diff --git a/.venv/share/jupyter/lab/static/7371.63b12ce793df713ab95b.js b/.venv/share/jupyter/lab/static/7371.63b12ce793df713ab95b.js new file mode 100644 index 0000000000000000000000000000000000000000..7fbf0e2e4d0d76b5b97623ea9790e5ac25327ad1 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7371.63b12ce793df713ab95b.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7371],{26527:function(t,e,r){(function e(i,n){if(true)t.exports=n(r(41709));else{}})(this,(function(t){return(()=>{"use strict";var e={658:t=>{t.exports=Object.assign!=null?Object.assign.bind(Object):function(t){for(var e=arguments.length,r=Array(e>1?e-1:0),i=1;i{var i=function(){function t(t,e){var r=[];var i=true;var n=false;var o=undefined;try{for(var a=t[Symbol.iterator](),s;!(i=(s=a.next()).done);i=true){r.push(s.value);if(e&&r.length===e)break}}catch(h){n=true;o=h}finally{try{if(!i&&a["return"])a["return"]()}finally{if(n)throw o}}return r}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return t(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var n=r(140).layoutBase.LinkedList;var o={};o.getTopMostNodes=function(t){var e={};for(var r=0;r0){l.merge(t)}}));for(var c=0;c1){l=s[0];c=l.connectedEdges().length;s.forEach((function(t){if(t.connectedEdges().length0){i.set("dummy"+(i.size+1),g)}}return u};o.relocateComponent=function(t,e,r){if(!r.fixedNodeConstraint){var n=Number.POSITIVE_INFINITY;var o=Number.NEGATIVE_INFINITY;var a=Number.POSITIVE_INFINITY;var s=Number.NEGATIVE_INFINITY;if(r.quality=="draft"){var h=true;var l=false;var c=undefined;try{for(var d=e.nodeIndexes[Symbol.iterator](),f;!(h=(f=d.next()).done);h=true){var g=f.value;var u=i(g,2);var p=u[0];var v=u[1];var y=r.cy.getElementById(p);if(y){var m=y.boundingBox();var E=e.xCoords[v]-m.w/2;var N=e.xCoords[v]+m.w/2;var T=e.yCoords[v]-m.h/2;var A=e.yCoords[v]+m.h/2;if(Eo)o=N;if(Ts)s=A}}}catch(C){l=true;c=C}finally{try{if(!h&&d.return){d.return()}}finally{if(l){throw c}}}var w=t.x-(o+n)/2;var L=t.y-(s+a)/2;e.xCoords=e.xCoords.map((function(t){return t+w}));e.yCoords=e.yCoords.map((function(t){return t+L}))}else{Object.keys(e).forEach((function(t){var r=e[t];var i=r.getRect().x;var h=r.getRect().x+r.getRect().width;var l=r.getRect().y;var c=r.getRect().y+r.getRect().height;if(io)o=h;if(ls)s=c}));var I=t.x-(o+n)/2;var _=t.y-(s+a)/2;Object.keys(e).forEach((function(t){var r=e[t];r.setCenter(r.getCenterX()+I,r.getCenterY()+_)}))}}};o.calcBoundingBox=function(t,e,r,i){var n=Number.MAX_SAFE_INTEGER;var o=Number.MIN_SAFE_INTEGER;var a=Number.MAX_SAFE_INTEGER;var s=Number.MIN_SAFE_INTEGER;var h=void 0;var l=void 0;var c=void 0;var d=void 0;var f=t.descendants().not(":parent");var g=f.length;for(var u=0;uh){n=h}if(oc){a=c}if(s{var i=r(548);var n=r(140).CoSELayout;var o=r(140).CoSENode;var a=r(140).layoutBase.PointD;var s=r(140).layoutBase.DimensionD;var h=r(140).layoutBase.LayoutConstants;var l=r(140).layoutBase.FDLayoutConstants;var c=r(140).CoSEConstants;var d=function t(e,r){var d=e.cy;var f=e.eles;var g=f.nodes();var u=f.edges();var p=void 0;var v=void 0;var y=void 0;var m={};if(e.randomize){p=r["nodeIndexes"];v=r["xCoords"];y=r["yCoords"]}var E=function t(e){return typeof e==="function"};var N=function t(e,r){if(E(e)){return e(r)}else{return e}};var T=i.calcParentsWithoutChildren(d,f);var A=function t(e,r,n,h){var l=r.length;for(var c=0;c0){var A=void 0;A=n.getGraphManager().add(n.newGraph(),g);t(A,f,n,h)}}};var w=function t(r,i,n){var o=0;var a=0;for(var s=0;s0)c.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=o/a;else if(!E(e.idealEdgeLength))c.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=e.idealEdgeLength;else c.DEFAULT_EDGE_LENGTH=l.DEFAULT_EDGE_LENGTH=50;c.MIN_REPULSION_DIST=l.MIN_REPULSION_DIST=l.DEFAULT_EDGE_LENGTH/10;c.DEFAULT_RADIAL_SEPARATION=l.DEFAULT_EDGE_LENGTH}};var L=function t(e,r){if(r.fixedNodeConstraint){e.constraints["fixedNodeConstraint"]=r.fixedNodeConstraint}if(r.alignmentConstraint){e.constraints["alignmentConstraint"]=r.alignmentConstraint}if(r.relativePlacementConstraint){e.constraints["relativePlacementConstraint"]=r.relativePlacementConstraint}};if(e.nestingFactor!=null)c.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=l.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=e.nestingFactor;if(e.gravity!=null)c.DEFAULT_GRAVITY_STRENGTH=l.DEFAULT_GRAVITY_STRENGTH=e.gravity;if(e.numIter!=null)c.MAX_ITERATIONS=l.MAX_ITERATIONS=e.numIter;if(e.gravityRange!=null)c.DEFAULT_GRAVITY_RANGE_FACTOR=l.DEFAULT_GRAVITY_RANGE_FACTOR=e.gravityRange;if(e.gravityCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_STRENGTH=l.DEFAULT_COMPOUND_GRAVITY_STRENGTH=e.gravityCompound;if(e.gravityRangeCompound!=null)c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=l.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=e.gravityRangeCompound;if(e.initialEnergyOnIncremental!=null)c.DEFAULT_COOLING_FACTOR_INCREMENTAL=l.DEFAULT_COOLING_FACTOR_INCREMENTAL=e.initialEnergyOnIncremental;if(e.tilingCompareBy!=null)c.TILING_COMPARE_BY=e.tilingCompareBy;if(e.quality=="proof")h.QUALITY=2;else h.QUALITY=0;c.NODE_DIMENSIONS_INCLUDE_LABELS=l.NODE_DIMENSIONS_INCLUDE_LABELS=h.NODE_DIMENSIONS_INCLUDE_LABELS=e.nodeDimensionsIncludeLabels;c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=!e.randomize;c.ANIMATE=l.ANIMATE=h.ANIMATE=e.animate;c.TILE=e.tile;c.TILING_PADDING_VERTICAL=typeof e.tilingPaddingVertical==="function"?e.tilingPaddingVertical.call():e.tilingPaddingVertical;c.TILING_PADDING_HORIZONTAL=typeof e.tilingPaddingHorizontal==="function"?e.tilingPaddingHorizontal.call():e.tilingPaddingHorizontal;c.DEFAULT_INCREMENTAL=l.DEFAULT_INCREMENTAL=h.DEFAULT_INCREMENTAL=true;c.PURE_INCREMENTAL=!e.randomize;h.DEFAULT_UNIFORM_LEAF_NODE_SIZES=e.uniformNodeDimensions;if(e.step=="transformed"){c.TRANSFORM_ON_CONSTRAINT_HANDLING=true;c.ENFORCE_CONSTRAINTS=false;c.APPLY_LAYOUT=false}if(e.step=="enforced"){c.TRANSFORM_ON_CONSTRAINT_HANDLING=false;c.ENFORCE_CONSTRAINTS=true;c.APPLY_LAYOUT=false}if(e.step=="cose"){c.TRANSFORM_ON_CONSTRAINT_HANDLING=false;c.ENFORCE_CONSTRAINTS=false;c.APPLY_LAYOUT=true}if(e.step=="all"){if(e.randomize)c.TRANSFORM_ON_CONSTRAINT_HANDLING=true;else c.TRANSFORM_ON_CONSTRAINT_HANDLING=false;c.ENFORCE_CONSTRAINTS=true;c.APPLY_LAYOUT=true}if(e.fixedNodeConstraint||e.alignmentConstraint||e.relativePlacementConstraint){c.TREE_REDUCTION_ON_INCREMENTAL=false}else{c.TREE_REDUCTION_ON_INCREMENTAL=true}var t=new n;var I=t.newGraphManager();A(I.addRoot(),i.getTopMostNodes(g),t,e);w(t,I,u);L(t,e);t.runLayout();return m};t.exports={coseLayout:d}},212:(t,e,r)=>{var i=function(){function t(t,e){for(var r=0;r0){if(!v){var y=r.eles.boundingBox();g.push({x:y.x1+y.w/2,y:y.y1+y.h/2});if(r.randomize){var m=h(r);o.push(m)}if(r.quality=="default"||r.quality=="proof"){d.push(c(r,o[0]));a.relocateComponent(g[0],d[0],r)}else{a.relocateComponent(g[0],o[0],r)}}else{var E=a.getTopMostNodes(r.eles.nodes());f=a.connectComponents(i,r.eles,E);f.forEach((function(t){var e=t.boundingBox();g.push({x:e.x1+e.w/2,y:e.y1+e.h/2})}));if(r.randomize){f.forEach((function(t){r.eles=t;o.push(h(r))}))}if(r.quality=="default"||r.quality=="proof"){var N=i.collection();if(r.tile){var T=new Map;var A=[];var w=[];var L=0;var I={nodeIndexes:T,xCoords:A,yCoords:w};var _=[];f.forEach((function(t,e){if(t.edges().length==0){t.nodes().forEach((function(e,r){N.merge(t.nodes()[r]);if(!e.isParent()){I.nodeIndexes.set(t.nodes()[r].id(),L++);I.xCoords.push(t.nodes()[0].position().x);I.yCoords.push(t.nodes()[0].position().y)}}));_.push(e)}}));if(N.length>1){var C=N.boundingBox();g.push({x:C.x1+C.w/2,y:C.y1+C.h/2});f.push(N);o.push(I);for(var M=_.length-1;M>=0;M--){f.splice(_[M],1);o.splice(_[M],1);g.splice(_[M],1)}}}f.forEach((function(t,e){r.eles=t;d.push(c(r,o[e]));a.relocateComponent(g[e],d[e],r)}))}else{f.forEach((function(t,e){a.relocateComponent(g[e],o[e],r)}))}var x=new Set;if(f.length>1){var O=[];var D=n.filter((function(t){return t.css("display")=="none"}));f.forEach((function(t,e){var i=void 0;if(r.quality=="draft"){i=o[e].nodeIndexes}if(t.nodes().not(D).length>0){var n={};n.edges=[];n.nodes=[];var s=void 0;t.nodes().not(D).forEach((function(t){if(r.quality=="draft"){if(!t.isParent()){s=i.get(t.id());n.nodes.push({x:o[e].xCoords[s]-t.boundingbox().w/2,y:o[e].yCoords[s]-t.boundingbox().h/2,width:t.boundingbox().w,height:t.boundingbox().h})}else{var h=a.calcBoundingBox(t,o[e].xCoords,o[e].yCoords,i);n.nodes.push({x:h.topLeftX,y:h.topLeftY,width:h.width,height:h.height})}}else{if(d[e][t.id()]){n.nodes.push({x:d[e][t.id()].getLeft(),y:d[e][t.id()].getTop(),width:d[e][t.id()].getWidth(),height:d[e][t.id()].getHeight()})}}}));t.edges().forEach((function(t){var s=t.source();var h=t.target();if(s.css("display")!="none"&&h.css("display")!="none"){if(r.quality=="draft"){var l=i.get(s.id());var c=i.get(h.id());var f=[];var g=[];if(s.isParent()){var u=a.calcBoundingBox(s,o[e].xCoords,o[e].yCoords,i);f.push(u.topLeftX+u.width/2);f.push(u.topLeftY+u.height/2)}else{f.push(o[e].xCoords[l]);f.push(o[e].yCoords[l])}if(h.isParent()){var p=a.calcBoundingBox(h,o[e].xCoords,o[e].yCoords,i);g.push(p.topLeftX+p.width/2);g.push(p.topLeftY+p.height/2)}else{g.push(o[e].xCoords[c]);g.push(o[e].yCoords[c])}n.edges.push({startX:f[0],startY:f[1],endX:g[0],endY:g[1]})}else{if(d[e][s.id()]&&d[e][h.id()]){n.edges.push({startX:d[e][s.id()].getCenterX(),startY:d[e][s.id()].getCenterY(),endX:d[e][h.id()].getCenterX(),endY:d[e][h.id()].getCenterY()})}}}}));if(n.nodes.length>0){O.push(n);x.add(e)}}}));var R=p.packComponents(O,r.randomize).shifts;if(r.quality=="draft"){o.forEach((function(t,e){var r=t.xCoords.map((function(t){return t+R[e].dx}));var i=t.yCoords.map((function(t){return t+R[e].dy}));t.xCoords=r;t.yCoords=i}))}else{var b=0;x.forEach((function(t){Object.keys(d[t]).forEach((function(e){var r=d[t][e];r.setCenter(r.getCenterX()+R[b].dx,r.getCenterY()+R[b].dy)}));b++}))}}}}var G=function t(e,i){if(r.quality=="default"||r.quality=="proof"){if(typeof e==="number"){e=i}var n=void 0;var a=void 0;var s=e.data("id");d.forEach((function(t){if(s in t){n={x:t[s].getRect().getCenterX(),y:t[s].getRect().getCenterY()};a=t[s]}}));if(r.nodeDimensionsIncludeLabels){if(a.labelWidth){if(a.labelPosHorizontal=="left"){n.x+=a.labelWidth/2}else if(a.labelPosHorizontal=="right"){n.x-=a.labelWidth/2}}if(a.labelHeight){if(a.labelPosVertical=="top"){n.y+=a.labelHeight/2}else if(a.labelPosVertical=="bottom"){n.y-=a.labelHeight/2}}}if(n==undefined)n={x:e.position("x"),y:e.position("y")};return{x:n.x,y:n.y}}else{var h=void 0;o.forEach((function(t){var r=t.nodeIndexes.get(e.id());if(r!=undefined){h={x:t.xCoords[r],y:t.yCoords[r]}}}));if(h==undefined)h={x:e.position("x"),y:e.position("y")};return{x:h.x,y:h.y}}};if(r.quality=="default"||r.quality=="proof"||r.randomize){var F=a.calcParentsWithoutChildren(i,n);var S=n.filter((function(t){return t.css("display")=="none"}));r.eles=n.not(S);n.nodes().not(":parent").not(S).layoutPositions(e,r,G);if(F.length>0){F.forEach((function(t){t.position(G(t))}))}}else{console.log("If randomize option is set to false, then quality option must be 'default' or 'proof'.")}}}]);return t}();t.exports=f},657:(t,e,r)=>{var i=r(548);var n=r(140).layoutBase.Matrix;var o=r(140).layoutBase.SVD;var a=function t(e){var r=e.cy;var a=e.eles;var s=a.nodes();var h=a.nodes(":parent");var l=new Map;var c=new Map;var d=new Map;var f=[];var g=[];var u=[];var p=[];var v=[];var y=[];var m=[];var E=[];var N=void 0;var T=void 0;var A=1e8;var w=1e-9;var L=e.piTol;var I=e.samplingType;var _=e.nodeSeparation;var C=void 0;var M=function t(){var e=0;var r=0;var i=false;while(r=o){s=n[o++];var p=f[s];for(var m=0;md){d=v[N];g=N}}}return g};var O=function t(e){var r=void 0;if(!e){M();for(var i=0;i=1){break}d=c}for(var v=0;v=1){break}d=c}for(var N=0;N0){if(r.isParent())f[e].push(d.get(r.id()));else f[e].push(r.id())}}))}));var X=function t(e){var i=c.get(e);var n=void 0;l.get(e).forEach((function(t){if(r.getElementById(t).isParent())n=d.get(t);else n=t;f[i].push(n);f[c.get(n)].push(e)}))};var z=true;var V=false;var B=undefined;try{for(var W=l.keys()[Symbol.iterator](),j;!(z=(j=W.next()).done);z=true){var q=j.value;X(q)}}catch(nt){V=true;B=nt}finally{try{if(!z&&W.return){W.return()}}finally{if(V){throw B}}}T=c.size;var $=void 0;if(T>2){C=T{var i=r(212);var n=function t(e){if(!e){return}e("layout","fcose",i)};if(typeof cytoscape!=="undefined"){n(cytoscape)}t.exports=n},140:e=>{e.exports=t}};var r={};function i(t){var n=r[t];if(n!==undefined){return n.exports}var o=r[t]={exports:{}};e[t](o,o.exports,i);return o.exports}var n=i(579);return n})()}))},41709:function(t,e,r){(function e(i,n){if(true)t.exports=n(r(1917));else{}})(this,(function(t){return(()=>{"use strict";var e={45:(t,e,r)=>{var i={};i.layoutBase=r(551);i.CoSEConstants=r(806);i.CoSEEdge=r(767);i.CoSEGraph=r(880);i.CoSEGraphManager=r(578);i.CoSELayout=r(765);i.CoSENode=r(991);i.ConstraintHandler=r(902);t.exports=i},806:(t,e,r)=>{var i=r(551).FDLayoutConstants;function n(){}for(var o in i){n[o]=i[o]}n.DEFAULT_USE_MULTI_LEVEL_SCALING=false;n.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH;n.DEFAULT_COMPONENT_SEPERATION=60;n.TILE=true;n.TILING_PADDING_VERTICAL=10;n.TILING_PADDING_HORIZONTAL=10;n.TRANSFORM_ON_CONSTRAINT_HANDLING=true;n.ENFORCE_CONSTRAINTS=true;n.APPLY_LAYOUT=true;n.RELAX_MOVEMENT_ON_CONSTRAINTS=true;n.TREE_REDUCTION_ON_INCREMENTAL=true;n.PURE_INCREMENTAL=n.DEFAULT_INCREMENTAL;t.exports=n},767:(t,e,r)=>{var i=r(551).FDLayoutEdge;function n(t,e,r){i.call(this,t,e,r)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},880:(t,e,r)=>{var i=r(551).LGraph;function n(t,e,r){i.call(this,t,e,r)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},578:(t,e,r)=>{var i=r(551).LGraphManager;function n(t){i.call(this,t)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},765:(t,e,r)=>{var i=r(551).FDLayout;var n=r(578);var o=r(880);var a=r(991);var s=r(767);var h=r(806);var l=r(902);var c=r(551).FDLayoutConstants;var d=r(551).LayoutConstants;var f=r(551).Point;var g=r(551).PointD;var u=r(551).DimensionD;var p=r(551).Layout;var v=r(551).Integer;var y=r(551).IGeometry;var m=r(551).LGraph;var E=r(551).Transform;var N=r(551).LinkedList;function T(){i.call(this);this.toBeTiled={};this.constraints={}}T.prototype=Object.create(i.prototype);for(var A in i){T[A]=i[A]}T.prototype.newGraphManager=function(){var t=new n(this);this.graphManager=t;return t};T.prototype.newGraph=function(t){return new o(null,this.graphManager,t)};T.prototype.newNode=function(t){return new a(this.graphManager,t)};T.prototype.newEdge=function(t){return new s(null,null,t)};T.prototype.initParameters=function(){i.prototype.initParameters.call(this,arguments);if(!this.isSubLayout){if(h.DEFAULT_EDGE_LENGTH<10){this.idealEdgeLength=10}else{this.idealEdgeLength=h.DEFAULT_EDGE_LENGTH}this.useSmartIdealEdgeLengthCalculation=h.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION;this.gravityConstant=c.DEFAULT_GRAVITY_STRENGTH;this.compoundGravityConstant=c.DEFAULT_COMPOUND_GRAVITY_STRENGTH;this.gravityRangeFactor=c.DEFAULT_GRAVITY_RANGE_FACTOR;this.compoundGravityRangeFactor=c.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR;this.prunedNodesAll=[];this.growTreeIterations=0;this.afterGrowthIterations=0;this.isTreeGrowing=false;this.isGrowthFinished=false}};T.prototype.initSpringEmbedder=function(){i.prototype.initSpringEmbedder.call(this);this.coolingCycle=0;this.maxCoolingCycle=this.maxIterations/c.CONVERGENCE_CHECK_PERIOD;this.finalTemperature=.04;this.coolingAdjuster=1};T.prototype.layout=function(){var t=d.DEFAULT_CREATE_BENDS_AS_NEEDED;if(t){this.createBendpoints();this.graphManager.resetAllEdges()}this.level=0;return this.classicLayout()};T.prototype.classicLayout=function(){this.nodesWithGravity=this.calculateNodesToApplyGravitationTo();this.graphManager.setAllNodesToApplyGravitation(this.nodesWithGravity);this.calcNoOfChildrenForAllNodes();this.graphManager.calcLowestCommonAncestors();this.graphManager.calcInclusionTreeDepths();this.graphManager.getRoot().calcEstimatedSize();this.calcIdealEdgeLengths();if(!this.incremental){var t=this.getFlatForest();if(t.length>0){this.positionNodesRadially(t)}else{this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes());var r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r);this.positionNodesRandomly()}}else{if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes());var r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r)}}if(Object.keys(this.constraints).length>0){l.handleConstraints(this);this.initConstraintVariables()}this.initSpringEmbedder();if(h.APPLY_LAYOUT){this.runSpringEmbedder()}return true};T.prototype.tick=function(){this.totalIterations++;if(this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}if(this.totalIterations%c.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}this.coolingCycle++;if(this.layoutQuality==0){this.coolingAdjuster=this.coolingCycle}else if(this.layoutQuality==1){this.coolingAdjuster=this.coolingCycle/3}this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature);this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0){if(this.prunedNodesAll.length>0){this.graphManager.updateBounds();this.updateGrid();this.growTree(this.prunedNodesAll);this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes());var e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e);this.graphManager.updateBounds();this.updateGrid();if(h.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2;else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL}else{this.isTreeGrowing=false;this.isGrowthFinished=true}}this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged()){return true}if(this.afterGrowthIterations%10==0){this.graphManager.updateBounds();this.updateGrid()}if(h.PURE_INCREMENTAL)this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL/2*((100-this.afterGrowthIterations)/100);else this.coolingFactor=c.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished;var i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;this.totalDisplacement=0;this.graphManager.updateBounds();this.calcSpringForces();this.calcRepulsionForces(r,i);this.calcGravitationalForces();this.moveNodes();this.animate();return false};T.prototype.getPositionsData=function(){var t=this.graphManager.getAllNodes();var e={};for(var r=0;r0){this.updateDisplacements()}for(var r=0;r0){i.fixedNodeWeight=o}}}}if(this.constraints.relativePlacementConstraint){var a=new Map;var s=new Map;this.dummyToNodeForVerticalAlignment=new Map;this.dummyToNodeForHorizontalAlignment=new Map;this.fixedNodesOnHorizontal=new Set;this.fixedNodesOnVertical=new Set;this.fixedNodeSet.forEach((function(e){t.fixedNodesOnHorizontal.add(e);t.fixedNodesOnVertical.add(e)}));if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var l=this.constraints.alignmentConstraint.vertical;for(var r=0;r=2*t.length/3;i--){e=Math.floor(Math.random()*(i+1));r=t[i];t[i]=t[e];t[e]=r}return t};this.nodesInRelativeHorizontal=[];this.nodesInRelativeVertical=[];this.nodeToRelativeConstraintMapHorizontal=new Map;this.nodeToRelativeConstraintMapVertical=new Map;this.nodeToTempPositionMapHorizontal=new Map;this.nodeToTempPositionMapVertical=new Map;this.constraints.relativePlacementConstraint.forEach((function(e){if(e.left){var r=a.has(e.left)?a.get(e.left):e.left;var i=a.has(e.right)?a.get(e.right):e.right;if(!t.nodesInRelativeHorizontal.includes(r)){t.nodesInRelativeHorizontal.push(r);t.nodeToRelativeConstraintMapHorizontal.set(r,[]);if(t.dummyToNodeForVerticalAlignment.has(r)){t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(r)[0]).getCenterX())}else{t.nodeToTempPositionMapHorizontal.set(r,t.idToNodeMap.get(r).getCenterX())}}if(!t.nodesInRelativeHorizontal.includes(i)){t.nodesInRelativeHorizontal.push(i);t.nodeToRelativeConstraintMapHorizontal.set(i,[]);if(t.dummyToNodeForVerticalAlignment.has(i)){t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(t.dummyToNodeForVerticalAlignment.get(i)[0]).getCenterX())}else{t.nodeToTempPositionMapHorizontal.set(i,t.idToNodeMap.get(i).getCenterX())}}t.nodeToRelativeConstraintMapHorizontal.get(r).push({right:i,gap:e.gap});t.nodeToRelativeConstraintMapHorizontal.get(i).push({left:r,gap:e.gap})}else{var n=s.has(e.top)?s.get(e.top):e.top;var o=s.has(e.bottom)?s.get(e.bottom):e.bottom;if(!t.nodesInRelativeVertical.includes(n)){t.nodesInRelativeVertical.push(n);t.nodeToRelativeConstraintMapVertical.set(n,[]);if(t.dummyToNodeForHorizontalAlignment.has(n)){t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(n)[0]).getCenterY())}else{t.nodeToTempPositionMapVertical.set(n,t.idToNodeMap.get(n).getCenterY())}}if(!t.nodesInRelativeVertical.includes(o)){t.nodesInRelativeVertical.push(o);t.nodeToRelativeConstraintMapVertical.set(o,[]);if(t.dummyToNodeForHorizontalAlignment.has(o)){t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(t.dummyToNodeForHorizontalAlignment.get(o)[0]).getCenterY())}else{t.nodeToTempPositionMapVertical.set(o,t.idToNodeMap.get(o).getCenterY())}}t.nodeToRelativeConstraintMapVertical.get(n).push({bottom:o,gap:e.gap});t.nodeToRelativeConstraintMapVertical.get(o).push({top:n,gap:e.gap})}}))}else{var d=new Map;var f=new Map;this.constraints.relativePlacementConstraint.forEach((function(t){if(t.left){var e=a.has(t.left)?a.get(t.left):t.left;var r=a.has(t.right)?a.get(t.right):t.right;if(d.has(e)){d.get(e).push(r)}else{d.set(e,[r])}if(d.has(r)){d.get(r).push(e)}else{d.set(r,[e])}}else{var i=s.has(t.top)?s.get(t.top):t.top;var n=s.has(t.bottom)?s.get(t.bottom):t.bottom;if(f.has(i)){f.get(i).push(n)}else{f.set(i,[n])}if(f.has(n)){f.get(n).push(i)}else{f.set(n,[i])}}}));var g=function t(e,r){var i=[];var n=[];var o=new N;var a=new Set;var s=0;e.forEach((function(t,h){if(!a.has(h)){i[s]=[];n[s]=false;var l=h;o.push(l);a.add(l);i[s].push(l);while(o.length!=0){l=o.shift();if(r.has(l)){n[s]=true}var c=e.get(l);c.forEach((function(t){if(!a.has(t)){o.push(t);a.add(t);i[s].push(t)}}))}s++}}));return{components:i,isFixed:n}};var u=g(d,t.fixedNodesOnHorizontal);this.componentsOnHorizontal=u.components;this.fixedComponentsOnHorizontal=u.isFixed;var p=g(f,t.fixedNodesOnVertical);this.componentsOnVertical=p.components;this.fixedComponentsOnVertical=p.isFixed}}};T.prototype.updateDisplacements=function(){var t=this;if(this.constraints.fixedNodeConstraint){this.constraints.fixedNodeConstraint.forEach((function(e){var r=t.idToNodeMap.get(e.nodeId);r.displacementX=0;r.displacementY=0}))}if(this.constraints.alignmentConstraint){if(this.constraints.alignmentConstraint.vertical){var e=this.constraints.alignmentConstraint.vertical;for(var r=0;r1){var s;for(s=0;si){i=Math.floor(a.y)}o=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(d.WORLD_CENTER_X-a.x/2,d.WORLD_CENTER_Y-a.y/2))};T.radialLayout=function(t,e,r){var i=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);T.branchRadialLayout(e,null,0,359,0,i);var n=m.calculateBounds(t);var o=new E;o.setDeviceOrgX(n.getMinX());o.setDeviceOrgY(n.getMinY());o.setWorldOrgX(r.x);o.setWorldOrgY(r.y);for(var a=0;a1){var E=m[0];m.splice(0,1);var N=f.indexOf(E);if(N>=0){f.splice(N,1)}p--;g--}if(e!=null){v=(f.indexOf(m[0])+1)%p}else{v=0}var A=Math.abs(i-r)/g;for(var w=v;u!=g;w=++w%p){var L=f[w].getOtherEnd(t);if(L==e){continue}var I=(r+u*A)%360;var _=(I+A)%360;T.branchRadialLayout(L,t,I,_,n+o,o);u++}};T.maxDiagonalInTree=function(t){var e=v.MIN_VALUE;for(var r=0;re){e=n}}return e};T.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength};T.prototype.groupZeroDegreeMembers=function(){var t=this;var e={};this.memberGroups={};this.idToDummyNode={};var r=[];var i=this.graphManager.getAllNodes();for(var n=0;n1){var i="DummyCompound_"+r;t.memberGroups[i]=e[r];var n=e[r][0].getParent();var o=new a(t.graphManager);o.id=i;o.paddingLeft=n.paddingLeft||0;o.paddingRight=n.paddingRight||0;o.paddingBottom=n.paddingBottom||0;o.paddingTop=n.paddingTop||0;t.idToDummyNode[i]=o;var s=t.getGraphManager().add(t.newGraph(),o);var h=n.getChild();h.add(o);for(var l=0;ln){i.rect.x-=(i.labelWidth-n)/2;i.setWidth(i.labelWidth);i.labelMarginLeft=(i.labelWidth-n)/2}else if(i.labelPosHorizontal=="right"){i.setWidth(n+i.labelWidth)}}if(i.labelHeight){if(i.labelPosVertical=="top"){i.rect.y-=i.labelHeight;i.setHeight(o+i.labelHeight);i.labelMarginTop=i.labelHeight}else if(i.labelPosVertical=="center"&&i.labelHeight>o){i.rect.y-=(i.labelHeight-o)/2;i.setHeight(i.labelHeight);i.labelMarginTop=(i.labelHeight-o)/2}else if(i.labelPosVertical=="bottom"){i.setHeight(o+i.labelHeight)}}}}))};T.prototype.repopulateCompounds=function(){for(var t=this.compoundOrder.length-1;t>=0;t--){var e=this.compoundOrder[t];var r=e.id;var i=e.paddingLeft;var n=e.paddingTop;var o=e.labelMarginLeft;var a=e.labelMarginTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,i,n,o,a)}};T.prototype.repopulateZeroDegreeMembers=function(){var t=this;var e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var i=t.idToDummyNode[r];var n=i.paddingLeft;var o=i.paddingTop;var a=i.labelMarginLeft;var s=i.labelMarginTop;t.adjustLocations(e[r],i.rect.x,i.rect.y,n,o,a,s)}))};T.prototype.getToBeTiled=function(t){var e=t.id;if(this.toBeTiled[e]!=null){return this.toBeTiled[e]}var r=t.getChild();if(r==null){this.toBeTiled[e]=false;return false}var i=r.getNodes();for(var n=0;n0){this.toBeTiled[e]=false;return false}if(o.getChild()==null){this.toBeTiled[o.id]=false;continue}if(!this.getToBeTiled(o)){this.toBeTiled[e]=false;return false}}this.toBeTiled[e]=true;return true};T.prototype.getNodeDegree=function(t){var e=t.id;var r=t.getEdges();var i=0;for(var n=0;nc)c=f.rect.height}r+=c+t.verticalPadding}};T.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[];Object.keys(t).forEach((function(i){var n=e[i];r.tiledMemberPack[i]=r.tileNodes(t[i],n.paddingLeft+n.paddingRight);n.rect.width=r.tiledMemberPack[i].width;n.rect.height=r.tiledMemberPack[i].height;n.setCenter(r.tiledMemberPack[i].centerX,r.tiledMemberPack[i].centerY);n.labelMarginLeft=0;n.labelMarginTop=0;if(h.NODE_DIMENSIONS_INCLUDE_LABELS){var o=n.rect.width;var a=n.rect.height;if(n.labelWidth){if(n.labelPosHorizontal=="left"){n.rect.x-=n.labelWidth;n.setWidth(o+n.labelWidth);n.labelMarginLeft=n.labelWidth}else if(n.labelPosHorizontal=="center"&&n.labelWidth>o){n.rect.x-=(n.labelWidth-o)/2;n.setWidth(n.labelWidth);n.labelMarginLeft=(n.labelWidth-o)/2}else if(n.labelPosHorizontal=="right"){n.setWidth(o+n.labelWidth)}}if(n.labelHeight){if(n.labelPosVertical=="top"){n.rect.y-=n.labelHeight;n.setHeight(a+n.labelHeight);n.labelMarginTop=n.labelHeight}else if(n.labelPosVertical=="center"&&n.labelHeight>a){n.rect.y-=(n.labelHeight-a)/2;n.setHeight(n.labelHeight);n.labelMarginTop=(n.labelHeight-a)/2}else if(n.labelPosVertical=="bottom"){n.setHeight(a+n.labelHeight)}}}}))};T.prototype.tileNodes=function(t,e){var r=this.tileNodesByFavoringDim(t,e,true);var i=this.tileNodesByFavoringDim(t,e,false);var n=this.getOrgRatio(r);var o=this.getOrgRatio(i);var a;if(os){s=t.getWidth()}}));var l=o/n;var c=a/n;var d=Math.pow(r-i,2)+4*(l+i)*(c+r)*n;var f=(i-r+Math.sqrt(d))/(2*(l+i));var g;if(e){g=Math.ceil(f);if(g==f){g++}}else{g=Math.floor(f)}var u=g*(l+i)-i;if(s>u){u=s}u+=i*2;return u};T.prototype.tileNodesByFavoringDim=function(t,e,r){var i=h.TILING_PADDING_VERTICAL;var n=h.TILING_PADDING_HORIZONTAL;var o=h.TILING_COMPARE_BY;var a={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:i,horizontalPadding:n,centerX:0,centerY:0};if(o){a.idealRowWidth=this.calcIdealRowWidth(t,r)}var s=function t(e){return e.rect.width*e.rect.height};var l=function t(e,r){return s(r)-s(e)};t.sort((function(t,e){var r=l;if(a.idealRowWidth){r=o;return r(t.id,e.id)}return r(t,e)}));var c=0;var d=0;for(var f=0;f0){a+=t.horizontalPadding}t.rowWidth[r]=a;if(t.width0)s+=t.verticalPadding;var h=0;if(s>t.rowHeight[r]){h=t.rowHeight[r];t.rowHeight[r]=s;h=t.rowHeight[r]-h}t.height+=h;t.rows[r].push(e)};T.prototype.getShortestRowIndex=function(t){var e=-1;var r=Number.MAX_VALUE;for(var i=0;ir){e=i;r=t.rowWidth[i]}}return e};T.prototype.canAddHorizontal=function(t,e,r){if(t.idealRowWidth){var i=t.rows.length-1;var n=t.rowWidth[i];return n+e+t.horizontalPadding<=t.idealRowWidth}var o=this.getShortestRowIndex(t);if(o<0){return true}var a=t.rowWidth[o];if(a+t.horizontalPadding+e<=t.width)return true;var s=0;if(t.rowHeight[o]0)s=r+t.verticalPadding-t.rowHeight[o]}var h;if(t.width-a>=e+t.horizontalPadding){h=(t.height+s)/(a+e+t.horizontalPadding)}else{h=(t.height+s)/t.width}s=r+t.verticalPadding;var l;if(t.widtho&&e!=r){i.splice(-1,1);t.rows[r].push(n);t.rowWidth[e]=t.rowWidth[e]-o;t.rowWidth[r]=t.rowWidth[r]+o;t.width=t.rowWidth[instance.getLongestRowIndex(t)];var a=Number.MIN_VALUE;for(var s=0;sa)a=i[s].height}if(e>0)a+=t.verticalPadding;var h=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a;if(t.rowHeight[r]0){for(var p=n;p<=o;p++){u[0]+=this.grid[p][a-1].length+this.grid[p][a].length-1}}if(o0){for(var p=a;p<=s;p++){u[3]+=this.grid[n-1][p].length+this.grid[n][p].length-1}}var y=v.MAX_VALUE;var m;var E;for(var N=0;N{var i=r(551).FDLayoutNode;var n=r(551).IMath;function o(t,e,r,n){i.call(this,t,e,r,n)}o.prototype=Object.create(i.prototype);for(var a in i){o[a]=i[a]}o.prototype.calculateDisplacement=function(){var t=this.graphManager.getLayout();if(this.getChild()!=null&&this.fixedNodeWeight){this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.fixedNodeWeight;this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.fixedNodeWeight}else{this.displacementX+=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren;this.displacementY+=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren}if(Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement){this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)}if(Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement){this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)}if(this.child&&this.child.getNodes().length>0){this.propogateDisplacementToChildren(this.displacementX,this.displacementY)}};o.prototype.propogateDisplacementToChildren=function(t,e){var r=this.getChild().getNodes();var i;for(var n=0;n{function i(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);e0){var i=0;e.forEach((function(t){if(r=="horizontal"){g.set(t,h.has(t)?l[h.get(t)]:a.get(t));i+=g.get(t)}else{g.set(t,h.has(t)?c[h.get(t)]:a.get(t));i+=g.get(t)}}));i=i/e.length;t.forEach((function(t){if(!n.has(t)){g.set(t,i)}}))}else{var o=0;t.forEach((function(t){if(r=="horizontal"){o+=h.has(t)?l[h.get(t)]:a.get(t)}else{o+=h.has(t)?c[h.get(t)]:a.get(t)}}));o=o/t.length;t.forEach((function(t){g.set(t,o)}))}}))}var v=function t(){var i=p.shift();var o=e.get(i);o.forEach((function(t){if(g.get(t.id)o){o=m}if(Es){s=E}}}catch(C){f=true;u=C}finally{try{if(!d&&p.return){p.return()}}finally{if(f){throw u}}}var N=(i+o)/2-(n+s)/2;var T=true;var A=false;var w=undefined;try{for(var L=t[Symbol.iterator](),I;!(T=(I=L.next()).done);T=true){var _=I.value;g.set(_,g.get(_)+N)}}catch(C){A=true;w=C}finally{try{if(!T&&L.return){L.return()}}finally{if(A){throw w}}}}))}return g};var m=function t(e){var r=0,i=0;var n=0,o=0;e.forEach((function(t){if(t.left){l[h.get(t.left)]-l[h.get(t.right)]>=0?r++:i++}else{c[h.get(t.top)]-c[h.get(t.bottom)]>=0?n++:o++}}));if(r>i&&n>o){for(var a=0;ai){for(var s=0;so){for(var d=0;d1){e.fixedNodeConstraint.forEach((function(t,e){A[e]=[t.position.x,t.position.y];w[e]=[l[h.get(t.nodeId)],c[h.get(t.nodeId)]]}));L=true}else if(e.alignmentConstraint){(function(){var t=0;if(e.alignmentConstraint.vertical){var r=e.alignmentConstraint.vertical;var n=function e(n){var o=new Set;r[n].forEach((function(t){o.add(t)}));var a=new Set([].concat(i(o)).filter((function(t){return _.has(t)})));var s=void 0;if(a.size>0)s=l[h.get(a.values().next().value)];else s=v(o).x;r[n].forEach((function(e){A[t]=[s,c[h.get(e)]];w[t]=[l[h.get(e)],c[h.get(e)]];t++}))};for(var o=0;o0)s=l[h.get(o.values().next().value)];else s=v(n).y;a[r].forEach((function(e){A[t]=[l[h.get(e)],s];w[t]=[l[h.get(e)],c[h.get(e)]];t++}))};for(var d=0;dO){O=x[R].length;D=R}}if(O0){var q={x:0,y:0};e.fixedNodeConstraint.forEach((function(t,e){var r={x:l[h.get(t.nodeId)],y:c[h.get(t.nodeId)]};var i=t.position;var n=p(i,r);q.x+=n.x;q.y+=n.y}));q.x/=e.fixedNodeConstraint.length;q.y/=e.fixedNodeConstraint.length;l.forEach((function(t,e){l[e]+=q.x}));c.forEach((function(t,e){c[e]+=q.y}));e.fixedNodeConstraint.forEach((function(t){l[h.get(t.nodeId)]=t.position.x;c[h.get(t.nodeId)]=t.position.y}))}if(e.alignmentConstraint){if(e.alignmentConstraint.vertical){var $=e.alignmentConstraint.vertical;var K=function t(e){var r=new Set;$[e].forEach((function(t){r.add(t)}));var n=new Set([].concat(i(r)).filter((function(t){return _.has(t)})));var o=void 0;if(n.size>0)o=l[h.get(n.values().next().value)];else o=v(r).x;r.forEach((function(t){if(!_.has(t))l[h.get(t)]=o}))};for(var Z=0;Z<$.length;Z++){K(Z)}}if(e.alignmentConstraint.horizontal){var Q=e.alignmentConstraint.horizontal;var J=function t(e){var r=new Set;Q[e].forEach((function(t){r.add(t)}));var n=new Set([].concat(i(r)).filter((function(t){return _.has(t)})));var o=void 0;if(n.size>0)o=c[h.get(n.values().next().value)];else o=v(r).y;r.forEach((function(t){if(!_.has(t))c[h.get(t)]=o}))};for(var tt=0;tt{e.exports=t}};var r={};function i(t){var n=r[t];if(n!==undefined){return n.exports}var o=r[t]={exports:{}};e[t](o,o.exports,i);return o.exports}var n=i(45);return n})()}))},1917:function(t){(function e(r,i){if(true)t.exports=i();else{}})(this,(function(){return function(t){var e={};function r(i){if(e[i]){return e[i].exports}var n=e[i]={i,l:false,exports:{}};t[i].call(n.exports,n,n.exports,r);n.l=true;return n.exports}r.m=t;r.c=e;r.i=function(t){return t};r.d=function(t,e,i){if(!r.o(t,e)){Object.defineProperty(t,e,{configurable:false,enumerable:true,get:i})}};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};r.p="";return r(r.s=28)}([function(t,e,r){"use strict";function i(){}i.QUALITY=1;i.DEFAULT_CREATE_BENDS_AS_NEEDED=false;i.DEFAULT_INCREMENTAL=false;i.DEFAULT_ANIMATION_ON_LAYOUT=true;i.DEFAULT_ANIMATION_DURING_LAYOUT=false;i.DEFAULT_ANIMATION_PERIOD=50;i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=false;i.DEFAULT_GRAPH_MARGIN=15;i.NODE_DIMENSIONS_INCLUDE_LABELS=false;i.SIMPLE_NODE_SIZE=40;i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2;i.EMPTY_COMPOUND_NODE_SIZE=40;i.MIN_EDGE_LENGTH=1;i.WORLD_BOUNDARY=1e6;i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3;i.WORLD_CENTER_X=1200;i.WORLD_CENTER_Y=900;t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(8);var o=r(9);function a(t,e,r){i.call(this,r);this.isOverlapingSourceAndTarget=false;this.vGraphObject=r;this.bendpoints=[];this.source=t;this.target=e}a.prototype=Object.create(i.prototype);for(var s in i){a[s]=i[s]}a.prototype.getSource=function(){return this.source};a.prototype.getTarget=function(){return this.target};a.prototype.isInterGraph=function(){return this.isInterGraph};a.prototype.getLength=function(){return this.length};a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget};a.prototype.getBendpoints=function(){return this.bendpoints};a.prototype.getLca=function(){return this.lca};a.prototype.getSourceInLca=function(){return this.sourceInLca};a.prototype.getTargetInLca=function(){return this.targetInLca};a.prototype.getOtherEnd=function(t){if(this.source===t){return this.target}else if(this.target===t){return this.source}else{throw"Node is not incident with this edge"}};a.prototype.getOtherEndInGraph=function(t,e){var r=this.getOtherEnd(t);var i=e.getGraphManager().getRoot();while(true){if(r.getOwner()==e){return r}if(r.getOwner()==i){break}r=r.getOwner().getParent()}return null};a.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),t);if(!this.isOverlapingSourceAndTarget){this.lengthX=t[0]-t[2];this.lengthY=t[1]-t[3];if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}};a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX();this.lengthY=this.target.getCenterY()-this.source.getCenterY();if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)};t.exports=a},function(t,e,r){"use strict";function i(t){this.vGraphObject=t}t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(10);var o=r(13);var a=r(0);var s=r(16);var h=r(5);function l(t,e,r,a){if(r==null&&a==null){a=e}i.call(this,a);if(t.graphManager!=null)t=t.graphManager;this.estimatedSize=n.MIN_VALUE;this.inclusionTreeDepth=n.MAX_VALUE;this.vGraphObject=a;this.edges=[];this.graphManager=t;if(r!=null&&e!=null)this.rect=new o(e.x,e.y,r.width,r.height);else this.rect=new o}l.prototype=Object.create(i.prototype);for(var c in i){l[c]=i[c]}l.prototype.getEdges=function(){return this.edges};l.prototype.getChild=function(){return this.child};l.prototype.getOwner=function(){return this.owner};l.prototype.getWidth=function(){return this.rect.width};l.prototype.setWidth=function(t){this.rect.width=t};l.prototype.getHeight=function(){return this.rect.height};l.prototype.setHeight=function(t){this.rect.height=t};l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2};l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2};l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)};l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)};l.prototype.getRect=function(){return this.rect};l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)};l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2};l.prototype.setRect=function(t,e){this.rect.x=t.x;this.rect.y=t.y;this.rect.width=e.width;this.rect.height=e.height};l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2;this.rect.y=e-this.rect.height/2};l.prototype.setLocation=function(t,e){this.rect.x=t;this.rect.y=e};l.prototype.moveBy=function(t,e){this.rect.x+=t;this.rect.y+=e};l.prototype.getEdgeListToNode=function(t){var e=[];var r;var i=this;i.edges.forEach((function(r){if(r.target==t){if(r.source!=i)throw"Incorrect edge source!";e.push(r)}}));return e};l.prototype.getEdgesBetween=function(t){var e=[];var r;var i=this;i.edges.forEach((function(r){if(!(r.source==i||r.target==i))throw"Incorrect edge source and/or target";if(r.target==t||r.source==t){e.push(r)}}));return e};l.prototype.getNeighborsList=function(){var t=new Set;var e=this;e.edges.forEach((function(r){if(r.source==e){t.add(r.target)}else{if(r.target!=e){throw"Incorrect incidency!"}t.add(r.source)}}));return t};l.prototype.withChildren=function(){var t=new Set;var e;var r;t.add(this);if(this.child!=null){var i=this.child.getNodes();for(var n=0;ne){this.rect.x-=(this.labelWidth-e)/2;this.setWidth(this.labelWidth)}else if(this.labelPosHorizontal=="right"){this.setWidth(e+this.labelWidth)}}if(this.labelHeight){if(this.labelPosVertical=="top"){this.rect.y-=this.labelHeight;this.setHeight(r+this.labelHeight)}else if(this.labelPosVertical=="center"&&this.labelHeight>r){this.rect.y-=(this.labelHeight-r)/2;this.setHeight(this.labelHeight)}else if(this.labelPosVertical=="bottom"){this.setHeight(r+this.labelHeight)}}}}};l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE){throw"assert failed"}return this.inclusionTreeDepth};l.prototype.transform=function(t){var e=this.rect.x;if(e>a.WORLD_BOUNDARY){e=a.WORLD_BOUNDARY}else if(e<-a.WORLD_BOUNDARY){e=-a.WORLD_BOUNDARY}var r=this.rect.y;if(r>a.WORLD_BOUNDARY){r=a.WORLD_BOUNDARY}else if(r<-a.WORLD_BOUNDARY){r=-a.WORLD_BOUNDARY}var i=new h(e,r);var n=t.inverseTransformPoint(i);this.setLocation(n.x,n.y)};l.prototype.getLeft=function(){return this.rect.x};l.prototype.getRight=function(){return this.rect.x+this.rect.width};l.prototype.getTop=function(){return this.rect.y};l.prototype.getBottom=function(){return this.rect.y+this.rect.height};l.prototype.getParent=function(){if(this.owner==null){return null}return this.owner.getParent()};t.exports=l},function(t,e,r){"use strict";var i=r(0);function n(){}for(var o in i){n[o]=i[o]}n.MAX_ITERATIONS=2500;n.DEFAULT_EDGE_LENGTH=50;n.DEFAULT_SPRING_STRENGTH=.45;n.DEFAULT_REPULSION_STRENGTH=4500;n.DEFAULT_GRAVITY_STRENGTH=.4;n.DEFAULT_COMPOUND_GRAVITY_STRENGTH=1;n.DEFAULT_GRAVITY_RANGE_FACTOR=3.8;n.DEFAULT_COMPOUND_GRAVITY_RANGE_FACTOR=1.5;n.DEFAULT_USE_SMART_IDEAL_EDGE_LENGTH_CALCULATION=true;n.DEFAULT_USE_SMART_REPULSION_RANGE_CALCULATION=true;n.DEFAULT_COOLING_FACTOR_INCREMENTAL=.3;n.COOLING_ADAPTATION_FACTOR=.33;n.ADAPTATION_LOWER_NODE_LIMIT=1e3;n.ADAPTATION_UPPER_NODE_LIMIT=5e3;n.MAX_NODE_DISPLACEMENT_INCREMENTAL=100;n.MAX_NODE_DISPLACEMENT=n.MAX_NODE_DISPLACEMENT_INCREMENTAL*3;n.MIN_REPULSION_DIST=n.DEFAULT_EDGE_LENGTH/10;n.CONVERGENCE_CHECK_PERIOD=100;n.PER_LEVEL_IDEAL_EDGE_LENGTH_FACTOR=.1;n.MIN_EDGE_LENGTH=1;n.GRID_CALCULATION_CHECK_PERIOD=10;t.exports=n},function(t,e,r){"use strict";function i(t,e){if(t==null&&e==null){this.x=0;this.y=0}else{this.x=t;this.y=e}}i.prototype.getX=function(){return this.x};i.prototype.getY=function(){return this.y};i.prototype.setX=function(t){this.x=t};i.prototype.setY=function(t){this.y=t};i.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)};i.prototype.getCopy=function(){return new i(this.x,this.y)};i.prototype.translate=function(t){this.x+=t.width;this.y+=t.height;return this};t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(10);var o=r(0);var a=r(7);var s=r(3);var h=r(1);var l=r(13);var c=r(12);var d=r(11);function f(t,e,r){i.call(this,r);this.estimatedSize=n.MIN_VALUE;this.margin=o.DEFAULT_GRAPH_MARGIN;this.edges=[];this.nodes=[];this.isConnected=false;this.parent=t;if(e!=null&&e instanceof a){this.graphManager=e}else if(e!=null&&e instanceof Layout){this.graphManager=e.graphManager}}f.prototype=Object.create(i.prototype);for(var g in i){f[g]=i[g]}f.prototype.getNodes=function(){return this.nodes};f.prototype.getEdges=function(){return this.edges};f.prototype.getGraphManager=function(){return this.graphManager};f.prototype.getParent=function(){return this.parent};f.prototype.getLeft=function(){return this.left};f.prototype.getRight=function(){return this.right};f.prototype.getTop=function(){return this.top};f.prototype.getBottom=function(){return this.bottom};f.prototype.isConnected=function(){return this.isConnected};f.prototype.add=function(t,e,r){if(e==null&&r==null){var i=t;if(this.graphManager==null){throw"Graph has no graph mgr!"}if(this.getNodes().indexOf(i)>-1){throw"Node already in graph!"}i.owner=this;this.getNodes().push(i);return i}else{var n=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1)){throw"Source or target not in graph!"}if(!(e.owner==r.owner&&e.owner==this)){throw"Both owners must be this graph!"}if(e.owner!=r.owner){return null}n.source=e;n.target=r;n.isInterGraph=false;this.getEdges().push(n);e.edges.push(n);if(r!=e){r.edges.push(n)}return n}};f.prototype.remove=function(t){var e=t;if(t instanceof s){if(e==null){throw"Node is null!"}if(!(e.owner!=null&&e.owner==this)){throw"Owner graph is invalid!"}if(this.graphManager==null){throw"Owner graph manager is invalid!"}var r=e.edges.slice();var i;var n=r.length;for(var o=0;o-1&&c>-1)){throw"Source and/or target doesn't know this edge!"}i.source.edges.splice(l,1);if(i.target!=i.source){i.target.edges.splice(c,1)}var a=i.source.owner.getEdges().indexOf(i);if(a==-1){throw"Not in owner's edge list!"}i.source.owner.getEdges().splice(a,1)}};f.prototype.updateLeftTop=function(){var t=n.MAX_VALUE;var e=n.MAX_VALUE;var r;var i;var o;var a=this.getNodes();var s=a.length;for(var h=0;hr){t=r}if(e>i){e=i}}if(t==n.MAX_VALUE){return null}if(a[0].getParent().paddingLeft!=undefined){o=a[0].getParent().paddingLeft}else{o=this.margin}this.left=e-o;this.top=t-o;return new c(this.left,this.top)};f.prototype.updateBounds=function(t){var e=n.MAX_VALUE;var r=-n.MAX_VALUE;var i=n.MAX_VALUE;var o=-n.MAX_VALUE;var a;var s;var h;var c;var d;var f=this.nodes;var g=f.length;for(var u=0;ua){e=a}if(rh){i=h}if(oa){e=a}if(rh){i=h}if(o=this.nodes.length){var f=0;r.forEach((function(e){if(e.owner==t){f++}}));if(f==this.nodes.length){this.isConnected=true}}};t.exports=f},function(t,e,r){"use strict";var i;var n=r(1);function o(t){i=r(6);this.layout=t;this.graphs=[];this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph();var e=this.layout.newNode(null);var r=this.add(t,e);this.setRootGraph(r);return this.rootGraph};o.prototype.add=function(t,e,r,i,n){if(r==null&&i==null&&n==null){if(t==null){throw"Graph is null!"}if(e==null){throw"Parent node is null!"}if(this.graphs.indexOf(t)>-1){throw"Graph already in this graph mgr!"}this.graphs.push(t);if(t.parent!=null){throw"Already has a parent!"}if(e.child!=null){throw"Already has a child!"}t.parent=e;e.child=t;return t}else{n=r;i=e;r=t;var o=i.getOwner();var a=n.getOwner();if(!(o!=null&&o.getGraphManager()==this)){throw"Source not in this graph mgr!"}if(!(a!=null&&a.getGraphManager()==this)){throw"Target not in this graph mgr!"}if(o==a){r.isInterGraph=false;return o.add(r,i,n)}else{r.isInterGraph=true;r.source=i;r.target=n;if(this.edges.indexOf(r)>-1){throw"Edge already in inter-graph edge list!"}this.edges.push(r);if(!(r.source!=null&&r.target!=null)){throw"Edge source and/or target is null!"}if(!(r.source.edges.indexOf(r)==-1&&r.target.edges.indexOf(r)==-1)){throw"Edge already in source and/or target incidency list!"}r.source.edges.push(r);r.target.edges.push(r);return r}}};o.prototype.remove=function(t){if(t instanceof i){var e=t;if(e.getGraphManager()!=this){throw"Graph not in this graph mgr"}if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this)){throw"Invalid parent node!"}var r=[];r=r.concat(e.getEdges());var o;var a=r.length;for(var s=0;s=e.getRight()){r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())}else if(e.getX()<=t.getX()&&e.getRight()>=t.getRight()){r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())}if(t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()){r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom())}else if(e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()){r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom())}var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));if(e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()){o=1}var a=o*r[0];var s=r[1]/o;if(r[0]a){r[0]=i;r[1]=h;r[2]=o;r[3]=E;return false}else if(no){r[0]=s;r[1]=n;r[2]=y;r[3]=a;return false}else if(io){r[0]=c;r[1]=d;w=true}else{r[0]=l;r[1]=h;w=true}}else if(I===C){if(i>o){r[0]=s;r[1]=h;w=true}else{r[0]=f;r[1]=d;w=true}}if(-_===C){if(o>i){r[2]=m;r[3]=E;L=true}else{r[2]=y;r[3]=v;L=true}}else if(_===C){if(o>i){r[2]=p;r[3]=v;L=true}else{r[2]=N;r[3]=E;L=true}}if(w&&L){return false}if(i>o){if(n>a){M=this.getCardinalDirection(I,C,4);x=this.getCardinalDirection(_,C,2)}else{M=this.getCardinalDirection(-I,C,3);x=this.getCardinalDirection(-_,C,1)}}else{if(n>a){M=this.getCardinalDirection(-I,C,1);x=this.getCardinalDirection(-_,C,3)}else{M=this.getCardinalDirection(I,C,2);x=this.getCardinalDirection(_,C,4)}}if(!w){switch(M){case 1:D=h;O=i+-u/C;r[0]=O;r[1]=D;break;case 2:O=f;D=n+g*C;r[0]=O;r[1]=D;break;case 3:D=d;O=i+u/C;r[0]=O;r[1]=D;break;case 4:O=c;D=n+-g*C;r[0]=O;r[1]=D;break}}if(!L){switch(x){case 1:b=v;R=o+-A/C;r[2]=R;r[3]=b;break;case 2:R=N;b=a+T*C;r[2]=R;r[3]=b;break;case 3:b=E;R=o+A/C;r[2]=R;r[3]=b;break;case 4:R=m;b=a+-T*C;r[2]=R;r[3]=b;break}}}return false};n.getCardinalDirection=function(t,e,r){if(t>e){return r}else{return 1+r%4}};n.getIntersection=function(t,e,r,n){if(n==null){return this.getIntersection2(t,e,r)}var o=t.x;var a=t.y;var s=e.x;var h=e.y;var l=r.x;var c=r.y;var d=n.x;var f=n.y;var g=void 0,u=void 0;var p=void 0,v=void 0,y=void 0,m=void 0,E=void 0,N=void 0;var T=void 0;p=h-a;y=o-s;E=s*a-o*h;v=f-c;m=l-d;N=d*c-l*f;T=p*m-v*y;if(T===0){return null}g=(y*N-m*E)/T;u=(v*E-p*N)/T;return new i(g,u)};n.angleOfVector=function(t,e,r,i){var n=void 0;if(t!==r){n=Math.atan((i-e)/(r-t));if(r=0){var d=(-h+Math.sqrt(h*h-4*s*l))/(2*s);var f=(-h-Math.sqrt(h*h-4*s*l))/(2*s);var g=null;if(d>=0&&d<=1){return[d]}if(f>=0&&f<=1){return[f]}return g}else return null};n.HALF_PI=.5*Math.PI;n.ONE_AND_HALF_PI=1.5*Math.PI;n.TWO_PI=2*Math.PI;n.THREE_PI=3*Math.PI;t.exports=n},function(t,e,r){"use strict";function i(){}i.sign=function(t){if(t>0){return 1}else if(t<0){return-1}else{return 0}};i.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)};i.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)};t.exports=i},function(t,e,r){"use strict";function i(){}i.MAX_VALUE=2147483647;i.MIN_VALUE=-2147483648;t.exports=i},function(t,e,r){"use strict";var i=function(){function t(t,e){for(var r=0;r0&&e){s.push(l[0]);while(s.length>0&&e){var c=s[0];s.splice(0,1);a.add(c);var d=c.getEdges();for(var o=0;o-1){l.splice(p,1)}}a=new Set;h=new Map}}return t};f.prototype.createDummyNodesForBendpoints=function(t){var e=[];var r=t.source;var i=this.graphManager.calcLowestCommonAncestor(t.source,t.target);for(var n=0;n0){var n=this.edgeToDummyNodes.get(r);for(var o=0;o=0){e.splice(d,1)}var f=s.getNeighborsList();f.forEach((function(t){if(r.indexOf(t)<0){var e=i.get(t);var n=e-1;if(n==1){l.push(t)}i.set(t,n)}}))}r=r.concat(l);if(e.length==1||e.length==2){n=true;o=e[0]}}return o};f.prototype.setGraphManager=function(t){this.graphManager=t};t.exports=f},function(t,e,r){"use strict";function i(){}i.seed=1;i.x=0;i.nextDouble=function(){i.x=Math.sin(i.seed++)*1e4;return i.x-Math.floor(i.x)};t.exports=i},function(t,e,r){"use strict";var i=r(5);function n(t,e){this.lworldOrgX=0;this.lworldOrgY=0;this.ldeviceOrgX=0;this.ldeviceOrgY=0;this.lworldExtX=1;this.lworldExtY=1;this.ldeviceExtX=1;this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX};n.prototype.setWorldOrgX=function(t){this.lworldOrgX=t};n.prototype.getWorldOrgY=function(){return this.lworldOrgY};n.prototype.setWorldOrgY=function(t){this.lworldOrgY=t};n.prototype.getWorldExtX=function(){return this.lworldExtX};n.prototype.setWorldExtX=function(t){this.lworldExtX=t};n.prototype.getWorldExtY=function(){return this.lworldExtY};n.prototype.setWorldExtY=function(t){this.lworldExtY=t};n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX};n.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t};n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY};n.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t};n.prototype.getDeviceExtX=function(){return this.ldeviceExtX};n.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t};n.prototype.getDeviceExtY=function(){return this.ldeviceExtY};n.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t};n.prototype.transformX=function(t){var e=0;var r=this.lworldExtX;if(r!=0){e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r}return e};n.prototype.transformY=function(t){var e=0;var r=this.lworldExtY;if(r!=0){e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r}return e};n.prototype.inverseTransformX=function(t){var e=0;var r=this.ldeviceExtX;if(r!=0){e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r}return e};n.prototype.inverseTransformY=function(t){var e=0;var r=this.ldeviceExtY;if(r!=0){e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r}return e};n.prototype.inverseTransformPoint=function(t){var e=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return e};t.exports=n},function(t,e,r){"use strict";function i(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);eo.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))}this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(t>o.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR))}else{this.coolingFactor=1}this.initialCoolingFactor=this.coolingFactor;this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations);this.displacementThresholdPerNode=3*o.DEFAULT_EDGE_LENGTH/100;this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length;this.repulsionRange=this.calcRepulsionRange()};l.prototype.calcSpringForces=function(){var t=this.getAllEdges();var e;for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:true;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var r,i;var n,a;var s=this.getAllNodes();var h;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&t){this.updateGrid()}h=new Set;for(r=0;rh||s>h){t.gravitationForceX=-this.gravityConstant*n;t.gravitationForceY=-this.gravityConstant*o}}else{h=e.getEstimatedSize()*this.compoundGravityRangeFactor;if(a>h||s>h){t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant;t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant}}};l.prototype.isConverged=function(){var t;var e=false;if(this.totalIterations>this.maxIterations/3){e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2}t=this.totalDisplacement=h.length||c>=h[0].length)){for(var d=0;de}}]);return t}();t.exports=a},function(t,e,r){"use strict";function i(){}i.svd=function(t){this.U=null;this.V=null;this.s=null;this.m=0;this.n=0;this.m=t.length;this.n=t[0].length;var e=Math.min(this.m,this.n);this.s=function(t){var e=[];while(t-- >0){e.push(0)}return e}(Math.min(this.m+1,this.n));this.U=function(t){var e=function t(e){if(e.length==0){return 0}else{var r=[];for(var i=0;i0){e.push(0)}return e}(this.n);var n=function(t){var e=[];while(t-- >0){e.push(0)}return e}(this.m);var o=true;var a=true;var s=Math.min(this.m-1,this.n);var h=Math.max(0,Math.min(this.n-2,this.m));for(var l=0;l=0;x--){if(this.s[x]!==0){for(var O=x+1;O=0;P--){if(function(t,e){return t&&e}(P0){var j=void 0;var q=void 0;for(j=_-2;j>=-1;j--){if(j===-1){break}if(Math.abs(r[j])<=W+B*(Math.abs(this.s[j])+Math.abs(this.s[j+1]))){r[j]=0;break}}if(j===_-2){q=4}else{var $=void 0;for($=_-1;$>=j;$--){if($===j){break}var K=($!==_?Math.abs(r[$]):0)+($!==j+1?Math.abs(r[$-1]):0);if(Math.abs(this.s[$])<=W+B*K){this.s[$]=0;break}}if($===j){q=3}else if($===_-1){q=1}else{q=2;j=$}}j++;switch(q){case 1:{var Z=r[_-2];r[_-2]=0;for(var Q=_-2;Q>=j;Q--){var J=i.hypot(this.s[Q],Z);var tt=this.s[Q]/J;var et=Z/J;this.s[Q]=J;if(Q!==j){Z=-et*r[Q-1];r[Q-1]=tt*r[Q-1]}if(a){for(var rt=0;rt=this.s[j+1]){break}var Ct=this.s[j];this.s[j]=this.s[j+1];this.s[j+1]=Ct;if(a&&jMath.abs(e)){r=e/t;r=Math.abs(t)*Math.sqrt(1+r*r)}else if(e!=0){r=t/e;r=Math.abs(e)*Math.sqrt(1+r*r)}else{r=0}return r};t.exports=i},function(t,e,r){"use strict";var i=function(){function t(t,e){for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:1;var o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;n(this,t);this.sequence1=e;this.sequence2=r;this.match_score=i;this.mismatch_penalty=o;this.gap_penalty=a;this.iMax=e.length+1;this.jMax=r.length+1;this.grid=new Array(this.iMax);for(var s=0;s=0;r--){var i=this.listeners[r];if(i.event===t&&i.callback===e){this.listeners.splice(r,1)}}};n.emit=function(t,e){for(var r=0;r{"use strict";r.d(e,{diagram:()=>yt});var i=r(68232);var n=r(76261);var o=r(19163);var a=r(13249);var s=r(96049);var h=r(93113);var l=r(75905);var c=r(24010);var d=r(76405);var f=r(26527);var g=r.n(f);var u=r(24982);var p={L:"left",R:"right",T:"top",B:"bottom"};var v={L:(0,l.K2)((t=>`${t},${t/2} 0,${t} 0,0`),"L"),R:(0,l.K2)((t=>`0,${t/2} ${t},0 ${t},${t}`),"R"),T:(0,l.K2)((t=>`0,0 ${t},0 ${t/2},${t}`),"T"),B:(0,l.K2)((t=>`${t/2},0 ${t},${t} 0,${t}`),"B")};var y={L:(0,l.K2)(((t,e)=>t-e+2),"L"),R:(0,l.K2)(((t,e)=>t-2),"R"),T:(0,l.K2)(((t,e)=>t-e+2),"T"),B:(0,l.K2)(((t,e)=>t-2),"B")};var m=(0,l.K2)((function(t){if(N(t)){return t==="L"?"R":"L"}else{return t==="T"?"B":"T"}}),"getOppositeArchitectureDirection");var E=(0,l.K2)((function(t){const e=t;return e==="L"||e==="R"||e==="T"||e==="B"}),"isArchitectureDirection");var N=(0,l.K2)((function(t){const e=t;return e==="L"||e==="R"}),"isArchitectureDirectionX");var T=(0,l.K2)((function(t){const e=t;return e==="T"||e==="B"}),"isArchitectureDirectionY");var A=(0,l.K2)((function(t,e){const r=N(t)&&T(e);const i=T(t)&&N(e);return r||i}),"isArchitectureDirectionXY");var w=(0,l.K2)((function(t){const e=t[0];const r=t[1];const i=N(e)&&T(r);const n=T(e)&&N(r);return i||n}),"isArchitecturePairXY");var L=(0,l.K2)((function(t){return t!=="LL"&&t!=="RR"&&t!=="TT"&&t!=="BB"}),"isValidArchitectureDirectionPair");var I=(0,l.K2)((function(t,e){const r=`${t}${e}`;return L(r)?r:void 0}),"getArchitectureDirectionPair");var _=(0,l.K2)((function([t,e],r){const i=r[0];const n=r[1];if(N(i)){if(T(n)){return[t+(i==="L"?-1:1),e+(n==="T"?1:-1)]}else{return[t+(i==="L"?-1:1),e]}}else{if(N(n)){return[t+(n==="L"?1:-1),e+(i==="T"?1:-1)]}else{return[t,e+(i==="T"?1:-1)]}}}),"shiftPositionByArchitectureDirectionPair");var C=(0,l.K2)((function(t){if(t==="LT"||t==="TL"){return[1,1]}else if(t==="BL"||t==="LB"){return[1,-1]}else if(t==="BR"||t==="RB"){return[-1,-1]}else{return[-1,1]}}),"getArchitectureDirectionXYFactors");var M=(0,l.K2)((function(t,e){if(A(t,e)){return"bend"}else if(N(t)){return"horizontal"}return"vertical"}),"getArchitectureDirectionAlignment");var x=(0,l.K2)((function(t){const e=t;return e.type==="service"}),"isArchitectureService");var O=(0,l.K2)((function(t){const e=t;return e.type==="junction"}),"isArchitectureJunction");var D=(0,l.K2)((t=>t.data()),"edgeData");var R=(0,l.K2)((t=>t.data()),"nodeData");var b=l.UI.architecture;var G=new a.m((()=>({nodes:{},groups:{},edges:[],registeredIds:{},config:b,dataStructures:void 0,elements:{}})));var F=(0,l.K2)((()=>{G.reset();(0,l.IU)()}),"clear");var S=(0,l.K2)((function({id:t,icon:e,in:r,title:i,iconText:n}){if(G.records.registeredIds[t]!==void 0){throw new Error(`The service id [${t}] is already in use by another ${G.records.registeredIds[t]}`)}if(r!==void 0){if(t===r){throw new Error(`The service [${t}] cannot be placed within itself`)}if(G.records.registeredIds[r]===void 0){throw new Error(`The service [${t}]'s parent does not exist. Please make sure the parent is created before this service`)}if(G.records.registeredIds[r]==="node"){throw new Error(`The service [${t}]'s parent is not a group`)}}G.records.registeredIds[t]="node";G.records.nodes[t]={id:t,type:"service",icon:e,iconText:n,title:i,edges:[],in:r}}),"addService");var P=(0,l.K2)((()=>Object.values(G.records.nodes).filter(x)),"getServices");var U=(0,l.K2)((function({id:t,in:e}){G.records.registeredIds[t]="node";G.records.nodes[t]={id:t,type:"junction",edges:[],in:e}}),"addJunction");var k=(0,l.K2)((()=>Object.values(G.records.nodes).filter(O)),"getJunctions");var Y=(0,l.K2)((()=>Object.values(G.records.nodes)),"getNodes");var H=(0,l.K2)((t=>G.records.nodes[t]),"getNode");var X=(0,l.K2)((function({id:t,icon:e,in:r,title:i}){if(G.records.registeredIds[t]!==void 0){throw new Error(`The group id [${t}] is already in use by another ${G.records.registeredIds[t]}`)}if(r!==void 0){if(t===r){throw new Error(`The group [${t}] cannot be placed within itself`)}if(G.records.registeredIds[r]===void 0){throw new Error(`The group [${t}]'s parent does not exist. Please make sure the parent is created before this group`)}if(G.records.registeredIds[r]==="node"){throw new Error(`The group [${t}]'s parent is not a group`)}}G.records.registeredIds[t]="group";G.records.groups[t]={id:t,icon:e,title:i,in:r}}),"addGroup");var z=(0,l.K2)((()=>Object.values(G.records.groups)),"getGroups");var V=(0,l.K2)((function({lhsId:t,rhsId:e,lhsDir:r,rhsDir:i,lhsInto:n,rhsInto:o,lhsGroup:a,rhsGroup:s,title:h}){if(!E(r)){throw new Error(`Invalid direction given for left hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${r}`)}if(!E(i)){throw new Error(`Invalid direction given for right hand side of edge ${t}--${e}. Expected (L,R,T,B) got ${i}`)}if(G.records.nodes[t]===void 0&&G.records.groups[t]===void 0){throw new Error(`The left-hand id [${t}] does not yet exist. Please create the service/group before declaring an edge to it.`)}if(G.records.nodes[e]===void 0&&G.records.groups[t]===void 0){throw new Error(`The right-hand id [${e}] does not yet exist. Please create the service/group before declaring an edge to it.`)}const l=G.records.nodes[t].in;const c=G.records.nodes[e].in;if(a&&l&&c&&l==c){throw new Error(`The left-hand id [${t}] is modified to traverse the group boundary, but the edge does not pass through two groups.`)}if(s&&l&&c&&l==c){throw new Error(`The right-hand id [${e}] is modified to traverse the group boundary, but the edge does not pass through two groups.`)}const d={lhsId:t,lhsDir:r,lhsInto:n,lhsGroup:a,rhsId:e,rhsDir:i,rhsInto:o,rhsGroup:s,title:h};G.records.edges.push(d);if(G.records.nodes[t]&&G.records.nodes[e]){G.records.nodes[t].edges.push(G.records.edges[G.records.edges.length-1]);G.records.nodes[e].edges.push(G.records.edges[G.records.edges.length-1])}}),"addEdge");var B=(0,l.K2)((()=>G.records.edges),"getEdges");var W=(0,l.K2)((()=>{if(G.records.dataStructures===void 0){const t={};const e=Object.entries(G.records.nodes).reduce(((e,[r,i])=>{e[r]=i.edges.reduce(((e,i)=>{const n=H(i.lhsId)?.in;const o=H(i.rhsId)?.in;if(n&&o&&n!==o){const e=M(i.lhsDir,i.rhsDir);if(e!=="bend"){t[n]??={};t[n][o]=e;t[o]??={};t[o][n]=e}}if(i.lhsId===r){const t=I(i.lhsDir,i.rhsDir);if(t){e[t]=i.rhsId}}else{const t=I(i.rhsDir,i.lhsDir);if(t){e[t]=i.lhsId}}return e}),{});return e}),{});const r=Object.keys(e)[0];const i={[r]:1};const n=Object.keys(e).reduce(((t,e)=>e===r?t:{...t,[e]:1}),{});const o=(0,l.K2)((t=>{const r={[t]:[0,0]};const o=[t];while(o.length>0){const t=o.shift();if(t){i[t]=1;delete n[t];const a=e[t];const[s,h]=r[t];Object.entries(a).forEach((([t,e])=>{if(!i[e]){r[e]=_([s,h],t);o.push(e)}}))}}return r}),"BFS");const a=[o(r)];while(Object.keys(n).length>0){a.push(o(Object.keys(n)[0]))}G.records.dataStructures={adjList:e,spatialMaps:a,groupAlignments:t}}return G.records.dataStructures}),"getDataStructures");var j=(0,l.K2)(((t,e)=>{G.records.elements[t]=e}),"setElementForId");var q=(0,l.K2)((t=>G.records.elements[t]),"getElementById");var $={clear:F,setDiagramTitle:l.ke,getDiagramTitle:l.ab,setAccTitle:l.SV,getAccTitle:l.iN,setAccDescription:l.EI,getAccDescription:l.m7,addService:S,getServices:P,addJunction:U,getJunctions:k,getNodes:Y,getNode:H,addGroup:X,getGroups:z,addEdge:V,getEdges:B,setElementForId:j,getElementById:q,getDataStructures:W};function K(t){const e=(0,l.D7)().architecture;if(e?.[t]){return e[t]}return b[t]}(0,l.K2)(K,"getConfigField");var Z=(0,l.K2)(((t,e)=>{(0,o.S)(t,e);t.groups.map(e.addGroup);t.services.map((t=>e.addService({...t,type:"service"})));t.junctions.map((t=>e.addJunction({...t,type:"junction"})));t.edges.map(e.addEdge)}),"populateDb");var Q={parse:(0,l.K2)((async t=>{const e=await(0,c.qg)("architecture",t);l.Rm.debug(e);Z(e,$)}),"parse")};var J=(0,l.K2)((t=>`\n .edge {\n stroke-width: ${t.archEdgeWidth};\n stroke: ${t.archEdgeColor};\n fill: none;\n }\n\n .arrow {\n fill: ${t.archEdgeArrowColor};\n }\n\n .node-bkg {\n fill: none;\n stroke: ${t.archGroupBorderColor};\n stroke-width: ${t.archGroupBorderWidth};\n stroke-dasharray: 8;\n }\n .node-icon-text {\n display: flex; \n align-items: center;\n }\n \n .node-icon-text > div {\n color: #fff;\n margin: 1px;\n height: fit-content;\n text-align: center;\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n }\n`),"getStyles");var tt=J;var et=(0,l.K2)((t=>`${t}`),"wrapIcon");var rt={prefix:"mermaid-architecture",height:80,width:80,icons:{database:{body:et('')},server:{body:et('')},disk:{body:et('')},internet:{body:et('')},cloud:{body:et('')},unknown:i.Gc,blank:{body:et("")}}};var it=(0,l.K2)((async function(t,e){const r=K("padding");const i=K("iconSize");const o=i/2;const a=i/6;const s=a/2;await Promise.all(e.edges().map((async e=>{const{source:i,sourceDir:h,sourceArrow:c,sourceGroup:d,target:f,targetDir:g,targetArrow:u,targetGroup:p,label:m}=D(e);let{x:E,y:L}=e[0].sourceEndpoint();const{x:_,y:M}=e[0].midpoint();let{x,y:O}=e[0].targetEndpoint();const R=r+4;if(d){if(N(h)){E+=h==="L"?-R:R}else{L+=h==="T"?-R:R+18}}if(p){if(N(g)){x+=g==="L"?-R:R}else{O+=g==="T"?-R:R+18}}if(!d&&$.getNode(i)?.type==="junction"){if(N(h)){E+=h==="L"?o:-o}else{L+=h==="T"?o:-o}}if(!p&&$.getNode(f)?.type==="junction"){if(N(g)){x+=g==="L"?o:-o}else{O+=g==="T"?o:-o}}if(e[0]._private.rscratch){const e=t.insert("g");e.insert("path").attr("d",`M ${E},${L} L ${_},${M} L${x},${O} `).attr("class","edge");if(c){const t=N(h)?y[h](E,a):E-s;const r=T(h)?y[h](L,a):L-s;e.insert("polygon").attr("points",v[h](a)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(u){const t=N(g)?y[g](x,a):x-s;const r=T(g)?y[g](O,a):O-s;e.insert("polygon").attr("points",v[g](a)).attr("transform",`translate(${t},${r})`).attr("class","arrow")}if(m){const t=!A(h,g)?N(h)?"X":"Y":"XY";let r=0;if(t==="X"){r=Math.abs(E-x)}else if(t==="Y"){r=Math.abs(L-O)/1.5}else{r=Math.abs(E-x)/2}const i=e.append("g");await(0,n.GZ)(i,m,{useHtmlLabels:false,width:r,classes:"architecture-service-label"},(0,l.D7)());i.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");if(t==="X"){i.attr("transform","translate("+_+", "+M+")")}else if(t==="Y"){i.attr("transform","translate("+_+", "+M+") rotate(-90)")}else if(t==="XY"){const t=I(h,g);if(t&&w(t)){const e=i.node().getBoundingClientRect();const[r,n]=C(t);i.attr("dominant-baseline","auto").attr("transform",`rotate(${-1*r*n*45})`);const o=i.node().getBoundingClientRect();i.attr("transform",`\n translate(${_}, ${M-e.height/2})\n translate(${r*o.width/2}, ${n*o.height/2})\n rotate(${-1*r*n*45}, 0, ${e.height/2})\n `)}}}}})))}),"drawEdges");var nt=(0,l.K2)((async function(t,e){const r=K("padding");const o=r*.75;const a=K("fontSize");const s=K("iconSize");const h=s/2;await Promise.all(e.nodes().map((async e=>{const r=R(e);if(r.type==="group"){const{h:s,w:c,x1:d,y1:f}=e.boundingBox();t.append("rect").attr("x",d+h).attr("y",f+h).attr("width",c).attr("height",s).attr("class","node-bkg");const g=t.append("g");let u=d;let p=f;if(r.icon){const t=g.append("g");t.html(`${await(0,i.WY)(r.icon,{height:o,width:o,fallbackPrefix:rt.prefix})}`);t.attr("transform","translate("+(u+h+1)+", "+(p+h+1)+")");u+=o;p+=a/2-1-2}if(r.label){const t=g.append("g");await(0,n.GZ)(t,r.label,{useHtmlLabels:false,width:c,classes:"architecture-service-label"},(0,l.D7)());t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","start").attr("text-anchor","start");t.attr("transform","translate("+(u+h+4)+", "+(p+h+2)+")")}}})))}),"drawGroups");var ot=(0,l.K2)((async function(t,e,r){for(const o of r){const r=e.append("g");const a=K("iconSize");if(o.title){const t=r.append("g");await(0,n.GZ)(t,o.title,{useHtmlLabels:false,width:a*1.5,classes:"architecture-service-label"},(0,l.D7)());t.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle");t.attr("transform","translate("+a/2+", "+a+")")}const s=r.append("g");if(o.icon){s.html(`${await(0,i.WY)(o.icon,{height:a,width:a,fallbackPrefix:rt.prefix})}`)}else if(o.iconText){s.html(`${await(0,i.WY)("blank",{height:a,width:a,fallbackPrefix:rt.prefix})}`);const t=s.append("g");const e=t.append("foreignObject").attr("width",a).attr("height",a);const r=e.append("div").attr("class","node-icon-text").attr("style",`height: ${a}px;`).append("div").html(o.iconText);const n=parseInt(window.getComputedStyle(r.node(),null).getPropertyValue("font-size").replace(/\D/g,""))??16;r.attr("style",`-webkit-line-clamp: ${Math.floor((a-2)/n)};`)}else{s.append("path").attr("class","node-bkg").attr("id","node-"+o.id).attr("d",`M0 ${a} v${-a} q0,-5 5,-5 h${a} q5,0 5,5 v${a} H0 Z`)}r.attr("class","architecture-service");const{width:h,height:c}=r._groups[0][0].getBBox();o.width=h;o.height=c;t.setElementForId(o.id,r)}return 0}),"drawServices");var at=(0,l.K2)((function(t,e,r){r.forEach((r=>{const i=e.append("g");const n=K("iconSize");const o=i.append("g");o.append("rect").attr("id","node-"+r.id).attr("fill-opacity","0").attr("width",n).attr("height",n);i.attr("class","architecture-junction");const{width:a,height:s}=i._groups[0][0].getBBox();i.width=a;i.height=s;t.setElementForId(r.id,i)}))}),"drawJunctions");(0,i.pC)([{name:rt.prefix,icons:rt}]);d.A.use(g());function st(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"service",id:t.id,icon:t.icon,label:t.title,parent:t.in,width:K("iconSize"),height:K("iconSize")},classes:"node-service"})}))}(0,l.K2)(st,"addServices");function ht(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"junction",id:t.id,parent:t.in,width:K("iconSize"),height:K("iconSize")},classes:"node-junction"})}))}(0,l.K2)(ht,"addJunctions");function lt(t,e){e.nodes().map((e=>{const r=R(e);if(r.type==="group"){return}r.x=e.position().x;r.y=e.position().y;const i=t.getElementById(r.id);i.attr("transform","translate("+(r.x||0)+","+(r.y||0)+")")}))}(0,l.K2)(lt,"positionNodes");function ct(t,e){t.forEach((t=>{e.add({group:"nodes",data:{type:"group",id:t.id,icon:t.icon,label:t.title,parent:t.in},classes:"node-group"})}))}(0,l.K2)(ct,"addGroups");function dt(t,e){t.forEach((t=>{const{lhsId:r,rhsId:i,lhsInto:n,lhsGroup:o,rhsInto:a,lhsDir:s,rhsDir:h,rhsGroup:l,title:c}=t;const d=A(t.lhsDir,t.rhsDir)?"segments":"straight";const f={id:`${r}-${i}`,label:c,source:r,sourceDir:s,sourceArrow:n,sourceGroup:o,sourceEndpoint:s==="L"?"0 50%":s==="R"?"100% 50%":s==="T"?"50% 0":"50% 100%",target:i,targetDir:h,targetArrow:a,targetGroup:l,targetEndpoint:h==="L"?"0 50%":h==="R"?"100% 50%":h==="T"?"50% 0":"50% 100%"};e.add({group:"edges",data:f,classes:d})}))}(0,l.K2)(dt,"addEdges");function ft(t,e,r){const i=(0,l.K2)(((t,e)=>Object.entries(t).reduce(((t,[i,n])=>{let o=0;const a=Object.entries(n);if(a.length===1){t[i]=a[0][1];return t}for(let s=0;s{const r={};const n={};Object.entries(e).forEach((([e,[i,o]])=>{const a=t.getNode(e)?.in??"default";r[o]??={};r[o][a]??=[];r[o][a].push(e);n[i]??={};n[i][a]??=[];n[i][a].push(e)}));return{horiz:Object.values(i(r,"horizontal")).filter((t=>t.length>1)),vert:Object.values(i(n,"vertical")).filter((t=>t.length>1))}}));const[o,a]=n.reduce((([t,e],{horiz:r,vert:i})=>[[...t,...r],[...e,...i]]),[[],[]]);return{horizontal:o,vertical:a}}(0,l.K2)(ft,"getAlignments");function gt(t){const e=[];const r=(0,l.K2)((t=>`${t[0]},${t[1]}`),"posToStr");const i=(0,l.K2)((t=>t.split(",").map((t=>parseInt(t)))),"strToPos");t.forEach((t=>{const n=Object.fromEntries(Object.entries(t).map((([t,e])=>[r(e),t])));const o=[r([0,0])];const a={};const s={L:[-1,0],R:[1,0],T:[0,1],B:[0,-1]};while(o.length>0){const t=o.shift();if(t){a[t]=1;const h=n[t];if(h){const l=i(t);Object.entries(s).forEach((([t,i])=>{const s=r([l[0]+i[0],l[1]+i[1]]);const c=n[s];if(c&&!a[s]){o.push(s);e.push({[p[t]]:c,[p[m(t)]]:h,gap:1.5*K("iconSize")})}}))}}}}));return e}(0,l.K2)(gt,"getRelativeConstraints");function ut(t,e,r,i,n,{spatialMaps:o,groupAlignments:a}){return new Promise((s=>{const h=(0,u.Ltv)("body").append("div").attr("id","cy").attr("style","display:none");const c=(0,d.A)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"straight",label:"data(label)","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"edge.segments",style:{"curve-style":"segments","segment-weights":"0","segment-distances":[.5],"edge-distances":"endpoints","source-endpoint":"data(sourceEndpoint)","target-endpoint":"data(targetEndpoint)"}},{selector:"node",style:{"compound-sizing-wrt-labels":"include"}},{selector:"node[label]",style:{"text-valign":"bottom","text-halign":"center","font-size":`${K("fontSize")}px`}},{selector:".node-service",style:{label:"data(label)",width:"data(width)",height:"data(height)"}},{selector:".node-junction",style:{width:"data(width)",height:"data(height)"}},{selector:".node-group",style:{padding:`${K("padding")}px`}}]});h.remove();ct(r,c);st(t,c);ht(e,c);dt(i,c);const f=ft(n,o,a);const g=gt(o);const p=c.layout({name:"fcose",quality:"proof",styleEnabled:false,animate:false,nodeDimensionsIncludeLabels:false,idealEdgeLength(t){const[e,r]=t.connectedNodes();const{parent:i}=R(e);const{parent:n}=R(r);const o=i===n?1.5*K("iconSize"):.5*K("iconSize");return o},edgeElasticity(t){const[e,r]=t.connectedNodes();const{parent:i}=R(e);const{parent:n}=R(r);const o=i===n?.45:.001;return o},alignmentConstraint:f,relativePlacementConstraint:g});p.one("layoutstop",(()=>{function t(t,e,r,i){let n,o;const{x:a,y:s}=t;const{x:h,y:l}=e;o=(i-s+(a-r)*(s-l)/(a-h))/Math.sqrt(1+Math.pow((s-l)/(a-h),2));n=Math.sqrt(Math.pow(i-s,2)+Math.pow(r-a,2)-Math.pow(o,2));const c=Math.sqrt(Math.pow(h-a,2)+Math.pow(l-s,2));n=n/c;let d=(h-a)*(i-s)-(l-s)*(r-a);switch(true){case d>=0:d=1;break;case d<0:d=-1;break}let f=(h-a)*(r-a)+(l-s)*(i-s);switch(true){case f>=0:f=1;break;case f<0:f=-1;break}o=Math.abs(o)*d;n=n*f;return{distances:o,weights:n}}(0,l.K2)(t,"getSegmentWeights");c.startBatch();for(const e of Object.values(c.edges())){if(e.data?.()){const{x:r,y:i}=e.source().position();const{x:n,y:o}=e.target().position();if(r!==n&&i!==o){const r=e.sourceEndpoint();const i=e.targetEndpoint();const{sourceDir:n}=D(e);const[o,a]=T(n)?[r.x,i.y]:[i.x,r.y];const{weights:s,distances:h}=t(r,i,o,a);e.style("segment-distances",h);e.style("segment-weights",s)}}}c.endBatch();p.run()}));p.run();c.ready((t=>{l.Rm.info("Ready",t);s(c)}))}))}(0,l.K2)(ut,"layoutArchitecture");var pt=(0,l.K2)((async(t,e,r,i)=>{const n=i.db;const o=n.getServices();const a=n.getJunctions();const s=n.getGroups();const c=n.getEdges();const d=n.getDataStructures();const f=(0,h.D)(e);const g=f.append("g");g.attr("class","architecture-edges");const u=f.append("g");u.attr("class","architecture-services");const p=f.append("g");p.attr("class","architecture-groups");await ot(n,u,o);at(n,u,a);const v=await ut(o,a,s,c,n,d);await it(g,v);await nt(p,v);lt(n,v);(0,l.ot)(void 0,f,K("padding"),K("useMaxWidth"))}),"draw");var vt={draw:pt};var yt={parser:Q,db:$,renderer:vt,styles:tt}},19163:(t,e,r)=>{"use strict";r.d(e,{S:()=>n});var i=r(75905);function n(t,e){if(t.accDescr){e.setAccDescription?.(t.accDescr)}if(t.accTitle){e.setAccTitle?.(t.accTitle)}if(t.title){e.setDiagramTitle?.(t.title)}}(0,i.K2)(n,"populateCommonDb")},13249:(t,e,r)=>{"use strict";r.d(e,{m:()=>n});var i=r(75905);var n=class{constructor(t){this.init=t;this.records=this.init()}static{(0,i.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7425.f1c25f6c8aaec77e8635.js b/.venv/share/jupyter/lab/static/7425.f1c25f6c8aaec77e8635.js new file mode 100644 index 0000000000000000000000000000000000000000..ff9bef636c74f32e1523f8a307a6c6b62cb905a1 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7425.f1c25f6c8aaec77e8635.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7425],{37425:(e,O,t)=>{t.r(O);t.d(O,{css:()=>J,cssCompletionSource:()=>K,cssLanguage:()=>L,defineCSSCompletionSource:()=>B});var a=t(27421);var o=t(45145);const r=99,l=1,i=100,n=101,s=2;const d=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];const c=58,p=40,Q=95,u=91,m=45,g=46,S=35,f=37,h=38,y=92,b=10;function $(e){return e>=65&&e<=90||e>=97&&e<=122||e>=161}function P(e){return e>=48&&e<=57}const X=new a.Lu(((e,O)=>{for(let t=false,a=0,o=0;;o++){let{next:r}=e;if($(r)||r==m||r==Q||t&&P(r)){if(!t&&(r!=m||o>0))t=true;if(a===o&&r==m)a++;e.advance()}else if(r==y&&e.peek(1)!=b){e.advance();if(e.next>-1)e.advance();t=true}else{if(t)e.acceptToken(r==p?i:a==2&&O.canShift(s)?s:n);break}}}));const w=new a.Lu((e=>{if(d.includes(e.peek(-1))){let{next:O}=e;if($(O)||O==Q||O==S||O==g||O==u||O==c&&$(e.peek(1))||O==m||O==h)e.acceptToken(r)}}));const k=new a.Lu((e=>{if(!d.includes(e.peek(-1))){let{next:O}=e;if(O==f){e.advance();e.acceptToken(l)}if($(O)){do{e.advance()}while($(e.next)||P(e.next));e.acceptToken(l)}}}));const v=(0,o.styleTags)({"AtKeyword import charset namespace keyframes media supports":o.tags.definitionKeyword,"from to selector":o.tags.keyword,NamespaceName:o.tags.namespace,KeyframeName:o.tags.labelName,KeyframeRangeName:o.tags.operatorKeyword,TagName:o.tags.tagName,ClassName:o.tags.className,PseudoClassName:o.tags.constant(o.tags.className),IdName:o.tags.labelName,"FeatureName PropertyName":o.tags.propertyName,AttributeName:o.tags.attributeName,NumberLiteral:o.tags.number,KeywordQuery:o.tags.keyword,UnaryQueryOp:o.tags.operatorKeyword,"CallTag ValueName":o.tags.atom,VariableName:o.tags.variableName,Callee:o.tags.operatorKeyword,Unit:o.tags.unit,"UniversalSelector NestingSelector":o.tags.definitionOperator,MatchOp:o.tags.compareOperator,"ChildOp SiblingOp, LogicOp":o.tags.logicOperator,BinOp:o.tags.arithmeticOperator,Important:o.tags.modifier,Comment:o.tags.blockComment,ColorLiteral:o.tags.color,"ParenthesizedContent StringLiteral":o.tags.string,":":o.tags.punctuation,"PseudoOp #":o.tags.derefOperator,"; ,":o.tags.separator,"( )":o.tags.paren,"[ ]":o.tags.squareBracket,"{ }":o.tags.brace});const z={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:138};const x={__proto__:null,"@import":118,"@media":142,"@charset":146,"@namespace":150,"@keyframes":156,"@supports":168};const T={__proto__:null,not:132,only:132};const W=a.U1.deserialize({version:14,states:":jQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DTO$vQ[O'#DWOOQP'#Em'#EmO${QdO'#DgO%jQ[O'#DtO${QdO'#DvO%{Q[O'#DxO&WQ[O'#D{O&`Q[O'#ERO&nQ[O'#ETOOQS'#El'#ElOOQS'#EW'#EWQYQ[OOO&uQXO'#CdO'jQWO'#DcO'oQWO'#EsO'zQ[O'#EsQOQWOOP(UO#tO'#C_POOO)C@[)C@[OOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(aQ[O'#E[O({QWO,58{O)TQ[O,59SO$qQ[O,59oO$vQ[O,59rO(aQ[O,59uO(aQ[O,59wO(aQ[O,59xO)`Q[O'#DbOOQS,58{,58{OOQP'#Ck'#CkOOQO'#DR'#DROOQP,59S,59SO)gQWO,59SO)lQWO,59SOOQP'#DV'#DVOOQP,59o,59oOOQO'#DX'#DXO)qQ`O,59rOOQS'#Cp'#CpO${QdO'#CqO)yQvO'#CsO+ZQtO,5:ROOQO'#Cx'#CxO)lQWO'#CwO+oQWO'#CyO+tQ[O'#DOOOQS'#Ep'#EpOOQO'#Dj'#DjO+|Q[O'#DqO,[QWO'#EtO&`Q[O'#DoO,jQWO'#DrOOQO'#Eu'#EuO)OQWO,5:`O,oQpO,5:bOOQS'#Dz'#DzO,wQWO,5:dO,|Q[O,5:dOOQO'#D}'#D}O-UQWO,5:gO-ZQWO,5:mO-cQWO,5:oOOQS-E8U-E8UO-kQdO,59}O-{Q[O'#E^O.YQWO,5;_O.YQWO,5;_POOO'#EV'#EVP.eO#tO,58yPOOO,58y,58yOOQP1G.l1G.lO/[QXO,5:vOOQO-E8Y-E8YOOQS1G.g1G.gOOQP1G.n1G.nO)gQWO1G.nO)lQWO1G.nOOQP1G/Z1G/ZO/iQ`O1G/^O0SQXO1G/aO0jQXO1G/cO1QQXO1G/dO1hQWO,59|O1mQ[O'#DSO1tQdO'#CoOOQP1G/^1G/^O${QdO1G/^O1{QpO,59]OOQS,59_,59_O${QdO,59aO2TQWO1G/mOOQS,59c,59cO2YQ!bO,59eOOQS'#DP'#DPOOQS'#EY'#EYO2eQ[O,59jOOQS,59j,59jO2mQWO'#DjO2xQWO,5:VO2}QWO,5:]O&`Q[O,5:XO&`Q[O'#E_O3VQWO,5;`O3bQWO,5:ZO(aQ[O,5:^OOQS1G/z1G/zOOQS1G/|1G/|OOQS1G0O1G0OO3sQWO1G0OO3xQdO'#EOOOQS1G0R1G0ROOQS1G0X1G0XOOQS1G0Z1G0ZO4TQtO1G/iOOQO1G/i1G/iOOQO,5:x,5:xO4kQ[O,5:xOOQO-E8[-E8[O4xQWO1G0yPOOO-E8T-E8TPOOO1G.e1G.eOOQP7+$Y7+$YOOQP7+$x7+$xO${QdO7+$xOOQS1G/h1G/hO5TQXO'#ErO5[QWO,59nO5aQtO'#EXO6XQdO'#EoO6cQWO,59ZO6hQpO7+$xOOQS1G.w1G.wOOQS1G.{1G.{OOQS7+%X7+%XOOQS1G/P1G/PO6pQWO1G/POOQS-E8W-E8WOOQS1G/U1G/UO${QdO1G/qOOQO1G/w1G/wOOQO1G/s1G/sO6uQWO,5:yOOQO-E8]-E8]O7TQXO1G/xOOQS7+%j7+%jO7[QYO'#CsOOQO'#EQ'#EQO7gQ`O'#EPOOQO'#EP'#EPO7rQWO'#E`O7zQdO,5:jOOQS,5:j,5:jO8VQtO'#E]O${QdO'#E]O9WQdO7+%TOOQO7+%T7+%TOOQO1G0d1G0dO9kQpO<OAN>OO;]QdO,5:uOOQO-E8X-E8XOOQO<T![;'S%^;'S;=`%o<%lO%^l;TUo`Oy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^l;nYo`#e[Oy%^z!Q%^!Q![;g![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^l[[o`#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^n?VSt^Oy%^z;'S%^;'S;=`%o<%lO%^l?hWjWOy%^z!O%^!O!P;O!P!Q%^!Q![>T![;'S%^;'S;=`%o<%lO%^n@VU#bQOy%^z!Q%^!Q![;g![;'S%^;'S;=`%o<%lO%^~@nTjWOy%^z{@}{;'S%^;'S;=`%o<%lO%^~AUSo`#[~Oy%^z;'S%^;'S;=`%o<%lO%^lAg[#e[Oy%^z!O%^!O!P;g!P!Q%^!Q![>T![!g%^!g!h<^!h#X%^#X#Y<^#Y;'S%^;'S;=`%o<%lO%^bBbU]QOy%^z![%^![!]Bt!];'S%^;'S;=`%o<%lO%^bB{S^Qo`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Y^Oy%^z;'S%^;'S;=`%o<%lO%^dCoS|SOy%^z;'S%^;'S;=`%o<%lO%^bDQU!OQOy%^z!`%^!`!aDd!a;'S%^;'S;=`%o<%lO%^bDkS!OQo`Oy%^z;'S%^;'S;=`%o<%lO%^bDzWOy%^z!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^bEk[![Qo`Oy%^z}%^}!OEd!O!Q%^!Q![Ed![!c%^!c!}Ed!}#T%^#T#oEd#o;'S%^;'S;=`%o<%lO%^nFfSq^Oy%^z;'S%^;'S;=`%o<%lO%^nFwSp^Oy%^z;'S%^;'S;=`%o<%lO%^bGWUOy%^z#b%^#b#cGj#c;'S%^;'S;=`%o<%lO%^bGoUo`Oy%^z#W%^#W#XHR#X;'S%^;'S;=`%o<%lO%^bHYS!bQo`Oy%^z;'S%^;'S;=`%o<%lO%^bHiUOy%^z#f%^#f#gHR#g;'S%^;'S;=`%o<%lO%^fIQS!TUOy%^z;'S%^;'S;=`%o<%lO%^nIcS!S^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!RQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[w,k,X,1,2,3,4,new a.uC("m~RRYZ[z{a~~g~aO#^~~dP!P!Qg~lO#_~~",28,105)],topRules:{StyleSheet:[0,4],Styles:[1,86]},specialized:[{term:100,get:e=>z[e]||-1},{term:58,get:e=>x[e]||-1},{term:101,get:e=>T[e]||-1}],tokenPrec:1219});var R=t(4452);var U=t(66575);let Y=null;function q(){if(!Y&&typeof document=="object"&&document.body){let{style:e}=document.body,O=[],t=new Set;for(let a in e)if(a!="cssText"&&a!="cssFloat"){if(typeof e[a]=="string"){if(/[A-Z]/.test(a))a=a.replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()));if(!t.has(a)){O.push(a);t.add(a)}}}Y=O.sort().map((e=>({type:"property",label:e,apply:e+": "})))}return Y||[]}const Z=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map((e=>({type:"class",label:e})));const C=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map((e=>({type:"keyword",label:e}))).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map((e=>({type:"constant",label:e}))));const _=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map((e=>({type:"type",label:e})));const E=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map((e=>({type:"keyword",label:e})));const G=/^(\w[\w-]*|-\w[\w-]*|)$/,V=/^-(-[\w-]*)?$/;function N(e,O){var t;if(e.name=="("||e.type.isError)e=e.parent||e;if(e.name!="ArgList")return false;let a=(t=e.parent)===null||t===void 0?void 0:t.firstChild;if((a===null||a===void 0?void 0:a.name)!="Callee")return false;return O.sliceString(a.from,a.to)=="var"}const j=new U.NodeWeakMap;const D=["Declaration"];function I(e){for(let O=e;;){if(O.type.isTop)return O;if(!(O=O.parent))return e}}function F(e,O,t){if(O.to-O.from>4096){let a=j.get(O);if(a)return a;let o=[],r=new Set,l=O.cursor(U.IterMode.IncludeAnonymous);if(l.firstChild())do{for(let O of F(e,l.node,t))if(!r.has(O.label)){r.add(O.label);o.push(O)}}while(l.nextSibling());j.set(O,o);return o}else{let a=[],o=new Set;O.cursor().iterate((O=>{var r;if(t(O)&&O.matchContext(D)&&((r=O.node.nextSibling)===null||r===void 0?void 0:r.name)==":"){let t=e.sliceString(O.from,O.to);if(!o.has(t)){o.add(t);a.push({label:t,type:"variable"})}}}));return a}}const B=e=>O=>{let{state:t,pos:a}=O,o=(0,R.syntaxTree)(t).resolveInner(a,-1);let r=o.type.isError&&o.from==o.to-1&&t.doc.sliceString(o.from,o.to)=="-";if(o.name=="PropertyName"||(r||o.name=="TagName")&&/^(Block|Styles)$/.test(o.resolve(o.to).name))return{from:o.from,options:q(),validFor:G};if(o.name=="ValueName")return{from:o.from,options:C,validFor:G};if(o.name=="PseudoClassName")return{from:o.from,options:Z,validFor:G};if(e(o)||(O.explicit||r)&&N(o,t.doc))return{from:e(o)||r?o.from:a,options:F(t.doc,I(o),e),validFor:V};if(o.name=="TagName"){for(let{parent:e}=o;e;e=e.parent)if(e.name=="Block")return{from:o.from,options:q(),validFor:G};return{from:o.from,options:_,validFor:G}}if(o.name=="AtKeyword")return{from:o.from,options:E,validFor:G};if(!O.explicit)return null;let l=o.resolve(a),i=l.childBefore(a);if(i&&i.name==":"&&l.name=="PseudoClassSelector")return{from:a,options:Z,validFor:G};if(i&&i.name==":"&&l.name=="Declaration"||l.name=="ArgList")return{from:a,options:C,validFor:G};if(l.name=="Block"||l.name=="Styles")return{from:a,options:q(),validFor:G};return null};const K=B((e=>e.name=="VariableName"));const L=R.LRLanguage.define({name:"css",parser:W.configure({props:[R.indentNodeProp.add({Declaration:(0,R.continuedIndent)()}),R.foldNodeProp.add({"Block KeyframeList":R.foldInside})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function J(){return new R.LanguageSupport(L,L.data.of({autocomplete:K}))}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7445.7c793c8e1720f8ec4f85.js b/.venv/share/jupyter/lab/static/7445.7c793c8e1720f8ec4f85.js new file mode 100644 index 0000000000000000000000000000000000000000..4b96d5d871b9a818dc6f85c5764a4d1a3542a51a --- /dev/null +++ b/.venv/share/jupyter/lab/static/7445.7c793c8e1720f8ec4f85.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7445],{57445:(e,t,n)=>{n.r(t);n.d(t,{oz:()=>g});function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var a=/[\^@!\|<>#~\.\*\-\+\\/,=]/;var i=/(<-)|(:=)|(=<)|(>=)|(<=)|(<:)|(>:)|(=:)|(\\=)|(\\=:)|(!!)|(==)|(::)/;var u=/(:::)|(\.\.\.)|(=<:)|(>=:)/;var o=["in","then","else","of","elseof","elsecase","elseif","catch","finally","with","require","prepare","import","export","define","do"];var c=["end"];var f=r(["true","false","nil","unit"]);var s=r(["andthen","at","attr","declare","feat","from","lex","mod","div","mode","orelse","parser","prod","prop","scanner","self","syn","token"]);var l=r(["local","proc","fun","case","class","if","cond","or","dis","choice","not","thread","try","raise","lock","for","suchthat","meth","functor"]);var h=r(o);var d=r(c);function m(e,t){if(e.eatSpace()){return null}if(e.match(/[{}]/)){return"bracket"}if(e.match("[]")){return"keyword"}if(e.match(u)||e.match(i)){return"operator"}if(e.match(f)){return"atom"}var n=e.match(l);if(n){if(!t.doInCurrentLine)t.currentIndent++;else t.doInCurrentLine=false;if(n[0]=="proc"||n[0]=="fun")t.tokenize=z;else if(n[0]=="class")t.tokenize=p;else if(n[0]=="meth")t.tokenize=k;return"keyword"}if(e.match(h)||e.match(s)){return"keyword"}if(e.match(d)){t.currentIndent--;return"keyword"}var r=e.next();if(r=='"'||r=="'"){t.tokenize=b(r);return t.tokenize(e,t)}if(/[~\d]/.test(r)){if(r=="~"){if(!/^[0-9]/.test(e.peek()))return null;else if(e.next()=="0"&&e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return"number"}if(r=="0"&&e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^[0-9]*(\.[0-9]+)?([eE][~+]?[0-9]+)?/))return"number";return null}if(r=="%"){e.skipToEnd();return"comment"}else if(r=="/"){if(e.eat("*")){t.tokenize=v;return v(e,t)}}if(a.test(r)){return"operator"}e.eatWhile(/\w/);return"variable"}function p(e,t){if(e.eatSpace()){return null}e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)/);t.tokenize=m;return"type"}function k(e,t){if(e.eatSpace()){return null}e.match(/([a-zA-Z][A-Za-z0-9_]*)|(`.+`)/);t.tokenize=m;return"def"}function z(e,t){if(e.eatSpace()){return null}if(!t.hasPassedFirstStage&&e.eat("{")){t.hasPassedFirstStage=true;return"bracket"}else if(t.hasPassedFirstStage){e.match(/([A-Z][A-Za-z0-9_]*)|(`.+`)|\$/);t.hasPassedFirstStage=false;t.tokenize=m;return"def"}else{t.tokenize=m;return null}}function v(e,t){var n=false,r;while(r=e.next()){if(r=="/"&&n){t.tokenize=m;break}n=r=="*"}return"comment"}function b(e){return function(t,n){var r=false,a,i=false;while((a=t.next())!=null){if(a==e&&!r){i=true;break}r=!r&&a=="\\"}if(i||!r)n.tokenize=m;return"string"}}function w(){var e=o.concat(c);return new RegExp("[\\[\\]]|("+e.join("|")+")$")}const g={name:"oz",startState:function(){return{tokenize:m,currentIndent:0,doInCurrentLine:false,hasPassedFirstStage:false}},token:function(e,t){if(e.sol())t.doInCurrentLine=0;return t.tokenize(e,t)},indent:function(e,t,n){var r=t.replace(/^\s+|\s+$/g,"");if(r.match(d)||r.match(h)||r.match(/(\[])/))return n.unit*(e.currentIndent-1);if(e.currentIndent<0)return 0;return e.currentIndent*n.unit},languageData:{indentOnInut:w(),commentTokens:{line:"%",block:{open:"/*",close:"*/"}}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7575.2e3e32236d5667bba43f.js b/.venv/share/jupyter/lab/static/7575.2e3e32236d5667bba43f.js new file mode 100644 index 0000000000000000000000000000000000000000..7f780b8bc9d74d95e9a347cbc71d16474d0f9d63 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7575.2e3e32236d5667bba43f.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7575],{47575:(e,t,r)=>{r.r(t);r.d(t,{julia:()=>$});function n(e,t,r){if(typeof r==="undefined")r="";if(typeof t==="undefined"){t="\\b"}return new RegExp("^"+r+"(("+e.join(")|(")+"))"+t)}var a="\\\\[0-7]{1,3}";var i="\\\\x[A-Fa-f0-9]{1,2}";var u="\\\\[abefnrtv0%?'\"\\\\]";var s="([^\\u0027\\u005C\\uD800-\\uDFFF]|[\\uD800-\\uDFFF][\\uDC00-\\uDFFF])";var o=["[<>]:","[<>=]=","<<=?",">>>?=?","=>","--?>","<--[->]?","\\/\\/","\\.{2,3}","[\\.\\\\%*+\\-<>!\\/^|&]=?","\\?","\\$","~",":"];var f=n(["[<>]:","[<>=]=","[!=]==","<<=?",">>>?=?","=>?","--?>","<--[->]?","\\/\\/","[\\\\%*+\\-<>!\\/^|&\\u00F7\\u22BB]=?","\\?","\\$","~",":","\\u00D7","\\u2208","\\u2209","\\u220B","\\u220C","\\u2218","\\u221A","\\u221B","\\u2229","\\u222A","\\u2260","\\u2264","\\u2265","\\u2286","\\u2288","\\u228A","\\u22C5","\\b(in|isa)\\b(?!.?\\()"],"");var c=/^[;,()[\]{}]/;var l=/^[_A-Za-z\u00A1-\u2217\u2219-\uFFFF][\w\u00A1-\u2217\u2219-\uFFFF]*!*/;var m=n([a,i,u,s],"'");var p=["begin","function","type","struct","immutable","let","macro","for","while","quote","if","else","elseif","try","finally","catch","do"];var h=["end","else","elseif","catch","finally"];var d=["if","else","elseif","while","for","begin","let","end","do","try","catch","finally","return","break","continue","global","local","const","export","import","importall","using","function","where","macro","module","baremodule","struct","type","mutable","immutable","quote","typealias","abstract","primitive","bitstype"];var v=["true","false","nothing","NaN","Inf"];var F=n(p);var k=n(h);var b=n(d);var g=n(v);var y=/^@[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;var _=/^:[_A-Za-z\u00A1-\uFFFF][\w\u00A1-\uFFFF]*!*/;var x=/^(`|([_A-Za-z\u00A1-\uFFFF]*"("")?))/;var A=n(o,"","@");var z=n(o,"",":");function E(e){return e.nestedArrays>0}function w(e){return e.nestedGenerators>0}function D(e,t){if(typeof t==="undefined"){t=0}if(e.scopes.length<=t){return null}return e.scopes[e.scopes.length-(t+1)]}function T(e,t){if(e.match("#=",false)){t.tokenize=P;return t.tokenize(e,t)}var r=t.leavingExpr;if(e.sol()){r=false}t.leavingExpr=false;if(r){if(e.match(/^'+/)){return"operator"}}if(e.match(/\.{4,}/)){return"error"}else if(e.match(/\.{1,3}/)){return"operator"}if(e.eatSpace()){return null}var n=e.peek();if(n==="#"){e.skipToEnd();return"comment"}if(n==="["){t.scopes.push("[");t.nestedArrays++}if(n==="("){t.scopes.push("(");t.nestedGenerators++}if(E(t)&&n==="]"){while(t.scopes.length&&D(t)!=="["){t.scopes.pop()}t.scopes.pop();t.nestedArrays--;t.leavingExpr=true}if(w(t)&&n===")"){while(t.scopes.length&&D(t)!=="("){t.scopes.pop()}t.scopes.pop();t.nestedGenerators--;t.leavingExpr=true}if(E(t)){if(t.lastToken=="end"&&e.match(":")){return"operator"}if(e.match("end")){return"number"}}var a;if(a=e.match(F,false)){t.scopes.push(a[0])}if(e.match(k,false)){t.scopes.pop()}if(e.match(/^::(?![:\$])/)){t.tokenize=C;return t.tokenize(e,t)}if(!r&&(e.match(_)||e.match(z))){return"builtin"}if(e.match(f)){return"operator"}if(e.match(/^\.?\d/,false)){var i=RegExp(/^im\b/);var u=false;if(e.match(/^0x\.[0-9a-f_]+p[\+\-]?[_\d]+/i)){u=true}if(e.match(/^0x[0-9a-f_]+/i)){u=true}if(e.match(/^0b[01_]+/i)){u=true}if(e.match(/^0o[0-7_]+/i)){u=true}if(e.match(/^(?:(?:\d[_\d]*)?\.(?!\.)(?:\d[_\d]*)?|\d[_\d]*\.(?!\.)(?:\d[_\d]*))?([Eef][\+\-]?[_\d]+)?/i)){u=true}if(e.match(/^\d[_\d]*(e[\+\-]?\d+)?/i)){u=true}if(u){e.match(i);t.leavingExpr=true;return"number"}}if(e.match("'")){t.tokenize=j;return t.tokenize(e,t)}if(e.match(x)){t.tokenize=B(e.current());return t.tokenize(e,t)}if(e.match(y)||e.match(A)){return"meta"}if(e.match(c)){return null}if(e.match(b)){return"keyword"}if(e.match(g)){return"builtin"}var s=t.isDefinition||t.lastToken=="function"||t.lastToken=="macro"||t.lastToken=="type"||t.lastToken=="struct"||t.lastToken=="immutable";if(e.match(l)){if(s){if(e.peek()==="."){t.isDefinition=true;return"variable"}t.isDefinition=false;return"def"}t.leavingExpr=true;return"variable"}e.next();return"error"}function C(e,t){e.match(/.*?(?=[,;{}()=\s]|$)/);if(e.match("{")){t.nestedParameters++}else if(e.match("}")&&t.nestedParameters>0){t.nestedParameters--}if(t.nestedParameters>0){e.match(/.*?(?={|})/)||e.next()}else if(t.nestedParameters==0){t.tokenize=T}return"builtin"}function P(e,t){if(e.match("#=")){t.nestedComments++}if(!e.match(/.*?(?=(#=|=#))/)){e.skipToEnd()}if(e.match("=#")){t.nestedComments--;if(t.nestedComments==0)t.tokenize=T}return"comment"}function j(e,t){var r=false,n;if(e.match(m)){r=true}else if(n=e.match(/\\u([a-f0-9]{1,4})(?=')/i)){var a=parseInt(n[1],16);if(a<=55295||a>=57344){r=true;e.next()}}else if(n=e.match(/\\U([A-Fa-f0-9]{5,8})(?=')/)){var a=parseInt(n[1],16);if(a<=1114111){r=true;e.next()}}if(r){t.leavingExpr=true;t.tokenize=T;return"string"}if(!e.match(/^[^']+(?=')/)){e.skipToEnd()}if(e.match("'")){t.tokenize=T}return"error"}function B(e){if(e.substr(-3)==='"""'){e='"""'}else if(e.substr(-1)==='"'){e='"'}function t(t,r){if(t.eat("\\")){t.next()}else if(t.match(e)){r.tokenize=T;r.leavingExpr=true;return"string"}else{t.eat(/[`"]/)}t.eatWhile(/[^\\`"]/);return"string"}return t}const $={name:"julia",startState:function(){return{tokenize:T,scopes:[],lastToken:null,leavingExpr:false,isDefinition:false,nestedArrays:0,nestedComments:0,nestedGenerators:0,nestedParameters:0,firstParenPos:-1}},token:function(e,t){var r=t.tokenize(e,t);var n=e.current();if(n&&r){t.lastToken=n}return r},indent:function(e,t,r){var n=0;if(t==="]"||t===")"||/^end\b/.test(t)||/^else/.test(t)||/^catch\b/.test(t)||/^elseif\b/.test(t)||/^finally/.test(t)){n=-1}return(e.scopes.length+n)*r.unit},languageData:{indentOnInput:/^\s*(end|else|catch|finally)\b$/,commentTokens:{line:"#",block:{open:"#=",close:"=#"}},closeBrackets:{brackets:["(","[","{",'"']},autocomplete:d.concat(v)}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7587.3112240b6b82407b0f16.js b/.venv/share/jupyter/lab/static/7587.3112240b6b82407b0f16.js new file mode 100644 index 0000000000000000000000000000000000000000..49def792277cebebd480b44268961297018f2d7d --- /dev/null +++ b/.venv/share/jupyter/lab/static/7587.3112240b6b82407b0f16.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7587],{17587:(e,t,a)=>{a.r(t);a.d(t,{ebnf:()=>c});var s={slash:0,parenthesis:1};var r={comment:0,_string:1,characterClass:2};const c={name:"ebnf",startState:function(){return{stringType:null,commentType:null,braced:0,lhs:true,localState:null,stack:[],inDefinition:false}},token:function(e,t){if(!e)return;if(t.stack.length===0){if(e.peek()=='"'||e.peek()=="'"){t.stringType=e.peek();e.next();t.stack.unshift(r._string)}else if(e.match("/*")){t.stack.unshift(r.comment);t.commentType=s.slash}else if(e.match("(*")){t.stack.unshift(r.comment);t.commentType=s.parenthesis}}switch(t.stack[0]){case r._string:while(t.stack[0]===r._string&&!e.eol()){if(e.peek()===t.stringType){e.next();t.stack.shift()}else if(e.peek()==="\\"){e.next();e.next()}else{e.match(/^.[^\\\"\']*/)}}return t.lhs?"property":"string";case r.comment:while(t.stack[0]===r.comment&&!e.eol()){if(t.commentType===s.slash&&e.match("*/")){t.stack.shift();t.commentType=null}else if(t.commentType===s.parenthesis&&e.match("*)")){t.stack.shift();t.commentType=null}else{e.match(/^.[^\*]*/)}}return"comment";case r.characterClass:while(t.stack[0]===r.characterClass&&!e.eol()){if(!(e.match(/^[^\]\\]+/)||e.match("."))){t.stack.shift()}}return"operator"}var a=e.peek();switch(a){case"[":e.next();t.stack.unshift(r.characterClass);return"bracket";case":":case"|":case";":e.next();return"operator";case"%":if(e.match("%%")){return"header"}else if(e.match(/[%][A-Za-z]+/)){return"keyword"}else if(e.match(/[%][}]/)){return"bracket"}break;case"/":if(e.match(/[\/][A-Za-z]+/)){return"keyword"}case"\\":if(e.match(/[\][a-z]+/)){return"string.special"}case".":if(e.match(".")){return"atom"}case"*":case"-":case"+":case"^":if(e.match(a)){return"atom"}case"$":if(e.match("$$")){return"builtin"}else if(e.match(/[$][0-9]+/)){return"variableName.special"}case"<":if(e.match(/<<[a-zA-Z_]+>>/)){return"builtin"}}if(e.match("//")){e.skipToEnd();return"comment"}else if(e.match("return")){return"operator"}else if(e.match(/^[a-zA-Z_][a-zA-Z0-9_]*/)){if(e.match(/(?=[\(.])/)){return"variable"}else if(e.match(/(?=[\s\n]*[:=])/)){return"def"}return"variableName.special"}else if(["[","]","(",")"].indexOf(e.peek())!=-1){e.next();return"bracket"}else if(!e.eatSpace()){e.next()}return null}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7694.1cbff84dccb512476b7c.js b/.venv/share/jupyter/lab/static/7694.1cbff84dccb512476b7c.js new file mode 100644 index 0000000000000000000000000000000000000000..0ff28f5d07dd4433353c37d543d35433bc085dc6 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7694.1cbff84dccb512476b7c.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7694],{57694:(e,n,t)=>{t.r(n);t.d(n,{jinja2:()=>c});var a=["and","as","block","endblock","by","cycle","debug","else","elif","extends","filter","endfilter","firstof","do","for","endfor","if","endif","ifchanged","endifchanged","ifequal","endifequal","ifnotequal","set","raw","endraw","endifnotequal","in","include","load","not","now","or","parsed","regroup","reversed","spaceless","call","endcall","macro","endmacro","endspaceless","ssi","templatetag","openblock","closeblock","openvariable","closevariable","without","context","openbrace","closebrace","opencomment","closecomment","widthratio","url","with","endwith","get_current_language","trans","endtrans","noop","blocktrans","endblocktrans","get_available_languages","get_current_language_bidi","pluralize","autoescape","endautoescape"],i=/^[+\-*&%=<>!?|~^]/,r=/^[:\[\(\{]/,s=["true","false"],l=/^(\d[+\-\*\/])?\d+(\.\d+)?/;a=new RegExp("(("+a.join(")|(")+"))\\b");s=new RegExp("(("+s.join(")|(")+"))\\b");function o(e,n){var t=e.peek();if(n.incomment){if(!e.skipTo("#}")){e.skipToEnd()}else{e.eatWhile(/\#|}/);n.incomment=false}return"comment"}else if(n.intag){if(n.operator){n.operator=false;if(e.match(s)){return"atom"}if(e.match(l)){return"number"}}if(n.sign){n.sign=false;if(e.match(s)){return"atom"}if(e.match(l)){return"number"}}if(n.instring){if(t==n.instring){n.instring=false}e.next();return"string"}else if(t=="'"||t=='"'){n.instring=t;e.next();return"string"}else if(n.inbraces>0&&t==")"){e.next();n.inbraces--}else if(t=="("){e.next();n.inbraces++}else if(n.inbrackets>0&&t=="]"){e.next();n.inbrackets--}else if(t=="["){e.next();n.inbrackets++}else if(!n.lineTag&&(e.match(n.intag+"}")||e.eat("-")&&e.match(n.intag+"}"))){n.intag=false;return"tag"}else if(e.match(i)){n.operator=true;return"operator"}else if(e.match(r)){n.sign=true}else{if(e.column()==1&&n.lineTag&&e.match(a)){return"keyword"}if(e.eat(" ")||e.sol()){if(e.match(a)){return"keyword"}if(e.match(s)){return"atom"}if(e.match(l)){return"number"}if(e.sol()){e.next()}}else{e.next()}}return"variable"}else if(e.eat("{")){if(e.eat("#")){n.incomment=true;if(!e.skipTo("#}")){e.skipToEnd()}else{e.eatWhile(/\#|}/);n.incomment=false}return"comment"}else if(t=e.eat(/\{|%/)){n.intag=t;n.inbraces=0;n.inbrackets=0;if(t=="{"){n.intag="}"}e.eat("-");return"tag"}}else if(e.eat("#")){if(e.peek()=="#"){e.skipToEnd();return"comment"}else if(!e.eol()){n.intag=true;n.lineTag=true;n.inbraces=0;n.inbrackets=0;return"tag"}}e.next()}const c={name:"jinja2",startState:function(){return{tokenize:o,inbrackets:0,inbraces:0}},token:function(e,n){var t=n.tokenize(e,n);if(e.eol()&&n.lineTag&&!n.instring&&n.inbraces==0&&n.inbrackets==0){n.intag=false;n.lineTag=false}return t},languageData:{commentTokens:{block:{open:"{#",close:"#}",line:"##"}}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7741.2ad1372a5862c4522be3.js b/.venv/share/jupyter/lab/static/7741.2ad1372a5862c4522be3.js new file mode 100644 index 0000000000000000000000000000000000000000..3072630f92f6b0ef522a48215fce4cb6bc38ea7e --- /dev/null +++ b/.venv/share/jupyter/lab/static/7741.2ad1372a5862c4522be3.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7741],{97741:(a,e,p)=>{p.d(e,{createRadarServices:()=>t.f});var t=p(36578);var r=p(74888)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7756.93d0ab41829355a147ab.js b/.venv/share/jupyter/lab/static/7756.93d0ab41829355a147ab.js new file mode 100644 index 0000000000000000000000000000000000000000..3b15b683ee02081c657d3eb54389fda0c98f49c8 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7756.93d0ab41829355a147ab.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7756],{7756:(e,t,r)=>{r.r(t);r.d(t,{tiddlyWiki:()=>y});var n={};var i={allTags:true,closeAll:true,list:true,newJournal:true,newTiddler:true,permaview:true,saveChanges:true,search:true,slider:true,tabs:true,tag:true,tagging:true,tags:true,tiddler:true,timeline:true,today:true,version:true,option:true,with:true,filter:true};var u=/[\w_\-]/i,a=/^\-\-\-\-+$/,f=/^\/\*\*\*$/,l=/^\*\*\*\/$/,o=/^<<<$/,c=/^\/\/\{\{\{$/,m=/^\/\/\}\}\}$/,s=/^$/,h=/^$/,k=/^\{\{\{$/,p=/^\}\}\}$/,b=/.*?\}\}\}/;function d(e,t,r){t.tokenize=r;return r(e,t)}function w(e,t){var r=e.sol(),i=e.peek();t.block=false;if(r&&/[<\/\*{}\-]/.test(i)){if(e.match(k)){t.block=true;return d(e,t,$)}if(e.match(o))return"quote";if(e.match(f)||e.match(l))return"comment";if(e.match(c)||e.match(m)||e.match(s)||e.match(h))return"comment";if(e.match(a))return"contentSeparator"}e.next();if(r&&/[\/\*!#;:>|]/.test(i)){if(i=="!"){e.skipToEnd();return"header"}if(i=="*"){e.eatWhile("*");return"comment"}if(i=="#"){e.eatWhile("#");return"comment"}if(i==";"){e.eatWhile(";");return"comment"}if(i==":"){e.eatWhile(":");return"comment"}if(i==">"){e.eatWhile(">");return"quote"}if(i=="|")return"header"}if(i=="{"&&e.match("{{"))return d(e,t,$);if(/[hf]/i.test(i)&&/[ti]/i.test(e.peek())&&e.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if(i=='"')return"string";if(i=="~")return"brace";if(/[\[\]]/.test(i)&&e.match(i))return"brace";if(i=="@"){e.eatWhile(u);return"link"}if(/\d/.test(i)){e.eatWhile(/\d/);return"number"}if(i=="/"){if(e.eat("%")){return d(e,t,v)}else if(e.eat("/")){return d(e,t,z)}}if(i=="_"&&e.eat("_"))return d(e,t,W);if(i=="-"&&e.eat("-")){if(e.peek()!=" ")return d(e,t,g);if(e.peek()==" ")return"brace"}if(i=="'"&&e.eat("'"))return d(e,t,_);if(i=="<"&&e.eat("<"))return d(e,t,x);e.eatWhile(/[\w\$_]/);return n.propertyIsEnumerable(e.current())?"keyword":null}function v(e,t){var r=false,n;while(n=e.next()){if(n=="/"&&r){t.tokenize=w;break}r=n=="%"}return"comment"}function _(e,t){var r=false,n;while(n=e.next()){if(n=="'"&&r){t.tokenize=w;break}r=n=="'"}return"strong"}function $(e,t){var r=t.block;if(r&&e.current()){return"comment"}if(!r&&e.match(b)){t.tokenize=w;return"comment"}if(r&&e.sol()&&e.match(p)){t.tokenize=w;return"comment"}e.next();return"comment"}function z(e,t){var r=false,n;while(n=e.next()){if(n=="/"&&r){t.tokenize=w;break}r=n=="/"}return"emphasis"}function W(e,t){var r=false,n;while(n=e.next()){if(n=="_"&&r){t.tokenize=w;break}r=n=="_"}return"link"}function g(e,t){var r=false,n;while(n=e.next()){if(n=="-"&&r){t.tokenize=w;break}r=n=="-"}return"deleted"}function x(e,t){if(e.current()=="<<"){return"meta"}var r=e.next();if(!r){t.tokenize=w;return null}if(r==">"){if(e.peek()==">"){e.next();t.tokenize=w;return"meta"}}e.eatWhile(/[\w\$_]/);return i.propertyIsEnumerable(e.current())?"keyword":null}const y={name:"tiddlywiki",startState:function(){return{tokenize:w}},token:function(e,t){if(e.eatSpace())return null;var r=t.tokenize(e,t);return r}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7769.d39df7673ee2660a9ac4.js b/.venv/share/jupyter/lab/static/7769.d39df7673ee2660a9ac4.js new file mode 100644 index 0000000000000000000000000000000000000000..1bd879f8e0e0a4fd182b8d5e0c425ed54e7886a5 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7769.d39df7673ee2660a9ac4.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7769],{7769:(e,t,r)=>{r.r(t);r.d(t,{idl:()=>p});function i(e){return new RegExp("^(("+e.join(")|(")+"))\\b","i")}var a=["a_correlate","abs","acos","adapt_hist_equal","alog","alog2","alog10","amoeba","annotate","app_user_dir","app_user_dir_query","arg_present","array_equal","array_indices","arrow","ascii_template","asin","assoc","atan","axis","axis","bandpass_filter","bandreject_filter","barplot","bar_plot","beseli","beselj","beselk","besely","beta","biginteger","bilinear","bin_date","binary_template","bindgen","binomial","bit_ffs","bit_population","blas_axpy","blk_con","boolarr","boolean","boxplot","box_cursor","breakpoint","broyden","bubbleplot","butterworth","bytarr","byte","byteorder","bytscl","c_correlate","calendar","caldat","call_external","call_function","call_method","call_procedure","canny","catch","cd","cdf","ceil","chebyshev","check_math","chisqr_cvf","chisqr_pdf","choldc","cholsol","cindgen","cir_3pnt","clipboard","close","clust_wts","cluster","cluster_tree","cmyk_convert","code_coverage","color_convert","color_exchange","color_quan","color_range_map","colorbar","colorize_sample","colormap_applicable","colormap_gradient","colormap_rotation","colortable","comfit","command_line_args","common","compile_opt","complex","complexarr","complexround","compute_mesh_normals","cond","congrid","conj","constrained_min","contour","contour","convert_coord","convol","convol_fft","coord2to3","copy_lun","correlate","cos","cosh","cpu","cramer","createboxplotdata","create_cursor","create_struct","create_view","crossp","crvlength","ct_luminance","cti_test","cursor","curvefit","cv_coord","cvttobm","cw_animate","cw_animate_getp","cw_animate_load","cw_animate_run","cw_arcball","cw_bgroup","cw_clr_index","cw_colorsel","cw_defroi","cw_field","cw_filesel","cw_form","cw_fslider","cw_light_editor","cw_light_editor_get","cw_light_editor_set","cw_orient","cw_palette_editor","cw_palette_editor_get","cw_palette_editor_set","cw_pdmenu","cw_rgbslider","cw_tmpl","cw_zoom","db_exists","dblarr","dcindgen","dcomplex","dcomplexarr","define_key","define_msgblk","define_msgblk_from_file","defroi","defsysv","delvar","dendro_plot","dendrogram","deriv","derivsig","determ","device","dfpmin","diag_matrix","dialog_dbconnect","dialog_message","dialog_pickfile","dialog_printersetup","dialog_printjob","dialog_read_image","dialog_write_image","dictionary","digital_filter","dilate","dindgen","dissolve","dist","distance_measure","dlm_load","dlm_register","doc_library","double","draw_roi","edge_dog","efont","eigenql","eigenvec","ellipse","elmhes","emboss","empty","enable_sysrtn","eof","eos","erase","erf","erfc","erfcx","erode","errorplot","errplot","estimator_filter","execute","exit","exp","expand","expand_path","expint","extract","extract_slice","f_cvf","f_pdf","factorial","fft","file_basename","file_chmod","file_copy","file_delete","file_dirname","file_expand_path","file_gunzip","file_gzip","file_info","file_lines","file_link","file_mkdir","file_move","file_poll_input","file_readlink","file_same","file_search","file_tar","file_test","file_untar","file_unzip","file_which","file_zip","filepath","findgen","finite","fix","flick","float","floor","flow3","fltarr","flush","format_axis_values","forward_function","free_lun","fstat","fulstr","funct","function","fv_test","fx_root","fz_roots","gamma","gamma_ct","gauss_cvf","gauss_pdf","gauss_smooth","gauss2dfit","gaussfit","gaussian_function","gaussint","get_drive_list","get_dxf_objects","get_kbrd","get_login_info","get_lun","get_screen_size","getenv","getwindows","greg2jul","grib","grid_input","grid_tps","grid3","griddata","gs_iter","h_eq_ct","h_eq_int","hanning","hash","hdf","hdf5","heap_free","heap_gc","heap_nosave","heap_refcount","heap_save","help","hilbert","hist_2d","hist_equal","histogram","hls","hough","hqr","hsv","i18n_multibytetoutf8","i18n_multibytetowidechar","i18n_utf8tomultibyte","i18n_widechartomultibyte","ibeta","icontour","iconvertcoord","idelete","identity","idl_base64","idl_container","idl_validname","idlexbr_assistant","idlitsys_createtool","idlunit","iellipse","igamma","igetcurrent","igetdata","igetid","igetproperty","iimage","image","image_cont","image_statistics","image_threshold","imaginary","imap","indgen","int_2d","int_3d","int_tabulated","intarr","interpol","interpolate","interval_volume","invert","ioctl","iopen","ir_filter","iplot","ipolygon","ipolyline","iputdata","iregister","ireset","iresolve","irotate","isa","isave","iscale","isetcurrent","isetproperty","ishft","isocontour","isosurface","isurface","itext","itranslate","ivector","ivolume","izoom","journal","json_parse","json_serialize","jul2greg","julday","keyword_set","krig2d","kurtosis","kw_test","l64indgen","la_choldc","la_cholmprove","la_cholsol","la_determ","la_eigenproblem","la_eigenql","la_eigenvec","la_elmhes","la_gm_linear_model","la_hqr","la_invert","la_least_square_equality","la_least_squares","la_linear_equation","la_ludc","la_lumprove","la_lusol","la_svd","la_tridc","la_trimprove","la_triql","la_trired","la_trisol","label_date","label_region","ladfit","laguerre","lambda","lambdap","lambertw","laplacian","least_squares_filter","leefilt","legend","legendre","linbcg","lindgen","linfit","linkimage","list","ll_arc_distance","lmfit","lmgr","lngamma","lnp_test","loadct","locale_get","logical_and","logical_or","logical_true","lon64arr","lonarr","long","long64","lsode","lu_complex","ludc","lumprove","lusol","m_correlate","machar","make_array","make_dll","make_rt","map","mapcontinents","mapgrid","map_2points","map_continents","map_grid","map_image","map_patch","map_proj_forward","map_proj_image","map_proj_info","map_proj_init","map_proj_inverse","map_set","matrix_multiply","matrix_power","max","md_test","mean","meanabsdev","mean_filter","median","memory","mesh_clip","mesh_decimate","mesh_issolid","mesh_merge","mesh_numtriangles","mesh_obj","mesh_smooth","mesh_surfacearea","mesh_validate","mesh_volume","message","min","min_curve_surf","mk_html_help","modifyct","moment","morph_close","morph_distance","morph_gradient","morph_hitormiss","morph_open","morph_thin","morph_tophat","multi","n_elements","n_params","n_tags","ncdf","newton","noise_hurl","noise_pick","noise_scatter","noise_slur","norm","obj_class","obj_destroy","obj_hasmethod","obj_isa","obj_new","obj_valid","objarr","on_error","on_ioerror","online_help","openr","openu","openw","oplot","oploterr","orderedhash","p_correlate","parse_url","particle_trace","path_cache","path_sep","pcomp","plot","plot3d","plot","plot_3dbox","plot_field","ploterr","plots","polar_contour","polar_surface","polyfill","polyshade","pnt_line","point_lun","polarplot","poly","poly_2d","poly_area","poly_fit","polyfillv","polygon","polyline","polywarp","popd","powell","pref_commit","pref_get","pref_set","prewitt","primes","print","printf","printd","pro","product","profile","profiler","profiles","project_vol","ps_show_fonts","psafm","pseudo","ptr_free","ptr_new","ptr_valid","ptrarr","pushd","qgrid3","qhull","qromb","qromo","qsimp","query_*","query_ascii","query_bmp","query_csv","query_dicom","query_gif","query_image","query_jpeg","query_jpeg2000","query_mrsid","query_pict","query_png","query_ppm","query_srf","query_tiff","query_video","query_wav","r_correlate","r_test","radon","randomn","randomu","ranks","rdpix","read","readf","read_ascii","read_binary","read_bmp","read_csv","read_dicom","read_gif","read_image","read_interfile","read_jpeg","read_jpeg2000","read_mrsid","read_pict","read_png","read_ppm","read_spr","read_srf","read_sylk","read_tiff","read_video","read_wav","read_wave","read_x11_bitmap","read_xwd","reads","readu","real_part","rebin","recall_commands","recon3","reduce_colors","reform","region_grow","register_cursor","regress","replicate","replicate_inplace","resolve_all","resolve_routine","restore","retall","return","reverse","rk4","roberts","rot","rotate","round","routine_filepath","routine_info","rs_test","s_test","save","savgol","scale3","scale3d","scatterplot","scatterplot3d","scope_level","scope_traceback","scope_varfetch","scope_varname","search2d","search3d","sem_create","sem_delete","sem_lock","sem_release","set_plot","set_shading","setenv","sfit","shade_surf","shade_surf_irr","shade_volume","shift","shift_diff","shmdebug","shmmap","shmunmap","shmvar","show3","showfont","signum","simplex","sin","sindgen","sinh","size","skewness","skip_lun","slicer3","slide_image","smooth","sobel","socket","sort","spawn","sph_4pnt","sph_scat","spher_harm","spl_init","spl_interp","spline","spline_p","sprsab","sprsax","sprsin","sprstp","sqrt","standardize","stddev","stop","strarr","strcmp","strcompress","streamline","streamline","stregex","stretch","string","strjoin","strlen","strlowcase","strmatch","strmessage","strmid","strpos","strput","strsplit","strtrim","struct_assign","struct_hide","strupcase","surface","surface","surfr","svdc","svdfit","svsol","swap_endian","swap_endian_inplace","symbol","systime","t_cvf","t_pdf","t3d","tag_names","tan","tanh","tek_color","temporary","terminal_size","tetra_clip","tetra_surface","tetra_volume","text","thin","thread","threed","tic","time_test2","timegen","timer","timestamp","timestamptovalues","tm_test","toc","total","trace","transpose","tri_surf","triangulate","trigrid","triql","trired","trisol","truncate_lun","ts_coef","ts_diff","ts_fcast","ts_smooth","tv","tvcrs","tvlct","tvrd","tvscl","typename","uindgen","uint","uintarr","ul64indgen","ulindgen","ulon64arr","ulonarr","ulong","ulong64","uniq","unsharp_mask","usersym","value_locate","variance","vector","vector_field","vel","velovect","vert_t3d","voigt","volume","voronoi","voxel_proj","wait","warp_tri","watershed","wdelete","wf_draw","where","widget_base","widget_button","widget_combobox","widget_control","widget_displaycontextmenu","widget_draw","widget_droplist","widget_event","widget_info","widget_label","widget_list","widget_propertysheet","widget_slider","widget_tab","widget_table","widget_text","widget_tree","widget_tree_move","widget_window","wiener_filter","window","window","write_bmp","write_csv","write_gif","write_image","write_jpeg","write_jpeg2000","write_nrif","write_pict","write_png","write_ppm","write_spr","write_srf","write_sylk","write_tiff","write_video","write_wav","write_wave","writeu","wset","wshow","wtn","wv_applet","wv_cwt","wv_cw_wavelet","wv_denoise","wv_dwt","wv_fn_coiflet","wv_fn_daubechies","wv_fn_gaussian","wv_fn_haar","wv_fn_morlet","wv_fn_paul","wv_fn_symlet","wv_import_data","wv_import_wavelet","wv_plot3d_wps","wv_plot_multires","wv_pwt","wv_tool_denoise","xbm_edit","xdisplayfile","xdxf","xfont","xinteranimate","xloadct","xmanager","xmng_tmpl","xmtool","xobjview","xobjview_rotate","xobjview_write_image","xpalette","xpcolor","xplot3d","xregistered","xroi","xsq_test","xsurface","xvaredit","xvolume","xvolume_rotate","xvolume_write_image","xyouts","zlib_compress","zlib_uncompress","zoom","zoom_24"];var _=i(a);var o=["begin","end","endcase","endfor","endwhile","endif","endrep","endforeach","break","case","continue","for","foreach","goto","if","then","else","repeat","until","switch","while","do","pro","function"];var l=i(o);var s=new RegExp("^[_a-z¡-￿][_a-z0-9¡-￿]*","i");var n=/[+\-*&=<>\/@#~$]/;var c=new RegExp("(and|or|eq|lt|le|gt|ge|ne|not)","i");function d(e){if(e.eatSpace())return null;if(e.match(";")){e.skipToEnd();return"comment"}if(e.match(/^[0-9\.+-]/,false)){if(e.match(/^[+-]?0x[0-9a-fA-F]+/))return"number";if(e.match(/^[+-]?\d*\.\d+([EeDd][+-]?\d+)?/))return"number";if(e.match(/^[+-]?\d+([EeDd][+-]?\d+)?/))return"number"}if(e.match(/^"([^"]|(""))*"/)){return"string"}if(e.match(/^'([^']|(''))*'/)){return"string"}if(e.match(l)){return"keyword"}if(e.match(_)){return"builtin"}if(e.match(s)){return"variable"}if(e.match(n)||e.match(c)){return"operator"}e.next();return null}const p={name:"idl",token:function(e){return d(e)},languageData:{autocomplete:a.concat(o)}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7803.0c8929610218552319bf.js b/.venv/share/jupyter/lab/static/7803.0c8929610218552319bf.js new file mode 100644 index 0000000000000000000000000000000000000000..bb88637378a66f653413bcaedd12e77544467507 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7803.0c8929610218552319bf.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7803],{57803:(t,e,a)=>{a.r(e);a.d(e,{Tag:()=>o,classHighlighter:()=>K,getStyleTags:()=>y,highlightCode:()=>k,highlightTree:()=>u,styleTags:()=>f,tagHighlighter:()=>p,tags:()=>I});var i=a(66575);var r=a.n(i);let n=0;class o{constructor(t,e,a,i){this.name=t;this.set=e;this.base=a;this.modified=i;this.id=n++}toString(){let{name:t}=this;for(let e of this.modified)if(e.name)t=`${e.name}(${t})`;return t}static define(t,e){let a=typeof t=="string"?t:"?";if(t instanceof o)e=t;if(e===null||e===void 0?void 0:e.base)throw new Error("Can not derive from a modified tag");let i=new o(a,[],null,[]);i.set.push(i);if(e)for(let r of e.set)i.set.push(r);return i}static defineModifier(t){let e=new l(t);return t=>{if(t.modified.indexOf(e)>-1)return t;return l.get(t.base||t,t.modified.concat(e).sort(((t,e)=>t.id-e.id)))}}}let s=0;class l{constructor(t){this.name=t;this.instances=[];this.id=s++}static get(t,e){if(!e.length)return t;let a=e[0].instances.find((a=>a.base==t&&c(e,a.modified)));if(a)return a;let i=[],r=new o(t.name,i,t,e);for(let o of e)o.instances.push(r);let n=h(e);for(let o of t.set)if(!o.modified.length)for(let t of n)i.push(l.get(o,t));return r}}function c(t,e){return t.length==e.length&&t.every(((t,a)=>t==e[a]))}function h(t){let e=[[]];for(let a=0;ae.length-t.length))}function f(t){let e=Object.create(null);for(let a in t){let i=t[a];if(!Array.isArray(i))i=[i];for(let t of a.split(" "))if(t){let a=[],r=2,n=t;for(let e=0;;){if(n=="..."&&e>0&&e+3==t.length){r=1;break}let i=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(n);if(!i)throw new RangeError("Invalid path: "+t);a.push(i[0]=="*"?"":i[0][0]=='"'?JSON.parse(i[0]):i[0]);e+=i[0].length;if(e==t.length)break;let o=t[e++];if(e==t.length&&o=="!"){r=0;break}if(o!="/")throw new RangeError("Invalid path: "+t);n=t.slice(e)}let o=a.length-1,s=a[o];if(!s)throw new RangeError("Invalid path: "+t);let l=new d(i,r,o>0?a.slice(0,o):null);e[s]=l.sort(e[s])}}return g.add(e)}const g=new i.NodeProp;class d{constructor(t,e,a,i){this.tags=t;this.mode=e;this.context=a;this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){if(!t||t.depth{let e=r;for(let i of t){for(let t of i.set){let i=a[t.id];if(i){e=e?e+" "+i:i;break}}}return e},scope:i}}function m(t,e){let a=null;for(let i of t){let t=i.style(e);if(t)a=a?a+" "+t:t}return a}function u(t,e,a,i=0,r=t.length){let n=new b(i,Array.isArray(e)?e:[e],a);n.highlightRange(t.cursor(),i,r,"",n.highlighters);n.flush(r)}function k(t,e,a,i,r,n=0,o=t.length){let s=n;function l(e,a){if(e<=s)return;for(let n=t.slice(s,e),o=0;;){let t=n.indexOf("\n",o);let e=t<0?n.length:t;if(e>o)i(n.slice(o,e),a);if(t<0)break;r();o=t+1}s=e}u(e,a,((t,e,a)=>{l(t,"");l(e,a)}),n,o);l(o,"")}class b{constructor(t,e,a){this.at=t;this.highlighters=e;this.span=a;this.class=""}startSpan(t,e){if(e!=this.class){this.flush(t);if(t>this.at)this.at=t;this.class=e}}flush(t){if(t>this.at&&this.class)this.span(this.at,t,this.class)}highlightRange(t,e,a,r,n){let{type:o,from:s,to:l}=t;if(s>=a||l<=e)return;if(o.isTop)n=this.highlighters.filter((t=>!t.scope||t.scope(o)));let c=r;let h=y(t)||d.empty;let f=m(n,h.tags);if(f){if(c)c+=" ";c+=f;if(h.mode==1)r+=(r?" ":"")+f}this.startSpan(Math.max(e,s),c);if(h.opaque)return;let g=t.tree&&t.tree.prop(i.NodeProp.mounted);if(g&&g.overlay){let i=t.node.enter(g.overlay[0].from+s,1);let o=this.highlighters.filter((t=>!t.scope||t.scope(g.tree.type)));let h=t.firstChild();for(let f=0,d=s;;f++){let p=f=m||!t.nextSibling())break}}if(!p||m>a)break;d=p.to+s;if(d>e){this.highlightRange(i.cursor(),Math.max(e,p.from+s),Math.min(a,d),"",o);this.startSpan(Math.min(a,d),c)}}if(h)t.parent()}else if(t.firstChild()){if(g)r="";do{if(t.to<=e)continue;if(t.from>=a)break;this.highlightRange(t,e,a,r,n);this.startSpan(Math.min(a,t.to),c)}while(t.nextSibling());t.parent()}}}function y(t){let e=t.type.prop(g);while(e&&e.context&&!t.matchContext(e.context))e=e.next;return e||null}const N=o.define;const w=N(),v=N(),x=N(v),M=N(v),O=N(),S=N(O),C=N(O),R=N(),A=N(R),_=N(),T=N(),j=N(),q=N(j),E=N();const I={comment:w,lineComment:N(w),blockComment:N(w),docComment:N(w),name:v,variableName:N(v),typeName:x,tagName:N(x),propertyName:M,attributeName:N(M),className:N(v),labelName:N(v),namespace:N(v),macroName:N(v),literal:O,string:S,docString:N(S),character:N(S),attributeValue:N(S),number:C,integer:N(C),float:N(C),bool:N(O),regexp:N(O),escape:N(O),color:N(O),url:N(O),keyword:_,self:N(_),null:N(_),atom:N(_),unit:N(_),modifier:N(_),operatorKeyword:N(_),controlKeyword:N(_),definitionKeyword:N(_),moduleKeyword:N(_),operator:T,derefOperator:N(T),arithmeticOperator:N(T),logicOperator:N(T),bitwiseOperator:N(T),compareOperator:N(T),updateOperator:N(T),definitionOperator:N(T),typeOperator:N(T),controlOperator:N(T),punctuation:j,separator:N(j),bracket:q,angleBracket:N(q),squareBracket:N(q),paren:N(q),brace:N(q),content:R,heading:A,heading1:N(A),heading2:N(A),heading3:N(A),heading4:N(A),heading5:N(A),heading6:N(A),contentSeparator:N(R),list:N(R),quote:N(R),emphasis:N(R),strong:N(R),link:N(R),monospace:N(R),strikethrough:N(R),inserted:N(),deleted:N(),changed:N(),invalid:N(),meta:E,documentMeta:N(E),annotation:N(E),processingInstruction:N(E),definition:o.defineModifier("definition"),constant:o.defineModifier("constant"),function:o.defineModifier("function"),standard:o.defineModifier("standard"),local:o.defineModifier("local"),special:o.defineModifier("special")};for(let B in I){let t=I[B];if(t instanceof o)t.name=B}const K=p([{tag:I.link,class:"tok-link"},{tag:I.heading,class:"tok-heading"},{tag:I.emphasis,class:"tok-emphasis"},{tag:I.strong,class:"tok-strong"},{tag:I.keyword,class:"tok-keyword"},{tag:I.atom,class:"tok-atom"},{tag:I.bool,class:"tok-bool"},{tag:I.url,class:"tok-url"},{tag:I.labelName,class:"tok-labelName"},{tag:I.inserted,class:"tok-inserted"},{tag:I.deleted,class:"tok-deleted"},{tag:I.literal,class:"tok-literal"},{tag:I.string,class:"tok-string"},{tag:I.number,class:"tok-number"},{tag:[I.regexp,I.escape,I.special(I.string)],class:"tok-string2"},{tag:I.variableName,class:"tok-variableName"},{tag:I.local(I.variableName),class:"tok-variableName tok-local"},{tag:I.definition(I.variableName),class:"tok-variableName tok-definition"},{tag:I.special(I.variableName),class:"tok-variableName2"},{tag:I.definition(I.propertyName),class:"tok-propertyName tok-definition"},{tag:I.typeName,class:"tok-typeName"},{tag:I.namespace,class:"tok-namespace"},{tag:I.className,class:"tok-className"},{tag:I.macroName,class:"tok-macroName"},{tag:I.propertyName,class:"tok-propertyName"},{tag:I.operator,class:"tok-operator"},{tag:I.comment,class:"tok-comment"},{tag:I.meta,class:"tok-meta"},{tag:I.invalid,class:"tok-invalid"},{tag:I.punctuation,class:"tok-punctuation"}])}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7856.dd9523e57bed80f1f694.js b/.venv/share/jupyter/lab/static/7856.dd9523e57bed80f1f694.js new file mode 100644 index 0000000000000000000000000000000000000000..30f814c5dfb48086975082fbd34c6a26fa84b68f --- /dev/null +++ b/.venv/share/jupyter/lab/static/7856.dd9523e57bed80f1f694.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7856,5606],{97856:(e,t,i)=>{var s=i(65606);!function(t,i){if(true)e.exports=i();else{var s,r}}(globalThis,(()=>(()=>{"use strict";var e={4567:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.AccessibilityManager=void 0;const n=i(9042),o=i(9924),a=i(844),h=i(4725),c=i(2585),l=i(3656);let d=t.AccessibilityManager=class extends a.Disposable{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let r=0;rthis._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new o.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((e=>this._handleResize(e.rows)))),this.register(this._terminal.onRender((e=>this._refreshRows(e.start,e.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((e=>this._handleChar(e)))),this.register(this._terminal.onLineFeed((()=>this._handleChar("\n")))),this.register(this._terminal.onA11yTab((e=>this._handleTab(e)))),this.register(this._terminal.onKey((e=>this._handleKey(e.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,l.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,a.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=n.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){const i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){const e=i.lines.get(i.ydisp+r),t=[],n=e?.translateToString(!0,void 0,void 0,t)||"",o=(i.ydisp+r+1).toString(),a=this._rowElements[r];a&&(0===n.length?(a.innerText=" ",this._rowColumns.set(a,[0,1])):(a.textContent=n,this._rowColumns.set(a,t)),a.setAttribute("aria-posinset",o),a.setAttribute("aria-setsize",s))}this._announceCharacters()}_announceCharacters(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){const i=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")===(0===t?"1":`${this._terminal.buffer.lines.length}`))return;if(e.relatedTarget!==s)return;let r,n;if(0===t?(r=i,n=this._rowElements.pop(),this._rowContainer.removeChild(n)):(r=this._rowElements.shift(),n=i,this._rowContainer.removeChild(r)),r.removeEventListener("focus",this._topBoundaryFocusListener),n.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){const e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement("afterbegin",e)}else{const e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(0===this._rowElements.length)return;const e=document.getSelection();if(!e)return;if(e.isCollapsed)return void(this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection());if(!e.anchorNode||!e.focusNode)return void console.error("anchorNode and/or focusNode are null");let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;const s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;const r=({node:e,offset:t})=>{const i=e instanceof Text?e.parentNode:e;let s=parseInt(i?.getAttribute("aria-posinset"),10)-1;if(isNaN(s))return console.warn("row is invalid. Race condition?"),null;const r=this._rowColumns.get(i);if(!r)return console.warn("columns is null. Race condition?"),null;let n=t=this._terminal.cols&&(++s,n=0),{row:s,column:n}},n=r(t),o=r(i);if(n&&o){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{function i(e){return e.replace(/\r?\n/g,"\r")}function s(e,t){return t?"[200~"+e+"[201~":e}function r(e,t,r,n){e=s(e=i(e),r.decPrivateModes.bracketedPasteMode&&!0!==n.rawOptions.ignoreBracketedPasteMode),r.triggerDataEvent(e,!0),t.value=""}function n(e,t,i){const s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}Object.defineProperty(t,"__esModule",{value:!0}),t.rightClickHandler=t.moveTextAreaUnderMouseCursor=t.paste=t.handlePasteEvent=t.copyHandler=t.bracketTextForPaste=t.prepareTextForTerminal=void 0,t.prepareTextForTerminal=i,t.bracketTextForPaste=s,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i,s){e.stopPropagation(),e.clipboardData&&r(e.clipboardData.getData("text/plain"),t,i,s)},t.paste=r,t.moveTextAreaUnderMouseCursor=n,t.rightClickHandler=function(e,t,i,s,r){n(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}},7239:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorContrastCache=void 0;const s=i(1505);t.ColorContrastCache=class{constructor(){this._color=new s.TwoKeyMap,this._css=new s.TwoKeyMap}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}}},3656:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=void 0,t.addDisposableDomListener=function(e,t,i,s){e.addEventListener(t,i,s);let r=!1;return{dispose:()=>{r||(r=!0,e.removeEventListener(t,i,s))}}}},3551:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Linkifier=void 0;const n=i(3656),o=i(8460),a=i(844),h=i(2585),c=i(4725);let l=t.Linkifier=class extends a.Disposable{get currentLink(){return this._currentLink}constructor(e,t,i,s,r){super(),this._element=e,this._mouseService=t,this._renderService=i,this._bufferService=s,this._linkProviderService=r,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new o.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new o.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,a.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,a.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,n.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,n.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,n.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(e){this._lastMouseEvent=e;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;const i=e.composedPath();for(let s=0;s{e?.forEach((e=>{e.link.dispose&&e.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(const[s,r]of this._linkProviderService.linkProviders.entries())if(t){const t=this._activeProviderReplies?.get(s);t&&(i=this._checkLinkProviderResult(s,e,i))}else r.provideLinks(e.y,(t=>{if(this._isMouseOut)return;const r=t?.map((e=>({link:e})));this._activeProviderReplies?.set(s,r),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)}))}_removeIntersectingLinks(e,t){const i=new Set;for(let s=0;se?this._bufferService.cols:s.link.range.end.x;for(let e=n;e<=o;e++){if(i.has(e)){r.splice(t--,1);break}i.add(e)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;const s=this._activeProviderReplies.get(e);let r=!1;for(let n=0;nthis._linkAtPosition(e.link,t)));e&&(i=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;nthis._linkAtPosition(e.link,t)));if(e){i=!0,this._handleNewLink(e);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;const t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){this._currentLink&&this._lastMouseEvent&&(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,a.disposeArray)(this._linkCacheDisposables))}_handleNewLink(e){if(!this._lastMouseEvent)return;const t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:void 0===e.link.decorations||e.link.decorations.underline,pointerCursor:void 0===e.link.decorations||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((e=>{if(!this._currentLink)return;const t=0===e.start?0:e.start+1+this._bufferService.buffer.ydisp,i=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=i&&(this._clearCurrentLink(t,i),this._lastMouseEvent)){const e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}}))))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){const i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){const i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){const s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};t.Linkifier=l=s([r(1,c.IMouseService),r(2,c.IRenderService),r(3,h.IBufferService),r(4,c.ILinkProviderService)],l)},9042:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.tooMuchOutput=t.promptLabel=void 0,t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkProvider=void 0;const n=i(511),o=i(2585);let a=t.OscLinkProvider=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){const i=this._bufferService.buffer.lines.get(e-1);if(!i)return void t(void 0);const s=[],r=this._optionsService.rawOptions.linkHandler,o=new n.CellData,a=i.getTrimmedLength();let c=-1,l=-1,d=!1;for(let n=0;nr?r.activate(e,t,i):h(0,t),hover:(e,t)=>r?.hover?.(e,t,i),leave:(e,t)=>r?.leave?.(e,t,i)})}d=!1,o.hasExtendedAttrs()&&o.extended.urlId?(l=n,c=o.extended.urlId):(l=-1,c=-1)}}t(s)}};function h(e,t){if(confirm(`Do you want to navigate to ${t}?\n\nWARNING: This link could potentially be dangerous`)){const e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}t.OscLinkProvider=a=s([r(0,o.IBufferService),r(1,o.IOptionsService),r(2,o.IOscLinkService)],a)},6193:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RenderDebouncer=void 0,t.RenderDebouncer=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._animationFrame=void 0,void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return void this._runRefreshCallbacks();const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}}},3236:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Terminal=void 0;const s=i(3614),r=i(3656),n=i(3551),o=i(9042),a=i(3730),h=i(1680),c=i(3107),l=i(5744),d=i(2950),_=i(1296),u=i(428),f=i(4269),v=i(5114),p=i(8934),g=i(3230),m=i(9312),S=i(4725),C=i(6731),b=i(8055),w=i(8969),y=i(8460),E=i(844),k=i(6114),L=i(8437),D=i(2584),R=i(7399),x=i(5941),A=i(9074),B=i(2585),T=i(5435),M=i(4567),O=i(779);class P extends w.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(e={}){super(e),this.browser=k,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new E.MutableDisposable),this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new y.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new y.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new y.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new y.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new y.EventEmitter),this._onBlur=this.register(new y.EventEmitter),this._onA11yCharEmitter=this.register(new y.EventEmitter),this._onA11yTabEmitter=this.register(new y.EventEmitter),this._onWillOpen=this.register(new y.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(A.DecorationService),this._instantiationService.setService(B.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(O.LinkProviderService),this._instantiationService.setService(S.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(a.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((e,t)=>this.refresh(e,t)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((e=>this._reportWindowsOptions(e)))),this.register(this._inputHandler.onColor((e=>this._handleColorEvent(e)))),this.register((0,y.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,y.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,y.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,y.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((e=>this._afterResize(e.cols,e.rows)))),this.register((0,E.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(e){if(this._themeService)for(const t of e){let e,i="";switch(t.index){case 256:e="foreground",i="10";break;case 257:e="background",i="11";break;case 258:e="cursor",i="12";break;default:e="ansi",i="4;"+t.index}switch(t.type){case 0:const s=b.color.toColorRGB("ansi"===e?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${D.C0.ESC}]${i};${(0,x.toRgbString)(s)}${D.C1_ESCAPED.ST}`);break;case 1:if("ansi"===e)this._themeService.modifyColors((e=>e.ansi[t.index]=b.channels.toColor(...t.color)));else{const i=e;this._themeService.modifyColors((e=>e[i]=b.channels.toColor(...t.color)))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(M.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(D.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;const i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,r.addDisposableDomListener)(this.element,"copy",(e=>{this.hasSelection()&&(0,s.copyHandler)(e,this._selectionService)})));const e=e=>(0,s.handlePasteEvent)(e,this.textarea,this.coreService,this.optionsService);this.register((0,r.addDisposableDomListener)(this.textarea,"paste",e)),this.register((0,r.addDisposableDomListener)(this.element,"paste",e)),k.isFirefox?this.register((0,r.addDisposableDomListener)(this.element,"mousedown",(e=>{2===e.button&&(0,s.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,r.addDisposableDomListener)(this.element,"contextmenu",(e=>{(0,s.rightClickHandler)(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),k.isLinux&&this.register((0,r.addDisposableDomListener)(this.element,"auxclick",(e=>{1===e.button&&(0,s.moveTextAreaUnderMouseCursor)(e,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,r.addDisposableDomListener)(this.textarea,"keyup",(e=>this._keyUp(e)),!0)),this.register((0,r.addDisposableDomListener)(this.textarea,"keydown",(e=>this._keyDown(e)),!0)),this.register((0,r.addDisposableDomListener)(this.textarea,"keypress",(e=>this._keyPress(e)),!0)),this.register((0,r.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,r.addDisposableDomListener)(this.textarea,"compositionupdate",(e=>this._compositionHelper.compositionupdate(e)))),this.register((0,r.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,r.addDisposableDomListener)(this.textarea,"input",(e=>this._inputEvent(e)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);const t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,r.addDisposableDomListener)(this.screenElement,"mousemove",(e=>this.updateCursorStyle(e)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",o.promptLabel),k.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this.register(this._instantiationService.createInstance(v.CoreBrowserService,this.textarea,e.ownerDocument.defaultView??window,this._document??"undefined"!=typeof window?window.document:null)),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this.register((0,r.addDisposableDomListener)(this.textarea,"focus",(e=>this._handleTextAreaFocus(e)))),this.register((0,r.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(u.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(C.ThemeService),this._instantiationService.setService(S.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(f.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(g.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((e=>this._onRender.fire(e)))),this.onResize((e=>this._renderService.resize(e.cols,e.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(d.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(p.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(n.Linkifier,this.screenElement)),this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(h.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),this.register(this.onCursorMove((()=>{this._renderService.handleCursorMove(),this._syncTextArea()}))),this.register(this.onResize((()=>this._renderService.handleResize(this.cols,this.rows)))),this.register(this.onBlur((()=>this._renderService.handleBlur()))),this.register(this.onFocus((()=>this._renderService.handleFocus()))),this.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((e=>this.scrollLines(e.amount,e.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((e=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,r.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(c.BufferDecorationRenderer,this.screenElement)),this.register((0,r.addDisposableDomListener)(this.element,"mousedown",(e=>this._selectionService.handleMouseDown(e)))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(M.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(e=>this._handleScreenReaderModeOptionChange(e)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(_.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const e=this,t=this.element;function i(t){const i=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!i)return!1;let s,r;switch(t.overrideType||t.type){case"mousemove":r=32,void 0===t.buttons?(s=3,void 0!==t.button&&(s=t.button<3?t.button:3)):s=1&t.buttons?0:4&t.buttons?1:2&t.buttons?2:3;break;case"mouseup":r=0,s=t.button<3?t.button:3;break;case"mousedown":r=1,s=t.button<3?t.button:3;break;case"wheel":if(e._customWheelEventHandler&&!1===e._customWheelEventHandler(t))return!1;if(0===e.viewport.getLinesScrolled(t))return!1;r=t.deltaY<0?0:1,s=4;break;default:return!1}return!(void 0===r||void 0===s||s>4)&&e.coreMouseService.triggerMouseEvent({col:i.col,row:i.row,x:i.x,y:i.y,button:s,action:r,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}const s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},n={mouseup:e=>(i(e),e.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(e)),wheel:e=>(i(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&i(e)},mousemove:e=>{e.buttons||i(e)}};this.register(this.coreMouseService.onProtocolChange((e=>{e?("debug"===this.optionsService.rawOptions.logLevel&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(e)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&e?s.mousemove||(t.addEventListener("mousemove",n.mousemove),s.mousemove=n.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),16&e?s.wheel||(t.addEventListener("wheel",n.wheel,{passive:!1}),s.wheel=n.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),2&e?s.mouseup||(s.mouseup=n.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),4&e?s.mousedrag||(s.mousedrag=n.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,r.addDisposableDomListener)(t,"mousedown",(e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return i(e),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(e)}))),this.register((0,r.addDisposableDomListener)(t,"wheel",(e=>{if(!s.wheel){if(this._customWheelEventHandler&&!1===this._customWheelEventHandler(e))return!1;if(!this.buffer.hasScrollback){const t=this.viewport.getLinesScrolled(e);if(0===t)return;const i=D.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B");let s="";for(let e=0;e{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(e),this.cancel(e)}),{passive:!0})),this.register((0,r.addDisposableDomListener)(t,"touchmove",(e=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(e)?void 0:this.cancel(e)}),{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t,i=0){1===i?(super.scrollLines(e,t,i),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(e)}paste(e){(0,s.paste)(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;const t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;t||"Dead"!==e.key&&"AltGraph"!==e.key||(this._unprocessedDeadKey=!0);const i=(0,R.evaluateKeyboardEvent)(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3===i.type||2===i.type){const t=this.rows-1;return this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)}return 1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||!!(e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&1===e.key.length&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(i.key!==D.C0.ETX&&i.key!==D.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey?this.cancel(e,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(e,t){const i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return"keypress"===t.type?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(e){if(e.data&&"insertText"===e.inputType&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e!==this.cols||t!==this.rows?super.resize(e,t):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(e,t){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}clear(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e{Object.defineProperty(t,"__esModule",{value:!0}),t.TimeBasedDebouncer=void 0,t.TimeBasedDebouncer=class{constructor(e,t=1e3){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,i){this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t;const s=Date.now();if(s-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){const e=s-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),t)}}_innerRefresh(){if(void 0===this._rowStart||void 0===this._rowEnd||void 0===this._rowCount)return;const e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}}},1680:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.Viewport=void 0;const n=i(3656),o=i(4725),a=i(8460),h=i(844),c=i(2585);let l=t.Viewport=class extends h.Disposable{constructor(e,t,i,s,r,o,h,c){super(),this._viewportElement=e,this._scrollArea=t,this._bufferService=i,this._optionsService=s,this._charSizeService=r,this._renderService=o,this._coreBrowserService=h,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new a.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,n.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((e=>this._renderDimensions=e))),this._handleThemeChange(c.colors),this.register(c.onChangeColors((e=>this._handleThemeChange(e)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(e){this._viewportElement.style.backgroundColor=e.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(e){if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null}syncScrollArea(e=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(e)}_handleScroll(e){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:t,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||-1===this._smoothScrollState.origin||-1===this._smoothScrollState.target)return;const e=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(e*(this._smoothScrollState.target-this._smoothScrollState.origin)),e<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(e,t){const i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||t>0&&i0&&(i=e),s=""}}return{bufferElements:r,cursorElement:i}}getLinesScrolled(e){if(0===e.deltaY||e.shiftKey)return 0;let t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t}_applyScrollModifier(e,t){const i=this._optionsService.rawOptions.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(e){this._lastTouchY=e.touches[0].pageY}handleTouchMove(e){const t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))}};t.Viewport=l=s([r(2,c.IBufferService),r(3,c.IOptionsService),r(4,o.ICharSizeService),r(5,o.IRenderService),r(6,o.ICoreBrowserService),r(7,o.IThemeService)],l)},3107:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferDecorationRenderer=void 0;const n=i(4725),o=i(844),a=i(2585);let h=t.BufferDecorationRenderer=class extends o.Disposable{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange((()=>this._doRefreshDecorations()))),this.register(this._renderService.onDimensionsChange((()=>{this._dimensionsChanged=!0,this._queueRefresh()}))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt}))),this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh()))),this.register(this._decorationService.onDecorationRemoved((e=>this._removeDecoration(e)))),this.register((0,o.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){void 0===this._animationFrame&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){const t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer","top"===e?.options?.layer),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=(e.options.height||1)*this._renderService.dimensions.css.cell.height+"px",t.style.top=(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){const t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose((()=>{this._decorationElements.delete(e),i.remove()}))),i.style.top=t*this._renderService.dimensions.css.cell.height+"px",i.style.display=this._altBufferIsActive?"none":"block",e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;const i=e.options.x??0;"right"===(e.options.anchor||"left")?t.style.right=i?i*this._renderService.dimensions.css.cell.width+"px":"":t.style.left=i?i*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};t.BufferDecorationRenderer=h=s([r(1,a.IBufferService),r(2,n.ICoreBrowserService),r(3,a.IDecorationService),r(4,n.IRenderService)],h)},5871:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ColorZoneStore=void 0,t.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(const t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position))return void this._addLineToZone(t,e.marker.line)}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}}},5744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OverviewRulerRenderer=void 0;const n=i(5871),o=i(4725),a=i(844),h=i(2585),c={full:0,left:0,center:0,right:0},l={full:0,left:0,center:0,right:0},d={full:0,left:0,center:0,right:0};let _=t.OverviewRulerRenderer=class extends a.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(e,t,i,s,r,o,h){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=o,this._coreBrowserService=h,this._colorZoneStore=new n.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement);const c=this._canvas.getContext("2d");if(!c)throw new Error("Ctx cannot be null");this._ctx=c,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,a.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange((()=>this._queueRefresh()))),this.register(this._bufferService.buffers.onBufferActivate((()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"}))),this.register(this._bufferService.onScroll((()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const e=Math.floor(this._canvas.width/3),t=Math.ceil(this._canvas.width/3);l.full=this._canvas.width,l.left=e,l.center=t,l.right=e,this._refreshDrawHeightConstants(),d.full=0,d.left=0,d.center=l.left,d.right=l.left+l.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowserService.dpr);const e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);c.left=t,c.center=t,c.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1;const e=this._colorZoneStore.zones;for(const t of e)"full"!==t.position&&this._renderColorZone(t);for(const t of e)"full"===t.position&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(d[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-c[e.position||"full"]/2),l[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,void 0===this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};t.OverviewRulerRenderer=_=s([r(2,h.IBufferService),r(3,h.IDecorationService),r(4,o.IRenderService),r(5,h.IOptionsService),r(6,o.ICoreBrowserService)],_)},2950:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CompositionHelper=void 0;const n=i(4725),o=i(2585),a=i(2584);let h=t.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){const e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let t;this._isSendingComposition=!1,e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,e.end):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}}),0)}else{this._isSendingComposition=!1;const e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){const e=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.lengththis.updateCompositionElements(!0)),0)}}};t.CompositionHelper=h=s([r(2,o.IBufferService),r(3,o.IOptionsService),r(4,o.ICoreService),r(5,n.IRenderService)],h)},9806:(e,t)=>{function i(e,t,i){const s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoords=t.getCoordsRelativeToElement=void 0,t.getCoordsRelativeToElement=i,t.getCoords=function(e,t,s,r,n,o,a,h,c){if(!o)return;const l=i(e,t,s);return l?(l[0]=Math.ceil((l[0]+(c?a/2:0))/a),l[1]=Math.ceil(l[1]/h),l[0]=Math.min(Math.max(l[0],1),r+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),n),l):void 0}},9504:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.moveToCellSequence=void 0;const s=i(2584);function r(e,t,i,s){const r=e-n(e,i),a=t-n(t,i),l=Math.abs(r-a)-function(e,t,i){let s=0;const r=e-n(e,i),a=t-n(t,i);for(let n=0;n=0&&et?"A":"B"}function a(e,t,i,s,r,n){let o=e,a=t,h="";for(;o!==i||a!==s;)o+=r?1:-1,r&&o>n.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function h(e,t){const i=t?"O":"[";return s.C0.ESC+i+e}function c(e,t){e=Math.floor(e);let i="";for(let s=0;s0?s-n(s,o):t;const _=s,u=function(e,t,i,s,o,a){let h;return h=r(i,s,o,a).length>0?s-n(s,o):t,e=i&&he?"D":"C",c(Math.abs(o-e),h(d,s));d=l>t?"D":"C";const _=Math.abs(l-t);return c(function(e,t){return t.cols-e}(l>t?e:o,i)+(_-1)*i.cols+1+((l>t?o:e)-1),h(d,s))}},1296:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRenderer=void 0;const n=i(3787),o=i(2550),a=i(2223),h=i(6171),c=i(6052),l=i(4725),d=i(8055),_=i(8460),u=i(844),f=i(2585),v="xterm-dom-renderer-owner-",p="xterm-rows",g="xterm-fg-",m="xterm-bg-",S="xterm-focus",C="xterm-selection";let b=1,w=t.DomRenderer=class extends u.Disposable{constructor(e,t,i,s,r,a,l,d,f,g,m,S,w){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=a,this._linkifier2=l,this._charSizeService=f,this._optionsService=g,this._bufferService=m,this._coreBrowserService=S,this._themeService=w,this._terminalClass=b++,this._rowElements=[],this._selectionRenderModel=(0,c.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new _.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(p),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(C),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,h.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((e=>this._injectCss(e)))),this._injectCss(this._themeService.colors),this._rowFactory=d.createInstance(n.DomRendererRowFactory,document),this._element.classList.add(v+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((e=>this._handleLinkHover(e)))),this.register(this._linkifier2.onHideLinkUnderline((e=>this._handleLinkLeave(e)))),this.register((0,u.toDisposable)((()=>{this._element.classList.remove(v+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new o.WidthCache(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const t=`${this._terminalSelector} .${p} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${p} { color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${p} .xterm-dim { color: ${d.color.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;const i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${p}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${p}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${p}.${S} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${p} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${C} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${C} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${C} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(const[n,o]of e.ansi.entries())t+=`${this._terminalSelector} .${g}${n} { color: ${o.css}; }${this._terminalSelector} .${g}${n}.xterm-dim { color: ${d.color.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${m}${n} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${g}${a.INVERTED_DEFAULT_COLOR} { color: ${d.color.opaque(e.background).css}; }${this._terminalSelector} .${g}${a.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${d.color.multiplyOpacity(d.color.opaque(e.background),.5).css}; }${this._terminalSelector} .${m}${a.INVERTED_DEFAULT_COLOR} { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){const e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){const e=this._document.createElement("div");this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(S),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(S),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t)return;this._selectionRenderModel.update(this._terminal,e,t,i);const s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow;if(n>=this._bufferService.rows||o<0)return;const a=this._document.createDocumentFragment();if(i){const i=e[0]>t[0];a.appendChild(this._createSelectionElement(n,i?t[0]:e[0],i?e[0]:t[0],o-n+1))}else{const i=s===n?e[0]:0,h=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,i,h));const c=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,c)),n!==o){const e=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){const r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width;let o=this.dimensions.css.cell.width*(i-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),r.style.height=s*this.dimensions.css.cell.height+"px",r.style.top=e*this.dimensions.css.cell.height+"px",r.style.left=`${n}px`,r.style.width=`${o}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const e of this._rowElements)e.replaceChildren()}renderRows(e,t){const i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._optionsService.rawOptions.cursorBlink,o=this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){const e=h+i.ydisp,t=this._rowElements[h],c=i.lines.get(e);if(!t||!c)break;t.replaceChildren(...this._rowFactory.createRow(c,e,e===s,o,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${v}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);const o=this._bufferService.rows-1;i=Math.max(Math.min(i,o),0),s=Math.max(Math.min(s,o),0),r=Math.min(r,this._bufferService.cols);const a=this._bufferService.buffer,h=a.ybase+a.y,c=Math.min(a.x,r-1),l=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,_=this._optionsService.rawOptions.cursorInactiveStyle;for(let u=i;u<=s;++u){const o=u+a.ydisp,f=this._rowElements[u],v=a.lines.get(o);if(!f||!v)break;f.replaceChildren(...this._rowFactory.createRow(v,o,o===h,d,_,c,l,this.dimensions.css.cell.width,this._widthCache,n?u===i?e:0:-1,n?(u===s?t:r)-1:-1))}}};t.DomRenderer=w=s([r(7,f.IInstantiationService),r(8,l.ICharSizeService),r(9,f.IOptionsService),r(10,f.IBufferService),r(11,l.ICoreBrowserService),r(12,l.IThemeService)],w)},3787:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.DomRendererRowFactory=void 0;const n=i(2223),o=i(643),a=i(511),h=i(2585),c=i(8055),l=i(4725),d=i(4269),_=i(6171),u=i(3734);let f=t.DomRendererRowFactory=class{constructor(e,t,i,s,r,n,o){this._document=e,this._characterJoinerService=t,this._optionsService=i,this._coreBrowserService=s,this._coreService=r,this._decorationService=n,this._themeService=o,this._workCell=new a.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,i){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=i}createRow(e,t,i,s,r,a,h,l,_,f,p){const g=[],m=this._characterJoinerService.getJoinedCharacters(t),S=this._themeService.colors;let C,b=e.getNoBgTrimmedLength();i&&b0&&M===m[0][0]){O=!0;const t=m.shift();I=new d.JoinedCellData(this._workCell,e.translateToString(!0,t[0],t[1]),t[1]-t[0]),P=t[1]-1,b=I.getWidth()}const H=this._isCellInSelection(M,t),F=i&&M===a,W=T&&M>=f&&M<=p;let U=!1;this._decorationService.forEachDecorationAtCell(M,t,void 0,(e=>{U=!0}));let N=I.getChars()||o.WHITESPACE_CELL_CHAR;if(" "===N&&(I.isUnderline()||I.isOverline())&&(N=" "),A=b*l-_.get(N,I.isBold(),I.isItalic()),C){if(w&&(H&&x||!H&&!x&&I.bg===E)&&(H&&x&&S.selectionForeground||I.fg===k)&&I.extended.ext===L&&W===D&&A===R&&!F&&!O&&!U){I.isInvisible()?y+=o.WHITESPACE_CELL_CHAR:y+=N,w++;continue}w&&(C.textContent=y),C=this._document.createElement("span"),w=0,y=""}else C=this._document.createElement("span");if(E=I.bg,k=I.fg,L=I.extended.ext,D=W,R=A,x=H,O&&a>=M&&a<=P&&(a=M),!this._coreService.isCursorHidden&&F&&this._coreService.isCursorInitialized)if(B.push("xterm-cursor"),this._coreBrowserService.isFocused)h&&B.push("xterm-cursor-blink"),B.push("bar"===s?"xterm-cursor-bar":"underline"===s?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":B.push("xterm-cursor-outline");break;case"block":B.push("xterm-cursor-block");break;case"bar":B.push("xterm-cursor-bar");break;case"underline":B.push("xterm-cursor-underline")}if(I.isBold()&&B.push("xterm-bold"),I.isItalic()&&B.push("xterm-italic"),I.isDim()&&B.push("xterm-dim"),y=I.isInvisible()?o.WHITESPACE_CELL_CHAR:I.getChars()||o.WHITESPACE_CELL_CHAR,I.isUnderline()&&(B.push(`xterm-underline-${I.extended.underlineStyle}`)," "===y&&(y=" "),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())C.style.textDecorationColor=`rgb(${u.AttributeData.toColorRGB(I.getUnderlineColor()).join(",")})`;else{let e=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&e<8&&(e+=8),C.style.textDecorationColor=S.ansi[e].css}I.isOverline()&&(B.push("xterm-overline")," "===y&&(y=" ")),I.isStrikethrough()&&B.push("xterm-strikethrough"),W&&(C.style.textDecoration="underline");let $=I.getFgColor(),j=I.getFgColorMode(),z=I.getBgColor(),K=I.getBgColorMode();const q=!!I.isInverse();if(q){const e=$;$=z,z=e;const t=j;j=K,K=t}let V,G,X,J=!1;switch(this._decorationService.forEachDecorationAtCell(M,t,void 0,(e=>{"top"!==e.options.layer&&J||(e.backgroundColorRGB&&(K=50331648,z=e.backgroundColorRGB.rgba>>8&16777215,V=e.backgroundColorRGB),e.foregroundColorRGB&&(j=50331648,$=e.foregroundColorRGB.rgba>>8&16777215,G=e.foregroundColorRGB),J="top"===e.options.layer)})),!J&&H&&(V=this._coreBrowserService.isFocused?S.selectionBackgroundOpaque:S.selectionInactiveBackgroundOpaque,z=V.rgba>>8&16777215,K=50331648,J=!0,S.selectionForeground&&(j=50331648,$=S.selectionForeground.rgba>>8&16777215,G=S.selectionForeground)),J&&B.push("xterm-decoration-top"),K){case 16777216:case 33554432:X=S.ansi[z],B.push(`xterm-bg-${z}`);break;case 50331648:X=c.channels.toColor(z>>16,z>>8&255,255&z),this._addStyle(C,`background-color:#${v((z>>>0).toString(16),"0",6)}`);break;default:q?(X=S.foreground,B.push(`xterm-bg-${n.INVERTED_DEFAULT_COLOR}`)):X=S.background}switch(V||I.isDim()&&(V=c.color.multiplyOpacity(X,.5)),j){case 16777216:case 33554432:I.isBold()&&$<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&($+=8),this._applyMinimumContrast(C,X,S.ansi[$],I,V,void 0)||B.push(`xterm-fg-${$}`);break;case 50331648:const e=c.channels.toColor($>>16&255,$>>8&255,255&$);this._applyMinimumContrast(C,X,e,I,V,G)||this._addStyle(C,`color:#${v($.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(C,X,S.foreground,I,V,G)||q&&B.push(`xterm-fg-${n.INVERTED_DEFAULT_COLOR}`)}B.length&&(C.className=B.join(" "),B.length=0),F||O||U?C.textContent=y:w++,A!==this.defaultSpacing&&(C.style.letterSpacing=`${A}px`),g.push(C),M=P}return C&&w&&(C.textContent=y),g}_applyMinimumContrast(e,t,i,s,r,n){if(1===this._optionsService.rawOptions.minimumContrastRatio||(0,_.treatGlyphAsBackgroundColor)(s.getCode()))return!1;const o=this._getContrastCache(s);let a;if(r||n||(a=o.getColor(t.rgba,i.rgba)),void 0===a){const e=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=c.color.ensureContrastRatio(r||t,n||i,e),o.setColor((r||t).rgba,(n||i).rgba,a??null)}return!!a&&(this._addStyle(e,`color:${a.css}`),!0)}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){const i=this._selectionStart,s=this._selectionEnd;return!(!i||!s)&&(this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t=i[0]&&e=i[0])}};function v(e,t,i){for(;e.length{Object.defineProperty(t,"__esModule",{value:!0}),t.WidthCache=void 0,t.WidthCache=class{constructor(e,t){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=e.createElement("div"),this._container.classList.add("xterm-width-cache-measure-container"),this._container.setAttribute("aria-hidden","true"),this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const i=e.createElement("span");i.classList.add("xterm-char-measure-element");const s=e.createElement("span");s.classList.add("xterm-char-measure-element"),s.style.fontWeight="bold";const r=e.createElement("span");r.classList.add("xterm-char-measure-element"),r.style.fontStyle="italic";const n=e.createElement("span");n.classList.add("xterm-char-measure-element"),n.style.fontWeight="bold",n.style.fontStyle="italic",this._measureElements=[i,s,r,n],this._container.appendChild(i),this._container.appendChild(s),this._container.appendChild(r),this._container.appendChild(n),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,i,s){e===this._font&&t===this._fontSize&&i===this._weight&&s===this._weightBold||(this._font=e,this._fontSize=t,this._weight=i,this._weightBold=s,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${i}`,this._measureElements[1].style.fontWeight=`${s}`,this._measureElements[2].style.fontWeight=`${i}`,this._measureElements[3].style.fontWeight=`${s}`,this.clear())}get(e,t,i){let s=0;if(!t&&!i&&1===e.length&&(s=e.charCodeAt(0))<256){if(-9999!==this._flat[s])return this._flat[s];const t=this._measure(e,0);return t>0&&(this._flat[s]=t),t}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(void 0===n){let s=0;t&&(s|=1),i&&(s|=2),n=this._measure(e,s),n>0&&this._holey.set(r,n)}return n}_measure(e,t){const i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}}},2223:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.TEXT_BASELINE=t.DIM_OPACITY=t.INVERTED_DEFAULT_COLOR=void 0;const s=i(6114);t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.TEXT_BASELINE=s.isFirefox||s.isLegacyEdge?"bottom":"ideographic"},6171:(e,t)=>{function i(e){return 57508<=e&&e<=57558}function s(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}Object.defineProperty(t,"__esModule",{value:!0}),t.computeNextVariantOffset=t.createRenderDimensions=t.treatGlyphAsBackgroundColor=t.allowRescaling=t.isEmoji=t.isRestrictedPowerlineGlyph=t.isPowerlineGlyph=t.throwIfFalsy=void 0,t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e},t.isPowerlineGlyph=i,t.isRestrictedPowerlineGlyph=function(e){return 57520<=e&&e<=57527},t.isEmoji=s,t.allowRescaling=function(e,t,r,n){return 1===t&&r>Math.ceil(1.5*n)&&void 0!==e&&e>255&&!s(e)&&!i(e)&&!function(e){return 57344<=e&&e<=63743}(e)},t.treatGlyphAsBackgroundColor=function(e){return i(e)||function(e){return 9472<=e&&e<=9631}(e)},t.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},t.computeNextVariantOffset=function(e,t,i=0){return(e-(2*Math.round(t)-i))%(2*Math.round(t))}},6052:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createSelectionRenderModel=void 0;class i{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1])return void this.clear();const r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),h=Math.min(o,e.rows-1);a>=e.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=i[0])}isCellSelected(e,t,i){return!!this.hasSelection&&(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&t=this.startCol)}}t.createSelectionRenderModel=function(){return new i}},456:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionModel=void 0,t.SelectionModel=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharSizeService=void 0;const n=i(2585),o=i(8460),a=i(844);let h=t.CharSizeService=class extends a.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this.register(new o.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new d(this._optionsService))}catch{this._measureStrategy=this.register(new l(e,t,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};t.CharSizeService=h=s([r(2,n.IOptionsService)],h);class c extends a.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){void 0!==e&&e>0&&void 0!==t&&t>0&&(this._result.width=e,this._result.height=t)}}class l extends c{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}}class d extends c{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}}},4269:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CharacterJoinerService=t.JoinedCellData=void 0;const n=i(3734),o=i(643),a=i(511),h=i(2585);class c extends n.AttributeData{constructor(e,t,i){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=i}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.JoinedCellData=c;let l=t.CharacterJoinerService=class e{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}register(e){const t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t1){const e=this._getJoinedRanges(s,a,n,t,r);for(let t=0;t{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreBrowserService=void 0;const s=i(844),r=i(8460),n=i(3656);class o extends s.Disposable{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new a(this._window),this._onDprChange=this.register(new r.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new r.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((e=>this._screenDprMonitor.setWindow(e)))),this.register((0,r.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("blur",(()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return void 0===this._cachedIsFocused&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask((()=>this._cachedIsFocused=void 0))),this._cachedIsFocused}}t.CoreBrowserService=o;class a extends s.Disposable{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this.register(new s.MutableDisposable),this._onDprChange=this.register(new r.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,s.toDisposable)((()=>this.clearListener())))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,n.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}}},779:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LinkProviderService=void 0;const s=i(844);class r extends s.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,s.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{const t=this.linkProviders.indexOf(e);-1!==t&&this.linkProviders.splice(t,1)}}}}t.LinkProviderService=r},8934:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.MouseService=void 0;const n=i(4725),o=i(9806);let a=t.MouseService=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return(0,o.getCoords)(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){const i=(0,o.getCoordsRelativeToElement)(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};t.MouseService=a=s([r(0,n.IRenderService),r(1,n.ICharSizeService)],a)},3230:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.RenderService=void 0;const n=i(6193),o=i(4725),a=i(8460),h=i(844),c=i(7226),l=i(2585);let d=t.RenderService=class extends h.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(e,t,i,s,r,o,l,d){super(),this._rowCount=e,this._charSizeService=s,this._renderer=this.register(new h.MutableDisposable),this._pausedResizeTask=new c.DebouncedIdleTask,this._observerDisposable=this.register(new h.MutableDisposable),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new a.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new a.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new a.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new a.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new n.RenderDebouncer(((e,t)=>this._renderRows(e,t)),l),this.register(this._renderDebouncer),this.register(l.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(o.onResize((()=>this._fullRefresh()))),this.register(o.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(i.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(r.onDecorationRegistered((()=>this._fullRefresh()))),this.register(r.onDecorationRemoved((()=>this._fullRefresh()))),this.register(i.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()}))),this.register(i.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(o.buffer.y,o.buffer.y,!0)))),this.register(d.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(l.window,t),this.register(l.onWindowChange((e=>this._registerIntersectionObserver(e,t))))}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){const i=new e.IntersectionObserver((e=>this._handleIntersectionChange(e[e.length-1])),{threshold:0});i.observe(t),this._observerDisposable.value=(0,h.toDisposable)((()=>i.disconnect()))}}_handleIntersectionChange(e){this._isPaused=void 0===e.isIntersecting?0===e.intersectionRatio:!e.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){this._isPaused?this._needsFullRefresh=!0:(i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount))}_renderRows(e,t){this._renderer.value&&(e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0)}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw((e=>this.refreshRows(e.start,e.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(e,t))):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};t.RenderService=d=s([r(2,l.IOptionsService),r(3,o.ICharSizeService),r(4,l.IDecorationService),r(5,l.IBufferService),r(6,o.ICoreBrowserService),r(7,o.IThemeService)],d)},9312:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.SelectionService=void 0;const n=i(9806),o=i(9504),a=i(456),h=i(4725),c=i(8460),l=i(844),d=i(6114),_=i(4841),u=i(511),f=i(2585),v=String.fromCharCode(160),p=new RegExp(v,"g");let g=t.SelectionService=class extends l.Disposable{constructor(e,t,i,s,r,n,o,h,d){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=o,this._renderService=h,this._coreBrowserService=d,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new u.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new c.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new c.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new c.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new c.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((e=>this._handleTrim(e))),this.register(this._bufferService.buffers.onBufferActivate((e=>this._handleBufferActivate(e)))),this.enable(),this._model=new a.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.toDisposable)((()=>{this._removeMouseDownListeners()})))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])}get selectionText(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";const i=this._bufferService.buffer,s=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";const r=e[0]e.replace(p," "))).join(d.isWindows?"\r\n":"\n")}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),d.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})}_isClickInSelection(e){const t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!!(i&&s&&t)&&this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){const i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!(!i||!s)&&this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){const i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=(0,_.getRangeLength)(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const s=this._getMouseBufferCoords(e);return!!s&&(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){const t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=(0,n.getCoordsRelativeToElement)(this._coreBrowserService.window,e,this._screenElement)[1];const i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-50),50),t/=50,t/Math.abs(t)+Math.round(14*t))}shouldForceSelection(e){return d.isMac?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):1===e.detail?this._handleSingleClick(e):2===e.detail?this._handleDoubleClick(e):3===e.detail&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval((()=>this._dragScroll()),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){const t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(d.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;const t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd)return void this.refresh(!0);2===this._activeSelectionMode?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const i=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){const t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&void 0!==t[0]&&void 0!==t[1]){const e=(0,o.moveToCellSequence)(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,i=!(!e||!t||e[0]===t[0]&&e[1]===t[1]);i?e&&t&&(this._oldSelectionStart&&this._oldSelectionEnd&&e[0]===this._oldSelectionStart[0]&&e[1]===this._oldSelectionStart[1]&&t[0]===this._oldSelectionEnd[0]&&t[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(e,t,i)):this._oldHasSelection&&this._fireOnSelectionChange(e,t,i)}_fireOnSelectionChange(e,t,i){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=i,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim((e=>this._handleTrim(e)))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){const r=e.loadCell(s,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;const r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;const o=r.translateBufferLineToString(e[1],!1);let a=this._convertViewportColToCharacterIndex(n,e[0]),h=a;const c=e[0]-a;let l=0,d=0,_=0,u=0;if(" "===o.charAt(a)){for(;a>0&&" "===o.charAt(a-1);)a--;for(;h1&&(u+=s-1,h+=s-1);t>0&&a>0&&!this._isCharWordSeparator(n.loadCell(t-1,this._workCell));){n.loadCell(t-1,this._workCell);const e=this._workCell.getChars().length;0===this._workCell.getWidth()?(l++,t--):e>1&&(_+=e-1,a-=e-1),a--,t--}for(;i1&&(u+=e-1,h+=e-1),h++,i++}}h++;let f=a+c-l+_,v=Math.min(this._bufferService.cols,h-a+l+d-_-u);if(t||""!==o.slice(a,h).trim()){if(i&&0===f&&32!==n.getCodePoint(0)){const t=r.lines.get(e[1]-1);if(t&&n.isWrapped&&32!==t.getCodePoint(this._bufferService.cols-1)){const t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){const e=this._bufferService.cols-t.start;f-=e,v+=e}}}if(s&&f+v===this._bufferService.cols&&32!==n.getCodePoint(this._bufferService.cols-1)){const t=r.lines.get(e[1]+1);if(t?.isWrapped&&32!==t.getCodePoint(0)){const t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(v+=t.length)}}return{start:f,length:v}}}_selectWordAt(e,t){const i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){const t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return 0!==e.getWidth()&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){const t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,_.getRangeLength)(i,this._bufferService.cols)}};t.SelectionService=g=s([r(3,f.IBufferService),r(4,f.ICoreService),r(5,h.IMouseService),r(6,f.IOptionsService),r(7,h.IRenderService),r(8,h.ICoreBrowserService)],g)},4725:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ILinkProviderService=t.IThemeService=t.ICharacterJoinerService=t.ISelectionService=t.IRenderService=t.IMouseService=t.ICoreBrowserService=t.ICharSizeService=void 0;const s=i(8343);t.ICharSizeService=(0,s.createDecorator)("CharSizeService"),t.ICoreBrowserService=(0,s.createDecorator)("CoreBrowserService"),t.IMouseService=(0,s.createDecorator)("MouseService"),t.IRenderService=(0,s.createDecorator)("RenderService"),t.ISelectionService=(0,s.createDecorator)("SelectionService"),t.ICharacterJoinerService=(0,s.createDecorator)("CharacterJoinerService"),t.IThemeService=(0,s.createDecorator)("ThemeService"),t.ILinkProviderService=(0,s.createDecorator)("LinkProviderService")},6731:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeService=t.DEFAULT_ANSI_COLORS=void 0;const n=i(7239),o=i(8055),a=i(8460),h=i(844),c=i(2585),l=o.css.toColor("#ffffff"),d=o.css.toColor("#000000"),_=o.css.toColor("#ffffff"),u=o.css.toColor("#000000"),f={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};t.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const e=[o.css.toColor("#2e3436"),o.css.toColor("#cc0000"),o.css.toColor("#4e9a06"),o.css.toColor("#c4a000"),o.css.toColor("#3465a4"),o.css.toColor("#75507b"),o.css.toColor("#06989a"),o.css.toColor("#d3d7cf"),o.css.toColor("#555753"),o.css.toColor("#ef2929"),o.css.toColor("#8ae234"),o.css.toColor("#fce94f"),o.css.toColor("#729fcf"),o.css.toColor("#ad7fa8"),o.css.toColor("#34e2e2"),o.css.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){const s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:o.channels.toCss(s,r,n),rgba:o.channels.toRgba(s,r,n)})}for(let i=0;i<24;i++){const t=8+10*i;e.push({css:o.channels.toCss(t,t,t),rgba:o.channels.toRgba(t,t,t)})}return e})());let v=t.ThemeService=class extends h.Disposable{get colors(){return this._colors}constructor(e){super(),this._optionsService=e,this._contrastCache=new n.ColorContrastCache,this._halfContrastCache=new n.ColorContrastCache,this._onChangeColors=this.register(new a.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:d,cursor:_,cursorAccent:u,selectionForeground:void 0,selectionBackgroundTransparent:f,selectionBackgroundOpaque:o.color.blend(d,f),selectionInactiveBackgroundTransparent:f,selectionInactiveBackgroundOpaque:o.color.blend(d,f),ansi:t.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",(()=>this._contrastCache.clear()))),this.register(this._optionsService.onSpecificOptionChange("theme",(()=>this._setTheme(this._optionsService.rawOptions.theme))))}_setTheme(e={}){const i=this._colors;if(i.foreground=p(e.foreground,l),i.background=p(e.background,d),i.cursor=p(e.cursor,_),i.cursorAccent=p(e.cursorAccent,u),i.selectionBackgroundTransparent=p(e.selectionBackground,f),i.selectionBackgroundOpaque=o.color.blend(i.background,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundTransparent=p(e.selectionInactiveBackground,i.selectionBackgroundTransparent),i.selectionInactiveBackgroundOpaque=o.color.blend(i.background,i.selectionInactiveBackgroundTransparent),i.selectionForeground=e.selectionForeground?p(e.selectionForeground,o.NULL_COLOR):void 0,i.selectionForeground===o.NULL_COLOR&&(i.selectionForeground=void 0),o.color.isOpaque(i.selectionBackgroundTransparent)){const e=.3;i.selectionBackgroundTransparent=o.color.opacity(i.selectionBackgroundTransparent,e)}if(o.color.isOpaque(i.selectionInactiveBackgroundTransparent)){const e=.3;i.selectionInactiveBackgroundTransparent=o.color.opacity(i.selectionInactiveBackgroundTransparent,e)}if(i.ansi=t.DEFAULT_ANSI_COLORS.slice(),i.ansi[0]=p(e.black,t.DEFAULT_ANSI_COLORS[0]),i.ansi[1]=p(e.red,t.DEFAULT_ANSI_COLORS[1]),i.ansi[2]=p(e.green,t.DEFAULT_ANSI_COLORS[2]),i.ansi[3]=p(e.yellow,t.DEFAULT_ANSI_COLORS[3]),i.ansi[4]=p(e.blue,t.DEFAULT_ANSI_COLORS[4]),i.ansi[5]=p(e.magenta,t.DEFAULT_ANSI_COLORS[5]),i.ansi[6]=p(e.cyan,t.DEFAULT_ANSI_COLORS[6]),i.ansi[7]=p(e.white,t.DEFAULT_ANSI_COLORS[7]),i.ansi[8]=p(e.brightBlack,t.DEFAULT_ANSI_COLORS[8]),i.ansi[9]=p(e.brightRed,t.DEFAULT_ANSI_COLORS[9]),i.ansi[10]=p(e.brightGreen,t.DEFAULT_ANSI_COLORS[10]),i.ansi[11]=p(e.brightYellow,t.DEFAULT_ANSI_COLORS[11]),i.ansi[12]=p(e.brightBlue,t.DEFAULT_ANSI_COLORS[12]),i.ansi[13]=p(e.brightMagenta,t.DEFAULT_ANSI_COLORS[13]),i.ansi[14]=p(e.brightCyan,t.DEFAULT_ANSI_COLORS[14]),i.ansi[15]=p(e.brightWhite,t.DEFAULT_ANSI_COLORS[15]),e.extendedAnsi){const s=Math.min(i.ansi.length-16,e.extendedAnsi.length);for(let r=0;r{Object.defineProperty(t,"__esModule",{value:!0}),t.CircularList=void 0;const s=i(8460),r=i(844);class n extends r.Disposable{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this.register(new s.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new s.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new s.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;const t=new Array(e);for(let i=0;ithis._length)for(let t=this._length;t=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;sthis._maxLength){const e=this._length+i.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));const s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s{Object.defineProperty(t,"__esModule",{value:!0}),t.clone=void 0,t.clone=function e(t,i=5){if("object"!=typeof t)return t;const s=Array.isArray(t)?[]:{};for(const r in t)s[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return s}},8055:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.contrastRatio=t.toPaddedHex=t.rgba=t.rgb=t.css=t.color=t.channels=t.NULL_COLOR=void 0;let i=0,s=0,r=0,n=0;var o,a,h,c,l;function d(e){const t=e.toString(16);return t.length<2?"0"+t:t}function _(e,t){return e>>0},e.toColor=function(t,i,s,r){return{css:e.toCss(t,i,s,r),rgba:e.toRgba(t,i,s,r)}}}(o||(t.channels=o={})),function(e){function t(e,t){return n=Math.round(255*t),[i,s,r]=l.toChannels(e.rgba),{css:o.toCss(i,s,r,n),rgba:o.toRgba(i,s,r,n)}}e.blend=function(e,t){if(n=(255&t.rgba)/255,1===n)return{css:t.css,rgba:t.rgba};const a=t.rgba>>24&255,h=t.rgba>>16&255,c=t.rgba>>8&255,l=e.rgba>>24&255,d=e.rgba>>16&255,_=e.rgba>>8&255;return i=l+Math.round((a-l)*n),s=d+Math.round((h-d)*n),r=_+Math.round((c-_)*n),{css:o.toCss(i,s,r),rgba:o.toRgba(i,s,r)}},e.isOpaque=function(e){return 255==(255&e.rgba)},e.ensureContrastRatio=function(e,t,i){const s=l.ensureContrastRatio(e.rgba,t.rgba,i);if(s)return o.toColor(s>>24&255,s>>16&255,s>>8&255)},e.opaque=function(e){const t=(255|e.rgba)>>>0;return[i,s,r]=l.toChannels(t),{css:o.toCss(i,s,r),rgba:t}},e.opacity=t,e.multiplyOpacity=function(e,i){return n=255&e.rgba,t(e,n*i/255)},e.toColorRGB=function(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}}(a||(t.color=a={})),function(e){let t,a;try{const e=document.createElement("canvas");e.width=1,e.height=1;const i=e.getContext("2d",{willReadFrequently:!0});i&&(t=i,t.globalCompositeOperation="copy",a=t.createLinearGradient(0,0,1,1))}catch{}e.toColor=function(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return i=parseInt(e.slice(1,2).repeat(2),16),s=parseInt(e.slice(2,3).repeat(2),16),r=parseInt(e.slice(3,4).repeat(2),16),o.toColor(i,s,r);case 5:return i=parseInt(e.slice(1,2).repeat(2),16),s=parseInt(e.slice(2,3).repeat(2),16),r=parseInt(e.slice(3,4).repeat(2),16),n=parseInt(e.slice(4,5).repeat(2),16),o.toColor(i,s,r,n);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}const h=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(h)return i=parseInt(h[1]),s=parseInt(h[2]),r=parseInt(h[3]),n=Math.round(255*(void 0===h[5]?1:parseFloat(h[5]))),o.toColor(i,s,r,n);if(!t||!a)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=a,t.fillStyle=e,"string"!=typeof t.fillStyle)throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[i,s,r,n]=t.getImageData(0,0,1,1).data,255!==n)throw new Error("css.toColor: Unsupported css format");return{rgba:o.toRgba(i,s,r,n),css:e}}}(h||(t.css=h={})),function(e){function t(e,t,i){const s=e/255,r=t/255,n=i/255;return.2126*(s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4))}e.relativeLuminance=function(e){return t(e>>16&255,e>>8&255,255&e)},e.relativeLuminance2=t}(c||(t.rgb=c={})),function(e){function t(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(s,r,n));for(;l0||a>0||h>0);)o-=Math.max(0,Math.ceil(.1*o)),a-=Math.max(0,Math.ceil(.1*a)),h-=Math.max(0,Math.ceil(.1*h)),l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(s,r,n));return(o<<24|a<<16|h<<8|255)>>>0}function a(e,t,i){const s=e>>24&255,r=e>>16&255,n=e>>8&255;let o=t>>24&255,a=t>>16&255,h=t>>8&255,l=_(c.relativeLuminance2(o,a,h),c.relativeLuminance2(s,r,n));for(;l>>0}e.blend=function(e,t){if(n=(255&t)/255,1===n)return t;const a=t>>24&255,h=t>>16&255,c=t>>8&255,l=e>>24&255,d=e>>16&255,_=e>>8&255;return i=l+Math.round((a-l)*n),s=d+Math.round((h-d)*n),r=_+Math.round((c-_)*n),o.toRgba(i,s,r)},e.ensureContrastRatio=function(e,i,s){const r=c.relativeLuminance(e>>8),n=c.relativeLuminance(i>>8);if(_(r,n)>8));if(o_(r,c.relativeLuminance(t>>8))?n:t}return n}const o=a(e,i,s),h=_(r,c.relativeLuminance(o>>8));if(h_(r,c.relativeLuminance(n>>8))?o:n}return o}},e.reduceLuminance=t,e.increaseLuminance=a,e.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]}}(l||(t.rgba=l={})),t.toPaddedHex=d,t.contrastRatio=_},8969:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CoreTerminal=void 0;const s=i(844),r=i(2585),n=i(4348),o=i(7866),a=i(744),h=i(7302),c=i(6975),l=i(8460),d=i(1753),_=i(1480),u=i(7994),f=i(9282),v=i(5435),p=i(5981),g=i(2660);let m=!1;class S extends s.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event((e=>{this._onScrollApi?.fire(e.position)}))),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(const t in e)this.optionsService.options[t]=e[t]}constructor(e){super(),this._windowsWrappingHeuristics=this.register(new s.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new n.InstantiationService,this.optionsService=this.register(new h.OptionsService(e)),this._instantiationService.setService(r.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(a.BufferService)),this._instantiationService.setService(r.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(o.LogService)),this._instantiationService.setService(r.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService)),this._instantiationService.setService(r.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(d.CoreMouseService)),this._instantiationService.setService(r.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(_.UnicodeService)),this._instantiationService.setService(r.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(u.CharsetService),this._instantiationService.setService(r.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(g.OscLinkService),this._instantiationService.setService(r.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new v.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((e=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new p.WriteBuffer(((e,t)=>this._inputHandler.parse(e,t)))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=r.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,a.MINIMUM_COLS),t=Math.max(t,a.MINIMUM_ROWS),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t,i){this._bufferService.scrollLines(e,t,i)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){const t=e-this._bufferService.buffer.ydisp;0!==t&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1;const t=this.optionsService.rawOptions.windowsPty;t&&void 0!==t.buildNumber&&void 0!==t.buildNumber?e=!!("conpty"===t.backend&&t.buildNumber<21376):this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const e=[];e.push(this.onLineFeed(f.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},(()=>((0,f.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,s.toDisposable)((()=>{for(const t of e)t.dispose()}))}}}t.CoreTerminal=S},8460:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.runAndSubscribe=t.forwardEvent=t.EventEmitter=void 0,t.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=e=>(this._listeners.push(e),{dispose:()=>{if(!this._disposed)for(let t=0;tt.fire(e)))},t.runAndSubscribe=function(e,t){return t(void 0),e((e=>t(e)))}},5435:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.InputHandler=t.WindowsOptionsReportType=void 0;const n=i(2584),o=i(7116),a=i(2015),h=i(844),c=i(482),l=i(8437),d=i(8460),_=i(643),u=i(511),f=i(3734),v=i(2585),p=i(1480),g=i(6242),m=i(6351),S=i(5941),C={"(":0,")":1,"*":2,"+":3,"-":1,".":2},b=131072;function w(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var y;!function(e){e[e.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",e[e.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"}(y||(t.WindowsOptionsReportType=y={}));let E=0;class k extends h.Disposable{getAttrData(){return this._curAttrData}constructor(e,t,i,s,r,h,_,f,v=new a.EscapeSequenceParser){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=h,this._coreMouseService=_,this._unicodeService=f,this._parser=v,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new u.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new d.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new d.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new d.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new d.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new d.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new d.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new d.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new d.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new d.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new d.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new d.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new d.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new d.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new L(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((e=>this._activeBuffer=e.activeBuffer))),this._parser.setCsiHandlerFallback(((e,t)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(e),params:t.toArray()})})),this._parser.setEscHandlerFallback((e=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(e)})})),this._parser.setExecuteHandlerFallback((e=>{this._logService.debug("Unknown EXECUTE code: ",{code:e})})),this._parser.setOscHandlerFallback(((e,t,i)=>{this._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})})),this._parser.setDcsHandlerFallback(((e,t,i)=>{"HOOK"===t&&(i=i.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(e),action:t,payload:i})})),this._parser.setPrintHandler(((e,t,i)=>this.print(e,t,i))),this._parser.registerCsiHandler({final:"@"},(e=>this.insertChars(e))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(e=>this.scrollLeft(e))),this._parser.registerCsiHandler({final:"A"},(e=>this.cursorUp(e))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(e=>this.scrollRight(e))),this._parser.registerCsiHandler({final:"B"},(e=>this.cursorDown(e))),this._parser.registerCsiHandler({final:"C"},(e=>this.cursorForward(e))),this._parser.registerCsiHandler({final:"D"},(e=>this.cursorBackward(e))),this._parser.registerCsiHandler({final:"E"},(e=>this.cursorNextLine(e))),this._parser.registerCsiHandler({final:"F"},(e=>this.cursorPrecedingLine(e))),this._parser.registerCsiHandler({final:"G"},(e=>this.cursorCharAbsolute(e))),this._parser.registerCsiHandler({final:"H"},(e=>this.cursorPosition(e))),this._parser.registerCsiHandler({final:"I"},(e=>this.cursorForwardTab(e))),this._parser.registerCsiHandler({final:"J"},(e=>this.eraseInDisplay(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(e=>this.eraseInDisplay(e,!0))),this._parser.registerCsiHandler({final:"K"},(e=>this.eraseInLine(e,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(e=>this.eraseInLine(e,!0))),this._parser.registerCsiHandler({final:"L"},(e=>this.insertLines(e))),this._parser.registerCsiHandler({final:"M"},(e=>this.deleteLines(e))),this._parser.registerCsiHandler({final:"P"},(e=>this.deleteChars(e))),this._parser.registerCsiHandler({final:"S"},(e=>this.scrollUp(e))),this._parser.registerCsiHandler({final:"T"},(e=>this.scrollDown(e))),this._parser.registerCsiHandler({final:"X"},(e=>this.eraseChars(e))),this._parser.registerCsiHandler({final:"Z"},(e=>this.cursorBackwardTab(e))),this._parser.registerCsiHandler({final:"`"},(e=>this.charPosAbsolute(e))),this._parser.registerCsiHandler({final:"a"},(e=>this.hPositionRelative(e))),this._parser.registerCsiHandler({final:"b"},(e=>this.repeatPrecedingCharacter(e))),this._parser.registerCsiHandler({final:"c"},(e=>this.sendDeviceAttributesPrimary(e))),this._parser.registerCsiHandler({prefix:">",final:"c"},(e=>this.sendDeviceAttributesSecondary(e))),this._parser.registerCsiHandler({final:"d"},(e=>this.linePosAbsolute(e))),this._parser.registerCsiHandler({final:"e"},(e=>this.vPositionRelative(e))),this._parser.registerCsiHandler({final:"f"},(e=>this.hVPosition(e))),this._parser.registerCsiHandler({final:"g"},(e=>this.tabClear(e))),this._parser.registerCsiHandler({final:"h"},(e=>this.setMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(e=>this.setModePrivate(e))),this._parser.registerCsiHandler({final:"l"},(e=>this.resetMode(e))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(e=>this.resetModePrivate(e))),this._parser.registerCsiHandler({final:"m"},(e=>this.charAttributes(e))),this._parser.registerCsiHandler({final:"n"},(e=>this.deviceStatus(e))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(e=>this.deviceStatusPrivate(e))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(e=>this.softReset(e))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(e=>this.setCursorStyle(e))),this._parser.registerCsiHandler({final:"r"},(e=>this.setScrollRegion(e))),this._parser.registerCsiHandler({final:"s"},(e=>this.saveCursor(e))),this._parser.registerCsiHandler({final:"t"},(e=>this.windowOptions(e))),this._parser.registerCsiHandler({final:"u"},(e=>this.restoreCursor(e))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(e=>this.insertColumns(e))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(e=>this.deleteColumns(e))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(e=>this.selectProtected(e))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(e=>this.requestMode(e,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(e=>this.requestMode(e,!1))),this._parser.setExecuteHandler(n.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(n.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(n.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(n.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(n.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(n.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(n.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(n.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(n.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(n.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new g.OscHandler((e=>(this.setTitle(e),this.setIconName(e),!0)))),this._parser.registerOscHandler(1,new g.OscHandler((e=>this.setIconName(e)))),this._parser.registerOscHandler(2,new g.OscHandler((e=>this.setTitle(e)))),this._parser.registerOscHandler(4,new g.OscHandler((e=>this.setOrReportIndexedColor(e)))),this._parser.registerOscHandler(8,new g.OscHandler((e=>this.setHyperlink(e)))),this._parser.registerOscHandler(10,new g.OscHandler((e=>this.setOrReportFgColor(e)))),this._parser.registerOscHandler(11,new g.OscHandler((e=>this.setOrReportBgColor(e)))),this._parser.registerOscHandler(12,new g.OscHandler((e=>this.setOrReportCursorColor(e)))),this._parser.registerOscHandler(104,new g.OscHandler((e=>this.restoreIndexedColor(e)))),this._parser.registerOscHandler(110,new g.OscHandler((e=>this.restoreFgColor(e)))),this._parser.registerOscHandler(111,new g.OscHandler((e=>this.restoreBgColor(e)))),this._parser.registerOscHandler(112,new g.OscHandler((e=>this.restoreCursorColor(e)))),this._parser.registerEscHandler({final:"7"},(()=>this.saveCursor())),this._parser.registerEscHandler({final:"8"},(()=>this.restoreCursor())),this._parser.registerEscHandler({final:"D"},(()=>this.index())),this._parser.registerEscHandler({final:"E"},(()=>this.nextLine())),this._parser.registerEscHandler({final:"H"},(()=>this.tabSet())),this._parser.registerEscHandler({final:"M"},(()=>this.reverseIndex())),this._parser.registerEscHandler({final:"="},(()=>this.keypadApplicationMode())),this._parser.registerEscHandler({final:">"},(()=>this.keypadNumericMode())),this._parser.registerEscHandler({final:"c"},(()=>this.fullReset())),this._parser.registerEscHandler({final:"n"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"o"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"|"},(()=>this.setgLevel(3))),this._parser.registerEscHandler({final:"}"},(()=>this.setgLevel(2))),this._parser.registerEscHandler({final:"~"},(()=>this.setgLevel(1))),this._parser.registerEscHandler({intermediates:"%",final:"@"},(()=>this.selectDefaultCharset())),this._parser.registerEscHandler({intermediates:"%",final:"G"},(()=>this.selectDefaultCharset()));for(const n in o.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:n},(()=>this.selectCharset("("+n))),this._parser.registerEscHandler({intermediates:")",final:n},(()=>this.selectCharset(")"+n))),this._parser.registerEscHandler({intermediates:"*",final:n},(()=>this.selectCharset("*"+n))),this._parser.registerEscHandler({intermediates:"+",final:n},(()=>this.selectCharset("+"+n))),this._parser.registerEscHandler({intermediates:"-",final:n},(()=>this.selectCharset("-"+n))),this._parser.registerEscHandler({intermediates:".",final:n},(()=>this.selectCharset("."+n))),this._parser.registerEscHandler({intermediates:"/",final:n},(()=>this.selectCharset("/"+n)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((e=>(this._logService.error("Parsing error: ",e),e))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((e,t)=>this.requestStatusString(e,t))))}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=v.LogLevelEnum.WARN&&Promise.race([e,new Promise(((e,t)=>setTimeout((()=>t("#SLOW_TIMEOUT")),5e3)))]).catch((e=>{if("#SLOW_TIMEOUT"!==e)throw e;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0;const o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>b&&(n=this._parseStack.position+b)}if(this._logService.logLevel<=v.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+("string"==typeof e?` "${e}"`:` "${Array.prototype.map.call(e,(e=>String.fromCharCode(e))).join("")}"`),"string"==typeof e?e.split("").map((e=>e.charCodeAt(0))):e),this._parseBuffer.lengthb)for(let c=n;c0&&2===f.getWidth(this._activeBuffer.x-1)&&f.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let v=this._parser.precedingJoinState;for(let g=t;ga)if(h){const e=f;let t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),f=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&f instanceof l.BufferLine&&f.copyCellsFrom(e,t,0,m,!1);t=0;)f.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}else if(d&&(f.insertCells(this._activeBuffer.x,r-m,this._activeBuffer.getNullCell(u)),2===f.getWidth(a-1)&&f.setCellFromCodepoint(a-1,_.NULL_CELL_CODE,_.NULL_CELL_WIDTH,u)),f.setCellFromCodepoint(this._activeBuffer.x++,s,r,u),r>0)for(;--r;)f.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=v,this._activeBuffer.x0&&0===f.getWidth(this._activeBuffer.x)&&!f.hasContent(this._activeBuffer.x)&&f.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return"t"!==e.final||e.prefix||e.intermediates?this._parser.registerCsiHandler(e,t):this._parser.registerCsiHandler(e,(e=>!w(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)))}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new m.DcsHandler(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new g.OscHandler(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(0===this._activeBuffer.x&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){const t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){const t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){const t=e.params[0];return 0===t?delete this._activeBuffer.tabs[this._activeBuffer.x]:3===t&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){const t=e.params[0];return 1===t&&(this._curAttrData.bg|=536870912),2!==t&&0!==t||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){const n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){const i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){let i;switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 3:const e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,0===this._activeBuffer.x,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let h=a;for(let c=1;c0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(e){return 0===(this._optionsService.rawOptions.termName+"").indexOf(e)}setMode(e){for(let t=0;te?1:2,u=e.params[0];return f=u,v=t?2===u?4:4===u?_(o.modes.insertMode):12===u?3:20===u?_(d.convertEol):0:1===u?_(i.applicationCursorKeys):3===u?d.windowOptions.setWinLines?80===h?2:132===h?1:0:0:6===u?_(i.origin):7===u?_(i.wraparound):8===u?3:9===u?_("X10"===s):12===u?_(d.cursorBlink):25===u?_(!o.isCursorHidden):45===u?_(i.reverseWraparound):66===u?_(i.applicationKeypad):67===u?4:1e3===u?_("VT200"===s):1002===u?_("DRAG"===s):1003===u?_("ANY"===s):1004===u?_(i.sendFocus):1005===u?4:1006===u?_("SGR"===r):1015===u?4:1016===u?_("SGR_PIXELS"===r):1048===u?1:47===u||1047===u||1049===u?_(c===l):2004===u?_(i.bracketedPasteMode):0,o.triggerDataEvent(`${n.C0.ESC}[${t?"":"?"}${f};${v}$y`),!0;var f,v}_updateAttrColor(e,t,i,s,r){return 2===t?(e|=50331648,e&=-16777216,e|=f.AttributeData.fromColorRGB([i,s,r])):5===t&&(e&=-50331904,e|=33554432|255&i),e}_extractColor(e,t,i){const s=[0,0,-1,0,0,0];let r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){const i=e.getSubParams(t+n);let o=0;do{5===s[1]&&(r=1),s[n+o+1+r]=i[o]}while(++o=2||2===s[1]&&n+r>=5)break;s[1]&&(r=1)}while(++n+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,0===e&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=l.DEFAULT_ATTR_DATA.fg,e.bg=l.DEFAULT_ATTR_DATA.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(1===e.length&&0===e.params[0])return this._processSGR0(this._curAttrData),!0;const t=e.length;let i;const s=this._curAttrData;for(let r=0;r=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777224|i-90):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777224|i-100):0===i?this._processSGR0(s):1===i?s.fg|=134217728:3===i?s.bg|=67108864:4===i?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):5===i?s.fg|=536870912:7===i?s.fg|=67108864:8===i?s.fg|=1073741824:9===i?s.fg|=2147483648:2===i?s.bg|=134217728:21===i?this._processUnderline(2,s):22===i?(s.fg&=-134217729,s.bg&=-134217729):23===i?s.bg&=-67108865:24===i?(s.fg&=-268435457,this._processUnderline(0,s)):25===i?s.fg&=-536870913:27===i?s.fg&=-67108865:28===i?s.fg&=-1073741825:29===i?s.fg&=2147483647:39===i?(s.fg&=-67108864,s.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):49===i?(s.bg&=-67108864,s.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):38===i||48===i||58===i?r+=this._extractColor(e,r,s):53===i?s.bg|=1073741824:55===i?s.bg&=-1073741825:59===i?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):100===i?(s.fg&=-67108864,s.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,s.bg&=-67108864,s.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(6===e.params[0]){const e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){const t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const i=t%2==1;return this._optionsService.options.cursorBlink=i,!0}setScrollRegion(e){const t=e.params[0]||1;let i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||0===i)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!w(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;const t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:2!==t&&this._onRequestWindowsOptionsReport.fire(y.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(y.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){const t=[],i=e.split(";");for(;i.length>1;){const e=i.shift(),s=i.shift();if(/^\d+$/.exec(e)){const i=parseInt(e);if(D(i))if("?"===s)t.push({type:0,index:i});else{const e=(0,S.parseColor)(s);e&&t.push({type:1,index:i,color:e})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){const t=e.split(";");return!(t.length<2)&&(t[1]?this._createHyperlink(t[0],t[1]):!t[0]&&this._finishHyperlink())}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();const i=e.split(":");let s;const r=i.findIndex((e=>e.startsWith("id=")));return-1!==r&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){const i=e.split(";");for(let s=0;s=this._specialColors.length);++s,++t)if("?"===i[s])this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{const e=(0,S.parseColor)(i[s]);e&&this._onColor.fire([{type:1,index:this._specialColors[t],color:e}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;const t=[],i=e.split(";");for(let s=0;s=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){const e=new u.CellData;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${n.C0.ESC}${e}${n.C0.ESC}\\`),!0))('"q'===e?`P1$r${this._curAttrData.isProtected()?1:0}"q`:'"p'===e?'P1$r61;1"p':"r"===e?`P1$r${i.scrollTop+1};${i.scrollBottom+1}r`:"m"===e?"P1$r0m":" q"===e?`P1$r${{block:2,underline:4,bar:6}[s.cursorStyle]-(s.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}}t.InputHandler=k;let L=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(E=e,e=t,t=E),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function D(e){return 0<=e&&e<256}L=s([r(0,v.IBufferService)],L)},844:(e,t)=>{function i(e){for(const t of e)t.dispose();e.length=0}Object.defineProperty(t,"__esModule",{value:!0}),t.getDisposeArrayDisposable=t.disposeArray=t.toDisposable=t.MutableDisposable=t.Disposable=void 0,t.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const e of this._disposables)e.dispose();this._disposables.length=0}register(e){return this._disposables.push(e),e}unregister(e){const t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,1)}},t.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},t.toDisposable=function(e){return{dispose:e}},t.disposeArray=i,t.getDisposeArrayDisposable=function(e){return{dispose:()=>i(e)}}},1505:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FourKeyMap=t.TwoKeyMap=void 0;class i{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}}t.TwoKeyMap=i,t.FourKeyMap=class{constructor(){this._data=new i}set(e,t,s,r,n){this._data.get(e,t)||this._data.set(e,t,new i),this._data.get(e,t).set(s,r,n)}get(e,t,i,s){return this._data.get(e,t)?.get(i,s)}clear(){this._data.clear()}}},6114:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isChromeOS=t.isLinux=t.isWindows=t.isIphone=t.isIpad=t.isMac=t.getSafariVersion=t.isSafari=t.isLegacyEdge=t.isFirefox=t.isNode=void 0,t.isNode="undefined"!=typeof s&&"title"in s;const i=t.isNode?"node":navigator.userAgent,r=t.isNode?"node":navigator.platform;t.isFirefox=i.includes("Firefox"),t.isLegacyEdge=i.includes("Edge"),t.isSafari=/^((?!chrome|android).)*safari/i.test(i),t.getSafariVersion=function(){if(!t.isSafari)return 0;const e=i.match(/Version\/(\d+)/);return null===e||e.length<2?0:parseInt(e[1])},t.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(r),t.isIpad="iPad"===r,t.isIphone="iPhone"===r,t.isWindows=["Windows","Win16","Win32","WinCE"].includes(r),t.isLinux=r.indexOf("Linux")>=0,t.isChromeOS=/\bCrOS\b/.test(i)},6106:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SortedList=void 0;let i=0;t.SortedList=class{constructor(e){this._getKey=e,this._array=[]}clear(){this._array.length=0}insert(e){0!==this._array.length?(i=this._search(this._getKey(e)),this._array.splice(i,0,e)):this._array.push(e)}delete(e){if(0===this._array.length)return!1;const t=this._getKey(e);if(void 0===t)return!1;if(i=this._search(t),-1===i)return!1;if(this._getKey(this._array[i])!==t)return!1;do{if(this._array[i]===e)return this._array.splice(i,1),!0}while(++i=this._array.length)&&this._getKey(this._array[i])===e))do{yield this._array[i]}while(++i=this._array.length)&&this._getKey(this._array[i])===e))do{t(this._array[i])}while(++i=t;){let s=t+i>>1;const r=this._getKey(this._array[s]);if(r>e)i=s-1;else{if(!(r0&&this._getKey(this._array[s-1])===e;)s--;return s}t=s+1}}return t}}},7226:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DebouncedIdleTask=t.IdleTaskQueue=t.PriorityTaskQueue=void 0;const s=i(6114);class r{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ir)return s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),void this._start();s=r}this.clear()}}class n extends r{_requestCallback(e){return setTimeout((()=>e(this._createDeadline(16))))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){const t=Date.now()+e;return{timeRemaining:()=>Math.max(0,t-Date.now())}}}t.PriorityTaskQueue=n,t.IdleTaskQueue=!s.isNode&&"requestIdleCallback"in window?class extends r{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}}:n,t.DebouncedIdleTask=class{constructor(){this._queue=new t.IdleTaskQueue}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}}},9282:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.updateWindowsModeWrappedState=void 0;const s=i(643);t.updateWindowsModeWrappedState=function(e){const t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1),i=t?.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[s.CHAR_DATA_CODE_INDEX]!==s.NULL_CELL_CODE&&i[s.CHAR_DATA_CODE_INDEX]!==s.WHITESPACE_CELL_CODE)}},3734:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ExtendedAttrs=t.AttributeData=void 0;class i{constructor(){this.fg=0,this.bg=0,this.extended=new s}static toColorRGB(e){return[e>>>16&255,e>>>8&255,255&e]}static fromColorRGB(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]}clone(){const e=new i;return e.fg=this.fg,e.bg=this.bg,e.extended=this.extended.clone(),e}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&0!==this.extended.underlineStyle?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return 50331648==(50331648&this.fg)}isBgRGB(){return 50331648==(50331648&this.bg)}isFgPalette(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)}isBgPalette(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)}isFgDefault(){return 0==(50331648&this.fg)}isBgDefault(){return 0==(50331648&this.bg)}isAttributeDefault(){return 0===this.fg&&0===this.bg}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?50331648==(50331648&this.extended.underlineColor):this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?16777216==(50331648&this.extended.underlineColor)||33554432==(50331648&this.extended.underlineColor):this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?0==(50331648&this.extended.underlineColor):this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}t.AttributeData=i;class s{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(e){this._ext&=-67108864,this._ext|=67108863&e}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){const e=(3758096384&this._ext)>>29;return e<0?4294967288^e:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}clone(){return new s(this._ext,this._urlId)}isEmpty(){return 0===this.underlineStyle&&0===this._urlId}}t.ExtendedAttrs=s},9092:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Buffer=t.MAX_BUFFER_SIZE=void 0;const s=i(6349),r=i(7226),n=i(3734),o=i(8437),a=i(4634),h=i(511),c=i(643),l=i(4863),d=i(7116);t.MAX_BUFFER_SIZE=4294967295,t.Buffer=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=o.DEFAULT_ATTR_DATA.clone(),this.savedCharset=d.DEFAULT_CHARSET,this.markers=[],this._nullCell=h.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=h.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new r.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new n.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new n.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,t){return new o.BufferLine(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const e=this.ybase+this.y-this.ydisp;return e>=0&&et.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(0===this.lines.length){void 0===e&&(e=o.DEFAULT_ATTR_DATA);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new s.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){const i=this.getNullCell(o.DEFAULT_ATTR_DATA);let s=0;const r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new o.BufferLine(e,i)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){const e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&"conpty"===e.backend&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){const i=(0,a.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(o.DEFAULT_ATTR_DATA));if(i.length>0){const s=(0,a.reflowLargerCreateNewLayout)(this.lines,i);(0,a.reflowLargerApplyNewLayout)(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){const s=this.getNullCell(o.DEFAULT_ATTR_DATA);let r=i;for(;r-- >0;)0===this.ybase?(this.y>0&&this.y--,this.lines.length=0;n--){let h=this.lines.get(n);if(!h||!h.isWrapped&&h.getTrimmedLength()<=e)continue;const c=[h];for(;h.isWrapped&&n>0;)h=this.lines.get(--n),c.unshift(h);const l=this.ybase+this.y;if(l>=n&&l0&&(s.push({start:n+c.length+r,newLines:v}),r+=v.length),c.push(...v);let p=_.length-1,g=_[p];0===g&&(p--,g=_[p]);let m=c.length-u-1,S=d;for(;m>=0;){const e=Math.min(S,g);if(void 0===c[p])break;if(c[p].copyCellsFrom(c[m],S-e,g-e,e,!0),g-=e,0===g&&(p--,g=_[p]),S-=e,0===S){m--;const e=Math.max(m,0);S=(0,a.getWrappedLineTrimmedLength)(c,e,this._cols)}}for(let t=0;t0;)0===this.ybase?this.y0){const e=[],t=[];for(let s=0;s=0;d--)if(a&&a.start>n+h){for(let e=a.newLines.length-1;e>=0;e--)this.lines.set(d--,a.newLines[e]);d++,e.push({index:n+1,amount:a.newLines.length}),h+=a.newLines.length,a=s[++o]}else this.lines.set(d,t[n--]);let c=0;for(let s=e.length-1;s>=0;s--)e[s].index+=c,this.lines.onInsertEmitter.fire(e[s]),c+=e[s].amount;const l=Math.max(0,i+r-this.lines.maxLength);l>0&&this.lines.onTrimEmitter.fire(l)}}translateBufferLineToString(e,t,i=0,s){const r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=e,t.line<0&&t.dispose()}))),t.register(this.lines.onInsert((e=>{t.line>=e.index&&(t.line+=e.amount)}))),t.register(this.lines.onDelete((e=>{t.line>=e.index&&t.linee.index&&(t.line-=e.amount)}))),t.register(t.onDispose((()=>this._removeMarker(t)))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}}},8437:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLine=t.DEFAULT_ATTR_DATA=void 0;const s=i(3734),r=i(511),n=i(643),o=i(482);t.DEFAULT_ATTR_DATA=Object.freeze(new s.AttributeData);let a=0;class h{constructor(e,t,i=!1){this.isWrapped=i,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*e);const s=t||r.CellData.fromCharData([0,n.NULL_CELL_CHAR,n.NULL_CELL_WIDTH,n.NULL_CELL_CODE]);for(let r=0;r>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]}set(e,t){this._data[3*e+1]=t[n.CHAR_DATA_ATTR_INDEX],t[n.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[n.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[n.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[n.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(e){return this._data[3*e+0]>>22}hasWidth(e){return 12582912&this._data[3*e+0]}getFg(e){return this._data[3*e+1]}getBg(e){return this._data[3*e+2]}hasContent(e){return 4194303&this._data[3*e+0]}getCodePoint(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t}isCombined(e){return 2097152&this._data[3*e+0]}getString(e){const t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?(0,o.stringFromCodePoint)(2097151&t):""}isProtected(e){return 536870912&this._data[3*e+2]}loadCell(e,t){return a=3*e,t.content=this._data[a+0],t.fg=this._data[a+1],t.bg=this._data[a+2],2097152&t.content&&(t.combinedData=this._combined[e]),268435456&t.bg&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),268435456&t.bg&&(this._extendedAttrs[e]=t.extended),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg}setCellFromCodepoint(e,t,i,s){268435456&s.bg&&(this._extendedAttrs[e]=s.extended),this._data[3*e+0]=t|i<<22,this._data[3*e+1]=s.fg,this._data[3*e+2]=s.bg}addCodepointToCell(e,t,i){let s=this._data[3*e+0];2097152&s?this._combined[e]+=(0,o.stringFromCodePoint)(t):2097151&s?(this._combined[e]=(0,o.stringFromCodePoint)(2097151&s)+(0,o.stringFromCodePoint)(t),s&=-2097152,s|=2097152):s=t|1<<22,i&&(s&=-12582913,s|=i<<22),this._data[3*e+0]=s}insertCells(e,t,i){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodepoint(e-1,0,1,i),t=0;--i)this.setCell(e+t+i,this.loadCell(e+i,s));for(let r=0;rthis.length){if(this._data.buffer.byteLength>=4*i)this._data=new Uint32Array(this._data.buffer,0,i);else{const e=new Uint32Array(i);e.set(this._data),this._data=e}for(let i=this.length;i=e&&delete this._combined[s]}const s=Object.keys(this._extendedAttrs);for(let i=0;i=e&&delete this._extendedAttrs[t]}}return this.length=e,4*i*2=0;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(4194303&this._data[3*e+0]||50331648&this._data[3*e+2])return e+(this._data[3*e+0]>>22);return 0}copyCellsFrom(e,t,i,s,r){const n=e._data;if(r)for(let a=s-1;a>=0;a--){for(let e=0;e<3;e++)this._data[3*(i+a)+e]=n[3*(t+a)+e];268435456&n[3*(t+a)+2]&&(this._extendedAttrs[i+a]=e._extendedAttrs[t+a])}else for(let a=0;a=t&&(this._combined[s-t+i]=e._combined[s])}}translateToString(e,t,i,s){t=t??0,i=i??this.length,e&&(i=Math.min(i,this.getTrimmedLength())),s&&(s.length=0);let r="";for(;t>22||1}return s&&s.push(t),r}}t.BufferLine=h},4841:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getRangeLength=void 0,t.getRangeLength=function(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}},4634:(e,t)=>{function i(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();const s=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),r=2===e[t+1].getWidth(0);return s&&r?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.getWrappedLineTrimmedLength=t.reflowSmallerGetNewLineLengths=t.reflowLargerApplyNewLayout=t.reflowLargerCreateNewLayout=t.reflowLargerGetLinesToRemove=void 0,t.reflowLargerGetLinesToRemove=function(e,t,s,r,n){const o=[];for(let a=0;a=a&&r0&&(e>d||0===l[e].getTrimmedLength());e--)v++;v>0&&(o.push(a+l.length-v),o.push(v)),a+=l.length-1}return o},t.reflowLargerCreateNewLayout=function(e,t){const i=[];let s=0,r=t[s],n=0;for(let o=0;oi(e,r,t))).reduce(((e,t)=>e+t));let o=0,a=0,h=0;for(;hc&&(o-=c,a++);const l=2===e[a].getWidth(o-1);l&&o--;const d=l?s-1:s;r.push(d),h+=d}return r},t.getWrappedLineTrimmedLength=i},5295:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferSet=void 0;const s=i(8460),r=i(844),n=i(9092);class o extends r.Disposable{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this.register(new s.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.resize(this._bufferService.cols,this._bufferService.rows)))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",(()=>this.setupTabStops())))}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}}t.BufferSet=o},511:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CellData=void 0;const s=i(482),r=i(643),n=i(3734);class o extends n.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new n.ExtendedAttrs,this.combinedData=""}static fromCharData(e){const t=new o;return t.setFromCharData(e),t}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,s.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(e){this.fg=e[r.CHAR_DATA_ATTR_INDEX],this.bg=0;let t=!1;if(e[r.CHAR_DATA_CHAR_INDEX].length>2)t=!0;else if(2===e[r.CHAR_DATA_CHAR_INDEX].length){const i=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){const s=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(i-55296)+s-56320+65536|e[r.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[r.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[r.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[r.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[r.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}t.CellData=o},643:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WHITESPACE_CELL_CODE=t.WHITESPACE_CELL_WIDTH=t.WHITESPACE_CELL_CHAR=t.NULL_CELL_CODE=t.NULL_CELL_WIDTH=t.NULL_CELL_CHAR=t.CHAR_DATA_CODE_INDEX=t.CHAR_DATA_WIDTH_INDEX=t.CHAR_DATA_CHAR_INDEX=t.CHAR_DATA_ATTR_INDEX=t.DEFAULT_EXT=t.DEFAULT_ATTR=t.DEFAULT_COLOR=void 0,t.DEFAULT_COLOR=0,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.DEFAULT_EXT=0,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},4863:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Marker=void 0;const s=i(8460),r=i(844);class n{get id(){return this._id}constructor(e){this.line=e,this.isDisposed=!1,this._disposables=[],this._id=n._nextId++,this._onDispose=this.register(new s.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,r.disposeArray)(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}}t.Marker=n,n._nextId=1},7116:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_CHARSET=t.CHARSETS=void 0,t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=void 0,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(e,t)=>{var i,s,r;Object.defineProperty(t,"__esModule",{value:!0}),t.C1_ESCAPED=t.C1=t.C0=void 0,function(e){e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="",e.BS="\b",e.HT="\t",e.LF="\n",e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""}(i||(t.C0=i={})),function(e){e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"}(s||(t.C1=s={})),function(e){e.ST=`${i.ESC}\\`}(r||(t.C1_ESCAPED=r={}))},7399:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateKeyboardEvent=void 0;const s=i(2584),r={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,n){const o={type:0,cancel:!1,key:void 0},a=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B");break;case 8:o.key=e.ctrlKey?"\b":s.C0.DEL,e.altKey&&(o.key=s.C0.ESC+o.key);break;case 9:if(e.shiftKey){o.key=s.C0.ESC+"[Z";break}o.key=s.C0.HT,o.cancel=!0;break;case 13:o.key=e.altKey?s.C0.ESC+s.C0.CR:s.C0.CR,o.cancel=!0;break;case 27:o.key=s.C0.ESC,e.altKey&&(o.key=s.C0.ESC+s.C0.ESC),o.cancel=!0;break;case 37:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"D",o.key===s.C0.ESC+"[1;3D"&&(o.key=s.C0.ESC+(i?"b":"[1;5D"))):o.key=t?s.C0.ESC+"OD":s.C0.ESC+"[D";break;case 39:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"C",o.key===s.C0.ESC+"[1;3C"&&(o.key=s.C0.ESC+(i?"f":"[1;5C"))):o.key=t?s.C0.ESC+"OC":s.C0.ESC+"[C";break;case 38:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"A",i||o.key!==s.C0.ESC+"[1;3A"||(o.key=s.C0.ESC+"[1;5A")):o.key=t?s.C0.ESC+"OA":s.C0.ESC+"[A";break;case 40:if(e.metaKey)break;a?(o.key=s.C0.ESC+"[1;"+(a+1)+"B",i||o.key!==s.C0.ESC+"[1;3B"||(o.key=s.C0.ESC+"[1;5B")):o.key=t?s.C0.ESC+"OB":s.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=s.C0.ESC+"[2~");break;case 46:o.key=a?s.C0.ESC+"[3;"+(a+1)+"~":s.C0.ESC+"[3~";break;case 36:o.key=a?s.C0.ESC+"[1;"+(a+1)+"H":t?s.C0.ESC+"OH":s.C0.ESC+"[H";break;case 35:o.key=a?s.C0.ESC+"[1;"+(a+1)+"F":t?s.C0.ESC+"OF":s.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:e.ctrlKey?o.key=s.C0.ESC+"[5;"+(a+1)+"~":o.key=s.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:e.ctrlKey?o.key=s.C0.ESC+"[6;"+(a+1)+"~":o.key=s.C0.ESC+"[6~";break;case 112:o.key=a?s.C0.ESC+"[1;"+(a+1)+"P":s.C0.ESC+"OP";break;case 113:o.key=a?s.C0.ESC+"[1;"+(a+1)+"Q":s.C0.ESC+"OQ";break;case 114:o.key=a?s.C0.ESC+"[1;"+(a+1)+"R":s.C0.ESC+"OR";break;case 115:o.key=a?s.C0.ESC+"[1;"+(a+1)+"S":s.C0.ESC+"OS";break;case 116:o.key=a?s.C0.ESC+"[15;"+(a+1)+"~":s.C0.ESC+"[15~";break;case 117:o.key=a?s.C0.ESC+"[17;"+(a+1)+"~":s.C0.ESC+"[17~";break;case 118:o.key=a?s.C0.ESC+"[18;"+(a+1)+"~":s.C0.ESC+"[18~";break;case 119:o.key=a?s.C0.ESC+"[19;"+(a+1)+"~":s.C0.ESC+"[19~";break;case 120:o.key=a?s.C0.ESC+"[20;"+(a+1)+"~":s.C0.ESC+"[20~";break;case 121:o.key=a?s.C0.ESC+"[21;"+(a+1)+"~":s.C0.ESC+"[21~";break;case 122:o.key=a?s.C0.ESC+"[23;"+(a+1)+"~":s.C0.ESC+"[23~";break;case 123:o.key=a?s.C0.ESC+"[24;"+(a+1)+"~":s.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!n||!e.altKey||e.metaKey)!i||e.altKey||e.ctrlKey||e.shiftKey||!e.metaKey?e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&("_"===e.key&&(o.key=s.C0.US),"@"===e.key&&(o.key=s.C0.NUL)):65===e.keyCode&&(o.type=1);else{const t=r[e.keyCode],i=t?.[e.shiftKey?1:0];if(i)o.key=s.C0.ESC+i;else if(e.keyCode>=65&&e.keyCode<=90){const t=e.ctrlKey?e.keyCode-64:e.keyCode+32;let i=String.fromCharCode(t);e.shiftKey&&(i=i.toUpperCase()),o.key=s.C0.ESC+i}else if(32===e.keyCode)o.key=s.C0.ESC+(e.ctrlKey?s.C0.NUL:" ");else if("Dead"===e.key&&e.code.startsWith("Key")){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),o.key=s.C0.ESC+t,o.cancel=!0}}else e.keyCode>=65&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=s.C0.NUL:e.keyCode>=51&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=s.C0.DEL:219===e.keyCode?o.key=s.C0.ESC:220===e.keyCode?o.key=s.C0.FS:221===e.keyCode&&(o.key=s.C0.GS)}return o}},482:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Utf8ToUtf32=t.StringToUtf32=t.utf32ToString=t.stringFromCodePoint=void 0,t.stringFromCodePoint=function(e){return e>65535?(e-=65536,String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t=0,i=e.length){let s="";for(let r=t;r65535?(t-=65536,s+=String.fromCharCode(55296+(t>>10))+String.fromCharCode(t%1024+56320)):s+=String.fromCharCode(t)}return s},t.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){const i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){const i=e.charCodeAt(r++);56320<=i&&i<=57343?t[s++]=1024*(this._interim-55296)+i-56320+65536:(t[s++]=this._interim,t[s++]=i),this._interim=0}for(let n=r;n=i)return this._interim=r,s;const o=e.charCodeAt(n);56320<=o&&o<=57343?t[s++]=1024*(r-55296)+o-56320+65536:(t[s++]=r,t[s++]=o)}else 65279!==r&&(t[s++]=r)}return s}},t.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){const i=e.length;if(!i)return 0;let s,r,n,o,a=0,h=0,c=0;if(this.interim[0]){let s=!1,r=this.interim[0];r&=192==(224&r)?31:224==(240&r)?15:7;let n,o=0;for(;(n=63&this.interim[++o])&&o<4;)r<<=6,r|=n;const h=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,l=h-o;for(;c=i)return 0;if(n=e[c++],128!=(192&n)){c--,s=!0;break}this.interim[o++]=n,r<<=6,r|=63&n}s||(2===h?r<128?c--:t[a++]=r:3===h?r<2048||r>=55296&&r<=57343||65279===r||(t[a++]=r):r<65536||r>1114111||(t[a++]=r)),this.interim.fill(0)}const l=i-4;let d=c;for(;d=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(h=(31&s)<<6|63&r,h<128){d--;continue}t[a++]=h}else if(224==(240&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(h=(15&s)<<12|(63&r)<<6|63&n,h<2048||h>=55296&&h<=57343||65279===h)continue;t[a++]=h}else if(240==(248&s)){if(d>=i)return this.interim[0]=s,a;if(r=e[d++],128!=(192&r)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,a;if(n=e[d++],128!=(192&n)){d--;continue}if(d>=i)return this.interim[0]=s,this.interim[1]=r,this.interim[2]=n,a;if(o=e[d++],128!=(192&o)){d--;continue}if(h=(7&s)<<18|(63&r)<<12|(63&n)<<6|63&o,h<65536||h>1114111)continue;t[a++]=h}}return a}}},225:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeV6=void 0;const s=i(1480),r=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],n=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let o;t.UnicodeV6=class{constructor(){if(this.version="6",!o){o=new Uint8Array(65536),o.fill(1),o[0]=0,o.fill(0,1,32),o.fill(0,127,160),o.fill(2,4352,4448),o[9001]=2,o[9002]=2,o.fill(2,11904,42192),o[12351]=1,o.fill(2,44032,55204),o.fill(2,63744,64256),o.fill(2,65040,65050),o.fill(2,65072,65136),o.fill(2,65280,65377),o.fill(2,65504,65511);for(let e=0;et[r][1])return!1;for(;r>=s;)if(i=s+r>>1,e>t[i][1])s=i+1;else{if(!(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),r=0===i&&0!==t;if(r){const e=s.UnicodeService.extractWidth(t);0===e?r=!1:e>i&&(i=e)}return s.UnicodeService.createPropertyValue(0,i,r)}}},5981:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.WriteBuffer=void 0;const s=i(8460),r=i(844);class n extends r.Disposable{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new s.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(void 0!==t&&this._syncCalls>t)return void(this._syncCalls=0);if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let i;for(this._isSyncWriting=!0;i=this._writeBuffer.shift();){this._action(i);const e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){const i=e||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const e=this._writeBuffer[this._bufferOffset],s=this._action(e,t);if(s){const e=e=>Date.now()-i>=12?setTimeout((()=>this._innerWrite(0,e))):this._innerWrite(i,e);return void s.catch((e=>(queueMicrotask((()=>{throw e})),Promise.resolve(!1)))).then(e)}const r=this._callbacks[this._bufferOffset];if(r&&r(),this._bufferOffset++,this._pendingData-=e.length,Date.now()-i>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout((()=>this._innerWrite()))):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}t.WriteBuffer=n},5941:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.toRgbString=t.parseColor=void 0;const i=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,s=/^[\da-f]+$/;function r(e,t){const i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}t.parseColor=function(e){if(!e)return;let t=e.toLowerCase();if(0===t.indexOf("rgb:")){t=t.slice(4);const e=i.exec(t);if(e){const t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(0===t.indexOf("#")&&(t=t.slice(1),s.exec(t)&&[3,6,9,12].includes(t.length))){const e=t.length/3,i=[0,0,0];for(let s=0;s<3;++s){const r=parseInt(t.slice(e*s,e*s+e),16);i[s]=1===e?r<<4:2===e?r:3===e?r>>4:r>>8}return i}},t.toRgbString=function(e,t=16){const[i,s,n]=e;return`rgb:${r(i,t)}/${r(s,t)}/${r(n,t)}`}},5770:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=void 0,t.PAYLOAD_LIMIT=1e7},6351:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DcsHandler=t.DcsParser=void 0;const s=i(482),r=i(8742),n=i(5770),o=[];t.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=o,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=o}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=o,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||o,this._active.length)for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t);else this._handlerFb(this._ident,"HOOK",t)}put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._ident,"PUT",(0,s.utf32ToString)(e,t,i))}unhook(e,t=!0){if(this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].unhook(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",e);this._active=o,this._ident=0}};const a=new r.Params;a.addParam(0),t.DcsHandler=class{constructor(e){this._handler=e,this._data="",this._params=a,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():a,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,s.utf32ToString)(e,t,i),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then((e=>(this._params=a,this._data="",this._hitLimit=!1,e)));return this._params=a,this._data="",this._hitLimit=!1,t}}},2015:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EscapeSequenceParser=t.VT500_TRANSITION_TABLE=t.TransitionTable=void 0;const s=i(844),r=i(8742),n=i(6242),o=i(6351);class a{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;rt)),i=(e,i)=>t.slice(e,i),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));const n=i(0,14);let o;for(o in e.setDefault(1,0),e.addMany(s,0,2,0),n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(h,0,2,0),e.add(h,8,5,8),e.add(h,6,0,6),e.add(h,11,0,11),e.add(h,13,13,13),e}();class c extends s.Disposable{constructor(e=t.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new r.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,i)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,s.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new n.OscParser),this._dcsParser=this.register(new o.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let t=0;ts||s>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=s}}if(1!==e.final.length)throw new Error("final must be a single byte");const s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){const t=[];for(;e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){const i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);const s=this._escHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){const i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);const s=this._csiHandlers[i];return s.push(t),{dispose:()=>{const e=s.indexOf(t);-1!==e&&s.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,0!==this._parseStack.state&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s,r=0,n=0,o=0;if(this._parseStack.state)if(2===this._parseStack.state)this._parseStack.state=0,o=this._parseStack.chunkPos+1;else{if(void 0===i||1===this._parseStack.state)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const t=this._parseStack.handlers;let n=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](this._params),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 4:if(!1===i&&n>-1)for(;n>=0&&(s=t[n](),!0!==s);n--)if(s instanceof Promise)return this._parseStack.handlerPos=n,s;this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],s=this._dcsParser.unhook(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],s=this._oscParser.end(24!==r&&26!==r,i),s)return s;27===r&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,o=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let a=o;a>4){case 2:for(let s=a+1;;++s){if(s>=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=t||(r=e[s])<32||r>126&&r=0&&(s=i[o](this._params),!0!==s);o--)if(s instanceof Promise)return this._preserveStack(3,i,o,n,a),s;o<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do{switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}}while(++a47&&r<60);a--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:const c=this._escHandlers[this._collect<<8|r];let l=c?c.length-1:-1;for(;l>=0&&(s=c[l](),!0!==s);l--)if(s instanceof Promise)return this._preserveStack(4,c,l,n,a),s;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let s=a+1;;++s)if(s>=t||24===(r=e[s])||26===r||27===r||r>127&&r=t||(r=e[s])<32||r>127&&r{Object.defineProperty(t,"__esModule",{value:!0}),t.OscHandler=t.OscParser=void 0;const s=i(5770),r=i(482),n=[];t.OscParser=class{constructor(){this._state=0,this._active=n,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);const i=this._handlers[e];return i.push(t),{dispose:()=>{const e=i.indexOf(t);-1!==e&&i.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=n}reset(){if(2===this._state)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=n,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||n,this._active.length)for(let e=this._active.length-1;e>=0;e--)this._active[e].start();else this._handlerFb(this._id,"START")}_put(e,t,i){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i);else this._handlerFb(this._id,"PUT",(0,r.utf32ToString)(e,t,i))}start(){this.reset(),this._state=1}put(e,t,i){if(3!==this._state){if(1===this._state)for(;t0&&this._put(e,t,i)}}end(e,t=!0){if(0!==this._state){if(3!==this._state)if(1===this._state&&this._start(),this._active.length){let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&!1===i){for(;s>=0&&(i=this._active[s].end(e),!0!==i);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}else this._handlerFb(this._id,"END",e);this._active=n,this._id=-1,this._state=0}}},t.OscHandler=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=(0,r.utf32ToString)(e,t,i),this._data.length>s.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then((e=>(this._data="",this._hitLimit=!1,e)));return this._data="",this._hitLimit=!1,t}}},8742:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Params=void 0;const i=2147483647;class s{static fromArray(e){const t=new s;if(!e.length)return t;for(let i=Array.isArray(e[0])?1:0;i256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const e=new s(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e}toArray(){const e=[];for(let t=0;t>8,s=255&this._subParamsIdx[t];s-i>0&&e.push(Array.prototype.slice.call(this._subParams,i,s))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>i?i:e}}addSubParam(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=e>i?i:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)>0}getSubParams(e){const t=this._subParamsIdx[e]>>8,i=255&this._subParamsIdx[e];return i-t>0?this._subParams.subarray(t,i):null}getSubParamsAll(){const e={};for(let t=0;t>8,s=255&this._subParamsIdx[t];s-i>0&&(e[t]=this._subParams.slice(i,s))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const s=this._digitIsSub?this._subParams:this.params,r=s[t-1];s[t-1]=~r?Math.min(10*r+e,i):e}}t.Params=s},5741:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.AddonManager=void 0,t.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){const i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferApiView=void 0;const s=i(3785),r=i(511);t.BufferApiView=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){const t=this._buffer.lines.get(e);if(t)return new s.BufferLineApiView(t)}getNullCell(){return new r.CellData}}},3785:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferLineApiView=void 0;const s=i(511);t.BufferLineApiView=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new s.CellData)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}}},8285:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BufferNamespaceApi=void 0;const s=i(8771),r=i(8460),n=i(844);class o extends n.Disposable{constructor(e){super(),this._core=e,this._onBufferChange=this.register(new r.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new s.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new s.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate((()=>this._onBufferChange.fire(this.active)))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}t.BufferNamespaceApi=o},7975:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ParserApi=void 0,t.ParserApi=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,(e=>t(e.toArray())))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,((e,i)=>t(e,i.toArray())))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}}},7090:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeApi=void 0,t.UnicodeApi=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}}},744:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.BufferService=t.MINIMUM_ROWS=t.MINIMUM_COLS=void 0;const n=i(8460),o=i(844),a=i(5295),h=i(2585);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;let c=t.BufferService=class extends o.Disposable{get buffer(){return this.buffers.active}constructor(e){super(),this.isUserScrolling=!1,this._onResize=this.register(new n.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new n.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,t.MINIMUM_COLS),this.rows=Math.max(e.rawOptions.rows||0,t.MINIMUM_ROWS),this.buffers=this.register(new a.BufferSet(e,this))}resize(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){const i=this.buffer;let s;s=this._cachedBlankLine,s&&s.length===this.cols&&s.getFg(0)===e.fg&&s.getBg(0)===e.bg||(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;const r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(0===i.scrollTop){const e=i.lines.isFull;n===i.lines.length-1?e?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),e?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{const e=n-r+1;i.lines.shiftElements(r+1,e-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t,i){const s=this.buffer;if(e<0){if(0===s.ydisp)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);const r=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),r!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))}};t.BufferService=c=s([r(0,h.IOptionsService)],c)},7994:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CharsetService=void 0,t.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}}},1753:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreMouseService=void 0;const n=i(2585),o=i(8460),a=i(844),h={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>32!==e.action},DRAG:{events:23,restrict:e=>32!==e.action||3!==e.button},ANY:{events:31,restrict:e=>!0}};function c(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}const l=String.fromCharCode,d={DEFAULT:e=>{const t=[c(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`${l(t[0])}${l(t[1])}${l(t[2])}`},SGR:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${c(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{const t=0===e.action&&4!==e.button?"m":"M";return`[<${c(e,!0)};${e.x};${e.y}${t}`}};let _=t.CoreMouseService=class extends a.Disposable{constructor(e,t){super(),this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new o.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const i of Object.keys(h))this.addProtocol(i,h[i]);for(const i of Object.keys(d))this.addEncoding(i,d[i]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return 0!==this._protocols[this._activeProtocol].events}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._equalEvents(this._lastEvent,e,"SGR_PIXELS"===this._activeEncoding))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;const t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x)return!1;if(e.y!==t.y)return!1}else{if(e.col!==t.col)return!1;if(e.row!==t.row)return!1}return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};t.CoreMouseService=_=s([r(0,n.IBufferService),r(1,n.ICoreService)],_)},6975:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoreService=void 0;const n=i(1439),o=i(8460),a=i(844),h=i(2585),c=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let d=t.CoreService=class extends a.Disposable{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new o.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new o.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new o.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new o.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,n.clone)(c),this.decPrivateModes=(0,n.clone)(l)}reset(){this.modes=(0,n.clone)(c),this.decPrivateModes=(0,n.clone)(l)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;const i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,(()=>e.split("").map((e=>e.charCodeAt(0))))),this._onBinary.fire(e))}};t.CoreService=d=s([r(0,h.IBufferService),r(1,h.ILogService),r(2,h.IOptionsService)],d)},9074:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DecorationService=void 0;const s=i(8055),r=i(8460),n=i(844),o=i(6106);let a=0,h=0;class c extends n.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new o.SortedList((e=>e?.marker.line)),this._onDecorationRegistered=this.register(new r.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new r.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,n.toDisposable)((()=>this.reset())))}registerDecoration(e){if(e.marker.isDisposed)return;const t=new l(e);if(t){const e=t.marker.onDispose((()=>t.dispose()));t.onDispose((()=>{t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())})),this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(const e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(const n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e{a=t.options.x??0,h=a+(t.options.width??1),e>=a&&e{Object.defineProperty(t,"__esModule",{value:!0}),t.InstantiationService=t.ServiceCollection=void 0;const s=i(2585),r=i(8343);class n{constructor(...e){this._entries=new Map;for(const[t,i]of e)this.set(t,i)}set(e,t){const i=this._entries.get(e);return this._entries.set(e,t),i}forEach(e){for(const[t,i]of this._entries.entries())e(t,i)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}}t.ServiceCollection=n,t.InstantiationService=class{constructor(){this._services=new n,this._services.set(s.IInstantiationService,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){const i=(0,r.getServiceDependencies)(e).sort(((e,t)=>e.index-t.index)),s=[];for(const r of i){const t=this._services.get(r.id);if(!t)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${r.id}.`);s.push(t)}const n=i.length>0?i[0].index:t.length;if(t.length!==n)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${n+1} conflicts with ${t.length} static arguments`);return new e(...[...t,...s])}}},7866:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.traceCall=t.setTraceLogger=t.LogService=void 0;const n=i(844),o=i(2585),a={trace:o.LogLevelEnum.TRACE,debug:o.LogLevelEnum.DEBUG,info:o.LogLevelEnum.INFO,warn:o.LogLevelEnum.WARN,error:o.LogLevelEnum.ERROR,off:o.LogLevelEnum.OFF};let h,c=t.LogService=class extends n.Disposable{get logLevel(){return this._logLevel}constructor(e){super(),this._optionsService=e,this._logLevel=o.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),h=this}_updateLogLevel(){this._logLevel=a[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tJSON.stringify(e))).join(", ")})`);const t=s.apply(this,e);return h.trace(`GlyphRenderer#${s.name} return`,t),t}}},7302:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.OptionsService=t.DEFAULT_OPTIONS=void 0;const s=i(8460),r=i(844),n=i(6114);t.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:n.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const o=["normal","bold","100","200","300","400","500","600","700","800","900"];class a extends r.Disposable{constructor(e){super(),this._onOptionChange=this.register(new s.EventEmitter),this.onOptionChange=this._onOptionChange.event;const i={...t.DEFAULT_OPTIONS};for(const t in e)if(t in i)try{const s=e[t];i[t]=this._sanitizeAndValidateOption(t,s)}catch(e){console.error(e)}this.rawOptions=i,this.options={...i},this._setupOptions(),this.register((0,r.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(e,t){return this.onOptionChange((i=>{i===e&&t(this.rawOptions[e])}))}onMultipleOptionChange(e,t){return this.onOptionChange((i=>{-1!==e.indexOf(i)&&t()}))}_setupOptions(){const e=e=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);return this.rawOptions[e]},i=(e,i)=>{if(!(e in t.DEFAULT_OPTIONS))throw new Error(`No option with key "${e}"`);i=this._sanitizeAndValidateOption(e,i),this.rawOptions[e]!==i&&(this.rawOptions[e]=i,this._onOptionChange.fire(e))};for(const t in this.rawOptions){const s={get:e.bind(this,t),set:i.bind(this,t)};Object.defineProperty(this.options,t,s)}}_sanitizeAndValidateOption(e,i){switch(e){case"cursorStyle":if(i||(i=t.DEFAULT_OPTIONS[e]),!function(e){return"block"===e||"underline"===e||"bar"===e}(i))throw new Error(`"${i}" is not a valid value for ${e}`);break;case"wordSeparator":i||(i=t.DEFAULT_OPTIONS[e]);break;case"fontWeight":case"fontWeightBold":if("number"==typeof i&&1<=i&&i<=1e3)break;i=o.includes(i)?i:t.DEFAULT_OPTIONS[e];break;case"cursorWidth":i=Math.floor(i);case"lineHeight":case"tabStopWidth":if(i<1)throw new Error(`${e} cannot be less than 1, value: ${i}`);break;case"minimumContrastRatio":i=Math.max(1,Math.min(21,Math.round(10*i)/10));break;case"scrollback":if((i=Math.min(i,4294967295))<0)throw new Error(`${e} cannot be less than 0, value: ${i}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(i<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${i}`);break;case"rows":case"cols":if(!i&&0!==i)throw new Error(`${e} must be numeric, value: ${i}`);break;case"windowsPty":i=i??{}}return i}}t.OptionsService=a},2660:function(e,t,i){var s=this&&this.__decorate||function(e,t,i,s){var r,n=arguments.length,o=n<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o},r=this&&this.__param||function(e,t){return function(i,s){t(i,s,e)}};Object.defineProperty(t,"__esModule",{value:!0}),t.OscLinkService=void 0;const n=i(2585);let o=t.OscLinkService=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){const t=this._bufferService.buffer;if(void 0===e.id){const i=t.addMarker(t.ybase+t.y),s={data:e,id:this._nextId++,lines:[i]};return i.onDispose((()=>this._removeMarkerFromLink(s,i))),this._dataByLinkId.set(s.id,s),s.id}const i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;const n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose((()=>this._removeMarkerFromLink(o,n))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){const i=this._dataByLinkId.get(e);if(i&&i.lines.every((e=>e.line!==t))){const e=this._bufferService.buffer.addMarker(t);i.lines.push(e),e.onDispose((()=>this._removeMarkerFromLink(i,e)))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){const i=e.lines.indexOf(t);-1!==i&&(e.lines.splice(i,1),0===e.lines.length&&(void 0!==e.data.id&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};t.OscLinkService=o=s([r(0,n.IBufferService)],o)},8343:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDecorator=t.getServiceDependencies=t.serviceRegistry=void 0;const i="di$target",s="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[s]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);const r=function(e,t,n){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,r){t[i]===t?t[s].push({id:e,index:r}):(t[s]=[{id:e,index:r}],t[i]=t)}(r,e,n)};return r.toString=()=>e,t.serviceRegistry.set(e,r),r}},2585:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.IDecorationService=t.IUnicodeService=t.IOscLinkService=t.IOptionsService=t.ILogService=t.LogLevelEnum=t.IInstantiationService=t.ICharsetService=t.ICoreService=t.ICoreMouseService=t.IBufferService=void 0;const s=i(8343);var r;t.IBufferService=(0,s.createDecorator)("BufferService"),t.ICoreMouseService=(0,s.createDecorator)("CoreMouseService"),t.ICoreService=(0,s.createDecorator)("CoreService"),t.ICharsetService=(0,s.createDecorator)("CharsetService"),t.IInstantiationService=(0,s.createDecorator)("InstantiationService"),function(e){e[e.TRACE=0]="TRACE",e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.OFF=5]="OFF"}(r||(t.LogLevelEnum=r={})),t.ILogService=(0,s.createDecorator)("LogService"),t.IOptionsService=(0,s.createDecorator)("OptionsService"),t.IOscLinkService=(0,s.createDecorator)("OscLinkService"),t.IUnicodeService=(0,s.createDecorator)("UnicodeService"),t.IDecorationService=(0,s.createDecorator)("DecorationService")},1480:(e,t,i)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UnicodeService=void 0;const s=i(8460),r=i(225);class n{static extractShouldJoin(e){return 0!=(1&e)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,i=!1){return(16777215&e)<<3|(3&t)<<1|(i?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new s.EventEmitter,this.onChange=this._onChange.event;const e=new r.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw new Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(e){let t=0,i=0;const s=e.length;for(let r=0;r=s)return t+this.wcwidth(o);const i=e.charCodeAt(r);56320<=i&&i<=57343?o=1024*(o-55296)+i-56320+65536:t+=this.wcwidth(i)}const a=this.charProperties(o,i);let h=n.extractWidth(a);n.extractShouldJoin(a)&&(h-=n.extractWidth(i)),t+=h,i=a}return t}charProperties(e,t){return this._activeProvider.charProperties(e,t)}}t.UnicodeService=n}},t={};function i(s){var r=t[s];if(void 0!==r)return r.exports;var n=t[s]={exports:{}};return e[s].call(n.exports,n,n.exports,i),n.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.Terminal=void 0;const t=i(9042),s=i(3236),n=i(844),o=i(5741),a=i(8285),h=i(7975),c=i(7090),l=["cols","rows"];class d extends n.Disposable{constructor(e){super(),this._core=this.register(new s.Terminal(e)),this._addonManager=this.register(new o.AddonManager),this._publicOptions={...this._core.options};const t=e=>this._core.options[e],i=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(const s in this._core.options){const e={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,e)}}_checkReadonlyOptions(e){if(l.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new h.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new c.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const e=this._core.coreService.decPrivateModes;let t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any"}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(const t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write("\r\n",t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return t}_verifyIntegers(...e){for(const t of e)if(t===1/0||isNaN(t)||t%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(const t of e)if(t&&(t===1/0||isNaN(t)||t%1!=0||t<0))throw new Error("This API only accepts positive integers")}}e.Terminal=d})(),r})()))},65606:e=>{var t=e.exports={};var i;var s;function r(){throw new Error("setTimeout has not been defined")}function n(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){i=setTimeout}else{i=r}}catch(e){i=r}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=n}}catch(e){s=n}})();function o(e){if(i===setTimeout){return setTimeout(e,0)}if((i===r||!i)&&setTimeout){i=setTimeout;return setTimeout(e,0)}try{return i(e,0)}catch(t){try{return i.call(null,e,0)}catch(t){return i.call(this,e,0)}}}function a(e){if(s===clearTimeout){return clearTimeout(e)}if((s===n||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(e)}try{return s(e)}catch(t){try{return s.call(null,e)}catch(t){return s.call(this,e)}}}var h=[];var c=false;var l;var d=-1;function _(){if(!c||!l){return}c=false;if(l.length){h=l.concat(h)}else{d=-1}if(h.length){u()}}function u(){if(c){return}var e=o(_);c=true;var t=h.length;while(t){l=h;h=[];while(++d1){for(var i=1;i{n.d(e,{P:()=>g});const i="view",r="[",s="]",a="{",o="}",u=":",l=",",c="@",f=">",d=/[[\]{}]/,h={"*":1,arc:1,area:1,group:1,image:1,line:1,path:1,rect:1,rule:1,shape:1,symbol:1,text:1,trail:1};let p,m;function g(t,e,n){p=e||i;m=n||h;return b(t.trim()).map(x)}function y(t){return m[t]}function v(t,e,n,i,r){const s=t.length;let a=0,o;for(;e=0)--a;else if(i&&i.indexOf(o)>=0)++a}return e}function b(t){const e=[],n=t.length;let i=0,u=0;while(u' after between selector: "+t}i=i.map(x);const a=x(t.slice(1).trim());if(a.between){return{between:i,stream:a}}else{a.between=i}return a}function w(t){const e={source:p},n=[];let i=[0,0],l=0,f=0,h=t.length,m=0,g,b;if(t[h-1]===o){m=t.lastIndexOf(a);if(m>=0){try{i=A(t.substring(m+1,h-1))}catch(x){throw"Invalid throttle specification: "+t}t=t.slice(0,m).trim();h=t.length}else throw"Unmatched right brace: "+t;m=0}if(!h)throw t;if(t[0]===c)l=++m;g=v(t,m,u);if(g1){e.type=n[1];if(l){e.markname=n[0].slice(1)}else if(y(n[0])){e.marktype=n[0]}else{e.source=n[0]}}else{e.type=n[0]}if(e.type.slice(-1)==="!"){e.consume=true;e.type=e.type.slice(0,-1)}if(b!=null)e.filter=b;if(i[0])e.throttle=i[0];if(i[1])e.debounce=i[1];return e}function A(t){const e=t.split(l);if(!t.length||e.length>2)throw t;return e.map((e=>{const n=+e;if(n!==n)throw t;return n}))}},37879:(t,e,n)=>{n.r(e);n.d(e,{Bounds:()=>vd,CanvasHandler:()=>jm,CanvasRenderer:()=>Zm,DATE:()=>it,DAY:()=>rt,DAYOFYEAR:()=>st,Dataflow:()=>Si,Debug:()=>p.y,Error:()=>p.$D,EventStream:()=>Ln,Gradient:()=>Hc,GroupItem:()=>xd,HOURS:()=>at,Handler:()=>hm,HybridHandler:()=>ey,HybridRenderer:()=>ty,Info:()=>p.R2,Item:()=>bd,MILLISECONDS:()=>lt,MINUTES:()=>ot,MONTH:()=>et,Marks:()=>Qp,MultiPulse:()=>pi,None:()=>p.NV,Operator:()=>$n,Parameters:()=>Dn,Pulse:()=>ci,QUARTER:()=>tt,RenderType:()=>oy,Renderer:()=>mm,ResourceLoader:()=>_d,SECONDS:()=>ut,SVGHandler:()=>eg,SVGRenderer:()=>Rg,SVGStringRenderer:()=>Qg,Scenegraph:()=>rm,TIME_UNITS:()=>ct,Transform:()=>zi,View:()=>Hq,WEEK:()=>nt,Warn:()=>p.P$,YEAR:()=>J,accessor:()=>p.sY,accessorFields:()=>p.nS,accessorName:()=>p.N6,array:()=>p.YO,ascending:()=>p.V_,bandwidthNRD:()=>er,bin:()=>nr,bootstrapCI:()=>sr,boundClip:()=>gy,boundContext:()=>jd,boundItem:()=>Kp,boundMark:()=>Jp,boundStroke:()=>kd,changeset:()=>En,clampRange:()=>p.BS,codegenExpression:()=>cO,compare:()=>p.UD,constant:()=>p.dY,cumulativeLogNormal:()=>wr,cumulativeNormal:()=>mr,cumulativeUniform:()=>Cr,dayofyear:()=>yt,debounce:()=>p.sg,defaultLocale:()=>Fe,definition:()=>Ri,densityLogNormal:()=>_r,densityNormal:()=>pr,densityUniform:()=>Dr,domChild:()=>um,domClear:()=>lm,domCreate:()=>am,domFind:()=>om,dotbin:()=>ar,error:()=>p.z3,expressionFunction:()=>UL,extend:()=>p.X$,extent:()=>p.Xx,extentIndex:()=>p.n,falsy:()=>p.me,fastmap:()=>p.nG,field:()=>p.ZZ,flush:()=>p.bX,font:()=>Lp,fontFamily:()=>Np,fontSize:()=>Fp,format:()=>an,formatLocale:()=>xe,formats:()=>on,hasOwnProperty:()=>p.mQ,id:()=>p.id,identity:()=>p.D_,inferType:()=>Qe,inferTypes:()=>Ke,ingest:()=>bn,inherits:()=>p.B,inrange:()=>p.PK,interpolate:()=>oc,interpolateColors:()=>ic,interpolateRange:()=>nc,intersect:()=>cy,intersectBoxLine:()=>th,intersectPath:()=>Qd,intersectPoint:()=>Kd,intersectRule:()=>Jd,isArray:()=>p.cy,isBoolean:()=>p.Lm,isDate:()=>p.$P,isFunction:()=>p.Tn,isIterable:()=>p.xZ,isNumber:()=>p.Et,isObject:()=>p.Gv,isRegExp:()=>p.gd,isString:()=>p.Kg,isTuple:()=>gn,key:()=>p.Eb,lerp:()=>p.Cc,lineHeight:()=>Sp,loader:()=>fn,locale:()=>Ce,logger:()=>p.vF,lruCache:()=>p.EV,markup:()=>Eg,merge:()=>p.h1,mergeConfig:()=>p.io,multiLineOffset:()=>$p,one:()=>p.xH,pad:()=>p.eV,panLinear:()=>p.VC,panLog:()=>p.KH,panPow:()=>p.co,panSymlog:()=>p.zy,parse:()=>mW,parseExpression:()=>aO,parseSelector:()=>Jq.P,path:()=>Qo.Ae,pathCurves:()=>Qc,pathEqual:()=>by,pathParse:()=>nf,pathRectangle:()=>Bf,pathRender:()=>yf,pathSymbols:()=>_f,pathTrail:()=>zf,peek:()=>p.se,point:()=>fm,projection:()=>wk,quantileLogNormal:()=>Ar,quantileNormal:()=>gr,quantileUniform:()=>Fr,quantiles:()=>Ji,quantizeInterpolator:()=>rc,quarter:()=>p.$G,quartiles:()=>tr,random:()=>ir,randomInteger:()=>lr,randomKDE:()=>br,randomLCG:()=>ur,randomLogNormal:()=>kr,randomMixture:()=>Er,randomNormal:()=>vr,randomUniform:()=>Sr,read:()=>ln,regressionConstant:()=>Br,regressionExp:()=>Lr,regressionLinear:()=>Tr,regressionLoess:()=>Wr,regressionLog:()=>Nr,regressionPoly:()=>Ir,regressionPow:()=>Pr,regressionQuad:()=>qr,renderModule:()=>ly,repeat:()=>p.ux,resetDefaultLocale:()=>Se,resetSVGClipId:()=>gd,resetSVGDefIds:()=>_y,responseType:()=>un,runtimeContext:()=>bP,sampleCurve:()=>Kr,sampleLogNormal:()=>xr,sampleNormal:()=>hr,sampleUniform:()=>Mr,scale:()=>Yl,sceneEqual:()=>vy,sceneFromJSON:()=>nm,scenePickVisit:()=>dh,sceneToJSON:()=>em,sceneVisit:()=>fh,sceneZOrder:()=>ch,scheme:()=>pc,serializeXML:()=>Mg,setHybridRendererOptions:()=>Jg,setRandom:()=>rr,span:()=>p.Ln,splitAccessPath:()=>p.iv,stringValue:()=>p.r$,textMetrics:()=>Ap,timeBin:()=>ce,timeFloor:()=>Rt,timeFormatLocale:()=>Me,timeInterval:()=>qt,timeOffset:()=>jt,timeSequence:()=>Wt,timeUnitSpecifier:()=>pt,timeUnits:()=>dt,toBoolean:()=>p.G4,toDate:()=>p.ay,toNumber:()=>p.Ro,toSet:()=>p.M1,toString:()=>p.dI,transform:()=>Oi,transforms:()=>$i,truncate:()=>p.xv,truthy:()=>p.vN,tupleid:()=>yn,typeParsers:()=>Xe,utcFloor:()=>Nt,utcInterval:()=>It,utcOffset:()=>Gt,utcSequence:()=>Xt,utcdayofyear:()=>At,utcquarter:()=>p.vu,utcweek:()=>kt,version:()=>gW,visitArray:()=>p.rt,week:()=>vt,writeConfig:()=>p.AU,zero:()=>p.v_,zoomLinear:()=>p.lL,zoomLog:()=>p.oV,zoomPow:()=>p.SW,zoomSymlog:()=>p.B2});var i={};n.r(i);n.d(i,{aggregate:()=>xs,bin:()=>ws,collect:()=>ks,compare:()=>Es,countpattern:()=>Ds,cross:()=>Fs,density:()=>Ts,dotbin:()=>js,expression:()=>Ys,extent:()=>Xs,facet:()=>Vs,field:()=>Qs,filter:()=>Zs,flatten:()=>Js,fold:()=>ta,formula:()=>ea,generate:()=>na,impute:()=>sa,joinaggregate:()=>la,kde:()=>ca,key:()=>fa,load:()=>ha,lookup:()=>ga,multiextent:()=>ya,multivalues:()=>ba,params:()=>_a,pivot:()=>wa,prefacet:()=>Ma,project:()=>Da,proxy:()=>Fa,quantile:()=>Sa,relay:()=>za,sample:()=>$a,sequence:()=>Ra,sieve:()=>Oa,subflow:()=>Hs,timeunit:()=>Ta,tupleindex:()=>La,values:()=>Pa,window:()=>Xa});var r={};n.r(r);n.d(r,{bound:()=>sv,identifier:()=>uv,mark:()=>cv,overlap:()=>dv,render:()=>xv,viewlayout:()=>Qv});var s={};n.r(s);n.d(s,{axisticks:()=>eb,datajoin:()=>nb,encode:()=>sb,legendentries:()=>ab,linkpath:()=>fb,pie:()=>Eb,scale:()=>Sb,sortitems:()=>jb,stack:()=>Hb});var a={};n.r(a);n.d(a,{contour:()=>Jk,geojson:()=>iE,geopath:()=>rE,geopoint:()=>aE,geoshape:()=>oE,graticule:()=>lE,heatmap:()=>cE,isocontour:()=>qk,kde2d:()=>Vk,projection:()=>mE});var o={};n.r(o);n.d(o,{force:()=>yM});var u={};n.r(u);n.d(u,{nest:()=>oC,pack:()=>mC,partition:()=>yC,stratify:()=>vC,tree:()=>_C,treelinks:()=>wC,treemap:()=>EC});var l={};n.r(l);n.d(l,{label:()=>fF});var c={};n.r(c);n.d(c,{loess:()=>hF,regression:()=>gF});var f={};n.r(f);n.d(f,{voronoi:()=>_z});var d={};n.r(d);n.d(d,{wordcloud:()=>qz});var h={};n.r(h);n.d(h,{crossfilter:()=>Zz,resolvefilter:()=>Jz});var p=n(26372);var m={},g={},y=34,v=10,b=13;function x(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function _(t,e){var n=x(t);return function(i,r){return e(n(i),r,t)}}function w(t){var e=Object.create(null),n=[];t.forEach((function(t){for(var i in t){if(!(i in e)){n.push(e[i]=i)}}}));return n}function A(t,e){var n=t+"",i=n.length;return i9999?"+"+A(t,6):A(t,4)}function E(t){var e=t.getUTCHours(),n=t.getUTCMinutes(),i=t.getUTCSeconds(),r=t.getUTCMilliseconds();return isNaN(t)?"Invalid Date":k(t.getUTCFullYear(),4)+"-"+A(t.getUTCMonth()+1,2)+"-"+A(t.getUTCDate(),2)+(r?"T"+A(e,2)+":"+A(n,2)+":"+A(i,2)+"."+A(r,3)+"Z":i?"T"+A(e,2)+":"+A(n,2)+":"+A(i,2)+"Z":n||e?"T"+A(e,2)+":"+A(n,2)+"Z":"")}function M(t){var e=new RegExp('["'+t+"\n\r]"),n=t.charCodeAt(0);function i(t,e){var n,i,s=r(t,(function(t,r){if(n)return n(t,r-1);i=t,n=e?_(t,e):x(t)}));s.columns=i||[];return s}function r(t,e){var i=[],r=t.length,s=0,a=0,o,u=r<=0,l=false;if(t.charCodeAt(r-1)===v)--r;if(t.charCodeAt(r-1)===b)--r;function c(){if(u)return g;if(l)return l=false,m;var e,i=s,a;if(t.charCodeAt(i)===y){while(s++=r)u=true;else if((a=t.charCodeAt(s++))===v)l=true;else if(a===b){l=true;if(t.charCodeAt(s)===v)++s}return t.slice(i+1,e-1).replace(/""/g,'"')}while(s1)i=T(t,e,n);else for(r=0,i=new Array(s=t.arcs.length);r(t[e]=1+n,t)),{});function dt(t){const e=(0,p.YO)(t).slice(),n={};if(!e.length)(0,p.z3)("Missing time unit.");e.forEach((t=>{if((0,p.mQ)(ft,t)){n[t]=1}else{(0,p.z3)(`Invalid time unit: ${t}.`)}}));const i=(n[nt]||n[rt]?1:0)+(n[tt]||n[et]||n[it]?1:0)+(n[st]?1:0);if(i>1){(0,p.z3)(`Incompatible time units: ${t}`)}e.sort(((t,e)=>ft[t]-ft[e]));return e}const ht={[J]:"%Y ",[tt]:"Q%q ",[et]:"%b ",[it]:"%d ",[nt]:"W%U ",[rt]:"%a ",[st]:"%j ",[at]:"%H:00",[ot]:"00:%M",[ut]:":%S",[lt]:".%L",[`${J}-${et}`]:"%Y-%m ",[`${J}-${et}-${it}`]:"%Y-%m-%d ",[`${at}-${ot}`]:"%H:%M"};function pt(t,e){const n=(0,p.X$)({},ht,e),i=dt(t),r=i.length;let s="",a=0,o,u;for(a=0;aa;--o){u=i.slice(a,o).join("-");if(n[u]!=null){s+=n[u];a=o;break}}}return s.trim()}const mt=new Date;function gt(t){mt.setFullYear(t);mt.setMonth(0);mt.setDate(1);mt.setHours(0,0,0,0);return mt}function yt(t){return bt(new Date(t))}function vt(t){return xt(new Date(t))}function bt(t){return G.UA.count(gt(t.getFullYear())-1,t)}function xt(t){return Y.YP.count(gt(t.getFullYear())-1,t)}function _t(t){return gt(t).getDay()}function wt(t,e,n,i,r,s,a){if(0<=t&&t<100){const o=new Date(-1,e,n,i,r,s,a);o.setFullYear(t);return o}return new Date(t,e,n,i,r,s,a)}function At(t){return Et(new Date(t))}function kt(t){return Mt(new Date(t))}function Et(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return G.dA.count(e-1,t)}function Mt(t){const e=Date.UTC(t.getUTCFullYear(),0,1);return Y.Hl.count(e-1,t)}function Dt(t){mt.setTime(Date.UTC(t,0,1));return mt.getUTCDay()}function Ct(t,e,n,i,r,s,a){if(0<=t&&t<100){const t=new Date(Date.UTC(-1,e,n,i,r,s,a));t.setUTCFullYear(n.y);return t}return new Date(Date.UTC(t,e,n,i,r,s,a))}function Ft(t,e,n,i,r){const s=e||1,a=(0,p.se)(t),o=(t,e,r)=>{r=r||t;return St(n[r],i[r],t===a&&s,e)};const u=new Date,l=(0,p.M1)(t),c=l[J]?o(J):(0,p.dY)(2012),f=l[et]?o(et):l[tt]?o(tt):p.v_,d=l[nt]&&l[rt]?o(rt,1,nt+rt):l[nt]?o(nt,1):l[rt]?o(rt,1):l[it]?o(it,1):l[st]?o(st,1):p.xH,h=l[at]?o(at):p.v_,m=l[ot]?o(ot):p.v_,g=l[ut]?o(ut):p.v_,y=l[lt]?o(lt):p.v_;return function(t){u.setTime(+t);const e=c(u);return r(e,f(u),d(u,e),h(u),m(u),g(u),y(u))}}function St(t,e,n,i){const r=n<=1?t:i?(e,r)=>i+n*Math.floor((t(e,r)-i)/n):(e,i)=>n*Math.floor(t(e,i)/n);return e?(t,n)=>e(r(t,n),n):r}function Bt(t,e,n){return e+t*7-(n+6)%7}const zt={[J]:t=>t.getFullYear(),[tt]:t=>Math.floor(t.getMonth()/3),[et]:t=>t.getMonth(),[it]:t=>t.getDate(),[at]:t=>t.getHours(),[ot]:t=>t.getMinutes(),[ut]:t=>t.getSeconds(),[lt]:t=>t.getMilliseconds(),[st]:t=>bt(t),[nt]:t=>xt(t),[nt+rt]:(t,e)=>Bt(xt(t),t.getDay(),_t(e)),[rt]:(t,e)=>Bt(1,t.getDay(),_t(e))};const $t={[tt]:t=>3*t,[nt]:(t,e)=>Bt(t,0,_t(e))};function Rt(t,e){return Ft(t,e||1,zt,$t,wt)}const Ot={[J]:t=>t.getUTCFullYear(),[tt]:t=>Math.floor(t.getUTCMonth()/3),[et]:t=>t.getUTCMonth(),[it]:t=>t.getUTCDate(),[at]:t=>t.getUTCHours(),[ot]:t=>t.getUTCMinutes(),[ut]:t=>t.getUTCSeconds(),[lt]:t=>t.getUTCMilliseconds(),[st]:t=>Et(t),[nt]:t=>Mt(t),[rt]:(t,e)=>Bt(1,t.getUTCDay(),Dt(e)),[nt+rt]:(t,e)=>Bt(Mt(t),t.getUTCDay(),Dt(e))};const Tt={[tt]:t=>3*t,[nt]:(t,e)=>Bt(t,0,Dt(e))};function Nt(t,e){return Ft(t,e||1,Ot,Tt,Ct)}const Lt={[J]:W.he,[tt]:X.Ui.every(3),[et]:X.Ui,[nt]:Y.YP,[it]:G.UA,[rt]:G.UA,[st]:G.UA,[at]:H.Ag,[ot]:V.wX,[ut]:Q.R,[lt]:K.y};const Pt={[J]:W.Mb,[tt]:X.R6.every(3),[et]:X.R6,[nt]:Y.Hl,[it]:G.dA,[rt]:G.dA,[st]:G.dA,[at]:H.pz,[ot]:V.vD,[ut]:Q.R,[lt]:K.y};function qt(t){return Lt[t]}function It(t){return Pt[t]}function Ut(t,e,n){return t?t.offset(e,n):undefined}function jt(t,e,n){return Ut(qt(t),e,n)}function Gt(t,e,n){return Ut(It(t),e,n)}function Yt(t,e,n,i){return t?t.range(e,n,i):undefined}function Wt(t,e,n,i){return Yt(qt(t),e,n,i)}function Xt(t,e,n,i){return Yt(It(t),e,n,i)}const Ht=1e3,Vt=Ht*60,Qt=Vt*60,Kt=Qt*24,Zt=Kt*7,Jt=Kt*30,te=Kt*365;const ee=[J,et,it,at,ot,ut,lt],ne=ee.slice(0,-1),ie=ne.slice(0,-1),re=ie.slice(0,-1),se=re.slice(0,-1),ae=[J,nt],oe=[J,et],ue=[J];const le=[[ne,1,Ht],[ne,5,5*Ht],[ne,15,15*Ht],[ne,30,30*Ht],[ie,1,Vt],[ie,5,5*Vt],[ie,15,15*Vt],[ie,30,30*Vt],[re,1,Qt],[re,3,3*Qt],[re,6,6*Qt],[re,12,12*Qt],[se,1,Kt],[ae,1,Zt],[oe,1,Jt],[oe,3,3*Jt],[ue,1,te]];function ce(t){const e=t.extent,n=t.maxbins||40,i=Math.abs((0,p.Ln)(e))/n;let r=(0,Z.A)((t=>t[2])).right(le,i),s,a;if(r===le.length){s=ue,a=(0,N.sG)(e[0]/te,e[1]/te,n)}else if(r){r=le[i/le[r-1][2]e[n]||(e[n]=t(n))}function pe(t,e){return n=>{const i=t(n),r=i.indexOf(e);if(r<0)return i;let s=me(i,r);const a=sr)if(i[s]!=="0"){++s;break}return i.slice(0,s)+a}}function me(t,e){let n=t.lastIndexOf("e"),i;if(n>0)return n;for(n=t.length;--n>e;){i=t.charCodeAt(n);if(i>=48&&i<=57)return n+1}}function ge(t){const e=he(t.format),n=t.formatPrefix;return{format:e,formatPrefix:n,formatFloat(t){const n=(0,L.A)(t||",");if(n.precision==null){n.precision=12;switch(n.type){case"%":n.precision-=2;break;case"e":n.precision-=1;break}return pe(e(n),e(".1f")(1)[1])}else{return e(n)}},formatSpan(t,i,r,s){s=(0,L.A)(s==null?",f":s);const a=(0,N.sG)(t,i,r),o=Math.max(Math.abs(t),Math.abs(i));let u;if(s.precision==null){switch(s.type){case"s":{if(!isNaN(u=(0,P.A)(a,o))){s.precision=u}return n(s,o)}case"":case"e":case"g":case"p":case"r":{if(!isNaN(u=(0,q.A)(a,o))){s.precision=u-(s.type==="e")}break}case"f":case"%":{if(!isNaN(u=(0,I.A)(a))){s.precision=u-(s.type==="%")*2}break}}}return e(s)}}}let ye;ve();function ve(){return ye=ge({format:U.GP,formatPrefix:U.s})}function be(t){return ge((0,j.A)(t))}function xe(t){return arguments.length?ye=be(t):ye}function _e(t,e,n){n=n||{};if(!(0,p.Gv)(n)){(0,p.z3)(`Invalid time multi-format specifier: ${n}`)}const i=e(ut),r=e(ot),s=e(at),a=e(it),o=e(nt),u=e(et),l=e(tt),c=e(J),f=t(n[lt]||".%L"),d=t(n[ut]||":%S"),h=t(n[ot]||"%I:%M"),m=t(n[at]||"%I %p"),g=t(n[it]||n[rt]||"%a %d"),y=t(n[nt]||"%b %d"),v=t(n[et]||"%B"),b=t(n[tt]||"%B"),x=t(n[J]||"%Y");return t=>(i(t)(0,p.Kg)(t)?e(t):_e(e,qt,t),utcFormat:t=>(0,p.Kg)(t)?n(t):_e(n,It,t),timeParse:he(t.parse),utcParse:he(t.utcParse)}}let Ae;ke();function ke(){return Ae=we({format:fe.DC,parse:fe.T6,utcFormat:fe.aL,utcParse:fe.GY})}function Ee(t){return we((0,de.A)(t))}function Me(t){return arguments.length?Ae=Ee(t):Ae}const De=(t,e)=>(0,p.X$)({},t,e);function Ce(t,e){const n=t?be(t):xe();const i=e?Ee(e):Me();return De(n,i)}function Fe(t,e){const n=arguments.length;if(n&&n!==2){(0,p.z3)("defaultLocale expects either zero or two arguments.")}return n?De(xe(t),Me(e)):De(xe(),Me())}function Se(){ve();ke();return Fe()}const Be=/^(data:|([A-Za-z]+:)?\/\/)/;const ze=/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|file|data):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i;const $e=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g;const Re="file://";function Oe(t,e){return n=>({options:n||{},sanitize:Ne,load:Te,fileAccess:false,file:Le(e),http:qe(t)})}async function Te(t,e){const n=await this.sanitize(t,e),i=n.href;return n.localFile?this.file(i):this.http(i,e)}async function Ne(t,e){e=(0,p.X$)({},this.options,e);const n=this.fileAccess,i={href:null};let r,s,a;const o=ze.test(t.replace($e,""));if(t==null||typeof t!=="string"||!o){(0,p.z3)("Sanitize failure, invalid URI: "+(0,p.r$)(t))}const u=Be.test(t);if((a=e.baseURL)&&!u){if(!t.startsWith("/")&&!a.endsWith("/")){t="/"+t}t=a+t}s=(r=t.startsWith(Re))||e.mode==="file"||e.mode!=="http"&&!u&&n;if(r){t=t.slice(Re.length)}else if(t.startsWith("//")){if(e.defaultProtocol==="file"){t=t.slice(2);s=true}else{t=(e.defaultProtocol||"http")+":"+t}}Object.defineProperty(i,"localFile",{value:!!s});i.href=t;if(e.target){i.target=e.target+""}if(e.rel){i.rel=e.rel+""}if(e.context==="image"&&e.crossOrigin){i.crossOrigin=e.crossOrigin+""}return i}function Le(t){return t?e=>new Promise(((n,i)=>{t.readFile(e,((t,e)=>{if(t)i(t);else n(e)}))})):Pe}async function Pe(){(0,p.z3)("No file system access.")}function qe(t){return t?async function(e,n){const i=(0,p.X$)({},this.options.http,n),r=n&&n.response,s=await t(e,i);return!s.ok?(0,p.z3)(s.status+""+s.statusText):(0,p.Tn)(s[r])?s[r]():s.text()}:Ie}async function Ie(){(0,p.z3)("No HTTP fetch method available.")}const Ue=t=>t!=null&&t===t;const je=t=>t==="true"||t==="false"||t===true||t===false;const Ge=t=>!Number.isNaN(Date.parse(t));const Ye=t=>!Number.isNaN(+t)&&!(t instanceof Date);const We=t=>Ye(t)&&Number.isInteger(+t);const Xe={boolean:p.G4,integer:p.Ro,number:p.Ro,date:p.ay,string:p.dI,unknown:p.D_};const He=[je,We,Ye,Ge];const Ve=["boolean","integer","number","date"];function Qe(t,e){if(!t||!t.length)return"unknown";const n=t.length,i=He.length,r=He.map(((t,e)=>e+1));for(let s=0,a=0,o,u;st===0?e:t),0)-1]}function Ke(t,e){return e.reduce(((e,n)=>{e[n]=Qe(t,n);return e}),{})}function Ze(t){const e=function(e,n){const i={delimiter:t};return Je(e,n?(0,p.X$)(n,i):i)};e.responseType="text";return e}function Je(t,e){if(e.header){t=e.header.map(p.r$).join(e.delimiter)+"\n"+t}return M(e.delimiter).parse(t+"")}Je.responseType="text";function tn(t){return typeof Buffer==="function"&&(0,p.Tn)(Buffer.isBuffer)?Buffer.isBuffer(t):false}function en(t,e){const n=e&&e.property?(0,p.ZZ)(e.property):p.D_;return(0,p.Gv)(t)&&!tn(t)?nn(n(t),e):n(JSON.parse(t))}en.responseType="json";function nn(t,e){if(!(0,p.cy)(t)&&(0,p.xZ)(t)){t=[...t]}return e&&e.copy?JSON.parse(JSON.stringify(t)):t}const rn={interior:(t,e)=>t!==e,exterior:(t,e)=>t===e};function sn(t,e){let n,i,r,s;t=en(t,e);if(e&&e.feature){n=S;r=e.feature}else if(e&&e.mesh){n=R;r=e.mesh;s=rn[e.filter]}else{(0,p.z3)("Missing TopoJSON feature or mesh parameter.")}i=(i=t.objects[r])?n(t,i,s):(0,p.z3)("Invalid TopoJSON object: "+r);return i&&i.features||[i]}sn.responseType="json";const an={dsv:Je,csv:Ze(","),tsv:Ze("\t"),json:en,topojson:sn};function on(t,e){if(arguments.length>1){an[t]=e;return this}else{return(0,p.mQ)(an,t)?an[t]:null}}function un(t){const e=on(t);return e&&e.responseType||"text"}function ln(t,e,n,i){e=e||{};const r=on(e.type||"json");if(!r)(0,p.z3)("Unknown data format type: "+e.type);t=r(t,e);if(e.parse)cn(t,e.parse,n,i);if((0,p.mQ)(t,"columns"))delete t.columns;return t}function cn(t,e,n,i){if(!t.length)return;const r=Me();n=n||r.timeParse;i=i||r.utcParse;let s=t.columns||Object.keys(t[0]),a,o,u,l,c,f;if(e==="auto")e=Ke(t,s);s=Object.keys(e);const d=s.map((t=>{const r=e[t];let s,a;if(r&&(r.startsWith("date:")||r.startsWith("utc:"))){s=r.split(/:(.+)?/,2);a=s[1];if(a[0]==="'"&&a[a.length-1]==="'"||a[0]==='"'&&a[a.length-1]==='"'){a=a.slice(1,-1)}const t=s[0]==="utc"?i:n;return t(a)}if(!Xe[r]){throw Error("Illegal format pattern: "+t+":"+r)}return Xe[r]}));for(u=0,c=t.length,f=s.length;u{const r=e(t);if(!i[r]){i[r]=1;n.push(t)}return n};n.remove=t=>{const r=e(t);if(i[r]){i[r]=0;const e=n.indexOf(t);if(e>=0)n.splice(e,1)}return n};return n}async function hn(t,e){try{await e(t)}catch(n){t.error(n)}}const pn=Symbol("vega_id");let mn=1;function gn(t){return!!(t&&yn(t))}function yn(t){return t[pn]}function vn(t,e){t[pn]=e;return t}function bn(t){const e=t===Object(t)?t:{data:t};return yn(e)?e:vn(e,mn++)}function xn(t){return _n(t,bn({}))}function _n(t,e){for(const n in t)e[n]=t[n];return e}function wn(t,e){return vn(e,yn(t))}function An(t,e){return!t?null:e?(n,i)=>t(n,i)||yn(e(n))-yn(e(i)):(e,n)=>t(e,n)||yn(e)-yn(n)}function kn(t){return t&&t.constructor===En}function En(){const t=[],e=[],n=[],i=[],r=[];let s=null,a=false;return{constructor:En,insert(e){const n=(0,p.YO)(e),i=n.length;for(let r=0;r{if(p(t))l[yn(t)]=-1}))}for(f=0,d=t.length;f0){y(m,p,h.value);o.modifies(p)}}for(f=0,d=r.length;f{if(p(t)&&l[yn(t)]>0){y(t,h.field,h.value)}}));o.modifies(h.field)}if(a){o.mod=e.length||i.length?u.filter((t=>l[yn(t)]>0)):u.slice()}else{for(g in c)o.mod.push(c[g])}if(s||s==null&&(e.length||i.length)){o.clean(true)}return o}}}const Mn="_:mod:_";function Dn(){Object.defineProperty(this,Mn,{writable:true,value:{}})}Dn.prototype={set(t,e,n,i){const r=this,s=r[t],a=r[Mn];if(e!=null&&e>=0){if(s[e]!==n||i){s[e]=n;a[e+":"+t]=-1;a[t]=-1}}else if(s!==n||i){r[t]=n;a[t]=(0,p.cy)(n)?1+n.length:-1}return r},modified(t,e){const n=this[Mn];if(!arguments.length){for(const t in n){if(n[t])return true}return false}else if((0,p.cy)(t)){for(let e=0;e=0?e+1{if(a instanceof $n){if(a!==this){if(e)a.targets().add(this);s.push(a)}r.push({op:a,name:t,index:n})}else{i.set(t,n,a)}};for(a in t){o=t[a];if(a===Fn){(0,p.YO)(o).forEach((t=>{if(!(t instanceof $n)){(0,p.z3)("Pulse parameters must be operator instances.")}else if(t!==this){t.targets().add(this);s.push(t)}}));this.source=o}else if((0,p.cy)(o)){i.set(a,-1,Array(u=o.length));for(l=0;l{const n=Date.now();if(n-e>t){e=n;return 1}else{return 0}}))},debounce(t){const e=Pn();this.targets().add(Pn(null,null,(0,p.sg)(t,(t=>{const n=t.dataflow;e.receive(t);if(n&&n.run)n.run()}))));return e},between(t,e){let n=false;t.targets().add(Pn(null,null,(()=>n=true)));e.targets().add(Pn(null,null,(()=>n=false)));return this.filter((()=>n))},detach(){this._filter=p.vN;this._targets=null}};function qn(t,e,n,i){const r=this,s=Pn(n,i),a=function(t){t.dataflow=r;try{s.receive(t)}catch(e){r.error(e)}finally{r.run()}};let o;if(typeof t==="string"&&typeof document!=="undefined"){o=document.querySelectorAll(t)}else{o=(0,p.YO)(t)}const u=o.length;for(let l=0;le=t));n.requests=0;n.done=()=>{if(--n.requests===0){t._pending=null;e(t)}};return t._pending=n}const Wn={skip:true};function Xn(t,e,n,i,r){const s=t instanceof $n?Vn:Hn;s(this,t,e,n,i,r);return this}function Hn(t,e,n,i,r,s){const a=(0,p.X$)({},s,Wn);let o,u;if(!(0,p.Tn)(n))n=(0,p.dY)(n);if(i===undefined){o=e=>t.touch(n(e))}else if((0,p.Tn)(i)){u=new $n(null,i,r,false);o=e=>{u.evaluate(e);const i=n(e),r=u.value;kn(r)?t.pulse(i,r,s):t.update(i,r,a)}}else{o=e=>t.update(n(e),i,a)}e.apply(o)}function Vn(t,e,n,i,r,s){if(i===undefined){e.targets().add(n)}else{const a=s||{},o=new $n(null,Qn(n,i),r,false);o.modified(a.force);o.rank=e.rank;e.targets().add(o);if(n){o.skip(true);o.value=n.value;o.targets().add(n);t.connect(n,[o])}}}function Qn(t,e){e=(0,p.Tn)(e)?e:(0,p.dY)(e);return t?function(n,i){const r=e(n,i);if(!t.skip()){t.skip(r!==this.value).value=r}return r}:e}function Kn(t){t.rank=++this._rank}function Zn(t){const e=[t];let n,i,r;while(e.length){this.rank(n=e.pop());if(i=n._targets){for(r=i.length;--r>=0;){e.push(n=i[r]);if(n===t)(0,p.z3)("Cycle detected in dataflow graph.")}}}}const Jn={};const ti=1<<0,ei=1<<1,ni=1<<2,ii=ti|ei,ri=ti|ni,si=ti|ei|ni,ai=1<<3,oi=1<<4,ui=1<<5,li=1<<6;function ci(t,e,n){this.dataflow=t;this.stamp=e==null?-1:e;this.add=[];this.rem=[];this.mod=[];this.fields=null;this.encode=n||null}function fi(t,e){const n=[];(0,p.rt)(t,e,(t=>n.push(t)));return n}function di(t,e){const n={};t.visit(e,(t=>{n[yn(t)]=1}));return t=>n[yn(t)]?null:t}function hi(t,e){return t?(n,i)=>t(n,i)&&e(n,i):e}ci.prototype={StopPropagation:Jn,ADD:ti,REM:ei,MOD:ni,ADD_REM:ii,ADD_MOD:ri,ALL:si,REFLOW:ai,SOURCE:oi,NO_SOURCE:ui,NO_FIELDS:li,fork(t){return new ci(this.dataflow).init(this,t)},clone(){const t=this.fork(si);t.add=t.add.slice();t.rem=t.rem.slice();t.mod=t.mod.slice();if(t.source)t.source=t.source.slice();return t.materialize(si|oi)},addAll(){let t=this;const e=!t.source||t.add===t.rem||!t.rem.length&&t.source.length===t.add.length;if(e){return t}else{t=new ci(this.dataflow).init(this);t.add=t.source;t.rem=[];return t}},init(t,e){const n=this;n.stamp=t.stamp;n.encode=t.encode;if(t.fields&&!(e&li)){n.fields=t.fields}if(e&ti){n.addF=t.addF;n.add=t.add}else{n.addF=null;n.add=[]}if(e&ei){n.remF=t.remF;n.rem=t.rem}else{n.remF=null;n.rem=[]}if(e&ni){n.modF=t.modF;n.mod=t.mod}else{n.modF=null;n.mod=[]}if(e&ui){n.srcF=null;n.source=null}else{n.srcF=t.srcF;n.source=t.source;if(t.cleans)n.cleans=t.cleans}return n},runAfter(t){this.dataflow.runAfter(t)},changed(t){const e=t||si;return e&ti&&this.add.length||e&ei&&this.rem.length||e&ni&&this.mod.length},reflow(t){if(t)return this.fork(si).reflow();const e=this.add.length,n=this.source&&this.source.length;if(n&&n!==e){this.mod=this.source;if(e)this.filter(ni,di(this,ti))}return this},clean(t){if(arguments.length){this.cleans=!!t;return this}else{return this.cleans}},modifies(t){const e=this.fields||(this.fields={});if((0,p.cy)(t)){t.forEach((t=>e[t]=true))}else{e[t]=true}return this},modified(t,e){const n=this.fields;return!((e||this.mod.length)&&n)?false:!arguments.length?!!n:(0,p.cy)(t)?t.some((t=>n[t])):n[t]},filter(t,e){const n=this;if(t&ti)n.addF=hi(n.addF,e);if(t&ei)n.remF=hi(n.remF,e);if(t&ni)n.modF=hi(n.modF,e);if(t&oi)n.srcF=hi(n.srcF,e);return n},materialize(t){t=t||si;const e=this;if(t&ti&&e.addF){e.add=fi(e.add,e.addF);e.addF=null}if(t&ei&&e.remF){e.rem=fi(e.rem,e.remF);e.remF=null}if(t&ni&&e.modF){e.mod=fi(e.mod,e.modF);e.modF=null}if(t&oi&&e.srcF){e.source=e.source.filter(e.srcF);e.srcF=null}return e},visit(t,e){const n=this,i=e;if(t&oi){(0,p.rt)(n.source,n.srcF,i);return n}if(t&ti)(0,p.rt)(n.add,n.addF,i);if(t&ei)(0,p.rt)(n.rem,n.remF,i);if(t&ni)(0,p.rt)(n.mod,n.modF,i);const r=n.source;if(t&ai&&r){const t=n.add.length+n.mod.length;if(t===r.length);else if(t){(0,p.rt)(r,di(n,ri),i)}else{(0,p.rt)(r,n.srcF,i)}}return n}};function pi(t,e,n,i){const r=this;let s=0;this.dataflow=t;this.stamp=e;this.fields=null;this.encode=i||null;this.pulses=n;for(const a of n){if(a.stamp!==e)continue;if(a.fields){const t=r.fields||(r.fields={});for(const e in a.fields){t[e]=1}}if(a.changed(r.ADD))s|=r.ADD;if(a.changed(r.REM))s|=r.REM;if(a.changed(r.MOD))s|=r.MOD}this.changes=s}(0,p.B)(pi,ci,{fork(t){const e=new ci(this.dataflow).init(this,t&this.NO_FIELDS);if(t!==undefined){if(t&e.ADD)this.visit(e.ADD,(t=>e.add.push(t)));if(t&e.REM)this.visit(e.REM,(t=>e.rem.push(t)));if(t&e.MOD)this.visit(e.MOD,(t=>e.mod.push(t)))}return e},changed(t){return this.changes&t},modified(t){const e=this,n=e.fields;return!(n&&e.changes&e.MOD)?0:(0,p.cy)(t)?t.some((t=>n[t])):n[t]},filter(){(0,p.z3)("MultiPulse does not support filtering.")},materialize(){(0,p.z3)("MultiPulse does not support materialization.")},visit(t,e){const n=this,i=n.pulses,r=i.length;let s=0;if(t&n.SOURCE){for(;si._enqueue(t,true)));i._touched=dn(p.id);let a=0,o,u,l;try{while(i._heap.size()>0){o=i._heap.pop();if(o.rank!==o.qrank){i._enqueue(o,true);continue}u=o.run(i._getPulse(o,t));if(u.then){u=await u}else if(u.async){r.push(u.async);u=Jn}if(u!==Jn){if(o._targets)o._targets.forEach((t=>i._enqueue(t)))}++a}}catch(c){i._heap.clear();l=c}i._input={};i._pulse=null;i.debug(`Pulse ${s}: ${a} operators`);if(l){i._postrun=[];i.error(l)}if(i._postrun.length){const t=i._postrun.sort(((t,e)=>e.priority-t.priority));i._postrun=[];for(let e=0;ei.runAsync(null,(()=>{t.forEach((t=>{try{t(i)}catch(c){i.error(c)}}))}))))}return i}async function gi(t,e,n){while(this._running)await this._running;const i=()=>this._running=null;(this._running=this.evaluate(t,e,n)).then(i,i);return this._running}function yi(t,e,n){return this._pulse?bi(this):(this.evaluate(t,e,n),this)}function vi(t,e,n){if(this._pulse||e){this._postrun.push({priority:n||0,callback:t})}else{try{t(this)}catch(i){this.error(i)}}}function bi(t){t.error("Dataflow already running. Use runAsync() to chain invocations.");return t}function xi(t,e){const n=t.stampt.pulse)),e):this._input[t.id]||wi(this._pulse,n&&n.pulse)}function wi(t,e){if(e&&e.stamp===t.stamp){return e}t=t.fork();if(e&&e!==Jn){t.source=e.source}return t}const Ai={skip:false,force:false};function ki(t,e){const n=e||Ai;if(this._pulse){this._enqueue(t)}else{this._touched.add(t)}if(n.skip)t.skip(true);return this}function Ei(t,e,n){const i=n||Ai;if(t.set(e)||i.force){this.touch(t,i)}return this}function Mi(t,e,n){this.touch(t,n||Ai);const i=new ci(this,this._clock+(this._pulse?0:1)),r=t.pulse&&t.pulse.source||[];i.target=t;this._input[t.id]=e.pulse(i,r);return this}function Di(t){let e=[];return{clear:()=>e=[],size:()=>e.length,peek:()=>e[0],push:n=>{e.push(n);return Ci(e,0,e.length-1,t)},pop:()=>{const n=e.pop();let i;if(e.length){i=e[0];e[0]=n;Fi(e,0,t)}else{i=n}return i}}}function Ci(t,e,n,i){let r,s;const a=t[n];while(n>e){s=n-1>>1;r=t[s];if(i(a,r)<0){t[n]=r;n=s;continue}break}return t[n]=a}function Fi(t,e,n){const i=e,r=t.length,s=t[e];let a=(e<<1)+1,o;while(a=0){a=o}t[e]=t[a];e=a;a=(e<<1)+1}t[e]=s;return Ci(t,i,e,n)}function Si(){this.logger((0,p.vF)());this.logLevel(p.$D);this._clock=0;this._rank=0;this._locale=Fe();try{this._loader=fn()}catch(t){}this._touched=dn(p.id);this._input={};this._pulse=null;this._heap=Di(((t,e)=>t.qrank-e.qrank));this._postrun=[]}function Bi(t){return function(){return this._log[t].apply(this,arguments)}}Si.prototype={stamp(){return this._clock},loader(t){if(arguments.length){this._loader=t;return this}else{return this._loader}},locale(t){if(arguments.length){this._locale=t;return this}else{return this._locale}},logger(t){if(arguments.length){this._log=t;return this}else{return this._log}},error:Bi("error"),warn:Bi("warn"),info:Bi("info"),debug:Bi("debug"),logLevel:Bi("level"),cleanThreshold:1e4,add:On,connect:Tn,rank:Kn,rerank:Zn,pulse:Mi,touch:ki,update:Ei,changeset:En,ingest:Un,parse:In,preload:Gn,request:jn,events:qn,on:Xn,evaluate:mi,run:yi,runAsync:gi,runAfter:vi,_enqueue:xi,_getPulse:_i};function zi(t,e){$n.call(this,t,null,e)}(0,p.B)(zi,$n,{run(t){if(t.stampthis.pulse=t))}else if(e!==t.StopPropagation){this.pulse=e}return e},evaluate(t){const e=this.marshall(t.stamp),n=this.transform(e,t);e.clear();return n},transform(){}});const $i={};function Ri(t){const e=Oi(t);return e&&e.Definition||null}function Oi(t){t=t&&t.toLowerCase();return(0,p.mQ)($i,t)?$i[t]:null}var Ti=n(82887);var Ni=n(21671);var Li=n(44317);function Pi(t,...e){if(typeof t[Symbol.iterator]!=="function")throw new TypeError("values is not iterable");t=Array.from(t);let[n]=e;if(n&&n.length!==2||e.length>1){const i=Uint32Array.from(t,((t,e)=>e));if(e.length>1){e=e.map((e=>t.map(e)));i.sort(((t,n)=>{for(const i of e){const e=Ii(i[t],i[n]);if(e)return e}}))}else{n=t.map(n);i.sort(((t,e)=>Ii(n[t],n[e])))}return permute(t,i)}return t.sort(qi(n))}function qi(t=Ti.A){if(t===Ti.A)return Ii;if(typeof t!=="function")throw new TypeError("compare is not a function");return(e,n)=>{const i=t(e,n);if(i||i===0)return i;return(t(n,n)===0)-(t(e,e)===0)}}function Ii(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(te?1:0)}function Ui(t,e,n=0,i=Infinity,r){e=Math.floor(e);n=Math.floor(Math.max(0,n));i=Math.floor(Math.min(t.length-1,i));if(!(n<=e&&e<=i))return t;r=r===undefined?Ii:qi(r);while(i>n){if(i-n>600){const s=i-n+1;const a=e-n+1;const o=Math.log(s);const u=.5*Math.exp(2*o/3);const l=.5*Math.sqrt(o*u*(s-u)/s)*(a-s/2<0?-1:1);const c=Math.max(n,Math.floor(e-a*u/s+l));const f=Math.min(i,Math.floor(e+(s-a)*u/s+l));Ui(t,e,c,f,r)}const s=t[e];let a=n;let o=i;ji(t,n,e);if(r(t[i],s)>0)ji(t,n,i);while(a0)--o}if(r(t[n],s)===0)ji(t,n,o);else++o,ji(t,o,i);if(o<=e)n=o+1;if(e<=o)i=o-1}return t}function ji(t,e,n){const i=t[e];t[e]=t[n];t[n]=i}var Gi=n(40168);function Yi(t,e,n){t=Float64Array.from((0,Gi.n)(t,n));if(!(i=t.length)||isNaN(e=+e))return;if(e<=0||i<2)return(0,Li.A)(t);if(e>=1)return(0,Ni.A)(t);var i,r=(i-1)*e,s=Math.floor(r),a=(0,Ni.A)(Ui(t,s).subarray(0,s+1)),o=(0,Li.A)(t.subarray(s+1));return a+(o-a)*(r-s)}function Wi(t,e,n=Gi.A){if(!(i=t.length)||isNaN(e=+e))return;if(e<=0||i<2)return+n(t[0],0,t);if(e>=1)return+n(t[i-1],i-1,t);var i,r=(i-1)*e,s=Math.floor(r),a=+n(t[s],s,t),o=+n(t[s+1],s+1,t);return a+(o-a)*(r-s)}function Xi(t,e,n=number){if(isNaN(e=+e))return;i=Float64Array.from(t,((e,i)=>number(n(t[i],i,t))));if(e<=0)return minIndex(i);if(e>=1)return maxIndex(i);var i,r=Uint32Array.from(t,((t,e)=>e)),s=i.length-1,a=Math.floor(s*e);quickselect(r,a,0,s,((t,e)=>ascendingDefined(i[t],i[e])));a=greatest(r.subarray(0,a+1),(t=>i[t]));return a>=0?a:-1}function Hi(t,e){let n=0;let i;let r=0;let s=0;if(e===undefined){for(let e of t){if(e!=null&&(e=+e)>=e){i=e-r;r+=i/++n;s+=i*(e-r)}}}else{let a=-1;for(let o of t){if((o=e(o,++a,t))!=null&&(o=+o)>=o){i=o-r;r+=i/++n;s+=i*(o-r)}}}if(n>1)return s/(n-1)}function Vi(t,e){const n=Hi(t,e);return n?Math.sqrt(n):n}function Qi(t,e){return Yi(t,.5,e)}function Ki(t,e){return quantileIndex(t,.5,e)}function*Zi(t,e){if(e==null){for(let e of t){if(e!=null&&e!==""&&(e=+e)>=e){yield e}}}else{let n=-1;for(let i of t){i=e(i,++n,t);if(i!=null&&i!==""&&(i=+i)>=i){yield i}}}}function Ji(t,e,n){const i=Float64Array.from(Zi(t,n));i.sort(Ti.A);return e.map((t=>Wi(i,t)))}function tr(t,e){return Ji(t,[.25,.5,.75],e)}function er(t,e){const n=t.length,i=Vi(t,e),r=tr(t,e),s=(r[2]-r[0])/1.34,a=Math.min(i,s)||i||Math.abs(r[0])||1;return 1.06*a*Math.pow(n,-.2)}function nr(t){const e=t.maxbins||20,n=t.base||10,i=Math.log(n),r=t.divide||[5,2];let s=t.extent[0],a=t.extent[1],o,u,l,c,f,d;const h=t.span||a-s||Math.abs(s)||1;if(t.step){o=t.step}else if(t.steps){c=h/e;for(f=0,d=t.steps.length;fe){o*=n}for(f=0,d=r.length;f=l&&h/c<=e)o=c}}c=Math.log(o);const p=c>=0?0:~~(-c/i)+1,m=Math.pow(n,-p-1);if(t.nice||t.nice===undefined){c=Math.floor(s/o+m)*o;s=st);const r=t.length,s=new Float64Array(r);let a=0,o=1,u=i(t[0]),l=u,c=u+e,f;for(;o=c){l=(u+l)/2;for(;a>1);while(ar)t[a--]=t[i]}i=r;r=s}return t}function ur(t){return function(){t=(1103515245*t+12345)%2147483647;return t/2147483647}}function lr(t,e){if(e==null){e=t;t=0}let n,i,r;const s={min(t){if(arguments.length){n=t||0;r=i-n;return s}else{return n}},max(t){if(arguments.length){i=t||0;r=i-n;return s}else{return i}},sample(){return n+Math.floor(r*ir())},pdf(t){return t===Math.floor(t)&&t>=n&&t=i?1:(e-n+1)/r},icdf(t){return t>=0&&t<=1?n-1+Math.floor(t*r):NaN}};return s.min(t).max(e)}const cr=Math.sqrt(2*Math.PI);const fr=Math.SQRT2;let dr=NaN;function hr(t,e){t=t||0;e=e==null?1:e;let n=0,i=0,r,s;if(dr===dr){n=dr;dr=NaN}else{do{n=ir()*2-1;i=ir()*2-1;r=n*n+i*i}while(r===0||r>1);s=Math.sqrt(-2*Math.log(r)/r);n*=s;dr=i*s}return t+n*e}function pr(t,e,n){n=n==null?1:n;const i=(t-(e||0))/n;return Math.exp(-.5*i*i)/(n*cr)}function mr(t,e,n){e=e||0;n=n==null?1:n;const i=(t-e)/n,r=Math.abs(i);let s;if(r>37){s=0}else{const t=Math.exp(-r*r/2);let e;if(r<7.07106781186547){e=.0352624965998911*r+.700383064443688;e=e*r+6.37396220353165;e=e*r+33.912866078383;e=e*r+112.079291497871;e=e*r+221.213596169931;e=e*r+220.206867912376;s=t*e;e=.0883883476483184*r+1.75566716318264;e=e*r+16.064177579207;e=e*r+86.7807322029461;e=e*r+296.564248779674;e=e*r+637.333633378831;e=e*r+793.826512519948;e=e*r+440.413735824752;s=s/e}else{e=r+.65;e=r+4/e;e=r+3/e;e=r+2/e;e=r+1/e;s=t/e/2.506628274631}}return i>0?1-s:s}function gr(t,e,n){if(t<0||t>1)return NaN;return(e||0)+(n==null?1:n)*fr*yr(2*t-1)}function yr(t){let e=-Math.log((1-t)*(1+t)),n;if(e<6.25){e-=3.125;n=-364441206401782e-35;n=-16850591381820166e-35+n*e;n=128584807152564e-32+n*e;n=11157877678025181e-33+n*e;n=-1333171662854621e-31+n*e;n=20972767875968562e-33+n*e;n=6637638134358324e-30+n*e;n=-4054566272975207e-29+n*e;n=-8151934197605472e-29+n*e;n=26335093153082323e-28+n*e;n=-12975133253453532e-27+n*e;n=-5415412054294628e-26+n*e;n=1.0512122733215323e-9+n*e;n=-4.112633980346984e-9+n*e;n=-2.9070369957882005e-8+n*e;n=4.2347877827932404e-7+n*e;n=-13654692000834679e-22+n*e;n=-13882523362786469e-21+n*e;n=.00018673420803405714+n*e;n=-.000740702534166267+n*e;n=-.006033670871430149+n*e;n=.24015818242558962+n*e;n=1.6536545626831027+n*e}else if(e<16){e=Math.sqrt(e)-3.25;n=2.2137376921775787e-9;n=9.075656193888539e-8+n*e;n=-2.7517406297064545e-7+n*e;n=1.8239629214389228e-8+n*e;n=15027403968909828e-22+n*e;n=-4013867526981546e-21+n*e;n=29234449089955446e-22+n*e;n=12475304481671779e-21+n*e;n=-47318229009055734e-21+n*e;n=6828485145957318e-20+n*e;n=24031110387097894e-21+n*e;n=-.0003550375203628475+n*e;n=.0009532893797373805+n*e;n=-.0016882755560235047+n*e;n=.002491442096107851+n*e;n=-.003751208507569241+n*e;n=.005370914553590064+n*e;n=1.0052589676941592+n*e;n=3.0838856104922208+n*e}else if(Number.isFinite(e)){e=Math.sqrt(e)-5;n=-27109920616438573e-27;n=-2.555641816996525e-10+n*e;n=1.5076572693500548e-9+n*e;n=-3.789465440126737e-9+n*e;n=7.61570120807834e-9+n*e;n=-1.496002662714924e-8+n*e;n=2.914795345090108e-8+n*e;n=-6.771199775845234e-8+n*e;n=2.2900482228026655e-7+n*e;n=-9.9298272942317e-7+n*e;n=4526062597223154e-21+n*e;n=-1968177810553167e-20+n*e;n=7599527703001776e-20+n*e;n=-.00021503011930044477+n*e;n=-.00013871931833623122+n*e;n=1.0103004648645344+n*e;n=4.849906401408584+n*e}else{n=Infinity}return n*t}function vr(t,e){let n,i;const r={mean(t){if(arguments.length){n=t||0;return r}else{return n}},stdev(t){if(arguments.length){i=t==null?1:t;return r}else{return i}},sample:()=>hr(n,i),pdf:t=>pr(t,n,i),cdf:t=>mr(t,n,i),icdf:t=>gr(t,n,i)};return r.mean(t).stdev(e)}function br(t,e){const n=vr();let i=0;const r={data(n){if(arguments.length){t=n;i=n?n.length:0;return r.bandwidth(e)}else{return t}},bandwidth(n){if(!arguments.length)return e;e=n;if(!e&&t)e=er(t);return r},sample(){return t[~~(ir()*i)]+e*n.sample()},pdf(r){let s=0,a=0;for(;axr(n,i),pdf:t=>_r(t,n,i),cdf:t=>wr(t,n,i),icdf:t=>Ar(t,n,i)};return r.mean(t).stdev(e)}function Er(t,e){let n=0,i;function r(t){const e=[];let i=0,r;for(r=0;r=e&&t<=n?1/(n-e):0}function Cr(t,e,n){if(n==null){n=e==null?1:e;e=0}return tn?1:(t-e)/(n-e)}function Fr(t,e,n){if(n==null){n=e==null?1:e;e=0}return t>=0&&t<=1?e+t*(n-e):NaN}function Sr(t,e){let n,i;const r={min(t){if(arguments.length){n=t||0;return r}else{return n}},max(t){if(arguments.length){i=t==null?1:t;return r}else{return i}},sample:()=>Mr(n,i),pdf:t=>Dr(t,n,i),cdf:t=>Cr(t,n,i),icdf:t=>Fr(t,n,i)};if(e==null){e=t==null?1:t;t=0}return r.min(t).max(e)}function Br(t,e,n){let i=0,r=0;for(const s of t){const t=n(s);if(e(s)==null||t==null||isNaN(t))continue;i+=(t-i)/++r}return{coef:[i],predict:()=>i,rSquared:0}}function zr(t,e,n,i){const r=i-t*t,s=Math.abs(r)<1e-24?0:(n-t*e)/r,a=e-s*t;return[a,s]}function $r(t,e,n,i){t=t.filter((t=>{let i=e(t),r=n(t);return i!=null&&(i=+i)>=i&&r!=null&&(r=+r)>=r}));if(i){t.sort(((t,n)=>e(t)-e(n)))}const r=t.length,s=new Float64Array(r),a=new Float64Array(r);let o=0,u=0,l=0,c,f,d;for(d of t){s[o]=c=+e(d);a[o]=f=+n(d);++o;u+=(c-u)/o;l+=(f-l)/o}for(o=0;o=s&&a!=null&&(a=+a)>=a){i(s,a,++r)}}}function Or(t,e,n,i,r){let s=0,a=0;Rr(t,e,n,((t,e)=>{const n=e-r(t),o=e-i;s+=n*n;a+=o*o}));return 1-s/a}function Tr(t,e,n){let i=0,r=0,s=0,a=0,o=0;Rr(t,e,n,((t,e)=>{++o;i+=(t-i)/o;r+=(e-r)/o;s+=(t*e-s)/o;a+=(t*t-a)/o}));const u=zr(i,r,s,a),l=t=>u[0]+u[1]*t;return{coef:u,predict:l,rSquared:Or(t,e,n,r,l)}}function Nr(t,e,n){let i=0,r=0,s=0,a=0,o=0;Rr(t,e,n,((t,e)=>{++o;t=Math.log(t);i+=(t-i)/o;r+=(e-r)/o;s+=(t*e-s)/o;a+=(t*t-a)/o}));const u=zr(i,r,s,a),l=t=>u[0]+u[1]*Math.log(t);return{coef:u,predict:l,rSquared:Or(t,e,n,r,l)}}function Lr(t,e,n){const[i,r,s,a]=$r(t,e,n);let o=0,u=0,l=0,c=0,f=0,d,h,p;Rr(t,e,n,((t,e)=>{d=i[f++];h=Math.log(e);p=d*e;o+=(e*h-o)/f;u+=(p-u)/f;l+=(p*h-l)/f;c+=(d*p-c)/f}));const[m,g]=zr(u/a,o/a,l/a,c/a),y=t=>Math.exp(m+g*(t-s));return{coef:[Math.exp(m-g*s),g],predict:y,rSquared:Or(t,e,n,a,y)}}function Pr(t,e,n){let i=0,r=0,s=0,a=0,o=0,u=0;Rr(t,e,n,((t,e)=>{const n=Math.log(t),l=Math.log(e);++u;i+=(n-i)/u;r+=(l-r)/u;s+=(n*l-s)/u;a+=(n*n-a)/u;o+=(e-o)/u}));const l=zr(i,r,s,a),c=t=>l[0]*Math.pow(t,l[1]);l[0]=Math.exp(l[0]);return{coef:l,predict:c,rSquared:Or(t,e,n,o,c)}}function qr(t,e,n){const[i,r,s,a]=$r(t,e,n),o=i.length;let u=0,l=0,c=0,f=0,d=0,h,p,m,g;for(h=0;h{t=t-s;return b*t*t+x*t+_+a};return{coef:[_-x*s+b*s*s+a,x-2*b*s,b],predict:w,rSquared:Or(t,e,n,a,w)}}function Ir(t,e,n,i){if(i===0)return Br(t,e,n);if(i===1)return Tr(t,e,n);if(i===2)return qr(t,e,n);const[r,s,a,o]=$r(t,e,n),u=r.length,l=[],c=[],f=i+1;let d,h,p,m,g;for(d=0;d{t-=a;let e=o+y[0]+y[1]*t+y[2]*t*t;for(d=3;d=0;--s){o=e[s];u=1;r[s]+=o;for(a=1;a<=s;++a){u*=(s+1-a)/a;r[s-a]+=o*Math.pow(n,a)*u}}r[0]+=i;return r}function jr(t){const e=t.length-1,n=[];let i,r,s,a,o;for(i=0;iMath.abs(t[i][a])){a=r}}for(s=i;s=i;s--){t[s][r]-=t[s][i]*t[i][r]/t[i][i]}}}for(r=e-1;r>=0;--r){o=0;for(s=r+1;sr[a]-e?i:a;let u=0,l=0,h=0,p=0,m=0;const g=1/Math.abs(r[o]-e||1);for(let t=i;t<=a;++t){const n=r[t],i=s[t],a=Xr(Math.abs(e-n)*g)*d[t],o=n*a;u+=a;l+=o;h+=i*a;p+=i*o;m+=n*o}const[y,v]=zr(l/u,h/u,p/u,m/u);c[n]=y+v*e;f[n]=Math.abs(s[n]-c[n]);Hr(r,n+1,t)}if(h===Gr){break}const e=Qi(f);if(Math.abs(e)=1?Yr:(r=1-i*i)*r}}return Vr(r,c,a,o)}function Xr(t){return(t=1-t*t*t)*t*t}function Hr(t,e,n){const i=t[e];let r=n[0],s=n[1]+1;if(s>=t.length)return;while(e>r&&t[s]-i<=i-t[r]){n[0]=++r;n[1]=s;++s}}function Vr(t,e,n,i){const r=t.length,s=[];let a=0,o=0,u=[],l;for(;a[e,t(e)],s=e[0],a=e[1],o=a-s,u=o/i,l=[r(s)],c=[];if(n===i){for(let t=1;t0;){c.push(r(s+t/n*o))}}let f=l[0];let d=c[c.length-1];const h=1/o;const p=Zr(f[1],c);while(d){const t=r((f[0]+d[0])/2);const e=t[0]-f[0]>=u;if(e&&Jr(f,t,d,h,p)>Qr){c.push(t)}else{f=d;l.push(d);c.pop()}d=c[c.length-1]}return l}function Zr(t,e){let n=t;let i=t;const r=e.length;for(let s=0;si)i=t}return 1/(i-n)}function Jr(t,e,n,i,r){const s=Math.atan2(r*(n[1]-t[1]),i*(n[0]-t[0])),a=Math.atan2(r*(e[1]-t[1]),i*(e[0]-t[0]));return Math.abs(s-a)}function ts(t,e){let n=0;let i=0;if(e===undefined){for(let e of t){if(e!=null&&(e=+e)>=e){++n,i+=e}}}else{let r=-1;for(let s of t){if((s=e(s,++r,t))!=null&&(s=+s)>=s){++n,i+=s}}}if(n)return i/n}var es=n(18312);function ns(t){return e=>{const n=t.length;let i=1,r=String(t[0](e));for(;i{};const as={init:ss,add:ss,rem:ss,idx:0};const os={values:{init:t=>t.cell.store=true,value:t=>t.cell.data.values(),idx:-1},count:{value:t=>t.cell.num},__count__:{value:t=>t.missing+t.valid},missing:{value:t=>t.missing},valid:{value:t=>t.valid},sum:{init:t=>t.sum=0,value:t=>t.valid?t.sum:undefined,add:(t,e)=>t.sum+=+e,rem:(t,e)=>t.sum-=e},product:{init:t=>t.product=1,value:t=>t.valid?t.product:undefined,add:(t,e)=>t.product*=e,rem:(t,e)=>t.product/=e},mean:{init:t=>t.mean=0,value:t=>t.valid?t.mean:undefined,add:(t,e)=>(t.mean_d=e-t.mean,t.mean+=t.mean_d/t.valid),rem:(t,e)=>(t.mean_d=e-t.mean,t.mean-=t.valid?t.mean_d/t.valid:t.mean)},average:{value:t=>t.valid?t.mean:undefined,req:["mean"],idx:1},variance:{init:t=>t.dev=0,value:t=>t.valid>1?t.dev/(t.valid-1):undefined,add:(t,e)=>t.dev+=t.mean_d*(e-t.mean),rem:(t,e)=>t.dev-=t.mean_d*(e-t.mean),req:["mean"],idx:1},variancep:{value:t=>t.valid>1?t.dev/t.valid:undefined,req:["variance"],idx:2},stdev:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid-1)):undefined,req:["variance"],idx:2},stdevp:{value:t=>t.valid>1?Math.sqrt(t.dev/t.valid):undefined,req:["variance"],idx:2},stderr:{value:t=>t.valid>1?Math.sqrt(t.dev/(t.valid*(t.valid-1))):undefined,req:["variance"],idx:2},distinct:{value:t=>t.cell.data.distinct(t.get),req:["values"],idx:3},ci0:{value:t=>t.cell.data.ci0(t.get),req:["values"],idx:3},ci1:{value:t=>t.cell.data.ci1(t.get),req:["values"],idx:3},median:{value:t=>t.cell.data.q2(t.get),req:["values"],idx:3},q1:{value:t=>t.cell.data.q1(t.get),req:["values"],idx:3},q3:{value:t=>t.cell.data.q3(t.get),req:["values"],idx:3},min:{init:t=>t.min=undefined,value:t=>t.min=Number.isNaN(t.min)?t.cell.data.min(t.get):t.min,add:(t,e)=>{if(e{if(e<=t.min)t.min=NaN},req:["values"],idx:4},max:{init:t=>t.max=undefined,value:t=>t.max=Number.isNaN(t.max)?t.cell.data.max(t.get):t.max,add:(t,e)=>{if(e>t.max||t.max===undefined)t.max=e},rem:(t,e)=>{if(e>=t.max)t.max=NaN},req:["values"],idx:4},argmin:{init:t=>t.argmin=undefined,value:t=>t.argmin||t.cell.data.argmin(t.get),add:(t,e,n)=>{if(e{if(e<=t.min)t.argmin=undefined},req:["min","values"],idx:3},argmax:{init:t=>t.argmax=undefined,value:t=>t.argmax||t.cell.data.argmax(t.get),add:(t,e,n)=>{if(e>t.max)t.argmax=n},rem:(t,e)=>{if(e>=t.max)t.argmax=undefined},req:["max","values"],idx:3},exponential:{init:(t,e)=>{t.exp=0;t.exp_r=e},value:t=>t.valid?t.exp*(1-t.exp_r)/(1-t.exp_r**t.valid):undefined,add:(t,e)=>t.exp=t.exp_r*t.exp+e,rem:(t,e)=>t.exp=(t.exp-e/t.exp_r**(t.valid-1))/t.exp_r},exponentialb:{value:t=>t.valid?t.exp*(1-t.exp_r):undefined,req:["exponential"],idx:1}};const us=Object.keys(os).filter((t=>t!=="__count__"));function ls(t,e){return(n,i)=>(0,p.X$)({name:t,aggregate_param:i,out:n||t},as,e)}[...us,"__count__"].forEach((t=>{os[t]=ls(t,os[t])}));function cs(t,e,n){return os[t](n,e)}function fs(t,e){return t.idx-e.idx}function ds(t){const e={};t.forEach((t=>e[t.name]=t));const n=t=>{if(!t.req)return;t.req.forEach((t=>{if(!e[t])n(e[t]=os[t]())}))};t.forEach(n);return Object.values(e).sort(fs)}function hs(){this.valid=0;this.missing=0;this._ops.forEach((t=>t.aggregate_param==null?t.init(this):t.init(this,t.aggregate_param)))}function ps(t,e){if(t==null||t===""){++this.missing;return}if(t!==t)return;++this.valid;this._ops.forEach((n=>n.add(this,t,e)))}function ms(t,e){if(t==null||t===""){--this.missing;return}if(t!==t)return;--this.valid;this._ops.forEach((n=>n.rem(this,t,e)))}function gs(t){this._out.forEach((e=>t[e.out]=e.value(this)));return t}function ys(t,e){const n=e||p.D_,i=ds(t),r=t.slice().sort(fs);function s(t){this._ops=i;this._out=r;this.cell=t;this.init()}s.prototype.init=hs;s.prototype.add=ps;s.prototype.rem=ms;s.prototype.set=gs;s.prototype.get=n;s.fields=t.map((t=>t.out));return s}function vs(t){this._key=t?(0,p.ZZ)(t):yn;this.reset()}const bs=vs.prototype;bs.reset=function(){this._add=[];this._rem=[];this._ext=null;this._get=null;this._q=null};bs.add=function(t){this._add.push(t)};bs.rem=function(t){this._rem.push(t)};bs.values=function(){this._get=null;if(this._rem.length===0)return this._add;const t=this._add,e=this._rem,n=this._key,i=t.length,r=e.length,s=Array(i-r),a={};let o,u,l;for(o=0;o=0){s=t(e[i])+"";if(!(0,p.mQ)(n,s)){n[s]=1;++r}}return r};bs.extent=function(t){if(this._get!==t||!this._ext){const e=this.values(),n=(0,p.n)(e,t);this._ext=[e[n[0]],e[n[1]]];this._get=t}return this._ext};bs.argmin=function(t){return this.extent(t)[0]||{}};bs.argmax=function(t){return this.extent(t)[1]||{}};bs.min=function(t){const e=this.extent(t)[0];return e!=null?t(e):undefined};bs.max=function(t){const e=this.extent(t)[1];return e!=null?t(e):undefined};bs.quartile=function(t){if(this._get!==t||!this._q){this._q=tr(this.values(),t);this._get=t}return this._q};bs.q1=function(t){return this.quartile(t)[0]};bs.q2=function(t){return this.quartile(t)[1]};bs.q3=function(t){return this.quartile(t)[2]};bs.ci=function(t){if(this._get!==t||!this._ci){this._ci=sr(this.values(),1e3,.05,t);this._get=t}return this._ci};bs.ci0=function(t){return this.ci(t)[0]};bs.ci1=function(t){return this.ci(t)[1]};function xs(t){zi.call(this,null,t);this._adds=[];this._mods=[];this._alen=0;this._mlen=0;this._drop=true;this._cross=false;this._dims=[];this._dnames=[];this._measures=[];this._countOnly=false;this._counts=null;this._prev=null;this._inputs=null;this._outputs=null}xs.Definition={type:"Aggregate",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"ops",type:"enum",array:true,values:us},{name:"aggregate_params",type:"number",null:true,array:true},{name:"fields",type:"field",null:true,array:true},{name:"as",type:"string",null:true,array:true},{name:"drop",type:"boolean",default:true},{name:"cross",type:"boolean",default:false},{name:"key",type:"field"}]};(0,p.B)(xs,zi,{transform(t,e){const n=this,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.modified();n.stamp=i.stamp;if(n.value&&(r||e.modified(n._inputs,true))){n._prev=n.value;n.value=r?n.init(t):Object.create(null);e.visit(e.SOURCE,(t=>n.add(t)))}else{n.value=n.value||n.init(t);e.visit(e.REM,(t=>n.rem(t)));e.visit(e.ADD,(t=>n.add(t)))}i.modifies(n._outputs);n._drop=t.drop!==false;if(t.cross&&n._dims.length>1){n._drop=false;n.cross()}if(e.clean()&&n._drop){i.clean(true).runAfter((()=>this.clean()))}return n.changes(i)},cross(){const t=this,e=t.value,n=t._dnames,i=n.map((()=>({}))),r=n.length;function s(t){let e,s,a,o;for(e in t){a=t[e].tuple;for(s=0;s{const e=(0,p.N6)(t);r(t);n.push(e);return e}));this.cellkey=t.key?t.key:is(this._dims);this._countOnly=true;this._counts=[];this._measures=[];const s=t.fields||[null],a=t.ops||["count"],o=t.aggregate_params||[null],u=t.as||[],l=s.length,c={};let f,d,h,m,g,y,v;if(l!==a.length){(0,p.z3)("Unmatched number of fields and aggregate ops.")}for(v=0;vys(t,t.field)));return Object.create(null)},cellkey:is(),cell(t,e){let n=this.value[t];if(!n){n=this.value[t]=this.newcell(t,e);this._adds[this._alen++]=n}else if(n.num===0&&this._drop&&n.stamp{const e=i(t);t[o]=e;t[u]=e==null?null:r+s*(1+(e-r)/s)}:t=>t[o]=i(t));return e.modifies(n?a:o)},_bins(t){if(this.value&&!t.modified()){return this.value}const e=t.field,n=nr(t),i=n.step;let r=n.start,s=r+Math.ceil((n.stop-r)/i)*i,a,o;if((a=t.anchor)!=null){o=a-(r+i*Math.floor((a-r)/i));r+=o;s+=o}const u=function(t){let n=(0,p.Ro)(e(t));return n==null?null:ns?+Infinity:(n=Math.max(r,Math.min(n,s-i)),r+i*Math.floor(_s+(n-r)/i))};u.start=r;u.stop=n.stop;u.step=i;return this.value=(0,p.sY)(u,(0,p.nS)(e),t.name||"bin_"+(0,p.N6)(e))}});function As(t,e,n){const i=t;let r=e||[],s=n||[],a={},o=0;return{add:t=>s.push(t),remove:t=>a[i(t)]=++o,size:()=>r.length,data:(t,e)=>{if(o){r=r.filter((t=>!a[i(t)]));a={};o=0}if(e&&t){r.sort(t)}if(s.length){r=t?(0,p.h1)(t,r,s.sort(t)):r.concat(s);s=[]}return r}}}function ks(t){zi.call(this,[],t)}ks.Definition={type:"Collect",metadata:{source:true},params:[{name:"sort",type:"compare"}]};(0,p.B)(ks,zi,{transform(t,e){const n=e.fork(e.ALL),i=As(yn,this.value,n.materialize(n.ADD).add),r=t.sort,s=e.changed()||r&&(t.modified("sort")||e.modified(r.fields));n.visit(n.REM,i.remove);this.modified(s);this.value=n.source=i.data(An(r),s);if(e.source&&e.source.root){this.value.root=e.source.root}return n}});function Es(t){$n.call(this,null,Ms,t)}(0,p.B)(Es,$n);function Ms(t){return this.value&&!t.modified()?this.value:(0,p.UD)(t.fields,t.orders)}function Ds(t){zi.call(this,null,t)}Ds.Definition={type:"CountPattern",metadata:{generates:true,changes:true},params:[{name:"field",type:"field",required:true},{name:"case",type:"enum",values:["upper","lower","mixed"],default:"mixed"},{name:"pattern",type:"string",default:'[\\w"]+'},{name:"stopwords",type:"string",default:""},{name:"as",type:"string",array:true,length:2,default:["text","count"]}]};function Cs(t,e,n){switch(e){case"upper":t=t.toUpperCase();break;case"lower":t=t.toLowerCase();break}return t.match(n)}(0,p.B)(Ds,zi,{transform(t,e){const n=e=>n=>{var i=Cs(o(n),t.case,s)||[],r;for(var u=0,l=i.length;ur[t]=1+(r[t]||0))),c=n((t=>r[t]-=1));if(i){e.visit(e.SOURCE,l)}else{e.visit(e.ADD,l);e.visit(e.REM,c)}return this._finish(e,u)},_parameterCheck(t,e){let n=false;if(t.modified("stopwords")||!this._stop){this._stop=new RegExp("^"+(t.stopwords||"")+"$","i");n=true}if(t.modified("pattern")||!this._match){this._match=new RegExp(t.pattern||"[\\w']+","g");n=true}if(t.modified("field")||e.modified(t.field.fields)){n=true}if(n)this._counts={};return n},_finish(t,e){const n=this._counts,i=this._tuples||(this._tuples={}),r=e[0],s=e[1],a=t.fork(t.NO_SOURCE|t.NO_FIELDS);let o,u,l;for(o in n){u=i[o];l=n[o]||0;if(!u&&l){i[o]=u=bn({});u[r]=o;u[s]=l;a.add.push(u)}else if(l===0){if(u)a.rem.push(u);n[o]=null;i[o]=null}else if(u[s]!==l){u[s]=l;a.mod.push(u)}}return a.modifies(e)}});function Fs(t){zi.call(this,null,t)}Fs.Definition={type:"Cross",metadata:{generates:true},params:[{name:"filter",type:"expr"},{name:"as",type:"string",array:true,length:2,default:["a","b"]}]};(0,p.B)(Fs,zi,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.as||["a","b"],r=i[0],s=i[1],a=!this.value||e.changed(e.ADD_REM)||t.modified("as")||t.modified("filter");let o=this.value;if(a){if(o)n.rem=o;o=e.materialize(e.SOURCE).source;n.add=this.value=Ss(o,r,s,t.filter||p.vN)}else{n.mod=o}n.source=this.value;return n.modifies(i)}});function Ss(t,e,n,i){var r=[],s={},a=t.length,o=0,u,l;for(;oOs(t,e))))}else if(typeof i[r]===$s){i[r](t[r])}}return i}function Ts(t){zi.call(this,null,t)}const Ns=[{key:{function:"normal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"lognormal"},params:[{name:"mean",type:"number",default:0},{name:"stdev",type:"number",default:1}]},{key:{function:"uniform"},params:[{name:"min",type:"number",default:0},{name:"max",type:"number",default:1}]},{key:{function:"kde"},params:[{name:"field",type:"field",required:true},{name:"from",type:"data"},{name:"bandwidth",type:"number",default:0}]}];const Ls={key:{function:"mixture"},params:[{name:"distributions",type:"param",array:true,params:Ns},{name:"weights",type:"number",array:true}]};Ts.Definition={type:"Density",metadata:{generates:true},params:[{name:"extent",type:"number",array:true,length:2},{name:"steps",type:"number"},{name:"minsteps",type:"number",default:25},{name:"maxsteps",type:"number",default:200},{name:"method",type:"string",default:"pdf",values:["pdf","cdf"]},{name:"distribution",type:"param",params:Ns.concat(Ls)},{name:"as",type:"string",array:true,default:["value","density"]}]};(0,p.B)(Ts,zi,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=Os(t.distribution,Ps(e)),r=t.steps||t.minsteps||25,s=t.steps||t.maxsteps||200;let a=t.method||"pdf";if(a!=="pdf"&&a!=="cdf"){(0,p.z3)("Invalid density method: "+a)}if(!t.extent&&!i.data){(0,p.z3)("Missing density extent parameter.")}a=i[a];const o=t.as||["value","density"],u=t.extent||(0,p.Xx)(i.data()),l=Kr(a,u,r,s).map((t=>{const e={};e[o[0]]=t[0];e[o[1]]=t[1];return bn(e)}));if(this.value)n.rem=this.value;this.value=n.add=n.source=l}return n}});function Ps(t){return()=>t.materialize(t.SOURCE).source}function qs(t,e){if(!t)return null;return t.map(((t,n)=>e[n]||(0,p.N6)(t)))}function Is(t,e,n){const i=[],r=t=>t(u);let s,a,o,u,l,c;if(e==null){i.push(t.map(n))}else{for(s={},a=0,o=t.length;a(0,p.Ln)((0,p.Xx)(t,e))/30;(0,p.B)(js,zi,{transform(t,e){if(this.value&&!(t.modified()||e.changed())){return e}const n=e.materialize(e.SOURCE).source,i=Is(e.source,t.groupby,p.D_),r=t.smooth||false,s=t.field,a=t.step||Gs(n,s),o=An(((t,e)=>s(t)-s(e))),u=t.as||Us,l=i.length;let c=Infinity,f=-Infinity,d=0,h;for(;df)f=e;t[++h][u]=e}}this.value={start:c,stop:f,step:a};return e.reflow(true).modifies(u)}});function Ys(t){$n.call(this,null,Ws,t);this.modified(true)}(0,p.B)(Ys,$n);function Ws(t){const e=t.expr;return this.value&&!t.modified("expr")?this.value:(0,p.sY)((n=>e(n,t)),(0,p.nS)(e),(0,p.N6)(e))}function Xs(t){zi.call(this,[undefined,undefined],t)}Xs.Definition={type:"Extent",metadata:{},params:[{name:"field",type:"field",required:true}]};(0,p.B)(Xs,zi,{transform(t,e){const n=this.value,i=t.field,r=e.changed()||e.modified(i.fields)||t.modified("field");let s=n[0],a=n[1];if(r||s==null){s=+Infinity;a=-Infinity}e.visit(r?e.SOURCE:e.ADD,(t=>{const e=(0,p.Ro)(i(t));if(e!=null){if(ea)a=e}}));if(!Number.isFinite(s)||!Number.isFinite(a)){let t=(0,p.N6)(i);if(t)t=` for field "${t}"`;e.dataflow.warn(`Infinite extent${t}: [${s}, ${a}]`);s=a=undefined}this.value=[s,a]}});function Hs(t,e){$n.call(this,t);this.parent=e;this.count=0}(0,p.B)(Hs,$n,{connect(t){this.detachSubflow=t.detachSubflow;this.targets().add(t);return t.source=this},add(t){this.count+=1;this.value.add.push(t)},rem(t){this.count-=1;this.value.rem.push(t)},mod(t){this.value.mod.push(t)},init(t){this.value.init(t,t.NO_SOURCE)},evaluate(){return this.value}});function Vs(t){zi.call(this,{},t);this._keys=(0,p.nG)();const e=this._targets=[];e.active=0;e.forEach=t=>{for(let n=0,i=e.active;nt&&t.count>0));this.initTargets(t)}},initTargets(t){const e=this._targets,n=e.length,i=t?t.length:0;let r=0;for(;rthis.subflow(t,r,e);this._group=t.group||{};this.initTargets();e.visit(e.REM,(t=>{const e=yn(t),n=s.get(e);if(n!==undefined){s.delete(e);o(n).rem(t)}}));e.visit(e.ADD,(t=>{const e=i(t);s.set(yn(t),e);o(e).add(t)}));if(a||e.modified(i.fields)){e.visit(e.MOD,(t=>{const e=yn(t),n=s.get(e),r=i(t);if(n===r){o(r).mod(t)}else{s.set(e,r);o(n).rem(t);o(r).add(t)}}))}else if(e.changed(e.MOD)){e.visit(e.MOD,(t=>{o(s.get(yn(t))).mod(t)}))}if(a){e.visit(e.REFLOW,(t=>{const e=yn(t),n=s.get(e),r=i(t);if(n!==r){s.set(e,r);o(n).rem(t);o(r).add(t)}}))}if(e.clean()){n.runAfter((()=>{this.clean();s.clean()}))}else if(s.empty>n.cleanThreshold){n.runAfter(s.clean)}return e}});function Qs(t){$n.call(this,null,Ks,t)}(0,p.B)(Qs,$n);function Ks(t){return this.value&&!t.modified()?this.value:(0,p.cy)(t.name)?(0,p.YO)(t.name).map((t=>(0,p.ZZ)(t))):(0,p.ZZ)(t.name,t.as)}function Zs(t){zi.call(this,(0,p.nG)(),t)}Zs.Definition={type:"Filter",metadata:{changes:true},params:[{name:"expr",type:"expr",required:true}]};(0,p.B)(Zs,zi,{transform(t,e){const n=e.dataflow,i=this.value,r=e.fork(),s=r.add,a=r.rem,o=r.mod,u=t.expr;let l=true;e.visit(e.REM,(t=>{const e=yn(t);if(!i.has(e))a.push(t);else i.delete(e)}));e.visit(e.ADD,(e=>{if(u(e,t))s.push(e);else i.set(yn(e),1)}));function c(e){const n=yn(e),r=u(e,t),c=i.get(n);if(r&&c){i.delete(n);s.push(e)}else if(!r&&!c){i.set(n,1);a.push(e)}else if(l&&r&&!c){o.push(e)}}e.visit(e.MOD,c);if(t.modified()){l=false;e.visit(e.REFLOW,c)}if(i.empty>n.cleanThreshold)n.runAfter(i.clean);return r}});function Js(t){zi.call(this,[],t)}Js.Definition={type:"Flatten",metadata:{generates:true},params:[{name:"fields",type:"field",array:true,required:true},{name:"index",type:"string"},{name:"as",type:"string",array:true}]};(0,p.B)(Js,zi,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=qs(i,t.as||[]),s=t.index||null,a=r.length;n.rem=this.value;e.visit(e.SOURCE,(t=>{const e=i.map((e=>e(t))),o=e.reduce(((t,e)=>Math.max(t,e.length)),0);let u=0,l,c,f;for(;u{for(let e=0,s;ee[i]=n(e,t)))}});function na(t){zi.call(this,[],t)}(0,p.B)(na,zi,{transform(t,e){const n=e.fork(e.ALL),i=t.generator;let r=this.value,s=t.size-r.length,a,o,u;if(s>0){for(a=[];--s>=0;){a.push(u=bn(i(t)));r.push(u)}n.add=n.add.length?n.materialize(n.ADD).add.concat(a):a}else{o=r.slice(0,-s);n.rem=n.rem.length?n.materialize(n.REM).rem.concat(o):o;r=r.slice(-s)}n.source=this.value=r;return n}});const ia={value:"value",median:Qi,mean:ts,min:Li.A,max:Ni.A};const ra=[];function sa(t){zi.call(this,[],t)}sa.Definition={type:"Impute",metadata:{changes:true},params:[{name:"field",type:"field",required:true},{name:"key",type:"field",required:true},{name:"keyvals",array:true},{name:"groupby",type:"field",array:true},{name:"method",type:"enum",default:"value",values:["value","mean","median","max","min"]},{name:"value",default:0}]};function aa(t){var e=t.method||ia.value,n;if(ia[e]==null){(0,p.z3)("Unrecognized imputation method: "+e)}else if(e===ia.value){n=t.value!==undefined?t.value:0;return()=>n}else{return ia[e]}}function oa(t){const e=t.field;return t=>t?e(t):NaN}(0,p.B)(sa,zi,{transform(t,e){var n=e.fork(e.ALL),i=aa(t),r=oa(t),s=(0,p.N6)(t.field),a=(0,p.N6)(t.key),o=(t.groupby||[]).map(p.N6),u=ua(e.source,t.groupby,t.key,t.keyvals),l=[],c=this.value,f=u.domain.length,d,h,m,g,y,v,b,x,_,w;for(y=0,x=u.length;yt(g),s=[],a=i?i.slice():[],o={},u={},l,c,f,d,h,p,m,g;a.forEach(((t,e)=>o[t]=e+1));for(d=0,m=t.length;dn.add(t)))}else{r=n.value=n.value||this.init(t);e.visit(e.REM,(t=>n.rem(t)));e.visit(e.ADD,(t=>n.add(t)))}n.changes();e.visit(e.SOURCE,(t=>{(0,p.X$)(t,r[n.cellkey(t)].tuple)}));return e.reflow(i).modifies(this._outputs)},changes(){const t=this._adds,e=this._mods;let n,i;for(n=0,i=this._alen;n{const n=br(e,a)[o],i=t.counts?e.length:1,r=c||(0,p.Xx)(e);Kr(n,r,f,d).forEach((t=>{const n={};for(let i=0;i{this._pending=(0,p.YO)(t.data);return t=>t.touch(this)}));return{async:e}}else{return n.request(t.url,t.format).then((t=>ma(this,e,(0,p.YO)(t.data))))}}});function pa(t){return t.modified("async")&&!(t.modified("values")||t.modified("url")||t.modified("format"))}function ma(t,e,n){n.forEach(bn);const i=e.fork(e.NO_FIELDS&e.NO_SOURCE);i.rem=t.value;t.value=i.source=i.add=n;t._pending=null;if(i.rem.length)i.clean(true);return i}function ga(t){zi.call(this,{},t)}ga.Definition={type:"Lookup",metadata:{modifies:true},params:[{name:"index",type:"index",params:[{name:"from",type:"data",required:true},{name:"key",type:"field",required:true}]},{name:"values",type:"field",array:true},{name:"fields",type:"field",array:true,required:true},{name:"as",type:"string",array:true},{name:"default",default:null}]};(0,p.B)(ga,zi,{transform(t,e){const n=t.fields,i=t.index,r=t.values,s=t.default==null?null:t.default,a=t.modified(),o=n.length;let u=a?e.SOURCE:e.ADD,l=e,c=t.as,f,d,h;if(r){d=r.length;if(o>1&&!c){(0,p.z3)('Multi-field lookup requires explicit "as" parameter.')}if(c&&c.length!==o*d){(0,p.z3)('The "as" parameter has too few output field names.')}c=c||r.map(p.N6);f=function(t){for(var e=0,a=0,u,l;ee.modified(t.fields)));u|=h?e.MOD:0}e.visit(u,f);return l.modifies(c)}});function ya(t){$n.call(this,null,va,t)}(0,p.B)(ya,$n);function va(t){if(this.value&&!t.modified()){return this.value}const e=t.extents,n=e.length;let i=+Infinity,r=-Infinity,s,a;for(s=0;sr)r=a[1]}return[i,r]}function ba(t){$n.call(this,null,xa,t)}(0,p.B)(ba,$n);function xa(t){return this.value&&!t.modified()?this.value:t.values.reduce(((t,e)=>t.concat(e)),[])}function _a(t){zi.call(this,null,t)}(0,p.B)(_a,zi,{transform(t,e){this.modified(t.modified());this.value=t;return e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function wa(t){xs.call(this,t)}wa.Definition={type:"Pivot",metadata:{generates:true,changes:true},params:[{name:"groupby",type:"field",array:true},{name:"field",type:"field",required:true},{name:"value",type:"field",required:true},{name:"op",type:"enum",values:us,default:"sum"},{name:"limit",type:"number",default:0},{name:"key",type:"field"}]};(0,p.B)(wa,xs,{_transform:xs.prototype.transform,transform(t,e){return this._transform(Aa(t,e),e)}});function Aa(t,e){const n=t.field,i=t.value,r=(t.op==="count"?"__count__":t.op)||"sum",s=(0,p.nS)(n).concat((0,p.nS)(i)),a=Ea(n,t.limit||0,e);if(e.changed())t.set("__pivot__",null,null,true);return{key:t.key,groupby:t.groupby,ops:a.map((()=>r)),fields:a.map((t=>ka(t,n,i,s))),as:a.map((t=>t+"")),modified:t.modified.bind(t)}}function ka(t,e,n,i){return(0,p.sY)((i=>e(i)===t?n(i):NaN),i,t+"")}function Ea(t,e,n){const i={},r=[];n.visit(n.SOURCE,(e=>{const n=t(e);if(!i[n]){i[n]=1;r.push(n)}}));r.sort(p.V_);return e?r.slice(0,e):r}function Ma(t){Vs.call(this,t)}(0,p.B)(Ma,Vs,{transform(t,e){const n=t.subflow,i=t.field,r=t=>this.subflow(yn(t),n,e,t);if(t.modified("field")||i&&e.modified((0,p.nS)(i))){(0,p.z3)("PreFacet does not support field modification.")}this.initTargets();if(i){e.visit(e.MOD,(t=>{const e=r(t);i(t).forEach((t=>e.mod(t)))}));e.visit(e.ADD,(t=>{const e=r(t);i(t).forEach((t=>e.add(bn(t))))}));e.visit(e.REM,(t=>{const e=r(t);i(t).forEach((t=>e.rem(t)))}))}else{e.visit(e.MOD,(t=>r(t).mod(t)));e.visit(e.ADD,(t=>r(t).add(t)));e.visit(e.REM,(t=>r(t).rem(t)))}if(e.clean()){e.runAfter((()=>this.clean()))}return e}});function Da(t){zi.call(this,null,t)}Da.Definition={type:"Project",metadata:{generates:true,changes:true},params:[{name:"fields",type:"field",array:true},{name:"as",type:"string",null:true,array:true}]};(0,p.B)(Da,zi,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.fields,r=qs(t.fields,t.as||[]),s=i?(t,e)=>Ca(t,e,i,r):_n;let a;if(this.value){a=this.value}else{e=e.addAll();a=this.value={}}e.visit(e.REM,(t=>{const e=yn(t);n.rem.push(a[e]);a[e]=null}));e.visit(e.ADD,(t=>{const e=s(t,bn({}));a[yn(t)]=e;n.add.push(e)}));e.visit(e.MOD,(t=>{n.mod.push(s(t,a[yn(t)]))}));return n}});function Ca(t,e,n,i){for(let r=0,s=n.length;r{const e=Ji(t,l);for(let n=0;n{const e=yn(t);n.rem.push(i[e]);i[e]=null}));e.visit(e.ADD,(t=>{const e=xn(t);i[yn(t)]=e;n.add.push(e)}));e.visit(e.MOD,(t=>{const e=i[yn(t)];for(const i in t){e[i]=t[i];n.modifies(i)}n.mod.push(e)}))}return n}});function $a(t){zi.call(this,[],t);this.count=0}$a.Definition={type:"Sample",metadata:{},params:[{name:"size",type:"number",default:1e3}]};(0,p.B)($a,zi,{transform(t,e){const n=e.fork(e.NO_SOURCE),i=t.modified("size"),r=t.size,s=this.value.reduce(((t,e)=>(t[yn(e)]=1,t)),{});let a=this.value,o=this.count,u=0;function l(t){let e,i;if(a.length=u){e=a[i];if(s[yn(e)])n.rem.push(e);a[i]=t}}++o}if(e.rem.length){e.visit(e.REM,(t=>{const e=yn(t);if(s[e]){s[e]=-1;n.rem.push(t)}--o}));a=a.filter((t=>s[yn(t)]!==-1))}if((e.rem.length||i)&&a.length{if(!s[yn(t)])l(t)}));u=-1}if(i&&a.length>r){const t=a.length-r;for(let e=0;e{if(s[yn(t)])n.mod.push(t)}))}if(e.add.length){e.visit(e.ADD,l)}if(e.add.length||u<0){n.add=a.filter((t=>!s[yn(t)]))}this.count=o;this.value=n.source=a;return n}});function Ra(t){zi.call(this,null,t)}Ra.Definition={type:"Sequence",metadata:{generates:true,changes:true},params:[{name:"start",type:"number",required:true},{name:"stop",type:"number",required:true},{name:"step",type:"number",default:1},{name:"as",type:"string",default:"data"}]};(0,p.B)(Ra,zi,{transform(t,e){if(this.value&&!t.modified())return;const n=e.materialize().fork(e.MOD),i=t.as||"data";n.rem=this.value?e.rem.concat(this.value):e.rem;this.value=(0,es.A)(t.start,t.stop,t.step||1).map((t=>{const e={};e[i]=t;return bn(e)}));n.add=e.add.concat(this.value);return n}});function Oa(t){zi.call(this,null,t);this.modified(true)}(0,p.B)(Oa,zi,{transform(t,e){this.value=e.source;return e.changed()?e.fork(e.NO_SOURCE|e.NO_FIELDS):e.StopPropagation}});function Ta(t){zi.call(this,null,t)}const Na=["unit0","unit1"];Ta.Definition={type:"TimeUnit",metadata:{modifies:true},params:[{name:"field",type:"field",required:true},{name:"interval",type:"boolean",default:true},{name:"units",type:"enum",values:ct,array:true},{name:"step",type:"number",default:1},{name:"maxbins",type:"number",default:40},{name:"extent",type:"date",array:true},{name:"timezone",type:"enum",default:"local",values:["local","utc"]},{name:"as",type:"string",array:true,length:2,default:Na}]};(0,p.B)(Ta,zi,{transform(t,e){const n=t.field,i=t.interval!==false,r=t.timezone==="utc",s=this._floor(t,e),a=(r?It:qt)(s.unit).offset,o=t.as||Na,u=o[0],l=o[1],c=s.step;let f=s.start||Infinity,d=s.stop||-Infinity,h=e.ADD;if(t.modified()||e.changed(e.REM)||e.modified((0,p.nS)(n))){e=e.reflow(true);h=e.SOURCE;f=Infinity;d=-Infinity}e.visit(h,(t=>{const e=n(t);let r,o;if(e==null){t[u]=null;if(i)t[l]=null}else{t[u]=r=o=s(e);if(i)t[l]=o=a(r,c);if(rd)d=o}}));s.start=f;s.stop=d;return e.modifies(i?o:u)},_floor(t,e){const n=t.timezone==="utc";const{units:i,step:r}=t.units?{units:t.units,step:t.step||1}:ce({extent:t.extent||(0,p.Xx)(e.materialize(e.SOURCE).source,t.field),maxbins:t.maxbins});const s=dt(i),a=this.value||{},o=(n?Nt:Rt)(s,r);o.unit=(0,p.se)(s);o.units=s;o.step=r;o.start=a.start;o.stop=a.stop;return this.value=o}});function La(t){zi.call(this,(0,p.nG)(),t)}(0,p.B)(La,zi,{transform(t,e){const n=e.dataflow,i=t.field,r=this.value,s=t=>r.set(i(t),t);let a=true;if(t.modified("field")||e.modified(i.fields)){r.clear();e.visit(e.SOURCE,s)}else if(e.changed()){e.visit(e.REM,(t=>r.delete(i(t))));e.visit(e.ADD,s)}else{a=false}this.modified(a);if(r.empty>n.cleanThreshold)n.runAfter(r.clean);return e.fork()}});function Pa(t){zi.call(this,null,t)}(0,p.B)(Pa,zi,{transform(t,e){const n=!this.value||t.modified("field")||t.modified("sort")||e.changed()||t.sort&&e.modified(t.sort.fields);if(n){this.value=(t.sort?e.source.slice().sort(An(t.sort)):e.source).map(t.field)}}});function qa(t,e,n,i){const r=Ia[t](e,n);return{init:r.init||p.v_,update:function(t,e){e[i]=r.next(t)}}}const Ia={row_number:function(){return{next:t=>t.index+1}},rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?t=n+1:t}}},dense_rank:function(){let t;return{init:()=>t=1,next:e=>{const n=e.index,i=e.data;return n&&e.compare(i[n-1],i[n])?++t:t}}},percent_rank:function(){const t=Ia.rank(),e=t.next;return{init:t.init,next:t=>(e(t)-1)/(t.data.length-1)}},cume_dist:function(){let t;return{init:()=>t=0,next:e=>{const n=e.data,i=e.compare;let r=e.index;if(t0))(0,p.z3)("ntile num must be greater than zero.");const n=Ia.cume_dist(),i=n.next;return{init:n.init,next:t=>Math.ceil(e*i(t))}},lag:function(t,e){e=+e||1;return{next:n=>{const i=n.index-e;return i>=0?t(n.data[i]):null}}},lead:function(t,e){e=+e||1;return{next:n=>{const i=n.index+e,r=n.data;return it(e.data[e.i0])}},last_value:function(t){return{next:e=>t(e.data[e.i1-1])}},nth_value:function(t,e){e=+e;if(!(e>0))(0,p.z3)("nth_value nth must be greater than zero.");return{next:n=>{const i=n.i0+(e-1);return ie=null,next:n=>{const i=t(n.data[n.index]);return i!=null?e=i:e}}},next_value:function(t){let e,n;return{init:()=>(e=null,n=-1),next:i=>{const r=i.data;return i.index<=n?e:(n=Ua(t,r,i.index))<0?(n=r.length,e=null):e=t(r[n])}}}};function Ua(t,e,n){for(let i=e.length;nu[t]=1))}h(t.sort);e.forEach(((t,e)=>{const u=n[e],m=i[e],g=r[e]||null,y=(0,p.N6)(u),v=rs(t,y,s[e]);h(u);a.push(v);if((0,p.mQ)(Ia,t)){o.push(qa(t,u,m,v))}else{if(u==null&&t!=="count"){(0,p.z3)("Null aggregate field specified.")}if(t==="count"){c.push(v);return}d=false;let e=l[y];if(!e){e=l[y]=[];e.field=u;f.push(e)}e.push(cs(t,g,v))}}));if(c.length||f.length){this.cell=Wa(f,c,d)}this.inputs=Object.keys(u)}const Ya=Ga.prototype;Ya.init=function(){this.windows.forEach((t=>t.init()));if(this.cell)this.cell.init()};Ya.update=function(t,e){const n=this.cell,i=this.windows,r=t.data,s=i&&i.length;let a;if(n){for(a=t.p0;ays(t,t.field)));const i={num:0,agg:null,store:false,count:e};if(!n){var r=t.length,s=i.agg=Array(r),a=0;for(;athis.group(r(t));let a=this.state;if(!a||n){a=this.state=new Ga(t)}if(n||e.modified(a.inputs)){this.value={};e.visit(e.SOURCE,(t=>s(t).add(t)))}else{e.visit(e.REM,(t=>s(t).remove(t)));e.visit(e.ADD,(t=>s(t).add(t)))}for(let o=0,u=this._mlen;o0&&!r(s[n],s[n-1]))t.i0=e.left(s,s[n]);if(i=f;--d){o.point(y[d],v[d])}o.lineEnd();o.areaEnd()}}if(m){y[c]=+t(p,c,l),v[c]=+e(p,c,l);o.point(i?+i(p,c,l):y[c],n?+n(p,c,l):v[c])}}if(g)return o=null,g+""||null}function c(){return(0,go.A)().defined(r).curve(a).context(s)}l.x=function(e){return arguments.length?(t=typeof e==="function"?e:(0,mo.A)(+e),i=null,l):t};l.x0=function(e){return arguments.length?(t=typeof e==="function"?e:(0,mo.A)(+e),l):t};l.x1=function(t){return arguments.length?(i=t==null?null:typeof t==="function"?t:(0,mo.A)(+t),l):i};l.y=function(t){return arguments.length?(e=typeof t==="function"?t:(0,mo.A)(+t),n=null,l):e};l.y0=function(t){return arguments.length?(e=typeof t==="function"?t:(0,mo.A)(+t),l):e};l.y1=function(t){return arguments.length?(n=t==null?null:typeof t==="function"?t:(0,mo.A)(+t),l):n};l.lineX0=l.lineY0=function(){return c().x(t).y(e)};l.lineY1=function(){return c().x(t).y(n)};l.lineX1=function(){return c().x(i).y(e)};l.defined=function(t){return arguments.length?(r=typeof t==="function"?t:(0,mo.A)(!!t),l):r};l.curve=function(t){return arguments.length?(a=t,s!=null&&(o=a(s)),l):a};l.context=function(t){return arguments.length?(t==null?s=o=null:o=a(s=t),l):s};return l}var xo=n(98247);const _o=(0,xo.RZ)(3);const wo={draw(t,e){const n=(0,xo.RZ)(e+(0,xo.jk)(e/28,.75))*.59436;const i=n/2;const r=i*_o;t.moveTo(0,n);t.lineTo(0,-n);t.moveTo(-r,-i);t.lineTo(r,i);t.moveTo(-r,i);t.lineTo(r,-i)}};const Ao={draw(t,e){const n=(0,xo.RZ)(e/xo.pi);t.moveTo(n,0);t.arc(0,0,n,0,xo.FA)}};const ko={draw(t,e){const n=(0,xo.RZ)(e/5)/2;t.moveTo(-3*n,-n);t.lineTo(-n,-n);t.lineTo(-n,-3*n);t.lineTo(n,-3*n);t.lineTo(n,-n);t.lineTo(3*n,-n);t.lineTo(3*n,n);t.lineTo(n,n);t.lineTo(n,3*n);t.lineTo(-n,3*n);t.lineTo(-n,n);t.lineTo(-3*n,n);t.closePath()}};const Eo=(0,xo.RZ)(1/3);const Mo=Eo*2;const Do={draw(t,e){const n=(0,xo.RZ)(e/Mo);const i=n*Eo;t.moveTo(0,-n);t.lineTo(i,0);t.lineTo(0,n);t.lineTo(-i,0);t.closePath()}};const Co={draw(t,e){const n=(0,xo.RZ)(e)*.62625;t.moveTo(0,-n);t.lineTo(n,0);t.lineTo(0,n);t.lineTo(-n,0);t.closePath()}};const Fo={draw(t,e){const n=(0,xo.RZ)(e-(0,xo.jk)(e/7,2))*.87559;t.moveTo(-n,0);t.lineTo(n,0);t.moveTo(0,n);t.lineTo(0,-n)}};const So={draw(t,e){const n=(0,xo.RZ)(e);const i=-n/2;t.rect(i,i,n,n)}};const Bo={draw(t,e){const n=(0,xo.RZ)(e)*.4431;t.moveTo(n,n);t.lineTo(n,-n);t.lineTo(-n,-n);t.lineTo(-n,n);t.closePath()}};const zo=.8908130915292852;const $o=(0,xo.F8)(xo.pi/10)/(0,xo.F8)(7*xo.pi/10);const Ro=(0,xo.F8)(xo.FA/10)*$o;const Oo=-(0,xo.gn)(xo.FA/10)*$o;const To={draw(t,e){const n=(0,xo.RZ)(e*zo);const i=Ro*n;const r=Oo*n;t.moveTo(0,-n);t.lineTo(i,r);for(let s=1;s<5;++s){const e=xo.FA*s/5;const a=(0,xo.gn)(e);const o=(0,xo.F8)(e);t.lineTo(o*n,-a*n);t.lineTo(a*i-o*r,o*i+a*r)}t.closePath()}};const No=(0,xo.RZ)(3);const Lo={draw(t,e){const n=-(0,xo.RZ)(e/(No*3));t.moveTo(0,n*2);t.lineTo(-No*n,-n);t.lineTo(No*n,-n);t.closePath()}};const Po=(0,xo.RZ)(3);const qo={draw(t,e){const n=(0,xo.RZ)(e)*.6824;const i=n/2;const r=n*Po/2;t.moveTo(0,-n);t.lineTo(r,i);t.lineTo(-r,i);t.closePath()}};const Io=-.5;const Uo=(0,xo.RZ)(3)/2;const jo=1/(0,xo.RZ)(12);const Go=(jo/2+1)*3;const Yo={draw(t,e){const n=(0,xo.RZ)(e/Go);const i=n/2,r=n*jo;const s=i,a=n*jo+n;const o=-s,u=a;t.moveTo(i,r);t.lineTo(s,a);t.lineTo(o,u);t.lineTo(Io*i-Uo*r,Uo*i+Io*r);t.lineTo(Io*s-Uo*a,Uo*s+Io*a);t.lineTo(Io*o-Uo*u,Uo*o+Io*u);t.lineTo(Io*i+Uo*r,Io*r-Uo*i);t.lineTo(Io*s+Uo*a,Io*a-Uo*s);t.lineTo(Io*o+Uo*u,Io*u-Uo*o);t.closePath()}};const Wo={draw(t,e){const n=(0,xo.RZ)(e-(0,xo.jk)(e/6,1.7))*.6189;t.moveTo(-n,-n);t.lineTo(n,n);t.moveTo(-n,n);t.lineTo(n,-n)}};const Xo=[Ao,ko,Do,So,To,Lo,Yo];const Ho=[Ao,Fo,Wo,qo,wo,Bo,Co];function Vo(t,e){let n=null,i=(0,yo.i)(r);t=typeof t==="function"?t:(0,mo.A)(t||Ao);e=typeof e==="function"?e:(0,mo.A)(e===undefined?64:+e);function r(){let r;if(!n)n=r=i();t.apply(this,arguments).draw(n,+e.apply(this,arguments));if(r)return n=null,r+""||null}r.type=function(e){return arguments.length?(t=typeof e==="function"?e:(0,mo.A)(e),r):t};r.size=function(t){return arguments.length?(e=typeof t==="function"?t:(0,mo.A)(+t),r):e};r.context=function(t){return arguments.length?(n=t==null?null:t,r):n};return r}var Qo=n(69450);function Ko(t,e){if(typeof document!=="undefined"&&document.createElement){const n=document.createElement("canvas");if(n&&n.getContext){n.width=t;n.height=e;return n}}return null}const Zo=()=>typeof Image!=="undefined"?Image:null;var Jo=n(71363);var tu=n(20481);var eu=n(60117);function nu(t){var e;function n(t){return t==null||isNaN(t=+t)?e:t}n.invert=n;n.domain=n.range=function(e){return arguments.length?(t=Array.from(e,eu.A),n):t.slice()};n.unknown=function(t){return arguments.length?(e=t,n):e};n.copy=function(){return nu(t).unknown(e)};t=arguments.length?Array.from(t,eu.A):[0,1];return(0,tu.C)(n)}var iu=n(60125);var ru=n(52178);var su=n(25758);function au(t){return Math.log(t)}function ou(t){return Math.exp(t)}function uu(t){return-Math.log(-t)}function lu(t){return-Math.exp(-t)}function cu(t){return isFinite(t)?+("1e"+t):t<0?0:t}function fu(t){return t===10?cu:t===Math.E?Math.exp:e=>Math.pow(t,e)}function du(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function hu(t){return(e,n)=>-t(-e,n)}function pu(t){const e=t(au,ou);const n=e.domain;let i=10;let r;let s;function a(){r=du(i),s=fu(i);if(n()[0]<0){r=hu(r),s=hu(s);t(uu,lu)}else{t(au,ou)}return e}e.base=function(t){return arguments.length?(i=+t,a()):i};e.domain=function(t){return arguments.length?(n(t),a()):n()};e.ticks=t=>{const e=n();let a=e[0];let o=e[e.length-1];const u=o0)for(;l<=c;++l){for(f=1;fo)break;p.push(d)}}else for(;l<=c;++l){for(f=i-1;f>=1;--f){d=l>0?f/s(-l):f*s(l);if(do)break;p.push(d)}}if(p.length*2{if(t==null)t=10;if(n==null)n=i===10?"s":",";if(typeof n!=="function"){if(!(i%1)&&(n=(0,L.A)(n)).precision==null)n.trim=true;n=(0,U.GP)(n)}if(t===Infinity)return n;const a=Math.max(1,i*t/e.ticks().length);return t=>{let e=t/s(Math.round(r(t)));if(e*in((0,iu.A)(n(),{floor:t=>s(Math.floor(r(t))),ceil:t=>s(Math.ceil(r(t)))}));return e}function mu(){const t=pu((0,ru.Gu)()).domain([1,10]);t.copy=()=>(0,ru.C)(t,mu()).base(t.base());su.C.apply(t,arguments);return t}function gu(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function yu(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function vu(t){return t<0?-t*t:t*t}function bu(t){var e=t(ru.D_,ru.D_),n=1;function i(){return n===1?t(ru.D_,ru.D_):n===.5?t(yu,vu):t(gu(n),gu(1/n))}e.exponent=function(t){return arguments.length?(n=+t,i()):n};return(0,tu.C)(e)}function xu(){var t=bu((0,ru.Gu)());t.copy=function(){return(0,ru.C)(t,xu()).exponent(t.exponent())};su.C.apply(t,arguments);return t}function _u(){return xu.apply(null,arguments).exponent(.5)}function wu(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function Au(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function ku(t){var e=1,n=t(wu(e),Au(e));n.constant=function(n){return arguments.length?t(wu(e=+n),Au(e)):e};return(0,tu.C)(n)}function Eu(){var t=ku((0,ru.Gu)());t.copy=function(){return(0,ru.C)(t,Eu()).constant(t.constant())};return su.C.apply(t,arguments)}var Mu=n(74725);var Du=n(20421);function Cu(){return su.C.apply((0,Mu.B)(Du.$Z,Du.lk,W.Mb,X.R6,Y.Hl,G.dA,H.pz,V.vD,Q.R,fe.aL).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}var Fu=n(21406);var Su=n(15307);function Bu(){var t=0,e=1,n,i,r,s,a=ru.D_,o=false,u;function l(t){return t==null||isNaN(t=+t)?u:a(r===0?.5:(t=(s(t)-n)*r,o?Math.max(0,Math.min(1,t)):t))}l.domain=function(a){return arguments.length?([t,e]=a,n=s(t=+t),i=s(e=+e),r=n===i?0:1/(i-n),l):[t,e]};l.clamp=function(t){return arguments.length?(o=!!t,l):o};l.interpolator=function(t){return arguments.length?(a=t,l):a};function c(t){return function(e){var n,i;return arguments.length?([n,i]=e,a=t(n,i),l):[a(0),a(1)]}}l.range=c(Fu.A);l.rangeRound=c(Su.A);l.unknown=function(t){return arguments.length?(u=t,l):u};return function(a){s=a,n=a(t),i=a(e),r=n===i?0:1/(i-n);return l}}function zu(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function $u(){var t=(0,tu.C)(Bu()(ru.D_));t.copy=function(){return zu(t,$u())};return su.K.apply(t,arguments)}function Ru(){var t=pu(Bu()).domain([1,10]);t.copy=function(){return zu(t,Ru()).base(t.base())};return su.K.apply(t,arguments)}function Ou(){var t=ku(Bu());t.copy=function(){return zu(t,Ou()).constant(t.constant())};return su.K.apply(t,arguments)}function Tu(){var t=bu(Bu());t.copy=function(){return zu(t,Tu()).exponent(t.exponent())};return su.K.apply(t,arguments)}function Nu(){return Tu.apply(null,arguments).exponent(.5)}var Lu=n(99793);function Pu(){var t=0,e=.5,n=1,i=1,r,s,a,o,u,l=ru.D_,c,f=false,d;function h(t){return isNaN(t=+t)?d:(t=.5+((t=+c(t))-s)*(i*t0?n[r-1]:t[0],r=n?[i[n-1],e]:[i[a-1],i[a]]};a.unknown=function(t){return arguments.length?(s=t,a):a};a.thresholds=function(){return i.slice()};a.copy=function(){return Wu().domain([t,e]).range(r).unknown(s)};return su.C.apply((0,tu.C)(a),arguments)}function Xu(){var t=[.5],e=[0,1],n,i=1;function r(r){return r!=null&&r<=r?e[(0,Jo.Ay)(t,r,0,i)]:n}r.domain=function(n){return arguments.length?(t=Array.from(n),i=Math.min(t.length,e.length-1),r):t.slice()};r.range=function(n){return arguments.length?(e=Array.from(n),i=Math.min(t.length,e.length-1),r):e.slice()};r.invertExtent=function(n){var i=e.indexOf(n);return[t[i-1],t[i]]};r.unknown=function(t){return arguments.length?(n=t,r):n};r.copy=function(){return Xu().domain(t).range(e).unknown(n)};return su.C.apply(r,arguments)}var Hu=n(16527);var Vu=n(26698);var Qu=n(67360);var Ku=n(58177);const Zu=(0,Ku.A)("7fc97fbeaed4fdc086ffff99386cb0f0027fbf5b17666666");const Ju=(0,Ku.A)("1f77b4ff7f0e2ca02cd627289467bd8c564be377c27f7f7fbcbd2217becf");const tl=(0,Ku.A)("1b9e77d95f027570b3e7298a66a61ee6ab02a6761d666666");const el=(0,Ku.A)("4269d0efb118ff725c6cc5b03ca951ff8ab7a463f297bbf59c6b4e9498a0");const nl=(0,Ku.A)("a6cee31f78b4b2df8a33a02cfb9a99e31a1cfdbf6fff7f00cab2d66a3d9affff99b15928");const il=(0,Ku.A)("fbb4aeb3cde3ccebc5decbe4fed9a6ffffcce5d8bdfddaecf2f2f2");const rl=(0,Ku.A)("b3e2cdfdcdaccbd5e8f4cae4e6f5c9fff2aef1e2cccccccc");const sl=(0,Ku.A)("e41a1c377eb84daf4a984ea3ff7f00ffff33a65628f781bf999999");const al=(0,Ku.A)("66c2a5fc8d628da0cbe78ac3a6d854ffd92fe5c494b3b3b3");const ol=(0,Ku.A)("8dd3c7ffffb3bebadafb807280b1d3fdb462b3de69fccde5d9d9d9bc80bdccebc5ffed6f");function ul(t,e,n){const i=t-e+n*2;return t?i>0?i:1:0}const ll="identity";const cl="linear";const fl="log";const dl="pow";const hl="sqrt";const pl="symlog";const ml="time";const gl="utc";const yl="sequential";const vl="diverging";const bl="quantile";const xl="quantize";const _l="threshold";const wl="ordinal";const Al="point";const kl="band";const El="bin-ordinal";const Ml="continuous";const Dl="discrete";const Cl="discretizing";const Fl="interpolating";const Sl="temporal";function Bl(t){return function(e){let n=e[0],i=e[1],r;if(i=i&&n[u]<=r){if(s<0)s=u;a=u}}if(s<0)return undefined;i=t.invertExtent(n[s]);r=t.invertExtent(n[a]);return[i[0]===undefined?i[1]:i[0],r[1]===undefined?r[0]:r[1]]}}function $l(){const t=(0,Hu.A)().unknown(undefined),e=t.domain,n=t.range;let i=[0,1],r,s,a=false,o=0,u=0,l=.5;delete t.unknown;function c(){const t=e().length,c=i[1]h+r*t));return n(c?p.reverse():p)}t.domain=function(t){if(arguments.length){e(t);return c()}else{return e()}};t.range=function(t){if(arguments.length){i=[+t[0],+t[1]];return c()}else{return i.slice()}};t.rangeRound=function(t){i=[+t[0],+t[1]];a=true;return c()};t.bandwidth=function(){return s};t.step=function(){return r};t.round=function(t){if(arguments.length){a=!!t;return c()}else{return a}};t.padding=function(t){if(arguments.length){u=Math.max(0,Math.min(1,t));o=u;return c()}else{return o}};t.paddingInner=function(t){if(arguments.length){o=Math.max(0,Math.min(1,t));return c()}else{return o}};t.paddingOuter=function(t){if(arguments.length){u=Math.max(0,Math.min(1,t));return c()}else{return u}};t.align=function(t){if(arguments.length){l=Math.max(0,Math.min(1,t));return c()}else{return l}};t.invertRange=function(t){if(t[0]==null||t[1]==null)return;const r=i[1]i[1-r])return;c=Math.max(0,(0,Jo.Jj)(a,u)-1);f=u===l?c:(0,Jo.Jj)(a,l)-1;if(u-a[c]>s+1e-10)++c;if(r){d=c;c=o-f;f=o-d}return c>f?undefined:e().slice(c,f+1)};t.invert=function(e){const n=t.invertRange([e,e]);return n?n[0]:n};t.copy=function(){return $l().domain(e()).range(i).round(a).paddingInner(o).paddingOuter(u).align(l)};return c()}function Rl(t){const e=t.copy;t.padding=t.paddingOuter;delete t.paddingInner;t.copy=function(){return Rl(e())};return t}function Ol(){return Rl($l().paddingInner(1))}var Tl=Array.prototype.map;function Nl(t){return Tl.call(t,p.Ro)}const Ll=Array.prototype.slice;function Pl(){let t=[],e=[];function n(n){return n==null||n!==n?undefined:e[((0,Jo.Ay)(t,n)-1)%e.length]}n.domain=function(e){if(arguments.length){t=Nl(e);return n}else{return t.slice()}};n.range=function(t){if(arguments.length){e=Ll.call(t);return n}else{return e.slice()}};n.tickFormat=function(e,n){return(0,Vu.A)(t[0],(0,p.se)(t),e==null?10:e,n)};n.copy=function(){return Pl().domain(n.domain()).range(n.range())};return n}const ql=new Map;const Il=Symbol("vega_scale");function Ul(t){t[Il]=true;return t}function jl(t){return t&&t[Il]===true}function Gl(t,e,n){const i=function n(){const i=e();if(!i.invertRange){i.invertRange=i.invert?Bl(i):i.invertExtent?zl(i):undefined}i.type=t;return Ul(i)};i.metadata=(0,p.M1)((0,p.YO)(n));return i}function Yl(t,e,n){if(arguments.length>1){ql.set(t,Gl(t,e,n));return this}else{return Wl(t)?ql.get(t):undefined}}Yl(ll,nu);Yl(cl,tu.A,Ml);Yl(fl,mu,[Ml,fl]);Yl(dl,xu,Ml);Yl(hl,_u,Ml);Yl(pl,Eu,Ml);Yl(ml,Mu.A,[Ml,Sl]);Yl(gl,Cu,[Ml,Sl]);Yl(yl,$u,[Ml,Fl]);Yl(`${yl}-${cl}`,$u,[Ml,Fl]);Yl(`${yl}-${fl}`,Ru,[Ml,Fl,fl]);Yl(`${yl}-${dl}`,Tu,[Ml,Fl]);Yl(`${yl}-${hl}`,Nu,[Ml,Fl]);Yl(`${yl}-${pl}`,Ou,[Ml,Fl]);Yl(`${vl}-${cl}`,qu,[Ml,Fl]);Yl(`${vl}-${fl}`,Iu,[Ml,Fl,fl]);Yl(`${vl}-${dl}`,ju,[Ml,Fl]);Yl(`${vl}-${hl}`,Gu,[Ml,Fl]);Yl(`${vl}-${pl}`,Uu,[Ml,Fl]);Yl(bl,Yu,[Cl,bl]);Yl(xl,Wu,Cl);Yl(_l,Xu,Cl);Yl(El,Pl,[Dl,Cl]);Yl(wl,Hu.A,Dl);Yl(kl,$l,Dl);Yl(Al,Ol,Dl);function Wl(t){return ql.has(t)}function Xl(t,e){const n=ql.get(t);return n&&n.metadata[e]}function Hl(t){return Xl(t,Ml)}function Vl(t){return Xl(t,Dl)}function Ql(t){return Xl(t,Cl)}function Kl(t){return Xl(t,fl)}function Zl(t){return Xl(t,Sl)}function Jl(t){return Xl(t,Fl)}function tc(t){return Xl(t,bl)}const ec=["clamp","base","constant","exponent"];function nc(t,e){const n=e[0],i=(0,p.se)(e)-n;return function(e){return t(n+e*i)}}function ic(t,e,n){return Lu.A(oc(e||"rgb",n),t)}function rc(t,e){const n=new Array(e),i=e+1;for(let r=0;rt[e]?a[e](t[e]()):0));return a}}function oc(t,e){const n=Qu[uc(t)];return e!=null&&n&&n.gamma?n.gamma(e):n}function uc(t){return"interpolate"+t.toLowerCase().split("-").map((t=>t[0].toUpperCase()+t.slice(1))).join("")}const lc={blues:"cfe1f2bed8eca8cee58fc1de74b2d75ba3cf4592c63181bd206fb2125ca40a4a90",greens:"d3eecdc0e6baabdda594d3917bc77d60ba6c46ab5e329a512089430e7735036429",greys:"e2e2e2d4d4d4c4c4c4b1b1b19d9d9d8888887575756262624d4d4d3535351e1e1e",oranges:"fdd8b3fdc998fdb87bfda55efc9244f87f2cf06b18e4580bd14904b93d029f3303",purples:"e2e1efd4d4e8c4c5e0b4b3d6a3a0cc928ec3827cb97566ae684ea25c3696501f8c",reds:"fdc9b4fcb49afc9e80fc8767fa7051f6573fec3f2fdc2a25c81b1db21218970b13",blueGreen:"d5efedc1e8e0a7ddd18bd2be70c6a958ba9144ad77319c5d2089460e7736036429",bluePurple:"ccddecbad0e4a8c2dd9ab0d4919cc98d85be8b6db28a55a6873c99822287730f71",greenBlue:"d3eecec5e8c3b1e1bb9bd8bb82cec269c2ca51b2cd3c9fc7288abd1675b10b60a1",orangeRed:"fddcaffdcf9bfdc18afdad77fb9562f67d53ee6545e24932d32d1ebf130da70403",purpleBlue:"dbdaebc8cee4b1c3de97b7d87bacd15b9fc93a90c01e7fb70b70ab056199045281",purpleBlueGreen:"dbd8eac8cee4b0c3de93b7d872acd1549fc83892bb1c88a3097f8702736b016353",purpleRed:"dcc9e2d3b3d7ce9eccd186c0da6bb2e14da0e23189d91e6fc61159ab07498f023a",redPurple:"fccfccfcbec0faa9b8f98faff571a5ec539ddb3695c41b8aa908808d0179700174",yellowGreen:"e4f4acd1eca0b9e2949ed68880c97c62bb6e47aa5e3297502083440e723b036034",yellowOrangeBrown:"feeaa1fedd84fecc63feb746fca031f68921eb7215db5e0bc54c05ab3d038f3204",yellowOrangeRed:"fee087fed16ffebd59fea849fd903efc7335f9522bee3423de1b20ca0b22af0225",blueOrange:"134b852f78b35da2cb9dcae1d2e5eff2f0ebfce0bafbbf74e8932fc5690d994a07",brownBlueGreen:"704108a0651ac79548e3c78af3e6c6eef1eac9e9e48ed1c74da79e187a72025147",purpleGreen:"5b1667834792a67fb6c9aed3e6d6e8eff0efd9efd5aedda971bb75368e490e5e29",purpleOrange:"4114696647968f83b7b9b4d6dadbebf3eeeafce0bafbbf74e8932fc5690d994a07",redBlue:"8c0d25bf363adf745ef4ae91fbdbc9f2efeed2e5ef9dcae15da2cb2f78b3134b85",redGrey:"8c0d25bf363adf745ef4ae91fcdccbfaf4f1e2e2e2c0c0c0969696646464343434",yellowGreenBlue:"eff9bddbf1b4bde5b594d5b969c5be45b4c22c9ec02182b82163aa23479c1c3185",redYellowBlue:"a50026d4322cf16e43fcac64fedd90faf8c1dcf1ecabd6e875abd04a74b4313695",redYellowGreen:"a50026d4322cf16e43fcac63fedd8df9f7aed7ee8ea4d86e64bc6122964f006837",pinkYellowGreen:"8e0152c0267edd72adf0b3d6faddedf5f3efe1f2cab6de8780bb474f9125276419",spectral:"9e0142d13c4bf0704afcac63fedd8dfbf8b0e0f3a1a9dda269bda94288b55e4fa2",viridis:"440154470e61481a6c482575472f7d443a834144873d4e8a39568c35608d31688e2d708e2a788e27818e23888e21918d1f988b1fa08822a8842ab07f35b77943bf7154c56866cc5d7ad1518fd744a5db36bcdf27d2e21be9e51afde725",magma:"0000040404130b0924150e3720114b2c11603b0f704a107957157e651a80721f817f24828c29819a2e80a8327db6377ac43c75d1426fde4968e95462f1605df76f5cfa7f5efc8f65fe9f6dfeaf78febf84fece91fddea0fcedaffcfdbf",inferno:"0000040403130c0826170c3b240c4f330a5f420a68500d6c5d126e6b176e781c6d86216b932667a12b62ae305cbb3755c73e4cd24644dd513ae65c30ed6925f3771af8850ffb9506fca50afcb519fac62df6d645f2e661f3f484fcffa4",plasma:"0d088723069033059742039d5002a25d01a66a00a87801a88405a7900da49c179ea72198b12a90ba3488c33d80cb4779d35171da5a69e16462e76e5bed7953f2834cf68f44fa9a3dfca636fdb32ffec029fcce25f9dc24f5ea27f0f921",cividis:"00205100235800265d002961012b65042e670831690d346b11366c16396d1c3c6e213f6e26426e2c456e31476e374a6e3c4d6e42506e47536d4c566d51586e555b6e5a5e6e5e616e62646f66676f6a6a706e6d717270717573727976737c79747f7c75827f758682768985778c8877908b78938e789691789a94789e9778a19b78a59e77a9a177aea575b2a874b6ab73bbaf71c0b26fc5b66dc9b96acebd68d3c065d8c462ddc85fe2cb5ce7cf58ebd355f0d652f3da4ff7de4cfae249fce647",rainbow:"6e40aa883eb1a43db3bf3cafd83fa4ee4395fe4b83ff576eff6659ff7847ff8c38f3a130e2b72fcfcc36bee044aff05b8ff4576ff65b52f6673af27828ea8d1ddfa319d0b81cbecb23abd82f96e03d82e14c6edb5a5dd0664dbf6e40aa",sinebow:"ff4040fc582af47218e78d0bd5a703bfbf00a7d5038de70b72f41858fc2a40ff402afc5818f4720be78d03d5a700bfbf03a7d50b8de71872f42a58fc4040ff582afc7218f48d0be7a703d5bf00bfd503a7e70b8df41872fc2a58ff4040",turbo:"23171b32204a3e2a71453493493eae4b49c54a53d7485ee44569ee4074f53c7ff8378af93295f72e9ff42ba9ef28b3e926bce125c5d925cdcf27d5c629dcbc2de3b232e9a738ee9d3ff39347f68950f9805afc7765fd6e70fe667cfd5e88fc5795fb51a1f84badf545b9f140c5ec3cd0e637dae034e4d931ecd12ef4c92bfac029ffb626ffad24ffa223ff9821ff8d1fff821dff771cfd6c1af76118f05616e84b14df4111d5380fcb2f0dc0260ab61f07ac1805a313029b0f00950c00910b00",browns:"eedbbdecca96e9b97ae4a865dc9856d18954c7784cc0673fb85536ad44339f3632",tealBlues:"bce4d89dd3d181c3cb65b3c245a2b9368fae347da0306a932c5985",teals:"bbdfdfa2d4d58ac9c975bcbb61b0af4da5a43799982b8b8c1e7f7f127273006667",warmGreys:"dcd4d0cec5c1c0b8b4b3aaa7a59c9998908c8b827f7e7673726866665c5a59504e",goldGreen:"f4d166d5ca60b6c35c98bb597cb25760a6564b9c533f8f4f33834a257740146c36",goldOrange:"f4d166f8be5cf8aa4cf5983bf3852aef701be2621fd65322c54923b142239e3a26",goldRed:"f4d166f6be59f9aa51fc964ef6834bee734ae56249db5247cf4244c43141b71d3e",lightGreyRed:"efe9e6e1dad7d5cbc8c8bdb9bbaea9cd967ddc7b43e15f19df4011dc000b",lightGreyTeal:"e4eaead6dcddc8ced2b7c2c7a6b4bc64b0bf22a6c32295c11f85be1876bc",lightMulti:"e0f1f2c4e9d0b0de9fd0e181f6e072f6c053f3993ef77440ef4a3c",lightOrange:"f2e7daf7d5baf9c499fab184fa9c73f68967ef7860e8645bde515bd43d5b",lightTealBlue:"e3e9e0c0dccf9aceca7abfc859afc0389fb9328dad2f7ca0276b95255988",darkBlue:"3232322d46681a5c930074af008cbf05a7ce25c0dd38daed50f3faffffff",darkGold:"3c3c3c584b37725e348c7631ae8b2bcfa424ecc31ef9de30fff184ffffff",darkGreen:"3a3a3a215748006f4d048942489e4276b340a6c63dd2d836ffeb2cffffaa",darkMulti:"3737371f5287197d8c29a86995ce3fffe800ffffff",darkRed:"3434347036339e3c38cc4037e75d1eec8620eeab29f0ce32ffeb2c"};const cc={accent:Zu,category10:Ju,category20:"1f77b4aec7e8ff7f0effbb782ca02c98df8ad62728ff98969467bdc5b0d58c564bc49c94e377c2f7b6d27f7f7fc7c7c7bcbd22dbdb8d17becf9edae5",category20b:"393b795254a36b6ecf9c9ede6379398ca252b5cf6bcedb9c8c6d31bd9e39e7ba52e7cb94843c39ad494ad6616be7969c7b4173a55194ce6dbdde9ed6",category20c:"3182bd6baed69ecae1c6dbefe6550dfd8d3cfdae6bfdd0a231a35474c476a1d99bc7e9c0756bb19e9ac8bcbddcdadaeb636363969696bdbdbdd9d9d9",dark2:tl,observable10:el,paired:nl,pastel1:il,pastel2:rl,set1:sl,set2:al,set3:ol,tableau10:"4c78a8f58518e4575672b7b254a24beeca3bb279a2ff9da69d755dbab0ac",tableau20:"4c78a89ecae9f58518ffbf7954a24b88d27ab79a20f2cf5b43989483bcb6e45756ff9d9879706ebab0acd67195fcbfd2b279a2d6a5c99e765fd8b5a5"};function fc(t){if((0,p.cy)(t))return t;const e=t.length/6|0,n=new Array(e);for(let i=0;iic(fc(t))));function pc(t,e){t=t&&t.toLowerCase();if(arguments.length>1){hc[t]=e;return this}else{return hc[t]}}const mc="symbol";const gc="discrete";const yc="gradient";const vc=t=>(0,p.cy)(t)?t.map((t=>String(t))):String(t);const bc=(t,e)=>t[1]-e[1];const xc=(t,e)=>e[1]-t[1];function _c(t,e,n){let i;if((0,p.Et)(e)){if(t.bins){e=Math.max(e,t.bins.length)}if(n!=null){e=Math.min(e,Math.floor((0,p.Ln)(t.domain())/n||1)+1)}}if((0,p.Gv)(e)){i=e.step;e=e.interval}if((0,p.Kg)(e)){e=t.type===ml?qt(e):t.type==gl?It(e):(0,p.z3)("Only time and utc scales accept interval strings.");if(i)e=e.every(i)}return e}function wc(t,e,n){let i=t.range(),r=i[0],s=(0,p.se)(i),a=bc;if(r>s){i=s;s=r;r=i;a=xc}r=Math.floor(r);s=Math.ceil(s);e=e.map((e=>[e,t(e)])).filter((t=>r<=t[1]&&t[1]<=s)).sort(a).map((t=>t[0]));if(n>0&&e.length>1){const t=[e[0],(0,p.se)(e)];while(e.length>n&&e.length>=3){e=e.filter(((t,e)=>!(e%2)))}if(e.length<3){e=t}}return e}function Ac(t,e){return t.bins?wc(t,t.bins,e):t.ticks?t.ticks(e):t.domain()}function kc(t,e,n,i,r,s){const a=e.type;let o=vc;if(a===ml||r===ml){o=t.timeFormat(i)}else if(a===gl||r===gl){o=t.utcFormat(i)}else if(Kl(a)){const r=t.formatFloat(i);if(s||e.bins){o=r}else{const t=Ec(e,n,false);o=e=>t(e)?r(e):""}}else if(e.tickFormat){const r=e.domain();o=t.formatSpan(r[0],r[r.length-1],n,i)}else if(i){o=t.format(i)}return o}function Ec(t,e,n){const i=Ac(t,e),r=t.base(),s=Math.log(r),a=Math.max(1,r*e/i.length);const o=t=>{let e=t/Math.pow(r,Math.round(Math.log(t)/s));if(e*r1?i[1]-i[0]:i[0],a;for(a=1;aMc[t.type]||t.bins;function $c(t,e,n,i,r,s,a){const o=Dc[e.type]&&s!==ml&&s!==gl?Fc(t,e,r):kc(t,e,n,r,s,a);return i===mc&&zc(e)?Rc(o):i===gc?Tc(o):Nc(o)}const Rc=t=>(e,n,i)=>{const r=Oc(i[n+1],Oc(i.max,+Infinity)),s=Lc(e,t),a=Lc(r,t);return s&&a?s+" – "+a:a?"< "+a:"≥ "+s};const Oc=(t,e)=>t!=null?t:e;const Tc=t=>(e,n)=>n?t(e):null;const Nc=t=>e=>t(e);const Lc=(t,e)=>Number.isFinite(t)?e(t):null;function Pc(t){const e=t.domain(),n=e.length-1;let i=+e[0],r=+(0,p.se)(e),s=r-i;if(t.type===_l){const t=n?s/n:.1;i-=t;r+=t;s=r-i}return t=>(t-i)/s}function qc(t,e,n,i){const r=i||e.type;if((0,p.Kg)(n)&&Zl(r)){n=n.replace(/%a/g,"%A").replace(/%b/g,"%B")}return!n&&r===ml?t.timeFormat("%A, %d %B %Y, %X"):!n&&r===gl?t.utcFormat("%A, %d %B %Y, %X UTC"):$c(t,e,5,null,n,i,true)}function Ic(t,e,n){n=n||{};const i=Math.max(3,n.maxlen||7),r=qc(t,e,n.format,n.formatType);if(Ql(e.type)){const t=Cc(e).slice(1).map(r),n=t.length;return`${n} boundar${n===1?"y":"ies"}: ${t.join(", ")}`}else if(Vl(e.type)){const t=e.domain(),n=t.length,s=n>i?t.slice(0,i-2).map(r).join(", ")+", ending with "+t.slice(-1).map(r):t.map(r).join(", ");return`${n} value${n===1?"":"s"}: ${s}`}else{const t=e.domain();return`values from ${r(t[0])} to ${r((0,p.se)(t))}`}}let Uc=0;function jc(){Uc=0}const Gc="p_";function Yc(t){return t&&t.gradient}function Wc(t,e,n){const i=t.gradient;let r=t.id,s=i==="radial"?Gc:"";if(!r){r=t.id="gradient_"+Uc++;if(i==="radial"){t.x1=Xc(t.x1,.5);t.y1=Xc(t.y1,.5);t.r1=Xc(t.r1,0);t.x2=Xc(t.x2,.5);t.y2=Xc(t.y2,.5);t.r2=Xc(t.r2,.5);s=Gc}else{t.x1=Xc(t.x1,0);t.y1=Xc(t.y1,0);t.x2=Xc(t.x2,1);t.y2=Xc(t.y2,0)}}e[r]=t;return"url("+(n||"")+"#"+s+r+")"}function Xc(t,e){return t!=null?t:e}function Hc(t,e){var n=[],i;return i={gradient:"linear",x1:t?t[0]:0,y1:t?t[1]:0,x2:e?e[0]:1,y2:e?e[1]:0,stops:n,stop:function(t,e){n.push({offset:t,color:e});return i}}}const Vc={basis:{curve:Ka.Ay},"basis-closed":{curve:Za.A},"basis-open":{curve:Ja.A},bundle:{curve:to.A,tension:"beta",value:.85},cardinal:{curve:eo.Ay,tension:"tension",value:0},"cardinal-open":{curve:no.A,tension:"tension",value:0},"cardinal-closed":{curve:io.A,tension:"tension",value:0},"catmull-rom":{curve:ro.A,tension:"alpha",value:.5},"catmull-rom-closed":{curve:so.A,tension:"alpha",value:.5},"catmull-rom-open":{curve:ao.A,tension:"alpha",value:.5},linear:{curve:oo.A},"linear-closed":{curve:uo.A},monotone:{horizontal:lo.N,vertical:lo.G},natural:{curve:co.A},step:{curve:fo.Ay},"step-after":{curve:fo.Ps},"step-before":{curve:fo.Ko}};function Qc(t,e,n){var i=(0,p.mQ)(Vc,t)&&Vc[t],r=null;if(i){r=i.curve||i[e||"vertical"];if(i.tension&&n!=null){r=r[i.tension](n)}}return r}const Kc={m:2,l:2,h:1,v:1,z:0,c:6,s:4,q:4,t:2,a:7};const Zc=/[mlhvzcsqta]([^mlhvzcsqta]+|$)/gi;const Jc=/^[+-]?(([0-9]*\.[0-9]+)|([0-9]+\.)|([0-9]+))([eE][+-]?[0-9]+)?/;const tf=/^((\s+,?\s*)|(,\s*))/;const ef=/^[01]/;function nf(t){const e=[];const n=t.match(Zc)||[];n.forEach((t=>{let n=t[0];const i=n.toLowerCase();const r=Kc[i];const s=rf(i,r,t.slice(1).trim());const a=s.length;if(a1){m=Math.sqrt(m);n*=m;i*=m}const g=d/n;const y=f/n;const v=-f/i;const b=d/i;const x=g*o+y*u;const _=v*o+b*u;const w=g*t+y*e;const A=v*t+b*e;const k=(w-x)*(w-x)+(A-_)*(A-_);let E=1/k-.25;if(E<0)E=0;let M=Math.sqrt(E);if(s==r)M=-M;const D=.5*(x+w)-M*(A-_);const C=.5*(_+A)+M*(w-x);const F=Math.atan2(_-C,x-D);const S=Math.atan2(A-C,w-D);let B=S-F;if(B<0&&s===1){B+=uf}else if(B>0&&s===0){B-=uf}const z=Math.ceil(Math.abs(B/(of+.001)));const $=[];for(let R=0;R+t}function Sf(t,e,n){return Math.max(e,Math.min(t,n))}function Bf(){var t=Ef,e=Mf,n=Df,i=Cf,r=Ff(0),s=r,a=r,o=r,u=null;function l(l,c,f){var d,h=c!=null?c:+t.call(this,l),p=f!=null?f:+e.call(this,l),m=+n.call(this,l),g=+i.call(this,l),y=Math.min(m,g)/2,v=Sf(+r.call(this,l),0,y),b=Sf(+s.call(this,l),0,y),x=Sf(+a.call(this,l),0,y),_=Sf(+o.call(this,l),0,y);if(!u)u=d=(0,Qo.Ae)();if(v<=0&&b<=0&&x<=0&&_<=0){u.rect(h,p,m,g)}else{var w=h+m,A=p+g;u.moveTo(h+v,p);u.lineTo(w-b,p);u.bezierCurveTo(w-kf*b,p,w,p+kf*b,w,p+b);u.lineTo(w,A-_);u.bezierCurveTo(w,A-kf*_,w-kf*_,A,w-_,A);u.lineTo(h+x,A);u.bezierCurveTo(h+kf*x,A,h,A-kf*x,h,A-x);u.lineTo(h,p+v);u.bezierCurveTo(h,p+kf*v,h+kf*v,p,h+v,p);u.closePath()}if(d){u=null;return d+""||null}}l.x=function(e){if(arguments.length){t=Ff(e);return l}else{return t}};l.y=function(t){if(arguments.length){e=Ff(t);return l}else{return e}};l.width=function(t){if(arguments.length){n=Ff(t);return l}else{return n}};l.height=function(t){if(arguments.length){i=Ff(t);return l}else{return i}};l.cornerRadius=function(t,e,n,i){if(arguments.length){r=Ff(t);s=e!=null?Ff(e):r;o=n!=null?Ff(n):r;a=i!=null?Ff(i):s;return l}else{return r}};l.context=function(t){if(arguments.length){u=t==null?null:t;return l}else{return u}};return l}function zf(){var t,e,n,i,r=null,s,a,o,u;function l(t,e,n){const i=n/2;if(s){var l=o-e,c=t-a;if(l||c){var f=Math.hypot(l,c),d=(l/=f)*u,h=(c/=f)*u,p=Math.atan2(c,l);r.moveTo(a-d,o-h);r.lineTo(t-l*i,e-c*i);r.arc(t,e,i,p-Math.PI,p);r.lineTo(a+d,o+h);r.arc(a,o,u,p,p+Math.PI)}else{r.arc(t,e,i,0,uf)}r.closePath()}else{s=1}a=t;o=e;u=i}function c(a){var o,u=a.length,c,f=false,d;if(r==null)r=d=(0,Qo.Ae)();for(o=0;o<=u;++o){if(!(ot.x||0,Of=t=>t.y||0,Tf=t=>t.width||0,Nf=t=>t.height||0,Lf=t=>(t.x||0)+(t.width||0),Pf=t=>(t.y||0)+(t.height||0),qf=t=>t.startAngle||0,If=t=>t.endAngle||0,Uf=t=>t.padAngle||0,jf=t=>t.innerRadius||0,Gf=t=>t.outerRadius||0,Yf=t=>t.cornerRadius||0,Wf=t=>$f(t.cornerRadiusTopLeft,t.cornerRadius)||0,Xf=t=>$f(t.cornerRadiusTopRight,t.cornerRadius)||0,Hf=t=>$f(t.cornerRadiusBottomRight,t.cornerRadius)||0,Vf=t=>$f(t.cornerRadiusBottomLeft,t.cornerRadius)||0,Qf=t=>$f(t.size,64),Kf=t=>t.size||1,Zf=t=>!(t.defined===false),Jf=t=>_f(t.shape||"circle");const td=(0,ho.A)().startAngle(qf).endAngle(If).padAngle(Uf).innerRadius(jf).outerRadius(Gf).cornerRadius(Yf),ed=bo().x(Rf).y1(Of).y0(Pf).defined(Zf),nd=bo().y(Of).x1(Rf).x0(Lf).defined(Zf),id=(0,go.A)().x(Rf).y(Of).defined(Zf),rd=Bf().x(Rf).y(Of).width(Tf).height(Nf).cornerRadius(Wf,Xf,Hf,Vf),sd=Vo().type(Jf).size(Qf),ad=zf().x(Rf).y(Of).defined(Zf).size(Kf);function od(t){return t.cornerRadius||t.cornerRadiusTopLeft||t.cornerRadiusTopRight||t.cornerRadiusBottomRight||t.cornerRadiusBottomLeft}function ud(t,e){return td.context(t)(e)}function ld(t,e){const n=e[0],i=n.interpolate||"linear";return(n.orient==="horizontal"?nd:ed).curve(Qc(i,n.orient,n.tension)).context(t)(e)}function cd(t,e){const n=e[0],i=n.interpolate||"linear";return id.curve(Qc(i,n.orient,n.tension)).context(t)(e)}function fd(t,e,n,i){return rd.context(t)(e,n,i)}function dd(t,e){return(e.mark.shape||e.shape).context(t)(e)}function hd(t,e){return sd.context(t)(e)}function pd(t,e){return ad.context(t)(e)}var md=1;function gd(){md=1}function yd(t,e,n){var i=e.clip,r=t._defs,s=e.clip_id||(e.clip_id="clip"+md++),a=r.clipping[s]||(r.clipping[s]={id:s});if((0,p.Tn)(i)){a.path=i(null)}else if(od(n)){a.path=fd(null,n,0,0)}else{a.width=n.width||0;a.height=n.height||0}return"url(#"+s+")"}function vd(t){this.clear();if(t)this.union(t)}vd.prototype={clone(){return new vd(this)},clear(){this.x1=+Number.MAX_VALUE;this.y1=+Number.MAX_VALUE;this.x2=-Number.MAX_VALUE;this.y2=-Number.MAX_VALUE;return this},empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE},equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2},set(t,e,n,i){if(nthis.x2)this.x2=t;if(e>this.y2)this.y2=e;return this},expand(t){this.x1-=t;this.y1-=t;this.x2+=t;this.y2+=t;return this},round(){this.x1=Math.floor(this.x1);this.y1=Math.floor(this.y1);this.x2=Math.ceil(this.x2);this.y2=Math.ceil(this.y2);return this},scale(t){this.x1*=t;this.y1*=t;this.x2*=t;this.y2*=t;return this},translate(t,e){this.x1+=t;this.x2+=t;this.y1+=e;this.y2+=e;return this},rotate(t,e,n){const i=this.rotatedPoints(t,e,n);return this.clear().add(i[0],i[1]).add(i[2],i[3]).add(i[4],i[5]).add(i[6],i[7])},rotatedPoints(t,e,n){var{x1:i,y1:r,x2:s,y2:a}=this,o=Math.cos(t),u=Math.sin(t),l=e-e*o+n*u,c=n-e*u-n*o;return[o*i-u*r+l,u*i+o*r+c,o*i-u*a+l,u*i+o*a+c,o*s-u*r+l,u*s+o*r+c,o*s-u*a+l,u*s+o*a+c]},union(t){if(t.x1this.x2)this.x2=t.x2;if(t.y2>this.y2)this.y2=t.y2;return this},intersect(t){if(t.x1>this.x1)this.x1=t.x1;if(t.y1>this.y1)this.y1=t.y1;if(t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2},alignsWith(t){return t&&(this.x1==t.x1||this.x2==t.x2||this.y1==t.y1||this.y2==t.y2)},intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)},contains(t,e){return!(tthis.x2||ethis.y2)},width(){return this.x2-this.x1},height(){return this.y2-this.y1}};function bd(t){this.mark=t;this.bounds=this.bounds||new vd}function xd(t){bd.call(this,t);this.items=this.items||[]}(0,p.B)(xd,bd);class _d{constructor(t){this._pending=0;this._loader=t||fn()}pending(){return this._pending}sanitizeURL(t){const e=this;wd(e);return e._loader.sanitize(t,{context:"href"}).then((t=>{Ad(e);return t})).catch((()=>{Ad(e);return null}))}loadImage(t){const e=this,n=Zo();wd(e);return e._loader.sanitize(t,{context:"image"}).then((t=>{const i=t.href;if(!i||!n)throw{url:i};const r=new n;const s=(0,p.mQ)(t,"crossOrigin")?t.crossOrigin:"anonymous";if(s!=null)r.crossOrigin=s;r.onload=()=>Ad(e);r.onerror=()=>Ad(e);r.src=i;return r})).catch((t=>{Ad(e);return{complete:false,width:0,height:0,src:t&&t.url||""}}))}ready(){const t=this;return new Promise((e=>{function n(i){if(!t.pending())e(i);else setTimeout((()=>{n(true)}),10)}n(false)}))}}function wd(t){t._pending+=1}function Ad(t){t._pending-=1}function kd(t,e,n){if(e.stroke&&e.opacity!==0&&e.strokeOpacity!==0){const i=e.strokeWidth!=null?+e.strokeWidth:1;t.expand(i+(n?Ed(e,i):0))}return t}function Ed(t,e){return t.strokeJoin&&t.strokeJoin!=="miter"?0:e}const Md=uf-1e-8;let Dd,Cd,Fd,Sd,Bd,zd,$d,Rd;const Od=(t,e)=>Dd.add(t,e);const Td=(t,e)=>Od(Cd=t,Fd=e);const Nd=t=>Od(t,Dd.y1);const Ld=t=>Od(Dd.x1,t);const Pd=(t,e)=>Bd*t+$d*e;const qd=(t,e)=>zd*t+Rd*e;const Id=(t,e)=>Od(Pd(t,e),qd(t,e));const Ud=(t,e)=>Td(Pd(t,e),qd(t,e));function jd(t,e){Dd=t;if(e){Sd=e*sf;Bd=Rd=Math.cos(Sd);zd=Math.sin(Sd);$d=-zd}else{Bd=Rd=1;Sd=zd=$d=0}return Gd}const Gd={beginPath(){},closePath(){},moveTo:Ud,lineTo:Ud,rect(t,e,n,i){if(Sd){Id(t+n,e);Id(t+n,e+i);Id(t,e+i);Ud(t,e)}else{Od(t+n,e+i);Td(t,e)}},quadraticCurveTo(t,e,n,i){const r=Pd(t,e),s=qd(t,e),a=Pd(n,i),o=qd(n,i);Yd(Cd,r,a,Nd);Yd(Fd,s,o,Ld);Td(a,o)},bezierCurveTo(t,e,n,i,r,s){const a=Pd(t,e),o=qd(t,e),u=Pd(n,i),l=qd(n,i),c=Pd(r,s),f=qd(r,s);Wd(Cd,a,u,c,Nd);Wd(Fd,o,l,f,Ld);Td(c,f)},arc(t,e,n,i,r,s){i+=Sd;r+=Sd;Cd=n*Math.cos(r)+t;Fd=n*Math.sin(r)+e;if(Math.abs(r-i)>Md){Od(t-n,e-n);Od(t+n,e+n)}else{const a=i=>Od(n*Math.cos(i)+t,n*Math.sin(i)+e);let o,u;a(i);a(r);if(r!==i){i=i%uf;if(i<0)i+=uf;r=r%uf;if(r<0)r+=uf;if(rr;++u,o-=of)a(o)}else{o=i-i%of+of;for(u=0;u<4&&oaf){c=a*a+o*s;if(c>=0){c=Math.sqrt(c);u=(-a+c)/s;l=(-a-c)/s}}else{u=.5*o/a}if(0d)return false;else if(m>f)f=m}else if(h>0){if(m0){t.globalAlpha=n;t.fillStyle=sh(t,e,e.fill);return true}else{return false}}var oh=[];function uh(t,e,n){var i=(i=e.strokeWidth)!=null?i:1;if(i<=0)return false;n*=e.strokeOpacity==null?1:e.strokeOpacity;if(n>0){t.globalAlpha=n;t.strokeStyle=sh(t,e,e.stroke);t.lineWidth=i;t.lineCap=e.strokeCap||"butt";t.lineJoin=e.strokeJoin||"miter";t.miterLimit=e.strokeMiterLimit||10;if(t.setLineDash){t.setLineDash(e.strokeDash||oh);t.lineDashOffset=e.strokeDashOffset||0}return true}else{return false}}function lh(t,e){return t.zindex-e.zindex||t.index-e.index}function ch(t){if(!t.zdirty)return t.zitems;var e=t.items,n=[],i,r,s;for(r=0,s=e.length;r=0;){if(i=e(n[r]))return i}if(n===s){for(n=t.items,r=n.length;--r>=0;){if(!n[r].zindex){if(i=e(n[r]))return i}}}return null}function hh(t){return function(e,n,i){fh(n,(n=>{if(!i||i.intersects(n.bounds)){mh(t,e,n,n)}}))}}function ph(t){return function(e,n,i){if(n.items.length&&(!i||i.intersects(n.bounds))){mh(t,e,n.items[0],n.items)}}}function mh(t,e,n,i){var r=n.opacity==null?1:n.opacity;if(r===0)return;if(t(e,i))return;eh(e,n);if(n.fill&&ah(e,n,r)){e.fill()}if(n.stroke&&uh(e,n,r)){e.stroke()}}function gh(t){t=t||p.vN;return function(e,n,i,r,s,a){i*=e.pixelRatio;r*=e.pixelRatio;return dh(n,(n=>{const o=n.bounds;if(o&&!o.contains(s,a)||!o)return;if(t(e,n,i,r,s,a))return n}))}}function yh(t,e){return function(n,i,r,s){var a=Array.isArray(i)?i[0]:i,o=e==null?a.fill:e,u=a.stroke&&n.isPointInStroke,l,c;if(u){l=a.strokeWidth;c=a.strokeCap;n.lineWidth=l!=null?l:1;n.lineCap=c!=null?c:"butt"}return t(n,i)?false:o&&n.isPointInPath(r,s)||u&&n.isPointInStroke(r,s)}}function vh(t){return gh(yh(t))}function bh(t,e){return"translate("+t+","+e+")"}function xh(t){return"rotate("+t+")"}function _h(t,e){return"scale("+t+","+e+")"}function wh(t){return bh(t.x||0,t.y||0)}function Ah(t){return bh(t.x||0,t.y||0)+(t.angle?" "+xh(t.angle):"")}function kh(t){return bh(t.x||0,t.y||0)+(t.angle?" "+xh(t.angle):"")+(t.scaleX||t.scaleY?" "+_h(t.scaleX||1,t.scaleY||1):"")}function Eh(t,e,n){function i(t,n){t("transform",Ah(n));t("d",e(null,n))}function r(t,n){e(jd(t,n.angle),n);return kd(t,n).translate(n.x||0,n.y||0)}function s(t,n){var i=n.x||0,r=n.y||0,s=n.angle||0;t.translate(i,r);if(s)t.rotate(s*=sf);t.beginPath();e(t,n);if(s)t.rotate(-s);t.translate(-i,-r)}return{type:t,tag:"path",nested:false,attr:i,bound:r,draw:hh(s),pick:vh(s),isect:n||Qd(s)}}var Mh=Eh("arc",ud);function Dh(t,e){var n=t[0].orient==="horizontal"?e[1]:e[0],i=t[0].orient==="horizontal"?"y":"x",r=t.length,s=+Infinity,a,o;while(--r>=0){if(t[r].defined===false)continue;o=Math.abs(t[r][i]-n);if(o=0){if(t[i].defined===false)continue;r=t[i].x-e[0];s=t[i].y-e[1];a=r*r+s*s;if(a=0){if(t[n].defined===false)continue;i=t[n].x-e[0];r=t[n].y-e[1];s=i*i+r*r;i=t[n].size||1;if(s.5&&e<1.5?.5-Math.abs(e-1):0}function Oh(t,e){t("transform",wh(e))}function Th(t,e){const n=Rh(e);t("d",fd(null,e,n,n))}function Nh(t,e){t("class","background");t("aria-hidden",true);Th(t,e)}function Lh(t,e){t("class","foreground");t("aria-hidden",true);if(e.strokeForeground){Th(t,e)}else{t("d","")}}function Ph(t,e,n){const i=e.clip?yd(n,e,e):null;t("clip-path",i)}function qh(t,e){if(!e.clip&&e.items){const n=e.items,i=n.length;for(let e=0;e{const r=e.x||0,s=e.y||0,a=e.strokeForeground,o=e.opacity==null?1:e.opacity;if((e.stroke||e.fill)&&o){Ih(t,e,r,s);eh(t,e);if(e.fill&&ah(t,e,o)){t.fill()}if(e.stroke&&!a&&uh(t,e,o)){t.stroke()}}t.save();t.translate(r,s);if(e.clip)$h(t,e);if(n)n.translate(-r,-s);fh(e,(e=>{if(e.marktype==="group"||i==null||i.includes(e.marktype)){this.draw(t,e,n,i)}}));if(n)n.translate(r,s);t.restore();if(a&&e.stroke&&o){Ih(t,e,r,s);eh(t,e);if(uh(t,e,o)){t.stroke()}}}))}function Wh(t,e,n,i,r,s){if(e.bounds&&!e.bounds.contains(r,s)||!e.items){return null}const a=n*t.pixelRatio,o=i*t.pixelRatio;return dh(e,(u=>{let l,c,f;const d=u.bounds;if(d&&!d.contains(r,s))return;c=u.x||0;f=u.y||0;const h=c+(u.width||0),p=f+(u.height||0),m=u.clip;if(m&&(rh||sp))return;t.save();t.translate(c,f);c=r-c;f=s-f;if(m&&od(u)&&!Gh(t,u,a,o)){t.restore();return null}const g=u.strokeForeground,y=e.interactive!==false;if(y&&g&&u.stroke&&jh(t,u,a,o)){t.restore();return u}l=dh(u,(t=>Xh(t,c,f)?this.pick(t,n,i,c,f):null));if(!l&&y&&(u.fill||!g&&u.stroke)&&Uh(t,u,a,o)){l=u}t.restore();return l||null}))}function Xh(t,e,n){return(t.interactive!==false||t.marktype==="group")&&t.bounds&&t.bounds.contains(e,n)}var Hh={type:"group",tag:"g",nested:false,attr:Oh,bound:qh,draw:Yh,pick:Wh,isect:Zd,content:Ph,background:Nh,foreground:Lh};var Vh={xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",version:"1.1"};function Qh(t,e){var n=t.image;if(!n||t.url&&t.url!==n.url){n={complete:false,width:0,height:0};e.loadImage(t.url).then((e=>{t.image=e;t.image.url=t.url}))}return n}function Kh(t,e){return t.width!=null?t.width:!e||!e.width?0:t.aspect!==false&&t.height?t.height*e.width/e.height:e.width}function Zh(t,e){return t.height!=null?t.height:!e||!e.height?0:t.aspect!==false&&t.width?t.width*e.height/e.width:e.height}function Jh(t,e){return t==="center"?e/2:t==="right"?e:0}function tp(t,e){return t==="middle"?e/2:t==="bottom"?e:0}function ep(t,e,n){const i=Qh(e,n),r=Kh(e,i),s=Zh(e,i),a=(e.x||0)-Jh(e.align,r),o=(e.y||0)-tp(e.baseline,s),u=!i.src&&i.toDataURL?i.toDataURL():i.src||"";t("href",u,Vh["xmlns:xlink"],"xlink:href");t("transform",bh(a,o));t("width",r);t("height",s);t("preserveAspectRatio",e.aspect===false?"none":"xMidYMid")}function np(t,e){const n=e.image,i=Kh(e,n),r=Zh(e,n),s=(e.x||0)-Jh(e.align,i),a=(e.y||0)-tp(e.baseline,r);return t.set(s,a,s+i,a+r)}function ip(t,e,n){fh(e,(e=>{if(n&&!n.intersects(e.bounds))return;const i=Qh(e,this);let r=Kh(e,i);let s=Zh(e,i);if(r===0||s===0)return;let a=(e.x||0)-Jh(e.align,r),o=(e.y||0)-tp(e.baseline,s),u,l,c,f;if(e.aspect!==false){l=i.width/i.height;c=e.width/e.height;if(l===l&&c===c&&l!==c){if(c{if(n&&!n.intersects(e.bounds))return;var i=e.opacity==null?1:e.opacity;if(i&&gp(t,e,i)){eh(t,e);t.stroke()}}))}function vp(t,e,n,i){if(!t.isPointInStroke)return false;return gp(t,e,1)&&t.isPointInStroke(n,i)}var bp={type:"rule",tag:"line",nested:false,attr:pp,bound:mp,draw:yp,pick:gh(vp),isect:Jd};var xp=Eh("shape",dd);var _p=Eh("symbol",hd,Kd);const wp=(0,p.EV)();var Ap={height:Fp,measureWidth:Dp,estimateWidth:Ep,width:Ep,canvas:kp};kp(true);function kp(t){Ap.width=t&&Hd?Dp:Ep}function Ep(t,e){return Mp(Rp(t,e),Fp(t))}function Mp(t,e){return~~(.8*t.length*e)}function Dp(t,e){return Fp(t)<=0||!(e=Rp(t,e))?0:Cp(e,Lp(t))}function Cp(t,e){const n=`(${e}) ${t}`;let i=wp.get(n);if(i===undefined){Hd.font=e;i=Hd.measureText(t).width;wp.set(n,i)}return i}function Fp(t){return t.fontSize!=null?+t.fontSize||0:11}function Sp(t){return t.lineHeight!=null?t.lineHeight:Fp(t)+2}function Bp(t){return(0,p.cy)(t)?t.length>1?t:t[0]:t}function zp(t){return Bp(t.lineBreak&&t.text&&!(0,p.cy)(t.text)?t.text.split(t.lineBreak):t.text)}function $p(t){const e=zp(t);return((0,p.cy)(e)?e.length-1:0)*Sp(t)}function Rp(t,e){const n=e==null?"":(e+"").trim();return t.limit>0&&n.length?Tp(t,n):n}function Op(t){if(Ap.width===Dp){const e=Lp(t);return t=>Cp(t,e)}else if(Ap.width===Ep){const e=Fp(t);return t=>Mp(t,e)}else{return e=>Ap.width(t,e)}}function Tp(t,e){var n=+t.limit,i=Op(t);if(i(e)>>1;if(i(e.slice(u))>n)a=u+1;else o=u}return r+e.slice(a)}else{while(a>>1);if(i(e.slice(0,u))Math.max(t,Ap.width(e,n))),0)}else{f=Ap.width(e,c)}if(r==="center"){u-=f/2}else if(r==="right"){u-=f}else;t.set(u+=a,l+=o,u+f,l+i);if(e.angle&&!n){t.rotate(e.angle*sf,a,o)}else if(n===2){return t.rotatedPoints(e.angle*sf,a,o)}return t}function Yp(t,e,n){fh(e,(e=>{var i=e.opacity==null?1:e.opacity,r,s,a,o,u,l,c;if(n&&!n.intersects(e.bounds)||i===0||e.fontSize<=0||e.text==null||e.text.length===0)return;t.font=Lp(e);t.textAlign=e.align||"left";r=Up(e);s=r.x1,a=r.y1;if(e.angle){t.save();t.translate(s,a);t.rotate(e.angle*sf);s=a=0}s+=e.dx||0;a+=(e.dy||0)+Pp(e);l=zp(e);eh(t,e);if((0,p.cy)(l)){u=Sp(e);for(o=0;oe)t.removeChild(n[--i]);return t}function cm(t){return"mark-"+t.marktype+(t.role?" role-"+t.role:"")+(t.name?" "+t.name:"")}function fm(t,e){const n=e.getBoundingClientRect();return[t.clientX-n.left-(e.clientLeft||0),t.clientY-n.top-(e.clientTop||0)]}function dm(t,e,n,i){var r=t&&t.mark,s,a;if(r&&(s=Qp[r.marktype]).tip){a=fm(e,n);a[0]-=i[0];a[1]-=i[1];while(t=t.mark.group){a[0]-=t.x||0;a[1]-=t.y||0}t=s.tip(r.items,a)}return t}class hm{constructor(t,e){this._active=null;this._handlers={};this._loader=t||fn();this._tooltip=e||pm}initialize(t,e,n){this._el=t;this._obj=n||null;return this.origin(e)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}origin(t){if(arguments.length){this._origin=t||[0,0];return this}else{return this._origin.slice()}}scene(t){if(!arguments.length)return this._scene;this._scene=t;return this}on(){}off(){}_handlerIndex(t,e,n){for(let i=t?t.length:0;--i>=0;){if(t[i].type===e&&(!n||t[i].handler===n)){return i}}return-1}handlers(t){const e=this._handlers,n=[];if(t){n.push(...e[this.eventName(t)])}else{for(const t in e){n.push(...e[t])}}return n}eventName(t){const e=t.indexOf(".");return e<0?t:t.slice(0,e)}handleHref(t,e,n){this._loader.sanitize(n,{context:"href"}).then((e=>{const n=new MouseEvent(t.type,t),i=am(null,"a");for(const t in e)i.setAttribute(t,e[t]);i.dispatchEvent(n)})).catch((()=>{}))}handleTooltip(t,e,n){if(e&&e.tooltip!=null){e=dm(e,t,this.canvas(),this._origin);const i=n&&e&&e.tooltip||null;this._tooltip.call(this._obj,this,t,e,i)}}getItemBoundingClientRect(t){const e=this.canvas();if(!e)return;const n=e.getBoundingClientRect(),i=this._origin,r=t.bounds,s=r.width(),a=r.height();let o=r.x1+i[0]+n.left,u=r.y1+i[1]+n.top;while(t.mark&&(t=t.mark.group)){o+=t.x||0;u+=t.y||0}return{x:o,y:u,width:s,height:a,left:o,top:u,right:o+s,bottom:u+a}}}function pm(t,e,n,i){t.element().setAttribute("title",i||"")}class mm{constructor(t){this._el=null;this._bgcolor=null;this._loader=new _d(t)}initialize(t,e,n,i,r){this._el=t;return this.resize(e,n,i,r)}element(){return this._el}canvas(){return this._el&&this._el.firstChild}background(t){if(arguments.length===0)return this._bgcolor;this._bgcolor=t;return this}resize(t,e,n,i){this._width=t;this._height=e;this._origin=n||[0,0];this._scale=i||1;return this}dirty(){}render(t,e){const n=this;n._call=function(){n._render(t,e)};n._call();n._call=null;return n}_render(){}renderAsync(t,e){const n=this.render(t,e);return this._ready?this._ready.then((()=>n)):Promise.resolve(n)}_load(t,e){var n=this,i=n._loader[t](e);if(!n._ready){const t=n._call;n._ready=n._loader.ready().then((e=>{if(e)t();n._ready=null}))}return i}sanitizeURL(t){return this._load("sanitizeURL",t)}loadImage(t){return this._load("loadImage",t)}}const gm="keydown";const ym="keypress";const vm="keyup";const bm="dragenter";const xm="dragleave";const _m="dragover";const wm="pointerdown";const Am="pointerup";const km="pointermove";const Em="pointerout";const Mm="pointerover";const Dm="mousedown";const Cm="mouseup";const Fm="mousemove";const Sm="mouseout";const Bm="mouseover";const zm="click";const $m="dblclick";const Rm="wheel";const Om="mousewheel";const Tm="touchstart";const Nm="touchmove";const Lm="touchend";const Pm=[gm,ym,vm,bm,xm,_m,wm,Am,km,Em,Mm,Dm,Cm,Fm,Sm,Bm,zm,$m,Rm,Om,Tm,Nm,Lm];const qm=km;const Im=Sm;const Um=zm;class jm extends hm{constructor(t,e){super(t,e);this._down=null;this._touch=null;this._first=true;this._events={};this.events=Pm;this.pointermove=Hm([km,Fm],[Mm,Bm],[Em,Sm]);this.dragover=Hm([_m],[bm],[xm]),this.pointerout=Vm([Em,Sm]);this.dragleave=Vm([xm])}initialize(t,e,n){this._canvas=t&&om(t,"canvas");[zm,Dm,wm,km,Em,xm].forEach((t=>Ym(this,t)));return super.initialize(t,e,n)}canvas(){return this._canvas}context(){return this._canvas.getContext("2d")}DOMMouseScroll(t){this.fire(Om,t)}pointerdown(t){this._down=this._active;this.fire(wm,t)}mousedown(t){this._down=this._active;this.fire(Dm,t)}click(t){if(this._down===this._active){this.fire(zm,t);this._down=null}}touchstart(t){this._touch=this.pickEvent(t.changedTouches[0]);if(this._first){this._active=this._touch;this._first=false}this.fire(Tm,t,true)}touchmove(t){this.fire(Nm,t,true)}touchend(t){this.fire(Lm,t,true);this._touch=null}fire(t,e,n){const i=n?this._touch:this._active,r=this._handlers[t];e.vegaType=t;if(t===Um&&i&&i.href){this.handleHref(e,i,i.href)}else if(t===qm||t===Im){this.handleTooltip(e,i,t!==Im)}if(r){for(let t=0,n=r.length;t=0){i.splice(r,1)}return this}pickEvent(t){const e=fm(t,this._canvas),n=this._origin;return this.pick(this._scene,e[0],e[1],e[0]-n[0],e[1]-n[1])}pick(t,e,n,i,r){const s=this.context(),a=Qp[t.marktype];return a.pick.call(this,s,t,e,n,i,r)}}const Gm=t=>t===Tm||t===Nm||t===Lm?[Tm,Nm,Lm]:[t];function Ym(t,e){Gm(e).forEach((e=>Wm(t,e)))}function Wm(t,e){const n=t.canvas();if(n&&!t._events[e]){t._events[e]=1;n.addEventListener(e,t[e]?n=>t[e](n):n=>t.fire(e,n))}}function Xm(t,e,n){e.forEach((e=>t.fire(e,n)))}function Hm(t,e,n){return function(i){const r=this._active,s=this.pickEvent(i);if(s===r){Xm(this,t,i)}else{if(!r||!r.exit){Xm(this,n,i)}this._active=s;Xm(this,e,i);Xm(this,t,i)}}}function Vm(t){return function(e){Xm(this,t,e);this._active=null}}function Qm(){return typeof window!=="undefined"?window.devicePixelRatio||1:1}function Km(t,e,n,i,r,s){const a=typeof HTMLElement!=="undefined"&&t instanceof HTMLElement&&t.parentNode!=null,o=t.getContext("2d"),u=a?Qm():r;t.width=e*u;t.height=n*u;for(const l in s){o[l]=s[l]}if(a&&u!==1){t.style.width=e+"px";t.style.height=n+"px"}o.pixelRatio=u;o.setTransform(u,0,0,u,u*i[0],u*i[1]);return t}class Zm extends mm{constructor(t){super(t);this._options={};this._redraw=false;this._dirty=new vd;this._tempb=new vd}initialize(t,e,n,i,r,s){this._options=s||{};this._canvas=this._options.externalContext?null:Ko(1,1,this._options.type);if(t&&this._canvas){lm(t,0).appendChild(this._canvas);this._canvas.setAttribute("class","marks")}return super.initialize(t,e,n,i,r)}resize(t,e,n,i){super.resize(t,e,n,i);if(this._canvas){Km(this._canvas,this._width,this._height,this._origin,this._scale,this._options.context)}else{const t=this._options.externalContext;if(!t)(0,p.z3)("CanvasRenderer is missing a valid canvas or context");t.scale(this._scale,this._scale);t.translate(this._origin[0],this._origin[1])}this._redraw=true;return this}canvas(){return this._canvas}context(){return this._options.externalContext||(this._canvas?this._canvas.getContext("2d"):null)}dirty(t){const e=this._tempb.clear().union(t.bounds);let n=t.mark.group;while(n){e.translate(n.x||0,n.y||0);n=n.mark.group}this._dirty.union(e)}_render(t,e){const n=this.context(),i=this._origin,r=this._width,s=this._height,a=this._dirty,o=Jm(i,r,s);n.save();const u=this._redraw||a.empty()?(this._redraw=false,o.expand(1)):tg(n,o.intersect(a),i);this.clear(-i[0],-i[1],r,s);this.draw(n,t,u,e);n.restore();a.clear();return this}draw(t,e,n,i){if(e.marktype!=="group"&&i!=null&&!i.includes(e.marktype)){return}const r=Qp[e.marktype];if(e.clip)zh(t,e);r.draw.call(this,t,e,n,i);if(e.clip)t.restore()}clear(t,e,n,i){const r=this._options,s=this.context();if(r.type!=="pdf"&&!r.externalContext){s.clearRect(t,e,n,i)}if(this._bgcolor!=null){s.fillStyle=this._bgcolor;s.fillRect(t,e,n,i)}}}const Jm=(t,e,n)=>(new vd).set(0,0,e,n).translate(-t[0],-t[1]);function tg(t,e,n){e.expand(1).round();if(t.pixelRatio%1){e.scale(t.pixelRatio).round().scale(1/t.pixelRatio)}e.translate(-(n[0]%1),-(n[1]%1));t.beginPath();t.rect(e.x1,e.y1,e.width(),e.height());t.clip();return e}class eg extends hm{constructor(t,e){super(t,e);const n=this;n._hrefHandler=ng(n,((t,e)=>{if(e&&e.href)n.handleHref(t,e,e.href)}));n._tooltipHandler=ng(n,((t,e)=>{n.handleTooltip(t,e,t.type!==Im)}))}initialize(t,e,n){let i=this._svg;if(i){i.removeEventListener(Um,this._hrefHandler);i.removeEventListener(qm,this._tooltipHandler);i.removeEventListener(Im,this._tooltipHandler)}this._svg=i=t&&om(t,"svg");if(i){i.addEventListener(Um,this._hrefHandler);i.addEventListener(qm,this._tooltipHandler);i.addEventListener(Im,this._tooltipHandler)}return super.initialize(t,e,n)}canvas(){return this._svg}on(t,e){const n=this.eventName(t),i=this._handlers,r=this._handlerIndex(i[n],t,e);if(r<0){const r={type:t,handler:e,listener:ng(this,e)};(i[n]||(i[n]=[])).push(r);if(this._svg){this._svg.addEventListener(n,r.listener)}}return this}off(t,e){const n=this.eventName(t),i=this._handlers[n],r=this._handlerIndex(i,t,e);if(r>=0){if(this._svg){this._svg.removeEventListener(n,i[r].listener)}i.splice(r,1)}return this}}const ng=(t,e)=>n=>{let i=n.target.__data__;i=Array.isArray(i)?i[0]:i;n.vegaType=n.type;e.call(t._obj,n,i)};const ig="aria-hidden";const rg="aria-label";const sg="role";const ag="aria-roledescription";const og="graphics-object";const ug="graphics-symbol";const lg=(t,e,n)=>({[sg]:t,[ag]:e,[rg]:n||undefined});const cg=(0,p.M1)(["axis-domain","axis-grid","axis-label","axis-tick","axis-title","legend-band","legend-entry","legend-gradient","legend-label","legend-title","legend-symbol","title"]);const fg={axis:{desc:"axis",caption:vg},legend:{desc:"legend",caption:bg},"title-text":{desc:"title",caption:t=>`Title text '${yg(t)}'`},"title-subtitle":{desc:"subtitle",caption:t=>`Subtitle text '${yg(t)}'`}};const dg={ariaRole:sg,ariaRoleDescription:ag,description:rg};function hg(t,e){const n=e.aria===false;t(ig,n||undefined);if(n||e.description==null){for(const e in dg){t(dg[e],undefined)}}else{const n=e.mark.marktype;t(rg,e.description);t(sg,e.ariaRole||(n==="group"?og:ug));t(ag,e.ariaRoleDescription||`${n} mark`)}}function pg(t){return t.aria===false?{[ig]:true}:cg[t.role]?null:fg[t.role]?gg(t,fg[t.role]):mg(t)}function mg(t){const e=t.marktype;const n=e==="group"||e==="text"||t.items.some((t=>t.description!=null&&t.aria!==false));return lg(n?og:ug,`${e} mark container`,t.description)}function gg(t,e){try{const n=t.items[0],i=e.caption||(()=>"");return lg(e.role||ug,e.desc,n.description||i(n))}catch(n){return null}}function yg(t){return(0,p.YO)(t.text).join(" ")}function vg(t){const e=t.datum,n=t.orient,i=e.title?xg(t):null,r=t.context,s=r.scales[e.scale].value,a=r.dataflow.locale(),o=s.type,u=n==="left"||n==="right"?"Y":"X";return`${u}-axis`+(i?` titled '${i}'`:"")+` for a ${Vl(o)?"discrete":o} scale`+` with ${Ic(a,s,t)}`}function bg(t){const e=t.datum,n=e.title?xg(t):null,i=`${e.type||""} legend`.trim(),r=e.scales,s=Object.keys(r),a=t.context,o=a.scales[r[s[0]]].value,u=a.dataflow.locale();return wg(i)+(n?` titled '${n}'`:"")+` for ${_g(s)}`+` with ${Ic(u,o,t)}`}function xg(t){try{return(0,p.YO)((0,p.se)(t.items).items[0].text).join(" ")}catch(e){return null}}function _g(t){t=t.map((t=>t+(t==="fill"||t==="stroke"?" color":"")));return t.length<2?t[0]:t.slice(0,-1).join(", ")+" and "+(0,p.se)(t)}function wg(t){return t.length?t[0].toUpperCase()+t.slice(1):t}const Ag=t=>(t+"").replace(/&/g,"&").replace(//g,">");const kg=t=>Ag(t).replace(/"/g,""").replace(/\t/g," ").replace(/\n/g," ").replace(/\r/g," ");function Eg(){let t="",e="",n="";const i=[],r=()=>e=n="",s=s=>{if(e){t+=`${e}>${n}`;r()}i.push(s)},a=(t,n)=>{if(n!=null)e+=` ${t}="${kg(n)}"`;return o},o={open(t){s(t);e="<"+t;for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r${n}`:"/>")}else{t+=``}r();return o},attr:a,text:t=>(n+=Ag(t),o),toString:()=>t};return o}const Mg=t=>Dg(Eg(),t)+"";function Dg(t,e){t.open(e.tagName);if(e.hasAttributes()){const n=e.attributes,i=n.length;for(let e=0;e{t.dirty=e}))}if(i.zdirty)continue;if(n.exit){if(s.nested&&i.items.length){u=i.items[0];if(u._svg)this._update(s,u._svg,u)}else if(n._svg){u=n._svg.parentNode;if(u)u.removeChild(n._svg)}n._svg=null;continue}n=s.nested?i.items[0]:n;if(n._update===e)continue;if(!n._svg||!n._svg.ownerSVGElement){this._dirtyAll=false;Og(n,e)}else{this._update(s,n._svg,n)}n._update=e}return!this._dirtyAll}mark(t,e,n,i){if(!this.isDirty(e)){return e._svg}const r=this._svg,s=e.marktype,a=Qp[s],o=e.interactive===false?"none":null,u=a.tag==="g";const l=Pg(e,t,n,"g",r);if(s!=="group"&&i!=null&&!i.includes(s)){lm(l,0);return e._svg}l.setAttribute("class",cm(e));const c=pg(e);for(const p in c)Xg(l,p,c[p]);if(!u){Xg(l,"pointer-events",o)}Xg(l,"clip-path",e.clip?yd(this,e,e.group):null);let f=null,d=0;const h=t=>{const e=this.isDirty(t),n=Pg(t,l,f,a.tag,r);if(e){this._update(a,n,t);if(u)Lg(this,n,t,i)}f=n;++d};if(a.nested){if(e.items.length)h(e.items[0])}else{fh(e,h)}lm(l,d);return l}_update(t,e,n){Ig=e;Ug=e.__values__;hg(Gg,n);t.attr(Gg,n,this);const i=jg[t.type];if(i)i.call(this,t,e,n);if(Ig)this.style(Ig,n)}style(t,e){if(e==null)return;for(const n in Cg){let i=n==="font"?Np(e):e[n];if(i===Ug[n])continue;const r=Cg[n];if(i==null){t.removeAttribute(r)}else{if(Yc(i)){i=Wc(i,this._defs.gradient,Vg())}t.setAttribute(r,i+"")}Ug[n]=i}for(const n in Fg){Yg(t,Fg[n],e[n])}}defs(){const t=this._svg,e=this._defs;let n=e.el,i=0;for(const r in e.gradient){if(!n)e.el=n=um(t,Bg+1,"defs",$g);i=Tg(n,e.gradient[r],i)}for(const r in e.clipping){if(!n)e.el=n=um(t,Bg+1,"defs",$g);i=Ng(n,e.clipping[r],i)}if(n){i===0?(t.removeChild(n),e.el=null):lm(n,i)}}_clearDefs(){const t=this._defs;t.gradient={};t.clipping={}}}function Og(t,e){for(;t&&t.dirty!==e;t=t.mark.group){t.dirty=e;if(t.mark&&t.mark.dirty!==e){t.mark.dirty=e}else return}}function Tg(t,e,n){let i,r,s;if(e.gradient==="radial"){let i=um(t,n++,"pattern",$g);Wg(i,{id:Gc+e.id,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"});i=um(i,0,"rect",$g);Wg(i,{width:1,height:1,fill:`url(${Vg()}#${e.id})`});t=um(t,n++,"radialGradient",$g);Wg(t,{id:e.id,fx:e.x1,fy:e.y1,fr:e.r1,cx:e.x2,cy:e.y2,r:e.r2})}else{t=um(t,n++,"linearGradient",$g);Wg(t,{id:e.id,x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2})}for(i=0,r=e.stops.length;i{r=t.mark(e,n,r,i);++s}));lm(e,1+s)}function Pg(t,e,n,i,r){let s=t._svg,a;if(!s){a=e.ownerDocument;s=am(a,i,$g);t._svg=s;if(t.mark){s.__data__=t;s.__values__={fill:"default"};if(i==="g"){const e=am(a,"path",$g);s.appendChild(e);e.__data__=t;const n=am(a,"g",$g);s.appendChild(n);n.__data__=t;const i=am(a,"path",$g);s.appendChild(i);i.__data__=t;i.__values__={fill:"default"}}}}if(s.ownerSVGElement!==r||qg(s,n)){e.insertBefore(s,n?n.nextSibling:e.firstChild)}return s}function qg(t,e){return t.parentNode&&t.parentNode.childNodes.length>1&&t.previousSibling!=e}let Ig=null,Ug=null;const jg={group(t,e,n){const i=Ig=e.childNodes[2];Ug=i.__values__;t.foreground(Gg,n,this);Ug=e.__values__;Ig=e.childNodes[1];t.content(Gg,n,this);const r=Ig=e.childNodes[0];t.background(Gg,n,this);const s=n.mark.interactive===false?"none":null;if(s!==Ug.events){Xg(i,"pointer-events",s);Xg(r,"pointer-events",s);Ug.events=s}if(n.strokeForeground&&n.stroke){const t=n.fill;Xg(i,"display",null);this.style(r,n);Xg(r,"stroke",null);if(t)n.fill=null;Ug=i.__values__;this.style(i,n);if(t)n.fill=t;Ig=null}else{Xg(i,"display","none")}},image(t,e,n){if(n.smooth===false){Yg(e,"image-rendering","optimizeSpeed");Yg(e,"image-rendering","pixelated")}else{Yg(e,"image-rendering",null)}},text(t,e,n){const i=zp(n);let r,s,a,o;if((0,p.cy)(i)){s=i.map((t=>Rp(n,t)));r=s.join("\n");if(r!==Ug.text){lm(e,0);a=e.ownerDocument;o=Sp(n);s.forEach(((t,i)=>{const r=am(a,"tspan",$g);r.__data__=n;r.textContent=t;if(i){r.setAttribute("x",0);r.setAttribute("dy",o)}e.appendChild(r)}));Ug.text=r}}else{s=Rp(n,i);if(s!==Ug.text){e.textContent=s;Ug.text=s}}Xg(e,"font-family",Np(n));Xg(e,"font-size",Fp(n)+"px");Xg(e,"font-style",n.fontStyle);Xg(e,"font-variant",n.fontVariant);Xg(e,"font-weight",n.fontWeight)}};function Gg(t,e,n){if(e===Ug[t])return;if(n){Hg(Ig,t,e,n)}else{Xg(Ig,t,e)}Ug[t]=e}function Yg(t,e,n){if(n!==Ug[e]){if(n==null){t.style.removeProperty(e)}else{t.style.setProperty(e,n+"")}Ug[e]=n}}function Wg(t,e){for(const n in e){Xg(t,n,e[n])}}function Xg(t,e,n){if(n!=null){t.setAttribute(e,n)}else{t.removeAttribute(e)}}function Hg(t,e,n,i){if(n!=null){t.setAttributeNS(i,e,n)}else{t.removeAttributeNS(i,e)}}function Vg(){let t;return typeof window==="undefined"?"":(t=window.location).hash?t.href.slice(0,-t.hash.length):t.href}class Qg extends mm{constructor(t){super(t);this._text=null;this._defs={gradient:{},clipping:{}}}svg(){return this._text}_render(t){const e=Eg();e.open("svg",(0,p.X$)({},Vh,{class:"marks",width:this._width*this._scale,height:this._height*this._scale,viewBox:`0 0 ${this._width} ${this._height}`}));const n=this._bgcolor;if(n&&n!=="transparent"&&n!=="none"){e.open("rect",{width:this._width,height:this._height,fill:n}).close()}e.open("g",Sg,{transform:"translate("+this._origin+")"});this.mark(e,t);e.close();this.defs(e);this._text=e.close()+"";return this}mark(t,e){const n=Qp[e.marktype],i=n.tag,r=[hg,n.attr];t.open("g",{class:cm(e),"clip-path":e.clip?yd(this,e,e.group):null},pg(e),{"pointer-events":i!=="g"&&e.interactive===false?"none":null});const s=s=>{const a=this.href(s);if(a)t.open("a",a);t.open(i,this.attr(e,s,r,i!=="g"?i:null));if(i==="text"){const e=zp(s);if((0,p.cy)(e)){const n={x:0,dy:Sp(s)};for(let i=0;ithis.mark(t,e)));t.close();if(i&&a){if(r)s.fill=null;s.stroke=a;t.open("path",this.attr(e,s,n.foreground,"bgrect")).close();if(r)s.fill=r}else{t.open("path",this.attr(e,s,n.foreground,"bgfore")).close()}}t.close();if(a)t.close()};if(n.nested){if(e.items&&e.items.length)s(e.items[0])}else{fh(e,s)}return t.close()}href(t){const e=t.href;let n;if(e){if(n=this._hrefs&&this._hrefs[e]){return n}else{this.sanitizeURL(e).then((t=>{t["xlink:href"]=t.href;t.href=null;(this._hrefs||(this._hrefs={}))[e]=t}))}}return null}attr(t,e,n,i){const r={},s=(t,e,n,i)=>{r[i||t]=e};if(Array.isArray(n)){n.forEach((t=>t(s,e,this)))}else{n(s,e,this)}if(i){Kg(r,e,t,i,this._defs)}return r}defs(t){const e=this._defs.gradient,n=this._defs.clipping,i=Object.keys(e).length+Object.keys(n).length;if(i===0)return;t.open("defs");for(const r in e){const n=e[r],i=n.stops;if(n.gradient==="radial"){t.open("pattern",{id:Gc+r,viewBox:"0,0,1,1",width:"100%",height:"100%",preserveAspectRatio:"xMidYMid slice"});t.open("rect",{width:"1",height:"1",fill:"url(#"+r+")"}).close();t.close();t.open("radialGradient",{id:r,fx:n.x1,fy:n.y1,fr:n.r1,cx:n.x2,cy:n.y2,r:n.r2})}else{t.open("linearGradient",{id:r,x1:n.x1,x2:n.x2,y1:n.y1,y2:n.y2})}for(let e=0;e!Zg.svgMarkTypes.includes(t)));this._svgRenderer.render(t,Zg.svgMarkTypes);this._canvasRenderer.render(t,i)}resize(t,e,n,i){super.resize(t,e,n,i);this._svgRenderer.resize(t,e,n,i);this._canvasRenderer.resize(t,e,n,i);return this}background(t){if(Zg.svgOnTop){this._canvasRenderer.background(t)}else{this._svgRenderer.background(t)}return this}}class ey extends jm{constructor(t,e){super(t,e)}initialize(t,e,n){const i=um(um(t,0,"div"),Zg.svgOnTop?0:1,"div");return super.initialize(i,e,n)}}const ny="canvas";const iy="hybrid";const ry="png";const sy="svg";const ay="none";const oy={Canvas:ny,PNG:ry,SVG:sy,Hybrid:iy,None:ay};const uy={};uy[ny]=uy[ry]={renderer:Zm,headless:Zm,handler:jm};uy[sy]={renderer:Rg,headless:Qg,handler:eg};uy[iy]={renderer:ty,headless:ty,handler:ey};uy[ay]={};function ly(t,e){t=String(t||"").toLowerCase();if(arguments.length>1){uy[t]=e;return this}else{return uy[t]}}function cy(t,e,n){const i=[],r=(new vd).union(e),s=t.marktype;return s?fy(t,r,n,i):s==="group"?hy(t,r,n,i):(0,p.z3)("Intersect scene must be mark node or group item.")}function fy(t,e,n,i){if(dy(t,e,n)){const r=t.items,s=t.marktype,a=r.length;let o=0;if(s==="group"){for(;o=0;s--){if(n[s]!=i[s])return false}for(s=n.length-1;s>=0;s--){r=n[s];if(!vy(t[r],e[r],r))return false}return typeof t===typeof e}function _y(){gd();jc()}const wy="top";const Ay="left";const ky="right";const Ey="bottom";const My="top-left";const Dy="top-right";const Cy="bottom-left";const Fy="bottom-right";const Sy="start";const By="middle";const zy="end";const $y="x";const Ry="y";const Oy="group";const Ty="axis";const Ny="title";const Ly="frame";const Py="scope";const qy="legend";const Iy="row-header";const Uy="row-footer";const jy="row-title";const Gy="column-header";const Yy="column-footer";const Wy="column-title";const Xy="padding";const Hy="symbol";const Vy="fit";const Qy="fit-x";const Ky="fit-y";const Zy="pad";const Jy="none";const tv="all";const ev="each";const nv="flush";const iv="column";const rv="row";function sv(t){zi.call(this,null,t)}(0,p.B)(sv,zi,{transform(t,e){const n=e.dataflow,i=t.mark,r=i.marktype,s=Qp[r],a=s.bound;let o=i.bounds,u;if(s.nested){if(i.items.length)n.dirty(i.items[0]);o=av(i,a);i.items.forEach((t=>{t.bounds.clear().union(o)}))}else if(r===Oy||t.modified()){e.visit(e.MOD,(t=>n.dirty(t)));o.clear();i.items.forEach((t=>o.union(av(t,a))));switch(i.role){case Ty:case qy:case Ny:e.reflow()}}else{u=e.changed(e.REM);e.visit(e.ADD,(t=>{o.union(av(t,a))}));e.visit(e.MOD,(t=>{u=u||o.alignsWith(t.bounds);n.dirty(t);o.union(av(t,a))}));if(u){o.clear();i.items.forEach((t=>o.union(t.bounds)))}}gy(i);return e.modifies("bounds")}});function av(t,e,n){return e(t.bounds.clear(),t,n)}const ov=":vega_identifier:";function uv(t){zi.call(this,0,t)}uv.Definition={type:"Identifier",metadata:{modifies:true},params:[{name:"as",type:"string",required:true}]};(0,p.B)(uv,zi,{transform(t,e){const n=lv(e.dataflow),i=t.as;let r=n.value;e.visit(e.ADD,(t=>t[i]=t[i]||++r));n.set(this.value=r);return e}});function lv(t){return t._signals[ov]||(t._signals[ov]=t.add(0))}function cv(t){zi.call(this,null,t)}(0,p.B)(cv,zi,{transform(t,e){let n=this.value;if(!n){n=e.dataflow.scenegraph().mark(t.markdef,fv(t),t.index);n.group.context=t.context;if(!t.context.group)t.context.group=n.group;n.source=this.source;n.clip=t.clip;n.interactive=t.interactive;this.value=n}const i=n.marktype===Oy?xd:bd;e.visit(e.ADD,(t=>i.call(t,n)));if(t.modified("clip")||t.modified("interactive")){n.clip=t.clip;n.interactive=!!t.interactive;n.zdirty=true;e.reflow()}n.items=e.source;return e}});function fv(t){const e=t.groups,n=t.parent;return e&&e.size===1?e.get(Object.keys(e.object)[0]):e&&n?e.lookup(n):null}function dv(t){zi.call(this,null,t)}const hv={parity:t=>t.filter(((t,e)=>e%2?t.opacity=0:1)),greedy:(t,e)=>{let n;return t.filter(((t,i)=>!i||!pv(n.bounds,t.bounds,e)?(n=t,1):t.opacity=0))}};const pv=(t,e,n)=>n>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2);const mv=(t,e)=>{for(var n=1,i=t.length,r=t[0].bounds,s;n{const e=t.bounds;return e.width()>1&&e.height()>1};const yv=(t,e,n)=>{var i=t.range(),r=new vd;if(e===wy||e===Ey){r.set(i[0],-Infinity,i[1],+Infinity)}else{r.set(-Infinity,i[0],+Infinity,i[1])}r.expand(n||1);return t=>r.encloses(t.bounds)};const vv=t=>{t.forEach((t=>t.opacity=1));return t};const bv=(t,e)=>t.reflow(e.modified()).modifies("opacity");(0,p.B)(dv,zi,{transform(t,e){const n=hv[t.method]||hv.parity,i=t.separation||0;let r=e.materialize(e.SOURCE).source,s,a;if(!r||!r.length)return;if(!t.method){if(t.modified("method")){vv(r);e=bv(e,t)}return e}r=r.filter(gv);if(!r.length)return;if(t.sort){r=r.slice().sort(t.sort)}s=vv(r);e=bv(e,t);if(s.length>=3&&mv(s,i)){do{s=n(s,i)}while(s.length>=3&&mv(s,i));if(s.length<3&&!(0,p.se)(r).opacity){if(s.length>1)(0,p.se)(s).opacity=0;(0,p.se)(r).opacity=1}}if(t.boundScale&&t.boundTolerance>=0){a=yv(t.boundScale,t.boundOrient,+t.boundTolerance);r.forEach((t=>{if(!a(t))t.opacity=0}))}const o=s[0].mark.bounds.clear();r.forEach((t=>{if(t.opacity)o.union(t.bounds)}));return e}});function xv(t){zi.call(this,null,t)}(0,p.B)(xv,zi,{transform(t,e){const n=e.dataflow;e.visit(e.ALL,(t=>n.dirty(t)));if(e.fields&&e.fields["zindex"]){const t=e.source&&e.source[0];if(t)t.mark.zdirty=true}}});const _v=new vd;function wv(t,e,n){return t[e]===n?0:(t[e]=n,1)}function Av(t){var e=t.items[0].orient;return e===Ay||e===ky}function kv(t){let e=+t.grid;return[t.ticks?e++:-1,t.labels?e++:-1,e+ +t.domain]}function Ev(t,e,n,i){var r=e.items[0],s=r.datum,a=r.translate!=null?r.translate:.5,o=r.orient,u=kv(s),l=r.range,c=r.offset,f=r.position,d=r.minExtent,h=r.maxExtent,p=s.title&&r.items[u[2]].items[0],m=r.titlePadding,g=r.bounds,y=p&&$p(p),v=0,b=0,x,_;_v.clear().union(g);g.clear();if((x=u[0])>-1)g.union(r.items[x].bounds);if((x=u[1])>-1)g.union(r.items[x].bounds);switch(o){case wy:v=f||0;b=-c;_=Math.max(d,Math.min(h,-g.y1));g.add(0,-_).add(l,0);if(p)Mv(t,p,_,m,y,0,-1,g);break;case Ay:v=-c;b=f||0;_=Math.max(d,Math.min(h,-g.x1));g.add(-_,0).add(0,l);if(p)Mv(t,p,_,m,y,1,-1,g);break;case ky:v=n+c;b=f||0;_=Math.max(d,Math.min(h,g.x2));g.add(0,0).add(_,l);if(p)Mv(t,p,_,m,y,1,1,g);break;case Ey:v=f||0;b=i+c;_=Math.max(d,Math.min(h,g.y2));g.add(0,0).add(l,_);if(p)Mv(t,p,_,m,0,0,1,g);break;default:v=r.x;b=r.y}kd(g.translate(v,b),r);if(wv(r,"x",v+a)|wv(r,"y",b+a)){r.bounds=_v;t.dirty(r);r.bounds=g;t.dirty(r)}return r.mark.bounds.clear().union(g)}function Mv(t,e,n,i,r,s,a,o){const u=e.bounds;if(e.auto){const o=a*(n+r+i);let l=0,c=0;t.dirty(e);s?l=(e.x||0)-(e.x=o):c=(e.y||0)-(e.y=o);e.mark.bounds.clear().union(u.translate(-l,-c));t.dirty(e)}o.union(u)}const Dv=(t,e)=>Math.floor(Math.min(t,e));const Cv=(t,e)=>Math.ceil(Math.max(t,e));function Fv(t){var e=t.items,n=e.length,i=0,r,s;const a={marks:[],rowheaders:[],rowfooters:[],colheaders:[],colfooters:[],rowtitle:null,coltitle:null};for(;i1){for(A=0;A0)b[A]+=S/2}}if(o&&zv(n.center,rv)&&c!==1){for(A=0;A0)x[A]+=B/2}}for(A=0;Ar){t.warn("Grid headers exceed limit: "+r);e=e.slice(0,r)}m+=s;for(v=0,x=e.length;v=0&&(A=n[b])==null;b-=d);if(o){k=h==null?A.x:Math.round(A.bounds.x1+h*A.bounds.width());E=m}else{k=m;E=h==null?A.y:Math.round(A.bounds.y1+h*A.bounds.height())}_.union(w.bounds.translate(k-(w.x||0),E-(w.y||0)));w.x=k;w.y=E;t.dirty(w);g=a(g,_[l])}return g}function Pv(t,e,n,i,r,s){if(!e)return;t.dirty(e);var a=n,o=n;i?a=Math.round(r.x1+s*r.width()):o=Math.round(r.y1+s*r.height());e.bounds.translate(a-(e.x||0),o-(e.y||0));e.mark.bounds.clear().union(e.bounds);e.x=a;e.y=o;t.dirty(e)}function qv(t,e){const n=t[e]||{};return(e,i)=>n[e]!=null?n[e]:t[e]!=null?t[e]:i}function Iv(t,e){let n=-Infinity;t.forEach((t=>{if(t.offset!=null)n=Math.max(n,t.offset)}));return n>-Infinity?n:e}function Uv(t,e,n,i,r,s,a){const o=qv(n,e),u=Iv(t,o("offset",0)),l=o("anchor",Sy),c=l===zy?1:l===By?.5:0;const f={align:ev,bounds:o("bounds",nv),columns:o("direction")==="vertical"?1:t.length,padding:o("margin",8),center:o("center"),nodirty:true};switch(e){case Ay:f.anchor={x:Math.floor(i.x1)-u,column:zy,y:c*(a||i.height()+2*i.y1),row:l};break;case ky:f.anchor={x:Math.ceil(i.x2)+u,y:c*(a||i.height()+2*i.y1),row:l};break;case wy:f.anchor={y:Math.floor(r.y1)-u,row:zy,x:c*(s||r.width()+2*r.x1),column:l};break;case Ey:f.anchor={y:Math.ceil(r.y2)+u,x:c*(s||r.width()+2*r.x1),column:l};break;case My:f.anchor={x:u,y:u};break;case Dy:f.anchor={x:s-u,y:u,column:zy};break;case Cy:f.anchor={x:u,y:a-u,row:zy};break;case Fy:f.anchor={x:s-u,y:a-u,column:zy,row:zy};break}return f}function jv(t,e){var n=e.items[0],i=n.datum,r=n.orient,s=n.bounds,a=n.x,o=n.y,u,l;n._bounds?n._bounds.clear().union(s):n._bounds=s.clone();s.clear();Yv(t,n,n.items[0].items[0]);s=Gv(n,s);u=2*n.padding;l=2*n.padding;if(!s.empty()){u=Math.ceil(s.width()+u);l=Math.ceil(s.height()+l)}if(i.type===Hy){Hv(n.items[0].items[0].items[0].items)}if(r!==Jy){n.x=a=0;n.y=o=0}n.width=u;n.height=l;kd(s.set(a,o,a+u,o+l),n);n.mark.bounds.clear().union(s);return n}function Gv(t,e){t.items.forEach((t=>e.union(t.bounds)));e.x1=t.padding;e.y1=t.padding;return e}function Yv(t,e,n){var i=e.padding,r=i-n.x,s=i-n.y;if(!e.datum.title){if(r||s)Xv(t,n,r,s)}else{var a=e.items[1].items[0],o=a.anchor,u=e.titlePadding||0,l=i-a.x,c=i-a.y;switch(a.orient){case Ay:r+=Math.ceil(a.bounds.width())+u;break;case ky:case Ey:break;default:s+=a.bounds.height()+u}if(r||s)Xv(t,n,r,s);switch(a.orient){case Ay:c+=Wv(e,n,a,o,1,1);break;case ky:l+=Wv(e,n,a,zy,0,0)+u;c+=Wv(e,n,a,o,1,1);break;case Ey:l+=Wv(e,n,a,o,0,0);c+=Wv(e,n,a,zy,-1,0,1)+u;break;default:l+=Wv(e,n,a,o,0,0)}if(l||c)Xv(t,a,l,c);if((l=Math.round(a.bounds.x1-i))<0){Xv(t,n,-l,0);Xv(t,a,-l,0)}}}function Wv(t,e,n,i,r,s,a){const o=t.datum.type!=="symbol",u=n.datum.vgrad,l=o&&(s||!u)&&!a?e.items[0]:e,c=l.bounds[r?"y2":"x2"]-t.padding,f=u&&s?c:0,d=u&&s?0:c,h=r<=0?0:$p(n);return Math.round(i===Sy?f:i===zy?d-h:.5*(c-h))}function Xv(t,e,n,i){e.x+=n;e.y+=i;e.bounds.translate(n,i);e.mark.bounds.translate(n,i);t.dirty(e)}function Hv(t){const e=t.reduce(((t,e)=>{t[e.column]=Math.max(e.bounds.x2-e.x,t[e.column]||0);return t}),{});t.forEach((t=>{t.width=e[t.column];t.height=t.bounds.y2-t.y}))}function Vv(t,e,n,i,r){var s=e.items[0],a=s.frame,o=s.orient,u=s.anchor,l=s.offset,c=s.padding,f=s.items[0].items[0],d=s.items[1]&&s.items[1].items[0],h=o===Ay||o===ky?i:n,p=0,m=0,g=0,y=0,v=0,b;if(a!==Oy){o===Ay?(p=r.y2,h=r.y1):o===ky?(p=r.y1,h=r.y2):(p=r.x1,h=r.x2)}else if(o===Ay){p=i,h=0}b=u===Sy?p:u===zy?h:(p+h)/2;if(d&&d.text){switch(o){case wy:case Ey:v=f.bounds.height()+c;break;case Ay:y=f.bounds.width()+c;break;case ky:y=-f.bounds.width()-c;break}_v.clear().union(d.bounds);_v.translate(y-(d.x||0),v-(d.y||0));if(wv(d,"x",y)|wv(d,"y",v)){t.dirty(d);d.bounds.clear().union(_v);d.mark.bounds.clear().union(_v);t.dirty(d)}_v.clear().union(d.bounds)}else{_v.clear()}_v.union(f.bounds);switch(o){case wy:m=b;g=r.y1-_v.height()-l;break;case Ay:m=r.x1-_v.width()-l;g=b;break;case ky:m=r.x2+_v.width()+l;g=b;break;case Ey:m=b;g=r.y2+l;break;default:m=s.x;g=s.y}if(wv(s,"x",m)|wv(s,"y",g)){_v.translate(m,g);t.dirty(s);s.bounds.clear().union(_v);e.bounds.clear().union(_v);t.dirty(s)}return s.bounds}function Qv(t){zi.call(this,null,t)}(0,p.B)(Qv,zi,{transform(t,e){const n=e.dataflow;t.mark.items.forEach((e=>{if(t.layout)Ov(n,e,t.layout);Zv(n,e,t)}));return Kv(t.mark.group)?e.reflow():e}});function Kv(t){return t&&t.mark.role!=="legend-entry"}function Zv(t,e,n){var i=e.items,r=Math.max(0,e.width||0),s=Math.max(0,e.height||0),a=(new vd).set(0,0,r,s),o=a.clone(),u=a.clone(),l=[],c,f,d,h,p,m;for(p=0,m=i.length;p{d=t.orient||ky;if(d!==Jy)(e[d]||(e[d]=[])).push(t)}));for(const i in e){const a=e[i];Rv(t,a,Uv(a,i,n.legends,o,u,r,s))}l.forEach((e=>{const i=e.bounds;if(!i.equals(e._bounds)){e.bounds=e._bounds;t.dirty(e);e.bounds=i;t.dirty(e)}if(n.autosize&&(n.autosize.type===Vy||n.autosize.type===Qy||n.autosize.type===Ky)){switch(e.orient){case Ay:case ky:a.add(i.x1,0).add(i.x2,0);break;case wy:case Ey:a.add(0,i.y1).add(0,i.y2)}}else{a.union(i)}}))}a.union(o).union(u);if(c){a.union(Vv(t,c,r,s,a))}if(e.clip){a.set(0,0,e.width||0,e.height||0)}Jv(t,e,a,n)}function Jv(t,e,n,i){const r=i.autosize||{},s=r.type;if(t._autosize<1||!s)return;let a=t._width,o=t._height,u=Math.max(0,e.width||0),l=Math.max(0,Math.ceil(-n.x1)),c=Math.max(0,e.height||0),f=Math.max(0,Math.ceil(-n.y1));const d=Math.max(0,Math.ceil(n.x2-u)),h=Math.max(0,Math.ceil(n.y2-c));if(r.contains===Xy){const e=t.padding();a-=e.left+e.right;o-=e.top+e.bottom}if(s===Jy){l=0;f=0;u=a;c=o}else if(s===Vy){u=Math.max(0,a-l-d);c=Math.max(0,o-f-h)}else if(s===Qy){u=Math.max(0,a-l-d);o=c+f+h}else if(s===Ky){a=u+l+d;c=Math.max(0,o-f-h)}else if(s===Zy){a=u+l+d;o=c+f+h}t._resizeView(a,o,u,c,[l,f],r.resize)}function tb(t,e){let n=0;if(e===undefined){for(let e of t){if(e=+e){n+=e}}}else{let i=-1;for(let r of t){if(r=+e(r,++i,t)){n+=r}}}return n}function eb(t){zi.call(this,null,t)}(0,p.B)(eb,zi,{transform(t,e){if(this.value&&!t.modified()){return e.StopPropagation}var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,s=t.scale,a=t.count==null?t.values?t.values.length:10:t.count,o=_c(s,a,t.minstep),u=t.format||kc(n,s,o,t.formatSpecifier,t.formatType,!!t.values),l=t.values?wc(s,t.values,o):Ac(s,o);if(r)i.rem=r;r=l.map(((t,e)=>bn({index:e/(l.length-1||1),value:t,label:u(t)})));if(t.extra&&r.length){r.push(bn({index:-1,extra:{value:r[0].value},label:""}))}i.source=r;i.add=r;this.value=r;return i}});function nb(t){zi.call(this,null,t)}function ib(){return bn({})}function rb(t){const e=(0,p.nG)().test((t=>t.exit));e.lookup=n=>e.get(t(n));return e}(0,p.B)(nb,zi,{transform(t,e){var n=e.dataflow,i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=t.item||ib,s=t.key||yn,a=this.value;if((0,p.cy)(i.encode)){i.encode=null}if(a&&(t.modified("key")||e.modified(s))){(0,p.z3)("DataJoin does not support modified key function or fields.")}if(!a){e=e.addAll();this.value=a=rb(s)}e.visit(e.ADD,(t=>{const e=s(t);let n=a.get(e);if(n){if(n.exit){a.empty--;i.add.push(n)}else{i.mod.push(n)}}else{n=r(t);a.set(e,n);i.add.push(n)}n.datum=t;n.exit=false}));e.visit(e.MOD,(t=>{const e=s(t),n=a.get(e);if(n){n.datum=t;i.mod.push(n)}}));e.visit(e.REM,(t=>{const e=s(t),n=a.get(e);if(t===n.datum&&!n.exit){i.rem.push(n);n.exit=true;++a.empty}}));if(e.changed(e.ADD_MOD))i.modifies("datum");if(e.clean()||t.clean&&a.empty>n.cleanThreshold){n.runAfter(a.clean)}return i}});function sb(t){zi.call(this,null,t)}(0,p.B)(sb,zi,{transform(t,e){var n=e.fork(e.ADD_REM),i=t.mod||false,r=t.encoders,s=e.encode;if((0,p.cy)(s)){if(n.changed()||s.every((t=>r[t]))){s=s[0];n.encode=null}else{return e.StopPropagation}}var a=s==="enter",o=r.update||p.me,u=r.enter||p.me,l=r.exit||p.me,c=(s&&!a?r[s]:o)||p.me;if(e.changed(e.ADD)){e.visit(e.ADD,(e=>{u(e,t);o(e,t)}));n.modifies(u.output);n.modifies(o.output);if(c!==p.me&&c!==o){e.visit(e.ADD,(e=>{c(e,t)}));n.modifies(c.output)}}if(e.changed(e.REM)&&l!==p.me){e.visit(e.REM,(e=>{l(e,t)}));n.modifies(l.output)}if(a||c!==p.me){const r=e.MOD|(t.modified()?e.REFLOW:0);if(a){e.visit(r,(e=>{const r=u(e,t)||i;if(c(e,t)||r)n.mod.push(e)}));if(n.mod.length)n.modifies(u.output)}else{e.visit(r,(e=>{if(c(e,t)||i)n.mod.push(e)}))}if(n.mod.length)n.modifies(c.output)}return n.changed()?n:e.StopPropagation}});function ab(t){zi.call(this,[],t)}(0,p.B)(ab,zi,{transform(t,e){if(this.value!=null&&!t.modified()){return e.StopPropagation}var n=e.dataflow.locale(),i=e.fork(e.NO_SOURCE|e.NO_FIELDS),r=this.value,s=t.type||mc,a=t.scale,o=+t.limit,u=_c(a,t.count==null?5:t.count,t.minstep),l=!!t.values||s===mc,c=t.format||$c(n,a,u,s,t.formatSpecifier,t.formatType,l),f=t.values||Cc(a,u),d,h,m,g,y;if(r)i.rem=r;if(s===mc){if(o&&f.length>o){e.dataflow.warn("Symbol legend count exceeds limit, filtering items.");r=f.slice(0,o-1);y=true}else{r=f}if((0,p.Tn)(m=t.size)){if(!t.values&&a(r[0])===0){r=r.slice(1)}g=r.reduce(((e,n)=>Math.max(e,m(n,t))),0)}else{m=(0,p.dY)(g=m||8)}r=r.map(((e,n)=>bn({index:n,label:c(e,n,r),value:e,offset:g,size:m(e,t)})));if(y){y=f[r.length];r.push(bn({index:r.length,label:`…${f.length-r.length} entries`,value:y,offset:g,size:m(y,t)}))}}else if(s===yc){d=a.domain(),h=ac(a,d[0],(0,p.se)(d));if(f.length<3&&!t.values&&d[0]!==(0,p.se)(d)){f=[d[0],(0,p.se)(d)]}r=f.map(((t,e)=>bn({index:e,label:c(t,e,f),value:t,perc:h(t)})))}else{m=f.length-1;h=Pc(a);r=f.map(((t,e)=>bn({index:e,label:c(t,e,f),value:t,perc:e?h(t):0,perc2:e===m?1:h(f[e+1])})))}i.source=r;i.add=r;this.value=r;return i}});const ob=t=>t.source.x;const ub=t=>t.source.y;const lb=t=>t.target.x;const cb=t=>t.target.y;function fb(t){zi.call(this,{},t)}fb.Definition={type:"LinkPath",metadata:{modifies:true},params:[{name:"sourceX",type:"field",default:"source.x"},{name:"sourceY",type:"field",default:"source.y"},{name:"targetX",type:"field",default:"target.x"},{name:"targetY",type:"field",default:"target.y"},{name:"orient",type:"enum",default:"vertical",values:["horizontal","vertical","radial"]},{name:"shape",type:"enum",default:"line",values:["line","arc","curve","diagonal","orthogonal"]},{name:"require",type:"signal"},{name:"as",type:"string",default:"path"}]};(0,p.B)(fb,zi,{transform(t,e){var n=t.sourceX||ob,i=t.sourceY||ub,r=t.targetX||lb,s=t.targetY||cb,a=t.as||"path",o=t.orient||"vertical",u=t.shape||"line",l=kb.get(u+"-"+o)||kb.get(u);if(!l){(0,p.z3)("LinkPath unsupported type: "+t.shape+(t.orient?"-"+t.orient:""))}e.visit(e.SOURCE,(t=>{t[a]=l(n(t),i(t),r(t),s(t))}));return e.reflow(t.modified()).modifies(a)}});const db=(t,e,n,i)=>"M"+t+","+e+"L"+n+","+i;const hb=(t,e,n,i)=>db(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n));const pb=(t,e,n,i)=>{var r=n-t,s=i-e,a=Math.hypot(r,s)/2,o=180*Math.atan2(s,r)/Math.PI;return"M"+t+","+e+"A"+a+","+a+" "+o+" 0 1"+" "+n+","+i};const mb=(t,e,n,i)=>pb(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n));const gb=(t,e,n,i)=>{const r=n-t,s=i-e,a=.2*(r+s),o=.2*(s-r);return"M"+t+","+e+"C"+(t+a)+","+(e+o)+" "+(n+o)+","+(i-a)+" "+n+","+i};const yb=(t,e,n,i)=>gb(e*Math.cos(t),e*Math.sin(t),i*Math.cos(n),i*Math.sin(n));const vb=(t,e,n,i)=>"M"+t+","+e+"V"+i+"H"+n;const bb=(t,e,n,i)=>"M"+t+","+e+"H"+n+"V"+i;const xb=(t,e,n,i)=>{const r=Math.cos(t),s=Math.sin(t),a=Math.cos(n),o=Math.sin(n),u=Math.abs(n-t)>Math.PI?n<=t:n>t;return"M"+e*r+","+e*s+"A"+e+","+e+" 0 0,"+(u?1:0)+" "+e*a+","+e*o+"L"+i*a+","+i*o};const _b=(t,e,n,i)=>{const r=(t+n)/2;return"M"+t+","+e+"C"+r+","+e+" "+r+","+i+" "+n+","+i};const wb=(t,e,n,i)=>{const r=(e+i)/2;return"M"+t+","+e+"C"+t+","+r+" "+n+","+r+" "+n+","+i};const Ab=(t,e,n,i)=>{const r=Math.cos(t),s=Math.sin(t),a=Math.cos(n),o=Math.sin(n),u=(e+i)/2;return"M"+e*r+","+e*s+"C"+u*r+","+u*s+" "+u*a+","+u*o+" "+i*a+","+i*o};const kb=(0,p.nG)({line:db,"line-radial":hb,arc:pb,"arc-radial":mb,curve:gb,"curve-radial":yb,"orthogonal-horizontal":vb,"orthogonal-vertical":bb,"orthogonal-radial":xb,"diagonal-horizontal":_b,"diagonal-vertical":wb,"diagonal-radial":Ab});function Eb(t){zi.call(this,null,t)}Eb.Definition={type:"Pie",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"startAngle",type:"number",default:0},{name:"endAngle",type:"number",default:6.283185307179586},{name:"sort",type:"boolean",default:false},{name:"as",type:"string",array:true,length:2,default:["startAngle","endAngle"]}]};(0,p.B)(Eb,zi,{transform(t,e){var n=t.as||["startAngle","endAngle"],i=n[0],r=n[1],s=t.field||p.xH,a=t.startAngle||0,o=t.endAngle!=null?t.endAngle:2*Math.PI,u=e.source,l=u.map(s),c=l.length,f=a,d=(o-a)/tb(l),h=(0,es.A)(c),m,g,y;if(t.sort){h.sort(((t,e)=>l[t]-l[e]))}for(m=0;m-1)return i;var r=e.domain,s=t.type,a=e.zero||e.zero===undefined&&Db(t),o,u;if(!r)return 0;if(a||e.domainMin!=null||e.domainMax!=null||e.domainMid!=null){o=(r=r.slice()).length-1||1;if(a){if(r[0]>0)r[0]=0;if(r[o]<0)r[o]=0}if(e.domainMin!=null)r[0]=e.domainMin;if(e.domainMax!=null)r[o]=e.domainMax;if(e.domainMid!=null){u=e.domainMid;const t=u>r[o]?o+1:ut+(e<0?-1:e>0?1:0)),0));if(i!==e.length){n.warn("Log scale domain includes zero: "+(0,p.r$)(e))}}return e}function Nb(t,e,n){let i=e.bins;if(i&&!(0,p.cy)(i)){const e=t.domain(),n=e[0],r=(0,p.se)(e),s=i.step;let a=i.start==null?n:i.start,o=i.stop==null?r:i.stop;if(!s)(0,p.z3)("Scale bins parameter missing step property.");if(ar)o=s*Math.floor(r/s);i=(0,es.A)(a,o+s/2,s)}if(i){t.bins=i}else if(t.bins){delete t.bins}if(t.type===El){if(!i){t.bins=t.domain()}else if(!e.domain&&!e.domainRaw){t.domain(i);n=i.length}}return n}function Lb(t,e,n){var i=t.type,r=e.round||false,s=e.range;if(e.rangeStep!=null){s=Pb(i,e,n)}else if(e.scheme){s=qb(i,e,n);if((0,p.Tn)(s)){if(t.interpolator){return t.interpolator(s)}else{(0,p.z3)(`Scale type ${i} does not support interpolating color schemes.`)}}}if(s&&Jl(i)){return t.interpolator(ic(Ub(s,e.reverse),e.interpolate,e.interpolateGamma))}if(s&&e.interpolate&&t.interpolate){t.interpolate(oc(e.interpolate,e.interpolateGamma))}else if((0,p.Tn)(t.round)){t.round(r)}else if((0,p.Tn)(t.rangeRound)){t.interpolate(r?Su.A:Fu.A)}if(s)t.range(Ub(s,e.reverse))}function Pb(t,e,n){if(t!==kl&&t!==Al){(0,p.z3)("Only band and point scales support rangeStep.")}var i=(e.paddingOuter!=null?e.paddingOuter:e.padding)||0,r=t===Al?1:(e.paddingInner!=null?e.paddingInner:e.padding)||0;return[0,e.rangeStep*ul(n,r,i)]}function qb(t,e,n){var i=e.schemeExtent,r,s;if((0,p.cy)(e.scheme)){s=ic(e.scheme,e.interpolate,e.interpolateGamma)}else{r=e.scheme.toLowerCase();s=pc(r);if(!s)(0,p.z3)(`Unrecognized scheme name: ${e.scheme}`)}n=t===_l?n+1:t===El?n-1:t===bl||t===xl?+e.schemeCount||Mb:n;return Jl(t)?Ib(s,i,e.reverse):(0,p.Tn)(s)?rc(Ib(s,i),n):t===wl?s:s.slice(0,n)}function Ib(t,e,n){return(0,p.Tn)(t)&&(e||n)?nc(t,Ub(e||[0,1],n)):t}function Ub(t,e){return e?t.slice().reverse():t}function jb(t){zi.call(this,null,t)}(0,p.B)(jb,zi,{transform(t,e){const n=t.modified("sort")||e.changed(e.ADD)||e.modified(t.sort.fields)||e.modified("datum");if(n)e.source.sort(An(t.sort));this.modified(n);return e}});const Gb="zero",Yb="center",Wb="normalize",Xb=["y0","y1"];function Hb(t){zi.call(this,null,t)}Hb.Definition={type:"Stack",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"groupby",type:"field",array:true},{name:"sort",type:"compare"},{name:"offset",type:"enum",default:Gb,values:[Gb,Yb,Wb]},{name:"as",type:"string",array:true,length:2,default:Xb}]};(0,p.B)(Hb,zi,{transform(t,e){var n=t.as||Xb,i=n[0],r=n[1],s=An(t.sort),a=t.field||p.xH,o=t.offset===Yb?Vb:t.offset===Wb?Qb:Kb,u,l,c,f;u=Zb(e.source,t.groupby,s,a);for(l=0,c=u.length,f=u.max;lt(c),a,o,u,l,c,f,d,h,p;if(e==null){r.push(t.slice())}else{for(a={},o=0,u=t.length;op)p=h;if(n)d.sort(n)}r.max=p;return r}const Jb=t=>t;function tx(t,e){if(t&&nx.hasOwnProperty(t.type)){nx[t.type](t,e)}}var ex={Feature:function(t,e){tx(t.geometry,e)},FeatureCollection:function(t,e){var n=t.features,i=-1,r=n.length;while(++i0){s=t[--e];while(e>0){n=s;i=t[--e];s=n+i;r=i-(s-n);if(r)break}if(e>0&&(r<0&&t[e-1]<0||r>0&&t[e-1]>0)){i=r*2;n=s+i;if(i==n-s)s=n}}return s}}function ox(t,e){const n=new ax;if(e===undefined){for(let e of t){if(e=+e){n.add(e)}}}else{let i=-1;for(let r of t){if(r=+e(r,++i,t)){n.add(r)}}}return+n}function ux(t,e){const n=new ax;let i=-1;return Float64Array.from(t,e===undefined?t=>n.add(+t||0):r=>n.add(+e(r,++i,t)||0))}var lx=1e-6;var cx=1e-12;var fx=Math.PI;var dx=fx/2;var hx=fx/4;var px=fx*2;var mx=180/fx;var gx=fx/180;var yx=Math.abs;var vx=Math.atan;var bx=Math.atan2;var xx=Math.cos;var _x=Math.ceil;var wx=Math.exp;var Ax=Math.floor;var kx=Math.hypot;var Ex=Math.log;var Mx=Math.pow;var Dx=Math.sin;var Cx=Math.sign||function(t){return t>0?1:t<0?-1:0};var Fx=Math.sqrt;var Sx=Math.tan;function Bx(t){return t>1?0:t<-1?fx:Math.acos(t)}function zx(t){return t>1?dx:t<-1?-dx:Math.asin(t)}function $x(t){return(t=Dx(t/2))*t}function Rx(){}var Ox=new ax,Tx=new ax,Nx,Lx,Px,qx;var Ix={point:Rx,lineStart:Rx,lineEnd:Rx,polygonStart:function(){Ix.lineStart=Ux;Ix.lineEnd=Yx},polygonEnd:function(){Ix.lineStart=Ix.lineEnd=Ix.point=Rx;Ox.add(yx(Tx));Tx=new ax},result:function(){var t=Ox/2;Ox=new ax;return t}};function Ux(){Ix.point=jx}function jx(t,e){Ix.point=Gx;Nx=Px=t,Lx=qx=e}function Gx(t,e){Tx.add(qx*t-Px*e);Px=t,qx=e}function Yx(){Gx(Nx,Lx)}const Wx=Ix;var Xx=Infinity,Hx=Xx,Vx=-Xx,Qx=Vx;var Kx={point:Zx,lineStart:Rx,lineEnd:Rx,polygonStart:Rx,polygonEnd:Rx,result:function(){var t=[[Xx,Hx],[Vx,Qx]];Vx=Qx=-(Hx=Xx=Infinity);return t}};function Zx(t,e){if(tVx)Vx=t;if(eQx)Qx=e}const Jx=Kx;var t_=0,e_=0,n_=0,i_=0,r_=0,s_=0,a_=0,o_=0,u_=0,l_,c_,f_,d_;var h_={point:p_,lineStart:m_,lineEnd:v_,polygonStart:function(){h_.lineStart=b_;h_.lineEnd=x_},polygonEnd:function(){h_.point=p_;h_.lineStart=m_;h_.lineEnd=v_},result:function(){var t=u_?[a_/u_,o_/u_]:s_?[i_/s_,r_/s_]:n_?[t_/n_,e_/n_]:[NaN,NaN];t_=e_=n_=i_=r_=s_=a_=o_=u_=0;return t}};function p_(t,e){t_+=t;e_+=e;++n_}function m_(){h_.point=g_}function g_(t,e){h_.point=y_;p_(f_=t,d_=e)}function y_(t,e){var n=t-f_,i=e-d_,r=Fx(n*n+i*i);i_+=r*(f_+t)/2;r_+=r*(d_+e)/2;s_+=r;p_(f_=t,d_=e)}function v_(){h_.point=p_}function b_(){h_.point=__}function x_(){w_(l_,c_)}function __(t,e){h_.point=w_;p_(l_=f_=t,c_=d_=e)}function w_(t,e){var n=t-f_,i=e-d_,r=Fx(n*n+i*i);i_+=r*(f_+t)/2;r_+=r*(d_+e)/2;s_+=r;r=d_*t-f_*e;a_+=r*(f_+t);o_+=r*(d_+e);u_+=r*3;p_(f_=t,d_=e)}const A_=h_;function k_(t){this._context=t}k_.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line===0)this._context.closePath();this._point=NaN},point:function(t,e){switch(this._point){case 0:{this._context.moveTo(t,e);this._point=1;break}case 1:{this._context.lineTo(t,e);break}default:{this._context.moveTo(t+this._radius,e);this._context.arc(t,e,this._radius,0,px);break}}},result:Rx};var E_=new ax,M_,D_,C_,F_,S_;var B_={point:Rx,lineStart:function(){B_.point=z_},lineEnd:function(){if(M_)$_(D_,C_);B_.point=Rx},polygonStart:function(){M_=true},polygonEnd:function(){M_=null},result:function(){var t=+E_;E_=new ax;return t}};function z_(t,e){B_.point=$_;D_=F_=t,C_=S_=e}function $_(t,e){F_-=t,S_-=e;E_.add(Fx(F_*F_+S_*S_));F_=t,S_=e}const R_=B_;let O_,T_,N_,L_;class P_{constructor(t){this._append=t==null?q_:I_(t);this._radius=4.5;this._=""}pointRadius(t){this._radius=+t;return this}polygonStart(){this._line=0}polygonEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){if(this._line===0)this._+="Z";this._point=NaN}point(t,e){switch(this._point){case 0:{this._append`M${t},${e}`;this._point=1;break}case 1:{this._append`L${t},${e}`;break}default:{this._append`M${t},${e}`;if(this._radius!==N_||this._append!==T_){const t=this._radius;const e=this._;this._="";this._append`m0,${t}a${t},${t} 0 1,1 0,${-2*t}a${t},${t} 0 1,1 0,${2*t}z`;N_=t;T_=this._append;L_=this._;this._=e}this._+=L_;break}}}result(){const t=this._;this._="";return t.length?t:null}}function q_(t){let e=1;this._+=t[0];for(const n=t.length;e=0))throw new RangeError(`invalid digits: ${t}`);if(e>15)return q_;if(e!==O_){const t=10**e;O_=e;T_=function e(n){let i=1;this._+=n[0];for(const r=n.length;i=0))throw new RangeError(`invalid digits: ${t}`);n=e}if(e===null)s=new P_(n);return a};return a.projection(t).digits(n).context(e)}function j_(){var t=[],e;return{point:function(t,n,i){e.push([t,n,i])},lineStart:function(){t.push(e=[])},lineEnd:Rx,rejoin:function(){if(t.length>1)t.push(t.pop().concat(t.shift()))},result:function(){var n=t;t=[];e=null;return n}}}function G_(t,e){return yx(t[0]-e[0])=0;--o)r.point((f=c[o])[0],f[1])}else{i(d.x,d.p.x,-1,r)}d=d.p}d=d.o;c=d.z;h=!h}while(!d.v);r.lineEnd()}}function X_(t){if(!(e=t.length))return;var e,n=0,i=t[0],r;while(++n=0?1:-1,M=E*k,D=M>fx,C=g*w;u.add(bx(C*E*Dx(M),y*A+C*xx(M)));a+=D?k+E*px:k;if(D^p>=n^x>=n){var F=K_(V_(h),V_(b));tw(F);var S=K_(s,F);tw(S);var B=(D^k>=0?-1:1)*zx(S[2]);if(i>B||i===B&&(F[0]||F[1])){o+=D^k>=0?1:-1}}}}return(a<-lx||a0){if(!u)r.polygonStart(),u=true;r.lineStart();for(n=0;n1&&t&2)e.push(e.pop().concat(e.shift()));c.push(e.filter(aw))}return d}}function aw(t){return t.length>1}function ow(t,e){return((t=t.x)[0]<0?t[1]-dx-lx:dx-t[1])-((e=e.x)[0]<0?e[1]-dx-lx:dx-e[1])}const uw=sw((function(){return true}),lw,fw,[-fx,-dx]);function lw(t){var e=NaN,n=NaN,i=NaN,r;return{lineStart:function(){t.lineStart();r=1},point:function(s,a){var o=s>0?fx:-fx,u=yx(s-e);if(yx(u-fx)0?dx:-dx);t.point(i,n);t.lineEnd();t.lineStart();t.point(o,n);t.point(s,n);r=0}else if(i!==o&&u>=fx){if(yx(e-i)lx?vx((Dx(e)*(s=xx(i))*Dx(n)-Dx(i)*(r=xx(e))*Dx(t))/(r*s*a)):(e+i)/2}function fw(t,e,n,i){var r;if(t==null){r=n*dx;i.point(-fx,r);i.point(0,r);i.point(fx,r);i.point(fx,0);i.point(fx,-r);i.point(0,-r);i.point(-fx,-r);i.point(-fx,0);i.point(-fx,r)}else if(yx(t[0]-e[0])>lx){var s=t[0]0?rs)r+=i*px}for(var l,c=r;i>0?c>s:c0,r=yx(e)>lx;function s(e,i,r,s){dw(s,t,n,r,e,i)}function a(t,n){return xx(t)*xx(n)>e}function o(t){var e,n,s,o,c;return{lineStart:function(){o=s=false;c=1},point:function(f,d){var h=[f,d],p,m=a(f,d),g=i?m?0:l(f,d):m?l(f+(f<0?fx:-fx),d):0;if(!e&&(o=s=m))t.lineStart();if(m!==s){p=u(e,h);if(!p||G_(e,p)||G_(h,p))h[2]=1}if(m!==s){c=0;if(m){t.lineStart();p=u(h,e);t.point(p[0],p[1])}else{p=u(e,h);t.point(p[0],p[1],2);t.lineEnd()}e=p}else if(r&&e&&i^m){var y;if(!(g&n)&&(y=u(h,e,true))){c=0;if(i){t.lineStart();t.point(y[0][0],y[0][1]);t.point(y[1][0],y[1][1]);t.lineEnd()}else{t.point(y[1][0],y[1][1]);t.lineEnd();t.lineStart();t.point(y[0][0],y[0][1],3)}}}if(m&&(!e||!G_(e,h))){t.point(h[0],h[1])}e=h,s=m,n=g},lineEnd:function(){if(s)t.lineEnd();e=null},clean:function(){return c|(o&&s)<<1}}}function u(t,n,i){var r=V_(t),s=V_(n);var a=[1,0,0],o=K_(r,s),u=Q_(o,o),l=o[0],c=u-l*l;if(!c)return!i&&t;var f=e*u/c,d=-e*l/c,h=K_(a,o),p=J_(a,f),m=J_(o,d);Z_(p,m);var g=h,y=Q_(p,g),v=Q_(g,g),b=y*y-v*(Q_(p,p)-1);if(b<0)return;var x=Fx(b),_=J_(g,(-y-x)/v);Z_(_,p);_=H_(_);if(!i)return _;var w=t[0],A=n[0],k=t[1],E=n[1],M;if(A0^_[1]<(yx(_[0]-w)fx^(w<=_[0]&&_[0]<=A)){var S=J_(g,(-y+x)/v);Z_(S,p);return[_,H_(S)]}}function l(e,n){var r=i?t:fx-t,s=0;if(e<-r)s|=1;else if(e>r)s|=2;if(n<-r)s|=4;else if(n>r)s|=8;return s}return sw(a,o,s,i?[0,-t]:[-fx,t-fx])}function gw(t,e,n,i,r,s){var a=t[0],o=t[1],u=e[0],l=e[1],c=0,f=1,d=u-a,h=l-o,p;p=n-a;if(!d&&p>0)return;p/=d;if(d<0){if(p0){if(p>f)return;if(p>c)c=p}p=r-a;if(!d&&p<0)return;p/=d;if(d<0){if(p>f)return;if(p>c)c=p}else if(d>0){if(p0)return;p/=h;if(h<0){if(p0){if(p>f)return;if(p>c)c=p}p=s-o;if(!h&&p<0)return;p/=h;if(h<0){if(p>f)return;if(p>c)c=p}else if(h>0){if(p0)t[0]=a+c*d,t[1]=o+c*h;if(f<1)e[0]=a+f*d,e[1]=o+f*h;return true}var yw=1e9,vw=-yw;function bw(t,e,n,i){function r(r,s){return t<=r&&r<=n&&e<=s&&s<=i}function s(r,s,o,l){var c=0,f=0;if(r==null||(c=a(r,o))!==(f=a(s,o))||u(r,s)<0^o>0){do{l.point(c===0||c===3?t:n,c>1?i:e)}while((c=(c+o+4)%4)!==f)}else{l.point(s[0],s[1])}}function a(i,r){return yx(i[0]-t)0?0:3:yx(i[0]-n)0?2:1:yx(i[1]-e)0?1:0:r>0?3:2}function o(t,e){return u(t.x,e.x)}function u(t,e){var n=a(t,1),i=a(e,1);return n!==i?n-i:n===0?e[1]-t[1]:n===1?t[0]-e[0]:n===2?t[1]-e[1]:e[0]-t[0]}return function(a){var u=a,l=j_(),c,f,d,h,p,m,g,y,v,b,x;var _={point:w,lineStart:M,lineEnd:D,polygonStart:k,polygonEnd:E};function w(t,e){if(r(t,e))u.point(t,e)}function A(){var e=0;for(var n=0,r=f.length;ni&&(d-l)*(i-c)>(h-c)*(t-l))++e}else{if(h<=i&&(d-l)*(i-c)<(h-c)*(t-l))--e}}}return e}function k(){u=l,c=[],f=[],x=true}function E(){var t=A(),e=x&&t,n=(c=rw(c)).length;if(e||n){a.polygonStart();if(e){a.lineStart();s(null,null,1,a);a.lineEnd()}if(n){W_(c,o,t,s,a)}a.polygonEnd()}u=a,c=f=d=null}function M(){_.point=C;if(f)f.push(d=[]);b=true;v=false;g=y=NaN}function D(){if(c){C(h,p);if(m&&v)l.rejoin();c.push(l.result())}_.point=w;if(v)u.lineEnd()}function C(s,a){var o=r(s,a);if(f)d.push([s,a]);if(b){h=s,p=a,m=o;b=false;if(o){u.lineStart();u.point(s,a)}}else{if(o&&v)u.point(s,a);else{var l=[g=Math.max(vw,Math.min(yw,g)),y=Math.max(vw,Math.min(yw,y))],c=[s=Math.max(vw,Math.min(yw,s)),a=Math.max(vw,Math.min(yw,a))];if(gw(l,c,t,e,n,i)){if(!v){u.lineStart();u.point(l[0],l[1])}u.point(c[0],c[1]);if(!o)u.lineEnd();x=false}else if(o){u.lineStart();u.point(s,a);x=false}}}g=s,y=a,v=o}return _}}function xw(t,e){function n(n,i){return n=t(n,i),e(n[0],n[1])}if(t.invert&&e.invert)n.invert=function(n,i){return n=e.invert(n,i),n&&t.invert(n[0],n[1])};return n}function _w(t,e){if(yx(t)>fx)t-=Math.round(t/px)*px;return[t,e]}_w.invert=_w;function ww(t,e,n){return(t%=px)?e||n?xw(kw(t),Ew(e,n)):kw(t):e||n?Ew(e,n):_w}function Aw(t){return function(e,n){e+=t;if(yx(e)>fx)e-=Math.round(e/px)*px;return[e,n]}}function kw(t){var e=Aw(t);e.invert=Aw(-t);return e}function Ew(t,e){var n=xx(t),i=Dx(t),r=xx(e),s=Dx(e);function a(t,e){var a=xx(e),o=xx(t)*a,u=Dx(t)*a,l=Dx(e),c=l*n+o*i;return[bx(u*r-c*s,o*n-l*i),zx(c*r+u*s)]}a.invert=function(t,e){var a=xx(e),o=xx(t)*a,u=Dx(t)*a,l=Dx(e),c=l*r-u*s;return[bx(u*r+l*s,o*n+c*i),zx(c*n-o*i)]};return a}function Mw(t){t=ww(t[0]*gx,t[1]*gx,t.length>2?t[2]*gx:0);function e(e){e=t(e[0]*gx,e[1]*gx);return e[0]*=mx,e[1]*=mx,e}e.invert=function(e){e=t.invert(e[0]*gx,e[1]*gx);return e[0]*=mx,e[1]*=mx,e};return e}function Dw(t){return{stream:Cw(t)}}function Cw(t){return function(e){var n=new Fw;for(var i in t)n[i]=t[i];n.stream=e;return n}}function Fw(){}Fw.prototype={constructor:Fw,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};function Sw(t,e,n){var i=t.clipExtent&&t.clipExtent();t.scale(150).translate([0,0]);if(i!=null)t.clipExtent(null);sx(n,t.stream(Jx));e(Jx.result());if(i!=null)t.clipExtent(i);return t}function Bw(t,e,n){return Sw(t,(function(n){var i=e[1][0]-e[0][0],r=e[1][1]-e[0][1],s=Math.min(i/(n[1][0]-n[0][0]),r/(n[1][1]-n[0][1])),a=+e[0][0]+(i-s*(n[1][0]+n[0][0]))/2,o=+e[0][1]+(r-s*(n[1][1]+n[0][1]))/2;t.scale(150*s).translate([a,o])}),n)}function zw(t,e,n){return Bw(t,[[0,0],e],n)}function $w(t,e,n){return Sw(t,(function(n){var i=+e,r=i/(n[1][0]-n[0][0]),s=(i-r*(n[1][0]+n[0][0]))/2,a=-r*n[0][1];t.scale(150*r).translate([s,a])}),n)}function Rw(t,e,n){return Sw(t,(function(n){var i=+e,r=i/(n[1][1]-n[0][1]),s=-r*n[0][0],a=(i-r*(n[1][1]+n[0][1]))/2;t.scale(150*r).translate([s,a])}),n)}var Ow=16,Tw=xx(30*gx);function Nw(t,e){return+e?Pw(t,e):Lw(t)}function Lw(t){return Cw({point:function(e,n){e=t(e,n);this.stream.point(e[0],e[1])}})}function Pw(t,e){function n(i,r,s,a,o,u,l,c,f,d,h,p,m,g){var y=l-i,v=c-r,b=y*y+v*v;if(b>4*e&&m--){var x=a+d,_=o+h,w=u+p,A=Fx(x*x+_*_+w*w),k=zx(w/=A),E=yx(yx(w)-1)e||yx((y*F+v*S)/b-.5)>.3||a*d+o*h+u*p2?t[2]%360*gx:0,F()):[o*mx,u*mx,l*mx]};D.angle=function(t){return arguments.length?(f=t%360*gx,F()):f*mx};D.reflectX=function(t){return arguments.length?(d=t?-1:1,F()):d<0};D.reflectY=function(t){return arguments.length?(h=t?-1:1,F()):h<0};D.precision=function(t){return arguments.length?(w=Nw(A,_=t*t),S()):Fx(_)};D.fitExtent=function(t,e){return Bw(D,t,e)};D.fitSize=function(t,e){return zw(D,t,e)};D.fitWidth=function(t,e){return $w(D,t,e)};D.fitHeight=function(t,e){return Rw(D,t,e)};function F(){var t=jw(n,0,0,d,h,f).apply(null,e(s,a)),p=jw(n,i-t[0],r-t[1],d,h,f);c=ww(o,u,l);A=xw(e,p);k=xw(c,A);w=Nw(A,_);return S()}function S(){E=M=null;return D}return function(){e=t.apply(this,arguments);D.invert=e.invert&&C;return F()}}function Ww(t){var e=0,n=fx/3,i=Yw(t),r=i(e,n);r.parallels=function(t){return arguments.length?i(e=t[0]*gx,n=t[1]*gx):[e*mx,n*mx]};return r}function Xw(t){var e=xx(t);function n(t,n){return[t*e,Dx(n)/e]}n.invert=function(t,n){return[t/e,zx(n*e)]};return n}function Hw(t,e){var n=Dx(t),i=(n+Dx(e))/2;if(yx(i)=.12&&o<.234&&s>=-.425&&s<-.214?r:o>=.166&&o<.234&&s>=-.214&&s<-.115?a:n).invert(t)};c.stream=function(i){return t&&e===i?t:t=Kw([n.stream(e=i),r.stream(i),a.stream(i)])};c.precision=function(t){if(!arguments.length)return n.precision();n.precision(t),r.precision(t),a.precision(t);return f()};c.scale=function(t){if(!arguments.length)return n.scale();n.scale(t),r.scale(t*.35),a.scale(t);return c.translate(n.translate())};c.translate=function(t){if(!arguments.length)return n.translate();var e=n.scale(),u=+t[0],c=+t[1];i=n.translate(t).clipExtent([[u-.455*e,c-.238*e],[u+.455*e,c+.238*e]]).stream(l);s=r.translate([u-.307*e,c+.201*e]).clipExtent([[u-.425*e+lx,c+.12*e+lx],[u-.214*e-lx,c+.234*e-lx]]).stream(l);o=a.translate([u-.205*e,c+.212*e]).clipExtent([[u-.214*e+lx,c+.166*e+lx],[u-.115*e-lx,c+.234*e-lx]]).stream(l);return f()};c.fitExtent=function(t,e){return Bw(c,t,e)};c.fitSize=function(t,e){return zw(c,t,e)};c.fitWidth=function(t,e){return $w(c,t,e)};c.fitHeight=function(t,e){return Rw(c,t,e)};function f(){t=e=null;return c}return c.scale(1070)}function Jw(t){return function(e,n){var i=xx(e),r=xx(n),s=t(i*r);if(s===Infinity)return[2,0];return[s*r*Dx(e),s*Dx(n)]}}function tA(t){return function(e,n){var i=Fx(e*e+n*n),r=t(i),s=Dx(r),a=xx(r);return[bx(e*s,i*a),zx(i&&n*s/i)]}}var eA=Jw((function(t){return Fx(2/(1+t))}));eA.invert=tA((function(t){return 2*zx(t/2)}));function nA(){return Gw(eA).scale(124.75).clipAngle(180-.001)}var iA=Jw((function(t){return(t=Bx(t))&&t/Dx(t)}));iA.invert=tA((function(t){return t}));function rA(){return Gw(iA).scale(79.4188).clipAngle(180-.001)}function sA(t,e){return[t,Ex(Sx((dx+e)/2))]}sA.invert=function(t,e){return[t,2*vx(wx(e))-dx]};function aA(){return oA(sA).scale(961/px)}function oA(t){var e=Gw(t),n=e.center,i=e.scale,r=e.translate,s=e.clipExtent,a=null,o,u,l;e.scale=function(t){return arguments.length?(i(t),c()):i()};e.translate=function(t){return arguments.length?(r(t),c()):r()};e.center=function(t){return arguments.length?(n(t),c()):n()};e.clipExtent=function(t){return arguments.length?(t==null?a=o=u=l=null:(a=+t[0][0],o=+t[0][1],u=+t[1][0],l=+t[1][1]),c()):a==null?null:[[a,o],[u,l]]};function c(){var n=fx*i(),r=e(Mw(e.rotate()).invert([0,0]));return s(a==null?[[r[0]-n,r[1]-n],[r[0]+n,r[1]+n]]:t===sA?[[Math.max(r[0]-n,a),o],[Math.min(r[0]+n,u),l]]:[[a,Math.max(r[1]-n,o)],[u,Math.min(r[1]+n,l)]])}return c()}function uA(t){return Sx((dx+t)/2)}function lA(t,e){var n=xx(t),i=t===e?Dx(t):Ex(n/xx(e))/Ex(uA(e)/uA(t)),r=n*Mx(uA(t),i)/i;if(!i)return sA;function s(t,e){if(r>0){if(e<-dx+lx)e=-dx+lx}else{if(e>dx-lx)e=dx-lx}var n=r/Mx(uA(e),i);return[n*Dx(i*t),r-n*xx(i*t)]}s.invert=function(t,e){var n=r-e,s=Cx(i)*Fx(t*t+n*n),a=bx(t,yx(n))*Cx(n);if(n*i<0)a-=fx*Cx(t)*Cx(n);return[a/i,2*vx(Mx(r/s,1/i))-dx]};return s}function cA(){return Ww(lA).scale(109.5).parallels([30,30])}function fA(t,e){return[t,e]}fA.invert=fA;function dA(){return Gw(fA).scale(152.63)}function hA(t,e){var n=xx(t),i=t===e?Dx(t):(n-xx(e))/(e-t),r=n/i+t;if(yx(i)lx&&--i>0);return[t/(.8707+(s=n*n)*(-.131979+s*(-.013791+s*s*s*(.003971-.001529*s)))),n]};function DA(){return Gw(MA).scale(175.295)}function CA(t,e){return[xx(e)*Dx(t),Dx(e)]}CA.invert=tA(zx);function FA(){return Gw(CA).scale(249.5).clipAngle(90+lx)}function SA(t,e){var n=xx(e),i=1+xx(t)*n;return[n*Dx(t)/i,Dx(e)/i]}SA.invert=tA((function(t){return 2*vx(t)}));function BA(){return Gw(SA).scale(250).clipAngle(142)}function zA(t,e){return[Ex(Sx((dx+e)/2)),-t]}zA.invert=function(t,e){return[-e,2*vx(wx(t))-dx]};function $A(){var t=oA(zA),e=t.center,n=t.rotate;t.center=function(t){return arguments.length?e([-t[1],t[0]]):(t=e(),[t[1],-t[0]])};t.rotate=function(t){return arguments.length?n([t[0],t[1],t.length>2?t[2]+90:90]):(t=n(),[t[0],t[1],t[2]-90])};return n([0,0,90]).scale(159.155)}var RA=Math.abs;var OA=Math.atan;var TA=Math.atan2;var NA=Math.ceil;var LA=Math.cos;var PA=Math.exp;var qA=Math.floor;var IA=Math.log;var UA=Math.max;var jA=Math.min;var GA=Math.pow;var YA=Math.round;var WA=Math.sign||function(t){return t>0?1:t<0?-1:0};var XA=Math.sin;var HA=Math.tan;var VA=1e-6;var QA=1e-12;var KA=Math.PI;var ZA=KA/2;var JA=KA/4;var tk=Math.SQRT1_2;var ek=lk(2);var nk=lk(KA);var ik=KA*2;var rk=180/KA;var sk=KA/180;function ak(t){return t?t/Math.sin(t):1}function ok(t){return t>1?ZA:t<-1?-ZA:Math.asin(t)}function uk(t){return t>1?0:t<-1?KA:Math.acos(t)}function lk(t){return t>0?Math.sqrt(t):0}function ck(t){t=PA(2*t);return(t-1)/(t+1)}function fk(t){return(PA(t)-PA(-t))/2}function dk(t){return(PA(t)+PA(-t))/2}function hk(t){return IA(t+lk(t*t+1))}function pk(t){return IA(t+lk(t*t-1))}function mk(t,e){var n=t*XA(e),i=30,r;do{e-=r=(e+XA(e)-n)/(1+LA(e))}while(RA(r)>VA&&--i>0);return e/2}function gk(t,e,n){function i(i,r){return[t*i*LA(r=mk(n,r)),e*XA(r)]}i.invert=function(i,r){return r=ok(r/e),[i/(t*LA(r)),ok((2*r+XA(2*r))/n)]};return i}var yk=gk(ek/ZA,ek,KA);function vk(){return Gw(yk).scale(169.529)}const bk=U_();const xk=["clipAngle","clipExtent","scale","translate","center","rotate","parallels","precision","reflectX","reflectY","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function _k(t,e){return function n(){const i=e();i.type=t;i.path=U_().projection(i);i.copy=i.copy||function(){const t=n();xk.forEach((e=>{if(i[e])t[e](i[e]())}));t.path.pointRadius(i.path.pointRadius());return t};return Ul(i)}}function wk(t,e){if(!t||typeof t!=="string"){throw new Error("Projection type must be a name string.")}t=t.toLowerCase();if(arguments.length>1){kk[t]=_k(t,e);return this}else{return kk[t]||null}}function Ak(t){return t&&t.path||bk}const kk={albers:Qw,albersusa:Zw,azimuthalequalarea:nA,azimuthalequidistant:rA,conicconformal:cA,conicequalarea:Vw,conicequidistant:pA,equalEarth:wA,equirectangular:dA,gnomonic:kA,identity:EA,mercator:aA,mollweide:vk,naturalEarth1:DA,orthographic:FA,stereographic:BA,transversemercator:$A};for(const yW in kk){wk(yW,kk[yW])}function Ek(t,e,n){var i=(0,es.A)(t,e-lx,n).concat(e);return function(t){return i.map((function(e){return[t,e]}))}}function Mk(t,e,n){var i=(0,es.A)(t,e-lx,n).concat(e);return function(t){return i.map((function(e){return[e,t]}))}}function Dk(){var t,e,n,i,r,s,a,o,u=10,l=u,c=90,f=360,d,h,p,m,g=2.5;function y(){return{type:"MultiLineString",coordinates:v()}}function v(){return(0,es.A)(_x(i/c)*c,n,c).map(p).concat((0,es.A)(_x(o/f)*f,a,f).map(m)).concat((0,es.A)(_x(e/u)*u,t,u).filter((function(t){return yx(t%c)>lx})).map(d)).concat((0,es.A)(_x(s/l)*l,r,l).filter((function(t){return yx(t%f)>lx})).map(h))}y.lines=function(){return v().map((function(t){return{type:"LineString",coordinates:t}}))};y.outline=function(){return{type:"Polygon",coordinates:[p(i).concat(m(a).slice(1),p(n).reverse().slice(1),m(o).reverse().slice(1))]}};y.extent=function(t){if(!arguments.length)return y.extentMinor();return y.extentMajor(t).extentMinor(t)};y.extentMajor=function(t){if(!arguments.length)return[[i,o],[n,a]];i=+t[0][0],n=+t[1][0];o=+t[0][1],a=+t[1][1];if(i>n)t=i,i=n,n=t;if(o>a)t=o,o=a,a=t;return y.precision(g)};y.extentMinor=function(n){if(!arguments.length)return[[e,s],[t,r]];e=+n[0][0],t=+n[1][0];s=+n[0][1],r=+n[1][1];if(e>t)n=e,e=t,t=n;if(s>r)n=s,s=r,r=n;return y.precision(g)};y.step=function(t){if(!arguments.length)return y.stepMinor();return y.stepMajor(t).stepMinor(t)};y.stepMajor=function(t){if(!arguments.length)return[c,f];c=+t[0],f=+t[1];return y};y.stepMinor=function(t){if(!arguments.length)return[u,l];u=+t[0],l=+t[1];return y};y.precision=function(u){if(!arguments.length)return g;g=+u;d=Ek(s,r,90);h=Mk(e,t,g);p=Ek(o,a,90);m=Mk(i,n,g);return y};return y.extentMajor([[-180,-90+lx],[180,90-lx]]).extentMinor([[-180,-80-lx],[180,80+lx]])}function Ck(){return Dk()()}var Fk=n(33844);function Sk(){}const Bk=[[],[[[1,1.5],[.5,1]]],[[[1.5,1],[1,1.5]]],[[[1.5,1],[.5,1]]],[[[1,.5],[1.5,1]]],[[[1,1.5],[.5,1]],[[1,.5],[1.5,1]]],[[[1,.5],[1,1.5]]],[[[1,.5],[.5,1]]],[[[.5,1],[1,.5]]],[[[1,1.5],[1,.5]]],[[[.5,1],[1,.5]],[[1.5,1],[1,1.5]]],[[[1.5,1],[1,.5]]],[[[.5,1],[1.5,1]]],[[[1,1.5],[1.5,1]]],[[[.5,1],[1,1.5]]],[]];function zk(){var t=1,e=1,n=o;function i(t,e){return e.map((e=>r(t,e)))}function r(t,e){var i=[],r=[];s(t,e,(s=>{n(s,t,e);if($k(s)>0)i.push([s]);else r.push(s)}));r.forEach((t=>{for(var e=0,n=i.length,r;e=i;Bk[f<<1].forEach(p);while(++u=i;Bk[c|f<<1].forEach(p)}Bk[f<<0].forEach(p);while(++l=i;d=n[l*t]>=i;Bk[f<<1|d<<2].forEach(p);while(++u=i;h=d,d=n[l*t+u+1]>=i;Bk[c|f<<1|d<<2|h<<3].forEach(p)}Bk[f|d<<3].forEach(p)}u=-1;d=n[l*t]>=i;Bk[d<<2].forEach(p);while(++u=i;Bk[d<<2|h<<3].forEach(p)}Bk[d<<3].forEach(p);function p(t){var e=[t[0][0]+u,t[0][1]+l],n=[t[1][0]+u,t[1][1]+l],i=a(e),c=a(n),f,d;if(f=o[i]){if(d=s[c]){delete o[f.end];delete s[d.start];if(f===d){f.ring.push(n);r(f.ring)}else{s[f.start]=o[d.end]={start:f.start,end:d.end,ring:f.ring.concat(d.ring)}}}else{delete o[f.end];f.ring.push(n);o[f.end=c]=f}}else if(f=s[c]){if(d=o[i]){delete s[f.start];delete o[d.end];if(f===d){f.ring.push(n);r(f.ring)}else{s[d.start]=o[f.end]={start:d.start,end:f.end,ring:d.ring.concat(f.ring)}}}else{delete s[f.start];f.ring.unshift(e);s[f.start=i]=f}}else{s[i]=o[c]={start:i,end:c,ring:[e,n]}}}}function a(e){return e[0]*2+e[1]*(t+1)*4}function o(n,i,r){n.forEach((n=>{var s=n[0],a=n[1],o=s|0,u=a|0,l,c=i[u*t+o];if(s>0&&s0&&a=0&&s>=0))(0,p.z3)("invalid size");return t=r,e=s,i};i.smooth=function(t){return arguments.length?(n=t?o:Sk,i):n===o};return i}function $k(t){var e=0,n=t.length,i=t[n-1][1]*t[0][0]-t[n-1][0]*t[0][1];while(++ei!==h>i&&n<(d-l)*(i-c)/(h-c)+l)r=-r}return r}function Tk(t,e,n){var i;return Nk(t,e,n)&&Lk(t[i=+(t[0]===e[0])],n[i],e[i])}function Nk(t,e,n){return(e[0]-t[0])*(n[1]-t[1])===(n[0]-t[0])*(e[1]-t[1])}function Lk(t,e,n){return t<=e&&e<=n||n<=e&&e<=t}function Pk(t,e,n){return function(i){var r=(0,p.Xx)(i),s=n?Math.min(r[0],0):r[0],a=r[1],o=a-s,u=e?(0,N.sG)(s,a,t):o/(t+1);return(0,es.A)(s+u,a,u)}}function qk(t){zi.call(this,null,t)}qk.Definition={type:"Isocontour",metadata:{generates:true},params:[{name:"field",type:"field"},{name:"thresholds",type:"number",array:true},{name:"levels",type:"number"},{name:"nice",type:"boolean",default:false},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"zero",type:"boolean",default:true},{name:"smooth",type:"boolean",default:true},{name:"scale",type:"number",expr:true},{name:"translate",type:"number",array:true,expr:true},{name:"as",type:"string",null:true,default:"contour"}]};(0,p.B)(qk,zi,{transform(t,e){if(this.value&&!e.changed()&&!t.modified()){return e.StopPropagation}var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=t.field||p.D_,s=zk().smooth(t.smooth!==false),a=t.thresholds||Ik(i,r,t),o=t.as===null?null:t.as||"contour",u=[];i.forEach((e=>{const n=r(e);const i=s.size([n.width,n.height])(n.values,(0,p.cy)(a)?a:a(n.values));Uk(i,n,e,t);i.forEach((t=>{u.push(_n(e,bn(o!=null?{[o]:t}:t)))}))}));if(this.value)n.rem=this.value;this.value=n.source=n.add=u;return n}});function Ik(t,e,n){const i=Pk(n.levels||10,n.nice,n.zero!==false);return n.resolve!=="shared"?i:i(t.map((t=>(0,Ni.A)(e(t).values))))}function Uk(t,e,n,i){let r=i.scale||e.scale,s=i.translate||e.translate;if((0,p.Tn)(r))r=r(n,i);if((0,p.Tn)(s))s=s(n,i);if((r===1||r==null)&&!s)return;const a=((0,p.Et)(r)?r:r[0])||1,o=((0,p.Et)(r)?r:r[1])||1,u=s&&s[0]||0,l=s&&s[1]||0;t.forEach(jk(e,a,o,u,l))}function jk(t,e,n,i,r){const s=t.x1||0,a=t.y1||0,o=e*n<0;function u(t){t.forEach(l)}function l(t){if(o)t.reverse();t.forEach(c)}function c(t){t[0]=(t[0]-s)*e+i;t[1]=(t[1]-a)*n+r}return function(t){t.coordinates.forEach(u);return t}}function Gk(t,e,n){const i=t>=0?t:er(e,n);return Math.round((Math.sqrt(4*i*i+1)-1)/2)}function Yk(t){return(0,p.Tn)(t)?t:(0,p.dY)(+t)}function Wk(){var t=t=>t[0],e=t=>t[1],n=p.xH,i=[-1,-1],r=960,s=500,a=2;function o(o,u){const l=Gk(i[0],o,t)>>a,c=Gk(i[1],o,e)>>a,f=l?l+2:0,d=c?c+2:0,h=2*f+(r>>a),p=2*d+(s>>a),m=new Float32Array(h*p),g=new Float32Array(h*p);let y=m;o.forEach((i=>{const r=f+(+t(i)>>a),s=d+(+e(i)>>a);if(r>=0&&r=0&&s0&&c>0){Xk(h,p,m,g,l);Hk(h,p,g,m,c);Xk(h,p,m,g,l);Hk(h,p,g,m,c);Xk(h,p,m,g,l);Hk(h,p,g,m,c)}else if(l>0){Xk(h,p,m,g,l);Xk(h,p,g,m,l);Xk(h,p,m,g,l);y=g}else if(c>0){Hk(h,p,m,g,c);Hk(h,p,g,m,c);Hk(h,p,m,g,c);y=g}const v=u?Math.pow(2,-2*a):1/tb(y);for(let t=0,e=h*p;t>a),y2:d+(s>>a)}}o.x=function(e){return arguments.length?(t=Yk(e),o):t};o.y=function(t){return arguments.length?(e=Yk(t),o):e};o.weight=function(t){return arguments.length?(n=Yk(t),o):n};o.size=function(t){if(!arguments.length)return[r,s];var e=+t[0],n=+t[1];if(!(e>=0&&n>=0))(0,p.z3)("invalid size");return r=e,s=n,o};o.cellSize=function(t){if(!arguments.length)return 1<=1))(0,p.z3)("invalid cell size");a=Math.floor(Math.log(t)/Math.LN2);return o};o.bandwidth=function(t){if(!arguments.length)return i;t=(0,p.YO)(t);if(t.length===1)t=[+t[0],+t[0]];if(t.length!==2)(0,p.z3)("invalid bandwidth");return i=t,o};return o}function Xk(t,e,n,i,r){const s=(r<<1)+1;for(let a=0;a=r){if(e>=s){o-=n[e-s+a*t]}i[e-r+a*t]=o/Math.min(e+1,t-1+s-e,s)}}}}function Hk(t,e,n,i,r){const s=(r<<1)+1;for(let a=0;a=r){if(o>=s){u-=n[a+(o-s)*t]}i[a+(o-r)*t]=u/Math.min(o+1,e-1+s-o,s)}}}}function Vk(t){zi.call(this,null,t)}Vk.Definition={type:"KDE2D",metadata:{generates:true},params:[{name:"size",type:"number",array:true,length:2,required:true},{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"weight",type:"field"},{name:"groupby",type:"field",array:true},{name:"cellSize",type:"number"},{name:"bandwidth",type:"number",array:true,length:2},{name:"counts",type:"boolean",default:false},{name:"as",type:"string",default:"grid"}]};const Qk=["x","y","weight","size","cellSize","bandwidth"];function Kk(t,e){Qk.forEach((n=>e[n]!=null?t[n](e[n]):0));return t}(0,p.B)(Vk,zi,{transform(t,e){if(this.value&&!e.changed()&&!t.modified())return e.StopPropagation;var n=e.fork(e.NO_SOURCE|e.NO_FIELDS),i=e.materialize(e.SOURCE).source,r=Zk(i,t.groupby),s=(t.groupby||[]).map(p.N6),a=Kk(Wk(),t),o=t.as||"grid",u=[];function l(t,e){for(let n=0;nbn(l({[o]:a(e,t.counts)},e.dims))));if(this.value)n.rem=this.value;this.value=n.source=n.add=u;return n}});function Zk(t,e){var n=[],i=t=>t(o),r,s,a,o,u,l;if(e==null){n.push(t)}else{for(r={},s=0,a=t.length;sn.push(o(t))))}if(s&&a){e.visit(u,(t=>{var e=s(t),n=a(t);if(e!=null&&n!=null&&(e=+e)===e&&(n=+n)===n){i.push([e,n])}}));n=n.concat({type:tE,geometry:{type:nE,coordinates:i}})}this.value={type:eE,features:n}}});function rE(t){zi.call(this,null,t)}rE.Definition={type:"GeoPath",metadata:{modifies:true},params:[{name:"projection",type:"projection"},{name:"field",type:"field"},{name:"pointRadius",type:"number",expr:true},{name:"as",type:"string",default:"path"}]};(0,p.B)(rE,zi,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.field||p.D_,s=t.as||"path",a=n.SOURCE;if(!i||t.modified()){this.value=i=Ak(t.projection);n.materialize().reflow()}else{a=r===p.D_||e.modified(r.fields)?n.ADD_MOD:n.ADD}const o=sE(i,t.pointRadius);n.visit(a,(t=>t[s]=i(r(t))));i.pointRadius(o);return n.modifies(s)}});function sE(t,e){const n=t.pointRadius();t.context(null);if(e!=null){t.pointRadius(e)}return n}function aE(t){zi.call(this,null,t)}aE.Definition={type:"GeoPoint",metadata:{modifies:true},params:[{name:"projection",type:"projection",required:true},{name:"fields",type:"field",array:true,required:true,length:2},{name:"as",type:"string",array:true,length:2,default:["x","y"]}]};(0,p.B)(aE,zi,{transform(t,e){var n=t.projection,i=t.fields[0],r=t.fields[1],s=t.as||["x","y"],a=s[0],o=s[1],u;function l(t){const e=n([i(t),r(t)]);if(e){t[a]=e[0];t[o]=e[1]}else{t[a]=undefined;t[o]=undefined}}if(t.modified()){e=e.materialize().reflow(true).visit(e.SOURCE,l)}else{u=e.modified(i.fields)||e.modified(r.fields);e.visit(u?e.ADD_MOD:e.ADD,l)}return e.modifies(s)}});function oE(t){zi.call(this,null,t)}oE.Definition={type:"GeoShape",metadata:{modifies:true,nomod:true},params:[{name:"projection",type:"projection"},{name:"field",type:"field",default:"datum"},{name:"pointRadius",type:"number",expr:true},{name:"as",type:"string",default:"shape"}]};(0,p.B)(oE,zi,{transform(t,e){var n=e.fork(e.ALL),i=this.value,r=t.as||"shape",s=n.ADD;if(!i||t.modified()){this.value=i=uE(Ak(t.projection),t.field||(0,p.ZZ)("datum"),t.pointRadius);n.materialize().reflow();s=n.SOURCE}n.visit(s,(t=>t[r]=i));return n.modifies(r)}});function uE(t,e,n){const i=n==null?n=>t(e(n)):i=>{var r=t.pointRadius(),s=t.pointRadius(n)(e(i));t.pointRadius(r);return s};i.context=e=>{t.context(e);return i};return i}function lE(t){zi.call(this,[],t);this.generator=Dk()}lE.Definition={type:"Graticule",metadata:{changes:true,generates:true},params:[{name:"extent",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"extentMajor",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"extentMinor",type:"array",array:true,length:2,content:{type:"number",array:true,length:2}},{name:"step",type:"number",array:true,length:2},{name:"stepMajor",type:"number",array:true,length:2,default:[90,360]},{name:"stepMinor",type:"number",array:true,length:2,default:[10,10]},{name:"precision",type:"number",default:2.5}]};(0,p.B)(lE,zi,{transform(t,e){var n=this.value,i=this.generator,r;if(!n.length||t.modified()){for(const e in t){if((0,p.Tn)(i[e])){i[e](t[e])}}}r=i();if(n.length){e.mod.push(wn(n[0],r))}else{e.add.push(bn(r))}n[0]=r;return e}});function cE(t){zi.call(this,null,t)}cE.Definition={type:"heatmap",metadata:{modifies:true},params:[{name:"field",type:"field"},{name:"color",type:"string",expr:true},{name:"opacity",type:"number",expr:true},{name:"resolve",type:"enum",values:["shared","independent"],default:"independent"},{name:"as",type:"string",default:"image"}]};(0,p.B)(cE,zi,{transform(t,e){if(!e.changed()&&!t.modified()){return e.StopPropagation}var n=e.materialize(e.SOURCE).source,i=t.resolve==="shared",r=t.field||p.D_,s=dE(t.opacity,t),a=fE(t.color,t),o=t.as||"image",u={$x:0,$y:0,$value:0,$max:i?(0,Ni.A)(n.map((t=>(0,Ni.A)(r(t).values)))):0};n.forEach((t=>{const e=r(t);const n=(0,p.X$)({},t,u);if(!i)n.$max=(0,Ni.A)(e.values||[]);t[o]=pE(e,n,a.dep?a:(0,p.dY)(a(n)),s.dep?s:(0,p.dY)(s(n)))}));return e.reflow(true).modifies(o)}});function fE(t,e){let n;if((0,p.Tn)(t)){n=n=>(0,Fk.Qh)(t(n,e));n.dep=hE(t)}else{n=(0,p.dY)((0,Fk.Qh)(t||"#888"))}return n}function dE(t,e){let n;if((0,p.Tn)(t)){n=n=>t(n,e);n.dep=hE(t)}else if(t){n=(0,p.dY)(t)}else{n=t=>t.$value/t.$max||0;n.dep=true}return n}function hE(t){if(!(0,p.Tn)(t))return false;const e=(0,p.M1)((0,p.nS)(t));return e.$x||e.$y||e.$value||e.$max}function pE(t,e,n,i){const r=t.width,s=t.height,a=t.x1||0,o=t.y1||0,u=t.x2||r,l=t.y2||s,c=t.values,f=c?t=>c[t]:p.v_,d=Ko(u-a,l-o),h=d.getContext("2d"),m=h.getImageData(0,0,u-a,l-o),g=m.data;for(let p=o,y=0;p{if(t[e]!=null)vE(n,e,t[e])}))}else{xk.forEach((e=>{if(t.modified(e))vE(n,e,t[e])}))}if(t.pointRadius!=null)n.path.pointRadius(t.pointRadius);if(t.fit)gE(n,t);return e.fork(e.NO_SOURCE|e.NO_FIELDS)}});function gE(t,e){const n=bE(e.fit);e.extent?t.fitExtent(e.extent,n):e.size?t.fitSize(e.size,n):0}function yE(t){const e=wk((t||"mercator").toLowerCase());if(!e)(0,p.z3)("Unrecognized projection type: "+t);return e()}function vE(t,e,n){if((0,p.Tn)(t[e]))t[e](n)}function bE(t){t=(0,p.YO)(t);return t.length===1?t[0]:{type:eE,features:t.reduce(((t,e)=>t.concat(xE(e))),[])}}function xE(t){return t.type===eE?t.features:(0,p.YO)(t).filter((t=>t!=null)).map((t=>t.type===tE?t:{type:tE,geometry:t}))}function _E(t,e){var n,i=1;if(t==null)t=0;if(e==null)e=0;function r(){var r,s=n.length,a,o=0,u=0;for(r=0;r=(f=(o+l)/2))o=f;else l=f;if(g=n>=(d=(u+c)/2))u=d;else c=d;if(r=s,!(s=s[y=g<<1|m]))return r[y]=a,t}h=+t._x.call(null,s.data);p=+t._y.call(null,s.data);if(e===h&&n===p)return a.next=s,r?r[y]=a:t._root=a,t;do{r=r?r[y]=new Array(4):t._root=new Array(4);if(m=e>=(f=(o+l)/2))o=f;else l=f;if(g=n>=(d=(u+c)/2))u=d;else c=d}while((y=g<<1|m)===(v=(p>=d)<<1|h>=f));return r[v]=s,r[y]=a,t}function kE(t){var e,n,i=t.length,r,s,a=new Array(i),o=new Array(i),u=Infinity,l=Infinity,c=-Infinity,f=-Infinity;for(n=0;nc)c=r;if(sf)f=s}if(u>c||l>f)return this;this.cover(u,l).cover(c,f);for(n=0;nt||t>=r||i>e||e>=s){l=(ec||(o=p.y0)>f||(u=p.x1)=y)<<1|t>=g){p=d[d.length-1];d[d.length-1]=d[d.length-1-m];d[d.length-1-m]=p}}else{var v=t-+this._x.call(null,h.data),b=e-+this._y.call(null,h.data),x=v*v+b*b;if(x=(d=(a+u)/2))a=d;else u=d;if(m=f>=(h=(o+l)/2))o=h;else l=h;if(!(e=n,n=n[g=m<<1|p]))return this;if(!n.length)break;if(e[g+1&3]||e[g+2&3]||e[g+3&3])i=e,y=g}while(n.data!==t)if(!(r=n,n=n.next))return this;if(s=n.next)delete n.next;if(r)return s?r.next=s:delete r.next,this;if(!e)return this._root=s,this;s?e[g]=s:delete e[g];if((n=e[0]||e[1]||e[2]||e[3])&&n===(e[3]||e[2]||e[1]||e[0])&&!n.length){if(i)i[y]=n;else this._root=n}return this}function BE(t){for(var e=0,n=t.length;el.index){var m=c-o.x-o.vx,g=f-o.y-o.vy,y=m*m+g*g;if(yc+p||sf+p||at.r){t.r=t[e].r}}}function u(){if(!e)return;var i,r=e.length,s;n=new Array(r);for(i=0;i(t=(KE*t+ZE)%JE)/JE}function eM(t){return t.x}function nM(t){return t.y}var iM=10,rM=Math.PI*(3-Math.sqrt(5));function sM(t){var e,n=1,i=.001,r=1-Math.pow(i,1/300),s=0,a=.6,o=new Map,u=(0,QE.O1)(f),l=(0,VE.A)("tick","end"),c=tM();if(t==null)t=[];function f(){d();l.call("tick",e);if(n1?(n==null?o.delete(t):o.set(t,p(n)),e):o.get(t)},find:function(e,n,i){var r=0,s=t.length,a,o,u,l,c;if(i==null)i=Infinity;else i*=i;for(r=0;r1?(l.on(t,n),e):l.on(t)}}}function aM(){var t,e,n,i,r=GE(-30),s,a=1,o=Infinity,u=.81;function l(n){var r,s=t.length,a=qE(t,eM,nM).visitAfter(f);for(i=n,r=0;r=o)return;if(t.data!==e||t.next){if(f===0)f=YE(n),p+=f*f;if(d===0)d=YE(n),p+=d*d;if(p[e(t,n,a),t]))),f;for(n=0,o=new Array(r);n=0;)n.tick()}else{if(n.stopped())n.restart();if(!i)return e.StopPropagation}}return this.finish(t,e)},finish(t,e){const n=e.dataflow;for(let o=this._argops,u=0,l=o.length,c;ut.touch(e).run()}function bM(t,e){const n=sM(t),i=n.stop,r=n.restart;let s=false;n.stopped=()=>s;n.restart=()=>(s=false,r());n.stop=()=>(s=true,i());return xM(n,e,true).on("end",(()=>s=true))}function xM(t,e,n,i){var r=(0,p.YO)(e.forces),s,a,o,u;for(s=0,a=pM.length;se(t,n):e)}function kM(t){var e=0,n=t.children,i=n&&n.length;if(!i)e=1;else while(--i>=0)e+=n[i].value;t.value=e}function EM(){return this.eachAfter(kM)}function MM(t,e){let n=-1;for(const i of this){t.call(e,i,++n,this)}return this}function DM(t,e){var n=this,i=[n],r,s,a=-1;while(n=i.pop()){t.call(e,n,++a,this);if(r=n.children){for(s=r.length-1;s>=0;--s){i.push(r[s])}}}return this}function CM(t,e){var n=this,i=[n],r=[],s,a,o,u=-1;while(n=i.pop()){r.push(n);if(s=n.children){for(a=0,o=s.length;a=0)n+=i[r].value;e.value=n}))}function BM(t){return this.eachBefore((function(e){if(e.children){e.children.sort(t)}}))}function zM(t){var e=this,n=$M(e,t),i=[e];while(e!==n){e=e.parent;i.push(e)}var r=i.length;while(t!==n){i.splice(r,0,t);t=t.parent}return i}function $M(t,e){if(t===e)return t;var n=t.ancestors(),i=e.ancestors(),r=null;t=n.pop();e=i.pop();while(t===e){r=t;t=n.pop();e=i.pop()}return r}function RM(){var t=this,e=[t];while(t=t.parent){e.push(t)}return e}function OM(){return Array.from(this)}function TM(){var t=[];this.eachBefore((function(e){if(!e.children){t.push(e)}}));return t}function NM(){var t=this,e=[];t.each((function(n){if(n!==t){e.push({source:n.parent,target:n})}}));return e}function*LM(){var t=this,e,n=[t],i,r,s;do{e=n.reverse(),n=[];while(t=e.pop()){yield t;if(i=t.children){for(r=0,s=i.length;r=0;--o){r.push(s=a[o]=new YM(a[o]));s.parent=i;s.depth=i.depth+1}}}return n.eachBefore(GM)}function qM(){return PM(this).eachBefore(jM)}function IM(t){return t.children}function UM(t){return Array.isArray(t)?t[1]:null}function jM(t){if(t.data.value!==undefined)t.value=t.data.value;t.data=t.data.data}function GM(t){var e=0;do{t.height=e}while((t=t.parent)&&t.height<++e)}function YM(t){this.data=t;this.depth=this.height=0;this.parent=null}YM.prototype=PM.prototype={constructor:YM,count:EM,each:MM,eachAfter:CM,eachBefore:DM,find:FM,sum:SM,sort:BM,path:zM,ancestors:RM,descendants:OM,leaves:TM,links:NM,copy:qM,[Symbol.iterator]:LM};function WM(t){return t==null?null:XM(t)}function XM(t){if(typeof t!=="function")throw new Error;return t}function HM(){return 0}function VM(t){return function(){return t}}const QM=1664525;const KM=1013904223;const ZM=4294967296;function JM(){let t=1;return()=>(t=(QM*t+KM)%ZM)/ZM}function tD(t){return typeof t==="object"&&"length"in t?t:Array.from(t)}function eD(t,e){let n=t.length,i,r;while(n){r=e()*n--|0;i=t[n];t[n]=t[r];t[r]=i}return t}function nD(t){return iD(t,lcg())}function iD(t,e){var n=0,i=(t=eD(Array.from(t),e)).length,r=[],s,a;while(n0&&n*n>i*i+r*r}function oD(t,e){for(var n=0;n1e-6?(D+Math.sqrt(D*D-4*M*C))/(2*M):C/D);return{x:i+w+A*F,y:r+k+E*F,r:F}}function dD(t,e,n){var i=t.x-e.x,r,s,a=t.y-e.y,o,u,l=i*i+a*a;if(l){s=e.r+n.r,s*=s;u=t.r+n.r,u*=u;if(s>u){r=(l+u-s)/(2*l);o=Math.sqrt(Math.max(0,u/l-r*r));n.x=t.x-r*i-o*a;n.y=t.y-r*a+o*i}else{r=(l+s-u)/(2*l);o=Math.sqrt(Math.max(0,s/l-r*r));n.x=e.x+r*i-o*a;n.y=e.y+r*a+o*i}}else{n.x=e.x+n.r;n.y=e.y}}function hD(t,e){var n=t.r+e.r-1e-6,i=e.x-t.x,r=e.y-t.y;return n>0&&n*n>i*i+r*r}function pD(t){var e=t._,n=t.next._,i=e.r+n.r,r=(e.x*n.r+n.x*e.r)/i,s=(e.y*n.r+n.y*e.r)/i;return r*r+s*s}function mD(t){this._=t;this.next=null;this.previous=null}function gD(t,e){if(!(s=(t=tD(t)).length))return 0;var n,i,r,s,a,o,u,l,c,f,d;n=t[0],n.x=0,n.y=0;if(!(s>1))return n.r;i=t[1],n.x=-i.r,i.x=n.r,i.y=0;if(!(s>2))return n.r+i.r;dD(i,n,r=t[2]);n=new mD(n),i=new mD(i),r=new mD(r);n.next=r.previous=i;i.next=n.previous=r;r.next=i.previous=n;t:for(u=3;uzD(n(t,e,i))));const e=t.map($D);const o=new Set(t).add("");for(const n of e){if(!o.has(n)){o.add(n);t.push(n);e.push($D(n));r.push(CD)}}s=(e,n)=>t[n];a=(t,n)=>e[n]}for(l=0,o=r.length;l=0;--t){d=r[t];if(d.data!==CD)break;d.data=null}}c.parent=MD;c.eachBefore((function(t){t.depth=t.parent.depth+1;--o})).eachBefore(GM);c.parent=null;if(o>0)throw new Error("cycle");return c}i.id=function(e){return arguments.length?(t=WM(e),i):t};i.parentId=function(t){return arguments.length?(e=WM(t),i):e};i.path=function(t){return arguments.length?(n=WM(t),i):n};return i}function zD(t){t=`${t}`;let e=t.length;if(RD(t,e-1)&&!RD(t,e-2))t=t.slice(0,-1);return t[0]==="/"?t:`/${t}`}function $D(t){let e=t.length;if(e<2)return"";while(--e>1)if(RD(t,e))break;return t.slice(0,e)}function RD(t,e){if(t[e]==="/"){let n=0;while(e>0&&t[--e]==="\\")++n;if((n&1)===0)return true}return false}function OD(t,e){return t.parent===e.parent?1:2}function TD(t){var e=t.children;return e?e[0]:t.t}function ND(t){var e=t.children;return e?e[e.length-1]:t.t}function LD(t,e,n){var i=n/(e.i-t.i);e.c-=i;e.s+=n;t.c+=i;e.z+=n;e.m+=n}function PD(t){var e=0,n=0,i=t.children,r=i.length,s;while(--r>=0){s=i[r];s.z+=e;s.m+=e;e+=s.s+(n+=s.c)}}function qD(t,e,n){return t.a.parent===e.parent?t.a:n}function ID(t,e){this._=t;this.parent=null;this.children=null;this.A=null;this.a=this;this.z=0;this.m=0;this.c=0;this.s=0;this.t=null;this.i=e}ID.prototype=Object.create(YM.prototype);function UD(t){var e=new ID(t,0),n,i=[e],r,s,a,o;while(n=i.pop()){if(s=n._.children){n.children=new Array(o=s.length);for(a=o-1;a>=0;--a){i.push(r=n.children[a]=new ID(s[a],a));r.parent=n}}}(e.parent=new ID(null,0)).children=[e];return e}function jD(){var t=OD,e=1,n=1,i=null;function r(r){var o=UD(r);o.eachAfter(s),o.parent.m=-o.z;o.eachBefore(a);if(i)r.eachBefore(u);else{var l=r,c=r,f=r;r.eachBefore((function(t){if(t.xc.x)c=t;if(t.depth>f.depth)f=t}));var d=l===c?1:t(l,c)/2,h=d-l.x,p=e/(c.x+d+h),m=n/(f.depth||1);r.eachBefore((function(t){t.x=(t.x+h)*p;t.y=t.depth*m}))}return r}function s(e){var n=e.children,i=e.parent.children,r=e.i?i[e.i-1]:null;if(n){PD(e);var s=(n[0].z+n[n.length-1].z)/2;if(r){e.z=r.z+t(e._,r._);e.m=e.z-s}else{e.z=s}}else if(r){e.z=r.z+t(e._,r._)}e.parent.A=o(e,r,e.parent.A||i[0])}function a(t){t._.x=t.z+t.parent.m;t.m+=t.parent.m}function o(e,n,i){if(n){var r=e,s=e,a=n,o=r.parent.children[0],u=r.m,l=s.m,c=a.m,f=o.m,d;while(a=ND(a),r=TD(r),a&&r){o=TD(o);s=ND(s);s.a=e;d=a.z+c-r.z-u+t(a._,r._);if(d>0){LD(qD(a,e,i),e,d);u+=d;l+=d}c+=a.m;u+=r.m;f+=o.m;l+=s.m}if(a&&!ND(s)){s.t=a;s.m+=c-l}if(r&&!TD(o)){o.t=r;o.m+=u-f;i=e}}return i}function u(t){t.x*=e;t.y=t.depth*n}r.separation=function(e){return arguments.length?(t=e,r):t};r.size=function(t){return arguments.length?(i=false,e=+t[0],n=+t[1],r):i?null:[e,n]};r.nodeSize=function(t){return arguments.length?(i=true,e=+t[0],n=+t[1],r):i?[e,n]:null};return r}function GD(t,e){return t.parent===e.parent?1:2}function YD(t){return t.reduce(WD,0)/t.length}function WD(t,e){return t+e.x}function XD(t){return 1+t.reduce(HD,0)}function HD(t,e){return Math.max(t,e.y)}function VD(t){var e;while(e=t.children)t=e[0];return t}function QD(t){var e;while(e=t.children)t=e[e.length-1];return t}function KD(){var t=GD,e=1,n=1,i=false;function r(r){var s,a=0;r.eachAfter((function(e){var n=e.children;if(n){e.x=YD(n);e.y=XD(n)}else{e.x=s?a+=t(e,s):0;e.y=0;s=e}}));var o=VD(r),u=QD(r),l=o.x-t(o,u)/2,c=u.x+t(u,o)/2;return r.eachAfter(i?function(t){t.x=(t.x-r.x)*e;t.y=(r.y-t.y)*n}:function(t){t.x=(t.x-l)/(c-l)*e;t.y=(1-(r.y?t.y/r.y:1))*n})}r.separation=function(e){return arguments.length?(t=e,r):t};r.size=function(t){return arguments.length?(i=false,e=+t[0],n=+t[1],r):i?null:[e,n]};r.nodeSize=function(t){return arguments.length?(i=true,e=+t[0],n=+t[1],r):i?[e,n]:null};return r}function ZD(t,e,n,i,r){var s=t.children,a,o=s.length,u,l=new Array(o+1);for(l[0]=u=a=0;a=e-1){var u=s[t];u.x0=i,u.y0=r;u.x1=a,u.y1=o;return}var f=l[t],d=n/2+f,h=t+1,p=e-1;while(h>>1;if(l[m]o-r){var v=n?(i*y+a*g)/n:a;c(t,h,g,i,r,v,o);c(h,e,y,v,r,a,o)}else{var b=n?(r*y+o*g)/n:o;c(t,h,g,i,r,a,b);c(h,e,y,i,b,a,o)}}}function JD(t,e,n,i,r){var s=t.children,a,o=-1,u=s.length,l=t.value&&(r-n)/t.value;while(++ov)v=l;w=g*g*_;b=Math.max(v/w,w/y);if(b>x){g-=l;break}x=b}a.push(u={value:g,dice:h1?e:1)};return n}(eC);const rC=function t(e){function n(t,n,i,r,s){if((a=t._squarify)&&a.ratio===e){var a,o,u,l,c=-1,f,d=a.length,h=t.value;while(++c1?e:1)};return n}(eC);function sC(){var t=iC,e=false,n=1,i=1,r=[0],s=HM,a=HM,o=HM,u=HM,l=HM;function c(t){t.x0=t.y0=0;t.x1=n;t.y1=i;t.eachBefore(f);r=[0];if(e)t.eachBefore(AD);return t}function f(e){var n=r[e.depth],i=e.x0+n,c=e.y0+n,f=e.x1-n,d=e.y1-n;if(f{const r=t.data;if(n(r))i[e(r)]=t}));t.lookup=i;return t}function oC(t){zi.call(this,null,t)}oC.Definition={type:"Nest",metadata:{treesource:true,changes:true},params:[{name:"keys",type:"field",array:true},{name:"generate",type:"boolean"}]};const uC=t=>t.values;(0,p.B)(oC,zi,{transform(t,e){if(!e.source){(0,p.z3)("Nest transform requires an upstream data source.")}var n=t.generate,i=t.modified(),r=e.clone(),s=this.value;if(!s||i||e.changed()){if(s){s.each((t=>{if(t.children&&gn(t.data)){r.rem.push(t.data)}}))}this.value=s=PM({values:(0,p.YO)(t.keys).reduce(((t,e)=>{t.key(e);return t}),lC()).entries(r.source)},uC);if(n){s.each((t=>{if(t.children){t=bn(t.data);r.add.push(t);r.source.push(t)}}))}aC(s,yn,yn)}r.source.root=s;return r}});function lC(){const t=[],e={entries:t=>i(n(t,0),0),key:n=>(t.push(n),e)};function n(e,i){if(i>=t.length){return e}const r=e.length,s=t[i++],a={},o={};let u=-1,l,c,f;while(++ut.length)return e;const r=[];for(const t in e){r.push({key:t,values:i(e[t],n)})}return r}return e}function cC(t){zi.call(this,null,t)}const fC=(t,e)=>t.parent===e.parent?1:2;(0,p.B)(cC,zi,{transform(t,e){if(!e.source||!e.source.root){(0,p.z3)(this.constructor.name+" transform requires a backing tree data source.")}const n=this.layout(t.method),i=this.fields,r=e.source.root,s=t.as||i;if(t.field)r.sum(t.field);else r.count();if(t.sort)r.sort(An(t.sort,(t=>t.data)));dC(n,this.params,t);if(n.separation){n.separation(t.separation!==false?fC:p.xH)}try{this.value=n(r)}catch(a){(0,p.z3)(a)}r.each((t=>hC(t,i,s)));return e.reflow(t.modified()).modifies(s).modifies("leaf")}});function dC(t,e,n){for(let i,r=0,s=e.length;rs[yn(t)]=1));i.each((t=>{const e=t.data,n=t.parent&&t.parent.data;if(n&&s[yn(e)]&&s[yn(n)]){r.add.push(bn({source:n,target:e}))}}));this.value=r.add}else if(e.changed(e.MOD)){e.visit(e.MOD,(t=>s[yn(t)]=1));n.forEach((t=>{if(s[yn(t.source)]||s[yn(t.target)]){r.mod.push(t)}}))}return r}});const AC={binary:ZD,dice:kD,slice:JD,slicedice:tC,squarify:iC,resquarify:rC};const kC=["x0","y0","x1","y1","depth","children"];function EC(t){cC.call(this,t)}EC.Definition={type:"Treemap",metadata:{tree:true,modifies:true},params:[{name:"field",type:"field"},{name:"sort",type:"compare"},{name:"method",type:"enum",default:"squarify",values:["squarify","resquarify","binary","dice","slice","slicedice"]},{name:"padding",type:"number",default:0},{name:"paddingInner",type:"number",default:0},{name:"paddingOuter",type:"number",default:0},{name:"paddingTop",type:"number",default:0},{name:"paddingRight",type:"number",default:0},{name:"paddingBottom",type:"number",default:0},{name:"paddingLeft",type:"number",default:0},{name:"ratio",type:"number",default:1.618033988749895},{name:"round",type:"boolean",default:false},{name:"size",type:"number",array:true,length:2},{name:"as",type:"string",array:true,length:kC.length,default:kC}]};(0,p.B)(EC,cC,{layout(){const t=sC();t.ratio=e=>{const n=t.tile();if(n.ratio)t.tile(n.ratio(e))};t.method=e=>{if((0,p.mQ)(AC,e))t.tile(AC[e]);else(0,p.z3)("Unrecognized Treemap layout method: "+e)};return t},params:["method","ratio","size","round","padding","paddingInner","paddingOuter","paddingTop","paddingRight","paddingBottom","paddingLeft"],fields:kC});const MC=4278190080;function DC(t,e){const n=t.bitmap();(e||[]).forEach((e=>n.set(t(e.boundary[0]),t(e.boundary[3]))));return[n,undefined]}function CC(t,e,n,i,r){const s=t.width,a=t.height,o=i||r,u=Ko(s,a).getContext("2d"),l=Ko(s,a).getContext("2d"),c=o&&Ko(s,a).getContext("2d");n.forEach((t=>SC(u,t,false)));SC(l,e,false);if(o){SC(c,e,true)}const f=FC(u,s,a),d=FC(l,s,a),h=o&&FC(c,s,a),p=t.bitmap(),m=o&&t.bitmap();let g,y,v,b,x,_,w,A;for(y=0;y{e.items.forEach((e=>SC(t,e.items,n)))}))}else{Qp[i].draw(t,{items:n?e.map(BC):e})}}function BC(t){const e=_n(t,{});if(e.stroke&&e.strokeOpacity!==0||e.fill&&e.fillOpacity!==0){return{...e,strokeOpacity:1,stroke:"#000",fillOpacity:0}}return e}const zC=5,$C=31,RC=32,OC=new Uint32Array(RC+1),TC=new Uint32Array(RC+1);TC[0]=0;OC[0]=~TC[0];for(let yW=1;yW<=RC;++yW){TC[yW]=TC[yW-1]<<1|1;OC[yW]=~TC[yW]}function NC(t,e){const n=new Uint32Array(~~((t*e+RC)/RC));function i(t,e){n[t]|=e}function r(t,e){n[t]&=e}return{array:n,get:(e,i)=>{const r=i*t+e;return n[r>>>zC]&1<<(r&$C)},set:(e,n)=>{const r=n*t+e;i(r>>>zC,1<<(r&$C))},clear:(e,n)=>{const i=n*t+e;r(i>>>zC,~(1<<(i&$C)))},getRange:(e,i,r,s)=>{let a=s,o,u,l,c;for(;a>=i;--a){o=a*t+e;u=a*t+r;l=o>>>zC;c=u>>>zC;if(l===c){if(n[l]&OC[o&$C]&TC[(u&$C)+1]){return true}}else{if(n[l]&OC[o&$C])return true;if(n[c]&TC[(u&$C)+1])return true;for(let t=l+1;t{let a,o,u,l,c;for(;n<=s;++n){a=n*t+e;o=n*t+r;u=a>>>zC;l=o>>>zC;if(u===l){i(u,OC[a&$C]&TC[(o&$C)+1])}else{i(u,OC[a&$C]);i(l,TC[(o&$C)+1]);for(c=u+1;c{let a,o,u,l,c;for(;n<=s;++n){a=n*t+e;o=n*t+i;u=a>>>zC;l=o>>>zC;if(u===l){r(u,TC[a&$C]|OC[(o&$C)+1])}else{r(u,TC[a&$C]);r(l,OC[(o&$C)+1]);for(c=u+1;cn<0||i<0||s>=e||r>=t}}function LC(t,e,n){const i=Math.max(1,Math.sqrt(t*e/1e6)),r=~~((t+2*n+i)/i),s=~~((e+2*n+i)/i),a=t=>~~((t+n)/i);a.invert=t=>t*i-n;a.bitmap=()=>NC(r,s);a.ratio=i;a.padding=n;a.width=t;a.height=e;return a}function PC(t,e,n,i){const r=t.width,s=t.height;return function(t){const e=t.datum.datum.items[i].items,n=e.length,a=t.datum.fontSize,o=Ap.width(t.datum,t.datum.text);let u=0,l,c,f,d,h,p,m;for(let i=0;i=u){u=m;t.x=h;t.y=p}}h=o/2;p=a/2;l=t.x-h;c=t.x+h;f=t.y-p;d=t.y+p;t.align="center";if(l<0&&c<=r){t.align="left"}else if(0<=l&&rr||e-(a=i/2)<0||e+a>s}function IC(t,e,n,i,r,s,a,o){const u=r*s/(i*2),l=t(e-u),c=t(e+u),f=t(n-(s=s/2)),d=t(n+s);return a.outOfBounds(l,f,c,d)||a.getRange(l,f,c,d)||o&&o.getRange(l,f,c,d)}function UC(t,e,n,i){const r=t.width,s=t.height,a=e[0],o=e[1];function u(e,n,i,u,l){const c=t.invert(e),f=t.invert(n);let d=i,h=s,p;if(!qC(c,f,u,l,r,s)&&!IC(t,c,f,l,u,d,a,o)&&!IC(t,c,f,l,u,l,a,null)){while(h-d>=1){p=(d+h)/2;if(IC(t,c,f,l,u,p,a,o)){h=p}else{d=p}}if(d>i){return[c,f,d,true]}}}return function(e){const o=e.datum.datum.items[i].items,l=o.length,c=e.datum.fontSize,f=Ap.width(e.datum,e.datum.text);let d=n?c:0,h=false,p=false,m=0,g,y,v,b,x,_,w,A,k,E,M,D,C,F,S,B,z;for(let i=0;iy){z=g;g=y;y=z}if(v>b){z=v;v=b;b=z}k=t(g);M=t(y);E=~~((k+M)/2);D=t(v);F=t(b);C=~~((D+F)/2);for(w=E;w>=k;--w){for(A=C;A>=D;--A){B=u(w,A,d,f,c);if(B){[e.x,e.y,d,h]=B}}}for(w=E;w<=M;++w){for(A=C;A<=F;++A){B=u(w,A,d,f,c);if(B){[e.x,e.y,d,h]=B}}}if(!h&&!n){S=Math.abs(y-g+b-v);x=(g+y)/2;_=(v+b)/2;if(S>=m&&!qC(x,_,f,c,r,s)&&!IC(t,x,_,c,f,c,a,null)){m=S;e.x=x;e.y=_;p=true}}}if(h||p){x=f/2;_=c/2;a.setRange(t(e.x-x),t(e.y-_),t(e.x+x),t(e.y+_));e.align="center";e.baseline="middle";return true}else{return false}}}const jC=[-1,-1,1,1];const GC=[-1,1,-1,1];function YC(t,e,n,i){const r=t.width,s=t.height,a=e[0],o=e[1],u=t.bitmap();return function(e){const l=e.datum.datum.items[i].items,c=l.length,f=e.datum.fontSize,d=Ap.width(e.datum,e.datum.text),h=[];let p=n?f:0,m=false,g=false,y=0,v,b,x,_,w,A,k,E,M,D,C,F;for(let i=0;i=1){C=(M+D)/2;if(IC(t,w,A,f,d,C,a,o)){D=C}else{M=C}}if(M>p){e.x=w;e.y=A;p=M;m=true}}}if(!m&&!n){F=Math.abs(b-v+_-x);w=(v+b)/2;A=(x+_)/2;if(F>=y&&!qC(w,A,d,f,r,s)&&!IC(t,w,A,f,d,f,a,null)){y=F;e.x=w;e.y=A;g=true}}}if(m||g){w=d/2;A=f/2;a.setRange(t(e.x-w),t(e.y-A),t(e.x+w),t(e.y+A));e.align="center";e.baseline="middle";return true}else{return false}}}const WC=["right","center","left"],XC=["bottom","middle","top"];function HC(t,e,n,i){const r=t.width,s=t.height,a=e[0],o=e[1],u=i.length;return function(e){const l=e.boundary,c=e.datum.fontSize;if(l[2]<0||l[5]<0||l[0]>r||l[3]>s){return false}let f=e.textWidth??0,d,h,p,m,g,y,v,b,x,_,w,A,k,E,M;for(let r=0;r>>2&3)-1;p=d===0&&h===0||i[r]<0;m=d&&h?Math.SQRT1_2:1;g=i[r]<0?-1:1;y=l[1+d]+i[r]*d*m;w=l[4+h]+g*c*h/2+i[r]*h*m;b=w-c/2;x=w+c/2;A=t(y);E=t(b);M=t(x);if(!f){if(!VC(A,A,E,M,a,o,y,y,b,x,l,p)){continue}else{f=Ap.width(e.datum,e.datum.text)}}_=y+g*f*d/2;y=_-f/2;v=_+f/2;A=t(y);k=t(v);if(VC(A,k,E,M,a,o,y,v,b,x,l,p)){e.x=!d?_:d*g<0?v:y;e.y=!h?w:h*g<0?x:b;e.align=WC[d*g+1];e.baseline=XC[h*g+1];a.setRange(A,E,k,M);return true}}return false}}function VC(t,e,n,i,r,s,a,o,u,l,c,f){return!(r.outOfBounds(t,n,e,i)||(f&&s||r).getRange(t,n,e,i))}const QC=0,KC=4,ZC=8,JC=0,tF=1,eF=2;const nF={"top-left":QC+JC,top:QC+tF,"top-right":QC+eF,left:KC+JC,middle:KC+tF,right:KC+eF,"bottom-left":ZC+JC,bottom:ZC+tF,"bottom-right":ZC+eF};const iF={naive:PC,"reduced-search":UC,floodfill:YC};function rF(t,e,n,i,r,s,a,o,u,l,c){if(!t.length)return t;const f=Math.max(i.length,r.length),d=sF(i,f),h=aF(r,f),p=oF(t[0].datum),m=p==="group"&&t[0].datum.items[u].marktype,g=m==="area",y=uF(p,m,o,u),v=l===null||l===Infinity,b=g&&c==="naive";let x=-1,_=-1;const w=t.map((t=>{const e=v?Ap.width(t,t.text):undefined;x=Math.max(x,e);_=Math.max(_,t.fontSize);return{datum:t,opacity:0,x:undefined,y:undefined,align:undefined,baseline:undefined,boundary:y(t),textWidth:e}}));l=l===null||l===Infinity?Math.max(x,_)+Math.max(...i):l;const A=LC(e[0],e[1],l);let k;if(!b){if(n){w.sort(((t,e)=>n(t.datum,e.datum)))}let e=false;for(let t=0;tt.datum));k=s.length||i?CC(A,i||[],s,e,g):DC(A,a&&w)}const E=g?iF[c](A,k,a,u):HC(A,k,h,d);w.forEach((t=>t.opacity=+E(t)));return w}function sF(t,e){const n=new Float64Array(e),i=t.length;for(let r=0;r[t.x,t.x,t.x,t.y,t.y,t.y];if(!t){return r}else if(t==="line"||t==="area"){return t=>r(t.datum)}else if(e==="line"){return t=>{const e=t.datum.items[i].items;return r(e.length?e[n==="start"?0:e.length-1]:{x:NaN,y:NaN})}}else{return t=>{const e=t.datum.bounds;return[e.x1,(e.x1+e.x2)/2,e.x2,e.y1,(e.y1+e.y2)/2,e.y2]}}}const lF=["x","y","opacity","align","baseline"];const cF=["top-left","left","bottom-left","top","bottom","top-right","right","bottom-right"];function fF(t){zi.call(this,null,t)}fF.Definition={type:"Label",metadata:{modifies:true},params:[{name:"size",type:"number",array:true,length:2,required:true},{name:"sort",type:"compare"},{name:"anchor",type:"string",array:true,default:cF},{name:"offset",type:"number",array:true,default:[1]},{name:"padding",type:"number",default:0,null:true},{name:"lineAnchor",type:"string",values:["start","end"],default:"end"},{name:"markIndex",type:"number",default:0},{name:"avoidBaseMark",type:"boolean",default:true},{name:"avoidMarks",type:"data",array:true},{name:"method",type:"string",default:"naive"},{name:"as",type:"string",array:true,length:lF.length,default:lF}]};(0,p.B)(fF,zi,{transform(t,e){function n(n){const i=t[n];return(0,p.Tn)(i)&&e.modified(i.fields)}const i=t.modified();if(!(i||e.changed(e.ADD_REM)||n("sort")))return;if(!t.size||t.size.length!==2){(0,p.z3)("Size parameter should be specified as a [width, height] array.")}const r=t.as||lF;rF(e.materialize(e.SOURCE).source||[],t.size,t.sort,(0,p.YO)(t.offset==null?1:t.offset),(0,p.YO)(t.anchor||cF),t.avoidMarks||[],t.avoidBaseMark!==false,t.lineAnchor||"end",t.markIndex||0,t.padding===undefined?0:t.padding,t.method||"naive").forEach((t=>{const e=t.datum;e[r[0]]=t.x;e[r[1]]=t.y;e[r[2]]=t.opacity;e[r[3]]=t.align;e[r[4]]=t.baseline}));return e.reflow(i).modifies(r)}});function dF(t,e){var n=[],i=function(t){return t(o)},r,s,a,o,u,l;if(e==null){n.push(t)}else{for(r={},s=0,a=t.length;s{Wr(e,t.x,t.y,t.bandwidth||.3).forEach((t=>{const n={};for(let i=0;it==="poly"?e:t==="quad"?2:1;function gF(t){zi.call(this,null,t)}gF.Definition={type:"Regression",metadata:{generates:true},params:[{name:"x",type:"field",required:true},{name:"y",type:"field",required:true},{name:"groupby",type:"field",array:true},{name:"method",type:"string",default:"linear",values:Object.keys(pF)},{name:"order",type:"number",default:3},{name:"extent",type:"number",array:true,length:2},{name:"params",type:"boolean",default:false},{name:"as",type:"string",array:true}]};(0,p.B)(gF,zi,{transform(t,e){const n=e.fork(e.NO_SOURCE|e.NO_FIELDS);if(!this.value||e.changed()||t.modified()){const i=e.materialize(e.SOURCE).source,r=dF(i,t.groupby),s=(t.groupby||[]).map(p.N6),a=t.method||"linear",o=t.order==null?3:t.order,u=mF(a,o),l=t.as||[(0,p.N6)(t.x),(0,p.N6)(t.y)],c=pF[a],f=[];let d=t.extent;if(!(0,p.mQ)(pF,a)){(0,p.z3)("Invalid regression method: "+a)}if(d!=null){if(a==="log"&&d[0]<=0){e.dataflow.warn("Ignoring extent with values <= 0 for log regression.");d=null}}r.forEach((n=>{const i=n.length;if(i<=u){e.dataflow.warn("Skipping regression with more parameters than data points.");return}const r=c(n,t.x,t.y,o);if(t.params){f.push(bn({keys:n.dims,coef:r.coef,rSquared:r.rSquared}));return}const h=d||(0,p.Xx)(n,t.x),m=t=>{const e={};for(let i=0;im([t,r.predict(t)])))}else{Kr(r.predict,h,25,200).forEach(m)}}));if(this.value)n.rem=this.value;this.value=n.add=n.source=f}return n}});const yF=11102230246251565e-32;const vF=134217729;const bF=(3+8*yF)*yF;function xF(t,e,n,i,r){let s,a,o,u;let l=e[0];let c=i[0];let f=0;let d=0;if(c>l===c>-l){s=l;l=e[++f]}else{s=c;c=i[++d]}let h=0;if(fl===c>-l){a=l+s;o=s-(a-l);l=e[++f]}else{a=c+s;o=s-(a-c);c=i[++d]}s=a;if(o!==0){r[h++]=o}while(fl===c>-l){a=s+l;u=a-s;o=s-(a-u)+(l-u);l=e[++f]}else{a=s+c;u=a-s;o=s-(a-u)+(c-u);c=i[++d]}s=a;if(o!==0){r[h++]=o}}}while(f=S||-F>=S){return F}f=t-E;o=t-(E+f)+(f-r);f=n-M;l=n-(M+f)+(f-r);f=e-D;u=e-(D+f)+(f-s);f=i-C;c=i-(C+f)+(f-s);if(o===0&&u===0&&l===0&&c===0){return F}S=CF*a+bF*Math.abs(F);F+=E*c+C*o-(D*l+M*u);if(F>=S||-F>=S)return F;x=o*C;d=vF*o;h=d-(d-o);p=o-h;d=vF*C;m=d-(d-C);g=C-m;_=p*g-(x-h*m-p*m-h*g);w=u*M;d=vF*u;h=d-(d-u);p=u-h;d=vF*M;m=d-(d-M);g=M-m;A=p*g-(w-h*m-p*m-h*g);y=_-A;f=_-y;$F[0]=_-(y+f)+(f-A);v=x+y;f=v-x;b=x-(v-f)+(y-f);y=b-w;f=b-y;$F[1]=b-(y+f)+(f-w);k=v+y;f=k-v;$F[2]=v-(k-f)+(y-f);$F[3]=k;const B=xF(4,FF,4,$F,SF);x=E*c;d=vF*E;h=d-(d-E);p=E-h;d=vF*c;m=d-(d-c);g=c-m;_=p*g-(x-h*m-p*m-h*g);w=D*l;d=vF*D;h=d-(d-D);p=D-h;d=vF*l;m=d-(d-l);g=l-m;A=p*g-(w-h*m-p*m-h*g);y=_-A;f=_-y;$F[0]=_-(y+f)+(f-A);v=x+y;f=v-x;b=x-(v-f)+(y-f);y=b-w;f=b-y;$F[1]=b-(y+f)+(f-w);k=v+y;f=k-v;$F[2]=v-(k-f)+(y-f);$F[3]=k;const z=xF(B,SF,4,$F,BF);x=o*c;d=vF*o;h=d-(d-o);p=o-h;d=vF*c;m=d-(d-c);g=c-m;_=p*g-(x-h*m-p*m-h*g);w=u*l;d=vF*u;h=d-(d-u);p=u-h;d=vF*l;m=d-(d-l);g=l-m;A=p*g-(w-h*m-p*m-h*g);y=_-A;f=_-y;$F[0]=_-(y+f)+(f-A);v=x+y;f=v-x;b=x-(v-f)+(y-f);y=b-w;f=b-y;$F[1]=b-(y+f)+(f-w);k=v+y;f=k-v;$F[2]=v-(k-f)+(y-f);$F[3]=k;const $=xF(z,BF,4,$F,zF);return zF[$-1]}function OF(t,e,n,i,r,s){const a=(e-s)*(n-r);const o=(t-r)*(i-s);const u=a-o;if(a===0||o===0||a>0!==o>0)return u;const l=Math.abs(a+o);if(Math.abs(u)>=MF*l)return u;return-RF(t,e,n,i,r,s,l)}function TF(t,e,n,i,r,s){return(e-s)*(n-r)-(t-r)*(i-s)}const NF=(7+56*yF)*yF;const LF=(3+28*yF)*yF;const PF=(26+288*yF)*yF*yF;const qF=EF(4);const IF=EF(4);const UF=EF(4);const jF=EF(4);const GF=EF(4);const YF=EF(4);const WF=EF(4);const XF=EF(4);const HF=EF(4);const VF=EF(8);const QF=EF(8);const KF=EF(8);const ZF=EF(4);const JF=EF(8);const tS=EF(8);const eS=EF(8);const nS=EF(12);let iS=EF(192);let rS=EF(192);function sS(t,e,n){t=sum(t,iS,e,n,rS);const i=iS;iS=rS;rS=i;return t}function aS(t,e,n,i,r,s,a,o){let u,l,c,f,d,h,p,m,g,y,v,b,x,_,w,A;if(t===0){if(e===0){a[0]=0;o[0]=0;return 1}else{A=-e;v=A*n;l=splitter*A;c=l-(l-A);f=A-c;l=splitter*n;d=l-(l-n);h=n-d;a[0]=f*h-(v-c*d-f*d-c*h);a[1]=v;v=e*r;l=splitter*e;c=l-(l-e);f=e-c;l=splitter*r;d=l-(l-r);h=r-d;o[0]=f*h-(v-c*d-f*d-c*h);o[1]=v;return 2}}else{if(e===0){v=t*i;l=splitter*t;c=l-(l-t);f=t-c;l=splitter*i;d=l-(l-i);h=i-d;a[0]=f*h-(v-c*d-f*d-c*h);a[1]=v;A=-t;v=A*s;l=splitter*A;c=l-(l-A);f=A-c;l=splitter*s;d=l-(l-s);h=s-d;o[0]=f*h-(v-c*d-f*d-c*h);o[1]=v;return 2}else{v=t*i;l=splitter*t;c=l-(l-t);f=t-c;l=splitter*i;d=l-(l-i);h=i-d;b=f*h-(v-c*d-f*d-c*h);x=e*n;l=splitter*e;c=l-(l-e);f=e-c;l=splitter*n;d=l-(l-n);h=n-d;_=f*h-(x-c*d-f*d-c*h);p=b-_;u=b-p;a[0]=b-(p+u)+(u-_);m=v+p;u=m-v;y=v-(m-u)+(p-u);p=y-x;u=y-p;a[1]=y-(p+u)+(u-x);w=m+p;u=w-m;a[2]=m-(w-u)+(p-u);a[3]=w;v=e*r;l=splitter*e;c=l-(l-e);f=e-c;l=splitter*r;d=l-(l-r);h=r-d;b=f*h-(v-c*d-f*d-c*h);x=t*s;l=splitter*t;c=l-(l-t);f=t-c;l=splitter*s;d=l-(l-s);h=s-d;_=f*h-(x-c*d-f*d-c*h);p=b-_;u=b-p;o[0]=b-(p+u)+(u-_);m=v+p;u=m-v;y=v-(m-u)+(p-u);p=y-x;u=y-p;o[1]=y-(p+u)+(u-x);w=m+p;u=w-m;o[2]=m-(w-u)+(p-u);o[3]=w;return 4}}}function oS(t,e,n,i,r){let s,a,o,u,l,c,f,d,h,p,m,g,y;m=e*n;a=splitter*e;o=a-(a-e);u=e-o;a=splitter*n;l=a-(a-n);c=n-l;g=u*c-(m-o*l-u*l-o*c);a=splitter*i;l=a-(a-i);c=i-l;f=g*i;a=splitter*g;o=a-(a-g);u=g-o;ZF[0]=u*c-(f-o*l-u*l-o*c);d=m*i;a=splitter*m;o=a-(a-m);u=m-o;p=u*c-(d-o*l-u*l-o*c);h=f+p;s=h-f;ZF[1]=f-(h-s)+(p-s);y=d+h;ZF[2]=h-(y-d);ZF[3]=y;t=sS(t,4,ZF);if(r!==0){a=splitter*r;l=a-(a-r);c=r-l;f=g*r;a=splitter*g;o=a-(a-g);u=g-o;ZF[0]=u*c-(f-o*l-u*l-o*c);d=m*r;a=splitter*m;o=a-(a-m);u=m-o;p=u*c-(d-o*l-u*l-o*c);h=f+p;s=h-f;ZF[1]=f-(h-s)+(p-s);y=d+h;ZF[2]=h-(y-d);ZF[3]=y;t=sS(t,4,ZF)}return t}function uS(t,e,n,i,r,s,a,o,u,l,c,f,d){let h;let p,m,g;let y,v,b;let x,_,w;let A,k,E,M,D,C,F,S,B,z,$,R,O,T,N;const L=t-l;const P=i-l;const q=a-l;const I=e-c;const U=r-c;const j=o-c;const G=n-f;const Y=s-f;const W=u-f;$=P*j;k=splitter*P;E=k-(k-P);M=P-E;k=splitter*j;D=k-(k-j);C=j-D;R=M*C-($-E*D-M*D-E*C);O=q*U;k=splitter*q;E=k-(k-q);M=q-E;k=splitter*U;D=k-(k-U);C=U-D;T=M*C-(O-E*D-M*D-E*C);F=R-T;A=R-F;qF[0]=R-(F+A)+(A-T);S=$+F;A=S-$;z=$-(S-A)+(F-A);F=z-O;A=z-F;qF[1]=z-(F+A)+(A-O);N=S+F;A=N-S;qF[2]=S-(N-A)+(F-A);qF[3]=N;$=q*I;k=splitter*q;E=k-(k-q);M=q-E;k=splitter*I;D=k-(k-I);C=I-D;R=M*C-($-E*D-M*D-E*C);O=L*j;k=splitter*L;E=k-(k-L);M=L-E;k=splitter*j;D=k-(k-j);C=j-D;T=M*C-(O-E*D-M*D-E*C);F=R-T;A=R-F;IF[0]=R-(F+A)+(A-T);S=$+F;A=S-$;z=$-(S-A)+(F-A);F=z-O;A=z-F;IF[1]=z-(F+A)+(A-O);N=S+F;A=N-S;IF[2]=S-(N-A)+(F-A);IF[3]=N;$=L*U;k=splitter*L;E=k-(k-L);M=L-E;k=splitter*U;D=k-(k-U);C=U-D;R=M*C-($-E*D-M*D-E*C);O=P*I;k=splitter*P;E=k-(k-P);M=P-E;k=splitter*I;D=k-(k-I);C=I-D;T=M*C-(O-E*D-M*D-E*C);F=R-T;A=R-F;UF[0]=R-(F+A)+(A-T);S=$+F;A=S-$;z=$-(S-A)+(F-A);F=z-O;A=z-F;UF[1]=z-(F+A)+(A-O);N=S+F;A=N-S;UF[2]=S-(N-A)+(F-A);UF[3]=N;h=sum(sum(scale(4,qF,G,JF),JF,scale(4,IF,Y,tS),tS,eS),eS,scale(4,UF,W,JF),JF,iS);let X=estimate(h,iS);let H=LF*d;if(X>=H||-X>=H){return X}A=t-L;p=t-(L+A)+(A-l);A=i-P;m=i-(P+A)+(A-l);A=a-q;g=a-(q+A)+(A-l);A=e-I;y=e-(I+A)+(A-c);A=r-U;v=r-(U+A)+(A-c);A=o-j;b=o-(j+A)+(A-c);A=n-G;x=n-(G+A)+(A-f);A=s-Y;_=s-(Y+A)+(A-f);A=u-W;w=u-(W+A)+(A-f);if(p===0&&m===0&&g===0&&y===0&&v===0&&b===0&&x===0&&_===0&&w===0){return X}H=PF*d+resulterrbound*Math.abs(X);X+=G*(P*b+j*m-(U*g+q*v))+x*(P*j-U*q)+Y*(q*y+I*g-(j*p+L*b))+_*(q*I-j*L)+W*(L*v+U*p-(I*m+P*y))+w*(L*U-I*P);if(X>=H||-X>=H){return X}const V=aS(p,y,P,U,q,j,jF,GF);const Q=aS(m,v,q,j,L,I,YF,WF);const K=aS(g,b,L,I,P,U,XF,HF);const Z=sum(Q,YF,K,HF,VF);h=sS(h,scale(Z,VF,G,eS),eS);const J=sum(K,XF,V,GF,QF);h=sS(h,scale(J,QF,Y,eS),eS);const tt=sum(V,jF,Q,WF,KF);h=sS(h,scale(tt,KF,W,eS),eS);if(x!==0){h=sS(h,scale(4,qF,x,nS),nS);h=sS(h,scale(Z,VF,x,eS),eS)}if(_!==0){h=sS(h,scale(4,IF,_,nS),nS);h=sS(h,scale(J,QF,_,eS),eS)}if(w!==0){h=sS(h,scale(4,UF,w,nS),nS);h=sS(h,scale(tt,KF,w,eS),eS)}if(p!==0){if(v!==0){h=oS(h,p,v,W,w)}if(b!==0){h=oS(h,-p,b,Y,_)}}if(m!==0){if(b!==0){h=oS(h,m,b,G,x)}if(y!==0){h=oS(h,-m,y,W,w)}}if(g!==0){if(y!==0){h=oS(h,g,y,Y,_)}if(v!==0){h=oS(h,-g,v,G,x)}}return iS[h-1]}function lS(t,e,n,i,r,s,a,o,u,l,c,f){const d=t-l;const h=i-l;const p=a-l;const m=e-c;const g=r-c;const y=o-c;const v=n-f;const b=s-f;const x=u-f;const _=h*y;const w=p*g;const A=p*m;const k=d*y;const E=d*g;const M=h*m;const D=v*(_-w)+b*(A-k)+x*(E-M);const C=(Math.abs(_)+Math.abs(w))*Math.abs(v)+(Math.abs(A)+Math.abs(k))*Math.abs(b)+(Math.abs(E)+Math.abs(M))*Math.abs(x);const F=NF*C;if(D>F||-D>F){return D}return uS(t,e,n,i,r,s,a,o,u,l,c,f,C)}function cS(t,e,n,i,r,s,a,o,u,l,c,f){const d=t-l;const h=i-l;const p=a-l;const m=e-c;const g=r-c;const y=o-c;const v=n-f;const b=s-f;const x=u-f;return d*(g*x-b*y)+h*(y*v-x*m)+p*(m*b-v*g)}const fS=(10+96*yF)*yF;const dS=(4+48*yF)*yF;const hS=(44+576*yF)*yF*yF;const pS=EF(4);const mS=EF(4);const gS=EF(4);const yS=EF(4);const vS=EF(4);const bS=EF(4);const xS=EF(4);const _S=EF(4);const wS=EF(8);const AS=EF(8);const kS=EF(8);const ES=EF(8);const MS=EF(8);const DS=EF(8);const CS=EF(8);const FS=EF(8);const SS=EF(8);const BS=EF(4);const zS=EF(4);const $S=EF(4);const RS=EF(8);const OS=EF(16);const TS=EF(16);const NS=EF(16);const LS=EF(32);const PS=EF(32);const qS=EF(48);const IS=EF(64);let US=EF(1152);let jS=EF(1152);function GS(t,e,n){t=sum(t,US,e,n,jS);const i=US;US=jS;jS=i;return t}function YS(t,e,n,i,r,s,a,o,u){let l;let c,f,d,h,p,m;let g,y,v,b,x,_;let w,A,k;let E,M,D;let C,F;let S,B,z,$,R,O,T,N,L,P,q,I,U,j;const G=t-a;const Y=n-a;const W=r-a;const X=e-o;const H=i-o;const V=s-o;P=Y*V;B=splitter*Y;z=B-(B-Y);$=Y-z;B=splitter*V;R=B-(B-V);O=V-R;q=$*O-(P-z*R-$*R-z*O);I=W*H;B=splitter*W;z=B-(B-W);$=W-z;B=splitter*H;R=B-(B-H);O=H-R;U=$*O-(I-z*R-$*R-z*O);T=q-U;S=q-T;pS[0]=q-(T+S)+(S-U);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L-I;S=L-T;pS[1]=L-(T+S)+(S-I);j=N+T;S=j-N;pS[2]=N-(j-S)+(T-S);pS[3]=j;P=W*X;B=splitter*W;z=B-(B-W);$=W-z;B=splitter*X;R=B-(B-X);O=X-R;q=$*O-(P-z*R-$*R-z*O);I=G*V;B=splitter*G;z=B-(B-G);$=G-z;B=splitter*V;R=B-(B-V);O=V-R;U=$*O-(I-z*R-$*R-z*O);T=q-U;S=q-T;mS[0]=q-(T+S)+(S-U);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L-I;S=L-T;mS[1]=L-(T+S)+(S-I);j=N+T;S=j-N;mS[2]=N-(j-S)+(T-S);mS[3]=j;P=G*H;B=splitter*G;z=B-(B-G);$=G-z;B=splitter*H;R=B-(B-H);O=H-R;q=$*O-(P-z*R-$*R-z*O);I=Y*X;B=splitter*Y;z=B-(B-Y);$=Y-z;B=splitter*X;R=B-(B-X);O=X-R;U=$*O-(I-z*R-$*R-z*O);T=q-U;S=q-T;gS[0]=q-(T+S)+(S-U);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L-I;S=L-T;gS[1]=L-(T+S)+(S-I);j=N+T;S=j-N;gS[2]=N-(j-S)+(T-S);gS[3]=j;l=sum(sum(sum(scale(scale(4,pS,G,RS),RS,G,OS),OS,scale(scale(4,pS,X,RS),RS,X,TS),TS,LS),LS,sum(scale(scale(4,mS,Y,RS),RS,Y,OS),OS,scale(scale(4,mS,H,RS),RS,H,TS),TS,PS),PS,IS),IS,sum(scale(scale(4,gS,W,RS),RS,W,OS),OS,scale(scale(4,gS,V,RS),RS,V,TS),TS,LS),LS,US);let Q=estimate(l,US);let K=dS*u;if(Q>=K||-Q>=K){return Q}S=t-G;c=t-(G+S)+(S-a);S=e-X;h=e-(X+S)+(S-o);S=n-Y;f=n-(Y+S)+(S-a);S=i-H;p=i-(H+S)+(S-o);S=r-W;d=r-(W+S)+(S-a);S=s-V;m=s-(V+S)+(S-o);if(c===0&&f===0&&d===0&&h===0&&p===0&&m===0){return Q}K=hS*u+resulterrbound*Math.abs(Q);Q+=(G*G+X*X)*(Y*m+V*f-(H*d+W*p))+2*(G*c+X*h)*(Y*V-H*W)+((Y*Y+H*H)*(W*h+X*d-(V*c+G*m))+2*(Y*f+H*p)*(W*X-V*G))+((W*W+V*V)*(G*p+H*c-(X*f+Y*h))+2*(W*d+V*m)*(G*H-X*Y));if(Q>=K||-Q>=K){return Q}if(f!==0||p!==0||d!==0||m!==0){P=G*G;B=splitter*G;z=B-(B-G);$=G-z;q=$*$-(P-z*z-(z+z)*$);I=X*X;B=splitter*X;z=B-(B-X);$=X-z;U=$*$-(I-z*z-(z+z)*$);T=q+U;S=T-q;yS[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;yS[1]=L-(T-S)+(I-S);j=N+T;S=j-N;yS[2]=N-(j-S)+(T-S);yS[3]=j}if(d!==0||m!==0||c!==0||h!==0){P=Y*Y;B=splitter*Y;z=B-(B-Y);$=Y-z;q=$*$-(P-z*z-(z+z)*$);I=H*H;B=splitter*H;z=B-(B-H);$=H-z;U=$*$-(I-z*z-(z+z)*$);T=q+U;S=T-q;vS[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;vS[1]=L-(T-S)+(I-S);j=N+T;S=j-N;vS[2]=N-(j-S)+(T-S);vS[3]=j}if(c!==0||h!==0||f!==0||p!==0){P=W*W;B=splitter*W;z=B-(B-W);$=W-z;q=$*$-(P-z*z-(z+z)*$);I=V*V;B=splitter*V;z=B-(B-V);$=V-z;U=$*$-(I-z*z-(z+z)*$);T=q+U;S=T-q;bS[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;bS[1]=L-(T-S)+(I-S);j=N+T;S=j-N;bS[2]=N-(j-S)+(T-S);bS[3]=j}if(c!==0){g=scale(4,pS,c,wS);l=GS(l,sum_three(scale(g,wS,2*G,OS),OS,scale(scale(4,bS,c,RS),RS,H,TS),TS,scale(scale(4,vS,c,RS),RS,-V,NS),NS,LS,qS),qS)}if(h!==0){y=scale(4,pS,h,AS);l=GS(l,sum_three(scale(y,AS,2*X,OS),OS,scale(scale(4,vS,h,RS),RS,W,TS),TS,scale(scale(4,bS,h,RS),RS,-Y,NS),NS,LS,qS),qS)}if(f!==0){v=scale(4,mS,f,kS);l=GS(l,sum_three(scale(v,kS,2*Y,OS),OS,scale(scale(4,yS,f,RS),RS,V,TS),TS,scale(scale(4,bS,f,RS),RS,-X,NS),NS,LS,qS),qS)}if(p!==0){b=scale(4,mS,p,ES);l=GS(l,sum_three(scale(b,ES,2*H,OS),OS,scale(scale(4,bS,p,RS),RS,G,TS),TS,scale(scale(4,yS,p,RS),RS,-W,NS),NS,LS,qS),qS)}if(d!==0){x=scale(4,gS,d,MS);l=GS(l,sum_three(scale(x,MS,2*W,OS),OS,scale(scale(4,vS,d,RS),RS,X,TS),TS,scale(scale(4,yS,d,RS),RS,-H,NS),NS,LS,qS),qS)}if(m!==0){_=scale(4,gS,m,DS);l=GS(l,sum_three(scale(_,DS,2*V,OS),OS,scale(scale(4,yS,m,RS),RS,Y,TS),TS,scale(scale(4,vS,m,RS),RS,-G,NS),NS,LS,qS),qS)}if(c!==0||h!==0){if(f!==0||p!==0||d!==0||m!==0){P=f*V;B=splitter*f;z=B-(B-f);$=f-z;B=splitter*V;R=B-(B-V);O=V-R;q=$*O-(P-z*R-$*R-z*O);I=Y*m;B=splitter*Y;z=B-(B-Y);$=Y-z;B=splitter*m;R=B-(B-m);O=m-R;U=$*O-(I-z*R-$*R-z*O);T=q+U;S=T-q;xS[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;xS[1]=L-(T-S)+(I-S);j=N+T;S=j-N;xS[2]=N-(j-S)+(T-S);xS[3]=j;P=d*-H;B=splitter*d;z=B-(B-d);$=d-z;B=splitter*-H;R=B-(B- -H);O=-H-R;q=$*O-(P-z*R-$*R-z*O);I=W*-p;B=splitter*W;z=B-(B-W);$=W-z;B=splitter*-p;R=B-(B- -p);O=-p-R;U=$*O-(I-z*R-$*R-z*O);T=q+U;S=T-q;_S[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;_S[1]=L-(T-S)+(I-S);j=N+T;S=j-N;_S[2]=N-(j-S)+(T-S);_S[3]=j;A=sum(4,xS,4,_S,FS);P=f*m;B=splitter*f;z=B-(B-f);$=f-z;B=splitter*m;R=B-(B-m);O=m-R;q=$*O-(P-z*R-$*R-z*O);I=d*p;B=splitter*d;z=B-(B-d);$=d-z;B=splitter*p;R=B-(B-p);O=p-R;U=$*O-(I-z*R-$*R-z*O);T=q-U;S=q-T;zS[0]=q-(T+S)+(S-U);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L-I;S=L-T;zS[1]=L-(T+S)+(S-I);j=N+T;S=j-N;zS[2]=N-(j-S)+(T-S);zS[3]=j;M=4}else{FS[0]=0;A=1;zS[0]=0;M=1}if(c!==0){const t=scale(A,FS,c,NS);l=GS(l,sum(scale(g,wS,c,OS),OS,scale(t,NS,2*G,LS),LS,qS),qS);const e=scale(M,zS,c,RS);l=GS(l,sum_three(scale(e,RS,2*G,OS),OS,scale(e,RS,c,TS),TS,scale(t,NS,c,LS),LS,PS,IS),IS);if(p!==0){l=GS(l,scale(scale(4,bS,c,RS),RS,p,OS),OS)}if(m!==0){l=GS(l,scale(scale(4,vS,-c,RS),RS,m,OS),OS)}}if(h!==0){const t=scale(A,FS,h,NS);l=GS(l,sum(scale(y,AS,h,OS),OS,scale(t,NS,2*X,LS),LS,qS),qS);const e=scale(M,zS,h,RS);l=GS(l,sum_three(scale(e,RS,2*X,OS),OS,scale(e,RS,h,TS),TS,scale(t,NS,h,LS),LS,PS,IS),IS)}}if(f!==0||p!==0){if(d!==0||m!==0||c!==0||h!==0){P=d*X;B=splitter*d;z=B-(B-d);$=d-z;B=splitter*X;R=B-(B-X);O=X-R;q=$*O-(P-z*R-$*R-z*O);I=W*h;B=splitter*W;z=B-(B-W);$=W-z;B=splitter*h;R=B-(B-h);O=h-R;U=$*O-(I-z*R-$*R-z*O);T=q+U;S=T-q;xS[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;xS[1]=L-(T-S)+(I-S);j=N+T;S=j-N;xS[2]=N-(j-S)+(T-S);xS[3]=j;C=-V;F=-m;P=c*C;B=splitter*c;z=B-(B-c);$=c-z;B=splitter*C;R=B-(B-C);O=C-R;q=$*O-(P-z*R-$*R-z*O);I=G*F;B=splitter*G;z=B-(B-G);$=G-z;B=splitter*F;R=B-(B-F);O=F-R;U=$*O-(I-z*R-$*R-z*O);T=q+U;S=T-q;_S[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;_S[1]=L-(T-S)+(I-S);j=N+T;S=j-N;_S[2]=N-(j-S)+(T-S);_S[3]=j;k=sum(4,xS,4,_S,SS);P=d*h;B=splitter*d;z=B-(B-d);$=d-z;B=splitter*h;R=B-(B-h);O=h-R;q=$*O-(P-z*R-$*R-z*O);I=c*m;B=splitter*c;z=B-(B-c);$=c-z;B=splitter*m;R=B-(B-m);O=m-R;U=$*O-(I-z*R-$*R-z*O);T=q-U;S=q-T;$S[0]=q-(T+S)+(S-U);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L-I;S=L-T;$S[1]=L-(T+S)+(S-I);j=N+T;S=j-N;$S[2]=N-(j-S)+(T-S);$S[3]=j;D=4}else{SS[0]=0;k=1;$S[0]=0;D=1}if(f!==0){const t=scale(k,SS,f,NS);l=GS(l,sum(scale(v,kS,f,OS),OS,scale(t,NS,2*Y,LS),LS,qS),qS);const e=scale(D,$S,f,RS);l=GS(l,sum_three(scale(e,RS,2*Y,OS),OS,scale(e,RS,f,TS),TS,scale(t,NS,f,LS),LS,PS,IS),IS);if(m!==0){l=GS(l,scale(scale(4,yS,f,RS),RS,m,OS),OS)}if(h!==0){l=GS(l,scale(scale(4,bS,-f,RS),RS,h,OS),OS)}}if(p!==0){const t=scale(k,SS,p,NS);l=GS(l,sum(scale(b,ES,p,OS),OS,scale(t,NS,2*H,LS),LS,qS),qS);const e=scale(D,$S,p,RS);l=GS(l,sum_three(scale(e,RS,2*H,OS),OS,scale(e,RS,p,TS),TS,scale(t,NS,p,LS),LS,PS,IS),IS)}}if(d!==0||m!==0){if(c!==0||h!==0||f!==0||p!==0){P=c*H;B=splitter*c;z=B-(B-c);$=c-z;B=splitter*H;R=B-(B-H);O=H-R;q=$*O-(P-z*R-$*R-z*O);I=G*p;B=splitter*G;z=B-(B-G);$=G-z;B=splitter*p;R=B-(B-p);O=p-R;U=$*O-(I-z*R-$*R-z*O);T=q+U;S=T-q;xS[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;xS[1]=L-(T-S)+(I-S);j=N+T;S=j-N;xS[2]=N-(j-S)+(T-S);xS[3]=j;C=-X;F=-h;P=f*C;B=splitter*f;z=B-(B-f);$=f-z;B=splitter*C;R=B-(B-C);O=C-R;q=$*O-(P-z*R-$*R-z*O);I=Y*F;B=splitter*Y;z=B-(B-Y);$=Y-z;B=splitter*F;R=B-(B-F);O=F-R;U=$*O-(I-z*R-$*R-z*O);T=q+U;S=T-q;_S[0]=q-(T-S)+(U-S);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L+I;S=T-L;_S[1]=L-(T-S)+(I-S);j=N+T;S=j-N;_S[2]=N-(j-S)+(T-S);_S[3]=j;w=sum(4,xS,4,_S,CS);P=c*p;B=splitter*c;z=B-(B-c);$=c-z;B=splitter*p;R=B-(B-p);O=p-R;q=$*O-(P-z*R-$*R-z*O);I=f*h;B=splitter*f;z=B-(B-f);$=f-z;B=splitter*h;R=B-(B-h);O=h-R;U=$*O-(I-z*R-$*R-z*O);T=q-U;S=q-T;BS[0]=q-(T+S)+(S-U);N=P+T;S=N-P;L=P-(N-S)+(T-S);T=L-I;S=L-T;BS[1]=L-(T+S)+(S-I);j=N+T;S=j-N;BS[2]=N-(j-S)+(T-S);BS[3]=j;E=4}else{CS[0]=0;w=1;BS[0]=0;E=1}if(d!==0){const t=scale(w,CS,d,NS);l=GS(l,sum(scale(x,MS,d,OS),OS,scale(t,NS,2*W,LS),LS,qS),qS);const e=scale(E,BS,d,RS);l=GS(l,sum_three(scale(e,RS,2*W,OS),OS,scale(e,RS,d,TS),TS,scale(t,NS,d,LS),LS,PS,IS),IS);if(h!==0){l=GS(l,scale(scale(4,vS,d,RS),RS,h,OS),OS)}if(p!==0){l=GS(l,scale(scale(4,yS,-d,RS),RS,p,OS),OS)}}if(m!==0){const t=scale(w,CS,m,NS);l=GS(l,sum(scale(_,DS,m,OS),OS,scale(t,NS,2*V,LS),LS,qS),qS);const e=scale(E,BS,m,RS);l=GS(l,sum_three(scale(e,RS,2*V,OS),OS,scale(e,RS,m,TS),TS,scale(t,NS,m,LS),LS,PS,IS),IS)}}return US[l-1]}function WS(t,e,n,i,r,s,a,o){const u=t-a;const l=n-a;const c=r-a;const f=e-o;const d=i-o;const h=s-o;const p=l*h;const m=c*d;const g=u*u+f*f;const y=c*f;const v=u*h;const b=l*l+d*d;const x=u*d;const _=l*f;const w=c*c+h*h;const A=g*(p-m)+b*(y-v)+w*(x-_);const k=(Math.abs(p)+Math.abs(m))*g+(Math.abs(y)+Math.abs(v))*b+(Math.abs(x)+Math.abs(_))*w;const E=fS*k;if(A>E||-A>E){return A}return YS(t,e,n,i,r,s,a,o,k)}function XS(t,e,n,i,r,s,a,o){const u=t-a;const l=e-o;const c=n-a;const f=i-o;const d=r-a;const h=s-o;const p=u*f-c*l;const m=c*h-d*f;const g=d*l-u*h;const y=u*u+l*l;const v=c*c+f*f;const b=d*d+h*h;return y*m+v*g+b*p}const HS=(16+224*yF)*yF;const VS=(5+72*yF)*yF;const QS=(71+1408*yF)*yF*yF;const KS=EF(4);const ZS=EF(4);const JS=EF(4);const tB=EF(4);const eB=EF(4);const nB=EF(4);const iB=EF(4);const rB=EF(4);const sB=EF(4);const aB=EF(4);const oB=EF(24);const uB=EF(24);const lB=EF(24);const cB=EF(24);const fB=EF(24);const dB=EF(24);const hB=EF(24);const pB=EF(24);const mB=EF(24);const gB=EF(24);const yB=EF(1152);const vB=EF(1152);const bB=EF(1152);const xB=EF(1152);const _B=EF(1152);const wB=EF(2304);const AB=EF(2304);const kB=EF(3456);const EB=EF(5760);const MB=EF(8);const DB=EF(8);const CB=EF(8);const FB=EF(16);const SB=EF(24);const BB=EF(48);const zB=EF(48);const $B=EF(96);const RB=EF(192);const OB=EF(384);const TB=EF(384);const NB=EF(384);const LB=EF(768);function PB(t,e,n,i,r,s,a){return sum_three(scale(4,t,i,MB),MB,scale(4,e,r,DB),DB,scale(4,n,s,CB),CB,FB,a)}function qB(t,e,n,i,r,s,a,o,u,l,c,f){const d=sum(sum(t,e,n,i,BB),BB,negate(sum(r,s,a,o,zB),zB),zB,$B);return sum_three(scale(scale(d,$B,u,RB),RB,u,OB),OB,scale(scale(d,$B,l,RB),RB,l,TB),TB,scale(scale(d,$B,c,RB),RB,c,NB),NB,LB,f)}function IB(t,e,n,i,r,s,a,o,u,l,c,f,d,h,p){let m,g,y,v,b,x,_,w,A,k,E,M,D,C;k=t*r;g=splitter*t;y=g-(g-t);v=t-y;g=splitter*r;b=g-(g-r);x=r-b;E=v*x-(k-y*b-v*b-y*x);M=i*e;g=splitter*i;y=g-(g-i);v=i-y;g=splitter*e;b=g-(g-e);x=e-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;KS[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;KS[1]=A-(_+m)+(m-M);C=w+_;m=C-w;KS[2]=w-(C-m)+(_-m);KS[3]=C;k=i*o;g=splitter*i;y=g-(g-i);v=i-y;g=splitter*o;b=g-(g-o);x=o-b;E=v*x-(k-y*b-v*b-y*x);M=a*r;g=splitter*a;y=g-(g-a);v=a-y;g=splitter*r;b=g-(g-r);x=r-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;ZS[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;ZS[1]=A-(_+m)+(m-M);C=w+_;m=C-w;ZS[2]=w-(C-m)+(_-m);ZS[3]=C;k=a*c;g=splitter*a;y=g-(g-a);v=a-y;g=splitter*c;b=g-(g-c);x=c-b;E=v*x-(k-y*b-v*b-y*x);M=l*o;g=splitter*l;y=g-(g-l);v=l-y;g=splitter*o;b=g-(g-o);x=o-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;JS[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;JS[1]=A-(_+m)+(m-M);C=w+_;m=C-w;JS[2]=w-(C-m)+(_-m);JS[3]=C;k=l*h;g=splitter*l;y=g-(g-l);v=l-y;g=splitter*h;b=g-(g-h);x=h-b;E=v*x-(k-y*b-v*b-y*x);M=d*c;g=splitter*d;y=g-(g-d);v=d-y;g=splitter*c;b=g-(g-c);x=c-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;tB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;tB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;tB[2]=w-(C-m)+(_-m);tB[3]=C;k=d*e;g=splitter*d;y=g-(g-d);v=d-y;g=splitter*e;b=g-(g-e);x=e-b;E=v*x-(k-y*b-v*b-y*x);M=t*h;g=splitter*t;y=g-(g-t);v=t-y;g=splitter*h;b=g-(g-h);x=h-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;eB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;eB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;eB[2]=w-(C-m)+(_-m);eB[3]=C;k=t*o;g=splitter*t;y=g-(g-t);v=t-y;g=splitter*o;b=g-(g-o);x=o-b;E=v*x-(k-y*b-v*b-y*x);M=a*e;g=splitter*a;y=g-(g-a);v=a-y;g=splitter*e;b=g-(g-e);x=e-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;nB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;nB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;nB[2]=w-(C-m)+(_-m);nB[3]=C;k=i*c;g=splitter*i;y=g-(g-i);v=i-y;g=splitter*c;b=g-(g-c);x=c-b;E=v*x-(k-y*b-v*b-y*x);M=l*r;g=splitter*l;y=g-(g-l);v=l-y;g=splitter*r;b=g-(g-r);x=r-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;iB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;iB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;iB[2]=w-(C-m)+(_-m);iB[3]=C;k=a*h;g=splitter*a;y=g-(g-a);v=a-y;g=splitter*h;b=g-(g-h);x=h-b;E=v*x-(k-y*b-v*b-y*x);M=d*o;g=splitter*d;y=g-(g-d);v=d-y;g=splitter*o;b=g-(g-o);x=o-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;rB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;rB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;rB[2]=w-(C-m)+(_-m);rB[3]=C;k=l*e;g=splitter*l;y=g-(g-l);v=l-y;g=splitter*e;b=g-(g-e);x=e-b;E=v*x-(k-y*b-v*b-y*x);M=t*c;g=splitter*t;y=g-(g-t);v=t-y;g=splitter*c;b=g-(g-c);x=c-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;sB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;sB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;sB[2]=w-(C-m)+(_-m);sB[3]=C;k=d*r;g=splitter*d;y=g-(g-d);v=d-y;g=splitter*r;b=g-(g-r);x=r-b;E=v*x-(k-y*b-v*b-y*x);M=i*h;g=splitter*i;y=g-(g-i);v=i-y;g=splitter*h;b=g-(g-h);x=h-b;D=v*x-(M-y*b-v*b-y*x);_=E-D;m=E-_;aB[0]=E-(_+m)+(m-D);w=k+_;m=w-k;A=k-(w-m)+(_-m);_=A-M;m=A-_;aB[1]=A-(_+m)+(m-M);C=w+_;m=C-w;aB[2]=w-(C-m)+(_-m);aB[3]=C;const F=PB(KS,ZS,nB,u,n,-s,oB);const S=PB(ZS,JS,iB,f,s,-u,uB);const B=PB(JS,tB,rB,p,u,-f,lB);const z=PB(tB,eB,sB,n,f,-p,cB);const $=PB(eB,KS,aB,s,p,-n,fB);const R=PB(KS,iB,sB,f,n,s,dB);const O=PB(ZS,rB,aB,p,s,u,hB);const T=PB(JS,sB,nB,n,u,f,pB);const N=PB(tB,aB,iB,s,f,p,mB);const L=PB(eB,nB,rB,u,p,n,gB);const P=sum_three(qB(B,lB,O,hB,N,mB,S,uB,t,e,n,yB),yB,qB(z,cB,T,pB,L,gB,B,lB,i,r,s,vB),vB,sum_three(qB($,fB,N,mB,R,dB,z,cB,a,o,u,bB),bB,qB(F,oB,L,gB,O,hB,$,fB,l,c,f,xB),xB,qB(S,uB,R,dB,T,pB,F,oB,d,h,p,_B),_B,AB,kB),kB,wB,EB);return EB[P-1]}const UB=EF(96);const jB=EF(96);const GB=EF(96);const YB=EF(1152);function WB(t,e,n,i,r,s,a,o,u,l){const c=PB(t,e,n,i,r,s,SB);return sum_three(scale(scale(c,SB,a,BB),BB,a,UB),UB,scale(scale(c,SB,o,BB),BB,o,jB),jB,scale(scale(c,SB,u,BB),BB,u,GB),GB,RB,l)}function XB(t,e,n,i,r,s,a,o,u,l,c,f,d,h,p,m){let g,y,v,b,x,_;let w,A,k,E;let M,D,C,F;let S,B,z,$;let R,O,T,N,L,P,q,I,U,j,G,Y,W;const X=t-d;const H=i-d;const V=a-d;const Q=l-d;const K=e-h;const Z=r-h;const J=o-h;const tt=c-h;const et=n-p;const nt=s-p;const it=u-p;const rt=f-p;j=X*Z;O=splitter*X;T=O-(O-X);N=X-T;O=splitter*Z;L=O-(O-Z);P=Z-L;G=N*P-(j-T*L-N*L-T*P);Y=H*K;O=splitter*H;T=O-(O-H);N=H-T;O=splitter*K;L=O-(O-K);P=K-L;W=N*P-(Y-T*L-N*L-T*P);q=G-W;R=G-q;KS[0]=G-(q+R)+(R-W);I=j+q;R=I-j;U=j-(I-R)+(q-R);q=U-Y;R=U-q;KS[1]=U-(q+R)+(R-Y);g=I+q;R=g-I;KS[2]=I-(g-R)+(q-R);KS[3]=g;j=H*J;O=splitter*H;T=O-(O-H);N=H-T;O=splitter*J;L=O-(O-J);P=J-L;G=N*P-(j-T*L-N*L-T*P);Y=V*Z;O=splitter*V;T=O-(O-V);N=V-T;O=splitter*Z;L=O-(O-Z);P=Z-L;W=N*P-(Y-T*L-N*L-T*P);q=G-W;R=G-q;ZS[0]=G-(q+R)+(R-W);I=j+q;R=I-j;U=j-(I-R)+(q-R);q=U-Y;R=U-q;ZS[1]=U-(q+R)+(R-Y);y=I+q;R=y-I;ZS[2]=I-(y-R)+(q-R);ZS[3]=y;j=V*tt;O=splitter*V;T=O-(O-V);N=V-T;O=splitter*tt;L=O-(O-tt);P=tt-L;G=N*P-(j-T*L-N*L-T*P);Y=Q*J;O=splitter*Q;T=O-(O-Q);N=Q-T;O=splitter*J;L=O-(O-J);P=J-L;W=N*P-(Y-T*L-N*L-T*P);q=G-W;R=G-q;JS[0]=G-(q+R)+(R-W);I=j+q;R=I-j;U=j-(I-R)+(q-R);q=U-Y;R=U-q;JS[1]=U-(q+R)+(R-Y);v=I+q;R=v-I;JS[2]=I-(v-R)+(q-R);JS[3]=v;j=Q*K;O=splitter*Q;T=O-(O-Q);N=Q-T;O=splitter*K;L=O-(O-K);P=K-L;G=N*P-(j-T*L-N*L-T*P);Y=X*tt;O=splitter*X;T=O-(O-X);N=X-T;O=splitter*tt;L=O-(O-tt);P=tt-L;W=N*P-(Y-T*L-N*L-T*P);q=G-W;R=G-q;sB[0]=G-(q+R)+(R-W);I=j+q;R=I-j;U=j-(I-R)+(q-R);q=U-Y;R=U-q;sB[1]=U-(q+R)+(R-Y);b=I+q;R=b-I;sB[2]=I-(b-R)+(q-R);sB[3]=b;j=X*J;O=splitter*X;T=O-(O-X);N=X-T;O=splitter*J;L=O-(O-J);P=J-L;G=N*P-(j-T*L-N*L-T*P);Y=V*K;O=splitter*V;T=O-(O-V);N=V-T;O=splitter*K;L=O-(O-K);P=K-L;W=N*P-(Y-T*L-N*L-T*P);q=G-W;R=G-q;nB[0]=G-(q+R)+(R-W);I=j+q;R=I-j;U=j-(I-R)+(q-R);q=U-Y;R=U-q;nB[1]=U-(q+R)+(R-Y);x=I+q;R=x-I;nB[2]=I-(x-R)+(q-R);nB[3]=x;j=H*tt;O=splitter*H;T=O-(O-H);N=H-T;O=splitter*tt;L=O-(O-tt);P=tt-L;G=N*P-(j-T*L-N*L-T*P);Y=Q*Z;O=splitter*Q;T=O-(O-Q);N=Q-T;O=splitter*Z;L=O-(O-Z);P=Z-L;W=N*P-(Y-T*L-N*L-T*P);q=G-W;R=G-q;iB[0]=G-(q+R)+(R-W);I=j+q;R=I-j;U=j-(I-R)+(q-R);q=U-Y;R=U-q;iB[1]=U-(q+R)+(R-Y);_=I+q;R=_-I;iB[2]=I-(_-R)+(q-R);iB[3]=_;const st=sum(sum(negate(WB(ZS,JS,iB,rt,nt,-it,X,K,et,yB),yB),yB,WB(JS,sB,nB,et,it,rt,H,Z,nt,vB),vB,wB),wB,sum(negate(WB(sB,KS,iB,nt,rt,et,V,J,it,bB),bB),bB,WB(KS,ZS,nB,it,et,-nt,Q,tt,rt,xB),xB,AB),AB,YB);let at=estimate(st,YB);let ot=VS*m;if(at>=ot||-at>=ot){return at}R=t-X;w=t-(X+R)+(R-d);R=e-K;M=e-(K+R)+(R-h);R=n-et;S=n-(et+R)+(R-p);R=i-H;A=i-(H+R)+(R-d);R=r-Z;D=r-(Z+R)+(R-h);R=s-nt;B=s-(nt+R)+(R-p);R=a-V;k=a-(V+R)+(R-d);R=o-J;C=o-(J+R)+(R-h);R=u-it;z=u-(it+R)+(R-p);R=l-Q;E=l-(Q+R)+(R-d);R=c-tt;F=c-(tt+R)+(R-h);R=f-rt;$=f-(rt+R)+(R-p);if(w===0&&M===0&&S===0&&A===0&&D===0&&B===0&&k===0&&C===0&&z===0&&E===0&&F===0&&$===0){return at}ot=QS*m+resulterrbound*Math.abs(at);const ut=X*D+Z*w-(K*A+H*M);const lt=H*C+J*A-(Z*k+V*D);const ct=V*F+tt*k-(J*E+Q*C);const ft=Q*M+K*E-(tt*w+X*F);const dt=X*C+J*w-(K*k+V*M);const ht=H*F+tt*A-(Z*E+Q*D);at+=(H*H+Z*Z+nt*nt)*(it*ft+rt*dt+et*ct+(z*b+$*x+S*v))+(Q*Q+tt*tt+rt*rt)*(et*lt-nt*dt+it*ut+(S*y-B*x+z*g))-((X*X+K*K+et*et)*(nt*ct-it*ht+rt*lt+(B*v-z*_+$*y))+(V*V+J*J+it*it)*(rt*ut+et*ht+nt*ft+($*g+S*_+B*b)))+2*((H*A+Z*D+nt*B)*(it*b+rt*x+et*v)+(Q*E+tt*F+rt*$)*(et*y-nt*x+it*g)-((X*w+K*M+et*S)*(nt*v-it*_+rt*y)+(V*k+J*C+it*z)*(rt*g+et*_+nt*b)));if(at>=ot||-at>=ot){return at}return IB(t,e,n,i,r,s,a,o,u,l,c,f,d,h,p)}function HB(t,e,n,i,r,s,a,o,u,l,c,f,d,h,p){const m=t-d;const g=i-d;const y=a-d;const v=l-d;const b=e-h;const x=r-h;const _=o-h;const w=c-h;const A=n-p;const k=s-p;const E=u-p;const M=f-p;const D=m*x;const C=g*b;const F=D-C;const S=g*_;const B=y*x;const z=S-B;const $=y*w;const R=v*_;const O=$-R;const T=v*b;const N=m*w;const L=T-N;const P=m*_;const q=y*b;const I=P-q;const U=g*w;const j=v*x;const G=U-j;const Y=A*z-k*I+E*F;const W=k*O-E*G+M*z;const X=E*L+M*I+A*O;const H=M*F+A*G+k*L;const V=m*m+b*b+A*A;const Q=g*g+x*x+k*k;const K=y*y+_*_+E*E;const Z=v*v+w*w+M*M;const J=K*H-Z*Y+(V*W-Q*X);const tt=Math.abs(A);const et=Math.abs(k);const nt=Math.abs(E);const it=Math.abs(M);const rt=Math.abs(D);const st=Math.abs(C);const at=Math.abs(S);const ot=Math.abs(B);const ut=Math.abs($);const lt=Math.abs(R);const ct=Math.abs(T);const ft=Math.abs(N);const dt=Math.abs(P);const ht=Math.abs(q);const pt=Math.abs(U);const mt=Math.abs(j);const gt=((ut+lt)*et+(mt+pt)*nt+(at+ot)*it)*V+((ct+ft)*nt+(dt+ht)*it+(ut+lt)*tt)*Q+((rt+st)*it+(pt+mt)*tt+(ct+ft)*et)*K+((at+ot)*tt+(ht+dt)*et+(rt+st)*nt)*Z;const yt=HS*gt;if(J>yt||-J>yt){return J}return-XB(t,e,n,i,r,s,a,o,u,l,c,f,d,h,p,gt)}function VB(t,e,n,i,r,s,a,o,u,l,c,f,d,h,p){const m=t-d;const g=i-d;const y=a-d;const v=l-d;const b=e-h;const x=r-h;const _=o-h;const w=c-h;const A=n-p;const k=s-p;const E=u-p;const M=f-p;const D=m*x-g*b;const C=g*_-y*x;const F=y*w-v*_;const S=v*b-m*w;const B=m*_-y*b;const z=g*w-v*x;const $=A*C-k*B+E*D;const R=k*F-E*z+M*C;const O=E*S+M*B+A*F;const T=M*D+A*z+k*S;const N=m*m+b*b+A*A;const L=g*g+x*x+k*k;const P=y*y+_*_+E*E;const q=v*v+w*w+M*M;return P*T-q*$+(N*R-L*O)}const QB=Math.pow(2,-52);const KB=new Uint32Array(512);class ZB{static from(t,e=az,n=oz){const i=t.length;const r=new Float64Array(i*2);for(let s=0;s>1;if(e>0&&typeof t[0]!=="number")throw new Error("Expected coords to contain numbers.");this.coords=t;const n=Math.max(2*e-5,0);this._triangles=new Uint32Array(n*3);this._halfedges=new Int32Array(n*3);this._hashSize=Math.ceil(Math.sqrt(e));this._hullPrev=new Uint32Array(e);this._hullNext=new Uint32Array(e);this._hullTri=new Uint32Array(e);this._hullHash=new Int32Array(this._hashSize).fill(-1);this._ids=new Uint32Array(e);this._dists=new Float64Array(e);this.update()}update(){const{coords:t,_hullPrev:e,_hullNext:n,_hullTri:i,_hullHash:r}=this;const s=t.length>>1;let a=Infinity;let o=Infinity;let u=-Infinity;let l=-Infinity;for(let E=0;Eu)u=e;if(n>l)l=n;this._ids[E]=E}const c=(a+u)/2;const f=(o+l)/2;let d=Infinity;let h,p,m;for(let E=0;E0){p=E;d=e}}let v=t[2*p];let b=t[2*p+1];let x=Infinity;for(let E=0;Ei){e[n++]=r;i=this._dists[r]}}this.hull=e.subarray(0,n);this.triangles=new Uint32Array(0);this.halfedges=new Uint32Array(0);return}if(OF(g,y,v,b,_,w)<0){const t=p;const e=v;const n=b;p=m;v=_;b=w;m=t;_=e;w=n}const A=iz(g,y,v,b,_,w);this._cx=A.x;this._cy=A.y;for(let E=0;E0&&Math.abs(a-M)<=QB&&Math.abs(o-D)<=QB)continue;M=a;D=o;if(s===h||s===p||s===m)continue;let u=0;for(let t=0,e=this._hashKey(a,o);t=0){l=c;if(l===u){l=-1;break}}if(l===-1)continue;let f=this._addTriangle(l,s,n[l],-1,-1,i[l]);i[s]=this._legalize(f+2);i[l]=f;k++;let d=n[l];while(c=n[d],OF(a,o,t[2*d],t[2*d+1],t[2*c],t[2*c+1])<0){f=this._addTriangle(d,s,c,i[s],-1,i[d]);i[s]=this._legalize(f+2);n[d]=d;k--;d=c}if(l===u){while(c=e[l],OF(a,o,t[2*c],t[2*c+1],t[2*l],t[2*l+1])<0){f=this._addTriangle(c,s,l,-1,i[l],i[c]);this._legalize(f+2);i[c]=f;n[l]=l;k--;l=c}}this._hullStart=e[s]=l;n[l]=e[d]=s;n[s]=d;r[this._hashKey(a,o)]=s;r[this._hashKey(t[2*l],t[2*l+1])]=l}this.hull=new Uint32Array(k);for(let E=0,M=this._hullStart;E0?3-n:1+n)/4}function tz(t,e,n,i){const r=t-n;const s=e-i;return r*r+s*s}function ez(t,e,n,i,r,s,a,o){const u=t-a;const l=e-o;const c=n-a;const f=i-o;const d=r-a;const h=s-o;const p=u*u+l*l;const m=c*c+f*f;const g=d*d+h*h;return u*(f*g-m*h)-l*(c*g-m*d)+p*(c*h-f*d)<0}function nz(t,e,n,i,r,s){const a=n-t;const o=i-e;const u=r-t;const l=s-e;const c=a*a+o*o;const f=u*u+l*l;const d=.5/(a*l-o*u);const h=(l*c-o*f)*d;const p=(a*f-u*c)*d;return h*h+p*p}function iz(t,e,n,i,r,s){const a=n-t;const o=i-e;const u=r-t;const l=s-e;const c=a*a+o*o;const f=u*u+l*l;const d=.5/(a*l-o*u);const h=t+(l*c-o*f)*d;const p=e+(a*f-u*c)*d;return{x:h,y:p}}function rz(t,e,n,i){if(i-n<=20){for(let r=n+1;r<=i;r++){const i=t[r];const s=e[i];let a=r-1;while(a>=n&&e[t[a]]>s)t[a+1]=t[a--];t[a+1]=i}}else{const r=n+i>>1;let s=n+1;let a=i;sz(t,r,s);if(e[t[n]]>e[t[i]])sz(t,n,i);if(e[t[s]]>e[t[i]])sz(t,s,i);if(e[t[n]]>e[t[s]])sz(t,n,s);const o=t[s];const u=e[o];while(true){do{s++}while(e[t[s]]u);if(a=a-n){rz(t,e,s,i);rz(t,e,n,a-1)}else{rz(t,e,n,a-1);rz(t,e,s,i)}}}function sz(t,e,n){const i=t[e];t[e]=t[n];t[n]=i}function az(t){return t[0]}function oz(t){return t[1]}const uz=1e-6;class lz{constructor(){this._x0=this._y0=this._x1=this._y1=null;this._=""}moveTo(t,e){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}`}closePath(){if(this._x1!==null){this._x1=this._x0,this._y1=this._y0;this._+="Z"}}lineTo(t,e){this._+=`L${this._x1=+t},${this._y1=+e}`}arc(t,e,n){t=+t,e=+e,n=+n;const i=t+n;const r=e;if(n<0)throw new Error("negative radius");if(this._x1===null)this._+=`M${i},${r}`;else if(Math.abs(this._x1-i)>uz||Math.abs(this._y1-r)>uz)this._+="L"+i+","+r;if(!n)return;this._+=`A${n},${n},0,1,1,${t-n},${e}A${n},${n},0,1,1,${this._x1=i},${this._y1=r}`}rect(t,e,n,i){this._+=`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${+n}v${+i}h${-n}Z`}value(){return this._||null}}class cz{constructor(){this._=[]}moveTo(t,e){this._.push([t,e])}closePath(){this._.push(this._[0].slice())}lineTo(t,e){this._.push([t,e])}value(){return this._.length?this._:null}}class fz{constructor(t,[e,n,i,r]=[0,0,960,500]){if(!((i=+i)>=(e=+e))||!((r=+r)>=(n=+n)))throw new Error("invalid bounds");this.delaunay=t;this._circumcenters=new Float64Array(t.points.length*2);this.vectors=new Float64Array(t.points.length*2);this.xmax=i,this.xmin=e;this.ymax=r,this.ymin=n;this._init()}update(){this.delaunay.update();this._init();return this}_init(){const{delaunay:{points:t,hull:e,triangles:n},vectors:i}=this;let r,s;const a=this.circumcenters=this._circumcenters.subarray(0,n.length/3*2);for(let p=0,m=0,g=n.length,y,v;p1)r-=2;for(let s=2;s0){if(e>=this.ymax)return null;if((s=(this.ymax-e)/i)0){if(t>=this.xmax)return null;if((s=(this.xmax-t)/n)this.xmax?2:0)|(ethis.ymax?8:0)}_simplify(t){if(t&&t.length>4){for(let e=0;e1e-10)return false}return true}function yz(t,e,n){return[t+Math.sin(t+e)*n,e+Math.cos(t-e)*n]}class vz{static from(t,e=pz,n=mz,i){return new vz("length"in t?bz(t,e,n,i):Float64Array.from(xz(t,e,n,i)))}constructor(t){this._delaunator=new ZB(t);this.inedges=new Int32Array(t.length/2);this._hullIndex=new Int32Array(t.length/2);this.points=this._delaunator.coords;this._init()}update(){this._delaunator.update();this._init();return this}_init(){const t=this._delaunator,e=this.points;if(t.hull&&t.hull.length>2&&gz(t)){this.collinear=Int32Array.from({length:e.length/2},((t,e)=>e)).sort(((t,n)=>e[2*t]-e[2*n]||e[2*t+1]-e[2*n+1]));const t=this.collinear[0],n=this.collinear[this.collinear.length-1],i=[e[2*t],e[2*t+1],e[2*n],e[2*n+1]],r=1e-8*Math.hypot(i[3]-i[1],i[2]-i[0]);for(let s=0,a=e.length/2;s0){this.triangles=new Int32Array(3).fill(-1);this.halfedges=new Int32Array(3).fill(-1);this.triangles[0]=i[0];s[i[0]]=1;if(i.length===2){s[i[1]]=0;this.triangles[1]=i[1];this.triangles[2]=i[1]}}}voronoi(t){return new fz(this,t)}*neighbors(t){const{inedges:e,hull:n,_hullIndex:i,halfedges:r,triangles:s,collinear:a}=this;if(a){const e=a.indexOf(t);if(e>0)yield a[e-1];if(e=0&&r!==n&&r!==i)n=r;return r}_step(t,e,n){const{inedges:i,hull:r,_hullIndex:s,halfedges:a,triangles:o,points:u}=this;if(i[t]===-1||!u.length)return(t+1)%(u.length>>1);let l=t;let c=hz(e-u[t*2],2)+hz(n-u[t*2+1],2);const f=i[t];let d=f;do{let i=o[d];const f=hz(e-u[i*2],2)+hz(n-u[i*2+1],2);if(f>5,Dz=1<<11;function Cz(){var t=[256,256],e,n,i,r,s,a,o,u=$z,l=[],c=Math.random,f={};f.layout=function(){var u=d(Ko()),f=Oz((t[0]>>5)*t[1]),p=null,m=l.length,g=-1,y=[],v=l.map((t=>({text:e(t),font:n(t),style:r(t),weight:s(t),rotate:a(t),size:~~(i(t)+1e-14),padding:o(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:false,sprite:null,datum:t}))).sort(((t,e)=>e.size-t.size));while(++g>1;b.y=t[1]*(c()+.5)>>1;Fz(u,b,v,g);if(b.hasText&&h(f,b,p)){y.push(b);if(p)Bz(p,b);else p=[{x:b.x+b.x0,y:b.y+b.y0},{x:b.x+b.x1,y:b.y+b.y1}];b.x-=t[0]>>1;b.y-=t[1]>>1}}return y};function d(t){t.width=t.height=1;var e=Math.sqrt(t.getContext("2d").getImageData(0,0,1,1).data.length>>2);t.width=(Mz<<5)/e;t.height=Dz/e;var n=t.getContext("2d");n.fillStyle=n.strokeStyle="red";n.textAlign="center";return{context:n,ratio:e}}function h(e,n,i){var r=n.x,s=n.y,a=Math.hypot(t[0],t[1]),o=u(t),l=c()<.5?1:-1,f=-l,d,h,p;while(d=o(f+=l)){h=~~d[0];p=~~d[1];if(Math.min(Math.abs(h),Math.abs(p))>=a)break;n.x=r+h;n.y=s+p;if(n.x+n.x0<0||n.y+n.y0<0||n.x+n.x1>t[0]||n.y+n.y1>t[1])continue;if(!i||!Sz(n,e,t[0])){if(!i||zz(n,i)){var m=n.sprite,g=n.width>>5,y=t[0]>>5,v=n.x-(g<<4),b=v&127,x=32-b,_=n.y1-n.y0,w=(n.y+n.y0)*y+(v>>5),A;for(var k=0;k<_;k++){A=0;for(var E=0;E<=g;E++){e[w+E]|=A<>>b:0)}w+=y}n.sprite=null;return true}}}return false}f.words=function(t){if(arguments.length){l=t;return f}else{return l}};f.size=function(e){if(arguments.length){t=[+e[0],+e[1]];return f}else{return t}};f.font=function(t){if(arguments.length){n=Tz(t);return f}else{return n}};f.fontStyle=function(t){if(arguments.length){r=Tz(t);return f}else{return r}};f.fontWeight=function(t){if(arguments.length){s=Tz(t);return f}else{return s}};f.rotate=function(t){if(arguments.length){a=Tz(t);return f}else{return a}};f.text=function(t){if(arguments.length){e=Tz(t);return f}else{return e}};f.spiral=function(t){if(arguments.length){u=Nz[t]||t;return f}else{return u}};f.fontSize=function(t){if(arguments.length){i=Tz(t);return f}else{return i}};f.padding=function(t){if(arguments.length){o=Tz(t);return f}else{return o}};f.random=function(t){if(arguments.length){c=t;return f}else{return c}};return f}function Fz(t,e,n,i){if(e.sprite)return;var r=t.context,s=t.ratio;r.clearRect(0,0,(Mz<<5)/s,Dz/s);var a=0,o=0,u=0,l=n.length,c,f,d,h,p;--i;while(++i>5<<5;d=~~Math.max(Math.abs(v+b),Math.abs(v-b))}else{c=c+31>>5<<5}if(d>u)u=d;if(a+c>=Mz<<5){a=0;o+=u;u=0}if(o+d>=Dz)break;r.translate((a+(c>>1))/s,(o+(d>>1))/s);if(e.rotate)r.rotate(e.rotate*Ez);r.fillText(e.text,0,0);if(e.padding){r.lineWidth=2*e.padding;r.strokeText(e.text,0,0)}r.restore();e.width=c;e.height=d;e.xoff=a;e.yoff=o;e.x1=c>>1;e.y1=d>>1;e.x0=-e.x1;e.y0=-e.y1;e.hasText=true;a+=c}var _=r.getImageData(0,0,(Mz<<5)/s,Dz/s).data,w=[];while(--i>=0){e=n[i];if(!e.hasText)continue;c=e.width;f=c>>5;d=e.y1-e.y0;for(h=0;h>5),M=_[(o+p)*(Mz<<5)+(a+h)<<2]?1<<31-h%32:0;w[E]|=M;A|=M}if(A)k=p;else{e.y0++;d--;p--;o++}}e.y1=e.y0+k;e.sprite=w.slice(0,(e.y1-e.y0)*f)}}function Sz(t,e,n){n>>=5;var i=t.sprite,r=t.width>>5,s=t.x-(r<<4),a=s&127,o=32-a,u=t.y1-t.y0,l=(t.y+t.y0)*n+(s>>5),c;for(var f=0;f>>a:0))&e[l+d])return true}l+=n}return false}function Bz(t,e){var n=t[0],i=t[1];if(e.x+e.x0i.x)i.x=e.x+e.x1;if(e.y+e.y1>i.y)i.y=e.y+e.y1}function zz(t,e){return t.x+t.x1>e[0].x&&t.x+t.x0e[0].y&&t.y+t.y0e(t(n))}r.forEach((t=>{t[a[0]]=NaN;t[a[1]]=NaN;t[a[3]]=0}));const l=s.words(r).text(t.text).size(t.size||[500,500]).padding(t.padding||1).spiral(t.spiral||"archimedean").rotate(t.rotate||0).font(t.font||"sans-serif").fontStyle(t.fontStyle||"normal").fontWeight(t.fontWeight||"normal").fontSize(o).random(ir).layout();const c=s.size(),f=c[0]>>1,d=c[1]>>1,h=l.length;for(let p=0,m,g;pt[e]))}const Uz=t=>new Uint8Array(t);const jz=t=>new Uint16Array(t);const Gz=t=>new Uint32Array(t);function Yz(){let t=8,e=[],n=Gz(0),i=Xz(0,t),r=Xz(0,t);return{data:()=>e,seen:()=>n=Wz(n,e.length),add(t){for(let n=0,i=e.length,r=t.length,s;ne.length,curr:()=>i,prev:()=>r,reset:t=>r[t]=i[t],all:()=>t<257?255:t<65537?65535:4294967295,set(t,e){i[t]|=e},clear(t,e){i[t]&=~e},resize(e,n){const s=i.length;if(e>s||n>t){t=Math.max(n,t);i=Xz(e,t,i);r=Xz(e,t)}}}}function Wz(t,e,n){if(t.length>=e)return t;n=n||new t.constructor(e);n.set(t);return n}function Xz(t,e,n){const i=(e<257?Uz:e<65537?jz:Gz)(t);if(n)i.set(n);return i}function Hz(t,e,n){const i=1<0)for(d=0;dt,size:()=>n}}function Qz(t,e){t.sort.call(e,((e,n)=>{const i=t[e],r=t[n];return ir?1:0}));return Iz(t,e)}function Kz(t,e,n,i,r,s,a,o,u){let l=0,c=0,f;for(f=0;le.modified(t.fields)));return n?this.reinit(t,e):this.eval(t,e)}},init(t,e){const n=t.fields,i=t.query,r=this._indices={},s=this._dims=[],a=i.length;let o=0,u,l;for(;o{const t=r.remove(e,n);for(const e in i)i[e].reindex(t)}))},update(t,e,n){const i=this._dims,r=t.query,s=e.stamp,a=i.length;let o=0,u,l;n.filters=0;for(l=0;lh){for(g=h,y=Math.min(f,p);gp){for(g=Math.max(f,p),y=d;gf){for(p=f,m=Math.min(l,d);pd){for(p=Math.max(l,d),m=c;p!(o[t]&n)?a[t]:null;s.filter(s.MOD,l);if(!(r&r-1)){s.filter(s.ADD,l);s.filter(s.REM,(t=>(o[t]&n)===r?a[t]:null))}else{s.filter(s.ADD,(t=>{const e=o[t]&n,i=!e&&e^u[t]&n;return i?a[t]:null}));s.filter(s.REM,(t=>{const e=o[t]&n,i=e&&!(e^(e^u[t]&n));return i?a[t]:null}))}return s.filter(s.SOURCE,(t=>l(t._index)))}});const t$="RawCode";const e$="Literal";const n$="Property";const i$="Identifier";const r$="ArrayExpression";const s$="BinaryExpression";const a$="CallExpression";const o$="ConditionalExpression";const u$="LogicalExpression";const l$="MemberExpression";const c$="ObjectExpression";const f$="UnaryExpression";function d$(t){this.type=t}d$.prototype.visit=function(t){let e,n,i;if(t(this))return 1;for(e=h$(this),n=0,i=e.length;n";p$[_$]="Identifier";p$[w$]="Keyword";p$[A$]="Null";p$[k$]="Numeric";p$[E$]="Punctuator";p$[M$]="String";p$[D$]="RegularExpression";var C$="ArrayExpression",F$="BinaryExpression",S$="CallExpression",B$="ConditionalExpression",z$="Identifier",$$="Literal",R$="LogicalExpression",O$="MemberExpression",T$="ObjectExpression",N$="Property",L$="UnaryExpression";var P$="Unexpected token %0",q$="Unexpected number",I$="Unexpected string",U$="Unexpected identifier",j$="Unexpected reserved word",G$="Unexpected end of input",Y$="Invalid regular expression",W$="Invalid regular expression: missing /",X$="Octal literals are not allowed in strict mode.",H$="Duplicate data property in object literal not allowed in strict mode";var V$="ILLEGAL",Q$="Disabled.";var K$=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u08A0-\\u08B2\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58\\u0C59\\u0C60\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D60\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1877\\u1880-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19C1-\\u19C7\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4B\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1CE9-\\u1CEC\\u1CEE-\\u1CF1\\u1CF5\\u1CF6\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6EF\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]"),Z$=new RegExp("[\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0300-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u0483-\\u0487\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u0591-\\u05BD\\u05BF\\u05C1\\u05C2\\u05C4\\u05C5\\u05C7\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0610-\\u061A\\u0620-\\u0669\\u066E-\\u06D3\\u06D5-\\u06DC\\u06DF-\\u06E8\\u06EA-\\u06FC\\u06FF\\u0710-\\u074A\\u074D-\\u07B1\\u07C0-\\u07F5\\u07FA\\u0800-\\u082D\\u0840-\\u085B\\u08A0-\\u08B2\\u08E4-\\u0963\\u0966-\\u096F\\u0971-\\u0983\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BC-\\u09C4\\u09C7\\u09C8\\u09CB-\\u09CE\\u09D7\\u09DC\\u09DD\\u09DF-\\u09E3\\u09E6-\\u09F1\\u0A01-\\u0A03\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A3C\\u0A3E-\\u0A42\\u0A47\\u0A48\\u0A4B-\\u0A4D\\u0A51\\u0A59-\\u0A5C\\u0A5E\\u0A66-\\u0A75\\u0A81-\\u0A83\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABC-\\u0AC5\\u0AC7-\\u0AC9\\u0ACB-\\u0ACD\\u0AD0\\u0AE0-\\u0AE3\\u0AE6-\\u0AEF\\u0B01-\\u0B03\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3C-\\u0B44\\u0B47\\u0B48\\u0B4B-\\u0B4D\\u0B56\\u0B57\\u0B5C\\u0B5D\\u0B5F-\\u0B63\\u0B66-\\u0B6F\\u0B71\\u0B82\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BBE-\\u0BC2\\u0BC6-\\u0BC8\\u0BCA-\\u0BCD\\u0BD0\\u0BD7\\u0BE6-\\u0BEF\\u0C00-\\u0C03\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D-\\u0C44\\u0C46-\\u0C48\\u0C4A-\\u0C4D\\u0C55\\u0C56\\u0C58\\u0C59\\u0C60-\\u0C63\\u0C66-\\u0C6F\\u0C81-\\u0C83\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBC-\\u0CC4\\u0CC6-\\u0CC8\\u0CCA-\\u0CCD\\u0CD5\\u0CD6\\u0CDE\\u0CE0-\\u0CE3\\u0CE6-\\u0CEF\\u0CF1\\u0CF2\\u0D01-\\u0D03\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D-\\u0D44\\u0D46-\\u0D48\\u0D4A-\\u0D4E\\u0D57\\u0D60-\\u0D63\\u0D66-\\u0D6F\\u0D7A-\\u0D7F\\u0D82\\u0D83\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0DCA\\u0DCF-\\u0DD4\\u0DD6\\u0DD8-\\u0DDF\\u0DE6-\\u0DEF\\u0DF2\\u0DF3\\u0E01-\\u0E3A\\u0E40-\\u0E4E\\u0E50-\\u0E59\\u0E81\\u0E82\\u0E84\\u0E87\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA\\u0EAB\\u0EAD-\\u0EB9\\u0EBB-\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EC8-\\u0ECD\\u0ED0-\\u0ED9\\u0EDC-\\u0EDF\\u0F00\\u0F18\\u0F19\\u0F20-\\u0F29\\u0F35\\u0F37\\u0F39\\u0F3E-\\u0F47\\u0F49-\\u0F6C\\u0F71-\\u0F84\\u0F86-\\u0F97\\u0F99-\\u0FBC\\u0FC6\\u1000-\\u1049\\u1050-\\u109D\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u135D-\\u135F\\u1380-\\u138F\\u13A0-\\u13F4\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16EE-\\u16F8\\u1700-\\u170C\\u170E-\\u1714\\u1720-\\u1734\\u1740-\\u1753\\u1760-\\u176C\\u176E-\\u1770\\u1772\\u1773\\u1780-\\u17D3\\u17D7\\u17DC\\u17DD\\u17E0-\\u17E9\\u180B-\\u180D\\u1810-\\u1819\\u1820-\\u1877\\u1880-\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1920-\\u192B\\u1930-\\u193B\\u1946-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u19D0-\\u19D9\\u1A00-\\u1A1B\\u1A20-\\u1A5E\\u1A60-\\u1A7C\\u1A7F-\\u1A89\\u1A90-\\u1A99\\u1AA7\\u1AB0-\\u1ABD\\u1B00-\\u1B4B\\u1B50-\\u1B59\\u1B6B-\\u1B73\\u1B80-\\u1BF3\\u1C00-\\u1C37\\u1C40-\\u1C49\\u1C4D-\\u1C7D\\u1CD0-\\u1CD2\\u1CD4-\\u1CF6\\u1CF8\\u1CF9\\u1D00-\\u1DF5\\u1DFC-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u200C\\u200D\\u203F\\u2040\\u2054\\u2071\\u207F\\u2090-\\u209C\\u20D0-\\u20DC\\u20E1\\u20E5-\\u20F0\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2160-\\u2188\\u2C00-\\u2C2E\\u2C30-\\u2C5E\\u2C60-\\u2CE4\\u2CEB-\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D7F-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2DE0-\\u2DFF\\u2E2F\\u3005-\\u3007\\u3021-\\u302F\\u3031-\\u3035\\u3038-\\u303C\\u3041-\\u3096\\u3099\\u309A\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312D\\u3131-\\u318E\\u31A0-\\u31BA\\u31F0-\\u31FF\\u3400-\\u4DB5\\u4E00-\\u9FCC\\uA000-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA62B\\uA640-\\uA66F\\uA674-\\uA67D\\uA67F-\\uA69D\\uA69F-\\uA6F1\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA78E\\uA790-\\uA7AD\\uA7B0\\uA7B1\\uA7F7-\\uA827\\uA840-\\uA873\\uA880-\\uA8C4\\uA8D0-\\uA8D9\\uA8E0-\\uA8F7\\uA8FB\\uA900-\\uA92D\\uA930-\\uA953\\uA960-\\uA97C\\uA980-\\uA9C0\\uA9CF-\\uA9D9\\uA9E0-\\uA9FE\\uAA00-\\uAA36\\uAA40-\\uAA4D\\uAA50-\\uAA59\\uAA60-\\uAA76\\uAA7A-\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEF\\uAAF2-\\uAAF6\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB5F\\uAB64\\uAB65\\uABC0-\\uABEA\\uABEC\\uABED\\uABF0-\\uABF9\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE00-\\uFE0F\\uFE20-\\uFE2D\\uFE33\\uFE34\\uFE4D-\\uFE4F\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF10-\\uFF19\\uFF21-\\uFF3A\\uFF3F\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC]");function J$(t,e){if(!t){throw new Error("ASSERT: "+e)}}function tR(t){return t>=48&&t<=57}function eR(t){return"0123456789abcdefABCDEF".includes(t)}function nR(t){return"01234567".includes(t)}function iR(t){return t===32||t===9||t===11||t===12||t===160||t>=5760&&[5760,6158,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288,65279].includes(t)}function rR(t){return t===10||t===13||t===8232||t===8233}function sR(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t===92||t>=128&&K$.test(String.fromCharCode(t))}function aR(t){return t===36||t===95||t>=65&&t<=90||t>=97&&t<=122||t>=48&&t<=57||t===92||t>=128&&Z$.test(String.fromCharCode(t))}const oR={if:1,in:1,do:1,var:1,for:1,new:1,try:1,let:1,this:1,else:1,case:1,void:1,with:1,enum:1,while:1,break:1,catch:1,throw:1,const:1,yield:1,class:1,super:1,return:1,typeof:1,delete:1,switch:1,export:1,import:1,public:1,static:1,default:1,finally:1,extends:1,package:1,private:1,function:1,continue:1,debugger:1,interface:1,protected:1,instanceof:1,implements:1};function uR(){while(g$1114111||t!=="}"){NR({},P$,V$)}if(e<=65535){return String.fromCharCode(e)}n=(e-65536>>10)+55296;i=(e-65536&1023)+56320;return String.fromCharCode(n,i)}function fR(){var t,e;t=m$.charCodeAt(g$++);e=String.fromCharCode(t);if(t===92){if(m$.charCodeAt(g$)!==117){NR({},P$,V$)}++g$;t=lR("u");if(!t||t==="\\"||!sR(t.charCodeAt(0))){NR({},P$,V$)}e=t}while(g$>>="){g$+=4;return{type:E$,value:a,start:t,end:g$}}s=a.substr(0,3);if(s===">>>"||s==="<<="||s===">>="){g$+=3;return{type:E$,value:s,start:t,end:g$}}r=s.substr(0,2);if(i===r[1]&&"+-<>&|".includes(i)||r==="=>"){g$+=2;return{type:E$,value:r,start:t,end:g$}}if(r==="//"){NR({},P$,V$)}if("<>=!+-*%&|^/".includes(i)){++g$;return{type:E$,value:i,start:t,end:g$}}NR({},P$,V$)}function mR(t){let e="";while(g${if(parseInt(e,16)<=1114111){return"x"}NR({},Y$)})).replace(/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,"x")}try{new RegExp(n)}catch(i){NR({},Y$)}try{return new RegExp(t,e)}catch(r){return null}}function xR(){var t,e,n,i,r;t=m$[g$];J$(t==="/","Regular expression literal must start with a slash");e=m$[g$++];n=false;i=false;while(g$=0){NR({},Y$,n)}return{value:n,literal:e}}function wR(){var t,e,n,i;v$=null;uR();t=g$;e=xR();n=_R();i=bR(e.value,n.value);return{literal:e.literal+n.literal,value:i,regex:{pattern:e.value,flags:n.value},start:t,end:g$}}function AR(t){return t.type===_$||t.type===w$||t.type===b$||t.type===A$}function kR(){uR();if(g$>=y$){return{type:x$,start:g$,end:g$}}const t=m$.charCodeAt(g$);if(sR(t)){return hR()}if(t===40||t===41||t===59){return pR()}if(t===39||t===34){return vR()}if(t===46){if(tR(m$.charCodeAt(g$+1))){return yR()}return pR()}if(tR(t)){return yR()}return pR()}function ER(){const t=v$;g$=t.end;v$=kR();g$=t.end;return t}function MR(){const t=g$;v$=kR();g$=t}function DR(t){const e=new d$(C$);e.elements=t;return e}function CR(t,e,n){const i=new d$(t==="||"||t==="&&"?R$:F$);i.operator=t;i.left=e;i.right=n;return i}function FR(t,e){const n=new d$(S$);n.callee=t;n.arguments=e;return n}function SR(t,e,n){const i=new d$(B$);i.test=t;i.consequent=e;i.alternate=n;return i}function BR(t){const e=new d$(z$);e.name=t;return e}function zR(t){const e=new d$($$);e.value=t.value;e.raw=m$.slice(t.start,t.end);if(t.regex){if(e.raw==="//"){e.raw="/(?:)/"}e.regex=t.regex}return e}function $R(t,e,n){const i=new d$(O$);i.computed=t==="[";i.object=e;i.property=n;if(!i.computed)n.member=true;return i}function RR(t){const e=new d$(T$);e.properties=t;return e}function OR(t,e,n){const i=new d$(N$);i.key=e;i.value=n;i.kind=t;return i}function TR(t,e){const n=new d$(L$);n.operator=t;n.argument=e;n.prefix=true;return n}function NR(t,e){var n,i=Array.prototype.slice.call(arguments,2),r=e.replace(/%(\d)/g,((t,e)=>{J$(e":case"<=":case">=":case"instanceof":case"in":e=7;break;case"<<":case">>":case">>>":e=8;break;case"+":case"-":e=9;break;case"*":case"/":case"%":e=11;break}return e}function iO(){var t,e,n,i,r,s,a,o,u,l;t=v$;u=eO();i=v$;r=nO(i);if(r===0){return u}i.prec=r;ER();e=[t,v$];a=eO();s=[u,i,a];while((r=nO(v$))>0){while(s.length>2&&r<=s[s.length-2].prec){a=s.pop();o=s.pop().value;u=s.pop();e.pop();n=CR(o,u,a);s.push(n)}i=ER();i.prec=r;s.push(i);e.push(v$);n=eO();s.push(n)}l=s.length-1;n=s[l];e.pop();while(l>1){e.pop();n=CR(s[l-1].value,s[l-2],n);l-=2}return n}function rO(){var t,e,n;t=iO();if(qR("?")){ER();e=rO();PR(":");n=rO();t=SR(t,e,n)}return t}function sO(){const t=rO();if(qR(",")){throw new Error(Q$)}return t}function aO(t){m$=t;g$=0;y$=m$.length;v$=null;MR();const e=sO();if(v$.type!==x$){throw new Error("Unexpect token after expression.")}return e}var oO={NaN:"NaN",E:"Math.E",LN2:"Math.LN2",LN10:"Math.LN10",LOG2E:"Math.LOG2E",LOG10E:"Math.LOG10E",PI:"Math.PI",SQRT1_2:"Math.SQRT1_2",SQRT2:"Math.SQRT2",MIN_VALUE:"Number.MIN_VALUE",MAX_VALUE:"Number.MAX_VALUE"};function uO(t){function e(e,n,i,r){let s=t(n[0]);if(i){s=i+"("+s+")";if(i.lastIndexOf("new ",0)===0)s="("+s+")"}return s+"."+e+(r<0?"":r===0?"()":"("+n.slice(1).map(t).join(",")+")")}function n(t,n,i){return r=>e(t,r,n,i)}const i="new Date",r="String",s="RegExp";return{isNaN:"Number.isNaN",isFinite:"Number.isFinite",abs:"Math.abs",acos:"Math.acos",asin:"Math.asin",atan:"Math.atan",atan2:"Math.atan2",ceil:"Math.ceil",cos:"Math.cos",exp:"Math.exp",floor:"Math.floor",hypot:"Math.hypot",log:"Math.log",max:"Math.max",min:"Math.min",pow:"Math.pow",random:"Math.random",round:"Math.round",sin:"Math.sin",sqrt:"Math.sqrt",tan:"Math.tan",clamp:function(e){if(e.length<3)(0,p.z3)("Missing arguments to clamp function.");if(e.length>3)(0,p.z3)("Too many arguments to clamp function.");const n=e.map(t);return"Math.max("+n[1]+", Math.min("+n[2]+","+n[0]+"))"},now:"Date.now",utc:"Date.UTC",datetime:i,date:n("getDate",i,0),day:n("getDay",i,0),year:n("getFullYear",i,0),month:n("getMonth",i,0),hours:n("getHours",i,0),minutes:n("getMinutes",i,0),seconds:n("getSeconds",i,0),milliseconds:n("getMilliseconds",i,0),time:n("getTime",i,0),timezoneoffset:n("getTimezoneOffset",i,0),utcdate:n("getUTCDate",i,0),utcday:n("getUTCDay",i,0),utcyear:n("getUTCFullYear",i,0),utcmonth:n("getUTCMonth",i,0),utchours:n("getUTCHours",i,0),utcminutes:n("getUTCMinutes",i,0),utcseconds:n("getUTCSeconds",i,0),utcmilliseconds:n("getUTCMilliseconds",i,0),length:n("length",null,-1),parseFloat:"parseFloat",parseInt:"parseInt",upper:n("toUpperCase",r,0),lower:n("toLowerCase",r,0),substring:n("substring",r),split:n("split",r),trim:n("trim",r,0),btoa:"btoa",atob:"atob",regexp:s,test:n("test",s),if:function(e){if(e.length<3)(0,p.z3)("Missing arguments to if function.");if(e.length>3)(0,p.z3)("Too many arguments to if function.");const n=e.map(t);return"("+n[0]+"?"+n[1]+":"+n[2]+")"}}}function lO(t){const e=t&&t.length-1;return e&&(t[0]==='"'&&t[e]==='"'||t[0]==="'"&&t[e]==="'")?t.slice(1,-1):t}function cO(t){t=t||{};const e=t.allowed?(0,p.M1)(t.allowed):{},n=t.forbidden?(0,p.M1)(t.forbidden):{},i=t.constants||oO,r=(t.functions||uO)(f),s=t.globalvar,a=t.fieldvar,o=(0,p.Tn)(s)?s:t=>`${s}["${t}"]`;let u={},l={},c=0;function f(t){if((0,p.Kg)(t))return t;const e=d[t.type];if(e==null)(0,p.z3)("Unsupported type: "+t.type);return e(t)}const d={Literal:t=>t.raw,Identifier:t=>{const r=t.name;if(c>0){return r}else if((0,p.mQ)(n,r)){return(0,p.z3)("Illegal identifier: "+r)}else if((0,p.mQ)(i,r)){return i[r]}else if((0,p.mQ)(e,r)){return r}else{u[r]=1;return o(r)}},MemberExpression:t=>{const e=!t.computed,n=f(t.object);if(e)c+=1;const i=f(t.property);if(n===a){l[lO(i)]=1}if(e)c-=1;return n+(e?"."+i:"["+i+"]")},CallExpression:t=>{if(t.callee.type!=="Identifier"){(0,p.z3)("Illegal callee type: "+t.callee.type)}const e=t.callee.name,n=t.arguments,i=(0,p.mQ)(r,e)&&r[e];if(!i)(0,p.z3)("Unrecognized function: "+e);return(0,p.Tn)(i)?i(n):i+"("+n.map(f).join(",")+")"},ArrayExpression:t=>"["+t.elements.map(f).join(",")+"]",BinaryExpression:t=>"("+f(t.left)+" "+t.operator+" "+f(t.right)+")",UnaryExpression:t=>"("+t.operator+f(t.argument)+")",ConditionalExpression:t=>"("+f(t.test)+"?"+f(t.consequent)+":"+f(t.alternate)+")",LogicalExpression:t=>"("+f(t.left)+t.operator+f(t.right)+")",ObjectExpression:t=>"{"+t.properties.map(f).join(",")+"}",Property:t=>{c+=1;const e=f(t.key);c-=1;return e+":"+f(t.value)}};function h(t){const e={code:f(t),globals:Object.keys(u),fields:Object.keys(l)};u={};l={};return e}h.functions=r;h.constants=i;return h}var fO=new ax;var dO=new ax,hO,pO,mO,gO,yO;var vO={point:Rx,lineStart:Rx,lineEnd:Rx,polygonStart:function(){fO=new ax;vO.lineStart=bO;vO.lineEnd=xO},polygonEnd:function(){var t=+fO;dO.add(t<0?px+t:t);this.lineStart=this.lineEnd=this.point=Rx},sphere:function(){dO.add(px)}};function bO(){vO.point=_O}function xO(){wO(hO,pO)}function _O(t,e){vO.point=wO;hO=t,pO=e;t*=gx,e*=gx;mO=t,gO=xx(e=e/2+hx),yO=Dx(e)}function wO(t,e){t*=gx,e*=gx;e=e/2+hx;var n=t-mO,i=n>=0?1:-1,r=i*n,s=xx(e),a=Dx(e),o=yO*a,u=gO*s+o*xx(r),l=o*i*Dx(r);fO.add(bx(l,u));mO=t,gO=s,yO=a}function AO(t){dO=new ax;sx(t,vO);return dO*2}var kO,EO,MO,DO,CO,FO,SO,BO,zO,$O,RO;var OO={point:TO,lineStart:LO,lineEnd:PO,polygonStart:function(){OO.point=qO;OO.lineStart=IO;OO.lineEnd=UO;zO=new ax;vO.polygonStart()},polygonEnd:function(){vO.polygonEnd();OO.point=TO;OO.lineStart=LO;OO.lineEnd=PO;if(fO<0)kO=-(MO=180),EO=-(DO=90);else if(zO>lx)DO=90;else if(zO<-lx)EO=-90;RO[0]=kO,RO[1]=MO},sphere:function(){kO=-(MO=180),EO=-(DO=90)}};function TO(t,e){$O.push(RO=[kO=t,MO=t]);if(eDO)DO=e}function NO(t,e){var n=V_([t*gx,e*gx]);if(BO){var i=K_(BO,n),r=[i[1],-i[0],0],s=K_(r,i);tw(s);s=H_(s);var a=t-CO,o=a>0?1:-1,u=s[0]*mx*o,l,c=yx(a)>180;if(c^(o*CODO)DO=l}else if(u=(u+360)%360-180,c^(o*CODO)DO=e}if(c){if(tjO(kO,MO))MO=t}else{if(jO(t,MO)>jO(kO,MO))kO=t}}else{if(MO>=kO){if(tMO)MO=t}else{if(t>CO){if(jO(kO,t)>jO(kO,MO))MO=t}else{if(jO(t,MO)>jO(kO,MO))kO=t}}}}else{$O.push(RO=[kO=t,MO=t])}if(eDO)DO=e;BO=n,CO=t}function LO(){OO.point=NO}function PO(){RO[0]=kO,RO[1]=MO;OO.point=TO;BO=null}function qO(t,e){if(BO){var n=t-CO;zO.add(yx(n)>180?n+(n>0?360:-360):n)}else{FO=t,SO=e}vO.point(t,e);NO(t,e)}function IO(){vO.lineStart()}function UO(){qO(FO,SO);vO.lineEnd();if(yx(zO)>lx)kO=-(MO=180);RO[0]=kO,RO[1]=MO;BO=null}function jO(t,e){return(e-=t)<0?e+360:e}function GO(t,e){return t[0]-e[0]}function YO(t,e){return t[0]<=t[1]?t[0]<=e&&e<=t[1]:ejO(i[0],i[1]))i[1]=r[1];if(jO(r[0],i[1])>jO(i[0],i[1]))i[0]=r[0]}else{s.push(i=r)}}for(a=-Infinity,n=s.length-1,e=0,i=s[n];e<=n;i=r,++e){r=s[e];if((o=jO(i[1],r[0]))>a)a=o,kO=r[0],MO=i[1]}}$O=RO=null;return kO===Infinity||EO===Infinity?[[NaN,NaN],[NaN,NaN]]:[[kO,EO],[MO,DO]]}var XO,HO,VO,QO,KO,ZO,JO,tT,eT,nT,iT,rT,sT,aT,oT,uT;var lT={sphere:Rx,point:cT,lineStart:dT,lineEnd:mT,polygonStart:function(){lT.lineStart=gT;lT.lineEnd=yT},polygonEnd:function(){lT.lineStart=dT;lT.lineEnd=mT}};function cT(t,e){t*=gx,e*=gx;var n=xx(e);fT(n*xx(t),n*Dx(t),Dx(e))}function fT(t,e,n){++XO;VO+=(t-VO)/XO;QO+=(e-QO)/XO;KO+=(n-KO)/XO}function dT(){lT.point=hT}function hT(t,e){t*=gx,e*=gx;var n=xx(e);aT=n*xx(t);oT=n*Dx(t);uT=Dx(e);lT.point=pT;fT(aT,oT,uT)}function pT(t,e){t*=gx,e*=gx;var n=xx(e),i=n*xx(t),r=n*Dx(t),s=Dx(e),a=bx(Fx((a=oT*s-uT*r)*a+(a=uT*i-aT*s)*a+(a=aT*r-oT*i)*a),aT*i+oT*r+uT*s);HO+=a;ZO+=a*(aT+(aT=i));JO+=a*(oT+(oT=r));tT+=a*(uT+(uT=s));fT(aT,oT,uT)}function mT(){lT.point=cT}function gT(){lT.point=vT}function yT(){bT(rT,sT);lT.point=cT}function vT(t,e){rT=t,sT=e;t*=gx,e*=gx;lT.point=bT;var n=xx(e);aT=n*xx(t);oT=n*Dx(t);uT=Dx(e);fT(aT,oT,uT)}function bT(t,e){t*=gx,e*=gx;var n=xx(e),i=n*xx(t),r=n*Dx(t),s=Dx(e),a=oT*s-uT*r,o=uT*i-aT*s,u=aT*r-oT*i,l=kx(a,o,u),c=zx(l),f=l&&-c/l;eT.add(f*a);nT.add(f*o);iT.add(f*u);HO+=c;ZO+=c*(aT+(aT=i));JO+=c*(oT+(oT=r));tT+=c*(uT+(uT=s));fT(aT,oT,uT)}function xT(t){XO=HO=VO=QO=KO=ZO=JO=tT=0;eT=new ax;nT=new ax;iT=new ax;sx(t,lT);var e=+eT,n=+nT,i=+iT,r=kx(e,n,i);if(r=i[s])return false}else if(o.type===UT){if(a>i[s])return false}else if(o.type===jT){if(a<=i[s])return false}else if(o.type===GT){if(a(0,p.X$)(e.fields?{values:e.fields.map((e=>DT(e)(t.datum)))}:{[RT]:OT(t.datum)},e)))}function eN(t,e,n,i){var r=this.context.data[t],s=r?r.values.value:[],a={},o={},u={},l,c,f,d,h,m,g,y,v,b,x=s.length,_=0,w,A;for(;_(t[c[n].field]=e,t)),{}))}}else{h=RT;m=OT(l);g=a[h]||(a[h]={});y=g[d]||(g[d]=[]);y.push(m);if(n){y=o[d]||(o[d]=[]);y.push({[RT]:m})}}}e=e||FT;if(a[RT]){a[RT]=nN[`${RT}_${e}`](...Object.values(a[RT]))}else{Object.keys(a).forEach((t=>{a[t]=Object.keys(a[t]).map((e=>a[t][e])).reduce(((n,i)=>n===undefined?i:nN[`${u[t]}_${e}`](n,i)))}))}s=Object.keys(o);if(n&&s.length){const t=i?BT:ST;a[t]=e===FT?{[zT]:s.reduce(((t,e)=>(t.push(...o[e]),t)),[])}:{[$T]:s.map((t=>({[zT]:o[t]})))}}return a}var nN={[`${RT}_union`]:AT,[`${RT}_intersect`]:kT,E_union:function(t,e){if(!t.length)return e;var n=0,i=e.length;for(;ne.includes(t)))},R_union:function(t,e){var n=(0,p.Ro)(e[0]),i=(0,p.Ro)(e[1]);if(n>i){n=e[1];i=e[0]}if(!t.length)return[n,i];if(t[0]>n)t[0]=n;if(t[1]i){n=e[1];i=e[0]}if(!t.length)return[n,i];if(ii)t[1]=i}return t}};const iN=":",rN="@";function sN(t,e,n,i){if(e[0].type!==e$)(0,p.z3)("First argument to selection functions must be a string literal.");const r=e[0].value,s=e.length>=2&&(0,p.se)(e).value,a="unit",o=rN+a,u=iN+r;if(s===CT&&!(0,p.mQ)(i,o)){i[o]=n.getData(r).indataRef(n,a)}if(!(0,p.mQ)(i,u)){i[u]=n.getData(r).tuplesRef()}}function aN(t){const e=this.context.data[t];return e?e.values.value:[]}function oN(t,e,n){const i=this.context.data[t]["index:"+e],r=i?i.value.get(n):undefined;return r?r.count:r}function uN(t,e){const n=this.context.dataflow,i=this.context.data[t],r=i.input;n.pulse(r,n.changeset().remove(p.vN).insert(e));return 1}function lN(t,e,n){if(t){const n=this.context.dataflow,i=t.mark.source;n.pulse(i,n.changeset().encode(t,e))}return n!==undefined?n:t}const cN=t=>function(e,n){const i=this.context.dataflow.locale();return e===null?"null":i[t](n)(e)};const fN=cN("format");const dN=cN("timeFormat");const hN=cN("utcFormat");const pN=cN("timeParse");const mN=cN("utcParse");const gN=new Date(2e3,0,1);function yN(t,e,n){if(!Number.isInteger(t)||!Number.isInteger(e))return"";gN.setYear(2e3);gN.setMonth(t);gN.setDate(e);return dN.call(this,gN,n)}function vN(t){return yN.call(this,t,1,"%B")}function bN(t){return yN.call(this,t,1,"%b")}function xN(t){return yN.call(this,0,2+t,"%A")}function _N(t){return yN.call(this,0,2+t,"%a")}const wN=":";const AN="@";const kN="%";const EN="$";function MN(t,e,n,i){if(e[0].type!==e$){(0,p.z3)("First argument to data functions must be a string literal.")}const r=e[0].value,s=wN+r;if(!(0,p.mQ)(s,i)){try{i[s]=n.getData(r).tuplesRef()}catch(a){}}}function DN(t,e,n,i){if(e[0].type!==e$)(0,p.z3)("First argument to indata must be a string literal.");if(e[1].type!==e$)(0,p.z3)("Second argument to indata must be a string literal.");const r=e[0].value,s=e[1].value,a=AN+s;if(!(0,p.mQ)(a,i)){i[a]=n.getData(r).indataRef(n,s)}}function CN(t,e,n,i){if(e[0].type===e$){FN(n,i,e[0].value)}else{for(t in n.scales){FN(n,i,t)}}}function FN(t,e,n){const i=kN+n;if(!(0,p.mQ)(e,i)){try{e[i]=t.scaleRef(n)}catch(r){}}}function SN(t,e){if((0,p.Kg)(t)){const n=e.scales[t];return n&&jl(n.value)?n.value:undefined}else if((0,p.Tn)(t)){return jl(t)?t:undefined}return undefined}function BN(t,e,n){e.__bandwidth=t=>t&&t.bandwidth?t.bandwidth():0;n._bandwidth=CN;n._range=CN;n._scale=CN;const i=e=>"_["+(e.type===e$?(0,p.r$)(kN+e.value):(0,p.r$)(kN)+"+"+t(e))+"]";return{_bandwidth:t=>`this.__bandwidth(${i(t[0])})`,_range:t=>`${i(t[0])}.range()`,_scale:e=>`${i(e[0])}(${t(e[1])})`}}function zN(t,e){return function(n,i,r){if(n){const e=SN(n,(r||this).context);return e&&e.path[t](i)}else{return e(i)}}}const $N=zN("area",AO);const RN=zN("bounds",WO);const ON=zN("centroid",xT);function TN(t,e){const n=SN(t,(e||this).context);return n&&n.scale()}function NN(t){const e=this.context.group;let n=false;if(e)while(t){if(t===e){n=true;break}t=t.mark.group}return n}function LN(t,e,n){try{t[e].apply(t,["EXPRESSION"].concat([].slice.call(n)))}catch(i){t.warn(i)}return n[n.length-1]}function PN(){return LN(this.context.dataflow,"warn",arguments)}function qN(){return LN(this.context.dataflow,"info",arguments)}function IN(){return LN(this.context.dataflow,"debug",arguments)}function UN(t){const e=t/255;if(e<=.03928){return e/12.92}return Math.pow((e+.055)/1.055,2.4)}function jN(t){const e=(0,Fk.Qh)(t),n=UN(e.r),i=UN(e.g),r=UN(e.b);return.2126*n+.7152*i+.0722*r}function GN(t,e){const n=jN(t),i=jN(e),r=Math.max(n,i),s=Math.min(n,i);return(r+.05)/(s+.05)}function YN(){const t=[].slice.call(arguments);t.unshift({});return(0,p.X$)(...t)}function WN(t,e){return t===e||t!==t&&e!==e?true:(0,p.cy)(t)?(0,p.cy)(e)&&t.length===e.length?XN(t,e):false:(0,p.Gv)(t)&&(0,p.Gv)(e)?HN(t,e):false}function XN(t,e){for(let n=0,i=t.length;nHN(t,e)}function QN(t,e,n,i,r,s){const a=this.context.dataflow,o=this.context.data[t],u=o.input,l=a.stamp();let c=o.changes,f,d;if(a._trigger===false||!(u.value.length||e||i)){return 0}if(!c||c.stamp{o.modified=true;a.pulse(u,c).run()}),true,1)}if(n){f=n===true?p.vN:(0,p.cy)(n)||gn(n)?n:VN(n);c.remove(f)}if(e){c.insert(e)}if(i){f=VN(i);if(u.value.some(f)){c.remove(f)}else{c.insert(i)}}if(r){for(d in s){c.modify(r,d,s[d])}}return 1}function KN(t){const e=t.touches,n=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.hypot(n,i)}function ZN(t){const e=t.touches;return Math.atan2(e[0].clientY-e[1].clientY,e[0].clientX-e[1].clientX)}const JN={};function tL(t,e){const n=JN[e]||(JN[e]=(0,p.ZZ)(e));return(0,p.cy)(t)?t.map(n):n(t)}function eL(t){return(0,p.cy)(t)||ArrayBuffer.isView(t)?t:null}function nL(t){return eL(t)||((0,p.Kg)(t)?t:null)}function iL(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),i=1;i1?e-1:0),i=1;i1?e-1:0),i=1;i1?e-1:0),i=1;is.stop(l(e),t(e))));return s}function vL(t,e,n){const i=SN(t,(n||this).context);return function(t){return i?i.path.context(t)(e):""}}function bL(t){let e=null;return function(n){return n?yf(n,e=e||nf(t)):t}}const xL=t=>t.data;function _L(t,e){const n=aN.call(e,t);return n.root&&n.root.lookup||{}}function wL(t,e,n){const i=_L(t,this),r=i[e],s=i[n];return r&&s?r.path(s).map(xL):undefined}function AL(t,e){const n=_L(t,this)[e];return n?n.ancestors().map(xL):undefined}const kL=()=>typeof window!=="undefined"&&window||null;function EL(){const t=kL();return t?t.screen:{}}function ML(){const t=kL();return t?[t.innerWidth,t.innerHeight]:[undefined,undefined]}function DL(){const t=this.context.dataflow,e=t.container&&t.container();return e?[e.clientWidth,e.clientHeight]:[undefined,undefined]}function CL(t,e,n){if(!t)return[];const[i,r]=t,s=(new vd).set(i[0],i[1],r[0],r[1]),a=n||this.context.dataflow.scenegraph().root;return cy(a,s,FL(e))}function FL(t){let e=null;if(t){const n=(0,p.YO)(t.marktype),i=(0,p.YO)(t.markname);e=t=>(!n.length||n.some((e=>t.marktype===e)))&&(!i.length||i.some((e=>t.name===e)))}return e}function SL(t,e,n){let i=arguments.length>3&&arguments[3]!==undefined?arguments[3]:5;t=(0,p.YO)(t);const r=t[t.length-1];return r===undefined||Math.hypot(r[0]-e,r[1]-n)>i?[...t,[e,n]]:t}function BL(t){return(0,p.YO)(t).reduce(((e,n,i)=>{let[r,s]=n;return e+=i==0?`M ${r},${s} `:i===t.length-1?" Z":`L ${r},${s} `}),"")}function zL(t,e,n){const{x:i,y:r,mark:s}=n;const a=(new vd).set(Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER,Number.MIN_SAFE_INTEGER,Number.MIN_SAFE_INTEGER);for(const[u,l]of e){if(ua.x2)a.x2=u;if(la.y2)a.y2=l}a.translate(i,r);const o=CL([[a.x1,a.y1],[a.x2,a.y2]],t,s);return o.filter((t=>$L(t.x,t.y,e)))}function $L(t,e,n){let i=0;for(let r=0,s=n.length-1;re!=o>e&&t<(a-u)*(e-l)/(o-l)+u){i++}}return i&1}const RL={random(){return ir()},cumulativeNormal:mr,cumulativeLogNormal:wr,cumulativeUniform:Cr,densityNormal:pr,densityLogNormal:_r,densityUniform:Dr,quantileNormal:gr,quantileLogNormal:Ar,quantileUniform:Fr,sampleNormal:hr,sampleLogNormal:xr,sampleUniform:Mr,isArray:p.cy,isBoolean:p.Lm,isDate:p.$P,isDefined(t){return t!==undefined},isNumber:p.Et,isObject:p.Gv,isRegExp:p.gd,isString:p.Kg,isTuple:gn,isValid(t){return t!=null&&t===t},toBoolean:p.G4,toDate(t){return(0,p.ay)(t)},toNumber:p.Ro,toString:p.dI,indexof:rL,join:iL,lastindexof:sL,replace:oL,reverse:uL,sort:lL,slice:aL,flush:p.bX,lerp:p.Cc,merge:YN,pad:p.eV,peek:p.se,pluck:tL,span:p.Ln,inrange:p.PK,truncate:p.xv,rgb:Fk.Qh,lab:_T.Ay,hcl:_T.aq,hsl:Fk.KI,luminance:jN,contrast:GN,sequence:es.A,format:fN,utcFormat:hN,utcParse:mN,utcOffset:Gt,utcSequence:Xt,timeFormat:dN,timeParse:pN,timeOffset:jt,timeSequence:Wt,timeUnitSpecifier:pt,monthFormat:vN,monthAbbrevFormat:bN,dayFormat:xN,dayAbbrevFormat:_N,quarter:p.$G,utcquarter:p.vu,week:vt,utcweek:kt,dayofyear:yt,utcdayofyear:At,warn:PN,info:qN,debug:IN,extent(t){return(0,p.Xx)(t)},inScope:NN,intersect:CL,clampRange:p.BS,pinchDistance:KN,pinchAngle:ZN,screen:EL,containerSize:DL,windowSize:ML,bandspace:cL,setdata:uN,pathShape:bL,panLinear:p.VC,panLog:p.KH,panPow:p.co,panSymlog:p.zy,zoomLinear:p.lL,zoomLog:p.oV,zoomPow:p.SW,zoomSymlog:p.B2,encode:lN,modify:QN,lassoAppend:SL,lassoPath:BL,intersectLasso:zL};const OL=["view","item","group","xy","x","y"],TL="event.vega.",NL="this.",LL={};const PL={forbidden:["_"],allowed:["datum","event","item"],fieldvar:"datum",globalvar:t=>`_[${(0,p.r$)(EN+t)}]`,functions:IL,constants:oO,visitors:LL};const qL=cO(PL);function IL(t){const e=uO(t);OL.forEach((t=>e[t]=TL+t));for(const n in RL){e[n]=NL+n}(0,p.X$)(e,BN(t,RL,LL));return e}function UL(t,e,n){if(arguments.length===1){return RL[t]}RL[t]=e;if(n)LL[t]=n;if(qL)qL.functions[t]=NL+t;return this}UL("bandwidth",fL,CN);UL("copy",dL,CN);UL("domain",hL,CN);UL("range",mL,CN);UL("invert",pL,CN);UL("scale",gL,CN);UL("gradient",yL,CN);UL("geoArea",$N,CN);UL("geoBounds",RN,CN);UL("geoCentroid",ON,CN);UL("geoShape",vL,CN);UL("geoScale",TN,CN);UL("indata",oN,DN);UL("data",aN,MN);UL("treePath",wL,MN);UL("treeAncestors",AL,MN);UL("vlSelectionTest",VT,sN);UL("vlSelectionIdTest",JT,sN);UL("vlSelectionResolve",eN,sN);UL("vlSelectionTuples",tN);function jL(t,e){const n={};let i;try{t=(0,p.Kg)(t)?t:(0,p.r$)(t)+"";i=aO(t)}catch(s){(0,p.z3)("Expression parse error: "+t)}i.visit((t=>{if(t.type!==a$)return;const i=t.callee.name,r=PL.visitors[i];if(r)r(i,t.arguments,e,n)}));const r=qL(i);r.globals.forEach((t=>{const i=EN+t;if(!(0,p.mQ)(n,i)&&e.getSignal(t)){n[i]=e.signalRef(t)}}));return{$expr:(0,p.X$)({code:r.code},e.options.ast?{ast:i}:null),$fields:r.fields,$params:n}}function GL(t){const e=this,n=t.operators||[];if(t.background){e.background=t.background}if(t.eventConfig){e.eventConfig=t.eventConfig}if(t.locale){e.locale=t.locale}n.forEach((t=>e.parseOperator(t)));n.forEach((t=>e.parseOperatorParameters(t)));(t.streams||[]).forEach((t=>e.parseStream(t)));(t.updates||[]).forEach((t=>e.parseUpdate(t)));return e.resolve()}const YL=(0,p.M1)(["rule"]),WL=(0,p.M1)(["group","image","rect"]);function XL(t,e){let n="";if(YL[e])return n;if(t.x2){if(t.x){if(WL[e]){n+="if(o.x>o.x2)$=o.x,o.x=o.x2,o.x2=$;"}n+="o.width=o.x2-o.x;"}else{n+="o.x=o.x2-(o.width||0);"}}if(t.xc){n+="o.x=o.xc-(o.width||0)/2;"}if(t.y2){if(t.y){if(WL[e]){n+="if(o.y>o.y2)$=o.y,o.y=o.y2,o.y2=$;"}n+="o.height=o.y2-o.y;"}else{n+="o.y=o.y2-(o.height||0);"}}if(t.yc){n+="o.y=o.yc-(o.height||0)/2;"}return n}function HL(t){return(t+"").toLowerCase()}function VL(t){return HL(t)==="operator"}function QL(t){return HL(t)==="collect"}function KL(t,e,n){if(!n.endsWith(";")){n="return("+n+");"}const i=Function(...e.concat(n));return t&&t.functions?i.bind(t.functions):i}function ZL(t,e,n,i){return`((u = ${t}) < (v = ${e}) || u == null) && v != null ? ${n}\n : (u > v || v == null) && u != null ? ${i}\n : ((v = v instanceof Date ? +v : v), (u = u instanceof Date ? +u : u)) !== u && v === v ? ${n}\n : v !== v && u === u ? ${i} : `}var JL={operator:(t,e)=>KL(t,["_"],e.code),parameter:(t,e)=>KL(t,["datum","_"],e.code),event:(t,e)=>KL(t,["event"],e.code),handler:(t,e)=>{const n=`var datum=event.item&&event.item.datum;return ${e.code};`;return KL(t,["_","event"],n)},encode:(t,e)=>{const{marktype:n,channels:i}=e;let r="var o=item,datum=o.datum,m=0,$;";for(const s in i){const t="o["+(0,p.r$)(s)+"]";r+=`$=${i[s].code};if(${t}!==$)${t}=$,m=1;`}r+=XL(i,n);r+="return m;";return KL(t,["item","_"],r)},codegen:{get(t){const e=`[${t.map(p.r$).join("][")}]`;const n=Function("_",`return _${e};`);n.path=e;return n},comparator(t,e){let n;const i=(t,i)=>{const r=e[i];let s,a;if(t.path){s=`a${t.path}`;a=`b${t.path}`}else{(n=n||{})["f"+i]=t;s=`this.f${i}(a)`;a=`this.f${i}(b)`}return ZL(s,a,-r,r)};const r=Function("a","b","var u, v; return "+t.map(i).join("")+"0;");return n?r.bind(n):r}}};function tP(t){const e=this;if(VL(t.type)||!t.type){e.operator(t,t.update?e.operatorExpression(t.update):null)}else{e.transform(t,t.type)}}function eP(t){const e=this;if(t.params){const n=e.get(t.id);if(!n)(0,p.z3)("Invalid operator id: "+t.id);e.dataflow.connect(n,n.parameters(e.parseParameters(t.params),t.react,t.initonly))}}function nP(t,e){e=e||{};const n=this;for(const i in t){const r=t[i];e[i]=(0,p.cy)(r)?r.map((t=>iP(t,n,e))):iP(r,n,e)}return e}function iP(t,e,n){if(!t||!(0,p.Gv)(t))return t;for(let i=0,r=rP.length,s;it&&t.$tupleid?yn:t));return e.fn[n]||(e.fn[n]=(0,p.UD)(i,t.$order,e.expr.codegen))}function cP(t,e){const n=t.$encode,i={};for(const r in n){const t=n[r];i[r]=(0,p.sY)(e.encodeExpression(t.$expr),t.$fields);i[r].output=t.$output}return i}function fP(t,e){return e}function dP(t,e){const n=t.$subflow;return function(t,i,r){const s=e.fork().parse(n),a=s.get(n.operators[0].id),o=s.signals.parent;if(o)o.set(r);a.detachSubflow=()=>e.detach(s);return a}}function hP(){return yn}function pP(t){var e=this,n=t.filter!=null?e.eventExpression(t.filter):undefined,i=t.stream!=null?e.get(t.stream):undefined,r;if(t.source){i=e.events(t.source,t.type,n)}else if(t.merge){r=t.merge.map((t=>e.get(t)));i=r[0].merge.apply(r[0],r.slice(1))}if(t.between){r=t.between.map((t=>e.get(t)));i=i.between(r[0],r[1])}if(t.filter){i=i.filter(n)}if(t.throttle!=null){i=i.throttle(+t.throttle)}if(t.debounce!=null){i=i.debounce(+t.debounce)}if(i==null){(0,p.z3)("Invalid stream definition: "+JSON.stringify(t))}if(t.consume)i.consume(true);e.stream(t,i)}function mP(t){var e=this,n=(0,p.Gv)(n=t.source)?n.$ref:n,i=e.get(n),r=null,s=t.update,a=undefined;if(!i)(0,p.z3)("Source not defined: "+t.source);r=t.target&&t.target.$expr?e.eventExpression(t.target.$expr):e.get(t.target);if(s&&s.$expr){if(s.$params){a=e.parseParameters(s.$params)}s=e.handlerExpression(s.$expr)}e.update(t,i,r,s,a)}const gP={skip:true};function yP(t){var e=this,n={};if(t.signals){var i=n.signals={};Object.keys(e.signals).forEach((n=>{const r=e.signals[n];if(t.signals(n,r)){i[n]=r.value}}))}if(t.data){var r=n.data={};Object.keys(e.data).forEach((n=>{const i=e.data[n];if(t.data(n,i)){r[n]=i.input.value}}))}if(e.subcontext&&t.recurse!==false){n.subcontext=e.subcontext.map((e=>e.getState(t)))}return n}function vP(t){var e=this,n=e.dataflow,i=t.data,r=t.signals;Object.keys(r||{}).forEach((t=>{n.update(e.signals[t],r[t],gP)}));Object.keys(i||{}).forEach((t=>{n.pulse(e.data[t].input,n.changeset().remove(p.vN).insert(i[t]))}));(t.subcontext||[]).forEach(((t,n)=>{const i=e.subcontext[n];if(i)i.setState(t)}))}function bP(t,e,n,i){return new xP(t,e,n,i)}function xP(t,e,n,i){this.dataflow=t;this.transforms=e;this.events=t.events.bind(t);this.expr=i||JL,this.signals={};this.scales={};this.nodes={};this.data={};this.fn={};if(n){this.functions=Object.create(n);this.functions.context=this}}function _P(t){this.dataflow=t.dataflow;this.transforms=t.transforms;this.events=t.events;this.expr=t.expr;this.signals=Object.create(t.signals);this.scales=Object.create(t.scales);this.nodes=Object.create(t.nodes);this.data=Object.create(t.data);this.fn=Object.create(t.fn);if(t.functions){this.functions=Object.create(t.functions);this.functions.context=this}}xP.prototype=_P.prototype={fork(){const t=new _P(this);(this.subcontext||(this.subcontext=[])).push(t);return t},detach(t){this.subcontext=this.subcontext.filter((e=>e!==t));const e=Object.keys(t.nodes);for(const n of e)t.nodes[n]._targets=null;for(const n of e)t.nodes[n].detach();t.nodes=null},get(t){return this.nodes[t]},set(t,e){return this.nodes[t]=e},add(t,e){const n=this,i=n.dataflow,r=t.value;n.set(t.id,e);if(QL(t.type)&&r){if(r.$ingest){i.ingest(e,r.$ingest,r.$format)}else if(r.$request){i.preload(e,r.$request,r.$format)}else{i.pulse(e,i.changeset().insert(r))}}if(t.root){n.root=e}if(t.parent){let r=n.get(t.parent.$ref);if(r){i.connect(r,[e]);e.targets().add(r)}else{(n.unresolved=n.unresolved||[]).push((()=>{r=n.get(t.parent.$ref);i.connect(r,[e]);e.targets().add(r)}))}}if(t.signal){n.signals[t.signal]=e}if(t.scale){n.scales[t.scale]=e}if(t.data){for(const i in t.data){const r=n.data[i]||(n.data[i]={});t.data[i].forEach((t=>r[t]=e))}}},resolve(){(this.unresolved||[]).forEach((t=>t()));delete this.unresolved;return this},operator(t,e){this.add(t,this.dataflow.add(t.value,e))},transform(t,e){this.add(t,this.dataflow.add(this.transforms[HL(e)]))},stream(t,e){this.set(t.id,e)},update(t,e,n,i,r){this.dataflow.on(e,n,i,r,t.options)},operatorExpression(t){return this.expr.operator(this,t)},parameterExpression(t){return this.expr.parameter(this,t)},eventExpression(t){return this.expr.event(this,t)},handlerExpression(t){return this.expr.handler(this,t)},encodeExpression(t){return this.expr.encode(this,t)},parse:GL,parseOperator:tP,parseOperatorParameters:eP,parseParameters:nP,parseStream:pP,parseUpdate:mP,getState:yP,setState:vP};function wP(t,e,n){var i=new QE.M4,r=e;if(e==null)return i.restart(t,e,n),i;i._restart=i.restart;i.restart=function(t,e,n){e=+e,n=n==null?(0,QE.tB)():+n;i._restart((function s(a){a+=r;i._restart(s,r+=e,n);t(a)}),e,n)};i.restart(t,e,n);return i}function AP(t){const e=t.container();if(e){e.setAttribute("role","graphics-document");e.setAttribute("aria-roleDescription","visualization");kP(e,t.description())}}function kP(t,e){if(t)e==null?t.removeAttribute("aria-label"):t.setAttribute("aria-label",e)}function EP(t){t.add(null,(e=>{t._background=e.bg;t._resize=1;return e.bg}),{bg:t._signals.background})}const MP="default";function DP(t){const e=t._signals.cursor||(t._signals.cursor=t.add({user:MP,item:null}));t.on(t.events("view","pointermove"),e,((t,n)=>{const i=e.value,r=i?(0,p.Kg)(i)?i:i.user:MP,s=n.item&&n.item.cursor||null;return i&&r===i.user&&s==i.item?i:{user:r,item:s}}));t.add(null,(function(e){let n=e.cursor,i=this.value;if(!(0,p.Kg)(n)){i=n.item;n=n.user}CP(t,n&&n!==MP?n:i||n);return i}),{cursor:e})}function CP(t,e){const n=t.globalCursor()?typeof document!=="undefined"&&document.body:t.container();if(n){return e==null?n.style.removeProperty("cursor"):n.style.cursor=e}}function FP(t,e){var n=t._runtime.data;if(!(0,p.mQ)(n,e)){(0,p.z3)("Unrecognized data set: "+e)}return n[e]}function SP(t,e){return arguments.length<2?FP(this,t).values.value:BP.call(this,t,En().remove(p.vN).insert(e))}function BP(t,e){if(!kn(e)){(0,p.z3)("Second argument to changes must be a changeset.")}const n=FP(this,t);n.modified=true;return this.pulse(n.input,e)}function zP(t,e){return BP.call(this,t,En().insert(e))}function $P(t,e){return BP.call(this,t,En().remove(e))}function RP(t){var e=t.padding();return Math.max(0,t._viewWidth+e.left+e.right)}function OP(t){var e=t.padding();return Math.max(0,t._viewHeight+e.top+e.bottom)}function TP(t){var e=t.padding(),n=t._origin;return[e.left+n[0],e.top+n[1]]}function NP(t){var e=TP(t),n=RP(t),i=OP(t);t._renderer.background(t.background());t._renderer.resize(n,i,e);t._handler.origin(e);t._resizeListeners.forEach((e=>{try{e(n,i)}catch(r){t.error(r)}}))}function LP(t,e,n){var i=t._renderer,r=i&&i.canvas(),s,a,o;if(r){o=TP(t);a=e.changedTouches?e.changedTouches[0]:e;s=fm(a,r);s[0]-=o[0];s[1]-=o[1]}e.dataflow=t;e.item=n;e.vega=PP(t,n,s);return e}function PP(t,e,n){const i=e?e.mark.marktype==="group"?e:e.mark.group:null;function r(t){var n=i,r;if(t)for(r=e;r;r=r.mark.group){if(r.mark.name===t){n=r;break}}return n&&n.mark&&n.mark.interactive?n:{}}function s(t){if(!t)return n;if((0,p.Kg)(t))t=r(t);const e=n.slice();while(t){e[0]-=t.x||0;e[1]-=t.y||0;t=t.mark&&t.mark.group}return e}return{view:(0,p.dY)(t),item:(0,p.dY)(e||{}),group:r,xy:s,x:t=>s(t)[0],y:t=>s(t)[1]}}const qP="view",IP="timer",UP="window",jP={trap:false};function GP(t){const e=(0,p.X$)({defaults:{}},t);const n=(t,e)=>{e.forEach((e=>{if((0,p.cy)(t[e]))t[e]=(0,p.M1)(t[e])}))};n(e.defaults,["prevent","allow"]);n(e,["view","window","selector"]);return e}function YP(t,e,n,i){t._eventListeners.push({type:n,sources:(0,p.YO)(e),handler:i})}function WP(t,e){var n=t._eventConfig.defaults,i=n.prevent,r=n.allow;return i===false||r===true?false:i===true||r===false?true:i?i[e]:r?!r[e]:t.preventDefault()}function XP(t,e,n){const i=t._eventConfig&&t._eventConfig[e];if(i===false||(0,p.Gv)(i)&&!i[n]){t.warn(`Blocked ${e} ${n} event listener.`);return false}return true}function HP(t,e,n){var i=this,r=new Ln(n),s=function(n,s){i.runAsync(null,(()=>{if(t===qP&&WP(i,e)){n.preventDefault()}r.receive(LP(i,n,s))}))},a;if(t===IP){if(XP(i,"timer",e)){i.timer(s,e)}}else if(t===qP){if(XP(i,"view",e)){i.addEventListener(e,s,jP)}}else{if(t===UP){if(XP(i,"window",e)&&typeof window!=="undefined"){a=[window]}}else if(typeof document!=="undefined"){if(XP(i,"selector",e)){a=Array.from(document.querySelectorAll(t))}}if(!a){i.warn("Can not resolve event source: "+t)}else{for(var o=0,u=a.length;o=0){e[r].stop()}r=i.length;while(--r>=0){a=i[r];s=a.sources.length;while(--s>=0){a.sources[s].removeEventListener(a.type,a.handler)}}if(t){t.call(this,this._handler,null,null,null)}r=n.length;while(--r>=0){u=n[r].type;o=n[r].handler;this._handler.off(u,o)}return this}function tq(t,e,n){const i=document.createElement(t);for(const r in e)i.setAttribute(r,e[r]);if(n!=null)i.textContent=n;return i}const eq="vega-bind",nq="vega-bind-name",iq="vega-bind-radio";function rq(t,e,n){if(!e)return;const i=n.param;let r=n.state;if(!r){r=n.state={elements:null,active:false,set:null,update:e=>{if(e!=t.signal(i.signal)){t.runAsync(null,(()=>{r.source=true;t.signal(i.signal,e)}))}}};if(i.debounce){r.update=(0,p.sg)(i.debounce,r.update)}}const s=i.input==null&&i.element?sq:oq;s(r,e,i,t);if(!r.active){t.on(t._signals[i.signal],null,(()=>{r.source?r.source=false:r.set(t.signal(i.signal))}));r.active=true}return r}function sq(t,e,n,i){const r=n.event||"input";const s=()=>t.update(e.value);i.signal(n.signal,e.value);e.addEventListener(r,s);YP(i,e,r,s);t.set=t=>{e.value=t;e.dispatchEvent(aq(r))}}function aq(t){return typeof Event!=="undefined"?new Event(t):{type:t}}function oq(t,e,n,i){const r=i.signal(n.signal);const s=tq("div",{class:eq});const a=n.input==="radio"?s:s.appendChild(tq("label"));a.appendChild(tq("span",{class:nq},n.name||n.signal));e.appendChild(s);let o=uq;switch(n.input){case"checkbox":o=lq;break;case"select":o=cq;break;case"radio":o=fq;break;case"range":o=dq;break}o(t,a,n,r)}function uq(t,e,n,i){const r=tq("input");for(const s in n){if(s!=="signal"&&s!=="element"){r.setAttribute(s==="input"?"type":s,n[s])}}r.setAttribute("name",n.signal);r.value=i;e.appendChild(r);r.addEventListener("input",(()=>t.update(r.value)));t.elements=[r];t.set=t=>r.value=t}function lq(t,e,n,i){const r={type:"checkbox",name:n.signal};if(i)r.checked=true;const s=tq("input",r);e.appendChild(s);s.addEventListener("change",(()=>t.update(s.checked)));t.elements=[s];t.set=t=>s.checked=!!t||null}function cq(t,e,n,i){const r=tq("select",{name:n.signal}),s=n.labels||[];n.options.forEach(((t,e)=>{const n={value:t};if(hq(t,i))n.selected=true;r.appendChild(tq("option",n,(s[e]||t)+""))}));e.appendChild(r);r.addEventListener("change",(()=>{t.update(n.options[r.selectedIndex])}));t.elements=[r];t.set=t=>{for(let e=0,i=n.options.length;e{const o={type:"radio",name:n.signal,value:e};if(hq(e,i))o.checked=true;const u=tq("input",o);u.addEventListener("change",(()=>t.update(e)));const l=tq("label",{},(s[a]||e)+"");l.prepend(u);r.appendChild(l);return u}));t.set=e=>{const n=t.elements,i=n.length;for(let t=0;t{u.textContent=o.value;t.update(+o.value)};o.addEventListener("input",l);o.addEventListener("change",l);t.elements=[o];t.set=t=>{o.value=t;u.textContent=t}}function hq(t,e){return t===e||t+""===e+""}function pq(t,e,n,i,r,s){e=e||new i(t.loader());return e.initialize(n,RP(t),OP(t),TP(t),r,s).background(t.background())}function mq(t,e){return!e?null:function(){try{e.apply(this,arguments)}catch(n){t.error(n)}}}function gq(t,e,n,i){const r=new i(t.loader(),mq(t,t.tooltip())).scene(t.scenegraph().root).initialize(n,TP(t),t);if(e){e.handlers().forEach((t=>{r.on(t.type,t.handler)}))}return r}function yq(t,e){const n=this,i=n._renderType,r=n._eventConfig.bind,s=ly(i);t=n._el=t?vq(n,t,true):null;AP(n);if(!s)n.error("Unrecognized renderer type: "+i);const a=s.handler||jm,o=t?s.renderer:s.headless;n._renderer=!o?null:pq(n,n._renderer,t,o);n._handler=gq(n,n._handler,t,a);n._redraw=true;if(t&&r!=="none"){e=e?n._elBind=vq(n,e,true):t.appendChild(tq("form",{class:"vega-bindings"}));n._bind.forEach((t=>{if(t.param.element&&r!=="container"){t.element=vq(n,t.param.element,!!t.param.input)}}));n._bind.forEach((t=>{rq(n,t.element||e,t)}))}return n}function vq(t,e,n){if(typeof e==="string"){if(typeof document!=="undefined"){e=document.querySelector(e);if(!e){t.error("Signal bind element not found: "+e);return null}}else{t.error("DOM document instance not found.");return null}}if(e&&n){try{e.textContent=""}catch(i){e=null;t.error(i)}}return e}const bq=t=>+t||0;const xq=t=>({top:t,bottom:t,left:t,right:t});function _q(t){return(0,p.Gv)(t)?{top:bq(t.top),bottom:bq(t.bottom),left:bq(t.left),right:bq(t.right)}:xq(bq(t))}async function wq(t,e,n,i){const r=ly(e),s=r&&r.headless;if(!s)(0,p.z3)("Unrecognized renderer type: "+e);await t.runAsync();return pq(t,null,null,s,n,i).renderAsync(t._scenegraph.root)}async function Aq(t,e){if(t!==oy.Canvas&&t!==oy.SVG&&t!==oy.PNG){(0,p.z3)("Unrecognized image type: "+t)}const n=await wq(this,t,e);return t===oy.SVG?kq(n.svg(),"image/svg+xml"):n.canvas().toDataURL("image/png")}function kq(t,e){const n=new Blob([t],{type:e});return window.URL.createObjectURL(n)}async function Eq(t,e){const n=await wq(this,oy.Canvas,t,e);return n.canvas()}async function Mq(t){const e=await wq(this,oy.SVG,t);return e.svg()}function Dq(t,e,n){return bP(t,$i,RL,n).parse(e)}function Cq(t){var e=this._runtime.scales;if(!(0,p.mQ)(e,t)){(0,p.z3)("Unrecognized scale or projection: "+t)}return e[t].value}var Fq="width",Sq="height",Bq="padding",zq={skip:true};function $q(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===Bq?i.left+i.right:0)}function Rq(t,e){var n=t.autosize(),i=t.padding();return e-(n&&n.contains===Bq?i.top+i.bottom:0)}function Oq(t){var e=t._signals,n=e[Fq],i=e[Sq],r=e[Bq];function s(){t._autosize=t._resize=1}t._resizeWidth=t.add(null,(e=>{t._width=e.size;t._viewWidth=$q(t,e.size);s()}),{size:n});t._resizeHeight=t.add(null,(e=>{t._height=e.size;t._viewHeight=Rq(t,e.size);s()}),{size:i});const a=t.add(null,s,{pad:r});t._resizeWidth.rank=n.rank+1;t._resizeHeight.rank=i.rank+1;a.rank=r.rank+1}function Tq(t,e,n,i,r,s){this.runAfter((a=>{let o=0;a._autosize=0;if(a.width()!==n){o=1;a.signal(Fq,n,zq);a._resizeWidth.skip(true)}if(a.height()!==i){o=1;a.signal(Sq,i,zq);a._resizeHeight.skip(true)}if(a._viewWidth!==t){a._resize=1;a._viewWidth=t}if(a._viewHeight!==e){a._resize=1;a._viewHeight=e}if(a._origin[0]!==r[0]||a._origin[1]!==r[1]){a._resize=1;a._origin=r}if(o)a.run("enter");if(s)a.runAfter((t=>t.resize()))}),false,1)}function Nq(t){return this._runtime.getState(t||{data:Lq,signals:Pq,recurse:true})}function Lq(t,e){return e.modified&&(0,p.cy)(e.input.value)&&!t.startsWith("_:vega:_")}function Pq(t,e){return!(t==="parent"||e instanceof $i.proxy)}function qq(t){this.runAsync(null,(e=>{e._trigger=false;e._runtime.setState(t)}),(t=>{t._trigger=true}));return this}function Iq(t,e){function n(e){t({timestamp:Date.now(),elapsed:e})}this._timers.push(wP(n,e))}function Uq(t,e,n,i){const r=t.element();if(r)r.setAttribute("title",jq(i))}function jq(t){return t==null?"":(0,p.cy)(t)?Yq(t):(0,p.Gv)(t)&&!(0,p.$P)(t)?Gq(t):t+""}function Gq(t){return Object.keys(t).map((e=>{const n=t[e];return e+": "+((0,p.cy)(n)?Yq(n):Wq(n))})).join("\n")}function Yq(t){return"["+t.map(Wq).join(", ")+"]"}function Wq(t){return(0,p.cy)(t)?"[…]":(0,p.Gv)(t)&&!(0,p.$P)(t)?"{…}":t}function Xq(){if(this.renderer()==="canvas"&&this._renderer._canvas){let t=null;const e=()=>{if(t!=null){t()}const n=matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);n.addEventListener("change",e);t=()=>{n.removeEventListener("change",e)};this._renderer._canvas.getContext("2d").pixelRatio=window.devicePixelRatio||1;this._redraw=true;this._resize=1;this.resize().runAsync()};e()}}function Hq(t,e){const n=this;e=e||{};Si.call(n);if(e.loader)n.loader(e.loader);if(e.logger)n.logger(e.logger);if(e.logLevel!=null)n.logLevel(e.logLevel);if(e.locale||t.locale){const i=(0,p.X$)({},t.locale,e.locale);n.locale(Ce(i.number,i.time))}n._el=null;n._elBind=null;n._renderType=e.renderer||oy.Canvas;n._scenegraph=new rm;const i=n._scenegraph.root;n._renderer=null;n._tooltip=e.tooltip||Uq,n._redraw=true;n._handler=(new jm).scene(i);n._globalCursor=false;n._preventDefault=false;n._timers=[];n._eventListeners=[];n._resizeListeners=[];n._eventConfig=GP(t.eventConfig);n.globalCursor(n._eventConfig.globalCursor);const r=Dq(n,t,e.expr);n._runtime=r;n._signals=r.signals;n._bind=(t.bindings||[]).map((t=>({state:null,param:(0,p.X$)({},t)})));if(r.root)r.root.set(i);i.source=r.data.root.input;n.pulse(r.data.root.input,n.changeset().insert(i.items));n._width=n.width();n._height=n.height();n._viewWidth=$q(n,n._width);n._viewHeight=Rq(n,n._height);n._origin=[0,0];n._resize=0;n._autosize=1;Oq(n);EP(n);DP(n);n.description(t.description);if(e.hover)n.hover();if(e.container)n.initialize(e.container,e.bind);if(e.watchPixelRatio)n._watchPixelRatio()}function Vq(t,e){return(0,p.mQ)(t._signals,e)?t._signals[e]:(0,p.z3)("Unrecognized signal name: "+(0,p.r$)(e))}function Qq(t,e){const n=(t._targets||[]).filter((t=>t._update&&t._update.handler===e));return n.length?n[0]:null}function Kq(t,e,n,i){let r=Qq(n,i);if(!r){r=mq(t,(()=>i(e,n.value)));r.handler=i;t.on(n,null,r)}return t}function Zq(t,e,n){const i=Qq(e,n);if(i)e._targets.remove(i);return t}(0,p.B)(Hq,Si,{async evaluate(t,e,n){await Si.prototype.evaluate.call(this,t,e);if(this._redraw||this._resize){try{if(this._renderer){if(this._resize){this._resize=0;NP(this)}await this._renderer.renderAsync(this._scenegraph.root)}this._redraw=false}catch(i){this.error(i)}}if(n)hn(this,n);return this},dirty(t){this._redraw=true;this._renderer&&this._renderer.dirty(t)},description(t){if(arguments.length){const e=t!=null?t+"":null;if(e!==this._desc)kP(this._el,this._desc=e);return this}return this._desc},container(){return this._el},scenegraph(){return this._scenegraph},origin(){return this._origin.slice()},signal(t,e,n){const i=Vq(this,t);return arguments.length===1?i.value:this.update(i,e,n)},width(t){return arguments.length?this.signal("width",t):this.signal("width")},height(t){return arguments.length?this.signal("height",t):this.signal("height")},padding(t){return arguments.length?this.signal("padding",_q(t)):_q(this.signal("padding"))},autosize(t){return arguments.length?this.signal("autosize",t):this.signal("autosize")},background(t){return arguments.length?this.signal("background",t):this.signal("background")},renderer(t){if(!arguments.length)return this._renderType;if(!ly(t))(0,p.z3)("Unrecognized renderer type: "+t);if(t!==this._renderType){this._renderType=t;this._resetRenderer()}return this},tooltip(t){if(!arguments.length)return this._tooltip;if(t!==this._tooltip){this._tooltip=t;this._resetRenderer()}return this},loader(t){if(!arguments.length)return this._loader;if(t!==this._loader){Si.prototype.loader.call(this,t);this._resetRenderer()}return this},resize(){this._autosize=1;return this.touch(Vq(this,"autosize"))},_resetRenderer(){if(this._renderer){this._renderer=null;this.initialize(this._el,this._elBind)}},_resizeView:Tq,addEventListener(t,e,n){let i=e;if(!(n&&n.trap===false)){i=mq(this,e);i.raw=e}this._handler.on(t,i);return this},removeEventListener(t,e){var n=this._handler.handlers(t),i=n.length,r,s;while(--i>=0){s=n[i].type;r=n[i].handler;if(t===s&&(e===r||e===r.raw)){this._handler.off(s,r);break}}return this},addResizeListener(t){const e=this._resizeListeners;if(!e.includes(t)){e.push(t)}return this},removeResizeListener(t){var e=this._resizeListeners,n=e.indexOf(t);if(n>=0){e.splice(n,1)}return this},addSignalListener(t,e){return Kq(this,t,Vq(this,t),e)},removeSignalListener(t,e){return Zq(this,Vq(this,t),e)},addDataListener(t,e){return Kq(this,t,FP(this,t).values,e)},removeDataListener(t,e){return Zq(this,FP(this,t).values,e)},globalCursor(t){if(arguments.length){if(this._globalCursor!==!!t){const e=CP(this,null);this._globalCursor=!!t;if(e)CP(this,e)}return this}else{return this._globalCursor}},preventDefault(t){if(arguments.length){this._preventDefault=t;return this}else{return this._preventDefault}},timer:Iq,events:HP,finalize:JP,hover:ZP,data:SP,change:BP,insert:zP,remove:$P,scale:Cq,initialize:yq,toImageURL:Aq,toCanvas:Eq,toSVG:Mq,getState:Nq,setState:qq,_watchPixelRatio:Xq});var Jq=n(45948);function tI(t){return(0,p.Gv)(t)?t:{type:t||"pad"}}const eI=t=>+t||0;const nI=t=>({top:t,bottom:t,left:t,right:t});function iI(t){return!(0,p.Gv)(t)?nI(eI(t)):t.signal?t:{top:eI(t.top),bottom:eI(t.bottom),left:eI(t.left),right:eI(t.right)}}const rI=t=>(0,p.Gv)(t)&&!(0,p.cy)(t)?(0,p.X$)({},t):{value:t};function sI(t,e,n,i){if(n!=null){const r=(0,p.Gv)(n)&&!(0,p.cy)(n)||(0,p.cy)(n)&&n.length&&(0,p.Gv)(n[0]);if(r){t.update[e]=n}else{t[i||"enter"][e]={value:n}}return 1}else{return 0}}function aI(t,e,n){for(const i in e){sI(t,i,e[i])}for(const i in n){sI(t,i,n[i],"update")}}function oI(t,e,n){for(const i in e){if(n&&(0,p.mQ)(n,i))continue;t[i]=(0,p.X$)(t[i]||{},e[i])}return t}function uI(t,e){return e&&(e.enter&&e.enter[t]||e.update&&e.update[t])}const lI="mark";const cI="frame";const fI="scope";const dI="axis";const hI="axis-domain";const pI="axis-grid";const mI="axis-label";const gI="axis-tick";const yI="axis-title";const vI="legend";const bI="legend-band";const xI="legend-entry";const _I="legend-gradient";const wI="legend-label";const AI="legend-symbol";const kI="legend-title";const EI="title";const MI="title-text";const DI="title-subtitle";function CI(t,e,n,i,r){const s={},a={};let o,u,l,c;u="lineBreak";if(e==="text"&&r[u]!=null&&!uI(u,t)){FI(s,u,r[u])}if(n=="legend"||String(n).startsWith("axis")){n=null}c=n===cI?r.group:n===lI?(0,p.X$)({},r.mark,r[e]):null;for(u in c){l=uI(u,t)||(u==="fill"||u==="stroke")&&(uI("fill",t)||uI("stroke",t));if(!l)FI(s,u,c[u])}(0,p.YO)(i).forEach((e=>{const n=r.style&&r.style[e];for(const i in n){if(!uI(i,t)){FI(s,i,n[i])}}}));t=(0,p.X$)({},t);for(u in s){c=s[u];if(c.signal){(o=o||{})[u]=c}else{a[u]=c}}t.enter=(0,p.X$)(a,t.enter);if(o)t.update=(0,p.X$)(o,t.update);return t}function FI(t,e,n){t[e]=n&&n.signal?{signal:n.signal}:{value:n}}const SI=t=>(0,p.Kg)(t)?(0,p.r$)(t):t.signal?`(${t.signal})`:TI(t);function BI(t){if(t.gradient!=null){return RI(t)}let e=t.signal?`(${t.signal})`:t.color?$I(t.color):t.field!=null?TI(t.field):t.value!==undefined?(0,p.r$)(t.value):undefined;if(t.scale!=null){e=LI(t,e)}if(e===undefined){e=null}if(t.exponent!=null){e=`pow(${e},${OI(t.exponent)})`}if(t.mult!=null){e+=`*${OI(t.mult)}`}if(t.offset!=null){e+=`+${OI(t.offset)}`}if(t.round){e=`round(${e})`}return e}const zI=(t,e,n,i)=>`(${t}(${[e,n,i].map(BI).join(",")})+'')`;function $I(t){return t.c?zI("hcl",t.h,t.c,t.l):t.h||t.s?zI("hsl",t.h,t.s,t.l):t.l||t.a?zI("lab",t.l,t.a,t.b):t.r||t.g||t.b?zI("rgb",t.r,t.g,t.b):null}function RI(t){const e=[t.start,t.stop,t.count].map((t=>t==null?null:(0,p.r$)(t)));while(e.length&&(0,p.se)(e)==null)e.pop();e.unshift(SI(t.gradient));return`gradient(${e.join(",")})`}function OI(t){return(0,p.Gv)(t)?"("+BI(t)+")":t}function TI(t){return NI((0,p.Gv)(t)?t:{datum:t})}function NI(t){let e,n,i;if(t.signal){e="datum";i=t.signal}else if(t.group||t.parent){n=Math.max(1,t.level||1);e="item";while(n-- >0){e+=".mark.group"}if(t.parent){i=t.parent;e+=".datum"}else{i=t.group}}else if(t.datum){e="datum";i=t.datum}else{(0,p.z3)("Invalid field reference: "+(0,p.r$)(t))}if(!t.signal){i=(0,p.Kg)(i)?(0,p.iv)(i).map(p.r$).join("]["):NI(i)}return e+"["+i+"]"}function LI(t,e){const n=SI(t.scale);if(t.range!=null){e=`lerp(_range(${n}), ${+t.range})`}else{if(e!==undefined)e=`_scale(${n}, ${e})`;if(t.band){e=(e?e+"+":"")+`_bandwidth(${n})`+(+t.band===1?"":"*"+OI(t.band));if(t.extra){e=`(datum.extra ? _scale(${n}, datum.extra.value) : ${e})`}}if(e==null)e="0"}return e}function PI(t){let e="";t.forEach((t=>{const n=BI(t);e+=t.test?`(${t.test})?${n}:`:n}));if((0,p.se)(e)===":"){e+="null"}return e}function qI(t,e,n,i,r,s){const a={};s=s||{};s.encoders={$encode:a};t=CI(t,e,n,i,r.config);for(const o in t){a[o]=II(t[o],e,s,r)}return s}function II(t,e,n,i){const r={},s={};for(const a in t){if(t[a]!=null){r[a]=jI(UI(t[a]),i,n,s)}}return{$expr:{marktype:e,channels:r},$fields:Object.keys(s),$output:Object.keys(t)}}function UI(t){return(0,p.cy)(t)?PI(t):BI(t)}function jI(t,e,n,i){const r=jL(t,e);r.$fields.forEach((t=>i[t]=1));(0,p.X$)(n,r.$params);return r.$expr}const GI="outer",YI=["value","update","init","react","bind"];function WI(t,e){(0,p.z3)(t+' for "outer" push: '+(0,p.r$)(e))}function XI(t,e){const n=t.name;if(t.push===GI){if(!e.signals[n])WI("No prior signal definition",n);YI.forEach((e=>{if(t[e]!==undefined)WI("Invalid property ",e)}))}else{const i=e.addSignal(n,t.value);if(t.react===false)i.react=false;if(t.bind)e.addBinding(n,t.bind)}}function HI(t,e,n,i){this.id=-1;this.type=t;this.value=e;this.params=n;if(i)this.parent=i}function VI(t,e,n,i){return new HI(t,e,n,i)}function QI(t,e){return VI("operator",t,e)}function KI(t){const e={$ref:t.id};if(t.id<0)(t.refs=t.refs||[]).push(e);return e}function ZI(t,e){return e?{$field:t,$name:e}:{$field:t}}const JI=ZI("key");function tU(t,e){return{$compare:t,$order:e}}function eU(t,e){const n={$key:t};if(e)n.$flat=true;return n}const nU="ascending";const iU="descending";function rU(t){return!(0,p.Gv)(t)?"":(t.order===iU?"-":"+")+sU(t.op,t.field)}function sU(t,e){return(t&&t.signal?"$"+t.signal:t||"")+(t&&e?"_":"")+(e&&e.signal?"$"+e.signal:e||"")}const aU="scope";const oU="view";function uU(t){return t&&t.signal}function lU(t){return t&&t.expr}function cU(t){if(uU(t))return true;if((0,p.Gv)(t))for(const e in t){if(cU(t[e]))return true}return false}function fU(t,e){return t!=null?t:e}function dU(t){return t&&t.signal||t}const hU="timer";function pU(t,e){const n=t.merge?gU:t.stream?yU:t.type?vU:(0,p.z3)("Invalid stream specification: "+(0,p.r$)(t));return n(t,e)}function mU(t){return t===aU?oU:t||oU}function gU(t,e){const n=t.merge.map((t=>pU(t,e))),i=bU({merge:n},t,e);return e.addStream(i).id}function yU(t,e){const n=pU(t.stream,e),i=bU({stream:n},t,e);return e.addStream(i).id}function vU(t,e){let n;if(t.type===hU){n=e.event(hU,t.throttle);t={between:t.between,filter:t.filter}}else{n=e.event(mU(t.source),t.type)}const i=bU({stream:n},t,e);return Object.keys(i).length===1?n:e.addStream(i).id}function bU(t,e,n){let i=e.between;if(i){if(i.length!==2){(0,p.z3)('Stream "between" parameter must have 2 entries: '+(0,p.r$)(e))}t.between=[pU(i[0],n),pU(i[1],n)]}i=e.filter?[].concat(e.filter):[];if(e.marktype||e.markname||e.markrole){i.push(xU(e.marktype,e.markname,e.markrole))}if(e.source===aU){i.push("inScope(event.item)")}if(i.length){t.filter=jL("("+i.join(")&&(")+")",n).$expr}if((i=e.throttle)!=null){t.throttle=+i}if((i=e.debounce)!=null){t.debounce=+i}if(e.consume){t.consume=true}return t}function xU(t,e,n){const i="event.item";return i+(t&&t!=="*"?"&&"+i+".mark.marktype==='"+t+"'":"")+(n?"&&"+i+".mark.role==='"+n+"'":"")+(e?"&&"+i+".mark.name==='"+e+"'":"")}const _U={code:"_.$value",ast:{type:"Identifier",value:"value"}};function wU(t,e,n){const i=t.encode,r={target:n};let s=t.events,a=t.update,o=[];if(!s){(0,p.z3)("Signal update missing events specification.")}if((0,p.Kg)(s)){s=(0,Jq.P)(s,e.isSubscope()?aU:oU)}s=(0,p.YO)(s).filter((t=>t.signal||t.scale?(o.push(t),0):1));if(o.length>1){o=[kU(o)]}if(s.length){o.push(s.length>1?{merge:s}:s[0])}if(i!=null){if(a)(0,p.z3)("Signal encode and update are mutually exclusive.");a="encode(item(),"+(0,p.r$)(i)+")"}r.update=(0,p.Kg)(a)?jL(a,e):a.expr!=null?jL(a.expr,e):a.value!=null?a.value:a.signal!=null?{$expr:_U,$params:{$value:e.signalRef(a.signal)}}:(0,p.z3)("Invalid signal update specification.");if(t.force){r.options={force:true}}o.forEach((t=>e.addUpdate((0,p.X$)(AU(t,e),r))))}function AU(t,e){return{source:t.signal?e.signalRef(t.signal):t.scale?e.scaleRef(t.scale):pU(t,e)}}function kU(t){return{signal:"["+t.map((t=>t.scale?'scale("'+t.scale+'")':t.signal))+"]"}}function EU(t,e){const n=e.getSignal(t.name);let i=t.update;if(t.init){if(i){(0,p.z3)("Signals can not include both init and update expressions.")}else{i=t.init;n.initonly=true}}if(i){i=jL(i,e);n.update=i.$expr;n.params=i.$params}if(t.on){t.on.forEach((t=>wU(t,e,n.id)))}}const MU=t=>(e,n,i)=>VI(t,n,e||undefined,i);const DU=MU("aggregate");const CU=MU("axisticks");const FU=MU("bound");const SU=MU("collect");const BU=MU("compare");const zU=MU("datajoin");const $U=MU("encode");const RU=MU("expression");const OU=MU("facet");const TU=MU("field");const NU=MU("key");const LU=MU("legendentries");const PU=MU("load");const qU=MU("mark");const IU=MU("multiextent");const UU=MU("multivalues");const jU=MU("overlap");const GU=MU("params");const YU=MU("prefacet");const WU=MU("projection");const XU=MU("proxy");const HU=MU("relay");const VU=MU("render");const QU=MU("scale");const KU=MU("sieve");const ZU=MU("sortitems");const JU=MU("viewlayout");const tj=MU("values");let ej=0;const nj={min:"min",max:"max",count:"sum"};function ij(t,e){const n=t.type||"linear";if(!Wl(n)){(0,p.z3)("Unrecognized scale type: "+(0,p.r$)(n))}e.addScale(t.name,{type:n,domain:undefined})}function rj(t,e){const n=e.getScale(t.name).params;let i;n.domain=uj(t.domain,t,e);if(t.range!=null){n.range=xj(t,e,n)}if(t.interpolate!=null){bj(t.interpolate,n)}if(t.nice!=null){n.nice=vj(t.nice,e)}if(t.bins!=null){n.bins=yj(t.bins,e)}for(i in t){if((0,p.mQ)(n,i)||i==="name")continue;n[i]=sj(t[i],e)}}function sj(t,e){return!(0,p.Gv)(t)?t:t.signal?e.signalRef(t.signal):(0,p.z3)("Unsupported object: "+(0,p.r$)(t))}function aj(t,e){return t.signal?e.signalRef(t.signal):t.map((t=>sj(t,e)))}function oj(t){(0,p.z3)("Can not find data set: "+(0,p.r$)(t))}function uj(t,e,n){if(!t){if(e.domainMin!=null||e.domainMax!=null){(0,p.z3)("No scale domain defined for domainMin/domainMax to override.")}return}return t.signal?n.signalRef(t.signal):((0,p.cy)(t)?lj:t.fields?fj:cj)(t,e,n)}function lj(t,e,n){return t.map((t=>sj(t,n)))}function cj(t,e,n){const i=n.getData(t.data);if(!i)oj(t.data);return Vl(e.type)?i.valuesRef(n,t.field,pj(t.sort,false)):tc(e.type)?i.domainRef(n,t.field):i.extentRef(n,t.field)}function fj(t,e,n){const i=t.data,r=t.fields.reduce(((t,e)=>{e=(0,p.Kg)(e)?{data:i,field:e}:(0,p.cy)(e)||e.signal?dj(e,n):e;t.push(e);return t}),[]);return(Vl(e.type)?hj:tc(e.type)?mj:gj)(t,n,r)}function dj(t,e){const n="_:vega:_"+ej++,i=SU({});if((0,p.cy)(t)){i.value={$ingest:t}}else if(t.signal){const r="setdata("+(0,p.r$)(n)+","+t.signal+")";i.params.input=e.signalRef(r)}e.addDataPipeline(n,[i,KU({})]);return{data:n,field:"data"}}function hj(t,e,n){const i=pj(t.sort,true);let r,s;const a=n.map((t=>{const n=e.getData(t.data);if(!n)oj(t.data);return n.countsRef(e,t.field,i)}));const o={groupby:JI,pulse:a};if(i){r=i.op||"count";s=i.field?sU(r,i.field):"count";o.ops=[nj[r]];o.fields=[e.fieldRef(s)];o.as=[s]}r=e.add(DU(o));const u=e.add(SU({pulse:KI(r)}));s=e.add(tj({field:JI,sort:e.sortRef(i),pulse:KI(u)}));return KI(s)}function pj(t,e){if(t){if(!t.field&&!t.op){if((0,p.Gv)(t))t.field="key";else t={field:"key"}}else if(!t.field&&t.op!=="count"){(0,p.z3)("No field provided for sort aggregate op: "+t.op)}else if(e&&t.field){if(t.op&&!nj[t.op]){(0,p.z3)("Multiple domain scales can not be sorted using "+t.op)}}}return t}function mj(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);if(!n)oj(t.data);return n.domainRef(e,t.field)}));return KI(e.add(UU({values:i})))}function gj(t,e,n){const i=n.map((t=>{const n=e.getData(t.data);if(!n)oj(t.data);return n.extentRef(e,t.field)}));return KI(e.add(IU({extents:i})))}function yj(t,e){return t.signal||(0,p.cy)(t)?aj(t,e):e.objectProperty(t)}function vj(t,e){return t.signal?e.signalRef(t.signal):(0,p.Gv)(t)?{interval:sj(t.interval),step:sj(t.step)}:sj(t)}function bj(t,e){e.interpolate=sj(t.type||t);if(t.gamma!=null){e.interpolateGamma=sj(t.gamma)}}function xj(t,e,n){const i=e.config.range;let r=t.range;if(r.signal){return e.signalRef(r.signal)}else if((0,p.Kg)(r)){if(i&&(0,p.mQ)(i,r)){t=(0,p.X$)({},t,{range:i[r]});return xj(t,e,n)}else if(r==="width"){r=[0,{signal:"width"}]}else if(r==="height"){r=Vl(t.type)?[0,{signal:"height"}]:[{signal:"height"},0]}else{(0,p.z3)("Unrecognized scale range value: "+(0,p.r$)(r))}}else if(r.scheme){n.scheme=(0,p.cy)(r.scheme)?aj(r.scheme,e):sj(r.scheme,e);if(r.extent)n.schemeExtent=aj(r.extent,e);if(r.count)n.schemeCount=sj(r.count,e);return}else if(r.step){n.rangeStep=sj(r.step,e);return}else if(Vl(t.type)&&!(0,p.cy)(r)){return uj(r,t,e)}else if(!(0,p.cy)(r)){(0,p.z3)("Unsupported range type: "+(0,p.r$)(r))}return r.map((t=>((0,p.cy)(t)?aj:sj)(t,e)))}function _j(t,e){const n=e.config.projection||{},i={};for(const r in t){if(r==="name")continue;i[r]=wj(t[r],r,e)}for(const r in n){if(i[r]==null){i[r]=wj(n[r],r,e)}}e.addProjection(t.name,i)}function wj(t,e,n){return(0,p.cy)(t)?t.map((t=>wj(t,e,n))):!(0,p.Gv)(t)?t:t.signal?n.signalRef(t.signal):e==="fit"?t:(0,p.z3)("Unsupported parameter object: "+(0,p.r$)(t))}const Aj="top";const kj="left";const Ej="right";const Mj="bottom";const Dj="center";const Cj="vertical";const Fj="start";const Sj="middle";const Bj="end";const zj="index";const $j="label";const Rj="offset";const Oj="perc";const Tj="perc2";const Nj="value";const Lj="guide-label";const Pj="guide-title";const qj="group-title";const Ij="group-subtitle";const Uj="symbol";const jj="gradient";const Gj="discrete";const Yj="size";const Wj="shape";const Xj="fill";const Hj="stroke";const Vj="strokeWidth";const Qj="strokeDash";const Kj="opacity";const Zj=[Yj,Wj,Xj,Hj,Vj,Qj,Kj];const Jj={name:1,style:1,interactive:1};const tG={value:0};const eG={value:1};const nG="group";const iG="rect";const rG="rule";const sG="symbol";const aG="text";function oG(t){t.type=nG;t.interactive=t.interactive||false;return t}function uG(t,e){const n=(n,i)=>fU(t[n],fU(e[n],i));n.isVertical=n=>Cj===fU(t.direction,e.direction||(n?e.symbolDirection:e.gradientDirection));n.gradientLength=()=>fU(t.gradientLength,e.gradientLength||e.gradientWidth);n.gradientThickness=()=>fU(t.gradientThickness,e.gradientThickness||e.gradientHeight);n.entryColumns=()=>fU(t.columns,fU(e.columns,+n.isVertical(true)));return n}function lG(t,e){const n=e&&(e.update&&e.update[t]||e.enter&&e.enter[t]);return n&&n.signal?n:n?n.value:null}function cG(t,e,n){const i=e.config.style[n];return i&&i[t]}function fG(t,e,n){return`item.anchor === '${Fj}' ? ${t} : item.anchor === '${Bj}' ? ${e} : ${n}`}const dG=fG((0,p.r$)(kj),(0,p.r$)(Ej),(0,p.r$)(Dj));function hG(t){const e=t("tickBand");let n=t("tickOffset"),i,r;if(!e){i=t("bandPosition");r=t("tickExtra")}else if(e.signal){i={signal:`(${e.signal}) === 'extent' ? 1 : 0.5`};r={signal:`(${e.signal}) === 'extent'`};if(!(0,p.Gv)(n)){n={signal:`(${e.signal}) === 'extent' ? 0 : ${n}`}}}else if(e==="extent"){i=1;r=true;n=0}else{i=.5;r=false}return{extra:r,band:i,offset:n}}function pG(t,e){return!e?t:!t?e:!(0,p.Gv)(t)?{value:t,offset:e}:Object.assign({},t,{offset:pG(t.offset,e)})}function mG(t,e){if(e){t.name=e.name;t.style=e.style||t.style;t.interactive=!!e.interactive;t.encode=oI(t.encode,e,Jj)}else{t.interactive=false}return t}function gG(t,e,n,i){const r=uG(t,n),s=r.isVertical(),a=r.gradientThickness(),o=r.gradientLength();let u,l,c,f,d;if(s){l=[0,1];c=[0,0];f=a;d=o}else{l=[0,0];c=[1,0];f=o;d=a}const h={enter:u={opacity:tG,x:tG,y:tG,width:rI(f),height:rI(d)},update:(0,p.X$)({},u,{opacity:eG,fill:{gradient:e,start:l,stop:c}}),exit:{opacity:tG}};aI(h,{stroke:r("gradientStrokeColor"),strokeWidth:r("gradientStrokeWidth")},{opacity:r("gradientOpacity")});return mG({type:iG,role:_I,encode:h},i)}function yG(t,e,n,i,r){const s=uG(t,n),a=s.isVertical(),o=s.gradientThickness(),u=s.gradientLength();let l,c,f,d,h="";a?(l="y",f="y2",c="x",d="width",h="1-"):(l="x",f="x2",c="y",d="height");const m={opacity:tG,fill:{scale:e,field:Nj}};m[l]={signal:h+"datum."+Oj,mult:u};m[c]=tG;m[f]={signal:h+"datum."+Tj,mult:u};m[d]=rI(o);const g={enter:m,update:(0,p.X$)({},m,{opacity:eG}),exit:{opacity:tG}};aI(g,{stroke:s("gradientStrokeColor"),strokeWidth:s("gradientStrokeWidth")},{opacity:s("gradientOpacity")});return mG({type:iG,role:bI,key:Nj,from:r,encode:g},i)}const vG=`datum.${Oj}<=0?"${kj}":datum.${Oj}>=1?"${Ej}":"${Dj}"`,bG=`datum.${Oj}<=0?"${Mj}":datum.${Oj}>=1?"${Aj}":"${Sj}"`;function xG(t,e,n,i){const r=uG(t,e),s=r.isVertical(),a=rI(r.gradientThickness()),o=r.gradientLength();let u=r("labelOverlap"),l,c,f,d,h="";const p={enter:l={opacity:tG},update:c={opacity:eG,text:{field:$j}},exit:{opacity:tG}};aI(p,{fill:r("labelColor"),fillOpacity:r("labelOpacity"),font:r("labelFont"),fontSize:r("labelFontSize"),fontStyle:r("labelFontStyle"),fontWeight:r("labelFontWeight"),limit:fU(t.labelLimit,e.gradientLabelLimit)});if(s){l.align={value:"left"};l.baseline=c.baseline={signal:bG};f="y";d="x";h="1-"}else{l.align=c.align={signal:vG};l.baseline={value:"top"};f="x";d="y"}l[f]=c[f]={signal:h+"datum."+Oj,mult:o};l[d]=c[d]=a;a.offset=fU(t.labelOffset,e.gradientLabelOffset)||0;u=u?{separation:r("labelSeparation"),method:u,order:"datum."+zj}:undefined;return mG({type:aG,role:wI,style:Lj,key:Nj,from:i,encode:p,overlap:u},n)}function _G(t,e,n,i,r){const s=uG(t,e),a=n.entries,o=!!(a&&a.interactive),u=a?a.name:undefined,l=s("clipHeight"),c=s("symbolOffset"),f={data:"value"},d=`(${r}) ? datum.${Rj} : datum.${Yj}`,h=l?rI(l):{field:Yj},p=`datum.${zj}`,m=`max(1, ${r})`;let g,y,v,b,x;h.mult=.5;g={enter:y={opacity:tG,x:{signal:d,mult:.5,offset:c},y:h},update:v={opacity:eG,x:y.x,y:y.y},exit:{opacity:tG}};let _=null,w=null;if(!t.fill){_=e.symbolBaseFillColor;w=e.symbolBaseStrokeColor}aI(g,{fill:s("symbolFillColor",_),shape:s("symbolType"),size:s("symbolSize"),stroke:s("symbolStrokeColor",w),strokeDash:s("symbolDash"),strokeDashOffset:s("symbolDashOffset"),strokeWidth:s("symbolStrokeWidth")},{opacity:s("symbolOpacity")});Zj.forEach((e=>{if(t[e]){v[e]=y[e]={scale:t[e],field:Nj}}}));const A=mG({type:sG,role:AI,key:Nj,from:f,clip:l?true:undefined,encode:g},n.symbols);const k=rI(c);k.offset=s("labelOffset");g={enter:y={opacity:tG,x:{signal:d,offset:k},y:h},update:v={opacity:eG,text:{field:$j},x:y.x,y:y.y},exit:{opacity:tG}};aI(g,{align:s("labelAlign"),baseline:s("labelBaseline"),fill:s("labelColor"),fillOpacity:s("labelOpacity"),font:s("labelFont"),fontSize:s("labelFontSize"),fontStyle:s("labelFontStyle"),fontWeight:s("labelFontWeight"),limit:s("labelLimit")});const E=mG({type:aG,role:wI,style:Lj,key:Nj,from:f,encode:g},n.labels);g={enter:{noBound:{value:!l},width:tG,height:l?rI(l):tG,opacity:tG},exit:{opacity:tG},update:v={opacity:eG,row:{signal:null},column:{signal:null}}};if(s.isVertical(true)){b=`ceil(item.mark.items.length / ${m})`;v.row.signal=`${p}%${b}`;v.column.signal=`floor(${p} / ${b})`;x={field:["row",p]}}else{v.row.signal=`floor(${p} / ${m})`;v.column.signal=`${p} % ${m}`;x={field:p}}v.column.signal=`(${r})?${v.column.signal}:${p}`;i={facet:{data:i,name:"value",groupby:zj}};return oG({role:fI,from:i,encode:oI(g,a,Jj),marks:[A,E],name:u,interactive:o,sort:x})}function wG(t,e){const n=uG(t,e);return{align:n("gridAlign"),columns:n.entryColumns(),center:{row:true,column:false},padding:{row:n("rowPadding"),column:n("columnPadding")}}}const AG='item.orient === "left"',kG='item.orient === "right"',EG=`(${AG} || ${kG})`,MG=`datum.vgrad && ${EG}`,DG=fG('"top"','"bottom"','"middle"'),CG=fG('"right"','"left"','"center"'),FG=`datum.vgrad && ${kG} ? (${CG}) : (${EG} && !(datum.vgrad && ${AG})) ? "left" : ${dG}`,SG=`item._anchor || (${EG} ? "middle" : "start")`,BG=`${MG} ? (${AG} ? -90 : 90) : 0`,zG=`${EG} ? (datum.vgrad ? (${kG} ? "bottom" : "top") : ${DG}) : "top"`;function $G(t,e,n,i){const r=uG(t,e);const s={enter:{opacity:tG},update:{opacity:eG,x:{field:{group:"padding"}},y:{field:{group:"padding"}}},exit:{opacity:tG}};aI(s,{orient:r("titleOrient"),_anchor:r("titleAnchor"),anchor:{signal:SG},angle:{signal:BG},align:{signal:FG},baseline:{signal:zG},text:t.title,fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),baseline:r("titleBaseline")});return mG({type:aG,role:kI,style:Pj,from:i,encode:s},n)}function RG(t,e){let n;if((0,p.Gv)(t)){if(t.signal){n=t.signal}else if(t.path){n="pathShape("+OG(t.path)+")"}else if(t.sphere){n="geoShape("+OG(t.sphere)+', {type: "Sphere"})'}}return n?e.signalRef(n):!!t}function OG(t){return(0,p.Gv)(t)&&t.signal?t.signal:(0,p.r$)(t)}function TG(t){const e=t.role||"";return e.startsWith("axis")||e.startsWith("legend")||e.startsWith("title")?e:t.type===nG?fI:e||lI}function NG(t){return{marktype:t.type,name:t.name||undefined,role:t.role||TG(t),zindex:+t.zindex||undefined,aria:t.aria,description:t.description}}function LG(t,e){return t&&t.signal?e.signalRef(t.signal):t===false?false:true}function PG(t,e){const n=Ri(t.type);if(!n)(0,p.z3)("Unrecognized transform type: "+(0,p.r$)(t.type));const i=VI(n.type.toLowerCase(),null,qG(n,t,e));if(t.signal)e.addSignal(t.signal,e.proxy(i));i.metadata=n.metadata||{};return i}function qG(t,e,n){const i={},r=t.params.length;for(let s=0;sUG(t,e,n))):UG(t,r,n)}function UG(t,e,n){const i=t.type;if(uU(e)){return VG(i)?(0,p.z3)("Expression references can not be signals."):QG(i)?n.fieldRef(e):KG(i)?n.compareRef(e):n.signalRef(e.signal)}else{const r=t.expr||QG(i);return r&&WG(e)?n.exprRef(e.expr,e.as):r&&XG(e)?ZI(e.field,e.as):VG(i)?jL(e,n):HG(i)?KI(n.getData(e).values):QG(i)?ZI(e):KG(i)?n.compareRef(e):e}}function jG(t,e,n){if(!(0,p.Kg)(e.from)){(0,p.z3)('Lookup "from" parameter must be a string literal.')}return n.getData(e.from).lookupRef(n,e.key)}function GG(t,e,n){const i=e[t.name];if(t.array){if(!(0,p.cy)(i)){(0,p.z3)("Expected an array of sub-parameters. Instead: "+(0,p.r$)(i))}return i.map((e=>YG(t,e,n)))}else{return YG(t,i,n)}}function YG(t,e,n){const i=t.params.length;let r;for(let a=0;at&&t.expr;const XG=t=>t&&t.field;const HG=t=>t==="data";const VG=t=>t==="expr";const QG=t=>t==="field";const KG=t=>t==="compare";function ZG(t,e,n){let i,r,s,a,o;if(!t){a=KI(n.add(SU(null,[{}])))}else if(i=t.facet){if(!e)(0,p.z3)("Only group marks can be faceted.");if(i.field!=null){a=o=JG(i,n)}else{if(!t.data){s=PG((0,p.X$)({type:"aggregate",groupby:(0,p.YO)(i.groupby)},i.aggregate),n);s.params.key=n.keyRef(i.groupby);s.params.pulse=JG(i,n);a=o=KI(n.add(s))}else{o=KI(n.getData(t.data).aggregate)}r=n.keyRef(i.groupby,true)}}if(!a){a=JG(t,n)}return{key:r,pulse:a,parent:o}}function JG(t,e){return t.$ref?t:t.data&&t.data.$ref?t.data:KI(e.getData(t.data).output)}function tY(t,e,n,i,r){this.scope=t;this.input=e;this.output=n;this.values=i;this.aggregate=r;this.index={}}tY.fromEntries=function(t,e){const n=e.length,i=e[n-1],r=e[n-2];let s=e[0],a=null,o=1;if(s&&s.type==="load"){s=e[1]}t.add(e[0]);for(;ot==null?"null":t)).join(",")+"),0)";const c=jL(l,e);u.update=c.$expr;u.params=c.$params}function oY(t,e){const n=TG(t),i=t.type===nG,r=t.from&&t.from.facet,s=t.overlap;let a=t.layout||n===fI||n===cI,o,u,l,c,f,d,h;const m=n===lI||a||r;const g=ZG(t.from,i,e);u=e.add(zU({key:g.key||(t.key?ZI(t.key):undefined),pulse:g.pulse,clean:!i}));const y=KI(u);u=l=e.add(SU({pulse:y}));u=e.add(qU({markdef:NG(t),interactive:LG(t.interactive,e),clip:RG(t.clip,e),context:{$context:true},groups:e.lookup(),parent:e.signals.parent?e.signalRef("parent"):null,index:e.markpath(),pulse:KI(u)}));const v=KI(u);u=c=e.add($U(qI(t.encode,t.type,n,t.style,e,{mod:false,pulse:v})));u.params.parent=e.encode();if(t.transform){t.transform.forEach((t=>{const n=PG(t,e),i=n.metadata;if(i.generates||i.changes){(0,p.z3)("Mark transforms should not generate new data.")}if(!i.nomod)c.params.mod=true;n.params.pulse=KI(u);e.add(u=n)}))}if(t.sort){u=e.add(ZU({sort:e.compareRef(t.sort),pulse:KI(u)}))}const b=KI(u);if(r||a){a=e.add(JU({layout:e.objectProperty(t.layout),legends:e.legends,mark:v,pulse:b}));d=KI(a)}const x=e.add(FU({mark:v,pulse:d||b}));h=KI(x);if(i){if(m){o=e.operators;o.pop();if(a)o.pop()}e.pushState(b,d||h,y);r?rY(t,e,g):m?sY(t,e,g):e.parse(t);e.popState();if(m){if(a)o.push(a);o.push(x)}}if(s){h=uY(s,h,e)}const _=e.add(VU({pulse:h})),w=e.add(KU({pulse:KI(_)},undefined,e.parent()));if(t.name!=null){f=t.name;e.addData(f,new tY(e,l,_,w));if(t.on)t.on.forEach((t=>{if(t.insert||t.remove||t.toggle){(0,p.z3)("Marks only support modify triggers.")}aY(t,e,f)}))}}function uY(t,e,n){const i=t.method,r=t.bound,s=t.separation;const a={separation:uU(s)?n.signalRef(s.signal):s,method:uU(i)?n.signalRef(i.signal):i,pulse:e};if(t.order){a.sort=n.compareRef({field:t.order})}if(r){const t=r.tolerance;a.boundTolerance=uU(t)?n.signalRef(t.signal):+t;a.boundScale=n.scaleRef(r.scale);a.boundOrient=r.orient}return KI(n.add(jU(a)))}function lY(t,e){const n=e.config.legend,i=t.encode||{},r=uG(t,n),s=i.legend||{},a=s.name||undefined,o=s.interactive,u=s.style,l={};let c=0,f,d,h;Zj.forEach((e=>t[e]?(l[e]=t[e],c=c||t[e]):0));if(!c)(0,p.z3)("Missing valid scale for legend.");const m=cY(t,e.scaleType(c));const g={title:t.title!=null,scales:l,type:m,vgrad:m!=="symbol"&&r.isVertical()};const y=KI(e.add(SU(null,[g])));const v={enter:{x:{value:0},y:{value:0}}};const b=KI(e.add(LU(d={type:m,scale:e.scaleRef(c),count:e.objectProperty(r("tickCount")),limit:e.property(r("symbolLimit")),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));if(m===jj){h=[gG(t,c,n,i.gradient),xG(t,n,i.labels,b)];d.count=d.count||e.signalRef(`max(2,2*floor((${dU(r.gradientLength())})/100))`)}else if(m===Gj){h=[yG(t,c,n,i.gradient,b),xG(t,n,i.labels,b)]}else{f=wG(t,n);h=[_G(t,n,i,b,dU(f.columns))];d.size=hY(t,e,h[0].marks)}h=[oG({role:xI,from:y,encode:v,marks:h,layout:f,interactive:o})];if(g.title){h.push($G(t,n,i.title,y))}return oY(oG({role:vI,from:y,encode:oI(dY(r,t,n),s,Jj),marks:h,aria:r("aria"),description:r("description"),zindex:r("zindex"),name:a,interactive:o,style:u}),e)}function cY(t,e){let n=t.type||Uj;if(!t.type&&fY(t)===1&&(t.fill||t.stroke)){n=Hl(e)?jj:Ql(e)?Gj:Uj}return n!==jj?n:Ql(e)?Gj:jj}function fY(t){return Zj.reduce(((e,n)=>e+(t[n]?1:0)),0)}function dY(t,e,n){const i={enter:{},update:{}};aI(i,{orient:t("orient"),offset:t("offset"),padding:t("padding"),titlePadding:t("titlePadding"),cornerRadius:t("cornerRadius"),fill:t("fillColor"),stroke:t("strokeColor"),strokeWidth:n.strokeWidth,strokeDash:n.strokeDash,x:t("legendX"),y:t("legendY"),format:e.format,formatType:e.formatType});return i}function hY(t,e,n){const i=dU(pY("size",t,n)),r=dU(pY("strokeWidth",t,n)),s=dU(mY(n[1].encode,e,Lj));return jL(`max(ceil(sqrt(${i})+${r}),${s})`,e)}function pY(t,e,n){return e[t]?`scale("${e[t]}",datum)`:lG(t,n[0].encode)}function mY(t,e,n){return lG("fontSize",t)||cG("fontSize",e,n)}const gY=`item.orient==="${kj}"?-90:item.orient==="${Ej}"?90:0`;function yY(t,e){t=(0,p.Kg)(t)?{text:t}:t;const n=uG(t,e.config.title),i=t.encode||{},r=i.group||{},s=r.name||undefined,a=r.interactive,o=r.style,u=[];const l={},c=KI(e.add(SU(null,[l])));u.push(xY(t,n,vY(t),c));if(t.subtitle){u.push(_Y(t,n,i.subtitle,c))}return oY(oG({role:EI,from:c,encode:bY(n,r),marks:u,aria:n("aria"),description:n("description"),zindex:n("zindex"),name:s,interactive:a,style:o}),e)}function vY(t){const e=t.encode;return e&&e.title||(0,p.X$)({name:t.name,interactive:t.interactive,style:t.style},e)}function bY(t,e){const n={enter:{},update:{}};aI(n,{orient:t("orient"),anchor:t("anchor"),align:{signal:dG},angle:{signal:gY},limit:t("limit"),frame:t("frame"),offset:t("offset")||0,padding:t("subtitlePadding")});return oI(n,e,Jj)}function xY(t,e,n,i){const r={value:0},s=t.text,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};aI(a,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("color"),font:e("font"),fontSize:e("fontSize"),fontStyle:e("fontStyle"),fontWeight:e("fontWeight"),lineHeight:e("lineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")});return mG({type:aG,role:MI,style:qj,from:i,encode:a},n)}function _Y(t,e,n,i){const r={value:0},s=t.subtitle,a={enter:{opacity:r},update:{opacity:{value:1}},exit:{opacity:r}};aI(a,{text:s,align:{signal:"item.mark.group.align"},angle:{signal:"item.mark.group.angle"},limit:{signal:"item.mark.group.limit"},baseline:"top",dx:e("dx"),dy:e("dy"),fill:e("subtitleColor"),font:e("subtitleFont"),fontSize:e("subtitleFontSize"),fontStyle:e("subtitleFontStyle"),fontWeight:e("subtitleFontWeight"),lineHeight:e("subtitleLineHeight")},{align:e("align"),angle:e("angle"),baseline:e("baseline")});return mG({type:aG,role:DI,style:Ij,from:i,encode:a},n)}function wY(t,e){const n=[];if(t.transform){t.transform.forEach((t=>{n.push(PG(t,e))}))}if(t.on){t.on.forEach((n=>{aY(n,e,t.name)}))}e.addDataPipeline(t.name,AY(t,e,n))}function AY(t,e,n){const i=[];let r=null,s=false,a=false,o,u,l,c,f;if(t.values){if(uU(t.values)||cU(t.format)){i.push(EY(e,t));i.push(r=kY())}else{i.push(r=kY({$ingest:t.values,$format:t.format}))}}else if(t.url){if(cU(t.url)||cU(t.format)){i.push(EY(e,t));i.push(r=kY())}else{i.push(r=kY({$request:t.url,$format:t.format}))}}else if(t.source){r=o=(0,p.YO)(t.source).map((t=>KI(e.getData(t).output)));i.push(null)}for(u=0,l=n.length;ut===Mj||t===Aj;const DY=(t,e,n)=>uU(t)?RY(t.signal,e,n):t===kj||t===Aj?e:n;const CY=(t,e,n)=>uU(t)?zY(t.signal,e,n):MY(t)?e:n;const FY=(t,e,n)=>uU(t)?$Y(t.signal,e,n):MY(t)?n:e;const SY=(t,e,n)=>uU(t)?OY(t.signal,e,n):t===Aj?{value:e}:{value:n};const BY=(t,e,n)=>uU(t)?TY(t.signal,e,n):t===Ej?{value:e}:{value:n};const zY=(t,e,n)=>NY(`${t} === '${Aj}' || ${t} === '${Mj}'`,e,n);const $Y=(t,e,n)=>NY(`${t} !== '${Aj}' && ${t} !== '${Mj}'`,e,n);const RY=(t,e,n)=>PY(`${t} === '${kj}' || ${t} === '${Aj}'`,e,n);const OY=(t,e,n)=>PY(`${t} === '${Aj}'`,e,n);const TY=(t,e,n)=>PY(`${t} === '${Ej}'`,e,n);const NY=(t,e,n)=>{e=e!=null?rI(e):e;n=n!=null?rI(n):n;if(LY(e)&&LY(n)){e=e?e.signal||(0,p.r$)(e.value):null;n=n?n.signal||(0,p.r$)(n.value):null;return{signal:`${t} ? (${e}) : (${n})`}}else{return[(0,p.X$)({test:t},e)].concat(n||[])}};const LY=t=>t==null||Object.keys(t).length===1;const PY=(t,e,n)=>({signal:`${t} ? (${IY(e)}) : (${IY(n)})`});const qY=(t,e,n,i,r)=>({signal:(i!=null?`${t} === '${kj}' ? (${IY(i)}) : `:"")+(n!=null?`${t} === '${Mj}' ? (${IY(n)}) : `:"")+(r!=null?`${t} === '${Ej}' ? (${IY(r)}) : `:"")+(e!=null?`${t} === '${Aj}' ? (${IY(e)}) : `:"")+"(null)"});const IY=t=>uU(t)?t.signal:t==null?null:(0,p.r$)(t);const UY=(t,e)=>e===0?0:uU(t)?{signal:`(${t.signal}) * ${e}`}:{value:t*e};const jY=(t,e)=>{const n=t.signal;return n&&n.endsWith("(null)")?{signal:n.slice(0,-6)+e.signal}:t};function GY(t,e,n,i){let r;if(e&&(0,p.mQ)(e,t)){return e[t]}else if((0,p.mQ)(n,t)){return n[t]}else if(t.startsWith("title")){switch(t){case"titleColor":r="fill";break;case"titleFont":case"titleFontSize":case"titleFontWeight":r=t[5].toLowerCase()+t.slice(6)}return i[Pj][r]}else if(t.startsWith("label")){switch(t){case"labelColor":r="fill";break;case"labelFont":case"labelFontSize":r=t[5].toLowerCase()+t.slice(6)}return i[Lj][r]}return null}function YY(t){const e={};for(const n of t){if(!n)continue;for(const t in n)e[t]=1}return Object.keys(e)}function WY(t,e){var n=e.config,i=n.style,r=n.axis,s=e.scaleType(t.scale)==="band"&&n.axisBand,a=t.orient,o,u,l;if(uU(a)){const t=YY([n.axisX,n.axisY]),e=YY([n.axisTop,n.axisBottom,n.axisLeft,n.axisRight]);o={};for(l of t){o[l]=CY(a,GY(l,n.axisX,r,i),GY(l,n.axisY,r,i))}u={};for(l of e){u[l]=qY(a.signal,GY(l,n.axisTop,r,i),GY(l,n.axisBottom,r,i),GY(l,n.axisLeft,r,i),GY(l,n.axisRight,r,i))}}else{o=a===Aj||a===Mj?n.axisX:n.axisY;u=n["axis"+a[0].toUpperCase()+a.slice(1)]}const c=o||u||s?(0,p.X$)({},r,o,u,s):r;return c}function XY(t,e,n,i){const r=uG(t,e),s=t.orient;let a,o;const u={enter:a={opacity:tG},update:o={opacity:eG},exit:{opacity:tG}};aI(u,{stroke:r("domainColor"),strokeCap:r("domainCap"),strokeDash:r("domainDash"),strokeDashOffset:r("domainDashOffset"),strokeWidth:r("domainWidth"),strokeOpacity:r("domainOpacity")});const l=HY(t,0);const c=HY(t,1);a.x=o.x=CY(s,l,tG);a.x2=o.x2=CY(s,c);a.y=o.y=FY(s,l,tG);a.y2=o.y2=FY(s,c);return mG({type:rG,role:hI,from:i,encode:u},n)}function HY(t,e){return{scale:t.scale,range:e}}function VY(t,e,n,i,r){const s=uG(t,e),a=t.orient,o=t.gridScale,u=DY(a,1,-1),l=QY(t.offset,u);let c,f,d;const h={enter:c={opacity:tG},update:d={opacity:eG},exit:f={opacity:tG}};aI(h,{stroke:s("gridColor"),strokeCap:s("gridCap"),strokeDash:s("gridDash"),strokeDashOffset:s("gridDashOffset"),strokeOpacity:s("gridOpacity"),strokeWidth:s("gridWidth")});const m={scale:t.scale,field:Nj,band:r.band,extra:r.extra,offset:r.offset,round:s("tickRound")};const g=CY(a,{signal:"height"},{signal:"width"});const y=o?{scale:o,range:0,mult:u,offset:l}:{value:0,offset:l};const v=o?{scale:o,range:1,mult:u,offset:l}:(0,p.X$)(g,{mult:u,offset:l});c.x=d.x=CY(a,m,y);c.y=d.y=FY(a,m,y);c.x2=d.x2=FY(a,v);c.y2=d.y2=CY(a,v);f.x=CY(a,m);f.y=FY(a,m);return mG({type:rG,role:pI,key:Nj,from:i,encode:h},n)}function QY(t,e){if(e===1);else if(!(0,p.Gv)(t)){t=uU(e)?{signal:`(${e.signal}) * (${t||0})`}:e*(t||0)}else{let n=t=(0,p.X$)({},t);while(n.mult!=null){if(!(0,p.Gv)(n.mult)){n.mult=uU(e)?{signal:`(${n.mult}) * (${e.signal})`}:n.mult*e;return t}else{n=n.mult=(0,p.X$)({},n.mult)}}n.mult=e}return t}function KY(t,e,n,i,r,s){const a=uG(t,e),o=t.orient,u=DY(o,-1,1);let l,c,f;const d={enter:l={opacity:tG},update:f={opacity:eG},exit:c={opacity:tG}};aI(d,{stroke:a("tickColor"),strokeCap:a("tickCap"),strokeDash:a("tickDash"),strokeDashOffset:a("tickDashOffset"),strokeOpacity:a("tickOpacity"),strokeWidth:a("tickWidth")});const h=rI(r);h.mult=u;const p={scale:t.scale,field:Nj,band:s.band,extra:s.extra,offset:s.offset,round:a("tickRound")};f.y=l.y=CY(o,tG,p);f.y2=l.y2=CY(o,h);c.x=CY(o,p);f.x=l.x=FY(o,tG,p);f.x2=l.x2=FY(o,h);c.y=FY(o,p);return mG({type:rG,role:gI,key:Nj,from:i,encode:d},n)}function ZY(t,e,n,i,r){return{signal:'flush(range("'+t+'"), '+'scale("'+t+'", datum.value), '+e+","+n+","+i+","+r+")"}}function JY(t,e,n,i,r,s){const a=uG(t,e),o=t.orient,u=t.scale,l=DY(o,-1,1),c=dU(a("labelFlush")),f=dU(a("labelFlushOffset")),d=a("labelAlign"),h=a("labelBaseline");let p=c===0||!!c,m;const g=rI(r);g.mult=l;g.offset=rI(a("labelPadding")||0);g.offset.mult=l;const y={scale:u,field:Nj,band:.5,offset:pG(s.offset,a("labelOffset"))};const v=CY(o,p?ZY(u,c,'"left"','"right"','"center"'):{value:"center"},BY(o,"left","right"));const b=CY(o,SY(o,"bottom","top"),p?ZY(u,c,'"top"','"bottom"','"middle"'):{value:"middle"});const x=ZY(u,c,`-(${f})`,f,0);p=p&&f;const _={opacity:tG,x:CY(o,y,g),y:FY(o,y,g)};const w={enter:_,update:m={opacity:eG,text:{field:$j},x:_.x,y:_.y,align:v,baseline:b},exit:{opacity:tG,x:_.x,y:_.y}};aI(w,{dx:!d&&p?CY(o,x):null,dy:!h&&p?FY(o,x):null});aI(w,{angle:a("labelAngle"),fill:a("labelColor"),fillOpacity:a("labelOpacity"),font:a("labelFont"),fontSize:a("labelFontSize"),fontWeight:a("labelFontWeight"),fontStyle:a("labelFontStyle"),limit:a("labelLimit"),lineHeight:a("labelLineHeight")},{align:d,baseline:h});const A=a("labelBound");let k=a("labelOverlap");k=k||A?{separation:a("labelSeparation"),method:k,order:"datum.index",bound:A?{scale:u,orient:o,tolerance:A}:null}:undefined;if(m.align!==v){m.align=jY(m.align,v)}if(m.baseline!==b){m.baseline=jY(m.baseline,b)}return mG({type:aG,role:mI,style:Lj,key:Nj,from:i,encode:w,overlap:k},n)}function tW(t,e,n,i){const r=uG(t,e),s=t.orient,a=DY(s,-1,1);let o,u;const l={enter:o={opacity:tG,anchor:rI(r("titleAnchor",null)),align:{signal:dG}},update:u=(0,p.X$)({},o,{opacity:eG,text:rI(t.title)}),exit:{opacity:tG}};const c={signal:`lerp(range("${t.scale}"), ${fG(0,1,.5)})`};u.x=CY(s,c);u.y=FY(s,c);o.angle=CY(s,tG,UY(a,90));o.baseline=CY(s,SY(s,Mj,Aj),{value:Mj});u.angle=o.angle;u.baseline=o.baseline;aI(l,{fill:r("titleColor"),fillOpacity:r("titleOpacity"),font:r("titleFont"),fontSize:r("titleFontSize"),fontStyle:r("titleFontStyle"),fontWeight:r("titleFontWeight"),limit:r("titleLimit"),lineHeight:r("titleLineHeight")},{align:r("titleAlign"),angle:r("titleAngle"),baseline:r("titleBaseline")});eW(r,s,l,n);l.update.align=jY(l.update.align,o.align);l.update.angle=jY(l.update.angle,o.angle);l.update.baseline=jY(l.update.baseline,o.baseline);return mG({type:aG,role:yI,style:Pj,from:i,encode:l},n)}function eW(t,e,n,i){const r=(t,e)=>t!=null?(n.update[e]=jY(rI(t),n.update[e]),false):!uI(e,i)?true:false;const s=r(t("titleX"),"x"),a=r(t("titleY"),"y");n.enter.auto=a===s?rI(a):CY(e,rI(a),rI(s))}function nW(t,e){const n=WY(t,e),i=t.encode||{},r=i.axis||{},s=r.name||undefined,a=r.interactive,o=r.style,u=uG(t,n),l=hG(u);const c={scale:t.scale,ticks:!!u("ticks"),labels:!!u("labels"),grid:!!u("grid"),domain:!!u("domain"),title:t.title!=null};const f=KI(e.add(SU({},[c])));const d=KI(e.add(CU({scale:e.scaleRef(t.scale),extra:e.property(l.extra),count:e.objectProperty(t.tickCount),values:e.objectProperty(t.values),minstep:e.property(t.tickMinStep),formatType:e.property(t.formatType),formatSpecifier:e.property(t.format)})));const h=[];let p;if(c.grid){h.push(VY(t,n,i.grid,d,l))}if(c.ticks){p=u("tickSize");h.push(KY(t,n,i.ticks,d,p,l))}if(c.labels){p=c.ticks?p:0;h.push(JY(t,n,i.labels,d,p,l))}if(c.domain){h.push(XY(t,n,i.domain,f))}if(c.title){h.push(tW(t,n,i.title,f))}return oY(oG({role:dI,from:f,encode:oI(iW(u,t),r,Jj),marks:h,aria:u("aria"),description:u("description"),zindex:u("zindex"),name:s,interactive:a,style:o}),e)}function iW(t,e){const n={enter:{},update:{}};aI(n,{orient:t("orient"),offset:t("offset")||0,position:fU(e.position,0),titlePadding:t("titlePadding"),minExtent:t("minExtent"),maxExtent:t("maxExtent"),range:{signal:`abs(span(range("${e.scale}")))`},translate:t("translate"),format:e.format,formatType:e.formatType});return n}function rW(t,e,n){const i=(0,p.YO)(t.signals),r=(0,p.YO)(t.scales);if(!n)i.forEach((t=>XI(t,e)));(0,p.YO)(t.projections).forEach((t=>_j(t,e)));r.forEach((t=>ij(t,e)));(0,p.YO)(t.data).forEach((t=>wY(t,e)));r.forEach((t=>rj(t,e)));(n||i).forEach((t=>EU(t,e)));(0,p.YO)(t.axes).forEach((t=>nW(t,e)));(0,p.YO)(t.marks).forEach((t=>oY(t,e)));(0,p.YO)(t.legends).forEach((t=>lY(t,e)));if(t.title)yY(t.title,e);e.parseLambdas();return e}const sW=t=>oI({enter:{x:{value:0},y:{value:0}},update:{width:{signal:"width"},height:{signal:"height"}}},t);function aW(t,e){const n=e.config;const i=KI(e.root=e.add(QI()));const r=uW(t,n);r.forEach((t=>XI(t,e)));e.description=t.description||n.description;e.eventConfig=n.events;e.legends=e.objectProperty(n.legend&&n.legend.layout);e.locale=n.locale;const s=e.add(SU());const a=e.add($U(qI(sW(t.encode),nG,cI,t.style,e,{pulse:KI(s)})));const o=e.add(JU({layout:e.objectProperty(t.layout),legends:e.legends,autosize:e.signalRef("autosize"),mark:i,pulse:KI(a)}));e.operators.pop();e.pushState(KI(a),KI(o),null);rW(t,e,r);e.operators.push(o);let u=e.add(FU({mark:i,pulse:KI(o)}));u=e.add(VU({pulse:KI(u)}));u=e.add(KU({pulse:KI(u)}));e.addData("root",new tY(e,s,s,u));return e}function oW(t,e){return e&&e.signal?{name:t,update:e.signal}:{name:t,value:e}}function uW(t,e){const n=n=>fU(t[n],e[n]),i=[oW("background",n("background")),oW("autosize",tI(n("autosize"))),oW("padding",iI(n("padding"))),oW("width",n("width")||0),oW("height",n("height")||0)],r=i.reduce(((t,e)=>(t[e.name]=e,t)),{}),s={};(0,p.YO)(t.signals).forEach((t=>{if((0,p.mQ)(r,t.name)){t=(0,p.X$)(r[t.name],t)}else{i.push(t)}s[t.name]=t}));(0,p.YO)(e.signals).forEach((t=>{if(!(0,p.mQ)(s,t.name)&&!(0,p.mQ)(r,t.name)){i.push(t)}}));return i}function lW(t,e){this.config=t||{};this.options=e||{};this.bindings=[];this.field={};this.signals={};this.lambdas={};this.scales={};this.events={};this.data={};this.streams=[];this.updates=[];this.operators=[];this.eventConfig=null;this.locale=null;this._id=0;this._subid=0;this._nextsub=[0];this._parent=[];this._encode=[];this._lookup=[];this._markpath=[]}function cW(t){this.config=t.config;this.options=t.options;this.legends=t.legends;this.field=Object.create(t.field);this.signals=Object.create(t.signals);this.lambdas=Object.create(t.lambdas);this.scales=Object.create(t.scales);this.events=Object.create(t.events);this.data=Object.create(t.data);this.streams=[];this.updates=[];this.operators=[];this._id=0;this._subid=++t._nextsub[0];this._nextsub=t._nextsub;this._parent=t._parent.slice();this._encode=t._encode.slice();this._lookup=t._lookup.slice();this._markpath=t._markpath}lW.prototype=cW.prototype={parse(t){return rW(t,this)},fork(){return new cW(this)},isSubscope(){return this._subid>0},toRuntime(){this.finish();return{description:this.description,operators:this.operators,streams:this.streams,updates:this.updates,bindings:this.bindings,eventConfig:this.eventConfig,locale:this.locale}},id(){return(this._subid?this._subid+":":0)+this._id++},add(t){this.operators.push(t);t.id=this.id();if(t.refs){t.refs.forEach((e=>{e.$ref=t.id}));t.refs=null}return t},proxy(t){const e=t instanceof HI?KI(t):t;return this.add(XU({value:e}))},addStream(t){this.streams.push(t);t.id=this.id();return t},addUpdate(t){this.updates.push(t);return t},finish(){let t,e;if(this.root)this.root.root=true;for(t in this.signals){this.signals[t].signal=t}for(t in this.scales){this.scales[t].scale=t}function n(t,e,n){let i,r;if(t){i=t.data||(t.data={});r=i[e]||(i[e]=[]);r.push(n)}}for(t in this.data){e=this.data[t];n(e.input,t,"input");n(e.output,t,"output");n(e.values,t,"values");for(const i in e.index){n(e.index[i],t,"index:"+i)}}return this},pushState(t,e,n){this._encode.push(KI(this.add(KU({pulse:t}))));this._parent.push(e);this._lookup.push(n?KI(this.proxy(n)):null);this._markpath.push(-1)},popState(){this._encode.pop();this._parent.pop();this._lookup.pop();this._markpath.pop()},parent(){return(0,p.se)(this._parent)},encode(){return(0,p.se)(this._encode)},lookup(){return(0,p.se)(this._lookup)},markpath(){const t=this._markpath;return++t[t.length-1]},fieldRef(t,e){if((0,p.Kg)(t))return ZI(t,e);if(!t.signal){(0,p.z3)("Unsupported field reference: "+(0,p.r$)(t))}const n=t.signal;let i=this.field[n];if(!i){const t={name:this.signalRef(n)};if(e)t.as=e;this.field[n]=i=KI(this.add(TU(t)))}return i},compareRef(t){let e=false;const n=t=>uU(t)?(e=true,this.signalRef(t.signal)):lU(t)?(e=true,this.exprRef(t.expr)):t;const i=(0,p.YO)(t.field).map(n),r=(0,p.YO)(t.order).map(n);return e?KI(this.add(BU({fields:i,orders:r}))):tU(i,r)},keyRef(t,e){let n=false;const i=t=>uU(t)?(n=true,KI(r[t.signal])):t;const r=this.signals;t=(0,p.YO)(t).map(i);return n?KI(this.add(NU({fields:t,flat:e}))):eU(t,e)},sortRef(t){if(!t)return t;const e=sU(t.op,t.field),n=t.order||nU;return n.signal?KI(this.add(BU({fields:e,orders:this.signalRef(n.signal)}))):tU(e,n)},event(t,e){const n=t+":"+e;if(!this.events[n]){const i=this.id();this.streams.push({id:i,source:t,type:e});this.events[n]=i}return this.events[n]},hasOwnSignal(t){return(0,p.mQ)(this.signals,t)},addSignal(t,e){if(this.hasOwnSignal(t)){(0,p.z3)("Duplicate signal name: "+(0,p.r$)(t))}const n=e instanceof HI?e:this.add(QI(e));return this.signals[t]=n},getSignal(t){if(!this.signals[t]){(0,p.z3)("Unrecognized signal name: "+(0,p.r$)(t))}return this.signals[t]},signalRef(t){if(this.signals[t]){return KI(this.signals[t])}else if(!(0,p.mQ)(this.lambdas,t)){this.lambdas[t]=this.add(QI(null))}return KI(this.lambdas[t])},parseLambdas(){const t=Object.keys(this.lambdas);for(let e=0,n=t.length;e0?",":"")+((0,p.Gv)(e)?e.signal||fW(e):(0,p.r$)(e))}return n+"]"}function hW(t){let e="{",n=0,i,r;for(i in t){r=t[i];e+=(++n>1?",":"")+(0,p.r$)(i)+":"+((0,p.Gv)(r)?r.signal||fW(r):(0,p.r$)(r))}return e+"}"}function pW(){const t="sans-serif",e=30,n=2,i="#4c78a8",r="#000",s="#888",a="#ddd";return{description:"Vega visualization",padding:0,autosize:"pad",background:null,events:{defaults:{allow:["wheel"]}},group:null,mark:null,arc:{fill:i},area:{fill:i},image:null,line:{stroke:i,strokeWidth:n},path:{stroke:i},rect:{fill:i},rule:{stroke:r},shape:{stroke:i},symbol:{fill:i,size:64},text:{fill:r,font:t,fontSize:11},trail:{fill:i,size:n},style:{"guide-label":{fill:r,font:t,fontSize:10},"guide-title":{fill:r,font:t,fontSize:11,fontWeight:"bold"},"group-title":{fill:r,font:t,fontSize:13,fontWeight:"bold"},"group-subtitle":{fill:r,font:t,fontSize:12},point:{size:e,strokeWidth:n,shape:"circle"},circle:{size:e,strokeWidth:n},square:{size:e,strokeWidth:n,shape:"square"},cell:{fill:"transparent",stroke:a},view:{fill:"transparent"}},title:{orient:"top",anchor:"middle",offset:4,subtitlePadding:3},axis:{minExtent:0,maxExtent:200,bandPosition:.5,domain:true,domainWidth:1,domainColor:s,grid:false,gridWidth:1,gridColor:a,labels:true,labelAngle:0,labelLimit:180,labelOffset:0,labelPadding:2,ticks:true,tickColor:s,tickOffset:0,tickRound:true,tickSize:5,tickWidth:1,titlePadding:4},axisBand:{tickOffset:-.5},projection:{type:"mercator"},legend:{orient:"right",padding:0,gridAlign:"each",columnPadding:10,rowPadding:2,symbolDirection:"vertical",gradientDirection:"vertical",gradientLength:200,gradientThickness:16,gradientStrokeColor:a,gradientStrokeWidth:0,gradientLabelOffset:2,labelAlign:"left",labelBaseline:"middle",labelLimit:160,labelOffset:4,labelOverlap:true,symbolLimit:30,symbolType:"circle",symbolSize:100,symbolOffset:0,symbolStrokeWidth:1.5,symbolBaseFillColor:"transparent",symbolBaseStrokeColor:s,titleLimit:180,titleOrient:"top",titlePadding:5,layout:{offset:18,direction:"horizontal",left:{direction:"vertical"},right:{direction:"vertical"}}},range:{category:{scheme:"tableau10"},ordinal:{scheme:"blues"},heatmap:{scheme:"yellowgreenblue"},ramp:{scheme:"blues"},diverging:{scheme:"blueorange",extent:[1,0]},symbol:["circle","square","triangle-up","cross","diamond","triangle-right","triangle-down","triangle-left"]}}}function mW(t,e,n){if(!(0,p.Gv)(t)){(0,p.z3)("Input Vega specification must be an object.")}e=(0,p.io)(pW(),e,t.config);return aW(t,new lW(e,n)).toRuntime()}var gW="5.33.0";(0,p.X$)($i,i,r,s,a,o,l,u,c,f,d,h)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/7881.c5a234ce171f347c94e2.js b/.venv/share/jupyter/lab/static/7881.c5a234ce171f347c94e2.js new file mode 100644 index 0000000000000000000000000000000000000000..380c9f286428e5ec3d972be83ad70f7e7c91fa60 --- /dev/null +++ b/.venv/share/jupyter/lab/static/7881.c5a234ce171f347c94e2.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[7881],{27881:(e,t,r)=>{r.r(t);r.d(t,{liveScript:()=>p});var n=function(e,t){var r=t.next||"start";if(r){t.next=t.next;var n=s[r];if(n.splice){for(var o=0;o|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*"+o+")?))\\s*$");var x="(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))";var g={token:"string",regex:".+"};var s={start:[{token:"docComment",regex:"/\\*",next:"comment"},{token:"comment",regex:"#.*"},{token:"keyword",regex:"(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)"+x},{token:"atom",regex:"(?:true|false|yes|no|on|off|null|void|undefined)"+x},{token:"invalid",regex:"(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)"+x},{token:"className.standard",regex:"(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)"+x},{token:"variableName.function.standard",regex:"(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)"+x},{token:"variableName.standard",regex:"(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)"+x},{token:"variableName",regex:o+"\\s*:(?![:=])"},{token:"variableName",regex:o},{token:"operatorKeyword",regex:"(?:\\.{3}|\\s+\\?)"},{token:"keyword",regex:"(?:@+|::|\\.\\.)",next:"key"},{token:"operatorKeyword",regex:"\\.\\s*",next:"key"},{token:"string",regex:"\\\\\\S[^\\s,;)}\\]]*"},{token:"docString",regex:"'''",next:"qdoc"},{token:"docString",regex:'"""',next:"qqdoc"},{token:"string",regex:"'",next:"qstring"},{token:"string",regex:'"',next:"qqstring"},{token:"string",regex:"`",next:"js"},{token:"string",regex:"<\\[",next:"words"},{token:"regexp",regex:"//",next:"heregex"},{token:"regexp",regex:"\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}",next:"key"},{token:"number",regex:"(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)"},{token:"paren",regex:"[({[]"},{token:"paren",regex:"[)}\\]]",next:"key"},{token:"operatorKeyword",regex:"\\S+"},{token:"content",regex:"\\s+"}],heregex:[{token:"regexp",regex:".*?//[gimy$?]{0,4}",next:"start"},{token:"regexp",regex:"\\s*#{"},{token:"comment",regex:"\\s+(?:#.*)?"},{token:"regexp",regex:"\\S+"}],key:[{token:"operatorKeyword",regex:"[.?@!]+"},{token:"variableName",regex:o,next:"start"},{token:"content",regex:"",next:"start"}],comment:[{token:"docComment",regex:".*?\\*/",next:"start"},{token:"docComment",regex:".+"}],qdoc:[{token:"string",regex:".*?'''",next:"key"},g],qqdoc:[{token:"string",regex:'.*?"""',next:"key"},g],qstring:[{token:"string",regex:"[^\\\\']*(?:\\\\.[^\\\\']*)*'",next:"key"},g],qqstring:[{token:"string",regex:'[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',next:"key"},g],js:[{token:"string",regex:"[^\\\\`]*(?:\\\\.[^\\\\`]*)*`",next:"key"},g],words:[{token:"string",regex:".*?\\]>",next:"key"},g]};for(var i in s){var k=s[i];if(k.splice){for(var l=0,c=k.length;l{"use strict";var t=/("(?:[^\\"]|\\.)*")|[:,]/g;e.exports=function e(r,n){var i,a,o;n=n||{};i=JSON.stringify([1],undefined,n.indent===undefined?2:n.indent).slice(2,-3);a=i===""?Infinity:n.maxLength===undefined?80:n.maxLength;o=n.replacer;return function e(r,n,s){var l,c,u,f,h,p,d,v,g,m,y,b;if(r&&typeof r.toJSON==="function"){r=r.toJSON()}y=JSON.stringify(r,o);if(y===undefined){return y}d=a-n.length-s;if(y.length<=d){g=y.replace(t,(function(e,t){return t||e+" "}));if(g.length<=d){return g}}if(o!=null){r=JSON.parse(y);o=undefined}if(typeof r==="object"&&r!==null){v=n+i;u=[];c=0;if(Array.isArray(r)){m="[";l="]";d=r.length;for(;c0){return[m,i+u.join(",\n"+v),l].join("\n"+n)}}return y}(r,"",0)}},65606:e=>{var t=e.exports={};var r;var n;function i(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){r=setTimeout}else{r=i}}catch(e){r=i}try{if(typeof clearTimeout==="function"){n=clearTimeout}else{n=a}}catch(e){n=a}})();function o(e){if(r===setTimeout){return setTimeout(e,0)}if((r===i||!r)&&setTimeout){r=setTimeout;return setTimeout(e,0)}try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}function s(e){if(n===clearTimeout){return clearTimeout(e)}if((n===a||!n)&&clearTimeout){n=clearTimeout;return clearTimeout(e)}try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}var l=[];var c=false;var u;var f=-1;function h(){if(!c||!u){return}c=false;if(u.length){l=u.concat(l)}else{f=-1}if(l.length){p()}}function p(){if(c){return}var e=o(h);c=true;var t=l.length;while(t){u=l;l=[];while(++f1){for(var r=1;r{"use strict";r.r(t);r.d(t,{DEFAULT_ACTIONS:()=>Ca,default:()=>Wa,guessMode:()=>Ua,vega:()=>Ra,vegaLite:()=>Da,version:()=>Ta});var n={};r.r(n);r.d(n,{JsonPatchError:()=>b,_areEquals:()=>T,applyOperation:()=>A,applyPatch:()=>I,applyReducer:()=>N,deepClone:()=>E,getValueByPointer:()=>O,validate:()=>L,validator:()=>S});var i={};r.r(i);r.d(i,{compare:()=>B,generate:()=>M,observe:()=>_,unobserve:()=>P});var a={};r.r(a);r.d(a,{dark:()=>Le,excel:()=>Re,fivethirtyeight:()=>_e,ggplot2:()=>ze,googlecharts:()=>vt,latimes:()=>qe,powerbi:()=>Mt,quartz:()=>Ke,urbaninstitute:()=>ft,version:()=>zt,vox:()=>tt});var o=undefined&&undefined.__extends||function(){var e=function(t,r){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)if(t.hasOwnProperty(r))e[r]=t[r]};return e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}();var s=Object.prototype.hasOwnProperty;function l(e,t){return s.call(e,t)}function c(e){if(Array.isArray(e)){var t=new Array(e.length);for(var r=0;r=48&&n<=57){t++;continue}return false}return true}function h(e){if(e.indexOf("/")===-1&&e.indexOf("~")===-1)return e;return e.replace(/~/g,"~0").replace(/\//g,"~1")}function p(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function d(e,t){var r;for(var n in e){if(l(e,n)){if(e[n]===t){return h(n)+"/"}else if(typeof e[n]==="object"){r=d(e[n],t);if(r!=""){return h(n)+"/"+r}}}}return""}function v(e,t){if(e===t){return"/"}var r=d(e,t);if(r===""){throw new Error("Object not found in root")}return"/"+r}function g(e){if(e===undefined){return true}if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t0&&l[h-1]=="constructor")){throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README")}if(r){if(v===undefined){if(c[g]===undefined){v=l.slice(0,h).join("/")}else if(h==d-1){v=t.path}if(v!==undefined){m(t,0,e,v)}}}h++;if(Array.isArray(c)){if(g==="-"){g=c.length}else{if(r&&!f(g)){throw new b("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e)}else if(f(g)){g=~~g}}if(h>=d){if(r&&t.op==="add"&&g>c.length){throw new b("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e)}var o=x[t.op].call(t,c,g,e);if(o.test===false){throw new b("Test operation failed","TEST_OPERATION_FAILED",a,t,e)}return o}}else{if(h>=d){var o=w[t.op].call(t,c,g,e);if(o.test===false){throw new b("Test operation failed","TEST_OPERATION_FAILED",a,t,e)}return o}}c=c[g];if(r&&h0){throw new b('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",t,e,r)}else if((e.op==="move"||e.op==="copy")&&typeof e.from!=="string"){throw new b("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r)}else if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===undefined){throw new b("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r)}else if((e.op==="add"||e.op==="replace"||e.op==="test")&&g(e.value)){throw new b("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r)}else if(r){if(e.op=="add"){var i=e.path.split("/").length;var a=n.split("/").length;if(i!==a+1&&i!==a){throw new b("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n){throw new b("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}}else if(e.op==="move"||e.op==="copy"){var o={op:"_get",path:e.from,value:undefined};var s=L([o],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE"){throw new b("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}}function L(e,t,r){try{if(!Array.isArray(e)){throw new b("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY")}if(t){I(u(t),u(e),r||true)}else{r=r||S;for(var n=0;n0){e.patches=[];if(e.callback){e.callback(n)}}return n}function z(e,t,r,n,i){if(t===e){return}if(typeof t.toJSON==="function"){t=t.toJSON()}var a=c(t);var o=c(e);var s=false;var f=false;for(var p=o.length-1;p>=0;p--){var d=o[p];var v=e[d];if(l(t,d)&&!(t[d]===undefined&&v!==undefined&&Array.isArray(t)===false)){var g=t[d];if(typeof v=="object"&&v!=null&&typeof g=="object"&&g!=null&&Array.isArray(v)===Array.isArray(g)){z(v,g,r,n+"/"+h(d),i)}else{if(v!==g){s=true;if(i){r.push({op:"test",path:n+"/"+h(d),value:u(v)})}r.push({op:"replace",path:n+"/"+h(d),value:u(g)})}}}else if(Array.isArray(e)===Array.isArray(t)){if(i){r.push({op:"test",path:n+"/"+h(d),value:u(v)})}r.push({op:"remove",path:n+"/"+h(d)});f=true}else{if(i){r.push({op:"test",path:n,value:e})}r.push({op:"replace",path:n,value:t});s=true}}if(!f&&a.length==o.length){return}for(var p=0;pe.x2){n=e.x;e.x=e.x2;e.x2=n}e.width=e.x2-e.x}else{e.x=e.x2-(e.width||0)}}if(t.xc){e.x=e.xc-(e.width||0)/2}if(t.y2){if(t.y){if(r&&e.y>e.y2){n=e.y;e.y=e.y2;e.y2=n}e.height=e.y2-e.y}else{e.y=e.y2-(e.height||0)}}if(t.yc){e.y=e.yc-(e.height||0)/2}}var W={NaN,E:Math.E,LN2:Math.LN2,LN10:Math.LN10,LOG2E:Math.LOG2E,LOG10E:Math.LOG10E,PI:Math.PI,SQRT1_2:Math.SQRT1_2,SQRT2:Math.SQRT2,MIN_VALUE:Number.MIN_VALUE,MAX_VALUE:Number.MAX_VALUE};var H={"*":(e,t)=>e*t,"+":(e,t)=>e+t,"-":(e,t)=>e-t,"/":(e,t)=>e/t,"%":(e,t)=>e%t,">":(e,t)=>e>t,"<":(e,t)=>ee<=t,">=":(e,t)=>e>=t,"==":(e,t)=>e==t,"!=":(e,t)=>e!=t,"===":(e,t)=>e===t,"!==":(e,t)=>e!==t,"&":(e,t)=>e&t,"|":(e,t)=>e|t,"^":(e,t)=>e^t,"<<":(e,t)=>e<>":(e,t)=>e>>t,">>>":(e,t)=>e>>>t};var Y={"+":e=>+e,"-":e=>-e,"~":e=>~e,"!":e=>!e};const J=Array.prototype.slice;const q=(e,t,r)=>{const n=r?r(t[0]):t[0];return n[e].apply(n,J.call(t,1))};const Q=(e,t,r,n,i,a,o)=>new Date(e,t||0,r!=null?r:1,n||0,i||0,a||0,o||0);var Z={isNaN:Number.isNaN,isFinite:Number.isFinite,abs:Math.abs,acos:Math.acos,asin:Math.asin,atan:Math.atan,atan2:Math.atan2,ceil:Math.ceil,cos:Math.cos,exp:Math.exp,floor:Math.floor,log:Math.log,max:Math.max,min:Math.min,pow:Math.pow,random:Math.random,round:Math.round,sin:Math.sin,sqrt:Math.sqrt,tan:Math.tan,clamp:(e,t,r)=>Math.max(t,Math.min(r,e)),now:Date.now,utc:Date.UTC,datetime:Q,date:e=>new Date(e).getDate(),day:e=>new Date(e).getDay(),year:e=>new Date(e).getFullYear(),month:e=>new Date(e).getMonth(),hours:e=>new Date(e).getHours(),minutes:e=>new Date(e).getMinutes(),seconds:e=>new Date(e).getSeconds(),milliseconds:e=>new Date(e).getMilliseconds(),time:e=>new Date(e).getTime(),timezoneoffset:e=>new Date(e).getTimezoneOffset(),utcdate:e=>new Date(e).getUTCDate(),utcday:e=>new Date(e).getUTCDay(),utcyear:e=>new Date(e).getUTCFullYear(),utcmonth:e=>new Date(e).getUTCMonth(),utchours:e=>new Date(e).getUTCHours(),utcminutes:e=>new Date(e).getUTCMinutes(),utcseconds:e=>new Date(e).getUTCSeconds(),utcmilliseconds:e=>new Date(e).getUTCMilliseconds(),length:e=>e.length,join:function(){return q("join",arguments)},indexof:function(){return q("indexOf",arguments)},lastindexof:function(){return q("lastIndexOf",arguments)},slice:function(){return q("slice",arguments)},reverse:e=>e.slice().reverse(),parseFloat,parseInt,upper:e=>String(e).toUpperCase(),lower:e=>String(e).toLowerCase(),substring:function(){return q("substring",arguments,String)},split:function(){return q("split",arguments,String)},replace:function(){return q("replace",arguments,String)},trim:e=>String(e).trim(),regexp:RegExp,test:(e,t)=>RegExp(e).test(t)};const K=["view","item","group","xy","x","y"];const ee=new Set([Function,eval,setTimeout,setInterval]);if(typeof setImmediate==="function")ee.add(setImmediate);const te={Literal:(e,t)=>t.value,Identifier:(e,t)=>{const r=t.name;return e.memberDepth>0?r:r==="datum"?e.datum:r==="event"?e.event:r==="item"?e.item:W[r]||e.params["$"+r]},MemberExpression:(e,t)=>{const r=!t.computed,n=e(t.object);if(r)e.memberDepth+=1;const i=e(t.property);if(r)e.memberDepth-=1;if(ee.has(n[i])){console.error(`Prevented interpretation of member "${i}" which could lead to insecure code execution`);return}return n[i]},CallExpression:(e,t)=>{const r=t.arguments;let n=t.callee.name;if(n.startsWith("_")){n=n.slice(1)}return n==="if"?e(r[0])?e(r[1]):e(r[2]):(e.fn[n]||Z[n]).apply(e.fn,r.map(e))},ArrayExpression:(e,t)=>t.elements.map(e),BinaryExpression:(e,t)=>H[t.operator](e(t.left),e(t.right)),UnaryExpression:(e,t)=>Y[t.operator](e(t.argument)),ConditionalExpression:(e,t)=>e(t.test)?e(t.consequent):e(t.alternate),LogicalExpression:(e,t)=>t.operator==="&&"?e(t.left)&&e(t.right):e(t.left)||e(t.right),ObjectExpression:(e,t)=>t.properties.reduce(((t,r)=>{e.memberDepth+=1;const n=e(r.key);e.memberDepth-=1;if(ee.has(e(r.value))){console.error(`Prevented interpretation of property "${n}" which could lead to insecure code execution`)}else{t[n]=e(r.value)}return t}),{})};function re(e,t,r,n,i,a){const o=e=>te[e.type](o,e);o.memberDepth=0;o.fn=Object.create(t);o.params=r;o.datum=n;o.event=i;o.item=a;K.forEach((e=>o.fn[e]=function(){return i.vega[e](...arguments)}));return o(e)}var ne={operator(e,t){const r=t.ast,n=e.functions;return e=>re(r,n,e)},parameter(e,t){const r=t.ast,n=e.functions;return(e,t)=>re(r,n,t,e)},event(e,t){const r=t.ast,n=e.functions;return e=>re(r,n,undefined,undefined,e)},handler(e,t){const r=t.ast,n=e.functions;return(e,t)=>{const i=t.item&&t.item.datum;return re(r,n,e,i,t)}},encode(e,t){const{marktype:r,channels:n}=t,i=e.functions,a=r==="group"||r==="image"||r==="rect";return(e,t)=>{const o=e.datum;let s=0,l;for(const r in n){l=re(n[r].ast,i,t,o,undefined,e);if(e[r]!==l){e[r]=l;s=1}}if(r!=="rule"){$(e,n,a)}return s}}};var ie=r(17438);function ae(e){const[t,r]=/schema\/([\w-]+)\/([\w\.\-]+)\.json$/g.exec(e).slice(1,3);return{library:t,version:r}}const oe=ae;var se="vega-themes";var le="2.12.1";var ce="Themes for stylized Vega and Vega-Lite visualizations.";var ue=["vega","vega-lite","themes","style"];var fe="BSD-3-Clause";var he={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"};var pe=[{name:"Emily Gu",url:"https://github.com/emilygu"},{name:"Arvind Satyanarayan",url:"http://arvindsatya.com"},{name:"Jeffrey Heer",url:"https://idl.cs.washington.edu"},{name:"Dominik Moritz",url:"https://www.domoritz.de"}];var de="build/vega-themes.js";var ve="build/vega-themes.module.js";var ge="build/vega-themes.min.js";var me="build/vega-themes.min.js";var ye="build/vega-themes.module.d.ts";var be={type:"git",url:"https://github.com/vega/vega-themes.git"};var Ee=["src","build"];var we={prebuild:"yarn clean",build:"rollup -c",clean:"rimraf build && rimraf examples/build","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && mkdir -p examples/build && rsync -r build/* examples/build && gh-pages -d examples",preversion:"yarn lint",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",prepare:"beemo create-config",eslintbase:"beemo eslint .",format:"yarn eslintbase --fix",lint:"yarn eslintbase",release:"release-it"};var xe={"@release-it/conventional-changelog":"^5.1.1","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.1","@rollup/plugin-terser":"^0.4.0","browser-sync":"^2.27.10",concurrently:"^7.3.0","gh-pages":"^5.0.0","release-it":"^15.6.0","rollup-plugin-bundle-size":"^1.0.3","rollup-plugin-ts":"^3.0.2",rollup:"^3.15.0",typescript:"^4.7.4","vega-lite-dev-config":"^0.21.0","vega-lite":"^5.0.0",vega:"^5.19.1"};var Oe={vega:"*","vega-lite":"*"};var Ae={};var Ie={name:se,version:le,description:ce,keywords:ue,license:fe,author:he,contributors:pe,main:de,module:ve,unpkg:ge,jsdelivr:me,types:ye,repository:be,files:Ee,scripts:we,devDependencies:xe,peerDependencies:Oe,dependencies:Ae};const Ne="#fff";const Se="#888";const Le={background:"#333",view:{stroke:Se},title:{color:Ne,subtitleColor:Ne},style:{"guide-label":{fill:Ne},"guide-title":{fill:Ne}},axis:{domainColor:Ne,gridColor:Se,tickColor:Ne}};const Te="#4572a7";const Re={background:"#fff",arc:{fill:Te},area:{fill:Te},line:{stroke:Te,strokeWidth:2},path:{stroke:Te},rect:{fill:Te},shape:{stroke:Te},symbol:{fill:Te,strokeWidth:1.5,size:50},axis:{bandPosition:.5,grid:true,gridColor:"#000000",gridOpacity:1,gridWidth:.5,labelPadding:10,tickSize:5,tickWidth:.5},axisBand:{grid:false,tickExtra:true},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:50,symbolType:"square"},range:{category:["#4572a7","#aa4643","#8aa453","#71598e","#4598ae","#d98445","#94aace","#d09393","#b9cc98","#a99cbc"]}};const De="#30a2da";const ke="#cbcbcb";const Ce="#999";const Fe="#333";const je="#f0f0f0";const Pe="#333";const _e={arc:{fill:De},area:{fill:De},axis:{domainColor:ke,grid:true,gridColor:ke,gridWidth:1,labelColor:Ce,labelFontSize:10,titleColor:Fe,tickColor:ke,tickSize:10,titleFontSize:14,titlePadding:10,labelPadding:4},axisBand:{grid:false},background:je,group:{fill:je},legend:{labelColor:Pe,labelFontSize:11,padding:1,symbolSize:30,symbolType:"square",titleColor:Pe,titleFontSize:14,titlePadding:10},line:{stroke:De,strokeWidth:2},path:{stroke:De,strokeWidth:.5},rect:{fill:De},range:{category:["#30a2da","#fc4f30","#e5ae38","#6d904f","#8b8b8b","#b96db8","#ff9e27","#56cc60","#52d2ca","#52689e","#545454","#9fe4f8"],diverging:["#cc0020","#e77866","#f6e7e1","#d6e8ed","#91bfd9","#1d78b5"],heatmap:["#d6e8ed","#cee0e5","#91bfd9","#549cc6","#1d78b5"]},point:{filled:true,shape:"circle"},shape:{stroke:De},bar:{binSpacing:2,fill:De,stroke:null},title:{anchor:"start",fontSize:24,fontWeight:600,offset:20}};const Me="#000";const ze={group:{fill:"#e5e5e5"},arc:{fill:Me},area:{fill:Me},line:{stroke:Me},path:{stroke:Me},rect:{fill:Me},shape:{stroke:Me},symbol:{fill:Me,size:40},axis:{domain:false,grid:true,gridColor:"#FFFFFF",gridOpacity:1,labelColor:"#7F7F7F",labelPadding:4,tickColor:"#7F7F7F",tickSize:5.67,titleFontSize:16,titleFontWeight:"normal"},legend:{labelBaseline:"middle",labelFontSize:11,symbolSize:40},range:{category:["#000000","#7F7F7F","#1A1A1A","#999999","#333333","#B0B0B0","#4D4D4D","#C9C9C9","#666666","#DCDCDC"]}};const Be=22;const Ge="normal";const Ue="Benton Gothic, sans-serif";const Ve=11.5;const Xe="normal";const $e="#82c6df";const We="Benton Gothic Bold, sans-serif";const He="normal";const Ye=13;const Je={"category-6":["#ec8431","#829eb1","#c89d29","#3580b1","#adc839","#ab7fb4"],"fire-7":["#fbf2c7","#f9e39c","#f8d36e","#f4bb6a","#e68a4f","#d15a40","#ab4232"],"fireandice-6":["#e68a4f","#f4bb6a","#f9e39c","#dadfe2","#a6b7c6","#849eae"],"ice-7":["#edefee","#dadfe2","#c4ccd2","#a6b7c6","#849eae","#607785","#47525d"]};const qe={background:"#ffffff",title:{anchor:"start",color:"#000000",font:We,fontSize:Be,fontWeight:Ge},arc:{fill:$e},area:{fill:$e},line:{stroke:$e,strokeWidth:2},path:{stroke:$e},rect:{fill:$e},shape:{stroke:$e},symbol:{fill:$e,size:30},axis:{labelFont:Ue,labelFontSize:Ve,labelFontWeight:Xe,titleFont:We,titleFontSize:Ye,titleFontWeight:He},axisX:{labelAngle:0,labelPadding:4,tickSize:3},axisY:{labelBaseline:"middle",maxExtent:45,minExtent:45,tickSize:2,titleAlign:"left",titleAngle:0,titleX:-45,titleY:-11},legend:{labelFont:Ue,labelFontSize:Ve,symbolType:"square",titleFont:We,titleFontSize:Ye,titleFontWeight:He},range:{category:Je["category-6"],diverging:Je["fireandice-6"],heatmap:Je["fire-7"],ordinal:Je["fire-7"],ramp:Je["fire-7"]}};const Qe="#ab5787";const Ze="#979797";const Ke={background:"#f9f9f9",arc:{fill:Qe},area:{fill:Qe},line:{stroke:Qe},path:{stroke:Qe},rect:{fill:Qe},shape:{stroke:Qe},symbol:{fill:Qe,size:30},axis:{domainColor:Ze,domainWidth:.5,gridWidth:.2,labelColor:Ze,tickColor:Ze,tickWidth:.2,titleColor:Ze},axisBand:{grid:false},axisX:{grid:true,tickSize:10},axisY:{domain:false,grid:true,tickSize:0},legend:{labelFontSize:11,padding:1,symbolSize:30,symbolType:"square"},range:{category:["#ab5787","#51b2e5","#703c5c","#168dd9","#d190b6","#00609f","#d365ba","#154866","#666666","#c4c4c4"]}};const et="#3e5c69";const tt={background:"#fff",arc:{fill:et},area:{fill:et},line:{stroke:et},path:{stroke:et},rect:{fill:et},shape:{stroke:et},symbol:{fill:et},axis:{domainWidth:.5,grid:true,labelPadding:2,tickSize:5,tickWidth:.5,titleFontWeight:"normal"},axisBand:{grid:false},axisX:{gridWidth:.2},axisY:{gridDash:[3],gridWidth:.4},legend:{labelFontSize:11,padding:1,symbolType:"square"},range:{category:["#3e5c69","#6793a6","#182429","#0570b0","#3690c0","#74a9cf","#a6bddb","#e2ddf2"]}};const rt="#1696d2";const nt="#000000";const it="#FFFFFF";const at="Lato";const ot="Lato";const st="Lato";const lt="#DEDDDD";const ct=18;const ut={"main-colors":["#1696d2","#d2d2d2","#000000","#fdbf11","#ec008b","#55b748","#5c5859","#db2b27"],"shades-blue":["#CFE8F3","#A2D4EC","#73BFE2","#46ABDB","#1696D2","#12719E","#0A4C6A","#062635"],"shades-gray":["#F5F5F5","#ECECEC","#E3E3E3","#DCDBDB","#D2D2D2","#9D9D9D","#696969","#353535"],"shades-yellow":["#FFF2CF","#FCE39E","#FDD870","#FCCB41","#FDBF11","#E88E2D","#CA5800","#843215"],"shades-magenta":["#F5CBDF","#EB99C2","#E46AA7","#E54096","#EC008B","#AF1F6B","#761548","#351123"],"shades-green":["#DCEDD9","#BCDEB4","#98CF90","#78C26D","#55B748","#408941","#2C5C2D","#1A2E19"],"shades-black":["#D5D5D4","#ADABAC","#848081","#5C5859","#332D2F","#262223","#1A1717","#0E0C0D"],"shades-red":["#F8D5D4","#F1AAA9","#E9807D","#E25552","#DB2B27","#A4201D","#6E1614","#370B0A"],"one-group":["#1696d2","#000000"],"two-groups-cat-1":["#1696d2","#000000"],"two-groups-cat-2":["#1696d2","#fdbf11"],"two-groups-cat-3":["#1696d2","#db2b27"],"two-groups-seq":["#a2d4ec","#1696d2"],"three-groups-cat":["#1696d2","#fdbf11","#000000"],"three-groups-seq":["#a2d4ec","#1696d2","#0a4c6a"],"four-groups-cat-1":["#000000","#d2d2d2","#fdbf11","#1696d2"],"four-groups-cat-2":["#1696d2","#ec0008b","#fdbf11","#5c5859"],"four-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a"],"five-groups-cat-1":["#1696d2","#fdbf11","#d2d2d2","#ec008b","#000000"],"five-groups-cat-2":["#1696d2","#0a4c6a","#d2d2d2","#fdbf11","#332d2f"],"five-groups-seq":["#cfe8f3","#73bf42","#1696d2","#0a4c6a","#000000"],"six-groups-cat-1":["#1696d2","#ec008b","#fdbf11","#000000","#d2d2d2","#55b748"],"six-groups-cat-2":["#1696d2","#d2d2d2","#ec008b","#fdbf11","#332d2f","#0a4c6a"],"six-groups-seq":["#cfe8f3","#a2d4ec","#73bfe2","#46abdb","#1696d2","#12719e"],"diverging-colors":["#ca5800","#fdbf11","#fdd870","#fff2cf","#cfe8f3","#73bfe2","#1696d2","#0a4c6a"]};const ft={background:it,title:{anchor:"start",fontSize:ct,font:at},axisX:{domain:true,domainColor:nt,domainWidth:1,grid:false,labelFontSize:12,labelFont:ot,labelAngle:0,tickColor:nt,tickSize:5,titleFontSize:12,titlePadding:10,titleFont:at},axisY:{domain:false,domainWidth:1,grid:true,gridColor:lt,gridWidth:1,labelFontSize:12,labelFont:ot,labelPadding:8,ticks:false,titleFontSize:12,titlePadding:10,titleFont:at,titleAngle:0,titleY:-10,titleX:18},legend:{labelFontSize:12,labelFont:ot,symbolSize:100,titleFontSize:12,titlePadding:10,titleFont:at,orient:"right",offset:10},view:{stroke:"transparent"},range:{category:ut["six-groups-cat-1"],diverging:ut["diverging-colors"],heatmap:ut["diverging-colors"],ordinal:ut["six-groups-seq"],ramp:ut["shades-blue"]},area:{fill:rt},rect:{fill:rt},line:{color:rt,stroke:rt,strokeWidth:5},trail:{color:rt,stroke:rt,strokeWidth:0,size:1},path:{stroke:rt,strokeWidth:.5},point:{filled:true},text:{font:st,color:rt,fontSize:11,align:"center",fontWeight:400,size:11},style:{bar:{fill:rt,stroke:null}},arc:{fill:rt},shape:{stroke:rt},symbol:{fill:rt,size:30}};const ht="#3366CC";const pt="#ccc";const dt="Arial, sans-serif";const vt={arc:{fill:ht},area:{fill:ht},path:{stroke:ht},rect:{fill:ht},shape:{stroke:ht},symbol:{stroke:ht},circle:{fill:ht},background:"#fff",padding:{top:10,right:10,bottom:10,left:10},style:{"guide-label":{font:dt,fontSize:12},"guide-title":{font:dt,fontSize:12},"group-title":{font:dt,fontSize:12}},title:{font:dt,fontSize:14,fontWeight:"bold",dy:-3,anchor:"start"},axis:{gridColor:pt,tickColor:pt,domain:false,grid:true},range:{category:["#4285F4","#DB4437","#F4B400","#0F9D58","#AB47BC","#00ACC1","#FF7043","#9E9D24","#5C6BC0","#F06292","#00796B","#C2185B"],heatmap:["#c6dafc","#5e97f6","#2a56c6"]}};const gt=e=>e*(1/3+1);const mt=gt(9);const yt=gt(10);const bt=gt(12);const Et="Segoe UI";const wt="wf_standard-font, helvetica, arial, sans-serif";const xt="#252423";const Ot="#605E5C";const At="transparent";const It="#C8C6C4";const Nt="#118DFF";const St="#12239E";const Lt="#E66C37";const Tt="#6B007B";const Rt="#E044A7";const Dt="#744EC2";const kt="#D9B300";const Ct="#D64550";const Ft=Nt;const jt="#DEEFFF";const Pt=[jt,Ft];const _t=[jt,"#c7e4ff","#b0d9ff","#9aceff","#83c3ff","#6cb9ff","#55aeff","#3fa3ff","#2898ff",Ft];const Mt={view:{stroke:At},background:At,font:Et,header:{titleFont:wt,titleFontSize:bt,titleColor:xt,labelFont:Et,labelFontSize:yt,labelColor:Ot},axis:{ticks:false,grid:false,domain:false,labelColor:Ot,labelFontSize:mt,titleFont:wt,titleColor:xt,titleFontSize:bt,titleFontWeight:"normal"},axisQuantitative:{tickCount:3,grid:true,gridColor:It,gridDash:[1,5],labelFlush:false},axisBand:{tickExtra:true},axisX:{labelPadding:5},axisY:{labelPadding:10},bar:{fill:Nt},line:{stroke:Nt,strokeWidth:3,strokeCap:"round",strokeJoin:"round"},text:{font:Et,fontSize:mt,fill:Ot},arc:{fill:Nt},area:{fill:Nt,line:true,opacity:.6},path:{stroke:Nt},rect:{fill:Nt},point:{fill:Nt,filled:true,size:75},shape:{stroke:Nt},symbol:{fill:Nt,strokeWidth:1.5,size:50},legend:{titleFont:Et,titleFontWeight:"bold",titleColor:Ot,labelFont:Et,labelFontSize:yt,labelColor:Ot,symbolType:"circle",symbolSize:75},range:{category:[Nt,St,Lt,Tt,Rt,Dt,kt,Ct],diverging:Pt,heatmap:Pt,ordinal:_t}};const zt=Ie.version;var Bt=r(26372);var Gt="vega-tooltip";var Ut="0.30.1";var Vt="A tooltip plugin for Vega-Lite and Vega visualizations.";var Xt=["vega-lite","vega","tooltip"];var $t={type:"git",url:"https://github.com/vega/vega-tooltip.git"};var Wt={name:"UW Interactive Data Lab",url:"https://idl.cs.washington.edu"};var Ht=["Dominik Moritz","Sira Horradarn","Zening Qu","Kanit Wongsuphasawat","Yuri Astrakhan","Jeffrey Heer"];var Yt="BSD-3-Clause";var Jt={url:"https://github.com/vega/vega-tooltip/issues"};var qt="https://github.com/vega/vega-tooltip#readme";var Qt="build/vega-tooltip.js";var Zt="build/vega-tooltip.module.js";var Kt="build/vega-tooltip.min.js";var er="build/vega-tooltip.min.js";var tr="build/vega-tooltip.module.d.ts";var rr=["src","build","types"];var nr={prebuild:"yarn clean && yarn build:style",build:"rollup -c","build:style":"./build-style.sh",clean:"rimraf build && rimraf src/style.ts","copy:data":"rsync -r node_modules/vega-datasets/data/* examples/data","copy:build":"rsync -r build/* examples/build","deploy:gh":"yarn build && yarn copy:build && gh-pages -d examples && yarn clean",prepublishOnly:"yarn clean && yarn build",preversion:"yarn lint && yarn test",serve:"browser-sync start -s -f build examples --serveStatic examples",start:"yarn build && concurrently --kill-others -n Server,Rollup 'yarn serve' 'rollup -c -w'",pretest:"yarn build:style",test:"beemo jest","test:inspect":"node --inspect-brk ./node_modules/.bin/jest --runInBand",prepare:"beemo create-config && yarn copy:data",prettierbase:"beemo prettier '*.{css,scss,html}'",eslintbase:"beemo eslint .",format:"yarn eslintbase --fix && yarn prettierbase --write",lint:"yarn eslintbase && yarn prettierbase --check",release:"release-it"};var ir={"@release-it/conventional-changelog":"^5.1.1","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.0.1","release-it":"^15.6.0","browser-sync":"^2.27.11",concurrently:"^7.6.0","gh-pages":"^5.0.0","jest-environment-jsdom":"^29.4.2",path:"^0.12.7",rollup:"^3.15.0","rollup-plugin-bundle-size":"^1.0.3","@rollup/plugin-terser":"^0.4.0","rollup-plugin-ts":"^3.2.0",sass:"^1.58.0",typescript:"~4.9.5","vega-datasets":"^2.5.4","vega-lite-dev-config":"^0.21.0","vega-typings":"^0.22.3"};var ar={"vega-util":"^1.17.0"};var or={name:Gt,version:Ut,description:Vt,keywords:Xt,repository:$t,author:Wt,collaborators:Ht,license:Yt,bugs:Jt,homepage:qt,main:Qt,module:Zt,unpkg:Kt,jsdelivr:er,types:tr,files:rr,scripts:nr,devDependencies:ir,dependencies:ar};function sr(e,t){var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0)r[n]=e[n];if(e!=null&&typeof Object.getOwnPropertySymbols==="function")for(var i=0,n=Object.getOwnPropertySymbols(e);it((0,Bt.Kg)(e)?e:ur(e,r)))).join(", ")}]`}if((0,Bt.Gv)(e)){let n="";const i=e,{title:a,image:o}=i,s=sr(i,["title","image"]);if(a){n+=`

${t(a)}

`}if(o){n+=``}const l=Object.keys(s);if(l.length>0){n+="";for(const e of l){let i=s[e];if(i===undefined){continue}if((0,Bt.Gv)(i)){i=ur(i,r)}n+=``}n+=`
${t(e)}:${t(i)}
`}return n||"{}"}return t(e)}function cr(e){const t=[];return function(r,n){if(typeof n!=="object"||n===null){return n}const i=t.indexOf(this)+1;t.length=i;if(t.length>e){return"[Object]"}if(t.indexOf(n)>=0){return"[Circular]"}t.push(n);return n}}function ur(e,t){return JSON.stringify(e,cr(t))}var fr=`#vg-tooltip-element {\n visibility: hidden;\n padding: 8px;\n position: fixed;\n z-index: 1000;\n font-family: sans-serif;\n font-size: 11px;\n border-radius: 3px;\n box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);\n /* The default theme is the light theme. */\n background-color: rgba(255, 255, 255, 0.95);\n border: 1px solid #d9d9d9;\n color: black;\n}\n#vg-tooltip-element.visible {\n visibility: visible;\n}\n#vg-tooltip-element h2 {\n margin-top: 0;\n margin-bottom: 10px;\n font-size: 13px;\n}\n#vg-tooltip-element img {\n max-width: 200px;\n max-height: 200px;\n}\n#vg-tooltip-element table {\n border-spacing: 0;\n}\n#vg-tooltip-element table tr {\n border: none;\n}\n#vg-tooltip-element table tr td {\n overflow: hidden;\n text-overflow: ellipsis;\n padding-top: 2px;\n padding-bottom: 2px;\n}\n#vg-tooltip-element table tr td.key {\n color: #808080;\n max-width: 150px;\n text-align: right;\n padding-right: 4px;\n}\n#vg-tooltip-element table tr td.value {\n display: block;\n max-width: 300px;\n max-height: 7em;\n text-align: left;\n}\n#vg-tooltip-element.dark-theme {\n background-color: rgba(32, 32, 32, 0.9);\n border: 1px solid #f5f5f5;\n color: white;\n}\n#vg-tooltip-element.dark-theme td.key {\n color: #bfbfbf;\n}\n`;const hr="vg-tooltip-element";const pr={offsetX:10,offsetY:10,id:hr,styleId:"vega-tooltip-style",theme:"light",disableDefaultStyle:false,sanitize:dr,maxDepth:2,formatTooltip:lr};function dr(e){return String(e).replace(/&/g,"&").replace(/window.innerWidth){i=+e.clientX-r-t.width}let a=e.clientY+n;if(a+t.height>window.innerHeight){a=+e.clientY-n-t.height}return{x:i,y:a}}class mr{constructor(e){this.options=Object.assign(Object.assign({},pr),e);const t=this.options.id;this.el=null;this.call=this.tooltipHandler.bind(this);if(!this.options.disableDefaultStyle&&!document.getElementById(this.options.styleId)){const e=document.createElement("style");e.setAttribute("id",this.options.styleId);e.innerHTML=vr(t);const r=document.head;if(r.childNodes.length>0){r.insertBefore(e,r.childNodes[0])}else{r.appendChild(e)}}}tooltipHandler(e,t,r,n){var i;this.el=document.getElementById(this.options.id);if(!this.el){this.el=document.createElement("div");this.el.setAttribute("id",this.options.id);this.el.classList.add("vg-tooltip");const e=(i=document.fullscreenElement)!==null&&i!==void 0?i:document.body;e.appendChild(this.el)}if(n==null||n===""){this.el.classList.remove("visible",`${this.options.theme}-theme`);return}this.el.innerHTML=this.options.formatTooltip(n,this.options.sanitize,this.options.maxDepth);this.el.classList.add("visible",`${this.options.theme}-theme`);const{x:a,y:o}=gr(t,this.el.getBoundingClientRect(),this.options.offsetX,this.options.offsetY);this.el.style.top=`${o}px`;this.el.style.left=`${a}px`}}const yr=or.version;function br(e,t){const r=new mr(t);e.tooltip(r.call).run();return r}var Er=r(65606);function wr(e){"@babel/helpers - typeof";return wr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wr(e)}function xr(e,t){if(wr(e)!=="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==undefined){var n=r.call(e,t||"default");if(wr(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Or(e){var t=xr(e,"string");return wr(t)==="symbol"?t:String(t)}function Ar(e,t,r){t=Or(t);if(t in e){Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true})}else{e[t]=r}return e}function Ir(e,t,r,n,i,a,o){try{var s=e[a](o);var l=s.value}catch(c){r(c);return}if(s.done){t(l)}else{Promise.resolve(l).then(n,i)}}function Nr(e){return function(){var t=this,r=arguments;return new Promise((function(n,i){var a=e.apply(t,r);function o(e){Ir(a,n,i,o,s,"next",e)}function s(e){Ir(a,n,i,o,s,"throw",e)}o(undefined)}))}}var Sr=Object.prototype;var Lr=Sr.hasOwnProperty;var Tr;var Rr=typeof Symbol==="function"?Symbol:{};var Dr=Rr.iterator||"@@iterator";var kr=Rr.asyncIterator||"@@asyncIterator";var Cr=Rr.toStringTag||"@@toStringTag";function Fr(e,t,r,n){var i=t&&t.prototype instanceof Gr?t:Gr;var a=Object.create(i.prototype);var o=new an(n||[]);a._invoke=en(e,r,o);return a}function jr(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(n){return{type:"throw",arg:n}}}var Pr="suspendedStart";var _r="suspendedYield";var Mr="executing";var zr="completed";var Br={};function Gr(){}function Ur(){}function Vr(){}var Xr={};Xr[Dr]=function(){return this};var $r=Object.getPrototypeOf;var Wr=$r&&$r($r(sn([])));if(Wr&&Wr!==Sr&&Lr.call(Wr,Dr)){Xr=Wr}var Hr=Vr.prototype=Gr.prototype=Object.create(Xr);Ur.prototype=Hr.constructor=Vr;Vr.constructor=Ur;Vr[Cr]=Ur.displayName="GeneratorFunction";function Yr(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function Jr(e){var t=typeof e==="function"&&e.constructor;return t?t===Ur||(t.displayName||t.name)==="GeneratorFunction":false}function qr(e){if(Object.setPrototypeOf){Object.setPrototypeOf(e,Vr)}else{e.__proto__=Vr;if(!(Cr in e)){e[Cr]="GeneratorFunction"}}e.prototype=Object.create(Hr);return e}function Qr(e){return{__await:e}}function Zr(e,t){function r(n,i,a,o){var s=jr(e[n],e,i);if(s.type==="throw"){o(s.arg)}else{var l=s.arg;var c=l.value;if(c&&typeof c==="object"&&Lr.call(c,"__await")){return t.resolve(c.__await).then((function(e){r("next",e,a,o)}),(function(e){r("throw",e,a,o)}))}return t.resolve(c).then((function(e){l.value=e;a(l)}),(function(e){return r("throw",e,a,o)}))}}var n;function i(e,i){function a(){return new t((function(t,n){r(e,i,t,n)}))}return n=n?n.then(a,a):a()}this._invoke=i}Yr(Zr.prototype);Zr.prototype[kr]=function(){return this};function Kr(e,t,r,n,i){if(i===void 0)i=Promise;var a=new Zr(Fr(e,t,r,n),i);return Jr(t)?a:a.next().then((function(e){return e.done?e.value:a.next()}))}function en(e,t,r){var n=Pr;return function i(a,o){if(n===Mr){throw new Error("Generator is already running")}if(n===zr){if(a==="throw"){throw o}return ln()}r.method=a;r.arg=o;while(true){var s=r.delegate;if(s){var l=tn(s,r);if(l){if(l===Br)continue;return l}}if(r.method==="next"){r.sent=r._sent=r.arg}else if(r.method==="throw"){if(n===Pr){n=zr;throw r.arg}r.dispatchException(r.arg)}else if(r.method==="return"){r.abrupt("return",r.arg)}n=Mr;var c=jr(e,t,r);if(c.type==="normal"){n=r.done?zr:_r;if(c.arg===Br){continue}return{value:c.arg,done:r.done}}else if(c.type==="throw"){n=zr;r.method="throw";r.arg=c.arg}}}}function tn(e,t){var r=e.iterator[t.method];if(r===Tr){t.delegate=null;if(t.method==="throw"){if(e.iterator["return"]){t.method="return";t.arg=Tr;tn(e,t);if(t.method==="throw"){return Br}}t.method="throw";t.arg=new TypeError("The iterator does not provide a 'throw' method")}return Br}var n=jr(r,e.iterator,t.arg);if(n.type==="throw"){t.method="throw";t.arg=n.arg;t.delegate=null;return Br}var i=n.arg;if(!i){t.method="throw";t.arg=new TypeError("iterator result is not an object");t.delegate=null;return Br}if(i.done){t[e.resultName]=i.value;t.next=e.nextLoc;if(t.method!=="return"){t.method="next";t.arg=Tr}}else{return i}t.delegate=null;return Br}Yr(Hr);Hr[Cr]="Generator";Hr[Dr]=function(){return this};Hr.toString=function(){return"[object Generator]"};function rn(e){var t={tryLoc:e[0]};if(1 in e){t.catchLoc=e[1]}if(2 in e){t.finallyLoc=e[2];t.afterLoc=e[3]}this.tryEntries.push(t)}function nn(e){var t=e.completion||{};t.type="normal";delete t.arg;e.completion=t}function an(e){this.tryEntries=[{tryLoc:"root"}];e.forEach(rn,this);this.reset(true)}function on(e){var t=[];for(var r in e){t.push(r)}t.reverse();return function r(){while(t.length){var n=t.pop();if(n in e){r.value=n;r.done=false;return r}}r.done=true;return r}}function sn(e){if(e){var t=e[Dr];if(t){return t.call(e)}if(typeof e.next==="function"){return e}if(!isNaN(e.length)){var r=-1,n=function t(){while(++r=0;--i){var a=this.tryEntries[i];var o=a.completion;if(a.tryLoc==="root"){return n("end")}if(a.tryLoc<=this.prev){var s=Lr.call(a,"catchLoc");var l=Lr.call(a,"finallyLoc");if(s&&l){if(this.prev=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&Lr.call(i,"finallyLoc")&&this.prev=0;--r){var n=this.tryEntries[r];if(n.finallyLoc===t){this.complete(n.completion,n.afterLoc);nn(n);return Br}}},catch:function e(t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc===t){var i=n.completion;if(i.type==="throw"){var a=i.arg;nn(n)}return a}}throw new Error("illegal catch attempt")},delegateYield:function e(t,r,n){this.delegate={iterator:sn(t),resultName:r,nextLoc:n};if(this.method==="next"){this.arg=Tr}return Br}};var cn={wrap:Fr,isGeneratorFunction:Jr,AsyncIterator:Zr,mark:qr,awrap:Qr,async:Kr,keys:on,values:sn};var un;var fn;function hn(){if(fn)return un;fn=1;un=function e(t){t.prototype[Symbol.iterator]=cn.mark((function e(){var t;return cn.wrap((function e(r){while(1)switch(r.prev=r.next){case 0:t=this.head;case 1:if(!t){r.next=7;break}r.next=4;return t.value;case 4:t=t.next;r.next=1;break;case 7:case"end":return r.stop()}}),e,this)}))};return un}var pn=dn;dn.Node=yn;dn.create=dn;function dn(e){var t=this;if(!(t instanceof dn)){t=new dn}t.tail=null;t.head=null;t.length=0;if(e&&typeof e.forEach==="function"){e.forEach((function(e){t.push(e)}))}else if(arguments.length>0){for(var r=0,n=arguments.length;r1){r=t}else if(this.head){n=this.head.next;r=this.head.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=0;n!==null;i++){r=e(r,n.value,i);n=n.next}return r};dn.prototype.reduceReverse=function(e,t){var r;var n=this.tail;if(arguments.length>1){r=t}else if(this.tail){n=this.tail.prev;r=this.tail.value}else{throw new TypeError("Reduce of empty list with no initial value")}for(var i=this.length-1;n!==null;i--){r=e(r,n.value,i);n=n.prev}return r};dn.prototype.toArray=function(){var e=new Array(this.length);for(var t=0,r=this.head;r!==null;t++){e[t]=r.value;r=r.next}return e};dn.prototype.toArrayReverse=function(){var e=new Array(this.length);for(var t=0,r=this.tail;r!==null;t++){e[t]=r.value;r=r.prev}return e};dn.prototype.slice=function(e,t){t=t||this.length;if(t<0){t+=this.length}e=e||0;if(e<0){e+=this.length}var r=new dn;if(tthis.length){t=this.length}for(var n=0,i=this.head;i!==null&&nthis.length){t=this.length}for(var n=this.length,i=this.tail;i!==null&&n>t;n--){i=i.prev}for(;i!==null&&n>e;n--,i=i.prev){r.push(i.value)}return r};dn.prototype.splice=function(e,t){if(e>this.length){e=this.length-1}if(e<0){e=this.length+e}for(var r=0,n=this.head;n!==null&&r1;class Dn{constructor(e){if(typeof e==="number")e={max:e};if(!e)e={};if(e.max&&(typeof e.max!=="number"||e.max<0))throw new TypeError("max must be a non-negative number");this[En]=e.max||Infinity;var t=e.length||Rn;this[xn]=typeof t!=="function"?Rn:t;this[On]=e.stale||false;if(e.maxAge&&typeof e.maxAge!=="number")throw new TypeError("maxAge must be a number");this[An]=e.maxAge||0;this[In]=e.dispose;this[Nn]=e.noDisposeOnSet||false;this[Tn]=e.updateAgeOnGet||false;this.reset()}set max(e){if(typeof e!=="number"||e<0)throw new TypeError("max must be a non-negative number");this[En]=e||Infinity;Fn(this)}get max(){return this[En]}set allowStale(e){this[On]=!!e}get allowStale(){return this[On]}set maxAge(e){if(typeof e!=="number")throw new TypeError("maxAge must be a non-negative number");this[An]=e;Fn(this)}get maxAge(){return this[An]}set lengthCalculator(e){if(typeof e!=="function")e=Rn;if(e!==this[xn]){this[xn]=e;this[wn]=0;this[Sn].forEach((e=>{e.length=this[xn](e.value,e.key);this[wn]+=e.length}))}Fn(this)}get lengthCalculator(){return this[xn]}get length(){return this[wn]}get itemCount(){return this[Sn].length}rforEach(e,t){t=t||this;for(var r=this[Sn].tail;r!==null;){var n=r.prev;_n(this,e,r,t);r=n}}forEach(e,t){t=t||this;for(var r=this[Sn].head;r!==null;){var n=r.next;_n(this,e,r,t);r=n}}keys(){return this[Sn].toArray().map((e=>e.key))}values(){return this[Sn].toArray().map((e=>e.value))}reset(){if(this[In]&&this[Sn]&&this[Sn].length){this[Sn].forEach((e=>this[In](e.key,e.value)))}this[Ln]=new Map;this[Sn]=new bn;this[wn]=0}dump(){return this[Sn].map((e=>Cn(this,e)?false:{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[Sn]}set(e,t,r){r=r||this[An];if(r&&typeof r!=="number")throw new TypeError("maxAge must be a number");var n=r?Date.now():0;var i=this[xn](t,e);if(this[Ln].has(e)){if(i>this[En]){jn(this,this[Ln].get(e));return false}var a=this[Ln].get(e);var o=a.value;if(this[In]){if(!this[Nn])this[In](e,o.value)}o.now=n;o.maxAge=r;o.value=t;this[wn]+=i-o.length;o.length=i;this.get(e);Fn(this);return true}var s=new Pn(e,t,i,n,r);if(s.length>this[En]){if(this[In])this[In](e,t);return false}this[wn]+=s.length;this[Sn].unshift(s);this[Ln].set(e,this[Sn].head);Fn(this);return true}has(e){if(!this[Ln].has(e))return false;var t=this[Ln].get(e).value;return!Cn(this,t)}get(e){return kn(this,e,true)}peek(e){return kn(this,e,false)}pop(){var e=this[Sn].tail;if(!e)return null;jn(this,e);return e.value}del(e){jn(this,this[Ln].get(e))}load(e){this.reset();var t=Date.now();for(var r=e.length-1;r>=0;r--){var n=e[r];var i=n.e||0;if(i===0)this.set(n.k,n.v);else{var a=i-t;if(a>0){this.set(n.k,n.v,a)}}}}prune(){this[Ln].forEach(((e,t)=>kn(this,t,false)))}}var kn=(e,t,r)=>{var n=e[Ln].get(t);if(n){var i=n.value;if(Cn(e,i)){jn(e,n);if(!e[On])return undefined}else{if(r){if(e[Tn])n.value.now=Date.now();e[Sn].unshiftNode(n)}}return i.value}};var Cn=(e,t)=>{if(!t||!t.maxAge&&!e[An])return false;var r=Date.now()-t.now;return t.maxAge?r>t.maxAge:e[An]&&r>e[An]};var Fn=e=>{if(e[wn]>e[En]){for(var t=e[Sn].tail;e[wn]>e[En]&&t!==null;){var r=t.prev;jn(e,t);t=r}}};var jn=(e,t)=>{if(t){var r=t.value;if(e[In])e[In](r.key,r.value);e[wn]-=r.length;e[Ln].delete(r.key);e[Sn].removeNode(t)}};class Pn{constructor(e,t,r,n,i){this.key=e;this.value=t;this.length=r;this.now=n;this.maxAge=i||0}}var _n=(e,t,r,n)=>{var i=r.value;if(Cn(e,i)){jn(e,r);if(!e[On])i=undefined}if(i)t.call(n,i.value,i.key,e)};var Mn=Dn;var zn=["includePrerelease","loose","rtl"];var Bn=e=>!e?{}:typeof e!=="object"?{loose:true}:zn.filter((t=>e[t])).reduce(((e,t)=>{e[t]=true;return e}),{});var Gn=Bn;var Un={};var Vn={get exports(){return Un},set exports(e){Un=e}};var Xn="2.0.0";var $n=256;var Wn=Number.MAX_SAFE_INTEGER||9007199254740991;var Hn=16;var Yn={SEMVER_SPEC_VERSION:Xn,MAX_LENGTH:$n,MAX_SAFE_INTEGER:Wn,MAX_SAFE_COMPONENT_LENGTH:Hn};var Jn=typeof Er==="object"&&Er.env&&Er.env.NODE_DEBUG&&/\bsemver\b/i.test(Er.env.NODE_DEBUG)?function(){for(var e=arguments.length,t=new Array(e),r=0;r{};var qn=Jn;(function(e,t){var r=Yn.MAX_SAFE_COMPONENT_LENGTH;var n=qn;t=e.exports={};var i=t.re=[];var a=t.src=[];var o=t.t={};var s=0;var l=(e,t,r)=>{var l=s++;n(e,l,t);o[e]=l;a[l]=t;i[l]=new RegExp(t,r?"g":undefined)};l("NUMERICIDENTIFIER","0|[1-9]\\d*");l("NUMERICIDENTIFIERLOOSE","[0-9]+");l("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*");l("MAINVERSION","(".concat(a[o.NUMERICIDENTIFIER],")\\.")+"(".concat(a[o.NUMERICIDENTIFIER],")\\.")+"(".concat(a[o.NUMERICIDENTIFIER],")"));l("MAINVERSIONLOOSE","(".concat(a[o.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(a[o.NUMERICIDENTIFIERLOOSE],")\\.")+"(".concat(a[o.NUMERICIDENTIFIERLOOSE],")"));l("PRERELEASEIDENTIFIER","(?:".concat(a[o.NUMERICIDENTIFIER],"|").concat(a[o.NONNUMERICIDENTIFIER],")"));l("PRERELEASEIDENTIFIERLOOSE","(?:".concat(a[o.NUMERICIDENTIFIERLOOSE],"|").concat(a[o.NONNUMERICIDENTIFIER],")"));l("PRERELEASE","(?:-(".concat(a[o.PRERELEASEIDENTIFIER],"(?:\\.").concat(a[o.PRERELEASEIDENTIFIER],")*))"));l("PRERELEASELOOSE","(?:-?(".concat(a[o.PRERELEASEIDENTIFIERLOOSE],"(?:\\.").concat(a[o.PRERELEASEIDENTIFIERLOOSE],")*))"));l("BUILDIDENTIFIER","[0-9A-Za-z-]+");l("BUILD","(?:\\+(".concat(a[o.BUILDIDENTIFIER],"(?:\\.").concat(a[o.BUILDIDENTIFIER],")*))"));l("FULLPLAIN","v?".concat(a[o.MAINVERSION]).concat(a[o.PRERELEASE],"?").concat(a[o.BUILD],"?"));l("FULL","^".concat(a[o.FULLPLAIN],"$"));l("LOOSEPLAIN","[v=\\s]*".concat(a[o.MAINVERSIONLOOSE]).concat(a[o.PRERELEASELOOSE],"?").concat(a[o.BUILD],"?"));l("LOOSE","^".concat(a[o.LOOSEPLAIN],"$"));l("GTLT","((?:<|>)?=?)");l("XRANGEIDENTIFIERLOOSE","".concat(a[o.NUMERICIDENTIFIERLOOSE],"|x|X|\\*"));l("XRANGEIDENTIFIER","".concat(a[o.NUMERICIDENTIFIER],"|x|X|\\*"));l("XRANGEPLAIN","[v=\\s]*(".concat(a[o.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[o.XRANGEIDENTIFIER],")")+"(?:\\.(".concat(a[o.XRANGEIDENTIFIER],")")+"(?:".concat(a[o.PRERELEASE],")?").concat(a[o.BUILD],"?")+")?)?");l("XRANGEPLAINLOOSE","[v=\\s]*(".concat(a[o.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[o.XRANGEIDENTIFIERLOOSE],")")+"(?:\\.(".concat(a[o.XRANGEIDENTIFIERLOOSE],")")+"(?:".concat(a[o.PRERELEASELOOSE],")?").concat(a[o.BUILD],"?")+")?)?");l("XRANGE","^".concat(a[o.GTLT],"\\s*").concat(a[o.XRANGEPLAIN],"$"));l("XRANGELOOSE","^".concat(a[o.GTLT],"\\s*").concat(a[o.XRANGEPLAINLOOSE],"$"));l("COERCE","".concat("(^|[^\\d])"+"(\\d{1,").concat(r,"})")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:\\.(\\d{1,".concat(r,"}))?")+"(?:$|[^\\d])");l("COERCERTL",a[o.COERCE],true);l("LONETILDE","(?:~>?)");l("TILDETRIM","(\\s*)".concat(a[o.LONETILDE],"\\s+"),true);t.tildeTrimReplace="$1~";l("TILDE","^".concat(a[o.LONETILDE]).concat(a[o.XRANGEPLAIN],"$"));l("TILDELOOSE","^".concat(a[o.LONETILDE]).concat(a[o.XRANGEPLAINLOOSE],"$"));l("LONECARET","(?:\\^)");l("CARETTRIM","(\\s*)".concat(a[o.LONECARET],"\\s+"),true);t.caretTrimReplace="$1^";l("CARET","^".concat(a[o.LONECARET]).concat(a[o.XRANGEPLAIN],"$"));l("CARETLOOSE","^".concat(a[o.LONECARET]).concat(a[o.XRANGEPLAINLOOSE],"$"));l("COMPARATORLOOSE","^".concat(a[o.GTLT],"\\s*(").concat(a[o.LOOSEPLAIN],")$|^$"));l("COMPARATOR","^".concat(a[o.GTLT],"\\s*(").concat(a[o.FULLPLAIN],")$|^$"));l("COMPARATORTRIM","(\\s*)".concat(a[o.GTLT],"\\s*(").concat(a[o.LOOSEPLAIN],"|").concat(a[o.XRANGEPLAIN],")"),true);t.comparatorTrimReplace="$1$2$3";l("HYPHENRANGE","^\\s*(".concat(a[o.XRANGEPLAIN],")")+"\\s+-\\s+"+"(".concat(a[o.XRANGEPLAIN],")")+"\\s*$");l("HYPHENRANGELOOSE","^\\s*(".concat(a[o.XRANGEPLAINLOOSE],")")+"\\s+-\\s+"+"(".concat(a[o.XRANGEPLAINLOOSE],")")+"\\s*$");l("STAR","(<|>)?=?\\s*\\*");l("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");l("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Vn,Un);var Qn=/^[0-9]+$/;var Zn=(e,t)=>{var r=Qn.test(e);var n=Qn.test(t);if(r&&n){e=+e;t=+t}return e===t?0:r&&!n?-1:n&&!r?1:eZn(t,e);var ei={compareIdentifiers:Zn,rcompareIdentifiers:Kn};var ti=qn;var ri=Yn.MAX_LENGTH,ni=Yn.MAX_SAFE_INTEGER;var ii=Un.re,ai=Un.t;var oi=Gn;var si=ei.compareIdentifiers;let li=class e{constructor(t,r){r=oi(r);if(t instanceof e){if(t.loose===!!r.loose&&t.includePrerelease===!!r.includePrerelease){return t}else{t=t.version}}else if(typeof t!=="string"){throw new TypeError("Invalid Version: ".concat(t))}if(t.length>ri){throw new TypeError("version is longer than ".concat(ri," characters"))}ti("SemVer",t,r);this.options=r;this.loose=!!r.loose;this.includePrerelease=!!r.includePrerelease;var n=t.trim().match(r.loose?ii[ai.LOOSE]:ii[ai.FULL]);if(!n){throw new TypeError("Invalid Version: ".concat(t))}this.raw=t;this.major=+n[1];this.minor=+n[2];this.patch=+n[3];if(this.major>ni||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>ni||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>ni||this.patch<0){throw new TypeError("Invalid patch version")}if(!n[4]){this.prerelease=[]}else{this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){var t=+e;if(t>=0&&t=0){if(typeof this.prerelease[r]==="number"){this.prerelease[r]++;r=-2}}if(r===-1){this.prerelease.push(0)}}if(t){if(si(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1])){this.prerelease=[t,0]}}else{this.prerelease=[t,0]}}break;default:throw new Error("invalid increment argument: ".concat(e))}this.format();this.raw=this.version;return this}};var ci=li;var ui=ci;var fi=(e,t,r)=>new ui(e,r).compare(new ui(t,r));var hi=fi;var pi=hi;var di=(e,t,r)=>pi(e,t,r)===0;var vi=di;var gi=hi;var mi=(e,t,r)=>gi(e,t,r)!==0;var yi=mi;var bi=hi;var Ei=(e,t,r)=>bi(e,t,r)>0;var wi=Ei;var xi=hi;var Oi=(e,t,r)=>xi(e,t,r)>=0;var Ai=Oi;var Ii=hi;var Ni=(e,t,r)=>Ii(e,t,r)<0;var Si=Ni;var Li=hi;var Ti=(e,t,r)=>Li(e,t,r)<=0;var Ri=Ti;var Di=vi;var ki=yi;var Ci=wi;var Fi=Ai;var ji=Si;var Pi=Ri;var _i=(e,t,r,n)=>{switch(t){case"===":if(typeof e==="object"){e=e.version}if(typeof r==="object"){r=r.version}return e===r;case"!==":if(typeof e==="object"){e=e.version}if(typeof r==="object"){r=r.version}return e!==r;case"":case"=":case"==":return Di(e,r,n);case"!=":return ki(e,r,n);case">":return Ci(e,r,n);case">=":return Fi(e,r,n);case"<":return ji(e,r,n);case"<=":return Pi(e,r,n);default:throw new TypeError("Invalid operator: ".concat(t))}};var Mi=_i;var zi;var Bi;function Gi(){if(Bi)return zi;Bi=1;var e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(n,i){i=r(i);if(n instanceof t){if(n.loose===!!i.loose){return n}else{n=n.value}}o("comparator",n,i);this.options=i;this.loose=!!i.loose;this.parse(n);if(this.semver===e){this.value=""}else{this.value=this.operator+this.semver.version}o("comp",this)}parse(t){var r=this.options.loose?n[i.COMPARATORLOOSE]:n[i.COMPARATOR];var a=t.match(r);if(!a){throw new TypeError("Invalid comparator: ".concat(t))}this.operator=a[1]!==undefined?a[1]:"";if(this.operator==="="){this.operator=""}if(!a[2]){this.semver=e}else{this.semver=new s(a[2],this.options.loose)}}toString(){return this.value}test(t){o("Comparator.test",t,this.options.loose);if(this.semver===e||t===e){return true}if(typeof t==="string"){try{t=new s(t,this.options)}catch(Ka){return false}}return a(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t)){throw new TypeError("a Comparator is required")}if(!r||typeof r!=="object"){r={loose:!!r,includePrerelease:false}}if(this.operator===""){if(this.value===""){return true}return new l(e.value,r).test(this.value)}else if(e.operator===""){if(e.value===""){return true}return new l(this.value,r).test(e.semver)}var n=(this.operator===">="||this.operator===">")&&(e.operator===">="||e.operator===">");var i=(this.operator==="<="||this.operator==="<")&&(e.operator==="<="||e.operator==="<");var o=this.semver.version===e.semver.version;var s=(this.operator===">="||this.operator==="<=")&&(e.operator===">="||e.operator==="<=");var c=a(this.semver,"<",e.semver,r)&&(this.operator===">="||this.operator===">")&&(e.operator==="<="||e.operator==="<");var u=a(this.semver,">",e.semver,r)&&(this.operator==="<="||this.operator==="<")&&(e.operator===">="||e.operator===">");return n||i||o&&s||c||u}}zi=t;var r=Gn;var n=Un.re,i=Un.t;var a=Mi;var o=qn;var s=ci;var l=Hi();return zi}function Ui(e,t){var r=typeof Symbol!=="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=Vi(e))||t&&e&&typeof e.length==="number"){if(r)e=r;var n=0;var i=function e(){};return{s:i,n:function t(){if(n>=e.length)return{done:true};return{done:false,value:e[n++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a=true,o=false,s;return{s:function t(){r=r.call(e)},n:function e(){var t=r.next();a=t.done;return t},e:function e(t){o=true;s=t},f:function e(){try{if(!a&&r.return!=null)r.return()}finally{if(o)throw s}}}}function Vi(e,t){if(!e)return;if(typeof e==="string")return Xi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xi(e,t)}function Xi(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);rthis.parseRange(e.trim()))).filter((e=>e.length));if(!this.set.length){throw new TypeError("Invalid SemVer Range: ".concat(t))}if(this.set.length>1){var a=this.set[0];this.set=this.set.filter((e=>!h(e[0])));if(this.set.length===0){this.set=[a]}else if(this.set.length>1){var o=Ui(this.set),s;try{for(o.s();!(s=o.n()).done;){var l=s.value;if(l.length===1&&p(l[0])){this.set=[l];break}}}catch(c){o.e(c)}finally{o.f()}}}this.format()}format(){this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim();return this.range}toString(){return this.range}parseRange(e){e=e.trim();var t=Object.keys(this.options).join(",");var n="parseRange:".concat(t,":").concat(e);var o=r.get(n);if(o){return o}var p=this.options.loose;var d=p?s[l.HYPHENRANGELOOSE]:s[l.HYPHENRANGE];e=e.replace(d,I(this.options.includePrerelease));a("hyphen replace",e);e=e.replace(s[l.COMPARATORTRIM],c);a("comparator trim",e);e=e.replace(s[l.TILDETRIM],u);e=e.replace(s[l.CARETTRIM],f);e=e.split(/\s+/).join(" ");var g=e.split(" ").map((e=>v(e,this.options))).join(" ").split(/\s+/).map((e=>A(e,this.options)));if(p){g=g.filter((e=>{a("loose invalid filter",e,this.options);return!!e.match(s[l.COMPARATORLOOSE])}))}a("range list",g);var m=new Map;var y=g.map((e=>new i(e,this.options)));var b=Ui(y),E;try{for(b.s();!(E=b.n()).done;){var w=E.value;if(h(w)){return[w]}m.set(w.value,w)}}catch(O){b.e(O)}finally{b.f()}if(m.size>1&&m.has("")){m.delete("")}var x=[...m.values()];r.set(n,x);return x}intersects(t,r){if(!(t instanceof e)){throw new TypeError("a Range is required")}return this.set.some((e=>d(e,r)&&t.set.some((t=>d(t,r)&&e.every((e=>t.every((t=>e.intersects(t,r)))))))))}test(e){if(!e){return false}if(typeof e==="string"){try{e=new o(e,this.options)}catch(Ka){return false}}for(var t=0;te.value==="<0.0.0-0";var p=e=>e.value==="";var d=(e,t)=>{var r=true;var n=e.slice();var i=n.pop();while(r&&n.length){r=n.every((e=>i.intersects(e,t)));i=n.pop()}return r};var v=(e,t)=>{a("comp",e,t);e=b(e,t);a("caret",e);e=m(e,t);a("tildes",e);e=w(e,t);a("xrange",e);e=O(e,t);a("stars",e);return e};var g=e=>!e||e.toLowerCase()==="x"||e==="*";var m=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" ");var y=(e,t)=>{var r=t.loose?s[l.TILDELOOSE]:s[l.TILDE];return e.replace(r,((t,r,n,i,o)=>{a("tilde",e,t,r,n,i,o);var s;if(g(r)){s=""}else if(g(n)){s=">=".concat(r,".0.0 <").concat(+r+1,".0.0-0")}else if(g(i)){s=">=".concat(r,".").concat(n,".0 <").concat(r,".").concat(+n+1,".0-0")}else if(o){a("replaceTilde pr",o);s=">=".concat(r,".").concat(n,".").concat(i,"-").concat(o," <").concat(r,".").concat(+n+1,".0-0")}else{s=">=".concat(r,".").concat(n,".").concat(i," <").concat(r,".").concat(+n+1,".0-0")}a("tilde return",s);return s}))};var b=(e,t)=>e.trim().split(/\s+/).map((e=>E(e,t))).join(" ");var E=(e,t)=>{a("caret",e,t);var r=t.loose?s[l.CARETLOOSE]:s[l.CARET];var n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,o,s)=>{a("caret",e,t,r,i,o,s);var l;if(g(r)){l=""}else if(g(i)){l=">=".concat(r,".0.0").concat(n," <").concat(+r+1,".0.0-0")}else if(g(o)){if(r==="0"){l=">=".concat(r,".").concat(i,".0").concat(n," <").concat(r,".").concat(+i+1,".0-0")}else{l=">=".concat(r,".").concat(i,".0").concat(n," <").concat(+r+1,".0.0-0")}}else if(s){a("replaceCaret pr",s);if(r==="0"){if(i==="0"){l=">=".concat(r,".").concat(i,".").concat(o,"-").concat(s," <").concat(r,".").concat(i,".").concat(+o+1,"-0")}else{l=">=".concat(r,".").concat(i,".").concat(o,"-").concat(s," <").concat(r,".").concat(+i+1,".0-0")}}else{l=">=".concat(r,".").concat(i,".").concat(o,"-").concat(s," <").concat(+r+1,".0.0-0")}}else{a("no pr");if(r==="0"){if(i==="0"){l=">=".concat(r,".").concat(i,".").concat(o).concat(n," <").concat(r,".").concat(i,".").concat(+o+1,"-0")}else{l=">=".concat(r,".").concat(i,".").concat(o).concat(n," <").concat(r,".").concat(+i+1,".0-0")}}else{l=">=".concat(r,".").concat(i,".").concat(o," <").concat(+r+1,".0.0-0")}}a("caret return",l);return l}))};var w=(e,t)=>{a("replaceXRanges",e,t);return e.split(/\s+/).map((e=>x(e,t))).join(" ")};var x=(e,t)=>{e=e.trim();var r=t.loose?s[l.XRANGELOOSE]:s[l.XRANGE];return e.replace(r,((r,n,i,o,s,l)=>{a("xRange",e,r,n,i,o,s,l);var c=g(i);var u=c||g(o);var f=u||g(s);var h=f;if(n==="="&&h){n=""}l=t.includePrerelease?"-0":"";if(c){if(n===">"||n==="<"){r="<0.0.0-0"}else{r="*"}}else if(n&&h){if(u){o=0}s=0;if(n===">"){n=">=";if(u){i=+i+1;o=0;s=0}else{o=+o+1;s=0}}else if(n==="<="){n="<";if(u){i=+i+1}else{o=+o+1}}if(n==="<"){l="-0"}r="".concat(n+i,".").concat(o,".").concat(s).concat(l)}else if(u){r=">=".concat(i,".0.0").concat(l," <").concat(+i+1,".0.0-0")}else if(f){r=">=".concat(i,".").concat(o,".0").concat(l," <").concat(i,".").concat(+o+1,".0-0")}a("xRange return",r);return r}))};var O=(e,t)=>{a("replaceStars",e,t);return e.trim().replace(s[l.STAR],"")};var A=(e,t)=>{a("replaceGTE0",e,t);return e.trim().replace(s[t.includePrerelease?l.GTE0PRE:l.GTE0],"")};var I=e=>(t,r,n,i,a,o,s,l,c,u,f,h,p)=>{if(g(n)){r=""}else if(g(i)){r=">=".concat(n,".0.0").concat(e?"-0":"")}else if(g(a)){r=">=".concat(n,".").concat(i,".0").concat(e?"-0":"")}else if(o){r=">=".concat(r)}else{r=">=".concat(r).concat(e?"-0":"")}if(g(c)){l=""}else if(g(u)){l="<".concat(+c+1,".0.0-0")}else if(g(f)){l="<".concat(c,".").concat(+u+1,".0-0")}else if(h){l="<=".concat(c,".").concat(u,".").concat(f,"-").concat(h)}else if(e){l="<".concat(c,".").concat(u,".").concat(+f+1,"-0")}else{l="<=".concat(l)}return"".concat(r," ").concat(l).trim()};var N=(e,t,r)=>{for(var n=0;n0){var s=e[o].semver;if(s.major===t.major&&s.minor===t.minor&&s.patch===t.patch){return true}}}return false}return true};return $i}var Yi=Hi();var Ji=(e,t,r)=>{try{t=new Yi(t,r)}catch(Ka){return false}return t.test(e)};var qi=Ji;function Qi(e,t,r){var n=e.open(t);var i=1e4;var a=250;var o=new URL(t),s=o.origin;var l=~~(i/a);function c(t){if(t.source===n){l=0;e.removeEventListener("message",c,false)}}e.addEventListener("message",c,false);function u(){if(l<=0){return}n.postMessage(r,s);setTimeout(u,a);l-=1}setTimeout(u,a)}var Zi='.vega-embed {\n position: relative;\n display: inline-block;\n box-sizing: border-box;\n}\n.vega-embed.has-actions {\n padding-right: 38px;\n}\n.vega-embed details:not([open]) > :not(summary) {\n display: none !important;\n}\n.vega-embed summary {\n list-style: none;\n position: absolute;\n top: 0;\n right: 0;\n padding: 6px;\n z-index: 1000;\n background: white;\n box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1);\n color: #1b1e23;\n border: 1px solid #aaa;\n border-radius: 999px;\n opacity: 0.2;\n transition: opacity 0.4s ease-in;\n cursor: pointer;\n line-height: 0px;\n}\n.vega-embed summary::-webkit-details-marker {\n display: none;\n}\n.vega-embed summary:active {\n box-shadow: #aaa 0px 0px 0px 1px inset;\n}\n.vega-embed summary svg {\n width: 14px;\n height: 14px;\n}\n.vega-embed details[open] summary {\n opacity: 0.7;\n}\n.vega-embed:hover summary, .vega-embed:focus-within summary {\n opacity: 1 !important;\n transition: opacity 0.2s ease;\n}\n.vega-embed .vega-actions {\n position: absolute;\n z-index: 1001;\n top: 35px;\n right: -9px;\n display: flex;\n flex-direction: column;\n padding-bottom: 8px;\n padding-top: 8px;\n border-radius: 4px;\n box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.2);\n border: 1px solid #d9d9d9;\n background: white;\n animation-duration: 0.15s;\n animation-name: scale-in;\n animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);\n text-align: left;\n}\n.vega-embed .vega-actions a {\n padding: 8px 16px;\n font-family: sans-serif;\n font-size: 14px;\n font-weight: 600;\n white-space: nowrap;\n color: #434a56;\n text-decoration: none;\n}\n.vega-embed .vega-actions a:hover, .vega-embed .vega-actions a:focus {\n background-color: #f7f7f9;\n color: black;\n}\n.vega-embed .vega-actions::before, .vega-embed .vega-actions::after {\n content: "";\n display: inline-block;\n position: absolute;\n}\n.vega-embed .vega-actions::before {\n left: auto;\n right: 14px;\n top: -16px;\n border: 8px solid rgba(0, 0, 0, 0);\n border-bottom-color: #d9d9d9;\n}\n.vega-embed .vega-actions::after {\n left: auto;\n right: 15px;\n top: -14px;\n border: 7px solid rgba(0, 0, 0, 0);\n border-bottom-color: #fff;\n}\n.vega-embed .chart-wrapper.fit-x {\n width: 100%;\n}\n.vega-embed .chart-wrapper.fit-y {\n height: 100%;\n}\n\n.vega-embed-wrapper {\n max-width: 100%;\n overflow: auto;\n padding-right: 14px;\n}\n\n@keyframes scale-in {\n from {\n opacity: 0;\n transform: scale(0.6);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n}\n';if(!String.prototype.startsWith){String.prototype.startsWith=function(e,t){return this.substr(!t||t<0?0:+t,e.length)===e}}function Ki(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n=e.length)return{done:true};return{done:false,value:e[n++]}},e:function e(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a=true,o=false,s;return{s:function t(){r=r.call(e)},n:function e(){var t=r.next();a=t.done;return t},e:function e(t){o=true;s=t},f:function e(){try{if(!a&&r.return!=null)r.return()}finally{if(o)throw s}}}}function Ia(e,t){if(!e)return;if(typeof e==="string")return Na(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor)r=e.constructor.name;if(r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Na(e,t)}function Na(e,t){if(t==null||t>e.length)t=e.length;for(var r=0,n=new Array(t);re,"vega-lite":(e,t)=>Da.compile(e,{config:t}).spec};var Ma='\n\n \n \n \n';var za="chart-wrapper";function Ba(e){return typeof e==="function"}function Ga(e,t,r,n){var i="".concat(t,'
');var a="
".concat(r,"");var o=window.open("");o.document.write(i+e+a);o.document.title="".concat(ja[n]," JSON Source")}function Ua(e,t){if(e.$schema){var r=oe(e.$schema);if(t&&t!==r.library){var n;console.warn("The given visualization spec is written in ".concat(ja[r.library],", but mode argument sets ").concat((n=ja[t])!==null&&n!==void 0?n:t,"."))}var i=r.library;if(!qi(Pa[i],"^".concat(r.version.slice(1)))){console.warn("The input spec uses ".concat(ja[i]," ").concat(r.version,", but the current version of ").concat(ja[i]," is v").concat(Pa[i],"."))}return i}if("mark"in e||"encoding"in e||"layer"in e||"hconcat"in e||"vconcat"in e||"facet"in e||"repeat"in e){return"vega-lite"}if("marks"in e||"signals"in e||"scales"in e||"axes"in e){return"vega"}return t!==null&&t!==void 0?t:"vega"}function Va(e){return!!(e&&"load"in e)}function Xa(e){return Va(e)?e:Ra.loader(e)}function $a(e){var t,r;var n=(t=(r=e.usermeta)===null||r===void 0?void 0:r.embedOptions)!==null&&t!==void 0?t:{};if((0,X.isString)(n.defaultStyle)){n.defaultStyle=false}return n}function Wa(e,t){return Ha.apply(this,arguments)}function Ha(){Ha=Nr(cn.mark((function e(t,r){var n,i;var a,o,s,l,c,u,f,h,p,d=arguments;return cn.wrap((function e(v){while(1)switch(v.prev=v.next){case 0:a=d.length>2&&d[2]!==undefined?d[2]:{};if(!(0,X.isString)(r)){v.next=10;break}s=Xa(a.loader);v.t0=JSON;v.next=6;return s.load(r);case 6:v.t1=v.sent;o=v.t0.parse.call(v.t0,v.t1);v.next=11;break;case 10:o=r;case 11:l=$a(o);c=l.loader;if(!s||c){s=Xa((u=a.loader)!==null&&u!==void 0?u:c)}v.next=16;return Ya(l,s);case 16:f=v.sent;v.next=19;return Ya(a,s);case 19:h=v.sent;p=La(La({},Ki(h,f)),{},{config:(0,X.mergeConfig)((n=h.config)!==null&&n!==void 0?n:{},(i=f.config)!==null&&i!==void 0?i:{})});v.next=23;return Qa(t,o,p,s);case 23:return v.abrupt("return",v.sent);case 24:case"end":return v.stop()}}),e)})));return Ha.apply(this,arguments)}function Ya(e,t){return Ja.apply(this,arguments)}function Ja(){Ja=Nr(cn.mark((function e(t,r){var n;var i,a;return cn.wrap((function e(o){while(1)switch(o.prev=o.next){case 0:if(!(0,X.isString)(t.config)){o.next=8;break}o.t1=JSON;o.next=4;return r.load(t.config);case 4:o.t2=o.sent;o.t0=o.t1.parse.call(o.t1,o.t2);o.next=9;break;case 8:o.t0=(n=t.config)!==null&&n!==void 0?n:{};case 9:i=o.t0;if(!(0,X.isString)(t.patch)){o.next=18;break}o.t4=JSON;o.next=14;return r.load(t.patch);case 14:o.t5=o.sent;o.t3=o.t4.parse.call(o.t4,o.t5);o.next=19;break;case 18:o.t3=t.patch;case 19:a=o.t3;return o.abrupt("return",La(La(La({},t),a?{patch:a}:{}),i?{config:i}:{}));case 21:case"end":return o.stop()}}),e)})));return Ja.apply(this,arguments)}function qa(e){var t;var r=e.getRootNode?e.getRootNode():document;return r instanceof ShadowRoot?{root:r,rootContainer:r}:{root:document,rootContainer:(t=document.head)!==null&&t!==void 0?t:document.body}}function Qa(e,t){return Za.apply(this,arguments)}function Za(){Za=Nr(cn.mark((function e(t,r){var n,i,o,s,l,c,u;var f,h,p,d,v,g,m,y,b,E,w,x,O,A,N,S,L,T,R,D,k,C,F,j,P,_,M,z,B,G,U,$,W,H,Y,J,q,Q,Z,K,ee,te,re,ie,ae=arguments;return cn.wrap((function e(se){while(1)switch(se.prev=se.next){case 0:ie=function e(){if(U){document.removeEventListener("click",U)}P.finalize()};f=ae.length>2&&ae[2]!==undefined?ae[2]:{};h=ae.length>3?ae[3]:undefined;p=f.theme?(0,X.mergeConfig)(a[f.theme],(n=f.config)!==null&&n!==void 0?n:{}):f.config;d=(0,X.isBoolean)(f.actions)?f.actions:Ki({},Ca,(i=f.actions)!==null&&i!==void 0?i:{});v=La(La({},Fa),f.i18n);g=(o=f.renderer)!==null&&o!==void 0?o:"canvas";m=(s=f.logLevel)!==null&&s!==void 0?s:Ra.Warn;y=(l=f.downloadFileName)!==null&&l!==void 0?l:"visualization";b=typeof t==="string"?document.querySelector(t):t;if(b){se.next=12;break}throw new Error("".concat(t," does not exist"));case 12:if(f.defaultStyle!==false){E="vega-embed-style";w=qa(b),x=w.root,O=w.rootContainer;if(!x.getElementById(E)){A=document.createElement("style");A.id=E;A.innerHTML=f.defaultStyle===undefined||f.defaultStyle===true?Zi.toString():f.defaultStyle;O.appendChild(A)}}N=Ua(r,f.mode);S=_a[N](r,p);if(N==="vega-lite"){if(S.$schema){L=oe(S.$schema);if(!qi(Pa.vega,"^".concat(L.version.slice(1)))){console.warn("The compiled spec uses Vega ".concat(L.version,", but current version is v").concat(Pa.vega,"."))}}}b.classList.add("vega-embed");if(d){b.classList.add("has-actions")}b.innerHTML="";T=b;if(d){R=document.createElement("div");R.classList.add(za);b.appendChild(R);T=R}D=f.patch;if(D){S=D instanceof Function?D(S):I(S,D,true,false).newDocument}if(f.formatLocale){Ra.formatLocale(f.formatLocale)}if(f.timeFormatLocale){Ra.timeFormatLocale(f.timeFormatLocale)}if(f.expressionFunctions){for(k in f.expressionFunctions){C=f.expressionFunctions[k];if("fn"in C){Ra.expressionFunction(k,C.fn,C["visitor"])}else if(C instanceof Function){Ra.expressionFunction(k,C)}}}F=f.ast;j=Ra.parse(S,N==="vega-lite"?{}:p,{ast:F});P=new(f.viewClass||Ra.View)(j,La({loader:h,logLevel:m,renderer:g},F?{expr:(c=(u=Ra.expressionInterpreter)!==null&&u!==void 0?u:f.expr)!==null&&c!==void 0?c:ne}:{}));P.addSignalListener("autosize",((e,t)=>{var r=t.type;if(r=="fit-x"){T.classList.add("fit-x");T.classList.remove("fit-y")}else if(r=="fit-y"){T.classList.remove("fit-x");T.classList.add("fit-y")}else if(r=="fit"){T.classList.add("fit-x","fit-y")}else{T.classList.remove("fit-x","fit-y")}}));if(f.tooltip!==false){_=Ba(f.tooltip)?f.tooltip:new mr(f.tooltip===true?{}:f.tooltip).call;P.tooltip(_)}M=f.hover;if(M===undefined){M=N==="vega"}if(M){z=typeof M==="boolean"?{}:M,B=z.hoverSet,G=z.updateSet;P.hover(B,G)}if(f){if(f.width!=null){P.width(f.width)}if(f.height!=null){P.height(f.height)}if(f.padding!=null){P.padding(f.padding)}}se.next=37;return P.initialize(T,f.bind).runAsync();case 37:if(!(d!==false)){se.next=63;break}$=b;if(f.defaultStyle!==false){W=document.createElement("details");W.title=v.CLICK_TO_VIEW_ACTIONS;b.append(W);$=W;H=document.createElement("summary");H.innerHTML=Ma;W.append(H);U=e=>{if(!W.contains(e.target)){W.removeAttribute("open")}};document.addEventListener("click",U)}Y=document.createElement("div");$.append(Y);Y.classList.add("vega-actions");if(!(d===true||d.export!==false)){se.next=60;break}J=Aa(["svg","png"]);se.prev=45;Q=cn.mark((function e(){var t,r,n,i;return cn.wrap((function e(a){while(1)switch(a.prev=a.next){case 0:t=q.value;if(d===true||d.export===true||d.export[t]){r=v["".concat(t.toUpperCase(),"_ACTION")];n=document.createElement("a");i=(0,X.isObject)(f.scaleFactor)?f.scaleFactor[t]:f.scaleFactor;n.text=r;n.href="#";n.target="_blank";n.download="".concat(y,".").concat(t);n.addEventListener("mousedown",function(){var e=Nr(cn.mark((function e(r){var n;return cn.wrap((function e(a){while(1)switch(a.prev=a.next){case 0:r.preventDefault();a.next=3;return P.toImageURL(t,i);case 3:n=a.sent;this.href=n;case 5:case"end":return a.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}());Y.append(n)}case 2:case"end":return a.stop()}}),e)}));J.s();case 48:if((q=J.n()).done){se.next=52;break}return se.delegateYield(Q(),"t0",50);case 50:se.next=48;break;case 52:se.next=57;break;case 54:se.prev=54;se.t1=se["catch"](45);J.e(se.t1);case 57:se.prev=57;J.f();return se.finish(57);case 60:if(d===true||d.source!==false){Z=document.createElement("a");Z.text=v.SOURCE_ACTION;Z.href="#";Z.addEventListener("click",(function(e){var t,n;Ga(V()(r),(t=f.sourceHeader)!==null&&t!==void 0?t:"",(n=f.sourceFooter)!==null&&n!==void 0?n:"",N);e.preventDefault()}));Y.append(Z)}if(N==="vega-lite"&&(d===true||d.compiled!==false)){K=document.createElement("a");K.text=v.COMPILED_ACTION;K.href="#";K.addEventListener("click",(function(e){var t,r;Ga(V()(S),(t=f.sourceHeader)!==null&&t!==void 0?t:"",(r=f.sourceFooter)!==null&&r!==void 0?r:"","vega");e.preventDefault()}));Y.append(K)}if(d===true||d.editor!==false){te=(ee=f.editorUrl)!==null&&ee!==void 0?ee:"https://vega.github.io/editor/";re=document.createElement("a");re.text=v.EDITOR_ACTION;re.href="#";re.addEventListener("click",(function(e){Qi(window,te,{config:p,mode:N,renderer:g,spec:V()(r)});e.preventDefault()}));Y.append(re)}case 63:return se.abrupt("return",{view:P,spec:r,vgSpec:S,finalize:ie,embedOptions:f});case 64:case"end":return se.stop()}}),e,null,[[45,54,57,60]])})));return Za.apply(this,arguments)}},26372:(e,t,r)=>{"use strict";r.d(t,{$D:()=>E,$G:()=>Y,$P:()=>me,AU:()=>T,B:()=>de,B2:()=>H,BS:()=>Q,Cc:()=>Oe,D_:()=>p,EV:()=>Ie,Eb:()=>xe,Et:()=>be,G4:()=>De,Gv:()=>N,KH:()=>B,Kg:()=>we,Lm:()=>ge,Ln:()=>Te,M1:()=>je,N6:()=>i,NV:()=>b,P$:()=>w,PK:()=>ve,R2:()=>x,Ro:()=>k,SW:()=>W,Tn:()=>Z,UD:()=>ee,VC:()=>z,V_:()=>te,X$:()=>se,Xx:()=>le,YO:()=>q,ZZ:()=>f,ay:()=>Ce,bX:()=>pe,co:()=>G,cy:()=>I,dI:()=>Fe,dY:()=>ae,eV:()=>Le,gd:()=>Ee,h1:()=>Ne,id:()=>h,io:()=>L,iv:()=>u,lL:()=>X,mQ:()=>ue,me:()=>m,n:()=>ce,nG:()=>he,nS:()=>a,oV:()=>$,r$:()=>Re,rt:()=>_e,sY:()=>n,se:()=>D,sg:()=>oe,ux:()=>Se,vF:()=>A,vN:()=>g,v_:()=>d,vu:()=>J,xH:()=>v,xZ:()=>ye,xv:()=>Pe,y:()=>O,z3:()=>c,zy:()=>U});function n(e,t,r){e.fields=t||[];e.fname=r;return e}function i(e){return e==null?null:e.fname}function a(e){return e==null?null:e.fields}function o(e){return e.length===1?s(e[0]):l(e)}const s=e=>function(t){return t[e]};const l=e=>{const t=e.length;return function(r){for(let n=0;no){u()}else{o=s+1}}else if(l==="["){if(s>o)u();i=o=s+1}else if(l==="]"){if(!i)c("Access path missing open bracket: "+e);if(i>0)u();i=0;o=s+1}}if(i)c("Access path missing closing bracket: "+e);if(n)c("Access path missing closing quote: "+e);if(s>o){s++;u()}return t}function f(e,t,r){const i=u(e);e=i.length===1?i[0]:e;return n((r&&r.get||o)(i),[e],t||e)}const h=f("id");const p=n((e=>e),[],"identity");const d=n((()=>0),[],"zero");const v=n((()=>1),[],"one");const g=n((()=>true),[],"true");const m=n((()=>false),[],"false");function y(e,t,r){const n=[t].concat([].slice.call(r));console[e].apply(console,n)}const b=0;const E=1;const w=2;const x=3;const O=4;function A(e,t){let r=arguments.length>2&&arguments[2]!==undefined?arguments[2]:y;let n=e||b;return{level(e){if(arguments.length){n=+e;return this}else{return n}},error(){if(n>=E)r(t||"error","ERROR",arguments);return this},warn(){if(n>=w)r(t||"warn","WARN",arguments);return this},info(){if(n>=x)r(t||"log","INFO",arguments);return this},debug(){if(n>=O)r(t||"log","DEBUG",arguments);return this}}}var I=Array.isArray;function N(e){return e===Object(e)}const S=e=>e!=="__proto__";function L(){for(var e=arguments.length,t=new Array(e),r=0;r{for(const r in t){if(r==="signals"){e.signals=R(e.signals,t.signals)}else{const n=r==="legend"?{layout:1}:r==="style"?true:null;T(e,r,t[r],n)}}return e}),{})}function T(e,t,r,n){if(!S(t))return;let i,a;if(N(r)&&!I(r)){a=N(e[t])?e[t]:e[t]={};for(i in r){if(n&&(n===true||n[i])){T(a,i,r[i])}else if(S(i)){a[i]=r[i]}}}else{e[t]=r}}function R(e,t){if(e==null)return t;const r={},n=[];function i(e){if(!r[e.name]){r[e.name]=1;n.push(e)}}t.forEach(i);e.forEach(i);return n}function D(e){return e[e.length-1]}function k(e){return e==null||e===""?null:+e}const C=e=>t=>e*Math.exp(t);const F=e=>t=>Math.log(e*t);const j=e=>t=>Math.sign(t)*Math.log1p(Math.abs(t/e));const P=e=>t=>Math.sign(t)*Math.expm1(Math.abs(t))*e;const _=e=>t=>t<0?-Math.pow(-t,e):Math.pow(t,e);function M(e,t,r,n){const i=r(e[0]),a=r(D(e)),o=(a-i)*t;return[n(i-o),n(a-o)]}function z(e,t){return M(e,t,k,p)}function B(e,t){var r=Math.sign(e[0]);return M(e,t,F(r),C(r))}function G(e,t,r){return M(e,t,_(r),_(1/r))}function U(e,t,r){return M(e,t,j(r),P(r))}function V(e,t,r,n,i){const a=n(e[0]),o=n(D(e)),s=t!=null?n(t):(a+o)/2;return[i(s+(a-s)*r),i(s+(o-s)*r)]}function X(e,t,r){return V(e,t,r,k,p)}function $(e,t,r){const n=Math.sign(e[0]);return V(e,t,r,F(n),C(n))}function W(e,t,r,n){return V(e,t,r,_(n),_(1/n))}function H(e,t,r,n){return V(e,t,r,j(n),P(n))}function Y(e){return 1+~~(new Date(e).getMonth()/3)}function J(e){return 1+~~(new Date(e).getUTCMonth()/3)}function q(e){return e!=null?I(e)?e:[e]:[]}function Q(e,t,r){let n=e[0],i=e[1],a;if(i=r-t?[t,r]:[n=Math.min(Math.max(n,t),r-a),n+a]}function Z(e){return typeof e==="function"}const K="descending";function ee(e,t,r){r=r||{};t=q(t)||[];const i=[],o=[],s={},l=r.comparator||re;q(e).forEach(((e,n)=>{if(e==null)return;i.push(t[n]===K?-1:1);o.push(e=Z(e)?e:f(e,null,r));(a(e)||[]).forEach((e=>s[e]=1))}));return o.length===0?null:n(l(o,i),Object.keys(s))}const te=(e,t)=>(et||t==null)&&e!=null?1:(t=t instanceof Date?+t:t,e=e instanceof Date?+e:e)!==e&&t===t?-1:t!==t&&e===e?1:0;const re=(e,t)=>e.length===1?ne(e[0],t[0]):ie(e,t,e.length);const ne=(e,t)=>function(r,n){return te(e(r),e(n))*t};const ie=(e,t,r)=>{t.push(0);return function(n,i){let a,o=0,s=-1;while(o===0&&++se}function oe(e,t){let r;return n=>{if(r)clearTimeout(r);r=setTimeout((()=>(t(n),r=null)),e)}}function se(e){for(let t,r,n=1,i=arguments.length;no)o=i}}}else{for(i=t(e[r]);ro)o=i}}}}return[a,o]}function ce(e,t){const r=e.length;let n=-1,i,a,o,s,l;if(t==null){while(++n=a){i=o=a;break}}if(n===r)return[-1,-1];s=l=n;while(++na){i=a;s=n}if(o=a){i=o=a;break}}if(n===r)return[-1,-1];s=l=n;while(++na){i=a;s=n}if(o{i.set(t,e[t])}));return i}function pe(e,t,r,n,i,a){if(!r&&r!==0)return a;const o=+r;let s=e[0],l=D(e),c;if(la){o=i;i=a;a=o}r=r===undefined||r;n=n===undefined||n;return(r?i<=e:ie.replace(/\\(.)/g,"$1"))):q(e)}const i=e&&e.length,a=r&&r.get||o,s=e=>a(t?[e]:u(e));let l;if(!i){l=function(){return""}}else if(i===1){const t=s(e[0]);l=function(e){return""+t(e)}}else{const t=e.map(s);l=function(e){let r=""+t[0](e),n=0;while(++n{t={};r={};n=0};const a=(i,a)=>{if(++n>e){r=t;t={};n=1}return t[i]=a};i();return{clear:i,has:e=>ue(t,e)||ue(r,e),get:e=>ue(t,e)?t[e]:ue(r,e)?a(e,r[e]):undefined,set:(e,r)=>ue(t,e)?t[e]=r:a(e,r)}}function Ne(e,t,r,n){const i=t.length,a=r.length;if(!a)return t;if(!i)return r;const o=n||new t.constructor(i+a);let s=0,l=0,c=0;for(;s0?r[l++]:t[s++]}for(;s=0)r+=e;return r}function Le(e,t,r,n){const i=r||" ",a=e+"",o=t-a.length;return o<=0?a:n==="left"?Se(i,o)+a:n==="center"?Se(i,~~(o/2))+a+Se(i,Math.ceil(o/2)):a+Se(i,o)}function Te(e){return e&&D(e)-e[0]||0}function Re(e){return I(e)?"["+e.map(Re)+"]":N(e)||we(e)?JSON.stringify(e).replace("\u2028","\\u2028").replace("\u2029","\\u2029"):e}function De(e){return e==null||e===""?null:!e||e==="false"||e==="0"?false:!!e}const ke=e=>be(e)?e:me(e)?e:Date.parse(e);function Ce(e,t){t=t||ke;return e==null||e===""?null:t(e)}function Fe(e){return e==null||e===""?null:e+""}function je(e){const t={},r=e.length;for(let n=0;n{a.d(e,{CP:()=>l,HT:()=>h,PB:()=>d,aC:()=>c,lC:()=>n,m:()=>o,tk:()=>i});var s=a(75905);var r=a(16750);var i=(0,s.K2)(((t,e)=>{const a=t.append("rect");a.attr("x",e.x);a.attr("y",e.y);a.attr("fill",e.fill);a.attr("stroke",e.stroke);a.attr("width",e.width);a.attr("height",e.height);if(e.name){a.attr("name",e.name)}if(e.rx){a.attr("rx",e.rx)}if(e.ry){a.attr("ry",e.ry)}if(e.attrs!==void 0){for(const t in e.attrs){a.attr(t,e.attrs[t])}}if(e.class){a.attr("class",e.class)}return a}),"drawRect");var n=(0,s.K2)(((t,e)=>{const a={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};const s=i(t,a);s.lower()}),"drawBackgroundRect");var o=(0,s.K2)(((t,e)=>{const a=e.text.replace(s.H1," ");const r=t.append("text");r.attr("x",e.x);r.attr("y",e.y);r.attr("class","legend");r.style("text-anchor",e.anchor);if(e.class){r.attr("class",e.class)}const i=r.append("tspan");i.attr("x",e.x+e.textMargin*2);i.text(a);return r}),"drawText");var c=(0,s.K2)(((t,e,a,s)=>{const i=t.append("image");i.attr("x",e);i.attr("y",a);const n=(0,r.J)(s);i.attr("xlink:href",n)}),"drawImage");var l=(0,s.K2)(((t,e,a,s)=>{const i=t.append("use");i.attr("x",e);i.attr("y",a);const n=(0,r.J)(s);i.attr("xlink:href",`#${n}`)}),"drawEmbeddedImage");var d=(0,s.K2)((()=>{const t={x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0};return t}),"getNoteRect");var h=(0,s.K2)((()=>{const t={x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:true};return t}),"getTextObj")},13249:(t,e,a)=>{a.d(e,{m:()=>r});var s=a(75905);var r=class{constructor(t){this.init=t;this.records=this.init()}static{(0,s.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},38038:(t,e,a)=>{a.d(e,{diagram:()=>Tt});var s=a(60148);var r=a(13249);var i=a(96049);var n=a(75905);var o=a(24982);var c=a(16750);var l=function(){var t=(0,n.K2)((function(t,e,a,s){for(a=a||{},s=t.length;s--;a[t[s]]=e);return a}),"o"),e=[1,2],a=[1,3],s=[1,4],r=[2,4],i=[1,9],o=[1,11],c=[1,13],l=[1,14],d=[1,16],h=[1,17],p=[1,18],g=[1,24],u=[1,25],f=[1,26],x=[1,27],y=[1,28],b=[1,29],m=[1,30],T=[1,31],E=[1,32],w=[1,33],v=[1,34],k=[1,35],I=[1,36],L=[1,37],_=[1,38],P=[1,39],A=[1,41],N=[1,42],M=[1,43],D=[1,44],S=[1,45],O=[1,46],R=[1,4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,48,49,50,52,53,54,59,60,61,62,70],Y=[4,5,16,50,52,53],K=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],C=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,49,50,52,53,54,59,60,61,62,70],B=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,48,50,52,53,54,59,60,61,62,70],$=[4,5,13,14,16,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,47,50,52,53,54,59,60,61,62,70],V=[68,69,70],F=[1,122];var W={trace:(0,n.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NEWLINE:5,SD:6,document:7,line:8,statement:9,box_section:10,box_line:11,participant_statement:12,create:13,box:14,restOfLine:15,end:16,signal:17,autonumber:18,NUM:19,off:20,activate:21,actor:22,deactivate:23,note_statement:24,links_statement:25,link_statement:26,properties_statement:27,details_statement:28,title:29,legacy_title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,loop:36,rect:37,opt:38,alt:39,else_sections:40,par:41,par_sections:42,par_over:43,critical:44,option_sections:45,break:46,option:47,and:48,else:49,participant:50,AS:51,participant_actor:52,destroy:53,note:54,placement:55,text2:56,over:57,actor_pair:58,links:59,link:60,properties:61,details:62,spaceList:63,",":64,left_of:65,right_of:66,signaltype:67,"+":68,"-":69,ACTOR:70,SOLID_OPEN_ARROW:71,DOTTED_OPEN_ARROW:72,SOLID_ARROW:73,BIDIRECTIONAL_SOLID_ARROW:74,DOTTED_ARROW:75,BIDIRECTIONAL_DOTTED_ARROW:76,SOLID_CROSS:77,DOTTED_CROSS:78,SOLID_POINT:79,DOTTED_POINT:80,TXT:81,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NEWLINE",6:"SD",13:"create",14:"box",15:"restOfLine",16:"end",18:"autonumber",19:"NUM",20:"off",21:"activate",23:"deactivate",29:"title",30:"legacy_title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"loop",37:"rect",38:"opt",39:"alt",41:"par",43:"par_over",44:"critical",46:"break",47:"option",48:"and",49:"else",50:"participant",51:"AS",52:"participant_actor",53:"destroy",54:"note",57:"over",59:"links",60:"link",61:"properties",62:"details",64:",",65:"left_of",66:"right_of",68:"+",69:"-",70:"ACTOR",71:"SOLID_OPEN_ARROW",72:"DOTTED_OPEN_ARROW",73:"SOLID_ARROW",74:"BIDIRECTIONAL_SOLID_ARROW",75:"DOTTED_ARROW",76:"BIDIRECTIONAL_DOTTED_ARROW",77:"SOLID_CROSS",78:"DOTTED_CROSS",79:"SOLID_POINT",80:"DOTTED_POINT",81:"TXT"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[10,0],[10,2],[11,2],[11,1],[11,1],[9,1],[9,2],[9,4],[9,2],[9,4],[9,3],[9,3],[9,2],[9,3],[9,3],[9,2],[9,2],[9,2],[9,2],[9,2],[9,1],[9,1],[9,2],[9,2],[9,1],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[9,4],[45,1],[45,4],[42,1],[42,4],[40,1],[40,4],[12,5],[12,3],[12,5],[12,3],[12,3],[24,4],[24,4],[25,3],[26,3],[27,3],[28,3],[63,2],[63,1],[58,3],[58,1],[55,1],[55,1],[17,5],[17,5],[17,4],[22,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[67,1],[56,1]],performAction:(0,n.K2)((function t(e,a,s,r,i,n,o){var c=n.length-1;switch(i){case 3:r.apply(n[c]);return n[c];break;case 4:case 9:this.$=[];break;case 5:case 10:n[c-1].push(n[c]);this.$=n[c-1];break;case 6:case 7:case 11:case 12:this.$=n[c];break;case 8:case 13:this.$=[];break;case 15:n[c].type="createParticipant";this.$=n[c];break;case 16:n[c-1].unshift({type:"boxStart",boxData:r.parseBoxData(n[c-2])});n[c-1].push({type:"boxEnd",boxText:n[c-2]});this.$=n[c-1];break;case 18:this.$={type:"sequenceIndex",sequenceIndex:Number(n[c-2]),sequenceIndexStep:Number(n[c-1]),sequenceVisible:true,signalType:r.LINETYPE.AUTONUMBER};break;case 19:this.$={type:"sequenceIndex",sequenceIndex:Number(n[c-1]),sequenceIndexStep:1,sequenceVisible:true,signalType:r.LINETYPE.AUTONUMBER};break;case 20:this.$={type:"sequenceIndex",sequenceVisible:false,signalType:r.LINETYPE.AUTONUMBER};break;case 21:this.$={type:"sequenceIndex",sequenceVisible:true,signalType:r.LINETYPE.AUTONUMBER};break;case 22:this.$={type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:n[c-1].actor};break;case 23:this.$={type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:n[c-1].actor};break;case 29:r.setDiagramTitle(n[c].substring(6));this.$=n[c].substring(6);break;case 30:r.setDiagramTitle(n[c].substring(7));this.$=n[c].substring(7);break;case 31:this.$=n[c].trim();r.setAccTitle(this.$);break;case 32:case 33:this.$=n[c].trim();r.setAccDescription(this.$);break;case 34:n[c-1].unshift({type:"loopStart",loopText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.LOOP_START});n[c-1].push({type:"loopEnd",loopText:n[c-2],signalType:r.LINETYPE.LOOP_END});this.$=n[c-1];break;case 35:n[c-1].unshift({type:"rectStart",color:r.parseMessage(n[c-2]),signalType:r.LINETYPE.RECT_START});n[c-1].push({type:"rectEnd",color:r.parseMessage(n[c-2]),signalType:r.LINETYPE.RECT_END});this.$=n[c-1];break;case 36:n[c-1].unshift({type:"optStart",optText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.OPT_START});n[c-1].push({type:"optEnd",optText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.OPT_END});this.$=n[c-1];break;case 37:n[c-1].unshift({type:"altStart",altText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.ALT_START});n[c-1].push({type:"altEnd",signalType:r.LINETYPE.ALT_END});this.$=n[c-1];break;case 38:n[c-1].unshift({type:"parStart",parText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.PAR_START});n[c-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END});this.$=n[c-1];break;case 39:n[c-1].unshift({type:"parStart",parText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.PAR_OVER_START});n[c-1].push({type:"parEnd",signalType:r.LINETYPE.PAR_END});this.$=n[c-1];break;case 40:n[c-1].unshift({type:"criticalStart",criticalText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.CRITICAL_START});n[c-1].push({type:"criticalEnd",signalType:r.LINETYPE.CRITICAL_END});this.$=n[c-1];break;case 41:n[c-1].unshift({type:"breakStart",breakText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.BREAK_START});n[c-1].push({type:"breakEnd",optText:r.parseMessage(n[c-2]),signalType:r.LINETYPE.BREAK_END});this.$=n[c-1];break;case 43:this.$=n[c-3].concat([{type:"option",optionText:r.parseMessage(n[c-1]),signalType:r.LINETYPE.CRITICAL_OPTION},n[c]]);break;case 45:this.$=n[c-3].concat([{type:"and",parText:r.parseMessage(n[c-1]),signalType:r.LINETYPE.PAR_AND},n[c]]);break;case 47:this.$=n[c-3].concat([{type:"else",altText:r.parseMessage(n[c-1]),signalType:r.LINETYPE.ALT_ELSE},n[c]]);break;case 48:n[c-3].draw="participant";n[c-3].type="addParticipant";n[c-3].description=r.parseMessage(n[c-1]);this.$=n[c-3];break;case 49:n[c-1].draw="participant";n[c-1].type="addParticipant";this.$=n[c-1];break;case 50:n[c-3].draw="actor";n[c-3].type="addParticipant";n[c-3].description=r.parseMessage(n[c-1]);this.$=n[c-3];break;case 51:n[c-1].draw="actor";n[c-1].type="addParticipant";this.$=n[c-1];break;case 52:n[c-1].type="destroyParticipant";this.$=n[c-1];break;case 53:this.$=[n[c-1],{type:"addNote",placement:n[c-2],actor:n[c-1].actor,text:n[c]}];break;case 54:n[c-2]=[].concat(n[c-1],n[c-1]).slice(0,2);n[c-2][0]=n[c-2][0].actor;n[c-2][1]=n[c-2][1].actor;this.$=[n[c-1],{type:"addNote",placement:r.PLACEMENT.OVER,actor:n[c-2].slice(0,2),text:n[c]}];break;case 55:this.$=[n[c-1],{type:"addLinks",actor:n[c-1].actor,text:n[c]}];break;case 56:this.$=[n[c-1],{type:"addALink",actor:n[c-1].actor,text:n[c]}];break;case 57:this.$=[n[c-1],{type:"addProperties",actor:n[c-1].actor,text:n[c]}];break;case 58:this.$=[n[c-1],{type:"addDetails",actor:n[c-1].actor,text:n[c]}];break;case 61:this.$=[n[c-2],n[c]];break;case 62:this.$=n[c];break;case 63:this.$=r.PLACEMENT.LEFTOF;break;case 64:this.$=r.PLACEMENT.RIGHTOF;break;case 65:this.$=[n[c-4],n[c-1],{type:"addMessage",from:n[c-4].actor,to:n[c-1].actor,signalType:n[c-3],msg:n[c],activate:true},{type:"activeStart",signalType:r.LINETYPE.ACTIVE_START,actor:n[c-1].actor}];break;case 66:this.$=[n[c-4],n[c-1],{type:"addMessage",from:n[c-4].actor,to:n[c-1].actor,signalType:n[c-3],msg:n[c]},{type:"activeEnd",signalType:r.LINETYPE.ACTIVE_END,actor:n[c-4].actor}];break;case 67:this.$=[n[c-3],n[c-1],{type:"addMessage",from:n[c-3].actor,to:n[c-1].actor,signalType:n[c-2],msg:n[c]}];break;case 68:this.$={type:"addParticipant",actor:n[c]};break;case 69:this.$=r.LINETYPE.SOLID_OPEN;break;case 70:this.$=r.LINETYPE.DOTTED_OPEN;break;case 71:this.$=r.LINETYPE.SOLID;break;case 72:this.$=r.LINETYPE.BIDIRECTIONAL_SOLID;break;case 73:this.$=r.LINETYPE.DOTTED;break;case 74:this.$=r.LINETYPE.BIDIRECTIONAL_DOTTED;break;case 75:this.$=r.LINETYPE.SOLID_CROSS;break;case 76:this.$=r.LINETYPE.DOTTED_CROSS;break;case 77:this.$=r.LINETYPE.SOLID_POINT;break;case 78:this.$=r.LINETYPE.DOTTED_POINT;break;case 79:this.$=r.parseMessage(n[c].trim().substring(1));break}}),"anonymous"),table:[{3:1,4:e,5:a,6:s},{1:[3]},{3:5,4:e,5:a,6:s},{3:6,4:e,5:a,6:s},t([1,4,5,13,14,18,21,23,29,30,31,33,35,36,37,38,39,41,43,44,46,50,52,53,54,59,60,61,62,70],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:i,5:o,8:8,9:10,12:12,13:c,14:l,17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},t(R,[2,5]),{9:47,12:12,13:c,14:l,17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},t(R,[2,7]),t(R,[2,8]),t(R,[2,14]),{12:48,50:L,52:_,53:P},{15:[1,49]},{5:[1,50]},{5:[1,53],19:[1,51],20:[1,52]},{22:54,70:O},{22:55,70:O},{5:[1,56]},{5:[1,57]},{5:[1,58]},{5:[1,59]},{5:[1,60]},t(R,[2,29]),t(R,[2,30]),{32:[1,61]},{34:[1,62]},t(R,[2,33]),{15:[1,63]},{15:[1,64]},{15:[1,65]},{15:[1,66]},{15:[1,67]},{15:[1,68]},{15:[1,69]},{15:[1,70]},{22:71,70:O},{22:72,70:O},{22:73,70:O},{67:74,71:[1,75],72:[1,76],73:[1,77],74:[1,78],75:[1,79],76:[1,80],77:[1,81],78:[1,82],79:[1,83],80:[1,84]},{55:85,57:[1,86],65:[1,87],66:[1,88]},{22:89,70:O},{22:90,70:O},{22:91,70:O},{22:92,70:O},t([5,51,64,71,72,73,74,75,76,77,78,79,80,81],[2,68]),t(R,[2,6]),t(R,[2,15]),t(Y,[2,9],{10:93}),t(R,[2,17]),{5:[1,95],19:[1,94]},{5:[1,96]},t(R,[2,21]),{5:[1,97]},{5:[1,98]},t(R,[2,24]),t(R,[2,25]),t(R,[2,26]),t(R,[2,27]),t(R,[2,28]),t(R,[2,31]),t(R,[2,32]),t(K,r,{7:99}),t(K,r,{7:100}),t(K,r,{7:101}),t(C,r,{40:102,7:103}),t(B,r,{42:104,7:105}),t(B,r,{7:105,42:106}),t($,r,{45:107,7:108}),t(K,r,{7:109}),{5:[1,111],51:[1,110]},{5:[1,113],51:[1,112]},{5:[1,114]},{22:117,68:[1,115],69:[1,116],70:O},t(V,[2,69]),t(V,[2,70]),t(V,[2,71]),t(V,[2,72]),t(V,[2,73]),t(V,[2,74]),t(V,[2,75]),t(V,[2,76]),t(V,[2,77]),t(V,[2,78]),{22:118,70:O},{22:120,58:119,70:O},{70:[2,63]},{70:[2,64]},{56:121,81:F},{56:123,81:F},{56:124,81:F},{56:125,81:F},{4:[1,128],5:[1,130],11:127,12:129,16:[1,126],50:L,52:_,53:P},{5:[1,131]},t(R,[2,19]),t(R,[2,20]),t(R,[2,22]),t(R,[2,23]),{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[1,132],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[1,133],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[1,134],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{16:[1,135]},{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[2,46],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,49:[1,136],50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{16:[1,137]},{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[2,44],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,48:[1,138],50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{16:[1,139]},{16:[1,140]},{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[2,42],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,47:[1,141],50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{4:i,5:o,8:8,9:10,12:12,13:c,14:l,16:[1,142],17:15,18:d,21:h,22:40,23:p,24:19,25:20,26:21,27:22,28:23,29:g,30:u,31:f,33:x,35:y,36:b,37:m,38:T,39:E,41:w,43:v,44:k,46:I,50:L,52:_,53:P,54:A,59:N,60:M,61:D,62:S,70:O},{15:[1,143]},t(R,[2,49]),{15:[1,144]},t(R,[2,51]),t(R,[2,52]),{22:145,70:O},{22:146,70:O},{56:147,81:F},{56:148,81:F},{56:149,81:F},{64:[1,150],81:[2,62]},{5:[2,55]},{5:[2,79]},{5:[2,56]},{5:[2,57]},{5:[2,58]},t(R,[2,16]),t(Y,[2,10]),{12:151,50:L,52:_,53:P},t(Y,[2,12]),t(Y,[2,13]),t(R,[2,18]),t(R,[2,34]),t(R,[2,35]),t(R,[2,36]),t(R,[2,37]),{15:[1,152]},t(R,[2,38]),{15:[1,153]},t(R,[2,39]),t(R,[2,40]),{15:[1,154]},t(R,[2,41]),{5:[1,155]},{5:[1,156]},{56:157,81:F},{56:158,81:F},{5:[2,67]},{5:[2,53]},{5:[2,54]},{22:159,70:O},t(Y,[2,11]),t(C,r,{7:103,40:160}),t(B,r,{7:105,42:161}),t($,r,{7:108,45:162}),t(R,[2,48]),t(R,[2,50]),{5:[2,65]},{5:[2,66]},{81:[2,61]},{16:[2,47]},{16:[2,45]},{16:[2,43]}],defaultActions:{5:[2,1],6:[2,2],87:[2,63],88:[2,64],121:[2,55],122:[2,79],123:[2,56],124:[2,57],125:[2,58],147:[2,67],148:[2,53],149:[2,54],157:[2,65],158:[2,66],159:[2,61],160:[2,47],161:[2,45],162:[2,43]},parseError:(0,n.K2)((function t(e,a){if(a.recoverable){this.trace(e)}else{var s=new Error(e);s.hash=a;throw s}}),"parseError"),parse:(0,n.K2)((function t(e){var a=this,s=[0],r=[],i=[null],o=[],c=this.table,l="",d=0,h=0,p=0,g=2,u=1;var f=o.slice.call(arguments,1);var x=Object.create(this.lexer);var y={yy:{}};for(var b in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,b)){y.yy[b]=this.yy[b]}}x.setInput(e,y.yy);y.yy.lexer=x;y.yy.parser=this;if(typeof x.yylloc=="undefined"){x.yylloc={}}var m=x.yylloc;o.push(m);var T=x.options&&x.options.ranges;if(typeof y.yy.parseError==="function"){this.parseError=y.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function E(t){s.length=s.length-2*t;i.length=i.length-t;o.length=o.length-t}(0,n.K2)(E,"popStack");function w(){var t;t=r.pop()||x.lex()||u;if(typeof t!=="number"){if(t instanceof Array){r=t;t=r.pop()}t=a.symbols_[t]||t}return t}(0,n.K2)(w,"lex");var v,k,I,L,_,P,A={},N,M,D,S;while(true){I=s[s.length-1];if(this.defaultActions[I]){L=this.defaultActions[I]}else{if(v===null||typeof v=="undefined"){v=w()}L=c[I]&&c[I][v]}if(typeof L==="undefined"||!L.length||!L[0]){var O="";S=[];for(N in c[I]){if(this.terminals_[N]&&N>g){S.push("'"+this.terminals_[N]+"'")}}if(x.showPosition){O="Parse error on line "+(d+1)+":\n"+x.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[v]||v)+"'"}else{O="Parse error on line "+(d+1)+": Unexpected "+(v==u?"end of input":"'"+(this.terminals_[v]||v)+"'")}this.parseError(O,{text:x.match,token:this.terminals_[v]||v,line:x.yylineno,loc:m,expected:S})}if(L[0]instanceof Array&&L.length>1){throw new Error("Parse Error: multiple actions possible at state: "+I+", token: "+v)}switch(L[0]){case 1:s.push(v);i.push(x.yytext);o.push(x.yylloc);s.push(L[1]);v=null;if(!k){h=x.yyleng;l=x.yytext;d=x.yylineno;m=x.yylloc;if(p>0){p--}}else{v=k;k=null}break;case 2:M=this.productions_[L[1]][1];A.$=i[i.length-M];A._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column};if(T){A._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]}P=this.performAction.apply(A,[l,h,d,y.yy,L[1],i,o].concat(f));if(typeof P!=="undefined"){return P}if(M){s=s.slice(0,-1*M*2);i=i.slice(0,-1*M);o=o.slice(0,-1*M)}s.push(this.productions_[L[1]][0]);i.push(A.$);o.push(A._$);D=c[s[s.length-2]][s[s.length-1]];s.push(D);break;case 3:return true}}return true}),"parse")};var q=function(){var t={EOF:1,parseError:(0,n.K2)((function t(e,a){if(this.yy.parser){this.yy.parser.parseError(e,a)}else{throw new Error(e)}}),"parseError"),setInput:(0,n.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,n.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,n.K2)((function(t){var e=t.length;var a=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-e);this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(a.length-1){this.yylineno-=a.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===s.length?this.yylloc.first_column:0)+s[s.length-a.length].length-a[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,n.K2)((function(){this._more=true;return this}),"more"),reject:(0,n.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,n.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,n.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,n.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,n.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,n.K2)((function(t,e){var a,s,r;if(this.options.backtrack_lexer){r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){r.yylloc.range=this.yylloc.range.slice(0)}}s=t[0].match(/(?:\r\n?|\n).*/g);if(s){this.yylineno+=s.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];a=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(a){return a}else if(this._backtrack){for(var i in r){this[i]=r[i]}return false}return false}),"test_match"),next:(0,n.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,a,s;if(!this._more){this.yytext="";this.match=""}var r=this._currentRules();for(var i=0;ie[0].length)){e=a;s=i;if(this.options.backtrack_lexer){t=this.test_match(a,r[i]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,r[s]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,n.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,n.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,n.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,n.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,n.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,n.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,n.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,n.K2)((function t(e,a,s,r){var i=r;switch(s){case 0:return 5;break;case 1:break;case 2:break;case 3:break;case 4:break;case 5:break;case 6:return 19;break;case 7:this.begin("LINE");return 14;break;case 8:this.begin("ID");return 50;break;case 9:this.begin("ID");return 52;break;case 10:return 13;break;case 11:this.begin("ID");return 53;break;case 12:a.yytext=a.yytext.trim();this.begin("ALIAS");return 70;break;case 13:this.popState();this.popState();this.begin("LINE");return 51;break;case 14:this.popState();this.popState();return 5;break;case 15:this.begin("LINE");return 36;break;case 16:this.begin("LINE");return 37;break;case 17:this.begin("LINE");return 38;break;case 18:this.begin("LINE");return 39;break;case 19:this.begin("LINE");return 49;break;case 20:this.begin("LINE");return 41;break;case 21:this.begin("LINE");return 43;break;case 22:this.begin("LINE");return 48;break;case 23:this.begin("LINE");return 44;break;case 24:this.begin("LINE");return 47;break;case 25:this.begin("LINE");return 46;break;case 26:this.popState();return 15;break;case 27:return 16;break;case 28:return 65;break;case 29:return 66;break;case 30:return 59;break;case 31:return 60;break;case 32:return 61;break;case 33:return 62;break;case 34:return 57;break;case 35:return 54;break;case 36:this.begin("ID");return 21;break;case 37:this.begin("ID");return 23;break;case 38:return 29;break;case 39:return 30;break;case 40:this.begin("acc_title");return 31;break;case 41:this.popState();return"acc_title_value";break;case 42:this.begin("acc_descr");return 33;break;case 43:this.popState();return"acc_descr_value";break;case 44:this.begin("acc_descr_multiline");break;case 45:this.popState();break;case 46:return"acc_descr_multiline_value";break;case 47:return 6;break;case 48:return 18;break;case 49:return 20;break;case 50:return 64;break;case 51:return 5;break;case 52:a.yytext=a.yytext.trim();return 70;break;case 53:return 73;break;case 54:return 74;break;case 55:return 75;break;case 56:return 76;break;case 57:return 71;break;case 58:return 72;break;case 59:return 77;break;case 60:return 78;break;case 61:return 79;break;case 62:return 80;break;case 63:return 81;break;case 64:return 68;break;case 65:return 69;break;case 66:return 5;break;case 67:return"INVALID";break}}),"anonymous"),rules:[/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[0-9]+(?=[ \n]+))/i,/^(?:box\b)/i,/^(?:participant\b)/i,/^(?:actor\b)/i,/^(?:create\b)/i,/^(?:destroy\b)/i,/^(?:[^\<->\->:\n,;]+?([\-]*[^\<->\->:\n,;]+?)*?(?=((?!\n)\s)+as(?!\n)\s|[#\n;]|$))/i,/^(?:as\b)/i,/^(?:(?:))/i,/^(?:loop\b)/i,/^(?:rect\b)/i,/^(?:opt\b)/i,/^(?:alt\b)/i,/^(?:else\b)/i,/^(?:par\b)/i,/^(?:par_over\b)/i,/^(?:and\b)/i,/^(?:critical\b)/i,/^(?:option\b)/i,/^(?:break\b)/i,/^(?:(?:[:]?(?:no)?wrap)?[^#\n;]*)/i,/^(?:end\b)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:links\b)/i,/^(?:link\b)/i,/^(?:properties\b)/i,/^(?:details\b)/i,/^(?:over\b)/i,/^(?:note\b)/i,/^(?:activate\b)/i,/^(?:deactivate\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:title:\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:sequenceDiagram\b)/i,/^(?:autonumber\b)/i,/^(?:off\b)/i,/^(?:,)/i,/^(?:;)/i,/^(?:[^\+\<->\->:\n,;]+((?!(-x|--x|-\)|--\)))[\-]*[^\+\<->\->:\n,;]+)*)/i,/^(?:->>)/i,/^(?:<<->>)/i,/^(?:-->>)/i,/^(?:<<-->>)/i,/^(?:->)/i,/^(?:-->)/i,/^(?:-[x])/i,/^(?:--[x])/i,/^(?:-[\)])/i,/^(?:--[\)])/i,/^(?::(?:(?:no)?wrap)?[^#\n;]+)/i,/^(?:\+)/i,/^(?:-)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[45,46],inclusive:false},acc_descr:{rules:[43],inclusive:false},acc_title:{rules:[41],inclusive:false},ID:{rules:[2,3,12],inclusive:false},ALIAS:{rules:[2,3,13,14],inclusive:false},LINE:{rules:[2,3,26],inclusive:false},INITIAL:{rules:[0,1,3,4,5,6,7,8,9,10,11,15,16,17,18,19,20,21,22,23,24,25,27,28,29,30,31,32,33,34,35,36,37,38,39,40,42,44,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67],inclusive:true}}};return t}();W.lexer=q;function z(){this.yy={}}(0,n.K2)(z,"Parser");z.prototype=W;W.Parser=z;return new z}();l.parser=l;var d=l;var h={SOLID:0,DOTTED:1,NOTE:2,SOLID_CROSS:3,DOTTED_CROSS:4,SOLID_OPEN:5,DOTTED_OPEN:6,LOOP_START:10,LOOP_END:11,ALT_START:12,ALT_ELSE:13,ALT_END:14,OPT_START:15,OPT_END:16,ACTIVE_START:17,ACTIVE_END:18,PAR_START:19,PAR_AND:20,PAR_END:21,RECT_START:22,RECT_END:23,SOLID_POINT:24,DOTTED_POINT:25,AUTONUMBER:26,CRITICAL_START:27,CRITICAL_OPTION:28,CRITICAL_END:29,BREAK_START:30,BREAK_END:31,PAR_OVER_START:32,BIDIRECTIONAL_SOLID:33,BIDIRECTIONAL_DOTTED:34};var p={FILLED:0,OPEN:1};var g={LEFTOF:0,RIGHTOF:1,OVER:2};var u=class{constructor(){this.state=new r.m((()=>({prevActor:void 0,actors:new Map,createdActors:new Map,destroyedActors:new Map,boxes:[],messages:[],notes:[],sequenceNumbersEnabled:false,wrapEnabled:void 0,currentBox:void 0,lastCreated:void 0,lastDestroyed:void 0})));this.setAccTitle=n.SV;this.setAccDescription=n.EI;this.setDiagramTitle=n.ke;this.getAccTitle=n.iN;this.getAccDescription=n.m7;this.getDiagramTitle=n.ab;this.apply=this.apply.bind(this);this.parseBoxData=this.parseBoxData.bind(this);this.parseMessage=this.parseMessage.bind(this);this.clear();this.setWrap((0,n.D7)().wrap);this.LINETYPE=h;this.ARROWTYPE=p;this.PLACEMENT=g}static{(0,n.K2)(this,"SequenceDB")}addBox(t){this.state.records.boxes.push({name:t.text,wrap:t.wrap??this.autoWrap(),fill:t.color,actorKeys:[]});this.state.records.currentBox=this.state.records.boxes.slice(-1)[0]}addActor(t,e,a,s){let r=this.state.records.currentBox;const i=this.state.records.actors.get(t);if(i){if(this.state.records.currentBox&&i.box&&this.state.records.currentBox!==i.box){throw new Error(`A same participant should only be defined in one Box: ${i.name} can't be in '${i.box.name}' and in '${this.state.records.currentBox.name}' at the same time.`)}r=i.box?i.box:this.state.records.currentBox;i.box=r;if(i&&e===i.name&&a==null){return}}if(a?.text==null){a={text:e,type:s}}if(s==null||a.text==null){a={text:e,type:s}}this.state.records.actors.set(t,{box:r,name:e,description:a.text,wrap:a.wrap??this.autoWrap(),prevActor:this.state.records.prevActor,links:{},properties:{},actorCnt:null,rectData:null,type:s??"participant"});if(this.state.records.prevActor){const e=this.state.records.actors.get(this.state.records.prevActor);if(e){e.nextActor=t}}if(this.state.records.currentBox){this.state.records.currentBox.actorKeys.push(t)}this.state.records.prevActor=t}activationCount(t){let e;let a=0;if(!t){return 0}for(e=0;e>-",token:"->>-",line:"1",loc:{first_line:1,last_line:1,first_column:1,last_column:1},expected:["'ACTIVE_PARTICIPANT'"]};throw e}}this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:t,to:e,message:a?.text??"",wrap:a?.wrap??this.autoWrap(),type:s,activate:r});return true}hasAtLeastOneBox(){return this.state.records.boxes.length>0}hasAtLeastOneBoxWithTitle(){return this.state.records.boxes.some((t=>t.name))}getMessages(){return this.state.records.messages}getBoxes(){return this.state.records.boxes}getActors(){return this.state.records.actors}getCreatedActors(){return this.state.records.createdActors}getDestroyedActors(){return this.state.records.destroyedActors}getActor(t){return this.state.records.actors.get(t)}getActorKeys(){return[...this.state.records.actors.keys()]}enableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=true}disableSequenceNumbers(){this.state.records.sequenceNumbersEnabled=false}showSequenceNumbers(){return this.state.records.sequenceNumbersEnabled}setWrap(t){this.state.records.wrapEnabled=t}extractWrap(t){if(t===void 0){return{}}t=t.trim();const e=/^:?wrap:/.exec(t)!==null?true:/^:?nowrap:/.exec(t)!==null?false:void 0;const a=(e===void 0?t:t.replace(/^:?(?:no)?wrap:/,"")).trim();return{cleanedText:a,wrap:e}}autoWrap(){if(this.state.records.wrapEnabled!==void 0){return this.state.records.wrapEnabled}return(0,n.D7)().sequence?.wrap??false}clear(){this.state.reset();(0,n.IU)()}parseMessage(t){const e=t.trim();const{wrap:a,cleanedText:s}=this.extractWrap(e);const r={text:s,wrap:a};n.Rm.debug(`parseMessage: ${JSON.stringify(r)}`);return r}parseBoxData(t){const e=/^((?:rgba?|hsla?)\s*\(.*\)|\w*)(.*)$/.exec(t);let a=e?.[1]?e[1].trim():"transparent";let s=e?.[2]?e[2].trim():void 0;if(window?.CSS){if(!window.CSS.supports("color",a)){a="transparent";s=t.trim()}}else{const e=(new Option).style;e.color=a;if(e.color!==a){a="transparent";s=t.trim()}}const{wrap:r,cleanedText:i}=this.extractWrap(s);return{text:i?(0,n.jZ)(i,(0,n.D7)()):void 0,color:a,wrap:r}}addNote(t,e,a){const s={actor:t,placement:e,message:a.text,wrap:a.wrap??this.autoWrap()};const r=[].concat(t,t);this.state.records.notes.push(s);this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:r[0],to:r[1],message:a.text,wrap:a.wrap??this.autoWrap(),type:this.LINETYPE.NOTE,placement:e})}addLinks(t,e){const a=this.getActor(t);try{let t=(0,n.jZ)(e.text,(0,n.D7)());t=t.replace(/=/g,"=");t=t.replace(/&/g,"&");const s=JSON.parse(t);this.insertLinks(a,s)}catch(s){n.Rm.error("error while parsing actor link text",s)}}addALink(t,e){const a=this.getActor(t);try{const t={};let s=(0,n.jZ)(e.text,(0,n.D7)());const r=s.indexOf("@");s=s.replace(/=/g,"=");s=s.replace(/&/g,"&");const i=s.slice(0,r-1).trim();const o=s.slice(r+1).trim();t[i]=o;this.insertLinks(a,t)}catch(s){n.Rm.error("error while parsing actor link text",s)}}insertLinks(t,e){if(t.links==null){t.links=e}else{for(const a in e){t.links[a]=e[a]}}}addProperties(t,e){const a=this.getActor(t);try{const t=(0,n.jZ)(e.text,(0,n.D7)());const s=JSON.parse(t);this.insertProperties(a,s)}catch(s){n.Rm.error("error while parsing actor properties text",s)}}insertProperties(t,e){if(t.properties==null){t.properties=e}else{for(const a in e){t.properties[a]=e[a]}}}boxEnd(){this.state.records.currentBox=void 0}addDetails(t,e){const a=this.getActor(t);const s=document.getElementById(e.text);try{const t=s.innerHTML;const e=JSON.parse(t);if(e.properties){this.insertProperties(a,e.properties)}if(e.links){this.insertLinks(a,e.links)}}catch(r){n.Rm.error("error while parsing actor details text",r)}}getActorProperty(t,e){if(t?.properties!==void 0){return t.properties[e]}return void 0}apply(t){if(Array.isArray(t)){t.forEach((t=>{this.apply(t)}))}else{switch(t.type){case"sequenceIndex":this.state.records.messages.push({id:this.state.records.messages.length.toString(),from:void 0,to:void 0,message:{start:t.sequenceIndex,step:t.sequenceIndexStep,visible:t.sequenceVisible},wrap:false,type:t.signalType});break;case"addParticipant":this.addActor(t.actor,t.actor,t.description,t.draw);break;case"createParticipant":if(this.state.records.actors.has(t.actor)){throw new Error("It is not possible to have actors with the same id, even if one is destroyed before the next is created. Use 'AS' aliases to simulate the behavior")}this.state.records.lastCreated=t.actor;this.addActor(t.actor,t.actor,t.description,t.draw);this.state.records.createdActors.set(t.actor,this.state.records.messages.length);break;case"destroyParticipant":this.state.records.lastDestroyed=t.actor;this.state.records.destroyedActors.set(t.actor,this.state.records.messages.length);break;case"activeStart":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"activeEnd":this.addSignal(t.actor,void 0,void 0,t.signalType);break;case"addNote":this.addNote(t.actor,t.placement,t.text);break;case"addLinks":this.addLinks(t.actor,t.text);break;case"addALink":this.addALink(t.actor,t.text);break;case"addProperties":this.addProperties(t.actor,t.text);break;case"addDetails":this.addDetails(t.actor,t.text);break;case"addMessage":if(this.state.records.lastCreated){if(t.to!==this.state.records.lastCreated){throw new Error("The created participant "+this.state.records.lastCreated.name+" does not have an associated creating message after its declaration. Please check the sequence diagram.")}else{this.state.records.lastCreated=void 0}}else if(this.state.records.lastDestroyed){if(t.to!==this.state.records.lastDestroyed&&t.from!==this.state.records.lastDestroyed){throw new Error("The destroyed participant "+this.state.records.lastDestroyed.name+" does not have an associated destroying message after its declaration. Please check the sequence diagram.")}else{this.state.records.lastDestroyed=void 0}}this.addSignal(t.from,t.to,t.msg,t.signalType,t.activate);break;case"boxStart":this.addBox(t.boxData);break;case"boxEnd":this.boxEnd();break;case"loopStart":this.addSignal(void 0,void 0,t.loopText,t.signalType);break;case"loopEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"rectStart":this.addSignal(void 0,void 0,t.color,t.signalType);break;case"rectEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"optStart":this.addSignal(void 0,void 0,t.optText,t.signalType);break;case"optEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"altStart":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"else":this.addSignal(void 0,void 0,t.altText,t.signalType);break;case"altEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"setAccTitle":(0,n.SV)(t.text);break;case"parStart":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"and":this.addSignal(void 0,void 0,t.parText,t.signalType);break;case"parEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"criticalStart":this.addSignal(void 0,void 0,t.criticalText,t.signalType);break;case"option":this.addSignal(void 0,void 0,t.optionText,t.signalType);break;case"criticalEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break;case"breakStart":this.addSignal(void 0,void 0,t.breakText,t.signalType);break;case"breakEnd":this.addSignal(void 0,void 0,void 0,t.signalType);break}}}getConfig(){return(0,n.D7)().sequence}};var f=(0,n.K2)((t=>`.actor {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n\n text.actor > tspan {\n fill: ${t.actorTextColor};\n stroke: none;\n }\n\n .actor-line {\n stroke: ${t.actorLineColor};\n }\n\n .messageLine0 {\n stroke-width: 1.5;\n stroke-dasharray: none;\n stroke: ${t.signalColor};\n }\n\n .messageLine1 {\n stroke-width: 1.5;\n stroke-dasharray: 2, 2;\n stroke: ${t.signalColor};\n }\n\n #arrowhead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .sequenceNumber {\n fill: ${t.sequenceNumberColor};\n }\n\n #sequencenumber {\n fill: ${t.signalColor};\n }\n\n #crosshead path {\n fill: ${t.signalColor};\n stroke: ${t.signalColor};\n }\n\n .messageText {\n fill: ${t.signalTextColor};\n stroke: none;\n }\n\n .labelBox {\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBkgColor};\n }\n\n .labelText, .labelText > tspan {\n fill: ${t.labelTextColor};\n stroke: none;\n }\n\n .loopText, .loopText > tspan {\n fill: ${t.loopTextColor};\n stroke: none;\n }\n\n .loopLine {\n stroke-width: 2px;\n stroke-dasharray: 2, 2;\n stroke: ${t.labelBoxBorderColor};\n fill: ${t.labelBoxBorderColor};\n }\n\n .note {\n //stroke: #decc93;\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n }\n\n .noteText, .noteText > tspan {\n fill: ${t.noteTextColor};\n stroke: none;\n }\n\n .activation0 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation1 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .activation2 {\n fill: ${t.activationBkgColor};\n stroke: ${t.activationBorderColor};\n }\n\n .actorPopupMenu {\n position: absolute;\n }\n\n .actorPopupMenuPanel {\n position: absolute;\n fill: ${t.actorBkg};\n box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);\n filter: drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));\n}\n .actor-man line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n }\n .actor-man circle, line {\n stroke: ${t.actorBorder};\n fill: ${t.actorBkg};\n stroke-width: 2px;\n }\n`),"getStyles");var x=f;var y=18*2;var b="actor-top";var m="actor-bottom";var T="actor-box";var E="actor-man";var w=(0,n.K2)((function(t,e){return(0,s.tk)(t,e)}),"drawRect");var v=(0,n.K2)((function(t,e,a,s,r){if(e.links===void 0||e.links===null||Object.keys(e.links).length===0){return{height:0,width:0}}const i=e.links;const n=e.actorCnt;const o=e.rectData;var l="none";if(r){l="block !important"}const d=t.append("g");d.attr("id","actor"+n+"_popup");d.attr("class","actorPopupMenu");d.attr("display",l);var h="";if(o.class!==void 0){h=" "+o.class}let p=o.width>a?o.width:a;const g=d.append("rect");g.attr("class","actorPopupMenuPanel"+h);g.attr("x",o.x);g.attr("y",o.height);g.attr("fill",o.fill);g.attr("stroke",o.stroke);g.attr("width",p);g.attr("height",o.height);g.attr("rx",o.rx);g.attr("ry",o.ry);if(i!=null){var u=20;for(let t in i){var f=d.append("a");var x=(0,c.J)(i[t]);f.attr("xlink:href",x);f.attr("target","_blank");U(s)(t,f,o.x+10,o.height+u,p,20,{class:"actor"},s);u+=30}}g.attr("height",u);return{height:o.height+u,width:p}}),"drawPopup");var k=(0,n.K2)((function(t){return"var pu = document.getElementById('"+t+"'); if (pu != null) { pu.style.display = pu.style.display == 'block' ? 'none' : 'block'; }"}),"popupMenuToggle");var I=(0,n.K2)((async function(t,e,a=null){let s=t.append("foreignObject");const r=await(0,n.VJ)(e.text,(0,n.zj)());const i=s.append("xhtml:div").attr("style","width: fit-content;").attr("xmlns","http://www.w3.org/1999/xhtml").html(r);const o=i.node().getBoundingClientRect();s.attr("height",Math.round(o.height)).attr("width",Math.round(o.width));if(e.class==="noteText"){const a=t.node().firstChild;a.setAttribute("height",o.height+2*e.textMargin);const r=a.getBBox();s.attr("x",Math.round(r.x+r.width/2-o.width/2)).attr("y",Math.round(r.y+r.height/2-o.height/2))}else if(a){let{startx:t,stopx:r,starty:i}=a;if(t>r){const e=t;t=r;r=e}s.attr("x",Math.round(t+Math.abs(t-r)/2-o.width/2));if(e.class==="loopText"){s.attr("y",Math.round(i))}else{s.attr("y",Math.round(i-o.height))}}return[s]}),"drawKatex");var L=(0,n.K2)((function(t,e){let a=0;let s=0;const r=e.text.split(n.Y2.lineBreakRegex);const[o,c]=(0,i.I5)(e.fontSize);let l=[];let d=0;let h=(0,n.K2)((()=>e.y),"yfunc");if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0){switch(e.valign){case"top":case"start":h=(0,n.K2)((()=>Math.round(e.y+e.textMargin)),"yfunc");break;case"middle":case"center":h=(0,n.K2)((()=>Math.round(e.y+(a+s+e.textMargin)/2)),"yfunc");break;case"bottom":case"end":h=(0,n.K2)((()=>Math.round(e.y+(a+s+2*e.textMargin)-e.textMargin)),"yfunc");break}}if(e.anchor!==void 0&&e.textMargin!==void 0&&e.width!==void 0){switch(e.anchor){case"left":case"start":e.x=Math.round(e.x+e.textMargin);e.anchor="start";e.dominantBaseline="middle";e.alignmentBaseline="middle";break;case"middle":case"center":e.x=Math.round(e.x+e.width/2);e.anchor="middle";e.dominantBaseline="middle";e.alignmentBaseline="middle";break;case"right":case"end":e.x=Math.round(e.x+e.width-e.textMargin);e.anchor="end";e.dominantBaseline="middle";e.alignmentBaseline="middle";break}}for(let[n,p]of r.entries()){if(e.textMargin!==void 0&&e.textMargin===0&&o!==void 0){d=n*o}const r=t.append("text");r.attr("x",e.x);r.attr("y",h());if(e.anchor!==void 0){r.attr("text-anchor",e.anchor).attr("dominant-baseline",e.dominantBaseline).attr("alignment-baseline",e.alignmentBaseline)}if(e.fontFamily!==void 0){r.style("font-family",e.fontFamily)}if(c!==void 0){r.style("font-size",c)}if(e.fontWeight!==void 0){r.style("font-weight",e.fontWeight)}if(e.fill!==void 0){r.attr("fill",e.fill)}if(e.class!==void 0){r.attr("class",e.class)}if(e.dy!==void 0){r.attr("dy",e.dy)}else if(d!==0){r.attr("dy",d)}const g=p||i.pe;if(e.tspan){const t=r.append("tspan");t.attr("x",e.x);if(e.fill!==void 0){t.attr("fill",e.fill)}t.text(g)}else{r.text(g)}if(e.valign!==void 0&&e.textMargin!==void 0&&e.textMargin>0){s+=(r._groups||r)[0][0].getBBox().height;a=s}l.push(r)}return l}),"drawText");var _=(0,n.K2)((function(t,e){function a(t,e,a,s,r){return t+","+e+" "+(t+a)+","+e+" "+(t+a)+","+(e+s-r)+" "+(t+a-r*1.2)+","+(e+s)+" "+t+","+(e+s)}(0,n.K2)(a,"genPoints");const s=t.append("polygon");s.attr("points",a(e.x,e.y,e.width,e.height,7));s.attr("class","labelBox");e.y=e.y+e.height/2;L(t,e);return s}),"drawLabel");var P=-1;var A=(0,n.K2)(((t,e,a,s)=>{if(!t.select){return}a.forEach((a=>{const r=e.get(a);const i=t.select("#actor"+r.actorCnt);if(!s.mirrorActors&&r.stopy){i.attr("y2",r.stopy+r.height/2)}else if(s.mirrorActors){i.attr("y2",r.stopy)}}))}),"fixLifeLineHeights");var N=(0,n.K2)((function(t,e,a,r){const i=r?e.stopy:e.starty;const o=e.x+e.width/2;const c=i+e.height;const l=t.append("g").lower();var d=l;if(!r){P++;if(Object.keys(e.links||{}).length&&!a.forceMenus){d.attr("onclick",k(`actor${P}_popup`)).attr("cursor","pointer")}d.append("line").attr("id","actor"+P).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name);d=l.append("g");e.actorCnt=P;if(e.links!=null){d.attr("id","root-"+P)}}const h=(0,s.PB)();var p="actor";if(e.properties?.class){p=e.properties.class}else{h.fill="#eaeaea"}if(r){p+=` ${m}`}else{p+=` ${b}`}h.x=e.x;h.y=i;h.width=e.width;h.height=e.height;h.class=p;h.rx=3;h.ry=3;h.name=e.name;const g=w(d,h);e.rectData=h;if(e.properties?.icon){const t=e.properties.icon.trim();if(t.charAt(0)==="@"){(0,s.CP)(d,h.x+h.width-20,h.y+10,t.substr(1))}else{(0,s.aC)(d,h.x+h.width-20,h.y+10,t)}}j(a,(0,n.Wi)(e.description))(e.description,d,h.x,h.y,h.width,h.height,{class:`actor ${T}`},a);let u=e.height;if(g.node){const t=g.node().getBBox();e.height=t.height;u=t.height}return u}),"drawActorTypeParticipant");var M=(0,n.K2)((function(t,e,a,r){const i=r?e.stopy:e.starty;const o=e.x+e.width/2;const c=i+80;const l=t.append("g").lower();if(!r){P++;l.append("line").attr("id","actor"+P).attr("x1",o).attr("y1",c).attr("x2",o).attr("y2",2e3).attr("class","actor-line 200").attr("stroke-width","0.5px").attr("stroke","#999").attr("name",e.name);e.actorCnt=P}const d=t.append("g");let h=E;if(r){h+=` ${m}`}else{h+=` ${b}`}d.attr("class",h);d.attr("name",e.name);const p=(0,s.PB)();p.x=e.x;p.y=i;p.fill="#eaeaea";p.width=e.width;p.height=e.height;p.class="actor";p.rx=3;p.ry=3;d.append("line").attr("id","actor-man-torso"+P).attr("x1",o).attr("y1",i+25).attr("x2",o).attr("y2",i+45);d.append("line").attr("id","actor-man-arms"+P).attr("x1",o-y/2).attr("y1",i+33).attr("x2",o+y/2).attr("y2",i+33);d.append("line").attr("x1",o-y/2).attr("y1",i+60).attr("x2",o).attr("y2",i+45);d.append("line").attr("x1",o).attr("y1",i+45).attr("x2",o+y/2-2).attr("y2",i+60);const g=d.append("circle");g.attr("cx",e.x+e.width/2);g.attr("cy",i+10);g.attr("r",15);g.attr("width",e.width);g.attr("height",e.height);const u=d.node().getBBox();e.height=u.height;j(a,(0,n.Wi)(e.description))(e.description,d,p.x,p.y+35,p.width,p.height,{class:`actor ${E}`},a);return e.height}),"drawActorTypeActor");var D=(0,n.K2)((async function(t,e,a,s){switch(e.type){case"actor":return await M(t,e,a,s);case"participant":return await N(t,e,a,s)}}),"drawActor");var S=(0,n.K2)((function(t,e,a){const s=t.append("g");const r=s;K(r,e);if(e.name){j(a)(e.name,r,e.x,e.y+(e.textMaxHeight||0)/2,e.width,0,{class:"text"},a)}r.lower()}),"drawBox");var O=(0,n.K2)((function(t){return t.append("g")}),"anchorElement");var R=(0,n.K2)((function(t,e,a,r,i){const n=(0,s.PB)();const o=e.anchored;n.x=e.startx;n.y=e.starty;n.class="activation"+i%3;n.width=e.stopx-e.startx;n.height=a-e.starty;w(o,n)}),"drawActivation");var Y=(0,n.K2)((async function(t,e,a,r){const{boxMargin:i,boxTextMargin:o,labelBoxHeight:c,labelBoxWidth:l,messageFontFamily:d,messageFontSize:h,messageFontWeight:p}=r;const g=t.append("g");const u=(0,n.K2)((function(t,e,a,s){return g.append("line").attr("x1",t).attr("y1",e).attr("x2",a).attr("y2",s).attr("class","loopLine")}),"drawLoopLine");u(e.startx,e.starty,e.stopx,e.starty);u(e.stopx,e.starty,e.stopx,e.stopy);u(e.startx,e.stopy,e.stopx,e.stopy);u(e.startx,e.starty,e.startx,e.stopy);if(e.sections!==void 0){e.sections.forEach((function(t){u(e.startx,t.y,e.stopx,t.y).style("stroke-dasharray","3, 3")}))}let f=(0,s.HT)();f.text=a;f.x=e.startx;f.y=e.starty;f.fontFamily=d;f.fontSize=h;f.fontWeight=p;f.anchor="middle";f.valign="middle";f.tspan=false;f.width=l||50;f.height=c||20;f.textMargin=o;f.class="labelText";_(g,f);f=z();f.text=e.title;f.x=e.startx+l/2+(e.stopx-e.startx)/2;f.y=e.starty+i+o;f.anchor="middle";f.valign="middle";f.textMargin=o;f.class="loopText";f.fontFamily=d;f.fontSize=h;f.fontWeight=p;f.wrap=true;let x=(0,n.Wi)(f.text)?await I(g,f,e):L(g,f);if(e.sectionTitles!==void 0){for(const[t,a]of Object.entries(e.sectionTitles)){if(a.message){f.text=a.message;f.x=e.startx+(e.stopx-e.startx)/2;f.y=e.sections[t].y+i+o;f.class="loopText";f.anchor="middle";f.valign="middle";f.tspan=false;f.fontFamily=d;f.fontSize=h;f.fontWeight=p;f.wrap=e.wrap;if((0,n.Wi)(f.text)){e.starty=e.sections[t].y;await I(g,f,e)}else{L(g,f)}let s=Math.round(x.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));e.sections[t].height+=s-(i+o)}}}e.height=Math.round(e.stopy-e.starty);return g}),"drawLoop");var K=(0,n.K2)((function(t,e){(0,s.lC)(t,e)}),"drawBackgroundRect");var C=(0,n.K2)((function(t){t.append("defs").append("symbol").attr("id","database").attr("fill-rule","evenodd").attr("clip-rule","evenodd").append("path").attr("transform","scale(.5)").attr("d","M12.258.001l.256.004.255.005.253.008.251.01.249.012.247.015.246.016.242.019.241.02.239.023.236.024.233.027.231.028.229.031.225.032.223.034.22.036.217.038.214.04.211.041.208.043.205.045.201.046.198.048.194.05.191.051.187.053.183.054.18.056.175.057.172.059.168.06.163.061.16.063.155.064.15.066.074.033.073.033.071.034.07.034.069.035.068.035.067.035.066.035.064.036.064.036.062.036.06.036.06.037.058.037.058.037.055.038.055.038.053.038.052.038.051.039.05.039.048.039.047.039.045.04.044.04.043.04.041.04.04.041.039.041.037.041.036.041.034.041.033.042.032.042.03.042.029.042.027.042.026.043.024.043.023.043.021.043.02.043.018.044.017.043.015.044.013.044.012.044.011.045.009.044.007.045.006.045.004.045.002.045.001.045v17l-.001.045-.002.045-.004.045-.006.045-.007.045-.009.044-.011.045-.012.044-.013.044-.015.044-.017.043-.018.044-.02.043-.021.043-.023.043-.024.043-.026.043-.027.042-.029.042-.03.042-.032.042-.033.042-.034.041-.036.041-.037.041-.039.041-.04.041-.041.04-.043.04-.044.04-.045.04-.047.039-.048.039-.05.039-.051.039-.052.038-.053.038-.055.038-.055.038-.058.037-.058.037-.06.037-.06.036-.062.036-.064.036-.064.036-.066.035-.067.035-.068.035-.069.035-.07.034-.071.034-.073.033-.074.033-.15.066-.155.064-.16.063-.163.061-.168.06-.172.059-.175.057-.18.056-.183.054-.187.053-.191.051-.194.05-.198.048-.201.046-.205.045-.208.043-.211.041-.214.04-.217.038-.22.036-.223.034-.225.032-.229.031-.231.028-.233.027-.236.024-.239.023-.241.02-.242.019-.246.016-.247.015-.249.012-.251.01-.253.008-.255.005-.256.004-.258.001-.258-.001-.256-.004-.255-.005-.253-.008-.251-.01-.249-.012-.247-.015-.245-.016-.243-.019-.241-.02-.238-.023-.236-.024-.234-.027-.231-.028-.228-.031-.226-.032-.223-.034-.22-.036-.217-.038-.214-.04-.211-.041-.208-.043-.204-.045-.201-.046-.198-.048-.195-.05-.19-.051-.187-.053-.184-.054-.179-.056-.176-.057-.172-.059-.167-.06-.164-.061-.159-.063-.155-.064-.151-.066-.074-.033-.072-.033-.072-.034-.07-.034-.069-.035-.068-.035-.067-.035-.066-.035-.064-.036-.063-.036-.062-.036-.061-.036-.06-.037-.058-.037-.057-.037-.056-.038-.055-.038-.053-.038-.052-.038-.051-.039-.049-.039-.049-.039-.046-.039-.046-.04-.044-.04-.043-.04-.041-.04-.04-.041-.039-.041-.037-.041-.036-.041-.034-.041-.033-.042-.032-.042-.03-.042-.029-.042-.027-.042-.026-.043-.024-.043-.023-.043-.021-.043-.02-.043-.018-.044-.017-.043-.015-.044-.013-.044-.012-.044-.011-.045-.009-.044-.007-.045-.006-.045-.004-.045-.002-.045-.001-.045v-17l.001-.045.002-.045.004-.045.006-.045.007-.045.009-.044.011-.045.012-.044.013-.044.015-.044.017-.043.018-.044.02-.043.021-.043.023-.043.024-.043.026-.043.027-.042.029-.042.03-.042.032-.042.033-.042.034-.041.036-.041.037-.041.039-.041.04-.041.041-.04.043-.04.044-.04.046-.04.046-.039.049-.039.049-.039.051-.039.052-.038.053-.038.055-.038.056-.038.057-.037.058-.037.06-.037.061-.036.062-.036.063-.036.064-.036.066-.035.067-.035.068-.035.069-.035.07-.034.072-.034.072-.033.074-.033.151-.066.155-.064.159-.063.164-.061.167-.06.172-.059.176-.057.179-.056.184-.054.187-.053.19-.051.195-.05.198-.048.201-.046.204-.045.208-.043.211-.041.214-.04.217-.038.22-.036.223-.034.226-.032.228-.031.231-.028.234-.027.236-.024.238-.023.241-.02.243-.019.245-.016.247-.015.249-.012.251-.01.253-.008.255-.005.256-.004.258-.001.258.001zm-9.258 20.499v.01l.001.021.003.021.004.022.005.021.006.022.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.023.018.024.019.024.021.024.022.025.023.024.024.025.052.049.056.05.061.051.066.051.07.051.075.051.079.052.084.052.088.052.092.052.097.052.102.051.105.052.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.048.144.049.147.047.152.047.155.047.16.045.163.045.167.043.171.043.176.041.178.041.183.039.187.039.19.037.194.035.197.035.202.033.204.031.209.03.212.029.216.027.219.025.222.024.226.021.23.02.233.018.236.016.24.015.243.012.246.01.249.008.253.005.256.004.259.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.021.224-.024.22-.026.216-.027.212-.028.21-.031.205-.031.202-.034.198-.034.194-.036.191-.037.187-.039.183-.04.179-.04.175-.042.172-.043.168-.044.163-.045.16-.046.155-.046.152-.047.148-.048.143-.049.139-.049.136-.05.131-.05.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.053.083-.051.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.05.023-.024.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.023.01-.022.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.127l-.077.055-.08.053-.083.054-.085.053-.087.052-.09.052-.093.051-.095.05-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.045-.118.044-.12.043-.122.042-.124.042-.126.041-.128.04-.13.04-.132.038-.134.038-.135.037-.138.037-.139.035-.142.035-.143.034-.144.033-.147.032-.148.031-.15.03-.151.03-.153.029-.154.027-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.01-.179.008-.179.008-.181.006-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.006-.179-.008-.179-.008-.178-.01-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.027-.153-.029-.151-.03-.15-.03-.148-.031-.146-.032-.145-.033-.143-.034-.141-.035-.14-.035-.137-.037-.136-.037-.134-.038-.132-.038-.13-.04-.128-.04-.126-.041-.124-.042-.122-.042-.12-.044-.117-.043-.116-.045-.113-.045-.112-.046-.109-.047-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.05-.093-.052-.09-.051-.087-.052-.085-.053-.083-.054-.08-.054-.077-.054v4.127zm0-5.654v.011l.001.021.003.021.004.021.005.022.006.022.007.022.009.022.01.022.011.023.012.023.013.023.015.024.016.023.017.024.018.024.019.024.021.024.022.024.023.025.024.024.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.052.11.051.114.051.119.052.123.05.127.051.131.05.135.049.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.044.171.042.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.022.23.02.233.018.236.016.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.012.241-.015.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.048.139-.05.136-.049.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.051.051-.049.023-.025.023-.024.021-.025.02-.024.019-.024.018-.024.017-.024.015-.023.014-.023.013-.024.012-.022.01-.023.01-.023.008-.022.006-.022.006-.022.004-.021.004-.022.001-.021.001-.021v-4.139l-.077.054-.08.054-.083.054-.085.052-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.049-.105.048-.106.047-.109.047-.111.046-.114.045-.115.044-.118.044-.12.044-.122.042-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.035-.143.033-.144.033-.147.033-.148.031-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.025-.161.024-.162.023-.163.022-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.011-.178.009-.179.009-.179.007-.181.007-.182.005-.182.004-.184.003-.184.002h-.37l-.184-.002-.184-.003-.182-.004-.182-.005-.181-.007-.179-.007-.179-.009-.178-.009-.176-.011-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.022-.162-.023-.161-.024-.159-.025-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.031-.146-.033-.145-.033-.143-.033-.141-.035-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.04-.126-.041-.124-.042-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.047-.105-.048-.102-.049-.1-.049-.097-.05-.095-.051-.093-.051-.09-.051-.087-.053-.085-.052-.083-.054-.08-.054-.077-.054v4.139zm0-5.666v.011l.001.02.003.022.004.021.005.022.006.021.007.022.009.023.01.022.011.023.012.023.013.023.015.023.016.024.017.024.018.023.019.024.021.025.022.024.023.024.024.025.052.05.056.05.061.05.066.051.07.051.075.052.079.051.084.052.088.052.092.052.097.052.102.052.105.051.11.052.114.051.119.051.123.051.127.05.131.05.135.05.139.049.144.048.147.048.152.047.155.046.16.045.163.045.167.043.171.043.176.042.178.04.183.04.187.038.19.037.194.036.197.034.202.033.204.032.209.03.212.028.216.027.219.025.222.024.226.021.23.02.233.018.236.017.24.014.243.012.246.01.249.008.253.006.256.003.259.001.26-.001.257-.003.254-.006.25-.008.247-.01.244-.013.241-.014.237-.016.233-.018.231-.02.226-.022.224-.024.22-.025.216-.027.212-.029.21-.03.205-.032.202-.033.198-.035.194-.036.191-.037.187-.039.183-.039.179-.041.175-.042.172-.043.168-.044.163-.045.16-.045.155-.047.152-.047.148-.048.143-.049.139-.049.136-.049.131-.051.126-.05.123-.051.118-.052.114-.051.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.052.07-.051.065-.051.06-.051.056-.05.051-.049.023-.025.023-.025.021-.024.02-.024.019-.024.018-.024.017-.024.015-.023.014-.024.013-.023.012-.023.01-.022.01-.023.008-.022.006-.022.006-.022.004-.022.004-.021.001-.021.001-.021v-4.153l-.077.054-.08.054-.083.053-.085.053-.087.053-.09.051-.093.051-.095.051-.097.05-.1.049-.102.048-.105.048-.106.048-.109.046-.111.046-.114.046-.115.044-.118.044-.12.043-.122.043-.124.042-.126.041-.128.04-.13.039-.132.039-.134.038-.135.037-.138.036-.139.036-.142.034-.143.034-.144.033-.147.032-.148.032-.15.03-.151.03-.153.028-.154.028-.156.027-.158.026-.159.024-.161.024-.162.023-.163.023-.165.021-.166.02-.167.019-.169.018-.169.017-.171.016-.173.015-.173.014-.175.013-.175.012-.177.01-.178.01-.179.009-.179.007-.181.006-.182.006-.182.004-.184.003-.184.001-.185.001-.185-.001-.184-.001-.184-.003-.182-.004-.182-.006-.181-.006-.179-.007-.179-.009-.178-.01-.176-.01-.176-.012-.175-.013-.173-.014-.172-.015-.171-.016-.17-.017-.169-.018-.167-.019-.166-.02-.165-.021-.163-.023-.162-.023-.161-.024-.159-.024-.157-.026-.156-.027-.155-.028-.153-.028-.151-.03-.15-.03-.148-.032-.146-.032-.145-.033-.143-.034-.141-.034-.14-.036-.137-.036-.136-.037-.134-.038-.132-.039-.13-.039-.128-.041-.126-.041-.124-.041-.122-.043-.12-.043-.117-.044-.116-.044-.113-.046-.112-.046-.109-.046-.106-.048-.105-.048-.102-.048-.1-.05-.097-.049-.095-.051-.093-.051-.09-.052-.087-.052-.085-.053-.083-.053-.08-.054-.077-.054v4.153zm8.74-8.179l-.257.004-.254.005-.25.008-.247.011-.244.012-.241.014-.237.016-.233.018-.231.021-.226.022-.224.023-.22.026-.216.027-.212.028-.21.031-.205.032-.202.033-.198.034-.194.036-.191.038-.187.038-.183.04-.179.041-.175.042-.172.043-.168.043-.163.045-.16.046-.155.046-.152.048-.148.048-.143.048-.139.049-.136.05-.131.05-.126.051-.123.051-.118.051-.114.052-.11.052-.106.052-.101.052-.096.052-.092.052-.088.052-.083.052-.079.052-.074.051-.07.052-.065.051-.06.05-.056.05-.051.05-.023.025-.023.024-.021.024-.02.025-.019.024-.018.024-.017.023-.015.024-.014.023-.013.023-.012.023-.01.023-.01.022-.008.022-.006.023-.006.021-.004.022-.004.021-.001.021-.001.021.001.021.001.021.004.021.004.022.006.021.006.023.008.022.01.022.01.023.012.023.013.023.014.023.015.024.017.023.018.024.019.024.02.025.021.024.023.024.023.025.051.05.056.05.06.05.065.051.07.052.074.051.079.052.083.052.088.052.092.052.096.052.101.052.106.052.11.052.114.052.118.051.123.051.126.051.131.05.136.05.139.049.143.048.148.048.152.048.155.046.16.046.163.045.168.043.172.043.175.042.179.041.183.04.187.038.191.038.194.036.198.034.202.033.205.032.21.031.212.028.216.027.22.026.224.023.226.022.231.021.233.018.237.016.241.014.244.012.247.011.25.008.254.005.257.004.26.001.26-.001.257-.004.254-.005.25-.008.247-.011.244-.012.241-.014.237-.016.233-.018.231-.021.226-.022.224-.023.22-.026.216-.027.212-.028.21-.031.205-.032.202-.033.198-.034.194-.036.191-.038.187-.038.183-.04.179-.041.175-.042.172-.043.168-.043.163-.045.16-.046.155-.046.152-.048.148-.048.143-.048.139-.049.136-.05.131-.05.126-.051.123-.051.118-.051.114-.052.11-.052.106-.052.101-.052.096-.052.092-.052.088-.052.083-.052.079-.052.074-.051.07-.052.065-.051.06-.05.056-.05.051-.05.023-.025.023-.024.021-.024.02-.025.019-.024.018-.024.017-.023.015-.024.014-.023.013-.023.012-.023.01-.023.01-.022.008-.022.006-.023.006-.021.004-.022.004-.021.001-.021.001-.021-.001-.021-.001-.021-.004-.021-.004-.022-.006-.021-.006-.023-.008-.022-.01-.022-.01-.023-.012-.023-.013-.023-.014-.023-.015-.024-.017-.023-.018-.024-.019-.024-.02-.025-.021-.024-.023-.024-.023-.025-.051-.05-.056-.05-.06-.05-.065-.051-.07-.052-.074-.051-.079-.052-.083-.052-.088-.052-.092-.052-.096-.052-.101-.052-.106-.052-.11-.052-.114-.052-.118-.051-.123-.051-.126-.051-.131-.05-.136-.05-.139-.049-.143-.048-.148-.048-.152-.048-.155-.046-.16-.046-.163-.045-.168-.043-.172-.043-.175-.042-.179-.041-.183-.04-.187-.038-.191-.038-.194-.036-.198-.034-.202-.033-.205-.032-.21-.031-.212-.028-.216-.027-.22-.026-.224-.023-.226-.022-.231-.021-.233-.018-.237-.016-.241-.014-.244-.012-.247-.011-.25-.008-.254-.005-.257-.004-.26-.001-.26.001z")}),"insertDatabaseIcon");var B=(0,n.K2)((function(t){t.append("defs").append("symbol").attr("id","computer").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M2 2v13h20v-13h-20zm18 11h-16v-9h16v9zm-10.228 6l.466-1h3.524l.467 1h-4.457zm14.228 3h-24l2-6h2.104l-1.33 4h18.45l-1.297-4h2.073l2 6zm-5-10h-14v-7h14v7z")}),"insertComputerIcon");var $=(0,n.K2)((function(t){t.append("defs").append("symbol").attr("id","clock").attr("width","24").attr("height","24").append("path").attr("transform","scale(.5)").attr("d","M12 2c5.514 0 10 4.486 10 10s-4.486 10-10 10-10-4.486-10-10 4.486-10 10-10zm0-2c-6.627 0-12 5.373-12 12s5.373 12 12 12 12-5.373 12-12-5.373-12-12-12zm5.848 12.459c.202.038.202.333.001.372-1.907.361-6.045 1.111-6.547 1.111-.719 0-1.301-.582-1.301-1.301 0-.512.77-5.447 1.125-7.445.034-.192.312-.181.343.014l.985 6.238 5.394 1.011z")}),"insertClockIcon");var V=(0,n.K2)((function(t){t.append("defs").append("marker").attr("id","arrowhead").attr("refX",7.9).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto-start-reverse").append("path").attr("d","M -1 0 L 10 5 L 0 10 z")}),"insertArrowHead");var F=(0,n.K2)((function(t){t.append("defs").append("marker").attr("id","filled-head").attr("refX",15.5).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")}),"insertArrowFilledHead");var W=(0,n.K2)((function(t){t.append("defs").append("marker").attr("id","sequencenumber").attr("refX",15).attr("refY",15).attr("markerWidth",60).attr("markerHeight",40).attr("orient","auto").append("circle").attr("cx",15).attr("cy",15).attr("r",6)}),"insertSequenceNumber");var q=(0,n.K2)((function(t){const e=t.append("defs");const a=e.append("marker").attr("id","crosshead").attr("markerWidth",15).attr("markerHeight",8).attr("orient","auto").attr("refX",4).attr("refY",4.5);a.append("path").attr("fill","none").attr("stroke","#000000").style("stroke-dasharray","0, 0").attr("stroke-width","1pt").attr("d","M 1,2 L 6,7 M 6,2 L 1,7")}),"insertArrowCrossHead");var z=(0,n.K2)((function(){return{x:0,y:0,fill:void 0,anchor:void 0,style:"#666",width:void 0,height:void 0,textMargin:0,rx:0,ry:0,tspan:true,valign:void 0}}),"getTextObj");var H=(0,n.K2)((function(){return{x:0,y:0,fill:"#EDF2AE",stroke:"#666",width:100,anchor:"start",height:100,rx:0,ry:0}}),"getNoteRect");var j=function(){function t(t,e,a,s,i,n,o){const c=e.append("text").attr("x",a+i/2).attr("y",s+n/2+5).style("text-anchor","middle").text(t);r(c,o)}(0,n.K2)(t,"byText");function e(t,e,a,s,o,c,l,d){const{actorFontSize:h,actorFontFamily:p,actorFontWeight:g}=d;const[u,f]=(0,i.I5)(h);const x=t.split(n.Y2.lineBreakRegex);for(let i=0;it.height||0)))+(this.loops.length===0?0:this.loops.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(this.messages.length===0?0:this.messages.map((t=>t.height||0)).reduce(((t,e)=>t+e)))+(this.notes.length===0?0:this.notes.map((t=>t.height||0)).reduce(((t,e)=>t+e)))}),"getHeight"),clear:(0,n.K2)((function(){this.actors=[];this.boxes=[];this.loops=[];this.messages=[];this.notes=[]}),"clear"),addBox:(0,n.K2)((function(t){this.boxes.push(t)}),"addBox"),addActor:(0,n.K2)((function(t){this.actors.push(t)}),"addActor"),addLoop:(0,n.K2)((function(t){this.loops.push(t)}),"addLoop"),addMessage:(0,n.K2)((function(t){this.messages.push(t)}),"addMessage"),addNote:(0,n.K2)((function(t){this.notes.push(t)}),"addNote"),lastActor:(0,n.K2)((function(){return this.actors[this.actors.length-1]}),"lastActor"),lastLoop:(0,n.K2)((function(){return this.loops[this.loops.length-1]}),"lastLoop"),lastMessage:(0,n.K2)((function(){return this.messages[this.messages.length-1]}),"lastMessage"),lastNote:(0,n.K2)((function(){return this.notes[this.notes.length-1]}),"lastNote"),actors:[],boxes:[],loops:[],messages:[],notes:[]},init:(0,n.K2)((function(){this.sequenceItems=[];this.activations=[];this.models.clear();this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0};this.verticalPos=0;ot((0,n.D7)())}),"init"),updateVal:(0,n.K2)((function(t,e,a,s){if(t[e]===void 0){t[e]=a}else{t[e]=s(a,t[e])}}),"updateVal"),updateBounds:(0,n.K2)((function(t,e,a,s){const r=this;let i=0;function o(o){return(0,n.K2)((function n(c){i++;const l=r.sequenceItems.length-i+1;r.updateVal(c,"starty",e-l*J.boxMargin,Math.min);r.updateVal(c,"stopy",s+l*J.boxMargin,Math.max);r.updateVal(G.data,"startx",t-l*J.boxMargin,Math.min);r.updateVal(G.data,"stopx",a+l*J.boxMargin,Math.max);if(!(o==="activation")){r.updateVal(c,"startx",t-l*J.boxMargin,Math.min);r.updateVal(c,"stopx",a+l*J.boxMargin,Math.max);r.updateVal(G.data,"starty",e-l*J.boxMargin,Math.min);r.updateVal(G.data,"stopy",s+l*J.boxMargin,Math.max)}}),"updateItemBounds")}(0,n.K2)(o,"updateFn");this.sequenceItems.forEach(o());this.activations.forEach(o("activation"))}),"updateBounds"),insert:(0,n.K2)((function(t,e,a,s){const r=n.Y2.getMin(t,a);const i=n.Y2.getMax(t,a);const o=n.Y2.getMin(e,s);const c=n.Y2.getMax(e,s);this.updateVal(G.data,"startx",r,Math.min);this.updateVal(G.data,"starty",o,Math.min);this.updateVal(G.data,"stopx",i,Math.max);this.updateVal(G.data,"stopy",c,Math.max);this.updateBounds(r,o,i,c)}),"insert"),newActivation:(0,n.K2)((function(t,e,a){const s=a.get(t.from);const r=ct(t.from).length||0;const i=s.x+s.width/2+(r-1)*J.activationWidth/2;this.activations.push({startx:i,starty:this.verticalPos+2,stopx:i+J.activationWidth,stopy:void 0,actor:t.from,anchored:X.anchorElement(e)})}),"newActivation"),endActivation:(0,n.K2)((function(t){const e=this.activations.map((function(t){return t.actor})).lastIndexOf(t.from);return this.activations.splice(e,1)[0]}),"endActivation"),createLoop:(0,n.K2)((function(t={message:void 0,wrap:false,width:void 0},e){return{startx:void 0,starty:this.verticalPos,stopx:void 0,stopy:void 0,title:t.message,wrap:t.wrap,width:t.width,height:0,fill:e}}),"createLoop"),newLoop:(0,n.K2)((function(t={message:void 0,wrap:false,width:void 0},e){this.sequenceItems.push(this.createLoop(t,e))}),"newLoop"),endLoop:(0,n.K2)((function(){return this.sequenceItems.pop()}),"endLoop"),isLoopOverlap:(0,n.K2)((function(){return this.sequenceItems.length?this.sequenceItems[this.sequenceItems.length-1].overlap:false}),"isLoopOverlap"),addSectionToLoop:(0,n.K2)((function(t){const e=this.sequenceItems.pop();e.sections=e.sections||[];e.sectionTitles=e.sectionTitles||[];e.sections.push({y:G.getVerticalPos(),height:0});e.sectionTitles.push(t);this.sequenceItems.push(e)}),"addSectionToLoop"),saveVerticalPos:(0,n.K2)((function(){if(this.isLoopOverlap()){this.savedVerticalPos=this.verticalPos}}),"saveVerticalPos"),resetVerticalPos:(0,n.K2)((function(){if(this.isLoopOverlap()){this.verticalPos=this.savedVerticalPos}}),"resetVerticalPos"),bumpVerticalPos:(0,n.K2)((function(t){this.verticalPos=this.verticalPos+t;this.data.stopy=n.Y2.getMax(this.data.stopy,this.verticalPos)}),"bumpVerticalPos"),getVerticalPos:(0,n.K2)((function(){return this.verticalPos}),"getVerticalPos"),getBounds:(0,n.K2)((function(){return{bounds:this.data,models:this.models}}),"getBounds")};var Z=(0,n.K2)((async function(t,e){G.bumpVerticalPos(J.boxMargin);e.height=J.boxMargin;e.starty=G.getVerticalPos();const a=(0,s.PB)();a.x=e.startx;a.y=e.starty;a.width=e.width||J.width;a.class="note";const r=t.append("g");const i=X.drawRect(r,a);const o=(0,s.HT)();o.x=e.startx;o.y=e.starty;o.width=a.width;o.dy="1em";o.text=e.message;o.class="noteText";o.fontFamily=J.noteFontFamily;o.fontSize=J.noteFontSize;o.fontWeight=J.noteFontWeight;o.anchor=J.noteAlign;o.textMargin=J.noteMargin;o.valign="center";const c=(0,n.Wi)(o.text)?await I(r,o):L(r,o);const l=Math.round(c.map((t=>(t._groups||t)[0][0].getBBox().height)).reduce(((t,e)=>t+e)));i.attr("height",l+2*J.noteMargin);e.height+=l+2*J.noteMargin;G.bumpVerticalPos(l+2*J.noteMargin);e.stopy=e.starty+l+2*J.noteMargin;e.stopx=e.startx+a.width;G.insert(e.startx,e.starty,e.stopx,e.stopy);G.models.addNote(e)}),"drawNote");var Q=(0,n.K2)((t=>({fontFamily:t.messageFontFamily,fontSize:t.messageFontSize,fontWeight:t.messageFontWeight})),"messageFont");var tt=(0,n.K2)((t=>({fontFamily:t.noteFontFamily,fontSize:t.noteFontSize,fontWeight:t.noteFontWeight})),"noteFont");var et=(0,n.K2)((t=>({fontFamily:t.actorFontFamily,fontSize:t.actorFontSize,fontWeight:t.actorFontWeight})),"actorFont");async function at(t,e){G.bumpVerticalPos(10);const{startx:a,stopx:s,message:r}=e;const o=n.Y2.splitBreaks(r).length;const c=(0,n.Wi)(r);const l=c?await(0,n.Dl)(r,(0,n.D7)()):i._K.calculateTextDimensions(r,Q(J));if(!c){const t=l.height/o;e.height+=t;G.bumpVerticalPos(t)}let d;let h=l.height-10;const p=l.width;if(a===s){d=G.getVerticalPos()+h;if(!J.rightAngles){h+=J.boxMargin;d=G.getVerticalPos()+h}h+=30;const t=n.Y2.getMax(p/2,J.width/2);G.insert(a-t,G.getVerticalPos()-10+h,s+t,G.getVerticalPos()+30+h)}else{h+=J.boxMargin;d=G.getVerticalPos()+h;G.insert(a,d-10,s,d)}G.bumpVerticalPos(h);e.height+=h;e.stopy=e.starty+e.height;G.insert(e.fromBounds,e.starty,e.toBounds,e.stopy);return d}(0,n.K2)(at,"boundMessage");var st=(0,n.K2)((async function(t,e,a,r){const{startx:o,stopx:c,starty:l,message:d,type:h,sequenceIndex:p,sequenceVisible:g}=e;const u=i._K.calculateTextDimensions(d,Q(J));const f=(0,s.HT)();f.x=o;f.y=l+10;f.width=c-o;f.class="messageText";f.dy="1em";f.text=d;f.fontFamily=J.messageFontFamily;f.fontSize=J.messageFontSize;f.fontWeight=J.messageFontWeight;f.anchor=J.messageAlign;f.valign="center";f.textMargin=J.wrapPadding;f.tspan=false;if((0,n.Wi)(f.text)){await I(t,f,{startx:o,stopx:c,starty:a})}else{L(t,f)}const x=u.width;let y;if(o===c){if(J.rightAngles){y=t.append("path").attr("d",`M ${o},${a} H ${o+n.Y2.getMax(J.width/2,x/2)} V ${a+25} H ${o}`)}else{y=t.append("path").attr("d","M "+o+","+a+" C "+(o+60)+","+(a-10)+" "+(o+60)+","+(a+30)+" "+o+","+(a+20))}}else{y=t.append("line");y.attr("x1",o);y.attr("y1",a);y.attr("x2",c);y.attr("y2",a)}if(h===r.db.LINETYPE.DOTTED||h===r.db.LINETYPE.DOTTED_CROSS||h===r.db.LINETYPE.DOTTED_POINT||h===r.db.LINETYPE.DOTTED_OPEN||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED){y.style("stroke-dasharray","3, 3");y.attr("class","messageLine1")}else{y.attr("class","messageLine0")}let b="";if(J.arrowMarkerAbsolute){b=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search;b=b.replace(/\(/g,"\\(");b=b.replace(/\)/g,"\\)")}y.attr("stroke-width",2);y.attr("stroke","none");y.style("fill","none");if(h===r.db.LINETYPE.SOLID||h===r.db.LINETYPE.DOTTED){y.attr("marker-end","url("+b+"#arrowhead)")}if(h===r.db.LINETYPE.BIDIRECTIONAL_SOLID||h===r.db.LINETYPE.BIDIRECTIONAL_DOTTED){y.attr("marker-start","url("+b+"#arrowhead)");y.attr("marker-end","url("+b+"#arrowhead)")}if(h===r.db.LINETYPE.SOLID_POINT||h===r.db.LINETYPE.DOTTED_POINT){y.attr("marker-end","url("+b+"#filled-head)")}if(h===r.db.LINETYPE.SOLID_CROSS||h===r.db.LINETYPE.DOTTED_CROSS){y.attr("marker-end","url("+b+"#crosshead)")}if(g||J.showSequenceNumbers){y.attr("marker-start","url("+b+"#sequencenumber)");t.append("text").attr("x",o).attr("y",a+4).attr("font-family","sans-serif").attr("font-size","12px").attr("text-anchor","middle").attr("class","sequenceNumber").text(p)}}),"drawMessage");var rt=(0,n.K2)((function(t,e,a,s,r,i,o){let c=0;let l=0;let d=void 0;let h=0;for(const p of s){const t=e.get(p);const s=t.box;if(d&&d!=s){if(!o){G.models.addBox(d)}l+=J.boxMargin+d.margin}if(s&&s!=d){if(!o){s.x=c+l;s.y=r}l+=s.margin}t.width=t.width||J.width;t.height=n.Y2.getMax(t.height||J.height,J.height);t.margin=t.margin||J.actorMargin;h=n.Y2.getMax(h,t.height);if(a.get(t.name)){l+=t.width/2}t.x=c+l;t.starty=G.getVerticalPos();G.insert(t.x,r,t.x+t.width,t.height);c+=t.width+l;if(t.box){t.box.width=c+s.margin-t.box.x}l=t.margin;d=t.box;G.models.addActor(t)}if(d&&!o){G.models.addBox(d)}G.bumpVerticalPos(h)}),"addActorRenderingData");var it=(0,n.K2)((async function(t,e,a,s){if(!s){for(const s of a){const a=e.get(s);await X.drawActor(t,a,J,false)}}else{let s=0;G.bumpVerticalPos(J.boxMargin*2);for(const r of a){const a=e.get(r);if(!a.stopy){a.stopy=G.getVerticalPos()}const i=await X.drawActor(t,a,J,true);s=n.Y2.getMax(s,i)}G.bumpVerticalPos(s+J.boxMargin)}}),"drawActors");var nt=(0,n.K2)((function(t,e,a,s){let r=0;let i=0;for(const n of a){const a=e.get(n);const o=ut(a);const c=X.drawPopup(t,a,o,J,J.forceMenus,s);if(c.height>r){r=c.height}if(c.width+a.x>i){i=c.width+a.x}}return{maxHeight:r,maxWidth:i}}),"drawActorsPopup");var ot=(0,n.K2)((function(t){(0,n.hH)(J,t);if(t.fontFamily){J.actorFontFamily=J.noteFontFamily=J.messageFontFamily=t.fontFamily}if(t.fontSize){J.actorFontSize=J.noteFontSize=J.messageFontSize=t.fontSize}if(t.fontWeight){J.actorFontWeight=J.noteFontWeight=J.messageFontWeight=t.fontWeight}}),"setConf");var ct=(0,n.K2)((function(t){return G.activations.filter((function(e){return e.actor===t}))}),"actorActivations");var lt=(0,n.K2)((function(t,e){const a=e.get(t);const s=ct(t);const r=s.reduce((function(t,e){return n.Y2.getMin(t,e.startx)}),a.x+a.width/2-1);const i=s.reduce((function(t,e){return n.Y2.getMax(t,e.stopx)}),a.x+a.width/2+1);return[r,i]}),"activationBounds");function dt(t,e,a,s,r){G.bumpVerticalPos(a);let o=s;if(e.id&&e.message&&t[e.id]){const a=t[e.id].width;const r=Q(J);e.message=i._K.wrapLabel(`[${e.message}]`,a-2*J.wrapPadding,r);e.width=a;e.wrap=true;const c=i._K.calculateTextDimensions(e.message,r);const l=n.Y2.getMax(c.height,J.labelBoxHeight);o=s+l;n.Rm.debug(`${l} - ${e.message}`)}r(e);G.bumpVerticalPos(o)}(0,n.K2)(dt,"adjustLoopHeightForWrap");function ht(t,e,a,s,r,i,o){function c(a,s){if(a.x{t.add(e.from);t.add(e.to)}));x=x.filter((e=>t.has(e)))}rt(h,p,g,x,0,y,false);const w=await bt(y,p,E,s);X.insertArrowHead(h);X.insertArrowCrossHead(h);X.insertArrowFilledHead(h);X.insertSequenceNumber(h);function v(t,e){const a=G.endActivation(t);if(a.starty+18>e){a.starty=e-6;e+=12}X.drawActivation(h,a,e,J,ct(t.from).length);G.insert(a.startx,e-10,a.stopx,e)}(0,n.K2)(v,"activeEnd");let k=1;let I=1;const L=[];const _=[];let P=0;for(const o of y){let t,e,a;switch(o.type){case s.db.LINETYPE.NOTE:G.resetVerticalPos();e=o.noteModel;await Z(h,e);break;case s.db.LINETYPE.ACTIVE_START:G.newActivation(o,h,p);break;case s.db.LINETYPE.ACTIVE_END:v(o,G.getVerticalPos());break;case s.db.LINETYPE.LOOP_START:dt(w,o,J.boxMargin,J.boxMargin+J.boxTextMargin,(t=>G.newLoop(t)));break;case s.db.LINETYPE.LOOP_END:t=G.endLoop();await X.drawLoop(h,t,"loop",J);G.bumpVerticalPos(t.stopy-G.getVerticalPos());G.models.addLoop(t);break;case s.db.LINETYPE.RECT_START:dt(w,o,J.boxMargin,J.boxMargin,(t=>G.newLoop(void 0,t.message)));break;case s.db.LINETYPE.RECT_END:t=G.endLoop();_.push(t);G.models.addLoop(t);G.bumpVerticalPos(t.stopy-G.getVerticalPos());break;case s.db.LINETYPE.OPT_START:dt(w,o,J.boxMargin,J.boxMargin+J.boxTextMargin,(t=>G.newLoop(t)));break;case s.db.LINETYPE.OPT_END:t=G.endLoop();await X.drawLoop(h,t,"opt",J);G.bumpVerticalPos(t.stopy-G.getVerticalPos());G.models.addLoop(t);break;case s.db.LINETYPE.ALT_START:dt(w,o,J.boxMargin,J.boxMargin+J.boxTextMargin,(t=>G.newLoop(t)));break;case s.db.LINETYPE.ALT_ELSE:dt(w,o,J.boxMargin+J.boxTextMargin,J.boxMargin,(t=>G.addSectionToLoop(t)));break;case s.db.LINETYPE.ALT_END:t=G.endLoop();await X.drawLoop(h,t,"alt",J);G.bumpVerticalPos(t.stopy-G.getVerticalPos());G.models.addLoop(t);break;case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:dt(w,o,J.boxMargin,J.boxMargin+J.boxTextMargin,(t=>G.newLoop(t)));G.saveVerticalPos();break;case s.db.LINETYPE.PAR_AND:dt(w,o,J.boxMargin+J.boxTextMargin,J.boxMargin,(t=>G.addSectionToLoop(t)));break;case s.db.LINETYPE.PAR_END:t=G.endLoop();await X.drawLoop(h,t,"par",J);G.bumpVerticalPos(t.stopy-G.getVerticalPos());G.models.addLoop(t);break;case s.db.LINETYPE.AUTONUMBER:k=o.message.start||k;I=o.message.step||I;if(o.message.visible){s.db.enableSequenceNumbers()}else{s.db.disableSequenceNumbers()}break;case s.db.LINETYPE.CRITICAL_START:dt(w,o,J.boxMargin,J.boxMargin+J.boxTextMargin,(t=>G.newLoop(t)));break;case s.db.LINETYPE.CRITICAL_OPTION:dt(w,o,J.boxMargin+J.boxTextMargin,J.boxMargin,(t=>G.addSectionToLoop(t)));break;case s.db.LINETYPE.CRITICAL_END:t=G.endLoop();await X.drawLoop(h,t,"critical",J);G.bumpVerticalPos(t.stopy-G.getVerticalPos());G.models.addLoop(t);break;case s.db.LINETYPE.BREAK_START:dt(w,o,J.boxMargin,J.boxMargin+J.boxTextMargin,(t=>G.newLoop(t)));break;case s.db.LINETYPE.BREAK_END:t=G.endLoop();await X.drawLoop(h,t,"break",J);G.bumpVerticalPos(t.stopy-G.getVerticalPos());G.models.addLoop(t);break;default:try{a=o.msgModel;a.starty=G.getVerticalPos();a.sequenceIndex=k;a.sequenceVisible=s.db.showSequenceNumbers();const t=await at(h,a);ht(o,a,t,P,p,g,u);L.push({messageModel:a,lineStartY:t});G.models.addMessage(a)}catch(K){n.Rm.error("error while drawing message",K)}}if([s.db.LINETYPE.SOLID_OPEN,s.db.LINETYPE.DOTTED_OPEN,s.db.LINETYPE.SOLID,s.db.LINETYPE.DOTTED,s.db.LINETYPE.SOLID_CROSS,s.db.LINETYPE.DOTTED_CROSS,s.db.LINETYPE.SOLID_POINT,s.db.LINETYPE.DOTTED_POINT,s.db.LINETYPE.BIDIRECTIONAL_SOLID,s.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(o.type)){k=k+I}P++}n.Rm.debug("createdActors",g);n.Rm.debug("destroyedActors",u);await it(h,p,x,false);for(const n of L){await st(h,n.messageModel,n.lineStartY,s)}if(J.mirrorActors){await it(h,p,x,true)}_.forEach((t=>X.drawBackgroundRect(h,t)));A(h,p,x,J);for(const n of G.models.boxes){n.height=G.getVerticalPos()-n.y;G.insert(n.x,n.y,n.x+n.width,n.height);n.startx=n.x;n.starty=n.y;n.stopx=n.startx+n.width;n.stopy=n.starty+n.height;n.stroke="rgb(0,0,0, 0.5)";X.drawBox(h,n,J)}if(m){G.bumpVerticalPos(J.boxMargin)}const N=nt(h,p,x,d);const{bounds:M}=G.getBounds();if(M.startx===void 0){M.startx=0}if(M.starty===void 0){M.starty=0}if(M.stopx===void 0){M.stopx=0}if(M.stopy===void 0){M.stopy=0}let D=M.stopy-M.starty;if(D{const a=Q(J);let s=e.actorKeys.reduce(((e,a)=>e+=t.get(a).width+(t.get(a).margin||0)),0);s-=2*J.boxTextMargin;if(e.wrap){e.name=i._K.wrapLabel(e.name,s-2*J.wrapPadding,a)}const o=i._K.calculateTextDimensions(e.name,a);r=n.Y2.getMax(o.height,r);const c=n.Y2.getMax(s,o.width+2*J.wrapPadding);e.margin=J.boxTextMargin;if(st.textMaxHeight=r));return n.Y2.getMax(s,J.height)}(0,n.K2)(ft,"calculateActorMargins");var xt=(0,n.K2)((async function(t,e,a){const s=e.get(t.from);const r=e.get(t.to);const o=s.x;const c=r.x;const l=t.wrap&&t.message;let d=(0,n.Wi)(t.message)?await(0,n.Dl)(t.message,(0,n.D7)()):i._K.calculateTextDimensions(l?i._K.wrapLabel(t.message,J.width,tt(J)):t.message,tt(J));const h={width:l?J.width:n.Y2.getMax(J.width,d.width+2*J.noteMargin),height:0,startx:s.x,stopx:0,starty:0,stopy:0,message:t.message};if(t.placement===a.db.PLACEMENT.RIGHTOF){h.width=l?n.Y2.getMax(J.width,d.width):n.Y2.getMax(s.width/2+r.width/2,d.width+2*J.noteMargin);h.startx=o+(s.width+J.actorMargin)/2}else if(t.placement===a.db.PLACEMENT.LEFTOF){h.width=l?n.Y2.getMax(J.width,d.width+2*J.noteMargin):n.Y2.getMax(s.width/2+r.width/2,d.width+2*J.noteMargin);h.startx=o-h.width+(s.width-J.actorMargin)/2}else if(t.to===t.from){d=i._K.calculateTextDimensions(l?i._K.wrapLabel(t.message,n.Y2.getMax(J.width,s.width),tt(J)):t.message,tt(J));h.width=l?n.Y2.getMax(J.width,s.width):n.Y2.getMax(s.width,J.width,d.width+2*J.noteMargin);h.startx=o+(s.width-h.width)/2}else{h.width=Math.abs(o+s.width/2-(c+r.width/2))+J.actorMargin;h.startx=o2;const g=(0,n.K2)((t=>l?-t:t),"adjustValue");if(t.from===t.to){h=d}else{if(t.activate&&!p){h+=g(J.activationWidth/2-1)}if(![a.db.LINETYPE.SOLID_OPEN,a.db.LINETYPE.DOTTED_OPEN].includes(t.type)){h+=g(3)}if([a.db.LINETYPE.BIDIRECTIONAL_SOLID,a.db.LINETYPE.BIDIRECTIONAL_DOTTED].includes(t.type)){d-=g(3)}}const u=[s,r,o,c];const f=Math.abs(d-h);if(t.wrap&&t.message){t.message=i._K.wrapLabel(t.message,n.Y2.getMax(f+2*J.wrapPadding,J.width),Q(J))}const x=i._K.calculateTextDimensions(t.message,Q(J));return{width:n.Y2.getMax(t.wrap?0:x.width+2*J.wrapPadding,f+2*J.wrapPadding,J.width),height:0,startx:d,stopx:h,starty:0,stopy:0,message:t.message,type:t.type,wrap:t.wrap,fromBounds:Math.min.apply(null,u),toBounds:Math.max.apply(null,u)}}),"buildMessageModel");var bt=(0,n.K2)((async function(t,e,a,s){const r={};const i=[];let o,c,l;for(const d of t){switch(d.type){case s.db.LINETYPE.LOOP_START:case s.db.LINETYPE.ALT_START:case s.db.LINETYPE.OPT_START:case s.db.LINETYPE.PAR_START:case s.db.LINETYPE.PAR_OVER_START:case s.db.LINETYPE.CRITICAL_START:case s.db.LINETYPE.BREAK_START:i.push({id:d.id,msg:d.message,from:Number.MAX_SAFE_INTEGER,to:Number.MIN_SAFE_INTEGER,width:0});break;case s.db.LINETYPE.ALT_ELSE:case s.db.LINETYPE.PAR_AND:case s.db.LINETYPE.CRITICAL_OPTION:if(d.message){o=i.pop();r[o.id]=o;r[d.id]=o;i.push(o)}break;case s.db.LINETYPE.LOOP_END:case s.db.LINETYPE.ALT_END:case s.db.LINETYPE.OPT_END:case s.db.LINETYPE.PAR_END:case s.db.LINETYPE.CRITICAL_END:case s.db.LINETYPE.BREAK_END:o=i.pop();r[o.id]=o;break;case s.db.LINETYPE.ACTIVE_START:{const t=e.get(d.from?d.from:d.to.actor);const a=ct(d.from?d.from:d.to.actor).length;const s=t.x+t.width/2+(a-1)*J.activationWidth/2;const r={startx:s,stopx:s+J.activationWidth,actor:d.from,enabled:true};G.activations.push(r)}break;case s.db.LINETYPE.ACTIVE_END:{const t=G.activations.map((t=>t.actor)).lastIndexOf(d.from);G.activations.splice(t,1).splice(0,1)}break}const t=d.placement!==void 0;if(t){c=await xt(d,e,s);d.noteModel=c;i.forEach((t=>{o=t;o.from=n.Y2.getMin(o.from,c.startx);o.to=n.Y2.getMax(o.to,c.startx+c.width);o.width=n.Y2.getMax(o.width,Math.abs(o.from-o.to))-J.labelBoxWidth}))}else{l=yt(d,e,s);d.msgModel=l;if(l.startx&&l.stopx&&i.length>0){i.forEach((t=>{o=t;if(l.startx===l.stopx){const t=e.get(d.from);const a=e.get(d.to);o.from=n.Y2.getMin(t.x-l.width/2,t.x-t.width/2,o.from);o.to=n.Y2.getMax(a.x+l.width/2,a.x+t.width/2,o.to);o.width=n.Y2.getMax(o.width,Math.abs(o.to-o.from))-J.labelBoxWidth}else{o.from=n.Y2.getMin(l.startx,o.from);o.to=n.Y2.getMax(l.stopx,o.to);o.width=n.Y2.getMax(o.width,l.width)-J.labelBoxWidth}}))}}}G.activations=[];n.Rm.debug("Loop type widths:",r);return r}),"calculateLoopBounds");var mt={bounds:G,drawActors:it,drawActorsPopup:nt,setConf:ot,draw:pt};var Tt={parser:d,get db(){return new u},renderer:mt,styles:x,init:(0,n.K2)((t=>{if(!t.sequence){t.sequence={}}if(t.wrap){t.sequence.wrap=t.wrap;(0,n.XV)({sequence:{wrap:t.wrap}})}}),"init")}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/805.2a0b8ac50aa8e6ab096f.js b/.venv/share/jupyter/lab/static/805.2a0b8ac50aa8e6ab096f.js new file mode 100644 index 0000000000000000000000000000000000000000..faad3ce33b0b6919717ff787ec0174da9d6c5425 --- /dev/null +++ b/.venv/share/jupyter/lab/static/805.2a0b8ac50aa8e6ab096f.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[805],{27574:(t,e,i)=>{i.d(e,{A:()=>a});var s=i(57991);var r=i(63221);const n=(t,e)=>s.A.lang.round(r.A.parse(t)[e]);const a=n},15051:(t,e,i)=>{i.d(e,{A:()=>n,P:()=>a});var s=i(75905);var r=i(24982);var n=(0,s.K2)(((t,e)=>{let i;if(e==="sandbox"){i=(0,r.Ltv)("#i"+t)}const s=e==="sandbox"?(0,r.Ltv)(i.nodes()[0].contentDocument.body):(0,r.Ltv)("body");const n=s.select(`[id="${t}"]`);return n}),"getDiagramElement");var a=(0,s.K2)(((t,e,i,r)=>{t.attr("class",i);const{width:n,height:a,x:l,y:h}=c(t,e);(0,s.a$)(t,a,n,r);const u=o(l,h,n,a,e);t.attr("viewBox",u);s.Rm.debug(`viewBox configured: ${u} with padding: ${e}`)}),"setupViewPortForSVG");var c=(0,s.K2)(((t,e)=>{const i=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:i.width+e*2,height:i.height+e*2,x:i.x,y:i.y}}),"calculateDimensionsWithPadding");var o=(0,s.K2)(((t,e,i,s,r)=>`${t-r} ${e-r} ${i} ${s}`),"createViewBox")},70805:(t,e,i)=>{i.d(e,{diagram:()=>O});var s=i(15051);var r=i(94065);var n=i(33416);var a=i(94746);var c=i(20778);var o=i(57590);var l=i(68232);var h=i(76261);var u=i(96049);var y=i(75905);var d=i(24982);var b=i(27574);var p=i(3635);var f=function(){var t=(0,y.K2)((function(t,e,i,s){for(i=i||{},s=t.length;s--;i[t[s]]=e);return i}),"o"),e=[6,8,10,22,24,26,28,33,34,35,36,37,40,43,44,50],i=[1,10],s=[1,11],r=[1,12],n=[1,13],a=[1,20],c=[1,21],o=[1,22],l=[1,23],h=[1,24],u=[1,19],d=[1,25],b=[1,26],p=[1,18],f=[1,33],k=[1,34],_=[1,35],g=[1,36],m=[1,37],E=[6,8,10,13,15,17,20,21,22,24,26,28,33,34,35,36,37,40,43,44,50,63,64,65,66,67],v=[1,42],S=[1,43],O=[1,52],T=[40,50,68,69],A=[1,63],R=[1,61],N=[1,58],I=[1,62],x=[1,64],C=[6,8,10,13,17,22,24,26,28,33,34,35,36,37,40,41,42,43,44,48,49,50,63,64,65,66,67],$=[63,64,65,66,67],D=[1,81],w=[1,80],K=[1,78],L=[1,79],M=[6,10,42,47],B=[6,10,13,41,42,47,48,49],F=[1,89],P=[1,88],Y=[1,87],G=[19,56],z=[1,98],U=[1,97],Z=[19,56,58,60];var j={trace:(0,y.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,entityName:11,relSpec:12,COLON:13,role:14,STYLE_SEPARATOR:15,idList:16,BLOCK_START:17,attributes:18,BLOCK_STOP:19,SQS:20,SQE:21,title:22,title_value:23,acc_title:24,acc_title_value:25,acc_descr:26,acc_descr_value:27,acc_descr_multiline_value:28,direction:29,classDefStatement:30,classStatement:31,styleStatement:32,direction_tb:33,direction_bt:34,direction_rl:35,direction_lr:36,CLASSDEF:37,stylesOpt:38,separator:39,UNICODE_TEXT:40,STYLE_TEXT:41,COMMA:42,CLASS:43,STYLE:44,style:45,styleComponent:46,SEMI:47,NUM:48,BRKT:49,ENTITY_NAME:50,attribute:51,attributeType:52,attributeName:53,attributeKeyTypeList:54,attributeComment:55,ATTRIBUTE_WORD:56,attributeKeyType:57,",":58,ATTRIBUTE_KEY:59,COMMENT:60,cardinality:61,relType:62,ZERO_OR_ONE:63,ZERO_OR_MORE:64,ONE_OR_MORE:65,ONLY_ONE:66,MD_PARENT:67,NON_IDENTIFYING:68,IDENTIFYING:69,WORD:70,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",8:"SPACE",10:"NEWLINE",13:"COLON",15:"STYLE_SEPARATOR",17:"BLOCK_START",19:"BLOCK_STOP",20:"SQS",21:"SQE",22:"title",23:"title_value",24:"acc_title",25:"acc_title_value",26:"acc_descr",27:"acc_descr_value",28:"acc_descr_multiline_value",33:"direction_tb",34:"direction_bt",35:"direction_rl",36:"direction_lr",37:"CLASSDEF",40:"UNICODE_TEXT",41:"STYLE_TEXT",42:"COMMA",43:"CLASS",44:"STYLE",47:"SEMI",48:"NUM",49:"BRKT",50:"ENTITY_NAME",56:"ATTRIBUTE_WORD",58:",",59:"ATTRIBUTE_KEY",60:"COMMENT",63:"ZERO_OR_ONE",64:"ZERO_OR_MORE",65:"ONE_OR_MORE",66:"ONLY_ONE",67:"MD_PARENT",68:"NON_IDENTIFYING",69:"IDENTIFYING",70:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,5],[9,9],[9,7],[9,7],[9,4],[9,6],[9,3],[9,5],[9,1],[9,3],[9,7],[9,9],[9,6],[9,8],[9,4],[9,6],[9,2],[9,2],[9,2],[9,1],[9,1],[9,1],[9,1],[9,1],[29,1],[29,1],[29,1],[29,1],[30,4],[16,1],[16,1],[16,3],[16,3],[31,3],[32,4],[38,1],[38,3],[45,1],[45,2],[39,1],[39,1],[39,1],[46,1],[46,1],[46,1],[46,1],[11,1],[11,1],[18,1],[18,2],[51,2],[51,3],[51,3],[51,4],[52,1],[53,1],[54,1],[54,3],[57,1],[55,1],[12,3],[61,1],[61,1],[61,1],[61,1],[61,1],[62,1],[62,1],[14,1],[14,1],[14,1]],performAction:(0,y.K2)((function t(e,i,s,r,n,a,c){var o=a.length-1;switch(n){case 1:break;case 2:this.$=[];break;case 3:a[o-1].push(a[o]);this.$=a[o-1];break;case 4:case 5:this.$=a[o];break;case 6:case 7:this.$=[];break;case 8:r.addEntity(a[o-4]);r.addEntity(a[o-2]);r.addRelationship(a[o-4],a[o],a[o-2],a[o-3]);break;case 9:r.addEntity(a[o-8]);r.addEntity(a[o-4]);r.addRelationship(a[o-8],a[o],a[o-4],a[o-5]);r.setClass([a[o-8]],a[o-6]);r.setClass([a[o-4]],a[o-2]);break;case 10:r.addEntity(a[o-6]);r.addEntity(a[o-2]);r.addRelationship(a[o-6],a[o],a[o-2],a[o-3]);r.setClass([a[o-6]],a[o-4]);break;case 11:r.addEntity(a[o-6]);r.addEntity(a[o-4]);r.addRelationship(a[o-6],a[o],a[o-4],a[o-5]);r.setClass([a[o-4]],a[o-2]);break;case 12:r.addEntity(a[o-3]);r.addAttributes(a[o-3],a[o-1]);break;case 13:r.addEntity(a[o-5]);r.addAttributes(a[o-5],a[o-1]);r.setClass([a[o-5]],a[o-3]);break;case 14:r.addEntity(a[o-2]);break;case 15:r.addEntity(a[o-4]);r.setClass([a[o-4]],a[o-2]);break;case 16:r.addEntity(a[o]);break;case 17:r.addEntity(a[o-2]);r.setClass([a[o-2]],a[o]);break;case 18:r.addEntity(a[o-6],a[o-4]);r.addAttributes(a[o-6],a[o-1]);break;case 19:r.addEntity(a[o-8],a[o-6]);r.addAttributes(a[o-8],a[o-1]);r.setClass([a[o-8]],a[o-3]);break;case 20:r.addEntity(a[o-5],a[o-3]);break;case 21:r.addEntity(a[o-7],a[o-5]);r.setClass([a[o-7]],a[o-2]);break;case 22:r.addEntity(a[o-3],a[o-1]);break;case 23:r.addEntity(a[o-5],a[o-3]);r.setClass([a[o-5]],a[o]);break;case 24:case 25:this.$=a[o].trim();r.setAccTitle(this.$);break;case 26:case 27:this.$=a[o].trim();r.setAccDescription(this.$);break;case 32:r.setDirection("TB");break;case 33:r.setDirection("BT");break;case 34:r.setDirection("RL");break;case 35:r.setDirection("LR");break;case 36:this.$=a[o-3];r.addClass(a[o-2],a[o-1]);break;case 37:case 38:case 56:case 64:this.$=[a[o]];break;case 39:case 40:this.$=a[o-2].concat([a[o]]);break;case 41:this.$=a[o-2];r.setClass(a[o-1],a[o]);break;case 42:;this.$=a[o-3];r.addCssStyles(a[o-2],a[o-1]);break;case 43:this.$=[a[o]];break;case 44:a[o-2].push(a[o]);this.$=a[o-2];break;case 46:this.$=a[o-1]+a[o];break;case 54:case 76:case 77:this.$=a[o].replace(/"/g,"");break;case 55:case 78:this.$=a[o];break;case 57:a[o].push(a[o-1]);this.$=a[o];break;case 58:this.$={type:a[o-1],name:a[o]};break;case 59:this.$={type:a[o-2],name:a[o-1],keys:a[o]};break;case 60:this.$={type:a[o-2],name:a[o-1],comment:a[o]};break;case 61:this.$={type:a[o-3],name:a[o-2],keys:a[o-1],comment:a[o]};break;case 62:case 63:case 66:this.$=a[o];break;case 65:a[o-2].push(a[o]);this.$=a[o-2];break;case 67:this.$=a[o].replace(/"/g,"");break;case 68:this.$={cardA:a[o],relType:a[o-1],cardB:a[o-2]};break;case 69:this.$=r.Cardinality.ZERO_OR_ONE;break;case 70:this.$=r.Cardinality.ZERO_OR_MORE;break;case 71:this.$=r.Cardinality.ONE_OR_MORE;break;case 72:this.$=r.Cardinality.ONLY_ONE;break;case 73:this.$=r.Cardinality.MD_PARENT;break;case 74:this.$=r.Identification.NON_IDENTIFYING;break;case 75:this.$=r.Identification.IDENTIFYING;break}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:9,22:i,24:s,26:r,28:n,29:14,30:15,31:16,32:17,33:a,34:c,35:o,36:l,37:h,40:u,43:d,44:b,50:p},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:27,11:9,22:i,24:s,26:r,28:n,29:14,30:15,31:16,32:17,33:a,34:c,35:o,36:l,37:h,40:u,43:d,44:b,50:p},t(e,[2,5]),t(e,[2,6]),t(e,[2,16],{12:28,61:32,15:[1,29],17:[1,30],20:[1,31],63:f,64:k,65:_,66:g,67:m}),{23:[1,38]},{25:[1,39]},{27:[1,40]},t(e,[2,27]),t(e,[2,28]),t(e,[2,29]),t(e,[2,30]),t(e,[2,31]),t(E,[2,54]),t(E,[2,55]),t(e,[2,32]),t(e,[2,33]),t(e,[2,34]),t(e,[2,35]),{16:41,40:v,41:S},{16:44,40:v,41:S},{16:45,40:v,41:S},t(e,[2,4]),{11:46,40:u,50:p},{16:47,40:v,41:S},{18:48,19:[1,49],51:50,52:51,56:O},{11:53,40:u,50:p},{62:54,68:[1,55],69:[1,56]},t(T,[2,69]),t(T,[2,70]),t(T,[2,71]),t(T,[2,72]),t(T,[2,73]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),{13:A,38:57,41:R,42:N,45:59,46:60,48:I,49:x},t(C,[2,37]),t(C,[2,38]),{16:65,40:v,41:S,42:N},{13:A,38:66,41:R,42:N,45:59,46:60,48:I,49:x},{13:[1,67],15:[1,68]},t(e,[2,17],{61:32,12:69,17:[1,70],42:N,63:f,64:k,65:_,66:g,67:m}),{19:[1,71]},t(e,[2,14]),{18:72,19:[2,56],51:50,52:51,56:O},{53:73,56:[1,74]},{56:[2,62]},{21:[1,75]},{61:76,63:f,64:k,65:_,66:g,67:m},t($,[2,74]),t($,[2,75]),{6:D,10:w,39:77,42:K,47:L},{40:[1,82],41:[1,83]},t(M,[2,43],{46:84,13:A,41:R,48:I,49:x}),t(B,[2,45]),t(B,[2,50]),t(B,[2,51]),t(B,[2,52]),t(B,[2,53]),t(e,[2,41],{42:N}),{6:D,10:w,39:85,42:K,47:L},{14:86,40:F,50:P,70:Y},{16:90,40:v,41:S},{11:91,40:u,50:p},{18:92,19:[1,93],51:50,52:51,56:O},t(e,[2,12]),{19:[2,57]},t(G,[2,58],{54:94,55:95,57:96,59:z,60:U}),t([19,56,59,60],[2,63]),t(e,[2,22],{15:[1,100],17:[1,99]}),t([40,50],[2,68]),t(e,[2,36]),{13:A,41:R,45:101,46:60,48:I,49:x},t(e,[2,47]),t(e,[2,48]),t(e,[2,49]),t(C,[2,39]),t(C,[2,40]),t(B,[2,46]),t(e,[2,42]),t(e,[2,8]),t(e,[2,76]),t(e,[2,77]),t(e,[2,78]),{13:[1,102],42:N},{13:[1,104],15:[1,103]},{19:[1,105]},t(e,[2,15]),t(G,[2,59],{55:106,58:[1,107],60:U}),t(G,[2,60]),t(Z,[2,64]),t(G,[2,67]),t(Z,[2,66]),{18:108,19:[1,109],51:50,52:51,56:O},{16:110,40:v,41:S},t(M,[2,44],{46:84,13:A,41:R,48:I,49:x}),{14:111,40:F,50:P,70:Y},{16:112,40:v,41:S},{14:113,40:F,50:P,70:Y},t(e,[2,13]),t(G,[2,61]),{57:114,59:z},{19:[1,115]},t(e,[2,20]),t(e,[2,23],{17:[1,116],42:N}),t(e,[2,11]),{13:[1,117],42:N},t(e,[2,10]),t(Z,[2,65]),t(e,[2,18]),{18:118,19:[1,119],51:50,52:51,56:O},{14:120,40:F,50:P,70:Y},{19:[1,121]},t(e,[2,21]),t(e,[2,9]),t(e,[2,19])],defaultActions:{52:[2,62],72:[2,57]},parseError:(0,y.K2)((function t(e,i){if(i.recoverable){this.trace(e)}else{var s=new Error(e);s.hash=i;throw s}}),"parseError"),parse:(0,y.K2)((function t(e){var i=this,s=[0],r=[],n=[null],a=[],c=this.table,o="",l=0,h=0,u=0,d=2,b=1;var p=a.slice.call(arguments,1);var f=Object.create(this.lexer);var k={yy:{}};for(var _ in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,_)){k.yy[_]=this.yy[_]}}f.setInput(e,k.yy);k.yy.lexer=f;k.yy.parser=this;if(typeof f.yylloc=="undefined"){f.yylloc={}}var g=f.yylloc;a.push(g);var m=f.options&&f.options.ranges;if(typeof k.yy.parseError==="function"){this.parseError=k.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function E(t){s.length=s.length-2*t;n.length=n.length-t;a.length=a.length-t}(0,y.K2)(E,"popStack");function v(){var t;t=r.pop()||f.lex()||b;if(typeof t!=="number"){if(t instanceof Array){r=t;t=r.pop()}t=i.symbols_[t]||t}return t}(0,y.K2)(v,"lex");var S,O,T,A,R,N,I={},x,C,$,D;while(true){T=s[s.length-1];if(this.defaultActions[T]){A=this.defaultActions[T]}else{if(S===null||typeof S=="undefined"){S=v()}A=c[T]&&c[T][S]}if(typeof A==="undefined"||!A.length||!A[0]){var w="";D=[];for(x in c[T]){if(this.terminals_[x]&&x>d){D.push("'"+this.terminals_[x]+"'")}}if(f.showPosition){w="Parse error on line "+(l+1)+":\n"+f.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[S]||S)+"'"}else{w="Parse error on line "+(l+1)+": Unexpected "+(S==b?"end of input":"'"+(this.terminals_[S]||S)+"'")}this.parseError(w,{text:f.match,token:this.terminals_[S]||S,line:f.yylineno,loc:g,expected:D})}if(A[0]instanceof Array&&A.length>1){throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+S)}switch(A[0]){case 1:s.push(S);n.push(f.yytext);a.push(f.yylloc);s.push(A[1]);S=null;if(!O){h=f.yyleng;o=f.yytext;l=f.yylineno;g=f.yylloc;if(u>0){u--}}else{S=O;O=null}break;case 2:C=this.productions_[A[1]][1];I.$=n[n.length-C];I._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column};if(m){I._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]}N=this.performAction.apply(I,[o,h,l,k.yy,A[1],n,a].concat(p));if(typeof N!=="undefined"){return N}if(C){s=s.slice(0,-1*C*2);n=n.slice(0,-1*C);a=a.slice(0,-1*C)}s.push(this.productions_[A[1]][0]);n.push(I.$);a.push(I._$);$=c[s[s.length-2]][s[s.length-1]];s.push($);break;case 3:return true}}return true}),"parse")};var W=function(){var t={EOF:1,parseError:(0,y.K2)((function t(e,i){if(this.yy.parser){this.yy.parser.parseError(e,i)}else{throw new Error(e)}}),"parseError"),setInput:(0,y.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,y.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,y.K2)((function(t){var e=t.length;var i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-e);this.offset-=e;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(i.length-1){this.yylineno-=i.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===s.length?this.yylloc.first_column:0)+s[s.length-i.length].length-i[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,y.K2)((function(){this._more=true;return this}),"more"),reject:(0,y.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,y.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,y.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,y.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,y.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,y.K2)((function(t,e){var i,s,r;if(this.options.backtrack_lexer){r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){r.yylloc.range=this.yylloc.range.slice(0)}}s=t[0].match(/(?:\r\n?|\n).*/g);if(s){this.yylineno+=s.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];i=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(i){return i}else if(this._backtrack){for(var n in r){this[n]=r[n]}return false}return false}),"test_match"),next:(0,y.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,i,s;if(!this._more){this.yytext="";this.match=""}var r=this._currentRules();for(var n=0;ne[0].length)){e=i;s=n;if(this.options.backtrack_lexer){t=this.test_match(i,r[n]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,r[s]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,y.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,y.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,y.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,y.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,y.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,y.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,y.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,y.K2)((function t(e,i,s,r){var n=r;switch(s){case 0:this.begin("acc_title");return 24;break;case 1:this.popState();return"acc_title_value";break;case 2:this.begin("acc_descr");return 26;break;case 3:this.popState();return"acc_descr_value";break;case 4:this.begin("acc_descr_multiline");break;case 5:this.popState();break;case 6:return"acc_descr_multiline_value";break;case 7:return 33;break;case 8:return 34;break;case 9:return 35;break;case 10:return 36;break;case 11:return 10;break;case 12:break;case 13:return 8;break;case 14:return 50;break;case 15:return 70;break;case 16:return 4;break;case 17:this.begin("block");return 17;break;case 18:return 49;break;case 19:return 49;break;case 20:return 42;break;case 21:return 15;break;case 22:return 13;break;case 23:break;case 24:return 59;break;case 25:return 56;break;case 26:return 56;break;case 27:return 60;break;case 28:break;case 29:this.popState();return 19;break;case 30:return i.yytext[0];break;case 31:return 20;break;case 32:return 21;break;case 33:this.begin("style");return 44;break;case 34:this.popState();return 10;break;case 35:break;case 36:return 13;break;case 37:return 42;break;case 38:return 49;break;case 39:this.begin("style");return 37;break;case 40:return 43;break;case 41:return 63;break;case 42:return 65;break;case 43:return 65;break;case 44:return 65;break;case 45:return 63;break;case 46:return 63;break;case 47:return 64;break;case 48:return 64;break;case 49:return 64;break;case 50:return 64;break;case 51:return 64;break;case 52:return 65;break;case 53:return 64;break;case 54:return 65;break;case 55:return 66;break;case 56:return 66;break;case 57:return 66;break;case 58:return 66;break;case 59:return 63;break;case 60:return 64;break;case 61:return 65;break;case 62:return 67;break;case 63:return 68;break;case 64:return 69;break;case 65:return 69;break;case 66:return 68;break;case 67:return 68;break;case 68:return 68;break;case 69:return 41;break;case 70:return 47;break;case 71:return 40;break;case 72:return 48;break;case 73:return i.yytext[0];break;case 74:return 6;break}}),"anonymous"),rules:[/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:[\s]+)/i,/^(?:"[^"%\r\n\v\b\\]+")/i,/^(?:"[^"]*")/i,/^(?:erDiagram\b)/i,/^(?:\{)/i,/^(?:#)/i,/^(?:#)/i,/^(?:,)/i,/^(?::::)/i,/^(?::)/i,/^(?:\s+)/i,/^(?:\b((?:PK)|(?:FK)|(?:UK))\b)/i,/^(?:([^\s]*)[~].*[~]([^\s]*))/i,/^(?:([\*A-Za-z_\u00C0-\uFFFF][A-Za-z0-9\-\_\[\]\(\)\u00C0-\uFFFF\*]*))/i,/^(?:"[^"]*")/i,/^(?:[\n]+)/i,/^(?:\})/i,/^(?:.)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:style\b)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?::)/i,/^(?:,)/i,/^(?:#)/i,/^(?:classDef\b)/i,/^(?:class\b)/i,/^(?:one or zero\b)/i,/^(?:one or more\b)/i,/^(?:one or many\b)/i,/^(?:1\+)/i,/^(?:\|o\b)/i,/^(?:zero or one\b)/i,/^(?:zero or more\b)/i,/^(?:zero or many\b)/i,/^(?:0\+)/i,/^(?:\}o\b)/i,/^(?:many\(0\))/i,/^(?:many\(1\))/i,/^(?:many\b)/i,/^(?:\}\|)/i,/^(?:one\b)/i,/^(?:only one\b)/i,/^(?:1\b)/i,/^(?:\|\|)/i,/^(?:o\|)/i,/^(?:o\{)/i,/^(?:\|\{)/i,/^(?:\s*u\b)/i,/^(?:\.\.)/i,/^(?:--)/i,/^(?:to\b)/i,/^(?:optionally to\b)/i,/^(?:\.-)/i,/^(?:-\.)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:;)/i,/^(?:([^\x00-\x7F]|\w|-|\*)+)/i,/^(?:[0-9])/i,/^(?:.)/i,/^(?:$)/i],conditions:{style:{rules:[34,35,36,37,38,69,70],inclusive:false},acc_descr_multiline:{rules:[5,6],inclusive:false},acc_descr:{rules:[3],inclusive:false},acc_title:{rules:[1],inclusive:false},block:{rules:[23,24,25,26,27,28,29,30],inclusive:false},INITIAL:{rules:[0,2,4,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,31,32,33,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,71,72,73,74],inclusive:true}}};return t}();j.lexer=W;function X(){this.yy={}}(0,y.K2)(X,"Parser");X.prototype=j;j.Parser=X;return new X}();f.parser=f;var k=f;var _=class{constructor(){this.entities=new Map;this.relationships=[];this.classes=new Map;this.direction="TB";this.Cardinality={ZERO_OR_ONE:"ZERO_OR_ONE",ZERO_OR_MORE:"ZERO_OR_MORE",ONE_OR_MORE:"ONE_OR_MORE",ONLY_ONE:"ONLY_ONE",MD_PARENT:"MD_PARENT"};this.Identification={NON_IDENTIFYING:"NON_IDENTIFYING",IDENTIFYING:"IDENTIFYING"};this.setAccTitle=y.SV;this.getAccTitle=y.iN;this.setAccDescription=y.EI;this.getAccDescription=y.m7;this.setDiagramTitle=y.ke;this.getDiagramTitle=y.ab;this.getConfig=(0,y.K2)((()=>(0,y.D7)().er),"getConfig");this.clear();this.addEntity=this.addEntity.bind(this);this.addAttributes=this.addAttributes.bind(this);this.addRelationship=this.addRelationship.bind(this);this.setDirection=this.setDirection.bind(this);this.addCssStyles=this.addCssStyles.bind(this);this.addClass=this.addClass.bind(this);this.setClass=this.setClass.bind(this);this.setAccTitle=this.setAccTitle.bind(this);this.setAccDescription=this.setAccDescription.bind(this)}static{(0,y.K2)(this,"ErDB")}addEntity(t,e=""){if(!this.entities.has(t)){this.entities.set(t,{id:`entity-${t}-${this.entities.size}`,label:t,attributes:[],alias:e,shape:"erBox",look:(0,y.D7)().look??"default",cssClasses:"default",cssStyles:[]});y.Rm.info("Added new entity :",t)}else if(!this.entities.get(t)?.alias&&e){this.entities.get(t).alias=e;y.Rm.info(`Add alias '${e}' to entity '${t}'`)}return this.entities.get(t)}getEntity(t){return this.entities.get(t)}getEntities(){return this.entities}getClasses(){return this.classes}addAttributes(t,e){const i=this.addEntity(t);let s;for(s=e.length-1;s>=0;s--){if(!e[s].keys){e[s].keys=[]}if(!e[s].comment){e[s].comment=""}i.attributes.push(e[s]);y.Rm.debug("Added attribute ",e[s].name)}}addRelationship(t,e,i,s){const r=this.entities.get(t);const n=this.entities.get(i);if(!r||!n){return}const a={entityA:r.id,roleA:e,entityB:n.id,relSpec:s};this.relationships.push(a);y.Rm.debug("Added new relationship :",a)}getRelationships(){return this.relationships}getDirection(){return this.direction}setDirection(t){this.direction=t}getCompiledStyles(t){let e=[];for(const i of t){const t=this.classes.get(i);if(t?.styles){e=[...e,...t.styles??[]].map((t=>t.trim()))}if(t?.textStyles){e=[...e,...t.textStyles??[]].map((t=>t.trim()))}}return e}addCssStyles(t,e){for(const i of t){const t=this.entities.get(i);if(!e||!t){return}for(const i of e){t.cssStyles.push(i)}}}addClass(t,e){t.forEach((t=>{let i=this.classes.get(t);if(i===void 0){i={id:t,styles:[],textStyles:[]};this.classes.set(t,i)}if(e){e.forEach((function(t){if(/color/.exec(t)){const e=t.replace("fill","bgFill");i.textStyles.push(e)}i.styles.push(t)}))}}))}setClass(t,e){for(const i of t){const t=this.entities.get(i);if(t){for(const i of e){t.cssClasses+=" "+i}}}}clear(){this.entities=new Map;this.classes=new Map;this.relationships=[];(0,y.IU)()}getData(){const t=[];const e=[];const i=(0,y.D7)();for(const r of this.entities.keys()){const e=this.entities.get(r);if(e){e.cssCompiledStyles=this.getCompiledStyles(e.cssClasses.split(" "));t.push(e)}}let s=0;for(const r of this.relationships){const t={id:(0,u.rY)(r.entityA,r.entityB,{prefix:"id",counter:s++}),type:"normal",curve:"basis",start:r.entityA,end:r.entityB,label:r.roleA,labelpos:"c",thickness:"normal",classes:"relationshipLine",arrowTypeStart:r.relSpec.cardB.toLowerCase(),arrowTypeEnd:r.relSpec.cardA.toLowerCase(),pattern:r.relSpec.relType=="IDENTIFYING"?"solid":"dashed",look:i.look};e.push(t)}return{nodes:t,edges:e,other:{},config:i,direction:"TB"}}};var g={};(0,y.VA)(g,{draw:()=>m});var m=(0,y.K2)((async function(t,e,i,n){y.Rm.info("REF0:");y.Rm.info("Drawing er diagram (unified)",e);const{securityLevel:a,er:c,layout:o}=(0,y.D7)();const l=n.db.getData();const h=(0,s.A)(e,a);l.type=n.type;l.layoutAlgorithm=(0,r.q7)(o);l.config.flowchart.nodeSpacing=c?.nodeSpacing||140;l.config.flowchart.rankSpacing=c?.rankSpacing||80;l.direction=n.db.getDirection();l.markers=["only_one","zero_or_one","one_or_more","zero_or_more"];l.diagramId=e;await(0,r.XX)(l,h);if(l.layoutAlgorithm==="elk"){h.select(".edges").lower()}const b=h.selectAll('[id*="-background"]');if(Array.from(b).length>0){b.each((function(){const t=(0,d.Ltv)(this);const e=t.attr("id");const i=e.replace("-background","");const s=h.select(`#${CSS.escape(i)}`);if(!s.empty()){const e=s.attr("transform");t.attr("transform",e)}}))}const p=8;u._K.insertTitle(h,"erDiagramTitleText",c?.titleTopMargin??25,n.db.getDiagramTitle());(0,s.P)(h,p,"erDiagram",c?.useMaxWidth??true)}),"draw");var E=(0,y.K2)(((t,e)=>{const i=b.A;const s=i(t,"r");const r=i(t,"g");const n=i(t,"b");return p.A(s,r,n,e)}),"fade");var v=(0,y.K2)((t=>`\n .entityBox {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n }\n\n .relationshipLabelBox {\n fill: ${t.tertiaryColor};\n opacity: 0.7;\n background-color: ${t.tertiaryColor};\n rect {\n opacity: 0.5;\n }\n }\n\n .labelBkg {\n background-color: ${E(t.tertiaryColor,.5)};\n }\n\n .edgeLabel .label {\n fill: ${t.nodeBorder};\n font-size: 14px;\n }\n\n .label {\n font-family: ${t.fontFamily};\n color: ${t.nodeTextColor||t.textColor};\n }\n\n .edge-pattern-dashed {\n stroke-dasharray: 8,8;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon\n {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n stroke-width: 1px;\n }\n\n .relationshipLine {\n stroke: ${t.lineColor};\n stroke-width: 1;\n fill: none;\n }\n\n .marker {\n fill: none !important;\n stroke: ${t.lineColor} !important;\n stroke-width: 1;\n }\n`),"getStyles");var S=v;var O={parser:k,get db(){return new _},renderer:g,styles:S}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8103.ed2b21471519b58a3d73.js b/.venv/share/jupyter/lab/static/8103.ed2b21471519b58a3d73.js new file mode 100644 index 0000000000000000000000000000000000000000..ff9e0cecde5e062d9279aa89ec1144c055a7468a --- /dev/null +++ b/.venv/share/jupyter/lab/static/8103.ed2b21471519b58a3d73.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8103],{88103:(O,Q,e)=>{e.r(Q);e.d(Q,{autoCloseTags:()=>rO,completionPath:()=>L,esLint:()=>SO,javascript:()=>aO,javascriptLanguage:()=>B,jsxLanguage:()=>M,localCompletionSource:()=>A,scopeCompletionSource:()=>D,snippets:()=>k,tsxLanguage:()=>F,typescriptLanguage:()=>K,typescriptSnippets:()=>_});var a=e(27421);var i=e(45145);const t=301,$=1,r=2,S=302,n=304,P=305,o=3,Z=4;const l=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];const c=125,X=59,s=47,p=42,g=43,Y=45;const b=new a.Aj({start:false,shift(O,Q){return Q==o||Q==Z||Q==n?O:Q==P},strict:false});const f=new a.Lu(((O,Q)=>{let{next:e}=O;if((e==c||e==-1||Q.context)&&Q.canShift(S))O.acceptToken(S)}),{contextual:true,fallback:true});const h=new a.Lu(((O,Q)=>{let{next:e}=O,a;if(l.indexOf(e)>-1)return;if(e==s&&((a=O.peek(1))==s||a==p))return;if(e!=c&&e!=X&&e!=-1&&!Q.context&&Q.canShift(t))O.acceptToken(t)}),{contextual:true});const u=new a.Lu(((O,Q)=>{let{next:e}=O;if(e==g||e==Y){O.advance();if(e==O.next){O.advance();let e=!Q.context&&Q.canShift($);O.acceptToken(e?$:r)}}}),{contextual:true});const W=(0,i.styleTags)({"get set async static":i.tags.modifier,"for while do if else switch try catch finally return throw break continue default case":i.tags.controlKeyword,"in of await yield void typeof delete instanceof":i.tags.operatorKeyword,"let var const function class extends":i.tags.definitionKeyword,"import export from":i.tags.moduleKeyword,"with debugger as new":i.tags.keyword,TemplateString:i.tags.special(i.tags.string),super:i.tags.atom,BooleanLiteral:i.tags.bool,this:i.tags.self,null:i.tags.null,Star:i.tags.modifier,VariableName:i.tags.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":i.tags.function(i.tags.variableName),VariableDefinition:i.tags.definition(i.tags.variableName),Label:i.tags.labelName,PropertyName:i.tags.propertyName,PrivatePropertyName:i.tags.special(i.tags.propertyName),"CallExpression/MemberExpression/PropertyName":i.tags.function(i.tags.propertyName),"FunctionDeclaration/VariableDefinition":i.tags.function(i.tags.definition(i.tags.variableName)),"ClassDeclaration/VariableDefinition":i.tags.definition(i.tags.className),PropertyDefinition:i.tags.definition(i.tags.propertyName),PrivatePropertyDefinition:i.tags.definition(i.tags.special(i.tags.propertyName)),UpdateOp:i.tags.updateOperator,LineComment:i.tags.lineComment,BlockComment:i.tags.blockComment,Number:i.tags.number,String:i.tags.string,Escape:i.tags.escape,ArithOp:i.tags.arithmeticOperator,LogicOp:i.tags.logicOperator,BitOp:i.tags.bitwiseOperator,CompareOp:i.tags.compareOperator,RegExp:i.tags.regexp,Equals:i.tags.definitionOperator,Arrow:i.tags.function(i.tags.punctuation),": Spread":i.tags.punctuation,"( )":i.tags.paren,"[ ]":i.tags.squareBracket,"{ }":i.tags.brace,"InterpolationStart InterpolationEnd":i.tags.special(i.tags.brace),".":i.tags.derefOperator,", ;":i.tags.separator,"@":i.tags.meta,TypeName:i.tags.typeName,TypeDefinition:i.tags.definition(i.tags.typeName),"type enum interface implements namespace module declare":i.tags.definitionKeyword,"abstract global Privacy readonly override":i.tags.modifier,"is keyof unique infer":i.tags.operatorKeyword,JSXAttributeValue:i.tags.attributeValue,JSXText:i.tags.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":i.tags.angleBracket,"JSXIdentifier JSXNameSpacedName":i.tags.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":i.tags.attributeName,"JSXBuiltin/JSXIdentifier":i.tags.standard(i.tags.tagName)});const U={__proto__:null,export:14,as:19,from:27,default:30,async:35,function:36,extends:46,this:50,true:58,false:58,null:70,void:74,typeof:78,super:96,new:130,delete:146,yield:155,await:159,class:164,public:219,private:219,protected:219,readonly:221,instanceof:240,satisfies:243,in:244,const:246,import:278,keyof:333,unique:337,infer:343,is:379,abstract:399,implements:401,type:403,let:406,var:408,interface:415,enum:419,namespace:425,module:427,declare:431,global:435,for:456,of:465,while:468,with:472,do:476,if:480,else:482,switch:486,case:492,try:498,catch:502,finally:506,return:510,throw:514,break:518,continue:522,debugger:526};const m={__proto__:null,async:117,get:119,set:121,public:181,private:181,protected:181,static:183,abstract:185,override:187,readonly:193,accessor:195,new:383};const y={__proto__:null,"<":137};const x=a.U1.deserialize({version:14,states:"$BhO`QUOOO%QQUOOO'TQWOOP(_OSOOO*mQ(CjO'#CfO*tOpO'#CgO+SO!bO'#CgO+bO07`O'#DZO-sQUO'#DaO.TQUO'#DlO%QQUO'#DvO0[QUO'#EOOOQ(CY'#EW'#EWO0rQSO'#ETOOQO'#I_'#I_O0zQSO'#GjOOQO'#Eh'#EhO1VQSO'#EgO1[QSO'#EgO3^Q(CjO'#JbO5}Q(CjO'#JcO6kQSO'#FVO6pQ#tO'#FnOOQ(CY'#F_'#F_O6{O&jO'#F_O7ZQ,UO'#FuO8qQSO'#FtOOQ(CY'#Jc'#JcOOQ(CW'#Jb'#JbOOQQ'#J|'#J|O8vQSO'#IOO8{Q(C[O'#IPOOQQ'#JO'#JOOOQQ'#IT'#ITQ`QUOOO%QQUO'#DnO9TQUO'#DzO%QQUO'#D|O9[QSO'#GjO9aQ,UO'#ClO9oQSO'#EfO9zQSO'#EqO:PQ,UO'#F^O:nQSO'#GjO:sQSO'#GnO;OQSO'#GnO;^QSO'#GqO;^QSO'#GrO;^QSO'#GtO9[QSO'#GwO;}QSO'#GzO=`QSO'#CbO=pQSO'#HXO=xQSO'#H_O=xQSO'#HaO`QUO'#HcO=xQSO'#HeO=xQSO'#HhO=}QSO'#HnO>SQ(C]O'#HtO%QQUO'#HvO>_Q(C]O'#HxO>jQ(C]O'#HzO8{Q(C[O'#H|O>uQ(CjO'#CfO?wQWO'#DfQOQSOOO@_QSO'#EPO9aQ,UO'#EfO@jQSO'#EfO@uQ`O'#F^OOQQ'#Cd'#CdOOQ(CW'#Dk'#DkOOQ(CW'#Jf'#JfO%QQUO'#JfOBOQWO'#E_OOQ(CW'#E^'#E^OBYQ(C`O'#E_OBtQWO'#ESOOQO'#Ji'#JiOCYQWO'#ESOCgQWO'#E_OC}QWO'#EeODQQWO'#E_O@}QWO'#E_OBtQWO'#E_PDkO?MpO'#C`POOO)CDm)CDmOOOO'#IU'#IUODvOpO,59ROOQ(CY,59R,59ROOOO'#IV'#IVOEUO!bO,59RO%QQUO'#D]OOOO'#IX'#IXOEdO07`O,59uOOQ(CY,59u,59uOErQUO'#IYOFVQSO'#JdOHXQbO'#JdO+pQUO'#JdOH`QSO,59{OHvQSO'#EhOITQSO'#JqOI`QSO'#JpOI`QSO'#JpOIhQSO,5;UOImQSO'#JoOOQ(CY,5:W,5:WOItQUO,5:WOKuQ(CjO,5:bOLfQSO,5:jOLkQSO'#JmOMeQ(C[O'#JnO:sQSO'#JmOMlQSO'#JmOMtQSO,5;TOMyQSO'#JmOOQ(CY'#Cf'#CfO%QQUO'#EOONmQ`O,5:oOOQO'#Jj'#JjOOQO-E<]-E<]O9[QSO,5=UO! TQSO,5=UO! YQUO,5;RO!#]Q,UO'#EcO!$pQSO,5;RO!&YQ,UO'#DpO!&aQUO'#DuO!&kQWO,5;[O!&sQWO,5;[O%QQUO,5;[OOQQ'#E}'#E}OOQQ'#FP'#FPO%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]O%QQUO,5;]OOQQ'#FT'#FTO!'RQUO,5;nOOQ(CY,5;s,5;sOOQ(CY,5;t,5;tO!)UQSO,5;tOOQ(CY,5;u,5;uO%QQUO'#IeO!)^Q(C[O,5jOOQQ'#JW'#JWOOQQ,5>k,5>kOOQQ-EgQWO'#EkOOQ(CW'#Jo'#JoO!>nQ(C[O'#J}O8{Q(C[O,5=YO;^QSO,5=`OOQO'#Cr'#CrO!>yQWO,5=]O!?RQ,UO,5=^O!?^QSO,5=`O!?cQ`O,5=cO=}QSO'#G|O9[QSO'#HOO!?kQSO'#HOO9aQ,UO'#HRO!?pQSO'#HROOQQ,5=f,5=fO!?uQSO'#HSO!?}QSO'#ClO!@SQSO,58|O!@^QSO,58|O!BfQUO,58|OOQQ,58|,58|O!BsQ(C[O,58|O%QQUO,58|O!COQUO'#HZOOQQ'#H['#H[OOQQ'#H]'#H]O`QUO,5=sO!C`QSO,5=sO`QUO,5=yO`QUO,5={O!CeQSO,5=}O`QUO,5>PO!CjQSO,5>SO!CoQUO,5>YOOQQ,5>`,5>`O%QQUO,5>`O8{Q(C[O,5>bOOQQ,5>d,5>dO!GvQSO,5>dOOQQ,5>f,5>fO!GvQSO,5>fOOQQ,5>h,5>hO!G{QWO'#DXO%QQUO'#JfO!HjQWO'#JfO!IXQWO'#DgO!IjQWO'#DgO!K{QUO'#DgO!LSQSO'#JeO!L[QSO,5:QO!LaQSO'#ElO!LoQSO'#JrO!LwQSO,5;VO!L|QWO'#DgO!MZQWO'#EROOQ(CY,5:k,5:kO%QQUO,5:kO!MbQSO,5:kO=}QSO,5;QO!;xQWO,5;QO!tO+pQUO,5>tOOQO,5>z,5>zO#$vQUO'#IYOOQO-EtO$8XQSO1G5jO$8aQSO1G5vO$8iQbO1G5wO:sQSO,5>zO$8sQSO1G5sO$8sQSO1G5sO:sQSO1G5sO$8{Q(CjO1G5tO%QQUO1G5tO$9]Q(C[O1G5tO$9nQSO,5>|O:sQSO,5>|OOQO,5>|,5>|O$:SQSO,5>|OOQO-E<`-E<`OOQO1G0]1G0]OOQO1G0_1G0_O!)XQSO1G0_OOQQ7+([7+([O!#]Q,UO7+([O%QQUO7+([O$:bQSO7+([O$:mQ,UO7+([O$:{Q(CjO,59nO$=TQ(CjO,5UOOQQ,5>U,5>UO%QQUO'#HkO%&qQSO'#HmOOQQ,5>[,5>[O:sQSO,5>[OOQQ,5>^,5>^OOQQ7+)`7+)`OOQQ7+)f7+)fOOQQ7+)j7+)jOOQQ7+)l7+)lO%&vQWO1G5lO%'[Q$IUO1G0rO%'fQSO1G0rOOQO1G/m1G/mO%'qQ$IUO1G/mO=}QSO1G/mO!'RQUO'#DgOOQO,5>u,5>uOOQO-E{,5>{OOQO-E<_-E<_O!;xQWO1G/mOOQO-E<[-E<[OOQ(CY1G0X1G0XOOQ(CY7+%q7+%qO!MeQSO7+%qOOQ(CY7+&W7+&WO=}QSO7+&WO!;xQWO7+&WOOQO7+%t7+%tO$7kQ(CjO7+&POOQO7+&P7+&PO%QQUO7+&PO%'{Q(C[O7+&PO=}QSO7+%tO!;xQWO7+%tO%(WQ(C[O7+&POBtQWO7+%tO%(fQ(C[O7+&PO%(zQ(C`O7+&PO%)UQWO7+%tOBtQWO7+&PO%)cQWO7+&PO%)yQSO7++_O%)yQSO7++_O%*RQ(CjO7++`O%QQUO7++`OOQO1G4h1G4hO:sQSO1G4hO%*cQSO1G4hOOQO7+%y7+%yO!MeQSO<vOOQO-EwO%QQUO,5>wOOQO-ESQ$IUO1G0wO%>ZQ$IUO1G0wO%@RQ$IUO1G0wO%@fQ(CjO<VOOQQ,5>X,5>XO&#WQSO1G3vO:sQSO7+&^O!'RQUO7+&^OOQO7+%X7+%XO&#]Q$IUO1G5wO=}QSO7+%XOOQ(CY<zAN>zO%QQUOAN?VO=}QSOAN>zO&<^Q(C[OAN?VO!;xQWOAN>zO&zO&RO!V+iO^(qX'j(qX~O#W+mO'|%OO~Og+pO!X$yO'|%OO~O!X+rO~Oy+tO!XXO~O!t+yO~Ob,OO~O's#jO!W(sP~Ob%lO~O%a!OO's%|O~PRO!V,yO!W(fa~O!W2SO~P'TO^%^O#W2]O'j%^O~O^%^O!a#rO#W2]O'j%^O~O^%^O!a#rO!h%ZO!l2aO#W2]O'j%^O'|%OO(`'dO~O!]2bO!^2bO't!iO~PBtO![2eO!]2bO!^2bO#S2fO#T2fO't!iO~PBtO![2eO!]2bO!^2bO#P2gO#S2fO#T2fO't!iO~PBtO^%^O!a#rO!l2aO#W2]O'j%^O(`'dO~O^%^O'j%^O~P!3jO!V$^Oo$ja~O!S&|i!V&|i~P!3jO!V'xO!S(Wi~O!V(PO!S(di~O!S(ei!V(ei~P!3jO!V(]O!g(ai~O!V(bi!g(bi^(bi'j(bi~P!3jO#W2kO!V(bi!g(bi^(bi'j(bi~O|%vO!X%wO!x]O#a2nO#b2mO's%eO~O|%vO!X%wO#b2mO's%eO~Og2uO!X'QO%`2tO~Og2uO!X'QO%`2tO'|%OO~O#cvaPvaXva^vakva!eva!fva!hva!lva#fva#gva#hva#iva#jva#kva#lva#mva#nva#pva#rva#tva#uva'jva(Qva(`va!gva!Sva'hvaova!Xva%`va!ava~P#M{O#c$kaP$kaX$ka^$kak$kaz$ka!e$ka!f$ka!h$ka!l$ka#f$ka#g$ka#h$ka#i$ka#j$ka#k$ka#l$ka#m$ka#n$ka#p$ka#r$ka#t$ka#u$ka'j$ka(Q$ka(`$ka!g$ka!S$ka'h$kao$ka!X$ka%`$ka!a$ka~P#NqO#c$maP$maX$ma^$mak$maz$ma!e$ma!f$ma!h$ma!l$ma#f$ma#g$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#p$ma#r$ma#t$ma#u$ma'j$ma(Q$ma(`$ma!g$ma!S$ma'h$mao$ma!X$ma%`$ma!a$ma~P$ dO#c${aP${aX${a^${ak${az${a!V${a!e${a!f${a!h${a!l${a#f${a#g${a#h${a#i${a#j${a#k${a#l${a#m${a#n${a#p${a#r${a#t${a#u${a'j${a(Q${a(`${a!g${a!S${a'h${a#W${ao${a!X${a%`${a!a${a~P#(yO^#Zq!V#Zq'j#Zq'h#Zq!S#Zq!g#Zqo#Zq!X#Zq%`#Zq!a#Zq~P!3jOd'OX!V'OX~P!$uO!V._Od(Za~O!U2}O!V'PX!g'PX~P%QO!V.bO!g([a~O!V.bO!g([a~P!3jO!S3QO~O#x!ja!W!ja~PI{O#x!ba!V!ba!W!ba~P#?dO#x!na!W!na~P!6TO#x!pa!W!pa~P!8nO!X3dO$TfO$^3eO~O!W3iO~Oo3jO~P#(yO^$gq!V$gq'j$gq'h$gq!S$gq!g$gqo$gq!X$gq%`$gq!a$gq~P!3jO!S3kO~Ol.}O'uTO'xUO~Oy)sO|)tO(h)xOg%Wi(g%Wi!V%Wi#W%Wi~Od%Wi#x%Wi~P$HbOy)sO|)tOg%Yi(g%Yi(h%Yi!V%Yi#W%Yi~Od%Yi#x%Yi~P$ITO(`$WO~P#(yO!U3nO's%eO!V'YX!g'YX~O!V/VO!g(ma~O!V/VO!a#rO!g(ma~O!V/VO!a#rO(`'dO!g(ma~Od$ti!V$ti#W$ti#x$ti~P!-jO!U3vO's*UO!S'[X!V'[X~P!.XO!V/_O!S(na~O!V/_O!S(na~P#(yO!a#rO~O!a#rO#n4OO~Ok4RO!a#rO(`'dO~Od(Oi!V(Oi~P!-jO#W4UOd(Oi!V(Oi~P!-jO!g4XO~O^$hq!V$hq'j$hq'h$hq!S$hq!g$hqo$hq!X$hq%`$hq!a$hq~P!3jO!V4]O!X(oX~P#(yO!f#tO~P3zO!X$rX%TYX^$rX!V$rX'j$rX~P!,aO%T4_OghXyhX|hX!XhX(ghX(hhX^hX!VhX'jhX~O%T4_O~O%a4fO's+WO'uTO'xUO!V'eX!W'eX~O!V0_O!W(ua~OX4jO~O]4kO~O!S4oO~O^%^O'j%^O~P#(yO!X$yO~P#(yO!V4tO#W4vO!W(rX~O!W4wO~Ol!kO|4yO![5WO!]4}O!^4}O!x;oO!|5VO!}5UO#O5UO#P5TO#S5SO#T!wO't!iO'uTO'xUO(T!jO(_!nO~O!W5RO~P%#XOg5]O!X0zO%`5[O~Og5]O!X0zO%`5[O'|%OO~O's#jO!V'dX!W'dX~O!V1VO!W(sa~O'uTO'xUO(T5fO~O]5jO~O!g5mO~P%QO^5oO~O^5oO~P%QO#n5qO&Q5rO~PMPO_1mO!W5vO&`1lO~P`O!a5xO~O!a5zO!V(Yi!W(Yi!a(Yi!h(Yi'|(Yi~O!V#`i!W#`i~P#?dO#W5{O!V#`i!W#`i~O!V!Zi!W!Zi~P#?dO^%^O#W6UO'j%^O~O^%^O!a#rO#W6UO'j%^O~O^%^O!a#rO!l6ZO#W6UO'j%^O(`'dO~O!h%ZO'|%OO~P%(fO!]6[O!^6[O't!iO~PBtO![6_O!]6[O!^6[O#S6`O#T6`O't!iO~PBtO!V(]O!g(aq~O!V(bq!g(bq^(bq'j(bq~P!3jO|%vO!X%wO#b6dO's%eO~O!X'QO%`6gO~Og6jO!X'QO%`6gO~O#c%WiP%WiX%Wi^%Wik%Wiz%Wi!e%Wi!f%Wi!h%Wi!l%Wi#f%Wi#g%Wi#h%Wi#i%Wi#j%Wi#k%Wi#l%Wi#m%Wi#n%Wi#p%Wi#r%Wi#t%Wi#u%Wi'j%Wi(Q%Wi(`%Wi!g%Wi!S%Wi'h%Wio%Wi!X%Wi%`%Wi!a%Wi~P$HbO#c%YiP%YiX%Yi^%Yik%Yiz%Yi!e%Yi!f%Yi!h%Yi!l%Yi#f%Yi#g%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#p%Yi#r%Yi#t%Yi#u%Yi'j%Yi(Q%Yi(`%Yi!g%Yi!S%Yi'h%Yio%Yi!X%Yi%`%Yi!a%Yi~P$ITO#c$tiP$tiX$ti^$tik$tiz$ti!V$ti!e$ti!f$ti!h$ti!l$ti#f$ti#g$ti#h$ti#i$ti#j$ti#k$ti#l$ti#m$ti#n$ti#p$ti#r$ti#t$ti#u$ti'j$ti(Q$ti(`$ti!g$ti!S$ti'h$ti#W$tio$ti!X$ti%`$ti!a$ti~P#(yOd'Oa!V'Oa~P!-jO!V'Pa!g'Pa~P!3jO!V.bO!g([i~O#x#Zi!V#Zi!W#Zi~P#?dOP$YOy#vOz#wO|#xO!f#tO!h#uO!l$YO(QVOX#eik#ei!e#ei#g#ei#h#ei#i#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~O#f#ei~P%2xO#f;wO~P%2xOP$YOy#vOz#wO|#xO!f#tO!h#uO!l$YO#f;wO#g;xO#h;xO#i;xO(QVOX#ei!e#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~Ok#ei~P%5TOk;yO~P%5TOP$YOk;yOy#vOz#wO|#xO!f#tO!h#uO!l$YO#f;wO#g;xO#h;xO#i;xO#j;zO(QVO#p#ei#r#ei#t#ei#u#ei#x#ei(`#ei(g#ei(h#ei!V#ei!W#ei~OX#ei!e#ei#k#ei#l#ei#m#ei#n#ei~P%7`OXbO^#vy!V#vy'j#vy'h#vy!S#vy!g#vyo#vy!X#vy%`#vy!a#vy~P!3jOg=jOy)sO|)tO(g)vO(h)xO~OP#eiX#eik#eiz#ei!e#ei!f#ei!h#ei!l#ei#f#ei#g#ei#h#ei#i#ei#j#ei#k#ei#l#ei#m#ei#n#ei#p#ei#r#ei#t#ei#u#ei#x#ei(Q#ei(`#ei!V#ei!W#ei~P%AYO!f#tOP(PXX(PXg(PXk(PXy(PXz(PX|(PX!e(PX!h(PX!l(PX#f(PX#g(PX#h(PX#i(PX#j(PX#k(PX#l(PX#m(PX#n(PX#p(PX#r(PX#t(PX#u(PX#x(PX(Q(PX(`(PX(g(PX(h(PX!V(PX!W(PX~O#x#yi!V#yi!W#yi~P#?dO#x!ni!W!ni~P$!qO!W6vO~O!V'Xa!W'Xa~P#?dO!a#rO(`'dO!V'Ya!g'Ya~O!V/VO!g(mi~O!V/VO!a#rO!g(mi~Od$tq!V$tq#W$tq#x$tq~P!-jO!S'[a!V'[a~P#(yO!a6}O~O!V/_O!S(ni~P#(yO!V/_O!S(ni~O!S7RO~O!a#rO#n7WO~Ok7XO!a#rO(`'dO~O!S7ZO~Od$vq!V$vq#W$vq#x$vq~P!-jO^$hy!V$hy'j$hy'h$hy!S$hy!g$hyo$hy!X$hy%`$hy!a$hy~P!3jO!V4]O!X(oa~O^#Zy!V#Zy'j#Zy'h#Zy!S#Zy!g#Zyo#Zy!X#Zy%`#Zy!a#Zy~P!3jOX7`O~O!V0_O!W(ui~O]7fO~O!a5zO~O(T(qO!V'aX!W'aX~O!V4tO!W(ra~O!h%ZO'|%OO^(YX!a(YX!l(YX#W(YX'j(YX(`(YX~O's7oO~P.[O!x;oO!|7rO!}7qO#O7qO#P7pO#S'bO#T'bO~PBtO^%^O!a#rO!l'hO#W'fO'j%^O(`'dO~O!W7vO~P%#XOl!kO'uTO'xUO(T!jO(_!nO~O|7wO~P%MdO![7{O!]7zO!^7zO#P7pO#S'bO#T'bO't!iO~PBtO![7{O!]7zO!^7zO!}7|O#O7|O#P7pO#S'bO#T'bO't!iO~PBtO!]7zO!^7zO't!iO(T!jO(_!nO~O!X0zO~O!X0zO%`8OO~Og8RO!X0zO%`8OO~OX8WO!V'da!W'da~O!V1VO!W(si~O!g8[O~O!g8]O~O!g8^O~O!g8^O~P%QO^8`O~O!a8cO~O!g8dO~O!V(ei!W(ei~P#?dO^%^O#W8lO'j%^O~O^%^O!a#rO#W8lO'j%^O~O^%^O!a#rO!l8pO#W8lO'j%^O(`'dO~O!h%ZO'|%OO~P&$QO!]8qO!^8qO't!iO~PBtO!V(]O!g(ay~O!V(by!g(by^(by'j(by~P!3jO!X'QO%`8uO~O#c$tqP$tqX$tq^$tqk$tqz$tq!V$tq!e$tq!f$tq!h$tq!l$tq#f$tq#g$tq#h$tq#i$tq#j$tq#k$tq#l$tq#m$tq#n$tq#p$tq#r$tq#t$tq#u$tq'j$tq(Q$tq(`$tq!g$tq!S$tq'h$tq#W$tqo$tq!X$tq%`$tq!a$tq~P#(yO#c$vqP$vqX$vq^$vqk$vqz$vq!V$vq!e$vq!f$vq!h$vq!l$vq#f$vq#g$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#p$vq#r$vq#t$vq#u$vq'j$vq(Q$vq(`$vq!g$vq!S$vq'h$vq#W$vqo$vq!X$vq%`$vq!a$vq~P#(yO!V'Pi!g'Pi~P!3jO#x#Zq!V#Zq!W#Zq~P#?dOy/yOz/yO|/zOPvaXvagvakva!eva!fva!hva!lva#fva#gva#hva#iva#jva#kva#lva#mva#nva#pva#rva#tva#uva#xva(Qva(`va(gva(hva!Vva!Wva~Oy)sO|)tOP$kaX$kag$kak$kaz$ka!e$ka!f$ka!h$ka!l$ka#f$ka#g$ka#h$ka#i$ka#j$ka#k$ka#l$ka#m$ka#n$ka#p$ka#r$ka#t$ka#u$ka#x$ka(Q$ka(`$ka(g$ka(h$ka!V$ka!W$ka~Oy)sO|)tOP$maX$mag$mak$maz$ma!e$ma!f$ma!h$ma!l$ma#f$ma#g$ma#h$ma#i$ma#j$ma#k$ma#l$ma#m$ma#n$ma#p$ma#r$ma#t$ma#u$ma#x$ma(Q$ma(`$ma(g$ma(h$ma!V$ma!W$ma~OP${aX${ak${az${a!e${a!f${a!h${a!l${a#f${a#g${a#h${a#i${a#j${a#k${a#l${a#m${a#n${a#p${a#r${a#t${a#u${a#x${a(Q${a(`${a!V${a!W${a~P%AYO#x$gq!V$gq!W$gq~P#?dO#x$hq!V$hq!W$hq~P#?dO!W9PO~O#x9QO~P!-jO!a#rO!V'Yi!g'Yi~O!a#rO(`'dO!V'Yi!g'Yi~O!V/VO!g(mq~O!S'[i!V'[i~P#(yO!V/_O!S(nq~O!S9WO~P#(yO!S9WO~Od(Oy!V(Oy~P!-jO!V'_a!X'_a~P#(yO!X%Sq^%Sq!V%Sq'j%Sq~P#(yOX9]O~O!V0_O!W(uq~O#W9aO!V'aa!W'aa~O!V4tO!W(ri~P#?dOPYXXYXkYXyYXzYX|YX!SYX!VYX!eYX!fYX!hYX!lYX#WYX#ccX#fYX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#pYX#rYX#tYX#uYX#zYX(QYX(`YX(gYX(hYX~O!a%QX#n%QX~P&6lO#S-cO#T-cO~PBtO#P9eO#S-cO#T-cO~PBtO!}9fO#O9fO#P9eO#S-cO#T-cO~PBtO!]9iO!^9iO't!iO(T!jO(_!nO~O![9lO!]9iO!^9iO#P9eO#S-cO#T-cO't!iO~PBtO!X0zO%`9oO~O'uTO'xUO(T9tO~O!V1VO!W(sq~O!g9wO~O!g9wO~P%QO!g9yO~O!g9zO~O#W9|O!V#`y!W#`y~O!V#`y!W#`y~P#?dO^%^O#W:QO'j%^O~O^%^O!a#rO#W:QO'j%^O~O^%^O!a#rO!l:UO#W:QO'j%^O(`'dO~O!X'QO%`:XO~O#x#vy!V#vy!W#vy~P#?dOP$tiX$tik$tiz$ti!e$ti!f$ti!h$ti!l$ti#f$ti#g$ti#h$ti#i$ti#j$ti#k$ti#l$ti#m$ti#n$ti#p$ti#r$ti#t$ti#u$ti#x$ti(Q$ti(`$ti!V$ti!W$ti~P%AYOy)sO|)tO(h)xOP%WiX%Wig%Wik%Wiz%Wi!e%Wi!f%Wi!h%Wi!l%Wi#f%Wi#g%Wi#h%Wi#i%Wi#j%Wi#k%Wi#l%Wi#m%Wi#n%Wi#p%Wi#r%Wi#t%Wi#u%Wi#x%Wi(Q%Wi(`%Wi(g%Wi!V%Wi!W%Wi~Oy)sO|)tOP%YiX%Yig%Yik%Yiz%Yi!e%Yi!f%Yi!h%Yi!l%Yi#f%Yi#g%Yi#h%Yi#i%Yi#j%Yi#k%Yi#l%Yi#m%Yi#n%Yi#p%Yi#r%Yi#t%Yi#u%Yi#x%Yi(Q%Yi(`%Yi(g%Yi(h%Yi!V%Yi!W%Yi~O#x$hy!V$hy!W$hy~P#?dO#x#Zy!V#Zy!W#Zy~P#?dO!a#rO!V'Yq!g'Yq~O!V/VO!g(my~O!S'[q!V'[q~P#(yO!S:`O~P#(yO!V0_O!W(uy~O!V4tO!W(rq~O#S2fO#T2fO~PBtO#P:gO#S2fO#T2fO~PBtO!]:kO!^:kO't!iO(T!jO(_!nO~O!X0zO%`:nO~O!g:qO~O^%^O#W:vO'j%^O~O^%^O!a#rO#W:vO'j%^O~O!X'QO%`:{O~OP$tqX$tqk$tqz$tq!e$tq!f$tq!h$tq!l$tq#f$tq#g$tq#h$tq#i$tq#j$tq#k$tq#l$tq#m$tq#n$tq#p$tq#r$tq#t$tq#u$tq#x$tq(Q$tq(`$tq!V$tq!W$tq~P%AYOP$vqX$vqk$vqz$vq!e$vq!f$vq!h$vq!l$vq#f$vq#g$vq#h$vq#i$vq#j$vq#k$vq#l$vq#m$vq#n$vq#p$vq#r$vq#t$vq#u$vq#x$vq(Q$vq(`$vq!V$vq!W$vq~P%AYOd%[!Z!V%[!Z#W%[!Z#x%[!Z~P!-jO!V'aq!W'aq~P#?dO#S6`O#T6`O~PBtO!V#`!Z!W#`!Z~P#?dO^%^O#W;ZO'j%^O~O#c%[!ZP%[!ZX%[!Z^%[!Zk%[!Zz%[!Z!V%[!Z!e%[!Z!f%[!Z!h%[!Z!l%[!Z#f%[!Z#g%[!Z#h%[!Z#i%[!Z#j%[!Z#k%[!Z#l%[!Z#m%[!Z#n%[!Z#p%[!Z#r%[!Z#t%[!Z#u%[!Z'j%[!Z(Q%[!Z(`%[!Z!g%[!Z!S%[!Z'h%[!Z#W%[!Zo%[!Z!X%[!Z%`%[!Z!a%[!Z~P#(yOP%[!ZX%[!Zk%[!Zz%[!Z!e%[!Z!f%[!Z!h%[!Z!l%[!Z#f%[!Z#g%[!Z#h%[!Z#i%[!Z#j%[!Z#k%[!Z#l%[!Z#m%[!Z#n%[!Z#p%[!Z#r%[!Z#t%[!Z#u%[!Z#x%[!Z(Q%[!Z(`%[!Z!V%[!Z!W%[!Z~P%AYOo(UX~P1dO't!iO~P!'RO!ScX!VcX#WcX~P&6lOPYXXYXkYXyYXzYX|YX!VYX!VcX!eYX!fYX!hYX!lYX#WYX#WcX#ccX#fYX#gYX#hYX#iYX#jYX#kYX#lYX#mYX#nYX#pYX#rYX#tYX#uYX#zYX(QYX(`YX(gYX(hYX~O!acX!gYX!gcX(`cX~P'!sOP;nOQ;nOa=_Ob!fOikOk;nOlkOmkOskOu;nOw;nO|WO!QkO!RkO!XXO!c;qO!hZO!k;nO!l;nO!m;nO!o;rO!q;sO!t!eO$P!hO$TfO's)RO'uTO'xUO(QVO(_[O(l=]O~O!Vv!>v!BnPPP!BuHdPPPPPPPPPPP!FTP!GiPPHd!HyPHdPHdHdHdHdPHd!J`PP!MiP#!nP#!r#!|##Q##QP!MfP##U##UP#&ZP#&_HdHd#&e#)iAQPAQPAQAQP#*sAQAQ#,mAQ#.zAQ#0nAQAQ#1[#3W#3W#3[#3d#3W#3lP#3WPAQ#4hAQ#5pAQAQ6iPPP#6{PP#7e#7eP#7eP#7z#7ePP#8QP#7wP#7w#8d!1p#7w#9O#9U6f(}#9X(}P#9`#9`#9`P(}P(}P(}P(}PP(}P#9f#9iP#9i(}P#9mP#9pP(}P(}P(}P(}P(}P(}(}PP#9v#9|#:W#:^#:d#:j#:p#;O#;U#;[#;f#;l#b#?r#@Q#@W#@^#@d#@j#@t#@z#AQ#A[#An#AtPPPPPPPPPP#AzPPPPPPP#Bn#FYP#Gu#G|#HUPPPP#L`$ U$'t$'w$'z$)w$)z$)}$*UPP$*[$*`$+X$,X$,]$,qPP$,u$,{$-PP$-S$-W$-Z$.P$.g$.l$.o$.r$.x$.{$/P$/TR!yRmpOXr!X#a%]&d&f&g&i,^,c1g1jU!pQ'Q-OQ%ctQ%kwQ%rzQ&[!TS&x!c,vQ'W!f[']!m!r!s!t!u!vS*[$y*aQ+U%lQ+c%tQ+}&UQ,|'PQ-W'XW-`'^'_'`'aQ/p*cQ1U,OU2b-b-d-eS4}0z5QS6[2e2gU7z5U5V5WQ8q6_S9i7{7|Q:k9lR TypeParamList TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . ?. PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody MethodDeclaration AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:362,context:b,nodeProps:[["group",-26,6,14,16,62,198,202,205,206,208,211,214,225,227,233,235,237,239,242,248,254,256,258,260,262,264,265,"Statement",-32,10,11,25,28,29,35,45,48,49,51,56,64,72,76,78,80,81,102,103,112,113,130,133,135,136,137,138,140,141,161,162,164,"Expression",-23,24,26,30,34,36,38,165,167,169,170,172,173,174,176,177,178,180,181,182,192,194,196,197,"Type",-3,84,95,101,"ClassItem"],["openedBy",31,"InterpolationStart",50,"[",54,"{",69,"(",142,"JSXStartTag",154,"JSXStartTag JSXStartCloseTag"],["closedBy",33,"InterpolationEnd",44,"]",55,"}",70,")",143,"JSXSelfCloseEndTag JSXEndTag",159,"JSXEndTag"]],propSources:[W],skippedNodes:[0,3,4,268],repeatNodeCount:32,tokenData:"$>y(CSR!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tu>PuvBavwDxwxGgxyMvyz! Qz{!![{|!%O|}!&]}!O!%O!O!P!'g!P!Q!1w!Q!R#0t!R![#3T![!]#@T!]!^#Aa!^!_#Bk!_!`#GS!`!a#In!a!b#N{!b!c$$z!c!}>P!}#O$&U#O#P$'`#P#Q$,w#Q#R$.R#R#S>P#S#T$/`#T#o$0j#o#p$4z#p#q$5p#q#r$7Q#r#s$8^#s$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$I|>P$I|$I}$P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(n%d_$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$c&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$c&j'y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU'y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$c&j'vpOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'vpOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'vp'y!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$c&j'vp'y!b'l(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST'w#S$c&j'm(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$c&j'vp'y!b'm(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$c&j!l$Ip'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#p$Id$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#p$Id$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'u$(n$c&j'y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$c&j'y!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$c&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$^#t$c&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$^#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$^#t$c&j'y!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ'y!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$^#t'y!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hg$c&j'vp'y!bOY%ZYZ&cZr%Zrs&}st%Ztu`k$c&j'vp'y!b(T!LY's&;d$V#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P+d@`k$c&j'vp'y!b$V#tOY%ZYZ&cZr%Zrs&}st%Ztu@Tuw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![@T![!^%Z!^!_*g!_!c%Z!c!}@T!}#O%Z#O#P&c#P#R%Z#R#S@T#S#T%Z#T#o@T#o#p*g#p$g%Z$g;'S@T;'S;=`BT<%lO@T+dBWP;=`<%l@T(CSB^P;=`<%l>P%#SBl`$c&j'vp'y!b#h$IdOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`Cn!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#SCy_$c&j#z$Id'vp'y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%DfETa(h%Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#>fi$c&j'vp'y!bl$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q![#>Z![!^%Z!^!_*g!_!c%Z!c!i#>Z!i#O%Z#O#P&c#P#R%Z#R#S#>Z#S#T%Z#T#Z#>Z#Z#b%Z#b#c#5T#c#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%Gh#@b_!a$b$c&j#x%Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$f%Z$f$g+g$g#BY>P#BY#BZ$9h#BZ$IS>P$IS$I_$9h$I_$JT>P$JT$JU$9h$JU$KV>P$KV$KW$9h$KW&FU>P&FU&FV$9h&FV;'S>P;'S;=`BZ<%l?HT>P?HT?HU$9h?HUO>P(CS$=Uk$c&j'vp'y!b'm(;d(T!LY's&;d$V#tOY%ZYZ&cZr%Zrs&}st%Ztu>Puw%Zwx(rx}%Z}!O@T!O!Q%Z!Q![>P![!^%Z!^!_*g!_!c%Z!c!}>P!}#O%Z#O#P&c#P#R%Z#R#S>P#S#T%Z#T#o>P#o#p*g#p$g%Z$g;'S>P;'S;=`BZ<%lO>P",tokenizers:[h,u,2,3,4,5,6,7,8,9,10,11,12,13,f,new a.uC("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOq~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!O~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(S~~",141,325),new a.uC("j~RQYZXz{^~^O'p~~aP!P!Qd~iO'q~~",25,307)],topRules:{Script:[0,5],SingleExpression:[1,266],SingleClassItem:[2,267]},dialects:{jsx:13213,ts:13215},dynamicPrecedences:{76:1,78:1,162:1,190:1},specialized:[{term:311,get:O=>U[O]||-1},{term:327,get:O=>m[O]||-1},{term:67,get:O=>y[O]||-1}],tokenPrec:13238});var d=e(4452);var j=e(71674);var w=e(22819);var v=e(75128);var V=e(66575);const k=[(0,v.Gw)("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),(0,v.Gw)("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),(0,v.Gw)("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),(0,v.Gw)("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),(0,v.Gw)("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),(0,v.Gw)("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),(0,v.Gw)("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),(0,v.Gw)("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),(0,v.Gw)("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),(0,v.Gw)('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),(0,v.Gw)('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})];const _=k.concat([(0,v.Gw)("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),(0,v.Gw)("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),(0,v.Gw)("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]);const G=new V.NodeWeakMap;const q=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function T(O){return(Q,e)=>{let a=Q.node.getChild("VariableDefinition");if(a)e(a,O);return true}}const R=["FunctionDeclaration"];const C={FunctionDeclaration:T("function"),ClassDeclaration:T("class"),ClassExpression:()=>true,EnumDeclaration:T("constant"),TypeAliasDeclaration:T("type"),NamespaceDeclaration:T("namespace"),VariableDefinition(O,Q){if(!O.matchContext(R))Q(O,"variable")},TypeDefinition(O,Q){Q(O,"type")},__proto__:null};function z(O,Q){let e=G.get(Q);if(e)return e;let a=[],i=true;function t(Q,e){let i=O.sliceString(Q.from,Q.to);a.push({label:i,type:e})}Q.cursor(V.IterMode.IncludeAnonymous).iterate((Q=>{if(i){i=false}else if(Q.name){let O=C[Q.name];if(O&&O(Q,t)||q.has(Q.name))return false}else if(Q.to-Q.from>8192){for(let e of z(O,Q.node))a.push(e);return false}}));G.set(Q,a);return a}const I=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/;const E=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function A(O){let Q=(0,d.syntaxTree)(O.state).resolveInner(O.pos,-1);if(E.indexOf(Q.name)>-1)return null;let e=Q.name=="VariableName"||Q.to-Q.from<20&&I.test(O.state.sliceDoc(Q.from,Q.to));if(!e&&!O.explicit)return null;let a=[];for(let i=Q;i;i=i.parent){if(q.has(i.name))a=a.concat(z(O.state.doc,i))}return{options:a,from:e?Q.from:O.pos,validFor:I}}function J(O,Q,e){var a;let i=[];for(;;){let t=Q.firstChild,$;if((t===null||t===void 0?void 0:t.name)=="VariableName"){i.push(O(t));return{path:i.reverse(),name:e}}else if((t===null||t===void 0?void 0:t.name)=="MemberExpression"&&((a=$=t.lastChild)===null||a===void 0?void 0:a.name)=="PropertyName"){i.push(O($));Q=t}else{return null}}}function L(O){let Q=Q=>O.state.doc.sliceString(Q.from,Q.to);let e=(0,d.syntaxTree)(O.state).resolveInner(O.pos,-1);if(e.name=="PropertyName"){return J(Q,e.parent,Q(e))}else if((e.name=="."||e.name=="?.")&&e.parent.name=="MemberExpression"){return J(Q,e.parent,"")}else if(E.indexOf(e.name)>-1){return null}else if(e.name=="VariableName"||e.to-e.from<20&&I.test(Q(e))){return{path:[],name:Q(e)}}else if(e.name=="MemberExpression"){return J(Q,e,"")}else{return O.explicit?{path:[],name:""}:null}}function N(O,Q){let e=[],a=new Set;for(let t=0;;t++){for(let r of(Object.getOwnPropertyNames||Object.keys)(O)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(r)||a.has(r))continue;a.add(r);let $;try{$=O[r]}catch(i){continue}e.push({label:r,type:typeof $=="function"?/^[A-Z]/.test(r)?"class":Q?"function":"method":Q?"variable":"property",boost:-t})}let $=Object.getPrototypeOf(O);if(!$)return e;O=$}}function D(O){let Q=new Map;return e=>{let a=L(e);if(!a)return null;let i=O;for(let O of a.path){i=i[O];if(!i)return null}let t=Q.get(i);if(!t)Q.set(i,t=N(i,!a.path.length));return{from:e.pos-a.name.length,options:t,validFor:I}}}const B=d.LRLanguage.define({name:"javascript",parser:x.configure({props:[d.indentNodeProp.add({IfStatement:(0,d.continuedIndent)({except:/^\s*({|else\b)/}),TryStatement:(0,d.continuedIndent)({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:d.flatIndent,SwitchBody:O=>{let Q=O.textAfter,e=/^\s*\}/.test(Q),a=/^\s*(case|default)\b/.test(Q);return O.baseIndent+(e?0:a?1:2)*O.unit},Block:(0,d.delimitedIndent)({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"TemplateString BlockComment":()=>null,"Statement Property":(0,d.continuedIndent)({except:/^{/}),JSXElement(O){let Q=/^\s*<\//.test(O.textAfter);return O.lineIndent(O.node.from)+(Q?0:O.unit)},JSXEscape(O){let Q=/\s*\}/.test(O.textAfter);return O.lineIndent(O.node.from)+(Q?0:O.unit)},"JSXOpenTag JSXSelfClosingTag"(O){return O.column(O.node.from)+O.unit}}),d.foldNodeProp.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":d.foldInside,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}});const H={test:O=>/^JSX/.test(O.name),facet:(0,d.defineLanguageFacet)({commentTokens:{block:{open:"{/*",close:"*/}"}}})};const K=B.configure({dialect:"ts"},"typescript");const M=B.configure({dialect:"jsx",props:[d.sublanguageProp.add((O=>O.isTop?[H]:undefined))]});const F=B.configure({dialect:"jsx ts",props:[d.sublanguageProp.add((O=>O.isTop?[H]:undefined))]},"typescript");let OO=O=>({label:O,type:"keyword"});const QO="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(OO);const eO=QO.concat(["declare","implements","private","protected","public"].map(OO));function aO(O={}){let Q=O.jsx?O.typescript?F:M:O.typescript?K:B;let e=O.typescript?_.concat(eO):k.concat(QO);return new d.LanguageSupport(Q,[B.data.of({autocomplete:(0,v.Ar)(E,(0,v.et)(e))}),B.data.of({autocomplete:A}),O.jsx?rO:[]])}function iO(O){for(;;){if(O.name=="JSXOpenTag"||O.name=="JSXSelfClosingTag"||O.name=="JSXFragmentTag")return O;if(O.name=="JSXEscape"||!O.parent)return null;O=O.parent}}function tO(O,Q,e=O.length){for(let a=Q===null||Q===void 0?void 0:Q.firstChild;a;a=a.nextSibling){if(a.name=="JSXIdentifier"||a.name=="JSXBuiltin"||a.name=="JSXNamespacedName"||a.name=="JSXMemberExpression")return O.sliceString(a.from,Math.min(a.to,e))}return""}const $O=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent);const rO=w.EditorView.inputHandler.of(((O,Q,e,a,i)=>{if(($O?O.composing:O.compositionStarted)||O.state.readOnly||Q!=e||a!=">"&&a!="/"||!B.isActiveAt(O.state,Q,-1))return false;let t=i(),{state:$}=t;let r=$.changeByRange((O=>{var Q;let{head:e}=O,i=(0,d.syntaxTree)($).resolveInner(e-1,-1),t;if(i.name=="JSXStartTag")i=i.parent;if($.doc.sliceString(e-1,e)!=a||i.name=="JSXAttributeValue"&&i.to>e);else if(a==">"&&i.name=="JSXFragmentTag"){return{range:O,changes:{from:e,insert:``}}}else if(a=="/"&&i.name=="JSXStartCloseTag"){let O=i.parent,a=O.parent;if(a&&O.from==e-2&&((t=tO($.doc,a.firstChild,e))||((Q=a.firstChild)===null||Q===void 0?void 0:Q.name)=="JSXFragmentTag")){let O=`${t}>`;return{range:j.EditorSelection.cursor(e+O.length,-1),changes:{from:e,insert:O}}}}else if(a==">"){let Q=iO(i);if(Q&&Q.name=="JSXOpenTag"&&!/^\/?>|^<\//.test($.doc.sliceString(e,e+2))&&(t=tO($.doc,Q,e)))return{range:O,changes:{from:e,insert:``}}}return{range:O}}));if(r.changes.empty)return false;O.dispatch([t,$.update(r,{userEvent:"input.complete",scrollIntoView:true})]);return true}));function SO(O,Q){if(!Q){Q={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:true,node:true,es6:true,es2015:true,es2017:true,es2020:true},rules:{}};O.getRules().forEach(((O,e)=>{if(O.meta.docs.recommended)Q.rules[e]=2}))}return e=>{let{state:a}=e,i=[];for(let{from:t,to:$}of B.findRegions(a)){let e=a.doc.lineAt(t),r={line:e.number-1,col:t-e.from,pos:t};for(let S of O.verify(a.sliceDoc(t,$),Q))i.push(PO(S,a.doc,r))}return i}}function nO(O,Q,e,a){return e.line(O+a.line).from+Q+(O==1?a.col-1:-1)}function PO(O,Q,e){let a=nO(O.line,O.column,Q,e);let i={from:a,to:O.endLine!=null&&O.endColumn!=1?nO(O.endLine,O.endColumn,Q,e):a,message:O.message,source:O.ruleId?"eslint:"+O.ruleId:"eslint",severity:O.severity==1?"warning":"error"};if(O.fix){let{range:Q,text:t}=O.fix,$=Q[0]+e.pos-a,r=Q[1]+e.pos-a;i.actions=[{name:"fix",apply(O,Q){O.dispatch({changes:{from:Q+$,to:Q+r,insert:t},scrollIntoView:true})}}]}return i}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8217.801fbb0b549a74238760.js b/.venv/share/jupyter/lab/static/8217.801fbb0b549a74238760.js new file mode 100644 index 0000000000000000000000000000000000000000..2c9c66a941be9a4ac443a39dcb9cdc5447169c1f --- /dev/null +++ b/.venv/share/jupyter/lab/static/8217.801fbb0b549a74238760.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8217],{58217:(E,T,I)=>{I.r(T);I.d(T,{cobol:()=>i});var N="builtin",R="comment",A="string",O="atom",C="number",L="keyword",D="header",S="def",U="link";function P(E){var T={},I=E.split(" ");for(var N=0;N >= ");var n={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+\-]/};function G(E,T){if(E==="0"&&T.eat(/x/i)){T.eatWhile(n.hex);return true}if((E=="+"||E=="-")&&n.digit.test(T.peek())){T.eat(n.sign);E=T.next()}if(n.digit.test(E)){T.eat(E);T.eatWhile(n.digit);if("."==T.peek()){T.eat(".");T.eatWhile(n.digit)}if(T.eat(n.exponent)){T.eat(n.sign);T.eatWhile(n.digit)}return true}return false}const i={name:"cobol",startState:function(){return{indentStack:null,indentation:0,mode:false}},token:function(E,T){if(T.indentStack==null&&E.sol()){T.indentation=6}if(E.eatSpace()){return null}var I=null;switch(T.mode){case"string":var P=false;while((P=E.next())!=null){if((P=='"'||P=="'")&&!E.match(/['"]/,false)){T.mode=false;break}}I=A;break;default:var i=E.next();var r=E.column();if(r>=0&&r<=5){I=S}else if(r>=72&&r<=79){E.skipToEnd();I=D}else if(i=="*"&&r==6){E.skipToEnd();I=R}else if(i=='"'||i=="'"){T.mode="string";I=A}else if(i=="'"&&!n.digit_or_colon.test(E.peek())){I=O}else if(i=="."){I=U}else if(G(i,E)){I=C}else{if(E.current().match(n.symbol)){while(r<71){if(E.eat(n.symbol)===undefined){break}else{r++}}}if(M&&M.propertyIsEnumerable(E.current().toUpperCase())){I=L}else if(t&&t.propertyIsEnumerable(E.current().toUpperCase())){I=N}else if(e&&e.propertyIsEnumerable(E.current().toUpperCase())){I=O}else I=null}}return I},indent:function(E){if(E.indentStack==null)return E.indentation;return E.indentStack.indent}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8232.e31d5021e77a9b5215d6.js b/.venv/share/jupyter/lab/static/8232.e31d5021e77a9b5215d6.js new file mode 100644 index 0000000000000000000000000000000000000000..dbd038d3c0ae62f5d164dea626dc68902b0ea929 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8232.e31d5021e77a9b5215d6.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8232],{38232:(e,t,r)=>{r.r(t);r.d(t,{pascal:()=>p});function n(e){var t={},r=e.split(" ");for(var n=0;n!?|\/]/;function l(e,t){var r=e.next();if(r=="#"&&t.startOfLine){e.skipToEnd();return"meta"}if(r=='"'||r=="'"){t.tokenize=u(r);return t.tokenize(e,t)}if(r=="("&&e.eat("*")){t.tokenize=s;return s(e,t)}if(r=="{"){t.tokenize=c;return c(e,t)}if(/[\[\]\(\),;\:\.]/.test(r)){return null}if(/\d/.test(r)){e.eatWhile(/[\w\.]/);return"number"}if(r=="/"){if(e.eat("/")){e.skipToEnd();return"comment"}}if(o.test(r)){e.eatWhile(o);return"operator"}e.eatWhile(/[\w\$_]/);var n=e.current().toLowerCase();if(a.propertyIsEnumerable(n))return"keyword";if(i.propertyIsEnumerable(n))return"atom";return"variable"}function u(e){return function(t,r){var n=false,a,i=false;while((a=t.next())!=null){if(a==e&&!n){i=true;break}n=!n&&a=="\\"}if(i||!n)r.tokenize=null;return"string"}}function s(e,t){var r=false,n;while(n=e.next()){if(n==")"&&r){t.tokenize=null;break}r=n=="*"}return"comment"}function c(e,t){var r;while(r=e.next()){if(r=="}"){t.tokenize=null;break}}return"comment"}const p={name:"pascal",startState:function(){return{tokenize:null}},token:function(e,t){if(e.eatSpace())return null;var r=(t.tokenize||l)(e,t);if(r=="comment"||r=="meta")return r;return r},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{block:{open:"(*",close:"*)"}}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8313.aac706f5036a7209b3a8.js b/.venv/share/jupyter/lab/static/8313.aac706f5036a7209b3a8.js new file mode 100644 index 0000000000000000000000000000000000000000..d47b4a1c0d8449d7dea4119cdddc445252ae0c1a --- /dev/null +++ b/.venv/share/jupyter/lab/static/8313.aac706f5036a7209b3a8.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8313],{48313:(t,e,n)=>{n.r(e);n.d(e,{DocInput:()=>T,HighlightStyle:()=>Ft,IndentContext:()=>$,LRLanguage:()=>v,Language:()=>k,LanguageDescription:()=>M,LanguageSupport:()=>B,ParseContext:()=>C,StreamLanguage:()=>de,StringStream:()=>fe,TreeIndentContext:()=>K,bidiIsolates:()=>Be,bracketMatching:()=>ee,bracketMatchingHandle:()=>ne,codeFolding:()=>It,continuedIndent:()=>et,defaultHighlightStyle:()=>Gt,defineLanguageFacet:()=>g,delimitedIndent:()=>Y,ensureSyntaxTree:()=>x,flatIndent:()=>tt,foldAll:()=>yt,foldCode:()=>vt,foldEffect:()=>ut,foldGutter:()=>Mt,foldInside:()=>ot,foldKeymap:()=>At,foldNodeProp:()=>st,foldService:()=>it,foldState:()=>pt,foldable:()=>ft,foldedRanges:()=>gt,forceParsing:()=>S,getIndentUnit:()=>V,getIndentation:()=>W,highlightingFor:()=>$t,indentNodeProp:()=>z,indentOnInput:()=>rt,indentRange:()=>U,indentService:()=>R,indentString:()=>j,indentUnit:()=>F,language:()=>L,languageDataProp:()=>p,matchBrackets:()=>se,sublanguageProp:()=>m,syntaxHighlighting:()=>Ut,syntaxParserRunning:()=>P,syntaxTree:()=>b,syntaxTreeAvailable:()=>y,toggleFold:()=>Tt,unfoldAll:()=>St,unfoldCode:()=>bt,unfoldEffect:()=>ct});var r=n(66575);var i=n.n(r);var s=n(71674);var o=n.n(s);var a=n(22819);var l=n.n(a);var f=n(45145);var h=n.n(f);var u=n(23546);var c=n.n(u);var d;const p=new r.NodeProp;function g(t){return s.Facet.define({combine:t?e=>e.concat(t):undefined})}const m=new r.NodeProp;class k{constructor(t,e,n=[],r=""){this.data=t;this.name=r;if(!s.EditorState.prototype.hasOwnProperty("tree"))Object.defineProperty(s.EditorState.prototype,"tree",{get(){return b(this)}});this.parser=e;this.extension=[L.of(this),s.EditorState.languageData.of(((t,e,n)=>{let r=w(t,e,n),i=r.type.prop(p);if(!i)return[];let s=t.facet(i),o=r.type.prop(m);if(o){let i=r.resolve(e-r.from,n);for(let e of o)if(e.test(i,t)){let n=t.facet(e.facet);return e.type=="replace"?n:n.concat(s)}}return s}))].concat(n)}isActiveAt(t,e,n=-1){return w(t,e,n).type.prop(p)==this.data}findRegions(t){let e=t.facet(L);if((e===null||e===void 0?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[];let i=(t,e)=>{if(t.prop(p)==this.data){n.push({from:e,to:e+t.length});return}let s=t.prop(r.NodeProp.mounted);if(s){if(s.tree.prop(p)==this.data){if(s.overlay)for(let t of s.overlay)n.push({from:t.from+e,to:t.to+e});else n.push({from:e,to:e+t.length});return}else if(s.overlay){let t=n.length;i(s.tree,s.overlay[0].from+e);if(n.length>t)return}}for(let n=0;nt.isTop?e:undefined))]}),t.name)}configure(t,e){return new v(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function b(t){let e=t.field(k.state,false);return e?e.tree:r.Tree.empty}function x(t,e,n=50){var r;let i=(r=t.field(k.state,false))===null||r===void 0?void 0:r.context;if(!i)return null;let s=i.viewport;i.updateViewport({from:0,to:e});let o=i.isDone(e)||i.work(n,e)?i.tree:null;i.updateViewport(s);return o}function y(t,e=t.doc.length){var n;return((n=t.field(k.state,false))===null||n===void 0?void 0:n.context.isDone(e))||false}function S(t,e=t.viewport.to,n=100){let r=x(t.state,e,n);if(r!=b(t.state))t.dispatch({});return!!r}function P(t){var e;return((e=t.plugin(E))===null||e===void 0?void 0:e.isWorking())||false}class T{constructor(t){this.doc=t;this.cursorPos=0;this.string="";this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){this.string=this.cursor.next(t-this.cursorPos).value;this.cursorPos=t+this.string.length;return this.cursorPos-this.string.length}chunk(t){this.syncTo(t);return this.string}get lineChunks(){return true}read(t,e){let n=this.cursorPos-this.string.length;if(t=this.cursorPos)return this.doc.sliceString(t,e);else return this.string.slice(t-n,e-n)}}let A=null;class C{constructor(t,e,n=[],r,i,s,o,a){this.parser=t;this.state=e;this.fragments=n;this.tree=r;this.treeLen=i;this.viewport=s;this.skipped=o;this.scheduleOn=a;this.parse=null;this.tempSkipped=[]}static create(t,e,n){return new C(t,e,[],r.Tree.empty,0,n,[],null)}startParse(){return this.parser.startParse(new T(this.state.doc),this.fragments)}work(t,e){if(e!=null&&e>=this.state.doc.length)e=undefined;if(this.tree!=r.Tree.empty&&this.isDone(e!==null&&e!==void 0?e:this.state.doc.length)){this.takeTree();return true}return this.withContext((()=>{var n;if(typeof t=="number"){let e=Date.now()+t;t=()=>Date.now()>e}if(!this.parse)this.parse=this.startParse();if(e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e=this.treeLen){if(this.parse.stoppedAt==null||this.parse.stoppedAt>t)this.parse.stopAt(t);this.withContext((()=>{while(!(e=this.parse.advance())){}}));this.treeLen=t;this.tree=e;this.fragments=this.withoutTempSkipped(r.TreeFragment.addTree(this.tree,this.fragments,true));this.parse=null}}withContext(t){let e=A;A=this;try{return t()}finally{A=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=D(t,e.from,e.to);return t}changes(t,e){let{fragments:n,tree:i,treeLen:s,viewport:o,skipped:a}=this;this.takeTree();if(!t.empty){let e=[];t.iterChangedRanges(((t,n,r,i)=>e.push({fromA:t,toA:n,fromB:r,toB:i})));n=r.TreeFragment.applyChanges(n,e);i=r.Tree.empty;s=0;o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)};if(this.skipped.length){a=[];for(let e of this.skipped){let n=t.mapPos(e.from,1),r=t.mapPos(e.to,-1);if(nt.from){this.fragments=D(this.fragments,e,r);this.skipped.splice(n--,1)}}if(this.skipped.length>=e)return false;this.reset();return true}reset(){if(this.parse){this.takeTree();this.parse=null}}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends r.Parser{createParse(e,n,i){let s=i[0].from,o=i[i.length-1].to;let a={parsedPos:s,advance(){let e=A;if(e){for(let t of i)e.tempSkipped.push(t);if(t)e.scheduleOn=e.scheduleOn?Promise.all([e.scheduleOn,t]):t}this.parsedPos=o;return new r.Tree(r.NodeType.none,[],[],o-s)},stoppedAt:null,stopAt(){}};return a}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return A}}function D(t,e,n){return r.TreeFragment.applyChanges(t,[{fromA:e,toA:n,fromB:e,toB:n}])}class I{constructor(t){this.context=t;this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state);let n=this.context.treeLen==t.startState.doc.length?undefined:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);if(!e.work(20,n))e.takeTree();return new I(e)}static init(t){let e=Math.min(3e3,t.doc.length);let n=C.create(t.facet(L).parser,t,{from:0,to:e});if(!n.work(20,e))n.takeTree();return new I(n)}}k.state=s.StateField.define({create:I.init,update(t,e){for(let n of e.effects)if(n.is(k.setState))return n.value;if(e.startState.facet(L)!=e.state.facet(L))return I.init(e.state);return t.apply(e)}});let N=t=>{let e=setTimeout((()=>t()),500);return()=>clearTimeout(e)};if(typeof requestIdleCallback!="undefined")N=t=>{let e=-1,n=setTimeout((()=>{e=requestIdleCallback(t,{timeout:500-100})}),100);return()=>e<0?clearTimeout(n):cancelIdleCallback(e)};const O=typeof navigator!="undefined"&&((d=navigator.scheduling)===null||d===void 0?void 0:d.isInputPending)?()=>navigator.scheduling.isInputPending():null;const E=a.ViewPlugin.fromClass(class t{constructor(t){this.view=t;this.working=null;this.workScheduled=0;this.chunkEnd=-1;this.chunkBudget=-1;this.work=this.work.bind(this);this.scheduleWork()}update(t){let e=this.view.state.field(k.state).context;if(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)this.scheduleWork();if(t.docChanged||t.selectionSet){if(this.view.hasFocus)this.chunkBudget+=50;this.scheduleWork()}this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(k.state);if(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))this.working=N(this.work)}work(t){this.working=null;let e=Date.now();if(this.chunkEndr+1e3;let a=i.context.work((()=>O&&O()||Date.now()>s),r+(o?0:1e5));this.chunkBudget-=Date.now()-e;if(a||this.chunkBudget<=0){i.context.takeTree();this.view.dispatch({effects:k.setState.of(new I(i.context))})}if(this.chunkBudget>0&&!(a&&!o))this.scheduleWork();this.checkAsyncSchedule(i.context)}checkAsyncSchedule(t){if(t.scheduleOn){this.workScheduled++;t.scheduleOn.then((()=>this.scheduleWork())).catch((t=>(0,a.logException)(this.view.state,t))).then((()=>this.workScheduled--));t.scheduleOn=null}}destroy(){if(this.working)this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}});const L=s.Facet.define({combine(t){return t.length?t[0]:null},enables:t=>[k.state,E,a.EditorView.contentAttributes.compute([t],(e=>{let n=e.facet(t);return n&&n.name?{"data-language":n.name}:{}}))]});class B{constructor(t,e=[]){this.language=t;this.support=e;this.extension=[t,e]}}class M{constructor(t,e,n,r,i,s=undefined){this.name=t;this.alias=e;this.extensions=n;this.filename=r;this.loadFunc=i;this.support=s;this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then((t=>this.support=t),(t=>{this.loading=null;throw t})))}static of(t){let{load:e,support:n}=t;if(!e){if(!n)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(n)}return new M(t.name,(t.alias||[]).concat(t.name).map((t=>t.toLowerCase())),t.extensions||[],t.filename,e,n)}static matchFilename(t,e){for(let r of t)if(r.filename&&r.filename.test(e))return r;let n=/\.([^.]+)$/.exec(e);if(n)for(let r of t)if(r.extensions.indexOf(n[1])>-1)return r;return null}static matchLanguageName(t,e,n=true){e=e.toLowerCase();for(let r of t)if(r.alias.some((t=>t==e)))return r;if(n)for(let r of t)for(let t of r.alias){let n=e.indexOf(t);if(n>-1&&(t.length>2||!/\w/.test(e[n-1])&&!/\w/.test(e[n+t.length])))return r}return null}}const R=s.Facet.define();const F=s.Facet.define({combine:t=>{if(!t.length)return" ";let e=t[0];if(!e||/\S/.test(e)||Array.from(e).some((t=>t!=e[0])))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return e}});function V(t){let e=t.facet(F);return e.charCodeAt(0)==9?t.tabSize*e.length:e.length}function j(t,e){let n="",r=t.tabSize,i=t.facet(F)[0];if(i=="\t"){while(e>=r){n+="\t";e-=r}i=" "}for(let s=0;s=e?H(t,n,e):null}function U(t,e,n){let r=Object.create(null);let i=new $(t,{overrideIndentation:t=>{var e;return(e=r[t])!==null&&e!==void 0?e:-1}});let s=[];for(let o=e;o<=n;){let e=t.doc.lineAt(o);o=e.to+1;let n=W(i,e.from);if(n==null)continue;if(!/\S/.test(e.text))n=0;let a=/^\s*/.exec(e.text)[0];let l=j(t,n);if(a!=l){r[e.from]=n;s.push({from:e.from,to:e.from+a.length,insert:l})}}return t.changes(s)}class ${constructor(t,e={}){this.state=t;this.options=e;this.unit=V(t)}lineAt(t,e=1){let n=this.state.doc.lineAt(t);let{simulateBreak:r,simulateDoubleBreak:i}=this.options;if(r!=null&&r>=n.from&&r<=n.to){if(i&&r==t)return{text:"",from:t};else if(e<0?r-1)i+=s-this.countColumn(n,n.search(/\S|$/));return i}countColumn(t,e=t.length){return(0,s.countColumn)(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:n,from:r}=this.lineAt(t,e);let i=this.options.overrideIndentation;if(i){let t=i(r);if(t>-1)return t}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const z=new r.NodeProp;function H(t,e,n){let r=e.resolveStack(n);let i=e.resolveInner(n,-1).resolve(n,0).enterUnfinishedNodesBefore(n);if(i!=r.node){let t=[];for(let e=i;e&&!(e.from==r.node.from&&e.type==r.node.type);e=e.parent)t.push(e);for(let e=t.length-1;e>=0;e--)r={node:t[e],next:r}}return G(r,t,n)}function G(t,e,n){for(let r=t;r;r=r.next){let t=q(r.node);if(t)return t(K.create(e,n,r))}return 0}function _(t){return t.pos==t.options.simulateBreak&&t.options.simulateDoubleBreak}function q(t){let e=t.type.prop(z);if(e)return e;let n=t.firstChild,i;if(n&&(i=n.type.prop(r.NodeProp.closedBy))){let e=t.lastChild,n=e&&i.indexOf(e.name)>-1;return t=>Z(t,true,1,undefined,n&&!_(t)?e.from:undefined)}return t.parent==null?J:null}function J(){return 0}class K extends ${constructor(t,e,n){super(t.state,t.options);this.base=t;this.pos=e;this.context=n}get node(){return this.context.node}static create(t,e,n){return new K(t,e,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let n=t.resolve(e.from);while(n.parent&&n.parent.from==n.from)n=n.parent;if(Q(n,t))break;e=this.state.doc.lineAt(n.from)}return this.lineIndent(e.from)}continue(){return G(this.context.next,this.base,this.pos)}}function Q(t,e){for(let n=e;n;n=n.parent)if(t==n)return true;return false}function X(t){let e=t.node;let n=e.childAfter(e.from),r=e.lastChild;if(!n)return null;let i=t.options.simulateBreak;let s=t.state.doc.lineAt(n.from);let o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=n.to;;){let t=e.childAfter(a);if(!t||t==r)return null;if(!t.type.isSkipped){if(t.from>=o)return null;let e=/^ */.exec(s.text.slice(n.to-s.from))[0].length;return{from:n.from,to:n.to+e}}a=t.to}}function Y({closing:t,align:e=true,units:n=1}){return r=>Z(r,e,n,t)}function Z(t,e,n,r,i){let s=t.textAfter,o=s.match(/^\s*/)[0].length;let a=r&&s.slice(o,o+r.length)==r||i==t.pos+o;let l=e?X(t):null;if(l)return a?t.column(l.from):t.column(l.to);return t.baseIndent+(a?0:t.unit*n)}const tt=t=>t.baseIndent;function et({except:t,units:e=1}={}){return n=>{let r=t&&t.test(n.textAfter);return n.baseIndent+(r?0:e*n.unit)}}const nt=200;function rt(){return s.EditorState.transactionFilter.of((t=>{if(!t.docChanged||!t.isUserEvent("input.type")&&!t.isUserEvent("input.complete"))return t;let e=t.startState.languageDataAt("indentOnInput",t.startState.selection.main.head);if(!e.length)return t;let n=t.newDoc,{head:r}=t.newSelection.main,i=n.lineAt(r);if(r>i.from+nt)return t;let s=n.sliceString(i.from,r);if(!e.some((t=>t.test(s))))return t;let{state:o}=t,a=-1,l=[];for(let{head:f}of o.selection.ranges){let t=o.doc.lineAt(f);if(t.from==a)continue;a=t.from;let e=W(o,t.from);if(e==null)continue;let n=/^\s*/.exec(t.text)[0];let r=j(o,e);if(n!=r)l.push({from:t.from,to:t.from+n.length,insert:r})}return l.length?[t,{changes:l,sequential:true}]:t}))}const it=s.Facet.define();const st=new r.NodeProp;function ot(t){let e=t.firstChild,n=t.lastChild;return e&&e.ton)continue;if(s&&i.from=e&&r.to>n)s=r}}return s}function lt(t){let e=t.lastChild;return e&&e.to==t.to&&e.type.isError}function ft(t,e,n){for(let r of t.facet(it)){let i=r(t,e,n);if(i)return i}return at(t,e,n)}function ht(t,e){let n=e.mapPos(t.from,1),r=e.mapPos(t.to,-1);return n>=r?undefined:{from:n,to:r}}const ut=s.StateEffect.define({map:ht});const ct=s.StateEffect.define({map:ht});function dt(t){let e=[];for(let{head:n}of t.state.selection.ranges){if(e.some((t=>t.from<=n&&t.to>=n)))continue;e.push(t.lineBlockAt(n))}return e}const pt=s.StateField.define({create(){return a.Decoration.none},update(t,e){t=t.map(e.changes);for(let n of e.effects){if(n.is(ut)&&!kt(t,n.value.from,n.value.to)){let{preparePlaceholder:r}=e.state.facet(Dt);let i=!r?Ot:a.Decoration.replace({widget:new Et(r(e.state,n.value))});t=t.update({add:[i.range(n.value.from,n.value.to)]})}else if(n.is(ct)){t=t.update({filter:(t,e)=>n.value.from!=t||n.value.to!=e,filterFrom:n.value.from,filterTo:n.value.to})}}if(e.selection){let n=false,{head:r}=e.selection.main;t.between(r,r,((t,e)=>{if(tr)n=true}));if(n)t=t.update({filterFrom:r,filterTo:r,filter:(t,e)=>e<=r||t>=r})}return t},provide:t=>a.EditorView.decorations.from(t),toJSON(t,e){let n=[];t.between(0,e.doc.length,((t,e)=>{n.push(t,e)}));return n},fromJSON(t){if(!Array.isArray(t)||t.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let n=0;n{if(!i||i.from>t)i={from:t,to:e}}));return i}function kt(t,e,n){let r=false;t.between(e,e,((t,i)=>{if(t==e&&i==n)r=true}));return r}function wt(t,e){return t.field(pt,false)?e:e.concat(s.StateEffect.appendConfig.of(It()))}const vt=t=>{for(let e of dt(t)){let n=ft(t.state,e.from,e.to);if(n){t.dispatch({effects:wt(t.state,[ut.of(n),xt(t,n)])});return true}}return false};const bt=t=>{if(!t.state.field(pt,false))return false;let e=[];for(let n of dt(t)){let r=mt(t.state,n.from,n.to);if(r)e.push(ct.of(r),xt(t,r,false))}if(e.length)t.dispatch({effects:e});return e.length>0};function xt(t,e,n=true){let r=t.state.doc.lineAt(e.from).number,i=t.state.doc.lineAt(e.to).number;return a.EditorView.announce.of(`${t.state.phrase(n?"Folded lines":"Unfolded lines")} ${r} ${t.state.phrase("to")} ${i}.`)}const yt=t=>{let{state:e}=t,n=[];for(let r=0;r{let e=t.state.field(pt,false);if(!e||!e.size)return false;let n=[];e.between(0,t.state.doc.length,((t,e)=>{n.push(ct.of({from:t,to:e}))}));t.dispatch({effects:n});return true};function Pt(t,e){for(let n=e;;){let r=ft(t.state,n.from,n.to);if(r&&r.to>e.from)return r;if(!n.from)return null;n=t.lineBlockAt(n.from-1)}}const Tt=t=>{let e=[];for(let n of dt(t)){let r=mt(t.state,n.from,n.to);if(r){e.push(ct.of(r),xt(t,r,false))}else{let r=Pt(t,n);if(r)e.push(ut.of(r),xt(t,r))}}if(e.length>0)t.dispatch({effects:wt(t.state,e)});return!!e.length};const At=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:vt},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:bt},{key:"Ctrl-Alt-[",run:yt},{key:"Ctrl-Alt-]",run:St}];const Ct={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"};const Dt=s.Facet.define({combine(t){return(0,s.combineConfig)(t,Ct)}});function It(t){let e=[pt,Rt];if(t)e.push(Dt.of(t));return e}function Nt(t,e){let{state:n}=t,r=n.facet(Dt);let i=e=>{let n=t.lineBlockAt(t.posAtDOM(e.target));let r=mt(t.state,n.from,n.to);if(r)t.dispatch({effects:ct.of(r)});e.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(t,i,e);let s=document.createElement("span");s.textContent=r.placeholderText;s.setAttribute("aria-label",n.phrase("folded code"));s.title=n.phrase("unfold");s.className="cm-foldPlaceholder";s.onclick=i;return s}const Ot=a.Decoration.replace({widget:new class extends a.WidgetType{toDOM(t){return Nt(t,null)}}});class Et extends a.WidgetType{constructor(t){super();this.value=t}eq(t){return this.value==t.value}toDOM(t){return Nt(t,this.value)}}const Lt={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>false};class Bt extends a.GutterMarker{constructor(t,e){super();this.config=t;this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");e.textContent=this.open?this.config.openText:this.config.closedText;e.title=t.state.phrase(this.open?"Fold line":"Unfold line");return e}}function Mt(t={}){let e=Object.assign(Object.assign({},Lt),t);let n=new Bt(e,true),r=new Bt(e,false);let i=a.ViewPlugin.fromClass(class{constructor(t){this.from=t.viewport.from;this.markers=this.buildMarkers(t)}update(t){if(t.docChanged||t.viewportChanged||t.startState.facet(L)!=t.state.facet(L)||t.startState.field(pt,false)!=t.state.field(pt,false)||b(t.startState)!=b(t.state)||e.foldingChanged(t))this.markers=this.buildMarkers(t.view)}buildMarkers(t){let e=new s.RangeSetBuilder;for(let i of t.viewportLineBlocks){let s=mt(t.state,i.from,i.to)?r:ft(t.state,i.from,i.to)?n:null;if(s)e.add(i.from,i.from,s)}return e.finish()}});let{domEventHandlers:o}=e;return[i,(0,a.gutter)({class:"cm-foldGutter",markers(t){var e;return((e=t.plugin(i))===null||e===void 0?void 0:e.markers)||s.RangeSet.empty},initialSpacer(){return new Bt(e,false)},domEventHandlers:Object.assign(Object.assign({},o),{click:(t,e,n)=>{if(o.click&&o.click(t,e,n))return true;let r=mt(t.state,e.from,e.to);if(r){t.dispatch({effects:ct.of(r)});return true}let i=ft(t.state,e.from,e.to);if(i){t.dispatch({effects:ut.of(i)});return true}return false}})}),It()]}const Rt=a.EditorView.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Ft{constructor(t,e){this.specs=t;let n;function r(t){let e=u.StyleModule.newName();(n||(n=Object.create(null)))["."+e]=t;return e}const i=typeof e.all=="string"?e.all:e.all?r(e.all):undefined;const s=e.scope;this.scope=s instanceof k?t=>t.prop(p)==s.data:s?t=>t==s:undefined;this.style=(0,f.tagHighlighter)(t.map((t=>({tag:t.tag,class:t.class||r(Object.assign({},t,{tag:null}))}))),{all:i}).style;this.module=n?new u.StyleModule(n):null;this.themeType=e.themeType}static define(t,e){return new Ft(t,e||{})}}const Vt=s.Facet.define();const jt=s.Facet.define({combine(t){return t.length?[t[0]]:null}});function Wt(t){let e=t.facet(Vt);return e.length?e:t.facet(jt)}function Ut(t,e){let n=[Ht],r;if(t instanceof Ft){if(t.module)n.push(a.EditorView.styleModule.of(t.module));r=t.themeType}if(e===null||e===void 0?void 0:e.fallback)n.push(jt.of(t));else if(r)n.push(Vt.computeN([a.EditorView.darkTheme],(e=>e.facet(a.EditorView.darkTheme)==(r=="dark")?[t]:[])));else n.push(Vt.of(t));return n}function $t(t,e,n){let r=Wt(t);let i=null;if(r)for(let s of r){if(!s.scope||n&&s.scope(n)){let t=s.style(e);if(t)i=i?i+" "+t:t}}return i}class zt{constructor(t){this.markCache=Object.create(null);this.tree=b(t.state);this.decorations=this.buildDeco(t,Wt(t.state));this.decoratedTo=t.viewport.to}update(t){let e=b(t.state),n=Wt(t.state);let r=n!=Wt(t.startState);let{viewport:i}=t.view,s=t.changes.mapPos(this.decoratedTo,1);if(e.length=i.to){this.decorations=this.decorations.map(t.changes);this.decoratedTo=s}else if(e!=this.tree||t.viewportChanged||r){this.tree=e;this.decorations=this.buildDeco(t.view,n);this.decoratedTo=i.to}}buildDeco(t,e){if(!e||!this.tree.length)return a.Decoration.none;let n=new s.RangeSetBuilder;for(let{from:r,to:i}of t.visibleRanges){(0,f.highlightTree)(this.tree,e,((t,e,r)=>{n.add(t,e,this.markCache[r]||(this.markCache[r]=a.Decoration.mark({class:r})))}),r,i)}return n.finish()}}const Ht=s.Prec.high(a.ViewPlugin.fromClass(zt,{decorations:t=>t.decorations}));const Gt=Ft.define([{tag:f.tags.meta,color:"#404740"},{tag:f.tags.link,textDecoration:"underline"},{tag:f.tags.heading,textDecoration:"underline",fontWeight:"bold"},{tag:f.tags.emphasis,fontStyle:"italic"},{tag:f.tags.strong,fontWeight:"bold"},{tag:f.tags.strikethrough,textDecoration:"line-through"},{tag:f.tags.keyword,color:"#708"},{tag:[f.tags.atom,f.tags.bool,f.tags.url,f.tags.contentSeparator,f.tags.labelName],color:"#219"},{tag:[f.tags.literal,f.tags.inserted],color:"#164"},{tag:[f.tags.string,f.tags.deleted],color:"#a11"},{tag:[f.tags.regexp,f.tags.escape,f.tags.special(f.tags.string)],color:"#e40"},{tag:f.tags.definition(f.tags.variableName),color:"#00f"},{tag:f.tags.local(f.tags.variableName),color:"#30a"},{tag:[f.tags.typeName,f.tags.namespace],color:"#085"},{tag:f.tags.className,color:"#167"},{tag:[f.tags.special(f.tags.variableName),f.tags.macroName],color:"#256"},{tag:f.tags.definition(f.tags.propertyName),color:"#00c"},{tag:f.tags.comment,color:"#940"},{tag:f.tags.invalid,color:"#f00"}]);const _t=a.EditorView.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}});const qt=1e4,Jt="()[]{}";const Kt=s.Facet.define({combine(t){return(0,s.combineConfig)(t,{afterCursor:true,brackets:Jt,maxScanDistance:qt,renderMatch:Yt})}});const Qt=a.Decoration.mark({class:"cm-matchingBracket"}),Xt=a.Decoration.mark({class:"cm-nonmatchingBracket"});function Yt(t){let e=[];let n=t.matched?Qt:Xt;e.push(n.range(t.start.from,t.start.to));if(t.end)e.push(n.range(t.end.from,t.end.to));return e}const Zt=s.StateField.define({create(){return a.Decoration.none},update(t,e){if(!e.docChanged&&!e.selection)return t;let n=[];let r=e.state.facet(Kt);for(let i of e.state.selection.ranges){if(!i.empty)continue;let t=se(e.state,i.head,-1,r)||i.head>0&&se(e.state,i.head-1,1,r)||r.afterCursor&&(se(e.state,i.head,1,r)||i.heada.EditorView.decorations.from(t)});const te=[Zt,_t];function ee(t={}){return[Kt.of(t),te]}const ne=new r.NodeProp;function re(t,e,n){let i=t.prop(e<0?r.NodeProp.openedBy:r.NodeProp.closedBy);if(i)return i;if(t.name.length==1){let r=n.indexOf(t.name);if(r>-1&&r%2==(e<0?1:0))return[n[r+e]]}return null}function ie(t){let e=t.type.prop(ne);return e?e(t.node):t}function se(t,e,n,r={}){let i=r.maxScanDistance||qt,s=r.brackets||Jt;let o=b(t),a=o.resolveInner(e,n);for(let l=a;l;l=l.parent){let r=re(l.type,n,s);if(r&&l.from0?e>=i.from&&ei.from&&e<=i.to))return oe(t,e,n,l,i,r,s)}}return ae(t,e,n,o,a.type,i,s)}function oe(t,e,n,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to};let f=0,h=a===null||a===void 0?void 0:a.cursor();if(h&&(n<0?h.childBefore(r.from):h.childAfter(r.to)))do{if(n<0?h.to<=r.from:h.from>=r.to){if(f==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let f={from:n<0?e-1:e,to:n>0?e+1:e};let h=t.doc.iterRange(e,n>0?t.doc.length:0),u=0;for(let c=0;!h.next().done&&c<=s;){let t=h.value;if(n<0)c+=t.length;let s=e+c*n;for(let e=n>0?0:t.length-1,a=n>0?t.length:-1;e!=a;e+=n){let a=o.indexOf(t[e]);if(a<0||r.resolveInner(s+e,1).type!=i)continue;if(a%2==0==n>0){u++}else if(u==1){return{start:f,end:{from:s+e,to:s+e+1},matched:a>>1==l>>1}}else{u--}}if(n>0)c+=t.length}return h.done?{start:f,matched:false}:null}function le(t,e,n,r=0,i=0){if(e==null){e=t.search(/[^\s\u00a0]/);if(e==-1)e=t.length}let s=i;for(let o=r;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||undefined}next(){if(this.pose}eatSpace(){let t=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos)))++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1){this.pos=e;return true}}backUp(t){this.pos-=t}column(){if(this.lastColumnPosn?t.toLowerCase():t;let i=this.string.substr(this.pos,t.length);if(r(i)==r(t)){if(e!==false)this.pos+=t.length;return true}else return null}else{let n=this.string.slice(this.pos).match(t);if(n&&n.index>0)return null;if(n&&e!==false)this.pos+=n[0].length;return n}}current(){return this.string.slice(this.start,this.pos)}}function he(t){return{name:t.name||"",token:t.token,blankLine:t.blankLine||(()=>{}),startState:t.startState||(()=>true),copyState:t.copyState||ue,indent:t.indent||(()=>null),languageData:t.languageData||{},tokenTable:t.tokenTable||ve,mergeTokens:t.mergeTokens!==false}}function ue(t){if(typeof t!="object")return t;let e={};for(let n in t){let r=t[n];e[n]=r instanceof Array?r.slice():r}return e}const ce=new WeakMap;class de extends k{constructor(t){let e=g(t.languageData);let n=he(t),i;let s=new class extends r.Parser{createParse(t,e,n){return new ke(i,t,e,n)}};super(e,s,[],t.name);this.topNode=Ie(e,this);i=this;this.streamParser=n;this.stateAfter=new r.NodeProp({perNode:true});this.tokenTable=t.tokenTable?new Te(n.tokenTable):Ae}static define(t){return new de(t)}getIndent(t){let e=undefined;let{overrideIndentation:n}=t.options;if(n){e=ce.get(t.state);if(e!=null&&e1e4)return null;while(i=i&&n+e.length<=s&&e.prop(t.stateAfter);if(o)return{state:t.streamParser.copyState(o),pos:n+e.length};for(let a=e.children.length-1;a>=0;a--){let o=e.children[a],l=n+e.positions[a];let f=o instanceof r.Tree&&l=e.length)return e;if(!s&&n==0&&e.type==t.topNode)s=true;for(let o=e.children.length-1;o>=0;o--){let a=e.positions[o],l=e.children[o],f;if(an&&pe(t,r.tree,0-r.offset,n,s),a;if(o&&o.pos<=i&&(a=ge(t,r.tree,n+r.offset,o.pos+r.offset,false)))return{state:o.state,tree:a}}return{state:t.streamParser.startState(s?V(s):4),tree:r.Tree.empty}}class ke{constructor(t,e,n,r){this.lang=t;this.input=e;this.fragments=n;this.ranges=r;this.stoppedAt=null;this.chunks=[];this.chunkPos=[];this.chunk=[];this.chunkReused=undefined;this.rangeIndex=0;this.to=r[r.length-1].to;let i=C.get(),s=r[0].from;let{state:o,tree:a}=me(t,n,s,this.to,i===null||i===void 0?void 0:i.state);this.state=o;this.parsedPos=this.chunkStart=s+a.length;for(let l=0;lt.from<=i.viewport.from&&t.to>=i.viewport.from))){this.state=this.lang.streamParser.startState(V(i.state));i.skipUntilInView(this.parsedPos,i.viewport.from);this.parsedPos=i.viewport.from}this.moveRangeIndex()}advance(){let t=C.get();let e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt);let n=Math.min(e,this.chunkStart+2048);if(t)n=Math.min(n,t.viewport.to);while(this.parsedPos=e)return this.finish();if(t&&this.parsedPos>=t.viewport.to){t.skipUntilInView(this.parsedPos,e);return this.finish()}return null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(!this.input.lineChunks){let t=e.indexOf("\n");if(t>-1)e=e.slice(0,t)}else if(e=="\n"){e=""}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),n=t+e.length;for(let r=this.rangeIndex;;){let t=this.ranges[r].to;if(t>=n)break;e=e.slice(0,t-(n-e.length));r++;if(r==this.ranges.length)break;let i=this.ranges[r].from;let s=this.lineAfter(i);e+=s;n=i+s.length}return{line:e,end:n}}skipGapsTo(t,e,n){for(;;){let r=this.ranges[this.rangeIndex].to,i=t+e;if(n>0?r>i:r>=i)break;let s=this.ranges[++this.rangeIndex].from;e+=s-r}return e}moveRangeIndex(){while(this.ranges[this.rangeIndex].to1){r=this.skipGapsTo(e,r,1);e+=r;let t=this.chunk.length;r=this.skipGapsTo(n,r,-1);n+=r;i+=this.chunk.length-t}let s=this.chunk.length-4;if(this.lang.streamParser.mergeTokens&&i==4&&s>=0&&this.chunk[s]==t&&this.chunk[s+2]==e)this.chunk[s+2]=n;else this.chunk.push(t,e,n,i);return r}parseLine(t){let{line:e,end:n}=this.nextLine(),r=0,{streamParser:i}=this.lang;let s=new fe(e,t?t.state.tabSize:4,t?V(t.state):2);if(s.eol()){i.blankLine(this.state,s.indentUnit)}else{while(!s.eol()){let t=we(i.token,s,this.state);if(t)r=this.emitToken(this.lang.tokenTable.resolve(t),this.parsedPos+s.start,this.parsedPos+s.pos,r);if(s.start>1e4)break}}this.parsedPos=n;this.moveRangeIndex();if(this.parsedPose.start)return r}throw new Error("Stream parser failed to advance stream.")}const ve=Object.create(null);const be=[r.NodeType.none];const xe=new r.NodeSet(be);const ye=[];const Se=Object.create(null);const Pe=Object.create(null);for(let[je,We]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Pe[je]=De(ve,We);class Te{constructor(t){this.extra=t;this.table=Object.assign(Object.create(null),Pe)}resolve(t){return!t?0:this.table[t]||(this.table[t]=De(this.extra,t))}}const Ae=new Te(ve);function Ce(t,e){if(ye.indexOf(t)>-1)return;ye.push(t);console.warn(e)}function De(t,e){let n=[];for(let r of e.split(" ")){let e=[];for(let n of r.split(".")){let r=t[n]||f.tags[n];if(!r){Ce(n,`Unknown highlighting tag ${n}`)}else if(typeof r=="function"){if(!e.length)Ce(n,`Modifier ${n} used at start of tag`);else e=e.map(r)}else{if(e.length)Ce(n,`Tag ${n} used as modifier`);else e=Array.isArray(r)?r:[r]}}for(let t of e)n.push(t)}if(!n.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+n.map((t=>t.id));let o=Se[s];if(o)return o.id;let a=Se[s]=r.NodeType.define({id:be.length,name:i,props:[(0,f.styleTags)({[i]:n})]});be.push(a);return a.id}function Ie(t,e){let n=r.NodeType.define({id:be.length,name:"Document",props:[p.add((()=>t)),z.add((()=>t=>e.getIndent(t)))],top:true});be.push(n);return n}function Ne(t){return t.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(t)}function Oe(t){for(let e=t.iter();!e.next().done;)if(Ne(e.value))return true;return false}function Ee(t){let e=false;t.iterChanges(((t,n,r,i,s)=>{if(!e&&Oe(s))e=true}));return e}const Le=s.Facet.define({combine:t=>t.some((t=>t))});function Be(t={}){let e=[Me];if(t.alwaysIsolate)e.push(Le.of(true));return e}const Me=a.ViewPlugin.fromClass(class{constructor(t){this.always=t.state.facet(Le)||t.textDirection!=a.Direction.LTR||t.state.facet(a.EditorView.perLineTextDirection);this.hasRTL=!this.always&&Oe(t.state.doc);this.tree=b(t.state);this.decorations=this.always||this.hasRTL?Re(t,this.tree,this.always):a.Decoration.none}update(t){let e=t.state.facet(Le)||t.view.textDirection!=a.Direction.LTR||t.state.facet(a.EditorView.perLineTextDirection);if(!e&&!this.hasRTL&&Ee(t.changes))this.hasRTL=true;if(!e&&!this.hasRTL)return;let n=b(t.state);if(e!=this.always||n!=this.tree||t.docChanged||t.viewportChanged){this.tree=n;this.always=e;this.decorations=Re(t.view,n,e)}}},{provide:t=>{function e(e){var n,r;return(r=(n=e.plugin(t))===null||n===void 0?void 0:n.decorations)!==null&&r!==void 0?r:a.Decoration.none}return[a.EditorView.outerDecorations.of(e),s.Prec.lowest(a.EditorView.bidiIsolatedRanges.of(e))]}});function Re(t,e,n){let i=new s.RangeSetBuilder;let o=t.visibleRanges;if(!n)o=Fe(o,t.state.doc);for(let{from:s,to:a}of o){e.iterate({enter:t=>{let e=t.type.prop(r.NodeProp.isolate);if(e)i.add(t.from,t.to,Ve[e])},from:s,to:a})}return i.finish()}function Fe(t,e){let n=e.iter(),r=0,i=[],s=null;for(let{from:o,to:a}of t){if(s&&s.to>o){o=s.to;if(o>=a)continue}if(r+n.value.lengtht-10)s.to=Math.min(a,e);else i.push(s={from:t,to:Math.min(a,e)})}if(e>=a)break;r=e;n.next()}}return i}const Ve={rtl:a.Decoration.mark({class:"cm-iso",inclusive:true,attributes:{dir:"rtl"},bidiIsolate:a.Direction.RTL}),ltr:a.Decoration.mark({class:"cm-iso",inclusive:true,attributes:{dir:"ltr"},bidiIsolate:a.Direction.LTR}),auto:a.Decoration.mark({class:"cm-iso",inclusive:true,attributes:{dir:"auto"},bidiIsolate:null})}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8326.9dda93079a9e4f1b9be6.js b/.venv/share/jupyter/lab/static/8326.9dda93079a9e4f1b9be6.js new file mode 100644 index 0000000000000000000000000000000000000000..5c02626784077bd070cb68f53305d9f5735ddd75 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8326.9dda93079a9e4f1b9be6.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8326],{98326:(e,_,t)=>{t.r(_);t.d(_,{nginx:()=>f});function r(e){var _={},t=e.split(" ");for(var r=0;r*\/]/.test(r)){return n(null,"select-op")}else if(/[;{}:\[\]]/.test(r)){return n(null,r)}else{e.eatWhile(/[\w\\\-]/);return n("variable","variable")}}function l(e,_){var t=false,r;while((r=e.next())!=null){if(t&&r=="/"){_.tokenize=c;break}t=r=="*"}return n("comment","comment")}function p(e,_){var t=0,r;while((r=e.next())!=null){if(t>=2&&r==">"){_.tokenize=c;break}t=r=="-"?t+1:0}return n("comment","comment")}function u(e){return function(_,t){var r=false,i;while((i=_.next())!=null){if(i==e&&!r)break;r=!r&&i=="\\"}if(!r)t.tokenize=c;return n("string","string")}}const f={name:"nginx",startState:function(){return{tokenize:c,baseIndent:0,stack:[]}},token:function(e,_){if(e.eatSpace())return null;o=null;var t=_.tokenize(e,_);var r=_.stack[_.stack.length-1];if(o=="hash"&&r=="rule")t="atom";else if(t=="variable"){if(r=="rule")t="number";else if(!r||r=="@media{")t="tag"}if(r=="rule"&&/^[\{\};]$/.test(o))_.stack.pop();if(o=="{"){if(r=="@media")_.stack[_.stack.length-1]="@media{";else _.stack.push("{")}else if(o=="}")_.stack.pop();else if(o=="@media")_.stack.push("@media");else if(r=="{"&&o!="comment")_.stack.push("rule");return t},indent:function(e,_,t){var r=e.stack.length;if(/^\}/.test(_))r-=e.stack[e.stack.length-1]=="rule"?2:1;return e.baseIndent+r*t.unit},languageData:{indentOnInput:/^\s*\}$/}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8354.94077232b086a13541cc.js b/.venv/share/jupyter/lab/static/8354.94077232b086a13541cc.js new file mode 100644 index 0000000000000000000000000000000000000000..0ce846e00d5ff609871bf980d609c0c5f5146e81 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8354.94077232b086a13541cc.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8354],{68354:(a,p,e)=>{e.d(p,{createGitGraphServices:()=>t.b});var t=e(87290);var r=e(74888)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8368.c75a4b32ae45ec88465d.js b/.venv/share/jupyter/lab/static/8368.c75a4b32ae45ec88465d.js new file mode 100644 index 0000000000000000000000000000000000000000..0fab82bc840e0508acfba7af210f0f75e14f2727 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8368.c75a4b32ae45ec88465d.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8368],{85987:(e,r,t)=>{t.r(r);t.d(r,{javascript:()=>i,json:()=>a,jsonld:()=>u,typescript:()=>f});function n(e){var r=e.statementIndent;var t=e.jsonld;var n=e.json||t;var i=e.typescript;var a=e.wordCharacters||/[\w$\xa1-\uffff]/;var u=function(){function e(e){return{type:e,style:"keyword"}}var r=e("keyword a"),t=e("keyword b"),n=e("keyword c"),i=e("keyword d");var a=e("operator"),u={type:"atom",style:"atom"};return{if:e("if"),while:r,with:r,else:t,do:t,try:t,finally:t,return:i,break:i,continue:i,new:e("new"),delete:n,void:n,throw:n,debugger:e("debugger"),var:e("var"),const:e("var"),let:e("var"),function:e("function"),catch:e("catch"),for:e("for"),switch:e("switch"),case:e("case"),default:e("default"),in:a,typeof:a,instanceof:a,true:u,false:u,null:u,undefined:u,NaN:u,Infinity:u,this:e("this"),class:e("class"),super:e("atom"),yield:n,export:e("export"),import:e("import"),extends:n,await:n}}();var f=/[+\-*&%=<>!?|~^@]/;var s=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function o(e){var r=false,t,n=false;while((t=e.next())!=null){if(!r){if(t=="/"&&!n)return;if(t=="[")n=true;else if(n&&t=="]")n=false}r=!r&&t=="\\"}}var l,c;function d(e,r,t){l=e;c=t;return r}function m(e,r){var t=e.next();if(t=='"'||t=="'"){r.tokenize=p(t);return r.tokenize(e,r)}else if(t=="."&&e.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return d("number","number")}else if(t=="."&&e.match("..")){return d("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(t)){return d(t)}else if(t=="="&&e.eat(">")){return d("=>","operator")}else if(t=="0"&&e.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return d("number","number")}else if(/\d/.test(t)){e.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return d("number","number")}else if(t=="/"){if(e.eat("*")){r.tokenize=k;return k(e,r)}else if(e.eat("/")){e.skipToEnd();return d("comment","comment")}else if(er(e,r,1)){o(e);e.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return d("regexp","string.special")}else{e.eat("=");return d("operator","operator",e.current())}}else if(t=="`"){r.tokenize=v;return v(e,r)}else if(t=="#"&&e.peek()=="!"){e.skipToEnd();return d("meta","meta")}else if(t=="#"&&e.eatWhile(a)){return d("variable","property")}else if(t=="<"&&e.match("!--")||t=="-"&&e.match("->")&&!/\S/.test(e.string.slice(0,e.start))){e.skipToEnd();return d("comment","comment")}else if(f.test(t)){if(t!=">"||!r.lexical||r.lexical.type!=">"){if(e.eat("=")){if(t=="!"||t=="=")e.eat("=")}else if(/[<>*+\-|&?]/.test(t)){e.eat(t);if(t==">")e.eat(t)}}if(t=="?"&&e.eat("."))return d(".");return d("operator","operator",e.current())}else if(a.test(t)){e.eatWhile(a);var n=e.current();if(r.lastType!="."){if(u.propertyIsEnumerable(n)){var i=u[n];return d(i.type,i.style,n)}if(n=="async"&&e.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return d("async","keyword",n)}return d("variable","variable",n)}}function p(e){return function(r,n){var i=false,a;if(t&&r.peek()=="@"&&r.match(s)){n.tokenize=m;return d("jsonld-keyword","meta")}while((a=r.next())!=null){if(a==e&&!i)break;i=!i&&a=="\\"}if(!i)n.tokenize=m;return d("string","string")}}function k(e,r){var t=false,n;while(n=e.next()){if(n=="/"&&t){r.tokenize=m;break}t=n=="*"}return d("comment","comment")}function v(e,r){var t=false,n;while((n=e.next())!=null){if(!t&&(n=="`"||n=="$"&&e.eat("{"))){r.tokenize=m;break}t=!t&&n=="\\"}return d("quasi","string.special",e.current())}var y="([{}])";function w(e,r){if(r.fatArrowAt)r.fatArrowAt=null;var t=e.string.indexOf("=>",e.start);if(t<0)return;if(i){var n=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(e.string.slice(e.start,t));if(n)t=n.index}var u=0,f=false;for(var s=t-1;s>=0;--s){var o=e.string.charAt(s);var l=y.indexOf(o);if(l>=0&&l<3){if(!u){++s;break}if(--u==0){if(o=="(")f=true;break}}else if(l>=3&&l<6){++u}else if(a.test(o)){f=true}else if(/["'\/`]/.test(o)){for(;;--s){if(s==0)return;var c=e.string.charAt(s-1);if(c==o&&e.string.charAt(s-2)!="\\"){s--;break}}}else if(f&&!u){++s;break}}if(f&&!u)r.fatArrowAt=s}var b={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function h(e,r,t,n,i,a){this.indented=e;this.column=r;this.type=t;this.prev=i;this.info=a;if(n!=null)this.align=n}function x(e,r){for(var t=e.localVars;t;t=t.next)if(t.name==r)return true;for(var n=e.context;n;n=n.prev){for(var t=n.vars;t;t=t.next)if(t.name==r)return true}}function g(e,r,t,i,a){var u=e.cc;V.state=e;V.stream=a;V.marked=null;V.cc=u;V.style=r;if(!e.lexical.hasOwnProperty("align"))e.lexical.align=true;while(true){var f=u.length?u.pop():n?F:B;if(f(t,i)){while(u.length&&u[u.length-1].lex)u.pop()();if(V.marked)return V.marked;if(t=="variable"&&x(e,i))return"variableName.local";return r}}}var V={state:null,column:null,marked:null,cc:null};function A(){for(var e=arguments.length-1;e>=0;e--)V.cc.push(arguments[e])}function z(){A.apply(null,arguments);return true}function j(e,r){for(var t=r;t;t=t.next)if(t.name==e)return true;return false}function T(r){var t=V.state;V.marked="def";if(t.context){if(t.lexical.info=="var"&&t.context&&t.context.block){var n=_(r,t.context);if(n!=null){t.context=n;return}}else if(!j(r,t.localVars)){t.localVars=new q(r,t.localVars);return}}if(e.globalVars&&!j(r,t.globalVars))t.globalVars=new q(r,t.globalVars)}function _(e,r){if(!r){return null}else if(r.block){var t=_(e,r.prev);if(!t)return null;if(t==r.prev)return r;return new O(t,r.vars,true)}else if(j(e,r.vars)){return r}else{return new O(r.prev,new q(e,r.vars),false)}}function $(e){return e=="public"||e=="private"||e=="protected"||e=="abstract"||e=="readonly"}function O(e,r,t){this.prev=e;this.vars=r;this.block=t}function q(e,r){this.name=e;this.next=r}var E=new q("this",new q("arguments",null));function I(){V.state.context=new O(V.state.context,V.state.localVars,false);V.state.localVars=E}function C(){V.state.context=new O(V.state.context,V.state.localVars,true);V.state.localVars=null}I.lex=C.lex=true;function S(){V.state.localVars=V.state.context.vars;V.state.context=V.state.context.prev}S.lex=true;function N(e,r){var t=function(){var t=V.state,n=t.indented;if(t.lexical.type=="stat")n=t.lexical.indented;else for(var i=t.lexical;i&&i.type==")"&&i.align;i=i.prev)n=i.indented;t.lexical=new h(n,V.stream.column(),e,null,t.lexical,r)};t.lex=true;return t}function P(){var e=V.state;if(e.lexical.prev){if(e.lexical.type==")")e.indented=e.lexical.indented;e.lexical=e.lexical.prev}}P.lex=true;function W(e){function r(t){if(t==e)return z();else if(e==";"||t=="}"||t==")"||t=="]")return A();else return z(r)}return r}function B(e,r){if(e=="var")return z(N("vardef",r),Ae,W(";"),P);if(e=="keyword a")return z(N("form"),G,B,P);if(e=="keyword b")return z(N("form"),B,P);if(e=="keyword d")return V.stream.match(/^\s*$/,false)?z():z(N("stat"),J,W(";"),P);if(e=="debugger")return z(W(";"));if(e=="{")return z(N("}"),C,se,P,S);if(e==";")return z();if(e=="if"){if(V.state.lexical.info=="else"&&V.state.cc[V.state.cc.length-1]==P)V.state.cc.pop()();return z(N("form"),G,B,P,Oe)}if(e=="function")return z(Ce);if(e=="for")return z(N("form"),C,qe,B,S,P);if(e=="class"||i&&r=="interface"){V.marked="keyword";return z(N("form",e=="class"?e:r),Be,P)}if(e=="variable"){if(i&&r=="declare"){V.marked="keyword";return z(B)}else if(i&&(r=="module"||r=="enum"||r=="type")&&V.stream.match(/^\s*\w/,false)){V.marked="keyword";if(r=="enum")return z(Xe);else if(r=="type")return z(Ne,W("operator"),me,W(";"));else return z(N("form"),ze,W("{"),N("}"),se,P,P)}else if(i&&r=="namespace"){V.marked="keyword";return z(N("form"),F,B,P)}else if(i&&r=="abstract"){V.marked="keyword";return z(B)}else{return z(N("stat"),re)}}if(e=="switch")return z(N("form"),G,W("{"),N("}","switch"),C,se,P,P,S);if(e=="case")return z(F,W(":"));if(e=="default")return z(W(":"));if(e=="catch")return z(N("form"),I,D,B,P,S);if(e=="export")return z(N("stat"),Ge,P);if(e=="import")return z(N("stat"),Je,P);if(e=="async")return z(B);if(r=="@")return z(F,B);return A(N("stat"),F,W(";"),P)}function D(e){if(e=="(")return z(Pe,W(")"))}function F(e,r){return H(e,r,false)}function U(e,r){return H(e,r,true)}function G(e){if(e!="(")return A();return z(N(")"),J,W(")"),P)}function H(e,r,t){if(V.state.fatArrowAt==V.stream.start){var n=t?X:R;if(e=="(")return z(I,N(")"),ue(Pe,")"),P,W("=>"),n,S);else if(e=="variable")return A(I,ze,W("=>"),n,S)}var a=t?L:K;if(b.hasOwnProperty(e))return z(a);if(e=="function")return z(Ce,a);if(e=="class"||i&&r=="interface"){V.marked="keyword";return z(N("form"),We,P)}if(e=="keyword c"||e=="async")return z(t?U:F);if(e=="(")return z(N(")"),J,W(")"),P,a);if(e=="operator"||e=="spread")return z(t?U:F);if(e=="[")return z(N("]"),Re,P,a);if(e=="{")return fe(ne,"}",null,a);if(e=="quasi")return A(M,a);if(e=="new")return z(Y(t));return z()}function J(e){if(e.match(/[;\}\)\],]/))return A();return A(F)}function K(e,r){if(e==",")return z(J);return L(e,r,false)}function L(e,r,t){var n=t==false?K:L;var a=t==false?F:U;if(e=="=>")return z(I,t?X:R,S);if(e=="operator"){if(/\+\+|--/.test(r)||i&&r=="!")return z(n);if(i&&r=="<"&&V.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return z(N(">"),ue(me,">"),P,n);if(r=="?")return z(F,W(":"),a);return z(a)}if(e=="quasi"){return A(M,n)}if(e==";")return;if(e=="(")return fe(U,")","call",n);if(e==".")return z(te,n);if(e=="[")return z(N("]"),J,W("]"),P,n);if(i&&r=="as"){V.marked="keyword";return z(me,n)}if(e=="regexp"){V.state.lastType=V.marked="operator";V.stream.backUp(V.stream.pos-V.stream.start-1);return z(a)}}function M(e,r){if(e!="quasi")return A();if(r.slice(r.length-2)!="${")return z(M);return z(J,Q)}function Q(e){if(e=="}"){V.marked="string.special";V.state.tokenize=v;return z(M)}}function R(e){w(V.stream,V.state);return A(e=="{"?B:F)}function X(e){w(V.stream,V.state);return A(e=="{"?B:U)}function Y(e){return function(r){if(r==".")return z(e?ee:Z);else if(r=="variable"&&i)return z(xe,e?L:K);else return A(e?U:F)}}function Z(e,r){if(r=="target"){V.marked="keyword";return z(K)}}function ee(e,r){if(r=="target"){V.marked="keyword";return z(L)}}function re(e){if(e==":")return z(P,B);return A(K,W(";"),P)}function te(e){if(e=="variable"){V.marked="property";return z()}}function ne(e,r){if(e=="async"){V.marked="property";return z(ne)}else if(e=="variable"||V.style=="keyword"){V.marked="property";if(r=="get"||r=="set")return z(ie);var n;if(i&&V.state.fatArrowAt==V.stream.start&&(n=V.stream.match(/^\s*:\s*/,false)))V.state.fatArrowAt=V.stream.pos+n[0].length;return z(ae)}else if(e=="number"||e=="string"){V.marked=t?"property":V.style+" property";return z(ae)}else if(e=="jsonld-keyword"){return z(ae)}else if(i&&$(r)){V.marked="keyword";return z(ne)}else if(e=="["){return z(F,oe,W("]"),ae)}else if(e=="spread"){return z(U,ae)}else if(r=="*"){V.marked="keyword";return z(ne)}else if(e==":"){return A(ae)}}function ie(e){if(e!="variable")return A(ae);V.marked="property";return z(Ce)}function ae(e){if(e==":")return z(U);if(e=="(")return A(Ce)}function ue(e,r,t){function n(i,a){if(t?t.indexOf(i)>-1:i==","){var u=V.state.lexical;if(u.info=="call")u.pos=(u.pos||0)+1;return z((function(t,n){if(t==r||n==r)return A();return A(e)}),n)}if(i==r||a==r)return z();if(t&&t.indexOf(";")>-1)return A(e);return z(W(r))}return function(t,i){if(t==r||i==r)return z();return A(e,n)}}function fe(e,r,t){for(var n=3;n"),me);if(e=="quasi")return A(ye,he)}function pe(e){if(e=="=>")return z(me)}function ke(e){if(e.match(/[\}\)\]]/))return z();if(e==","||e==";")return z(ke);return A(ve,ke)}function ve(e,r){if(e=="variable"||V.style=="keyword"){V.marked="property";return z(ve)}else if(r=="?"||e=="number"||e=="string"){return z(ve)}else if(e==":"){return z(me)}else if(e=="["){return z(W("variable"),le,W("]"),ve)}else if(e=="("){return A(Se,ve)}else if(!e.match(/[;\}\)\],]/)){return z()}}function ye(e,r){if(e!="quasi")return A();if(r.slice(r.length-2)!="${")return z(ye);return z(me,we)}function we(e){if(e=="}"){V.marked="string.special";V.state.tokenize=v;return z(ye)}}function be(e,r){if(e=="variable"&&V.stream.match(/^\s*[?:]/,false)||r=="?")return z(be);if(e==":")return z(me);if(e=="spread")return z(be);return A(me)}function he(e,r){if(r=="<")return z(N(">"),ue(me,">"),P,he);if(r=="|"||e=="."||r=="&")return z(me);if(e=="[")return z(me,W("]"),he);if(r=="extends"||r=="implements"){V.marked="keyword";return z(me)}if(r=="?")return z(me,W(":"),me)}function xe(e,r){if(r=="<")return z(N(">"),ue(me,">"),P,he)}function ge(){return A(me,Ve)}function Ve(e,r){if(r=="=")return z(me)}function Ae(e,r){if(r=="enum"){V.marked="keyword";return z(Xe)}return A(ze,oe,_e,$e)}function ze(e,r){if(i&&$(r)){V.marked="keyword";return z(ze)}if(e=="variable"){T(r);return z()}if(e=="spread")return z(ze);if(e=="[")return fe(Te,"]");if(e=="{")return fe(je,"}")}function je(e,r){if(e=="variable"&&!V.stream.match(/^\s*:/,false)){T(r);return z(_e)}if(e=="variable")V.marked="property";if(e=="spread")return z(ze);if(e=="}")return A();if(e=="[")return z(F,W("]"),W(":"),je);return z(W(":"),ze,_e)}function Te(){return A(ze,_e)}function _e(e,r){if(r=="=")return z(U)}function $e(e){if(e==",")return z(Ae)}function Oe(e,r){if(e=="keyword b"&&r=="else")return z(N("form","else"),B,P)}function qe(e,r){if(r=="await")return z(qe);if(e=="(")return z(N(")"),Ee,P)}function Ee(e){if(e=="var")return z(Ae,Ie);if(e=="variable")return z(Ie);return A(Ie)}function Ie(e,r){if(e==")")return z();if(e==";")return z(Ie);if(r=="in"||r=="of"){V.marked="keyword";return z(F,Ie)}return A(F,Ie)}function Ce(e,r){if(r=="*"){V.marked="keyword";return z(Ce)}if(e=="variable"){T(r);return z(Ce)}if(e=="(")return z(I,N(")"),ue(Pe,")"),P,ce,B,S);if(i&&r=="<")return z(N(">"),ue(ge,">"),P,Ce)}function Se(e,r){if(r=="*"){V.marked="keyword";return z(Se)}if(e=="variable"){T(r);return z(Se)}if(e=="(")return z(I,N(")"),ue(Pe,")"),P,ce,S);if(i&&r=="<")return z(N(">"),ue(ge,">"),P,Se)}function Ne(e,r){if(e=="keyword"||e=="variable"){V.marked="type";return z(Ne)}else if(r=="<"){return z(N(">"),ue(ge,">"),P)}}function Pe(e,r){if(r=="@")z(F,Pe);if(e=="spread")return z(Pe);if(i&&$(r)){V.marked="keyword";return z(Pe)}if(i&&e=="this")return z(oe,_e);return A(ze,oe,_e)}function We(e,r){if(e=="variable")return Be(e,r);return De(e,r)}function Be(e,r){if(e=="variable"){T(r);return z(De)}}function De(e,r){if(r=="<")return z(N(">"),ue(ge,">"),P,De);if(r=="extends"||r=="implements"||i&&e==","){if(r=="implements")V.marked="keyword";return z(i?me:F,De)}if(e=="{")return z(N("}"),Fe,P)}function Fe(e,r){if(e=="async"||e=="variable"&&(r=="static"||r=="get"||r=="set"||i&&$(r))&&V.stream.match(/^\s+#?[\w$\xa1-\uffff]/,false)){V.marked="keyword";return z(Fe)}if(e=="variable"||V.style=="keyword"){V.marked="property";return z(Ue,Fe)}if(e=="number"||e=="string")return z(Ue,Fe);if(e=="[")return z(F,oe,W("]"),Ue,Fe);if(r=="*"){V.marked="keyword";return z(Fe)}if(i&&e=="(")return A(Se,Fe);if(e==";"||e==",")return z(Fe);if(e=="}")return z();if(r=="@")return z(F,Fe)}function Ue(e,r){if(r=="!"||r=="?")return z(Ue);if(e==":")return z(me,_e);if(r=="=")return z(U);var t=V.state.lexical.prev,n=t&&t.info=="interface";return A(n?Se:Ce)}function Ge(e,r){if(r=="*"){V.marked="keyword";return z(Qe,W(";"))}if(r=="default"){V.marked="keyword";return z(F,W(";"))}if(e=="{")return z(ue(He,"}"),Qe,W(";"));return A(B)}function He(e,r){if(r=="as"){V.marked="keyword";return z(W("variable"))}if(e=="variable")return A(U,He)}function Je(e){if(e=="string")return z();if(e=="(")return A(F);if(e==".")return A(K);return A(Ke,Le,Qe)}function Ke(e,r){if(e=="{")return fe(Ke,"}");if(e=="variable")T(r);if(r=="*")V.marked="keyword";return z(Me)}function Le(e){if(e==",")return z(Ke,Le)}function Me(e,r){if(r=="as"){V.marked="keyword";return z(Ke)}}function Qe(e,r){if(r=="from"){V.marked="keyword";return z(F)}}function Re(e){if(e=="]")return z();return A(ue(U,"]"))}function Xe(){return A(N("form"),ze,W("{"),N("}"),ue(Ye,"}"),P,P)}function Ye(){return A(ze,_e)}function Ze(e,r){return e.lastType=="operator"||e.lastType==","||f.test(r.charAt(0))||/[,.]/.test(r.charAt(0))}function er(e,r,t){return r.tokenize==m&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(r.lastType)||r.lastType=="quasi"&&/\{\s*$/.test(e.string.slice(0,e.pos-(t||0)))}return{name:e.name,startState:function(r){var t={tokenize:m,lastType:"sof",cc:[],lexical:new h(-r,0,"block",false),localVars:e.localVars,context:e.localVars&&new O(null,null,false),indented:0};if(e.globalVars&&typeof e.globalVars=="object")t.globalVars=e.globalVars;return t},token:function(e,r){if(e.sol()){if(!r.lexical.hasOwnProperty("align"))r.lexical.align=false;r.indented=e.indentation();w(e,r)}if(r.tokenize!=k&&e.eatSpace())return null;var t=r.tokenize(e,r);if(l=="comment")return t;r.lastType=l=="operator"&&(c=="++"||c=="--")?"incdec":l;return g(r,t,l,c,e)},indent:function(t,n,i){if(t.tokenize==k||t.tokenize==v)return null;if(t.tokenize!=m)return 0;var a=n&&n.charAt(0),u=t.lexical,f;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var o=t.cc[s];if(o==P)u=u.prev;else if(o!=Oe&&o!=S)break}while((u.type=="stat"||u.type=="form")&&(a=="}"||(f=t.cc[t.cc.length-1])&&(f==K||f==L)&&!/^[,\.=+\-*:?[\(]/.test(n)))u=u.prev;if(r&&u.type==")"&&u.prev.type=="stat")u=u.prev;var l=u.type,c=a==l;if(l=="vardef")return u.indented+(t.lastType=="operator"||t.lastType==","?u.info.length+1:0);else if(l=="form"&&a=="{")return u.indented;else if(l=="form")return u.indented+i.unit;else if(l=="stat")return u.indented+(Ze(t,n)?r||i.unit:0);else if(u.info=="switch"&&!c&&e.doubleIndentSwitch!=false)return u.indented+(/^(?:case|default)\b/.test(n)?i.unit:2*i.unit);else if(u.align)return u.column+(c?0:1);else return u.indented+(c?0:i.unit)},languageData:{indentOnInput:/^\s*(?:case .*?:|default:|\{|\})$/,commentTokens:n?undefined:{line:"//",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]},wordChars:"$"}}}const i=n({name:"javascript"});const a=n({name:"json",json:true});const u=n({name:"json",jsonld:true});const f=n({name:"typescript",typescript:true})}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8391.e5fb2e35cced405eb819.js b/.venv/share/jupyter/lab/static/8391.e5fb2e35cced405eb819.js new file mode 100644 index 0000000000000000000000000000000000000000..9c34660c4e0d0fd29c080686df6d52b38f2321a8 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8391.e5fb2e35cced405eb819.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8391],{78391:(t,e,a)=>{a.d(e,{diagram:()=>j});var i=a(88855);var r=a(15051);var n=a(94065);var s=a(33416);var d=a(94746);var o=a(20778);var c=a(57590);var g=a(68232);var p=a(76261);var h=a(96049);var l=a(75905);var f=a(24982);var x=a(82211);var u=a(84416);var D={};var y=(0,l.K2)(((t,e)=>{D[t]=e}),"set");var w=(0,l.K2)((t=>D[t]),"get");var v=(0,l.K2)((()=>Object.keys(D)),"keys");var m=(0,l.K2)((()=>v().length),"size");var b={get:w,set:y,keys:v,size:m};var B=(0,l.K2)((t=>t.append("circle").attr("class","start-state").attr("r",(0,l.D7)().state.sizeUnit).attr("cx",(0,l.D7)().state.padding+(0,l.D7)().state.sizeUnit).attr("cy",(0,l.D7)().state.padding+(0,l.D7)().state.sizeUnit)),"drawStartState");var k=(0,l.K2)((t=>t.append("line").style("stroke","grey").style("stroke-dasharray","3").attr("x1",(0,l.D7)().state.textHeight).attr("class","divider").attr("x2",(0,l.D7)().state.textHeight*2).attr("y1",0).attr("y2",0)),"drawDivider");var S=(0,l.K2)(((t,e)=>{const a=t.append("text").attr("x",2*(0,l.D7)().state.padding).attr("y",(0,l.D7)().state.textHeight+2*(0,l.D7)().state.padding).attr("font-size",(0,l.D7)().state.fontSize).attr("class","state-title").text(e.id);const i=a.node().getBBox();t.insert("rect",":first-child").attr("x",(0,l.D7)().state.padding).attr("y",(0,l.D7)().state.padding).attr("width",i.width+2*(0,l.D7)().state.padding).attr("height",i.height+2*(0,l.D7)().state.padding).attr("rx",(0,l.D7)().state.radius);return a}),"drawSimpleState");var N=(0,l.K2)(((t,e)=>{const a=(0,l.K2)((function(t,e,a){const i=t.append("tspan").attr("x",2*(0,l.D7)().state.padding).text(e);if(!a){i.attr("dy",(0,l.D7)().state.textHeight)}}),"addTspan");const i=t.append("text").attr("x",2*(0,l.D7)().state.padding).attr("y",(0,l.D7)().state.textHeight+1.3*(0,l.D7)().state.padding).attr("font-size",(0,l.D7)().state.fontSize).attr("class","state-title").text(e.descriptions[0]);const r=i.node().getBBox();const n=r.height;const s=t.append("text").attr("x",(0,l.D7)().state.padding).attr("y",n+(0,l.D7)().state.padding*.4+(0,l.D7)().state.dividerMargin+(0,l.D7)().state.textHeight).attr("class","state-description");let d=true;let o=true;e.descriptions.forEach((function(t){if(!d){a(s,t,o);o=false}d=false}));const c=t.append("line").attr("x1",(0,l.D7)().state.padding).attr("y1",(0,l.D7)().state.padding+n+(0,l.D7)().state.dividerMargin/2).attr("y2",(0,l.D7)().state.padding+n+(0,l.D7)().state.dividerMargin/2).attr("class","descr-divider");const g=s.node().getBBox();const p=Math.max(g.width,r.width);c.attr("x2",p+3*(0,l.D7)().state.padding);t.insert("rect",":first-child").attr("x",(0,l.D7)().state.padding).attr("y",(0,l.D7)().state.padding).attr("width",p+2*(0,l.D7)().state.padding).attr("height",g.height+n+2*(0,l.D7)().state.padding).attr("rx",(0,l.D7)().state.radius);return t}),"drawDescrState");var E=(0,l.K2)(((t,e,a)=>{const i=(0,l.D7)().state.padding;const r=2*(0,l.D7)().state.padding;const n=t.node().getBBox();const s=n.width;const d=n.x;const o=t.append("text").attr("x",0).attr("y",(0,l.D7)().state.titleShift).attr("font-size",(0,l.D7)().state.fontSize).attr("class","state-title").text(e.id);const c=o.node().getBBox();const g=c.width+r;let p=Math.max(g,s);if(p===s){p=p+r}let h;const f=t.node().getBBox();if(e.doc){}h=d-i;if(g>s){h=(s-p)/2+i}if(Math.abs(d-f.x)s){h=d-(g-s)/2}const x=1-(0,l.D7)().state.textHeight;t.insert("rect",":first-child").attr("x",h).attr("y",x).attr("class",a?"alt-composit":"composit").attr("width",p).attr("height",f.height+(0,l.D7)().state.textHeight+(0,l.D7)().state.titleShift+1).attr("rx","0");o.attr("x",h+i);if(g<=s){o.attr("x",d+(p-r)/2-g/2+i)}t.insert("rect",":first-child").attr("x",h).attr("y",(0,l.D7)().state.titleShift-(0,l.D7)().state.textHeight-(0,l.D7)().state.padding).attr("width",p).attr("height",(0,l.D7)().state.textHeight*3).attr("rx",(0,l.D7)().state.radius);t.insert("rect",":first-child").attr("x",h).attr("y",(0,l.D7)().state.titleShift-(0,l.D7)().state.textHeight-(0,l.D7)().state.padding).attr("width",p).attr("height",f.height+3+2*(0,l.D7)().state.textHeight).attr("rx",(0,l.D7)().state.radius);return t}),"addTitleAndBox");var K=(0,l.K2)((t=>{t.append("circle").attr("class","end-state-outer").attr("r",(0,l.D7)().state.sizeUnit+(0,l.D7)().state.miniPadding).attr("cx",(0,l.D7)().state.padding+(0,l.D7)().state.sizeUnit+(0,l.D7)().state.miniPadding).attr("cy",(0,l.D7)().state.padding+(0,l.D7)().state.sizeUnit+(0,l.D7)().state.miniPadding);return t.append("circle").attr("class","end-state-inner").attr("r",(0,l.D7)().state.sizeUnit).attr("cx",(0,l.D7)().state.padding+(0,l.D7)().state.sizeUnit+2).attr("cy",(0,l.D7)().state.padding+(0,l.D7)().state.sizeUnit+2)}),"drawEndState");var M=(0,l.K2)(((t,e)=>{let a=(0,l.D7)().state.forkWidth;let i=(0,l.D7)().state.forkHeight;if(e.parentId){let t=a;a=i;i=t}return t.append("rect").style("stroke","black").style("fill","black").attr("width",a).attr("height",i).attr("x",(0,l.D7)().state.padding).attr("y",(0,l.D7)().state.padding)}),"drawForkJoinState");var R=(0,l.K2)(((t,e,a,i)=>{let r=0;const n=i.append("text");n.style("text-anchor","start");n.attr("class","noteText");let s=t.replace(/\r\n/g,"
");s=s.replace(/\n/g,"
");const d=s.split(l.Y2.lineBreakRegex);let o=1.25*(0,l.D7)().state.noteMargin;for(const c of d){const t=c.trim();if(t.length>0){const i=n.append("tspan");i.text(t);if(o===0){const t=i.node().getBBox();o+=t.height}r+=o;i.attr("x",e+(0,l.D7)().state.noteMargin);i.attr("y",a+r+1.25*(0,l.D7)().state.noteMargin)}}return{textWidth:n.node().getBBox().width,textHeight:r}}),"_drawLongText");var z=(0,l.K2)(((t,e)=>{e.attr("class","state-note");const a=e.append("rect").attr("x",0).attr("y",(0,l.D7)().state.padding);const i=e.append("g");const{textWidth:r,textHeight:n}=R(t,0,0,i);a.attr("height",n+2*(0,l.D7)().state.noteMargin);a.attr("width",r+(0,l.D7)().state.noteMargin*2);return a}),"drawNote");var H=(0,l.K2)((function(t,e){const a=e.id;const i={id:a,label:e.id,width:0,height:0};const r=t.append("g").attr("id",a).attr("class","stateGroup");if(e.type==="start"){B(r)}if(e.type==="end"){K(r)}if(e.type==="fork"||e.type==="join"){M(r,e)}if(e.type==="note"){z(e.note.text,r)}if(e.type==="divider"){k(r)}if(e.type==="default"&&e.descriptions.length===0){S(r,e)}if(e.type==="default"&&e.descriptions.length>0){N(r,e)}const n=r.node().getBBox();i.width=n.width+2*(0,l.D7)().state.padding;i.height=n.height+2*(0,l.D7)().state.padding;b.set(a,i);return i}),"drawState");var T=0;var L=(0,l.K2)((function(t,e,a){const r=(0,l.K2)((function(t){switch(t){case i.u4.relationType.AGGREGATION:return"aggregation";case i.u4.relationType.EXTENSION:return"extension";case i.u4.relationType.COMPOSITION:return"composition";case i.u4.relationType.DEPENDENCY:return"dependency"}}),"getRelationType");e.points=e.points.filter((t=>!Number.isNaN(t.y)));const n=e.points;const s=(0,f.n8j)().x((function(t){return t.x})).y((function(t){return t.y})).curve(f.qrM);const d=t.append("path").attr("d",s(n)).attr("id","edge"+T).attr("class","transition");let o="";if((0,l.D7)().state.arrowMarkerAbsolute){o=window.location.protocol+"//"+window.location.host+window.location.pathname+window.location.search;o=o.replace(/\(/g,"\\(");o=o.replace(/\)/g,"\\)")}d.attr("marker-end","url("+o+"#"+r(i.u4.relationType.DEPENDENCY)+"End)");if(a.title!==void 0){const i=t.append("g").attr("class","stateLabel");const{x:r,y:n}=h._K.calcLabelPosition(e.points);const s=l.Y2.getRows(a.title);let d=0;const o=[];let c=0;let g=0;for(let t=0;t<=s.length;t++){const e=i.append("text").attr("text-anchor","middle").text(s[t]).attr("x",r).attr("y",n+d);const a=e.node().getBBox();c=Math.max(c,a.width);g=Math.min(g,a.x);l.Rm.info(a.x,r,n+d);if(d===0){const t=e.node().getBBox();d=t.height;l.Rm.info("Title height",d,n)}o.push(e)}let p=d*s.length;if(s.length>1){const t=(s.length-1)*d*.5;o.forEach(((e,a)=>e.attr("y",n+a*d-t)));p=d*s.length}const f=i.node().getBBox();i.insert("rect",":first-child").attr("class","box").attr("x",r-c/2-(0,l.D7)().state.padding/2).attr("y",n-p/2-(0,l.D7)().state.padding/2-3.5).attr("width",c+(0,l.D7)().state.padding).attr("height",p+(0,l.D7)().state.padding);l.Rm.info(f)}T++}),"drawEdge");var A;var G={};var O=(0,l.K2)((function(){}),"setConf");var C=(0,l.K2)((function(t){t.append("defs").append("marker").attr("id","dependencyEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")}),"insertMarkers");var P=(0,l.K2)((function(t,e,a,i){A=(0,l.D7)().state;const r=(0,l.D7)().securityLevel;let n;if(r==="sandbox"){n=(0,f.Ltv)("#i"+e)}const s=r==="sandbox"?(0,f.Ltv)(n.nodes()[0].contentDocument.body):(0,f.Ltv)("body");const d=r==="sandbox"?n.nodes()[0].contentDocument:document;l.Rm.debug("Rendering diagram "+t);const o=s.select(`[id='${e}']`);C(o);const c=i.db.getRootDoc();_(c,o,void 0,false,s,d,i);const g=A.padding;const p=o.node().getBBox();const h=p.width+g*2;const x=p.height+g*2;const u=h*1.75;(0,l.a$)(o,x,u,A.useMaxWidth);o.attr("viewBox",`${p.x-A.padding} ${p.y-A.padding} `+h+" "+x)}),"draw");var U=(0,l.K2)((t=>t?t.length*A.fontSizeFactor:1),"getLabelWidth");var _=(0,l.K2)(((t,e,a,i,r,n,s)=>{const d=new u.T({compound:true,multigraph:true});let o;let c=true;for(o=0;o{const e=t.parentElement;let a=0;let i=0;if(e){if(e.parentElement){a=e.parentElement.getBBox().width}i=parseInt(e.getAttribute("data-x-shift"),10);if(Number.isNaN(i)){i=0}}t.setAttribute("x1",0-i+8);t.setAttribute("x2",a-i-8)}))}else{l.Rm.debug("No Node "+t+": "+JSON.stringify(d.node(t)))}}));let w=y.getBBox();d.edges().forEach((function(t){if(t!==void 0&&d.edge(t)!==void 0){l.Rm.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(d.edge(t)));L(e,d.edge(t),d.edge(t).relation)}}));w=y.getBBox();const v={id:a?a:"root",label:a?a:"root",width:0,height:0};v.width=w.width+2*A.padding;v.height=w.height+2*A.padding;l.Rm.debug("Doc rendered",v,d);return v}),"renderDoc");var I={setConf:O,draw:P};var j={parser:i.Zk,get db(){return new i.u4(1)},renderer:I,styles:i.tM,init:(0,l.K2)((t=>{if(!t.state){t.state={}}t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute}),"init")}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/84.fe0a55d7756c37585fb4.js b/.venv/share/jupyter/lab/static/84.fe0a55d7756c37585fb4.js new file mode 100644 index 0000000000000000000000000000000000000000..824a9e754077837f3bec9ff5064af12862440b38 --- /dev/null +++ b/.venv/share/jupyter/lab/static/84.fe0a55d7756c37585fb4.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[84],{50084:(e,t,n)=>{n.r(t);n.d(t,{shell:()=>p});var r={};function s(e,t){for(var n=0;n1)e.eat("$");var n=e.next();if(/['"({]/.test(n)){t.tokens[0]=f(n,n=="("?"quote":n=="{"?"def":"string");return h(e,t)}if(!/\d/.test(n))e.eatWhile(/\w/);t.tokens.shift();return"def"};function k(e){return function(t,n){if(t.sol()&&t.string==e)n.tokens.shift();t.skipToEnd();return"string.special"}}function h(e,t){return(t.tokens[0]||a)(e,t)}const p={name:"shell",startState:function(){return{tokens:[]}},token:function(e,t){return h(e,t)},languageData:{autocomplete:i.concat(o,u),closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"#"}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8418.42e29778d4b49fb54e8e.js b/.venv/share/jupyter/lab/static/8418.42e29778d4b49fb54e8e.js new file mode 100644 index 0000000000000000000000000000000000000000..773501d41668e8475fb9681404e2ef2a6ddecb76 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8418.42e29778d4b49fb54e8e.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8418],{28418:(e,t,r)=>{r.r(t);r.d(t,{go:()=>d});var n={break:true,case:true,chan:true,const:true,continue:true,default:true,defer:true,else:true,fallthrough:true,for:true,func:true,go:true,goto:true,if:true,import:true,interface:true,map:true,package:true,range:true,return:true,select:true,struct:true,switch:true,type:true,var:true,bool:true,byte:true,complex64:true,complex128:true,float32:true,float64:true,int8:true,int16:true,int32:true,int64:true,string:true,uint8:true,uint16:true,uint32:true,uint64:true,int:true,uint:true,uintptr:true,error:true,rune:true,any:true,comparable:true};var u={true:true,false:true,iota:true,nil:true,append:true,cap:true,close:true,complex:true,copy:true,delete:true,imag:true,len:true,make:true,new:true,panic:true,print:true,println:true,real:true,recover:true};var i=/[+\-*&^%:=<>!|\/]/;var a;function l(e,t){var r=e.next();if(r=='"'||r=="'"||r=="`"){t.tokenize=o(r);return t.tokenize(e,t)}if(/[\d\.]/.test(r)){if(r=="."){e.match(/^[0-9]+([eE][\-+]?[0-9]+)?/)}else if(r=="0"){e.match(/^[xX][0-9a-fA-F]+/)||e.match(/^0[0-7]+/)}else{e.match(/^[0-9]*\.?[0-9]*([eE][\-+]?[0-9]+)?/)}return"number"}if(/[\[\]{}\(\),;\:\.]/.test(r)){a=r;return null}if(r=="/"){if(e.eat("*")){t.tokenize=c;return c(e,t)}if(e.eat("/")){e.skipToEnd();return"comment"}}if(i.test(r)){e.eatWhile(i);return"operator"}e.eatWhile(/[\w\$_\xa1-\uffff]/);var l=e.current();if(n.propertyIsEnumerable(l)){if(l=="case"||l=="default")a="case";return"keyword"}if(u.propertyIsEnumerable(l))return"atom";return"variable"}function o(e){return function(t,r){var n=false,u,i=false;while((u=t.next())!=null){if(u==e&&!n){i=true;break}n=!n&&e!="`"&&u=="\\"}if(i||!(n||e=="`"))r.tokenize=l;return"string"}}function c(e,t){var r=false,n;while(n=e.next()){if(n=="/"&&r){t.tokenize=l;break}r=n=="*"}return"comment"}function f(e,t,r,n,u){this.indented=e;this.column=t;this.type=r;this.align=n;this.prev=u}function s(e,t,r){return e.context=new f(e.indented,t,r,null,e.context)}function p(e){if(!e.context.prev)return;var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}const d={name:"go",startState:function(e){return{tokenize:null,context:new f(-e,0,"top",false),indented:0,startOfLine:true}},token:function(e,t){var r=t.context;if(e.sol()){if(r.align==null)r.align=false;t.indented=e.indentation();t.startOfLine=true;if(r.type=="case")r.type="}"}if(e.eatSpace())return null;a=null;var n=(t.tokenize||l)(e,t);if(n=="comment")return n;if(r.align==null)r.align=true;if(a=="{")s(t,e.column(),"}");else if(a=="[")s(t,e.column(),"]");else if(a=="(")s(t,e.column(),")");else if(a=="case")r.type="case";else if(a=="}"&&r.type=="}")p(t);else if(a==r.type)p(t);t.startOfLine=false;return n},indent:function(e,t,r){if(e.tokenize!=l&&e.tokenize!=null)return null;var n=e.context,u=t&&t.charAt(0);if(n.type=="case"&&/^(?:case|default)\b/.test(t))return n.indented;var i=u==n.type;if(n.align)return n.column+(i?0:1);else return n.indented+(i?0:r.unit)},languageData:{indentOnInput:/^\s([{}]|case |default\s*:)$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8493.3b6106e45d5661438d8e.js b/.venv/share/jupyter/lab/static/8493.3b6106e45d5661438d8e.js new file mode 100644 index 0000000000000000000000000000000000000000..db0b397fa5c9662129a99e6216c7eff6260150bb --- /dev/null +++ b/.venv/share/jupyter/lab/static/8493.3b6106e45d5661438d8e.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8493],{40874:(e,t,n)=>{n.r(t);n.d(t,{groovy:()=>v});function r(e){var t={},n=e.split(" ");for(var r=0;r")){s="->";return null}if(/[+\-*&%=<>!?|\/~]/.test(n)){e.eatWhile(/[+\-*&%=<>|~]/);return"operator"}e.eatWhile(/[\w\$_]/);if(n=="@"){e.eatWhile(/[\w\$_\.]/);return"meta"}if(t.lastToken==".")return"property";if(e.eat(":")){s="proplabel";return"property"}var r=e.current();if(o.propertyIsEnumerable(r)){return"atom"}if(i.propertyIsEnumerable(r)){if(a.propertyIsEnumerable(r))s="newstatement";else if(l.propertyIsEnumerable(r))s="standalone";return"keyword"}return"variable"}u.isBase=true;function f(e,t,n){var r=false;if(e!="/"&&t.eat(e)){if(t.eat(e))r=true;else return"string"}function i(t,n){var i=false,a,l=!r;while((a=t.next())!=null){if(a==e&&!i){if(!r){break}if(t.match(e+e)){l=true;break}}if(e=='"'&&a=="$"&&!i){if(t.eat("{")){n.tokenize.push(p());return"string"}else if(t.match(/^\w/,false)){n.tokenize.push(c);return"string"}}i=!i&&a=="\\"}if(l)n.tokenize.pop();return"string"}n.tokenize.push(i);return i(t,n)}function p(){var e=1;function t(t,n){if(t.peek()=="}"){e--;if(e==0){n.tokenize.pop();return n.tokenize[n.tokenize.length-1](t,n)}}else if(t.peek()=="{"){e++}return u(t,n)}t.isBase=true;return t}function c(e,t){var n=e.match(/^(\.|[\w\$_]+)/);if(!n||!e.match(n[0]=="."?/^[\w$_]/:/^\./))t.tokenize.pop();if(!n)return t.tokenize[t.tokenize.length-1](e,t);return n[0]=="."?null:"variable"}function h(e,t){var n=false,r;while(r=e.next()){if(r=="/"&&n){t.tokenize.pop();break}n=r=="*"}return"comment"}function k(e,t){return!e||e=="operator"||e=="->"||/[\.\[\{\(,;:]/.test(e)||e=="newstatement"||e=="keyword"||e=="proplabel"||e=="standalone"&&!t}function m(e,t,n,r,i){this.indented=e;this.column=t;this.type=n;this.align=r;this.prev=i}function d(e,t,n){return e.context=new m(e.indented,t,n,null,e.context)}function y(e){var t=e.context.type;if(t==")"||t=="]"||t=="}")e.indented=e.context.indented;return e.context=e.context.prev}const v={name:"groovy",startState:function(e){return{tokenize:[u],context:new m(-e,0,"top",false),indented:0,startOfLine:true,lastToken:null}},token:function(e,t){var n=t.context;if(e.sol()){if(n.align==null)n.align=false;t.indented=e.indentation();t.startOfLine=true;if(n.type=="statement"&&!k(t.lastToken,true)){y(t);n=t.context}}if(e.eatSpace())return null;s=null;var r=t.tokenize[t.tokenize.length-1](e,t);if(r=="comment")return r;if(n.align==null)n.align=true;if((s==";"||s==":")&&n.type=="statement")y(t);else if(s=="->"&&n.type=="statement"&&n.prev.type=="}"){y(t);t.context.align=false}else if(s=="{")d(t,e.column(),"}");else if(s=="[")d(t,e.column(),"]");else if(s=="(")d(t,e.column(),")");else if(s=="}"){while(n.type=="statement")n=y(t);if(n.type=="}")n=y(t);while(n.type=="statement")n=y(t)}else if(s==n.type)y(t);else if(n.type=="}"||n.type=="top"||n.type=="statement"&&s=="newstatement")d(t,e.column(),"statement");t.startOfLine=false;t.lastToken=s||r;return r},indent:function(e,t,n){if(!e.tokenize[e.tokenize.length-1].isBase)return null;var r=t&&t.charAt(0),i=e.context;if(i.type=="statement"&&!k(e.lastToken,true))i=i.prev;var a=r==i.type;if(i.type=="statement")return i.indented+(r=="{"?0:n.unit);else if(i.align)return i.column+(a?0:1);else return i.indented+(a?0:n.unit)},languageData:{indentOnInput:/^\s*[{}]$/,commentTokens:{line:"//",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8537.21b8b9ae0d81ae264499.js b/.venv/share/jupyter/lab/static/8537.21b8b9ae0d81ae264499.js new file mode 100644 index 0000000000000000000000000000000000000000..4003d37cc4873cd830d2bb9f9e2a69668df2d086 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8537.21b8b9ae0d81ae264499.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8537],{98537:(a,r,e)=>{e.d(r,{diagram:()=>l});var t=e(59357);var n=e(93113);var s=e(75905);var i=e(24010);var p={parse:(0,s.K2)((async a=>{const r=await(0,i.qg)("info",a);s.Rm.debug(r)}),"parse")};var o={version:t.n.version};var v=(0,s.K2)((()=>o.version),"getVersion");var d={getVersion:v};var c=(0,s.K2)(((a,r,e)=>{s.Rm.debug("rendering info diagram\n"+a);const t=(0,n.D)(r);(0,s.a$)(t,100,400,true);const i=t.append("g");i.append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${e}`)}),"draw");var g={draw:c};var l={parser:p,db:d,renderer:g}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8606.bc1b0136e61d173913cd.js b/.venv/share/jupyter/lab/static/8606.bc1b0136e61d173913cd.js new file mode 100644 index 0000000000000000000000000000000000000000..ca0c4771095f2c8dcc86728bf274ade6cda330a6 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8606.bc1b0136e61d173913cd.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8606],{82887:(t,n,e)=>{e.d(n,{A:()=>i});function i(t,n){return t==null||n==null?NaN:tn?1:t>=n?0:NaN}},71363:(t,n,e)=>{e.d(n,{Ay:()=>c,Jj:()=>o,ah:()=>u});var i=e(82887);var r=e(9791);var s=e(40168);const a=(0,r.A)(i.A);const o=a.right;const u=a.left;const h=(0,r.A)(s.A).center;const c=o},9791:(t,n,e)=>{e.d(n,{A:()=>s});var i=e(82887);function r(t,n){return t==null||n==null?NaN:nt?1:n>=t?0:NaN}function s(t){let n,e,s;if(t.length!==2){n=i.A;e=(n,e)=>(0,i.A)(t(n),e);s=(n,e)=>t(n)-e}else{n=t===i.A||t===r?t:a;e=t;s=t}function o(t,i,r=0,s=t.length){if(r>>1;if(e(t[n],i)<0)r=n+1;else s=n}while(r>>1;if(e(t[n],i)<=0)r=n+1;else s=n}while(re&&s(t[r-1],n)>-s(t[r],n)?r-1:r}return{left:o,center:h,right:u}}function a(){return 0}},21671:(t,n,e)=>{e.d(n,{A:()=>i});function i(t,n){let e;if(n===undefined){for(const n of t){if(n!=null&&(e=n)){e=n}}}else{let i=-1;for(let r of t){if((r=n(r,++i,t))!=null&&(e=r)){e=r}}}return e}},44317:(t,n,e)=>{e.d(n,{A:()=>i});function i(t,n){let e;if(n===undefined){for(const n of t){if(n!=null&&(e>n||e===undefined&&n>=n)){e=n}}}else{let i=-1;for(let r of t){if((r=n(r,++i,t))!=null&&(e>r||e===undefined&&r>=r)){e=r}}}return e}},40168:(t,n,e)=>{e.d(n,{A:()=>i,n:()=>r});function i(t){return t===null?NaN:+t}function*r(t,n){if(n===undefined){for(let n of t){if(n!=null&&(n=+n)>=n){yield n}}}else{let e=-1;for(let i of t){if((i=n(i,++e,t))!=null&&(i=+i)>=i){yield i}}}}},18312:(t,n,e)=>{e.d(n,{A:()=>i});function i(t,n,e){t=+t,n=+n,e=(r=arguments.length)<2?(n=t,t=0,1):r<3?1:+e;var i=-1,r=Math.max(0,Math.ceil((n-t)/e))|0,s=new Array(r);while(++i{e.d(n,{Ay:()=>o,lq:()=>u,sG:()=>h});const i=Math.sqrt(50),r=Math.sqrt(10),s=Math.sqrt(2);function a(t,n,e){const o=(n-t)/Math.max(0,e),u=Math.floor(Math.log10(o)),h=o/Math.pow(10,u),c=h>=i?10:h>=r?5:h>=s?2:1;let l,f,_;if(u<0){_=Math.pow(10,-u)/c;l=Math.round(t*_);f=Math.round(n*_);if(l/_n)--f;_=-_}else{_=Math.pow(10,u)*c;l=Math.round(t/_);f=Math.round(n/_);if(l*_n)--f}if(f0))return[];if(t===n)return[t];const i=n=r))return[];const u=s-r+1,h=new Array(u);if(i){if(o<0)for(let t=0;t{e.d(n,{Ay:()=>b,Gw:()=>N,KI:()=>R,Q1:()=>r,Qh:()=>k,Uw:()=>a,b:()=>T,ef:()=>s});var i=e(47592);function r(){}var s=.7;var a=1/s;var o="\\s*([+-]?\\d+)\\s*",u="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",h="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",c=/^#([0-9a-f]{3,8})$/,l=new RegExp(`^rgb\\(${o},${o},${o}\\)$`),f=new RegExp(`^rgb\\(${h},${h},${h}\\)$`),_=new RegExp(`^rgba\\(${o},${o},${o},${u}\\)$`),p=new RegExp(`^rgba\\(${h},${h},${h},${u}\\)$`),y=new RegExp(`^hsl\\(${u},${h},${h}\\)$`),g=new RegExp(`^hsla\\(${u},${h},${h},${u}\\)$`);var d={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};(0,i.A)(r,b,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:v,formatHex:v,formatHex8:x,formatHsl:w,formatRgb:m,toString:m});function v(){return this.rgb().formatHex()}function x(){return this.rgb().formatHex8()}function w(){return E(this).formatHsl()}function m(){return this.rgb().formatRgb()}function b(t){var n,e;t=(t+"").trim().toLowerCase();return(n=c.exec(t))?(e=n[1].length,n=parseInt(n[1],16),e===6?A(n):e===3?new N(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):e===8?M(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):e===4?M(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=l.exec(t))?new N(n[1],n[2],n[3],1):(n=f.exec(t))?new N(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=_.exec(t))?M(n[1],n[2],n[3],n[4]):(n=p.exec(t))?M(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=y.exec(t))?P(n[1],n[2]/100,n[3]/100,1):(n=g.exec(t))?P(n[1],n[2]/100,n[3]/100,n[4]):d.hasOwnProperty(t)?A(d[t]):t==="transparent"?new N(NaN,NaN,NaN,0):null}function A(t){return new N(t>>16&255,t>>8&255,t&255,1)}function M(t,n,e,i){if(i<=0)t=n=e=NaN;return new N(t,n,e,i)}function T(t){if(!(t instanceof r))t=b(t);if(!t)return new N;t=t.rgb();return new N(t.r,t.g,t.b,t.opacity)}function k(t,n,e,i){return arguments.length===1?T(t):new N(t,n,e,i==null?1:i)}function N(t,n,e,i){this.r=+t;this.g=+n;this.b=+e;this.opacity=+i}(0,i.A)(N,k,(0,i.X)(r,{brighter(t){t=t==null?a:Math.pow(a,t);return new N(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){t=t==null?s:Math.pow(s,t);return new N(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new N(D(this.r),D(this.g),D(this.b),F(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&(-.5<=this.g&&this.g<255.5)&&(-.5<=this.b&&this.b<255.5)&&(0<=this.opacity&&this.opacity<=1)},hex:C,formatHex:C,formatHex8:$,formatRgb:U,toString:U}));function C(){return`#${S(this.r)}${S(this.g)}${S(this.b)}`}function $(){return`#${S(this.r)}${S(this.g)}${S(this.b)}${S((isNaN(this.opacity)?1:this.opacity)*255)}`}function U(){const t=F(this.opacity);return`${t===1?"rgb(":"rgba("}${D(this.r)}, ${D(this.g)}, ${D(this.b)}${t===1?")":`, ${t})`}`}function F(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function D(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function S(t){t=D(t);return(t<16?"0":"")+t.toString(16)}function P(t,n,e,i){if(i<=0)t=n=e=NaN;else if(e<=0||e>=1)t=n=NaN;else if(n<=0)t=NaN;return new H(t,n,e,i)}function E(t){if(t instanceof H)return new H(t.h,t.s,t.l,t.opacity);if(!(t instanceof r))t=b(t);if(!t)return new H;if(t instanceof H)return t;t=t.rgb();var n=t.r/255,e=t.g/255,i=t.b/255,s=Math.min(n,e,i),a=Math.max(n,e,i),o=NaN,u=a-s,h=(a+s)/2;if(u){if(n===a)o=(e-i)/u+(e0&&h<1?0:o}return new H(o,u,h,t.opacity)}function R(t,n,e,i){return arguments.length===1?E(t):new H(t,n,e,i==null?1:i)}function H(t,n,e,i){this.h=+t;this.s=+n;this.l=+e;this.opacity=+i}(0,i.A)(H,R,(0,i.X)(r,{brighter(t){t=t==null?a:Math.pow(a,t);return new H(this.h,this.s,this.l*t,this.opacity)},darker(t){t=t==null?s:Math.pow(s,t);return new H(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,n=isNaN(t)||isNaN(this.s)?0:this.s,e=this.l,i=e+(e<.5?e:1-e)*n,r=2*e-i;return new N(L(t>=240?t-240:t+120,r,i),L(t,r,i),L(t<120?t+240:t-120,r,i),this.opacity)},clamp(){return new H(Y(this.h),q(this.s),q(this.l),F(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&(0<=this.l&&this.l<=1)&&(0<=this.opacity&&this.opacity<=1)},formatHsl(){const t=F(this.opacity);return`${t===1?"hsl(":"hsla("}${Y(this.h)}, ${q(this.s)*100}%, ${q(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Y(t){t=(t||0)%360;return t<0?t+360:t}function q(t){return Math.max(0,Math.min(1,t||0))}function L(t,n,e){return(t<60?n+(e-n)*t/60:t<180?e:t<240?n+(e-n)*(240-t)/60:n)*255}},47592:(t,n,e)=>{e.d(n,{A:()=>i,X:()=>r});function i(t,n,e){t.prototype=n.prototype=e;e.constructor=t}function r(t,n){var e=Object.create(t.prototype);for(var i in n)e[i]=n[i];return e}},14180:(t,n,e)=>{e.d(n,{Ay:()=>g,aq:()=>M});var i=e(47592);var r=e(33844);var s=e(77689);const a=18,o=.96422,u=1,h=.82521,c=4/29,l=6/29,f=3*l*l,_=l*l*l;function p(t){if(t instanceof d)return new d(t.l,t.a,t.b,t.opacity);if(t instanceof T)return k(t);if(!(t instanceof r.Gw))t=(0,r.b)(t);var n=m(t.r),e=m(t.g),i=m(t.b),s=v((.2225045*n+.7168786*e+.0606169*i)/u),a,c;if(n===e&&e===i)a=c=s;else{a=v((.4360747*n+.3850649*e+.1430804*i)/o);c=v((.0139322*n+.0971045*e+.7141733*i)/h)}return new d(116*s-16,500*(a-s),200*(s-c),t.opacity)}function y(t,n){return new d(t,0,0,n==null?1:n)}function g(t,n,e,i){return arguments.length===1?p(t):new d(t,n,e,i==null?1:i)}function d(t,n,e,i){this.l=+t;this.a=+n;this.b=+e;this.opacity=+i}(0,i.A)(d,g,(0,i.X)(r.Q1,{brighter(t){return new d(this.l+a*(t==null?1:t),this.a,this.b,this.opacity)},darker(t){return new d(this.l-a*(t==null?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,n=isNaN(this.a)?t:t+this.a/500,e=isNaN(this.b)?t:t-this.b/200;n=o*x(n);t=u*x(t);e=h*x(e);return new r.Gw(w(3.1338561*n-1.6168667*t-.4906146*e),w(-.9787684*n+1.9161415*t+.033454*e),w(.0719453*n-.2289914*t+1.4052427*e),this.opacity)}}));function v(t){return t>_?Math.pow(t,1/3):t/f+c}function x(t){return t>l?t*t*t:f*(t-c)}function w(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function m(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function b(t){if(t instanceof T)return new T(t.h,t.c,t.l,t.opacity);if(!(t instanceof d))t=p(t);if(t.a===0&&t.b===0)return new T(NaN,0{e.d(n,{F:()=>i,u:()=>r});const i=Math.PI/180;const r=180/Math.PI},62996:(t,n,e)=>{e.d(n,{A:()=>h});var i={value:()=>{}};function r(){for(var t=0,n=arguments.length,e={},i;t=0)e=t.slice(i+1),t=t.slice(0,i);if(t&&!n.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))}s.prototype=r.prototype={constructor:s,on:function(t,n){var e=this._,i=a(t+"",e),r,s=-1,h=i.length;if(arguments.length<2){while(++s0)for(var e=new Array(r),i=0,r,s;i{e.d(n,{GP:()=>s,s:()=>a});var i=e(25216);var r;var s;var a;o({thousands:",",grouping:[3],currency:["$",""]});function o(t){r=(0,i.A)(t);s=r.format;a=r.formatPrefix;return r}},40886:(t,n,e)=>{e.d(n,{A:()=>r});var i=e(23735);function r(t){return t=(0,i.f)(Math.abs(t)),t?t[1]:NaN}},23735:(t,n,e)=>{e.d(n,{A:()=>i,f:()=>r});function i(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function r(t,n){if((e=(t=n?t.toExponential(n-1):t.toExponential()).indexOf("e"))<0)return null;var e,i=t.slice(0,e);return[i.length>1?i[0]+i.slice(2):i,+t.slice(e+1)]}},71688:(t,n,e)=>{e.d(n,{A:()=>r});var i=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function r(t){if(!(n=i.exec(t)))throw new Error("invalid format: "+t);var n;return new s({fill:n[1],align:n[2],sign:n[3],symbol:n[4],zero:n[5],width:n[6],comma:n[7],precision:n[8]&&n[8].slice(1),trim:n[9],type:n[10]})}r.prototype=s.prototype;function s(t){this.fill=t.fill===undefined?" ":t.fill+"";this.align=t.align===undefined?">":t.align+"";this.sign=t.sign===undefined?"-":t.sign+"";this.symbol=t.symbol===undefined?"":t.symbol+"";this.zero=!!t.zero;this.width=t.width===undefined?undefined:+t.width;this.comma=!!t.comma;this.precision=t.precision===undefined?undefined:+t.precision;this.trim=!!t.trim;this.type=t.type===undefined?"":t.type+""}s.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===undefined?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===undefined?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type}},25216:(t,n,e)=>{e.d(n,{A:()=>g});var i=e(40886);function r(t,n){return function(e,i){var r=e.length,s=[],a=0,o=t[0],u=0;while(r>0&&o>0){if(u+o+1>i)o=Math.max(1,i-u);s.push(e.substring(r-=o,r+o));if((u+=o+1)>i)break;o=t[a=(a+1)%t.length]}return s.reverse().join(n)}}function s(t){return function(n){return n.replace(/[0-9]/g,(function(n){return t[+n]}))}}var a=e(71688);function o(t){t:for(var n=t.length,e=1,i=-1,r;e0)i=0;break}}return i>0?t.slice(0,i)+t.slice(r+1):t}var u=e(23735);var h;function c(t,n){var e=(0,u.f)(t,n);if(!e)return t+"";var i=e[0],r=e[1],s=r-(h=Math.max(-8,Math.min(8,Math.floor(r/3)))*3)+1,a=i.length;return s===a?i:s>a?i+new Array(s-a+1).join("0"):s>0?i.slice(0,s)+"."+i.slice(s):"0."+new Array(1-s).join("0")+(0,u.f)(t,Math.max(0,n+s-1))[0]}function l(t,n){var e=(0,u.f)(t,n);if(!e)return t+"";var i=e[0],r=e[1];return r<0?"0."+new Array(-r).join("0")+i:i.length>r+1?i.slice(0,r+1)+"."+i.slice(r+1):i+new Array(r-i.length+2).join("0")}const f={"%":(t,n)=>(t*100).toFixed(n),b:t=>Math.round(t).toString(2),c:t=>t+"",d:u.A,e:(t,n)=>t.toExponential(n),f:(t,n)=>t.toFixed(n),g:(t,n)=>t.toPrecision(n),o:t=>Math.round(t).toString(8),p:(t,n)=>l(t*100,n),r:l,s:c,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function _(t){return t}var p=Array.prototype.map,y=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function g(t){var n=t.grouping===undefined||t.thousands===undefined?_:r(p.call(t.grouping,Number),t.thousands+""),e=t.currency===undefined?"":t.currency[0]+"",u=t.currency===undefined?"":t.currency[1]+"",c=t.decimal===undefined?".":t.decimal+"",l=t.numerals===undefined?_:s(p.call(t.numerals,String)),g=t.percent===undefined?"%":t.percent+"",d=t.minus===undefined?"−":t.minus+"",v=t.nan===undefined?"NaN":t.nan+"";function x(t){t=(0,a.A)(t);var i=t.fill,r=t.align,s=t.sign,_=t.symbol,p=t.zero,x=t.width,w=t.comma,m=t.precision,b=t.trim,A=t.type;if(A==="n")w=true,A="g";else if(!f[A])m===undefined&&(m=12),b=true,A="g";if(p||i==="0"&&r==="=")p=true,i="0",r="=";var M=_==="$"?e:_==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():"",T=_==="$"?u:/[%p]/.test(A)?g:"";var k=f[A],N=/[defgprs%]/.test(A);m=m===undefined?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,m)):Math.max(0,Math.min(20,m));function C(t){var e=M,a=T,u,f,_;if(A==="c"){a=k(t)+a;t=""}else{t=+t;var g=t<0||1/t<0;t=isNaN(t)?v:k(Math.abs(t),m);if(b)t=o(t);if(g&&+t===0&&s!=="+")g=false;e=(g?s==="("?s:d:s==="-"||s==="("?"":s)+e;a=(A==="s"?y[8+h/3]:"")+a+(g&&s==="("?")":"");if(N){u=-1,f=t.length;while(++u_||_>57){a=(_===46?c+t.slice(u+1):t.slice(u))+a;t=t.slice(0,u);break}}}}if(w&&!p)t=n(t,Infinity);var C=e.length+t.length+a.length,$=C>1)+e+t+a+$.slice(C);break;default:t=$+e+t+a;break}return l(t)}C.toString=function(){return t+""};return C}function w(t,n){var e=x((t=(0,a.A)(t),t.type="f",t)),r=Math.max(-8,Math.min(8,Math.floor((0,i.A)(n)/3)))*3,s=Math.pow(10,-r),o=y[8+r/3];return function(t){return e(s*t)+o}}return{format:x,formatPrefix:w}}},93391:(t,n,e)=>{e.d(n,{A:()=>r});var i=e(40886);function r(t){return Math.max(0,-(0,i.A)(Math.abs(t)))}},86093:(t,n,e)=>{e.d(n,{A:()=>r});var i=e(40886);function r(t,n){return Math.max(0,Math.max(-8,Math.min(8,Math.floor((0,i.A)(n)/3)))*3-(0,i.A)(Math.abs(t)))}},78209:(t,n,e)=>{e.d(n,{A:()=>r});var i=e(40886);function r(t,n){t=Math.abs(t),n=Math.abs(n)-t;return Math.max(0,(0,i.A)(n)-(0,i.A)(t))+1}},69266:(t,n,e)=>{e.d(n,{$:()=>a,A:()=>s});var i=e(21406);var r=e(48561);function s(t,n){return((0,r.p)(n)?r.A:a)(t,n)}function a(t,n){var e=n?n.length:0,r=t?Math.min(e,t.length):0,s=new Array(r),a=new Array(e),o;for(o=0;o{e.d(n,{A:()=>r,H:()=>i});function i(t,n,e,i,r){var s=t*t,a=s*t;return((1-3*t+3*s-a)*n+(4-6*s+3*a)*e+(1+3*t+3*s-3*a)*i+a*r)/6}function r(t){var n=t.length-1;return function(e){var r=e<=0?e=0:e>=1?(e=1,n-1):Math.floor(e*n),s=t[r],a=t[r+1],o=r>0?t[r-1]:2*s-a,u=r{e.d(n,{A:()=>r});var i=e(13029);function r(t){var n=t.length;return function(e){var r=Math.floor(((e%=1)<0?++e:e)*n),s=t[(r+n-1)%n],a=t[r%n],o=t[(r+1)%n],u=t[(r+2)%n];return(0,i.H)((e-r/n)*n,s,a,o,u)}}},6504:(t,n,e)=>{e.d(n,{Ay:()=>u,lG:()=>a,uN:()=>o});var i=e(80319);function r(t,n){return function(e){return t+e*n}}function s(t,n,e){return t=Math.pow(t,e),n=Math.pow(n,e)-t,e=1/e,function(i){return Math.pow(t+i*n,e)}}function a(t,n){var e=n-t;return e?r(t,e>180||e<-180?e-360*Math.round(e/360):e):(0,i.A)(isNaN(t)?n:t)}function o(t){return(t=+t)===1?u:function(n,e){return e-n?s(n,e,t):(0,i.A)(isNaN(n)?e:n)}}function u(t,n){var e=n-t;return e?r(t,e):(0,i.A)(isNaN(t)?n:t)}},80319:(t,n,e)=>{e.d(n,{A:()=>i});const i=t=>()=>t},57007:(t,n,e)=>{e.d(n,{A:()=>i});function i(t,n){var e=new Date;return t=+t,n=+n,function(i){return e.setTime(t*(1-i)+n*i),e}}},67360:(t,n,e)=>{e.r(n);e.d(n,{interpolate:()=>i.A,interpolateArray:()=>r.A,interpolateBasis:()=>s.A,interpolateBasisClosed:()=>a.A,interpolateCubehelix:()=>G,interpolateCubehelixLong:()=>J,interpolateDate:()=>o.A,interpolateDiscrete:()=>u,interpolateHcl:()=>U,interpolateHclLong:()=>F,interpolateHsl:()=>T,interpolateHslLong:()=>k,interpolateHue:()=>c,interpolateLab:()=>C,interpolateNumber:()=>l.A,interpolateNumberArray:()=>f.A,interpolateObject:()=>_.A,interpolateRgb:()=>b.Ay,interpolateRgbBasis:()=>b.Ik,interpolateRgbBasisClosed:()=>b.uL,interpolateRound:()=>p.A,interpolateString:()=>y.A,interpolateTransformCss:()=>g.T,interpolateTransformSvg:()=>g.I,interpolateZoom:()=>m,piecewise:()=>Z.A,quantize:()=>Q});var i=e(21406);var r=e(69266);var s=e(13029);var a=e(64425);var o=e(57007);function u(t){var n=t.length;return function(e){return t[Math.max(0,Math.min(n-1,Math.floor(e*n)))]}}var h=e(6504);function c(t,n){var e=(0,h.lG)(+t,+n);return function(t){var n=e(t);return n-360*Math.floor(n/360)}}var l=e(85566);var f=e(48561);var _=e(86088);var p=e(15307);var y=e(23318);var g=e(39480);var d=1e-12;function v(t){return((t=Math.exp(t))+1/t)/2}function x(t){return((t=Math.exp(t))-1/t)/2}function w(t){return((t=Math.exp(2*t))-1)/(t+1)}const m=function t(n,e,i){function r(t,r){var s=t[0],a=t[1],o=t[2],u=r[0],h=r[1],c=r[2],l=u-s,f=h-a,_=l*l+f*f,p,y;if(_{e.d(n,{A:()=>i});function i(t,n){return t=+t,n=+n,function(e){return t*(1-e)+n*e}}},48561:(t,n,e)=>{e.d(n,{A:()=>i,p:()=>r});function i(t,n){if(!n)n=[];var e=t?Math.min(n.length,t.length):0,i=n.slice(),r;return function(s){for(r=0;r{e.d(n,{A:()=>r});var i=e(21406);function r(t,n){var e={},r={},s;if(t===null||typeof t!=="object")t={};if(n===null||typeof n!=="object")n={};for(s in n){if(s in t){e[s]=(0,i.A)(t[s],n[s])}else{r[s]=n[s]}}return function(t){for(s in e)r[s]=e[s](t);return r}}},99793:(t,n,e)=>{e.d(n,{A:()=>r});var i=e(21406);function r(t,n){if(n===undefined)n=t,t=i.A;var e=0,r=n.length-1,s=n[0],a=new Array(r<0?0:r);while(e{e.d(n,{Ay:()=>o,Ik:()=>h,uL:()=>c});var i=e(33844);var r=e(13029);var s=e(64425);var a=e(6504);const o=function t(n){var e=(0,a.uN)(n);function r(t,n){var r=e((t=(0,i.Qh)(t)).r,(n=(0,i.Qh)(n)).r),s=e(t.g,n.g),o=e(t.b,n.b),u=(0,a.Ay)(t.opacity,n.opacity);return function(n){t.r=r(n);t.g=s(n);t.b=o(n);t.opacity=u(n);return t+""}}r.gamma=t;return r}(1);function u(t){return function(n){var e=n.length,r=new Array(e),s=new Array(e),a=new Array(e),o,u;for(o=0;o{e.d(n,{A:()=>i});function i(t,n){return t=+t,n=+n,function(e){return Math.round(t*(1-e)+n*e)}}},23318:(t,n,e)=>{e.d(n,{A:()=>u});var i=e(85566);var r=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,s=new RegExp(r.source,"g");function a(t){return function(){return t}}function o(t){return function(n){return t(n)+""}}function u(t,n){var e=r.lastIndex=s.lastIndex=0,u,h,c,l=-1,f=[],_=[];t=t+"",n=n+"";while((u=r.exec(t))&&(h=s.exec(n))){if((c=h.index)>e){c=n.slice(e,c);if(f[l])f[l]+=c;else f[++l]=c}if((u=u[0])===(h=h[0])){if(f[l])f[l]+=h;else f[++l]=h}else{f[++l]=null;_.push({i:l,x:(0,i.A)(u,h)})}e=s.lastIndex}if(e{e.d(n,{T:()=>l,I:()=>f});var i=e(85566);var r=180/Math.PI;var s={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function a(t,n,e,i,s,a){var o,u,h;if(o=Math.sqrt(t*t+n*n))t/=o,n/=o;if(h=t*e+n*i)e-=t*h,i-=n*h;if(u=Math.sqrt(e*e+i*i))e/=u,i/=u,h/=u;if(t*i180)n+=360;else if(n-t>180)t+=360;a.push({i:e.push(s(e)+"rotate(",null,r)-2,x:(0,i.A)(t,n)})}else if(n){e.push(s(e)+"rotate("+n+r)}}function u(t,n,e,a){if(t!==n){a.push({i:e.push(s(e)+"skewX(",null,r)-2,x:(0,i.A)(t,n)})}else if(n){e.push(s(e)+"skewX("+n+r)}}function h(t,n,e,r,a,o){if(t!==e||n!==r){var u=a.push(s(a)+"scale(",null,",",null,")");o.push({i:u-4,x:(0,i.A)(t,e)},{i:u-2,x:(0,i.A)(n,r)})}else if(e!==1||r!==1){a.push(s(a)+"scale("+e+","+r+")")}}return function(n,e){var i=[],r=[];n=t(n),e=t(e);a(n.translateX,n.translateY,e.translateX,e.translateY,i,r);o(n.rotate,e.rotate,i,r);u(n.skewX,e.skewX,i,r);h(n.scaleX,n.scaleY,e.scaleX,e.scaleY,i,r);n=e=null;return function(t){var n=-1,e=r.length,s;while(++n{e.d(n,{A:()=>f});var i=e(33844);var r=e(79948);var s=e(69266);var a=e(57007);var o=e(85566);var u=e(86088);var h=e(23318);var c=e(80319);var l=e(48561);function f(t,n){var e=typeof n,f;return n==null||e==="boolean"?(0,c.A)(n):(e==="number"?o.A:e==="string"?(f=(0,i.Ay)(n))?(n=f,r.Ay):h.A:n instanceof i.Ay?r.Ay:n instanceof Date?a.A:(0,l.p)(n)?l.A:Array.isArray(n)?s.$:typeof n.valueOf!=="function"&&typeof n.toString!=="function"||isNaN(n)?u.A:o.A)(t,n)}},69450:(t,n,e)=>{e.d(n,{Ae:()=>c,wA:()=>h});const i=Math.PI,r=2*i,s=1e-6,a=r-s;function o(t){this._+=t[0];for(let n=1,e=t.length;n=0))throw new Error(`invalid digits: ${t}`);if(n>15)return o;const e=10**n;return function(t){this._+=t[0];for(let n=1,i=t.length;ns));else if(!(Math.abs(f*h-c*l)>s)||!a){this._append`L${this._x1=t},${this._y1=n}`}else{let p=e-o,y=r-u,g=h*h+c*c,d=p*p+y*y,v=Math.sqrt(g),x=Math.sqrt(_),w=a*Math.tan((i-Math.acos((g+_-d)/(2*v*x)))/2),m=w/x,b=w/v;if(Math.abs(m-1)>s){this._append`L${t+m*l},${n+m*f}`}this._append`A${a},${a},0,0,${+(f*p>l*y)},${this._x1=t+b*h},${this._y1=n+b*c}`}}arc(t,n,e,o,u,h){t=+t,n=+n,e=+e,h=!!h;if(e<0)throw new Error(`negative radius: ${e}`);let c=e*Math.cos(o),l=e*Math.sin(o),f=t+c,_=n+l,p=1^h,y=h?o-u:u-o;if(this._x1===null){this._append`M${f},${_}`}else if(Math.abs(this._x1-f)>s||Math.abs(this._y1-_)>s){this._append`L${f},${_}`}if(!e)return;if(y<0)y=y%r+r;if(y>a){this._append`A${e},${e},0,1,${p},${t-c},${n-l}A${e},${e},0,1,${p},${this._x1=f},${this._y1=_}`}else if(y>s){this._append`A${e},${e},0,${+(y>=i)},${p},${this._x1=t+e*Math.cos(u)},${this._y1=n+e*Math.sin(u)}`}}rect(t,n,e,i){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${e=+e}v${+i}h${-e}Z`}toString(){return this._}}function c(){return new h}c.prototype=h.prototype;function l(t=3){return new h(+t)}},58177:(t,n,e)=>{e.d(n,{A:()=>i});function i(t){var n=t.length/6|0,e=new Array(n),i=0;while(i{e.d(n,{C:()=>y,Ay:()=>d,D_:()=>c,Gu:()=>g});var i=e(71363);var r=e(21406);var s=e(85566);var a=e(15307);function o(t){return function(){return t}}var u=e(60117);var h=[0,1];function c(t){return t}function l(t,n){return(n-=t=+t)?function(e){return(e-t)/n}:o(isNaN(n)?NaN:.5)}function f(t,n){var e;if(t>n)e=t,t=n,n=e;return function(e){return Math.max(t,Math.min(n,e))}}function _(t,n,e){var i=t[0],r=t[1],s=n[0],a=n[1];if(r2?p:_;d=v=null;return w}function w(r){return r==null||isNaN(r=+r)?l:(d||(d=g(t.map(i),n,e)))(i(y(r)))}w.invert=function(e){return y(o((v||(v=g(n,t.map(i),s.A)))(e)))};w.domain=function(n){return arguments.length?(t=Array.from(n,u.A),x()):t.slice()};w.range=function(t){return arguments.length?(n=Array.from(t),x()):n.slice()};w.rangeRound=function(t){return n=Array.from(t),e=a.A,x()};w.clamp=function(t){return arguments.length?(y=t?true:c,x()):y!==c};w.interpolate=function(t){return arguments.length?(e=t,x()):e};w.unknown=function(t){return arguments.length?(l=t,w):l};return function(t,n){i=t,o=n;return x()}}function d(){return g()(c,c)}},25758:(t,n,e)=>{e.d(n,{C:()=>i,K:()=>r});function i(t,n){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(n).domain(t);break}return this}function r(t,n){switch(arguments.length){case 0:break;case 1:{if(typeof t==="function")this.interpolator(t);else this.range(t);break}default:{this.domain(t);if(typeof n==="function")this.interpolator(n);else this.range(n);break}}return this}},20481:(t,n,e)=>{e.d(n,{A:()=>u,C:()=>o});var i=e(97119);var r=e(52178);var s=e(25758);var a=e(26698);function o(t){var n=t.domain;t.ticks=function(t){var e=n();return(0,i.Ay)(e[0],e[e.length-1],t==null?10:t)};t.tickFormat=function(t,e){var i=n();return(0,a.A)(i[0],i[i.length-1],t==null?10:t,e)};t.nice=function(e){if(e==null)e=10;var r=n();var s=0;var a=r.length-1;var o=r[s];var u=r[a];var h;var c;var l=10;if(u0){c=(0,i.lq)(o,u,e);if(c===h){r[s]=o;r[a]=u;return n(r)}else if(c>0){o=Math.floor(o/c)*c;u=Math.ceil(u/c)*c}else if(c<0){o=Math.ceil(o*c)/c;u=Math.floor(u*c)/c}else{break}h=c}return t};return t}function u(){var t=(0,r.Ay)();t.copy=function(){return(0,r.C)(t,u())};s.C.apply(t,arguments);return o(t)}},60125:(t,n,e)=>{e.d(n,{A:()=>i});function i(t,n){t=t.slice();var e=0,i=t.length-1,r=t[e],s=t[i],a;if(s{e.d(n,{A:()=>i});function i(t){return+t}},16527:(t,n,e)=>{e.d(n,{A:()=>a,h:()=>s});var i=e(30352);var r=e(25758);const s=Symbol("implicit");function a(){var t=new i.B,n=[],e=[],o=s;function u(i){let r=t.get(i);if(r===undefined){if(o!==s)return o;t.set(i,r=n.push(i)-1)}return e[r%e.length]}u.domain=function(e){if(!arguments.length)return n.slice();n=[],t=new i.B;for(const i of e){if(t.has(i))continue;t.set(i,n.push(i)-1)}return u};u.range=function(t){return arguments.length?(e=Array.from(t),u):e.slice()};u.unknown=function(t){return arguments.length?(o=t,u):o};u.copy=function(){return a(n,e).unknown(o)};r.C.apply(u,arguments);return u}},26698:(t,n,e)=>{e.d(n,{A:()=>h});var i=e(97119);var r=e(71688);var s=e(86093);var a=e(24626);var o=e(78209);var u=e(93391);function h(t,n,e,h){var c=(0,i.sG)(t,n,e),l;h=(0,r.A)(h==null?",f":h);switch(h.type){case"s":{var f=Math.max(Math.abs(t),Math.abs(n));if(h.precision==null&&!isNaN(l=(0,s.A)(c,f)))h.precision=l;return(0,a.s)(h,f)}case"":case"e":case"g":case"p":case"r":{if(h.precision==null&&!isNaN(l=(0,o.A)(c,Math.max(Math.abs(t),Math.abs(n)))))h.precision=l-(h.type==="e");break}case"f":case"%":{if(h.precision==null&&!isNaN(l=(0,u.A)(c)))h.precision=l-(h.type==="%")*2;break}}return(0,a.GP)(h)}},74725:(t,n,e)=>{e.d(n,{A:()=>v,B:()=>d});var i=e(20421);var r=e(42706);var s=e(77849);var a=e(61779);var o=e(20293);var u=e(9017);var h=e(23383);var c=e(61147);var l=e(82692);var f=e(52178);var _=e(25758);var p=e(60125);function y(t){return new Date(t)}function g(t){return t instanceof Date?+t:+new Date(+t)}function d(t,n,e,i,r,s,a,o,u,h){var c=(0,f.Ay)(),l=c.invert,_=c.domain;var v=h(".%L"),x=h(":%S"),w=h("%I:%M"),m=h("%I %p"),b=h("%a %d"),A=h("%b %d"),M=h("%B"),T=h("%Y");function k(t){return(u(t){e.d(n,{A:()=>_});var i=e(84653);var r=e(98247);var s=e(18226);function a(t){return t.innerRadius}function o(t){return t.outerRadius}function u(t){return t.startAngle}function h(t){return t.endAngle}function c(t){return t&&t.padAngle}function l(t,n,e,i,s,a,o,u){var h=e-t,c=i-n,l=o-s,f=u-a,_=f*h-l*c;if(_*_F*F+D*D)T=N,k=C;return{cx:T,cy:k,x01:-l,y01:-f,x11:T*(s/b-1),y11:k*(s/b-1)}}function _(){var t=a,n=o,e=(0,i.A)(0),_=null,p=u,y=h,g=c,d=null,v=(0,s.i)(x);function x(){var i,s,a=+t.apply(this,arguments),o=+n.apply(this,arguments),u=p.apply(this,arguments)-r.TW,h=y.apply(this,arguments)-r.TW,c=(0,r.tn)(h-u),x=h>u;if(!d)d=i=v();if(or.Ni))d.moveTo(0,0);else if(c>r.FA-r.Ni){d.moveTo(o*(0,r.gn)(u),o*(0,r.F8)(u));d.arc(0,0,o,u,h,!x);if(a>r.Ni){d.moveTo(a*(0,r.gn)(h),a*(0,r.F8)(h));d.arc(0,0,a,h,u,x)}}else{var w=u,m=h,b=u,A=h,M=c,T=c,k=g.apply(this,arguments)/2,N=k>r.Ni&&(_?+_.apply(this,arguments):(0,r.RZ)(a*a+o*o)),C=(0,r.jk)((0,r.tn)(o-a)/2,+e.apply(this,arguments)),$=C,U=C,F,D;if(N>r.Ni){var S=(0,r.qR)(N/a*(0,r.F8)(k)),P=(0,r.qR)(N/o*(0,r.F8)(k));if((M-=S*2)>r.Ni)S*=x?1:-1,b+=S,A-=S;else M=0,b=A=(u+h)/2;if((T-=P*2)>r.Ni)P*=x?1:-1,w+=P,m-=P;else T=0,w=m=(u+h)/2}var E=o*(0,r.gn)(w),R=o*(0,r.F8)(w),H=a*(0,r.gn)(A),Y=a*(0,r.F8)(A);if(C>r.Ni){var q=o*(0,r.gn)(m),L=o*(0,r.F8)(m),j=a*(0,r.gn)(b),z=a*(0,r.F8)(b),X;if(cr.Ni))d.moveTo(E,R);else if(U>r.Ni){F=f(j,z,E,R,o,U,x);D=f(q,L,H,Y,o,U,x);d.moveTo(F.cx+F.x01,F.cy+F.y01);if(Ur.Ni)||!(M>r.Ni))d.lineTo(H,Y);else if($>r.Ni){F=f(H,Y,q,L,a,-$,x);D=f(E,R,j,z,a,-$,x);d.lineTo(F.cx+F.x01,F.cy+F.y01);if(${e.d(n,{A:()=>r});var i=Array.prototype.slice;function r(t){return typeof t==="object"&&"length"in t?t:Array.from(t)}},84653:(t,n,e)=>{e.d(n,{A:()=>i});function i(t){return function n(){return t}}},24363:(t,n,e)=>{e.d(n,{Ay:()=>s,xO:()=>r,zx:()=>i});function i(t,n,e){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+n)/6,(t._y0+4*t._y1+e)/6)}function r(t){this._context=t}r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){switch(this._point){case 3:i(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:i(this,t,n);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=n}};function s(t){return new r(t)}},60075:(t,n,e)=>{e.d(n,{A:()=>a});var i=e(71649);var r=e(24363);function s(t){this._context=t}s.prototype={areaStart:i.A,areaEnd:i.A,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2);this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3);this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3);this._context.closePath();break}case 3:{this.point(this._x2,this._y2);this.point(this._x3,this._y3);this.point(this._x4,this._y4);break}}},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;this._x2=t,this._y2=n;break;case 1:this._point=2;this._x3=t,this._y3=n;break;case 2:this._point=3;this._x4=t,this._y4=n;this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+n)/6);break;default:(0,r.zx)(this,t,n);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=n}};function a(t){return new s(t)}},69683:(t,n,e)=>{e.d(n,{A:()=>s});var i=e(24363);function r(t){this._context=t}r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var e=(this._x0+4*this._x1+t)/6,r=(this._y0+4*this._y1+n)/6;this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break;case 3:this._point=4;default:(0,i.zx)(this,t,n);break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=n}};function s(t){return new r(t)}},54545:(t,n,e)=>{e.d(n,{A:()=>s});var i=e(24363);function r(t,n){this._basis=new i.xO(t);this._beta=n}r.prototype={lineStart:function(){this._x=[];this._y=[];this._basis.lineStart()},lineEnd:function(){var t=this._x,n=this._y,e=t.length-1;if(e>0){var i=t[0],r=n[0],s=t[e]-i,a=n[e]-r,o=-1,u;while(++o<=e){u=o/e;this._basis.point(this._beta*t[o]+(1-this._beta)*(i+u*s),this._beta*n[o]+(1-this._beta)*(r+u*a))}}this._x=this._y=null;this._basis.lineEnd()},point:function(t,n){this._x.push(+t);this._y.push(+n)}};const s=function t(n){function e(t){return n===1?new i.xO(t):new r(t,n)}e.beta=function(n){return t(+n)};return e}(.85)},43793:(t,n,e)=>{e.d(n,{Ay:()=>s,vP:()=>r,zx:()=>i});function i(t,n,e){t._context.bezierCurveTo(t._x1+t._k*(t._x2-t._x0),t._y1+t._k*(t._y2-t._y0),t._x2+t._k*(t._x1-n),t._y2+t._k*(t._y1-e),t._x2,t._y2)}function r(t,n){this._context=t;this._k=(1-n)/6}r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:i(this,this._x1,this._y1);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;this._x1=t,this._y1=n;break;case 2:this._point=3;default:i(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=n}};const s=function t(n){function e(t){return new r(t,n)}e.tension=function(n){return t(+n)};return e}(0)},13893:(t,n,e)=>{e.d(n,{A:()=>a,L:()=>s});var i=e(71649);var r=e(43793);function s(t,n){this._context=t;this._k=(1-n)/6}s.prototype={areaStart:i.A,areaEnd:i.A,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;this._x3=t,this._y3=n;break;case 1:this._point=2;this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3;this._x5=t,this._y5=n;break;default:(0,r.zx)(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=n}};const a=function t(n){function e(t){return new s(t,n)}e.tension=function(n){return t(+n)};return e}(0)},46457:(t,n,e)=>{e.d(n,{A:()=>s,H:()=>r});var i=e(43793);function r(t,n){this._context=t;this._k=(1-n)/6}r.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:(0,i.zx)(this,t,n);break}this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=n}};const s=function t(n){function e(t){return new r(t,n)}e.tension=function(n){return t(+n)};return e}(0)},76413:(t,n,e)=>{e.d(n,{A:()=>o,z:()=>s});var i=e(98247);var r=e(43793);function s(t,n,e){var r=t._x1,s=t._y1,a=t._x2,o=t._y2;if(t._l01_a>i.Ni){var u=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,h=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*u-t._x0*t._l12_2a+t._x2*t._l01_2a)/h;s=(s*u-t._y0*t._l12_2a+t._y2*t._l01_2a)/h}if(t._l23_a>i.Ni){var c=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,l=3*t._l23_a*(t._l23_a+t._l12_a);a=(a*c+t._x1*t._l23_2a-n*t._l12_2a)/l;o=(o*c+t._y1*t._l23_2a-e*t._l12_2a)/l}t._context.bezierCurveTo(r,s,a,o,t._x2,t._y2)}function a(t,n){this._context=t;this._alpha=n}a.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x2,this._y2);break;case 3:this.point(this._x2,this._y2);break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;if(this._point){var e=this._x2-t,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;default:s(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=n}};const o=function t(n){function e(t){return n?new a(t,n):new r.vP(t,0)}e.alpha=function(n){return t(+n)};return e}(.5)},25633:(t,n,e)=>{e.d(n,{A:()=>o});var i=e(13893);var r=e(71649);var s=e(76413);function a(t,n){this._context=t;this._alpha=n}a.prototype={areaStart:r.A,areaEnd:r.A,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x3,this._y3);this._context.closePath();break}case 2:{this._context.lineTo(this._x3,this._y3);this._context.closePath();break}case 3:{this.point(this._x3,this._y3);this.point(this._x4,this._y4);this.point(this._x5,this._y5);break}}},point:function(t,n){t=+t,n=+n;if(this._point){var e=this._x2-t,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+i*i,this._alpha))}switch(this._point){case 0:this._point=1;this._x3=t,this._y3=n;break;case 1:this._point=2;this._context.moveTo(this._x4=t,this._y4=n);break;case 2:this._point=3;this._x5=t,this._y5=n;break;default:(0,s.z)(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=n}};const o=function t(n){function e(t){return n?new a(t,n):new i.L(t,0)}e.alpha=function(n){return t(+n)};return e}(.5)},13309:(t,n,e)=>{e.d(n,{A:()=>a});var i=e(46457);var r=e(76413);function s(t,n){this._context=t;this._alpha=n}s.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN;this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===3)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;if(this._point){var e=this._x2-t,i=this._y2-n;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(e*e+i*i,this._alpha))}switch(this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;this._line?this._context.lineTo(this._x2,this._y2):this._context.moveTo(this._x2,this._y2);break;case 3:this._point=4;default:(0,r.z)(this,t,n);break}this._l01_a=this._l12_a,this._l12_a=this._l23_a;this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a;this._x0=this._x1,this._x1=this._x2,this._x2=t;this._y0=this._y1,this._y1=this._y2,this._y2=n}};const a=function t(n){function e(t){return n?new s(t,n):new i.H(t,0)}e.alpha=function(n){return t(+n)};return e}(.5)},71228:(t,n,e)=>{e.d(n,{A:()=>r});function i(t){this._context=t}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:this._context.lineTo(t,n);break}}};function r(t){return new i(t)}},43272:(t,n,e)=>{e.d(n,{A:()=>s});var i=e(71649);function r(t){this._context=t}r.prototype={areaStart:i.A,areaEnd:i.A,lineStart:function(){this._point=0},lineEnd:function(){if(this._point)this._context.closePath()},point:function(t,n){t=+t,n=+n;if(this._point)this._context.lineTo(t,n);else this._point=1,this._context.moveTo(t,n)}};function s(t){return new r(t)}},67694:(t,n,e)=>{e.d(n,{G:()=>c,N:()=>l});function i(t){return t<0?-1:1}function r(t,n,e){var r=t._x1-t._x0,s=n-t._x1,a=(t._y1-t._y0)/(r||s<0&&-0),o=(e-t._y1)/(s||r<0&&-0),u=(a*s+o*r)/(r+s);return(i(a)+i(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(u))||0}function s(t,n){var e=t._x1-t._x0;return e?(3*(t._y1-t._y0)/e-n)/2:n}function a(t,n,e){var i=t._x0,r=t._y0,s=t._x1,a=t._y1,o=(s-i)/3;t._context.bezierCurveTo(i+o,r+o*n,s-o,a-o*e,s,a)}function o(t){this._context=t}o.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN;this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:a(this,this._t0,s(this,this._t0));break}if(this._line||this._line!==0&&this._point===1)this._context.closePath();this._line=1-this._line},point:function(t,n){var e=NaN;t=+t,n=+n;if(t===this._x1&&n===this._y1)return;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;break;case 2:this._point=3;a(this,s(this,e=r(this,t,n)),e);break;default:a(this,this._t0,e=r(this,t,n));break}this._x0=this._x1,this._x1=t;this._y0=this._y1,this._y1=n;this._t0=e}};function u(t){this._context=new h(t)}(u.prototype=Object.create(o.prototype)).point=function(t,n){o.prototype.point.call(this,n,t)};function h(t){this._context=t}h.prototype={moveTo:function(t,n){this._context.moveTo(n,t)},closePath:function(){this._context.closePath()},lineTo:function(t,n){this._context.lineTo(n,t)},bezierCurveTo:function(t,n,e,i,r,s){this._context.bezierCurveTo(n,t,i,e,s,r)}};function c(t){return new o(t)}function l(t){return new u(t)}},29944:(t,n,e)=>{e.d(n,{A:()=>s});function i(t){this._context=t}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[];this._y=[]},lineEnd:function(){var t=this._x,n=this._y,e=t.length;if(e){this._line?this._context.lineTo(t[0],n[0]):this._context.moveTo(t[0],n[0]);if(e===2){this._context.lineTo(t[1],n[1])}else{var i=r(t),s=r(n);for(var a=0,o=1;o=0;--n)r[n]=(a[n]-r[n+1])/s[n];s[e-1]=(t[e]+r[e-1])/2;for(n=0;n{e.d(n,{Ay:()=>r,Ko:()=>s,Ps:()=>a});function i(t,n){this._context=t;this._t=n}i.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN;this._point=0},lineEnd:function(){if(0=0)this._t=1-this._t,this._line=1-this._line},point:function(t,n){t=+t,n=+n;switch(this._point){case 0:this._point=1;this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break;case 1:this._point=2;default:{if(this._t<=0){this._context.lineTo(this._x,n);this._context.lineTo(t,n)}else{var e=this._x*(1-this._t)+t*this._t;this._context.lineTo(e,this._y);this._context.lineTo(e,n)}break}}this._x=t,this._y=n}};function r(t){return new i(t,.5)}function s(t){return new i(t,0)}function a(t){return new i(t,1)}},58679:(t,n,e)=>{e.d(n,{A:()=>u});var i=e(12736);var r=e(84653);var s=e(71228);var a=e(18226);var o=e(59835);function u(t,n){var e=(0,r.A)(true),u=null,h=s.A,c=null,l=(0,a.i)(f);t=typeof t==="function"?t:t===undefined?o.x:(0,r.A)(t);n=typeof n==="function"?n:n===undefined?o.y:(0,r.A)(n);function f(r){var s,a=(r=(0,i.A)(r)).length,o,f=false,_;if(u==null)c=h(_=l());for(s=0;s<=a;++s){if(!(s{e.d(n,{F8:()=>u,FA:()=>_,FP:()=>r,HQ:()=>p,Ni:()=>c,RZ:()=>h,T9:()=>a,TW:()=>f,gn:()=>s,jk:()=>o,pi:()=>l,qR:()=>y,tn:()=>i});const i=Math.abs;const r=Math.atan2;const s=Math.cos;const a=Math.max;const o=Math.min;const u=Math.sin;const h=Math.sqrt;const c=1e-12;const l=Math.PI;const f=l/2;const _=2*l;function p(t){return t>1?0:t<-1?l:Math.acos(t)}function y(t){return t>=1?f:t<=-1?-f:Math.asin(t)}},71649:(t,n,e)=>{e.d(n,{A:()=>i});function i(){}},18226:(t,n,e)=>{e.d(n,{i:()=>r});var i=e(69450);function r(t){let n=3;t.digits=function(e){if(!arguments.length)return n;if(e==null){n=null}else{const t=Math.floor(e);if(!(t>=0))throw new RangeError(`invalid digits: ${e}`);n=t}return t};return()=>new i.wA(n)}},59835:(t,n,e)=>{e.d(n,{x:()=>i,y:()=>r});function i(t){return t[0]}function r(t){return t[1]}},82692:(t,n,e)=>{e.d(n,{DC:()=>s,GY:()=>u,T6:()=>a,aL:()=>o});var i=e(77613);var r;var s;var a;var o;var u;h({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function h(t){r=(0,i.A)(t);s=r.format;a=r.parse;o=r.utcFormat;u=r.utcParse;return r}},77613:(t,n,e)=>{e.d(n,{A:()=>h});var i=e(61779);var r=e(20293);var s=e(42706);function a(t){if(0<=t.y&&t.y<100){var n=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);n.setFullYear(t.y);return n}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function o(t){if(0<=t.y&&t.y<100){var n=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));n.setUTCFullYear(t.y);return n}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function u(t,n,e){return{y:t,m:n,d:e,H:0,M:0,S:0,L:0}}function h(t){var n=t.dateTime,e=t.date,s=t.time,h=t.periods,l=t.days,f=t.shortDays,_=t.months,p=t.shortMonths;var y=g(h),Q=d(h),yt=g(l),Nt=d(l),Ct=g(f),$t=d(f),Ut=g(_),Ft=d(_),Dt=g(p),St=d(p);var Pt={a:Zt,A:Qt,b:Bt,B:Wt,c:null,d:Y,e:Y,f:X,g:tt,G:et,H:q,I:L,j,L:z,m:I,M:O,p:Vt,q:Kt,Q:Tt,s:kt,S:G,u:J,U:Z,V:B,w:W,W:V,x:null,X:null,y:K,Y:nt,Z:it,"%":Mt};var Et={a:tn,A:nn,b:en,B:rn,c:null,d:rt,e:rt,f:ht,g:wt,G:bt,H:st,I:at,j:ot,L:ut,m:ct,M:lt,p:sn,q:an,Q:Tt,s:kt,S:ft,u:_t,U:pt,V:gt,w:dt,W:vt,x:null,X:null,y:xt,Y:mt,Z:At,"%":Mt};var Rt={a:jt,A:zt,b:Xt,B:It,c:Ot,d:C,e:C,f:P,g:M,G:A,H:U,I:U,j:$,L:S,m:N,M:F,p:Lt,q:k,Q:R,s:H,S:D,u:x,U:w,V:m,w:v,W:b,x:Gt,X:Jt,y:M,Y:A,Z:T,"%":E};Pt.x=Ht(e,Pt);Pt.X=Ht(s,Pt);Pt.c=Ht(n,Pt);Et.x=Ht(e,Et);Et.X=Ht(s,Et);Et.c=Ht(n,Et);function Ht(t,n){return function(e){var i=[],r=-1,s=0,a=t.length,o,u,h;if(!(e instanceof Date))e=new Date(+e);while(++r53)return null;if(!("w"in s))s.w=1;if("Z"in s){c=o(u(s.y,0,1)),l=c.getUTCDay();c=l>4||l===0?i.rt.ceil(c):(0,i.rt)(c);c=r.dA.offset(c,(s.V-1)*7);s.y=c.getUTCFullYear();s.m=c.getUTCMonth();s.d=c.getUTCDate()+(s.w+6)%7}else{c=a(u(s.y,0,1)),l=c.getDay();c=l>4||l===0?i.AB.ceil(c):(0,i.AB)(c);c=r.UA.offset(c,(s.V-1)*7);s.y=c.getFullYear();s.m=c.getMonth();s.d=c.getDate()+(s.w+6)%7}}else if("W"in s||"U"in s){if(!("w"in s))s.w="u"in s?s.u%7:"W"in s?1:0;l="Z"in s?o(u(s.y,0,1)).getUTCDay():a(u(s.y,0,1)).getDay();s.m=0;s.d="W"in s?(s.w+6)%7+s.W*7-(l+5)%7:s.w+s.U*7-(l+6)%7}if("Z"in s){s.H+=s.Z/100|0;s.M+=s.Z%100;return o(s)}return a(s)}}function qt(t,n,e,i){var r=0,s=n.length,a=e.length,o,u;while(r=a)return-1;o=n.charCodeAt(r++);if(o===37){o=n.charAt(r++);u=Rt[o in c?n.charAt(r++):o];if(!u||(i=u(t,e,i))<0)return-1}else if(o!=e.charCodeAt(i++)){return-1}}return i}function Lt(t,n,e){var i=y.exec(n.slice(e));return i?(t.p=Q.get(i[0].toLowerCase()),e+i[0].length):-1}function jt(t,n,e){var i=Ct.exec(n.slice(e));return i?(t.w=$t.get(i[0].toLowerCase()),e+i[0].length):-1}function zt(t,n,e){var i=yt.exec(n.slice(e));return i?(t.w=Nt.get(i[0].toLowerCase()),e+i[0].length):-1}function Xt(t,n,e){var i=Dt.exec(n.slice(e));return i?(t.m=St.get(i[0].toLowerCase()),e+i[0].length):-1}function It(t,n,e){var i=Ut.exec(n.slice(e));return i?(t.m=Ft.get(i[0].toLowerCase()),e+i[0].length):-1}function Ot(t,e,i){return qt(t,n,e,i)}function Gt(t,n,i){return qt(t,e,n,i)}function Jt(t,n,e){return qt(t,s,n,e)}function Zt(t){return f[t.getDay()]}function Qt(t){return l[t.getDay()]}function Bt(t){return p[t.getMonth()]}function Wt(t){return _[t.getMonth()]}function Vt(t){return h[+(t.getHours()>=12)]}function Kt(t){return 1+~~(t.getMonth()/3)}function tn(t){return f[t.getUTCDay()]}function nn(t){return l[t.getUTCDay()]}function en(t){return p[t.getUTCMonth()]}function rn(t){return _[t.getUTCMonth()]}function sn(t){return h[+(t.getUTCHours()>=12)]}function an(t){return 1+~~(t.getUTCMonth()/3)}return{format:function(t){var n=Ht(t+="",Pt);n.toString=function(){return t};return n},parse:function(t){var n=Yt(t+="",false);n.toString=function(){return t};return n},utcFormat:function(t){var n=Ht(t+="",Et);n.toString=function(){return t};return n},utcParse:function(t){var n=Yt(t+="",true);n.toString=function(){return t};return n}}}var c={"-":"",_:" ",0:"0"},l=/^\s*\d+/,f=/^%/,_=/[\\^$*+?|[\]().{}]/g;function p(t,n,e){var i=t<0?"-":"",r=(i?-t:t)+"",s=r.length;return i+(s[t.toLowerCase(),n])))}function v(t,n,e){var i=l.exec(n.slice(e,e+1));return i?(t.w=+i[0],e+i[0].length):-1}function x(t,n,e){var i=l.exec(n.slice(e,e+1));return i?(t.u=+i[0],e+i[0].length):-1}function w(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.U=+i[0],e+i[0].length):-1}function m(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.V=+i[0],e+i[0].length):-1}function b(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.W=+i[0],e+i[0].length):-1}function A(t,n,e){var i=l.exec(n.slice(e,e+4));return i?(t.y=+i[0],e+i[0].length):-1}function M(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.y=+i[0]+(+i[0]>68?1900:2e3),e+i[0].length):-1}function T(t,n,e){var i=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(n.slice(e,e+6));return i?(t.Z=i[1]?0:-(i[2]+(i[3]||"00")),e+i[0].length):-1}function k(t,n,e){var i=l.exec(n.slice(e,e+1));return i?(t.q=i[0]*3-3,e+i[0].length):-1}function N(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.m=i[0]-1,e+i[0].length):-1}function C(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.d=+i[0],e+i[0].length):-1}function $(t,n,e){var i=l.exec(n.slice(e,e+3));return i?(t.m=0,t.d=+i[0],e+i[0].length):-1}function U(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.H=+i[0],e+i[0].length):-1}function F(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.M=+i[0],e+i[0].length):-1}function D(t,n,e){var i=l.exec(n.slice(e,e+2));return i?(t.S=+i[0],e+i[0].length):-1}function S(t,n,e){var i=l.exec(n.slice(e,e+3));return i?(t.L=+i[0],e+i[0].length):-1}function P(t,n,e){var i=l.exec(n.slice(e,e+6));return i?(t.L=Math.floor(i[0]/1e3),e+i[0].length):-1}function E(t,n,e){var i=f.exec(n.slice(e,e+1));return i?e+i[0].length:-1}function R(t,n,e){var i=l.exec(n.slice(e));return i?(t.Q=+i[0],e+i[0].length):-1}function H(t,n,e){var i=l.exec(n.slice(e));return i?(t.s=+i[0],e+i[0].length):-1}function Y(t,n){return p(t.getDate(),n,2)}function q(t,n){return p(t.getHours(),n,2)}function L(t,n){return p(t.getHours()%12||12,n,2)}function j(t,n){return p(1+r.UA.count((0,s.he)(t),t),n,3)}function z(t,n){return p(t.getMilliseconds(),n,3)}function X(t,n){return z(t,n)+"000"}function I(t,n){return p(t.getMonth()+1,n,2)}function O(t,n){return p(t.getMinutes(),n,2)}function G(t,n){return p(t.getSeconds(),n,2)}function J(t){var n=t.getDay();return n===0?7:n}function Z(t,n){return p(i.YP.count((0,s.he)(t)-1,t),n,2)}function Q(t){var n=t.getDay();return n>=4||n===0?(0,i.Mo)(t):i.Mo.ceil(t)}function B(t,n){t=Q(t);return p(i.Mo.count((0,s.he)(t),t)+((0,s.he)(t).getDay()===4),n,2)}function W(t){return t.getDay()}function V(t,n){return p(i.AB.count((0,s.he)(t)-1,t),n,2)}function K(t,n){return p(t.getFullYear()%100,n,2)}function tt(t,n){t=Q(t);return p(t.getFullYear()%100,n,2)}function nt(t,n){return p(t.getFullYear()%1e4,n,4)}function et(t,n){var e=t.getDay();t=e>=4||e===0?(0,i.Mo)(t):i.Mo.ceil(t);return p(t.getFullYear()%1e4,n,4)}function it(t){var n=t.getTimezoneOffset();return(n>0?"-":(n*=-1,"+"))+p(n/60|0,"0",2)+p(n%60,"0",2)}function rt(t,n){return p(t.getUTCDate(),n,2)}function st(t,n){return p(t.getUTCHours(),n,2)}function at(t,n){return p(t.getUTCHours()%12||12,n,2)}function ot(t,n){return p(1+r.dA.count((0,s.Mb)(t),t),n,3)}function ut(t,n){return p(t.getUTCMilliseconds(),n,3)}function ht(t,n){return ut(t,n)+"000"}function ct(t,n){return p(t.getUTCMonth()+1,n,2)}function lt(t,n){return p(t.getUTCMinutes(),n,2)}function ft(t,n){return p(t.getUTCSeconds(),n,2)}function _t(t){var n=t.getUTCDay();return n===0?7:n}function pt(t,n){return p(i.Hl.count((0,s.Mb)(t)-1,t),n,2)}function yt(t){var n=t.getUTCDay();return n>=4||n===0?(0,i.pT)(t):i.pT.ceil(t)}function gt(t,n){t=yt(t);return p(i.pT.count((0,s.Mb)(t),t)+((0,s.Mb)(t).getUTCDay()===4),n,2)}function dt(t){return t.getUTCDay()}function vt(t,n){return p(i.rt.count((0,s.Mb)(t)-1,t),n,2)}function xt(t,n){return p(t.getUTCFullYear()%100,n,2)}function wt(t,n){t=yt(t);return p(t.getUTCFullYear()%100,n,2)}function mt(t,n){return p(t.getUTCFullYear()%1e4,n,4)}function bt(t,n){var e=t.getUTCDay();t=e>=4||e===0?(0,i.pT)(t):i.pT.ceil(t);return p(t.getUTCFullYear()%1e4,n,4)}function At(){return"+0000"}function Mt(){return"%"}function Tt(t){return+t}function kt(t){return Math.floor(+t/1e3)}},20293:(t,n,e)=>{e.d(n,{TW:()=>h,UA:()=>s,dA:()=>o});var i=e(12834);var r=e(29551);const s=(0,i.f)((t=>t.setHours(0,0,0,0)),((t,n)=>t.setDate(t.getDate()+n)),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*r.rR)/r.Nm),(t=>t.getDate()-1));const a=s.range;const o=(0,i.f)((t=>{t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n)}),((t,n)=>(n-t)/r.Nm),(t=>t.getUTCDate()-1));const u=o.range;const h=(0,i.f)((t=>{t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n)}),((t,n)=>(n-t)/r.Nm),(t=>Math.floor(t/r.Nm)));const c=h.range},29551:(t,n,e)=>{e.d(n,{Fq:()=>o,JJ:()=>s,MP:()=>h,Nm:()=>a,Pv:()=>u,Tt:()=>i,rR:()=>r});const i=1e3;const r=i*60;const s=r*60;const a=s*24;const o=a*7;const u=a*30;const h=a*365},9017:(t,n,e)=>{e.d(n,{Ag:()=>s,pz:()=>o});var i=e(12834);var r=e(29551);const s=(0,i.f)((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*r.Tt-t.getMinutes()*r.rR)}),((t,n)=>{t.setTime(+t+n*r.JJ)}),((t,n)=>(n-t)/r.JJ),(t=>t.getHours()));const a=s.range;const o=(0,i.f)((t=>{t.setUTCMinutes(0,0,0)}),((t,n)=>{t.setTime(+t+n*r.JJ)}),((t,n)=>(n-t)/r.JJ),(t=>t.getUTCHours()));const u=o.range},12834:(t,n,e)=>{e.d(n,{f:()=>s});const i=new Date,r=new Date;function s(t,n,e,a){function o(n){return t(n=arguments.length===0?new Date:new Date(+n)),n}o.floor=n=>(t(n=new Date(+n)),n);o.ceil=e=>(t(e=new Date(e-1)),n(e,1),t(e),e);o.round=t=>{const n=o(t),e=o.ceil(t);return t-n(n(t=new Date(+t),e==null?1:Math.floor(e)),t);o.range=(e,i,r)=>{const s=[];e=o.ceil(e);r=r==null?1:Math.floor(r);if(!(e0))return s;let a;do{s.push(a=new Date(+e)),n(e,r),t(e)}while(as((n=>{if(n>=n)while(t(n),!e(n))n.setTime(n-1)}),((t,i)=>{if(t>=t){if(i<0)while(++i<=0){while(n(t,-1),!e(t)){}}else while(--i>=0){while(n(t,+1),!e(t)){}}}}));if(e){o.count=(n,s)=>{i.setTime(+n),r.setTime(+s);t(i),t(r);return Math.floor(e(i,r))};o.every=t=>{t=Math.floor(t);return!isFinite(t)||!(t>0)?null:!(t>1)?o:o.filter(a?n=>a(n)%t===0:n=>o.count(0,n)%t===0)}}return o}},26530:(t,n,e)=>{e.d(n,{y:()=>r});var i=e(12834);const r=(0,i.f)((()=>{}),((t,n)=>{t.setTime(+t+n)}),((t,n)=>n-t));r.every=t=>{t=Math.floor(t);if(!isFinite(t)||!(t>0))return null;if(!(t>1))return r;return(0,i.f)((n=>{n.setTime(Math.floor(n/t)*t)}),((n,e)=>{n.setTime(+n+e*t)}),((n,e)=>(e-n)/t))};const s=r.range},23383:(t,n,e)=>{e.d(n,{vD:()=>o,wX:()=>s});var i=e(12834);var r=e(29551);const s=(0,i.f)((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*r.Tt)}),((t,n)=>{t.setTime(+t+n*r.rR)}),((t,n)=>(n-t)/r.rR),(t=>t.getMinutes()));const a=s.range;const o=(0,i.f)((t=>{t.setUTCSeconds(0,0)}),((t,n)=>{t.setTime(+t+n*r.rR)}),((t,n)=>(n-t)/r.rR),(t=>t.getUTCMinutes()));const u=o.range},77849:(t,n,e)=>{e.d(n,{R6:()=>a,Ui:()=>r});var i=e(12834);const r=(0,i.f)((t=>{t.setDate(1);t.setHours(0,0,0,0)}),((t,n)=>{t.setMonth(t.getMonth()+n)}),((t,n)=>n.getMonth()-t.getMonth()+(n.getFullYear()-t.getFullYear())*12),(t=>t.getMonth()));const s=r.range;const a=(0,i.f)((t=>{t.setUTCDate(1);t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCMonth(t.getUTCMonth()+n)}),((t,n)=>n.getUTCMonth()-t.getUTCMonth()+(n.getUTCFullYear()-t.getUTCFullYear())*12),(t=>t.getUTCMonth()));const o=a.range},61147:(t,n,e)=>{e.d(n,{R:()=>s});var i=e(12834);var r=e(29551);const s=(0,i.f)((t=>{t.setTime(t-t.getMilliseconds())}),((t,n)=>{t.setTime(+t+n*r.Tt)}),((t,n)=>(n-t)/r.Tt),(t=>t.getUTCSeconds()));const a=s.range},20421:(t,n,e)=>{e.d(n,{$Z:()=>y,Cf:()=>d,lk:()=>g,yE:()=>v});var i=e(9791);var r=e(97119);var s=e(29551);var a=e(26530);var o=e(61147);var u=e(23383);var h=e(9017);var c=e(20293);var l=e(61779);var f=e(77849);var _=e(42706);function p(t,n,e,u,h,c){const l=[[o.R,1,s.Tt],[o.R,5,5*s.Tt],[o.R,15,15*s.Tt],[o.R,30,30*s.Tt],[c,1,s.rR],[c,5,5*s.rR],[c,15,15*s.rR],[c,30,30*s.rR],[h,1,s.JJ],[h,3,3*s.JJ],[h,6,6*s.JJ],[h,12,12*s.JJ],[u,1,s.Nm],[u,2,2*s.Nm],[e,1,s.Fq],[n,1,s.Pv],[n,3,3*s.Pv],[t,1,s.MP]];function f(t,n,e){const i=nt)).right(l,u);if(h===l.length)return t.every((0,r.sG)(n/s.MP,e/s.MP,o));if(h===0)return a.y.every(Math.max((0,r.sG)(n,e,o),1));const[c,f]=l[u/l[h-1][2]{e.d(n,{AB:()=>o,Gu:()=>h,Hl:()=>m,Mo:()=>c,PG:()=>u,TU:()=>l,YP:()=>a,pT:()=>T,rG:()=>f,rt:()=>b});var i=e(12834);var r=e(29551);function s(t){return(0,i.f)((n=>{n.setDate(n.getDate()-(n.getDay()+7-t)%7);n.setHours(0,0,0,0)}),((t,n)=>{t.setDate(t.getDate()+n*7)}),((t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*r.rR)/r.Fq))}const a=s(0);const o=s(1);const u=s(2);const h=s(3);const c=s(4);const l=s(5);const f=s(6);const _=a.range;const p=o.range;const y=u.range;const g=h.range;const d=c.range;const v=l.range;const x=f.range;function w(t){return(0,i.f)((n=>{n.setUTCDate(n.getUTCDate()-(n.getUTCDay()+7-t)%7);n.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)}),((t,n)=>(n-t)/r.Fq))}const m=w(0);const b=w(1);const A=w(2);const M=w(3);const T=w(4);const k=w(5);const N=w(6);const C=m.range;const $=b.range;const U=A.range;const F=M.range;const D=T.range;const S=k.range;const P=N.range},42706:(t,n,e)=>{e.d(n,{Mb:()=>a,he:()=>r});var i=e(12834);const r=(0,i.f)((t=>{t.setMonth(0,1);t.setHours(0,0,0,0)}),((t,n)=>{t.setFullYear(t.getFullYear()+n)}),((t,n)=>n.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));r.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:(0,i.f)((n=>{n.setFullYear(Math.floor(n.getFullYear()/t)*t);n.setMonth(0,1);n.setHours(0,0,0,0)}),((n,e)=>{n.setFullYear(n.getFullYear()+e*t)}));const s=r.range;const a=(0,i.f)((t=>{t.setUTCMonth(0,1);t.setUTCHours(0,0,0,0)}),((t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n)}),((t,n)=>n.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));a.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:(0,i.f)((n=>{n.setUTCFullYear(Math.floor(n.getUTCFullYear()/t)*t);n.setUTCMonth(0,1);n.setUTCHours(0,0,0,0)}),((n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e*t)}));const o=a.range},14036:(t,n,e)=>{e.d(n,{M4:()=>g,O1:()=>d,tB:()=>p});var i=0,r=0,s=0,a=1e3,o,u,h=0,c=0,l=0,f=typeof performance==="object"&&performance.now?performance:Date,_=typeof window==="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function p(){return c||(_(y),c=f.now()+l)}function y(){c=0}function g(){this._call=this._time=this._next=null}g.prototype=d.prototype={constructor:g,restart:function(t,n,e){if(typeof t!=="function")throw new TypeError("callback is not a function");e=(e==null?p():+e)+(n==null?0:+n);if(!this._next&&u!==this){if(u)u._next=this;else o=this;u=this}this._call=t;this._time=e;b()},stop:function(){if(this._call){this._call=null;this._time=Infinity;b()}}};function d(t,n,e){var i=new g;i.restart(t,n,e);return i}function v(){p();++i;var t=o,n;while(t){if((n=c-t._time)>=0)t._call.call(undefined,n);t=t._next}--i}function x(){c=(h=f.now())+l;i=r=0;try{v()}finally{i=0;m();c=0}}function w(){var t=f.now(),n=t-h;if(n>a)l-=n,h=t}function m(){var t,n=o,e,i=Infinity;while(n){if(n._call){if(i>n._time)i=n._time;t=n,n=n._next}else{e=n._next,n._next=null;n=t?t._next=e:o=e}}u=t;b(i)}function b(t){if(i)return;if(r)r=clearTimeout(r);var n=t-c;if(n>24){if(t{e.d(n,{B:()=>i,v:()=>r});class i extends Map{constructor(t,n=u){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}});if(t!=null)for(const[e,i]of t)this.set(e,i)}get(t){return super.get(s(this,t))}has(t){return super.has(s(this,t))}set(t,n){return super.set(a(this,t),n)}delete(t){return super.delete(o(this,t))}}class r extends Set{constructor(t,n=u){super();Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}});if(t!=null)for(const e of t)this.add(e)}has(t){return super.has(s(this,t))}add(t){return super.add(a(this,t))}delete(t){return super.delete(o(this,t))}}function s({_intern:t,_key:n},e){const i=n(e);return t.has(i)?t.get(i):e}function a({_intern:t,_key:n},e){const i=n(e);if(t.has(i))return t.get(i);t.set(i,e);return e}function o({_intern:t,_key:n},e){const i=n(e);if(t.has(i)){e=t.get(e);t.delete(i)}return e}function u(t){return t!==null&&typeof t==="object"?t.valueOf():t}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/867.e814bf26fbfc77fc4f16.js b/.venv/share/jupyter/lab/static/867.e814bf26fbfc77fc4f16.js new file mode 100644 index 0000000000000000000000000000000000000000..88011cf41fb5585676330e644dfaec0889681e1b --- /dev/null +++ b/.venv/share/jupyter/lab/static/867.e814bf26fbfc77fc4f16.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[867],{90867:(e,t,r)=>{r.r(t);r.d(t,{erlang:()=>H});var n=["-type","-spec","-export_type","-opaque"];var i=["after","begin","catch","case","cond","end","fun","if","let","of","query","receive","try","when"];var a=/[\->,;]/;var o=["->",";",","];var u=["and","andalso","band","bnot","bor","bsl","bsr","bxor","div","not","or","orelse","rem","xor"];var s=/[\+\-\*\/<>=\|:!]/;var c=["=","+","-","*","/",">",">=","<","=<","=:=","==","=/=","/=","||","<-","!"];var l=/[<\(\[\{]/;var f=["<<","(","[","{"];var _=/[>\)\]\}]/;var p=["}","]",")",">>"];var m=["is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_record","is_reference","is_tuple","atom","binary","bitstring","boolean","function","integer","list","number","pid","port","record","reference","tuple"];var b=["abs","adler32","adler32_combine","alive","apply","atom_to_binary","atom_to_list","binary_to_atom","binary_to_existing_atom","binary_to_list","binary_to_term","bit_size","bitstring_to_list","byte_size","check_process_code","contact_binary","crc32","crc32_combine","date","decode_packet","delete_module","disconnect_node","element","erase","exit","float","float_to_list","garbage_collect","get","get_keys","group_leader","halt","hd","integer_to_list","internal_bif","iolist_size","iolist_to_binary","is_alive","is_atom","is_binary","is_bitstring","is_boolean","is_float","is_function","is_integer","is_list","is_number","is_pid","is_port","is_process_alive","is_record","is_reference","is_tuple","length","link","list_to_atom","list_to_binary","list_to_bitstring","list_to_existing_atom","list_to_float","list_to_integer","list_to_pid","list_to_tuple","load_module","make_ref","module_loaded","monitor_node","node","node_link","node_unlink","nodes","notalive","now","open_port","pid_to_list","port_close","port_command","port_connect","port_control","pre_loaded","process_flag","process_info","processes","purge_module","put","register","registered","round","self","setelement","size","spawn","spawn_link","spawn_monitor","spawn_opt","split_binary","statistics","term_to_binary","time","throw","tl","trunc","tuple_size","tuple_to_list","unlink","unregister","whereis"];var d=/[\w@Ø-ÞÀ-Öß-öø-ÿ]/;var k=/[0-7]{1,3}|[bdefnrstv\\"']|\^[a-zA-Z]|x[0-9a-zA-Z]{2}|x{[0-9a-zA-Z]+}/;function g(e,t){if(t.in_string){t.in_string=!y(e);return W(t,e,"string")}if(t.in_atom){t.in_atom=!w(e);return W(t,e,"atom")}if(e.eatSpace()){return W(t,e,"whitespace")}if(!Z(t)&&e.match(/-\s*[a-zß-öø-ÿ][\wØ-ÞÀ-Öß-öø-ÿ]*/)){if(z(e.current(),n)){return W(t,e,"type")}else{return W(t,e,"attribute")}}var r=e.next();if(r=="%"){e.skipToEnd();return W(t,e,"comment")}if(r==":"){return W(t,e,"colon")}if(r=="?"){e.eatSpace();e.eatWhile(d);return W(t,e,"macro")}if(r=="#"){e.eatSpace();e.eatWhile(d);return W(t,e,"record")}if(r=="$"){if(e.next()=="\\"&&!e.match(k)){return W(t,e,"error")}return W(t,e,"number")}if(r=="."){return W(t,e,"dot")}if(r=="'"){if(!(t.in_atom=!w(e))){if(e.match(/\s*\/\s*[0-9]/,false)){e.match(/\s*\/\s*[0-9]/,true);return W(t,e,"fun")}if(e.match(/\s*\(/,false)||e.match(/\s*:/,false)){return W(t,e,"function")}}return W(t,e,"atom")}if(r=='"'){t.in_string=!y(e);return W(t,e,"string")}if(/[A-Z_Ø-ÞÀ-Ö]/.test(r)){e.eatWhile(d);return W(t,e,"variable")}if(/[a-z_ß-öø-ÿ]/.test(r)){e.eatWhile(d);if(e.match(/\s*\/\s*[0-9]/,false)){e.match(/\s*\/\s*[0-9]/,true);return W(t,e,"fun")}var g=e.current();if(z(g,i)){return W(t,e,"keyword")}else if(z(g,u)){return W(t,e,"operator")}else if(e.match(/\s*\(/,false)){if(z(g,b)&&(Z(t).token!=":"||Z(t,2).token=="erlang")){return W(t,e,"builtin")}else if(z(g,m)){return W(t,e,"guard")}else{return W(t,e,"function")}}else if(S(e)==":"){if(g=="erlang"){return W(t,e,"builtin")}else{return W(t,e,"function")}}else if(z(g,["true","false"])){return W(t,e,"boolean")}else{return W(t,e,"atom")}}var x=/[0-9]/;var U=/[0-9a-zA-Z]/;if(x.test(r)){e.eatWhile(x);if(e.eat("#")){if(!e.eatWhile(U)){e.backUp(1)}}else if(e.eat(".")){if(!e.eatWhile(x)){e.backUp(1)}else{if(e.eat(/[eE]/)){if(e.eat(/[-+]/)){if(!e.eatWhile(x)){e.backUp(2)}}else{if(!e.eatWhile(x)){e.backUp(1)}}}}}return W(t,e,"number")}if(h(e,l,f)){return W(t,e,"open_paren")}if(h(e,_,p)){return W(t,e,"close_paren")}if(v(e,a,o)){return W(t,e,"separator")}if(v(e,s,c)){return W(t,e,"operator")}return W(t,e,null)}function h(e,t,r){if(e.current().length==1&&t.test(e.current())){e.backUp(1);while(t.test(e.peek())){e.next();if(z(e.current(),r)){return true}}e.backUp(e.current().length-1)}return false}function v(e,t,r){if(e.current().length==1&&t.test(e.current())){while(t.test(e.peek())){e.next()}while(01&&e[t].type==="fun"&&e[t-1].token==="fun"){return e.slice(0,t-1)}switch(e[t].token){case"}":return T(e,{g:["{"]});case"]":return T(e,{i:["["]});case")":return T(e,{i:["("]});case">>":return T(e,{i:["<<"]});case"end":return T(e,{i:["begin","case","fun","if","receive","try"]});case",":return T(e,{e:["begin","try","when","->",",","(","[","{","<<"]});case"->":return T(e,{r:["when"],m:["try","if","case","receive"]});case";":return T(e,{E:["case","fun","if","receive","try","when"]});case"catch":return T(e,{e:["try"]});case"of":return T(e,{e:["case"]});case"after":return T(e,{e:["receive","try"]});default:return e}}function T(e,t){for(var r in t){var n=e.length-1;var i=t[r];for(var a=n-1;-1"){if(z(o.token,["receive","case","if","try"])){return o.column+r.unit+r.unit}else{return o.column+r.unit}}else if(z(a.token,f)){return a.column+a.token.length}else{n=$(e);return G(n)?n.column+r.unit:0}}function N(e){var t=e.match(/,|[a-z]+|\}|\]|\)|>>|\|+|\(/);return G(t)&&t.index===0?t[0]:""}function O(e){var t=e.tokenStack.slice(0,-1);var r=F(t,"type",["open_paren"]);return G(t[r])?t[r]:false}function $(e){var t=e.tokenStack;var r=F(t,"type",["open_paren","separator","keyword"]);var n=F(t,"type",["operator"]);if(G(r)&&G(n)&&r{e.d(a,{diagram:()=>_});var s=e(41359);var t=e(15051);var l=e(94065);var p=e(33416);var v=e(94746);var i=e(20778);var n=e(57590);var u=e(68232);var c=e(76261);var o=e(96049);var b=e(75905);var _={parser:s._$,get db(){return new s.NM},renderer:s.Lh,styles:s.tM,init:(0,b.K2)((r=>{if(!r.class){r.class={}}r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute}),"init")}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8753.56da17175b663d61f9d3.js b/.venv/share/jupyter/lab/static/8753.56da17175b663d61f9d3.js new file mode 100644 index 0000000000000000000000000000000000000000..c9f7e6aab86003349203d719939393827bc5b8a9 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8753.56da17175b663d61f9d3.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8753],{58753:(e,t,n)=>{n.r(t);n.d(t,{sparql:()=>x});var r;function a(e){return new RegExp("^(?:"+e.join("|")+")$","i")}var i=a(["str","lang","langmatches","datatype","bound","sameterm","isiri","isuri","iri","uri","bnode","count","sum","min","max","avg","sample","group_concat","rand","abs","ceil","floor","round","concat","substr","strlen","replace","ucase","lcase","encode_for_uri","contains","strstarts","strends","strbefore","strafter","year","month","day","hours","minutes","seconds","timezone","tz","now","uuid","struuid","md5","sha1","sha256","sha384","sha512","coalesce","if","strlang","strdt","isnumeric","regex","exists","isblank","isliteral","a","bind"]);var u=a(["base","prefix","select","distinct","reduced","construct","describe","ask","from","named","where","order","limit","offset","filter","optional","graph","by","asc","desc","as","having","undef","values","group","minus","in","not","service","silent","using","insert","delete","union","true","false","with","data","copy","to","move","add","create","drop","clear","load","into"]);var o=/[*+\-<>=&|\^\/!\?]/;var s="[A-Za-z_\\-0-9]";var l=new RegExp("[A-Za-z]");var c=new RegExp("(("+s+"|\\.)*("+s+"))?:");function f(e,t){var n=e.next();r=null;if(n=="$"||n=="?"){if(n=="?"&&e.match(/\s/,false)){return"operator"}e.match(/^[A-Za-z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][A-Za-z0-9_\u00B7\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]*/);return"variableName.local"}else if(n=="<"&&!e.match(/^[\s\u00a0=]/,false)){e.match(/^[^\s\u00a0>]*>?/);return"atom"}else if(n=='"'||n=="'"){t.tokenize=d(n);return t.tokenize(e,t)}else if(/[{}\(\),\.;\[\]]/.test(n)){r=n;return"bracket"}else if(n=="#"){e.skipToEnd();return"comment"}else if(o.test(n)){return"operator"}else if(n==":"){p(e);return"atom"}else if(n=="@"){e.eatWhile(/[a-z\d\-]/i);return"meta"}else if(l.test(n)&&e.match(c)){p(e);return"atom"}e.eatWhile(/[_\w\d]/);var a=e.current();if(i.test(a))return"builtin";else if(u.test(a))return"keyword";else return"variable"}function p(e){e.match(/(\.(?=[\w_\-\\%])|[:\w_-]|\\[-\\_~.!$&'()*+,;=/?#@%]|%[a-f\d][a-f\d])+/i)}function d(e){return function(t,n){var r=false,a;while((a=t.next())!=null){if(a==e&&!r){n.tokenize=f;break}r=!r&&a=="\\"}return"string"}}function m(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function F(e){e.indent=e.context.indent;e.context=e.context.prev}const x={name:"sparql",startState:function(){return{tokenize:f,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()){if(t.context&&t.context.align==null)t.context.align=false;t.indent=e.indentation()}if(e.eatSpace())return null;var n=t.tokenize(e,t);if(n!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"){t.context.align=true}if(r=="(")m(t,")",e.column());else if(r=="[")m(t,"]",e.column());else if(r=="{")m(t,"}",e.column());else if(/[\]\}\)]/.test(r)){while(t.context&&t.context.type=="pattern")F(t);if(t.context&&r==t.context.type){F(t);if(r=="}"&&t.context&&t.context.type=="pattern")F(t)}}else if(r=="."&&t.context&&t.context.type=="pattern")F(t);else if(/atom|string|variable/.test(n)&&t.context){if(/[\}\]]/.test(t.context.type))m(t,"pattern",e.column());else if(t.context.type=="pattern"&&!t.context.align){t.context.align=true;t.context.col=e.column()}}return n},indent:function(e,t,n){var r=t&&t.charAt(0);var a=e.context;if(/[\]\}]/.test(r))while(a&&a.type=="pattern")a=a.prev;var i=a&&r==a.type;if(!a)return 0;else if(a.type=="pattern")return a.col;else if(a.align)return a.col+(i?0:1);else return a.indent+(i?0:n.unit)},languageData:{commentTokens:{line:"#"}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8778.a3883f9acac5a903d6be.js b/.venv/share/jupyter/lab/static/8778.a3883f9acac5a903d6be.js new file mode 100644 index 0000000000000000000000000000000000000000..dd72c5614fcc0030fdad3bf1014c9a29d07f2e9e --- /dev/null +++ b/.venv/share/jupyter/lab/static/8778.a3883f9acac5a903d6be.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8778,5606],{65606:e=>{var t=e.exports={};var r;var n;function s(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){r=setTimeout}else{r=s}}catch(e){r=s}try{if(typeof clearTimeout==="function"){n=clearTimeout}else{n=o}}catch(e){n=o}})();function a(e){if(r===setTimeout){return setTimeout(e,0)}if((r===s||!r)&&setTimeout){r=setTimeout;return setTimeout(e,0)}try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}function i(e){if(n===clearTimeout){return clearTimeout(e)}if((n===o||!n)&&clearTimeout){n=clearTimeout;return clearTimeout(e)}try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}var l=[];var c=false;var u;var p=-1;function f(){if(!c||!u){return}c=false;if(u.length){l=u.concat(l)}else{p=-1}if(l.length){h()}}function h(){if(c){return}var e=a(f);c=true;var t=l.length;while(t){u=l;l=[];while(++p1){for(var r=1;r{!function(t,n){true?e.exports=n(r(44914)):0}(r.g,(function(e){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,r),s.l=!0,s.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)r.d(n,s,function(t){return e[t]}.bind(null,s));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=4)}([function(e,t,r){e.exports=r(2)()},function(t,r){t.exports=e},function(e,t,r){"use strict";var n=r(3);function s(){}function o(){}o.resetWarningCache=s,e.exports=function(){function e(e,t,r,s,o,a){if(a!==n){var i=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw i.name="Invariant Violation",i}}function t(){return e}e.isRequired=e;var r={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:s};return r.PropTypes=r,r}},function(e,t,r){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,r,n){"use strict";n.r(r);var s=n(1),o=n.n(s),a=n(0),i=n.n(a);function l(){return(l=Object.assign||function(e){for(var t=1;t0&&t.handlePageSelected(r-1,e)})),N(R(t),"handleNextPage",(function(e){var r=t.state.selected,n=t.props.pageCount;e.preventDefault?e.preventDefault():e.returnValue=!1,rs-n/2?d=n-(g=s-u):us-a||f>=u-d&&f<=u+g?e.push(v(f)):i&&e[e.length-1]!==m&&(m=o.a.createElement(h,{key:f,breakLabel:i,breakClassName:l,breakLinkClassName:c,breakHandler:t.handleBreakClick.bind(null,f),getEventListener:t.getEventListener}),e.push(m))}return e})),r=e.initialPage?e.initialPage:e.forcePage?e.forcePage:0,t.state={selected:r},t}return t=a,(r=[{key:"componentDidMount",value:function(){var e=this.props,t=e.initialPage,r=e.disableInitialCallback,n=e.extraAriaContext;void 0===t||r||this.callCallback(t),n&&console.warn("DEPRECATED (react-paginate): The extraAriaContext prop is deprecated. You should now use the ariaLabelBuilder instead.")}},{key:"componentDidUpdate",value:function(e){void 0!==this.props.forcePage&&this.props.forcePage!==e.forcePage&&this.setState({selected:this.props.forcePage})}},{key:"getForwardJump",value:function(){var e=this.state.selected,t=this.props,r=t.pageCount,n=e+t.pageRangeDisplayed;return n>=r?r-1:n}},{key:"getBackwardJump",value:function(){var e=this.state.selected-this.props.pageRangeDisplayed;return e<0?0:e}},{key:"hrefBuilder",value:function(e){var t=this.props,r=t.hrefBuilder,n=t.pageCount;if(r&&e!==this.state.selected&&e>=0&&e=0&&e{const n=Symbol("SemVer ANY");class s{static get ANY(){return n}constructor(e,t){t=o(t);if(e instanceof s){if(e.loose===!!t.loose){return e}else{e=e.value}}e=e.trim().split(/\s+/).join(" ");c("comparator",e,t);this.options=t;this.loose=!!t.loose;this.parse(e);if(this.semver===n){this.value=""}else{this.value=this.operator+this.semver.version}c("comp",this)}parse(e){const t=this.options.loose?a[i.COMPARATORLOOSE]:a[i.COMPARATOR];const r=e.match(t);if(!r){throw new TypeError(`Invalid comparator: ${e}`)}this.operator=r[1]!==undefined?r[1]:"";if(this.operator==="="){this.operator=""}if(!r[2]){this.semver=n}else{this.semver=new u(r[2],this.options.loose)}}toString(){return this.value}test(e){c("Comparator.test",e,this.options.loose);if(this.semver===n||e===n){return true}if(typeof e==="string"){try{e=new u(e,this.options)}catch(t){return false}}return l(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof s)){throw new TypeError("a Comparator is required")}if(this.operator===""){if(this.value===""){return true}return new p(e.value,t).test(this.value)}else if(e.operator===""){if(e.value===""){return true}return new p(this.value,t).test(e.semver)}t=o(t);if(t.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")){return false}if(!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))){return false}if(this.operator.startsWith(">")&&e.operator.startsWith(">")){return true}if(this.operator.startsWith("<")&&e.operator.startsWith("<")){return true}if(this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")){return true}if(l(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")){return true}if(l(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">")){return true}return false}}e.exports=s;const o=r(98587);const{safeRe:a,t:i}=r(99718);const l=r(72111);const c=r(57272);const u=r(31527);const p=r(78311)},78311:(e,t,r)=>{const n=/\s+/g;class s{constructor(e,t){t=i(t);if(e instanceof s){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{return new s(e.raw,t)}}if(e instanceof l){this.raw=e.value;this.set=[[e]];this.formatted=undefined;return this}this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;this.raw=e.trim().replace(n," ");this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length));if(!this.set.length){throw new TypeError(`Invalid SemVer Range: ${this.raw}`)}if(this.set.length>1){const e=this.set[0];this.set=this.set.filter((e=>!v(e[0])));if(this.set.length===0){this.set=[e]}else if(this.set.length>1){for(const e of this.set){if(e.length===1&&L(e[0])){this.set=[e];break}}}}this.formatted=undefined}get range(){if(this.formatted===undefined){this.formatted="";for(let e=0;e0){this.formatted+="||"}const t=this.set[e];for(let e=0;e0){this.formatted+=" "}this.formatted+=t[e].toString().trim()}}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){const t=(this.options.includePrerelease&&d)|(this.options.loose&&g);const r=t+":"+e;const n=a.get(r);if(n){return n}const s=this.options.loose;const o=s?p[f.HYPHENRANGELOOSE]:p[f.HYPHENRANGE];e=e.replace(o,A(this.options.includePrerelease));c("hyphen replace",e);e=e.replace(p[f.COMPARATORTRIM],h);c("comparator trim",e);e=e.replace(p[f.TILDETRIM],E);c("tilde trim",e);e=e.replace(p[f.CARETTRIM],m);c("caret trim",e);let i=e.split(" ").map((e=>$(e,this.options))).join(" ").split(/\s+/).map((e=>C(e,this.options)));if(s){i=i.filter((e=>{c("loose invalid filter",e,this.options);return!!e.match(p[f.COMPARATORLOOSE])}))}c("range list",i);const u=new Map;const L=i.map((e=>new l(e,this.options)));for(const a of L){if(v(a)){return[a]}u.set(a.value,a)}if(u.size>1&&u.has("")){u.delete("")}const R=[...u.values()];a.set(r,R);return R}intersects(e,t){if(!(e instanceof s)){throw new TypeError("a Range is required")}return this.set.some((r=>R(r,t)&&e.set.some((e=>R(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e){return false}if(typeof e==="string"){try{e=new u(e,this.options)}catch(t){return false}}for(let r=0;re.value==="<0.0.0-0";const L=e=>e.value==="";const R=(e,t)=>{let r=true;const n=e.slice();let s=n.pop();while(r&&n.length){r=n.every((e=>s.intersects(e,t)));s=n.pop()}return r};const $=(e,t)=>{c("comp",e,t);e=O(e,t);c("caret",e);e=I(e,t);c("tildes",e);e=T(e,t);c("xrange",e);e=w(e,t);c("stars",e);return e};const N=e=>!e||e.toLowerCase()==="x"||e==="*";const I=(e,t)=>e.trim().split(/\s+/).map((e=>b(e,t))).join(" ");const b=(e,t)=>{const r=t.loose?p[f.TILDELOOSE]:p[f.TILDE];return e.replace(r,((t,r,n,s,o)=>{c("tilde",e,t,r,n,s,o);let a;if(N(r)){a=""}else if(N(n)){a=`>=${r}.0.0 <${+r+1}.0.0-0`}else if(N(s)){a=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`}else if(o){c("replaceTilde pr",o);a=`>=${r}.${n}.${s}-${o} <${r}.${+n+1}.0-0`}else{a=`>=${r}.${n}.${s} <${r}.${+n+1}.0-0`}c("tilde return",a);return a}))};const O=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" ");const y=(e,t)=>{c("caret",e,t);const r=t.loose?p[f.CARETLOOSE]:p[f.CARET];const n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,s,o,a)=>{c("caret",e,t,r,s,o,a);let i;if(N(r)){i=""}else if(N(s)){i=`>=${r}.0.0${n} <${+r+1}.0.0-0`}else if(N(o)){if(r==="0"){i=`>=${r}.${s}.0${n} <${r}.${+s+1}.0-0`}else{i=`>=${r}.${s}.0${n} <${+r+1}.0.0-0`}}else if(a){c("replaceCaret pr",a);if(r==="0"){if(s==="0"){i=`>=${r}.${s}.${o}-${a} <${r}.${s}.${+o+1}-0`}else{i=`>=${r}.${s}.${o}-${a} <${r}.${+s+1}.0-0`}}else{i=`>=${r}.${s}.${o}-${a} <${+r+1}.0.0-0`}}else{c("no pr");if(r==="0"){if(s==="0"){i=`>=${r}.${s}.${o}${n} <${r}.${s}.${+o+1}-0`}else{i=`>=${r}.${s}.${o}${n} <${r}.${+s+1}.0-0`}}else{i=`>=${r}.${s}.${o} <${+r+1}.0.0-0`}}c("caret return",i);return i}))};const T=(e,t)=>{c("replaceXRanges",e,t);return e.split(/\s+/).map((e=>P(e,t))).join(" ")};const P=(e,t)=>{e=e.trim();const r=t.loose?p[f.XRANGELOOSE]:p[f.XRANGE];return e.replace(r,((r,n,s,o,a,i)=>{c("xRange",e,r,n,s,o,a,i);const l=N(s);const u=l||N(o);const p=u||N(a);const f=p;if(n==="="&&f){n=""}i=t.includePrerelease?"-0":"";if(l){if(n===">"||n==="<"){r="<0.0.0-0"}else{r="*"}}else if(n&&f){if(u){o=0}a=0;if(n===">"){n=">=";if(u){s=+s+1;o=0;a=0}else{o=+o+1;a=0}}else if(n==="<="){n="<";if(u){s=+s+1}else{o=+o+1}}if(n==="<"){i="-0"}r=`${n+s}.${o}.${a}${i}`}else if(u){r=`>=${s}.0.0${i} <${+s+1}.0.0-0`}else if(p){r=`>=${s}.${o}.0${i} <${s}.${+o+1}.0-0`}c("xRange return",r);return r}))};const w=(e,t)=>{c("replaceStars",e,t);return e.trim().replace(p[f.STAR],"")};const C=(e,t)=>{c("replaceGTE0",e,t);return e.trim().replace(p[t.includePrerelease?f.GTE0PRE:f.GTE0],"")};const A=e=>(t,r,n,s,o,a,i,l,c,u,p,f)=>{if(N(n)){r=""}else if(N(s)){r=`>=${n}.0.0${e?"-0":""}`}else if(N(o)){r=`>=${n}.${s}.0${e?"-0":""}`}else if(a){r=`>=${r}`}else{r=`>=${r}${e?"-0":""}`}if(N(c)){l=""}else if(N(u)){l=`<${+c+1}.0.0-0`}else if(N(p)){l=`<${c}.${+u+1}.0-0`}else if(f){l=`<=${c}.${u}.${p}-${f}`}else if(e){l=`<${c}.${u}.${+p+1}-0`}else{l=`<=${l}`}return`${r} ${l}`.trim()};const S=(e,t,r)=>{for(let n=0;n0){const n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch){return true}}}return false}return true}},31527:(e,t,r)=>{const n=r(57272);const{MAX_LENGTH:s,MAX_SAFE_INTEGER:o}=r(16874);const{safeRe:a,t:i}=r(99718);const l=r(98587);const{compareIdentifiers:c}=r(61123);class u{constructor(e,t){t=l(t);if(e instanceof u){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease){return e}else{e=e.version}}else if(typeof e!=="string"){throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`)}if(e.length>s){throw new TypeError(`version is longer than ${s} characters`)}n("SemVer",e,t);this.options=t;this.loose=!!t.loose;this.includePrerelease=!!t.includePrerelease;const r=e.trim().match(t.loose?a[i.LOOSE]:a[i.FULL]);if(!r){throw new TypeError(`Invalid Version: ${e}`)}this.raw=e;this.major=+r[1];this.minor=+r[2];this.patch=+r[3];if(this.major>o||this.major<0){throw new TypeError("Invalid major version")}if(this.minor>o||this.minor<0){throw new TypeError("Invalid minor version")}if(this.patch>o||this.patch<0){throw new TypeError("Invalid patch version")}if(!r[4]){this.prerelease=[]}else{this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0){if(typeof this.prerelease[n]==="number"){this.prerelease[n]++;n=-2}}if(n===-1){if(t===this.prerelease.join(".")&&r===false){throw new Error("invalid increment argument: identifier already exists")}this.prerelease.push(e)}}if(t){let n=[t,e];if(r===false){n=[t]}if(c(this.prerelease[0],t)===0){if(isNaN(this.prerelease[1])){this.prerelease=n}}else{this.prerelease=n}}break}default:throw new Error(`invalid increment argument: ${e}`)}this.raw=this.format();if(this.build.length){this.raw+=`+${this.build.join(".")}`}return this}}e.exports=u},57414:(e,t,r)=>{const n=r(30144);const s=(e,t)=>{const r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};e.exports=s},72111:(e,t,r)=>{const n=r(94641);const s=r(13999);const o=r(35580);const a=r(54089);const i=r(7059);const l=r(25200);const c=(e,t,r,c)=>{switch(t){case"===":if(typeof e==="object"){e=e.version}if(typeof r==="object"){r=r.version}return e===r;case"!==":if(typeof e==="object"){e=e.version}if(typeof r==="object"){r=r.version}return e!==r;case"":case"=":case"==":return n(e,r,c);case"!=":return s(e,r,c);case">":return o(e,r,c);case">=":return a(e,r,c);case"<":return i(e,r,c);case"<=":return l(e,r,c);default:throw new TypeError(`Invalid operator: ${t}`)}};e.exports=c},46170:(e,t,r)=>{const n=r(31527);const s=r(30144);const{safeRe:o,t:a}=r(99718);const i=(e,t)=>{if(e instanceof n){return e}if(typeof e==="number"){e=String(e)}if(typeof e!=="string"){return null}t=t||{};let r=null;if(!t.rtl){r=e.match(t.includePrerelease?o[a.COERCEFULL]:o[a.COERCE])}else{const n=t.includePrerelease?o[a.COERCERTLFULL]:o[a.COERCERTL];let s;while((s=n.exec(e))&&(!r||r.index+r[0].length!==e.length)){if(!r||s.index+s[0].length!==r.index+r[0].length){r=s}n.lastIndex=s.index+s[1].length+s[2].length}n.lastIndex=-1}if(r===null){return null}const i=r[2];const l=r[3]||"0";const c=r[4]||"0";const u=t.includePrerelease&&r[5]?`-${r[5]}`:"";const p=t.includePrerelease&&r[6]?`+${r[6]}`:"";return s(`${i}.${l}.${c}${u}${p}`,t)};e.exports=i},40909:(e,t,r)=>{const n=r(31527);const s=(e,t,r)=>{const s=new n(e,r);const o=new n(t,r);return s.compare(o)||s.compareBuild(o)};e.exports=s},11763:(e,t,r)=>{const n=r(50560);const s=(e,t)=>n(e,t,true);e.exports=s},50560:(e,t,r)=>{const n=r(31527);const s=(e,t,r)=>new n(e,r).compare(new n(t,r));e.exports=s},51832:(e,t,r)=>{const n=r(30144);const s=(e,t)=>{const r=n(e,null,true);const s=n(t,null,true);const o=r.compare(s);if(o===0){return null}const a=o>0;const i=a?r:s;const l=a?s:r;const c=!!i.prerelease.length;const u=!!l.prerelease.length;if(u&&!c){if(!l.patch&&!l.minor){return"major"}if(i.patch){return"patch"}if(i.minor){return"minor"}return"major"}const p=c?"pre":"";if(r.major!==s.major){return p+"major"}if(r.minor!==s.minor){return p+"minor"}if(r.patch!==s.patch){return p+"patch"}return"prerelease"};e.exports=s},94641:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(e,t,r)===0;e.exports=s},35580:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(e,t,r)>0;e.exports=s},54089:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(e,t,r)>=0;e.exports=s},93007:(e,t,r)=>{const n=r(31527);const s=(e,t,r,s,o)=>{if(typeof r==="string"){o=s;s=r;r=undefined}try{return new n(e instanceof n?e.version:e,r).inc(t,s,o).version}catch(a){return null}};e.exports=s},7059:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(e,t,r)<0;e.exports=s},25200:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(e,t,r)<=0;e.exports=s},32938:(e,t,r)=>{const n=r(31527);const s=(e,t)=>new n(e,t).major;e.exports=s},46254:(e,t,r)=>{const n=r(31527);const s=(e,t)=>new n(e,t).minor;e.exports=s},13999:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(e,t,r)!==0;e.exports=s},30144:(e,t,r)=>{const n=r(31527);const s=(e,t,r=false)=>{if(e instanceof n){return e}try{return new n(e,t)}catch(s){if(!r){return null}throw s}};e.exports=s},24493:(e,t,r)=>{const n=r(31527);const s=(e,t)=>new n(e,t).patch;e.exports=s},31729:(e,t,r)=>{const n=r(30144);const s=(e,t)=>{const r=n(e,t);return r&&r.prerelease.length?r.prerelease:null};e.exports=s},9970:(e,t,r)=>{const n=r(50560);const s=(e,t,r)=>n(t,e,r);e.exports=s},74277:(e,t,r)=>{const n=r(40909);const s=(e,t)=>e.sort(((e,r)=>n(r,e,t)));e.exports=s},97638:(e,t,r)=>{const n=r(78311);const s=(e,t,r)=>{try{t=new n(t,r)}catch(s){return false}return t.test(e)};e.exports=s},43927:(e,t,r)=>{const n=r(40909);const s=(e,t)=>e.sort(((e,r)=>n(e,r,t)));e.exports=s},56953:(e,t,r)=>{const n=r(30144);const s=(e,t)=>{const r=n(e,t);return r?r.version:null};e.exports=s},99589:(e,t,r)=>{const n=r(99718);const s=r(16874);const o=r(31527);const a=r(61123);const i=r(30144);const l=r(56953);const c=r(57414);const u=r(93007);const p=r(51832);const f=r(32938);const h=r(46254);const E=r(24493);const m=r(31729);const d=r(50560);const g=r(9970);const v=r(11763);const L=r(40909);const R=r(43927);const $=r(74277);const N=r(35580);const I=r(7059);const b=r(94641);const O=r(13999);const y=r(54089);const T=r(25200);const P=r(72111);const w=r(46170);const C=r(93904);const A=r(78311);const S=r(97638);const x=r(77631);const k=r(19628);const j=r(270);const D=r(41261);const _=r(13874);const G=r(97075);const M=r(75571);const F=r(5342);const U=r(76780);const X=r(72525);const B=r(75032);e.exports={parse:i,valid:l,clean:c,inc:u,diff:p,major:f,minor:h,patch:E,prerelease:m,compare:d,rcompare:g,compareLoose:v,compareBuild:L,sort:R,rsort:$,gt:N,lt:I,eq:b,neq:O,gte:y,lte:T,cmp:P,coerce:w,Comparator:C,Range:A,satisfies:S,toComparators:x,maxSatisfying:k,minSatisfying:j,minVersion:D,validRange:_,outside:G,gtr:M,ltr:F,intersects:U,simplifyRange:X,subset:B,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:s.SEMVER_SPEC_VERSION,RELEASE_TYPES:s.RELEASE_TYPES,compareIdentifiers:a.compareIdentifiers,rcompareIdentifiers:a.rcompareIdentifiers}},16874:e=>{const t="2.0.0";const r=256;const n=Number.MAX_SAFE_INTEGER||9007199254740991;const s=16;const o=r-6;const a=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:s,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:a,SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},57272:(e,t,r)=>{var n=r(65606);const s=typeof n==="object"&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=s},61123:e=>{const t=/^[0-9]+$/;const r=(e,r)=>{const n=t.test(e);const s=t.test(r);if(n&&s){e=+e;r=+r}return e===r?0:n&&!s?-1:s&&!n?1:er(t,e);e.exports={compareIdentifiers:r,rcompareIdentifiers:n}},68794:e=>{class t{constructor(){this.max=1e3;this.map=new Map}get(e){const t=this.map.get(e);if(t===undefined){return undefined}else{this.map.delete(e);this.map.set(e,t);return t}}delete(e){return this.map.delete(e)}set(e,t){const r=this.delete(e);if(!r&&t!==undefined){if(this.map.size>=this.max){const e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}e.exports=t},98587:e=>{const t=Object.freeze({loose:true});const r=Object.freeze({});const n=e=>{if(!e){return r}if(typeof e!=="object"){return t}return e};e.exports=n},99718:(e,t,r)=>{const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:s,MAX_LENGTH:o}=r(16874);const a=r(57272);t=e.exports={};const i=t.re=[];const l=t.safeRe=[];const c=t.src=[];const u=t.t={};let p=0;const f="[a-zA-Z0-9-]";const h=[["\\s",1],["\\d",o],[f,s]];const E=e=>{for(const[t,r]of h){e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`)}return e};const m=(e,t,r)=>{const n=E(t);const s=p++;a(e,s,t);u[e]=s;c[s]=t;i[s]=new RegExp(t,r?"g":undefined);l[s]=new RegExp(n,r?"g":undefined)};m("NUMERICIDENTIFIER","0|[1-9]\\d*");m("NUMERICIDENTIFIERLOOSE","\\d+");m("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${f}*`);m("MAINVERSION",`(${c[u.NUMERICIDENTIFIER]})\\.`+`(${c[u.NUMERICIDENTIFIER]})\\.`+`(${c[u.NUMERICIDENTIFIER]})`);m("MAINVERSIONLOOSE",`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.`+`(${c[u.NUMERICIDENTIFIERLOOSE]})\\.`+`(${c[u.NUMERICIDENTIFIERLOOSE]})`);m("PRERELEASEIDENTIFIER",`(?:${c[u.NUMERICIDENTIFIER]}|${c[u.NONNUMERICIDENTIFIER]})`);m("PRERELEASEIDENTIFIERLOOSE",`(?:${c[u.NUMERICIDENTIFIERLOOSE]}|${c[u.NONNUMERICIDENTIFIER]})`);m("PRERELEASE",`(?:-(${c[u.PRERELEASEIDENTIFIER]}(?:\\.${c[u.PRERELEASEIDENTIFIER]})*))`);m("PRERELEASELOOSE",`(?:-?(${c[u.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${c[u.PRERELEASEIDENTIFIERLOOSE]})*))`);m("BUILDIDENTIFIER",`${f}+`);m("BUILD",`(?:\\+(${c[u.BUILDIDENTIFIER]}(?:\\.${c[u.BUILDIDENTIFIER]})*))`);m("FULLPLAIN",`v?${c[u.MAINVERSION]}${c[u.PRERELEASE]}?${c[u.BUILD]}?`);m("FULL",`^${c[u.FULLPLAIN]}$`);m("LOOSEPLAIN",`[v=\\s]*${c[u.MAINVERSIONLOOSE]}${c[u.PRERELEASELOOSE]}?${c[u.BUILD]}?`);m("LOOSE",`^${c[u.LOOSEPLAIN]}$`);m("GTLT","((?:<|>)?=?)");m("XRANGEIDENTIFIERLOOSE",`${c[u.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);m("XRANGEIDENTIFIER",`${c[u.NUMERICIDENTIFIER]}|x|X|\\*`);m("XRANGEPLAIN",`[v=\\s]*(${c[u.XRANGEIDENTIFIER]})`+`(?:\\.(${c[u.XRANGEIDENTIFIER]})`+`(?:\\.(${c[u.XRANGEIDENTIFIER]})`+`(?:${c[u.PRERELEASE]})?${c[u.BUILD]}?`+`)?)?`);m("XRANGEPLAINLOOSE",`[v=\\s]*(${c[u.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})`+`(?:\\.(${c[u.XRANGEIDENTIFIERLOOSE]})`+`(?:${c[u.PRERELEASELOOSE]})?${c[u.BUILD]}?`+`)?)?`);m("XRANGE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAIN]}$`);m("XRANGELOOSE",`^${c[u.GTLT]}\\s*${c[u.XRANGEPLAINLOOSE]}$`);m("COERCEPLAIN",`${"(^|[^\\d])"+"(\\d{1,"}${n}})`+`(?:\\.(\\d{1,${n}}))?`+`(?:\\.(\\d{1,${n}}))?`);m("COERCE",`${c[u.COERCEPLAIN]}(?:$|[^\\d])`);m("COERCEFULL",c[u.COERCEPLAIN]+`(?:${c[u.PRERELEASE]})?`+`(?:${c[u.BUILD]})?`+`(?:$|[^\\d])`);m("COERCERTL",c[u.COERCE],true);m("COERCERTLFULL",c[u.COERCEFULL],true);m("LONETILDE","(?:~>?)");m("TILDETRIM",`(\\s*)${c[u.LONETILDE]}\\s+`,true);t.tildeTrimReplace="$1~";m("TILDE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAIN]}$`);m("TILDELOOSE",`^${c[u.LONETILDE]}${c[u.XRANGEPLAINLOOSE]}$`);m("LONECARET","(?:\\^)");m("CARETTRIM",`(\\s*)${c[u.LONECARET]}\\s+`,true);t.caretTrimReplace="$1^";m("CARET",`^${c[u.LONECARET]}${c[u.XRANGEPLAIN]}$`);m("CARETLOOSE",`^${c[u.LONECARET]}${c[u.XRANGEPLAINLOOSE]}$`);m("COMPARATORLOOSE",`^${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]})$|^$`);m("COMPARATOR",`^${c[u.GTLT]}\\s*(${c[u.FULLPLAIN]})$|^$`);m("COMPARATORTRIM",`(\\s*)${c[u.GTLT]}\\s*(${c[u.LOOSEPLAIN]}|${c[u.XRANGEPLAIN]})`,true);t.comparatorTrimReplace="$1$2$3";m("HYPHENRANGE",`^\\s*(${c[u.XRANGEPLAIN]})`+`\\s+-\\s+`+`(${c[u.XRANGEPLAIN]})`+`\\s*$`);m("HYPHENRANGELOOSE",`^\\s*(${c[u.XRANGEPLAINLOOSE]})`+`\\s+-\\s+`+`(${c[u.XRANGEPLAINLOOSE]})`+`\\s*$`);m("STAR","(<|>)?=?\\s*\\*");m("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");m("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},75571:(e,t,r)=>{const n=r(97075);const s=(e,t,r)=>n(e,t,">",r);e.exports=s},76780:(e,t,r)=>{const n=r(78311);const s=(e,t,r)=>{e=new n(e,r);t=new n(t,r);return e.intersects(t,r)};e.exports=s},5342:(e,t,r)=>{const n=r(97075);const s=(e,t,r)=>n(e,t,"<",r);e.exports=s},19628:(e,t,r)=>{const n=r(31527);const s=r(78311);const o=(e,t,r)=>{let o=null;let a=null;let i=null;try{i=new s(t,r)}catch(l){return null}e.forEach((e=>{if(i.test(e)){if(!o||a.compare(e)===-1){o=e;a=new n(o,r)}}}));return o};e.exports=o},270:(e,t,r)=>{const n=r(31527);const s=r(78311);const o=(e,t,r)=>{let o=null;let a=null;let i=null;try{i=new s(t,r)}catch(l){return null}e.forEach((e=>{if(i.test(e)){if(!o||a.compare(e)===1){o=e;a=new n(o,r)}}}));return o};e.exports=o},41261:(e,t,r)=>{const n=r(31527);const s=r(78311);const o=r(35580);const a=(e,t)=>{e=new s(e,t);let r=new n("0.0.0");if(e.test(r)){return r}r=new n("0.0.0-0");if(e.test(r)){return r}r=null;for(let s=0;s{const t=new n(e.semver.version);switch(e.operator){case">":if(t.prerelease.length===0){t.patch++}else{t.prerelease.push(0)}t.raw=t.format();case"":case">=":if(!a||o(t,a)){a=t}break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}}));if(a&&(!r||o(r,a))){r=a}}if(r&&e.test(r)){return r}return null};e.exports=a},97075:(e,t,r)=>{const n=r(31527);const s=r(93904);const{ANY:o}=s;const a=r(78311);const i=r(97638);const l=r(35580);const c=r(7059);const u=r(25200);const p=r(54089);const f=(e,t,r,f)=>{e=new n(e,f);t=new a(t,f);let h,E,m,d,g;switch(r){case">":h=l;E=u;m=c;d=">";g=">=";break;case"<":h=c;E=p;m=l;d="<";g="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(i(e,t,f)){return false}for(let n=0;n{if(e.semver===o){e=new s(">=0.0.0")}a=a||e;i=i||e;if(h(e.semver,a.semver,f)){a=e}else if(m(e.semver,i.semver,f)){i=e}}));if(a.operator===d||a.operator===g){return false}if((!i.operator||i.operator===d)&&E(e,i.semver)){return false}else if(i.operator===g&&m(e,i.semver)){return false}}return true};e.exports=f},72525:(e,t,r)=>{const n=r(97638);const s=r(50560);e.exports=(e,t,r)=>{const o=[];let a=null;let i=null;const l=e.sort(((e,t)=>s(e,t,r)));for(const s of l){const e=n(s,t,r);if(e){i=s;if(!a){a=s}}else{if(i){o.push([a,i])}i=null;a=null}}if(a){o.push([a,null])}const c=[];for(const[n,s]of o){if(n===s){c.push(n)}else if(!s&&n===l[0]){c.push("*")}else if(!s){c.push(`>=${n}`)}else if(n===l[0]){c.push(`<=${s}`)}else{c.push(`${n} - ${s}`)}}const u=c.join(" || ");const p=typeof t.raw==="string"?t.raw:String(t);return u.length{const n=r(78311);const s=r(93904);const{ANY:o}=s;const a=r(97638);const i=r(50560);const l=(e,t,r={})=>{if(e===t){return true}e=new n(e,r);t=new n(t,r);let s=false;e:for(const n of e.set){for(const e of t.set){const t=p(n,e,r);s=s||t!==null;if(t){continue e}}if(s){return false}}return true};const c=[new s(">=0.0.0-0")];const u=[new s(">=0.0.0")];const p=(e,t,r)=>{if(e===t){return true}if(e.length===1&&e[0].semver===o){if(t.length===1&&t[0].semver===o){return true}else if(r.includePrerelease){e=c}else{e=u}}if(t.length===1&&t[0].semver===o){if(r.includePrerelease){return true}else{t=u}}const n=new Set;let s,l;for(const o of e){if(o.operator===">"||o.operator===">="){s=f(s,o,r)}else if(o.operator==="<"||o.operator==="<="){l=h(l,o,r)}else{n.add(o.semver)}}if(n.size>1){return null}let p;if(s&&l){p=i(s.semver,l.semver,r);if(p>0){return null}else if(p===0&&(s.operator!==">="||l.operator!=="<=")){return null}}for(const o of n){if(s&&!a(o,String(s),r)){return null}if(l&&!a(o,String(l),r)){return null}for(const e of t){if(!a(o,String(e),r)){return false}}return true}let E,m;let d,g;let v=l&&!r.includePrerelease&&l.semver.prerelease.length?l.semver:false;let L=s&&!r.includePrerelease&&s.semver.prerelease.length?s.semver:false;if(v&&v.prerelease.length===1&&l.operator==="<"&&v.prerelease[0]===0){v=false}for(const o of t){g=g||o.operator===">"||o.operator===">=";d=d||o.operator==="<"||o.operator==="<=";if(s){if(L){if(o.semver.prerelease&&o.semver.prerelease.length&&o.semver.major===L.major&&o.semver.minor===L.minor&&o.semver.patch===L.patch){L=false}}if(o.operator===">"||o.operator===">="){E=f(s,o,r);if(E===o&&E!==s){return false}}else if(s.operator===">="&&!a(s.semver,String(o),r)){return false}}if(l){if(v){if(o.semver.prerelease&&o.semver.prerelease.length&&o.semver.major===v.major&&o.semver.minor===v.minor&&o.semver.patch===v.patch){v=false}}if(o.operator==="<"||o.operator==="<="){m=h(l,o,r);if(m===o&&m!==l){return false}}else if(l.operator==="<="&&!a(l.semver,String(o),r)){return false}}if(!o.operator&&(l||s)&&p!==0){return false}}if(s&&d&&!l&&p!==0){return false}if(l&&g&&!s&&p!==0){return false}if(L||v){return false}return true};const f=(e,t,r)=>{if(!e){return t}const n=i(e.semver,t.semver,r);return n>0?e:n<0?t:t.operator===">"&&e.operator===">="?t:e};const h=(e,t,r)=>{if(!e){return t}const n=i(e.semver,t.semver,r);return n<0?e:n>0?t:t.operator==="<"&&e.operator==="<="?t:e};e.exports=l},77631:(e,t,r)=>{const n=r(78311);const s=(e,t)=>new n(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));e.exports=s},13874:(e,t,r)=>{const n=r(78311);const s=(e,t)=>{try{return new n(e,t).range||"*"}catch(r){return null}};e.exports=s}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8779.6eebdb56785e3d38a457.js b/.venv/share/jupyter/lab/static/8779.6eebdb56785e3d38a457.js new file mode 100644 index 0000000000000000000000000000000000000000..62ac72404fc0a15087ee3b69abeb69fd97a57382 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8779.6eebdb56785e3d38a457.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8779],{88779:(O,Q,P)=>{P.r(Q);P.d(Q,{java:()=>t,javaLanguage:()=>X});var $=P(27421);var a=P(45145);const i=(0,a.styleTags)({null:a.tags.null,instanceof:a.tags.operatorKeyword,this:a.tags.self,"new super assert open to with void":a.tags.keyword,"class interface extends implements enum var":a.tags.definitionKeyword,"module package import":a.tags.moduleKeyword,"switch while for if else case default do break continue return try catch finally throw":a.tags.controlKeyword,["requires exports opens uses provides public private protected static transitive abstract final "+"strictfp synchronized native transient volatile throws"]:a.tags.modifier,IntegerLiteral:a.tags.integer,FloatingPointLiteral:a.tags.float,"StringLiteral TextBlock":a.tags.string,CharacterLiteral:a.tags.character,LineComment:a.tags.lineComment,BlockComment:a.tags.blockComment,BooleanLiteral:a.tags.bool,PrimitiveType:a.tags.standard(a.tags.typeName),TypeName:a.tags.typeName,Identifier:a.tags.variableName,"MethodName/Identifier":a.tags.function(a.tags.variableName),Definition:a.tags.definition(a.tags.variableName),ArithOp:a.tags.arithmeticOperator,LogicOp:a.tags.logicOperator,BitOp:a.tags.bitwiseOperator,CompareOp:a.tags.compareOperator,AssignOp:a.tags.definitionOperator,UpdateOp:a.tags.updateOperator,Asterisk:a.tags.punctuation,Label:a.tags.labelName,"( )":a.tags.paren,"[ ]":a.tags.squareBracket,"{ }":a.tags.brace,".":a.tags.derefOperator,", ;":a.tags.separator});const r={__proto__:null,true:34,false:34,null:42,void:46,byte:48,short:48,int:48,long:48,char:48,float:48,double:48,boolean:48,extends:62,super:64,class:76,this:78,new:84,public:100,protected:102,private:104,abstract:106,static:108,final:110,strictfp:112,default:114,synchronized:116,native:118,transient:120,volatile:122,throws:150,implements:160,interface:166,enum:176,instanceof:236,open:265,module:267,requires:272,transitive:274,exports:276,to:278,opens:280,uses:282,provides:284,with:286,package:290,import:294,if:306,else:308,while:312,for:316,var:323,assert:330,switch:334,case:340,do:344,break:348,continue:352,return:356,throw:362,try:366,catch:370,finally:378};const e=$.U1.deserialize({version:14,states:"#!hQ]QPOOO&tQQO'#H[O(xQQO'#CbOOQO'#Cb'#CbO)PQPO'#CaO)XOSO'#CpOOQO'#Ha'#HaOOQO'#Cu'#CuO*tQPO'#D_O+_QQO'#HkOOQO'#Hk'#HkO-sQQO'#HfO-zQQO'#HfOOQO'#Hf'#HfOOQO'#He'#HeO0OQPO'#DUO0]QPO'#GlO3TQPO'#D_O3[QPO'#DzO)PQPO'#E[O3}QPO'#E[OOQO'#DV'#DVO5]QQO'#H_O7dQQO'#EeO7kQPO'#EdO7pQPO'#EfOOQO'#H`'#H`O5sQQO'#H`O8sQQO'#FgO8zQPO'#EwO9PQPO'#E|O9PQPO'#FOOOQO'#H_'#H_OOQO'#HW'#HWOOQO'#Gf'#GfOOQO'#HV'#HVO:aQPO'#FhOOQO'#HU'#HUOOQO'#Ge'#GeQ]QPOOOOQO'#Hq'#HqO:fQPO'#HqO:kQPO'#D{O:kQPO'#EVO:kQPO'#EQO:sQPO'#HnO;UQQO'#EfO)PQPO'#C`O;^QPO'#C`O)PQPO'#FbO;cQPO'#FdO;nQPO'#FjO;nQPO'#FmO:kQPO'#FrO;sQPO'#FoO9PQPO'#FvO;nQPO'#FxO]QPO'#F}O;xQPO'#GPOyOSO,59[OOQO,59[,59[OOQO'#Hg'#HgO?jQPO,59eO@lQPO,59yOOQO-E:d-E:dO)PQPO,58zOA`QPO,58zO)PQPO,5;|OAeQPO'#DQOAjQPO'#DQOOQO'#Gi'#GiOBjQQO,59jOOQO'#Dm'#DmODRQPO'#HsOD]QPO'#DlODkQPO'#HrODsQPO,5<^ODxQPO,59^OEcQPO'#CxOOQO,59c,59cOEjQPO,59bOGrQQO'#H[OJVQQO'#CbOJmQPO'#D_OKrQQO'#HkOLSQQO,59pOLZQPO'#DvOLiQPO'#HzOLqQPO,5:`OLvQPO,5:`OM^QPO,5;mOMiQPO'#IROMtQPO,5;dOMyQPO,5=WOOQO-E:j-E:jOOQO,5:f,5:fO! aQPO,5:fO! hQPO,5:vO! mQPO,5<^O)PQPO,5:vO:kQPO,5:gO:kQPO,5:qO:kQPO,5:lO:kQPO,5<^O!!^QPO,59qO9PQPO,5:}O!!eQPO,5;QO9PQPO,59TO!!sQPO'#DXOOQO,5;O,5;OOOQO'#El'#ElOOQO'#En'#EnO9PQPO,5;UO9PQPO,5;UO9PQPO,5;UO9PQPO,5;UO9PQPO,5;UO9PQPO,5;UO9PQPO,5;eOOQO,5;h,5;hOOQO,5],5>]O!%SQPO,5:gO!%bQPO,5:qO!%jQPO,5:lO!%uQPO,5>YOLZQPO,5>YO! {QPO,59UO!&QQQO,58zO!&YQQO,5;|O!&bQQO,5_O!.ZQPO,5:WO:kQPO'#GnO!.bQPO,5>^OOQO1G1x1G1xOOQO1G.x1G.xO!.{QPO'#CyO!/kQPO'#HkO!/uQPO'#CzO!0TQPO'#HjO!0]QPO,59dOOQO1G.|1G.|OEjQPO1G.|O!0sQPO,59eO!1QQQO'#H[O!1cQQO'#CbOOQO,5:b,5:bO:kQPO,5:cOOQO,5:a,5:aO!1tQQO,5:aOOQO1G/[1G/[O!1yQPO,5:bO!2[QPO'#GqO!2oQPO,5>fOOQO1G/z1G/zO!2wQPO'#DvO!3YQPO'#D_O!3aQPO1G/zO!!zQPO'#GoO!3fQPO1G1XO9PQPO1G1XO:kQPO'#GwO!3nQPO,5>mOOQO1G1O1G1OOOQO1G0Q1G0QO!3vQPO'#E]OOQO1G0b1G0bO!4gQPO1G1xO! hQPO1G0bO!%SQPO1G0RO!%bQPO1G0]O!%jQPO1G0WOOQO1G/]1G/]O!4lQQO1G.pO7kQPO1G0jO)PQPO1G0jO:sQPO'#HnO!6`QQO1G.pOOQO1G.p1G.pO!6eQQO1G0iOOQO1G0l1G0lO!6lQPO1G0lO!6wQQO1G.oO!7_QQO'#HoO!7lQPO,59sO!8{QQO1G0pO!:dQQO1G0pO!;rQQO1G0pO!UOOQO1G/O1G/OOOQO7+$h7+$hOOQO1G/{1G/{O#1TQQO1G/{OOQO1G/}1G/}O#1YQPO1G/{OOQO1G/|1G/|O:kQPO1G/}OOQO,5=],5=]OOQO-E:o-E:oOOQO7+%f7+%fOOQO,5=Z,5=ZOOQO-E:m-E:mO9PQPO7+&sOOQO7+&s7+&sOOQO,5=c,5=cOOQO-E:u-E:uO#1_QPO'#EUO#1mQPO'#EUOOQO'#Gu'#GuO#2UQPO,5:wOOQO,5:w,5:wOOQO7+'d7+'dOOQO7+%|7+%|OOQO7+%m7+%mO!AYQPO7+%mO!A_QPO7+%mO!AgQPO7+%mOOQO7+%w7+%wO!BVQPO7+%wOOQO7+%r7+%rO!CUQPO7+%rO!CZQPO7+%rOOQO7+&U7+&UOOQO'#Ee'#EeO7kQPO7+&UO7kQPO,5>YO#2uQPO7+$[OOQO7+&T7+&TOOQO7+&W7+&WO9PQPO'#GjO#3TQPO,5>ZOOQO1G/_1G/_O9PQPO7+&kO#3`QQO,59eO#4cQPO'#DrO! pQPO'#DrO#4nQPO'#HwO#4vQPO,5:]O#5aQQO'#HgO#5|QQO'#CuO! mQPO'#HvO#6lQPO'#DpO#6vQPO'#HvO#7XQPO'#DpO#7aQPO'#IPO#7fQPO'#E`OOQO'#Hp'#HpOOQO'#Gk'#GkO#7nQPO,59vOOQO,59v,59vO#7uQPO'#HqOOQO,5:h,5:hO#9]QPO'#H|OOQO'#EP'#EPOOQO,5:i,5:iO#9hQPO'#EYO:kQPO'#EYO#9yQPO'#H}O#:UQPO,5:sO! mQPO'#HvO!!zQPO'#HvO#:^QPO'#DpOOQO'#Gs'#GsO#:eQPO,5:oOOQO,5:o,5:oOOQO,5:n,5:nOOQO,5;S,5;SO#;_QQO,5;SO#;fQPO,5;SOOQO-E:t-E:tOOQO7+&X7+&XOOQO7+)`7+)`O#;mQQO7+)`OOQO'#Gz'#GzO#=ZQPO,5;rOOQO,5;r,5;rO#=bQPO'#FXO)PQPO'#FXO)PQPO'#FXO)PQPO'#FXO#=pQPO7+'UO#=uQPO7+'UOOQO7+'U7+'UO]QPO7+'[O#>QQPO1G1{O! mQPO1G1{O#>`QQO1G1wO!!sQPO1G1wO#>gQPO1G1wO#>nQQO7+'hOOQO'#G}'#G}O#>uQPO,5|QPO'#HqO9PQPO'#F{O#?UQPO7+'oO#?ZQPO,5=OO! mQPO,5=OO#?`QPO1G2iO#@iQPO1G2iOOQO1G2i1G2iOOQO-E:|-E:|OOQO7+'z7+'zO!2[QPO'#G^OpOOQO1G.n1G.nOOQO<X,5>XOOQO,5=S,5=SOOQO-E:f-E:fO#EjQPO7+%gOOQO7+%g7+%gOOQO7+%i7+%iOOQO<cOOQO1G/w1G/wO#IfQPO'#HsO#ImQPO,59xO#IrQPO,5>bO! mQPO,59xO#I}QPO,5:[O#7fQPO,5:zO! mQPO,5>bO!!zQPO,5>bO#7aQPO,5>kOOQO,5:[,5:[OLvQPO'#DtOOQO,5>k,5>kO#JVQPO'#EaOOQO,5:z,5:zO#MWQPO,5:zO!!zQPO'#DxOOQO-E:i-E:iOOQO1G/b1G/bOOQO,5:y,5:yO!!zQPO'#GrO#M]QPO,5>hOOQO,5:t,5:tO#MhQPO,5:tO#MvQPO,5:tO#NXQPO'#GtO#NoQPO,5>iO#NzQPO'#EZOOQO1G0_1G0_O$ RQPO1G0_O! mQPO,5:pOOQO-E:q-E:qOOQO1G0Z1G0ZOOQO1G0n1G0nO$ WQQO1G0nOOQO<oOOQO1G1Y1G1YO$%uQPO'#FTOOQO,5=e,5=eOOQO-E:w-E:wO$%zQPO'#GmO$&XQPO,5>aOOQO1G/u1G/uOOQO<sAN>sO!AYQPOAN>sOOQOAN>xAN>xOOQOAN?[AN?[O7kQPOAN?[O$&pQPO,5:_OOQO1G/x1G/xOOQO,5=[,5=[OOQO-E:n-E:nO$&{QPO,5>eOOQO1G/d1G/dOOQO1G3|1G3|O$'^QPO1G/dOOQO1G/v1G/vOOQO1G0f1G0fO#MWQPO1G0fO#7aQPO'#HyO$'cQPO1G3|O! mQPO1G3|OOQO1G4V1G4VOK^QPO'#DvOJmQPO'#D_OOQO,5:{,5:{O$'nQPO,5:{O$'nQPO,5:{O$'uQQO'#H_O$'|QQO'#H`O$(WQQO'#EbO$(cQPO'#EbOOQO,5:d,5:dOOQO,5=^,5=^OOQO-E:p-E:pOOQO1G0`1G0`O$(kQPO1G0`OOQO,5=`,5=`OOQO-E:r-E:rO$(yQPO,5:uOOQO7+%y7+%yOOQO7+&Y7+&YOOQO1G1_1G1_O$)QQQO1G1_OOQO-E:y-E:yO$)YQQO'#IWO$)TQPO1G1_O$ mQPO1G1_O)PQPO1G1_OOQOAN@[AN@[O$)eQQO<rO$,cQPO7+&yO$,hQQO'#IXOOQOAN@mAN@mO$,sQQOAN@mOOQOAN@iAN@iO$,zQPOAN@iO$-PQQO<sOOQOG26XG26XOOQOG26TG26TOOQO<bPPP>hP@|PPPAv2vPCoPPDjPEaEgPPPPPPPPPPPPFpGXPJ_JgJqKZKaKgMVMZMZMcPMrNx! k! uP!![NxP!!b!!l!!{!#TP!#r!#|!$SNx!$V!$]EaEa!$a!$k!$n2v!&Y2v2v!(RP.^P!(VP!(vPPPPPP.^P.^!)d.^PP.^P.^PP.^!*x!+SPP!+Y!+cPPPPPPPP&}P&}PP!+g!+g!+z!+gPP!+gP!+gP!,e!,hP!+g!-O!+gP!+gP!-R!-UP!+gP!+gP!+gP!+gP!+g!+gP!+gP!-YP!-`!-c!-iP!+g!-u!-x!.Q!.d!2a!2g!2m!3s!3y!4T!5X!5_!5e!5o!5u!5{!6R!6X!6_!6e!6k!6q!6w!6}!7T!7Z!7e!7k!7u!7{PPP!8R!+g!8vP!a!]!^!?q!^!_!@_!_!`!Ax!`!a!Bl!a!b!DY!b!c!Dx!c!}!Kt!}#O!MQ#O#P%Q#P#Q!Mn#Q#R!N[#R#S4e#S#T%Q#T#o4e#o#p# O#p#q# l#q#r##U#r#s##r#s#y%Q#y#z'f#z$f%Q$f$g'f$g#BY%Q#BY#BZ'f#BZ$IS%Q$IS$I_'f$I_$I|%Q$I|$JO'f$JO$JT%Q$JT$JU'f$JU$KV%Q$KV$KW'f$KW&FU%Q&FU&FV'f&FV;'S%Q;'S;=`&s<%lO%QS%VV&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS%qO&WSS%tVOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZS&^VOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QS&vP;=`<%l%QS&|UOY&ZYZ%lZr&Zs;'S&Z;'S;=`'`<%lO&ZS'cP;=`<%l&Z_'mk&WS%wZOX%QXY'fYZ)bZ^'f^p%Qpq'fqr%Qrs%qs#y%Q#y#z'f#z$f%Q$f$g'f$g#BY%Q#BY#BZ'f#BZ$IS%Q$IS$I_'f$I_$I|%Q$I|$JO'f$JO$JT%Q$JT$JU'f$JU$KV%Q$KV$KW'f$KW&FU%Q&FU&FV'f&FV;'S%Q;'S;=`&s<%lO%Q_)iY&WS%wZX^*Xpq*X#y#z*X$f$g*X#BY#BZ*X$IS$I_*X$I|$JO*X$JT$JU*X$KV$KW*X&FU&FV*XZ*^Y%wZX^*Xpq*X#y#z*X$f$g*X#BY#BZ*X$IS$I_*X$I|$JO*X$JT$JU*X$KV$KW*X&FU&FV*XV+TX#sP&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`+p!`;'S%Q;'S;=`&s<%lO%QU+wV#_Q&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT,aXOY,|YZ%lZr,|rs3Ys#O,|#O#P2d#P;'S,|;'S;=`3S<%lO,|T-PXOY-lYZ%lZr-lrs.^s#O-l#O#P.x#P;'S-l;'S;=`2|<%lO-lT-qX&WSOY-lYZ%lZr-lrs.^s#O-l#O#P.x#P;'S-l;'S;=`2|<%lO-lT.cVcPOY&ZYZ%lZr&Zrs&ys;'S&Z;'S;=`'`<%lO&ZT.}V&WSOY-lYZ/dZr-lrs1]s;'S-l;'S;=`2|<%lO-lT/iW&WSOY0RZr0Rrs0ns#O0R#O#P0s#P;'S0R;'S;=`1V<%lO0RP0UWOY0RZr0Rrs0ns#O0R#O#P0s#P;'S0R;'S;=`1V<%lO0RP0sOcPP0vTOY0RYZ0RZ;'S0R;'S;=`1V<%lO0RP1YP;=`<%l0RT1`XOY,|YZ%lZr,|rs1{s#O,|#O#P2d#P;'S,|;'S;=`3S<%lO,|T2QUcPOY&ZYZ%lZr&Zs;'S&Z;'S;=`'`<%lO&ZT2gVOY-lYZ/dZr-lrs1]s;'S-l;'S;=`2|<%lO-lT3PP;=`<%l-lT3VP;=`<%l,|T3_VcPOY&ZYZ%lZr&Zrs3ts;'S&Z;'S;=`'`<%lO&ZT3yR&USXY4SYZ4`pq4SP4VRXY4SYZ4`pq4SP4eO&VP_4la%}Z&WSOY%QYZ%lZr%Qrs%qst%Qtu4eu!Q%Q!Q![4e![!c%Q!c!}4e!}#R%Q#R#S4e#S#T%Q#T#o4e#o;'S%Q;'S;=`&s<%lO%QU5xX#gQ&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QU6lV#]Q&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV7YZ&lR&WSOY%QYZ%lZr%Qrs%qsv%Qvw7{w!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QU8SV#aQ&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT8nZ&WSOY9aYZ%lZr9ars:Xsw9awx%Qx#O9a#O#Pt<%lO9aT9fZ&WSOY9aYZ%lZr9ars:Xsw9awx;sx#O9a#O#Pt<%lO9aT:[ZOY:}YZ%lZr:}rs>zsw:}wx?px#O:}#O#P@[#P;'S:};'S;=`@t<%lO:}T;QZOY9aYZ%lZr9ars:Xsw9awx;sx#O9a#O#Pt<%lO9aT;zVbP&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QTt<%lO9aT=QW&WSOY=jZw=jwx>Vx#O=j#O#P>[#P;'S=j;'S;=`>n<%lO=jP=mWOY=jZw=jwx>Vx#O=j#O#P>[#P;'S=j;'S;=`>n<%lO=jP>[ObPP>_TOY=jYZ=jZ;'S=j;'S;=`>n<%lO=jP>qP;=`<%l=jT>wP;=`<%l9aT>}ZOY:}YZ%lZr:}rs=jsw:}wx?px#O:}#O#P@[#P;'S:};'S;=`@t<%lO:}T?uVbPOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT@_VOY9aYZ<{Zr9ars:Xs;'S9a;'S;=`>t<%lO9aT@wP;=`<%l:}_ARVZZ&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVAoVYR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVB_X$YP&WS#fQOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QVCRZ#eR&WSOY%QYZ%lZr%Qrs%qs{%Q{|Ct|!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QVC{V#qR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVDiVqR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QVEV[#eR&WSOY%QYZ%lZr%Qrs%qs}%Q}!OCt!O!_%Q!_!`6e!`!aE{!a;'S%Q;'S;=`&s<%lO%QVFSV&vR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_FpZWY&WSOY%QYZ%lZr%Qrs%qs!O%Q!O!PGc!P!Q%Q!Q![Hq![;'S%Q;'S;=`&s<%lO%QVGhX&WSOY%QYZ%lZr%Qrs%qs!O%Q!O!PHT!P;'S%Q;'S;=`&s<%lO%QVH[V&oR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QTHxc&WS`POY%QYZ%lZr%Qrs%qs!Q%Q!Q![Hq![!f%Q!f!gJT!g!hJq!h!iJT!i#R%Q#R#SNk#S#W%Q#W#XJT#X#YJq#Y#ZJT#Z;'S%Q;'S;=`&s<%lO%QTJ[V&WS`POY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QTJv]&WSOY%QYZ%lZr%Qrs%qs{%Q{|Ko|}%Q}!OKo!O!Q%Q!Q![La![;'S%Q;'S;=`&s<%lO%QTKtX&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![La![;'S%Q;'S;=`&s<%lO%QTLhc&WS`POY%QYZ%lZr%Qrs%qs!Q%Q!Q![La![!f%Q!f!gJT!g!h%Q!h!iJT!i#R%Q#R#SMs#S#W%Q#W#XJT#X#Y%Q#Y#ZJT#Z;'S%Q;'S;=`&s<%lO%QTMxZ&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![La![#R%Q#R#SMs#S;'S%Q;'S;=`&s<%lO%QTNpZ&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![Hq![#R%Q#R#SNk#S;'S%Q;'S;=`&s<%lO%Q_! j]&WS#fQOY%QYZ%lZr%Qrs%qsz%Qz{!!c{!P%Q!P!Q!)U!Q!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%Q_!!hX&WSOY!!cYZ!#TZr!!crs!$psz!!cz{!&O{;'S!!c;'S;=`!'d<%lO!!c_!#YT&WSOz!#iz{!#{{;'S!#i;'S;=`!$j<%lO!#iZ!#lTOz!#iz{!#{{;'S!#i;'S;=`!$j<%lO!#iZ!$OVOz!#iz{!#{{!P!#i!P!Q!$e!Q;'S!#i;'S;=`!$j<%lO!#iZ!$jOQZZ!$mP;=`<%l!#i_!$sXOY!%`YZ!#TZr!%`rs!'jsz!%`z{!(Y{;'S!%`;'S;=`!)O<%lO!%`_!%cXOY!!cYZ!#TZr!!crs!$psz!!cz{!&O{;'S!!c;'S;=`!'d<%lO!!c_!&TZ&WSOY!!cYZ!#TZr!!crs!$psz!!cz{!&O{!P!!c!P!Q!&v!Q;'S!!c;'S;=`!'d<%lO!!c_!&}V&WSQZOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!'gP;=`<%l!!c_!'mXOY!%`YZ!#TZr!%`rs!#isz!%`z{!(Y{;'S!%`;'S;=`!)O<%lO!%`_!(]ZOY!!cYZ!#TZr!!crs!$psz!!cz{!&O{!P!!c!P!Q!&v!Q;'S!!c;'S;=`!'d<%lO!!c_!)RP;=`<%l!%`_!)]V&WSPZOY!)UYZ%lZr!)Urs!)rs;'S!)U;'S;=`!*x<%lO!)U_!)wVPZOY!*^YZ%lZr!*^rs!+Os;'S!*^;'S;=`!,R<%lO!*^_!*cVPZOY!)UYZ%lZr!)Urs!)rs;'S!)U;'S;=`!*x<%lO!)U_!*{P;=`<%l!)U_!+TVPZOY!*^YZ%lZr!*^rs!+js;'S!*^;'S;=`!,R<%lO!*^Z!+oSPZOY!+jZ;'S!+j;'S;=`!+{<%lO!+jZ!,OP;=`<%l!+j_!,UP;=`<%l!*^T!,`u&WS_POY%QYZ%lZr%Qrs%qs!O%Q!O!P!.s!P!Q%Q!Q![!0P![!d%Q!d!e!3Z!e!f%Q!f!gJT!g!hJq!h!iJT!i!n%Q!n!o!1u!o!q%Q!q!r!5X!r!z%Q!z!{!7P!{#R%Q#R#S!2c#S#U%Q#U#V!3Z#V#W%Q#W#XJT#X#YJq#Y#ZJT#Z#`%Q#`#a!1u#a#c%Q#c#d!5X#d#l%Q#l#m!7P#m;'S%Q;'S;=`&s<%lO%QT!.za&WS`POY%QYZ%lZr%Qrs%qs!Q%Q!Q![Hq![!f%Q!f!gJT!g!hJq!h!iJT!i#W%Q#W#XJT#X#YJq#Y#ZJT#Z;'S%Q;'S;=`&s<%lO%QT!0Wi&WS_POY%QYZ%lZr%Qrs%qs!O%Q!O!P!.s!P!Q%Q!Q![!0P![!f%Q!f!gJT!g!hJq!h!iJT!i!n%Q!n!o!1u!o#R%Q#R#S!2c#S#W%Q#W#XJT#X#YJq#Y#ZJT#Z#`%Q#`#a!1u#a;'S%Q;'S;=`&s<%lO%QT!1|V&WS_POY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT!2hZ&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![!0P![#R%Q#R#S!2c#S;'S%Q;'S;=`&s<%lO%QT!3`Y&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q!R!4O!R!S!4O!S;'S%Q;'S;=`&s<%lO%QT!4V`&WS_POY%QYZ%lZr%Qrs%qs!Q%Q!Q!R!4O!R!S!4O!S!n%Q!n!o!1u!o#R%Q#R#S!3Z#S#`%Q#`#a!1u#a;'S%Q;'S;=`&s<%lO%QT!5^X&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q!Y!5y!Y;'S%Q;'S;=`&s<%lO%QT!6Q_&WS_POY%QYZ%lZr%Qrs%qs!Q%Q!Q!Y!5y!Y!n%Q!n!o!1u!o#R%Q#R#S!5X#S#`%Q#`#a!1u#a;'S%Q;'S;=`&s<%lO%QT!7U_&WSOY%QYZ%lZr%Qrs%qs!O%Q!O!P!8T!P!Q%Q!Q![!:c![!c%Q!c!i!:c!i#T%Q#T#Z!:c#Z;'S%Q;'S;=`&s<%lO%QT!8Y]&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![!9R![!c%Q!c!i!9R!i#T%Q#T#Z!9R#Z;'S%Q;'S;=`&s<%lO%QT!9Wc&WSOY%QYZ%lZr%Qrs%qs!Q%Q!Q![!9R![!c%Q!c!i!9R!i!r%Q!r!sJq!s#R%Q#R#S!8T#S#T%Q#T#Z!9R#Z#d%Q#d#eJq#e;'S%Q;'S;=`&s<%lO%QT!:ji&WS_POY%QYZ%lZr%Qrs%qs!O%Q!O!P!hX#oR&WSOY%QYZ%lZr%Qrs%qs![%Q![!]!?T!];'S%Q;'S;=`&s<%lO%QV!?[V&tR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV!?xV!PR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!@fY&]Z&WSOY%QYZ%lZr%Qrs%qs!^%Q!^!_!AU!_!`+p!`;'S%Q;'S;=`&s<%lO%QU!A]X#hQ&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QV!BPX!bR&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`+p!`;'S%Q;'S;=`&s<%lO%QV!BsY&[R&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`+p!`!a!Cc!a;'S%Q;'S;=`&s<%lO%QU!CjY#hQ&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`!a!AU!a;'S%Q;'S;=`&s<%lO%Q_!DcV&`X#nQ&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!EPX%{Z&WSOY%QYZ%lZr%Qrs%qs#]%Q#]#^!El#^;'S%Q;'S;=`&s<%lO%QV!EqX&WSOY%QYZ%lZr%Qrs%qs#b%Q#b#c!F^#c;'S%Q;'S;=`&s<%lO%QV!FcX&WSOY%QYZ%lZr%Qrs%qs#h%Q#h#i!GO#i;'S%Q;'S;=`&s<%lO%QV!GTX&WSOY%QYZ%lZr%Qrs%qs#X%Q#X#Y!Gp#Y;'S%Q;'S;=`&s<%lO%QV!GuX&WSOY%QYZ%lZr%Qrs%qs#f%Q#f#g!Hb#g;'S%Q;'S;=`&s<%lO%QV!HgX&WSOY%QYZ%lZr%Qrs%qs#Y%Q#Y#Z!IS#Z;'S%Q;'S;=`&s<%lO%QV!IXX&WSOY%QYZ%lZr%Qrs%qs#T%Q#T#U!It#U;'S%Q;'S;=`&s<%lO%QV!IyX&WSOY%QYZ%lZr%Qrs%qs#V%Q#V#W!Jf#W;'S%Q;'S;=`&s<%lO%QV!JkX&WSOY%QYZ%lZr%Qrs%qs#X%Q#X#Y!KW#Y;'S%Q;'S;=`&s<%lO%QV!K_V&rR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_!K{a&PZ&WSOY%QYZ%lZr%Qrs%qst%Qtu!Ktu!Q%Q!Q![!Kt![!c%Q!c!}!Kt!}#R%Q#R#S!Kt#S#T%Q#T#o!Kt#o;'S%Q;'S;=`&s<%lO%Q_!MXVuZ&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV!MuVsR&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QU!NcX#cQ&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`;'S%Q;'S;=`&s<%lO%QV# VV}R&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q_# uZ&|X#cQ&WSOY%QYZ%lZr%Qrs%qs!_%Q!_!`6e!`#p%Q#p#q#!h#q;'S%Q;'S;=`&s<%lO%QU#!oV#dQ&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QV##]V|R&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%QT##yV#tP&WSOY%QYZ%lZr%Qrs%qs;'S%Q;'S;=`&s<%lO%Q",tokenizers:[0,1,2,3],topRules:{Program:[0,3]},dynamicPrecedences:{27:1,230:-1,241:-1},specialized:[{term:229,get:O=>r[O]||-1}],tokenPrec:7067});var s=P(4452);const X=s.LRLanguage.define({name:"java",parser:e.configure({props:[s.indentNodeProp.add({IfStatement:(0,s.continuedIndent)({except:/^\s*({|else\b)/}),TryStatement:(0,s.continuedIndent)({except:/^\s*({|catch|finally)\b/}),LabeledStatement:s.flatIndent,SwitchBlock:O=>{let Q=O.textAfter,P=/^\s*\}/.test(Q),$=/^\s*(case|default)\b/.test(Q);return O.baseIndent+(P?0:$?1:2)*O.unit},Block:(0,s.delimitedIndent)({closing:"}"}),BlockComment:()=>null,Statement:(0,s.continuedIndent)({except:/^{/})}),s.foldNodeProp.add({["Block SwitchBlock ClassBody ElementValueArrayInitializer ModuleBody EnumBody "+"ConstructorBody InterfaceBody ArrayInitializer"]:s.foldInside,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/}});function t(){return new s.LanguageSupport(X)}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8786.a2bc3dfc1ea13c04ba94.js b/.venv/share/jupyter/lab/static/8786.a2bc3dfc1ea13c04ba94.js new file mode 100644 index 0000000000000000000000000000000000000000..995e133cef63f18646e412492a5e674bc71a6275 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8786.a2bc3dfc1ea13c04ba94.js @@ -0,0 +1,2 @@ +/*! For license information please see 8786.a2bc3dfc1ea13c04ba94.js.LICENSE.txt */ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8786],{76405:(e,t,r)=>{r.d(t,{A:()=>Up});function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=Array(t);r=e.length?{done:true}:{done:false,value:e[a++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,o=true,s=false;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=true,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw i}}}}function v(e,t,r){return(t=m(t))in e?Object.defineProperty(e,t,{value:r,enumerable:true,configurable:true,writable:true}):e[t]=r,e}function f(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function c(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,i,o,s=[],l=true,u=false;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(a=i.call(r)).done)&&(s.push(a.value),s.length!==t);l=!0);}catch(e){u=true,n=e}finally{try{if(!l&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw n}}return s}}function d(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function h(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function p(e,t){return n(e)||c(e,t)||x(e,t)||d()}function g(e){return i(e)||f(e)||x(e)||h()}function y(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(undefined!==r){var a=r.call(e,t);if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function m(e){var t=y(e,"string");return"symbol"==typeof t?t:t+""}function b(e){"@babel/helpers - typeof";return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function x(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):undefined}}var w=typeof window==="undefined"?null:window;var E=w?w.navigator:null;w?w.document:null;var T=b("");var k=b({});var C=b((function(){}));var P=typeof HTMLElement==="undefined"?"undefined":b(HTMLElement);var S=function e(t){return t&&t.instanceString&&B(t.instanceString)?t.instanceString():null};var D=function e(t){return t!=null&&b(t)==T};var B=function e(t){return t!=null&&b(t)===C};var A=function e(t){return!L(t)&&(Array.isArray?Array.isArray(t):t!=null&&t instanceof Array)};var _=function e(t){return t!=null&&b(t)===k&&!A(t)&&t.constructor===Object};var M=function e(t){return t!=null&&b(t)===k};var I=function e(t){return t!=null&&b(t)===b(1)&&!isNaN(t)};var R=function e(t){return I(t)&&Math.floor(t)===t};var N=function e(t){if("undefined"===P){return undefined}else{return null!=t&&t instanceof HTMLElement}};var L=function e(t){return O(t)||z(t)};var O=function e(t){return S(t)==="collection"&&t._private.single};var z=function e(t){return S(t)==="collection"&&!t._private.single};var F=function e(t){return S(t)==="core"};var V=function e(t){return S(t)==="stylesheet"};var j=function e(t){return S(t)==="event"};var X=function e(t){if(t===undefined||t===null){return true}else if(t===""||t.match(/^\s+$/)){return true}return false};var Y=function e(t){if(typeof HTMLElement==="undefined"){return false}else{return t instanceof HTMLElement}};var q=function e(t){return _(t)&&I(t.x1)&&I(t.x2)&&I(t.y1)&&I(t.y2)};var W=function e(t){return M(t)&&B(t.then)};var U=function e(){return E&&E.userAgent.match(/msie|trident|edge/i)};var G=function e(t,r){if(!r){r=function e(){if(arguments.length===1){return arguments[0]}else if(arguments.length===0){return"undefined"}var t=[];for(var r=0;rr){return 1}else{return 0}};var oe=function e(t,r){return-1*ie(t,r)};var se=Object.assign!=null?Object.assign.bind(Object):function(e){var t=arguments;for(var r=1;r1)r-=1;if(r<1/6)return e+(t-e)*6*r;if(r<1/2)return t;if(r<2/3)return e+(t-e)*(2/3-r)*6;return e}var f=new RegExp("^"+te+"$").exec(t);if(f){a=parseInt(f[1]);if(a<0){a=(360- -1*a%360)%360}else if(a>360){a=a%360}a/=360;n=parseFloat(f[2]);if(n<0||n>100){return}n=n/100;i=parseFloat(f[3]);if(i<0||i>100){return}i=i/100;o=f[4];if(o!==undefined){o=parseFloat(o);if(o<0||o>1){return}}if(n===0){s=l=u=Math.round(i*255)}else{var c=i<.5?i*(1+n):i+n-i*n;var d=2*i-c;s=Math.round(255*v(d,c,a+1/3));l=Math.round(255*v(d,c,a));u=Math.round(255*v(d,c,a-1/3))}r=[s,l,u,o]}return r};var ve=function e(t){var r;var a=new RegExp("^"+J+"$").exec(t);if(a){r=[];var n=[];for(var i=1;i<=3;i++){var o=a[i];if(o[o.length-1]==="%"){n[i]=true}o=parseFloat(o);if(n[i]){o=o/100*255}if(o<0||o>255){return}r.push(Math.floor(o))}var s=n[1]||n[2]||n[3];var l=n[1]&&n[2]&&n[3];if(s&&!l){return}var u=a[4];if(u!==undefined){u=parseFloat(u);if(u<0||u>1){return}r.push(u)}}return r};var fe=function e(t){return de[t.toLowerCase()]};var ce=function e(t){return(A(t)?t:null)||fe(t)||le(t)||ve(t)||ue(t)};var de={transparent:[0,0,0,0],aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],grey:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var he=function e(t){var r=t.map;var a=t.keys;var n=a.length;for(var i=0;i=s||t<0||y&&r>=f}function T(){var e=t();if(E(e)){return k(e)}d=setTimeout(T,w(e))}function k(e){d=undefined;if(m&&u){return b(e)}u=v=undefined;return c}function C(){if(d!==undefined){clearTimeout(d)}p=0;u=h=v=d=undefined}function P(){return d===undefined?c:k(t())}function S(){var e=t(),r=E(e);u=arguments;v=this;h=e;if(r){if(d===undefined){return x(h)}if(y){clearTimeout(d);d=setTimeout(T,s);return b(h)}}if(d===undefined){d=setTimeout(T,s)}return c}S.cancel=C;S.flush=P;return S}at=o;return at}var ot=it();var st=ye(ot);var lt=w?w.performance:null;var ut=lt&<.now?function(){return lt.now()}:function(){return Date.now()};var vt=function(){if(w){if(w.requestAnimationFrame){return function(e){w.requestAnimationFrame(e)}}else if(w.mozRequestAnimationFrame){return function(e){w.mozRequestAnimationFrame(e)}}else if(w.webkitRequestAnimationFrame){return function(e){w.webkitRequestAnimationFrame(e)}}else if(w.msRequestAnimationFrame){return function(e){w.msRequestAnimationFrame(e)}}}return function(e){if(e){setTimeout((function(){e(ut())}),1e3/60)}}}();var ft=function e(t){return vt(t)};var ct=ut;var dt=9261;var ht=65599;var pt=5381;var gt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:dt;var a=r;var n;for(;;){n=t.next();if(n.done){break}a=a*ht+n.value|0}return a};var yt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:dt;return r*ht+t|0};var mt=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:pt;return(r<<5)+r+t|0};var bt=function e(t,r){return t*2097152+r};var xt=function e(t){return t[0]*2097152+t[1]};var wt=function e(t,r){return[yt(t[0],r[0]),mt(t[1],r[1])]};var Et=function e(t,r){var a={value:0,done:false};var n=0;var i=t.length;var o={next:function e(){if(n=0;n--){if(t[n]===r){t.splice(n,1)}}};var Wt=function e(t){t.splice(0,t.length)};var Ut=function e(t,r){for(var a=0;a2&&arguments[2]!==undefined?arguments[2]:true;if(t===undefined||r===undefined||!F(t)){Rt("An element must have a core reference and parameters set");return}var n=r.group;if(n==null){if(r.data&&r.data.source!=null&&r.data.target!=null){n="edges"}else{n="nodes"}}if(n!=="nodes"&&n!=="edges"){Rt("An element must be of type `nodes` or `edges`; you specified `"+n+"`");return}this.length=1;this[0]=this;var i=this._private={cy:t,single:true,data:r.data||{},position:r.position||{x:0,y:0},autoWidth:undefined,autoHeight:undefined,autoPadding:undefined,compoundBoundsClean:false,listeners:[],group:n,style:{},rstyle:{},styleCxts:[],styleKeys:{},removed:true,selected:r.selected?true:false,selectable:r.selectable===undefined?true:r.selectable?true:false,locked:r.locked?true:false,grabbed:false,grabbable:r.grabbable===undefined?true:r.grabbable?true:false,pannable:r.pannable===undefined?n==="edges"?true:false:r.pannable?true:false,active:false,classes:new Jt,animation:{current:[],queue:[]},rscratch:{},scratch:r.scratch||{},edges:[],children:[],parent:r.parent&&r.parent.isNode()?r.parent:null,traversalCache:{},backgrounding:false,bbCache:null,bbCacheShift:{x:0,y:0},bodyBounds:null,overlayBounds:null,labelBounds:{all:null,source:null,target:null,main:null},arrowBounds:{source:null,target:null,"mid-source":null,"mid-target":null}};if(i.position.x==null){i.position.x=0}if(i.position.y==null){i.position.y=0}if(r.renderedPosition){var o=r.renderedPosition;var s=t.pan();var l=t.zoom();i.position={x:(o.x-s.x)/l,y:(o.y-s.y)/l}}var u=[];if(A(r.classes)){u=r.classes}else if(D(r.classes)){u=r.classes.split(/\s+/)}for(var v=0,f=u.length;vt){return 1}return 0};u=function(e,t,n,i,o){var s;if(n==null){n=0}if(o==null){o=r}if(n<0){throw new Error("lo must be non-negative")}if(i==null){i=e.length}while(nr;0<=r?t++:t--){u.push(t)}return u}.apply(this).reverse();l=[];for(i=0,o=s.length;ip;0<=p?++c:--c){g.push(i(e,a))}return g};h=function(e,t,a,n){var i,o,s;if(n==null){n=r}i=e[a];while(a>t){s=a-1>>1;o=e[s];if(n(i,o)<0){e[a]=o;a=s;continue}break}return e[a]=i};p=function(e,t,a){var n,i,o,s,l;if(a==null){a=r}i=e.length;l=t;o=e[t];n=2*t+1;while(n0){var E=m.pop();var T=g(E);var k=E.id();c[k]=T;if(T===Infinity){continue}var C=E.neighborhood().intersect(h);for(var P=0;P0){a.unshift(r);while(f[i]){var o=f[i];a.unshift(o.edge);a.unshift(o.node);n=o.node;i=n.id()}}return s.spawn(a)}}}};var hr={kruskal:function e(t){t=t||function(e){return 1};var r=this.byGroup(),a=r.nodes,n=r.edges;var i=a.length;var o=new Array(i);var s=a;var l=function e(t){for(var r=0;r0){w();T++;if(x===v){var k=[];var C=i;var P=v;var S=y[P];for(;;){k.unshift(C);if(S!=null){k.unshift(S)}C=g[P];if(C==null){break}P=C.id();S=y[P]}return{found:true,distance:f[x],path:this.spawn(k),steps:T}}d[x]=true;var D=b._private.edges;for(var B=0;BS){h[P]=S;m[P]=C;b[P]=w}if(!i){var B=C*v+k;if(!i&&h[B]>S){h[B]=S;m[B]=k;b[B]=w}}}for(var A=0;A1&&arguments[1]!==undefined?arguments[1]:o;var n=b(t);var i=[];var s=n;for(;;){if(s==null){return r.spawn()}var u=m(s),v=u.edge,f=u.pred;i.unshift(s[0]);if(s.same(a)&&i.length>0){break}if(v!=null){i.unshift(v)}s=f}return l.spawn(i)};for(var E=0;E=0;v--){var f=u[v];var c=f[1];var d=f[2];if(r[c]===s&&r[d]===l||r[c]===l&&r[d]===s){u.splice(v,1)}}for(var h=0;hn){var i=Math.floor(Math.random()*r.length);r=Er(i,t,r);a--}return r};var kr={kargerStein:function e(){var t=this;var r=this.byGroup(),a=r.nodes,n=r.edges;n.unmergeBy((function(e){return e.isLoop()}));var i=a.length;var o=n.length;var s=Math.ceil(Math.pow(Math.log(i)/Math.LN2,2));var l=Math.floor(i/wr);if(i<2){Rt("At least 2 nodes are required for Karger-Stein algorithm");return undefined}var u=[];for(var v=0;v1&&arguments[1]!==undefined?arguments[1]:0;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var e=Infinity;for(var n=r;n1&&arguments[1]!==undefined?arguments[1]:0;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var e=-Infinity;for(var n=r;n1&&arguments[1]!==undefined?arguments[1]:0;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var n=0;var i=0;for(var o=r;o1&&arguments[1]!==undefined?arguments[1]:0;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:t.length;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var o=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;if(n){t=t.slice(r,a)}else{if(a0){t.splice(0,r)}}var s=0;for(var l=t.length-1;l>=0;l--){var u=t[l];if(o){if(!isFinite(u)){t[l]=-Infinity;s++}}else{t.splice(l,1)}}if(i){t.sort((function(e,t){return e-t}))}var v=t.length;var f=Math.floor(v/2);if(v%2!==0){return t[f+1+s]}else{return(t[f-1+s]+t[f+s])/2}};var Ir=function e(t){return Math.PI*t/180};var Rr=function e(t,r){return Math.atan2(r,t)-Math.PI/2};var Nr=Math.log2||function(e){return Math.log(e)/Math.log(2)};var Lr=function e(t){if(t>0){return 1}else if(t<0){return-1}else{return 0}};var Or=function e(t,r){return Math.sqrt(zr(t,r))};var zr=function e(t,r){var a=r.x-t.x;var n=r.y-t.y;return a*a+n*n};var Fr=function e(t){var r=t.length;var a=0;for(var n=0;n=t.x1&&t.y2>=t.y1){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2,w:t.x2-t.x1,h:t.y2-t.y1}}else if(t.w!=null&&t.h!=null&&t.w>=0&&t.h>=0){return{x1:t.x1,y1:t.y1,x2:t.x1+t.w,y2:t.y1+t.h,w:t.w,h:t.h}}}};var Wr=function e(t){return{x1:t.x1,x2:t.x2,w:t.w,y1:t.y1,y2:t.y2,h:t.h}};var Ur=function e(t){t.x1=Infinity;t.y1=Infinity;t.x2=-Infinity;t.y2=-Infinity;t.w=0;t.h=0};var Gr=function e(t,r,a){return{x1:t.x1+r,x2:t.x2+r,y1:t.y1+a,y2:t.y2+a,w:t.w,h:t.h}};var Hr=function e(t,r){t.x1=Math.min(t.x1,r.x1);t.x2=Math.max(t.x2,r.x2);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,r.y1);t.y2=Math.max(t.y2,r.y2);t.h=t.y2-t.y1};var Kr=function e(t,r,a){t.x1=Math.min(t.x1,r);t.x2=Math.max(t.x2,r);t.w=t.x2-t.x1;t.y1=Math.min(t.y1,a);t.y2=Math.max(t.y2,a);t.h=t.y2-t.y1};var Zr=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;t.x1-=r;t.x2+=r;t.y1-=r;t.y2+=r;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};var $r=function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[0];var a,n,i,o;if(r.length===1){a=n=i=o=r[0]}else if(r.length===2){a=i=r[0];o=n=r[1]}else if(r.length===4){var s=p(r,4);a=s[0];n=s[1];i=s[2];o=s[3]}t.x1-=o;t.x2+=n;t.y1-=a;t.y2+=i;t.w=t.x2-t.x1;t.h=t.y2-t.y1;return t};var Qr=function e(t,r){t.x1=r.x1;t.y1=r.y1;t.x2=r.x2;t.y2=r.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};var Jr=function e(t,r){if(t.x1>r.x2){return false}if(r.x1>t.x2){return false}if(t.x2r.y2){return false}if(r.y1>t.y2){return false}return true};var ea=function e(t,r,a){return t.x1<=r&&r<=t.x2&&t.y1<=a&&a<=t.y2};var ta=function e(t,r){return ea(t,r.x,r.y)};var ra=function e(t,r){return ea(t,r.x1,r.y1)&&ea(t,r.x2,r.y2)};var aa=function e(t,r,a,n,i,o,s){var l=arguments.length>7&&arguments[7]!==undefined?arguments[7]:"auto";var u=l==="auto"?Pa(i,o):l;var v=i/2;var f=o/2;u=Math.min(u,v,f);var c=u!==v,d=u!==f;var h;if(c){var p=a-v+u-s;var g=n-f-s;var y=a+v-u+s;var m=g;h=ba(t,r,a,n,p,g,y,m,false);if(h.length>0){return h}}if(d){var b=a+v+s;var x=n-f+u-s;var w=b;var E=n+f-u+s;h=ba(t,r,a,n,b,x,w,E,false);if(h.length>0){return h}}if(c){var T=a-v+u-s;var k=n+f+s;var C=a+v-u+s;var P=k;h=ba(t,r,a,n,T,k,C,P,false);if(h.length>0){return h}}if(d){var S=a-v-s;var D=n-f+u-s;var B=S;var A=n+f-u+s;h=ba(t,r,a,n,S,D,B,A,false);if(h.length>0){return h}}var _;{var M=a-v+u;var I=n-f+u;_=ya(t,r,a,n,M,I,u+s);if(_.length>0&&_[0]<=M&&_[1]<=I){return[_[0],_[1]]}}{var R=a+v-u;var N=n-f+u;_=ya(t,r,a,n,R,N,u+s);if(_.length>0&&_[0]>=R&&_[1]<=N){return[_[0],_[1]]}}{var L=a+v-u;var O=n+f-u;_=ya(t,r,a,n,L,O,u+s);if(_.length>0&&_[0]>=L&&_[1]>=O){return[_[0],_[1]]}}{var z=a-v+u;var F=n+f-u;_=ya(t,r,a,n,z,F,u+s);if(_.length>0&&_[0]<=z&&_[1]>=F){return[_[0],_[1]]}}return[]};var na=function e(t,r,a,n,i,o,s){var l=s;var u=Math.min(a,i);var v=Math.max(a,i);var f=Math.min(n,o);var c=Math.max(n,o);return u-l<=t&&t<=v+l&&f-l<=r&&r<=c+l};var ia=function e(t,r,a,n,i,o,s,l,u){var v={x1:Math.min(a,s,i)-u,x2:Math.max(a,s,i)+u,y1:Math.min(n,l,o)-u,y2:Math.max(n,l,o)+u};if(tv.x2||rv.y2){return false}else{return true}};var oa=function e(t,r,a,n){a-=n;var i=r*r-4*t*a;if(i<0){return[]}var o=Math.sqrt(i);var s=2*t;var l=(-r+o)/s;var u=(-r-o)/s;return[l,u]};var sa=function e(t,r,a,n,i){var o=1e-5;if(t===0){t=o}r/=t;a/=t;n/=t;var s,l,u,v,f,c,d,h;l=(3*a-r*r)/9;u=-(27*n)+r*(9*a-2*(r*r));u/=54;s=l*l*l+u*u;i[1]=0;d=r/3;if(s>0){f=u+Math.sqrt(s);f=f<0?-Math.pow(-f,1/3):Math.pow(f,1/3);c=u-Math.sqrt(s);c=c<0?-Math.pow(-c,1/3):Math.pow(c,1/3);i[0]=-d+f+c;d+=(f+c)/2;i[4]=i[2]=-d;d=Math.sqrt(3)*(-c+f)/2;i[3]=d;i[5]=-d;return}i[5]=i[3]=0;if(s===0){h=u<0?-Math.pow(-u,1/3):Math.pow(u,1/3);i[0]=-d+2*h;i[4]=i[2]=-(h+d);return}l=-l;v=l*l*l;v=Math.acos(u/Math.sqrt(v));h=2*Math.sqrt(l);i[0]=-d+h*Math.cos(v/3);i[2]=-d+h*Math.cos((v+2*Math.PI)/3);i[4]=-d+h*Math.cos((v+4*Math.PI)/3);return};var la=function e(t,r,a,n,i,o,s,l){var u=1*a*a-4*a*i+2*a*s+4*i*i-4*i*s+s*s+n*n-4*n*o+2*n*l+4*o*o-4*o*l+l*l;var v=1*9*a*i-3*a*a-3*a*s-6*i*i+3*i*s+9*n*o-3*n*n-3*n*l-6*o*o+3*o*l;var f=1*3*a*a-6*a*i+a*s-a*t+2*i*i+2*i*t-s*t+3*n*n-6*n*o+n*l-n*r+2*o*o+2*o*r-l*r;var c=1*a*i-a*a+a*t-i*t+n*o-n*n+n*r-o*r;var d=[];sa(u,v,f,c,d);var h=1e-7;var p=[];for(var g=0;g<6;g+=2){if(Math.abs(d[g+1])=0&&d[g]<=1){p.push(d[g])}}p.push(1);p.push(0);var y=-1;var m,b,x;for(var w=0;w=0){if(xu){return(t-i)*(t-i)+(r-o)*(r-o)}return v-c};var va=function e(t,r,a){var n,i,o,s;var l;var u=0;for(var v=0;v=t&&t>=o||n<=t&&t<=o){l=(t-n)/(o-n)*(s-i)+i;if(l>r){u++}}else{continue}}if(u%2===0){return false}else{return true}};var fa=function e(t,r,a,n,i,o,s,l,u){var v=new Array(a.length);var f;if(l[0]!=null){f=Math.atan(l[1]/l[0]);if(l[0]<0){f=f+Math.PI/2}else{f=-f-Math.PI/2}}else{f=l}var c=Math.cos(-f);var d=Math.sin(-f);for(var h=0;h0){var g=ha(v,-u);p=da(g)}else{p=v}return va(t,r,p)};var ca=function e(t,r,a,n,i,o,s,l){var u=new Array(a.length*2);for(var v=0;v=0&&g<=1){m.push(g)}if(y>=0&&y<=1){m.push(y)}if(m.length===0){return[]}var b=m[0]*l[0]+t;var x=m[0]*l[1]+r;if(m.length>1){if(m[0]==m[1]){return[b,x]}else{var w=m[1]*l[0]+t;var E=m[1]*l[1]+r;return[b,x,w,E]}}else{return[b,x]}};var ma=function e(t,r,a){if(r<=t&&t<=a||a<=t&&t<=r){return t}else if(t<=r&&r<=a||a<=r&&r<=t){return r}else{return a}};var ba=function e(t,r,a,n,i,o,s,l,u){var v=t-i;var f=a-t;var c=s-i;var d=r-o;var h=n-r;var p=l-o;var g=c*d-p*v;var y=f*d-h*v;var m=p*f-c*h;if(m!==0){var b=g/m;var x=y/m;var w=.001;var E=0-w;var T=1+w;if(E<=b&&b<=T&&E<=x&&x<=T){return[t+b*f,r+b*h]}else{if(!u){return[]}else{return[t+b*f,r+b*h]}}}else{if(g===0||y===0){if(ma(t,a,s)===s){return[s,l]}if(ma(t,a,i)===i){return[i,o]}if(ma(i,s,a)===a){return[a,n]}return[]}else{return[]}}};var xa=function e(t,r,a,n,i,o,s,l){var u=[];var v;var f=new Array(a.length);var c=true;if(o==null){c=false}var d;if(c){for(var h=0;h0){var p=ha(f,-l);d=da(p)}else{d=f}}else{d=a}var g,y,m,b;for(var x=0;x2){var h=[v[0],v[1]];var p=Math.pow(h[0]-t,2)+Math.pow(h[1]-r,2);for(var g=1;gv){v=r}},get:function e(t){return u[t]}};for(var c=0;c0){x=b.edgesTo(m)[0]}else{x=m.edgesTo(b)[0]}var w=n(x);m=m.id();if(v[m]>v[p]+w){v[m]=v[p]+w;if(c.nodes.indexOf(m)<0){c.push(m)}else{c.updateItem(m)}u[m]=0;a[m]=[]}if(v[m]==v[p]+w){u[m]=u[m]+u[p];a[m].push(p)}}}else{for(var E=0;E0){var P=r.pop();for(var S=0;S0){s.push(a[l])}}if(s.length!==0){i.push(n.collection(s))}}return i};var Ka=function e(t,r){for(var a=0;a5&&arguments[5]!==undefined?arguments[5]:Ja;var s=n;var l,u;for(var v=0;v=2){return on(t,r,a,0,rn,an)}else{return on(t,r,a,0,tn)}},squaredEuclidean:function e(t,r,a){return on(t,r,a,0,rn)},manhattan:function e(t,r,a){return on(t,r,a,0,tn)},max:function e(t,r,a){return on(t,r,a,-Infinity,nn)}};sn["squared-euclidean"]=sn["squaredEuclidean"];sn["squaredeuclidean"]=sn["squaredEuclidean"];function ln(e,t,r,a,n,i){var o;if(B(e)){o=e}else{o=sn[e]||sn.euclidean}if(t===0&&B(e)){return o(n,i)}else{return o(t,r,a,n,i)}}var un=Yt({k:2,m:2,sensitivityThreshold:1e-4,distance:"euclidean",maxIterations:10,attributes:[],testMode:false,testCentroids:null});var vn=function e(t){return un(t)};var fn=function e(t,r,a,n,i){var o=i!=="kMedoids";var s=o?function(e){return a[e]}:function(e){return n[e](a)};var l=function e(t){return n[t](r)};var u=a;var v=r;return ln(t,n.length,s,l,u,v)};var cn=function e(t,r,a){var n=a.length;var i=new Array(n);var o=new Array(n);var s=new Array(r);var l=null;for(var u=0;ua){return false}}}return true};var yn=function e(t,r,a){for(var n=0;ns){s=r[u][v];l=v}}i[l].push(t[u])}for(var f=0;f=i.threshold||i.mode==="dendrogram"&&t.length===1){return false}var h=r[o];var p=r[n[o]];var g;if(i.mode==="dendrogram"){g={left:h,right:p,key:h.key}}else{g={value:h.value.concat(p.value),key:h.key}}t[h.index]=g;t.splice(p.index,1);r[h.key]=g;for(var y=0;ya[p.key][m.key]){l=a[p.key][m.key]}}else if(i.linkage==="max"){l=a[h.key][m.key];if(a[h.key][m.key]0){n.push(i)}}return n};var jn=function e(t,r,a){var n=[];for(var i=0;is){o=u;s=r[i*t+u]}}if(o>0){n.push(o)}}for(var v=0;vu){l=v;u=f}}a[i]=o[l]}n=jn(t,r,a);return n};var Yn=function e(t){var r=this.cy();var a=this.nodes();var n=On(t);var i={};for(var o=0;o=S){D=S;S=A;B=_}else if(A>D){D=A}}for(var M=0;M0?1:0;T[C%n.minIterations*s+z]=F;O+=F}if(O>0&&(C>=n.minIterations-1||C==n.maxIterations-1)){var V=0;for(var j=0;j1||n>1){s=true}f[t]=[];e.outgoers().forEach((function(e){if(e.isEdge())f[t].push(e.id())}))}else{c[t]=[undefined,e.target().id()]}}))}else{o.forEach((function(e){var t=e.id();if(e.isNode()){var r=e.degree(true);if(r%2){if(!l)l=t;else if(!u)u=t;else s=true}f[t]=[];e.connectedEdges().forEach((function(e){return f[t].push(e.id())}))}else{c[t]=[e.source().id(),e.target().id()]}}))}var d={found:false,trail:undefined};if(s)return d;else if(u&&l){if(i){if(v&&u!=v){return d}v=u}else{if(v&&u!=v&&l!=v){return d}else if(!v){v=u}}}else{if(!v)v=o[0].id()}var h=function e(t){var r=t;var a=[t];var n,o,s;while(f[r].length){n=f[r].shift();o=c[n][0];s=c[n][1];if(r!=s){f[s]=f[s].filter((function(e){return e!=n}));r=s}else if(!i&&r!=o){f[o]=f[o].filter((function(e){return e!=n}));r=o}a.unshift(n);a.unshift(r)}return a};var p=[];var g=[];g=h(v);while(g.length!=1){if(f[g[0]].length==0){p.unshift(o.getElementById(g.shift()));p.unshift(o.getElementById(g.shift()))}else{g=h(g.shift()).concat(g)}}p.unshift(o.getElementById(g.shift()));for(var y in f){if(f[y].length){return d}}d.found=true;d.trail=this.spawn(p,true);return d}};var Gn=function e(){var t=this;var r={};var a=0;var n=0;var i=[];var o=[];var s={};var l=function e(a,n){var s=o.length-1;var l=[];var u=t.spawn();while(o[s].x!=a||o[s].y!=n){l.push(o.pop().edge);s--}l.push(o.pop().edge);l.forEach((function(e){var a=e.connectedNodes().intersection(t);u.merge(e);a.forEach((function(e){var a=e.id();var n=e.connectedEdges().intersection(t);u.merge(e);if(!r[a].cutVertex){u.merge(n)}else{u.merge(n.filter((function(e){return e.isLoop()})))}}))}));i.push(u)};var u=function e(v,f,c){if(v===c)n+=1;r[f]={id:a,low:a++,cutVertex:false};var d=t.getElementById(f).connectedEdges().intersection(t);if(d.size()===0){i.push(t.spawn(t.getElementById(f)))}else{var h,p,g,y;d.forEach((function(e){h=e.source().id();p=e.target().id();g=h===f?p:h;if(g!==c){y=e.id();if(!s[y]){s[y]=true;o.push({x:f,y:g,edge:e})}if(!(g in r)){u(v,g,f);r[f].low=Math.min(r[f].low,r[g].low);if(r[f].id<=r[g].low){r[f].cutVertex=true;l(f,g)}}else{r[f].low=Math.min(r[f].low,r[g].id)}}}))}};t.forEach((function(e){if(e.isNode()){var t=e.id();if(!(t in r)){n=0;u(t,t);r[t].cutVertex=n>1}}}));var v=Object.keys(r).filter((function(e){return r[e].cutVertex})).map((function(e){return t.getElementById(e)}));return{cut:t.spawn(v),components:i}};var Hn={hopcroftTarjanBiconnected:Gn,htbc:Gn,htb:Gn,hopcroftTarjanBiconnectedComponents:Gn};var Kn=function e(){var t=this;var r={};var a=0;var n=[];var i=[];var o=t.spawn(t);var s=function e(l){i.push(l);r[l]={index:a,low:a++,explored:false};var u=t.getElementById(l).connectedEdges().intersection(t);u.forEach((function(e){var t=e.target().id();if(t!==l){if(!(t in r)){s(t)}if(!r[t].explored){r[l].low=Math.min(r[l].low,r[t].low)}}}));if(r[l].index===r[l].low){var v=t.spawn();for(;;){var f=i.pop();v.merge(t.getElementById(f));r[f].low=r[l].index;r[f].explored=true;if(f===l){break}}var c=v.edgesWith(v);var d=v.merge(c);n.push(d);o=o.difference(d)}};t.forEach((function(e){if(e.isNode()){var t=e.id();if(!(t in r)){s(t)}}}));return{cut:o,components:n}};var Zn={tarjanStronglyConnected:Kn,tsc:Kn,tscc:Kn,tarjanStronglyConnectedComponents:Kn};var $n={};[rr,dr,hr,gr,mr,xr,kr,Ma,Ra,La,za,Qa,Pn,Nn,qn,Un,Hn,Zn].forEach((function(e){se($n,e)}));var Qn=0;var Jn=1;var ei=2;var ti=function e(t){if(!(this instanceof ti))return new ti(t);this.id="Thenable/1.0.7";this.state=Qn;this.fulfillValue=undefined;this.rejectReason=undefined;this.onFulfilled=[];this.onRejected=[];this.proxy={then:this.then.bind(this)};if(typeof t==="function")t.call(this,this.fulfill.bind(this),this.reject.bind(this))};ti.prototype={fulfill:function e(t){return ri(this,Jn,"fulfillValue",t)},reject:function e(t){return ri(this,ei,"rejectReason",t)},then:function e(t,r){var a=this;var n=new ti;a.onFulfilled.push(ii(t,n,"fulfill"));a.onRejected.push(ii(r,n,"reject"));ai(a);return n.proxy}};var ri=function e(t,r,a,n){if(t.state===Qn){t.state=r;t[a]=n;ai(t)}return t};var ai=function e(t){if(t.state===Jn)ni(t,"onFulfilled",t.fulfillValue);else if(t.state===ei)ni(t,"onRejected",t.rejectReason)};var ni=function e(t,r,a){if(t[r].length===0)return;var n=t[r];t[r]=[];var i=function e(){for(var t=0;t0}}},clearQueue:function e(){return function e(){var t=this;var r=t.length!==undefined;var a=r?t:[t];var n=this._private.cy||this;if(!n.styleEnabled()){return this}for(var i=0;i-1}wo=t;return wo}var ko;var Co;function Po(){if(Co)return ko;Co=1;var e=ho();function t(t,r){var a=this.__data__,n=e(a,t);if(n<0){++this.size;a.push([t,r])}else{a[n][1]=r}return this}ko=t;return ko}var So;var Do;function Bo(){if(Do)return So;Do=1;var e=so(),t=yo(),r=xo(),a=To(),n=Po();function i(e){var t=-1,r=e==null?0:e.length;this.clear();while(++t-1&&r%1==0&&r0){this.spawn(n).updateStyle().emit("class")}return r},addClass:function e(t){return this.toggleClass(t,true)},hasClass:function e(t){var r=this[0];return r!=null&&r._private.classes.has(t)},toggleClass:function e(t,r){if(!A(t)){t=t.match(/\S+/g)||[]}var a=this;var n=r===undefined;var i=[];for(var o=0,s=a.length;o0){this.spawn(i).updateStyle().emit("class")}return a},removeClass:function e(t){return this.toggleClass(t,false)},flashClass:function e(t,r){var a=this;if(r==null){r=250}else if(r===0){return a}a.addClass(t);setTimeout((function(){a.removeClass(t)}),r);return a}};dl.className=dl.classNames=dl.classes;var hl={metaChar:"[\\!\\\"\\#\\$\\%\\&\\'\\(\\)\\*\\+\\,\\.\\/\\:\\;\\<\\=\\>\\?\\@\\[\\]\\^\\`\\{\\|\\}\\~]",comparatorOp:"=|\\!=|>|>=|<|<=|\\$=|\\^=|\\*=",boolOp:"\\?|\\!|\\^",string:'"(?:\\\\"|[^"])*"'+"|"+"'(?:\\\\'|[^'])*'",number:Q,meta:"degree|indegree|outdegree",separator:"\\s*,\\s*",descendant:"\\s+",child:"\\s+>\\s+",subject:"\\$",group:"node|edge|\\*",directedEdge:"\\s+->\\s+",undirectedEdge:"\\s+<->\\s+"};hl.variable="(?:[\\w-.]|(?:\\\\"+hl.metaChar+"))+";hl.className="(?:[\\w-]|(?:\\\\"+hl.metaChar+"))+";hl.value=hl.string+"|"+hl.number;hl.id=hl.variable;(function(){var e,t,r;e=hl.comparatorOp.split("|");for(r=0;r=0){continue}if(t==="="){continue}hl.comparatorOp+="|\\!"+t}})();var pl=function e(){return{checks:[]}};var gl={GROUP:0,COLLECTION:1,FILTER:2,DATA_COMPARE:3,DATA_EXIST:4,DATA_BOOL:5,META_COMPARE:6,STATE:7,ID:8,CLASS:9,UNDIRECTED_EDGE:10,DIRECTED_EDGE:11,NODE_SOURCE:12,NODE_TARGET:13,NODE_NEIGHBOR:14,CHILD:15,DESCENDANT:16,PARENT:17,ANCESTOR:18,COMPOUND_SPLIT:19,TRUE:20};var yl=[{selector:":selected",matches:function e(t){return t.selected()}},{selector:":unselected",matches:function e(t){return!t.selected()}},{selector:":selectable",matches:function e(t){return t.selectable()}},{selector:":unselectable",matches:function e(t){return!t.selectable()}},{selector:":locked",matches:function e(t){return t.locked()}},{selector:":unlocked",matches:function e(t){return!t.locked()}},{selector:":visible",matches:function e(t){return t.visible()}},{selector:":hidden",matches:function e(t){return!t.visible()}},{selector:":transparent",matches:function e(t){return t.transparent()}},{selector:":grabbed",matches:function e(t){return t.grabbed()}},{selector:":free",matches:function e(t){return!t.grabbed()}},{selector:":removed",matches:function e(t){return t.removed()}},{selector:":inside",matches:function e(t){return!t.removed()}},{selector:":grabbable",matches:function e(t){return t.grabbable()}},{selector:":ungrabbable",matches:function e(t){return!t.grabbable()}},{selector:":animated",matches:function e(t){return t.animated()}},{selector:":unanimated",matches:function e(t){return!t.animated()}},{selector:":parent",matches:function e(t){return t.isParent()}},{selector:":childless",matches:function e(t){return t.isChildless()}},{selector:":child",matches:function e(t){return t.isChild()}},{selector:":orphan",matches:function e(t){return t.isOrphan()}},{selector:":nonorphan",matches:function e(t){return t.isChild()}},{selector:":compound",matches:function e(t){if(t.isNode()){return t.isParent()}else{return t.source().isParent()||t.target().isParent()}}},{selector:":loop",matches:function e(t){return t.isLoop()}},{selector:":simple",matches:function e(t){return t.isSimple()}},{selector:":active",matches:function e(t){return t.active()}},{selector:":inactive",matches:function e(t){return!t.active()}},{selector:":backgrounding",matches:function e(t){return t.backgrounding()}},{selector:":nonbackgrounding",matches:function e(t){return!t.backgrounding()}}].sort((function(e,t){return oe(e.selector,t.selector)}));var ml=function(){var e={};var t;for(var r=0;r0&&v.edgeCount>0){Lt("The selector `"+t+"` is invalid because it uses both a compound selector and an edge selector");return false}if(v.edgeCount>1){Lt("The selector `"+t+"` is invalid because it uses multiple edge selectors");return false}else if(v.edgeCount===1){Lt("The selector `"+t+"` is deprecated. Edge selectors do not take effect on changes to source and target nodes after an edge is added, for performance reasons. Use a class or data selector on edges instead, updating the class or data of an edge when your app detects a change in source or target nodes.")}}return true};var Sl=function e(){if(this.toStringCache!=null){return this.toStringCache}var t=function e(t){if(t==null){return""}else{return t}};var r=function e(r){if(D(r)){return'"'+r+'"'}else{return t(r)}};var a=function e(t){return" "+t+" "};var n=function e(n,o){var s=n.type,l=n.value;switch(s){case gl.GROUP:{var u=t(l);return u.substring(0,u.length-1)}case gl.DATA_COMPARE:{var v=n.field,f=n.operator;return"["+v+a(t(f))+r(l)+"]"}case gl.DATA_BOOL:{var c=n.operator,d=n.field;return"["+t(c)+d+"]"}case gl.DATA_EXIST:{var h=n.field;return"["+h+"]"}case gl.META_COMPARE:{var p=n.operator,g=n.field;return"[["+g+a(t(p))+r(l)+"]]"}case gl.STATE:{return l}case gl.ID:{return"#"+l}case gl.CLASS:{return"."+l}case gl.PARENT:case gl.CHILD:{return i(n.parent,o)+a(">")+i(n.child,o)}case gl.ANCESTOR:case gl.DESCENDANT:{return i(n.ancestor,o)+" "+i(n.descendant,o)}case gl.COMPOUND_SPLIT:{var y=i(n.left,o);var m=i(n.subject,o);var b=i(n.right,o);return y+(y.length>0?" ":"")+m+b}case gl.TRUE:{return""}}};var i=function e(t,r){return t.checks.reduce((function(e,a,i){return e+(r===t&&i===0?"$":"")+n(a,r)}),"")};var o="";for(var s=0;s1&&s=0){r=r.replace("!","");f=true}if(r.indexOf("@")>=0){r=r.replace("@","");v=true}if(i||s||v){l=!i&&!o?"":""+t;u=""+a}if(v){t=l=l.toLowerCase();a=u=u.toLowerCase()}switch(r){case"*=":n=l.indexOf(u)>=0;break;case"$=":n=l.indexOf(u,l.length-u.length)>=0;break;case"^=":n=l.indexOf(u)===0;break;case"=":n=t===a;break;case">":c=true;n=t>a;break;case">=":c=true;n=t>=a;break;case"<":c=true;n=t0){var v=n.shift();t(v);i.add(v.id());if(s){a(n,i,v)}}return e}function Wl(e,t,r){if(r.isParent()){var a=r._private.children;for(var n=0;n1&&arguments[1]!==undefined?arguments[1]:true;return ql(this,e,t,Wl)};function Ul(e,t,r){if(r.isChild()){var a=r._private.parent;if(!t.has(a.id())){e.push(a)}}}Yl.forEachUp=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return ql(this,e,t,Ul)};function Gl(e,t,r){Ul(e,t,r);Wl(e,t,r)}Yl.forEachUpAndDown=function(e){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;return ql(this,e,t,Gl)};Yl.ancestors=Yl.parents;var Hl,Kl;Hl=Kl={data:fl.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateStyle:true}),removeData:fl.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,immutableKeys:{id:true,source:true,target:true,parent:true},updateStyle:true}),scratch:fl.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:fl.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),rscratch:fl.data({field:"rscratch",allowBinding:false,allowSetting:true,settingTriggersEvent:false,allowGetting:true}),removeRscratch:fl.removeData({field:"rscratch",triggerEvent:false}),id:function e(){var t=this[0];if(t){return t._private.data.id}}};Hl.attr=Hl.data;Hl.removeAttr=Hl.removeData;var Zl=Kl;var $l={};function Ql(e){return function(t){var r=this;if(t===undefined){t=true}if(r.length===0){return}if(r.isNode()&&!r.removed()){var a=0;var n=r[0];var i=n._private.edges;for(var o=0;ot})),minIndegree:Jl("indegree",(function(e,t){return et})),minOutdegree:Jl("outdegree",(function(e,t){return et}))});se($l,{totalDegree:function e(t){var r=0;var a=this.nodes();for(var n=0;n0;var c=f;if(f){v=v[0]}var d=c?v.position():{x:0,y:0};if(r!==undefined){u.position(t,r+d[t])}else if(i!==undefined){u.position({x:i.x+d.x,y:i.y+d.y})}}}else{var h=a.position();var p=s?a.parent():null;var g=p&&p.length>0;var y=g;if(g){p=p[0]}var m=y?p.position():{x:0,y:0};i={x:h.x-m.x,y:h.y-m.y};if(t===undefined){return i}else{return i[t]}}}else if(!o){return undefined}return this}};eu.modelPosition=eu.point=eu.position;eu.modelPositions=eu.points=eu.positions;eu.renderedPoint=eu.renderedPosition;eu.relativePoint=eu.relativePosition;var nu=tu;var iu,ou;iu=ou={};ou.renderedBoundingBox=function(e){var t=this.boundingBox(e);var r=this.cy();var a=r.zoom();var n=r.pan();var i=t.x1*a+n.x;var o=t.x2*a+n.x;var s=t.y1*a+n.y;var l=t.y2*a+n.y;return{x1:i,x2:o,y1:s,y2:l,w:o-i,h:l-s}};ou.dirtyCompoundBoundsCache=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}this.forEachUp((function(t){if(t.isParent()){var r=t._private;r.compoundBoundsClean=false;r.bbCache=null;if(!e){t.emitAndNotify("bounds")}}}));return this};ou.updateCompoundBounds=function(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var t=this.cy();if(!t.styleEnabled()||!t.hasCompoundNodes()){return this}if(!e&&t.batching()){return this}function r(e){if(!e.isParent()){return}var t=e._private;var r=e.children();var a=e.pstyle("compound-sizing-wrt-labels").value==="include";var n={width:{val:e.pstyle("min-width").pfValue,left:e.pstyle("min-width-bias-left"),right:e.pstyle("min-width-bias-right")},height:{val:e.pstyle("min-height").pfValue,top:e.pstyle("min-height-bias-top"),bottom:e.pstyle("min-height-bias-bottom")}};var i=r.boundingBox({includeLabels:a,includeOverlays:false,useCache:false});var o=t.position;if(i.w===0||i.h===0){i={w:e.pstyle("width").pfValue,h:e.pstyle("height").pfValue};i.x1=o.x-i.w/2;i.x2=o.x+i.w/2;i.y1=o.y-i.h/2;i.y2=o.y+i.h/2}function s(e,t,r){var a=0;var n=0;var i=t+r;if(e>0&&i>0){a=t/i*e;n=r/i*e}return{biasDiff:a,biasComplementDiff:n}}function l(e,t,r,a){if(r.units==="%"){switch(a){case"width":return e>0?r.pfValue*e:0;case"height":return t>0?r.pfValue*t:0;case"average":return e>0&&t>0?r.pfValue*(e+t)/2:0;case"min":return e>0&&t>0?e>t?r.pfValue*t:r.pfValue*e:0;case"max":return e>0&&t>0?e>t?r.pfValue*e:r.pfValue*t:0;default:return 0}}else if(r.units==="px"){return r.pfValue}else{return 0}}var u=n.width.left.value;if(n.width.left.units==="px"&&n.width.val>0){u=u*100/n.width.val}var v=n.width.right.value;if(n.width.right.units==="px"&&n.width.val>0){v=v*100/n.width.val}var f=n.height.top.value;if(n.height.top.units==="px"&&n.height.val>0){f=f*100/n.height.val}var c=n.height.bottom.value;if(n.height.bottom.units==="px"&&n.height.val>0){c=c*100/n.height.val}var d=s(n.width.val-i.w,u,v);var h=d.biasDiff;var p=d.biasComplementDiff;var g=s(n.height.val-i.h,f,c);var y=g.biasDiff;var m=g.biasComplementDiff;t.autoPadding=l(i.w,i.h,e.pstyle("padding"),e.pstyle("padding-relative-to").value);t.autoWidth=Math.max(i.w,n.width.val);o.x=(-h+i.x1+i.x2+p)/2;t.autoHeight=Math.max(i.h,n.height.val);o.y=(-y+i.y1+i.y2+m)/2}for(var a=0;at.x2?n:t.x2;t.y1=at.y2?i:t.y2;t.w=t.x2-t.x1;t.h=t.y2-t.y1};var uu=function e(t,r){if(r==null){return t}return lu(t,r.x1,r.y1,r.x2,r.y2)};var vu=function e(t,r,a){return Gt(t,r,a)};var fu=function e(t,r,a){if(r.cy().headless()){return}var n=r._private;var i=n.rstyle;var o=i.arrowWidth/2;var s=r.pstyle(a+"-arrow-shape").value;var l;var u;if(s!=="none"){if(a==="source"){l=i.srcX;u=i.srcY}else if(a==="target"){l=i.tgtX;u=i.tgtY}else{l=i.midX;u=i.midY}var v=n.arrowBounds=n.arrowBounds||{};var f=v[a]=v[a]||{};f.x1=l-o;f.y1=u-o;f.x2=l+o;f.y2=u+o;f.w=f.x2-f.x1;f.h=f.y2-f.y1;Zr(f,1);lu(t,f.x1,f.y1,f.x2,f.y2)}};var cu=function e(t,r,a){if(r.cy().headless()){return}var n;if(a){n=a+"-"}else{n=""}var i=r._private;var o=i.rstyle;var s=r.pstyle(n+"label").strValue;if(s){var l=r.pstyle("text-halign");var u=r.pstyle("text-valign");var v=vu(o,"labelWidth",a);var f=vu(o,"labelHeight",a);var c=vu(o,"labelX",a);var d=vu(o,"labelY",a);var h=r.pstyle(n+"text-margin-x").pfValue;var p=r.pstyle(n+"text-margin-y").pfValue;var g=r.isEdge();var y=r.pstyle(n+"text-rotation");var m=r.pstyle("text-outline-width").pfValue;var b=r.pstyle("text-border-width").pfValue;var x=b/2;var w=r.pstyle("text-background-padding").pfValue;var E=2;var T=f;var k=v;var C=k/2;var P=T/2;var S,D,B,A;if(g){S=c-C;D=c+C;B=d-P;A=d+P}else{switch(l.value){case"left":S=c-k;D=c;break;case"center":S=c-C;D=c+C;break;case"right":S=c;D=c+k;break}switch(u.value){case"top":B=d-T;A=d;break;case"center":B=d-P;A=d+P;break;case"bottom":B=d;A=d+T;break}}var _=h-Math.max(m,x)-w-E;var M=h+Math.max(m,x)+w+E;var I=p-Math.max(m,x)-w-E;var R=p+Math.max(m,x)+w+E;S+=_;D+=M;B+=I;A+=R;var N=a||"main";var L=i.labelBounds;var O=L[N]=L[N]||{};O.x1=S;O.y1=B;O.x2=D;O.y2=A;O.w=D-S;O.h=A-B;O.leftPad=_;O.rightPad=M;O.topPad=I;O.botPad=R;var z=g&&y.strValue==="autorotate";var F=y.pfValue!=null&&y.pfValue!==0;if(z||F){var V=z?vu(i.rstyle,"labelAngle",a):y.pfValue;var j=Math.cos(V);var X=Math.sin(V);var Y=(S+D)/2;var q=(B+A)/2;if(!g){switch(l.value){case"left":Y=D;break;case"right":Y=S;break}switch(u.value){case"top":q=A;break;case"bottom":q=B;break}}var W=function e(t,r){t=t-Y;r=r-q;return{x:t*j-r*X+Y,y:t*X+r*j+q}};var U=W(S,B);var G=W(S,A);var H=W(D,B);var K=W(D,A);S=Math.min(U.x,G.x,H.x,K.x);D=Math.max(U.x,G.x,H.x,K.x);B=Math.min(U.y,G.y,H.y,K.y);A=Math.max(U.y,G.y,H.y,K.y)}var Z=N+"Rot";var $=L[Z]=L[Z]||{};$.x1=S;$.y1=B;$.x2=D;$.y2=A;$.w=D-S;$.h=A-B;lu(t,S,B,D,A);lu(i.labelBounds.all,S,B,D,A)}return t};var du=function e(t,r){if(r.cy().headless()){return}var a=r.pstyle("outline-opacity").value;var n=r.pstyle("outline-width").value;if(a>0&&n>0){var i=r.pstyle("outline-offset").value;var o=r.pstyle("shape").value;var s=n+i;var l=(t.w+s*2)/t.w;var u=(t.h+s*2)/t.h;var v=0;var f=0;if(["diamond","pentagon","round-triangle"].includes(o)){l=(t.w+s*2.4)/t.w;f=-s/3.6}else if(["concave-hexagon","rhomboid","right-rhomboid"].includes(o)){l=(t.w+s*2.4)/t.w}else if(o==="star"){l=(t.w+s*2.8)/t.w;u=(t.h+s*2.6)/t.h;f=-s/3.8}else if(o==="triangle"){l=(t.w+s*2.8)/t.w;u=(t.h+s*2.4)/t.h;f=-s/1.4}else if(o==="vee"){l=(t.w+s*4.4)/t.w;u=(t.h+s*3.8)/t.h;f=-s*.5}var c=t.h*u-t.h;var d=t.w*l-t.w;$r(t,[Math.ceil(c/2),Math.ceil(d/2)]);if(v!=0||f!==0){var h=Gr(t,v,f);Hr(t,h)}}};var hu=function e(t,r){var a=t._private.cy;var n=a.styleEnabled();var i=a.headless();var o=qr();var s=t._private;var l=t.isNode();var u=t.isEdge();var v,f,c,d;var h,p;var g=s.rstyle;var y=l&&n?t.pstyle("bounds-expansion").pfValue:[0];var m=function e(t){return t.pstyle("display").value!=="none"};var b=!n||m(t)&&(!u||m(t.source())&&m(t.target()));if(b){var x=0;var w=0;if(n&&r.includeOverlays){x=t.pstyle("overlay-opacity").value;if(x!==0){w=t.pstyle("overlay-padding").value}}var E=0;var T=0;if(n&&r.includeUnderlays){E=t.pstyle("underlay-opacity").value;if(E!==0){T=t.pstyle("underlay-padding").value}}var k=Math.max(w,T);var C=0;var P=0;if(n){C=t.pstyle("width").pfValue;P=C/2}if(l&&r.includeNodes){var S=t.position();h=S.x;p=S.y;var D=t.outerWidth();var B=D/2;var A=t.outerHeight();var _=A/2;v=h-B;f=h+B;c=p-_;d=p+_;lu(o,v,c,f,d);if(n&&r.includeOutlines){du(o,t)}}else if(u&&r.includeEdges){if(n&&!i){var M=t.pstyle("curve-style").strValue;v=Math.min(g.srcX,g.midX,g.tgtX);f=Math.max(g.srcX,g.midX,g.tgtX);c=Math.min(g.srcY,g.midY,g.tgtY);d=Math.max(g.srcY,g.midY,g.tgtY);v-=P;f+=P;c-=P;d+=P;lu(o,v,c,f,d);if(M==="haystack"){var I=g.haystackPts;if(I&&I.length===2){v=I[0].x;c=I[0].y;f=I[1].x;d=I[1].y;if(v>f){var R=v;v=f;f=R}if(c>d){var N=c;c=d;d=N}lu(o,v-P,c-P,f+P,d+P)}}else if(M==="bezier"||M==="unbundled-bezier"||M.endsWith("segments")||M.endsWith("taxi")){var L;switch(M){case"bezier":case"unbundled-bezier":L=g.bezierPts;break;case"segments":case"taxi":case"round-segments":case"round-taxi":L=g.linePts;break}if(L!=null){for(var O=0;Of){var Y=v;v=f;f=Y}if(c>d){var q=c;c=d;d=q}v-=P;f+=P;c-=P;d+=P;lu(o,v,c,f,d)}}if(n&&r.includeEdges&&u){fu(o,t,"mid-source");fu(o,t,"mid-target");fu(o,t,"source");fu(o,t,"target")}if(n){var W=t.pstyle("ghost").value==="yes";if(W){var U=t.pstyle("ghost-offset-x").pfValue;var G=t.pstyle("ghost-offset-y").pfValue;lu(o,o.x1+U,o.y1+G,o.x2+U,o.y2+G)}}var H=s.bodyBounds=s.bodyBounds||{};Qr(H,o);$r(H,y);Zr(H,1);if(n){v=o.x1;f=o.x2;c=o.y1;d=o.y2;lu(o,v-k,c-k,f+k,d+k)}var K=s.overlayBounds=s.overlayBounds||{};Qr(K,o);$r(K,y);Zr(K,1);var Z=s.labelBounds=s.labelBounds||{};if(Z.all!=null){Ur(Z.all)}else{Z.all=qr()}if(n&&r.includeLabels){if(r.includeMainLabels){cu(o,t,null)}if(u){if(r.includeSourceLabels){cu(o,t,"source")}if(r.includeTargetLabels){cu(o,t,"target")}}}}o.x1=su(o.x1);o.y1=su(o.y1);o.x2=su(o.x2);o.y2=su(o.y2);o.w=su(o.x2-o.x1);o.h=su(o.y2-o.y1);if(o.w>0&&o.h>0&&b){$r(o,y);Zr(o,1)}return o};var pu=function e(t){var r=0;var a=function e(t){return(t?1:0)<0&&arguments[0]!==undefined?arguments[0]:Wu;var t=arguments.length>1?arguments[1]:undefined;for(var r=0;r=0;s--){o(s)}return this};Gu.removeAllListeners=function(){return this.removeListener("*")};Gu.emit=Gu.trigger=function(e,t,r){var a=this.listeners;var n=a.length;this.emitting++;if(!A(t)){t=[t]}Zu(this,(function(e,i){if(r!=null){a=[{event:i.event,type:i.type,namespace:i.namespace,callback:r}];n=a.length}var o=function r(){var n=a[s];if(n.type===i.type&&(!n.namespace||n.namespace===i.namespace||n.namespace===Xu)&&e.eventMatches(e.context,n,i)){var o=[i];if(t!=null){Ut(o,t)}e.beforeEmit(e.context,n,i);if(n.conf&&n.conf.one){e.listeners=e.listeners.filter((function(e){return e!==n}))}var l=e.callbackContext(e.context,n,i);var u=n.callback.apply(l,o);e.afterEmit(e.context,n,i);if(u===false){i.stopPropagation();i.preventDefault()}}};for(var s=0;s1&&!o){var s=this.length-1;var l=this[s];var u=l._private.data.id;this[s]=undefined;this[t]=l;i.set(u,{ele:l,index:t})}this.length--;return this},unmergeOne:function e(t){t=t[0];var r=this._private;var a=t._private.data.id;var n=r.map;var i=n.get(a);if(!i){return this}var o=i.index;this.unmergeAt(o);return this},unmerge:function e(t){var r=this._private.cy;if(!t){return this}if(t&&D(t)){var a=t;t=r.mutableElements().filter(a)}for(var n=0;n=0;r--){var a=this[r];if(t(a)){this.unmergeAt(r)}}return this},map:function e(t,r){var a=[];var n=this;for(var i=0;ie){e=s;a=o}}return{value:e,ele:a}},min:function e(t,r){var e=Infinity;var a;var n=this;for(var i=0;i=0&&i1&&arguments[1]!==undefined?arguments[1]:true;var a=this[0];var n=a.cy();if(!n.styleEnabled()){return}if(a){if(a._private.styleDirty){a._private.styleDirty=false;n.style().apply(a)}var i=a._private.style[t];if(i!=null){return i}else if(r){return n.style().getDefaultProperty(t)}else{return null}}},numericStyle:function e(t){var r=this[0];if(!r.cy().styleEnabled()){return}if(r){var a=r.pstyle(t);return a.pfValue!==undefined?a.pfValue:a.value}},numericStyleUnits:function e(t){var r=this[0];if(!r.cy().styleEnabled()){return}if(r){return r.pstyle(t).units}},renderedStyle:function e(t){var r=this.cy();if(!r.styleEnabled()){return this}var a=this[0];if(a){return r.style().getRenderedStyle(a,t)}},style:function e(t,r){var a=this.cy();if(!a.styleEnabled()){return this}var n=false;var e=a.style();if(_(t)){var i=t;e.applyBypass(this,i,n);this.emitAndNotify("style")}else if(D(t)){if(r===undefined){var o=this[0];if(o){return e.getStylePropertyValue(o,t)}else{return}}else{e.applyBypass(this,t,r,n);this.emitAndNotify("style")}}else if(t===undefined){var s=this[0];if(s){return e.getRawStyle(s)}else{return}}return this},removeStyle:function e(t){var r=this.cy();if(!r.styleEnabled()){return this}var a=false;var n=r.style();var i=this;if(t===undefined){for(var o=0;o0){t.push(v[0])}t.push(s[0])}}return this.spawn(t,true).filter(e)}),"neighborhood"),closedNeighborhood:function e(t){return this.neighborhood().add(this).filter(t)},openNeighborhood:function e(t){return this.neighborhood(t)}});Ev.neighbourhood=Ev.neighborhood;Ev.closedNeighbourhood=Ev.closedNeighborhood;Ev.openNeighbourhood=Ev.openNeighborhood;se(Ev,{source:Xl((function e(t){var r=this[0];var a;if(r){a=r._private.source||r.cy().collection()}return a&&t?a.filter(t):a}),"source"),target:Xl((function e(t){var r=this[0];var a;if(r){a=r._private.target||r.cy().collection()}return a&&t?a.filter(t):a}),"target"),sources:Pv({attr:"source"}),targets:Pv({attr:"target"})});function Pv(e){return function t(r){var a=[];for(var n=0;n0);return e},component:function e(){var t=this[0];return t.cy().mutableElements().components(t)[0]}});Ev.componentsOf=Ev.components;var Bv=function e(t,r){var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:false;var n=arguments.length>3&&arguments[3]!==undefined?arguments[3]:false;if(t===undefined){Rt("A collection must have a reference to the core");return}var i=new Zt;var o=false;if(!r){r=[]}else if(r.length>0&&_(r[0])&&!O(r[0])){o=true;var s=[];var l=new Jt;for(var u=0,v=r.length;u0&&arguments[0]!==undefined?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=this;var a=r.cy();var n=a._private;var i=[];var o=[];var s;for(var l=0,u=r.length;l0){var O=s.length===r.length?r:new Bv(a,s);for(var z=0;z0&&arguments[0]!==undefined?arguments[0]:true;var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var r=this;var a=[];var n={};var i=r._private.cy;function o(e){var t=e._private.edges;for(var r=0;r0){if(e){S.emitAndNotify("remove")}else if(t){S.emit("remove")}}for(var D=0;D0){n=l}else{a=l}}while(Math.abs(i)>o&&++u=i){return m(t,v)}else if(f===0){return v}else{return x(t,a,a+u)}}var E=false;function T(){E=true;if(e!==t||r!==a){b()}}var k=function n(i){if(!E){T()}if(e===t&&r===a){return i}if(i===0){return 0}if(i===1){return 1}return g(w(i),t,a)};k.getControlPoints=function(){return[{x:e,y:t},{x:r,y:a}]};var C="generateBezier("+[e,t,r,a]+")";k.toString=function(){return C};return k}var Iv=function(){function e(e){return-e.tension*e.x-e.friction*e.v}function t(t,r,a){var n={x:t.x+a.dx*r,v:t.v+a.dv*r,tension:t.tension,friction:t.friction};return{dx:n.v,dv:e(n)}}function r(r,a){var n={dx:r.v,dv:e(r)},i=t(r,a*.5,n),o=t(r,a*.5,i),s=t(r,a,o),l=1/6*(n.dx+2*(i.dx+o.dx)+s.dx),u=1/6*(n.dv+2*(i.dv+o.dv)+s.dv);r.x=r.x+l*a;r.v=r.v+u*a;return r}return function e(t,a,n){var i={x:-1,v:0,tension:null,friction:null},o=[0],s=0,l=1/1e4,u=16/1e3,v,f,c;t=parseFloat(t)||500;a=parseFloat(a)||20;n=n||null;i.tension=t;i.friction=a;v=n!==null;if(v){s=e(t,a);f=s/n*u}else{f=u}for(;;){c=r(c||i,f);o.push(1+c.x);s+=16;if(!(Math.abs(c.x)>l&&Math.abs(c.v)>l)){break}}return!v?s:function(e){return o[e*(o.length-1)|0]}}}();var Rv=function e(t,r,a,n){var i=Mv(t,r,a,n);return function(e,t,r){return e+(t-e)*i(r)}};var Nv={linear:function e(t,r,a){return t+(r-t)*a},ease:Rv(.25,.1,.25,1),"ease-in":Rv(.42,0,1,1),"ease-out":Rv(0,0,.58,1),"ease-in-out":Rv(.42,0,.58,1),"ease-in-sine":Rv(.47,0,.745,.715),"ease-out-sine":Rv(.39,.575,.565,1),"ease-in-out-sine":Rv(.445,.05,.55,.95),"ease-in-quad":Rv(.55,.085,.68,.53),"ease-out-quad":Rv(.25,.46,.45,.94),"ease-in-out-quad":Rv(.455,.03,.515,.955),"ease-in-cubic":Rv(.55,.055,.675,.19),"ease-out-cubic":Rv(.215,.61,.355,1),"ease-in-out-cubic":Rv(.645,.045,.355,1),"ease-in-quart":Rv(.895,.03,.685,.22),"ease-out-quart":Rv(.165,.84,.44,1),"ease-in-out-quart":Rv(.77,0,.175,1),"ease-in-quint":Rv(.755,.05,.855,.06),"ease-out-quint":Rv(.23,1,.32,1),"ease-in-out-quint":Rv(.86,0,.07,1),"ease-in-expo":Rv(.95,.05,.795,.035),"ease-out-expo":Rv(.19,1,.22,1),"ease-in-out-expo":Rv(1,0,0,1),"ease-in-circ":Rv(.6,.04,.98,.335),"ease-out-circ":Rv(.075,.82,.165,1),"ease-in-out-circ":Rv(.785,.135,.15,.86),spring:function e(t,r,a){if(a===0){return Nv.linear}var e=Iv(t,r,a);return function(t,r,a){return t+(r-t)*e(a)}},"cubic-bezier":Rv};function Lv(e,t,r,a,n){if(a===1){return r}if(t===r){return r}var i=n(t,r,a);if(e==null){return i}if(e.roundValue||e.color){i=Math.round(i)}if(e.min!==undefined){i=Math.max(i,e.min)}if(e.max!==undefined){i=Math.min(i,e.max)}return i}function Ov(e,t){if(e.pfValue!=null||e.value!=null){if(e.pfValue!=null&&(t==null||t.type.units!=="%")){return e.pfValue}else{return e.value}}else{return e}}function zv(e,t,r,a,n){var i=n!=null?n.type:null;if(r<0){r=0}else if(r>1){r=1}var o=Ov(e,n);var s=Ov(t,n);if(I(o)&&I(s)){return Lv(i,o,s,r,a)}else if(A(o)&&A(s)){var l=[];for(var u=0;u0){if(d==="spring"){h.push(o.duration)}o.easingImpl=Nv[d].apply(null,h)}else{o.easingImpl=Nv[d]}}}var p=o.easingImpl;var g;if(o.duration===0){g=1}else{g=(r-l)/o.duration}if(o.applying){g=o.progress}if(g<0){g=0}else if(g>1){g=1}if(o.delay==null){var y=o.startPosition;var m=o.position;if(m&&n&&!e.locked()){var b={};if(Vv(y.x,m.x)){b.x=zv(y.x,m.x,g,p)}if(Vv(y.y,m.y)){b.y=zv(y.y,m.y,g,p)}e.position(b)}var x=o.startPan;var w=o.pan;var E=i.pan;var T=w!=null&&a;if(T){if(Vv(x.x,w.x)){E.x=zv(x.x,w.x,g,p)}if(Vv(x.y,w.y)){E.y=zv(x.y,w.y,g,p)}e.emit("pan")}var k=o.startZoom;var C=o.zoom;var P=C!=null&&a;if(P){if(Vv(k,C)){i.zoom=Yr(i.minZoom,zv(k,C,g,p),i.maxZoom)}e.emit("zoom")}if(T||P){e.emit("viewport")}var S=o.style;if(S&&S.length>0&&n){for(var B=0;B=0;r--){var a=t[r];a()}t.splice(0,t.length)};for(var v=i.length-1;v>=0;v--){var f=i[v];var c=f._private;if(c.stopped){i.splice(v,1);c.hooked=false;c.playing=false;c.started=false;u(c.frames);continue}if(!c.playing&&!c.applying){continue}if(c.playing&&c.applying){c.applying=false}if(!c.started){jv(t,f,e)}Fv(t,f,e,r);if(c.applying){c.applying=false}u(c.frames);if(c.step!=null){c.step(e)}if(f.completed()){i.splice(v,1);c.hooked=false;c.playing=false;c.started=false;u(c.completes)}s=true}if(!r&&i.length===0&&o.length===0){a.push(t)}return s}var i=false;for(var o=0;o0){t.notify("draw",r)}else{t.notify("draw")}}r.unmerge(a);t.emit("step")}var Yv={animate:fl.animate(),animation:fl.animation(),animated:fl.animated(),clearQueue:fl.clearQueue(),delay:fl.delay(),delayAnimation:fl.delayAnimation(),stop:fl.stop(),addToAnimationPool:function e(t){var r=this;if(!r.styleEnabled()){return}r._private.aniEles.merge(t)},stopAnimationLoop:function e(){this._private.animationsRunning=false},startAnimationLoop:function e(){var t=this;t._private.animationsRunning=true;if(!t.styleEnabled()){return}function r(){if(!t._private.animationsRunning){return}ft((function e(a){Xv(a,t);r()}))}var a=t.renderer();if(a&&a.beforeRender){a.beforeRender((function e(r,a){Xv(a,t)}),a.beforeRenderPriorities.animations)}else{r()}}};var qv={qualifierCompare:function e(t,r){if(t==null||r==null){return t==null&&r==null}else{return t.sameText(r)}},eventMatches:function e(t,r,a){var n=r.qualifier;if(n!=null){return t!==a.target&&O(a.target)&&n.matches(a.target)}return true},addEventFields:function e(t,r){r.cy=t;r.target=t},callbackContext:function e(t,r,a){return r.qualifier!=null?a.target:t}};var Wv=function e(t){if(D(t)){return new Fl(t)}else{return t}};var Uv={createEmitter:function e(){var t=this._private;if(!t.emitter){t.emitter=new Uu(qv,this)}return this},emitter:function e(){return this._private.emitter},on:function e(t,r,a){this.emitter().on(t,Wv(r),a);return this},removeListener:function e(t,r,a){this.emitter().removeListener(t,Wv(r),a);return this},removeAllListeners:function e(){this.emitter().removeAllListeners();return this},one:function e(t,r,a){this.emitter().one(t,Wv(r),a);return this},once:function e(t,r,a){this.emitter().one(t,Wv(r),a);return this},emit:function e(t,r){this.emitter().emit(t,r);return this},emitAndNotify:function e(t,r){this.emit(t);this.notify(t,r);return this}};fl.eventAliasesOn(Uv);var Gv={png:function e(t){var r=this._private.renderer;t=t||{};return r.png(t)},jpg:function e(t){var r=this._private.renderer;t=t||{};t.bg=t.bg||"#fff";return r.jpg(t)}};Gv.jpeg=Gv.jpg;var Hv={layout:function e(t){var r=this;if(t==null){Rt("Layout options must be specified to make a layout");return}if(t.name==null){Rt("A `name` must be specified to make a layout");return}var a=t.name;var n=r.extension("layout",a);if(n==null){Rt("No such layout `"+a+"` found. Did you forget to import it and `cytoscape.use()` it?");return}var i;if(D(t.eles)){i=r.$(t.eles)}else{i=t.eles!=null?t.eles:r.$()}var e=new n(se({},t,{cy:r,eles:i}));return e}};Hv.createLayout=Hv.makeLayout=Hv.layout;var Kv={notify:function e(t,r){var a=this._private;if(this.batching()){a.batchNotifications=a.batchNotifications||{};var n=a.batchNotifications[t]=a.batchNotifications[t]||this.collection();if(r!=null){n.merge(r)}return}if(!a.notificationsEnabled){return}var i=this.renderer();if(this.destroyed()||!i){return}i.notify(t,r)},notifications:function e(t){var r=this._private;if(t===undefined){return r.notificationsEnabled}else{r.notificationsEnabled=t?true:false}return this},noNotifications:function e(t){this.notifications(false);t();this.notifications(true)},batching:function e(){return this._private.batchCount>0},startBatch:function e(){var t=this._private;if(t.batchCount==null){t.batchCount=0}if(t.batchCount===0){t.batchStyleEles=this.collection();t.batchNotifications={}}t.batchCount++;return this},endBatch:function e(){var t=this._private;if(t.batchCount===0){return this}t.batchCount--;if(t.batchCount===0){t.batchStyleEles.updateStyle();var r=this.renderer();Object.keys(t.batchNotifications).forEach((function(e){var a=t.batchNotifications[e];if(a.empty()){r.notify(e)}else{r.notify(e,a)}}))}return this},batch:function e(t){this.startBatch();t();this.endBatch();return this},batchData:function e(t){var r=this;return this.batch((function(){var e=Object.keys(t);for(var a=0;a0){r.removeChild(r.childNodes[0])}}t._private.renderer=null;t.mutableElements().forEach((function(e){var t=e._private;t.rscratch={};t.rstyle={};t.animation.current=[];t.animation.queue=[]}))},onRender:function e(t){return this.on("render",t)},offRender:function e(t){return this.off("render",t)}};$v.invalidateDimensions=$v.resize;var Qv={collection:function e(t,r){if(D(t)){return this.$(t)}else if(L(t)){return t.collection()}else if(A(t)){if(!r){r={}}return new Bv(this,t,r.unique,r.removed)}return new Bv(this)},nodes:function e(t){var e=this.$((function(e){return e.isNode()}));if(t){return e.filter(t)}return e},edges:function e(t){var e=this.$((function(e){return e.isEdge()}));if(t){return e.filter(t)}return e},$:function e(t){var r=this._private.elements;if(t){return r.filter(t)}else{return r.spawnSelf()}},mutableElements:function e(){return this._private.elements}};Qv.elements=Qv.filter=Qv.$;var Jv={};var ef="t";var tf="f";Jv.apply=function(e){var t=this;var r=t._private;var a=r.cy;var n=a.collection();for(var i=0;i0;if(c||f&&d){var h=undefined;if(c&&d){h=u.properties}else if(c){h=u.properties}else if(d){h=u.mappedProperties}for(var p=0;p1){x=1}if(s.color){var E=a.valueMin[0];var T=a.valueMax[0];var k=a.valueMin[1];var C=a.valueMax[1];var P=a.valueMin[2];var S=a.valueMax[2];var D=a.valueMin[3]==null?1:a.valueMin[3];var B=a.valueMax[3]==null?1:a.valueMax[3];var A=[Math.round(E+(T-E)*x),Math.round(k+(C-k)*x),Math.round(P+(S-P)*x),Math.round(D+(B-D)*x)];i={bypass:a.bypass,name:a.name,value:A,strValue:"rgb("+A[0]+", "+A[1]+", "+A[2]+")"}}else if(s.number){var _=a.valueMin+(a.valueMax-a.valueMin)*x;i=this.parse(a.name,_,a.bypass,c)}else{return false}if(!i){p();return false}i.mapping=a;a=i;break}case o.data:{var M=a.field.split(".");var R=f.data;for(var N=0;N0&&i>0){var s={};var l=false;for(var u=0;u0){e.delayAnimation(o).play().promise().then(t)}else{t()}})).then((function(){return e.animation({style:s,duration:i,easing:e.pstyle("transition-timing-function").value,queue:false}).play().promise()})).then((function(){r.removeBypasses(e,n);e.emitAndNotify("style");a.transitioning=false}))}else if(a.transitioning){this.removeBypasses(e,n);e.emitAndNotify("style");a.transitioning=false}};Jv.checkTrigger=function(e,t,r,a,n,i){var o=this.properties[t];var s=n(o);if(e.removed()){return}if(s!=null&&s(r,a,e)){i(o)}};Jv.checkZOrderTrigger=function(e,t,r,a){var n=this;this.checkTrigger(e,t,r,a,(function(e){return e.triggersZOrder}),(function(){n._private.cy.notify("zorder",e)}))};Jv.checkBoundsTrigger=function(e,t,r,a){this.checkTrigger(e,t,r,a,(function(e){return e.triggersBounds}),(function(t){e.dirtyCompoundBoundsCache();e.dirtyBoundingBoxCache()}))};Jv.checkConnectedEdgesBoundsTrigger=function(e,t,r,a){this.checkTrigger(e,t,r,a,(function(e){return e.triggersBoundsOfConnectedEdges}),(function(t){e.connectedEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))};Jv.checkParallelEdgesBoundsTrigger=function(e,t,r,a){this.checkTrigger(e,t,r,a,(function(e){return e.triggersBoundsOfParallelEdges}),(function(t){e.parallelEdges().forEach((function(e){e.dirtyBoundingBoxCache()}))}))};Jv.checkTriggers=function(e,t,r,a){e.dirtyStyleCache();this.checkZOrderTrigger(e,t,r,a);this.checkBoundsTrigger(e,t,r,a);this.checkConnectedEdgesBoundsTrigger(e,t,r,a);this.checkParallelEdgesBoundsTrigger(e,t,r,a)};var rf={};rf.applyBypass=function(e,t,r,a){var n=this;var i=[];var o=true;if(t==="*"||t==="**"){if(r!==undefined){for(var s=0;sn.length){a=a.substr(n.length)}else{a=""}}function l(){if(i.length>o.length){i=i.substr(o.length)}else{i=""}}for(;;){var u=a.match(/^\s*$/);if(u){break}var v=a.match(/^\s*((?:.|\s)+?)\s*\{((?:.|\s)+?)\}/);if(!v){Lt("Halting stylesheet parsing: String stylesheet contains more to parse but no selector and block found in: "+a);break}n=v[0];var f=v[1];if(f!=="core"){var c=new Fl(f);if(c.invalid){Lt("Skipping parsing of block: Invalid selector found in string stylesheet: "+f);s();continue}}var d=v[2];var h=false;i=d;var p=[];for(;;){var g=i.match(/^\s*$/);if(g){break}var y=i.match(/^\s*(.+?)\s*:\s*(.+?)(?:\s*;|\s*$)/);if(!y){Lt("Skipping parsing of block: Invalid formatting of style property and value definitions found in:"+d);h=true;break}o=y[0];var m=y[1];var b=y[2];var x=t.properties[m];if(!x){Lt("Skipping property: Invalid property name in: "+o);l();continue}var w=r.parse(m,b);if(!w){Lt("Skipping property: Invalid property definition in: "+o);l();continue}p.push({name:m,val:b});l()}if(h){s();break}r.selector(f);for(var E=0;E=7&&t[0]==="d"&&(v=new RegExp(s.data.regex).exec(t))){if(r){return false}var c=s.data;return{name:e,value:v,strValue:""+t,mapped:c,field:v[1],bypass:r}}else if(t.length>=10&&t[0]==="m"&&(f=new RegExp(s.mapData.regex).exec(t))){if(r){return false}if(u.multiple){return false}var d=s.mapData;if(!(u.color||u.number)){return false}var h=this.parse(e,f[4]);if(!h||h.mapped){return false}var p=this.parse(e,f[5]);if(!p||p.mapped){return false}if(h.pfValue===p.pfValue||h.strValue===p.strValue){Lt("`"+e+": "+t+"` is not a valid mapper because the output range is zero; converting to `"+e+": "+h.strValue+"`");return this.parse(e,h.strValue)}else if(u.color){var g=h.value;var y=p.value;var m=g[0]===y[0]&&g[1]===y[1]&&g[2]===y[2]&&(g[3]===y[3]||(g[3]==null||g[3]===1)&&(y[3]==null||y[3]===1));if(m){return false}}return{name:e,value:f,strValue:""+t,mapped:d,field:f[1],fieldMin:parseFloat(f[2]),fieldMax:parseFloat(f[3]),valueMin:h.value,valueMax:p.value,bypass:r}}if(u.multiple&&a!=="multiple"){var b;if(l){b=t.split(/\s+/)}else if(A(t)){b=t}else{b=[t]}if(u.evenMultiple&&b.length%2!==0){return null}var x=[];var w=[];var E=[];var T="";var k=false;for(var C=0;C0?" ":"")+P.strValue}if(u.validate&&!u.validate(x,w)){return null}if(u.singleEnum&&k){if(x.length===1&&D(x[0])){return{name:e,value:x[0],strValue:x[0],bypass:r}}else{return null}}return{name:e,value:x,pfValue:E,strValue:T,bypass:r,units:w}}var S=function a(){for(var n=0;nu.max||u.strictMax&&t===u.max)){return null}var L={name:e,value:t,strValue:""+t+(_?_:""),units:_,bypass:r};if(u.unitless||_!=="px"&&_!=="em"){L.pfValue=t}else{L.pfValue=_==="px"||!_?t:this.getEmSizeInPixels()*t}if(_==="ms"||_==="s"){L.pfValue=_==="ms"?t:1e3*t}if(_==="deg"||_==="rad"){L.pfValue=_==="rad"?t:Ir(t)}if(_==="%"){L.pfValue=t/100}return L}else if(u.propList){var O=[];var z=""+t;if(z==="none");else{var F=z.split(/\s*,\s*|\s+/);for(var V=0;V0&&s>0&&!isNaN(a.w)&&!isNaN(a.h)&&a.w>0&&a.h>0){l=Math.min((o-2*r)/a.w,(s-2*r)/a.h);l=l>this._private.maxZoom?this._private.maxZoom:l;l=l=a.minZoom){a.maxZoom=r}return this},minZoom:function e(t){if(t===undefined){return this._private.minZoom}else{return this.zoomRange({min:t})}},maxZoom:function e(t){if(t===undefined){return this._private.maxZoom}else{return this.zoomRange({max:t})}},getZoomedViewport:function e(t){var r=this._private;var a=r.pan;var n=r.zoom;var i;var o;var s=false;if(!r.zoomingEnabled){s=true}if(I(t)){o=t}else if(_(t)){o=t.level;if(t.position!=null){i=Pr(t.position,n,a)}else if(t.renderedPosition!=null){i=t.renderedPosition}if(i!=null&&!r.panningEnabled){s=true}}o=o>r.maxZoom?r.maxZoom:o;o=or.maxZoom||!r.zoomingEnabled){o=true}else{r.zoom=l;i.push("zoom")}}if(n&&(!o||!t.cancelOnFailedZoom)&&r.panningEnabled){var u=t.pan;if(I(u.x)){r.pan.x=u.x;s=false}if(I(u.y)){r.pan.y=u.y;s=false}if(!s){i.push("pan")}}if(i.length>0){i.push("viewport");this.emit(i.join(" "));this.notify("viewport")}return this},center:function e(t){var r=this.getCenterPan(t);if(r){this._private.pan=r;this.emit("pan viewport");this.notify("viewport")}return this},getCenterPan:function e(t,r){if(!this._private.panningEnabled){return}if(D(t)){var a=t;t=this.mutableElements().filter(a)}else if(!L(t)){t=this.mutableElements()}if(t.length===0){return}var n=t.boundingBox();var i=this.width();var o=this.height();r=r===undefined?this._private.zoom:r;var s={x:(i-r*(n.x1+n.x2))/2,y:(o-r*(n.y1+n.y2))/2};return s},reset:function e(){if(!this._private.panningEnabled||!this._private.zoomingEnabled){return this}this.viewport({pan:{x:0,y:0},zoom:1});return this},invalidateSize:function e(){this._private.sizeCache=null},size:function e(){var t=this._private;var r=t.container;var a=this;return t.sizeCache=t.sizeCache||(r?function(){var e=a.window().getComputedStyle(r);var t=function t(r){return parseFloat(e.getPropertyValue(r))};return{width:r.clientWidth-t("padding-left")-t("padding-right"),height:r.clientHeight-t("padding-top")-t("padding-bottom")}}():{width:1,height:1})},width:function e(){return this.size().width},height:function e(){return this.size().height},extent:function e(){var t=this._private.pan;var r=this._private.zoom;var a=this.renderedExtent();var n={x1:(a.x1-t.x)/r,x2:(a.x2-t.x)/r,y1:(a.y1-t.y)/r,y2:(a.y2-t.y)/r};n.w=n.x2-n.x1;n.h=n.y2-n.y1;return n},renderedExtent:function e(){var t=this.width();var r=this.height();return{x1:0,y1:0,x2:t,y2:r,w:t,h:r}},multiClickDebounceTime:function e(t){if(t)this._private.multiClickDebounceTime=t;else return this._private.multiClickDebounceTime;return this}};hf.centre=hf.center;hf.autolockNodes=hf.autolock;hf.autoungrabifyNodes=hf.autoungrabify;var pf={data:fl.data({field:"data",bindingEvent:"data",allowBinding:true,allowSetting:true,settingEvent:"data",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeData:fl.removeData({field:"data",event:"data",triggerFnName:"trigger",triggerEvent:true,updateStyle:true}),scratch:fl.data({field:"scratch",bindingEvent:"scratch",allowBinding:true,allowSetting:true,settingEvent:"scratch",settingTriggersEvent:true,triggerFnName:"trigger",allowGetting:true,updateStyle:true}),removeScratch:fl.removeData({field:"scratch",event:"scratch",triggerFnName:"trigger",triggerEvent:true,updateStyle:true})};pf.attr=pf.data;pf.removeAttr=pf.removeData;var gf=function e(t){var r=this;t=se({},t);var a=t.container;if(a&&!N(a)&&N(a[0])){a=a[0]}var n=a?a._cyreg:null;n=n||{};if(n&&n.cy){n.cy.destroy();n={}}var i=n.readies=n.readies||[];if(a){a._cyreg=n}n.cy=r;var o=w!==undefined&&a!==undefined&&!t.headless;var s=t;s.layout=se({name:o?"grid":"null"},s.layout);s.renderer=se({name:o?"canvas":"null"},s.renderer);var l=function e(t,r,a){if(r!==undefined){return r}else if(a!==undefined){return a}else{return t}};var u=this._private={container:a,ready:false,options:s,elements:new Bv(this),listeners:[],aniEles:new Bv(this),data:s.data||{},scratch:{},layout:null,renderer:null,destroyed:false,notificationsEnabled:true,minZoom:1e-50,maxZoom:1e50,zoomingEnabled:l(true,s.zoomingEnabled),userZoomingEnabled:l(true,s.userZoomingEnabled),panningEnabled:l(true,s.panningEnabled),userPanningEnabled:l(true,s.userPanningEnabled),boxSelectionEnabled:l(true,s.boxSelectionEnabled),autolock:l(false,s.autolock,s.autolockNodes),autoungrabify:l(false,s.autoungrabify,s.autoungrabifyNodes),autounselectify:l(false,s.autounselectify),styleEnabled:s.styleEnabled===undefined?o:s.styleEnabled,zoom:I(s.zoom)?s.zoom:1,pan:{x:_(s.pan)&&I(s.pan.x)?s.pan.x:0,y:_(s.pan)&&I(s.pan.y)?s.pan.y:0},animation:{current:[],queue:[]},hasCompoundNodes:false,multiClickDebounceTime:l(250,s.multiClickDebounceTime)};this.createEmitter();this.selectionType(s.selectionType);this.zoomRange({min:s.minZoom,max:s.maxZoom});var v=function e(t,r){var a=t.some(W);if(a){return si.all(t).then(r)}else{r(t)}};if(u.styleEnabled){r.setStyle([])}var f=se({},s,s.renderer);r.initRenderer(f);var c=function e(t,a,n){r.notifications(false);var i=r.mutableElements();if(i.length>0){i.remove()}if(t!=null){if(_(t)||A(t)){r.add(t)}}r.one("layoutready",(function(e){r.notifications(true);r.emit(e);r.one("load",a);r.emitAndNotify("load")})).one("layoutstop",(function(){r.one("done",n);r.emit("done")}));var o=se({},r._private.options.layout);o.eles=r.elements();r.layout(o).run()};v([s.style,s.elements],(function(e){var t=e[0];var a=e[1];if(u.styleEnabled){r.style().append(t)}c(a,(function(){r.startAnimationLoop();u.ready=true;if(B(s.ready)){r.on("ready",s.ready)}for(var e=0;e0;var s=!!e.boundingBox;var l=t.extent();var u=qr(s?e.boundingBox:{x1:l.x1,y1:l.y1,w:l.w,h:l.h});var v;if(L(e.roots)){v=e.roots}else if(A(e.roots)){var f=[];for(var c=0;c0){var I=M();var R=P(I,B);if(R){I.outgoers().filter((function(e){return e.isNode()&&r.has(e)})).forEach(_)}else if(R===null){Lt("Detected double maximal shift for node `"+I.id()+"`. Bailing maximal adjustment due to cycle. Use `options.maximal: true` only on DAGs.");break}}}var N=0;if(e.avoidOverlap){for(var O=0;O0&&m[0].length<=3?o/2:0);var v=2*Math.PI/m[n].length*i;if(n===0&&m[0].length===1){l=1}return{x:Q.x+l*Math.cos(v),y:Q.y+l*Math.sin(v)}}else{var f=m[n].length;var c=Math.max(f===1?0:s?(u.w-e.padding*2-J.w)/((e.grid?te:f)-1):(u.w-e.padding*2-J.w)/((e.grid?te:f)+1),N);var d={x:Q.x+(i+1-(f+1)/2)*c,y:Q.y+(n+1-(W+1)/2)*ee};return d}};r.nodes().layoutPositions(this,e,re);return this};var Tf={fit:true,padding:30,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,spacingFactor:undefined,radius:undefined,startAngle:3/2*Math.PI,sweep:undefined,clockwise:true,sort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function kf(e){this.options=se({},Tf,e)}kf.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var a=t.eles;var n=t.counterclockwise!==undefined?!t.counterclockwise:t.clockwise;var i=a.nodes().not(":parent");if(t.sort){i=i.sort(t.sort)}var o=qr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});var s={x:o.x1+o.w/2,y:o.y1+o.h/2};var l=t.sweep===undefined?2*Math.PI-2*Math.PI/i.length:t.sweep;var u=l/Math.max(1,i.length-1);var v;var f=0;for(var c=0;c1&&t.avoidOverlap){f*=1.75;var y=Math.cos(u)-Math.cos(0);var m=Math.sin(u)-Math.sin(0);var b=Math.sqrt(f*f/(y*y+m*m));v=Math.max(b,v)}var x=function e(r,a){var i=t.startAngle+a*u*(n?1:-1);var o=v*Math.cos(i);var l=v*Math.sin(i);var f={x:s.x+o,y:s.y+l};return f};a.nodes().layoutPositions(this,t,x);return this};var Cf={fit:true,padding:30,startAngle:3/2*Math.PI,sweep:undefined,clockwise:true,equidistant:false,minNodeSpacing:10,boundingBox:undefined,avoidOverlap:true,nodeDimensionsIncludeLabels:false,height:undefined,width:undefined,spacingFactor:undefined,concentric:function e(t){return t.degree()},levelWidth:function e(t){return t.maxDegree()/4},animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function Pf(e){this.options=se({},Cf,e)}Pf.prototype.run=function(){var e=this.options;var t=e;var r=t.counterclockwise!==undefined?!t.counterclockwise:t.clockwise;var a=e.cy;var n=t.eles;var i=n.nodes().not(":parent");var o=qr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:a.width(),h:a.height()});var s={x:o.x1+o.w/2,y:o.y1+o.h/2};var l=[];var u=0;for(var v=0;v0){var w=Math.abs(m[0].value-x.value);if(w>=g){m=[];y.push(m)}}m.push(x)}var E=u+t.minNodeSpacing;if(!t.avoidOverlap){var T=y.length>0&&y[0].length>1;var k=Math.min(o.w,o.h)/2-E;var C=k/(y.length+T?1:0);E=Math.min(E,C)}var P=0;for(var S=0;S1&&t.avoidOverlap){var _=Math.cos(A)-Math.cos(0);var M=Math.sin(A)-Math.sin(0);var I=Math.sqrt(E*E/(_*_+M*M));P=Math.max(I,P)}D.r=P;P+=E}if(t.equidistant){var R=0;var N=0;for(var L=0;L=e.numIter){return false}Of(a,e);a.temperature=a.temperature*e.coolingFactor;if(a.temperature=e.animationThreshold){i()}ft(v)}};v()}else{while(u){u=o(l);l++}Kf(a,e);s()}return this};Bf.prototype.stop=function(){this.stopped=true;if(this.thread){this.thread.stop()}this.emit("layoutstop");return this};Bf.prototype.destroy=function(){if(this.thread){this.thread.stop()}return this};var Af=function e(t,r,a){var n=a.eles.edges();var i=a.eles.nodes();var o=qr(a.boundingBox?a.boundingBox:{x1:0,y1:0,w:t.width(),h:t.height()});var s={isCompound:t.hasCompoundNodes(),layoutNodes:[],idToIndex:{},nodeSize:i.size(),graphSet:[],indexToGraph:[],layoutEdges:[],edgeSize:n.size(),temperature:a.initialTemp,clientWidth:o.w,clientHeight:o.h,boundingBox:o};var l=a.eles.components();var u={};for(var v=0;v0){s.graphSet.push(k);for(var v=0;vn.count){return 0}else{return n.graph}};var Mf=function e(t,r,a,n){var i=n.graphSet[a];if(-10){var f=n.nodeOverlap*v;var c=Math.sqrt(s*s+l*l);var d=f*s/c;var h=f*l/c}else{var p=Xf(t,s,l);var g=Xf(r,-1*s,-1*l);var y=g.x-p.x;var m=g.y-p.y;var b=y*y+m*m;var c=Math.sqrt(b);var f=(t.nodeRepulsion+r.nodeRepulsion)/b;var d=f*y/c;var h=f*m/c}if(!t.isLocked){t.offsetX-=d;t.offsetY-=h}if(!r.isLocked){r.offsetX+=d;r.offsetY+=h}return};var jf=function e(t,r,a,n){if(a>0){var i=t.maxX-r.minX}else{var i=r.maxX-t.minX}if(n>0){var o=t.maxY-r.minY}else{var o=r.maxY-t.minY}if(i>=0&&o>=0){return Math.sqrt(i*i+o*o)}else{return 0}};var Xf=function e(t,r,a){var n=t.positionX;var i=t.positionY;var o=t.height||1;var s=t.width||1;var l=a/r;var u=o/s;var v={};if(0===r&&0a){v.x=n;v.y=i+o/2;return v}if(0r&&-1*u<=l&&l<=u){v.x=n-s/2;v.y=i-s*a/2/r;return v}if(0=u)){v.x=n+o*r/2/a;v.y=i+o/2;return v}if(0>a&&(l<=-1*u||l>=u)){v.x=n-o*r/2/a;v.y=i-o/2;return v}return v};var Yf=function e(t,r){for(var a=0;aa){var g=r.gravity*d/p;var y=r.gravity*h/p;c.offsetX+=g;c.offsetY+=y}}}};var Wf=function e(t,r){var a=[];var n=0;var i=-1;a.push.apply(a,t.graphSet[0]);i+=t.graphSet[0].length;while(n<=i){var o=a[n++];var s=t.idToIndex[o];var l=t.layoutNodes[s];var u=l.children;if(0a){var i={x:a*t/n,y:a*r/n}}else{var i={x:t,y:r}}return i};var Hf=function e(t,r){var a=t.parentId;if(null==a){return}var n=r.layoutNodes[r.idToIndex[a]];var i=false;if(null==n.maxX||t.maxX+n.padRight>n.maxX){n.maxX=t.maxX+n.padRight;i=true}if(null==n.minX||t.minX-n.padLeftn.maxY){n.maxY=t.maxY+n.padBottom;i=true}if(null==n.minY||t.minY-n.padTopy){h+=g+r.componentSpacing;d=0;p=0;g=0}}};var Zf={fit:true,padding:30,boundingBox:undefined,avoidOverlap:true,avoidOverlapPadding:10,nodeDimensionsIncludeLabels:false,spacingFactor:undefined,condense:false,rows:undefined,cols:undefined,position:function e(t){},sort:undefined,animate:false,animationDuration:500,animationEasing:undefined,animateFilter:function e(t,r){return true},ready:undefined,stop:undefined,transform:function e(t,r){return r}};function $f(e){this.options=se({},Zf,e)}$f.prototype.run=function(){var e=this.options;var t=e;var r=e.cy;var a=t.eles;var n=a.nodes().not(":parent");if(t.sort){n=n.sort(t.sort)}var i=qr(t.boundingBox?t.boundingBox:{x1:0,y1:0,w:r.width(),h:r.height()});if(i.h===0||i.w===0){a.nodes().layoutPositions(this,t,(function(e){return{x:i.x1,y:i.y1}}))}else{var o=n.size();var s=Math.sqrt(o*i.h/i.w);var l=Math.round(s);var u=Math.round(i.w/i.h*s);var v=function e(t){if(t==null){return Math.min(l,u)}else{var r=Math.min(l,u);if(r==l){l=t}else{u=t}}};var f=function e(t){if(t==null){return Math.max(l,u)}else{var r=Math.max(l,u);if(r==l){l=t}else{u=t}}};var c=t.rows;var d=t.cols!=null?t.cols:t.columns;if(c!=null&&d!=null){l=c;u=d}else if(c!=null&&d==null){l=c;u=Math.ceil(o/l)}else if(c==null&&d!=null){u=d;l=Math.ceil(o/u)}else if(u*l>o){var h=v();var p=f();if((h-1)*p>=o){v(h-1)}else if((p-1)*h>=o){f(p-1)}}else{while(u*l=o){f(y+1)}else{v(g+1)}}}var m=i.w/u;var b=i.h/l;if(t.condense){m=0;b=0}if(t.avoidOverlap){for(var x=0;x=u){_=0;A++}};var I={};for(var R=0;R(b=ua(e,t,x[w],x[w+1],x[w+2],x[w+3]))){g(r,b);return true}}}else if(o.edgeType==="bezier"||o.edgeType==="multibezier"||o.edgeType==="self"||o.edgeType==="compound"){var x=o.allpts;for(var w=0;w+5(b=la(e,t,x[w],x[w+1],x[w+2],x[w+3],x[w+4],x[w+5]))){g(r,b);return true}}}var p=p||a.source;var m=m||a.target;var E=n.getArrowWidth(l,f);var T=[{name:"source",x:o.arrowStartX,y:o.arrowStartY,angle:o.srcArrowAngle},{name:"target",x:o.arrowEndX,y:o.arrowEndY,angle:o.tgtArrowAngle},{name:"mid-source",x:o.midX,y:o.midY,angle:o.midsrcArrowAngle},{name:"mid-target",x:o.midX,y:o.midY,angle:o.midtgtArrowAngle}];for(var w=0;w0){y(p);y(m)}}function b(e,t,r){return Gt(e,t,r)}function x(r,a){var n=r._private;var i=c;var o;if(a){o=a+"-"}else{o=""}r.boundingBox();var s=n.labelBounds[a||"main"];var l=r.pstyle(o+"label").value;var u=r.pstyle("text-events").strValue==="yes";if(!u||!l){return}var v=b(n.rscratch,"labelX",a);var f=b(n.rscratch,"labelY",a);var d=b(n.rscratch,"labelAngle",a);var h=r.pstyle(o+"text-margin-x").pfValue;var p=r.pstyle(o+"text-margin-y").pfValue;var y=s.x1-i-h;var m=s.x2+i-h;var x=s.y1-i-p;var w=s.y2+i-p;if(d){var E=Math.cos(d);var T=Math.sin(d);var k=function e(t,r){t=t-v;r=r-f;return{x:t*E-r*T+v,y:t*T+r*E+f}};var C=k(y,x);var P=k(y,w);var S=k(m,x);var D=k(m,w);var B=[C.x+h,C.y+p,S.x+h,S.y+p,D.x+h,D.y+p,P.x+h,P.y+p];if(va(e,t,B)){g(r);return true}}else{if(ea(s,e,t)){g(r);return true}}}for(var w=o.length-1;w>=0;w--){var E=o[w];if(E.isNode()){y(E)||x(E)}else{m(E)||x(E)||x(E,"source")||x(E,"target")}}return s};uc.getAllInBox=function(e,t,r,a){var n=this.getCachedZSortedEles().interactive;var i=[];var o=Math.min(e,r);var s=Math.max(e,r);var l=Math.min(t,a);var u=Math.max(t,a);e=o;r=s;t=l;a=u;var v=qr({x1:e,y1:t,x2:r,y2:a});for(var f=0;f0?-(Math.PI-t.ang):Math.PI+t.ang};var Mc=function e(t,r,a,n,i){t!==Bc?Ac(r,t,dc):_c(hc,dc);Ac(r,a,hc);pc=dc.nx*hc.ny-dc.ny*hc.nx;gc=dc.nx*hc.nx-dc.ny*-hc.ny;bc=Math.asin(Math.max(-1,Math.min(1,pc)));if(Math.abs(bc)<1e-6){fc=r.x;cc=r.y;wc=Tc=0;return}yc=1;mc=false;if(gc<0){if(bc<0){bc=Math.PI+bc}else{bc=Math.PI-bc;yc=-1;mc=true}}else{if(bc>0){yc=-1;mc=true}}if(r.radius!==undefined){Tc=r.radius}else{Tc=n}xc=bc/2;kc=Math.min(dc.len/2,hc.len/2);if(i){Ec=Math.abs(Math.cos(xc)*Tc/Math.sin(xc));if(Ec>kc){Ec=kc;wc=Math.abs(Ec*Math.sin(xc)/Math.cos(xc))}else{wc=Tc}}else{Ec=Math.min(kc,Tc);wc=Math.abs(Ec*Math.sin(xc)/Math.cos(xc))}Sc=r.x+hc.nx*Ec;Dc=r.y+hc.ny*Ec;fc=Sc-hc.ny*wc*yc;cc=Dc+hc.nx*wc*yc;Cc=r.x+dc.nx*Ec;Pc=r.y+dc.ny*Ec;Bc=r};function Ic(e,t){if(t.radius===0)e.lineTo(t.cx,t.cy);else e.arc(t.cx,t.cy,t.radius,t.startAngle,t.endAngle,t.counterClockwise)}function Rc(e,t,r,a){var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;if(a===0||t.radius===0)return{cx:t.x,cy:t.y,radius:0,startX:t.x,startY:t.y,stopX:t.x,stopY:t.y,startAngle:undefined,endAngle:undefined,counterClockwise:undefined};Mc(e,t,r,a,n);return{cx:fc,cy:cc,radius:wc,startX:Cc,startY:Pc,stopX:Sc,stopY:Dc,startAngle:dc.ang+Math.PI/2*yc,endAngle:hc.ang-Math.PI/2*yc,counterClockwise:mc}}var Nc={};Nc.findMidptPtsEtc=function(e,t){var r=t.posPts,a=t.intersectionPts,n=t.vectorNormInverse;var i;var o=e.pstyle("source-endpoint");var s=e.pstyle("target-endpoint");var l=o.units!=null&&s.units!=null;var u=function e(t,r,a,n){var i=n-r;var o=a-t;var s=Math.sqrt(o*o+i*i);return{x:-i/s,y:o/s}};var v=e.pstyle("edge-distances").value;switch(v){case"node-position":i=r;break;case"intersection":i=a;break;case"endpoints":{if(l){var f=this.manualEndptToPx(e.source()[0],o),c=p(f,2),d=c[0],h=c[1];var g=this.manualEndptToPx(e.target()[0],s),y=p(g,2),m=y[0],b=y[1];var x={x1:d,y1:h,x2:m,y2:b};n=u(d,h,m,b);i=x}else{Lt("Edge ".concat(e.id()," has edge-distances:endpoints specified without manual endpoints specified via source-endpoint and target-endpoint. Falling back on edge-distances:intersection (default)."));i=a}break}}return{midptPts:i,vectorNormInverse:n}};Nc.findHaystackPoints=function(e){for(var t=0;t0){return Math.max(t-r,0)}else{return Math.min(t+r,0)}};var B=D(P,k);var A=D(S,C);var _=false;if(m===u){y=Math.abs(B)>Math.abs(A)?n:a}else if(m===l||m===s){y=a;_=true}else if(m===i||m===o){y=n;_=true}var M=y===a;var I=M?A:B;var R=M?S:P;var N=Lr(R);var L=false;if(!(_&&(x||E))&&(m===s&&R<0||m===l&&R>0||m===i&&R>0||m===o&&R<0)){N*=-1;I=N*Math.abs(I);L=true}var O;if(x){var z=w<0?1+w:w;O=z*I}else{var F=w<0?I:0;O=F+w*N}var V=function e(t){return Math.abs(t)=Math.abs(I)};var j=V(O);var X=V(Math.abs(I)-Math.abs(O));var Y=j||X;if(Y&&!L){if(M){var q=Math.abs(R)<=c/2;var W=Math.abs(P)<=d/2;if(q){var U=(v.x1+v.x2)/2;var G=v.y1,H=v.y2;r.segpts=[U,G,U,H]}else if(W){var K=(v.y1+v.y2)/2;var Z=v.x1,$=v.x2;r.segpts=[Z,K,$,K]}else{r.segpts=[v.x1,v.y2]}}else{var Q=Math.abs(R)<=f/2;var J=Math.abs(S)<=h/2;if(Q){var ee=(v.y1+v.y2)/2;var te=v.x1,re=v.x2;r.segpts=[te,ee,re,ee]}else if(J){var ae=(v.x1+v.x2)/2;var ne=v.y1,ie=v.y2;r.segpts=[ae,ne,ae,ie]}else{r.segpts=[v.x2,v.y1]}}}else{if(M){var oe=v.y1+O+(g?c/2*N:0);var se=v.x1,le=v.x2;r.segpts=[se,oe,le,oe]}else{var ue=v.x1+O+(g?f/2*N:0);var ve=v.y1,fe=v.y2;r.segpts=[ue,ve,ue,fe]}}if(r.isRound){var ce=e.pstyle("taxi-radius").value;var de=e.pstyle("radius-type").value[0]==="arc-radius";r.radii=new Array(r.segpts.length/2).fill(ce);r.isArcRadius=new Array(r.segpts.length/2).fill(de)}};Nc.tryToCorrectInvalidPoints=function(e,t){var r=e._private.rscratch;if(r.edgeType==="bezier"){var a=t.srcPos,n=t.tgtPos,i=t.srcW,o=t.srcH,s=t.tgtW,l=t.tgtH,u=t.srcShape,v=t.tgtShape,f=t.srcCornerRadius,c=t.tgtCornerRadius,d=t.srcRs,h=t.tgtRs;var p=!I(r.startX)||!I(r.startY);var g=!I(r.arrowStartX)||!I(r.arrowStartY);var y=!I(r.endX)||!I(r.endY);var m=!I(r.arrowEndX)||!I(r.arrowEndY);var b=3;var x=this.getArrowWidth(e.pstyle("width").pfValue,e.pstyle("arrow-scale").value)*this.arrowShapeWidth;var w=b*x;var E=Or({x:r.ctrlpts[0],y:r.ctrlpts[1]},{x:r.startX,y:r.startY});var T=Eg.poolIndex()){var y=p;p=g;g=y}var m=f.srcPos=p.position();var b=f.tgtPos=g.position();var x=f.srcW=p.outerWidth();var w=f.srcH=p.outerHeight();var E=f.tgtW=g.outerWidth();var T=f.tgtH=g.outerHeight();var C=f.srcShape=r.nodeShapes[t.getNodeShape(p)];var P=f.tgtShape=r.nodeShapes[t.getNodeShape(g)];var S=f.srcCornerRadius=p.pstyle("corner-radius").value==="auto"?"auto":p.pstyle("corner-radius").pfValue;var D=f.tgtCornerRadius=g.pstyle("corner-radius").value==="auto"?"auto":g.pstyle("corner-radius").pfValue;var B=f.tgtRs=g._private.rscratch;var A=f.srcRs=p._private.rscratch;f.dirCounts={north:0,west:0,south:0,east:0,northwest:0,southwest:0,northeast:0,southeast:0};for(var _=0;_0){var K=i;var Z=zr(K,Dr(r));var $=zr(K,Dr(H));var Q=Z;if($2){var J=zr(K,{x:H[2],y:H[3]});if(J0){var ce=o;var de=zr(ce,Dr(r));var he=zr(ce,Dr(fe));var pe=de;if(he2){var ge=zr(ce,{x:fe[2],y:fe[3]});if(ge=v||b){c={cp:g,segment:m};break}}if(c){break}}var x=c.cp;var w=c.segment;var E=(v-d)/w.length;var T=w.t1-w.t0;var k=u?w.t0+T*E:w.t1-T*E;k=Yr(0,k,1);t=jr(x.p0,x.p1,x.p2,k);s=Yc(x.p0,x.p1,x.p2,k);break}case"straight":case"segments":case"haystack":{var C=0,P,S;var D,B;var A=a.allpts.length;for(var _=0;_+3=v){break}}var M=v-S;var I=M/P;I=Yr(0,I,1);t=Xr(D,B,I);s=Xc(D,B);break}}o("labelX",n,t.x);o("labelY",n,t.y);o("labelAutoAngle",n,s)};u("source");u("target");this.applyLabelDimensions(e)};Vc.applyLabelDimensions=function(e){this.applyPrefixedLabelDimensions(e);if(e.isEdge()){this.applyPrefixedLabelDimensions(e,"source");this.applyPrefixedLabelDimensions(e,"target")}};Vc.applyPrefixedLabelDimensions=function(e,t){var r=e._private;var a=this.getLabelText(e,t);var n=this.calculateLabelDimensions(e,a);var i=e.pstyle("line-height").pfValue;var o=e.pstyle("text-wrap").strValue;var s=Gt(r.rscratch,"labelWrapCachedLines",t)||[];var l=o!=="wrap"?1:Math.max(s.length,1);var u=n.height/l;var v=u*i;var f=n.width;var c=n.height+(l-1)*(i-1)*u;Ht(r.rstyle,"labelWidth",t,f);Ht(r.rscratch,"labelWidth",t,f);Ht(r.rstyle,"labelHeight",t,c);Ht(r.rscratch,"labelHeight",t,c);Ht(r.rscratch,"labelLineHeight",t,v)};Vc.getLabelText=function(e,t){var r=e._private;var a=t?t+"-":"";var n=e.pstyle(a+"label").strValue;var i=e.pstyle("text-transform").value;var o=function e(a,n){if(n){Ht(r.rscratch,a,t,n);return n}else{return Gt(r.rscratch,a,t)}};if(!n){return""}if(i=="none");else if(i=="uppercase"){n=n.toUpperCase()}else if(i=="lowercase"){n=n.toLowerCase()}var s=e.pstyle("text-wrap").value;if(s==="wrap"){var l=o("labelKey");if(l!=null&&o("labelWrapKey")===l){return o("labelWrapCachedText")}var v="​";var f=n.split("\n");var c=e.pstyle("text-max-width").pfValue;var d=e.pstyle("text-overflow-wrap").value;var h=d==="anywhere";var p=[];var g=/[\s\u200b]+|$/g;for(var y=0;yc){var E=m.matchAll(g);var T="";var k=0;var C=u(E),P;try{for(C.s();!(P=C.n()).done;){var S=P.value;var D=S[0];var B=m.substring(k,S.index);k=S.index+D.length;var A=T.length===0?B:T+B+D;var _=this.calculateLabelDimensions(e,A);var M=_.width;if(M<=c){T+=B+D}else{if(T){p.push(T)}T=B+D}}}catch(F){C.e(F)}finally{C.f()}if(!T.match(/^[\s\u200b]+$/)){p.push(T)}}else{p.push(m)}}o("labelWrapCachedLines",p);n=o("labelWrapCachedText",p.join("\n"));o("labelWrapKey",l)}else if(s==="ellipsis"){var I=e.pstyle("text-max-width").pfValue;var R="";var N="…";var L=false;if(this.calculateLabelDimensions(e,n).widthI){break}R+=n[O];if(O===n.length-1){L=true}}if(!L){R+=N}return R}return n};Vc.getLabelJustification=function(e){var t=e.pstyle("text-justification").strValue;var r=e.pstyle("text-halign").strValue;if(t==="auto"){if(e.isNode()){switch(r){case"left":return"right";case"right":return"left";default:return"center"}}else{return"center"}}else{return t}};Vc.calculateLabelDimensions=function(e,t){var r=this;var a=r.cy.window();var n=a.document;var i=Tt(t,e._private.labelDimsKey);var o=r.labelDimCache||(r.labelDimCache=[]);var s=o[i];if(s!=null){return s}var l=0;var u=e.pstyle("font-style").strValue;var v=e.pstyle("font-size").pfValue;var f=e.pstyle("font-family").strValue;var c=e.pstyle("font-weight").strValue;var d=this.labelCalcCanvas;var h=this.labelCalcCanvasContext;if(!d){d=this.labelCalcCanvas=n.createElement("canvas");h=this.labelCalcCanvasContext=d.getContext("2d");var p=d.style;p.position="absolute";p.left="-9999px";p.top="-9999px";p.zIndex="-1";p.visibility="hidden";p.pointerEvents="none"}h.font="".concat(u," ").concat(c," ").concat(v,"px ").concat(f);var g=0;var y=0;var m=t.split("\n");for(var b=0;b1&&arguments[1]!==undefined?arguments[1]:true;t.merge(r);if(a){for(var n=0;n=e.desktopTapThreshold2}var B=i(r);if(E){e.hoverData.tapholdCancelled=true}var A=function t(){var r=e.hoverData.dragDelta=e.hoverData.dragDelta||[];if(r.length===0){r.push(x[0]);r.push(x[1])}else{r[0]+=x[0];r[1]+=x[1]}};s=true;n(g,["mousemove","vmousemove","tapdrag"],r,{x:f[0],y:f[1]});var _=function t(){e.data.bgActivePosistion=undefined;if(!e.hoverData.selecting){l.emit({originalEvent:r,type:"boxstart",position:{x:f[0],y:f[1]}})}h[4]=1;e.hoverData.selecting=true;e.redrawHint("select",true);e.redraw()};if(e.hoverData.which===3){if(E){var M={originalEvent:r,type:"cxtdrag",position:{x:f[0],y:f[1]}};if(b){b.emit(M)}else{l.emit(M)}e.hoverData.cxtDragged=true;if(!e.hoverData.cxtOver||g!==e.hoverData.cxtOver){if(e.hoverData.cxtOver){e.hoverData.cxtOver.emit({originalEvent:r,type:"cxtdragout",position:{x:f[0],y:f[1]}})}e.hoverData.cxtOver=g;if(g){g.emit({originalEvent:r,type:"cxtdragover",position:{x:f[0],y:f[1]}})}}}}else if(e.hoverData.dragging){s=true;if(l.panningEnabled()&&l.userPanningEnabled()){var R;if(e.hoverData.justStartedPan){var N=e.hoverData.mdownPos;R={x:(f[0]-N[0])*u,y:(f[1]-N[1])*u};e.hoverData.justStartedPan=false}else{R={x:x[0]*u,y:x[1]*u}}l.panBy(R);l.emit("dragpan");e.hoverData.dragged=true}f=e.projectIntoViewport(r.clientX,r.clientY)}else if(h[4]==1&&(b==null||b.pannable())){if(E){if(!e.hoverData.dragging&&l.boxSelectionEnabled()&&(B||!l.panningEnabled()||!l.userPanningEnabled())){_()}else if(!e.hoverData.selecting&&l.panningEnabled()&&l.userPanningEnabled()){var L=o(b,e.hoverData.downs);if(L){e.hoverData.dragging=true;e.hoverData.justStartedPan=true;h[4]=0;e.data.bgActivePosistion=Dr(c);e.redrawHint("select",true);e.redraw()}}if(b&&b.pannable()&&b.active()){b.unactivate()}}}else{if(b&&b.pannable()&&b.active()){b.unactivate()}if((!b||!b.grabbed())&&g!=m){if(m){n(m,["mouseout","tapdragout"],r,{x:f[0],y:f[1]})}if(g){n(g,["mouseover","tapdragover"],r,{x:f[0],y:f[1]})}e.hoverData.last=g}if(b){if(E){if(l.boxSelectionEnabled()&&B){if(b&&b.grabbed()){y(w);b.emit("freeon");w.emit("free");if(e.dragData.didDrag){b.emit("dragfreeon");w.emit("dragfree")}}_()}else if(b&&b.grabbed()&&e.nodeIsDraggable(b)){var O=!e.dragData.didDrag;if(O){e.redrawHint("eles",true)}e.dragData.didDrag=true;if(!e.hoverData.draggingEles){p(w,{inDragLayer:true})}var z={x:0,y:0};if(I(x[0])&&I(x[1])){z.x+=x[0];z.y+=x[1];if(O){var F=e.hoverData.dragDelta;if(F&&I(F[0])&&I(F[1])){z.x+=F[0];z.y+=F[1]}}}e.hoverData.draggingEles=true;w.silentShift(z).emit("position drag");e.redrawHint("drag",true);e.redraw()}}else{A()}}s=true}h[2]=f[0];h[3]=f[1];if(s){if(r.stopPropagation)r.stopPropagation();if(r.preventDefault)r.preventDefault();return false}}),false);var D,B,A;e.registerBinding(t,"mouseup",(function t(a){if(e.hoverData.which===1&&a.which!==1&&e.hoverData.capture){return}var o=e.hoverData.capture;if(!o){return}e.hoverData.capture=false;var s=e.cy;var l=e.projectIntoViewport(a.clientX,a.clientY);var u=e.selection;var v=e.findNearestElement(l[0],l[1],true,false);var f=e.dragData.possibleDragElements;var c=e.hoverData.down;var d=i(a);if(e.data.bgActivePosistion){e.redrawHint("select",true);e.redraw()}e.hoverData.tapholdCancelled=true;e.data.bgActivePosistion=undefined;if(c){c.unactivate()}if(e.hoverData.which===3){var h={originalEvent:a,type:"cxttapend",position:{x:l[0],y:l[1]}};if(c){c.emit(h)}else{s.emit(h)}if(!e.hoverData.cxtDragged){var p={originalEvent:a,type:"cxttap",position:{x:l[0],y:l[1]}};if(c){c.emit(p)}else{s.emit(p)}}e.hoverData.cxtDragged=false;e.hoverData.which=null}else if(e.hoverData.which===1){n(v,["mouseup","tapend","vmouseup"],a,{x:l[0],y:l[1]});if(!e.dragData.didDrag&&!e.hoverData.dragged&&!e.hoverData.selecting&&!e.hoverData.isOverThresholdDrag){n(c,["click","tap","vclick"],a,{x:l[0],y:l[1]});B=false;if(a.timeStamp-A<=s.multiClickDebounceTime()){D&&clearTimeout(D);B=true;A=null;n(c,["dblclick","dbltap","vdblclick"],a,{x:l[0],y:l[1]})}else{D=setTimeout((function(){if(B)return;n(c,["oneclick","onetap","voneclick"],a,{x:l[0],y:l[1]})}),s.multiClickDebounceTime());A=a.timeStamp}}if(c==null&&!e.dragData.didDrag&&!e.hoverData.selecting&&!e.hoverData.dragged&&!i(a)){s.$(r).unselect(["tapunselect"]);if(f.length>0){e.redrawHint("eles",true)}e.dragData.possibleDragElements=f=s.collection()}if(v==c&&!e.dragData.didDrag&&!e.hoverData.selecting){if(v!=null&&v._private.selectable){if(e.hoverData.dragging);else if(s.selectionType()==="additive"||d){if(v.selected()){v.unselect(["tapunselect"])}else{v.select(["tapselect"])}}else{if(!d){s.$(r).unmerge(v).unselect(["tapunselect"]);v.select(["tapselect"])}}e.redrawHint("eles",true)}}if(e.hoverData.selecting){var g=s.collection(e.getAllInBox(u[0],u[1],u[2],u[3]));e.redrawHint("select",true);if(g.length>0){e.redrawHint("eles",true)}s.emit({type:"boxend",originalEvent:a,position:{x:l[0],y:l[1]}});var m=function e(t){return t.selectable()&&!t.selected()};if(s.selectionType()==="additive"){g.emit("box").stdFilter(m).select().emit("boxselect")}else{if(!d){s.$(r).unmerge(g).unselect()}g.emit("box").stdFilter(m).select().emit("boxselect")}e.redraw()}if(e.hoverData.dragging){e.hoverData.dragging=false;e.redrawHint("select",true);e.redrawHint("eles",true);e.redraw()}if(!u[4]){e.redrawHint("drag",true);e.redrawHint("eles",true);var b=c&&c.grabbed();y(f);if(b){c.emit("freeon");f.emit("free");if(e.dragData.didDrag){c.emit("dragfreeon");f.emit("dragfree")}}}}u[4]=0;e.hoverData.down=null;e.hoverData.cxtStarted=false;e.hoverData.draggingEles=false;e.hoverData.selecting=false;e.hoverData.isOverThresholdDrag=false;e.dragData.didDrag=false;e.hoverData.dragged=false;e.hoverData.dragDelta=[];e.hoverData.mdownPos=null;e.hoverData.mdownGPos=null;e.hoverData.which=null}),false);var _=function t(r){if(e.scrollingPage){return}var a=e.cy;var n=a.zoom();var i=a.pan();var o=e.projectIntoViewport(r.clientX,r.clientY);var s=[o[0]*n+i.x,o[1]*n+i.y];if(e.hoverData.draggingEles||e.hoverData.dragging||e.hoverData.cxtStarted||C()){r.preventDefault();return}if(a.panningEnabled()&&a.userPanningEnabled()&&a.zoomingEnabled()&&a.userZoomingEnabled()){r.preventDefault();e.data.wheelZooming=true;clearTimeout(e.data.wheelTimeout);e.data.wheelTimeout=setTimeout((function(){e.data.wheelZooming=false;e.redrawHint("eles",true);e.redraw()}),150);var l;if(r.deltaY!=null){l=r.deltaY/-250}else if(r.wheelDeltaY!=null){l=r.wheelDeltaY/1e3}else{l=r.wheelDelta/1e3}l=l*e.wheelSensitivity;var u=r.deltaMode===1;if(u){l*=33}var v=a.zoom()*Math.pow(10,l);if(r.type==="gesturechange"){v=e.gestureStartZoom*r.scale}a.zoom({level:v,renderedPosition:{x:s[0],y:s[1]}});a.emit(r.type==="gesturechange"?"pinchzoom":"scrollzoom")}};e.registerBinding(e.container,"wheel",_,true);e.registerBinding(t,"scroll",(function t(r){e.scrollingPage=true;clearTimeout(e.scrollingPageTimeout);e.scrollingPageTimeout=setTimeout((function(){e.scrollingPage=false}),250)}),true);e.registerBinding(e.container,"gesturestart",(function t(r){e.gestureStartZoom=e.cy.zoom();if(!e.hasTouchStarted){r.preventDefault()}}),true);e.registerBinding(e.container,"gesturechange",(function(t){if(!e.hasTouchStarted){_(t)}}),true);e.registerBinding(e.container,"mouseout",(function t(r){var a=e.projectIntoViewport(r.clientX,r.clientY);e.cy.emit({originalEvent:r,type:"mouseout",position:{x:a[0],y:a[1]}})}),false);e.registerBinding(e.container,"mouseover",(function t(r){var a=e.projectIntoViewport(r.clientX,r.clientY);e.cy.emit({originalEvent:r,type:"mouseover",position:{x:a[0],y:a[1]}})}),false);var M,R,N,L;var O,z;var F,V;var j,X;var Y,q;var W;var U=function e(t,r,a,n){return Math.sqrt((a-t)*(a-t)+(n-r)*(n-r))};var G=function e(t,r,a,n){return(a-t)*(a-t)+(n-r)*(n-r)};var H;e.registerBinding(e.container,"touchstart",H=function t(r){e.hasTouchStarted=true;if(!P(r)){return}b();e.touchData.capture=true;e.data.bgActivePosistion=undefined;var a=e.cy;var i=e.touchData.now;var o=e.touchData.earlier;if(r.touches[0]){var s=e.projectIntoViewport(r.touches[0].clientX,r.touches[0].clientY);i[0]=s[0];i[1]=s[1]}if(r.touches[1]){var s=e.projectIntoViewport(r.touches[1].clientX,r.touches[1].clientY);i[2]=s[0];i[3]=s[1]}if(r.touches[2]){var s=e.projectIntoViewport(r.touches[2].clientX,r.touches[2].clientY);i[4]=s[0];i[5]=s[1]}if(r.touches[1]){e.touchData.singleTouchMoved=true;y(e.dragData.touchDragEles);var l=e.findContainerClientCoords();j=l[0];X=l[1];Y=l[2];q=l[3];M=r.touches[0].clientX-j;R=r.touches[0].clientY-X;N=r.touches[1].clientX-j;L=r.touches[1].clientY-X;W=0<=M&&M<=Y&&0<=N&&N<=Y&&0<=R&&R<=q&&0<=L&&L<=q;var u=a.pan();var v=a.zoom();O=U(M,R,N,L);z=G(M,R,N,L);F=[(M+N)/2,(R+L)/2];V=[(F[0]-u.x)/v,(F[1]-u.y)/v];var c=200;var d=c*c;if(z=1){var C=e.touchData.startPosition=[null,null,null,null,null,null];for(var S=0;S=e.touchTapThreshold2}if(a&&e.touchData.cxt){r.preventDefault();var T=r.touches[0].clientX-j,k=r.touches[0].clientY-X;var C=r.touches[1].clientX-j,S=r.touches[1].clientY-X;var D=G(T,k,C,S);var B=D/z;var A=150;var _=A*A;var F=1.5;var Y=F*F;if(B>=Y||D>=_){e.touchData.cxt=false;e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var q={originalEvent:r,type:"cxttapend",position:{x:l[0],y:l[1]}};if(e.touchData.start){e.touchData.start.unactivate().emit(q);e.touchData.start=null}else{s.emit(q)}}}if(a&&e.touchData.cxt){var q={originalEvent:r,type:"cxtdrag",position:{x:l[0],y:l[1]}};e.data.bgActivePosistion=undefined;e.redrawHint("select",true);if(e.touchData.start){e.touchData.start.emit(q)}else{s.emit(q)}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxtDragged=true;var H=e.findNearestElement(l[0],l[1],true,true);if(!e.touchData.cxtOver||H!==e.touchData.cxtOver){if(e.touchData.cxtOver){e.touchData.cxtOver.emit({originalEvent:r,type:"cxtdragout",position:{x:l[0],y:l[1]}})}e.touchData.cxtOver=H;if(H){H.emit({originalEvent:r,type:"cxtdragover",position:{x:l[0],y:l[1]}})}}}else if(a&&r.touches[2]&&s.boxSelectionEnabled()){r.preventDefault();e.data.bgActivePosistion=undefined;this.lastThreeTouch=+new Date;if(!e.touchData.selecting){s.emit({originalEvent:r,type:"boxstart",position:{x:l[0],y:l[1]}})}e.touchData.selecting=true;e.touchData.didSelect=true;i[4]=1;if(!i||i.length===0||i[0]===undefined){i[0]=(l[0]+l[2]+l[4])/3;i[1]=(l[1]+l[3]+l[5])/3;i[2]=(l[0]+l[2]+l[4])/3+1;i[3]=(l[1]+l[3]+l[5])/3+1}else{i[2]=(l[0]+l[2]+l[4])/3;i[3]=(l[1]+l[3]+l[5])/3}e.redrawHint("select",true);e.redraw()}else if(a&&r.touches[1]&&!e.touchData.didSelect&&s.zoomingEnabled()&&s.panningEnabled()&&s.userZoomingEnabled()&&s.userPanningEnabled()){r.preventDefault();e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var K=e.dragData.touchDragEles;if(K){e.redrawHint("drag",true);for(var Z=0;Z0&&!e.hoverData.draggingEles&&!e.swipePanning&&e.data.bgActivePosistion!=null){e.data.bgActivePosistion=undefined;e.redrawHint("select",true);e.redraw()}},false);var Z;e.registerBinding(t,"touchcancel",Z=function t(r){var a=e.touchData.start;e.touchData.capture=false;if(a){a.unactivate()}});var $,Q,J,ee;e.registerBinding(t,"touchend",$=function t(a){var i=e.touchData.start;var o=e.touchData.capture;if(o){if(a.touches.length===0){e.touchData.capture=false}a.preventDefault()}else{return}var s=e.selection;e.swipePanning=false;e.hoverData.draggingEles=false;var l=e.cy;var u=l.zoom();var v=e.touchData.now;var f=e.touchData.earlier;if(a.touches[0]){var c=e.projectIntoViewport(a.touches[0].clientX,a.touches[0].clientY);v[0]=c[0];v[1]=c[1]}if(a.touches[1]){var c=e.projectIntoViewport(a.touches[1].clientX,a.touches[1].clientY);v[2]=c[0];v[3]=c[1]}if(a.touches[2]){var c=e.projectIntoViewport(a.touches[2].clientX,a.touches[2].clientY);v[4]=c[0];v[5]=c[1]}if(i){i.unactivate()}var d;if(e.touchData.cxt){d={originalEvent:a,type:"cxttapend",position:{x:v[0],y:v[1]}};if(i){i.emit(d)}else{l.emit(d)}if(!e.touchData.cxtDragged){var h={originalEvent:a,type:"cxttap",position:{x:v[0],y:v[1]}};if(i){i.emit(h)}else{l.emit(h)}}if(e.touchData.start){e.touchData.start._private.grabbed=false}e.touchData.cxt=false;e.touchData.start=null;e.redraw();return}if(!a.touches[2]&&l.boxSelectionEnabled()&&e.touchData.selecting){e.touchData.selecting=false;var p=l.collection(e.getAllInBox(s[0],s[1],s[2],s[3]));s[0]=undefined;s[1]=undefined;s[2]=undefined;s[3]=undefined;s[4]=0;e.redrawHint("select",true);l.emit({type:"boxend",originalEvent:a,position:{x:v[0],y:v[1]}});var g=function e(t){return t.selectable()&&!t.selected()};p.emit("box").stdFilter(g).select().emit("boxselect");if(p.nonempty()){e.redrawHint("eles",true)}e.redraw()}if(i!=null){i.unactivate()}if(a.touches[2]){e.data.bgActivePosistion=undefined;e.redrawHint("select",true)}else if(a.touches[1]);else if(a.touches[0]);else if(!a.touches[0]){e.data.bgActivePosistion=undefined;e.redrawHint("select",true);var m=e.dragData.touchDragEles;if(i!=null){var b=i._private.grabbed;y(m);e.redrawHint("drag",true);e.redrawHint("eles",true);if(b){i.emit("freeon");m.emit("free");if(e.dragData.didDrag){i.emit("dragfreeon");m.emit("dragfree")}}n(i,["touchend","tapend","vmouseup","tapdragout"],a,{x:v[0],y:v[1]});i.unactivate();e.touchData.start=null}else{var x=e.findNearestElement(v[0],v[1],true,true);n(x,["touchend","tapend","vmouseup","tapdragout"],a,{x:v[0],y:v[1]})}var w=e.touchData.startPosition[0]-v[0];var E=w*w;var T=e.touchData.startPosition[1]-v[1];var k=T*T;var C=E+k;var P=C*u*u;if(!e.touchData.singleTouchMoved){if(!i){l.$(":selected").unselect(["tapunselect"])}n(i,["tap","vclick"],a,{x:v[0],y:v[1]});Q=false;if(a.timeStamp-ee<=l.multiClickDebounceTime()){J&&clearTimeout(J);Q=true;ee=null;n(i,["dbltap","vdblclick"],a,{x:v[0],y:v[1]})}else{J=setTimeout((function(){if(Q)return;n(i,["onetap","voneclick"],a,{x:v[0],y:v[1]})}),l.multiClickDebounceTime());ee=a.timeStamp}}if(i!=null&&!e.dragData.didDrag&&i._private.selectable&&P0){return p[0]}}return null};var h=Object.keys(c);for(var p=0;p0){return d}return aa(i,o,t,r,a,n,s,l)},checkPoint:function e(t,r,a,n,i,o,s,l){l=l==="auto"?Pa(n,i):l;var u=2*l;if(fa(t,r,this.points,o,s,n,i-u,[0,-1],a)){return true}if(fa(t,r,this.points,o,s,n-u,i,[0,-1],a)){return true}var v=n/2+2*a;var f=i/2+2*a;var c=[o-v,s-f,o-v,s,o+v,s,o+v,s-f];if(va(t,r,c)){return true}if(ga(t,r,u,u,o+n/2-l,s+i/2-l,a)){return true}if(ga(t,r,u,u,o-n/2+l,s+i/2-l,a)){return true}return false}}};Qc.registerNodeShapes=function(){var e=this.nodeShapes={};var t=this;this.generateEllipse();this.generatePolygon("triangle",Ta(3,0));this.generateRoundPolygon("round-triangle",Ta(3,0));this.generatePolygon("rectangle",Ta(4,0));e["square"]=e["rectangle"];this.generateRoundRectangle();this.generateCutRectangle();this.generateBarrel();this.generateBottomRoundrectangle();{var r=[0,1,1,0,0,-1,-1,0];this.generatePolygon("diamond",r);this.generateRoundPolygon("round-diamond",r)}this.generatePolygon("pentagon",Ta(5,0));this.generateRoundPolygon("round-pentagon",Ta(5,0));this.generatePolygon("hexagon",Ta(6,0));this.generateRoundPolygon("round-hexagon",Ta(6,0));this.generatePolygon("heptagon",Ta(7,0));this.generateRoundPolygon("round-heptagon",Ta(7,0));this.generatePolygon("octagon",Ta(8,0));this.generateRoundPolygon("round-octagon",Ta(8,0));var a=new Array(20);{var n=Ca(5,0);var i=Ca(5,Math.PI/5);var o=.5*(3-Math.sqrt(5));o*=1.57;for(var s=0;s=t.deqFastCost*g){break}}else{if(i){if(h>=t.deqCost*u||h>=t.deqAvgCost*l){break}}else if(p>=t.deqNoDrawCost*nd){break}}var y=t.deq(r,c,f);if(y.length>0){for(var m=0;m0){t.onDeqd(r,v);if(!i&&t.shouldRedraw(r,v,c,f)){n()}}};var o=t.priority||It;a.beforeRender(i,o(r))}}};var od=function(){function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:_t;o(this,e);this.idsByKey=new Zt;this.keyForId=new Zt;this.cachesByLvl=new Zt;this.lvls=[];this.getKey=t;this.doesEleInvalidateKey=r}return l(e,[{key:"getIdsFor",value:function e(t){if(t==null){Rt("Can not get id list for null key")}var r=this.idsByKey;var a=this.idsByKey.get(t);if(!a){a=new Jt;r.set(t,a)}return a}},{key:"addIdForKey",value:function e(t,r){if(t!=null){this.getIdsFor(t).add(r)}}},{key:"deleteIdForKey",value:function e(t,r){if(t!=null){this.getIdsFor(t)["delete"](r)}}},{key:"getNumberOfIdsForKey",value:function e(t){if(t==null){return 0}else{return this.getIdsFor(t).size}}},{key:"updateKeyMappingFor",value:function e(t){var r=t.id();var a=this.keyForId.get(r);var n=this.getKey(t);this.deleteIdForKey(a,r);this.addIdForKey(n,r);this.keyForId.set(r,n)}},{key:"deleteKeyMappingFor",value:function e(t){var r=t.id();var a=this.keyForId.get(r);this.deleteIdForKey(a,r);this.keyForId["delete"](r)}},{key:"keyHasChangedFor",value:function e(t){var r=t.id();var a=this.keyForId.get(r);var n=this.getKey(t);return a!==n}},{key:"isInvalid",value:function e(t){return this.keyHasChangedFor(t)||this.doesEleInvalidateKey(t)}},{key:"getCachesAt",value:function e(t){var r=this.cachesByLvl,a=this.lvls;var n=r.get(t);if(!n){n=new Zt;r.set(t,n);a.push(t)}return n}},{key:"getCache",value:function e(t,r){return this.getCachesAt(r).get(t)}},{key:"get",value:function e(t,r){var a=this.getKey(t);var n=this.getCache(a,r);if(n!=null){this.updateKeyMappingFor(t)}return n}},{key:"getForCachedKey",value:function e(t,r){var a=this.keyForId.get(t.id());var n=this.getCache(a,r);return n}},{key:"hasCache",value:function e(t,r){return this.getCachesAt(r).has(t)}},{key:"has",value:function e(t,r){var a=this.getKey(t);return this.hasCache(a,r)}},{key:"setCache",value:function e(t,r,a){a.key=t;this.getCachesAt(r).set(t,a)}},{key:"set",value:function e(t,r,a){var n=this.getKey(t);this.setCache(n,r,a);this.updateKeyMappingFor(t)}},{key:"deleteCache",value:function e(t,r){this.getCachesAt(r)["delete"](t)}},{key:"delete",value:function e(t,r){var a=this.getKey(t);this.deleteCache(a,r)}},{key:"invalidateKey",value:function e(t){var r=this;this.lvls.forEach((function(e){return r.deleteCache(t,e)}))}},{key:"invalidate",value:function e(t){var r=t.id();var a=this.keyForId.get(r);this.deleteKeyMappingFor(t);var n=this.doesEleInvalidateKey(t);if(n){this.invalidateKey(a)}return n||this.getNumberOfIdsForKey(a)===0}}])}();var sd=25;var ld=50;var ud=-4;var vd=3;var fd=7.99;var cd=8;var dd=1024;var hd=1024;var pd=1024;var gd=.2;var yd=.8;var md=10;var bd=.15;var xd=.1;var wd=.9;var Ed=.9;var Td=100;var kd=1;var Cd={dequeue:"dequeue",downscale:"downscale",highQuality:"highQuality"};var Pd=Yt({getKey:null,doesEleInvalidateKey:_t,drawElement:null,getBoundingBox:null,getRotationPoint:null,getRotationOffset:null,isVisible:At,allowEdgeTxrCaching:true,allowParentTxrCaching:true});var Sd=function e(t,r){var a=this;a.renderer=t;a.onDequeues=[];var n=Pd(r);se(a,n);a.lookup=new od(n.getKey,n.doesEleInvalidateKey);a.setupDequeueing()};var Dd=Sd.prototype;Dd.reasons=Cd;Dd.getTextureQueue=function(e){var t=this;t.eleImgCaches=t.eleImgCaches||{};return t.eleImgCaches[e]=t.eleImgCaches[e]||[]};Dd.getRetiredTextureQueue=function(e){var t=this;var r=t.eleImgCaches.retired=t.eleImgCaches.retired||{};var a=r[e]=r[e]||[];return a};Dd.getElementQueue=function(){var e=this;var t=e.eleCacheQueue=e.eleCacheQueue||new fr((function(e,t){return t.reqs-e.reqs}));return t};Dd.getElementKeyToQueue=function(){var e=this;var t=e.eleKeyToCacheQueue=e.eleKeyToCacheQueue||{};return t};Dd.getElement=function(e,t,r,a,n){var i=this;var o=this.renderer;var s=o.cy.zoom();var l=this.lookup;if(!t||t.w===0||t.h===0||isNaN(t.w)||isNaN(t.h)||!e.visible()||e.removed()){return null}if(!i.allowEdgeTxrCaching&&e.isEdge()||!i.allowParentTxrCaching&&e.isParent()){return null}if(a==null){a=Math.ceil(Nr(s*r))}if(a=fd||a>vd){return null}var u=Math.pow(2,a);var v=t.h*u;var f=t.w*u;var c=o.eleTextBiggerThanMin(e,u);if(!this.isVisible(e,c)){return null}var d=l.get(e,a);if(d&&d.invalidated){d.invalidated=false;d.texture.invalidatedWidth-=d.width}if(d){return d}var h;if(v<=sd){h=sd}else if(v<=ld){h=ld}else{h=Math.ceil(v/ld)*ld}if(v>pd||f>hd){return null}var p=i.getTextureQueue(h);var g=p[p.length-2];var y=function e(){return i.recycleTexture(h,f)||i.addTexture(h,f)};if(!g){g=p[p.length-1]}if(!g){g=y()}if(g.width-g.usedWidtha;S--){C=i.getElement(e,t,r,S,Cd.downscale)}P()}else{i.queueElement(e,E.level-1);return E}}else{var D;if(!b&&!x&&!w){for(var B=a-1;B>=ud;B--){var A=l.get(e,B);if(A){D=A;break}}}if(m(D)){i.queueElement(e,a);return D}g.context.translate(g.usedWidth,0);g.context.scale(u,u);this.drawElement(g.context,e,t,c,false);g.context.scale(1/u,1/u);g.context.translate(-g.usedWidth,0)}d={x:g.usedWidth,texture:g,level:a,scale:u,width:f,height:v,scaledLabelShown:c};g.usedWidth+=Math.ceil(f+cd);g.eleCaches.push(d);l.set(e,a,d);i.checkTextureFullness(g);return d};Dd.invalidateElements=function(e){for(var t=0;t=gd*e.width){this.retireTexture(e)}};Dd.checkTextureFullness=function(e){var t=this;var r=t.getTextureQueue(e.height);if(e.usedWidth/e.width>yd&&e.fullnessChecks>=md){qt(r,e)}else{e.fullnessChecks++}};Dd.retireTexture=function(e){var t=this;var r=e.height;var a=t.getTextureQueue(r);var n=this.lookup;qt(a,e);e.retired=true;var i=e.eleCaches;for(var o=0;o=t){o.retired=false;o.usedWidth=0;o.invalidatedWidth=0;o.fullnessChecks=0;Wt(o.eleCaches);o.context.setTransform(1,0,0,1,0,0);o.context.clearRect(0,0,o.width,o.height);qt(n,o);a.push(o);return o}}};Dd.queueElement=function(e,t){var r=this;var a=r.getElementQueue();var n=r.getElementKeyToQueue();var i=this.getKey(e);var o=n[i];if(o){o.level=Math.max(o.level,t);o.eles.merge(e);o.reqs++;a.updateItem(o)}else{var s={eles:e.spawn().merge(e),level:t,reqs:1,key:i};a.push(s);n[i]=s}};Dd.dequeue=function(e){var t=this;var r=t.getElementQueue();var a=t.getElementKeyToQueue();var n=[];var i=t.lookup;for(var o=0;o0){var s=r.pop();var l=s.key;var u=s.eles[0];var v=i.hasCache(u,s.level);a[l]=null;if(v){continue}n.push(s);var f=t.getBoundingBox(u);t.getElement(u,f,e,s.level,Cd.dequeue)}else{break}}return n};Dd.removeFromQueue=function(e){var t=this;var r=t.getElementQueue();var a=t.getElementKeyToQueue();var n=this.getKey(e);var i=a[n];if(i!=null){if(i.eles.length===1){i.reqs=Bt;r.updateItem(i);r.pop();a[n]=null}else{i.eles.unmerge(e)}}};Dd.onDequeue=function(e){this.onDequeues.push(e)};Dd.offDequeue=function(e){qt(this.onDequeues,e)};Dd.setupDequeueing=id.setupDequeueing({deqRedrawThreshold:Td,deqCost:bd,deqAvgCost:xd,deqNoDrawCost:wd,deqFastCost:Ed,deq:function e(t,r,a){return t.dequeue(r,a)},onDeqd:function e(t,r){for(var a=0;a=Md||r>_d){return null}}a.validateLayersElesOrdering(r,e);var l=a.layersByLevel;var u=Math.pow(2,r);var v=l[r]=l[r]||[];var f;var c=a.levelIsComplete(r,e);var d;var h=function t(){var n=function t(r){a.validateLayersElesOrdering(r,e);if(a.levelIsComplete(r,e)){d=l[r];return true}};var i=function e(t){if(d){return}for(var a=r+t;Ad<=a&&a<=_d;a+=t){if(n(a)){break}}};i(1);i(-1);for(var o=v.length-1;o>=0;o--){var s=v[o];if(s.invalid){qt(v,s)}}};if(!c){h()}else{return v}var p=function t(){if(!f){f=qr();for(var r=0;rXd||o>Xd){return null}var s=i*o;if(s>jd){return null}var l=a.makeLayer(f,r);if(n!=null){var c=v.indexOf(n)+1;v.splice(c,0,l)}else if(t.insert===undefined||t.insert){v.unshift(l)}return l};if(a.skipping&&!s){return null}var y=null;var m=e.length/Bd;var b=!s;for(var x=0;x=m||!ra(y.bb,w.boundingBox())){y=g({insert:true,after:y});if(!y){return null}}if(d||b){a.queueLayer(y,w)}else{a.drawEleInLayer(y,w,r,t)}y.eles.push(w);T[r]=y}if(d){return d}if(b){return null}return v};Wd.getEleLevelForLayerLevel=function(e,t){return e};Wd.drawEleInLayer=function(e,t,r,a){var n=this;var i=this.renderer;var o=e.context;var s=t.boundingBox();if(s.w===0||s.h===0||!t.visible()){return}r=n.getEleLevelForLayerLevel(r,a);{i.setImgSmoothing(o,false)}{i.drawCachedElement(o,t,null,null,r,Yd)}{i.setImgSmoothing(o,true)}};Wd.levelIsComplete=function(e,t){var r=this;var a=r.layersByLevel[e];if(!a||a.length===0){return false}var n=0;for(var i=0;i0){return false}if(o.invalid){return false}n+=o.eles.length}if(n!==t.length){return false}return true};Wd.validateLayersElesOrdering=function(e,t){var r=this.layersByLevel[e];if(!r){return}for(var a=0;a0){t=true;break}}return t};Wd.invalidateElements=function(e){var t=this;if(e.length===0){return}t.lastInvalidationTime=ct();if(e.length===0||!t.haveLayers()){return}t.updateElementsInLayers(e,(function e(r,a,n){t.invalidateLayer(r)}))};Wd.invalidateLayer=function(e){this.lastInvalidationTime=ct();if(e.invalid){return}var t=e.level;var r=e.eles;var a=this.layersByLevel[t];qt(a,e);e.elesQueue=[];e.invalid=true;if(e.replacement){e.replacement.invalid=true}for(var n=0;n3&&arguments[3]!==undefined?arguments[3]:true;var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;var s=t._private.rscratch;if(i&&!t.visible()){return}if(s.badLine||s.allpts==null||isNaN(s.allpts[0])){return}var l;if(r){l=r;e.translate(-l.x1,-l.y1)}var u=i?t.pstyle("opacity").value:1;var v=i?t.pstyle("line-opacity").value:1;var f=t.pstyle("curve-style").value;var c=t.pstyle("line-style").value;var d=t.pstyle("width").pfValue;var h=t.pstyle("line-cap").value;var p=t.pstyle("line-outline-width").value;var g=t.pstyle("line-outline-color").value;var y=u*v;var m=u*v;var b=function r(){var a=arguments.length>0&&arguments[0]!==undefined?arguments[0]:y;if(f==="straight-triangle"){o.eleStrokeStyle(e,t,a);o.drawEdgeTrianglePath(t,e,s.allpts)}else{e.lineWidth=d;e.lineCap=h;o.eleStrokeStyle(e,t,a);o.drawEdgePath(t,e,s.allpts,c);e.lineCap="butt"}};var x=function r(){var a=arguments.length>0&&arguments[0]!==undefined?arguments[0]:y;e.lineWidth=d+p;e.lineCap=h;if(p>0){o.colorStrokeStyle(e,g[0],g[1],g[2],a)}else{e.lineCap="butt";return}if(f==="straight-triangle"){o.drawEdgeTrianglePath(t,e,s.allpts)}else{o.drawEdgePath(t,e,s.allpts,c);e.lineCap="butt"}};var w=function r(){if(!n){return}o.drawEdgeOverlay(e,t)};var E=function r(){if(!n){return}o.drawEdgeUnderlay(e,t)};var T=function r(){var a=arguments.length>0&&arguments[0]!==undefined?arguments[0]:m;o.drawArrowheads(e,t,a)};var k=function r(){o.drawElementText(e,t,null,a)};e.lineJoin="round";var C=t.pstyle("ghost").value==="yes";if(C){var P=t.pstyle("ghost-offset-x").pfValue;var S=t.pstyle("ghost-offset-y").pfValue;var D=t.pstyle("ghost-opacity").value;var B=y*D;e.translate(P,S);b(B);T(B);e.translate(-P,-S)}else{x()}E();b();T();w();k();if(r){e.translate(l.x1,l.y1)}};var uh=function e(t){if(!["overlay","underlay"].includes(t)){throw new Error("Invalid state")}return function(e,r){if(!r.visible()){return}var a=r.pstyle("".concat(t,"-opacity")).value;if(a===0){return}var n=this;var i=n.usePaths();var o=r._private.rscratch;var s=r.pstyle("".concat(t,"-padding")).pfValue;var l=2*s;var u=r.pstyle("".concat(t,"-color")).value;e.lineWidth=l;if(o.edgeType==="self"&&!i){e.lineCap="butt"}else{e.lineCap="round"}n.colorStrokeStyle(e,u[0],u[1],u[2],a);n.drawEdgePath(r,e,o.allpts,"solid")}};lh.drawEdgeOverlay=uh("overlay");lh.drawEdgeUnderlay=uh("underlay");lh.drawEdgePath=function(e,t,r,a){var n=e._private.rscratch;var i=t;var o;var s=false;var l=this.usePaths();var v=e.pstyle("line-dash-pattern").pfValue;var f=e.pstyle("line-dash-offset").pfValue;if(l){var c=r.join("$");var d=n.pathCacheKey&&n.pathCacheKey===c;if(d){o=t=n.pathCache;s=true}else{o=t=new Path2D;n.pathCacheKey=c;n.pathCache=o}}if(i.setLineDash){switch(a){case"dotted":i.setLineDash([1,1]);break;case"dashed":i.setLineDash(v);i.lineDashOffset=f;break;case"solid":i.setLineDash([]);break}}if(!s&&!n.badLine){if(t.beginPath){t.beginPath()}t.moveTo(r[0],r[1]);switch(n.edgeType){case"bezier":case"self":case"compound":case"multibezier":for(var h=2;h+35&&arguments[5]!==undefined?arguments[5]:true;var o=this;if(a==null){if(i&&!o.eleTextBiggerThanMin(t)){return}}else if(a===false){return}if(t.isNode()){var s=t.pstyle("label");if(!s||!s.value){return}var l=o.getLabelJustification(t);e.textAlign=l;e.textBaseline="bottom"}else{var u=t.element()._private.rscratch.badLine;var v=t.pstyle("label");var f=t.pstyle("source-label");var c=t.pstyle("target-label");if(u||(!v||!v.value)&&(!f||!f.value)&&(!c||!c.value)){return}e.textAlign="center";e.textBaseline="bottom"}var d=!r;var h;if(r){h=r;e.translate(-h.x1,-h.y1)}if(n==null){o.drawText(e,t,null,d,i);if(t.isEdge()){o.drawText(e,t,"source",d,i);o.drawText(e,t,"target",d,i)}}else{o.drawText(e,t,n,d,i)}if(r){e.translate(h.x1,h.y1)}};fh.getFontCache=function(e){var t;this.fontCaches=this.fontCaches||[];for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:true;var a=t.pstyle("font-style").strValue;var n=t.pstyle("font-size").pfValue+"px";var i=t.pstyle("font-family").strValue;var o=t.pstyle("font-weight").strValue;var s=r?t.effectiveOpacity()*t.pstyle("text-opacity").value:1;var l=t.pstyle("text-outline-opacity").value*s;var u=t.pstyle("color").value;var v=t.pstyle("text-outline-color").value;e.font=a+" "+o+" "+n+" "+i;e.lineJoin="round";this.colorFillStyle(e,u[0],u[1],u[2],s);this.colorStrokeStyle(e,v[0],v[1],v[2],l)};function ch(e,t,r,a,n){var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:5;var o=arguments.length>6?arguments[6]:undefined;e.beginPath();e.moveTo(t+i,r);e.lineTo(t+a-i,r);e.quadraticCurveTo(t+a,r,t+a,r+i);e.lineTo(t+a,r+n-i);e.quadraticCurveTo(t+a,r+n,t+a-i,r+n);e.lineTo(t+i,r+n);e.quadraticCurveTo(t,r+n,t,r+n-i);e.lineTo(t,r+i);e.quadraticCurveTo(t,r,t+i,r);e.closePath();if(o)e.stroke();else e.fill()}fh.getTextAngle=function(e,t){var r;var a=e._private;var n=a.rscratch;var i=t?t+"-":"";var o=e.pstyle(i+"text-rotation");if(o.strValue==="autorotate"){var s=Gt(n,"labelAngle",t);r=e.isEdge()?s:0}else if(o.strValue==="none"){r=0}else{r=o.pfValue}return r};fh.drawText=function(e,t,r){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=t._private;var o=i.rscratch;var s=n?t.effectiveOpacity():1;if(n&&(s===0||t.pstyle("text-opacity").value===0)){return}if(r==="main"){r=null}var l=Gt(o,"labelX",r);var u=Gt(o,"labelY",r);var v,f;var c=this.getLabelText(t,r);if(c!=null&&c!==""&&!isNaN(l)&&!isNaN(u)){this.setupTextStyle(e,t,n);var d=r?r+"-":"";var h=Gt(o,"labelWidth",r);var p=Gt(o,"labelHeight",r);var g=t.pstyle(d+"text-margin-x").pfValue;var y=t.pstyle(d+"text-margin-y").pfValue;var m=t.isEdge();var b=t.pstyle("text-halign").value;var x=t.pstyle("text-valign").value;if(m){b="center";x="center"}l+=g;u+=y;var w;if(!a){w=0}else{w=this.getTextAngle(t,r)}if(w!==0){v=l;f=u;e.translate(v,f);e.rotate(w);l=0;u=0}switch(x){case"top":break;case"center":u+=p/2;break;case"bottom":u+=p;break}var E=t.pstyle("text-background-opacity").value;var T=t.pstyle("text-border-opacity").value;var k=t.pstyle("text-border-width").pfValue;var C=t.pstyle("text-background-padding").pfValue;var P=t.pstyle("text-background-shape").strValue;var S=P.indexOf("round")===0;var D=2;if(E>0||k>0&&T>0){var B=l-C;switch(b){case"left":B-=h;break;case"center":B-=h/2;break}var A=u-p-C;var _=h+2*C;var M=p+2*C;if(E>0){var I=e.fillStyle;var R=t.pstyle("text-background-color").value;e.fillStyle="rgba("+R[0]+","+R[1]+","+R[2]+","+E*s+")";if(S){ch(e,B,A,_,M,D)}else{e.fillRect(B,A,_,M)}e.fillStyle=I}if(k>0&&T>0){var N=e.strokeStyle;var L=e.lineWidth;var O=t.pstyle("text-border-color").value;var z=t.pstyle("text-border-style").value;e.strokeStyle="rgba("+O[0]+","+O[1]+","+O[2]+","+T*s+")";e.lineWidth=k;if(e.setLineDash){switch(z){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"double":e.lineWidth=k/4;e.setLineDash([]);break;case"solid":e.setLineDash([]);break}}if(S){ch(e,B,A,_,M,D,"stroke")}else{e.strokeRect(B,A,_,M)}if(z==="double"){var F=k/2;if(S){ch(e,B+F,A+F,_-F*2,M-F*2,D,"stroke")}else{e.strokeRect(B+F,A+F,_-F*2,M-F*2)}}if(e.setLineDash){e.setLineDash([])}e.lineWidth=L;e.strokeStyle=N}}var V=2*t.pstyle("text-outline-width").pfValue;if(V>0){e.lineWidth=V}if(t.pstyle("text-wrap").value==="wrap"){var j=Gt(o,"labelWrapCachedLines",r);var X=Gt(o,"labelLineHeight",r);var Y=h/2;var q=this.getLabelJustification(t);if(q==="auto");else if(b==="left"){if(q==="left"){l+=-h}else if(q==="center"){l+=-Y}}else if(b==="center"){if(q==="left"){l+=-Y}else if(q==="right"){l+=Y}}else if(b==="right"){if(q==="center"){l+=Y}else if(q==="right"){l+=h}}switch(x){case"top":u-=(j.length-1)*X;break;case"center":case"bottom":u-=(j.length-1)*X;break}for(var W=0;W0){e.strokeText(j[W],l,u)}e.fillText(j[W],l,u);u+=X}}else{if(V>0){e.strokeText(c,l,u)}e.fillText(c,l,u)}if(w!==0){e.rotate(-w);e.translate(-v,-f)}}};var dh={};dh.drawNode=function(e,t,r){var a=arguments.length>3&&arguments[3]!==undefined?arguments[3]:true;var n=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var i=arguments.length>5&&arguments[5]!==undefined?arguments[5]:true;var o=this;var s,l;var u=t._private;var v=u.rscratch;var f=t.position();if(!I(f.x)||!I(f.y)){return}if(i&&!t.visible()){return}var c=i?t.effectiveOpacity():1;var d=o.usePaths();var h;var p=false;var g=t.padding();s=t.width()+2*g;l=t.height()+2*g;var y;if(r){y=r;e.translate(-y.x1,-y.y1)}var m=t.pstyle("background-image");var b=m.value;var x=new Array(b.length);var w=new Array(b.length);var E=0;for(var T=0;T0&&arguments[0]!==undefined?arguments[0]:B;o.eleFillStyle(e,t,a)};var U=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:z;o.colorStrokeStyle(e,A[0],A[1],A[2],r)};var G=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:X;o.colorStrokeStyle(e,V[0],V[1],V[2],r)};var H=function e(t,r,a,n){var i=o.nodePathCache=o.nodePathCache||[];var s=kt(a==="polygon"?a+","+n.join(","):a,""+r,""+t,""+q);var l=i[s];var u;var f=false;if(l!=null){u=l;f=true;v.pathCache=u}else{u=new Path2D;i[s]=v.pathCache=u}return{path:u,cacheHit:f}};var K=t.pstyle("shape").strValue;var Z=t.pstyle("shape-polygon-points").pfValue;if(d){e.translate(f.x,f.y);var $=H(s,l,K,Z);h=$.path;p=$.cacheHit}var Q=function r(){if(!p){var a=f;if(d){a={x:0,y:0}}o.nodeShapes[o.getNodeShape(t)].draw(h||e,a.x,a.y,s,l,q,v)}if(d){e.fill(h)}else{e.fill()}};var J=function r(){var a=arguments.length>0&&arguments[0]!==undefined?arguments[0]:c;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:true;var i=u.backgrounding;var s=0;for(var l=0;l0&&arguments[0]!==undefined?arguments[0]:false;var n=arguments.length>1&&arguments[1]!==undefined?arguments[1]:c;if(o.hasPie(t)){o.drawPie(e,t,n);if(a){if(!d){o.nodeShapes[o.getNodeShape(t)].draw(e,f.x,f.y,s,l,q,v)}}}};var te=function t(){var r=arguments.length>0&&arguments[0]!==undefined?arguments[0]:c;var a=(S>0?S:-S)*r;var n=S>0?0:255;if(S!==0){o.colorFillStyle(e,n,n,n,a);if(d){e.fill(h)}else{e.fill()}}};var re=function t(){if(D>0){e.lineWidth=D;e.lineCap=R;e.lineJoin=M;if(e.setLineDash){switch(_){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash(L);e.lineDashOffset=O;break;case"solid":case"double":e.setLineDash([]);break}}if(N!=="center"){e.save();e.lineWidth*=2;if(N==="inside"){d?e.clip(h):e.clip()}else{var r=new Path2D;r.rect(-s/2-D,-l/2-D,s+2*D,l+2*D);r.addPath(h);e.clip(r,"evenodd")}d?e.stroke(h):e.stroke();e.restore()}else{d?e.stroke(h):e.stroke()}if(_==="double"){e.lineWidth=D/3;var a=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";if(d){e.stroke(h)}else{e.stroke()}e.globalCompositeOperation=a}if(e.setLineDash){e.setLineDash([])}}};var ae=function r(){if(F>0){e.lineWidth=F;e.lineCap="butt";if(e.setLineDash){switch(j){case"dotted":e.setLineDash([1,1]);break;case"dashed":e.setLineDash([4,2]);break;case"solid":case"double":e.setLineDash([]);break}}var a=f;if(d){a={x:0,y:0}}var n=o.getNodeShape(t);var i=D;if(N==="inside")i=0;if(N==="outside")i*=2;var u=(s+i+(F+Y))/s;var v=(l+i+(F+Y))/l;var c=s*u;var h=l*v;var p=o.nodeShapes[n].points;var g;if(d){var y=H(c,h,n,p);g=y.path}if(n==="ellipse"){o.drawEllipsePath(g||e,a.x,a.y,c,h)}else if(["round-diamond","round-heptagon","round-hexagon","round-octagon","round-pentagon","round-polygon","round-triangle","round-tag"].includes(n)){var m=0;var b=0;var x=0;if(n==="round-diamond"){m=(i+Y+F)*1.4}else if(n==="round-heptagon"){m=(i+Y+F)*1.075;x=-(i/2+Y+F)/35}else if(n==="round-hexagon"){m=(i+Y+F)*1.12}else if(n==="round-pentagon"){m=(i+Y+F)*1.13;x=-(i/2+Y+F)/15}else if(n==="round-tag"){m=(i+Y+F)*1.12;b=(i/2+F+Y)*.07}else if(n==="round-triangle"){m=(i+Y+F)*(Math.PI/2);x=-(i+Y/2+F)/Math.PI}if(m!==0){u=(s+m)/s;c=s*u;if(!["round-hexagon","round-tag"].includes(n)){v=(l+m)/l;h=l*v}}q=q==="auto"?Sa(c,h):q;var w=c/2;var E=h/2;var T=q+(i+F+Y)/2;var k=new Array(p.length/2);var C=new Array(p.length/2);for(var P=0;P0){a=a||r.position();if(n==null||i==null){var c=r.padding();n=r.width()+2*c;i=r.height()+2*c}o.colorFillStyle(e,u[0],u[1],u[2],l);o.nodeShapes[v].draw(e,a.x,a.y,n+s*2,i+s*2,f);e.fill()}}};dh.drawNodeOverlay=hh("overlay");dh.drawNodeUnderlay=hh("underlay");dh.hasPie=function(e){e=e[0];return e._private.hasPie};dh.drawPie=function(e,t,r,a){t=t[0];a=a||t.position();var n=t.cy().style();var i=t.pstyle("pie-size");var o=a.x;var s=a.y;var l=t.width();var u=t.height();var v=Math.min(l,u)/2;var f=0;var c=this.usePaths();if(c){o=0;s=0}if(i.units==="%"){v=v*i.pfValue}else if(i.pfValue!==undefined){v=i.pfValue/2}for(var d=1;d<=n.pieBackgroundN;d++){var h=t.pstyle("pie-"+d+"-background-size").value;var p=t.pstyle("pie-"+d+"-background-color").value;var g=t.pstyle("pie-"+d+"-background-opacity").value*r;var y=h/100;if(y+f>1){y=1-f}var m=1.5*Math.PI+2*Math.PI*f;var b=2*Math.PI*y;var x=m+b;if(h===0||f>=1||f+y>1){continue}e.beginPath();e.moveTo(o,s);e.arc(o,s,v,m,x);e.closePath();this.colorFillStyle(e,p[0],p[1],p[2],g);e.fill();f+=y}};var ph={};var gh=100;ph.getPixelRatio=function(){var e=this.data.contexts[0];if(this.forcedPixelRatio!=null){return this.forcedPixelRatio}var t=this.cy.window();var r=e.backingStorePixelRatio||e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return(t.devicePixelRatio||1)/r};ph.paintCache=function(e){var t=this.paintCaches=this.paintCaches||[];var r=true;var a;for(var n=0;nt.minMbLowQualFrames){t.motionBlurPxRatio=t.mbPxRBlurry}}if(t.clearingMotionBlur){t.motionBlurPxRatio=1}if(t.textureDrawLastFrame&&!f){v[t.NODE]=true;v[t.SELECT_BOX]=true}var m=r.style();var b=r.zoom();var x=o!==undefined?o:b;var w=r.pan();var E={x:w.x,y:w.y};var T={zoom:b,pan:{x:w.x,y:w.y}};var k=t.prevViewport;var C=k===undefined||T.zoom!==k.zoom||T.pan.x!==k.pan.x||T.pan.y!==k.pan.y;if(!C&&!(p&&!h)){t.motionBlurPxRatio=1}if(s){E=s}x*=l;E.x*=l;E.y*=l;var P=t.getCachedZSortedEles();function S(e,r,a,n,i){var o=e.globalCompositeOperation;e.globalCompositeOperation="destination-out";t.colorFillStyle(e,255,255,255,t.motionBlurTransparency);e.fillRect(r,a,n,i);e.globalCompositeOperation=o}function D(e,r){var i,l,v,f;if(!t.clearingMotionBlur&&(e===u.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]||e===u.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG])){i={x:w.x*d,y:w.y*d};l=b*d;v=t.canvasWidth*d;f=t.canvasHeight*d}else{i=E;l=x;v=t.canvasWidth;f=t.canvasHeight}e.setTransform(1,0,0,1,0,0);if(r==="motionBlur"){S(e,0,0,v,f)}else if(!a&&(r===undefined||r)){e.clearRect(0,0,v,f)}if(!n){e.translate(i.x,i.y);e.scale(l,l)}if(s){e.translate(s.x,s.y)}if(o){e.scale(o,o)}}if(!f){t.textureDrawLastFrame=false}if(f){t.textureDrawLastFrame=true;if(!t.textureCache){t.textureCache={};t.textureCache.bb=r.mutableElements().boundingBox();t.textureCache.texture=t.data.bufferCanvases[t.TEXTURE_BUFFER];var B=t.data.bufferContexts[t.TEXTURE_BUFFER];B.setTransform(1,0,0,1,0,0);B.clearRect(0,0,t.canvasWidth*t.textureMult,t.canvasHeight*t.textureMult);t.render({forcedContext:B,drawOnlyNodeLayer:true,forcedPxRatio:l*t.textureMult});var T=t.textureCache.viewport={zoom:r.zoom(),pan:r.pan(),width:t.canvasWidth,height:t.canvasHeight};T.mpan={x:(0-T.pan.x)/T.zoom,y:(0-T.pan.y)/T.zoom}}v[t.DRAG]=false;v[t.NODE]=false;var A=u.contexts[t.NODE];var _=t.textureCache.texture;var T=t.textureCache.viewport;A.setTransform(1,0,0,1,0,0);if(c){S(A,0,0,T.width,T.height)}else{A.clearRect(0,0,T.width,T.height)}var M=m.core("outside-texture-bg-color").value;var I=m.core("outside-texture-bg-opacity").value;t.colorFillStyle(A,M[0],M[1],M[2],I);A.fillRect(0,0,T.width,T.height);var b=r.zoom();D(A,false);A.clearRect(T.mpan.x,T.mpan.y,T.width/T.zoom/l,T.height/T.zoom/l);A.drawImage(_,T.mpan.x,T.mpan.y,T.width/T.zoom/l,T.height/T.zoom/l)}else if(t.textureOnViewport&&!a){t.textureCache=null}var R=r.extent();var N=t.pinching||t.hoverData.dragging||t.swipePanning||t.data.wheelZooming||t.hoverData.draggingEles||t.cy.animated();var L=t.hideEdgesOnViewport&&N;var O=[];O[t.NODE]=!v[t.NODE]&&c&&!t.clearedForMotionBlur[t.NODE]||t.clearingMotionBlur;if(O[t.NODE]){t.clearedForMotionBlur[t.NODE]=true}O[t.DRAG]=!v[t.DRAG]&&c&&!t.clearedForMotionBlur[t.DRAG]||t.clearingMotionBlur;if(O[t.DRAG]){t.clearedForMotionBlur[t.DRAG]=true}if(v[t.NODE]||n||i||O[t.NODE]){var z=c&&!O[t.NODE]&&d!==1;var A=a||(z?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_NODE]:u.contexts[t.NODE]);var F=c&&!z?"motionBlur":undefined;D(A,F);if(L){t.drawCachedNodes(A,P.nondrag,l,R)}else{t.drawLayeredElements(A,P.nondrag,l,R)}if(t.debug){t.drawDebugPoints(A,P.nondrag)}if(!n&&!c){v[t.NODE]=false}}if(!i&&(v[t.DRAG]||n||O[t.DRAG])){var z=c&&!O[t.DRAG]&&d!==1;var A=a||(z?t.data.bufferContexts[t.MOTIONBLUR_BUFFER_DRAG]:u.contexts[t.DRAG]);D(A,c&&!z?"motionBlur":undefined);if(L){t.drawCachedNodes(A,P.drag,l,R)}else{t.drawCachedElements(A,P.drag,l,R)}if(t.debug){t.drawDebugPoints(A,P.drag)}if(!n&&!c){v[t.DRAG]=false}}this.drawSelectionRectangle(e,D);if(c&&d!==1){var V=u.contexts[t.NODE];var j=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_NODE];var X=u.contexts[t.DRAG];var Y=t.data.bufferCanvases[t.MOTIONBLUR_BUFFER_DRAG];var q=function e(r,a,n){r.setTransform(1,0,0,1,0,0);if(n||!y){r.clearRect(0,0,t.canvasWidth,t.canvasHeight)}else{S(r,0,0,t.canvasWidth,t.canvasHeight)}var i=d;r.drawImage(a,0,0,t.canvasWidth*i,t.canvasHeight*i,0,0,t.canvasWidth,t.canvasHeight)};if(v[t.NODE]||O[t.NODE]){q(V,j,O[t.NODE]);v[t.NODE]=false}if(v[t.DRAG]||O[t.DRAG]){q(X,Y,O[t.DRAG]);v[t.DRAG]=false}}t.prevViewport=T;if(t.clearingMotionBlur){t.clearingMotionBlur=false;t.motionBlurCleared=true;t.motionBlur=true}if(c){t.motionBlurTimeout=setTimeout((function(){t.motionBlurTimeout=null;t.clearedForMotionBlur[t.NODE]=false;t.clearedForMotionBlur[t.DRAG]=false;t.motionBlur=false;t.clearingMotionBlur=!f;t.mbFrames=0;v[t.NODE]=true;v[t.DRAG]=true;t.redraw()}),gh)}if(!a){r.emit("render")}};var yh;ph.drawSelectionRectangle=function(e,t){var r=this;var a=r.cy;var n=r.data;var i=a.style();var o=e.drawOnlyNodeLayer;var s=e.drawAllLayers;var l=n.canvasNeedsRedraw;var u=e.forcedContext;if(r.showFps||!o&&l[r.SELECT_BOX]&&!s){var v=u||n.contexts[r.SELECT_BOX];t(v);if(r.selection[4]==1&&(r.hoverData.selecting||r.touchData.selecting)){var f=r.cy.zoom();var c=i.core("selection-box-border-width").value/f;v.lineWidth=c;v.fillStyle="rgba("+i.core("selection-box-color").value[0]+","+i.core("selection-box-color").value[1]+","+i.core("selection-box-color").value[2]+","+i.core("selection-box-opacity").value+")";v.fillRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1]);if(c>0){v.strokeStyle="rgba("+i.core("selection-box-border-color").value[0]+","+i.core("selection-box-border-color").value[1]+","+i.core("selection-box-border-color").value[2]+","+i.core("selection-box-opacity").value+")";v.strokeRect(r.selection[0],r.selection[1],r.selection[2]-r.selection[0],r.selection[3]-r.selection[1])}}if(n.bgActivePosistion&&!r.hoverData.selecting){var f=r.cy.zoom();var d=n.bgActivePosistion;v.fillStyle="rgba("+i.core("active-bg-color").value[0]+","+i.core("active-bg-color").value[1]+","+i.core("active-bg-color").value[2]+","+i.core("active-bg-opacity").value+")";v.beginPath();v.arc(d.x,d.y,i.core("active-bg-size").pfValue/f,0,2*Math.PI);v.fill()}var h=r.lastRedrawTime;if(r.showFps&&h){h=Math.round(h);var p=Math.round(1e3/h);var g="1 frame = "+h+" ms = "+p+" fps";v.setTransform(1,0,0,1,0,0);v.fillStyle="rgba(255, 0, 0, 0.75)";v.strokeStyle="rgba(255, 0, 0, 0.75)";v.font="30px Arial";if(!yh){var y=v.measureText(g);yh=y.actualBoundingBoxAscent}v.fillText(g,0,yh);var m=60;v.strokeRect(0,yh+10,250,20);v.fillRect(0,yh+10,250*Math.min(p/m,1),20)}if(!s){l[r.SELECT_BOX]=false}}};function mh(e,t,r){var a=e.createShader(t);e.shaderSource(a,r);e.compileShader(a);if(!e.getShaderParameter(a,e.COMPILE_STATUS)){throw new Error(e.getShaderInfoLog(a))}return a}function bh(e,t,r){var a=mh(e,e.VERTEX_SHADER,t);var n=mh(e,e.FRAGMENT_SHADER,r);var i=e.createProgram();e.attachShader(i,a);e.attachShader(i,n);e.linkProgram(i);if(!e.getProgramParameter(i,e.LINK_STATUS)){throw new Error("Could not initialize shaders")}return i}function xh(e,t,r){if(r===undefined){r=t}var a=e.makeOffscreenCanvas(t,r);var n=a.context=a.getContext("2d");a.clear=function(){return n.clearRect(0,0,a.width,a.height)};a.clear();return a}function wh(e){var t=e.pixelRatio;var r=e.cy.zoom();var a=e.cy.pan();return{zoom:r*t,pan:{x:a.x*t,y:a.y*t}}}function Eh(e,t,r,a,n){var i=a*r+t.x;var o=n*r+t.y;o=Math.round(e.canvasHeight-o);return[i,o]}function Th(e,t,r){var a=e[0]/255;var n=e[1]/255;var i=e[2]/255;var o=t;var s=r||new Array(4);s[0]=a*o;s[1]=n*o;s[2]=i*o;s[3]=o;return s}function kh(e,t){var r=t||new Array(4);r[0]=(e>>0&255)/255;r[1]=(e>>8&255)/255;r[2]=(e>>16&255)/255;r[3]=(e>>24&255)/255;return r}function Ch(e){return e[0]+(e[1]<<8)+(e[2]<<16)+(e[3]<<24)}function Ph(e,t){var r=e.createTexture();r.buffer=function(t){e.bindTexture(e.TEXTURE_2D,r);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR);e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR_MIPMAP_NEAREST);e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,true);e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);e.generateMipmap(e.TEXTURE_2D);e.bindTexture(e.TEXTURE_2D,null)};r.deleteTexture=function(){e.deleteTexture(r)};return r}function Sh(e,t){switch(t){case"float":return[1,e.FLOAT,4];case"vec2":return[2,e.FLOAT,4];case"vec3":return[3,e.FLOAT,4];case"vec4":return[4,e.FLOAT,4];case"int":return[1,e.INT,4];case"ivec2":return[2,e.INT,4]}}function Dh(e,t,r){switch(t){case e.FLOAT:return new Float32Array(r);case e.INT:return new Int32Array(r)}}function Bh(e,t,r,a,n,i){switch(t){case e.FLOAT:return new Float32Array(r.buffer,i*a,n);case e.INT:return new Int32Array(r.buffer,i*a,n)}}function Ah(e,t,r,a){var n=Sh(e,t),i=p(n,2),o=i[0],s=i[1];var l=Dh(e,s,a);var u=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,u);e.bufferData(e.ARRAY_BUFFER,l,e.STATIC_DRAW);if(s===e.FLOAT){e.vertexAttribPointer(r,o,s,false,0,0)}else if(s===e.INT){e.vertexAttribIPointer(r,o,s,0,0)}e.enableVertexAttribArray(r);e.bindBuffer(e.ARRAY_BUFFER,null);return u}function _h(e,t,r,a){var n=Sh(e,r),i=p(n,3),o=i[0],s=i[1],l=i[2];var u=Dh(e,s,t*o);var v=o*l;var f=e.createBuffer();e.bindBuffer(e.ARRAY_BUFFER,f);e.bufferData(e.ARRAY_BUFFER,t*v,e.DYNAMIC_DRAW);e.enableVertexAttribArray(a);if(s===e.FLOAT){e.vertexAttribPointer(a,o,s,false,v,0)}else if(s===e.INT){e.vertexAttribIPointer(a,o,s,v,0)}e.vertexAttribDivisor(a,1);e.bindBuffer(e.ARRAY_BUFFER,null);var c=new Array(t);for(var d=0;di){o=i/r;s=r*o;l=a*o}return{scale:o,texW:s,texH:l}}},{key:"draw",value:function e(t,r,a){var n=this;if(this.locked)throw new Error("can't draw, atlas is locked");var i=this.texSize,o=this.texRows,s=this.texHeight;var l=this.getScale(r),u=l.scale,v=l.texW,f=l.texH;var c=[null,null];var d=function e(t,n){if(a&&n){var i=n.context;var o=t.x,l=t.row;var v=o;var f=s*l;i.save();i.translate(v,f);i.scale(u,u);a(i,r);i.restore()}};var h=function e(){d(n.freePointer,n.canvas);c[0]={x:n.freePointer.x,y:n.freePointer.row*s,w:v,h:f};c[1]={x:n.freePointer.x+v,y:n.freePointer.row*s,w:0,h:f};n.freePointer.x+=v;if(n.freePointer.x==i){n.freePointer.x=0;n.freePointer.row++}};var p=function e(){var t=n.scratch,r=n.canvas;t.clear();d({x:0,row:0},t);var a=i-n.freePointer.x;var o=v-a;var l=s;{var u=n.freePointer.x;var h=n.freePointer.row*s;var p=a;r.context.drawImage(t,0,0,p,l,u,h,p,l);c[0]={x:u,y:h,w:p,h:f}}{var g=a;var y=(n.freePointer.row+1)*s;var m=o;if(r){r.context.drawImage(t,g,0,m,l,0,y,m,l)}c[1]={x:0,y,w:m,h:f}}n.freePointer.x=o;n.freePointer.row++};var g=function e(){n.freePointer.x=0;n.freePointer.row++};if(this.freePointer.x+v<=i){h()}else if(this.freePointer.row>=o-1){return false}else if(this.freePointer.x===i){g();h()}else if(this.enableWrapping){p()}else{g();h()}this.keyToLocation.set(t,c);this.needsBuffer=true;return c}},{key:"getOffsets",value:function e(t){return this.keyToLocation.get(t)}},{key:"isEmpty",value:function e(){return this.freePointer.x===0&&this.freePointer.row===0}},{key:"canFit",value:function e(t){if(this.locked)return false;var r=this.texSize,a=this.texRows;var n=this.getScale(t),i=n.texW;if(this.freePointer.x+i>r){return this.freePointer.row1&&arguments[1]!==undefined?arguments[1]:{},a=r.forceRedraw,n=a===undefined?false:a,i=r.filterEle,o=i===undefined?function(){return true}:i,s=r.filterType,l=s===undefined?function(){return true}:s;var v=false;var f=false;var c=u(t),d;try{for(c.s();!(d=c.n()).done;){var h=d.value;if(o(h)){var p=u(this.renderTypes.values()),g;try{for(p.s();!(g=p.n()).done;){var y=g.value;var m=y.type;if(l(m)){var b=y.getKey(h);var x=this.collections.get(y.collection);if(n){x.markKeyForGC(b);f=true}else{var w=y.getID?y.getID(h):h.id();var E=this._key(m,w);var T=this.typeAndIdToKey.get(E);if(T!==undefined&&T!==b){this.typeAndIdToKey["delete"](E);x.markKeyForGC(T);v=true}}}}}catch(k){p.e(k)}finally{p.f()}}}}catch(k){c.e(k)}finally{c.f()}if(f){this.gc();v=false}return v}},{key:"gc",value:function e(){var t=u(this.collections.values()),r;try{for(t.s();!(r=t.n()).done;){var a=r.value;a.gc()}}catch(n){t.e(n)}finally{t.f()}}},{key:"getOrCreateAtlas",value:function e(t,r,a){var n=this.renderTypes.get(r);var i=n.getKey(t);if(!a)a=n.getBoundingBox(t);var o=this.collections.get(n.collection);var s=false;var l=o.draw(i,a,(function(e){n.drawElement(e,t,a,true,true);s=true}));if(s){var u=n.getID?n.getID(t):t.id();var v=this._key(r,u);this.typeAndIdToKey.set(v,i)}return l}},{key:"startBatch",value:function e(){this.batchAtlases=[]}},{key:"getAtlasCount",value:function e(){return this.batchAtlases.length}},{key:"getAtlases",value:function e(){return this.batchAtlases}},{key:"canAddToCurrentBatch",value:function e(t,r){if(this.batchAtlases.length===this.maxAtlasesPerBatch){var a=this.renderTypes.get(r);var n=a.getKey(t);var i=this.collections.get(a.collection);var o=i.getAtlas(n);return Boolean(o)&&this.batchAtlases.includes(o)}return true}},{key:"getAtlasIndexForBatch",value:function e(t){var r=this.batchAtlases.indexOf(t);if(r<0){if(this.batchAtlases.length===this.maxAtlasesPerBatch){return}this.batchAtlases.push(t);r=this.batchAtlases.length-1}return r}},{key:"getIndexArray",value:function e(){return Array.from({length:this.maxAtlasesPerBatch},(function(e,t){return t}))}},{key:"getAtlasInfo",value:function e(t,r){var a=this.renderTypes.get(r);var n=a.getBoundingBox(t);var i=this.getOrCreateAtlas(t,r,n);var o=this.getAtlasIndexForBatch(i);if(o===undefined){return undefined}var s=a.getKey(t);var l=i.getOffsets(s),u=p(l,2),v=u[0],f=u[1];return{index:o,tex1:v,tex2:f,bb:n}}},{key:"setTransformMatrix",value:function e(t,r,a,n){var i=arguments.length>4&&arguments[4]!==undefined?arguments[4]:true;var o=this.getRenderTypeOpts(a);var s=o.getPadding?o.getPadding(t):0;if(n){var l=n.bb,u=n.tex1,v=n.tex2;var f=u.w/(u.w+v.w);if(!i){f=1-f}var c=this.getAdjustedBB(l,s,i,f);this._applyTransformMatrix(r,c,o,t)}else{var d=o.getBoundingBox(t);var h=this.getAdjustedBB(d,s,true,1);this._applyTransformMatrix(r,h,o,t)}}},{key:"_applyTransformMatrix",value:function e(t,r,a,n){var i,o;Lh(t);var s=a.getRotation?a.getRotation(n):0;if(s!==0){var l=a.getRotationPoint(n),u=l.x,v=l.y;zh(t,t,[u,v]);Fh(t,t,s);var f=a.getRotationOffset(n);i=f.x+r.xOffset;o=f.y}else{i=r.x1;o=r.y1}zh(t,t,[i,o]);Vh(t,t,[r.w,r.h])}},{key:"getAdjustedBB",value:function e(t,r,a,n){var i=t.x1,o=t.y1,s=t.w,l=t.h;if(r){i-=r;o-=r;s+=2*r;l+=2*r}var u=0;var v=s*n;if(a&&n<1){s=v}else if(!a&&n<1){u=s-v;i+=u;s=v}return{x1:i,y1:o,w:s,h:l,xOffset:u}}},{key:"getDebugInfo",value:function e(){var t=[];var r=u(this.collections),a;try{for(r.s();!(a=r.n()).done;){var n=p(a.value,2),i=n[0],o=n[1];var s=o.getCounts(),l=s.keyCount,v=s.atlasCount;t.push({type:i,keyCount:l,atlasCount:v})}}catch(f){r.e(f)}finally{r.f()}return t}}])}();var Kh=0;var Zh=1;var $h=2;var Qh=3;var Jh=4;var ep=function(){function e(t,r,a){o(this,e);this.r=t;this.gl=r;this.maxInstances=a.webglBatchSize;this.atlasSize=a.webglTexSize;this.bgColor=a.bgColor;this.debug=a.webglDebug;this.batchDebugInfo=[];a.enableWrapping=true;a.createTextureCanvas=xh;this.atlasManager=new Hh(t,a);this.program=this.createShaderProgram(Xh.SCREEN);this.pickingProgram=this.createShaderProgram(Xh.PICKING);this.vao=this.createVAO()}return l(e,[{key:"addAtlasCollection",value:function e(t,r){this.atlasManager.addAtlasCollection(t,r)}},{key:"addAtlasRenderType",value:function e(t,r){this.atlasManager.addRenderType(t,r)}},{key:"invalidate",value:function e(t){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},a=r.type;var n=this.atlasManager;if(a){return n.invalidate(t,{filterType:function e(t){return t===a},forceRedraw:true})}else{return n.invalidate(t)}}},{key:"gc",value:function e(){this.atlasManager.gc()}},{key:"createShaderProgram",value:function e(t){var r=this.gl;var a="#version 300 es\n precision highp float;\n\n uniform mat3 uPanZoomMatrix;\n uniform int uAtlasSize;\n \n // instanced\n in vec2 aPosition; \n\n in mat3 aTransform;\n\n // what are we rendering?\n in int aVertType;\n\n // for picking\n in vec4 aIndex;\n \n // For textures\n in int aAtlasId; // which shader unit/atlas to use\n in vec4 aTex; // x/y/w/h of texture in atlas\n\n // for edges\n in vec4 aPointAPointB;\n in vec4 aPointCPointD;\n in float aLineWidth;\n in vec4 aColor;\n\n out vec2 vTexCoord;\n out vec4 vColor;\n flat out int vAtlasId;\n flat out vec4 vIndex;\n flat out int vVertType;\n\n void main(void) {\n int vid = gl_VertexID;\n vec2 position = aPosition;\n\n if(aVertType == ".concat(Kh,") {\n float texX = aTex.x;\n float texY = aTex.y;\n float texW = aTex.z;\n float texH = aTex.w;\n\n int vid = gl_VertexID;\n\n if(vid == 1 || vid == 2 || vid == 4) {\n texX += texW;\n }\n if(vid == 2 || vid == 4 || vid == 5) {\n texY += texH;\n }\n\n float d = float(uAtlasSize);\n vTexCoord = vec2(texX / d, texY / d); // tex coords must be between 0 and 1\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n }\n else if(aVertType == ").concat(Jh,") {\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else if(aVertType == ").concat(Zh,") {\n vec2 source = aPointAPointB.xy;\n vec2 target = aPointAPointB.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 xBasis = target - source;\n vec2 yBasis = normalize(vec2(-xBasis.y, xBasis.x));\n vec2 point = source + xBasis * position.x + yBasis * aLineWidth * position.y;\n\n gl_Position = vec4(uPanZoomMatrix * vec3(point, 1.0), 1.0);\n vColor = aColor;\n } \n else if(aVertType == ").concat($h,") {\n vec2 pointA = aPointAPointB.xy;\n vec2 pointB = aPointAPointB.zw;\n vec2 pointC = aPointCPointD.xy;\n vec2 pointD = aPointCPointD.zw;\n\n // adjust the geometry so that the line is centered on the edge\n position.y = position.y - 0.5;\n\n vec2 p0 = pointA;\n vec2 p1 = pointB;\n vec2 p2 = pointC;\n vec2 pos = position;\n if(position.x == 1.0) {\n p0 = pointD;\n p1 = pointC;\n p2 = pointB;\n pos = vec2(0.0, -position.y);\n }\n\n vec2 p01 = p1 - p0;\n vec2 p12 = p2 - p1;\n vec2 p21 = p1 - p2;\n\n // Find the normal vector.\n vec2 tangent = normalize(normalize(p12) + normalize(p01));\n vec2 normal = vec2(-tangent.y, tangent.x);\n\n // Find the vector perpendicular to p0 -> p1.\n vec2 p01Norm = normalize(vec2(-p01.y, p01.x));\n\n // Determine the bend direction.\n float sigma = sign(dot(p01 + p21, normal));\n float width = aLineWidth;\n\n if(sign(pos.y) == -sigma) {\n // This is an intersecting vertex. Adjust the position so that there's no overlap.\n vec2 point = 0.5 * width * normal * -sigma / dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n } else {\n // This is a non-intersecting vertex. Treat it like a mitre join.\n vec2 point = 0.5 * width * normal * sigma * dot(normal, p01Norm);\n gl_Position = vec4(uPanZoomMatrix * vec3(p1 + point, 1.0), 1.0);\n }\n\n vColor = aColor;\n } \n else if(aVertType == ").concat(Qh," && vid < 3) {\n // massage the first triangle into an edge arrow\n if(vid == 0)\n position = vec2(-0.15, -0.3);\n if(vid == 1)\n position = vec2( 0.0, 0.0);\n if(vid == 2)\n position = vec2( 0.15, -0.3);\n\n gl_Position = vec4(uPanZoomMatrix * aTransform * vec3(position, 1.0), 1.0);\n vColor = aColor;\n }\n else {\n gl_Position = vec4(2.0, 0.0, 0.0, 1.0); // discard vertex by putting it outside webgl clip space\n }\n\n vAtlasId = aAtlasId;\n vIndex = aIndex;\n vVertType = aVertType;\n }\n ");var n=this.atlasManager.getIndexArray();var i="#version 300 es\n precision highp float;\n\n // define texture unit for each node in the batch\n ".concat(n.map((function(e){return"uniform sampler2D uTexture".concat(e,";")})).join("\n\t"),"\n\n uniform vec4 uBGColor;\n\n in vec2 vTexCoord;\n in vec4 vColor;\n flat in int vAtlasId;\n flat in vec4 vIndex;\n flat in int vVertType;\n\n out vec4 outColor;\n\n void main(void) {\n if(vVertType == ").concat(Kh,") {\n ").concat(n.map((function(e){return"if(vAtlasId == ".concat(e,") outColor = texture(uTexture").concat(e,", vTexCoord);")})).join("\n\telse "),"\n } else if(vVertType == ").concat(Qh,") {\n // blend arrow color with background (using premultiplied alpha)\n outColor.rgb = vColor.rgb + (uBGColor.rgb * (1.0 - vColor.a)); \n outColor.a = 1.0; // make opaque, masks out line under arrow\n } else {\n outColor = vColor;\n }\n\n ").concat(t.picking?"if(outColor.a == 0.0) discard;\n else outColor = vIndex;":"","\n }\n ");var o=bh(r,a,i);o.aPosition=r.getAttribLocation(o,"aPosition");o.aIndex=r.getAttribLocation(o,"aIndex");o.aVertType=r.getAttribLocation(o,"aVertType");o.aTransform=r.getAttribLocation(o,"aTransform");o.aAtlasId=r.getAttribLocation(o,"aAtlasId");o.aTex=r.getAttribLocation(o,"aTex");o.aPointAPointB=r.getAttribLocation(o,"aPointAPointB");o.aPointCPointD=r.getAttribLocation(o,"aPointCPointD");o.aLineWidth=r.getAttribLocation(o,"aLineWidth");o.aColor=r.getAttribLocation(o,"aColor");o.uPanZoomMatrix=r.getUniformLocation(o,"uPanZoomMatrix");o.uAtlasSize=r.getUniformLocation(o,"uAtlasSize");o.uBGColor=r.getUniformLocation(o,"uBGColor");o.uTextures=[];for(var s=0;s1&&arguments[1]!==undefined?arguments[1]:Xh.SCREEN;this.panZoomMatrix=t;this.renderTarget=r;this.batchDebugInfo=[];this.wrappedCount=0;this.rectangleCount=0;this.startBatch()}},{key:"startBatch",value:function e(){this.instanceCount=0;this.atlasManager.startBatch()}},{key:"endFrame",value:function e(){this.endBatch()}},{key:"getTempMatrix",value:function e(){return this.tempMatrix=this.tempMatrix||Nh()}},{key:"drawTexture",value:function e(t,r,a){var n=this.atlasManager;if(!t.visible()){return}if(!n.getRenderTypeOpts(a).isVisible(t)){return}if(!n.canAddToCurrentBatch(t,a)){this.endBatch()}if(this.instanceCount+1>=this.maxInstances){this.endBatch()}var i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=Kh;var o=this.indexBuffer.getView(i);kh(r,o);var s=n.getAtlasInfo(t,a);var l=s.index,u=s.tex1,v=s.tex2;if(v.w>0)this.wrappedCount++;var f=true;for(var c=0,d=[u,v];c=this.maxInstances){this.endBatch()}}},{key:"drawSimpleRectangle",value:function e(t,r,a){if(!t.visible()){return}var n=this.atlasManager;var i=this.instanceCount;this.vertTypeBuffer.getView(i)[0]=Jh;var o=this.indexBuffer.getView(i);kh(r,o);var s=t.pstyle("background-color").value;var l=t.pstyle("background-opacity").value;var u=this.colorBuffer.getView(i);Th(s,l,u);var v=this.transformBuffer.getMatrixView(i);n.setTransformMatrix(t,v,a);this.rectangleCount++;this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}},{key:"drawEdgeArrow",value:function e(t,r,a){if(!t.visible()){return}var n=t._private.rscratch;var i,o,s;if(a==="source"){i=n.arrowStartX;o=n.arrowStartY;s=n.srcArrowAngle}else{i=n.arrowEndX;o=n.arrowEndY;s=n.tgtArrowAngle}if(isNaN(i)||i==null||isNaN(o)||o==null||isNaN(s)||s==null){return}var l=t.pstyle(a+"-arrow-shape").value;if(l==="none"){return}var u=t.pstyle(a+"-arrow-color").value;var v=t.pstyle("opacity").value;var f=t.pstyle("line-opacity").value;var c=v*f;var d=t.pstyle("width").pfValue;var h=t.pstyle("arrow-scale").value;var p=this.r.getArrowWidth(d,h);var g=this.instanceCount;var y=this.transformBuffer.getMatrixView(g);Lh(y);zh(y,y,[i,o]);Vh(y,y,[p,p]);Fh(y,y,s);this.vertTypeBuffer.getView(g)[0]=Qh;var m=this.indexBuffer.getView(g);kh(r,m);var b=this.colorBuffer.getView(g);Th(u,c,b);this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}},{key:"drawEdgeLine",value:function e(t,r){if(!t.visible()){return}var a=this.getEdgePoints(t);if(!a){return}var n=t.pstyle("opacity").value;var i=t.pstyle("line-opacity").value;var o=t.pstyle("width").pfValue;var s=t.pstyle("line-color").value;var l=n*i;if(a.length/2+this.instanceCount>this.maxInstances){this.endBatch()}if(a.length==4){var u=this.instanceCount;this.vertTypeBuffer.getView(u)[0]=Zh;var v=this.indexBuffer.getView(u);kh(r,v);var f=this.colorBuffer.getView(u);Th(s,l,f);var c=this.lineWidthBuffer.getView(u);c[0]=o;var d=this.pointAPointBBuffer.getView(u);d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];this.instanceCount++;if(this.instanceCount>=this.maxInstances){this.endBatch()}}else{for(var h=0;h=this.maxInstances){this.endBatch()}}}}},{key:"getEdgePoints",value:function e(t){var r=t._private.rscratch;if(r.badLine||r.allpts==null||isNaN(r.allpts[0])){return}var a=r.allpts;if(a.length==4){return a}var n=this.getNumSegments(t);return this.getCurveSegmentPoints(a,n)}},{key:"getNumSegments",value:function e(t){var r=15;return Math.min(Math.max(r,5),this.maxInstances)}},{key:"getCurveSegmentPoints",value:function e(t,r){if(t.length==4){return t}var a=Array((r+1)*2);for(var n=0;n<=r;n++){if(n==0){a[0]=t[0];a[1]=t[1]}else if(n==r){a[n*2]=t[t.length-2];a[n*2+1]=t[t.length-1]}else{var i=n/r;this.setCurvePoint(t,i,a,n*2)}}return a}},{key:"setCurvePoint",value:function e(t,r,a,n){if(t.length<=2){a[n]=t[0];a[n+1]=t[1]}else{var i=Array(t.length-2);for(var o=0;o0}},{key:"getStyle",value:function e(t,r){var a=r.pstyle("".concat(t,"-opacity")).value;var n=r.pstyle("".concat(t,"-color")).value;var i=r.pstyle("".concat(t,"-shape")).value;return{opacity:a,color:n,shape:i}}},{key:"getPadding",value:function e(t,r){return r.pstyle("".concat(t,"-padding")).pfValue}},{key:"draw",value:function e(t,r,a,n){if(!this.isVisible(t,a))return;var i=this.r;var o=n.w;var s=n.h;var l=o/2;var u=s/2;var v=this.getStyle(t,a),f=v.shape,c=v.color,d=v.opacity;r.save();r.fillStyle=tp(c,d);if(f==="round-rectangle"||f==="roundrectangle"){i.drawRoundRectanglePath(r,l,u,o,s,"auto")}else if(f==="ellipse"){i.drawEllipsePath(r,l,u,o,s)}r.fill();r.restore()}}])}();var ap={};ap.initWebgl=function(e,t){var r=this;var a=r.data.contexts[r.WEBGL];e.bgColor=np(r);e.webglTexSize=Math.min(e.webglTexSize,a.getParameter(a.MAX_TEXTURE_SIZE));e.webglTexRows=Math.min(e.webglTexRows,54);e.webglTexRowsNodes=Math.min(e.webglTexRowsNodes,54);e.webglBatchSize=Math.min(e.webglBatchSize,16384);e.webglTexPerBatch=Math.min(e.webglTexPerBatch,a.getParameter(a.MAX_TEXTURE_IMAGE_UNITS));r.webglDebug=e.webglDebug;r.webglDebugShowAtlases=e.webglDebugShowAtlases;r.pickingFrameBuffer=Ih(a);r.pickingFrameBuffer.needsDraw=true;var n=function e(t){return function(e){return r.getTextAngle(e,t)}};var i=function e(t){return function(e){var r=e.pstyle(t);return r&&r.value}};r.drawing=new ep(r,a,e);var o=new rp(r);r.drawing.addAtlasCollection("node",Yh({texRows:e.webglTexRowsNodes}));r.drawing.addAtlasCollection("label",Yh({texRows:e.webglTexRows}));r.drawing.addAtlasRenderType("node-body",qh({collection:"node",getKey:t.getStyleKey,getBoundingBox:t.getElementBox,drawElement:t.drawElement}));r.drawing.addAtlasRenderType("label",qh({collection:"label",getKey:t.getLabelKey,getBoundingBox:t.getLabelBox,drawElement:t.drawLabel,getRotation:n(null),getRotationPoint:t.getLabelRotationPoint,getRotationOffset:t.getLabelRotationOffset,isVisible:i("label")}));r.drawing.addAtlasRenderType("node-overlay",qh({collection:"node",getBoundingBox:t.getElementBox,getKey:function e(t){return o.getStyleKey("overlay",t)},drawElement:function e(t,r,a){return o.draw("overlay",t,r,a)},isVisible:function e(t){return o.isVisible("overlay",t)},getPadding:function e(t){return o.getPadding("overlay",t)}}));r.drawing.addAtlasRenderType("node-underlay",qh({collection:"node",getBoundingBox:t.getElementBox,getKey:function e(t){return o.getStyleKey("underlay",t)},drawElement:function e(t,r,a){return o.draw("underlay",t,r,a)},isVisible:function e(t){return o.isVisible("underlay",t)},getPadding:function e(t){return o.getPadding("underlay",t)}}));r.drawing.addAtlasRenderType("edge-source-label",qh({collection:"label",getKey:t.getSourceLabelKey,getBoundingBox:t.getSourceLabelBox,drawElement:t.drawSourceLabel,getRotation:n("source"),getRotationPoint:t.getSourceLabelRotationPoint,getRotationOffset:t.getSourceLabelRotationOffset,isVisible:i("source-label")}));r.drawing.addAtlasRenderType("edge-target-label",qh({collection:"label",getKey:t.getTargetLabelKey,getBoundingBox:t.getTargetLabelBox,drawElement:t.drawTargetLabel,getRotation:n("target"),getRotationPoint:t.getTargetLabelRotationPoint,getRotationOffset:t.getTargetLabelRotationOffset,isVisible:i("target-label")}));var s=st((function(){console.log("garbage collect flag set");r.data.gc=true}),1e4);r.onUpdateEleCalcs((function(e,t){var a=false;if(t&&t.length>0){a|=r.drawing.invalidate(t)}if(a){s()}}));ip(r)};function np(e){var t=e.cy.container();var r=t&&t.style&&t.style.backgroundColor||"white";return ce(r)}function ip(e){{var t=e.render;e.render=function(r){r=r||{};var a=e.cy;if(e.webgl){if(a.zoom()>fd){op(e);t.call(e,r)}else{sp(e);yp(e,r,Xh.SCREEN)}}}}{var r=e.matchCanvasSize;e.matchCanvasSize=function(t){r.call(e,t);e.pickingFrameBuffer.setFramebufferAttachmentSizes(e.canvasWidth,e.canvasHeight);e.pickingFrameBuffer.needsDraw=true}}{e.findNearestElements=function(t,r,a,n){return hp(e,t,r)}}{var a=e.invalidateCachedZSortedEles;e.invalidateCachedZSortedEles=function(){a.call(e);e.pickingFrameBuffer.needsDraw=true}}{var n=e.notify;e.notify=function(t,r){n.call(e,t,r);if(t==="viewport"||t==="bounds"){e.pickingFrameBuffer.needsDraw=true}else if(t==="background"){e.drawing.invalidate(r,{type:"node-body"})}}}}function op(e){var t=e.data.contexts[e.WEBGL];t.clear(t.COLOR_BUFFER_BIT|t.DEPTH_BUFFER_BIT)}function sp(e){var t=function t(r){r.save();r.setTransform(1,0,0,1,0,0);r.clearRect(0,0,e.canvasWidth,e.canvasHeight);r.restore()};t(e.data.contexts[e.NODE]);t(e.data.contexts[e.DRAG])}function lp(e){var t=e.canvasWidth;var r=e.canvasHeight;var a=wh(e),n=a.pan,i=a.zoom;var o=Nh();zh(o,o,[n.x,n.y]);Vh(o,o,[i,i]);var s=Nh();jh(s,t,r);var l=Nh();Oh(l,s,o);return l}function up(e,t){var r=e.canvasWidth;var a=e.canvasHeight;var n=wh(e),i=n.pan,o=n.zoom;t.setTransform(1,0,0,1,0,0);t.clearRect(0,0,r,a);t.translate(i.x,i.y);t.scale(o,o)}function vp(e,t){e.drawSelectionRectangle(t,(function(t){return up(e,t)}))}function fp(e){var t=e.data.contexts[e.NODE];t.save();up(e,t);t.strokeStyle="rgba(0, 0, 0, 0.3)";t.beginPath();t.moveTo(-1e3,0);t.lineTo(1e3,0);t.stroke();t.beginPath();t.moveTo(0,-1e3);t.lineTo(0,1e3);t.stroke();t.restore()}function cp(e){var t=function t(r,a,n){var i=r.atlasManager.getAtlasCollection(a);var o=e.data.contexts[e.NODE];var s=.125;var l=i.atlases;for(var u=0;u=0){w.add(k)}}return w}function hp(e,t,r){var a=dp(e,t,r);var n=e.getCachedZSortedEles();var i,o;var s=u(a),l;try{for(s.s();!(l=s.n()).done;){var v=l.value;var f=n[v];if(!i&&f.isNode()){i=f}if(!o&&f.isEdge()){o=f}if(i&&o){break}}}catch(c){s.e(c)}finally{s.f()}return[i,o].filter(Boolean)}function pp(e){return e.pstyle("shape").value==="rectangle"&&e.pstyle("background-fill").value==="solid"&&e.pstyle("border-width").pfValue===0&&e.pstyle("background-image").strValue==="none"}function gp(e,t,r){var a=e.drawing;t+=1;if(r.isNode()){a.drawTexture(r,t,"node-underlay");if(pp(r)){a.drawSimpleRectangle(r,t,"node-body")}else{a.drawTexture(r,t,"node-body")}a.drawTexture(r,t,"label");a.drawTexture(r,t,"node-overlay")}else{a.drawEdgeLine(r,t);a.drawEdgeArrow(r,t,"source");a.drawEdgeArrow(r,t,"target");a.drawTexture(r,t,"label");a.drawTexture(r,t,"edge-source-label");a.drawTexture(r,t,"edge-target-label")}}function yp(e,t,r){var a;if(e.webglDebug){a=performance.now()}var n=e.drawing;var i=0;if(r.screen){if(e.data.canvasNeedsRedraw[e.SELECT_BOX]){vp(e,t)}}if(e.data.canvasNeedsRedraw[e.NODE]||r.picking){var o=e.data.contexts[e.WEBGL];if(r.screen){o.clearColor(0,0,0,0);o.enable(o.BLEND);o.blendFunc(o.ONE,o.ONE_MINUS_SRC_ALPHA)}else{o.disable(o.BLEND)}o.clear(o.COLOR_BUFFER_BIT|o.DEPTH_BUFFER_BIT);o.viewport(0,0,o.canvas.width,o.canvas.height);var s=lp(e);var l=e.getCachedZSortedEles();i=l.length;n.startFrame(s,r);if(r.screen){for(var v=0;v0&&o>0){d.clearRect(0,0,i,o);d.globalCompositeOperation="source-over";var h=this.getCachedZSortedEles();if(e.full){d.translate(-a.x1*u,-a.y1*u);d.scale(u,u);this.drawElements(d,h);d.scale(1/u,1/u);d.translate(a.x1*u,a.y1*u)}else{var p=t.pan();var g={x:p.x*u,y:p.y*u};u*=t.zoom();d.translate(g.x,g.y);d.scale(u,u);this.drawElements(d,h);d.scale(1/u,1/u);d.translate(-g.x,-g.y)}if(e.bg){d.globalCompositeOperation="destination-over";d.fillStyle=e.bg;d.rect(0,0,i,o);d.fill()}}return c};function Pp(e,t){var r=atob(e);var a=new ArrayBuffer(r.length);var n=new Uint8Array(a);for(var i=0;i=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(r,"__esModule",{value:true});r.MathJax=r.combineWithMathJax=r.combineDefaults=r.combineConfig=r.isObject=void 0;var n=t(71471);function o(e){return typeof e==="object"&&e!==null}r.isObject=o;function i(e,r){var t,n;try{for(var s=a(Object.keys(r)),l=s.next();!l.done;l=s.next()){var f=l.value;if(f==="__esModule")continue;if(o(e[f])&&o(r[f])&&!(r[f]instanceof Promise)){i(e[f],r[f])}else if(r[f]!==null&&r[f]!==undefined){e[f]=r[f]}}}catch(c){t={error:c}}finally{try{if(l&&!l.done&&(n=s.return))n.call(s)}finally{if(t)throw t.error}}return e}r.combineConfig=i;function s(e,r,t){var n,i;if(!e[r]){e[r]={}}e=e[r];try{for(var l=a(Object.keys(t)),f=l.next();!f.done;f=l.next()){var c=f.value;if(o(e[c])&&o(t[c])){s(e,c,t[c])}else if(e[c]==null&&t[c]!=null){e[c]=t[c]}}}catch(u){n={error:u}}finally{try{if(f&&!f.done&&(i=l.return))i.call(l)}finally{if(n)throw n.error}}return e}r.combineDefaults=s;function l(e){return i(r.MathJax,e)}r.combineWithMathJax=l;if(typeof t.g.MathJax==="undefined"){t.g.MathJax={}}if(!t.g.MathJax.version){t.g.MathJax={version:n.VERSION,_:{},config:t.g.MathJax}}r.MathJax=t.g.MathJax},59228:function(e,r,t){var a="/";var n=this&&this.__values||function(e){var r=typeof Symbol==="function"&&Symbol.iterator,t=r&&e[r],a=0;if(t)return t.call(e);if(e&&typeof e.length==="number")return{next:function(){if(e&&a>=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};var o,i;Object.defineProperty(r,"__esModule",{value:true});r.CONFIG=r.MathJax=r.Loader=r.PathFilters=r.PackageError=r.Package=void 0;var s=t(58496);var l=t(6875);var f=t(6875);Object.defineProperty(r,"Package",{enumerable:true,get:function(){return f.Package}});Object.defineProperty(r,"PackageError",{enumerable:true,get:function(){return f.PackageError}});var c=t(43899);r.PathFilters={source:function(e){if(r.CONFIG.source.hasOwnProperty(e.name)){e.name=r.CONFIG.source[e.name]}return true},normalize:function(e){var r=e.name;if(!r.match(/^(?:[a-z]+:\/)?\/|[a-z]:\\|\[/i)){e.name="[mathjax]/"+r.replace(/^\.\//,"")}if(e.addExtension&&!r.match(/\.[^\/]+$/)){e.name+=".js"}return true},prefix:function(e){var t;while(t=e.name.match(/^\[([^\]]*)\]/)){if(!r.CONFIG.paths.hasOwnProperty(t[1]))break;e.name=r.CONFIG.paths[t[1]]+e.name.substr(t[0].length)}return true}};var u;(function(e){var t=s.MathJax.version;e.versions=new Map;function o(){var e,r;var t=[];for(var a=0;a=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};var o=this&&this.__read||function(e,r){var t=typeof Symbol==="function"&&e[Symbol.iterator];if(!t)return e;var a=t.call(e),n,o=[],i;try{while((r===void 0||r-- >0)&&!(n=a.next()).done)o.push(n.value)}catch(s){i={error:s}}finally{try{if(n&&!n.done&&(t=a["return"]))t.call(a)}finally{if(i)throw i.error}}return o};var i=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,o;a=e.length)e=void 0;return{value:e&&e[a++],done:!e}}};throw new TypeError(r?"Object is not iterable.":"Symbol.iterator is not defined.")};var n=this&&this.__read||function(e,r){var t=typeof Symbol==="function"&&e[Symbol.iterator];if(!t)return e;var a=t.call(e),n,o=[],i;try{while((r===void 0||r-- >0)&&!(n=a.next()).done)o.push(n.value)}catch(s){i={error:s}}finally{try{if(n&&!n.done&&(t=a["return"]))t.call(a)}finally{if(i)throw i.error}}return o};var o=this&&this.__spreadArray||function(e,r,t){if(t||arguments.length===2)for(var a=0,n=r.length,o;a{n.r(t);n.d(t,{cython:()=>c,mkPython:()=>s,python:()=>u});function r(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}var i=r(["and","or","not","is"]);var a=["as","assert","break","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","lambda","pass","raise","return","try","while","with","yield","in","False","True"];var o=["abs","all","any","bin","bool","bytearray","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__","NotImplemented","Ellipsis","__debug__"];function l(e){return e.scopes[e.scopes.length-1]}function s(e){var t="error";var n=e.delimiters||e.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.\\]/;var s=[e.singleOperators,e.doubleOperators,e.doubleDelimiters,e.tripleDelimiters,e.operators||/^([-+*/%\/&|^]=?|[<>=]+|\/\/=?|\*\*=?|!=|[~!@]|\.\.\.)/];for(var f=0;fi)_(e,n);else if(a0&&z(e,n))o+=" "+t;return o}}return v(e,n)}function v(e,r,a){if(e.eatSpace())return null;if(!a&&e.match(/^#.*/))return"comment";if(e.match(/^[0-9\.]/,false)){var o=false;if(e.match(/^[\d_]*\.\d+(e[\+\-]?\d+)?/i)){o=true}if(e.match(/^[\d_]+\.\d*/)){o=true}if(e.match(/^\.\d+/)){o=true}if(o){e.eat(/J/i);return"number"}var l=false;if(e.match(/^0x[0-9a-f_]+/i))l=true;if(e.match(/^0b[01_]+/i))l=true;if(e.match(/^0o[0-7_]+/i))l=true;if(e.match(/^[1-9][\d_]*(e[\+\-]?[\d_]+)?/)){e.eat(/J/i);l=true}if(e.match(/^0(?![\dx])/i))l=true;if(l){e.eat(/L/i);return"number"}}if(e.match(h)){var f=e.current().toLowerCase().indexOf("f")!==-1;if(!f){r.tokenize=x(e.current(),r.tokenize);return r.tokenize(e,r)}else{r.tokenize=k(e.current(),r.tokenize);return r.tokenize(e,r)}}for(var u=0;u=0)n=n.substr(1);var i=n.length==1;var a="string";function o(e){return function(t,n){var r=v(t,n,true);if(r=="punctuation"){if(t.current()=="{"){n.tokenize=o(e+1)}else if(t.current()=="}"){if(e>1)n.tokenize=o(e-1);else n.tokenize=l}}return r}}function l(l,s){while(!l.eol()){l.eatWhile(/[^'"\{\}\\]/);if(l.eat("\\")){l.next();if(i&&l.eol())return a}else if(l.match(n)){s.tokenize=r;return a}else if(l.match("{{")){return a}else if(l.match("{",false)){s.tokenize=o(0);if(l.current())return a;else return s.tokenize(l,s)}else if(l.match("}}")){return a}else if(l.match("}")){return t}else{l.eat(/['"]/)}}if(i){if(e.singleLineStringErrors)return t;else s.tokenize=r}return a}l.isString=true;return l}function x(n,r){while("rubf".indexOf(n.charAt(0).toLowerCase())>=0)n=n.substr(1);var i=n.length==1;var a="string";function o(o,l){while(!o.eol()){o.eatWhile(/[^'"\\]/);if(o.eat("\\")){o.next();if(i&&o.eol())return a}else if(o.match(n)){l.tokenize=r;return a}else{o.eat(/['"]/)}}if(i){if(e.singleLineStringErrors)return t;else l.tokenize=r}return a}o.isString=true;return o}function _(e,t){while(l(t).type!="py")t.scopes.pop();t.scopes.push({offset:l(t).offset+e.indentUnit,type:"py",align:null})}function w(e,t,n){var r=e.match(/^[\s\[\{\(]*(?:#|$)/,false)?null:e.column()+1;t.scopes.push({offset:t.indent+(u||e.indentUnit),type:n,align:r})}function z(e,t){var n=e.indentation();while(t.scopes.length>1&&l(t).offset>n){if(l(t).type!="py")return true;t.scopes.pop()}return l(t).offset!=n}function F(e,n){if(e.sol()){n.beginningOfLine=true;n.dedent=false}var r=n.tokenize(e,n);var i=e.current();if(n.beginningOfLine&&i=="@")return e.match(m,false)?"meta":d?"operator":t;if(/\S/.test(i))n.beginningOfLine=false;if((r=="variable"||r=="builtin")&&n.lastToken=="meta")r="meta";if(i=="pass"||i=="return")n.dedent=true;if(i=="lambda")n.lambda=true;if(i==":"&&!n.lambda&&l(n).type=="py"&&e.match(/^\s*(?:#|$)/,false))_(e,n);if(i.length==1&&!/string|comment/.test(r)){var a="[({".indexOf(i);if(a!=-1)w(e,n,"])}".slice(a,a+1));a="])}".indexOf(i);if(a!=-1){if(l(n).type==i)n.indent=n.scopes.pop().offset-(u||e.indentUnit);else return t}}if(n.dedent&&e.eol()&&l(n).type=="py"&&n.scopes.length>1)n.scopes.pop();return r}return{name:"python",startState:function(){return{tokenize:g,scopes:[{offset:0,type:"py",align:null}],indent:0,lastToken:null,lambda:false,dedent:0}},token:function(e,n){var r=n.errorToken;if(r)n.errorToken=false;var i=F(e,n);if(i&&i!="comment")n.lastToken=i=="keyword"||i=="punctuation"?e.current():i;if(i=="punctuation")i=null;if(e.eol()&&n.lambda)n.lambda=false;return r?t:i},indent:function(e,t,n){if(e.tokenize!=g)return e.tokenize.isString?null:0;var r=l(e);var i=r.type==t.charAt(0)||r.type=="py"&&!e.dedent&&/^(else:|elif |except |finally:)/.test(t);if(r.align!=null)return r.align-(i?1:0);else return r.offset-(i?u||n.unit:0)},languageData:{autocomplete:a.concat(o).concat(["exec","print"]),indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:)$/,commentTokens:{line:"#"},closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""']}}}}var f=function(e){return e.split(" ")};const u=s({});const c=s({extra_keywords:f("by cdef cimport cpdef ctypedef enum except "+"extern gil include nogil property public "+"readonly struct union DEF IF ELIF ELSE")})}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8855.b17b9969fce42d0398e4.js b/.venv/share/jupyter/lab/static/8855.b17b9969fce42d0398e4.js new file mode 100644 index 0000000000000000000000000000000000000000..a7f223a7fcf4d56daea1e5165c37a9376b4202a4 --- /dev/null +++ b/.venv/share/jupyter/lab/static/8855.b17b9969fce42d0398e4.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8855],{88855:(t,e,s)=>{s.d(e,{Zk:()=>l,q7:()=>Q,tM:()=>Tt,u4:()=>_t});var i=s(15051);var r=s(94065);var n=s(96049);var a=s(75905);var o=function(){var t=(0,a.K2)((function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s}),"o"),e=[1,2],s=[1,3],i=[1,4],r=[2,4],n=[1,9],o=[1,11],l=[1,16],c=[1,17],h=[1,18],d=[1,19],u=[1,32],p=[1,20],f=[1,21],y=[1,22],g=[1,23],m=[1,24],S=[1,26],b=[1,27],k=[1,28],_=[1,29],v=[1,30],T=[1,31],E=[1,34],D=[1,35],x=[1,36],C=[1,37],$=[1,33],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],L=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],A=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54];var w={trace:(0,a.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,classDef:38,CLASSDEF_ID:39,CLASSDEF_STYLEOPTS:40,DEFAULT:41,style:42,STYLE_IDS:43,STYLEDEF_STYLEOPTS:44,class:45,CLASSENTITY_IDS:46,STYLECLASS:47,direction_tb:48,direction_bt:49,direction_rl:50,direction_lr:51,eol:52,";":53,EDGE_STATE:54,STYLE_SEPARATOR:55,left_of:56,right_of:57,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"classDef",39:"CLASSDEF_ID",40:"CLASSDEF_STYLEOPTS",41:"DEFAULT",42:"style",43:"STYLE_IDS",44:"STYLEDEF_STYLEOPTS",45:"class",46:"CLASSENTITY_IDS",47:"STYLECLASS",48:"direction_tb",49:"direction_bt",50:"direction_rl",51:"direction_lr",53:";",54:"EDGE_STATE",55:"STYLE_SEPARATOR",56:"left_of",57:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[52,1],[52,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:(0,a.K2)((function t(e,s,i,r,n,a,o){var l=a.length-1;switch(n){case 3:r.setRootDoc(a[l]);return a[l];break;case 4:this.$=[];break;case 5:if(a[l]!="nl"){a[l-1].push(a[l]);this.$=a[l-1]}break;case 6:case 7:this.$=a[l];break;case 8:this.$="nl";break;case 12:this.$=a[l];break;case 13:const t=a[l-1];t.description=r.trimColon(a[l]);this.$=t;break;case 14:this.$={stmt:"relation",state1:a[l-2],state2:a[l]};break;case 15:const e=r.trimColon(a[l]);this.$={stmt:"relation",state1:a[l-3],state2:a[l-1],description:e};break;case 19:this.$={stmt:"state",id:a[l-3],type:"default",description:"",doc:a[l-1]};break;case 20:var c=a[l];var h=a[l-2].trim();if(a[l].match(":")){var d=a[l].split(":");c=d[0];h=[h,d[1]]}this.$={stmt:"state",id:c,type:"default",description:h};break;case 21:this.$={stmt:"state",id:a[l-3],type:"default",description:a[l-5],doc:a[l-1]};break;case 22:this.$={stmt:"state",id:a[l],type:"fork"};break;case 23:this.$={stmt:"state",id:a[l],type:"join"};break;case 24:this.$={stmt:"state",id:a[l],type:"choice"};break;case 25:this.$={stmt:"state",id:r.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:a[l-1].trim(),note:{position:a[l-2].trim(),text:a[l].trim()}};break;case 29:this.$=a[l].trim();r.setAccTitle(this.$);break;case 30:case 31:this.$=a[l].trim();r.setAccDescription(this.$);break;case 32:case 33:this.$={stmt:"classDef",id:a[l-1].trim(),classes:a[l].trim()};break;case 34:this.$={stmt:"style",id:a[l-1].trim(),styleClass:a[l].trim()};break;case 35:this.$={stmt:"applyClass",id:a[l-1].trim(),styleClass:a[l].trim()};break;case 36:r.setDirection("TB");this.$={stmt:"dir",value:"TB"};break;case 37:r.setDirection("BT");this.$={stmt:"dir",value:"BT"};break;case 38:r.setDirection("RL");this.$={stmt:"dir",value:"RL"};break;case 39:r.setDirection("LR");this.$={stmt:"dir",value:"LR"};break;case 42:case 43:this.$={stmt:"state",id:a[l].trim(),type:"default",description:""};break;case 44:this.$={stmt:"state",id:a[l-2].trim(),classes:[a[l].trim()],type:"default",description:""};break;case 45:this.$={stmt:"state",id:a[l-2].trim(),classes:[a[l].trim()],type:"default",description:""};break}}),"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,42,45,48,49,50,51,54],r,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,5]),{9:38,10:12,11:13,12:14,13:15,16:l,17:c,19:h,22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,39],15:[1,40]}),t(I,[2,16]),{18:[1,41]},t(I,[2,18],{20:[1,42]}),{23:[1,43]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:44,31:[1,45],56:[1,46],57:[1,47]},t(I,[2,28]),{34:[1,48]},{36:[1,49]},t(I,[2,31]),{39:[1,50],41:[1,51]},{43:[1,52]},{46:[1,53]},t(L,[2,42],{55:[1,54]}),t(L,[2,43],{55:[1,55]}),t(I,[2,36]),t(I,[2,37]),t(I,[2,38]),t(I,[2,39]),t(I,[2,6]),t(I,[2,13]),{13:56,24:u,54:$},t(I,[2,17]),t(A,r,{7:57}),{24:[1,58]},{24:[1,59]},{23:[1,60]},{24:[2,46]},{24:[2,47]},t(I,[2,29]),t(I,[2,30]),{40:[1,61]},{40:[1,62]},{44:[1,63]},{47:[1,64]},{24:[1,65]},{24:[1,66]},t(I,[2,14],{14:[1,67]}),{4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,68],22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,20],{20:[1,69]}),{31:[1,70]},{24:[1,71]},t(I,[2,32]),t(I,[2,33]),t(I,[2,34]),t(I,[2,35]),t(L,[2,44]),t(L,[2,45]),t(I,[2,15]),t(I,[2,19]),t(A,r,{7:72}),t(I,[2,26]),t(I,[2,27]),{4:n,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:l,17:c,19:h,21:[1,73],22:d,24:u,25:p,26:f,27:y,28:g,29:m,32:25,33:S,35:b,37:k,38:_,42:v,45:T,48:E,49:D,50:x,51:C,54:$},t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],46:[2,46],47:[2,47]},parseError:(0,a.K2)((function t(e,s){if(s.recoverable){this.trace(e)}else{var i=new Error(e);i.hash=s;throw i}}),"parseError"),parse:(0,a.K2)((function t(e){var s=this,i=[0],r=[],n=[null],o=[],l=this.table,c="",h=0,d=0,u=0,p=2,f=1;var y=o.slice.call(arguments,1);var g=Object.create(this.lexer);var m={yy:{}};for(var S in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,S)){m.yy[S]=this.yy[S]}}g.setInput(e,m.yy);m.yy.lexer=g;m.yy.parser=this;if(typeof g.yylloc=="undefined"){g.yylloc={}}var b=g.yylloc;o.push(b);var k=g.options&&g.options.ranges;if(typeof m.yy.parseError==="function"){this.parseError=m.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function _(t){i.length=i.length-2*t;n.length=n.length-t;o.length=o.length-t}(0,a.K2)(_,"popStack");function v(){var t;t=r.pop()||g.lex()||f;if(typeof t!=="number"){if(t instanceof Array){r=t;t=r.pop()}t=s.symbols_[t]||t}return t}(0,a.K2)(v,"lex");var T,E,D,x,C,$,I={},L,A,w,R;while(true){D=i[i.length-1];if(this.defaultActions[D]){x=this.defaultActions[D]}else{if(T===null||typeof T=="undefined"){T=v()}x=l[D]&&l[D][T]}if(typeof x==="undefined"||!x.length||!x[0]){var O="";R=[];for(L in l[D]){if(this.terminals_[L]&&L>p){R.push("'"+this.terminals_[L]+"'")}}if(g.showPosition){O="Parse error on line "+(h+1)+":\n"+g.showPosition()+"\nExpecting "+R.join(", ")+", got '"+(this.terminals_[T]||T)+"'"}else{O="Parse error on line "+(h+1)+": Unexpected "+(T==f?"end of input":"'"+(this.terminals_[T]||T)+"'")}this.parseError(O,{text:g.match,token:this.terminals_[T]||T,line:g.yylineno,loc:b,expected:R})}if(x[0]instanceof Array&&x.length>1){throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+T)}switch(x[0]){case 1:i.push(T);n.push(g.yytext);o.push(g.yylloc);i.push(x[1]);T=null;if(!E){d=g.yyleng;c=g.yytext;h=g.yylineno;b=g.yylloc;if(u>0){u--}}else{T=E;E=null}break;case 2:A=this.productions_[x[1]][1];I.$=n[n.length-A];I._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column};if(k){I._$.range=[o[o.length-(A||1)].range[0],o[o.length-1].range[1]]}$=this.performAction.apply(I,[c,d,h,m.yy,x[1],n,o].concat(y));if(typeof $!=="undefined"){return $}if(A){i=i.slice(0,-1*A*2);n=n.slice(0,-1*A);o=o.slice(0,-1*A)}i.push(this.productions_[x[1]][0]);n.push(I.$);o.push(I._$);w=l[i[i.length-2]][i[i.length-1]];i.push(w);break;case 3:return true}}return true}),"parse")};var R=function(){var t={EOF:1,parseError:(0,a.K2)((function t(e,s){if(this.yy.parser){this.yy.parser.parseError(e,s)}else{throw new Error(e)}}),"parseError"),setInput:(0,a.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,a.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,a.K2)((function(t){var e=t.length;var s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-e);this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(s.length-1){this.yylineno-=s.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,a.K2)((function(){this._more=true;return this}),"more"),reject:(0,a.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,a.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,a.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,a.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,a.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,a.K2)((function(t,e){var s,i,r;if(this.options.backtrack_lexer){r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){r.yylloc.range=this.yylloc.range.slice(0)}}i=t[0].match(/(?:\r\n?|\n).*/g);if(i){this.yylineno+=i.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(s){return s}else if(this._backtrack){for(var n in r){this[n]=r[n]}return false}return false}),"test_match"),next:(0,a.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,s,i;if(!this._more){this.yytext="";this.match=""}var r=this._currentRules();for(var n=0;ne[0].length)){e=s;i=n;if(this.options.backtrack_lexer){t=this.test_match(s,r[n]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,r[i]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,a.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,a.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,a.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,a.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,a.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,a.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,a.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,a.K2)((function t(e,s,i,r){var n=r;switch(i){case 0:return 41;break;case 1:return 48;break;case 2:return 49;break;case 3:return 50;break;case 4:return 51;break;case 5:break;case 6:{}break;case 7:return 5;break;case 8:break;case 9:break;case 10:break;case 11:break;case 12:this.pushState("SCALE");return 17;break;case 13:return 18;break;case 14:this.popState();break;case 15:this.begin("acc_title");return 33;break;case 16:this.popState();return"acc_title_value";break;case 17:this.begin("acc_descr");return 35;break;case 18:this.popState();return"acc_descr_value";break;case 19:this.begin("acc_descr_multiline");break;case 20:this.popState();break;case 21:return"acc_descr_multiline_value";break;case 22:this.pushState("CLASSDEF");return 38;break;case 23:this.popState();this.pushState("CLASSDEFID");return"DEFAULT_CLASSDEF_ID";break;case 24:this.popState();this.pushState("CLASSDEFID");return 39;break;case 25:this.popState();return 40;break;case 26:this.pushState("CLASS");return 45;break;case 27:this.popState();this.pushState("CLASS_STYLE");return 46;break;case 28:this.popState();return 47;break;case 29:this.pushState("STYLE");return 42;break;case 30:this.popState();this.pushState("STYLEDEF_STYLES");return 43;break;case 31:this.popState();return 44;break;case 32:this.pushState("SCALE");return 17;break;case 33:return 18;break;case 34:this.popState();break;case 35:this.pushState("STATE");break;case 36:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 25;break;case 37:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 26;break;case 38:this.popState();s.yytext=s.yytext.slice(0,-10).trim();return 27;break;case 39:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 25;break;case 40:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 26;break;case 41:this.popState();s.yytext=s.yytext.slice(0,-10).trim();return 27;break;case 42:return 48;break;case 43:return 49;break;case 44:return 50;break;case 45:return 51;break;case 46:this.pushState("STATE_STRING");break;case 47:this.pushState("STATE_ID");return"AS";break;case 48:this.popState();return"ID";break;case 49:this.popState();break;case 50:return"STATE_DESCR";break;case 51:return 19;break;case 52:this.popState();break;case 53:this.popState();this.pushState("struct");return 20;break;case 54:break;case 55:this.popState();return 21;break;case 56:break;case 57:this.begin("NOTE");return 29;break;case 58:this.popState();this.pushState("NOTE_ID");return 56;break;case 59:this.popState();this.pushState("NOTE_ID");return 57;break;case 60:this.popState();this.pushState("FLOATING_NOTE");break;case 61:this.popState();this.pushState("FLOATING_NOTE_ID");return"AS";break;case 62:break;case 63:return"NOTE_TEXT";break;case 64:this.popState();return"ID";break;case 65:this.popState();this.pushState("NOTE_TEXT");return 24;break;case 66:this.popState();s.yytext=s.yytext.substr(2).trim();return 31;break;case 67:this.popState();s.yytext=s.yytext.slice(0,-8).trim();return 31;break;case 68:return 6;break;case 69:return 6;break;case 70:return 16;break;case 71:return 54;break;case 72:return 24;break;case 73:s.yytext=s.yytext.trim();return 14;break;case 74:return 15;break;case 75:return 28;break;case 76:return 55;break;case 77:return 5;break;case 78:return"INVALID";break}}),"anonymous"),rules:[/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*<>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[9,10],inclusive:false},struct:{rules:[9,10,22,26,29,35,42,43,44,45,54,55,56,57,71,72,73,74,75],inclusive:false},FLOATING_NOTE_ID:{rules:[64],inclusive:false},FLOATING_NOTE:{rules:[61,62,63],inclusive:false},NOTE_TEXT:{rules:[66,67],inclusive:false},NOTE_ID:{rules:[65],inclusive:false},NOTE:{rules:[58,59,60],inclusive:false},STYLEDEF_STYLEOPTS:{rules:[],inclusive:false},STYLEDEF_STYLES:{rules:[31],inclusive:false},STYLE_IDS:{rules:[],inclusive:false},STYLE:{rules:[30],inclusive:false},CLASS_STYLE:{rules:[28],inclusive:false},CLASS:{rules:[27],inclusive:false},CLASSDEFID:{rules:[25],inclusive:false},CLASSDEF:{rules:[23,24],inclusive:false},acc_descr_multiline:{rules:[20,21],inclusive:false},acc_descr:{rules:[18],inclusive:false},acc_title:{rules:[16],inclusive:false},SCALE:{rules:[13,14,33,34],inclusive:false},ALIAS:{rules:[],inclusive:false},STATE_ID:{rules:[48],inclusive:false},STATE_STRING:{rules:[49,50],inclusive:false},FORK_STATE:{rules:[],inclusive:false},STATE:{rules:[9,10,36,37,38,39,40,41,46,47,51,52,53],inclusive:false},ID:{rules:[9,10],inclusive:false},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,10,11,12,15,17,19,22,26,29,32,35,53,57,68,69,70,71,72,73,74,76,77,78],inclusive:true}}};return t}();w.lexer=R;function O(){this.yy={}}(0,a.K2)(O,"Parser");O.prototype=w;w.Parser=O;return new O}();o.parser=o;var l=o;var c="TB";var h="TB";var d="dir";var u="state";var p="relation";var f="classDef";var y="style";var g="applyClass";var m="default";var S="divider";var b="fill:none";var k="fill: #333";var _="c";var v="text";var T="normal";var E="rect";var D="rectWithTitle";var x="stateStart";var C="stateEnd";var $="divider";var I="roundedWithTitle";var L="note";var A="noteGroup";var w="statediagram";var R="state";var O=`${w}-${R}`;var N="transition";var K="note";var B="note-edge";var F=`${N} ${B}`;var Y=`${w}-${K}`;var P="cluster";var G=`${w}-${P}`;var j="cluster-alt";var z=`${w}-${j}`;var U="parent";var M="note";var V="state";var X="----";var W=`${X}${M}`;var H=`${X}${U}`;var J=(0,a.K2)(((t,e=h)=>{if(!t.doc){return e}let s=e;for(const i of t.doc){if(i.stmt==="dir"){s=i.value}}return s}),"getDir");var q=(0,a.K2)((function(t,e){return e.db.getClasses()}),"getClasses");var Z=(0,a.K2)((async function(t,e,s,o){a.Rm.info("REF0:");a.Rm.info("Drawing state diagram (v2)",e);const{securityLevel:l,state:c,layout:h}=(0,a.D7)();o.db.extract(o.db.getRootDocV2());const d=o.db.getData();const u=(0,i.A)(e,l);d.type=o.type;d.layoutAlgorithm=h;d.nodeSpacing=c?.nodeSpacing||50;d.rankSpacing=c?.rankSpacing||50;d.markers=["barb"];d.diagramId=e;await(0,r.XX)(d,u);const p=8;n._K.insertTitle(u,"statediagramTitleText",c?.titleTopMargin??25,o.db.getDiagramTitle());(0,i.P)(u,p,w,c?.useMaxWidth??true)}),"draw");var Q={getClasses:q,draw:Z,getDir:J};var tt=new Map;var et=0;function st(t="",e=0,s="",i=X){const r=s!==null&&s.length>0?`${i}${s}`:"";return`${V}-${t}${r}-${e}`}(0,a.K2)(st,"stateDomId");var it=(0,a.K2)(((t,e,s,i,r,n,o,l)=>{a.Rm.trace("items",e);e.forEach((e=>{switch(e.stmt){case u:lt(t,e,s,i,r,n,o,l);break;case m:lt(t,e,s,i,r,n,o,l);break;case p:{lt(t,e.state1,s,i,r,n,o,l);lt(t,e.state2,s,i,r,n,o,l);const c={id:"edge"+et,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:"arrow_barb",style:b,labelStyle:"",label:a.Y2.sanitizeText(e.description,(0,a.D7)()),arrowheadStyle:k,labelpos:_,labelType:v,thickness:T,classes:N,look:o};r.push(c);et++}break}}))}),"setupDoc");var rt=(0,a.K2)(((t,e=h)=>{let s=e;if(t.doc){for(const e of t.doc){if(e.stmt==="dir"){s=e.value}}}return s}),"getDir");function nt(t,e,s){if(!e.id||e.id===""||e.id===""){return}if(e.cssClasses){if(!Array.isArray(e.cssCompiledStyles)){e.cssCompiledStyles=[]}e.cssClasses.split(" ").forEach((t=>{if(s.get(t)){const i=s.get(t);e.cssCompiledStyles=[...e.cssCompiledStyles,...i.styles]}}))}const i=t.find((t=>t.id===e.id));if(i){Object.assign(i,e)}else{t.push(e)}}(0,a.K2)(nt,"insertOrUpdateNode");function at(t){return t?.classes?.join(" ")??""}(0,a.K2)(at,"getClassesFromDbInfo");function ot(t){return t?.styles??[]}(0,a.K2)(ot,"getStylesFromDbInfo");var lt=(0,a.K2)(((t,e,s,i,r,n,o,l)=>{const c=e.id;const h=s.get(c);const d=at(h);const u=ot(h);a.Rm.info("dataFetcher parsedItem",e,h,u);if(c!=="root"){let s=E;if(e.start===true){s=x}else if(e.start===false){s=C}if(e.type!==m){s=e.type}if(!tt.get(c)){tt.set(c,{id:c,shape:s,description:a.Y2.sanitizeText(c,(0,a.D7)()),cssClasses:`${d} ${O}`,cssStyles:u})}const h=tt.get(c);if(e.description){if(Array.isArray(h.description)){h.shape=D;h.description.push(e.description)}else{if(h.description?.length>0){h.shape=D;if(h.description===c){h.description=[e.description]}else{h.description=[h.description,e.description]}}else{h.shape=E;h.description=e.description}}h.description=a.Y2.sanitizeTextOrArray(h.description,(0,a.D7)())}if(h.description?.length===1&&h.shape===D){if(h.type==="group"){h.shape=I}else{h.shape=E}}if(!h.type&&e.doc){a.Rm.info("Setting cluster for XCX",c,rt(e));h.type="group";h.isGroup=true;h.dir=rt(e);h.shape=e.type===S?$:I;h.cssClasses=`${h.cssClasses} ${G} ${n?z:""}`}const p={labelStyle:"",shape:h.shape,label:h.description,cssClasses:h.cssClasses,cssCompiledStyles:[],cssStyles:h.cssStyles,id:c,dir:h.dir,domId:st(c,et),type:h.type,isGroup:h.type==="group",padding:8,rx:10,ry:10,look:o};if(p.shape===$){p.label=""}if(t&&t.id!=="root"){a.Rm.trace("Setting node ",c," to be child of its parent ",t.id);p.parentId=t.id}p.centerLabel=true;if(e.note){const t={labelStyle:"",shape:L,label:e.note.text,cssClasses:Y,cssStyles:[],cssCompilesStyles:[],id:c+W+"-"+et,domId:st(c,et,M),type:h.type,isGroup:h.type==="group",padding:(0,a.D7)().flowchart.padding,look:o,position:e.note.position};const s=c+H;const n={labelStyle:"",shape:A,label:e.note.text,cssClasses:h.cssClasses,cssStyles:[],id:c+H,domId:st(c,et,U),type:"group",isGroup:true,padding:16,look:o,position:e.note.position};et++;n.id=s;t.parentId=s;nt(i,n,l);nt(i,t,l);nt(i,p,l);let d=c;let u=t.id;if(e.note.position==="left of"){d=t.id;u=c}r.push({id:d+"-"+u,start:d,end:u,arrowhead:"none",arrowTypeEnd:"",style:b,labelStyle:"",classes:F,arrowheadStyle:k,labelpos:_,labelType:v,thickness:T,look:o})}else{nt(i,p,l)}}if(e.doc){a.Rm.trace("Adding nodes children ");it(e,e.doc,s,i,r,!n,o,l)}}),"dataFetcher");var ct=(0,a.K2)((()=>{tt.clear();et=0}),"reset");var ht="[*]";var dt="start";var ut=ht;var pt="end";var ft="color";var yt="fill";var gt="bgFill";var mt=",";function St(){return new Map}(0,a.K2)(St,"newClassesList");var bt=(0,a.K2)((()=>({relations:[],states:new Map,documents:{}})),"newDoc");var kt=(0,a.K2)((t=>JSON.parse(JSON.stringify(t))),"clone");var _t=class{static{(0,a.K2)(this,"StateDB")}constructor(t){this.clear();this.version=t;this.setRootDoc=this.setRootDoc.bind(this);this.getDividerId=this.getDividerId.bind(this);this.setDirection=this.setDirection.bind(this);this.trimColon=this.trimColon.bind(this)}version;nodes=[];edges=[];rootDoc=[];classes=St();documents={root:bt()};currentDocument=this.documents.root;startEndCount=0;dividerCnt=0;static relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3};setRootDoc(t){a.Rm.info("Setting root doc",t);this.rootDoc=t;if(this.version===1){this.extract(t)}else{this.extract(this.getRootDocV2())}}getRootDoc(){return this.rootDoc}docTranslator(t,e,s){if(e.stmt===p){this.docTranslator(t,e.state1,true);this.docTranslator(t,e.state2,false)}else{if(e.stmt===u){if(e.id==="[*]"){e.id=s?t.id+"_start":t.id+"_end";e.start=s}else{e.id=e.id.trim()}}if(e.doc){const t=[];let s=[];let i;for(i=0;i0&&s.length>0){const i={stmt:u,id:(0,n.$C)(),type:"divider",doc:kt(s)};t.push(kt(i));e.doc=t}e.doc.forEach((t=>this.docTranslator(e,t,true)))}}}getRootDocV2(){this.docTranslator({id:"root"},{id:"root",doc:this.rootDoc},true);return{id:"root",doc:this.rootDoc}}extract(t){let e;if(t.doc){e=t.doc}else{e=t}a.Rm.info(e);this.clear(true);a.Rm.info("Extract initial document:",e);e.forEach((t=>{a.Rm.warn("Statement",t.stmt);switch(t.stmt){case u:this.addState(t.id.trim(),t.type,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);break;case p:this.addRelation(t.state1,t.state2,t.description);break;case f:this.addStyleClass(t.id.trim(),t.classes);break;case y:{const e=t.id.trim().split(",");const s=t.styleClass.split(",");e.forEach((t=>{let e=this.getState(t);if(e===void 0){const s=t.trim();this.addState(s);e=this.getState(s)}e.styles=s.map((t=>t.replace(/;/g,"")?.trim()))}))}break;case g:this.setCssClass(t.id.trim(),t.styleClass);break}}));const s=this.getStates();const i=(0,a.D7)();const r=i.look;ct();lt(void 0,this.getRootDocV2(),s,this.nodes,this.edges,true,r,this.classes);this.nodes.forEach((t=>{if(Array.isArray(t.label)){t.description=t.label.slice(1);if(t.isGroup&&t.description.length>0){throw new Error("Group nodes can only have label. Remove the additional description for node ["+t.id+"]")}t.label=t.label[0]}}))}addState(t,e=m,s=null,i=null,r=null,n=null,o=null,l=null){const c=t?.trim();if(!this.currentDocument.states.has(c)){a.Rm.info("Adding state ",c,i);this.currentDocument.states.set(c,{id:c,descriptions:[],type:e,doc:s,note:r,classes:[],styles:[],textStyles:[]})}else{if(!this.currentDocument.states.get(c).doc){this.currentDocument.states.get(c).doc=s}if(!this.currentDocument.states.get(c).type){this.currentDocument.states.get(c).type=e}}if(i){a.Rm.info("Setting state description",c,i);if(typeof i==="string"){this.addDescription(c,i.trim())}if(typeof i==="object"){i.forEach((t=>this.addDescription(c,t.trim())))}}if(r){const t=this.currentDocument.states.get(c);t.note=r;t.note.text=a.Y2.sanitizeText(t.note.text,(0,a.D7)())}if(n){a.Rm.info("Setting state classes",c,n);const t=typeof n==="string"?[n]:n;t.forEach((t=>this.setCssClass(c,t.trim())))}if(o){a.Rm.info("Setting state styles",c,o);const t=typeof o==="string"?[o]:o;t.forEach((t=>this.setStyle(c,t.trim())))}if(l){a.Rm.info("Setting state styles",c,o);const t=typeof l==="string"?[l]:l;t.forEach((t=>this.setTextStyle(c,t.trim())))}}clear(t){this.nodes=[];this.edges=[];this.documents={root:bt()};this.currentDocument=this.documents.root;this.startEndCount=0;this.classes=St();if(!t){(0,a.IU)()}}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){a.Rm.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}startIdIfNeeded(t=""){let e=t;if(t===ht){this.startEndCount++;e=`${dt}${this.startEndCount}`}return e}startTypeIfNeeded(t="",e=m){return t===ht?dt:e}endIdIfNeeded(t=""){let e=t;if(t===ut){this.startEndCount++;e=`${pt}${this.startEndCount}`}return e}endTypeIfNeeded(t="",e=m){return t===ut?pt:e}addRelationObjs(t,e,s){let i=this.startIdIfNeeded(t.id.trim());let r=this.startTypeIfNeeded(t.id.trim(),t.type);let n=this.startIdIfNeeded(e.id.trim());let o=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,r,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles);this.addState(n,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles);this.currentDocument.relations.push({id1:i,id2:n,relationTitle:a.Y2.sanitizeText(s,(0,a.D7)())})}addRelation(t,e,s){if(typeof t==="object"){this.addRelationObjs(t,e,s)}else{const i=this.startIdIfNeeded(t.trim());const r=this.startTypeIfNeeded(t);const n=this.endIdIfNeeded(e.trim());const o=this.endTypeIfNeeded(e);this.addState(i,r);this.addState(n,o);this.currentDocument.relations.push({id1:i,id2:n,title:a.Y2.sanitizeText(s,(0,a.D7)())})}}addDescription(t,e){const s=this.currentDocument.states.get(t);const i=e.startsWith(":")?e.replace(":","").trim():e;s.descriptions.push(a.Y2.sanitizeText(i,(0,a.D7)()))}cleanupLabel(t){if(t.substring(0,1)===":"){return t.substr(2).trim()}else{return t.trim()}}getDividerId(){this.dividerCnt++;return"divider-id-"+this.dividerCnt}addStyleClass(t,e=""){if(!this.classes.has(t)){this.classes.set(t,{id:t,styles:[],textStyles:[]})}const s=this.classes.get(t);if(e!==void 0&&e!==null){e.split(mt).forEach((t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(ft).exec(t)){const t=e.replace(yt,gt);const i=t.replace(ft,yt);s.textStyles.push(i)}s.styles.push(e)}))}}getClasses(){return this.classes}setCssClass(t,e){t.split(",").forEach((t=>{let s=this.getState(t);if(s===void 0){const e=t.trim();this.addState(e);s=this.getState(e)}s.classes.push(e)}))}setStyle(t,e){const s=this.getState(t);if(s!==void 0){s.styles.push(e)}}setTextStyle(t,e){const s=this.getState(t);if(s!==void 0){s.textStyles.push(e)}}getDirectionStatement(){return this.rootDoc.find((t=>t.stmt===d))}getDirection(){return this.getDirectionStatement()?.value??c}setDirection(t){const e=this.getDirectionStatement();if(e){e.value=t}else{this.rootDoc.unshift({stmt:d,value:t})}}trimColon(t){return t&&t[0]===":"?t.substr(1).trim():t.trim()}getData(){const t=(0,a.D7)();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:J(this.getRootDocV2())}}getConfig(){return(0,a.D7)().state}getAccTitle=a.iN;setAccTitle=a.SV;getAccDescription=a.m7;setAccDescription=a.EI;setDiagramTitle=a.ke;getDiagramTitle=a.ab};var vt=(0,a.K2)((t=>`\ndefs #statediagram-barbEnd {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: 1;\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: 1px;\n}\n#statediagram-barbEnd {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: 1px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n#dependencyStart, #dependencyEnd {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: 1;\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n`),"getStyles");var Tt=vt},15051:(t,e,s)=>{s.d(e,{A:()=>n,P:()=>a});var i=s(75905);var r=s(24982);var n=(0,i.K2)(((t,e)=>{let s;if(e==="sandbox"){s=(0,r.Ltv)("#i"+t)}const i=e==="sandbox"?(0,r.Ltv)(s.nodes()[0].contentDocument.body):(0,r.Ltv)("body");const n=i.select(`[id="${t}"]`);return n}),"getDiagramElement");var a=(0,i.K2)(((t,e,s,r)=>{t.attr("class",s);const{width:n,height:a,x:c,y:h}=o(t,e);(0,i.a$)(t,a,n,r);const d=l(c,h,n,a,e);t.attr("viewBox",d);i.Rm.debug(`viewBox configured: ${d} with padding: ${e}`)}),"setupViewPortForSVG");var o=(0,i.K2)(((t,e)=>{const s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+e*2,height:s.height+e*2,x:s.x,y:s.y}}),"calculateDimensionsWithPadding");var l=(0,i.K2)(((t,e,s,i,r)=>`${t-r} ${e-r} ${s} ${i}`),"createViewBox")}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/88b98cad3688915e50da.woff b/.venv/share/jupyter/lab/static/88b98cad3688915e50da.woff new file mode 100644 index 0000000000000000000000000000000000000000..2805af50f1fb0f5fb5a8429873de45d1fe713759 Binary files /dev/null and b/.venv/share/jupyter/lab/static/88b98cad3688915e50da.woff differ diff --git a/.venv/share/jupyter/lab/static/89.933673451ca4a51053cb.js b/.venv/share/jupyter/lab/static/89.933673451ca4a51053cb.js new file mode 100644 index 0000000000000000000000000000000000000000..7f38e31dd3c34ae203ccd84bed820df586a4c051 --- /dev/null +++ b/.venv/share/jupyter/lab/static/89.933673451ca4a51053cb.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[89],{30089:(e,t,n)=>{n.r(t);n.d(t,{q:()=>f});var r,i=s(["abs","acos","aj","aj0","all","and","any","asc","asin","asof","atan","attr","avg","avgs","bin","by","ceiling","cols","cor","cos","count","cov","cross","csv","cut","delete","deltas","desc","dev","differ","distinct","div","do","each","ej","enlist","eval","except","exec","exit","exp","fby","fills","first","fkeys","flip","floor","from","get","getenv","group","gtime","hclose","hcount","hdel","hopen","hsym","iasc","idesc","if","ij","in","insert","inter","inv","key","keys","last","like","list","lj","load","log","lower","lsq","ltime","ltrim","mavg","max","maxs","mcount","md5","mdev","med","meta","min","mins","mmax","mmin","mmu","mod","msum","neg","next","not","null","or","over","parse","peach","pj","plist","prd","prds","prev","prior","rand","rank","ratios","raze","read0","read1","reciprocal","reverse","rload","rotate","rsave","rtrim","save","scan","select","set","setenv","show","signum","sin","sqrt","ss","ssr","string","sublist","sum","sums","sv","system","tables","tan","til","trim","txf","type","uj","ungroup","union","update","upper","upsert","value","var","view","views","vs","wavg","where","where","while","within","wj","wj1","wsum","xasc","xbar","xcol","xcols","xdesc","xexp","xgroup","xkey","xlog","xprev","xrank"]),o=/[|/&^!+:\\\-*%$=~#;@><,?_\'\"\[\(\]\)\s{}]/;function s(e){return new RegExp("^("+e.join("|")+")$")}function a(e,t){var n=e.sol(),s=e.next();r=null;if(n)if(s=="/")return(t.tokenize=c)(e,t);else if(s=="\\"){if(e.eol()||/\s/.test(e.peek()))return e.skipToEnd(),/^\\\s*$/.test(e.current())?(t.tokenize=u)(e):t.tokenize=a,"comment";else return t.tokenize=a,"builtin"}if(/\s/.test(s))return e.peek()=="/"?(e.skipToEnd(),"comment"):"null";if(s=='"')return(t.tokenize=p)(e,t);if(s=="`")return e.eatWhile(/[A-Za-z\d_:\/.]/),"macroName";if("."==s&&/\d/.test(e.peek())||/\d/.test(s)){var l=null;e.backUp(1);if(e.match(/^\d{4}\.\d{2}(m|\.\d{2}([DT](\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)?)?)/)||e.match(/^\d+D(\d{2}(:\d{2}(:\d{2}(\.\d{1,9})?)?)?)/)||e.match(/^\d{2}:\d{2}(:\d{2}(\.\d{1,9})?)?/)||e.match(/^\d+[ptuv]{1}/))l="temporal";else if(e.match(/^0[NwW]{1}/)||e.match(/^0x[\da-fA-F]*/)||e.match(/^[01]+[b]{1}/)||e.match(/^\d+[chijn]{1}/)||e.match(/-?\d*(\.\d*)?(e[+\-]?\d+)?(e|f)?/))l="number";return l&&(!(s=e.peek())||o.test(s))?l:(e.next(),"error")}if(/[A-Za-z]|\./.test(s))return e.eatWhile(/[A-Za-z._\d]/),i.test(e.current())?"keyword":"variable";if(/[|/&^!+:\\\-*%$=~#;@><\.,?_\']/.test(s))return null;if(/[{}\(\[\]\)]/.test(s))return null;return"error"}function c(e,t){return e.skipToEnd(),/\/\s*$/.test(e.current())?(t.tokenize=l)(e,t):t.tokenize=a,"comment"}function l(e,t){var n=e.sol()&&e.peek()=="\\";e.skipToEnd();if(n&&/^\\\s*$/.test(e.current()))t.tokenize=a;return"comment"}function u(e){return e.skipToEnd(),"comment"}function p(e,t){var n=false,r,i=false;while(r=e.next()){if(r=='"'&&!n){i=true;break}n=!n&&r=="\\"}if(i)t.tokenize=a;return"string"}function d(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function m(e){e.indent=e.context.indent;e.context=e.context.prev}const f={name:"q",startState:function(){return{tokenize:a,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()){if(t.context&&t.context.align==null)t.context.align=false;t.indent=e.indentation()}var n=t.tokenize(e,t);if(n!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"){t.context.align=true}if(r=="(")d(t,")",e.column());else if(r=="[")d(t,"]",e.column());else if(r=="{")d(t,"}",e.column());else if(/[\]\}\)]/.test(r)){while(t.context&&t.context.type=="pattern")m(t);if(t.context&&r==t.context.type)m(t)}else if(r=="."&&t.context&&t.context.type=="pattern")m(t);else if(/atom|string|variable/.test(n)&&t.context){if(/[\}\]]/.test(t.context.type))d(t,"pattern",e.column());else if(t.context.type=="pattern"&&!t.context.align){t.context.align=true;t.context.col=e.column()}}return n},indent:function(e,t,n){var r=t&&t.charAt(0);var i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var o=i&&r==i.type;if(!i)return 0;else if(i.type=="pattern")return i.col;else if(i.align)return i.col+(o?0:1);else return i.indent+(o?0:n.unit)}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8915.ab253990b1581460b255.js b/.venv/share/jupyter/lab/static/8915.ab253990b1581460b255.js new file mode 100644 index 0000000000000000000000000000000000000000..7d50a7a2c1249b9246b60eed254301c55bb1730b --- /dev/null +++ b/.venv/share/jupyter/lab/static/8915.ab253990b1581460b255.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[8915],{87799:function(t,e,r){(function e(i,n){if(true)t.exports=n(r(23143));else{}})(this,(function(t){return function(t){var e={};function r(i){if(e[i]){return e[i].exports}var n=e[i]={i,l:false,exports:{}};t[i].call(n.exports,n,n.exports,r);n.l=true;return n.exports}r.m=t;r.c=e;r.i=function(t){return t};r.d=function(t,e,i){if(!r.o(t,e)){Object.defineProperty(t,e,{configurable:false,enumerable:true,get:i})}};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};r.p="";return r(r.s=7)}([function(e,r){e.exports=t},function(t,e,r){"use strict";var i=r(0).FDLayoutConstants;function n(){}for(var o in i){n[o]=i[o]}n.DEFAULT_USE_MULTI_LEVEL_SCALING=false;n.DEFAULT_RADIAL_SEPARATION=i.DEFAULT_EDGE_LENGTH;n.DEFAULT_COMPONENT_SEPERATION=60;n.TILE=true;n.TILING_PADDING_VERTICAL=10;n.TILING_PADDING_HORIZONTAL=10;n.TREE_REDUCTION_ON_INCREMENTAL=false;t.exports=n},function(t,e,r){"use strict";var i=r(0).FDLayoutEdge;function n(t,e,r){i.call(this,t,e,r)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},function(t,e,r){"use strict";var i=r(0).LGraph;function n(t,e,r){i.call(this,t,e,r)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},function(t,e,r){"use strict";var i=r(0).LGraphManager;function n(t){i.call(this,t)}n.prototype=Object.create(i.prototype);for(var o in i){n[o]=i[o]}t.exports=n},function(t,e,r){"use strict";var i=r(0).FDLayoutNode;var n=r(0).IMath;function o(t,e,r,n){i.call(this,t,e,r,n)}o.prototype=Object.create(i.prototype);for(var a in i){o[a]=i[a]}o.prototype.move=function(){var t=this.graphManager.getLayout();this.displacementX=t.coolingFactor*(this.springForceX+this.repulsionForceX+this.gravitationForceX)/this.noOfChildren;this.displacementY=t.coolingFactor*(this.springForceY+this.repulsionForceY+this.gravitationForceY)/this.noOfChildren;if(Math.abs(this.displacementX)>t.coolingFactor*t.maxNodeDisplacement){this.displacementX=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementX)}if(Math.abs(this.displacementY)>t.coolingFactor*t.maxNodeDisplacement){this.displacementY=t.coolingFactor*t.maxNodeDisplacement*n.sign(this.displacementY)}if(this.child==null){this.moveBy(this.displacementX,this.displacementY)}else if(this.child.getNodes().length==0){this.moveBy(this.displacementX,this.displacementY)}else{this.propogateDisplacementToChildren(this.displacementX,this.displacementY)}t.totalDisplacement+=Math.abs(this.displacementX)+Math.abs(this.displacementY);this.springForceX=0;this.springForceY=0;this.repulsionForceX=0;this.repulsionForceY=0;this.gravitationForceX=0;this.gravitationForceY=0;this.displacementX=0;this.displacementY=0};o.prototype.propogateDisplacementToChildren=function(t,e){var r=this.getChild().getNodes();var i;for(var n=0;n0){this.positionNodesRadially(t)}else{this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes());var r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r);this.positionNodesRandomly()}}else{if(h.TREE_REDUCTION_ON_INCREMENTAL){this.reduceTrees();this.graphManager.resetAllNodesToApplyGravitation();var e=new Set(this.getAllNodes());var r=this.nodesWithGravity.filter((function(t){return e.has(t)}));this.graphManager.setAllNodesToApplyGravitation(r)}}this.initSpringEmbedder();this.runSpringEmbedder();return true};E.prototype.tick=function(){this.totalIterations++;if(this.totalIterations===this.maxIterations&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}if(this.totalIterations%l.CONVERGENCE_CHECK_PERIOD==0&&!this.isTreeGrowing&&!this.isGrowthFinished){if(this.isConverged()){if(this.prunedNodesAll.length>0){this.isTreeGrowing=true}else{return true}}this.coolingCycle++;if(this.layoutQuality==0){this.coolingAdjuster=this.coolingCycle}else if(this.layoutQuality==1){this.coolingAdjuster=this.coolingCycle/3}this.coolingFactor=Math.max(this.initialCoolingFactor-Math.pow(this.coolingCycle,Math.log(100*(this.initialCoolingFactor-this.finalTemperature))/Math.log(this.maxCoolingCycle))/100*this.coolingAdjuster,this.finalTemperature);this.animationPeriod=Math.ceil(this.initialAnimationPeriod*Math.sqrt(this.coolingFactor))}if(this.isTreeGrowing){if(this.growTreeIterations%10==0){if(this.prunedNodesAll.length>0){this.graphManager.updateBounds();this.updateGrid();this.growTree(this.prunedNodesAll);this.graphManager.resetAllNodesToApplyGravitation();var t=new Set(this.getAllNodes());var e=this.nodesWithGravity.filter((function(e){return t.has(e)}));this.graphManager.setAllNodesToApplyGravitation(e);this.graphManager.updateBounds();this.updateGrid();this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL}else{this.isTreeGrowing=false;this.isGrowthFinished=true}}this.growTreeIterations++}if(this.isGrowthFinished){if(this.isConverged()){return true}if(this.afterGrowthIterations%10==0){this.graphManager.updateBounds();this.updateGrid()}this.coolingFactor=l.DEFAULT_COOLING_FACTOR_INCREMENTAL*((100-this.afterGrowthIterations)/100);this.afterGrowthIterations++}var r=!this.isTreeGrowing&&!this.isGrowthFinished;var i=this.growTreeIterations%10==1&&this.isTreeGrowing||this.afterGrowthIterations%10==1&&this.isGrowthFinished;this.totalDisplacement=0;this.graphManager.updateBounds();this.calcSpringForces();this.calcRepulsionForces(r,i);this.calcGravitationalForces();this.moveNodes();this.animate();return false};E.prototype.getPositionsData=function(){var t=this.graphManager.getAllNodes();var e={};for(var r=0;r1){var s;for(s=0;si){i=Math.floor(a.y)}o=Math.floor(a.x+h.DEFAULT_COMPONENT_SEPERATION)}this.transform(new g(c.WORLD_CENTER_X-a.x/2,c.WORLD_CENTER_Y-a.y/2))};E.radialLayout=function(t,e,r){var i=Math.max(this.maxDiagonalInTree(t),h.DEFAULT_RADIAL_SEPARATION);E.branchRadialLayout(e,null,0,359,0,i);var n=v.calculateBounds(t);var o=new y;o.setDeviceOrgX(n.getMinX());o.setDeviceOrgY(n.getMinY());o.setWorldOrgX(r.x);o.setWorldOrgY(r.y);for(var a=0;a1){var m=_[0];_.splice(0,1);var N=g.indexOf(m);if(N>=0){g.splice(N,1)}v--;d--}if(e!=null){y=(g.indexOf(_[0])+1)%v}else{y=0}var A=Math.abs(i-r)/d;for(var L=y;p!=d;L=++L%v){var T=g[L].getOtherEnd(t);if(T==e){continue}var O=(r+p*A)%360;var D=(O+A)%360;E.branchRadialLayout(T,t,O,D,n+o,o);p++}};E.maxDiagonalInTree=function(t){var e=p.MIN_VALUE;for(var r=0;re){e=n}}return e};E.prototype.calcRepulsionRange=function(){return 2*(this.level+1)*this.idealEdgeLength};E.prototype.groupZeroDegreeMembers=function(){var t=this;var e={};this.memberGroups={};this.idToDummyNode={};var r=[];var i=this.graphManager.getAllNodes();for(var n=0;n1){var i="DummyCompound_"+r;t.memberGroups[i]=e[r];var n=e[r][0].getParent();var o=new a(t.graphManager);o.id=i;o.paddingLeft=n.paddingLeft||0;o.paddingRight=n.paddingRight||0;o.paddingBottom=n.paddingBottom||0;o.paddingTop=n.paddingTop||0;t.idToDummyNode[i]=o;var s=t.getGraphManager().add(t.newGraph(),o);var h=n.getChild();h.add(o);for(var l=0;l=0;t--){var e=this.compoundOrder[t];var r=e.id;var i=e.paddingLeft;var n=e.paddingTop;this.adjustLocations(this.tiledMemberPack[r],e.rect.x,e.rect.y,i,n)}};E.prototype.repopulateZeroDegreeMembers=function(){var t=this;var e=this.tiledZeroDegreePack;Object.keys(e).forEach((function(r){var i=t.idToDummyNode[r];var n=i.paddingLeft;var o=i.paddingTop;t.adjustLocations(e[r],i.rect.x,i.rect.y,n,o)}))};E.prototype.getToBeTiled=function(t){var e=t.id;if(this.toBeTiled[e]!=null){return this.toBeTiled[e]}var r=t.getChild();if(r==null){this.toBeTiled[e]=false;return false}var i=r.getNodes();for(var n=0;n0){this.toBeTiled[e]=false;return false}if(o.getChild()==null){this.toBeTiled[o.id]=false;continue}if(!this.getToBeTiled(o)){this.toBeTiled[e]=false;return false}}this.toBeTiled[e]=true;return true};E.prototype.getNodeDegree=function(t){var e=t.id;var r=t.getEdges();var i=0;for(var n=0;nh)h=c.rect.height}r+=h+t.verticalPadding}};E.prototype.tileCompoundMembers=function(t,e){var r=this;this.tiledMemberPack=[];Object.keys(t).forEach((function(i){var n=e[i];r.tiledMemberPack[i]=r.tileNodes(t[i],n.paddingLeft+n.paddingRight);n.rect.width=r.tiledMemberPack[i].width;n.rect.height=r.tiledMemberPack[i].height}))};E.prototype.tileNodes=function(t,e){var r=h.TILING_PADDING_VERTICAL;var i=h.TILING_PADDING_HORIZONTAL;var n={rows:[],rowWidth:[],rowHeight:[],width:0,height:e,verticalPadding:r,horizontalPadding:i};t.sort((function(t,e){if(t.rect.width*t.rect.height>e.rect.width*e.rect.height)return-1;if(t.rect.width*t.rect.height0){a+=t.horizontalPadding}t.rowWidth[r]=a;if(t.width0)s+=t.verticalPadding;var h=0;if(s>t.rowHeight[r]){h=t.rowHeight[r];t.rowHeight[r]=s;h=t.rowHeight[r]-h}t.height+=h;t.rows[r].push(e)};E.prototype.getShortestRowIndex=function(t){var e=-1;var r=Number.MAX_VALUE;for(var i=0;ir){e=i;r=t.rowWidth[i]}}return e};E.prototype.canAddHorizontal=function(t,e,r){var i=this.getShortestRowIndex(t);if(i<0){return true}var n=t.rowWidth[i];if(n+t.horizontalPadding+e<=t.width)return true;var o=0;if(t.rowHeight[i]0)o=r+t.verticalPadding-t.rowHeight[i]}var a;if(t.width-n>=e+t.horizontalPadding){a=(t.height+o)/(n+e+t.horizontalPadding)}else{a=(t.height+o)/t.width}o=r+t.verticalPadding;var s;if(t.widtho&&e!=r){i.splice(-1,1);t.rows[r].push(n);t.rowWidth[e]=t.rowWidth[e]-o;t.rowWidth[r]=t.rowWidth[r]+o;t.width=t.rowWidth[instance.getLongestRowIndex(t)];var a=Number.MIN_VALUE;for(var s=0;sa)a=i[s].height}if(e>0)a+=t.verticalPadding;var h=t.rowHeight[e]+t.rowHeight[r];t.rowHeight[e]=a;if(t.rowHeight[r]0){for(var f=n;f<=o;f++){d[0]+=this.grid[f][a-1].length+this.grid[f][a].length-1}}if(o0){for(var f=a;f<=s;f++){d[3]+=this.grid[n-1][f].length+this.grid[n][f].length-1}}var v=p.MAX_VALUE;var y;var E;for(var _=0;_0){var f;f=r.getGraphManager().add(r.newGraph(),c);this.processChildrenList(f,a,r)}}};g.prototype.stop=function(){this.stopped=true;return this};var p=function t(e){e("layout","cose-bilkent",g)};if(typeof cytoscape!=="undefined"){p(cytoscape)}t.exports=p}])}))},23143:function(t){(function e(r,i){if(true)t.exports=i();else{}})(this,(function(){return function(t){var e={};function r(i){if(e[i]){return e[i].exports}var n=e[i]={i,l:false,exports:{}};t[i].call(n.exports,n,n.exports,r);n.l=true;return n.exports}r.m=t;r.c=e;r.i=function(t){return t};r.d=function(t,e,i){if(!r.o(t,e)){Object.defineProperty(t,e,{configurable:false,enumerable:true,get:i})}};r.n=function(t){var e=t&&t.__esModule?function e(){return t["default"]}:function e(){return t};r.d(e,"a",e);return e};r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};r.p="";return r(r.s=26)}([function(t,e,r){"use strict";function i(){}i.QUALITY=1;i.DEFAULT_CREATE_BENDS_AS_NEEDED=false;i.DEFAULT_INCREMENTAL=false;i.DEFAULT_ANIMATION_ON_LAYOUT=true;i.DEFAULT_ANIMATION_DURING_LAYOUT=false;i.DEFAULT_ANIMATION_PERIOD=50;i.DEFAULT_UNIFORM_LEAF_NODE_SIZES=false;i.DEFAULT_GRAPH_MARGIN=15;i.NODE_DIMENSIONS_INCLUDE_LABELS=false;i.SIMPLE_NODE_SIZE=40;i.SIMPLE_NODE_HALF_SIZE=i.SIMPLE_NODE_SIZE/2;i.EMPTY_COMPOUND_NODE_SIZE=40;i.MIN_EDGE_LENGTH=1;i.WORLD_BOUNDARY=1e6;i.INITIAL_WORLD_BOUNDARY=i.WORLD_BOUNDARY/1e3;i.WORLD_CENTER_X=1200;i.WORLD_CENTER_Y=900;t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(8);var o=r(9);function a(t,e,r){i.call(this,r);this.isOverlapingSourceAndTarget=false;this.vGraphObject=r;this.bendpoints=[];this.source=t;this.target=e}a.prototype=Object.create(i.prototype);for(var s in i){a[s]=i[s]}a.prototype.getSource=function(){return this.source};a.prototype.getTarget=function(){return this.target};a.prototype.isInterGraph=function(){return this.isInterGraph};a.prototype.getLength=function(){return this.length};a.prototype.isOverlapingSourceAndTarget=function(){return this.isOverlapingSourceAndTarget};a.prototype.getBendpoints=function(){return this.bendpoints};a.prototype.getLca=function(){return this.lca};a.prototype.getSourceInLca=function(){return this.sourceInLca};a.prototype.getTargetInLca=function(){return this.targetInLca};a.prototype.getOtherEnd=function(t){if(this.source===t){return this.target}else if(this.target===t){return this.source}else{throw"Node is not incident with this edge"}};a.prototype.getOtherEndInGraph=function(t,e){var r=this.getOtherEnd(t);var i=e.getGraphManager().getRoot();while(true){if(r.getOwner()==e){return r}if(r.getOwner()==i){break}r=r.getOwner().getParent()}return null};a.prototype.updateLength=function(){var t=new Array(4);this.isOverlapingSourceAndTarget=n.getIntersection(this.target.getRect(),this.source.getRect(),t);if(!this.isOverlapingSourceAndTarget){this.lengthX=t[0]-t[2];this.lengthY=t[1]-t[3];if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)}};a.prototype.updateLengthSimple=function(){this.lengthX=this.target.getCenterX()-this.source.getCenterX();this.lengthY=this.target.getCenterY()-this.source.getCenterY();if(Math.abs(this.lengthX)<1){this.lengthX=o.sign(this.lengthX)}if(Math.abs(this.lengthY)<1){this.lengthY=o.sign(this.lengthY)}this.length=Math.sqrt(this.lengthX*this.lengthX+this.lengthY*this.lengthY)};t.exports=a},function(t,e,r){"use strict";function i(t){this.vGraphObject=t}t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(10);var o=r(13);var a=r(0);var s=r(16);var h=r(4);function l(t,e,r,a){if(r==null&&a==null){a=e}i.call(this,a);if(t.graphManager!=null)t=t.graphManager;this.estimatedSize=n.MIN_VALUE;this.inclusionTreeDepth=n.MAX_VALUE;this.vGraphObject=a;this.edges=[];this.graphManager=t;if(r!=null&&e!=null)this.rect=new o(e.x,e.y,r.width,r.height);else this.rect=new o}l.prototype=Object.create(i.prototype);for(var c in i){l[c]=i[c]}l.prototype.getEdges=function(){return this.edges};l.prototype.getChild=function(){return this.child};l.prototype.getOwner=function(){return this.owner};l.prototype.getWidth=function(){return this.rect.width};l.prototype.setWidth=function(t){this.rect.width=t};l.prototype.getHeight=function(){return this.rect.height};l.prototype.setHeight=function(t){this.rect.height=t};l.prototype.getCenterX=function(){return this.rect.x+this.rect.width/2};l.prototype.getCenterY=function(){return this.rect.y+this.rect.height/2};l.prototype.getCenter=function(){return new h(this.rect.x+this.rect.width/2,this.rect.y+this.rect.height/2)};l.prototype.getLocation=function(){return new h(this.rect.x,this.rect.y)};l.prototype.getRect=function(){return this.rect};l.prototype.getDiagonal=function(){return Math.sqrt(this.rect.width*this.rect.width+this.rect.height*this.rect.height)};l.prototype.getHalfTheDiagonal=function(){return Math.sqrt(this.rect.height*this.rect.height+this.rect.width*this.rect.width)/2};l.prototype.setRect=function(t,e){this.rect.x=t.x;this.rect.y=t.y;this.rect.width=e.width;this.rect.height=e.height};l.prototype.setCenter=function(t,e){this.rect.x=t-this.rect.width/2;this.rect.y=e-this.rect.height/2};l.prototype.setLocation=function(t,e){this.rect.x=t;this.rect.y=e};l.prototype.moveBy=function(t,e){this.rect.x+=t;this.rect.y+=e};l.prototype.getEdgeListToNode=function(t){var e=[];var r;var i=this;i.edges.forEach((function(r){if(r.target==t){if(r.source!=i)throw"Incorrect edge source!";e.push(r)}}));return e};l.prototype.getEdgesBetween=function(t){var e=[];var r;var i=this;i.edges.forEach((function(r){if(!(r.source==i||r.target==i))throw"Incorrect edge source and/or target";if(r.target==t||r.source==t){e.push(r)}}));return e};l.prototype.getNeighborsList=function(){var t=new Set;var e=this;e.edges.forEach((function(r){if(r.source==e){t.add(r.target)}else{if(r.target!=e){throw"Incorrect incidency!"}t.add(r.source)}}));return t};l.prototype.withChildren=function(){var t=new Set;var e;var r;t.add(this);if(this.child!=null){var i=this.child.getNodes();for(var n=0;ne){this.rect.x-=(this.labelWidth-e)/2;this.setWidth(this.labelWidth)}if(this.labelHeight>r){if(this.labelPos=="center"){this.rect.y-=(this.labelHeight-r)/2}else if(this.labelPos=="top"){this.rect.y-=this.labelHeight-r}this.setHeight(this.labelHeight)}}}};l.prototype.getInclusionTreeDepth=function(){if(this.inclusionTreeDepth==n.MAX_VALUE){throw"assert failed"}return this.inclusionTreeDepth};l.prototype.transform=function(t){var e=this.rect.x;if(e>a.WORLD_BOUNDARY){e=a.WORLD_BOUNDARY}else if(e<-a.WORLD_BOUNDARY){e=-a.WORLD_BOUNDARY}var r=this.rect.y;if(r>a.WORLD_BOUNDARY){r=a.WORLD_BOUNDARY}else if(r<-a.WORLD_BOUNDARY){r=-a.WORLD_BOUNDARY}var i=new h(e,r);var n=t.inverseTransformPoint(i);this.setLocation(n.x,n.y)};l.prototype.getLeft=function(){return this.rect.x};l.prototype.getRight=function(){return this.rect.x+this.rect.width};l.prototype.getTop=function(){return this.rect.y};l.prototype.getBottom=function(){return this.rect.y+this.rect.height};l.prototype.getParent=function(){if(this.owner==null){return null}return this.owner.getParent()};t.exports=l},function(t,e,r){"use strict";function i(t,e){if(t==null&&e==null){this.x=0;this.y=0}else{this.x=t;this.y=e}}i.prototype.getX=function(){return this.x};i.prototype.getY=function(){return this.y};i.prototype.setX=function(t){this.x=t};i.prototype.setY=function(t){this.y=t};i.prototype.getDifference=function(t){return new DimensionD(this.x-t.x,this.y-t.y)};i.prototype.getCopy=function(){return new i(this.x,this.y)};i.prototype.translate=function(t){this.x+=t.width;this.y+=t.height;return this};t.exports=i},function(t,e,r){"use strict";var i=r(2);var n=r(10);var o=r(0);var a=r(6);var s=r(3);var h=r(1);var l=r(13);var c=r(12);var u=r(11);function g(t,e,r){i.call(this,r);this.estimatedSize=n.MIN_VALUE;this.margin=o.DEFAULT_GRAPH_MARGIN;this.edges=[];this.nodes=[];this.isConnected=false;this.parent=t;if(e!=null&&e instanceof a){this.graphManager=e}else if(e!=null&&e instanceof Layout){this.graphManager=e.graphManager}}g.prototype=Object.create(i.prototype);for(var d in i){g[d]=i[d]}g.prototype.getNodes=function(){return this.nodes};g.prototype.getEdges=function(){return this.edges};g.prototype.getGraphManager=function(){return this.graphManager};g.prototype.getParent=function(){return this.parent};g.prototype.getLeft=function(){return this.left};g.prototype.getRight=function(){return this.right};g.prototype.getTop=function(){return this.top};g.prototype.getBottom=function(){return this.bottom};g.prototype.isConnected=function(){return this.isConnected};g.prototype.add=function(t,e,r){if(e==null&&r==null){var i=t;if(this.graphManager==null){throw"Graph has no graph mgr!"}if(this.getNodes().indexOf(i)>-1){throw"Node already in graph!"}i.owner=this;this.getNodes().push(i);return i}else{var n=t;if(!(this.getNodes().indexOf(e)>-1&&this.getNodes().indexOf(r)>-1)){throw"Source or target not in graph!"}if(!(e.owner==r.owner&&e.owner==this)){throw"Both owners must be this graph!"}if(e.owner!=r.owner){return null}n.source=e;n.target=r;n.isInterGraph=false;this.getEdges().push(n);e.edges.push(n);if(r!=e){r.edges.push(n)}return n}};g.prototype.remove=function(t){var e=t;if(t instanceof s){if(e==null){throw"Node is null!"}if(!(e.owner!=null&&e.owner==this)){throw"Owner graph is invalid!"}if(this.graphManager==null){throw"Owner graph manager is invalid!"}var r=e.edges.slice();var i;var n=r.length;for(var o=0;o-1&&c>-1)){throw"Source and/or target doesn't know this edge!"}i.source.edges.splice(l,1);if(i.target!=i.source){i.target.edges.splice(c,1)}var a=i.source.owner.getEdges().indexOf(i);if(a==-1){throw"Not in owner's edge list!"}i.source.owner.getEdges().splice(a,1)}};g.prototype.updateLeftTop=function(){var t=n.MAX_VALUE;var e=n.MAX_VALUE;var r;var i;var o;var a=this.getNodes();var s=a.length;for(var h=0;hr){t=r}if(e>i){e=i}}if(t==n.MAX_VALUE){return null}if(a[0].getParent().paddingLeft!=undefined){o=a[0].getParent().paddingLeft}else{o=this.margin}this.left=e-o;this.top=t-o;return new c(this.left,this.top)};g.prototype.updateBounds=function(t){var e=n.MAX_VALUE;var r=-n.MAX_VALUE;var i=n.MAX_VALUE;var o=-n.MAX_VALUE;var a;var s;var h;var c;var u;var g=this.nodes;var d=g.length;for(var p=0;pa){e=a}if(rh){i=h}if(oa){e=a}if(rh){i=h}if(o=this.nodes.length){var g=0;r.forEach((function(e){if(e.owner==t){g++}}));if(g==this.nodes.length){this.isConnected=true}}};t.exports=g},function(t,e,r){"use strict";var i;var n=r(1);function o(t){i=r(5);this.layout=t;this.graphs=[];this.edges=[]}o.prototype.addRoot=function(){var t=this.layout.newGraph();var e=this.layout.newNode(null);var r=this.add(t,e);this.setRootGraph(r);return this.rootGraph};o.prototype.add=function(t,e,r,i,n){if(r==null&&i==null&&n==null){if(t==null){throw"Graph is null!"}if(e==null){throw"Parent node is null!"}if(this.graphs.indexOf(t)>-1){throw"Graph already in this graph mgr!"}this.graphs.push(t);if(t.parent!=null){throw"Already has a parent!"}if(e.child!=null){throw"Already has a child!"}t.parent=e;e.child=t;return t}else{n=r;i=e;r=t;var o=i.getOwner();var a=n.getOwner();if(!(o!=null&&o.getGraphManager()==this)){throw"Source not in this graph mgr!"}if(!(a!=null&&a.getGraphManager()==this)){throw"Target not in this graph mgr!"}if(o==a){r.isInterGraph=false;return o.add(r,i,n)}else{r.isInterGraph=true;r.source=i;r.target=n;if(this.edges.indexOf(r)>-1){throw"Edge already in inter-graph edge list!"}this.edges.push(r);if(!(r.source!=null&&r.target!=null)){throw"Edge source and/or target is null!"}if(!(r.source.edges.indexOf(r)==-1&&r.target.edges.indexOf(r)==-1)){throw"Edge already in source and/or target incidency list!"}r.source.edges.push(r);r.target.edges.push(r);return r}}};o.prototype.remove=function(t){if(t instanceof i){var e=t;if(e.getGraphManager()!=this){throw"Graph not in this graph mgr"}if(!(e==this.rootGraph||e.parent!=null&&e.parent.graphManager==this)){throw"Invalid parent node!"}var r=[];r=r.concat(e.getEdges());var o;var a=r.length;for(var s=0;s=e.getRight()){r[0]+=Math.min(e.getX()-t.getX(),t.getRight()-e.getRight())}else if(e.getX()<=t.getX()&&e.getRight()>=t.getRight()){r[0]+=Math.min(t.getX()-e.getX(),e.getRight()-t.getRight())}if(t.getY()<=e.getY()&&t.getBottom()>=e.getBottom()){r[1]+=Math.min(e.getY()-t.getY(),t.getBottom()-e.getBottom())}else if(e.getY()<=t.getY()&&e.getBottom()>=t.getBottom()){r[1]+=Math.min(t.getY()-e.getY(),e.getBottom()-t.getBottom())}var o=Math.abs((e.getCenterY()-t.getCenterY())/(e.getCenterX()-t.getCenterX()));if(e.getCenterY()===t.getCenterY()&&e.getCenterX()===t.getCenterX()){o=1}var a=o*r[0];var s=r[1]/o;if(r[0]a){r[0]=i;r[1]=h;r[2]=o;r[3]=_;return false}else if(no){r[0]=s;r[1]=n;r[2]=y;r[3]=a;return false}else if(io){r[0]=c;r[1]=u;L=true}else{r[0]=l;r[1]=h;L=true}}else if(O===I){if(i>o){r[0]=s;r[1]=h;L=true}else{r[0]=g;r[1]=u;L=true}}if(-D===I){if(o>i){r[2]=E;r[3]=_;T=true}else{r[2]=y;r[3]=v;T=true}}else if(D===I){if(o>i){r[2]=f;r[3]=v;T=true}else{r[2]=m;r[3]=_;T=true}}if(L&&T){return false}if(i>o){if(n>a){w=this.getCardinalDirection(O,I,4);R=this.getCardinalDirection(D,I,2)}else{w=this.getCardinalDirection(-O,I,3);R=this.getCardinalDirection(-D,I,1)}}else{if(n>a){w=this.getCardinalDirection(-O,I,1);R=this.getCardinalDirection(-D,I,3)}else{w=this.getCardinalDirection(O,I,2);R=this.getCardinalDirection(D,I,4)}}if(!L){switch(w){case 1:M=h;C=i+-p/I;r[0]=C;r[1]=M;break;case 2:C=g;M=n+d*I;r[0]=C;r[1]=M;break;case 3:M=u;C=i+p/I;r[0]=C;r[1]=M;break;case 4:C=c;M=n+-d*I;r[0]=C;r[1]=M;break}}if(!T){switch(R){case 1:b=v;x=o+-A/I;r[2]=x;r[3]=b;break;case 2:x=m;b=a+N*I;r[2]=x;r[3]=b;break;case 3:b=_;x=o+A/I;r[2]=x;r[3]=b;break;case 4:x=E;b=a+-N*I;r[2]=x;r[3]=b;break}}}return false};n.getCardinalDirection=function(t,e,r){if(t>e){return r}else{return 1+r%4}};n.getIntersection=function(t,e,r,n){if(n==null){return this.getIntersection2(t,e,r)}var o=t.x;var a=t.y;var s=e.x;var h=e.y;var l=r.x;var c=r.y;var u=n.x;var g=n.y;var d=void 0,p=void 0;var f=void 0,v=void 0,y=void 0,E=void 0,_=void 0,m=void 0;var N=void 0;f=h-a;y=o-s;_=s*a-o*h;v=g-c;E=l-u;m=u*c-l*g;N=f*E-v*y;if(N===0){return null}d=(y*m-E*_)/N;p=(v*_-f*m)/N;return new i(d,p)};n.angleOfVector=function(t,e,r,i){var n=void 0;if(t!==r){n=Math.atan((i-e)/(r-t));if(r0){return 1}else if(t<0){return-1}else{return 0}};i.floor=function(t){return t<0?Math.ceil(t):Math.floor(t)};i.ceil=function(t){return t<0?Math.floor(t):Math.ceil(t)};t.exports=i},function(t,e,r){"use strict";function i(){}i.MAX_VALUE=2147483647;i.MIN_VALUE=-2147483648;t.exports=i},function(t,e,r){"use strict";var i=function(){function t(t,e){for(var r=0;r0&&e){s.push(l[0]);while(s.length>0&&e){var c=s[0];s.splice(0,1);a.add(c);var u=c.getEdges();for(var o=0;o-1){l.splice(f,1)}}a=new Set;h=new Map}}return t};g.prototype.createDummyNodesForBendpoints=function(t){var e=[];var r=t.source;var i=this.graphManager.calcLowestCommonAncestor(t.source,t.target);for(var n=0;n0){var n=this.edgeToDummyNodes.get(r);for(var o=0;o=0){e.splice(u,1)}var g=s.getNeighborsList();g.forEach((function(t){if(r.indexOf(t)<0){var e=i.get(t);var n=e-1;if(n==1){l.push(t)}i.set(t,n)}}))}r=r.concat(l);if(e.length==1||e.length==2){n=true;o=e[0]}}return o};g.prototype.setGraphManager=function(t){this.graphManager=t};t.exports=g},function(t,e,r){"use strict";function i(){}i.seed=1;i.x=0;i.nextDouble=function(){i.x=Math.sin(i.seed++)*1e4;return i.x-Math.floor(i.x)};t.exports=i},function(t,e,r){"use strict";var i=r(4);function n(t,e){this.lworldOrgX=0;this.lworldOrgY=0;this.ldeviceOrgX=0;this.ldeviceOrgY=0;this.lworldExtX=1;this.lworldExtY=1;this.ldeviceExtX=1;this.ldeviceExtY=1}n.prototype.getWorldOrgX=function(){return this.lworldOrgX};n.prototype.setWorldOrgX=function(t){this.lworldOrgX=t};n.prototype.getWorldOrgY=function(){return this.lworldOrgY};n.prototype.setWorldOrgY=function(t){this.lworldOrgY=t};n.prototype.getWorldExtX=function(){return this.lworldExtX};n.prototype.setWorldExtX=function(t){this.lworldExtX=t};n.prototype.getWorldExtY=function(){return this.lworldExtY};n.prototype.setWorldExtY=function(t){this.lworldExtY=t};n.prototype.getDeviceOrgX=function(){return this.ldeviceOrgX};n.prototype.setDeviceOrgX=function(t){this.ldeviceOrgX=t};n.prototype.getDeviceOrgY=function(){return this.ldeviceOrgY};n.prototype.setDeviceOrgY=function(t){this.ldeviceOrgY=t};n.prototype.getDeviceExtX=function(){return this.ldeviceExtX};n.prototype.setDeviceExtX=function(t){this.ldeviceExtX=t};n.prototype.getDeviceExtY=function(){return this.ldeviceExtY};n.prototype.setDeviceExtY=function(t){this.ldeviceExtY=t};n.prototype.transformX=function(t){var e=0;var r=this.lworldExtX;if(r!=0){e=this.ldeviceOrgX+(t-this.lworldOrgX)*this.ldeviceExtX/r}return e};n.prototype.transformY=function(t){var e=0;var r=this.lworldExtY;if(r!=0){e=this.ldeviceOrgY+(t-this.lworldOrgY)*this.ldeviceExtY/r}return e};n.prototype.inverseTransformX=function(t){var e=0;var r=this.ldeviceExtX;if(r!=0){e=this.lworldOrgX+(t-this.ldeviceOrgX)*this.lworldExtX/r}return e};n.prototype.inverseTransformY=function(t){var e=0;var r=this.ldeviceExtY;if(r!=0){e=this.lworldOrgY+(t-this.ldeviceOrgY)*this.lworldExtY/r}return e};n.prototype.inverseTransformPoint=function(t){var e=new i(this.inverseTransformX(t.x),this.inverseTransformY(t.y));return e};t.exports=n},function(t,e,r){"use strict";function i(t){if(Array.isArray(t)){for(var e=0,r=Array(t.length);eo.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(this.coolingFactor*o.COOLING_ADAPTATION_FACTOR,this.coolingFactor-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*this.coolingFactor*(1-o.COOLING_ADAPTATION_FACTOR))}this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT_INCREMENTAL}else{if(t>o.ADAPTATION_LOWER_NODE_LIMIT){this.coolingFactor=Math.max(o.COOLING_ADAPTATION_FACTOR,1-(t-o.ADAPTATION_LOWER_NODE_LIMIT)/(o.ADAPTATION_UPPER_NODE_LIMIT-o.ADAPTATION_LOWER_NODE_LIMIT)*(1-o.COOLING_ADAPTATION_FACTOR))}else{this.coolingFactor=1}this.initialCoolingFactor=this.coolingFactor;this.maxNodeDisplacement=o.MAX_NODE_DISPLACEMENT}this.maxIterations=Math.max(this.getAllNodes().length*5,this.maxIterations);this.totalDisplacementThreshold=this.displacementThresholdPerNode*this.getAllNodes().length;this.repulsionRange=this.calcRepulsionRange()};l.prototype.calcSpringForces=function(){var t=this.getAllEdges();var e;for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:true;var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;var r,i;var n,a;var s=this.getAllNodes();var h;if(this.useFRGridVariant){if(this.totalIterations%o.GRID_CALCULATION_CHECK_PERIOD==1&&t){this.updateGrid()}h=new Set;for(r=0;rh||s>h){t.gravitationForceX=-this.gravityConstant*n;t.gravitationForceY=-this.gravityConstant*o}}else{h=e.getEstimatedSize()*this.compoundGravityRangeFactor;if(a>h||s>h){t.gravitationForceX=-this.gravityConstant*n*this.compoundGravityConstant;t.gravitationForceY=-this.gravityConstant*o*this.compoundGravityConstant}}};l.prototype.isConverged=function(){var t;var e=false;if(this.totalIterations>this.maxIterations/3){e=Math.abs(this.totalDisplacement-this.oldTotalDisplacement)<2}t=this.totalDisplacement=h.length||c>=h[0].length)){for(var u=0;ue}}]);return t}();t.exports=a},function(t,e,r){"use strict";var i=function(){function t(t,e){for(var r=0;r2&&arguments[2]!==undefined?arguments[2]:1;var o=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;var a=arguments.length>4&&arguments[4]!==undefined?arguments[4]:-1;n(this,t);this.sequence1=e;this.sequence2=r;this.match_score=i;this.mismatch_penalty=o;this.gap_penalty=a;this.iMax=e.length+1;this.jMax=r.length+1;this.grid=new Array(this.iMax);for(var s=0;s=0;r--){var i=this.listeners[r];if(i.event===t&&i.callback===e){this.listeners.splice(r,1)}}};n.emit=function(t,e){for(var r=0;r{"use strict";r.d(e,{diagram:()=>J});var i=r(76261);var n=r(96049);var o=r(93113);var a=r(75905);var s=r(76405);var h=r(43457);var l=r.n(h);var c=r(24982);var u=r(63170);var g=r(77470);var d=r(48750);var p=function(){var t=(0,a.K2)((function(t,e,r,i){for(r=r||{},i=t.length;i--;r[t[i]]=e);return r}),"o"),e=[1,4],r=[1,13],i=[1,12],n=[1,15],o=[1,16],s=[1,20],h=[1,19],l=[6,7,8],c=[1,26],u=[1,24],g=[1,25],d=[6,7,11],p=[1,6,13,15,16,19,22],f=[1,33],v=[1,34],y=[1,6,7,11,13,15,16,19,22];var E={trace:(0,a.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:(0,a.K2)((function t(e,r,i,n,o,a,s){var h=a.length-1;switch(o){case 6:case 7:return n;break;case 8:n.getLogger().trace("Stop NL ");break;case 9:n.getLogger().trace("Stop EOF ");break;case 11:n.getLogger().trace("Stop NL2 ");break;case 12:n.getLogger().trace("Stop EOF2 ");break;case 15:n.getLogger().info("Node: ",a[h].id);n.addNode(a[h-1].length,a[h].id,a[h].descr,a[h].type);break;case 16:n.getLogger().trace("Icon: ",a[h]);n.decorateNode({icon:a[h]});break;case 17:case 21:n.decorateNode({class:a[h]});break;case 18:n.getLogger().trace("SPACELIST");break;case 19:n.getLogger().trace("Node: ",a[h].id);n.addNode(0,a[h].id,a[h].descr,a[h].type);break;case 20:n.decorateNode({icon:a[h]});break;case 25:n.getLogger().trace("node found ..",a[h-2]);this.$={id:a[h-1],descr:a[h-1],type:n.getType(a[h-2],a[h])};break;case 26:this.$={id:a[h],descr:a[h],type:n.nodeType.DEFAULT};break;case 27:n.getLogger().trace("node found ..",a[h-3]);this.$={id:a[h-3],descr:a[h-1],type:n.getType(a[h-2],a[h])};break}}),"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:r,7:[1,10],9:9,12:11,13:i,14:14,15:n,16:o,17:17,18:18,19:s,22:h},t(l,[2,3]),{1:[2,2]},t(l,[2,4]),t(l,[2,5]),{1:[2,6],6:r,12:21,13:i,14:14,15:n,16:o,17:17,18:18,19:s,22:h},{6:r,9:22,12:11,13:i,14:14,15:n,16:o,17:17,18:18,19:s,22:h},{6:c,7:u,10:23,11:g},t(d,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:s,22:h}),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,23]),t(d,[2,24]),t(d,[2,26],{19:[1,30]}),{20:[1,31]},{6:c,7:u,10:32,11:g},{1:[2,7],6:r,12:21,13:i,14:14,15:n,16:o,17:17,18:18,19:s,22:h},t(p,[2,14],{7:f,11:v}),t(y,[2,8]),t(y,[2,9]),t(y,[2,10]),t(d,[2,15]),t(d,[2,16]),t(d,[2,17]),{20:[1,35]},{21:[1,36]},t(p,[2,13],{7:f,11:v}),t(y,[2,11]),t(y,[2,12]),{21:[1,37]},t(d,[2,25]),t(d,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:(0,a.K2)((function t(e,r){if(r.recoverable){this.trace(e)}else{var i=new Error(e);i.hash=r;throw i}}),"parseError"),parse:(0,a.K2)((function t(e){var r=this,i=[0],n=[],o=[null],s=[],h=this.table,l="",c=0,u=0,g=0,d=2,p=1;var f=s.slice.call(arguments,1);var v=Object.create(this.lexer);var y={yy:{}};for(var E in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,E)){y.yy[E]=this.yy[E]}}v.setInput(e,y.yy);y.yy.lexer=v;y.yy.parser=this;if(typeof v.yylloc=="undefined"){v.yylloc={}}var _=v.yylloc;s.push(_);var m=v.options&&v.options.ranges;if(typeof y.yy.parseError==="function"){this.parseError=y.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function N(t){i.length=i.length-2*t;o.length=o.length-t;s.length=s.length-t}(0,a.K2)(N,"popStack");function A(){var t;t=n.pop()||v.lex()||p;if(typeof t!=="number"){if(t instanceof Array){n=t;t=n.pop()}t=r.symbols_[t]||t}return t}(0,a.K2)(A,"lex");var L,T,O,D,I,w,R={},C,M,x,b;while(true){O=i[i.length-1];if(this.defaultActions[O]){D=this.defaultActions[O]}else{if(L===null||typeof L=="undefined"){L=A()}D=h[O]&&h[O][L]}if(typeof D==="undefined"||!D.length||!D[0]){var G="";b=[];for(C in h[O]){if(this.terminals_[C]&&C>d){b.push("'"+this.terminals_[C]+"'")}}if(v.showPosition){G="Parse error on line "+(c+1)+":\n"+v.showPosition()+"\nExpecting "+b.join(", ")+", got '"+(this.terminals_[L]||L)+"'"}else{G="Parse error on line "+(c+1)+": Unexpected "+(L==p?"end of input":"'"+(this.terminals_[L]||L)+"'")}this.parseError(G,{text:v.match,token:this.terminals_[L]||L,line:v.yylineno,loc:_,expected:b})}if(D[0]instanceof Array&&D.length>1){throw new Error("Parse Error: multiple actions possible at state: "+O+", token: "+L)}switch(D[0]){case 1:i.push(L);o.push(v.yytext);s.push(v.yylloc);i.push(D[1]);L=null;if(!T){u=v.yyleng;l=v.yytext;c=v.yylineno;_=v.yylloc;if(g>0){g--}}else{L=T;T=null}break;case 2:M=this.productions_[D[1]][1];R.$=o[o.length-M];R._$={first_line:s[s.length-(M||1)].first_line,last_line:s[s.length-1].last_line,first_column:s[s.length-(M||1)].first_column,last_column:s[s.length-1].last_column};if(m){R._$.range=[s[s.length-(M||1)].range[0],s[s.length-1].range[1]]}w=this.performAction.apply(R,[l,u,c,y.yy,D[1],o,s].concat(f));if(typeof w!=="undefined"){return w}if(M){i=i.slice(0,-1*M*2);o=o.slice(0,-1*M);s=s.slice(0,-1*M)}i.push(this.productions_[D[1]][0]);o.push(R.$);s.push(R._$);x=h[i[i.length-2]][i[i.length-1]];i.push(x);break;case 3:return true}}return true}),"parse")};var _=function(){var t={EOF:1,parseError:(0,a.K2)((function t(e,r){if(this.yy.parser){this.yy.parser.parseError(e,r)}else{throw new Error(e)}}),"parseError"),setInput:(0,a.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,a.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,a.K2)((function(t){var e=t.length;var r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-e);this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(r.length-1){this.yylineno-=r.length-1}var n=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===i.length?this.yylloc.first_column:0)+i[i.length-r.length].length-r[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[n[0],n[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,a.K2)((function(){this._more=true;return this}),"more"),reject:(0,a.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,a.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,a.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,a.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,a.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,a.K2)((function(t,e){var r,i,n;if(this.options.backtrack_lexer){n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){n.yylloc.range=this.yylloc.range.slice(0)}}i=t[0].match(/(?:\r\n?|\n).*/g);if(i){this.yylineno+=i.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(r){return r}else if(this._backtrack){for(var o in n){this[o]=n[o]}return false}return false}),"test_match"),next:(0,a.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,r,i;if(!this._more){this.yytext="";this.match=""}var n=this._currentRules();for(var o=0;oe[0].length)){e=r;i=o;if(this.options.backtrack_lexer){t=this.test_match(r,n[o]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,n[i]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,a.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,a.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,a.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,a.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,a.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,a.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,a.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,a.K2)((function t(e,r,i,n){var o=n;switch(i){case 0:e.getLogger().trace("Found comment",r.yytext);return 6;break;case 1:return 8;break;case 2:this.begin("CLASS");break;case 3:this.popState();return 16;break;case 4:this.popState();break;case 5:e.getLogger().trace("Begin icon");this.begin("ICON");break;case 6:e.getLogger().trace("SPACELINE");return 6;break;case 7:return 7;break;case 8:return 15;break;case 9:e.getLogger().trace("end icon");this.popState();break;case 10:e.getLogger().trace("Exploding node");this.begin("NODE");return 19;break;case 11:e.getLogger().trace("Cloud");this.begin("NODE");return 19;break;case 12:e.getLogger().trace("Explosion Bang");this.begin("NODE");return 19;break;case 13:e.getLogger().trace("Cloud Bang");this.begin("NODE");return 19;break;case 14:this.begin("NODE");return 19;break;case 15:this.begin("NODE");return 19;break;case 16:this.begin("NODE");return 19;break;case 17:this.begin("NODE");return 19;break;case 18:return 13;break;case 19:return 22;break;case 20:return 11;break;case 21:this.begin("NSTR2");break;case 22:return"NODE_DESCR";break;case 23:this.popState();break;case 24:e.getLogger().trace("Starting NSTR");this.begin("NSTR");break;case 25:e.getLogger().trace("description:",r.yytext);return"NODE_DESCR";break;case 26:this.popState();break;case 27:this.popState();e.getLogger().trace("node end ))");return"NODE_DEND";break;case 28:this.popState();e.getLogger().trace("node end )");return"NODE_DEND";break;case 29:this.popState();e.getLogger().trace("node end ...",r.yytext);return"NODE_DEND";break;case 30:this.popState();e.getLogger().trace("node end ((");return"NODE_DEND";break;case 31:this.popState();e.getLogger().trace("node end (-");return"NODE_DEND";break;case 32:this.popState();e.getLogger().trace("node end (-");return"NODE_DEND";break;case 33:this.popState();e.getLogger().trace("node end ((");return"NODE_DEND";break;case 34:this.popState();e.getLogger().trace("node end ((");return"NODE_DEND";break;case 35:e.getLogger().trace("Long description:",r.yytext);return 20;break;case 36:e.getLogger().trace("Long description:",r.yytext);return 20;break}}),"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:mindmap\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{CLASS:{rules:[3,4],inclusive:false},ICON:{rules:[8,9],inclusive:false},NSTR2:{rules:[22,23],inclusive:false},NSTR:{rules:[25,26],inclusive:false},NODE:{rules:[21,24,27,28,29,30,31,32,33,34,35,36],inclusive:false},INITIAL:{rules:[0,1,2,5,6,7,10,11,12,13,14,15,16,17,18,19,20],inclusive:true}}};return t}();E.lexer=_;function m(){this.yy={}}(0,a.K2)(m,"Parser");m.prototype=E;E.Parser=m;return new m}();p.parser=p;var f=p;var v=[];var y=0;var E={};var _=(0,a.K2)((()=>{v=[];y=0;E={}}),"clear");var m=(0,a.K2)((function(t){for(let e=v.length-1;e>=0;e--){if(v[e].levelv.length>0?v[0]:null),"getMindmap");var A=(0,a.K2)(((t,e,r,i)=>{a.Rm.info("addNode",t,e,r,i);const n=(0,a.D7)();let o=n.mindmap?.padding??a.UI.mindmap.padding;switch(i){case L.ROUNDED_RECT:case L.RECT:case L.HEXAGON:o*=2}const s={id:y++,nodeId:(0,a.jZ)(e,n),level:t,descr:(0,a.jZ)(r,n),type:i,children:[],width:n.mindmap?.maxNodeWidth??a.UI.mindmap.maxNodeWidth,padding:o};const h=m(t);if(h){h.children.push(s);v.push(s)}else{if(v.length===0){v.push(s)}else{throw new Error('There can be only one root. No parent could be found for ("'+s.descr+'")')}}}),"addNode");var L={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6};var T=(0,a.K2)(((t,e)=>{a.Rm.debug("In get type",t,e);switch(t){case"[":return L.RECT;case"(":return e===")"?L.ROUNDED_RECT:L.CLOUD;case"((":return L.CIRCLE;case")":return L.CLOUD;case"))":return L.BANG;case"{{":return L.HEXAGON;default:return L.DEFAULT}}),"getType");var O=(0,a.K2)(((t,e)=>{E[t]=e}),"setElementForId");var D=(0,a.K2)((t=>{if(!t){return}const e=(0,a.D7)();const r=v[v.length-1];if(t.icon){r.icon=(0,a.jZ)(t.icon,e)}if(t.class){r.class=(0,a.jZ)(t.class,e)}}),"decorateNode");var I=(0,a.K2)((t=>{switch(t){case L.DEFAULT:return"no-border";case L.RECT:return"rect";case L.ROUNDED_RECT:return"rounded-rect";case L.CIRCLE:return"circle";case L.CLOUD:return"cloud";case L.BANG:return"bang";case L.HEXAGON:return"hexgon";default:return"no-border"}}),"type2Str");var w=(0,a.K2)((()=>a.Rm),"getLogger");var R=(0,a.K2)((t=>E[t]),"getElementById");var C={clear:_,addNode:A,getMindmap:N,nodeType:L,getType:T,setElementForId:O,decorateNode:D,type2Str:I,getLogger:w,getElementById:R};var M=C;var x=12;var b=(0,a.K2)((function(t,e,r,i){const n=5;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 ${r.height-n} v${-r.height+2*n} q0,-5 5,-5 h${r.width-2*n} q5,0 5,5 v${r.height-n} H0 Z`);e.append("line").attr("class","node-line-"+i).attr("x1",0).attr("y1",r.height).attr("x2",r.width).attr("y2",r.height)}),"defaultBkg");var G=(0,a.K2)((function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("width",r.width)}),"rectBkg");var S=(0,a.K2)((function(t,e,r){const i=r.width;const n=r.height;const o=.15*i;const a=.25*i;const s=.35*i;const h=.2*i;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${o},${o} 0 0,1 ${i*.25},${-1*i*.1}\n a${s},${s} 1 0,1 ${i*.4},${-1*i*.1}\n a${a},${a} 1 0,1 ${i*.35},${1*i*.2}\n\n a${o},${o} 1 0,1 ${i*.15},${1*n*.35}\n a${h},${h} 1 0,1 ${-1*i*.15},${1*n*.65}\n\n a${a},${o} 1 0,1 ${-1*i*.25},${i*.15}\n a${s},${s} 1 0,1 ${-1*i*.5},${0}\n a${o},${o} 1 0,1 ${-1*i*.25},${-1*i*.15}\n\n a${o},${o} 1 0,1 ${-1*i*.1},${-1*n*.35}\n a${h},${h} 1 0,1 ${i*.1},${-1*n*.65}\n\n H0 V0 Z`)}),"cloudBkg");var F=(0,a.K2)((function(t,e,r){const i=r.width;const n=r.height;const o=.15*i;e.append("path").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("d",`M0 0 a${o},${o} 1 0,0 ${i*.25},${-1*n*.1}\n a${o},${o} 1 0,0 ${i*.25},${0}\n a${o},${o} 1 0,0 ${i*.25},${0}\n a${o},${o} 1 0,0 ${i*.25},${1*n*.1}\n\n a${o},${o} 1 0,0 ${i*.15},${1*n*.33}\n a${o*.8},${o*.8} 1 0,0 ${0},${1*n*.34}\n a${o},${o} 1 0,0 ${-1*i*.15},${1*n*.33}\n\n a${o},${o} 1 0,0 ${-1*i*.25},${n*.15}\n a${o},${o} 1 0,0 ${-1*i*.25},${0}\n a${o},${o} 1 0,0 ${-1*i*.25},${0}\n a${o},${o} 1 0,0 ${-1*i*.25},${-1*n*.15}\n\n a${o},${o} 1 0,0 ${-1*i*.1},${-1*n*.33}\n a${o*.8},${o*.8} 1 0,0 ${0},${-1*n*.34}\n a${o},${o} 1 0,0 ${i*.1},${-1*n*.33}\n\n H0 V0 Z`)}),"bangBkg");var P=(0,a.K2)((function(t,e,r){e.append("circle").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("r",r.width/2)}),"circleBkg");function k(t,e,r,i,n){return t.insert("polygon",":first-child").attr("points",i.map((function(t){return t.x+","+t.y})).join(" ")).attr("transform","translate("+(n.width-e)/2+", "+r+")")}(0,a.K2)(k,"insertPolygonShape");var U=(0,a.K2)((function(t,e,r){const i=r.height;const n=4;const o=i/n;const a=r.width-r.padding+2*o;const s=[{x:o,y:0},{x:a-o,y:0},{x:a,y:-i/2},{x:a-o,y:-i},{x:o,y:-i},{x:0,y:-i/2}];k(e,a,i,s,r)}),"hexagonBkg");var Y=(0,a.K2)((function(t,e,r){e.append("rect").attr("id","node-"+r.id).attr("class","node-bkg node-"+t.type2Str(r.type)).attr("height",r.height).attr("rx",r.padding).attr("ry",r.padding).attr("width",r.width)}),"roundedRectBkg");var X=(0,a.K2)((async function(t,e,r,o,a){const s=a.htmlLabels;const h=o%(x-1);const l=e.append("g");r.section=h;let c="section-"+h;if(h<0){c+=" section-root"}l.attr("class",(r.class?r.class+" ":"")+"mindmap-node "+c);const u=l.append("g");const g=l.append("g");const d=r.descr.replace(/()/g,"\n");await(0,i.GZ)(g,d,{useHtmlLabels:s,width:r.width,classes:"mindmap-node-label"},a);if(!s){g.attr("dy","1em").attr("alignment-baseline","middle").attr("dominant-baseline","middle").attr("text-anchor","middle")}const p=g.node().getBBox();const[f]=(0,n.I5)(a.fontSize);r.height=p.height+f*1.1*.5+r.padding;r.width=p.width+2*r.padding;if(r.icon){if(r.type===t.nodeType.CIRCLE){r.height+=50;r.width+=50;const t=l.append("foreignObject").attr("height","50px").attr("width",r.width).attr("style","text-align: center;");t.append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+h+" "+r.icon);g.attr("transform","translate("+r.width/2+", "+(r.height/2-1.5*r.padding)+")")}else{r.width+=50;const t=r.height;r.height=Math.max(t,60);const e=Math.abs(r.height-t);const i=l.append("foreignObject").attr("width","60px").attr("height",r.height).attr("style","text-align: center;margin-top:"+e/2+"px;");i.append("div").attr("class","icon-container").append("i").attr("class","node-icon-"+h+" "+r.icon);g.attr("transform","translate("+(25+r.width/2)+", "+(e/2+r.padding/2)+")")}}else{if(!s){const t=r.width/2;const e=r.padding/2;g.attr("transform","translate("+t+", "+e+")")}else{const t=(r.width-p.width)/2;const e=(r.height-p.height)/2;g.attr("transform","translate("+t+", "+e+")")}}switch(r.type){case t.nodeType.DEFAULT:b(t,u,r,h);break;case t.nodeType.ROUNDED_RECT:Y(t,u,r,h);break;case t.nodeType.RECT:G(t,u,r,h);break;case t.nodeType.CIRCLE:u.attr("transform","translate("+r.width/2+", "+ +r.height/2+")");P(t,u,r,h);break;case t.nodeType.CLOUD:S(t,u,r,h);break;case t.nodeType.BANG:F(t,u,r,h);break;case t.nodeType.HEXAGON:U(t,u,r,h);break}t.setElementForId(r.id,l);return r.height}),"drawNode");var $=(0,a.K2)((function(t,e){const r=t.getElementById(e.id);const i=e.x||0;const n=e.y||0;r.attr("transform","translate("+i+","+n+")")}),"positionNode");s.A.use(l());async function B(t,e,r,i,n){await X(t,e,r,i,n);if(r.children){await Promise.all(r.children.map(((r,o)=>B(t,e,r,i<0?o:i,n))))}}(0,a.K2)(B,"drawNodes");function H(t,e){e.edges().map(((e,r)=>{const i=e.data();if(e[0]._private.bodyBounds){const n=e[0]._private.rscratch;a.Rm.trace("Edge: ",r,i);t.insert("path").attr("d",`M ${n.startX},${n.startY} L ${n.midX},${n.midY} L${n.endX},${n.endY} `).attr("class","edge section-edge-"+i.section+" edge-depth-"+i.depth)}}))}(0,a.K2)(H,"drawEdges");function W(t,e,r,i){e.add({group:"nodes",data:{id:t.id.toString(),labelText:t.descr,height:t.height,width:t.width,level:i,nodeId:t.id,padding:t.padding,type:t.type},position:{x:t.x,y:t.y}});if(t.children){t.children.forEach((n=>{W(n,e,r,i+1);e.add({group:"edges",data:{id:`${t.id}_${n.id}`,source:t.id,target:n.id,depth:i,section:n.section}})}))}}(0,a.K2)(W,"addNodes");function j(t,e){return new Promise((r=>{const i=(0,c.Ltv)("body").append("div").attr("id","cy").attr("style","display:none");const n=(0,s.A)({container:document.getElementById("cy"),style:[{selector:"edge",style:{"curve-style":"bezier"}}]});i.remove();W(t,n,e,0);n.nodes().forEach((function(t){t.layoutDimensions=()=>{const e=t.data();return{w:e.width,h:e.height}}}));n.layout({name:"cose-bilkent",quality:"proof",styleEnabled:false,animate:false}).run();n.ready((t=>{a.Rm.info("Ready",t);r(n)}))}))}(0,a.K2)(j,"layoutMindmap");function V(t,e){e.nodes().map(((e,r)=>{const i=e.data();i.x=e.position().x;i.y=e.position().y;$(t,i);const n=t.getElementById(i.nodeId);a.Rm.info("Id:",r,"Position: (",e.position().x,", ",e.position().y,")",i);n.attr("transform",`translate(${e.position().x-i.width/2}, ${e.position().y-i.height/2})`);n.attr("attr",`apa-${r})`)}))}(0,a.K2)(V,"positionNodes");var K=(0,a.K2)((async(t,e,r,i)=>{a.Rm.debug("Rendering mindmap diagram\n"+t);const n=i.db;const s=n.getMindmap();if(!s){return}const h=(0,a.D7)();h.htmlLabels=false;const l=(0,o.D)(e);const c=l.append("g");c.attr("class","mindmap-edges");const u=l.append("g");u.attr("class","mindmap-nodes");await B(n,u,s,-1,h);const g=await j(s,h);H(c,g);V(n,g);(0,a.ot)(void 0,l,h.mindmap?.padding??a.UI.mindmap.padding,h.mindmap?.useMaxWidth??a.UI.mindmap.useMaxWidth)}),"draw");var z={draw:K};var q=(0,a.K2)((t=>{let e="";for(let r=0;r`\n .edge {\n stroke-width: 3;\n }\n ${q(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .mindmap-node-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n`),"getStyles");var Q=Z;var J={db:M,renderer:z,parser:f,styles:Q}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/898.ed04189e15f0a3781fb1.js b/.venv/share/jupyter/lab/static/898.ed04189e15f0a3781fb1.js new file mode 100644 index 0000000000000000000000000000000000000000..1a2cf71616b8389ae303e82bd058a063416c6728 --- /dev/null +++ b/.venv/share/jupyter/lab/static/898.ed04189e15f0a3781fb1.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[898],{19163:(t,e,a)=>{a.d(e,{S:()=>n});var r=a(75905);function n(t,e){if(t.accDescr){e.setAccDescription?.(t.accDescr)}if(t.accTitle){e.setAccTitle?.(t.accTitle)}if(t.title){e.setDiagramTitle?.(t.title)}}(0,r.K2)(n,"populateCommonDb")},80898:(t,e,a)=>{a.d(e,{diagram:()=>_});var r=a(19163);var n=a(96049);var s=a(93113);var i=a(75905);var o=a(24010);var c={showLegend:true,ticks:5,max:null,min:0,graticule:"circle"};var l={axes:[],curves:[],options:c};var d=structuredClone(l);var p=i.UI.radar;var g=(0,i.K2)((()=>{const t=(0,n.$t)({...p,...(0,i.zj)().radar});return t}),"getConfig");var u=(0,i.K2)((()=>d.axes),"getAxes");var h=(0,i.K2)((()=>d.curves),"getCurves");var x=(0,i.K2)((()=>d.options),"getOptions");var m=(0,i.K2)((t=>{d.axes=t.map((t=>({name:t.name,label:t.label??t.name})))}),"setAxes");var v=(0,i.K2)((t=>{d.curves=t.map((t=>({name:t.name,label:t.label??t.name,entries:$(t.entries)})))}),"setCurves");var $=(0,i.K2)((t=>{if(t[0].axis==void 0){return t.map((t=>t.value))}const e=u();if(e.length===0){throw new Error("Axes must be populated before curves for reference entries")}return e.map((e=>{const a=t.find((t=>t.axis?.$refText===e.name));if(a===void 0){throw new Error("Missing entry for axis "+e.label)}return a.value}))}),"computeCurveEntries");var f=(0,i.K2)((t=>{const e=t.reduce(((t,e)=>{t[e.name]=e;return t}),{});d.options={showLegend:e.showLegend?.value??c.showLegend,ticks:e.ticks?.value??c.ticks,max:e.max?.value??c.max,min:e.min?.value??c.min,graticule:e.graticule?.value??c.graticule}}),"setOptions");var y=(0,i.K2)((()=>{(0,i.IU)();d=structuredClone(l)}),"clear");var b={getAxes:u,getCurves:h,getOptions:x,setAxes:m,setCurves:v,setOptions:f,getConfig:g,clear:y,setAccTitle:i.SV,getAccTitle:i.iN,setDiagramTitle:i.ke,getDiagramTitle:i.ab,getAccDescription:i.m7,setAccDescription:i.EI};var w=(0,i.K2)((t=>{(0,r.S)(t,b);const{axes:e,curves:a,options:n}=t;b.setAxes(e);b.setCurves(a);b.setOptions(n)}),"populate");var C={parse:(0,i.K2)((async t=>{const e=await(0,o.qg)("radar",t);i.Rm.debug(e);w(e)}),"parse")};var M=(0,i.K2)(((t,e,a,r)=>{const n=r.db;const i=n.getAxes();const o=n.getCurves();const c=n.getOptions();const l=n.getConfig();const d=n.getDiagramTitle();const p=(0,s.D)(e);const g=K(p,l);const u=c.max??Math.max(...o.map((t=>Math.max(...t.entries))));const h=c.min;const x=Math.min(l.width,l.height)/2;L(g,i,x,c.ticks,c.graticule);T(g,i,x,l);k(g,i,o,h,u,c.graticule,l);S(g,o,c.showLegend,l);g.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-l.height/2-l.marginTop)}),"draw");var K=(0,i.K2)(((t,e)=>{const a=e.width+e.marginLeft+e.marginRight;const r=e.height+e.marginTop+e.marginBottom;const n={x:e.marginLeft+e.width/2,y:e.marginTop+e.height/2};t.attr("viewbox",`0 0 ${a} ${r}`).attr("width",a).attr("height",r);return t.append("g").attr("transform",`translate(${n.x}, ${n.y})`)}),"drawFrame");var L=(0,i.K2)(((t,e,a,r,n)=>{if(n==="circle"){for(let e=0;e{const a=2*e*Math.PI/n-Math.PI/2;const r=i*Math.cos(a);const s=i*Math.sin(a);return`${r},${s}`})).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}}),"drawGraticule");var T=(0,i.K2)(((t,e,a,r)=>{const n=e.length;for(let s=0;s{if(e.entries.length!==o){return}const l=e.entries.map(((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2;const s=A(t,r,n,c);const i=s*Math.cos(a);const l=s*Math.sin(a);return{x:i,y:l}}));if(s==="circle"){t.append("path").attr("d",O(l,i.curveTension)).attr("class",`radarCurve-${a}`)}else if(s==="polygon"){t.append("polygon").attr("points",l.map((t=>`${t.x},${t.y}`)).join(" ")).attr("class",`radarCurve-${a}`)}}))}(0,i.K2)(k,"drawCurves");function A(t,e,a,r){const n=Math.min(Math.max(t,e),a);return r*(n-e)/(a-e)}(0,i.K2)(A,"relativeRadius");function O(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n{const r=t.append("g").attr("transform",`translate(${n}, ${s+a*i})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`);r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)}))}(0,i.K2)(S,"drawLegend");var I={draw:M};var D=(0,i.K2)(((t,e)=>{let a="";for(let r=0;r{const e=(0,i.P$)();const a=(0,i.zj)();const r=(0,n.$t)(e,a.themeVariables);const s=(0,n.$t)(r.radar,t);return{themeVariables:r,radarOptions:s}}),"buildRadarStyleOptions");var E=(0,i.K2)((({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=z(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${a.axisColor};\n\t\tstroke-width: ${a.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tdominant-baseline: middle;\n\t\ttext-anchor: middle;\n\t\tfont-size: ${a.axisLabelFontSize}px;\n\t\tcolor: ${a.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${a.graticuleColor};\n\t\tfill-opacity: ${a.graticuleOpacity};\n\t\tstroke: ${a.graticuleColor};\n\t\tstroke-width: ${a.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${a.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${D(e,a)}\n\t`}),"styles");var _={parser:C,db:b,renderer:I,styles:E}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/8ea8791754915a898a31.woff2 b/.venv/share/jupyter/lab/static/8ea8791754915a898a31.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..402f81c0bc082532fca61319959cb4b8e597de9d Binary files /dev/null and b/.venv/share/jupyter/lab/static/8ea8791754915a898a31.woff2 differ diff --git a/.venv/share/jupyter/lab/static/8ea8dbb1b02e6f730f55.woff b/.venv/share/jupyter/lab/static/8ea8dbb1b02e6f730f55.woff new file mode 100644 index 0000000000000000000000000000000000000000..6496d17f5261f2f4e4cf47522441db9f9dc52ad8 Binary files /dev/null and b/.venv/share/jupyter/lab/static/8ea8dbb1b02e6f730f55.woff differ diff --git a/.venv/share/jupyter/lab/static/9023.2ff687d7ff50df3719fc.js b/.venv/share/jupyter/lab/static/9023.2ff687d7ff50df3719fc.js new file mode 100644 index 0000000000000000000000000000000000000000..333f0fbc38436bc1e3a69e3251b81120ca760d34 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9023.2ff687d7ff50df3719fc.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9023],{99023:(e,t,n)=>{n.r(t);n.d(t,{cypher:()=>f});var r=function(e){return new RegExp("^(?:"+e.join("|")+")$","i")};var a=function(e){o=null;var t=e.next();if(t==='"'){e.match(/^.*?"/);return"string"}if(t==="'"){e.match(/^.*?'/);return"string"}if(/[{}\(\),\.;\[\]]/.test(t)){o=t;return"punctuation"}else if(t==="/"&&e.eat("/")){e.skipToEnd();return"comment"}else if(d.test(t)){e.eatWhile(d);return null}else{e.eatWhile(/[_\w\d]/);if(e.eat(":")){e.eatWhile(/[\w\d_\-]/);return"atom"}var n=e.current();if(l.test(n))return"builtin";if(c.test(n))return"def";if(u.test(n)||p.test(n))return"keyword";return"variable"}};var i=function(e,t,n){return e.context={prev:e.context,indent:e.indent,col:n,type:t}};var s=function(e){e.indent=e.context.indent;return e.context=e.context.prev};var o;var l=r(["abs","acos","allShortestPaths","asin","atan","atan2","avg","ceil","coalesce","collect","cos","cot","count","degrees","e","endnode","exp","extract","filter","floor","haversin","head","id","keys","labels","last","left","length","log","log10","lower","ltrim","max","min","node","nodes","percentileCont","percentileDisc","pi","radians","rand","range","reduce","rel","relationship","relationships","replace","reverse","right","round","rtrim","shortestPath","sign","sin","size","split","sqrt","startnode","stdev","stdevp","str","substring","sum","tail","tan","timestamp","toFloat","toInt","toString","trim","type","upper"]);var c=r(["all","and","any","contains","exists","has","in","none","not","or","single","xor"]);var u=r(["as","asc","ascending","assert","by","case","commit","constraint","create","csv","cypher","delete","desc","descending","detach","distinct","drop","else","end","ends","explain","false","fieldterminator","foreach","from","headers","in","index","is","join","limit","load","match","merge","null","on","optional","order","periodic","profile","remove","return","scan","set","skip","start","starts","then","true","union","unique","unwind","using","when","where","with","call","yield"]);var p=r(["access","active","assign","all","alter","as","catalog","change","copy","create","constraint","constraints","current","database","databases","dbms","default","deny","drop","element","elements","exists","from","grant","graph","graphs","if","index","indexes","label","labels","management","match","name","names","new","node","nodes","not","of","on","or","password","populated","privileges","property","read","relationship","relationships","remove","replace","required","revoke","role","roles","set","show","start","status","stop","suspended","to","traverse","type","types","user","users","with","write"]);var d=/[*+\-<>=&|~%^]/;const f={name:"cypher",startState:function(){return{tokenize:a,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()){if(t.context&&t.context.align==null){t.context.align=false}t.indent=e.indentation()}if(e.eatSpace()){return null}var n=t.tokenize(e,t);if(n!=="comment"&&t.context&&t.context.align==null&&t.context.type!=="pattern"){t.context.align=true}if(o==="("){i(t,")",e.column())}else if(o==="["){i(t,"]",e.column())}else if(o==="{"){i(t,"}",e.column())}else if(/[\]\}\)]/.test(o)){while(t.context&&t.context.type==="pattern"){s(t)}if(t.context&&o===t.context.type){s(t)}}else if(o==="."&&t.context&&t.context.type==="pattern"){s(t)}else if(/atom|string|variable/.test(n)&&t.context){if(/[\}\]]/.test(t.context.type)){i(t,"pattern",e.column())}else if(t.context.type==="pattern"&&!t.context.align){t.context.align=true;t.context.col=e.column()}}return n},indent:function(e,t,n){var r=t&&t.charAt(0);var a=e.context;if(/[\]\}]/.test(r)){while(a&&a.type==="pattern"){a=a.prev}}var i=a&&r===a.type;if(!a)return 0;if(a.type==="keywords")return null;if(a.align)return a.col+(i?0:1);return a.indent+(i?0:n.unit)}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9046.99c477ea375dcbb8c7ca.js b/.venv/share/jupyter/lab/static/9046.99c477ea375dcbb8c7ca.js new file mode 100644 index 0000000000000000000000000000000000000000..7e2c20ba479e25629e48149d55025f4c23bad5e7 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9046.99c477ea375dcbb8c7ca.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9046,5606],{32421:(t,e,n)=>{"use strict";n.d(e,{HT:()=>c,HV:()=>s,S2:()=>o,cy:()=>d});const s=t=>t[t.length-1];const r=()=>[];const i=t=>t.slice();const o=(t,e)=>{for(let n=0;n{for(let n=0;n{for(let n=0;nt.length===e.length&&l(t,((t,n)=>t===e[n]));const u=t=>t.reduce(((t,e)=>t.concat(e)),[]);const d=Array.isArray;const f=t=>c(set.from(t));const g=(t,e)=>{const n=set.create();const s=[];for(let r=0;r{"use strict";n.d(e,{EK:()=>u,OK:()=>r,vo:()=>a});var s=n(70641);const r=(t,e,n=0)=>{try{for(;n{};const o=t=>t();const c=t=>t;const l=(t,e)=>t===e;const h=(t,e)=>t===e||t!=null&&e!=null&&t.constructor===e.constructor&&(t instanceof Array&&array.equalFlat(t,e)||typeof t==="object"&&object.equalFlat(t,e));const a=(t,e)=>{if(t==null||e==null){return l(t,e)}if(t.constructor!==e.constructor){return false}if(t===e){return true}switch(t.constructor){case ArrayBuffer:t=new Uint8Array(t);e=new Uint8Array(e);case Uint8Array:{if(t.byteLength!==e.byteLength){return false}for(let n=0;ne.includes(t)},61662:(t,e,n)=>{"use strict";n.d(e,{C:()=>r,Tj:()=>o,_4:()=>i,bz:()=>c,vt:()=>s});const s=()=>new Map;const r=t=>{const e=s();t.forEach(((t,n)=>{e.set(n,t)}));return e};const i=(t,e,n)=>{let s=t.get(e);if(s===undefined){t.set(e,s=n())}return s};const o=(t,e)=>{const n=[];for(const[s,r]of t){n.push(e(r,s))}return n};const c=(t,e)=>{for(const[n,s]of t){if(e(s,n)){return true}}return false};const l=(t,e)=>{for(const[n,s]of t){if(!e(s,n)){return false}}return true}},63616:(t,e,n)=>{"use strict";n.d(e,{RI:()=>s,T9:()=>g,jk:()=>f,sj:()=>b,tn:()=>i});const s=Math.floor;const r=Math.ceil;const i=Math.abs;const o=Math.imul;const c=Math.round;const l=Math.log10;const h=Math.log2;const a=Math.log;const u=Math.sqrt;const d=(t,e)=>t+e;const f=(t,e)=>tt>e?t:e;const p=Number.isNaN;const w=Math.pow;const m=t=>Math.pow(10,t);const y=Math.sign;const b=t=>t!==0?t<0:1/t<0},70641:(t,e,n)=>{"use strict";n.d(e,{Bw:()=>l,SQ:()=>f,i5:()=>d});const s=()=>Object.create(null);const r=Object.assign;const i=Object.keys;const o=(t,e)=>{for(const n in t){e(t[n],n)}};const c=(t,e)=>{const n=[];for(const s in t){n.push(e(t[s],s))}return n};const l=t=>i(t).length;const h=(t,e)=>{for(const n in t){if(e(t[n],n)){return true}}return false};const a=t=>{for(const e in t){return false}return true};const u=(t,e)=>{for(const n in t){if(!e(t[n],n)){return false}}return true};const d=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);const f=(t,e)=>t===e||l(t)===l(e)&&u(t,((t,n)=>(t!==undefined||d(e,n))&&e[n]===t))},5739:(t,e,n)=>{"use strict";n.d(e,{c:()=>o});var s=n(61662);var r=n(25404);var i=n(32421);class o{constructor(){this._observers=s.vt()}on(t,e){s._4(this._observers,t,r.vt).add(e)}once(t,e){const n=(...s)=>{this.off(t,n);e(...s)};this.on(t,n)}off(t,e){const n=this._observers.get(t);if(n!==undefined){n.delete(e);if(n.size===0){this._observers.delete(t)}}}emit(t,e){return i.HT((this._observers.get(t)||s.vt()).values()).forEach((t=>t(...e)))}destroy(){this._observers=s.vt()}}},25404:(t,e,n)=>{"use strict";n.d(e,{vt:()=>s});const s=()=>new Set;const r=t=>Array.from(t);const i=t=>t.values().next().value||undefined;const o=t=>new Set(t)},64191:(t,e,n)=>{"use strict";n.d(e,{_g:()=>r});const s=()=>new Date;const r=Date.now;const i=t=>{if(t<6e4){const e=metric.prefix(t,-1);return math.round(e.n*100)/100+e.prefix+"s"}t=math.floor(t/1e3);const e=t%60;const n=math.floor(t/60)%60;const s=math.floor(t/3600)%24;const r=math.floor(t/86400);if(r>0){return r+"d"+(s>0||n>30?" "+(n>30?s+1:s)+"h":"")}if(s>0){return s+"h"+(n>0||e>30?" "+(e>30?n+1:n)+"min":"")}return n+"min"+(e>0?" "+e+"s":"")}},65606:t=>{var e=t.exports={};var n;var s;function r(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){n=setTimeout}else{n=r}}catch(t){n=r}try{if(typeof clearTimeout==="function"){s=clearTimeout}else{s=i}}catch(t){s=i}})();function o(t){if(n===setTimeout){return setTimeout(t,0)}if((n===r||!n)&&setTimeout){n=setTimeout;return setTimeout(t,0)}try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}function c(t){if(s===clearTimeout){return clearTimeout(t)}if((s===i||!s)&&clearTimeout){s=clearTimeout;return clearTimeout(t)}try{return s(t)}catch(e){try{return s.call(null,t)}catch(e){return s.call(this,t)}}}var l=[];var h=false;var a;var u=-1;function d(){if(!h||!a){return}h=false;if(a.length){l=a.concat(l)}else{u=-1}if(l.length){f()}}function f(){if(h){return}var t=o(d);h=true;var e=l.length;while(e){a=l;l=[];while(++u1){for(var n=1;n{"use strict";n.r(e);n.d(e,{AbsolutePosition:()=>to,AbstractConnector:()=>Yr,AbstractStruct:()=>Al,AbstractType:()=>Tc,Array:()=>Yc,ContentAny:()=>Jl,ContentBinary:()=>Il,ContentDeleted:()=>Ul,ContentEmbed:()=>Vl,ContentFormat:()=>jl,ContentJSON:()=>Fl,ContentString:()=>Hl,ContentType:()=>eh,Doc:()=>ai,GC:()=>xl,ID:()=>zi,Item:()=>ch,Map:()=>Qc,PermanentUserData:()=>Xi,RelativePosition:()=>Gi,Snapshot:()=>ao,Text:()=>pl,Transaction:()=>No,UndoManager:()=>Ko,UpdateEncoderV1:()=>wi,XmlElement:()=>kl,XmlFragment:()=>yl,XmlHook:()=>El,XmlText:()=>Dl,YArrayEvent:()=>qc,YEvent:()=>wc,YMapEvent:()=>Gc,YTextEvent:()=>gl,YXmlEvent:()=>Sl,applyUpdate:()=>Ai,applyUpdateV2:()=>vi,cleanupYTextFormatting:()=>dl,compareIDs:()=>Ji,compareRelativePositions:()=>ho,convertUpdateFormatV1ToV2:()=>gc,convertUpdateFormatV2ToV1:()=>pc,createAbsolutePositionFromRelativePosition:()=>lo,createDeleteSet:()=>ri,createDeleteSetFromStructStore:()=>ii,createDocFromSnapshot:()=>So,createID:()=>$i,createRelativePositionFromJSON:()=>Zi,createRelativePositionFromTypeIndex:()=>so,createSnapshot:()=>mo,decodeRelativePosition:()=>co,decodeSnapshot:()=>wo,decodeSnapshotV2:()=>po,decodeStateVector:()=>Ui,decodeUpdate:()=>Qo,decodeUpdateV2:()=>Zo,diffUpdate:()=>hc,diffUpdateV2:()=>lc,emptySnapshot:()=>yo,encodeRelativePosition:()=>io,encodeSnapshot:()=>go,encodeSnapshotV2:()=>fo,encodeStateAsUpdate:()=>Ii,encodeStateAsUpdateV2:()=>xi,encodeStateVector:()=>Ri,encodeStateVectorFromUpdate:()=>sc,encodeStateVectorFromUpdateV2:()=>nc,equalSnapshots:()=>uo,findIndexSS:()=>Ao,findRootTypeKey:()=>Ki,getItem:()=>xo,getState:()=>Do,getTypeChildren:()=>vc,isDeleted:()=>ti,isParentOf:()=>qi,iterateDeletedStructs:()=>Qr,logType:()=>Yi,logUpdate:()=>Xo,logUpdateV2:()=>Go,mergeUpdates:()=>ec,mergeUpdatesV2:()=>cc,parseUpdateMeta:()=>ic,parseUpdateMetaV2:()=>rc,readUpdate:()=>Di,readUpdateV2:()=>Ci,relativePositionToJSON:()=>Qi,snapshot:()=>bo,transact:()=>Jo,tryGc:()=>Fo,typeListToArraySnapshot:()=>Mc,typeMapGetSnapshot:()=>Wc});var s=n(5739);var r=n(32421);var i=n(63616);var o=n(61662);const c=String.fromCharCode;const l=String.fromCodePoint;const h=t=>t.toLowerCase();const a=/^\s*/g;const u=t=>t.replace(a,"");const d=/([A-Z])/g;const f=(t,e)=>u(t.replace(d,(t=>`${e}${h(t)}`)));const g=t=>unescape(encodeURIComponent(t)).length;const p=t=>{const e=unescape(encodeURIComponent(t));const n=e.length;const s=new Uint8Array(n);for(let r=0;rw.encode(t);const y=w?m:p;const b=t=>{let e=t.length;let n="";let s=0;while(e>0){const r=e<1e4?e:1e4;const i=t.subarray(s,s+r);s+=r;n+=String.fromCodePoint.apply(null,i);e-=r}return decodeURIComponent(escape(n))};let k=typeof TextDecoder==="undefined"?null:new TextDecoder("utf-8",{fatal:true,ignoreBOM:true});if(k&&k.decode(new Uint8Array).length===1){k=null}const _=t=>k.decode(t);const S=null&&(k?_:b);const E=(t,e,n,s="")=>t.slice(0,e)+s+t.slice(e+n);const C=t=>t===undefined?null:t;class D{constructor(){this.map=new Map}setItem(t,e){this.map.set(t,e)}getItem(t){return this.map.get(t)}}let v=new D;let A=true;try{if(typeof localStorage!=="undefined"){v=localStorage;A=false}}catch(gh){}const T=v;const x=t=>A||addEventListener("storage",t);var I=n(53110);var M=n(65606);const U=typeof M!=="undefined"&&M.release&&/node|io\.js/.test(M.release.name);const O=typeof window!=="undefined"&&typeof document!=="undefined"&&!U;const L=typeof navigator!=="undefined"?/Mac/.test(navigator.platform):false;let N;const R=[];const V=()=>{if(N===undefined){if(U){N=o.vt();const t=M.argv;let e=null;for(let n=0;n{if(t.length!==0){const[e,n]=t.split("=");N.set(`--${f(e,"-")}`,n);N.set(`-${f(e,"-")}`,n)}}))}else{N=o.vt()}}return N};const P=t=>V().has(t);const j=(t,e)=>V().get(t)||e;const B=t=>U?C(M.env[t.toUpperCase()]):C(T.getItem(t));const F=t=>V().get("--"+t)||B(t);const z=t=>P("--"+t)||B(t)!==null;const J=z("production");const $=U&&I.EK(M.env.FORCE_COLOR,["true","1","2"]);const H=!P("no-colors")&&(!U||M.stdout.isTTY||$)&&(!U||P("color")||$||B("COLORTERM")!==null||(B("TERM")||"").includes("color"));const W=t=>new Uint8Array(t);const K=(t,e,n)=>new Uint8Array(t,e,n);const q=t=>new Uint8Array(t);const Y=t=>{let e="";for(let n=0;nBuffer.from(t.buffer,t.byteOffset,t.byteLength).toString("base64");const G=t=>{const e=atob(t);const n=W(e.length);for(let s=0;s{const e=Buffer.from(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)};const Z=O?Y:X;const tt=O?G:Q;const et=t=>{const e=W(t.byteLength);e.set(t);return e};const nt=t=>{const e=encoding.createEncoder();encoding.writeAny(e,t);return encoding.toUint8Array(e)};const st=t=>decoding.readAny(decoding.createDecoder(t));const rt=1;const it=2;const ot=4;const ct=8;const lt=16;const ht=32;const at=64;const ut=128;const dt=256;const ft=512;const gt=1024;const pt=2048;const wt=4096;const mt=8192;const yt=16384;const bt=32768;const kt=65536;const _t=1<<17;const St=1<<18;const Et=1<<19;const Ct=1<<20;const Dt=1<<21;const vt=1<<22;const At=1<<23;const Tt=1<<24;const xt=1<<25;const It=1<<26;const Mt=1<<27;const Ut=1<<28;const Ot=1<<29;const Lt=1<<30;const Nt=null&&1<<31;const Rt=0;const Vt=1;const Pt=3;const jt=7;const Bt=15;const Ft=31;const zt=63;const Jt=127;const $t=255;const Ht=511;const Wt=1023;const Kt=2047;const qt=4095;const Yt=8191;const Xt=16383;const Gt=32767;const Qt=65535;const Zt=_t-1;const te=St-1;const ee=Et-1;const ne=Ct-1;const se=Dt-1;const re=vt-1;const ie=At-1;const oe=Tt-1;const ce=xt-1;const le=It-1;const he=Mt-1;const ae=Ut-1;const ue=Ot-1;const de=Lt-1;const fe=2147483647;const ge=4294967295;const pe=Number.MAX_SAFE_INTEGER;const we=Number.MIN_SAFE_INTEGER;const me=null&&1<<31;const ye=fe;const be=Number.isInteger||(t=>typeof t==="number"&&isFinite(t)&&i.RI(t)===t);const ke=Number.isNaN;const _e=Number.parseInt;class Se{constructor(){this.cpos=0;this.cbuf=new Uint8Array(100);this.bufs=[]}}const Ee=()=>new Se;const Ce=t=>{let e=t.cpos;for(let n=0;n{const e=new Uint8Array(Ce(t));let n=0;for(let s=0;s{const n=t.cbuf.length;if(n-t.cpos{const n=t.cbuf.length;if(t.cpos===n){t.bufs.push(t.cbuf);t.cbuf=new Uint8Array(n*2);t.cpos=0}t.cbuf[t.cpos++]=e};const Te=(t,e,n)=>{let s=null;for(let r=0;r{Ae(t,e&binary.BITS8);Ae(t,e>>>8&binary.BITS8)};const Ue=(t,e,n)=>{Te(t,e,n&binary.BITS8);Te(t,e+1,n>>>8&binary.BITS8)};const Oe=(t,e)=>{for(let n=0;n<4;n++){Ae(t,e&binary.BITS8);e>>>=8}};const Le=(t,e)=>{for(let n=3;n>=0;n--){Ae(t,e>>>8*n&binary.BITS8)}};const Ne=(t,e,n)=>{for(let s=0;s<4;s++){Te(t,e+s,n&binary.BITS8);n>>>=8}};const Re=(t,e)=>{while(e>Jt){Ae(t,ut|Jt&e);e=i.RI(e/128)}Ae(t,Jt&e)};const Ve=(t,e)=>{const n=i.sj(e);if(n){e=-e}Ae(t,(e>zt?ut:0)|(n?at:0)|zt&e);e=i.RI(e/64);while(e>0){Ae(t,(e>Jt?ut:0)|Jt&e);e=i.RI(e/128)}};const Pe=new Uint8Array(3e4);const je=Pe.length/3;const Be=(t,e)=>{if(e.length{const n=unescape(encodeURIComponent(e));const s=n.length;Re(t,s);for(let r=0;r$e(t,De(e));const $e=(t,e)=>{const n=t.cbuf.length;const s=t.cpos;const r=i.jk(n-s,e.length);const o=e.length-r;t.cbuf.set(e.subarray(0,r),s);t.cpos+=r;if(o>0){t.bufs.push(t.cbuf);t.cbuf=new Uint8Array(i.T9(n*2,o));t.cbuf.set(e.subarray(r));t.cpos=o}};const He=(t,e)=>{Re(t,e.byteLength);$e(t,e)};const We=(t,e)=>{ve(t,e);const n=new DataView(t.cbuf.buffer,t.cpos,e);t.cpos+=e;return n};const Ke=(t,e)=>We(t,4).setFloat32(0,e,false);const qe=(t,e)=>We(t,8).setFloat64(0,e,false);const Ye=(t,e)=>We(t,8).setBigInt64(0,e,false);const Xe=(t,e)=>We(t,8).setBigUint64(0,e,false);const Ge=new DataView(new ArrayBuffer(4));const Qe=t=>{Ge.setFloat32(0,t);return Ge.getFloat32(0)===t};const Ze=(t,e)=>{switch(typeof e){case"string":Ae(t,119);ze(t,e);break;case"number":if(be(e)&&i.tn(e)<=fe){Ae(t,125);Ve(t,e)}else if(Qe(e)){Ae(t,124);Ke(t,e)}else{Ae(t,123);qe(t,e)}break;case"bigint":Ae(t,122);Ye(t,e);break;case"object":if(e===null){Ae(t,126)}else if(e instanceof Array){Ae(t,117);Re(t,e.length);for(let n=0;n0){Re(this,this.count-1)}this.count=1;this.w(this,t);this.s=t}}}class en extends Se{constructor(t){super();this.s=t}write(t){Ve(this,t-this.s);this.s=t}}class nn extends Se{constructor(t){super();this.s=t;this.count=0}write(t){if(this.s===t&&this.count>0){this.count++}else{if(this.count>0){Re(this,this.count-1)}this.count=1;Ve(this,t-this.s);this.s=t}}}const sn=t=>{if(t.count>0){Ve(t.encoder,t.count===1?t.s:-t.s);if(t.count>1){Re(t.encoder,t.count-2)}}};class rn{constructor(){this.encoder=new Se;this.s=0;this.count=0}write(t){if(this.s===t){this.count++}else{sn(this);this.count=1;this.s=t}}toUint8Array(){sn(this);return De(this.encoder)}}class on{constructor(){this.encoder=new Se;this.s=0;this.count=0}write(t){if(this.s+this.count===t){this.count++}else{sn(this);this.count=1;this.s=t}}toUint8Array(){sn(this);return De(this.encoder)}}const cn=t=>{if(t.count>0){const e=t.diff*2+(t.count===1?0:1);Ve(t.encoder,e);if(t.count>1){Re(t.encoder,t.count-2)}}};class ln{constructor(){this.encoder=new Se;this.s=0;this.count=0;this.diff=0}write(t){if(this.diff===t-this.s){this.s=t;this.count++}else{cn(this);this.count=1;this.diff=t-this.s;this.s=t}}toUint8Array(){cn(this);return De(this.encoder)}}class hn{constructor(){this.sarr=[];this.s="";this.lensE=new rn}write(t){this.s+=t;if(this.s.length>19){this.sarr.push(this.s);this.s=""}this.lensE.write(t.length)}toUint8Array(){const t=new Se;this.sarr.push(this.s);this.s="";ze(t,this.sarr.join(""));$e(t,this.lensE.toUint8Array());return De(t)}}const an=t=>new Error(t);const un=()=>{throw an("Method unimplemented")};const dn=()=>{throw an("Unexpected case")};const fn=an("Unexpected end of array");const gn=an("Integer out of Range");class pn{constructor(t){this.arr=t;this.pos=0}}const wn=t=>new pn(t);const mn=t=>t.pos!==t.arr.length;const yn=(t,e=t.pos)=>{const n=wn(t.arr);n.pos=e;return n};const bn=(t,e)=>{const n=K(t.arr.buffer,t.pos+t.arr.byteOffset,e);t.pos+=e;return n};const kn=t=>bn(t,In(t));const _n=t=>bn(t,t.arr.length-t.pos);const Sn=t=>t.pos++;const En=t=>t.arr[t.pos++];const Cn=t=>{const e=t.arr[t.pos]+(t.arr[t.pos+1]<<8);t.pos+=2;return e};const Dn=t=>{const e=t.arr[t.pos]+(t.arr[t.pos+1]<<8)+(t.arr[t.pos+2]<<16)+(t.arr[t.pos+3]<<24)>>>0;t.pos+=4;return e};const vn=t=>{const e=t.arr[t.pos+3]+(t.arr[t.pos+2]<<8)+(t.arr[t.pos+1]<<16)+(t.arr[t.pos]<<24)>>>0;t.pos+=4;return e};const An=t=>t.arr[t.pos];const Tn=t=>t.arr[t.pos]+(t.arr[t.pos+1]<<8);const xn=t=>t.arr[t.pos]+(t.arr[t.pos+1]<<8)+(t.arr[t.pos+2]<<16)+(t.arr[t.pos+3]<<24)>>>0;const In=t=>{let e=0;let n=1;const s=t.arr.length;while(t.pospe){throw gn}}throw fn};const Mn=t=>{let e=t.arr[t.pos++];let n=e&zt;let s=64;const r=(e&at)>0?-1:1;if((e&ut)===0){return r*n}const i=t.arr.length;while(t.pospe){throw gn}}throw fn};const Un=t=>{const e=t.pos;const n=In(t);t.pos=e;return n};const On=t=>{const e=t.pos;const n=Mn(t);t.pos=e;return n};const Ln=t=>{let e=In(t);if(e===0){return""}else{let n=String.fromCodePoint(En(t));if(--e<100){while(e--){n+=String.fromCodePoint(En(t))}}else{while(e>0){const s=e<1e4?e:1e4;const r=t.arr.subarray(t.pos,t.pos+s);t.pos+=s;n+=String.fromCodePoint.apply(null,r);e-=s}}return decodeURIComponent(escape(n))}};const Nn=t=>k.decode(kn(t));const Rn=k?Nn:Ln;const Vn=t=>{const e=t.pos;const n=Rn(t);t.pos=e;return n};const Pn=(t,e)=>{const n=new DataView(t.arr.buffer,t.arr.byteOffset+t.pos,e);t.pos+=e;return n};const jn=t=>Pn(t,4).getFloat32(0,false);const Bn=t=>Pn(t,8).getFloat64(0,false);const Fn=t=>Pn(t,8).getBigInt64(0,false);const zn=t=>Pn(t,8).getBigUint64(0,false);const Jn=[t=>undefined,t=>null,Mn,jn,Bn,Fn,t=>false,t=>true,Rn,t=>{const e=In(t);const n={};for(let s=0;s{const e=In(t);const n=[];for(let s=0;sJn[127-En(t)](t);class Hn extends pn{constructor(t,e){super(t);this.reader=e;this.s=null;this.count=0}read(){if(this.count===0){this.s=this.reader(this);if(mn(this)){this.count=In(this)+1}else{this.count=-1}}this.count--;return this.s}}class Wn extends pn{constructor(t,e){super(t);this.s=e}read(){this.s+=Mn(this);return this.s}}class Kn extends pn{constructor(t,e){super(t);this.s=e;this.count=0}read(){if(this.count===0){this.s+=Mn(this);if(mn(this)){this.count=In(this)+1}else{this.count=-1}}this.count--;return this.s}}class qn extends pn{constructor(t){super(t);this.s=0;this.count=0}read(){if(this.count===0){this.s=Mn(this);const t=i.sj(this.s);this.count=1;if(t){this.s=-this.s;this.count=In(this)+2}}this.count--;return this.s}}class Yn extends pn{constructor(t){super(t);this.s=0;this.count=0}read(){if(this.count===0){this.s=Mn(this);const t=i.sj(this.s);this.count=1;if(t){this.s=-this.s;this.count=In(this)+2}}this.count--;return this.s++}}class Xn extends pn{constructor(t){super(t);this.s=0;this.count=0;this.diff=0}read(){if(this.count===0){const t=Mn(this);const e=t&1;this.diff=i.RI(t/2);this.count=1;if(e){this.count=In(this)+2}}this.s+=this.diff;this.count--;return this.s}}class Gn{constructor(t){this.decoder=new qn(t);this.str=Rn(this.decoder);this.spos=0}read(){const t=this.spos+this.decoder.read();const e=this.str.slice(this.spos,t);this.spos=t;return e}}const Qn=typeof window==="undefined"?null:typeof window.performance!=="undefined"&&window.performance||null;const Zn=typeof crypto==="undefined"?null:crypto;const ts=Zn!==null?t=>{const e=new ArrayBuffer(t);const n=new Uint8Array(e);Zn.getRandomValues(n);return e}:t=>{const e=new ArrayBuffer(t);const n=new Uint8Array(e);for(let s=0;s>>0)}return e};const es=Math.random;const ns=()=>new Uint32Array(ts(4))[0];const ss=()=>{const t=new Uint32Array(cryptoRandomBuffer(8));return(t[0]&binary.BITS21)*(binary.BITS32+1)+(t[1]>>>0)};const rs=t=>t[math.floor(es()*t.length)];const is=[1e7]+-1e3+-4e3+-8e3+-1e11;const os=()=>is.replace(/[018]/g,(t=>(t^ns()&15>>t/4).toString(16)));const cs=t=>new Promise(t);const ls=t=>new Promise(t);const hs=t=>Promise.all(t);const as=t=>Promise.reject(t);const us=t=>Promise.resolve(t);const ds=t=>Promise.resolve(t);const fs=(t,e,n=10)=>cs(((s,r)=>{const i=time.getUnixTime();const o=t>0;const c=()=>{if(e()){clearInterval(l);s()}else if(o){if(time.getUnixTime()-i>t){clearInterval(l);r(new Error("Timeout"))}}};const l=setInterval(c,n)}));const gs=t=>cs(((e,n)=>setTimeout(e,t)));const ps=t=>t instanceof Promise||t&&t.then&&t.catch&&t.finally;var ws=n(25404);const ms=Symbol;const ys=t=>typeof t==="symbol";class bs{constructor(t,e){this.left=t;this.right=e}}const ks=(t,e)=>new bs(t,e);const _s=(t,e)=>new bs(e,t);const Ss=(t,e)=>t.forEach((t=>e(t.left,t.right)));const Es=(t,e)=>t.map((t=>e(t.left,t.right)));const Cs=typeof document!=="undefined"?document:{};const Ds=t=>Cs.createElement(t);const vs=()=>Cs.createDocumentFragment();const As=t=>Cs.createTextNode(t);const Ts=typeof DOMParser!=="undefined"?new DOMParser:null;const xs=(t,e,n)=>t.dispatchEvent(new CustomEvent(e,n));const Is=(t,e)=>{pair.forEach(e,((e,n)=>{if(n===false){t.removeAttribute(e)}else if(n===true){t.setAttribute(e,"")}else{t.setAttribute(e,n)}}));return t};const Ms=(t,e)=>{e.forEach(((e,n)=>{t.setAttribute(n,e)}));return t};const Us=t=>{const e=vs();for(let n=0;n{Zs(t,Us(e));return t};const Ls=t=>t.remove();const Ns=(t,e,n)=>t.addEventListener(e,n);const Rs=(t,e,n)=>t.removeEventListener(e,n);const Vs=(t,e)=>{pair.forEach(e,((e,n)=>Ns(t,e,n)));return t};const Ps=(t,e)=>{pair.forEach(e,((e,n)=>Rs(t,e,n)));return t};const js=(t,e=[],n=[])=>Os(Is(Ds(t),e),n);const Bs=(t,e)=>{const n=Ds("canvas");n.height=e;n.width=t;return n};const Fs=null&&As;const zs=t=>`${t.left}:${t.right};`;const Js=t=>t.map(zs).join("");const $s=t=>o.Tj(t,((t,e)=>`${e}:${t};`)).join("");const Hs=(t,e)=>t.querySelector(e);const Ws=(t,e)=>t.querySelectorAll(e);const Ks=t=>Cs.getElementById(t);const qs=t=>Ts.parseFromString(`${t}`,"text/html").body;const Ys=t=>Us(qs(t).childNodes);const Xs=t=>qs(t).firstElementChild;const Gs=(t,e)=>t.replaceWith(e);const Qs=(t,e,n)=>t.insertBefore(e,n);const Zs=(t,e)=>t.appendChild(e);const tr=Cs.ELEMENT_NODE;const er=Cs.TEXT_NODE;const nr=Cs.CDATA_SECTION_NODE;const sr=Cs.COMMENT_NODE;const rr=Cs.DOCUMENT_NODE;const ir=Cs.DOCUMENT_TYPE_NODE;const or=Cs.DOCUMENT_FRAGMENT_NODE;const cr=(t,e)=>t.nodeType===e;const lr=(t,e)=>{let n=e.parentNode;while(n&&n!==t){n=n.parentNode}return n===t};var hr=n(64191);const ar=ms();const ur=ms();const dr=ms();const fr=ms();const gr=ms();const pr=ms();const wr=ms();const mr=ms();const yr=ms();const br={[ar]:ks("font-weight","bold"),[ur]:ks("font-weight","normal"),[dr]:ks("color","blue"),[gr]:ks("color","green"),[fr]:ks("color","grey"),[pr]:ks("color","red"),[wr]:ks("color","purple"),[mr]:ks("color","orange"),[yr]:ks("color","black")};const kr={[ar]:"",[ur]:"",[dr]:"",[gr]:"",[fr]:"",[pr]:"",[wr]:"",[mr]:"",[yr]:""};const _r=t=>{const e=[];const n=[];const s=o.vt();let r=[];let i=0;for(;i0||t.length>0){e.push("%c"+r);n.push(t)}else{e.push(r)}}else{break}}}if(i>0){r=n;r.unshift(e.join(""))}for(;i{const e=[];const n=[];let s=0;for(;s0){n.push(e.join(""))}for(;s{const e=[];const n=[];let s=0;for(;s0){e.push("");n.push(e.join(""))}for(;s{console.log(...Cr(t));Nr.forEach((e=>e.print(t)))};const vr=(...t)=>{console.warn(...Cr(t));t.unshift(mr);Nr.forEach((e=>e.print(t)))};const Ar=t=>{console.error(t);Nr.forEach((e=>e.printError(t)))};const Tr=(t,e)=>{if(env.isBrowser){console.log("%c ",`font-size: ${e}px; background-size: contain; background-repeat: no-repeat; background-image: url(${t})`)}Nr.forEach((n=>n.printImg(t,e)))};const xr=(t,e)=>Tr(`data:image/gif;base64,${t}`,e);const Ir=(...t)=>{console.group(...Cr(t));Nr.forEach((e=>e.group(t)))};const Mr=(...t)=>{console.groupCollapsed(...Cr(t));Nr.forEach((e=>e.groupCollapsed(t)))};const Ur=()=>{console.groupEnd();Nr.forEach((t=>t.groupEnd()))};const Or=t=>Nr.forEach((e=>e.printDom(t())));const Lr=(t,e)=>Tr(t.toDataURL(),e);const Nr=ws.vt();const Rr=t=>{const e=[];const n=new Map;let s=0;for(;s{const n=dom.element("span",[pair.create("hidden",e),pair.create("style","color:grey;font-size:120%;")],[dom.text("▼")]);const s=dom.element("span",[pair.create("hidden",!e),pair.create("style","color:grey;font-size:125%;")],[dom.text("▶")]);const r=dom.element("div",[pair.create("style",`${Vr};padding-left:${this.depth*10}px`)],[n,s,dom.text(" ")].concat(Rr(t)));const i=dom.element("div",[pair.create("hidden",e)]);const o=dom.element("div",[],[r,i]);dom.append(this.ccontainer,[o]);this.ccontainer=i;this.depth++;dom.addEventListener(r,"click",(t=>{i.toggleAttribute("hidden");n.toggleAttribute("hidden");s.toggleAttribute("hidden")}))}))}groupCollapsed(t){this.group(t,true)}groupEnd(){eventloop.enqueue((()=>{if(this.depth>0){this.depth--;this.ccontainer=this.ccontainer.parentElement.parentElement}}))}print(t){eventloop.enqueue((()=>{dom.append(this.ccontainer,[dom.element("div",[pair.create("style",`${Vr};padding-left:${this.depth*10}px`)],Rr(t))])}))}printError(t){this.print([pr,ar,t.toString()])}printImg(t,e){eventloop.enqueue((()=>{dom.append(this.ccontainer,[dom.element("img",[pair.create("src",t),pair.create("height",`${math.round(e*1.5)}px`)])])}))}printDom(t){eventloop.enqueue((()=>{dom.append(this.ccontainer,[t])}))}destroy(){eventloop.enqueue((()=>{Nr.delete(this)}))}}const jr=t=>new Pr(t);const Br=[gr,wr,mr,dr];let Fr=0;let zr=hr._g();const Jr=t=>{const e=Br[Fr];const n=env.getVariable("log");const s=n!==null&&(n==="*"||n==="true"||new RegExp(n,"gi").test(t));Fr=(Fr+1)%Br.length;t+=": ";return!s?func.nop:(...n)=>{const s=time.getUnixTime();const r=s-zr;zr=s;Dr(e,t,yr,...n.map((t=>typeof t==="string"||typeof t==="symbol"?t:JSON.stringify(t))),e," +"+r+"ms")}};const $r=(t,e)=>({[Symbol.iterator](){return this},next(){const n=t.next();return{value:n.done?undefined:e(n.value),done:n.done}}});const Hr=t=>({[Symbol.iterator](){return this},next:t});const Wr=(t,e)=>Hr((()=>{let n;do{n=t.next()}while(!n.done&&!e(n.value));return n}));const Kr=(t,e)=>Hr((()=>{const{done:n,value:s}=t.next();return{done:n,value:n?undefined:e(s)}}));var qr=n(70641);class Yr extends s.c{constructor(t,e){super();this.doc=t;this.awareness=e}}class Xr{constructor(t,e){this.clock=t;this.len=e}}class Gr{constructor(){this.clients=new Map}}const Qr=(t,e,n)=>e.clients.forEach(((e,s)=>{const r=t.doc.store.clients.get(s);for(let i=0;i{let n=0;let s=t.length-1;while(n<=s){const r=i.RI((n+s)/2);const o=t[r];const c=o.clock;if(c<=e){if(e{const n=t.clients.get(e.client);return n!==undefined&&Zr(n,e.clock)!==null};const ei=t=>{t.clients.forEach((t=>{t.sort(((t,e)=>t.clock-e.clock));let e,n;for(e=1,n=1;e=r.clock){s.len=i.T9(s.len,r.clock+r.len-s.clock)}else{if(n{const e=new Gr;for(let n=0;n{if(!e.clients.has(i)){const o=s.slice();for(let e=n+1;e{o._4(t.clients,e,(()=>[])).push(new Xr(n,s))};const ri=()=>new Gr;const ii=t=>{const e=ri();t.clients.forEach(((t,n)=>{const s=[];for(let e=0;e0){e.clients.set(n,s)}}));return e};const oi=(t,e)=>{Re(t.restEncoder,e.clients.size);r.HT(e.clients.entries()).sort(((t,e)=>e[0]-t[0])).forEach((([e,n])=>{t.resetDsCurVal();Re(t.restEncoder,e);const s=n.length;Re(t.restEncoder,s);for(let r=0;r{const e=new Gr;const n=In(t.restDecoder);for(let s=0;s0){const r=o._4(e.clients,n,(()=>[]));for(let e=0;e{const s=new Gr;const r=In(t.restDecoder);for(let i=0;i0){const t=new yi;Re(t.restEncoder,0);oi(t,s);return t.toUint8Array()}return null};const hi=ns;class ai extends s.c{constructor({guid:t=os(),collectionid:e=null,gc:n=true,gcFilter:s=()=>true,meta:r=null,autoLoad:i=false,shouldLoad:o=true}={}){super();this.gc=n;this.gcFilter=s;this.clientID=hi();this.guid=t;this.collectionid=e;this.share=new Map;this.store=new Eo;this._transaction=null;this._transactionCleanups=[];this.subdocs=new Set;this._item=null;this.shouldLoad=o;this.autoLoad=i;this.meta=r;this.isLoaded=false;this.isSynced=false;this.whenLoaded=cs((t=>{this.on("load",(()=>{this.isLoaded=true;t(this)}))}));const c=()=>cs((t=>{const e=n=>{if(n===undefined||n===true){this.off("sync",e);t()}};this.on("sync",e)}));this.on("sync",(t=>{if(t===false&&this.isSynced){this.whenSynced=c()}this.isSynced=t===undefined||t===true;if(!this.isLoaded){this.emit("load",[])}}));this.whenSynced=c()}load(){const t=this._item;if(t!==null&&!this.shouldLoad){Jo(t.parent.doc,(t=>{t.subdocsLoaded.add(this)}),null,true)}this.shouldLoad=true}getSubdocs(){return this.subdocs}getSubdocGuids(){return new Set(r.HT(this.subdocs).map((t=>t.guid)))}transact(t,e=null){Jo(this,t,e)}get(t,e=Tc){const n=o._4(this.share,t,(()=>{const t=new e;t._integrate(this,null);return t}));const s=n.constructor;if(e!==Tc&&s!==e){if(s===Tc){const s=new e;s._map=n._map;n._map.forEach((t=>{for(;t!==null;t=t.left){t.parent=s}}));s._start=n._start;for(let t=s._start;t!==null;t=t.right){t.parent=s}s._length=n._length;this.share.set(t,s);s._integrate(this,null);return s}else{throw new Error(`Type with the name ${t} has already been defined with a different constructor`)}}return n}getArray(t=""){return this.get(t,Yc)}getText(t=""){return this.get(t,pl)}getMap(t=""){return this.get(t,Qc)}getXmlFragment(t=""){return this.get(t,yl)}toJSON(){const t={};this.share.forEach(((e,n)=>{t[n]=e.toJSON()}));return t}destroy(){r.HT(this.subdocs).forEach((t=>t.destroy()));const t=this._item;if(t!==null){this._item=null;const e=t.content;e.doc=new ai({guid:this.guid,...e.opts,shouldLoad:false});e.doc._item=t;Jo(t.parent.doc,(n=>{const s=e.doc;if(!t.deleted){n.subdocsAdded.add(s)}n.subdocsRemoved.add(this)}),null,true)}this.emit("destroyed",[true]);this.emit("destroy",[this]);super.destroy()}on(t,e){super.on(t,e)}off(t,e){super.off(t,e)}}class ui{constructor(t){this.restDecoder=t}resetDsCurVal(){}readDsClock(){return In(this.restDecoder)}readDsLen(){return In(this.restDecoder)}}class di extends ui{readLeftID(){return $i(In(this.restDecoder),In(this.restDecoder))}readRightID(){return $i(In(this.restDecoder),In(this.restDecoder))}readClient(){return In(this.restDecoder)}readInfo(){return En(this.restDecoder)}readString(){return Rn(this.restDecoder)}readParentInfo(){return In(this.restDecoder)===1}readTypeRef(){return In(this.restDecoder)}readLen(){return In(this.restDecoder)}readAny(){return $n(this.restDecoder)}readBuf(){return et(kn(this.restDecoder))}readJSON(){return JSON.parse(Rn(this.restDecoder))}readKey(){return Rn(this.restDecoder)}}class fi{constructor(t){this.dsCurrVal=0;this.restDecoder=t}resetDsCurVal(){this.dsCurrVal=0}readDsClock(){this.dsCurrVal+=In(this.restDecoder);return this.dsCurrVal}readDsLen(){const t=In(this.restDecoder)+1;this.dsCurrVal+=t;return t}}class gi extends fi{constructor(t){super(t);this.keys=[];In(t);this.keyClockDecoder=new Xn(kn(t));this.clientDecoder=new qn(kn(t));this.leftClockDecoder=new Xn(kn(t));this.rightClockDecoder=new Xn(kn(t));this.infoDecoder=new Hn(kn(t),En);this.stringDecoder=new Gn(kn(t));this.parentInfoDecoder=new Hn(kn(t),En);this.typeRefDecoder=new qn(kn(t));this.lenDecoder=new qn(kn(t))}readLeftID(){return new zi(this.clientDecoder.read(),this.leftClockDecoder.read())}readRightID(){return new zi(this.clientDecoder.read(),this.rightClockDecoder.read())}readClient(){return this.clientDecoder.read()}readInfo(){return this.infoDecoder.read()}readString(){return this.stringDecoder.read()}readParentInfo(){return this.parentInfoDecoder.read()===1}readTypeRef(){return this.typeRefDecoder.read()}readLen(){return this.lenDecoder.read()}readAny(){return $n(this.restDecoder)}readBuf(){return kn(this.restDecoder)}readJSON(){return $n(this.restDecoder)}readKey(){const t=this.keyClockDecoder.read();if(t{s=i.T9(s,e[0].id.clock);const r=Ao(e,s);Re(t.restEncoder,e.length-r);t.writeClient(n);Re(t.restEncoder,s);const o=e[r];o.write(t,s-o.id.clock);for(let i=r+1;i{const s=new Map;n.forEach(((t,n)=>{if(Do(e,n)>t){s.set(n,t)}}));Co(e).forEach(((t,e)=>{if(!n.has(e)){s.set(e,0)}}));Re(t.restEncoder,s.size);r.HT(s.entries()).sort(((t,e)=>e[0]-t[0])).forEach((([n,s])=>{bi(t,e.clients.get(n),n,s)}))};const _i=(t,e)=>{const n=o.vt();const s=In(t.restDecoder);for(let r=0;r{const s=[];let i=r.HT(n.keys()).sort(((t,e)=>t-e));if(i.length===0){return null}const c=()=>{if(i.length===0){return null}let t=n.get(i[i.length-1]);while(t.refs.length===t.i){i.pop();if(i.length>0){t=n.get(i[i.length-1])}else{return null}}return t};let l=c();if(l===null&&s.length===0){return null}const h=new Eo;const a=new Map;const u=(t,e)=>{const n=a.get(t);if(n==null||n>e){a.set(t,e)}};let d=l.refs[l.i++];const f=new Map;const g=()=>{for(const t of s){const e=t.id.client;const s=n.get(e);if(s){s.i--;h.clients.set(e,s.refs.slice(s.i));n.delete(e);s.i=0;s.refs=[]}else{h.clients.set(e,[t])}i=i.filter((t=>t!==e))}s.length=0};while(true){if(d.constructor!==uh){const r=o._4(f,d.id.client,(()=>Do(e,d.id.client)));const i=r-d.id.clock;if(i<0){s.push(d);u(d.id.client,d.id.clock-1);g()}else{const r=d.getMissing(t,e);if(r!==null){s.push(d);const t=n.get(r)||{refs:[],i:0};if(t.refs.length===t.i){u(r,Do(e,r));g()}else{d=t.refs[t.i++];continue}}else if(i===0||i0){d=s.pop()}else if(l!==null&&l.i0){const t=new yi;ki(t,h,new Map);Re(t.restEncoder,0);return{missing:a,update:t.toUint8Array()}}return null};const Ei=(t,e)=>ki(t,e.doc.store,e.beforeState);const Ci=(t,e,n,s=new gi(t))=>Jo(e,(t=>{t.local=false;let e=false;const n=t.doc;const r=n.store;const i=_i(s,n);const o=Si(t,r,i);const c=r.pendingStructs;if(c){for(const[t,n]of c.missing){if(ne){c.missing.set(t,e)}}c.update=cc([c.update,o.update])}}else{r.pendingStructs=o}const l=li(s,t,r);if(r.pendingDs){const e=new gi(wn(r.pendingDs));In(e.restDecoder);const n=li(e,t,r);if(l&&n){r.pendingDs=cc([l,n])}else{r.pendingDs=l||n}}else{r.pendingDs=l}if(e){const e=r.pendingStructs.update;r.pendingStructs=null;vi(t.doc,e)}}),n,false);const Di=(t,e,n)=>Ci(t,e,n,new di(t));const vi=(t,e,n,s=gi)=>{const r=wn(e);Ci(r,t,n,new s(r))};const Ai=(t,e,n)=>vi(t,e,n,di);const Ti=(t,e,n=new Map)=>{ki(t,e.store,n);oi(t,ii(e.store))};const xi=(t,e=new Uint8Array([0]),n=new yi)=>{const s=Ui(e);Ti(n,t,s);const r=[n.toUint8Array()];if(t.store.pendingDs){r.push(t.store.pendingDs)}if(t.store.pendingStructs){r.push(lc(t.store.pendingStructs.update,e))}if(r.length>1){if(n.constructor===wi){return ec(r.map(((t,e)=>e===0?t:pc(t))))}else if(n.constructor===yi){return cc(r)}}return r[0]};const Ii=(t,e)=>xi(t,e,new wi);const Mi=t=>{const e=new Map;const n=In(t.restDecoder);for(let s=0;sMi(new ui(wn(t)));const Oi=(t,e)=>{Re(t.restEncoder,e.size);r.HT(e.entries()).sort(((t,e)=>e[0]-t[0])).forEach((([e,n])=>{Re(t.restEncoder,e);Re(t.restEncoder,n)}));return t};const Li=(t,e)=>Oi(t,Co(e.store));const Ni=(t,e=new mi)=>{if(t instanceof Map){Oi(e,t)}else{Li(e,t)}return e.toUint8Array()};const Ri=t=>Ni(t,new pi);class Vi{constructor(){this.l=[]}}const Pi=()=>new Vi;const ji=(t,e)=>t.l.push(e);const Bi=(t,e)=>{const n=t.l;const s=n.length;t.l=n.filter((t=>e!==t));if(s===t.l.length){console.error("[yjs] Tried to remove event handler that doesn't exist.")}};const Fi=(t,e,n)=>I.OK(t.l,[e,n]);class zi{constructor(t,e){this.client=t;this.clock=e}}const Ji=(t,e)=>t===e||t!==null&&e!==null&&t.client===e.client&&t.clock===e.clock;const $i=(t,e)=>new zi(t,e);const Hi=(t,e)=>{Re(t,e.client);Re(t,e.clock)};const Wi=t=>$i(In(t),In(t));const Ki=t=>{for(const[e,n]of t.doc.share.entries()){if(n===t){return e}}throw dn()};const qi=(t,e)=>{while(e!==null){if(e.parent===t){return true}e=e.parent._item}return false};const Yi=t=>{const e=[];let n=t._start;while(n){e.push(n);n=n.right}console.log("Children: ",e);console.log("Children content: ",e.filter((t=>!t.deleted)).map((t=>t.content)))};class Xi{constructor(t,e=t.getMap("users")){const n=new Map;this.yusers=e;this.doc=t;this.clients=new Map;this.dss=n;const s=(t,e)=>{const n=t.get("ds");const s=t.get("ids");const r=t=>this.clients.set(t,e);n.observe((t=>{t.changes.added.forEach((t=>{t.content.getContent().forEach((t=>{if(t instanceof Uint8Array){this.dss.set(e,ni([this.dss.get(e)||ri(),ci(new ui(wn(t)))]))}}))}))}));this.dss.set(e,ni(n.map((t=>ci(new ui(wn(t)))))));s.observe((t=>t.changes.added.forEach((t=>t.content.getContent().forEach(r)))));s.forEach(r)};e.observe((t=>{t.keysChanged.forEach((t=>s(e.get(t),t)))}));e.forEach(s)}setUserMapping(t,e,n,{filter:s=()=>true}={}){const r=this.yusers;let i=r.get(n);if(!i){i=new Qc;i.set("ids",new Yc);i.set("ds",new Yc);r.set(n,i)}i.get("ids").push([e]);r.observe((t=>{setTimeout((()=>{const t=r.get(n);if(t!==i){i=t;this.clients.forEach(((t,e)=>{if(n===t){i.get("ids").push([e])}}));const e=new pi;const s=this.dss.get(n);if(s){oi(e,s);i.get("ds").push([e.toUint8Array()])}}}),0)}));t.on("afterTransaction",(t=>{setTimeout((()=>{const e=i.get("ds");const n=t.deleteSet;if(t.local&&n.clients.size>0&&s(t,n)){const t=new pi;oi(t,n);e.push([t.toUint8Array()])}}))}))}getUserByClientId(t){return this.clients.get(t)||null}getUserByDeletedId(t){for(const[e,n]of this.dss.entries()){if(ti(n,t)){return e}}return null}}class Gi{constructor(t,e,n,s=0){this.type=t;this.tname=e;this.item=n;this.assoc=s}}const Qi=t=>{const e={};if(t.type){e.type=t.type}if(t.tname){e.tname=t.tname}if(t.item){e.item=t.item}if(t.assoc!=null){e.assoc=t.assoc}return e};const Zi=t=>new Gi(t.type==null?null:$i(t.type.client,t.type.clock),t.tname||null,t.item==null?null:$i(t.item.client,t.item.clock),t.assoc==null?0:t.assoc);class to{constructor(t,e,n=0){this.type=t;this.index=e;this.assoc=n}}const eo=(t,e,n=0)=>new to(t,e,n);const no=(t,e,n)=>{let s=null;let r=null;if(t._item===null){r=Ki(t)}else{s=$i(t._item.id.client,t._item.id.clock)}return new Gi(s,r,e,n)};const so=(t,e,n=0)=>{let s=t._start;if(n<0){if(e===0){return no(t,null,n)}e--}while(s!==null){if(!s.deleted&&s.countable){if(s.length>e){return no(t,$i(s.id.client,s.id.clock+e),n)}e-=s.length}if(s.right===null&&n<0){return no(t,s.lastId,n)}s=s.right}return no(t,null,n)};const ro=(t,e)=>{const{type:n,tname:s,item:r,assoc:i}=e;if(r!==null){Re(t,0);Hi(t,r)}else if(s!==null){xe(t,1);ze(t,s)}else if(n!==null){xe(t,2);Hi(t,n)}else{throw dn()}Ve(t,i);return t};const io=t=>{const e=Ee();ro(e,t);return De(e)};const oo=t=>{let e=null;let n=null;let s=null;switch(In(t)){case 0:s=Wi(t);break;case 1:n=Rn(t);break;case 2:{e=Wi(t)}}const r=mn(t)?Mn(t):0;return new Gi(e,n,s,r)};const co=t=>oo(wn(t));const lo=(t,e)=>{const n=e.store;const s=t.item;const r=t.type;const i=t.tname;const o=t.assoc;let c=null;let l=0;if(s!==null){if(Do(n,s.client)<=s.clock){return null}const t=sh(n,s);const e=t.item;if(!(e instanceof ch)){return null}c=e.parent;if(c._item===null||!c._item.deleted){l=e.deleted||!e.countable?0:t.diff+(o>=0?0:1);let n=e.left;while(n!==null){if(!n.deleted&&n.countable){l+=n.length}n=n.left}}}else{if(i!==null){c=e.get(i)}else if(r!==null){if(Do(n,r.client)<=r.clock){return null}const{item:t}=sh(n,r);if(t instanceof ch&&t.content instanceof eh){c=t.content.type}else{return null}}else{throw dn()}if(o>=0){l=c._length}else{l=0}}return eo(c,l,t.assoc)};const ho=(t,e)=>t===e||t!==null&&e!==null&&t.tname===e.tname&&Ji(t.item,e.item)&&Ji(t.type,e.type)&&t.assoc===e.assoc;class ao{constructor(t,e){this.ds=t;this.sv=e}}const uo=(t,e)=>{const n=t.ds.clients;const s=e.ds.clients;const r=t.sv;const i=e.sv;if(r.size!==i.size||n.size!==s.size){return false}for(const[o,c]of r.entries()){if(i.get(o)!==c){return false}}for(const[o,c]of n.entries()){const t=s.get(o)||[];if(c.length!==t.length){return false}for(let e=0;e{oi(e,t.ds);Oi(e,t.sv);return e.toUint8Array()};const go=t=>fo(t,new pi);const po=(t,e=new fi(wn(t)))=>new ao(ci(e),Mi(e));const wo=t=>po(t,new ui(wn(t)));const mo=(t,e)=>new ao(t,e);const yo=mo(ri(),new Map);const bo=t=>mo(ii(t.store),Co(t.store));const ko=(t,e)=>e===undefined?!t.deleted:e.sv.has(t.id.client)&&(e.sv.get(t.id.client)||0)>t.id.clock&&!ti(e.ds,t.id);const _o=(t,e)=>{const n=o._4(t.meta,_o,ws.vt);const s=t.doc.store;if(!n.has(e)){e.sv.forEach(((e,n)=>{if(e{}));n.add(e)}};const So=(t,e,n=new ai)=>{if(t.gc){throw new Error("originDoc must not be garbage collected")}const{sv:s,ds:r}=e;const i=new yi;t.transact((e=>{let n=0;s.forEach((t=>{if(t>0){n++}}));Re(i.restEncoder,n);for(const[r,o]of s){if(o===0){continue}if(o{const e=new Map;t.clients.forEach(((t,n)=>{const s=t[t.length-1];e.set(n,s.id.clock+s.length)}));return e};const Do=(t,e)=>{const n=t.clients.get(e);if(n===undefined){return 0}const s=n[n.length-1];return s.id.clock+s.length};const vo=(t,e)=>{let n=t.clients.get(e.id.client);if(n===undefined){n=[];t.clients.set(e.id.client,n)}else{const t=n[n.length-1];if(t.id.clock+t.length!==e.id.clock){throw dn()}}n.push(e)};const Ao=(t,e)=>{let n=0;let s=t.length-1;let r=t[s];let o=r.id.clock;if(o===e){return s}let c=i.RI(e/(o+r.length-1)*s);while(n<=s){r=t[c];o=r.id.clock;if(o<=e){if(e{const n=t.clients.get(e.client);return n[Ao(n,e.clock)]};const xo=To;const Io=(t,e,n)=>{const s=Ao(e,n);const r=e[s];if(r.id.clock{const n=t.doc.store.clients.get(e.client);return n[Io(t,n,e.clock)]};const Uo=(t,e,n)=>{const s=e.clients.get(n.client);const r=Ao(s,n.clock);const i=s[r];if(n.clock!==i.id.clock+i.length-1&&i.constructor!==xl){s.splice(r+1,0,ih(t,i,n.clock-i.id.clock+1))}return i};const Oo=(t,e,n)=>{const s=t.clients.get(e.id.client);s[Ao(s,e.id.clock)]=n};const Lo=(t,e,n,s,r)=>{if(s===0){return}const i=n+s;let o=Io(t,e,n);let c;do{c=e[o++];if(i{if(e.deleteSet.clients.size===0&&!o.bz(e.afterState,((t,n)=>e.beforeState.get(n)!==t))){return false}ei(e.deleteSet);Ei(t,e);oi(t,e.deleteSet);return true};const Vo=(t,e,n)=>{const s=e._item;if(s===null||s.id.clock<(t.beforeState.get(s.id.client)||0)&&!s.deleted){o._4(t.changed,e,ws.vt).add(n)}};const Po=(t,e)=>{const n=t[e-1];const s=t[e];if(n.deleted===s.deleted&&n.constructor===s.constructor){if(n.mergeWith(s)){t.splice(e,1);if(s instanceof ch&&s.parentSub!==null&&s.parent._map.get(s.parentSub)===s){s.parent._map.set(s.parentSub,n)}}}};const jo=(t,e,n)=>{for(const[s,r]of t.clients.entries()){const t=e.clients.get(s);for(let s=r.length-1;s>=0;s--){const i=r[s];const o=i.clock+i.len;for(let s=Ao(t,i.clock),r=t[s];s{t.clients.forEach(((t,n)=>{const s=e.clients.get(n);for(let e=t.length-1;e>=0;e--){const n=t[e];const r=i.jk(s.length-1,1+Ao(s,n.clock+n.len-1));for(let t=r,e=s[t];t>0&&e.id.clock>=n.clock;e=s[--t]){Po(s,t)}}}))};const Fo=(t,e,n)=>{jo(t,e,n);Bo(t,e)};const zo=(t,e)=>{if(et.push((()=>{if(s._item===null||!s._item.deleted){s._callObserver(n,e)}}))));t.push((()=>{n.changedParentTypes.forEach(((e,s)=>t.push((()=>{if(s._item===null||!s._item.deleted){e=e.filter((t=>t.target._item===null||!t.target._item.deleted));e.forEach((t=>{t.currentTarget=s}));e.sort(((t,e)=>t.path.length-e.path.length));Fi(s._dEH,e,n)}}))));t.push((()=>s.emit("afterTransaction",[n,s])))}));(0,I.OK)(t,[])}finally{if(s.gc){jo(o,r,s.gcFilter)}Bo(o,r);n.afterState.forEach(((t,e)=>{const s=n.beforeState.get(e)||0;if(s!==t){const t=r.clients.get(e);const n=i.T9(Ao(t,s),1);for(let e=t.length-1;e>=n;e--){Po(t,e)}}}));for(let t=0;t0){Po(s,i)}}if(!n.local&&n.afterState.get(s.clientID)!==n.beforeState.get(s.clientID)){Dr(mr,ar,"[yjs] ",ur,pr,"Changed the client-id because another client seems to be using it.");s.clientID=hi()}s.emit("afterTransactionCleanup",[n,s]);if(s._observers.has("update")){const t=new wi;const e=Ro(t,n);if(e){s.emit("update",[t.toUint8Array(),n.origin,s,n])}}if(s._observers.has("updateV2")){const t=new yi;const e=Ro(t,n);if(e){s.emit("updateV2",[t.toUint8Array(),n.origin,s,n])}}const{subdocsAdded:l,subdocsLoaded:h,subdocsRemoved:a}=n;if(l.size>0||a.size>0||h.size>0){l.forEach((t=>{t.clientID=s.clientID;if(t.collectionid==null){t.collectionid=s.collectionid}s.subdocs.add(t)}));a.forEach((t=>s.subdocs.delete(t)));s.emit("subdocs",[{loaded:h,added:l,removed:a},s,n]);a.forEach((t=>t.destroy()))}if(t.length<=e+1){s._transactionCleanups=[];s.emit("afterAllTransactions",[s,t])}else{zo(t,e+1)}}}};const Jo=(t,e,n=null,s=true)=>{const r=t._transactionCleanups;let i=false;let o=null;if(t._transaction===null){i=true;t._transaction=new No(t,n,s);r.push(t._transaction);if(r.length===1){t.emit("beforeAllTransactions",[t])}t.emit("beforeTransaction",[t._transaction,t])}try{o=e(t._transaction)}finally{if(i){const e=t._transaction===r[0];t._transaction=null;if(e){zo(r,0)}}}return o};class $o{constructor(t,e){this.insertions=e;this.deletions=t;this.meta=new Map}}const Ho=(t,e,n)=>{Qr(t,n.deletions,(t=>{if(t instanceof ch&&e.scope.some((e=>qi(e,t)))){rh(t,false)}}))};const Wo=(t,e,n)=>{let s=null;let r=null;const i=t.doc;const o=t.scope;Jo(i,(n=>{while(e.length>0&&s===null){const r=i.store;const c=e.pop();const l=new Set;const h=[];let a=false;Qr(n,c.insertions,(t=>{if(t instanceof ch){if(t.redone!==null){let{item:e,diff:s}=sh(r,t.id);if(s>0){e=Mo(n,$i(e.id.client,e.id.clock+s))}t=e}if(!t.deleted&&o.some((e=>qi(e,t)))){h.push(t)}}}));Qr(n,c.deletions,(t=>{if(t instanceof ch&&o.some((e=>qi(e,t)))&&!ti(c.insertions,t.id)){l.add(t)}}));l.forEach((e=>{a=oh(n,e,l,c.insertions,t.ignoreRemoteMapChanges)!==null||a}));for(let e=h.length-1;e>=0;e--){const s=h[e];if(t.deleteFilter(s)){s.delete(n);a=true}}s=a?c:null}n.changed.forEach(((t,e)=>{if(t.has(null)&&e._searchMarker){e._searchMarker.length=0}}));r=n}),t);if(s!=null){const e=r.changedParentTypes;t.emit("stack-item-popped",[{stackItem:s,type:n,changedParentTypes:e},t])}return s};class Ko extends s.c{constructor(t,{captureTimeout:e=500,captureTransaction:n=t=>true,deleteFilter:s=()=>true,trackedOrigins:i=new Set([null]),ignoreRemoteMapChanges:o=false,doc:c=(r.cy(t)?t[0].doc:t.doc)}={}){super();this.scope=[];this.addToScope(t);this.deleteFilter=s;i.add(this);this.trackedOrigins=i;this.captureTransaction=n;this.undoStack=[];this.redoStack=[];this.undoing=false;this.redoing=false;this.doc=c;this.lastChange=0;this.ignoreRemoteMapChanges=o;this.captureTimeout=e;this.afterTransactionHandler=t=>{if(!this.captureTransaction(t)||!this.scope.some((e=>t.changedParentTypes.has(e)))||!this.trackedOrigins.has(t.origin)&&(!t.origin||!this.trackedOrigins.has(t.origin.constructor))){return}const e=this.undoing;const n=this.redoing;const s=e?this.redoStack:this.undoStack;if(e){this.stopCapturing()}else if(!n){this.clear(false,true)}const r=new Gr;t.afterState.forEach(((e,n)=>{const s=t.beforeState.get(n)||0;const i=e-s;if(i>0){si(r,n,s,i)}}));const i=hr._g();let o=false;if(this.lastChange>0&&i-this.lastChange0&&!e&&!n){const e=s[s.length-1];e.deletions=ni([e.deletions,t.deleteSet]);e.insertions=ni([e.insertions,r])}else{s.push(new $o(t.deleteSet,r));o=true}if(!e&&!n){this.lastChange=i}Qr(t,t.deleteSet,(t=>{if(t instanceof ch&&this.scope.some((e=>qi(e,t)))){rh(t,true)}}));const c=[{stackItem:s[s.length-1],origin:t.origin,type:e?"redo":"undo",changedParentTypes:t.changedParentTypes},this];if(o){this.emit("stack-item-added",c)}else{this.emit("stack-item-updated",c)}};this.doc.on("afterTransaction",this.afterTransactionHandler);this.doc.on("destroy",(()=>{this.destroy()}))}addToScope(t){t=r.cy(t)?t:[t];t.forEach((t=>{if(this.scope.every((e=>e!==t))){this.scope.push(t)}}))}addTrackedOrigin(t){this.trackedOrigins.add(t)}removeTrackedOrigin(t){this.trackedOrigins.delete(t)}clear(t=true,e=true){if(t&&this.canUndo()||e&&this.canRedo()){this.doc.transact((n=>{if(t){this.undoStack.forEach((t=>Ho(n,this,t)));this.undoStack=[]}if(e){this.redoStack.forEach((t=>Ho(n,this,t)));this.redoStack=[]}this.emit("stack-cleared",[{undoStackCleared:t,redoStackCleared:e}])}))}}stopCapturing(){this.lastChange=0}undo(){this.undoing=true;let t;try{t=Wo(this,this.undoStack,"undo")}finally{this.undoing=false}return t}redo(){this.redoing=true;let t;try{t=Wo(this,this.redoStack,"redo")}finally{this.redoing=false}return t}canUndo(){return this.undoStack.length>0}canRedo(){return this.redoStack.length>0}destroy(){this.trackedOrigins.delete(this);this.doc.off("afterTransaction",this.afterTransactionHandler);super.destroy()}}function*qo(t){const e=In(t.restDecoder);for(let n=0;nGo(t,di);const Go=(t,e=gi)=>{const n=[];const s=new e(wn(t));const r=new Yo(s,false);for(let o=r.curr;o!==null;o=r.next()){n.push(o)}Dr("Structs: ",n);const i=ci(s);Dr("DeleteSet: ",i)};const Qo=t=>Zo(t,di);const Zo=(t,e=gi)=>{const n=[];const s=new e(wn(t));const r=new Yo(s,false);for(let i=r.curr;i!==null;i=r.next()){n.push(i)}return{structs:n,ds:ci(s)}};class tc{constructor(t){this.currClient=0;this.startClock=0;this.written=0;this.encoder=t;this.clientStructs=[]}}const ec=t=>cc(t,di,wi);const nc=(t,e=mi,n=gi)=>{const s=new e;const r=new Yo(new n(wn(t)),false);let i=r.curr;if(i!==null){let t=0;let e=i.id.client;let n=i.id.clock!==0;let o=n?0:i.id.clock+i.length;for(;i!==null;i=r.next()){if(e!==i.id.client){if(o!==0){t++;Re(s.restEncoder,e);Re(s.restEncoder,o)}e=i.id.client;o=0;n=i.id.clock!==0}if(i.constructor===uh){n=true}if(!n){o=i.id.clock+i.length}}if(o!==0){t++;Re(s.restEncoder,e);Re(s.restEncoder,o)}const c=Ee();Re(c,t);Je(c,s.restEncoder);s.restEncoder=c;return s.toUint8Array()}else{Re(s.restEncoder,0);return s.toUint8Array()}};const sc=t=>nc(t,pi,di);const rc=(t,e=gi)=>{const n=new Map;const s=new Map;const r=new Yo(new e(wn(t)),false);let i=r.curr;if(i!==null){let t=i.id.client;let e=i.id.clock;n.set(t,e);for(;i!==null;i=r.next()){if(t!==i.id.client){s.set(t,e);n.set(i.id.client,i.id.clock);t=i.id.client}e=i.id.clock+i.length}s.set(t,e)}return{from:n,to:s}};const ic=t=>rc(t,di);const oc=(t,e)=>{if(t.constructor===xl){const{client:n,clock:s}=t.id;return new xl($i(n,s+e),t.length-e)}else if(t.constructor===uh){const{client:n,clock:s}=t.id;return new uh($i(n,s+e),t.length-e)}else{const n=t;const{client:s,clock:r}=n.id;return new ch($i(s,r+e),null,$i(s,r+e-1),null,n.rightOrigin,n.parent,n.parentSub,n.content.splice(e))}};const cc=(t,e=gi,n=yi)=>{if(t.length===1){return t[0]}const s=t.map((t=>new e(wn(t))));let r=s.map((t=>new Yo(t,true)));let i=null;const o=new n;const c=new tc(o);while(true){r=r.filter((t=>t.curr!==null));r.sort(((t,e)=>{if(t.curr.id.client===e.curr.id.client){const n=t.curr.id.clock-e.curr.id.clock;if(n===0){return t.curr.constructor===e.curr.constructor?0:t.curr.constructor===uh?1:-1}else{return n}}else{return e.curr.id.client-t.curr.id.client}}));if(r.length===0){break}const t=r[0];const e=t.curr.id.client;if(i!==null){let n=t.curr;let s=false;while(n!==null&&n.id.clock+n.length<=i.struct.id.clock+i.struct.length&&n.id.client>=i.struct.id.client){n=t.next();s=true}if(n===null||n.id.client!==e||s&&n.id.clock>i.struct.id.clock+i.struct.length){continue}if(e!==i.struct.id.client){uc(c,i.struct,i.offset);i={struct:n,offset:0};t.next()}else{if(i.struct.id.clock+i.struct.length0){if(i.struct.constructor===uh){i.struct.length-=e}else{n=oc(n,e)}}if(!i.struct.mergeWith(n)){uc(c,i.struct,i.offset);i={struct:n,offset:0};t.next()}}}}else{i={struct:t.curr,offset:0};t.next()}for(let n=t.curr;n!==null&&n.id.client===e&&n.id.clock===i.struct.id.clock+i.struct.length&&n.constructor!==uh;n=t.next()){uc(c,i.struct,i.offset);i={struct:n,offset:0}}}if(i!==null){uc(c,i.struct,i.offset);i=null}dc(c);const l=s.map((t=>ci(t)));const h=ni(l);oi(o,h);return o.toUint8Array()};const lc=(t,e,n=gi,s=yi)=>{const r=Ui(e);const o=new s;const c=new tc(o);const l=new n(wn(t));const h=new Yo(l,false);while(h.curr){const t=h.curr;const e=t.id.client;const n=r.get(e)||0;if(h.curr.constructor===uh){h.next();continue}if(t.id.clock+t.length>n){uc(c,t,i.T9(n-t.id.clock,0));h.next();while(h.curr&&h.curr.id.client===e){uc(c,h.curr,0);h.next()}}else{while(h.curr&&h.curr.id.client===e&&h.curr.id.clock+h.curr.length<=n){h.next()}}}dc(c);const a=ci(l);oi(o,a);return o.toUint8Array()};const hc=(t,e)=>lc(t,e,di,wi);const ac=t=>{if(t.written>0){t.clientStructs.push({written:t.written,restEncoder:De(t.encoder.restEncoder)});t.encoder.restEncoder=Ee();t.written=0}};const uc=(t,e,n)=>{if(t.written>0&&t.currClient!==e.id.client){ac(t)}if(t.written===0){t.currClient=e.id.client;t.encoder.writeClient(e.id.client);Re(t.encoder.restEncoder,e.id.clock+n)}e.write(t.encoder,n);t.written++};const dc=t=>{ac(t);const e=t.encoder.restEncoder;Re(e,t.clientStructs.length);for(let n=0;n{const s=new e(wn(t));const r=new Yo(s,false);const i=new n;const o=new tc(i);for(let l=r.curr;l!==null;l=r.next()){uc(o,l,0)}dc(o);const c=ci(s);oi(i,c);return i.toUint8Array()};const gc=t=>fc(t,di,yi);const pc=t=>fc(t,gi,wi);class wc{constructor(t,e){this.target=t;this.currentTarget=t;this.transaction=e;this._changes=null;this._keys=null;this._delta=null}get path(){return mc(this.currentTarget,this.target)}deletes(t){return ti(this.transaction.deleteSet,t.id)}get keys(){if(this._keys===null){const t=new Map;const e=this.target;const n=this.transaction.changed.get(e);n.forEach((n=>{if(n!==null){const s=e._map.get(n);let i;let o;if(this.adds(s)){let t=s.left;while(t!==null&&this.adds(t)){t=t.left}if(this.deletes(s)){if(t!==null&&this.deletes(t)){i="delete";o=r.HV(t.content.getContent())}else{return}}else{if(t!==null&&this.deletes(t)){i="update";o=r.HV(t.content.getContent())}else{i="add";o=undefined}}}else{if(this.deletes(s)){i="delete";o=r.HV(s.content.getContent())}else{return}}t.set(n,{action:i,oldValue:o})}}));this._keys=t}return this._keys}get delta(){return this.changes.delta}adds(t){return t.id.clock>=(this.transaction.beforeState.get(t.id.client)||0)}get changes(){let t=this._changes;if(t===null){const e=this.target;const n=ws.vt();const s=ws.vt();const r=[];t={added:n,deleted:s,delta:r,keys:this.keys};const i=this.transaction.changed.get(e);if(i.has(null)){let t=null;const i=()=>{if(t){r.push(t)}};for(let r=e._start;r!==null;r=r.right){if(r.deleted){if(this.deletes(r)&&!this.adds(r)){if(t===null||t.delete===undefined){i();t={delete:0}}t.delete+=r.length;s.add(r)}}else{if(this.adds(r)){if(t===null||t.insert===undefined){i();t={insert:[]}}t.insert=t.insert.concat(r.content.getContent());n.add(r)}else{if(t===null||t.retain===undefined){i();t={retain:0}}t.retain+=r.length}}}if(t!==null&&t.retain===undefined){i()}}this._changes=t}return t}}const mc=(t,e)=>{const n=[];while(e._item!==null&&e!==t){if(e._item.parentSub!==null){n.unshift(e._item.parentSub)}else{let t=0;let s=e._item.parent._start;while(s!==e._item&&s!==null){if(!s.deleted){t++}s=s.right}n.unshift(t)}e=e._item.parent}return n};const yc=80;let bc=0;class kc{constructor(t,e){t.marker=true;this.p=t;this.index=e;this.timestamp=bc++}}const _c=t=>{t.timestamp=bc++};const Sc=(t,e,n)=>{t.p.marker=false;t.p=e;e.marker=true;t.index=n;t.timestamp=bc++};const Ec=(t,e,n)=>{if(t.length>=yc){const s=t.reduce(((t,e)=>t.timestamp{if(t._start===null||e===0||t._searchMarker===null){return null}const n=t._searchMarker.length===0?null:t._searchMarker.reduce(((t,n)=>i.tn(e-t.index)e){s=s.left;if(!s.deleted&&s.countable){r-=s.length}}while(s.left!==null&&s.left.id.client===s.id.client&&s.left.id.clock+s.left.length===s.id.clock){s=s.left;if(!s.deleted&&s.countable){r-=s.length}}if(n!==null&&i.tn(n.index-r){for(let s=t.length-1;s>=0;s--){const r=t[s];if(n>0){let e=r.p;e.marker=false;while(e&&(e.deleted||!e.countable)){e=e.left;if(e&&!e.deleted&&e.countable){r.index-=e.length}}if(e===null||e.marker===true){t.splice(s,1);continue}r.p=e;e.marker=true}if(e0&&e===r.index){r.index=i.T9(e,r.index+n)}}};const vc=t=>{let e=t._start;const n=[];while(e){n.push(e);e=e.right}return n};const Ac=(t,e,n)=>{const s=t;const r=e.changedParentTypes;while(true){o._4(r,t,(()=>[])).push(n);if(t._item===null){break}t=t._item.parent}Fi(s._eH,n,e)};class Tc{constructor(){this._item=null;this._map=new Map;this._start=null;this.doc=null;this._length=0;this._eH=Pi();this._dEH=Pi();this._searchMarker=null}get parent(){return this._item?this._item.parent:null}_integrate(t,e){this.doc=t;this._item=e}_copy(){throw un()}clone(){throw un()}_write(t){}get _first(){let t=this._start;while(t!==null&&t.deleted){t=t.right}return t}_callObserver(t,e){if(!t.local&&this._searchMarker){this._searchMarker.length=0}}observe(t){ji(this._eH,t)}observeDeep(t){ji(this._dEH,t)}unobserve(t){Bi(this._eH,t)}unobserveDeep(t){Bi(this._dEH,t)}toJSON(){}}const xc=(t,e,n)=>{if(e<0){e=t._length+e}if(n<0){n=t._length+n}let s=n-e;const r=[];let i=t._start;while(i!==null&&s>0){if(i.countable&&!i.deleted){const t=i.content.getContent();if(t.length<=e){e-=t.length}else{for(let n=e;n0;n++){r.push(t[n]);s--}e=0}}i=i.right}return r};const Ic=t=>{const e=[];let n=t._start;while(n!==null){if(n.countable&&!n.deleted){const t=n.content.getContent();for(let n=0;n{const n=[];let s=t._start;while(s!==null){if(s.countable&&ko(s,e)){const t=s.content.getContent();for(let e=0;e{let n=0;let s=t._start;while(s!==null){if(s.countable&&!s.deleted){const r=s.content.getContent();for(let s=0;s{const n=[];Uc(t,((s,r)=>{n.push(e(s,r,t))}));return n};const Lc=t=>{let e=t._start;let n=null;let s=0;return{[Symbol.iterator](){return this},next:()=>{if(n===null){while(e!==null&&e.deleted){e=e.right}if(e===null){return{done:true,value:undefined}}n=e.content.getContent();s=0;e=e.right}const t=n[s++];if(n.length<=s){n=null}return{done:false,value:t}}}};const Nc=(t,e)=>{const n=Cc(t,e);let s=t._start;if(n!==null){s=n.p;e-=n.index}for(;s!==null;s=s.right){if(!s.deleted&&s.countable){if(e{let r=n;const i=t.doc;const o=i.clientID;const c=i.store;const l=n===null?e._start:n.right;let h=[];const a=()=>{if(h.length>0){r=new ch($i(o,Do(c,o)),r,r&&r.lastId,l,l&&l.id,e,null,new Jl(h));r.integrate(t,0);h=[]}};s.forEach((n=>{if(n===null){h.push(n)}else{switch(n.constructor){case Number:case Object:case Boolean:case Array:case String:h.push(n);break;default:a();switch(n.constructor){case Uint8Array:case ArrayBuffer:r=new ch($i(o,Do(c,o)),r,r&&r.lastId,l,l&&l.id,e,null,new Il(new Uint8Array(n)));r.integrate(t,0);break;case ai:r=new ch($i(o,Do(c,o)),r,r&&r.lastId,l,l&&l.id,e,null,new Nl(n));r.integrate(t,0);break;default:if(n instanceof Tc){r=new ch($i(o,Do(c,o)),r,r&&r.lastId,l,l&&l.id,e,null,new eh(n));r.integrate(t,0)}else{throw new Error("Unexpected content type in insert operation")}}}}}));a()};const Vc=an("Length exceeded!");const Pc=(t,e,n,s)=>{if(n>e._length){throw Vc}if(n===0){if(e._searchMarker){Dc(e._searchMarker,n,s.length)}return Rc(t,e,null,s)}const r=n;const i=Cc(e,n);let o=e._start;if(i!==null){o=i.p;n-=i.index;if(n===0){o=o.prev;n+=o&&o.countable&&!o.deleted?o.length:0}}for(;o!==null;o=o.right){if(!o.deleted&&o.countable){if(n<=o.length){if(n{const s=(e._searchMarker||[]).reduce(((t,e)=>e.index>t.index?e:t),{index:0,p:e._start});let r=s.p;if(r){while(r.right){r=r.right}}return Rc(t,e,r,n)};const Bc=(t,e,n,s)=>{if(s===0){return}const r=n;const i=s;const o=Cc(e,n);let c=e._start;if(o!==null){c=o.p;n-=o.index}for(;c!==null&&n>0;c=c.right){if(!c.deleted&&c.countable){if(n0&&c!==null){if(!c.deleted){if(s0){throw Vc}if(e._searchMarker){Dc(e._searchMarker,r,-i+s)}};const Fc=(t,e,n)=>{const s=e._map.get(n);if(s!==undefined){s.delete(t)}};const zc=(t,e,n,s)=>{const r=e._map.get(n)||null;const i=t.doc;const o=i.clientID;let c;if(s==null){c=new Jl([s])}else{switch(s.constructor){case Number:case Object:case Boolean:case Array:case String:c=new Jl([s]);break;case Uint8Array:c=new Il(s);break;case ai:c=new Nl(s);break;default:if(s instanceof Tc){c=new eh(s)}else{throw new Error("Unexpected content type")}}}new ch($i(o,Do(i.store,o)),r,r&&r.lastId,null,null,e,n,c).integrate(t,0)};const Jc=(t,e)=>{const n=t._map.get(e);return n!==undefined&&!n.deleted?n.content.getContent()[n.length-1]:undefined};const $c=t=>{const e={};t._map.forEach(((t,n)=>{if(!t.deleted){e[n]=t.content.getContent()[t.length-1]}}));return e};const Hc=(t,e)=>{const n=t._map.get(e);return n!==undefined&&!n.deleted};const Wc=(t,e,n)=>{let s=t._map.get(e)||null;while(s!==null&&(!n.sv.has(s.id.client)||s.id.clock>=(n.sv.get(s.id.client)||0))){s=s.left}return s!==null&&ko(s,n)?s.content.getContent()[s.length-1]:undefined};const Kc=t=>Wr(t.entries(),(t=>!t[1].deleted));class qc extends wc{constructor(t,e){super(t,e);this._transaction=e}}class Yc extends Tc{constructor(){super();this._prelimContent=[];this._searchMarker=[]}static from(t){const e=new Yc;e.push(t);return e}_integrate(t,e){super._integrate(t,e);this.insert(0,this._prelimContent);this._prelimContent=null}_copy(){return new Yc}clone(){const t=new Yc;t.insert(0,this.toArray().map((t=>t instanceof Tc?t.clone():t)));return t}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}_callObserver(t,e){super._callObserver(t,e);Ac(this,t,new qc(this,t))}insert(t,e){if(this.doc!==null){Jo(this.doc,(n=>{Pc(n,this,t,e)}))}else{this._prelimContent.splice(t,0,...e)}}push(t){if(this.doc!==null){Jo(this.doc,(e=>{jc(e,this,t)}))}else{this._prelimContent.push(...t)}}unshift(t){this.insert(0,t)}delete(t,e=1){if(this.doc!==null){Jo(this.doc,(n=>{Bc(n,this,t,e)}))}else{this._prelimContent.splice(t,e)}}get(t){return Nc(this,t)}toArray(){return Ic(this)}slice(t=0,e=this.length){return xc(this,t,e)}toJSON(){return this.map((t=>t instanceof Tc?t.toJSON():t))}map(t){return Oc(this,t)}forEach(t){Uc(this,t)}[Symbol.iterator](){return Lc(this)}_write(t){t.writeTypeRef(ql)}}const Xc=t=>new Yc;class Gc extends wc{constructor(t,e,n){super(t,e);this.keysChanged=n}}class Qc extends Tc{constructor(t){super();this._prelimContent=null;if(t===undefined){this._prelimContent=new Map}else{this._prelimContent=new Map(t)}}_integrate(t,e){super._integrate(t,e);this._prelimContent.forEach(((t,e)=>{this.set(e,t)}));this._prelimContent=null}_copy(){return new Qc}clone(){const t=new Qc;this.forEach(((e,n)=>{t.set(n,e instanceof Tc?e.clone():e)}));return t}_callObserver(t,e){Ac(this,t,new Gc(this,t,e))}toJSON(){const t={};this._map.forEach(((e,n)=>{if(!e.deleted){const s=e.content.getContent()[e.length-1];t[n]=s instanceof Tc?s.toJSON():s}}));return t}get size(){return[...Kc(this._map)].length}keys(){return Kr(Kc(this._map),(t=>t[0]))}values(){return Kr(Kc(this._map),(t=>t[1].content.getContent()[t[1].length-1]))}entries(){return Kr(Kc(this._map),(t=>[t[0],t[1].content.getContent()[t[1].length-1]]))}forEach(t){this._map.forEach(((e,n)=>{if(!e.deleted){t(e.content.getContent()[e.length-1],n,this)}}))}[Symbol.iterator](){return this.entries()}delete(t){if(this.doc!==null){Jo(this.doc,(e=>{Fc(e,this,t)}))}else{this._prelimContent.delete(t)}}set(t,e){if(this.doc!==null){Jo(this.doc,(n=>{zc(n,this,t,e)}))}else{this._prelimContent.set(t,e)}return e}get(t){return Jc(this,t)}has(t){return Hc(this,t)}clear(){if(this.doc!==null){Jo(this.doc,(t=>{this.forEach((function(e,n,s){Fc(t,s,n)}))}))}else{this._prelimContent.clear()}}_write(t){t.writeTypeRef(Yl)}}const Zc=t=>new Qc;const tl=(t,e)=>t===e||typeof t==="object"&&typeof e==="object"&&t&&e&&qr.SQ(t,e);class el{constructor(t,e,n,s){this.left=t;this.right=e;this.index=n;this.currentAttributes=s}forward(){if(this.right===null){dn()}switch(this.right.content.constructor){case jl:if(!this.right.deleted){il(this.currentAttributes,this.right.content)}break;default:if(!this.right.deleted){this.index+=this.right.length}break}this.left=this.right;this.right=this.right.right}}const nl=(t,e,n)=>{while(e.right!==null&&n>0){switch(e.right.content.constructor){case jl:if(!e.right.deleted){il(e.currentAttributes,e.right.content)}break;default:if(!e.right.deleted){if(n{const s=new Map;const r=Cc(e,n);if(r){const e=new el(r.p.left,r.p,r.index,s);return nl(t,e,n-r.index)}else{const r=new el(null,e._start,0,s);return nl(t,r,n)}};const rl=(t,e,n,s)=>{while(n.right!==null&&(n.right.deleted===true||n.right.content.constructor===jl&&tl(s.get(n.right.content.key),n.right.content.value))){if(!n.right.deleted){s.delete(n.right.content.key)}n.forward()}const r=t.doc;const i=r.clientID;s.forEach(((s,o)=>{const c=n.left;const l=n.right;const h=new ch($i(i,Do(r.store,i)),c,c&&c.lastId,l,l&&l.id,e,null,new jl(o,s));h.integrate(t,0);n.right=h;n.forward()}))};const il=(t,e)=>{const{key:n,value:s}=e;if(s===null){t.delete(n)}else{t.set(n,s)}};const ol=(t,e)=>{while(true){if(t.right===null){break}else if(t.right.deleted||t.right.content.constructor===jl&&tl(e[t.right.content.key]||null,t.right.content.value));else{break}t.forward()}};const cl=(t,e,n,s)=>{const r=t.doc;const i=r.clientID;const o=new Map;for(const c in s){const l=s[c];const h=n.currentAttributes.get(c)||null;if(!tl(h,l)){o.set(c,h);const{left:s,right:a}=n;n.right=new ch($i(i,Do(r.store,i)),s,s&&s.lastId,a,a&&a.id,e,null,new jl(c,l));n.right.integrate(t,0);n.forward()}}return o};const ll=(t,e,n,s,r)=>{n.currentAttributes.forEach(((t,e)=>{if(r[e]===undefined){r[e]=null}}));const i=t.doc;const o=i.clientID;ol(n,r);const c=cl(t,e,n,r);const l=s.constructor===String?new Hl(s):s instanceof Tc?new eh(s):new Vl(s);let{left:h,right:a,index:u}=n;if(e._searchMarker){Dc(e._searchMarker,n.index,l.getLength())}a=new ch($i(o,Do(i.store,o)),h,h&&h.lastId,a,a&&a.id,e,null,l);a.integrate(t,0);n.right=a;n.index=u;n.forward();rl(t,e,n,c)};const hl=(t,e,n,s,r)=>{const i=t.doc;const o=i.clientID;ol(n,r);const c=cl(t,e,n,r);t:while(n.right!==null&&(s>0||c.size>0&&(n.right.deleted||n.right.content.constructor===jl))){if(!n.right.deleted){switch(n.right.content.constructor){case jl:{const{key:e,value:i}=n.right.content;const o=r[e];if(o!==undefined){if(tl(o,i)){c.delete(e)}else{if(s===0){break t}c.set(e,i)}n.right.delete(t)}else{n.currentAttributes.set(e,i)}break}default:if(s0){let r="";for(;s>0;s--){r+="\n"}n.right=new ch($i(o,Do(i.store,o)),n.left,n.left&&n.left.lastId,n.right,n.right&&n.right.id,e,null,new Hl(r));n.right.integrate(t,0);n.forward()}rl(t,e,n,c)};const al=(t,e,n,s,r)=>{let i=e;const c=o.vt();while(i&&(!i.countable||i.deleted)){if(!i.deleted&&i.content.constructor===jl){const t=i.content;c.set(t.key,t)}i=i.right}let l=0;let h=false;while(e!==i){if(n===e){h=true}if(!e.deleted){const n=e.content;switch(n.constructor){case jl:{const{key:i,value:o}=n;const a=s.get(i)||null;if(c.get(i)!==n||a===o){e.delete(t);l++;if(!h&&(r.get(i)||null)===o&&a!==o){if(a===null){r.delete(i)}else{r.set(i,a)}}}if(!h&&!e.deleted){il(r,n)}break}}}e=e.right}return l};const ul=(t,e)=>{while(e&&e.right&&(e.right.deleted||!e.right.countable)){e=e.right}const n=new Set;while(e&&(e.deleted||!e.countable)){if(!e.deleted&&e.content.constructor===jl){const s=e.content.key;if(n.has(s)){e.delete(t)}else{n.add(s)}}e=e.left}};const dl=t=>{let e=0;Jo(t.doc,(n=>{let s=t._start;let r=t._start;let i=o.vt();const c=o.C(i);while(r){if(r.deleted===false){switch(r.content.constructor){case jl:il(c,r.content);break;default:e+=al(n,s,r,i,c);i=o.C(c);s=r;break}}r=r.right}}));return e};const fl=(t,e,n)=>{const s=n;const r=o.C(e.currentAttributes);const i=e.right;while(n>0&&e.right!==null){if(e.right.deleted===false){switch(e.right.content.constructor){case eh:case Vl:case Hl:if(n{if(t===null){this.childListChanged=true}else{this.keysChanged.add(t)}}))}get changes(){if(this._changes===null){const t={keys:this.keys,delta:this.delta,added:new Set,deleted:new Set};this._changes=t}return this._changes}get delta(){if(this._delta===null){const t=this.target.doc;const e=[];Jo(t,(t=>{const n=new Map;const s=new Map;let r=this.target._start;let i=null;const o={};let c="";let l=0;let h=0;const a=()=>{if(i!==null){let t;switch(i){case"delete":t={delete:h};h=0;break;case"insert":t={insert:c};if(n.size>0){t.attributes={};n.forEach(((e,n)=>{if(e!==null){t.attributes[n]=e}}))}c="";break;case"retain":t={retain:l};if(Object.keys(o).length>0){t.attributes={};for(const e in o){t.attributes[e]=o[e]}}l=0;break}e.push(t);i=null}};while(r!==null){switch(r.content.constructor){case eh:case Vl:if(this.adds(r)){if(!this.deletes(r)){a();i="insert";c=r.content.getContent()[0];a()}}else if(this.deletes(r)){if(i!=="delete"){a();i="delete"}h+=1}else if(!r.deleted){if(i!=="retain"){a();i="retain"}l+=1}break;case Hl:if(this.adds(r)){if(!this.deletes(r)){if(i!=="insert"){a();i="insert"}c+=r.content.str}}else if(this.deletes(r)){if(i!=="delete"){a();i="delete"}h+=r.length}else if(!r.deleted){if(i!=="retain"){a();i="retain"}l+=r.length}break;case jl:{const{key:e,value:c}=r.content;if(this.adds(r)){if(!this.deletes(r)){const l=n.get(e)||null;if(!tl(l,c)){if(i==="retain"){a()}if(tl(c,s.get(e)||null)){delete o[e]}else{o[e]=c}}else if(c!==null){r.delete(t)}}}else if(this.deletes(r)){s.set(e,c);const t=n.get(e)||null;if(!tl(t,c)){if(i==="retain"){a()}o[e]=t}}else if(!r.deleted){s.set(e,c);const n=o[e];if(n!==undefined){if(!tl(n,c)){if(i==="retain"){a()}if(c===null){delete o[e]}else{o[e]=c}}else if(n!==null){r.delete(t)}}}if(!r.deleted){if(i==="insert"){a()}il(n,r.content)}break}}r=r.right}a();while(e.length>0){const t=e[e.length-1];if(t.retain!==undefined&&t.attributes===undefined){e.pop()}else{break}}}));this._delta=e}return this._delta}}class pl extends Tc{constructor(t){super();this._pending=t!==undefined?[()=>this.insert(0,t)]:[];this._searchMarker=[]}get length(){return this._length}_integrate(t,e){super._integrate(t,e);try{this._pending.forEach((t=>t()))}catch(gh){console.error(gh)}this._pending=null}_copy(){return new pl}clone(){const t=new pl;t.applyDelta(this.toDelta());return t}_callObserver(t,e){super._callObserver(t,e);const n=new gl(this,t,e);const s=t.doc;Ac(this,t,n);if(!t.local){let e=false;for(const[n,r]of t.afterState.entries()){const i=t.beforeState.get(n)||0;if(r===i){continue}Lo(t,s.store.clients.get(n),i,r,(t=>{if(!t.deleted&&t.content.constructor===jl){e=true}}));if(e){break}}if(!e){Qr(t,t.deleteSet,(t=>{if(t instanceof xl||e){return}if(t.parent===this&&t.content.constructor===jl){e=true}}))}Jo(s,(t=>{if(e){dl(this)}else{Qr(t,t.deleteSet,(e=>{if(e instanceof xl){return}if(e.parent===this){ul(t,e)}}))}}))}}toString(){let t="";let e=this._start;while(e!==null){if(!e.deleted&&e.countable&&e.content.constructor===Hl){t+=e.content.str}e=e.right}return t}toJSON(){return this.toString()}applyDelta(t,{sanitize:e=true}={}){if(this.doc!==null){Jo(this.doc,(n=>{const s=new el(null,this._start,0,new Map);for(let r=0;r0){ll(n,this,s,o,i.attributes||{})}}else if(i.retain!==undefined){hl(n,this,s,i.retain,i.attributes||{})}else if(i.delete!==undefined){fl(n,s,i.delete)}}}))}else{this._pending.push((()=>this.applyDelta(t)))}}toDelta(t,e,n){const s=[];const r=new Map;const i=this.doc;let o="";let c=this._start;function l(){if(o.length>0){const t={};let e=false;r.forEach(((n,s)=>{e=true;t[s]=n}));const n={insert:o};if(e){n.attributes=t}s.push(n);o=""}}Jo(i,(i=>{if(t){_o(i,t)}if(e){_o(i,e)}while(c!==null){if(ko(c,t)||e!==undefined&&ko(c,e)){switch(c.content.constructor){case Hl:{const s=r.get("ychange");if(t!==undefined&&!ko(c,t)){if(s===undefined||s.user!==c.id.client||s.type!=="removed"){l();r.set("ychange",n?n("removed",c.id):{type:"removed"})}}else if(e!==undefined&&!ko(c,e)){if(s===undefined||s.user!==c.id.client||s.type!=="added"){l();r.set("ychange",n?n("added",c.id):{type:"added"})}}else if(s!==undefined){l();r.delete("ychange")}o+=c.content.str;break}case eh:case Vl:{l();const t={insert:c.content.getContent()[0]};if(r.size>0){const e={};t.attributes=e;r.forEach(((t,n)=>{e[n]=t}))}s.push(t);break}case jl:if(ko(c,t)){l();il(r,c.content)}break}}c=c.right}l()}),"cleanup");return s}insert(t,e,n){if(e.length<=0){return}const s=this.doc;if(s!==null){Jo(s,(s=>{const r=sl(s,this,t);if(!n){n={};r.currentAttributes.forEach(((t,e)=>{n[e]=t}))}ll(s,this,r,e,n)}))}else{this._pending.push((()=>this.insert(t,e,n)))}}insertEmbed(t,e,n={}){const s=this.doc;if(s!==null){Jo(s,(s=>{const r=sl(s,this,t);ll(s,this,r,e,n)}))}else{this._pending.push((()=>this.insertEmbed(t,e,n)))}}delete(t,e){if(e===0){return}const n=this.doc;if(n!==null){Jo(n,(n=>{fl(n,sl(n,this,t),e)}))}else{this._pending.push((()=>this.delete(t,e)))}}format(t,e,n){if(e===0){return}const s=this.doc;if(s!==null){Jo(s,(s=>{const r=sl(s,this,t);if(r.right===null){return}hl(s,this,r,e,n)}))}else{this._pending.push((()=>this.format(t,e,n)))}}removeAttribute(t){if(this.doc!==null){Jo(this.doc,(e=>{Fc(e,this,t)}))}else{this._pending.push((()=>this.removeAttribute(t)))}}setAttribute(t,e){if(this.doc!==null){Jo(this.doc,(n=>{zc(n,this,t,e)}))}else{this._pending.push((()=>this.setAttribute(t,e)))}}getAttribute(t){return Jc(this,t)}getAttributes(){return $c(this)}_write(t){t.writeTypeRef(Xl)}}const wl=t=>new pl;class ml{constructor(t,e=()=>true){this._filter=e;this._root=t;this._currentNode=t._start;this._firstCall=true}[Symbol.iterator](){return this}next(){let t=this._currentNode;let e=t&&t.content&&t.content.type;if(t!==null&&(!this._firstCall||t.deleted||!this._filter(e))){do{e=t.content.type;if(!t.deleted&&(e.constructor===kl||e.constructor===yl)&&e._start!==null){t=e._start}else{while(t!==null){if(t.right!==null){t=t.right;break}else if(t.parent===this._root){t=null}else{t=t.parent._item}}}}while(t!==null&&(t.deleted||!this._filter(t.content.type)))}this._firstCall=false;if(t===null){return{value:undefined,done:true}}this._currentNode=t;return{value:t.content.type,done:false}}}class yl extends Tc{constructor(){super();this._prelimContent=[]}get firstChild(){const t=this._first;return t?t.content.getContent()[0]:null}_integrate(t,e){super._integrate(t,e);this.insert(0,this._prelimContent);this._prelimContent=null}_copy(){return new yl}clone(){const t=new yl;t.insert(0,this.toArray().map((t=>t instanceof Tc?t.clone():t)));return t}get length(){return this._prelimContent===null?this._length:this._prelimContent.length}createTreeWalker(t){return new ml(this,t)}querySelector(t){t=t.toUpperCase();const e=new ml(this,(e=>e.nodeName&&e.nodeName.toUpperCase()===t));const n=e.next();if(n.done){return null}else{return n.value}}querySelectorAll(t){t=t.toUpperCase();return r.HT(new ml(this,(e=>e.nodeName&&e.nodeName.toUpperCase()===t)))}_callObserver(t,e){Ac(this,t,new Sl(this,e,t))}toString(){return Jo(this.doc,(()=>Oc(this,(t=>t.toString())).join("")))}toJSON(){return this.toString()}toDOM(t=document,e={},n){const s=t.createDocumentFragment();if(n!==undefined){n._createAssociation(s,this)}Uc(this,(r=>{s.insertBefore(r.toDOM(t,e,n),null)}));return s}insert(t,e){if(this.doc!==null){Jo(this.doc,(n=>{Pc(n,this,t,e)}))}else{this._prelimContent.splice(t,0,...e)}}insertAfter(t,e){if(this.doc!==null){Jo(this.doc,(n=>{const s=t&&t instanceof Tc?t._item:t;Rc(n,this,s,e)}))}else{const n=this._prelimContent;const s=t===null?0:n.findIndex((e=>e===t))+1;if(s===0&&t!==null){throw an("Reference item not found")}n.splice(s,0,...e)}}delete(t,e=1){if(this.doc!==null){Jo(this.doc,(n=>{Bc(n,this,t,e)}))}else{this._prelimContent.splice(t,e)}}toArray(){return Ic(this)}push(t){this.insert(this.length,t)}unshift(t){this.insert(0,t)}get(t){return Nc(this,t)}slice(t=0,e=this.length){return xc(this,t,e)}forEach(t){Uc(this,t)}_write(t){t.writeTypeRef(Ql)}}const bl=t=>new yl;class kl extends yl{constructor(t="UNDEFINED"){super();this.nodeName=t;this._prelimAttrs=new Map}get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_integrate(t,e){super._integrate(t,e);this._prelimAttrs.forEach(((t,e)=>{this.setAttribute(e,t)}));this._prelimAttrs=null}_copy(){return new kl(this.nodeName)}clone(){const t=new kl(this.nodeName);const e=this.getAttributes();for(const n in e){t.setAttribute(n,e[n])}t.insert(0,this.toArray().map((t=>t instanceof Tc?t.clone():t)));return t}toString(){const t=this.getAttributes();const e=[];const n=[];for(const o in t){n.push(o)}n.sort();const s=n.length;for(let o=0;o0?" "+e.join(" "):"";return`<${r}${i}>${super.toString()}`}removeAttribute(t){if(this.doc!==null){Jo(this.doc,(e=>{Fc(e,this,t)}))}else{this._prelimAttrs.delete(t)}}setAttribute(t,e){if(this.doc!==null){Jo(this.doc,(n=>{zc(n,this,t,e)}))}else{this._prelimAttrs.set(t,e)}}getAttribute(t){return Jc(this,t)}hasAttribute(t){return Hc(this,t)}getAttributes(){return $c(this)}toDOM(t=document,e={},n){const s=t.createElement(this.nodeName);const r=this.getAttributes();for(const i in r){s.setAttribute(i,r[i])}Uc(this,(r=>{s.appendChild(r.toDOM(t,e,n))}));if(n!==undefined){n._createAssociation(s,this)}return s}_write(t){t.writeTypeRef(Gl);t.writeKey(this.nodeName)}}const _l=t=>new kl(t.readKey());class Sl extends wc{constructor(t,e,n){super(t,n);this.childListChanged=false;this.attributesChanged=new Set;e.forEach((t=>{if(t===null){this.childListChanged=true}else{this.attributesChanged.add(t)}}))}}class El extends Qc{constructor(t){super();this.hookName=t}_copy(){return new El(this.hookName)}clone(){const t=new El(this.hookName);this.forEach(((e,n)=>{t.set(n,e)}));return t}toDOM(t=document,e={},n){const s=e[this.hookName];let r;if(s!==undefined){r=s.createDom(this)}else{r=document.createElement(this.hookName)}r.setAttribute("data-yjs-hook",this.hookName);if(n!==undefined){n._createAssociation(r,this)}return r}_write(t){t.writeTypeRef(Zl);t.writeKey(this.hookName)}}const Cl=t=>new El(t.readKey());class Dl extends pl{get nextSibling(){const t=this._item?this._item.next:null;return t?t.content.type:null}get prevSibling(){const t=this._item?this._item.prev:null;return t?t.content.type:null}_copy(){return new Dl}clone(){const t=new Dl;t.applyDelta(this.toDelta());return t}toDOM(t=document,e,n){const s=t.createTextNode(this.toString());if(n!==undefined){n._createAssociation(s,this)}return s}toString(){return this.toDelta().map((t=>{const e=[];for(const s in t.attributes){const n=[];for(const e in t.attributes[s]){n.push({key:e,value:t.attributes[s][e]})}n.sort(((t,e)=>t.keyt.nodeName=0;s--){n+=``}return n})).join("")}toJSON(){return this.toString()}_write(t){t.writeTypeRef(th)}}const vl=t=>new Dl;class Al{constructor(t,e){this.id=t;this.length=e}get deleted(){throw un()}mergeWith(t){return false}write(t,e,n){throw un()}integrate(t,e){throw un()}}const Tl=0;class xl extends Al{get deleted(){return true}delete(){}mergeWith(t){if(this.constructor!==t.constructor){return false}this.length+=t.length;return true}integrate(t,e){if(e>0){this.id.clock+=e;this.length-=e}vo(t.doc.store,this)}write(t,e){t.writeInfo(Tl);t.writeLen(this.length-e)}getMissing(t,e){return null}}class Il{constructor(t){this.content=t}getLength(){return 1}getContent(){return[this.content]}isCountable(){return true}copy(){return new Il(this.content)}splice(t){throw un()}mergeWith(t){return false}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeBuf(this.content)}getRef(){return 3}}const Ml=t=>new Il(t.readBuf());class Ul{constructor(t){this.len=t}getLength(){return this.len}getContent(){return[]}isCountable(){return false}copy(){return new Ul(this.len)}splice(t){const e=new Ul(this.len-t);this.len=t;return e}mergeWith(t){this.len+=t.len;return true}integrate(t,e){si(t.deleteSet,e.id.client,e.id.clock,this.len);e.markDeleted()}delete(t){}gc(t){}write(t,e){t.writeLen(this.len-e)}getRef(){return 1}}const Ol=t=>new Ul(t.readLen());const Ll=(t,e)=>new ai({guid:t,...e,shouldLoad:e.shouldLoad||e.autoLoad||false});class Nl{constructor(t){if(t._item){console.error("This document was already integrated as a sub-document. You should create a second instance instead with the same guid.")}this.doc=t;const e={};this.opts=e;if(!t.gc){e.gc=false}if(t.autoLoad){e.autoLoad=true}if(t.meta!==null){e.meta=t.meta}}getLength(){return 1}getContent(){return[this.doc]}isCountable(){return true}copy(){return new Nl(Ll(this.doc.guid,this.opts))}splice(t){throw un()}mergeWith(t){return false}integrate(t,e){this.doc._item=e;t.subdocsAdded.add(this.doc);if(this.doc.shouldLoad){t.subdocsLoaded.add(this.doc)}}delete(t){if(t.subdocsAdded.has(this.doc)){t.subdocsAdded.delete(this.doc)}else{t.subdocsRemoved.add(this.doc)}}gc(t){}write(t,e){t.writeString(this.doc.guid);t.writeAny(this.opts)}getRef(){return 9}}const Rl=t=>new Nl(Ll(t.readString(),t.readAny()));class Vl{constructor(t){this.embed=t}getLength(){return 1}getContent(){return[this.embed]}isCountable(){return true}copy(){return new Vl(this.embed)}splice(t){throw un()}mergeWith(t){return false}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeJSON(this.embed)}getRef(){return 5}}const Pl=t=>new Vl(t.readJSON());class jl{constructor(t,e){this.key=t;this.value=e}getLength(){return 1}getContent(){return[]}isCountable(){return false}copy(){return new jl(this.key,this.value)}splice(t){throw un()}mergeWith(t){return false}integrate(t,e){e.parent._searchMarker=null}delete(t){}gc(t){}write(t,e){t.writeKey(this.key);t.writeJSON(this.value)}getRef(){return 6}}const Bl=t=>new jl(t.readKey(),t.readJSON());class Fl{constructor(t){this.arr=t}getLength(){return this.arr.length}getContent(){return this.arr}isCountable(){return true}copy(){return new Fl(this.arr)}splice(t){const e=new Fl(this.arr.slice(t));this.arr=this.arr.slice(0,t);return e}mergeWith(t){this.arr=this.arr.concat(t.arr);return true}integrate(t,e){}delete(t){}gc(t){}write(t,e){const n=this.arr.length;t.writeLen(n-e);for(let s=e;s{const e=t.readLen();const n=[];for(let s=0;s{const e=t.readLen();const n=[];for(let s=0;s=55296&&n<=56319){this.str=this.str.slice(0,t-1)+"�";e.str="�"+e.str.slice(1)}return e}mergeWith(t){this.str+=t.str;return true}integrate(t,e){}delete(t){}gc(t){}write(t,e){t.writeString(e===0?this.str:this.str.slice(e))}getRef(){return 4}}const Wl=t=>new Hl(t.readString());const Kl=[Xc,Zc,wl,_l,bl,Cl,vl];const ql=0;const Yl=1;const Xl=2;const Gl=3;const Ql=4;const Zl=5;const th=6;class eh{constructor(t){this.type=t}getLength(){return 1}getContent(){return[this.type]}isCountable(){return true}copy(){return new eh(this.type._copy())}splice(t){throw un()}mergeWith(t){return false}integrate(t,e){this.type._integrate(t.doc,e)}delete(t){let e=this.type._start;while(e!==null){if(!e.deleted){e.delete(t)}else{t._mergeStructs.push(e)}e=e.right}this.type._map.forEach((e=>{if(!e.deleted){e.delete(t)}else{t._mergeStructs.push(e)}}));t.changed.delete(this.type)}gc(t){let e=this.type._start;while(e!==null){e.gc(t,true);e=e.right}this.type._start=null;this.type._map.forEach((e=>{while(e!==null){e.gc(t,true);e=e.left}}));this.type._map=new Map}write(t,e){this.type._write(t)}getRef(){return 7}}const nh=t=>new eh(Kl[t.readTypeRef()](t));const sh=(t,e)=>{let n=e;let s=0;let r;do{if(s>0){n=$i(n.client,n.clock+s)}r=xo(t,n);s=n.clock-r.id.clock;n=r.redone}while(n!==null&&r instanceof ch);return{item:r,diff:s}};const rh=(t,e)=>{while(t!==null&&t.keep!==e){t.keep=e;t=t.parent._item}};const ih=(t,e,n)=>{const{client:s,clock:r}=e.id;const i=new ch($i(s,r+n),e,$i(s,r+n-1),e.right,e.rightOrigin,e.parent,e.parentSub,e.content.splice(n));if(e.deleted){i.markDeleted()}if(e.keep){i.keep=true}if(e.redone!==null){i.redone=$i(e.redone.client,e.redone.clock+n)}e.right=i;if(i.right!==null){i.right.left=i}t._mergeStructs.push(i);if(i.parentSub!==null&&i.right===null){i.parent._map.set(i.parentSub,i)}e.length=n;return i};const oh=(t,e,n,s,r)=>{const i=t.doc;const o=i.store;const c=i.clientID;const l=e.redone;if(l!==null){return Mo(t,l)}let h=e.parent._item;let a=null;let u;if(h!==null&&h.deleted===true){if(h.redone===null&&(!n.has(h)||oh(t,h,n,s,r)===null)){return null}while(h.redone!==null){h=Mo(t,h.redone)}}const d=h===null?e.parent:h.content.type;if(e.parentSub===null){a=e.left;u=e;while(a!==null){let e=a;while(e!==null&&e.parent._item!==h){e=e.redone===null?null:Mo(t,e.redone)}if(e!==null&&e.parent._item===h){a=e;break}a=a.left}while(u!==null){let e=u;while(e!==null&&e.parent._item!==h){e=e.redone===null?null:Mo(t,e.redone)}if(e!==null&&e.parent._item===h){u=e;break}u=u.right}}else{u=null;if(e.right&&!r){a=e;while(a!==null&&a.right!==null&&ti(s,a.right.id)){a=a.right}while(a!==null&&a.redone!==null){a=Mo(t,a.redone)}if(a&&a.right!==null){return null}}else{a=d._map.get(e.parentSub)||null}}const f=Do(o,c);const g=$i(c,f);const p=new ch(g,a,a&&a.lastId,u,u&&u.id,d,e.parentSub,e.content.copy());e.redone=g;rh(p,true);p.integrate(t,0);return p};class ch extends Al{constructor(t,e,n,s,r,i,o,c){super(t,c.getLength());this.origin=n;this.left=e;this.right=s;this.rightOrigin=r;this.parent=i;this.parentSub=o;this.redone=null;this.content=c;this.info=this.content.isCountable()?it:0}set marker(t){if((this.info&ct)>0!==t){this.info^=ct}}get marker(){return(this.info&ct)>0}get keep(){return(this.info&rt)>0}set keep(t){if(this.keep!==t){this.info^=rt}}get countable(){return(this.info&it)>0}get deleted(){return(this.info&ot)>0}set deleted(t){if(this.deleted!==t){this.info^=ot}}markDeleted(){this.info|=ot}getMissing(t,e){if(this.origin&&this.origin.client!==this.id.client&&this.origin.clock>=Do(e,this.origin.client)){return this.origin.client}if(this.rightOrigin&&this.rightOrigin.client!==this.id.client&&this.rightOrigin.clock>=Do(e,this.rightOrigin.client)){return this.rightOrigin.client}if(this.parent&&this.parent.constructor===zi&&this.id.client!==this.parent.client&&this.parent.clock>=Do(e,this.parent.client)){return this.parent.client}if(this.origin){this.left=Uo(t,e,this.origin);this.origin=this.left.lastId}if(this.rightOrigin){this.right=Mo(t,this.rightOrigin);this.rightOrigin=this.right.id}if(this.left&&this.left.constructor===xl||this.right&&this.right.constructor===xl){this.parent=null}if(!this.parent){if(this.left&&this.left.constructor===ch){this.parent=this.left.parent;this.parentSub=this.left.parentSub}if(this.right&&this.right.constructor===ch){this.parent=this.right.parent;this.parentSub=this.right.parentSub}}else if(this.parent.constructor===zi){const t=xo(e,this.parent);if(t.constructor===xl){this.parent=null}else{this.parent=t.content.type}}return null}integrate(t,e){if(e>0){this.id.clock+=e;this.left=Uo(t,t.doc.store,$i(this.id.client,this.id.clock-1));this.origin=this.left.lastId;this.content=this.content.splice(e);this.length-=e}if(this.parent){if(!this.left&&(!this.right||this.right.left!==null)||this.left&&this.left.right!==this.right){let e=this.left;let n;if(e!==null){n=e.right}else if(this.parentSub!==null){n=this.parent._map.get(this.parentSub)||null;while(n!==null&&n.left!==null){n=n.left}}else{n=this.parent._start}const s=new Set;const r=new Set;while(n!==null&&n!==this.right){r.add(n);s.add(n);if(Ji(this.origin,n.origin)){if(n.id.client{if(e.p===t){e.p=this;if(!this.deleted&&this.countable){e.index-=this.length}}}))}if(t.keep){this.keep=true}this.right=t.right;if(this.right!==null){this.right.left=this}this.length+=t.length;return true}return false}delete(t){if(!this.deleted){const e=this.parent;if(this.countable&&this.parentSub===null){e._length-=this.length}this.markDeleted();si(t.deleteSet,this.id.client,this.id.clock,this.length);Vo(t,e,this.parentSub);this.content.delete(t)}}gc(t,e){if(!this.deleted){throw dn()}this.content.gc(t);if(e){Oo(t,this,new xl(this.id,this.length))}else{this.content=new Ul(this.length)}}write(t,e){const n=e>0?$i(this.id.client,this.id.clock+e-1):this.origin;const s=this.rightOrigin;const r=this.parentSub;const i=this.content.getRef()&Ft|(n===null?0:ut)|(s===null?0:at)|(r===null?0:ht);t.writeInfo(i);if(n!==null){t.writeLeftID(n)}if(s!==null){t.writeRightID(s)}if(n===null&&s===null){const e=this.parent;if(e._item!==undefined){const n=e._item;if(n===null){const n=Ki(e);t.writeParentInfo(true);t.writeString(n)}else{t.writeParentInfo(false);t.writeLeftID(n.id)}}else if(e.constructor===String){t.writeParentInfo(true);t.writeString(e)}else if(e.constructor===zi){t.writeParentInfo(false);t.writeLeftID(e)}else{dn()}if(r!==null){t.writeString(r)}}this.content.write(t,e)}}const lh=(t,e)=>hh[e&Ft](t);const hh=[()=>{dn()},Ol,zl,Ml,Wl,Pl,Bl,nh,$l,Rl,()=>{dn()}];const ah=10;class uh extends Al{get deleted(){return true}delete(){}mergeWith(t){if(this.constructor!==t.constructor){return false}this.length+=t.length;return true}integrate(t,e){dn()}write(t,e){t.writeInfo(ah);Re(t.restEncoder,this.length-e)}getMissing(t,e){return null}}const dh=typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:typeof n.g!=="undefined"?n.g:{};const fh="__ $YJS$ __";if(dh[fh]===true){console.error("Yjs was already imported. This breaks constructor checks and will lead to issues! - https://github.com/yjs/yjs/issues/438")}dh[fh]=true}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9085.5a959b5878e7afd8a878.js b/.venv/share/jupyter/lab/static/9085.5a959b5878e7afd8a878.js new file mode 100644 index 0000000000000000000000000000000000000000..de8e40941c0691ca23ec52e1bfeffe543775cc90 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9085.5a959b5878e7afd8a878.js @@ -0,0 +1,2 @@ +/*! For license information please see 9085.5a959b5878e7afd8a878.js.LICENSE.txt */ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9085],{91033:r=>{function e(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}r.exports=e},83729:r=>{function e(r,e){var t=-1,n=r==null?0:r.length;while(++t{var n=t(98598),o=t(75288);var a=Object.prototype;var u=a.hasOwnProperty;function c(r,e,t){var a=r[e];if(!(u.call(r,e)&&o(a,t))||t===undefined&&!(e in r)){n(r,e,t)}}r.exports=c},74733:(r,e,t)=>{var n=t(21791),o=t(95950);function a(r,e){return r&&n(e,o(e),r)}r.exports=a},43838:(r,e,t)=>{var n=t(21791),o=t(37241);function a(r,e){return r&&n(e,o(e),r)}r.exports=a},98598:(r,e,t)=>{var n=t(93243);function o(r,e,t){if(e=="__proto__"&&n){n(r,e,{configurable:true,enumerable:true,value:t,writable:true})}else{r[e]=t}}r.exports=o},9999:(r,e,t)=>{var n=t(37217),o=t(83729),a=t(16547),u=t(74733),c=t(43838),i=t(93290),f=t(23007),s=t(92271),l=t(48948),v=t(50002),p=t(83349),b=t(5861),y=t(76189),j=t(77199),x=t(35529),d=t(56449),h=t(3656),w=t(87730),g=t(23805),O=t(38440),_=t(95950),A=t(37241);var S=1,m=2,P=4;var k="[object Arguments]",E="[object Array]",I="[object Boolean]",U="[object Date]",F="[object Error]",C="[object Function]",D="[object GeneratorFunction]",M="[object Map]",R="[object Number]",B="[object Object]",L="[object RegExp]",N="[object Set]",T="[object String]",$="[object Symbol]",V="[object WeakMap]";var W="[object ArrayBuffer]",z="[object DataView]",G="[object Float32Array]",Y="[object Float64Array]",q="[object Int8Array]",H="[object Int16Array]",J="[object Int32Array]",K="[object Uint8Array]",Q="[object Uint8ClampedArray]",X="[object Uint16Array]",Z="[object Uint32Array]";var rr={};rr[k]=rr[E]=rr[W]=rr[z]=rr[I]=rr[U]=rr[G]=rr[Y]=rr[q]=rr[H]=rr[J]=rr[M]=rr[R]=rr[B]=rr[L]=rr[N]=rr[T]=rr[$]=rr[K]=rr[Q]=rr[X]=rr[Z]=true;rr[F]=rr[C]=rr[V]=false;function er(r,e,t,E,I,U){var F,M=e&S,R=e&m,L=e&P;if(t){F=I?t(r,E,I,U):t(r)}if(F!==undefined){return F}if(!g(r)){return r}var N=d(r);if(N){F=y(r);if(!M){return f(r,F)}}else{var T=b(r),$=T==C||T==D;if(h(r)){return i(r,M)}if(T==B||T==k||$&&!I){F=R||$?{}:x(r);if(!M){return R?l(r,c(F,r)):s(r,u(F,r))}}else{if(!rr[T]){return I?r:{}}F=j(r,T,M)}}U||(U=new n);var V=U.get(r);if(V){return V}U.set(r,F);if(O(r)){r.forEach((function(n){F.add(er(n,e,t,n,r,U))}))}else if(w(r)){r.forEach((function(n,o){F.set(o,er(n,e,t,o,r,U))}))}var W=L?R?p:v:R?A:_;var z=N?undefined:W(r);o(z||r,(function(n,o){if(z){o=n;n=r[o]}a(F,o,er(n,e,t,o,r,U))}));return F}r.exports=er},39344:(r,e,t)=>{var n=t(23805);var o=Object.create;var a=function(){function r(){}return function(e){if(!n(e)){return{}}if(o){return o(e)}r.prototype=e;var t=new r;r.prototype=undefined;return t}}();r.exports=a},83120:(r,e,t)=>{var n=t(14528),o=t(45891);function a(r,e,t,u,c){var i=-1,f=r.length;t||(t=o);c||(c=[]);while(++i0&&t(s)){if(e>1){a(s,e-1,t,u,c)}else{n(c,s)}}else if(!u){c[c.length]=s}}return c}r.exports=a},20426:r=>{var e=Object.prototype;var t=e.hasOwnProperty;function n(r,e){return r!=null&&t.call(r,e)}r.exports=n},28077:r=>{function e(r,e){return r!=null&&e in Object(r)}r.exports=e},29172:(r,e,t)=>{var n=t(5861),o=t(40346);var a="[object Map]";function u(r){return o(r)&&n(r)==a}r.exports=u},16038:(r,e,t)=>{var n=t(5861),o=t(40346);var a="[object Set]";function u(r){return o(r)&&n(r)==a}r.exports=u},72903:(r,e,t)=>{var n=t(23805),o=t(55527),a=t(90181);var u=Object.prototype;var c=u.hasOwnProperty;function i(r){if(!n(r)){return a(r)}var e=o(r),t=[];for(var u in r){if(!(u=="constructor"&&(e||!c.call(r,u)))){t.push(u)}}return t}r.exports=i},73170:(r,e,t)=>{var n=t(16547),o=t(31769),a=t(30361),u=t(23805),c=t(77797);function i(r,e,t,i){if(!u(r)){return r}e=o(e,r);var f=-1,s=e.length,l=s-1,v=r;while(v!=null&&++f{var n=t(37334),o=t(93243),a=t(83488);var u=!o?a:function(r,e){return o(r,"toString",{configurable:true,enumerable:false,value:n(e),writable:true})};r.exports=u},25160:r=>{function e(r,e,t){var n=-1,o=r.length;if(e<0){e=-e>o?0:o+e}t=t>o?o:t;if(t<0){t+=o}o=e>t?0:t-e>>>0;e>>>=0;var a=Array(o);while(++n{var n=t(31769),o=t(68090),a=t(68969),u=t(77797);function c(r,e){e=n(e,r);r=a(r,e);return r==null||delete r[u(o(e))]}r.exports=c},49653:(r,e,t)=>{var n=t(37828);function o(r){var e=new r.constructor(r.byteLength);new n(e).set(new n(r));return e}r.exports=o},93290:(r,e,t)=>{r=t.nmd(r);var n=t(9325);var o=true&&e&&!e.nodeType&&e;var a=o&&"object"=="object"&&r&&!r.nodeType&&r;var u=a&&a.exports===o;var c=u?n.Buffer:undefined,i=c?c.allocUnsafe:undefined;function f(r,e){if(e){return r.slice()}var t=r.length,n=i?i(t):new r.constructor(t);r.copy(n);return n}r.exports=f},76169:(r,e,t)=>{var n=t(49653);function o(r,e){var t=e?n(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.byteLength)}r.exports=o},73201:r=>{var e=/\w*$/;function t(r){var t=new r.constructor(r.source,e.exec(r));t.lastIndex=r.lastIndex;return t}r.exports=t},93736:(r,e,t)=>{var n=t(51873);var o=n?n.prototype:undefined,a=o?o.valueOf:undefined;function u(r){return a?Object(a.call(r)):{}}r.exports=u},71961:(r,e,t)=>{var n=t(49653);function o(r,e){var t=e?n(r.buffer):r.buffer;return new r.constructor(t,r.byteOffset,r.length)}r.exports=o},23007:r=>{function e(r,e){var t=-1,n=r.length;e||(e=Array(n));while(++t{var n=t(16547),o=t(98598);function a(r,e,t,a){var u=!t;t||(t={});var c=-1,i=e.length;while(++c{var n=t(21791),o=t(4664);function a(r,e){return n(r,o(r),e)}r.exports=a},48948:(r,e,t)=>{var n=t(21791),o=t(86375);function a(r,e){return n(r,o(r),e)}r.exports=a},53138:(r,e,t)=>{var n=t(11331);function o(r){return n(r)?undefined:r}r.exports=o},93243:(r,e,t)=>{var n=t(56110);var o=function(){try{var r=n(Object,"defineProperty");r({},"",{});return r}catch(e){}}();r.exports=o},38816:(r,e,t)=>{var n=t(35970),o=t(56757),a=t(32865);function u(r){return a(o(r,undefined,n),r+"")}r.exports=u},83349:(r,e,t)=>{var n=t(82199),o=t(86375),a=t(37241);function u(r){return n(r,a,o)}r.exports=u},28879:(r,e,t)=>{var n=t(74335);var o=n(Object.getPrototypeOf,Object);r.exports=o},86375:(r,e,t)=>{var n=t(14528),o=t(28879),a=t(4664),u=t(63345);var c=Object.getOwnPropertySymbols;var i=!c?u:function(r){var e=[];while(r){n(e,a(r));r=o(r)}return e};r.exports=i},49326:(r,e,t)=>{var n=t(31769),o=t(72428),a=t(56449),u=t(30361),c=t(30294),i=t(77797);function f(r,e,t){e=n(e,r);var f=-1,s=e.length,l=false;while(++f{var e=Object.prototype;var t=e.hasOwnProperty;function n(r){var e=r.length,n=new r.constructor(e);if(e&&typeof r[0]=="string"&&t.call(r,"index")){n.index=r.index;n.input=r.input}return n}r.exports=n},77199:(r,e,t)=>{var n=t(49653),o=t(76169),a=t(73201),u=t(93736),c=t(71961);var i="[object Boolean]",f="[object Date]",s="[object Map]",l="[object Number]",v="[object RegExp]",p="[object Set]",b="[object String]",y="[object Symbol]";var j="[object ArrayBuffer]",x="[object DataView]",d="[object Float32Array]",h="[object Float64Array]",w="[object Int8Array]",g="[object Int16Array]",O="[object Int32Array]",_="[object Uint8Array]",A="[object Uint8ClampedArray]",S="[object Uint16Array]",m="[object Uint32Array]";function P(r,e,t){var P=r.constructor;switch(e){case j:return n(r);case i:case f:return new P(+r);case x:return o(r,t);case d:case h:case w:case g:case O:case _:case A:case S:case m:return c(r,t);case s:return new P;case l:case b:return new P(r);case v:return a(r);case p:return new P;case y:return u(r)}}r.exports=P},35529:(r,e,t)=>{var n=t(39344),o=t(28879),a=t(55527);function u(r){return typeof r.constructor=="function"&&!a(r)?n(o(r)):{}}r.exports=u},45891:(r,e,t)=>{var n=t(51873),o=t(72428),a=t(56449);var u=n?n.isConcatSpreadable:undefined;function c(r){return a(r)||o(r)||!!(u&&r&&r[u])}r.exports=c},90181:r=>{function e(r){var e=[];if(r!=null){for(var t in Object(r)){e.push(t)}}return e}r.exports=e},56757:(r,e,t)=>{var n=t(91033);var o=Math.max;function a(r,e,t){e=o(e===undefined?r.length-1:e,0);return function(){var a=arguments,u=-1,c=o(a.length-e,0),i=Array(c);while(++u{var n=t(47422),o=t(25160);function a(r,e){return e.length<2?r:n(r,o(e,0,-1))}r.exports=a},32865:(r,e,t)=>{var n=t(19570),o=t(51811);var a=o(n);r.exports=a},51811:r=>{var e=800,t=16;var n=Date.now;function o(r){var o=0,a=0;return function(){var u=n(),c=t-(u-a);a=u;if(c>0){if(++o>=e){return arguments[0]}}else{o=0}return r.apply(undefined,arguments)}}r.exports=o},88055:(r,e,t)=>{var n=t(9999);var o=1,a=4;function u(r){return n(r,o|a)}r.exports=u},37334:r=>{function e(r){return function(){return r}}r.exports=e},35970:(r,e,t)=>{var n=t(83120);function o(r){var e=r==null?0:r.length;return e?n(r,1):[]}r.exports=o},61448:(r,e,t)=>{var n=t(20426),o=t(49326);function a(r,e){return r!=null&&o(r,e,n)}r.exports=a},80631:(r,e,t)=>{var n=t(28077),o=t(49326);function a(r,e){return r!=null&&o(r,e,n)}r.exports=a},83488:r=>{function e(r){return r}r.exports=e},62193:(r,e,t)=>{var n=t(88984),o=t(5861),a=t(72428),u=t(56449),c=t(64894),i=t(3656),f=t(55527),s=t(37167);var l="[object Map]",v="[object Set]";var p=Object.prototype;var b=p.hasOwnProperty;function y(r){if(r==null){return true}if(c(r)&&(u(r)||typeof r=="string"||typeof r.splice=="function"||i(r)||s(r)||a(r))){return!r.length}var e=o(r);if(e==l||e==v){return!r.size}if(f(r)){return!n(r).length}for(var t in r){if(b.call(r,t)){return false}}return true}r.exports=y},87730:(r,e,t)=>{var n=t(29172),o=t(27301),a=t(86009);var u=a&&a.isMap;var c=u?o(u):n;r.exports=c},11331:(r,e,t)=>{var n=t(72552),o=t(28879),a=t(40346);var u="[object Object]";var c=Function.prototype,i=Object.prototype;var f=c.toString;var s=i.hasOwnProperty;var l=f.call(Object);function v(r){if(!a(r)||n(r)!=u){return false}var e=o(r);if(e===null){return true}var t=s.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&f.call(t)==l}r.exports=v},38440:(r,e,t)=>{var n=t(16038),o=t(27301),a=t(86009);var u=a&&a.isSet;var c=u?o(u):n;r.exports=c},37241:(r,e,t)=>{var n=t(70695),o=t(72903),a=t(64894);function u(r){return a(r)?n(r,true):o(r)}r.exports=u},68090:r=>{function e(r){var e=r==null?0:r.length;return e?r[e-1]:undefined}r.exports=e},90179:(r,e,t)=>{var n=t(34932),o=t(9999),a=t(19931),u=t(31769),c=t(21791),i=t(53138),f=t(38816),s=t(83349);var l=1,v=2,p=4;var b=f((function(r,e){var t={};if(r==null){return t}var f=false;e=n(e,(function(e){e=u(e,r);f||(f=e.length>1);return e}));c(r,s(r),t);if(f){t=o(t,l|v|p,i)}var b=e.length;while(b--){a(t,e[b])}return t}));r.exports=b},63560:(r,e,t)=>{var n=t(73170);function o(r,e,t){return r==null?r:n(r,e,t)}r.exports=o},42072:(r,e,t)=>{var n=t(34932),o=t(23007),a=t(56449),u=t(44394),c=t(61802),i=t(77797),f=t(13222);function s(r){if(a(r)){return n(r,i)}return u(r)?[r]:o(c(f(r)))}r.exports=s},21020:(r,e,t)=>{"use strict";var n=t(44914),o=Symbol.for("react.element"),a=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,c=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function f(r,e,t){var n,a={},f=null,s=null;void 0!==t&&(f=""+t);void 0!==e.key&&(f=""+e.key);void 0!==e.ref&&(s=e.ref);for(n in e)u.call(e,n)&&!i.hasOwnProperty(n)&&(a[n]=e[n]);if(r&&r.defaultProps)for(n in e=r.defaultProps,e)void 0===a[n]&&(a[n]=e[n]);return{$$typeof:o,type:r,key:f,ref:s,props:a,_owner:c.current}}e.Fragment=a;e.jsx=f;e.jsxs=f},74848:(r,e,t)=>{"use strict";if(true){r.exports=t(21020)}else{}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9085.5a959b5878e7afd8a878.js.LICENSE.txt b/.venv/share/jupyter/lab/static/9085.5a959b5878e7afd8a878.js.LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..e68557b276e85c5ba9b75686382f339f3e148abe --- /dev/null +++ b/.venv/share/jupyter/lab/static/9085.5a959b5878e7afd8a878.js.LICENSE.txt @@ -0,0 +1,9 @@ +/** + * @license React + * react-jsx-runtime.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/.venv/share/jupyter/lab/static/9123.501219cd782693d6539f.js b/.venv/share/jupyter/lab/static/9123.501219cd782693d6539f.js new file mode 100644 index 0000000000000000000000000000000000000000..a8543817d07727cb306727f8048e9f1389c56c3c --- /dev/null +++ b/.venv/share/jupyter/lab/static/9123.501219cd782693d6539f.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9123],{19123:(i,l,e)=>{e.r(l);e.d(l,{gas:()=>t,gasArm:()=>n});function a(i){var l=[];var e="";var a={".abort":"builtin",".align":"builtin",".altmacro":"builtin",".ascii":"builtin",".asciz":"builtin",".balign":"builtin",".balignw":"builtin",".balignl":"builtin",".bundle_align_mode":"builtin",".bundle_lock":"builtin",".bundle_unlock":"builtin",".byte":"builtin",".cfi_startproc":"builtin",".comm":"builtin",".data":"builtin",".def":"builtin",".desc":"builtin",".dim":"builtin",".double":"builtin",".eject":"builtin",".else":"builtin",".elseif":"builtin",".end":"builtin",".endef":"builtin",".endfunc":"builtin",".endif":"builtin",".equ":"builtin",".equiv":"builtin",".eqv":"builtin",".err":"builtin",".error":"builtin",".exitm":"builtin",".extern":"builtin",".fail":"builtin",".file":"builtin",".fill":"builtin",".float":"builtin",".func":"builtin",".global":"builtin",".gnu_attribute":"builtin",".hidden":"builtin",".hword":"builtin",".ident":"builtin",".if":"builtin",".incbin":"builtin",".include":"builtin",".int":"builtin",".internal":"builtin",".irp":"builtin",".irpc":"builtin",".lcomm":"builtin",".lflags":"builtin",".line":"builtin",".linkonce":"builtin",".list":"builtin",".ln":"builtin",".loc":"builtin",".loc_mark_labels":"builtin",".local":"builtin",".long":"builtin",".macro":"builtin",".mri":"builtin",".noaltmacro":"builtin",".nolist":"builtin",".octa":"builtin",".offset":"builtin",".org":"builtin",".p2align":"builtin",".popsection":"builtin",".previous":"builtin",".print":"builtin",".protected":"builtin",".psize":"builtin",".purgem":"builtin",".pushsection":"builtin",".quad":"builtin",".reloc":"builtin",".rept":"builtin",".sbttl":"builtin",".scl":"builtin",".section":"builtin",".set":"builtin",".short":"builtin",".single":"builtin",".size":"builtin",".skip":"builtin",".sleb128":"builtin",".space":"builtin",".stab":"builtin",".string":"builtin",".struct":"builtin",".subsection":"builtin",".symver":"builtin",".tag":"builtin",".text":"builtin",".title":"builtin",".type":"builtin",".uleb128":"builtin",".val":"builtin",".version":"builtin",".vtable_entry":"builtin",".vtable_inherit":"builtin",".warning":"builtin",".weak":"builtin",".weakref":"builtin",".word":"builtin"};var t={};function n(){e="#";t.al="variable";t.ah="variable";t.ax="variable";t.eax="variableName.special";t.rax="variableName.special";t.bl="variable";t.bh="variable";t.bx="variable";t.ebx="variableName.special";t.rbx="variableName.special";t.cl="variable";t.ch="variable";t.cx="variable";t.ecx="variableName.special";t.rcx="variableName.special";t.dl="variable";t.dh="variable";t.dx="variable";t.edx="variableName.special";t.rdx="variableName.special";t.si="variable";t.esi="variableName.special";t.rsi="variableName.special";t.di="variable";t.edi="variableName.special";t.rdi="variableName.special";t.sp="variable";t.esp="variableName.special";t.rsp="variableName.special";t.bp="variable";t.ebp="variableName.special";t.rbp="variableName.special";t.ip="variable";t.eip="variableName.special";t.rip="variableName.special";t.cs="keyword";t.ds="keyword";t.ss="keyword";t.es="keyword";t.fs="keyword";t.gs="keyword"}function b(){e="@";a.syntax="builtin";t.r0="variable";t.r1="variable";t.r2="variable";t.r3="variable";t.r4="variable";t.r5="variable";t.r6="variable";t.r7="variable";t.r8="variable";t.r9="variable";t.r10="variable";t.r11="variable";t.r12="variable";t.sp="variableName.special";t.lr="variableName.special";t.pc="variableName.special";t.r13=t.sp;t.r14=t.lr;t.r15=t.pc;l.push((function(i,l){if(i==="#"){l.eatWhile(/\w/);return"number"}}))}if(i==="x86"){n()}else if(i==="arm"||i==="armv6"){b()}function r(i,l){var e=false,a;while((a=i.next())!=null){if(a===l&&!e){return false}e=!e&&a==="\\"}return e}function u(i,l){var e=false,a;while((a=i.next())!=null){if(a==="/"&&e){l.tokenize=null;break}e=a==="*"}return"comment"}return{name:"gas",startState:function(){return{tokenize:null}},token:function(i,n){if(n.tokenize){return n.tokenize(i,n)}if(i.eatSpace()){return null}var b,s,c=i.next();if(c==="/"){if(i.eat("*")){n.tokenize=u;return u(i,n)}}if(c===e){i.skipToEnd();return"comment"}if(c==='"'){r(i,'"');return"string"}if(c==="."){i.eatWhile(/\w/);s=i.current().toLowerCase();b=a[s];return b||null}if(c==="="){i.eatWhile(/\w/);return"tag"}if(c==="{"){return"bracket"}if(c==="}"){return"bracket"}if(/\d/.test(c)){if(c==="0"&&i.eat("x")){i.eatWhile(/[0-9a-fA-F]/);return"number"}i.eatWhile(/\d/);return"number"}if(/\w/.test(c)){i.eatWhile(/\w/);if(i.eat(":")){return"tag"}s=i.current().toLowerCase();b=t[s];return b||null}for(var o=0;o{p.d(e,{createInfoServices:()=>t.v});var t=p(25996);var c=p(74888)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9137.179a3c47465e7fb8f067.js b/.venv/share/jupyter/lab/static/9137.179a3c47465e7fb8f067.js new file mode 100644 index 0000000000000000000000000000000000000000..38f400317c376a2fbec079f0df368917ac4e7a57 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9137.179a3c47465e7fb8f067.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9137],{59137:(e,r,t)=>{t.r(r);t.d(r,{css:()=>_,gss:()=>S,keywords:()=>q,less:()=>O,mkCSS:()=>i,sCSS:()=>C});function i(e){e={...K,...e};var r=e.inline;var t=e.tokenHooks,i=e.documentTypes||{},o=e.mediaTypes||{},a=e.mediaFeatures||{},n=e.mediaValueKeywords||{},l=e.propertyKeywords||{},s=e.nonStandardPropertyKeywords||{},c=e.fontProperties||{},d=e.counterDescriptors||{},p=e.colorKeywords||{},u=e.valueKeywords||{},m=e.allowNested,f=e.lineComment,g=e.supportsAtComponent===true,h=e.highlightNonStandardPropertyKeywords!==false;var b,k;function y(e,r){b=r;return e}function w(e,r){var i=e.next();if(t[i]){var o=t[i](e,r);if(o!==false)return o}if(i=="@"){e.eatWhile(/[\w\\\-]/);return y("def",e.current())}else if(i=="="||(i=="~"||i=="|")&&e.eat("=")){return y(null,"compare")}else if(i=='"'||i=="'"){r.tokenize=v(i);return r.tokenize(e,r)}else if(i=="#"){e.eatWhile(/[\w\\\-]/);return y("atom","hash")}else if(i=="!"){e.match(/^\s*\w*/);return y("keyword","important")}else if(/\d/.test(i)||i=="."&&e.eat(/\d/)){e.eatWhile(/[\w.%]/);return y("number","unit")}else if(i==="-"){if(/[\d.]/.test(e.peek())){e.eatWhile(/[\w.%]/);return y("number","unit")}else if(e.match(/^-[\w\\\-]*/)){e.eatWhile(/[\w\\\-]/);if(e.match(/^\s*:/,false))return y("def","variable-definition");return y("variableName","variable")}else if(e.match(/^\w+-/)){return y("meta","meta")}}else if(/[,+>*\/]/.test(i)){return y(null,"select-op")}else if(i=="."&&e.match(/^-?[_a-z][_a-z0-9-]*/i)){return y("qualifier","qualifier")}else if(/[:;{}\[\]\(\)]/.test(i)){return y(null,i)}else if(e.match(/^[\w-.]+(?=\()/)){if(/^(url(-prefix)?|domain|regexp)$/i.test(e.current())){r.tokenize=x}return y("variableName.function","variable")}else if(/[\w\\\-]/.test(i)){e.eatWhile(/[\w\\\-]/);return y("property","word")}else{return y(null,null)}}function v(e){return function(r,t){var i=false,o;while((o=r.next())!=null){if(o==e&&!i){if(e==")")r.backUp(1);break}i=!i&&o=="\\"}if(o==e||!i&&e!=")")t.tokenize=null;return y("string","string")}}function x(e,r){e.next();if(!e.match(/^\s*[\"\')]/,false))r.tokenize=v(")");else r.tokenize=null;return y(null,"(")}function z(e,r,t){this.type=e;this.indent=r;this.prev=t}function j(e,r,t,i){e.context=new z(t,r.indentation()+(i===false?0:r.indentUnit),e.context);return t}function q(e){if(e.context.prev)e.context=e.context.prev;return e.context.type}function _(e,r,t){return O[t.context.type](e,r,t)}function B(e,r,t,i){for(var o=i||1;o>0;o--)t.context=t.context.prev;return _(e,r,t)}function C(e){var r=e.current().toLowerCase();if(u.hasOwnProperty(r))k="atom";else if(p.hasOwnProperty(r))k="keyword";else k="variable"}var O={};O.top=function(e,r,t){if(e=="{"){return j(t,r,"block")}else if(e=="}"&&t.context.prev){return q(t)}else if(g&&/@component/i.test(e)){return j(t,r,"atComponentBlock")}else if(/^@(-moz-)?document$/i.test(e)){return j(t,r,"documentTypes")}else if(/^@(media|supports|(-moz-)?document|import)$/i.test(e)){return j(t,r,"atBlock")}else if(/^@(font-face|counter-style)/i.test(e)){t.stateArg=e;return"restricted_atBlock_before"}else if(/^@(-(moz|ms|o|webkit)-)?keyframes$/i.test(e)){return"keyframes"}else if(e&&e.charAt(0)=="@"){return j(t,r,"at")}else if(e=="hash"){k="builtin"}else if(e=="word"){k="tag"}else if(e=="variable-definition"){return"maybeprop"}else if(e=="interpolation"){return j(t,r,"interpolation")}else if(e==":"){return"pseudo"}else if(m&&e=="("){return j(t,r,"parens")}return t.context.type};O.block=function(e,r,t){if(e=="word"){var i=r.current().toLowerCase();if(l.hasOwnProperty(i)){k="property";return"maybeprop"}else if(s.hasOwnProperty(i)){k=h?"string.special":"property";return"maybeprop"}else if(m){k=r.match(/^\s*:(?:\s|$)/,false)?"property":"tag";return"block"}else{k="error";return"maybeprop"}}else if(e=="meta"){return"block"}else if(!m&&(e=="hash"||e=="qualifier")){k="error";return"block"}else{return O.top(e,r,t)}};O.maybeprop=function(e,r,t){if(e==":")return j(t,r,"prop");return _(e,r,t)};O.prop=function(e,r,t){if(e==";")return q(t);if(e=="{"&&m)return j(t,r,"propBlock");if(e=="}"||e=="{")return B(e,r,t);if(e=="(")return j(t,r,"parens");if(e=="hash"&&!/^#([0-9a-fA-F]{3,4}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(r.current())){k="error"}else if(e=="word"){C(r)}else if(e=="interpolation"){return j(t,r,"interpolation")}return"prop"};O.propBlock=function(e,r,t){if(e=="}")return q(t);if(e=="word"){k="property";return"maybeprop"}return t.context.type};O.parens=function(e,r,t){if(e=="{"||e=="}")return B(e,r,t);if(e==")")return q(t);if(e=="(")return j(t,r,"parens");if(e=="interpolation")return j(t,r,"interpolation");if(e=="word")C(r);return"parens"};O.pseudo=function(e,r,t){if(e=="meta")return"pseudo";if(e=="word"){k="variableName.constant";return t.context.type}return _(e,r,t)};O.documentTypes=function(e,r,t){if(e=="word"&&i.hasOwnProperty(r.current())){k="tag";return t.context.type}else{return O.atBlock(e,r,t)}};O.atBlock=function(e,r,t){if(e=="(")return j(t,r,"atBlock_parens");if(e=="}"||e==";")return B(e,r,t);if(e=="{")return q(t)&&j(t,r,m?"block":"top");if(e=="interpolation")return j(t,r,"interpolation");if(e=="word"){var i=r.current().toLowerCase();if(i=="only"||i=="not"||i=="and"||i=="or")k="keyword";else if(o.hasOwnProperty(i))k="attribute";else if(a.hasOwnProperty(i))k="property";else if(n.hasOwnProperty(i))k="keyword";else if(l.hasOwnProperty(i))k="property";else if(s.hasOwnProperty(i))k=h?"string.special":"property";else if(u.hasOwnProperty(i))k="atom";else if(p.hasOwnProperty(i))k="keyword";else k="error"}return t.context.type};O.atComponentBlock=function(e,r,t){if(e=="}")return B(e,r,t);if(e=="{")return q(t)&&j(t,r,m?"block":"top",false);if(e=="word")k="error";return t.context.type};O.atBlock_parens=function(e,r,t){if(e==")")return q(t);if(e=="{"||e=="}")return B(e,r,t,2);return O.atBlock(e,r,t)};O.restricted_atBlock_before=function(e,r,t){if(e=="{")return j(t,r,"restricted_atBlock");if(e=="word"&&t.stateArg=="@counter-style"){k="variable";return"restricted_atBlock_before"}return _(e,r,t)};O.restricted_atBlock=function(e,r,t){if(e=="}"){t.stateArg=null;return q(t)}if(e=="word"){if(t.stateArg=="@font-face"&&!c.hasOwnProperty(r.current().toLowerCase())||t.stateArg=="@counter-style"&&!d.hasOwnProperty(r.current().toLowerCase()))k="error";else k="property";return"maybeprop"}return"restricted_atBlock"};O.keyframes=function(e,r,t){if(e=="word"){k="variable";return"keyframes"}if(e=="{")return j(t,r,"top");return _(e,r,t)};O.at=function(e,r,t){if(e==";")return q(t);if(e=="{"||e=="}")return B(e,r,t);if(e=="word")k="tag";else if(e=="hash")k="builtin";return"at"};O.interpolation=function(e,r,t){if(e=="}")return q(t);if(e=="{"||e==";")return B(e,r,t);if(e=="word")k="variable";else if(e!="variable"&&e!="("&&e!=")")k="error";return"interpolation"};return{name:e.name,startState:function(){return{tokenize:null,state:r?"block":"top",stateArg:null,context:new z(r?"block":"top",0,null)}},token:function(e,r){if(!r.tokenize&&e.eatSpace())return null;var t=(r.tokenize||w)(e,r);if(t&&typeof t=="object"){b=t[1];t=t[0]}k=t;if(b!="comment")r.state=O[r.state](b,e,r);return k},indent:function(e,r,t){var i=e.context,o=r&&r.charAt(0);var a=i.indent;if(i.type=="prop"&&(o=="}"||o==")"))i=i.prev;if(i.prev){if(o=="}"&&(i.type=="block"||i.type=="top"||i.type=="interpolation"||i.type=="restricted_atBlock")){i=i.prev;a=i.indent}else if(o==")"&&(i.type=="parens"||i.type=="atBlock_parens")||o=="{"&&(i.type=="at"||i.type=="atBlock")){a=Math.max(0,i.indent-t.unit)}}return a},languageData:{indentOnInput:/^\s*\}$/,commentTokens:{line:f,block:{open:"/*",close:"*/"}},autocomplete:P}}}function o(e){var r={};for(var t=0;t{i.r(e);i.d(e,{BidiSpan:()=>jt,BlockInfo:()=>ms,BlockType:()=>Ct,Decoration:()=>kt,Direction:()=>Ft,EditorView:()=>no,GutterMarker:()=>rr,MatchDecorator:()=>Xo,RectangleMarker:()=>Co,ViewPlugin:()=>Ae,ViewUpdate:()=>We,WidgetType:()=>Mt,__test:()=>Wr,closeHoverTooltips:()=>_n,crosshairCursor:()=>xn,drawSelection:()=>Lo,dropCursor:()=>Ko,getDialog:()=>er,getDrawSelectionConfig:()=>Po,getPanel:()=>$n,getTooltip:()=>qn,gutter:()=>cr,gutterLineClass:()=>lr,gutterWidgetClass:()=>ar,gutters:()=>ur,hasHoverTooltips:()=>Kn,highlightActiveLine:()=>hn,highlightActiveLineGutter:()=>Rr,highlightSpecialChars:()=>Zo,highlightTrailingWhitespace:()=>Fr,highlightWhitespace:()=>Nr,hoverTooltip:()=>In,keymap:()=>go,layer:()=>Ro,lineNumberMarkers:()=>Sr,lineNumberWidgetMarker:()=>xr,lineNumbers:()=>Dr,logException:()=>xe,panels:()=>jn,placeholder:()=>un,rectangularSelection:()=>bn,repositionTooltips:()=>Xn,runScopeHandlers:()=>vo,scrollPastEnd:()=>an,showDialog:()=>tr,showPanel:()=>Zn,showTooltip:()=>Ln,tooltips:()=>kn});var s=i(71674);var o=i(23546);var n={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"};var r={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'};var l=typeof navigator!="undefined"&&/Chrome\/(\d+)/.exec(navigator.userAgent);var a=typeof navigator!="undefined"&&/Gecko\/\d+/.test(navigator.userAgent);var h=typeof navigator!="undefined"&&/Mac/.test(navigator.platform);var f=typeof navigator!="undefined"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);var c=h||l&&+l[1]<57;for(var d=0;d<10;d++)n[48+d]=n[96+d]=String(d);for(var d=1;d<=24;d++)n[d+111]="F"+d;for(var d=65;d<=90;d++){n[d]=String.fromCharCode(d+32);r[d]=String.fromCharCode(d)}for(var u in n)if(!r.hasOwnProperty(u))r[u]=n[u];function p(t){var e=c&&(t.ctrlKey||t.altKey||t.metaKey)||f&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified";var i=!e&&t.key||(t.shiftKey?r:n)[t.keyCode]||t.key||"Unidentified";if(i=="Esc")i="Escape";if(i=="Del")i="Delete";if(i=="Left")i="ArrowLeft";if(i=="Up")i="ArrowUp";if(i=="Right")i="ArrowRight";if(i=="Down")i="ArrowDown";return i}var g=i(41107);function m(t){let e;if(t.nodeType==11){e=t.getSelection?t:t.ownerDocument}else{e=t}return e.getSelection()}function w(t,e){return e?t==e||t.contains(e.nodeType!=1?e.parentNode:e):false}function v(t,e){if(!e.anchorNode)return false;try{return w(t,e.anchorNode)}catch(i){return false}}function b(t){if(t.nodeType==3)return P(t,0,t.nodeValue.length).getClientRects();else if(t.nodeType==1)return t.getClientRects();else return[]}function y(t,e,i,s){return i?M(t,e,i,s,-1)||M(t,e,i,s,1):false}function S(t){for(var e=0;;e++){t=t.previousSibling;if(!t)return e}}function x(t){return t.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}function M(t,e,i,s,o){for(;;){if(t==i&&e==s)return true;if(e==(o<0?0:C(t))){if(t.nodeName=="DIV")return false;let i=t.parentNode;if(!i||i.nodeType!=1)return false;e=S(t)+(o<0?0:1);t=i}else if(t.nodeType==1){t=t.childNodes[e+(o<0?-1:0)];if(t.nodeType==1&&t.contentEditable=="false")return false;e=o<0?C(t):0}else{return false}}}function C(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function k(t,e){let i=e?t.left:t.right;return{left:i,right:i,top:t.top,bottom:t.bottom}}function A(t){let e=t.visualViewport;if(e)return{left:0,right:e.width,top:0,bottom:e.height};return{left:0,right:t.innerWidth,top:0,bottom:t.innerHeight}}function D(t,e){let i=e.width/t.offsetWidth;let s=e.height/t.offsetHeight;if(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.width-t.offsetWidth)<1)i=1;if(s>.995&&s<1.005||!isFinite(s)||Math.abs(e.height-t.offsetHeight)<1)s=1;return{scaleX:i,scaleY:s}}function O(t,e,i,s,o,n,r,l){let a=t.ownerDocument,h=a.defaultView||window;for(let f=t,c=false;f&&!c;){if(f.nodeType==1){let t,d=f==a.body;let u=1,p=1;if(d){t=A(h)}else{if(/^(fixed|sticky)$/.test(getComputedStyle(f).position))c=true;if(f.scrollHeight<=f.clientHeight&&f.scrollWidth<=f.clientWidth){f=f.assignedSlot||f.parentNode;continue}let e=f.getBoundingClientRect();({scaleX:u,scaleY:p}=D(f,e));t={left:e.left,right:e.left+f.clientWidth*u,top:e.top,bottom:e.top+f.clientHeight*p}}let g=0,m=0;if(o=="nearest"){if(e.top0&&e.bottom>t.bottom+m)m=e.bottom-t.bottom+r}else if(e.bottom>t.bottom){m=e.bottom-t.bottom+r;if(i<0&&e.top-m0&&e.right>t.right+g)g=e.right-t.right+n}else if(e.right>t.right){g=e.right-t.right+n;if(i<0&&e.leftt.bottom||e.leftt.right)e={left:Math.max(e.left,t.left),right:Math.min(e.right,t.right),top:Math.max(e.top,t.top),bottom:Math.min(e.bottom,t.bottom)};f=f.assignedSlot||f.parentNode}else if(f.nodeType==11){f=f.host}else{break}}}function T(t){let e=t.ownerDocument,i,s;for(let o=t.parentNode;o;){if(o==e.body||i&&s){break}else if(o.nodeType==1){if(!s&&o.scrollHeight>o.clientHeight)s=o;if(!i&&o.scrollWidth>o.clientWidth)i=o;o=o.assignedSlot||o.parentNode}else if(o.nodeType==11){o=o.host}else{break}}return{x:i,y:s}}class E{constructor(){this.anchorNode=null;this.anchorOffset=0;this.focusNode=null;this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?C(e):0),i,Math.min(t.focusOffset,i?C(i):0))}set(t,e,i,s){this.anchorNode=t;this.anchorOffset=e;this.focusNode=i;this.focusOffset=s}}let R=null;function B(t){if(t.setActive)return t.setActive();if(R)return t.focus(R);let e=[];for(let i=t;i;i=i.parentNode){e.push(i,i.scrollTop,i.scrollLeft);if(i==i.ownerDocument)break}t.focus(R==null?{get preventScroll(){R={preventScroll:true};return true}}:undefined);if(!R){R=false;for(let t=0;tMath.max(1,t.scrollHeight-t.clientHeight-4)}function z(t,e){for(let i=t,s=e;;){if(i.nodeType==3&&s>0){return{node:i,offset:s}}else if(i.nodeType==1&&s>0){if(i.contentEditable=="false")return null;i=i.childNodes[s-1];s=C(i)}else if(i.parentNode&&!x(i)){s=S(i);i=i.parentNode}else{return null}}}function I(t,e){for(let i=t,s=e;;){if(i.nodeType==3&&se)return i.domBoundsAround(t,e,a);if(f>=t&&s==-1){s=l;o=a}if(a>e&&i.dom.parentNode==this.dom){n=l;r=h;break}h=f;a=f+i.breakAfter}return{from:o,to:r<0?i+this.length:r,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:n=0?this.children[n].dom:null}}markDirty(t=false){this.flags|=2;this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t)e.flags|=2;if(e.flags&1)return;e.flags|=1;t=false}}setParent(t){if(this.parent!=t){this.parent=t;if(this.flags&7)this.markParentsDirty(true)}}setDOM(t){if(this.dom==t)return;if(this.dom)this.dom.cmView=null;this.dom=t;t.cmView=this}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=K){this.markDirty();for(let s=t;sthis.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter)){this.off=t-this.pos;return this}let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function G(t,e,i,s,o,n,r,l,a){let{children:h}=t;let f=h.length?h[e]:null;let c=n.length?n[n.length-1]:null;let d=c?c.breakAfter:r;if(e==s&&f&&!r&&!d&&n.length<2&&f.merge(i,o,n.length?c:null,i==0,l,a))return;if(s0){if(!r&&n.length&&f.merge(i,f.length,n[0],false,l,0)){f.breakAfter=n.shift().breakAfter}else if(i2);var rt={mac:nt||/Mac/.test($.platform),windows:/Win/.test($.platform),linux:/Linux|X11/.test($.platform),ie:tt,ie_version:J?U.documentMode||6:Z?+Z[1]:Q?+Q[1]:0,gecko:et,gecko_version:et?+(/Firefox\/(\d+)/.exec($.userAgent)||[0,0])[1]:0,chrome:!!it,chrome_version:it?+it[1]:0,ios:nt,android:/Android\b/.test($.userAgent),webkit:st,safari:ot,webkit_version:st?+(/\bAppleWebKit\/(\d+)/.exec($.userAgent)||[0,0])[1]:0,tabSize:U.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const lt=256;class at extends Y{constructor(t){super();this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){if(!this.dom)this.createDOM();if(this.dom.nodeValue!=this.text){if(e&&e.node==this.dom)e.written=true;this.dom.nodeValue=this.text}}reuseDOM(t){if(t.nodeType==3)this.createDOM(t)}merge(t,e,i){if(this.flags&8||i&&(!(i instanceof at)||this.length-(e-t)+i.length>lt||i.flags&8))return false;this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e);this.markDirty();return true}split(t){let e=new at(this.text.slice(t));this.text=this.text.slice(0,t);this.markDirty();e.flags|=this.flags&8;return e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new q(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return ft(this.dom,t,e)}}class ht extends Y{constructor(t,e=[],i=0){super();this.mark=t;this.children=e;this.length=i;for(let s of e)s.setParent(this)}setAttrs(t){V(t);if(this.mark.class)t.className=this.mark.class;if(this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){if(t.nodeName==this.mark.tagName.toUpperCase()){this.setDOM(t);this.flags|=4|2}}sync(t,e){if(!this.dom)this.setDOM(this.setAttrs(document.createElement(this.mark.tagName)));else if(this.flags&4)this.setAttrs(this.dom);super.sync(t,e)}merge(t,e,i,s,o,n){if(i&&(!(i instanceof ht&&i.mark.eq(this.mark))||t&&o<=0||et)e.push(i=t)s=o;i=n;o++}let n=this.length-t;this.length=t;if(s>-1){this.children.length=s;this.markDirty()}return new ht(this.mark,e,n)}domAtPos(t){return ut(this,t)}coordsAt(t,e){return gt(this,t,e)}}function ft(t,e,i){let s=t.nodeValue.length;if(e>s)e=s;let o=e,n=e,r=0;if(e==0&&i<0||e==s&&i>=0){if(!(rt.chrome||rt.gecko)){if(e){o--;r=1}else if(n=0)?0:l.length-1];if(rt.safari&&!r&&a.width==0)a=Array.prototype.find.call(l,(t=>t.width))||a;return r?k(a,r<0):a||null}class ct extends Y{static create(t,e,i){return new ct(t,e,i)}constructor(t,e,i){super();this.widget=t;this.length=e;this.side=i;this.prevWidget=null}split(t){let e=ct.create(this.widget,this.length-t,this.side);this.length-=t;return e}sync(t){if(!this.dom||!this.widget.updateDOM(this.dom,t)){if(this.dom&&this.prevWidget)this.prevWidget.destroy(this.dom);this.prevWidget=null;this.setDOM(this.widget.toDOM(t));if(!this.widget.editable)this.dom.contentEditable="false"}}getSide(){return this.side}merge(t,e,i,s,o,n){if(i&&(!(i instanceof ct)||!this.widget.compare(i.widget)||t>0&&o<=0||e0)?q.before(this.dom):q.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let n=this.side?this.side<0:t>0;for(let r=n?s.length-1:0;;r+=n?-1:1){o=s[r];if(t>0?r==0:r==s.length-1||o.top0?q.before(this.dom):q.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return s.Text.empty}get isHidden(){return true}}at.prototype.children=ct.prototype.children=dt.prototype.children=K;function ut(t,e){let i=t.dom,{children:s}=t,o=0;for(let n=0;on&&e0;n--){let t=s[n-1];if(t.dom.parentNode==i)return t.domAtPos(t.length)}for(let n=o;n0&&e instanceof ht&&o.length&&(s=o[o.length-1])instanceof ht&&s.mark.eq(e.mark)){pt(s,e.children[0],i-1)}else{o.push(e);e.setParent(t)}t.length+=e.length}function gt(t,e,i){let s=null,o=-1,n=null,r=-1;function l(t,e){for(let a=0,h=0;a=e){if(f.children.length){l(f,e-h)}else if((!n||n.isHidden&&(i>0||wt(n,f)))&&(c>e||h==c&&f.getSide()>0)){n=f;r=e-h}else if(h-1?1:0)!=o.length-(i&&o.indexOf(i)>-1?1:0))return false;for(let n of s){if(n!=i&&(o.indexOf(n)==-1||t[n]!==e[n]))return false}return true}function St(t,e,i){let s=false;if(e)for(let o in e)if(!(i&&o in i)){s=true;if(o=="style")t.style.cssText="";else t.removeAttribute(o)}if(i)for(let o in i)if(!(e&&e[o]==i[o])){s=true;if(o=="style")t.style.cssText=i[o];else t.setAttribute(o,i[o])}return s}function xt(t){let e=Object.create(null);for(let i=0;i0?3e8:-4e8:e>0?1e8:-1e8;return new Ot(t,e,e,i,t.widget||null,false)}static replace(t){let e=!!t.block,i,s;if(t.isBlockGap){i=-5e8;s=4e8}else{let{start:o,end:n}=Tt(t,e);i=(o?e?-3e8:-1:5e8)-1;s=(n?e?2e8:1:-6e8)+1}return new Ot(t,i,s,e,t.widget||null,true)}static line(t){return new Dt(t)}static set(t,e=false){return s.RangeSet.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:false}}kt.none=s.RangeSet.empty;class At extends kt{constructor(t){let{start:e,end:i}=Tt(t);super(e?-1:5e8,i?1:-6e8,null,t);this.tagName=t.tagName||"span";this.class=t.class||"";this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof At&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&yt(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}At.prototype.point=false;class Dt extends kt{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof Dt&&this.spec.class==t.spec.class&&yt(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}Dt.prototype.mapMode=s.MapMode.TrackBefore;Dt.prototype.point=true;class Ot extends kt{constructor(t,e,i,o,n,r){super(e,i,n,t);this.block=o;this.isReplace=r;this.mapMode=!o?s.MapMode.TrackDel:e<=0?s.MapMode.TrackBefore:s.MapMode.TrackAfter}get type(){return this.startSide!=this.endSide?Ct.WidgetRange:this.startSide<=0?Ct.WidgetBefore:Ct.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof Ot&&Et(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}Ot.prototype.point=true;function Tt(t,e=false){let{inclusiveStart:i,inclusiveEnd:s}=t;if(i==null)i=t.inclusive;if(s==null)s=t.inclusive;return{start:i!==null&&i!==void 0?i:e,end:s!==null&&s!==void 0?s:e}}function Et(t,e){return t==e||!!(t&&e&&t.compare(e))}function Rt(t,e,i,s=0){let o=i.length-1;if(o>=0&&i[o]+s>=t)i[o]=Math.max(i[o],e);else i.push(t,e)}class Bt extends Y{constructor(){super(...arguments);this.children=[];this.length=0;this.prevAttrs=undefined;this.attrs=null;this.breakAfter=0}merge(t,e,i,s,o,n){if(i){if(!(i instanceof Bt))return false;if(!this.dom)i.transferDOM(this)}if(s)this.setDeco(i?i.attrs:null);j(this,t,e,i?i.children.slice():[],o,n);return true}split(t){let e=new Bt;e.breakAfter=this.breakAfter;if(this.length==0)return e;let{i,off:s}=this.childPos(t);if(s){e.append(this.children[i].split(s),0);this.children[i].merge(s,this.children[i].length,null,false,0,0);i++}for(let o=i;o0&&this.children[i-1].length==0)this.children[--i].destroy();this.children.length=i;this.markDirty();this.length=t;return e}transferDOM(t){if(!this.dom)return;this.markDirty();t.setDOM(this.dom);t.prevAttrs=this.prevAttrs===undefined?this.attrs:this.prevAttrs;this.prevAttrs=undefined;this.dom=null}setDeco(t){if(!yt(this.attrs,t)){if(this.dom){this.prevAttrs=this.attrs;this.markDirty()}this.attrs=t}}append(t,e){pt(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;if(e)this.attrs=vt(e,this.attrs||{});if(i)this.attrs=vt({class:i},this.attrs||{})}domAtPos(t){return ut(this,t)}reuseDOM(t){if(t.nodeName=="DIV"){this.setDOM(t);this.flags|=4|2}}sync(t,e){var i;if(!this.dom){this.setDOM(document.createElement("div"));this.dom.className="cm-line";this.prevAttrs=this.attrs?null:undefined}else if(this.flags&4){V(this.dom);this.dom.className="cm-line";this.prevAttrs=this.attrs?null:undefined}if(this.prevAttrs!==undefined){St(this.dom,this.prevAttrs,this.attrs);this.dom.classList.add("cm-line");this.prevAttrs=undefined}super.sync(t,e);let s=this.dom.lastChild;while(s&&Y.get(s)instanceof ht)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((i=Y.get(s))===null||i===void 0?void 0:i.isEditable)==false&&(!rt.ios||!this.children.some((t=>t instanceof at)))){let t=document.createElement("BR");t.cmIgnore=true;this.dom.appendChild(t)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof at)||/[^ -~]/.test(i.text))return null;let s=b(i.dom);if(s.length!=1)return null;t+=s[0].width;e=s[0].height}return!t?null:{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}}coordsAt(t,e){let i=gt(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:t}=this.parent.view.viewState,e=i.bottom-i.top;if(Math.abs(e-t.lineHeight)<2&&t.textHeight=e){if(o instanceof Bt)return o;if(n>e)break}s=n+o.breakAfter}return null}}class Lt extends Y{constructor(t,e,i){super();this.widget=t;this.length=e;this.deco=i;this.breakAfter=0;this.prevWidget=null}merge(t,e,i,s,o,n){if(i&&(!(i instanceof Lt)||!this.widget.compare(i.widget)||t>0&&o<=0||e0}}class Pt extends Mt{constructor(t){super();this.height=t}toDOM(){let t=document.createElement("div");t.className="cm-gap";this.updateDOM(t);return t}eq(t){return t.height==this.height}updateDOM(t){t.style.height=this.height+"px";return true}get editable(){return true}get estimatedHeight(){return this.height}ignoreEvent(){return false}}class Ht{constructor(t,e,i,s){this.doc=t;this.pos=e;this.end=i;this.disallowBlockEffectsFor=s;this.content=[];this.curLine=null;this.breakAtStart=0;this.pendingBuffer=0;this.bufferMarks=[];this.atCursorPos=true;this.openStart=-1;this.openEnd=-1;this.text="";this.textOff=0;this.cursor=t.iter();this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Lt&&t.deco.endSide<0)}getLine(){if(!this.curLine){this.content.push(this.curLine=new Bt);this.atCursorPos=true}return this.curLine}flushBuffer(t=this.bufferMarks){if(this.pendingBuffer){this.curLine.append(Nt(new dt(-1),t),t.length);this.pendingBuffer=0}}addBlockWidget(t){this.flushBuffer();this.curLine=null;this.content.push(t)}finish(t){if(this.pendingBuffer&&t<=this.bufferMarks.length)this.flushBuffer();else this.pendingBuffer=0;if(!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof Lt))this.getLine()}buildText(t,e,i){while(t>0){if(this.textOff==this.text.length){let{value:e,lineBreak:i,done:s}=this.cursor.next(this.skip);this.skip=0;if(s)throw new Error("Ran out of text content when drawing inline views");if(i){if(!this.posCovered())this.getLine();if(this.content.length)this.content[this.content.length-1].breakAfter=1;else this.breakAtStart=1;this.flushBuffer();this.curLine=null;this.atCursorPos=true;t--;continue}else{this.text=e;this.textOff=0}}let s=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i));this.getLine().append(Nt(new at(this.text.slice(this.textOff,this.textOff+s)),e),i);this.atCursorPos=true;this.textOff+=s;t-=s;i=0}}span(t,e,i,s){this.buildText(e-t,i,s);this.pos=e;if(this.openStart<0)this.openStart=s}point(t,e,i,s,o,n){if(this.disallowBlockEffectsFor[n]&&i instanceof Ot){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let r=e-t;if(i instanceof Ot){if(i.block){if(i.startSide>0&&!this.posCovered())this.getLine();this.addBlockWidget(new Lt(i.widget||Vt.block,r,i))}else{let n=ct.create(i.widget||Vt.inline,r,r?0:i.startSide);let l=this.atCursorPos&&!n.isEditable&&o<=s.length&&(t0);let a=!n.isEditable&&(ts.length||i.startSide<=0);let h=this.getLine();if(this.pendingBuffer==2&&!l&&!n.isEditable)this.pendingBuffer=0;this.flushBuffer(s);if(l){h.append(Nt(new dt(1),s),o);o=s.length+Math.max(0,o-s.length)}h.append(Nt(n,s),o);this.atCursorPos=a;this.pendingBuffer=!a?0:ts.length?1:2;if(this.pendingBuffer)this.bufferMarks=s.slice()}}else if(this.doc.lineAt(this.pos).from==this.pos){this.getLine().addLineDeco(i)}if(r){if(this.textOff+r<=this.text.length){this.textOff+=r}else{this.skip+=r-(this.text.length-this.textOff);this.text="";this.textOff=0}this.pos=e}if(this.openStart<0)this.openStart=o}static build(t,e,i,o,n){let r=new Ht(t,e,i,n);r.openEnd=s.RangeSet.spans(o,e,i,r);if(r.openStart<0)r.openStart=r.openEnd;r.finish(r.openEnd);return r}}function Nt(t,e){for(let i of e)t=new ht(i,[t],t.length);return t}class Vt extends Mt{constructor(t){super();this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return true}}Vt.inline=new Vt("span");Vt.block=new Vt("div");var Ft=function(t){t[t["LTR"]=0]="LTR";t[t["RTL"]=1]="RTL";return t}(Ft||(Ft={}));const Wt=Ft.LTR,zt=Ft.RTL;function It(t){let e=[];for(let i=0;i=e){if(r.level==i)return n;if(o<0||(s!=0?s<0?r.frome:t[o].level>r.level))o=n}}if(o<0)throw new RangeError("Index out of range");return o}}function $t(t,e){if(t.length!=e.length)return false;for(let i=0;i=0;t-=3){if(_t[t+1]==-s){let i=_t[t+2];let s=i&2?o:!(i&4)?0:i&1?n:o;if(s)Ut[e]=Ut[_t[t]]=s;l=t;break}}}else if(_t.length==189){break}else{_t[l++]=e;_t[l++]=i;_t[l++]=a}}else if((r=Ut[e])==2||r==1){let t=r==o;a=t?0:1;for(let e=l-3;e>=0;e-=3){let i=_t[e+2];if(i&2)break;if(t){_t[e+2]|=2}else{if(i&4)break;_t[e+2]|=4}}}}}}function Zt(t,e,i,s){for(let o=0,n=s;o<=i.length;o++){let r=o?i[o-1].to:t,l=oa;){if(e==n){e=i[--s].from;n=s?i[s-1].to:t}Ut[--e]=c}a=r}else{n=r;a++}}}}function te(t,e,i,s,o,n,r){let l=s%2?2:1;if(s%2==o%2){for(let a=e,h=0;aa)r.push(new jt(a,p.from,d));let e=p.direction==Wt!=!(d%2);ee(t,e?s+1:s,o,p.inner,p.from,p.to,r);a=p.to}u=p.to}else if(u==i||(e?Ut[u]!=l:Ut[u]==l)){break}else{u++}}if(c)te(t,a,u,s+1,o,c,r);else if(ae;){let i=true,f=false;if(!h||a>n[h-1].to){let t=Ut[a-1];if(t!=l){i=false;f=t==16}}let c=!i&&l==1?[]:null;let d=i?s:s+1;let u=a;t:for(;;){if(h&&u==n[h-1].to){if(f)break t;let p=n[--h];if(!i)for(let t=p.from,i=h;;){if(t==e)break t;if(i&&n[i-1].to==t)t=n[--i].from;else if(Ut[t-1]==l)break t;else break}if(c){c.push(p)}else{if(p.toUt.length)Ut[Ut.length]=256;let s=[],o=e==Wt?0:1;ee(t,o,o,i,0,t.length,s);return s}function se(t){return[new jt(0,t,0)]}let oe="";function ne(t,e,i,o,n){var r;let l=o.head-t.from;let a=jt.find(e,l,(r=o.bidiLevel)!==null&&r!==void 0?r:-1,o.assoc);let h=e[a],f=h.side(n,i);if(l==f){let t=a+=n?1:-1;if(t<0||t>=e.length)return null;h=e[a=t];l=h.side(!n,i);f=h.side(n,i)}let c=(0,s.findClusterBreak)(t.text,l,h.forward(n,i));if(ch.to)c=f;oe=t.text.slice(Math.min(l,c),Math.max(l,c));let d=a==(n?e.length-1:0)?null:e[a+(n?1:-1)];if(d&&c==f&&d.level+(n?0:1)t.some((t=>t))});const we=s.Facet.define({combine:t=>t.some((t=>t))});const ve=s.Facet.define();class be{constructor(t,e="nearest",i="nearest",s=5,o=5,n=false){this.range=t;this.y=e;this.x=i;this.yMargin=s;this.xMargin=o;this.isSnapshot=n}map(t){return t.empty?this:new be(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new be(s.EditorSelection.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const ye=s.StateEffect.define({map:(t,e)=>t.map(e)});const Se=s.StateEffect.define();function xe(t,e,i){let s=t.facet(fe);if(s.length)s[0](e);else if(window.onerror&&window.onerror(String(e),i,undefined,undefined,e));else if(i)console.error(i+":",e);else console.error(e)}const Me=s.Facet.define({combine:t=>t.length?t[0]:true});let Ce=0;const ke=s.Facet.define({combine(t){return t.filter(((e,i)=>{for(let s=0;s{let e=[];if(n)e.push(Ee.of((e=>{let i=e.plugin(t);return i?n(i):kt.none})));if(o)e.push(o(t));return e}))}static fromClass(t,e){return Ae.define(((e,i)=>new t(e,i)),e)}}class De{constructor(t){this.spec=t;this.mustUpdate=null;this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(t){if(!this.value){if(this.spec){try{this.value=this.spec.plugin.create(t,this.spec.arg)}catch(e){xe(t.state,e,"CodeMirror plugin crashed");this.deactivate()}}}else if(this.mustUpdate){let t=this.mustUpdate;this.mustUpdate=null;if(this.value.update){try{this.value.update(t)}catch(e){xe(t.state,e,"CodeMirror plugin crashed");if(this.value.destroy)try{this.value.destroy()}catch(i){}this.deactivate()}}}return this}destroy(t){var e;if((e=this.value)===null||e===void 0?void 0:e.destroy){try{this.value.destroy()}catch(i){xe(t.state,i,"CodeMirror plugin crashed")}}}deactivate(){this.spec=this.value=null}}const Oe=s.Facet.define();const Te=s.Facet.define();const Ee=s.Facet.define();const Re=s.Facet.define();const Be=s.Facet.define();const Le=s.Facet.define();function Pe(t,e){let i=t.state.facet(Le);if(!i.length)return i;let o=i.map((e=>e instanceof Function?e(t):e));let n=[];s.RangeSet.spans(o,e.from,e.to,{point(){},span(t,i,s,o){let r=t-e.from,l=i-e.from;let a=n;for(let n=s.length-1;n>=0;n--,o--){let t=s[n].spec.bidiIsolate,i;if(t==null)t=re(e.text,r,l);if(o>0&&a.length&&(i=a[a.length-1]).to==r&&i.direction==t){i.to=l;a=i.inner}else{let e={from:r,to:l,direction:t,inner:[]};a.push(e);a=e.inner}}}});return n}const He=s.Facet.define();function Ne(t){let e=0,i=0,s=0,o=0;for(let n of t.state.facet(He)){let r=n(t);if(r){if(r.left!=null)e=Math.max(e,r.left);if(r.right!=null)i=Math.max(i,r.right);if(r.top!=null)s=Math.max(s,r.top);if(r.bottom!=null)o=Math.max(o,r.bottom)}}return{left:e,right:i,top:s,bottom:o}}const Ve=s.Facet.define();class Fe{constructor(t,e,i,s){this.fromA=t;this.toA=e;this.fromB=i;this.toB=s}join(t){return new Fe(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let s=t[e-1];if(s.fromA>i.toA)continue;if(s.toAh)break;else o+=2}if(!l)return i;new Fe(l.fromA,l.toA,l.fromB,l.toB).addToSet(i);n=l.toA;r=l.toB}}}class We{constructor(t,e,i){this.view=t;this.state=e;this.transactions=i;this.flags=0;this.startState=t.state;this.changes=s.ChangeSet.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let o=[];this.changes.iterChangedRanges(((t,e,i,s)=>o.push(new Fe(t,e,i,s))));this.changedRanges=o}static create(t,e,i){return new We(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&(16|2))>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((t=>t.selection))}get empty(){return this.flags==0&&this.transactions.length==0}}class ze extends Y{get length(){return this.view.state.doc.length}constructor(t){super();this.view=t;this.decorations=[];this.dynamicDecorationMap=[false];this.domChanged=null;this.hasComposition=null;this.markedForComposition=new Set;this.editContextFormatting=kt.none;this.lastCompositionAfterCursor=false;this.minWidth=0;this.minWidthFrom=0;this.minWidthTo=0;this.impreciseAnchor=null;this.impreciseHead=null;this.forceSelection=false;this.lastUpdate=Date.now();this.setDOM(t.contentDOM);this.children=[new Bt];this.children[0].setParent(this);this.updateDeco();this.updateInner([new Fe(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;if(this.minWidth>0&&i.length){if(!i.every((({fromA:t,toA:e})=>ethis.minWidthTo))){this.minWidth=this.minWidthFrom=this.minWidthTo=0}else{this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1);this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)}}this.updateEditContextFormatting(t);let s=-1;if(this.view.inputState.composing>=0&&!this.view.observer.editContext){if((e=this.domChanged)===null||e===void 0?void 0:e.newSel)s=this.domChanged.newSel.head;else if(!je(t.changes,this.hasComposition)&&!t.selectionSet)s=t.state.selection.main.head}let o=s>-1?Ke(this.view,t.changes,s):null;this.domChanged=null;if(this.hasComposition){this.markedForComposition.clear();let{from:e,to:s}=this.hasComposition;i=new Fe(e,s,t.changes.mapPos(e,-1),t.changes.mapPos(s,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null;if((rt.ie||rt.chrome)&&!o&&t&&t.state.doc.lines!=t.startState.doc.lines)this.forceSelection=true;let n=this.decorations,r=this.updateDeco();let l=Xe(n,r,t.changes);i=Fe.extendWithRanges(i,l);if(!(this.flags&7)&&i.length==0){return false}else{this.updateInner(i,t.startState.doc.length,o);if(t.transactions.length)this.lastUpdate=Date.now();return true}}updateInner(t,e,i){this.view.viewState.mustMeasureContent=true;this.updateChildren(t,e,i);let{observer:s}=this.view;s.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px";this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let t=rt.chrome||rt.ios?{node:s.selectionRange.focusNode,written:false}:undefined;this.sync(this.view,t);this.flags&=~7;if(t&&(t.written||s.selectionRange.focusNode!=t.node))this.forceSelection=true;this.dom.style.height=""}));this.markedForComposition.forEach((t=>t.flags&=~8));let o=[];if(this.view.viewport.from||this.view.viewport.to=0?s[n]:null;if(!t)break;let{fromA:e,toA:r,fromB:l,toB:a}=t,h,f,c,d;if(i&&i.range.fromBl){let t=Ht.build(this.view.state.doc,l,i.range.fromB,this.decorations,this.dynamicDecorationMap);let e=Ht.build(this.view.state.doc,i.range.toB,a,this.decorations,this.dynamicDecorationMap);f=t.breakAtStart;c=t.openStart;d=e.openEnd;let s=this.compositionView(i);if(e.breakAtStart){s.breakAfter=1}else if(e.content.length&&s.merge(s.length,s.length,e.content[0],false,e.openStart,0)){s.breakAfter=e.content[0].breakAfter;e.content.shift()}if(t.content.length&&s.merge(0,0,t.content[t.content.length-1],true,0,t.openEnd)){t.content.pop()}h=t.content.concat(s).concat(e.content)}else{({content:h,breakAtStart:f,openStart:c,openEnd:d}=Ht.build(this.view.state.doc,l,a,this.decorations,this.dynamicDecorationMap))}let{i:u,off:p}=o.findPos(r,1);let{i:g,off:m}=o.findPos(e,-1);G(this,g,m,u,p,h,f,c,d)}if(i)this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let t of e.effects)if(t.is(Se)){this.editContextFormatting=t.value}}compositionView(t){let e=new at(t.text.nodeValue);e.flags|=8;for(let{deco:s}of t.marks)e=new ht(s,[e],e.length);let i=new Bt;i.append(e,0);return i}fixCompositionDOM(t){let e=(t,e)=>{e.flags|=8|(e.children.some((t=>t.flags&7))?1:0);this.markedForComposition.add(e);let i=Y.get(t);if(i&&i!=e)i.dom=null;e.setDOM(t)};let i=this.childPos(t.range.fromB,1);let s=this.children[i.i];e(t.line,s);for(let o=t.marks.length-1;o>=-1;o--){i=s.childPos(i.off,1);s=s.children[i.i];e(o>=0?t.marks[o].node:t.text,s)}}updateSelection(t=false,e=false){if(t||!this.view.observer.selectionRange.focusNode)this.view.observer.readSelectionRange();let i=this.view.root.activeElement,s=i==this.dom;let o=!s&&!(this.view.state.facet(Me)||this.dom.tabIndex>-1)&&v(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(s||e||o))return;let n=this.forceSelection;this.forceSelection=false;let r=this.view.state.selection.main;let l=this.moveToLine(this.domAtPos(r.anchor));let a=r.empty?l:this.moveToLine(this.domAtPos(r.head));if(rt.gecko&&r.empty&&!this.hasComposition&&Ie(l)){let t=document.createTextNode("");this.view.observer.ignore((()=>l.node.insertBefore(t,l.node.childNodes[l.offset]||null)));l=a=new q(t,0);n=true}let h=this.view.observer.selectionRange;if(n||!h.focusNode||(!y(l.node,l.offset,h.anchorNode,h.anchorOffset)||!y(a.node,a.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,r)){this.view.observer.ignore((()=>{if(rt.android&&rt.chrome&&this.dom.contains(h.focusNode)&&Ge(h.focusNode,this.dom)){this.dom.blur();this.dom.focus({preventScroll:true})}let t=m(this.view.root);if(!t);else if(r.empty){if(rt.gecko){let t=Ye(l.node,l.offset);if(t&&t!=(1|2)){let e=(t==1?z:I)(l.node,l.offset);if(e)l=new q(e.node,e.offset)}}t.collapse(l.node,l.offset);if(r.bidiLevel!=null&&t.caretBidiLevel!==undefined)t.caretBidiLevel=r.bidiLevel}else if(t.extend){t.collapse(l.node,l.offset);try{t.extend(a.node,a.offset)}catch(e){}}else{let e=document.createRange();if(r.anchor>r.head)[l,a]=[a,l];e.setEnd(a.node,a.offset);e.setStart(l.node,l.offset);t.removeAllRanges();t.addRange(e)}if(o&&this.view.root.activeElement==this.dom){this.dom.blur();if(i)i.focus()}}));this.view.observer.setSelectionRange(l,a)}this.impreciseAnchor=l.precise?null:new q(h.anchorNode,h.anchorOffset);this.impreciseHead=a.precise?null:new q(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&y(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main;let i=m(t.root);let{anchorNode:s,anchorOffset:o}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let n=Bt.find(this,e.head);if(!n)return;let r=n.posAtStart;if(e.head==r||e.head==r+n.length)return;let l=this.coordsAt(e.head,-1),a=this.coordsAt(e.head,1);if(!l||!a||l.bottom>a.top)return;let h=this.domAtPos(e.head+e.assoc);i.collapse(h.node,h.offset);i.modify("move",e.assoc<0?"forward":"backward","lineboundary");t.observer.readSelectionRange();let f=t.observer.selectionRange;if(t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from)i.collapse(s,o)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let s=t.offset;!i&&s=0;s--){let t=Y.get(e.childNodes[s]);if(t instanceof Bt)i=t.domAtPos(t.length)}return i?new q(i.node,i.offset,true):t}nearest(t){for(let e=t;e;){let t=Y.get(e);if(t&&t.rootView==this)return t;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=0;n--){let r=this.children[n],l=o-r.breakAfter,a=l-r.length;if(lt||r.covers(1))&&(!i||r instanceof Bt&&!(i instanceof Bt&&e>=0))){i=r;s=a}else if(i&&a==t&&l==t&&r instanceof Lt&&Math.abs(e)<2){if(r.deco.startSide<0)break;else if(n)i=null}o=a}return i?i.coordsAt(t-s,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),o=this.children[e];if(!(o instanceof Bt))return null;while(o.children.length){let{i:t,off:e}=o.childPos(i,1);for(;;t++){if(t==o.children.length)return null;if((o=o.children[t]).length)break}i=e}if(!(o instanceof at))return null;let n=(0,s.findClusterBreak)(o.text,i);if(n==i)return null;let r=P(o.dom,i,n).getClientRects();for(let s=0;sMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1;let r=-1,l=this.view.textDirection==Ft.LTR;for(let a=0,h=0;hs)break;if(a>=i){let i=t.dom.getBoundingClientRect();e.push(i.height);if(n){let e=t.dom.lastChild;let s=e?b(e):[];if(s.length){let t=s[s.length-1];let e=l?t.right-i.left:i.right-t.left;if(e>r){r=e;this.minWidth=o;this.minWidthFrom=a;this.minWidthTo=f}}}}a=f+t.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?Ft.RTL:Ft.LTR}measureTextSize(){for(let o of this.children){if(o instanceof Bt){let t=o.measureTextSize();if(t)return t}}let t=document.createElement("div"),e,i,s;t.className="cm-line";t.style.width="99999px";t.style.position="absolute";t.textContent="abc def ghi jkl mno pqr stu";this.view.observer.ignore((()=>{this.dom.appendChild(t);let o=b(t.firstChild)[0];e=t.getBoundingClientRect().height;i=o?o.width/27:7;s=o?o.height:e;t.remove()}));return{lineHeight:e,charWidth:i,textHeight:s}}childCursor(t=this.length){let e=this.children.length;if(e)t-=this.children[--e].length;return new X(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,s=0;;s++){let o=s==e.viewports.length?null:e.viewports[s];let n=o?o.from-1:this.length;if(n>i){let s=(e.lineBlockAt(n).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(kt.replace({widget:new Pt(s),block:true,inclusive:true,isBlockGap:true}).range(i,n))}if(!o)break;i=o.to+1}return kt.set(t)}updateDeco(){let t=1;let e=this.view.state.facet(Ee).map((e=>{let i=this.dynamicDecorationMap[t++]=typeof e=="function";return i?e(this.view):e}));let i=false,o=this.view.state.facet(Re).map(((t,e)=>{let s=typeof t=="function";if(s)i=true;return s?t(this.view):t}));if(o.length){this.dynamicDecorationMap[t++]=i;e.push(s.RangeSet.join(o))}this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];while(te.anchor?-1:1),s;if(!i)return;if(!e.empty&&(s=this.coordsAt(e.anchor,e.anchor>e.head?-1:1)))i={left:Math.min(i.left,s.left),top:Math.min(i.top,s.top),right:Math.max(i.right,s.right),bottom:Math.max(i.bottom,s.bottom)};let o=Ne(this.view);let n={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom};let{offsetWidth:r,offsetHeight:l}=this.view.scrollDOM;O(this.view.scrollDOM,n,e.head{if(te.from)i=true}));return i}function $e(t,e,i=1){let o=t.charCategorizer(e);let n=t.doc.lineAt(e),r=e-n.from;if(n.length==0)return s.EditorSelection.cursor(e);if(r==0)i=1;else if(r==n.length)i=-1;let l=r,a=r;if(i<0)l=(0,s.findClusterBreak)(n.text,r,false);else a=(0,s.findClusterBreak)(n.text,r);let h=o(n.text.slice(l,a));while(l>0){let t=(0,s.findClusterBreak)(n.text,l,false);if(o(n.text.slice(t,l))!=h)break;l=t}while(at?e.left-t:Math.max(0,t-e.right)}function Qe(t,e){return e.top>t?e.top-t:Math.max(0,t-e.bottom)}function Je(t,e){return t.tope.top+1}function Ze(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ei(t,e,i){let s,o,n,r,l=false;let a,h,f,c;for(let p=t.firstChild;p;p=p.nextSibling){let t=b(p);for(let d=0;dm||r==m&&n>g){s=p;o=u;n=g;r=m;l=!g?true:e0:du.bottom&&(!f||f.bottomu.top)){h=p;c=u}}else if(f&&Je(f,u)){f=ti(f,u.bottom)}else if(c&&Je(c,u)){c=Ze(c,u.top)}}}if(f&&f.bottom>=i){s=a;o=f}else if(c&&c.top<=i){s=h;o=c}if(!s)return{node:t,offset:0};let d=Math.max(o.left,Math.min(o.right,e));if(s.nodeType==3)return ii(s,d,i);if(l&&s.contentEditable!="false")return ei(s,d,i);let u=Array.prototype.indexOf.call(t.childNodes,s)+(e>=(o.left+o.right)/2?1:0);return{node:t,offset:u}}function ii(t,e,i){let s=t.nodeValue.length;let o=-1,n=1e9,r=0;for(let l=0;li?h.top-i:i-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&f=(h.left+h.right)/2,s=i;if(rt.chrome||rt.gecko){let e=P(t,l).getBoundingClientRect();if(e.left==h.right)s=!i}if(f<=0)return{node:t,offset:l+(s?1:0)};o=l+(s?1:0);n=f}}}return{node:t,offset:o>-1?o:r>0?t.nodeValue.length:0}}function si(t,e,i,s=-1){var o,n;let r=t.contentDOM.getBoundingClientRect(),l=r.top+t.viewState.paddingTop;let a,{docHeight:h}=t.viewState;let{x:f,y:c}=e,d=c-l;if(d<0)return 0;if(d>h)return t.state.doc.length;for(let y=t.viewState.heightOracle.textHeight/2,S=false;;){a=t.elementAtHeight(d);if(a.type==Ct.Text)break;for(;;){d=s>0?a.bottom+y:a.top-y;if(d>=0&&d<=h)break;if(S)return i?null:0;S=true;s=-s}}c=l+d;let u=a.from;if(ut.viewport.to)return t.viewport.to==t.state.doc.length?t.state.doc.length:i?null:oi(t,r,a,f,c);let p=t.dom.ownerDocument;let g=t.root.elementFromPoint?t.root:p;let m=g.elementFromPoint(f,c);if(m&&!t.contentDOM.contains(m))m=null;if(!m){f=Math.max(r.left+1,Math.min(r.right-1,f));m=g.elementFromPoint(f,c);if(m&&!t.contentDOM.contains(m))m=null}let w,v=-1;if(m&&((o=t.docView.nearest(m))===null||o===void 0?void 0:o.isEditable)!=false){if(p.caretPositionFromPoint){let t=p.caretPositionFromPoint(f,c);if(t)({offsetNode:w,offset:v}=t)}else if(p.caretRangeFromPoint){let e=p.caretRangeFromPoint(f,c);if(e){({startContainer:w,startOffset:v}=e);if(!t.contentDOM.contains(w)||rt.safari&&ni(w,v,f)||rt.chrome&&ri(w,v,f))w=undefined}}if(w)v=Math.min(C(w),v)}if(!w||!t.docView.dom.contains(w)){let e=Bt.find(t.docView,u);if(!e)return d>a.top+a.height/2?a.to:a.from;({node:w,offset:v}=ei(e.dom,f,c))}let b=t.docView.nearest(w);if(!b)return null;if(b.isWidget&&((n=b.dom)===null||n===void 0?void 0:n.nodeType)==1){let t=b.dom.getBoundingClientRect();return e.yt.defaultLineHeight*1.5){let e=t.viewState.heightOracle.textHeight;let s=Math.floor((n-i.top-(t.defaultLineHeight-e)*.5)/e);r+=s*t.viewState.heightOracle.lineLength}let l=t.state.sliceDoc(i.from,i.to);return i.from+(0,s.findColumn)(l,r,t.state.tabSize)}function ni(t,e,i){let s,o=t;if(t.nodeType!=3||e!=(s=t.nodeValue.length))return false;for(;;){let t=o.nextSibling;if(t){if(t.nodeName=="BR")break;return false}else{let t=o.parentNode;if(!t||t.nodeName=="DIV")break;o=t}}return P(t,s-1,s).getBoundingClientRect().right>i}function ri(t,e,i){if(e!=0)return false;for(let o=t;;){let t=o.parentNode;if(!t||t.nodeType!=1||t.firstChild!=o)return false;if(t.classList.contains("cm-line"))break;o=t}let s=t.nodeType==1?t.getBoundingClientRect():P(t,0,Math.max(t.nodeValue.length,1)).getBoundingClientRect();return i-s.left>5}function li(t,e,i){let s=t.lineBlockAt(e);if(Array.isArray(s.type)){let t;for(let o of s.type){if(o.from>e)break;if(o.toe)return o;if(!t||o.type==Ct.Text&&(t.type!=o.type||(i<0?o.frome)))t=o}return t||s}return s}function ai(t,e,i,o){let n=li(t,e.head,e.assoc||-1);let r=!o||n.type!=Ct.Text||!(t.lineWrapping||n.widgetLineBreaks)?null:t.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(r){let e=t.dom.getBoundingClientRect();let o=t.textDirectionAt(n.from);let l=t.posAtCoords({x:i==(o==Ft.LTR)?e.right-1:e.left+1,y:(r.top+r.bottom)/2});if(l!=null)return s.EditorSelection.cursor(l,i?-1:1)}return s.EditorSelection.cursor(i?n.to:n.from,i?-1:1)}function hi(t,e,i,s){let o=t.state.doc.lineAt(e.head),n=t.bidiSpans(o);let r=t.textDirectionAt(o.from);for(let l=e,a=null;;){let e=ne(o,n,r,l,i),h=oe;if(!e){if(o.number==(i?t.state.doc.lines:1))return l;h="\n";o=t.state.doc.line(o.number+(i?1:-1));n=t.bidiSpans(o);e=t.visualLineSide(o,!i)}if(!a){if(!s)return e;a=s(h)}else if(!a(h)){return l}l=e}}function fi(t,e,i){let o=t.state.charCategorizer(e);let n=o(i);return t=>{let e=o(t);if(n==s.CharCategory.Space)n=e;return n==e}}function ci(t,e,i,o){let n=e.head,r=i?1:-1;if(n==(i?t.state.doc.length:0))return s.EditorSelection.cursor(n,e.assoc);let l=e.goalColumn,a;let h=t.contentDOM.getBoundingClientRect();let f=t.coordsAtPos(n,e.assoc||-1),c=t.documentTop;if(f){if(l==null)l=f.left-h.left;a=r<0?f.top:f.bottom}else{let e=t.viewState.lineBlockAt(n);if(l==null)l=Math.min(h.right-h.left,t.defaultCharacterWidth*(n-e.from));a=(r<0?e.top:e.bottom)+c}let d=h.left+l;let u=o!==null&&o!==void 0?o:t.viewState.heightOracle.textHeight>>1;for(let p=0;;p+=10){let e=a+(u+p)*r;let i=si(t,{x:d,y:e},false,r);if(eh.bottom||(r<0?in)){let o=t.docView.coordsForChar(i);let n=!o||e{if(e>t&&ee(t))),i.from,e.head>i.from?-1:1);return o==i.from?i:s.EditorSelection.cursor(o,ot)this.lineBreak();s=o}this.findPointBefore(i,e);return this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)if(i.node==t)i.pos=this.text.length+Math.min(i.offset,e.length);for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,n=1,r;if(this.lineSeparator){o=e.indexOf(this.lineSeparator,i);n=this.lineSeparator.length}else if(r=s.exec(e)){o=r.index;n=r[0].length}this.append(e.slice(i,o<0?e.length:o));if(o<0)break;this.lineBreak();if(n>1)for(let e of this.points)if(e.node==t&&e.pos>this.text.length)e.pos-=n-1;i=o+n}}readNode(t){if(t.cmIgnore)return;let e=Y.get(t);let i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let t=i.iter();!t.next().done;){if(t.lineBreak)this.lineBreak();else this.append(t.value)}}else if(t.nodeType==3){this.readTextNode(t)}else if(t.nodeName=="BR"){if(t.nextSibling)this.lineBreak()}else if(t.nodeType==1){this.readRange(t.firstChild,null)}}findPointBefore(t,e){for(let i of this.points)if(i.node==t&&t.childNodes[i.offset]==e)i.pos=this.text.length}findPointInside(t,e){for(let i of this.points)if(t.nodeType==3?i.node==t:t.contains(i.node))i.pos=this.text.length+(mi(t,i.node,i.offset)?e:0)}}function mi(t,e,i){for(;;){if(!e||i-1;let{impreciseHead:n,impreciseAnchor:r}=t.docView;if(t.state.readOnly&&e>-1){this.newSel=null}else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let e=n||r?[]:Mi(t);let i=new gi(e,t.state);i.readRange(this.bounds.startDOM,this.bounds.endDOM);this.text=i.text;this.newSel=Ci(e,this.bounds.from)}else{let e=t.observer.selectionRange;let i=n&&n.node==e.focusNode&&n.offset==e.focusOffset||!w(t.contentDOM,e.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(e.focusNode,e.focusOffset);let o=r&&r.node==e.anchorNode&&r.offset==e.anchorOffset||!w(t.contentDOM,e.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(e.anchorNode,e.anchorOffset);let l=t.viewport;if((rt.ios||rt.chrome)&&t.state.selection.main.empty&&i!=o&&(l.from>0||l.toDate.now()-100?t.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds;let a=n.from,h=null;if(r===8||rt.android&&e.text.length=n.from&&i.to<=n.to&&(i.from!=n.from||i.to!=n.to)&&n.to-n.from-(i.to-i.from)<=4){i={from:n.from,to:n.to,insert:t.state.doc.slice(n.from,i.from).append(i.insert).append(t.state.doc.slice(i.to,n.to))}}else if(rt.chrome&&i&&i.from==i.to&&i.from==n.head&&i.insert.toString()=="\n "&&t.lineWrapping){if(o)o=s.EditorSelection.single(o.main.anchor-1,o.main.head-1);i={from:n.from,to:n.to,insert:s.Text.of([" "])}}if(i){return yi(t,i,o,r)}else if(o&&!o.main.eq(n)){let e=false,i="select";if(t.inputState.lastSelectionTime>Date.now()-50){if(t.inputState.lastSelectionOrigin=="select")e=true;i=t.inputState.lastSelectionOrigin}t.dispatch({selection:o,scrollIntoView:e,userEvent:i});return true}else{return false}}function yi(t,e,i,s=-1){if(rt.ios&&t.inputState.flushIOSKey(e))return true;let o=t.state.selection.main;if(rt.android&&(e.to==o.to&&(e.from==o.from||e.from==o.from-1&&t.state.sliceDoc(e.from,o.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&H(t.contentDOM,"Enter",13)||(e.from==o.from-1&&e.to==o.to&&e.insert.length==0||s==8&&e.insert.lengtho.head)&&H(t.contentDOM,"Backspace",8)||e.from==o.from&&e.to==o.to+1&&e.insert.length==0&&H(t.contentDOM,"Delete",46)))return true;let n=e.insert.toString();if(t.inputState.composing>=0)t.inputState.composing++;let r;let l=()=>r||(r=Si(t,e,i));if(!t.state.facet(de).some((i=>i(t,e.from,e.to,n,l))))t.dispatch(l());return true}function Si(t,e,i){let o,n=t.state,r=n.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==e.from+e.insert.length)&&t.inputState.composing<0){let i=r.frome.to?n.sliceDoc(e.to,r.to):"";o=n.replaceSelection(t.state.toText(i+e.insert.sliceString(0,undefined,t.state.lineBreak)+s))}else{let l=n.changes(e);let a=i&&i.main.to<=l.newLength?i.main:undefined;if(n.selection.ranges.length>1&&t.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let h=t.state.sliceDoc(e.from,e.to);let f,c=i&&qe(t,i.main.head);if(c){let t=e.insert.length-(e.to-e.from);f={from:c.from,to:c.to-t}}else{f=t.state.doc.lineAt(r.head)}let d=r.to-e.to,u=r.to-r.from;o=n.changeByRange((i=>{if(i.from==r.from&&i.to==r.to)return{changes:l,range:a||i.map(l)};let o=i.to-d,c=o-h.length;if(i.to-i.from!=u||t.state.sliceDoc(c,o)!=h||i.to>=f.from&&i.from<=f.to)return{range:i};let p=n.changes({from:c,to:o,insert:e.insert}),g=i.to-r.to;return{changes:p,range:!a?i.map(p):s.EditorSelection.range(Math.max(0,a.anchor+g),Math.max(0,a.head+g))}}))}else{o={changes:l,selection:a&&n.selection.replaceRange(a)}}}let l="input.type";if(t.composing||t.inputState.compositionPendingChange&&t.inputState.compositionEndedAt>Date.now()-50){t.inputState.compositionPendingChange=false;l+=".compose";if(t.inputState.compositionFirstChange){l+=".start";t.inputState.compositionFirstChange=false}}return n.update(o,{userEvent:l,scrollIntoView:true})}function xi(t,e,i,s){let o=Math.min(t.length,e.length);let n=0;while(n0&&l>0&&t.charCodeAt(r-1)==e.charCodeAt(l-1)){r--;l--}if(s=="end"){let t=Math.max(0,n-Math.min(r,l));i-=r+t-n}if(r=r?n-i:0;n-=t;l=n+(l-r);r=n}else if(l=l?n-i:0;n-=t;r=n+(r-l);l=n}return{from:n,toA:r,toB:l}}function Mi(t){let e=[];if(t.root.activeElement!=t.contentDOM)return e;let{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:n}=t.observer.selectionRange;if(i){e.push(new wi(i,s));if(o!=i||n!=s)e.push(new wi(o,n))}return e}function Ci(t,e){if(t.length==0)return null;let i=t[0].pos,o=t.length==2?t[1].pos:i;return i>-1&&o>-1?s.EditorSelection.single(i+e,o+e):null}class ki{setSelectionOrigin(t){this.lastSelectionOrigin=t;this.lastSelectionTime=Date.now()}constructor(t){this.view=t;this.lastKeyCode=0;this.lastKeyTime=0;this.lastTouchTime=0;this.lastFocusTime=0;this.lastScrollTop=0;this.lastScrollLeft=0;this.pendingIOSKey=undefined;this.tabFocusMode=-1;this.lastSelectionOrigin=null;this.lastSelectionTime=0;this.lastContextMenu=0;this.scrollHandlers=[];this.handlers=Object.create(null);this.composing=-1;this.compositionFirstChange=null;this.compositionEndedAt=0;this.compositionPendingKey=false;this.compositionPendingChange=false;this.mouseSelection=null;this.draggedContent=null;this.handleEvent=this.handleEvent.bind(this);this.notifiedFocused=t.hasFocus;if(rt.safari)t.contentDOM.addEventListener("input",(()=>null));if(rt.gecko)fs(t.contentDOM.ownerDocument)}handleEvent(t){if(!Fi(this.view,t)||this.ignoreDuringComposition(t))return;if(t.type=="keydown"&&this.keydown(t))return;if(this.view.updateState!=0)Promise.resolve().then((()=>this.runHandlers(t.type,t)));else this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let t of i.observers)t(this.view,e);for(let t of i.handlers){if(e.defaultPrevented)break;if(t(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=Di(t),i=this.handlers,s=this.view.contentDOM;for(let o in e)if(o!="scroll"){let t=!e[o].handlers.length;let n=i[o];if(n&&t!=!n.handlers.length){s.removeEventListener(o,this.handleEvent);n=null}if(!n)s.addEventListener(o,this.handleEvent,{passive:t})}for(let o in i)if(o!="scroll"&&!e[o])s.removeEventListener(o,this.handleEvent);this.handlers=e}keydown(t){this.lastKeyCode=t.keyCode;this.lastKeyTime=Date.now();if(t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return true;if(this.tabFocusMode>0&&t.keyCode!=27&&Ei.indexOf(t.keyCode)<0)this.tabFocusMode=-1;if(rt.android&&rt.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8)){this.view.observer.delayAndroidKey(t.key,t.keyCode);return true}let e;if(rt.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Oi.find((e=>e.keyCode==t.keyCode)))&&!t.ctrlKey||Ti.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)){this.pendingIOSKey=e||t;setTimeout((()=>this.flushIOSKey()),250);return true}if(t.keyCode!=229)this.view.observer.forceFlush();return false}flushIOSKey(t){let e=this.pendingIOSKey;if(!e)return false;if(e.key=="Enter"&&t&&t.from0)return true;if(rt.safari&&!rt.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100){this.compositionPendingKey=false;return true}return false}startMouseSelection(t){if(this.mouseSelection)this.mouseSelection.destroy();this.mouseSelection=t}update(t){this.view.observer.update(t);if(this.mouseSelection)this.mouseSelection.update(t);if(this.draggedContent&&t.docChanged)this.draggedContent=this.draggedContent.map(t.changes);if(t.transactions.length)this.lastKeyCode=this.lastSelectionTime=0}destroy(){if(this.mouseSelection)this.mouseSelection.destroy()}}function Ai(t,e){return(i,s)=>{try{return e.call(t,s,i)}catch(o){xe(i.state,o)}}}function Di(t){let e=Object.create(null);function i(t){return e[t]||(e[t]={observers:[],handlers:[]})}for(let s of t){let t=s.spec,e=t&&t.plugin.domEventHandlers,o=t&&t.plugin.domEventObservers;if(e)for(let n in e){let t=e[n];if(t)i(n).handlers.push(Ai(s.value,t))}if(o)for(let n in o){let t=o[n];if(t)i(n).observers.push(Ai(s.value,t))}}for(let s in Wi)i(s).handlers.push(Wi[s]);for(let s in zi)i(s).observers.push(zi[s]);return e}const Oi=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}];const Ti="dthko";const Ei=[16,17,18,20,91,92,224,225];const Ri=6;function Bi(t){return Math.max(0,t)*.7+8}function Li(t,e){return Math.max(Math.abs(t.clientX-e.clientX),Math.abs(t.clientY-e.clientY))}class Pi{constructor(t,e,i,o){this.view=t;this.startEvent=e;this.style=i;this.mustSelect=o;this.scrollSpeed={x:0,y:0};this.scrolling=-1;this.lastEvent=e;this.scrollParents=T(t.contentDOM);this.atoms=t.state.facet(Be).map((e=>e(t)));let n=t.contentDOM.ownerDocument;n.addEventListener("mousemove",this.move=this.move.bind(this));n.addEventListener("mouseup",this.up=this.up.bind(this));this.extend=e.shiftKey;this.multiple=t.state.facet(s.EditorState.allowMultipleSelections)&&Hi(t,e);this.dragging=Vi(t,e)&&Zi(e)==1?null:false}start(t){if(this.dragging===false)this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Li(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0;let s=0,o=0,n=this.view.win.innerWidth,r=this.view.win.innerHeight;if(this.scrollParents.x)({left:s,right:n}=this.scrollParents.x.getBoundingClientRect());if(this.scrollParents.y)({top:o,bottom:r}=this.scrollParents.y.getBoundingClientRect());let l=Ne(this.view);if(t.clientX-l.left<=s+Ri)e=-Bi(s-t.clientX);else if(t.clientX+l.right>=n-Ri)e=Bi(t.clientX-n);if(t.clientY-l.top<=o+Ri)i=-Bi(o-t.clientY);else if(t.clientY+l.bottom>=r-Ri)i=Bi(t.clientY-r);this.setScrollSpeed(e,i)}up(t){if(this.dragging==null)this.select(this.lastEvent);if(!this.dragging)t.preventDefault();this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move);t.removeEventListener("mouseup",this.up);this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e};if(t||e){if(this.scrolling<0)this.scrolling=setInterval((()=>this.scroll()),50)}else if(this.scrolling>-1){clearInterval(this.scrolling);this.scrolling=-1}}scroll(){let{x:t,y:e}=this.scrollSpeed;if(t&&this.scrollParents.x){this.scrollParents.x.scrollLeft+=t;t=0}if(e&&this.scrollParents.y){this.scrollParents.y.scrollTop+=e;e=0}if(t||e)this.view.win.scrollBy(t,e);if(this.dragging===false)this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;it.isUserEvent("input.type"))))this.destroy();else if(this.style.update(t))setTimeout((()=>this.select(this.lastEvent)),20)}}function Hi(t,e){let i=t.state.facet(le);return i.length?i[0](e):rt.mac?e.metaKey:e.ctrlKey}function Ni(t,e){let i=t.state.facet(ae);return i.length?i[0](e):rt.mac?!e.altKey:!e.ctrlKey}function Vi(t,e){let{main:i}=t.state.selection;if(i.empty)return false;let s=m(t.root);if(!s||s.rangeCount==0)return true;let o=s.getRangeAt(0).getClientRects();for(let n=0;n=e.clientX&&t.top<=e.clientY&&t.bottom>=e.clientY)return true}return false}function Fi(t,e){if(!e.bubbles)return true;if(e.defaultPrevented)return false;for(let i=e.target,s;i!=t.contentDOM;i=i.parentNode)if(!i||i.nodeType==11||(s=Y.get(i))&&s.ignoreEvent(e))return false;return true}const Wi=Object.create(null);const zi=Object.create(null);const Ii=rt.ie&&rt.ie_version<15||rt.ios&&rt.webkit_version<604;function qi(t){let e=t.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px";i.focus();setTimeout((()=>{t.focus();i.remove();Yi(t,i.value)}),50)}function Ki(t,e,i){for(let s of t.facet(e))i=s(i,t);return i}function Yi(t,e){e=Ki(t.state,pe,e);let{state:i}=t,o,n=1,r=i.toText(e);let l=r.lines==i.selection.ranges.length;let a=ns!=null&&i.selection.ranges.every((t=>t.empty))&&ns==r.toString();if(a){let t=-1;o=i.changeByRange((o=>{let a=i.doc.lineAt(o.from);if(a.from==t)return{range:o};t=a.from;let h=i.toText((l?r.line(n++).text:e)+i.lineBreak);return{changes:{from:a.from,insert:h},range:s.EditorSelection.cursor(o.from+h.length)}}))}else if(l){o=i.changeByRange((t=>{let e=r.line(n++);return{changes:{from:t.from,to:t.to,insert:e.text},range:s.EditorSelection.cursor(t.from+e.length)}}))}else{o=i.replaceSelection(r)}t.dispatch(o,{userEvent:"input.paste",scrollIntoView:true})}zi.scroll=t=>{t.inputState.lastScrollTop=t.scrollDOM.scrollTop;t.inputState.lastScrollLeft=t.scrollDOM.scrollLeft};Wi.keydown=(t,e)=>{t.inputState.setSelectionOrigin("select");if(e.keyCode==27&&t.inputState.tabFocusMode!=0)t.inputState.tabFocusMode=Date.now()+2e3;return false};zi.touchstart=(t,e)=>{t.inputState.lastTouchTime=Date.now();t.inputState.setSelectionOrigin("select.pointer")};zi.touchmove=t=>{t.inputState.setSelectionOrigin("select.pointer")};Wi.mousedown=(t,e)=>{t.observer.flush();if(t.inputState.lastTouchTime>Date.now()-2e3)return false;let i=null;for(let s of t.state.facet(he)){i=s(t,e);if(i)break}if(!i&&e.button==0)i=ts(t,e);if(i){let s=!t.hasFocus;t.inputState.startMouseSelection(new Pi(t,e,i,s));if(s)t.observer.ignore((()=>{B(t.contentDOM);let e=t.root.activeElement;if(e&&!e.contains(t.contentDOM))e.blur()}));let o=t.inputState.mouseSelection;if(o){o.start(e);return o.dragging===false}}return false};function _i(t,e,i,o){if(o==1){return s.EditorSelection.cursor(e,i)}else if(o==2){return $e(t.state,e,i)}else{let i=Bt.find(t.docView,e),o=t.state.doc.lineAt(i?i.posAtEnd:e);let n=i?i.posAtStart:o.from,r=i?i.posAtEnd:o.to;if(re>=i.top&&e<=i.bottom&&t>=i.left&&t<=i.right;function Gi(t,e,i,s){let o=Bt.find(t.docView,e);if(!o)return 1;let n=e-o.posAtStart;if(n==0)return 1;if(n==o.length)return-1;let r=o.coordsAt(n,-1);if(r&&Xi(i,s,r))return-1;let l=o.coordsAt(n,1);if(l&&Xi(i,s,l))return 1;return r&&r.bottom>=s?-1:1}function ji(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},false);return{pos:i,bias:Gi(t,i,e.clientX,e.clientY)}}const $i=rt.ie&&rt.ie_version<=11;let Ui=null,Qi=0,Ji=0;function Zi(t){if(!$i)return t.detail;let e=Ui,i=Ji;Ui=t;Ji=Date.now();return Qi=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(Qi+1)%3:1}function ts(t,e){let i=ji(t,e),o=Zi(e);let n=t.state.selection;return{update(t){if(t.docChanged){i.pos=t.changes.mapPos(i.pos);n=n.map(t.changes)}},get(e,r,l){let a=ji(t,e),h;let f=_i(t,a.pos,a.bias,o);if(i.pos!=a.pos&&!r){let e=_i(t,i.pos,i.bias,o);let n=Math.min(e.from,f.from),r=Math.max(e.to,f.to);f=n1&&(h=es(n,a.pos)))return h;else if(l)return n.addRange(f);else return s.EditorSelection.create([f])}}}function es(t,e){for(let i=0;i=e)return s.EditorSelection.create(t.ranges.slice(0,i).concat(t.ranges.slice(i+1)),t.mainIndex==i?0:t.mainIndex-(t.mainIndex>i?1:0))}return null}Wi.dragstart=(t,e)=>{let{selection:{main:i}}=t.state;if(e.target.draggable){let o=t.docView.nearest(e.target);if(o&&o.isWidget){let t=o.posAtStart,e=t+o.length;if(t>=i.to||e<=i.from)i=s.EditorSelection.range(t,e)}}let{inputState:o}=t;if(o.mouseSelection)o.mouseSelection.dragging=true;o.draggedContent=i;if(e.dataTransfer){e.dataTransfer.setData("Text",Ki(t.state,ge,t.state.sliceDoc(i.from,i.to)));e.dataTransfer.effectAllowed="copyMove"}return false};Wi.dragend=t=>{t.inputState.draggedContent=null;return false};function is(t,e,i,s){i=Ki(t.state,pe,i);if(!i)return;let o=t.posAtCoords({x:e.clientX,y:e.clientY},false);let{draggedContent:n}=t.inputState;let r=s&&n&&Ni(t,e)?{from:n.from,to:n.to}:null;let l={from:o,insert:i};let a=t.state.changes(r?[r,l]:l);t.focus();t.dispatch({changes:a,selection:{anchor:a.mapPos(o,-1),head:a.mapPos(o,1)},userEvent:r?"move.drop":"input.drop"});t.inputState.draggedContent=null}Wi.drop=(t,e)=>{if(!e.dataTransfer)return false;if(t.state.readOnly)return true;let i=e.dataTransfer.files;if(i&&i.length){let s=Array(i.length),o=0;let n=()=>{if(++o==i.length)is(t,e,s.filter((t=>t!=null)).join(t.state.lineBreak),false)};for(let t=0;t{if(!/[\x00-\x08\x0e-\x1f]{2}/.test(e.result))s[t]=e.result;n()};e.readAsText(i[t])}return true}else{let i=e.dataTransfer.getData("Text");if(i){is(t,e,i,true);return true}}return false};Wi.paste=(t,e)=>{if(t.state.readOnly)return true;t.observer.flush();let i=Ii?null:e.clipboardData;if(i){Yi(t,i.getData("text/plain")||i.getData("text/uri-list"));return true}else{qi(t);return false}};function ss(t,e){let i=t.dom.parentNode;if(!i)return;let s=i.appendChild(document.createElement("textarea"));s.style.cssText="position: fixed; left: -10000px; top: 10px";s.value=e;s.focus();s.selectionEnd=e.length;s.selectionStart=0;setTimeout((()=>{s.remove();t.focus()}),50)}function os(t){let e=[],i=[],s=false;for(let o of t.selection.ranges)if(!o.empty){e.push(t.sliceDoc(o.from,o.to));i.push(o)}if(!e.length){let o=-1;for(let{from:s}of t.selection.ranges){let n=t.doc.lineAt(s);if(n.number>o){e.push(n.text);i.push({from:n.from,to:Math.min(t.doc.length,n.to+1)})}o=n.number}s=true}return{text:Ki(t,ge,e.join(t.lineBreak)),ranges:i,linewise:s}}let ns=null;Wi.copy=Wi.cut=(t,e)=>{let{text:i,ranges:s,linewise:o}=os(t.state);if(!i&&!o)return false;ns=o?i:null;if(e.type=="cut"&&!t.state.readOnly)t.dispatch({changes:s,scrollIntoView:true,userEvent:"delete.cut"});let n=Ii?null:e.clipboardData;if(n){n.clearData();n.setData("text/plain",i);return true}else{ss(t,i);return false}};const rs=s.Annotation.define();function ls(t,e){let i=[];for(let s of t.facet(ue)){let o=s(t,e);if(o)i.push(o)}return i.length?t.update({effects:i,annotations:rs.of(true)}):null}function as(t){setTimeout((()=>{let e=t.hasFocus;if(e!=t.inputState.notifiedFocused){let i=ls(t.state,e);if(i)t.dispatch(i);else t.update([])}}),10)}zi.focus=t=>{t.inputState.lastFocusTime=Date.now();if(!t.scrollDOM.scrollTop&&(t.inputState.lastScrollTop||t.inputState.lastScrollLeft)){t.scrollDOM.scrollTop=t.inputState.lastScrollTop;t.scrollDOM.scrollLeft=t.inputState.lastScrollLeft}as(t)};zi.blur=t=>{t.observer.clearSelectionRange();as(t)};zi.compositionstart=zi.compositionupdate=t=>{if(t.observer.editContext)return;if(t.inputState.compositionFirstChange==null)t.inputState.compositionFirstChange=true;if(t.inputState.composing<0){t.inputState.composing=0}};zi.compositionend=t=>{if(t.observer.editContext)return;t.inputState.composing=-1;t.inputState.compositionEndedAt=Date.now();t.inputState.compositionPendingKey=true;t.inputState.compositionPendingChange=t.observer.pendingRecords().length>0;t.inputState.compositionFirstChange=null;if(rt.chrome&&rt.android){t.observer.flushSoon()}else if(t.inputState.compositionPendingChange){Promise.resolve().then((()=>t.observer.flush()))}else{setTimeout((()=>{if(t.inputState.composing<0&&t.docView.hasComposition)t.update([])}),50)}};zi.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};Wi.beforeinput=(t,e)=>{var i,s;if(e.inputType=="insertReplacementText"&&t.observer.editContext){let s=(i=e.dataTransfer)===null||i===void 0?void 0:i.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let e=o[0];let i=t.posAtDOM(e.startContainer,e.startOffset),n=t.posAtDOM(e.endContainer,e.endOffset);yi(t,{from:i,to:n,insert:t.state.toText(s)},null);return true}}let o;if(rt.chrome&&rt.android&&(o=Oi.find((t=>t.inputType==e.inputType)))){t.observer.delayAndroidKey(o.key,o.keyCode);if(o.key=="Backspace"||o.key=="Delete"){let e=((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0;setTimeout((()=>{var i;if((((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0)>e+10&&t.hasFocus){t.contentDOM.blur();t.focus()}}),100)}}if(rt.ios&&e.inputType=="deleteContentForward"){t.observer.flushSoon()}if(rt.safari&&e.inputType=="insertText"&&t.inputState.composing>=0){setTimeout((()=>zi.compositionend(t,e)),20)}return false};const hs=new Set;function fs(t){if(!hs.has(t)){hs.add(t);t.addEventListener("copy",(()=>{}));t.addEventListener("cut",(()=>{}))}}const cs=["pre-wrap","normal","pre-line","break-spaces"];let ds=false;function us(){ds=false}class ps{constructor(t){this.lineWrapping=t;this.doc=s.Text.empty;this.heightSamples={};this.lineHeight=14;this.charWidth=7;this.textHeight=14;this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;if(this.lineWrapping)i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength));return this.lineHeight*i}heightForLine(t){if(!this.lineWrapping)return this.lineHeight;let e=1+Math.max(0,Math.ceil((t-this.lineLength)/Math.max(1,this.lineLength-5)));return e*this.lineHeight}setDoc(t){this.doc=t;return this}mustRefreshForWrapping(t){return cs.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=false;for(let i=0;i-1;let l=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=r;this.lineWrapping=r;this.lineHeight=e;this.charWidth=i;this.textHeight=s;this.lineLength=o;if(l){this.heightSamples={};for(let t=0;t0}set outdated(t){this.flags=(t?2:0)|this.flags&~2}setHeight(t){if(this.height!=t){if(Math.abs(this.height-t)>vs)ds=true;this.height=t}}replace(t,e,i){return bs.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,s){let o=this,n=i.doc;for(let r=s.length-1;r>=0;r--){let{fromA:l,toA:a,fromB:h,toB:f}=s[r];let c=o.lineAt(l,ws.ByPosNoHeight,i.setDoc(e),0,0);let d=c.to>=a?c:o.lineAt(a,ws.ByPosNoHeight,i,0,0);f+=d.to-a;a=d.to;while(r>0&&c.from<=s[r-1].toA){l=s[r-1].fromA;h=s[r-1].fromB;r--;if(lo*2){let o=t[e-1];if(o.break)t.splice(--e,1,o.left,null,o.right);else t.splice(--e,1,o.left,o.right);i+=1+o.break;s-=o.size}else if(o>s*2){let e=t[i];if(e.break)t.splice(i,1,e.left,null,e.right);else t.splice(i,1,e.left,e.right);i+=2+e.break;o-=e.size}else{break}}else if(s=o)n(this.blockAt(0,i,s,o))}updateHeight(t,e=0,i=false,s){if(s&&s.from<=e&&s.more)this.setHeight(s.heights[s.index++]);this.outdated=false;return this}toString(){return`block(${this.length})`}}class xs extends Ss{constructor(t,e){super(t,e,null);this.collapsed=0;this.widgetHeight=0;this.breaks=0}blockAt(t,e,i,s){return new ms(s,this.length,i,this.height,this.breaks)}replace(t,e,i){let s=i[0];if(i.length==1&&(s instanceof xs||s instanceof Ms&&s.flags&4)&&Math.abs(this.length-s.length)<10){if(s instanceof Ms)s=new xs(s.length,this.height);else s.height=this.height;if(!this.outdated)s.outdated=false;return s}else{return bs.of(i)}}updateHeight(t,e=0,i=false,s){if(s&&s.from<=e&&s.more)this.setHeight(s.heights[s.index++]);else if(i||this.outdated)this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight);this.outdated=false;return this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Ms extends bs{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,s=t.doc.lineAt(e+this.length).number;let o=s-i+1;let n,r=0;if(t.lineWrapping){let e=Math.min(this.height,t.lineHeight*o);n=e/o;if(this.length>o+1)r=(this.height-e)/(this.length-o-1)}else{n=this.height/o}return{firstLine:i,lastLine:s,perLine:n,perChar:r}}blockAt(t,e,i,s){let{firstLine:o,lastLine:n,perLine:r,perChar:l}=this.heightMetrics(e,s);if(e.lineWrapping){let o=s+(t0){let t=i[i.length-1];if(t instanceof Ms)i[i.length-1]=new Ms(t.length+s);else i.push(null,new Ms(s-1))}if(t>0){let e=i[0];if(e instanceof Ms)i[0]=new Ms(t+e.length);else i.unshift(new Ms(t-1),null)}return bs.of(i)}decomposeLeft(t,e){e.push(new Ms(t-1),null)}decomposeRight(t,e){e.push(null,new Ms(this.length-t-1))}updateHeight(t,e=0,i=false,s){let o=e+this.length;if(s&&s.from<=e+this.length&&s.more){let i=[],n=Math.max(e,s.from),r=-1;if(s.from>e)i.push(new Ms(s.from-e-1).updateHeight(t,e));while(n<=o&&s.more){let e=t.doc.lineAt(n).length;if(i.length)i.push(null);let o=s.heights[s.index++];if(r==-1)r=o;else if(Math.abs(o-r)>=vs)r=-2;let l=new xs(e,o);l.outdated=false;i.push(l);n+=e+1}if(n<=o)i.push(null,new Ms(o-n).updateHeight(t,n));let l=bs.of(i);if(r<0||Math.abs(l.height-this.height)>=vs||Math.abs(r-this.heightMetrics(t,e).perLine)>=vs)ds=true;return ys(this,l)}else if(i||this.outdated){this.setHeight(t.heightForGap(e,e+this.length));this.outdated=false}return this}toString(){return`gap(${this.length})`}}class Cs extends bs{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0));this.left=t;this.right=i;this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,s){let o=i+this.left.height;return tr))return a;let h=e==ws.ByPosNoHeight?ws.ByPosNoHeight:ws.ByPos;if(l)return a.join(this.right.lineAt(r,h,i,n,r));else return this.left.lineAt(r,h,i,s,o).join(a)}forEachLine(t,e,i,s,o,n){let r=s+this.left.height,l=o+this.left.length+this.break;if(this.break){if(t=l)this.right.forEachLine(t,e,i,r,l,n)}else{let a=this.lineAt(l,ws.ByPos,i,s,o);if(t=t&&a.from<=e)n(a);if(e>a.to)this.right.forEachLine(a.to+1,e,i,r,l,n)}}replace(t,e,i){let s=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-s,e-s,i));let o=[];if(t>0)this.decomposeLeft(t,o);let n=o.length;for(let r of i)o.push(r);if(t>0)ks(o,n-1);if(e=i)e.push(null)}if(t>i)this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,s=i+this.break;if(t>=s)return this.right.decomposeRight(t-s,e);if(t2*e.size||e.size>2*t.size)return bs.of(this.break?[t,null,e]:[t,e]);this.left=ys(this.left,t);this.right=ys(this.right,e);this.setHeight(t.height+e.height);this.outdated=t.outdated||e.outdated;this.size=t.size+e.size;this.length=t.length+this.break+e.length;return this}updateHeight(t,e=0,i=false,s){let{left:o,right:n}=this,r=e+o.length+this.break,l=null;if(s&&s.from<=e+o.length&&s.more)l=o=o.updateHeight(t,e,i,s);else o.updateHeight(t,e,i);if(s&&s.from<=r+n.length&&s.more)l=n=n.updateHeight(t,r,i,s);else n.updateHeight(t,r,i);if(l)return this.balanced(o,n);this.height=this.left.height+this.right.height;this.outdated=false;return this}toString(){return this.left+(this.break?" ":"-")+this.right}}function ks(t,e){let i,s;if(t[e]==null&&(i=t[e-1])instanceof Ms&&(s=t[e+1])instanceof Ms)t.splice(e-1,3,new Ms(i.length+1+s.length))}const As=5;class Ds{constructor(t,e){this.pos=t;this.oracle=e;this.nodes=[];this.lineStart=-1;this.lineEnd=-1;this.covering=null;this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let t=Math.min(e,this.lineEnd),i=this.nodes[this.nodes.length-1];if(i instanceof xs)i.length+=t-this.pos;else if(t>this.pos||!this.isCovered)this.nodes.push(new xs(t-this.pos,-1));this.writtenTo=t;if(e>t){this.nodes.push(null);this.writtenTo++;this.lineStart=-1}}this.pos=e}point(t,e,i){if(t=As){this.addLineDeco(s,o,n)}}else if(e>t){this.span(t,e)}if(this.lineEnd>-1&&this.lineEnd-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t;this.lineEnd=e;if(this.writtenTot)this.nodes.push(new xs(this.pos-t,-1));this.writtenTo=this.pos}blankContent(t,e){let i=new Ms(e-t);if(this.oracle.doc.lineAt(t).to==e)i.flags|=4;return i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof xs)return t;let e=new xs(0,-1);this.nodes.push(e);return e}addBlock(t){this.enterLine();let e=t.deco;if(e&&e.startSide>0&&!this.isCovered)this.ensureLine();this.nodes.push(t);this.writtenTo=this.pos=this.pos+t.length;if(e&&e.endSide>0)this.covering=t}addLineDeco(t,e,i){let s=this.ensureLine();s.length+=i;s.collapsed+=i;s.widgetHeight=Math.max(s.widgetHeight,t);s.breaks+=e;this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];if(this.lineStart>-1&&!(e instanceof xs)&&!this.isCovered)this.nodes.push(new xs(0,-1));else if(this.writtenToe.clientHeight||e.scrollWidth>e.clientWidth)&&i.overflow!="visible"){let i=e.getBoundingClientRect();n=Math.max(n,i.left);r=Math.min(r,i.right);l=Math.max(l,i.top);a=Math.min(h==t.parentNode?o.innerHeight:a,i.bottom)}h=i.position=="absolute"||i.position=="fixed"?e.offsetParent:e.parentNode}else if(h.nodeType==11){h=h.host}else{break}}return{left:n-i.left,right:Math.max(n,r)-i.left,top:l-(i.top+e),bottom:Math.max(l,a)-(i.top+e)}}function Rs(t){let e=t.getBoundingClientRect(),i=t.ownerDocument.defaultView||window;return e.left0&&e.top0}function Bs(t,e){let i=t.getBoundingClientRect();return{left:0,right:i.right-i.left,top:e,bottom:i.bottom-(i.top+e)}}class Ls{constructor(t,e,i,s){this.from=t;this.to=e;this.size=i;this.displaySize=s}static same(t,e){if(t.length!=e.length)return false;for(let i=0;itypeof t!="function"&&t.class=="cm-lineWrapping"));this.heightOracle=new ps(e);this.stateDeco=t.facet(Ee).filter((t=>typeof t!="function"));this.heightMap=bs.empty().applyChanges(this.stateDeco,s.Text.empty,this.heightOracle.setDoc(t.doc),[new Fe(0,0,0,t.doc.length)]);for(let i=0;i<2;i++){this.viewport=this.getViewport(0,null);if(!this.updateForViewport())break}this.updateViewportLines();this.lineGaps=this.ensureLineGaps([]);this.lineGapDeco=kt.set(this.lineGaps.map((t=>t.draw(this,false))));this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let s=i?e.head:e.anchor;if(!t.some((({from:t,to:e})=>s>=t&&s<=e))){let{from:e,to:i}=this.lineBlockAt(s);t.push(new Ns(e,i))}}this.viewports=t.sort(((t,e)=>t.from-e.from));return this.updateScaler()}updateScaler(){let t=this.scaler;this.scaler=this.heightMap.height<=7e6?Is:new qs(this.heightOracle,this.heightMap,this.viewports);return t.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[];this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,(t=>{this.viewportLines.push(Ks(t,this.scaler))}))}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Ee).filter((t=>typeof t!="function"));let o=t.changedRanges;let n=Fe.extendWithRanges(o,Os(i,this.stateDeco,t?t.changes:s.ChangeSet.empty(this.state.doc.length)));let r=this.heightMap.height;let l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);us();this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),n);if(this.heightMap.height!=r||ds)t.flags|=2;if(l){this.scrollAnchorPos=t.changes.mapPos(l.from,-1);this.scrollAnchorHeight=l.top}else{this.scrollAnchorPos=-1;this.scrollAnchorHeight=r}let a=n.length?this.mapViewport(this.viewport,t.changes):this.viewport;if(e&&(e.range.heada.to)||!this.viewportIsAppropriate(a))a=this.getViewport(0,e);let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a;t.flags|=this.updateForViewport();if(h||!t.changes.empty||t.flags&2)this.updateViewportLines();if(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes)));t.flags|=this.computeVisibleRanges(t.changes);if(e)this.scrollTarget=e;if(!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(we))this.mustEnforceCursorAssoc=true}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e);let o=this.heightOracle;let n=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?Ft.RTL:Ft.LTR;let r=this.heightOracle.mustRefreshForWrapping(n);let l=e.getBoundingClientRect();let a=r||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height;this.mustMeasureContent=false;let h=0,f=0;if(l.width&&l.height){let{scaleX:t,scaleY:i}=D(e,l);if(t>.005&&Math.abs(this.scaleX-t)>.005||i>.005&&Math.abs(this.scaleY-i)>.005){this.scaleX=t;this.scaleY=i;h|=16;r=a=true}}let c=(parseInt(i.paddingTop)||0)*this.scaleY;let d=(parseInt(i.paddingBottom)||0)*this.scaleY;if(this.paddingTop!=c||this.paddingBottom!=d){this.paddingTop=c;this.paddingBottom=d;h|=16|2}if(this.editorWidth!=t.scrollDOM.clientWidth){if(o.lineWrapping)a=true;this.editorWidth=t.scrollDOM.clientWidth;h|=16}let u=t.scrollDOM.scrollTop*this.scaleY;if(this.scrollTop!=u){this.scrollAnchorHeight=-1;this.scrollTop=u}this.scrolledToBottom=W(t.scrollDOM);let p=(this.printing?Bs:Es)(e,this.paddingTop);let g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let w=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(w!=this.inView){this.inView=w;if(w)a=true}if(!this.inView&&!this.scrollTarget&&!Rs(t.dom))return 0;let v=l.width;if(this.contentDOMWidth!=v||this.editorHeight!=t.scrollDOM.clientHeight){this.contentDOMWidth=l.width;this.editorHeight=t.scrollDOM.clientHeight;h|=16}if(a){let e=t.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(e))r=true;if(r||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:i,charWidth:s,textHeight:l}=t.docView.measureTextSize();r=i>0&&o.refresh(n,i,s,l,Math.max(5,v/s),e);if(r){t.docView.minWidth=0;h|=16}}if(g>0&&m>0)f=Math.max(g,m);else if(g<0&&m<0)f=Math.min(g,m);us();for(let i of this.viewports){let n=i.from==this.viewport.from?e:t.docView.measureVisibleLineHeights(i);this.heightMap=(r?bs.empty().applyChanges(this.stateDeco,s.Text.empty,this.heightOracle,[new Fe(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(o,0,r,new gs(i.from,n))}if(ds)h|=2}let b=!this.viewportIsAppropriate(this.viewport,f)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);if(b){if(h&2)h|=this.updateScaler();this.viewport=this.getViewport(f,this.scrollTarget);h|=this.updateForViewport()}if(h&2||b)this.updateViewportLines();if(this.lineGaps.length||this.viewport.to-this.viewport.from>2e3<<1)this.updateLineGaps(this.ensureLineGaps(r?[]:this.lineGaps,t));h|=this.computeVisibleRanges();if(this.mustEnforceCursorAssoc){this.mustEnforceCursorAssoc=false;t.docView.enforceCursorAssoc()}return h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2));let s=this.heightMap,o=this.heightOracle;let{visibleTop:n,visibleBottom:r}=this;let l=new Ns(s.lineAt(n-i*1e3,ws.ByHeight,o,0,0).from,s.lineAt(r+(1-i)*1e3,ws.ByHeight,o,0,0).to);if(e){let{head:t}=e.range;if(tl.to){let i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top);let n=s.lineAt(t,ws.ByPos,o,0,0),r;if(e.y=="center")r=(n.top+n.bottom)/2-i/2;else if(e.y=="start"||e.y=="nearest"&&t=r+Math.max(10,Math.min(i,250)))&&(s>n-2*1e3&&o>1,r=o<<1;if(this.defaultTextDirection!=Ft.LTR&&!i)return[];let l=[];let a=(o,r,h,f)=>{if(r-oo&&tt.from>=h.from&&t.to<=h.to&&Math.abs(t.from-o)t.frome))));if(!u){if(rt.from<=r&&t.to>=r))){let t=e.moveToLineBoundary(s.EditorSelection.cursor(r),false,true).head;if(t>o)r=t}let t=this.gapSize(h,o,r,f);let n=i||t<2e6?t:2e6;u=new Ls(o,r,t,n)}l.push(u)};let h=e=>{if(e.length2e6)for(let s of t){if(s.from>=e.from&&s.frome.from)a(e.from,l,e,s);if(ht.draw(this,this.heightOracle.lineWrapping))))}}computeVisibleRanges(t){let e=this.stateDeco;if(this.lineGaps.length)e=e.concat(this.lineGapDeco);let i=[];s.RangeSet.spans(e,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20);let o=0;if(i.length!=this.visibleRanges.length){o=8|4}else{for(let e=0;e=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find((e=>e.from<=t&&e.to>=t))||Ks(this.heightMap.lineAt(t,ws.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find((e=>e.top<=t&&e.bottom>=t))||Ks(this.heightMap.lineAt(this.scaler.fromDOM(t),ws.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Ks(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Ns{constructor(t,e){this.from=t;this.to=e}}function Vs(t,e,i){let o=[],n=t,r=0;s.RangeSet.spans(i,t,e,{span(){},point(t,e){if(t>n){o.push({from:n,to:t});r+=t-n}n=e}},20);if(n=1)return e[e.length-1].to;let s=Math.floor(t*i);for(let o=0;;o++){let{from:t,to:i}=e[o],n=i-t;if(s<=n)return t+s;s-=n}}function Ws(t,e){let i=0;for(let{from:s,to:o}of t.ranges){if(e<=o){i+=e-s;break}i+=o-s}return i/t.total}function zs(t,e){for(let i of t)if(e(i))return i;return undefined}const Is={toDOM(t){return t},fromDOM(t){return t},scale:1,eq(t){return t==this}};class qs{constructor(t,e,i){let s=0,o=0,n=0;this.viewports=i.map((({from:i,to:o})=>{let n=e.lineAt(i,ws.ByPos,t,0,0).top;let r=e.lineAt(o,ws.ByPos,t,0,0).bottom;s+=r-n;return{from:i,to:o,top:n,bottom:r,domTop:0,domBottom:0}}));this.scale=(7e6-s)/(e.height-s);for(let r of this.viewports){r.domTop=n+(r.top-o)*this.scale;n=r.domBottom=r.domTop+(r.bottom-r.top);o=r.bottom}}toDOM(t){for(let e=0,i=0,s=0;;e++){let o=ee.from==t.viewports[i].from&&e.to==t.viewports[i].to))}}function Ks(t,e){if(e.scale==1)return t;let i=e.toDOM(t.top),s=e.toDOM(t.bottom);return new ms(t.from,t.length,i,s-i,Array.isArray(t._content)?t._content.map((t=>Ks(t,e))):t._content)}const Ys=s.Facet.define({combine:t=>t.join(" ")});const _s=s.Facet.define({combine:t=>t.indexOf(true)>-1});const Xs=o.StyleModule.newName(),Gs=o.StyleModule.newName(),js=o.StyleModule.newName();const $s={"&light":"."+Gs,"&dark":"."+js};function Us(t,e,i){return new o.StyleModule(e,{finish(e){return/&/.test(e)?e.replace(/&\w*/,(e=>{if(e=="&")return t;if(!i||!i[e])throw new RangeError(`Unsupported selector: ${e}`);return i[e]})):t+" "+e}})}const Qs=Us("."+Xs,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},$s);const Js={childList:true,characterData:true,subtree:true,attributes:true,characterDataOldValue:true};const Zs=rt.ie&&rt.ie_version<=11;class to{constructor(t){this.view=t;this.active=false;this.editContext=null;this.selectionRange=new E;this.selectionChanged=false;this.delayedFlush=-1;this.resizeTimeout=-1;this.queue=[];this.delayedAndroidKey=null;this.flushingAndroidKey=-1;this.lastChange=0;this.scrollTargets=[];this.intersection=null;this.resizeScroll=null;this.intersecting=false;this.gapIntersection=null;this.gaps=[];this.printQuery=null;this.parentCheck=-1;this.dom=t.contentDOM;this.observer=new MutationObserver((e=>{for(let t of e)this.queue.push(t);if((rt.ie&&rt.ie_version<=11||rt.ios&&t.composing)&&e.some((t=>t.type=="childList"&&t.removedNodes.length||t.type=="characterData"&&t.oldValue.length>t.target.nodeValue.length)))this.flushSoon();else this.flush()}));if(window.EditContext&&rt.android&&t.constructor.EDIT_CONTEXT!==false&&!(rt.chrome&&rt.chrome_version<126)){this.editContext=new oo(t);if(t.state.facet(Me))t.contentDOM.editContext=this.editContext.editContext}if(Zs)this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue});this.flushSoon()};this.onSelectionChange=this.onSelectionChange.bind(this);this.onResize=this.onResize.bind(this);this.onPrint=this.onPrint.bind(this);this.onScroll=this.onScroll.bind(this);if(window.matchMedia)this.printQuery=window.matchMedia("print");if(typeof ResizeObserver=="function"){this.resizeScroll=new ResizeObserver((()=>{var t;if(((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){if(this.parentCheck<0)this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3);if(t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting){this.intersecting=!this.intersecting;if(this.intersecting!=this.view.inView)this.onScrollChanged(document.createEvent("Event"))}}),{threshold:[0,.001]});this.intersection.observe(this.dom);this.gapIntersection=new IntersectionObserver((t=>{if(t.length>0&&t[t.length-1].intersectionRatio>0)this.onScrollChanged(document.createEvent("Event"))}),{})}this.listenForScroll();this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t);if(this.intersecting)this.view.measure()}onScroll(t){if(this.intersecting)this.flush(false);if(this.editContext)this.view.requestMeasure(this.editContext.measureReq);this.onScrollChanged(t)}onResize(){if(this.resizeTimeout<0)this.resizeTimeout=setTimeout((()=>{this.resizeTimeout=-1;this.view.requestMeasure()}),50)}onPrint(t){if((t.type=="change"||!t.type)&&!t.matches)return;this.view.viewState.printing=true;this.view.measure();setTimeout((()=>{this.view.viewState.printing=false;this.view.requestMeasure()}),500)}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some(((e,i)=>e!=t[i])))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,s=this.selectionRange;if(i.state.facet(Me)?i.root.activeElement!=this.dom:!v(this.dom,s))return;let o=s.anchorNode&&i.docView.nearest(s.anchorNode);if(o&&o.ignoreEvent(t)){if(!e)this.selectionChanged=false;return}if((rt.ie&&rt.ie_version<=11||rt.android&&rt.chrome)&&!i.state.selection.main.empty&&s.focusNode&&y(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset))this.flushSoon();else this.flush(false)}readSelectionRange(){let{view:t}=this;let e=m(t.root);if(!e)return false;let i=rt.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&so(this.view,e)||e;if(!i||this.selectionRange.eq(i))return false;let s=v(this.dom,i);if(s&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime{let t=this.delayedAndroidKey;if(t){this.clearDelayedAndroidKey();this.view.inputState.lastKeyCode=t.keyCode;this.view.inputState.lastKeyTime=Date.now();let e=this.flush();if(!e&&t.force)H(this.dom,t.key,t.keyCode)}};this.flushingAndroidKey=this.view.win.requestAnimationFrame(t)}if(!this.delayedAndroidKey||t=="Enter")this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange{this.delayedFlush=-1;this.flush()}))}forceFlush(){if(this.delayedFlush>=0){this.view.win.cancelAnimationFrame(this.delayedFlush);this.delayedFlush=-1}this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();if(t.length)this.queue=[];let e=-1,i=-1,s=false;for(let o of t){let t=this.readMutation(o);if(!t)continue;if(t.typeOver)s=true;if(e==-1){({from:e,to:i}=t)}else{e=Math.min(t.from,e);i=Math.max(t.to,i)}}return{from:e,to:i,typeOver:s}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords();let s=this.selectionChanged&&v(this.dom,this.selectionRange);if(t<0&&!s)return null;if(t>-1)this.lastChange=Date.now();this.view.inputState.lastFocusTime=0;this.selectionChanged=false;let o=new vi(this.view,t,e,i);this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null};return o}flush(t=true){if(this.delayedFlush>=0||this.delayedAndroidKey)return false;if(t)this.readSelectionRange();let e=this.readChange();if(!e){this.view.requestMeasure();return false}let i=this.view.state;let s=bi(this.view,e);if(this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main)))this.view.update([]);return s}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;e.markDirty(t.type=="attributes");if(t.type=="attributes")e.flags|=4;if(t.type=="childList"){let i=eo(e,t.previousSibling||t.target.previousSibling,-1);let s=eo(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:s?e.posBefore(s):e.posAtEnd,typeOver:false}}else if(t.type=="characterData"){return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}}else{return null}}setWindow(t){if(t!=this.win){this.removeWindowListeners(this.win);this.win=t;this.addWindowListeners(this.win)}}addWindowListeners(t){t.addEventListener("resize",this.onResize);if(this.printQuery){if(this.printQuery.addEventListener)this.printQuery.addEventListener("change",this.onPrint);else this.printQuery.addListener(this.onPrint)}else t.addEventListener("beforeprint",this.onPrint);t.addEventListener("scroll",this.onScroll);t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll);t.removeEventListener("resize",this.onResize);if(this.printQuery){if(this.printQuery.removeEventListener)this.printQuery.removeEventListener("change",this.onPrint);else this.printQuery.removeListener(this.onPrint)}else t.removeEventListener("beforeprint",this.onPrint);t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){if(this.editContext){this.editContext.update(t);if(t.startState.facet(Me)!=t.state.facet(Me))t.view.contentDOM.editContext=t.state.facet(Me)?this.editContext.editContext:null}}destroy(){var t,e,i;this.stop();(t=this.intersection)===null||t===void 0?void 0:t.disconnect();(e=this.gapIntersection)===null||e===void 0?void 0:e.disconnect();(i=this.resizeScroll)===null||i===void 0?void 0:i.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win);clearTimeout(this.parentCheck);clearTimeout(this.resizeTimeout);this.win.cancelAnimationFrame(this.delayedFlush);this.win.cancelAnimationFrame(this.flushingAndroidKey);if(this.editContext){this.view.contentDOM.editContext=null;this.editContext.destroy()}}}function eo(t,e,i){while(e){let s=Y.get(e);if(s&&s.parent==t)return s;let o=e.parentNode;e=o!=t.dom?o:i>0?e.nextSibling:e.previousSibling}return null}function io(t,e){let i=e.startContainer,s=e.startOffset;let o=e.endContainer,n=e.endOffset;let r=t.docView.domAtPos(t.state.selection.main.anchor);if(y(r.node,r.offset,o,n))[i,s,o,n]=[o,n,i,s];return{anchorNode:i,anchorOffset:s,focusNode:o,focusOffset:n}}function so(t,e){if(e.getComposedRanges){let i=e.getComposedRanges(t.root)[0];if(i)return io(t,i)}let i=null;function s(t){t.preventDefault();t.stopImmediatePropagation();i=t.getTargetRanges()[0]}t.contentDOM.addEventListener("beforeinput",s,true);t.dom.ownerDocument.execCommand("indent");t.contentDOM.removeEventListener("beforeinput",s,true);return i?io(t,i):null}class oo{constructor(t){this.from=0;this.to=0;this.pendingContextChange=null;this.handlers=Object.create(null);this.composing=null;this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=e=>{let i=t.state.selection.main,{anchor:o,head:n}=i;let r=this.toEditorPos(e.updateRangeStart),l=this.toEditorPos(e.updateRangeEnd);if(t.inputState.composing>=0&&!this.composing)this.composing={contextBase:e.updateRangeStart,editorBase:r,drifted:false};let a={from:r,to:l,insert:s.Text.of(e.text.split("\n"))};if(a.from==this.from&&othis.to)a.to=o;if(a.from==a.to&&!a.insert.length){let o=s.EditorSelection.single(this.toEditorPos(e.selectionStart),this.toEditorPos(e.selectionEnd));if(!o.main.eq(i))t.dispatch({selection:o,userEvent:"select"});return}if((rt.mac||rt.android)&&a.from==n-1&&/^\. ?$/.test(e.text)&&t.contentDOM.getAttribute("autocorrect")=="off")a={from:r,to:l,insert:s.Text.of([e.text.replace("."," ")])};this.pendingContextChange=a;if(!t.state.readOnly){let i=this.to-this.from+(a.to-a.from+a.insert.length);yi(t,a,s.EditorSelection.single(this.toEditorPos(e.selectionStart,i),this.toEditorPos(e.selectionEnd,i)))}if(this.pendingContextChange){this.revertPending(t.state);this.setSelection(t.state)}};this.handlers.characterboundsupdate=i=>{let s=[],o=null;for(let e=this.toEditorPos(i.rangeStart),n=this.toEditorPos(i.rangeEnd);e{let i=[];for(let t of e.getTextFormats()){let e=t.underlineStyle,s=t.underlineThickness;if(e!="None"&&s!="None"){let o=this.toEditorPos(t.rangeStart),n=this.toEditorPos(t.rangeEnd);if(o{if(t.inputState.composing<0){t.inputState.composing=0;t.inputState.compositionFirstChange=true}};this.handlers.compositionend=()=>{t.inputState.composing=-1;t.inputState.compositionFirstChange=null;if(this.composing){let{drifted:e}=this.composing;this.composing=null;if(e)this.reset(t.state)}};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:t=>{this.editContext.updateControlBounds(t.contentDOM.getBoundingClientRect());let e=m(t.root);if(e&&e.rangeCount)this.editContext.updateSelectionBounds(e.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=false,s=this.pendingContextChange;t.changes.iterChanges(((o,n,r,l,a)=>{if(i)return;let h=a.length-(n-o);if(s&&n>=s.to){if(s.from==o&&s.to==n&&s.insert.eq(a)){s=this.pendingContextChange=null;e+=h;this.to+=h;return}else{s=null;this.revertPending(t.state)}}o+=e;n+=e;if(n<=this.from){this.from+=h;this.to+=h}else if(othis.to||this.to-this.from+a.length>3e4){i=true;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(n),a.toString());this.to+=h}e+=h}));if(s&&!i)this.revertPending(t.state);return!i}update(t){let e=this.pendingContextChange,i=t.startState.selection.main;if(this.composing&&(this.composing.drifted||!t.changes.touchesRange(i.from,i.to)&&t.transactions.some((t=>!t.isUserEvent("input.type")&&t.changes.touchesRange(this.from,this.to))))){this.composing.drifted=true;this.composing.editorBase=t.changes.mapPos(this.composing.editorBase)}else if(!this.applyEdits(t)||!this.rangeIsValid(t.state)){this.pendingContextChange=null;this.reset(t.state)}else if(t.docChanged||t.selectionSet||e){this.setSelection(t.state)}if(t.geometryChanged||t.docChanged||t.selectionSet)t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4);this.to=Math.min(t.doc.length,e+1e4)}reset(t){this.resetRange(t);this.editContext.updateText(0,this.editContext.text.length,t.doc.sliceString(this.from,this.to));this.setSelection(t)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null;this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection;let i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor)));let s=this.toContextPos(e.head);if(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)this.editContext.updateSelection(i,s)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to1e4*3)}toEditorPos(t,e=this.to-this.from){t=Math.min(t,e);let i=this.composing;return i&&i.drifted?i.editorBase+(t-i.contextBase):t+this.from}toContextPos(t){let e=this.composing;return e&&e.drifted?e.contextBase+(t-e.editorBase):t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class no{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;this.plugins=[];this.pluginMap=new Map;this.editorAttrs={};this.contentAttrs={};this.bidiCache=[];this.destroyed=false;this.updateState=2;this.measureScheduled=-1;this.measureRequests=[];this.contentDOM=document.createElement("div");this.scrollDOM=document.createElement("div");this.scrollDOM.tabIndex=-1;this.scrollDOM.className="cm-scroller";this.scrollDOM.appendChild(this.contentDOM);this.announceDOM=document.createElement("div");this.announceDOM.className="cm-announced";this.announceDOM.setAttribute("aria-live","polite");this.dom=document.createElement("div");this.dom.appendChild(this.announceDOM);this.dom.appendChild(this.scrollDOM);if(t.parent)t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(t=>t.forEach((t=>i(t,this))))||(t=>this.update(t));this.dispatch=this.dispatch.bind(this);this._root=t.root||N(t.parent)||document;this.viewState=new Hs(t.state||s.EditorState.create(t));if(t.scrollTo&&t.scrollTo.is(ye))this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state);this.plugins=this.state.facet(ke).map((t=>new De(t)));for(let s of this.plugins)s.update(this);this.observer=new to(this);this.inputState=new ki(this);this.inputState.ensureHandlers(this.plugins);this.docView=new ze(this);this.mountStyles();this.updateAttrs();this.updateState=0;this.requestMeasure();if((e=document.fonts)===null||e===void 0?void 0:e.ready)document.fonts.ready.then((()=>this.requestMeasure()))}dispatch(...t){let e=t.length==1&&t[0]instanceof s.Transaction?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=false,i=false,o;let n=this.state;for(let s of t){if(s.startState!=n)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");n=s.state}if(this.destroyed){this.viewState.state=n;return}let r=this.hasFocus,l=0,a=null;if(t.some((t=>t.annotation(rs)))){this.inputState.notifiedFocused=r;l=1}else if(r!=this.inputState.notifiedFocused){this.inputState.notifiedFocused=r;a=ls(n,r);if(!a)l=1}let h=this.observer.delayedAndroidKey,f=null;if(h){this.observer.clearDelayedAndroidKey();f=this.observer.readChange();if(f&&!this.state.doc.eq(n.doc)||!this.state.selection.eq(n.selection))f=null}else{this.observer.clear()}if(n.facet(s.EditorState.phrases)!=this.state.facet(s.EditorState.phrases))return this.setState(n);o=We.create(this,n,t);o.flags|=l;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let e of t){if(c)c=c.map(e.changes);if(e.scrollIntoView){let{main:t}=e.state.selection;c=new be(t.empty?t:s.EditorSelection.cursor(t.head,t.head>t.anchor?-1:1))}for(let t of e.effects)if(t.is(ye))c=t.value.clip(this.state)}this.viewState.update(o,c);this.bidiCache=ao.update(this.bidiCache,o.changes);if(!o.empty){this.updatePlugins(o);this.inputState.update(o)}e=this.docView.update(o);if(this.state.facet(Ve)!=this.styleModules)this.mountStyles();i=this.updateAttrs();this.showAnnouncements(t);this.docView.updateSelection(e,t.some((t=>t.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(o.startState.facet(Ys)!=o.state.facet(Ys))this.viewState.mustMeasureContent=true;if(e||i||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)this.requestMeasure();if(e)this.docViewUpdate();if(!o.empty)for(let s of this.state.facet(ce)){try{s(o)}catch(d){xe(this.state,d,"update listener")}}if(a||f)Promise.resolve().then((()=>{if(a&&this.state==a.startState)this.dispatch(a);if(f){if(!bi(this,f)&&h.force)H(this.contentDOM,h.key,h.keyCode)}}))}setState(t){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=t;return}this.updateState=2;let e=this.hasFocus;try{for(let t of this.plugins)t.destroy(this);this.viewState=new Hs(t);this.plugins=t.facet(ke).map((t=>new De(t)));this.pluginMap.clear();for(let t of this.plugins)t.update(this);this.docView.destroy();this.docView=new ze(this);this.inputState.ensureHandlers(this.plugins);this.mountStyles();this.updateAttrs();this.bidiCache=[]}finally{this.updateState=0}if(e)this.focus();this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(ke),i=t.state.facet(ke);if(e!=i){let s=[];for(let o of i){let i=e.indexOf(o);if(i<0){s.push(new De(o))}else{let e=this.plugins[i];e.mustUpdate=t;s.push(e)}}for(let e of this.plugins)if(e.mustUpdate!=t)e.destroy(this);this.plugins=s;this.pluginMap.clear()}else{for(let e of this.plugins)e.mustUpdate=t}for(let s=0;s-1)this.win.cancelAnimationFrame(this.measureScheduled);if(this.observer.delayedAndroidKey){this.measureScheduled=-1;this.requestMeasure();return}this.measureScheduled=0;if(t)this.observer.forceFlush();let e=null;let i=this.scrollDOM,s=i.scrollTop*this.scaleY;let{scrollAnchorPos:o,scrollAnchorHeight:n}=this.viewState;if(Math.abs(s-this.viewState.scrollTop)>1)n=-1;this.viewState.scrollAnchorHeight=-1;try{for(let t=0;;t++){if(n<0){if(W(i)){o=-1;n=this.viewState.heightMap.height}else{let t=this.viewState.scrollAnchorAt(s);o=t.from;n=t.top}}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(t>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let a=[];if(!(l&4))[this.measureRequests,a]=[a,this.measureRequests];let h=a.map((t=>{try{return t.read(this)}catch(e){xe(this.state,e);return lo}}));let f=We.create(this,this.state,[]),c=false;f.flags|=l;if(!e)e=f;else e.flags|=l;this.updateState=2;if(!f.empty){this.updatePlugins(f);this.inputState.update(f);this.updateAttrs();c=this.docView.update(f);if(c)this.docViewUpdate()}for(let t=0;t1||e<-1){s=s+e;i.scrollTop=s/this.scaleY;n=-1;continue}}}break}}}finally{this.updateState=0;this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(ce))l(e)}get themeClasses(){return Xs+" "+(this.state.facet(_s)?js:Gs)+" "+this.state.facet(Ys)}updateAttrs(){let t=ho(this,Oe,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses});let e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:!this.state.facet(Me)?"false":"true",class:"cm-content",style:`${rt.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};if(this.state.readOnly)e["aria-readonly"]="true";ho(this,Te,e);let i=this.observer.ignore((()=>{let i=St(this.contentDOM,this.contentAttrs,e);let s=St(this.dom,this.editorAttrs,t);return i||s}));this.editorAttrs=t;this.contentAttrs=e;return i}showAnnouncements(t){let e=true;for(let i of t)for(let t of i.effects)if(t.is(no.announce)){if(e)this.announceDOM.textContent="";e=false;let i=this.announceDOM.appendChild(document.createElement("div"));i.textContent=t.value}}mountStyles(){this.styleModules=this.state.facet(Ve);let t=this.state.facet(no.cspNonce);o.StyleModule.mount(this.root,this.styleModules.concat(Qs).reverse(),t?{nonce:t}:undefined)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");if(this.updateState==0&&this.measureScheduled>-1)this.measure(false)}requestMeasure(t){if(this.measureScheduled<0)this.measureScheduled=this.win.requestAnimationFrame((()=>this.measure()));if(t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null)for(let e=0;ee.plugin==t))||null);return e&&e.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(t){this.readMeasured();return this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){this.readMeasured();return this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return ui(this,t,hi(this,t,e,i))}moveByGroup(t,e){return ui(this,t,hi(this,t,e,(e=>fi(this,t.head,e))))}visualLineSide(t,e){let i=this.bidiSpans(t),o=this.textDirectionAt(t.from);let n=i[e?i.length-1:0];return s.EditorSelection.cursor(n.side(e,o)+t.from,n.forward(!e,o)?1:-1)}moveToLineBoundary(t,e,i=true){return ai(this,t,e,i)}moveVertically(t,e,i){return ui(this,t,ci(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=true){this.readMeasured();return si(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let s=this.state.doc.lineAt(t),o=this.bidiSpans(s);let n=o[jt.find(o,t-s.from,-1,e)];return k(i,n.dir==Ft.LTR==e>0)}coordsForChar(t){this.readMeasured();return this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){let e=this.state.facet(me);if(!e||tthis.viewport.to)return this.textDirection;this.readMeasured();return this.docView.textDirectionAt(t)}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>ro)return se(t.length);let e=this.textDirectionAt(t.from),i;for(let o of this.bidiCache){if(o.from==t.from&&o.dir==e&&(o.fresh||$t(o.isolates,i=Pe(this,t))))return o.order}if(!i)i=Pe(this,t);let s=ie(t.text,e,i);this.bidiCache.push(new ao(t.from,t.to,e,i,true,s));return s}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||rt.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{B(this.contentDOM);this.docView.updateSelection()}))}setRoot(t){if(this._root!=t){this._root=t;this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window);this.mountStyles()}}destroy(){if(this.root.activeElement==this.contentDOM)this.contentDOM.blur();for(let t of this.plugins)t.destroy(this);this.plugins=[];this.inputState.destroy();this.docView.destroy();this.dom.remove();this.observer.destroy();if(this.measureScheduled>-1)this.win.cancelAnimationFrame(this.measureScheduled);this.destroyed=true}static scrollIntoView(t,e={}){return ye.of(new be(typeof t=="number"?s.EditorSelection.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM;let i=this.viewState.scrollAnchorAt(t);return ye.of(new be(s.EditorSelection.cursor(i.from),"start","start",i.top-t,e,true))}setTabFocusMode(t){if(t==null)this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1;else if(typeof t=="boolean")this.inputState.tabFocusMode=t?0:-1;else if(this.inputState.tabFocusMode!=0)this.inputState.tabFocusMode=Date.now()+t}static domEventHandlers(t){return Ae.define((()=>({})),{eventHandlers:t})}static domEventObservers(t){return Ae.define((()=>({})),{eventObservers:t})}static theme(t,e){let i=o.StyleModule.newName();let s=[Ys.of(i),Ve.of(Us(`.${i}`,t))];if(e&&e.dark)s.push(_s.of(true));return s}static baseTheme(t){return s.Prec.lowest(Ve.of(Us("."+Xs,t,$s)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content");let s=i&&Y.get(i)||Y.get(t);return((e=s===null||s===void 0?void 0:s.rootView)===null||e===void 0?void 0:e.view)||null}}no.styleModule=Ve;no.inputHandler=de;no.clipboardInputFilter=pe;no.clipboardOutputFilter=ge;no.scrollHandler=ve;no.focusChangeEffect=ue;no.perLineTextDirection=me;no.exceptionSink=fe;no.updateListener=ce;no.editable=Me;no.mouseSelectionStyle=he;no.dragMovesSelection=ae;no.clickAddsSelectionRange=le;no.decorations=Ee;no.outerDecorations=Re;no.atomicRanges=Be;no.bidiIsolatedRanges=Le;no.scrollMargins=He;no.darkTheme=_s;no.cspNonce=s.Facet.define({combine:t=>t.length?t[0]:""});no.contentAttributes=Te;no.editorAttributes=Oe;no.lineWrapping=no.contentAttributes.of({class:"cm-lineWrapping"});no.announce=s.StateEffect.define();const ro=4096;const lo={};class ao{constructor(t,e,i,s,o,n){this.from=t;this.to=e;this.dir=i;this.isolates=s;this.fresh=o;this.order=n}static update(t,e){if(e.empty&&!t.some((t=>t.fresh)))return t;let i=[],s=t.length?t[t.length-1].dir:Ft.LTR;for(let o=Math.max(0,t.length-10);o=0;o--){let e=s[o],n=typeof e=="function"?e(t):e;if(n)vt(n,i)}return i}const fo=rt.mac?"mac":rt.windows?"win":rt.linux?"linux":"key";function co(t,e){const i=t.split(/-(?!$)/);let s=i[i.length-1];if(s=="Space")s=" ";let o,n,r,l;for(let a=0;at.concat(e)),[])));return i}function vo(t,e,i){return Mo(wo(t.state),e,t,i)}let bo=null;const yo=4e3;function So(t,e=fo){let i=Object.create(null);let s=Object.create(null);let o=(t,e)=>{let i=s[t];if(i==null)s[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")};let n=(t,s,n,r,l)=>{var a,h;let f=i[t]||(i[t]=Object.create(null));let c=s.split(/ (?!$)/).map((t=>co(t,e)));for(let e=1;e{let s=bo={view:e,prefix:i,scope:t};setTimeout((()=>{if(bo==s)bo=null}),yo);return true}]}}let d=c.join(" ");o(d,false);let u=f[d]||(f[d]={preventDefault:false,stopPropagation:false,run:((h=(a=f._any)===null||a===void 0?void 0:a.run)===null||h===void 0?void 0:h.slice())||[]});if(n)u.run.push(n);if(r)u.preventDefault=true;if(l)u.stopPropagation=true};for(let r of t){let t=r.scope?r.scope.split(" "):["editor"];if(r.any)for(let e of t){let t=i[e]||(i[e]=Object.create(null));if(!t._any)t._any={preventDefault:false,stopPropagation:false,run:[]};let{any:s}=r;for(let e in t)t[e].run.push((t=>s(t,xo)))}let s=r[e]||r.key;if(!s)continue;for(let e of t){n(e,s,r.run,r.preventDefault,r.stopPropagation);if(r.shift)n(e,"Shift-"+s,r.shift,r.preventDefault,r.stopPropagation)}}return i}let xo=null;function Mo(t,e,i,o){xo=e;let l=p(e);let a=(0,s.codePointAt)(l,0),h=(0,s.codePointSize)(a)==l.length&&l!=" ";let f="",c=false,d=false,u=false;if(bo&&bo.view==i&&bo.scope==o){f=bo.prefix+" ";if(Ei.indexOf(e.keyCode)<0){d=true;bo=null}}let g=new Set;let m=t=>{if(t){for(let e of t.run)if(!g.has(e)){g.add(e);if(e(i)){if(t.stopPropagation)u=true;return true}}if(t.preventDefault){if(t.stopPropagation)u=true;d=true}}return false};let w=t[o],v,b;if(w){if(m(w[f+uo(l,e,!h)])){c=true}else if(h&&(e.altKey||e.metaKey||e.ctrlKey)&&!(rt.windows&&e.ctrlKey&&e.altKey)&&!(rt.mac&&e.altKey&&!e.ctrlKey)&&(v=n[e.keyCode])&&v!=l){if(m(w[f+uo(v,e,true)])){c=true}else if(e.shiftKey&&(b=r[e.keyCode])!=l&&b!=v&&m(w[f+uo(b,e,false)])){c=true}}else if(h&&e.shiftKey&&m(w[f+uo(l,e,true)])){c=true}if(!c&&m(w._any))c=true}if(d)c=true;if(c&&u)e.stopPropagation();xo=null;return c}class Co{constructor(t,e,i,s,o){this.className=t;this.left=e;this.top=i;this.width=s;this.height=o}draw(){let t=document.createElement("div");t.className=this.className;this.adjust(t);return t}update(t,e){if(e.className!=this.className)return false;this.adjust(t);return true}adjust(t){t.style.left=this.left+"px";t.style.top=this.top+"px";if(this.width!=null)t.style.width=this.width+"px";t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let s=t.coordsAtPos(i.head,i.assoc||1);if(!s)return[];let o=ko(t);return[new Co(e,s.left-o.left,s.top-o.top,null,s.bottom-s.top)]}else{return Do(t,e,i)}}}function ko(t){let e=t.scrollDOM.getBoundingClientRect();let i=t.textDirection==Ft.LTR?e.left:e.right-t.scrollDOM.clientWidth*t.scaleX;return{left:i-t.scrollDOM.scrollLeft*t.scaleX,top:e.top-t.scrollDOM.scrollTop*t.scaleY}}function Ao(t,e,i,s){let o=t.coordsAtPos(e,i*2);if(!o)return s;let n=t.dom.getBoundingClientRect();let r=(o.top+o.bottom)/2;let l=t.posAtCoords({x:n.left+1,y:r});let a=t.posAtCoords({x:n.right-1,y:r});if(l==null||a==null)return s;return{from:Math.max(s.from,Math.min(l,a)),to:Math.min(s.to,Math.max(l,a))}}function Do(t,e,i){if(i.to<=t.viewport.from||i.from>=t.viewport.to)return[];let s=Math.max(i.from,t.viewport.from),o=Math.min(i.to,t.viewport.to);let n=t.textDirection==Ft.LTR;let r=t.contentDOM,l=r.getBoundingClientRect(),a=ko(t);let h=r.querySelector(".cm-line"),f=h&&window.getComputedStyle(h);let c=l.left+(f?parseInt(f.paddingLeft)+Math.min(0,parseInt(f.textIndent)):0);let d=l.right-(f?parseInt(f.paddingRight):0);let u=li(t,s,1),p=li(t,o,-1);let g=u.type==Ct.Text?u:null;let m=p.type==Ct.Text?p:null;if(g&&(t.lineWrapping||u.widgetLineBreaks))g=Ao(t,s,1,g);if(m&&(t.lineWrapping||p.widgetLineBreaks))m=Ao(t,o,-1,m);if(g&&m&&g.from==m.from&&g.to==m.to){return v(b(i.from,i.to,g))}else{let e=g?b(i.from,null,g):y(u,false);let s=m?b(null,i.to,m):y(p,true);let o=[];if((g||u).to<(m||p).from-(g&&m?1:0)||u.widgetLineBreaks>1&&e.bottom+t.defaultLineHeight/2h&&n.from=o)break;if(l>s)a(Math.max(t,s),e==null&&t<=h,Math.min(l,o),i==null&&l>=f,r.dir)}s=n.to+1;if(s>=o)break}}if(l.length==0)a(h,e==null,f,i==null,t.textDirection);return{top:o,bottom:r,horizontal:l}}function y(t,e){let i=l.top+(e?t.top:t.bottom);return{top:i,bottom:i,horizontal:[]}}}function Oo(t,e){return t.constructor==e.constructor&&t.eq(e)}class To{constructor(t,e){this.view=t;this.layer=e;this.drawn=[];this.scaleX=1;this.scaleY=1;this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)};this.dom=t.scrollDOM.appendChild(document.createElement("div"));this.dom.classList.add("cm-layer");if(e.above)this.dom.classList.add("cm-layer-above");if(e.class)this.dom.classList.add(e.class);this.scale();this.dom.setAttribute("aria-hidden","true");this.setOrder(t.state);t.requestMeasure(this.measureReq);if(e.mount)e.mount(this.dom,t)}update(t){if(t.startState.facet(Eo)!=t.state.facet(Eo))this.setOrder(t.state);if(this.layer.update(t,this.dom)||t.geometryChanged){this.scale();t.view.requestMeasure(this.measureReq)}}docViewUpdate(t){if(this.layer.updateOnDocViewUpdate!==false)t.requestMeasure(this.measureReq)}setOrder(t){let e=0,i=t.facet(Eo);while(e!Oo(t,this.drawn[e])))){let e=this.dom.firstChild,i=0;for(let s of t){if(s.update&&e&&s.constructor&&this.drawn[i].constructor&&s.update(e,this.drawn[i])){e=e.nextSibling;i++}else{this.dom.insertBefore(s.draw(),e)}}while(e){let t=e.nextSibling;e.remove();e=t}this.drawn=t}}destroy(){if(this.layer.destroy)this.layer.destroy(this.dom,this.view);this.dom.remove()}}const Eo=s.Facet.define();function Ro(t){return[Ae.define((e=>new To(e,t))),Eo.of(t)]}const Bo=s.Facet.define({combine(t){return(0,s.combineConfig)(t,{cursorBlinkRate:1200,drawRangeCursor:true},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function Lo(t={}){return[Bo.of(t),No,Fo,Wo,we.of(true)]}function Po(t){return t.facet(Bo)}function Ho(t){return t.startState.facet(Bo)!=t.state.facet(Bo)}const No=Ro({above:true,markers(t){let{state:e}=t,i=e.facet(Bo);let o=[];for(let n of e.selection.ranges){let r=n==e.selection.main;if(n.empty||i.drawRangeCursor){let e=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary";let i=n.empty?n:s.EditorSelection.cursor(n.head,n.head>n.anchor?-1:1);for(let s of Co.forRange(t,e,i))o.push(s)}}return o},update(t,e){if(t.transactions.some((t=>t.selection)))e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink";let i=Ho(t);if(i)Vo(t.state,e);return t.docChanged||t.selectionSet||i},mount(t,e){Vo(e.state,t)},class:"cm-cursorLayer"});function Vo(t,e){e.style.animationDuration=t.facet(Bo).cursorBlinkRate+"ms"}const Fo=Ro({above:false,markers(t){return t.state.selection.ranges.map((e=>e.empty?[]:Co.forRange(t,"cm-selectionBackground",e))).reduce(((t,e)=>t.concat(e)))},update(t,e){return t.docChanged||t.selectionSet||t.viewportChanged||Ho(t)},class:"cm-selectionLayer"});const Wo=s.Prec.highest(no.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}}));const zo=s.StateEffect.define({map(t,e){return t==null?null:e.mapPos(t)}});const Io=s.StateField.define({create(){return null},update(t,e){if(t!=null)t=e.changes.mapPos(t);return e.effects.reduce(((t,e)=>e.is(zo)?e.value:t),t)}});const qo=Ae.fromClass(class{constructor(t){this.view=t;this.cursor=null;this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(t){var e;let i=t.state.field(Io);if(i==null){if(this.cursor!=null){(e=this.cursor)===null||e===void 0?void 0:e.remove();this.cursor=null}}else{if(!this.cursor){this.cursor=this.view.scrollDOM.appendChild(document.createElement("div"));this.cursor.className="cm-dropCursor"}if(t.startState.field(Io)!=i||t.docChanged||t.geometryChanged)this.view.requestMeasure(this.measureReq)}}readPos(){let{view:t}=this;let e=t.state.field(Io);let i=e!=null&&t.coordsAtPos(e);if(!i)return null;let s=t.scrollDOM.getBoundingClientRect();return{left:i.left-s.left+t.scrollDOM.scrollLeft*t.scaleX,top:i.top-s.top+t.scrollDOM.scrollTop*t.scaleY,height:i.bottom-i.top}}drawCursor(t){if(this.cursor){let{scaleX:e,scaleY:i}=this.view;if(t){this.cursor.style.left=t.left/e+"px";this.cursor.style.top=t.top/i+"px";this.cursor.style.height=t.height/i+"px"}else{this.cursor.style.left="-100000px"}}}destroy(){if(this.cursor)this.cursor.remove()}setDropPos(t){if(this.view.state.field(Io)!=t)this.view.dispatch({effects:zo.of(t)})}},{eventObservers:{dragover(t){this.setDropPos(this.view.posAtCoords({x:t.clientX,y:t.clientY}))},dragleave(t){if(t.target==this.view.contentDOM||!this.view.contentDOM.contains(t.relatedTarget))this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Ko(){return[Io,qo]}function Yo(t,e,i,s,o){e.lastIndex=0;for(let n=t.iterRange(i,s),r=i,l;!n.next().done;r+=n.value.length){if(!n.lineBreak)while(l=e.exec(n.value))o(r+l.index,l)}}function _o(t,e){let i=t.visibleRanges;if(i.length==1&&i[0].from==t.viewport.from&&i[0].to==t.viewport.to)return i;let s=[];for(let{from:o,to:n}of i){o=Math.max(t.state.doc.lineAt(o).from,o-e);n=Math.min(t.state.doc.lineAt(n).to,n+e);if(s.length&&s[s.length-1].to>=o)s[s.length-1].to=n;else s.push({from:o,to:n})}return s}class Xo{constructor(t){const{regexp:e,decoration:i,decorate:s,boundary:o,maxLength:n=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");this.regexp=e;if(s){this.addMatch=(t,e,i,o)=>s(o,i,i+t[0].length,t,e)}else if(typeof i=="function"){this.addMatch=(t,e,s,o)=>{let n=i(t,e,s);if(n)o(s,s+t[0].length,n)}}else if(i){this.addMatch=(t,e,s,o)=>o(s,s+t[0].length,i)}else{throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator")}this.boundary=o;this.maxLength=n}createDeco(t){let e=new s.RangeSetBuilder,i=e.add.bind(e);for(let{from:s,to:o}of _o(t,this.maxLength))Yo(t.state.doc,this.regexp,s,o,((e,s)=>this.addMatch(s,t,e,i)));return e.finish()}updateDeco(t,e){let i=1e9,s=-1;if(t.docChanged)t.changes.iterChanges(((e,o,n,r)=>{if(r>=t.view.viewport.from&&n<=t.view.viewport.to){i=Math.min(n,i);s=Math.max(r,s)}}));if(t.viewportMoved||s-i>1e3)return this.createDeco(t.view);if(s>-1)return this.updateRange(t.view,e.map(t.changes),i,s);return e}updateRange(t,e,i,s){for(let o of t.visibleRanges){let n=Math.max(o.from,i),r=Math.min(o.to,s);if(r>=n){let i=t.state.doc.lineAt(n),s=i.toi.from;n--)if(this.boundary.test(i.text[n-1-i.from])){l=n;break}for(;rh.push(i.range(t,e));if(i==s){this.regexp.lastIndex=l-i.from;while((f=this.regexp.exec(i.text))&&f.indexthis.addMatch(i,t,e,c)))}e=e.update({filterFrom:l,filterTo:a,filter:(t,e)=>ta,add:h})}}return e}}const Go=/x/.unicode!=null?"gu":"g";const jo=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",Go);const $o={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Uo=null;function Qo(){var t;if(Uo==null&&typeof document!="undefined"&&document.body){let e=document.body.style;Uo=((t=e.tabSize)!==null&&t!==void 0?t:e.MozTabSize)!=null}return Uo||false}const Jo=s.Facet.define({combine(t){let e=(0,s.combineConfig)(t,{render:null,specialChars:jo,addSpecialChars:null});if(e.replaceTabs=!Qo())e.specialChars=new RegExp("\t|"+e.specialChars.source,Go);if(e.addSpecialChars)e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Go);return e}});function Zo(t={}){return[Jo.of(t),en()]}let tn=null;function en(){return tn||(tn=Ae.fromClass(class{constructor(t){this.view=t;this.decorations=kt.none;this.decorationCache=Object.create(null);this.decorator=this.makeDecorator(t.state.facet(Jo));this.decorations=this.decorator.createDeco(t)}makeDecorator(t){return new Xo({regexp:t.specialChars,decoration:(e,i,o)=>{let{doc:n}=i.state;let r=(0,s.codePointAt)(e[0],0);if(r==9){let t=n.lineAt(o);let e=i.state.tabSize,r=(0,s.countColumn)(t.text,e,o-t.from);return kt.replace({widget:new rn((e-r%e)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=kt.replace({widget:new nn(t,r)}))},boundary:t.replaceTabs?undefined:/[^]/})}update(t){let e=t.state.facet(Jo);if(t.startState.facet(Jo)!=e){this.decorator=this.makeDecorator(e);this.decorations=this.decorator.createDeco(t.view)}else{this.decorations=this.decorator.updateDeco(t,this.decorations)}}},{decorations:t=>t.decorations}))}const sn="•";function on(t){if(t>=32)return sn;if(t==10)return"␤";return String.fromCharCode(9216+t)}class nn extends Mt{constructor(t,e){super();this.options=t;this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=on(this.code);let i=t.state.phrase("Control character")+" "+($o[this.code]||"0x"+this.code.toString(16));let s=this.options.render&&this.options.render(this.code,i,e);if(s)return s;let o=document.createElement("span");o.textContent=e;o.title=i;o.setAttribute("aria-label",i);o.className="cm-specialChar";return o}ignoreEvent(){return false}}class rn extends Mt{constructor(t){super();this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");t.textContent="\t";t.className="cm-tab";t.style.width=this.width+"px";return t}ignoreEvent(){return false}}const ln=Ae.fromClass(class{constructor(){this.height=1e3;this.attrs={style:"padding-bottom: 1000px"}}update(t){let{view:e}=t;let i=e.viewState.editorHeight-e.defaultLineHeight-e.documentPadding.top-.5;if(i>=0&&i!=this.height){this.height=i;this.attrs={style:`padding-bottom: ${i}px`}}}});function an(){return[ln,Te.of((t=>{var e;return((e=t.plugin(ln))===null||e===void 0?void 0:e.attrs)||null}))]}function hn(){return cn}const fn=kt.line({class:"cm-activeLine"});const cn=Ae.fromClass(class{constructor(t){this.decorations=this.getDeco(t)}update(t){if(t.docChanged||t.selectionSet)this.decorations=this.getDeco(t.view)}getDeco(t){let e=-1,i=[];for(let s of t.state.selection.ranges){let o=t.lineBlockAt(s.head);if(o.from>e){i.push(fn.range(o.from));e=o.from}}return kt.set(i)}},{decorations:t=>t.decorations});class dn extends Mt{constructor(t){super();this.content=t}toDOM(t){let e=document.createElement("span");e.className="cm-placeholder";e.style.pointerEvents="none";e.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(t):this.content.cloneNode(true));e.setAttribute("aria-hidden","true");return e}coordsAt(t){let e=t.firstChild?b(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode);let s=k(e[0],i.direction!="rtl");let o=parseInt(i.lineHeight);if(s.bottom-s.top>o*1.5)return{left:s.left,right:s.right,top:s.top,bottom:s.top+o};return s}ignoreEvent(){return false}}function un(t){let e=Ae.fromClass(class{constructor(e){this.view=e;this.placeholder=t?kt.set([kt.widget({widget:new dn(t),side:1}).range(0)]):kt.none}get decorations(){return this.view.state.doc.length?kt.none:this.placeholder}},{decorations:t=>t.decorations});return typeof t=="string"?[e,no.contentAttributes.of({"aria-placeholder":t})]:e}const pn=2e3;function gn(t,e,i){let o=Math.min(e.line,i.line),n=Math.max(e.line,i.line);let r=[];if(e.off>pn||i.off>pn||e.col<0||i.col<0){let l=Math.min(e.off,i.off),a=Math.max(e.off,i.off);for(let e=o;e<=n;e++){let i=t.doc.line(e);if(i.length<=a)r.push(s.EditorSelection.range(i.from+l,i.to+a))}}else{let l=Math.min(e.col,i.col),a=Math.max(e.col,i.col);for(let e=o;e<=n;e++){let i=t.doc.line(e);let o=(0,s.findColumn)(i.text,l,t.tabSize,true);if(o<0){r.push(s.EditorSelection.cursor(i.to))}else{let e=(0,s.findColumn)(i.text,a,t.tabSize);r.push(s.EditorSelection.range(i.from+o,i.from+e))}}}return r}function mn(t,e){let i=t.coordsAtPos(t.viewport.from);return i?Math.round(Math.abs((i.left-e)/t.defaultCharacterWidth)):-1}function wn(t,e){let i=t.posAtCoords({x:e.clientX,y:e.clientY},false);let o=t.state.doc.lineAt(i),n=i-o.from;let r=n>pn?-1:n==o.length?mn(t,e.clientX):(0,s.countColumn)(o.text,t.state.tabSize,i-o.from);return{line:o.number,col:r,off:n}}function vn(t,e){let i=wn(t,e),o=t.state.selection;if(!i)return null;return{update(t){if(t.docChanged){let e=t.changes.mapPos(t.startState.doc.line(i.line).from);let s=t.state.doc.lineAt(e);i={line:s.number,col:i.col,off:Math.min(i.off,s.length)};o=o.map(t.changes)}},get(e,n,r){let l=wn(t,e);if(!l)return o;let a=gn(t.state,i,l);if(!a.length)return o;if(r)return s.EditorSelection.create(a.concat(o.ranges));else return s.EditorSelection.create(a)}}}function bn(t){let e=(t===null||t===void 0?void 0:t.eventFilter)||(t=>t.altKey&&t.button==0);return no.mouseSelectionStyle.of(((t,i)=>e(i)?vn(t,i):null))}const yn={Alt:[18,t=>!!t.altKey],Control:[17,t=>!!t.ctrlKey],Shift:[16,t=>!!t.shiftKey],Meta:[91,t=>!!t.metaKey]};const Sn={style:"cursor: crosshair"};function xn(t={}){let[e,i]=yn[t.key||"Alt"];let s=Ae.fromClass(class{constructor(t){this.view=t;this.isDown=false}set(t){if(this.isDown!=t){this.isDown=t;this.view.update([])}}},{eventObservers:{keydown(t){this.set(t.keyCode==e||i(t))},keyup(t){if(t.keyCode==e||!i(t))this.set(false)},mousemove(t){this.set(i(t))}}});return[s,no.contentAttributes.of((t=>{var e;return((e=t.plugin(s))===null||e===void 0?void 0:e.isDown)?Sn:null}))]}const Mn="-10000px";class Cn{constructor(t,e,i,s){this.facet=e;this.createTooltipView=i;this.removeTooltipView=s;this.input=t.state.facet(e);this.tooltips=this.input.filter((t=>t));let o=null;this.tooltipViews=this.tooltips.map((t=>o=i(t,o)))}update(t,e){var i;let s=t.state.facet(this.facet);let o=s.filter((t=>t));if(s===this.input){for(let e of this.tooltipViews)if(e.update)e.update(t);return false}let n=[],r=e?[]:null;for(let l=0;le[i]=t));e.length=r.length}this.input=s;this.tooltips=o;this.tooltipViews=n;return true}}function kn(t={}){return Dn.of(t)}function An(t){let e=t.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Dn=s.Facet.define({combine:t=>{var e,i,s;return{position:rt.ios?"absolute":((e=t.find((t=>t.position)))===null||e===void 0?void 0:e.position)||"fixed",parent:((i=t.find((t=>t.parent)))===null||i===void 0?void 0:i.parent)||null,tooltipSpace:((s=t.find((t=>t.tooltipSpace)))===null||s===void 0?void 0:s.tooltipSpace)||An}}});const On=new WeakMap;const Tn=Ae.fromClass(class{constructor(t){this.view=t;this.above=[];this.inView=true;this.madeAbsolute=false;this.lastTransaction=0;this.measureTimeout=-1;let e=t.state.facet(Dn);this.position=e.position;this.parent=e.parent;this.classes=t.themeClasses;this.createContainer();this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this};this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver((()=>this.measureSoon())):null;this.manager=new Cn(t,Ln,((t,e)=>this.createTooltip(t,e)),(t=>{if(this.resizeObserver)this.resizeObserver.unobserve(t.dom);t.dom.remove()}));this.above=this.manager.tooltips.map((t=>!!t.above));this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver((t=>{if(Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1)this.measureSoon()}),{threshold:[1]}):null;this.observeIntersection();t.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this));this.maybeMeasure()}createContainer(){if(this.parent){this.container=document.createElement("div");this.container.style.position="relative";this.container.className=this.view.themeClasses;this.parent.appendChild(this.container)}else{this.container=this.view.dom}}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let t of this.manager.tooltipViews)this.intersectionObserver.observe(t.dom)}}measureSoon(){if(this.measureTimeout<0)this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1;this.maybeMeasure()}),50)}update(t){if(t.transactions.length)this.lastTransaction=Date.now();let e=this.manager.update(t,this.above);if(e)this.observeIntersection();let i=e||t.geometryChanged;let s=t.state.facet(Dn);if(s.position!=this.position&&!this.madeAbsolute){this.position=s.position;for(let t of this.manager.tooltipViews)t.dom.style.position=this.position;i=true}if(s.parent!=this.parent){if(this.parent)this.container.remove();this.parent=s.parent;this.createContainer();for(let t of this.manager.tooltipViews)this.container.appendChild(t.dom);i=true}else if(this.parent&&this.view.themeClasses!=this.classes){this.classes=this.container.className=this.view.themeClasses}if(i)this.maybeMeasure()}createTooltip(t,e){let i=t.create(this.view);let s=e?e.dom:null;i.dom.classList.add("cm-tooltip");if(t.arrow&&!i.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow";i.dom.appendChild(t)}i.dom.style.position=this.position;i.dom.style.top=Mn;i.dom.style.left="0px";this.container.insertBefore(i.dom,s);if(i.mount)i.mount(this.view);if(this.resizeObserver)this.resizeObserver.observe(i.dom);return i}destroy(){var t,e,i;this.view.win.removeEventListener("resize",this.measureSoon);for(let s of this.manager.tooltipViews){s.dom.remove();(t=s.destroy)===null||t===void 0?void 0:t.call(s)}if(this.parent)this.container.remove();(e=this.resizeObserver)===null||e===void 0?void 0:e.disconnect();(i=this.intersectionObserver)===null||i===void 0?void 0:i.disconnect();clearTimeout(this.measureTimeout)}readMeasure(){let t=1,e=1,i=false;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:t}=this.manager.tooltipViews[0];if(rt.gecko){i=t.offsetParent!=this.container.ownerDocument.body}else if(t.style.top==Mn&&t.style.left=="0px"){let e=t.getBoundingClientRect();i=Math.abs(e.top+1e4)>1||Math.abs(e.left)>1}}if(i||this.position=="absolute"){if(this.parent){let i=this.parent.getBoundingClientRect();if(i.width&&i.height){t=i.width/this.parent.offsetWidth;e=i.height/this.parent.offsetHeight}}else{({scaleX:t,scaleY:e}=this.view.viewState)}}let s=this.view.scrollDOM.getBoundingClientRect(),o=Ne(this.view);return{visible:{left:s.left+o.left,top:s.top+o.top,right:s.right-o.right,bottom:s.bottom-o.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map(((t,e)=>{let i=this.manager.tooltipViews[e];return i.getCoords?i.getCoords(t.pos):this.view.coordsAtPos(t.pos)})),size:this.manager.tooltipViews.map((({dom:t})=>t.getBoundingClientRect())),space:this.view.state.facet(Dn).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(t){var e;if(t.makeAbsolute){this.madeAbsolute=true;this.position="absolute";for(let t of this.manager.tooltipViews)t.dom.style.position="absolute"}let{visible:i,space:s,scaleX:o,scaleY:n}=t;let r=[];for(let l=0;l=Math.min(i.bottom,s.bottom)||c.rightMath.min(i.right,s.right)+.1)){f.style.top=Mn;continue}let u=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null;let p=u?7:0;let g=d.right-d.left,m=(e=On.get(h))!==null&&e!==void 0?e:d.bottom-d.top;let w=h.offset||Bn,v=this.view.textDirection==Ft.LTR;let b=d.width>s.right-s.left?v?s.left:s.right-d.width:v?Math.max(s.left,Math.min(c.left-(u?14:0)+w.x,s.right-g)):Math.min(Math.max(s.left,c.left-g+(u?14:0)-w.x),s.right-g);let y=this.above[l];if(!a.strictSide&&(y?c.top-m-p-w.ys.bottom)&&y==s.bottom-c.bottom>c.top-s.top)y=this.above[l]=!y;let S=(y?c.top-s.top:s.bottom-c.bottom)-p;if(Sb&&t.topx)x=y?t.top-m-2-p:t.bottom+p+2;if(this.position=="absolute"){f.style.top=(x-t.parent.top)/n+"px";En(f,(b-t.parent.left)/o)}else{f.style.top=x/n+"px";En(f,b/o)}if(u){let t=c.left+(v?w.x:-w.x)-(b+14-7);u.style.left=t/o+"px"}if(h.overlap!==true)r.push({left:b,top:x,right:M,bottom:x+m});f.classList.toggle("cm-tooltip-above",y);f.classList.toggle("cm-tooltip-below",!y);if(h.positioned)h.positioned(t.space)}}maybeMeasure(){if(this.manager.tooltips.length){if(this.view.inView)this.view.requestMeasure(this.measureReq);if(this.inView!=this.view.inView){this.inView=this.view.inView;if(!this.inView)for(let t of this.manager.tooltipViews)t.dom.style.top=Mn}}}},{eventObservers:{scroll(){this.maybeMeasure()}}});function En(t,e){let i=parseInt(t.style.left,10);if(isNaN(i)||Math.abs(e-i)>1)t.style.left=e+"px"}const Rn=no.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:`${7}px`,width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:`${7}px solid transparent`,borderRight:`${7}px solid transparent`},".cm-tooltip-above &":{bottom:`-${7}px`,"&:before":{borderTop:`${7}px solid #bbb`},"&:after":{borderTop:`${7}px solid #f5f5f5`,bottom:"1px"}},".cm-tooltip-below &":{top:`-${7}px`,"&:before":{borderBottom:`${7}px solid #bbb`},"&:after":{borderBottom:`${7}px solid #f5f5f5`,top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}});const Bn={x:0,y:0};const Ln=s.Facet.define({enables:[Tn,Rn]});const Pn=s.Facet.define({combine:t=>t.reduce(((t,e)=>t.concat(e)),[])});class Hn{static create(t){return new Hn(t)}constructor(t){this.view=t;this.mounted=false;this.dom=document.createElement("div");this.dom.classList.add("cm-tooltip-hover");this.manager=new Cn(t,Pn,((t,e)=>this.createHostedView(t,e)),(t=>t.dom.remove()))}createHostedView(t,e){let i=t.create(this.view);i.dom.classList.add("cm-tooltip-section");this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild);if(this.mounted&&i.mount)i.mount(this.view);return i}mount(t){for(let e of this.manager.tooltipViews){if(e.mount)e.mount(t)}this.mounted=true}positioned(t){for(let e of this.manager.tooltipViews){if(e.positioned)e.positioned(t)}}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)(t=e.destroy)===null||t===void 0?void 0:t.call(e)}passProp(t){let e=undefined;for(let i of this.manager.tooltipViews){let s=i[t];if(s!==undefined){if(e===undefined)e=s;else if(e!==s)return undefined}}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const Nn=Ln.compute([Pn],(t=>{let e=t.facet(Pn);if(e.length===0)return null;return{pos:Math.min(...e.map((t=>t.pos))),end:Math.max(...e.map((t=>{var e;return(e=t.end)!==null&&e!==void 0?e:t.pos}))),create:Hn.create,above:e[0].above,arrow:e.some((t=>t.arrow))}}));class Vn{constructor(t,e,i,s,o){this.view=t;this.source=e;this.field=i;this.setHover=s;this.hoverTime=o;this.hoverTimeout=-1;this.restartTimeout=-1;this.pending=null;this.lastMove={x:0,y:0,target:t.dom,time:0};this.checkHover=this.checkHover.bind(this);t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this));t.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){if(this.pending){this.pending=null;clearTimeout(this.restartTimeout);this.restartTimeout=setTimeout((()=>this.startHover()),20)}}get active(){return this.view.state.field(this.field)}checkHover(){this.hoverTimeout=-1;if(this.active.length)return;let t=Date.now()-this.lastMove.time;if(ti.bottom||e.xi.right+t.defaultCharacterWidth)return;let n=t.bidiSpans(t.state.doc.lineAt(s)).find((t=>t.from<=s&&t.to>=s));let r=n&&n.dir==Ft.RTL?-1:1;o=e.x{if(this.pending==e){this.pending=null;if(i&&!(Array.isArray(i)&&!i.length))t.dispatch({effects:this.setHover.of(Array.isArray(i)?i:[i])})}}),(e=>xe(t.state,e,"hover tooltip")))}else if(n&&!(Array.isArray(n)&&!n.length)){t.dispatch({effects:this.setHover.of(Array.isArray(n)?n:[n])})}}get tooltip(){let t=this.view.plugin(Tn);let e=t?t.manager.tooltips.findIndex((t=>t.create==Hn.create)):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()};if(this.hoverTimeout<0)this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime);let{active:s,tooltip:o}=this;if(s.length&&o&&!Wn(o.dom,t)||this.pending){let{pos:o}=s[0]||this.pending,n=(i=(e=s[0])===null||e===void 0?void 0:e.end)!==null&&i!==void 0?i:o;if(o==n?this.view.posAtCoords(this.lastMove)!=o:!zn(this.view,o,n,t.clientX,t.clientY)){this.view.dispatch({effects:this.setHover.of([])});this.pending=null}}}mouseleave(t){clearTimeout(this.hoverTimeout);this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:e}=this;let i=e&&e.dom.contains(t.relatedTarget);if(!i)this.view.dispatch({effects:this.setHover.of([])});else this.watchTooltipLeave(e.dom)}}watchTooltipLeave(t){let e=i=>{t.removeEventListener("mouseleave",e);if(this.active.length&&!this.view.dom.contains(i.relatedTarget))this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout);this.view.dom.removeEventListener("mouseleave",this.mouseleave);this.view.dom.removeEventListener("mousemove",this.mousemove)}}const Fn=4;function Wn(t,e){let{left:i,right:s,top:o,bottom:n}=t.getBoundingClientRect(),r;if(r=t.querySelector(".cm-tooltip-arrow")){let t=r.getBoundingClientRect();o=Math.min(t.top,o);n=Math.max(t.bottom,n)}return e.clientX>=i-Fn&&e.clientX<=s+Fn&&e.clientY>=o-Fn&&e.clientY<=n+Fn}function zn(t,e,i,s,o,n){let r=t.scrollDOM.getBoundingClientRect();let l=t.documentTop+t.documentPadding.top+t.contentHeight;if(r.left>s||r.righto||Math.min(r.bottom,l)=e&&a<=i}function In(t,e={}){let i=s.StateEffect.define();let o=s.StateField.define({create(){return[]},update(t,o){if(t.length){if(e.hideOnChange&&(o.docChanged||o.selection))t=[];else if(e.hideOn)t=t.filter((t=>!e.hideOn(o,t)));if(o.docChanged){let e=[];for(let i of t){let t=o.changes.mapPos(i.pos,-1,s.MapMode.TrackDel);if(t!=null){let s=Object.assign(Object.create(null),i);s.pos=t;if(s.end!=null)s.end=o.changes.mapPos(s.end);e.push(s)}}t=e}}for(let e of o.effects){if(e.is(i))t=e.value;if(e.is(Yn))t=[]}return t},provide:t=>Pn.from(t)});return{active:o,extension:[o,Ae.define((s=>new Vn(s,t,o,i,e.hoverTime||300))),Nn]}}function qn(t,e){let i=t.plugin(Tn);if(!i)return null;let s=i.manager.tooltips.indexOf(e);return s<0?null:i.manager.tooltipViews[s]}function Kn(t){return t.facet(Pn).some((t=>t))}const Yn=s.StateEffect.define();const _n=Yn.of(null);function Xn(t){let e=t.plugin(Tn);if(e)e.maybeMeasure()}const Gn=s.Facet.define({combine(t){let e,i;for(let s of t){e=e||s.topContainer;i=i||s.bottomContainer}return{topContainer:e,bottomContainer:i}}});function jn(t){return t?[Gn.of(t)]:[]}function $n(t,e){let i=t.plugin(Un);let s=i?i.specs.indexOf(e):-1;return s>-1?i.panels[s]:null}const Un=Ae.fromClass(class{constructor(t){this.input=t.state.facet(Zn);this.specs=this.input.filter((t=>t));this.panels=this.specs.map((e=>e(t)));let e=t.state.facet(Gn);this.top=new Qn(t,true,e.topContainer);this.bottom=new Qn(t,false,e.bottomContainer);this.top.sync(this.panels.filter((t=>t.top)));this.bottom.sync(this.panels.filter((t=>!t.top)));for(let i of this.panels){i.dom.classList.add("cm-panel");if(i.mount)i.mount()}}update(t){let e=t.state.facet(Gn);if(this.top.container!=e.topContainer){this.top.sync([]);this.top=new Qn(t.view,true,e.topContainer)}if(this.bottom.container!=e.bottomContainer){this.bottom.sync([]);this.bottom=new Qn(t.view,false,e.bottomContainer)}this.top.syncClasses();this.bottom.syncClasses();let i=t.state.facet(Zn);if(i!=this.input){let e=i.filter((t=>t));let s=[],o=[],n=[],r=[];for(let i of e){let e=this.specs.indexOf(i),l;if(e<0){l=i(t.view);r.push(l)}else{l=this.panels[e];if(l.update)l.update(t)}s.push(l);(l.top?o:n).push(l)}this.specs=e;this.panels=s;this.top.sync(o);this.bottom.sync(n);for(let t of r){t.dom.classList.add("cm-panel");if(t.mount)t.mount()}}else{for(let e of this.panels)if(e.update)e.update(t)}}destroy(){this.top.sync([]);this.bottom.sync([])}},{provide:t=>no.scrollMargins.of((e=>{let i=e.plugin(t);return i&&{top:i.top.scrollMargin(),bottom:i.bottom.scrollMargin()}}))});class Qn{constructor(t,e,i){this.view=t;this.top=e;this.container=i;this.dom=undefined;this.classes="";this.panels=[];this.syncClasses()}sync(t){for(let e of this.panels)if(e.destroy&&t.indexOf(e)<0)e.destroy();this.panels=t;this.syncDOM()}syncDOM(){if(this.panels.length==0){if(this.dom){this.dom.remove();this.dom=undefined}return}if(!this.dom){this.dom=document.createElement("div");this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom";this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels){if(e.dom.parentNode==this.dom){while(t!=e.dom)t=Jn(t);t=t.nextSibling}else{this.dom.insertBefore(e.dom,t)}}while(t)t=Jn(t)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!this.container||this.classes==this.view.themeClasses)return;for(let t of this.classes.split(" "))if(t)this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))if(t)this.container.classList.add(t)}}function Jn(t){let e=t.nextSibling;t.remove();return e}const Zn=s.Facet.define({enables:Un});function tr(t,e){let i;let o=new Promise((t=>i=t));let n=t=>nr(t,e,i);if(t.state.field(ir,false)){t.dispatch({effects:sr.of(n)})}else{t.dispatch({effects:s.StateEffect.appendConfig.of(ir.init((()=>[n])))})}let r=or.of(n);return{close:r,result:o.then((e=>{let i=t.win.queueMicrotask||(e=>t.win.setTimeout(e,10));i((()=>{if(t.state.field(ir).indexOf(n)>-1)t.dispatch({effects:r})}));return e}))}}function er(t,e){let i=t.state.field(ir,false)||[];for(let s of i){let i=$n(t,s);if(i&&i.dom.classList.contains(e))return i}return null}const ir=s.StateField.define({create(){return[]},update(t,e){for(let i of e.effects){if(i.is(sr))t=[i.value].concat(t);else if(i.is(or))t=t.filter((t=>t!=i.value))}return t},provide:t=>Zn.computeN([t],(e=>e.field(t)))});const sr=s.StateEffect.define();const or=s.StateEffect.define();function nr(t,e,i){let s=e.content?e.content(t,(()=>r(null))):null;if(!s){s=(0,g.A)("form");if(e.input){let t=(0,g.A)("input",e.input);if(/^(text|password|number|email|tel|url)$/.test(t.type))t.classList.add("cm-textfield");if(!t.name)t.name="input";s.appendChild((0,g.A)("label",(e.label||"")+": ",t))}else{s.appendChild(document.createTextNode(e.label||""))}s.appendChild(document.createTextNode(" "));s.appendChild((0,g.A)("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let o=s.nodeName=="FORM"?[s]:s.querySelectorAll("form");for(let l=0;l{if(e.keyCode==27){e.preventDefault();r(null)}else if(e.keyCode==13){e.preventDefault();r(t)}}));t.addEventListener("submit",(e=>{e.preventDefault();r(t)}))}let n=(0,g.A)("div",s,(0,g.A)("button",{onclick:()=>r(null),"aria-label":t.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));if(e.class)n.className=e.class;n.classList.add("cm-dialog");function r(e){if(n.contains(n.ownerDocument.activeElement))t.focus();i(e)}return{dom:n,top:e.top,mount:()=>{if(e.focus){let t;if(typeof e.focus=="string")t=s.querySelector(e.focus);else t=s.querySelector("input")||s.querySelector("button");if(t&&"select"in t)t.select();else if(t&&"focus"in t)t.focus()}}}}class rr extends s.RangeValue{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return false}destroy(t){}}rr.prototype.elementClass="";rr.prototype.toDOM=undefined;rr.prototype.mapMode=s.MapMode.TrackBefore;rr.prototype.startSide=rr.prototype.endSide=-1;rr.prototype.point=true;const lr=s.Facet.define();const ar=s.Facet.define();const hr={class:"",renderEmptyElements:false,elementStyle:"",markers:()=>s.RangeSet.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"};const fr=s.Facet.define();function cr(t){return[ur(),fr.of({...hr,...t})]}const dr=s.Facet.define({combine:t=>t.some((t=>t))});function ur(t){let e=[pr];if(t&&t.fixed===false)e.push(dr.of(true));return e}const pr=Ae.fromClass(class{constructor(t){this.view=t;this.domAfter=null;this.prevViewport=t.viewport;this.dom=document.createElement("div");this.dom.className="cm-gutters cm-gutters-before";this.dom.setAttribute("aria-hidden","true");this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px";this.gutters=t.state.facet(fr).map((e=>new vr(t,e)));this.fixed=!t.state.facet(dr);for(let e of this.gutters){if(e.config.side=="after")this.getDOMAfter().appendChild(e.dom);else this.dom.appendChild(e.dom)}if(this.fixed){this.dom.style.position="sticky"}this.syncGutters(false);t.scrollDOM.insertBefore(this.dom,t.contentDOM)}getDOMAfter(){if(!this.domAfter){this.domAfter=document.createElement("div");this.domAfter.className="cm-gutters cm-gutters-after";this.domAfter.setAttribute("aria-hidden","true");this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px";this.domAfter.style.position=this.fixed?"sticky":"";this.view.scrollDOM.appendChild(this.domAfter)}return this.domAfter}update(t){if(this.updateGutters(t)){let e=this.prevViewport,i=t.view.viewport;let s=Math.min(e.to,i.to)-Math.max(e.from,i.from);this.syncGutters(s<(i.to-i.from)*.8)}if(t.geometryChanged){let t=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=t;if(this.domAfter)this.domAfter.style.minHeight=t}if(this.view.state.facet(dr)!=!this.fixed){this.fixed=!this.fixed;this.dom.style.position=this.fixed?"sticky":"";if(this.domAfter)this.domAfter.style.position=this.fixed?"sticky":""}this.prevViewport=t.view.viewport}syncGutters(t){let e=this.dom.nextSibling;if(t){this.dom.remove();if(this.domAfter)this.domAfter.remove()}let i=s.RangeSet.iter(this.view.state.facet(lr),this.view.viewport.from);let o=[];let n=this.gutters.map((t=>new wr(t,this.view.viewport,-this.view.documentPadding.top)));for(let s of this.view.viewportLineBlocks){if(o.length)o=[];if(Array.isArray(s.type)){let t=true;for(let e of s.type){if(e.type==Ct.Text&&t){mr(i,o,e.from);for(let t of n)t.line(this.view,e,o);t=false}else if(e.widget){for(let t of n)t.widget(this.view,e)}}}else if(s.type==Ct.Text){mr(i,o,s.from);for(let t of n)t.line(this.view,s,o)}else if(s.widget){for(let t of n)t.widget(this.view,s)}}for(let s of n)s.finish();if(t){this.view.scrollDOM.insertBefore(this.dom,e);if(this.domAfter)this.view.scrollDOM.appendChild(this.domAfter)}}updateGutters(t){let e=t.startState.facet(fr),i=t.state.facet(fr);let o=t.docChanged||t.heightChanged||t.viewportChanged||!s.RangeSet.eq(t.startState.facet(lr),t.state.facet(lr),t.view.viewport.from,t.view.viewport.to);if(e==i){for(let e of this.gutters)if(e.update(t))o=true}else{o=true;let s=[];for(let o of i){let i=e.indexOf(o);if(i<0){s.push(new vr(this.view,o))}else{this.gutters[i].update(t);s.push(this.gutters[i])}}for(let t of this.gutters){t.dom.remove();if(s.indexOf(t)<0)t.destroy()}for(let t of s){if(t.config.side=="after")this.getDOMAfter().appendChild(t.dom);else this.dom.appendChild(t.dom)}this.gutters=s}return o}destroy(){for(let t of this.gutters)t.destroy();this.dom.remove();if(this.domAfter)this.domAfter.remove()}},{provide:t=>no.scrollMargins.of((e=>{let i=e.plugin(t);if(!i||i.gutters.length==0||!i.fixed)return null;let s=i.dom.offsetWidth*e.scaleX,o=i.domAfter?i.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==Ft.LTR?{left:s,right:o}:{right:s,left:o}}))});function gr(t){return Array.isArray(t)?t:[t]}function mr(t,e,i){while(t.value&&t.from<=i){if(t.from==i)e.push(t.value);t.next()}}class wr{constructor(t,e,i){this.gutter=t;this.height=i;this.i=0;this.cursor=s.RangeSet.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:s}=this,o=(e.top-this.height)/t.scaleY,n=e.height/t.scaleY;if(this.i==s.elements.length){let e=new br(t,n,o,i);s.elements.push(e);s.dom.appendChild(e.dom)}else{s.elements[this.i].update(t,n,o,i)}this.height=e.bottom;this.i++}line(t,e,i){let s=[];mr(this.cursor,s,e.from);if(i.length)s=s.concat(i);let o=this.gutter.config.lineMarker(t,e,s);if(o)s.unshift(o);let n=this.gutter;if(s.length==0&&!n.config.renderEmptyElements)return;this.addElement(t,e,s)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e),s=i?[i]:null;for(let o of t.state.facet(ar)){let i=o(t,e.widget,e);if(i)(s||(s=[])).push(i)}if(s)this.addElement(t,e,s)}finish(){let t=this.gutter;while(t.elements.length>this.i){let e=t.elements.pop();t.dom.removeChild(e.dom);e.destroy()}}}class vr{constructor(t,e){this.view=t;this.config=e;this.elements=[];this.spacer=null;this.dom=document.createElement("div");this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers){this.dom.addEventListener(i,(s=>{let o=s.target,n;if(o!=this.dom&&this.dom.contains(o)){while(o.parentNode!=this.dom)o=o.parentNode;let t=o.getBoundingClientRect();n=(t.top+t.bottom)/2}else{n=s.clientY}let r=t.lineBlockAtHeight(n-t.documentTop);if(e.domEventHandlers[i](t,r,s))s.preventDefault()}))}this.markers=gr(e.markers(t));if(e.initialSpacer){this.spacer=new br(t,0,0,[e.initialSpacer(t)]);this.dom.appendChild(this.spacer.dom);this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none"}}update(t){let e=this.markers;this.markers=gr(this.config.markers(t.view));if(this.spacer&&this.config.updateSpacer){let e=this.config.updateSpacer(this.spacer.markers[0],t);if(e!=this.spacer.markers[0])this.spacer.update(t.view,0,0,[e])}let i=t.view.viewport;return!s.RangeSet.eq(this.markers,e,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):false)}destroy(){for(let t of this.elements)t.destroy()}}class br{constructor(t,e,i,s){this.height=-1;this.above=0;this.markers=[];this.dom=document.createElement("div");this.dom.className="cm-gutterElement";this.update(t,e,i,s)}update(t,e,i,s){if(this.height!=e){this.height=e;this.dom.style.height=e+"px"}if(this.above!=i)this.dom.style.marginTop=(this.above=i)?i+"px":"";if(!yr(this.markers,s))this.setMarkers(t,s)}setMarkers(t,e){let i="cm-gutterElement",s=this.dom.firstChild;for(let o=0,n=0;;){let r=n,l=ot(e,i,s)||o(e,i,s):o}return i}})}});class Cr extends rr{constructor(t){super();this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function kr(t,e){return t.state.facet(Mr).formatNumber(e,t.state)}const Ar=fr.compute([Mr],(t=>({class:"cm-lineNumbers",renderEmptyElements:false,markers(t){return t.state.facet(Sr)},lineMarker(t,e,i){if(i.some((t=>t.toDOM)))return null;return new Cr(kr(t,t.state.doc.lineAt(e.from).number))},widgetMarker:(t,e,i)=>{for(let s of t.state.facet(xr)){let o=s(t,e,i);if(o)return o}return null},lineMarkerChange:t=>t.startState.facet(Mr)!=t.state.facet(Mr),initialSpacer(t){return new Cr(kr(t,Or(t.state.doc.lines)))},updateSpacer(t,e){let i=kr(e.view,Or(e.view.state.doc.lines));return i==t.number?t:new Cr(i)},domEventHandlers:t.facet(Mr).domEventHandlers,side:"before"})));function Dr(t={}){return[Mr.of(t),ur(),Ar]}function Or(t){let e=9;while(e{let e=[],i=-1;for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head).from;if(o>i){i=o;e.push(Tr.range(o))}}return s.RangeSet.of(e)}));function Rr(){return Er}function Br(t){return Ae.define((e=>({decorations:t.createDeco(e),update(e){this.decorations=t.updateDeco(e,this.decorations)}})),{decorations:t=>t.decorations})}const Lr=kt.mark({class:"cm-highlightTab"});const Pr=kt.mark({class:"cm-highlightSpace"});const Hr=Br(new Xo({regexp:/\t| /g,decoration:t=>t[0]=="\t"?Lr:Pr,boundary:/\S/}));function Nr(){return Hr}const Vr=Br(new Xo({regexp:/\s+$/g,decoration:kt.mark({class:"cm-trailingSpace"})}));function Fr(){return Vr}const Wr={HeightMap:bs,HeightOracle:ps,MeasuredHeights:gs,QueryType:ws,ChangedRange:Fe,computeOrder:ie,moveVisually:ne,clearHeightChangeFlag:us,getHeightChangeFlag:()=>ds}},41107:(t,e,i)=>{i.d(e,{A:()=>s});function s(){var t=arguments[0];if(typeof t=="string")t=document.createElement(t);var e=1,i=arguments[1];if(i&&typeof i=="object"&&i.nodeType==null&&!Array.isArray(i)){for(var s in i)if(Object.prototype.hasOwnProperty.call(i,s)){var n=i[s];if(typeof n=="string")t.setAttribute(s,n);else if(n!=null)t[s]=n}e++}for(;e{n.r(t);n.d(t,{commonmarkLanguage:()=>Je,deleteMarkupBackward:()=>ut,insertNewlineContinueMarkup:()=>lt,markdown:()=>pt,markdownKeymap:()=>ct,markdownLanguage:()=>Ye});var r=n(71674);var s=n(22819);var i=n(4452);var l=n(75128);var o=n(66575);var a=n(45145);class h{static create(e,t,n,r,s){let i=r+(r<<8)+e+(t<<4)|0;return new h(e,t,n,i,s,[],[])}constructor(e,t,n,r,s,i,l){this.type=e;this.value=t;this.from=n;this.hash=r;this.end=s;this.children=i;this.positions=l;this.hashProp=[[o.NodeProp.contextHash,r]]}addChild(e,t){if(e.prop(o.NodeProp.contextHash)!=this.hash)e=new o.Tree(e.type,e.children,e.positions,e.length,this.hashProp);this.children.push(e);this.positions.push(t)}toTree(e,t=this.end){let n=this.children.length-1;if(n>=0)t=Math.max(t,this.positions[n]+this.children[n].length+this.from);return new o.Tree(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(e,t,n)=>new o.Tree(o.NodeType.none,e,t,n,this.hashProp)})}}var f;(function(e){e[e["Document"]=1]="Document";e[e["CodeBlock"]=2]="CodeBlock";e[e["FencedCode"]=3]="FencedCode";e[e["Blockquote"]=4]="Blockquote";e[e["HorizontalRule"]=5]="HorizontalRule";e[e["BulletList"]=6]="BulletList";e[e["OrderedList"]=7]="OrderedList";e[e["ListItem"]=8]="ListItem";e[e["ATXHeading1"]=9]="ATXHeading1";e[e["ATXHeading2"]=10]="ATXHeading2";e[e["ATXHeading3"]=11]="ATXHeading3";e[e["ATXHeading4"]=12]="ATXHeading4";e[e["ATXHeading5"]=13]="ATXHeading5";e[e["ATXHeading6"]=14]="ATXHeading6";e[e["SetextHeading1"]=15]="SetextHeading1";e[e["SetextHeading2"]=16]="SetextHeading2";e[e["HTMLBlock"]=17]="HTMLBlock";e[e["LinkReference"]=18]="LinkReference";e[e["Paragraph"]=19]="Paragraph";e[e["CommentBlock"]=20]="CommentBlock";e[e["ProcessingInstructionBlock"]=21]="ProcessingInstructionBlock";e[e["Escape"]=22]="Escape";e[e["Entity"]=23]="Entity";e[e["HardBreak"]=24]="HardBreak";e[e["Emphasis"]=25]="Emphasis";e[e["StrongEmphasis"]=26]="StrongEmphasis";e[e["Link"]=27]="Link";e[e["Image"]=28]="Image";e[e["InlineCode"]=29]="InlineCode";e[e["HTMLTag"]=30]="HTMLTag";e[e["Comment"]=31]="Comment";e[e["ProcessingInstruction"]=32]="ProcessingInstruction";e[e["Autolink"]=33]="Autolink";e[e["HeaderMark"]=34]="HeaderMark";e[e["QuoteMark"]=35]="QuoteMark";e[e["ListMark"]=36]="ListMark";e[e["LinkMark"]=37]="LinkMark";e[e["EmphasisMark"]=38]="EmphasisMark";e[e["CodeMark"]=39]="CodeMark";e[e["CodeText"]=40]="CodeText";e[e["CodeInfo"]=41]="CodeInfo";e[e["LinkTitle"]=42]="LinkTitle";e[e["LinkLabel"]=43]="LinkLabel";e[e["URL"]=44]="URL"})(f||(f={}));class u{constructor(e,t){this.start=e;this.content=t;this.marks=[];this.parsers=[]}}class c{constructor(){this.text="";this.baseIndent=0;this.basePos=0;this.depth=0;this.markers=[];this.pos=0;this.indent=0;this.next=-1}forward(){if(this.basePos>this.pos)this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent);this.pos=e;this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return m(this.text,e)}reset(e){this.text=e;this.baseIndent=this.basePos=this.pos=this.indent=0;this.forwardInner();this.depth=1;while(this.markers.length)this.markers.pop()}moveBase(e){this.basePos=e;this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e;this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,n=0){for(let r=t;r=t.stack[n.depth+1].value+n.baseIndent)return true;if(n.indent>=n.baseIndent+4)return false;let r=(e.type==f.OrderedList?C:S)(n,t,false);return r>0&&(e.type!=f.BulletList||b(n,t,false)<0)&&n.text.charCodeAt(n.pos+r-1)==e.value}const p={[f.Blockquote](e,t,n){if(n.next!=62)return false;n.markers.push(J(f.QuoteMark,t.lineStart+n.pos,t.lineStart+n.pos+1));n.moveBase(n.pos+(g(n.text.charCodeAt(n.pos+1))?2:1));e.end=t.lineStart+n.text.length;return true},[f.ListItem](e,t,n){if(n.indent-1)return false;n.moveBaseColumn(n.baseIndent+e.value);return true},[f.OrderedList]:d,[f.BulletList]:d,[f.Document](){return true}};function g(e){return e==32||e==9||e==10||e==13}function m(e,t=0){while(tn&&g(e.charCodeAt(t-1)))t--;return t}function x(e){if(e.next!=96&&e.next!=126)return-1;let t=e.pos+1;while(t-1&&e.depth==t.stack.length)return-1;return r<3?-1:1}function w(e,t){for(let n=e.stack.length-1;n>=0;n--)if(e.stack[n].type==t)return true;return false}function S(e,t,n){return(e.next==45||e.next==43||e.next==42)&&(e.pos==e.text.length-1||g(e.text.charCodeAt(e.pos+1)))&&(!n||w(t,f.BulletList)||e.skipSpace(e.pos+2)=48&&s<=57)r++;else break;if(r==e.text.length)return-1;s=e.text.charCodeAt(r)}if(r==e.pos||r>e.pos+9||s!=46&&s!=41||re.pos+1||e.next!=49))return-1;return r+1-e.pos}function y(e){if(e.next!=35)return-1;let t=e.pos+1;while(t6?-1:n}function T(e){if(e.next!=45&&e.next!=61||e.indent>=e.baseIndent+4)return-1;let t=e.pos+1;while(t/,B=/\?>/;const E=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(r);if(i)return e.append(J(f.Comment,n,n+1+i[0].length));let l=/^\?[^]*?\?>/.exec(r);if(l)return e.append(J(f.ProcessingInstruction,n,n+1+l[0].length));let o=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);if(!o)return-1;return e.append(J(f.HTMLTag,n,n+1+o[0].length))},Emphasis(e,t,n){if(t!=95&&t!=42)return-1;let r=n+1;while(e.char(r)==t)r++;let s=e.slice(n-1,n),i=e.slice(r,r+1);let l=se.test(s),o=se.test(i);let a=/\s|^$/.test(s),h=/\s|^$/.test(i);let f=!h&&(!o||a||l);let u=!a&&(!l||h||o);let c=f&&(t==42||!u||l);let d=u&&(t==42||!f||o);return e.append(new ne(t==95?W:Y,n,r,(c?1:0)|(d?2:0)))},HardBreak(e,t,n){if(t==92&&e.char(n+1)==10)return e.append(J(f.HardBreak,n,n+2));if(t==32){let t=n+1;while(e.char(t)==32)t++;if(e.char(t)==10&&t>=n+2)return e.append(J(f.HardBreak,n,t+1))}return-1},Link(e,t,n){return t==91?e.append(new ne(ee,n,n+1,1)):-1},Image(e,t,n){return t==33&&e.char(n+1)==91?e.append(new ne(te,n,n+2,1)):-1},LinkEnd(e,t,n){if(t!=93)return-1;for(let r=e.parts.length-1;r>=0;r--){let t=e.parts[r];if(t instanceof ne&&(t.type==ee||t.type==te)){if(!t.side||e.skipSpace(t.to)==n&&!/[(\[]/.test(e.slice(n+1,n+2))){e.parts[r]=null;return-1}let s=e.takeContent(r);let i=e.parts[r]=le(e,s,t.type==ee?f.Link:f.Image,t.from,n+1);if(t.type==ee)for(let t=0;tt?J(f.URL,t+n,s+n):s==e.length?null:false}}function ae(e,t,n){let r=e.charCodeAt(t);if(r!=39&&r!=34&&r!=40)return false;let s=r==40?41:r;for(let i=t+1,l=false;i=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){this.parts.push(e);return e.to}addDelimiter(e,t,n,r,s){return this.append(new ne(e,t,n,(r?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof ne&&(t.type==ee||t.type==te))return true}return false}addElement(e){return this.append(e)}resolveMarkers(e){for(let n=e;n=e;l--){let e=this.parts[l];if(e instanceof ne&&e.side&1&&e.type==t.type&&!(r&&(t.side&1||e.side&2)&&(e.to-e.from+s)%3==0&&((e.to-e.from)%3||s%3))){i=e;break}}if(!i)continue;let o=t.type.resolve,a=[];let h=i.from,f=t.to;if(r){let e=Math.min(2,i.to-i.from,s);h=i.to-e;f=t.from+e;o=e==1?"Emphasis":"StrongEmphasis"}if(i.type.mark)a.push(this.elt(i.type.mark,h,i.to));for(let e=l+1;e=0;t--){let n=this.parts[t];if(n instanceof ne&&n.type==e)return t}return null}takeContent(e){let t=this.resolveMarkers(e);this.parts.length=e;return t}skipSpace(e){return m(this.text,e-this.offset)+this.offset}elt(e,t,n,r){if(typeof e=="string")return J(this.parser.getNodeType(e),t,n,r);return new K(e,t)}}function ue(e,t){if(!t.length)return e;if(!e.length)return t;let n=e.slice(),r=0;for(let s of t){while(r(e?e-1:0))return false;if(this.fragmentEnd<0){let e=this.fragment.to;while(e>0&&this.input.read(e-1,e)!="\n")e--;this.fragmentEnd=e?e-1:0}let n=this.cursor;if(!n){n=this.cursor=this.fragment.tree.cursor();n.firstChild()}let r=e+this.fragment.offset;while(n.to<=r)if(!n.parent())return false;for(;;){if(n.from>=r)return this.fragment.from<=t;if(!n.childAfter(r))return false}}matches(e){let t=this.cursor.tree;return t&&t.prop(o.NodeProp.contextHash)==e}takeNodes(e){let t=this.cursor,n=this.fragment.offset,r=this.fragmentEnd-(this.fragment.openEnd?1:0);let s=e.absoluteLineStart,i=s,l=e.block.children.length;let a=i,h=l;for(;;){if(t.to-n>r){if(t.type.isAnonymous&&t.firstChild())continue;break}let s=pe(t.from-n,e.ranges);if(t.to-n<=e.ranges[e.rangeI].to){e.addNode(t.tree,s)}else{let n=new o.Tree(e.parser.nodeSet.types[f.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(n,t.tree);e.addNode(n,s)}if(t.type.is("Block")){if(ce.indexOf(t.type.id)<0){i=t.to-n;l=e.block.children.length}else{i=a;l=h;a=t.to-n;h=e.block.children.length}}if(!t.nextSibling())break}while(e.block.children.length>l){e.block.children.pop();e.block.positions.pop()}return i-s}}function pe(e,t){let n=e;for(let r=1;rv[e])),Object.keys(v).map((e=>X[e])),Object.keys(v),z,p,Object.keys(ie).map((e=>ie[e])),Object.keys(ie),[]);function ke(e,t,n){let r=[];for(let s=e.firstChild,i=t;;s=s.nextSibling){let e=s?s.from:n;if(e>i)r.push({from:i,to:e});if(!s)break;i=s.to}return r}function xe(e){let{codeParser:t,htmlParser:n}=e;let r=(0,o.parseMixed)(((e,r)=>{let s=e.type.id;if(t&&(s==f.CodeBlock||s==f.FencedCode)){let n="";if(s==f.FencedCode){let t=e.node.getChild(f.CodeInfo);if(t)n=r.read(t.from,t.to)}let i=t(n);if(i)return{parser:i,overlay:e=>e.type.id==f.CodeText}}else if(n&&(s==f.HTMLBlock||s==f.HTMLTag)){return{parser:n,overlay:ke(e.node,e.from,e.to)}}return null}));return{wrap:r}}const Le={resolve:"Strikethrough",mark:"StrikethroughMark"};const be={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":a.tags.strikethrough}},{name:"StrikethroughMark",style:a.tags.processingInstruction}],parseInline:[{name:"Strikethrough",parse(e,t,n){if(t!=126||e.char(n+1)!=126||e.char(n+2)==126)return-1;let r=e.slice(n-1,n),s=e.slice(n+2,n+3);let i=/\s|^$/.test(r),l=/\s|^$/.test(s);let o=se.test(r),a=se.test(s);return e.addDelimiter(Le,n,n+2,!l&&(!a||i||o),!i&&(!o||l||a))},after:"Emphasis"}]};function we(e,t,n=0,r,s=0){let i=0,l=true,o=-1,a=-1,h=false;let f=()=>{r.push(e.elt("TableCell",s+o,s+a,e.parser.parseInline(t.slice(o,a),s+o)))};for(let u=n;u-1)i++;l=false;if(r){if(o>-1)f();r.push(e.elt("TableDelimiter",u+s,u+s+1))}o=a=-1}else if(h||n!=32&&n!=9){if(o<0)o=u;a=u+1}h=!h&&n==92}if(o>-1){i++;if(r)f()}return i}function Se(e,t){for(let n=t;ne instanceof ye))||!Se(t.text,t.basePos))return false;let r=e.scanLine(e.absoluteLineEnd+1).text;return Ce.test(r)&&we(e,t.text,t.basePos)==we(e,r,t.basePos)},before:"SetextHeading"}]};class Ae{nextLine(){return false}finish(e,t){e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)]));return true}}const Ie={defineNodes:[{name:"Task",block:true,style:a.tags.list},{name:"TaskMarker",style:a.tags.atom}],parseBlock:[{name:"TaskList",leaf(e,t){return/^\[[ xX]\][ \t]/.test(t.content)&&e.parentType().name=="ListItem"?new Ae:null},after:"SetextHeading"}]};const Be=/(www\.)|(https?:\/\/)|([\w.+-]+@)|(mailto:|xmpp:)/gy;const Ee=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy;const Me=/[\w-]+\.[\w-]+($|\/)/;const Pe=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy;const He=/\/[a-zA-Z\d@.]+/gy;function ve(e,t,n,r){let s=0;for(let i=t;i-1)return-1;let r=t+n[0].length;for(;;){let n=e[r-1],s;if(/[?!.,:*_~]/.test(n)||n==")"&&ve(e,t,r,")")>ve(e,t,r,"("))r--;else if(n==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(e.slice(t,r))))r=t+s.index;else break}return r}function Oe(e,t){Pe.lastIndex=t;let n=Pe.exec(e);if(!n)return-1;let r=n[0][n[0].length-1];return r=="_"||r=="-"?-1:t+n[0].length-(r=="."?1:0)}const Re={parseInline:[{name:"Autolink",parse(e,t,n){let r=n-e.offset;Be.lastIndex=r;let s=Be.exec(e.text),i=-1;if(!s)return-1;if(s[1]||s[2]){i=Ne(e.text,r+s[0].length);if(i>-1&&e.hasOpenLink){let t=/([^\[\]]|\[[^\]]*\])*/.exec(e.text.slice(r,i));i=r+t[0].length}}else if(s[3]){i=Oe(e.text,r)}else{i=Oe(e.text,r+s[0].length);if(i>-1&&s[0]=="xmpp:"){He.lastIndex=i;s=He.exec(e.text);if(s)i=s.index+s[0].length}}if(i<0)return-1;e.addElement(e.elt("URL",n,i+e.offset));return i+e.offset}}]};const Xe=[Te,Ie,be,Re];function ze(e,t,n){return(r,s,i)=>{if(s!=e||r.char(i+1)==e)return-1;let l=[r.elt(n,i,i+1)];for(let o=i+1;o!e.is("Block")||e.is("Document")||Qe(e)!=null||Ze(e)?undefined:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to}))),qe.add(Qe),i.indentNodeProp.add({Document:()=>null}),i.languageDataProp.add({Document:je})]});function Qe(e){let t=/^(?:ATX|Setext)Heading(\d)$/.exec(e.name);return t?+t[1]:undefined}function Ze(e){return e.name=="OrderedList"||e.name=="BulletList"}function Ve(e,t){let n=e;for(;;){let e=n.nextSibling,r;if(!e||(r=Qe(e.type))!=null&&r<=t)break;n=e}return n.to}const Ge=i.foldService.of(((e,t,n)=>{for(let r=(0,i.syntaxTree)(e).resolveInner(n,-1);r;r=r.parent){if(r.fromn)return{from:n,to:s}}return null}));function Ke(e){return new i.Language(je,e,[Ge],"markdown")}const Je=Ke(Ue);const We=Ue.configure([Xe,$e,De,_e,{props:[i.foldNodeProp.add({Table:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})})]}]);const Ye=Ke(We);function et(e,t){return n=>{if(n&&e){let t=null;n=/\S*/.exec(n)[0];if(typeof e=="function")t=e(n);else t=i.LanguageDescription.matchLanguageName(e,n,true);if(t instanceof i.LanguageDescription)return t.support?t.support.language.parser:i.ParseContext.getSkippingParser(t.load());else if(t)return t.parser}return t?t.parser:null}}class tt{constructor(e,t,n,r,s,i,l){this.node=e;this.from=t;this.to=n;this.spaceBefore=r;this.spaceAfter=s;this.type=i;this.item=l}blank(e,t=true){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){while(n.length0;e--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+rt(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function nt(e,t){let n=[],r=[];for(let s=e;s;s=s.parent){if(s.name=="FencedCode")return r;if(s.name=="ListItem"||s.name=="Blockquote")n.push(s)}for(let s=n.length-1;s>=0;s--){let e=n[s],i;let l=t.lineAt(e.from),o=e.from-l.from;if(e.name=="Blockquote"&&(i=/^ *>( ?)/.exec(l.text.slice(o)))){r.push(new tt(e,o,o+i[0].length,"",i[1],">",null))}else if(e.name=="ListItem"&&e.parent.name=="OrderedList"&&(i=/^( *)\d+([.)])( *)/.exec(l.text.slice(o)))){let t=i[3],n=i[0].length;if(t.length>=4){t=t.slice(0,t.length-4);n-=4}r.push(new tt(e.parent,o,o+n,i[1],t,i[2],e))}else if(e.name=="ListItem"&&e.parent.name=="BulletList"&&(i=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(l.text.slice(o)))){let t=i[4],n=i[0].length;if(t.length>4){t=t.slice(0,t.length-4);n-=4}let s=i[2];if(i[3])s+=i[3].replace(/[xX]/," ");r.push(new tt(e.parent,o,o+n,i[1],t,s,e))}}return r}function rt(e,t){return/^(\s*)(\d+)(?=[.)])/.exec(t.sliceString(e.from,e.from+10))}function st(e,t,n,r=0){for(let s=-1,i=e;;){if(i.name=="ListItem"){let e=rt(i,t);let l=+e[2];if(s>=0){if(l!=s+1)return;n.push({from:i.from+e[1].length,to:i.from+e[0].length,insert:String(s+2+r)})}s=l}let e=i.nextSibling;if(!e)break;i=e}}function it(e,t){let n=/^[ \t]*/.exec(e)[0].length;if(!n||t.facet(i.indentUnit)!="\t")return e;let s=(0,r.countColumn)(e,4,n);let l="";for(let r=s;r>0;){if(r>=4){l+="\t";r-=4}else{l+=" ";r--}}return l+e.slice(n)}const lt=({state:e,dispatch:t})=>{let n=(0,i.syntaxTree)(e),{doc:s}=e;let l=null,o=e.changeByRange((t=>{if(!t.empty||!Ye.isActiveAt(e,t.from,0))return l={range:t};let i=t.from,o=s.lineAt(i);let a=nt(n.resolveInner(i,-1),s);while(a.length&&a[a.length-1].from>i-o.from)a.pop();if(!a.length)return l={range:t};let h=a[a.length-1];if(h.to-h.spaceAfter.length>i-o.from)return l={range:t};let f=i>=h.to-h.spaceAfter.length&&!/\S/.test(o.text.slice(h.to));if(h.item&&f){let t=h.node.firstChild,n=h.node.getChild("ListItem","ListItem");if(t.to>=i||n&&n.to0&&!/[^\s>]/.test(s.lineAt(o.from-1).text)){let e=a.length>1?a[a.length-2]:null;let t,n="";if(e&&e.item){t=o.from+e.from;n=e.marker(s,1)}else{t=o.from+(e?e.to:0)}let l=[{from:t,to:i,insert:n}];if(h.node.name=="OrderedList")st(h.item,s,l,-2);if(e&&e.node.name=="OrderedList")st(e.item,s,l);return{range:r.EditorSelection.cursor(t+n.length),changes:l}}else{let t=ht(a,e,o);return{range:r.EditorSelection.cursor(i+t.length+1),changes:{from:o.from,insert:t+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&o.from){let n=s.lineAt(o.from-1),r=/>\s*$/.exec(n.text);if(r&&r.index==h.from){let s=e.changes([{from:n.from+r.index,to:n.to},{from:o.from+h.from,to:o.to}]);return{range:t.map(s),changes:s}}}let u=[];if(h.node.name=="OrderedList")st(h.item,s,u);let c=h.item&&h.item.from]*/.exec(o.text)[0].length>=h.to){for(let e=0,t=a.length-1;e<=t;e++){d+=e==t&&!c?a[e].marker(s,1):a[e].blank(eo.from&&/\s/.test(o.text.charAt(p-o.from-1)))p--;d=it(d,e);if(at(h.node,e.doc))d=ht(a,e,o)+e.lineBreak+d;u.push({from:p,to:i,insert:e.lineBreak+d});return{range:r.EditorSelection.cursor(p+d.length+1),changes:u}}));if(l)return false;t(e.update(o,{scrollIntoView:true,userEvent:"input"}));return true};function ot(e){return e.name=="QuoteMark"||e.name=="ListMark"}function at(e,t){if(e.name!="OrderedList"&&e.name!="BulletList")return false;let n=e.firstChild,r=e.getChild("ListItem","ListItem");if(!r)return false;let s=t.lineAt(n.to),i=t.lineAt(r.from);let l=/^[\s>]*$/.test(s.text);return s.number+(l?0:1){let n=(0,i.syntaxTree)(e);let s=null,l=e.changeByRange((t=>{let i=t.from,{doc:l}=e;if(t.empty&&Ye.isActiveAt(e,t.from)){let t=l.lineAt(i);let s=nt(ft(n,i),l);if(s.length){let n=s[s.length-1];let l=n.to-n.spaceAfter.length+(n.spaceAfter?1:0);if(i-t.from>l&&!/\S/.test(t.text.slice(l,i-t.from)))return{range:r.EditorSelection.cursor(t.from+l),changes:{from:t.from+l,to:i}};if(i-t.from==l&&(!n.item||t.from<=n.item.from||!/\S/.test(t.text.slice(0,n.to)))){let s=t.from+n.from;if(n.item&&n.node.from{e.r(i);e.d(i,{globalCompletion:()=>Oi,localCompletionSource:()=>BO,python:()=>ni,pythonLanguage:()=>ai});var a=e(27421);var n=e(45145);const Q=1,t=194,r=195,o=196,d=197,s=198,T=199,l=200,S=2,p=3,q=201,g=24,$=25,P=49,m=50,c=55,h=56,X=57,f=59,y=60,W=61,z=62,u=63,v=65,R=238,k=71,x=241,_=242,U=243,V=244,G=245,b=246,w=247,Z=248,j=72,E=249,Y=250,F=251,J=252,A=253,C=254,I=255,N=256,D=73,H=77,L=263,B=112,K=130,M=151,OO=152,iO=155;const eO=10,aO=13,nO=32,QO=9,tO=35,rO=40,oO=46,dO=123,sO=125,TO=39,lO=34,SO=92,pO=111,qO=120,gO=78,$O=117,PO=85;const mO=new Set([$,P,m,L,v,K,h,X,R,z,u,j,D,H,y,W,M,OO,iO,B]);function cO(O){return O==eO||O==aO}function hO(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const XO=new a.Lu(((O,i)=>{let e;if(O.next<0){O.acceptToken(T)}else if(i.context.flags&yO){if(cO(O.next))O.acceptToken(s,1)}else if(((e=O.peek(-1))<0||cO(e))&&i.canShift(d)){let i=0;while(O.next==nO||O.next==QO){O.advance();i++}if(O.next==eO||O.next==aO||O.next==tO)O.acceptToken(d,-i)}else if(cO(O.next)){O.acceptToken(o,1)}}),{contextual:true});const fO=new a.Lu(((O,i)=>{let e=i.context;if(e.flags)return;let a=O.peek(-1);if(a==eO||a==aO){let i=0,a=0;for(;;){if(O.next==nO)i++;else if(O.next==QO)i+=8-i%8;else break;O.advance();a++}if(i!=e.indent&&O.next!=eO&&O.next!=aO&&O.next!=tO){if(i[O,i|WO])));const VO=new a.Aj({start:xO,reduce(O,i,e,a){if(O.flags&yO&&mO.has(i)||(i==k||i==j)&&O.flags&WO)return O.parent;return O},shift(O,i,e,a){if(i==t)return new kO(O,_O(a.read(a.pos,e.pos)),0);if(i==r)return O.parent;if(i==g||i==c||i==f||i==p)return new kO(O,0,yO);if(UO.has(i))return new kO(O,0,UO.get(i)|O.flags&yO);return O},hash(O){return O.hash}});const GO=new a.Lu((O=>{for(let i=0;i<5;i++){if(O.next!="print".charCodeAt(i))return;O.advance()}if(/\w/.test(String.fromCharCode(O.next)))return;for(let i=0;;i++){let e=O.peek(i);if(e==nO||e==QO)continue;if(e!=rO&&e!=oO&&e!=eO&&e!=aO&&e!=tO)O.acceptToken(Q);return}}));const bO=new a.Lu(((O,i)=>{let{flags:e}=i.context;let a=e&zO?lO:TO;let n=(e&uO)>0;let Q=!(e&vO);let t=(e&RO)>0;let r=O.pos;for(;;){if(O.next<0){break}else if(t&&O.next==dO){if(O.peek(1)==dO){O.advance(2)}else{if(O.pos==r){O.acceptToken(p,1);return}break}}else if(Q&&O.next==SO){if(O.pos==r){O.advance();let i=O.next;if(i>=0){O.advance();wO(O,i)}O.acceptToken(S);return}break}else if(O.next==a&&(!n||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==r){O.acceptToken(q,n?3:1);return}break}else if(O.next==eO){if(n){O.advance()}else if(O.pos==r){O.acceptToken(q);return}break}else{O.advance()}}if(O.pos>r)O.acceptToken(l)}));function wO(O,i){if(i==pO){for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance()}else if(i==qO){for(let i=0;i<2&&hO(O.next);i++)O.advance()}else if(i==$O){for(let i=0;i<4&&hO(O.next);i++)O.advance()}else if(i==PO){for(let i=0;i<8&&hO(O.next);i++)O.advance()}else if(i==gO){if(O.next==dO){O.advance();while(O.next>=0&&O.next!=sO&&O.next!=TO&&O.next!=lO&&O.next!=eO)O.advance();if(O.next==sO)O.advance()}}}const ZO=(0,n.styleTags)({'async "*" "**" FormatConversion FormatSpec':n.tags.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.tags.controlKeyword,"in not and or is del":n.tags.operatorKeyword,"from def class global nonlocal lambda":n.tags.definitionKeyword,import:n.tags.moduleKeyword,"with as print":n.tags.keyword,Boolean:n.tags.bool,None:n.tags.null,VariableName:n.tags.variableName,"CallExpression/VariableName":n.tags.function(n.tags.variableName),"FunctionDefinition/VariableName":n.tags.function(n.tags.definition(n.tags.variableName)),"ClassDefinition/VariableName":n.tags.definition(n.tags.className),PropertyName:n.tags.propertyName,"CallExpression/MemberExpression/PropertyName":n.tags.function(n.tags.propertyName),Comment:n.tags.lineComment,Number:n.tags.number,String:n.tags.string,FormatString:n.tags.special(n.tags.string),Escape:n.tags.escape,UpdateOp:n.tags.updateOperator,"ArithOp!":n.tags.arithmeticOperator,BitOp:n.tags.bitwiseOperator,CompareOp:n.tags.compareOperator,AssignOp:n.tags.definitionOperator,Ellipsis:n.tags.punctuation,At:n.tags.meta,"( )":n.tags.paren,"[ ]":n.tags.squareBracket,"{ }":n.tags.brace,".":n.tags.derefOperator,", ;":n.tags.separator});const jO={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285};const EO=a.U1.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5QQdO'#DoOOQS,5:Y,5:YO5eQdO'#HdOOQS,5:],5:]O5rQ!fO,5:]O5wQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8gQdO,59bO8lQdO,59bO8sQdO,59jO8zQdO'#HTO:QQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:iQdO,59aO'vQdO,59aO:wQdO,59aOOQS,59y,59yO:|QdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;[QdO,5:QO;aQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;rQdO,5:UO;wQdO,5:WOOOW'#Fy'#FyO;|OWO,5:aOOQS,5:a,5:aOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/RQtO1G.|O!/YQtO1G.|O1lQdO1G.|O!/uQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!/|QdO1G/eO!0^QdO1G/eO!0fQdO1G/fO'vQdO'#H[O!0kQdO'#H[O!0pQtO1G.{O!1QQdO,59iO!2WQdO,5=zO!2hQdO,5=zO!2pQdO1G/mO!2uQtO1G/mOOQS1G/l1G/lO!3VQdO,5=uO!3|QdO,5=uO0rQdO1G/qO!4kQdO1G/sO!4pQtO1G/sO!5QQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5bQdO'#HxO0rQdO'#HxO!5sQdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6RQ#xO1G2zO!6rQtO1G2zO'vQdO,5kOOQS1G1`1G1`O!7xQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!7}QdO'#FrO!8YQdO,59oO!8bQdO1G/XO!8lQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9]QdO'#GtOOQS,5jO!;QQdO,5>jO1XQdO,5>jO!;cQdO,5>iOOQS-E:R-E:RO!;hQdO1G0lO!;sQdO1G0lO!;xQdO,5>lO!lO!hO!<|QdO,5>hO!=_QdO'#EpO0rQdO1G0tO!=jQdO1G0tO!=oQgO1G0zO!AmQgO1G0}O!EhQdO,5>oO!ErQdO,5>oO!EzQtO,5>oO0rQdO1G1PO!FUQdO1G1PO4iQdO1G1UO!!sQdO1G1WOOQV,5;a,5;aO!FZQfO,5;aO!F`QgO1G1QO!JaQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JqQdO,5>pO!KOQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KWQdO'#FSO!KiQ!fO1G1WO!KqQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!KvQdO1G1]O!LOQdO'#F^OOQV1G1b1G1bO!#WQtO1G1bPOOO1G2v1G2vP!LTOSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LYQdO,5=|O!LmQdO,5=|OOQS1G/u1G/uO!LuQdO,5>PO!MVQdO,5>PO!M_QdO,5>PO!MrQdO,5>PO!NSQdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8bQdO7+$pO# uQdO1G.|O# |QdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!TQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!eQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!jQdO7+%PO#!rQdO7+%QO#!wQdO1G3fOOQS7+%X7+%XO##XQdO1G3fO##aQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##fQdO1G3aOOQS-E9q-E9qO#$]QdO7+%]OOQS7+%_7+%_O#$kQdO1G3aO#%YQdO7+%_O#%_QdO1G3gO#%oQdO1G3gO#%wQdO7+%]O#%|QdO,5>dO#&gQdO,5>dO#&gQdO,5>dOOQS'#Dx'#DxO#&xO&jO'#DzO#'TO`O'#HyOOOW1G3}1G3}O#'YQdO1G3}O#'bQdO1G3}O#'mQ#xO7+(fO#(^QtO1G2UP#(wQdO'#GOOOQS,5bQdO,5gQdO1G4OOOQS-E9y-E9yO#?QQdO1G4OOe,5>eOOOW7+)i7+)iO#?nQdO7+)iO#?vQdO1G2zO#@aQdO1G2zP'vQdO'#FuO0rQdO<mO#AtQdO,5>mOOQS1G0v1G0vOOQS<rO#KZQdO,5>rOOQS,5>r,5>rO#KfQdO,5>qO#KwQdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ WQdO<cAN>cO0rQdO1G1|O$ hQtO1G1|P$ rQdO'#FvOOQS1G2R1G2RP$!PQdO'#F{O$!^QdO7+)jO$!wQdO,5>gOOOO-E9z-E9zOOOW<tO$4dQdO,5>tO1XQdO,5vO$)VQdO,5>vOOQS1G1p1G1pO$8[QtO,5<[OOQU7+'P7+'PO$+cQdO1G/iO$)VQdO,5wO$8jQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)VQdO'#GdO$8rQdO1G4bO$8|QdO1G4bO$9UQdO1G4bOOQS7+%T7+%TO$9dQdO1G1tO$9rQtO'#FaO$9yQdO,5<}OOQS,5<},5<}O$:XQdO1G4cOOQS-E:a-E:aO$)VQdO,5<|O$:`QdO,5<|O$:eQdO7+)|OOQS-E:`-E:`O$:oQdO7+)|O$)VQdO,5m>pPP'Z'ZPP?PPP'Z'ZPP'Z'Z'Z'Z'Z?T?}'ZP@QP@WD_G{HPPHSH^Hb'ZPPPHeHn'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHtIQIYPIaIgPIaPIaIaPPPIaPKuPLOLYL`KuPIaLiPIaPLpLvPLzM`M}NhLzLzNnN{LzLzLzLz! a! g! j! o! r! |!!S!!`!!r!!x!#S!#Y!#v!#|!$S!$^!$d!$j!$|!%W!%^!%d!%n!%t!%z!&Q!&W!&^!&h!&n!&x!'O!'X!'_!'n!'v!(Q!(XPPPPPPPPPPP!(_!(b!(h!(q!({!)WPPPPPPPPPPPP!-z!/`!3`!6pPP!6x!7X!7b!8Z!8Q!8d!8j!8m!8p!8s!8{!9lPPPPPPPPPPPPPPPPP!9o!9s!9yP!:_!:c!:o!:x!;U!;l!;o!;r!;x!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[GO,fO,XO,bO,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>jO[O]||-1}],tokenPrec:7652});var YO=e(4452);var FO=e(66575);var JO=e(75128);const AO=new FO.NodeWeakMap;const CO=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function IO(O){return(i,e,a)=>{if(a)return false;let n=i.node.getChild("VariableName");if(n)e(n,O);return true}}const NO={FunctionDefinition:IO("function"),ClassDefinition:IO("class"),ForStatement(O,i,e){if(e)for(let a=O.node.firstChild;a;a=a.nextSibling){if(a.name=="VariableName")i(a,"variable");else if(a.name=="in")break}},ImportStatement(O,i){var e,a;let{node:n}=O;let Q=((e=n.firstChild)===null||e===void 0?void 0:e.name)=="from";for(let t=n.getChild("import");t;t=t.nextSibling){if(t.name=="VariableName"&&((a=t.nextSibling)===null||a===void 0?void 0:a.name)!="as")i(t,Q?"variable":"namespace")}},AssignStatement(O,i){for(let e=O.node.firstChild;e;e=e.nextSibling){if(e.name=="VariableName")i(e,"variable");else if(e.name==":"||e.name=="AssignOp")break}},ParamList(O,i){for(let e=null,a=O.node.firstChild;a;a=a.nextSibling){if(a.name=="VariableName"&&(!e||!/\*|AssignOp/.test(e.name)))i(a,"variable");e=a}},CapturePattern:IO("variable"),AsPattern:IO("variable"),__proto__:null};function DO(O,i){let e=AO.get(i);if(e)return e;let a=[],n=true;function Q(i,e){let n=O.sliceString(i.from,i.to);a.push({label:n,type:e})}i.cursor(FO.IterMode.IncludeAnonymous).iterate((i=>{if(i.name){let O=NO[i.name];if(O&&O(i,Q,n)||!n&&CO.has(i.name))return false;n=false}else if(i.to-i.from>8192){for(let e of DO(O,i.node))a.push(e);return false}}));AO.set(i,a);return a}const HO=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/;const LO=["String","FormatString","Comment","PropertyName"];function BO(O){let i=(0,YO.syntaxTree)(O.state).resolveInner(O.pos,-1);if(LO.indexOf(i.name)>-1)return null;let e=i.name=="VariableName"||i.to-i.from<20&&HO.test(O.state.sliceDoc(i.from,i.to));if(!e&&!O.explicit)return null;let a=[];for(let n=i;n;n=n.parent){if(CO.has(n.name))a=a.concat(DO(O.state.doc,n))}return{options:a,from:e?i.from:O.pos,validFor:HO}}const KO=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map((O=>({label:O,type:"constant"}))).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map((O=>({label:O,type:"type"})))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map((O=>({label:O,type:"class"})))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map((O=>({label:O,type:"function"}))));const MO=[(0,JO.Gw)("def ${name}(${params}):\n\t${}",{label:"def",detail:"function",type:"keyword"}),(0,JO.Gw)("for ${name} in ${collection}:\n\t${}",{label:"for",detail:"loop",type:"keyword"}),(0,JO.Gw)("while ${}:\n\t${}",{label:"while",detail:"loop",type:"keyword"}),(0,JO.Gw)("try:\n\t${}\nexcept ${error}:\n\t${}",{label:"try",detail:"/ except block",type:"keyword"}),(0,JO.Gw)("if ${}:\n\t\n",{label:"if",detail:"block",type:"keyword"}),(0,JO.Gw)("if ${}:\n\t${}\nelse:\n\t${}",{label:"if",detail:"/ else block",type:"keyword"}),(0,JO.Gw)("class ${name}:\n\tdef __init__(self, ${params}):\n\t\t\t${}",{label:"class",detail:"definition",type:"keyword"}),(0,JO.Gw)("import ${module}",{label:"import",detail:"statement",type:"keyword"}),(0,JO.Gw)("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})];const Oi=(0,JO.Ar)(LO,(0,JO.et)(KO.concat(MO)));function ii(O){let{node:i,pos:e}=O;let a=O.lineIndent(e,-1);let n=null;for(;;){let Q=i.childBefore(e);if(!Q){break}else if(Q.name=="Comment"){e=Q.from}else if(Q.name=="Body"||Q.name=="MatchBody"){if(O.baseIndentFor(Q)+O.unit<=a)n=Q;i=Q}else if(Q.name=="MatchClause"){i=Q}else if(Q.type.is("Statement")){i=Q}else{break}}return n}function ei(O,i){let e=O.baseIndentFor(i);let a=O.lineAt(O.pos,-1),n=a.from+a.text.length;if(/^\s*($|#)/.test(a.text)&&O.node.toe)return null;return e+O.unit}const ai=YO.LRLanguage.define({name:"python",parser:EO.configure({props:[YO.indentNodeProp.add({Body:O=>{var i;let e=ii(O);return(i=ei(O,e||O.node))!==null&&i!==void 0?i:O.continue()},MatchBody:O=>{var i;let e=ii(O);return(i=ei(O,e||O.node))!==null&&i!==void 0?i:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except |finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),MatchStatement:O=>{if(/^\s*case /.test(O.textAfter))return O.baseIndent+O.unit;return O.continue()},"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":(0,YO.delimitedIndent)({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":(0,YO.delimitedIndent)({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":(0,YO.delimitedIndent)({closing:"]"}),MemberExpression:O=>O.baseIndent+O.unit,"String FormatString":()=>null,Script:O=>{var i;let e=ii(O);return(i=e&&ei(O,e))!==null&&i!==void 0?i:O.continue()}}),YO.foldNodeProp.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":YO.foldInside,Body:(O,i)=>({from:O.from+1,to:O.to-(O.to==i.doc.length?0:1)}),"String FormatString":(O,i)=>({from:i.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function ni(){return new YO.LanguageSupport(ai,[ai.data.of({autocomplete:BO}),ai.data.of({autocomplete:Oi})])}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9359.34d1b961b733676193cb.js b/.venv/share/jupyter/lab/static/9359.34d1b961b733676193cb.js new file mode 100644 index 0000000000000000000000000000000000000000..e9ad8980f49bed59cdd0b1f825ee4481ea8883fe --- /dev/null +++ b/.venv/share/jupyter/lab/static/9359.34d1b961b733676193cb.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9359],{79359:(e,a,p)=>{p.d(a,{createArchitectureServices:()=>t.S});var t=p(77018);var c=p(74888)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9400.90fd1d2212781c80b587.js b/.venv/share/jupyter/lab/static/9400.90fd1d2212781c80b587.js new file mode 100644 index 0000000000000000000000000000000000000000..8187835908f4977d31f93f894120da18c15fdfbe --- /dev/null +++ b/.venv/share/jupyter/lab/static/9400.90fd1d2212781c80b587.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9400],{42519:function(t,e,r){var o=this&&this.__extends||function(){var t=function(e,r){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r))t[r]=e[r]};return 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 o(){this.constructor=e}e.prototype=r===null?Object.create(r):(o.prototype=r.prototype,new o)}}();var n=this&&this.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],o=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&o>=t.length)t=void 0;return{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:true});e.HTMLAdaptor=void 0;var i=r(21747);var a=function(t){o(e,t);function e(e){var r=t.call(this,e.document)||this;r.window=e;r.parser=new e.DOMParser;return r}e.prototype.parse=function(t,e){if(e===void 0){e="text/html"}return this.parser.parseFromString(t,e)};e.prototype.create=function(t,e){return e?this.document.createElementNS(e,t):this.document.createElement(t)};e.prototype.text=function(t){return this.document.createTextNode(t)};e.prototype.head=function(t){return t.head||t};e.prototype.body=function(t){return t.body||t};e.prototype.root=function(t){return t.documentElement||t};e.prototype.doctype=function(t){return t.doctype?""):""};e.prototype.tags=function(t,e,r){if(r===void 0){r=null}var o=r?t.getElementsByTagNameNS(r,e):t.getElementsByTagName(e);return Array.from(o)};e.prototype.getElements=function(t,e){var r,o;var i=[];try{for(var a=n(t),u=a.next();!u.done;u=a.next()){var l=u.value;if(typeof l==="string"){i=i.concat(Array.from(this.document.querySelectorAll(l)))}else if(Array.isArray(l)){i=i.concat(Array.from(l))}else if(l instanceof this.window.NodeList||l instanceof this.window.HTMLCollection){i=i.concat(Array.from(l))}else{i.push(l)}}}catch(p){r={error:p}}finally{try{if(u&&!u.done&&(o=a.return))o.call(a)}finally{if(r)throw r.error}}return i};e.prototype.contains=function(t,e){return t.contains(e)};e.prototype.parent=function(t){return t.parentNode};e.prototype.append=function(t,e){return t.appendChild(e)};e.prototype.insert=function(t,e){return this.parent(e).insertBefore(t,e)};e.prototype.remove=function(t){return this.parent(t).removeChild(t)};e.prototype.replace=function(t,e){return this.parent(e).replaceChild(t,e)};e.prototype.clone=function(t){return t.cloneNode(true)};e.prototype.split=function(t,e){return t.splitText(e)};e.prototype.next=function(t){return t.nextSibling};e.prototype.previous=function(t){return t.previousSibling};e.prototype.firstChild=function(t){return t.firstChild};e.prototype.lastChild=function(t){return t.lastChild};e.prototype.childNodes=function(t){return Array.from(t.childNodes)};e.prototype.childNode=function(t,e){return t.childNodes[e]};e.prototype.kind=function(t){var e=t.nodeType;return e===1||e===3||e===8?t.nodeName.toLowerCase():""};e.prototype.value=function(t){return t.nodeValue||""};e.prototype.textContent=function(t){return t.textContent};e.prototype.innerHTML=function(t){return t.innerHTML};e.prototype.outerHTML=function(t){return t.outerHTML};e.prototype.serializeXML=function(t){var e=new this.window.XMLSerializer;return e.serializeToString(t)};e.prototype.setAttribute=function(t,e,r,o){if(o===void 0){o=null}if(!o){return t.setAttribute(e,r)}e=o.replace(/.*\//,"")+":"+e.replace(/^.*:/,"");return t.setAttributeNS(o,e,r)};e.prototype.getAttribute=function(t,e){return t.getAttribute(e)};e.prototype.removeAttribute=function(t,e){return t.removeAttribute(e)};e.prototype.hasAttribute=function(t,e){return t.hasAttribute(e)};e.prototype.allAttributes=function(t){return Array.from(t.attributes).map((function(t){return{name:t.name,value:t.value}}))};e.prototype.addClass=function(t,e){if(t.classList){t.classList.add(e)}else{t.className=(t.className+" "+e).trim()}};e.prototype.removeClass=function(t,e){if(t.classList){t.classList.remove(e)}else{t.className=t.className.split(/ /).filter((function(t){return t!==e})).join(" ")}};e.prototype.hasClass=function(t,e){if(t.classList){return t.classList.contains(e)}return t.className.split(/ /).indexOf(e)>=0};e.prototype.setStyle=function(t,e,r){t.style[e]=r};e.prototype.getStyle=function(t,e){return t.style[e]};e.prototype.allStyles=function(t){return t.style.cssText};e.prototype.insertRules=function(t,e){var r,o;try{for(var i=n(e.reverse()),a=i.next();!a.done;a=i.next()){var u=a.value;try{t.sheet.insertRule(u,0)}catch(l){console.warn("MathJax: can't insert css rule '".concat(u,"': ").concat(l.message))}}}catch(p){r={error:p}}finally{try{if(a&&!a.done&&(o=i.return))o.call(i)}finally{if(r)throw r.error}}};e.prototype.fontSize=function(t){var e=this.window.getComputedStyle(t);return parseFloat(e.fontSize)};e.prototype.fontFamily=function(t){var e=this.window.getComputedStyle(t);return e.fontFamily||""};e.prototype.nodeSize=function(t,e,r){if(e===void 0){e=1}if(r===void 0){r=false}if(r&&t.getBBox){var o=t.getBBox(),n=o.width,i=o.height;return[n/e,i/e]}return[t.offsetWidth/e,t.offsetHeight/e]};e.prototype.nodeBBox=function(t){var e=t.getBoundingClientRect(),r=e.left,o=e.right,n=e.top,i=e.bottom;return{left:r,right:o,top:n,bottom:i}};return e}(i.AbstractDOMAdaptor);e.HTMLAdaptor=a},59400:(t,e,r)=>{Object.defineProperty(e,"__esModule",{value:true});e.browserAdaptor=void 0;var o=r(42519);function n(){return new o.HTMLAdaptor(window)}e.browserAdaptor=n},21747:function(t,e){var r=this&&this.__values||function(t){var e=typeof Symbol==="function"&&Symbol.iterator,r=e&&t[e],o=0;if(r)return r.call(t);if(t&&typeof t.length==="number")return{next:function(){if(t&&o>=t.length)t=void 0;return{value:t&&t[o++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};Object.defineProperty(e,"__esModule",{value:true});e.AbstractDOMAdaptor=void 0;var o=function(){function t(t){if(t===void 0){t=null}this.document=t}t.prototype.node=function(t,e,o,n){var i,a;if(e===void 0){e={}}if(o===void 0){o=[]}var u=this.create(t,n);this.setAttributes(u,e);try{for(var l=r(o),p=l.next();!p.done;p=l.next()){var s=p.value;this.append(u,s)}}catch(c){i={error:c}}finally{try{if(p&&!p.done&&(a=l.return))a.call(l)}finally{if(i)throw i.error}}return u};t.prototype.setAttributes=function(t,e){var o,n,i,a,u,l;if(e.style&&typeof e.style!=="string"){try{for(var p=r(Object.keys(e.style)),s=p.next();!s.done;s=p.next()){var c=s.value;this.setStyle(t,c.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()})),e.style[c])}}catch(v){o={error:v}}finally{try{if(s&&!s.done&&(n=p.return))n.call(p)}finally{if(o)throw o.error}}}if(e.properties){try{for(var f=r(Object.keys(e.properties)),y=f.next();!y.done;y=f.next()){var c=y.value;t[c]=e.properties[c]}}catch(m){i={error:m}}finally{try{if(y&&!y.done&&(a=f.return))a.call(f)}finally{if(i)throw i.error}}}try{for(var d=r(Object.keys(e)),h=d.next();!h.done;h=d.next()){var c=h.value;if((c!=="style"||typeof e.style==="string")&&c!=="properties"){this.setAttribute(t,c,e[c])}}}catch(b){u={error:b}}finally{try{if(h&&!h.done&&(l=d.return))l.call(d)}finally{if(u)throw u.error}}};t.prototype.replace=function(t,e){this.insert(t,e);this.remove(e);return e};t.prototype.childNode=function(t,e){return this.childNodes(t)[e]};t.prototype.allClasses=function(t){var e=this.getAttribute(t,"class");return!e?[]:e.replace(/ +/g," ").replace(/^ /,"").replace(/ $/,"").split(/ /)};return t}();e.AbstractDOMAdaptor=o}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9474.01b4e1d1e3376f4a5919.js b/.venv/share/jupyter/lab/static/9474.01b4e1d1e3376f4a5919.js new file mode 100644 index 0000000000000000000000000000000000000000..ad4f4413b6753b70cdfe25b1c665a94db4090444 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9474.01b4e1d1e3376f4a5919.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9474],{59474:(e,t,n)=>{n.r(t);n.d(t,{turtle:()=>p});var r;function i(e){return new RegExp("^(?:"+e.join("|")+")$","i")}var l=i([]);var a=i(["@prefix","@base","a"]);var o=/[*+\-<>=&|]/;function c(e,t){var n=e.next();r=null;if(n=="<"&&!e.match(/^[\s\u00a0=]/,false)){e.match(/^[^\s\u00a0>]*>?/);return"atom"}else if(n=='"'||n=="'"){t.tokenize=u(n);return t.tokenize(e,t)}else if(/[{}\(\),\.;\[\]]/.test(n)){r=n;return null}else if(n=="#"){e.skipToEnd();return"comment"}else if(o.test(n)){e.eatWhile(o);return null}else if(n==":"){return"operator"}else{e.eatWhile(/[_\w\d]/);if(e.peek()==":"){return"variableName.special"}else{var i=e.current();if(a.test(i)){return"meta"}if(n>="A"&&n<="Z"){return"comment"}else{return"keyword"}}var i=e.current();if(l.test(i))return null;else if(a.test(i))return"meta";else return"variable"}}function u(e){return function(t,n){var r=false,i;while((i=t.next())!=null){if(i==e&&!r){n.tokenize=c;break}r=!r&&i=="\\"}return"string"}}function s(e,t,n){e.context={prev:e.context,indent:e.indent,col:n,type:t}}function f(e){e.indent=e.context.indent;e.context=e.context.prev}const p={name:"turtle",startState:function(){return{tokenize:c,context:null,indent:0,col:0}},token:function(e,t){if(e.sol()){if(t.context&&t.context.align==null)t.context.align=false;t.indent=e.indentation()}if(e.eatSpace())return null;var n=t.tokenize(e,t);if(n!="comment"&&t.context&&t.context.align==null&&t.context.type!="pattern"){t.context.align=true}if(r=="(")s(t,")",e.column());else if(r=="[")s(t,"]",e.column());else if(r=="{")s(t,"}",e.column());else if(/[\]\}\)]/.test(r)){while(t.context&&t.context.type=="pattern")f(t);if(t.context&&r==t.context.type)f(t)}else if(r=="."&&t.context&&t.context.type=="pattern")f(t);else if(/atom|string|variable/.test(n)&&t.context){if(/[\}\]]/.test(t.context.type))s(t,"pattern",e.column());else if(t.context.type=="pattern"&&!t.context.align){t.context.align=true;t.context.col=e.column()}}return n},indent:function(e,t,n){var r=t&&t.charAt(0);var i=e.context;if(/[\]\}]/.test(r))while(i&&i.type=="pattern")i=i.prev;var l=i&&r==i.type;if(!i)return 0;else if(i.type=="pattern")return i.col;else if(i.align)return i.col+(l?0:1);else return i.indent+(l?0:n.unit)},languageData:{commentTokens:{line:"#"}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9517.7056cafdf1da3a136d45.js b/.venv/share/jupyter/lab/static/9517.7056cafdf1da3a136d45.js new file mode 100644 index 0000000000000000000000000000000000000000..12eacf29b44f4326af74960eae2e06308cbc4573 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9517.7056cafdf1da3a136d45.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9517],{79517:(e,t,i)=>{i.r(t);i.d(t,{properties:()=>n});const n={name:"properties",token:function(e,t){var i=e.sol()||t.afterSection;var n=e.eol();t.afterSection=false;if(i){if(t.nextMultiline){t.inMultiline=true;t.nextMultiline=false}else{t.position="def"}}if(n&&!t.nextMultiline){t.inMultiline=false;t.position="def"}if(i){while(e.eatSpace()){}}var l=e.next();if(i&&(l==="#"||l==="!"||l===";")){t.position="comment";e.skipToEnd();return"comment"}else if(i&&l==="["){t.afterSection=true;e.skipTo("]");e.eat("]");return"header"}else if(l==="="||l===":"){t.position="quote";return null}else if(l==="\\"&&t.position==="quote"){if(e.eol()){t.nextMultiline=true}}return t.position},startState:function(){return{position:"def",nextMultiline:false,inMultiline:false,afterSection:false}}}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9572.f91bbaa33e932d524f8f.js b/.venv/share/jupyter/lab/static/9572.f91bbaa33e932d524f8f.js new file mode 100644 index 0000000000000000000000000000000000000000..fbfbb00be96b77ff6a6ab1fd8a64b87ab4cba064 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9572.f91bbaa33e932d524f8f.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9572],{19756:function(t){!function(e,n){true?t.exports=n():0}(this,(function(){"use strict";return function(t,e){var n=e.prototype,i=n.format;n.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return i.bind(this)(t);var r=this.$utils(),s=(t||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(t){switch(t){case"Q":return Math.ceil((e.$M+1)/3);case"Do":return n.ordinal(e.$D);case"gggg":return e.weekYear();case"GGGG":return e.isoWeekYear();case"wo":return n.ordinal(e.week(),"W");case"w":case"ww":return r.s(e.week(),"w"===t?1:2,"0");case"W":case"WW":return r.s(e.isoWeek(),"W"===t?1:2,"0");case"k":case"kk":return r.s(String(0===e.$H?24:e.$H),"k"===t?1:2,"0");case"X":return Math.floor(e.$d.getTime()/1e3);case"x":return e.$d.getTime();case"z":return"["+e.offsetName()+"]";case"zzz":return"["+e.offsetName("long")+"]";default:return t}}));return i.bind(this)(s)}}}))},90445:function(t){!function(e,n){true?t.exports=n():0}(this,(function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},e=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,n=/\d/,i=/\d\d/,r=/\d\d?/,s=/\d*[^-_:/,()\s\d]+/,a={},o=function(t){return(t=+t)+(t>68?1900:2e3)};var c=function(t){return function(e){this[t]=+e}},l=[/[+-]\d\d:?(\d\d)?|Z/,function(t){(this.zone||(this.zone={})).offset=function(t){if(!t)return 0;if("Z"===t)return 0;var e=t.match(/([+-]|\d\d)/g),n=60*e[1]+(+e[2]||0);return 0===n?0:"+"===e[0]?-n:n}(t)}],u=function(t){var e=a[t];return e&&(e.indexOf?e:e.s.concat(e.f))},d=function(t,e){var n,i=a.meridiem;if(i){for(var r=1;r<=24;r+=1)if(t.indexOf(i(r,0,e))>-1){n=r>12;break}}else n=t===(e?"pm":"PM");return n},f={A:[s,function(t){this.afternoon=d(t,!1)}],a:[s,function(t){this.afternoon=d(t,!0)}],Q:[n,function(t){this.month=3*(t-1)+1}],S:[n,function(t){this.milliseconds=100*+t}],SS:[i,function(t){this.milliseconds=10*+t}],SSS:[/\d{3}/,function(t){this.milliseconds=+t}],s:[r,c("seconds")],ss:[r,c("seconds")],m:[r,c("minutes")],mm:[r,c("minutes")],H:[r,c("hours")],h:[r,c("hours")],HH:[r,c("hours")],hh:[r,c("hours")],D:[r,c("day")],DD:[i,c("day")],Do:[s,function(t){var e=a.ordinal,n=t.match(/\d+/);if(this.day=n[0],e)for(var i=1;i<=31;i+=1)e(i).replace(/\[|\]/g,"")===t&&(this.day=i)}],w:[r,c("week")],ww:[i,c("week")],M:[r,c("month")],MM:[i,c("month")],MMM:[s,function(t){var e=u("months"),n=(u("monthsShort")||e.map((function(t){return t.slice(0,3)}))).indexOf(t)+1;if(n<1)throw new Error;this.month=n%12||n}],MMMM:[s,function(t){var e=u("months").indexOf(t)+1;if(e<1)throw new Error;this.month=e%12||e}],Y:[/[+-]?\d+/,c("year")],YY:[i,function(t){this.year=o(t)}],YYYY:[/\d{4}/,c("year")],Z:l,ZZ:l};function h(n){var i,r;i=n,r=a&&a.formats;for(var s=(n=i.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,n,i){var s=i&&i.toUpperCase();return n||r[i]||t[i]||r[s].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))).match(e),o=s.length,c=0;c-1)return new Date(("X"===e?1e3:1)*t);var r=h(e)(t),s=r.year,a=r.month,o=r.day,c=r.hours,l=r.minutes,u=r.seconds,d=r.milliseconds,f=r.zone,k=r.week,y=new Date,m=o||(s||a?1:y.getDate()),p=s||y.getFullYear(),g=0;s&&!a||(g=a>0?a-1:y.getMonth());var v,b=c||0,T=l||0,x=u||0,w=d||0;return f?new Date(Date.UTC(p,g,m,b,T,x,w+60*f.offset*1e3)):n?new Date(Date.UTC(p,g,m,b,T,x,w)):(v=new Date(p,g,m,b,T,x,w),k&&(v=i(v).week(k).toDate()),v)}catch(t){return new Date("")}}(e,o,i,n),this.init(),d&&!0!==d&&(this.$L=this.locale(d).$L),u&&e!=this.format(o)&&(this.$d=new Date("")),a={}}else if(o instanceof Array)for(var f=o.length,k=1;k<=f;k+=1){s[1]=o[k-1];var y=n.apply(this,s);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}k===f&&(this.$d=new Date(""))}else r.call(this,t)}}}))},90694:function(t){!function(e,n){true?t.exports=n():0}(this,(function(){"use strict";var t="day";return function(e,n,i){var r=function(e){return e.add(4-e.isoWeekday(),t)},s=n.prototype;s.isoWeekYear=function(){return r(this).year()},s.isoWeek=function(e){if(!this.$utils().u(e))return this.add(7*(e-this.isoWeek()),t);var n,s,a,o,c=r(this),l=(n=this.isoWeekYear(),s=this.$u,a=(s?i.utc:i)().year(n).startOf("year"),o=4-a.isoWeekday(),a.isoWeekday()>4&&(o+=7),a.add(o,t));return c.diff(l,"week")+1},s.isoWeekday=function(t){return this.$utils().u(t)?this.day()||7:this.day(this.day()%7?t:t-7)};var a=s.startOf;s.startOf=function(t,e){var n=this.$utils(),i=!!n.u(e)||e;return"isoweek"===n.p(t)?i?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):a.bind(this)(t,e)}}}))},87191:(t,e,n)=>{"use strict";n.d(e,{diagram:()=>Nt});var i=n(96049);var r=n(75905);var s=n(16750);var a=n(74353);var o=n.n(a);var c=n(90694);var l=n.n(c);var u=n(90445);var d=n.n(u);var f=n(19756);var h=n.n(f);var k=n(24982);var y=function(){var t=(0,r.K2)((function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n}),"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],n=[1,26],i=[1,27],s=[1,28],a=[1,29],o=[1,30],c=[1,31],l=[1,32],u=[1,33],d=[1,34],f=[1,9],h=[1,10],k=[1,11],y=[1,12],m=[1,13],p=[1,14],g=[1,15],v=[1,16],b=[1,19],T=[1,20],x=[1,21],w=[1,22],_=[1,23],D=[1,25],$=[1,35];var C={trace:(0,r.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:(0,r.K2)((function t(e,n,i,r,s,a,o){var c=a.length-1;switch(s){case 1:return a[c-1];break;case 2:this.$=[];break;case 3:a[c-1].push(a[c]);this.$=a[c-1];break;case 4:case 5:this.$=a[c];break;case 6:case 7:this.$=[];break;case 8:r.setWeekday("monday");break;case 9:r.setWeekday("tuesday");break;case 10:r.setWeekday("wednesday");break;case 11:r.setWeekday("thursday");break;case 12:r.setWeekday("friday");break;case 13:r.setWeekday("saturday");break;case 14:r.setWeekday("sunday");break;case 15:r.setWeekend("friday");break;case 16:r.setWeekend("saturday");break;case 17:r.setDateFormat(a[c].substr(11));this.$=a[c].substr(11);break;case 18:r.enableInclusiveEndDates();this.$=a[c].substr(18);break;case 19:r.TopAxis();this.$=a[c].substr(8);break;case 20:r.setAxisFormat(a[c].substr(11));this.$=a[c].substr(11);break;case 21:r.setTickInterval(a[c].substr(13));this.$=a[c].substr(13);break;case 22:r.setExcludes(a[c].substr(9));this.$=a[c].substr(9);break;case 23:r.setIncludes(a[c].substr(9));this.$=a[c].substr(9);break;case 24:r.setTodayMarker(a[c].substr(12));this.$=a[c].substr(12);break;case 27:r.setDiagramTitle(a[c].substr(6));this.$=a[c].substr(6);break;case 28:this.$=a[c].trim();r.setAccTitle(this.$);break;case 29:case 30:this.$=a[c].trim();r.setAccDescription(this.$);break;case 31:r.addSection(a[c].substr(8));this.$=a[c].substr(8);break;case 33:r.addTask(a[c-1],a[c]);this.$="task";break;case 34:this.$=a[c-1];r.setClickEvent(a[c-1],a[c],null);break;case 35:this.$=a[c-2];r.setClickEvent(a[c-2],a[c-1],a[c]);break;case 36:this.$=a[c-2];r.setClickEvent(a[c-2],a[c-1],null);r.setLink(a[c-2],a[c]);break;case 37:this.$=a[c-3];r.setClickEvent(a[c-3],a[c-2],a[c-1]);r.setLink(a[c-3],a[c]);break;case 38:this.$=a[c-2];r.setClickEvent(a[c-2],a[c],null);r.setLink(a[c-2],a[c-1]);break;case 39:this.$=a[c-3];r.setClickEvent(a[c-3],a[c-1],a[c]);r.setLink(a[c-3],a[c-2]);break;case 40:this.$=a[c-1];r.setLink(a[c-1],a[c]);break;case 41:case 47:this.$=a[c-1]+" "+a[c];break;case 42:case 43:case 45:this.$=a[c-2]+" "+a[c-1]+" "+a[c];break;case 44:case 46:this.$=a[c-3]+" "+a[c-2]+" "+a[c-1]+" "+a[c];break}}),"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:n,13:i,14:s,15:a,16:o,17:c,18:l,19:18,20:u,21:d,22:f,23:h,24:k,25:y,26:m,27:p,28:g,29:v,30:b,31:T,33:x,35:w,36:_,37:24,38:D,40:$},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:n,13:i,14:s,15:a,16:o,17:c,18:l,19:18,20:u,21:d,22:f,23:h,24:k,25:y,26:m,27:p,28:g,29:v,30:b,31:T,33:x,35:w,36:_,37:24,38:D,40:$},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:(0,r.K2)((function t(e,n){if(n.recoverable){this.trace(e)}else{var i=new Error(e);i.hash=n;throw i}}),"parseError"),parse:(0,r.K2)((function t(e){var n=this,i=[0],s=[],a=[null],o=[],c=this.table,l="",u=0,d=0,f=0,h=2,k=1;var y=o.slice.call(arguments,1);var m=Object.create(this.lexer);var p={yy:{}};for(var g in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,g)){p.yy[g]=this.yy[g]}}m.setInput(e,p.yy);p.yy.lexer=m;p.yy.parser=this;if(typeof m.yylloc=="undefined"){m.yylloc={}}var v=m.yylloc;o.push(v);var b=m.options&&m.options.ranges;if(typeof p.yy.parseError==="function"){this.parseError=p.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function T(t){i.length=i.length-2*t;a.length=a.length-t;o.length=o.length-t}(0,r.K2)(T,"popStack");function x(){var t;t=s.pop()||m.lex()||k;if(typeof t!=="number"){if(t instanceof Array){s=t;t=s.pop()}t=n.symbols_[t]||t}return t}(0,r.K2)(x,"lex");var w,_,D,$,C,S,K={},E,M,A,L;while(true){D=i[i.length-1];if(this.defaultActions[D]){$=this.defaultActions[D]}else{if(w===null||typeof w=="undefined"){w=x()}$=c[D]&&c[D][w]}if(typeof $==="undefined"||!$.length||!$[0]){var Y="";L=[];for(E in c[D]){if(this.terminals_[E]&&E>h){L.push("'"+this.terminals_[E]+"'")}}if(m.showPosition){Y="Parse error on line "+(u+1)+":\n"+m.showPosition()+"\nExpecting "+L.join(", ")+", got '"+(this.terminals_[w]||w)+"'"}else{Y="Parse error on line "+(u+1)+": Unexpected "+(w==k?"end of input":"'"+(this.terminals_[w]||w)+"'")}this.parseError(Y,{text:m.match,token:this.terminals_[w]||w,line:m.yylineno,loc:v,expected:L})}if($[0]instanceof Array&&$.length>1){throw new Error("Parse Error: multiple actions possible at state: "+D+", token: "+w)}switch($[0]){case 1:i.push(w);a.push(m.yytext);o.push(m.yylloc);i.push($[1]);w=null;if(!_){d=m.yyleng;l=m.yytext;u=m.yylineno;v=m.yylloc;if(f>0){f--}}else{w=_;_=null}break;case 2:M=this.productions_[$[1]][1];K.$=a[a.length-M];K._$={first_line:o[o.length-(M||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(M||1)].first_column,last_column:o[o.length-1].last_column};if(b){K._$.range=[o[o.length-(M||1)].range[0],o[o.length-1].range[1]]}S=this.performAction.apply(K,[l,d,u,p.yy,$[1],a,o].concat(y));if(typeof S!=="undefined"){return S}if(M){i=i.slice(0,-1*M*2);a=a.slice(0,-1*M);o=o.slice(0,-1*M)}i.push(this.productions_[$[1]][0]);a.push(K.$);o.push(K._$);A=c[i[i.length-2]][i[i.length-1]];i.push(A);break;case 3:return true}}return true}),"parse")};var S=function(){var t={EOF:1,parseError:(0,r.K2)((function t(e,n){if(this.yy.parser){this.yy.parser.parseError(e,n)}else{throw new Error(e)}}),"parseError"),setInput:(0,r.K2)((function(t,e){this.yy=e||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,r.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);if(e){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,r.K2)((function(t){var e=t.length;var n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-e);this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(n.length-1){this.yylineno-=n.length-1}var r=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[0].length:this.yylloc.first_column-e};if(this.options.ranges){this.yylloc.range=[r[0],r[0]+this.yyleng-e]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,r.K2)((function(){this._more=true;return this}),"more"),reject:(0,r.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,r.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,r.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,r.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,r.K2)((function(){var t=this.pastInput();var e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"}),"showPosition"),test_match:(0,r.K2)((function(t,e){var n,i,r;if(this.options.backtrack_lexer){r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){r.yylloc.range=this.yylloc.range.slice(0)}}i=t[0].match(/(?:\r\n?|\n).*/g);if(i){this.yylineno+=i.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(n){return n}else if(this._backtrack){for(var s in r){this[s]=r[s]}return false}return false}),"test_match"),next:(0,r.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,e,n,i;if(!this._more){this.yytext="";this.match=""}var r=this._currentRules();for(var s=0;se[0].length)){e=n;i=s;if(this.options.backtrack_lexer){t=this.test_match(n,r[s]);if(t!==false){return t}else if(this._backtrack){e=false;continue}else{return false}}else if(!this.options.flex){break}}}if(e){t=this.test_match(e,r[i]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,r.K2)((function t(){var e=this.next();if(e){return e}else{return this.lex()}}),"lex"),begin:(0,r.K2)((function t(e){this.conditionStack.push(e)}),"begin"),popState:(0,r.K2)((function t(){var e=this.conditionStack.length-1;if(e>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,r.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,r.K2)((function t(e){e=this.conditionStack.length-1-Math.abs(e||0);if(e>=0){return this.conditionStack[e]}else{return"INITIAL"}}),"topState"),pushState:(0,r.K2)((function t(e){this.begin(e)}),"pushState"),stateStackSize:(0,r.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,r.K2)((function t(e,n,i,r){var s=r;switch(i){case 0:this.begin("open_directive");return"open_directive";break;case 1:this.begin("acc_title");return 31;break;case 2:this.popState();return"acc_title_value";break;case 3:this.begin("acc_descr");return 33;break;case 4:this.popState();return"acc_descr_value";break;case 5:this.begin("acc_descr_multiline");break;case 6:this.popState();break;case 7:return"acc_descr_multiline_value";break;case 8:break;case 9:break;case 10:break;case 11:return 10;break;case 12:break;case 13:break;case 14:this.begin("href");break;case 15:this.popState();break;case 16:return 43;break;case 17:this.begin("callbackname");break;case 18:this.popState();break;case 19:this.popState();this.begin("callbackargs");break;case 20:return 41;break;case 21:this.popState();break;case 22:return 42;break;case 23:this.begin("click");break;case 24:this.popState();break;case 25:return 40;break;case 26:return 4;break;case 27:return 22;break;case 28:return 23;break;case 29:return 24;break;case 30:return 25;break;case 31:return 26;break;case 32:return 28;break;case 33:return 27;break;case 34:return 29;break;case 35:return 12;break;case 36:return 13;break;case 37:return 14;break;case 38:return 15;break;case 39:return 16;break;case 40:return 17;break;case 41:return 18;break;case 42:return 20;break;case 43:return 21;break;case 44:return"date";break;case 45:return 30;break;case 46:return"accDescription";break;case 47:return 36;break;case 48:return 38;break;case 49:return 39;break;case 50:return":";break;case 51:return 6;break;case 52:return"INVALID";break}}),"anonymous"),rules:[/^(?:%%\{)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:%%(?!\{)*[^\n]*)/i,/^(?:[^\}]%%*[^\n]*)/i,/^(?:%%*[^\n]*[\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:%[^\n]*)/i,/^(?:href[\s]+["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:call[\s]+)/i,/^(?:\([\s]*\))/i,/^(?:\()/i,/^(?:[^(]*)/i,/^(?:\))/i,/^(?:[^)]*)/i,/^(?:click[\s]+)/i,/^(?:[\s\n])/i,/^(?:[^\s\n]*)/i,/^(?:gantt\b)/i,/^(?:dateFormat\s[^#\n;]+)/i,/^(?:inclusiveEndDates\b)/i,/^(?:topAxis\b)/i,/^(?:axisFormat\s[^#\n;]+)/i,/^(?:tickInterval\s[^#\n;]+)/i,/^(?:includes\s[^#\n;]+)/i,/^(?:excludes\s[^#\n;]+)/i,/^(?:todayMarker\s[^\n;]+)/i,/^(?:weekday\s+monday\b)/i,/^(?:weekday\s+tuesday\b)/i,/^(?:weekday\s+wednesday\b)/i,/^(?:weekday\s+thursday\b)/i,/^(?:weekday\s+friday\b)/i,/^(?:weekday\s+saturday\b)/i,/^(?:weekday\s+sunday\b)/i,/^(?:weekend\s+friday\b)/i,/^(?:weekend\s+saturday\b)/i,/^(?:\d\d\d\d-\d\d-\d\d\b)/i,/^(?:title\s[^\n]+)/i,/^(?:accDescription\s[^#\n;]+)/i,/^(?:section\s[^\n]+)/i,/^(?:[^:\n]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[6,7],inclusive:false},acc_descr:{rules:[4],inclusive:false},acc_title:{rules:[2],inclusive:false},callbackargs:{rules:[21,22],inclusive:false},callbackname:{rules:[18,19,20],inclusive:false},href:{rules:[15,16],inclusive:false},click:{rules:[24,25],inclusive:false},INITIAL:{rules:[0,1,3,5,8,9,10,11,12,13,14,17,23,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52],inclusive:true}}};return t}();C.lexer=S;function K(){this.yy={}}(0,r.K2)(K,"Parser");K.prototype=C;C.Parser=K;return new K}();y.parser=y;var m=y;o().extend(l());o().extend(d());o().extend(h());var p={friday:5,saturday:6};var g="";var v="";var b=void 0;var T="";var x=[];var w=[];var _=new Map;var D=[];var $=[];var C="";var S="";var K=["active","done","crit","milestone"];var E=[];var M=false;var A=false;var L="sunday";var Y="saturday";var I=0;var F=(0,r.K2)((function(){D=[];$=[];C="";E=[];kt=0;gt=void 0;vt=void 0;bt=[];g="";v="";S="";b=void 0;T="";x=[];w=[];M=false;A=false;I=0;_=new Map;(0,r.IU)();L="sunday";Y="saturday"}),"clear");var W=(0,r.K2)((function(t){v=t}),"setAxisFormat");var O=(0,r.K2)((function(){return v}),"getAxisFormat");var P=(0,r.K2)((function(t){b=t}),"setTickInterval");var B=(0,r.K2)((function(){return b}),"getTickInterval");var z=(0,r.K2)((function(t){T=t}),"setTodayMarker");var N=(0,r.K2)((function(){return T}),"getTodayMarker");var G=(0,r.K2)((function(t){g=t}),"setDateFormat");var H=(0,r.K2)((function(){M=true}),"enableInclusiveEndDates");var j=(0,r.K2)((function(){return M}),"endDatesAreInclusive");var R=(0,r.K2)((function(){A=true}),"enableTopAxis");var U=(0,r.K2)((function(){return A}),"topAxisEnabled");var V=(0,r.K2)((function(t){S=t}),"setDisplayMode");var Z=(0,r.K2)((function(){return S}),"getDisplayMode");var X=(0,r.K2)((function(){return g}),"getDateFormat");var q=(0,r.K2)((function(t){x=t.toLowerCase().split(/[\s,]+/)}),"setIncludes");var Q=(0,r.K2)((function(){return x}),"getIncludes");var J=(0,r.K2)((function(t){w=t.toLowerCase().split(/[\s,]+/)}),"setExcludes");var tt=(0,r.K2)((function(){return w}),"getExcludes");var et=(0,r.K2)((function(){return _}),"getLinks");var nt=(0,r.K2)((function(t){C=t;D.push(t)}),"addSection");var it=(0,r.K2)((function(){return D}),"getSections");var rt=(0,r.K2)((function(){let t=Dt();const e=10;let n=0;while(!t&&n[\d\w- ]+)/;const s=i.exec(n);if(s!==null){let t=null;for(const n of s.groups.ids.split(" ")){let e=wt(n);if(e!==void 0&&(!t||e.endTime>t.endTime)){t=e}}if(t){return t.endTime}const e=new Date;e.setHours(0,0,0,0);return e}let a=o()(n,e.trim(),true);if(a.isValid()){return a.toDate()}else{r.Rm.debug("Invalid date:"+n);r.Rm.debug("With date format:"+e.trim());const t=new Date(n);if(t===void 0||isNaN(t.getTime())||t.getFullYear()<-1e4||t.getFullYear()>1e4){throw new Error("Invalid date:"+n)}return t}}),"getStartDate");var ft=(0,r.K2)((function(t){const e=/^(\d+(?:\.\d+)?)([Mdhmswy]|ms)$/.exec(t.trim());if(e!==null){return[Number.parseFloat(e[1]),e[2]]}return[NaN,"ms"]}),"parseDuration");var ht=(0,r.K2)((function(t,e,n,i=false){n=n.trim();const r=/^until\s+(?[\d\w- ]+)/;const s=r.exec(n);if(s!==null){let t=null;for(const n of s.groups.ids.split(" ")){let e=wt(n);if(e!==void 0&&(!t||e.startTime{window.open(n,"_self")}));_.set(t,n)}}));Ct(t,"clickable")}),"setLink");var Ct=(0,r.K2)((function(t,e){t.split(",").forEach((function(t){let n=wt(t);if(n!==void 0){n.classes.push(e)}}))}),"setClass");var St=(0,r.K2)((function(t,e,n){if((0,r.D7)().securityLevel!=="loose"){return}if(e===void 0){return}let s=[];if(typeof n==="string"){s=n.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t{i._K.runFunc(e,...s)}))}}),"setClickFun");var Kt=(0,r.K2)((function(t,e){E.push((function(){const n=document.querySelector(`[id="${t}"]`);if(n!==null){n.addEventListener("click",(function(){e()}))}}),(function(){const n=document.querySelector(`[id="${t}-text"]`);if(n!==null){n.addEventListener("click",(function(){e()}))}}))}),"pushFun");var Et=(0,r.K2)((function(t,e,n){t.split(",").forEach((function(t){St(t,e,n)}));Ct(t,"clickable")}),"setClickEvent");var Mt=(0,r.K2)((function(t){E.forEach((function(e){e(t)}))}),"bindFunctions");var At={getConfig:(0,r.K2)((()=>(0,r.D7)().gantt),"getConfig"),clear:F,setDateFormat:G,getDateFormat:X,enableInclusiveEndDates:H,endDatesAreInclusive:j,enableTopAxis:R,topAxisEnabled:U,setAxisFormat:W,getAxisFormat:O,setTickInterval:P,getTickInterval:B,setTodayMarker:z,getTodayMarker:N,setAccTitle:r.SV,getAccTitle:r.iN,setDiagramTitle:r.ke,getDiagramTitle:r.ab,setDisplayMode:V,getDisplayMode:Z,setAccDescription:r.EI,getAccDescription:r.m7,addSection:nt,getSections:it,getTasks:rt,addTask:xt,findTaskById:wt,addTaskOrg:_t,setIncludes:q,getIncludes:Q,setExcludes:J,getExcludes:tt,setClickEvent:Et,setLink:$t,getLinks:et,bindFunctions:Mt,parseDuration:ft,isInvalidDate:st,setWeekday:at,getWeekday:ot,setWeekend:ct};function Lt(t,e,n){let i=true;while(i){i=false;n.forEach((function(n){const r="^\\s*"+n+"\\s*$";const s=new RegExp(r);if(t[0].match(s)){e[n]=true;t.shift(1);i=true}}))}}(0,r.K2)(Lt,"getTaskTags");var Yt=(0,r.K2)((function(){r.Rm.debug("Something is calling, setConf, remove the call")}),"setConf");var It={monday:k.ABi,tuesday:k.PGu,wednesday:k.GuW,thursday:k.Mol,friday:k.TUC,saturday:k.rGn,sunday:k.YPH};var Ft=(0,r.K2)(((t,e)=>{let n=[...t].map((()=>-Infinity));let i=[...t].sort(((t,e)=>t.startTime-e.startTime||t.order-e.order));let r=0;for(const s of i){for(let t=0;t=n[t]){n[t]=s.endTime;s.order=t+e;if(t>r){r=t}break}}}return r}),"getMaxIntersections");var Wt;var Ot=(0,r.K2)((function(t,e,n,i){const s=(0,r.D7)().gantt;const a=(0,r.D7)().securityLevel;let c;if(a==="sandbox"){c=(0,k.Ltv)("#i"+e)}const l=a==="sandbox"?(0,k.Ltv)(c.nodes()[0].contentDocument.body):(0,k.Ltv)("body");const u=a==="sandbox"?c.nodes()[0].contentDocument:document;const d=u.getElementById(e);Wt=d.parentElement.offsetWidth;if(Wt===void 0){Wt=1200}if(s.useWidth!==void 0){Wt=s.useWidth}const f=i.db.getTasks();let h=[];for(const r of f){h.push(r.type)}h=$(h);const y={};let m=2*s.topPadding;if(i.db.getDisplayMode()==="compact"||s.displayMode==="compact"){const t={};for(const n of f){if(t[n.section]===void 0){t[n.section]=[n]}else{t[n.section].push(n)}}let e=0;for(const n of Object.keys(t)){const i=Ft(t[n],e)+1;e+=i;m+=i*(s.barHeight+s.barGap);y[n]=i}}else{m+=f.length*(s.barHeight+s.barGap);for(const t of h){y[t]=f.filter((e=>e.type===t)).length}}d.setAttribute("viewBox","0 0 "+Wt+" "+m);const p=l.select(`[id="${e}"]`);const g=(0,k.w7C)().domain([(0,k.jkA)(f,(function(t){return t.startTime})),(0,k.T9B)(f,(function(t){return t.endTime}))]).rangeRound([0,Wt-s.leftPadding-s.rightPadding]);function v(t,e){const n=t.startTime;const i=e.startTime;let r=0;if(n>i){r=1}else if(nt.order)))];const f=d.map((e=>t.find((t=>t.order===e))));p.append("g").selectAll("rect").data(f).enter().append("rect").attr("x",0).attr("y",(function(t,e){e=t.order;return e*n+a-2})).attr("width",(function(){return u-s.rightPadding/2})).attr("height",n).attr("class",(function(t){for(const[e,n]of h.entries()){if(t.type===n){return"section section"+e%s.numberSectionStyles}}return"section section0"}));const y=p.append("g").selectAll("rect").data(t).enter();const m=i.db.getLinks();y.append("rect").attr("id",(function(t){return t.id})).attr("rx",3).attr("ry",3).attr("x",(function(t){if(t.milestone){return g(t.startTime)+o+.5*(g(t.endTime)-g(t.startTime))-.5*c}return g(t.startTime)+o})).attr("y",(function(t,e){e=t.order;return e*n+a})).attr("width",(function(t){if(t.milestone){return c}return g(t.renderEndTime||t.endTime)-g(t.startTime)})).attr("height",c).attr("transform-origin",(function(t,e){e=t.order;return(g(t.startTime)+o+.5*(g(t.endTime)-g(t.startTime))).toString()+"px "+(e*n+a+.5*c).toString()+"px"})).attr("class",(function(t){const e="task";let n="";if(t.classes.length>0){n=t.classes.join(" ")}let i=0;for(const[a,o]of h.entries()){if(t.type===o){i=a%s.numberSectionStyles}}let r="";if(t.active){if(t.crit){r+=" activeCrit"}else{r=" active"}}else if(t.done){if(t.crit){r=" doneCrit"}else{r=" done"}}else{if(t.crit){r+=" crit"}}if(r.length===0){r=" task"}if(t.milestone){r=" milestone "+r}r+=i;r+=" "+n;return e+r}));y.append("text").attr("id",(function(t){return t.id+"-text"})).text((function(t){return t.task})).attr("font-size",s.fontSize).attr("x",(function(t){let e=g(t.startTime);let n=g(t.renderEndTime||t.endTime);if(t.milestone){e+=.5*(g(t.endTime)-g(t.startTime))-.5*c}if(t.milestone){n=e+c}const i=this.getBBox().width;if(i>n-e){if(n+i+1.5*s.leftPadding>u){return e+o-5}else{return n+o+5}}else{return(n-e)/2+e+o}})).attr("y",(function(t,e){e=t.order;return e*n+s.barHeight/2+(s.fontSize/2-2)+a})).attr("text-height",c).attr("class",(function(t){const e=g(t.startTime);let n=g(t.endTime);if(t.milestone){n=e+c}const i=this.getBBox().width;let r="";if(t.classes.length>0){r=t.classes.join(" ")}let a=0;for(const[c,l]of h.entries()){if(t.type===l){a=c%s.numberSectionStyles}}let o="";if(t.active){if(t.crit){o="activeCritText"+a}else{o="activeText"+a}}if(t.done){if(t.crit){o=o+" doneCritText"+a}else{o=o+" doneText"+a}}else{if(t.crit){o=o+" critText"+a}}if(t.milestone){o+=" milestoneText"}if(i>n-e){if(n+i+1.5*s.leftPadding>u){return r+" taskTextOutsideLeft taskTextOutside"+a+" "+o}else{return r+" taskTextOutsideRight taskTextOutside"+a+" "+o+" width-"+i}}else{return r+" taskText taskText"+a+" "+o+" width-"+i}}));const v=(0,r.D7)().securityLevel;if(v==="sandbox"){let t;t=(0,k.Ltv)("#i"+e);const n=t.nodes()[0].contentDocument;y.filter((function(t){return m.has(t.id)})).each((function(t){var e=n.querySelector("#"+t.id);var i=n.querySelector("#"+t.id+"-text");const r=e.parentNode;var s=n.createElement("a");s.setAttribute("xlink:href",m.get(t.id));s.setAttribute("target","_top");r.appendChild(s);s.appendChild(e);s.appendChild(i)}))}}(0,r.K2)(T,"drawRects");function x(t,e,n,a,c,l,u,d){if(u.length===0&&d.length===0){return}let f;let h;for(const{startTime:i,endTime:r}of l){if(f===void 0||ih){h=r}}if(!f||!h){return}if(o()(h).diff(o()(f),"year")>5){r.Rm.warn("The difference between the min and max time is more than 5 years. This will cause performance issues. Skipping drawing exclude days.");return}const k=i.db.getDateFormat();const y=[];let m=null;let v=o()(f);while(v.valueOf()<=h){if(i.db.isInvalidDate(v,k,u,d)){if(!m){m={start:v,end:v}}else{m.end=v}}else{if(m){y.push(m);m=null}}v=v.add(1,"d")}const b=p.append("g").selectAll("rect").data(y).enter();b.append("rect").attr("id",(function(t){return"exclude-"+t.start.format("YYYY-MM-DD")})).attr("x",(function(t){return g(t.start)+n})).attr("y",s.gridLineStartPadding).attr("width",(function(t){const e=t.end.add(1,"day");return g(e)-g(t.start)})).attr("height",c-e-s.gridLineStartPadding).attr("transform-origin",(function(e,i){return(g(e.start)+n+.5*(g(e.end)-g(e.start))).toString()+"px "+(i*t+.5*c).toString()+"px"})).attr("class","exclude-range")}(0,r.K2)(x,"drawExcludeDays");function w(t,e,n,r){let a=(0,k.l78)(g).tickSize(-r+e+s.gridLineStartPadding).tickFormat((0,k.DCK)(i.db.getAxisFormat()||s.axisFormat||"%Y-%m-%d"));const o=/^([1-9]\d*)(millisecond|second|minute|hour|day|week|month)$/;const c=o.exec(i.db.getTickInterval()||s.tickInterval);if(c!==null){const t=c[1];const e=c[2];const n=i.db.getWeekday()||s.weekday;switch(e){case"millisecond":a.ticks(k.t6C.every(t));break;case"second":a.ticks(k.ucG.every(t));break;case"minute":a.ticks(k.wXd.every(t));break;case"hour":a.ticks(k.Agd.every(t));break;case"day":a.ticks(k.UAC.every(t));break;case"week":a.ticks(It[n].every(t));break;case"month":a.ticks(k.Ui6.every(t));break}}p.append("g").attr("class","grid").attr("transform","translate("+t+", "+(r-50)+")").call(a).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10).attr("dy","1em");if(i.db.topAxisEnabled()||s.topAxis){let n=(0,k.tlR)(g).tickSize(-r+e+s.gridLineStartPadding).tickFormat((0,k.DCK)(i.db.getAxisFormat()||s.axisFormat||"%Y-%m-%d"));if(c!==null){const t=c[1];const e=c[2];const r=i.db.getWeekday()||s.weekday;switch(e){case"millisecond":n.ticks(k.t6C.every(t));break;case"second":n.ticks(k.ucG.every(t));break;case"minute":n.ticks(k.wXd.every(t));break;case"hour":n.ticks(k.Agd.every(t));break;case"day":n.ticks(k.UAC.every(t));break;case"week":n.ticks(It[r].every(t));break;case"month":n.ticks(k.Ui6.every(t));break}}p.append("g").attr("class","grid").attr("transform","translate("+t+", "+e+")").call(n).selectAll("text").style("text-anchor","middle").attr("fill","#000").attr("stroke","none").attr("font-size",10)}}(0,r.K2)(w,"makeGrid");function _(t,e){let n=0;const i=Object.keys(y).map((t=>[t,y[t]]));p.append("g").selectAll("text").data(i).enter().append((function(t){const e=t[0].split(r.Y2.lineBreakRegex);const n=-(e.length-1)/2;const i=u.createElementNS("http://www.w3.org/2000/svg","text");i.setAttribute("dy",n+"em");for(const[r,s]of e.entries()){const t=u.createElementNS("http://www.w3.org/2000/svg","tspan");t.setAttribute("alignment-baseline","central");t.setAttribute("x","10");if(r>0){t.setAttribute("dy","1em")}t.textContent=s;i.appendChild(t)}return i})).attr("x",10).attr("y",(function(r,s){if(s>0){for(let a=0;a`\n .mermaid-main-font {\n font-family: ${t.fontFamily};\n }\n\n .exclude-range {\n fill: ${t.excludeBkgColor};\n }\n\n .section {\n stroke: none;\n opacity: 0.2;\n }\n\n .section0 {\n fill: ${t.sectionBkgColor};\n }\n\n .section2 {\n fill: ${t.sectionBkgColor2};\n }\n\n .section1,\n .section3 {\n fill: ${t.altSectionBkgColor};\n opacity: 0.2;\n }\n\n .sectionTitle0 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle1 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle2 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle3 {\n fill: ${t.titleColor};\n }\n\n .sectionTitle {\n text-anchor: start;\n font-family: ${t.fontFamily};\n }\n\n\n /* Grid and axis */\n\n .grid .tick {\n stroke: ${t.gridColor};\n opacity: 0.8;\n shape-rendering: crispEdges;\n }\n\n .grid .tick text {\n font-family: ${t.fontFamily};\n fill: ${t.textColor};\n }\n\n .grid path {\n stroke-width: 0;\n }\n\n\n /* Today line */\n\n .today {\n fill: none;\n stroke: ${t.todayLineColor};\n stroke-width: 2px;\n }\n\n\n /* Task styling */\n\n /* Default task */\n\n .task {\n stroke-width: 2;\n }\n\n .taskText {\n text-anchor: middle;\n font-family: ${t.fontFamily};\n }\n\n .taskTextOutsideRight {\n fill: ${t.taskTextDarkColor};\n text-anchor: start;\n font-family: ${t.fontFamily};\n }\n\n .taskTextOutsideLeft {\n fill: ${t.taskTextDarkColor};\n text-anchor: end;\n }\n\n\n /* Special case clickable */\n\n .task.clickable {\n cursor: pointer;\n }\n\n .taskText.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideLeft.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n .taskTextOutsideRight.clickable {\n cursor: pointer;\n fill: ${t.taskTextClickableColor} !important;\n font-weight: bold;\n }\n\n\n /* Specific task settings for the sections*/\n\n .taskText0,\n .taskText1,\n .taskText2,\n .taskText3 {\n fill: ${t.taskTextColor};\n }\n\n .task0,\n .task1,\n .task2,\n .task3 {\n fill: ${t.taskBkgColor};\n stroke: ${t.taskBorderColor};\n }\n\n .taskTextOutside0,\n .taskTextOutside2\n {\n fill: ${t.taskTextOutsideColor};\n }\n\n .taskTextOutside1,\n .taskTextOutside3 {\n fill: ${t.taskTextOutsideColor};\n }\n\n\n /* Active task */\n\n .active0,\n .active1,\n .active2,\n .active3 {\n fill: ${t.activeTaskBkgColor};\n stroke: ${t.activeTaskBorderColor};\n }\n\n .activeText0,\n .activeText1,\n .activeText2,\n .activeText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Completed task */\n\n .done0,\n .done1,\n .done2,\n .done3 {\n stroke: ${t.doneTaskBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneText0,\n .doneText1,\n .doneText2,\n .doneText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n\n /* Tasks on the critical line */\n\n .crit0,\n .crit1,\n .crit2,\n .crit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.critBkgColor};\n stroke-width: 2;\n }\n\n .activeCrit0,\n .activeCrit1,\n .activeCrit2,\n .activeCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.activeTaskBkgColor};\n stroke-width: 2;\n }\n\n .doneCrit0,\n .doneCrit1,\n .doneCrit2,\n .doneCrit3 {\n stroke: ${t.critBorderColor};\n fill: ${t.doneTaskBkgColor};\n stroke-width: 2;\n cursor: pointer;\n shape-rendering: crispEdges;\n }\n\n .milestone {\n transform: rotate(45deg) scale(0.8,0.8);\n }\n\n .milestoneText {\n font-style: italic;\n }\n .doneCritText0,\n .doneCritText1,\n .doneCritText2,\n .doneCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .activeCritText0,\n .activeCritText1,\n .activeCritText2,\n .activeCritText3 {\n fill: ${t.taskTextDarkColor} !important;\n }\n\n .titleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.titleColor||t.textColor};\n font-family: ${t.fontFamily};\n }\n`),"getStyles");var zt=Bt;var Nt={parser:m,db:At,renderer:Pt,styles:zt}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/961.29c067b15a524e556eed.js b/.venv/share/jupyter/lab/static/961.29c067b15a524e556eed.js new file mode 100644 index 0000000000000000000000000000000000000000..e439443e48faf8267c50f165274bdde3555d668d --- /dev/null +++ b/.venv/share/jupyter/lab/static/961.29c067b15a524e556eed.js @@ -0,0 +1,2 @@ +/*! For license information please see 961.29c067b15a524e556eed.js.LICENSE.txt */ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[961],{22551:(e,n,t)=>{var r=t(44914),l=t(69982);function a(e){for(var n="https://reactjs.org/docs/error-decoder.html?invariant="+e,t=1;tn}return!1}function y(e,n,t,r,l,a,u){this.acceptsBooleans=2===n||3===n||4===n;this.attributeName=r;this.attributeNamespace=l;this.mustUseProperty=t;this.propertyName=e;this.type=n;this.sanitizeURL=a;this.removeEmptyString=u}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){b[e]=new y(e,0,!1,e,null,!1,!1)}));[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var n=e[0];b[n]=new y(n,1,!1,e[1],null,!1,!1)}));["contentEditable","draggable","spellCheck","value"].forEach((function(e){b[e]=new y(e,2,!1,e.toLowerCase(),null,!1,!1)}));["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){b[e]=new y(e,2,!1,e,null,!1,!1)}));"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){b[e]=new y(e,3,!1,e.toLowerCase(),null,!1,!1)}));["checked","multiple","muted","selected"].forEach((function(e){b[e]=new y(e,3,!0,e,null,!1,!1)}));["capture","download"].forEach((function(e){b[e]=new y(e,4,!1,e,null,!1,!1)}));["cols","rows","size","span"].forEach((function(e){b[e]=new y(e,6,!1,e,null,!1,!1)}));["rowSpan","start"].forEach((function(e){b[e]=new y(e,5,!1,e.toLowerCase(),null,!1,!1)}));var k=/[\-:]([a-z])/g;function w(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var n=e.replace(k,w);b[n]=new y(n,1,!1,e,null,!1,!1)}));"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var n=e.replace(k,w);b[n]=new y(n,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}));["xml:base","xml:lang","xml:space"].forEach((function(e){var n=e.replace(k,w);b[n]=new y(n,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}));["tabIndex","crossOrigin"].forEach((function(e){b[e]=new y(e,1,!1,e.toLowerCase(),null,!1,!1)}));b.xlinkHref=new y("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach((function(e){b[e]=new y(e,1,!1,e.toLowerCase(),null,!0,!0)}));function S(e,n,t,r){var l=b.hasOwnProperty(n)?b[n]:null;if(null!==l?0!==l.type:r||!(2i||l[u]!==a[i]){var o="\n"+l[u].replace(" at new "," at ");e.displayName&&o.includes("")&&(o=o.replace("",e.displayName));return o}}while(1<=u&&0<=i)}break}}}finally{H=!1,Error.prepareStackTrace=t}return(e=e?e.displayName||e.name:"")?B(e):""}function Q(e){switch(e.tag){case 5:return B(e.type);case 16:return B("Lazy");case 13:return B("Suspense");case 19:return B("SuspenseList");case 0:case 2:case 15:return e=W(e.type,!1),e;case 11:return e=W(e.type.render,!1),e;case 1:return e=W(e.type,!0),e;default:return""}}function j(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case _:return"Fragment";case C:return"Portal";case z:return"Profiler";case N:return"StrictMode";case M:return"Suspense";case F:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case T:return(e.displayName||"Context")+".Consumer";case P:return(e._context.displayName||"Context")+".Provider";case L:var n=e.render;e=e.displayName;e||(e=n.displayName||n.name||"",e=""!==e?"ForwardRef("+e+")":"ForwardRef");return e;case D:return n=e.displayName||null,null!==n?n:j(e.type)||"Memo";case R:n=e._payload;e=e._init;try{return j(e(n))}catch(t){}}return null}function $(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=n.render,e=e.displayName||e.name||"",n.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return j(n);case 8:return n===N?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof n)return n.displayName||n.name||null;if("string"===typeof n)return n}return null}function K(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function q(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function Y(e){var n=q(e)?"checked":"value",t=Object.getOwnPropertyDescriptor(e.constructor.prototype,n),r=""+e[n];if(!e.hasOwnProperty(n)&&"undefined"!==typeof t&&"function"===typeof t.get&&"function"===typeof t.set){var l=t.get,a=t.set;Object.defineProperty(e,n,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e;a.call(this,e)}});Object.defineProperty(e,n,{enumerable:t.enumerable});return{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null;delete e[n]}}}}function X(e){e._valueTracker||(e._valueTracker=Y(e))}function G(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var t=n.getValue();var r="";e&&(r=q(e)?e.checked?"true":"false":e.value);e=r;return e!==t?(n.setValue(e),!0):!1}function Z(e){e=e||("undefined"!==typeof document?document:void 0);if("undefined"===typeof e)return null;try{return e.activeElement||e.body}catch(n){return e.body}}function J(e,n){var t=n.checked;return V({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function ee(e,n){var t=null==n.defaultValue?"":n.defaultValue,r=null!=n.checked?n.checked:n.defaultChecked;t=K(null!=n.value?n.value:t);e._wrapperState={initialChecked:r,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function ne(e,n){n=n.checked;null!=n&&S(e,"checked",n,!1)}function te(e,n){ne(e,n);var t=K(n.value),r=n.type;if(null!=t)if("number"===r){if(0===t&&""===e.value||e.value!=t)e.value=""+t}else e.value!==""+t&&(e.value=""+t);else if("submit"===r||"reset"===r){e.removeAttribute("value");return}n.hasOwnProperty("value")?le(e,n.type,t):n.hasOwnProperty("defaultValue")&&le(e,n.type,K(n.defaultValue));null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function re(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(!("submit"!==r&&"reset"!==r||void 0!==n.value&&null!==n.value))return;n=""+e._wrapperState.initialValue;t||n===e.value||(e.value=n);e.defaultValue=n}t=e.name;""!==t&&(e.name="");e.defaultChecked=!!e._wrapperState.initialChecked;""!==t&&(e.name=t)}function le(e,n,t){if("number"!==n||Z(e.ownerDocument)!==e)null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t)}var ae=Array.isArray;function ue(e,n,t,r){e=e.options;if(n){n={};for(var l=0;l"+n.valueOf().toString()+"";for(n=pe.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;n.firstChild;)e.appendChild(n.firstChild)}}));function he(e,n){if(n){var t=e.firstChild;if(t&&t===e.lastChild&&3===t.nodeType){t.nodeValue=n;return}}e.textContent=n}var ge={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ve=["Webkit","ms","Moz","O"];Object.keys(ge).forEach((function(e){ve.forEach((function(n){n=n+e.charAt(0).toUpperCase()+e.substring(1);ge[n]=ge[e]}))}));function ye(e,n,t){return null==n||"boolean"===typeof n||""===n?"":t||"number"!==typeof n||0===n||ge.hasOwnProperty(e)&&ge[e]?(""+n).trim():n+"px"}function be(e,n){e=e.style;for(var t in n)if(n.hasOwnProperty(t)){var r=0===t.indexOf("--"),l=ye(t,n[t],r);"float"===t&&(t="cssFloat");r?e.setProperty(t,l):e[t]=l}}var ke=V({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function we(e,n){if(n){if(ke[e]&&(null!=n.children||null!=n.dangerouslySetInnerHTML))throw Error(a(137,e));if(null!=n.dangerouslySetInnerHTML){if(null!=n.children)throw Error(a(60));if("object"!==typeof n.dangerouslySetInnerHTML||!("__html"in n.dangerouslySetInnerHTML))throw Error(a(61))}if(null!=n.style&&"object"!==typeof n.style)throw Error(a(62))}}function Se(e,n){if(-1===e.indexOf("-"))return"string"===typeof n.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var xe=null;function Ee(e){e=e.target||e.srcElement||window;e.correspondingUseElement&&(e=e.correspondingUseElement);return 3===e.nodeType?e.parentNode:e}var Ce=null,_e=null,Ne=null;function ze(e){if(e=Bl(e)){if("function"!==typeof Ce)throw Error(a(280));var n=e.stateNode;n&&(n=Wl(n),Ce(e.stateNode,e.type,n))}}function Pe(e){_e?Ne?Ne.push(e):Ne=[e]:_e=e}function Te(){if(_e){var e=_e,n=Ne;Ne=_e=null;ze(e);if(n)for(e=0;e>>=0;return 0===e?32:31-(mn(e)/hn|0)|0}var vn=64,yn=4194304;function bn(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kn(e,n){var t=e.pendingLanes;if(0===t)return 0;var r=0,l=e.suspendedLanes,a=e.pingedLanes,u=t&268435455;if(0!==u){var i=u&~l;0!==i?r=bn(i):(a&=u,0!==a&&(r=bn(a)))}else u=t&~l,0!==u?r=bn(u):0!==a&&(r=bn(a));if(0===r)return 0;if(0!==n&&n!==r&&0===(n&l)&&(l=r&-r,a=n&-n,l>=a||16===l&&0!==(a&4194240)))return n;0!==(r&4)&&(r|=t&16);n=e.entangledLanes;if(0!==n)for(e=e.entanglements,n&=r;0t;t++)n.push(e);return n}function _n(e,n,t){e.pendingLanes|=n;536870912!==n&&(e.suspendedLanes=0,e.pingedLanes=0);e=e.eventTimes;n=31-pn(n);e[n]=t}function Nn(e,n){var t=e.pendingLanes&~n;e.pendingLanes=n;e.suspendedLanes=0;e.pingedLanes=0;e.expiredLanes&=n;e.mutableReadLanes&=n;e.entangledLanes&=n;n=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Zt),nr=String.fromCharCode(32),tr=!1;function rr(e,n){switch(e){case"keyup":return-1!==Xt.indexOf(n.keyCode);case"keydown":return 229!==n.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lr(e){e=e.detail;return"object"===typeof e&&"data"in e?e.data:null}var ar=!1;function ur(e,n){switch(e){case"compositionend":return lr(n);case"keypress":if(32!==n.which)return null;tr=!0;return nr;case"textInput":return e=n.data,e===nr&&tr?null:e;default:return null}}function ir(e,n){if(ar)return"compositionend"===e||!Gt&&rr(e,n)?(e=ft(),ct=st=ot=null,ar=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1=n)return{node:t,offset:n-e};e=r}e:{for(;t;){if(t.nextSibling){t=t.nextSibling;break e}t=t.parentNode}t=void 0}t=Pr(t)}}function Lr(e,n){return e&&n?e===n?!0:e&&3===e.nodeType?!1:n&&3===n.nodeType?Lr(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Mr(){for(var e=window,n=Z();n instanceof e.HTMLIFrameElement;){try{var t="string"===typeof n.contentWindow.location.href}catch(r){t=!1}if(t)e=n.contentWindow;else break;n=Z(e.document)}return n}function Fr(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&("input"===n&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===n||"true"===e.contentEditable)}function Dr(e){var n=Mr(),t=e.focusedElem,r=e.selectionRange;if(n!==t&&t&&t.ownerDocument&&Lr(t.ownerDocument.documentElement,t)){if(null!==r&&Fr(t))if(n=r.start,e=r.end,void 0===e&&(e=n),"selectionStart"in t)t.selectionStart=n,t.selectionEnd=Math.min(e,t.value.length);else if(e=(n=t.ownerDocument||document)&&n.defaultView||window,e.getSelection){e=e.getSelection();var l=t.textContent.length,a=Math.min(r.start,l);r=void 0===r.end?a:Math.min(r.end,l);!e.extend&&a>r&&(l=r,r=a,a=l);l=Tr(t,a);var u=Tr(t,r);l&&u&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==u.node||e.focusOffset!==u.offset)&&(n=n.createRange(),n.setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(n),e.extend(u.node,u.offset)):(n.setEnd(u.node,u.offset),e.addRange(n)))}n=[];for(e=t;e=e.parentNode;)1===e.nodeType&&n.push({element:e,left:e.scrollLeft,top:e.scrollTop});"function"===typeof t.focus&&t.focus();for(t=0;t=document.documentMode,Or=null,Ir=null,Ur=null,Vr=!1;function Ar(e,n,t){var r=t.window===t?t.document:9===t.nodeType?t:t.ownerDocument;Vr||null==Or||Or!==Z(r)||(r=Or,"selectionStart"in r&&Fr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ur&&zr(Ur,r)||(Ur=r,r=ml(Ir,"onSelect"),0jl||(e.current=Ql[jl],Ql[jl]=null,jl--)}function ql(e,n){jl++;Ql[jl]=e.current;e.current=n}var Yl={},Xl=$l(Yl),Gl=$l(!1),Zl=Yl;function Jl(e,n){var t=e.type.contextTypes;if(!t)return Yl;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===n)return r.__reactInternalMemoizedMaskedChildContext;var l={},a;for(a in t)l[a]=n[a];r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=n,e.__reactInternalMemoizedMaskedChildContext=l);return l}function ea(e){e=e.childContextTypes;return null!==e&&void 0!==e}function na(){Kl(Gl);Kl(Xl)}function ta(e,n,t){if(Xl.current!==Yl)throw Error(a(168));ql(Xl,n);ql(Gl,t)}function ra(e,n,t){var r=e.stateNode;n=n.childContextTypes;if("function"!==typeof r.getChildContext)return t;r=r.getChildContext();for(var l in r)if(!(l in n))throw Error(a(108,$(e)||"Unknown",l));return V({},t,r)}function la(e){e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Yl;Zl=Xl.current;ql(Xl,e);ql(Gl,Gl.current);return!0}function aa(e,n,t){var r=e.stateNode;if(!r)throw Error(a(169));t?(e=ra(e,n,Zl),r.__reactInternalMemoizedMergedChildContext=e,Kl(Gl),Kl(Xl),ql(Xl,e)):Kl(Gl);ql(Gl,t)}var ua=null,ia=!1,oa=!1;function sa(e){null===ua?ua=[e]:ua.push(e)}function ca(e){ia=!0;sa(e)}function fa(){if(!oa&&null!==ua){oa=!0;var e=0,n=Pn;try{var t=ua;for(Pn=1;e>=u;l-=u;ba=1<<32-pn(n)+l|t<h?(g=f,f=null):g=f.sibling;var v=p(l,f,i[h],o);if(null===v){null===f&&(f=g);break}e&&f&&null===v.alternate&&n(l,f);a=u(v,a,h);null===c?s=v:c.sibling=v;c=v;f=g}if(h===i.length)return t(l,f),Na&&wa(l,h),s;if(null===f){for(;hg?(v=h,h=null):v=h.sibling;var b=p(l,h,y.value,s);if(null===b){null===h&&(h=v);break}e&&h&&null===b.alternate&&n(l,h);i=u(b,i,g);null===f?c=b:f.sibling=b;f=b;h=v}if(y.done)return t(l,h),Na&&wa(l,g),c;if(null===h){for(;!y.done;g++,y=o.next())y=d(l,y.value,s),null!==y&&(i=u(y,i,g),null===f?c=y:f.sibling=y,f=y);Na&&wa(l,g);return c}for(h=r(l,h);!y.done;g++,y=o.next())y=m(h,l,g,y.value,s),null!==y&&(e&&null!==y.alternate&&h.delete(null===y.key?g:y.key),i=u(y,i,g),null===f?c=y:f.sibling=y,f=y);e&&h.forEach((function(e){return n(l,e)}));Na&&wa(l,g);return c}function v(e,r,a,u){"object"===typeof a&&null!==a&&a.type===_&&null===a.key&&(a=a.props.children);if("object"===typeof a&&null!==a){switch(a.$$typeof){case E:e:{for(var o=a.key,s=r;null!==s;){if(s.key===o){o=a.type;if(o===_){if(7===s.tag){t(e,s.sibling);r=l(s,a.props.children);r.return=e;e=r;break e}}else if(s.elementType===o||"object"===typeof o&&null!==o&&o.$$typeof===R&&vu(o)===s.type){t(e,s.sibling);r=l(s,a.props);r.ref=hu(e,s,a);r.return=e;e=r;break e}t(e,s);break}else n(e,s);s=s.sibling}a.type===_?(r=fc(a.props.children,e.mode,u,a.key),r.return=e,e=r):(u=cc(a.type,a.key,a.props,null,e.mode,u),u.ref=hu(e,r,a),u.return=e,e=u)}return i(e);case C:e:{for(s=a.key;null!==r;){if(r.key===s)if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){t(e,r.sibling);r=l(r,a.children||[]);r.return=e;e=r;break e}else{t(e,r);break}else n(e,r);r=r.sibling}r=mc(a,e.mode,u);r.return=e;e=r}return i(e);case R:return s=a._init,v(e,r,s(a._payload),u)}if(ae(a))return h(e,r,a,u);if(U(a))return g(e,r,a,u);gu(e,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==r&&6===r.tag?(t(e,r.sibling),r=l(r,a),r.return=e,e=r):(t(e,r),r=pc(a,e.mode,u),r.return=e,e=r),i(e)):t(e,r)}return v}var bu=yu(!0),ku=yu(!1),wu={},Su=$l(wu),xu=$l(wu),Eu=$l(wu);function Cu(e){if(e===wu)throw Error(a(174));return e}function _u(e,n){ql(Eu,n);ql(xu,e);ql(Su,wu);e=n.nodeType;switch(e){case 9:case 11:n=(n=n.documentElement)?n.namespaceURI:de(null,"");break;default:e=8===e?n.parentNode:n,n=e.namespaceURI||null,e=e.tagName,n=de(n,e)}Kl(Su);ql(Su,n)}function Nu(){Kl(Su);Kl(xu);Kl(Eu)}function zu(e){Cu(Eu.current);var n=Cu(Su.current);var t=de(n,e.type);n!==t&&(ql(xu,e),ql(Su,t))}function Pu(e){xu.current===e&&(Kl(Su),Kl(xu))}var Tu=$l(0);function Lu(e){for(var n=e;null!==n;){if(13===n.tag){var t=n.memoizedState;if(null!==t&&(t=t.dehydrated,null===t||"$?"===t.data||"$!"===t.data))return n}else if(19===n.tag&&void 0!==n.memoizedProps.revealOrder){if(0!==(n.flags&128))return n}else if(null!==n.child){n.child.return=n;n=n.child;continue}if(n===e)break;for(;null===n.sibling;){if(null===n.return||n.return===e)return null;n=n.return}n.sibling.return=n.return;n=n.sibling}return null}var Mu=[];function Fu(){for(var e=0;et?t:4;e(!0);var r=Ru.transition;Ru.transition={};try{e(!1),n()}finally{Pn=t,Ru.transition=r}}function Si(){return Yu().memoizedState}function xi(e,n,t){var r=Ns(e);t={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(Ci(e))_i(n,t);else if(t=Ga(e,n,t,r),null!==t){var l=_s();zs(t,e,r,l);Ni(t,n,r)}}function Ei(e,n,t){var r=Ns(e),l={lane:r,action:t,hasEagerState:!1,eagerState:null,next:null};if(Ci(e))_i(n,l);else{var a=e.alternate;if(0===e.lanes&&(null===a||0===a.lanes)&&(a=n.lastRenderedReducer,null!==a))try{var u=n.lastRenderedState,i=a(u,t);l.hasEagerState=!0;l.eagerState=i;if(Nr(i,u)){var o=n.interleaved;null===o?(l.next=l,Xa(n)):(l.next=o.next,o.next=l);n.interleaved=l;return}}catch(s){}finally{}t=Ga(e,n,l,r);null!==t&&(l=_s(),zs(t,e,r,l),Ni(t,n,r))}}function Ci(e){var n=e.alternate;return e===Iu||null!==n&&n===Iu}function _i(e,n){Bu=Au=!0;var t=e.pending;null===t?n.next=n:(n.next=t.next,t.next=n);e.pending=n}function Ni(e,n,t){if(0!==(t&4194240)){var r=n.lanes;r&=e.pendingLanes;t|=r;n.lanes=t;zn(e,t)}}var zi={readContext:qa,useCallback:Qu,useContext:Qu,useEffect:Qu,useImperativeHandle:Qu,useInsertionEffect:Qu,useLayoutEffect:Qu,useMemo:Qu,useReducer:Qu,useRef:Qu,useState:Qu,useDebugValue:Qu,useDeferredValue:Qu,useTransition:Qu,useMutableSource:Qu,useSyncExternalStore:Qu,useId:Qu,unstable_isNewReconciler:!1},Pi={readContext:qa,useCallback:function(e,n){qu().memoizedState=[e,void 0===n?null:n];return e},useContext:qa,useEffect:fi,useImperativeHandle:function(e,n,t){t=null!==t&&void 0!==t?t.concat([e]):null;return si(4194308,4,hi.bind(null,n,e),t)},useLayoutEffect:function(e,n){return si(4194308,4,e,n)},useInsertionEffect:function(e,n){return si(4,2,e,n)},useMemo:function(e,n){var t=qu();n=void 0===n?null:n;e=e();t.memoizedState=[e,n];return e},useReducer:function(e,n,t){var r=qu();n=void 0!==t?t(n):n;r.memoizedState=r.baseState=n;e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:n};r.queue=e;e=e.dispatch=xi.bind(null,Iu,e);return[r.memoizedState,e]},useRef:function(e){var n=qu();e={current:e};return n.memoizedState=e},useState:ui,useDebugValue:vi,useDeferredValue:function(e){return qu().memoizedState=e},useTransition:function(){var e=ui(!1),n=e[0];e=wi.bind(null,e[1]);qu().memoizedState=e;return[n,e]},useMutableSource:function(){},useSyncExternalStore:function(e,n,t){var r=Iu,l=qu();if(Na){if(void 0===t)throw Error(a(407));t=t()}else{t=n();if(null===ns)throw Error(a(349));0!==(Ou&30)||ni(r,n,t)}l.memoizedState=t;var u={value:t,getSnapshot:n};l.queue=u;fi(ri.bind(null,r,u,e),[e]);r.flags|=2048;ii(9,ti.bind(null,r,u,t,n),void 0,null);return t},useId:function(){var e=qu(),n=ns.identifierPrefix;if(Na){var t=ka;var r=ba;t=(r&~(1<<32-pn(r)-1)).toString(32)+t;n=":"+n+"R"+t;t=Hu++;0<\/script>",e=e.removeChild(e.firstChild)):"string"===typeof r.is?e=o.createElement(t,{is:r.is}):(e=o.createElement(t),"select"===t&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,t);e[Dl]=n;e[Rl]=r;po(e,n,!1,!1);n.stateNode=e;e:{o=Se(t,r);switch(t){case"dialog":il("cancel",e);il("close",e);l=r;break;case"iframe":case"object":case"embed":il("load",e);l=r;break;case"video":case"audio":for(l=0;lms&&(n.flags|=128,r=!0,vo(u,!1),n.lanes=4194304)}else{if(!r)if(e=Lu(o),null!==e){if(n.flags|=128,r=!0,t=e.updateQueue,null!==t&&(n.updateQueue=t,n.flags|=4),vo(u,!0),null===u.tail&&"hidden"===u.tailMode&&!o.alternate&&!Na)return yo(n),null}else 2*tn()-u.renderingStartTime>ms&&1073741824!==t&&(n.flags|=128,r=!0,vo(u,!1),n.lanes=4194304);u.isBackwards?(o.sibling=n.child,n.child=o):(t=u.last,null!==t?t.sibling=o:n.child=o,u.last=o)}if(null!==u.tail)return n=u.tail,u.rendering=n,u.tail=n.sibling,u.renderingStartTime=tn(),n.sibling=null,t=Tu.current,ql(Tu,r?t&1|2:t&1),n;yo(n);return null;case 22:case 23:return Us(),r=null!==n.memoizedState,null!==e&&null!==e.memoizedState!==r&&(n.flags|=8192),r&&0!==(n.mode&1)?0!==(ls&1073741824)&&(yo(n),n.subtreeFlags&6&&(n.flags|=8192)):yo(n),null;case 24:return null;case 25:return null}throw Error(a(156,n.tag))}function ko(e,n){Ea(n);switch(n.tag){case 1:return ea(n.type)&&na(),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Nu(),Kl(Gl),Kl(Xl),Fu(),e=n.flags,0!==(e&65536)&&0===(e&128)?(n.flags=e&-65537|128,n):null;case 5:return Pu(n),null;case 13:Kl(Tu);e=n.memoizedState;if(null!==e&&null!==e.dehydrated){if(null===n.alternate)throw Error(a(340));Oa()}e=n.flags;return e&65536?(n.flags=e&-65537|128,n):null;case 19:return Kl(Tu),null;case 4:return Nu(),null;case 10:return ja(n.type._context),null;case 22:case 23:return Us(),null;case 24:return null;default:return null}}var wo=!1,So=!1,xo="function"===typeof WeakSet?WeakSet:Set,Eo=null;function Co(e,n){var t=e.ref;if(null!==t)if("function"===typeof t)try{t(null)}catch(r){Zs(e,n,r)}else t.current=null}function _o(e,n,t){try{t()}catch(r){Zs(e,n,r)}}var No=!1;function zo(e,n){Sl=nt;e=Mr();if(Fr(e)){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:{t=(t=e.ownerDocument)&&t.defaultView||window;var r=t.getSelection&&t.getSelection();if(r&&0!==r.rangeCount){t=r.anchorNode;var l=r.anchorOffset,u=r.focusNode;r=r.focusOffset;try{t.nodeType,u.nodeType}catch(w){t=null;break e}var i=0,o=-1,s=-1,c=0,f=0,d=e,p=null;n:for(;;){for(var m;;){d!==t||0!==l&&3!==d.nodeType||(o=i+l);d!==u||0!==r&&3!==d.nodeType||(s=i+r);3===d.nodeType&&(i+=d.nodeValue.length);if(null===(m=d.firstChild))break;p=d;d=m}for(;;){if(d===e)break n;p===t&&++c===l&&(o=i);p===u&&++f===r&&(s=i);if(null!==(m=d.nextSibling))break;d=p;p=d.parentNode}d=m}t=-1===o||-1===s?null:{start:o,end:s}}else t=null}t=t||{start:0,end:0}}else t=null;xl={focusedElem:e,selectionRange:t};nt=!1;for(Eo=n;null!==Eo;)if(n=Eo,e=n.child,0!==(n.subtreeFlags&1028)&&null!==e)e.return=n,Eo=e;else for(;null!==Eo;){n=Eo;try{var h=n.alternate;if(0!==(n.flags&1024))switch(n.tag){case 0:case 11:case 15:break;case 1:if(null!==h){var g=h.memoizedProps,v=h.memoizedState,y=n.stateNode,b=y.getSnapshotBeforeUpdate(n.elementType===n.type?g:Va(n.type,g),v);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var k=n.stateNode.containerInfo;1===k.nodeType?k.textContent="":9===k.nodeType&&k.documentElement&&k.removeChild(k.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(a(163))}}catch(w){Zs(n,n.return,w)}e=n.sibling;if(null!==e){e.return=n.return;Eo=e;break}Eo=n.return}h=No;No=!1;return h}function Po(e,n,t){var r=n.updateQueue;r=null!==r?r.lastEffect:null;if(null!==r){var l=r=r.next;do{if((l.tag&e)===e){var a=l.destroy;l.destroy=void 0;void 0!==a&&_o(n,t,a)}l=l.next}while(l!==r)}}function To(e,n){n=n.updateQueue;n=null!==n?n.lastEffect:null;if(null!==n){var t=n=n.next;do{if((t.tag&e)===e){var r=t.create;t.destroy=r()}t=t.next}while(t!==n)}}function Lo(e){var n=e.ref;if(null!==n){var t=e.stateNode;switch(e.tag){case 5:e=t;break;default:e=t}"function"===typeof n?n(e):n.current=e}}function Mo(e){var n=e.alternate;null!==n&&(e.alternate=null,Mo(n));e.child=null;e.deletions=null;e.sibling=null;5===e.tag&&(n=e.stateNode,null!==n&&(delete n[Dl],delete n[Rl],delete n[Il],delete n[Ul],delete n[Vl]));e.stateNode=null;e.return=null;e.dependencies=null;e.memoizedProps=null;e.memoizedState=null;e.pendingProps=null;e.stateNode=null;e.updateQueue=null}function Fo(e){return 5===e.tag||3===e.tag||4===e.tag}function Do(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Fo(e.return))return null;e=e.return}e.sibling.return=e.return;for(e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(e.flags&2)continue e;if(null===e.child||4===e.tag)continue e;else e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ro(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?8===t.nodeType?t.parentNode.insertBefore(e,n):t.insertBefore(e,n):(8===t.nodeType?(n=t.parentNode,n.insertBefore(e,t)):(n=t,n.appendChild(e)),t=t._reactRootContainer,null!==t&&void 0!==t||null!==n.onclick||(n.onclick=wl));else if(4!==r&&(e=e.child,null!==e))for(Ro(e,n,t),e=e.sibling;null!==e;)Ro(e,n,t),e=e.sibling}function Oo(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(4!==r&&(e=e.child,null!==e))for(Oo(e,n,t),e=e.sibling;null!==e;)Oo(e,n,t),e=e.sibling}var Io=null,Uo=!1;function Vo(e,n,t){for(t=t.child;null!==t;)Ao(e,n,t),t=t.sibling}function Ao(e,n,t){if(fn&&"function"===typeof fn.onCommitFiberUnmount)try{fn.onCommitFiberUnmount(cn,t)}catch(i){}switch(t.tag){case 5:So||Co(t,n);case 6:var r=Io,l=Uo;Io=null;Vo(e,n,t);Io=r;Uo=l;null!==Io&&(Uo?(e=Io,t=t.stateNode,8===e.nodeType?e.parentNode.removeChild(t):e.removeChild(t)):Io.removeChild(t.stateNode));break;case 18:null!==Io&&(Uo?(e=Io,t=t.stateNode,8===e.nodeType?Tl(e.parentNode,t):1===e.nodeType&&Tl(e,t),Jn(e)):Tl(Io,t.stateNode));break;case 4:r=Io;l=Uo;Io=t.stateNode.containerInfo;Uo=!0;Vo(e,n,t);Io=r;Uo=l;break;case 0:case 11:case 14:case 15:if(!So&&(r=t.updateQueue,null!==r&&(r=r.lastEffect,null!==r))){l=r=r.next;do{var a=l,u=a.destroy;a=a.tag;void 0!==u&&(0!==(a&2)?_o(t,n,u):0!==(a&4)&&_o(t,n,u));l=l.next}while(l!==r)}Vo(e,n,t);break;case 1:if(!So&&(Co(t,n),r=t.stateNode,"function"===typeof r.componentWillUnmount))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(i){Zs(t,n,i)}Vo(e,n,t);break;case 21:Vo(e,n,t);break;case 22:t.mode&1?(So=(r=So)||null!==t.memoizedState,Vo(e,n,t),So=r):Vo(e,n,t);break;default:Vo(e,n,t)}}function Bo(e){var n=e.updateQueue;if(null!==n){e.updateQueue=null;var t=e.stateNode;null===t&&(t=e.stateNode=new xo);n.forEach((function(n){var r=tc.bind(null,e,n);t.has(n)||(t.add(n),n.then(r,r))}))}}function Ho(e,n){var t=n.deletions;if(null!==t)for(var r=0;rl&&(l=i);r&=~u}r=l;r=tn()-r;r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Xo(r/1960))-r;if(10e?16:e;if(null===ks)var r=!1;else{e=ks;ks=null;ws=0;if(0!==(es&6))throw Error(a(331));var l=es;es|=4;for(Eo=e.current;null!==Eo;){var u=Eo,i=u.child;if(0!==(Eo.flags&16)){var o=u.deletions;if(null!==o){for(var s=0;stn()-ps?Vs(e,0):cs|=t);Ps(e,n)}function ec(e,n){0===n&&(0===(e.mode&1)?n=1:(n=yn,yn<<=1,0===(yn&130023424)&&(yn=4194304)));var t=_s();e=Za(e,n);null!==e&&(_n(e,n,t),Ps(e,t))}function nc(e){var n=e.memoizedState,t=0;null!==n&&(t=n.retryLane);ec(e,t)}function tc(e,n){var t=0;switch(e.tag){case 13:var r=e.stateNode;var l=e.memoizedState;null!==l&&(t=l.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(a(314))}null!==r&&r.delete(n);ec(e,t)}var rc;rc=function(e,n,t){if(null!==e)if(e.memoizedProps!==n.pendingProps||Gl.current)Hi=!0;else{if(0===(e.lanes&t)&&0===(n.flags&128))return Hi=!1,fo(e,n,t);Hi=0!==(e.flags&131072)?!0:!1}else Hi=!1,Na&&0!==(n.flags&1048576)&&Sa(n,ha,n.index);n.lanes=0;switch(n.tag){case 2:var r=n.type;so(e,n);e=n.pendingProps;var l=Jl(n,Xl.current);Ka(n,t);l=$u(null,n,r,e,l,t);var u=Ku();n.flags|=1;"object"===typeof l&&null!==l&&"function"===typeof l.render&&void 0===l.$$typeof?(n.tag=1,n.memoizedState=null,n.updateQueue=null,ea(r)?(u=!0,la(n)):u=!1,n.memoizedState=null!==l.state&&void 0!==l.state?l.state:null,eu(n),l.updater=cu,n.stateNode=l,l._reactInternals=n,mu(n,r,e,t),n=Gi(null,n,r,!0,u,t)):(n.tag=0,Na&&u&&xa(n),Wi(null,n,l,t),n=n.child);return n;case 16:r=n.elementType;e:{so(e,n);e=n.pendingProps;l=r._init;r=l(r._payload);n.type=r;l=n.tag=oc(r);e=Va(r,e);switch(l){case 0:n=Yi(null,n,r,e,t);break e;case 1:n=Xi(null,n,r,e,t);break e;case 11:n=Qi(null,n,r,e,t);break e;case 14:n=ji(null,n,r,Va(r.type,e),t);break e}throw Error(a(306,r,""))}return n;case 0:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Va(r,l),Yi(e,n,r,l,t);case 1:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Va(r,l),Xi(e,n,r,l,t);case 3:e:{Zi(n);if(null===e)throw Error(a(387));r=n.pendingProps;u=n.memoizedState;l=u.element;nu(e,n);uu(n,r,null,t);var i=n.memoizedState;r=i.element;if(u.isDehydrated)if(u={element:r,isDehydrated:!1,cache:i.cache,pendingSuspenseBoundaries:i.pendingSuspenseBoundaries,transitions:i.transitions},n.updateQueue.baseState=u,n.memoizedState=u,n.flags&256){l=Mi(Error(a(423)),n);n=Ji(e,n,r,t,l);break e}else if(r!==l){l=Mi(Error(a(424)),n);n=Ji(e,n,r,t,l);break e}else for(_a=Ll(n.stateNode.containerInfo.firstChild),Ca=n,Na=!0,za=null,t=ku(n,null,r,t),n.child=t;t;)t.flags=t.flags&-3|4096,t=t.sibling;else{Oa();if(r===l){n=co(e,n,t);break e}Wi(e,n,r,t)}n=n.child}return n;case 5:return zu(n),null===e&&Ma(n),r=n.type,l=n.pendingProps,u=null!==e?e.memoizedProps:null,i=l.children,El(r,l)?i=null:null!==u&&El(r,u)&&(n.flags|=32),qi(e,n),Wi(e,n,i,t),n.child;case 6:return null===e&&Ma(n),null;case 13:return to(e,n,t);case 4:return _u(n,n.stateNode.containerInfo),r=n.pendingProps,null===e?n.child=bu(n,null,r,t):Wi(e,n,r,t),n.child;case 11:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Va(r,l),Qi(e,n,r,l,t);case 7:return Wi(e,n,n.pendingProps,t),n.child;case 8:return Wi(e,n,n.pendingProps.children,t),n.child;case 12:return Wi(e,n,n.pendingProps.children,t),n.child;case 10:e:{r=n.type._context;l=n.pendingProps;u=n.memoizedProps;i=l.value;ql(Aa,r._currentValue);r._currentValue=i;if(null!==u)if(Nr(u.value,i)){if(u.children===l.children&&!Gl.current){n=co(e,n,t);break e}}else for(u=n.child,null!==u&&(u.return=n);null!==u;){var o=u.dependencies;if(null!==o){i=u.child;for(var s=o.firstContext;null!==s;){if(s.context===r){if(1===u.tag){s=tu(-1,t&-t);s.tag=2;var c=u.updateQueue;if(null!==c){c=c.shared;var f=c.pending;null===f?s.next=s:(s.next=f.next,f.next=s);c.pending=s}}u.lanes|=t;s=u.alternate;null!==s&&(s.lanes|=t);$a(u.return,t,n);o.lanes|=t;break}s=s.next}}else if(10===u.tag)i=u.type===n.type?null:u.child;else if(18===u.tag){i=u.return;if(null===i)throw Error(a(341));i.lanes|=t;o=i.alternate;null!==o&&(o.lanes|=t);$a(i,t,n);i=u.sibling}else i=u.child;if(null!==i)i.return=u;else for(i=u;null!==i;){if(i===n){i=null;break}u=i.sibling;if(null!==u){u.return=i.return;i=u;break}i=i.return}u=i}Wi(e,n,l.children,t);n=n.child}return n;case 9:return l=n.type,r=n.pendingProps.children,Ka(n,t),l=qa(l),r=r(l),n.flags|=1,Wi(e,n,r,t),n.child;case 14:return r=n.type,l=Va(r,n.pendingProps),l=Va(r.type,l),ji(e,n,r,l,t);case 15:return $i(e,n,n.type,n.pendingProps,t);case 17:return r=n.type,l=n.pendingProps,l=n.elementType===r?l:Va(r,l),so(e,n),n.tag=1,ea(r)?(e=!0,la(n)):e=!1,Ka(n,t),du(n,r,l),mu(n,r,l,t),Gi(null,n,r,!0,e,t);case 19:return oo(e,n,t);case 22:return Ki(e,n,t)}throw Error(a(156,n.tag))};function lc(e,n){return Ze(e,n)}function ac(e,n,t,r){this.tag=e;this.key=t;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=n;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=r;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function uc(e,n,t,r){return new ac(e,n,t,r)}function ic(e){e=e.prototype;return!(!e||!e.isReactComponent)}function oc(e){if("function"===typeof e)return ic(e)?1:0;if(void 0!==e&&null!==e){e=e.$$typeof;if(e===L)return 11;if(e===D)return 14}return 2}function sc(e,n){var t=e.alternate;null===t?(t=uc(e.tag,n,e.key,e.mode),t.elementType=e.elementType,t.type=e.type,t.stateNode=e.stateNode,t.alternate=e,e.alternate=t):(t.pendingProps=n,t.type=e.type,t.flags=0,t.subtreeFlags=0,t.deletions=null);t.flags=e.flags&14680064;t.childLanes=e.childLanes;t.lanes=e.lanes;t.child=e.child;t.memoizedProps=e.memoizedProps;t.memoizedState=e.memoizedState;t.updateQueue=e.updateQueue;n=e.dependencies;t.dependencies=null===n?null:{lanes:n.lanes,firstContext:n.firstContext};t.sibling=e.sibling;t.index=e.index;t.ref=e.ref;return t}function cc(e,n,t,r,l,u){var i=2;r=e;if("function"===typeof e)ic(e)&&(i=1);else if("string"===typeof e)i=5;else e:switch(e){case _:return fc(t.children,l,u,n);case N:i=8;l|=8;break;case z:return e=uc(12,t,n,l|2),e.elementType=z,e.lanes=u,e;case M:return e=uc(13,t,n,l),e.elementType=M,e.lanes=u,e;case F:return e=uc(19,t,n,l),e.elementType=F,e.lanes=u,e;case O:return dc(t,l,u,n);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case P:i=10;break e;case T:i=9;break e;case L:i=11;break e;case D:i=14;break e;case R:i=16;r=null;break e}throw Error(a(130,null==e?e:typeof e,""))}n=uc(i,t,n,l);n.elementType=e;n.type=r;n.lanes=u;return n}function fc(e,n,t,r){e=uc(7,e,r,n);e.lanes=t;return e}function dc(e,n,t,r){e=uc(22,e,r,n);e.elementType=O;e.lanes=t;e.stateNode={isHidden:!1};return e}function pc(e,n,t){e=uc(6,e,null,n);e.lanes=t;return e}function mc(e,n,t){n=uc(4,null!==e.children?e.children:[],e.key,n);n.lanes=t;n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation};return n}function hc(e,n,t,r,l){this.tag=n;this.containerInfo=e;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=Cn(0);this.expirationTimes=Cn(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=Cn(0);this.identifierPrefix=r;this.onRecoverableError=l;this.mutableSourceEagerHydrationData=null}function gc(e,n,t,r,l,a,u,i,o){e=new hc(e,n,t,i,o);1===n?(n=1,!0===a&&(n|=8)):n=0;a=uc(3,null,null,n);e.current=a;a.stateNode=e;a.memoizedState={element:r,isDehydrated:t,cache:null,transitions:null,pendingSuspenseBoundaries:null};eu(a);return e}function vc(e,n,t){var r=3{function r(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__==="undefined"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=="function"){return}if(false){}try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}if(true){r();e.exports=t(22551)}else{}},7463:(e,n)=>{function t(e,n){var t=e.length;e.push(n);e:for(;0>>1,l=e[r];if(0>>1;ra(o,t))sa(c,o)?(e[r]=c,e[s]=t,r=s):(e[r]=o,e[i]=t,r=i);else if(sa(c,t))e[r]=c,e[s]=t,r=s;else break e}}return n}function a(e,n){var t=e.sortIndex-n.sortIndex;return 0!==t?t:e.id-n.id}if("object"===typeof performance&&"function"===typeof performance.now){var u=performance;n.unstable_now=function(){return u.now()}}else{var i=Date,o=i.now();n.unstable_now=function(){return i.now()-o}}var s=[],c=[],f=1,d=null,p=3,m=!1,h=!1,g=!1,v="function"===typeof setTimeout?setTimeout:null,y="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function k(e){for(var n=r(c);null!==n;){if(null===n.callback)l(c);else if(n.startTime<=e)l(c),n.sortIndex=n.expirationTime,t(s,n);else break;n=r(c)}}function w(e){g=!1;k(e);if(!h)if(null!==r(s))h=!0,F(S);else{var n=r(c);null!==n&&D(w,n.startTime-e)}}function S(e,t){h=!1;g&&(g=!1,y(C),C=-1);m=!0;var a=p;try{k(t);for(d=r(s);null!==d&&(!(d.expirationTime>t)||e&&!z());){var u=d.callback;if("function"===typeof u){d.callback=null;p=d.priorityLevel;var i=u(d.expirationTime<=t);t=n.unstable_now();"function"===typeof i?d.callback=i:d===r(s)&&l(s);k(t)}else l(s);d=r(s)}if(null!==d)var o=!0;else{var f=r(c);null!==f&&D(w,f.startTime-t);o=!1}return o}finally{d=null,p=a,m=!1}}var x=!1,E=null,C=-1,_=5,N=-1;function z(){return n.unstable_now()-N<_?!1:!0}function P(){if(null!==E){var e=n.unstable_now();N=e;var t=!0;try{t=E(!0,e)}finally{t?T():(x=!1,E=null)}}else x=!1}var T;if("function"===typeof b)T=function(){b(P)};else if("undefined"!==typeof MessageChannel){var L=new MessageChannel,M=L.port2;L.port1.onmessage=P;T=function(){M.postMessage(null)}}else T=function(){v(P,0)};function F(e){E=e;x||(x=!0,T())}function D(e,t){C=v((function(){e(n.unstable_now())}),t)}n.unstable_IdlePriority=5;n.unstable_ImmediatePriority=1;n.unstable_LowPriority=4;n.unstable_NormalPriority=3;n.unstable_Profiling=null;n.unstable_UserBlockingPriority=2;n.unstable_cancelCallback=function(e){e.callback=null};n.unstable_continueExecution=function(){h||m||(h=!0,F(S))};n.unstable_forceFrameRate=function(e){0>e||125u?(e.sortIndex=a,t(c,e),null===r(s)&&e===r(c)&&(g?(y(C),C=-1):g=!0,D(w,a-u))):(e.sortIndex=i,t(s,e),h||m||(h=!0,F(S)));return e};n.unstable_shouldYield=z;n.unstable_wrapCallback=function(e){var n=p;return function(){var t=p;p=n;try{return e.apply(this,arguments)}finally{p=t}}}},69982:(e,n,t)=>{if(true){e.exports=t(7463)}else{}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/961.29c067b15a524e556eed.js.LICENSE.txt b/.venv/share/jupyter/lab/static/961.29c067b15a524e556eed.js.LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..122393a3f28d235cd077495ec4705a88bccaea41 --- /dev/null +++ b/.venv/share/jupyter/lab/static/961.29c067b15a524e556eed.js.LICENSE.txt @@ -0,0 +1,19 @@ +/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +/** + * @license React + * scheduler.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ diff --git a/.venv/share/jupyter/lab/static/9652.a8d2e5854bcae4d40041.js b/.venv/share/jupyter/lab/static/9652.a8d2e5854bcae4d40041.js new file mode 100644 index 0000000000000000000000000000000000000000..795845d9c7ae9fda89d8980ae750927b0dc53f18 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9652.a8d2e5854bcae4d40041.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9652,5606],{89031:e=>{"use strict";function t(e,t){var r=e;t.slice(0,-1).forEach((function(e){r=r[e]||{}}));var n=t[t.length-1];return n in r}function r(e){if(typeof e==="number"){return true}if(/^0x[0-9a-f]+$/i.test(e)){return true}return/^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(e)}function n(e,t){return t==="constructor"&&typeof e[t]==="function"||t==="__proto__"}e.exports=function(e,o){if(!o){o={}}var i={bools:{},strings:{},unknownFn:null};if(typeof o.unknown==="function"){i.unknownFn=o.unknown}if(typeof o.boolean==="boolean"&&o.boolean){i.allBools=true}else{[].concat(o.boolean).filter(Boolean).forEach((function(e){i.bools[e]=true}))}var s={};function a(e){return s[e].some((function(e){return i.bools[e]}))}Object.keys(o.alias||{}).forEach((function(e){s[e]=[].concat(o.alias[e]);s[e].forEach((function(t){s[t]=[e].concat(s[e].filter((function(e){return t!==e})))}))}));[].concat(o.string).filter(Boolean).forEach((function(e){i.strings[e]=true;if(s[e]){[].concat(s[e]).forEach((function(e){i.strings[e]=true}))}}));var f=o.default||{};var l={_:[]};function u(e,t){return i.allBools&&/^--[^=]+$/.test(t)||i.strings[e]||i.bools[e]||s[e]}function c(e,t,r){var o=e;for(var s=0;s{"use strict";var n=r(65606);function o(e){if(typeof e!=="string"){throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}}function i(e,t){var r="";var n=0;var o=-1;var i=0;var s;for(var a=0;a<=e.length;++a){if(a2){var f=r.lastIndexOf("/");if(f!==r.length-1){if(f===-1){r="";n=0}else{r=r.slice(0,f);n=r.length-1-r.lastIndexOf("/")}o=a;i=0;continue}}else if(r.length===2||r.length===1){r="";n=0;o=a;i=0;continue}}if(t){if(r.length>0)r+="/..";else r="..";n=2}}else{if(r.length>0)r+="/"+e.slice(o+1,a);else r=e.slice(o+1,a);n=a-o-1}o=a;i=0}else if(s===46&&i!==-1){++i}else{i=-1}}return r}function s(e,t){var r=t.dir||t.root;var n=t.base||(t.name||"")+(t.ext||"");if(!r){return n}if(r===t.root){return r+n}return r+e+n}var a={resolve:function e(){var t="";var r=false;var s;for(var a=arguments.length-1;a>=-1&&!r;a--){var f;if(a>=0)f=arguments[a];else{if(s===undefined)s=n.cwd();f=s}o(f);if(f.length===0){continue}t=f+"/"+t;r=f.charCodeAt(0)===47}t=i(t,!r);if(r){if(t.length>0)return"/"+t;else return"/"}else if(t.length>0){return t}else{return"."}},normalize:function e(t){o(t);if(t.length===0)return".";var r=t.charCodeAt(0)===47;var n=t.charCodeAt(t.length-1)===47;t=i(t,!r);if(t.length===0&&!r)t=".";if(t.length>0&&n)t+="/";if(r)return"/"+t;return t},isAbsolute:function e(t){o(t);return t.length>0&&t.charCodeAt(0)===47},join:function e(){if(arguments.length===0)return".";var t;for(var r=0;r0){if(t===undefined)t=n;else t+="/"+n}}if(t===undefined)return".";return a.normalize(t)},relative:function e(t,r){o(t);o(r);if(t===r)return"";t=a.resolve(t);r=a.resolve(r);if(t===r)return"";var n=1;for(;nc){if(r.charCodeAt(f+p)===47){return r.slice(f+p+1)}else if(p===0){return r.slice(f+p)}}else if(s>c){if(t.charCodeAt(n+p)===47){h=p}else if(p===0){h=0}}break}var d=t.charCodeAt(n+p);var v=r.charCodeAt(f+p);if(d!==v)break;else if(d===47)h=p}var g="";for(p=n+h+1;p<=i;++p){if(p===i||t.charCodeAt(p)===47){if(g.length===0)g+="..";else g+="/.."}}if(g.length>0)return g+r.slice(f+h);else{f+=h;if(r.charCodeAt(f)===47)++f;return r.slice(f)}},_makeLong:function e(t){return t},dirname:function e(t){o(t);if(t.length===0)return".";var r=t.charCodeAt(0);var n=r===47;var i=-1;var s=true;for(var a=t.length-1;a>=1;--a){r=t.charCodeAt(a);if(r===47){if(!s){i=a;break}}else{s=false}}if(i===-1)return n?"/":".";if(n&&i===1)return"//";return t.slice(0,i)},basename:function e(t,r){if(r!==undefined&&typeof r!=="string")throw new TypeError('"ext" argument must be a string');o(t);var n=0;var i=-1;var s=true;var a;if(r!==undefined&&r.length>0&&r.length<=t.length){if(r.length===t.length&&r===t)return"";var f=r.length-1;var l=-1;for(a=t.length-1;a>=0;--a){var u=t.charCodeAt(a);if(u===47){if(!s){n=a+1;break}}else{if(l===-1){s=false;l=a+1}if(f>=0){if(u===r.charCodeAt(f)){if(--f===-1){i=a}}else{f=-1;i=l}}}}if(n===i)i=l;else if(i===-1)i=t.length;return t.slice(n,i)}else{for(a=t.length-1;a>=0;--a){if(t.charCodeAt(a)===47){if(!s){n=a+1;break}}else if(i===-1){s=false;i=a+1}}if(i===-1)return"";return t.slice(n,i)}},extname:function e(t){o(t);var r=-1;var n=0;var i=-1;var s=true;var a=0;for(var f=t.length-1;f>=0;--f){var l=t.charCodeAt(f);if(l===47){if(!s){n=f+1;break}continue}if(i===-1){s=false;i=f+1}if(l===46){if(r===-1)r=f;else if(a!==1)a=1}else if(r!==-1){a=-1}}if(r===-1||i===-1||a===0||a===1&&r===i-1&&r===n+1){return""}return t.slice(r,i)},format:function e(t){if(t===null||typeof t!=="object"){throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t)}return s("/",t)},parse:function e(t){o(t);var r={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return r;var n=t.charCodeAt(0);var i=n===47;var s;if(i){r.root="/";s=1}else{s=0}var a=-1;var f=0;var l=-1;var u=true;var c=t.length-1;var h=0;for(;c>=s;--c){n=t.charCodeAt(c);if(n===47){if(!u){f=c+1;break}continue}if(l===-1){u=false;l=c+1}if(n===46){if(a===-1)a=c;else if(h!==1)h=1}else if(a!==-1){h=-1}}if(a===-1||l===-1||h===0||h===1&&a===l-1&&a===f+1){if(l!==-1){if(f===0&&i)r.base=r.name=t.slice(1,l);else r.base=r.name=t.slice(f,l)}}else{if(f===0&&i){r.name=t.slice(1,a);r.base=t.slice(1,l)}else{r.name=t.slice(f,a);r.base=t.slice(f,l)}r.ext=t.slice(a,l)}if(f>0)r.dir=t.slice(0,f-1);else if(i)r.dir="/";return r},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a;e.exports=a},65606:e=>{var t=e.exports={};var r;var n;function o(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}(function(){try{if(typeof setTimeout==="function"){r=setTimeout}else{r=o}}catch(e){r=o}try{if(typeof clearTimeout==="function"){n=clearTimeout}else{n=i}}catch(e){n=i}})();function s(e){if(r===setTimeout){return setTimeout(e,0)}if((r===o||!r)&&setTimeout){r=setTimeout;return setTimeout(e,0)}try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}function a(e){if(n===clearTimeout){return clearTimeout(e)}if((n===i||!n)&&clearTimeout){n=clearTimeout;return clearTimeout(e)}try{return n(e)}catch(t){try{return n.call(null,e)}catch(t){return n.call(this,e)}}}var f=[];var l=false;var u;var c=-1;function h(){if(!l||!u){return}l=false;if(u.length){f=u.concat(f)}else{c=-1}if(f.length){p()}}function p(){if(l){return}var e=s(h);l=true;var t=f.length;while(t){u=f;f=[];while(++c1){for(var r=1;r{"use strict";var r=Object.prototype.hasOwnProperty,n;function o(e){try{return decodeURIComponent(e.replace(/\+/g," "))}catch(t){return null}}function i(e){try{return encodeURIComponent(e)}catch(t){return null}}function s(e){var t=/([^=?#&]+)=?([^&]*)/g,r={},n;while(n=t.exec(e)){var i=o(n[1]),s=o(n[2]);if(i===null||s===null||i in r)continue;r[i]=s}return r}function a(e,t){t=t||"";var o=[],s,a;if("string"!==typeof t)t="?";for(a in e){if(r.call(e,a)){s=e[a];if(!s&&(s===null||s===n||isNaN(s))){s=""}a=i(a);s=i(s);if(a===null||s===null)continue;o.push(a+"="+s)}}return o.length?t+o.join("&"):""}t.stringify=a;t.parse=s},92063:e=>{"use strict";e.exports=function e(t,r){r=r.split(":")[0];t=+t;if(!t)return false;switch(r){case"http":case"ws":return t!==80;case"https":case"wss":return t!==443;case"ftp":return t!==21;case"gopher":return t!==70;case"file":return false}return t!==0}},61160:(e,t,r)=>{"use strict";var n=r(92063),o=r(73992),i=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,s=/[\n\r\t]/g,a=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,f=/:\d+$/,l=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,u=/^[a-zA-Z]:/;function c(e){return(e?e:"").toString().replace(i,"")}var h=[["#","hash"],["?","query"],function e(t,r){return v(r.protocol)?t.replace(/\\/g,"/"):t},["/","pathname"],["@","auth",1],[NaN,"host",undefined,1,1],[/:(\d*)$/,"port",undefined,1],[NaN,"hostname",undefined,1,1]];var p={hash:1,query:1};function d(e){var t;if(typeof window!=="undefined")t=window;else if(typeof r.g!=="undefined")t=r.g;else if(typeof self!=="undefined")t=self;else t={};var n=t.location||{};e=e||n;var o={},i=typeof e,s;if("blob:"===e.protocol){o=new b(unescape(e.pathname),{})}else if("string"===i){o=new b(e,{});for(s in p)delete o[s]}else if("object"===i){for(s in e){if(s in p)continue;o[s]=e[s]}if(o.slashes===undefined){o.slashes=a.test(e.href)}}return o}function v(e){return e==="file:"||e==="ftp:"||e==="http:"||e==="https:"||e==="ws:"||e==="wss:"}function g(e,t){e=c(e);e=e.replace(s,"");t=t||{};var r=l.exec(e);var n=r[1]?r[1].toLowerCase():"";var o=!!r[2];var i=!!r[3];var a=0;var f;if(o){if(i){f=r[2]+r[3]+r[4];a=r[2].length+r[3].length}else{f=r[2]+r[4];a=r[2].length}}else{if(i){f=r[3]+r[4];a=r[3].length}else{f=r[4]}}if(n==="file:"){if(a>=2){f=f.slice(2)}}else if(v(n)){f=r[4]}else if(n){if(o){f=f.slice(2)}}else if(a>=2&&v(t.protocol)){f=r[4]}return{protocol:n,slashes:o||v(n),slashesCount:a,rest:f}}function m(e,t){if(e==="")return t;var r=(t||"/").split("/").slice(0,-1).concat(e.split("/")),n=r.length,o=r[n-1],i=false,s=0;while(n--){if(r[n]==="."){r.splice(n,1)}else if(r[n]===".."){r.splice(n,1);s++}else if(s){if(n===0)i=true;r.splice(n,1);s--}}if(i)r.unshift("");if(o==="."||o==="..")r.push("");return r.join("/")}function b(e,t,r){e=c(e);e=e.replace(s,"");if(!(this instanceof b)){return new b(e,t,r)}var i,a,f,l,p,y,w=h.slice(),C=typeof t,A=this,k=0;if("object"!==C&&"string"!==C){r=t;t=null}if(r&&"function"!==typeof r)r=o.parse;t=d(t);a=g(e||"",t);i=!a.protocol&&!a.slashes;A.slashes=a.slashes||i&&t.slashes;A.protocol=a.protocol||t.protocol||"";e=a.rest;if(a.protocol==="file:"&&(a.slashesCount!==2||u.test(e))||!a.slashes&&(a.protocol||a.slashesCount<2||!v(A.protocol))){w[3]=[/(.*)/,"pathname"]}for(;k + + + +Created by FontForge 20201107 at Wed Aug 4 12:25:29 2021 + By Robert Madole +Copyright (c) Font Awesome + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.venv/share/jupyter/lab/static/9746.c7e86b432363dfd28caa.js b/.venv/share/jupyter/lab/static/9746.c7e86b432363dfd28caa.js new file mode 100644 index 0000000000000000000000000000000000000000..ee5732664b7cc8d3372782edd601a18916709d6e --- /dev/null +++ b/.venv/share/jupyter/lab/static/9746.c7e86b432363dfd28caa.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9746],{89746:(t,e,n)=>{n.r(e);n.d(e,{stex:()=>a,stexMath:()=>i});function r(t){function e(t,e){t.cmdState.push(e)}function n(t){if(t.cmdState.length>0){return t.cmdState[t.cmdState.length-1]}else{return null}}function r(t){var e=t.cmdState.pop();if(e){e.closeBracket()}}function a(t){var e=t.cmdState;for(var n=e.length-1;n>=0;n--){var r=e[n];if(r.name=="DEFAULT"){continue}return r}return{styleIdentifier:function(){return null}}}function i(t,e,n){return function(){this.name=t;this.bracketNo=0;this.style=e;this.styles=n;this.argument=null;this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null};this.openBracket=function(){this.bracketNo++;return"bracket"};this.closeBracket=function(){}}}var u={};u["importmodule"]=i("importmodule","tag",["string","builtin"]);u["documentclass"]=i("documentclass","tag",["","atom"]);u["usepackage"]=i("usepackage","tag",["atom"]);u["begin"]=i("begin","tag",["atom"]);u["end"]=i("end","tag",["atom"]);u["label"]=i("label","tag",["atom"]);u["ref"]=i("ref","tag",["atom"]);u["eqref"]=i("eqref","tag",["atom"]);u["cite"]=i("cite","tag",["atom"]);u["bibitem"]=i("bibitem","tag",["atom"]);u["Bibitem"]=i("Bibitem","tag",["atom"]);u["RBibitem"]=i("RBibitem","tag",["atom"]);u["DEFAULT"]=function(){this.name="DEFAULT";this.style="tag";this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function c(t,e){t.f=e}function f(t,r){var i;if(t.match(/^\\[a-zA-Z@\xc0-\u1fff\u2060-\uffff]+/)){var f=t.current().slice(1);i=u.hasOwnProperty(f)?u[f]:u["DEFAULT"];i=new i;e(r,i);c(r,s);return i.style}if(t.match(/^\\[$&%#{}_]/)){return"tag"}if(t.match(/^\\[,;!\/\\]/)){return"tag"}if(t.match("\\[")){c(r,(function(t,e){return o(t,e,"\\]")}));return"keyword"}if(t.match("\\(")){c(r,(function(t,e){return o(t,e,"\\)")}));return"keyword"}if(t.match("$$")){c(r,(function(t,e){return o(t,e,"$$")}));return"keyword"}if(t.match("$")){c(r,(function(t,e){return o(t,e,"$")}));return"keyword"}var m=t.next();if(m=="%"){t.skipToEnd();return"comment"}else if(m=="}"||m=="]"){i=n(r);if(i){i.closeBracket(m);c(r,s)}else{return"error"}return"bracket"}else if(m=="{"||m=="["){i=u["DEFAULT"];i=new i;e(r,i);return"bracket"}else if(/\d/.test(m)){t.eatWhile(/[\w.%]/);return"atom"}else{t.eatWhile(/[\w\-_]/);i=a(r);if(i.name=="begin"){i.argument=t.current()}return i.styleIdentifier()}}function o(t,e,n){if(t.eatSpace()){return null}if(n&&t.match(n)){c(e,f);return"keyword"}if(t.match(/^\\[a-zA-Z@]+/)){return"tag"}if(t.match(/^[a-zA-Z]+/)){return"variableName.special"}if(t.match(/^\\[$&%#{}_]/)){return"tag"}if(t.match(/^\\[,;!\/]/)){return"tag"}if(t.match(/^[\^_&]/)){return"tag"}if(t.match(/^[+\-<>|=,\/@!*:;'"`~#?]/)){return null}if(t.match(/^(\d+\.\d*|\d*\.\d+|\d+)/)){return"number"}var r=t.next();if(r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"){return"bracket"}if(r=="%"){t.skipToEnd();return"comment"}return"error"}function s(t,e){var a=t.peek(),i;if(a=="{"||a=="["){i=n(e);i.openBracket(a);t.eat(a);c(e,f);return"bracket"}if(/[ \t\r]/.test(a)){t.eat(a);return null}c(e,f);r(e);return f(t,e)}return{name:"stex",startState:function(){var e=t?function(t,e){return o(t,e)}:f;return{cmdState:[],f:e}},copyState:function(t){return{cmdState:t.cmdState.slice(),f:t.f}},token:function(t,e){return e.f(t,e)},blankLine:function(t){t.f=f;t.cmdState.length=0},languageData:{commentTokens:{line:"%"}}}}const a=r(false);const i=r(true)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9834b82ad26e2a37583d.woff2 b/.venv/share/jupyter/lab/static/9834b82ad26e2a37583d.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..2217164f0c05a385d7d0d83e030fdbae01e99304 Binary files /dev/null and b/.venv/share/jupyter/lab/static/9834b82ad26e2a37583d.woff2 differ diff --git a/.venv/share/jupyter/lab/static/9881.37d189ff085cb3468683.js b/.venv/share/jupyter/lab/static/9881.37d189ff085cb3468683.js new file mode 100644 index 0000000000000000000000000000000000000000..bc9fa14700502135c5fe641b439781561282cc7a --- /dev/null +++ b/.venv/share/jupyter/lab/static/9881.37d189ff085cb3468683.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9881],{79881:(t,i,e)=>{e.d(i,{diagram:()=>nt});var s=e(76261);var a=e(96049);var n=e(93113);var h=e(75905);var o=e(24982);var r=function(){var t=(0,h.K2)((function(t,i,e,s){for(e=e||{},s=t.length;s--;e[t[s]]=i);return e}),"o"),i=[1,10,12,14,16,18,19,21,23],e=[2,6],s=[1,3],a=[1,5],n=[1,6],o=[1,7],r=[1,5,10,12,14,16,18,19,21,23,34,35,36],l=[1,25],c=[1,26],u=[1,28],g=[1,29],x=[1,30],f=[1,31],p=[1,32],d=[1,33],y=[1,34],m=[1,35],b=[1,36],k=[1,37],A=[1,43],S=[1,42],w=[1,47],C=[1,50],_=[1,10,12,14,16,18,19,21,23,34,35,36],T=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],R=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],D=[1,64];var v={trace:(0,h.K2)((function t(){}),"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:(0,h.K2)((function t(i,e,s,a,n,h,o){var r=h.length-1;switch(n){case 5:a.setOrientation(h[r]);break;case 9:a.setDiagramTitle(h[r].text.trim());break;case 12:a.setLineData({text:"",type:"text"},h[r]);break;case 13:a.setLineData(h[r-1],h[r]);break;case 14:a.setBarData({text:"",type:"text"},h[r]);break;case 15:a.setBarData(h[r-1],h[r]);break;case 16:this.$=h[r].trim();a.setAccTitle(this.$);break;case 17:case 18:this.$=h[r].trim();a.setAccDescription(this.$);break;case 19:this.$=h[r-1];break;case 20:this.$=[Number(h[r-2]),...h[r]];break;case 21:this.$=[Number(h[r])];break;case 22:a.setXAxisTitle(h[r]);break;case 23:a.setXAxisTitle(h[r-1]);break;case 24:a.setXAxisTitle({type:"text",text:""});break;case 25:a.setXAxisBand(h[r]);break;case 26:a.setXAxisRangeData(Number(h[r-2]),Number(h[r]));break;case 27:this.$=h[r-1];break;case 28:this.$=[h[r-2],...h[r]];break;case 29:this.$=[h[r]];break;case 30:a.setYAxisTitle(h[r]);break;case 31:a.setYAxisTitle(h[r-1]);break;case 32:a.setYAxisTitle({type:"text",text:""});break;case 33:a.setYAxisRangeData(Number(h[r-2]),Number(h[r]));break;case 37:this.$={text:h[r],type:"text"};break;case 38:this.$={text:h[r],type:"text"};break;case 39:this.$={text:h[r],type:"markdown"};break;case 40:this.$=h[r];break;case 41:this.$=h[r-1]+""+h[r];break}}),"anonymous"),table:[t(i,e,{3:1,4:2,7:4,5:s,34:a,35:n,36:o}),{1:[3]},t(i,e,{4:2,7:4,3:8,5:s,34:a,35:n,36:o}),t(i,e,{4:2,7:4,6:9,3:10,5:s,8:[1,11],34:a,35:n,36:o}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},t(r,[2,34]),t(r,[2,35]),t(r,[2,36]),{1:[2,1]},t(i,e,{4:2,7:4,3:21,5:s,34:a,35:n,36:o}),{1:[2,3]},t(r,[2,5]),t(i,[2,7],{4:22,34:a,35:n,36:o}),{11:23,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},{11:39,13:38,24:A,27:S,29:40,30:41,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},{11:45,15:44,27:w,33:46,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},{11:49,17:48,24:C,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},{11:52,17:51,24:C,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},{20:[1,53]},{22:[1,54]},t(_,[2,18]),{1:[2,2]},t(_,[2,8]),t(_,[2,9]),t(T,[2,37],{40:55,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k}),t(T,[2,38]),t(T,[2,39]),t(R,[2,40]),t(R,[2,42]),t(R,[2,43]),t(R,[2,44]),t(R,[2,45]),t(R,[2,46]),t(R,[2,47]),t(R,[2,48]),t(R,[2,49]),t(R,[2,50]),t(R,[2,51]),t(_,[2,10]),t(_,[2,22],{30:41,29:56,24:A,27:S}),t(_,[2,24]),t(_,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},t(_,[2,11]),t(_,[2,30],{33:60,27:w}),t(_,[2,32]),{31:[1,61]},t(_,[2,12]),{17:62,24:C},{25:63,27:D},t(_,[2,14]),{17:65,24:C},t(_,[2,16]),t(_,[2,17]),t(R,[2,41]),t(_,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(_,[2,31]),{27:[1,69]},t(_,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(_,[2,15]),t(_,[2,26]),t(_,[2,27]),{11:59,32:72,37:24,38:l,39:c,40:27,41:u,42:g,43:x,44:f,45:p,46:d,47:y,48:m,49:b,50:k},t(_,[2,33]),t(_,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:(0,h.K2)((function t(i,e){if(e.recoverable){this.trace(i)}else{var s=new Error(i);s.hash=e;throw s}}),"parseError"),parse:(0,h.K2)((function t(i){var e=this,s=[0],a=[],n=[null],o=[],r=this.table,l="",c=0,u=0,g=0,x=2,f=1;var p=o.slice.call(arguments,1);var d=Object.create(this.lexer);var y={yy:{}};for(var m in this.yy){if(Object.prototype.hasOwnProperty.call(this.yy,m)){y.yy[m]=this.yy[m]}}d.setInput(i,y.yy);y.yy.lexer=d;y.yy.parser=this;if(typeof d.yylloc=="undefined"){d.yylloc={}}var b=d.yylloc;o.push(b);var k=d.options&&d.options.ranges;if(typeof y.yy.parseError==="function"){this.parseError=y.yy.parseError}else{this.parseError=Object.getPrototypeOf(this).parseError}function A(t){s.length=s.length-2*t;n.length=n.length-t;o.length=o.length-t}(0,h.K2)(A,"popStack");function S(){var t;t=a.pop()||d.lex()||f;if(typeof t!=="number"){if(t instanceof Array){a=t;t=a.pop()}t=e.symbols_[t]||t}return t}(0,h.K2)(S,"lex");var w,C,_,T,R,D,v={},L,P,E,K;while(true){_=s[s.length-1];if(this.defaultActions[_]){T=this.defaultActions[_]}else{if(w===null||typeof w=="undefined"){w=S()}T=r[_]&&r[_][w]}if(typeof T==="undefined"||!T.length||!T[0]){var I="";K=[];for(L in r[_]){if(this.terminals_[L]&&L>x){K.push("'"+this.terminals_[L]+"'")}}if(d.showPosition){I="Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+K.join(", ")+", got '"+(this.terminals_[w]||w)+"'"}else{I="Parse error on line "+(c+1)+": Unexpected "+(w==f?"end of input":"'"+(this.terminals_[w]||w)+"'")}this.parseError(I,{text:d.match,token:this.terminals_[w]||w,line:d.yylineno,loc:b,expected:K})}if(T[0]instanceof Array&&T.length>1){throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+w)}switch(T[0]){case 1:s.push(w);n.push(d.yytext);o.push(d.yylloc);s.push(T[1]);w=null;if(!C){u=d.yyleng;l=d.yytext;c=d.yylineno;b=d.yylloc;if(g>0){g--}}else{w=C;C=null}break;case 2:P=this.productions_[T[1]][1];v.$=n[n.length-P];v._$={first_line:o[o.length-(P||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(P||1)].first_column,last_column:o[o.length-1].last_column};if(k){v._$.range=[o[o.length-(P||1)].range[0],o[o.length-1].range[1]]}D=this.performAction.apply(v,[l,u,c,y.yy,T[1],n,o].concat(p));if(typeof D!=="undefined"){return D}if(P){s=s.slice(0,-1*P*2);n=n.slice(0,-1*P);o=o.slice(0,-1*P)}s.push(this.productions_[T[1]][0]);n.push(v.$);o.push(v._$);E=r[s[s.length-2]][s[s.length-1]];s.push(E);break;case 3:return true}}return true}),"parse")};var L=function(){var t={EOF:1,parseError:(0,h.K2)((function t(i,e){if(this.yy.parser){this.yy.parser.parseError(i,e)}else{throw new Error(i)}}),"parseError"),setInput:(0,h.K2)((function(t,i){this.yy=i||this.yy||{};this._input=t;this._more=this._backtrack=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};if(this.options.ranges){this.yylloc.range=[0,0]}this.offset=0;return this}),"setInput"),input:(0,h.K2)((function(){var t=this._input[0];this.yytext+=t;this.yyleng++;this.offset++;this.match+=t;this.matched+=t;var i=t.match(/(?:\r\n?|\n).*/g);if(i){this.yylineno++;this.yylloc.last_line++}else{this.yylloc.last_column++}if(this.options.ranges){this.yylloc.range[1]++}this._input=this._input.slice(1);return t}),"input"),unput:(0,h.K2)((function(t){var i=t.length;var e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input;this.yytext=this.yytext.substr(0,this.yytext.length-i);this.offset-=i;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1);this.matched=this.matched.substr(0,this.matched.length-1);if(e.length-1){this.yylineno-=e.length-1}var a=this.yylloc.range;this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===s.length?this.yylloc.first_column:0)+s[s.length-e.length].length-e[0].length:this.yylloc.first_column-i};if(this.options.ranges){this.yylloc.range=[a[0],a[0]+this.yyleng-i]}this.yyleng=this.yytext.length;return this}),"unput"),more:(0,h.K2)((function(){this._more=true;return this}),"more"),reject:(0,h.K2)((function(){if(this.options.backtrack_lexer){this._backtrack=true}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}return this}),"reject"),less:(0,h.K2)((function(t){this.unput(this.match.slice(t))}),"less"),pastInput:(0,h.K2)((function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")}),"pastInput"),upcomingInput:(0,h.K2)((function(){var t=this.match;if(t.length<20){t+=this._input.substr(0,20-t.length)}return(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")}),"upcomingInput"),showPosition:(0,h.K2)((function(){var t=this.pastInput();var i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"}),"showPosition"),test_match:(0,h.K2)((function(t,i){var e,s,a;if(this.options.backtrack_lexer){a={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done};if(this.options.ranges){a.yylloc.range=this.yylloc.range.slice(0)}}s=t[0].match(/(?:\r\n?|\n).*/g);if(s){this.yylineno+=s.length}this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:s?s[s.length-1].length-s[s.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.matches=t;this.yyleng=this.yytext.length;if(this.options.ranges){this.yylloc.range=[this.offset,this.offset+=this.yyleng]}this._more=false;this._backtrack=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input){this.done=false}if(e){return e}else if(this._backtrack){for(var n in a){this[n]=a[n]}return false}return false}),"test_match"),next:(0,h.K2)((function(){if(this.done){return this.EOF}if(!this._input){this.done=true}var t,i,e,s;if(!this._more){this.yytext="";this.match=""}var a=this._currentRules();for(var n=0;ni[0].length)){i=e;s=n;if(this.options.backtrack_lexer){t=this.test_match(e,a[n]);if(t!==false){return t}else if(this._backtrack){i=false;continue}else{return false}}else if(!this.options.flex){break}}}if(i){t=this.test_match(i,a[s]);if(t!==false){return t}return false}if(this._input===""){return this.EOF}else{return this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}}),"next"),lex:(0,h.K2)((function t(){var i=this.next();if(i){return i}else{return this.lex()}}),"lex"),begin:(0,h.K2)((function t(i){this.conditionStack.push(i)}),"begin"),popState:(0,h.K2)((function t(){var i=this.conditionStack.length-1;if(i>0){return this.conditionStack.pop()}else{return this.conditionStack[0]}}),"popState"),_currentRules:(0,h.K2)((function t(){if(this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules}else{return this.conditions["INITIAL"].rules}}),"_currentRules"),topState:(0,h.K2)((function t(i){i=this.conditionStack.length-1-Math.abs(i||0);if(i>=0){return this.conditionStack[i]}else{return"INITIAL"}}),"topState"),pushState:(0,h.K2)((function t(i){this.begin(i)}),"pushState"),stateStackSize:(0,h.K2)((function t(){return this.conditionStack.length}),"stateStackSize"),options:{"case-insensitive":true},performAction:(0,h.K2)((function t(i,e,s,a){var n=a;switch(s){case 0:break;case 1:break;case 2:this.popState();return 34;break;case 3:this.popState();return 34;break;case 4:return 34;break;case 5:break;case 6:return 10;break;case 7:this.pushState("acc_title");return 19;break;case 8:this.popState();return"acc_title_value";break;case 9:this.pushState("acc_descr");return 21;break;case 10:this.popState();return"acc_descr_value";break;case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";break;case 14:return 5;break;case 15:return 8;break;case 16:this.pushState("axis_data");return"X_AXIS";break;case 17:this.pushState("axis_data");return"Y_AXIS";break;case 18:this.pushState("axis_band_data");return 24;break;case 19:return 31;break;case 20:this.pushState("data");return 16;break;case 21:this.pushState("data");return 18;break;case 22:this.pushState("data_inner");return 24;break;case 23:return 27;break;case 24:this.popState();return 26;break;case 25:this.popState();break;case 26:this.pushState("string");break;case 27:this.popState();break;case 28:return"STR";break;case 29:return 24;break;case 30:return 26;break;case 31:return 43;break;case 32:return"COLON";break;case 33:return 44;break;case 34:return 28;break;case 35:return 45;break;case 36:return 46;break;case 37:return 48;break;case 38:return 50;break;case 39:return 47;break;case 40:return 41;break;case 41:return 49;break;case 42:return 42;break;case 43:break;case 44:return 35;break;case 45:return 36;break}}),"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,23,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:true},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,20,21,22,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:true},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,24,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:true},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,23,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:true},acc_descr_multiline:{rules:[12,13],inclusive:false},acc_descr:{rules:[10],inclusive:false},acc_title:{rules:[8],inclusive:false},title:{rules:[],inclusive:false},md_string:{rules:[],inclusive:false},string:{rules:[27,28],inclusive:false},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,20,21,25,26,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45],inclusive:true}}};return t}();v.lexer=L;function P(){this.yy={}}(0,h.K2)(P,"Parser");P.prototype=v;v.Parser=P;return new P}();r.parser=r;var l=r;function c(t){return t.type==="bar"}(0,h.K2)(c,"isBarPlot");function u(t){return t.type==="band"}(0,h.K2)(u,"isBandAxisData");function g(t){return t.type==="linear"}(0,h.K2)(g,"isLinearAxisData");var x=class{constructor(t){this.parentGroup=t}static{(0,h.K2)(this,"TextDimensionCalculatorWithFont")}getMaxDimension(t,i){if(!this.parentGroup){return{width:t.reduce(((t,i)=>Math.max(i.length,t)),0)*i,height:i}}const e={width:0,height:0};const a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const n of t){const t=(0,s.W6)(a,1,n);const h=t?t.width:n.length*i;const o=t?t.height:i;e.width=Math.max(e.width,h);e.height=Math.max(e.height,o)}a.remove();return e}};var f=.7;var p=.2;var d=class{constructor(t,i,e,s){this.axisConfig=t;this.title=i;this.textDimensionCalculator=e;this.axisThemeConfig=s;this.boundingRect={x:0,y:0,width:0,height:0};this.axisPosition="left";this.showTitle=false;this.showLabel=false;this.showTick=false;this.showAxisLine=false;this.outerPadding=0;this.titleTextHeight=0;this.labelTextHeight=0;this.range=[0,10];this.boundingRect={x:0,y:0,width:0,height:0};this.axisPosition="left"}static{(0,h.K2)(this,"BaseAxis")}setRange(t){this.range=t;if(this.axisPosition==="left"||this.axisPosition==="right"){this.boundingRect.height=t[1]-t[0]}else{this.boundingRect.width=t[1]-t[0]}this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t;this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map((t=>t.toString())),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){if(f*this.getTickDistance()>this.outerPadding*2){this.outerPadding=Math.floor(f*this.getTickDistance()/2)}this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth){i-=this.axisConfig.axisLineWidth;this.showAxisLine=true}if(this.axisConfig.showLabel){const e=this.getLabelDimension();const s=p*t.width;this.outerPadding=Math.min(e.width/2,s);const a=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height;if(a<=i){i-=a;this.showLabel=true}}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength){this.showTick=true;i-=this.axisConfig.tickLength}if(this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize);const e=t.height+this.axisConfig.titlePadding*2;this.titleTextHeight=t.height;if(e<=i){i-=e;this.showTitle=true}}this.boundingRect.width=t.width;this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth){i-=this.axisConfig.axisLineWidth;this.showAxisLine=true}if(this.axisConfig.showLabel){const e=this.getLabelDimension();const s=p*t.height;this.outerPadding=Math.min(e.height/2,s);const a=e.width+this.axisConfig.labelPadding*2;if(a<=i){i-=a;this.showLabel=true}}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength){this.showTick=true;i-=this.axisConfig.tickLength}if(this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize);const e=t.height+this.axisConfig.titlePadding*2;this.titleTextHeight=t.height;if(e<=i){i-=e;this.showTitle=true}}this.boundingRect.width=t.width-i;this.boundingRect.height=t.height}calculateSpace(t){if(this.axisPosition==="left"||this.axisPosition==="right"){this.calculateSpaceIfDrawnVertical(t)}else{this.calculateSpaceIfDrawnHorizontally(t)}this.recalculateScale();return{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x;this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel){t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(t),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"})))})}if(this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}if(this.showTitle){t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]})}return t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel){t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))})}if(this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}if(this.showTitle){t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]})}return t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel){t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map((t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"})))})}if(this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map((t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth})))})}if(this.showTitle){t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]})}return t}getDrawableElements(){if(this.axisPosition==="left"){return this.getDrawableElementsForLeftAxis()}if(this.axisPosition==="right"){throw Error("Drawing of right axis is not implemented")}if(this.axisPosition==="bottom"){return this.getDrawableElementsForBottomAxis()}if(this.axisPosition==="top"){return this.getDrawableElementsForTopAxis()}return[]}};var y=class extends d{static{(0,h.K2)(this,"BandAxis")}constructor(t,i,e,s,a){super(t,s,a,i);this.categories=e;this.scale=(0,o.WH)().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=(0,o.WH)().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5);h.Rm.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}};var m=class extends d{static{(0,h.K2)(this,"LinearAxis")}constructor(t,i,e,s,a){super(t,s,a,i);this.domain=e;this.scale=(0,o.m4Y)().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];if(this.axisPosition==="left"){t.reverse()}this.scale=(0,o.m4Y)().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}};function b(t,i,e,s){const a=new x(s);if(u(t)){return new y(i,e,t.categories,t.title,a)}return new m(i,e,[t.min,t.max],t.title,a)}(0,h.K2)(b,"getAxis");var k=class{constructor(t,i,e,s){this.textDimensionCalculator=t;this.chartConfig=i;this.chartData=e;this.chartThemeConfig=s;this.boundingRect={x:0,y:0,width:0,height:0};this.showChartTitle=false}static{(0,h.K2)(this,"ChartTitle")}setBoundingBoxXY(t){this.boundingRect.x=t.x;this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize);const e=Math.max(i.width,t.width);const s=i.height+2*this.chartConfig.titlePadding;if(i.width<=e&&i.height<=s&&this.chartConfig.showTitle&&this.chartData.title){this.boundingRect.width=e;this.boundingRect.height=s;this.showChartTitle=true}return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];if(this.showChartTitle){t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]})}return t}};function A(t,i,e,s){const a=new x(s);return new k(a,t,i,e)}(0,h.K2)(A,"getChartTitleComponent");var S=class{constructor(t,i,e,s,a){this.plotData=t;this.xAxis=i;this.yAxis=e;this.orientation=s;this.plotIndex=a}static{(0,h.K2)(this,"LinePlot")}getDrawableElement(){const t=this.plotData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));let i;if(this.orientation==="horizontal"){i=(0,o.n8j)().y((t=>t[0])).x((t=>t[1]))(t)}else{i=(0,o.n8j)().x((t=>t[0])).y((t=>t[1]))(t)}if(!i){return[]}return[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]}};var w=class{constructor(t,i,e,s,a,n){this.barData=t;this.boundingRect=i;this.xAxis=e;this.yAxis=s;this.orientation=a;this.plotIndex=n}static{(0,h.K2)(this,"BarPlot")}getDrawableElement(){const t=this.barData.data.map((t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]));const i=.05;const e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-i);const s=e/2;if(this.orientation==="horizontal"){return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:this.boundingRect.x,y:t[0]-s,height:e,width:t[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}return[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map((t=>({x:t[0]-s,y:t[1],width:e,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill})))}]}};var C=class{constructor(t,i,e){this.chartConfig=t;this.chartData=i;this.chartThemeConfig=e;this.boundingRect={x:0,y:0,width:0,height:0}}static{(0,h.K2)(this,"BasePlot")}setAxes(t,i){this.xAxis=t;this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x;this.boundingRect.y=t.y}calculateSpace(t){this.boundingRect.width=t.width;this.boundingRect.height=t.height;return{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis)){throw Error("Axes must be passed to render Plots")}const t=[];for(const[i,e]of this.chartData.plots.entries()){switch(e.type){case"line":{const s=new S(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break;case"bar":{const s=new w(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...s.getDrawableElement())}break}}return t}};function _(t,i,e){return new C(t,i,e)}(0,h.K2)(_,"getPlotComponent");var T=class{constructor(t,i,e,s){this.chartConfig=t;this.chartData=i;this.componentStore={title:A(t,i,e,s),plot:_(t,i,e),xAxis:b(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},s),yAxis:b(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},s)}}static{(0,h.K2)(this,"Orchestrator")}calculateVerticalSpace(){let t=this.chartConfig.width;let i=this.chartConfig.height;let e=0;let s=0;let a=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100);let n=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100);let h=this.componentStore.plot.calculateSpace({width:a,height:n});t-=h.width;i-=h.height;h=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i});s=h.height;i-=h.height;this.componentStore.xAxis.setAxisPosition("bottom");h=this.componentStore.xAxis.calculateSpace({width:t,height:i});i-=h.height;this.componentStore.yAxis.setAxisPosition("left");h=this.componentStore.yAxis.calculateSpace({width:t,height:i});e=h.width;t-=h.width;if(t>0){a+=t;t=0}if(i>0){n+=i;i=0}this.componentStore.plot.calculateSpace({width:a,height:n});this.componentStore.plot.setBoundingBoxXY({x:e,y:s});this.componentStore.xAxis.setRange([e,e+a]);this.componentStore.xAxis.setBoundingBoxXY({x:e,y:s+n});this.componentStore.yAxis.setRange([s,s+n]);this.componentStore.yAxis.setBoundingBoxXY({x:0,y:s});if(this.chartData.plots.some((t=>c(t)))){this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}}calculateHorizontalSpace(){let t=this.chartConfig.width;let i=this.chartConfig.height;let e=0;let s=0;let a=0;let n=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100);let h=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100);let o=this.componentStore.plot.calculateSpace({width:n,height:h});t-=o.width;i-=o.height;o=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i});e=o.height;i-=o.height;this.componentStore.xAxis.setAxisPosition("left");o=this.componentStore.xAxis.calculateSpace({width:t,height:i});t-=o.width;s=o.width;this.componentStore.yAxis.setAxisPosition("top");o=this.componentStore.yAxis.calculateSpace({width:t,height:i});i-=o.height;a=e+o.height;if(t>0){n+=t;t=0}if(i>0){h+=i;i=0}this.componentStore.plot.calculateSpace({width:n,height:h});this.componentStore.plot.setBoundingBoxXY({x:s,y:a});this.componentStore.yAxis.setRange([s,s+n]);this.componentStore.yAxis.setBoundingBoxXY({x:s,y:e});this.componentStore.xAxis.setRange([a,a+h]);this.componentStore.xAxis.setBoundingBoxXY({x:0,y:a});if(this.chartData.plots.some((t=>c(t)))){this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}}calculateSpace(){if(this.chartConfig.chartOrientation==="horizontal"){this.calculateHorizontalSpace()}else{this.calculateVerticalSpace()}}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore)){t.push(...i.getDrawableElements())}return t}};var R=class{static{(0,h.K2)(this,"XYChartBuilder")}static build(t,i,e,s){const a=new T(t,i,e,s);return a.getDrawableElement()}};var D=0;var v;var L=B();var P=M();var E=z();var K=P.plotColorPalette.split(",").map((t=>t.trim()));var I=false;var $=false;function M(){const t=(0,h.P$)();const i=(0,h.zj)();return(0,a.$t)(t.xyChart,i.themeVariables.xyChart)}(0,h.K2)(M,"getChartDefaultThemeConfig");function B(){const t=(0,h.zj)();return(0,a.$t)(h.UI.xyChart,t.xyChart)}(0,h.K2)(B,"getChartDefaultConfig");function z(){return{yAxis:{type:"linear",title:"",min:Infinity,max:-Infinity},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}(0,h.K2)(z,"getChartDefaultData");function W(t){const i=(0,h.zj)();return(0,h.jZ)(t.trim(),i)}(0,h.K2)(W,"textSanitizer");function O(t){v=t}(0,h.K2)(O,"setTmpSVGG");function F(t){if(t==="horizontal"){L.chartOrientation="horizontal"}else{L.chartOrientation="vertical"}}(0,h.K2)(F,"setOrientation");function N(t){E.xAxis.title=W(t.text)}(0,h.K2)(N,"setXAxisTitle");function V(t,i){E.xAxis={type:"linear",title:E.xAxis.title,min:t,max:i};I=true}(0,h.K2)(V,"setXAxisRangeData");function X(t){E.xAxis={type:"band",title:E.xAxis.title,categories:t.map((t=>W(t.text)))};I=true}(0,h.K2)(X,"setXAxisBand");function Y(t){E.yAxis.title=W(t.text)}(0,h.K2)(Y,"setYAxisTitle");function U(t,i){E.yAxis={type:"linear",title:E.yAxis.title,min:t,max:i};$=true}(0,h.K2)(U,"setYAxisRangeData");function H(t){const i=Math.min(...t);const e=Math.max(...t);const s=g(E.yAxis)?E.yAxis.min:Infinity;const a=g(E.yAxis)?E.yAxis.max:-Infinity;E.yAxis={type:"linear",title:E.yAxis.title,min:Math.min(s,i),max:Math.max(a,e)}}(0,h.K2)(H,"setYAxisRangeFromPlotData");function j(t){let i=[];if(t.length===0){return i}if(!I){const i=g(E.xAxis)?E.xAxis.min:Infinity;const e=g(E.xAxis)?E.xAxis.max:-Infinity;V(Math.min(i,1),Math.max(e,t.length))}if(!$){H(t)}if(u(E.xAxis)){i=E.xAxis.categories.map(((i,e)=>[i,t[e]]))}if(g(E.xAxis)){const e=E.xAxis.min;const s=E.xAxis.max;const a=(s-e)/(t.length-1);const n=[];for(let t=e;t<=s;t+=a){n.push(`${t}`)}i=n.map(((i,e)=>[i,t[e]]))}return i}(0,h.K2)(j,"transformDataWithoutCategory");function G(t){return K[t===0?0:t%K.length]}(0,h.K2)(G,"getPlotColorFromPalette");function Q(t,i){const e=j(i);E.plots.push({type:"line",strokeFill:G(D),strokeWidth:2,data:e});D++}(0,h.K2)(Q,"setLineData");function Z(t,i){const e=j(i);E.plots.push({type:"bar",fill:G(D),data:e});D++}(0,h.K2)(Z,"setBarData");function q(){if(E.plots.length===0){throw Error("No Plot to render, please provide a plot with some data")}E.title=(0,h.ab)();return R.build(L,E,P,v)}(0,h.K2)(q,"getDrawableElem");function J(){return P}(0,h.K2)(J,"getChartThemeConfig");function tt(){return L}(0,h.K2)(tt,"getChartConfig");var it=(0,h.K2)((function(){(0,h.IU)();D=0;L=B();E=z();P=M();K=P.plotColorPalette.split(",").map((t=>t.trim()));I=false;$=false}),"clear");var et={getDrawableElem:q,clear:it,setAccTitle:h.SV,getAccTitle:h.iN,setDiagramTitle:h.ke,getDiagramTitle:h.ab,getAccDescription:h.m7,setAccDescription:h.EI,setOrientation:F,setXAxisTitle:N,setXAxisRangeData:V,setXAxisBand:X,setYAxisTitle:Y,setYAxisRangeData:U,setLineData:Q,setBarData:Z,setTmpSVGG:O,getChartThemeConfig:J,getChartConfig:tt};var st=(0,h.K2)(((t,i,e,s)=>{const a=s.db;const o=a.getChartThemeConfig();const r=a.getChartConfig();function l(t){return t==="top"?"text-before-edge":"middle"}(0,h.K2)(l,"getDominantBaseLine");function c(t){return t==="left"?"start":t==="right"?"end":"middle"}(0,h.K2)(c,"getTextAnchor");function u(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}(0,h.K2)(u,"getTextTransformation");h.Rm.debug("Rendering xychart chart\n"+t);const g=(0,n.D)(i);const x=g.append("g").attr("class","main");const f=x.append("rect").attr("width",r.width).attr("height",r.height).attr("class","background");(0,h.a$)(g,r.height,r.width,true);g.attr("viewBox",`0 0 ${r.width} ${r.height}`);f.attr("fill",o.backgroundColor);a.setTmpSVGG(g.append("g").attr("class","mermaid-tmp-group"));const p=a.getDrawableElem();const d={};function y(t){let i=x;let e="";for(const[s]of t.entries()){let a=x;if(s>0&&d[e]){a=d[e]}e+=t[s];i=d[e];if(!i){i=d[e]=a.append("g").attr("class",t[s])}}return i}(0,h.K2)(y,"getGroup");for(const n of p){if(n.data.length===0){continue}const t=y(n.groupTexts);switch(n.type){case"rect":t.selectAll("rect").data(n.data).enter().append("rect").attr("x",(t=>t.x)).attr("y",(t=>t.y)).attr("width",(t=>t.width)).attr("height",(t=>t.height)).attr("fill",(t=>t.fill)).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break;case"text":t.selectAll("text").data(n.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",(t=>t.fill)).attr("font-size",(t=>t.fontSize)).attr("dominant-baseline",(t=>l(t.verticalPos))).attr("text-anchor",(t=>c(t.horizontalPos))).attr("transform",(t=>u(t))).text((t=>t.text));break;case"path":t.selectAll("path").data(n.data).enter().append("path").attr("d",(t=>t.path)).attr("fill",(t=>t.fill?t.fill:"none")).attr("stroke",(t=>t.strokeFill)).attr("stroke-width",(t=>t.strokeWidth));break}}}),"draw");var at={draw:st};var nt={parser:l,db:et,renderer:at}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9890.75ea8024e2c1c49c89a3.js b/.venv/share/jupyter/lab/static/9890.75ea8024e2c1c49c89a3.js new file mode 100644 index 0000000000000000000000000000000000000000..8c44382c53bee0638c767f8702247d932a3a7df2 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9890.75ea8024e2c1c49c89a3.js @@ -0,0 +1 @@ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9890],{19163:(t,e,r)=>{r.d(e,{S:()=>n});var a=r(75905);function n(t,e){if(t.accDescr){e.setAccDescription?.(t.accDescr)}if(t.accTitle){e.setAccTitle?.(t.accTitle)}if(t.title){e.setDiagramTitle?.(t.title)}}(0,a.K2)(n,"populateCommonDb")},13249:(t,e,r)=>{r.d(e,{m:()=>n});var a=r(75905);var n=class{constructor(t){this.init=t;this.records=this.init()}static{(0,a.K2)(this,"ImperativeState")}reset(){this.records=this.init()}}},99890:(t,e,r)=>{r.d(e,{diagram:()=>Mt});var a=r(19163);var n=r(13249);var o=r(96049);var s=r(75905);var c=r(24010);var i=r(24982);var m={NORMAL:0,REVERSE:1,HIGHLIGHT:2,MERGE:3,CHERRY_PICK:4};var d=s.UI.gitGraph;var h=(0,s.K2)((()=>{const t=(0,o.$t)({...d,...(0,s.zj)().gitGraph});return t}),"getConfig");var l=new n.m((()=>{const t=h();const e=t.mainBranchName;const r=t.mainBranchOrder;return{mainBranchName:e,commits:new Map,head:null,branchConfig:new Map([[e,{name:e,order:r}]]),branches:new Map([[e,null]]),currBranch:e,direction:"LR",seq:0,options:{}}}));function g(){return(0,o.yT)({length:7})}(0,s.K2)(g,"getID");function p(t,e){const r=Object.create(null);return t.reduce(((t,a)=>{const n=e(a);if(!r[n]){r[n]=true;t.push(a)}return t}),[])}(0,s.K2)(p,"uniqBy");var f=(0,s.K2)((function(t){l.records.direction=t}),"setDirection");var $=(0,s.K2)((function(t){s.Rm.debug("options str",t);t=t?.trim();t=t||"{}";try{l.records.options=JSON.parse(t)}catch(e){s.Rm.error("error while parsing gitGraph options",e.message)}}),"setOptions");var y=(0,s.K2)((function(){return l.records.options}),"getOptions");var x=(0,s.K2)((function(t){let e=t.msg;let r=t.id;const a=t.type;let n=t.tags;s.Rm.info("commit",e,r,a,n);s.Rm.debug("Entering commit:",e,r,a,n);const o=h();r=s.Y2.sanitizeText(r,o);e=s.Y2.sanitizeText(e,o);n=n?.map((t=>s.Y2.sanitizeText(t,o)));const c={id:r?r:l.records.seq+"-"+g(),message:e,seq:l.records.seq++,type:a??m.NORMAL,tags:n??[],parents:l.records.head==null?[]:[l.records.head.id],branch:l.records.currBranch};l.records.head=c;s.Rm.info("main branch",o.mainBranchName);l.records.commits.set(c.id,c);l.records.branches.set(l.records.currBranch,c.id);s.Rm.debug("in pushCommit "+c.id)}),"commit");var u=(0,s.K2)((function(t){let e=t.name;const r=t.order;e=s.Y2.sanitizeText(e,h());if(l.records.branches.has(e)){throw new Error(`Trying to create an existing branch. (Help: Either use a new name if you want create a new branch or try using "checkout ${e}")`)}l.records.branches.set(e,l.records.head!=null?l.records.head.id:null);l.records.branchConfig.set(e,{name:e,order:r});v(e);s.Rm.debug("in createBranch")}),"branch");var b=(0,s.K2)((t=>{let e=t.branch;let r=t.id;const a=t.type;const n=t.tags;const o=h();e=s.Y2.sanitizeText(e,o);if(r){r=s.Y2.sanitizeText(r,o)}const c=l.records.branches.get(l.records.currBranch);const i=l.records.branches.get(e);const d=c?l.records.commits.get(c):void 0;const p=i?l.records.commits.get(i):void 0;if(d&&p&&d.branch===e){throw new Error(`Cannot merge branch '${e}' into itself.`)}if(l.records.currBranch===e){const t=new Error('Incorrect usage of "merge". Cannot merge a branch to itself');t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]};throw t}if(d===void 0||!d){const t=new Error(`Incorrect usage of "merge". Current branch (${l.records.currBranch})has no commits`);t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["commit"]};throw t}if(!l.records.branches.has(e)){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") does not exist");t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:[`branch ${e}`]};throw t}if(p===void 0||!p){const t=new Error('Incorrect usage of "merge". Branch to be merged ('+e+") has no commits");t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:['"commit"']};throw t}if(d===p){const t=new Error('Incorrect usage of "merge". Both branches have same head');t.hash={text:`merge ${e}`,token:`merge ${e}`,expected:["branch abc"]};throw t}if(r&&l.records.commits.has(r)){const t=new Error('Incorrect usage of "merge". Commit with id:'+r+" already exists, use different custom Id");t.hash={text:`merge ${e} ${r} ${a} ${n?.join(" ")}`,token:`merge ${e} ${r} ${a} ${n?.join(" ")}`,expected:[`merge ${e} ${r}_UNIQUE ${a} ${n?.join(" ")}`]};throw t}const f=i?i:"";const $={id:r||`${l.records.seq}-${g()}`,message:`merged branch ${e} into ${l.records.currBranch}`,seq:l.records.seq++,parents:l.records.head==null?[]:[l.records.head.id,f],branch:l.records.currBranch,type:m.MERGE,customType:a,customId:r?true:false,tags:n??[]};l.records.head=$;l.records.commits.set($.id,$);l.records.branches.set(l.records.currBranch,$.id);s.Rm.debug(l.records.branches);s.Rm.debug("in mergeBranch")}),"merge");var w=(0,s.K2)((function(t){let e=t.id;let r=t.targetId;let a=t.tags;let n=t.parent;s.Rm.debug("Entering cherryPick:",e,r,a);const o=h();e=s.Y2.sanitizeText(e,o);r=s.Y2.sanitizeText(r,o);a=a?.map((t=>s.Y2.sanitizeText(t,o)));n=s.Y2.sanitizeText(n,o);if(!e||!l.records.commits.has(e)){const t=new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided');t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]};throw t}const c=l.records.commits.get(e);if(c===void 0||!c){throw new Error('Incorrect usage of "cherryPick". Source commit id should exist and provided')}if(n&&!(Array.isArray(c.parents)&&c.parents.includes(n))){const t=new Error("Invalid operation: The specified parent commit is not an immediate parent of the cherry-picked commit.");throw t}const i=c.branch;if(c.type===m.MERGE&&!n){const t=new Error("Incorrect usage of cherry-pick: If the source commit is a merge commit, an immediate parent commit must be specified.");throw t}if(!r||!l.records.commits.has(r)){if(i===l.records.currBranch){const t=new Error('Incorrect usage of "cherryPick". Source commit is already on current branch');t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]};throw t}const t=l.records.branches.get(l.records.currBranch);if(t===void 0||!t){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${l.records.currBranch})has no commits`);t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]};throw t}const o=l.records.commits.get(t);if(o===void 0||!o){const t=new Error(`Incorrect usage of "cherry-pick". Current branch (${l.records.currBranch})has no commits`);t.hash={text:`cherryPick ${e} ${r}`,token:`cherryPick ${e} ${r}`,expected:["cherry-pick abc"]};throw t}const d={id:l.records.seq+"-"+g(),message:`cherry-picked ${c?.message} into ${l.records.currBranch}`,seq:l.records.seq++,parents:l.records.head==null?[]:[l.records.head.id,c.id],branch:l.records.currBranch,type:m.CHERRY_PICK,tags:a?a.filter(Boolean):[`cherry-pick:${c.id}${c.type===m.MERGE?`|parent:${n}`:""}`]};l.records.head=d;l.records.commits.set(d.id,d);l.records.branches.set(l.records.currBranch,d.id);s.Rm.debug(l.records.branches);s.Rm.debug("in cherryPick")}}),"cherryPick");var v=(0,s.K2)((function(t){t=s.Y2.sanitizeText(t,h());if(!l.records.branches.has(t)){const e=new Error(`Trying to checkout branch which is not yet created. (Help try using "branch ${t}")`);e.hash={text:`checkout ${t}`,token:`checkout ${t}`,expected:[`branch ${t}`]};throw e}else{l.records.currBranch=t;const e=l.records.branches.get(l.records.currBranch);if(e===void 0||!e){l.records.head=null}else{l.records.head=l.records.commits.get(e)??null}}}),"checkout");function B(t,e,r){const a=t.indexOf(e);if(a===-1){t.push(r)}else{t.splice(a,1,r)}}(0,s.K2)(B,"upsert");function E(t){const e=t.reduce(((t,e)=>{if(t.seq>e.seq){return t}return e}),t[0]);let r="";t.forEach((function(t){if(t===e){r+="\t*"}else{r+="\t|"}}));const a=[r,e.id,e.seq];for(const n in l.records.branches){if(l.records.branches.get(n)===e.id){a.push(n)}}s.Rm.debug(a.join(" "));if(e.parents&&e.parents.length==2&&e.parents[0]&&e.parents[1]){const r=l.records.commits.get(e.parents[0]);B(t,e,r);if(e.parents[1]){t.push(l.records.commits.get(e.parents[1]))}}else if(e.parents.length==0){return}else{if(e.parents[0]){const r=l.records.commits.get(e.parents[0]);B(t,e,r)}}t=p(t,(t=>t.id));E(t)}(0,s.K2)(E,"prettyPrintCommitHistory");var C=(0,s.K2)((function(){s.Rm.debug(l.records.commits);const t=R()[0];E([t])}),"prettyPrint");var k=(0,s.K2)((function(){l.reset();(0,s.IU)()}),"clear");var L=(0,s.K2)((function(){const t=[...l.records.branchConfig.values()].map(((t,e)=>{if(t.order!==null&&t.order!==void 0){return t}return{...t,order:parseFloat(`0.${e}`)}})).sort(((t,e)=>(t.order??0)-(e.order??0))).map((({name:t})=>({name:t})));return t}),"getBranchesAsObjArray");var T=(0,s.K2)((function(){return l.records.branches}),"getBranches");var M=(0,s.K2)((function(){return l.records.commits}),"getCommits");var R=(0,s.K2)((function(){const t=[...l.records.commits.values()];t.forEach((function(t){s.Rm.debug(t.id)}));t.sort(((t,e)=>t.seq-e.seq));return t}),"getCommitsArray");var K=(0,s.K2)((function(){return l.records.currBranch}),"getCurrentBranch");var O=(0,s.K2)((function(){return l.records.direction}),"getDirection");var P=(0,s.K2)((function(){return l.records.head}),"getHead");var A={commitType:m,getConfig:h,setDirection:f,setOptions:$,getOptions:y,commit:x,branch:u,merge:b,cherryPick:w,checkout:v,prettyPrint:C,clear:k,getBranchesAsObjArray:L,getBranches:T,getCommits:M,getCommitsArray:R,getCurrentBranch:K,getDirection:O,getHead:P,setAccTitle:s.SV,getAccTitle:s.iN,getAccDescription:s.m7,setAccDescription:s.EI,setDiagramTitle:s.ke,getDiagramTitle:s.ab};var q=(0,s.K2)(((t,e)=>{(0,a.S)(t,e);if(t.dir){e.setDirection(t.dir)}for(const r of t.statements){I(r,e)}}),"populate");var I=(0,s.K2)(((t,e)=>{const r={Commit:(0,s.K2)((t=>e.commit(G(t))),"Commit"),Branch:(0,s.K2)((t=>e.branch(W(t))),"Branch"),Merge:(0,s.K2)((t=>e.merge(H(t))),"Merge"),Checkout:(0,s.K2)((t=>e.checkout(D(t))),"Checkout"),CherryPicking:(0,s.K2)((t=>e.cherryPick(N(t))),"CherryPicking")};const a=r[t.$type];if(a){a(t)}else{s.Rm.error(`Unknown statement type: ${t.$type}`)}}),"parseStatement");var G=(0,s.K2)((t=>{const e={id:t.id,msg:t.message??"",type:t.type!==void 0?m[t.type]:m.NORMAL,tags:t.tags??void 0};return e}),"parseCommit");var W=(0,s.K2)((t=>{const e={name:t.name,order:t.order??0};return e}),"parseBranch");var H=(0,s.K2)((t=>{const e={branch:t.branch,id:t.id??"",type:t.type!==void 0?m[t.type]:void 0,tags:t.tags??void 0};return e}),"parseMerge");var D=(0,s.K2)((t=>{const e=t.branch;return e}),"parseCheckout");var N=(0,s.K2)((t=>{const e={id:t.id,targetId:"",tags:t.tags?.length===0?void 0:t.tags,parent:t.parent};return e}),"parseCherryPicking");var _={parse:(0,s.K2)((async t=>{const e=await(0,c.qg)("gitGraph",t);s.Rm.debug(e);q(e,A)}),"parse")};if(void 0){const{it:t,expect:e,describe:r}=void 0;const a={commitType:m,setDirection:vi.fn(),commit:vi.fn(),branch:vi.fn(),merge:vi.fn(),cherryPick:vi.fn(),checkout:vi.fn()};r("GitGraph Parser",(()=>{t("should parse a commit statement",(()=>{const t={$type:"Commit",id:"1",message:"test",tags:["tag1","tag2"],type:"NORMAL"};I(t,a);e(a.commit).toHaveBeenCalledWith({id:"1",msg:"test",tags:["tag1","tag2"],type:0})}));t("should parse a branch statement",(()=>{const t={$type:"Branch",name:"newBranch",order:1};I(t,a);e(a.branch).toHaveBeenCalledWith({name:"newBranch",order:1})}));t("should parse a checkout statement",(()=>{const t={$type:"Checkout",branch:"newBranch"};I(t,a);e(a.checkout).toHaveBeenCalledWith("newBranch")}));t("should parse a merge statement",(()=>{const t={$type:"Merge",branch:"newBranch",id:"1",tags:["tag1","tag2"],type:"NORMAL"};I(t,a);e(a.merge).toHaveBeenCalledWith({branch:"newBranch",id:"1",tags:["tag1","tag2"],type:0})}));t("should parse a cherry picking statement",(()=>{const t={$type:"CherryPicking",id:"1",tags:["tag1","tag2"],parent:"2"};I(t,a);e(a.cherryPick).toHaveBeenCalledWith({id:"1",targetId:"",parent:"2",tags:["tag1","tag2"]})}));t("should parse a langium generated gitGraph ast",(()=>{const t={$type:"GitGraph",statements:[]};const r={$type:"GitGraph",statements:[{$container:t,$type:"Commit",id:"1",message:"test",tags:["tag1","tag2"],type:"NORMAL"},{$container:t,$type:"Branch",name:"newBranch",order:1},{$container:t,$type:"Merge",branch:"newBranch",id:"1",tags:["tag1","tag2"],type:"NORMAL"},{$container:t,$type:"Checkout",branch:"newBranch"},{$container:t,$type:"CherryPicking",id:"1",tags:["tag1","tag2"],parent:"2"}]};q(r,a);e(a.commit).toHaveBeenCalledWith({id:"1",msg:"test",tags:["tag1","tag2"],type:0});e(a.branch).toHaveBeenCalledWith({name:"newBranch",order:1});e(a.merge).toHaveBeenCalledWith({branch:"newBranch",id:"1",tags:["tag1","tag2"],type:0});e(a.checkout).toHaveBeenCalledWith("newBranch")}))}))}var S=(0,s.D7)();var z=S?.gitGraph;var Y=10;var j=40;var Z=4;var F=2;var U=8;var V=new Map;var J=new Map;var Q=30;var X=new Map;var tt=[];var et=0;var rt="LR";var at=(0,s.K2)((()=>{V.clear();J.clear();X.clear();et=0;tt=[];rt="LR"}),"clear");var nt=(0,s.K2)((t=>{const e=document.createElementNS("http://www.w3.org/2000/svg","text");const r=typeof t==="string"?t.split(/\\n|\n|/gi):t;r.forEach((t=>{const r=document.createElementNS("http://www.w3.org/2000/svg","tspan");r.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve");r.setAttribute("dy","1em");r.setAttribute("x","0");r.setAttribute("class","row");r.textContent=t.trim();e.appendChild(r)}));return e}),"drawText");var ot=(0,s.K2)((t=>{let e;let r;let a;if(rt==="BT"){r=(0,s.K2)(((t,e)=>t<=e),"comparisonFunc");a=Infinity}else{r=(0,s.K2)(((t,e)=>t>=e),"comparisonFunc");a=0}t.forEach((t=>{const n=rt==="TB"||rt=="BT"?J.get(t)?.y:J.get(t)?.x;if(n!==void 0&&r(n,a)){e=t;a=n}}));return e}),"findClosestParent");var st=(0,s.K2)((t=>{let e="";let r=Infinity;t.forEach((t=>{const a=J.get(t).y;if(a<=r){e=t;r=a}}));return e||void 0}),"findClosestParentBT");var ct=(0,s.K2)(((t,e,r)=>{let a=r;let n=r;const o=[];t.forEach((t=>{const r=e.get(t);if(!r){throw new Error(`Commit not found for key ${t}`)}if(r.parents.length){a=mt(r);n=Math.max(a,n)}else{o.push(r)}dt(r,a)}));a=n;o.forEach((t=>{ht(t,a,r)}));t.forEach((t=>{const r=e.get(t);if(r?.parents.length){const t=st(r.parents);a=J.get(t).y-j;if(a<=n){n=a}const e=V.get(r.branch).pos;const o=a-Y;J.set(r.id,{x:e,y:o})}}))}),"setParallelBTPos");var it=(0,s.K2)((t=>{const e=ot(t.parents.filter((t=>t!==null)));if(!e){throw new Error(`Closest parent not found for commit ${t.id}`)}const r=J.get(e)?.y;if(r===void 0){throw new Error(`Closest parent position not found for commit ${t.id}`)}return r}),"findClosestParentPos");var mt=(0,s.K2)((t=>{const e=it(t);return e+j}),"calculateCommitPosition");var dt=(0,s.K2)(((t,e)=>{const r=V.get(t.branch);if(!r){throw new Error(`Branch not found for commit ${t.id}`)}const a=r.pos;const n=e+Y;J.set(t.id,{x:a,y:n});return{x:a,y:n}}),"setCommitPosition");var ht=(0,s.K2)(((t,e,r)=>{const a=V.get(t.branch);if(!a){throw new Error(`Branch not found for commit ${t.id}`)}const n=e+r;const o=a.pos;J.set(t.id,{x:o,y:n})}),"setRootPosition");var lt=(0,s.K2)(((t,e,r,a,n,o)=>{if(o===m.HIGHLIGHT){t.append("rect").attr("x",r.x-10).attr("y",r.y-10).attr("width",20).attr("height",20).attr("class",`commit ${e.id} commit-highlight${n%U} ${a}-outer`);t.append("rect").attr("x",r.x-6).attr("y",r.y-6).attr("width",12).attr("height",12).attr("class",`commit ${e.id} commit${n%U} ${a}-inner`)}else if(o===m.CHERRY_PICK){t.append("circle").attr("cx",r.x).attr("cy",r.y).attr("r",10).attr("class",`commit ${e.id} ${a}`);t.append("circle").attr("cx",r.x-3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${a}`);t.append("circle").attr("cx",r.x+3).attr("cy",r.y+2).attr("r",2.75).attr("fill","#fff").attr("class",`commit ${e.id} ${a}`);t.append("line").attr("x1",r.x+3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${a}`);t.append("line").attr("x1",r.x-3).attr("y1",r.y+1).attr("x2",r.x).attr("y2",r.y-5).attr("stroke","#fff").attr("class",`commit ${e.id} ${a}`)}else{const s=t.append("circle");s.attr("cx",r.x);s.attr("cy",r.y);s.attr("r",e.type===m.MERGE?9:10);s.attr("class",`commit ${e.id} commit${n%U}`);if(o===m.MERGE){const o=t.append("circle");o.attr("cx",r.x);o.attr("cy",r.y);o.attr("r",6);o.attr("class",`commit ${a} ${e.id} commit${n%U}`)}if(o===m.REVERSE){const o=t.append("path");o.attr("d",`M ${r.x-5},${r.y-5}L${r.x+5},${r.y+5}M${r.x-5},${r.y+5}L${r.x+5},${r.y-5}`).attr("class",`commit ${a} ${e.id} commit${n%U}`)}}}),"drawCommitBullet");var gt=(0,s.K2)(((t,e,r,a)=>{if(e.type!==m.CHERRY_PICK&&(e.customId&&e.type===m.MERGE||e.type!==m.MERGE)&&z?.showCommitLabel){const n=t.append("g");const o=n.insert("rect").attr("class","commit-label-bkg");const s=n.append("text").attr("x",a).attr("y",r.y+25).attr("class","commit-label").text(e.id);const c=s.node()?.getBBox();if(c){o.attr("x",r.posWithOffset-c.width/2-F).attr("y",r.y+13.5).attr("width",c.width+2*F).attr("height",c.height+2*F);if(rt==="TB"||rt==="BT"){o.attr("x",r.x-(c.width+4*Z+5)).attr("y",r.y-12);s.attr("x",r.x-(c.width+4*Z)).attr("y",r.y+c.height-12)}else{s.attr("x",r.posWithOffset-c.width/2)}if(z.rotateCommitLabel){if(rt==="TB"||rt==="BT"){s.attr("transform","rotate(-45, "+r.x+", "+r.y+")");o.attr("transform","rotate(-45, "+r.x+", "+r.y+")")}else{const t=-7.5-(c.width+10)/25*9.5;const e=10+c.width/25*8.5;n.attr("transform","translate("+t+", "+e+") rotate(-45, "+a+", "+r.y+")")}}}}}),"drawCommitLabel");var pt=(0,s.K2)(((t,e,r,a)=>{if(e.tags.length>0){let n=0;let o=0;let s=0;const c=[];for(const a of e.tags.reverse()){const e=t.insert("polygon");const i=t.append("circle");const m=t.append("text").attr("y",r.y-16-n).attr("class","tag-label").text(a);const d=m.node()?.getBBox();if(!d){throw new Error("Tag bbox not found")}o=Math.max(o,d.width);s=Math.max(s,d.height);m.attr("x",r.posWithOffset-d.width/2);c.push({tag:m,hole:i,rect:e,yOffset:n});n+=20}for(const{tag:t,hole:e,rect:i,yOffset:m}of c){const n=s/2;const c=r.y-19.2-m;i.attr("class","tag-label-bkg").attr("points",`\n ${a-o/2-Z/2},${c+F} \n ${a-o/2-Z/2},${c-F}\n ${r.posWithOffset-o/2-Z},${c-n-F}\n ${r.posWithOffset+o/2+Z},${c-n-F}\n ${r.posWithOffset+o/2+Z},${c+n+F}\n ${r.posWithOffset-o/2-Z},${c+n+F}`);e.attr("cy",c).attr("cx",a-o/2+Z/2).attr("r",1.5).attr("class","tag-hole");if(rt==="TB"||rt==="BT"){const s=a+m;i.attr("class","tag-label-bkg").attr("points",`\n ${r.x},${s+2}\n ${r.x},${s-2}\n ${r.x+Y},${s-n-2}\n ${r.x+Y+o+4},${s-n-2}\n ${r.x+Y+o+4},${s+n+2}\n ${r.x+Y},${s+n+2}`).attr("transform","translate(12,12) rotate(45, "+r.x+","+a+")");e.attr("cx",r.x+Z/2).attr("cy",s).attr("transform","translate(12,12) rotate(45, "+r.x+","+a+")");t.attr("x",r.x+5).attr("y",s+3).attr("transform","translate(14,14) rotate(45, "+r.x+","+a+")")}}}}),"drawCommitTags");var ft=(0,s.K2)((t=>{const e=t.customType??t.type;switch(e){case m.NORMAL:return"commit-normal";case m.REVERSE:return"commit-reverse";case m.HIGHLIGHT:return"commit-highlight";case m.MERGE:return"commit-merge";case m.CHERRY_PICK:return"commit-cherry-pick";default:return"commit-normal"}}),"getCommitClassType");var $t=(0,s.K2)(((t,e,r,a)=>{const n={x:0,y:0};if(t.parents.length>0){const r=ot(t.parents);if(r){const o=a.get(r)??n;if(e==="TB"){return o.y+j}else if(e==="BT"){const e=a.get(t.id)??n;return e.y-j}else{return o.x+j}}}else{if(e==="TB"){return Q}else if(e==="BT"){const e=a.get(t.id)??n;return e.y-j}else{return 0}}return 0}),"calculatePosition");var yt=(0,s.K2)(((t,e,r)=>{const a=rt==="BT"&&r?e:e+Y;const n=rt==="TB"||rt==="BT"?a:V.get(t.branch)?.pos;const o=rt==="TB"||rt==="BT"?V.get(t.branch)?.pos:a;if(o===void 0||n===void 0){throw new Error(`Position were undefined for commit ${t.id}`)}return{x:o,y:n,posWithOffset:a}}),"getCommitPosition");var xt=(0,s.K2)(((t,e,r)=>{if(!z){throw new Error("GitGraph config not found")}const a=t.append("g").attr("class","commit-bullets");const n=t.append("g").attr("class","commit-labels");let o=rt==="TB"||rt==="BT"?Q:0;const c=[...e.keys()];const i=z?.parallelCommits??false;const m=(0,s.K2)(((t,r)=>{const a=e.get(t)?.seq;const n=e.get(r)?.seq;return a!==void 0&&n!==void 0?a-n:0}),"sortKeys");let d=c.sort(m);if(rt==="BT"){if(i){ct(d,e,o)}d=d.reverse()}d.forEach((t=>{const s=e.get(t);if(!s){throw new Error(`Commit not found for key ${t}`)}if(i){o=$t(s,rt,o,J)}const c=yt(s,o,i);if(r){const t=ft(s);const e=s.customType??s.type;const r=V.get(s.branch)?.index??0;lt(a,s,c,t,r,e);gt(n,s,c,o);pt(n,s,c,o)}if(rt==="TB"||rt==="BT"){J.set(s.id,{x:c.x,y:c.posWithOffset})}else{J.set(s.id,{x:c.posWithOffset,y:c.y})}o=rt==="BT"&&i?o+j:o+j+Y;if(o>et){et=o}}))}),"drawCommits");var ut=(0,s.K2)(((t,e,r,a,n)=>{const o=rt==="TB"||rt==="BT"?r.xt.branch===c),"isOnBranchToGetCurve");const m=(0,s.K2)((r=>r.seq>t.seq&&r.seqm(t)&&i(t)))}),"shouldRerouteArrow");var bt=(0,s.K2)(((t,e,r=0)=>{const a=t+Math.abs(t-e)/2;if(r>5){return a}const n=tt.every((t=>Math.abs(t-a)>=10));if(n){tt.push(a);return a}const o=Math.abs(t-e);return bt(t,e-o/5,r+1)}),"findLane");var wt=(0,s.K2)(((t,e,r,a)=>{const n=J.get(e.id);const o=J.get(r.id);if(n===void 0||o===void 0){throw new Error(`Commit positions not found for commits ${e.id} and ${r.id}`)}const s=ut(e,r,n,o,a);let c="";let i="";let d=0;let h=0;let l=V.get(r.branch)?.index;if(r.type===m.MERGE&&e.id!==r.parents[0]){l=V.get(e.branch)?.index}let g;if(s){c="A 10 10, 0, 0, 0,";i="A 10 10, 0, 0, 1,";d=10;h=10;const t=n.yo.x){c="A 20 20, 0, 0, 0,";i="A 20 20, 0, 0, 1,";d=20;h=20;if(r.type===m.MERGE&&e.id!==r.parents[0]){g=`M ${n.x} ${n.y} L ${n.x} ${o.y-d} ${i} ${n.x-h} ${o.y} L ${o.x} ${o.y}`}else{g=`M ${n.x} ${n.y} L ${o.x+d} ${n.y} ${c} ${o.x} ${n.y+h} L ${o.x} ${o.y}`}}if(n.x===o.x){g=`M ${n.x} ${n.y} L ${o.x} ${o.y}`}}else if(rt==="BT"){if(n.xo.x){c="A 20 20, 0, 0, 0,";i="A 20 20, 0, 0, 1,";d=20;h=20;if(r.type===m.MERGE&&e.id!==r.parents[0]){g=`M ${n.x} ${n.y} L ${n.x} ${o.y+d} ${c} ${n.x-h} ${o.y} L ${o.x} ${o.y}`}else{g=`M ${n.x} ${n.y} L ${o.x-d} ${n.y} ${c} ${o.x} ${n.y-h} L ${o.x} ${o.y}`}}if(n.x===o.x){g=`M ${n.x} ${n.y} L ${o.x} ${o.y}`}}else{if(n.yo.y){if(r.type===m.MERGE&&e.id!==r.parents[0]){g=`M ${n.x} ${n.y} L ${o.x-d} ${n.y} ${c} ${o.x} ${n.y-h} L ${o.x} ${o.y}`}else{g=`M ${n.x} ${n.y} L ${n.x} ${o.y+d} ${i} ${n.x+h} ${o.y} L ${o.x} ${o.y}`}}if(n.y===o.y){g=`M ${n.x} ${n.y} L ${o.x} ${o.y}`}}}if(g===void 0){throw new Error("Line definition not found")}t.append("path").attr("d",g).attr("class","arrow arrow"+l%U)}),"drawArrow");var vt=(0,s.K2)(((t,e)=>{const r=t.append("g").attr("class","commit-arrows");[...e.keys()].forEach((t=>{const a=e.get(t);if(a.parents&&a.parents.length>0){a.parents.forEach((t=>{wt(r,e.get(t),a,e)}))}}))}),"drawArrows");var Bt=(0,s.K2)(((t,e)=>{const r=t.append("g");e.forEach(((t,e)=>{const a=e%U;const n=V.get(t.name)?.pos;if(n===void 0){throw new Error(`Position not found for branch ${t.name}`)}const o=r.append("line");o.attr("x1",0);o.attr("y1",n);o.attr("x2",et);o.attr("y2",n);o.attr("class","branch branch"+a);if(rt==="TB"){o.attr("y1",Q);o.attr("x1",n);o.attr("y2",et);o.attr("x2",n)}else if(rt==="BT"){o.attr("y1",et);o.attr("x1",n);o.attr("y2",Q);o.attr("x2",n)}tt.push(n);const s=t.name;const c=nt(s);const i=r.insert("rect");const m=r.insert("g").attr("class","branchLabel");const d=m.insert("g").attr("class","label branch-label"+a);d.node().appendChild(c);const h=c.getBBox();i.attr("class","branchLabelBkg label"+a).attr("rx",4).attr("ry",4).attr("x",-h.width-4-(z?.rotateCommitLabel===true?30:0)).attr("y",-h.height/2+8).attr("width",h.width+18).attr("height",h.height+4);d.attr("transform","translate("+(-h.width-14-(z?.rotateCommitLabel===true?30:0))+", "+(n-h.height/2-1)+")");if(rt==="TB"){i.attr("x",n-h.width/2-10).attr("y",0);d.attr("transform","translate("+(n-h.width/2-5)+", 0)")}else if(rt==="BT"){i.attr("x",n-h.width/2-10).attr("y",et);d.attr("transform","translate("+(n-h.width/2-5)+", "+et+")")}else{i.attr("transform","translate(-19, "+(n-h.height/2)+")")}}))}),"drawBranches");var Et=(0,s.K2)((function(t,e,r,a,n){V.set(t,{pos:e,index:r});e+=50+(n?40:0)+(rt==="TB"||rt==="BT"?a.width/2:0);return e}),"setBranchPosition");var Ct=(0,s.K2)((function(t,e,r,a){at();s.Rm.debug("in gitgraph renderer",t+"\n","id:",e,r);if(!z){throw new Error("GitGraph config not found")}const n=z.rotateCommitLabel??false;const c=a.db;X=c.getCommits();const m=c.getBranchesAsObjArray();rt=c.getDirection();const d=(0,i.Ltv)(`[id="${e}"]`);let h=0;m.forEach(((t,e)=>{const r=nt(t.name);const a=d.append("g");const o=a.insert("g").attr("class","branchLabel");const s=o.insert("g").attr("class","label branch-label");s.node()?.appendChild(r);const c=r.getBBox();h=Et(t.name,h,e,c,n);s.remove();o.remove();a.remove()}));xt(d,X,false);if(z.showBranches){Bt(d,m)}vt(d,X);xt(d,X,true);o._K.insertTitle(d,"gitTitleText",z.titleTopMargin??0,c.getDiagramTitle());(0,s.mj)(void 0,d,z.diagramPadding,z.useMaxWidth)}),"draw");var kt={draw:Ct};if(void 0){const{it:t,expect:e,describe:r}=void 0;r("drawText",(()=>{t("should drawText",(()=>{const t=nt("main");e(t).toBeDefined();e(t.children[0].innerHTML).toBe("main")}))}));r("branchPosition",(()=>{const r={x:0,y:0,width:10,height:10,top:0,right:0,bottom:0,left:0,toJSON:(0,s.K2)((()=>""),"toJSON")};t("should setBranchPositions LR with two branches",(()=>{rt="LR";const t=Et("main",0,0,r,true);e(t).toBe(90);e(V.get("main")).toEqual({pos:0,index:0});const a=Et("develop",t,1,r,true);e(a).toBe(180);e(V.get("develop")).toEqual({pos:t,index:1})}));t("should setBranchPositions TB with two branches",(()=>{rt="TB";r.width=34.9921875;const t=Et("main",0,0,r,true);e(t).toBe(107.49609375);e(V.get("main")).toEqual({pos:0,index:0});r.width=56.421875;const a=Et("develop",t,1,r,true);e(a).toBe(225.70703125);e(V.get("develop")).toEqual({pos:t,index:1})}))}));r("commitPosition",(()=>{const a=new Map([["commitZero",{id:"ZERO",message:"",seq:0,type:m.NORMAL,tags:[],parents:[],branch:"main"}],["commitA",{id:"A",message:"",seq:1,type:m.NORMAL,tags:[],parents:["ZERO"],branch:"feature"}],["commitB",{id:"B",message:"",seq:2,type:m.NORMAL,tags:[],parents:["A"],branch:"feature"}],["commitM",{id:"M",message:"merged branch feature into main",seq:3,type:m.MERGE,tags:[],parents:["ZERO","B"],branch:"main",customId:true}],["commitC",{id:"C",message:"",seq:4,type:m.NORMAL,tags:[],parents:["ZERO"],branch:"release"}],["commit5_8928ea0",{id:"5-8928ea0",message:"cherry-picked [object Object] into release",seq:5,type:m.CHERRY_PICK,tags:[],parents:["C","M"],branch:"release"}],["commitD",{id:"D",message:"",seq:6,type:m.NORMAL,tags:[],parents:["5-8928ea0"],branch:"release"}],["commit7_ed848ba",{id:"7-ed848ba",message:"cherry-picked [object Object] into release",seq:7,type:m.CHERRY_PICK,tags:[],parents:["D","M"],branch:"release"}]]);let n=0;V.set("main",{pos:0,index:0});V.set("feature",{pos:107.49609375,index:1});V.set("release",{pos:224.03515625,index:2});r("TB",(()=>{n=30;rt="TB";const r=new Map([["commitZero",{x:0,y:40,posWithOffset:40}],["commitA",{x:107.49609375,y:90,posWithOffset:90}],["commitB",{x:107.49609375,y:140,posWithOffset:140}],["commitM",{x:0,y:190,posWithOffset:190}],["commitC",{x:224.03515625,y:240,posWithOffset:240}],["commit5_8928ea0",{x:224.03515625,y:290,posWithOffset:290}],["commitD",{x:224.03515625,y:340,posWithOffset:340}],["commit7_ed848ba",{x:224.03515625,y:390,posWithOffset:390}]]);a.forEach(((a,o)=>{t(`should give the correct position for commit ${o}`,(()=>{const t=yt(a,n,false);e(t).toEqual(r.get(o));n+=50}))}))}));r("LR",(()=>{let r=30;rt="LR";const n=new Map([["commitZero",{x:0,y:40,posWithOffset:40}],["commitA",{x:107.49609375,y:90,posWithOffset:90}],["commitB",{x:107.49609375,y:140,posWithOffset:140}],["commitM",{x:0,y:190,posWithOffset:190}],["commitC",{x:224.03515625,y:240,posWithOffset:240}],["commit5_8928ea0",{x:224.03515625,y:290,posWithOffset:290}],["commitD",{x:224.03515625,y:340,posWithOffset:340}],["commit7_ed848ba",{x:224.03515625,y:390,posWithOffset:390}]]);a.forEach(((a,o)=>{t(`should give the correct position for commit ${o}`,(()=>{const t=yt(a,r,false);e(t).toEqual(n.get(o));r+=50}))}))}));r("getCommitClassType",(()=>{const r=new Map([["commitZero","commit-normal"],["commitA","commit-normal"],["commitB","commit-normal"],["commitM","commit-merge"],["commitC","commit-normal"],["commit5_8928ea0","commit-cherry-pick"],["commitD","commit-normal"],["commit7_ed848ba","commit-cherry-pick"]]);a.forEach(((a,n)=>{t(`should give the correct class type for commit ${n}`,(()=>{const t=ft(a);e(t).toBe(r.get(n))}))}))}))}));r("building BT parallel commit diagram",(()=>{const r=new Map([["1-abcdefg",{id:"1-abcdefg",message:"",seq:0,type:0,tags:[],parents:[],branch:"main"}],["2-abcdefg",{id:"2-abcdefg",message:"",seq:1,type:0,tags:[],parents:["1-abcdefg"],branch:"main"}],["3-abcdefg",{id:"3-abcdefg",message:"",seq:2,type:0,tags:[],parents:["2-abcdefg"],branch:"develop"}],["4-abcdefg",{id:"4-abcdefg",message:"",seq:3,type:0,tags:[],parents:["3-abcdefg"],branch:"develop"}],["5-abcdefg",{id:"5-abcdefg",message:"",seq:4,type:0,tags:[],parents:["2-abcdefg"],branch:"feature"}],["6-abcdefg",{id:"6-abcdefg",message:"",seq:5,type:0,tags:[],parents:["5-abcdefg"],branch:"feature"}],["7-abcdefg",{id:"7-abcdefg",message:"",seq:6,type:0,tags:[],parents:["2-abcdefg"],branch:"main"}],["8-abcdefg",{id:"8-abcdefg",message:"",seq:7,type:0,tags:[],parents:["7-abcdefg"],branch:"main"}]]);const a=new Map([["1-abcdefg",{x:0,y:40}],["2-abcdefg",{x:0,y:90}],["3-abcdefg",{x:107.49609375,y:140}],["4-abcdefg",{x:107.49609375,y:190}],["5-abcdefg",{x:225.70703125,y:140}],["6-abcdefg",{x:225.70703125,y:190}],["7-abcdefg",{x:0,y:140}],["8-abcdefg",{x:0,y:190}]]);const n=new Map([["1-abcdefg",{x:0,y:210}],["2-abcdefg",{x:0,y:160}],["3-abcdefg",{x:107.49609375,y:110}],["4-abcdefg",{x:107.49609375,y:60}],["5-abcdefg",{x:225.70703125,y:110}],["6-abcdefg",{x:225.70703125,y:60}],["7-abcdefg",{x:0,y:110}],["8-abcdefg",{x:0,y:60}]]);const o=new Map([["1-abcdefg",30],["2-abcdefg",80],["3-abcdefg",130],["4-abcdefg",180],["5-abcdefg",130],["6-abcdefg",180],["7-abcdefg",130],["8-abcdefg",180]]);const s=[...a.keys()];t("should get the correct commit position and current position",(()=>{rt="BT";let t=30;J.clear();V.clear();V.set("main",{pos:0,index:0});V.set("develop",{pos:107.49609375,index:1});V.set("feature",{pos:225.70703125,index:2});z.parallelCommits=true;r.forEach(((r,n)=>{if(r.parents.length>0){t=mt(r)}const s=dt(r,t);e(s).toEqual(a.get(n));e(t).toEqual(o.get(n))}))}));t("should get the correct commit position after parallel commits",(()=>{J.clear();V.clear();rt="BT";const t=30;J.clear();V.clear();V.set("main",{pos:0,index:0});V.set("develop",{pos:107.49609375,index:1});V.set("feature",{pos:225.70703125,index:2});ct(s,r,t);s.forEach((t=>{const r=J.get(t);e(r).toEqual(n.get(t))}))}))}));z.parallelCommits=false;t("add",(()=>{J.set("parent1",{x:1,y:1});J.set("parent2",{x:2,y:2});J.set("parent3",{x:3,y:3});rt="LR";const t=["parent1","parent2","parent3"];const r=ot(t);e(r).toBe("parent3");J.clear()}))}var Lt=(0,s.K2)((t=>`\n .commit-id,\n .commit-msg,\n .branch-label {\n fill: lightgrey;\n color: lightgrey;\n font-family: 'trebuchet ms', verdana, arial, sans-serif;\n font-family: var(--mermaid-font-family);\n }\n ${[0,1,2,3,4,5,6,7].map((e=>`\n .branch-label${e} { fill: ${t["gitBranchLabel"+e]}; }\n .commit${e} { stroke: ${t["git"+e]}; fill: ${t["git"+e]}; }\n .commit-highlight${e} { stroke: ${t["gitInv"+e]}; fill: ${t["gitInv"+e]}; }\n .label${e} { fill: ${t["git"+e]}; }\n .arrow${e} { stroke: ${t["git"+e]}; }\n `)).join("\n")}\n\n .branch {\n stroke-width: 1;\n stroke: ${t.lineColor};\n stroke-dasharray: 2;\n }\n .commit-label { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelColor};}\n .commit-label-bkg { font-size: ${t.commitLabelFontSize}; fill: ${t.commitLabelBackground}; opacity: 0.5; }\n .tag-label { font-size: ${t.tagLabelFontSize}; fill: ${t.tagLabelColor};}\n .tag-label-bkg { fill: ${t.tagLabelBackground}; stroke: ${t.tagLabelBorder}; }\n .tag-hole { fill: ${t.textColor}; }\n\n .commit-merge {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n .commit-reverse {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n stroke-width: 3;\n }\n .commit-highlight-outer {\n }\n .commit-highlight-inner {\n stroke: ${t.primaryColor};\n fill: ${t.primaryColor};\n }\n\n .arrow { stroke-width: 8; stroke-linecap: round; fill: none}\n .gitTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n }\n`),"getStyles");var Tt=Lt;var Mt={parser:_,db:A,renderer:kt,styles:Tt}}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9892.6d289e7baed8c64d88e2.js b/.venv/share/jupyter/lab/static/9892.6d289e7baed8c64d88e2.js new file mode 100644 index 0000000000000000000000000000000000000000..a4f37cceddb3da50abf365d55550002e3281c5ed --- /dev/null +++ b/.venv/share/jupyter/lab/static/9892.6d289e7baed8c64d88e2.js @@ -0,0 +1,2 @@ +/*! For license information please see 9892.6d289e7baed8c64d88e2.js.LICENSE.txt */ +"use strict";(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[9892],{58488:u=>{const e={mode:"lazy"};u.exports=e},9128:(u,e,r)=>{const d=r(58488);const a=r(62545);const t=r(34999);const n=new WeakMap;function f(u){return d.mode==="spec-compliant"?c(this,u):i(this,u)}function i(u,e){const r=u.lastIndex;const d=a.call(u,e);if(d===null)return null;let t;Object.defineProperty(d,"indices",{enumerable:true,configurable:true,get(){if(t===undefined){const{measurementRegExp:n,groupInfos:f}=o(u);n.lastIndex=r;const i=a.call(n,e);if(i===null)throw new TypeError;l(d,"indices",t=s(i,f))}return t},set(u){l(d,"indices",u)}});return d}function c(u,e){const{measurementRegExp:r,groupInfos:d}=o(u);r.lastIndex=u.lastIndex;const t=a.call(r,e);if(t===null)return null;u.lastIndex=r.lastIndex;const n=[];l(n,0,t[0]);for(const a of d){l(n,a.oldGroupNumber,t[a.newGroupNumber])}l(n,"index",t.index);l(n,"input",t.input);l(n,"groups",t.groups);l(n,"indices",s(t,d));return n}function o(u){let e=n.get(u);if(!e){e=T(t.parse(`/${u.source}/${u.flags}`));n.set(u,e)}const r=e.getExtra();const d=e.toRegExp();return{measurementRegExp:d,groupInfos:r}}function s(u,e){const r=u.index;const d=r+u[0].length;const a=!!u.groups;const t=[];const n=a?Object.create(null):undefined;l(t,0,[r,d]);for(const f of e){let e;if(u[f.newGroupNumber]!==undefined){let d=r;if(f.measurementGroups){for(const e of f.measurementGroups){d+=u[e].length}}const a=d+u[f.newGroupNumber].length;e=[d,a]}l(t,f.oldGroupNumber,e);if(n&&f.groupName!==undefined){l(n,f.groupName,e)}}l(t,"groups",n);return t}function l(u,e,r){const d=Object.getOwnPropertyDescriptor(u,e);if(d?d.configurable:Object.isExtensible(u)){const a={enumerable:d?d.enumerable:true,configurable:d?d.configurable:true,writable:true,value:r};Object.defineProperty(u,e,a)}}let b;let p=false;let h=new Set;let v=[];let g=false;let y=1;let m=[];let _=new Map;let C=new Map;const S={init(){p=false;h.clear();v.length=0;g=false;y=1;m.length=0;_.clear();C.clear();b=[]},RegExp(u){t.traverse(u.node,A);if(h.size>0){t.transform(u.node,k);t.transform(u.node,P);if(p){t.transform(u.node,w)}}return false}};const x={pre(u){v.push(g);g=u.node.type==="Group"&&u.node.capturing},post(u){if(g){h.add(u.node)}g=v.pop()||g}};const A={Alternative:x,Disjunction:x,Assertion:x,Group:x,Repetition:x,Backreference(u){p=true}};const k={Alternative(u){if(h.has(u.node)){let e=0;let r=[];const d=[];const a=[];for(let n=0;ne){const u={type:"Group",capturing:true,number:-1,expression:r.length>1?{type:"Alternative",expressions:r}:r.length===1?r[0]:null};a.push(u);d.push(u);e=n;r=[]}m.push(d);t.transform(f,k);m.pop();r.push(f);continue}r.push(f)}u.update({expressions:a.concat(r)})}return false},Group(u){if(!u.node.capturing)return;_.set(u.node,E())}};const P={Group(u){if(!b)throw new Error("Not initialized.");if(!u.node.capturing)return;const e=u.node.number;const r=y++;const d=_.get(u.node);if(e!==-1){b.push({oldGroupNumber:e,newGroupNumber:r,measurementGroups:d&&d.map((u=>u.number)),groupName:u.node.name});C.set(e,r)}u.update({number:r})}};const w={Backreference(u){const e=C.get(u.node.number);if(e){if(u.node.kind==="number"){u.update({number:e,reference:e})}else{u.update({number:e})}}}};function E(){const u=[];for(const e of m){for(const r of e){u.push(r)}}return u}function T(u){const e=t.transform(u,S);return new t.TransformResult(e.getAST(),b)}u.exports=f},9892:(u,e,r)=>{const d=r(9128);const a=r(62545);const t=r(93581);const n=r(74443);const f=r(58488);const i=t();function c(u,e){return i.call(u,e)}c.implementation=d;c.native=a;c.getPolyfill=t;c.shim=n;c.config=f;(function(u){})(c||(c={}));u.exports=c},62545:u=>{const e=RegExp.prototype.exec;u.exports=e},93581:(u,e,r)=>{const d=r(62545);const a=r(9128);function t(){const u=new RegExp("a");const e=d.call(u,"a");if(e.indices){return d}return a}u.exports=t},74443:(u,e,r)=>{const d=r(93581);function a(){const u=d();if(RegExp.prototype.exec!==u){RegExp.prototype.exec=u}}u.exports=a},9182:(u,e,r)=>{var d=r(43034);var a=r(2003);u.exports={transform:function u(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:[];var t=r.length>0?r:Object.keys(d);var n=void 0;var f={};t.forEach((function(u){if(!d.hasOwnProperty(u)){throw new Error("Unknown compat-transform: "+u+". "+"Available transforms are: "+Object.keys(d).join(", "))}var r=d[u];n=a.transform(e,r);e=n.getAST();if(typeof r.getExtra==="function"){f[u]=r.getExtra()}}));n.setExtra(f);return n}}},51537:u=>{var e=function(){function u(u,e){for(var r=0;r{u.exports={_hasUFlag:false,shouldRun:function u(e){var u=e.flags.includes("s");if(!u){return false}e.flags=e.flags.replace("s","");this._hasUFlag=e.flags.includes("u");return true},Char:function u(e){var r=e.node;if(r.kind!=="meta"||r.value!=="."){return}var d="\\uFFFF";var a="￿";if(this._hasUFlag){d="\\u{10FFFF}";a="􏿿"}e.replace({type:"CharacterClass",expressions:[{type:"ClassRange",from:{type:"Char",value:"\\0",kind:"decimal",symbol:"\0"},to:{type:"Char",value:d,kind:"unicode",symbol:a}}]})}}},62514:u=>{u.exports={_groupNames:{},init:function u(){this._groupNames={}},getExtra:function u(){return this._groupNames},Group:function u(e){var r=e.node;if(!r.name){return}this._groupNames[r.name]=r.number;delete r.name;delete r.nameRaw},Backreference:function u(e){var r=e.node;if(r.kind!=="name"){return}r.kind="number";r.reference=r.number;delete r.referenceRaw}}},57559:u=>{u.exports={RegExp:function u(e){var r=e.node;if(r.flags.includes("x")){r.flags=r.flags.replace("x","")}}}},43034:(u,e,r)=>{u.exports={dotAll:r(45640),namedCapturingGroups:r(62514),xFlag:r(57559)}},20042:u=>{function e(u){return u?r[u.type](u):""}var r={RegExp:function u(r){return"/"+e(r.body)+"/"+r.flags},Alternative:function u(r){return(r.expressions||[]).map(e).join("")},Disjunction:function u(r){return e(r.left)+"|"+e(r.right)},Group:function u(r){var d=e(r.expression);if(r.capturing){if(r.name){return"(?<"+(r.nameRaw||r.name)+">"+d+")"}return"("+d+")"}return"(?:"+d+")"},Backreference:function u(e){switch(e.kind){case"number":return"\\"+e.reference;case"name":return"\\k<"+(e.referenceRaw||e.reference)+">";default:throw new TypeError("Unknown Backreference kind: "+e.kind)}},Assertion:function u(r){switch(r.kind){case"^":case"$":case"\\b":case"\\B":return r.kind;case"Lookahead":{var d=e(r.assertion);if(r.negative){return"(?!"+d+")"}return"(?="+d+")"}case"Lookbehind":{var a=e(r.assertion);if(r.negative){return"(?{var e=function(){function u(u,e){var r=[];var d=true;var a=false;var t=undefined;try{for(var n=u[Symbol.iterator](),f;!(d=(f=n.next()).done);d=true){r.push(f.value);if(e&&r.length===e)break}}catch(i){a=true;t=i}finally{try{if(!d&&n["return"])n["return"]()}finally{if(a)throw t}}return r}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return u(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function r(u){return Array.isArray(u)?u:Array.from(u)}function d(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e0}))];var b=void 0;var p=void 0;b=l[l.length-1];p=l[l.length-2];var h=function u(){var e={};var n=true;var i=false;var o=undefined;try{for(var s=b[Symbol.iterator](),h;!(n=(h=s.next()).done);n=true){var v=h.value;var g={};var y=r(v),m=y[0],_=y.slice(1);g[m]=new Set([m]);var C=true;var S=false;var x=undefined;try{u:for(var A=_[Symbol.iterator](),k;!(C=(k=A.next()).done);C=true){var P=k.value;var w=true;var E=false;var T=undefined;try{for(var O=Object.keys(g)[Symbol.iterator](),R;!(w=(R=O.next()).done);w=true){var N=R.value;if(f(P,N,t,c)){g[N].add(P);g[P]=g[N];continue u}}}catch(I){E=true;T=I}finally{try{if(!w&&O.return){O.return()}}finally{if(E){throw T}}}g[P]=new Set([P])}}catch(I){S=true;x=I}finally{try{if(!C&&A.return){A.return()}}finally{if(S){throw x}}}Object.assign(e,g)}}catch(I){i=true;o=I}finally{try{if(!n&&s.return){s.return()}}finally{if(i){throw o}}}a=e;var L=new Set(Object.keys(e).map((function(u){return e[u]})));l.push([].concat(d(L)));b=l[l.length-1];p=l[l.length-2]};while(!n(b,p)){h()}var v=new Map;var g=1;b.forEach((function(u){return v.set(u,g++)}));var y={};var m=new Set;var _=function u(e,r){var d=true;var a=false;var t=undefined;try{for(var n=e[Symbol.iterator](),f;!(d=(f=n.next()).done);d=true){var i=f.value;if(o.has(i)){m.add(r)}}}catch(c){a=true;t=c}finally{try{if(!d&&n.return){n.return()}}finally{if(a){throw t}}}};var C=true;var S=false;var x=undefined;try{for(var A=v.entries()[Symbol.iterator](),k;!(C=(k=A.next()).done);C=true){var P=k.value;var w=e(P,2);var E=w[0];var T=w[1];y[T]={};var O=true;var R=false;var N=undefined;try{for(var L=c[Symbol.iterator](),I;!(O=(I=L.next()).done);O=true){var F=I.value;_(E,T);var D=void 0;var M=true;var G=false;var j=undefined;try{for(var B=E[Symbol.iterator](),U;!(M=(U=B.next()).done);M=true){var H=U.value;D=t[H][F];if(D){break}}}catch(q){G=true;j=q}finally{try{if(!M&&B.return){B.return()}}finally{if(G){throw j}}}if(D){y[T][F]=v.get(a[D])}}}catch(q){R=true;N=q}finally{try{if(!O&&L.return){L.return()}}finally{if(R){throw N}}}}}catch(q){S=true;x=q}finally{try{if(!C&&A.return){A.return()}}finally{if(S){throw x}}}u.setTransitionTable(y);u.setAcceptingStateNumbers(m);return u}function n(u,e){if(!e){return false}if(u.length!==e.length){return false}for(var r=0;r{var d=function(){function u(u,e){for(var r=0;r0){var l=n.shift();var b=l.join(",");o[b]={};var p=true;var h=false;var v=undefined;try{for(var g=f[Symbol.iterator](),y;!(p=(y=g.next()).done);p=true){var m=y.value;var _=[];s(l);var C=true;var S=false;var x=undefined;try{for(var A=l[Symbol.iterator](),k;!(C=(k=A.next()).done);C=true){var P=k.value;var w=r[P][m];if(!w){continue}var E=true;var T=false;var O=undefined;try{for(var R=w[Symbol.iterator](),N;!(E=(N=R.next()).done);E=true){var L=N.value;if(!r[L]){continue}_.push.apply(_,a(r[L][i]))}}catch(M){T=true;O=M}finally{try{if(!E&&R.return){R.return()}}finally{if(T){throw O}}}}}catch(M){S=true;x=M}finally{try{if(!C&&A.return){A.return()}}finally{if(S){throw x}}}var I=new Set(_);var F=[].concat(a(I));if(F.length>0){var D=F.join(",");o[b][m]=D;if(!o.hasOwnProperty(D)){n.unshift(F)}}}}catch(M){h=true;v=M}finally{try{if(!p&&g.return){g.return()}}finally{if(h){throw v}}}}return this._transitionTable=this._remapStateNumbers(o)}},{key:"_remapStateNumbers",value:function u(e){var r={};this._originalTransitionTable=e;var d={};Object.keys(e).forEach((function(u,e){r[u]=e+1}));for(var a in e){var t=e[a];var n={};for(var f in t){n[f]=r[t[f]]}d[r[a]]=n}this._originalAcceptingStateNumbers=this._acceptingStateNumbers;this._acceptingStateNumbers=new Set;var i=true;var c=false;var o=undefined;try{for(var s=this._originalAcceptingStateNumbers[Symbol.iterator](),l;!(i=(l=s.next()).done);i=true){var b=l.value;this._acceptingStateNumbers.add(r[b])}}catch(p){c=true;o=p}finally{try{if(!i&&s.return){s.return()}}finally{if(c){throw o}}}return d}},{key:"getOriginalTransitionTable",value:function u(){if(!this._originalTransitionTable){this.getTransitionTable()}return this._originalTransitionTable}},{key:"matches",value:function u(e){var r=1;var d=0;var a=this.getTransitionTable();while(e[d]){r=a[r][e[d++]];if(!r){return false}}if(!this.getAcceptingStateNumbers().has(r)){return false}return true}}]);return u}();u.exports=c},36734:(u,e,r)=>{var d=r(91909);var a=r(32569);var t=r(28398);var n=r(70860);u.exports={NFA:d,DFA:a,builders:n,toNFA:function u(e){return t.build(e)},toDFA:function u(e){return new a(this.toNFA(e))},test:function u(e,r){return this.toDFA(e).matches(r)}}},70860:(u,e,r)=>{var d=r(91909);var a=r(48617);var t=r(75821),n=t.EPSILON;function f(u){var e=new a;var r=new a({accepting:true});return new d(e.addTransition(u,r),r)}function i(){return f(n)}function c(u,e){u.out.accepting=false;e.out.accepting=true;u.out.addTransition(n,e.in);return new d(u.in,e.out)}function o(u){for(var e=arguments.length,r=Array(e>1?e-1:0),d=1;d1?e-1:0),d=1;d{function d(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e{var d=function(){function u(u,e){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:new Set;if(r.has(this)){return false}r.add(this);if(e.length===0){if(this.accepting){return true}var d=true;var a=false;var t=undefined;try{for(var n=this.getTransitionsOnSymbol(c)[Symbol.iterator](),f;!(d=(f=n.next()).done);d=true){var i=f.value;if(i.matches("",r)){return true}}}catch(k){a=true;t=k}finally{try{if(!d&&n.return){n.return()}}finally{if(a){throw t}}}return false}var o=e[0];var s=e.slice(1);var l=this.getTransitionsOnSymbol(o);var b=true;var p=false;var h=undefined;try{for(var v=l[Symbol.iterator](),g;!(b=(g=v.next()).done);b=true){var y=g.value;if(y.matches(s)){return true}}}catch(k){p=true;h=k}finally{try{if(!b&&v.return){v.return()}}finally{if(p){throw h}}}var m=true;var _=false;var C=undefined;try{for(var S=this.getTransitionsOnSymbol(c)[Symbol.iterator](),x;!(m=(x=S.next()).done);m=true){var A=x.value;if(A.matches(e,r)){return true}}}catch(k){_=true;C=k}finally{try{if(!m&&S.return){S.return()}}finally{if(_){throw C}}}return false}},{key:"getEpsilonClosure",value:function u(){var e=this;if(!this._epsilonClosure){(function(){var u=e.getTransitionsOnSymbol(c);var r=e._epsilonClosure=new Set;r.add(e);var d=true;var a=false;var t=undefined;try{for(var n=u[Symbol.iterator](),f;!(d=(f=n.next()).done);d=true){var i=f.value;if(!r.has(i)){r.add(i);var o=i.getEpsilonClosure();o.forEach((function(u){return r.add(u)}))}}}catch(s){a=true;t=s}finally{try{if(!d&&n.return){n.return()}}finally{if(a){throw t}}}})()}return this._epsilonClosure}}]);return e}(f);u.exports=o},91909:(u,e,r)=>{var d=function(){function u(u,e){var r=[];var d=true;var a=false;var t=undefined;try{for(var n=u[Symbol.iterator](),f;!(d=(f=n.next()).done);d=true){r.push(f.value);if(e&&r.length===e)break}}catch(i){a=true;t=i}finally{try{if(!d&&n["return"])n["return"]()}finally{if(a)throw t}}return r}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return u(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();var a=function(){function u(u,e){for(var r=0;r{var e="ε";var r=e+"*";u.exports={EPSILON:e,EPSILON_CLOSURE:r}},81191:u=>{var e=function(){function u(u,e){for(var r=0;r0&&arguments[0]!==undefined?arguments[0]:{},d=e.accepting,a=d===undefined?false:d;r(this,u);this._transitions=new Map;this.accepting=a}e(u,[{key:"getTransitions",value:function u(){return this._transitions}},{key:"addTransition",value:function u(e,r){this.getTransitionsOnSymbol(e).add(r);return this}},{key:"getTransitionsOnSymbol",value:function u(e){var r=this._transitions.get(e);if(!r){r=new Set;this._transitions.set(e,r)}return r}}]);return u}();u.exports=d},63072:(u,e,r)=>{var d=r(1379);var a=r(23810);var t=r(2003);var n=r(53256);u.exports={optimize:function u(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},f=r.whitelist,i=f===undefined?[]:f,c=r.blacklist,o=c===undefined?[]:c;var s=i.length>0?i:Array.from(n.keys());var l=s.filter((function(u){return!o.includes(u)}));var b=e;if(e instanceof RegExp){e=""+e}if(typeof e==="string"){b=a.parse(e)}var p=new t.TransformResult(b);var h=void 0;do{h=p.toString();b=d(p.getAST());l.forEach((function(u){if(!n.has(u)){throw new Error("Unknown optimization-transform: "+u+". "+"Available transforms are: "+Array.from(n.keys()).join(", "))}var e=n.get(u);var r=t.transform(b,e);if(r.toString()!==p.toString()){if(r.toString().length<=p.toString().length){p=r}else{b=d(p.getAST())}}}))}while(p.toString()!==h);return p}}},98002:u=>{var e="A".codePointAt(0);var r="Z".codePointAt(0);u.exports={_AZClassRanges:null,_hasUFlag:false,init:function u(e){this._AZClassRanges=new Set;this._hasUFlag=e.flags.includes("u")},shouldRun:function u(e){return e.flags.includes("i")},Char:function u(e){var r=e.node,t=e.parent;if(isNaN(r.codePoint)){return}if(!this._hasUFlag&&r.codePoint>=4096){return}if(t.type==="ClassRange"){if(!this._AZClassRanges.has(t)&&!d(t)){return}this._AZClassRanges.add(t)}var n=r.symbol.toLowerCase();if(n!==r.symbol){r.value=a(n,r);r.symbol=n;r.codePoint=n.codePointAt(0)}}};function d(u){var d=u.from,a=u.to;return d.codePoint>=e&&d.codePoint<=r&&a.codePoint>=e&&a.codePoint<=r}function a(u,e){var r=u.codePointAt(0);if(e.kind==="decimal"){return"\\"+r}if(e.kind==="oct"){return"\\0"+r.toString(8)}if(e.kind==="hex"){return"\\x"+r.toString(16)}if(e.kind==="unicode"){if(e.isSurrogatePair){var d=t(r),a=d.lead,n=d.trail;return"\\u"+"0".repeat(4-a.length)+a+"\\u"+"0".repeat(4-n.length)+n}else if(e.value.includes("{")){return"\\u{"+r.toString(16)+"}"}else{var f=r.toString(16);return"\\u"+"0".repeat(4-f.length)+f}}return u}function t(u){var e=Math.floor((u-65536)/1024)+55296;var r=(u-65536)%1024+56320;return{lead:e.toString(16),trail:r.toString(16)}}},70436:u=>{u.exports={_hasIUFlags:false,init:function u(e){this._hasIUFlags=e.flags.includes("i")&&e.flags.includes("u")},CharacterClass:function u(r){var a=r.node;var n=a.expressions;var f=[];n.forEach((function(u){if(d(u)){f.push(u.value)}}));n.sort(e);for(var i=0;i1&&arguments[1]!==undefined?arguments[1]:null;return u.type==="Char"&&u.kind==="meta"&&(e?u.value===e:/^\\[dws]$/i.test(u.value))}function a(u){return u.type==="Char"&&u.kind==="control"}function t(u,e,r){for(var d=0;d=8192&&u.codePoint<=8202||u.codePoint===8232||u.codePoint===8233||u.codePoint===8239||u.codePoint===8287||u.codePoint===12288||u.codePoint===65279}function i(u){return u.codePoint>=48&&u.codePoint<=57}function c(u,e){return i(u)||u.codePoint>=65&&u.codePoint<=90||u.codePoint>=97&&u.codePoint<=122||u.value==="_"||e&&(u.codePoint===383||u.codePoint===8490)}function o(u,e){if(e&&e.type==="ClassRange"){if(l(u,e)){return true}else if(p(u)&&e.to.codePoint===u.codePoint-1){e.to=u;return true}else if(u.type==="ClassRange"&&u.from.codePoint<=e.to.codePoint+1&&u.to.codePoint>=e.from.codePoint-1){if(u.from.codePointe.to.codePoint){e.to=u.to}return true}}return false}function s(u,e){if(e&&e.type==="ClassRange"){if(p(u)&&e.from.codePoint===u.codePoint+1){e.from=u;return true}}return false}function l(u,e){if(u.type==="Char"&&isNaN(u.codePoint)){return false}if(u.type==="ClassRange"){return l(u.from,e)&&l(u.to,e)}return u.codePoint>=e.from.codePoint&&u.codePoint<=e.to.codePoint}function b(u,e,r){if(!p(u)){return 0}var d=0;while(e>0){var a=r[e];var t=r[e-1];if(p(t)&&t.codePoint===a.codePoint-1){d++;e--}else{break}}if(d>1){r[e]={type:"ClassRange",from:r[e],to:u};return d}return 0}function p(u){return u&&u.type==="Char"&&!isNaN(u.codePoint)&&(c(u,false)||u.kind==="unicode"||u.kind==="hex"||u.kind==="oct"||u.kind==="decimal")}},76953:u=>{u.exports={ClassRange:function u(e){var r=e.node;if(r.from.codePoint===r.to.codePoint){e.replace(r.from)}else if(r.from.codePoint===r.to.codePoint-1){e.getParent().insertChildAt(r.to,e.index+1);e.replace(r.from)}}}},322:u=>{u.exports={CharacterClass:function u(e){var r=e.node;var d={};for(var a=0;a{function e(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e2&&arguments[2]!==undefined?arguments[2]:"simple";return u.type==="Char"&&u.value===e&&u.kind===r}function i(u,e){return f(u,e,"meta")}function c(u){return u.type==="ClassRange"&&u.from.value==="a"&&u.to.value==="z"}function o(u){return u.type==="ClassRange"&&u.from.value==="A"&&u.to.value==="Z"}function s(u){return u.type==="Char"&&u.value==="_"&&u.kind==="simple"}function l(u,e){return u.type==="Char"&&u.kind==="unicode"&&u.codePoint===e}},11810:u=>{u.exports={CharacterClass:function u(n){var f=n.node;if(f.expressions.length!==1||!a(n)||!e(f.expressions[0])){return}var i=f.expressions[0],c=i.value,o=i.kind,s=i.escaped;if(f.negative){if(!r(c)){return}c=d(c)}n.replace({type:"Char",value:c,kind:o,escaped:s||t(c)})}};function e(u){return u.type==="Char"&&u.value!=="\\b"}function r(u){return/^\\[dwsDWS]$/.test(u)}function d(u){return/[dws]/.test(u)?u.toUpperCase():u.toLowerCase()}function a(u){var e=u.parent,r=u.index;if(e.type!=="Alternative"){return true}var d=e.expressions[r-1];if(d==null){return true}if(d.type==="Backreference"&&d.kind==="number"){return false}if(d.type==="Char"&&d.kind==="decimal"){return false}return true}function t(u){return/[*[()+?$./{}|]/.test(u)}},88111:u=>{var e="A".codePointAt(0);var r="Z".codePointAt(0);var d="a".codePointAt(0);var a="z".codePointAt(0);var t="0".codePointAt(0);var n="9".codePointAt(0);u.exports={Char:function u(e){var r=e.node,d=e.parent;if(isNaN(r.codePoint)||r.kind==="simple"){return}if(d.type==="ClassRange"){if(!f(d)){return}}if(!i(r.codePoint)){return}var a=String.fromCodePoint(r.codePoint);var t={type:"Char",kind:"simple",value:a,symbol:a,codePoint:r.codePoint};if(c(a,d.type)){t.escaped=true}e.replace(t)}};function f(u){var f=u.from,i=u.to;return f.codePoint>=t&&f.codePoint<=n&&i.codePoint>=t&&i.codePoint<=n||f.codePoint>=e&&f.codePoint<=r&&i.codePoint>=e&&i.codePoint<=r||f.codePoint>=d&&f.codePoint<=a&&i.codePoint>=d&&i.codePoint<=a}function i(u){return u>=32&&u<=126}function c(u,e){if(e==="ClassRange"||e==="CharacterClass"){return/[\]\\^-]/.test(u)}return/[*[()+?^$./\\|{}]/.test(u)}},6632:u=>{u.exports={_hasXFlag:false,init:function u(e){this._hasXFlag=e.flags.includes("x")},Char:function u(r){var d=r.node;if(!d.escaped){return}if(e(r,this._hasXFlag)){delete d.escaped}}};function e(u,e){var a=u.node.value,t=u.index,n=u.parent;if(n.type!=="CharacterClass"&&n.type!=="ClassRange"){return!d(a,t,n,e)}return!r(a,t,n)}function r(u,e,r){if(u==="^"){return e===0&&!r.negative}if(u==="-"){return true}return/[\]\\]/.test(u)}function d(u,e,r,d){if(u==="{"){return n(e,r)}if(u==="}"){return f(e,r)}if(d&&/[ #]/.test(u)){return true}return/[*[()+?^$./\\|]/.test(u)}function a(u,e,r){var d=u;var a=(r?d>=0:d=0:d=0&&e.expressions[d];if(r&&t(n,"{")){return true}if(t(n,",")){r=a(d-1,e,true);d=d-r-1;n=d{u.exports={shouldRun:function u(e){return e.flags.includes("u")},Char:function u(e){var r=e.node;if(r.kind!=="unicode"||!r.isSurrogatePair||isNaN(r.codePoint)){return}r.value="\\u{"+r.codePoint.toString(16)+"}";delete r.isSurrogatePair}}},97648:(u,e,r)=>{function d(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e=r.expressions.length){break}a=e.getChild(d);d=Math.max(1,i(e,a,d));if(d>=r.expressions.length){break}a=e.getChild(d);d=Math.max(1,c(e,a,d));d++}}};function f(u,e,r){var t=u.node;var n=Math.ceil(r/2);var f=0;while(f{var d=r(41059);var a=r(33166),t=a.disjunctionToList,n=a.listToDisjunction;u.exports={Disjunction:function u(e){var r=e.node;var a={};var f=t(r).filter((function(u){var e=u?d.getForNode(u).jsonEncode():"null";if(a.hasOwnProperty(e)){return false}a[e]=u;return true}));e.replace(n(f))}}},5808:u=>{u.exports={Disjunction:function u(d){var a=d.node,t=d.parent;if(!e[t.type]){return}var n=new Map;if(!r(a,n)||!n.size){return}var f={type:"CharacterClass",expressions:Array.from(n.keys()).sort().map((function(u){return n.get(u)}))};e[t.type](d.getParent(),f)}};var e={RegExp:function u(e,r){var d=e.node;d.body=r},Group:function u(e,r){var d=e.node;if(d.capturing){d.expression=r}else{e.replace(r)}}};function r(u,e){if(!u){return false}var d=u.type;if(d==="Disjunction"){var a=u.left,t=u.right;return r(a,e)&&r(t,e)}else if(d==="Char"){var n=u.value;e.set(n,u);return true}else if(d==="CharacterClass"&&!u.negative){return u.expressions.every((function(u){return r(u,e)}))}return false}},53256:(u,e,r)=>{u.exports=new Map([["charSurrogatePairToSingleUnicode",r(8988)],["charCodeToSimpleChar",r(88111)],["charCaseInsensitiveLowerCaseTransform",r(98002)],["charClassRemoveDuplicates",r(322)],["quantifiersMerge",r(31837)],["quantifierRangeToSymbol",r(88190)],["charClassClassrangesToChars",r(76953)],["charClassToMeta",r(4090)],["charClassToSingleChar",r(11810)],["charEscapeUnescape",r(6632)],["charClassClassrangesMerge",r(70436)],["disjunctionRemoveDuplicates",r(61013)],["groupSingleCharsToCharClass",r(5808)],["removeEmptyGroup",r(72097)],["ungroup",r(95435)],["combineRepeatingPatterns",r(97648)]])},88190:u=>{u.exports={Quantifier:function u(a){var t=a.node;if(t.kind!=="Range"){return}e(a);r(a);d(a)}};function e(u){var e=u.node;if(e.from!==0||e.to){return}e.kind="*";delete e.from}function r(u){var e=u.node;if(e.from!==1||e.to){return}e.kind="+";delete e.from}function d(u){var e=u.node;if(e.from!==1||e.to!==1){return}u.parentPath.replace(u.parentPath.node.expression)}},31837:(u,e,r)=>{var d=r(33166),a=d.increaseQuantifierByOne;u.exports={Repetition:function u(e){var r=e.node,d=e.parent;if(d.type!=="Alternative"||!e.index){return}var f=e.getPreviousSibling();if(!f){return}if(f.node.type==="Repetition"){if(!f.getChild().hasEqualSource(e.getChild())){return}var i=n(f.node.quantifier),c=i.from,o=i.to;var s=n(r.quantifier),l=s.from,b=s.to;if(f.node.quantifier.greedy!==r.quantifier.greedy&&!t(f.node.quantifier)&&!t(r.quantifier)){return}r.quantifier.kind="Range";r.quantifier.from=c+l;if(o&&b){r.quantifier.to=o+b}else{delete r.quantifier.to}if(t(f.node.quantifier)||t(r.quantifier)){r.quantifier.greedy=true}f.remove()}else{if(!f.hasEqualSource(e.getChild())){return}a(r.quantifier);f.remove()}}};function t(u){return u.greedy&&(u.kind==="+"||u.kind==="*"||u.kind==="Range"&&!u.to)}function n(u){var e=void 0,r=void 0;if(u.kind==="*"){e=0}else if(u.kind==="+"){e=1}else if(u.kind==="?"){e=0;r=1}else{e=u.from;if(u.to){r=u.to}}return{from:e,to:r}}},72097:u=>{u.exports={Group:function u(e){var r=e.node,d=e.parent;var a=e.getChild();if(r.capturing||a){return}if(d.type==="Repetition"){e.getParent().replace(r)}else if(d.type!=="RegExp"){e.remove()}}}},95435:u=>{function e(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e{var d=function(){function u(u,e){var r=[];var d=true;var a=false;var t=undefined;try{for(var n=u[Symbol.iterator](),f;!(d=(f=n.next()).done);d=true){r.push(f.value);if(e&&r.length===e)break}}catch(i){a=true;t=i}finally{try{if(!d&&n["return"])n["return"]()}finally{if(a)throw t}}return r}return function(e,r){if(Array.isArray(e)){return e}else if(Symbol.iterator in Object(e)){return u(e,r)}else{throw new TypeError("Invalid attempt to destructure non-iterable instance")}}}();function a(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e/,function(){var u=t.slice(3,-1);F(u,this.getCurrentState());return"NAMED_GROUP_REF"}],[/^\\b/,function(){return"ESC_b"}],[/^\\B/,function(){return"ESC_B"}],[/^\\c[a-zA-Z]/,function(){return"CTRL_CH"}],[/^\\0\d{1,2}/,function(){return"OCT_CODE"}],[/^\\0/,function(){return"DEC_CODE"}],[/^\\\d{1,3}/,function(){return"DEC_CODE"}],[/^\\u[dD][89abAB][0-9a-fA-F]{2}\\u[dD][c-fC-F][0-9a-fA-F]{2}/,function(){return"U_CODE_SURROGATE"}],[/^\\u\{[0-9a-fA-F]{1,}\}/,function(){return"U_CODE"}],[/^\\u[0-9a-fA-F]{4}/,function(){return"U_CODE"}],[/^\\[pP]\{\w+(?:=\w+)?\}/,function(){return"U_PROP_VALUE_EXP"}],[/^\\x[0-9a-fA-F]{2}/,function(){return"HEX_CODE"}],[/^\\[tnrdDsSwWvf]/,function(){return"META_CHAR"}],[/^\\\//,function(){return"ESC_CHAR"}],[/^\\[ #]/,function(){return"ESC_CHAR"}],[/^\\[\^\$\.\*\+\?\(\)\\\[\]\{\}\|\/]/,function(){return"ESC_CHAR"}],[/^\\[^*?+\[()\\|]/,function(){var u=this.getCurrentState();if(u==="u_class"&&t==="\\-"){return"ESC_CHAR"}else if(u==="u"||u==="xu"||u==="u_class"){throw new SyntaxError("invalid Unicode escape "+t)}return"ESC_CHAR"}],[/^\(/,function(){return"CHAR"}],[/^\)/,function(){return"CHAR"}],[/^\(\?=/,function(){return"POS_LA_ASSERT"}],[/^\(\?!/,function(){return"NEG_LA_ASSERT"}],[/^\(\?<=/,function(){return"POS_LB_ASSERT"}],[/^\(\?/,function(){t=t.slice(3,-1);F(t,this.getCurrentState());return"NAMED_CAPTURE_GROUP"}],[/^\(/,function(){return"L_PAREN"}],[/^\)/,function(){return"R_PAREN"}],[/^[*?+[^$]/,function(){return"CHAR"}],[/^\\\]/,function(){return"ESC_CHAR"}],[/^\]/,function(){this.popState();return"R_BRACKET"}],[/^\^/,function(){return"BOS"}],[/^\$/,function(){return"EOS"}],[/^\*/,function(){return"STAR"}],[/^\?/,function(){return"Q_MARK"}],[/^\+/,function(){return"PLUS"}],[/^\|/,function(){return"BAR"}],[/^\./,function(){return"ANY"}],[/^\//,function(){return"SLASH"}],[/^[^*?+\[()\\|]/,function(){return"CHAR"}],[/^\[\^/,function(){var u=this.getCurrentState();this.pushState(u==="u"||u==="xu"?"u_class":"class");return"NEG_CLASS"}],[/^\[/,function(){var u=this.getCurrentState();this.pushState(u==="u"||u==="xu"?"u_class":"class");return"L_BRACKET"}]];var y={INITIAL:[8,9,10,11,12,13,14,15,16,17,20,22,23,24,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],u:[8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],xu:[0,1,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],x:[0,1,8,9,10,11,12,13,14,15,16,17,20,22,23,24,26,27,30,31,32,33,34,35,36,37,41,42,43,44,45,46,47,48,49,50,51],u_class:[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],class:[2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,20,22,23,24,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51]};var m={type:s,value:""};v={initString:function u(e){this._string=e;this._cursor=0;this._states=["INITIAL"];this._tokensQueue=[];this._currentLine=1;this._currentColumn=0;this._currentLineBeginOffset=0;this._tokenStartOffset=0;this._tokenEndOffset=0;this._tokenStartLine=1;this._tokenEndLine=1;this._tokenStartColumn=0;this._tokenEndColumn=0;return this},getStates:function u(){return this._states},getCurrentState:function u(){return this._states[this._states.length-1]},pushState:function u(e){this._states.push(e)},begin:function u(e){this.pushState(e)},popState:function u(){if(this._states.length>1){return this._states.pop()}return this._states[0]},getNextToken:function u(){if(this._tokensQueue.length>0){return this.onToken(this._toToken(this._tokensQueue.shift()))}if(!this.hasMoreTokens()){return this.onToken(m)}var e=this._string.slice(this._cursor);var r=y[this.getCurrentState()];for(var d=0;d0){var l;(l=this._tokensQueue).unshift.apply(l,a(s))}}return this.onToken(this._toToken(o,t))}}if(this.isEOF()){this._cursor++;return m}this.throwUnexpectedToken(e[0],this._currentLine,this._currentColumn)},throwUnexpectedToken:function u(e,r,d){var a=this._string.split("\n")[r-1];var t="";if(a){var n=" ".repeat(d);t="\n\n"+a+"\n"+n+"^\n"}throw new SyntaxError(t+'Unexpected token: "'+e+'" '+("at "+r+":"+d+"."))},getCursor:function u(){return this._cursor},getCurrentLine:function u(){return this._currentLine},getCurrentColumn:function u(){return this._currentColumn},_captureLocation:function u(e){var r=/\n/g;this._tokenStartOffset=this._cursor;this._tokenStartLine=this._currentLine;this._tokenStartColumn=this._tokenStartOffset-this._currentLineBeginOffset;var d=void 0;while((d=r.exec(e))!==null){this._currentLine++;this._currentLineBeginOffset=this._tokenStartOffset+d.index+1}this._tokenEndOffset=this._cursor+e.length;this._tokenEndLine=this._currentLine;this._tokenEndColumn=this._currentColumn=this._tokenEndOffset-this._currentLineBeginOffset},_toToken:function u(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"";return{type:e,value:r,startOffset:this._tokenStartOffset,endOffset:this._tokenEndOffset,startLine:this._tokenStartLine,endLine:this._tokenEndLine,startColumn:this._tokenStartColumn,endColumn:this._tokenEndColumn}},isEOF:function u(){return this._cursor===this._string.length},hasMoreTokens:function u(){return this._cursor<=this._string.length},_match:function u(e,r){var d=e.match(r);if(d){this._captureLocation(d[0]);this._cursor+=d[0].length;return d[0]}return null},onToken:function u(e){return e}};f.lexer=v;f.tokenizer=v;f.options={captureLocations:true};var _={setOptions:function u(e){f.options=e;return this},getOptions:function u(){return f.options},parse:function u(e,r){if(!v){throw new Error("Tokenizer instance wasn't specified.")}v.initString(e);var d=f.options;if(r){f.options=Object.assign({},f.options,r)}_.onParseBegin(e,v,f.options);h.length=0;h.push(0);var o=v.getNextToken();var s=null;do{if(!o){f.options=d;H()}var g=h[h.length-1];var y=b[o.type];if(!p[g].hasOwnProperty(y)){f.options=d;U(o)}var m=p[g][y];if(m[0]==="s"){var C=null;if(f.options.captureLocations){C={startOffset:o.startOffset,endOffset:o.endOffset,startLine:o.startLine,endLine:o.endLine,startColumn:o.startColumn,endColumn:o.endColumn}}s=this.onShift(o);h.push({symbol:b[s.type],semanticValue:s.value,loc:C},Number(m.slice(1)));o=v.getNextToken()}else if(m[0]==="r"){var S=m.slice(1);var x=l[S];var A=typeof x[2]==="function";var k=A?[]:null;var P=A&&f.options.captureLocations?[]:null;if(x[1]!==0){var w=x[1];while(w-- >0){h.pop();var E=h.pop();if(A){k.unshift(E.semanticValue);if(P){P.unshift(E.loc)}}}}var T={symbol:x[0]};if(A){t=s?s.value:null;n=s?s.value.length:null;var O=P!==null?k.concat(P):k;x[2].apply(x,a(O));T.semanticValue=i;if(P){T.loc=c}}var R=h[h.length-1];var N=x[0];h.push(T,p[R][N])}else if(m==="acc"){h.pop();var L=h.pop();if(h.length!==1||h[0]!==0||v.hasMoreTokens()){f.options=d;U(o)}if(L.hasOwnProperty("semanticValue")){f.options=d;_.onParseEnd(L.semanticValue);return L.semanticValue}_.onParseEnd();f.options=d;return true}}while(v.hasMoreTokens()||h.length>1)},setTokenizer:function u(e){v=e;return _},getTokenizer:function u(){return v},onParseBegin:function u(e,r,d){},onParseEnd:function u(e){},onShift:function u(e){return e}};var C=0;var S={};var x="";_.onParseBegin=function(u,e){x=u;C=0;S={};var r=u.lastIndexOf("/");var d=u.slice(r);if(d.includes("x")&&d.includes("u")){e.pushState("xu")}else{if(d.includes("x")){e.pushState("x")}if(d.includes("u")){e.pushState("u")}}};_.onShift=function(u){if(u.type==="L_PAREN"||u.type==="NAMED_CAPTURE_GROUP"){u.value=new String(u.value);u.value.groupNumber=++C}return u};function A(u){var e=u.match(/\d+/g).map(Number);if(Number.isFinite(e[1])&&e[1]e.codePoint){throw new SyntaxError("Range "+u.value+"-"+e.value+" out of order in character class")}}var P=r(37047);function w(u,e){var r=u[1]==="P";var d=u.indexOf("=");var a=u.slice(3,d!==-1?d:-1);var t=void 0;var n=d===-1&&P.isGeneralCategoryValue(a);var f=d===-1&&P.isBinaryPropertyName(a);if(n){t=a;a="General_Category"}else if(f){t=a}else{if(!P.isValidName(a)){throw new SyntaxError("Invalid unicode property name: "+a+".")}t=u.slice(d+1,-1);if(!P.isValidValue(a,t)){throw new SyntaxError("Invalid "+a+" unicode property value: "+t+".")}}return j({type:"UnicodeProperty",name:a,value:t,negative:r,shorthand:n,binary:f,canonicalName:P.getCanonicalName(a)||a,canonicalValue:P.getCanonicalValue(t)||t},e)}function E(u,e,r){var a=void 0;var t=void 0;switch(e){case"decimal":{t=Number(u.slice(1));a=String.fromCodePoint(t);break}case"oct":{t=parseInt(u.slice(1),8);a=String.fromCodePoint(t);break}case"hex":case"unicode":{if(u.lastIndexOf("\\u")>0){var n=u.split("\\u").slice(1),f=d(n,2),i=f[0],c=f[1];i=parseInt(i,16);c=parseInt(c,16);t=(i-55296)*1024+(c-56320)+65536;a=String.fromCodePoint(t)}else{var o=u.slice(2).replace("{","");t=parseInt(o,16);if(t>1114111){throw new SyntaxError("Bad character escape sequence: "+u)}a=String.fromCodePoint(t)}break}case"meta":{switch(u){case"\\t":a="\t";t=a.codePointAt(0);break;case"\\n":a="\n";t=a.codePointAt(0);break;case"\\r":a="\r";t=a.codePointAt(0);break;case"\\v":a="\v";t=a.codePointAt(0);break;case"\\f":a="\f";t=a.codePointAt(0);break;case"\\b":a="\b";t=a.codePointAt(0);case"\\0":a="\0";t=0;case".":a=".";t=NaN;break;default:t=NaN}break}case"simple":{a=u;t=a.codePointAt(0);break}}return j({type:"Char",value:u,kind:e,symbol:a,codePoint:t},r)}var T="gimsuxy";function O(u){var e=new Set;var r=true;var d=false;var a=undefined;try{for(var t=u[Symbol.iterator](),n;!(r=(n=t.next()).done);r=true){var f=n.value;if(e.has(f)||!T.includes(f)){throw new SyntaxError("Invalid flags: "+u)}e.add(f)}}catch(i){d=true;a=i}finally{try{if(!r&&t.return){t.return()}}finally{if(d){throw a}}}return u.split("").sort().join("")}function R(u,e){var r=Number(u.slice(1));if(r>0&&r<=C){return j({type:"Backreference",kind:"number",number:r,reference:r},e)}return E(u,"decimal",e)}var N=/^\\u[0-9a-fA-F]{4}/;var L=/^\\u\{[0-9a-fA-F]{1,}\}/;var I=/\\u\{[0-9a-fA-F]{1,}\}/;function F(u,e){var r=I.test(u);var d=e==="u"||e==="xu"||e==="u_class";if(r&&!d){throw new SyntaxError('invalid group Unicode name "'+u+'", use `u` flag.')}return u}var D=/\\u(?:([dD][89aAbB][0-9a-fA-F]{2})\\u([dD][c-fC-F][0-9a-fA-F]{2})|([dD][89aAbB][0-9a-fA-F]{2})|([dD][c-fC-F][0-9a-fA-F]{2})|([0-9a-ce-fA-CE-F][0-9a-fA-F]{3}|[dD][0-7][0-9a-fA-F]{2})|\{(0*(?:[0-9a-fA-F]{1,5}|10[0-9a-fA-F]{4}))\})/;function M(u){return u.replace(new RegExp(D,"g"),(function(u,e,r,d,a,t,n){if(e){return String.fromCodePoint(parseInt(e,16),parseInt(r,16))}if(d){return String.fromCodePoint(parseInt(d,16))}if(a){return String.fromCodePoint(parseInt(a,16))}if(t){return String.fromCodePoint(parseInt(t,16))}if(n){return String.fromCodePoint(parseInt(n,16))}return u}))}function G(u,e){var r=u.slice(3,-1);var d=M(r);if(S.hasOwnProperty(d)){return j({type:"Backreference",kind:"name",number:S[d],reference:d,referenceRaw:r},e)}var a=null;var t=null;var n=null;var f=null;if(e){a=e.startOffset;t=e.startLine;n=e.endLine;f=e.startColumn}var i=/^[\w$<>]/;var c=void 0;var o=[E(u.slice(1,2),"simple",a?{startLine:t,endLine:n,startColumn:f,startOffset:a,endOffset:a+=2,endColumn:f+=2}:null)];o[0].escaped=true;u=u.slice(2);while(u.length>0){var s=null;if((s=u.match(N))||(s=u.match(L))){if(a){c={startLine:t,endLine:n,startColumn:f,startOffset:a,endOffset:a+=s[0].length,endColumn:f+=s[0].length}}o.push(E(s[0],"unicode",c));u=u.slice(s[0].length)}else if(s=u.match(i)){if(a){c={startLine:t,endLine:n,startColumn:f,startOffset:a,endOffset:++a,endColumn:++f}}o.push(E(s[0],"simple",c));u=u.slice(1)}}return o}function j(u,e){if(f.options.captureLocations){u.loc={source:x.slice(e.startOffset,e.endOffset),start:{line:e.startLine,column:e.startColumn,offset:e.startOffset},end:{line:e.endLine,column:e.endColumn,offset:e.endOffset}}}return u}function B(u,e){if(!f.options.captureLocations){return null}return{startOffset:u.startOffset,endOffset:e.endOffset,startLine:u.startLine,endLine:e.endLine,startColumn:u.startColumn,endColumn:e.endColumn}}function U(u){if(u.type===s){H()}v.throwUnexpectedToken(u.value,u.startLine,u.startColumn)}function H(){q("Unexpected end of input.")}function q(u){throw new SyntaxError(u)}u.exports=_},23810:(u,e,r)=>{var d=r(97e3);var a=d.parse.bind(d);d.parse=function(u,e){return a(""+u,e)};d.setOptions({captureLocations:false});u.exports=d},37047:u=>{var e={General_Category:"gc",Script:"sc",Script_Extensions:"scx"};var r=c(e);var d={ASCII:"ASCII",ASCII_Hex_Digit:"AHex",Alphabetic:"Alpha",Any:"Any",Assigned:"Assigned",Bidi_Control:"Bidi_C",Bidi_Mirrored:"Bidi_M",Case_Ignorable:"CI",Cased:"Cased",Changes_When_Casefolded:"CWCF",Changes_When_Casemapped:"CWCM",Changes_When_Lowercased:"CWL",Changes_When_NFKC_Casefolded:"CWKCF",Changes_When_Titlecased:"CWT",Changes_When_Uppercased:"CWU",Dash:"Dash",Default_Ignorable_Code_Point:"DI",Deprecated:"Dep",Diacritic:"Dia",Emoji:"Emoji",Emoji_Component:"Emoji_Component",Emoji_Modifier:"Emoji_Modifier",Emoji_Modifier_Base:"Emoji_Modifier_Base",Emoji_Presentation:"Emoji_Presentation",Extended_Pictographic:"Extended_Pictographic",Extender:"Ext",Grapheme_Base:"Gr_Base",Grapheme_Extend:"Gr_Ext",Hex_Digit:"Hex",IDS_Binary_Operator:"IDSB",IDS_Trinary_Operator:"IDST",ID_Continue:"IDC",ID_Start:"IDS",Ideographic:"Ideo",Join_Control:"Join_C",Logical_Order_Exception:"LOE",Lowercase:"Lower",Math:"Math",Noncharacter_Code_Point:"NChar",Pattern_Syntax:"Pat_Syn",Pattern_White_Space:"Pat_WS",Quotation_Mark:"QMark",Radical:"Radical",Regional_Indicator:"RI",Sentence_Terminal:"STerm",Soft_Dotted:"SD",Terminal_Punctuation:"Term",Unified_Ideograph:"UIdeo",Uppercase:"Upper",Variation_Selector:"VS",White_Space:"space",XID_Continue:"XIDC",XID_Start:"XIDS"};var a=c(d);var t={Cased_Letter:"LC",Close_Punctuation:"Pe",Connector_Punctuation:"Pc",Control:["Cc","cntrl"],Currency_Symbol:"Sc",Dash_Punctuation:"Pd",Decimal_Number:["Nd","digit"],Enclosing_Mark:"Me",Final_Punctuation:"Pf",Format:"Cf",Initial_Punctuation:"Pi",Letter:"L",Letter_Number:"Nl",Line_Separator:"Zl",Lowercase_Letter:"Ll",Mark:["M","Combining_Mark"],Math_Symbol:"Sm",Modifier_Letter:"Lm",Modifier_Symbol:"Sk",Nonspacing_Mark:"Mn",Number:"N",Open_Punctuation:"Ps",Other:"C",Other_Letter:"Lo",Other_Number:"No",Other_Punctuation:"Po",Other_Symbol:"So",Paragraph_Separator:"Zp",Private_Use:"Co",Punctuation:["P","punct"],Separator:"Z",Space_Separator:"Zs",Spacing_Mark:"Mc",Surrogate:"Cs",Symbol:"S",Titlecase_Letter:"Lt",Unassigned:"Cn",Uppercase_Letter:"Lu"};var n=c(t);var f={Adlam:"Adlm",Ahom:"Ahom",Anatolian_Hieroglyphs:"Hluw",Arabic:"Arab",Armenian:"Armn",Avestan:"Avst",Balinese:"Bali",Bamum:"Bamu",Bassa_Vah:"Bass",Batak:"Batk",Bengali:"Beng",Bhaiksuki:"Bhks",Bopomofo:"Bopo",Brahmi:"Brah",Braille:"Brai",Buginese:"Bugi",Buhid:"Buhd",Canadian_Aboriginal:"Cans",Carian:"Cari",Caucasian_Albanian:"Aghb",Chakma:"Cakm",Cham:"Cham",Cherokee:"Cher",Common:"Zyyy",Coptic:["Copt","Qaac"],Cuneiform:"Xsux",Cypriot:"Cprt",Cyrillic:"Cyrl",Deseret:"Dsrt",Devanagari:"Deva",Dogra:"Dogr",Duployan:"Dupl",Egyptian_Hieroglyphs:"Egyp",Elbasan:"Elba",Ethiopic:"Ethi",Georgian:"Geor",Glagolitic:"Glag",Gothic:"Goth",Grantha:"Gran",Greek:"Grek",Gujarati:"Gujr",Gunjala_Gondi:"Gong",Gurmukhi:"Guru",Han:"Hani",Hangul:"Hang",Hanifi_Rohingya:"Rohg",Hanunoo:"Hano",Hatran:"Hatr",Hebrew:"Hebr",Hiragana:"Hira",Imperial_Aramaic:"Armi",Inherited:["Zinh","Qaai"],Inscriptional_Pahlavi:"Phli",Inscriptional_Parthian:"Prti",Javanese:"Java",Kaithi:"Kthi",Kannada:"Knda",Katakana:"Kana",Kayah_Li:"Kali",Kharoshthi:"Khar",Khmer:"Khmr",Khojki:"Khoj",Khudawadi:"Sind",Lao:"Laoo",Latin:"Latn",Lepcha:"Lepc",Limbu:"Limb",Linear_A:"Lina",Linear_B:"Linb",Lisu:"Lisu",Lycian:"Lyci",Lydian:"Lydi",Mahajani:"Mahj",Makasar:"Maka",Malayalam:"Mlym",Mandaic:"Mand",Manichaean:"Mani",Marchen:"Marc",Medefaidrin:"Medf",Masaram_Gondi:"Gonm",Meetei_Mayek:"Mtei",Mende_Kikakui:"Mend",Meroitic_Cursive:"Merc",Meroitic_Hieroglyphs:"Mero",Miao:"Plrd",Modi:"Modi",Mongolian:"Mong",Mro:"Mroo",Multani:"Mult",Myanmar:"Mymr",Nabataean:"Nbat",New_Tai_Lue:"Talu",Newa:"Newa",Nko:"Nkoo",Nushu:"Nshu",Ogham:"Ogam",Ol_Chiki:"Olck",Old_Hungarian:"Hung",Old_Italic:"Ital",Old_North_Arabian:"Narb",Old_Permic:"Perm",Old_Persian:"Xpeo",Old_Sogdian:"Sogo",Old_South_Arabian:"Sarb",Old_Turkic:"Orkh",Oriya:"Orya",Osage:"Osge",Osmanya:"Osma",Pahawh_Hmong:"Hmng",Palmyrene:"Palm",Pau_Cin_Hau:"Pauc",Phags_Pa:"Phag",Phoenician:"Phnx",Psalter_Pahlavi:"Phlp",Rejang:"Rjng",Runic:"Runr",Samaritan:"Samr",Saurashtra:"Saur",Sharada:"Shrd",Shavian:"Shaw",Siddham:"Sidd",SignWriting:"Sgnw",Sinhala:"Sinh",Sogdian:"Sogd",Sora_Sompeng:"Sora",Soyombo:"Soyo",Sundanese:"Sund",Syloti_Nagri:"Sylo",Syriac:"Syrc",Tagalog:"Tglg",Tagbanwa:"Tagb",Tai_Le:"Tale",Tai_Tham:"Lana",Tai_Viet:"Tavt",Takri:"Takr",Tamil:"Taml",Tangut:"Tang",Telugu:"Telu",Thaana:"Thaa",Thai:"Thai",Tibetan:"Tibt",Tifinagh:"Tfng",Tirhuta:"Tirh",Ugaritic:"Ugar",Vai:"Vaii",Warang_Citi:"Wara",Yi:"Yiii",Zanabazar_Square:"Zanb"};var i=c(f);function c(u){var e={};for(var r in u){if(!u.hasOwnProperty(r)){continue}var d=u[r];if(Array.isArray(d)){for(var a=0;a{var d=r(9182);var a=r(20042);var t=r(63072);var n=r(23810);var f=r(2003);var i=r(29171);var c=r(36734);var o=r(51537),s=o.RegExpTree;var l={parser:n,fa:c,TransformResult:f.TransformResult,parse:function u(e,r){return n.parse(""+e,r)},traverse:function u(e,r,d){return i.traverse(e,r,d)},transform:function u(e,r){return f.transform(e,r)},generate:function u(e){return a.generate(e)},toRegExp:function u(e){var r=this.compatTranspile(e);return new RegExp(r.getSource(),r.getFlags())},optimize:function u(e,r){var d=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},a=d.blacklist;return t.optimize(e,{whitelist:r,blacklist:a})},compatTranspile:function u(e,r){return d.transform(e,r)},exec:function u(e,r){if(typeof e==="string"){var d=this.compatTranspile(e);var a=d.getExtra();if(a.namedCapturingGroups){e=new s(d.toRegExp(),{flags:d.getFlags(),source:d.getSource(),groups:a.namedCapturingGroups})}else{e=d.toRegExp()}}return e.exec(r)}};u.exports=l},2003:(u,e,r)=>{var d=function(){function u(u,e){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:null;a(this,u);this._ast=e;this._source=null;this._string=null;this._regexp=null;this._extra=r}d(u,[{key:"getAST",value:function u(){return this._ast}},{key:"setExtra",value:function u(e){this._extra=e}},{key:"getExtra",value:function u(){return this._extra}},{key:"toRegExp",value:function u(){if(!this._regexp){this._regexp=new RegExp(this.getSource(),this._ast.flags)}return this._regexp}},{key:"getSource",value:function u(){if(!this._source){this._source=t.generate(this._ast.body)}return this._source}},{key:"getFlags",value:function u(){return this._ast.flags}},{key:"toString",value:function u(){if(!this._string){this._string=t.generate(this._ast)}return this._string}}]);return u}();u.exports={TransformResult:i,transform:function u(e,r){var d=e;if(e instanceof RegExp){e=""+e}if(typeof e==="string"){d=n.parse(e,{captureLocations:true})}f.traverse(d,r);return new i(d)}}},33166:u=>{function e(u){if(Array.isArray(u)){for(var e=0,r=Array(u.length);e{var d=r(41059);function a(u){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};var r=e.pre;var a=e.post;var t=e.skipProperty;function n(u,e,f,i){if(!u||typeof u.type!=="string"){return}var c=undefined;if(r){c=r(u,e,f,i)}if(c!==false){if(e&&e[f]){if(!isNaN(i)){u=e[f][i]}else{u=e[f]}}for(var o in u){if(u.hasOwnProperty(o)){if(t?t(o,u):o[0]==="$"){continue}var s=u[o];if(Array.isArray(s)){var l=0;d.traversingIndexStack.push(l);while(l2&&arguments[2]!==undefined?arguments[2]:{asNodes:false};if(!Array.isArray(r)){r=[r]}r=r.filter((function(u){if(typeof u.shouldRun!=="function"){return true}return u.shouldRun(e)}));d.initRegistry();r.forEach((function(u){if(typeof u.init==="function"){u.init(e)}}));function n(u,e,r,a){var t=d.getForNode(e);var n=d.getForNode(u,t,r,a);return n}a(e,{pre:function u(e,d,a,f){var i=void 0;if(!t.asNodes){i=n(e,d,a,f)}var c=true;var o=false;var s=undefined;try{for(var l=r[Symbol.iterator](),b;!(c=(b=l.next()).done);c=true){var p=b.value;if(typeof p["*"]==="function"){if(i){if(!i.isRemoved()){var h=p["*"](i);if(h===false){return false}}}else{p["*"](e,d,a,f)}}var v=void 0;if(typeof p[e.type]==="function"){v=p[e.type]}else if(typeof p[e.type]==="object"&&typeof p[e.type].pre==="function"){v=p[e.type].pre}if(v){if(i){if(!i.isRemoved()){var g=v.call(p,i);if(g===false){return false}}}else{v.call(p,e,d,a,f)}}}}catch(y){o=true;s=y}finally{try{if(!c&&l.return){l.return()}}finally{if(o){throw s}}}},post:function u(e,d,a,f){if(!e){return}var i=void 0;if(!t.asNodes){i=n(e,d,a,f)}var c=true;var o=false;var s=undefined;try{for(var l=r[Symbol.iterator](),b;!(c=(b=l.next()).done);c=true){var p=b.value;var h=void 0;if(typeof p[e.type]==="object"&&typeof p[e.type].post==="function"){h=p[e.type].post}if(h){if(i){if(!i.isRemoved()){var v=h.call(p,i);if(v===false){return false}}}else{h.call(p,e,d,a,f)}}}}catch(g){o=true;s=g}finally{try{if(!c&&l.return){l.return()}}finally{if(o){throw s}}}},skipProperty:function u(e){return e==="loc"}})}}},41059:u=>{var e=function(){function u(u,e){for(var r=0;r1&&arguments[1]!==undefined?arguments[1]:null;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var t=arguments.length>3&&arguments[3]!==undefined?arguments[3]:null;r(this,u);this.node=e;this.parentPath=d;this.parent=d?d.node:null;this.property=a;this.index=t}e(u,[{key:"_enforceProp",value:function u(e){if(!this.node.hasOwnProperty(e)){throw new Error("Node of type "+this.node.type+" doesn't have \""+e+'" collection.')}}},{key:"setChild",value:function e(r){var t=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var f=void 0;if(t!=null){if(!n){n=d}this._enforceProp(n);this.node[n][t]=r;f=u.getForNode(r,this,n,t)}else{if(!n){n=a}this._enforceProp(n);this.node[n]=r;f=u.getForNode(r,this,n,null)}return f}},{key:"appendChild",value:function u(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;if(!r){r=d}this._enforceProp(r);var a=this.node[r].length;return this.setChild(e,a,r)}},{key:"insertChildAt",value:function e(r,a){var t=arguments.length>2&&arguments[2]!==undefined?arguments[2]:d;this._enforceProp(t);this.node[t].splice(a,0,r);if(a<=u.getTraversingIndex()){u.updateTraversingIndex(+1)}this._rebuildIndex(this.node,t)}},{key:"remove",value:function e(){if(this.isRemoved()){return}u.registry.delete(this.node);this.node=null;if(!this.parent){return}if(this.index!==null){this.parent[this.property].splice(this.index,1);if(this.index<=u.getTraversingIndex()){u.updateTraversingIndex(-1)}this._rebuildIndex(this.parent,this.property);this.index=null;this.property=null;return}delete this.parent[this.property];this.property=null}},{key:"_rebuildIndex",value:function e(r,d){var a=u.getForNode(r);for(var t=0;t0&&arguments[0]!==undefined?arguments[0]:0;if(this.node.expressions){return u.getForNode(this.node.expressions[r],this,d,r)}else if(this.node.expression&&r==0){return u.getForNode(this.node.expression,this,a)}return null}},{key:"hasEqualSource",value:function u(e){return JSON.stringify(this.node,n)===JSON.stringify(e.node,n)}},{key:"jsonEncode",value:function u(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{},r=e.format,d=e.useLoc;return JSON.stringify(this.node,d?null:n,r)}},{key:"getPreviousSibling",value:function e(){if(!this.parent||this.index==null){return null}return u.getForNode(this.parent[this.property][this.index-1],u.getForNode(this.parent),this.property,this.index-1)}},{key:"getNextSibling",value:function e(){if(!this.parent||this.index==null){return null}return u.getForNode(this.parent[this.property][this.index+1],u.getForNode(this.parent),this.property,this.index+1)}}],[{key:"getForNode",value:function e(r){var d=arguments.length>1&&arguments[1]!==undefined?arguments[1]:null;var a=arguments.length>2&&arguments[2]!==undefined?arguments[2]:null;var t=arguments.length>3&&arguments[3]!==undefined?arguments[3]:-1;if(!r){return null}if(!u.registry.has(r)){u.registry.set(r,new u(r,d,a,t==-1?null:t))}var n=u.registry.get(r);if(d!==null){n.parentPath=d;n.parent=n.parentPath.node}if(a!==null){n.property=a}if(t>=0){n.index=t}return n}},{key:"initRegistry",value:function e(){if(!u.registry){u.registry=new Map}u.registry.clear()}},{key:"updateTraversingIndex",value:function e(r){return u.traversingIndexStack[u.traversingIndexStack.length-1]+=r}},{key:"getTraversingIndex",value:function e(){return u.traversingIndexStack[u.traversingIndexStack.length-1]}}]);return u}();t.initRegistry();t.traversingIndexStack=[];function n(u,e){if(u==="loc"){return undefined}return e}u.exports=t},1379:u=>{u.exports=function u(e){if(e===null||typeof e!=="object"){return e}var r=void 0;if(Array.isArray(e)){r=[]}else{r={}}for(var d in e){r[d]=u(e[d])}return r}},34999:(u,e,r)=>{u.exports=r(54676)}}]); \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/9892.6d289e7baed8c64d88e2.js.LICENSE.txt b/.venv/share/jupyter/lab/static/9892.6d289e7baed8c64d88e2.js.LICENSE.txt new file mode 100644 index 0000000000000000000000000000000000000000..5ef2b40c0581b98689d39124cc07c0cf73c194a4 --- /dev/null +++ b/.venv/share/jupyter/lab/static/9892.6d289e7baed8c64d88e2.js.LICENSE.txt @@ -0,0 +1,15 @@ +/*! +Copyright 2019 Ron Buckton + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ diff --git a/.venv/share/jupyter/lab/static/a009bea404f7a500ded4.woff b/.venv/share/jupyter/lab/static/a009bea404f7a500ded4.woff new file mode 100644 index 0000000000000000000000000000000000000000..e62ff5fdceb428c7b53974b4815c0a76ecae5016 Binary files /dev/null and b/.venv/share/jupyter/lab/static/a009bea404f7a500ded4.woff differ diff --git a/.venv/share/jupyter/lab/static/a3b9817780214caf01e8.svg b/.venv/share/jupyter/lab/static/a3b9817780214caf01e8.svg new file mode 100644 index 0000000000000000000000000000000000000000..b9881a43b7313e5a033582e4bf0bcb26bf11730c --- /dev/null +++ b/.venv/share/jupyter/lab/static/a3b9817780214caf01e8.svg @@ -0,0 +1,3717 @@ + + + + +Created by FontForge 20201107 at Wed Aug 4 12:25:29 2021 + By Robert Madole +Copyright (c) Font Awesome + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.venv/share/jupyter/lab/static/af04542b29eaac04550a.woff b/.venv/share/jupyter/lab/static/af04542b29eaac04550a.woff new file mode 100644 index 0000000000000000000000000000000000000000..57819c51537046bcb02f0a05f62cb681b093c79b Binary files /dev/null and b/.venv/share/jupyter/lab/static/af04542b29eaac04550a.woff differ diff --git a/.venv/share/jupyter/lab/static/af96f67d7accf5fd2a4a.woff b/.venv/share/jupyter/lab/static/af96f67d7accf5fd2a4a.woff new file mode 100644 index 0000000000000000000000000000000000000000..a9d1f345bff3b0131f7759f0022778e393fb2b00 Binary files /dev/null and b/.venv/share/jupyter/lab/static/af96f67d7accf5fd2a4a.woff differ diff --git a/.venv/share/jupyter/lab/static/b418136e3b384baaadec.woff b/.venv/share/jupyter/lab/static/b418136e3b384baaadec.woff new file mode 100644 index 0000000000000000000000000000000000000000..d1ff7c6bd3e49326fd38d631fb05d5106f3455e6 Binary files /dev/null and b/.venv/share/jupyter/lab/static/b418136e3b384baaadec.woff differ diff --git a/.venv/share/jupyter/lab/static/be0a084962d8066884f7.svg b/.venv/share/jupyter/lab/static/be0a084962d8066884f7.svg new file mode 100644 index 0000000000000000000000000000000000000000..463af27c02dd3cf5f729e35f23050d4567855824 --- /dev/null +++ b/.venv/share/jupyter/lab/static/be0a084962d8066884f7.svg @@ -0,0 +1,801 @@ + + + + +Created by FontForge 20201107 at Wed Aug 4 12:25:29 2021 + By Robert Madole +Copyright (c) Font Awesome + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/.venv/share/jupyter/lab/static/bootstrap.js b/.venv/share/jupyter/lab/static/bootstrap.js new file mode 100644 index 0000000000000000000000000000000000000000..9a5ae3eb3187ce70450db1ea825a58b551ac140c --- /dev/null +++ b/.venv/share/jupyter/lab/static/bootstrap.js @@ -0,0 +1,98 @@ +// This file is auto-generated from the corresponding file in /dev_mode +/* + * Copyright (c) Jupyter Development Team. + * Distributed under the terms of the Modified BSD License. + */ + +// We copy some of the pageconfig parsing logic in @jupyterlab/coreutils +// below, since this must run before any other files are loaded (including +// @jupyterlab/coreutils). + +/** + * Get global configuration data for the Jupyter application. + * + * @param name - The name of the configuration option. + * + * @returns The config value or an empty string if not found. + * + * #### Notes + * All values are treated as strings. For browser based applications, it is + * assumed that the page HTML includes a script tag with the id + * `jupyter-config-data` containing the configuration as valid JSON. + */ +let _CONFIG_DATA = null; +function getOption(name) { + if (_CONFIG_DATA === null) { + let configData = {}; + // Use script tag if available. + if (typeof document !== 'undefined' && document) { + const el = document.getElementById('jupyter-config-data'); + + if (el) { + configData = JSON.parse(el.textContent || '{}'); + } + } + _CONFIG_DATA = configData; + } + + return _CONFIG_DATA[name] || ''; +} + +// eslint-disable-next-line no-undef +__webpack_public_path__ = getOption('fullStaticUrl') + '/'; + +function loadScript(url) { + return new Promise((resolve, reject) => { + const newScript = document.createElement('script'); + newScript.onerror = reject; + newScript.onload = resolve; + newScript.async = true; + document.head.appendChild(newScript); + newScript.src = url; + }); +} + +async function loadComponent(url, scope) { + await loadScript(url); + + // From https://webpack.js.org/concepts/module-federation/#dynamic-remote-containers + // eslint-disable-next-line no-undef + await __webpack_init_sharing__('default'); + const container = window._JUPYTERLAB[scope]; + // Initialize the container, it may provide shared modules and may need ours + // eslint-disable-next-line no-undef + await container.init(__webpack_share_scopes__.default); +} + +void (async function bootstrap() { + // This is all the data needed to load and activate plugins. This should be + // gathered by the server and put onto the initial page template. + const extension_data = getOption('federated_extensions'); + + // We first load all federated components so that the shared module + // deduplication can run and figure out which shared modules from all + // components should be actually used. We have to do this before importing + // and using the module that actually uses these components so that all + // dependencies are initialized. + let labExtensionUrl = getOption('fullLabextensionsUrl'); + const extensions = await Promise.allSettled( + extension_data.map(async data => { + await loadComponent( + `${labExtensionUrl}/${data.name}/${data.load}`, + data.name + ); + }) + ); + + extensions.forEach(p => { + if (p.status === 'rejected') { + // There was an error loading the component + console.error(p.reason); + } + }); + + // Now that all federated containers are initialized with the main + // container, we can import the main function. + let main = (await import('./index.out.js')).main; + window.addEventListener('load', main); +})(); diff --git a/.venv/share/jupyter/lab/static/build_log.json b/.venv/share/jupyter/lab/static/build_log.json new file mode 100644 index 0000000000000000000000000000000000000000..54d75ca3cf30ad7aefd9bafe41cc06b3902ecba2 --- /dev/null +++ b/.venv/share/jupyter/lab/static/build_log.json @@ -0,0 +1,805 @@ +[ + { + "bail": true, + "module": { + "rules": [ + { + "test": {}, + "type": "asset/source" + }, + { + "test": {}, + "use": [ + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/style-loader/dist/cjs.js", + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/css-loader/dist/cjs.js" + ] + }, + { + "test": {}, + "type": "asset/source" + }, + { + "test": {}, + "type": "asset/source" + }, + { + "test": {}, + "type": "asset/resource" + }, + { + "test": {}, + "type": "asset/resource" + }, + { + "test": {}, + "type": "asset/resource" + }, + { + "test": {}, + "type": "asset/resource" + }, + { + "test": {}, + "type": "asset/resource" + }, + { + "test": {}, + "type": "asset/resource" + }, + { + "test": {}, + "issuer": {}, + "type": "asset", + "generator": {} + }, + { + "test": {}, + "issuer": {}, + "type": "asset/source" + }, + { + "test": {}, + "type": "javascript/auto" + }, + { + "test": {}, + "resolve": { + "fullySpecified": false + } + }, + { + "test": {}, + "resolve": { + "fullySpecified": false + } + }, + { + "test": {}, + "include": [], + "use": [ + "source-map-loader" + ], + "enforce": "pre" + } + ] + }, + "resolve": { + "fallback": { + "url": false, + "buffer": false, + "crypto": false, + "path": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/path-browserify/index.js", + "process": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/process/browser.js" + } + }, + "watchOptions": { + "poll": 500, + "aggregateTimeout": 1000 + }, + "output": { + "hashFunction": "sha256", + "path": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/build", + "publicPath": "{{page_config.fullStaticUrl}}/", + "filename": "[name].[contenthash].js" + }, + "plugins": [ + { + "definitions": { + "process": "process/browser" + } + }, + { + "options": { + "verbose": true, + "showHelp": true, + "emitError": false, + "strict": true + } + }, + { + "userOptions": { + "chunksSortMode": "none", + "template": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/templates/template.html", + "title": "JupyterLab" + }, + "version": 5 + }, + {}, + { + "buildDir": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/build", + "staticDir": "../static", + "_first": true + }, + { + "_options": { + "library": { + "type": "var", + "name": [ + "_JUPYTERLAB", + "CORE_LIBRARY_FEDERATION" + ] + }, + "name": "CORE_FEDERATION", + "shared": { + "@codemirror/language": { + "requiredVersion": "^6.0.0", + "singleton": true + }, + "@codemirror/state": { + "requiredVersion": "^6.2.0", + "singleton": true + }, + "@codemirror/view": { + "requiredVersion": "^6.9.6", + "singleton": true + }, + "@jupyter/react-components": { + "requiredVersion": "^0.16.6", + "singleton": true + }, + "@jupyter/web-components": { + "requiredVersion": "^0.16.6", + "singleton": true + }, + "@jupyter/ydoc": { + "requiredVersion": "^3.0.0-a3", + "singleton": true + }, + "@jupyterlab/application": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/application-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/apputils": { + "requiredVersion": "~4.5.6", + "singleton": true + }, + "@jupyterlab/apputils-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/attachments": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/cell-toolbar": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/cell-toolbar-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/cells": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/celltags-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/codeeditor": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/codemirror": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/codemirror-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/completer": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/completer-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/console": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/console-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/coreutils": { + "requiredVersion": "~6.4.6", + "singleton": true + }, + "@jupyterlab/csvviewer": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/csvviewer-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/debugger": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/debugger-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/docmanager": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/docmanager-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/docregistry": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/documentsearch": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/documentsearch-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/extensionmanager": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/extensionmanager-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/filebrowser": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/filebrowser-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/fileeditor": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/fileeditor-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/help-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/htmlviewer": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/htmlviewer-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/hub-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/imageviewer": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/imageviewer-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/inspector": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/inspector-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/javascript-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/json-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/launcher": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/launcher-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/logconsole": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/logconsole-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/lsp": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/lsp-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/mainmenu": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/mainmenu-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/markdownviewer": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/markdownviewer-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/markedparser-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/mathjax-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/mermaid": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/mermaid-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/metadataform": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/metadataform-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/metapackage": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/nbconvert-css": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/nbformat": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/notebook": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/notebook-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/observables": { + "requiredVersion": "~5.4.6" + }, + "@jupyterlab/outputarea": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/pdf-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/pluginmanager": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/pluginmanager-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/property-inspector": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/rendermime": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/rendermime-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/rendermime-interfaces": { + "requiredVersion": "~3.12.6", + "singleton": true + }, + "@jupyterlab/running": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/running-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/services": { + "requiredVersion": "~7.4.6", + "singleton": true + }, + "@jupyterlab/services-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/settingeditor": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/settingeditor-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/settingregistry": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/shortcuts-extension": { + "requiredVersion": "~5.2.6" + }, + "@jupyterlab/statedb": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/statusbar": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/statusbar-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/terminal": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/terminal-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/theme-dark-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/theme-dark-high-contrast-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/theme-light-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/toc": { + "requiredVersion": "~6.4.6", + "singleton": true + }, + "@jupyterlab/toc-extension": { + "requiredVersion": "~6.4.6" + }, + "@jupyterlab/tooltip": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/tooltip-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/translation": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/translation-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/ui-components": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/ui-components-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/vega5-extension": { + "requiredVersion": "~4.4.6" + }, + "@jupyterlab/workspaces": { + "requiredVersion": "~4.4.6", + "singleton": true + }, + "@jupyterlab/workspaces-extension": { + "requiredVersion": "~4.4.6" + }, + "@lezer/common": { + "requiredVersion": "^1.0.0", + "singleton": true + }, + "@lezer/highlight": { + "requiredVersion": "^1.0.0", + "singleton": true + }, + "@lumino/algorithm": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/application": { + "requiredVersion": "^2.3.0-alpha.0", + "singleton": true + }, + "@lumino/commands": { + "requiredVersion": "^2.0.1", + "singleton": true + }, + "@lumino/coreutils": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/datagrid": { + "requiredVersion": "^2.3.0-alpha.0", + "singleton": true + }, + "@lumino/disposable": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/domutils": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/dragdrop": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/keyboard": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/messaging": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/polling": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/properties": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/signaling": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/virtualdom": { + "requiredVersion": "^2.0.0", + "singleton": true + }, + "@lumino/widgets": { + "requiredVersion": "^2.3.1-alpha.0", + "singleton": true + }, + "@microsoft/fast-element": { + "requiredVersion": "^1.12.0", + "singleton": true + }, + "@microsoft/fast-foundation": { + "requiredVersion": "^2.49.2", + "singleton": true + }, + "react": { + "requiredVersion": "^18.2.0", + "singleton": true + }, + "react-dom": { + "requiredVersion": "^18.2.0", + "singleton": true + }, + "yjs": { + "requiredVersion": "^13.5.40", + "singleton": true + }, + "react-toastify": { + "requiredVersion": "^9.0.8" + }, + "@rjsf/utils": { + "requiredVersion": "^5.13.4" + }, + "@codemirror/commands": { + "requiredVersion": "^6.8.1" + }, + "@codemirror/lang-markdown": { + "requiredVersion": "^6.3.2" + }, + "@codemirror/legacy-modes": { + "requiredVersion": "^6.5.1" + }, + "@codemirror/search": { + "requiredVersion": "^6.5.10" + }, + "@rjsf/validator-ajv8": { + "requiredVersion": "^5.13.4" + }, + "marked": { + "requiredVersion": "^15.0.7" + }, + "marked-gfm-heading-id": { + "requiredVersion": "^4.1.1" + }, + "marked-mangle": { + "requiredVersion": "^1.1.10" + }, + "mathjax-full": { + "requiredVersion": "^3.2.2" + }, + "react-highlight-words": { + "requiredVersion": "^0.20.0" + }, + "react-json-tree": { + "requiredVersion": "^0.18.0" + }, + "style-mod": { + "requiredVersion": "^4.0.0" + }, + "vega": { + "requiredVersion": "^5.20.0" + }, + "vega-embed": { + "requiredVersion": "^6.2.1" + }, + "vega-lite": { + "requiredVersion": "^5.6.1-next.1" + } + } + } + } + ], + "mode": "development", + "entry": { + "main": [ + "./publicpath", + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/build/bootstrap.js" + ] + }, + "optimization": { + "splitChunks": { + "chunks": "all", + "cacheGroups": { + "jlab_core": { + "test": {}, + "name": "jlab_core" + } + } + } + }, + "devtool": "inline-source-map", + "externals": [ + "ws" + ] + }, + { + "mode": "production", + "entry": { + "index": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/@jupyterlab/theme-dark-extension/style/theme.css" + }, + "output": { + "path": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/themes/@jupyterlab/theme-dark-extension", + "filename": "[name].js", + "hashFunction": "sha256" + }, + "module": { + "rules": [ + { + "test": {}, + "use": [ + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/mini-css-extract-plugin/dist/loader.js", + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/css-loader/dist/cjs.js" + ] + }, + { + "test": {}, + "type": "asset/inline", + "generator": {} + }, + { + "test": {}, + "type": "asset" + } + ] + }, + "plugins": [ + { + "_sortedModulesCache": {}, + "options": { + "filename": "[name].css", + "ignoreOrder": false, + "runtime": true, + "chunkFilename": "[id].css" + }, + "runtimeOptions": { + "linkType": "text/css" + } + } + ] + }, + { + "mode": "production", + "entry": { + "index": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/@jupyterlab/theme-dark-high-contrast-extension/style/theme.css" + }, + "output": { + "path": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/themes/@jupyterlab/theme-dark-high-contrast-extension", + "filename": "[name].js", + "hashFunction": "sha256" + }, + "module": { + "rules": [ + { + "test": {}, + "use": [ + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/mini-css-extract-plugin/dist/loader.js", + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/css-loader/dist/cjs.js" + ] + }, + { + "test": {}, + "type": "asset/inline", + "generator": {} + }, + { + "test": {}, + "type": "asset" + } + ] + }, + "plugins": [ + { + "_sortedModulesCache": {}, + "options": { + "filename": "[name].css", + "ignoreOrder": false, + "runtime": true, + "chunkFilename": "[id].css" + }, + "runtimeOptions": { + "linkType": "text/css" + } + } + ] + }, + { + "mode": "production", + "entry": { + "index": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/@jupyterlab/theme-light-extension/style/theme.css" + }, + "output": { + "path": "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/themes/@jupyterlab/theme-light-extension", + "filename": "[name].js", + "hashFunction": "sha256" + }, + "module": { + "rules": [ + { + "test": {}, + "use": [ + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/mini-css-extract-plugin/dist/loader.js", + "/home/runner/work/jupyterlab/jupyterlab/.jupyter_releaser_checkout/jupyterlab/staging/node_modules/css-loader/dist/cjs.js" + ] + }, + { + "test": {}, + "type": "asset/inline", + "generator": {} + }, + { + "test": {}, + "type": "asset" + } + ] + }, + "plugins": [ + { + "_sortedModulesCache": {}, + "options": { + "filename": "[name].css", + "ignoreOrder": false, + "runtime": true, + "chunkFilename": "[id].css" + }, + "runtimeOptions": { + "linkType": "text/css" + } + } + ] + } +] \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/c49810b53ecc0d87d802.woff b/.venv/share/jupyter/lab/static/c49810b53ecc0d87d802.woff new file mode 100644 index 0000000000000000000000000000000000000000..e735ddf8505afa47b3901ab90560caa72e57b755 Binary files /dev/null and b/.venv/share/jupyter/lab/static/c49810b53ecc0d87d802.woff differ diff --git a/.venv/share/jupyter/lab/static/c56da8d69f1a0208b8e0.woff b/.venv/share/jupyter/lab/static/c56da8d69f1a0208b8e0.woff new file mode 100644 index 0000000000000000000000000000000000000000..510a8dacfa0a6e6db1e139cf1ae6095c689f3849 Binary files /dev/null and b/.venv/share/jupyter/lab/static/c56da8d69f1a0208b8e0.woff differ diff --git a/.venv/share/jupyter/lab/static/cb9e9e693192413cde2b.woff b/.venv/share/jupyter/lab/static/cb9e9e693192413cde2b.woff new file mode 100644 index 0000000000000000000000000000000000000000..ad077c6bec782b7c15bfa4ec96ee5900faaa3ccb Binary files /dev/null and b/.venv/share/jupyter/lab/static/cb9e9e693192413cde2b.woff differ diff --git a/.venv/share/jupyter/lab/static/e42a88444448ac3d6054.woff2 b/.venv/share/jupyter/lab/static/e42a88444448ac3d6054.woff2 new file mode 100644 index 0000000000000000000000000000000000000000..56328948b3b1bacb23a13af9d727fd75c0343448 Binary files /dev/null and b/.venv/share/jupyter/lab/static/e42a88444448ac3d6054.woff2 differ diff --git a/.venv/share/jupyter/lab/static/e8711bbb871afd8e9dea.ttf b/.venv/share/jupyter/lab/static/e8711bbb871afd8e9dea.ttf new file mode 100644 index 0000000000000000000000000000000000000000..7157aafbacdb095b479ae52f59e28e19ce61d79a Binary files /dev/null and b/.venv/share/jupyter/lab/static/e8711bbb871afd8e9dea.ttf differ diff --git a/.venv/share/jupyter/lab/static/f9217f66874b0c01cd8c.woff b/.venv/share/jupyter/lab/static/f9217f66874b0c01cd8c.woff new file mode 100644 index 0000000000000000000000000000000000000000..3375bef0911555af28fea3c02c3e7671c50a5e7b Binary files /dev/null and b/.venv/share/jupyter/lab/static/f9217f66874b0c01cd8c.woff differ diff --git a/.venv/share/jupyter/lab/static/fc6ddf5df402b263cfb1.woff b/.venv/share/jupyter/lab/static/fc6ddf5df402b263cfb1.woff new file mode 100644 index 0000000000000000000000000000000000000000..22e5eff737c68962138420de5742413683fbcea0 Binary files /dev/null and b/.venv/share/jupyter/lab/static/fc6ddf5df402b263cfb1.woff differ diff --git a/.venv/share/jupyter/lab/static/index.html b/.venv/share/jupyter/lab/static/index.html new file mode 100644 index 0000000000000000000000000000000000000000..5e01386d8c766bddb19a79f7cf1495d3d9a5fe0a --- /dev/null +++ b/.venv/share/jupyter/lab/static/index.html @@ -0,0 +1,25 @@ +JupyterLab{# Copy so we do not modify the page_config with updates. #} {% set page_config_full = page_config.copy() %} {# Set a dummy variable - we just want the side effect of the update. #} {% set _ = page_config_full.update(baseUrl=base_url, wsUrl=ws_url) %}{% block favicon %}{% endblock %} {% if custom_css %}{% endif %} \ No newline at end of file diff --git a/.venv/share/jupyter/lab/static/index.out.js b/.venv/share/jupyter/lab/static/index.out.js new file mode 100644 index 0000000000000000000000000000000000000000..a0d845be45f025098774346159d57e96933a05c3 --- /dev/null +++ b/.venv/share/jupyter/lab/static/index.out.js @@ -0,0 +1,827 @@ +// This file is auto-generated from the corresponding file in /dev_mode +/* + * Copyright (c) Jupyter Development Team. + * Distributed under the terms of the Modified BSD License. + */ + +import { PageConfig } from '@jupyterlab/coreutils'; +import { PluginRegistry } from '@lumino/coreutils'; + +import './style.js'; + +async function createModule(scope, module) { + try { + const factory = await window._JUPYTERLAB[scope].get(module); + const instance = factory(); + instance.__scope__ = scope; + return instance; + } catch(e) { + console.warn(`Failed to create module: package: ${scope}; module: ${module}`); + throw e; + } +} + +/** + * The main entry point for the application. + */ +export async function main() { + + // Handle a browser test. + // Set up error handling prior to loading extensions. + var browserTest = PageConfig.getOption('browserTest'); + if (browserTest.toLowerCase() === 'true') { + var el = document.createElement('div'); + el.id = 'browserTest'; + document.body.appendChild(el); + el.textContent = '[]'; + el.style.display = 'none'; + var errors = []; + var reported = false; + var timeout = 25000; + + var report = function() { + if (reported) { + return; + } + reported = true; + el.className = 'completed'; + } + + window.onerror = function(msg, url, line, col, error) { + errors.push(String(error)); + el.textContent = JSON.stringify(errors) + }; + console.error = function(message) { + errors.push(String(message)); + el.textContent = JSON.stringify(errors) + }; + } + + var pluginRegistry = new PluginRegistry(); + var JupyterLab = require('@jupyterlab/application').JupyterLab; + var disabled = []; + var deferred = []; + var ignorePlugins = []; + var register = []; + + + const federatedExtensionPromises = []; + const federatedMimeExtensionPromises = []; + const federatedStylePromises = []; + + // Start initializing the federated extensions + const extensions = JSON.parse( + PageConfig.getOption('federated_extensions') + ); + + // Keep a mapping of renamed plugin ids to ensure user configs don't break. + // The mapping is defined in the main index.js for JupyterLab, since it may not be relevant for + // other lab-based applications (they may not use the same set of plugins). + const renamedPluginIds = { + '@jupyterlab/application:mimedocument': '@jupyterlab/application-extension:mimedocument', + '@jupyterlab/help-extension:licenses': '@jupyterlab/apputils-extension:licenses-plugin', + '@jupyterlab/lsp:ILSPCodeExtractorsManager': '@jupyterlab/lsp-extension:code-extractor-manager', + '@jupyterlab/translation:translator': '@jupyterlab/translation-extension:translator', + '@jupyterlab/workspaces:commands': '@jupyterlab/workspaces-extension:commands' + }; + + // Transparently handle the case of renamed plugins, so current configs don't break. + // And emit a warning in the dev tools console to notify about the rename so + // users can update their config. + const disabledExtensions = PageConfig.Extension.disabled.map(id => { + if (renamedPluginIds[id]) { + console.warn(`Plugin ${id} has been renamed to ${renamedPluginIds[id]}. Consider updating your config to use the new name.`); + return renamedPluginIds[id]; + } + return id; + }); + + const deferredExtensions = PageConfig.Extension.deferred.map(id => { + if (renamedPluginIds[id]) { + console.warn(`Plugin id ${id} has been renamed to ${renamedPluginIds[id]}. Consider updating your config to use the new name.`); + return renamedPluginIds[id]; + } + return id; + }); + + // This is basically a copy of PageConfig.Extension.isDisabled to + // take into account the case of renamed plugins. + const isPluginDisabled = (id) => { + const separatorIndex = id.indexOf(':'); + let extName = ''; + if (separatorIndex !== -1) { + extName = id.slice(0, separatorIndex); + } + return disabledExtensions.some(val => val === id || (extName && val === extName)); + } + + // This is basically a copy of PageConfig.Extension.isDeferred to + // take into account the case of renamed plugins. + const isPluginDeferred = (id) => { + const separatorIndex = id.indexOf(':'); + let extName = ''; + if (separatorIndex !== -1) { + extName = id.slice(0, separatorIndex); + } + return deferredExtensions.some(val => val === id || (extName && val === extName)); + } + + const queuedFederated = []; + + extensions.forEach(data => { + if (data.extension) { + queuedFederated.push(data.name); + federatedExtensionPromises.push(createModule(data.name, data.extension)); + } + if (data.mimeExtension) { + queuedFederated.push(data.name); + federatedMimeExtensionPromises.push(createModule(data.name, data.mimeExtension)); + } + + if (data.style && !isPluginDisabled(data.name)) { + federatedStylePromises.push(createModule(data.name, data.style)); + } + }); + + const allPlugins = []; + + /** + * Get the plugins from an extension. + */ + function getPlugins(extension) { + // Handle commonjs or es2015 modules + let exports; + if (extension.hasOwnProperty('__esModule')) { + exports = extension.default; + } else { + // CommonJS exports. + exports = extension; + } + + return Array.isArray(exports) ? exports : [exports]; + } + + /** + * Iterate over active plugins in an extension. + * + * #### Notes + * This also populates the disabled, deferred, and ignored arrays. + */ + function* activePlugins(extension) { + const plugins = getPlugins(extension); + for (let plugin of plugins) { + const isDisabled = isPluginDisabled(plugin.id); + allPlugins.push({ + id: plugin.id, + description: plugin.description, + requires: plugin.requires ?? [], + optional: plugin.optional ?? [], + provides: plugin.provides ?? null, + autoStart: plugin.autoStart, + enabled: !isDisabled, + extension: extension.__scope__ + }); + if (isDisabled) { + disabled.push(plugin.id); + continue; + } + if (isPluginDeferred(plugin.id)) { + deferred.push(plugin.id); + ignorePlugins.push(plugin.id); + } + yield plugin; + } + } + + // Handle the registered mime extensions. + const mimeExtensions = []; + if (!queuedFederated.includes('@jupyterlab/javascript-extension')) { + try { + let ext = require('@jupyterlab/javascript-extension'); + ext.__scope__ = '@jupyterlab/javascript-extension'; + for (let plugin of activePlugins(ext)) { + mimeExtensions.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/json-extension')) { + try { + let ext = require('@jupyterlab/json-extension'); + ext.__scope__ = '@jupyterlab/json-extension'; + for (let plugin of activePlugins(ext)) { + mimeExtensions.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/mermaid-extension')) { + try { + let ext = require('@jupyterlab/mermaid-extension/lib/mime.js'); + ext.__scope__ = '@jupyterlab/mermaid-extension'; + for (let plugin of activePlugins(ext)) { + mimeExtensions.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/pdf-extension')) { + try { + let ext = require('@jupyterlab/pdf-extension'); + ext.__scope__ = '@jupyterlab/pdf-extension'; + for (let plugin of activePlugins(ext)) { + mimeExtensions.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/vega5-extension')) { + try { + let ext = require('@jupyterlab/vega5-extension'); + ext.__scope__ = '@jupyterlab/vega5-extension'; + for (let plugin of activePlugins(ext)) { + mimeExtensions.push(plugin); + } + } catch (e) { + console.error(e); + } + } + + // Add the federated mime extensions. + const federatedMimeExtensions = await Promise.allSettled(federatedMimeExtensionPromises); + federatedMimeExtensions.forEach(p => { + if (p.status === "fulfilled") { + for (let plugin of activePlugins(p.value)) { + mimeExtensions.push(plugin); + } + } else { + console.error(p.reason); + } + }); + + // Handled the registered standard extensions. + if (!queuedFederated.includes('@jupyterlab/application-extension')) { + try { + let ext = require('@jupyterlab/application-extension'); + ext.__scope__ = '@jupyterlab/application-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/apputils-extension')) { + try { + let ext = require('@jupyterlab/apputils-extension'); + ext.__scope__ = '@jupyterlab/apputils-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/cell-toolbar-extension')) { + try { + let ext = require('@jupyterlab/cell-toolbar-extension'); + ext.__scope__ = '@jupyterlab/cell-toolbar-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/celltags-extension')) { + try { + let ext = require('@jupyterlab/celltags-extension'); + ext.__scope__ = '@jupyterlab/celltags-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/codemirror-extension')) { + try { + let ext = require('@jupyterlab/codemirror-extension'); + ext.__scope__ = '@jupyterlab/codemirror-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/completer-extension')) { + try { + let ext = require('@jupyterlab/completer-extension'); + ext.__scope__ = '@jupyterlab/completer-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/console-extension')) { + try { + let ext = require('@jupyterlab/console-extension'); + ext.__scope__ = '@jupyterlab/console-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/csvviewer-extension')) { + try { + let ext = require('@jupyterlab/csvviewer-extension'); + ext.__scope__ = '@jupyterlab/csvviewer-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/debugger-extension')) { + try { + let ext = require('@jupyterlab/debugger-extension'); + ext.__scope__ = '@jupyterlab/debugger-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/docmanager-extension')) { + try { + let ext = require('@jupyterlab/docmanager-extension'); + ext.__scope__ = '@jupyterlab/docmanager-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/documentsearch-extension')) { + try { + let ext = require('@jupyterlab/documentsearch-extension'); + ext.__scope__ = '@jupyterlab/documentsearch-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/extensionmanager-extension')) { + try { + let ext = require('@jupyterlab/extensionmanager-extension'); + ext.__scope__ = '@jupyterlab/extensionmanager-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/filebrowser-extension')) { + try { + let ext = require('@jupyterlab/filebrowser-extension'); + ext.__scope__ = '@jupyterlab/filebrowser-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/fileeditor-extension')) { + try { + let ext = require('@jupyterlab/fileeditor-extension'); + ext.__scope__ = '@jupyterlab/fileeditor-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/help-extension')) { + try { + let ext = require('@jupyterlab/help-extension'); + ext.__scope__ = '@jupyterlab/help-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/htmlviewer-extension')) { + try { + let ext = require('@jupyterlab/htmlviewer-extension'); + ext.__scope__ = '@jupyterlab/htmlviewer-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/hub-extension')) { + try { + let ext = require('@jupyterlab/hub-extension'); + ext.__scope__ = '@jupyterlab/hub-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/imageviewer-extension')) { + try { + let ext = require('@jupyterlab/imageviewer-extension'); + ext.__scope__ = '@jupyterlab/imageviewer-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/inspector-extension')) { + try { + let ext = require('@jupyterlab/inspector-extension'); + ext.__scope__ = '@jupyterlab/inspector-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/launcher-extension')) { + try { + let ext = require('@jupyterlab/launcher-extension'); + ext.__scope__ = '@jupyterlab/launcher-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/logconsole-extension')) { + try { + let ext = require('@jupyterlab/logconsole-extension'); + ext.__scope__ = '@jupyterlab/logconsole-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/lsp-extension')) { + try { + let ext = require('@jupyterlab/lsp-extension'); + ext.__scope__ = '@jupyterlab/lsp-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/mainmenu-extension')) { + try { + let ext = require('@jupyterlab/mainmenu-extension'); + ext.__scope__ = '@jupyterlab/mainmenu-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/markdownviewer-extension')) { + try { + let ext = require('@jupyterlab/markdownviewer-extension'); + ext.__scope__ = '@jupyterlab/markdownviewer-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/markedparser-extension')) { + try { + let ext = require('@jupyterlab/markedparser-extension'); + ext.__scope__ = '@jupyterlab/markedparser-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/mathjax-extension')) { + try { + let ext = require('@jupyterlab/mathjax-extension'); + ext.__scope__ = '@jupyterlab/mathjax-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/mermaid-extension')) { + try { + let ext = require('@jupyterlab/mermaid-extension'); + ext.__scope__ = '@jupyterlab/mermaid-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/metadataform-extension')) { + try { + let ext = require('@jupyterlab/metadataform-extension'); + ext.__scope__ = '@jupyterlab/metadataform-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/notebook-extension')) { + try { + let ext = require('@jupyterlab/notebook-extension'); + ext.__scope__ = '@jupyterlab/notebook-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/pluginmanager-extension')) { + try { + let ext = require('@jupyterlab/pluginmanager-extension'); + ext.__scope__ = '@jupyterlab/pluginmanager-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/rendermime-extension')) { + try { + let ext = require('@jupyterlab/rendermime-extension'); + ext.__scope__ = '@jupyterlab/rendermime-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/running-extension')) { + try { + let ext = require('@jupyterlab/running-extension'); + ext.__scope__ = '@jupyterlab/running-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/services-extension')) { + try { + let ext = require('@jupyterlab/services-extension'); + ext.__scope__ = '@jupyterlab/services-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/settingeditor-extension')) { + try { + let ext = require('@jupyterlab/settingeditor-extension'); + ext.__scope__ = '@jupyterlab/settingeditor-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/shortcuts-extension')) { + try { + let ext = require('@jupyterlab/shortcuts-extension'); + ext.__scope__ = '@jupyterlab/shortcuts-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/statusbar-extension')) { + try { + let ext = require('@jupyterlab/statusbar-extension'); + ext.__scope__ = '@jupyterlab/statusbar-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/terminal-extension')) { + try { + let ext = require('@jupyterlab/terminal-extension'); + ext.__scope__ = '@jupyterlab/terminal-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/theme-dark-extension')) { + try { + let ext = require('@jupyterlab/theme-dark-extension'); + ext.__scope__ = '@jupyterlab/theme-dark-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/theme-dark-high-contrast-extension')) { + try { + let ext = require('@jupyterlab/theme-dark-high-contrast-extension'); + ext.__scope__ = '@jupyterlab/theme-dark-high-contrast-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/theme-light-extension')) { + try { + let ext = require('@jupyterlab/theme-light-extension'); + ext.__scope__ = '@jupyterlab/theme-light-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/toc-extension')) { + try { + let ext = require('@jupyterlab/toc-extension'); + ext.__scope__ = '@jupyterlab/toc-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/tooltip-extension')) { + try { + let ext = require('@jupyterlab/tooltip-extension'); + ext.__scope__ = '@jupyterlab/tooltip-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/translation-extension')) { + try { + let ext = require('@jupyterlab/translation-extension'); + ext.__scope__ = '@jupyterlab/translation-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/ui-components-extension')) { + try { + let ext = require('@jupyterlab/ui-components-extension'); + ext.__scope__ = '@jupyterlab/ui-components-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + if (!queuedFederated.includes('@jupyterlab/workspaces-extension')) { + try { + let ext = require('@jupyterlab/workspaces-extension'); + ext.__scope__ = '@jupyterlab/workspaces-extension'; + for (let plugin of activePlugins(ext)) { + register.push(plugin); + } + } catch (e) { + console.error(e); + } + } + + // Add the federated extensions. + const federatedExtensions = await Promise.allSettled(federatedExtensionPromises); + federatedExtensions.forEach(p => { + if (p.status === "fulfilled") { + for (let plugin of activePlugins(p.value)) { + register.push(plugin); + } + } else { + console.error(p.reason); + } + }); + + // Load all federated component styles and log errors for any that do not + (await Promise.allSettled(federatedStylePromises)).filter(({status}) => status === "rejected").forEach(({reason}) => { + console.error(reason); + }); + + // 2. Register the plugins + pluginRegistry.registerPlugins(register); + + // 3. Get and resolve the service manager and connection status plugins + const IConnectionStatus = require('@jupyterlab/services').IConnectionStatus; + const IServiceManager = require('@jupyterlab/services').IServiceManager; + const connectionStatus = await pluginRegistry.resolveOptionalService(IConnectionStatus); + const serviceManager = await pluginRegistry.resolveRequiredService(IServiceManager); + + const lab = new JupyterLab({ + pluginRegistry, + serviceManager, + mimeExtensions, + connectionStatus, + disabled: { + matches: disabled, + patterns: disabledExtensions + .map(function (val) { return val.raw; }) + }, + deferred: { + matches: deferred, + patterns: deferredExtensions + .map(function (val) { return val.raw; }) + }, + availablePlugins: allPlugins + }); + + // 4. Start the application, which will activate the other plugins + lab.start({ ignorePlugins, bubblingKeydown: true }); + + // Expose global app instance when in dev mode or when toggled explicitly. + var exposeAppInBrowser = (PageConfig.getOption('exposeAppInBrowser') || '').toLowerCase() === 'true'; + var devMode = (PageConfig.getOption('devMode') || '').toLowerCase() === 'true'; + + if (exposeAppInBrowser || devMode) { + window.jupyterapp = lab; + } + + // Handle a browser test. + if (browserTest.toLowerCase() === 'true') { + lab.restored + .then(function() { report(errors); }) + .catch(function(reason) { report([`RestoreError: ${reason.message}`]); }); + + // Handle failures to restore after the timeout has elapsed. + window.setTimeout(function() { report(errors); }, timeout); + } +} diff --git a/.venv/share/jupyter/lab/static/jlab_core.4a2106ef64a5fd6bb332.js b/.venv/share/jupyter/lab/static/jlab_core.4a2106ef64a5fd6bb332.js new file mode 100644 index 0000000000000000000000000000000000000000..51362d59e53c27f9d5d76309cf8e90f57634550d --- /dev/null +++ b/.venv/share/jupyter/lab/static/jlab_core.4a2106ef64a5fd6bb332.js @@ -0,0 +1 @@ +(self["webpackChunk_jupyterlab_application_top"]=self["webpackChunk_jupyterlab_application_top"]||[]).push([[4470],{27902:(e,t,n)=>{"use strict";n.r(t);n.d(t,{DEFAULT_CONTEXT_ITEM_RANK:()=>y,default:()=>F});var i=n(74991);var s=n(72050);var o=n(37737);var r=n(12173);var a=n(15615);var l=n(86503);var d=n(66987);var c=n(61927);var h=n(66127);var u=n(34236);var p=n(5592);var m=n(93247);var g=n(90044);var f=n(1143);var v=n(44914);const _="TopBar";const b={id:"@jupyterlab/application-extension:top-bar",description:"Adds a toolbar to the top area (next to the main menu bar).",autoStart:true,requires:[a.ISettingRegistry,s.IToolbarWidgetRegistry],optional:[c.ITranslator],activate:(e,t,n,i)=>{const o=(i!==null&&i!==void 0?i:c.nullTranslator).load("jupyterlab");const r=new h.Toolbar;r.id="jp-top-bar";r.node.setAttribute("aria-label",o.__("Topbar toolbar"));(0,s.setToolbar)(r,(0,s.createToolbarFactory)(n,t,_,b.id,i!==null&&i!==void 0?i:c.nullTranslator),r);e.shell.add(r,"top",{rank:900})}};const y=100;var w;(function(e){e.activateNextTab="application:activate-next-tab";e.activatePreviousTab="application:activate-previous-tab";e.activateNextTabBar="application:activate-next-tab-bar";e.activatePreviousTabBar="application:activate-previous-tab-bar";e.close="application:close";e.closeOtherTabs="application:close-other-tabs";e.closeRightTabs="application:close-right-tabs";e.closeAll="application:close-all";e.setMode="application:set-mode";e.showPropertyPanel="property-inspector:show-panel";e.resetLayout="application:reset-layout";e.toggleContextMenu="application:toggle-context-menu";e.toggleHeader="application:toggle-header";e.toggleMode="application:toggle-mode";e.toggleLeftArea="application:toggle-left-area";e.toggleRightArea="application:toggle-right-area";e.toggleSideTabBar="application:toggle-side-tabbar";e.toggleSidebarWidget="application:toggle-sidebar-widget";e.togglePresentationMode="application:toggle-presentation-mode";e.toggleFullscreenMode="application:toggle-fullscreen-mode";e.tree="router:tree";e.switchSidebar="sidebar:switch"})(w||(w={}));const C={id:"@jupyterlab/application-extension:commands",description:"Adds commands related to the shell.",autoStart:true,requires:[c.ITranslator],optional:[i.ILabShell,s.ICommandPalette],activate:(e,t,n,s)=>{var r;const{commands:a,shell:l}=e;const d=t.load("jupyterlab");const c=d.__("Main Area");a.addCommand(i.JupyterFrontEndContextMenu.contextMenu,{label:d.__("Shift+Right Click for Browser Menu"),isEnabled:()=>false,execute:()=>void 0});const h=()=>{const t=e=>!!e.dataset.id;const n=e.contextMenuHitTest(t);if(!n){return l.currentWidget}return(0,u.find)(l.widgets("main"),(e=>e.id===n.dataset.id))||l.currentWidget};const p=e=>{e.forEach((e=>e.close()))};const m=(e,t)=>{if(e.type==="tab-area"){return e.widgets.includes(t)?e:null}if(e.type==="split-area"){for(const n of e.children){const e=m(n,t);if(e){return e}}}return null};const g=e=>{var t;const i=n===null||n===void 0?void 0:n.saveLayout();const s=i===null||i===void 0?void 0:i.mainArea;if(!s||o.PageConfig.getOption("mode")!=="multiple-document"){return null}const r=(t=s.dock)===null||t===void 0?void 0:t.main;return r?m(r,e):null};const f=e=>{const{id:t}=e;const n=g(e);const i=n?n.widgets||[]:[];const s=i.findIndex((e=>e.id===t));if(s<0){return[]}return i.slice(s+1)};const v=e=>{let t;if(e!="left"&&e!="right"){throw Error(`Unsupported sidebar: ${e}`)}if(e==="left"){t=document.querySelector(".lm-TabBar-tab.lm-mod-current")}else{const e=document.querySelectorAll(".lm-TabBar-tab.lm-mod-current");t=e[e.length-1]}const n=t===null||t===void 0?void 0:t.getAttribute("data-id");if(n){return n===null||n===void 0?void 0:n.toString()}else{return""}};function _(e){if(e){e.focus()}}a.addCommand(w.close,{label:()=>d.__("Close Tab"),isEnabled:()=>{const e=h();return!!e&&e.title.closable},execute:()=>{const e=h();if(e){e.close()}}});a.addCommand(w.closeOtherTabs,{label:()=>d.__("Close All Other Tabs"),isEnabled:()=>(0,u.some)(l.widgets("main"),((e,t)=>t===1)),execute:()=>{const e=h();if(!e){return}const{id:t}=e;for(const n of l.widgets("main")){if(n.id!==t){n.close()}}}});a.addCommand(w.closeRightTabs,{label:()=>d.__("Close Tabs to Right"),isEnabled:()=>!!h()&&f(h()).length>0,execute:()=>{const e=h();if(!e){return}p(f(e))}});(r=l.currentChanged)===null||r===void 0?void 0:r.connect((()=>{[w.close,w.closeOtherTabs,w.closeRightTabs].forEach((e=>a.notifyCommandChanged(e)))}));if(n){a.addCommand(w.activateNextTab,{label:d.__("Activate Next Tab"),execute:()=>{n.activateNextTab()}});a.addCommand(w.activatePreviousTab,{label:d.__("Activate Previous Tab"),execute:()=>{n.activatePreviousTab()}});a.addCommand(w.activateNextTabBar,{label:d.__("Activate Next Tab Bar"),execute:()=>{n.activateNextTabBar()}});a.addCommand(w.activatePreviousTabBar,{label:d.__("Activate Previous Tab Bar"),execute:()=>{n.activatePreviousTabBar()}});a.addCommand(w.closeAll,{label:d.__("Close All Tabs"),execute:()=>{n.closeAll()}});a.addCommand(w.toggleHeader,{label:d.__("Show Header"),execute:()=>{if(n.mode==="single-document"){n.toggleTopInSimpleModeVisibility()}},isToggled:()=>n.isTopInSimpleModeVisible(),isVisible:()=>n.mode==="single-document"});a.addCommand(w.toggleLeftArea,{label:d.__("Show Left Sidebar"),execute:()=>{if(n.leftCollapsed){n.expandLeft()}else{n.collapseLeft();if(n.currentWidget){n.activateById(n.currentWidget.id)}}},isToggled:()=>!n.leftCollapsed,isEnabled:()=>!n.isEmpty("left")});a.addCommand(w.toggleRightArea,{label:d.__("Show Right Sidebar"),execute:()=>{if(n.rightCollapsed){n.expandRight()}else{n.collapseRight();if(n.currentWidget){n.activateById(n.currentWidget.id)}}},isToggled:()=>!n.rightCollapsed,isEnabled:()=>!n.isEmpty("right")});a.addCommand(w.toggleSidebarWidget,{label:e=>e===undefined||e.side===undefined||e.index===undefined?d.__("Toggle Sidebar Element"):e.side==="right"?d.__("Toggle Element %1 in Right Sidebar",parseInt(e.index,10)+1):d.__("Toggle Element %1 in Left Sidebar",parseInt(e.index,10)+1),execute:e=>{const t=parseInt(e.index,10);if(e.side!="left"&&e.side!="right"){throw Error(`Unsupported sidebar: ${e.side}`)}const i=Array.from(n.widgets(e.side));if(t>=i.length){return}const s=i[t].id;const o=document.querySelector("[data-id='"+s+"']");if(v(e.side)===s){if(e.side=="left"){n.collapseLeft();_(o)}if(e.side=="right"){n.collapseRight();_(o)}}else{n.activateById(s);_(o)}}});a.addCommand(w.toggleSideTabBar,{label:e=>e.side==="right"?d.__("Show Right Activity Bar"):d.__("Show Left Activity Bar"),execute:e=>{if(e.side==="right"){n.toggleSideTabBarVisibility("right")}else{n.toggleSideTabBarVisibility("left")}},isToggled:e=>e.side==="right"?n.isSideTabBarVisible("right"):n.isSideTabBarVisible("left"),isEnabled:e=>e.side==="right"?!n.isEmpty("right"):!n.isEmpty("left")});a.addCommand(w.togglePresentationMode,{label:()=>d.__("Presentation Mode"),execute:()=>{n.presentationMode=!n.presentationMode},isToggled:()=>n.presentationMode,isVisible:()=>true});a.addCommand(w.toggleFullscreenMode,{label:d.__("Fullscreen Mode"),execute:()=>{if(document.fullscreenElement===null||document.fullscreenElement===undefined){document.documentElement.requestFullscreen().catch((e=>{console.error("Failed to enter fullscreen mode.",e)}))}else if(document.fullscreenElement!==null){document.exitFullscreen().catch((e=>{console.error("Failed to exit fullscreen mode.",e)}))}},isToggled:()=>document.fullscreenElement!==null});a.addCommand(w.setMode,{label:e=>e["mode"]?d.__("Set %1 mode.",e["mode"]):d.__("Set the layout `mode`."),caption:d.__('The layout `mode` can be "single-document" or "multiple-document".'),isVisible:e=>{const t=e["mode"];return t==="single-document"||t==="multiple-document"},execute:e=>{const t=e["mode"];if(t==="single-document"||t==="multiple-document"){n.mode=t;return}throw new Error(`Unsupported application shell mode: ${t}`)}});a.addCommand(w.toggleMode,{label:d.__("Simple Interface"),isToggled:()=>n.mode==="single-document",execute:()=>{const e=n.mode==="multiple-document"?{mode:"single-document"}:{mode:"multiple-document"};return a.execute(w.setMode,e)}});a.addCommand(w.resetLayout,{label:d.__("Reset Default Layout"),execute:()=>{if(n.presentationMode){a.execute(w.togglePresentationMode).catch((e=>{console.error("Failed to undo presentation mode.",e)}))}if(document.fullscreenElement!==null||document.fullscreenElement!==undefined){a.execute(w.toggleFullscreenMode).catch((e=>{console.error("Failed to exit fullscreen mode.",e)}))}if(n.mode==="single-document"&&!n.isTopInSimpleModeVisible()){a.execute(w.toggleHeader).catch((e=>{console.error("Failed to display title header.",e)}))}["left","right"].forEach((e=>{if(!n.isSideTabBarVisible(e)&&!n.isEmpty(e)){a.execute(w.toggleSideTabBar,{side:e}).catch((t=>{console.error(`Failed to show ${e} activity bar.`,t)}))}}))}})}if(s){[w.activateNextTab,w.activatePreviousTab,w.activateNextTabBar,w.activatePreviousTabBar,w.close,w.closeAll,w.closeOtherTabs,w.closeRightTabs,w.toggleHeader,w.toggleLeftArea,w.toggleRightArea,w.togglePresentationMode,w.toggleFullscreenMode,w.toggleMode,w.resetLayout].forEach((e=>s.addItem({command:e,category:c})));["right","left"].forEach((e=>{s.addItem({command:w.toggleSideTabBar,category:c,args:{side:e}})}))}}};const x={id:"@jupyterlab/application-extension:main",description:"Initializes the application and provides the URL tree path handler.",requires:[i.IRouter,s.IWindowResolver,c.ITranslator,i.JupyterFrontEnd.ITreeResolver],optional:[i.IConnectionLost],provides:i.ITreePathUpdater,activate:(e,t,n,r,a,l)=>{const d=r.load("jupyterlab");if(!(e instanceof i.JupyterLab)){throw new Error(`${x.id} must be activated in JupyterLab.`)}let c="";let h="";function u(e){void a.paths.then((()=>{h=e;if(!c){const n=o.PageConfig.getUrl({treePath:e});const i=o.URLExt.parse(n).pathname;t.navigate(i,{skipRouting:true});o.PageConfig.setOption("treePath",e)}}))}const p=n.name;console.debug(`Starting application in workspace: "${p}"`);if(e.registerPluginErrors.length!==0){const t=v.createElement("pre",null,e.registerPluginErrors.map((e=>e.message)).join("\n"));void(0,s.showErrorMessage)(d.__("Error Registering Plugins"),{message:t})}e.shell.modeChanged.connect(((e,n)=>{const i=o.PageConfig.getUrl({mode:n});const s=o.URLExt.parse(i).pathname;t.navigate(s,{skipRouting:true});o.PageConfig.setOption("mode",n)}));void a.paths.then((()=>{e.shell.currentPathChanged.connect(((e,n)=>{const i=n.newValue;const s=i||h;const r=o.PageConfig.getUrl({treePath:s});const a=o.URLExt.parse(r).pathname;t.navigate(a,{skipRouting:true});o.PageConfig.setOption("treePath",s);c=i}))}));l=l||i.ConnectionLost;e.serviceManager.connectionFailure.connect(((e,t)=>l(e,t,r)));const m=e.serviceManager.builder;const g=()=>m.build().then((()=>(0,s.showDialog)({title:d.__("Build Complete"),body:v.createElement("div",null,d.__("Build successfully completed, reload page?"),v.createElement("br",null),d.__("You will lose any unsaved changes.")),buttons:[s.Dialog.cancelButton({label:d.__("Reload Without Saving"),actions:["reload"]}),s.Dialog.okButton({label:d.__("Save and Reload")})],hasClose:true}))).then((({button:{accept:n,actions:i}})=>{if(n){void e.commands.execute("docmanager:save").then((()=>{t.reload()})).catch((e=>{void(0,s.showErrorMessage)(d.__("Save Failed"),{message:v.createElement("pre",null,e.message)})}))}else if(i.includes("reload")){t.reload()}})).catch((e=>{void(0,s.showErrorMessage)(d.__("Build Failed"),{message:v.createElement("pre",null,e.message)})}));if(m.isAvailable&&m.shouldCheck){void m.getStatus().then((e=>{if(e.status==="building"){return g()}if(e.status!=="needed"){return}const t=v.createElement("div",null,d.__("JupyterLab build is suggested:"),v.createElement("br",null),v.createElement("pre",null,e.message));void(0,s.showDialog)({title:d.__("Build Recommended"),body:t,buttons:[s.Dialog.cancelButton(),s.Dialog.okButton({label:d.__("Build")})]}).then((e=>e.button.accept?g():undefined))}))}return u},autoStart:true};const S={id:"@jupyterlab/application-extension:context-menu",description:"Populates the context menu.",autoStart:true,requires:[a.ISettingRegistry,c.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n,i)=>{const s=n.load("jupyterlab");function o(t){const n=new h.RankedMenu({...t,commands:e.commands});if(t.label){n.title.label=s.__(t.label)}return n}e.started.then((()=>z.loadSettingsContextMenu(e.contextMenu,e.commands,t,o,n))).then((()=>{if(i){i===null||i===void 0?void 0:i.addItem({category:s.__("Settings"),command:w.toggleContextMenu})}})).catch((e=>{console.error("Failed to load context menu items from settings registry.",e)}))}};const k={id:"@jupyterlab/application-extension:dirty",description:"Adds safeguard dialog when closing the browser tab with unsaved modifications.",autoStart:true,requires:[c.ITranslator],activate:(e,t)=>{if(!(e instanceof i.JupyterLab)){throw new Error(`${k.id} must be activated in JupyterLab.`)}const n=t.load("jupyterlab");const s=n.__("Are you sure you want to exit JupyterLab?\n\nAny unsaved changes will be lost.");window.addEventListener("beforeunload",(t=>{if(e.status.isDirty){return t.returnValue=s}}))}};const j={id:"@jupyterlab/application-extension:layout",description:"Provides the shell layout restorer.",requires:[l.IStateDB,i.ILabShell,a.ISettingRegistry],optional:[c.ITranslator],activate:(e,t,n,r,a)=>{const l=(a!==null&&a!==void 0?a:c.nullTranslator).load("jupyterlab");const d=e.started;const h=e.commands;const u=o.PageConfig.getOption("mode");const m=new i.LayoutRestorer({connector:t,first:d,registry:h,mode:u});r.load(D.id).then((t=>{var i,s;const o=t.composite["layout"];void n.restoreLayout(u,m,{"multiple-document":(i=o.multiple)!==null&&i!==void 0?i:{},"single-document":(s=o.single)!==null&&s!==void 0?s:{}}).then((()=>{n.layoutModified.connect((()=>{void m.save(n.saveLayout())}));t.changed.connect(g);z.activateSidebarSwitcher(e,n,t,l)}))})).catch((e=>{console.error("Fail to load settings for the layout restorer.");console.error(e)}));return m;async function g(e){if(!p.JSONExt.deepEqual(e.composite["layout"],{single:n.userLayout["single-document"],multiple:n.userLayout["multiple-document"]})){const e=await(0,s.showDialog)({title:l.__("Information"),body:l.__("User layout customization has changed. You may need to reload JupyterLab to see the changes."),buttons:[s.Dialog.cancelButton(),s.Dialog.okButton({label:l.__("Reload")})]});if(e.button.accept){location.reload()}}}},autoStart:true,provides:i.ILayoutRestorer};const I={id:"@jupyterlab/application-extension:router",description:"Provides the URL router",requires:[i.JupyterFrontEnd.IPaths],activate:(e,t)=>{const{commands:n}=e;const s=t.urls.base;const o=new i.Router({base:s,commands:n});void e.started.then((()=>{void o.route();window.addEventListener("popstate",(()=>{void o.route()}))}));return o},autoStart:true,provides:i.IRouter};const E={id:"@jupyterlab/application-extension:tree-resolver",description:"Provides the tree route resolver",autoStart:true,requires:[i.IRouter],provides:i.JupyterFrontEnd.ITreeResolver,activate:(e,t)=>{const{commands:n}=e;const i=new g.DisposableSet;const s=new p.PromiseDelegate;const r=new RegExp("/(lab|doc)(/workspaces/[a-zA-Z0-9-_]+)?(/tree/.*)?");i.add(n.addCommand(w.tree,{execute:async e=>{var t;if(i.isDisposed){return}const n=o.URLExt.queryStringToObject((t=e.search)!==null&&t!==void 0?t:"");const r=n["file-browser-path"]||"";delete n["file-browser-path"];i.dispose();s.resolve({browser:r,file:o.PageConfig.getOption("treePath")})}}));i.add(t.register({command:w.tree,pattern:r}));const a=()=>{if(i.isDisposed){return}i.dispose();s.resolve(null)};t.routed.connect(a);i.add(new g.DisposableDelegate((()=>{t.routed.disconnect(a)})));return{paths:s.promise}}};const T={id:"@jupyterlab/application-extension:notfound",description:"Defines the behavior for not found URL (aka route).",requires:[i.JupyterFrontEnd.IPaths,i.IRouter,c.ITranslator],activate:(e,t,n,i)=>{const o=i.load("jupyterlab");const r=t.urls.notFound;if(!r){return}const a=n.base;const l=o.__("The path: %1 was not found. JupyterLab redirected to: %2",r,a);n.navigate("");void(0,s.showErrorMessage)(o.__("Path Not Found"),{message:l})},autoStart:true};const M={id:"@jupyterlab/application-extension:faviconbusy",description:"Handles the favicon depending on the application status.",requires:[i.ILabStatus],activate:async(e,t)=>{t.busySignal.connect(((e,t)=>{const n=document.querySelector(`link[rel="icon"]${t?".idle.favicon":".busy.favicon"}`);if(!n){return}const i=document.querySelector(`link${t?".busy.favicon":".idle.favicon"}`);if(!i){return}if(n!==i){n.rel="";i.rel="icon";i.parentNode.replaceChild(i,i)}}))},autoStart:true};const D={id:"@jupyterlab/application-extension:shell",description:"Provides the JupyterLab shell. It has an extended API compared to `app.shell`.",optional:[a.ISettingRegistry],activate:(e,t)=>{if(!(e.shell instanceof i.LabShell)){throw new Error(`${D.id} did not find a LabShell instance.`)}if(t){void t.load(D.id).then((t=>{e.shell.updateConfig(t.composite);t.changed.connect((()=>{e.shell.updateConfig(t.composite)}))}))}return e.shell},autoStart:true,provides:i.ILabShell};const A={id:"@jupyterlab/application-extension:status",description:"Provides the application status.",activate:e=>{if(!(e instanceof i.JupyterLab)){throw new Error(`${A.id} must be activated in JupyterLab.`)}return e.status},autoStart:true,provides:i.ILabStatus};const P={id:"@jupyterlab/application-extension:info",description:"Provides the application information.",activate:e=>{if(!(e instanceof i.JupyterLab)){throw new Error(`${P.id} must be activated in JupyterLab.`)}return e.info},autoStart:true,provides:i.JupyterLab.IInfo};const L={id:"@jupyterlab/application-extension:paths",description:"Provides the application paths.",activate:e=>{if(!(e instanceof i.JupyterLab)){throw new Error(`${L.id} must be activated in JupyterLab.`)}return e.paths},autoStart:true,provides:i.JupyterFrontEnd.IPaths};const R={id:"@jupyterlab/application-extension:property-inspector",description:"Provides the property inspector.",autoStart:true,requires:[i.ILabShell,c.ITranslator],optional:[i.ILayoutRestorer],provides:r.IPropertyInspectorProvider,activate:(e,t,n,i)=>{const s=n.load("jupyterlab");const o=new r.SideBarPropertyInspectorProvider({shell:t,translator:n});o.title.icon=h.buildIcon;o.title.caption=s.__("Property Inspector");o.id="jp-property-inspector";t.add(o,"right",{rank:100,type:"Property Inspector"});e.commands.addCommand(w.showPropertyPanel,{label:s.__("Property Inspector"),execute:()=>{t.activateById(o.id)}});if(i){i.add(o,"jp-property-inspector")}return o}};const N={id:"@jupyterlab/application-extension:logo",description:"Sets the application logo.",autoStart:true,requires:[i.ILabShell],activate:(e,t)=>{const n=new f.Widget;h.jupyterIcon.element({container:n.node,elementPosition:"center",margin:"2px 2px 2px 8px",height:"auto",width:"16px"});n.id="jp-MainLogo";t.add(n,"top",{rank:0})}};const O={id:"@jupyterlab/application-extension:mode-switch",description:"Adds the interface mode switch",requires:[i.ILabShell,c.ITranslator],optional:[d.IStatusBar,a.ISettingRegistry],activate:(e,t,n,i,s)=>{if(i===null){return}const o=n.load("jupyterlab");const r=new h.Switch;r.id="jp-single-document-mode";r.valueChanged.connect(((e,n)=>{t.mode=n.newValue?"single-document":"multiple-document"}));t.modeChanged.connect(((e,t)=>{r.value=t==="single-document"}));if(s){const n=s.load(D.id);const i=e=>{const n=e.get("startMode").composite;if(n){t.mode=n==="single"?"single-document":"multiple-document"}};Promise.all([n,e.restored]).then((([e])=>{i(e)})).catch((e=>{console.error(e.message)}))}const a=()=>{const t=e.commands.keyBindings.find((e=>e.command==="application:toggle-mode"));if(t){const e=t.keys.map(m.CommandRegistry.formatKeystroke).join(", ");r.caption=o.__("Simple Interface (%1)",e)}else{r.caption=o.__("Simple Interface")}};a();e.commands.keyBindingChanged.connect((()=>{a()}));r.label=o.__("Simple");i.registerStatusItem(O.id,{priority:1,item:r,align:"left",rank:-1})},autoStart:true};const B=[S,k,x,C,j,I,E,T,M,D,A,P,O,L,R,N,b];const F=B;var z;(function(e){async function t(e){const t=await(0,s.showDialog)({title:e.__("Information"),body:e.__("Context menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[s.Dialog.cancelButton(),s.Dialog.okButton({label:e.__("Reload")})]});if(t.button.accept){location.reload()}}async function n(e,n,i,o,r){var l;const d=r.load("jupyterlab");const c=S.id;let h=null;let u={};function m(e){var t,n;u={};const s=Object.keys(i.plugins).map((e=>{var t,n;const s=(n=(t=i.plugins[e].schema["jupyter.lab.menus"])===null||t===void 0?void 0:t.context)!==null&&n!==void 0?n:[];u[e]=s;return s})).concat([(n=(t=e["jupyter.lab.menus"])===null||t===void 0?void 0:t.context)!==null&&n!==void 0?n:[]]).reduceRight(((e,t)=>a.SettingRegistry.reconcileItems(e,t,true)),[]);e.properties.contextMenu.default=a.SettingRegistry.reconcileItems(s,e.properties.contextMenu.default,true).sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Infinity)-((i=t.rank)!==null&&i!==void 0?i:Infinity)}))}i.transform(c,{compose:e=>{var t,n,i,s;if(!h){h=p.JSONExt.deepCopy(e.schema);m(h)}const o=(i=(n=(t=h.properties)===null||t===void 0?void 0:t.contextMenu)===null||n===void 0?void 0:n.default)!==null&&i!==void 0?i:[];const r={...e.data.user,contextMenu:(s=e.data.user.contextMenu)!==null&&s!==void 0?s:[]};const l={...e.data.composite,contextMenu:a.SettingRegistry.reconcileItems(o,r.contextMenu,false)};e.data={composite:l,user:r};return e},fetch:e=>{if(!h){h=p.JSONExt.deepCopy(e.schema);m(h)}return{data:e.data,id:e.id,raw:e.raw,schema:h,version:e.version}}});const g=await i.load(c);const f=e=>{const t=document.body;const n=t.hasAttribute("data-jp-suppress-context-menu");const i=e.get("disabled").composite;if(n&&!i){t.removeAttribute("data-jp-suppress-context-menu")}else if(i&&!n){t.setAttribute("data-jp-suppress-context-menu","true")}};const v=(l=g.composite.contextMenu)!==null&&l!==void 0?l:[];a.SettingRegistry.filterDisabledItems(v).forEach((t=>{s.MenuFactory.addContextItem({rank:y,...t},e,o)}));g.changed.connect((()=>{var e;const n=(e=g.composite.contextMenu)!==null&&e!==void 0?e:[];if(!p.JSONExt.deepEqual(v,n)){void t(d)}f(g)}));i.pluginChanged.connect((async(n,r)=>{var l,h,m,g;if(r!==c){const n=(l=u[r])!==null&&l!==void 0?l:[];const c=(m=(h=i.plugins[r].schema["jupyter.lab.menus"])===null||h===void 0?void 0:h.context)!==null&&m!==void 0?m:[];if(!p.JSONExt.deepEqual(n,c)){if(u[r]){await t(d)}else{u[r]=p.JSONExt.deepCopy(c);const t=(g=a.SettingRegistry.reconcileItems(c,v,false,false))!==null&&g!==void 0?g:[];a.SettingRegistry.filterDisabledItems(t).forEach((t=>{s.MenuFactory.addContextItem({rank:y,...t},e,o)}))}}}}));f(g);n.addCommand(w.toggleContextMenu,{label:d.__("Enable Context Menu"),isToggleable:true,isToggled:()=>!g.get("disabled").composite,execute:()=>void g.set("disabled",!g.get("disabled").composite)})}e.loadSettingsContextMenu=n;function i(e,t,n,i){e.commands.addCommand(w.switchSidebar,{label:i.__("Switch Sidebar Side"),execute:()=>{const i=e.contextMenuHitTest((e=>!!e.dataset.id));if(!i){return}const s=i.dataset["id"];const o=document.getElementById("jp-left-stack");const r=document.getElementById(s);let a=null;if(o&&r&&o.contains(r)){const e=(0,u.find)(t.widgets("left"),(e=>e.id===s));if(e){a=t.move(e,"right");t.activateById(e.id)}}else{const e=(0,u.find)(t.widgets("right"),(e=>e.id===s));if(e){a=t.move(e,"left");t.activateById(e.id)}}if(a){n.set("layout",{single:a["single-document"],multiple:a["multiple-document"]}).catch((e=>{console.error("Failed to save user layout customization.",e)}))}}});e.commands.commandExecuted.connect(((e,t)=>{if(t.id===w.resetLayout){n.remove("layout").catch((e=>{console.error("Failed to remove user layout customization.",e)}))}}))}e.activateSidebarSwitcher=i})(z||(z={}))},20979:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(3579);var a=n(58130);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(24118);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},16214:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ConnectionLost:()=>o,IConnectionLost:()=>q,ILabShell:()=>O,ILabStatus:()=>$,ILayoutRestorer:()=>b,IMimeDocumentTracker:()=>x,IRouter:()=>K,ITreePathUpdater:()=>J,JupyterFrontEnd:()=>p,JupyterFrontEndContextMenu:()=>g,JupyterLab:()=>W,LabShell:()=>B,LabStatus:()=>H,LayoutRestorer:()=>w,Router:()=>U,addSemanticCommand:()=>G,createRendermimePlugin:()=>k,createRendermimePlugins:()=>S,createSemanticCommand:()=>Y});var i=n(72050);var s=n(61927);const o=async function(e,t,n){n=n||s.nullTranslator;const o=n.load("jupyterlab");const a=o.__("Server Connection Error");const l=o.__("A connection to the Jupyter server could not be established.\n"+"JupyterLab will continue trying to reconnect.\n"+"Check your network connection or Jupyter server configuration.\n");if(!r.displayConnectionLost){return}if(r.serverConnectionLost){await r.serverConnectionLost;return}const d=(0,i.showDialog)({title:a,body:l,checkbox:{label:o.__("Do not show this message again in this session."),caption:o.__("If checked, you will not see a dialog informing you about an issue with server connection in this session.")},buttons:[i.Dialog.cancelButton({label:o.__("Close")})]}).then((e=>{if(e.isChecked){r.displayConnectionLost=false}return})).catch((e=>{console.error("An error occurred while showing the dialog: ",e)})).finally((()=>{r.serverConnectionLost=undefined}));r.serverConnectionLost=d};var r;(function(e){e.displayConnectionLost=true})(r||(r={}));var a=n(44185);var l=n(77256);var d=n(66127);var c=n(95286);var h=n(5592);var u=n(2336);class p extends c.Application{constructor(e){super(e);this._formatChanged=new u.Signal(this);e.shell.addClass("jp-ThemedContainer");this.contextMenu=new d.ContextMenuSvg({commands:this.commands,renderer:e.contextMenuRenderer,groupByTarget:false,sortBySelector:false});const t=new Promise((e=>{requestAnimationFrame((()=>{e()}))}));this.commandLinker=e.commandLinker||new i.CommandLinker({commands:this.commands});this.docRegistry=e.docRegistry||new a.DocumentRegistry;this.restored=e.restored||this.started.then((()=>t)).catch((()=>t));this.serviceManager=e.serviceManager||new l.ServiceManager}get format(){return this._format}set format(e){if(this._format!==e){this._format=e;document.body.dataset["format"]=e;this._formatChanged.emit(e)}}get formatChanged(){return this._formatChanged}contextMenuHitTest(e){if(!this._contextMenuEvent||!(this._contextMenuEvent.target instanceof Node)){return undefined}let t=this._contextMenuEvent.target;do{if(t instanceof HTMLElement&&e(t)){return t}t=t.parentNode}while(t&&t.parentNode&&t!==t.parentNode);return undefined}evtContextMenu(e){this._contextMenuEvent=e;if(e.shiftKey||m.suppressContextMenu(e.target)){return}const t=this.contextMenu.open(e);if(t){const t=this.contextMenu.menu.items;if(t.length===1&&t[0].command===g.contextMenu){this.contextMenu.menu.close();return}e.preventDefault();e.stopPropagation()}}}(function(e){function t(e,t){const n=new RegExp(`^${t.urls.doc}`);const i=e.match(n);if(i){return true}else{return false}}e.inDocMode=t;e.IPaths=new h.Token("@jupyterlab/application:IPaths",`A service providing information about various\n URLs and server paths for the current application. Use this service if you want to\n assemble URLs to use the JupyterLab REST API.`);e.ITreeResolver=new h.Token("@jupyterlab/application:ITreeResolver","A service to resolve the tree path.")})(p||(p={}));var m;(function(e){function t(e){return e.closest("[data-jp-suppress-context-menu]")!==null}e.suppressContextMenu=t})(m||(m={}));var g;(function(e){e.contextMenu="__internal:context-menu-info"})(g||(g={}));var f=n(37737);var v=n(90943);var _=n(94466);const b=new h.Token("@jupyterlab/application:ILayoutRestorer","A service providing application layout restoration functionality. Use this to have your activities restored across page loads.");const y="layout-restorer:data";class w{constructor(e){this._deferred=new Array;this._deferredMainArea=null;this._firstDone=false;this._promisesDone=false;this._promises=[];this._restored=new h.PromiseDelegate;this._trackers=new Set;this._widgets=new Map;this._mode="multiple-document";this._connector=e.connector;this._first=e.first;this._registry=e.registry;if(e.mode){this._mode=e.mode}void this._first.then((()=>{this._firstDone=true})).then((()=>Promise.all(this._promises))).then((()=>{this._promisesDone=true;this._trackers.clear()})).then((()=>{this._restored.resolve(void 0)}))}get isDeferred(){return this._deferred.length>0}get restored(){return this._restored.promise}add(e,t){C.nameProperty.set(e,t);this._widgets.set(t,e);e.disposed.connect(this._onWidgetDisposed,this)}async fetch(){var e;const t={fresh:true,mainArea:null,downArea:null,leftArea:null,rightArea:null,topArea:null,relativeSizes:null};const n=this._connector.fetch(y);try{const[i]=await Promise.all([n,this.restored]);if(!i){return t}const{main:s,down:o,left:r,right:a,relativeSizes:l,top:d}=i;const c=false;let h=null;if(this._mode==="multiple-document"){h=this._rehydrateMainArea(s)}else{this._deferredMainArea=s}const u=this._rehydrateDownArea(o);const p=this._rehydrateSideArea(r);const m=this._rehydrateSideArea(a);return{fresh:c,mainArea:h,downArea:u,leftArea:p,rightArea:m,relativeSizes:l||null,topArea:(e=d)!==null&&e!==void 0?e:null}}catch(i){return t}}async restore(e,t){if(this._firstDone){throw new Error("restore() must be called before `first` has resolved.")}const{namespace:n}=e;if(this._trackers.has(n)){throw new Error(`The tracker "${n}" is already restored.`)}const{args:i,command:s,name:o,when:r}=t;this._trackers.add(n);e.widgetAdded.connect(((e,t)=>{const i=o(t);if(i){this.add(t,`${n}:${i}`)}}),this);e.widgetUpdated.connect(((e,t)=>{const i=o(t);if(i){const e=`${n}:${i}`;C.nameProperty.set(t,e);this._widgets.set(e,t)}}));const a=this._first;if(this._mode=="multiple-document"){const t=e.restore({args:i||(()=>h.JSONExt.emptyObject),command:s,connector:this._connector,name:o,registry:this._registry,when:r?[a].concat(r):a}).catch((e=>{console.error(e)}));this._promises.push(t);return t}e.defer({args:i||(()=>h.JSONExt.emptyObject),command:s,connector:this._connector,name:o,registry:this._registry,when:r?[a].concat(r):a});this._deferred.push(e)}async restoreDeferred(){if(!this.isDeferred){return null}const e=Promise.resolve();const t=this._deferred.map((t=>e.then((()=>t.restore()))));this._deferred.length=0;await Promise.all(t);return this._rehydrateMainArea(this._deferredMainArea)}save(e){var t;if(!this._promisesDone){const e="save() was called prematurely.";console.warn(e);return Promise.reject(e)}const n={};n.main=this.isDeferred?this._deferredMainArea:this._dehydrateMainArea(e.mainArea);if(this.isDeferred){const i=(t=e.mainArea)===null||t===void 0?void 0:t.currentWidget;if(i){const e=C.nameProperty.get(i);n.main={...n.main,current:e||undefined}}}n.down=this._dehydrateDownArea(e.downArea);n.left=this._dehydrateSideArea(e.leftArea);n.right=this._dehydrateSideArea(e.rightArea);n.relativeSizes=e.relativeSizes;n.top={...e.topArea};return this._connector.save(y,n)}_dehydrateMainArea(e){if(!e){return null}return C.serializeMain(e)}_rehydrateMainArea(e){if(!e){return null}return C.deserializeMain(e,this._widgets)}_dehydrateDownArea(e){if(!e){return null}const t={size:e.size};if(e.currentWidget){const n=C.nameProperty.get(e.currentWidget);if(n){t.current=n}}if(e.widgets){t.widgets=e.widgets.map((e=>C.nameProperty.get(e))).filter((e=>!!e))}return t}_rehydrateDownArea(e){var t;if(!e){return{currentWidget:null,size:0,widgets:null}}const n=this._widgets;const i=e.current&&n.has(`${e.current}`)?n.get(`${e.current}`):null;const s=!Array.isArray(e.widgets)?null:e.widgets.map((e=>n.has(`${e}`)?n.get(`${e}`):null)).filter((e=>!!e));return{currentWidget:i,size:(t=e.size)!==null&&t!==void 0?t:0,widgets:s}}_dehydrateSideArea(e){if(!e){return null}const t={collapsed:e.collapsed,visible:e.visible};if(e.currentWidget){const n=C.nameProperty.get(e.currentWidget);if(n){t.current=n}}if(e.widgets){t.widgets=e.widgets.map((e=>C.nameProperty.get(e))).filter((e=>!!e))}if(e.widgetStates){t.widgetStates=e.widgetStates}return t}_rehydrateSideArea(e){var t,n;if(!e){return{collapsed:true,currentWidget:null,visible:true,widgets:null,widgetStates:{["null"]:{sizes:null,expansionStates:null}}}}const i=this._widgets;const s=(t=e.collapsed)!==null&&t!==void 0?t:false;const o=e.current&&i.has(`${e.current}`)?i.get(`${e.current}`):null;const r=!Array.isArray(e.widgets)?null:e.widgets.map((e=>i.has(`${e}`)?i.get(`${e}`):null)).filter((e=>!!e));const a=e.widgetStates;return{collapsed:s,currentWidget:o,widgets:r,visible:(n=e.visible)!==null&&n!==void 0?n:true,widgetStates:a}}_onWidgetDisposed(e){const t=C.nameProperty.get(e);this._widgets.delete(t)}}var C;(function(e){e.nameProperty=new _.AttachedProperty({name:"name",create:e=>""});function t(n){if(!n||!n.type){return null}if(n.type==="tab-area"){return{type:"tab-area",currentIndex:n.currentIndex,widgets:n.widgets.map((t=>e.nameProperty.get(t))).filter((e=>!!e))}}return{type:"split-area",orientation:n.orientation,sizes:n.sizes,children:n.children.map(t).filter((e=>!!e))}}function n(n){const i={dock:n&&n.dock&&t(n.dock.main)||null};if(n){if(n.currentWidget){const t=e.nameProperty.get(n.currentWidget);if(t){i.current=t}}}return i}e.serializeMain=n;function i(e,t){if(!e){return null}const n=e.type||"unknown";if(n==="unknown"||n!=="tab-area"&&n!=="split-area"){console.warn(`Attempted to deserialize unknown type: ${n}`);return null}if(n==="tab-area"){const{currentIndex:n,widgets:i}=e;const s={type:"tab-area",currentIndex:n||0,widgets:i&&i.map((e=>t.get(e))).filter((e=>!!e))||[]};if(s.currentIndex>s.widgets.length-1){s.currentIndex=0}return s}const{orientation:s,sizes:o,children:r}=e;const a={type:"split-area",orientation:s,sizes:o||[],children:r&&r.map((e=>i(e,t))).filter((e=>!!e))||[]};return a}function s(e,t){if(!e){return null}const n=e.current||null;const s=e.dock||null;return{currentWidget:n&&t.has(n)&&t.get(n)||null,dock:s?{main:i(s,t)}:null}}e.deserializeMain=s})(C||(C={}));const x=new h.Token("@jupyterlab/application:IMimeDocumentTracker","A widget tracker for documents rendered using a mime renderer extension. Use this if you want to list and interact with documents rendered by such extensions.");function S(e){const t=[];const n="application-mimedocuments";const s=new i.WidgetTracker({namespace:n});e.forEach((e=>{let n=e.default;if(!e.hasOwnProperty("__esModule")){n=e}if(!Array.isArray(n)){n=[n]}n.forEach((e=>{t.push(k(s,e))}))}));t.push({id:"@jupyterlab/application-extension:mimedocument",description:"Provides a mime document widget tracker.",optional:[b],provides:x,autoStart:true,activate:(e,t)=>{if(t){void t.restore(s,{command:"docmanager:open",args:e=>({path:e.context.path,factory:j.factoryNameProperty.get(e)}),name:e=>`${e.context.path}:${j.factoryNameProperty.get(e)}`})}return s}});return t}function k(e,t){return{id:t.id,description:t.description,requires:[v.IRenderMimeRegistry,s.ITranslator],autoStart:true,activate:(n,i,s)=>{if(t.rank!==undefined){i.addFactory(t.rendererFactory,t.rank)}else{i.addFactory(t.rendererFactory)}if(!t.documentWidgetFactoryOptions){return}const o=n.docRegistry;let r=[];if(Array.isArray(t.documentWidgetFactoryOptions)){r=t.documentWidgetFactoryOptions}else{r=[t.documentWidgetFactoryOptions]}if(t.fileTypes){t.fileTypes.forEach((e=>{if(e.icon){e={...e,icon:d.LabIcon.resolve({icon:e.icon})}}n.docRegistry.addFileType(e)}))}r.forEach((n=>{const r=n.toolbarFactory?e=>n.toolbarFactory(e.content.renderer):undefined;const l=new a.MimeDocumentFactory({renderTimeout:t.renderTimeout,dataType:t.dataType,rendermime:i,modelName:n.modelName,name:n.name,primaryFileType:o.getFileType(n.primaryFileType),fileTypes:n.fileTypes,defaultFor:n.defaultFor,defaultRendered:n.defaultRendered,toolbarFactory:r,translator:s,factory:t.rendererFactory});o.addWidgetFactory(l);l.widgetCreated.connect(((t,n)=>{j.factoryNameProperty.set(n,l.name);n.context.pathChanged.connect((()=>{void e.save(n)}));void e.add(n)}))}))}}}var j;(function(e){e.factoryNameProperty=new _.AttachedProperty({name:"factoryName",create:()=>undefined})})(j||(j={}));var I=n(34236);var E=n(42856);var T=n(26568);var M=n(1143);const D="jp-LabShell";const A="jp-SideBar";const P="jp-mod-current";const L="jp-mod-active";const R=900;const N="jp-Activity";const O=new h.Token("@jupyterlab/application:ILabShell","A service for interacting with the JupyterLab shell. The top-level ``application`` object also has a reference to the shell, but it has a restricted interface in order to be agnostic to different shell implementations on the application. Use this to get more detailed information about currently active widgets and layout state.");class B extends M.Widget{constructor(e){super();this._dockChildHook=(e,t)=>{switch(t.type){case"child-added":t.child.addClass(N);this._tracker.add(t.child);break;case"child-removed":t.child.removeClass(N);this._tracker.remove(t.child);break;default:break}return true};this._activeChanged=new u.Signal(this);this._cachedLayout=null;this._currentChanged=new u.Signal(this);this._currentPath="";this._currentPathChanged=new u.Signal(this);this._modeChanged=new u.Signal(this);this._isRestored=false;this._layoutModified=new u.Signal(this);this._layoutDebouncer=new T.Debouncer((()=>{this._layoutModified.emit(undefined)}),0);this._restored=new h.PromiseDelegate;this._tracker=new M.FocusTracker;this._topHandlerHiddenByUser=false;this._idTypeMap=new Map;this._mainOptionsCache=new Map;this._sideOptionsCache=new Map;this._delayedWidget=new Array;this.addClass(D);this.id="main";if((e===null||e===void 0?void 0:e.waitForRestore)===false){this._userLayout={"multiple-document":{},"single-document":{}}}const t=this._skipLinkWidget=new F.SkipLinkWidget(this);this._skipLinkWidget.show();const n=new M.Panel;n.addClass("jp-skiplink-wrapper");n.addWidget(t);const i=this._headerPanel=new M.BoxPanel;const o=this._menuHandler=new F.PanelHandler;o.panel.node.setAttribute("role","navigation");const r=this._topHandler=new F.PanelHandler;r.panel.node.setAttribute("role","banner");const l=this._bottomPanel=new M.BoxPanel;l.node.setAttribute("role","contentinfo");const c=new M.BoxPanel;const p=this._vsplitPanel=new F.RestorableSplitPanel;const m=this._dockPanel=new d.DockPanelSvg({hiddenMode:M.Widget.HiddenMode.Display});E.MessageLoop.installMessageHook(m,this._dockChildHook);const g=this._hsplitPanel=new F.RestorableSplitPanel;const f=this._downPanel=new d.TabPanelSvg({tabsMovable:true});const v=this._leftHandler=new F.SideBarHandler;const _=this._rightHandler=new F.SideBarHandler;const b=new M.BoxLayout;i.id="jp-header-panel";o.panel.id="jp-menu-panel";r.panel.id="jp-top-panel";l.id="jp-bottom-panel";c.id="jp-main-content-panel";p.id="jp-main-vsplit-panel";m.id="jp-main-dock-panel";g.id="jp-main-split-panel";f.id="jp-down-stack";v.sideBar.addClass(A);v.sideBar.addClass("jp-mod-left");v.sideBar.node.setAttribute("role","complementary");v.stackedPanel.id="jp-left-stack";_.sideBar.addClass(A);_.sideBar.addClass("jp-mod-right");_.sideBar.node.setAttribute("role","complementary");_.stackedPanel.id="jp-right-stack";m.node.setAttribute("role","main");c.spacing=0;p.spacing=1;m.spacing=5;g.spacing=1;i.direction="top-to-bottom";p.orientation="vertical";c.direction="left-to-right";g.orientation="horizontal";l.direction="bottom-to-top";M.SplitPanel.setStretch(v.stackedPanel,0);M.SplitPanel.setStretch(f,0);M.SplitPanel.setStretch(m,1);M.SplitPanel.setStretch(_.stackedPanel,0);M.BoxPanel.setStretch(v.sideBar,0);M.BoxPanel.setStretch(g,1);M.BoxPanel.setStretch(_.sideBar,0);M.SplitPanel.setStretch(p,1);g.addWidget(v.stackedPanel);g.addWidget(m);g.addWidget(_.stackedPanel);p.addWidget(g);p.addWidget(f);c.addWidget(v.sideBar);c.addWidget(p);c.addWidget(_.sideBar);b.direction="top-to-bottom";b.spacing=0;p.setRelativeSizes([3,1]);g.setRelativeSizes([1,2.5,1]);M.BoxLayout.setStretch(i,0);M.BoxLayout.setStretch(o.panel,0);M.BoxLayout.setStretch(r.panel,0);M.BoxLayout.setStretch(c,1);M.BoxLayout.setStretch(l,0);b.addWidget(n);b.addWidget(i);b.addWidget(r.panel);b.addWidget(c);b.addWidget(l);this._headerPanel.hide();this._bottomPanel.hide();this._downPanel.hide();this.layout=b;this._tracker.currentChanged.connect(this._onCurrentChanged,this);this._tracker.activeChanged.connect(this._onActiveChanged,this);this._dockPanel.layoutModified.connect(this._onLayoutModified,this);this._vsplitPanel.updated.connect(this._onLayoutModified,this);this._downPanel.currentChanged.connect(this._onLayoutModified,this);this._downPanel.tabBar.tabMoved.connect(this._onTabPanelChanged,this);this._downPanel.stackedPanel.widgetRemoved.connect(this._onTabPanelChanged,this);this._leftHandler.updated.connect(this._onLayoutModified,this);this._rightHandler.updated.connect(this._onLayoutModified,this);this._hsplitPanel.updated.connect(this._onLayoutModified,this);const y=this._titleHandler=new F.TitleHandler(this);this.add(y,"top",{rank:100});if(this._dockPanel.mode==="multiple-document"){this._topHandler.addWidget(this._menuHandler.panel,100);y.hide()}else{b.insertWidget(3,this._menuHandler.panel)}this.translator=s.nullTranslator;this.currentChanged.connect(((e,t)=>{let n=t.newValue;let i=t.oldValue;if(i){i.title.changed.disconnect(this._updateTitlePanelTitle,this);if(i instanceof a.DocumentWidget){i.context.pathChanged.disconnect(this._updateCurrentPath,this)}}if(n){n.title.changed.connect(this._updateTitlePanelTitle,this);this._updateTitlePanelTitle();if(n instanceof a.DocumentWidget){n.context.pathChanged.connect(this._updateCurrentPath,this)}}this._updateCurrentPath()}))}get activeChanged(){return this._activeChanged}get activeWidget(){return this._tracker.activeWidget}get addButtonEnabled(){return this._dockPanel.addButtonEnabled}set addButtonEnabled(e){this._dockPanel.addButtonEnabled=e}get addRequested(){return this._dockPanel.addRequested}get currentChanged(){return this._currentChanged}get currentPath(){return this._currentPath}get currentPathChanged(){return this._currentPathChanged}get currentWidget(){return this._tracker.currentWidget}get layoutModified(){return this._layoutModified}get leftCollapsed(){return!this._leftHandler.sideBar.currentTitle}get rightCollapsed(){return!this._rightHandler.sideBar.currentTitle}get presentationMode(){return this.hasClass("jp-mod-presentationMode")}set presentationMode(e){this.toggleClass("jp-mod-presentationMode",e)}get mode(){return this._dockPanel.mode}set mode(e){const t=this._dockPanel;if(e===t.mode){return}const n=this.currentWidget;if(e==="single-document"){this._cachedLayout=t.saveLayout();t.mode=e;if(this.currentWidget){t.activateWidget(this.currentWidget)}this.layout.insertWidget(3,this._menuHandler.panel);this._titleHandler.show();this._updateTitlePanelTitle();if(this._topHandlerHiddenByUser){this._topHandler.panel.hide()}}else{const i=Array.from(t.widgets());t.mode=e;if(this._cachedLayout){F.normalizeAreaConfig(t,this._cachedLayout.main);t.restoreLayout(this._cachedLayout);this._cachedLayout=null}if(this._layoutRestorer.isDeferred){this._layoutRestorer.restoreDeferred().then((e=>{if(e){const{currentWidget:t,dock:n}=e;if(n){this._dockPanel.restoreLayout(n)}if(t){this.activateById(t.id)}}})).catch((e=>{console.error("Failed to restore the deferred layout.");console.error(e)}))}i.forEach((e=>{if(!e.parent){this._addToMainArea(e,{...this._mainOptionsCache.get(e),activate:false})}}));this._mainOptionsCache.clear();if(n){t.activateWidget(n)}this.add(this._menuHandler.panel,"top",{rank:100});this._titleHandler.hide()}this.node.dataset.shellMode=e;this._downPanel.fit();this._modeChanged.emit(e)}get modeChanged(){return this._modeChanged}get restored(){return this._restored.promise}get translator(){var e;return(e=this._translator)!==null&&e!==void 0?e:s.nullTranslator}set translator(e){if(e!==this._translator){this._translator=e;d.TabBarSvg.translator=e;const t=e.load("jupyterlab");this._menuHandler.panel.node.setAttribute("aria-label",t.__("main menu"));this._leftHandler.sideBar.node.setAttribute("aria-label",t.__("main sidebar"));this._leftHandler.sideBar.contentNode.setAttribute("aria-label",t.__("main sidebar"));this._rightHandler.sideBar.node.setAttribute("aria-label",t.__("alternate sidebar"));this._rightHandler.sideBar.contentNode.setAttribute("aria-label",t.__("alternate sidebar"));this._topHandler.panel.node.setAttribute("aria-label",t.__("Top Bar"));this._bottomPanel.node.setAttribute("aria-label",t.__("Bottom Panel"));this._dockPanel.node.setAttribute("aria-label",t.__("Main Content"))}}get userLayout(){return h.JSONExt.deepCopy(this._userLayout)}activateById(e){if(this._leftHandler.has(e)){this._leftHandler.activate(e);return}if(this._rightHandler.has(e)){this._rightHandler.activate(e);return}const t=this._downPanel.tabBar.titles.findIndex((t=>t.owner.id===e));if(t>=0){this._downPanel.currentIndex=t;return}const n=this._dockPanel;const i=(0,I.find)(n.widgets(),(t=>t.id===e));if(i){n.activateWidget(i)}}activateArea(e="main"){switch(e){case"main":{const e=this._currentTabBar();if(!e){return}if(e.currentTitle){e.currentTitle.owner.activate()}}return;case"left":case"right":case"header":case"top":case"menu":case"bottom":console.debug(`Area: ${e} activation not yet implemented`);break;default:throw new Error(`Invalid area: ${e}`)}}activateNextTab(){const e=this._currentTabBar();if(!e){return}const t=e.currentIndex;if(t===-1){return}if(t0){e.currentIndex-=1;if(e.currentTitle){e.currentTitle.owner.activate()}return}if(t===0){const e=this._adjacentBar("previous");if(e){const t=e.titles.length;e.currentIndex=t-1;if(e.currentTitle){e.currentTitle.owner.activate()}}}}activateNextTabBar(){const e=this._adjacentBar("next");if(e){if(e.currentTitle){e.currentTitle.owner.activate()}}}activatePreviousTabBar(){const e=this._adjacentBar("previous");if(e){if(e.currentTitle){e.currentTitle.owner.activate()}}}add(e,t="main",n){var i;if(!this._userLayout){this._delayedWidget.push({widget:e,area:t,options:n});return}let s;if((n===null||n===void 0?void 0:n.type)&&this._userLayout[this.mode][n.type]){s=this._userLayout[this.mode][n.type];this._idTypeMap.set(e.id,n.type)}else{s=this._userLayout[this.mode][e.id]}if(n===null||n===void 0?void 0:n.type){this._idTypeMap.set(e.id,n.type);e.disposed.connect((()=>{this._idTypeMap.delete(e.id)}))}t=(i=s===null||s===void 0?void 0:s.area)!==null&&i!==void 0?i:t;n=n||(s===null||s===void 0?void 0:s.options)?{...n,...s===null||s===void 0?void 0:s.options}:undefined;switch(t||"main"){case"bottom":return this._addToBottomArea(e,n);case"down":return this._addToDownArea(e,n);case"header":return this._addToHeaderArea(e,n);case"left":return this._addToLeftArea(e,n);case"main":return this._addToMainArea(e,n);case"menu":return this._addToMenuArea(e,n);case"right":return this._addToRightArea(e,n);case"top":return this._addToTopArea(e,n);default:throw new Error(`Invalid area: ${t}`)}}move(e,t,n){var i;const s=(i=this._idTypeMap.get(e.id))!==null&&i!==void 0?i:e.id;for(const o of["single-document","multiple-document"].filter((e=>!n||e===n))){this._userLayout[o][s]={...this._userLayout[o][s],area:t}}this.add(e,t);return this._userLayout}collapseLeft(){this._leftHandler.collapse();this._onLayoutModified()}collapseRight(){this._rightHandler.collapse();this._onLayoutModified()}dispose(){if(this.isDisposed){return}this._layoutDebouncer.dispose();super.dispose()}expandLeft(){this._leftHandler.expand();this._onLayoutModified()}expandRight(){this._rightHandler.expand();this._onLayoutModified()}closeAll(){Array.from(this._dockPanel.widgets()).forEach((e=>e.close()));this._downPanel.stackedPanel.widgets.forEach((e=>e.close()))}isSideTabBarVisible(e){switch(e){case"left":return this._leftHandler.isVisible;case"right":return this._rightHandler.isVisible}}isTopInSimpleModeVisible(){return!this._topHandlerHiddenByUser}isEmpty(e){switch(e){case"bottom":return this._bottomPanel.widgets.length===0;case"down":return this._downPanel.stackedPanel.widgets.length===0;case"header":return this._headerPanel.widgets.length===0;case"left":return this._leftHandler.stackedPanel.widgets.length===0;case"main":return this._dockPanel.isEmpty;case"menu":return this._menuHandler.panel.widgets.length===0;case"right":return this._rightHandler.stackedPanel.widgets.length===0;case"top":return this._topHandler.panel.widgets.length===0;default:return true}}async restoreLayout(e,t,n={}){var i,s,o,r;this._userLayout={"single-document":(i=n["single-document"])!==null&&i!==void 0?i:{},"multiple-document":(s=n["multiple-document"])!==null&&s!==void 0?s:{}};this._delayedWidget.forEach((({widget:e,area:t,options:n})=>{this.add(e,t,n)}));this._delayedWidget.length=0;this._layoutRestorer=t;const a=await t.fetch();const{mainArea:l,downArea:d,leftArea:c,rightArea:h,topArea:u,relativeSizes:p}=a;if(l){const{currentWidget:t,dock:n}=l;if(n&&e==="multiple-document"){this._dockPanel.restoreLayout(n)}if(e){this.mode=e}if(t){this.activateById(t.id)}}else{if(e){this.mode=e}}if((u===null||u===void 0?void 0:u.simpleVisibility)!==undefined){this._topHandlerHiddenByUser=!u.simpleVisibility;if(this.mode==="single-document"){this._topHandler.panel.setHidden(this._topHandlerHiddenByUser)}}if(d){const{currentWidget:e,widgets:t,size:n}=d;const i=(o=t===null||t===void 0?void 0:t.map((e=>e.id)))!==null&&o!==void 0?o:[];this._downPanel.tabBar.titles.filter((e=>!i.includes(e.owner.id))).map((e=>e.owner.close()));const s=this._downPanel.tabBar.titles.map((e=>e.owner.id));t===null||t===void 0?void 0:t.filter((e=>!s.includes(e.id))).map((e=>this._downPanel.addWidget(e)));while(!I.ArrayExt.shallowEqual(i,this._downPanel.tabBar.titles.map((e=>e.owner.id)))){this._downPanel.tabBar.titles.forEach(((e,t)=>{const n=i.findIndex((t=>e.owner.id==t));if(n>=0&&n!=t){this._downPanel.tabBar.insertTab(n,e)}}))}if(e){const t=this._downPanel.stackedPanel.widgets.findIndex((t=>t.id===e.id));if(t){this._downPanel.currentIndex=t;(r=this._downPanel.currentWidget)===null||r===void 0?void 0:r.activate()}}if(n&&n>0){this._vsplitPanel.setRelativeSizes([1-n,n])}else{this._downPanel.stackedPanel.widgets.forEach((e=>e.close()));this._downPanel.hide()}}if(c){this._leftHandler.rehydrate(c)}else{if(e==="single-document"){this.collapseLeft()}}if(h){this._rightHandler.rehydrate(h)}else{if(e==="single-document"){this.collapseRight()}}if(p){this._hsplitPanel.setRelativeSizes(p)}if(!this._isRestored){E.MessageLoop.flush();this._restored.resolve(a)}}saveLayout(){const e={mainArea:{currentWidget:this._tracker.currentWidget,dock:this.mode==="single-document"?this._cachedLayout||this._dockPanel.saveLayout():this._dockPanel.saveLayout()},downArea:{currentWidget:this._downPanel.currentWidget,widgets:Array.from(this._downPanel.stackedPanel.widgets),size:this._vsplitPanel.relativeSizes()[1]},leftArea:this._leftHandler.dehydrate(),rightArea:this._rightHandler.dehydrate(),topArea:{simpleVisibility:!this._topHandlerHiddenByUser},relativeSizes:this._hsplitPanel.relativeSizes()};return e}toggleTopInSimpleModeVisibility(){if(this.mode==="single-document"){if(this._topHandler.panel.isVisible){this._topHandlerHiddenByUser=true;this._topHandler.panel.hide()}else{this._topHandlerHiddenByUser=false;this._topHandler.panel.show();this._updateTitlePanelTitle()}this._onLayoutModified()}}toggleSideTabBarVisibility(e){if(e==="right"){if(this._rightHandler.isVisible){this._rightHandler.hide()}else{this._rightHandler.show()}}else{if(this._leftHandler.isVisible){this._leftHandler.hide()}else{this._leftHandler.show()}}}updateConfig(e){if(e.hiddenMode){switch(e.hiddenMode){case"display":this._dockPanel.hiddenMode=M.Widget.HiddenMode.Display;break;case"scale":this._dockPanel.hiddenMode=M.Widget.HiddenMode.Scale;break;case"contentVisibility":this._dockPanel.hiddenMode=M.Widget.HiddenMode.ContentVisibility;break}}}widgets(e){switch(e!==null&&e!==void 0?e:"main"){case"main":return this._dockPanel.widgets();case"left":return(0,I.map)(this._leftHandler.sideBar.titles,(e=>e.owner));case"right":return(0,I.map)(this._rightHandler.sideBar.titles,(e=>e.owner));case"header":return this._headerPanel.children();case"top":return this._topHandler.panel.children();case"menu":return this._menuHandler.panel.children();case"bottom":return this._bottomPanel.children();default:throw new Error(`Invalid area: ${e}`)}}onAfterAttach(e){this.node.dataset.shellMode=this.mode}_updateTitlePanelTitle(){let e=this.currentWidget;const t=this._titleHandler.inputElement;t.value=e?e.title.label:"";t.title=e?e.title.caption:""}_updateCurrentPath(){let e=this.currentWidget;let t="";if(e&&e instanceof a.DocumentWidget){t=e.context.path}this._currentPathChanged.emit({newValue:t,oldValue:this._currentPath});this._currentPath=t}_addToLeftArea(e,t){if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}t=t||this._sideOptionsCache.get(e)||{};this._sideOptionsCache.set(e,t);const n="rank"in t?t.rank:R;this._leftHandler.addWidget(e,n);this._onLayoutModified()}_addToMainArea(e,t){if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}t=t||{};const n=this._dockPanel;const i=t.mode||"tab-after";let s=this.currentWidget;if(t.ref){s=(0,I.find)(n.widgets(),(e=>e.id===t.ref))||null}const{title:o}=e;o.dataset={...o.dataset,id:e.id};if(o.icon instanceof d.LabIcon){o.icon=o.icon.bindprops({stylesheet:"mainAreaTab"})}else if(typeof o.icon==="string"||!o.icon){o.iconClass=(0,d.classes)(o.iconClass,"jp-Icon")}n.addWidget(e,{mode:i,ref:s});if(n.mode==="single-document"){this._mainOptionsCache.set(e,t)}if(t.activate!==false){n.activateWidget(e)}}_addToRightArea(e,t){if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}t=t||this._sideOptionsCache.get(e)||{};const n="rank"in t?t.rank:R;this._sideOptionsCache.set(e,t);this._rightHandler.addWidget(e,n);this._onLayoutModified()}_addToTopArea(e,t){var n;if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}t=t||{};const i=(n=t.rank)!==null&&n!==void 0?n:R;this._topHandler.addWidget(e,i);this._onLayoutModified();if(this._topHandler.panel.isHidden){this._topHandler.panel.show()}}_addToMenuArea(e,t){var n;if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}t=t||{};const i=(n=t.rank)!==null&&n!==void 0?n:R;this._menuHandler.addWidget(e,i);this._onLayoutModified();if(this._menuHandler.panel.isHidden){this._menuHandler.panel.show()}}_addToHeaderArea(e,t){if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}this._headerPanel.addWidget(e);this._onLayoutModified();if(this._headerPanel.isHidden){this._headerPanel.show()}}_addToBottomArea(e,t){if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}this._bottomPanel.addWidget(e);this._onLayoutModified();if(this._bottomPanel.isHidden){this._bottomPanel.show()}}_addToDownArea(e,t){if(!e.id){console.error("Widgets added to app shell must have unique id property.");return}t=t||{};const{title:n}=e;n.dataset={...n.dataset,id:e.id};if(n.icon instanceof d.LabIcon){n.icon=n.icon.bindprops({stylesheet:"mainAreaTab"})}else if(typeof n.icon==="string"||!n.icon){n.iconClass=(0,d.classes)(n.iconClass,"jp-Icon")}this._downPanel.addWidget(e);this._onLayoutModified();if(this._downPanel.isHidden){this._downPanel.show()}}_adjacentBar(e){const t=this._currentTabBar();if(!t){return null}const n=Array.from(this._dockPanel.tabBars());const i=n.length;const s=n.indexOf(t);if(e==="previous"){return s>0?n[s-1]:s===0?n[i-1]:null}return se.titles.indexOf(t)>-1))||null}_onActiveChanged(e,t){if(t.newValue){t.newValue.title.className+=` ${L}`}if(t.oldValue){t.oldValue.title.className=t.oldValue.title.className.replace(L,"")}this._activeChanged.emit(t)}_onCurrentChanged(e,t){if(t.newValue){t.newValue.title.className+=` ${P}`}if(t.oldValue){t.oldValue.title.className=t.oldValue.title.className.replace(P,"")}this._currentChanged.emit(t);this._onLayoutModified()}_onTabPanelChanged(){if(this._downPanel.stackedPanel.widgets.length===0){this._downPanel.hide()}this._onLayoutModified()}_onLayoutModified(){void this._layoutDebouncer.invoke()}}var F;(function(e){function t(e,t){return e.rank-t.rank}e.itemCmp=t;function n(e,t){if(!t){return}if(t.type==="tab-area"){t.widgets=t.widgets.filter((t=>!t.isDisposed&&t.parent===e));return}t.children.forEach((t=>{n(e,t)}))}e.normalizeAreaConfig=n;class i{constructor(){this._panelChildHook=(e,t)=>{switch(t.type){case"child-added":{const e=t.child;if(this._items.find((t=>t.widget===e))){break}const n=this._items[this._items.length-1].rank;this._items.push({widget:e,rank:n})}break;case"child-removed":{const e=t.child;I.ArrayExt.removeFirstWhere(this._items,(t=>t.widget===e))}break;default:break}return true};this._items=new Array;this._panel=new M.Panel;E.MessageLoop.installMessageHook(this._panel,this._panelChildHook)}get panel(){return this._panel}addWidget(t,n){t.parent=null;const i={widget:t,rank:n};const s=I.ArrayExt.upperBound(this._items,i,e.itemCmp);I.ArrayExt.insert(this._items,s,i);this._panel.insertWidget(s,t)}}e.PanelHandler=i;class s{constructor(){this._isHiddenByUser=false;this._items=new Array;this._updated=new u.Signal(this);this._sideBar=new M.TabBar({insertBehavior:"none",removeBehavior:"none",allowDeselect:true,orientation:"vertical"});this._stackedPanel=new M.StackedPanel;this._sideBar.hide();this._stackedPanel.hide();this._lastCurrent=null;this._sideBar.currentChanged.connect(this._onCurrentChanged,this);this._sideBar.tabActivateRequested.connect(this._onTabActivateRequested,this);this._stackedPanel.widgetRemoved.connect(this._onWidgetRemoved,this)}get isVisible(){return this._sideBar.isVisible}get sideBar(){return this._sideBar}get stackedPanel(){return this._stackedPanel}get updated(){return this._updated}_onHandleMoved(){return this._refreshVisibility()}_onExpansionToggle(e,t){return this._refreshVisibility()}expand(){const e=this._lastCurrent||this._items.length>0&&this._items[0].widget;if(e){this.activate(e.id)}}activate(e){const t=this._findWidgetByID(e);if(t){this._sideBar.currentTitle=t.title;t.activate()}}has(e){return this._findWidgetByID(e)!==null}collapse(){this._sideBar.currentTitle=null}addWidget(e,t){var n,i,s,o;e.parent=null;e.hide();const r={widget:e,rank:t};const a=this._findInsertIndex(r);I.ArrayExt.insert(this._items,a,r);this._stackedPanel.insertWidget(a,e);const l=this._sideBar.insertTab(a,e.title);l.dataset={id:e.id};if(l.icon instanceof d.LabIcon){l.icon=l.icon.bindprops({stylesheet:"sideBar"})}else if(typeof l.icon==="string"&&l.icon!=""){l.iconClass=(0,d.classes)(l.iconClass,"jp-Icon","jp-Icon-20")}else if(!l.icon&&!l.label){l.icon=d.tabIcon.bindprops({stylesheet:"sideBar"})}(i=(n=e.content)===null||n===void 0?void 0:n.expansionToggled)===null||i===void 0?void 0:i.connect(this._onExpansionToggle,this);(o=(s=e.content)===null||s===void 0?void 0:s.handleMoved)===null||o===void 0?void 0:o.connect(this._onHandleMoved,this);this._refreshVisibility()}dehydrate(){const e=this._sideBar.currentTitle===null;const t=Array.from(this._stackedPanel.widgets);const n=t[this._sideBar.currentIndex];const i={};this._stackedPanel.widgets.forEach((e=>{if(e.id&&e.content instanceof M.SplitPanel){i[e.id]={sizes:e.content.relativeSizes(),expansionStates:e.content.widgets.map((e=>e.isVisible))}}}));return{collapsed:e,currentWidget:n,visible:!this._isHiddenByUser,widgets:t,widgetStates:i}}rehydrate(e){if(e.currentWidget){this.activate(e.currentWidget.id)}if(e.collapsed){this.collapse()}if(!e.visible){this.hide()}if(e.widgetStates){this._stackedPanel.widgets.forEach((t=>{var n;if(t.id&&t.content instanceof M.SplitPanel){const i=(n=e.widgetStates[t.id])!==null&&n!==void 0?n:{};t.content.widgets.forEach(((e,n)=>{var s;const o=((s=i.expansionStates)!==null&&s!==void 0?s:[])[n];if(typeof o==="boolean"&&t.content instanceof M.AccordionPanel){o?t.content.expand(n):t.content.collapse(n)}}));if(i.sizes){t.content.setRelativeSizes(i.sizes)}}}))}}hide(){this._isHiddenByUser=true;this._refreshVisibility()}show(){this._isHiddenByUser=false;this._refreshVisibility()}_findInsertIndex(t){return I.ArrayExt.upperBound(this._items,t,e.itemCmp)}_findWidgetIndex(e){return I.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e))}_findWidgetByTitle(e){const t=(0,I.find)(this._items,(t=>t.widget.title===e));return t?t.widget:null}_findWidgetByID(e){const t=(0,I.find)(this._items,(t=>t.widget.id===e));return t?t.widget:null}_refreshVisibility(){this._stackedPanel.setHidden(this._sideBar.currentTitle===null);this._sideBar.setHidden(this._isHiddenByUser||this._sideBar.titles.length===0);this._updated.emit()}_onCurrentChanged(e,t){const n=t.previousTitle?this._findWidgetByTitle(t.previousTitle):null;const i=t.currentTitle?this._findWidgetByTitle(t.currentTitle):null;if(n){n.hide()}if(i){i.show()}this._lastCurrent=i||n;this._refreshVisibility()}_onTabActivateRequested(e,t){t.title.owner.activate()}_onWidgetRemoved(e,t){if(t===this._lastCurrent){this._lastCurrent=null}I.ArrayExt.removeAt(this._items,this._findWidgetIndex(t));this._sideBar.removeTab(t.title);this._refreshVisibility()}}e.SideBarHandler=s;class o extends M.Widget{constructor(e){super();this.addClass("jp-skiplink");this.id="jp-skiplink";this._shell=e;this._createSkipLink("Skip to main panel","main")}handleEvent(e){var t,n;switch(e.type){case"click":if(e.target instanceof HTMLElement){this._shell.activateArea((n=(t=e.target)===null||t===void 0?void 0:t.dataset)===null||n===void 0?void 0:n.targetarea)}break}}onAfterAttach(e){super.onAfterAttach(e);this.node.addEventListener("click",this)}onBeforeDetach(e){this.node.removeEventListener("click",this);super.onBeforeDetach(e)}_createSkipLink(e,t){const n=document.createElement("a");n.href="#";n.tabIndex=0;n.text=e;n.className="skip-link";n.dataset["targetarea"]=t;this.node.appendChild(n)}}e.SkipLinkWidget=o;class r extends M.Widget{constructor(e){super();this._selected=false;const t=document.createElement("input");t.type="text";this.node.appendChild(t);this._shell=e;this.id="jp-title-panel-title"}onAfterAttach(e){super.onAfterAttach(e);this.inputElement.addEventListener("keyup",this);this.inputElement.addEventListener("click",this);this.inputElement.addEventListener("blur",this)}onBeforeDetach(e){super.onBeforeDetach(e);this.inputElement.removeEventListener("keyup",this);this.inputElement.removeEventListener("click",this);this.inputElement.removeEventListener("blur",this)}handleEvent(e){switch(e.type){case"keyup":void this._evtKeyUp(e);break;case"click":this._evtClick(e);break;case"blur":this._selected=false;break}}async _evtKeyUp(e){if(e.key=="Enter"){const e=this._shell.currentWidget;if(e==null){return}const t=e.title.label;const n=this.inputElement;const i=n.value;n.blur();if(i!==t){e.title.label=i}else{n.value=t}}}_evtClick(e){if(e.button!==0||this._selected){return}const t=this.inputElement;e.preventDefault();e.stopPropagation();this._selected=true;const n=t.value.indexOf(".");if(n===-1){t.select()}else{t.setSelectionRange(0,n)}}get inputElement(){return this.node.children[0]}}e.TitleHandler=r;class a extends M.SplitPanel{constructor(e={}){super(e);this._updated=new u.Signal(this)}get updated(){return this._updated}onUpdateRequest(e){super.onUpdateRequest(e);this._updated.emit()}}e.RestorableSplitPanel=a})(F||(F={}));var z=n(90044);class H{constructor(e){this._busyCount=0;this._dirtyCount=0;this._busySignal=new u.Signal(e);this._dirtySignal=new u.Signal(e)}get busySignal(){return this._busySignal}get dirtySignal(){return this._dirtySignal}get isBusy(){return this._busyCount>0}get isDirty(){return this._dirtyCount>0}setDirty(){const e=this.isDirty;this._dirtyCount++;if(this.isDirty!==e){this._dirtySignal.emit(this.isDirty)}return new z.DisposableDelegate((()=>{const e=this.isDirty;this._dirtyCount=Math.max(0,this._dirtyCount-1);if(this.isDirty!==e){this._dirtySignal.emit(this.isDirty)}}))}setBusy(){const e=this.isBusy;this._busyCount++;if(this.isBusy!==e){this._busySignal.emit(this.isBusy)}return new z.DisposableDelegate((()=>{const e=this.isBusy;this._busyCount--;if(this.isBusy!==e){this._busySignal.emit(this.isBusy)}}))}}class W extends p{constructor(e={shell:new B}){super({...e,shell:e.shell||new B,serviceManager:e.serviceManager||new l.ServiceManager({standby:()=>!this._info.isConnected||"when-hidden"})});this.name=f.PageConfig.getOption("appName")||"JupyterLab";this.namespace=f.PageConfig.getOption("appNamespace")||this.name;this.registerPluginErrors=[];this.status=new H(this);this.version=f.PageConfig.getOption("appVersion")||"unknown";this._allPluginsActivated=new h.PromiseDelegate;this._info=new W.Info(e);this.restored=this.shell.restored.then((async()=>{const e=[];const t=this.activateDeferredPlugins().catch((e=>{console.error("Error when activating deferred plugins\n:",e)}));e.push(t);if(this._info.deferred){const t=Promise.all(this._info.deferred.matches.map((e=>this.activatePlugin(e)))).catch((e=>{console.error("Error when activating customized list of deferred plugins:\n",e)}));e.push(t)}Promise.all(e).then((()=>{this._allPluginsActivated.resolve()})).catch((()=>undefined))})).catch((()=>undefined));const t=W.defaultPaths.urls;const n=W.defaultPaths.directories;const i=e.paths&&e.paths.urls||{};const s=e.paths&&e.paths.directories||{};this._paths={urls:Object.keys(t).reduce(((e,n)=>{if(n in i){const t=i[n];e[n]=t}else{e[n]=t[n]}return e}),{}),directories:Object.keys(W.defaultPaths.directories).reduce(((e,t)=>{if(t in s){const n=s[t];e[t]=n}else{e[t]=n[t]}return e}),{})};if(this._info.devMode){this.shell.addClass("jp-mod-devMode")}this.docRegistry.addModelFactory(new a.Base64ModelFactory);if(e.mimeExtensions){for(const t of S(e.mimeExtensions)){this.registerPlugin(t)}}}get info(){return this._info}get paths(){return this._paths}get allPluginsActivated(){return this._allPluginsActivated.promise}registerPluginModule(e){let t=e.default;if(!e.hasOwnProperty("__esModule")){t=e}if(!Array.isArray(t)){t=[t]}t.forEach((e=>{try{this.registerPlugin(e)}catch(t){this.registerPluginErrors.push(t)}}))}registerPluginModules(e){e.forEach((e=>{this.registerPluginModule(e)}))}evtKeydown(e){const t=new h.PromiseDelegate;this.commands.holdKeyBindingExecution(e,t.promise);this.commands.processKeydownEvent(e);const n=e.target;if(!n){return t.resolve(true)}let i=null;let s=null;const o=()=>{if(i){n.removeEventListener("beforeinput",i)}if(s){n.removeEventListener("keyup",s)}};const r=Promise.race([new Promise((e=>{i=t=>{switch(t.inputType){case"historyUndo":case"historyRedo":{if(t.target instanceof Element&&t.target.closest("[data-jp-undoer]")){t.preventDefault();o();return e(false)}break}case"insertLineBreak":{if(t.target instanceof Element&&t.target.closest(".jp-Cell")){t.preventDefault();o();return e(false)}break}}o();return e(true)};n.addEventListener("beforeinput",i,{once:true})})),new Promise((t=>{s=n=>{if(n.code===e.code){o();return t(false)}};n.addEventListener("keyup",s,{once:true})})),new Promise((e=>{setTimeout((()=>{o();return e(false)}),V.INPUT_GUARD_TIMEOUT)}))]);r.then((e=>{t.resolve(!e)})).catch(console.warn)}}(function(e){e.IInfo=new h.Token("@jupyterlab/application:IInfo","A service providing metadata about the current application, including disabled extensions and whether dev mode is enabled.");class t{constructor({connectionStatus:t,...n}={}){var i,s,o,r,a,d,c;this._connectionStatus=t!==null&&t!==void 0?t:new l.ConnectionStatus;this._availablePlugins=(i=n.availablePlugins)!==null&&i!==void 0?i:e.defaultInfo.availablePlugins;this._devMode=(s=n.devMode)!==null&&s!==void 0?s:e.defaultInfo.devMode;this._deferred=JSON.parse(JSON.stringify((o=n.deferred)!==null&&o!==void 0?o:e.defaultInfo.deferred));this._disabled=JSON.parse(JSON.stringify((r=n.disabled)!==null&&r!==void 0?r:e.defaultInfo.disabled));this._filesCached=(a=n.filesCached)!==null&&a!==void 0?a:e.defaultInfo.filesCached;this._mimeExtensions=JSON.parse(JSON.stringify((d=n.mimeExtensions)!==null&&d!==void 0?d:e.defaultInfo.mimeExtensions));this.isConnected=(c=n.isConnected)!==null&&c!==void 0?c:e.defaultInfo.isConnected}get availablePlugins(){return this._availablePlugins}get devMode(){return this._devMode}get deferred(){return this._deferred}get disabled(){return this._disabled}get filesCached(){return this._filesCached}get isConnected(){return this._connectionStatus.isConnected}set isConnected(e){this._connectionStatus.isConnected=e}get mimeExtensions(){return this._mimeExtensions}}e.Info=t;e.defaultInfo={devMode:f.PageConfig.getOption("devMode").toLowerCase()==="true",deferred:{patterns:[],matches:[]},disabled:{patterns:[],matches:[]},mimeExtensions:[],availablePlugins:[],filesCached:f.PageConfig.getOption("cacheFiles").toLowerCase()==="true",isConnected:true};e.defaultPaths={urls:{base:f.PageConfig.getOption("baseUrl"),notFound:f.PageConfig.getOption("notFoundUrl"),app:f.PageConfig.getOption("appUrl"),doc:f.PageConfig.getOption("docUrl"),static:f.PageConfig.getOption("staticUrl"),settings:f.PageConfig.getOption("settingsUrl"),themes:f.PageConfig.getOption("themesUrl"),translations:f.PageConfig.getOption("translationsApiUrl"),hubHost:f.PageConfig.getOption("hubHost")||undefined,hubPrefix:f.PageConfig.getOption("hubPrefix")||undefined,hubUser:f.PageConfig.getOption("hubUser")||undefined,hubServerName:f.PageConfig.getOption("hubServerName")||undefined},directories:{appSettings:f.PageConfig.getOption("appSettingsDir"),schemas:f.PageConfig.getOption("schemasDir"),static:f.PageConfig.getOption("staticDir"),templates:f.PageConfig.getOption("templatesDir"),themes:f.PageConfig.getOption("themesDir"),userSettings:f.PageConfig.getOption("userSettingsDir"),serverRoot:f.PageConfig.getOption("serverRoot"),workspaces:f.PageConfig.getOption("workspacesDir")}}})(W||(W={}));var V;(function(e){e.INPUT_GUARD_TIMEOUT=10})(V||(V={}));class U{constructor(e){this.stop=new h.Token("@jupyterlab/application:Router#stop");this._routed=new u.Signal(this);this._rules=new Map;this.base=e.base;this.commands=e.commands}get current(){var e,t;const{base:n}=this;const i=f.URLExt.parse(window.location.href);const{search:s,hash:o}=i;const r=(t=(e=i.pathname)===null||e===void 0?void 0:e.replace(n,"/"))!==null&&t!==void 0?t:"";const a=r+s+o;return{hash:o,path:r,request:a,search:s}}get routed(){return this._routed}navigate(e,t={}){const{base:n}=this;const{history:i}=window;const{hard:s}=t;const o=document.location.href;const r=e&&e.indexOf(n)===0?e:f.URLExt.join(n,e);if(r===o){return s?this.reload():undefined}i.pushState({},"",r);if(s){return this.reload()}if(!t.skipRouting){requestAnimationFrame((()=>{void this.route()}))}}register(e){var t;const{command:n,pattern:i}=e;const s=(t=e.rank)!==null&&t!==void 0?t:100;const o=this._rules;o.set(i,{command:n,rank:s});return new z.DisposableDelegate((()=>{o.delete(i)}))}reload(){window.location.reload()}route(){const{commands:e,current:t,stop:n}=this;const{request:i}=t;const s=this._routed;const o=this._rules;const r=[];o.forEach(((e,t)=>{if(i===null||i===void 0?void 0:i.match(t)){r.push(e)}}));const a=r.sort(((e,t)=>t.rank-e.rank));const l=new h.PromiseDelegate;const d=async()=>{if(!a.length){s.emit(t);l.resolve(undefined);return}const{command:o}=a.pop();try{const i=this.current.request;const s=await e.execute(o,t);if(s===n){a.length=0;console.debug(`Routing ${i} was short-circuited by ${o}`)}}catch(r){console.warn(`Routing ${i} to ${o} failed`,r)}void d()};void d();return l.promise}}const q=new h.Token("@jupyterlab/application:IConnectionLost",`A service for invoking the dialog shown\n when JupyterLab has lost its connection to the server. Use this if, for some reason,\n you want to bring up the "connection lost" dialog under new circumstances.`);const $=new h.Token("@jupyterlab/application:ILabStatus",`A service for interacting with the application busy/dirty\n status. Use this if you want to set the application "busy" favicon, or to set\n the application "dirty" status, which asks the user for confirmation before leaving the application page.`);const K=new h.Token("@jupyterlab/application:IRouter","The URL router used by the application. Use this to add custom URL-routing for your extension (e.g., to invoke a command if the user navigates to a sub-path).");const J=new h.Token("@jupyterlab/application:ITreePathUpdater","A service to update the tree path.");function G(e){const{id:t,commands:n,shell:i,semanticCommands:o,default:r,overrides:a,trans:l}=e;n.addCommand(t,{...Y({commands:n,shell:i},o,r!==null&&r!==void 0?r:{},l!==null&&l!==void 0?l:s.nullTranslator.load("jupyterlab")),...a});const d=Array.isArray(o)?o:[o];const c=(e,n)=>{if(n.id){if(n.id===t&&n.type==="removed"){e.commandChanged.disconnect(c)}else{const i=d.reduce(((e,t)=>e.concat(t.ids)),[]);if(i.includes(n.id)){switch(n.type){case"changed":case"many-changed":e.notifyCommandChanged(t);break;case"removed":for(const e of d){e.remove(n.id)}break}}}}};n.commandChanged.connect(c)}function Y(e,t,n,s){const{commands:o,shell:r}=e;const a=Array.isArray(t)?t:[t];return{label:d("label"),caption:d("caption"),isEnabled:()=>{var e;const t=l("isEnabled");return t.length>0&&!t.some((e=>e===false))||((e=n.isEnabled)!==null&&e!==void 0?e:false)},isToggled:()=>{var e;const t=l("isToggled");return t.some((e=>e===true))||((e=n.isToggled)!==null&&e!==void 0?e:false)},isVisible:()=>{var e;const t=l("isVisible");return t.length>0&&!t.some((e=>e===false))||((e=n.isVisible)!==null&&e!==void 0?e:true)},execute:async()=>{const e=r.currentWidget;const t=a.map((t=>e!==null?t.getActiveCommandId(e):null));const s=t.filter((e=>e!==null&&o.isEnabled(e)));let l=null;if(s.length>0){for(const t of s){const n={[i.SemanticCommand.WIDGET]:e.id};l=await o.execute(t,n);if(typeof l==="boolean"&&l===false){break}}}else if(n.execute){l=await o.execute(n.execute)}return l}};function l(e){const t=r.currentWidget;const n=a.map((e=>t!==null?e.getActiveCommandId(t):null));const i=n.filter((e=>e!==null)).map((t=>o[e](t)));return i}function d(e){return()=>{var t;const i=l(e).map(((t,n)=>e=="caption"&&n>0?t.toLocaleLowerCase():t));switch(i.length){case 0:return(t=n[e])!==null&&t!==void 0?t:"";case 1:return i[0];default:{const e=i.some((e=>/…$/.test(e)));const t=i.slice(undefined,-1).map((e=>e.replace(/…$/,""))).join(", ");const n=i.slice(-1)[0].replace(/…$/,"")+(e?"…":"");return s.__("%1 and %2",t,n)}}}}}},3579:(e,t,n)=>{"use strict";var i=n(2898);var s=n(40244);var o=n(10395);var r=n(40662);var a=n(97913);var l=n(79010);var d=n(85072);var c=n.n(d);var h=n(97825);var u=n.n(h);var p=n(77659);var m=n.n(p);var g=n(55056);var f=n.n(g);var v=n(10540);var _=n.n(v);var b=n(41113);var y=n.n(b);var w=n(30966);var C={};C.styleTagTransform=y();C.setAttributes=f();C.insert=m().bind(null,"head");C.domAPI=u();C.insertStyleElement=_();var x=c()(w.A,C);const S=w.A&&w.A.locals?w.A.locals:undefined},97472:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>De,kernelSettings:()=>Te,toggleHeader:()=>xe});var i=n(74991);var s=n(72050);var o=n(37737);var r=n(15615);var a=n(86503);var l=n(61927);var d=n(66127);var c=n(5592);var h=n(90044);var u=n(26568);var p=n(77256);const m="help:open";const g="/lab/api/news";const f="/lab/api/update";const v="https://jupyterlab.readthedocs.io/en/stable/privacy_policies.html";async function _(e,t={}){const n=p.ServerConnection.makeSettings();const i=o.URLExt.join(n.baseUrl,e);let s;try{s=await p.ServerConnection.makeRequest(i,t,n)}catch(a){throw new p.ServerConnection.NetworkError(a)}const r=await s.json();if(!s.ok){throw new p.ServerConnection.ResponseError(s,r.message)}return r}const b={id:"@jupyterlab/apputils-extension:announcements",description:"Add the announcement feature. It will fetch news on the internet and check for application updates.",autoStart:true,optional:[p.IConfigSectionManager,r.ISettingRegistry,l.ITranslator],activate:(e,t,n,i)=>{var o,r;const a=b.id.replace(/[^\w]/g,"");void Promise.all([e.restored,(o=n===null||n===void 0?void 0:n.load("@jupyterlab/apputils-extension:notification"))!==null&&o!==void 0?o:Promise.resolve(null),(r=t===null||t===void 0?void 0:t.create({name:a}))!==null&&r!==void 0?r:Promise.resolve(null)]).then((async([t,n,o])=>{const r=(i!==null&&i!==void 0?i:l.nullTranslator).load("jupyterlab");s.Notification.manager.changed.connect(((e,t)=>{var n;if(t.type!=="removed"){return}const{id:i,tags:s}=(n=t.notification.options.data)!==null&&n!==void 0?n:{};if((s!==null&&s!==void 0?s:[]).some((e=>["news","update"].includes(e)))&&i){const e={};e[i]={seen:true,dismissed:true};o===null||o===void 0?void 0:o.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}}));const a=n===null||n===void 0?void 0:n.get("fetchNews").composite;if(a==="none"){const t=s.Notification.emit(r.__("Would you like to get notified about official Jupyter news?"),"default",{autoClose:false,actions:[{label:r.__("Open privacy policy"),caption:v,callback:t=>{t.preventDefault();if(e.commands.hasCommand(m)){void e.commands.execute(m,{text:r.__("Privacy policies"),url:v})}else{window.open(v,"_blank","noreferrer")}},displayType:"link"},{label:r.__("Yes"),callback:()=>{s.Notification.dismiss(t);o===null||o===void 0?void 0:o.update({}).then((()=>d())).catch((e=>{console.error(`Failed to get the news:\n${e}`)}));n===null||n===void 0?void 0:n.set("fetchNews","true").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}},{label:r.__("No"),callback:()=>{s.Notification.dismiss(t);n===null||n===void 0?void 0:n.set("fetchNews","false").catch((e=>{console.error(`Failed to save setting 'fetchNews':\n${e}`)}))}}]})}else{await d()}async function d(){var e,t,i,a;if(((e=n===null||n===void 0?void 0:n.get("fetchNews").composite)!==null&&e!==void 0?e:"false")==="true"){try{const e=await _(g);for(const{link:n,message:i,type:a,options:l}of e.news){const e=l.data["id"];const d=(t=o===null||o===void 0?void 0:o.data[e])!==null&&t!==void 0?t:{seen:false,dismissed:false};if(!d.dismissed){l.actions=[{label:r.__("Hide"),caption:r.__("Never show this notification again."),callback:()=>{const t={};t[e]={seen:true,dismissed:true};o===null||o===void 0?void 0:o.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}}];if((n===null||n===void 0?void 0:n.length)===2){l.actions.push({label:n[0],caption:n[1],callback:()=>{window.open(n[1],"_blank","noreferrer")},displayType:"link"})}if(!d.seen){l.autoClose=5e3;const t={};t[e]={seen:true};o===null||o===void 0?void 0:o.update(t).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}s.Notification.emit(i,a,l)}}}catch(l){console.log("Failed to get the announcements.",l)}}if((i=n===null||n===void 0?void 0:n.get("checkForUpdates").composite)!==null&&i!==void 0?i:true){const e=await _(f);if(e.notification){const{link:t,message:i,type:l,options:d}=e.notification;const c=d.data["id"];const h=(a=o===null||o===void 0?void 0:o.data[c])!==null&&a!==void 0?a:{seen:false,dismissed:false};if(!h.dismissed){let e;d.actions=[{label:r.__("Ignore all updates"),caption:r.__("Do not prompt me if a new JupyterLab version is available."),callback:()=>{n===null||n===void 0?void 0:n.set("checkForUpdates",false).then((()=>{s.Notification.dismiss(e)})).catch((e=>{console.error("Failed to set the `checkForUpdates` setting.",e)}))}}];if((t===null||t===void 0?void 0:t.length)===2){d.actions.push({label:t[0],caption:t[1],callback:()=>{window.open(t[1],"_blank","noreferrer")},displayType:"accent"})}if(!h.seen){d.autoClose=5e3;const e={};e[c]={seen:true};o===null||o===void 0?void 0:o.update(e).catch((e=>{console.error(`Failed to update the announcements config:\n${e}`)}))}e=s.Notification.emit(i,l,d)}}}}}))}};var y=n(56759);var w;(function(e){e.licenses="apputils:licenses";e.licenseReport="apputils:license-report";e.refreshLicenses="apputils:licenses-refresh"})(w||(w={}));const C={id:"@jupyterlab/apputils-extension:licenses-client",description:"The licenses client plugin for fetching licenses.",autoStart:true,provides:s.ILicensesClient,activate:e=>{const t=o.URLExt.join(o.PageConfig.getBaseUrl(),o.PageConfig.getOption("licensesUrl"))+"/";const n=e.serviceManager.serverSettings;return new s.Licenses.LicensesClient({licensesUrl:t,serverSettings:n})}};const x={id:"@jupyterlab/apputils-extension:licenses-plugin",description:"Adds licenses reporting tools.",requires:[s.ILicensesClient,l.ITranslator],optional:[i.ILayoutRestorer,y.IMainMenu,s.ICommandPalette],autoStart:true,activate:(e,t,n,i,r,a)=>{const{commands:l,shell:c}=e;const h=n.load("jupyterlab");const u=h.__("Help");const p=h.__("Download All Licenses as");const m=h.__("Refresh Licenses");const g="help-licenses";const f=new s.WidgetTracker({namespace:g});const v=h.__("Licenses");let _=0;function b(e){const n=new s.Licenses.Model({...e,client:t,trans:h});const i=new s.Licenses({model:n});i.id=`${g}-${++_}`;i.title.label=v;i.title.icon=d.copyrightIcon;const o=new s.MainAreaWidget({content:i,reveal:n.licensesReady});o.toolbar.addItem("refresh-licenses",new d.CommandToolbarButton({id:w.refreshLicenses,args:{noLabel:1},commands:l}));o.toolbar.addItem("spacer",d.Toolbar.createSpacerItem());for(const t of Object.keys(s.Licenses.REPORT_FORMATS)){const e=new d.CommandToolbarButton({id:w.licenseReport,args:{format:t,noLabel:1},commands:l});o.toolbar.addItem(`download-${t}`,e)}return o}function y(e){return s.Licenses.REPORT_FORMATS[e]||s.Licenses.REPORT_FORMATS[s.Licenses.DEFAULT_FORMAT]}l.addCommand(w.licenses,{label:v,execute:e=>{if(!o.PageConfig.getOption("licensesUrl")){console.warn("No license API available from the server");return}const t=b(e);c.add(t,"main",{type:"Licenses"});void f.add(t);t.content.model.trackerDataChanged.connect((()=>{void f.save(t)}));return t}});l.addCommand(w.refreshLicenses,{label:e=>e.noLabel?"":m,caption:m,icon:d.refreshIcon,execute:async()=>{var e;return(e=f.currentWidget)===null||e===void 0?void 0:e.content.model.initLicenses()}});l.addCommand(w.licenseReport,{label:e=>{if(e.noLabel){return""}const t=y(`${e.format}`);return`${p} ${t.title}`},caption:e=>{const t=y(`${e.format}`);return`${p} ${t.title}`},icon:e=>{const t=y(`${e.format}`);return t.icon},execute:async e=>{var t;const n=y(`${e.format}`);return await((t=f.currentWidget)===null||t===void 0?void 0:t.content.model.download({format:n.id}))}});if(a){a.addItem({command:w.licenses,category:u})}if(r){const e=r.helpMenu;e.addGroup([{command:w.licenses}],0)}if(i){void i.restore(f,{command:w.licenses,name:e=>"licenses",args:e=>{const{currentBundleName:t,currentPackageIndex:n,packageFilter:i}=e.content.model;const s={currentBundleName:t,currentPackageIndex:n,packageFilter:i};return s}})}}};var S=n(66987);var k=n(1143);var j=n(44914);var I=n(5338);const E="jp-Notification-Toast-Close";const T="jp-Notification-Toast-Close-Margin";const M=140;var D;(function(e){e.dismiss="apputils:dismiss-notification";e.display="apputils:display-notifications";e.notify="apputils:notify";e.update="apputils:update-notification"})(D||(D={}));const A=4;function P(e){const{manager:t,onClose:n,trans:i}=e;const[s,o]=j.useState([]);const[r,a]=j.useState(null);j.useEffect((()=>{async function e(){o(await Promise.all(t.notifications.map((async e=>Object.freeze({...e})))))}if(s.length!==t.count){void e()}t.changed.connect(e);return()=>{t.changed.disconnect(e)}}),[t]);j.useEffect((()=>{O.getIcons().then((e=>{a(e)})).catch((e=>{console.error(`Failed to get react-toastify icons:\n${e}`)}))}),[]);return j.createElement(d.UseSignal,{signal:t.changed},(()=>j.createElement(j.Fragment,null,j.createElement("h2",{className:"jp-Notification-Header jp-Toolbar"},j.createElement("span",{className:"jp-Toolbar-item"},t.count>0?i._n("%1 notification","%1 notifications",t.count):i.__("No notifications")),j.createElement("span",{className:"jp-Toolbar-item jp-Toolbar-spacer"}),j.createElement(d.ToolbarButtonComponent,{noFocusOnClick:false,onClick:()=>{t.dismiss()},icon:d.deleteIcon,tooltip:i.__("Dismiss all notifications"),enabled:t.count>0}),j.createElement(d.ToolbarButtonComponent,{noFocusOnClick:false,onClick:n,icon:d.closeIcon,tooltip:i.__("Hide notifications")})),j.createElement("ol",{className:"jp-Notification-List"},s.map((e=>{var n;const{id:s,message:o,type:a,options:l}=e;const c=a==="in-progress"?"default":a;const h=()=>{t.dismiss(s)};const u=a==="default"?null:a==="in-progress"?(n=r===null||r===void 0?void 0:r.spinner)!==null&&n!==void 0?n:null:r&&r[a];return j.createElement("li",{className:"jp-Notification-List-Item",key:e.id,onClick:e=>{e.stopPropagation()}},j.createElement("div",{className:`Toastify__toast Toastify__toast-theme--light Toastify__toast--${c} jp-Notification-Toast-${c}`},j.createElement("div",{className:"Toastify__toast-body"},u&&j.createElement("div",{className:"Toastify__toast-icon"},u({theme:"light",type:c})),j.createElement("div",null,O.createContent(o,h,l.actions))),j.createElement(O.CloseButton,{close:h,closeIcon:d.deleteIcon.react,title:i.__("Dismiss notification"),closeIconMargin:true})))}))))))}class L extends d.VDomModel{constructor(e){super();this.manager=e;this._highlight=false;this._listOpened=false;this._doNotDisturbMode=false;this._count=e.count;this.manager.changed.connect(this.onNotificationChanged,this)}get count(){return this._count}get doNotDisturbMode(){return this._doNotDisturbMode}set doNotDisturbMode(e){this._doNotDisturbMode=e}get highlight(){return this._highlight}get listOpened(){return this._listOpened}set listOpened(e){this._listOpened=e;if(this._listOpened||this._highlight){this._highlight=false}this.stateChanged.emit()}onNotificationChanged(e,t){this._count=this.manager.count;const{autoClose:n}=t.notification.options;const i=this.doNotDisturbMode||typeof n==="number"&&n<=0;if(!this._listOpened&&t.type!=="removed"&&i){this._highlight=true}this.stateChanged.emit()}}function R(e){return j.createElement(S.GroupItem,{role:"button",tabIndex:0,"aria-haspopup":true,spacing:A,onClick:()=>{e.onClick()},onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){e.onClick()}},title:e.count>0?e.trans._n("%1 notification","%1 notifications",e.count):e.trans.__("No notifications")},j.createElement(S.TextItem,{className:"jp-Notification-Status-Text",source:`${e.count}`}),j.createElement(d.bellIcon.react,{top:"2px",stylesheet:"statusBar"}))}const N={id:"@jupyterlab/apputils-extension:notification",description:"Add the notification center and its status indicator.",autoStart:true,optional:[S.IStatusBar,r.ISettingRegistry,l.ITranslator],activate:(e,t,n,i)=>{O.translator=i!==null&&i!==void 0?i:l.nullTranslator;const o=O.translator.load("jupyterlab");const r=new L(s.Notification.manager);r.doNotDisturbMode=false;if(n){void Promise.all([n.load(N.id),e.restored]).then((([e])=>{const t=()=>{r.doNotDisturbMode=e.get("doNotDisturbMode").composite};t();e.changed.connect(t)}))}e.commands.addCommand(D.notify,{label:o.__("Emit a notification"),caption:o.__("Notification is described by {message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{var n;const{message:i,type:o}=t;const r=(n=t.options)!==null&&n!==void 0?n:{};return s.Notification.manager.notify(i,o!==null&&o!==void 0?o:"default",{...r,actions:r.actions?r.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}});e.commands.addCommand(D.update,{label:o.__("Update a notification"),caption:o.__("Notification is described by {id: string, message: string, type?: string, options?: {autoClose?: number | false, actions: {label: string, commandId: string, args?: ReadOnlyJSONObject, caption?: string, className?: string}[], data?: ReadOnlyJSONValue}}."),execute:t=>{const{id:n,message:i,type:o,...r}=t;return s.Notification.manager.update({id:n,message:i,type:o!==null&&o!==void 0?o:"default",...r,actions:r.actions?r.actions.map((t=>({...t,callback:()=>{e.commands.execute(t.commandId,t.args).catch((e=>{console.error(`Failed to executed '${t.commandId}':\n${e}`)}))}}))):null})}});e.commands.addCommand(D.dismiss,{label:o.__("Dismiss a notification"),execute:e=>{const{id:t}=e;s.Notification.manager.dismiss(t)}});let a=null;r.listOpened=false;const c=s.ReactWidget.create(j.createElement(P,{manager:s.Notification.manager,onClose:()=>{a===null||a===void 0?void 0:a.dispose()},trans:o}));c.addClass("jp-Notification-Center");async function h(e,t){var n;if(r.doNotDisturbMode||a!==null&&!a.isDisposed){return}const{message:i,type:s,options:o,id:l}=t.notification;if(typeof o.autoClose==="number"&&o.autoClose<=0){return}switch(t.type){case"added":await O.createToast(l,i,s,o);break;case"updated":{const t=await O.toast();const r=o.actions;const a=(n=o.autoClose)!==null&&n!==void 0?n:r&&r.length>0?false:null;if(t.isActive(l)){const n=()=>{t.dismiss(l);e.dismiss(l)};t.update(l,{type:s==="in-progress"?null:s,isLoading:s==="in-progress",autoClose:a,render:O.createContent(i,n,o.actions)})}else{await O.createToast(l,i,s,o)}}break;case"removed":await O.toast().then((e=>{e.dismiss(l)}));break}}s.Notification.manager.changed.connect(h);const u=()=>{if(a){a.dispose();a=null}else{a=(0,S.showPopup)({body:c,anchor:p,align:"right",hasDynamicSize:true,startHidden:true});O.toast().then((e=>{e.dismiss()})).catch((e=>{console.error(`Failed to dismiss all toasts:\n${e}`)})).finally((()=>{a===null||a===void 0?void 0:a.launch();c.node.focus();a===null||a===void 0?void 0:a.disposed.connect((()=>{r.listOpened=false;a=null}))}))}r.listOpened=a!==null};e.commands.addCommand(D.display,{label:o.__("Show Notifications"),execute:u});const p=s.ReactWidget.create(j.createElement(d.UseSignal,{signal:r.stateChanged},(()=>{if(r.highlight||a&&!a.isDisposed){p.addClass("jp-mod-selected")}else{p.removeClass("jp-mod-selected")}return j.createElement(R,{count:r.count,highlight:r.highlight,trans:o,onClick:u})})));p.addClass("jp-Notification-Status");if(t){t.registerStatusItem(N.id,{item:p,align:"right",rank:-1})}else{p.addClass("jp-ThemedContainer");p.node.style.position="fixed";p.node.style.bottom="0";p.node.style.right="10px";k.Widget.attach(p,document.body);p.show()}}};var O;(function(e){e.translator=l.nullTranslator;let t=null;function i(e){var t;return j.createElement("button",{className:`jp-Button jp-mod-minimal ${E}${e.closeIconMargin?` ${T}`:""}`,title:(t=e.title)!==null&&t!==void 0?t:"",onClick:e.close},j.createElement(e.closeIcon,{className:"jp-icon-hover",tag:"span"}))}e.CloseButton=i;function o(t){const n=e.translator.load("jupyterlab");return j.createElement(i,{close:t.closeToast,closeIcon:d.closeIcon.react,title:n.__("Hide notification")})}let r=null;async function a(){if(r===null){r=new c.PromiseDelegate}else{await r.promise}if(t===null){t=await n.e(1210).then(n.t.bind(n,91210,23));const e=document.body.appendChild(document.createElement("div"));e.id="react-toastify-container";e.classList.add("jp-ThemedContainer");const i=(0,I.H)(e);i.render(j.createElement(t.ToastContainer,{draggable:false,closeOnClick:false,hideProgressBar:true,newestOnTop:true,pauseOnFocusLoss:true,pauseOnHover:true,position:"bottom-right",className:"jp-toastContainer",transition:t.Slide,closeButton:o}));r.resolve()}return t.toast}e.toast=a;async function h(){if(t===null){await a()}return t.Icons}e.getIcons=h;const u={accent:"jp-mod-accept",link:"jp-mod-link",warn:"jp-mod-warn",default:""};function p({action:e,closeToast:t}){var n,i;const s=n=>{e.callback(n);if(!n.defaultPrevented){t()}};const o=["jp-toast-button",u[(n=e.displayType)!==null&&n!==void 0?n:"default"]].join(" ");return j.createElement(d.Button,{title:(i=e.caption)!==null&&i!==void 0?i:e.label,className:o,onClick:s,small:true},e.label)}function m(e,t,n){var i;const s=e.length>M?e.slice(0,M)+"…":e;return j.createElement(j.Fragment,null,j.createElement("div",{className:"jp-toast-message"},s.split("\n").map(((e,t)=>j.createElement(j.Fragment,{key:`part-${t}`},t>0?j.createElement("br",null):null,e)))),((i=n===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0)>0&&j.createElement("div",{className:"jp-toast-buttonBar"},j.createElement("div",{className:"jp-toast-spacer"}),n.map(((e,n)=>j.createElement(p,{key:"button-"+n,action:e,closeToast:t})))))}e.createContent=m;async function g(e,t,n,i={}){const{actions:o,autoClose:r,data:l}=i;const d=await a();const c={autoClose:r!==null&&r!==void 0?r:o&&o.length>0?false:undefined,data:l,className:`jp-Notification-Toast-${n}`,toastId:e,type:n==="in-progress"?null:n,isLoading:n==="in-progress"};return d((({closeToast:n})=>m(t,(()=>{if(n)n();s.Notification.manager.dismiss(e)}),o)),c)}e.createToast=g})(O||(O={}));var B=n(34236);var F=n(93247);var z;(function(e){e.activate="apputils:activate-command-palette"})(z||(z={}));const H="@jupyterlab/apputils-extension:palette";class W{constructor(e,t){this.translator=t||l.nullTranslator;const n=this.translator.load("jupyterlab");this._palette=e;this._palette.title.label="";this._palette.title.caption=n.__("Command Palette")}set placeholder(e){this._palette.inputNode.placeholder=e}get placeholder(){return this._palette.inputNode.placeholder}activate(){this._palette.activate()}addItem(e){const t=this._palette.addItem(e);return new h.DisposableDelegate((()=>{this._palette.removeItem(t)}))}}(function(e){function t(t,n,i){const{commands:o,shell:r}=t;const a=n.load("jupyterlab");const l=V.createPalette(t,n);const d=new s.ModalCommandPalette({commandPalette:l});let c=false;l.node.setAttribute("role","region");l.node.setAttribute("aria-label",a.__("Command Palette Section"));r.add(l,"left",{rank:300,type:"Command Palette"});if(i){const e=i.load(H);const n=e=>{const t=e.get("modal").composite;if(c&&!t){l.parent=null;d.detach();r.add(l,"left",{rank:300,type:"Command Palette"})}else if(!c&&t){l.parent=null;d.palette=l;l.show();d.attach()}c=t};Promise.all([e,t.restored]).then((([e])=>{n(e);e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}const h=()=>{const e=(0,B.find)(t.commands.keyBindings,(e=>e.command===z.activate));if(e){const t=e.keys.map(F.CommandRegistry.formatKeystroke).join(", ");l.title.caption=a.__("Commands (%1)",t)}else{l.title.caption=a.__("Commands")}};h();t.commands.keyBindingChanged.connect((()=>{h()}));o.addCommand(z.activate,{execute:()=>{if(c){d.activate()}else{r.activateById(l.id)}},label:a.__("Activate Command Palette")});l.inputNode.placeholder=a.__("SEARCH");return new e(l,n)}e.activate=t;function n(e,t,n){const i=V.createPalette(e,n);t.add(i,"command-palette")}e.restore=n})(W||(W={}));var V;(function(e){let t;function n(e,n){if(!t){t=new k.CommandPalette({commands:e.commands,renderer:d.CommandPaletteSvg.defaultRenderer});t.id="command-palette";t.title.icon=d.paletteIcon;const i=n.load("jupyterlab");t.title.label=i.__("Commands")}return t}e.createPalette=n})(V||(V={}));class U extends a.DataConnector{constructor(e){super();this._throttlers=Object.create(null);this._connector=e}fetch(e){const t=this._throttlers;if(!(e in t)){t[e]=new u.Throttler((()=>this._connector.fetch(e)),100)}return t[e].invoke()}async list(e="all"){const{isDisabled:t}=o.PageConfig.Extension;const{ids:n,values:i}=await this._connector.list(e==="ids"?"ids":undefined);if(e==="all"){return{ids:n,values:i}}if(e==="ids"){return{ids:n}}return{ids:n.filter((e=>!t(e))),values:i.filter((({id:e})=>!t(e)))}}async save(e,t){await this._connector.save(e,t)}}const q={id:"@jupyterlab/apputils-extension:settings-connector",description:"Provides the settings connector.",autoStart:true,provides:r.ISettingConnector,activate:e=>new U(e.serviceManager.settings)};const $={id:"@jupyterlab/apputils-extension:settings",autoStart:true,provides:r.ISettingRegistry,optional:[r.ISettingConnector],description:"Provides the setting registry.",activate:async(e,t)=>{const{isDisabled:n}=o.PageConfig.Extension;const i=t!==null&&t!==void 0?t:new U(e.serviceManager.settings);const s=new r.SettingRegistry({connector:i,plugins:(await i.list("active")).values.filter((t=>e.hasPlugin(t.id)))});void e.restored.then((async()=>{const t=await i.list("ids");t.ids.forEach((async t=>{if(!e.hasPlugin(t)||n(t)||t in s.plugins){return}try{await s.load(t)}catch(i){console.warn(`Settings failed to load for (${t})`,i);if(!e.isPluginActivated(t)){console.warn(`If 'jupyter.lab.transform=true' in the plugin schema, this `+`may happen if {autoStart: false} in (${t}) or if it is `+`one of the deferredExtensions in page config.`)}}}))}));return s}};const K={id:"@jupyterlab/apputils-extension:kernel-status",description:"Provides the kernel status indicator model.",autoStart:true,requires:[S.IStatusBar],provides:s.IKernelStatusModel,optional:[s.ISessionContextDialogs,l.ITranslator,i.ILabShell],activate:(e,t,n,i,o)=>{const r=i!==null&&i!==void 0?i:l.nullTranslator;const a=n!==null&&n!==void 0?n:new s.SessionContextDialogs({translator:r});const d=async()=>{if(!h.model.sessionContext){return}await a.selectKernel(h.model.sessionContext)};const c=async e=>{if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){e.preventDefault();e.stopPropagation();return d()}};const h=new s.KernelStatus({onClick:d,onKeyDown:c},r);const u=new Set;const p=t=>{u.add(t);if(e.shell.currentWidget){m(e.shell,{newValue:e.shell.currentWidget,oldValue:null})}};function m(e,t){var n;const{oldValue:i,newValue:s}=t;if(i){i.title.changed.disconnect(g)}h.model.sessionContext=(n=[...u].map((e=>e(t.newValue))).filter((e=>e!==null))[0])!==null&&n!==void 0?n:null;if(s&&h.model.sessionContext){g(s.title);s.title.changed.connect(g)}}const g=e=>{h.model.activityName=e.label};if(o){o.currentChanged.connect(m)}t.registerStatusItem(K.id,{priority:1,item:h,align:"left",rank:1,isActive:()=>h.model.sessionContext!==null});return{addSessionProvider:p}}};const J={id:"@jupyterlab/apputils-extension:running-sessions-status",description:"Add the running sessions and terminals status bar item.",autoStart:true,requires:[S.IStatusBar,l.ITranslator],optional:[r.ISettingRegistry],activate:(e,t,n,i)=>{const o=t=>{const i=new s.RunningSessions({onClick:()=>e.shell.activateById("jp-running-sessions"),onKeyDown:t=>{if(t.key==="Enter"||t.key==="Spacebar"||t.key===" "){t.preventDefault();t.stopPropagation();e.shell.activateById("jp-running-sessions")}},serviceManager:e.serviceManager,translator:n,...t});i.model.sessions=Array.from(e.serviceManager.sessions.running()).length;i.model.terminals=Array.from(e.serviceManager.terminals.running()).length;return i};const r=e=>{const n=o(e);return t.registerStatusItem(J.id,{item:n,align:"left",rank:0})};if(i){let e;const t=(t,n)=>{var i,s;const o={"if-any":undefined,never:false,always:true};const a=(i=t===null||t===void 0?void 0:t.get("showStatusBarItem").composite)!==null&&i!==void 0?i:true;const l=o[(s=n===null||n===void 0?void 0:n.get("showStatusBarItem").composite)!==null&&s!==void 0?s:"if-any"];e===null||e===void 0?void 0:e.dispose();if(a||l!==false){e=r({showKernels:a,showTerminals:l})}};const n="@jupyterlab/apputils-extension:kernels-settings";const s="@jupyterlab/terminal-extension:plugin";void Promise.all([n in i.plugins?i.load(n).catch((()=>undefined)):Promise.resolve(undefined),s in i.plugins?i.load(s).catch((()=>undefined)):Promise.resolve(undefined)]).then((([e,n])=>{t(e,n);if(e){e.changed.connect((i=>{e=i;t(e,n)}))}if(n){n.changed.connect((i=>{n=i;t(e,n)}))}}))}else{r({showKernels:true})}}};const G={id:"@jupyterlab/apputils-extension:subshell-settings",description:"Kernel subshell settings.",autoStart:true,requires:[],optional:[r.ISettingRegistry],activate:(e,t)=>{if(t){e.started.then((async()=>{const n=await t.load("@jupyterlab/apputils-extension:kernels-settings");const i=n.get("commsOverSubshells").composite;e.serviceManager.kernels.commsOverSubshells=i;n.changed.connect((()=>{const t=n.get("commsOverSubshells").composite;e.serviceManager.kernels.commsOverSubshells=t}))})).catch((e=>{console.error("Fail to load settings for the subshells.");console.error(e)}))}}};const Y="/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*\n * Webkit scrollbar styling.\n * Separate file which is dynamically loaded based on user/theme settings.\n */\n\n/* use standard opaque scrollbars for most nodes */\n\n::-webkit-scrollbar,\n::-webkit-scrollbar-corner {\n background: var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-thumb {\n background: rgb(var(--jp-scrollbar-thumb-color));\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-right: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n border-bottom: var(--jp-scrollbar-endpad) solid\n var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar */\n\n.CodeMirror-hscrollbar::-webkit-scrollbar,\n.CodeMirror-vscrollbar::-webkit-scrollbar,\n.CodeMirror-hscrollbar::-webkit-scrollbar-corner,\n.CodeMirror-vscrollbar::-webkit-scrollbar-corner {\n background-color: transparent;\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-thumb,\n.CodeMirror-vscrollbar::-webkit-scrollbar-thumb {\n background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n border: var(--jp-scrollbar-thumb-margin) solid transparent;\n background-clip: content-box;\n border-radius: var(--jp-scrollbar-thumb-radius);\n}\n\n.CodeMirror-hscrollbar::-webkit-scrollbar-track:horizontal {\n border-left: var(--jp-scrollbar-endpad) solid transparent;\n border-right: var(--jp-scrollbar-endpad) solid transparent;\n}\n\n.CodeMirror-vscrollbar::-webkit-scrollbar-track:vertical {\n border-top: var(--jp-scrollbar-endpad) solid transparent;\n border-bottom: var(--jp-scrollbar-endpad) solid transparent;\n}\n";var X;(function(e){e.changeTheme="apputils:change-theme";e.changePreferredLightTheme="apputils:change-light-theme";e.changePreferredDarkTheme="apputils:change-dark-theme";e.toggleAdaptiveTheme="apputils:adaptive-theme";e.themeScrollbars="apputils:theme-scrollbars";e.changeFont="apputils:change-font";e.incrFontSize="apputils:incr-font-size";e.decrFontSize="apputils:decr-font-size"})(X||(X={}));function Q(e){const t=document.createElement("style");t.setAttribute("type","text/css");t.appendChild(document.createTextNode(e));return t}const Z={id:"@jupyterlab/apputils-extension:themes",description:"Provides the theme manager.",requires:[r.ISettingRegistry,i.JupyterFrontEnd.IPaths,l.ITranslator],optional:[s.ISplashScreen],activate:(e,t,n,i,r)=>{const a=i.load("jupyterlab");const l=e.shell;const d=e.commands;const c=o.URLExt.join(o.PageConfig.getBaseUrl(),n.urls.themes);const h=Z.id;const u=new s.ThemeManager({key:h,host:l,settings:t,splash:r!==null&&r!==void 0?r:undefined,url:c});let p=null;let m;u.themeChanged.connect(((e,t)=>{m=t.newValue;document.body.dataset.jpThemeLight=String(u.isLight(m));document.body.dataset.jpThemeName=m;document.body.style.colorScheme=u.isLight(m)?"light":"dark";if(document.body.dataset.jpThemeScrollbars!==String(u.themeScrollbars(m))){document.body.dataset.jpThemeScrollbars=String(u.themeScrollbars(m));if(u.themeScrollbars(m)){if(!p){p=Q(Y)}if(!p.parentElement){document.body.appendChild(p)}}else{if(p&&p.parentElement){p.parentElement.removeChild(p)}}}d.notifyCommandChanged(X.changeTheme)}));d.addCommand(X.changeTheme,{label:e=>{if(e.theme===undefined){return a.__("Switch to the provided `theme`.")}const t=e["theme"];const n=u.getDisplayName(t);return e["isPalette"]?a.__("Use Theme: %1",n):n},isToggled:e=>e["theme"]===m,execute:e=>{const t=e["theme"];if(t===u.theme){return}if(u.isToggledAdaptiveTheme()){return u.toggleAdaptiveTheme()}return u.setTheme(t)}});d.addCommand(X.changePreferredLightTheme,{label:e=>{if(e.theme===undefined){return a.__("Switch to the provided light `theme`.")}const t=e["theme"];const n=u.getDisplayName(t);return e["isPalette"]?a.__("Set Preferred Light Theme: %1",n):n},isToggled:e=>e["theme"]===u.preferredLightTheme,execute:e=>{const t=e["theme"];if(t===u.preferredLightTheme){return}return u.setPreferredLightTheme(t)}});d.addCommand(X.changePreferredDarkTheme,{label:e=>{if(e.theme===undefined){return a.__("Switch to the provided dark `theme`.")}const t=e["theme"];const n=u.getDisplayName(t);return e["isPalette"]?a.__("Set Preferred Dark Theme: %1",n):n},isToggled:e=>e["theme"]===u.preferredDarkTheme,execute:e=>{const t=e["theme"];if(t===u.preferredDarkTheme){return}return u.setPreferredDarkTheme(t)}});d.addCommand(X.toggleAdaptiveTheme,{label:e=>e["isPalette"]?a.__("Synchronize Styling Theme with System Settings"):a.__("Synchronize with System Settings"),isToggled:()=>u.isToggledAdaptiveTheme(),execute:()=>{u.toggleAdaptiveTheme().catch(console.warn)}});d.addCommand(X.themeScrollbars,{label:a.__("Theme Scrollbars"),isToggled:()=>u.isToggledThemeScrollbars(),execute:()=>u.toggleThemeScrollbars()});d.addCommand(X.changeFont,{label:e=>e["enabled"]?`${e["font"]}`:a.__("waiting for fonts"),isEnabled:e=>e["enabled"],isToggled:e=>u.getCSS(e["key"])===e["font"],execute:e=>u.setCSSOverride(e["key"],e["font"])});d.addCommand(X.incrFontSize,{label:e=>{switch(e.key){case"code-font-size":return a.__("Increase Code Font Size");case"content-font-size1":return a.__("Increase Content Font Size");case"ui-font-size1":return a.__("Increase UI Font Size");default:return a.__("Increase Font Size")}},execute:e=>u.incrFontSize(e["key"])});d.addCommand(X.decrFontSize,{label:e=>{switch(e.key){case"code-font-size":return a.__("Decrease Code Font Size");case"content-font-size1":return a.__("Decrease Content Font Size");case"ui-font-size1":return a.__("Decrease UI Font Size");default:return a.__("Decrease Font Size")}},execute:e=>u.decrFontSize(e["key"])});return u},autoStart:true,provides:s.IThemeManager};const ee={id:"@jupyterlab/apputils-extension:themes-palette-menu",description:"Adds theme commands to the menu and the command palette.",requires:[s.IThemeManager,l.ITranslator],optional:[s.ICommandPalette,y.IMainMenu],activate:(e,t,n,i,s)=>{const o=n.load("jupyterlab");if(s){void e.restored.then((()=>{var e;const n=false;const i=(e=s.settingsMenu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-mainmenu-settings-apputilstheme"})))===null||e===void 0?void 0:e.submenu;if(i){t.themes.forEach(((e,t)=>{i.insertItem(t,{command:X.changeTheme,args:{isPalette:n,theme:e}})}))}}))}if(i){void e.restored.then((()=>{const e=o.__("Theme");const n=X.changeTheme;const s=true;t.themes.forEach((t=>{i.addItem({command:n,args:{isPalette:s,theme:t},category:e})}));t.themes.forEach((t=>{i.addItem({command:X.changePreferredLightTheme,args:{isPalette:s,theme:t},category:e})}));t.themes.forEach((t=>{i.addItem({command:X.changePreferredDarkTheme,args:{isPalette:s,theme:t},category:e})}));i.addItem({command:X.toggleAdaptiveTheme,args:{isPalette:s},category:e});i.addItem({command:X.themeScrollbars,category:e});i.addItem({command:X.incrFontSize,args:{key:"code-font-size"},category:e});i.addItem({command:X.decrFontSize,args:{key:"code-font-size"},category:e});i.addItem({command:X.incrFontSize,args:{key:"content-font-size1"},category:e});i.addItem({command:X.decrFontSize,args:{key:"content-font-size1"},category:e});i.addItem({command:X.incrFontSize,args:{key:"ui-font-size1"},category:e});i.addItem({command:X.decrFontSize,args:{key:"ui-font-size1"},category:e})}))}},autoStart:true};const te={id:"@jupyterlab/apputils-extension:toolbar-registry",description:"Provides toolbar items registry.",autoStart:true,provides:s.IToolbarWidgetRegistry,activate:e=>{const t=new s.ToolbarWidgetRegistry({defaultFactory:(0,s.createDefaultFactory)(e.commands)});return t}};var ne=n(44185);var ie=n(98171);const se="jupyterlab-workspace";const oe="."+se;const re="workspace-ui:lastSave";const ae="jp-JupyterIcon";const le={id:"@jupyterlab/apputils-extension:workspaces",description:"Add workspace file type.",autoStart:true,requires:[a.IStateDB,l.ITranslator,i.JupyterFrontEnd.IPaths],optional:[i.IRouter,ie.IWorkspaceCommands],activate:(e,t,n,i,s,r)=>{const a=new de.WorkspaceFactory({workspaces:e.serviceManager.workspaces,state:t,translator:n,open:async t=>{if(r){await e.commands.execute(r.open,{workspace:t})}else{const e=o.URLExt.join(i.urls.app,"workspaces");const n=o.URLExt.join(e,t);if(!n.startsWith(e)){throw new Error("Can only be used for workspaces")}if(s){s.navigate(n,{hard:true})}else{document.location.href=n}}}});const l=n.load("jupyterlab");e.docRegistry.addFileType({name:se,contentType:"file",fileFormat:"text",displayName:l.__("JupyterLab Workspace File"),extensions:[oe],mimeTypes:["text/json"],iconClass:ae});e.docRegistry.addWidgetFactory(a)}};var de;(function(e){class t extends ne.ABCWidgetFactory{constructor(e){const t=(e.translator||l.nullTranslator).load("jupyterlab");super({name:"Workspace loader",label:t.__("Workspace loader"),fileTypes:[se],defaultFor:[se],readOnly:true});this._state=e.state;this._workspaces=e.workspaces;this._open=e.open}createNewWidget(e){void e.ready.then((async()=>{const t=e.model;const n=t.toJSON();const i=e.path;const s=n.metadata.id;await this._workspaces.save(s,n);await this._state.save(re,i);await this._open(s)}));return n(e)}}e.WorkspaceFactory=t;function n(e){const t=new ne.DocumentWidget({content:new k.Widget,context:e});t.content.dispose();return t}})(de||(de={}));var ce=n(76326);const he="jp-ContextualShortcut-TableRow";const ue="jp-ContextualShortcut-TableLastRow";const pe="jp-ContextualShortcut-TableItem";const me="jp-ContextualShortcut-Key";function ge(e){const{commands:t,trans:n,activeElement:i}=e;const o=i!==null&&i!==void 0?i:document.activeElement;function r(e){const t=[];e.forEach(((e,n)=>{const i=[];e.split(" ").forEach(((e,t)=>{i.push(j.createElement("span",{className:me,key:`ch-${t}`},j.createElement("kbd",null,e)),j.createElement(j.Fragment,{key:`fragment-${t}`}," + "))}));t.push(j.createElement("span",{key:`key-${n}`},i.slice(0,-1)),j.createElement(j.Fragment,{key:`fragment-${n}`}," + "))}));return j.createElement("span",null,t.slice(0,-1))}function a(e){const t=e.charAt(0).toUpperCase()+e.slice(1);return t}function l(e){const n=t.label(e.command);const i=e.command.split(":")[1];const s=i.split("-");let o="";for(let t=0;t0){return n}else{return o}}function d(e,t){let n=t;for(let i=0;n!==null&&n!==n.parentElement;n=n.parentElement,++i){if(n.hasAttribute("data-lm-suppress-shortcuts")){return-1}if(n.matches(e)){return i}}return-1}const c=new Map;for(let s=0;sce.Selector.calculateSpecificity(e.selector)){continue}}c.set(i,[n,e])}let h=-1;const u=new Map;for(let[s,g]of c.values()){h=Math.max(s,h);if(!u.has(s)){u.set(s,[])}u.get(s).push(g)}const p=[];for(let s=0;s<=h;s++){if(u.has(s)){p.push(u.get(s).map((e=>j.createElement("tr",{className:he,key:`${e.command}-${e.keys.join("-").replace(" ","_")}`},j.createElement("td",{className:pe},l(e)),j.createElement("td",{className:pe},r([...e.keys]))))));p.push(j.createElement("tr",{className:ue,key:`group-${s}-last`}))}}const m=j.createElement("table",null,j.createElement("tbody",null,p));return(0,s.showDialog)({title:n.__("Keyboard Shortcuts"),body:m,buttons:[s.Dialog.cancelButton({label:n.__("Close")})]})}const fe=12e3;var ve;(function(e){e.loadState="apputils:load-statedb";e.print="apputils:print";e.reset="apputils:reset";e.resetOnLoad="apputils:reset-on-load";e.runFirstEnabled="apputils:run-first-enabled";e.runAllEnabled="apputils:run-all-enabled";e.toggleHeader="apputils:toggle-header";e.displayShortcuts="apputils:display-shortcuts"})(ve||(ve={}));const _e={id:"@jupyterlab/apputils-extension:palette",description:"Provides the command palette.",autoStart:true,requires:[l.ITranslator],provides:s.ICommandPalette,optional:[r.ISettingRegistry],activate:(e,t,n)=>W.activate(e,t,n)};const be={id:"@jupyterlab/apputils-extension:palette-restorer",description:"Restores the command palette.",autoStart:true,requires:[i.ILayoutRestorer,l.ITranslator],activate:(e,t,n)=>{W.restore(e,t,n)}};const ye={id:"@jupyterlab/apputils-extension:resolver",description:"Provides the window name resolver.",autoStart:true,provides:s.IWindowResolver,requires:[i.JupyterFrontEnd.IPaths,i.IRouter],activate:async(e,t,n)=>{const{hash:i,search:r}=n.current;const a=o.URLExt.queryStringToObject(r||"");const l=new s.WindowResolver;const d=o.PageConfig.getOption("workspace");const c=o.PageConfig.getOption("treePath");const h=o.PageConfig.getOption("mode")==="multiple-document"?"lab":"doc";const u=d?d:o.PageConfig.defaultWorkspace;const p=c?o.URLExt.join("tree",c):"";try{await l.resolve(u);return l}catch(m){return new Promise((()=>{const{base:e}=t.urls;const s="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";const r=s[Math.floor(Math.random()*s.length)];let l=o.URLExt.join(e,h,"workspaces",`auto-${r}`);l=p?o.URLExt.join(l,o.URLExt.encodeParts(p)):l;a["reset"]="";const d=l+o.URLExt.objectToQueryString(a)+(i||"");n.navigate(d,{hard:true})}))}}};const we={id:"@jupyterlab/apputils-extension:splash",description:"Provides the splash screen.",autoStart:true,requires:[l.ITranslator],provides:s.ISplashScreen,activate:(e,t)=>{const n=t.load("jupyterlab");const{commands:i,restored:o}=e;const r=document.createElement("div");const a=document.createElement("div");const l=document.createElement("div");r.id="jupyterlab-splash";a.id="galaxy";l.id="main-logo";d.jupyterFaviconIcon.element({container:l,stylesheet:"splash"});a.appendChild(l);["1","2","3"].forEach((e=>{const t=document.createElement("div");const n=document.createElement("div");t.id=`moon${e}`;t.className="moon orbit";n.id=`planet${e}`;n.className="planet";t.appendChild(n);a.appendChild(t)}));r.appendChild(a);let c;const p=new u.Throttler((async()=>{if(c){return}c=new s.Dialog({title:n.__("Loading…"),body:n.__(`The loading screen is taking a long time.\nWould you like to clear the workspace or keep waiting?`),buttons:[s.Dialog.cancelButton({label:n.__("Keep Waiting")}),s.Dialog.warnButton({label:n.__("Clear Workspace")})]});try{const e=await c.launch();c.dispose();c=null;if(e.button.accept&&i.hasCommand(ve.reset)){return i.execute(ve.reset)}requestAnimationFrame((()=>{void p.invoke().catch((e=>undefined))}))}catch(e){}}),{limit:fe,edge:"trailing"});let m=0;return{show:(e=true)=>{r.classList.remove("splash-fade");r.classList.toggle("light",e);r.classList.toggle("dark",!e);m++;document.body.appendChild(r);void p.invoke().catch((e=>undefined));return new h.DisposableDelegate((async()=>{await o;if(--m===0){void p.stop();if(c){c.dispose();c=null}r.classList.add("splash-fade");window.setTimeout((()=>{document.body.removeChild(r)}),200)}}))}}}};const Ce={id:"@jupyterlab/apputils-extension:print",description:"Add the print capability",autoStart:true,requires:[l.ITranslator],activate:(e,t)=>{var n;const i=t.load("jupyterlab");e.commands.addCommand(ve.print,{label:i.__("Print…"),isEnabled:()=>{const t=e.shell.currentWidget;return s.Printing.getPrintFunction(t)!==null},execute:async()=>{const t=e.shell.currentWidget;const n=s.Printing.getPrintFunction(t);if(n){await n()}}});(n=e.shell.currentChanged)===null||n===void 0?void 0:n.connect((()=>{e.commands.notifyCommandChanged(ve.print)}))}};const xe={id:"@jupyterlab/apputils-extension:toggle-header",description:"Adds a command to display the main area widget content header.",autoStart:true,requires:[l.ITranslator],optional:[s.ICommandPalette],activate:(e,t,n)=>{var i;const o=t.load("jupyterlab");const r=o.__("Main Area");e.commands.addCommand(ve.toggleHeader,{label:o.__("Show Header Above Content"),isEnabled:()=>e.shell.currentWidget instanceof s.MainAreaWidget&&!e.shell.currentWidget.contentHeader.isDisposed&&e.shell.currentWidget.contentHeader.widgets.length>0,isToggled:()=>{const t=e.shell.currentWidget;return t instanceof s.MainAreaWidget?!t.contentHeader.isHidden:false},execute:async()=>{const t=e.shell.currentWidget;if(t instanceof s.MainAreaWidget){t.contentHeader.setHidden(!t.contentHeader.isHidden)}}});(i=e.shell.currentChanged)===null||i===void 0?void 0:i.connect((()=>{e.commands.notifyCommandChanged(ve.toggleHeader)}));if(n){n.addItem({command:ve.toggleHeader,category:r})}}};async function Se(e,t,n){var i,s;const r=await t.toJSON();let a=(s=(i=r["layout-restorer:data"])===null||i===void 0?void 0:i.main)===null||s===void 0?void 0:s.current;if(a===undefined||!(a.startsWith("notebook")||a.startsWith("editor"))){document.title=`${o.PageConfig.getOption("appName")||"JupyterLab"}${e==="default"?"":` (${e})`}`}else{let t=o.PathExt.basename(decodeURIComponent(window.location.href));t=t.length>15?t.slice(0,12).concat(`…`):t;e=e.length>15?e.slice(0,12).concat(`…`):e;const i=Object.keys(r).filter((e=>e.startsWith("notebook")||e.startsWith("editor"))).length;document.title=`${t}${i>1?` (${i})`:``} - ${e==="default"?n:e}`}}const ke={id:"@jupyterlab/apputils-extension:state",description:"Provides the application state. It is stored per workspaces.",autoStart:true,provides:a.IStateDB,requires:[i.JupyterFrontEnd.IPaths,i.IRouter,l.ITranslator],optional:[s.IWindowResolver],activate:(e,t,n,i,s)=>{const r=i.load("jupyterlab");if(s===null){return new a.StateDB}let l=false;const{commands:d,name:h,serviceManager:p}=e;const{workspaces:m}=p;const g=s.name;const f=new c.PromiseDelegate;const v=new a.StateDB({transform:f.promise});const _=new u.Debouncer((async()=>{const e=g;const t={id:e};const n=await v.toJSON();await m.save(e,{data:n,metadata:t})}));v.changed.connect((()=>void _.invoke()),v);v.changed.connect((()=>Se(g,v,h)));d.addCommand(ve.loadState,{label:r.__("Load state for the current workspace."),execute:async e=>{if(l){return}const{hash:t,path:i,search:s}=e;const r=o.URLExt.queryStringToObject(s||"");const a=typeof r["clone"]==="string"?r["clone"]===""?o.PageConfig.defaultWorkspace:r["clone"]:null;const d=a||g||null;if(d===null){console.error(`${ve.loadState} cannot load null workspace.`);return}try{const e=await m.fetch(d);if(!l){l=true;f.resolve({type:"overwrite",contents:e.data})}}catch({message:c}){console.warn(`Fetching workspace "${g}" failed.`,c);if(!l){l=true;f.resolve({type:"cancel",contents:null})}}if(d===a){delete r["clone"];const e=i+o.URLExt.objectToQueryString(r)+t;const s=_.invoke().then((()=>n.stop));void s.then((()=>{n.navigate(e)}));return s}await _.invoke()}});d.addCommand(ve.reset,{label:r.__("Reset Application State"),execute:async({reload:e})=>{await v.clear();await _.invoke();if(e){n.reload()}}});d.addCommand(ve.resetOnLoad,{label:r.__("Reset state when loading for the workspace."),execute:e=>{const{hash:t,path:i,search:s}=e;const r=o.URLExt.queryStringToObject(s||"");const a="reset"in r;const d="clone"in r;if(!a){return}if(l){return n.reload()}l=true;f.resolve({type:"clear",contents:null});delete r["reset"];const c=i+o.URLExt.objectToQueryString(r)+t;const h=v.clear().then((()=>_.invoke()));if(d){void h.then((()=>{n.navigate(c,{hard:true})}))}else{void h.then((()=>{n.navigate(c)}))}return h}});n.register({command:ve.loadState,pattern:/.?/,rank:30});n.register({command:ve.resetOnLoad,pattern:/(\?reset|\&reset)($|&)/,rank:20});return v}};const je={id:"@jupyterlab/apputils-extension:sessionDialogs",description:"Provides the session context dialogs.",provides:s.ISessionContextDialogs,optional:[l.ITranslator,r.ISettingRegistry],autoStart:true,activate:async(e,t,n)=>new s.SessionContextDialogs({translator:t!==null&&t!==void 0?t:l.nullTranslator,settingRegistry:n!==null&&n!==void 0?n:null})};const Ie={id:"@jupyterlab/apputils-extension:utilityCommands",description:"Adds meta commands to run set of other commands.",requires:[l.ITranslator],optional:[s.ICommandPalette],autoStart:true,activate:(e,t,n)=>{const i=t.load("jupyterlab");const{commands:o}=e;o.addCommand(ve.runFirstEnabled,{label:i.__("Run First Enabled Command"),execute:t=>{const n=t.commands;const i=t.args;const s=Array.isArray(t);for(let o=0;o{var n,i;const s=(n=t.commands)!==null&&n!==void 0?n:[];const o=t.args;const r=Array.isArray(t);const a=(i=t.errorIfNotEnabled)!==null&&i!==void 0?i:false;for(let l=0;l{var n;const i=(n=t.commands)!==null&&n!==void 0?n:[];const s=t.args;const o=Array.isArray(t);return i.some(((t,n)=>e.commands.isEnabled(t,o?s[n]:s)))}});o.addCommand(ve.displayShortcuts,{label:i.__("Show Keyboard Shortcuts…"),caption:i.__("Show relevant keyboard shortcuts for the current active widget"),execute:t=>{var n;const r=e.shell.currentWidget;const a=r===null||r===void 0?void 0:r.node.contains(document.activeElement);if(!a&&r instanceof s.MainAreaWidget){const e=(n=r.content.node)!==null&&n!==void 0?n:r===null||r===void 0?void 0:r.node;e===null||e===void 0?void 0:e.focus()}const l={commands:o,trans:i};return ge(l)}});if(n){const e=i.__("Help");n.addItem({command:ve.displayShortcuts,category:e})}}};const Ee={id:"@jupyterlab/apputils-extension:sanitizer",description:"Provides the HTML sanitizer.",autoStart:true,provides:s.ISanitizer,requires:[r.ISettingRegistry],activate:(e,t)=>{const n=new s.Sanitizer;const i=e=>{const t=e.get("allowedSchemes").composite;const i=e.get("autolink").composite;const s=e.get("allowNamedProperties").composite;if(t){n.setAllowedSchemes(t)}n.setAutolink(i);n.setAllowNamedProperties(s)};t.load("@jupyterlab/apputils-extension:sanitizer").then((e=>{i(e);e.changed.connect(i)})).catch((e=>{console.error(`Failed to load sanitizer settings:`,e)}));return n}};const Te={id:"@jupyterlab/apputils-extension:kernels-settings",description:"Reserves the name for kernel settings.",autoStart:true,requires:[r.ISettingRegistry],activate:(e,t)=>{void t.load(Te.id)}};const Me=[Te,b,K,C,x,N,_e,be,Ce,ye,J,G,Ee,q,$,ke,we,je,Z,ee,xe,te,Ie,le];const De=Me},25313:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(79010);var l=n(3579);var d=n(67996);var c=n(85072);var h=n.n(c);var u=n(97825);var p=n.n(u);var m=n(77659);var g=n.n(m);var f=n(55056);var v=n.n(f);var _=n(10540);var b=n.n(_);var y=n(41113);var w=n.n(y);var C=n(61510);var x={};x.styleTagTransform=w();x.setAttributes=v();x.insert=g().bind(null,"head");x.domAPI=p();x.insertStyleElement=b();var S=h()(C.A,x);const k=C.A&&C.A.locals?C.A.locals:undefined},12253:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Clipboard:()=>M,Collapse:()=>i.Collapser,CommandLinker:()=>L,CommandToolbarButton:()=>i.CommandToolbarButton,CommandToolbarButtonComponent:()=>i.CommandToolbarButtonComponent,DOMUtils:()=>B,Dialog:()=>v,HoverBox:()=>i.HoverBox,ICommandPalette:()=>be,IFrame:()=>i.IFrame,IKernelStatusModel:()=>ye,ILicensesClient:()=>we,ISanitizer:()=>Se,ISessionContextDialogs:()=>Ce,ISplashScreen:()=>ke,IThemeManager:()=>xe,IToolbarWidgetRegistry:()=>Ie,IWindowResolver:()=>je,InputDialog:()=>H,KernelStatus:()=>k,Licenses:()=>Z,MainAreaWidget:()=>ne,MenuFactory:()=>ie,ModalCommandPalette:()=>N,Notification:()=>oe,NotificationManager:()=>se,Printing:()=>ee,ReactWidget:()=>i.ReactWidget,RunningSessions:()=>le,Sanitizer:()=>ue,SemanticCommand:()=>pe,SessionContext:()=>b,SessionContextDialogs:()=>y,Spinner:()=>i.Spinner,Styling:()=>i.Styling,ThemeManager:()=>ve,Toolbar:()=>ze,ToolbarButton:()=>i.ToolbarButton,ToolbarButtonComponent:()=>i.ToolbarButtonComponent,ToolbarWidgetRegistry:()=>Ee,UseSignal:()=>i.UseSignal,VDomModel:()=>i.VDomModel,VDomRenderer:()=>i.VDomRenderer,WidgetTracker:()=>m,WindowResolver:()=>Be,addCommandToolbarButtonClass:()=>i.addCommandToolbarButtonClass,addToolbarButtonClass:()=>i.addToolbarButtonClass,createDefaultFactory:()=>Te,createToolbarFactory:()=>Ne,setToolbar:()=>Oe,showDialog:()=>g,showErrorMessage:()=>f,translateKernelStatuses:()=>x});var i=n(66127);var s=n(61927);var o=n(1143);var r=n(44914);var a=n.n(r);var l=n(37737);var d=n(34236);var c=n(5592);var h=n(2336);var u=n(42856);var p=n(86503);class m{constructor(e){this._currentChanged=new h.Signal(this);this._deferred=null;this._isDisposed=false;this._widgetAdded=new h.Signal(this);this._widgetUpdated=new h.Signal(this);const t=this._focusTracker=new o.FocusTracker;const n=this._pool=new p.RestorablePool(e);this.namespace=e.namespace;t.currentChanged.connect(((e,t)=>{if(t.newValue!==this.currentWidget){n.current=t.newValue}}),this);n.added.connect(((e,t)=>{this._widgetAdded.emit(t)}),this);n.currentChanged.connect(((e,i)=>{if(i===null&&t.currentWidget){n.current=t.currentWidget;return}this.onCurrentChanged(i);this._currentChanged.emit(i)}),this);n.updated.connect(((e,t)=>{this._widgetUpdated.emit(t)}),this)}get currentChanged(){return this._currentChanged}get currentWidget(){return this._pool.current||null}get restored(){if(this._deferred){return Promise.resolve()}else{return this._pool.restored}}get size(){return this._pool.size}get widgetAdded(){return this._widgetAdded}get widgetUpdated(){return this._widgetUpdated}async add(e){this._focusTracker.add(e);await this._pool.add(e);if(!this._focusTracker.activeWidget){this._pool.current=e}}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._pool.dispose();this._focusTracker.dispose();h.Signal.clearData(this)}find(e){return this._pool.find(e)}forEach(e){return this._pool.forEach(e)}filter(e){return this._pool.filter(e)}inject(e){return this._pool.inject(e)}has(e){return this._pool.has(e)}async restore(e){const t=this._deferred;if(t){this._deferred=null;return this._pool.restore(t)}if(e){return this._pool.restore(e)}console.warn("No options provided to restore the tracker.")}defer(e){this._deferred=e}async save(e){return this._pool.save(e)}onCurrentChanged(e){}}function g(e={}){const t=new v(e);return t.launch()}function f(e,t,n){const i=v.translator.load("jupyterlab");n=n!==null&&n!==void 0?n:[v.cancelButton({label:i.__("Close")})];console.warn("Showing error:",t);const s=typeof t==="string"?t:t.message;const o=e+"----"+s;const r=_.errorMessagePromiseCache.get(o);if(r){return r}else{const t=g({title:e,body:s,buttons:n}).then((()=>{_.errorMessagePromiseCache.delete(o)}),(e=>{_.errorMessagePromiseCache.delete(o);throw e}));_.errorMessagePromiseCache.set(o,t);return t}}class v extends o.Widget{constructor(e={}){const t=document.createElement("dialog");t.ariaModal="true";super({node:t});this._hasValidationErrors=false;this._ready=new c.PromiseDelegate;this._focusNodeSelector="";this.addClass("jp-Dialog");this.addClass("jp-ThemedContainer");const n=_.handleOptions(e);const i=n.renderer;this._host=n.host;this._defaultButton=n.defaultButton;this._buttons=n.buttons;this._hasClose=n.hasClose;this._buttonNodes=this._buttons.map((e=>i.createButtonNode(e)));this._checkboxNode=null;this._lastMouseDownInDialog=false;if(n.checkbox){const{label:e="",caption:t="",checked:s=false,className:o=""}=n.checkbox;this._checkboxNode=i.createCheckboxNode({label:e,caption:t!==null&&t!==void 0?t:e,checked:s,className:o})}const s=this.layout=new o.PanelLayout;const r=new o.Panel;r.addClass("jp-Dialog-content");if(typeof e.body==="string"){r.addClass("jp-Dialog-content-small");t.ariaLabel=[n.title,e.body].join(" ")}s.addWidget(r);this._body=n.body;const a=i.createHeader(n.title,(()=>this.reject()),e);const l=i.createBody(n.body);const d=i.createFooter(this._buttonNodes,this._checkboxNode);r.addWidget(a);r.addWidget(l);r.addWidget(d);this._bodyWidget=l;this._primary=this._buttonNodes[this._defaultButton];this._focusNodeSelector=e.focusNodeSelector;void v.tracker.add(this)}get ready(){return this._ready.promise}dispose(){const e=this._promise;if(e){this._promise=null;e.reject(void 0);d.ArrayExt.removeFirstOf(_.launchQueue,e.promise)}super.dispose()}launch(){if(this._promise){return this._promise.promise}const e=this._promise=new c.PromiseDelegate;const t=Promise.all(_.launchQueue);_.launchQueue.push(this._promise.promise);return t.then((()=>{if(!this._promise){return Promise.resolve({button:v.cancelButton(),isChecked:null,value:null})}o.Widget.attach(this,this._host);return e.promise}))}resolve(e){if(!this._promise){return}if(e===undefined){e=this._defaultButton}this._resolve(this._buttons[e])}reject(){if(!this._promise){return}this._resolve(v.cancelButton())}handleEvent(e){switch(e.type){case"keydown":this._evtKeydown(e);break;case"mousedown":this._evtMouseDown(e);break;case"click":this._evtClick(e);break;case"input":this._evtInput(e);break;case"focus":this._evtFocus(e);break;case"contextmenu":e.preventDefault();e.stopPropagation();break;default:break}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,true);t.addEventListener("contextmenu",this,true);t.addEventListener("click",this,true);document.addEventListener("mousedown",this,true);document.addEventListener("focus",this,true);document.addEventListener("input",this,true);this._first=_.findFirstFocusable(this.node);this._original=document.activeElement;const n=()=>{var e;if(this._focusNodeSelector){const e=this.node.querySelector(".jp-Dialog-body");const t=e===null||e===void 0?void 0:e.querySelector(this._focusNodeSelector);if(t){this._primary=t}}(e=this._primary)===null||e===void 0?void 0:e.focus();this._ready.resolve()};if(this._bodyWidget instanceof i.ReactWidget&&this._bodyWidget.renderPromise!==undefined){this._bodyWidget.renderPromise.then((()=>{n()})).catch((()=>{console.error("Error while loading Dialog's body")}))}else{n()}}onAfterDetach(e){const t=this.node;t.removeEventListener("keydown",this,true);t.removeEventListener("contextmenu",this,true);t.removeEventListener("click",this,true);document.removeEventListener("focus",this,true);document.removeEventListener("mousedown",this,true);document.removeEventListener("input",this,true);this._original.focus()}onCloseRequest(e){if(this._promise){this.reject()}super.onCloseRequest(e)}_evtInput(e){this._hasValidationErrors=!!this.node.querySelector(":invalid");for(let t=0;t{e.dispose()}))}e.flush=d;class c{createHeader(t,n=()=>{},s={}){let o;const a=e=>{if(e.button===0){e.preventDefault();n()}};const l=e=>{const{key:t}=e;if(t==="Enter"||t===" "){n()}};if(typeof t==="string"){const n=e.translator.load("jupyterlab");o=i.ReactWidget.create(r.createElement(r.Fragment,null,t,s.hasClose&&r.createElement(i.Button,{className:"jp-Dialog-close-button",onMouseDown:a,onKeyDown:l,title:n.__("Cancel"),minimal:true},r.createElement(i.LabIcon.resolveReact,{icon:i.closeIcon,tag:"span"}))))}else{o=i.ReactWidget.create(t)}o.addClass("jp-Dialog-header");i.Styling.styleNode(o.node);return o}createBody(e){const t=e=>{if(e.renderPromise!==undefined){e.renderPromise.then((()=>{i.Styling.styleNode(e.node)})).catch((()=>{console.error("Error while loading Dialog's body")}))}else{i.Styling.styleNode(e.node)}};let n;if(typeof e==="string"){n=new o.Widget({node:document.createElement("span")});n.node.textContent=e}else if(e instanceof o.Widget){n=e;if(n instanceof i.ReactWidget){t(n)}else{i.Styling.styleNode(n.node)}}else{n=i.ReactWidget.create(e);u.MessageLoop.sendMessage(n,o.Widget.Msg.UpdateRequest);t(n)}n.addClass("jp-Dialog-body");return n}createFooter(e,t){const n=new o.Widget;n.addClass("jp-Dialog-footer");if(t){n.node.appendChild(t);n.node.insertAdjacentHTML("beforeend",'')}const s=document.createElement("div");for(const i of e){s.appendChild(i)}n.node.appendChild(s);i.Styling.styleNode(n.node);return n}createButtonNode(e){const t=document.createElement("button");t.className=this.createItemClass(e);t.appendChild(this.renderIcon(e));t.appendChild(this.renderLabel(e));return t}createCheckboxNode(e){const t=document.createElement("label");t.className="jp-Dialog-checkbox";if(e.className){t.classList.add(e.className)}t.title=e.caption;t.textContent=e.label;const n=document.createElement("input");n.type="checkbox";n.checked=!!e.checked;t.insertAdjacentElement("afterbegin",n);return t}createItemClass(e){let t="jp-Dialog-button";if(e.accept){t+=" jp-mod-accept"}else{t+=" jp-mod-reject"}if(e.displayType==="warn"){t+=" jp-mod-warn"}const n=e.className;if(n){t+=` ${n}`}return t}renderIcon(e){const t=document.createElement("div");t.className=this.createIconClass(e);t.appendChild(document.createTextNode(e.iconLabel));return t}createIconClass(e){const t="jp-Dialog-buttonIcon";const n=e.iconClass;return n?`${t} ${n}`:t}renderLabel(e){const t=document.createElement("div");t.className="jp-Dialog-buttonLabel";t.title=e.caption;t.ariaLabel=e.ariaLabel;t.appendChild(document.createTextNode(e.label));return t}}e.Renderer=c;e.defaultRenderer=new c;e.tracker=new m({namespace:"@jupyterlab/apputils:Dialog"})})(v||(v={}));var _;(function(e){e.launchQueue=[];e.errorMessagePromiseCache=new Map;function t(e={}){var t,n,i,s,o,r,a,l,d;const c=(t=e.buttons)!==null&&t!==void 0?t:[v.cancelButton(),v.okButton()];return{title:(n=e.title)!==null&&n!==void 0?n:"",body:(i=e.body)!==null&&i!==void 0?i:"",host:(s=e.host)!==null&&s!==void 0?s:document.body,checkbox:(o=e.checkbox)!==null&&o!==void 0?o:null,buttons:c,defaultButton:(r=e.defaultButton)!==null&&r!==void 0?r:c.length-1,renderer:(a=e.renderer)!==null&&a!==void 0?a:v.defaultRenderer,focusNodeSelector:(l=e.focusNodeSelector)!==null&&l!==void 0?l:"",hasClose:(d=e.hasClose)!==null&&d!==void 0?d:true}}e.handleOptions=t;function n(e){const t=["input","select","a[href]","textarea","button","[tabindex]"].join(",");return e.querySelectorAll(t)[0]}e.findFirstFocusable=n})(_||(_={}));class b{constructor(e){var t,n,i,o;this._path="";this._name="";this._type="";this._prevKernelName="";this._isDisposed=false;this._disposed=new h.Signal(this);this._session=null;this._ready=new c.PromiseDelegate;this._initializing=false;this._initStarted=new c.PromiseDelegate;this._initPromise=new c.PromiseDelegate;this._isReady=false;this._isTerminating=false;this._isRestarting=false;this._kernelChanged=new h.Signal(this);this._preferenceChanged=new h.Signal(this);this._sessionChanged=new h.Signal(this);this._statusChanged=new h.Signal(this);this._connectionStatusChanged=new h.Signal(this);this._pendingInput=false;this._iopubMessage=new h.Signal(this);this._unhandledMessage=new h.Signal(this);this._propertyChanged=new h.Signal(this);this._dialog=null;this._busyDisposable=null;this._pendingKernelName="";this._pendingSessionRequest="";this.kernelManager=e.kernelManager;this.sessionManager=e.sessionManager;this.specsManager=e.specsManager;this.translator=e.translator||s.nullTranslator;this._trans=this.translator.load("jupyterlab");this._path=(t=e.path)!==null&&t!==void 0?t:c.UUID.uuid4();this._type=(n=e.type)!==null&&n!==void 0?n:"";this._name=(i=e.name)!==null&&i!==void 0?i:"";this._setBusy=e.setBusy;this._kernelPreference=(o=e.kernelPreference)!==null&&o!==void 0?o:{}}get session(){var e;return(e=this._session)!==null&&e!==void 0?e:null}get path(){return this._path}get type(){return this._type}get name(){return this._name}get kernelChanged(){return this._kernelChanged}get sessionChanged(){return this._sessionChanged}get statusChanged(){return this._statusChanged}get pendingInput(){return this._pendingInput}get connectionStatusChanged(){return this._connectionStatusChanged}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get propertyChanged(){return this._propertyChanged}get kernelPreference(){return this._kernelPreference}set kernelPreference(e){if(!c.JSONExt.deepEqual(e,this._kernelPreference)){const t=this._kernelPreference;this._kernelPreference=e;this._preferenceChanged.emit({name:"kernelPreference",oldValue:t,newValue:c.JSONExt.deepCopy(e)})}}get kernelPreferenceChanged(){return this._preferenceChanged}get isReady(){return this._isReady}get ready(){return this._ready.promise}get isTerminating(){return this._isTerminating}get isRestarting(){return this._isRestarting}get hasNoKernel(){return this.kernelDisplayName===this.noKernelName}get kernelDisplayName(){var e,t,n,i,s,o,r;const a=(e=this.session)===null||e===void 0?void 0:e.kernel;if(this._pendingKernelName===this.noKernelName){return this.noKernelName}if(this._pendingKernelName){return(i=(n=(t=this.specsManager.specs)===null||t===void 0?void 0:t.kernelspecs[this._pendingKernelName])===null||n===void 0?void 0:n.display_name)!==null&&i!==void 0?i:this._pendingKernelName}if(!a){return this.noKernelName}return(r=(o=(s=this.specsManager.specs)===null||s===void 0?void 0:s.kernelspecs[a.name])===null||o===void 0?void 0:o.display_name)!==null&&r!==void 0?r:a.name}get kernelDisplayStatus(){var e,t;const n=(e=this.session)===null||e===void 0?void 0:e.kernel;if(this._isTerminating){return"terminating"}if(this._isRestarting){return"restarting"}if(this._pendingKernelName===this.noKernelName){return"unknown"}if(!n&&this._pendingKernelName){return"initializing"}if(!n&&!this.isReady&&this.kernelPreference.canStart!==false&&this.kernelPreference.shouldStart!==false){return"initializing"}return(t=(n===null||n===void 0?void 0:n.connectionStatus)==="connected"?n===null||n===void 0?void 0:n.status:n===null||n===void 0?void 0:n.connectionStatus)!==null&&t!==void 0?t:"unknown"}get prevKernelName(){return this._prevKernelName}get isDisposed(){return this._isDisposed}get disposed(){return this._disposed}get noKernelName(){return this._trans.__("No Kernel")}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._disposed.emit();if(this._session){if(this.kernelPreference.shutdownOnDispose){this.sessionManager.shutdown(this._session.id).catch((e=>{console.error(`Kernel not shut down ${e}`)}))}this._session.dispose();this._session=null}if(this._dialog){this._dialog.dispose()}if(this._busyDisposable){this._busyDisposable.dispose();this._busyDisposable=null}h.Signal.clearData(this)}async startKernel(){const e=this.kernelPreference;if(!e.autoStartDefault&&e.shouldStart===false){return true}let t;if(e.id){t={id:e.id}}else{const n=w.getDefaultKernel({specs:this.specsManager.specs,sessions:this.sessionManager.running(),preference:e});if(n){t={name:n}}}if(t){try{await this._changeKernel(t);return false}catch(n){}}return true}async restartKernel(){var e,t,n,i,s,o;const r=((e=this.session)===null||e===void 0?void 0:e.kernel)||null;if(this._isRestarting){return}this._isRestarting=true;this._isReady=false;this._statusChanged.emit("restarting");try{await((n=(t=this.session)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.restart());this._isReady=true}catch(a){console.error(a)}this._isRestarting=false;this._statusChanged.emit(((s=(i=this.session)===null||i===void 0?void 0:i.kernel)===null||s===void 0?void 0:s.status)||"unknown");this._kernelChanged.emit({name:"kernel",oldValue:r,newValue:((o=this.session)===null||o===void 0?void 0:o.kernel)||null})}async changeKernel(e={}){if(this.isDisposed){throw new Error("Disposed")}await this._initStarted.promise;return this._changeKernel(e)}async shutdown(){if(this.isDisposed||!this._initializing){return}await this._initStarted.promise;this._pendingSessionRequest="";this._pendingKernelName=this.noKernelName;return this._shutdownSession()}async initialize(){if(this._initializing){return this._initPromise.promise}this._initializing=true;const e=await this._initialize();if(!e){this._isReady=true;this._ready.resolve(undefined)}if(!this._pendingSessionRequest){this._initStarted.resolve(void 0)}this._initPromise.resolve(e);return e}async _initialize(){const e=this.sessionManager;await e.ready;await e.refreshRunning();const t=(0,d.find)(e.running(),(e=>e.path===this._path));if(t){try{const n=e.connectTo({model:t});this._handleNewSession(n)}catch(n){void this._handleSessionError(n);return Promise.reject(n)}}return await this._startIfNecessary()}async _shutdownSession(){var e;const t=this._session;const n=this._isTerminating;const i=this._isReady;this._isTerminating=true;this._isReady=false;this._statusChanged.emit("terminating");try{await(t===null||t===void 0?void 0:t.shutdown());this._isTerminating=false;t===null||t===void 0?void 0:t.dispose();this._session=null;const e=(t===null||t===void 0?void 0:t.kernel)||null;this._statusChanged.emit("unknown");this._kernelChanged.emit({name:"kernel",oldValue:e,newValue:null});this._sessionChanged.emit({name:"session",oldValue:t,newValue:null})}catch(s){this._isTerminating=n;this._isReady=i;const o=(e=t===null||t===void 0?void 0:t.kernel)===null||e===void 0?void 0:e.status;if(o===undefined){this._statusChanged.emit("unknown")}else{this._statusChanged.emit(o)}throw s}return}async _startIfNecessary(){var e;const t=this.kernelPreference;if(this.isDisposed||((e=this.session)===null||e===void 0?void 0:e.kernel)||t.shouldStart===false||t.canStart===false){return false}return this.startKernel()}async _changeKernel(e={}){if(e.name){this._pendingKernelName=e.name}if(!this._session){this._kernelChanged.emit({name:"kernel",oldValue:null,newValue:null})}if(!this._pendingSessionRequest){this._initStarted.resolve(void 0)}if(this._session&&!this._isTerminating){try{await this._session.changeKernel(e);return this._session.kernel}catch(i){void this._handleSessionError(i);throw i}}const t=l.PathExt.dirname(this._path);const n=this._pendingSessionRequest=l.PathExt.join(t,c.UUID.uuid4());try{this._statusChanged.emit("starting");const t=await this.sessionManager.startNew({path:n,type:this._type,name:this._name,kernel:e});if(this._pendingSessionRequest!==t.path){await t.shutdown();t.dispose();return null}await t.setPath(this._path);await t.setName(this._name);if(this._session&&!this._isTerminating){await this._shutdownSession()}return this._handleNewSession(t)}catch(i){void this._handleSessionError(i);throw i}}_handleNewSession(e){var t,n,i;if(this.isDisposed){throw Error("Disposed")}if(!this._isReady){this._isReady=true;this._ready.resolve(undefined)}if(this._session){this._session.dispose()}this._session=e;this._pendingKernelName="";if(e){this._prevKernelName=(n=(t=e.kernel)===null||t===void 0?void 0:t.name)!==null&&n!==void 0?n:"";e.disposed.connect(this._onSessionDisposed,this);e.propertyChanged.connect(this._onPropertyChanged,this);e.kernelChanged.connect(this._onKernelChanged,this);e.statusChanged.connect(this._onStatusChanged,this);e.connectionStatusChanged.connect(this._onConnectionStatusChanged,this);e.pendingInput.connect(this._onPendingInput,this);e.iopubMessage.connect(this._onIopubMessage,this);e.unhandledMessage.connect(this._onUnhandledMessage,this);if(e.path!==this._path){this._onPropertyChanged(e,"path")}if(e.name!==this._name){this._onPropertyChanged(e,"name")}if(e.type!==this._type){this._onPropertyChanged(e,"type")}}this._sessionChanged.emit({name:"session",oldValue:null,newValue:e});this._kernelChanged.emit({oldValue:null,newValue:(e===null||e===void 0?void 0:e.kernel)||null,name:"kernel"});this._statusChanged.emit(((i=e===null||e===void 0?void 0:e.kernel)===null||i===void 0?void 0:i.status)||"unknown");return(e===null||e===void 0?void 0:e.kernel)||null}async _handleSessionError(e){this._handleNewSession(null);let t="";let n="";try{t=e.traceback;n=e.message}catch(e){}await this._displayKernelError(n,t)}async _displayKernelError(e,t){const n=r.createElement("div",null,e&&r.createElement("pre",null,e),t&&r.createElement("details",{className:"jp-mod-wide"},r.createElement("pre",null,t)));const i=this._dialog=new v({title:this._trans.__("Error Starting Kernel"),body:n,buttons:[v.okButton()]});await i.launch();this._dialog=null}_onSessionDisposed(){if(this._session){const e=this._session;this._session=null;const t=this._session;this._sessionChanged.emit({name:"session",oldValue:e,newValue:t})}}_onPropertyChanged(e,t){switch(t){case"path":this._path=e.path;break;case"name":this._name=e.name;break;case"type":this._type=e.type;break;default:throw new Error(`unrecognized property ${t}`)}this._propertyChanged.emit(t)}_onKernelChanged(e,t){this._kernelChanged.emit(t)}_onStatusChanged(e,t){var n;if(t==="dead"){const t=(n=e.kernel)===null||n===void 0?void 0:n.model;if(t===null||t===void 0?void 0:t.reason){const e=t.traceback||"";void this._displayKernelError(t.reason,e)}}if(this._setBusy){if(t==="busy"){if(!this._busyDisposable){this._busyDisposable=this._setBusy()}}else{if(this._busyDisposable){this._busyDisposable.dispose();this._busyDisposable=null}}}this._statusChanged.emit(t)}_onConnectionStatusChanged(e,t){this._connectionStatusChanged.emit(t)}_onPendingInput(e,t){this._pendingInput=t}_onIopubMessage(e,t){if(t.header.msg_type==="shutdown_reply"){this.session.kernel.removeInputGuard()}this._iopubMessage.emit(t)}_onUnhandledMessage(e,t){this._unhandledMessage.emit(t)}}(function(e){function t(e){const{preference:t}=e;const{shouldStart:n}=t;if(n===false){return null}return w.getDefaultKernel(e)}e.getDefaultKernel=t})(b||(b={}));class y{constructor(e={}){var t;this._translator=(t=e.translator)!==null&&t!==void 0?t:s.nullTranslator;this._settingRegistry=e.settingRegistry||null}async selectKernel(e){if(e.isDisposed){return Promise.resolve()}const t=this._translator;const n=t.load("jupyterlab");let i=n.__("Cancel");if(e.hasNoKernel){i=e.kernelDisplayName}const s=[v.cancelButton({label:i}),v.okButton({label:n.__("Select"),ariaLabel:n.__("Select Kernel")})];const o=e.kernelPreference.autoStartDefault;const r=typeof o==="boolean";const a=new v({title:n.__("Select Kernel"),body:w.createKernelSelector(e,t),buttons:s,checkbox:r?{label:n.__("Always start the preferred kernel"),caption:n.__("Remember my choice and always start the preferred kernel"),checked:o}:null});const l=await a.launch();if(e.isDisposed||!l.button.accept){return}if(r&&l.isChecked!==null){e.kernelPreference={...e.kernelPreference,autoStartDefault:l.isChecked}}const d=l.value;if(d===null&&!e.hasNoKernel){return e.shutdown()}if(d){await e.changeKernel(d)}}async restart(e){var t,n,i,s,o;const r=this._translator.load("jupyterlab");await e.initialize();if(e.isDisposed){throw new Error("session already disposed")}const a=(t=e.session)===null||t===void 0?void 0:t.kernel;if(!a&&e.prevKernelName){await e.changeKernel({name:e.prevKernelName});return true}if(!a){throw new Error("No kernel to restart")}const l="@jupyterlab/apputils-extension:sessionDialogs";const d=(i=(n=e.kernelPreference)===null||n===void 0?void 0:n.skipKernelRestartDialog)!==null&&i!==void 0?i:false;const c=(o=await((s=this._settingRegistry)===null||s===void 0?void 0:s.get(l,"skipKernelRestartDialog")))===null||o===void 0?void 0:o.composite;if(c||d){await e.restartKernel();return true}const h=v.warnButton({label:r.__("Restart"),ariaLabel:r.__("Confirm Kernel Restart")});const u=await g({title:r.__("Restart Kernel?"),body:r.__("Do you want to restart the kernel of %1? All variables will be lost.",e.name),buttons:[v.cancelButton({ariaLabel:r.__("Cancel Kernel Restart")}),h],checkbox:{label:r.__("Do not ask me again."),caption:r.__("If checked, the kernel will restart without confirmation prompt in the future; you can change this back in the settings.")}});if(a.isDisposed){return false}if(u.button.accept){if(typeof u.isChecked==="boolean"&&u.isChecked==true){e.kernelPreference={...e.kernelPreference,skipKernelRestartDialog:true}}await e.restartKernel();return true}return false}}(function(e){function t(e,t=null){var n,i,o,r,a,d,c;const h={disabled:false,groups:[]};const u=Array.from((i=(n=e.kernelManager)===null||n===void 0?void 0:n.running())!==null&&i!==void 0?i:Array.from(e.sessionManager.running()).filter((e=>!!e.kernel)).map((e=>e.kernel)));const p=Array.from((o=e.sessionManager.running())!==null&&o!==void 0?o:[]).reduce(((e,t)=>{var n;if((n=t.kernel)===null||n===void 0?void 0:n.id)e[t.kernel.id]=t;return e}),{});const m={...e.kernelPreference,id:(a=(r=e.session)===null||r===void 0?void 0:r.kernel)===null||a===void 0?void 0:a.id};const g=!e.hasNoKernel?e.kernelDisplayName:null;const f={default:"",kernelspecs:Object.create(null),...e.specsManager.specs};const v=[];const _=Object.create(null);for(const s in f.kernelspecs){v.push(f.kernelspecs[s]);_[s]=f.kernelspecs[s].language}v.sort(((e,t)=>e.display_name.localeCompare(t.display_name)));t=t||s.nullTranslator;const b=t.load("jupyterlab");const y=m.language||_[m.name]||(m.id?_[(d=p[m.id])===null||d===void 0?void 0:d.name]:"");const w={connectKernel:b.__("Connect to Existing Kernel"),startPreferred:b.__("Start %1 Kernel",y),startOther:b.__("Start Kernel"),connectToPreferred:b.__("Connect to Existing %1 Kernel",y),connectToOther:b.__("Connect to Other Kernel"),noKernel:b.__("No Kernel"),startKernel:b.__("Start Kernel"),useNoKernel:b.__("Use No Kernel")};const C={label:w.useNoKernel,options:[{text:w.noKernel,title:w.noKernel,value:JSON.stringify(null)}]};const x=(e,t,n)=>{const i=n?n.name||l.PathExt.basename(n.path):e.name||b.__("Unknown Kernel");return{text:`${i} (${e.id.split("-")[0]})`,title:(n?`${b.__("Path: %1",n.path)}\n`:``)+`${b.__("Name: %1",i)}\n`+`${b.__("Kernel Name: %1",t!==null&&t!==void 0?t:e.name)}\n`+`${b.__("Kernel Id: %1",e.id)}`,value:JSON.stringify({id:e.id})}};const S=e=>({text:e.display_name,value:JSON.stringify({name:e.name})});if(m.canStart===false){h.disabled=true;h.groups.push(C);return h}if(y){const e={label:w.startPreferred,options:[]};const t={label:w.startOther,options:[]};const n={label:w.connectToPreferred,options:[]};const i={label:w.connectToOther,options:[]};for(const s of v){(s.language===y?e:t).options.push(S(s))}h.groups.push(e);h.groups.push(C);h.groups.push(t);u.map((e=>{var t,n;return{option:x(e,(n=(t=f.kernelspecs[e.name])===null||t===void 0?void 0:t.display_name)!==null&&n!==void 0?n:"",p[e.id]),language:_[e.name]}})).sort(((e,t)=>e.option.text.localeCompare(t.option.text))).forEach((e=>(y===e.language?n:i).options.push(e.option)));if(n.options.length)h.groups.push(n);if(i.options.length)h.groups.push(i)}else{h.groups.push({label:w.startKernel,options:v.map((e=>S(e)))});h.groups.push(C);h.groups.push({label:w.connectKernel,options:u.map((e=>{var t,n;return x(e,(n=(t=f.kernelspecs[e.name])===null||t===void 0?void 0:t.display_name)!==null&&n!==void 0?n:"",p[e.id])})).sort(((e,t)=>e.text.localeCompare(t.text)))})}if(m.id||g||m.name){for(const e of h.groups){for(const t of e.options){const e=JSON.parse(t.value);if(!e)continue;if(m.id){if(m.id===e.id){t.selected=true;return h}continue}if(g){if(g===((c=f.kernelspecs[e.name])===null||c===void 0?void 0:c.display_name)){t.selected=true;return h}continue}if(m.name){if(m.name===e.name){t.selected=true;return h}continue}}}}return h}e.kernelOptions=t})(y||(y={}));var w;(function(e){e.createKernelSelector=(e,i)=>new t({node:n(e,i)});class t extends o.Widget{getValue(){const e=this.node.querySelector("select");return JSON.parse(e.value)}}function n(e,t){t=t||s.nullTranslator;const n=t.load("jupyterlab");const i=document.createElement("div");const o=document.createElement("label");o.textContent=`${n.__("Select kernel for:")} "${e.name}"`;i.appendChild(o);const r=document.createElement("select");const a=y.kernelOptions(e,t);if(a.disabled)r.disabled=true;for(const s of a.groups){const{label:e,options:t}=s;const n=document.createElement("optgroup");n.label=e;for(const{selected:i,text:s,title:o,value:r}of t){const e=document.createElement("option");if(i)e.selected=true;if(o)e.title=o;e.text=s;e.value=r;n.appendChild(e)}r.appendChild(n)}i.appendChild(r);return i}function i(e){var t;const{specs:n,preference:i}=e;const{name:s,language:o,canStart:r,autoStartDefault:a}=i;if(!n||r===false){return null}const l=a?n.default:null;if(!s&&!o){return l}for(const c in n.kernelspecs){if(c===s){return s}}if(!o){return l}const d=[];for(const c in n.kernelspecs){const e=(t=n.kernelspecs[c])===null||t===void 0?void 0:t.language;if(o===e){d.push(c)}}if(d.length===1){const e=d[0];console.warn("No exact match found for "+e+", using kernel "+e+" that matches "+"language="+o);return e}return l}e.getDefaultKernel=i})(w||(w={}));var C=n(66987);function x(e){e=e||s.nullTranslator;const t=e.load("jupyterlab");const n={unknown:t.__("Unknown"),starting:t.__("Starting"),idle:t.__("Idle"),busy:t.__("Busy"),terminating:t.__("Terminating"),restarting:t.__("Restarting"),autorestarting:t.__("Autorestarting"),dead:t.__("Dead"),connected:t.__("Connected"),connecting:t.__("Connecting"),disconnected:t.__("Disconnected"),initializing:t.__("Initializing"),"":""};return n}function S(e){const t=e.translator||s.nullTranslator;const n=t.load("jupyterlab");let i="";if(e.status){i=` | ${e.status}`}return a().createElement(C.TextItem,{role:"button","aria-haspopup":true,onClick:e.handleClick,onKeyDown:e.handleKeyDown,source:`${e.kernelName}${i}`,title:n.__("Change kernel for %1",e.activityName),tabIndex:0})}class k extends i.VDomRenderer{constructor(e,t){super(new k.Model(t));this.translator=t||s.nullTranslator;this._handleClick=e.onClick;this._handleKeyDown=e.onKeyDown;this.addClass("jp-mod-highlighted")}render(){if(this.model===null){return null}else{return a().createElement(S,{status:this.model.status,kernelName:this.model.kernelName,activityName:this.model.activityName,handleClick:this._handleClick,handleKeyDown:this._handleKeyDown,translator:this.translator})}}}(function(e){class t extends i.VDomModel{constructor(e){super();this._activityName="";this._kernelName="";this._kernelStatus="";this._sessionContext=null;e=e!==null&&e!==void 0?e:s.nullTranslator;this._trans=e.load("jupyterlab");this._statusNames=x(e)}get kernelName(){return this._kernelName}get status(){return this._kernelStatus?this._statusNames[this._kernelStatus]:undefined}get activityName(){return this._activityName}set activityName(e){const t=this._activityName;if(t===e){return}this._activityName=e;this.stateChanged.emit()}get sessionContext(){return this._sessionContext}set sessionContext(e){var t,n,i,s;(t=this._sessionContext)===null||t===void 0?void 0:t.statusChanged.disconnect(this._onKernelStatusChanged,this);(n=this._sessionContext)===null||n===void 0?void 0:n.connectionStatusChanged.disconnect(this._onKernelStatusChanged,this);(i=this._sessionContext)===null||i===void 0?void 0:i.kernelChanged.disconnect(this._onKernelChanged,this);const o=this._getAllState();this._sessionContext=e;this._kernelStatus=e===null||e===void 0?void 0:e.kernelDisplayStatus;this._kernelName=(s=e===null||e===void 0?void 0:e.kernelDisplayName)!==null&&s!==void 0?s:this._trans.__("No Kernel");e===null||e===void 0?void 0:e.statusChanged.connect(this._onKernelStatusChanged,this);e===null||e===void 0?void 0:e.connectionStatusChanged.connect(this._onKernelStatusChanged,this);e===null||e===void 0?void 0:e.kernelChanged.connect(this._onKernelChanged,this);this._triggerChange(o,this._getAllState())}_onKernelStatusChanged(){var e;this._kernelStatus=(e=this._sessionContext)===null||e===void 0?void 0:e.kernelDisplayStatus;this.stateChanged.emit(void 0)}_onKernelChanged(e,t){var n;const i=this._getAllState();this._kernelStatus=(n=this._sessionContext)===null||n===void 0?void 0:n.kernelDisplayStatus;this._kernelName=e.kernelDisplayName;this._triggerChange(i,this._getAllState())}_getAllState(){return[this._kernelName,this._kernelStatus,this._activityName]}_triggerChange(e,t){if(c.JSONExt.deepEqual(e,t)){this.stateChanged.emit(void 0)}}}e.Model=t})(k||(k={}));const j="jp-Toolbar-kernelName";const I="jp-Toolbar-kernelStatus";var E;(function(e){function t(e,t){t=t||s.nullTranslator;const n=t.load("jupyterlab");return new i.ToolbarButton({icon:i.stopIcon,onClick:()=>{var t,n;void((n=(t=e.session)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.interrupt())},tooltip:n.__("Interrupt the kernel")})}e.createInterruptButton=t;function n(e,t,n){n=n!==null&&n!==void 0?n:s.nullTranslator;const o=n.load("jupyterlab");return new i.ToolbarButton({icon:i.refreshIcon,onClick:()=>{void(t!==null&&t!==void 0?t:new y({translator:n})).restart(e)},tooltip:o.__("Restart the kernel")})}e.createRestartButton=n;function o(e,t,n){const s=i.ReactWidget.create(r.createElement(T.KernelNameComponent,{sessionContext:e,dialogs:t!==null&&t!==void 0?t:new y({translator:n}),translator:n}));s.addClass("jp-KernelName");return s}e.createKernelNameItem=o;function a(e,t){return new T.KernelStatus(e,t)}e.createKernelStatusItem=a})(E||(E={}));var T;(function(e){function t(e){const t=e.translator||s.nullTranslator;const n=t.load("jupyterlab");const o=()=>{void e.dialogs.selectKernel(e.sessionContext)};return r.createElement(i.UseSignal,{signal:e.sessionContext.kernelChanged,initialSender:e.sessionContext},(e=>r.createElement(i.ToolbarButtonComponent,{className:j,onClick:o,tooltip:n.__("Switch kernel"),label:e===null||e===void 0?void 0:e.kernelDisplayName})))}e.KernelNameComponent=t;class n extends o.Widget{constructor(e,t){super();this.translator=t||s.nullTranslator;this._trans=this.translator.load("jupyterlab");this.addClass(I);this._statusNames=x(this.translator);this._onStatusChanged(e);e.statusChanged.connect(this._onStatusChanged,this);e.connectionStatusChanged.connect(this._onStatusChanged,this)}_onStatusChanged(e){if(this.isDisposed){return}const t=e.kernelDisplayStatus;const n={container:this.node,title:this._trans.__("Kernel %1",this._statusNames[t]||t),stylesheet:"toolbarButton",alignSelf:"normal",height:"24px"};i.LabIcon.remove(this.node);if(t==="busy"||t==="starting"||t==="terminating"||t==="restarting"||t==="initializing"){i.circleIcon.element(n)}else if(t==="connecting"||t==="disconnected"||t==="unknown"){i.offlineBoltIcon.element(n)}else{i.circleEmptyIcon.element(n)}}}e.KernelStatus=n})(T||(T={}));var M;(function(e){function t(){return D.instance}e.getInstance=t;function n(e){D.instance=e}e.setInstance=n;function i(e){const t=document.body;const n=i=>{const s=i.clipboardData||window.clipboardData;if(typeof e==="string"){s.setData("text",e)}else{e.types().map((t=>{s.setData(t,e.getData(t))}))}i.preventDefault();t.removeEventListener("copy",n)};t.addEventListener("copy",n);s(t)}e.copyToSystem=i;function s(e,t="copy"){let n=window.getSelection();const i=[];for(let o=0,r=(n===null||n===void 0?void 0:n.rangeCount)||0;o{if(this.isAttached&&this.isVisible){this.hideAndReset()}}));this.node.tabIndex=0}get palette(){return this._commandPalette}set palette(e){this._commandPalette=e;if(!this.searchIconGroup){this._commandPalette.inputNode.insertAdjacentElement("afterend",this.createSearchIconGroup())}this.addWidget(e);this.hideAndReset()}attach(){o.Widget.attach(this,document.body)}detach(){o.Widget.detach(this)}hideAndReset(){this.hide();this._commandPalette.inputNode.value="";this._commandPalette.refresh()}handleEvent(e){switch(e.type){case"keydown":this._evtKeydown(e);break;case"blur":{if(this.node.contains(e.target)&&!this.node.contains(e.relatedTarget)){e.stopPropagation();this.hideAndReset()}break}case"contextmenu":e.preventDefault();e.stopPropagation();break;default:break}}get searchIconGroup(){return this._commandPalette.node.getElementsByClassName(R)[0]}createSearchIconGroup(){const e=document.createElement("div");e.classList.add(R);i.searchIcon.render(e);return e}onAfterAttach(e){this.node.addEventListener("keydown",this,true);this.node.addEventListener("contextmenu",this,true)}onAfterDetach(e){this.node.removeEventListener("keydown",this,true);this.node.removeEventListener("contextmenu",this,true)}onBeforeHide(e){document.removeEventListener("blur",this,true)}onAfterShow(e){document.addEventListener("blur",this,true)}onActivateRequest(e){if(this.isAttached){this.show();this._commandPalette.activate()}}_evtKeydown(e){switch(e.keyCode){case 27:e.stopPropagation();e.preventDefault();this.hideAndReset();break;default:break}}}var O=n(76326);var B;(function(e){function t(e,t,n){return d.ArrayExt.findFirstIndex(e,(e=>O.ElementExt.hitTest(e,t,n)))}e.hitTestNodes=t;function n(e,t){return e.querySelector(`.${t}`)}e.findElement=n;function i(e,t){return e.getElementsByClassName(t)}e.findElements=i;function s(){return`id-${c.UUID.uuid4()}`}e.createDomID=s;function o(e,t=document){const n=t.activeElement;return!!(n&&e.contains(n)&&(n.matches(":read-write")||n.shadowRoot&&o(n.shadowRoot,n.shadowRoot)))}e.hasActiveEditableElement=o})(B||(B={}));const F="jp-Input-Dialog";const z="jp-Input-Boolean-Dialog";var H;(function(e){function t(e){return g({...e,body:new V(e),buttons:[v.cancelButton({label:e.cancelLabel}),v.okButton({label:e.okLabel})],focusNodeSelector:"input"})}e.getBoolean=t;function n(e){return g({...e,body:new U(e),buttons:[v.cancelButton({label:e.cancelLabel}),v.okButton({label:e.okLabel})],focusNodeSelector:"input"})}e.getNumber=n;function i(e){return g({...e,body:new J(e),buttons:[v.cancelButton({label:e.cancelLabel}),v.okButton({label:e.okLabel})],focusNodeSelector:e.editable?"input":"select"})}e.getItem=i;function s(e){return g({...e,body:new G(e),buttons:[v.cancelButton({label:e.cancelLabel}),v.okButton({label:e.okLabel})]})}e.getMultipleItems=s;function o(e){return g({...e,body:new $(e),buttons:[v.cancelButton({label:e.cancelLabel}),v.okButton({label:e.okLabel})],focusNodeSelector:"input"})}e.getText=o;function r(e){return g({...e,body:new K(e),buttons:[v.cancelButton({label:e.cancelLabel}),v.okButton({label:e.okLabel})],focusNodeSelector:"input"})}e.getPassword=r})(H||(H={}));class W extends o.Widget{constructor(e){super();this.addClass(F);this._input=document.createElement("input");this._input.classList.add("jp-mod-styled");this._input.id="jp-dialog-input-id";if(e.label!==undefined){const t=document.createElement("label");t.textContent=e.label;t.htmlFor=this._input.id;this.node.appendChild(t)}const t=document.createElement("div");t.className="jp-InputDialog-inputWrapper";if(e.prefix){const n=document.createElement("span");n.className="jp-InputDialog-inputPrefix";n.textContent=e.prefix;n.ariaHidden="true";t.appendChild(n)}t.appendChild(this._input);if(e.suffix){const n=document.createElement("span");n.className="jp-InputDialog-inputSuffix";n.textContent=e.suffix;n.ariaHidden="true";t.appendChild(n)}this.node.appendChild(t)}}class V extends W{constructor(e){super(e);this.addClass(z);this._input.type="checkbox";this._input.checked=e.value?true:false}getValue(){return this._input.checked}}class U extends W{constructor(e){super(e);this._input.type="number";this._input.value=e.value?e.value.toString():"0"}getValue(){if(this._input.value){return Number(this._input.value)}else{return Number.NaN}}}class q extends W{constructor(e){super(e);this._input.value=e.text?e.text:"";if(e.placeholder){this._input.placeholder=e.placeholder}if(e.pattern){this._input.pattern=e.pattern}if(e.required){this._input.required=e.required}}getValue(){return this._input.value}}class $ extends q{constructor(e){var t;super(e);this._input.type="text";this._initialSelectionRange=Math.min(this._input.value.length,Math.max(0,(t=e.selectionRange)!==null&&t!==void 0?t:this._input.value.length))}onAfterAttach(e){super.onAfterAttach(e);if(this._initialSelectionRange>0&&this._input.value){this._input.setSelectionRange(0,this._initialSelectionRange)}}}class K extends q{constructor(e){super(e);this._input.type="password"}onAfterAttach(e){super.onAfterAttach(e);if(this._input.value){this._input.select()}}}class J extends W{constructor(e){super(e);this._editable=e.editable||false;let t=e.current||0;let n;if(typeof t==="number"){n=Math.max(0,Math.min(t,e.items.length-1));t=""}this._list=document.createElement("select");e.items.forEach(((e,i)=>{const s=document.createElement("option");if(i===n){s.selected=true;t=e}s.value=e;s.textContent=e;this._list.appendChild(s)}));if(e.editable){const n=document.createElement("datalist");n.id="input-dialog-items";n.appendChild(this._list);this._input.type="list";this._input.value=t;this._input.setAttribute("list",n.id);if(e.placeholder){this._input.placeholder=e.placeholder}this.node.appendChild(n)}else{this._input.parentElement.replaceChild(this._list,this._input)}}getValue(){if(this._editable){return this._input.value}else{return this._list.value}}}class G extends W{constructor(e){super(e);let t=e.defaults||[];this._list=document.createElement("select");this._list.setAttribute("multiple","");e.items.forEach((e=>{const t=document.createElement("option");t.value=e;t.textContent=e;this._list.appendChild(t)}));this._input.remove();this.node.appendChild(this._list);const n=this._list.options;for(let i=0;ithis._updateBundles()));this.model.trackerDataChanged.connect((()=>{this.title.label=this.model.title}))}dispose(){if(this.isDisposed){return}this._bundles.currentChanged.disconnect(this.onBundleSelected,this);this.model.dispose();super.dispose()}initLeftPanel(){this._leftPanel=new o.Panel;this._leftPanel.addClass("jp-Licenses-FormArea");this.addWidget(this._leftPanel);o.SplitPanel.setStretch(this._leftPanel,1)}initFilters(){this._filters=new Z.Filters(this.model);o.SplitPanel.setStretch(this._filters,1);this._leftPanel.addWidget(this._filters)}initBundles(){this._bundles=new o.TabBar({orientation:"vertical",renderer:new Z.BundleTabRenderer(this.model)});this._bundles.addClass("jp-Licenses-Bundles");o.SplitPanel.setStretch(this._bundles,1);this._leftPanel.addWidget(this._bundles);this._bundles.currentChanged.connect(this.onBundleSelected,this);this.model.stateChanged.connect((()=>this._bundles.update()))}initGrid(){this._grid=new Z.Grid(this.model);o.SplitPanel.setStretch(this._grid,1);this.addWidget(this._grid)}initLicenseText(){this._licenseText=new Z.FullText(this.model);o.SplitPanel.setStretch(this._grid,1);this.addWidget(this._licenseText)}onBundleSelected(){var e;if((e=this._bundles.currentTitle)===null||e===void 0?void 0:e.label){this.model.currentBundleName=this._bundles.currentTitle.label}}_updateBundles(){this._bundles.clearTabs();let e=0;const{currentBundleName:t}=this.model;let n=0;for(const i of this.model.bundleNames){const s=new o.Widget;s.title.label=i;if(i===t){n=e}this._bundles.insertTab(++e,s.title)}this._bundles.currentIndex=n}}(function(e){e.REPORT_FORMATS={markdown:{id:"markdown",title:"Markdown",icon:i.markdownIcon},csv:{id:"csv",title:"CSV",icon:i.spreadsheetIcon},json:{id:"json",title:"JSON",icon:i.jsonIcon}};e.DEFAULT_FORMAT="markdown";class t{constructor(e={}){var t;this._licensesUrl=e.licensesUrl||"";this._serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:Y.ServerConnection.makeSettings()}async download(e){const t=`${this._licensesUrl}?format=${e.format}&download=1`;const n=document.createElement("a");n.href=t;n.download="";document.body.appendChild(n);n.click();document.body.removeChild(n);URL.revokeObjectURL(t);return void 0}async getBundles(){const e=await Y.ServerConnection.makeRequest(this._licensesUrl,{},this._serverSettings);return e.json()}}e.LicensesClient=t;class n extends i.VDomModel{constructor(e){super();this._selectedPackageChanged=new h.Signal(this);this._trackerDataChanged=new h.Signal(this);this._currentPackageIndex=0;this._licensesReady=new c.PromiseDelegate;this._packageFilter={};this._trans=e.trans;this._client=e.client;if(e.currentBundleName){this._currentBundleName=e.currentBundleName}if(e.packageFilter){this._packageFilter=e.packageFilter}if(e.currentPackageIndex){this._currentPackageIndex=e.currentPackageIndex}}async initLicenses(){try{this._serverResponse=await this._client.getBundles();this._licensesReady.resolve();this.stateChanged.emit(void 0)}catch(e){this._licensesReady.reject(e)}}async download(e){return this._client.download(e)}get selectedPackageChanged(){return this._selectedPackageChanged}get trackerDataChanged(){return this._trackerDataChanged}get bundleNames(){var e;return Object.keys(((e=this._serverResponse)===null||e===void 0?void 0:e.bundles)||{})}get currentBundleName(){if(this._currentBundleName){return this._currentBundleName}if(this.bundleNames.length){return this.bundleNames[0]}return null}set currentBundleName(e){if(this._currentBundleName!==e){this._currentBundleName=e;this.stateChanged.emit(void 0);this._trackerDataChanged.emit(void 0)}}get licensesReady(){return this._licensesReady.promise}get bundles(){var e;return((e=this._serverResponse)===null||e===void 0?void 0:e.bundles)||{}}get currentPackageIndex(){return this._currentPackageIndex}set currentPackageIndex(e){if(this._currentPackageIndex===e){return}this._currentPackageIndex=e;this._selectedPackageChanged.emit(void 0);this.stateChanged.emit(void 0);this._trackerDataChanged.emit(void 0)}get currentPackage(){var e;if(this.currentBundleName&&this.bundles&&this._currentPackageIndex!=null){return this.getFilteredPackages(((e=this.bundles[this.currentBundleName])===null||e===void 0?void 0:e.packages)||[])[this._currentPackageIndex]}return null}get trans(){return this._trans}get title(){return`${this._currentBundleName||""} ${this._trans.__("Licenses")}`.trim()}get packageFilter(){return this._packageFilter}set packageFilter(e){this._packageFilter=e;this.stateChanged.emit(void 0);this._trackerDataChanged.emit(void 0)}getFilteredPackages(e){let t=[];let n=Object.entries(this._packageFilter).filter((([e,t])=>t&&`${t}`.trim().length)).map((([e,t])=>[e,`${t}`.toLowerCase().trim().split(" ")]));for(const i of e){let e=0;for(const[t,s]of n){let n=0;let o=`${i[t]}`.toLowerCase();for(const e of s){if(o.includes(e)){n+=1}}if(n){e+=1}}if(e===n.length){t.push(i)}}return Object.values(t)}}e.Model=n;class s extends i.VDomRenderer{constructor(e){super(e);this.renderFilter=e=>{const t=this.model.packageFilter[e]||"";return r.createElement("input",{type:"text",name:e,defaultValue:t,className:"jp-mod-styled",onInput:this.onFilterInput})};this.onFilterInput=e=>{const t=e.currentTarget;const{name:n,value:i}=t;this.model.packageFilter={...this.model.packageFilter,[n]:i}};this.addClass("jp-Licenses-Filters");this.addClass("jp-RenderedHTMLCommon")}render(){const{trans:e}=this.model;return r.createElement("div",null,r.createElement("label",null,r.createElement("strong",{className:Q},e.__("Filter Licenses By"))),r.createElement("ul",null,r.createElement("li",null,r.createElement("label",null,e.__("Package")),this.renderFilter("name")),r.createElement("li",null,r.createElement("label",null,e.__("Version")),this.renderFilter("versionInfo")),r.createElement("li",null,r.createElement("label",null,e.__("License")),this.renderFilter("licenseId"))),r.createElement("label",null,r.createElement("strong",{className:Q},e.__("Distributions"))))}}e.Filters=s;class a extends o.TabBar.Renderer{constructor(e){super();this.closeIconSelector=".lm-TabBar-tabCloseIcon";this.model=e}renderTab(e){let t=e.title.caption;let n=this.createTabKey(e);let i=this.createTabStyle(e);let s=this.createTabClass(e);let o=this.createTabDataset(e);return X.h.li({key:n,className:s,title:t,style:i,dataset:o},this.renderIcon(e),this.renderLabel(e),this.renderCountBadge(e))}renderCountBadge(e){const t=e.title.label;const{bundles:n}=this.model;const i=this.model.getFilteredPackages((n&&t?n[t].packages:[])||[]);return X.h.label({},`${i.length}`)}}e.BundleTabRenderer=a;class l extends i.VDomRenderer{constructor(e){super(e);this.renderRow=(e,t)=>{const n=t===this.model.currentPackageIndex;const i=()=>this.model.currentPackageIndex=t;return r.createElement("tr",{key:e.name,className:n?"jp-mod-selected":"",onClick:i},r.createElement("td",null,r.createElement("input",{type:"radio",name:"show-package-license",value:t,onChange:i,checked:n})),r.createElement("th",null,e.name),r.createElement("td",null,r.createElement("code",null,e.versionInfo)),r.createElement("td",null,r.createElement("code",null,e.licenseId)))};this.addClass("jp-Licenses-Grid");this.addClass("jp-RenderedHTMLCommon")}render(){var e;const{bundles:t,currentBundleName:n,trans:i}=this.model;const s=this.model.getFilteredPackages(t&&n?((e=t[n])===null||e===void 0?void 0:e.packages)||[]:[]);if(!s.length){return r.createElement("blockquote",null,r.createElement("em",null,i.__("No Packages found")))}return r.createElement("form",null,r.createElement("table",null,r.createElement("thead",null,r.createElement("tr",null,r.createElement("td",null),r.createElement("th",null,i.__("Package")),r.createElement("th",null,i.__("Version")),r.createElement("th",null,i.__("License")))),r.createElement("tbody",null,s.map(this.renderRow))))}}e.Grid=l;class d extends i.VDomRenderer{constructor(e){super(e);this.addClass("jp-Licenses-Text");this.addClass("jp-RenderedHTMLCommon");this.addClass("jp-RenderedMarkdown")}render(){const{currentPackage:e,trans:t}=this.model;let n="";let i=t.__("No Package selected");let s="";if(e){const{name:o,versionInfo:r,licenseId:a,extractedText:l}=e;n=`${o} v${r}`;i=`${t.__("License")}: ${a||t.__("No License ID found")}`;s=l||t.__("No License Text found")}return[r.createElement("h1",{key:"h1"},n),r.createElement("blockquote",{key:"quote"},r.createElement("em",null,i)),r.createElement("code",{key:"code"},s)]}}e.FullText=d})(Z||(Z={}));var ee;(function(e){e.symbol=Symbol("printable");function t(t){if(typeof t!=="object"||!t){return false}return e.symbol in t}e.isPrintable=t;function n(n){if(t(n)){return n[e.symbol]()}return null}e.getPrintFunction=n;function i(e){return o(e.node)}e.printWidget=i;async function s(e){const t=Y.ServerConnection.makeSettings();const n=await(await Y.ServerConnection.makeRequest(e,{},t)).text();return o(n)}e.printURL=s;async function o(e){const t=typeof e==="string";const n=r();const i=window.document.body;i.appendChild(n);if(t){n.srcdoc=e;await l(n)}else{n.src="about:blank";await l(n);a(n,e)}const s=d();c(n.contentWindow);await s;i.removeChild(n)}function r(){const e=window.document.createElement("iframe");e.setAttribute("sandbox","allow-modals allow-same-origin");const t="visibility:hidden;width:0;height:0;position:absolute;z-index:-9999;bottom:0;";e.setAttribute("style",t);e.setAttribute("width","0");e.setAttribute("height","0");return e}function a(e,t){e.contentDocument.body.appendChild(t.cloneNode(true));e.contentDocument.close()}function l(e){return new Promise((t=>{e.onload=()=>t()}))}function d(){return new Promise((e=>{const t=()=>{document.removeEventListener("mousemove",t,true);document.removeEventListener("mousedown",t,true);document.removeEventListener("keydown",t,true);e()};document.addEventListener("mousemove",t,true);document.addEventListener("mousedown",t,true);document.addEventListener("keydown",t,true)}))}function c(e){const t=e.document.execCommand("print",false);if(!t){e.print()}}})(ee||(ee={}));const te=true;class ne extends o.Widget{constructor(e){super(e);this._changeGuard=false;this._spinner=new i.Spinner;this._isRevealed=false;this._evtMouseDown=()=>{if(!this.node.contains(document.activeElement)){this._focusContent()}};this.addClass("jp-MainAreaWidget");this.addClass("jp-MainAreaWidget-ContainStrict");this.id=B.createDomID();const t=(e.translator||s.nullTranslator).load("jupyterlab");const n=this._content=e.content;n.node.setAttribute("role","region");n.node.setAttribute("aria-label",t.__("main area content"));const r=this._toolbar=e.toolbar||new i.ReactiveToolbar({noFocusOnClick:true});r.node.setAttribute("role","toolbar");r.node.setAttribute("aria-label",t.__("main area toolbar"));const a=this._contentHeader=e.contentHeader||new o.BoxPanel({direction:"top-to-bottom",spacing:0});const l=this.layout=new o.BoxLayout({spacing:0});l.direction="top-to-bottom";o.BoxLayout.setStretch(r,0);o.BoxLayout.setStretch(a,0);o.BoxLayout.setStretch(n,1);l.addWidget(r);l.addWidget(a);l.addWidget(n);if(!n.id){n.id=B.createDomID()}n.node.tabIndex=-1;this._updateTitle();n.title.changed.connect(this._updateTitle,this);this.title.closable=true;this.title.changed.connect(this._updateContentTitle,this);if(e.reveal){this.node.appendChild(this._spinner.node);this._revealed=e.reveal.then((()=>{if(n.isDisposed){this.dispose();return}n.disposed.connect((()=>this.dispose()));const e=document.activeElement===this._spinner.node;this._disposeSpinner();this._isRevealed=true;if(e){this._focusContent()}})).catch((e=>{const t=new o.Widget;t.addClass("jp-MainAreaWidget-error");const i=document.createElement("pre");i.textContent=String(e);t.node.appendChild(i);o.BoxLayout.setStretch(t,1);this._disposeSpinner();n.dispose();this._content=null;r.dispose();this._toolbar=null;l.addWidget(t);this._isRevealed=true;throw t}))}else{this._spinner.dispose();this.removeClass("jp-MainAreaWidget-ContainStrict");n.disposed.connect((()=>this.dispose()));this._isRevealed=true;this._revealed=Promise.resolve(undefined)}}[ee.symbol](){if(!this._content){return null}return ee.getPrintFunction(this._content)}get content(){return this._content}get toolbar(){return this._toolbar}get contentHeader(){return this._contentHeader}get isRevealed(){return this._isRevealed}get revealed(){return this._revealed}onActivateRequest(e){if(this._isRevealed){this._focusContent()}else{this._spinner.node.focus()}}onAfterAttach(e){super.onAfterAttach(e);this.node.addEventListener("mousedown",this._evtMouseDown,te)}onBeforeDetach(e){this.node.removeEventListener("mousedown",this._evtMouseDown,te);super.onBeforeDetach(e)}onCloseRequest(e){this.dispose()}onUpdateRequest(e){if(this._content){u.MessageLoop.sendMessage(this._content,e)}}_disposeSpinner(){this.node.removeChild(this._spinner.node);this._spinner.dispose();this.removeClass("jp-MainAreaWidget-ContainStrict")}_updateTitle(){if(this._changeGuard||!this.content){return}this._changeGuard=true;const e=this.content;this.title.label=e.title.label;this.title.mnemonic=e.title.mnemonic;this.title.icon=e.title.icon;this.title.iconClass=e.title.iconClass;this.title.iconLabel=e.title.iconLabel;this.title.caption=e.title.caption;this.title.className=e.title.className;this.title.dataset=e.title.dataset;this._changeGuard=false}_updateContentTitle(){if(this._changeGuard||!this.content){return}this._changeGuard=true;const e=this.content;e.title.label=this.title.label;e.title.mnemonic=this.title.mnemonic;e.title.icon=this.title.icon;e.title.iconClass=this.title.iconClass;e.title.iconLabel=this.title.iconLabel;e.title.caption=this.title.caption;e.title.className=this.title.className;e.title.dataset=this.title.dataset;this._changeGuard=false}_focusContent(){if(!this.content){return}if(!this.content.node.contains(document.activeElement)){this.content.node.focus()}this.content.activate()}}var ie;(function(e){function t(e,t){return e.filter((e=>!e.disabled)).sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Infinity)-((i=t.rank)!==null&&i!==void 0?i:Infinity)})).map((e=>n(e,t)))}e.createMenus=t;function n(e,t){var n,s;const r=t(e);r.id=e.id;if(!r.title.label){r.title.label=(n=e.label)!==null&&n!==void 0?n:l.Text.titleCase(r.id.trim())}if(e.icon){r.title.icon=i.LabIcon.resolve({icon:e.icon})}if(e.mnemonic!==undefined){r.title.mnemonic=e.mnemonic}(s=e.items)===null||s===void 0?void 0:s.filter((e=>!e.disabled)).sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Infinity)-((i=t.rank)!==null&&i!==void 0?i:Infinity)})).map((e=>{o(e,r,t)}));return r}function s(e,t,i){const{submenu:s,...o}=e;t.addItem({...o,submenu:s?n(s,i):null})}e.addContextItem=s;function o(e,t,i){const{submenu:s,...o}=e;t.addItem({...o,submenu:s?n(s,i):null})}function r(e,t,i){const s=[];t.forEach((t=>{const o=e.find((e=>e.id===t.id));if(o){a(t,o,i)}else{if(!t.disabled){s.push(n(t,i))}}}));e.push(...s);return s}e.updateMenus=r;function a(e,t,n){var i;if(e.disabled){t.dispose()}else{(i=e.items)===null||i===void 0?void 0:i.forEach((e=>{var i,s;const r=t===null||t===void 0?void 0:t.items.find(((t,n)=>{var i,s,o;return t.type===e.type&&t.command===((i=e.command)!==null&&i!==void 0?i:"")&&((s=t.submenu)===null||s===void 0?void 0:s.id)===((o=e.submenu)===null||o===void 0?void 0:o.id)}));if(r&&e.type!=="separator"){if(e.disabled){t.removeItem(r)}else{switch((i=e.type)!==null&&i!==void 0?i:"command"){case"command":if(e.command){if(!c.JSONExt.deepEqual(r.args,(s=e.args)!==null&&s!==void 0?s:{})){o(e,t,n)}}break;case"submenu":if(e.submenu){a(e.submenu,r.submenu,n)}}}}else{o(e,t,n)}}))}}})(ie||(ie={}));class se{constructor(){this._isDisposed=false;this._queue=[];this._changed=new h.Signal(this)}get changed(){return this._changed}get count(){return this._queue.length}get isDisposed(){return this._isDisposed}get notifications(){return this._queue.slice()}dismiss(e){if(typeof e==="undefined"){const e=this._queue.slice();this._queue.length=0;for(const t of e){this._changed.emit({type:"removed",notification:t})}}else{const t=this._queue.findIndex((t=>t.id===e));if(t>-1){const e=this._queue.splice(t,1)[0];this._changed.emit({type:"removed",notification:e})}}}dispose(){if(this._isDisposed){return}this._isDisposed=true;h.Signal.clearData(this)}has(e){return this._queue.findIndex((t=>t.id===e))>-1}notify(e,t,n){const i=Date.now();const{progress:s,...o}=n;const r=Object.freeze({id:c.UUID.uuid4(),createdAt:i,modifiedAt:i,message:e,type:t,options:{autoClose:0,progress:typeof s==="number"?Math.min(Math.max(0,s),1):s,...o}});this._queue.unshift(r);this._changed.emit({type:"added",notification:r});return r.id}update(e){const{id:t,message:n,actions:i,autoClose:s,data:o,progress:r,type:a}=e;const l=typeof r==="number"?Math.min(Math.max(0,r),1):r;const d=this._queue.findIndex((e=>e.id===t));if(d>-1){const e=this._queue[d];const t=Object.freeze({...e,message:n!==null&&n!==void 0?n:e.message,type:a!==null&&a!==void 0?a:e.type,options:{actions:i!==null&&i!==void 0?i:e.options.actions,autoClose:s!==null&&s!==void 0?s:e.options.autoClose,data:o!==null&&o!==void 0?o:e.options.data,progress:l!==null&&l!==void 0?l:e.options.progress},modifiedAt:Date.now()});this._queue.splice(d,1);this._queue.unshift(t);this._changed.emit({type:"updated",notification:t});return true}return false}}var oe;(function(e){e.manager=new se;function t(t){e.manager.dismiss(t)}e.dismiss=t;function n(t,n="default",i={}){return e.manager.notify(t,n,i)}e.emit=n;function i(t,n={}){return e.manager.notify(t,"error",n)}e.error=i;function s(t,n={}){return e.manager.notify(t,"info",n)}e.info=s;function o(t,n){var i;const{pending:s,error:o,success:r}=n;const a=e.manager.notify(s.message,"in-progress",(i=s.options)!==null&&i!==void 0?i:{});t.then((t=>{var n,i,s;e.manager.update({id:a,message:r.message(t,(n=r.options)===null||n===void 0?void 0:n.data),type:"success",...r.options,data:(s=(i=r.options)===null||i===void 0?void 0:i.data)!==null&&s!==void 0?s:t})})).catch((t=>{var n,i,s;e.manager.update({id:a,message:o.message(t,(n=o.options)===null||n===void 0?void 0:n.data),type:"error",...o.options,data:(s=(i=o.options)===null||i===void 0?void 0:i.data)!==null&&s!==void 0?s:t})}));return a}e.promise=o;function r(t,n={}){return e.manager.notify(t,"success",n)}e.success=r;function a(t){return e.manager.update(t)}e.update=a;function l(t,n={}){return e.manager.notify(t,"warning",n)}e.warning=l})(oe||(oe={}));const re=4;function ae(e){var t,n;const s=(t=e.showKernels)!==null&&t!==void 0?t:true;const o=(n=e.showTerminals)!==null&&n!==void 0?n:e.terminals>0;return a().createElement(C.GroupItem,{role:"button",tabIndex:0,spacing:re,onClick:e.handleClick,onKeyDown:e.handleKeyDown,style:{cursor:"pointer"}},o?a().createElement(C.GroupItem,{spacing:re},a().createElement(C.TextItem,{source:e.terminals}),a().createElement(i.terminalIcon.react,{verticalAlign:"middle",stylesheet:"statusBar"})):null,s?a().createElement(C.GroupItem,{spacing:re},a().createElement(C.TextItem,{source:e.sessions}),a().createElement(i.kernelIcon.react,{verticalAlign:"middle",stylesheet:"statusBar"})):null)}class le extends i.VDomRenderer{constructor(e){super(new le.Model);this._serviceManager=e.serviceManager;this._handleClick=e.onClick;this._handleKeyDown=e.onKeyDown;this.translator=e.translator||s.nullTranslator;this._showKernels=e.showKernels;this._showTerminals=e.showTerminals;this._trans=this.translator.load("jupyterlab");this._serviceManager.sessions.runningChanged.connect(this._onSessionsRunningChanged,this);this._serviceManager.terminals.runningChanged.connect(this._onTerminalsRunningChanged,this);this.addClass("jp-mod-highlighted")}render(){if(!this.model){return null}const e=this._trans.__("%1 Terminals, %2 Kernel sessions",this.model.terminals,this.model.sessions);this.node.title=e;return a().createElement(ae,{sessions:this.model.sessions,terminals:this.model.terminals,handleClick:this._handleClick,handleKeyDown:this._handleKeyDown,showKernels:this._showKernels,showTerminals:this._showTerminals})}dispose(){super.dispose();this._serviceManager.sessions.runningChanged.disconnect(this._onSessionsRunningChanged,this);this._serviceManager.terminals.runningChanged.disconnect(this._onTerminalsRunningChanged,this)}_onSessionsRunningChanged(e,t){this.model.sessions=t.length}_onTerminalsRunningChanged(e,t){this.model.terminals=t.length}}(function(e){class t extends i.VDomModel{constructor(){super(...arguments);this._terminals=0;this._sessions=0}get sessions(){return this._sessions}set sessions(e){const t=this._sessions;this._sessions=e;if(t!==this._sessions){this.stateChanged.emit(void 0)}}get terminals(){return this._terminals}set terminals(e){const t=this._terminals;this._terminals=e;if(t!==this._terminals){this.stateChanged.emit(void 0)}}}e.Model=t})(le||(le={}));var de=n(74728);var ce=n.n(de);class he{static reg(e){return new RegExp("^"+e+"$","i")}}he.N={integer:`[+-]?[0-9]+`,integer_pos:`[+]?[0-9]+`,integer_zero_ff:`([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])`,number:`[+-]?([0-9]*[.])?[0-9]+(e-?[0-9]*)?`,number_pos:`[+]?([0-9]*[.])?[0-9]+(e-?[0-9]*)?`,number_zero_hundred:`[+]?(([0-9]|[1-9][0-9])([.][0-9]+)?|100)`,number_zero_one:`[+]?(1([.][0]+)?|0?([.][0-9]+)?)`};he.B={angle:`(${he.N.number}(deg|rad|grad|turn)|0)`,frequency:`${he.N.number}(Hz|kHz)`,ident:String.raw`-?([_a-z]|[\xA0-\xFF]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])([_a-z0-9-]|[\xA0-\xFF]|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*`,len_or_perc:`(0|${he.N.number}(px|em|rem|ex|in|cm|mm|pt|pc|%))`,length:`(${he.N.number}(px|em|rem|ex|in|cm|mm|pt|pc)|0)`,length_pos:`(${he.N.number_pos}(px|em|rem|ex|in|cm|mm|pt|pc)|0)`,percentage:`${he.N.number}%`,percentage_pos:`${he.N.number_pos}%`,percentage_zero_hundred:`${he.N.number_zero_hundred}%`,string:String.raw`(\"([^\n\r\f\\"]|\\\n|\r\n|\r|\f|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*\")|(\'([^\n\r\f\\']|\\\n|\r\n|\r|\f|\\[0-9a-f]{1,6}(\r\n|[ \t\r\n\f])?|\\[^\r\n\f0-9a-f])*\')`,time:`${he.N.number}(s|ms)`,url:`url\\(.*?\\)`,z_index:`[+-]?[0-9]{1,7}`};he.A={absolute_size:`xx-small|x-small|small|medium|large|x-large|xx-large`,attachment:`scroll|fixed|local`,bg_origin:`border-box|padding-box|content-box`,border_style:`none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset`,box:`border-box|padding-box|content-box`,display_inside:`auto|block|table|flex|grid`,display_outside:`block-level|inline-level|none|table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption`,ending_shape:`circle|ellipse`,generic_family:`serif|sans-serif|cursive|fantasy|monospace`,generic_voice:`male|female|child`,relative_size:`smaller|larger`,repeat_style:`repeat-x|repeat-y|((?:repeat|space|round|no-repeat)(?:\\s*(?:repeat|space|round|no-repeat))?)`,side_or_corner:`(left|right)?\\s*(top|bottom)?`,single_animation_direction:`normal|reverse|alternate|alternate-reverse`,single_animation_fill_mode:`none|forwards|backwards|both`,single_animation_play_state:`running|paused`};he._COLOR={hex:`\\#(0x)?[0-9a-f]+`,name:`aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|transparent|violet|wheat|white|whitesmoke|yellow|yellowgreen`,rgb:String.raw`rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)`,rgba:String.raw`rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(${he.N.integer_zero_ff}|${he.N.number_zero_one}|${he.B.percentage_zero_hundred})\s*\)`};he._C={alpha:`${he.N.integer_zero_ff}|${he.N.number_zero_one}|${he.B.percentage_zero_hundred}`,alphavalue:he.N.number_zero_one,bg_position:`((${he.B.len_or_perc}|left|center|right|top|bottom)\\s*){1,4}`,bg_size:`(${he.B.length_pos}|${he.B.percentage}|auto){1,2}|cover|contain`,border_width:`thin|medium|thick|${he.B.length}`,bottom:`${he.B.length}|auto`,color:`${he._COLOR.hex}|${he._COLOR.rgb}|${he._COLOR.rgba}|${he._COLOR.name}`,color_stop_length:`(${he.B.len_or_perc}\\s*){1,2}`,linear_color_hint:`${he.B.len_or_perc}`,family_name:`${he.B.string}|(${he.B.ident}\\s*)+`,image_decl:he.B.url,left:`${he.B.length}|auto`,loose_quotable_words:`(${he.B.ident})+`,margin_width:`${he.B.len_or_perc}|auto`,padding_width:`${he.B.length_pos}|${he.B.percentage_pos}`,page_url:he.B.url,position:`((${he.B.len_or_perc}|left|center|right|top|bottom)\\s*){1,4}`,right:`${he.B.length}|auto`,shadow:"",size:`closest-side|farthest-side|closest-corner|farthest-corner|${he.B.length}|(${he.B.len_or_perc})\\s+(${he.B.len_or_perc})`,top:`${he.B.length}|auto`};he._C1={image_list:`image\\(\\s*(${he.B.url})*\\s*(${he.B.url}|${he._C.color})\\s*\\)`,linear_color_stop:`(${he._C.color})(\\s*${he._C.color_stop_length})?`,shadow:`((${he._C.color})\\s+((${he.B.length})\\s*){2,4}(s+inset)?)|((inset\\s+)?((${he.B.length})\\s*){2,4}\\s*(${he._C.color})?)`};he._C2={color_stop_list:`((${he._C1.linear_color_stop})(\\s*(${he._C.linear_color_hint}))?\\s*,\\s*)+(${he._C1.linear_color_stop})`,shape:`rect\\(\\s*(${he._C.top})\\s*,\\s*(${he._C.right})\\s*,\\s*(${he._C.bottom})\\s*,\\s*(${he._C.left})\\s*\\)`};he._C3={linear_gradient:`linear-gradient\\((((${he.B.angle})|to\\s+(${he.A.side_or_corner}))\\s*,\\s*)?\\s*(${he._C2.color_stop_list})\\s*\\)`,radial_gradient:`radial-gradient\\(((((${he.A.ending_shape})|(${he._C.size}))\\s*)*\\s*(at\\s+${he._C.position})?\\s*,\\s*)?\\s*(${he._C2.color_stop_list})\\s*\\)`};he._C4={image:`${he.B.url}|${he._C3.linear_gradient}|${he._C3.radial_gradient}|${he._C1.image_list}`,bg_image:`(${he.B.url}|${he._C3.linear_gradient}|${he._C3.radial_gradient}|${he._C1.image_list})|none`};he.C={...he._C,...he._C1,...he._C2,...he._C3,...he._C4};he.AP={border_collapse:`collapse|separate`,box:`normal|none|contents`,box_sizing:`content-box|padding-box|border-box`,caption_side:`top|bottom`,clear:`none|left|right|both`,direction:`ltr|rtl`,empty_cells:`show|hide`,float:`left|right|none`,font_stretch:`normal|wider|narrower|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded`,font_style:`normal|italic|oblique`,font_variant:`normal|small-caps`,font_weight:`normal|bold|bolder|lighter|100|200|300|400|500|600|700|800|900`,list_style_position:`inside|outside`,list_style_type:`disc|circle|square|decimal|decimal-leading-zero|lower-roman|upper-roman|lower-greek|lower-latin|upper-latin|armenian|georgian|lower-alpha|upper-alpha|none`,overflow:`visible|hidden|scroll|auto`,overflow_wrap:`normal|break-word`,overflow_x:`visible|hidden|scroll|auto|no-display|no-content`,page_break_after:`auto|always|avoid|left|right`,page_break_before:`auto|always|avoid|left|right`,page_break_inside:`avoid|auto`,position:`static|relative|absolute`,resize:`none|both|horizontal|vertical`,speak:`normal|none|spell-out`,speak_header:`once|always`,speak_numeral:`digits|continuous`,speak_punctuation:`code|none`,table_layout:`auto|fixed`,text_align:`left|right|center|justify`,text_decoration:`none|((underline|overline|line-through|blink)\\s*)+`,text_transform:`capitalize|uppercase|lowercase|none`,text_wrap:`normal|unrestricted|none|suppress`,unicode_bidi:`normal|embed|bidi-override`,visibility:`visible|hidden|collapse`,white_space:`normal|pre|nowrap|pre-wrap|pre-line`,word_break:`normal|keep-all|break-all`};he._CP={background_attachment:`${he.A.attachment}(,\\s*${he.A.attachment})*`,background_color:he.C.color,background_origin:`${he.A.box}(,\\s*${he.A.box})*`,background_repeat:`${he.A.repeat_style}(,\\s*${he.A.repeat_style})*`,border:`((${he.C.border_width}|${he.A.border_style}|${he.C.color})\\s*){1,3}`,border_radius:`((${he.B.len_or_perc})\\s*){1,4}(\\/\\s*((${he.B.len_or_perc})\\s*){1,4})?`,border_spacing:`${he.B.length}\\s*(${he.B.length})?`,border_top_color:he.C.color,border_top_style:he.A.border_style,border_width:`((${he.C.border_width})\\s*){1,4}`,color:he.C.color,cursor:`(${he.B.url}(\\s*,\\s*)?)*(auto|crosshair|default|pointer|move|e-resize|ne-resize|nw-resize|n-resize|se-resize|sw-resize|s-resize|w-resize|text|wait|help|progress|all-scroll|col-resize|hand|no-drop|not-allowed|row-resize|vertical-text)`,display:`inline|block|list-item|run-in|inline-list-item|inline-block|table|inline-table|table-cell|table-caption|flex|inline-flex|grid|inline-grid|${he.A.display_inside}|${he.A.display_outside}|inherit|inline-box|inline-stack`,display_outside:he.A.display_outside,elevation:`${he.B.angle}|below|level|above|higher|lower`,font_family:`(${he.C.family_name}|${he.A.generic_family})(,\\s*(${he.C.family_name}|${he.A.generic_family}))*`,height:`${he.B.length}|${he.B.percentage}|auto`,letter_spacing:`normal|${he.B.length}`,list_style_image:`${he.C.image}|none`,margin_right:he.C.margin_width,max_height:`${he.B.length_pos}|${he.B.percentage_pos}|none|auto`,min_height:`${he.B.length_pos}|${he.B.percentage_pos}|auto`,opacity:he.C.alphavalue,outline_color:`${he.C.color}|invert`,outline_width:he.C.border_width,padding:`((${he.C.padding_width})\\s*){1,4}`,padding_top:he.C.padding_width,pitch_range:he.N.number,right:`${he.B.length}|${he.B.percentage}|auto`,stress:he.N.number,text_indent:`${he.B.length}|${he.B.percentage}`,text_shadow:`none|${he.C.shadow}(,\\s*(${he.C.shadow}))*`,volume:`${he.N.number_pos}|${he.B.percentage_pos}|silent|x-soft|soft|medium|loud|x-loud`,word_wrap:he.AP.overflow_wrap,zoom:`normal|${he.N.number_pos}|${he.B.percentage_pos}`,backface_visibility:he.AP.visibility,background_clip:`${he.A.box}(,\\s*(${he.A.box}))*`,background_position:`${he.C.bg_position}(,\\s*(${he.C.bg_position}))*`,border_bottom_color:he.C.color,border_bottom_style:he.A.border_style,border_color:`((${he.C.color})\\s*){1,4}`,border_left_color:he.C.color,border_right_color:he.C.color,border_style:`((${he.A.border_style})\\s*){1,4}`,border_top_left_radius:`(${he.B.length}|${he.B.percentage})(\\s*(${he.B.length}|${he.B.percentage}))?`,border_top_width:he.C.border_width,box_shadow:`none|${he.C.shadow}(,\\s*(${he.C.shadow}))*`,clip:`${he.C.shape}|auto`,display_inside:he.A.display_inside,font_size:`${he.A.absolute_size}|${he.A.relative_size}|${he.B.length_pos}|${he.B.percentage_pos}`,line_height:`normal|${he.N.number_pos}|${he.B.length_pos}|${he.B.percentage_pos}`,margin_left:he.C.margin_width,max_width:`${he.B.length_pos}|${he.B.percentage_pos}|none|auto`,outline_style:he.A.border_style,padding_bottom:he.C.padding_width,padding_right:he.C.padding_width,perspective:`none|${he.B.length}`,richness:he.N.number,text_overflow:`((clip|ellipsis|${he.B.string})\\s*){1,2}`,top:`${he.B.length}|${he.B.percentage}|auto`,width:`${he.B.length_pos}|${he.B.percentage_pos}|auto`,z_index:`auto|${he.B.z_index}`,background:`(((${he.C.bg_position}\\s*(\\/\\s*${he.C.bg_size})?)|(${he.A.repeat_style})|(${he.A.attachment})|(${he.A.bg_origin})|(${he.C.bg_image})|(${he.C.color}))\\s*)+`,background_size:`${he.C.bg_size}(,\\s*${he.C.bg_size})*`,border_bottom_left_radius:`(${he.B.length}|${he.B.percentage})(\\s*(${he.B.length}|${he.B.percentage}))?`,border_bottom_width:he.C.border_width,border_left_style:he.A.border_style,border_right_style:he.A.border_style,border_top:`((${he.C.border_width}|${he.A.border_style}|${he.C.color})\\s*){1,3}`,bottom:`${he.B.len_or_perc}|auto`,list_style:`((${he.AP.list_style_type}|${he.AP.list_style_position}|${he.C.image}|none})\\s*){1,3}`,margin_top:he.C.margin_width,outline:`((${he.C.color}|invert|${he.A.border_style}|${he.C.border_width})\\s*){1,3}`,overflow_y:he.AP.overflow_x,pitch:`${he.B.frequency}|x-low|low|medium|high|x-high`,vertical_align:`baseline|sub|super|top|text-top|middle|bottom|text-bottom|${he.B.len_or_perc}`,word_spacing:`normal|${he.B.length}`,background_image:`${he.C.bg_image}(,\\s*${he.C.bg_image})*`,border_bottom_right_radius:`(${he.B.length}|${he.B.percentage})(\\s*(${he.B.length}|${he.B.percentage}))?`,border_left_width:he.C.border_width,border_right_width:he.C.border_width,left:`${he.B.len_or_perc}|auto`,margin_bottom:he.C.margin_width,pause_after:`${he.B.time}|${he.B.percentage}`,speech_rate:`${he.N.number}|x-slow|slow|medium|fast|x-fast|faster|slower`,transition_duration:`${he.B.time}(,\\s*${he.B.time})*`,border_bottom:`((${he.C.border_width}|${he.A.border_style}|${he.C.color})\\s*){1,3}`,border_right:`((${he.C.border_width}|${he.A.border_style}|${he.C.color})\\s*){1,3}`,margin:`((${he.C.margin_width})\\s*){1,4}`,padding_left:he.C.padding_width,border_left:`((${he.C.border_width}|${he.A.border_style}|${he.C.color})\\s*){1,3}`,quotes:`(${he.B.string}\\s*${he.B.string})+|none`,border_top_right_radius:`(${he.B.length}|${he.B.percentage})(\\s*(${he.B.length}|${he.B.percentage}))?`,min_width:`${he.B.length_pos}|${he.B.percentage_pos}|auto`};he._CP1={font:`(((((${he.AP.font_style}|${he.AP.font_variant}|${he.AP.font_weight})\\s*){1,3})?\\s*(${he._CP.font_size})\\s*(\\/\\s*(${he._CP.line_height}))?\\s+(${he._CP.font_family}))|caption|icon|menu|message-box|small-caption|status-bar)`};he.CP={...he._CP,...he._CP1};he.BORDER_COLLAPSE=he.reg(he.AP.border_collapse);he.BOX=he.reg(he.AP.box);he.BOX_SIZING=he.reg(he.AP.box_sizing);he.CAPTION_SIDE=he.reg(he.AP.caption_side);he.CLEAR=he.reg(he.AP.clear);he.DIRECTION=he.reg(he.AP.direction);he.EMPTY_CELLS=he.reg(he.AP.empty_cells);he.FLOAT=he.reg(he.AP.float);he.FONT_STRETCH=he.reg(he.AP.font_stretch);he.FONT_STYLE=he.reg(he.AP.font_style);he.FONT_VARIANT=he.reg(he.AP.font_variant);he.FONT_WEIGHT=he.reg(he.AP.font_weight);he.LIST_STYLE_POSITION=he.reg(he.AP.list_style_position);he.LIST_STYLE_TYPE=he.reg(he.AP.list_style_type);he.OVERFLOW=he.reg(he.AP.overflow);he.OVERFLOW_WRAP=he.reg(he.AP.overflow_wrap);he.OVERFLOW_X=he.reg(he.AP.overflow_x);he.PAGE_BREAK_AFTER=he.reg(he.AP.page_break_after);he.PAGE_BREAK_BEFORE=he.reg(he.AP.page_break_before);he.PAGE_BREAK_INSIDE=he.reg(he.AP.page_break_inside);he.POSITION=he.reg(he.AP.position);he.RESIZE=he.reg(he.AP.resize);he.SPEAK=he.reg(he.AP.speak);he.SPEAK_HEADER=he.reg(he.AP.speak_header);he.SPEAK_NUMERAL=he.reg(he.AP.speak_numeral);he.SPEAK_PUNCTUATION=he.reg(he.AP.speak_punctuation);he.TABLE_LAYOUT=he.reg(he.AP.table_layout);he.TEXT_ALIGN=he.reg(he.AP.text_align);he.TEXT_DECORATION=he.reg(he.AP.text_decoration);he.TEXT_TRANSFORM=he.reg(he.AP.text_transform);he.TEXT_WRAP=he.reg(he.AP.text_wrap);he.UNICODE_BIDI=he.reg(he.AP.unicode_bidi);he.VISIBILITY=he.reg(he.AP.visibility);he.WHITE_SPACE=he.reg(he.AP.white_space);he.WORD_BREAK=he.reg(he.AP.word_break);he.BACKGROUND_ATTACHMENT=he.reg(he.CP.background_attachment);he.BACKGROUND_COLOR=he.reg(he.CP.background_color);he.BACKGROUND_ORIGIN=he.reg(he.CP.background_origin);he.BACKGROUND_REPEAT=he.reg(he.CP.background_repeat);he.BORDER=he.reg(he.CP.border);he.BORDER_RADIUS=he.reg(he.CP.border_radius);he.BORDER_SPACING=he.reg(he.CP.border_spacing);he.BORDER_TOP_COLOR=he.reg(he.CP.border_top_color);he.BORDER_TOP_STYLE=he.reg(he.CP.border_top_style);he.BORDER_WIDTH=he.reg(he.CP.border_width);he.COLOR=he.reg(he.CP.color);he.CURSOR=he.reg(he.CP.cursor);he.DISPLAY=he.reg(he.CP.display);he.DISPLAY_OUTSIDE=he.reg(he.CP.display_outside);he.ELEVATION=he.reg(he.CP.elevation);he.FONT_FAMILY=he.reg(he.CP.font_family);he.HEIGHT=he.reg(he.CP.height);he.LETTER_SPACING=he.reg(he.CP.letter_spacing);he.LIST_STYLE_IMAGE=he.reg(he.CP.list_style_image);he.MARGIN_RIGHT=he.reg(he.CP.margin_right);he.MAX_HEIGHT=he.reg(he.CP.max_height);he.MIN_HEIGHT=he.reg(he.CP.min_height);he.OPACITY=he.reg(he.CP.opacity);he.OUTLINE_COLOR=he.reg(he.CP.outline_color);he.OUTLINE_WIDTH=he.reg(he.CP.outline_width);he.PADDING=he.reg(he.CP.padding);he.PADDING_TOP=he.reg(he.CP.padding_top);he.PITCH_RANGE=he.reg(he.CP.pitch_range);he.RIGHT=he.reg(he.CP.right);he.STRESS=he.reg(he.CP.stress);he.TEXT_INDENT=he.reg(he.CP.text_indent);he.TEXT_SHADOW=he.reg(he.CP.text_shadow);he.VOLUME=he.reg(he.CP.volume);he.WORD_WRAP=he.reg(he.CP.word_wrap);he.ZOOM=he.reg(he.CP.zoom);he.BACKFACE_VISIBILITY=he.reg(he.CP.backface_visibility);he.BACKGROUND_CLIP=he.reg(he.CP.background_clip);he.BACKGROUND_POSITION=he.reg(he.CP.background_position);he.BORDER_BOTTOM_COLOR=he.reg(he.CP.border_bottom_color);he.BORDER_BOTTOM_STYLE=he.reg(he.CP.border_bottom_style);he.BORDER_COLOR=he.reg(he.CP.border_color);he.BORDER_LEFT_COLOR=he.reg(he.CP.border_left_color);he.BORDER_RIGHT_COLOR=he.reg(he.CP.border_right_color);he.BORDER_STYLE=he.reg(he.CP.border_style);he.BORDER_TOP_LEFT_RADIUS=he.reg(he.CP.border_top_left_radius);he.BORDER_TOP_WIDTH=he.reg(he.CP.border_top_width);he.BOX_SHADOW=he.reg(he.CP.box_shadow);he.CLIP=he.reg(he.CP.clip);he.DISPLAY_INSIDE=he.reg(he.CP.display_inside);he.FONT_SIZE=he.reg(he.CP.font_size);he.LINE_HEIGHT=he.reg(he.CP.line_height);he.MARGIN_LEFT=he.reg(he.CP.margin_left);he.MAX_WIDTH=he.reg(he.CP.max_width);he.OUTLINE_STYLE=he.reg(he.CP.outline_style);he.PADDING_BOTTOM=he.reg(he.CP.padding_bottom);he.PADDING_RIGHT=he.reg(he.CP.padding_right);he.PERSPECTIVE=he.reg(he.CP.perspective);he.RICHNESS=he.reg(he.CP.richness);he.TEXT_OVERFLOW=he.reg(he.CP.text_overflow);he.TOP=he.reg(he.CP.top);he.WIDTH=he.reg(he.CP.width);he.Z_INDEX=he.reg(he.CP.z_index);he.BACKGROUND=he.reg(he.CP.background);he.BACKGROUND_SIZE=he.reg(he.CP.background_size);he.BORDER_BOTTOM_LEFT_RADIUS=he.reg(he.CP.border_bottom_left_radius);he.BORDER_BOTTOM_WIDTH=he.reg(he.CP.border_bottom_width);he.BORDER_LEFT_STYLE=he.reg(he.CP.border_left_style);he.BORDER_RIGHT_STYLE=he.reg(he.CP.border_right_style);he.BORDER_TOP=he.reg(he.CP.border_top);he.BOTTOM=he.reg(he.CP.bottom);he.LIST_STYLE=he.reg(he.CP.list_style);he.MARGIN_TOP=he.reg(he.CP.margin_top);he.OUTLINE=he.reg(he.CP.outline);he.OVERFLOW_Y=he.reg(he.CP.overflow_y);he.PITCH=he.reg(he.CP.pitch);he.VERTICAL_ALIGN=he.reg(he.CP.vertical_align);he.WORD_SPACING=he.reg(he.CP.word_spacing);he.BACKGROUND_IMAGE=he.reg(he.CP.background_image);he.BORDER_BOTTOM_RIGHT_RADIUS=he.reg(he.CP.border_bottom_right_radius);he.BORDER_LEFT_WIDTH=he.reg(he.CP.border_left_width);he.BORDER_RIGHT_WIDTH=he.reg(he.CP.border_right_width);he.LEFT=he.reg(he.CP.left);he.MARGIN_BOTTOM=he.reg(he.CP.margin_bottom);he.PAUSE_AFTER=he.reg(he.CP.pause_after);he.SPEECH_RATE=he.reg(he.CP.speech_rate);he.TRANSITION_DURATION=he.reg(he.CP.transition_duration);he.BORDER_BOTTOM=he.reg(he.CP.border_bottom);he.BORDER_RIGHT=he.reg(he.CP.border_right);he.MARGIN=he.reg(he.CP.margin);he.PADDING_LEFT=he.reg(he.CP.padding_left);he.BORDER_LEFT=he.reg(he.CP.border_left);he.FONT=he.reg(he.CP.font);he.QUOTES=he.reg(he.CP.quotes);he.BORDER_TOP_RIGHT_RADIUS=he.reg(he.CP.border_top_right_radius);he.MIN_WIDTH=he.reg(he.CP.min_width);class ue{constructor(){this._autolink=true;this._allowNamedProperties=false;this._generateOptions=()=>{const e=Array.isArray(this._customAllowedSchemes)?this._customAllowedSchemes:[...ce().defaults.allowedSchemes];return{allowedTags:["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blockquote","br","button","canvas","caption","center","cite","code","col","colgroup","colspan","command","data","datalist","dd","del","details","dfn","dir","div","dl","dt","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","i","img","input","ins","kbd","label","legend","li","map","mark","menu","meter","nav","nobr","ol","optgroup","option","output","p","pre","progress","q","rowspan","s","samp","section","select","small","source","span","strike","strong","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"],allowedAttributes:{"*":["class","data-jupyter-id","dir","draggable","hidden","id","inert","itemprop","itemref","itemscope","lang","spellcheck","style","title","translate"],a:["accesskey","coords","href","hreflang",...this._allowNamedProperties?["name"]:[],"rel","shape","tabindex","target","type"],area:["accesskey","alt","coords","href","nohref","shape","tabindex"],audio:["autoplay","controls","loop","mediagroup","muted","preload","src"],bdo:["dir"],blockquote:["cite"],br:["clear"],button:["accesskey","data-commandlinker-args","data-commandlinker-command","disabled",...this._allowNamedProperties?["name"]:[],"tabindex","type","value"],canvas:["height","width"],caption:["align"],col:["align","char","charoff","span","valign","width"],colgroup:["align","char","charoff","span","valign","width"],command:["checked","command","disabled","icon","label","radiogroup","type"],data:["value"],del:["cite","datetime"],details:["open"],dir:["compact"],div:["align"],dl:["compact"],fieldset:["disabled"],font:["color","face","size"],form:["accept","autocomplete","enctype","method",...this._allowNamedProperties?["name"]:[],"novalidate"],h1:["align"],h2:["align"],h3:["align"],h4:["align"],h5:["align"],h6:["align"],hr:["align","noshade","size","width"],iframe:["align","frameborder","height","marginheight","marginwidth","width"],img:["align","alt","border","height","hspace","ismap",...this._allowNamedProperties?["name"]:[],"src","usemap","vspace","width"],input:["accept","accesskey","align","alt","autocomplete","checked","disabled","inputmode","ismap","list","max","maxlength","min","multiple",...this._allowNamedProperties?["name"]:[],"placeholder","readonly","required","size","src","step","tabindex","type","usemap","value"],ins:["cite","datetime"],label:["accesskey","for"],legend:["accesskey","align"],li:["type","value"],map:this._allowNamedProperties?["name"]:[],menu:["compact","label","type"],meter:["high","low","max","min","value"],ol:["compact","reversed","start","type"],optgroup:["disabled","label"],option:["disabled","label","selected","value"],output:["for",...this._allowNamedProperties?["name"]:[]],p:["align"],pre:["width"],progress:["max","min","value"],q:["cite"],select:["autocomplete","disabled","multiple",...this._allowNamedProperties?["name"]:[],"required","size","tabindex"],source:["type"],table:["align","bgcolor","border","cellpadding","cellspacing","frame","rules","summary","width"],tbody:["align","char","charoff","valign"],td:["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],textarea:["accesskey","autocomplete","cols","disabled","inputmode",...this._allowNamedProperties?["name"]:[],"placeholder","readonly","required","rows","tabindex","wrap"],tfoot:["align","char","charoff","valign"],th:["abbr","align","axis","bgcolor","char","charoff","colspan","headers","height","nowrap","rowspan","scope","valign","width"],thead:["align","char","charoff","valign"],tr:["align","bgcolor","char","charoff","valign"],track:["default","kind","label","srclang"],ul:["compact","type"],video:["autoplay","controls","height","loop","mediagroup","muted","poster","preload","src","width"]},allowedStyles:{"*":{"backface-visibility":[he.BACKFACE_VISIBILITY],background:[he.BACKGROUND],"background-attachment":[he.BACKGROUND_ATTACHMENT],"background-clip":[he.BACKGROUND_CLIP],"background-color":[he.BACKGROUND_COLOR],"background-image":[he.BACKGROUND_IMAGE],"background-origin":[he.BACKGROUND_ORIGIN],"background-position":[he.BACKGROUND_POSITION],"background-repeat":[he.BACKGROUND_REPEAT],"background-size":[he.BACKGROUND_SIZE],border:[he.BORDER],"border-bottom":[he.BORDER_BOTTOM],"border-bottom-color":[he.BORDER_BOTTOM_COLOR],"border-bottom-left-radius":[he.BORDER_BOTTOM_LEFT_RADIUS],"border-bottom-right-radius":[he.BORDER_BOTTOM_RIGHT_RADIUS],"border-bottom-style":[he.BORDER_BOTTOM_STYLE],"border-bottom-width":[he.BORDER_BOTTOM_WIDTH],"border-collapse":[he.BORDER_COLLAPSE],"border-color":[he.BORDER_COLOR],"border-left":[he.BORDER_LEFT],"border-left-color":[he.BORDER_LEFT_COLOR],"border-left-style":[he.BORDER_LEFT_STYLE],"border-left-width":[he.BORDER_LEFT_WIDTH],"border-radius":[he.BORDER_RADIUS],"border-right":[he.BORDER_RIGHT],"border-right-color":[he.BORDER_RIGHT_COLOR],"border-right-style":[he.BORDER_RIGHT_STYLE],"border-right-width":[he.BORDER_RIGHT_WIDTH],"border-spacing":[he.BORDER_SPACING],"border-style":[he.BORDER_STYLE],"border-top":[he.BORDER_TOP],"border-top-color":[he.BORDER_TOP_COLOR],"border-top-left-radius":[he.BORDER_TOP_LEFT_RADIUS],"border-top-right-radius":[he.BORDER_TOP_RIGHT_RADIUS],"border-top-style":[he.BORDER_TOP_STYLE],"border-top-width":[he.BORDER_TOP_WIDTH],"border-width":[he.BORDER_WIDTH],bottom:[he.BOTTOM],box:[he.BOX],"box-shadow":[he.BOX_SHADOW],"box-sizing":[he.BOX_SIZING],"caption-side":[he.CAPTION_SIDE],clear:[he.CLEAR],clip:[he.CLIP],color:[he.COLOR],cursor:[he.CURSOR],direction:[he.DIRECTION],display:[he.DISPLAY],"display-inside":[he.DISPLAY_INSIDE],"display-outside":[he.DISPLAY_OUTSIDE],elevation:[he.ELEVATION],"empty-cells":[he.EMPTY_CELLS],float:[he.FLOAT],font:[he.FONT],"font-family":[he.FONT_FAMILY],"font-size":[he.FONT_SIZE],"font-stretch":[he.FONT_STRETCH],"font-style":[he.FONT_STYLE],"font-variant":[he.FONT_VARIANT],"font-weight":[he.FONT_WEIGHT],height:[he.HEIGHT],left:[he.LEFT],"letter-spacing":[he.LETTER_SPACING],"line-height":[he.LINE_HEIGHT],"list-style":[he.LIST_STYLE],"list-style-image":[he.LIST_STYLE_IMAGE],"list-style-position":[he.LIST_STYLE_POSITION],"list-style-type":[he.LIST_STYLE_TYPE],margin:[he.MARGIN],"margin-bottom":[he.MARGIN_BOTTOM],"margin-left":[he.MARGIN_LEFT],"margin-right":[he.MARGIN_RIGHT],"margin-top":[he.MARGIN_TOP],"max-height":[he.MAX_HEIGHT],"max-width":[he.MAX_WIDTH],"min-height":[he.MIN_HEIGHT],"min-width":[he.MIN_WIDTH],opacity:[he.OPACITY],outline:[he.OUTLINE],"outline-color":[he.OUTLINE_COLOR],"outline-style":[he.OUTLINE_STYLE],"outline-width":[he.OUTLINE_WIDTH],overflow:[he.OVERFLOW],"overflow-wrap":[he.OVERFLOW_WRAP],"overflow-x":[he.OVERFLOW_X],"overflow-y":[he.OVERFLOW_Y],padding:[he.PADDING],"padding-bottom":[he.PADDING_BOTTOM],"padding-left":[he.PADDING_LEFT],"padding-right":[he.PADDING_RIGHT],"padding-top":[he.PADDING_TOP],"page-break-after":[he.PAGE_BREAK_AFTER],"page-break-before":[he.PAGE_BREAK_BEFORE],"page-break-inside":[he.PAGE_BREAK_INSIDE],"pause-after":[he.PAUSE_AFTER],perspective:[he.PERSPECTIVE],pitch:[he.PITCH],"pitch-range":[he.PITCH_RANGE],position:[he.POSITION],quotes:[he.QUOTES],resize:[he.RESIZE],richness:[he.RICHNESS],right:[he.RIGHT],speak:[he.SPEAK],"speak-header":[he.SPEAK_HEADER],"speak-numeral":[he.SPEAK_NUMERAL],"speak-punctuation":[he.SPEAK_PUNCTUATION],"speech-rate":[he.SPEECH_RATE],stress:[he.STRESS],"table-layout":[he.TABLE_LAYOUT],"text-align":[he.TEXT_ALIGN],"text-decoration":[he.TEXT_DECORATION],"text-indent":[he.TEXT_INDENT],"text-overflow":[he.TEXT_OVERFLOW],"text-shadow":[he.TEXT_SHADOW],"text-transform":[he.TEXT_TRANSFORM],"text-wrap":[he.TEXT_WRAP],top:[he.TOP],"unicode-bidi":[he.UNICODE_BIDI],"vertical-align":[he.VERTICAL_ALIGN],visibility:[he.VISIBILITY],volume:[he.VOLUME],"white-space":[he.WHITE_SPACE],width:[he.WIDTH],"word-break":[he.WORD_BREAK],"word-spacing":[he.WORD_SPACING],"word-wrap":[he.WORD_WRAP],"z-index":[he.Z_INDEX],zoom:[he.ZOOM]}},transformTags:{a:ce().simpleTransform("a",{rel:"nofollow"}),input:ce().simpleTransform("input",{disabled:"disabled"}),...this._allowNamedProperties?{}:{"*":function(e,t){if(t.id!==undefined){t["data-jupyter-id"]=t.id;delete t.id}return{tagName:e,attribs:{...t}}}}},allowedSchemes:e,allowedSchemesByTag:{img:[...e,"attachment"]},allowedSchemesAppliedToAttributes:["href","cite"]}};this._options=this._generateOptions()}sanitize(e,t){return ce()(e,{...this._options,...t||{}})}getAutolink(){return this._autolink}get allowNamedProperties(){return this._allowNamedProperties}setAllowedSchemes(e){this._customAllowedSchemes=[...e];this._options=this._generateOptions()}setAutolink(e){this._autolink=e}setAllowNamedProperties(e){this._allowNamedProperties=e;this._options=this._generateOptions()}}class pe{constructor(){this._commands=new Array}get ids(){return this._commands.map((e=>e.id))}add(e){if(this._commands.map((e=>e.id)).includes(e.id)){throw Error(`Command ${e.id} is already defined.`)}this._commands.push({isEnabled:()=>true,rank:pe.DEFAULT_RANK,...e})}getActiveCommandId(e){var t;const n=this._commands.filter((t=>t.isEnabled(e))).sort(((e,t)=>{const n=e.rank-t.rank;return n||(e.idt.id===e));if(t>=0){this._commands.splice(t,1)}}}pe.DEFAULT_RANK=500;pe.WIDGET="semanticWidget";var me=n(90044);const ge=75;const fe=20;class ve{constructor(e){this._current=null;this._links=[];this._overrides={};this._overrideProps={};this._outstanding=null;this._pending=0;this._requests={};this._themes={};this._themeChanged=new h.Signal(this);const{host:t,key:n,splash:i,url:o}=e;this.translator=e.translator||s.nullTranslator;this._trans=this.translator.load("jupyterlab");const r=e.settings;this._base=o;this._host=t;this._splash=i||null;void r.load(n).then((e=>{this._settings=e;this._initOverrideProps();this._settings.changed.connect(this._loadSettings,this);this._loadSettings()}))}get theme(){return this._current}get preferredLightTheme(){return this._settings.composite["preferred-light-theme"]}get preferredDarkTheme(){return this._settings.composite["preferred-dark-theme"]}get preferredTheme(){if(!this.isToggledAdaptiveTheme()){return this.theme}if(this.isSystemColorSchemeDark()){return this.preferredDarkTheme}return this.preferredLightTheme}get themes(){return Object.keys(this._themes)}get lightThemes(){return Object.entries(this._themes).filter((([e,t])=>t.isLight)).map((([e,t])=>e))}get darkThemes(){return Object.entries(this._themes).filter((([e,t])=>!t.isLight)).map((([e,t])=>e))}get themeChanged(){return this._themeChanged}isSystemColorSchemeDark(){return window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches}getCSS(e){var t;return(t=this._overrides[e])!==null&&t!==void 0?t:getComputedStyle(document.documentElement).getPropertyValue(`--jp-${e}`)}loadCSS(e){const t=this._base;const n=l.URLExt.isLocal(e)?l.URLExt.join(t,e):e;const i=this._links;return new Promise(((e,t)=>{const s=document.createElement("link");s.setAttribute("rel","stylesheet");s.setAttribute("type","text/css");s.setAttribute("href",n);s.addEventListener("load",(()=>{e(undefined)}));s.addEventListener("error",(()=>{t(`Stylesheet failed to load: ${n}`)}));document.body.appendChild(s);i.push(s);this.loadCSSOverrides()}))}loadCSSOverrides(){var e;const t=(e=this._settings.user["overrides"])!==null&&e!==void 0?e:{};Object.keys({...this._overrides,...t}).forEach((e=>{const n=t[e];if(n&&this.validateCSS(e,n)){document.documentElement.style.setProperty(`--jp-${e}`,n)}else{delete t[e];document.documentElement.style.removeProperty(`--jp-${e}`)}}));this._overrides=t}validateCSS(e,t){const n=this._overrideProps[e];if(!n){console.warn("CSS validation failed: could not find property corresponding to key.\n"+`key: '${e}', val: '${t}'`);return false}if(CSS.supports(n,t)){return true}else{console.warn("CSS validation failed: invalid value.\n"+`key: '${e}', val: '${t}', prop: '${n}'`);return false}}register(e){const{name:t}=e;const n=this._themes;if(n[t]){throw new Error(`Theme already registered for ${t}`)}n[t]=e;return new me.DisposableDelegate((()=>{delete n[t]}))}setCSSOverride(e,t){return this._settings.set("overrides",{...this._overrides,[e]:t})}setTheme(e){return this._settings.set("theme",e)}setPreferredLightTheme(e){return this._settings.set("preferred-light-theme",e)}setPreferredDarkTheme(e){return this._settings.set("preferred-dark-theme",e)}isLight(e){return this._themes[e].isLight}incrFontSize(e){return this._incrFontSize(e,true)}decrFontSize(e){return this._incrFontSize(e,false)}themeScrollbars(e){return!!this._settings.composite["theme-scrollbars"]&&!!this._themes[e].themeScrollbars}isToggledThemeScrollbars(){return!!this._settings.composite["theme-scrollbars"]}toggleThemeScrollbars(){return this._settings.set("theme-scrollbars",!this._settings.composite["theme-scrollbars"])}isToggledAdaptiveTheme(){return!!this._settings.composite["adaptive-theme"]}toggleAdaptiveTheme(){return this._settings.set("adaptive-theme",!this._settings.composite["adaptive-theme"])}getDisplayName(e){var t,n;return(n=(t=this._themes[e])===null||t===void 0?void 0:t.displayName)!==null&&n!==void 0?n:e}_incrFontSize(e,t=true){var n;const i=((n=this.getCSS(e))!==null&&n!==void 0?n:"13px").split(/([a-zA-Z]+)/);const s=(t?1:-1)*(i[1]==="em"?.1:1);return this.setCSSOverride(e,`${Number(i[0])+s}${i[1]}`)}_initOverrideProps(){const e=this._settings.schema.definitions;const t=e.cssOverrides.properties;Object.keys(t).forEach((e=>{let n;switch(e){case"code-font-size":case"content-font-size1":case"ui-font-size1":n="font-size";break;default:n=t[e].description;break}this._overrideProps[e]=n}))}_loadSettings(){const e=this._outstanding;const t=this._pending;const n=this._requests;if(t){window.clearTimeout(t);this._pending=0}const i=this._settings;const s=this._themes;let o=i.composite["theme"];if(this.isToggledAdaptiveTheme()){if(this.isSystemColorSchemeDark()){o=this.preferredDarkTheme}else{o=this.preferredLightTheme}}if(e){e.then((()=>{this._loadSettings()})).catch((()=>{this._loadSettings()}));this._outstanding=null;return}n[o]=n[o]?n[o]+1:1;if(s[o]){this._outstanding=this._loadTheme(o);delete n[o];return}if(n[o]>fe){const e=i.default("theme");delete n[o];if(!s[e]){this._onError(this._trans.__("Neither theme %1 nor default %2 loaded.",o,e));return}console.warn(`Could not load theme ${o}, using default ${e}.`);this._outstanding=this._loadTheme(e);return}this._pending=window.setTimeout((()=>{this._loadSettings()}),ge)}_loadTheme(e){var t;const n=this._current;const i=this._links;const s=this._themes;const o=this._splash?this._splash.show(s[e].isLight):new me.DisposableDelegate((()=>undefined));i.forEach((e=>{if(e.parentElement){e.parentElement.removeChild(e)}}));i.length=0;const r=(t=this._settings.schema.properties)===null||t===void 0?void 0:t.theme;if(r){r.enum=Object.keys(s).map((e=>{var t;return(t=s[e].displayName)!==null&&t!==void 0?t:e}))}const a=n?s[n].unload():Promise.resolve();return Promise.all([a,s[e].load()]).then((()=>{this._current=e;this._themeChanged.emit({name:"theme",oldValue:n,newValue:e});this._host.hide();requestAnimationFrame((()=>{this._host.show();_e.fitAll(this._host);o.dispose()}))})).catch((e=>{this._onError(e);o.dispose()}))}_onError(e){void g({title:this._trans.__("Error Loading Theme"),body:String(e),buttons:[v.okButton({label:this._trans.__("OK")})]})}}var _e;(function(e){function t(e){for(const n of e.children()){t(n)}e.fit()}e.fitAll=t})(_e||(_e={}));const be=new c.Token("@jupyterlab/apputils:ICommandPalette",`A service for the application command palette\n in the left panel. Use this to add commands to the palette.`);const ye=new c.Token("@jupyterlab/apputils:IKernelStatusModel","A service to register kernel session provider to the kernel status indicator.");const we=new c.Token("@jupyterlab/apputils:ILicensesClient","A service for fetching licenses.");const Ce=new c.Token("@jupyterlab/apputils:ISessionContextDialogs","A service for handling the session dialogs.");const xe=new c.Token("@jupyterlab/apputils:IThemeManager","A service for the theme manager for the application. This is used primarily in theme extensions to register new themes.");const Se=new c.Token("@jupyterlab/apputils:ISanitizer","A service for sanitizing HTML strings.");const ke=new c.Token("@jupyterlab/apputils:ISplashScreen",`A service for the splash screen for the application.\n Use this if you want to show the splash screen for your own purposes.`);const je=new c.Token("@jupyterlab/apputils:IWindowResolver",`A service for a window resolver for the\n application. JupyterLab workspaces are given a name, which are determined using\n the window resolver. Require this if you want to use the name of the current workspace.`);const Ie=new c.Token("@jupyterlab/apputils:IToolbarWidgetRegistry",`A registry for toolbar widgets. Require this\n if you want to build the toolbar dynamically from a data definition (stored in settings for example).`);class Ee{constructor(e){this._widgets=new Map;this._factoryAdded=new h.Signal(this);this._defaultFactory=e.defaultFactory}get defaultFactory(){return this._defaultFactory}set defaultFactory(e){this._defaultFactory=e}get factoryAdded(){return this._factoryAdded}createWidget(e,t,n){var i;const s=(i=this._widgets.get(e))===null||i===void 0?void 0:i.get(n.name);return s?s(t):this._defaultFactory(e,t,n)}addFactory(e,t,n){let i=this._widgets.get(e);const s=i===null||i===void 0?void 0:i.get(t);if(!i){i=new Map;this._widgets.set(e,i)}i.set(t,n);this._factoryAdded.emit(t);return s}registerFactory(e,t,n){return this.addFactory(e,t,n)}}function Te(e){return(t,n,s)=>{var r,a;switch((r=s.type)!==null&&r!==void 0?r:"command"){case"command":{const{command:t,args:o,label:r,caption:l,icon:d}=s;const c=t!==null&&t!==void 0?t:"";const h={toolbar:true,...o};const u=d?i.LabIcon.resolve({icon:d}):undefined;const p=n.toolbar;const m=(u!==null&&u!==void 0?u:e.icon(c,h))?r!==null&&r!==void 0?r:"":r;return new i.CommandToolbarButton({commands:e,id:c,args:h,icon:u,label:m,caption:l,noFocusOnClick:(a=p===null||p===void 0?void 0:p.noFocusOnClick)!==null&&a!==void 0?a:false})}case"spacer":return i.Toolbar.createSpacerItem();default:return new o.Widget}}}var Me=n(68148);var De=n(15615);const Ae=50;const Pe="jupyter.lab.toolbars";async function Le(e){const t=await g({title:e.__("Information"),body:e.__("Toolbar customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[v.cancelButton(),v.okButton({label:e.__("Reload")})]});if(t.button.accept){location.reload()}}async function Re(e,t,n,i,s,o="toolbar"){var r;const a=s.load("jupyterlab");let l=null;let d={};let h=true;try{function g(e){var s,r;d={};const a=Object.keys(t.plugins).filter((e=>e!==i)).map((e=>{var i,s;const o=(s=((i=t.plugins[e].schema[Pe])!==null&&i!==void 0?i:{})[n])!==null&&s!==void 0?s:[];d[e]=o;return o})).concat([(r=((s=e[Pe])!==null&&s!==void 0?s:{})[n])!==null&&r!==void 0?r:[]]).reduceRight(((e,t)=>De.SettingRegistry.reconcileToolbarItems(e,t,true)),[]);e.properties[o].default=De.SettingRegistry.reconcileToolbarItems(a,e.properties[o].default,true).sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Ae)-((i=t.rank)!==null&&i!==void 0?i:Ae)}))}t.transform(i,{compose:e=>{var t,n,i,s,r;if(!l){l=c.JSONExt.deepCopy(e.schema);g(l)}const a=(i=((n=((t=l.properties)!==null&&t!==void 0?t:{})[o])!==null&&n!==void 0?n:{}).default)!==null&&i!==void 0?i:[];const d=e.data.user;const h=e.data.composite;d[o]=(s=e.data.user[o])!==null&&s!==void 0?s:[];h[o]=((r=De.SettingRegistry.reconcileToolbarItems(a,d[o],false))!==null&&r!==void 0?r:[]).sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Ae)-((i=t.rank)!==null&&i!==void 0?i:Ae)}));e.data={composite:h,user:d};return e},fetch:e=>{if(!l){l=c.JSONExt.deepCopy(e.schema);g(l)}return{data:e.data,id:e.id,raw:e.raw,schema:l,version:e.version}}})}catch(m){if(m.name==="TransformError"){h=false}else{throw m}}const u=await t.load(i);u.changed.connect((()=>{var e;const t=(e=u.composite[o])!==null&&e!==void 0?e:[];p(t)}));const p=t=>{e.clear();e.pushAll(t.filter((e=>!e.disabled)))};p((r=u.composite[o])!==null&&r!==void 0?r:[]);if(!h){return}t.pluginChanged.connect((async(e,s)=>{var o,r,h;if(s===i){return}const u=(o=d[s])!==null&&o!==void 0?o:[];const p=(h=((r=t.plugins[s].schema[Pe])!==null&&r!==void 0?r:{})[n])!==null&&h!==void 0?h:[];if(!c.JSONExt.deepEqual(u,p)){if(d[s]){await Le(a)}else{if(p.length>0){l=null;const e=t.plugins[i].schema;e.properties.toolbar.default=[];await t.load(i,true)}}}}))}function Ne(e,t,n,i,s,o="toolbar"){const r=new Me.ObservableList({itemCmp:(e,t)=>c.JSONExt.deepEqual(e,t)});Re(r,t,n,i,s,o).catch((e=>{console.error(`Failed to load toolbar items for factory ${n} from ${i}`,e)}));return t=>{const i=(i,s)=>{switch(s.type){case"move":o.move(s.oldIndex,s.newIndex);break;case"add":s.newValues.forEach((i=>o.push({name:i.name,widget:e.createWidget(n,t,i)})));break;case"remove":s.oldValues.forEach((()=>o.remove(s.oldIndex)));break;case"set":s.newValues.forEach((i=>o.set(s.newIndex,{name:i.name,widget:e.createWidget(n,t,i)})));break}};const s=(i,s)=>{const a=Array.from(r).findIndex((e=>e.name===s));if(a>=0){o.set(a,{name:s,widget:e.createWidget(n,t,r.get(a))})}};const o=new Me.ObservableList({values:Array.from(r).map((i=>({name:i.name,widget:e.createWidget(n,t,i)})))});e.factoryAdded.connect(s);r.changed.connect(i);t.disposed.connect((()=>{r.changed.disconnect(i);e.factoryAdded.disconnect(s)}));return o}}function Oe(e,t,n){var i;if(!e.toolbar&&!n){console.log(`Widget ${e.id} has no 'toolbar' and no explicit toolbar was provided.`);return}const s=(i=e.toolbar)!==null&&i!==void 0?i:n;const o=t(e);if(Array.isArray(o)){o.forEach((({name:e,widget:t})=>{s.addItem(e,t)}))}else{const t=(e,t)=>{switch(t.type){case"add":t.newValues.forEach(((e,n)=>{s.insertItem(t.newIndex+n,e.name,e.widget)}));break;case"move":t.oldValues.forEach((e=>{e.widget.parent=null}));t.newValues.forEach(((e,n)=>{s.insertItem(t.newIndex+n,e.name,e.widget)}));break;case"remove":t.oldValues.forEach((e=>{e.widget.parent=null}));break;case"set":t.oldValues.forEach((e=>{e.widget.parent=null}));t.newValues.forEach(((e,n)=>{const i=(0,d.findIndex)(s.names(),(t=>e.name===t));if(i>=0){Array.from(s.children())[i].parent=null}s.insertItem(t.newIndex+n,e.name,e.widget)}));break}};t(o,{newIndex:0,newValues:Array.from(o),oldIndex:0,oldValues:[],type:"add"});o.changed.connect(t);e.disposed.connect((()=>{o.changed.disconnect(t)}))}}class Be{get name(){return this._name}resolve(e){return Fe.resolve(e).then((e=>{this._name=e}))}}var Fe;(function(e){const t="@jupyterlab/statedb:StateDB";const n=`${t}:beacon`;const i=Math.floor(200+Math.random()*300);const s=`${t}:window`;let o=null;let r=null;const a=new c.PromiseDelegate;const l={};let d=null;let h=false;function u(){window.addEventListener("storage",(e=>{const{key:t,newValue:i}=e;if(i===null){return}if(t===n&&i!==o&&r!==null){p(h?d:r);return}if(h||t!==s){return}const a=i.replace(/\-\d+$/,"");l[a]=null;if(!r||r in l){m()}}))}function p(e){if(e===null){return}const{localStorage:t}=window;t.setItem(s,`${e}-${(new Date).getTime()}`)}function m(){h=true;o=null;a.reject(`Window name candidate "${r}" already exists`)}function g(e){if(h){return a.promise}r=e;if(r in l){m();return a.promise}const{localStorage:t,setTimeout:s}=window;s((()=>{if(h){return}if(!r||r in l){return m()}h=true;o=null;a.resolve(d=r);p(d)}),i);o=`${Math.random()}-${(new Date).getTime()}`;t.setItem(n,o);return a.promise}e.resolve=g;(()=>{u()})()})(Fe||(Fe={}));class ze extends i.Toolbar{}(function(e){e.createInterruptButton=E.createInterruptButton;e.createKernelNameItem=E.createKernelNameItem;e.createKernelStatusItem=E.createKernelStatusItem;e.createRestartButton=E.createRestartButton;e.createSpacerItem=i.Toolbar.createSpacerItem})(ze||(ze={}))},97913:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(41510);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},39721:(e,t,n)=>{"use strict";n.r(t);n.d(t,{AttachmentsModel:()=>r,AttachmentsResolver:()=>a});var i=n(68148);var s=n(90943);var o=n(2336);class r{constructor(e){var t;this._map=new i.ObservableMap;this._isDisposed=false;this._stateChanged=new o.Signal(this);this._changed=new o.Signal(this);this._serialized=null;this._changeGuard=false;this.contentFactory=(t=e.contentFactory)!==null&&t!==void 0?t:r.defaultContentFactory;if(e.values){for(const t of Object.keys(e.values)){if(e.values[t]!==undefined){this.set(t,e.values[t])}}}this._map.changed.connect(this._onMapChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get keys(){return this._map.keys()}get length(){return this._map.keys().length}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._map.dispose();o.Signal.clearData(this)}has(e){return this._map.has(e)}get(e){return this._map.get(e)}set(e,t){const n=this._createItem({value:t});this._map.set(e,n)}remove(e){this._map.delete(e)}clear(){this._map.values().forEach((e=>{e.dispose()}));this._map.clear()}fromJSON(e){this.clear();Object.keys(e).forEach((t=>{if(e[t]!==undefined){this.set(t,e[t])}}))}toJSON(){const e={};for(const t of this._map.keys()){e[t]=this._map.get(t).toJSON()}return e}_createItem(e){const t=this.contentFactory;const n=t.createAttachmentModel(e);n.changed.connect(this._onGenericChange,this);return n}_onMapChanged(e,t){if(this._serialized&&!this._changeGuard){this._changeGuard=true;this._serialized.set(this.toJSON());this._changeGuard=false}this._changed.emit(t);this._stateChanged.emit(void 0)}_onGenericChange(){this._stateChanged.emit(void 0)}}(function(e){class t{createAttachmentModel(e){return new s.AttachmentModel(e)}}e.ContentFactory=t;e.defaultContentFactory=new t})(r||(r={}));class a{constructor(e){this._parent=e.parent||null;this._model=e.model}async resolveUrl(e){if(this._parent&&!e.startsWith("attachment:")){return this._parent.resolveUrl(e)}return e}async getDownloadUrl(e){if(this._parent&&!e.startsWith("attachment:")){return this._parent.getDownloadUrl(e)}const t=e.slice("attachment:".length);const n=this._model.get(t);if(n===undefined){return e}const{data:i}=n;const o=Object.keys(i)[0];if(o===undefined||s.imageRendererFactory.mimeTypes.indexOf(o)===-1){throw new Error(`Cannot render unknown image mime type "${o}".`)}const r=`data:${o};base64,${i[o]}`;return r}isLocal(e){var t,n,i;if(this._parent&&!e.startsWith("attachment:")){return(i=(n=(t=this._parent).isLocal)===null||n===void 0?void 0:n.call(t,e))!==null&&i!==void 0?i:true}return true}}},39470:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>p});var i=n(15615);var s=n.n(i);var o=n(17355);var r=n.n(o);var a=n(72050);var l=n.n(a);var d=n(61927);var c=n.n(d);const h="@jupyterlab/cell-toolbar-extension:plugin";const u={id:h,description:"Add the cells toolbar.",autoStart:true,activate:async(e,t,n,i)=>{function s(e){const t=e===null?true:e.get("showToolbar").composite;l.enabled=t}const r=t&&n?(0,a.createToolbarFactory)(n,t,o.CellBarExtension.FACTORY_NAME,u.id,i!==null&&i!==void 0?i:d.nullTranslator):undefined;const l=new o.CellBarExtension(e.commands,r);if(t!==null){void Promise.all([e.restored,t.load(h)]).then((([,e])=>{s(e);e.changed.connect(s)}))}e.docRegistry.addWidgetExtension("Notebook",l)},optional:[i.ISettingRegistry,a.IToolbarWidgetRegistry,d.ITranslator]};const p=u},56104:(e,t,n)=>{"use strict";var i=n(97913);var s=n(3579);var o=n(10395);var r=n(40662);var a=n(79010);var l=n(53377);var d=n(28006);var c=n(85072);var h=n.n(c);var u=n(97825);var p=n.n(u);var m=n(77659);var g=n.n(m);var f=n(55056);var v=n.n(f);var _=n(10540);var b=n.n(_);var y=n(41113);var w=n.n(y);var C=n(31772);var x={};x.styleTagTransform=w();x.setAttributes=v();x.insert=g().bind(null,"head");x.domAPI=p();x.insertStyleElement=b();var S=h()(C.A,x);const k=C.A&&C.A.locals?C.A.locals:undefined},23168:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CellBarExtension:()=>g,CellToolbarTracker:()=>p});var i=n(72050);var s=n(68148);var o=n(66127);var r=n(34236);var a=n(2336);var l=n(61927);const d=["text/plain","application/vnd.jupyter.stdout","application/vnd.jupyter.stderr"];const c="jp-cell-toolbar";const h="jp-cell-menu";const u="jp-toolbar-overlap";class p{constructor(e,t,n,i){this._isDisposed=false;this._toolbar=null;this._toolbarItems=null;this._toolbarFactory=null;this._panel=e;this._previousActiveCell=this._panel.content.activeCell;this._toolbarItems=t!==null&&t!==void 0?t:null;this._toolbarFactory=n!==null&&n!==void 0?n:null;this._enabled=true;this._trans=(i!==null&&i!==void 0?i:l.nullTranslator).load("jupyterlab");if(this._toolbarItems===null&&this._toolbarFactory===null){throw Error("You must provide the toolbarFactory or the toolbar items.")}if(!this._toolbarFactory&&this._toolbarItems){this._onToolbarChanged();this._toolbarItems.changed.connect(this._onToolbarChanged,this)}void e.revealed.then((()=>{requestAnimationFrame((()=>{const t=e.content;this._onActiveCellChanged(t);t.activeCellChanged.connect(this._onActiveCellChanged,this);t.renderingLayoutChanged.connect(this._onActiveCellChanged,this);t.disposed.connect((()=>{t.activeCellChanged.disconnect(this._onActiveCellChanged)}))}))}))}_onMetadataChanged(e,t){if(t.key==="jupyter"){if(typeof t.newValue==="object"&&t.newValue.source_hidden===true&&(t.type==="add"||t.type==="change")){this._removeToolbar(e)}else if(typeof t.oldValue==="object"&&t.oldValue.source_hidden===true){this._addToolbar(e)}}}_onActiveCellChanged(e){if(this._previousActiveCell&&!this._previousActiveCell.isDisposed){this._removeToolbar(this._previousActiveCell.model);this._previousActiveCell.model.metadataChanged.disconnect(this._onMetadataChanged)}const t=e.activeCell;this._previousActiveCell=t;if(t===null||t.inputHidden){return}t.model.metadataChanged.connect(this._onMetadataChanged,this);this._addToolbar(t.model)}get isDisposed(){return this._isDisposed}get enabled(){return this._enabled}set enabled(e){this._enabled=e;this._onToolbarChanged()}dispose(){var e,t;if(this.isDisposed){return}this._isDisposed=true;(e=this._toolbarItems)===null||e===void 0?void 0:e.changed.disconnect(this._onToolbarChanged,this);(t=this._toolbar)===null||t===void 0?void 0:t.dispose();this._panel=null;a.Signal.clearData(this)}_addToolbar(e){if(!this.enabled){return}const t=this._getCell(e);if(t&&!t.isDisposed){const e=this._toolbar=new o.Toolbar;e.addClass(h);e.addClass(c);e.node.setAttribute("aria-label",this._trans.__("Cell toolbar"));const n=[t.ready];if(this._toolbarFactory){const i=this._toolbarFactory(t);for(const{name:t,widget:s}of i){e.addItem(t,s);if(s instanceof o.ReactWidget&&s.renderPromise!==undefined){s.update();n.push(s.renderPromise)}}}else{for(const{name:t,widget:i}of this._toolbarItems){e.addItem(t,i);if(i instanceof o.ReactWidget&&i.renderPromise!==undefined){i.update();n.push(i.renderPromise)}}}n.push(t.ready);Promise.all(n).then((()=>{var n;if(t.isDisposed||((n=this._panel)===null||n===void 0?void 0:n.content.activeCell)!==t){e.dispose();return}t.node.classList.add(u);t.inputArea.layout.insertWidget(0,e);t.displayChanged.connect(this._resizeEventCallback,this);t.model.contentChanged.connect(this._changedEventCallback,this);this._updateCellForToolbarOverlap(t)})).catch((e=>{console.error("Error rendering buttons of the cell toolbar: ",e)}))}}_getCell(e){var t;return(t=this._panel)===null||t===void 0?void 0:t.content.widgets.find((t=>t.model===e))}_removeToolbar(e){var t,n;const i=this._getCell(e);if(i&&!i.isDisposed){i.displayChanged.disconnect(this._resizeEventCallback,this)}e.contentChanged.disconnect(this._changedEventCallback,this);if(((t=this._toolbar)===null||t===void 0?void 0:t.parent)===(i===null||i===void 0?void 0:i.inputArea)&&((n=this._toolbar)===null||n===void 0?void 0:n.isDisposed)===false){this._toolbar.dispose()}}_onToolbarChanged(){var e;const t=(e=this._panel)===null||e===void 0?void 0:e.content.activeCell;if(t){this._removeToolbar(t.model);this._addToolbar(t.model)}}_changedEventCallback(){var e;const t=(e=this._panel)===null||e===void 0?void 0:e.content.activeCell;if(t===null||t===undefined){return}this._updateCellForToolbarOverlap(t)}_resizeEventCallback(){var e;const t=(e=this._panel)===null||e===void 0?void 0:e.content.activeCell;if(t===null||t===undefined){return}this._updateCellForToolbarOverlap(t)}_updateCellForToolbarOverlap(e){requestIdleCallback((()=>{const t=e.node;t.classList.remove(u);if(this._cellToolbarOverlapsContents(e)){t.classList.add(u)}}))}_cellToolbarOverlapsContents(e){var t,n,i,s;if(!e.model){return false}const o=e.model.type;const r=(t=e.editorWidget)===null||t===void 0?void 0:t.node.getBoundingClientRect();const a=(n=r===null||r===void 0?void 0:r.left)!==null&&n!==void 0?n:0;const l=(i=r===null||r===void 0?void 0:r.right)!==null&&i!==void 0?i:0;const d=this._cellToolbarLeft(e);if(d===null){return false}if((a+l)/2>d){return true}if(o==="markdown"&&e.rendered){return this._markdownOverlapsToolbar(e)}if(((s=this._panel)===null||s===void 0?void 0:s.content.renderingLayout)==="default"){return this._codeOverlapsToolbar(e)}else{return this._outputOverlapsToolbar(e)}}_markdownOverlapsToolbar(e){const t=e.inputArea;if(!t){return false}const n=t.renderedInput;const i=n.node;const s=i.firstElementChild;if(s===null){return false}const o=s.style.maxWidth;s.style.maxWidth="max-content";const r=s.getBoundingClientRect().right;s.style.maxWidth=o;const a=this._cellToolbarLeft(e);return a===null?false:r>a}_outputOverlapsToolbar(e){const t=e.outputArea.node;if(t){const n=t.querySelectorAll("[data-mime-type]");const i=this._cellToolbarRect(e);if(i){const{left:e,bottom:t}=i;return(0,r.some)(n,(n=>{const i=n.firstElementChild;if(i){const s=new Range;if(d.includes(n.getAttribute("data-mime-type")||"")){s.selectNodeContents(i)}else{s.selectNode(i)}const{right:o,top:r}=s.getBoundingClientRect();return o>e&&rr}_cellToolbarRect(e){var t;if(((t=this._toolbar)===null||t===void 0?void 0:t.parent)!==e.inputArea){return null}const n=this._toolbar.node;return n.getBoundingClientRect()}_cellToolbarLeft(e){var t;return((t=this._cellToolbarRect(e))===null||t===void 0?void 0:t.left)||null}}const m=[{command:"notebook:duplicate-below",name:"duplicate-cell"},{command:"notebook:move-cell-up",name:"move-cell-up"},{command:"notebook:move-cell-down",name:"move-cell-down"},{command:"notebook:insert-cell-above",name:"insert-cell-above"},{command:"notebook:insert-cell-below",name:"insert-cell-below"},{command:"notebook:delete-cell",name:"delete-cell"}];class g{constructor(e,t){this._commands=e;this._toolbarFactory=t!==null&&t!==void 0?t:this.defaultToolbarFactory}createItemFactory(e){return(0,i.createDefaultFactory)(e)}get defaultToolbarFactory(){const e=this.createItemFactory(this._commands);return(t,n)=>new s.ObservableList({values:m.map((i=>{const s=n?{...i,args:{...i.args,...n}}:i;return{name:i.name,widget:e(g.FACTORY_NAME,t,s)}}))})}createNew(e){const t=t=>this._toolbarFactory(t,{[g.WIDGET_ID_ARG]:e.id});return this._tracker=new p(e,undefined,t)}get enabled(){return this._tracker.enabled}set enabled(e){if(this._tracker){this._tracker.enabled=e}}}g.FACTORY_NAME="Cell";g.WIDGET_ID_ARG="widgetId"},30531:(e,t,n)=>{"use strict";n.r(t);n.d(t,{AttachmentsCell:()=>$e,AttachmentsCellModel:()=>W,Cell:()=>Ve,CellDragUtils:()=>c,CellFooter:()=>k,CellHeader:()=>S,CellModel:()=>H,CellSearchProvider:()=>re,CodeCell:()=>qe,CodeCellLayout:()=>Ue,CodeCellModel:()=>q,Collapser:()=>_,InputArea:()=>D,InputCollapser:()=>b,InputPlaceholder:()=>ee,InputPrompt:()=>A,MarkdownCell:()=>Ke,MarkdownCellModel:()=>U,OutputCollapser:()=>y,OutputPlaceholder:()=>te,Placeholder:()=>Z,RawCell:()=>Je,RawCellModel:()=>V,SELECTED_HIGHLIGHT_CLASS:()=>oe,createCellSearchProvider:()=>de,isCodeCellModel:()=>B,isMarkdownCellModel:()=>F,isRawCellModel:()=>z});var i=n(97290);const s=5;const o="jp-dragImage";const r="jp-dragImage-singlePrompt";const a="jp-dragImage-content";const l="jp-dragImage-prompt";const d="jp-dragImage-multipleBack";var c;(function(e){function t(e,t,n){let i=-1;while(e&&e.parentElement){if(n(e)){let n=-1;for(const s of t){if(s.node===e){i=++n;break}}break}e=e.parentElement}return i}e.findCell=t;function n(e,t){var n,i;let s;if(e){if((n=e.editorWidget)===null||n===void 0?void 0:n.node.contains(t)){s="input"}else if((i=e.promptNode)===null||i===void 0?void 0:i.contains(t)){s="prompt"}else{s="cell"}}else{s="unknown"}return s}e.detectTargetArea=n;function c(e,t,n,i){const o=Math.abs(n-e);const r=Math.abs(i-t);return o>=s||r>=s}e.shouldStartDrag=c;function h(e,t){const n=t.length;let s;if(e.model.type==="code"){const t=e.model.executionCount;s=" ";if(t){s=t.toString()}}else{s=""}const c=e.model.sharedModel.getSource().split("\n")[0].slice(0,26);if(n>1){if(s!==""){return i.VirtualDOM.realize(i.h.div(i.h.div({className:o},i.h.span({className:l},"["+s+"]:"),i.h.span({className:a},c)),i.h.div({className:d},"")))}else{return i.VirtualDOM.realize(i.h.div(i.h.div({className:o},i.h.span({className:l}),i.h.span({className:a},c)),i.h.div({className:d},"")))}}else{if(s!==""){return i.VirtualDOM.realize(i.h.div(i.h.div({className:`${o} ${r}`},i.h.span({className:l},"["+s+"]:"),i.h.span({className:a},c))))}else{return i.VirtualDOM.realize(i.h.div(i.h.div({className:`${o} ${r}`},i.h.span({className:l}),i.h.span({className:a},c))))}}}e.createCellDragImage=h})(c||(c={}));var h=n(66127);var u=n(76326);var p=n(44914);const m="jp-Collapser";const g="jp-Collapser-child";const f="jp-InputCollapser";const v="jp-OutputCollapser";class _ extends h.ReactWidget{constructor(){super();this.addClass(m)}get collapsed(){return false}render(){const e=g;return p.createElement("div",{className:e,onClick:e=>this.handleClick(e)})}}class b extends _{constructor(){super();this.addClass(f)}get collapsed(){var e;const t=(e=this.parent)===null||e===void 0?void 0:e.parent;if(t){return t.inputHidden}else{return false}}handleClick(e){var t;const n=(t=this.parent)===null||t===void 0?void 0:t.parent;if(n){n.inputHidden=!n.inputHidden}this.update()}}class y extends _{constructor(){super();this.addClass(v)}get collapsed(){var e;const t=(e=this.parent)===null||e===void 0?void 0:e.parent;if(t){return t.outputHidden}else{return false}}handleClick(e){var t,n;const i=(t=this.parent)===null||t===void 0?void 0:t.parent;if(i){i.outputHidden=!i.outputHidden;if(i.outputHidden){let e=(n=i.parent)===null||n===void 0?void 0:n.node;if(e){u.ElementExt.scrollIntoViewIfNeeded(e,i.node)}}}this.update()}}var w=n(1143);const C="jp-CellHeader";const x="jp-CellFooter";class S extends w.Widget{constructor(){super();this.addClass(C)}}class k extends w.Widget{constructor(){super();this.addClass(x)}}var j=n(98335);const I="jp-InputArea";const E="jp-InputArea-prompt";const T="jp-InputPrompt";const M="jp-InputArea-editor";class D extends w.Widget{constructor(e){super();this.addClass(I);const{contentFactory:t,editorOptions:n,model:i}=e;this.model=i;this.contentFactory=t;const s=this._prompt=t.createInputPrompt();s.addClass(E);const o=this._editor=new j.CodeEditorWrapper({factory:t.editorFactory,model:i,editorOptions:n});o.addClass(M);const r=this.layout=new w.PanelLayout;r.addWidget(s);r.addWidget(o)}get editorWidget(){return this._editor}get editor(){return this._editor.editor}get promptNode(){return this._prompt.node}get renderedInput(){return this._rendered}renderInput(e){const t=this.layout;if(this._rendered){this._rendered.parent=null}this._editor.hide();this._rendered=e;t.addWidget(e)}showEditor(){if(this._rendered){this._rendered.parent=null}this._editor.show()}setPrompt(e){this._prompt.executionCount=e}dispose(){if(this.isDisposed){return}this._prompt=null;this._editor=null;this._rendered=null;super.dispose()}}(function(e){class t{constructor(e){this._editor=e.editorFactory}get editorFactory(){return this._editor}createInputPrompt(){return new A}}e.ContentFactory=t})(D||(D={}));class A extends w.Widget{constructor(){super();this._executionCount=null;this.addClass(T)}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e;if(e===null){this.node.textContent=" "}else{this.node.textContent=`[${e||" "}]:`}}}var P=n(2336);var L=n(66755);var R=n(8329);var N=n(95917);const O=(0,N.createMutex)();function B(e){return e.type==="code"}function F(e){return e.type==="markdown"}function z(e){return e.type==="raw"}class H extends j.CodeEditor.Model{constructor(e={}){const{cell_type:t,sharedModel:n,...i}=e;super({sharedModel:n!==null&&n!==void 0?n:(0,N.createStandaloneCell)({cell_type:t!==null&&t!==void 0?t:"raw",id:e.id}),...i});this.contentChanged=new P.Signal(this);this.stateChanged=new P.Signal(this);this._metadataChanged=new P.Signal(this);this._trusted=false;this.standaloneModel=typeof e.sharedModel==="undefined";this.trusted=!!this.getMetadata("trusted")||!!e.trusted;this.sharedModel.changed.connect(this.onGenericChange,this);this.sharedModel.metadataChanged.connect(this._onMetadataChanged,this)}get metadataChanged(){return this._metadataChanged}get id(){return this.sharedModel.getId()}get metadata(){return this.sharedModel.metadata}get trusted(){return this._trusted}set trusted(e){const t=this.trusted;if(t!==e){this._trusted=e;this.onTrustedChanged(this,{newValue:e,oldValue:t})}}dispose(){if(this.isDisposed){return}this.sharedModel.changed.disconnect(this.onGenericChange,this);this.sharedModel.metadataChanged.disconnect(this._onMetadataChanged,this);super.dispose()}onTrustedChanged(e,t){}deleteMetadata(e){return this.sharedModel.deleteMetadata(e)}getMetadata(e){return this.sharedModel.getMetadata(e)}setMetadata(e,t){if(typeof t==="undefined"){this.sharedModel.deleteMetadata(e)}else{this.sharedModel.setMetadata(e,t)}}toJSON(){return this.sharedModel.toJSON()}onGenericChange(){this.contentChanged.emit(void 0)}_onMetadataChanged(e,t){this._metadataChanged.emit(t)}}class W extends H{constructor(e){var t;super(e);const n=(t=e.contentFactory)!==null&&t!==void 0?t:W.defaultContentFactory;const i=this.sharedModel.getAttachments();this._attachments=n.createAttachmentsModel({values:i});this._attachments.stateChanged.connect(this.onGenericChange,this);this._attachments.changed.connect(this._onAttachmentsChange,this);this.sharedModel.changed.connect(this._onSharedModelChanged,this)}get attachments(){return this._attachments}dispose(){if(this.isDisposed){return}this._attachments.stateChanged.disconnect(this.onGenericChange,this);this._attachments.changed.disconnect(this._onAttachmentsChange,this);this._attachments.dispose();this.sharedModel.changed.disconnect(this._onSharedModelChanged,this);super.dispose()}toJSON(){return super.toJSON()}_onAttachmentsChange(e,t){const n=this.sharedModel;O((()=>n.setAttachments(e.toJSON())))}_onSharedModelChanged(e,t){if(t.attachmentsChange){const e=this.sharedModel;O((()=>{var t;return this._attachments.fromJSON((t=e.getAttachments())!==null&&t!==void 0?t:{})}))}}}(function(e){class t{createAttachmentsModel(e){return new L.AttachmentsModel(e)}}e.ContentFactory=t;e.defaultContentFactory=new t})(W||(W={}));class V extends W{constructor(e={}){super({cell_type:"raw",...e})}get type(){return"raw"}toJSON(){return super.toJSON()}}class U extends W{constructor(e={}){super({cell_type:"markdown",...e});this.mimeType="text/x-ipythongfm"}get type(){return"markdown"}toJSON(){return super.toJSON()}}class q extends H{constructor(e={}){var t;super({cell_type:"code",...e});this._executedCode="";this._isDirty=false;const n=(t=e===null||e===void 0?void 0:e.contentFactory)!==null&&t!==void 0?t:q.defaultContentFactory;const i=this.trusted;const s=this.sharedModel.getOutputs();this._outputs=n.createOutputArea({trusted:i,values:s});this.sharedModel.changed.connect(this._onSharedModelChanged,this);this._outputs.changed.connect(this.onGenericChange,this);this._outputs.changed.connect(this.onOutputsChange,this)}get type(){return"code"}get executionCount(){return this.sharedModel.execution_count||null}set executionCount(e){this.sharedModel.execution_count=e||null}get executionState(){return this.sharedModel.executionState}set executionState(e){this.sharedModel.executionState=e}get isDirty(){return this._isDirty}set isDirty(e){this._setDirty(e)}get outputs(){return this._outputs}clearExecution(){this.outputs.clear();this.executionCount=null;this.executionState="idle";this._setDirty(false);this.sharedModel.deleteMetadata("execution");this.trusted=true}dispose(){if(this.isDisposed){return}this.sharedModel.changed.disconnect(this._onSharedModelChanged,this);this._outputs.changed.disconnect(this.onGenericChange,this);this._outputs.changed.disconnect(this.onOutputsChange,this);this._outputs.dispose();this._outputs=null;super.dispose()}onTrustedChanged(e,t){const n=t.newValue;if(this._outputs){this._outputs.trusted=n}if(n){const e=this.sharedModel;const t=e.getMetadata();t.trusted=true;e.setMetadata(t)}this.stateChanged.emit({name:"trusted",oldValue:t.oldValue,newValue:n})}toJSON(){return super.toJSON()}onOutputsChange(e,t){const n=this.sharedModel;O((()=>{switch(t.type){case"add":{for(const n of t.newValues){if(n.type==="stream"){n.streamText.changed.connect(((e,n)=>{if(n.options!==undefined&&n.options["silent"]){return}const i=this.sharedModel;if(n.type==="remove"){i.removeStreamOutput(t.newIndex,n.start,"silent-change")}else{i.appendStreamOutput(t.newIndex,n.value,"silent-change")}}),this)}}const e=t.newValues.map((e=>e.toJSON()));n.updateOutputs(t.newIndex,t.newIndex,e,"silent-change");break}case"set":{const e=t.newValues.map((e=>e.toJSON()));n.updateOutputs(t.oldIndex,t.oldIndex+e.length,e,"silent-change");break}case"remove":n.updateOutputs(t.oldIndex,t.oldValues.length,[],"silent-change");break;case"clear":n.clearOutputs();break;default:throw new Error(`Invalid event type: ${t.type}`)}}))}_onSharedModelChanged(e,t){if(t.streamOutputChange){O((()=>{for(const e of t.streamOutputChange){if("delete"in e){this._outputs.removeStreamOutput(e.delete)}if("insert"in e){this._outputs.appendStreamOutput(e.insert.toString())}}}))}if(t.outputsChange){O((()=>{let e=0;for(const n of t.outputsChange){if("retain"in n){e+=n.retain}if("delete"in n){for(let t=0;t{if(e){this.cmHandler.setEditor(this.editor)}}))}}get editor(){return this.cell.editor}get model(){return this.cell.model}}class ae extends re{constructor(e){super(e);this.currentProviderIndex=-1;this.outputsProvider=[];const t=this.cell.outputArea;this._onOutputsChanged(t,t.widgets.length).catch((e=>{console.error(`Failed to initialize search on cell outputs.`,e)}));t.outputLengthChanged.connect(this._onOutputsChanged,this);t.disposed.connect((()=>{t.outputLengthChanged.disconnect(this._onOutputsChanged)}),this)}get matchesCount(){if(!this.isActive){return 0}return super.matchesCount+this.outputsProvider.reduce(((e,t)=>{var n;return e+((n=t.matchesCount)!==null&&n!==void 0?n:0)}),0)}async clearHighlight(){await super.clearHighlight();await Promise.all(this.outputsProvider.map((e=>e.clearHighlight())))}dispose(){if(this.isDisposed){return}super.dispose();this.outputsProvider.map((e=>{e.dispose()}));this.outputsProvider.length=0}async highlightNext(e,t){var n;const i=(n=t===null||t===void 0?void 0:t.from)!==null&&n!==void 0?n:"";if(this.matchesCount===0||i==="previous-match"&&this.currentIndex!==null&&this.currentIndex+1>=this.cmHandler.matches.length||!this.isActive){this.currentIndex=null}else{if(this.currentProviderIndex===-1){const n=await super.highlightNext(e,t);if(n){this.currentIndex=this.cmHandler.currentIndex;return n}else{this.currentProviderIndex=0}}while(this.currentProviderIndex{var n;return e+=(n=t.matchesCount)!==null&&n!==void 0?n:0}),0)+e.currentMatchIndex;return t}else{this.currentProviderIndex+=1}}this.currentProviderIndex=-1;this.currentIndex=null;return undefined}}async highlightPrevious(){if(this.matchesCount===0||!this.isActive){this.currentIndex=null}else{if(this.currentIndex===null){this.currentProviderIndex=this.outputsProvider.length-1}while(this.currentProviderIndex>=0){const e=this.outputsProvider[this.currentProviderIndex];const t=await e.highlightPrevious(false);if(t){this.currentIndex=super.matchesCount+this.outputsProvider.slice(0,this.currentProviderIndex).reduce(((e,t)=>{var n;return e+=(n=t.matchesCount)!==null&&n!==void 0?n:0}),0)+e.currentMatchIndex;return t}else{this.currentProviderIndex-=1}}const e=await super.highlightPrevious();if(e){this.currentIndex=this.cmHandler.currentIndex;return e}else{this.currentIndex=null;return undefined}}}async startQuery(e,t){await super.startQuery(e,t);if((t===null||t===void 0?void 0:t.output)!==false&&this.isActive){await Promise.all(this.outputsProvider.map((t=>t.startQuery(e))))}}async endQuery(){var e;await super.endQuery();if(((e=this.filters)===null||e===void 0?void 0:e.output)!==false&&this.isActive){await Promise.all(this.outputsProvider.map((e=>e.endQuery())))}}async replaceAllMatches(e,t){if(this.model.getMetadata("editable")===false)return Promise.resolve(false);const n=await super.replaceAllMatches(e,t);return n}async replaceCurrentMatch(e,t,n){if(this.model.getMetadata("editable")===false)return Promise.resolve(false);const i=await super.replaceCurrentMatch(e,t,n);return i}async _onOutputsChanged(e,t){var n;this.outputsProvider.forEach((e=>{e.dispose()}));this.outputsProvider.length=0;this.currentProviderIndex=-1;this.outputsProvider=this.cell.outputArea.widgets.map((e=>new se.GenericSearchProvider(e)));if(this.isActive&&this.query&&((n=this.filters)===null||n===void 0?void 0:n.output)!==false){await Promise.all([this.outputsProvider.map((e=>{void e.startQuery(this.query)}))])}this._stateChanged.emit()}}class le extends re{constructor(e){super(e);this._unrenderedByHighlight=false;this.renderedProvider=new se.GenericSearchProvider(e.renderer)}async clearHighlight(){await super.clearHighlight();await this.renderedProvider.clearHighlight()}dispose(){if(this.isDisposed){return}super.dispose();this.renderedProvider.dispose()}async endQuery(){await super.endQuery();await this.renderedProvider.endQuery()}async highlightNext(e=true,t){let n=undefined;if(!this.isActive){return n}const i=this.cell;if(i.rendered&&this.matchesCount>0){this._unrenderedByHighlight=true;const e=(0,ie.signalToPromise)(i.renderedChanged);i.rendered=false;await e}n=await super.highlightNext(e,t);return n}async highlightPrevious(){let e=undefined;const t=this.cell;if(t.rendered&&this.matchesCount>0){this._unrenderedByHighlight=true;const e=(0,ie.signalToPromise)(t.renderedChanged);t.rendered=false;await e}e=await super.highlightPrevious();return e}async startQuery(e,t){await super.startQuery(e,t);const n=this.cell;if(n.rendered){this.onRenderedChanged(n,n.rendered)}n.renderedChanged.connect(this.onRenderedChanged,this)}async replaceAllMatches(e,t){if(this.model.getMetadata("editable")===false)return Promise.resolve(false);const n=await super.replaceAllMatches(e,t);if(this.cell.rendered){this.cell.update()}return n}async replaceCurrentMatch(e,t,n){if(this.model.getMetadata("editable")===false)return Promise.resolve(false);const i=await super.replaceCurrentMatch(e,t,n);return i}onRenderedChanged(e,t){var n;if(!this._unrenderedByHighlight){this.currentIndex=null}this._unrenderedByHighlight=false;if(this.isActive){if(t){void this.renderedProvider.startQuery(this.query)}else{(n=e.editor)===null||n===void 0?void 0:n.setCursorPosition({column:0,line:0});void this.renderedProvider.endQuery()}}}}function de(e){if(e.isPlaceholder()){return new re(e)}switch(e.model.type){case"code":return new ae(e);case"markdown":return new le(e);default:return new re(e)}}var ce=n(22819);var he=n(72050);var ue=n(90943);var pe=n(10553);var me=n(5592);var ge=n(34236);var fe=n(42856);var ve=n(26568);const _e="jp-CellResizeHandle";const be="jp-mod-resizedCell";class ye extends w.Widget{constructor(e){super();this.targetNode=e;this._isActive=false;this._isDragging=false;this.sizeChanged=new P.Signal(this);this.addClass(_e);this._resizer=new ve.Throttler((e=>this._resize(e)),50)}dispose(){this._resizer.dispose();super.dispose()}handleEvent(e){var t,n;switch(e.type){case"dblclick":(t=this.targetNode.parentNode)===null||t===void 0?void 0:t.childNodes.forEach((e=>{e.classList.remove(be)}));document.documentElement.style.setProperty("--jp-side-by-side-output-size",`1fr`);this._isActive=false;break;case"mousedown":this._isDragging=true;if(!this._isActive){(n=this.targetNode.parentNode)===null||n===void 0?void 0:n.childNodes.forEach((e=>{e.classList.add(be)}));this._isActive=true}window.addEventListener("mousemove",this);window.addEventListener("mouseup",this);break;case"mousemove":{if(this._isActive&&this._isDragging){void this._resizer.invoke(e)}break}case"mouseup":this._isDragging=false;window.removeEventListener("mousemove",this);window.removeEventListener("mouseup",this);break;default:break}}onAfterAttach(e){this.node.addEventListener("dblclick",this);this.node.addEventListener("mousedown",this);super.onAfterAttach(e)}onBeforeDetach(e){this.node.removeEventListener("dblclick",this);this.node.removeEventListener("mousedown",this);super.onBeforeDetach(e)}_resize(e){const{width:t,x:n}=this.targetNode.getBoundingClientRect();const i=e.clientX-n;const s=t/i-1;if(0{const i=this._inViewport!==null;const s=i&&!this._inViewport;this._scrollRequested.emit({defaultPrevented:s,scrollWithinCell:()=>{e.dispatch({effects:ce.EditorView.scrollIntoView(t,n)})}});return s}));this._editorConfig={};this._editorExtensions=[];this._inputHidden=false;this._inViewportChanged=new P.Signal(this);this._readOnly=false;this._ready=new me.PromiseDelegate;this._resizeDebouncer=new ve.Debouncer((()=>{this._displayChanged.emit()}),0);this._syncCollapse=false;this._syncEditable=false;this.addClass(we);const o=this._model=e.model;this.contentFactory=e.contentFactory;this.layout=(t=e.layout)!==null&&t!==void 0?t:new w.PanelLayout;this.translator=(n=e.translator)!==null&&n!==void 0?n:$.nullTranslator;this._editorConfig={searchWithCM:false,...e.editorConfig};this._editorExtensions=(i=e.editorExtensions)!==null&&i!==void 0?i:[];this._editorExtensions.push(this._scrollHandlerExtension);this._placeholder=true;this._inViewport=null;this.placeholder=(s=e.placeholder)!==null&&s!==void 0?s:true;o.metadataChanged.connect(this.onMetadataChanged,this)}initializeState(){this.loadCollapseState();this.loadEditableState();return this}get displayChanged(){return this._displayChanged}get inViewport(){var e;return(e=this._inViewport)!==null&&e!==void 0?e:false}set inViewport(e){if(this._inViewport!==e){this._inViewport=e;this._inViewportChanged.emit(this._inViewport)}}get inViewportChanged(){return this._inViewportChanged}get placeholder(){return this._placeholder}set placeholder(e){if(this._placeholder!==e&&e===false){this.initializeDOM();this._placeholder=e;this._ready.resolve()}}get promptNode(){if(this.placeholder){return null}if(!this._inputHidden){return this._input.promptNode}else{return this._inputPlaceholder.node.firstElementChild}}get editorWidget(){var e,t;return(t=(e=this._input)===null||e===void 0?void 0:e.editorWidget)!==null&&t!==void 0?t:null}get editor(){var e,t;return(t=(e=this._input)===null||e===void 0?void 0:e.editor)!==null&&t!==void 0?t:null}get editorConfig(){return this._editorConfig}get headings(){return new Array}get model(){return this._model}get inputArea(){return this._input}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly){return}this._readOnly=e;if(this.syncEditable){this.saveEditableState()}this.update()}isPlaceholder(){return this.placeholder}saveEditableState(){const{sharedModel:e}=this.model;const t=e.getMetadata("editable");if(this.readOnly&&t===false||!this.readOnly&&t===undefined){return}if(this.readOnly){e.setMetadata("editable",false)}else{e.deleteMetadata("editable")}}loadEditableState(){this.readOnly=this.model.sharedModel.getMetadata("editable")===false}get ready(){return this._ready.promise}setPrompt(e){return this._setPrompt(e)}_setPrompt(e){var t;this.prompt=e;(t=this._input)===null||t===void 0?void 0:t.setPrompt(e)}get inputHidden(){return this._inputHidden}set inputHidden(e){var t;if(this._inputHidden===e){return}if(!this.placeholder){const n=this._inputWrapper.layout;if(e){this._input.parent=null;if(this._inputPlaceholder){this._inputPlaceholder.text=(t=this.model.sharedModel.getSource().split("\n"))===null||t===void 0?void 0:t[0]}n.addWidget(this._inputPlaceholder)}else{this._inputPlaceholder.parent=null;n.addWidget(this._input)}}this._inputHidden=e;if(this.syncCollapse){this.saveCollapseState()}this.handleInputHidden(e)}saveCollapseState(){const e={...this.model.getMetadata("jupyter")};if(this.inputHidden&&e.source_hidden===true||!this.inputHidden&&e.source_hidden===undefined){return}if(this.inputHidden){e.source_hidden=true}else{delete e.source_hidden}if(Object.keys(e).length===0){this.model.deleteMetadata("jupyter")}else{this.model.setMetadata("jupyter",e)}}loadCollapseState(){var e;const t=(e=this.model.getMetadata("jupyter"))!==null&&e!==void 0?e:{};this.inputHidden=!!t.source_hidden}handleInputHidden(e){return}get syncCollapse(){return this._syncCollapse}set syncCollapse(e){if(this._syncCollapse===e){return}this._syncCollapse=e;if(e){this.loadCollapseState()}}get syncEditable(){return this._syncEditable}set syncEditable(e){if(this._syncEditable===e){return}this._syncEditable=e;if(e){this.loadEditableState()}}clone(){const e=this.constructor;return new e({model:this.model,contentFactory:this.contentFactory,placeholder:false,translator:this.translator})}dispose(){if(this.isDisposed){return}this._resizeDebouncer.dispose();this._input=null;this._model=null;this._inputWrapper=null;this._inputPlaceholder=null;super.dispose()}updateEditorConfig(e){this._editorConfig={...this._editorConfig,...e};if(this.editor){this.editor.setBaseOptions(this._editorConfig)}}get scrollRequested(){return this._scrollRequested}initializeDOM(){if(!this.placeholder){return}const e=this.contentFactory;const t=this._model;const n=e.createCellHeader();n.addClass(Ce);this.layout.addWidget(n);const i=this._inputWrapper=new w.Panel;i.addClass(Se);const s=new b;s.addClass(Ee);const o=this._input=new D({model:t,contentFactory:e,editorOptions:this.getEditorOptions()});o.addClass(je);i.addWidget(s);i.addWidget(o);this.layout.addWidget(i);this._inputPlaceholder=new ee({callback:()=>{this.inputHidden=!this.inputHidden},text:o.model.sharedModel.getSource().split("\n")[0],translator:this.translator});o.model.contentChanged.connect(((e,t)=>{var n;if(this._inputPlaceholder&&this.inputHidden){this._inputPlaceholder.text=(n=e.sharedModel.getSource().split("\n"))===null||n===void 0?void 0:n[0]}}));if(this.inputHidden){o.parent=null;i.layout.addWidget(this._inputPlaceholder)}const r=this.contentFactory.createCellFooter();r.addClass(xe);this.layout.addWidget(r)}getEditorOptions(){return{config:this.editorConfig,extensions:this._editorExtensions}}onBeforeAttach(e){if(this.placeholder){this.placeholder=false}}onAfterAttach(e){this.update()}onActivateRequest(e){var t;(t=this.editor)===null||t===void 0?void 0:t.focus()}onResize(e){void this._resizeDebouncer.invoke()}onUpdateRequest(e){var t,n;if(!this._model){return}if(((t=this.editor)===null||t===void 0?void 0:t.getOption("readOnly"))!==this._readOnly){(n=this.editor)===null||n===void 0?void 0:n.setOption("readOnly",this._readOnly)}}onContentChanged(){var e;if(this.inputHidden&&this._inputPlaceholder){this._inputPlaceholder.text=(e=this.model.sharedModel.getSource().split("\n"))===null||e===void 0?void 0:e[0]}}onMetadataChanged(e,t){switch(t.key){case"jupyter":if(this.syncCollapse){this.loadCollapseState()}break;case"editable":if(this.syncEditable){this.loadEditableState()}break;default:break}}}(function(e){let t;(function(e){e[e["HTML"]=0]="HTML";e[e["Markdown"]=1]="Markdown"})(t=e.HeadingType||(e.HeadingType={}));class n{constructor(e){this._editorFactory=e.editorFactory}get editorFactory(){return this._editorFactory}createCellHeader(){return new S}createCellFooter(){return new k}createInputPrompt(){return new A}createOutputPrompt(){return new R.OutputPrompt}createStdin(e){return new R.Stdin(e)}}e.ContentFactory=n})(Ve||(Ve={}));class Ue extends w.PanelLayout{onBeforeAttach(e){let t=true;const n=this.parent.node.firstElementChild;for(const i of this){if(n){if(i.node===n){t=false}else{fe.MessageLoop.sendMessage(i,e);if(t){this.parent.node.insertBefore(i.node,n)}else{this.parent.node.appendChild(i.node)}if(!this.parent.isHidden){i.setFlag(w.Widget.Flag.IsVisible)}fe.MessageLoop.sendMessage(i,w.Widget.Msg.AfterAttach)}}}}onAfterDetach(e){for(const t of this){if(!t.hasClass(ke)&&t.node.isConnected){fe.MessageLoop.sendMessage(t,w.Widget.Msg.BeforeDetach);this.parent.node.removeChild(t.node);fe.MessageLoop.sendMessage(t,e)}}}}class qe extends Ve{constructor(e){var t;super({layout:new Ue,...e,placeholder:true});this._detectCaretMovementInOuput=e=>{const t=this._inViewport!==null;const n=t&&!this._inViewport;const i=e.target;if(!i||!(i instanceof HTMLElement)){return}if(this._lastTarget){this._lastTarget.removeEventListener("selectionchange",this._lastOnCaretMovedHandler);document.removeEventListener("selectionchange",this._lastOnCaretMovedHandler)}const s=()=>{this._scrollRequested.emit({scrollWithinCell:({scroller:e})=>{u.ElementExt.scrollIntoViewIfNeeded(e,i)},defaultPrevented:n})};this._lastTarget=i;this._lastOnCaretMovedHandler=s;i.addEventListener("selectionchange",s,{once:true});document.addEventListener("selectionchange",s,{once:true});setTimeout((()=>{i.removeEventListener("selectionchange",s);document.removeEventListener("selectionchange",s)}),250)};this._headingsCache=null;this._outputHidden=false;this._outputWrapper=null;this._outputPlaceholder=null;this._syncScrolled=false;this._lastTarget=null;this._lastOutputHeight="";this.addClass(De);const n=this.translator.load("jupyterlab");const i=this._rendermime=e.rendermime;const s=this.contentFactory;const o=this.model;this.maxNumberOutputs=e.maxNumberOutputs;const r=o.outputs.length===0?n.__("Code Cell Content"):n.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r);const a=this._output=new R.OutputArea({model:this.model.outputs,rendermime:i,contentFactory:s,maxNumberOutputs:this.maxNumberOutputs,translator:this.translator,promptOverlay:true,inputHistoryScope:e.inputHistoryScope,showInputPlaceholder:e.showInputPlaceholder});a.node.addEventListener("keydown",this._detectCaretMovementInOuput);a.addClass(Ie);a.toggleScrolling.connect((()=>{this.outputsScrolled=!this.outputsScrolled}));a.initialize.connect((()=>{this.updatePromptOverlayIcon()}));this.placeholder=(t=e.placeholder)!==null&&t!==void 0?t:true;o.outputs.changed.connect(this.onOutputChanged,this);o.outputs.stateChanged.connect(this.onOutputChanged,this);o.stateChanged.connect(this.onStateChanged,this)}initializeDOM(){if(!this.placeholder){return}super.initializeDOM();this._updatePrompt();const e=this._outputWrapper=new w.Panel;e.addClass(ke);const t=new y;t.addClass(Te);e.addWidget(t);if(this.model.outputs.length===0){this.addClass(Fe)}this._output.outputLengthChanged.connect(this._outputLengthHandler,this);e.addWidget(this._output);const n=this.layout;const i=new ye(this.node);i.sizeChanged.connect(this._sizeChangedHandler,this);n.insertWidget(n.widgets.length-1,i);n.insertWidget(n.widgets.length-1,e);if(this.model.isDirty){this.addClass(Me)}this._outputPlaceholder=new te({callback:()=>{this.outputHidden=!this.outputHidden},text:this.getOutputPlaceholderText(),translator:this.translator});const s=e.layout;if(this.outputHidden){s.removeWidget(this._output);s.addWidget(this._outputPlaceholder);if(this.inputHidden&&!e.isHidden){this._outputWrapper.hide()}}const o=this.translator.load("jupyterlab");const r=this.model.outputs.length===0?o.__("Code Cell Content"):o.__("Code Cell Content with Output");this.node.setAttribute("aria-label",r)}getOutputPlaceholderText(){var e;const t=this.model.outputs.get(0);const n=t===null||t===void 0?void 0:t.data;if(!n){return undefined}const i=["text/html","image/svg+xml","application/pdf","text/markdown","text/plain","application/vnd.jupyter.stderr","application/vnd.jupyter.stdout","text"];const s=i.find((e=>{const n=t.data[e];return(Array.isArray(n)?typeof n[0]:typeof n)==="string"}));const o=t.data[s!==null&&s!==void 0?s:""];if(o!==undefined){return(e=Array.isArray(o)?o:o===null||o===void 0?void 0:o.split("\n"))===null||e===void 0?void 0:e.find((e=>e!==""))}return undefined}initializeState(){super.initializeState();this.loadScrolledState();this._updatePrompt();return this}get headings(){if(!this._headingsCache){const e=[];const t=this.model.outputs;for(let n=0;n{if(!o&&pe.TableOfContentsUtils.Markdown.isMarkdown(e)){o=e}else if(!s&&pe.TableOfContentsUtils.isHTML(e)){s=e}}));if(s){let t=i.data[s];if(typeof t!=="string"){t=t.join("\n")}e.push(...pe.TableOfContentsUtils.getHTMLHeadings(this._rendermime.sanitizer.sanitize(t)).map((e=>({...e,outputIndex:n,type:Ve.HeadingType.HTML}))))}else if(o){e.push(...pe.TableOfContentsUtils.Markdown.getHeadings(i.data[o]).map((e=>({...e,outputIndex:n,type:Ve.HeadingType.Markdown}))))}}this._headingsCache=e}return[...this._headingsCache]}get outputArea(){return this._output}get outputHidden(){return this._outputHidden}set outputHidden(e){var t;if(this._outputHidden===e){return}if(!this.placeholder){const n=this._outputWrapper.layout;if(e){n.removeWidget(this._output);n.addWidget(this._outputPlaceholder);if(this.inputHidden&&!this._outputWrapper.isHidden){this._outputWrapper.hide()}if(this._outputPlaceholder){this._outputPlaceholder.text=(t=this.getOutputPlaceholderText())!==null&&t!==void 0?t:""}}else{if(this._outputWrapper.isHidden){this._outputWrapper.show()}n.removeWidget(this._outputPlaceholder);n.addWidget(this._output)}}this._outputHidden=e;if(this.syncCollapse){this.saveCollapseState()}}saveCollapseState(){this.model.sharedModel.transact((()=>{super.saveCollapseState();const e=this.model.getMetadata("collapsed");if(this.outputHidden&&e===true||!this.outputHidden&&e===undefined){return}if(this.outputHidden){this.model.setMetadata("collapsed",true)}else{this.model.deleteMetadata("collapsed")}}),false,"silent-change")}loadCollapseState(){super.loadCollapseState();this.outputHidden=!!this.model.getMetadata("collapsed")}get outputsScrolled(){return this._outputsScrolled}set outputsScrolled(e){this.toggleClass("jp-mod-outputsScrolled",e);this._outputsScrolled=e;if(this.syncScrolled){this.saveScrolledState()}this.updatePromptOverlayIcon()}updatePromptOverlayIcon(){var e;const t=he.DOMUtils.findElement(this.node,"jp-OutputArea-promptOverlay");if(!t){return}const n=16+4+4;if(t.clientHeight<=n){(e=t.firstChild)===null||e===void 0?void 0:e.remove();return}let i;if(this._outputsScrolled){h.expandIcon.element({container:t});i="Expand Output"}else{h.collapseIcon.element({container:t});i="Collapse Output"}const s=this.translator.load("jupyterlab");t.title=s.__(i)}saveScrolledState(){const e=this.model.getMetadata("scrolled");if(this.outputsScrolled&&e===true||!this.outputsScrolled&&e===undefined){return}if(this.outputsScrolled){this.model.setMetadata("scrolled",true)}else{this.outputArea.node.style.height="";this.model.deleteMetadata("scrolled")}}loadScrolledState(){if(this.model.getMetadata("scrolled")==="auto"){this.outputsScrolled=false}else{this.outputsScrolled=!!this.model.getMetadata("scrolled")}}get syncScrolled(){return this._syncScrolled}set syncScrolled(e){if(this._syncScrolled===e){return}this._syncScrolled=e;if(e){this.loadScrolledState()}}handleInputHidden(e){if(this.placeholder){return}if(!e&&this._outputWrapper.isHidden){this._outputWrapper.show()}else if(e&&!this._outputWrapper.isHidden&&this._outputHidden){this._outputWrapper.hide()}}clone(){const e=this.constructor;return new e({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:false,translator:this.translator})}cloneOutputArea(){return new R.SimplifiedOutputArea({model:this.model.outputs,contentFactory:this.contentFactory,rendermime:this._rendermime})}dispose(){if(this.isDisposed){return}this._output.outputLengthChanged.disconnect(this._outputLengthHandler,this);this._output.node.removeEventListener("keydown",this._detectCaretMovementInOuput);this._rendermime=null;this._output=null;this._outputWrapper=null;this._outputPlaceholder=null;super.dispose()}onStateChanged(e,t){switch(t.name){case"executionCount":if(t.newValue!==null){this.model.executionState="idle"}this._updatePrompt();break;case"executionState":this._updatePrompt();break;case"isDirty":if(e.isDirty){this.addClass(Me)}else{this.removeClass(Me)}break;default:break}}onOutputChanged(){var e;this._headingsCache=null;if(this._outputPlaceholder&&this.outputHidden){this._outputPlaceholder.text=(e=this.getOutputPlaceholderText())!==null&&e!==void 0?e:""}this.updatePromptOverlayIcon();const t=this.outputArea.node.style.height;if(this.model.outputs.length===0&&t!==""){this._lastOutputHeight=t;this.outputArea.node.style.height=""}else if(this.model.outputs.length>0&&t===""){this.outputArea.node.style.height=this._lastOutputHeight}}onMetadataChanged(e,t){switch(t.key){case"scrolled":if(this.syncScrolled){this.loadScrolledState()}break;case"collapsed":if(this.syncCollapse){this.loadCollapseState()}break;default:break}super.onMetadataChanged(e,t)}_updatePrompt(){let e;if(this.model.executionState=="running"){e="*"}else{e=`${this.model.executionCount||""}`}this._setPrompt(e)}_outputLengthHandler(e,t){const n=t===0?true:false;this.toggleClass(Fe,n);const i=this.translator.load("jupyterlab");const s=n?i.__("Code Cell Content"):i.__("Code Cell Content with Output");this.node.setAttribute("aria-label",s)}_sizeChangedHandler(e){this._displayChanged.emit()}}(function(e){async function t(e,t,n){var i;const s=e.model;const o=s.sharedModel.getSource();if(!o.trim()||!((i=t.session)===null||i===void 0?void 0:i.kernel)){s.sharedModel.transact((()=>{s.clearExecution()}),false);return}const r={cellId:s.sharedModel.getId()};n={...s.metadata,...n,...r};const{recordTiming:a}=n;s.sharedModel.transact((()=>{s.clearExecution();e.outputHidden=false}),false,"silent-change");s.executionState="running";s.trusted=true;let l;try{const i=R.OutputArea.execute(o,e.outputArea,t,n);if(a){const t=e=>{let t;switch(e.header.msg_type){case"status":t=`status.${e.content.execution_state}`;break;case"execute_input":t="execute_input";break;default:return true}const n=e.header.date||(new Date).toISOString();const i=Object.assign({},s.getMetadata("execution"));i[`iopub.${t}`]=n;s.setMetadata("execution",i);return true};e.outputArea.future.registerMessageHook(t)}else{s.deleteMetadata("execution")}l=e.outputArea.future;const r=await i;s.executionCount=r.content.execution_count;if(a){const e=Object.assign({},s.getMetadata("execution"));const t=r.metadata.started;if(t){e["shell.execute_reply.started"]=t}const n=r.header.date;e["shell.execute_reply"]=n||(new Date).toISOString();s.setMetadata("execution",e)}return r}catch(d){if(l&&!e.isDisposed&&e.outputArea.future===l){e.model.executionState="idle";if(a&&l.isDisposed){const e=Object.assign({},s.getMetadata("execution"));e["execution_failed"]=(new Date).toISOString();s.setMetadata("execution",e)}}throw d}}e.execute=t})(qe||(qe={}));class $e extends Ve{handleEvent(e){switch(e.type){case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:break}}getEditorOptions(){var e,t;const n=(e=super.getEditorOptions())!==null&&e!==void 0?e:{};n.extensions=[...(t=n.extensions)!==null&&t!==void 0?t:[],ce.EditorView.domEventHandlers({dragenter:e=>{e.preventDefault()},dragover:e=>{e.preventDefault()},drop:e=>{this._evtNativeDrop(e)},paste:e=>{this._evtPaste(e)}})];return n}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragover",this);t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragover",this);t.removeEventListener("lm-drop",this);super.onBeforeDetach(e)}_evtDragOver(e){const t=(0,ge.some)(ue.imageRendererFactory.mimeTypes,(t=>{if(!e.mimeData.hasData(We)){return false}const n=e.mimeData.getData(We);return n.model.mimetype===t}));if(!t){return}e.preventDefault();e.stopPropagation();e.dropAction=e.proposedAction}_evtPaste(e){var t;const n=(t=this.model.getMetadata("editable"))!==null&&t!==void 0?t:true;if(e.clipboardData&&n){const t=e.clipboardData.items;for(let n=0;n{var t,n;(n=(t=this.editor).replaceSelection)===null||n===void 0?void 0:n.call(t,e.replace(/\r\n/g,"\n").replace(/\r/g,"\n"))}))}this._attachFiles(e.clipboardData.items)}}e.preventDefault()}_evtNativeDrop(e){if(e.dataTransfer){this._attachFiles(e.dataTransfer.items)}e.preventDefault()}_evtDrop(e){const t=e.mimeData.types().filter((t=>{if(t===We){const t=e.mimeData.getData(We);return ue.imageRendererFactory.mimeTypes.indexOf(t.model.mimetype)!==-1}return ue.imageRendererFactory.mimeTypes.indexOf(t)!==-1}));if(t.length===0){return}e.preventDefault();e.stopPropagation();if(e.proposedAction==="none"){e.dropAction="none";return}e.dropAction="copy";for(const n of t){if(n===We){const{model:t,withContent:n}=e.mimeData.getData(We);if(t.type==="file"){const e=this._generateURI(t.name);this.updateCellSourceWithAttachment(t.name,e);void n().then((t=>{this.model.attachments.set(e,{[t.mimetype]:t.content})}))}}else{const t=this._generateURI();this.model.attachments.set(t,{[n]:e.mimeData.getData(n)});this.updateCellSourceWithAttachment(t,t)}}}_attachFiles(e){for(let t=0;t{const{href:i,protocol:s}=ie.URLExt.parse(t.result);if(s!=="data:"){return}const o=/([\w+\/\+]+)?(?:;(charset=[\w\d-]*|base64))?,(.*)/;const r=o.exec(i);if(!r||r.length!==4){return}const a=r[1];const l=r[3];const d={[a]:l};const c=this._generateURI(e.name);if(a.startsWith("image/")){this.model.attachments.set(c,d);this.updateCellSourceWithAttachment(e.name,c)}};t.onerror=t=>{console.error(`Failed to attach ${e.name}`+t)};t.readAsDataURL(e)}_generateURI(e=""){const t=e.lastIndexOf(".");return t!==-1?me.UUID.uuid4().concat(e.substring(t)):me.UUID.uuid4()}}class Ke extends $e{constructor(e){var t,n,i,s;super({...e,placeholder:true});this._headingsCache=null;this._headingCollapsedChanged=new P.Signal(this);this._prevText="";this._rendered=true;this._renderedChanged=new P.Signal(this);this._showEditorForReadOnlyMarkdown=true;this.addClass(Ae);this.model.contentChanged.connect(this.onContentChanged,this);const o=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",o.__("Markdown Cell Content"));this._rendermime=e.rendermime.clone({resolver:new L.AttachmentsResolver({parent:(t=e.rendermime.resolver)!==null&&t!==void 0?t:undefined,model:this.model.attachments})});this._renderer=this._rendermime.createRenderer("text/markdown");this._renderer.addClass(Pe);this._headingCollapsed=(n=this.model.getMetadata(Le))!==null&&n!==void 0?n:false;this._showEditorForReadOnlyMarkdown=(i=e.showEditorForReadOnlyMarkdown)!==null&&i!==void 0?i:Ke.defaultShowEditorForReadOnlyMarkdown;this.placeholder=(s=e.placeholder)!==null&&s!==void 0?s:true;this._monitor=new ie.ActivityMonitor({signal:this.model.contentChanged,timeout:He});this.ready.then((()=>{if(this.isDisposed){return}this._monitor.activityStopped.connect((()=>{if(this._rendered){this.update()}}),this)})).catch((e=>{console.error("Failed to be ready",e)}))}get headingInfo(){const e=this.headings;if(e.length>0){const{text:t,level:n}=e.reduce(((e,t)=>e.level<=t.level?e:t),e[0]);return{text:t,level:n}}else{return{text:"",level:-1}}}get headings(){if(!this._headingsCache){const e=pe.TableOfContentsUtils.Markdown.getHeadings(this.model.sharedModel.getSource());this._headingsCache=e.map((e=>({...e,type:Ve.HeadingType.Markdown})))}return[...this._headingsCache]}get headingCollapsed(){return this._headingCollapsed}set headingCollapsed(e){var t;if(this._headingCollapsed!==e){this._headingCollapsed=e;if(e){this.model.setMetadata(Le,e)}else if(this.model.getMetadata(Le)!=="undefined"){this.model.deleteMetadata(Le)}const n=(t=this.inputArea)===null||t===void 0?void 0:t.promptNode.getElementsByClassName(Re)[0];if(n){if(e){n.classList.add("jp-mod-collapsed")}else{n.classList.remove("jp-mod-collapsed")}}this.renderCollapseButtons(this._renderer);this._headingCollapsedChanged.emit(this._headingCollapsed)}}get numberChildNodes(){return this._numberChildNodes}set numberChildNodes(e){this._numberChildNodes=e;this.renderCollapseButtons(this._renderer)}get headingCollapsedChanged(){return this._headingCollapsedChanged}get rendered(){return this._rendered}set rendered(e){if(this.readOnly&&this._showEditorForReadOnlyMarkdown===false){e=true}if(e===this._rendered){return}this._rendered=e;this._handleRendered().then((()=>{this._displayChanged.emit();this._renderedChanged.emit(this._rendered)})).catch((e=>{console.error("Failed to render",e)}))}get renderedChanged(){return this._renderedChanged}get showEditorForReadOnly(){return this._showEditorForReadOnlyMarkdown}set showEditorForReadOnly(e){this._showEditorForReadOnlyMarkdown=e;if(e===false){this.rendered=true}}get renderer(){return this._renderer}dispose(){if(this.isDisposed){return}this._monitor.dispose();super.dispose()}initializeDOM(){if(!this.placeholder){return}super.initializeDOM();this.renderCollapseButtons(this._renderer);this._handleRendered().catch((e=>{console.error("Failed to render",e)}))}maybeCreateCollapseButton(){var e;const{level:t}=this.headingInfo;if(t>0&&((e=this.inputArea)===null||e===void 0?void 0:e.promptNode.getElementsByClassName(Re).length)==0){let e=this.inputArea.promptNode.appendChild(document.createElement("button"));e.className=`jp-Button ${Re}`;e.setAttribute("data-heading-level",t.toString());if(this._headingCollapsed){e.classList.add("jp-mod-collapsed")}else{e.classList.remove("jp-mod-collapsed")}e.onclick=e=>{this.headingCollapsed=!this.headingCollapsed}}}maybeCreateOrUpdateExpandButton(){const e=this.node.getElementsByClassName(Ne);let t=this.translator.load("jupyterlab");let n=t._n("%1 cell hidden","%1 cells hidden",this._numberChildNodes);let i=this.headingCollapsed&&this._numberChildNodes>0&&e.length==0;if(i){const e=document.createElement("button");e.className=`jp-mod-minimal jp-Button ${Ne}`;h.addIcon.render(e);const t=document.createElement("div");t.textContent=n;e.appendChild(t);e.onclick=()=>{this.headingCollapsed=false};this.node.appendChild(e)}let s=this.headingCollapsed&&this._numberChildNodes>0&&e.length==1;if(s){e[0].childNodes[1].textContent=n}let o=!(this.headingCollapsed&&this._numberChildNodes>0);if(o){for(const t of e){this.node.removeChild(t)}}}onContentChanged(){super.onContentChanged();this._headingsCache=null}renderCollapseButtons(e){this.node.classList.toggle(Le,this._headingCollapsed);this.maybeCreateCollapseButton();this.maybeCreateOrUpdateExpandButton()}renderInput(e){this.addClass(Be);if(!this.placeholder&&!this.isDisposed){this.renderCollapseButtons(e);this.inputArea.renderInput(e)}}showEditor(){this.removeClass(Be);if(!this.placeholder&&!this.isDisposed){this.inputArea.showEditor();let e=(this.model.sharedModel.getSource().match(/^#+/g)||[""])[0].length;if(e>0){this.inputArea.editor.setCursorPosition({column:e+1,line:0},{scroll:false})}}}onUpdateRequest(e){this._handleRendered().catch((e=>{console.error("Failed to render",e)}));super.onUpdateRequest(e)}updateCellSourceWithAttachment(e,t){var n,i;const s=`![${e}](attachment:${t!==null&&t!==void 0?t:e})`;(i=(n=this.editor)===null||n===void 0?void 0:n.replaceSelection)===null||i===void 0?void 0:i.call(n,s)}async _handleRendered(){if(!this._rendered){this.showEditor()}else{await this._updateRenderedInput();if(this._rendered){this.renderInput(this._renderer)}}}_updateRenderedInput(){if(this.placeholder){return Promise.resolve()}const e=this.model;const t=e&&e.sharedModel.getSource()||ze;if(t!==this._prevText){const e=new ue.MimeModel({data:{"text/markdown":t}});this._prevText=t;return this._renderer.renderModel(e)}return Promise.resolve()}clone(){const e=this.constructor;return new e({model:this.model,contentFactory:this.contentFactory,rendermime:this._rendermime,placeholder:false,translator:this.translator})}}(function(e){e.defaultShowEditorForReadOnlyMarkdown=true})(Ke||(Ke={}));class Je extends Ve{constructor(e){super(e);this.addClass(Oe);const t=this.translator.load("jupyterlab");this.node.setAttribute("aria-label",t.__("Raw Cell Content"))}clone(){const e=this.constructor;return new e({model:this.model,contentFactory:this.contentFactory,placeholder:false,translator:this.translator})}}},53377:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(5893);var a=n(38457);var l=n(17325);var d=n(19562);var c=n(23359);var h=n(39063);var u=n(1649);var p=n(66731);var m=n(85072);var g=n.n(m);var f=n(97825);var v=n.n(f);var _=n(77659);var b=n.n(_);var y=n(55056);var w=n.n(y);var C=n(10540);var x=n.n(C);var S=n(41113);var k=n.n(S);var j=n(55717);var I={};I.styleTagTransform=k();I.setAttributes=w();I.insert=b().bind(null,"head");I.domAPI=v();I.insertStyleElement=x();var E=g()(j.A,I);const T=j.A&&j.A.locals?j.A.locals:undefined},28211:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>_});var i=n(54281);var s=n(44914);var o=n.n(s);var r=n(66127);var a=n(34236);var l=n(61927);const d="jp-CellTags";const c="jp-CellTags-Tag";const h="jp-CellTags-Applied";const u="jp-CellTags-Unapplied";const p="jp-CellTags-Holder";const m="jp-CellTags-Add";const g="jp-CellTags-Empty";class f{constructor(e,t){this._tracker=e;this._translator=t||l.nullTranslator;this._trans=this._translator.load("jupyterlab");this._editing=false}addTag(e,t){const n=e.formData;if(t&&!n.includes(t)){n.push(t);e.formContext.updateMetadata({[e.name]:n},true)}}pullTags(){var e,t;const n=(e=this._tracker)===null||e===void 0?void 0:e.currentWidget;const i=(t=n===null||n===void 0?void 0:n.model)===null||t===void 0?void 0:t.cells;if(i===undefined){return[]}const s=(0,a.reduce)(i,((e,t)=>{var n;const i=(n=t.getMetadata("tags"))!==null&&n!==void 0?n:[];return[...e,...i]}),[]);return[...new Set(s)].filter((e=>e!==""))}_emptyAddTag(e){e.value="";e.style.width="";e.classList.add(g)}_onAddTagKeyDown(e,t){const n=t.target;if(t.ctrlKey)return;if(t.key==="Enter"){this.addTag(e,n.value)}else if(t.key==="Escape"){this._emptyAddTag(n)}}_onAddTagFocus(e){if(!this._editing){e.target.blur()}}_onAddTagBlur(e){if(this._editing){this._editing=false;this._emptyAddTag(e)}}_onChange(e){if(!e.target.value){this._emptyAddTag(e.target)}else{e.target.classList.remove(g);const t=document.createElement("span");t.className=m;t.textContent=e.target.value;document.body.appendChild(t);e.target.style.setProperty("width",`calc(${t.getBoundingClientRect().width}px + var(--jp-add-tag-extra-width))`);document.body.removeChild(t)}}_onAddTagClick(e,t){const n=t.target.closest("div");const i=n===null||n===void 0?void 0:n.childNodes[0];if(!this._editing){this._editing=true;i.value="";i.focus()}else if(t.target!==i){this.addTag(e,i.value)}t.preventDefault()}_onTagClick(e,t){const n=e.formData;if(n.includes(t)){n.splice(n.indexOf(t),1)}else{n.push(t)}e.formContext.updateMetadata({[e.name]:n},true)}render(e){const t=this.pullTags();return o().createElement("div",{className:d},o().createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},"Cell Tags"),t&&t.map(((t,n)=>o().createElement("div",{key:n,className:`${c} ${e.formData.includes(t)?h:u}`,onClick:()=>this._onTagClick(e,t)},o().createElement("div",{className:p},o().createElement("span",null,t),e.formData.includes(t)&&o().createElement(r.LabIcon.resolveReact,{icon:r.checkIcon,tag:"span",elementPosition:"center",height:"18px",width:"18px",marginLeft:"5px",marginRight:"-3px"}))))),o().createElement("div",{className:`${c} ${u}`},o().createElement("div",{className:p,onMouseDown:t=>this._onAddTagClick(e,t)},o().createElement("input",{className:`${m} ${g}`,type:"text",placeholder:this._trans.__("Add Tag"),onKeyDown:t=>this._onAddTagKeyDown(e,t),onFocus:e=>this._onAddTagFocus(e),onBlur:e=>this._onAddTagBlur(e.target),onChange:e=>{this._onChange(e)}}),o().createElement(r.LabIcon.resolveReact,{icon:r.addIcon,tag:"span",height:"18px",width:"18px",className:p}))))}}const v={id:"@jupyterlab/celltags-extension:plugin",description:"Adds the cell tags editor.",autoStart:true,requires:[i.INotebookTracker],optional:[r.IFormRendererRegistry],activate:(e,t,n)=>{if(n){const e={fieldRenderer:e=>new f(t).render(e)};n.addRenderer("@jupyterlab/celltags-extension:plugin.renderer",e)}}};const _=[v]},11114:(e,t,n)=>{"use strict";var i=n(40662);var s=n(3579);var o=n(28006);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(96415);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},32069:(e,t,n)=>{"use strict";n.r(t);n.d(t,{COMPLETER_ACTIVE_CLASS:()=>k,COMPLETER_ENABLED_CLASS:()=>S,COMPLETER_LINE_BEGINNING_CLASS:()=>j,CodeEditor:()=>a,CodeEditorWrapper:()=>P,CodeViewerWidget:()=>R,IEditorMimeTypeService:()=>r,IEditorServices:()=>I,IPositionModel:()=>E,JSONEditor:()=>f,LineCol:()=>x});var i=n(95917);var s=n(68148);var o=n(2336);var r;(function(e){e.defaultMimeType="text/plain"})(r||(r={}));var a;(function(e){class t{constructor(e={}){var t,n;this.standaloneModel=false;this._isDisposed=false;this._selections=new s.ObservableMap;this._mimeType=r.defaultMimeType;this._mimeTypeChanged=new o.Signal(this);this.standaloneModel=typeof e.sharedModel==="undefined";this.sharedModel=(t=e.sharedModel)!==null&&t!==void 0?t:new i.YFile;this._mimeType=(n=e.mimeType)!==null&&n!==void 0?n:r.defaultMimeType}get mimeTypeChanged(){return this._mimeTypeChanged}get selections(){return this._selections}get mimeType(){return this._mimeType}set mimeType(e){const t=this.mimeType;if(t===e){return}this._mimeType=e;this._mimeTypeChanged.emit({name:"mimeType",oldValue:t,newValue:e})}get isDisposed(){return this._isDisposed}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._selections.dispose();if(this.standaloneModel){this.sharedModel.dispose()}o.Signal.clearData(this)}}e.Model=t})(a||(a={}));var l=n(61927);var d=n(66127);var c=n(5592);var h=n(1143);const u="jp-JSONEditor";const p="jp-mod-error";const m="jp-JSONEditor-host";const g="jp-JSONEditor-header";class f extends h.Widget{constructor(e){super();this._dataDirty=false;this._inputDirty=false;this._source=null;this._originalValue=c.JSONExt.emptyObject;this._changeGuard=false;this.translator=e.translator||l.nullTranslator;this._trans=this.translator.load("jupyterlab");this.addClass(u);this.headerNode=document.createElement("div");this.headerNode.className=g;this.revertButtonNode=d.undoIcon.element({tag:"span",title:this._trans.__("Revert changes to data")});this.commitButtonNode=d.checkIcon.element({tag:"span",title:this._trans.__("Commit changes to data"),marginLeft:"8px"});this.editorHostNode=document.createElement("div");this.editorHostNode.className=m;this.headerNode.appendChild(this.revertButtonNode);this.headerNode.appendChild(this.commitButtonNode);this.node.appendChild(this.headerNode);this.node.appendChild(this.editorHostNode);const t=new a.Model({mimeType:"application/json"});t.sharedModel.changed.connect(this._onModelChanged,this);this.model=t;this.editor=e.editorFactory({host:this.editorHostNode,model:t,config:{readOnly:true}})}get source(){return this._source}set source(e){if(this._source===e){return}if(this._source){this._source.changed.disconnect(this._onSourceChanged,this)}this._source=e;this.editor.setOption("readOnly",e===null);if(e){e.changed.connect(this._onSourceChanged,this)}this._setValue()}get isDirty(){return this._dataDirty||this._inputDirty}dispose(){var e;if(this.isDisposed){return}(e=this.source)===null||e===void 0?void 0:e.dispose();this.model.dispose();this.editor.dispose();super.dispose()}handleEvent(e){switch(e.type){case"blur":this._evtBlur(e);break;case"click":this._evtClick(e);break;default:break}}onAfterAttach(e){const t=this.editorHostNode;t.addEventListener("blur",this,true);t.addEventListener("click",this,true);this.revertButtonNode.hidden=true;this.commitButtonNode.hidden=true;this.headerNode.addEventListener("click",this)}onBeforeDetach(e){const t=this.editorHostNode;t.removeEventListener("blur",this,true);t.removeEventListener("click",this,true);this.headerNode.removeEventListener("click",this)}_onSourceChanged(e,t){if(this._changeGuard){return}if(this._inputDirty||this.editor.hasFocus()){this._dataDirty=true;return}this._setValue()}_onModelChanged(e,t){if(t.sourceChange){let e=true;try{const e=JSON.parse(this.editor.model.sharedModel.getSource());this.removeClass(p);this._inputDirty=!this._changeGuard&&!c.JSONExt.deepEqual(e,this._originalValue)}catch(n){this.addClass(p);this._inputDirty=true;e=false}this.revertButtonNode.hidden=!this._inputDirty;this.commitButtonNode.hidden=!e||!this._inputDirty}}_evtBlur(e){if(!this._inputDirty&&this._dataDirty){this._setValue()}}_evtClick(e){const t=e.target;if(this.revertButtonNode.contains(t)){this._setValue()}else if(this.commitButtonNode.contains(t)){if(!this.commitButtonNode.hidden&&!this.hasClass(p)){this._changeGuard=true;this._mergeContent();this._changeGuard=false;this._setValue()}}else if(this.editorHostNode.contains(t)){this.editor.focus()}}_mergeContent(){const e=this.editor.model;const t=this._originalValue;const n=JSON.parse(e.sharedModel.getSource());const i=this.source;if(!i){return}for(const s in n){if(!c.JSONExt.deepEqual(n[s],t[s]||null)){i.set(s,n[s])}}for(const s in t){if(!(s in n)){i.delete(s)}}}_setValue(){this._dataDirty=false;this._inputDirty=false;this.revertButtonNode.hidden=true;this.commitButtonNode.hidden=true;this.removeClass(p);const e=this.editor.model;const t=this._source?this._source.toJSON():{};this._changeGuard=true;if(t===void 0){e.sharedModel.setSource(this._trans.__("No data!"));this._originalValue=c.JSONExt.emptyObject}else{const n=JSON.stringify(t,null,4);e.sharedModel.setSource(n);this._originalValue=t;if(n.length>1&&n[0]==="{"){this.editor.setCursorPosition({line:0,column:1})}}this._changeGuard=false;this.commitButtonNode.hidden=true;this.revertButtonNode.hidden=true}}var v=n(66987);var _=n(44914);var b=n.n(_);var y=n(72050);class w extends b().Component{constructor(e){super(e);this._handleChange=e=>{this.setState({value:e.currentTarget.value})};this._handleSubmit=e=>{e.preventDefault();const t=parseInt(this._textInput.value,10);if(!isNaN(t)&&isFinite(t)&&1<=t&&t<=this.props.maxLine){this.props.handleSubmit(t)}return false};this._handleFocus=()=>{this.setState({hasFocus:true})};this._handleBlur=()=>{this.setState({hasFocus:false})};this._textInput=null;this.translator=e.translator||l.nullTranslator;this._trans=this.translator.load("jupyterlab");this.state={value:"",hasFocus:false,textInputId:y.DOMUtils.createDomID()+"-line-number-input"}}componentDidMount(){this._textInput.focus()}render(){return b().createElement("div",{className:"jp-lineFormSearch"},b().createElement("form",{name:"lineColumnForm",onSubmit:this._handleSubmit,noValidate:true},b().createElement("div",{className:(0,d.classes)("jp-lineFormWrapper","lm-lineForm-wrapper",this.state.hasFocus?"jp-lineFormWrapperFocusWithin":undefined)},b().createElement("input",{type:"text",id:this.state.textInputId,className:"jp-lineFormInput",onChange:this._handleChange,onFocus:this._handleFocus,onBlur:this._handleBlur,value:this.state.value,ref:e=>{this._textInput=e}}),b().createElement("div",{className:"jp-baseLineForm jp-lineFormButtonContainer"},b().createElement(d.lineFormIcon.react,{className:"jp-baseLineForm jp-lineFormButtonIcon",elementPosition:"center"}),b().createElement("input",{type:"submit",className:"jp-baseLineForm jp-lineFormButton",value:""}))),b().createElement("label",{className:"jp-lineFormCaption",htmlFor:this.state.textInputId},this._trans.__("Go to line number between 1 and %1",this.props.maxLine))))}}function C(e){const t=e.translator||l.nullTranslator;const n=t.load("jupyterlab");const i=t=>{if(t.key==="Enter"||t.key==="Spacebar"||t.key===" "){t.preventDefault();t.stopPropagation();e.handleClick()}else{return}};return b().createElement(v.TextItem,{role:"button","aria-haspopup":true,onClick:e.handleClick,source:n.__("Ln %1, Col %2",e.line,e.column),title:n.__("Go to line number…"),tabIndex:0,onKeyDown:i})}class x extends d.VDomRenderer{constructor(e){super(new x.Model);this._popup=null;this.addClass("jp-mod-highlighted");this.translator=e||l.nullTranslator}render(){if(this.model===null){return null}else{return b().createElement(C,{line:this.model.line,column:this.model.column,translator:this.translator,handleClick:()=>this._handleClick()})}}_handleClick(){if(this._popup){this._popup.dispose()}const e=d.ReactWidget.create(b().createElement(w,{handleSubmit:e=>this._handleSubmit(e),currentLine:this.model.line,maxLine:this.model.editor.lineCount,translator:this.translator}));this._popup=(0,v.showPopup)({body:e,anchor:this,align:"right"})}_handleSubmit(e){this.model.editor.setCursorPosition({line:e-1,column:0});this._popup.dispose();this.model.editor.focus()}}(function(e){class t extends d.VDomModel{constructor(){super(...arguments);this._onSelectionChanged=()=>{const e=this._getAllState();const t=this.editor.getCursorPosition();this._line=t.line+1;this._column=t.column+1;this._triggerChange(e,this._getAllState())};this._line=1;this._column=1;this._editor=null}get editor(){return this._editor}set editor(e){var t;const n=this._editor;if((t=n===null||n===void 0?void 0:n.model)===null||t===void 0?void 0:t.selections){n.model.selections.changed.disconnect(this._onSelectionChanged)}const i=this._getAllState();this._editor=e;if(!this._editor){this._column=1;this._line=1}else{this._editor.model.selections.changed.connect(this._onSelectionChanged);const e=this._editor.getCursorPosition();this._column=e.column+1;this._line=e.line+1}this._triggerChange(i,this._getAllState())}get line(){return this._line}get column(){return this._column}_getAllState(){return[this._line,this._column]}_triggerChange(e,t){if(e[0]!==t[0]||e[1]!==t[1]){this.stateChanged.emit(void 0)}}}e.Model=t})(x||(x={}));const S="jp-mod-completer-enabled";const k="jp-mod-completer-active";const j="jp-mod-at-line-beginning";const I=new c.Token("@jupyterlab/codeeditor:IEditorServices",`A service for the text editor provider\n for the application. Use this to create new text editors and host them in your\n UI elements.`);const E=new c.Token("@jupyterlab/codeeditor:IPositionModel",`A service to handle an code editor cursor position.`);const T="jp-mod-has-primary-selection";const M="jp-mod-in-leading-whitespace";const D="jp-mod-dropTarget";const A=/^\s+$/;class P extends h.Widget{constructor(e){super();const{factory:t,model:n,editorOptions:i}=e;const s=this.editor=t({host:this.node,model:n,...i});s.model.selections.changed.connect(this._onSelectionsChanged,this)}get model(){return this.editor.model}dispose(){if(this.isDisposed){return}this.editor.dispose();super.dispose()}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:break}}onActivateRequest(e){this.editor.focus()}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("lm-dragenter",this);t.addEventListener("lm-dragleave",this);t.addEventListener("lm-dragover",this);t.addEventListener("lm-drop",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("lm-dragenter",this);t.removeEventListener("lm-dragleave",this);t.removeEventListener("lm-dragover",this);t.removeEventListener("lm-drop",this)}_onSelectionsChanged(){const{start:e,end:t}=this.editor.getSelection();if(e.column!==t.column||e.line!==t.line){this.addClass(T);this.removeClass(M)}else{this.removeClass(T);if(this.editor.getLine(t.line).slice(0,t.column).match(A)){this.addClass(M)}else{this.removeClass(M)}}}_evtDragEnter(e){if(this.editor.getOption("readOnly")===true){return}const t=L.findTextData(e.mimeData);if(t===undefined){return}e.preventDefault();e.stopPropagation();this.addClass("jp-mod-dropTarget")}_evtDragLeave(e){this.removeClass(D);if(this.editor.getOption("readOnly")===true){return}const t=L.findTextData(e.mimeData);if(t===undefined){return}e.preventDefault();e.stopPropagation()}_evtDragOver(e){this.removeClass(D);if(this.editor.getOption("readOnly")===true){return}const t=L.findTextData(e.mimeData);if(t===undefined){return}e.preventDefault();e.stopPropagation();e.dropAction="copy";this.addClass(D)}_evtDrop(e){if(this.editor.getOption("readOnly")===true){return}const t=L.findTextData(e.mimeData);if(t===undefined){return}const n={top:e.y,bottom:e.y,left:e.x,right:e.x};const i=this.editor.getPositionForCoordinate(n);if(i===null){return}this.removeClass(D);e.preventDefault();e.stopPropagation();if(e.proposedAction==="none"){e.dropAction="none";return}const s=this.editor.getOffsetAt(i);this.model.sharedModel.updateSource(s,s,t)}}var L;(function(e){function t(e){const t=e.types();const n=t.find((e=>e.indexOf("text")===0));if(n===undefined){return undefined}return e.getData(n)}e.findTextData=t})(L||(L={}));class R extends h.Widget{constructor(e){var t;super();this.model=e.model;const n=new P({factory:e.factory,model:this.model,editorOptions:{...e.editorOptions,config:{...(t=e.editorOptions)===null||t===void 0?void 0:t.config,readOnly:true}}});this.editor=n.editor;const i=this.layout=new h.StackedLayout;i.addWidget(n)}static createCodeViewer(e){const{content:t,mimeType:n,...i}=e;const s=new a.Model({mimeType:n});s.sharedModel.setSource(t);const o=new R({...i,model:s});o.disposed.connect((()=>{s.dispose()}));return o}get content(){return this.model.sharedModel.getSource()}get mimeType(){return this.model.mimeType}}},17325:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(38457);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(9534);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},21699:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>T,lineColItem:()=>I});var i=n(74991);var s=n(98335);var o=n(66987);var r=n(61927);var a=n(58285);var l=n(43370);var d;(function(e){e.deleteLine="codemirror:delete-line";e.toggleBlockComment="codemirror:toggle-block-comment";e.toggleComment="codemirror:toggle-comment";e.selectNextOccurrence="codemirror:select-next-occurrence";e.toggleTabFocusMode="codemirror:toggle-tab-focus-mode"})(d||(d={}));const c=".cm-content";const h={id:"@jupyterlab/codemirror-extension:commands",description:"Registers commands acting on selected/active CodeMirror editor.",autoStart:true,optional:[r.ITranslator],activate:(e,t)=>{t=t!==null&&t!==void 0?t:r.nullTranslator;const n=t.load("jupyterlab");const i=e=>e.classList.contains(c);const s=()=>{var t,n;const s=(t=e.contextMenuHitTest(i))!==null&&t!==void 0?t:(n=document.activeElement)===null||n===void 0?void 0:n.closest(c);if(!s){return}if(!("cmView"in s)){return}return s.cmView.view};const o=()=>!!s();e.commands.addCommand(d.deleteLine,{label:n.__("Delete the current line"),execute:()=>{const e=s();if(!e){return}(0,a.deleteLine)(e)},isEnabled:o});e.commands.addCommand(d.toggleBlockComment,{label:n.__("Toggle Block Comment"),caption:n.__("Toggles block comments in languages which support it (e.g. C, JavaScript)"),execute:()=>{const e=s();if(!e){return}(0,a.toggleBlockComment)(e)},isEnabled:o});e.commands.addCommand(d.toggleComment,{label:n.__("Toggle Comment"),execute:()=>{const e=s();if(!e){return}(0,a.toggleComment)(e)},isEnabled:o});e.commands.addCommand(d.toggleTabFocusMode,{label:n.__("Toggle Tab Focus Mode"),caption:n.__("Toggles behavior of Tab key between inserting indentation and moving to next focusable element"),execute:()=>{const e=s();if(!e){return}(0,a.toggleTabFocusMode)(e)},isEnabled:o});e.commands.addCommand(d.selectNextOccurrence,{label:n.__("Select Next Occurrence"),execute:()=>{const e=s();if(!e){return}(0,l.selectNextOccurrence)(e)},isEnabled:o})}};var u=n(4452);var p=n(90567);var m=n(15615);var g=n(66127);var f=n(5592);var v=n(41742);var _=n.n(v);var b=n(44914);var y=n.n(b);const w="@jupyterlab/codemirror-extension:plugin";const C={id:"@jupyterlab/codemirror-extension:languages",description:"Provides the CodeMirror languages registry.",provides:p.IEditorLanguageRegistry,optional:[r.ITranslator],activate:(e,t)=>{const i=new p.EditorLanguageRegistry;for(const n of p.EditorLanguageRegistry.getDefaultLanguages(t)){i.addLanguage(n)}i.addLanguage({name:"ipythongfm",mime:"text/x-ipythongfm",load:async()=>{const[e,t,s]=await Promise.all([n.e(5625).then(n.t.bind(n,95625,23)),Promise.all([n.e(1423),n.e(9329),n.e(2819),n.e(1674),n.e(6575),n.e(5145)]).then(n.bind(n,9329)),n.e(9746).then(n.bind(n,89746))]);const o=e.markdown({base:e.markdownLanguage,codeLanguages:e=>i.findBest(e),extensions:[(0,p.parseMathIPython)(u.StreamLanguage.define(s.stexMath).parser)]});return new u.LanguageSupport(o.language,[o.support,(0,p.pythonBuiltin)(t.pythonLanguage)])}});return i}};const x={id:"@jupyterlab/codemirror-extension:themes",description:"Provides the CodeMirror theme registry",provides:p.IEditorThemeRegistry,optional:[r.ITranslator],activate:(e,t)=>{const n=new p.EditorThemeRegistry;for(const i of p.EditorThemeRegistry.getDefaultThemes(t)){n.addTheme(i)}return n}};const S={id:"@jupyterlab/codemirror-extension:extensions",description:"Provides the CodeMirror extension factory registry.",provides:p.IEditorExtensionRegistry,requires:[p.IEditorThemeRegistry],optional:[r.ITranslator,m.ISettingRegistry,g.IFormRendererRegistry],activate:(e,t,n,i,s)=>{const o=new p.EditorExtensionRegistry;for(const r of p.EditorExtensionRegistry.getDefaultExtensions({themes:t,translator:n})){o.addExtension(r)}if(i){const t=e=>{var t;o.baseConfiguration=(t=e.get("defaultConfig").composite)!==null&&t!==void 0?t:{}};void Promise.all([i.load(w),e.restored]).then((([e])=>{t(e);e.changed.connect(t)}));s===null||s===void 0?void 0:s.addRenderer(`${w}.defaultConfig`,{fieldRenderer:e=>{const t=y().useMemo((()=>o.settingsSchema),[]);const i={};for(const[n,s]of Object.entries(o.defaultConfiguration)){if(typeof t[n]!=="undefined"){i[n]=s}}return y().createElement("div",{className:"jp-FormGroup-contentNormal"},y().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.schema.title),e.schema.description&&y().createElement("div",{className:"jp-FormGroup-description"},e.schema.description),y().createElement(g.FormComponent,{schema:{title:e.schema.title,description:e.schema.description,type:"object",properties:t,additionalProperties:false},validator:_(),formData:{...i,...e.formData},formContext:{defaultFormData:i},liveValidate:true,onChange:t=>{var n;const s={};for(const[e,o]of Object.entries((n=t.formData)!==null&&n!==void 0?n:{})){const t=i[e];if(t===undefined||!f.JSONExt.deepEqual(o,t)){s[e]=o}}e.onChange(s)},tagName:"div",translator:n!==null&&n!==void 0?n:r.nullTranslator}))}})}return o}};const k={id:"@jupyterlab/codemirror-extension:binding",description:"Register the CodeMirror extension factory binding the editor and the shared model.",autoStart:true,requires:[p.IEditorExtensionRegistry],activate:(e,t)=>{t.addExtension({name:"shared-model-binding",factory:e=>{var t;const n=e.model.sharedModel;return p.EditorExtensionRegistry.createImmutableExtension((0,p.ybinding)({ytext:n.ysource,undoManager:(t=n.undoManager)!==null&&t!==void 0?t:undefined}))}})}};const j={id:"@jupyterlab/codemirror-extension:services",description:"Provides the service to instantiate CodeMirror editors.",provides:s.IEditorServices,requires:[p.IEditorLanguageRegistry,p.IEditorExtensionRegistry],optional:[r.ITranslator],activate:(e,t,n,i)=>{const s=new p.CodeMirrorEditorFactory({extensions:n,languages:t,translator:i!==null&&i!==void 0?i:r.nullTranslator});return{factoryService:s,mimeTypeService:new p.CodeMirrorMimeTypeService(t)}}};const I={id:"@jupyterlab/codemirror-extension:line-col-status",description:"Provides the code editor cursor position model.",autoStart:true,requires:[r.ITranslator],optional:[i.ILabShell,o.IStatusBar],provides:s.IPositionModel,activate:(e,t,n,i)=>{const o=new s.LineCol(t);const r=new Set;if(i){i.registerStatusItem(I.id,{priority:1,item:o,align:"right",rank:2,isActive:()=>!!o.model.editor})}const a=t=>{r.add(t);if(e.shell.currentWidget){d(e.shell,{newValue:e.shell.currentWidget,oldValue:null})}};const l=()=>{d(e.shell,{oldValue:e.shell.currentWidget,newValue:e.shell.currentWidget})};function d(e,t){Promise.all([...r].map((e=>e(t.newValue)))).then((e=>{var t;o.model.editor=(t=e.filter((e=>e!==null))[0])!==null&&t!==void 0?t:null})).catch((e=>{console.error("Get editors",e)}))}if(n){n.currentChanged.connect(d)}return{addEditorProvider:a,update:l}}};const E=[h,C,x,k,S,j,I];const T=E},72508:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(17325);var a=n(3579);var l=n(23359)},68191:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CodeMirrorEditor:()=>le,CodeMirrorEditorFactory:()=>ce,CodeMirrorMimeTypeService:()=>he,CodeMirrorSearchHighlighter:()=>me,EditorExtensionRegistry:()=>J,EditorLanguageRegistry:()=>se,EditorSearchProvider:()=>pe,EditorThemeRegistry:()=>ee,ExtensionsHandler:()=>K,IEditorExtensionRegistry:()=>fe,IEditorLanguageRegistry:()=>ve,IEditorThemeRegistry:()=>_e,PythonBuiltin:()=>te,StateCommands:()=>d,YRange:()=>F,YSyncConfig:()=>z,customTheme:()=>b,jupyterEditorTheme:()=>X,jupyterHighlightStyle:()=>Q,jupyterTheme:()=>Z,parseMathIPython:()=>E,pythonBuiltin:()=>ne,rulers:()=>P,ySync:()=>V,ySyncAnnotation:()=>W,ySyncFacet:()=>H,ybinding:()=>U});var i=n(58285);var s=n(98335);const o="[data-jp-code-runner]";const r='[data-jp-interaction-mode="terminal"]';const a=".jp-CodeMirrorEditor:not(.jp-mod-has-primary-selection):not(.jp-mod-in-leading-whitespace):not(.jp-mod-completer-active)";const l=".jp-mod-editMode .jp-Cell.jp-mod-active";var d;(function(e){function t(e){var t;let n=(t=e.dom.parentElement)===null||t===void 0?void 0:t.classList;let o=n===null||n===void 0?void 0:n.contains(s.COMPLETER_ENABLED_CLASS);let r=n===null||n===void 0?void 0:n.contains(s.COMPLETER_LINE_BEGINNING_CLASS);if(o&&!r){return false}const a={state:e.state,dispatch:e.dispatch};const l=e.state.selection.main.from;const d=e.state.selection.main.to;if(l!=d){return(0,i.indentMore)(a)}const c=e.state.doc.lineAt(l);const h=e.state.doc.slice(c.from,l).toString();if(/^\s*$/.test(h)){return(0,i.indentMore)(a)}else{return(0,i.insertTab)(a)}}e.indentMoreOrInsertTab=t;function n(e){var t;if((t=e.dom.parentElement)===null||t===void 0?void 0:t.classList.contains(s.COMPLETER_ACTIVE_CLASS)){return false}if(e.dom.closest(r)){return false}const n={state:e.state,dispatch:e.dispatch};return(0,i.insertNewlineAndIndent)(n)}e.completerOrInsertNewLine=n;function d(e){if(e.dom.closest(o)){return true}return false}e.preventNewLineOnRun=d;function c(e){if(e.dom.closest(o)){return false}else{const t={state:e.state,dispatch:e.dispatch};return(0,i.insertBlankLine)(t)}}e.insertBlankLineOnRun=c;function h(e){const t={state:e.state,dispatch:e.dispatch};const n=(0,i.simplifySelection)(t);if(e.dom.closest(l)){return false}else{return n}}e.simplifySelectionAndMaybeSwitchToCommandMode=h;function u(e){if(e.dom.closest(a)){return false}return(0,i.indentLess)(e)}e.dedentIfNotLaunchingTooltip=u})(d||(d={}));var c=n(4452);var h=n(71674);var u=n(22819);var p=n(5592);var m=n(2336);var g=n(75128);var f=n(61927);const v=h.Facet.define({combine(e){return(0,h.combineConfig)(e,{fontFamily:null,fontSize:null,lineHeight:null},{fontFamily:(e,t)=>e!==null&&e!==void 0?e:t,fontSize:(e,t)=>e!==null&&e!==void 0?e:t,lineHeight:(e,t)=>e!==null&&e!==void 0?e:t})}});function _(e){const{fontFamily:t,fontSize:n,lineHeight:i}=e.state.facet(v);let s="";if(n){s+=`font-size: ${n}px !important;`}if(t){s+=`font-family: ${t} !important;`}if(i){s+=`line-height: ${i.toString()} !important`}return{style:s}}function b(e){return[v.of(e),u.EditorView.editorAttributes.of(_)]}var y=n(66575);var w=n(45145);const C="InlineMathDollar";const x="InlineMathBracket";const S="BlockMathDollar";const k="BlockMathBracket";const j={[C]:1,[x]:3,[S]:2,[k]:3};const I=Object.keys(j).reduce(((e,t)=>{e[t]={mark:`${t}Mark`,resolve:t};return e}),{});function E(e){const t=new Array;Object.keys(j).forEach((e=>{t.push({name:e,style:w.tags.emphasis},{name:`${e}Mark`,style:w.tags.processingInstruction})}));return{defineNodes:t,parseInline:[{name:S,parse(e,t,n){if(t!=36||e.char(n+1)!=36){return-1}return e.addDelimiter(I[S],n,n+j[S],true,true)}},{name:C,parse(e,t,n){if(t!=36||e.char(n+1)==36){return-1}return e.addDelimiter(I[C],n,n+j[C],true,true)}},{name:x,before:"Escape",parse(e,t,n){if(t!=92||e.char(n+1)!=92||![40,41].includes(e.char(n+2))){return-1}return e.addDelimiter(I[x],n,n+j[x],e.char(n+2)==40,e.char(n+2)==41)}},{name:k,before:"Escape",parse(e,t,n){if(t!=92||e.char(n+1)!=92||![91,93].includes(e.char(n+2))){return-1}return e.addDelimiter(I[k],n,n+j[k],e.char(n+2)==91,e.char(n+2)==93)}}],wrap:e?(0,y.parseMixed)(((t,n)=>{const i=j[t.type.name];if(i){return{parser:e,overlay:[{from:t.from+i,to:t.to-i}]}}return null})):undefined}}const T="cm-rulers";const M=u.EditorView.baseTheme({[`.${T}`]:{borderRight:"1px dotted gray",opacity:.7}});const D=h.Facet.define({combine(e){const t=e.reduce(((e,t)=>e.concat(t.filter(((n,i)=>!e.includes(n)&&i==t.lastIndexOf(n))))),[]);return t}});const A=u.ViewPlugin.fromClass(class{constructor(e){var t,n;this.rulersContainer=e.dom.appendChild(document.createElement("div"));this.rulersContainer.style.cssText=`\n position: absolute;\n left: 0;\n top: 0;\n width: 100%;\n height: 100%;\n pointer-events: none;\n overflow: hidden;\n `;const i=e.defaultCharacterWidth;const s=e.state.facet(D);const o=(n=(t=e.scrollDOM.querySelector(".cm-gutters"))===null||t===void 0?void 0:t.clientWidth)!==null&&n!==void 0?n:0;this.rulers=s.map((e=>{const t=this.rulersContainer.appendChild(document.createElement("div"));t.classList.add(T);t.style.cssText=`\n position: absolute;\n left: ${o+e*i}px;\n height: 100%;\n `;t.style.width="6px";return t}))}update(e){var t,n;const i=e.view.state.facet(D);if(e.viewportChanged||e.geometryChanged||!p.JSONExt.deepEqual(i,e.startState.facet(D))){const s=(n=(t=e.view.scrollDOM.querySelector(".cm-gutters"))===null||t===void 0?void 0:t.clientWidth)!==null&&n!==void 0?n:0;const o=e.view.defaultCharacterWidth;this.rulers.forEach(((e,t)=>{e.style.left=`${s+i[t]*o}px`}))}}destroy(){this.rulers.forEach((e=>{e.remove()}));this.rulersContainer.remove()}});function P(e){return[M,D.of(e),A]}class L{constructor(e){this.undoManager=e}}const R=h.Facet.define({combine(e){return e[e.length-1]}});class N{constructor(e){this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{if(t.has(this._syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)){e.meta.set(this,this._beforeChangeSelection)}};this._onStackItemPopped=({stackItem:e})=>{const t=e.meta.get(this);if(t){const e=this._syncConf.fromYRange(t);this._view.dispatch(this._view.state.update({selection:e,effects:[u.EditorView.scrollIntoView(e)]}));this._storeSelection()}};this._storeSelection=()=>{this._beforeChangeSelection=this._syncConf.toYRange(this._view.state.selection.main)};this._view=e;this._conf=e.state.facet(R);this._undoManager=this._conf.undoManager;this._syncConf=e.state.facet(H);this._beforeChangeSelection=null;this._undoManager.on("stack-item-added",this._onStackItemAdded);this._undoManager.on("stack-item-popped",this._onStackItemPopped);this._undoManager.addTrackedOrigin(this._syncConf)}update(e){if(e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(W)!==this._syncConf)){this._storeSelection()}}destroy(){this._undoManager.off("stack-item-added",this._onStackItemAdded);this._undoManager.off("stack-item-popped",this._onStackItemPopped);this._undoManager.removeTrackedOrigin(this._syncConf)}}const O=u.ViewPlugin.fromClass(N);var B=n(74356);class F{constructor(e,t){this.yanchor=e;this.yhead=t}toJSON(){return{yanchor:(0,B.relativePositionToJSON)(this.yanchor),yhead:(0,B.relativePositionToJSON)(this.yhead)}}static fromJSON(e){return new F((0,B.createRelativePositionFromJSON)(e.yanchor),(0,B.createRelativePositionFromJSON)(e.yhead))}}class z{constructor(e){this.ytext=e}toYPos(e,t=0){return(0,B.createRelativePositionFromTypeIndex)(this.ytext,e,t)}fromYPos(e){const t=(0,B.createAbsolutePositionFromRelativePosition)((0,B.createRelativePositionFromJSON)(e),this.ytext.doc);if(t==null||t.type!==this.ytext){throw new Error("[y-codemirror] The position you want to retrieve was created by a different document")}return{pos:t.index,assoc:t.assoc}}toYRange(e){const t=e.assoc;const n=this.toYPos(e.anchor,t);const i=this.toYPos(e.head,t);return new F(n,i)}fromYRange(e){const t=this.fromYPos(e.yanchor);const n=this.fromYPos(e.yhead);if(t.pos===n.pos){return h.EditorSelection.cursor(n.pos,n.assoc)}return h.EditorSelection.range(t.pos,n.pos)}}const H=h.Facet.define({combine(e){return e[e.length-1]}});const W=h.Annotation.define();const V=u.ViewPlugin.fromClass(class{constructor(e){this.conf=e.state.facet(H);this._observer=(t,n)=>{var i;if(n.origin!==this.conf){const n=t.delta;const s=[];let o=0;for(let e=0;e0&&e.transactions[0].annotation(W)===this.conf){return}const t=this.conf.ytext;t.doc.transact((()=>{let n=0;e.changes.iterChanges(((e,i,s,o,r)=>{const a=r.sliceString(0,r.length,"\n");if(e!==i){t.delete(e+n,i-e)}if(a.length>0){t.insert(e+n,a)}n+=a.length-(i-e)}))}),this.conf)}destroy(){this._ytext.unobserve(this._observer)}});function U({ytext:e,undoManager:t}){const n=new z(e);const i=[H.of(n),V];if(t){i.push(R.of(new L(t)),O)}return i}var q=n(43370);const $="jp-mod-readOnly";class K{constructor({baseConfiguration:e,config:t,defaultExtensions:n}={}){this._configChanged=new m.Signal(this);this._disposed=new m.Signal(this);this._isDisposed=false;this._immutables=new Set;this._baseConfig=e!==null&&e!==void 0?e:{};this._config=t!==null&&t!==void 0?t:{};this._configurableBuilderMap=new Map(n);const i=Object.keys(this._config).concat(Object.keys(this._baseConfig));this._immutables=new Set([...this._configurableBuilderMap.keys()].filter((e=>!i.includes(e))))}get configChanged(){return this._configChanged}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._disposed.emit();m.Signal.clearData(this)}getOption(e){var t;return(t=this._config[e])!==null&&t!==void 0?t:this._baseConfig[e]}hasOption(e){return Object.keys(this._config).includes(e)||Object.keys(this._baseConfig).includes(e)}setOption(e,t){if(this._config[e]!==t){this._config[e]=t;this._configChanged.emit({[e]:t})}}setBaseOptions(e){const t=this._getChangedOptions(e,this._baseConfig);if(t.length>0){this._baseConfig=e;const n=Object.keys(this._config);const i=t.filter((e=>!n.includes(e)));if(i.length>0){this._configChanged.emit(i.reduce(((e,t)=>{e[t]=this._baseConfig[t];return e}),{}))}}for(const n of Object.keys(e)){if(n in this._config&&this._config[n]!=e[n]){this.setOption(n,e[n])}}}setOptions(e){const t=this._getChangedOptions(e,this._config);if(t.length>0){this._config={...e};this._configChanged.emit(t.reduce(((e,t)=>{var n;e[t]=(n=this._config[t])!==null&&n!==void 0?n:this._baseConfig[t];return e}),{}))}}reconfigureExtension(e,t,n){const i=this.getEffect(e.state,t,n);if(i){e.dispatch({effects:[i]})}}reconfigureExtensions(e,t){const n=Object.keys(t).filter((e=>this.has(e))).map((n=>this.getEffect(e.state,n,t[n])));e.dispatch({effects:n.filter((e=>e!==null))})}injectExtension(e,t){e.dispatch({effects:h.StateEffect.appendConfig.of(t)})}getInitialExtensions(){const e={...this._baseConfig,...this._config};const t=[...this._immutables].map((e=>{var t;return(t=this.get(e))===null||t===void 0?void 0:t.instance(undefined)})).filter((e=>e));for(const n of Object.keys(e)){const i=this.get(n);if(i){const s=e[n];t.push(i.instance(s))}}return t}get(e){return this._configurableBuilderMap.get(e)}has(e){return this._configurableBuilderMap.has(e)}getEffect(e,t,n){var i;const s=this.get(t);return(i=s===null||s===void 0?void 0:s.reconfigure(n))!==null&&i!==void 0?i:null}_getChangedOptions(e,t){const n=new Array;const i=new Array;for(const[s,o]of Object.entries(e)){i.push(s);if(t[s]!==o){n.push(s)}}n.push(...Object.keys(t).filter((e=>!i.includes(e))));return n}}class J{constructor(){this.configurationBuilder=new Map;this.configurationSchema={};this.defaultOptions={};this.handlers=new Set;this.immutableExtensions=new Set;this._baseConfiguration={}}get baseConfiguration(){return{...this.defaultOptions,...this._baseConfiguration}}set baseConfiguration(e){if(!p.JSONExt.deepEqual(e,this._baseConfiguration)){this._baseConfiguration=e;for(const e of this.handlers){e.setBaseOptions(this.baseConfiguration)}}}get defaultConfiguration(){return Object.freeze({...this.defaultOptions})}get settingsSchema(){return Object.freeze(p.JSONExt.deepCopy(this.configurationSchema))}addExtension(e){var t;if(this.configurationBuilder.has(e.name)){throw new Error(`Extension named ${e.name} is already registered.`)}this.configurationBuilder.set(e.name,e);if(typeof e.default!="undefined"){this.defaultOptions[e.name]=e.default}if(e.schema){this.configurationSchema[e.name]={default:(t=e.default)!==null&&t!==void 0?t:null,...e.schema};this.defaultOptions[e.name]=this.configurationSchema[e.name].default}}createNew(e){const t=new Array;for(const[i,s]of this.configurationBuilder.entries()){const n=s.factory(e);if(n){t.push([i,n])}}const n=new K({baseConfiguration:this.baseConfiguration,config:e.config,defaultExtensions:t});this.handlers.add(n);n.disposed.connect((()=>{this.handlers.delete(n)}));return n}}(function(e){class t{constructor(e){this._compartment=new h.Compartment;this._builder=e}instance(e){return this._compartment.of(this._builder(e))}reconfigure(e){return this._compartment.reconfigure(this._builder(e))}}class n{constructor(e){this._extension=e}instance(){return this._extension}reconfigure(){return null}}function s(e){return new t(e)}e.createConfigurableExtension=s;function o(e,n=[]){return new t((t=>t?e:n))}e.createConditionalExtension=o;function r(e){return new n(e)}e.createImmutableExtension=r;function a(e={}){const{themes:t,translator:n}=e;const a=(n!==null&&n!==void 0?n:f.nullTranslator).load("jupyterlab");const l=[Object.freeze({name:"autoClosingBrackets",default:false,factory:()=>o((0,g.wm)()),schema:{type:"boolean",title:a.__("Auto Closing Brackets")}}),Object.freeze({name:"codeFolding",default:false,factory:()=>o((0,c.foldGutter)()),schema:{type:"boolean",title:a.__("Code Folding")}}),Object.freeze({name:"cursorBlinkRate",default:1200,factory:()=>s((e=>(0,u.drawSelection)({cursorBlinkRate:e}))),schema:{type:"number",title:a.__("Cursor blinking rate"),description:a.__("Half-period in milliseconds used for cursor blinking. The default blink rate is 1200ms. By setting this to zero, blinking can be disabled.")}}),Object.freeze({name:"highlightActiveLine",default:false,factory:()=>o((0,u.highlightActiveLine)()),schema:{type:"boolean",title:a.__("Highlight the active line")}}),Object.freeze({name:"highlightSpecialCharacters",default:true,factory:()=>o((0,u.highlightSpecialChars)()),schema:{type:"boolean",title:a.__("Highlight special characters")}}),Object.freeze({name:"highlightTrailingWhitespace",default:false,factory:()=>o((0,u.highlightTrailingWhitespace)()),schema:{type:"boolean",title:a.__("Highlight trailing white spaces")}}),Object.freeze({name:"highlightWhitespace",default:false,factory:()=>o((0,u.highlightWhitespace)()),schema:{type:"boolean",title:a.__("Highlight white spaces")}}),Object.freeze({name:"indentUnit",default:"4",factory:()=>s((e=>e=="Tab"?c.indentUnit.of("\t"):c.indentUnit.of(" ".repeat(parseInt(e,10))))),schema:{type:"string",title:a.__("Indentation unit"),description:a.__("The indentation is a `Tab` or the number of spaces. This defaults to 4 spaces."),enum:["Tab","1","2","4","8"]}}),Object.freeze({name:"keymap",default:[{key:"Mod-Enter",run:d.insertBlankLineOnRun},{key:"Enter",run:d.completerOrInsertNewLine},{key:"Escape",run:d.simplifySelectionAndMaybeSwitchToCommandMode},...i.defaultKeymap.filter((e=>!["Ctrl-m","Mod-Enter","Shift-Mod-k","Mod-/","Alt-A","Escape","Enter"].includes(e.key))),{key:"Tab",run:d.indentMoreOrInsertTab,shift:d.dedentIfNotLaunchingTooltip}],factory:()=>s((e=>u.keymap.of(e)))}),Object.freeze({name:"lineNumbers",default:true,factory:()=>o((0,u.lineNumbers)()),schema:{type:"boolean",title:a.__("Line Numbers")}}),Object.freeze({name:"lineWrap",factory:()=>o(u.EditorView.lineWrapping),default:true,schema:{type:"boolean",title:a.__("Line Wrap")}}),Object.freeze({name:"dropCursor",default:true,factory:()=>o((0,u.dropCursor)()),schema:{type:"boolean",title:a.__("Drop Cursor")}}),Object.freeze({name:"matchBrackets",default:true,factory:()=>o([(0,c.bracketMatching)(),h.Prec.high(u.keymap.of(g.Bc))]),schema:{type:"boolean",title:a.__("Match Brackets")}}),Object.freeze({name:"rectangularSelection",default:true,factory:()=>o([(0,u.rectangularSelection)(),(0,u.crosshairCursor)()]),schema:{type:"boolean",title:a.__("Rectangular selection"),description:a.__("Rectangular (block) selection can be created by dragging the mouse pointer while holding the left mouse button and the Alt key. When the Alt key is pressed, a crosshair cursor will appear, indicating that the rectangular selection mode is active.")}}),Object.freeze({name:"readOnly",default:false,factory:()=>s((e=>[h.EditorState.readOnly.of(e),e?u.EditorView.editorAttributes.of({class:$}):[]]))}),Object.freeze({name:"rulers",default:[],factory:()=>s((e=>e.length>0?P(e):[])),schema:{type:"array",title:a.__("Rulers"),items:{type:"number",minimum:0}}}),Object.freeze({name:"extendSelection",default:true,factory:()=>o(u.keymap.of([{key:"Mod-Shift-l",run:q.selectSelectionMatches,preventDefault:true}]))}),Object.freeze({name:"searchWithCM",default:false,factory:()=>o(u.keymap.of([{key:"Mod-f",run:q.openSearchPanel,scope:"editor search-panel"},{key:"F3",run:q.findNext,shift:q.findPrevious,scope:"editor search-panel",preventDefault:true},{key:"Mod-g",run:q.findNext,shift:q.findPrevious,scope:"editor search-panel",preventDefault:true},{key:"Escape",run:q.closeSearchPanel,scope:"editor search-panel"}]))}),Object.freeze({name:"scrollPastEnd",default:false,factory:e=>e.inline?null:o((0,u.scrollPastEnd)())}),Object.freeze({name:"smartIndent",default:true,factory:()=>o((0,c.indentOnInput)()),schema:{type:"boolean",title:a.__("Smart Indentation")}}),Object.freeze({name:"tabFocusable",default:true,factory:()=>o(u.EditorView.contentAttributes.of({tabIndex:"0"}),u.EditorView.contentAttributes.of({tabIndex:"-1"}))}),Object.freeze({name:"tabSize",default:4,factory:()=>s((e=>h.EditorState.tabSize.of(e))),schema:{type:"number",title:a.__("Tab size")}}),Object.freeze({name:"tooltips",factory:()=>r((0,u.tooltips)({position:"absolute",parent:document.body}))}),Object.freeze({name:"allowMultipleSelections",default:true,factory:()=>s((e=>h.EditorState.allowMultipleSelections.of(e))),schema:{type:"boolean",title:a.__("Multiple selections")}}),Object.freeze({name:"customStyles",factory:()=>s((e=>b(e))),default:{fontFamily:null,fontSize:null,lineHeight:null},schema:{title:a.__("Custom editor styles"),type:"object",properties:{fontFamily:{type:["string","null"],title:a.__("Font Family")},fontSize:{type:["number","null"],minimum:1,maximum:100,title:a.__("Font Size")},lineHeight:{type:["number","null"],title:a.__("Line Height")}},additionalProperties:false}})];if(t){l.push(Object.freeze({name:"theme",default:"jupyter",factory:()=>s((e=>t.getTheme(e))),schema:{type:"string",title:a.__("Theme"),description:a.__("CodeMirror theme")}}))}if(n){l.push(Object.freeze({name:"translation",default:{"Control character":a.__("Control character"),"Selection deleted":a.__("Selection deleted"),"Folded lines":a.__("Folded lines"),"Unfolded lines":a.__("Unfolded lines"),to:a.__("to"),"folded code":a.__("folded code"),unfold:a.__("unfold"),"Fold line":a.__("Fold line"),"Unfold line":a.__("Unfold line"),"Go to line":a.__("Go to line"),go:a.__("go"),Find:a.__("Find"),Replace:a.__("Replace"),next:a.__("next"),previous:a.__("previous"),all:a.__("all"),"match case":a.__("match case"),replace:a.__("replace"),"replace all":a.__("replace all"),close:a.__("close"),"current match":a.__("current match"),"replaced $ matches":a.__("replaced $ matches"),"replaced match on line $":a.__("replaced match on line $"),"on line":a.__("on line"),Completions:a.__("Completions"),Diagnostics:a.__("Diagnostics"),"No diagnostics":a.__("No diagnostics")},factory:()=>s((e=>h.EditorState.phrases.of(e)))}))}return l}e.getDefaultExtensions=a})(J||(J={}));var G=n(37737);var Y=n(91268);const X=u.EditorView.theme({"&":{background:"var(--jp-layout-color0)",color:"var(--jp-content-font-color1)"},".cm-panels":{color:"var(--jp-ui-font-color2)",backgroundColor:"var(--jp-layout-color2)"},".cm-panels.cm-panels-bottom":{borderTop:"1px solid var(--jp-border-color2)"},".cm-button":{background:"var(--jp-layout-color2)",border:"var(--jp-border-width) solid var(--jp-border-color1)",color:"var(--jp-ui-font-color1)",borderRadius:"var(--jp-border-radius)"},".cm-button:hover":{background:"var(--jp-layout-color1)"},".cm-panel.cm-search > label":{color:"var(--jp-ui-font-color1)"},".cm-textfield":{backgroundColor:"var(--jp-layout-color2)",color:"var(--jp-ui-font-color1)",border:"var(--jp-border-width) solid var(--jp-border-color1)"},".jp-CodeConsole &, .jp-Notebook &":{background:"transparent"},".cm-content":{caretColor:"var(--jp-editor-cursor-color)"},".cm-scroller":{fontFamily:"inherit"},".cm-cursor, .cm-dropCursor":{borderLeft:"var(--jp-code-cursor-width0) solid var(--jp-editor-cursor-color)"},".cm-selectionBackground, .cm-content ::selection":{backgroundColor:"var(--jp-editor-selected-background)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{backgroundColor:"var(--jp-editor-selected-focused-background)"},".cm-gutters":{borderRight:"1px solid var(--jp-border-color2)",backgroundColor:"var(--jp-layout-color2)"},".cm-gutter":{backgroundColor:"var(--jp-layout-color2)"},".cm-activeLine":{backgroundColor:"color-mix(in srgb, var(--jp-layout-color3) 25%, transparent)"},".cm-lineNumbers":{color:"var(--jp-ui-font-color2)"},".cm-searchMatch":{backgroundColor:"var(--jp-search-unselected-match-background-color)",color:"var(--jp-search-unselected-match-color)"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"var(--jp-search-selected-match-background-color) !important",color:"var(--jp-search-selected-match-color) !important"},".cm-tooltip":{backgroundColor:"var(--jp-layout-color1)"}});const Q=c.HighlightStyle.define([{tag:w.tags.meta,color:"var(--jp-mirror-editor-meta-color)"},{tag:w.tags.heading,color:"var(--jp-mirror-editor-header-color)"},{tag:[w.tags.heading1,w.tags.heading2,w.tags.heading3,w.tags.heading4],color:"var(--jp-mirror-editor-header-color)",fontWeight:"bold"},{tag:w.tags.keyword,color:"var(--jp-mirror-editor-keyword-color)",fontWeight:"bold"},{tag:w.tags.atom,color:"var(--jp-mirror-editor-atom-color)"},{tag:w.tags.number,color:"var(--jp-mirror-editor-number-color)"},{tag:[w.tags.definition(w.tags.name),w.tags.function(w.tags.definition(w.tags.variableName))],color:"var(--jp-mirror-editor-def-color)"},{tag:w.tags.standard(w.tags.variableName),color:"var(--jp-mirror-editor-builtin-color)"},{tag:[w.tags.special(w.tags.variableName),w.tags.self],color:"var(--jp-mirror-editor-variable-2-color)"},{tag:w.tags.punctuation,color:"var(--jp-mirror-editor-punctuation-color)"},{tag:w.tags.propertyName,color:"var(--jp-mirror-editor-property-color)"},{tag:w.tags.operator,color:"var(--jp-mirror-editor-operator-color)",fontWeight:"bold"},{tag:w.tags.comment,color:"var(--jp-mirror-editor-comment-color)",fontStyle:"italic"},{tag:w.tags.string,color:"var(--jp-mirror-editor-string-color)"},{tag:[w.tags.labelName,w.tags.monospace,w.tags.special(w.tags.string)],color:"var(--jp-mirror-editor-string-2-color)"},{tag:w.tags.bracket,color:"var(--jp-mirror-editor-bracket-color)"},{tag:w.tags.tagName,color:"var(--jp-mirror-editor-tag-color)"},{tag:w.tags.attributeName,color:"var(--jp-mirror-editor-attribute-color)"},{tag:w.tags.quote,color:"var(--jp-mirror-editor-quote-color)"},{tag:w.tags.link,color:"var(--jp-mirror-editor-link-color)",textDecoration:"underline"},{tag:[w.tags.separator,w.tags.derefOperator,w.tags.paren],color:""},{tag:w.tags.strong,fontWeight:"bold"},{tag:w.tags.emphasis,fontStyle:"italic"},{tag:w.tags.strikethrough,textDecoration:"line-through"},{tag:w.tags.bool,color:"var(--jp-mirror-editor-keyword-color)",fontWeight:"bold"}]);const Z=[X,(0,c.syntaxHighlighting)(Q)];class ee{constructor(){this._themeMap=new Map([["jupyter",Object.freeze({name:"jupyter",theme:Z})]])}get themes(){return Array.from(this._themeMap.values())}defaultTheme(){return this._themeMap.get("jupyter").theme}addTheme(e){if(this._themeMap.has(e.name)){throw new Error(`A theme named '${e.name}' is already registered.`)}this._themeMap.set(e.name,{displayName:e.name,...e})}getTheme(e){var t;const n=(t=this._themeMap.get(e))===null||t===void 0?void 0:t.theme;return n!==null&&n!==void 0?n:this.defaultTheme()}}(function(e){function t(e){const t=(e!==null&&e!==void 0?e:f.nullTranslator).load("jupyterlab");return[Object.freeze({name:"codemirror",displayName:t.__("codemirror"),theme:[u.EditorView.baseTheme({}),(0,c.syntaxHighlighting)(c.defaultHighlightStyle)]})]}e.getDefaultThemes=t})(ee||(ee={}));class te{constructor(e,t){this.langPython=t;this.tree=(0,c.syntaxTree)(e.state);this.mark=u.Decoration.mark({class:"cm-builtin"});this.decorations=this.buildDeco(e);this.decoratedTo=e.viewport.to}update(e){let t=(0,c.syntaxTree)(e.state);let{viewport:n}=e.view,i=e.changes.mapPos(this.decoratedTo,1);if(t.length=n.to){this.decorations=this.decorations.map(e.changes);this.decoratedTo=i}else if(t!=this.tree||e.viewportChanged){this.tree=t;this.decorations=this.buildDeco(e.view);this.decoratedTo=n.to}}buildDeco(e){if(!this.tree.length)return u.Decoration.none;let t=new h.RangeSetBuilder;const n=i=>{var s;const o=i.node.cursor();const r=o.tree&&o.tree.prop(y.NodeProp.mounted);if(r&&r.overlay){(s=i.node.enter(r.overlay[0].from+i.from,1))===null||s===void 0?void 0:s.cursor().iterate(n)}if(this.langPython.isActiveAt(e.state,i.from+1)&&i.name==="VariableName"){const n=e.state.sliceDoc(i.from,i.to);if(ie.includes(n)){t.add(i.from,i.to,this.mark)}}};for(let{from:i,to:s}of e.visibleRanges){this.tree.iterate({enter:n,from:i,to:s})}return t.finish()}}function ne(e){return u.ViewPlugin.define((t=>new te(t,e)),{decorations:e=>e.decorations})}const ie=["abs","aiter","all","any","anext","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip","__import__"];class se{constructor(){this._modeList=[];this.addLanguage({name:"none",mime:"text/plain",support:new c.LanguageSupport(c.LRLanguage.define({parser:(0,Y.KO)("@top Program { }")}))})}addLanguage(e){var t;const n=(t=this.findByName(e.name))!==null&&t!==void 0?t:this.findByMIME(e.mime,true);if(n){throw new Error(`${e.mime} already registered`)}this._modeList.push(this.makeSpec(e))}async getLanguage(e){const t=this.findBest(e);if(t&&!t.support){t.support=await t.load()}return t}getLanguages(){return[...this._modeList]}findByMIME(e,t=false){if(Array.isArray(e)){for(let t=0;t-1&&t.substring(n+1,t.length);if(i){return this.findByExtension(i)}return null}findBest(e,t=true){var n,i,o,r;const a=typeof e==="string"?e:e.name;const l=typeof e!=="string"?e.mime:a;const d=typeof e!=="string"?(n=e.extensions)!==null&&n!==void 0?n:[]:[];return(r=(o=(i=a?this.findByName(a):null)!==null&&i!==void 0?i:l?this.findByMIME(l):null)!==null&&o!==void 0?o:this.findByExtension(d))!==null&&r!==void 0?r:t?this.findByMIME(s.IEditorMimeTypeService.defaultMimeType):null}async highlight(e,t,n){var i;if(t){await this.getLanguage(t)}const s=(i=t===null||t===void 0?void 0:t.support)===null||i===void 0?void 0:i.language;if(!s){n.appendChild(document.createTextNode(e));return}const o=s.parser.parse(e);let r=0;(0,w.highlightTree)(o,Q,((t,i,s)=>{if(t>r){n.appendChild(document.createTextNode(e.slice(r,t)))}const o=n.appendChild(document.createElement("span"));o.className=s;o.appendChild(document.createTextNode(e.slice(t,i)));r=i}));if(rthis.onKeydown(e)});const c=u.EditorView.updateListener.of((e=>{this._onDocChanged(e)}));this._editor=de.createEditor(a,this._configurator,[h.Prec.high(d),c,this._language.of([]),...(r=e.extensions)!==null&&r!==void 0?r:[]],l.sharedModel.source);this._onMimeTypeChanged();this._onCursorActivity();this._configurator.configChanged.connect(this.onConfigChanged,this);l.mimeTypeChanged.connect(this._onMimeTypeChanged,this)}get uuid(){return this._uuid}set uuid(e){this._uuid=e}get editor(){return this._editor}get doc(){return this._editor.state.doc}get lineCount(){return this.doc.lines}get model(){return this._model}get lineHeight(){return this._editor.defaultLineHeight}get charWidth(){return this._editor.defaultCharacterWidth}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this.host.removeEventListener("focus",this,true);this.host.removeEventListener("blur",this,true);this.host.removeEventListener("scroll",this,true);this._configurator.dispose();m.Signal.clearData(this);this.editor.destroy()}getOption(e){return this._configurator.getOption(e)}hasOption(e){return this._configurator.hasOption(e)}setOption(e,t){this._configurator.setOption(e,t)}setOptions(e){this._configurator.setOptions(e)}setBaseOptions(e){this._configurator.setBaseOptions(e)}injectExtension(e){this._configurator.injectExtension(this._editor,e)}getLine(e){e=e+1;return e<=this.doc.lines?this.doc.line(e).text:undefined}getOffsetAt(e){return this.doc.line(e.line+1).from+e.column}getPositionAt(e){const t=this.doc.lineAt(e);return{line:t.number-1,column:e-t.from}}undo(){this.model.sharedModel.undo()}redo(){this.model.sharedModel.redo()}clearHistory(){this.model.sharedModel.clearUndoHistory()}focus(){this._editor.focus()}hasFocus(){return this._editor.hasFocus}blur(){this._editor.contentDOM.blur()}get state(){return this._editor.state}firstLine(){return 0}lastLine(){return this.doc.lines-1}cursorCoords(e,t){const n=this.state.selection.main;const i=e?n.from:n.to;const s=this.editor.coordsAtPos(i);return s}getRange(e,t,n){const i=this.getOffsetAt(this._toPosition(e));const s=this.getOffsetAt(this._toPosition(t));return this.state.sliceDoc(i,s)}revealPosition(e){const t=this.getOffsetAt(e);this._editor.dispatch({effects:u.EditorView.scrollIntoView(t)})}revealSelection(e){const t=this.getOffsetAt(e.start);const n=this.getOffsetAt(e.end);this._editor.dispatch({effects:u.EditorView.scrollIntoView(h.EditorSelection.range(t,n))})}getCoordinateForPosition(e){const t=this.getOffsetAt(e);const n=this.editor.coordsAtPos(t);return n}getPositionForCoordinate(e){const t=this.editor.posAtCoords({x:e.left,y:e.top});return this.getPositionAt(t)||null}getCursorPosition(){const e=this.state.selection.main.head;return this.getPositionAt(e)}setCursorPosition(e,t={}){const n=this.getOffsetAt(e);this.editor.dispatch({selection:{anchor:n},scrollIntoView:t.scroll===false?false:true});if(!this.editor.hasFocus){this.model.selections.set(this.uuid,this.getSelections())}}getSelection(){return this.getSelections()[0]}setSelection(e){this.setSelections([e])}getSelections(){const e=this.state.selection.ranges;if(e.length>0){const t=e.map((e=>({anchor:this._toCodeMirrorPosition(this.getPositionAt(e.from)),head:this._toCodeMirrorPosition(this.getPositionAt(e.to))})));return t.map((e=>this._toSelection(e)))}const t=this._toCodeMirrorPosition(this.getPositionAt(this.state.selection.main.head));const n=this._toSelection({anchor:t,head:t});return[n]}setSelections(e){const t=e.length?e.map((e=>h.EditorSelection.range(this.getOffsetAt(e.start),this.getOffsetAt(e.end)))):[h.EditorSelection.range(0,0)];this.editor.dispatch({selection:h.EditorSelection.create(t)})}replaceSelection(e){const t=this.getSelections()[0];this.model.sharedModel.updateSource(this.getOffsetAt(t.start),this.getOffsetAt(t.end),e);const n=this.getPositionAt(this.getOffsetAt(t.start)+e.length);this.setSelection({start:n,end:n})}getTokens(){const e=[];const t=(0,c.ensureSyntaxTree)(this.state,this.doc.length);if(t){t.iterate({enter:t=>{if(t.node.firstChild===null){e.push({value:this.state.sliceDoc(t.from,t.to),offset:t.from,type:t.name})}return true}})}return e}getTokenAt(e){const t=(0,c.ensureSyntaxTree)(this.state,e);let n=null;if(t){t.iterate({enter:t=>{if(n){return false}if(t.node.firstChild){return true}if(e>=t.from&&e<=t.to){let e=t;if(t.name==="⚠"&&t.from===t.to&&t.node.parent){e=t.node.parent}n={value:this.state.sliceDoc(e.from,e.to),offset:e.from,type:e.name};return false}return true}})}return n||{offset:e,value:""}}getTokenAtCursor(){return this.getTokenAt(this.state.selection.main.head)}newIndentedLine(){(0,i.insertNewlineAndIndent)({state:this.state,dispatch:this.editor.dispatch})}execCommand(e){e(this.editor)}onConfigChanged(e,t){const n=Object.keys(t).reduce(((e,n)=>{if(t[n]!=undefined){e[n]=t[n]}return e}),{});e.reconfigureExtensions(this._editor,n);if(t["customStyles"]&&!t["fontSize"]){this.editor.setState(this.editor.state)}}onKeydown(e){const t=this.state.selection.main.head;if(t===0&&e.keyCode===re){if(!e.shiftKey){this.edgeRequested.emit("top")}return false}const n=this.doc.lineAt(t).number;if(n===1&&e.keyCode===re){if(!e.shiftKey){this.edgeRequested.emit("topLine")}return false}const i=this.doc.length;if(t===i&&e.keyCode===ae){if(!e.shiftKey){this.edgeRequested.emit("bottom")}return false}return false}_onMimeTypeChanged(){this._languages.getLanguage(this._model.mimeType).then((e=>{var t;this._editor.dispatch({effects:this._language.reconfigure((t=e===null||e===void 0?void 0:e.support)!==null&&t!==void 0?t:[])})})).catch((e=>{console.log(`Failed to load language for '${this._model.mimeType}'.`,e);this._editor.dispatch({effects:this._language.reconfigure([])})}))}_onCursorActivity(){if(this._editor.hasFocus){const e=this.getSelections();this.model.selections.set(this.uuid,e)}}_toSelection(e){return{uuid:this.uuid,start:this._toPosition(e.anchor),end:this._toPosition(e.head)}}_toPosition(e){return{line:e.line,column:e.ch}}_toCodeMirrorPosition(e){return{line:e.line,ch:e.column}}_onDocChanged(e){if(e.transactions.length&&e.transactions[0].selection){this._onCursorActivity()}}handleEvent(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e);break;default:break}}_evtFocus(e){this.host.classList.add("jp-mod-focused");this._onCursorActivity()}_evtBlur(e){this.host.classList.remove("jp-mod-focused")}}var de;(function(e){function t(e,t,n,i){const s=t.getInitialExtensions();s.push(...n);const o=new u.EditorView({state:h.EditorState.create({doc:i,extensions:s}),parent:e});return o}e.createEditor=t})(de||(de={}));class ce{constructor(e={}){var t,n,i;this.newInlineEditor=e=>{e.host.dataset.type="inline";return this.newEditor({...e,config:{...this.inlineCodeMirrorConfig,...e.config||{}},inline:true})};this.newDocumentEditor=e=>{var t,n;e.host.dataset.type="document";return this.newEditor({...e,config:{...this.documentCodeMirrorConfig,...(t=e.config)!==null&&t!==void 0?t:{}},inline:false,extensions:[u.keymap.of([{key:"Shift-Enter",run:e=>true}])].concat((n=e.extensions)!==null&&n!==void 0?n:[])})};this.languages=(t=e.languages)!==null&&t!==void 0?t:new se;this.extensions=(n=e.extensions)!==null&&n!==void 0?n:new J;this.translator=(i=e.translator)!==null&&i!==void 0?i:f.nullTranslator;this.inlineCodeMirrorConfig={searchWithCM:true};this.documentCodeMirrorConfig={lineNumbers:true,scrollPastEnd:true}}newEditor(e){const t=new le({extensionsRegistry:this.extensions,languages:this.languages,translator:this.translator,...e});return t}}class he{constructor(e){this.languages=e}getMimeTypeByLanguage(e){var t;const n=e.file_extension||"";const i=this.languages.findBest(e.codemirror_mode||{mimetype:e.mimetype,name:e.name,ext:[n.split(".").slice(-1)[0]]});return i?Array.isArray(i.mime)?(t=i.mime[0])!==null&&t!==void 0?t:s.IEditorMimeTypeService.defaultMimeType:i.mime:s.IEditorMimeTypeService.defaultMimeType}getMimeTypeByFilePath(e){var t;const n=G.PathExt.extname(e);if(n===".ipy"){return"text/x-python"}else if(n===".md"){return"text/x-ipythongfm"}const i=this.languages.findByFileName(e);return i?Array.isArray(i.mime)?(t=i.mime[0])!==null&&t!==void 0?t:s.IEditorMimeTypeService.defaultMimeType:i.mime:s.IEditorMimeTypeService.defaultMimeType}}var ue=n(87277);class pe{constructor(){this.currentIndex=null;this.query=null;this._isActive=true;this._inSelection=null;this._isDisposed=false;this._cmHandler=null;this.currentIndex=null;this._stateChanged=new m.Signal(this)}get cmHandler(){if(!this._cmHandler){this._cmHandler=new me(this.editor)}return this._cmHandler}get stateChanged(){return this._stateChanged}get currentMatchIndex(){return this.isActive?this.currentIndex:null}get isActive(){return this._isActive}get isDisposed(){return this._isDisposed}get matchesCount(){return this.isActive?this.cmHandler.matches.length:0}clearHighlight(){this.currentIndex=null;this.cmHandler.clearHighlight();return Promise.resolve()}dispose(){if(this._isDisposed){return}this._isDisposed=true;m.Signal.clearData(this);if(this.isActive){this.endQuery().catch((e=>{console.error(`Failed to end search query on cells.`,e)}))}}async setIsActive(e){if(this._isActive===e){return}this._isActive=e;if(this._isActive){if(this.query!==null){await this.startQuery(this.query,this.filters)}}else{await this.endQuery()}}async setSearchSelection(e){if(this._inSelection===e){return}this._inSelection=e;await this.updateCodeMirror(this.model.sharedModel.getSource());this._stateChanged.emit()}setProtectSelection(e){this.cmHandler.protectSelection=e}async startQuery(e,t){this.query=e;this.filters=t;const n=this.model.sharedModel.getSource();await this.updateCodeMirror(n);this.model.sharedModel.changed.connect(this.onSharedModelChanged,this)}async endQuery(){await this.clearHighlight();await this.cmHandler.endQuery();this.currentIndex=null}async highlightNext(e=true,t){if(this.matchesCount===0||!this.isActive){this.currentIndex=null}else{let n=await this.cmHandler.highlightNext(t);if(n){this.currentIndex=this.cmHandler.currentIndex}else{this.currentIndex=e?0:null}return n}return Promise.resolve(this.getCurrentMatch())}async highlightPrevious(e=true,t){if(this.matchesCount===0||!this.isActive){this.currentIndex=null}else{let n=await this.cmHandler.highlightPrevious(t);if(n){this.currentIndex=this.cmHandler.currentIndex}else{this.currentIndex=e?this.matchesCount-1:null}return n}return Promise.resolve(this.getCurrentMatch())}replaceCurrentMatch(e,t,n){if(!this.isActive){return Promise.resolve(false)}if(this.currentIndex!==null&&this.currentIndex{this.updateCodeMirror(this.model.sharedModel.getSource()).then((()=>{const n=this.cmHandler.matches;const i=t.position+s.length;let o=false;for(let e=this.currentIndex||0;e=i){this.currentIndex=e;o=true;break}void this.highlightNext(false,{from:"previous-match"})}if(!o){this.currentIndex=null}e(true)})).catch((e=>{const t=`Failed to regenerate match list: ${e}`;console.error(t);n(t)}))}))}}return Promise.resolve(false)}replaceAllMatches(e,t){if(!this.isActive){return Promise.resolve(false)}let n=this.cmHandler.matches.length>0;let i=this.model.sharedModel.getSource();let s=0;const o=this.cmHandler.matches.reduce(((n,o)=>{const r=o.position;const a=r+o.text.length;const l=(t===null||t===void 0?void 0:t.regularExpression)?o.text.replace(this.query,e):e;const d=(t===null||t===void 0?void 0:t.preserveCase)?ue.GenericSearchProvider.preserveCase(o.text,l):l;const c=`${n}${i.slice(s,r)}${d}`;s=a;return c}),"");if(n){this.cmHandler.matches=[];this.currentIndex=null;this.model.sharedModel.setSource(`${o}${i.slice(s)}`)}return Promise.resolve(n)}getCurrentMatch(){if(this.currentIndex===null){return undefined}else{let e=undefined;if(this.currentIndexe.position>=n&&e.position<=i));if(this.cmHandler.currentIndex===null&&this.cmHandler.matches.length>0){await this.cmHandler.highlightNext({from:"selection",select:false,scroll:false})}this.currentIndex=this.cmHandler.currentIndex}else{this.cmHandler.matches=t}}else{this.cmHandler.matches=[]}}}class me{constructor(e){this._current=null;this._cm=e;this._matches=new Array;this._currentIndex=null;this._highlightEffect=h.StateEffect.define({map:(e,t)=>{const n=e=>({text:e.text,position:t.mapPos(e.position)});return{matches:e.matches.map(n),currentMatch:e.currentMatch?n(e.currentMatch):null}}});this._highlightMark=u.Decoration.mark({class:"cm-searching"});this._currentMark=u.Decoration.mark({class:"jp-current-match"});this._highlightField=h.StateField.define({create:()=>u.Decoration.none,update:(e,t)=>{e=e.map(t.changes);for(let n of t.effects){if(n.is(this._highlightEffect)){const t=n;if(t.value.matches.length){e=e.update({add:t.value.matches.map((e=>this._highlightMark.range(e.position,e.position+e.text.length))),filter:()=>false});e=e.update({add:t.value.currentMatch?[this._currentMark.range(t.value.currentMatch.position,t.value.currentMatch.position+t.value.currentMatch.text.length)]:[]})}else{e=u.Decoration.none}}}return e},provide:e=>u.EditorView.decorations.from(e)});this._domEventHandlers=u.EditorView.domEventHandlers({focus:()=>{this._selectCurrentMatch()}})}get currentIndex(){return this._currentIndex}get matches(){return this._matches}set matches(e){this._matches=e;if(this._currentIndex!==null&&this._currentIndex>this._matches.length){this._currentIndex=this._matches.length>0?0:null}this._highlightCurrentMatch({select:false})}get protectSelection(){return this._protectSelection}set protectSelection(e){this._protectSelection=e}clearHighlight(){this._currentIndex=null;this._highlightCurrentMatch()}endQuery(){this._currentIndex=null;this._matches=[];if(this._cm){this._cm.editor.dispatch({effects:this._highlightEffect.of({matches:[],currentMatch:null})})}return Promise.resolve()}highlightNext(e){var t;this._currentIndex=this._findNext(false,(t=e===null||e===void 0?void 0:e.from)!==null&&t!==void 0?t:"auto");this._highlightCurrentMatch(e);return Promise.resolve(this._currentIndex!==null?this._matches[this._currentIndex]:undefined)}highlightPrevious(e){var t;this._currentIndex=this._findNext(true,(t=e===null||e===void 0?void 0:e.from)!==null&&t!==void 0?t:"auto");this._highlightCurrentMatch(e);return Promise.resolve(this._currentIndex!==null?this._matches[this._currentIndex]:undefined)}setEditor(e){if(this._cm){throw new Error("CodeMirrorEditor already set.")}else{this._cm=e;if(this._currentIndex!==null){this._highlightCurrentMatch()}this._cm.editor.dispatch({effects:h.StateEffect.appendConfig.of(this._domEventHandlers)});this._refresh()}}_selectCurrentMatch(e=true){const t=this._current;if(!t){return}if(!this._cm){return}const n={anchor:t.position,head:t.position+t.text.length};const i=this._cm.editor.state.selection.main;if(i.from===t.position&&i.to===t.position+t.text.length||this._protectSelection){if(e){this._cm.editor.dispatch({effects:u.EditorView.scrollIntoView(h.EditorSelection.range(n.anchor,n.head))});return}}else{this._cm.editor.dispatch({selection:n,scrollIntoView:e})}}_highlightCurrentMatch(e){var t,n,i;if(!this._cm){return}if(this._currentIndex!==null){const s=this.matches[this._currentIndex];this._current=s;if((t=e===null||e===void 0?void 0:e.select)!==null&&t!==void 0?t:true){if(this._cm.hasFocus()){this._selectCurrentMatch((n=e===null||e===void 0?void 0:e.scroll)!==null&&n!==void 0?n:true)}else if((i=e===null||e===void 0?void 0:e.scroll)!==null&&i!==void 0?i:true){this._cm.editor.dispatch({effects:u.EditorView.scrollIntoView(s.position)})}}}else{this._current=null}this._refresh()}_refresh(){if(!this._cm){return}let e=[this._highlightEffect.of({matches:this.matches,currentMatch:this._current})];if(!this._cm.state.field(this._highlightField,false)){e.push(h.StateEffect.appendConfig.of([this._highlightField]))}this._cm.editor.dispatch({effects:e})}_findNext(e,t="auto"){var n,i,s,o;if(this._matches.length===0){return null}if(!this._cm&&!["previous-match","start"].includes(t)){t="previous-match"}let r=0;if(t==="auto"&&((i=(n=this._cm)===null||n===void 0?void 0:n.hasFocus())!==null&&i!==void 0?i:false)||t==="selection"){const t=this._cm.state.selection.main;r=e?t.anchor:t.head}else if(t==="selection-start"){const e=this._cm.state.selection.main;r=Math.min(e.anchor,e.head)}else if(t==="start"){r=0}else if(this._current){r=e?this._current.position:this._current.position+this._current.text.length}if(r===0&&e&&this.currentIndex===null){r=(o=(s=this._cm)===null||s===void 0?void 0:s.doc.length)!==null&&o!==void 0?o:d(this._matches[this._matches.length-1])}const a=r;let l=ge.findNext(this._matches,a,0,this._matches.length-1);if(l===null){return e?this._matches.length-1:null}if(e){l-=1;if(l<0){return null}}return l;function d(e){return e?e.position+e.text.length:0}}}var ge;(function(e){function t(e,t,n=0,i=Infinity){i=Math.min(e.length-1,i);while(n<=i){let s=Math.floor(.5*(n+i));const o=e[s].position;if(ot){return n}}else if(o>t){i=s-1;if(i>0&&e[i].position0?n-1:0;const o=e[s];return o.position>=t?s:null}e.findNext=t})(ge||(ge={}));const fe=new p.Token("@jupyterlab/codemirror:IEditorExtensionRegistry",`A registry for CodeMirror extension factories.`);const ve=new p.Token("@jupyterlab/codemirror:IEditorLanguageRegistry","A registry for CodeMirror languages.");const _e=new p.Token("@jupyterlab/codemirror:IEditorThemeRegistry","A registry for CodeMirror theme.")},23359:(e,t,n)=>{"use strict";var i=n(17325);var s=n(19562);var o=n(85072);var r=n.n(o);var a=n(97825);var l=n.n(a);var d=n(77659);var c=n.n(d);var h=n(55056);var u=n.n(h);var p=n(10540);var m=n.n(p);var g=n(41113);var f=n.n(g);var v=n(29500);var _={};_.styleTagTransform=f();_.setAttributes=u();_.insert=c().bind(null,"head");_.domAPI=l();_.insertStyleElement=m();var b=r()(v.A,_);const y=v.A&&v.A.locals?v.A.locals:undefined},76177:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>C});var i=n(98335);var s=n(66127);var o=n(26087);var r=n(15615);var a=n(61927);var l=n(93247);var d=n(44914);var c=n.n(d);const h="availableProviders";function u(e){const{schema:t}=e;const n=t.title;const i=t.description;const s=e.formContext.settings;const o=s.get(h).user;const r={...t.default};if(o){for(const e of Object.keys(r)){if(e in o){r[e]=o[e]}else{r[e]=-1}}}const[a,l]=(0,d.useState)(r);const u=(e,t)=>{const n={...a,[e]:parseInt(t.target.value)};s.set(h,n).catch(console.error);l(n)};return c().createElement("div",null,c().createElement("fieldset",null,c().createElement("legend",null,n),c().createElement("p",{className:"field-description"},i),Object.keys(r).map((e=>c().createElement("div",{key:e,className:"form-group small-field"},c().createElement("div",null,c().createElement("h3",null," ",e),c().createElement("div",{className:"inputFieldWrapper"},c().createElement("input",{className:"form-control",type:"number",value:a[e],onChange:t=>{u(e,t)}}))))))))}const p="@jupyterlab/completer-extension:manager";const m="@jupyterlab/completer-extension:inline-completer";var g;(function(e){e.nextInline="inline-completer:next";e.previousInline="inline-completer:previous";e.acceptInline="inline-completer:accept";e.invokeInline="inline-completer:invoke"})(g||(g={}));const f={id:"@jupyterlab/completer-extension:base-service",description:"Adds context and kernel completion providers.",requires:[o.ICompletionProviderManager],autoStart:true,activate:(e,t)=>{t.registerProvider(new o.ContextCompleterProvider);t.registerProvider(new o.KernelCompleterProvider)}};const v={id:"@jupyterlab/completer-extension:inline-history",description:"Adds inline completion provider suggesting code from execution history.",requires:[o.ICompletionProviderManager],optional:[a.ITranslator],autoStart:true,activate:(e,t,n)=>{t.registerInlineProvider(new o.HistoryInlineCompletionProvider({translator:n!==null&&n!==void 0?n:a.nullTranslator}))}};const _={id:"@jupyterlab/completer-extension:inline-completer-factory",description:"Provides a factory for inline completer.",provides:o.IInlineCompleterFactory,optional:[a.ITranslator],autoStart:true,activate:(e,t)=>{const n=(t||a.nullTranslator).load("jupyterlab");return{factory:t=>{const i=new o.InlineCompleter({...t,trans:n});const r=t=>{const n=e.commands.keyBindings.find((e=>e.command===t));const i=n?l.CommandRegistry.formatKeystroke(n.keys):"";return i?`${i}`:""};const a={[g.previousInline]:r(g.previousInline),[g.nextInline]:r(g.nextInline),[g.acceptInline]:r(g.acceptInline)};e.commands.keyBindingChanged.connect(((t,n)=>{const i=n.binding.command;if(a.hasOwnProperty(i)){const t=a[i];const n=r(i);if(n!==t){a[i]=n;e.commands.notifyCommandChanged(i)}}}));i.toolbar.addItem("previous-inline-completion",new s.CommandToolbarButton({commands:e.commands,icon:s.caretLeftIcon,id:g.previousInline,label:()=>a[g.previousInline],caption:n.__("Previous")}));i.toolbar.addItem("next-inline-completion",new s.CommandToolbarButton({commands:e.commands,icon:s.caretRightIcon,id:g.nextInline,label:()=>a[g.nextInline],caption:n.__("Next")}));i.toolbar.addItem("accept-inline-completion",new s.CommandToolbarButton({commands:e.commands,icon:s.checkIcon,id:g.acceptInline,label:()=>a[g.acceptInline],caption:n.__("Accept")}));i.model.suggestionsChanged.connect((()=>{for(const t of[g.previousInline,g.nextInline,g.acceptInline]){e.commands.notifyCommandChanged(t)}}));return i}}}};const b={id:m,description:"Registers the inline completer factory; adds inline completer commands, shortcuts and settings.",requires:[o.ICompletionProviderManager,o.IInlineCompleterFactory,r.ISettingRegistry],optional:[a.ITranslator],autoStart:true,activate:(e,t,n,s,o)=>{t.setInlineCompleterFactory(n);const r=(o||a.nullTranslator).load("jupyterlab");const l=()=>!!e.shell.currentWidget&&!!t.inline;let d;e.commands.addCommand(g.nextInline,{execute:()=>{var n;(n=t.inline)===null||n===void 0?void 0:n.cycle(e.shell.currentWidget.id,"next")},label:r.__("Next Inline Completion"),isEnabled:l});e.commands.addCommand(g.previousInline,{execute:()=>{var n;(n=t.inline)===null||n===void 0?void 0:n.cycle(e.shell.currentWidget.id,"previous")},label:r.__("Previous Inline Completion"),isEnabled:l});e.commands.addCommand(g.acceptInline,{execute:()=>{var n;(n=t.inline)===null||n===void 0?void 0:n.accept(e.shell.currentWidget.id)},label:r.__("Accept Inline Completion"),isEnabled:()=>l()&&t.inline.isActive(e.shell.currentWidget.id)});e.commands.addCommand(g.invokeInline,{execute:()=>{var n;(n=t.inline)===null||n===void 0?void 0:n.invoke(e.shell.currentWidget.id)},label:r.__("Invoke Inline Completer"),isEnabled:l});const c=e=>{var n;d=e.composite;(n=t.inline)===null||n===void 0?void 0:n.configure(d)};e.restored.then((()=>{var e;const n=(e=t.inlineProviders)!==null&&e!==void 0?e:[];const i=e=>{var t,n;return{enabled:true,autoFillInMiddle:false,timeout:5e3,debouncerDelay:0,...(n=(t=e.schema)===null||t===void 0?void 0:t.default)!==null&&n!==void 0?n:{}}};s.transform(m,{compose:e=>{var t,s;const o=(t=e.data.composite["providers"])!==null&&t!==void 0?t:{};for(const r of n){const e=i(r);o[r.identifier]={...e,...(s=o[r.identifier])!==null&&s!==void 0?s:{}}}e.data["composite"]["providers"]=o;return e},fetch:e=>{var t,s;const o=e.schema.properties;const a={};for(const l of n){a[l.identifier]={title:r.__("%1 provider",l.name),properties:{...(s=(t=l.schema)===null||t===void 0?void 0:t.properties)!==null&&s!==void 0?s:{},timeout:{title:r.__("Timeout"),description:r.__("Timeout for %1 provider (in milliseconds).",l.name),type:"number",minimum:0},debouncerDelay:{title:r.__("Debouncer delay"),minimum:0,description:r.__("Time since the last key press to wait before requesting completions from %1 provider (in milliseconds).",l.name),type:"number"},enabled:{title:r.__("Enabled"),description:r.__("Whether to fetch completions %1 provider.",l.name),type:"boolean"},autoFillInMiddle:{title:r.__("Fill in middle on typing"),description:r.__("Whether to show completions in the middle of the code line from %1 provider on typing.",l.name),type:"boolean"}},default:i(l),type:"object"}}o["providers"]["properties"]=a;return e}});const o=s.load(m);o.then((e=>{c(e);e.changed.connect((e=>{c(e)}))})).catch(console.error)})).catch(console.error);const h=t=>e.commands.keyBindings.find((e=>e.command===t));const u={[g.acceptInline]:h(g.acceptInline),[g.invokeInline]:h(g.invokeInline)};e.commands.keyBindingChanged.connect(((e,t)=>{const n=t.binding.command;if(u.hasOwnProperty(n)){u[n]=h(n)}}));const p=t=>{if(!(t.target instanceof Element)){return}const n=t.target;switch(t.keyCode){case 9:{const s=[u[g.acceptInline],u[g.invokeInline]];for(const o of s){if(o&&o.keys.length===1&&o.keys[0]==="Tab"&&n.closest(o.selector)&&e.commands.isEnabled(o.command)){const s=n.closest("."+i.COMPLETER_ACTIVE_CLASS);if((d===null||d===void 0?void 0:d.suppressIfTabCompleterActive)&&s){return}e.commands.execute(o.command).catch(console.error);t.preventDefault();t.stopPropagation();t.stopImmediatePropagation();return}}break}default:return}};document.addEventListener("keydown",p,true)}};const y={id:p,description:"Provides the completion provider manager.",requires:[r.ISettingRegistry],optional:[s.IFormRendererRegistry],provides:o.ICompletionProviderManager,autoStart:true,activate:(e,t,n)=>{const i="availableProviders";const s=new o.CompletionProviderManager;const r=(e,t)=>{var n;const o=e.get(i);const r=e.composite;s.setTimeout(r.providerTimeout);s.setShowDocumentationPanel(r.showDocumentationPanel);s.setContinuousHinting(r.autoCompletion);s.setSuppressIfInlineCompleterActive(r.suppressIfInlineCompleterActive);const a=(n=o.user)!==null&&n!==void 0?n:o.composite;const l=Object.entries(a!==null&&a!==void 0?a:{}).filter((e=>e[1]>=0&&t.includes(e[0]))).sort((([,e],[,t])=>t-e)).map((e=>e[0]));s.activateProvider(l)};e.restored.then((()=>{const e=[...s.getProviders().entries()];const n=e.map((([e,t])=>e));t.transform(p,{fetch:t=>{const n=t.schema.properties;const s={};e.forEach((([e,t],n)=>{var i;s[e]=(i=t.rank)!==null&&i!==void 0?i:(n+1)*10}));n[i]["default"]=s;return t}});const o=t.load(p);o.then((e=>{r(e,n);e.changed.connect((e=>{r(e,n)}))})).catch(console.error)})).catch(console.error);if(n){const e={fieldRenderer:e=>u(e)};n.addRenderer(`${p}.availableProviders`,e)}return s}};const w=[y,f,v,_,b];const C=w},2129:(e,t,n)=>{"use strict";var i=n(40662);var s=n(17325);var o=n(3579);var r=n(36060)},55178:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CONTEXT_PROVIDER_ID:()=>A,Completer:()=>E,CompleterModel:()=>g,CompletionHandler:()=>u,CompletionProviderManager:()=>ie,CompletionTriggerKind:()=>l,ContextCompleterProvider:()=>P,HistoryInlineCompletionProvider:()=>de,ICompletionProviderManager:()=>h,IInlineCompleterFactory:()=>c,InlineCompleter:()=>ne,InlineCompletionTriggerKind:()=>d,KERNEL_PROVIDER_ID:()=>R,KernelCompleterProvider:()=>N,ProviderReconciliator:()=>D,completerWidgetIcon:()=>ae,inlineCompleterIcon:()=>re});var i=n(98335);var s=n(37737);var o=n(42856);var r=n(2336);var a=n(5592);var l;(function(e){e[e["Invoked"]=1]="Invoked";e[e["TriggerCharacter"]=2]="TriggerCharacter";e[e["TriggerForIncompleteCompletions"]=3]="TriggerForIncompleteCompletions"})(l||(l={}));var d;(function(e){e[e["Invoke"]=0]="Invoke";e[e["Automatic"]=1]="Automatic"})(d||(d={}));const c=new a.Token("@jupyterlab/completer:IInlineCompleterFactory","A factory of inline completer widgets.");const h=new a.Token("@jupyterlab/completer:ICompletionProviderManager","A service for the completion providers management.");class u{constructor(e){this._fetchingInline=0;this._editor=null;this._enabled=false;this._isDisposed=false;this._autoCompletion=false;this._continuousInline=true;this._tabCompleterActive=false;this.completer=e.completer;this.inlineCompleter=e.inlineCompleter;this.completer.selected.connect(this.onCompletionSelected,this);this.completer.visibilityChanged.connect(this.onVisibilityChanged,this);this._reconciliator=e.reconciliator}set reconciliator(e){this._reconciliator=e}get editor(){return this._editor}set editor(e){if(e===this._editor){return}let t=this._editor;if(t&&!t.isDisposed){const e=t.model;t.host.classList.remove(i.COMPLETER_ENABLED_CLASS);t.host.classList.remove(i.COMPLETER_ACTIVE_CLASS);e.selections.changed.disconnect(this.onSelectionsChanged,this);e.sharedModel.changed.disconnect(this._onSharedModelChanged,this)}this.completer.reset();this.completer.editor=e;t=this._editor=e;if(t){const e=t.model;this._enabled=false;e.selections.changed.connect(this.onSelectionsChanged,this);const n=e.sharedModel;n.changed.connect(this._onSharedModelChanged,this);this.onSelectionsChanged();if(this.inlineCompleter){this.inlineCompleter.editor=t}}}get isDisposed(){return this._isDisposed}set autoCompletion(e){this._autoCompletion=e}get autoCompletion(){return this._autoCompletion}dispose(){if(this.isDisposed){return}this._isDisposed=true;r.Signal.clearData(this)}invokeInline(){const e=this._editor;if(e){this._makeInlineRequest(e.getCursorPosition(),d.Invoke).catch((e=>{console.warn("Inline invoke request bailed",e)}))}}invoke(){o.MessageLoop.sendMessage(this,u.Msg.InvokeRequest)}processMessage(e){switch(e.type){case u.Msg.InvokeRequest.type:this.onInvokeRequest(e);break;default:break}}getState(e,t){return{text:e.model.sharedModel.getSource(),line:t.line,column:t.column}}onCompletionSelected(e,t){const n=e.model;const i=this._editor;if(!i||!n){return}const s=n.createPatch(t);if(!s){return}const{start:o,end:r,value:a}=s;const l=i.getOffsetAt(i.getCursorPosition());const d={changes:{from:o,to:r,insert:a}};if(l<=r&&l>=o){d.selection={anchor:o+a.length}}i.editor.dispatch(d)}onInvokeRequest(e){if(!this.completer.model){return}if(this.completer.model.original){return}const t=this._editor;if(t){this._makeRequest(t.getCursorPosition(),l.Invoked).catch((e=>{console.warn("Invoke request bailed",e)}))}}onSelectionsChanged(){var e;const t=this.completer.model;const n=this._editor;if(!n){return}const s=(e=this.inlineCompleter)===null||e===void 0?void 0:e.model;if(s){s.handleSelectionChange(n.getSelection())}const o=n.host;if(!t){this._enabled=false;o.classList.remove(i.COMPLETER_ENABLED_CLASS);return}if(t.subsetMatch){return}const r=n.getCursorPosition();const a=n.getLine(r.line);const{start:l,end:d}=n.getSelection();if(l.column!==d.column||l.line!==d.line){this._enabled=false;t.reset(true);o.classList.remove(i.COMPLETER_ENABLED_CLASS);return}if(!a||d.column===0){o.classList.add(i.COMPLETER_LINE_BEGINNING_CLASS)}else if(a&&a.slice(0,r.column).match(/^\s*$/)){o.classList.add(i.COMPLETER_LINE_BEGINNING_CLASS)}else{o.classList.remove(i.COMPLETER_LINE_BEGINNING_CLASS)}if(!this._enabled){this._enabled=true;o.classList.add(i.COMPLETER_ENABLED_CLASS)}t.handleCursorChange(this.getState(n,n.getCursorPosition()))}async onTextChanged(e,t){var n;if(!this._enabled){return}const i=this.completer.model;const s=this.editor;if(!s){return}if(i&&this._autoCompletion&&this._reconciliator.shouldShowContinuousHint&&await this._reconciliator.shouldShowContinuousHint(this.completer.isVisible,t)){void this._makeRequest(s.getCursorPosition(),l.TriggerCharacter)}const o=(n=this.inlineCompleter)===null||n===void 0?void 0:n.model;if(o){o.handleTextChange(t);if(this._continuousInline){void this._makeInlineRequest(s.getCursorPosition(),d.Automatic)}}if(i){const{start:e,end:t}=s.getSelection();if(e.column!==t.column||e.line!==t.line){return}i.handleTextChange(this.getState(s,s.getCursorPosition()))}}onVisibilityChanged(e){var t;if(e.isDisposed||e.isHidden){this._tabCompleterActive=false;if(this._editor){this._editor.host.classList.remove(i.COMPLETER_ACTIVE_CLASS);this._editor.focus()}return}this._tabCompleterActive=true;(t=this._editor)===null||t===void 0?void 0:t.host.classList.add(i.COMPLETER_ACTIVE_CLASS)}async _onSharedModelChanged(e,t){if(t.sourceChange){await this.onTextChanged(e,t)}}_makeRequest(e,t){const n=this.editor;if(!n){return Promise.reject(new Error("No active editor"))}const i=this._composeRequest(n,e);const s=this.getState(n,e);return this._reconciliator.fetch(i,t).then((e=>{var t;if(!e){return}const n=this._updateModel(s,e.start,e.end);if(!n){return}if(this.completer.suppressIfInlineCompleterActive&&((t=this.inlineCompleter)===null||t===void 0?void 0:t.isActive)){return}if(n.setCompletionItems){n.setCompletionItems(e.items)}})).catch((e=>{}))}async _makeInlineRequest(e,t){const n=this.editor;if(!n){return Promise.reject(new Error("No active editor"))}if(!this.inlineCompleter){return Promise.reject(new Error("No inline completer"))}const i=n.getLine(e.line);if(t===d.Automatic&&(typeof i==="undefined"||i.slice(0,e.column).match(/^\s*$/))){this._fetchingInline+=1;return}let s=false;if(typeof i!=="undefined"&&e.column{var t;if(c||!e||!e.items){return}if(a!==this._fetchingInline){return}h.add(d);if(h.size===1){if(((t=this.inlineCompleter)===null||t===void 0?void 0:t.suppressIfTabCompleterActive)&&this._tabCompleterActive){c=true;return}r.setCompletions(e)}else{r.appendCompletions(e)}})).catch((e=>{console.warn(e)})).finally((()=>{h.add(d);const e=l.length-h.size;r.notifyProgress({pendingProviders:e,totalProviders:l.length})}))}}_composeRequest(e,t){const n=e.model.sharedModel.getSource();const i=e.model.mimeType;const o=s.Text.jsIndexToCharIndex(e.getOffsetAt(t),n);return{text:n,offset:o,mimeType:i}}_updateModel(e,t,n){const i=this.completer.model;const o=e.text;if(!i){return null}i.original=e;i.cursor={start:s.Text.charIndexToJsIndex(t,o),end:s.Text.charIndexToJsIndex(n,o)};return i}}(function(e){let t;(function(e){e[e["opened"]=0]="opened";e[e["update"]=1]="update";e[e["closed"]=2]="closed"})(t=e.StraemEvent||(e.StraemEvent={}));let n;(function(e){e.InvokeRequest=new o.Message("invoke-request")})(n=e.Msg||(e.Msg={}))})(u||(u={}));var p=n(34236);function m(e){const t=document.createElement("span");t.textContent=e;return t.innerHTML}class g{constructor(){this.processedItemsCache=null;this._current=null;this._cursor=null;this._isDisposed=false;this._completionItems=[];this._original=null;this._query="";this._subsetMatch=false;this._typeMap={};this._orderedTypes=[];this._stateChanged=new r.Signal(this);this._queryChanged=new r.Signal(this);this._processedToOriginalItem=null;this._resolvingItem=0}get stateChanged(){return this._stateChanged}get queryChanged(){return this._queryChanged}get original(){return this._original}set original(e){const t=this._original===e||this._original&&e&&a.JSONExt.deepEqual(e,this._original);if(t){return}this._reset();this._current=this._original=e;this._stateChanged.emit(undefined)}get current(){return this._current}set current(e){const t=this._current===e||this._current&&e&&a.JSONExt.deepEqual(e,this._current);if(t){return}const n=this._original;if(!n){return}const i=this._cursor;if(!i){return}const s=this._current=e;if(!s){this._stateChanged.emit(undefined);return}const o=n.text.split("\n")[n.line];const r=s.text.split("\n")[s.line];if(!this._subsetMatch&&r.lengthe.processedItem));this._processedToOriginalItem=new WeakMap(t.map((e=>[e.processedItem,e.originalItem])))}else{this.processedItemsCache=this._completionItems.map((e=>this._escapeItemLabel(e)));this._processedToOriginalItem=null}}return this.processedItemsCache}setCompletionItems(e){if(a.JSONExt.deepEqual(e,this._completionItems)){return}this._completionItems=e;this._orderedTypes=f.findOrderedCompletionItemTypes(this._completionItems);this.processedItemsCache=null;this._processedToOriginalItem=null;this._stateChanged.emit(undefined)}typeMap(){return this._typeMap}orderedTypes(){return this._orderedTypes}handleCursorChange(e){if(!this._original){return}const{column:t,line:n}=e;const{current:i,original:s}=this;if(!s){return}if(n!==s.line){this.reset(true);return}if(ts.column+r+d){this.reset(true);return}}handleTextChange(e){const t=this._original;if(!t){return}const{text:n,column:i,line:s}=e;const o=n.split("\n")[s][i-1];if(o&&o.match(/\S/)||e.column>=t.column){this.current=e;return}this.reset(false)}createPatch(e){const t=this._original;const n=this._cursor;const i=this._current;if(!t||!n||!i){return undefined}let{start:s,end:o}=n;o=o+(i.text.length-t.text.length);return{start:s,end:o,value:e}}reset(e=false){if(!e&&this._subsetMatch){return}this._reset();this._stateChanged.emit(undefined)}_markup(e){var t;const n=this._completionItems;let i=[];for(const s of n){const n=s.label.indexOf("(");const o=n>-1?s.label.substring(0,n):s.label;const r=p.StringExt.matchSumOfSquares(m(o),e);if(r){let e=p.StringExt.highlight(m(s.label),r.indices,f.mark);const n=Object.assign({},s);n.label=e.join("");n.insertText=(t=s.insertText)!==null&&t!==void 0?t:s.label;i.push({item:n,score:r.score,originalItem:s})}}i.sort(f.scoreCmp);return i.map((e=>({processedItem:e.item,originalItem:e.originalItem})))}resolveItem(e){let t;if(typeof e==="number"){const n=this.completionItems();if(!n||!n[e]){return undefined}t=n[e]}else{t=e}if(!t){return undefined}let n;if(this._processedToOriginalItem){n=this._processedToOriginalItem.get(t)}else{n=t}if(!n){return undefined}return this._resolveItemByValue(n)}_resolveItemByValue(e){const t=++this._resolvingItem;let n;if(e.resolve){let t;if(e.insertText){t=this.createPatch(e.insertText)}n=e.resolve(t)}else{n=Promise.resolve(e)}return n.then((n=>{this._escapeItemLabel(n,true);Object.keys(n).forEach((t=>{e[t]=n[t]}));e.resolve=undefined;if(t!==this._resolvingItem){return Promise.resolve(null)}return n})).catch((t=>{console.error(t);return Promise.resolve(e)}))}_escapeItemLabel(e,t=false){var n;const i=m(e.label);if(i!==e.label){const s=t?e:Object.assign({},e);s.insertText=(n=e.insertText)!==null&&n!==void 0?n:e.label;s.label=i;return s}return e}_reset(){const e=this._query;this._current=null;this._cursor=null;this._completionItems=[];this._original=null;this._query="";this.processedItemsCache=null;this._processedToOriginalItem=null;this._subsetMatch=false;this._typeMap={};this._orderedTypes=[];if(e){this._queryChanged.emit({newValue:this._query,origin:"reset"})}}}var f;(function(e){const t=["function","instance","class","module","keyword"];const n=t.reduce(((e,t)=>{e[t]=null;return e}),{});function i(e){return`${e}`}e.mark=i;function s(e,t){var n,i,s;const o=e.score-t.score;if(o!==0){return o}return(s=(n=e.item.insertText)===null||n===void 0?void 0:n.localeCompare((i=t.item.insertText)!==null&&i!==void 0?i:""))!==null&&s!==void 0?s:0}e.scoreCmp=s;function o(e){const n=new Set;e.forEach((e=>{if(e.type&&!t.includes(e.type)&&!n.has(e.type)){n.add(e.type)}}));const i=Array.from(n);i.sort(((e,t)=>e.localeCompare(t)));return t.concat(i)}e.findOrderedCompletionItemTypes=o;function r(e){const i=Object.keys(e).map((t=>e[t])).filter((e=>!!e&&!(e in n))).sort(((e,t)=>e.localeCompare(t)));return t.concat(i)}e.findOrderedTypes=r})(f||(f={}));var v=n(72050);var _=n(90943);var b=n(66127);var y=n(76326);var w=n(1143);const C="jp-Completer-item";const x="jp-mod-active";const S="jp-Completer-list";const k="jp-Completer-docpanel";const j=true;const I=10;class E extends w.Widget{constructor(e){var t,n,i,s;super({node:document.createElement("div")});this._activeIndex=0;this._editor=null;this._model=null;this._selected=new r.Signal(this);this._visibilityChanged=new r.Signal(this);this._indexChanged=new r.Signal(this);this._lastSubsetMatch="";this._geometryLock=false;this._geometryCounter=0;this._docPanelExpanded=false;this._renderCounter=0;this.sanitizer=(t=e.sanitizer)!==null&&t!==void 0?t:new v.Sanitizer;this._defaultRenderer=E.getDefaultRenderer(this.sanitizer);this._renderer=(n=e.renderer)!==null&&n!==void 0?n:this._defaultRenderer;this._docPanel=this._createDocPanelNode();this.model=(i=e.model)!==null&&i!==void 0?i:null;this.editor=(s=e.editor)!==null&&s!==void 0?s:null;this.addClass("jp-Completer");this.addClass("jp-ThemedContainer");this._updateConstraints()}_updateConstraints(){const e=document.createElement("div");e.classList.add(S);e.style.visibility="hidden";e.style.overflowY="scroll";document.body.appendChild(e);const t=window.getComputedStyle(e);this._maxHeight=parseInt(t.maxHeight,10);this._minHeight=parseInt(t.minHeight,10);this._scrollbarWidth=e.offsetWidth-e.clientWidth;document.body.removeChild(e);const n=this._createDocPanelNode();this._docPanelWidth=T.measureSize(n,"inline-block").width}get activeIndex(){return this._activeIndex}get editor(){return this._editor}set editor(e){this._editor=e}get selected(){return this._selected}get visibilityChanged(){return this._visibilityChanged}get indexChanged(){return this._indexChanged}get model(){return this._model}set model(e){if(!e&&!this._model||e===this._model){return}if(this._model){this._model.stateChanged.disconnect(this.onModelStateChanged,this);this._model.queryChanged.disconnect(this.onModelQueryChanged,this)}this._model=e;if(this._model){this._model.stateChanged.connect(this.onModelStateChanged,this);this._model.queryChanged.connect(this.onModelQueryChanged,this)}}get renderer(){return this._renderer}set renderer(e){this._renderer=e}set showDocsPanel(e){this._showDoc=e}get showDocsPanel(){return this._showDoc}dispose(){this._sizeCache=undefined;this._model=null;super.dispose()}handleEvent(e){if(this.isHidden||!this._editor){return}switch(e.type){case"keydown":this._evtKeydown(e);break;case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e);break;default:break}}reset(){this._activeIndex=0;this._lastSubsetMatch="";if(this._model){this._model.reset(true)}this._docPanel.style.display="none";this._sizeCache=undefined;this.node.scrollTop=0}selectActive(){const e=this.node.querySelector(`.${x}`);if(!e){this.reset();return}this._selected.emit(e.getAttribute("data-value"));this.reset()}onAfterAttach(e){document.addEventListener("keydown",this,j);document.addEventListener("pointerdown",this,j);document.addEventListener("scroll",this,j)}onBeforeDetach(e){document.removeEventListener("keydown",this,j);document.removeEventListener("pointerdown",this,j);document.removeEventListener("scroll",this,j)}onModelStateChanged(){if(this.isAttached){this._activeIndex=0;this._indexChanged.emit(this._activeIndex);this.update()}}onModelQueryChanged(e,t){if(this._sizeCache&&t.origin==="editorUpdate"){const t=e.completionItems();const n=this._sizeCache.items;const i=n[this._findWidestItemIndex(n)];const s=t[this._findWidestItemIndex(t)];const o=this._getPreferredItemWidthHeuristic();if(t.length!==this._sizeCache.items.length||o(i)!==o(s)){this._sizeCache=undefined}}}onUpdateRequest(e){var t;const n=this._model;if(!n){return}if(!n.query){this._populateSubset()}let i=n.completionItems();if(!i.length){if(!this.isHidden){this.reset();this.hide();this._visibilityChanged.emit(undefined)}return}this._updateConstraints();this._geometryLock=true;const s=this._createCompleterNode(n,i);let o=s.querySelectorAll(`.${C}`)[this._activeIndex];o.classList.add(x);const r=(t=this.model)===null||t===void 0?void 0:t.resolveItem(i[this._activeIndex]);if(this._showDoc){this._docPanel.innerText="";s.appendChild(this._docPanel);this._docPanelExpanded=false;this._docPanel.style.display="none";this._updateDocPanel(r,o)}if(this.isHidden){this.show();this._setGeometry();this._visibilityChanged.emit(undefined)}else{this._setGeometry()}this._geometryLock=false}get sizeCache(){if(!this._sizeCache){return}return{width:this._sizeCache.width+this._sizeCache.docPanelWidth,height:Math.max(this._sizeCache.height,this._sizeCache.docPanelHeight)}}_createDocPanelNode(){const e=document.createElement("div");e.className=k;return e}_createCompleterNode(e,t){const n=++this._renderCounter;let i=this.node;i.textContent="";let s=e.orderedTypes();let o=document.createElement("ul");o.className=S;const r=this._renderer.createCompletionItemNode(t[0],s);const a=[r];const l=T.measureSize(r,"inline-grid");const d=Math.max(Math.ceil(this._maxHeight/l.height),5);const c=Math.min(d+1,t.length);const h=performance.now();for(let g=1;g{if(r>=t.length){return}const e=l.height*(t.length-r);d.style.marginBottom=`${e}px`;requestAnimationFrame((()=>{if(n!=this._renderCounter){return}d.style.marginBottom="";const e=Math.min(t.length,r+i);for(let n=r;n{this._setGeometry()}))}_populateSubset(){const{model:e}=this;if(!e){return false}const t=e.completionItems();const n=T.commonSubset(t.map((e=>e.insertText||e.label)));const{query:i}=e;if(n&&n!==i&&n.indexOf(i)===0){e.query=n;return true}return false}_setGeometry(){const{node:e}=this;const t=this._model;const n=this._editor;if(!n||!t||!t.original||!t.cursor){return}const i=t.cursor.start;const s=n.getPositionAt(i);const o=n.getCoordinateForPosition(s);if(!o){return}const r=window.getComputedStyle(e);const a=parseInt(r.borderLeftWidth,10)||0;const l=parseInt(r.paddingLeft,10)||0;const d=n.host.closest(".jp-MainAreaWidget > .lm-Widget")||n.host;const c=t.completionItems();if(this._sizeCache&&this._sizeCache.items.length!==c.length){this._sizeCache=undefined}b.HoverBox.setGeometry({anchor:o,host:d,maxHeight:this._maxHeight,minHeight:this._minHeight,node:e,size:this.sizeCache,offset:{horizontal:a+l},privilege:"below",style:r,outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}});const h=++this._geometryCounter;if(!this._sizeCache){requestAnimationFrame((()=>{if(h!=this._geometryCounter){return}let t=e.getBoundingClientRect();let n=this._docPanel.getBoundingClientRect();this._sizeCache={width:t.width-n.width,height:t.height,items:c,docPanelWidth:n.width,docPanelHeight:n.height}}))}}_updateDocPanel(e,t){var n,i,s;let o=this._docPanel;if(!e){this._toggleDocPanel(false);return}const r=(s=(i=(n=this._renderer).createLoadingDocsIndicator)===null||i===void 0?void 0:i.call(n))!==null&&s!==void 0?s:this._defaultRenderer.createLoadingDocsIndicator();t.appendChild(r);e.then((e=>{var t,n,i;if(!e){return}if(!o){return}if(e.documentation){const s=(i=(n=(t=this._renderer).createDocumentationNode)===null||n===void 0?void 0:n.call(t,e))!==null&&i!==void 0?i:this._defaultRenderer.createDocumentationNode(e);o.textContent="";o.appendChild(s);this._toggleDocPanel(true)}else{this._toggleDocPanel(false)}})).catch((e=>console.error(e))).finally((()=>{t.removeChild(r)}))}_toggleDocPanel(e){let t=this._docPanel;if(e){if(this._docPanelExpanded){return}t.style.display="";this._docPanelExpanded=true}else{if(!this._docPanelExpanded){return}t.style.display="none";this._docPanelExpanded=false}const n=this._sizeCache;if(n){n.docPanelHeight=e?this._maxHeight:0;n.docPanelWidth=e?this._docPanelWidth:0;if(!this._geometryLock){this._setGeometry()}}}}(function(e){class t{constructor(e){this.sanitizer=(e===null||e===void 0?void 0:e.sanitizer)||new v.Sanitizer}createCompletionItemNode(e,t){let n=this._createWrapperNode(e.insertText||e.label);if(e.deprecated){n.classList.add("jp-Completer-deprecated")}return this._constructNode(n,this._createLabelNode(e.label),!!e.type,e.type,t,e.icon)}createDocumentationNode(e){const t=document.createElement("div");t.classList.add("jp-RenderedText");const n=this.sanitizer;const i=e.documentation||"";(0,_.renderText)({host:t,sanitizer:n,source:i}).catch(console.error);return t}itemWidthHeuristic(e){var t;const n=e.label.replace(/<(\/)?mark>/g,"");return n.length+(((t=e.type)===null||t===void 0?void 0:t.length)||0)}createLoadingDocsIndicator(){const e=document.createElement("div");e.classList.add("jp-Completer-loading-bar-container");const t=document.createElement("div");t.classList.add("jp-Completer-loading-bar");e.append(t);return e}_createWrapperNode(e){const t=document.createElement("li");t.className=C;t.setAttribute("data-value",e);return t}_createLabelNode(e){const t=document.createElement("code");t.className="jp-Completer-match";t.innerHTML=e;return t}_constructNode(e,t,n,i,s,o){if(o){const t=o.element({className:"jp-Completer-type jp-Completer-icon"});e.appendChild(t)}else if(n){const t=document.createElement("span");t.textContent=(i[0]||"").toLowerCase();const n=s.indexOf(i)%I+1;t.className="jp-Completer-type jp-Completer-monogram";t.setAttribute(`data-color-index`,n.toString());e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-monogram";e.appendChild(t)}e.appendChild(t);if(n){e.title=i;const t=document.createElement("code");t.className="jp-Completer-typeExtended";t.textContent=i.toLocaleLowerCase();e.appendChild(t)}else{const t=document.createElement("span");t.className="jp-Completer-typeExtended";e.appendChild(t)}return e}}e.Renderer=t;let n;function i(e){if(!n||e&&n.sanitizer!==e){n=new t({sanitizer:e})}return n}e.getDefaultRenderer=i})(E||(E={}));var T;(function(e){e.keyCodeMap={38:"up",40:"down",33:"pageUp",34:"pageDown"};function t(e){const t=e.length;let n="";if(t<2){return n}const i=e[0].length;for(let s=0;se.resolve?n=>e.resolve(t,this._context,n):undefined;this._fetching=0;this._inlineFetching=0;this._providers=e.providers;this._inlineProviders=(t=e.inlineProviders)!==null&&t!==void 0?t:[];this._inlineProvidersSettings=(n=e.inlineProvidersSettings)!==null&&n!==void 0?n:{};this._context=e.context;this._timeout=e.timeout}async applicableProviders(){const e=this._providers.map((e=>e.isApplicable(this._context)));const t=await Promise.all(e);return this._providers.filter(((e,n)=>t[n]))}fetchInline(e,t,n){let i=[];const s=++this._inlineFetching;for(const o of this._inlineProviders){const a=this._inlineProvidersSettings[o.identifier];if(t!==d.Invoke&&n&&!a.autoFillInMiddle){continue}let l=0;if(t===d.Automatic){l=a.debouncerDelay}const c=()=>{const n=o.fetch(e,{...this._context,triggerKind:t}).then((e=>({...e,items:e.items.map((e=>{const t=e;t.stream=new r.Signal(t);t.provider=o;void this._stream(t,o);return t}))})));const i=new Promise((e=>setTimeout((()=>e(null)),l+a.timeout)));return Promise.race([n,i])};const h=l===0?c():new Promise(((e,t)=>setTimeout((()=>{if(s!=this._inlineFetching){return t(null)}else{return e(c())}}),l)));i.push(h.catch((e=>e)))}return i}async _stream(e,t){if(!e.isIncomplete||!t.stream||!e.token){return}const n=e.stream;const i=e.token;e.token=undefined;e.streaming=true;n.emit(u.StraemEvent.opened);for await(const s of t.stream(i)){const t=s.response;const i=t.insertText.substring(e.insertText.length);e.insertText=t.insertText;e.lastStreamed=i;e.error=s.response.error;n.emit(u.StraemEvent.update)}e.isIncomplete=false;e.lastStreamed=undefined;e.streaming=false;n.emit(u.StraemEvent.closed)}async fetch(e,t){const n=++this._fetching;let i=[];const s=await this.applicableProviders();for(const r of s){let s;s=r.fetch(e,this._context,t).then((e=>{if(n!==this._fetching){return Promise.reject(void 0)}const t=e.items.map((e=>({...e,resolve:this._resolveFactory(r,e)})));return{...e,items:t}}));const o=new Promise((e=>setTimeout((()=>e(null)),this._timeout)));s=Promise.race([s,o]);i.push(s.catch((e=>e)))}const o=Promise.all(i);return this._mergeCompletions(o)}async shouldShowContinuousHint(e,t){const n=await this.applicableProviders();if(n.length===0){return false}if(n[0].shouldShowContinuousHint){return n[0].shouldShowContinuousHint(e,t,this._context)}return this._defaultShouldShowContinuousHint(e,t)}_alignPrefixes(e,t,n){if(t!=n){const t=this._context.editor;if(!t){return e}const i=t.getCursorPosition();const s=t.getLine(i.line);if(!s){return e}const o=t.getOffsetAt({line:i.line,column:0});return e.map((e=>{const t=Math.max(e.start-o,0);const i=Math.max(n-o,0);if(t==i){return e}const r=s.substring(t,i);return{...e,items:e.items.map((e=>{let t=e.insertText||e.label;e.insertText=t.startsWith(r)?t.slice(r.length):t;return e}))}}))}return e}async _mergeCompletions(e){let t=(await e).filter((e=>{if(!e||e instanceof Error){return false}if(!e.items.length){return false}return true}));if(t.length==0){return null}else if(t.length==1){return t[0]}const n=Math.min(...t.map((e=>e.end)));const i=t.map((e=>e.start));const s=Math.min(...i);const o=Math.max(...i);t=this._alignPrefixes(t,s,o);const r=new Set;const a=new Array;for(const l of t){l.items.forEach((e=>{let t=(e.insertText||e.label).trim();if(r.has(t)){return}r.add(t);a.push(e)}))}return{start:o,end:n,items:a}}_defaultShouldShowContinuousHint(e,t){var n,i,s;const o=(s=(i=(n=this._context)===null||n===void 0?void 0:n.editor)===null||i===void 0?void 0:i.model.mimeType)!==null&&s!==void 0?s:"";if(!M(o)){return false}return!e&&(t.sourceChange==null||t.sourceChange.some((e=>e.insert!=null&&e.insert.length>0)))}}const A="CompletionProvider:context";class P{constructor(){this.identifier=A;this.rank=500;this.renderer=null}async isApplicable(e){return true}fetch(e,t){const n=t.editor;if(!n){return Promise.reject("No editor")}return new Promise((e=>{e(L.contextHint(n))}))}}var L;(function(e){function t(e){const t=e.getTokenAtCursor();const i=n(t,e);const s=i.filter((e=>e.type)).map((e=>e.value));const o=new Set(s);const r=new Array;o.forEach((e=>r.push({label:e})));return{start:t.offset,end:t.offset+t.value.length,items:r}}e.contextHint=t;function n(e,t){const n=t.getTokens();return n.filter((t=>t.value.indexOf(e.value)===0&&t.value!==e.value))}})(L||(L={}));const R="CompletionProvider:kernel";class N{constructor(){this.identifier=R;this.rank=550;this.renderer=null}async isApplicable(e){var t;const n=(t=e.session)===null||t===void 0?void 0:t.kernel;if(!n){return false}return true}async fetch(e,t){var n;const i=(n=t.session)===null||n===void 0?void 0:n.kernel;if(!i){throw new Error("No kernel for completion request.")}const s={code:e.text,cursor_pos:e.offset};const o=await i.requestComplete(s);const r=o.content;if(r.status!=="ok"){throw new Error("Completion fetch failed to return successfully.")}const a=new Array;const l=r.metadata._jupyter_types_experimental;r.matches.forEach(((e,t)=>{if(l&&l[t]){a.push({label:e,type:l[t].type,insertText:l[t].text})}else{a.push({label:e})}}));return{start:r.cursor_start,end:r.cursor_end,items:a}}async resolve(e,t,n){const{editor:i,session:o}=t;if(o&&i){let t=i.model.sharedModel.getSource();const r=i.getCursorPosition();let a=s.Text.jsIndexToCharIndex(i.getOffsetAt(r),t);const l=o.kernel;if(!t||!l){return Promise.resolve(e)}if(n){const{start:e,value:i}=n;t=t.substring(0,e)+i;a=a+i.length}const d={code:t,cursor_pos:a,detail_level:0};const c=await l.requestInspect(d);const h=c.content;if(h.status!=="ok"||!h.found){return e}e.documentation=h.data["text/plain"];return e}return e}shouldShowContinuousHint(e,t,n){var i,s;const o=(s=(i=n===null||n===void 0?void 0:n.editor)===null||i===void 0?void 0:i.model.mimeType)!==null&&s!==void 0?s:"";if(!M(o)){return false}const r=t.sourceChange;if(r==null){return true}if(r.some((e=>e.delete!=null))){return false}return r.some((t=>t.insert!=null&&(t.insert==="."||!e&&t.insert.trim().length>0)))}}var O=n(22819);var B=n(71674);const F="jp-GhostText-lineSpacer";const z="jp-GhostText-letterSpacer";const H="jp-GhostText";const W="jp-GhostText-streamedToken";const V="jp-GhostText-streamingIndicator";const U="jp-GhostText-errorIndicator";const q="jp-GhostText-hiddenLines";class ${constructor(e){this.options=e}placeGhost(e,t){const n=[X.addMark.of(t)];if(!e.state.field(X.markField,false)){n.push(B.StateEffect.appendConfig.of([X.markField]));n.push(B.StateEffect.appendConfig.of([O.EditorView.domEventHandlers({blur:t=>{if(this.options.onBlur(t)===false){return true}const n=[X.removeMark.of(null)];setTimeout((()=>{e.dispatch({effects:n})}),0)}})]))}e.dispatch({effects:n})}clearGhosts(e){const t=[X.removeMark.of(null)];e.dispatch({effects:t})}}$.streamingAnimation="uncover";$.spacerRemovalDelay=700;$.spacerRemovalDuration=300;class K extends O.WidgetType{constructor(e){super();this.options=e;this.isSpacer=false;this._clearErrorTimeout=null}eq(e){return e.content==this.content&&e.options.streaming===this.options.streaming&&e.options.error===this.options.error}get lineBreaks(){return(this.content.match(/\n/g)||"").length}updateDOM(e,t){this._updateDOM(e);return true}get content(){return this.options.content}toDOM(){let e=document.createElement("span");if(this.options.onPointerOver){e.addEventListener("pointerover",this.options.onPointerOver)}if(this.options.onPointerLeave){e.addEventListener("pointerleave",this.options.onPointerLeave)}e.classList.add(H);e.dataset.animation=$.streamingAnimation;e.dataset.providedBy=this.options.providerId;this._updateDOM(e);return e}_removeErrorAnimation(e){const t=e.querySelectorAll(`.${U}`);t.forEach((e=>{e.remove()}))}_mountErrorAnimation(e){const t=document.createElement("span");t.className=U;const n=this.options.error;if(n===null||n===void 0?void 0:n.message){t.title=n===null||n===void 0?void 0:n.message}const i=e.querySelectorAll(`.${V}, .${U}`);i.forEach((e=>{e.remove()}));e.appendChild(t)}_updateDOM(e){var t,n;if(this.options.error){this._mountErrorAnimation(e);this._clearErrorTimeout=setTimeout((()=>{this._removeErrorAnimation(e);this._clearErrorTimeout=null}),5e3);return}if(this._clearErrorTimeout!==null){clearTimeout(this._clearErrorTimeout);this._removeErrorAnimation(e);this._clearErrorTimeout=null}let i=this.content;let s="";let o=this.options.addedPart;if(o){if(o.startsWith("\n")){o=o.substring(1)}i=i.substring(0,i.length-o.length)}if(this.options.maxLines){const e=i.split("\n");i=e.slice(0,this.options.maxLines).join("\n");s=e.slice(this.options.maxLines).join("\n")}const r=Math.min((t=this.options.minLines)!==null&&t!==void 0?t:0,(n=this.options.maxLines)!==null&&n!==void 0?n:Infinity);const a=Math.max(0,r-i.split("\n").length+1);const l=new Array(a).fill("").join("\n");if(this.isSpacer){e.innerText=i+l;return}e.innerText=i;let d=e;if(s.length>0){const t=document.createElement("span");t.className="jp-GhostText-hiddenWrapper";e.appendChild(t);const n=document.createElement("span");n.className="jp-GhostText-expandHidden";n.innerText="⇓";const i=document.createElement("span");t.appendChild(n);i.className=q;i.innerText="\n"+s;t.appendChild(i);d=i}if(o){const e=document.createElement("span");e.className=W;e.innerText=o;d.appendChild(e)}if(this.options.streaming){const e=document.createElement("span");e.className=V;d.appendChild(e)}if(l.length>0){const e=document.createTextNode(l);d.appendChild(e)}}destroy(e){if(this.options.onPointerOver){e.removeEventListener("pointerover",this.options.onPointerOver)}if(this.options.onPointerLeave){e.removeEventListener("pointerleave",this.options.onPointerLeave)}super.destroy(e)}}class J extends K{constructor(){super(...arguments);this.isSpacer=true}}class G extends J{toDOM(){const e=super.toDOM();e.classList.add(F);e.style.animationDelay=$.spacerRemovalDelay+"ms";e.style.animationDuration=$.spacerRemovalDuration+"ms";return e}}class Y extends J{get content(){return this.options.content[0]}toDOM(){const e=super.toDOM();e.classList.add(z);return e}}var X;(function(e){let t;(function(e){e[e["Set"]=0]="Set";e[e["Remove"]=1]="Remove";e[e["FilterAndUpdate"]=2]="FilterAndUpdate"})(t||(t={}));e.addMark=B.StateEffect.define({map:(e,t)=>({...e,from:t.mapPos(e.from),to:t.mapPos(e.from+e.content.length)})});e.removeMark=B.StateEffect.define();function n(n){for(let i of n.effects){if(i.is(e.addMark)){return{action:t.Set,spec:i.value}}else if(i.is(e.removeMark)){return{action:t.Remove}}}if(n.docChanged||n.selection){return{action:t.FilterAndUpdate}}return null}function i(e,t){const n=O.Decoration.widget({widget:new K(e),side:1,ghostSpec:e});return n.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))}function s(e,t,n=1e3){if(e.content.length<2){return[]}const i={elapsed:false};setTimeout((()=>{i.elapsed=true}),n);const s=O.Decoration.widget({widget:new Y(e),side:1,timeoutInfo:i});const o=O.Decoration.widget({widget:new G(e),side:1,timeoutInfo:i});return[s.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length)),o.range(Math.min(e.from,t.newDoc.length),Math.min(e.from,t.newDoc.length))]}e.markField=B.StateField.define({create(){return O.Decoration.none},update(e,o){const r=n(o);e=e.update({filter:(e,t,n)=>{if(n.spec.widget instanceof J){return!n.spec.timeoutInfo.elapsed}return true}});if(!r){return e.map(o.changes)}switch(r.action){case t.Set:{const t=r.spec;const n=i(t,o);return e.update({add:[n],filter:(e,t,i)=>i===n.value})}case t.Remove:return e.update({filter:()=>false});case t.FilterAndUpdate:{let t=e.iter();while(t.value&&t.value.spec.widget instanceof J){t.next()}if(!t.value){return e.map(o.changes)}const n=t.value.spec.ghostSpec;const r={...n};let l=false;o.changes.iterChanges(((e,t,n,i,s)=>{if(l){return}if(e===t&&n!==i){for(let e=0;e0?"\n"+t:t;if(r.content.startsWith(n)){r.content=r.content.slice(n.length);r.from+=n.length}else{l=true;break}}}else if(n===i&&e!==t){l=true}else{l=true}}));const d=l?s(n,o):[i(r,o)];const c=d.map((e=>e.value));e=e.update({add:d,filter:(e,t,n)=>c.includes(n)});if(l){try{e=e.map(o.changes)}catch(a){console.warn(a);return O.Decoration.none}}return e}}},provide:e=>O.EditorView.decorations.from(e)})})(X||(X={}));const Q="jp-InlineCompleter";const Z="jp-mod-inline-completer-active";const ee="jp-InlineCompleter-hover";const te="jp-InlineCompleter-progressBar";class ne extends w.Widget{constructor(e){var t,n;super({node:document.createElement("div")});this._clearHoverTimeout=null;this._current=0;this._editor=null;this._lastItem=null;this._model=null;this._providerWidget=new w.Widget;this._showShortcuts=ne.defaultSettings.showShortcuts;this._showWidget=ne.defaultSettings.showWidget;this._suggestionsCounter=new w.Widget;this._toolbar=new b.Toolbar;this.model=(t=e.model)!==null&&t!==void 0?t:null;this.editor=(n=e.editor)!==null&&n!==void 0?n:null;this.addClass(Q);this.addClass("jp-ThemedContainer");this._ghostManager=new $({onBlur:this._onEditorBlur.bind(this)});this._trans=e.trans;const i=this.layout=new w.PanelLayout;i.addWidget(this._suggestionsCounter);i.addWidget(this.toolbar);i.addWidget(this._providerWidget);this._progressBar=document.createElement("div");this._progressBar.className=te;this.node.appendChild(this._progressBar);this._updateShortcutsVisibility();this._updateDisplay();this.node.tabIndex=0}get toolbar(){return this._toolbar}get editor(){return this._editor}set editor(e){var t;(t=this.model)===null||t===void 0?void 0:t.reset();this._editor=e}get model(){return this._model}set model(e){if(!e&&!this._model||e===this._model){return}if(this._model){this._model.suggestionsChanged.disconnect(this._onModelSuggestionsChanged,this);this._model.filterTextChanged.disconnect(this._onModelFilterTextChanged,this);this._model.provisionProgress.disconnect(this._onProvisionProgress,this)}this._model=e;if(this._model){this._model.suggestionsChanged.connect(this._onModelSuggestionsChanged,this);this._model.filterTextChanged.connect(this._onModelFilterTextChanged,this);this._model.provisionProgress.connect(this._onProvisionProgress,this)}}cycle(e){var t,n;const i=(n=(t=this.model)===null||t===void 0?void 0:t.completions)===null||n===void 0?void 0:n.items;if(!i){return}if(e==="next"){const e=this._current+1;this._current=e===i.length?0:e}else{const e=this._current-1;this._current=e===-1?i.length-1:e}this._updateStreamTracking();this._render()}accept(){const e=this.model;const t=this.current;const n=this._editor;if(!n||!e||!t){return}const i=e.cursor;const s=t.insertText;const o=n.getOffsetAt(n.getCursorPosition());const r=n.getOffsetAt(i);const a=r;const l=o;const d={changes:{from:a,to:l,insert:s}};if(o<=l&&o>=a){d.selection={anchor:a+s.length}}n.editor.dispatch(d);e.reset();this.update()}get current(){var e;const t=(e=this.model)===null||e===void 0?void 0:e.completions;if(!t){return null}return t.items[this._current]}_updateStreamTracking(){if(this._lastItem){this._lastItem.stream.disconnect(this._onStream,this)}const e=this.current;if(e){e.stream.connect(this._onStream,this)}this._lastItem=e}_onStream(e,t){var n;const i=(n=this.model)===null||n===void 0?void 0:n.completions;if(!i||!i.items||i.items.length===0){return}if(this.isHidden){return}const s=i.items[this._current];this._setText(s)}configure(e){this._showWidget=e.showWidget;this._updateDisplay();if(e.showShortcuts!==this._showShortcuts){this._showShortcuts=e.showShortcuts;this._updateShortcutsVisibility()}$.streamingAnimation=e.streamingAnimation;$.spacerRemovalDelay=Math.max(0,e.editorResizeDelay-300);$.spacerRemovalDuration=Math.max(0,Math.min(300,e.editorResizeDelay-300));this._minLines=e.minLines;this._maxLines=e.maxLines;this._reserveSpaceForLongest=e.reserveSpaceForLongest;this._suppressIfTabCompleterActive=e.suppressIfTabCompleterActive}get suppressIfTabCompleterActive(){return this._suppressIfTabCompleterActive}get isActive(){var e;return!!((e=this.editor)===null||e===void 0?void 0:e.host.classList.contains(Z))}handleEvent(e){if(this.isHidden||!this._editor){return}switch(e.type){case"pointerdown":this._evtPointerdown(e);break;case"scroll":this._evtScroll(e);break;default:break}}onUpdateRequest(e){super.onUpdateRequest(e);const t=this._model;if(!t){return}let n=t.completions;if(!n||!n.items||n.items.length===0){if(!this.isHidden){this.hide()}return}if(this.isHidden){this.show();this._setGeometry()}}onAfterAttach(e){document.addEventListener("scroll",this,true);document.addEventListener("pointerdown",this,true)}onBeforeDetach(e){document.removeEventListener("scroll",this,true);document.removeEventListener("pointerdown",this,true)}_evtPointerdown(e){var t;if(this.isHidden||!this._editor){return}const n=e.target;if(this.node.contains(n)){return true}this.hide();(t=this.model)===null||t===void 0?void 0:t.reset()}_evtScroll(e){if(this.isHidden||!this._editor){return}const{node:t}=this;if(t.contains(e.target)){return}requestAnimationFrame((()=>{this._setGeometry()}))}_onEditorBlur(e){var t;if(this.node.contains(e.relatedTarget)){return false}(t=this._editor)===null||t===void 0?void 0:t.host.classList.remove(Z);this.hide()}_onModelSuggestionsChanged(e,t){var n;if(!this.isAttached){this.update();return}if(t.event==="set"){this._current=(n=t.indexMap.get(this._current))!==null&&n!==void 0?n:0}else if(t.event==="clear"){const e=this.editor;if(e){this._ghostManager.clearGhosts(e.editor);e.host.classList.remove(Z)}}this._updateStreamTracking();this.update();this._render()}_onModelFilterTextChanged(e,t){var n,i;const s=(n=this.model)===null||n===void 0?void 0:n.completions;if(!s||!s.items||s.items.length===0){return}this._current=(i=t.get(this._current))!==null&&i!==void 0?i:0;this._updateStreamTracking();setTimeout((()=>{this._render();this._setGeometry()}),0)}_onProvisionProgress(e,t){requestAnimationFrame((()=>{if(t.pendingProviders===0){this._progressBar.style.display="none"}else{this._progressBar.style.display="";this._progressBar.style.width=100*t.pendingProviders/t.totalProviders+"%"}}))}_render(){var e,t;const n=(e=this.model)===null||e===void 0?void 0:e.completions;if(!n||!n.items||n.items.length===0){return}const i=n.items[this._current];this._setText(i);if(this._showWidget==="never"){return}this._suggestionsCounter.node.innerText=this._trans.__("%1/%2",this._current+1,n.items.length);this._providerWidget.node.title=this._trans.__("Provider: %1",i.provider.name);const s=(t=i.provider.icon)!==null&&t!==void 0?t:b.kernelIcon;s.render(this._providerWidget.node)}_setText(e){var t,n,i;const s=e.insertText;const o=this._editor;const r=this._model;if(!r||!o){return}const a=o.editor;let l;if(this._reserveSpaceForLongest){const e=(i=(n=(t=this.model)===null||t===void 0?void 0:t.completions)===null||n===void 0?void 0:n.items)!==null&&i!==void 0?i:[];const s=Math.max(...e.map((e=>e.insertText.split("\n").length)));l=Math.max(this._minLines,s)}else{l=this._minLines}this._ghostManager.placeGhost(a,{from:o.getOffsetAt(r.cursor),content:s,providerId:e.provider.identifier,addedPart:e.lastStreamed,streaming:e.streaming,minLines:l,maxLines:this._maxLines,onPointerOver:this._onPointerOverGhost.bind(this),onPointerLeave:this._onPointerLeaveGhost.bind(this),error:e.error});o.host.classList.add(Z)}_onPointerOverGhost(){if(this._clearHoverTimeout!==null){window.clearTimeout(this._clearHoverTimeout);this._clearHoverTimeout=null}this.node.classList.add(ee)}_onPointerLeaveGhost(){this._clearHoverTimeout=window.setTimeout((()=>this.node.classList.remove(ee)),500)}_setGeometry(){const{node:e}=this;const t=this._model;const n=this._editor;if(!n||!t||!t.cursor){return}const i=n.host.closest(".jp-MainAreaWidget > .lm-Widget")||n.host;let s;try{const e=n.getCoordinateForPosition(t.cursor);if(!e){throw Error("No coordinates for cursor position")}s=e}catch(o){this.hide();return}b.HoverBox.setGeometry({anchor:s,host:i,maxHeight:40,minHeight:20,node:e,privilege:"forceAbove",outOfViewDisplay:{top:"stick-outside",bottom:"stick-inside",left:"stick-inside",right:"stick-outside"}})}_updateShortcutsVisibility(){this.node.dataset.showShortcuts=this._showShortcuts+""}_updateDisplay(){this.node.dataset.display=this._showWidget}}(function(e){e.defaultSettings={showWidget:"onHover",showShortcuts:true,streamingAnimation:"uncover",providers:{},minLines:2,maxLines:4,editorResizeDelay:1e3,reserveSpaceForLongest:false,suppressIfTabCompleterActive:true};class t{constructor(){this.suggestionsChanged=new r.Signal(this);this.filterTextChanged=new r.Signal(this);this.provisionProgress=new r.Signal(this);this._isDisposed=false;this._completions=null}setCompletions(e){var t,n;const i=new Map((n=(t=this._completions)===null||t===void 0?void 0:t.items)===null||n===void 0?void 0:n.map(((e,t)=>[e.insertText,t])));this._completions=e;const s=new Map(e.items.map(((e,t)=>[i.get(e.insertText),t])));this.suggestionsChanged.emit({event:"set",indexMap:s})}appendCompletions(e){if(!this._completions||!this._completions.items){console.warn("No completions to append to");return}this._completions.items.push(...e.items);this.suggestionsChanged.emit({event:"append"})}notifyProgress(e){this.provisionProgress.emit(e)}get cursor(){return this._cursor}set cursor(e){this._cursor=e}get completions(){return this._completions}reset(){this._completions=null;this.suggestionsChanged.emit({event:"clear"})}get isDisposed(){return this._isDisposed}handleTextChange(e){var t;const n=this._completions;if(!n||!n.items||n.items.length===0){return}const i=new Map(n.items.map(((e,t)=>[e,t])));for(let o of(t=e.sourceChange)!==null&&t!==void 0?t:[]){const e=o.insert;if(e){const t=n.items.filter((t=>{var n;const i=(n=t.filterText)!==null&&n!==void 0?n:t.insertText;if(!i.startsWith(e)){return false}t.filterText=i.substring(e.length);t.insertText=t.insertText.substring(e.length);return true}));if(t.length===0){this._completions=null}n.items=t}else{if(!o.retain){this._completions=null}}}const s=new Map(n.items.map(((e,t)=>[i.get(e),t])));this.filterTextChanged.emit(s)}handleSelectionChange(e){const t=this.cursor;if(!t){return}const{start:n,end:i}=e;if(n.column!==i.column||n.line!==i.line){this.reset()}if(n.line!==t.line||n.columnt.completer.showDocsPanel=e));this._showDoc=e}setSuppressIfInlineCompleterActive(e){this._panelHandlers.forEach((t=>t.completer.suppressIfInlineCompleterActive=e));this._suppressIfInlineCompleterActive=e}setContinuousHinting(e){this._panelHandlers.forEach((t=>t.autoCompletion=e));this._autoCompletion=e}registerProvider(e){const t=e.identifier;if(this._providers.has(t)){console.warn(`Completion provider with identifier ${t} is already registered`)}else{this._providers.set(t,e);this._panelHandlers.forEach(((e,t)=>{void this.updateCompleter(this._mostRecentContext.get(t))}))}}registerInlineProvider(e){const t=e.identifier;if(this._inlineProviders.has(t)){console.warn(`Completion provider with identifier ${t} is already registered`)}else{this._inlineProviders.set(t,e);this._panelHandlers.forEach(((e,t)=>{void this.updateCompleter(this._mostRecentContext.get(t))}))}}getProviders(){return this._providers}activateProvider(e){this._activeProviders=new Set([]);e.forEach((e=>{if(this._providers.has(e)){this._activeProviders.add(e)}}));if(this._activeProviders.size===0){this._activeProviders.add(R);this._activeProviders.add(A)}this._activeProvidersChanged.emit()}async updateCompleter(e){var t,n;const{widget:i,editor:s,sanitizer:o}=e;const r=i.id;const a=this._panelHandlers.get(r);const l=[...this._activeProviders][0];const d=this._providers.get(l);let c=(t=d===null||d===void 0?void 0:d.renderer)!==null&&t!==void 0?t:E.getDefaultRenderer(o);const h=d===null||d===void 0?void 0:d.modelFactory;let u;if(h){u=await h.call(d,e)}else{u=new g}this._mostRecentContext.set(i.id,e);const p={model:u,editor:s,renderer:c,sanitizer:o,showDoc:this._showDoc};if(!a){const t=await this._generateHandler(e,p);this._panelHandlers.set(i.id,t);t.completer.selected.connect(((e,t)=>this._selected.emit({insertText:t})));i.disposed.connect((e=>{this.disposeHandler(e.id,t);this._mostRecentContext.delete(r)}))}else{const t=a.completer;(n=t.model)===null||n===void 0?void 0:n.dispose();t.model=p.model;t.renderer=p.renderer;t.showDocsPanel=p.showDoc;t.suppressIfInlineCompleterActive=this._suppressIfInlineCompleterActive;a.autoCompletion=this._autoCompletion;if(s){a.editor=s;a.reconciliator=await this.generateReconciliator(e)}}}invoke(e){const t=this._panelHandlers.get(e);if(t){t.invoke()}}select(e){const t=this._panelHandlers.get(e);if(t){t.completer.selectActive()}}setInlineCompleterFactory(e){this._inlineCompleterFactory=e;this._panelHandlers.forEach(((e,t)=>{void this.updateCompleter(this._mostRecentContext.get(t))}));if(this.inline){return}this.inline={invoke:e=>{const t=this._panelHandlers.get(e);if(t&&t.inlineCompleter){t.invokeInline()}},isActive:e=>{const t=this._panelHandlers.get(e);if(t&&t.inlineCompleter){return t.inlineCompleter.isActive}return false},cycle:(e,t)=>{const n=this._panelHandlers.get(e);if(n&&n.inlineCompleter){n.inlineCompleter.cycle(t)}},accept:e=>{const t=this._panelHandlers.get(e);if(t&&t.inlineCompleter){t.inlineCompleter.accept()}},configure:e=>{this._inlineCompleterSettings=e;for(const[t,n]of this._inlineProviders.entries()){if(n.configure){n.configure(e.providers[t])}}this._panelHandlers.forEach(((t,n)=>{if(t.inlineCompleter){t.inlineCompleter.configure(e)}void this.updateCompleter(this._mostRecentContext.get(n))}))}}}get inlineProviders(){return[...this._inlineProviders.values()]}async generateReconciliator(e){const t=[];for(const[s,o]of Object.entries(this._inlineCompleterSettings.providers)){if(o.enabled===true){t.push(s)}}const n=[...this._inlineProviders.values()].filter((e=>t.includes(e.identifier)));const i=[];for(const s of this._activeProviders){const e=this._providers.get(s);if(e){i.push(e)}}return new D({context:e,providers:i,inlineProviders:n,inlineProvidersSettings:this._inlineCompleterSettings.providers,timeout:this._timeout})}disposeHandler(e,t){var n,i,s,o;(n=t.completer.model)===null||n===void 0?void 0:n.dispose();t.completer.dispose();(s=(i=t.inlineCompleter)===null||i===void 0?void 0:i.model)===null||s===void 0?void 0:s.dispose();(o=t.inlineCompleter)===null||o===void 0?void 0:o.dispose();t.dispose();this._panelHandlers.delete(e)}async _generateHandler(e,t){const n=new E(t);const i=this._inlineCompleterFactory?this._inlineCompleterFactory.factory({...t,model:new ne.Model}):undefined;n.hide();w.Widget.attach(n,document.body);if(i){w.Widget.attach(i,document.body);i.hide();i.configure(this._inlineCompleterSettings)}const s=await this.generateReconciliator(e);const o=new u({completer:n,inlineCompleter:i,reconciliator:s});o.editor=e.editor;return o}}const se='\n \n \n\n';const oe='\n\n\n\n';const re=new b.LabIcon({name:"completer:inline",svgstr:se});const ae=new b.LabIcon({name:"completer:widget",svgstr:oe});var le=n(61927);class de{constructor(e){this.options=e;this.identifier="@jupyterlab/inline-completer:history";this._maxSuggestions=100;const t=e.translator||le.nullTranslator;this._trans=t.load("jupyterlab")}get name(){return this._trans.__("History")}get icon(){return b.historyIcon}get schema(){return{properties:{maxSuggestions:{title:this._trans.__("Maximum number of suggestions"),description:this._trans.__("The maximum number of suggestions to retrieve from history."),type:"number"}},default:{enabled:false,maxSuggestions:100}}}configure(e){var t;this._maxSuggestions=(t=e.maxSuggestions)!==null&&t!==void 0?t:100}async fetch(e,t,n){var i;const s=(i=t.session)===null||i===void 0?void 0:i.kernel;if(!s){throw new Error("No kernel for completion request.")}const o=e.text.slice(0,e.offset);const r=o.split("\n").slice(-1)[0];const a=e.text.slice(e.offset).split("\n")[0];let l;const d=[];if(r===""){l={output:false,raw:true,hist_access_type:"tail",n:this._maxSuggestions};const e=await s.requestHistory(l);if(e.content.status==="ok"){let t=e.content.history;const n=new Map;for(const e of t.reverse()){const t=e[2];n.set(t,(n.get(t)||0)+1)}const i=Array.from(n.entries());const s=i.sort(((e,t)=>{if(e[1]>t[1]){return-1}else if(e[1]{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(23359);var a=n(5893);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(57331);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},70802:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>A});var i=n(74991);var s=n(72050);var o=n(98335);var r=n(26087);var a=n(16015);var l=n(45231);var d=n(11447);var c=n(56759);var h=n(90943);var u=n(15615);var p=n(61927);var m=n(66127);var g=n(34236);var f=n(5592);var v=n(90044);var _=n(1143);var b=n(94466);const y={id:"@jupyterlab/console-extension:foreign",description:"Add foreign handler of IOPub messages to the console.",requires:[a.IConsoleTracker,u.ISettingRegistry,p.ITranslator],optional:[s.ICommandPalette],activate:C,autoStart:true};const w=y;function C(e,t,n,i,s){var o;const r=i.load("jupyterlab");const{shell:l}=e;t.widgetAdded.connect(((e,t)=>{const i=t.console;const s=new a.ForeignHandler({sessionContext:i.sessionContext,parent:i});x.foreignHandlerProperty.set(i,s);void n.get("@jupyterlab/console-extension:tracker","showAllKernelActivity").then((({composite:e})=>{const t=e;s.enabled=t}));i.disposed.connect((()=>{s.dispose()}))}));const{commands:d}=e;const c=r.__("Console");const h="console:toggle-show-all-kernel-activity";function u(e){const n=t.currentWidget;const i=e["activate"]!==false;if(i&&n){l.activateById(n.id)}return n}d.addCommand(h,{label:e=>r.__("Show All Kernel Activity"),execute:e=>{const t=u(e);if(!t){return}const n=x.foreignHandlerProperty.get(t.console);if(n){n.enabled=!n.enabled}},isToggled:()=>{var e;return t.currentWidget!==null&&!!((e=x.foreignHandlerProperty.get(t.currentWidget.console))===null||e===void 0?void 0:e.enabled)},isEnabled:()=>t.currentWidget!==null&&t.currentWidget===l.currentWidget});const p=()=>{d.notifyCommandChanged(h)};t.currentChanged.connect(p);(o=l.currentChanged)===null||o===void 0?void 0:o.connect(p);if(s){s.addItem({command:h,category:c,args:{isPalette:true}})}}var x;(function(e){e.foreignHandlerProperty=new b.AttachedProperty({name:"foreignHandler",create:()=>undefined})})(x||(x={}));const S={id:"@jupyterlab/console-extension:cell-executor",description:"Provides the console cell executor.",autoStart:true,provides:a.IConsoleCellExecutor,activate:()=>Object.freeze({runCell:a.runCell})};var k;(function(e){e.autoClosingBrackets="console:toggle-autoclosing-brackets";e.create="console:create";e.clear="console:clear";e.runUnforced="console:run-unforced";e.runForced="console:run-forced";e.linebreak="console:linebreak";e.interrupt="console:interrupt-kernel";e.restart="console:restart-kernel";e.closeAndShutdown="console:close-and-shutdown";e.open="console:open";e.inject="console:inject";e.changeKernel="console:change-kernel";e.getKernel="console:get-kernel";e.interactionMode="console:interaction-mode";e.redo="console:redo";e.replaceSelection="console:replace-selection";e.shutdown="console:shutdown";e.undo="console:undo";e.invokeCompleter="completer:invoke-console";e.selectCompleter="completer:select-console"})(k||(k={}));const j={id:"@jupyterlab/console-extension:tracker",description:"Provides the console widget tracker.",provides:a.IConsoleTracker,requires:[a.ConsolePanel.IContentFactory,o.IEditorServices,a.IConsoleCellExecutor,h.IRenderMimeRegistry,u.ISettingRegistry],optional:[i.ILayoutRestorer,l.IDefaultFileBrowser,c.IMainMenu,s.ICommandPalette,d.ILauncher,i.ILabStatus,s.ISessionContextDialogs,m.IFormRendererRegistry,p.ITranslator,s.ISessionContextDialogs,s.IToolbarWidgetRegistry],activate:P,autoStart:true};const I={id:"@jupyterlab/console-extension:factory",description:"Provides the console widget content factory.",provides:a.ConsolePanel.IContentFactory,requires:[o.IEditorServices],autoStart:true,activate:(e,t)=>{const n=t.factoryService.newInlineEditor;return new a.ConsolePanel.ContentFactory({editorFactory:n})}};const E={id:"@jupyterlab/console-extension:kernel-status",description:"Adds the console to the kernel status indicator model.",autoStart:true,requires:[a.IConsoleTracker,s.IKernelStatusModel],activate:(e,t,n)=>{const i=e=>{let n=null;if(e&&t.has(e)){return e.sessionContext}return n};n.addSessionProvider(i)}};const T={id:"@jupyterlab/console-extension:cursor-position",description:"Adds the console to the code editor cursor position model.",autoStart:true,requires:[a.IConsoleTracker,o.IPositionModel],activate:(e,t,n)=>{let i=null;const s=async e=>{let s=null;if(e!==i){i===null||i===void 0?void 0:i.console.promptCellCreated.disconnect(n.update);i=null;if(e&&t.has(e)){e.console.promptCellCreated.connect(n.update);const t=e.console.promptCell;s=null;if(t){await t.ready;s=t.editor}i=e}}else if(e){const t=e.console.promptCell;s=null;if(t){await t.ready;s=t.editor}}return s};n.addEditorProvider(s)}};const M={id:"@jupyterlab/console-extension:completer",description:"Adds completion to the console.",autoStart:true,requires:[a.IConsoleTracker],optional:[r.ICompletionProviderManager,p.ITranslator,s.ISanitizer],activate:L};const D=[I,j,w,E,T,M,S];const A=D;async function P(e,t,n,i,o,r,l,d,c,h,u,b,y,w,C,x,S){var j;const I=C!==null&&C!==void 0?C:p.nullTranslator;const E=I.load("jupyterlab");const T=e.serviceManager;const{commands:M,shell:D}=e;const A=E.__("Console");const P=y!==null&&y!==void 0?y:new s.SessionContextDialogs({translator:I});const L="@jupyterlab/console-extension:tracker";const R=["top","bottom","left","right"];let N;if(S){const e="ConsolePanel";N=(0,s.createToolbarFactory)(S,r,e,L,I);if(x){S.addFactory(e,"kernelName",(e=>s.Toolbar.createKernelNameItem(e.sessionContext,x,I)))}S.addFactory(e,"kernelStatus",(e=>{const t=e.sessionContext;const n=s.Toolbar.createKernelStatusItem(t);return n}));const t=new _.Menu({commands:M});t.addClass("jp-CodeConsolePromptMenu");R.forEach((e=>{t.addItem({command:`console:prompt-to-${e}`})}));S.addFactory(e,"promptPosition",(e=>{const n=new m.ToolbarButton({tooltip:E.__("Change Console Prompt Position"),icon:m.dotsIcon,onClick:()=>{const e=n.node.getBoundingClientRect().right;const i=n.node.getBoundingClientRect().bottom;t.open(e,i,{horizontalAlignment:"right"})}});return n}))}const O=new s.WidgetTracker({namespace:"console"});if(l){void l.restore(O,{command:k.create,args:e=>{const{path:t,name:n,kernelPreference:i}=e.console.sessionContext;return{path:t,name:n,kernelPreference:{...i}}},name:e=>{var t;return(t=e.console.sessionContext.path)!==null&&t!==void 0?t:f.UUID.uuid4()},when:T.ready})}if(u){void T.ready.then((()=>{let e=null;const t=()=>{if(e){e.dispose();e=null}const t=T.kernelspecs.specs;if(!t){return}e=new v.DisposableSet;for(const n in t.kernelspecs){const i=n===t.default?0:Infinity;const s=t.kernelspecs[n];const o=s.resources["logo-svg"]||s.resources["logo-64x64"];e.add(u.add({command:k.create,args:{isLauncher:true,kernelPreference:{name:n}},category:E.__("Console"),rank:i,kernelIconUrl:o,metadata:{kernel:f.JSONExt.deepCopy(s.metadata||{})}}))}};t();T.kernelspecs.specsChanged.connect(t)}))}async function B(e){var l,d;await T.ready;const c=new a.ConsolePanel({manager:T,contentFactory:t,mimeTypeService:n.mimeTypeService,rendermime:o,sessionDialogs:P,executor:i,translator:I,setBusy:(l=b&&(()=>b.setBusy()))!==null&&l!==void 0?l:undefined,...e});if(N){(0,s.setToolbar)(c,N)}const h=(await r.get("@jupyterlab/console-extension:tracker","interactionMode")).composite;c.console.node.dataset.jpInteractionMode=h;await O.add(c);c.sessionContext.propertyChanged.connect((()=>{void O.save(c)}));if(e.subshell){c.sessionContext.kernelChanged.connect((async()=>{if(!c.sessionContext.isDisposed){c.sessionContext.ready.then((async()=>{if(c.sessionContext.session===null){console.error("Cannot create subshell without session")}else if(c.sessionContext.session.kernel===null){console.error("Cannot create subshell without kernel")}else{const{kernel:e}=c.sessionContext.session;await e.info;const t=await e.requestCreateSubshell({}).done;e.subshellId=t.content.subshell_id}})).catch((e=>{console.error("Failed to initialize SessionContext or create new subshell.",e)}))}}))}D.add(c,"main",{ref:e.ref,mode:e.insertMode,activate:e.activate!==false,type:(d=e.type)!==null&&d!==void 0?d:"Console"});return c}let F;let z;let H;let W;let V={};let U;let q;async function $(e){F=(await r.get(L,"clearCellsOnExecute")).composite;z=(await r.get(L,"clearCodeContentOnExecute")).composite;H=(await r.get(L,"hideCodeInput")).composite;W=(await r.get(L,"interactionMode")).composite;V=(await r.get(L,"promptCellConfig")).composite;U=(await r.get(L,"promptCellPosition")).composite;q=(await r.get(L,"showBanner")).composite;const t=e=>{var t,n;e.console.node.dataset.jpInteractionMode=W;e.console.editorConfig=V;(n=(t=e.console.promptCell)===null||t===void 0?void 0:t.editor)===null||n===void 0?void 0:n.setOptions(V);e.console.setConfig({clearCellsOnExecute:F,clearCodeContentOnExecute:z,hideCodeInput:H,promptCellPosition:U,showBanner:q})};if(e){t(e)}else{O.forEach(t)}}r.pluginChanged.connect(((e,t)=>{if(t===L){void $()}}));await $();if(w){const e=w.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");if(e){w.addRenderer("@jupyterlab/console-extension:tracker.promptCellConfig",e)}}O.widgetAdded.connect(((e,t)=>{void $(t)}));M.addCommand(k.autoClosingBrackets,{execute:async e=>{var t;V.autoClosingBrackets=!!((t=e["force"])!==null&&t!==void 0?t:!V.autoClosingBrackets);await r.set(L,"promptCellConfig",V)},label:E.__("Auto Close Brackets for Code Console Prompt"),isToggled:()=>V.autoClosingBrackets});function K(){return O.currentWidget!==null&&O.currentWidget===D.currentWidget}M.addCommand(k.open,{label:E.__("Open a console for the provided `path`."),execute:e=>{const t=e["path"];const n=O.find((e=>{var n;return((n=e.console.sessionContext.session)===null||n===void 0?void 0:n.path)===t}));if(n){if(e.activate!==false){D.activateById(n.id)}return n}else{return T.ready.then((()=>{const n=(0,g.find)(T.sessions.running(),(e=>e.path===t));if(n){return B(e)}return Promise.reject(`No running kernel session for path: ${t}`)}))}}});M.addCommand(k.create,{label:e=>{var t,n,i,s;if(e["isPalette"]){return E.__("New Console")}else if(e["isLauncher"]&&e["kernelPreference"]){const o=e["kernelPreference"];return(s=(i=(n=(t=T.kernelspecs)===null||t===void 0?void 0:t.specs)===null||n===void 0?void 0:n.kernelspecs[o.name||""])===null||i===void 0?void 0:i.display_name)!==null&&s!==void 0?s:""}return E.__("Console")},icon:e=>e["isPalette"]?undefined:m.consoleIcon,execute:e=>{var t;const n=(t=e["basePath"]||e["cwd"]||(d===null||d===void 0?void 0:d.model.path))!==null&&t!==void 0?t:"";return B({basePath:n,...e})}});function J(e){var t;const n=e[s.SemanticCommand.WIDGET]?(t=O.find((t=>t.id===e[s.SemanticCommand.WIDGET])))!==null&&t!==void 0?t:null:O.currentWidget;const i=e["activate"]!==false;if(i&&n){D.activateById(n.id)}return n}const G={top:m.dockTopIcon,bottom:m.dockBottomIcon,right:m.dockRightIcon,left:m.dockLeftIcon};R.forEach((e=>{const t=`console:prompt-to-${e}`;M.addCommand(t,{execute:t=>{const n=J(t);if(!n){return}n.console.setConfig({promptCellPosition:e})},isEnabled:K,label:E.__(`Prompt to ${e}`),icon:t=>t["isPalette"]?undefined:G[e]});if(h){h.addItem({command:t,category:A,args:{isPalette:true}})}}));M.addCommand(k.undo,{execute:e=>{var t;const n=J(e);if(!n){return}const i=(t=n.console.promptCell)===null||t===void 0?void 0:t.editor;if(!i){return}i.undo()},isEnabled:e=>{var t,n,i;if(!K()){return false}const s=(i=(n=(t=J(e))===null||t===void 0?void 0:t.console)===null||n===void 0?void 0:n.promptCell)===null||i===void 0?void 0:i.editor;if(!s){return false}return s.model.sharedModel.canUndo()},icon:m.undoIcon.bindprops({stylesheet:"menuItem"}),label:E.__("Undo")});M.addCommand(k.redo,{execute:e=>{var t;const n=J(e);if(!n){return}const i=(t=n.console.promptCell)===null||t===void 0?void 0:t.editor;if(!i){return}i.redo()},isEnabled:e=>{var t,n,i;if(!K()){return false}const s=(i=(n=(t=J(e))===null||t===void 0?void 0:t.console)===null||n===void 0?void 0:n.promptCell)===null||i===void 0?void 0:i.editor;if(!s){return false}return s.model.sharedModel.canRedo()},icon:m.redoIcon.bindprops({stylesheet:"menuItem"}),label:E.__("Redo")});M.addCommand(k.clear,{label:E.__("Clear Console Cells"),icon:e=>e.toolbar?m.clearIcon:undefined,execute:e=>{const t=J(e);if(!t){return}t.console.clear()},isEnabled:K});M.addCommand(k.runUnforced,{label:E.__("Run Cell (unforced)"),icon:e=>e.toolbar?m.runIcon:undefined,execute:e=>{const t=J(e);if(!t){return}return t.console.execute()},isEnabled:K});M.addCommand(k.runForced,{label:E.__("Run Cell (forced)"),icon:e=>e.toolbar?m.runIcon:undefined,execute:e=>{const t=J(e);if(!t){return}return t.console.execute(true)},isEnabled:K});M.addCommand(k.linebreak,{label:E.__("Insert Line Break"),execute:e=>{const t=J(e);if(!t){return}t.console.insertLinebreak()},isEnabled:K});M.addCommand(k.replaceSelection,{label:E.__("Replace Selection in Console"),execute:e=>{const t=J(e);if(!t){return}const n=e["text"]||"";t.console.replaceSelection(n)},isEnabled:K});M.addCommand(k.interrupt,{label:E.__("Interrupt Kernel"),execute:e=>{var t;const n=J(e);if(!n){return}const i=(t=n.console.sessionContext.session)===null||t===void 0?void 0:t.kernel;if(i){return i.interrupt()}},isEnabled:K});M.addCommand(k.restart,{label:E.__("Restart Kernel…"),icon:e=>e.toolbar?m.refreshIcon:undefined,execute:e=>{const t=J(e);if(!t){return}return P.restart(t.console.sessionContext)},isEnabled:K});M.addCommand(k.shutdown,{label:E.__("Shut Down"),execute:e=>{const t=J(e);if(!t){return}return t.console.sessionContext.shutdown()}});M.addCommand(k.closeAndShutdown,{label:E.__("Close and Shut Down…"),execute:e=>{const t=J(e);if(!t){return}return(0,s.showDialog)({title:E.__("Shut down the console?"),body:E.__('Are you sure you want to close "%1"?',t.title.label),buttons:[s.Dialog.cancelButton({ariaLabel:E.__("Cancel console Shut Down")}),s.Dialog.warnButton({ariaLabel:E.__("Confirm console Shut Down")})]}).then((e=>{if(e.button.accept){return M.execute(k.shutdown,{activate:false}).then((()=>{t.dispose();return true}))}else{return false}}))},isEnabled:K});M.addCommand(k.inject,{label:E.__("Inject some code in a console."),execute:e=>{const t=e["path"];O.find((n=>{var i;if(((i=n.console.sessionContext.session)===null||i===void 0?void 0:i.path)===t){if(e["activate"]!==false){D.activateById(n.id)}void n.console.inject(e["code"],e["metadata"]);return true}return false}))},isEnabled:K});M.addCommand(k.changeKernel,{label:E.__("Change Kernel…"),execute:e=>{const t=J(e);if(!t){return}return P.selectKernel(t.console.sessionContext)},isEnabled:K});M.addCommand(k.getKernel,{label:E.__("Get Kernel"),execute:e=>{var t;const n=J({activate:false,...e});if(!n){return}return(t=n.sessionContext.session)===null||t===void 0?void 0:t.kernel},isEnabled:K});const Y=[k.create];const X=()=>{Object.values(k).filter((e=>!Y.includes(e))).forEach((t=>e.commands.notifyCommandChanged(t)))};O.currentChanged.connect(X);(j=D.currentChanged)===null||j===void 0?void 0:j.connect(X);if(h){[k.create,k.linebreak,k.clear,k.runUnforced,k.runForced,k.restart,k.interrupt,k.changeKernel,k.closeAndShutdown].forEach((e=>{h.addItem({command:e,category:A,args:{isPalette:true}})}))}if(c){c.fileMenu.closeAndCleaners.add({id:k.closeAndShutdown,isEnabled:K});c.kernelMenu.kernelUsers.changeKernel.add({id:k.changeKernel,isEnabled:K});c.kernelMenu.kernelUsers.clearWidget.add({id:k.clear,isEnabled:K});c.kernelMenu.kernelUsers.interruptKernel.add({id:k.interrupt,isEnabled:K});c.kernelMenu.kernelUsers.restartKernel.add({id:k.restart,isEnabled:K});c.kernelMenu.kernelUsers.shutdownKernel.add({id:k.shutdown,isEnabled:K});c.runMenu.codeRunners.run.add({id:k.runForced,isEnabled:K});c.editMenu.clearers.clearCurrent.add({id:k.clear,isEnabled:K});c.editMenu.undoers.redo.add({id:k.redo,isEnabled:K});c.editMenu.undoers.undo.add({id:k.undo,isEnabled:K});c.helpMenu.getKernel.add({id:k.getKernel,isEnabled:K})}const Q={notebook:E.__("Execute with Shift+Enter"),terminal:E.__("Execute with Enter")};M.addCommand(k.interactionMode,{label:e=>{var t;return(t=Q[e["interactionMode"]])!==null&&t!==void 0?t:"Set the console interaction mode."},execute:async e=>{const t="keyMap";try{await r.set(L,"interactionMode",e["interactionMode"])}catch(n){console.error(`Failed to set ${L}:${t} - ${n.message}`)}},isToggled:e=>e["interactionMode"]===W});return O}function L(e,t,n,i,o){if(!n){return}const r=(i!==null&&i!==void 0?i:p.nullTranslator).load("jupyterlab");const a=o!==null&&o!==void 0?o:new s.Sanitizer;e.commands.addCommand(k.invokeCompleter,{label:r.__("Display the completion helper."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e){return n.invoke(e)}}});e.commands.addCommand(k.selectCompleter,{label:r.__("Select the completion suggestion."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e){return n.select(e)}}});e.commands.addKeyBinding({command:k.selectCompleter,keys:["Enter"],selector:".jp-ConsolePanel .jp-mod-completer-active"});const l=async(e,t)=>{var i,s;const o={editor:(s=(i=t.console.promptCell)===null||i===void 0?void 0:i.editor)!==null&&s!==void 0?s:null,session:t.console.sessionContext.session,widget:t};await n.updateCompleter(o);t.console.promptCellCreated.connect(((e,i)=>{const s={editor:i.editor,session:e.sessionContext.session,widget:t,sanitzer:a};n.updateCompleter(s).catch(console.error)}));t.console.sessionContext.sessionChanged.connect((()=>{var e,i;const s={editor:(i=(e=t.console.promptCell)===null||e===void 0?void 0:e.editor)!==null&&i!==void 0?i:null,session:t.console.sessionContext.session,widget:t,sanitizer:a};n.updateCompleter(s).catch(console.error)}))};t.widgetAdded.connect(l);n.activeProvidersChanged.connect((()=>{t.forEach((e=>{l(undefined,e).catch((e=>console.error(e)))}))}))}},99382:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(17325);var a=n(5893);var l=n(3579);var d=n(36060);var c=n(39063);var h=n(50286);var u=n(75797);var p=n(67996);var m=n(85072);var g=n.n(m);var f=n(97825);var v=n.n(f);var _=n(77659);var b=n.n(_);var y=n(55056);var w=n.n(y);var C=n(10540);var x=n.n(C);var S=n(41113);var k=n.n(S);var j=n(19961);var I={};I.styleTagTransform=k();I.setAttributes=w();I.insert=b().bind(null,"head");I.domAPI=v();I.insertStyleElement=x();var E=g()(j.A,I);const T=j.A&&j.A.locals?j.A.locals:undefined},57958:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CodeConsole:()=>A,ConsoleHistory:()=>l,ConsolePanel:()=>R,ForeignHandler:()=>a,IConsoleCellExecutor:()=>B,IConsoleTracker:()=>O,runCell:()=>s});var i=n(93681);async function s({cell:e,onCellExecuted:t,sessionContext:n}){const s=n=>{if(n&&n.content.status==="ok"){const i=n.content;if(i.payload&&i.payload.length){const t=i.payload.filter((e=>e.source==="set_next_input"))[0];if(t){const n=t.text;e.model.sharedModel.setSource(n)}}t({cell:e,executionDate:new Date,success:true});return true}else if(n&&n.content.status==="error"){const i=n.content.ename;const s=n.content.evalue;t({cell:e,executionDate:new Date,success:false,error:new Error(`KernelReplyNotOK: ${i} ${s}`)});return false}t({cell:e,executionDate:new Date,success:false});return false};const o=n=>{t({cell:e,executionDate:new Date,success:false,error:new Error(n)});return false};return i.CodeCell.execute(e,n).then(s,o)}var o=n(2336);const r="jp-CodeConsole-foreignCell";class a{constructor(e){this._enabled=false;this._isDisposed=false;this.sessionContext=e.sessionContext;this.sessionContext.iopubMessage.connect(this.onIOPubMessage,this);this._parent=e.parent}get enabled(){return this._enabled}set enabled(e){this._enabled=e}get parent(){return this._parent}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;o.Signal.clearData(this)}onIOPubMessage(e,t){var n;if(!this._enabled){return false}const i=(n=this.sessionContext.session)===null||n===void 0?void 0:n.kernel;if(!i){return false}const s=this._parent;const o=t.parent_header.session;if(o===i.clientId){return false}const r=t.header.msg_type;const a=t.parent_header;const l=a.msg_id;let d;switch(r){case"execute_input":{const e=t;d=this._newCell(l);const n=d.model;n.executionCount=e.content.execution_count;n.sharedModel.setSource(e.content.code);n.trusted=true;s.update();return true}case"execute_result":case"display_data":case"stream":case"error":{d=this._parent.getCell(l);if(!d){return false}const e={...t.content,output_type:r};d.model.outputs.add(e);s.update();return true}case"clear_output":{const e=t.content.wait;d=this._parent.getCell(l);if(d){d.model.outputs.clear(e)}return true}default:return false}}_newCell(e){const t=this.parent.createCodeCell();t.addClass(r);this._parent.addCell(t,e);return t}}class l{constructor(e){this._cursor=0;this._hasSession=false;this._history=[];this._placeholder="";this._setByHistory=false;this._isDisposed=false;this._editor=null;this._filtered=[];const{sessionContext:t}=e;if(t){this.sessionContext=t;void this._handleKernel();this.sessionContext.kernelChanged.connect(this._handleKernel,this)}}get editor(){return this._editor}set editor(e){if(this._editor===e){return}const t=this._editor;if(t){t.edgeRequested.disconnect(this.onEdgeRequest,this);t.model.sharedModel.changed.disconnect(this.onTextChange,this)}this._editor=e;if(e){e.edgeRequested.connect(this.onEdgeRequest,this);e.model.sharedModel.changed.connect(this.onTextChange,this)}}get placeholder(){return this._placeholder}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=true;this._history.length=0;o.Signal.clearData(this)}back(e){if(!this._hasSession){this._hasSession=true;this._placeholder=e;this.setFilter(e);this._cursor=this._filtered.length-1}--this._cursor;this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}forward(e){if(!this._hasSession){this._hasSession=true;this._placeholder=e;this.setFilter(e);this._cursor=this._filtered.length}++this._cursor;this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return Promise.resolve(t)}push(e){if(e&&e!==this._history[this._history.length-1]){this._history.push(e)}this.reset()}reset(){this._cursor=this._history.length;this._hasSession=false;this._placeholder=""}onHistory(e){this._history.length=0;let t="";let n="";if(e.content.status==="ok"){for(let i=0;i{if(this.isDisposed||!t){return}if(n.getSource()===t){return}this._setByHistory=true;n.setSource(t);let i=0;i=t.indexOf("\n");if(i<0){i=t.length}e.setCursorPosition({line:0,column:i})}))}else{void this.forward(i).then((t=>{if(this.isDisposed){return}const i=t||this.placeholder;if(n.getSource()===i){return}this._setByHistory=true;n.setSource(i);const s=e.getPositionAt(i.length);if(s){e.setCursorPosition(s)}}))}}async _handleKernel(){var e,t;const n=(t=(e=this.sessionContext)===null||e===void 0?void 0:e.session)===null||t===void 0?void 0:t.kernel;if(!n){this._history.length=0;return}return n.requestHistory(d.initialRequest).then((e=>{this.onHistory(e)}))}setFilter(e=""){this._filtered.length=0;let t="";let n="";for(let i=0;i0){e.get(0).dispose()}}createCodeCell(){const e=this.contentFactory;const t=this._createCodeCellOptions();const n=e.createCodeCell(t);n.readOnly=true;n.model.mimeType=this._mimetype;return n}dispose(){if(this.isDisposed){return}this._msgIdCells=null;this._msgIds=null;this._history.dispose();super.dispose()}async execute(e=false,t=T){var n,i;if(((i=(n=this.sessionContext.session)===null||n===void 0?void 0:n.kernel)===null||i===void 0?void 0:i.status)==="dead"){return}const s=this.promptCell;if(!s){throw new Error("Cannot execute without a prompt cell")}s.model.trusted=true;if(e){this.newPromptCell();await this._execute(s);return}const o=await this._shouldExecute(t);if(this.isDisposed){return}if(o){this.newPromptCell();this.promptCell.editor.focus();await this._execute(s)}else{s.editor.newIndentedLine()}}getCell(e){return this._msgIds.get(e)}inject(e,t={}){const n=this.createCodeCell();n.model.sharedModel.setSource(e);for(const i of Object.keys(t)){n.model.setMetadata(i,t[i])}this.addCell(n);return this._execute(n)}insertLinebreak(){const e=this.promptCell;if(!e){return}e.editor.newIndentedLine()}replaceSelection(e){var t,n;const i=this.promptCell;if(!i){return}(n=(t=i.editor).replaceSelection)===null||n===void 0?void 0:n.call(t,e)}setConfig(e){const{clearCellsOnExecute:t,clearCodeContentOnExecute:n,hideCodeInput:i,promptCellPosition:s,showBanner:o}=e;this._config={clearCellsOnExecute:t!==null&&t!==void 0?t:this._config.clearCellsOnExecute,clearCodeContentOnExecute:n!==null&&n!==void 0?n:this._config.clearCodeContentOnExecute,hideCodeInput:i!==null&&i!==void 0?i:this._config.hideCodeInput,promptCellPosition:s!==null&&s!==void 0?s:this._config.promptCellPosition,showBanner:o!==null&&o!==void 0?o:this._config.showBanner};this._updateLayout()}serialize(){const e=[];for(const t of this._cells){const n=t.model;if((0,i.isCodeCellModel)(n)){e.push(n.toJSON())}}if(this.promptCell){e.push(this.promptCell.model.toJSON())}return e}_evtMouseDown(e){const{button:t,shiftKey:n}=e;if(!(t===0||t===2)||n&&t===2){return}let s=e.target;const o=e=>e.classList.contains(x);let r=i.CellDragUtils.findCell(s,this._cells,o);if(r===-1){s=document.elementFromPoint(e.clientX,e.clientY);r=i.CellDragUtils.findCell(s,this._cells,o)}if(r===-1){return}const a=this._cells.get(r);const l=i.CellDragUtils.detectTargetArea(a,e.target);if(l==="prompt"){this._dragData={pressX:e.clientX,pressY:e.clientY,index:r};this._focusedCell=a;document.addEventListener("mouseup",this,true);document.addEventListener("mousemove",this,true);e.preventDefault()}}_evtMouseMove(e){const t=this._dragData;if(t&&i.CellDragUtils.shouldStartDrag(t.pressX,t.pressY,e.clientX,e.clientY)){void this._startDrag(t.index,e.clientX,e.clientY)}}_startDrag(e,t,n){const s=this._focusedCell.model;const o=[s.toJSON()];const r=i.CellDragUtils.createCellDragImage(this._focusedCell,o);this._drag=new b.Drag({mimeData:new g.MimeData,dragImage:r,proposedAction:"copy",supportedActions:"copy",source:this});this._drag.mimeData.setData(M,o);const a=s.sharedModel.getSource();this._drag.mimeData.setData("text/plain",a);this._focusedCell=null;document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true);return this._drag.start(t,n).then((()=>{if(this.isDisposed){return}this._drag=null;this._dragData=null}))}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"mouseup":this._evtMouseUp(e);break;case"resize":this._splitPanel.fit();break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e);break;default:break}}onAfterAttach(e){const t=this.node;t.addEventListener("keydown",this,true);t.addEventListener("click",this);t.addEventListener("mousedown",this);t.addEventListener("focusin",this);t.addEventListener("focusout",this);if(!this.promptCell){this.newPromptCell()}else{this.promptCell.editor.focus();this.update()}}onBeforeDetach(e){const t=this.node;t.removeEventListener("keydown",this,true);t.removeEventListener("click",this);t.removeEventListener("focusin",this);t.removeEventListener("focusout",this)}onActivateRequest(e){const t=this.promptCell&&this.promptCell.editor;if(t){t.focus()}this.update()}newPromptCell(){var e,t,n,i,s;let r=this.promptCell;const a=this._input;const l=(e=r===null||r===void 0?void 0:r.model.sharedModel.getSource())!==null&&e!==void 0?e:"";const d=(t=r===null||r===void 0?void 0:r.editor)===null||t===void 0?void 0:t.getCursorPosition();if(r){r.readOnly=true;r.removeClass(k);const e=r;requestIdleCallback((()=>{o.Signal.clearData(e.editor)}));(n=r.editor)===null||n===void 0?void 0:n.blur();const t=a.widgets[0];t.parent=null;if(this._config.hideCodeInput){(i=r.inputArea)===null||i===void 0?void 0:i.setHidden(true)}this.addCell(r)}const c=this.contentFactory;const h=this._createCodeCellOptions();r=c.createCodeCell(h);r.model.mimeType=this._mimetype;r.addClass(k);this._input.addWidget(r);this._history.editor=r.editor;if(!this._config.clearCodeContentOnExecute){r.model.sharedModel.setSource(l);if(d){(s=r.editor)===null||s===void 0?void 0:s.setCursorPosition(d)}}this._promptCellCreated.emit(r)}onUpdateRequest(e){P.scrollToBottom(this._content.node)}_evtKeyDown(e){const t=this.promptCell&&this.promptCell.editor;if(!t){return}if(e.keyCode===13&&!t.hasFocus()){e.preventDefault();t.focus()}else if(e.keyCode===27&&t.hasFocus()){e.preventDefault();e.stopPropagation();this.node.focus()}}_evtMouseUp(e){if(this.promptCell&&this.promptCell.node.contains(e.target)){this.promptCell.editor.focus()}}_evtFocusIn(e){this._updateReadWrite()}_evtFocusOut(e){this._updateReadWrite()}async _execute(e){const t=e.model.sharedModel.getSource();this._history.push(t);if(t==="clear"||t==="%clear"){this.clear();return Promise.resolve(void 0)}e.model.contentChanged.connect(this.update,this);const n={cell:e,sessionContext:this.sessionContext,onCellExecuted:e=>{this._executed.emit(e.executionDate);if(e.error){for(const e of this._cells){if(e.model.executionCount===null){e.model.executionState="idle"}}}}};try{await this._executor.runCell(n)}finally{if(!this.isDisposed){e.model.contentChanged.disconnect(this.update,this);this.update()}}}_handleInfo(e){if(e.status!=="ok"){if(this._banner){this._banner.model.sharedModel.setSource("Error in getting kernel banner")}return}if(this._banner){this._banner.model.sharedModel.setSource(e.banner)}const t=e.language_info;this._mimetype=this._mimeTypeService.getMimeTypeByLanguage(t);if(this.promptCell){this.promptCell.model.mimeType=this._mimetype}}_createCodeCellOptions(){const e=this.contentFactory;const t=this.modelFactory;const n=t.createCodeCell({});const i=this.rendermime;const s=this.editorConfig;return{model:n,rendermime:i,contentFactory:e,editorConfig:s,placeholder:false,translator:this._translator}}_onCellDisposed(e,t){if(!this.isDisposed){this._cells.removeValue(e);const t=this._msgIdCells.get(e);if(t){this._msgIdCells.delete(e);this._msgIds.delete(t)}}}_shouldExecute(e){const t=this.promptCell;if(!t){return Promise.resolve(false)}const n=t.model;const i=n.sharedModel.getSource();return new Promise(((t,n)=>{var s;const o=setTimeout((()=>{t(true)}),e);const r=(s=this.sessionContext.session)===null||s===void 0?void 0:s.kernel;if(!r){t(false);return}r.requestIsComplete({code:i}).then((e=>{clearTimeout(o);if(this.isDisposed){t(false)}if(e.content.status!=="incomplete"){t(true);return}t(false)})).catch((()=>{t(true)}))}))}async _onKernelChanged(){var e;this.clear();if(this._banner){this._banner.dispose();this._banner=null}if(this._config.showBanner){this.addBanner()}if((e=this.sessionContext.session)===null||e===void 0?void 0:e.kernel){this._handleInfo(await this.sessionContext.session.kernel.info)}}async _onKernelStatusChanged(){var e;const t=(e=this.sessionContext.session)===null||e===void 0?void 0:e.kernel;if((t===null||t===void 0?void 0:t.status)==="restarting"){if(this._config.showBanner){this.addBanner()}this._handleInfo(await(t===null||t===void 0?void 0:t.info))}}_updateReadWrite(){const e=c.DOMUtils.hasActiveEditableElement(this.node);this.node.classList.toggle(E,e)}_updateLayout(){const{promptCellPosition:e="bottom"}=this._config;this._splitPanel.orientation=["left","right"].includes(e)?"horizontal":"vertical";f.SplitPanel.setStretch(this._content,1);f.SplitPanel.setStretch(this._input,1);if(e==="bottom"||e==="right"){this._splitPanel.insertWidget(0,this._content);this._splitPanel.insertWidget(1,this._input)}else{this._splitPanel.insertWidget(0,this._input);this._splitPanel.insertWidget(1,this._content)}let t=[1,1];if(e==="top"){t=[1,100]}else if(e==="bottom"){t=[100,1]}this._splitPanel.setRelativeSizes(t)}}(function(e){e.defaultEditorConfig={codeFolding:false,lineNumbers:false};class t extends i.Cell.ContentFactory{createCodeCell(e){return new i.CodeCell(e).initializeState()}createRawCell(e){return new i.RawCell(e).initializeState()}}e.ContentFactory=t;class n{constructor(e={}){this.codeCellContentFactory=e.codeCellContentFactory||i.CodeCellModel.defaultContentFactory}createCodeCell(e={}){if(!e.contentFactory){e.contentFactory=this.codeCellContentFactory}return new i.CodeCellModel(e)}createRawCell(e){return new i.RawCellModel(e)}}e.ModelFactory=n;e.defaultModelFactory=new n({})})(A||(A={}));var P;(function(e){function t(e){e.scrollTop=e.scrollHeight-e.clientHeight}e.scrollToBottom=t})(P||(P={}));const L="jp-ConsolePanel";class R extends c.MainAreaWidget{constructor(e){super({content:new f.Panel});this._executed=null;this._connected=null;this.addClass(L);let{executor:t,rendermime:n,mimeTypeService:i,path:s,basePath:o,name:r,manager:a,modelFactory:l,sessionContext:d,translator:v}=e;this.translator=v!==null&&v!==void 0?v:p.nullTranslator;const _=this.translator.load("jupyterlab");const b=this.contentFactory=e.contentFactory;const y=N.count++;if(!s){s=h.PathExt.join(o||"",`console-${y}-${g.UUID.uuid4()}`)}d=this._sessionContext=d!==null&&d!==void 0?d:new c.SessionContext({kernelManager:a.kernels,sessionManager:a.sessions,specsManager:a.kernelspecs,path:a.contents.localPath(s),name:r||_.__("Console %1",y),type:"console",kernelPreference:e.kernelPreference,setBusy:e.setBusy});const w=new u.RenderMimeRegistry.UrlResolver({path:s,contents:a.contents});n=n.clone({resolver:w});this.console=b.createConsole({executor:t,rendermime:n,sessionContext:d,mimeTypeService:i,contentFactory:b,modelFactory:l,translator:v});this.content.addWidget(this.console);void d.initialize().then((async t=>{var n;if(t){await((n=e.sessionDialogs)!==null&&n!==void 0?n:new c.SessionContextDialogs({translator:v})).selectKernel(d)}this._connected=new Date;this._updateTitlePanel()}));this.console.executed.connect(this._onExecuted,this);this._updateTitlePanel();d.kernelChanged.connect(this._updateTitlePanel,this);d.propertyChanged.connect(this._updateTitlePanel,this);this.title.icon=m.consoleIcon;this.title.closable=true;this.id=`console-${y}`}get sessionContext(){return this._sessionContext}dispose(){this.sessionContext.dispose();this.console.dispose();super.dispose()}onActivateRequest(e){const t=this.console.promptCell;if(t){t.editor.focus()}}onCloseRequest(e){super.onCloseRequest(e);this.dispose()}_onExecuted(e,t){this._executed=t;this._updateTitlePanel()}_updateTitlePanel(){N.updateTitle(this,this._connected,this._executed,this.translator)}}(function(e){class t extends A.ContentFactory{createConsole(e){return new A(e)}}e.ContentFactory=t;e.IContentFactory=new g.Token("@jupyterlab/console:IContentFactory","A factory object that creates new code consoles. Use this if you want to create and host code consoles in your own UI elements.")})(R||(R={}));var N;(function(e){e.count=1;function t(e,t,n,i){i=i||p.nullTranslator;const s=i.load("jupyterlab");const o=e.console.sessionContext.session;if(o){let i=s.__("Name: %1\n",o.name)+s.__("Directory: %1\n",h.PathExt.dirname(o.path))+s.__("Kernel: %1",e.console.sessionContext.kernelDisplayName);if(t){i+=s.__("\nConnected: %1",h.Time.format(t.toISOString()))}if(n){i+=s.__("\nLast Execution: %1")}e.title.label=o.name;e.title.caption=i}else{e.title.label=s.__("Console");e.title.caption=""}}e.updateTitle=t})(N||(N={}));const O=new g.Token("@jupyterlab/console:IConsoleTracker",`A widget tracker for code consoles.\n Use this if you want to be able to iterate over and interact with code consoles\n created by the application.`);const B=new g.Token("@jupyterlab/console:IConsoleCellExecutor",`The console cell executor`)},50286:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(5893);var a=n(38457);var l=n(17325);var d=n(53377);var c=n(85072);var h=n.n(c);var u=n(97825);var p=n.n(u);var m=n(77659);var g=n.n(m);var f=n(55056);var v=n.n(f);var _=n(10540);var b=n.n(_);var y=n(41113);var w=n.n(y);var C=n(16513);var x={};x.styleTagTransform=w();x.setAttributes=v();x.insert=g().bind(null,"head");x.domAPI=p();x.insertStyleElement=b();var S=h()(C.A,x);const k=C.A&&C.A.locals?C.A.locals:undefined},75013:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ActivityMonitor=void 0;const i=n(2336);class s{constructor(e){this._timer=-1;this._timeout=-1;this._isDisposed=false;this._activityStopped=new i.Signal(this);e.signal.connect(this._onSignalFired,this);this._timeout=e.timeout||1e3}get activityStopped(){return this._activityStopped}get timeout(){return this._timeout}set timeout(e){this._timeout=e}get isDisposed(){return this._isDisposed}dispose(){if(this._isDisposed){return}this._isDisposed=true;i.Signal.clearData(this)}_onSignalFired(e,t){clearTimeout(this._timer);this._sender=e;this._args=t;this._timer=setTimeout((()=>{this._activityStopped.emit({sender:this._sender,args:this._args})}),this._timeout)}}t.ActivityMonitor=s},26376:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))i(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});s(n(75013),t);s(n(23106),t);s(n(24477),t);s(n(87484),t);s(n(92279),t);s(n(67169),t);s(n(97058),t);s(n(80121),t);s(n(9659),t);s(n(67881),t)},23106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},24477:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.LruCache=void 0;const n=128;class i{constructor(e={}){this._map=new Map;this._maxSize=(e===null||e===void 0?void 0:e.maxSize)||n}get size(){return this._map.size}clear(){this._map.clear()}get(e){const t=this._map.get(e)||null;if(t!=null){this._map.delete(e);this._map.set(e,t)}return t}set(e,t){if(this._map.size>=this._maxSize){this._map.delete(this._map.keys().next().value)}this._map.set(e,t)}}t.LruCache=i},87484:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.MarkdownCodeBlocks=void 0;var n;(function(e){e.CODE_BLOCK_MARKER="```";const t=[".markdown",".mdown",".mkdn",".md",".mkd",".mdwn",".mdtxt",".mdtext",".text",".txt",".Rmd"];class n{constructor(e){this.startLine=e;this.code="";this.endLine=-1}}e.MarkdownCodeBlock=n;function i(e){return t.indexOf(e)>-1}e.isMarkdown=i;function s(t){if(!t||t===""){return[]}const i=t.split("\n");const s=[];let o=null;for(let r=0;re===t||i&&e===i))}e.isDeferred=n;function i(t){const n=t.indexOf(":");let i="";if(n!==-1){i=t.slice(0,n)}return e.disabled.some((e=>e===t||i&&e===i))}e.isDisabled=i})(Extension=PageConfig.Extension||(PageConfig.Extension={}))})(PageConfig||(exports.PageConfig=PageConfig={}))},67169:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.PathExt=void 0;const i=n(57975);var s;(function(e){function t(...e){const t=i.posix.join(...e);return t==="."?"":h(t)}e.join=t;function n(...e){const t=i.posix.join(...e);return t==="."?"":t}e.joinWithLeadingSlash=n;function s(e,t){return i.posix.basename(e,t)}e.basename=s;function o(e){const t=h(i.posix.dirname(e));return t==="."?"":t}e.dirname=o;function r(e){return i.posix.extname(e)}e.extname=r;function a(e){if(e===""){return""}return h(i.posix.normalize(e))}e.normalize=a;function l(...e){return h(i.posix.resolve(...e))}e.resolve=l;function d(e,t){return h(i.posix.relative(e,t))}e.relative=d;function c(e){if(e.length>0&&e.indexOf(".")!==0){e=`.${e}`}return e}e.normalizeExtension=c;function h(e){if(e.indexOf("/")===0){e=e.slice(1)}return e}e.removeSlash=h})(s||(t.PathExt=s={}))},97058:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.signalToPromise=s;const i=n(5592);function s(e,t){const n=new i.PromiseDelegate;function s(){e.disconnect(o)}function o(e,t){s();n.resolve([e,t])}e.connect(o);if((t!==null&&t!==void 0?t:0)>0){setTimeout((()=>{s();n.reject(`Signal not emitted within ${t} ms.`)}),t)}return n.promise}},80121:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Text=void 0;var n;(function(e){const t="𝐚".length>1;function n(e,n){if(t){return e}let i=e;for(let t=0;t+1=55296&&e<=56319){const e=n.charCodeAt(t+1);if(e>=56320&&e<=57343){i--;t++}}}return i}e.jsIndexToCharIndex=n;function i(e,n){if(t){return e}let i=e;for(let t=0;t+1=55296&&e<=56319){const e=n.charCodeAt(t+1);if(e>=56320&&e<=57343){i++;t++}}}return i}e.charIndexToJsIndex=i;function s(e,t=false){return e.replace(/^(\w)|[\s-_:]+(\w)/g,(function(e,n,i){if(i){return i.toUpperCase()}else{return t?n.toUpperCase():n.toLowerCase()}}))}e.camelCase=s;function o(e){return(e||"").toLowerCase().split(" ").map((e=>e.charAt(0).toUpperCase()+e.slice(1))).join(" ")}e.titleCase=o})(n||(t.Text=n={}))},9659:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.Time=void 0;const n=[{name:"years",milliseconds:365*24*60*60*1e3},{name:"months",milliseconds:30*24*60*60*1e3},{name:"days",milliseconds:24*60*60*1e3},{name:"hours",milliseconds:60*60*1e3},{name:"minutes",milliseconds:60*1e3},{name:"seconds",milliseconds:1e3}];var i;(function(e){function t(e,t="long"){const i=document.documentElement.lang||"en";const s=new Intl.RelativeTimeFormat(i,{numeric:"auto",style:t});const o=new Date(e).getTime()-Date.now();for(let r of n){const e=Math.ceil(o/r.milliseconds);if(e===0){continue}return s.format(e,r.name)}return s.format(0,"seconds")}e.formatHuman=t;function i(e){const t=document.documentElement.lang||"en";const n=new Intl.DateTimeFormat(t,{dateStyle:"short",timeStyle:"short"});return n.format(new Date(e))}e.format=i})(i||(t.Time=i={}))},67881:function(e,t,n){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:true});t.URLExt=void 0;const s=n(57975);const o=i(n(61160));var r;(function(e){function t(e){if(typeof document!=="undefined"&&document){const t=document.createElement("a");t.href=e;return t}return(0,o.default)(e)}e.parse=t;function n(e){return(0,o.default)(e).hostname}e.getHostName=n;function i(e){return e&&t(e).toString()}e.normalize=i;function r(...e){let t=(0,o.default)(e[0],{});const n=t.protocol===""&&t.slashes;if(n){t=(0,o.default)(e[0],"https:"+e[0])}const i=`${n?"":t.protocol}${t.slashes?"//":""}${t.auth}${t.auth?"@":""}${t.host}`;const r=s.posix.join(`${!!i&&t.pathname[0]!=="/"?"/":""}${t.pathname}`,...e.slice(1));return`${i}${r==="."?"":r}`}e.join=r;function a(e){return r(...e.split("/").map(encodeURIComponent))}e.encodeParts=a;function l(e){const t=Object.keys(e).filter((e=>e.length>0));if(!t.length){return""}return"?"+t.map((t=>{const n=encodeURIComponent(String(e[t]));return t+(n?"="+n:"")})).join("&")}e.objectToQueryString=l;function d(e){return e.replace(/^\?/,"").split("&").reduce(((e,t)=>{const[n,i]=t.split("=");if(n.length>0){e[n]=decodeURIComponent(i||"")}return e}),{})}e.queryStringToObject=d;function c(e,n=false){const{protocol:i}=t(e);return(!i||e.toLowerCase().indexOf(i)!==0)&&(n?e.indexOf("//")!==0:e.indexOf("/")!==0)}e.isLocal=c})(r||(t.URLExt=r={}))},32254:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>k});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(92500);var l=n(69105);var d=n(87277);var c=n.n(d);var h=n(56759);var u=n.n(h);var p=n(15615);var m=n.n(p);var g=n(61927);var f=n.n(g);const v="CSVTable";const _="TSVTable";var b;(function(e){e.CSVGoToLine="csv:go-to-line";e.TSVGoToLine="tsv:go-to-line"})(b||(b={}));const y={activate:C,id:"@jupyterlab/csvviewer-extension:csv",description:"Adds viewer for CSV file types",requires:[g.ITranslator],optional:[i.ILayoutRestorer,o.IThemeManager,h.IMainMenu,d.ISearchProviderRegistry,p.ISettingRegistry,o.IToolbarWidgetRegistry],autoStart:true};const w={activate:x,id:"@jupyterlab/csvviewer-extension:tsv",description:"Adds viewer for TSV file types.",requires:[g.ITranslator],optional:[i.ILayoutRestorer,o.IThemeManager,h.IMainMenu,d.ISearchProviderRegistry,p.ISettingRegistry,o.IToolbarWidgetRegistry],autoStart:true};function C(e,t,i,s,r,d,c,h){var u;const{commands:p,shell:m}=e;let g;if(h){h.addFactory(v,"delimiter",(e=>new l.G({widget:e.content,translator:t})));if(c){g=(0,o.createToolbarFactory)(h,c,v,y.id,t)}}const f=t.load("jupyterlab");const _=new a.Pb({name:v,label:f.__("CSV Viewer"),fileTypes:["csv"],defaultFor:["csv"],readOnly:true,toolbarFactory:g,translator:t});const w=new o.WidgetTracker({namespace:"csvviewer"});let C=j.LIGHT_STYLE;let x=j.LIGHT_TEXT_CONFIG;if(i){void i.restore(w,{command:"docmanager:open",args:e=>({path:e.context.path,factory:v}),name:e=>e.context.path})}e.docRegistry.addWidgetFactory(_);const S=e.docRegistry.getFileType("csv");let k=false;_.widgetCreated.connect((async(e,t)=>{void w.add(t);t.context.pathChanged.connect((()=>{void w.save(t)}));if(S){t.title.icon=S.icon;t.title.iconClass=S.iconClass;t.title.iconLabel=S.iconLabel}if(d&&!k){const{CSVSearchProvider:e}=await Promise.all([n.e(4470),n.e(4663)]).then(n.bind(n,54041));d.add("csv",e);k=true}await t.content.ready;t.content.style=C;t.content.rendererConfig=x;I()}));const I=()=>{const e=s&&s.theme?s.isLight(s.theme):true;C=e?j.LIGHT_STYLE:j.DARK_STYLE;x=e?j.LIGHT_TEXT_CONFIG:j.DARK_TEXT_CONFIG;w.forEach((async e=>{await e.content.ready;e.content.style=C;e.content.rendererConfig=x}))};if(s){s.themeChanged.connect(I)}const E=()=>w.currentWidget!==null&&w.currentWidget===m.currentWidget;p.addCommand(b.CSVGoToLine,{label:f.__("Go to Line"),execute:async()=>{const e=w.currentWidget;if(e===null){return}const t=await o.InputDialog.getNumber({title:f.__("Go to Line"),value:0});if(t.button.accept&&t.value!==null){e.content.goToLine(t.value)}},isEnabled:E});if(r){r.editMenu.goToLiners.add({id:b.CSVGoToLine,isEnabled:E})}const T=()=>{p.notifyCommandChanged(b.CSVGoToLine)};w.currentChanged.connect(T);(u=m.currentChanged)===null||u===void 0?void 0:u.connect(T)}function x(e,t,i,s,r,d,c,h){const{commands:u,shell:p}=e;let m;if(h){h.addFactory(_,"delimiter",(e=>new l.G({widget:e.content,translator:t})));if(c){m=(0,o.createToolbarFactory)(h,c,_,w.id,t)}}const g=t.load("jupyterlab");const f=new a.og({name:_,label:g.__("TSV Viewer"),fileTypes:["tsv"],defaultFor:["tsv"],readOnly:true,toolbarFactory:m,translator:t});const v=new o.WidgetTracker({namespace:"tsvviewer"});let y=j.LIGHT_STYLE;let C=j.LIGHT_TEXT_CONFIG;if(i){void i.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:_}),name:e=>e.context.path})}e.docRegistry.addWidgetFactory(f);const x=e.docRegistry.getFileType("tsv");let S=false;f.widgetCreated.connect((async(e,t)=>{void v.add(t);t.context.pathChanged.connect((()=>{void v.save(t)}));if(x){t.title.icon=x.icon;t.title.iconClass=x.iconClass;t.title.iconLabel=x.iconLabel}if(d&&!S){const{CSVSearchProvider:e}=await Promise.all([n.e(4470),n.e(4663)]).then(n.bind(n,54041));d.add("tsv",e);S=true}await t.content.ready;t.content.style=y;t.content.rendererConfig=C}));const k=()=>{const e=s&&s.theme?s.isLight(s.theme):true;y=e?j.LIGHT_STYLE:j.DARK_STYLE;C=e?j.LIGHT_TEXT_CONFIG:j.DARK_TEXT_CONFIG;v.forEach((async e=>{await e.content.ready;e.content.style=y;e.content.rendererConfig=C}))};if(s){s.themeChanged.connect(k)}const I=()=>v.currentWidget!==null&&v.currentWidget===p.currentWidget;u.addCommand(b.TSVGoToLine,{label:g.__("Go to Line"),execute:async()=>{const e=v.currentWidget;if(e===null){return}const t=await o.InputDialog.getNumber({title:g.__("Go to Line"),value:0});if(t.button.accept&&t.value!==null){e.content.goToLine(t.value)}},isEnabled:I});if(r){r.editMenu.goToLiners.add({id:b.TSVGoToLine,isEnabled:I})}v.currentChanged.connect((()=>{u.notifyCommandChanged(b.TSVGoToLine)}))}const S=[y,w];const k=S;var j;(function(e){e.LIGHT_STYLE={voidColor:"#F3F3F3",backgroundColor:"white",headerBackgroundColor:"#EEEEEE",gridLineColor:"rgba(20, 20, 20, 0.15)",headerGridLineColor:"rgba(20, 20, 20, 0.25)",rowBackgroundColor:e=>e%2===0?"#F5F5F5":"white"};e.DARK_STYLE={voidColor:"black",backgroundColor:"#111111",headerBackgroundColor:"#424242",gridLineColor:"rgba(235, 235, 235, 0.15)",headerGridLineColor:"rgba(235, 235, 235, 0.25)",rowBackgroundColor:e=>e%2===0?"#212121":"#111111"};e.LIGHT_TEXT_CONFIG={textColor:"#111111",matchBackgroundColor:"#FFFFE0",currentMatchBackgroundColor:"#FFFF00",horizontalAlignment:"right"};e.DARK_TEXT_CONFIG={textColor:"#F5F5F5",matchBackgroundColor:"#838423",currentMatchBackgroundColor:"#A3807A",horizontalAlignment:"right"}})(j||(j={}))},54041:(e,t,n)=>{"use strict";n.d(t,{CSVSearchProvider:()=>d});var i=n(44663);var s=n.n(i);var o=n(44185);var r=n.n(o);var a=n(87277);var l=n.n(a);class d extends a.SearchProvider{constructor(){super(...arguments);this.isReadOnly=true}static createNew(e,t){return new d(e)}static isApplicable(e){return e instanceof o.DocumentWidget&&e.content instanceof i.CSVViewer}clearHighlight(){return Promise.resolve()}highlightNext(e){this.widget.content.searchService.find(this._query);return Promise.resolve(undefined)}highlightPrevious(e){this.widget.content.searchService.find(this._query,true);return Promise.resolve(undefined)}replaceCurrentMatch(e,t){return Promise.resolve(false)}replaceAllMatches(e){return Promise.resolve(false)}startQuery(e){this._query=e;this.widget.content.searchService.find(e);return Promise.resolve()}endQuery(){this.widget.content.searchService.clear();return Promise.resolve()}}},36672:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(79010);var r=n(3579);var a=n(40662);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(40538);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined;var S=n(19562);var k=n(67996)},77678:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CSVDelimiter:()=>o.G,CSVDocumentWidget:()=>r.Am,CSVViewer:()=>r.t2,CSVViewerFactory:()=>r.Pb,DSVModel:()=>i.DSVModel,GridSearchService:()=>r.Mv,TSVViewerFactory:()=>r.og,TextRenderConfig:()=>r.Gg,parseDSV:()=>s.h,parseDSVNoQuotes:()=>s.l});var i=n(77515);var s=n(69181);var o=n(69105);var r=n(92500)},77515:(e,t,n)=>{"use strict";n.r(t);n.d(t,{DSVModel:()=>d});var i=n(5592);var s=n.n(i);var o=n(28426);var r=n.n(o);var a=n(69181);const l={quotes:a.h,noquotes:a.l};class d extends o.DataModel{constructor(e){super();this._rowCount=0;this._header=[];this._columnOffsets=new Uint32Array(0);this._columnOffsetsStartingRow=0;this._maxCacheGet=1e3;this._rowOffsets=new Uint32Array(0);this._delayedParse=null;this._startedParsing=false;this._doneParsing=false;this._isDisposed=false;this._ready=new i.PromiseDelegate;let{data:t,delimiter:n=",",rowDelimiter:s=undefined,quote:o='"',quoteParser:r=undefined,header:a=true,initialRows:l=500}=e;this._rawData=t;this._delimiter=n;this._quote=o;this._quoteEscaped=new RegExp(o+o,"g");this._initialRows=l;if(s===undefined){const e=t.slice(0,5e3).indexOf("\r");if(e===-1){s="\n"}else if(t[e+1]==="\n"){s="\r\n"}else{s="\r"}}this._rowDelimiter=s;if(r===undefined){r=t.indexOf(o)>=0}this._parser=r?"quotes":"noquotes";this.parseAsync();if(a===true&&this._columnCount>0){const e=[];for(let t=0;t{}));this._ready.reject(undefined)}if(this._delayedParse!==null){window.clearTimeout(this._delayedParse)}}getOffsetIndex(e,t){const n=this._columnCount;let i=(e-this._columnOffsetsStartingRow)*n;if(i<0||i>this._columnOffsets.length){this._columnOffsets.fill(4294967295);this._columnOffsetsStartingRow=e;i=0}if(this._columnOffsets[i]===4294967295){let t=1;while(t<=this._maxCacheGet&&this._columnOffsets[i+t*n]===16777215){t++}const{offsets:s}=l[this._parser]({data:this._rawData,delimiter:this._delimiter,rowDelimiter:this._rowDelimiter,quote:this._quote,columnOffsets:true,maxRows:t,ncols:n,startIndex:this._rowOffsets[e]});for(let e=0;e{try{this._computeRowOffsets(e)}catch(t){if(this._parser==="quotes"){console.warn(t);this._parser="noquotes";this._resetParser();this._computeRowOffsets(e)}else{throw t}}return this._doneParsing};this._resetParser();const s=i(e);if(s){return}const o=()=>{const s=i(e+t);e+=t;if(t<1e6){t*=2}if(s){this._delayedParse=null}else{this._delayedParse=window.setTimeout(o,n)}};this._delayedParse=window.setTimeout(o,n)}_computeRowOffsets(e=4294967295){var t;if(this._rowCount>=e||this._doneParsing===true){return}if(this._columnCount===undefined){this._columnCount=l[this._parser]({data:this._rawData,delimiter:this._delimiter,rowDelimiter:this._rowDelimiter,quote:this._quote,columnOffsets:true,maxRows:1}).ncols}const n=this._rowCount>0?1:0;const{nrows:i,offsets:s}=l[this._parser]({data:this._rawData,startIndex:(t=this._rowOffsets[this._rowCount-n])!==null&&t!==void 0?t:0,delimiter:this._delimiter,rowDelimiter:this._rowDelimiter,quote:this._quote,columnOffsets:false,maxRows:e-this._rowCount+n});if(this._startedParsing&&i<=n){this._doneParsing=true;this._ready.resolve(undefined);return}this._startedParsing=true;const o=this._rowCount;const r=Math.min(i,n);this._rowCount=o+i-r;if(this._rowCounto){const e=this._rowOffsets;this._rowOffsets=new Uint32Array(this._rowCount);this._rowOffsets.set(e);this._rowOffsets.set(s,o-r)}const a=Math.floor(33554432/this._columnCount);if(o<=a){if(this._rowCount<=a){const e=this._columnOffsets;this._columnOffsets=new Uint32Array(this._rowCount*this._columnCount);this._columnOffsets.set(e);this._columnOffsets.fill(4294967295,e.length)}else{const e=this._columnOffsets;this._columnOffsets=new Uint32Array(Math.min(this._maxCacheGet,a)*this._columnCount);this._columnOffsets.set(e.subarray(0,this._columnOffsets.length));this._columnOffsets.fill(4294967295,e.length);this._columnOffsetsStartingRow=0}}let d=o;if(this._header.length>0){d-=1}this.emitChanged({type:"rows-inserted",region:"body",index:d,span:this._rowCount-o})}_getField(e,t){let n;let i;const s=this.getOffsetIndex(e,t);let o=0;let r=0;if(t===this._columnCount-1){if(e{}));this._ready.reject(undefined)}this._doneParsing=false;this._ready=new i.PromiseDelegate;if(this._delayedParse!==null){window.clearTimeout(this._delayedParse);this._delayedParse=null}this.emitChanged({type:"model-reset"})}}},69181:(e,t,n)=>{"use strict";n.d(t,{h:()=>o,l:()=>r});var i;(function(e){e[e["QUOTED_FIELD"]=0]="QUOTED_FIELD";e[e["QUOTED_FIELD_QUOTE"]=1]="QUOTED_FIELD_QUOTE";e[e["UNQUOTED_FIELD"]=2]="UNQUOTED_FIELD";e[e["NEW_FIELD"]=3]="NEW_FIELD";e[e["NEW_ROW"]=4]="NEW_ROW"})(i||(i={}));var s;(function(e){e[e["CR"]=0]="CR";e[e["CRLF"]=1]="CRLF";e[e["LF"]=2]="LF"})(s||(s={}));function o(e){const{data:t,columnOffsets:n,delimiter:o=",",startIndex:r=0,maxRows:a=4294967295,rowDelimiter:l="\r\n",quote:d='"'}=e;let c=e.ncols;let h=0;const u=[];const p=o.charCodeAt(0);const m=d.charCodeAt(0);const g=10;const f=13;const v=t.length;const{QUOTED_FIELD:_,QUOTED_FIELD_QUOTE:b,UNQUOTED_FIELD:y,NEW_FIELD:w,NEW_ROW:C}=i;const{CR:x,LF:S,CRLF:k}=s;const[j,I]=l==="\r\n"?[k,2]:l==="\r"?[x,1]:[S,1];let E=C;let T=r;let M=0;let D;while(Tc){u.length=u.length-(M-c)}}if(h===a){return{nrows:h,ncols:n?c:0,offsets:u}}break;case w:if(n===true){u.push(T)}M++;break;default:break}}if(E!==C){h++;if(n===true){if(c===undefined){c=M}if(Mc){u.length=u.length-(M-c)}}}return{nrows:h,ncols:n?c!==null&&c!==void 0?c:0:0,offsets:u}}function r(e){const{data:t,columnOffsets:n,delimiter:i=",",rowDelimiter:s="\r\n",startIndex:o=0,maxRows:r=4294967295}=e;let a=e.ncols;const l=[];let d=0;const c=s.length;let h=o;const u=t.length;let p;let m;let g;let f;let v;p=o;while(p!==-1&&d{"use strict";n.d(t,{G:()=>u});var i=n(61927);var s=n.n(i);var o=n(66127);var r=n.n(o);var a=n(1143);var l=n.n(a);const d="jp-CSVDelimiter";const c="jp-CSVDelimiter-label";const h="jp-CSVDelimiter-dropdown";class u extends a.Widget{constructor(e){super({node:p.createNode(e.widget.delimiter,e.translator)});this._widget=e.widget;this.addClass(d)}get selectNode(){return this.node.getElementsByTagName("select")[0]}handleEvent(e){switch(e.type){case"change":this._widget.delimiter=this.selectNode.value;break;default:break}}onAfterAttach(e){this.selectNode.addEventListener("change",this)}onBeforeDetach(e){this.selectNode.removeEventListener("change",this)}}var p;(function(e){function t(e,t){t=t||i.nullTranslator;const n=t===null||t===void 0?void 0:t.load("jupyterlab");const s=[[",",","],[";",";"],["\t",n.__("tab")],["|",n.__("pipe")],["#",n.__("hash")]];const r=document.createElement("div");const a=document.createElement("span");const l=document.createElement("select");a.textContent=n.__("Delimiter: ");a.className=c;for(const[i,o]of s){const t=document.createElement("option");t.value=i;t.textContent=o;if(i===e){t.selected=true}l.appendChild(t)}r.appendChild(a);const d=o.Styling.wrapSelect(l);d.classList.add(h);r.appendChild(d);return r}e.createNode=t})(p||(p={}))},92500:(e,t,n)=>{"use strict";n.d(t,{Am:()=>y,Gg:()=>v,Mv:()=>_,Pb:()=>w,og:()=>C,t2:()=>b});var i=n(37737);var s=n.n(i);var o=n(44185);var r=n.n(o);var a=n(5592);var l=n.n(a);var d=n(2336);var c=n.n(d);var h=n(1143);var u=n.n(h);var p=n(69105);const m="jp-CSVViewer";const g="jp-CSVViewer-grid";const f=1e3;class v{}class _{constructor(e){this._looping=true;this._changed=new d.Signal(this);this._grid=e;this._query=null;this._row=0;this._column=-1}get changed(){return this._changed}cellBackgroundColorRendererFunc(e){return({value:t,row:n,column:i})=>{if(this._query){if(t.match(this._query)){if(this._row===n&&this._column===i){return e.currentMatchBackgroundColor}return e.matchBackgroundColor}}return""}}clear(){this._query=null;this._row=0;this._column=-1;this._changed.emit(undefined)}find(e,t=false){const n=this._grid.dataModel;const i=n.rowCount("body");const s=n.columnCount("body");if(this._query!==e){this._row=0;this._column=-1}this._query=e;const o=this._grid.scrollY/this._grid.defaultSizes.rowHeight;const r=(this._grid.scrollY+this._grid.pageHeight)/this._grid.defaultSizes.rowHeight;const a=this._grid.scrollX/this._grid.defaultSizes.columnHeaderHeight;const l=(this._grid.scrollX+this._grid.pageWidth)/this._grid.defaultSizes.columnHeaderHeight;const d=(e,t)=>e>=o&&e<=r&&t>=a&&t<=l;const c=t?-1:1;this._column+=c;for(let h=this._row;t?h>=0:h=0:i=n-1){this._row=0;this._column=-1}}get query(){return this._query}}class b extends h.Widget{constructor(e){super();this._monitor=null;this._delimiter=",";this._revealed=new a.PromiseDelegate;this._baseRenderer=null;this._context=e.context;this.layout=new h.PanelLayout;this.addClass(m);this._ready=this.initialize()}get ready(){return this._ready}async initialize(){const e=this.layout;if(this.isDisposed||!e){return}const{BasicKeyHandler:t,BasicMouseHandler:n,DataGrid:s}=await x.ensureDataGrid();this._defaultStyle=s.defaultStyle;this._grid=new s({defaultSizes:{rowHeight:24,columnWidth:144,rowHeaderWidth:64,columnHeaderHeight:36}});this._grid.addClass(g);this._grid.headerVisibility="all";this._grid.keyHandler=new t;this._grid.mouseHandler=new n;this._grid.copyConfig={separator:"\t",format:s.copyFormatGeneric,headers:"all",warningThreshold:1e6};e.addWidget(this._grid);this._searchService=new _(this._grid);this._searchService.changed.connect(this._updateRenderer,this);await this._context.ready;await this._updateGrid();this._revealed.resolve(undefined);this._monitor=new i.ActivityMonitor({signal:this._context.model.contentChanged,timeout:f});this._monitor.activityStopped.connect(this._updateGrid,this)}get context(){return this._context}get revealed(){return this._revealed.promise}get delimiter(){return this._delimiter}set delimiter(e){if(e===this._delimiter){return}this._delimiter=e;void this._updateGrid()}get style(){return this._grid.style}set style(e){this._grid.style={...this._defaultStyle,...e}}set rendererConfig(e){this._baseRenderer=e;void this._updateRenderer()}get searchService(){return this._searchService}dispose(){if(this._monitor){this._monitor.dispose()}super.dispose()}goToLine(e){this._grid.scrollToRow(e)}onActivateRequest(e){this.node.tabIndex=-1;this.node.focus()}async _updateGrid(){const{BasicSelectionModel:e}=await x.ensureDataGrid();const{DSVModel:t}=await x.ensureDSVModel();const n=this._context.model.toString();const i=this._delimiter;const s=this._grid.dataModel;const o=this._grid.dataModel=new t({data:n,delimiter:i});this._grid.selectionModel=new e({dataModel:o});if(s){s.dispose()}}async _updateRenderer(){if(this._baseRenderer===null){return}const{TextRenderer:e}=await x.ensureDataGrid();const t=this._baseRenderer;const n=new e({textColor:t.textColor,horizontalAlignment:t.horizontalAlignment,backgroundColor:this._searchService.cellBackgroundColorRendererFunc(t)});this._grid.cellRenderers.update({body:n,"column-header":n,"corner-header":n,"row-header":n})}}class y extends o.DocumentWidget{constructor(e){let{content:t,context:n,delimiter:i,reveal:s,...o}=e;t=t||x.createContent(n);s=Promise.all([s,t.revealed]);super({content:t,context:n,reveal:s,...o});if(i){t.delimiter=i}}setFragment(e){const t=e.split("=");if(t[0]!=="#row"){return}let n=t[1].split(";")[0];n=n.split("-")[0];void this.context.ready.then((()=>{this.content.goToLine(Number(n))}))}}class w extends o.ABCWidgetFactory{createNewWidget(e){const t=this.translator;return new y({context:e,translator:t})}defaultToolbarFactory(e){return[{name:"delimiter",widget:new p.G({widget:e.content,translator:this.translator})}]}}class C extends w{createNewWidget(e){const t="\t";return new y({context:e,delimiter:t,translator:this.translator})}}var x;(function(e){let t=null;let i=null;async function s(){if(t==null){t=new a.PromiseDelegate;t.resolve(await n.e(8426).then(n.t.bind(n,28426,23)))}return t.promise}e.ensureDataGrid=s;async function o(){if(i==null){i=new a.PromiseDelegate;i.resolve(await Promise.all([n.e(4470),n.e(8426)]).then(n.bind(n,77515)))}return i.promise}e.ensureDSVModel=o;function r(e){return new b({context:e})}e.createContent=r})(x||(x={}))},5367:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>U});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(93681);var l=n.n(a);var d=n(98335);var c=n.n(d);var h=n(16015);var u=n.n(h);var p=n(37737);var m=n.n(p);var g=n(58257);var f=n.n(g);var v=n(44185);var _=n.n(v);var b=n(38894);var y=n.n(b);var w=n(39357);var C=n.n(w);var x=n(54281);var S=n.n(x);var k=n(90943);var j=n.n(k);var I=n(15615);var E=n.n(I);var T=n(61927);var M=n.n(T);function D(e){Object.values(g.Debugger.CommandIDs).forEach((t=>{if(e.hasCommand(t)){e.notifyCommandChanged(t)}}))}function A(e,t){const n=t.hasStoppedThreads();if(n){document.body.dataset.jpDebuggerStoppedThreads="true"}else{delete document.body.dataset.jpDebuggerStoppedThreads}D(e)}const P={id:"@jupyterlab/debugger-extension:consoles",description:"Add debugger capability to the consoles.",autoStart:true,requires:[g.IDebugger,h.IConsoleTracker],optional:[i.ILabShell],activate:(e,t,n,i)=>{const s=new g.Debugger.Handler({type:"console",shell:e.shell,service:t});const o=async n=>{const{sessionContext:i}=n;await i.ready;await s.updateContext(n,i);A(e.commands,t)};if(i){i.currentChanged.connect(((e,t)=>{const n=t.newValue;if(n instanceof h.ConsolePanel){void o(n)}}))}else{n.currentChanged.connect(((e,t)=>{if(t){void o(t)}}))}}};const L={id:"@jupyterlab/debugger-extension:files",description:"Adds debugger capabilities to files.",autoStart:true,requires:[g.IDebugger,b.IEditorTracker],optional:[i.ILabShell],activate:(e,t,n,i)=>{const s=new g.Debugger.Handler({type:"file",shell:e.shell,service:t});const o={};const r=async n=>{const i=e.serviceManager.sessions;try{const r=await i.findByPath(n.context.path);if(!r){return}let a=o[r.id];if(!a){a=i.connectTo({model:r});o[r.id]=a}await s.update(n,a);A(e.commands,t)}catch(r){return}};if(i){i.currentChanged.connect(((e,t)=>{const n=t.newValue;if(n instanceof v.DocumentWidget){const{content:e}=n;if(e instanceof b.FileEditor){void r(n)}}}))}else{n.currentChanged.connect(((e,t)=>{if(t){void r(t)}}))}}};const R={id:"@jupyterlab/debugger-extension:notebooks",description:"Adds debugger capability to notebooks and provides the debugger notebook handler.",autoStart:true,requires:[g.IDebugger,x.INotebookTracker],optional:[i.ILabShell,o.ICommandPalette,o.ISessionContextDialogs,T.ITranslator],provides:g.IDebuggerHandler,activate:(e,t,n,i,s,r,a)=>{const l=a!==null&&a!==void 0?a:T.nullTranslator;const d=r!==null&&r!==void 0?r:new o.SessionContextDialogs({translator:l});const c=new g.Debugger.Handler({type:"notebook",shell:e.shell,service:t});const h=l.load("jupyterlab");e.commands.addCommand(g.Debugger.CommandIDs.restartDebug,{label:h.__("Restart Kernel and Debug…"),caption:h.__("Restart Kernel and Debug…"),isEnabled:()=>t.isStarted,execute:async()=>{const e=t.getDebuggerState();await t.stop();const i=n.currentWidget;if(!i){return}const{content:s,sessionContext:o}=i;const r=await d.restart(o);if(!r){return}await t.restoreDebuggerState(e);await c.updateWidget(i,o.session);await x.NotebookActions.runAll(s,o,d,l)}});const u=async n=>{if(n){const{sessionContext:e}=n;await e.ready;await c.updateContext(n,e)}A(e.commands,t)};if(i){i.currentChanged.connect(((e,t)=>{const n=t.newValue;if(n instanceof x.NotebookPanel){void u(n)}}))}else{n.currentChanged.connect(((e,t)=>{if(t){void u(t)}}))}if(s){s.addItem({category:"Notebook Operations",command:g.Debugger.CommandIDs.restartDebug})}return c}};const N={id:"@jupyterlab/debugger-extension:service",description:"Provides the debugger service.",autoStart:true,provides:g.IDebugger,requires:[g.IDebuggerConfig],optional:[g.IDebuggerSources,T.ITranslator],activate:(e,t,n,i)=>new g.Debugger.Service({config:t,debuggerSources:n,specsManager:e.serviceManager.kernelspecs,translator:i})};const O={id:"@jupyterlab/debugger-extension:config",description:"Provides the debugger configuration",provides:g.IDebuggerConfig,autoStart:true,activate:()=>new g.Debugger.Config};const B={id:"@jupyterlab/debugger-extension:sources",description:"Provides the source feature for debugging",autoStart:true,provides:g.IDebuggerSources,requires:[g.IDebuggerConfig,d.IEditorServices],optional:[x.INotebookTracker,h.IConsoleTracker,b.IEditorTracker],activate:(e,t,n,i,s,o)=>new g.Debugger.Sources({config:t,shell:e.shell,editorServices:n,notebookTracker:i,consoleTracker:s,editorTracker:o})};const F={id:"@jupyterlab/debugger-extension:variables",description:"Adds variables renderer and inspection in the debugger variable panel.",autoStart:true,requires:[g.IDebugger,g.IDebuggerHandler,T.ITranslator],optional:[o.IThemeManager,k.IRenderMimeRegistry],activate:(e,t,n,i,s,r)=>{const a=i.load("jupyterlab");const{commands:l,shell:d}=e;const c=new o.WidgetTracker({namespace:"debugger/inspect-variable"});const h=new o.WidgetTracker({namespace:"debugger/render-variable"});const u=g.Debugger.CommandIDs;l.addCommand(u.inspectVariable,{label:a.__("Inspect Variable"),caption:a.__("Inspect Variable"),isEnabled:e=>{var n,i,s,o;return!!((n=t.session)===null||n===void 0?void 0:n.isStarted)&&Number((o=(i=e.variableReference)!==null&&i!==void 0?i:(s=t.model.variables.selectedVariable)===null||s===void 0?void 0:s.variablesReference)!==null&&o!==void 0?o:0)>0},execute:async e=>{var n,i,r,a;let{variableReference:h,name:u}=e;if(!h){h=(n=t.model.variables.selectedVariable)===null||n===void 0?void 0:n.variablesReference}if(!u){u=(i=t.model.variables.selectedVariable)===null||i===void 0?void 0:i.name}const p=`jp-debugger-variable-${u}`;if(!u||!h||c.find((e=>e.id===p))){return}const m=await t.inspectVariable(h);if(!m||m.length===0){return}const f=t.model.variables;const v=new o.MainAreaWidget({content:new g.Debugger.VariablesGrid({model:f,commands:l,scopes:[{name:u,variables:m}],themeManager:s})});v.addClass("jp-DebuggerVariables");v.id=p;v.title.icon=g.Debugger.Icons.variableIcon;v.title.label=`${(a=(r=t.session)===null||r===void 0?void 0:r.connection)===null||a===void 0?void 0:a.name} - ${u}`;void c.add(v);const _=()=>{v.dispose();f.changed.disconnect(_)};f.changed.connect(_);d.add(v,"main",{mode:c.currentWidget?"split-right":"split-bottom",activate:false,type:"Debugger Variables"})}});l.addCommand(u.renderMimeVariable,{label:a.__("Render Variable"),caption:a.__("Render variable according to its mime type"),isEnabled:()=>{var e;return!!((e=t.session)===null||e===void 0?void 0:e.isStarted)},isVisible:()=>t.model.hasRichVariableRendering&&(r!==null||n.activeWidget instanceof x.NotebookPanel),execute:e=>{var s,o,a,l,c,u,p,m;let{name:f,frameId:v}=e;if(!f){f=(s=t.model.variables.selectedVariable)===null||s===void 0?void 0:s.name}if(!v){v=(o=t.model.callstack.frame)===null||o===void 0?void 0:o.id}const _=n.activeWidget;let b=_ instanceof x.NotebookPanel?_.content.rendermime:r;if(!b){return}const y=`jp-debugger-variable-mime-${f}-${(l=(a=t.session)===null||a===void 0?void 0:a.connection)===null||l===void 0?void 0:l.path.replace("/","-")}`;if(!f||h.find((e=>e.id===y))||!v&&t.hasStoppedThreads()){return}const w=t.model.variables;const C=new g.Debugger.VariableRenderer({dataLoader:()=>t.inspectRichVariable(f,v),rendermime:b,translator:i});C.addClass("jp-DebuggerRichVariable");C.id=y;C.title.icon=g.Debugger.Icons.variableIcon;C.title.label=`${f} - ${(u=(c=t.session)===null||c===void 0?void 0:c.connection)===null||u===void 0?void 0:u.name}`;C.title.caption=`${f} - ${(m=(p=t.session)===null||p===void 0?void 0:p.connection)===null||m===void 0?void 0:m.path}`;void h.add(C);const S=()=>{C.dispose();w.changed.disconnect(k);_===null||_===void 0?void 0:_.disposed.disconnect(S)};const k=()=>{if(n.activeWidget===_){void C.refresh()}};C.disposed.connect(S);w.changed.connect(k);_===null||_===void 0?void 0:_.disposed.connect(S);d.add(C,"main",{mode:h.currentWidget?"split-right":"split-bottom",activate:false,type:"Debugger Variables"})}});l.addCommand(u.copyToClipboard,{label:a.__("Copy to Clipboard"),caption:a.__("Copy text representation of the value to clipboard"),isEnabled:()=>{var e,n;return!!((e=t.session)===null||e===void 0?void 0:e.isStarted)&&!!((n=t.model.variables.selectedVariable)===null||n===void 0?void 0:n.value)},isVisible:()=>n.activeWidget instanceof x.NotebookPanel,execute:async()=>{const e=t.model.variables.selectedVariable.value;if(e){o.Clipboard.copyToSystem(e)}}});l.addCommand(u.copyToGlobals,{label:a.__("Copy Variable to Globals"),caption:a.__("Copy variable to globals scope"),isEnabled:()=>{var e;return!!((e=t.session)===null||e===void 0?void 0:e.isStarted)},isVisible:()=>n.activeWidget instanceof x.NotebookPanel&&t.model.supportCopyToGlobals,execute:async e=>{const n=t.model.variables.selectedVariable.name;await t.copyToGlobals(n)}})}};const z={id:"@jupyterlab/debugger-extension:sidebar",description:"Provides the debugger sidebar.",provides:g.IDebuggerSidebar,requires:[g.IDebugger,d.IEditorServices,T.ITranslator],optional:[o.IThemeManager,I.ISettingRegistry],autoStart:true,activate:async(e,t,n,i,s,o)=>{const{commands:r}=e;const a=g.Debugger.CommandIDs;const l={registry:r,continue:a.debugContinue,terminate:a.terminate,next:a.next,stepIn:a.stepIn,stepOut:a.stepOut,evaluate:a.evaluate};const d={registry:r,pauseOnExceptions:a.pauseOnExceptions};const c=new g.Debugger.Sidebar({service:t,callstackCommands:l,breakpointsCommands:d,editorServices:n,themeManager:s,translator:i});if(o){const e=await o.load(W.id);const n=()=>{var n,i,s,o;const r=e.get("variableFilters").composite;const a=(o=(s=(i=(n=t.session)===null||n===void 0?void 0:n.connection)===null||i===void 0?void 0:i.kernel)===null||s===void 0?void 0:s.name)!==null&&o!==void 0?o:"";if(a&&r[a]){c.variables.filter=new Set(r[a])}const l=e.get("defaultKernelSourcesFilter").composite;c.kernelSources.filter=l};n();e.changed.connect(n);t.sessionChanged.connect(n)}return c}};const H={id:"@jupyterlab/debugger-extension:source-viewer",description:"Initialize the debugger sources viewer.",requires:[g.IDebugger,d.IEditorServices,g.IDebuggerSources,T.ITranslator],provides:g.IDebuggerSourceViewer,autoStart:true,activate:async(e,t,n,i,s)=>{const r=new g.Debugger.ReadOnlyEditorFactory({editorServices:n});const{model:a}=t;const l=(e,n)=>{var s,o,r,a,l,d,c,h,u;i.find({focus:true,kernel:(a=(r=(o=(s=t.session)===null||s===void 0?void 0:s.connection)===null||o===void 0?void 0:o.kernel)===null||r===void 0?void 0:r.name)!==null&&a!==void 0?a:"",path:(c=(d=(l=t.session)===null||l===void 0?void 0:l.connection)===null||d===void 0?void 0:d.path)!==null&&c!==void 0?c:"",source:(u=(h=n===null||n===void 0?void 0:n.source)===null||h===void 0?void 0:h.path)!==null&&u!==void 0?u:""}).forEach((e=>{requestAnimationFrame((()=>{void e.reveal().then((()=>{const t=e.get();if(t){g.Debugger.EditorHandler.showCurrentLine(t,n.line)}}))}))}))};a.callstack.currentFrameChanged.connect(l);const d=(e,n)=>{var s,o,a,l,d,c,h;if(!e){return}const{content:u,mimeType:m,path:f}=e;const v=i.find({focus:true,kernel:(l=(a=(o=(s=t.session)===null||s===void 0?void 0:s.connection)===null||o===void 0?void 0:o.kernel)===null||a===void 0?void 0:a.name)!==null&&l!==void 0?l:"",path:(h=(c=(d=t.session)===null||d===void 0?void 0:d.connection)===null||c===void 0?void 0:c.path)!==null&&h!==void 0?h:"",source:f});if(v.length>0){if(n&&typeof n.line!=="undefined"){v.forEach((e=>{void e.reveal().then((()=>{var t;(t=e.get())===null||t===void 0?void 0:t.revealPosition({line:n.line-1,column:n.column||0})}))}))}return}const _=r.createNewEditor({content:u,mimeType:m,path:f});const b=_.editor;const y=new g.Debugger.EditorHandler({debuggerService:t,editorReady:()=>Promise.resolve(b),getEditor:()=>b,path:f,src:b.model.sharedModel});_.disposed.connect((()=>y.dispose()));i.open({label:p.PathExt.basename(f),caption:f,editorWrapper:_});const w=t.model.callstack.frame;if(w){g.Debugger.EditorHandler.showCurrentLine(b,w.line)}};const c=s.load("jupyterlab");e.commands.addCommand(g.Debugger.CommandIDs.openSource,{label:c.__("Open Source"),caption:c.__("Open Source"),isEnabled:()=>!!H,execute:async e=>{const n=e.path||"";if(!n){throw Error("Path to open is needed")}if(!t.isStarted){const e=await(0,o.showDialog)({title:c.__("Start debugger?"),body:c.__("The debugger service is needed to open the source %1",n),buttons:[o.Dialog.cancelButton({label:c.__("Cancel")}),o.Dialog.okButton({label:c.__("Start debugger")})]});if(e.button.accept){await t.start()}else{return}}const i=await t.getSource({path:n});return d(i)}});return Object.freeze({open:d})}};const W={id:"@jupyterlab/debugger-extension:main",description:"Initialize the debugger user interface.",requires:[g.IDebugger,g.IDebuggerSidebar,d.IEditorServices,T.ITranslator],optional:[o.ICommandPalette,g.IDebuggerSourceViewer,i.ILabShell,i.ILayoutRestorer,w.ILoggerRegistry,I.ISettingRegistry],autoStart:true,activate:async(e,t,n,i,s,r,l,d,c,h,u)=>{var m;const f=s.load("jupyterlab");const{commands:v,shell:_,serviceManager:b}=e;const{kernelspecs:y}=b;const w=g.Debugger.CommandIDs;const C=p.PageConfig.getOption("alwaysShowDebuggerExtension").toLowerCase()==="true";if(!C){await y.ready;const e=(m=y.specs)===null||m===void 0?void 0:m.kernelspecs;if(!e){return}const t=Object.keys(e).some((t=>{var n,i,s;return!!((s=(i=(n=e[t])===null||n===void 0?void 0:n.metadata)===null||i===void 0?void 0:i["debugger"])!==null&&s!==void 0?s:false)}));if(!t){return}}const x=async()=>{var e,n,s;const o=(n=(e=t.session)===null||e===void 0?void 0:e.connection)===null||n===void 0?void 0:n.kernel;if(!o){return""}const r=(await o.info).language_info;const a=r.name;const l=(s=i.mimeTypeService.getMimeTypeByLanguage({name:a}))!==null&&s!==void 0?s:"";return l};const S=new k.RenderMimeRegistry({initialFactories:k.standardRendererFactories});v.addCommand(w.evaluate,{label:f.__("Evaluate Code"),caption:f.__("Evaluate Code"),icon:g.Debugger.Icons.evaluateIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{var e,n,s;const o=await x();const r=await g.Debugger.Dialogs.getCode({title:f.__("Evaluate Code"),okLabel:f.__("Evaluate"),cancelLabel:f.__("Cancel"),mimeType:o,contentFactory:new a.CodeCell.ContentFactory({editorFactory:e=>i.factoryService.newInlineEditor(e)}),rendermime:S});const l=r.value;if(!r.button.accept||!l){return}const d=await t.evaluate(l);if(d){const i=d.result;const o=(n=(e=t===null||t===void 0?void 0:t.session)===null||e===void 0?void 0:e.connection)===null||n===void 0?void 0:n.path;const r=o?(s=h===null||h===void 0?void 0:h.getLogger)===null||s===void 0?void 0:s.call(h,o):undefined;if(r){r.log({type:"text",data:i,level:r.level})}else{console.debug(i)}}}});v.addCommand(w.debugContinue,{label:()=>t.hasStoppedThreads()?f.__("Continue"):f.__("Pause"),caption:()=>t.hasStoppedThreads()?f.__("Continue"):f.__("Pause"),icon:()=>t.hasStoppedThreads()?g.Debugger.Icons.continueIcon:g.Debugger.Icons.pauseIcon,isEnabled:()=>{var e,n;return(n=(e=t.session)===null||e===void 0?void 0:e.isStarted)!==null&&n!==void 0?n:false},execute:async()=>{if(t.hasStoppedThreads()){await t.continue()}else{await t.pause()}v.notifyCommandChanged(w.debugContinue)}});v.addCommand(w.terminate,{label:f.__("Terminate"),caption:f.__("Terminate"),icon:g.Debugger.Icons.terminateIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.restart();A(e.commands,t)}});v.addCommand(w.next,{label:f.__("Next"),caption:f.__("Next"),icon:g.Debugger.Icons.stepOverIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.next()}});v.addCommand(w.stepIn,{label:f.__("Step In"),caption:f.__("Step In"),icon:g.Debugger.Icons.stepIntoIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.stepIn()}});v.addCommand(w.stepOut,{label:f.__("Step Out"),caption:f.__("Step Out"),icon:g.Debugger.Icons.stepOutIcon,isEnabled:()=>t.hasStoppedThreads(),execute:async()=>{await t.stepOut()}});v.addCommand(w.pauseOnExceptions,{label:e=>e.filter||"Breakpoints on exception",caption:e=>e.description,isToggled:e=>{var n;return((n=t.session)===null||n===void 0?void 0:n.isPausingOnException(e.filter))||false},isEnabled:()=>t.pauseOnExceptionsIsValid(),execute:async e=>{var n,i,s;if(e===null||e===void 0?void 0:e.filter){let n=e.filter;await t.pauseOnExceptionsFilter(n)}else{let e=[];(i=(n=t.session)===null||n===void 0?void 0:n.exceptionBreakpointFilters)===null||i===void 0?void 0:i.forEach((t=>{e.push(t.filter)}));const r=await o.InputDialog.getMultipleItems({title:f.__("Select a filter for breakpoints on exception"),items:e,defaults:((s=t.session)===null||s===void 0?void 0:s.currentExceptionFilters)||[]});let a=r.button.accept?r.value:null;if(a!==null){await t.pauseOnExceptions(a)}}}});let j=false;if(u){const e=await u.load(W.id);const t=()=>{j=e.get("autoCollapseDebuggerSidebar").composite};t();e.changed.connect(t)}t.eventMessage.connect(((i,s)=>{A(e.commands,t);if(d&&s.event==="initialized"){d.activateById(n.id)}else if(d&&n.isVisible&&s.event==="terminated"&&j){d.collapseRight()}}));t.sessionChanged.connect((n=>{A(e.commands,t)}));if(c){c.add(n,"debugger-sidebar")}n.node.setAttribute("role","region");n.node.setAttribute("aria-label",f.__("Debugger section"));n.title.caption=f.__("Debugger");_.add(n,"right",{type:"Debugger"});v.addCommand(w.showPanel,{label:f.__("Debugger Panel"),execute:()=>{_.activateById(n.id)}});if(r){const e=f.__("Debugger");[w.debugContinue,w.terminate,w.next,w.stepIn,w.stepOut,w.evaluate,w.pauseOnExceptions].forEach((t=>{r.addItem({command:t,category:e})}))}if(l){const{model:e}=t;const n=(e,t,n)=>{if(!t){return}l.open(t,n)};e.sources.currentSourceOpened.connect(((e,t)=>{l.open(t)}));e.kernelSources.kernelSourceOpened.connect(n);e.breakpoints.clicked.connect((async(e,n)=>{var i;const s=(i=n.source)===null||i===void 0?void 0:i.path;const o=await t.getSource({sourceReference:0,path:s});l.open(o,n)}))}}};const V=[N,P,L,R,F,z,W,B,H,O];const U=V},1904:(e,t,n)=>{"use strict";var i=n(97913);var s=n(17325);var o=n(5893);var r=n(79010);var a=n(3579);var l=n(53377);var d=n(50286);var c=n(77748);var h=n(28006);var u=n(10395);var p=n(40662);var m=n(23359);var g=n(85072);var f=n.n(g);var v=n(97825);var _=n.n(v);var b=n(77659);var y=n.n(b);var w=n(55056);var C=n.n(w);var x=n(10540);var S=n.n(x);var k=n(41113);var j=n.n(k);var I=n(1597);var E={};E.styleTagTransform=j();E.setAttributes=C();E.insert=y().bind(null,"head");E.domAPI=_();E.insertStyleElement=S();var T=f()(I.A,E);const M=I.A&&I.A.locals?I.A.locals:undefined;var D=n(69704)},35086:(e,t,n)=>{"use strict";n.d(t,{s:()=>Re});var i=n(66127);const s=1540483477;const o=new TextEncoder;function r(e,t){const n=o.encode(e);let i=n.length;let r=t^i;let a=0;while(i>=4){let e=n[a]&255|(n[++a]&255)<<8|(n[++a]&255)<<16|(n[++a]&255)<<24;e=(e&65535)*s+(((e>>>16)*s&65535)<<16);e^=e>>>24;e=(e&65535)*s+(((e>>>16)*s&65535)<<16);r=(r&65535)*s+(((r>>>16)*s&65535)<<16)^e;i-=4;++a}switch(i){case 3:r^=(n[a+2]&255)<<16;case 2:r^=(n[a+1]&255)<<8;case 1:r^=n[a]&255;r=(r&65535)*s+(((r>>>16)*s&65535)<<16)}r^=r>>>13;r=(r&65535)*s+(((r>>>16)*s&65535)<<16);r^=r>>>15;return r>>>0}class a{constructor(){this._fileParams=new Map;this._hashMethods=new Map}getCodeId(e,t){const n=this._fileParams.get(t);if(!n){throw new Error(`Kernel (${t}) has no tmp file params.`)}const i=this._hashMethods.get(t);if(!i){throw new Error(`Kernel (${t}) has no hashing params.`)}const{prefix:s,suffix:o}=n;return`${s}${i(e)}${o}`}setHashParams(e){const{kernel:t,method:n,seed:i}=e;if(!t){throw new TypeError(`Kernel name is not defined.`)}switch(n){case"Murmur2":this._hashMethods.set(t,(e=>r(e,i).toString()));break;default:throw new Error(`Hash method (${n}) is not supported.`)}}setTmpFileParams(e){const{kernel:t,prefix:n,suffix:i}=e;if(!t){throw new TypeError(`Kernel name is not defined.`)}this._fileParams.set(t,{kernel:t,prefix:n,suffix:i})}getTmpFileParams(e){return this._fileParams.get(e)}}var l=n(72050);var d=n(93681);var c=n(1143);var h;(function(e){function t(e){const t=new u({...e,body:new p(e),buttons:[l.Dialog.cancelButton({label:e.cancelLabel}),l.Dialog.okButton({label:e.okLabel})]});return t.launch()}e.getCode=t})(h||(h={}));class u extends l.Dialog{handleEvent(e){if(e.type==="keydown"){const t=e;const{code:n,shiftKey:i}=t;if(i&&n==="Enter"){return this.resolve()}if(n==="Enter"){return}}super.handleEvent(e)}}class p extends c.Widget{constructor(e){super();const{contentFactory:t,rendermime:n,mimeType:i}=e;const s=new d.CodeCellModel;s.mimeType=i!==null&&i!==void 0?i:"";this._prompt=new d.CodeCell({contentFactory:t,rendermime:n,model:s,placeholder:false}).initializeState();this._prompt.inputArea.promptNode.remove();this.node.appendChild(this._prompt.node)}getValue(){return this._prompt.model.sharedModel.getSource()}onAfterAttach(e){super.onAfterAttach(e);this._prompt.activate()}}var m=n(98335);class g{constructor(e){this._services=e.editorServices}createNewEditor(e){const{content:t,mimeType:n,path:i}=e;const s=this._services.factoryService.newInlineEditor;const o=this._services.mimeTypeService;const r=new m.CodeEditor.Model({mimeType:n||o.getMimeTypeByFilePath(i)});r.sharedModel.source=t;const a=new m.CodeEditorWrapper({editorOptions:{config:{readOnly:true,lineNumbers:true}},model:r,factory:s});a.node.setAttribute("data-jp-debugger","true");a.disposed.connect((()=>{r.dispose()}));return a}}var f=n(61927);var v=n(68148);var _=n(2336);var b=n(37737);var y=n(71674);var w=n(22819);const C="jp-DebuggerEditor-highlight";const x=1e3;class S{constructor(e){var t,n,i,s;this._src=e.src;this._id=(i=(n=(t=e.debuggerService.session)===null||t===void 0?void 0:t.connection)===null||n===void 0?void 0:n.id)!==null&&i!==void 0?i:"";this._path=(s=e.path)!==null&&s!==void 0?s:"";this._debuggerService=e.debuggerService;this._editor=e.getEditor;this._editorMonitor=new b.ActivityMonitor({signal:this._src.changed,timeout:x});this._editorMonitor.activityStopped.connect((()=>{this._sendEditorBreakpoints()}),this);this._debuggerService.model.breakpoints.changed.connect((async()=>{const e=this.editor;if(!e||e.isDisposed){return}this._addBreakpointsToEditor()}));this._debuggerService.model.breakpoints.restored.connect((async()=>{const e=this.editor;if(!e||e.isDisposed){return}this._addBreakpointsToEditor()}));this._debuggerService.model.callstack.currentFrameChanged.connect((()=>{const e=this.editor;if(e){S.clearHighlight(e)}}));this._breakpointEffect=y.StateEffect.define({map:(e,t)=>({pos:e.pos.map((e=>t.mapPos(e)))})});this._breakpointState=y.StateField.define({create:()=>y.RangeSet.empty,update:(e,t)=>{e=e.map(t.changes);for(let n of t.effects){if(n.is(this._breakpointEffect)){let t=n;if(t.value.pos.length){e=e.update({add:t.value.pos.map((e=>k.breakpointMarker.range(e))),sort:true})}else{e=y.RangeSet.empty}}}return e}});this._gutter=new y.Compartment;this._highlightDeco=w.Decoration.line({class:C});this._highlightState=y.StateField.define({create:()=>w.Decoration.none,update:(e,t)=>{e=e.map(t.changes);for(let n of t.effects){if(n.is(S._highlightEffect)){let t=n;if(t.value.pos.length){e=e.update({add:t.value.pos.map((e=>this._highlightDeco.range(e)))})}else{e=w.Decoration.none}}}return e},provide:e=>w.EditorView.decorations.from(e)});void e.editorReady().then((()=>{this._setupEditor()}))}get editor(){return this._editor()}dispose(){if(this.isDisposed){return}this._editorMonitor.dispose();this._clearEditor();this.isDisposed=true;_.Signal.clearData(this)}refreshBreakpoints(){this._addBreakpointsToEditor()}_setupEditor(){const e=this.editor;if(!e||e.isDisposed){return}e.setOption("lineNumbers",true);const t=[this._breakpointState,this._highlightState,y.Prec.highest((0,w.gutter)({class:"cm-breakpoint-gutter",renderEmptyElements:true,markers:e=>e.state.field(this._breakpointState),initialSpacer:()=>k.breakpointMarker,domEventHandlers:{mousedown:(e,t)=>{this._onGutterClick(e,t.from);return true}}}))];e.injectExtension(this._gutter.of(t));this._addBreakpointsToEditor()}_clearEditor(){const e=this.editor;if(!e||e.isDisposed){return}S.clearHighlight(e);this._clearGutter(e);e.setOption("lineNumbers",false);e.editor.dispatch({effects:this._gutter.reconfigure([])})}_sendEditorBreakpoints(){var e;if((e=this.editor)===null||e===void 0?void 0:e.isDisposed){return}const t=this._getBreakpointsFromEditor().map((e=>{var t,n;return k.createBreakpoint(((n=(t=this._debuggerService.session)===null||t===void 0?void 0:t.connection)===null||n===void 0?void 0:n.name)||"",e)}));void this._debuggerService.updateBreakpoints(this._src.getSource(),t,this._path)}_onGutterClick(e,t){var n,i,s;if(this._id!==((i=(n=this._debuggerService.session)===null||n===void 0?void 0:n.connection)===null||i===void 0?void 0:i.id)){return}const o=e.state.doc.lineAt(t).number;let r=e.state.field(this._breakpointState);let a=false;r.between(t,t,(()=>{a=true}));let l=this._getBreakpoints();if(a){l=l.filter((e=>e.line!==o))}else{l.push(k.createBreakpoint((s=this._path)!==null&&s!==void 0?s:this._debuggerService.session.connection.name,o))}l.sort(((e,t)=>e.line-t.line));void this._debuggerService.updateBreakpoints(this._src.getSource(),l,this._path)}_addBreakpointsToEditor(){var e,t;if(this._id!==((t=(e=this._debuggerService.session)===null||e===void 0?void 0:e.connection)===null||t===void 0?void 0:t.id)){return}const n=this.editor;const i=this._getBreakpoints();this._clearGutter(n);const s=i.map((e=>n.state.doc.line(e.line).from));n.editor.dispatch({effects:this._breakpointEffect.of({pos:s})})}_getBreakpointsFromEditor(){const e=this.editor;const t=e.editor.state.field(this._breakpointState);let n=[];t.between(0,e.doc.length,(t=>{n.push(e.doc.lineAt(t).number)}));return n}_clearGutter(e){if(!e){return}const t=e.editor;t.dispatch({effects:this._breakpointEffect.of({pos:[]})})}_getBreakpoints(){const e=this._src.getSource();return this._debuggerService.model.breakpoints.getBreakpoints(this._path||this._debuggerService.getCodeId(e))}}(function(e){e._highlightEffect=y.StateEffect.define({map:(e,t)=>({pos:e.pos.map((e=>t.mapPos(e)))})});function t(t,i){n(t);const s=t;const o=s.doc.line(i).from;s.editor.dispatch({effects:e._highlightEffect.of({pos:[o]})})}e.showCurrentLine=t;function n(t){if(!t||t.isDisposed){return}const n=t;n.editor.dispatch({effects:e._highlightEffect.of({pos:[]})})}e.clearHighlight=n})(S||(S={}));var k;(function(e){e.breakpointMarker=new class extends w.GutterMarker{toDOM(){const e=document.createTextNode("●");return e}};function t(e,t){return{line:t,verified:true,source:{name:e}}}e.createBreakpoint=t})(k||(k={}));class j{constructor(e){this._debuggerService=e.debuggerService;this._consolePanel=e.widget;this._cellMap=new v.ObservableMap;const t=this._consolePanel.console;if(t.promptCell){this._addEditorHandler(t.promptCell)}t.promptCellCreated.connect(((e,t)=>{this._addEditorHandler(t)}));const n=()=>{for(const e of t.cells){this._addEditorHandler(e)}};n();this._consolePanel.console.cells.changed.connect(n)}dispose(){if(this.isDisposed){return}this.isDisposed=true;this._cellMap.values().forEach((e=>e.dispose()));this._cellMap.dispose();_.Signal.clearData(this)}_addEditorHandler(e){const t=e.model.id;if(e.model.type!=="code"||this._cellMap.has(t)){return}const n=e;const i=new S({debuggerService:this._debuggerService,editorReady:async()=>{await n.ready;return n.editor},getEditor:()=>n.editor,src:e.model.sharedModel});n.disposed.connect((()=>{this._cellMap.delete(t);i.dispose()}));this._cellMap.set(t,i)}}class I{constructor(e){var t;this._debuggerService=e.debuggerService;this._fileEditor=e.widget.content;this._hasLineNumber=(t=this._fileEditor.editor.getOption("lineNumbers"))!==null&&t!==void 0?t:false;this._editorHandler=new S({debuggerService:this._debuggerService,editorReady:()=>Promise.resolve(this._fileEditor.editor),getEditor:()=>this._fileEditor.editor,src:this._fileEditor.model.sharedModel})}dispose(){var e,t;if(this.isDisposed){return}this.isDisposed=true;(e=this._editorHandler)===null||e===void 0?void 0:e.dispose();(t=this._editorHandler)===null||t===void 0?void 0:t.editor.setOptions({lineNumbers:this._hasLineNumber});_.Signal.clearData(this)}}class E{constructor(e){this._debuggerService=e.debuggerService;this._notebookPanel=e.widget;this._cellMap=new v.ObservableMap;const t=this._notebookPanel.content;t.model.cells.changed.connect(this._onCellsChanged,this);this._onCellsChanged()}dispose(){if(this.isDisposed){return}this.isDisposed=true;this._cellMap.values().forEach((e=>{var t;e.dispose();(t=e.editor)===null||t===void 0?void 0:t.setOptions({...this._notebookPanel.content.editorConfig.code})}));this._cellMap.dispose();_.Signal.clearData(this)}_onCellsChanged(e,t){var n;this._notebookPanel.content.widgets.forEach((e=>this._addEditorHandler(e)));if((t===null||t===void 0?void 0:t.type)==="move"){for(const e of t.newValues){(n=this._cellMap.get(e.id))===null||n===void 0?void 0:n.refreshBreakpoints()}}}_addEditorHandler(e){const t=e.model.id;if(e.model.type!=="code"||this._cellMap.has(t)){return}const n=e;const i=new S({debuggerService:this._debuggerService,editorReady:async()=>{await n.ready;return n.editor},getEditor:()=>n.editor,src:e.model.sharedModel});n.disposed.connect((()=>{this._cellMap.delete(t);i.dispose()}));this._cellMap.set(e.model.id,i)}}const T="debugger-icon";function M(e,t,n,s,o=f.nullTranslator){const r=o.load("jupyterlab");const a=new i.ToolbarButton({className:"jp-DebuggerBugButton",icon:i.bugIcon,tooltip:r.__("Enable Debugger"),pressedIcon:i.bugDotIcon,pressedTooltip:r.__("Disable Debugger"),disabledTooltip:r.__("Select a kernel that supports debugging to enable debugger"),enabled:n,pressed:s,onClick:t});if(!e.toolbar.insertBefore("kernelName",T,a)){e.toolbar.addItem(T,a)}return a}function D(e,t,n=true,i){if(e){e.enabled=n;e.pressed=t;if(i){e.onClick=i}}}class A{constructor(e){this._handlers={};this._contextKernelChangedHandlers={};this._kernelChangedHandlers={};this._statusChangedHandlers={};this._iopubMessageHandlers={};this._iconButtons={};this._type=e.type;this._shell=e.shell;this._service=e.service}get activeWidget(){return this._activeWidget}async update(e,t){if(!t){delete this._kernelChangedHandlers[e.id];delete this._statusChangedHandlers[e.id];delete this._iopubMessageHandlers[e.id];return this.updateWidget(e,t)}const n=()=>{void this.updateWidget(e,t)};const i=this._kernelChangedHandlers[e.id];if(i){t.kernelChanged.disconnect(i)}this._kernelChangedHandlers[e.id]=n;t.kernelChanged.connect(n);const s=(n,i)=>{if(i.endsWith("restarting")){void this.updateWidget(e,t)}};const o=this._statusChangedHandlers[e.id];if(o){t.statusChanged.disconnect(o)}t.statusChanged.connect(s);this._statusChangedHandlers[e.id]=s;const r=(e,t)=>{if(this._service.isStarted&&!this._service.hasStoppedThreads()&&t.parent_header.msg_type==="execute_request"){void this._service.displayDefinedVariables()}};const a=this._iopubMessageHandlers[e.id];if(a){t.iopubMessage.disconnect(a)}t.iopubMessage.connect(r);this._iopubMessageHandlers[e.id]=r;this._activeWidget=e;return this.updateWidget(e,t)}async updateContext(e,t){const n=()=>{const{session:n}=t;void this.update(e,n)};const i=this._contextKernelChangedHandlers[e.id];if(i){t.kernelChanged.disconnect(i)}this._contextKernelChangedHandlers[e.id]=n;t.kernelChanged.connect(n);return this.update(e,t.session)}async updateWidget(e,t){var n,i,s,o;if(!this._service.model||!t){return}const r=()=>this._shell.currentWidget===e;const a=()=>{if(!this._handlers[e.id]){e.node.removeAttribute("data-jp-debugger");return}e.node.setAttribute("data-jp-debugger","true")};const l=()=>{if(this._handlers[e.id]){return}switch(this._type){case"notebook":this._handlers[e.id]=new E({debuggerService:this._service,widget:e});break;case"console":this._handlers[e.id]=new j({debuggerService:this._service,widget:e});break;case"file":this._handlers[e.id]=new I({debuggerService:this._service,widget:e});break;default:throw Error(`No handler for the type ${this._type}`)}a()};const d=()=>{var n,i,s,o;const r=this._handlers[e.id];if(!r){return}r.dispose();delete this._handlers[e.id];delete this._kernelChangedHandlers[e.id];delete this._statusChangedHandlers[e.id];delete this._iopubMessageHandlers[e.id];delete this._contextKernelChangedHandlers[e.id];if(((i=(n=this._service.session)===null||n===void 0?void 0:n.connection)===null||i===void 0?void 0:i.path)===(t===null||t===void 0?void 0:t.path)||!((o=(s=this._service.session)===null||s===void 0?void 0:s.connection)===null||o===void 0?void 0:o.kernel)){const e=this._service.model;e.clear()}a()};const c=(t=true)=>{const n=this._iconButtons[e.id];if(!n){this._iconButtons[e.id]=M(e,m,this._service.isStarted,t)}else{D(n,this._service.isStarted,t,m)}};const h=()=>{var e;return this._service.isStarted&&((e=this._previousConnection)===null||e===void 0?void 0:e.id)===(t===null||t===void 0?void 0:t.id)};const u=async()=>{this._service.session.connection=t;await this._service.stop()};const p=async()=>{var e,n;this._service.session.connection=t;this._previousConnection=t;await this._service.restoreState(true);await this._service.displayDefinedVariables();if((n=(e=this._service.session)===null||e===void 0?void 0:e.capabilities)===null||n===void 0?void 0:n.supportsModulesRequest){await this._service.displayModules()}};const m=async()=>{if(!r()){return}const t=this._iconButtons[e.id];if(h()){await u();d();D(t,false)}else{await p();l();D(t,true)}};c(false);e.disposed.connect((async()=>{if(h()){await u()}d();delete this._iconButtons[e.id];delete this._contextKernelChangedHandlers[e.id]}));const g=await this._service.isAvailable(t);if(!g){d();D(this._iconButtons[e.id],false,false);return}if(!this._service.session){this._service.session=new Re.Session({connection:t,config:this._service.config})}else{this._previousConnection=((n=this._service.session.connection)===null||n===void 0?void 0:n.kernel)?this._service.session.connection:null;this._service.session.connection=t}await this._service.restoreState(false);if(this._service.isStarted&&!this._service.hasStoppedThreads()){await this._service.displayDefinedVariables();if((s=(i=this._service.session)===null||i===void 0?void 0:i.capabilities)===null||s===void 0?void 0:s.supportsModulesRequest){await this._service.displayModules()}}D(this._iconButtons[e.id],this._service.isStarted,true);if(!this._service.isStarted){d();this._service.session.connection=(o=this._previousConnection)!==null&&o!==void 0?o:t;await this._service.restoreState(false);return}l();this._previousConnection=t}}class P{constructor(){this._breakpoints=new Map;this._changed=new _.Signal(this);this._restored=new _.Signal(this);this._clicked=new _.Signal(this)}get changed(){return this._changed}get restored(){return this._restored}get clicked(){return this._clicked}get breakpoints(){return this._breakpoints}setBreakpoints(e,t){this._breakpoints.set(e,t);this._changed.emit(t)}getBreakpoints(e){var t;return(t=this._breakpoints.get(e))!==null&&t!==void 0?t:[]}restoreBreakpoints(e){this._breakpoints=e;this._restored.emit()}}class L{constructor(){this._state=[];this._currentFrame=null;this._framesChanged=new _.Signal(this);this._currentFrameChanged=new _.Signal(this)}get frames(){return this._state}set frames(e){this._state=e;const t=this.frame!==null?R.getFrameId(this.frame):"";const n=e.find((e=>R.getFrameId(e)===t));if(!n){this.frame=e[0]}this._framesChanged.emit(e)}get frame(){return this._currentFrame}set frame(e){this._currentFrame=e;this._currentFrameChanged.emit(e)}get framesChanged(){return this._framesChanged}get currentFrameChanged(){return this._currentFrameChanged}}var R;(function(e){function t(e){var t;return`${(t=e===null||e===void 0?void 0:e.source)===null||t===void 0?void 0:t.path}-${e===null||e===void 0?void 0:e.id}`}e.getFrameId=t})(R||(R={}));class N{constructor(e){this._currentSourceOpened=new _.Signal(this);this._currentSourceChanged=new _.Signal(this);this.currentFrameChanged=e.currentFrameChanged}get currentSourceOpened(){return this._currentSourceOpened}get currentSourceChanged(){return this._currentSourceChanged}get currentSource(){return this._currentSource}set currentSource(e){this._currentSource=e;this._currentSourceChanged.emit(e)}open(){this._currentSourceOpened.emit(this._currentSource)}}var O=n(26568);const B=500;const F=(e,t)=>{if(e.namet.name){return 1}return 0};class z{constructor(){this._filteredKernelSources=null;this._filter="";this._isDisposed=false;this._kernelSources=null;this._changed=new _.Signal(this);this._filterChanged=new _.Signal(this);this._kernelSourceOpened=new _.Signal(this);this.refresh=this.refresh.bind(this);this._refreshDebouncer=new O.Debouncer(this.refresh,B)}get filter(){return this._filter}set filter(e){this._filter=e;this._filterChanged.emit(e);void this._refreshDebouncer.invoke()}get isDisposed(){return this._isDisposed}get kernelSources(){return this._kernelSources}set kernelSources(e){this._kernelSources=e;this.refresh()}get changed(){return this._changed}get filterChanged(){return this._filterChanged}get kernelSourceOpened(){return this._kernelSourceOpened}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._refreshDebouncer.dispose();_.Signal.clearData(this)}open(e){this._kernelSourceOpened.emit(e)}getFilteredKernelSources(){const e=new RegExp(this._filter);return this._kernelSources.filter((t=>e.test(t.name)))}refresh(){if(this._kernelSources){this._filteredKernelSources=this._filter?this.getFilteredKernelSources():this._kernelSources;this._filteredKernelSources.sort(F)}else{this._kernelSources=new Array;this._filteredKernelSources=new Array}this._changed.emit(this._filteredKernelSources)}}class H{constructor(){this._selectedVariable=null;this._state=[];this._variableExpanded=new _.Signal(this);this._changed=new _.Signal(this)}get scopes(){return this._state}set scopes(e){this._state=e;this._changed.emit()}get changed(){return this._changed}get variableExpanded(){return this._variableExpanded}get selectedVariable(){return this._selectedVariable}set selectedVariable(e){this._selectedVariable=e}expandVariable(e){this._variableExpanded.emit(e)}}class W{constructor(){this._disposed=new _.Signal(this);this._isDisposed=false;this._hasRichVariableRendering=false;this._supportCopyToGlobals=false;this._stoppedThreads=new Set;this._title="-";this._titleChanged=new _.Signal(this);this.breakpoints=new P;this.callstack=new L;this.variables=new H;this.sources=new N({currentFrameChanged:this.callstack.currentFrameChanged});this.kernelSources=new z}get disposed(){return this._disposed}get hasRichVariableRendering(){return this._hasRichVariableRendering}set hasRichVariableRendering(e){this._hasRichVariableRendering=e}get supportCopyToGlobals(){return this._supportCopyToGlobals}set supportCopyToGlobals(e){this._supportCopyToGlobals=e}get isDisposed(){return this._isDisposed}get stoppedThreads(){return this._stoppedThreads}set stoppedThreads(e){this._stoppedThreads=e}get title(){return this._title}set title(e){if(e===this._title){return}this._title=e!==null&&e!==void 0?e:"-";this._titleChanged.emit(e)}get titleChanged(){return this._titleChanged}dispose(){if(this._isDisposed){return}this._isDisposed=true;this.kernelSources.dispose();this._disposed.emit()}clear(){this._stoppedThreads.clear();const e=new Map;this.breakpoints.restoreBreakpoints(e);this.callstack.frames=[];this.variables.scopes=[];this.sources.currentSource=null;this.kernelSources.kernelSources=null;this.title="-"}}class V extends c.Panel{constructor(e){super();this._filter=new Set;this._grid=null;this._pending=null;this.commands=e.commands;this.model=e.model;this.themeManager=e.themeManager;this.translator=e.translator;this.model.changed.connect((()=>this.update()),this);this.addClass("jp-DebuggerVariables-body")}get filter(){return this._filter}set filter(e){this._filter=e;this.update()}get scope(){return this._scope}set scope(e){this._scope=e;if(e!=="Globals"){this.addClass("jp-debuggerVariables-local")}else{this.removeClass("jp-debuggerVariables-local")}this.update()}async initialize(){if(this._grid||this._pending){return}const{Grid:e}=await(this._pending=Promise.all([n.e(4470),n.e(8426)]).then(n.bind(n,5011)));const{commands:t,model:i,themeManager:s,translator:o}=this;this._grid=new e({commands:t,model:i,themeManager:s,translator:o});this._grid.addClass("jp-DebuggerVariables-grid");this._pending=null;this.addWidget(this._grid);this.update()}onBeforeShow(e){if(!this._grid&&!this._pending){void this.initialize()}super.onBeforeShow(e)}onUpdateRequest(e){var t;if(this._grid){const{dataModel:e}=this._grid;e.filter=this._filter;e.scope=this._scope;e.setData((t=this.model.scopes)!==null&&t!==void 0?t:[])}super.onUpdateRequest(e)}}var U=n(90943);var q=n(5592);const $="jp-VariableRendererPanel";const K="jp-VariableRendererPanel-renderer";class J extends l.MainAreaWidget{constructor(e){const{dataLoader:t,rendermime:n,translator:i}=e;const s=new c.Panel;const o=new q.PromiseDelegate;super({content:s,reveal:Promise.all([t,o.promise])});this.content.addClass($);this.trans=(i!==null&&i!==void 0?i:f.nullTranslator).load("jupyterlab");this.dataLoader=t;this.renderMime=n;this._dataHash=null;this.refresh().then((()=>{o.resolve()})).catch((e=>o.reject(e)))}async refresh(e=false){let t=await this.dataLoader();if(Object.keys(t.data).length===0){t={data:{"text/plain":this.trans.__("The variable is undefined in the active context.")},metadata:{}}}if(t.data){const n=r(JSON.stringify(t),17);if(e||this._dataHash!==n){if(this.content.layout){this.content.widgets.forEach((e=>{this.content.layout.removeWidget(e)}))}const e=this.renderMime.preferredMimeType(t.data,"any");if(e){const i=this.renderMime.createRenderer(e);i.addClass(K);const s=new U.MimeModel({...t,trusted:true});this._dataHash=n;await i.renderModel(s);this.content.addWidget(i)}else{this._dataHash=null;return Promise.reject("Unable to determine the preferred mime type.")}}}else{this._dataHash=null;return Promise.reject("Unable to get a view on the variable.")}}}class G{constructor(e){var t,n;this._eventMessage=new _.Signal(this);this._isDisposed=false;this._sessionChanged=new _.Signal(this);this._pauseOnExceptionChanged=new _.Signal(this);this._config=e.config;this._session=null;this._specsManager=(t=e.specsManager)!==null&&t!==void 0?t:null;this._model=new Re.Model;this._debuggerSources=(n=e.debuggerSources)!==null&&n!==void 0?n:null;this._trans=(e.translator||f.nullTranslator).load("jupyterlab")}get eventMessage(){return this._eventMessage}get config(){return this._config}get isDisposed(){return this._isDisposed}get isStarted(){var e,t;return(t=(e=this._session)===null||e===void 0?void 0:e.isStarted)!==null&&t!==void 0?t:false}get pauseOnExceptionChanged(){return this._pauseOnExceptionChanged}get model(){return this._model}get session(){return this._session}set session(e){var t;if(this._session===e){return}if(this._session){this._session.dispose()}this._session=e;(t=this._session)===null||t===void 0?void 0:t.eventMessage.connect(((e,t)=>{if(t.event==="stopped"){this._model.stoppedThreads.clear();this._model.stoppedThreads.add(t.body.threadId);void this._getAllFrames()}else if(t.event==="continued"){this._model.stoppedThreads.delete(t.body.threadId);this._clearModel();this._clearSignals()}this._eventMessage.emit(t)}));this._sessionChanged.emit(e)}get sessionChanged(){return this._sessionChanged}dispose(){if(this.isDisposed){return}this._isDisposed=true;_.Signal.clearData(this)}getCodeId(e){var t,n,i,s;try{return this._config.getCodeId(e,(s=(i=(n=(t=this.session)===null||t===void 0?void 0:t.connection)===null||n===void 0?void 0:n.kernel)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"")}catch(o){return""}}hasStoppedThreads(){var e,t;return(t=((e=this._model)===null||e===void 0?void 0:e.stoppedThreads.size)>0)!==null&&t!==void 0?t:false}async isAvailable(e){var t,n,i,s;if(!this._specsManager){return true}await this._specsManager.ready;const o=e===null||e===void 0?void 0:e.kernel;if(!o){return false}const r=o.name;if(!((t=this._specsManager.specs)===null||t===void 0?void 0:t.kernelspecs[r])){return true}return!!((s=(i=(n=this._specsManager.specs.kernelspecs[r])===null||n===void 0?void 0:n.metadata)===null||i===void 0?void 0:i["debugger"])!==null&&s!==void 0?s:false)}async clearBreakpoints(){var e;if(((e=this.session)===null||e===void 0?void 0:e.isStarted)!==true){return}this._model.breakpoints.breakpoints.forEach(((e,t,n)=>{void this._setBreakpoints([],t)}));let t=new Map;this._model.breakpoints.restoreBreakpoints(t)}async continue(){try{if(!this.session){throw new Error("No active debugger session")}await this.session.sendRequest("continue",{threadId:this._currentThread()});this._model.stoppedThreads.delete(this._currentThread());this._clearModel();this._clearSignals()}catch(e){console.error("Error:",e.message)}}async getSource(e){var t,n;if(!this.session){throw new Error("No active debugger session")}const i=await this.session.sendRequest("source",{source:e,sourceReference:(t=e.sourceReference)!==null&&t!==void 0?t:0});return{...i.body,path:(n=e.path)!==null&&n!==void 0?n:""}}async evaluate(e){var t;if(!this.session){throw new Error("No active debugger session")}const n=(t=this.model.callstack.frame)===null||t===void 0?void 0:t.id;const i=await this.session.sendRequest("evaluate",{context:"repl",expression:e,frameId:n});if(!i.success){return null}this._clearModel();await this._getAllFrames();return i.body}async next(){try{if(!this.session){throw new Error("No active debugger session")}await this.session.sendRequest("next",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async inspectRichVariable(e,t){if(!this.session){throw new Error("No active debugger session")}const n=await this.session.sendRequest("richInspectVariables",{variableName:e,frameId:t});if(n.success){return n.body}else{throw new Error(n.message)}}async inspectVariable(e){if(!this.session){throw new Error("No active debugger session")}const t=await this.session.sendRequest("variables",{variablesReference:e});if(t.success){return t.body.variables}else{throw new Error(t.message)}}async copyToGlobals(e){if(!this.session){throw new Error("No active debugger session")}if(!this.model.supportCopyToGlobals){throw new Error('The "copyToGlobals" request is not supported by the kernel')}const t=this.model.callstack.frames;this.session.sendRequest("copyToGlobals",{srcVariableName:e,dstVariableName:e,srcFrameId:t[0].id}).then((async()=>{const e=await this._getScopes(t[0]);const n=await Promise.all(e.map((e=>this._getVariables(e))));const i=this._convertScopes(e,n);this._model.variables.scopes=i})).catch((e=>{console.error(e)}))}async displayDefinedVariables(){if(!this.session){throw new Error("No active debugger session")}const e=await this.session.sendRequest("inspectVariables",{});const t=e.body.variables;const n=[{name:this._trans.__("Globals"),variables:t}];this._model.variables.scopes=n}async displayModules(){if(!this.session){throw new Error("No active debugger session")}const e=await this.session.sendRequest("modules",{});this._model.kernelSources.kernelSources=e.body.modules.map((e=>({name:e.name,path:e.path})))}async restart(){const{breakpoints:e}=this._model.breakpoints;await this.stop();await this.start();await this._restoreBreakpoints(e)}async restoreState(e){var t,n,i,s,o,r,a,l,d,c;if(!this.model||!this.session){return}const h=await this.session.restoreState();const{body:u}=h;const p=this._mapBreakpoints(u.breakpoints);const m=new Set(u.stoppedThreads);this._model.hasRichVariableRendering=u.richRendering===true;this._model.supportCopyToGlobals=u.copyToGlobals===true;this._config.setHashParams({kernel:(s=(i=(n=(t=this.session)===null||t===void 0?void 0:t.connection)===null||n===void 0?void 0:n.kernel)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"",method:u.hashMethod,seed:u.hashSeed});this._config.setTmpFileParams({kernel:(l=(a=(r=(o=this.session)===null||o===void 0?void 0:o.connection)===null||r===void 0?void 0:r.kernel)===null||a===void 0?void 0:a.name)!==null&&l!==void 0?l:"",prefix:u.tmpFilePrefix,suffix:u.tmpFileSuffix});this._model.stoppedThreads=m;if(!this.isStarted&&(e||m.size!==0)){await this.start()}if(this.isStarted||e){this._model.title=this.isStarted?((c=(d=this.session)===null||d===void 0?void 0:d.connection)===null||c===void 0?void 0:c.name)||"-":"-"}if(this._debuggerSources){const e=this._filterBreakpoints(p);this._model.breakpoints.restoreBreakpoints(e)}else{this._model.breakpoints.restoreBreakpoints(p)}if(m.size!==0){await this._getAllFrames()}else if(this.isStarted){this._clearModel();this._clearSignals()}if(this.session.currentExceptionFilters){await this.pauseOnExceptions(this.session.currentExceptionFilters)}}start(){if(!this.session){throw new Error("No active debugger session")}return this.session.start()}async pause(){try{if(!this.session){throw new Error("No active debugger session")}await this.session.sendRequest("pause",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stepIn(){try{if(!this.session){throw new Error("No active debugger session")}await this.session.sendRequest("stepIn",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stepOut(){try{if(!this.session){throw new Error("No active debugger session")}await this.session.sendRequest("stepOut",{threadId:this._currentThread()})}catch(e){console.error("Error:",e.message)}}async stop(){if(!this.session){throw new Error("No active debugger session")}await this.session.stop();if(this._model){this._model.clear()}}async updateBreakpoints(e,t,n){var i;if(!((i=this.session)===null||i===void 0?void 0:i.isStarted)){return}if(!n){n=(await this._dumpCell(e)).body.sourcePath}const s=await this.session.restoreState();const o=t.filter((({line:e})=>typeof e==="number")).map((({line:e})=>({line:e})));const r=this._mapBreakpoints(s.body.breakpoints);if(this._debuggerSources){const e=this._filterBreakpoints(r);this._model.breakpoints.restoreBreakpoints(e)}else{this._model.breakpoints.restoreBreakpoints(r)}let a=new Set;const l=await this._setBreakpoints(o,n);const d=l.body.breakpoints.filter(((e,t,n)=>{const i=n.findIndex((t=>t.line===e.line))>-1;const s=!a.has(e.line);a.add(e.line);return i&&s}));this._model.breakpoints.setBreakpoints(n,d);await this.session.sendRequest("configurationDone",{})}pauseOnExceptionsIsValid(){var e,t;if(this.isStarted){if(((t=(e=this.session)===null||e===void 0?void 0:e.exceptionBreakpointFilters)===null||t===void 0?void 0:t.length)!==0){return true}}return false}async pauseOnExceptionsFilter(e){var t;if(!((t=this.session)===null||t===void 0?void 0:t.isStarted)){return}let n=this.session.currentExceptionFilters;if(this.session.isPausingOnException(e)){const t=n.indexOf(e);n.splice(t,1)}else{n===null||n===void 0?void 0:n.push(e)}await this.pauseOnExceptions(n)}async pauseOnExceptions(e){var t,n;if(!((t=this.session)===null||t===void 0?void 0:t.isStarted)){return}const i=((n=this.session.exceptionBreakpointFilters)===null||n===void 0?void 0:n.map((e=>e.filter)))||[];let s={filters:[]};e.forEach((e=>{if(i.includes(e)){s.filters.push(e)}}));this.session.currentExceptionFilters=s.filters;await this.session.sendRequest("setExceptionBreakpoints",s);this._pauseOnExceptionChanged.emit()}getDebuggerState(){var e,t,n,i,s,o,r;const a=this._model.breakpoints.breakpoints;let l=[];if(this._debuggerSources){for(const d of a.keys()){const a=this._debuggerSources.find({focus:false,kernel:(i=(n=(t=(e=this.session)===null||e===void 0?void 0:e.connection)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:"",path:(r=(o=(s=this._session)===null||s===void 0?void 0:s.connection)===null||o===void 0?void 0:o.path)!==null&&r!==void 0?r:"",source:d});const c=a.map((e=>e.src.getSource()));l=l.concat(c)}}return{cells:l,breakpoints:a}}async restoreDebuggerState(e){var t,n,i,s;await this.start();for(const c of e.cells){await this._dumpCell(c)}const o=new Map;const r=(s=(i=(n=(t=this.session)===null||t===void 0?void 0:t.connection)===null||n===void 0?void 0:n.kernel)===null||i===void 0?void 0:i.name)!==null&&s!==void 0?s:"";const{prefix:a,suffix:l}=this._config.getTmpFileParams(r);for(const c of e.breakpoints){const[e,t]=c;const n=e.substr(0,e.length-l.length);const i=n.substr(n.lastIndexOf("/")+1);const s=a.concat(i).concat(l);o.set(s,t)}await this._restoreBreakpoints(o);const d=await this.session.sendRequest("configurationDone",{});await this.restoreState(false);return d.success}_clearModel(){this._model.callstack.frames=[];this._model.variables.scopes=[]}_clearSignals(){this._model.callstack.currentFrameChanged.disconnect(this._onCurrentFrameChanged,this);this._model.variables.variableExpanded.disconnect(this._onVariableExpanded,this)}_convertScopes(e,t){if(!t||!e){return[]}return e.map(((e,n)=>({name:e.name,variables:t[n].map((e=>({...e})))})))}_currentThread(){var e;return(e=this._model.stoppedThreads.values().next().value)!==null&&e!==void 0?e:1}async _dumpCell(e){if(!this.session){throw new Error("No active debugger session")}return this.session.sendRequest("dumpCell",{code:e})}_filterBreakpoints(e){if(!this._debuggerSources){return e}let t=new Map;for(const n of e){const[e,i]=n;i.forEach((()=>{var n,s,o,r,a,l,d;this._debuggerSources.find({focus:false,kernel:(r=(o=(s=(n=this.session)===null||n===void 0?void 0:n.connection)===null||s===void 0?void 0:s.kernel)===null||o===void 0?void 0:o.name)!==null&&r!==void 0?r:"",path:(d=(l=(a=this._session)===null||a===void 0?void 0:a.connection)===null||l===void 0?void 0:l.path)!==null&&d!==void 0?d:"",source:e}).forEach((()=>{if(i.length>0){t.set(e,i)}}))}))}return t}async _getAllFrames(){this._model.callstack.currentFrameChanged.connect(this._onCurrentFrameChanged,this);this._model.variables.variableExpanded.connect(this._onVariableExpanded,this);const e=await this._getFrames(this._currentThread());this._model.callstack.frames=e}async _getFrames(e){if(!this.session){throw new Error("No active debugger session")}const t=await this.session.sendRequest("stackTrace",{threadId:e});const n=t.body.stackFrames;return n}async _getScopes(e){if(!this.session){throw new Error("No active debugger session")}if(!e){return[]}const t=await this.session.sendRequest("scopes",{frameId:e.id});return t.body.scopes}async _getVariables(e){if(!this.session){throw new Error("No active debugger session")}if(!e){return[]}const t=await this.session.sendRequest("variables",{variablesReference:e.variablesReference});return t.body.variables}_mapBreakpoints(e){if(!e.length){return new Map}return e.reduce(((e,t)=>{const{breakpoints:n,source:i}=t;e.set(i,n.map((e=>({...e,source:{path:i},verified:true}))));return e}),new Map)}async _onCurrentFrameChanged(e,t){if(!t){return}const n=await this._getScopes(t);const i=await Promise.all(n.map((e=>this._getVariables(e))));const s=this._convertScopes(n,i);this._model.variables.scopes=s}async _onVariableExpanded(e,t){if(!this.session){throw new Error("No active debugger session")}const n=await this.session.sendRequest("variables",{variablesReference:t.variablesReference});let i={...t,expanded:true};n.body.variables.forEach((e=>{i={[e.name]:e,...i}}));const s=this._model.variables.scopes.map((e=>{const n=e.variables.findIndex((e=>e.variablesReference===t.variablesReference));e.variables[n]=i;return{...e}}));this._model.variables.scopes=[...s];return n.body.variables}async _setBreakpoints(e,t){if(!this.session){throw new Error("No active debugger session")}return await this.session.sendRequest("setBreakpoints",{breakpoints:e,source:{path:t},sourceModified:false})}async _restoreBreakpoints(e){for(const[t,n]of e){await this._setBreakpoints(n.filter((({line:e})=>typeof e==="number")).map((({line:e})=>({line:e}))),t)}this._model.breakpoints.restoreBreakpoints(e)}}class Y{constructor(e){this._seq=0;this._ready=new q.PromiseDelegate;this._isDisposed=false;this._isStarted=false;this._exceptionPaths=[];this._exceptionBreakpointFilters=[];this._currentExceptionFilters={};this._disposed=new _.Signal(this);this._eventMessage=new _.Signal(this);this.connection=e.connection;this._config=e.config;this.translator=e.translator||f.nullTranslator}get isDisposed(){return this._isDisposed}get capabilities(){return this._capabilities}get disposed(){return this._disposed}get connection(){return this._connection}set connection(e){var t,n;if(this._connection){this._connection.iopubMessage.disconnect(this._handleEvent,this)}this._connection=e;if(!this._connection){this._isStarted=false;return}this._connection.iopubMessage.connect(this._handleEvent,this);this._ready=new q.PromiseDelegate;const i=(n=(t=this.connection)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.requestDebug({type:"request",seq:0,command:"debugInfo"});if(i){i.onReply=e=>{this._ready.resolve();i.dispose()}}}get isStarted(){return this._isStarted}get exceptionPaths(){return this._exceptionPaths}get exceptionBreakpointFilters(){return this._exceptionBreakpointFilters}get currentExceptionFilters(){var e,t,n;const i=(n=(t=(e=this.connection)===null||e===void 0?void 0:e.kernel)===null||t===void 0?void 0:t.name)!==null&&n!==void 0?n:"";if(!i){return[]}const s=this._config.getTmpFileParams(i);if(!s){return[]}let o=s.prefix;if(Object.keys(this._currentExceptionFilters).includes(o)){return this._currentExceptionFilters[o]}return[]}set currentExceptionFilters(e){var t,n,i;const s=(i=(n=(t=this.connection)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.name)!==null&&i!==void 0?i:"";if(!s){return}const o=this._config.getTmpFileParams(s);if(!o){return}let r=o.prefix;if(e===null){if(Object.keys(this._currentExceptionFilters).includes(r)){delete this._currentExceptionFilters[r]}}else{this._currentExceptionFilters[r]=e}}get eventMessage(){return this._eventMessage}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._disposed.emit();_.Signal.clearData(this)}async start(){var e,t,n,i;const s=await this.sendRequest("initialize",{clientID:"jupyterlab",clientName:"JupyterLab",adapterID:(n=(t=(e=this.connection)===null||e===void 0?void 0:e.kernel)===null||t===void 0?void 0:t.name)!==null&&n!==void 0?n:"",pathFormat:"path",linesStartAt1:true,columnsStartAt1:true,supportsVariableType:true,supportsVariablePaging:true,supportsRunInTerminalRequest:true,locale:document.documentElement.lang});if(!s.success){throw new Error(`Could not start the debugger: ${s.message}`)}this._capabilities=s.body;this._isStarted=true;this._exceptionBreakpointFilters=(i=s.body)===null||i===void 0?void 0:i.exceptionBreakpointFilters;await this.sendRequest("attach",{})}async stop(){this._isStarted=false;await this.sendRequest("disconnect",{restart:false,terminateDebuggee:false})}async restoreState(){var e;const t=await this.sendRequest("debugInfo",{});this._isStarted=t.body.isStarted;this._exceptionPaths=(e=t.body)===null||e===void 0?void 0:e.exceptionPaths;return t}isPausingOnException(e){var t,n;if(e){return(n=(t=this.currentExceptionFilters)===null||t===void 0?void 0:t.includes(e))!==null&&n!==void 0?n:false}else{return this.currentExceptionFilters.length>0}}async sendRequest(e,t){await this._ready.promise;const n=await this._sendDebugMessage({type:"request",seq:this._seq++,command:e,arguments:t});return n.content}_handleEvent(e,t){const n=t.header.msg_type;if(n!=="debug_event"){return}const i=t.content;this._eventMessage.emit(i)}async _sendDebugMessage(e){var t;const n=(t=this.connection)===null||t===void 0?void 0:t.kernel;if(!n){return Promise.reject(new Error("A kernel is required to send debug messages."))}const i=new q.PromiseDelegate;const s=n.requestDebug(e);s.onReply=e=>{i.resolve(e)};await s.done;return i.promise}}var X=n(44914);var Q=n.n(X);class Z extends i.ReactWidget{constructor(e){super();this._model=e;this.addClass("jp-DebuggerBreakpoints-body")}render(){return Q().createElement(ee,{model:this._model})}}const ee=({model:e})=>{const[t,n]=(0,X.useState)(Array.from(e.breakpoints.entries()));(0,X.useEffect)((()=>{const t=(t,i)=>{n(Array.from(e.breakpoints.entries()))};const i=t=>{n(Array.from(e.breakpoints.entries()))};e.changed.connect(t);e.restored.connect(i);return()=>{e.changed.disconnect(t);e.restored.disconnect(i)}}));return Q().createElement(Q().Fragment,null,t.map((t=>Q().createElement(te,{key:t[0],breakpoints:t[1],model:e}))))};const te=({breakpoints:e,model:t})=>Q().createElement(Q().Fragment,null,e.sort(((e,t)=>{var n,i;return((n=e.line)!==null&&n!==void 0?n:0)-((i=t.line)!==null&&i!==void 0?i:0)})).map(((e,n)=>{var i,s;return Q().createElement(ne,{key:((s=(i=e.source)===null||i===void 0?void 0:i.path)!==null&&s!==void 0?s:"")+n,breakpoint:e,model:t})})));const ne=({breakpoint:e,model:t})=>{var n,i,s;const o=e=>e[0]==="/"?e.slice(1)+"/":e;return Q().createElement("div",{className:"jp-DebuggerBreakpoint",onClick:()=>t.clicked.emit(e),title:(n=e.source)===null||n===void 0?void 0:n.path},Q().createElement("span",{className:"jp-DebuggerBreakpoint-marker"},"●"),Q().createElement("span",{className:"jp-DebuggerBreakpoint-source jp-left-truncated"},o((s=(i=e.source)===null||i===void 0?void 0:i.path)!==null&&s!==void 0?s:"")),Q().createElement("span",{className:"jp-DebuggerBreakpoint-line"},e.line))};const ie="jp-debugger-pauseOnExceptions";const se="jp-PauseOnExceptions";const oe="jp-PauseOnExceptions-menu";class re extends i.ToolbarButton{constructor(e){super();this.onclick=()=>{this._menu.open(this.node.getBoundingClientRect().left,this.node.getBoundingClientRect().bottom)};this._menu=new ae({service:e.service,commands:{registry:e.commands.registry,pauseOnExceptions:e.commands.pauseOnExceptions}});this.node.className=ie;this._props=e;this._props.className=se;this._props.service.eventMessage.connect(((e,t)=>{if(t.event==="initialized"||t.event==="terminated"){this.onChange()}}),this);this._props.enabled=this._props.service.pauseOnExceptionsIsValid();this._props.service.pauseOnExceptionChanged.connect(this.onChange,this)}onChange(){var e;const t=this._props.service.session;const n=t===null||t===void 0?void 0:t.exceptionBreakpointFilters;this._props.className=se;if(((e=this._props.service.session)===null||e===void 0?void 0:e.isStarted)&&n){this._props.pressed=t.isPausingOnException();this._props.enabled=true}else{this._props.enabled=false}this.update()}render(){return X.createElement(i.ToolbarButtonComponent,{...this._props,onClick:this.onclick})}}class ae extends i.MenuSvg{constructor(e){super({commands:e.commands.registry});this._service=e.service;this._command=e.commands.pauseOnExceptions;e.service.eventMessage.connect(((e,t)=>{if(t.event==="initialized"){this._build()}}),this);this._build();this.addClass(oe)}_build(){var e,t;this.clearItems();const n=(t=(e=this._service.session)===null||e===void 0?void 0:e.exceptionBreakpointFilters)!==null&&t!==void 0?t:[];n.map(((e,t)=>{this.addItem({command:this._command,args:{filter:e.filter,description:e.description}})}))}}class le extends i.PanelWithToolbar{constructor(e){var t;super(e);this.clicked=new _.Signal(this);const{model:n,service:s,commands:o}=e;const r=((t=e.translator)!==null&&t!==void 0?t:f.nullTranslator).load("jupyterlab");this.title.label=r.__("Breakpoints");const a=new Z(n);this.toolbar.node.setAttribute("aria-label",r.__("Breakpoints panel toolbar"));this.toolbar.addItem("pauseOnException",new re({service:s,commands:o,icon:i.exceptionsIcon,tooltip:r.__("Pause on exception filter")}));this.toolbar.addItem("closeAll",new i.ToolbarButton({icon:i.closeAllIcon,onClick:async()=>{if(n.breakpoints.size===0){return}const e=await(0,l.showDialog)({title:r.__("Remove All Breakpoints"),body:r.__("Are you sure you want to remove all breakpoints?"),buttons:[l.Dialog.okButton({label:r.__("Remove breakpoints")}),l.Dialog.cancelButton()],hasClose:true});if(e.button.accept){return s.clearBreakpoints()}},tooltip:r.__("Remove All Breakpoints")}));this.addWidget(a);this.addClass("jp-DebuggerBreakpoints")}}class de extends i.ReactWidget{constructor(e){super();this._model=e;this.addClass("jp-DebuggerCallstack-body")}render(){return Q().createElement(ce,{model:this._model})}}const ce=({model:e})=>{const[t,n]=(0,X.useState)(e.frames);const[i,s]=(0,X.useState)(e.frame);const o=t=>{s(t);e.frame=t};(0,X.useEffect)((()=>{const t=()=>{s(e.frame);n(e.frames)};e.framesChanged.connect(t);return()=>{e.framesChanged.disconnect(t)}}),[e]);const r=e=>{var t;const n=((t=e.source)===null||t===void 0?void 0:t.path)||"";const i=b.PathExt.basename(b.PathExt.dirname(n));const s=b.PathExt.basename(n);const o=b.PathExt.join(i,s);return`${o}:${e.line}`};return Q().createElement("ul",null,t.map((e=>{var t;return Q().createElement("li",{key:e.id,onClick:()=>o(e),className:(i===null||i===void 0?void 0:i.id)===e.id?"selected jp-DebuggerCallstackFrame":"jp-DebuggerCallstackFrame"},Q().createElement("span",{className:"jp-DebuggerCallstackFrame-name"},e.name),Q().createElement("span",{className:"jp-DebuggerCallstackFrame-location",title:(t=e.source)===null||t===void 0?void 0:t.path},r(e)))})))};class he extends i.PanelWithToolbar{constructor(e){var t;super(e);const{commands:n,model:s}=e;const o=((t=e.translator)!==null&&t!==void 0?t:f.nullTranslator).load("jupyterlab");this.title.label=o.__("Callstack");const r=new de(s);this.toolbar.node.setAttribute("aria-label",o.__("Callstack panel toolbar"));this.toolbar.addItem("continue",new i.CommandToolbarButton({commands:n.registry,id:n.continue,label:""}));this.toolbar.addItem("terminate",new i.CommandToolbarButton({commands:n.registry,id:n.terminate,label:""}));this.toolbar.addItem("step-over",new i.CommandToolbarButton({commands:n.registry,id:n.next,label:""}));this.toolbar.addItem("step-in",new i.CommandToolbarButton({commands:n.registry,id:n.stepIn,label:""}));this.toolbar.addItem("step-out",new i.CommandToolbarButton({commands:n.registry,id:n.stepOut,label:""}));this.toolbar.addItem("evaluate",new i.CommandToolbarButton({commands:n.registry,id:n.evaluate,label:""}));this.addWidget(r);this.addClass("jp-DebuggerCallstack")}}class ue extends c.Widget{constructor(e){super();this._model=e.model;this._debuggerService=e.service;this._mimeTypeService=e.editorServices.mimeTypeService;const t=new Re.ReadOnlyEditorFactory({editorServices:e.editorServices});this._editor=t.createNewEditor({content:"",mimeType:"",path:""});this._editor.hide();this._model.currentFrameChanged.connect((async(e,t)=>{if(!t){this._clearEditor();return}void this._showSource(t)}));const n=new c.PanelLayout;n.addWidget(this._editor);this.layout=n;this.addClass("jp-DebuggerSources-body")}dispose(){var e;if(this.isDisposed){return}(e=this._editorHandler)===null||e===void 0?void 0:e.dispose();_.Signal.clearData(this);super.dispose()}_clearEditor(){this._model.currentSource=null;this._editor.hide()}async _showSource(e){var t;const n=(t=e.source)===null||t===void 0?void 0:t.path;const i=await this._debuggerService.getSource({sourceReference:0,path:n});if(!(i===null||i===void 0?void 0:i.content)){this._clearEditor();return}if(this._editorHandler){this._editorHandler.dispose()}const{content:s,mimeType:o}=i;const r=o||this._mimeTypeService.getMimeTypeByFilePath(n!==null&&n!==void 0?n:"");this._editor.model.sharedModel.setSource(s);this._editor.model.mimeType=r;this._editorHandler=new S({debuggerService:this._debuggerService,editorReady:()=>Promise.resolve(this._editor.editor),getEditor:()=>this._editor.editor,path:n,src:this._editor.model.sharedModel});this._model.currentSource={content:s,mimeType:r,path:n!==null&&n!==void 0?n:""};requestAnimationFrame((()=>{S.showCurrentLine(this._editor.editor,e.line)}));this._editor.show()}}const pe=({model:e,trans:t})=>Q().createElement(i.UseSignal,{signal:e.currentSourceChanged,initialSender:e},(e=>{var n,i;return Q().createElement("span",{onClick:t=>{if(t.ctrlKey){e===null||e===void 0?void 0:e.open()}},title:t.__("Ctrl + click to open in the Main Area"),className:"jp-DebuggerSources-header-path"},(i=(n=e===null||e===void 0?void 0:e.currentSource)===null||n===void 0?void 0:n.path)!==null&&i!==void 0?i:"")}));class me extends i.PanelWithToolbar{constructor(e){var t;super();const{model:n,service:s,editorServices:o}=e;const r=((t=e.translator)!==null&&t!==void 0?t:f.nullTranslator).load("jupyterlab");this.title.label=r.__("Source");this.toolbar.addClass("jp-DebuggerSources-header");this.toolbar.node.setAttribute("aria-label",r.__("Sources preview panel toolbar"));const a=new ue({service:s,model:n,editorServices:o});this.toolbar.addItem("open",new i.ToolbarButton({icon:i.viewBreakpointIcon,onClick:()=>n.open(),tooltip:r.__("Open in the Main Area")}));const l=i.ReactWidget.create(Q().createElement(pe,{model:n,trans:r}));this.toolbar.addItem("sourcePath",l);this.addClass("jp-DebuggerSources-header");this.addWidget(a);this.addClass("jp-DebuggerSources")}}var ge=n(54158);const fe=e=>{const t=t=>{const n=t.target.value;e.model.filter=n};return Q().createElement(ge.Search,{onChange:t,placeholder:e.trans.__("Filter the kernel sources"),value:e.model.filter})};const ve=e=>Q().createElement(i.UseSignal,{signal:e.model.filterChanged,initialArgs:e.model.filter},(t=>Q().createElement(fe,{model:e.model,trans:e.trans})));const _e="jp-DebuggerKernelSource-filterBox";const be="jp-DebuggerKernelSource-filterBox-hidden";const ye="jp-DebuggerKernelSource-source";class we extends i.ReactWidget{constructor(e){var t;super();this._showFilter=false;this._model=e.model;this._debuggerService=e.service;this._trans=((t=e.translator)!==null&&t!==void 0?t:f.nullTranslator).load("jupyterlab");this.addClass("jp-DebuggerKernelSources-body")}render(){let e=_e;if(!this._showFilter){e+=" "+be}return Q().createElement(Q().Fragment,null,Q().createElement("div",{className:e,key:"filter"},Q().createElement(ve,{model:this._model,trans:this._trans})),Q().createElement(i.UseSignal,{signal:this._model.changed},((e,t)=>{const n={};return(t!==null&&t!==void 0?t:[]).map((e=>{var t;const s=e.name;const o=e.path;const r=s+(n[s]=((t=n[s])!==null&&t!==void 0?t:0)+1).toString();return Q().createElement("div",{key:r,title:o,className:ye,onClick:()=>{this._debuggerService.getSource({sourceReference:0,path:o}).then((e=>{this._model.open(e)})).catch((e=>{void(0,l.showErrorMessage)(this._trans.__("Fail to get source"),this._trans.__("Fail to get '%1' source:\n%2",o,e))}))}},Q().createElement(i.LabIcon.resolveReact,{icon:i.openKernelSourceIcon,iconClass:(0,i.classes)("jp-Icon"),tag:null}),s)}))})))}toggleFilterbox(){this._showFilter=!this._showFilter;this.update()}}class Ce extends i.PanelWithToolbar{constructor(e){var t;super();const{model:n,service:s}=e;this._model=n;const o=((t=e.translator)!==null&&t!==void 0?t:f.nullTranslator).load("jupyterlab");this.title.label=o.__("Kernel Sources");this.toolbar.addClass("jp-DebuggerKernelSources-header");this.toolbar.node.setAttribute("aria-label",o.__("Kernel sources panel toolbar"));this._body=new we({service:s,model:n,translator:e.translator});this.toolbar.addItem("open-filter",new i.ToolbarButton({icon:i.searchIcon,onClick:async()=>{this._body.toggleFilterbox()},tooltip:o.__("Toggle search filter")}));this.toolbar.addItem("refresh",new i.ToolbarButton({icon:i.refreshIcon,onClick:()=>{this._model.kernelSources=[];void s.displayModules().catch((e=>{void(0,l.showErrorMessage)(o.__("Fail to get kernel sources"),o.__("Fail to get kernel sources:\n%2",e))}))},tooltip:o.__("Refresh kernel sources")}));this.addClass("jp-DebuggerKernelSources-header");this.addWidget(this._body);this.addClass("jp-DebuggerKenelSources")}set filter(e){this._model.filter=e}}const xe=({model:e,tree:t,grid:n,trans:s})=>{const[o,r]=(0,X.useState)("-");const a=e.scopes;const l=e=>{const i=e.target.value;r(i);t.scope=i;n.scope=i};return Q().createElement(i.HTMLSelect,{onChange:l,value:o,"aria-label":s.__("Scope")},a.map((e=>Q().createElement("option",{key:e.name,value:e.name},s.__(e.name)))))};class Se extends i.ReactWidget{constructor(e){super();const{translator:t,model:n,tree:i,grid:s}=e;this._model=n;this._tree=i;this._grid=s;this._trans=(t||f.nullTranslator).load("jupyterlab")}render(){return Q().createElement(i.UseSignal,{signal:this._model.changed,initialSender:this._model},(()=>Q().createElement(xe,{model:this._model,trans:this._trans,tree:this._tree,grid:this._grid})))}}var ke=n(34236);class je extends i.ReactWidget{constructor(e){super();this._scope="";this._scopes=[];this._filter=new Set;this._commands=e.commands;this._service=e.service;this._translator=e.translator;const t=this.model=e.model;t.changed.connect(this._updateScopes,this);this.addClass("jp-DebuggerVariables-body")}render(){var e;const t=(e=this._scopes.find((e=>e.name===this._scope)))!==null&&e!==void 0?e:this._scopes[0];const n=e=>{this.model.selectedVariable=e};if((t===null||t===void 0?void 0:t.name)!=="Globals"){this.addClass("jp-debuggerVariables-local")}else{this.removeClass("jp-debuggerVariables-local")}return t?Q().createElement(Q().Fragment,null,Q().createElement(ge.TreeView,{className:"jp-TreeView"},Q().createElement(Ie,{key:t.name,commands:this._commands,service:this._service,data:t.variables,filter:this._filter,translator:this._translator,handleSelectVariable:n}))):Q().createElement("div",null)}set filter(e){this._filter=e;this.update()}set scope(e){this._scope=e;this.update()}_updateScopes(e){if(ke.ArrayExt.shallowEqual(this._scopes,e.scopes)){return}this._scopes=e.scopes;this.update()}}const Ie=e=>{const{commands:t,data:n,service:i,filter:s,translator:o,handleSelectVariable:r}=e;const[a,l]=(0,X.useState)(n);(0,X.useEffect)((()=>{l(n)}),[n]);return Q().createElement(Q().Fragment,null,a.filter((e=>!(s||new Set).has(e.evaluateName||""))).map((e=>{const n=`${e.name}-${e.evaluateName}-${e.type}-${e.value}-${e.variablesReference}`;return Q().createElement(Te,{key:n,commands:t,data:e,service:i,filter:s,translator:o,onSelect:r})})))};function Ee(e){if(e.type==="float"&&(e.value=="inf"||e.value=="-inf")){return e.value}const t=De(e);if(e.type==="float"&&isNaN(t)){return"NaN"}return t}const Te=e=>{var t,n;const{commands:s,data:o,service:r,filter:a,translator:l,onSelect:d}=e;const[c]=(0,X.useState)(o);const[h,u]=(0,X.useState)(false);const[p,m]=(0,X.useState)(false);const[g,v]=(0,X.useState)(null);const _=(0,X.useMemo)((()=>(l!==null&&l!==void 0?l:f.nullTranslator).load("jupyterlab")),[l]);const b=d!==null&&d!==void 0?d:()=>void 0;const y=(0,X.useMemo)((()=>c.variablesReference!==0||c.type==="function"),[c.variablesReference,c.type]);const w=(0,X.useMemo)((()=>Ee(c)),[c]);const C=(0,X.useMemo)((()=>!["special variables","protected variables","function variables","class variables"].includes(c.name)),[c.name]);const x=(0,X.useMemo)((()=>{var e;return!r.model.hasRichVariableRendering||!s.isEnabled(Re.CommandIDs.renderMimeVariable,{name:c.name,frameID:(e=r.model.callstack.frame)===null||e===void 0?void 0:e.id})}),[r.model.hasRichVariableRendering,c.name,(t=r.model.callstack.frame)===null||t===void 0?void 0:t.id]);const S=(0,X.useCallback)((async()=>{if(y&&!g){v(await r.inspectVariable(c.variablesReference))}}),[y,r,c.variablesReference,g]);const k=(0,X.useCallback)((async e=>{const t=(0,i.getTreeItemElement)(e.target);if(e.currentTarget!==t){return}if(!y){return}m(!p)}),[y,p]);const j=(0,X.useCallback)((e=>{if(e.currentTarget===e.detail&&e.detail.selected){b(c)}}),[c]);const I=(0,X.useCallback)((()=>{var e;s.execute(Re.CommandIDs.renderMimeVariable,{name:c.name,frameID:(e=r.model.callstack.frame)===null||e===void 0?void 0:e.id}).catch((e=>{console.error(`Failed to render variable ${c===null||c===void 0?void 0:c.name}`,e)}))}),[s,c.name,(n=r.model.callstack.frame)===null||n===void 0?void 0:n.id]);const E=(0,X.useCallback)((e=>{const t=(0,i.getTreeItemElement)(e.target);if(e.currentTarget!==t){return}b(c)}),[c]);return Q().createElement(ge.TreeItem,{className:"jp-TreeItem nested",expanded:p,onSelect:j,onExpand:S,onClick:e=>k(e),onContextMenu:E,onKeyDown:e=>{if(e.key=="Enter"){if(C&&h){b(c);I()}}},onFocus:e=>{u(!e.defaultPrevented);e.preventDefault()},onBlur:e=>{u(false)},onMouseOver:e=>{u(!e.defaultPrevented);e.preventDefault()},onMouseLeave:e=>{u(false)}},Q().createElement("span",{className:"jp-DebuggerVariables-name"},c.name),w&&Q().createElement("span",{className:"jp-DebuggerVariables-detail"},w),C&&h&&Q().createElement(ge.Button,{className:"jp-DebuggerVariables-renderVariable",appearance:"stealth",slot:"end",disabled:x,onClick:e=>{e.stopPropagation();I()},title:_.__("Render variable: %1",c===null||c===void 0?void 0:c.name)},Q().createElement(i.searchIcon.react,{tag:null})),g?Q().createElement(Ie,{key:c.name,commands:s,data:g,service:r,filter:a,translator:l,handleSelectVariable:d}):y&&Q().createElement(ge.TreeItem,null))};class Me extends i.PanelWithToolbar{constructor(e){super(e);const{model:t,service:n,commands:s,themeManager:o}=e;const r=e.translator||f.nullTranslator;const a=r.load("jupyterlab");this.title.label=a.__("Variables");this.toolbar.addClass("jp-DebuggerVariables-toolbar");this.toolbar.node.setAttribute("aria-label",a.__("Variables toolbar"));this._tree=new je({model:t,service:n,commands:s,translator:r});this._table=new V({model:t,commands:s,themeManager:o,translator:r});this._table.hide();this.toolbar.addItem("scope-switcher",new Se({translator:r,model:t,tree:this._tree,grid:this._table}));const l=()=>{if(this._table.isHidden){this._tree.hide();this._table.show();this.node.setAttribute("data-jp-table","true");h("table")}else{this._tree.show();this._table.hide();this.node.removeAttribute("data-jp-table");h("tree")}this.update()};const d=new i.ToolbarButton({icon:i.treeViewIcon,className:"jp-TreeView-Button",onClick:l,tooltip:a.__("Tree View")});const c=new i.ToolbarButton({icon:i.tableRowsIcon,className:"jp-TableView-Button",onClick:l,tooltip:a.__("Table View")});const h=e=>{c.pressed=e!=="tree";d.pressed=!c.pressed};h(this._table.isHidden?"tree":"table");this.toolbar.addItem("view-VariableTreeView",d);this.toolbar.addItem("view-VariableTableView",c);this.addWidget(this._tree);this.addWidget(this._table);this.addClass("jp-DebuggerVariables")}set filter(e){this._tree.filter=e;this._table.filter=e}onResize(e){super.onResize(e);this._resizeBody(e)}_resizeBody(e){const t=e.height-this.toolbar.node.offsetHeight;this._tree.node.style.height=`${t}px`}}const De=e=>{var t,n;const{type:i,value:s}=e;switch(i){case"int":return parseInt(s,10);case"float":return parseFloat(s);case"bool":return s;case"str":if((n=(t=e.presentationHint)===null||t===void 0?void 0:t.attributes)===null||n===void 0?void 0:n.includes("rawString")){return s.slice(1,s.length-1)}else{return s}default:return i!==null&&i!==void 0?i:s}};class Ae extends i.SidePanel{constructor(e){const t=e.translator||f.nullTranslator;super({translator:t});this.id="jp-debugger-sidebar";this.title.icon=i.bugIcon;this.addClass("jp-DebuggerSidebar");const{callstackCommands:n,breakpointsCommands:s,editorServices:o,service:r,themeManager:a}=e;const l=r.model;this.variables=new Me({model:l.variables,commands:n.registry,service:r,themeManager:a,translator:t});this.callstack=new he({commands:n,model:l.callstack,translator:t});this.breakpoints=new le({service:r,commands:s,model:l.breakpoints,translator:t});this.sources=new me({model:l.sources,service:r,editorServices:o,translator:t});this.kernelSources=new Ce({model:l.kernelSources,service:r,translator:t});const d=new Ae.Header;this.header.addWidget(d);l.titleChanged.connect(((e,t)=>{d.title.label=t}));this.content.addClass("jp-DebuggerSidebar-body");this.addWidget(this.variables);this.addWidget(this.callstack);this.addWidget(this.breakpoints);this.addWidget(this.sources);this.addWidget(this.kernelSources)}}(function(e){class t extends c.Widget{constructor(){super({node:Pe.createHeader()});this.title.changed.connect((e=>{this.node.textContent=this.title.label}))}}e.Header=t})(Ae||(Ae={}));var Pe;(function(e){function t(){const e=document.createElement("h2");e.textContent="-";e.classList.add("jp-text-truncated");return e}e.createHeader=t})(Pe||(Pe={}));class Le{constructor(e){var t,n,i;this._config=e.config;this._shell=e.shell;this._notebookTracker=(t=e.notebookTracker)!==null&&t!==void 0?t:null;this._consoleTracker=(n=e.consoleTracker)!==null&&n!==void 0?n:null;this._editorTracker=(i=e.editorTracker)!==null&&i!==void 0?i:null;this._readOnlyEditorTracker=new l.WidgetTracker({namespace:"@jupyterlab/debugger"})}find(e){return[...this._findInConsoles(e),...this._findInEditors(e),...this._findInNotebooks(e),...this._findInReadOnlyEditors(e)]}open(e){const{editorWrapper:t,label:n,caption:s}=e;const o=new l.MainAreaWidget({content:t});o.id=l.DOMUtils.createDomID();o.title.label=n;o.title.closable=true;o.title.caption=s;o.title.icon=i.textEditorIcon;this._shell.add(o,"main",{type:"Debugger Sources"});void this._readOnlyEditorTracker.add(o)}_findInNotebooks(e){if(!this._notebookTracker){return[]}const{focus:t,kernel:n,path:i,source:s}=e;const o=[];this._notebookTracker.forEach((e=>{const r=e.sessionContext;if(i!==r.path){return}const a=e.content;if(t){a.mode="command"}const l=e.content.widgets;l.forEach(((i,r)=>{const l=i.model.sharedModel.getSource();const d=this._getCodeId(l,n);if(!d){return}if(s!==d){return}if(t){a.activeCellIndex=r;if(a.activeCell){a.scrollToItem(a.activeCellIndex,"smart").catch((e=>{}))}this._shell.activateById(e.id)}o.push(Object.freeze({get:()=>i.editor,reveal:()=>a.scrollToItem(r,"smart"),src:i.model.sharedModel}))}))}));return o}_findInConsoles(e){if(!this._consoleTracker){return[]}const{focus:t,kernel:n,path:i,source:s}=e;const o=[];this._consoleTracker.forEach((e=>{const r=e.sessionContext;if(i!==r.path){return}const a=e.console.cells;for(const i of a){const r=i.model.sharedModel.getSource();const a=this._getCodeId(r,n);if(!a){break}if(s!==a){break}o.push(Object.freeze({get:()=>i.editor,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:i.model.sharedModel}));if(t){this._shell.activateById(e.id)}}}));return o}_findInEditors(e){if(!this._editorTracker){return[]}const{focus:t,kernel:n,path:i,source:s}=e;const o=[];this._editorTracker.forEach((e=>{const r=e.content;if(i!==r.context.path){return}const a=r.editor;if(!a){return}const l=a.model.sharedModel.getSource();const d=this._getCodeId(l,n);if(!d){return}if(s!==d){return}o.push(Object.freeze({get:()=>a,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:r.model.sharedModel}));if(t){this._shell.activateById(e.id)}}));return o}_findInReadOnlyEditors(e){const{focus:t,kernel:n,source:i}=e;const s=[];this._readOnlyEditorTracker.forEach((e=>{var o;const r=(o=e.content)===null||o===void 0?void 0:o.editor;if(!r){return}const a=r.model.sharedModel.getSource();const l=this._getCodeId(a,n);if(!l){return}if(e.title.caption!==i&&i!==l){return}s.push(Object.freeze({get:()=>r,reveal:()=>Promise.resolve(this._shell.activateById(e.id)),src:r.model.sharedModel}));if(t){this._shell.activateById(e.id)}}));return s}_getCodeId(e,t){try{return this._config.getCodeId(e,t)}catch(n){return""}}}var Re;(function(e){class t extends a{}e.Config=t;class n extends S{}e.EditorHandler=n;class s extends A{}e.Handler=s;class o extends W{}e.Model=o;class r extends g{}e.ReadOnlyEditorFactory=r;class l extends G{}e.Service=l;class d extends Y{}e.Session=d;class c extends Ae{}e.Sidebar=c;class u extends Le{}e.Sources=u;class p extends V{}e.VariablesGrid=p;class m extends J{}e.VariableRenderer=m;let f;(function(e){e.debugContinue="debugger:continue";e.terminate="debugger:terminate";e.next="debugger:next";e.showPanel="debugger:show-panel";e.stepIn="debugger:stepIn";e.stepOut="debugger:stepOut";e.inspectVariable="debugger:inspect-variable";e.renderMimeVariable="debugger:render-mime-variable";e.evaluate="debugger:evaluate";e.restartDebug="debugger:restart-debug";e.pauseOnExceptions="debugger:pause-on-exceptions";e.copyToClipboard="debugger:copy-to-clipboard";e.copyToGlobals="debugger:copy-to-globals";e.openSource="debugger:open-source"})(f=e.CommandIDs||(e.CommandIDs={}));let v;(function(e){e.closeAllIcon=i.closeAllIcon;e.evaluateIcon=i.codeIcon;e.continueIcon=i.runIcon;e.pauseIcon=i.pauseIcon;e.stepIntoIcon=i.stepIntoIcon;e.stepOutIcon=i.stepOutIcon;e.stepOverIcon=i.stepOverIcon;e.terminateIcon=i.stopIcon;e.variableIcon=i.variableIcon;e.viewBreakpointIcon=i.viewBreakpointIcon;e.pauseOnExceptionsIcon=i.pauseIcon})(v=e.Icons||(e.Icons={}));let _;(function(e){e.getCode=h.getCode})(_=e.Dialogs||(e.Dialogs={}))})(Re||(Re={}))},85995:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Debugger:()=>i.s,IDebugger:()=>o,IDebuggerConfig:()=>r,IDebuggerHandler:()=>d,IDebuggerSidebar:()=>l,IDebuggerSourceViewer:()=>c,IDebuggerSources:()=>a});var i=n(35086);var s=n(5592);const o=new s.Token("@jupyterlab/debugger:IDebugger","A debugger user interface.");const r=new s.Token("@jupyterlab/debugger:IDebuggerConfig","A service to handle the debugger configuration.");const a=new s.Token("@jupyterlab/debugger:IDebuggerSources","A service to display sources in debug mode.");const l=new s.Token("@jupyterlab/debugger:IDebuggerSidebar","A service for the debugger sidebar.");const d=new s.Token("@jupyterlab/debugger:IDebuggerHandler","A service for handling notebook debugger.");const c=new s.Token("@jupyterlab/debugger:IDebuggerSourceViewer","A debugger source viewer.")},5011:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Grid:()=>u,GridModel:()=>p});var i=n(28426);var s=n.n(i);var o=n(2336);var r=n.n(o);var a=n(1143);var l=n.n(a);var d=n(61927);var c=n.n(d);var h=n(35086);class u extends a.Panel{constructor(e){super();const{commands:t,model:n,themeManager:s}=e;this.model=n;const o=new p(e.translator);const r=new i.DataGrid;const a=new m.MouseHandler;a.doubleClicked.connect(((e,n)=>t.execute(h.s.CommandIDs.inspectVariable,{variableReference:o.getVariableReference(n.row),name:o.getVariableName(n.row)})));a.selected.connect(((e,t)=>{const{row:n}=t;this.model.selectedVariable={name:o.getVariableName(n),value:o.data("body",n,1),type:o.data("body",n,2),variablesReference:o.getVariableReference(n)}}));r.dataModel=o;r.keyHandler=new i.BasicKeyHandler;r.mouseHandler=a;r.selectionModel=new i.BasicSelectionModel({dataModel:o});r.stretchLastColumn=true;r.node.style.height="100%";this._grid=r;if(s){s.themeChanged.connect(this._updateStyles,this)}this.addWidget(r)}set filter(e){this._grid.dataModel.filter=e;this.update()}set scope(e){this._grid.dataModel.scope=e;this.update()}get dataModel(){return this._grid.dataModel}onAfterAttach(e){super.onAfterAttach(e);this._updateStyles()}_updateStyles(){const{style:e,textRenderer:t}=m.computeStyle();this._grid.cellRenderers.update({},t);this._grid.style=e}}class p extends i.DataModel{constructor(e){super();this._filter=new Set;this._scope="";this._data={name:[],type:[],value:[],variablesReference:[]};this._trans=(e||d.nullTranslator).load("jupyterlab")}get filter(){return this._filter}set filter(e){this._filter=e}get scope(){return this._scope}set scope(e){this._scope=e}rowCount(e){return e==="body"?this._data.name.length:1}columnCount(e){return e==="body"?2:1}data(e,t,n){if(e==="row-header"){return this._data.name[t]}if(e==="column-header"){return n===1?this._trans.__("Value"):this._trans.__("Type")}if(e==="corner-header"){return this._trans.__("Name")}return n===1?this._data.value[t]:this._data.type[t]}getVariableReference(e){return this._data.variablesReference[e]}getVariableName(e){return this._data.name[e]}setData(e){var t,n;this._clearData();this.emitChanged({type:"model-reset"});const i=(t=e.find((e=>e.name===this._scope)))!==null&&t!==void 0?t:e[0];const s=(n=i===null||i===void 0?void 0:i.variables)!==null&&n!==void 0?n:[];const o=s.filter((e=>e.name&&!this._filter.has(e.name)));o.forEach(((e,t)=>{var n;this._data.name[t]=e.name;this._data.type[t]=(n=e.type)!==null&&n!==void 0?n:"";this._data.value[t]=e.value;this._data.variablesReference[t]=e.variablesReference}));this.emitChanged({type:"rows-inserted",region:"body",index:1,span:o.length})}_clearData(){this._data={name:[],type:[],value:[],variablesReference:[]}}}var m;(function(e){function t(){const e=document.createElement("div");e.className="jp-DebuggerVariables-colorPalette";e.innerHTML=`\n \n \n \n \n \n \n \n `;return e}function n(){const e=t();document.body.appendChild(e);let n;n=e.querySelector(".jp-mod-void");const s=getComputedStyle(n).color;n=e.querySelector(".jp-mod-background");const o=getComputedStyle(n).color;n=e.querySelector(".jp-mod-header-background");const r=getComputedStyle(n).color;n=e.querySelector(".jp-mod-grid-line");const a=getComputedStyle(n).color;n=e.querySelector(".jp-mod-header-grid-line");const l=getComputedStyle(n).color;n=e.querySelector(".jp-mod-selection");const d=getComputedStyle(n).color;n=e.querySelector(".jp-mod-text");const c=getComputedStyle(n).color;document.body.removeChild(e);return{style:{voidColor:s,backgroundColor:o,headerBackgroundColor:r,gridLineColor:a,headerGridLineColor:l,rowBackgroundColor:e=>e%2===0?s:o,selectionFillColor:d},textRenderer:new i.TextRenderer({font:"12px sans-serif",textColor:c,backgroundColor:"",verticalAlignment:"center",horizontalAlignment:"left"})}}e.computeStyle=n;class s extends i.BasicMouseHandler{constructor(){super(...arguments);this._doubleClicked=new o.Signal(this);this._selected=new o.Signal(this)}get doubleClicked(){return this._doubleClicked}get selected(){return this._selected}dispose(){if(this.isDisposed){return}o.Signal.disconnectSender(this);super.dispose()}onMouseDoubleClick(e,t){const n=e.hitTest(t.clientX,t.clientY);this._doubleClicked.emit(n)}onMouseDown(e,t){let{clientX:n,clientY:i}=t;let s=e.hitTest(n,i);this._selected.emit(s);super.onMouseDown(e,t)}onContextMenu(e,t){let{clientX:n,clientY:i}=t;let s=e.hitTest(n,i);this._selected.emit(s)}}e.MouseHandler=s})(m||(m={}))},82372:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ToolbarItems:()=>A,default:()=>D,downloadPlugin:()=>E,openBrowserTabPlugin:()=>T,pathStatusPlugin:()=>I,savingStatusPlugin:()=>j});var i=n(74991);var s=n(72050);var o=n(37737);var r=n(65189);var a=n(15615);var l=n(66987);var d=n(61927);var c=n(66127);var h=n(34236);var u=n(5592);var p=n(2336);var m=n(1143);var g=n(44914);var f=n(86503);var v;(function(e){e.clearRecents="docmanager:clear-recents"})(v||(v={}));var _;(function(e){e.recentsManager="@jupyterlab/docmanager-extension:recents";e.reopenClosed="@jupyterlab/docmanager-extension:reopen-recently-closed";e.mainPlugin="@jupyterlab/docmanager-extension:plugin"})(_||(_={}));const b={id:_.recentsManager,description:"Provides a manager of recently opened and closed documents.",autoStart:true,requires:[f.IStateDB],optional:[a.ISettingRegistry,d.ITranslator],provides:r.IRecentsManager,activate:(e,t,n,i)=>{const{serviceManager:s}=e;const o=(i!==null&&i!==void 0?i:d.nullTranslator).load("jupyterlab");const a=new r.RecentsManager({stateDB:t,contents:s.contents});const l=e=>{a.maximalRecentsLength=e.get("maxNumberRecents").composite};if(n){void Promise.all([e.restored,n.load(_.mainPlugin)]).then((([e,t])=>{t.changed.connect(l);l(t)}))}e.commands.addCommand(v.clearRecents,{execute:()=>{a.clearRecents()},isEnabled:()=>a.recentlyOpened.length!=0||a.recentlyClosed.length!=0,label:o.__("Clear Recent Documents"),caption:o.__("Clear the list of recently opened items.")});return a}};var y;(function(e){e.clone="docmanager:clone";e.deleteFile="docmanager:delete-file";e.newUntitled="docmanager:new-untitled";e.open="docmanager:open";e.openBrowserTab="docmanager:open-browser-tab";e.reload="docmanager:reload";e.rename="docmanager:rename";e.del="docmanager:delete";e.duplicate="docmanager:duplicate";e.restoreCheckpoint="docmanager:restore-checkpoint";e.save="docmanager:save";e.saveAll="docmanager:save-all";e.saveAs="docmanager:save-as";e.download="docmanager:download";e.toggleAutosave="docmanager:toggle-autosave";e.showInFileBrowser="docmanager:show-in-file-browser"})(y||(y={}));const w="@jupyterlab/docmanager-extension:plugin";const C={id:"@jupyterlab/docmanager-extension:opener",description:"Provides the widget opener.",autoStart:true,provides:r.IDocumentWidgetOpener,activate:e=>{const{shell:t}=e;return new class{constructor(){this._opened=new p.Signal(this)}open(e,n){if(!e.id){e.id=`document-manager-${++B.id}`}e.title.dataset={type:"document-title",...e.title.dataset};if(!e.isAttached){t.add(e,"main",n||{})}t.activateById(e.id);this._opened.emit(e)}get opened(){return this._opened}}}};const x={id:"@jupyterlab/docmanager-extension:contexts",description:"Adds the handling of opened documents dirty state.",autoStart:true,requires:[r.IDocumentManager,r.IDocumentWidgetOpener],optional:[i.ILabStatus],activate:(e,t,n,i)=>{const s=new WeakSet;n.opened.connect(((e,n)=>{const o=t.contextForWidget(n);if(o&&!s.has(o)){if(i){O(i,o)}s.add(o)}}))}};const S={id:"@jupyterlab/docmanager-extension:manager",description:"Provides the document manager.",provides:r.IDocumentManager,requires:[r.IDocumentWidgetOpener],optional:[d.ITranslator,i.ILabStatus,s.ISessionContextDialogs,i.JupyterLab.IInfo,r.IRecentsManager],activate:(e,t,n,i,o,a,l)=>{var c;const{serviceManager:h,docRegistry:u}=e;const p=n!==null&&n!==void 0?n:d.nullTranslator;const m=o!==null&&o!==void 0?o:new s.SessionContextDialogs({translator:p});const g=e.restored.then((()=>void 0));const f=new r.DocumentManager({registry:u,manager:h,opener:t,when:g,setBusy:(c=i&&(()=>i.setBusy()))!==null&&c!==void 0?c:undefined,sessionDialogs:m,translator:p!==null&&p!==void 0?p:d.nullTranslator,isConnectedCallback:()=>{if(a){return a.isConnected}return true},recentsManager:l!==null&&l!==void 0?l:undefined});return f}};const k={id:w,description:"Adds commands and settings to the document manager.",autoStart:true,requires:[r.IDocumentManager,r.IDocumentWidgetOpener,a.ISettingRegistry],optional:[d.ITranslator,s.ICommandPalette,i.ILabShell],activate:(e,t,n,i,s,o,r)=>{s=s!==null&&s!==void 0?s:d.nullTranslator;const a=s.load("jupyterlab");const l=e.docRegistry;R(e,t,n,i,s,r,o);const c=n=>{const i=n.get("autosave").composite;t.autosave=i===true||i===false?i:true;e.commands.notifyCommandChanged(y.toggleAutosave);const s=n.get("confirmClosingDocument").composite;t.confirmClosingDocument=s!==null&&s!==void 0?s:true;const o=n.get("autosaveInterval").composite;t.autosaveInterval=o||120;const r=n.get("lastModifiedCheckMargin").composite;t.lastModifiedCheckMargin=r||500;const a=n.get("renameUntitledFileOnSave").composite;t.renameUntitledFileOnSave=a!==null&&a!==void 0?a:true;const d=n.get("defaultViewers").composite;const c={};Object.keys(d).forEach((e=>{if(!l.getFileType(e)){console.warn(`File Type ${e} not found`);return}if(!l.getWidgetFactory(d[e])){console.warn(`Document viewer ${d[e]} not found`)}c[e]=d[e]}));for(const e of l.fileTypes()){try{l.setDefaultWidgetFactory(e.name,c[e.name])}catch(h){console.warn(`Failed to set default viewer ${c[e.name]} for file type ${e.name}`)}}};Promise.all([i.load(w),e.restored]).then((([e])=>{e.changed.connect(c);c(e);const n=(t,n)=>{if(["autosave","autosaveInterval","confirmClosingDocument","lastModifiedCheckMargin","renameUntitledFileOnSave"].includes(n.name)&&e.get(n.name).composite!==n.newValue){e.set(n.name,n.newValue).catch((e=>{console.error(`Failed to set the setting '${n.name}':\n${e}`)}))}};t.stateChanged.connect(n)})).catch((e=>{console.error(e.message)}));i.transform(w,{fetch:e=>{const t=Array.from(l.fileTypes()).map((e=>e.name)).join(" \n");const n=Array.from(l.widgetFactories()).map((e=>e.name)).join(" \n");const i=a.__(`Overrides for the default viewers for file types.\nSpecify a mapping from file type name to document viewer name, for example:\n\ndefaultViewers: {\n markdown: "Markdown Preview"\n}\n\nIf you specify non-existent file types or viewers, or if a viewer cannot\nopen a given file type, the override will not function.\n\nAvailable viewers:\n%1\n\nAvailable file types:\n%2`,n,t);const s=u.JSONExt.deepCopy(e.schema);s.properties.defaultViewers.description=i;return{...e,schema:s}}});l.changed.connect((()=>i.load(w,true)))}};const j={id:"@jupyterlab/docmanager-extension:saving-status",description:"Adds a saving status indicator.",autoStart:true,requires:[r.IDocumentManager,i.ILabShell],optional:[d.ITranslator,l.IStatusBar],activate:(e,t,n,i,s)=>{if(!s){return}const o=new r.SavingStatus({docManager:t,translator:i!==null&&i!==void 0?i:d.nullTranslator});o.model.widget=n.currentWidget;n.currentChanged.connect((()=>{o.model.widget=n.currentWidget}));s.registerStatusItem(j.id,{item:o,align:"middle",isActive:()=>o.model!==null&&o.model.status!==null,activeStateChanged:o.model.stateChanged})}};const I={id:"@jupyterlab/docmanager-extension:path-status",description:"Adds a file path indicator in the status bar.",autoStart:true,requires:[r.IDocumentManager,i.ILabShell],optional:[l.IStatusBar],activate:(e,t,n,i)=>{if(!i){return}const s=new r.PathStatus({docManager:t});s.model.widget=n.currentWidget;n.currentChanged.connect((()=>{s.model.widget=n.currentWidget}));i.registerStatusItem(I.id,{item:s,align:"right",rank:0})}};const E={id:"@jupyterlab/docmanager-extension:download",description:"Adds command to download files.",autoStart:true,requires:[r.IDocumentManager],optional:[d.ITranslator,s.ICommandPalette],activate:(e,t,n,i)=>{var o;const r=(n!==null&&n!==void 0?n:d.nullTranslator).load("jupyterlab");const{commands:a,shell:l}=e;const c=()=>{const{currentWidget:e}=l;return!!(e&&t.contextForWidget(e))};a.addCommand(y.download,{label:r.__("Download"),caption:r.__("Download the file to your computer"),isEnabled:c,execute:()=>{if(c()){const e=t.contextForWidget(l.currentWidget);if(!e){return(0,s.showDialog)({title:r.__("Cannot Download"),body:r.__("No context found for current widget!"),buttons:[s.Dialog.okButton()]})}return e.download()}}});(o=e.shell.currentChanged)===null||o===void 0?void 0:o.connect((()=>{e.commands.notifyCommandChanged(y.download)}));const h=r.__("File Operations");if(i){i.addItem({command:y.download,category:h})}}};const T={id:"@jupyterlab/docmanager-extension:open-browser-tab",description:"Adds command to open a browser tab.",autoStart:true,requires:[r.IDocumentManager],optional:[d.ITranslator],activate:(e,t,n)=>{const i=(n!==null&&n!==void 0?n:d.nullTranslator).load("jupyterlab");const{commands:s}=e;s.addCommand(y.openBrowserTab,{execute:e=>{const n=typeof e["path"]==="undefined"?"":e["path"];if(!n){return}return t.services.contents.getDownloadUrl(n).then((e=>{const t=window.open();if(t){t.opener=null;t.location.href=e}else{throw new Error("Failed to open new browser tab.")}}))},iconClass:e=>e["icon"]||"",label:()=>i.__("Open in New Browser Tab")})}};const M=[S,k,x,I,j,E,T,C,b];const D=M;var A;(function(e){function t(e,t){return(0,s.addCommandToolbarButtonClass)(s.ReactWidget.create(g.createElement(s.UseSignal,{signal:t},(()=>g.createElement(s.CommandToolbarButtonComponent,{commands:e,id:y.save,label:"",args:{toolbar:true}})))))}e.createSaveButton=t})(A||(A={}));class P extends m.Widget{constructor(e,t,n="notebook"){super({node:B.createRevertConfirmNode(e,n,t)})}}function L(e,t){if(!e){return"File"}const n=t.contextForWidget(e);if(!n){return""}const i=t.registry.getFileTypesForPath(n.path);return i.length&&i[0].displayName?i[0].displayName:"File"}function R(e,t,n,i,r,a,l){var d;const u=r.load("jupyterlab");const{commands:p,shell:m}=e;const g=u.__("File Operations");const f=()=>{const{currentWidget:e}=m;return!!(e&&t.contextForWidget(e))};const v=()=>{var e;const{currentWidget:n}=m;if(!n){return false}const i=t.contextForWidget(n);return!!((e=i===null||i===void 0?void 0:i.contentsModel)===null||e===void 0?void 0:e.writable)};const _=e=>s.Notification.warning(u.__(`%1 is read-only. Use "Save as…" instead.`,e),{autoClose:5e3});if(a){N(e,t,a,n,r)}p.addCommand(y.deleteFile,{label:()=>`Delete ${L(m.currentWidget,t)}`,execute:e=>{const n=typeof e["path"]==="undefined"?"":e["path"];if(!n){const e=y.deleteFile;throw new Error(`A non-empty path is required for ${e}.`)}return t.deleteFile(n)}});p.addCommand(y.newUntitled,{execute:async e=>{const n=e["error"]||u.__("Error");const i=typeof e["path"]==="undefined"?"":e["path"];const o={type:e["type"],path:i};if(e["type"]==="file"){o.ext=e["ext"]||".txt"}return t.services.contents.newUntitled(o).catch((e=>(0,s.showErrorMessage)(n,e)))},label:e=>e["label"]||`New ${e["type"]}`});p.addCommand(y.open,{execute:async e=>{const n=typeof e["path"]==="undefined"?"":e["path"];const i=e["factory"]||void 0;const s=e===null||e===void 0?void 0:e.kernel;const o=e["options"]||void 0;return t.services.contents.get(n,{content:false}).then((()=>t.openOrReveal(n,i,s,o)))},iconClass:e=>e["icon"]||"",label:e=>{var t;return(t=e["label"]||e["factory"])!==null&&t!==void 0?t:u.__("Open the provided `path`.")},mnemonic:e=>e["mnemonic"]||-1});p.addCommand(y.reload,{label:()=>u.__("Reload %1 from Disk",L(m.currentWidget,t)),caption:u.__("Reload contents from disk"),isEnabled:f,execute:()=>{if(!f()){return}const e=t.contextForWidget(m.currentWidget);const n=L(m.currentWidget,t);if(!e){return(0,s.showDialog)({title:u.__("Cannot Reload"),body:u.__("No context found for current widget!"),buttons:[s.Dialog.okButton()]})}if(e.model.dirty){return(0,s.showDialog)({title:u.__("Reload %1 from Disk",n),body:u.__("Are you sure you want to reload the %1 from the disk?",n),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:u.__("Reload")})]}).then((t=>{if(t.button.accept&&!e.isDisposed){return e.revert()}}))}else{if(!e.isDisposed){return e.revert()}}}});p.addCommand(y.restoreCheckpoint,{label:()=>u.__("Revert %1 to Checkpoint…",L(m.currentWidget,t)),caption:u.__("Revert contents to previous checkpoint"),isEnabled:f,execute:()=>{if(!f()){return}const e=t.contextForWidget(m.currentWidget);if(!e){return(0,s.showDialog)({title:u.__("Cannot Revert"),body:u.__("No context found for current widget!"),buttons:[s.Dialog.okButton()]})}return e.listCheckpoints().then((async n=>{const i=L(m.currentWidget,t);if(n.length<1){await(0,s.showErrorMessage)(u.__("No checkpoints"),u.__("No checkpoints are available for this %1.",i));return}const o=n.length===1?n[0]:await B.getTargetCheckpoint(n.reverse(),u);if(!o){return}return(0,s.showDialog)({title:u.__("Revert %1 to checkpoint",i),body:new P(o,u,i),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:u.__("Revert"),ariaLabel:u.__("Revert to Checkpoint")})]}).then((t=>{if(e.isDisposed){return}if(t.button.accept){if(e.model.readOnly){return e.revert()}return e.restoreCheckpoint(o.id).then((()=>e.revert()))}}))}))}});const b=()=>{if(m.currentWidget){if(!v()){return u.__(`Document is read-only. "Save" is disabled; use "Save as…" instead`)}}return u.__("Save and create checkpoint")};const C=new WeakSet;p.addCommand(y.save,{label:()=>u.__("Save %1",L(m.currentWidget,t)),caption:b,icon:e=>e.toolbar?c.saveIcon:undefined,isEnabled:e=>{if(e._luminoEvent){return e._luminoEvent.type==="keybinding"?true:v()}else{return v()}},execute:async e=>{var n,r,a,l,d;const c=m.currentWidget;const h=t.contextForWidget(c);if(f()){if(!h){return(0,s.showDialog)({title:u.__("Cannot Save"),body:u.__("No context found for current widget!"),buttons:[s.Dialog.okButton()]})}else{if(C.has(h)){return}if(!((n=h.contentsModel)===null||n===void 0?void 0:n.writable)){let t=(r=e._luminoEvent)===null||r===void 0?void 0:r.type;if(e._luminoEvent&&t==="keybinding"){_(h.path);return}else{return(0,s.showDialog)({title:u.__("Cannot Save"),body:u.__("Document is read-only"),buttons:[s.Dialog.okButton()]})}}C.add(h);const m=o.PathExt.basename((l=(a=h.contentsModel)===null||a===void 0?void 0:a.path)!==null&&l!==void 0?l:"");let g=m;if(t.renameUntitledFileOnSave&&c.isUntitled===true){const e=await s.InputDialog.getText({title:u.__("Rename file"),okLabel:u.__("Rename and Save"),placeholder:u.__("File name"),text:m,selectionRange:m.length-o.PathExt.extname(m).length,checkbox:{label:u.__("Do not ask for rename on first save."),caption:u.__("If checked, you will not be asked to rename future untitled files when saving them.")}});if(e.button.accept){g=(d=e.value)!==null&&d!==void 0?d:m;c.isUntitled=false;if(typeof e.isChecked==="boolean"){const t=(await i.get(w,"renameUntitledFileOnSave")).composite;if(e.isChecked===t){i.set(w,"renameUntitledFileOnSave",!e.isChecked).catch((e=>{console.error(`Fail to set 'renameUntitledFileOnSave:\n${e}`)}))}}}}try{await h.save();if(!(c===null||c===void 0?void 0:c.isDisposed)){return h.createCheckpoint()}}catch(p){if(p.name==="ModalCancelError"){return}throw p}finally{C.delete(h);if(g!==m){await h.rename(g)}}}}}});p.addCommand(y.saveAll,{label:()=>u.__("Save All"),caption:u.__("Save all open documents"),isEnabled:()=>(0,h.some)(m.widgets("main"),(e=>{var n,i,s;return(s=(i=(n=t.contextForWidget(e))===null||n===void 0?void 0:n.contentsModel)===null||i===void 0?void 0:i.writable)!==null&&s!==void 0?s:false})),execute:()=>{var e;const n=[];const i=new Set;for(const s of m.widgets("main")){const o=t.contextForWidget(s);if(o&&!i.has(o.path)){if((e=o.contentsModel)===null||e===void 0?void 0:e.writable){i.add(o.path);n.push(o.save())}else{_(o.path)}}}return Promise.all(n)}});p.addCommand(y.saveAs,{label:()=>u.__("Save %1 As…",L(m.currentWidget,t)),caption:u.__("Save with new path"),isEnabled:f,execute:()=>{if(f()){const e=t.contextForWidget(m.currentWidget);if(!e){return(0,s.showDialog)({title:u.__("Cannot Save"),body:u.__("No context found for current widget!"),buttons:[s.Dialog.okButton()]})}const n=(n,i)=>{if(i.type==="save"&&i.newValue&&i.newValue.path!==e.path){void t.closeFile(e.path);void p.execute(y.open,{path:i.newValue.path})}};t.services.contents.fileChanged.connect(n);void e.saveAs().finally((()=>t.services.contents.fileChanged.disconnect(n)))}}});(d=e.shell.currentChanged)===null||d===void 0?void 0:d.connect((()=>{[y.reload,y.restoreCheckpoint,y.save,y.saveAll,y.saveAs].forEach((t=>{e.commands.notifyCommandChanged(t)}))}));p.addCommand(y.toggleAutosave,{label:u.__("Autosave Documents"),isToggled:()=>t.autosave,execute:()=>{const e=!t.autosave;const n="autosave";return i.set(w,n,e).catch((e=>{console.error(`Failed to set ${w}:${n} - ${e.message}`)}))}});if(l){[y.reload,y.restoreCheckpoint,y.save,y.saveAs,y.toggleAutosave,y.duplicate].forEach((e=>{l.addItem({command:e,category:g})}))}}function N(e,t,n,i,o){const a=o.load("jupyterlab");const{commands:l}=e;const d=()=>{var i;const s=/[Pp]ath:\s?(.*)\n?/;const o=e=>{var t;return!!((t=e["title"])===null||t===void 0?void 0:t.match(s))};const r=e.contextMenuHitTest(o);const a=r===null||r===void 0?void 0:r["title"].match(s);return(i=a&&t.findWidget(a[1],null))!==null&&i!==void 0?i:n.currentWidget};const c=()=>{const{currentWidget:e}=n;return!!(e&&t.contextForWidget(e))};l.addCommand(y.clone,{label:()=>a.__("New View for %1",L(d(),t)),isEnabled:c,execute:e=>{const n=d();const s=e["options"]||{mode:"split-right"};if(!n){return}const o=t.cloneWidget(n);if(o){i.open(o,s)}}});l.addCommand(y.rename,{label:()=>{let e=L(d(),t);if(e){e=" "+e}return a.__("Rename%1…",e)},isEnabled:c,execute:()=>{if(c()){const e=t.contextForWidget(d());return(0,r.renameDialog)(t,e)}}});l.addCommand(y.duplicate,{label:()=>a.__("Duplicate %1",L(d(),t)),isEnabled:c,execute:()=>{if(c()){const e=t.contextForWidget(d());if(!e){return}return t.duplicate(e.path)}}});l.addCommand(y.del,{label:()=>a.__("Delete %1",L(d(),t)),isEnabled:c,execute:async()=>{if(c()){const n=t.contextForWidget(d());if(!n){return}const i=await(0,s.showDialog)({title:a.__("Delete"),body:a.__("Are you sure you want to delete %1",n.path),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:a.__("Delete")})]});if(i.button.accept){await e.commands.execute("docmanager:delete-file",{path:n.path})}}}});l.addCommand(y.showInFileBrowser,{label:()=>a.__("Show in File Browser"),isEnabled:c,execute:async()=>{const e=d();const n=e&&t.contextForWidget(e);if(!n){return}await l.execute("filebrowser:activate",{path:n.path});await l.execute("filebrowser:go-to-path",{path:n.path})}});n.currentChanged.connect((()=>{[y.clone,y.rename,y.duplicate,y.del,y.showInFileBrowser].forEach((t=>{e.commands.notifyCommandChanged(t)}))}))}function O(e,t){let n=null;const i=(t,i)=>{if(i.name==="dirty"){if(i.newValue===true){if(!n){n=e.setDirty()}}else if(n){n.dispose();n=null}}};void t.ready.then((()=>{t.model.stateChanged.connect(i);if(t.model.dirty){n=e.setDirty()}}));t.disposed.connect((()=>{if(n){n.dispose()}}))}var B;(function(e){e.id=0;function t(e,t,n){const i=document.createElement("div");const s=document.createElement("p");const r=document.createTextNode(n.__("Are you sure you want to revert the %1 to checkpoint? ",t));const a=document.createElement("strong");a.textContent=n.__("This cannot be undone.");s.appendChild(r);s.appendChild(a);const l=document.createElement("p");const d=document.createTextNode(n.__("The checkpoint was last updated at: "));const c=document.createElement("p");const h=new Date(e.last_modified);c.style.textAlign="center";c.textContent=o.Time.format(h)+" ("+o.Time.formatHuman(h)+")";l.appendChild(d);l.appendChild(c);i.appendChild(s);i.appendChild(l);return i}e.createRevertConfirmNode=t;async function n(e,t){const n=".";const i=e.map(((e,t)=>{const i=o.Time.format(e.last_modified);const s=o.Time.formatHuman(e.last_modified);return`${t}${n} ${i} (${s})`}));const r=(await s.InputDialog.getItem({items:i,title:t.__("Choose a checkpoint")})).value;if(!r){return}const a=r.split(n,1)[0];return e[parseInt(a,10)]}e.getTargetCheckpoint=n})(B||(B={}))},87779:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(79010);var l=n(3579);var d=n(41603)},89069:(e,t,n)=>{"use strict";n.r(t);n.d(t,{DocumentManager:()=>j,DocumentWidgetManager:()=>S,IDocumentManager:()=>O,IDocumentWidgetOpener:()=>B,IRecentsManager:()=>F,PathStatus:()=>P,RecentsManager:()=>H,SaveHandler:()=>y,SavingStatus:()=>N,isValidFileName:()=>u,renameDialog:()=>d,renameFile:()=>c,shouldOverwrite:()=>h});var i=n(72050);var s=n(37737);var o=n(61927);var r=n(1143);const a="jp-FileDialog";const l="jp-new-name-title";function d(e,t,n){n=n||o.nullTranslator;const s=n.load("jupyterlab");const r=t.localPath.split("/");const a=r.pop()||t.localPath;return(0,i.showDialog)({title:s.__("Rename File"),body:new p(a),focusNodeSelector:"input",buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:s.__("Rename"),ariaLabel:s.__("Rename File")})]}).then((e=>{if(!e.value){return null}if(!u(e.value)){void(0,i.showErrorMessage)(s.__("Rename Error"),Error(s.__('"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',e.value)));return null}return t.rename(e.value)}))}function c(e,t,n){return e.rename(t,n).catch((i=>{if(i.response.status!==409){throw i}return h(n).then((i=>{if(i){return e.overwrite(t,n)}return Promise.reject("File not renamed")}))}))}function h(e,t){t=t||o.nullTranslator;const n=t.load("jupyterlab");const s={title:n.__("Overwrite file?"),body:n.__('"%1" already exists, overwrite?',e),buttons:[i.Dialog.cancelButton(),i.Dialog.warnButton({label:n.__("Overwrite"),ariaLabel:n.__("Overwrite Existing File")})]};return(0,i.showDialog)(s).then((e=>Promise.resolve(e.button.accept)))}function u(e){const t=/[\/\\:]/;return e.length>0&&!t.test(e)}class p extends r.Widget{constructor(e){super({node:m.createRenameNode(e)});this.addClass(a);const t=s.PathExt.extname(e);const n=this.inputNode.value=s.PathExt.basename(e);this.inputNode.setSelectionRange(0,n.length-t.length)}get inputNode(){return this.node.getElementsByTagName("input")[0]}getValue(){return this.inputNode.value}}var m;(function(e){function t(e,t){t=t||o.nullTranslator;const n=t.load("jupyterlab");const i=document.createElement("div");const s=document.createElement("label");s.textContent=n.__("File Path");const r=document.createElement("span");r.textContent=e;const a=document.createElement("label");a.textContent=n.__("New Name");a.className=l;const d=document.createElement("input");i.appendChild(s);i.appendChild(r);i.appendChild(a);i.appendChild(d);return i}e.createRenameNode=t})(m||(m={}));var g=n(44185);var f=n(34236);var v=n(5592);var _=n(94466);var b=n(2336);class y{constructor(e){this._autosaveTimer=-1;this._minInterval=-1;this._interval=-1;this._isActive=false;this._inDialog=false;this._isDisposed=false;this._multiplier=10;this._context=e.context;this._isConnectedCallback=e.isConnectedCallback||(()=>true);const t=e.saveInterval||120;this._minInterval=t*1e3;this._interval=this._minInterval;this._context.fileChanged.connect(this._setTimer,this);this._context.disposed.connect(this.dispose,this)}get saveInterval(){return this._interval/1e3}set saveInterval(e){this._minInterval=this._interval=e*1e3;if(this._isActive){this._setTimer()}}get isActive(){return this._isActive}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;clearTimeout(this._autosaveTimer);b.Signal.clearData(this)}start(){this._isActive=true;this._setTimer()}stop(){this._isActive=false;clearTimeout(this._autosaveTimer)}_setTimer(){clearTimeout(this._autosaveTimer);if(!this._isActive){return}this._autosaveTimer=window.setTimeout((()=>{if(this._isConnectedCallback()){this._save()}else{this._setTimer()}}),this._interval)}_save(){var e;const t=this._context;this._setTimer();if(!t){return}if(!((e=t.canSave)!==null&&e!==void 0?e:true)||!t.model.dirty||this._inDialog){return}const n=(new Date).getTime();t.save().then((()=>{if(this.isDisposed){return}const e=(new Date).getTime()-n;this._interval=Math.max(this._multiplier*e,this._minInterval);this._setTimer()})).catch((e=>{const{name:t}=e;if(t==="ModalCancelError"||t==="ModalDuplicateError"){return}console.error("Error in Auto-Save",e.message)}))}}var w=n(90044);var C=n(42856);const x="jp-Document";class S{constructor(e){this._activateRequested=new b.Signal(this);this._confirmClosingTab=false;this._isDisposed=false;this._stateChanged=new b.Signal(this);this._registry=e.registry;this.translator=e.translator||o.nullTranslator;this._recentsManager=e.recentsManager||null}get activateRequested(){return this._activateRequested}get confirmClosingDocument(){return this._confirmClosingTab}set confirmClosingDocument(e){if(this._confirmClosingTab!==e){const t=this._confirmClosingTab;this._confirmClosingTab=e;this._stateChanged.emit({name:"confirmClosingDocument",oldValue:t,newValue:e})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;b.Signal.disconnectReceiver(this)}createWidget(e,t){const n=e.createNew(t);this._initializeWidget(n,e,t);return n}_initializeWidget(e,t,n){k.factoryProperty.set(e,t);const i=new w.DisposableSet;for(const s of this._registry.widgetExtensions(t.name)){const t=s.createNew(e,n);if(t){i.add(t)}}k.disposablesProperty.set(e,i);e.disposed.connect(this._onWidgetDisposed,this);this.adoptWidget(n,e);n.fileChanged.connect(this._onFileChanged,this);n.pathChanged.connect(this._onPathChanged,this);void n.ready.then((()=>{void this.setCaption(e)}))}adoptWidget(e,t){const n=k.widgetsProperty.get(e);n.push(t);C.MessageLoop.installMessageHook(t,this);t.addClass(x);t.title.closable=true;t.disposed.connect(this._widgetDisposed,this);k.contextProperty.set(t,e)}findWidget(e,t){const n=k.widgetsProperty.get(e);if(!n){return undefined}return(0,f.find)(n,(e=>{const n=k.factoryProperty.get(e);if(!n){return false}return n.name===t}))}contextForWidget(e){return k.contextProperty.get(e)}cloneWidget(e){const t=k.contextProperty.get(e);if(!t){return undefined}const n=k.factoryProperty.get(e);if(!n){return undefined}const i=n.createNew(t,e);this._initializeWidget(i,n,t);return i}closeWidgets(e){const t=k.widgetsProperty.get(e);return Promise.all(t.map((e=>this.onClose(e)))).then((()=>undefined))}deleteWidgets(e){const t=k.widgetsProperty.get(e);return Promise.all(t.map((e=>this.onDelete(e)))).then((()=>undefined))}messageHook(e,t){switch(t.type){case"close-request":void this.onClose(e);return false;case"activate-request":{const t=e;const n=this.contextForWidget(t);if(n){n.ready.then((()=>{this._recordAsRecentlyOpened(t,n.contentsModel)})).catch((()=>{console.warn("Could not record the recents status for",n)}));this._activateRequested.emit(n.path)}break}default:break}return true}async setCaption(e){const t=this.translator.load("jupyterlab");const n=k.contextProperty.get(e);if(!n){return}const i=n.contentsModel;if(!i){e.title.caption="";return}return n.listCheckpoints().then((o=>{if(e.isDisposed){return}const r=o[o.length-1];const a=r?s.Time.format(r.last_modified):"None";let l=t.__("Name: %1\nPath: %2\n",i.name,i.path);if(n.model.readOnly){l+=t.__("Read-only")}else{l+=t.__("Last Saved: %1\n",s.Time.format(i.last_modified))+t.__("Last Checkpoint: %1",a)}e.title.caption=l}))}async onClose(e){var t;const[n,i]=await this._maybeClose(e,this.translator);if(e.isDisposed){return true}if(n){const n=k.contextProperty.get(e);if(!i){if(!n){return true}if((t=n.contentsModel)===null||t===void 0?void 0:t.writable){await n.save()}else{await n.saveAs()}}if(n){const t=await Promise.race([n.ready,new Promise((e=>setTimeout(e,3e3,"timeout")))]);if(t==="timeout"){console.warn("Could not record the widget as recently closed because the context did not become ready in 3 seconds")}else{this._recordAsRecentlyClosed(e,n.contentsModel)}}if(e.isDisposed){return true}e.dispose()}return n}onDelete(e){e.dispose();return Promise.resolve(void 0)}_recordAsRecentlyOpened(e,t){var n;const i=this._recentsManager;if(!i){return}const s=t.path;const o=this._registry.getFileTypeForModel(t);const r=o.contentType;const a=(n=k.factoryProperty.get(e))===null||n===void 0?void 0:n.name;i.addRecent({path:s,contentType:r,factory:a},"opened");if(r!=="directory"){const e=s.lastIndexOf("/")>0?s.slice(0,s.lastIndexOf("/")):"";i.addRecent({path:e,contentType:"directory"},"opened")}}_recordAsRecentlyClosed(e,t){var n;const i=this._recentsManager;if(!i){return}const s=t.path;const o=this._registry.getFileTypeForModel(t);const r=o.contentType;const a=(n=k.factoryProperty.get(e))===null||n===void 0?void 0:n.name;i.addRecent({path:s,contentType:r,factory:a},"closed")}async _maybeClose(e,t){var n,s;t=t||o.nullTranslator;const r=t.load("jupyterlab");const a=k.contextProperty.get(e);if(!a){return Promise.resolve([true,true])}let l=k.widgetsProperty.get(a);if(!l){return Promise.resolve([true,true])}l=l.filter((e=>{const t=k.factoryProperty.get(e);if(!t){return false}return t.readOnly===false}));const d=e.title.label;const c=k.factoryProperty.get(e);const h=a.model.dirty&&l.length<=1&&!((n=c===null||c===void 0?void 0:c.readOnly)!==null&&n!==void 0?n:true);if(this.confirmClosingDocument){const e=[i.Dialog.cancelButton(),i.Dialog.okButton({label:h?r.__("Close and save"):r.__("Close"),ariaLabel:h?r.__("Close and save Document"):r.__("Close Document")})];if(h){e.splice(1,0,i.Dialog.warnButton({label:r.__("Close without saving"),ariaLabel:r.__("Close Document without saving")}))}const t=await(0,i.showDialog)({title:r.__("Confirmation"),body:r.__('Please confirm you want to close "%1".',d),checkbox:h?null:{label:r.__("Do not ask me again."),caption:r.__("If checked, no confirmation to close a document will be asked in the future.")},buttons:e});if(t.isChecked){this.confirmClosingDocument=false}return Promise.resolve([t.button.accept,h?t.button.displayType==="warn":true])}else{if(!h){return Promise.resolve([true,true])}const e=((s=a.contentsModel)===null||s===void 0?void 0:s.writable)?r.__("Save"):r.__("Save as");const t=await(0,i.showDialog)({title:r.__("Save your work"),body:r.__('Save changes in "%1" before closing?',d),buttons:[i.Dialog.cancelButton(),i.Dialog.warnButton({label:r.__("Discard"),ariaLabel:r.__("Discard changes to file")}),i.Dialog.okButton({label:e})]});return[t.button.accept,t.button.displayType==="warn"]}}_widgetDisposed(e){const t=k.contextProperty.get(e);if(!t){return}const n=k.widgetsProperty.get(t);if(!n){return}f.ArrayExt.removeFirstOf(n,e);if(!n.length){t.dispose()}}_onWidgetDisposed(e){const t=k.disposablesProperty.get(e);t.dispose()}_onFileChanged(e){const t=k.widgetsProperty.get(e);for(const n of t){void this.setCaption(n)}}_onPathChanged(e){const t=k.widgetsProperty.get(e);for(const n of t){void this.setCaption(n)}}}var k;(function(e){e.contextProperty=new _.AttachedProperty({name:"context",create:()=>undefined});e.factoryProperty=new _.AttachedProperty({name:"factory",create:()=>undefined});e.widgetsProperty=new _.AttachedProperty({name:"widgets",create:()=>[]});e.disposablesProperty=new _.AttachedProperty({name:"disposables",create:()=>new w.DisposableSet})})(k||(k={}));class j{constructor(e){var t;this._activateRequested=new b.Signal(this);this._contexts=[];this._isDisposed=false;this._autosave=true;this._autosaveInterval=120;this._lastModifiedCheckMargin=500;this._renameUntitledFileOnSave=true;this._stateChanged=new b.Signal(this);this.translator=e.translator||o.nullTranslator;this.registry=e.registry;this.services=e.manager;this._dialogs=(t=e.sessionDialogs)!==null&&t!==void 0?t:new i.SessionContextDialogs({translator:e.translator});this._isConnectedCallback=e.isConnectedCallback||(()=>true);this._opener=e.opener;this._when=e.when||e.manager.ready;const n=new S({registry:this.registry,translator:this.translator,recentsManager:e.recentsManager});n.activateRequested.connect(this._onActivateRequested,this);n.stateChanged.connect(this._onWidgetStateChanged,this);this._widgetManager=n;this._setBusy=e.setBusy}get activateRequested(){return this._activateRequested}get autosave(){return this._autosave}set autosave(e){if(this._autosave!==e){const t=this._autosave;this._autosave=e;this._contexts.forEach((t=>{const n=I.saveHandlerProperty.get(t);if(!n){return}if(e===true&&!n.isActive){n.start()}else if(e===false&&n.isActive){n.stop()}}));this._stateChanged.emit({name:"autosave",oldValue:t,newValue:e})}}get autosaveInterval(){return this._autosaveInterval}set autosaveInterval(e){if(this._autosaveInterval!==e){const t=this._autosaveInterval;this._autosaveInterval=e;this._contexts.forEach((t=>{const n=I.saveHandlerProperty.get(t);if(!n){return}n.saveInterval=e||120}));this._stateChanged.emit({name:"autosaveInterval",oldValue:t,newValue:e})}}get confirmClosingDocument(){return this._widgetManager.confirmClosingDocument}set confirmClosingDocument(e){if(this._widgetManager.confirmClosingDocument!==e){const t=this._widgetManager.confirmClosingDocument;this._widgetManager.confirmClosingDocument=e;this._stateChanged.emit({name:"confirmClosingDocument",oldValue:t,newValue:e})}}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(e){if(this._lastModifiedCheckMargin!==e){const t=this._lastModifiedCheckMargin;this._lastModifiedCheckMargin=e;this._contexts.forEach((t=>{t.lastModifiedCheckMargin=e}));this._stateChanged.emit({name:"lastModifiedCheckMargin",oldValue:t,newValue:e})}}get renameUntitledFileOnSave(){return this._renameUntitledFileOnSave}set renameUntitledFileOnSave(e){if(this._renameUntitledFileOnSave!==e){const t=this._renameUntitledFileOnSave;this._renameUntitledFileOnSave=e;this._stateChanged.emit({name:"renameUntitledFileOnSave",oldValue:t,newValue:e})}}get stateChanged(){return this._stateChanged}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;b.Signal.clearData(this);this._contexts.forEach((e=>this._widgetManager.closeWidgets(e)));this._widgetManager.dispose();this._contexts.length=0}cloneWidget(e){return this._widgetManager.cloneWidget(e)}closeAll(){return Promise.all(this._contexts.map((e=>this._widgetManager.closeWidgets(e)))).then((()=>undefined))}closeFile(e){const t=this._contextsForPath(e).map((e=>this._widgetManager.closeWidgets(e)));return Promise.all(t).then((e=>undefined))}contextForWidget(e){return this._widgetManager.contextForWidget(e)}copy(e,t){return this.services.contents.copy(e,t)}createNew(e,t="default",n){return this._createOrOpenDocument("create",e,t,n)}deleteFile(e){return this.services.sessions.stopIfNeeded(e).then((()=>this.services.contents.delete(e))).then((()=>{this._contextsForPath(e).forEach((e=>this._widgetManager.deleteWidgets(e)));return Promise.resolve(void 0)}))}duplicate(e){const t=s.PathExt.dirname(e);return this.services.contents.copy(e,t)}findWidget(e,t="default"){const n=s.PathExt.normalize(e);let i=[t];if(t==="default"){const e=this.registry.defaultWidgetFactory(n);if(!e){return undefined}i=[e.name]}else if(t===null){i=this.registry.preferredWidgetFactories(n).map((e=>e.name))}for(const s of this._contextsForPath(n)){for(const e of i){if(e!==null){const t=this._widgetManager.findWidget(s,e);if(t){return t}}}}return undefined}newUntitled(e){if(e.type==="file"){e.ext=e.ext||".txt"}return this.services.contents.newUntitled(e)}open(e,t="default",n,i){return this._createOrOpenDocument("open",e,t,n,i)}openOrReveal(e,t="default",n,i){const s=this.findWidget(e,t);if(s){this._opener.open(s,{type:t,...i});return s}return this.open(e,t,n,i!==null&&i!==void 0?i:{})}overwrite(e,t){const n=`${t}.${v.UUID.uuid4()}`;const i=()=>this.rename(n,t);return this.rename(e,n).then((()=>this.deleteFile(t))).then(i,i)}rename(e,t){return this.services.contents.rename(e,t)}_findContext(e,t){const n=this.services.contents.normalize(e);return(0,f.find)(this._contexts,(e=>e.path===n&&e.factoryName===t))}_contextsForPath(e){const t=this.services.contents.normalize(e);return this._contexts.filter((e=>e.path===t))}_createContext(e,t,n,i){const s=(e,t)=>{this._widgetManager.adoptWidget(o,e);this._opener.open(e,t)};const o=new g.Context({opener:s,manager:this.services,factory:t,path:e,kernelPreference:n,setBusy:this._setBusy,sessionDialogs:this._dialogs,lastModifiedCheckMargin:this._lastModifiedCheckMargin,translator:this.translator,contentProviderId:i});const r=new y({context:o,isConnectedCallback:this._isConnectedCallback,saveInterval:this.autosaveInterval});I.saveHandlerProperty.set(o,r);void o.ready.then((()=>{if(this.autosave){r.start()}}));o.disposed.connect(this._onContextDisposed,this);this._contexts.push(o);return o}_onContextDisposed(e){f.ArrayExt.removeFirstOf(this._contexts,e)}_widgetFactoryFor(e,t){const{registry:n}=this;if(t==="default"){const i=n.defaultWidgetFactory(e);if(!i){return undefined}t=i.name}return n.getWidgetFactory(t)}_createOrOpenDocument(e,t,n="default",i,s){const o=this._widgetFactoryFor(t,n);if(!o){return undefined}const r=o.modelName||"text";const a=this.registry.getModelFactory(r);if(!a){return undefined}const l=this.registry.getKernelPreference(t,o.name,i);let d;let c=Promise.resolve(undefined);if(e==="open"){d=this._findContext(t,a.name)||null;if(!d){d=this._createContext(t,a,l,o.contentProviderId);c=this._when.then((()=>d.initialize(false)))}}else if(e==="create"){d=this._createContext(t,a,l,o.contentProviderId);c=this._when.then((()=>d.initialize(true)))}else{throw new Error(`Invalid argument 'which': ${e}`)}const h=this._widgetManager.createWidget(o,d);this._opener.open(h,{type:o.name,...s});c.catch((e=>{console.error(`Failed to initialize the context with '${a.name}' for ${t}`,e);h.close()}));return h}_onActivateRequested(e,t){this._activateRequested.emit(t)}_onWidgetStateChanged(e,t){if(t.name==="confirmClosingDocument"){this._stateChanged.emit(t)}}}var I;(function(e){e.saveHandlerProperty=new _.AttachedProperty({name:"saveHandler",create:()=>undefined})})(I||(I={}));var E=n(66987);var T=n(66127);var M=n(44914);var D=n.n(M);function A(e){return D().createElement(E.TextItem,{source:e.name,title:e.fullPath})}class P extends T.VDomRenderer{constructor(e){super(new P.Model(e.docManager));this.node.title=this.model.path}render(){return D().createElement(A,{fullPath:this.model.path,name:this.model.name})}}(function(e){class t extends T.VDomModel{constructor(e){super();this._onTitleChange=e=>{const t=this._getAllState();this._name=e.label;this._triggerChange(t,this._getAllState())};this._onPathChange=(e,t)=>{const n=this._getAllState();this._path=t;this._name=s.PathExt.basename(t);this._triggerChange(n,this._getAllState())};this._path="";this._name="";this._widget=null;this._docManager=e}get path(){return this._path}get name(){return this._name}get widget(){return this._widget}set widget(e){const t=this._widget;if(t!==null){const e=this._docManager.contextForWidget(t);if(e){e.pathChanged.disconnect(this._onPathChange)}else{t.title.changed.disconnect(this._onTitleChange)}}const n=this._getAllState();this._widget=e;if(this._widget===null){this._path="";this._name=""}else{const e=this._docManager.contextForWidget(this._widget);if(e){this._path=e.path;this._name=s.PathExt.basename(e.path);e.pathChanged.connect(this._onPathChange)}else{this._path="";this._name=this._widget.title.label;this._widget.title.changed.connect(this._onTitleChange)}}this._triggerChange(n,this._getAllState())}_getAllState(){return[this._path,this._name]}_triggerChange(e,t){if(e[0]!==t[0]||e[1]!==t[1]){this.stateChanged.emit(void 0)}}}e.Model=t})(P||(P={}));function L(e){return D().createElement(E.TextItem,{source:e.fileStatus})}const R=2e3;class N extends T.VDomRenderer{constructor(e){super(new N.Model(e.docManager));const t=e.translator||o.nullTranslator;const n=t.load("jupyterlab");this._statusMap={completed:n.__("Saving completed"),started:n.__("Saving started"),failed:n.__("Saving failed")}}render(){if(this.model===null||this.model.status===null){return null}else{return D().createElement(L,{fileStatus:this._statusMap[this.model.status]})}}}(function(e){class t extends T.VDomModel{constructor(e){super();this._onStatusChange=(e,t)=>{this._status=t;if(this._status==="completed"){setTimeout((()=>{this._status=null;this.stateChanged.emit(void 0)}),R);this.stateChanged.emit(void 0)}else{this.stateChanged.emit(void 0)}};this._status=null;this._widget=null;this._status=null;this.widget=null;this._docManager=e}get status(){return this._status}get widget(){return this._widget}set widget(e){var t,n;const i=this._widget;if(i!==null){const e=this._docManager.contextForWidget(i);if(e){e.saveState.disconnect(this._onStatusChange)}else if((t=this._widget.content)===null||t===void 0?void 0:t.saveStateChanged){this._widget.content.saveStateChanged.disconnect(this._onStatusChange)}}this._widget=e;if(this._widget===null){this._status=null}else{const e=this._docManager.contextForWidget(this._widget);if(e){e.saveState.connect(this._onStatusChange)}else if((n=this._widget.content)===null||n===void 0?void 0:n.saveStateChanged){this._widget.content.saveStateChanged.connect(this._onStatusChange)}}}}e.Model=t})(N||(N={}));const O=new v.Token("@jupyterlab/docmanager:IDocumentManager",`A service for the manager for all\n documents used by the application. Use this if you want to open and close documents,\n create and delete files, and otherwise interact with the file system.`);const B=new v.Token("@jupyterlab/docmanager:IDocumentWidgetOpener",`A service to open a widget.`);const F=new v.Token("@jupyterlab/docmanager:IRecentsManager",`A service providing information about recently opened and closed documents`);var z=n(26568);class H{constructor(e){this._recentsChanged=new b.Signal(this);this._recents={opened:[],closed:[]};this._isDisposed=false;this._maxRecentsLength=10;this._saveDebouncer=new z.Debouncer(this._save.bind(this),500);this._stateDB=e.stateDB;this._contentsManager=e.contents;this.updateRootDir();this._loadRecents().catch((e=>{console.error(`Failed to load recent list from state:\n${e}`)}))}get isDisposed(){return this._isDisposed}get recentlyOpened(){const e=this._recents.opened||[];return e.filter((e=>e.root===this._serverRoot))}get recentlyClosed(){const e=this._recents.closed||[];return e.filter((e=>e.root===this._serverRoot))}get changed(){return this._recentsChanged}get maximalRecentsLength(){return this._maxRecentsLength}set maximalRecentsLength(e){this._maxRecentsLength=Math.round(Math.max(1,e));let t=false;for(const n of["opened","closed"]){if(this._recents[n].length>this._maxRecentsLength){this._recents[n].length=this._maxRecentsLength;t=true}}if(t){this._recentsChanged.emit(undefined)}}dispose(){if(this.isDisposed){return}this._isDisposed=true;b.Signal.clearData(this);this._saveDebouncer.dispose()}addRecent(e,t){const n={...e,root:this._serverRoot};const i=this._recents[t];const s=i.findIndex((t=>t.path===e.path));if(s>=0){i.splice(s,1)}i.unshift(n);this._setRecents(i,t);this._recentsChanged.emit(undefined)}clearRecents(){this._setRecents([],"opened");this._setRecents([],"closed");this._recentsChanged.emit(undefined)}removeRecent(e,t){this._removeRecent(e.path,[t])}async validate(e){const t=await this._isValid(e);if(!t){this._removeRecent(e.path)}return t}updateRootDir(){this._serverRoot=s.PageConfig.getOption("serverRoot")}_removeRecent(e,t=["opened","closed"]){let n=false;for(const i of t){const t=this._recents[i];const s=t.filter((t=>e!==t.path));if(t.length!==s.length){this._setRecents(s,i);n=true}}if(n){this._recentsChanged.emit(undefined)}}async _isValid(e){var t;try{await this._contentsManager.get(e.path,{content:false})}catch(n){if(((t=n.response)===null||t===void 0?void 0:t.status)===404){return false}}return true}_setRecents(e,t){this._recents[t]=e.slice(0,this.maximalRecentsLength).sort(((e,t)=>{if(e.root===t.root){return 0}else{return e.root!==this._serverRoot?1:-1}}));this._saveDebouncer.invoke().catch(console.warn)}async _loadRecents(){const e=await this._stateDB.fetch(W.stateDBKey)||{opened:[],closed:[]};const t=[...e.opened,...e.closed];const n=new Set(await this._getInvalidPaths(t));for(const i of["opened","closed"]){this._setRecents(e[i].filter((e=>!n.has(e.path))),i)}this._recentsChanged.emit(undefined)}async _getInvalidPaths(e){const t=await Promise.all(e.map((async e=>{if(await this._isValid(e)){return null}else{return e.path}})));return t.filter((e=>typeof e==="string"))}async _save(){try{await this._stateDB.save(W.stateDBKey,this._recents)}catch(e){console.log("Saving recents failed",e)}}}var W;(function(e){e.stateDBKey="docmanager:recents"})(W||(W={}))},41603:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(79010)},70491:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ABCWidgetFactory:()=>b,Base64ModelFactory:()=>_,Context:()=>h,DocumentModel:()=>f,DocumentRegistry:()=>T,DocumentWidget:()=>w,MimeContent:()=>x,MimeDocument:()=>S,MimeDocumentFactory:()=>k,TextModelFactory:()=>v,createReadonlyLabel:()=>g});var i=n(72050);var s=n(37737);var o=n(90943);var r=n(61927);var a=n(5592);var l=n(90044);var d=n(2336);var c=n(1143);class h{constructor(e){var t,n;this._isReady=false;this._isDisposed=false;this._isPopulated=false;this._path="";this._lineEnding=null;this._contentsModel=null;this._populatedPromise=new a.PromiseDelegate;this._pathChanged=new d.Signal(this);this._fileChanged=new d.Signal(this);this._saveState=new d.Signal(this);this._disposed=new d.Signal(this);this._lastModifiedCheckMargin=500;this._conflictModalIsOpen=false;const l=this._manager=e.manager;this.translator=e.translator||r.nullTranslator;this._contentProviderId=e.contentProviderId;this._trans=this.translator.load("jupyterlab");this._factory=e.factory;this._dialogs=(t=e.sessionDialogs)!==null&&t!==void 0?t:new i.SessionContextDialogs({translator:e.translator});this._opener=e.opener||u.noOp;this._path=this._manager.contents.normalize(e.path);this._lastModifiedCheckMargin=e.lastModifiedCheckMargin||500;const c=this._manager.contents.localPath(this._path);const h=this._factory.preferredLanguage(s.PathExt.basename(c));const p=this._manager.contents.getSharedModelFactory(this._path,{contentProviderId:e.contentProviderId});const m=p===null||p===void 0?void 0:p.createNew({path:c,format:this._factory.fileFormat,contentType:this._factory.contentType,collaborative:this._factory.collaborative});this._model=this._factory.createNew({languagePreference:h,sharedModel:m,collaborationEnabled:(n=p===null||p===void 0?void 0:p.collaborative)!==null&&n!==void 0?n:false});this._readyPromise=l.ready.then((()=>this._populatedPromise.promise));const g=s.PathExt.extname(this._path);this.sessionContext=new i.SessionContext({kernelManager:l.kernels,sessionManager:l.sessions,specsManager:l.kernelspecs,path:c,type:g===".ipynb"?"notebook":"file",name:s.PathExt.basename(c),kernelPreference:e.kernelPreference||{shouldStart:false},setBusy:e.setBusy});this.sessionContext.propertyChanged.connect(this._onSessionChanged,this);l.contents.fileChanged.connect(this._onFileChanged,this);this.urlResolver=new o.RenderMimeRegistry.UrlResolver({path:this._path,contents:l.contents})}get pathChanged(){return this._pathChanged}get fileChanged(){return this._fileChanged}get saveState(){return this._saveState}get disposed(){return this._disposed}get lastModifiedCheckMargin(){return this._lastModifiedCheckMargin}set lastModifiedCheckMargin(e){this._lastModifiedCheckMargin=e}get model(){return this._model}get path(){return this._path}get localPath(){return this._manager.contents.localPath(this._path)}get contentsModel(){return this._contentsModel?{...this._contentsModel}:null}get factoryName(){return this.isDisposed?"":this._factory.name}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this.sessionContext.dispose();this._model.dispose();this._model.sharedModel.dispose();this._disposed.emit(void 0);d.Signal.clearData(this)}get isReady(){return this._isReady}get ready(){return this._readyPromise}get canSave(){var e;return!!(((e=this._contentsModel)===null||e===void 0?void 0:e.writable)&&!this._model.collaborative)}async initialize(e){if(e){await this._save()}else{await this._revert()}this.model.sharedModel.clearUndoHistory()}rename(e){return this.ready.then((()=>this._manager.ready.then((()=>this._rename(e)))))}async save(){await this.ready;await this._save()}async saveAs(){await this.ready;const e=this._manager.contents.localPath(this.path);const t=await u.getSavePath(e);if(this.isDisposed||!t){return}const n=this._manager.contents.driveName(this.path);const i=n==""?t:`${n}:${t}`;if(i===this._path){return this.save()}try{await this._manager.ready;await this._manager.contents.get(i,{contentProviderId:this._contentProviderId});await this._maybeOverWrite(i)}catch(s){if(!s.response||s.response.status!==404){throw s}await this._finishSaveAs(i)}}async download(){const e=await this._manager.contents.getDownloadUrl(this._path);const t=document.createElement("a");t.href=e;t.download="";document.body.appendChild(t);t.click();document.body.removeChild(t);return void 0}async revert(){await this.ready;await this._revert()}createCheckpoint(){const e=this._manager.contents;return this._manager.ready.then((()=>e.createCheckpoint(this._path)))}deleteCheckpoint(e){const t=this._manager.contents;return this._manager.ready.then((()=>t.deleteCheckpoint(this._path,e)))}restoreCheckpoint(e){const t=this._manager.contents;const n=this._path;return this._manager.ready.then((()=>{if(e){return t.restoreCheckpoint(n,e)}return this.listCheckpoints().then((i=>{if(this.isDisposed||!i.length){return}e=i[i.length-1].id;return t.restoreCheckpoint(n,e)}))}))}listCheckpoints(){const e=this._manager.contents;return this._manager.ready.then((()=>e.listCheckpoints(this._path)))}addSibling(e,t={}){const n=this._opener;if(n){n(e,t)}return new l.DisposableDelegate((()=>{e.close()}))}_onFileChanged(e,t){var n,i,s;if(t.type==="save"&&this._model.collaborative){if(((n=this._contentsModel)===null||n===void 0?void 0:n.path)!==((i=t.newValue)===null||i===void 0?void 0:i.path)){return}this._updateContentsModel({...this._contentsModel,...t.newValue});return}if(t.type!=="rename"){return}let o=t.oldValue&&t.oldValue.path;let r=t.newValue&&t.newValue.path;if(r&&this._path.indexOf(o||"")===0){let e=t.newValue;if(o!==this._path){r=this._path.replace(new RegExp(`^${o}/`),`${r}/`);o=this._path;e={last_modified:(s=t.newValue)===null||s===void 0?void 0:s.created,path:r}}this._updateContentsModel({...this._contentsModel,...e});this._updatePath(r)}}_onSessionChanged(e,t){if(t!=="path"){return}const n=this._manager.contents.driveName(this.path);let i=this.sessionContext.session.path;if(n){i=`${n}:${i}`}this._updatePath(i)}_updateContentsModel(e){var t,n,i,s;const o={path:e.path,name:e.name,type:e.type,writable:e.writable,created:e.created,last_modified:e.last_modified,mimetype:e.mimetype,format:e.format,hash:e.hash,hash_algorithm:e.hash_algorithm};const r=(n=(t=this._contentsModel)===null||t===void 0?void 0:t.last_modified)!==null&&n!==void 0?n:null;const a=(s=(i=this._contentsModel)===null||i===void 0?void 0:i.hash)!==null&&s!==void 0?s:null;this._contentsModel=o;if(!r&&!a||!a&&o.last_modified!==r||a&&o.hash!==a){this._fileChanged.emit(o)}}_updatePath(e){var t,n,i,o;if(this._path===e){return}this._path=e;const r=this._manager.contents.localPath(e);const a=s.PathExt.basename(r);if(((t=this.sessionContext.session)===null||t===void 0?void 0:t.path)!==r){void((n=this.sessionContext.session)===null||n===void 0?void 0:n.setPath(r))}if(((i=this.sessionContext.session)===null||i===void 0?void 0:i.name)!==a){void((o=this.sessionContext.session)===null||o===void 0?void 0:o.setName(a))}if(this.urlResolver.path!==e){this.urlResolver.path=e}if(this._contentsModel&&(this._contentsModel.path!==e||this._contentsModel.name!==a)){const t={...this._contentsModel,name:a,path:e};this._updateContentsModel(t)}this._pathChanged.emit(e)}async _populate(){this._isPopulated=true;this._isReady=true;this._populatedPromise.resolve(void 0);await this._maybeCheckpoint(false);if(this.isDisposed){return}const e=this._model.defaultKernelName||this.sessionContext.kernelPreference.name;this.sessionContext.kernelPreference={...this.sessionContext.kernelPreference,name:e,language:this._model.defaultKernelLanguage};void this.sessionContext.initialize().then((e=>{if(e){void this._dialogs.selectKernel(this.sessionContext)}}))}async _rename(e){const t=this.localPath.split("/");t[t.length-1]=e;let n=s.PathExt.join(...t);const i=this._manager.contents.driveName(this.path);if(i){n=`${i}:${n}`}await this._manager.contents.rename(this.path,n)}async _save(){this._saveState.emit("started");const e=this._createSaveOptions();try{await this._manager.ready;const t=await this._maybeSave(e);if(this.isDisposed){return}this._model.dirty=false;this._updateContentsModel(t);if(!this._isPopulated){await this._populate()}this._saveState.emit("completed")}catch(t){const{name:e}=t;if(e==="ModalCancelError"||e==="ModalDuplicateError"){throw t}const n=this._manager.contents.localPath(this._path);const i=s.PathExt.basename(n);void this._handleError(t,this._trans.__("File Save Error for %1",i));this._saveState.emit("failed");throw t}}_revert(e=false){const t={type:this._factory.contentType,content:this._factory.fileFormat!==null,hash:this._factory.fileFormat!==null,...this._factory.fileFormat!==null?{format:this._factory.fileFormat}:{},contentProviderId:this._contentProviderId};const n=this._path;const i=this._model;return this._manager.ready.then((()=>this._manager.contents.get(n,t))).then((e=>{if(this.isDisposed){return}if(e.content){if(e.format==="json"){i.fromJSON(e.content)}else{let t=e.content;if(t.indexOf("\r\n")!==-1){this._lineEnding="\r\n";t=t.replace(/\r\n/g,"\n")}else if(t.indexOf("\r")!==-1){this._lineEnding="\r";t=t.replace(/\r/g,"\n")}else{this._lineEnding=null}i.fromString(t)}}this._updateContentsModel(e);i.dirty=false;if(!this._isPopulated){return this._populate()}})).catch((async e=>{const t=this._manager.contents.localPath(this._path);const n=s.PathExt.basename(t);void this._handleError(e,this._trans.__("File Load Error for %1",n));throw e}))}_maybeSave(e){const t=this._path;const n=this._manager.contents.get(t,{content:false,hash:true,contentProviderId:this._contentProviderId});return n.then((n=>{var i,s,o,r;if(this.isDisposed){return Promise.reject(new Error("Disposed"))}const a=((i=this.contentsModel)===null||i===void 0?void 0:i.hash)!==undefined&&((s=this.contentsModel)===null||s===void 0?void 0:s.hash)!==null&&n.hash!==undefined&&n.hash!==null;const l=(o=this.contentsModel)===null||o===void 0?void 0:o.hash;const d=n.hash;if(a&&l!==d){console.warn(`Different hash found for ${this.path}`);return this._raiseConflict(n,e)}const c=this._lastModifiedCheckMargin;const h=(r=this.contentsModel)===null||r===void 0?void 0:r.last_modified;const u=h?new Date(h):new Date;const p=new Date(n.last_modified);if(!a&&h&&p.getTime()-u.getTime()>c){console.warn(`Last saving performed ${u} `+`while the current file seems to have been saved `+`${p}`);return this._raiseConflict(n,e)}return this._manager.contents.save(t,{...e,contentProviderId:this._contentProviderId}).then((async e=>{const n=await this._manager.contents.get(t,{content:false,hash:true,contentProviderId:this._contentProviderId});return{...e,hash:n.hash,hash_algorithm:n.hash_algorithm}}))}),(n=>{if(n.response&&n.response.status===404){return this._manager.contents.save(t,e).then((async e=>{const n=await this._manager.contents.get(t,{content:false,hash:true,contentProviderId:this._contentProviderId});return{...e,hash:n.hash,hash_algorithm:n.hash_algorithm}}))}throw n}))}async _handleError(e,t){await(0,i.showErrorMessage)(t,e);return}_maybeCheckpoint(e){let t=Promise.resolve(void 0);if(!this.canSave){return t}if(e){t=this.createCheckpoint().then()}else{t=this.listCheckpoints().then((e=>{if(!this.isDisposed&&!e.length&&this.canSave){return this.createCheckpoint().then()}}))}return t.catch((e=>{if(!e.response||e.response.status!==403){throw e}}))}_raiseConflict(e,t){if(this._conflictModalIsOpen){const e=new Error("Modal is already displayed");e.name="ModalDuplicateError";return Promise.reject(e)}const n=this._trans.__(`"%1" has changed on disk since the last time it was opened or saved.\nDo you want to overwrite the file on disk with the version open here,\nor load the version on disk (revert)?`,this.path);const s=i.Dialog.okButton({label:this._trans.__("Revert"),actions:["revert"]});const o=i.Dialog.warnButton({label:this._trans.__("Overwrite"),actions:["overwrite"]});this._conflictModalIsOpen=true;return(0,i.showDialog)({title:this._trans.__("File Changed"),body:n,buttons:[i.Dialog.cancelButton(),s,o]}).then((n=>{this._conflictModalIsOpen=false;if(this.isDisposed){return Promise.reject(new Error("Disposed"))}if(n.button.actions.includes("overwrite")){return this._manager.contents.save(this._path,{...t,contentProviderId:this._contentProviderId})}if(n.button.actions.includes("revert")){return this.revert().then((()=>e))}const i=new Error("Cancel");i.name="ModalCancelError";return Promise.reject(i)}))}_maybeOverWrite(e){const t=this._trans.__('"%1" already exists. Do you want to replace it?',e);const n=i.Dialog.warnButton({label:this._trans.__("Overwrite"),accept:true});return(0,i.showDialog)({title:this._trans.__("File Overwrite?"),body:t,buttons:[i.Dialog.cancelButton(),n]}).then((t=>{if(this.isDisposed){return Promise.reject(new Error("Disposed"))}if(t.button.accept){return this._manager.contents.delete(e).then((()=>this._finishSaveAs(e)))}}))}async _finishSaveAs(e){this._saveState.emit("started");try{await this._manager.ready;const t=this._createSaveOptions();await this._manager.contents.save(e,t);await this._maybeCheckpoint(true);this._saveState.emit("completed")}catch(t){if(t.message==="Cancel"||t.message==="Modal is already displayed"){throw t}const e=this._manager.contents.localPath(this._path);const n=s.PathExt.basename(e);void this._handleError(t,this._trans.__("File Save Error for %1",n));this._saveState.emit("failed");return}}_createSaveOptions(){let e=null;if(this._factory.fileFormat==="json"){e=this._model.toJSON()}else{e=this._model.toString();if(this._lineEnding){e=e.replace(/\n/g,this._lineEnding)}}return{type:this._factory.contentType,format:this._factory.fileFormat,content:e}}}var u;(function(e){function t(e,t){t=t||r.nullTranslator;const n=t.load("jupyterlab");const o=i.Dialog.okButton({label:n.__("Save"),accept:true});return(0,i.showDialog)({title:n.__("Save File As…"),body:new s(e),buttons:[i.Dialog.cancelButton(),o]}).then((e=>{var t;if(e.button.accept){return(t=e.value)!==null&&t!==void 0?t:undefined}return}))}e.getSavePath=t;function n(){}e.noOp=n;class s extends c.Widget{constructor(e){super({node:o(e)})}getValue(){return this.node.value}}function o(e){const t=document.createElement("input");t.value=e;return t}})(u||(u={}));var p=n(98335);var m=n(44914);function g(e,t){var n;let s=(t!==null&&t!==void 0?t:r.nullTranslator).load("jupyterlab");return i.ReactWidget.create(m.createElement("div",null,m.createElement("span",{className:"jp-ToolbarLabelComponent",title:s.__(`Document is read-only. "Save" is disabled; use "Save as…" instead`)},s.__(`%1 is read-only`,(n=e.context.contentsModel)===null||n===void 0?void 0:n.type))))}class f extends p.CodeEditor.Model{constructor(e={}){var t;super({sharedModel:e.sharedModel});this._defaultLang="";this._dirty=false;this._readOnly=false;this._contentChanged=new d.Signal(this);this._stateChanged=new d.Signal(this);this._defaultLang=(t=e.languagePreference)!==null&&t!==void 0?t:"";this._collaborationEnabled=!!e.collaborationEnabled;this.sharedModel.changed.connect(this._onStateChanged,this)}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get dirty(){return this._dirty}set dirty(e){const t=this._dirty;if(e===t){return}this._dirty=e;this.triggerStateChange({name:"dirty",oldValue:t,newValue:e})}get readOnly(){return this._readOnly}set readOnly(e){if(e===this._readOnly){return}const t=this._readOnly;this._readOnly=e;this.triggerStateChange({name:"readOnly",oldValue:t,newValue:e})}get defaultKernelName(){return""}get defaultKernelLanguage(){return this._defaultLang}get collaborative(){return this._collaborationEnabled}toString(){return this.sharedModel.getSource()}fromString(e){this.sharedModel.setSource(e)}toJSON(){return JSON.parse(this.sharedModel.getSource()||"null")}fromJSON(e){this.fromString(JSON.stringify(e))}initialize(){return}triggerStateChange(e){this._stateChanged.emit(e)}triggerContentChange(){this._contentChanged.emit(void 0);this.dirty=true}_onStateChanged(e,t){if(t.sourceChange){this.triggerContentChange()}if(t.stateChange){t.stateChange.forEach((e=>{if(e.name==="dirty"){this.dirty=e.newValue}else if(e.oldValue!==e.newValue){this.triggerStateChange({newValue:undefined,oldValue:undefined,...e})}}))}}}class v{constructor(e){this._isDisposed=false;this._collaborative=e!==null&&e!==void 0?e:true}get name(){return"text"}get contentType(){return"file"}get fileFormat(){return"text"}get collaborative(){return this._collaborative}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=true}createNew(e={}){const t=e.collaborationEnabled&&this.collaborative;return new f({...e,collaborationEnabled:t})}preferredLanguage(e){return""}}class _ extends v{get name(){return"base64"}get contentType(){return"file"}get fileFormat(){return"base64"}}class b{constructor(e){this._isDisposed=false;this._widgetCreated=new d.Signal(this);this._translator=e.translator||r.nullTranslator;this._name=e.name;this._label=e.label||e.name;this._readOnly=e.readOnly===undefined?false:e.readOnly;this._defaultFor=e.defaultFor?e.defaultFor.slice():[];this._defaultRendered=(e.defaultRendered||[]).slice();this._fileTypes=e.fileTypes.slice();this._modelName=e.modelName||"text";this._preferKernel=!!e.preferKernel;this._canStartKernel=!!e.canStartKernel;this._shutdownOnClose=!!e.shutdownOnClose;this._autoStartDefault=!!e.autoStartDefault;this._toolbarFactory=e.toolbarFactory;this._contentProviderId=e.contentProviderId}get widgetCreated(){return this._widgetCreated}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;d.Signal.clearData(this)}get readOnly(){return this._readOnly}get name(){return this._name}get label(){return this._label}get fileTypes(){return this._fileTypes.slice()}get modelName(){return this._modelName}get defaultFor(){return this._defaultFor.slice()}get defaultRendered(){return this._defaultRendered.slice()}get preferKernel(){return this._preferKernel}get canStartKernel(){return this._canStartKernel}get translator(){return this._translator}get shutdownOnClose(){return this._shutdownOnClose}set shutdownOnClose(e){this._shutdownOnClose=e}get autoStartDefault(){return this._autoStartDefault}set autoStartDefault(e){this._autoStartDefault=e}createNew(e,t){var n;const s=this.createNewWidget(e,t);(0,i.setToolbar)(s,(n=this._toolbarFactory)!==null&&n!==void 0?n:this.defaultToolbarFactory.bind(this));this._widgetCreated.emit(s);return s}get contentProviderId(){return this._contentProviderId}set contentProviderId(e){if(this._contentProviderId&&e!==this._contentProviderId){throw Error(`Cannot change content provider on factory with an existing provider: ${this._contentProviderId}`)}this._contentProviderId=e}defaultToolbarFactory(e){return[]}}const y="jp-mod-dirty";class w extends i.MainAreaWidget{constructor(e){var t;e.reveal=Promise.all([e.reveal,e.context.ready]);super(e);this._trans=((t=e.translator)!==null&&t!==void 0?t:r.nullTranslator).load("jupyterlab");this.context=e.context;this.context.pathChanged.connect(this._onPathChanged,this);this._onPathChanged(this.context,this.context.path);this.context.model.stateChanged.connect(this._onModelStateChanged,this);void this.context.ready.then((()=>{this._handleDirtyState()}));this.title.changed.connect(this._onTitleChanged,this)}setFragment(e){}async _onTitleChanged(e){const t=/[\/\\:]/;const n=this.title.label;const i=this.context.localPath.split("/").pop()||this.context.localPath;if(n===i){return}if(n.length>0&&!t.test(n)){const e=this.context.path;await this.context.rename(n);if(this.context.path!==e){return}}this.title.label=i}_onPathChanged(e,t){this.title.label=s.PathExt.basename(e.localPath);this.isUntitled=false}_onModelStateChanged(e,t){var n;if(t.name==="dirty"){this._handleDirtyState()}if(!this.context.model.dirty){if(((n=this.context.contentsModel)===null||n===void 0?void 0:n.writable)===false){const e=g(this);let t=this.toolbar.insertBefore("kernelName","read-only-indicator",e);if(!t){this.toolbar.addItem("read-only-indicator",e)}}}}_handleDirtyState(){if(this.context.model.dirty&&!this.title.className.includes(y)){this.title.className+=` ${y}`}else{this.title.className=this.title.className.replace(y,"")}}}var C=n(42856);class x extends c.Widget{constructor(e){super();this._changeCallback=e=>{if(!e.data||!e.data[this.mimeType]){return}const t=e.data[this.mimeType];if(typeof t==="string"){if(t!==this._context.model.toString()){this._context.model.fromString(t)}}else if(t!==null&&t!==undefined&&!a.JSONExt.deepEqual(t,this._context.model.toJSON())){this._context.model.fromJSON(t)}};this._fragment="";this._ready=new a.PromiseDelegate;this._isRendering=false;this._renderRequested=false;this.addClass("jp-MimeDocument");this.translator=e.translator||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this.mimeType=e.mimeType;this._dataType=e.dataType||"string";this._context=e.context;this.renderer=e.renderer;const t=this.layout=new c.StackedLayout;t.addWidget(this.renderer);this._context.ready.then((()=>this._render())).then((()=>{if(this.node===document.activeElement){C.MessageLoop.sendMessage(this.renderer,c.Widget.Msg.ActivateRequest)}this._monitor=new s.ActivityMonitor({signal:this._context.model.contentChanged,timeout:e.renderTimeout});this._monitor.activityStopped.connect(this.update,this);this._ready.resolve(undefined)})).catch((e=>{requestAnimationFrame((()=>{this.dispose()}));void(0,i.showErrorMessage)(this._trans.__("Renderer Failure: %1",this._context.path),e)}))}[i.Printing.symbol](){return i.Printing.getPrintFunction(this.renderer)}get ready(){return this._ready.promise}setFragment(e){this._fragment=e;this.update()}dispose(){if(this.isDisposed){return}if(this._monitor){this._monitor.dispose()}this._monitor=null;super.dispose()}onUpdateRequest(e){if(this._context.isReady){void this._render();this._fragment=""}}async _render(){if(this.isDisposed){return}if(this._isRendering){this._renderRequested=true;return}this._renderRequested=false;const e=this._context;const t=e.model;const n={};if(this._dataType==="string"){n[this.mimeType]=t.toString()}else{n[this.mimeType]=t.toJSON()}const s=new o.MimeModel({data:n,callback:this._changeCallback,metadata:{fragment:this._fragment}});try{this._isRendering=true;await this.renderer.renderModel(s);this._isRendering=false;if(this._renderRequested){return this._render()}}catch(r){requestAnimationFrame((()=>{this.dispose()}));void(0,i.showErrorMessage)(this._trans.__("Renderer Failure: %1",e.path),r)}}}class S extends w{setFragment(e){this.content.setFragment(e)}}class k extends b{constructor(e){super(j.createRegistryOptions(e));this._rendermime=e.rendermime;this._renderTimeout=e.renderTimeout||1e3;this._dataType=e.dataType||"string";this._fileType=e.primaryFileType;this._factory=e.factory}createNewWidget(e){var t,n;const i=this._fileType;const s=(i===null||i===void 0?void 0:i.mimeTypes.length)?i.mimeTypes[0]:p.IEditorMimeTypeService.defaultMimeType;const o=this._rendermime.clone({resolver:e.urlResolver});let r;if(this._factory&&this._factory.mimeTypes.includes(s)){r=this._factory.createRenderer({mimeType:s,resolver:o.resolver,sanitizer:o.sanitizer,linkHandler:o.linkHandler,latexTypesetter:o.latexTypesetter,markdownParser:o.markdownParser})}else{r=o.createRenderer(s)}const a=new x({context:e,renderer:r,mimeType:s,renderTimeout:this._renderTimeout,dataType:this._dataType});a.title.icon=i===null||i===void 0?void 0:i.icon;a.title.iconClass=(t=i===null||i===void 0?void 0:i.iconClass)!==null&&t!==void 0?t:"";a.title.iconLabel=(n=i===null||i===void 0?void 0:i.iconLabel)!==null&&n!==void 0?n:"";const l=new S({content:a,context:e});return l}}var j;(function(e){function t(e){return{...e,readOnly:true}}e.createRegistryOptions=t})(j||(j={}));var I=n(66127);var E=n(34236);class T{constructor(e={}){this._modelFactories=Object.create(null);this._widgetFactories=Object.create(null);this._defaultWidgetFactory="";this._defaultWidgetFactoryOverrides=Object.create(null);this._defaultWidgetFactories=Object.create(null);this._defaultRenderedWidgetFactories=Object.create(null);this._widgetFactoriesForFileType=Object.create(null);this._fileTypes=[];this._extenders=Object.create(null);this._changed=new d.Signal(this);this._isDisposed=false;const t=e.textModelFactory;this.translator=e.translator||r.nullTranslator;if(t&&t.name!=="text"){throw new Error("Text model factory must have the name `text`")}this._modelFactories["text"]=t||new v(true);const n=e.initialFileTypes||T.getDefaultFileTypes(this.translator);n.forEach((e=>{const t={...T.getFileTypeDefaults(this.translator),...e};this._fileTypes.push(t)}))}get changed(){return this._changed}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;for(const e in this._modelFactories){this._modelFactories[e].dispose()}for(const e in this._widgetFactories){this._widgetFactories[e].dispose()}for(const e in this._extenders){this._extenders[e].length=0}this._fileTypes.length=0;d.Signal.clearData(this)}addWidgetFactory(e){const t=e.name.toLowerCase();if(!t||t==="default"){throw Error("Invalid factory name")}if(this._widgetFactories[t]){console.warn(`Duplicate registered factory ${t}`);return new l.DisposableDelegate(M.noOp)}this._widgetFactories[t]=e;for(const n of e.defaultFor||[]){if(e.fileTypes.indexOf(n)===-1){continue}if(n==="*"){this._defaultWidgetFactory=t}else{this._defaultWidgetFactories[n]=t}}for(const n of e.defaultRendered||[]){if(e.fileTypes.indexOf(n)===-1){continue}this._defaultRenderedWidgetFactories[n]=t}for(const n of e.fileTypes){if(!this._widgetFactoriesForFileType[n]){this._widgetFactoriesForFileType[n]=[]}this._widgetFactoriesForFileType[n].push(t)}this._changed.emit({type:"widgetFactory",name:t,change:"added"});return new l.DisposableDelegate((()=>{delete this._widgetFactories[t];if(this._defaultWidgetFactory===t){this._defaultWidgetFactory=""}for(const e of Object.keys(this._defaultWidgetFactories)){if(this._defaultWidgetFactories[e]===t){delete this._defaultWidgetFactories[e]}}for(const e of Object.keys(this._defaultRenderedWidgetFactories)){if(this._defaultRenderedWidgetFactories[e]===t){delete this._defaultRenderedWidgetFactories[e]}}for(const e of Object.keys(this._widgetFactoriesForFileType)){E.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[e],t);if(this._widgetFactoriesForFileType[e].length===0){delete this._widgetFactoriesForFileType[e]}}for(const e of Object.keys(this._defaultWidgetFactoryOverrides)){if(this._defaultWidgetFactoryOverrides[e]===t){delete this._defaultWidgetFactoryOverrides[e]}}this._changed.emit({type:"widgetFactory",name:t,change:"removed"})}))}addModelFactory(e){const t=e.name.toLowerCase();if(this._modelFactories[t]){console.warn(`Duplicate registered factory ${t}`);return new l.DisposableDelegate(M.noOp)}this._modelFactories[t]=e;this._changed.emit({type:"modelFactory",name:t,change:"added"});return new l.DisposableDelegate((()=>{delete this._modelFactories[t];this._changed.emit({type:"modelFactory",name:t,change:"removed"})}))}addWidgetExtension(e,t){e=e.toLowerCase();if(!(e in this._extenders)){this._extenders[e]=[]}const n=this._extenders[e];const i=E.ArrayExt.firstIndexOf(n,t);if(i!==-1){console.warn(`Duplicate registered extension for ${e}`);return new l.DisposableDelegate(M.noOp)}this._extenders[e].push(t);this._changed.emit({type:"widgetExtension",name:e,change:"added"});return new l.DisposableDelegate((()=>{E.ArrayExt.removeFirstOf(this._extenders[e],t);this._changed.emit({type:"widgetExtension",name:e,change:"removed"})}))}addFileType(e,t){const n={...T.getFileTypeDefaults(this.translator),...e,...!(e.icon||e.iconClass)&&{icon:I.fileIcon}};this._fileTypes.push(n);if(t){const e=n.name.toLowerCase();t.map((e=>e.toLowerCase())).forEach((t=>{if(!this._widgetFactoriesForFileType[e]){this._widgetFactoriesForFileType[e]=[]}if(!this._widgetFactoriesForFileType[e].includes(t)){this._widgetFactoriesForFileType[e].push(t)}}));if(!this._defaultWidgetFactories[e]){this._defaultWidgetFactories[e]=this._widgetFactoriesForFileType[e][0]}}this._changed.emit({type:"fileType",name:n.name,change:"added"});return new l.DisposableDelegate((()=>{E.ArrayExt.removeFirstOf(this._fileTypes,n);if(t){const e=n.name.toLowerCase();for(const n of t.map((e=>e.toLowerCase()))){E.ArrayExt.removeFirstOf(this._widgetFactoriesForFileType[e],n)}if(this._defaultWidgetFactories[e]===t[0].toLowerCase()){delete this._defaultWidgetFactories[e]}}this._changed.emit({type:"fileType",name:e.name,change:"removed"})}))}preferredWidgetFactories(e){const t=new Set;const n=this.getFileTypesForPath(s.PathExt.basename(e));n.forEach((e=>{if(e.name in this._defaultWidgetFactoryOverrides){t.add(this._defaultWidgetFactoryOverrides[e.name])}}));n.forEach((e=>{if(e.name in this._defaultWidgetFactories){t.add(this._defaultWidgetFactories[e.name])}}));n.forEach((e=>{if(e.name in this._defaultRenderedWidgetFactories){t.add(this._defaultRenderedWidgetFactories[e.name])}}));if(this._defaultWidgetFactory){t.add(this._defaultWidgetFactory)}for(const s of n){if(s.name in this._widgetFactoriesForFileType){for(const e of this._widgetFactoriesForFileType[s.name]){t.add(e)}}}if("*"in this._widgetFactoriesForFileType){for(const e of this._widgetFactoriesForFileType["*"]){t.add(e)}}const i=[];for(const s of t){const e=this._widgetFactories[s];if(!e){continue}const t=e.modelName||"text";if(t in this._modelFactories){i.push(e)}}return i}defaultRenderedWidgetFactory(e){const t=this.getFileTypesForPath(s.PathExt.basename(e)).map((e=>e.name));for(const n in t){if(n in this._defaultWidgetFactoryOverrides){return this._widgetFactories[this._defaultWidgetFactoryOverrides[n]]}}for(const n in t){if(n in this._defaultRenderedWidgetFactories){return this._widgetFactories[this._defaultRenderedWidgetFactories[n]]}}return this.defaultWidgetFactory(e)}defaultWidgetFactory(e){if(!e){return this._widgetFactories[this._defaultWidgetFactory]}return this.preferredWidgetFactories(e)[0]}setDefaultWidgetFactory(e,t){e=e.toLowerCase();if(!this.getFileType(e)){throw Error(`Cannot find file type ${e}`)}if(!t){if(this._defaultWidgetFactoryOverrides[e]){delete this._defaultWidgetFactoryOverrides[e]}return}if(!this.getWidgetFactory(t)){throw Error(`Cannot find widget factory ${t}`)}t=t.toLowerCase();const n=this._widgetFactoriesForFileType[e];if(t!==this._defaultWidgetFactory&&!(n&&n.includes(t))){throw Error(`Factory ${t} cannot view file type ${e}`)}this._defaultWidgetFactoryOverrides[e]=t}*widgetFactories(){for(const e in this._widgetFactories){yield this._widgetFactories[e]}}*modelFactories(){for(const e in this._modelFactories){yield this._modelFactories[e]}}*widgetExtensions(e){e=e.toLowerCase();if(e in this._extenders){for(const t of this._extenders[e]){yield t}}}*fileTypes(){for(const e of this._fileTypes){yield e}}getWidgetFactory(e){return this._widgetFactories[e.toLowerCase()]}getModelFactory(e){return this._modelFactories[e.toLowerCase()]}getFileType(e){e=e.toLowerCase();return(0,E.find)(this._fileTypes,(t=>t.name.toLowerCase()===e))}getKernelPreference(e,t,n){t=t.toLowerCase();const i=this._widgetFactories[t];if(!i){return void 0}const o=this.getModelFactory(i.modelName||"text");if(!o){return void 0}const r=o.preferredLanguage(s.PathExt.basename(e));const a=n&&n.name;const l=n&&n.id;return{id:l,name:a,language:r,shouldStart:i.preferKernel,canStart:i.canStartKernel,shutdownOnDispose:i.shutdownOnClose,autoStartDefault:i.autoStartDefault}}getFileTypeForModel(e){let t=null;if(e.name||e.path){const n=e.name||s.PathExt.basename(e.path);const i=this.getFileTypesForPath(n);if(i.length>0){t=i[0]}}switch(e.type){case"directory":if(t!==null&&t.contentType==="directory"){return t}return(0,E.find)(this._fileTypes,(e=>e.contentType==="directory"))||T.getDefaultDirectoryFileType(this.translator);case"notebook":if(t!==null&&t.contentType==="notebook"){return t}return(0,E.find)(this._fileTypes,(e=>e.contentType==="notebook"))||T.getDefaultNotebookFileType(this.translator);default:if(t!==null){return t}return this.getFileType("text")||T.getDefaultTextFileType(this.translator)}}getFileTypesForPath(e){const t=[];const n=s.PathExt.basename(e);let i=(0,E.find)(this._fileTypes,(e=>!!(e.pattern&&n.match(e.pattern)!==null)));if(i){t.push(i)}let o=M.extname(n);while(o.length>1){const e=this._fileTypes.filter((e=>e.extensions.map((e=>e.toLowerCase())).includes(o)));t.push(...e);o="."+o.split(".").slice(2).join(".")}return t}}(function(e){function t(e){e=e||r.nullTranslator;const t=e===null||e===void 0?void 0:e.load("jupyterlab");return{name:"default",displayName:t.__("default"),extensions:[],mimeTypes:[],contentType:"file",fileFormat:"text"}}e.getFileTypeDefaults=t;function n(e){e=e||r.nullTranslator;const n=e===null||e===void 0?void 0:e.load("jupyterlab");const i=t(e);return{...i,name:"text",displayName:n.__("Text"),mimeTypes:["text/plain"],extensions:[".txt"],icon:I.fileIcon}}e.getDefaultTextFileType=n;function i(e){e=e||r.nullTranslator;const n=e===null||e===void 0?void 0:e.load("jupyterlab");return{...t(e),name:"notebook",displayName:n.__("Notebook"),mimeTypes:["application/x-ipynb+json"],extensions:[".ipynb"],contentType:"notebook",fileFormat:"json",icon:I.notebookIcon}}e.getDefaultNotebookFileType=i;function s(e){e=e||r.nullTranslator;const n=e===null||e===void 0?void 0:e.load("jupyterlab");return{...t(e),name:"directory",displayName:n.__("Directory"),extensions:[],mimeTypes:["text/directory"],contentType:"directory",icon:I.folderIcon}}e.getDefaultDirectoryFileType=s;function o(e){e=e||r.nullTranslator;const t=e===null||e===void 0?void 0:e.load("jupyterlab");return[n(e),i(e),s(e),{name:"markdown",displayName:t.__("Markdown File"),extensions:[".md"],mimeTypes:["text/markdown"],icon:I.markdownIcon},{name:"PDF",displayName:t.__("PDF File"),extensions:[".pdf"],mimeTypes:["application/pdf"],icon:I.pdfIcon},{name:"python",displayName:t.__("Python File"),extensions:[".py"],mimeTypes:["text/x-python"],icon:I.pythonIcon},{name:"json",displayName:t.__("JSON File"),extensions:[".json"],mimeTypes:["application/json"],icon:I.jsonIcon},{name:"jsonl",displayName:t.__("JSONLines File"),extensions:[".jsonl",".ndjson"],mimeTypes:["text/jsonl","application/jsonl","application/json-lines"],icon:I.jsonIcon},{name:"julia",displayName:t.__("Julia File"),extensions:[".jl"],mimeTypes:["text/x-julia"],icon:I.juliaIcon},{name:"csv",displayName:t.__("CSV File"),extensions:[".csv"],mimeTypes:["text/csv"],icon:I.spreadsheetIcon},{name:"tsv",displayName:t.__("TSV File"),extensions:[".tsv"],mimeTypes:["text/csv"],icon:I.spreadsheetIcon},{name:"r",displayName:t.__("R File"),mimeTypes:["text/x-rsrc"],extensions:[".R"],icon:I.rKernelIcon},{name:"yaml",displayName:t.__("YAML File"),mimeTypes:["text/x-yaml","text/yaml"],extensions:[".yaml",".yml"],icon:I.yamlIcon},{name:"svg",displayName:t.__("Image"),mimeTypes:["image/svg+xml"],extensions:[".svg"],icon:I.imageIcon,fileFormat:"base64"},{name:"tiff",displayName:t.__("Image"),mimeTypes:["image/tiff"],extensions:[".tif",".tiff"],icon:I.imageIcon,fileFormat:"base64"},{name:"jpeg",displayName:t.__("Image"),mimeTypes:["image/jpeg"],extensions:[".jpg",".jpeg"],icon:I.imageIcon,fileFormat:"base64"},{name:"gif",displayName:t.__("Image"),mimeTypes:["image/gif"],extensions:[".gif"],icon:I.imageIcon,fileFormat:"base64"},{name:"png",displayName:t.__("Image"),mimeTypes:["image/png"],extensions:[".png"],icon:I.imageIcon,fileFormat:"base64"},{name:"bmp",displayName:t.__("Image"),mimeTypes:["image/bmp"],extensions:[".bmp"],icon:I.imageIcon,fileFormat:"base64"},{name:"webp",displayName:t.__("Image"),mimeTypes:["image/webp"],extensions:[".webp"],icon:I.imageIcon,fileFormat:"base64"}]}e.getDefaultFileTypes=o})(T||(T={}));var M;(function(e){function t(e){const t=s.PathExt.basename(e).split(".");t.shift();const n="."+t.join(".");return n.toLowerCase()}e.extname=t;function n(){}e.noOp=n})(M||(M={}))},79010:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(79993);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},68201:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>w});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(87277);var l=n.n(a);var d=n(15615);var c=n.n(d);var h=n(61927);var u=n.n(h);var p=n(1143);var m=n.n(p);const g="jp-mod-searchable";const f="jp-mod-search-active";var v;(function(e){e.search="documentsearch:start";e.searchAndReplace="documentsearch:startWithReplace";e.findNext="documentsearch:highlightNext";e.findPrevious="documentsearch:highlightPrevious";e.end="documentsearch:end";e.toggleSearchInSelection="documentsearch:toggleSearchInSelection"})(v||(v={}));const _={id:"@jupyterlab/documentsearch-extension:labShellWidgetListener",description:"Active search on valid document",requires:[i.ILabShell,a.ISearchProviderRegistry],autoStart:true,activate:(e,t,n)=>{const i=e=>{if(!e){return}if(n.hasProvider(e)){e.addClass(g)}else{e.removeClass(g)}};n.changed.connect((()=>i(t.activeWidget)));t.activeChanged.connect(((e,t)=>{const n=t.oldValue;if(n){n.removeClass(g)}i(t.newValue)}))}};class b{constructor(e){this._commandRegistry=e;this._cache=this._buildCache();this._commandRegistry.keyBindingChanged.connect(this._rebuildCache,this)}get next(){return this._cache.next}get previous(){return this._cache.previous}get toggleSearchInSelection(){return this._cache.toggleSearchInSelection}_rebuildCache(){this._cache=this._buildCache()}_buildCache(){const e=this._commandRegistry.keyBindings.find((e=>e.command===v.findNext));const t=this._commandRegistry.keyBindings.find((e=>e.command===v.findPrevious));const n=this._commandRegistry.keyBindings.find((e=>e.command===v.toggleSearchInSelection));return{next:e,previous:t,toggleSearchInSelection:n}}dispose(){this._commandRegistry.keyBindingChanged.disconnect(this._rebuildCache,this)}}const y={id:"@jupyterlab/documentsearch-extension:plugin",description:"Provides the document search registry.",provides:a.ISearchProviderRegistry,requires:[h.ITranslator],optional:[o.ICommandPalette,d.ISettingRegistry],autoStart:true,activate:(e,t,n,i)=>{var s;const r=t.load("jupyterlab");let l=500;let d="never";const c=new a.SearchProviderRegistry(t);const h=new Map;if(i){const t=i.load(y.id);const n=e=>{l=e.get("searchDebounceTime").composite;d=e.get("autoSearchInSelection").composite};Promise.all([t,e.restored]).then((([e])=>{n(e);e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}const u=()=>{const t=e.shell.currentWidget;if(!t){return false}return c.hasProvider(t)};const m=n=>{if(!n){return}const i=n.id;let s=h.get(i);if(!s){const o=c.getProvider(n);if(!o){return}const r=new a.SearchDocumentModel(o,l);const d=new b(e.commands);const u=new a.SearchDocumentView(r,t,d);h.set(i,u);[v.findNext,v.findPrevious,v.end,v.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)}));u.closed.connect((()=>{if(!n.isDisposed){n.activate();n.removeClass(f)}}));u.disposed.connect((()=>{if(!n.isDisposed){n.activate();n.removeClass(f)}h.delete(i);[v.findNext,v.findPrevious,v.end,v.toggleSearchInSelection].forEach((t=>{e.commands.notifyCommandChanged(t)}))}));n.disposed.connect((()=>{u.dispose();r.dispose();o.dispose();d.dispose()}));s=u}if(!s.isAttached){p.Widget.attach(s,n.node);n.addClass(f);if(n instanceof o.MainAreaWidget){s.node.style.top=`${n.toolbar.node.getBoundingClientRect().height+n.contentHeader.node.getBoundingClientRect().height}px`}if(s.model.searchExpression){s.model.refresh()}}return s};e.commands.addCommand(v.search,{label:r.__("Find…"),isEnabled:u,execute:async t=>{const n=m(e.shell.currentWidget);if(n){const e=t["searchText"];if(e){n.setSearchText(e)}else{n.setSearchText(n.model.suggestedInitialQuery)}const i=n.model.selectionState;let s=false;switch(d){case"multiple-selected":s=i==="multiple";break;case"any-selected":s=i==="multiple"||i==="single";break;case"never":break}if(s){await n.model.setFilter("selection",true)}n.focusSearchInput()}}});e.commands.addCommand(v.searchAndReplace,{label:r.__("Find and Replace…"),isEnabled:u,execute:t=>{const n=m(e.shell.currentWidget);if(n){const e=t["searchText"];if(e){n.setSearchText(e)}else{n.setSearchText(n.model.suggestedInitialQuery)}const i=t["replaceText"];if(i){n.setReplaceText(i)}n.showReplace();n.focusSearchInput()}}});e.commands.addCommand(v.findNext,{label:r.__("Find Next"),isEnabled:()=>!!e.shell.currentWidget&&h.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;if(!n){return}await((t=h.get(n.id))===null||t===void 0?void 0:t.model.highlightNext())}});e.commands.addCommand(v.findPrevious,{label:r.__("Find Previous"),isEnabled:()=>!!e.shell.currentWidget&&h.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;if(!n){return}await((t=h.get(n.id))===null||t===void 0?void 0:t.model.highlightPrevious())}});e.commands.addCommand(v.end,{label:r.__("End Search"),isEnabled:()=>!!e.shell.currentWidget&&h.has(e.shell.currentWidget.id),execute:async()=>{var t;const n=e.shell.currentWidget;if(!n){return}(t=h.get(n.id))===null||t===void 0?void 0:t.close()}});e.commands.addCommand(v.toggleSearchInSelection,{label:r.__("Search in Selection"),isEnabled:()=>!!e.shell.currentWidget&&h.has(e.shell.currentWidget.id)&&"selection"in h.get(e.shell.currentWidget.id).model.filtersDefinition,execute:async()=>{var t;const n=e.shell.currentWidget;if(!n){return}const i=(t=h.get(n.id))===null||t===void 0?void 0:t.model;if(!i){return}const s=i.filters["selection"];return i.setFilter("selection",!s)}});(s=e.shell.currentChanged)===null||s===void 0?void 0:s.connect((()=>{Object.values(v).forEach((t=>{e.commands.notifyCommandChanged(t)}))}));if(n){[v.search,v.findNext,v.findPrevious,v.end,v.toggleSearchInSelection].forEach((e=>{n.addItem({command:e,category:r.__("Main Area")})}))}return c}};const w=[y,_]},13067:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(3579);var r=n(19562)},42866:(e,t,n)=>{"use strict";n.r(t);n.d(t,{FOUND_CLASSES:()=>a,GenericSearchProvider:()=>c,HTMLSearchEngine:()=>d,ISearchProviderRegistry:()=>se,SearchDocumentModel:()=>g,SearchDocumentView:()=>ee,SearchProvider:()=>o,SearchProviderRegistry:()=>ne,TextSearchEngine:()=>u});var i=n(1143);var s=n(2336);class o{constructor(e){this.widget=e;this._stateChanged=new s.Signal(this);this._filtersChanged=new s.Signal(this);this._disposed=false}get stateChanged(){return this._stateChanged}get filtersChanged(){return this._filtersChanged}get currentMatchIndex(){return null}get isDisposed(){return this._disposed}get matchesCount(){return null}dispose(){if(this._disposed){return}this._disposed=true;s.Signal.clearData(this)}getInitialQuery(){return""}getFilters(){return{}}static preserveCase(e,t){if(e.toUpperCase()===e){return t.toUpperCase()}if(e.toLowerCase()===e){return t.toLowerCase()}if(r(e)===e){return r(t)}return t}}function r([e="",...t]){return e.toUpperCase()+""+t.join("").toLowerCase()}const a=["cm-string","cm-overlay","cm-searching"];const l=["CodeMirror-selectedtext"];class d{static search(e,t){if(!(t instanceof Node)){console.warn("Unable to search with HTMLSearchEngine the provided object.",t);return Promise.resolve([])}if(!e.global){e=new RegExp(e.source,e.flags+"g")}const n=[];const i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:n=>{let i=n.parentElement;while(i!==t){if(i.nodeName in d.UNSUPPORTED_ELEMENTS){return NodeFilter.FILTER_REJECT}i=i.parentElement}return e.test(n.textContent)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT}});let s=null;while((s=i.nextNode())!==null){e.lastIndex=0;let t=null;while((t=e.exec(s.textContent))!==null){n.push({text:t[0],position:t.index,node:s})}}return Promise.resolve(n)}}d.UNSUPPORTED_ELEMENTS={BASE:true,HEAD:true,LINK:true,META:true,STYLE:true,TITLE:true,BODY:true,AREA:true,AUDIO:true,IMG:true,MAP:true,TRACK:true,VIDEO:true,APPLET:true,EMBED:true,IFRAME:true,NOEMBED:true,OBJECT:true,PARAM:true,PICTURE:true,SOURCE:true,CANVAS:true,NOSCRIPT:true,SCRIPT:true,svg:true,SVG:true};class c extends o{constructor(){super(...arguments);this.isReadOnly=true;this._matches=[];this._mutationObserver=new MutationObserver(this._onWidgetChanged.bind(this));this._markNodes=new Array}static isApplicable(e){return e instanceof i.Widget}static createNew(e,t,n){return new c(e)}get currentMatchIndex(){return this._currentMatchIndex>=0?this._currentMatchIndex:null}get currentMatch(){var e;return(e=this._matches[this._currentMatchIndex])!==null&&e!==void 0?e:null}get matches(){return this._matches?this._matches.map((e=>Object.assign({},e))):this._matches}get matchesCount(){return this._matches.length}clearHighlight(){if(this._currentMatchIndex>=0){const e=this._markNodes[this._currentMatchIndex];e.classList.remove(...l)}this._currentMatchIndex=-1;return Promise.resolve()}dispose(){if(this.isDisposed){return}this.endQuery().catch((e=>{console.error(`Failed to end search query.`,e)}));super.dispose()}async highlightNext(e){var t;return(t=this._highlightNext(false,e!==null&&e!==void 0?e:true))!==null&&t!==void 0?t:undefined}async highlightPrevious(e){var t;return(t=this._highlightNext(true,e!==null&&e!==void 0?e:true))!==null&&t!==void 0?t:undefined}async replaceCurrentMatch(e,t){return Promise.resolve(false)}async replaceAllMatches(e){return Promise.resolve(false)}async startQuery(e,t={}){await this.endQuery();this._query=e;if(e===null){return Promise.resolve()}const n=await d.search(e,this.widget.node);let i=0;while(i{const i=document.createElement("mark");i.classList.add(...a);i.textContent=n.text;const s=e.splitText(n.position);s.textContent=s.textContent.slice(n.text.length);t.insertBefore(i,s);return i}));for(let n=o.length-1;n>=0;n--){this._markNodes.push(o[n])}}this._mutationObserver.observe(this.widget.node,{attributes:false,characterData:true,childList:true,subtree:true});this._matches=n}async endQuery(){this._mutationObserver.disconnect();this._markNodes.forEach((e=>{const t=e.parentNode;t.replaceChild(document.createTextNode(e.textContent),e);t.normalize()}));this._markNodes=[];this._matches=[];this._currentMatchIndex=-1}_highlightNext(e,t){if(this._matches.length===0){return null}if(this._currentMatchIndex===-1){this._currentMatchIndex=e?this.matches.length-1:0}else{const n=this._markNodes[this._currentMatchIndex];n.classList.remove(...l);this._currentMatchIndex=e?this._currentMatchIndex-1:this._currentMatchIndex+1;if(t&&(this._currentMatchIndex<0||this._currentMatchIndex>=this._matches.length)){this._currentMatchIndex=(this._currentMatchIndex+this._matches.length)%this._matches.length}}if(this._currentMatchIndex>=0&&this._currentMatchIndex=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.left>=0&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}const u={search(e,t){if(typeof t!=="string"){try{t=JSON.stringify(t)}catch(s){console.warn("Unable to search with TextSearchEngine non-JSON serializable object.",s,t);return Promise.resolve([])}}if(!e.global){e=new RegExp(e.source,e.flags+"g")}const n=new Array;let i=null;while((i=e.exec(t))!==null){n.push({text:i[0],position:i.index})}return Promise.resolve(n)}};var p=n(66127);var m=n(26568);class g extends p.VDomModel{constructor(e,t){super();this.searchProvider=e;this._caseSensitive=false;this._disposed=new s.Signal(this);this._parsingError="";this._preserveCase=false;this._initialQuery="";this._filters={};this._replaceText="";this._searchActive=false;this._searchExpression="";this._useRegex=false;this._wholeWords=false;this._filters={};if(this.searchProvider.getFilters){const e=this.searchProvider.getFilters();for(const t in e){this._filters[t]=e[t].default}}e.stateChanged.connect(this._onProviderStateChanged,this);this._searchDebouncer=new m.Debouncer((()=>{this._updateSearch().catch((e=>{console.error("Failed to update search on document.",e)}))}),t)}get caseSensitive(){return this._caseSensitive}set caseSensitive(e){if(this._caseSensitive!==e){this._caseSensitive=e;this.stateChanged.emit();this.refresh()}}get currentIndex(){return this.searchProvider.currentMatchIndex}get disposed(){return this._disposed}get filters(){return this._filters}get filtersDefinition(){var e,t,n;return(n=(t=(e=this.searchProvider).getFilters)===null||t===void 0?void 0:t.call(e))!==null&&n!==void 0?n:{}}get filtersDefinitionChanged(){return this.searchProvider.filtersChanged||null}get initialQuery(){return this._initialQuery}set initialQuery(e){this._initialQuery=e}get suggestedInitialQuery(){return this.searchProvider.getInitialQuery()}get selectionState(){return this.searchProvider.getSelectionState?this.searchProvider.getSelectionState():undefined}get isReadOnly(){return this.searchProvider.isReadOnly}get replaceOptionsSupport(){return this.searchProvider.replaceOptionsSupport}get parsingError(){return this._parsingError}get preserveCase(){return this._preserveCase}set preserveCase(e){if(this._preserveCase!==e){this._preserveCase=e;this.stateChanged.emit();this.refresh()}}get replaceText(){return this._replaceText}set replaceText(e){if(this._replaceText!==e){this._replaceText=e;this.stateChanged.emit()}}get searchExpression(){return this._searchExpression}set searchExpression(e){if(this._searchExpression!==e){this._searchExpression=e;this.stateChanged.emit();this.refresh()}}get totalMatches(){return this.searchProvider.matchesCount}get useRegex(){return this._useRegex}set useRegex(e){if(this._useRegex!==e){this._useRegex=e;this.stateChanged.emit();this.refresh()}}get wholeWords(){return this._wholeWords}set wholeWords(e){if(this._wholeWords!==e){this._wholeWords=e;this.stateChanged.emit();this.refresh()}}dispose(){if(this.isDisposed){return}if(this._searchExpression){this.endQuery().catch((e=>{console.error(`Failed to end query '${this._searchExpression}.`,e)}))}this.searchProvider.stateChanged.disconnect(this._onProviderStateChanged,this);this._searchDebouncer.dispose();super.dispose()}async endQuery(){this._searchActive=false;await this.searchProvider.endQuery();this.stateChanged.emit()}async highlightNext(){await this.searchProvider.highlightNext();this.stateChanged.emit()}async highlightPrevious(){await this.searchProvider.highlightPrevious();this.stateChanged.emit()}refresh(){this._searchDebouncer.invoke().catch((e=>{console.error("Failed to invoke search document debouncer.",e)}))}async replaceAllMatches(){await this.searchProvider.replaceAllMatches(this._replaceText,{preserveCase:this.preserveCase,regularExpression:this.useRegex});this.stateChanged.emit()}async replaceCurrentMatch(){await this.searchProvider.replaceCurrentMatch(this._replaceText,true,{preserveCase:this.preserveCase,regularExpression:this.useRegex});this.stateChanged.emit()}async setFilter(e,t){if(this._filters[e]!==t){if(this.searchProvider.validateFilter){this._filters[e]=await this.searchProvider.validateFilter(e,t);if(this._filters[e]===t){this.stateChanged.emit();this.refresh()}}else{this._filters[e]=t;this.stateChanged.emit();this.refresh()}}}async _updateSearch(){if(this._parsingError){this._parsingError="";this.stateChanged.emit()}try{const e=this.searchExpression?f.parseQuery(this.searchExpression,this.caseSensitive,this.useRegex,this.wholeWords):null;if(e){this._searchActive=true;await this.searchProvider.startQuery(e,this._filters)}else{this._searchActive=false;await this.searchProvider.endQuery()}this.stateChanged.emit()}catch(e){this._parsingError=e.toString();this.stateChanged.emit();console.error(`Failed to parse expression ${this.searchExpression}`,e)}}_onProviderStateChanged(){if(this._searchActive){this.refresh()}}}var f;(function(e){function t(e,t,n,i){const s=t?"gm":"gim";let o=n?e:e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&");if(i){o="\\b"+o+"\\b"}const r=new RegExp(o,s);if(r.test("")){return null}return r}e.parseQuery=t})(f||(f={}));var v=n(61927);var _=n(93247);var b=n(72050);var y=n(44914);const w="jp-DocumentSearch-overlay";const C="jp-DocumentSearch-overlay-row";const x="jp-DocumentSearch-input";const S="jp-DocumentSearch-input-label";const k="jp-DocumentSearch-input-wrapper";const j="jp-DocumentSearch-input-button-off";const I="jp-DocumentSearch-input-button-on";const E="jp-DocumentSearch-index-counter";const T="jp-DocumentSearch-up-down-wrapper";const M="jp-DocumentSearch-up-down-button";const D="jp-DocumentSearch-filter-button";const A="jp-DocumentSearch-filter-button-enabled";const P="jp-DocumentSearch-regex-error";const L="jp-DocumentSearch-search-options";const R="jp-DocumentSearch-search-filter-disabled";const N="jp-DocumentSearch-search-filter";const O="jp-DocumentSearch-replace-button";const B="jp-DocumentSearch-replace-button-wrapper";const F="jp-DocumentSearch-replace-wrapper-class";const z="jp-DocumentSearch-replace-toggle";const H="jp-DocumentSearch-toggle-wrapper";const W="jp-DocumentSearch-toggle-placeholder";const V="jp-DocumentSearch-button-content";const U="jp-DocumentSearch-button-wrapper";const q="jp-DocumentSearch-spacer";function $(e){const[t,n]=(0,y.useState)(1);const i=(0,y.useCallback)((t=>{var i;const s=t?t.target:(i=e.inputRef)===null||i===void 0?void 0:i.current;if(s){const e=s.value.split(/\n/);let t=e.reduce(((e,t)=>e.length>t.length?e:t),"");if(s.parentNode&&s.parentNode instanceof HTMLElement){s.parentNode.dataset.value=t}n(e.length)}}),[]);(0,y.useEffect)((()=>{var t,n;(n=(t=e.inputRef)===null||t===void 0?void 0:t.current)===null||n===void 0?void 0:n.select();i()}),[e.initialValue]);return y.createElement("label",{className:S},y.createElement("textarea",{onChange:t=>{e.onChange(t);i(t)},onKeyDown:t=>{e.onKeyDown(t);i(t)},rows:t,placeholder:e.placeholder,className:x,key:e.autoUpdate?e.initialValue:null,tabIndex:0,ref:e.inputRef,title:e.title,defaultValue:e.initialValue||e.lastSearchText,autoFocus:e.autoFocus}))}function K(e){var t;const n=((t=e.translator)!==null&&t!==void 0?t:v.nullTranslator).load("jupyterlab");const i=(0,p.classes)(e.caseSensitive?I:j,V);const s=(0,p.classes)(e.useRegex?I:j,V);const o=(0,p.classes)(e.wholeWords?I:j,V);const r=k;return y.createElement("div",{className:r},y.createElement($,{placeholder:n.__("Find"),onChange:t=>e.onChange(t),onKeyDown:t=>e.onKeydown(t),inputRef:e.inputRef,initialValue:e.initialSearchText,lastSearchText:e.lastSearchText,title:n.__("Find"),autoFocus:true,autoUpdate:true}),y.createElement("button",{className:U,onClick:()=>{e.onCaseSensitiveToggled()},tabIndex:0,title:n.__("Match Case")},y.createElement(p.caseSensitiveIcon.react,{className:i,tag:"span"})),y.createElement("button",{className:U,onClick:()=>e.onWordToggled(),tabIndex:0,title:n.__("Match Whole Word")},y.createElement(p.wordIcon.react,{className:o,tag:"span"})),y.createElement("button",{className:U,onClick:()=>e.onRegexToggled(),tabIndex:0,title:n.__("Use Regular Expression")},y.createElement(p.regexIcon.react,{className:s,tag:"span"})))}function J(e){var t,n,i;const s=((t=e.translator)!==null&&t!==void 0?t:v.nullTranslator).load("jupyterlab");const o=(0,p.classes)(e.preserveCase?I:j,V);return y.createElement("div",{className:F},y.createElement("div",{className:k},y.createElement($,{placeholder:s.__("Replace"),initialValue:(n=e.replaceText)!==null&&n!==void 0?n:"",onKeyDown:t=>e.onReplaceKeydown(t),onChange:t=>e.onChange(t),title:s.__("Replace"),autoFocus:false,autoUpdate:false}),((i=e.replaceOptionsSupport)===null||i===void 0?void 0:i.preserveCase)?y.createElement("button",{className:U,onClick:()=>e.onPreserveCaseToggled(),tabIndex:0,title:s.__("Preserve Case")},y.createElement(p.caseSensitiveIcon.react,{className:o,tag:"span"})):null),y.createElement("button",{className:B,onClick:()=>e.onReplaceCurrent(),tabIndex:0},y.createElement("span",{className:`${O} ${V}`,tabIndex:0},s.__("Replace"))),y.createElement("button",{className:B,tabIndex:0,onClick:()=>e.onReplaceAll()},y.createElement("span",{className:`${O} ${V}`,tabIndex:-1},s.__("Replace All"))))}function G(e){var t,n;const i=(t=e.keyBindings)===null||t===void 0?void 0:t.next;const s=(n=e.keyBindings)===null||n===void 0?void 0:n.previous;const o=i?_.CommandRegistry.formatKeystroke(i.keys):"";const r=s?_.CommandRegistry.formatKeystroke(s.keys):"";const a=r?` (${r})`:"";const l=o?` (${o})`:"";const d=y.createElement("button",{className:U,onClick:()=>e.isEnabled?e.onHighlightPrevious():false,tabIndex:0,title:`${e.trans.__("Previous Match")}${a}`,disabled:!e.isEnabled},y.createElement(p.caretUpEmptyThinIcon.react,{className:(0,p.classes)(M,V),tag:"span"}));const c=y.createElement("button",{className:U,onClick:()=>e.isEnabled?e.onHighlightNext():false,tabIndex:0,title:`${e.trans.__("Next Match")}${l}`,disabled:!e.isEnabled},y.createElement(p.caretDownEmptyThinIcon.react,{className:(0,p.classes)(M,V),tag:"span"}));return y.createElement("div",{className:T},d,c)}function Y(e){return y.createElement("div",{className:E},e.totalMatches===0?"-/-":`${e.currentIndex===null?"-":e.currentIndex+1}/${e.totalMatches}`)}function X(e){let t=`${D} ${V}`;if(e.visible){t=`${t} ${A}`}const n=e.anyEnabled?p.filterDotIcon:p.filterIcon;return y.createElement("button",{className:U,onClick:()=>e.toggleVisible(),tabIndex:0,title:e.visible?e.trans.__("Hide Search Filters"):e.trans.__("Show Search Filters")},y.createElement(n.react,{className:t,tag:"span",height:"20px",width:"20px"}))}function Q(e){return y.createElement("label",{className:e.isEnabled?N:`${N} ${R}`,title:e.description},y.createElement("input",{type:"checkbox",className:"jp-mod-styled",disabled:!e.isEnabled,checked:e.value,onChange:e.onToggle}),e.title)}class Z extends y.Component{constructor(e){super(e);this.translator=e.translator||v.nullTranslator}_onSearchChange(e){const t=e.target.value;this.props.onSearchChanged(t)}_onSearchKeydown(e){if(e.keyCode===13){e.stopPropagation();e.preventDefault();if(e.ctrlKey){const t=e.target;this._insertNewLine(t);this.props.onSearchChanged(t.value)}else{e.shiftKey?this.props.onHighlightPrevious():this.props.onHighlightNext()}}}_onReplaceKeydown(e){if(e.keyCode===13){e.stopPropagation();e.preventDefault();if(e.ctrlKey){this._insertNewLine(e.target)}else{this.props.onReplaceCurrent()}}}_insertNewLine(e){const[t,n]=[e.selectionStart,e.selectionEnd];e.setRangeText("\n",t,n,"end")}_onClose(){this.props.onClose()}_onReplaceToggled(){if(!this.props.replaceEntryVisible){for(const e in this.props.filtersDefinition){const t=this.props.filtersDefinition[e];if(!t.supportReplace){this.props.onFilterChanged(e,false).catch((e=>{console.error(`Fail to update filter value for ${t.title}:\n${e}`)}))}}}this.props.onReplaceEntryShown(!this.props.replaceEntryVisible)}_toggleFiltersVisibility(){this.props.onFiltersVisibilityChanged(!this.props.filtersVisible)}render(){var e,t,n;const i=this.translator.load("jupyterlab");const s=!this.props.isReadOnly&&this.props.replaceEntryVisible;const o=this.props.filtersDefinition;const r=Object.keys(o).length>0;const a=r?y.createElement(X,{visible:this.props.filtersVisible,anyEnabled:Object.keys(o).some((e=>{var t;const n=o[e];return(t=this.props.filters[e])!==null&&t!==void 0?t:n.default})),toggleVisible:()=>this._toggleFiltersVisibility(),trans:i}):null;const l=(e=this.props.keyBindings)===null||e===void 0?void 0:e.toggleSearchInSelection;const d=l?_.CommandRegistry.formatKeystroke(l.keys):"";const c=d?` (${d})`:"";const h=r?y.createElement("div",{className:L},Object.keys(o).map((e=>{var t,n;const i=o[e];const r=!s||i.supportReplace;const a=r?i.description:(t=i.disabledDescription)!==null&&t!==void 0?t:i.description;return y.createElement(Q,{key:e,title:i.title,description:a+(e=="selection"?c:""),isEnabled:r,onToggle:async()=>{await this.props.onFilterChanged(e,!this.props.filters[e])},value:(n=this.props.filters[e])!==null&&n!==void 0?n:i.default})}))):null;const u=this.props.replaceEntryVisible?p.caretDownIcon:p.caretRightIcon;return y.createElement(y.Fragment,null,y.createElement("div",{className:C},this.props.isReadOnly?y.createElement("div",{className:W}):y.createElement("button",{className:H,onClick:()=>this._onReplaceToggled(),tabIndex:0,title:s?i.__("Hide Replace"):i.__("Show Replace")},y.createElement(u.react,{className:`${z} ${V}`,tag:"span",elementPosition:"center",height:"20px",width:"20px"})),y.createElement(K,{inputRef:this.props.searchInputRef,useRegex:this.props.useRegex,caseSensitive:this.props.caseSensitive,wholeWords:this.props.wholeWords,onCaseSensitiveToggled:this.props.onCaseSensitiveToggled,onRegexToggled:this.props.onRegexToggled,onWordToggled:this.props.onWordToggled,onKeydown:e=>this._onSearchKeydown(e),onChange:e=>this._onSearchChange(e),initialSearchText:this.props.initialSearchText,lastSearchText:this.props.lastSearchText,translator:this.translator}),a,y.createElement(Y,{currentIndex:this.props.currentIndex,totalMatches:(t=this.props.totalMatches)!==null&&t!==void 0?t:0}),y.createElement(G,{onHighlightPrevious:()=>{this.props.onHighlightPrevious()},onHighlightNext:()=>{this.props.onHighlightNext()},trans:i,keyBindings:this.props.keyBindings,isEnabled:!!((n=this.props.searchInputRef.current)===null||n===void 0?void 0:n.value)}),y.createElement("button",{className:U,onClick:()=>this._onClose(),tabIndex:0,title:i.__("Close Search Box")},y.createElement(p.closeIcon.react,{className:"jp-icon-hover",elementPosition:"center",height:"16px",width:"16px"}))),y.createElement("div",{className:C},s?y.createElement(y.Fragment,null,y.createElement(J,{onPreserveCaseToggled:this.props.onPreserveCaseToggled,onReplaceKeydown:e=>this._onReplaceKeydown(e),onChange:e=>this.props.onReplaceChanged(e.target.value),onReplaceCurrent:()=>this.props.onReplaceCurrent(),onReplaceAll:()=>this.props.onReplaceAll(),replaceOptionsSupport:this.props.replaceOptionsSupport,replaceText:this.props.replaceText,preserveCase:this.props.preserveCase,translator:this.translator}),y.createElement("div",{className:q})):null),this.props.filtersVisible?h:null,!!this.props.errorMessage&&y.createElement("div",{className:P},this.props.errorMessage))}}class ee extends p.VDomRenderer{constructor(e,t,n){super(e);this.translator=t;this._showReplace=false;this._showFilters=false;this._closed=new s.Signal(this);this.addClass(w);this._searchInput=y.createRef();this._keyBindings=n}get closed(){return this._closed}focusSearchInput(){var e;(e=this._searchInput.current)===null||e===void 0?void 0:e.select()}setSearchText(e){this.model.initialQuery=e;if(e){this.model.searchExpression=e}}setReplaceText(e){this.model.replaceText=e}showReplace(){this.setReplaceInputVisibility(true)}onCloseRequest(e){super.onCloseRequest(e);this._closed.emit();void this.model.endQuery()}setReplaceInputVisibility(e){if(this._showReplace!==e){this._showReplace=e;this.update()}}setFiltersVisibility(e){if(this._showFilters!==e){this._showFilters=e;this.update()}}render(){return this.model.filtersDefinitionChanged?y.createElement(b.UseSignal,{signal:this.model.filtersDefinitionChanged},(()=>this._renderOverlay())):this._renderOverlay()}_renderOverlay(){return y.createElement(Z,{caseSensitive:this.model.caseSensitive,currentIndex:this.model.currentIndex,isReadOnly:this.model.isReadOnly,errorMessage:this.model.parsingError,filters:this.model.filters,filtersDefinition:this.model.filtersDefinition,preserveCase:this.model.preserveCase,replaceEntryVisible:this._showReplace,filtersVisible:this._showFilters,replaceOptionsSupport:this.model.replaceOptionsSupport,replaceText:this.model.replaceText,initialSearchText:this.model.initialQuery,lastSearchText:this.model.searchExpression,searchInputRef:this._searchInput,totalMatches:this.model.totalMatches,translator:this.translator,useRegex:this.model.useRegex,wholeWords:this.model.wholeWords,onCaseSensitiveToggled:()=>{this.model.caseSensitive=!this.model.caseSensitive},onRegexToggled:()=>{this.model.useRegex=!this.model.useRegex},onWordToggled:()=>{this.model.wholeWords=!this.model.wholeWords},onFilterChanged:async(e,t)=>{await this.model.setFilter(e,t)},onFiltersVisibilityChanged:e=>{this.setFiltersVisibility(e)},onHighlightNext:()=>{void this.model.highlightNext()},onHighlightPrevious:()=>{void this.model.highlightPrevious()},onPreserveCaseToggled:()=>{this.model.preserveCase=!this.model.preserveCase},onSearchChanged:e=>{this.model.searchExpression=e},onClose:()=>{this.close()},onReplaceEntryShown:e=>{this.setReplaceInputVisibility(e)},onReplaceChanged:e=>{this.model.replaceText=e},onReplaceCurrent:()=>{void this.model.replaceCurrentMatch()},onReplaceAll:()=>{void this.model.replaceAllMatches()},keyBindings:this._keyBindings})}}var te=n(90044);class ne{constructor(e=v.nullTranslator){this.translator=e;this._changed=new s.Signal(this);this._providerMap=new Map}add(e,t){this._providerMap.set(e,t);this._changed.emit();return new te.DisposableDelegate((()=>{this._providerMap.delete(e);this._changed.emit()}))}getProvider(e){for(const t of this._providerMap.values()){if(t.isApplicable(e)){return t.createNew(e,this.translator)}}return undefined}hasProvider(e){for(const t of this._providerMap.values()){if(t.isApplicable(e)){return true}}return false}get changed(){return this._changed}}var ie=n(5592);const se=new ie.Token("@jupyterlab/documentsearch:ISearchProviderRegistry",`A service for a registry of search\n providers for the application. Plugins can register their UI elements with this registry\n to provide find/replace support.`)},19562:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(20939);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},53316:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>_});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(65055);var l=n.n(a);var d=n(15615);var c=n.n(d);var h=n(61927);var u=n.n(h);var p=n(66127);var m=n.n(p);const g="@jupyterlab/extensionmanager-extension:plugin";var f;(function(e){e.showPanel="extensionmanager:show-panel";e.toggle="extensionmanager:toggle"})(f||(f={}));const v={id:g,description:"Adds the extension manager plugin.",autoStart:true,requires:[d.ISettingRegistry],optional:[h.ITranslator,i.ILayoutRestorer,o.ICommandPalette],activate:async(e,t,n,i,s)=>{const{commands:o,shell:r,serviceManager:l}=e;n=n!==null&&n!==void 0?n:h.nullTranslator;const d=n.load("jupyterlab");const c=new a.ListModel(l,n);const u=()=>{const e=new a.ExtensionsPanel({model:c,translator:n});e.id="extensionmanager.main-view";e.title.icon=p.extensionIcon;e.title.caption=d.__("Extension Manager");e.node.setAttribute("role","region");e.node.setAttribute("aria-label",d.__("Extension Manager section"));if(i){i.add(e,e.id)}r.add(e,"left",{rank:1e3});return e};let m=u();Promise.all([e.restored,t.load(g)]).then((([,t])=>{c.isDisclaimed=t.get("disclaimed").composite;c.isEnabled=t.get("enabled").composite;c.stateChanged.connect((()=>{if(c.isDisclaimed!==t.get("disclaimed").composite){t.set("disclaimed",c.isDisclaimed).catch((e=>{console.error(`Failed to set setting 'disclaimed'.\n${e}`)}))}if(c.isEnabled!==t.get("enabled").composite){t.set("enabled",c.isEnabled).catch((e=>{console.error(`Failed to set setting 'enabled'.\n${e}`)}))}}));if(c.isEnabled){m=m!==null&&m!==void 0?m:u()}else{m===null||m===void 0?void 0:m.dispose();m=null}t.changed.connect((async()=>{c.isDisclaimed=t.get("disclaimed").composite;c.isEnabled=t.get("enabled").composite;e.commands.notifyCommandChanged(f.toggle);if(c.isEnabled){if(m===null||!m.isAttached){const e=await b.showWarning(d);if(!e){void t.set("enabled",false);return}}m=m!==null&&m!==void 0?m:u()}else{m===null||m===void 0?void 0:m.dispose();m=null}}))})).catch((e=>{console.error(`Something went wrong when reading the settings.\n${e}`)}));o.addCommand(f.showPanel,{label:d.__("Extension Manager"),execute:()=>{if(m){r.activateById(m.id)}},isVisible:()=>c.isEnabled});o.addCommand(f.toggle,{label:d.__("Enable Extension Manager"),execute:()=>{if(t){void t.set(v.id,"enabled",!c.isEnabled)}},isToggled:()=>c.isEnabled});if(s){s.addItem({command:f.toggle,category:d.__("Extension Manager")})}}};const _=v;var b;(function(e){async function t(e){const t=await(0,o.showDialog)({title:e.__("Enable Extension Manager?"),body:e.__(`Thanks for trying out JupyterLab's extension manager.\nThe JupyterLab development team is excited to have a robust\nthird-party extension community.\nHowever, we cannot vouch for every extension,\nand some may introduce security risks.\nDo you want to continue?`),buttons:[o.Dialog.cancelButton({label:e.__("Disable")}),o.Dialog.warnButton({label:e.__("Enable")})]});return t.button.accept}e.showWarning=t})(b||(b={}))},67374:(e,t,n)=>{"use strict";var i=n(40662);var s=n(97913);var o=n(3579);var r=n(10395);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(40502);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},84468:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ExtensionsPanel:()=>I,ListModel:()=>p});var i=n(72050);var s=n(37737);var o=n(77256);var r=n(61927);var a=n(66127);var l=n(26568);var d=n(99589);var c=n(44914);function h(e,t,n){n=n||r.nullTranslator;const s=n.load("jupyterlab");const o=[];o.push(c.createElement("p",null,s.__(`An error occurred installing "${e}".`)));if(t){o.push(c.createElement("p",null,c.createElement("span",{className:"jp-extensionmanager-dialog-subheader"},s.__("Error message:"))),c.createElement("pre",null,t.trim()))}const a=c.createElement("div",{className:"jp-extensionmanager-dialog"},o);void(0,i.showDialog)({title:s.__("Extension Installation Error"),body:a,buttons:[i.Dialog.warnButton({label:s.__("Ok")})]})}const u="lab/api/extensions";class p extends a.VDomModel{constructor(e,t){super();this.actionError=null;this.installedError=null;this.searchError=null;this.promptReload=false;this._isDisclaimed=false;this._isEnabled=false;this._isLoadingInstalledExtensions=false;this._isSearching=false;this._query="";this._page=1;this._pagination=30;this._lastPage=1;this._pendingActions=[];const n=JSON.parse(s.PageConfig.getOption("extensionManager")||"{}");this.name=n.name;this.canInstall=n.can_install;this.installPath=n.install_path;this.translator=t||r.nullTranslator;this._installed=[];this._lastSearchResult=[];this.serviceManager=e;this._debouncedSearch=new l.Debouncer(this.search.bind(this),1e3)}get installed(){return this._installed}get isDisclaimed(){return this._isDisclaimed}set isDisclaimed(e){if(e!==this._isDisclaimed){this._isDisclaimed=e;this.stateChanged.emit();void this._debouncedSearch.invoke()}}get isEnabled(){return this._isEnabled}set isEnabled(e){if(e!==this._isEnabled){this._isEnabled=e;this.stateChanged.emit()}}get isLoadingInstalledExtensions(){return this._isLoadingInstalledExtensions}get isSearching(){return this._isSearching}get searchResult(){return this._lastSearchResult}get query(){return this._query}set query(e){if(this._query!==e){this._query=e;this._page=1;void this._debouncedSearch.invoke()}}get page(){return this._page}set page(e){if(this._page!==e){this._page=e;void this._debouncedSearch.invoke()}}get pagination(){return this._pagination}set pagination(e){if(this._pagination!==e){this._pagination=e;void this._debouncedSearch.invoke()}}get lastPage(){return this._lastPage}dispose(){if(this.isDisposed){return}this._debouncedSearch.dispose();super.dispose()}hasPendingActions(){return this._pendingActions.length>0}async install(e,t={}){await this.performAction("install",e,t).then((t=>{if(t.status!=="ok"){h(e.name,t.message,this.translator)}return this.update(true)}))}async uninstall(e){if(!e.installed){throw new Error(`Not installed, cannot uninstall: ${e.name}`)}await this.performAction("uninstall",e);return this.update(true)}async enable(e){if(e.enabled){throw new Error(`Already enabled: ${e.name}`)}await this.performAction("enable",e);await this.refreshInstalled(true)}async disable(e){if(!e.enabled){throw new Error(`Already disabled: ${e.name}`)}await this.performAction("disable",e);await this.refreshInstalled(true)}async refreshInstalled(e=false){this.installedError=null;this._isLoadingInstalledExtensions=true;this.stateChanged.emit();try{const[t]=await m.requestAPI({refresh:e?1:0});this._installed=t.sort(m.installedComparator)}catch(t){this.installedError=t.toString()}finally{this._isLoadingInstalledExtensions=false;this.stateChanged.emit()}}async search(e=false){var t,n;if(!this.isDisclaimed){return Promise.reject("Installation warning is not disclaimed.")}this.searchError=null;this._isSearching=true;this.stateChanged.emit();try{const[i,o]=await m.requestAPI({query:(t=this.query)!==null&&t!==void 0?t:"",page:this.page,per_page:this.pagination,refresh:e?1:0});const r=o["last"];if(r){const e=s.URLExt.queryStringToObject((n=s.URLExt.parse(r).search)!==null&&n!==void 0?n:"")["page"];if(e){this._lastPage=parseInt(e,10)}}const a=this._installed.map((e=>e.name));this._lastSearchResult=i.filter((e=>!a.includes(e.name)))}catch(i){this.searchError=i.toString()}finally{this._isSearching=false;this.stateChanged.emit()}}async update(e=false){if(this.isDisclaimed){await this.refreshInstalled(e);await this.search()}}performAction(e,t,n={}){const s={cmd:e,extension_name:t.name};if(n.useVersion){s["extension_version"]=n.useVersion}const o=m.requestAPI({},{method:"POST",body:JSON.stringify(s)});o.then((([e])=>{const t=this.translator.load("jupyterlab");if(e.needs_restart.includes("server")){void(0,i.showDialog)({title:t.__("Information"),body:t.__("You will need to restart JupyterLab to apply the changes."),buttons:[i.Dialog.okButton({label:t.__("Ok")})]})}else{const n=[];if(e.needs_restart.includes("frontend")){n.push(window.isElectron?t.__("reload JupyterLab"):t.__("refresh the web page"))}if(e.needs_restart.includes("kernel")){n.push(t.__("install the extension in all kernels and restart them"))}void(0,i.showDialog)({title:t.__("Information"),body:t.__("You will need to %1 to apply the changes.",n.join(t.__(" and "))),buttons:[i.Dialog.okButton({label:t.__("Ok")})]})}this.actionError=null}),(e=>{this.actionError=e.toString()}));this.addPendingAction(o);return o.then((([e])=>e))}addPendingAction(e){this._pendingActions.push(e);const t=()=>{const t=this._pendingActions.indexOf(e);this._pendingActions.splice(t,1);this.stateChanged.emit(undefined)};e.then(t,t);this.stateChanged.emit(undefined)}}(function(e){function t(e){if(!e.installed||!e.latest_version){return false}return d.lt(e.installed_version,e.latest_version)}e.entryHasUpdate=t})(p||(p={}));var m;(function(e){function t(e,t){return e.name.localeCompare(t.name)}e.installedComparator=t;const n=/<([^>]+)>; rel="([^"]+)",?/g;async function i(e={},t={}){var i;const r=o.ServerConnection.makeSettings();const a=s.URLExt.join(r.baseUrl,u);let l;try{l=await o.ServerConnection.makeRequest(a+s.URLExt.objectToQueryString(e),t,r)}catch(m){throw new o.ServerConnection.NetworkError(m)}let d=await l.text();if(d.length>0){try{d=JSON.parse(d)}catch(m){console.log("Not a JSON response body.",l)}}if(!l.ok){throw new o.ServerConnection.ResponseError(l,d.message||d)}const c=(i=l.headers.get("Link"))!==null&&i!==void 0?i:"";const h={};let p=null;while((p=n.exec(c))!==null){h[p[2]]=p[1]}return[d,h]}e.requestAPI=i})(m||(m={}));var g=n(49764);var f=n.n(g);const v=32;const _=Math.floor(devicePixelRatio*v);function b(e){if(e.homepage_url&&e.homepage_url.startsWith("https://github.com/")){return e.homepage_url.split("/")[3]}else if(e.repository_url&&e.repository_url.startsWith("https://github.com/")){return e.repository_url.split("/")[3]}return null}function y(e){const{canFetch:t,entry:n,supportInstallation:i,trans:s}=e;const o=[];if(n.status&&["ok","warning","error"].indexOf(n.status)!==-1){o.push(`jp-extensionmanager-entry-${n.status}`)}const r=t?b(n):null;if(!n.allowed){o.push(`jp-extensionmanager-entry-should-be-uninstalled`)}return c.createElement("li",{className:`jp-extensionmanager-entry ${o.join(" ")}`,style:{display:"flex"}},c.createElement("div",{style:{marginRight:"8px"}},r?c.createElement("img",{src:`https://github.com/${r}.png?size=${_}`,style:{width:"32px",height:"32px"}}):c.createElement("div",{style:{width:`${v}px`,height:`${v}px`}})),c.createElement("div",{className:"jp-extensionmanager-entry-description"},c.createElement("div",{className:"jp-extensionmanager-entry-title"},c.createElement("div",{className:"jp-extensionmanager-entry-name"},n.homepage_url?c.createElement("a",{href:n.homepage_url,target:"_blank",rel:"noopener noreferrer",title:s.__("%1 extension home page",n.name)},n.name):c.createElement("div",null,n.name)),c.createElement("div",{className:"jp-extensionmanager-entry-version"},c.createElement("div",{title:s.__("Version: %1",n.installed_version)},n.installed_version)),n.installed&&!n.allowed&&c.createElement(a.ToolbarButtonComponent,{icon:a.infoIcon,iconLabel:s.__("%1 extension is not allowed anymore. Please uninstall it immediately or contact your administrator.",n.name),onClick:()=>window.open("https://jupyterlab.readthedocs.io/en/stable/user/extensions.html")}),n.approved&&c.createElement(a.jupyterIcon.react,{className:"jp-extensionmanager-is-approved",top:"1px",height:"auto",width:"1em",title:s.__("This extension is approved by your security team.")})),c.createElement("div",{className:"jp-extensionmanager-entry-content"},c.createElement("div",{className:"jp-extensionmanager-entry-description"},n.description),e.performAction&&c.createElement("div",{className:"jp-extensionmanager-entry-buttons"},n.installed?c.createElement(c.Fragment,null,i&&c.createElement(c.Fragment,null,p.entryHasUpdate(n)&&c.createElement(a.Button,{onClick:()=>e.performAction("install",n,{useVersion:n.latest_version}),title:s.__('Update "%1" to "%2"',n.name,n.latest_version),minimal:true,small:true},s.__("Update to %1",n.latest_version)),c.createElement(a.Button,{onClick:()=>e.performAction("uninstall",n),title:s.__('Uninstall "%1"',n.name),minimal:true,small:true},s.__("Uninstall"))),n.enabled?c.createElement(a.Button,{onClick:()=>e.performAction("disable",n),title:s.__('Disable "%1"',n.name),minimal:true,small:true},s.__("Disable")):c.createElement(a.Button,{onClick:()=>e.performAction("enable",n),title:s.__('Enable "%1"',n.name),minimal:true,small:true},s.__("Enable"))):i&&c.createElement(a.Button,{onClick:()=>e.performAction("install",n),title:s.__('Install "%1"',n.name),minimal:true,small:true},s.__("Install"))))))}function w(e){var t;const{canFetch:n,performAction:i,supportInstallation:s,trans:o}=e;return c.createElement("div",{className:"jp-extensionmanager-listview-wrapper"},e.entries.length>0?c.createElement("ul",{className:"jp-extensionmanager-listview"},e.entries.map((e=>c.createElement(y,{key:e.name,canFetch:n,entry:e,performAction:i,supportInstallation:s,trans:o})))):c.createElement("div",{key:"message",className:"jp-extensionmanager-listview-message"},o.__("No entries")),e.numPages>1&&c.createElement("div",{className:"jp-extensionmanager-pagination"},c.createElement(f(),{previousLabel:"<",nextLabel:">",breakLabel:"...",breakClassName:"break",initialPage:((t=e.initialPage)!==null&&t!==void 0?t:1)-1,pageCount:e.numPages,marginPagesDisplayed:2,pageRangeDisplayed:3,onPageChange:t=>e.onPage(t.selected+1),activeClassName:"active"})))}function C(e){return c.createElement("div",{className:"jp-extensionmanager-error"},e.children)}class x extends a.ReactWidget{constructor(e,t,n){super();this.model=e;this.trans=t;this.searchInputRef=n;e.stateChanged.connect(this.update,this);this.addClass("jp-extensionmanager-header")}render(){return c.createElement(c.Fragment,null,c.createElement("div",{className:"jp-extensionmanager-title"},c.createElement("span",null,this.trans.__("%1 Manager",this.model.name)),this.model.installPath&&c.createElement(a.infoIcon.react,{className:"jp-extensionmanager-path",tag:"span",title:this.trans.__("Extension installation path: %1",this.model.installPath)})),c.createElement(a.FilterBox,{placeholder:this.trans.__("Search extensions"),disabled:!this.model.isDisclaimed,updateFilter:(e,t)=>{this.model.query=t!==null&&t!==void 0?t:""},useFuzzyFilter:false,inputRef:this.searchInputRef}),c.createElement("div",{className:`jp-extensionmanager-pending ${this.model.hasPendingActions()?"jp-mod-hasPending":""}`}),this.model.actionError&&c.createElement(C,null,c.createElement("p",null,this.trans.__("Error when performing an action.")),c.createElement("p",null,this.trans.__("Reason given:")),c.createElement("pre",null,this.model.actionError)))}}class S extends a.ReactWidget{constructor(e,t){super();this.model=e;this.trans=t;this.addClass("jp-extensionmanager-disclaimer");e.stateChanged.connect(this.update,this)}render(){return c.createElement(c.Fragment,null,c.createElement("p",null,this.trans.__(`The JupyterLab development team is excited to have a robust\nthird-party extension community. However, we do not review\nthird-party extensions, and some extensions may introduce security\nrisks or contain malicious code that runs on your machine. Moreover in order\nto work, this panel needs to fetch data from web services. Do you agree to\nactivate this feature?`),c.createElement("br",null),c.createElement("a",{href:"https://jupyterlab.readthedocs.io/en/stable/privacy_policies.html",target:"_blank",rel:"noreferrer"},this.trans.__("Please read the privacy policy."))),this.model.isDisclaimed?c.createElement(a.Button,{className:"jp-extensionmanager-disclaimer-disable",onClick:e=>{this.model.isDisclaimed=false},title:this.trans.__("This will withdraw your consent.")},this.trans.__("No")):c.createElement("div",null,c.createElement(a.Button,{className:"jp-extensionmanager-disclaimer-enable",onClick:()=>{this.model.isDisclaimed=true}},this.trans.__("Yes")),c.createElement(a.Button,{className:"jp-extensionmanager-disclaimer-disable",onClick:()=>{this.model.isEnabled=false},title:this.trans.__("This will disable the extension manager panel; including the listing of installed extension.")},this.trans.__("No, disable"))))}}class k extends a.ReactWidget{constructor(e,t){super();this.model=e;this.trans=t;e.stateChanged.connect(this.update,this)}render(){return c.createElement(c.Fragment,null,this.model.installedError!==null?c.createElement(C,null,`Error querying installed extensions${this.model.installedError?`: ${this.model.installedError}`:"."}`):this.model.isLoadingInstalledExtensions?c.createElement("div",{className:"jp-extensionmanager-loader"},this.trans.__("Updating extensions list…")):c.createElement(w,{canFetch:this.model.isDisclaimed,entries:this.model.installed.filter((e=>new RegExp(this.model.query.toLowerCase()).test(e.name))),numPages:1,trans:this.trans,onPage:e=>{},performAction:this.model.isDisclaimed?this.onAction.bind(this):null,supportInstallation:this.model.canInstall&&this.model.isDisclaimed}))}onAction(e,t,n={}){switch(e){case"install":return this.model.install(t,n);case"uninstall":return this.model.uninstall(t);case"enable":return this.model.enable(t);case"disable":return this.model.disable(t);default:throw new Error(`Invalid action: ${e}`)}}}class j extends a.ReactWidget{constructor(e,t){super();this.model=e;this.trans=t;e.stateChanged.connect(this.update,this)}onPage(e){this.model.page=e}onAction(e,t,n={}){switch(e){case"install":return this.model.install(t,n);case"uninstall":return this.model.uninstall(t);case"enable":return this.model.enable(t);case"disable":return this.model.disable(t);default:throw new Error(`Invalid action: ${e}`)}}render(){return c.createElement(c.Fragment,null,this.model.searchError!==null?c.createElement(C,null,`Error searching for extensions${this.model.searchError?`: ${this.model.searchError}`:"."}`):this.model.isSearching?c.createElement("div",{className:"jp-extensionmanager-loader"},this.trans.__("Updating extensions list…")):c.createElement(w,{canFetch:this.model.isDisclaimed,entries:this.model.searchResult,initialPage:this.model.page,numPages:this.model.lastPage,onPage:e=>{this.onPage(e)},performAction:this.model.isDisclaimed?this.onAction.bind(this):null,supportInstallation:this.model.canInstall&&this.model.isDisclaimed,trans:this.trans}))}update(){this.title.label=this.model.query?this.trans.__("Search Results"):this.trans.__("Discover");super.update()}}class I extends a.SidePanel{constructor(e){const{model:t,translator:n}=e;super({translator:n});this._wasInitialized=false;this._wasDisclaimed=true;this.model=t;this._searchInputRef=c.createRef();this.addClass("jp-extensionmanager-view");this.trans=n.load("jupyterlab");this.header.addWidget(new x(t,this.trans,this._searchInputRef));const i=new S(t,this.trans);i.title.label=this.trans.__("Warning");this.addWidget(i);const s=new a.PanelWithToolbar;s.addClass("jp-extensionmanager-installedlist");s.toolbar.node.setAttribute("aria-label",this.trans.__("Extensions panel toolbar"));s.title.label=this.trans.__("Installed");s.toolbar.addItem("refresh",new a.ToolbarButton({icon:a.refreshIcon,onClick:()=>{t.refreshInstalled(true).catch((e=>{console.error(`Failed to refresh the installed extensions list:\n${e}`)}))},tooltip:this.trans.__("Refresh extensions list")}));s.addWidget(new k(t,this.trans));this.addWidget(s);if(this.model.canInstall){const e=new j(t,this.trans);e.addClass("jp-extensionmanager-searchresults");this.addWidget(e)}this._wasDisclaimed=this.model.isDisclaimed;if(this.model.isDisclaimed){this.content.collapse(0);this.content.layout.setRelativeSizes([0,1,1])}else{this.content.expand(0);this.content.collapse(1);this.content.collapse(2)}this.model.stateChanged.connect(this._onStateChanged,this)}dispose(){if(this.isDisposed){return}this.model.stateChanged.disconnect(this._onStateChanged,this);super.dispose()}handleEvent(e){switch(e.type){case"focus":case"blur":this._toggleFocused();break;default:break}}onBeforeAttach(e){this.node.addEventListener("focus",this,true);this.node.addEventListener("blur",this,true);super.onBeforeAttach(e)}onBeforeShow(e){if(!this._wasInitialized){this._wasInitialized=true;this.model.refreshInstalled().catch((e=>{console.log(`Failed to refresh installed extension list:\n${e}`)}))}}onAfterDetach(e){super.onAfterDetach(e);this.node.removeEventListener("focus",this,true);this.node.removeEventListener("blur",this,true)}onActivateRequest(e){if(this.isAttached){const e=this._searchInputRef.current;if(e){if(e.focus){e.focus()}if(e.select){e.select()}}}super.onActivateRequest(e)}_onStateChanged(){if(!this._wasDisclaimed&&this.model.isDisclaimed){this.content.collapse(0);this.content.expand(1);this.content.expand(2)}this._wasDisclaimed=this.model.isDisclaimed}_toggleFocused(){const e=document.activeElement===this._searchInputRef.current;this.toggleClass("lm-mod-focused",e)}}},48934:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>U,fileUploadStatus:()=>z});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(37737);var l=n.n(a);var d=n(65189);var c=n.n(d);var h=n(45231);var u=n.n(h);var p=n(15615);var m=n.n(p);var g=n(86503);var f=n.n(g);var v=n(66987);var _=n.n(v);var b=n(61927);var y=n.n(b);var w=n(66127);var C=n.n(w);var x=n(34236);var S=n.n(x);var k=n(93247);var j=n.n(k);const I="FileBrowser";const E="@jupyterlab/filebrowser-extension:browser";var T;(function(e){e.copy="filebrowser:copy";e.copyDownloadLink="filebrowser:copy-download-link";e.cut="filebrowser:cut";e.del="filebrowser:delete";e.download="filebrowser:download";e.duplicate="filebrowser:duplicate";e.hideBrowser="filebrowser:hide-main";e.goToPath="filebrowser:go-to-path";e.goUp="filebrowser:go-up";e.openPath="filebrowser:open-path";e.openUrl="filebrowser:open-url";e.open="filebrowser:open";e.openBrowserTab="filebrowser:open-browser-tab";e.paste="filebrowser:paste";e.createNewDirectory="filebrowser:create-new-directory";e.createNewFile="filebrowser:create-new-file";e.createNewMarkdownFile="filebrowser:create-new-markdown-file";e.refresh="filebrowser:refresh";e.rename="filebrowser:rename";e.copyShareableLink="filebrowser:share-main";e.copyPath="filebrowser:copy-path";e.showBrowser="filebrowser:activate";e.shutdown="filebrowser:shutdown";e.toggleBrowser="filebrowser:toggle-main";e.toggleFileFilter="filebrowser:toggle-file-filter";e.toggleNavigateToCurrentDirectory="filebrowser:toggle-navigate-to-current-directory";e.toggleLastModified="filebrowser:toggle-last-modified";e.toggleShowFullPath="filebrowser:toggle-show-full-path";e.toggleFileSize="filebrowser:toggle-file-size";e.toggleSortNotebooksFirst="filebrowser:toggle-sort-notebooks-first";e.search="filebrowser:search";e.toggleHiddenFiles="filebrowser:toggle-hidden-files";e.toggleSingleClick="filebrowser:toggle-single-click-navigation";e.toggleFileCheckboxes="filebrowser:toggle-file-checkboxes"})(T||(T={}));const M="filebrowser";const D={id:E,description:"Set up the default file browser commands and state restoration",requires:[h.IDefaultFileBrowser,h.IFileBrowserFactory,b.ITranslator],optional:[i.ILayoutRestorer,p.ISettingRegistry,i.ITreePathUpdater,o.ICommandPalette],provides:h.IFileBrowserCommands,autoStart:true,activate:async(e,t,n,i,s,o,r,l)=>{const d=t;if(s){s.add(d,M)}const c=a.PageConfig.getOption("preferredPath");if(c){await d.model.cd(c)}W(e,d,n,i,o,l);void Promise.all([e.restored,d.model.restored]).then((()=>{if(r){d.model.pathChanged.connect(((e,t)=>{r(t.newValue)}))}}));return{openPath:T.openPath}}};const A={id:"@jupyterlab/filebrowser-extension:settings",description:"Set up the default file browser settings",requires:[h.IDefaultFileBrowser],optional:[p.ISettingRegistry],autoStart:true,activate:(e,t,n)=>{if(n){void n.load(E).then((e=>{const n={navigateToCurrentDirectory:false,singleClickNavigation:false,showLastModifiedColumn:true,showFileSizeColumn:false,showHiddenFiles:false,showFileCheckboxes:false,sortNotebooksFirst:false,showFullPath:false};function i(e){let i;for(i in n){const n=e.get(i).composite;t[i]=n}const s=e.get("filterDirectories").composite;const o=e.get("useFuzzyFilter").composite;t.model.filterDirectories=s;t.model.useFuzzyFilter=o}e.changed.connect(i);i(e)}))}}};const P={id:"@jupyterlab/filebrowser-extension:factory",description:"Provides the file browser factory.",provides:h.IFileBrowserFactory,requires:[d.IDocumentManager,b.ITranslator],optional:[g.IStateDB,i.JupyterLab.IInfo],activate:async(e,t,n,i,s)=>{const r=new o.WidgetTracker({namespace:M});const a=(e,o={})=>{var a;const l=o.state===null?undefined:o.state||i||undefined;const d=new h.FilterFileBrowserModel({translator:n,auto:(a=o.auto)!==null&&a!==void 0?a:true,manager:t,driveName:o.driveName||"",refreshInterval:o.refreshInterval,refreshStandby:()=>{if(s){return!s.isConnected||"when-hidden"}return"when-hidden"},state:l});const c=o.restore;const u=new h.FileBrowser({id:e,model:d,restore:c,translator:n,state:l});void r.add(u);return u};return{createFileBrowser:a,tracker:r}}};const L={id:"@jupyterlab/filebrowser-extension:default-file-browser",description:"Provides the default file browser",provides:h.IDefaultFileBrowser,requires:[h.IFileBrowserFactory],optional:[i.IRouter,i.JupyterFrontEnd.ITreeResolver,i.ILabShell,b.ITranslator],activate:async(e,t,n,i,s,o)=>{const{commands:r}=e;const a=(o!==null&&o!==void 0?o:b.nullTranslator).load("jupyterlab");const l=t.createFileBrowser("filebrowser",{auto:false,restore:false});l.node.setAttribute("role","region");l.node.setAttribute("aria-label",a.__("File Browser Section"));l.title.icon=w.folderIcon;const d=()=>{const t=e.commands.keyBindings.find((e=>e.command===T.toggleBrowser));if(t){const e=t.keys.map(k.CommandRegistry.formatKeystroke).join(", ");l.title.caption=a.__("File Browser (%1)",e)}else{l.title.caption=a.__("File Browser")}};d();e.commands.keyBindingChanged.connect((()=>{d()}));void q.restoreBrowser(l,r,n,i,e,s);return l}};const R={id:"@jupyterlab/filebrowser-extension:download",description:"Adds the download file commands. Disabling this plugin will NOT disable downloading files from the server, if the user enters the appropriate download URLs.",requires:[h.IFileBrowserFactory,b.ITranslator],autoStart:true,activate:(e,t,n)=>{const i=n.load("jupyterlab");const{commands:s}=e;const{tracker:r}=t;s.addCommand(T.download,{execute:()=>{const e=r.currentWidget;if(e){return e.download()}},icon:w.downloadIcon.bindprops({stylesheet:"menuItem"}),label:i.__("Download")});s.addCommand(T.copyDownloadLink,{execute:()=>{const e=r.currentWidget;if(!e){return}return e.model.manager.services.contents.getDownloadUrl(e.selectedItems().next().value.path).then((e=>{o.Clipboard.copyToSystem(e)}))},isVisible:()=>!!r.currentWidget&&Array.from(r.currentWidget.selectedItems()).length===1,icon:w.copyIcon.bindprops({stylesheet:"menuItem"}),label:i.__("Copy Download Link"),mnemonic:0})}};const N={id:"@jupyterlab/filebrowser-extension:widget",description:"Adds the file browser to the application shell.",requires:[d.IDocumentManager,h.IDefaultFileBrowser,h.IFileBrowserFactory,p.ISettingRegistry,o.IToolbarWidgetRegistry,b.ITranslator,i.ILabShell,h.IFileBrowserCommands],optional:[o.ICommandPalette],autoStart:true,activate:(e,t,n,i,s,r,a,l,d,c)=>{const{commands:u}=e;const{tracker:p}=i;const m=a.load("jupyterlab");r.addFactory(I,"uploader",(e=>new h.Uploader({model:e.model,translator:a})));(0,o.setToolbar)(n,(0,o.createToolbarFactory)(r,s,I,N.id,a));l.add(n,"left",{rank:100,type:"File Browser"});u.addCommand(T.toggleBrowser,{label:m.__("File Browser"),execute:()=>{if(n.isHidden){return u.execute(T.showBrowser,void 0)}return u.execute(T.hideBrowser,void 0)}});u.addCommand(T.showBrowser,{label:m.__("Open the file browser for the provided `path`."),execute:e=>{const t=e.path||"";const s=q.getBrowserForPath(t,n,i);if(!s){return}if(n===s){l.activateById(n.id);return}else{const e=["left","right"];for(const t of e){for(const e of l.widgets(t)){if(e.contains(s)){l.activateById(e.id);return}}}}}});u.addCommand(T.hideBrowser,{label:m.__("Hide the file browser."),execute:()=>{const e=p.currentWidget;if(e&&!e.isHidden){l.collapseLeft()}}});u.addCommand(T.toggleNavigateToCurrentDirectory,{label:m.__("Show Active File in File Browser"),isToggled:()=>n.navigateToCurrentDirectory,execute:()=>{const e=!n.navigateToCurrentDirectory;const t="navigateToCurrentDirectory";return s.set(E,t,e).catch((e=>{console.error(`Failed to set navigateToCurrentDirectory setting`)}))}});if(c){c.addItem({command:T.toggleNavigateToCurrentDirectory,category:m.__("File Operations")})}void l.restored.then((e=>{if(e.fresh&&l.mode!=="single-document"){void u.execute(T.showBrowser,void 0)}}));void Promise.all([e.restored,n.model.restored]).then((()=>{l.currentChanged.connect((async(e,s)=>{if(n.navigateToCurrentDirectory&&s.newValue){const{newValue:e}=s;const r=t.contextForWidget(e);if(r){const{path:e}=r;try{await q.navigateToPath(e,n,i,a)}catch(o){console.warn(`${T.goToPath} failed to open: ${e}`,o)}}}}))}))}};const O={id:"@jupyterlab/filebrowser-extension:share-file",description:'Adds the "Copy Shareable Link" command; useful for JupyterHub deployment for example.',requires:[h.IFileBrowserFactory,b.ITranslator],autoStart:true,activate:(e,t,n)=>{const i=n.load("jupyterlab");const{commands:s}=e;const{tracker:r}=t;s.addCommand(T.copyShareableLink,{execute:()=>{const e=r.currentWidget;const t=e===null||e===void 0?void 0:e.selectedItems().next();if(t===undefined||t.done){return}o.Clipboard.copyToSystem(a.PageConfig.getUrl({workspace:a.PageConfig.defaultWorkspace,treePath:t.value.path,toShare:true}))},isVisible:()=>!!r.currentWidget&&Array.from(r.currentWidget.selectedItems()).length===1,icon:w.linkIcon.bindprops({stylesheet:"menuItem"}),label:i.__("Copy Shareable Link")})}};const B={id:"@jupyterlab/filebrowser-extension:open-with",description:"Adds the open-with feature allowing an user to pick the non-preferred document viewer.",requires:[h.IFileBrowserFactory],autoStart:true,activate:(e,t)=>{const{docRegistry:n}=e;const{tracker:i}=t;let s=[];function o(e){var t,o;const r=(o=(t=e.menu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-contextmenu-open-with"})))===null||t===void 0?void 0:t.submenu)!==null&&o!==void 0?o:null;if(!r){return}s.forEach((e=>e.dispose()));s.length=0;r.clearItems();const a=i.currentWidget?q.OpenWith.intersection((0,x.map)(i.currentWidget.selectedItems(),(e=>q.OpenWith.getFactories(n,e)))):new Set;s=[...a].map((e=>r.addItem({args:{factory:e.name,label:e.label||e.name},command:T.open})))}e.contextMenu.opened.connect(o)}};const F={id:"@jupyterlab/filebrowser-extension:open-browser-tab",description:"Adds the open-in-new-browser-tab features.",requires:[h.IFileBrowserFactory,b.ITranslator],autoStart:true,activate:(e,t,n)=>{const{commands:i}=e;const s=n.load("jupyterlab");const{tracker:o}=t;i.addCommand(T.openBrowserTab,{execute:e=>{const t=o.currentWidget;if(!t){return}const n=e["mode"];return Promise.all(Array.from((0,x.map)(t.selectedItems(),(e=>{if(n==="single-document"){const t=a.PageConfig.getUrl({mode:"single-document",treePath:e.path});const n=window.open();if(n){n.opener=null;n.location.href=t}else{throw new Error("Failed to open new browser tab.")}}else{return i.execute("docmanager:open-browser-tab",{path:e.path})}}))))},icon:w.addIcon.bindprops({stylesheet:"menuItem"}),label:e=>e["mode"]==="single-document"?s.__("Open in Simple Mode"):s.__("Open in New Browser Tab"),mnemonic:0})}};const z={id:"@jupyterlab/filebrowser-extension:file-upload-status",description:"Adds a file upload status widget.",autoStart:true,requires:[h.IFileBrowserFactory,b.ITranslator],optional:[v.IStatusBar],activate:(e,t,n,i)=>{if(!i){return}const s=new h.FileUploadStatus({tracker:t.tracker,translator:n});i.registerStatusItem("@jupyterlab/filebrowser-extension:file-upload-status",{item:s,align:"middle",isActive:()=>!!s.model&&s.model.items.length>0,activeStateChanged:s.model.stateChanged})}};const H={id:"@jupyterlab/filebrowser-extension:open-url",description:'Adds the feature "Open files from remote URLs".',autoStart:true,requires:[h.IDefaultFileBrowser,b.ITranslator],optional:[o.ICommandPalette],activate:(e,t,n,i)=>{const{commands:s}=e;const r=n.load("jupyterlab");const l=T.openUrl;s.addCommand(l,{label:e=>e.url?r.__("Open %1",e.url):r.__("Open from URL…"),caption:e=>e.url?r.__("Open %1",e.url):r.__("Open from URL"),execute:async e=>{var n,i,l;let d=(n=e===null||e===void 0?void 0:e.url)!==null&&n!==void 0?n:"";if(!d){d=(i=(await o.InputDialog.getText({label:r.__("URL"),placeholder:"https://example.com/path/to/file",title:r.__("Open URL"),okLabel:r.__("Open")})).value)!==null&&i!==void 0?i:undefined}if(!d){return}let c="";let h;try{const e=await fetch(d);h=await e.blob();c=(l=e.headers.get("Content-Type"))!==null&&l!==void 0?l:""}catch(u){if(u.response&&u.response.status!==200){u.message=r.__("Could not open URL: %1",d)}return(0,o.showErrorMessage)(r.__("Cannot fetch"),u)}try{const e=a.PathExt.basename(d);const n=new File([h],e,{type:c});const i=await t.model.upload(n);return s.execute("docmanager:open",{path:i.path})}catch(p){return(0,o.showErrorMessage)(r._p("showErrorMessage","Upload Error"),p)}}});if(i){i.addItem({command:l,category:r.__("File Operations")})}}};function W(e,t,n,i,s,r){const l=i.load("jupyterlab");const{docRegistry:d,commands:c}=e;const{tracker:h}=n;const u=a.PageConfig.getOption("delete_to_trash")==="true";c.addCommand(T.del,{execute:()=>{const e=h.currentWidget;if(e){return e.delete()}},icon:w.closeIcon.bindprops({stylesheet:"menuItem"}),label:u?l.__("Move to Trash"):l.__("Delete"),mnemonic:0});c.addCommand(T.copy,{execute:()=>{const e=h.currentWidget;if(e){return e.copy()}},icon:w.copyIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Copy"),mnemonic:0});c.addCommand(T.cut,{execute:()=>{const e=h.currentWidget;if(e){return e.cut()}},icon:w.cutIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Cut")});c.addCommand(T.duplicate,{execute:()=>{const e=h.currentWidget;if(e){return e.duplicate()}},icon:w.copyIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Duplicate")});c.addCommand(T.goToPath,{label:l.__("Update the file browser to display the provided `path`."),execute:async e=>{var s;const o=e.path||"";const r=!((s=e===null||e===void 0?void 0:e.dontShowBrowser)!==null&&s!==void 0?s:false);try{const e=await q.navigateToPath(o,t,n,i);if(e.type!=="directory"&&r){const e=q.getBrowserForPath(o,t,n);if(e){e.clearSelectedItems();const t=o.split("/");const n=t[t.length-1];if(n){await e.selectItemByName(n)}}}}catch(a){console.warn(`${T.goToPath} failed to go to: ${o}`,a)}if(r){return c.execute(T.showBrowser,{path:o})}}});c.addCommand(T.goUp,{label:"go up",execute:async()=>{const e=q.getBrowserForPath("",t,n);if(!e){return}const{model:i}=e;await i.restored;void e.goUp()}});c.addCommand(T.openPath,{label:e=>e.path?l.__("Open %1",e.path):l.__("Open from Path…"),caption:e=>e.path?l.__("Open %1",e.path):l.__("Open from path"),execute:async e=>{var i;let s;if(e===null||e===void 0?void 0:e.path){s=e.path}else{s=(i=(await o.InputDialog.getText({label:l.__("Path"),placeholder:"/path/relative/to/jlab/root",title:l.__("Open Path"),okLabel:l.__("Open")})).value)!==null&&i!==void 0?i:undefined}if(!s){return}try{const i=s!=="/"&&s.endsWith("/");if(i){s=s.slice(0,s.length-1)}const o=q.getBrowserForPath(s,t,n);const{services:r}=o.model.manager;const a=await r.contents.get(s,{content:false});if(i&&a.type!=="directory"){throw new Error(`Path ${s}/ is not a directory`)}await c.execute(T.goToPath,{path:s,dontShowBrowser:e.dontShowBrowser});if(a.type==="directory"){return}return c.execute("docmanager:open",{path:s})}catch(r){if(r.response&&r.response.status===404){r.message=l.__("Could not find path: %1",s)}return(0,o.showErrorMessage)(l.__("Cannot open"),r)}}});if(r){r.addItem({command:T.openPath,category:l.__("File Operations")})}c.addCommand(T.open,{execute:e=>{const t=e["factory"]||void 0;const n=h.currentWidget;if(!n){return}const{contents:i}=n.model.manager.services;return Promise.all(Array.from((0,x.map)(n.selectedItems(),(e=>{if(e.type==="directory"){const t=i.localPath(e.path);return n.model.cd(`/${t}`)}return c.execute("docmanager:open",{factory:t,path:e.path})}))))},icon:e=>{var t;const n=e["factory"]||void 0;if(n){const e=d.getFileType(n);return(t=e===null||e===void 0?void 0:e.icon)===null||t===void 0?void 0:t.bindprops({stylesheet:"menuItem"})}else{return w.folderIcon.bindprops({stylesheet:"menuItem"})}},label:e=>e["label"]||e["factory"]||l.__("Open"),mnemonic:0});c.addCommand(T.paste,{execute:()=>{const e=h.currentWidget;if(e){return e.paste()}},icon:w.pasteIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Paste"),mnemonic:0});c.addCommand(T.createNewDirectory,{execute:()=>{const e=h.currentWidget;if(e){return e.createNewDirectory()}},icon:w.newFolderIcon.bindprops({stylesheet:"menuItem"}),label:l.__("New Folder")});c.addCommand(T.createNewFile,{execute:()=>{const e=h.currentWidget;if(e){return e.createNewFile({ext:"txt"})}},icon:w.textEditorIcon.bindprops({stylesheet:"menuItem"}),label:l.__("New File")});c.addCommand(T.createNewMarkdownFile,{execute:()=>{const e=h.currentWidget;if(e){return e.createNewFile({ext:"md"})}},icon:w.markdownIcon.bindprops({stylesheet:"menuItem"}),label:l.__("New Markdown File")});c.addCommand(T.refresh,{execute:e=>{const t=h.currentWidget;if(t){return t.model.refresh()}},icon:w.refreshIcon.bindprops({stylesheet:"menuItem"}),caption:l.__("Refresh the file browser."),label:l.__("Refresh File List")});c.addCommand(T.rename,{execute:e=>{const t=h.currentWidget;if(t){return t.rename()}},isVisible:()=>!!h.currentWidget&&Array.from(h.currentWidget.selectedItems()).length===1,icon:w.editIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Rename"),mnemonic:0});c.addCommand(T.copyPath,{execute:()=>{var e;const t=h.currentWidget;if(!t){return}const n=t.selectedItems().next();if(n.done){return}if(a.PageConfig.getOption("copyAbsolutePath")==="true"){const t=a.PathExt.joinWithLeadingSlash((e=a.PageConfig.getOption("serverRoot"))!==null&&e!==void 0?e:"",n.value.path);o.Clipboard.copyToSystem(t)}else{o.Clipboard.copyToSystem(n.value.path)}},isVisible:()=>!!h.currentWidget&&Array.from(h.currentWidget.selectedItems()).length===1,icon:w.fileIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Copy Path")});c.addCommand(T.shutdown,{execute:()=>{const e=h.currentWidget;if(e){return e.shutdownKernels()}},icon:w.stopIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Shut Down Kernel")});c.addCommand(T.toggleFileFilter,{execute:()=>{t.showFileFilter=!t.showFileFilter;c.notifyCommandChanged(T.toggleFileFilter)},isToggled:()=>{const e=t.showFileFilter;return e},icon:w.filterIcon.bindprops({stylesheet:"menuItem"}),label:l.__("Toggle File Filter")});c.addCommand(T.toggleLastModified,{label:l.__("Show Last Modified Column"),isToggled:()=>t.showLastModifiedColumn,execute:()=>{const e=!t.showLastModifiedColumn;const n="showLastModifiedColumn";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set ${n} setting`)}))}}});c.addCommand(T.toggleShowFullPath,{label:l.__("Show Full Path"),isToggled:()=>t.showFullPath,execute:()=>{const e=!t.showFullPath;const n="showFullPath";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set ${n} setting`)}))}}});c.addCommand(T.toggleSortNotebooksFirst,{label:l.__("Sort Notebooks Above Files"),isToggled:()=>t.sortNotebooksFirst,execute:()=>{const e=!t.sortNotebooksFirst;const n="sortNotebooksFirst";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set ${n} setting`)}))}}});c.addCommand(T.toggleFileSize,{label:l.__("Show File Size Column"),isToggled:()=>t.showFileSizeColumn,execute:()=>{const e=!t.showFileSizeColumn;const n="showFileSizeColumn";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set ${n} setting`)}))}}});c.addCommand(T.toggleSingleClick,{label:l.__("Enable Single Click Navigation"),isToggled:()=>t.singleClickNavigation,execute:()=>{const e=!t.singleClickNavigation;const n="singleClickNavigation";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set singleClickNavigation setting`)}))}}});c.addCommand(T.toggleHiddenFiles,{label:l.__("Show Hidden Files"),isToggled:()=>t.showHiddenFiles,isVisible:()=>a.PageConfig.getOption("allow_hidden_files")==="true",execute:()=>{const e=!t.showHiddenFiles;const n="showHiddenFiles";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set showHiddenFiles setting`)}))}}});c.addCommand(T.toggleFileCheckboxes,{label:l.__("Show File Checkboxes"),isToggled:()=>t.showFileCheckboxes,execute:()=>{const e=!t.showFileCheckboxes;const n="showFileCheckboxes";if(s){return s.set(E,n,e).catch((e=>{console.error(`Failed to set showFileCheckboxes setting`)}))}}});c.addCommand(T.search,{label:l.__("Search on File Names"),execute:()=>alert("search")})}const V=[P,L,D,A,O,z,R,N,B,F,H];const U=V;var q;(function(e){function t(e,t,n){const{tracker:i}=n;const s=t.model.manager.services.contents.driveName(e);if(s){const t=i.find((e=>e.model.driveName===s));if(!t){console.warn(`${T.goToPath} failed to find filebrowser for path: ${e}`);return}return t}return t}e.getBrowserForPath=t;async function n(t,n,i,s){const o=s.load("jupyterlab");const r=e.getBrowserForPath(t,n,i);if(!r){throw new Error(o.__("No browser for path"))}const{services:l}=r.model.manager;const d=l.contents.localPath(t);await l.ready;const c=await l.contents.get(t,{content:false});const{model:h}=r;await h.restored;if(c.type==="directory"){await h.cd(`/${d}`)}else{await h.cd(`/${a.PathExt.dirname(d)}`)}return c}e.navigateToPath=n;async function i(e,t,n,i,s,o){const r="jp-mod-restoring";e.addClass(r);if(!n){await e.model.restore(e.id);await e.model.refresh();e.removeClass(r);return}const a=async()=>{n.routed.disconnect(a);const s=await(i===null||i===void 0?void 0:i.paths);if((s===null||s===void 0?void 0:s.file)||(s===null||s===void 0?void 0:s.browser)){await e.model.restore(e.id,false);if(s.file){await t.execute(T.openPath,{path:s.file,dontShowBrowser:true})}if(s.browser){await t.execute(T.openPath,{path:s.browser,dontShowBrowser:true})}}else{await e.model.restore(e.id);await e.model.refresh()}e.removeClass(r);if(o===null||o===void 0?void 0:o.isEmpty("main")){void t.execute("launcher:create")}};n.routed.connect(a)}e.restoreBrowser=i;let s;(function(e){function t(e,t){const n=e.preferredWidgetFactories(t.path);const i=e.getWidgetFactory("notebook");if(i&&t.type==="notebook"&&n.indexOf(i)===-1){n.unshift(i)}return n}e.getFactories=t;function n(e){let t=undefined;for(const n of e){if(t===undefined){t=new Set(n);continue}if(t.size===0){return t}let e=new Set;for(const i of n){if(t.has(i)){e.add(i)}}t=e}return t!==null&&t!==void 0?t:new Set}e.intersection=n})(s=e.OpenWith||(e.OpenWith={}))})(q||(q={}))},20135:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(79010);var l=n(3579);var d=n(41603);var c=n(39063);var h=n(85072);var u=n.n(h);var p=n(97825);var m=n.n(p);var g=n(77659);var f=n.n(g);var v=n(55056);var _=n.n(v);var b=n(10540);var y=n.n(b);var w=n(41113);var C=n.n(w);var x=n(538);var S={};S.styleTagTransform=C();S.setAttributes=_();S.insert=f().bind(null,"head");S.domAPI=m();S.insertStyleElement=y();var k=u()(x.A,S);const j=x.A&&x.A.locals?x.A.locals:undefined},21813:(e,t,n)=>{"use strict";n.r(t);n.d(t,{BreadCrumbs:()=>C,CHUNK_SIZE:()=>xe,DirListing:()=>ce,FileBrowser:()=>be,FileBrowserModel:()=>Se,FileDialog:()=>Te,FileUploadStatus:()=>He,FilterFileBrowserModel:()=>je,IDefaultFileBrowser:()=>Pe,IFileBrowserCommands:()=>Le,IFileBrowserFactory:()=>Ae,LARGE_FILE_SIZE:()=>Ce,TogglableHiddenFileBrowserModel:()=>ke,Uploader:()=>Re});var i=n(72050);var s=n(37737);var o=n(77256);var r=n(61927);var a=n(66127);var l=n(1143);var d=n(44914);var c=n.n(d);var h=n(65189);var u=n(34236);var p=n(5592);var m=n(76326);const g="jp-BreadCrumbs";const f="jp-BreadCrumbs-home";const v="jp-BreadCrumbs-preferred";const _="jp-BreadCrumbs-item";const b=["/","../../","../",""];const y="application/x-jupyter-icontents";const w="jp-mod-dropTarget";class C extends l.Widget{constructor(e){super();this._previousState=null;this.translator=e.translator||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this._model=e.model;this._fullPath=e.fullPath||false;this.addClass(g);this._crumbs=x.createCrumbs();this._crumbSeps=x.createCrumbSeparators();const t=s.PageConfig.getOption("preferredPath");this._hasPreferred=t&&t!=="/"?true:false;if(this._hasPreferred){this.node.appendChild(this._crumbs[x.Crumb.Preferred])}this.node.appendChild(this._crumbs[x.Crumb.Home]);this._model.refreshed.connect(this.update,this)}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:return}}get fullPath(){return this._fullPath}set fullPath(e){this._fullPath=e}onAfterAttach(e){super.onAfterAttach(e);this.update();const t=this.node;t.addEventListener("click",this);t.addEventListener("lm-dragenter",this);t.addEventListener("lm-dragleave",this);t.addEventListener("lm-dragover",this);t.addEventListener("lm-drop",this)}onBeforeDetach(e){super.onBeforeDetach(e);const t=this.node;t.removeEventListener("click",this);t.removeEventListener("lm-dragenter",this);t.removeEventListener("lm-dragleave",this);t.removeEventListener("lm-dragover",this);t.removeEventListener("lm-drop",this)}onUpdateRequest(e){const t=this._model.manager.services.contents;const n=t.localPath(this._model.path);const i={path:n,hasPreferred:this._hasPreferred,fullPath:this._fullPath};if(this._previousState&&p.JSONExt.deepEqual(i,this._previousState)){return}this._previousState=i;x.updateCrumbs(this._crumbs,this._crumbSeps,i)}_evtClick(e){if(e.button!==0){return}let t=e.target;while(t&&t!==this.node){if(t.classList.contains(v)){const t=s.PageConfig.getOption("preferredPath");const n=t?"/"+t:t;this._model.cd(n).catch((e=>(0,i.showErrorMessage)(this._trans.__("Open Error"),e)));e.preventDefault();e.stopPropagation();return}if(t.classList.contains(_)||t.classList.contains(f)){let n=u.ArrayExt.findFirstIndex(this._crumbs,(e=>e===t));let s=b[n];if(this._fullPath&&n<0&&!t.classList.contains(f)){s=t.title}this._model.cd(s).catch((e=>(0,i.showErrorMessage)(this._trans.__("Open Error"),e)));e.preventDefault();e.stopPropagation();return}t=t.parentElement}}_evtDragEnter(e){if(e.mimeData.hasData(y)){const t=u.ArrayExt.findFirstIndex(this._crumbs,(t=>m.ElementExt.hitTest(t,e.clientX,e.clientY)));if(t!==-1){if(t!==x.Crumb.Current){this._crumbs[t].classList.add(w);e.preventDefault();e.stopPropagation()}}}}_evtDragLeave(e){e.preventDefault();e.stopPropagation();const t=i.DOMUtils.findElement(this.node,w);if(t){t.classList.remove(w)}}_evtDragOver(e){e.preventDefault();e.stopPropagation();e.dropAction=e.proposedAction;const t=i.DOMUtils.findElement(this.node,w);if(t){t.classList.remove(w)}const n=u.ArrayExt.findFirstIndex(this._crumbs,(t=>m.ElementExt.hitTest(t,e.clientX,e.clientY)));if(n!==-1){this._crumbs[n].classList.add(w)}}_evtDrop(e){e.preventDefault();e.stopPropagation();if(e.proposedAction==="none"){e.dropAction="none";return}if(!e.mimeData.hasData(y)){return}e.dropAction=e.proposedAction;let t=e.target;while(t&&t.parentElement){if(t.classList.contains(w)){t.classList.remove(w);break}t=t.parentElement}const n=u.ArrayExt.findFirstIndex(this._crumbs,(e=>e===t));if(n===-1){return}const o=this._model;const r=s.PathExt.resolve(o.path,b[n]);const a=o.manager;const l=[];const d=e.mimeData.getData(y);for(const i of d){const e=a.services.contents.localPath(i);const t=s.PathExt.basename(e);const n=s.PathExt.join(r,t);l.push((0,h.renameFile)(a,i,n))}void Promise.all(l).catch((e=>(0,i.showErrorMessage)(this._trans.__("Move Error"),e)))}}var x;(function(e){let t;(function(e){e[e["Home"]=0]="Home";e[e["Ellipsis"]=1]="Ellipsis";e[e["Parent"]=2]="Parent";e[e["Current"]=3]="Current";e[e["Preferred"]=4]="Preferred"})(t=e.Crumb||(e.Crumb={}));function n(e,n,i){const s=e[0].parentNode;const o=s.firstChild;while(o&&o.nextSibling){s.removeChild(o.nextSibling)}if(i.hasPreferred){s.appendChild(e[t.Home]);s.appendChild(n[0])}else{s.appendChild(n[0])}const r=i.path.split("/");if(!i.fullPath&&r.length>2){s.appendChild(e[t.Ellipsis]);const i=r.slice(0,r.length-2).join("/");e[t.Ellipsis].title=i;s.appendChild(n[1])}if(i.path){if(!i.fullPath){if(r.length>=2){e[t.Parent].textContent=r[r.length-2];s.appendChild(e[t.Parent]);const i=r.slice(0,r.length-1).join("/");e[t.Parent].title=i;s.appendChild(n[2])}e[t.Current].textContent=r[r.length-1];s.appendChild(e[t.Current]);e[t.Current].title=i.path;s.appendChild(n[3])}else{for(let e=0;ethis.selection[e.path]))}sortedItems(){return this._sortedItems[Symbol.iterator]()}sort(e){this._sortedItems=he.sort(this.model.items(),e,this._sortNotebooksFirst,this.translator);this._sortState=e;this.update()}rename(){return this._doRename()}cut(){this._isCut=true;this._copy();this.update()}copy(){this._copy()}paste(){if(!this._clipboard.length){this._isCut=false;return Promise.resolve(undefined)}const e=this._model.path;const t=[];for(const n of this._clipboard){if(this._isCut){const i=this._manager.services.contents.localPath(n);const o=i.split("/");const r=o[o.length-1];const a=s.PathExt.join(e,r);t.push(this._model.manager.rename(n,a))}else{t.push(this._model.manager.copy(n,e))}}for(const n of this._items){n.classList.remove(ee)}this._clipboard.length=0;this._isCut=false;this.removeClass(Z);return Promise.all(t).then((()=>undefined)).catch((e=>{void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Paste Error"),e)}))}async delete(){const e=s.PageConfig.getOption("delete_to_trash")==="true";const t=this._sortedItems.filter((e=>this.selection[e.path]));if(!t.length){return}const n=this._trans.__("Are you sure you want to move to trash: %1?",t[0].name);const o=this._trans.__("Are you sure you want to permanently delete: %1?",t[0].name);const r=this._trans._n("Are you sure you want to move to trash the %1 selected item?","Are you sure you want to move to trash the %1 selected items?",t.length);const a=this._trans._n("Are you sure you want to permanently delete the %1 selected item?","Are you sure you want to permanently delete the %1 selected items?",t.length);const l=e?n:o;const d=e?r:a;const c=e?this._trans.__("Move to Trash"):this._trans.__("Delete");const h=t.length===1?l:d;const u=await(0,i.showDialog)({title:c,body:h,buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.warnButton({label:c})],defaultButton:0});if(!this.isDisposed&&u.button.accept){await this._delete(t.map((e=>e.path)))}let p=this._focusIndex;const m=this._sortedItems.length-t.length-1;if(p>m){p=Math.max(0,m)}this._focusItem(p)}duplicate(){const e=this._model.path;const t=[];for(const n of this.selectedItems()){if(n.type!=="directory"){t.push(this._model.manager.copy(n.path,e))}}return Promise.all(t).then((()=>undefined)).catch((e=>{void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Duplicate file"),e)}))}async download(){await Promise.all(Array.from(this.selectedItems()).filter((e=>e.type!=="directory")).map((e=>this._model.download(e.path))))}async restore(e){const t=`file-browser-${e}:columns`;const n=this._state;this._stateColumnsKey=t;if(!n){return}try{const e=await n.fetch(t);if(!e){return}const i=e["sizes"];if(!i){return}for(const[t,n]of Object.entries(i)){this._columnSizes[t]=n}this._updateColumnSizes()}catch(i){await n.remove(t)}}shutdownKernels(){const e=this._model;const t=this._sortedItems;const n=t.map((e=>e.path));const s=Array.from(this._model.sessions()).filter((e=>{const i=u.ArrayExt.firstIndexOf(n,e.path);return this.selection[t[i].path]})).map((t=>e.manager.services.sessions.shutdown(t.id)));return Promise.all(s).then((()=>undefined)).catch((e=>{void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Shut down kernel"),e)}))}selectNext(e=false){let t=-1;const n=Object.keys(this.selection);const i=this._sortedItems;if(n.length===1||e){const e=n[n.length-1];t=u.ArrayExt.findFirstIndex(i,(t=>t.path===e));t+=1;if(t===this._items.length){t=0}}else if(n.length===0){t=0}else{const e=n[n.length-1];t=u.ArrayExt.findFirstIndex(i,(t=>t.path===e))}if(t!==-1){this._selectItem(t,e);m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[t])}}selectPrevious(e=false){let t=-1;const n=Object.keys(this.selection);const i=this._sortedItems;if(n.length===1||e){const e=n[0];t=u.ArrayExt.findFirstIndex(i,(t=>t.path===e));t-=1;if(t===-1){t=this._items.length-1}}else if(n.length===0){t=this._items.length-1}else{const e=n[0];t=u.ArrayExt.findFirstIndex(i,(t=>t.path===e))}if(t!==-1){this._selectItem(t,e);m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[t])}}selectByPrefix(){const e=this._searchPrefix.toLowerCase();const t=this._sortedItems;const n=u.ArrayExt.findFirstIndex(t,(t=>t.name.toLowerCase().substr(0,e.length)===e));if(n!==-1){this._selectItem(n,false);m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[n])}}isSelected(e){const t=this._sortedItems;return Array.from((0,u.filter)(t,(t=>t.name===e&&this.selection[t.path]))).length!==0}modelForClick(e){const t=this._sortedItems;const n=he.hitTestNodes(this._items,e);if(n!==-1){return t[n]}return undefined}clearSelectedItems(){this.selection=Object.create(null)}async selectItemByName(e,t=false){return this._selectItemByName(e,t)}async _selectItemByName(e,t=false,n=false){if(!n&&this.isSelected(e)){return}await this.model.refresh();if(this.isDisposed){throw new Error("File browser is disposed.")}const i=this._sortedItems;const s=u.ArrayExt.findFirstIndex(i,(t=>t.name===e));if(s===-1){throw new Error("Item does not exist.")}this._selectItem(s,false,t);I.MessageLoop.sendMessage(this,l.Widget.Msg.UpdateRequest);m.ElementExt.scrollIntoViewIfNeeded(this.contentNode,this._items[s])}handleEvent(e){switch(e.type){case"mousedown":this._evtMousedown(e);break;case"mouseup":this._evtMouseup(e);break;case"mousemove":this._evtMousemove(e);break;case"keydown":this.evtKeydown(e);break;case"click":this._evtClick(e);break;case"dblclick":this.evtDblClick(e);break;case"dragenter":case"dragover":this.addClass("jp-mod-native-drop");e.preventDefault();break;case"dragleave":case"dragend":this.removeClass("jp-mod-native-drop");break;case"drop":this.removeClass("jp-mod-native-drop");this.evtNativeDrop(e);break;case"scroll":this._evtScroll(e);break;case"lm-dragenter":this.evtDragEnter(e);break;case"lm-dragleave":this.evtDragLeave(e);break;case"lm-dragover":this.evtDragOver(e);break;case"lm-drop":this.evtDrop(e);break;default:break}}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;this._width=this._computeContentWidth();const n=i.DOMUtils.findElement(t,R);t.addEventListener("mousedown",this);t.addEventListener("keydown",this);t.addEventListener("click",this);t.addEventListener("dblclick",this);this._contentSizeObserver.observe(n);n.addEventListener("dragenter",this);n.addEventListener("dragover",this);n.addEventListener("dragleave",this);n.addEventListener("dragend",this);n.addEventListener("drop",this);n.addEventListener("scroll",this);n.addEventListener("lm-dragenter",this);n.addEventListener("lm-dragleave",this);n.addEventListener("lm-dragover",this);n.addEventListener("lm-drop",this);this._updateColumnSizes()}onBeforeDetach(e){super.onBeforeDetach(e);const t=this.node;const n=i.DOMUtils.findElement(t,R);t.removeEventListener("mousedown",this);t.removeEventListener("keydown",this);t.removeEventListener("click",this);t.removeEventListener("dblclick",this);this._contentSizeObserver.disconnect();n.removeEventListener("scroll",this);n.removeEventListener("dragover",this);n.removeEventListener("dragover",this);n.removeEventListener("dragleave",this);n.removeEventListener("dragend",this);n.removeEventListener("drop",this);n.removeEventListener("lm-dragenter",this);n.removeEventListener("lm-dragleave",this);n.removeEventListener("lm-dragover",this);n.removeEventListener("lm-drop",this);document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true)}onAfterShow(e){if(this._isDirty){this.sort(this.sortState);this.update()}}_onContentResize(){const e=i.DOMUtils.findElement(this.node,R);const t=e.offsetWidth-e.clientWidth;if(t!=this._contentScrollbarWidth){this._contentScrollbarWidth=t;this._width=this._computeContentWidth();this._updateColumnSizes()}}_computeContentWidth(e=null){if(!e){e=this.node.getBoundingClientRect().width}this._paddingWidth=parseFloat(window.getComputedStyle(this.node).getPropertyValue("--jp-dirlisting-padding-width"));const t=this.node.querySelector(`.${Q}`);this._handleWidth=t?t.getBoundingClientRect().width:re;return e-this._paddingWidth*2-this._contentScrollbarWidth}_updateModifiedSize(e){var t,n;const s=i.DOMUtils.findElement(e,q);this._modifiedWidth=(n=(t=this._columnSizes["last_modified"])!==null&&t!==void 0?t:s===null||s===void 0?void 0:s.getBoundingClientRect().width)!==null&&n!==void 0?n:83;this._modifiedStyle=this._modifiedWidth<100?"narrow":this._modifiedWidth>120?"long":"short"}_updateModifiedStyleAndSize(){const e=this._modifiedStyle;this._updateModifiedSize(this.node);if(e!==this._modifiedStyle){this.updateModified(this._sortedItems,this._items)}}updateModified(e,t){e.forEach(((e,n)=>{const s=t[n];if(s&&e.last_modified){const t=i.DOMUtils.findElement(s,z);if(this.renderer.updateItemModified!==undefined){this.renderer.updateItemModified(t,e.last_modified,this._modifiedStyle)}else{ce.defaultRenderer.updateItemModified(t,e.last_modified,this._modifiedStyle)}}}))}updateNodes(e,t,n=false){var i;e.forEach(((e,i)=>{const s=t[i];if(n&&this.renderer.updateItemSize){if(!s){return}return this.renderer.updateItemSize(s,e,this._modifiedStyle,this._columnSizes)}const o=this._manager.registry.getFileTypeForModel(e);this.renderer.updateItemNode(s,e,o,this.translator,this._hiddenColumns,this.selection[e.path],this._modifiedStyle,this._columnSizes);if(this.selection[e.path]&&this._isCut&&this._model.path===this._prevPath){s.classList.add(ee)}s.setAttribute("data-isdir",e.type==="directory"?"true":"false")}));const s=Object.keys(this.selection).length;if(s){this.addClass(Y);if(s>1){this.addClass(te)}}const o=e.map((e=>e.path));for(const r of this._model.sessions()){const e=u.ArrayExt.firstIndexOf(o,r.path);const n=t[e];if(n){let e=(i=r.kernel)===null||i===void 0?void 0:i.name;const t=this._model.specs;n.classList.add(ne);if(t&&e){const n=t.kernelspecs[e];e=n?n.display_name:this._trans.__("unknown")}const s=this._lastRenderedState.get(n);if(s!==n.title){n.title=this._trans.__("%1\nKernel: %2",n.title,e);this._lastRenderedState.set(n,n.title)}}}}onUpdateRequest(e){this._isDirty=false;const t=this._sortedItems;const n=this._items;const s=n.length===0;const o=i.DOMUtils.findElement(this.node,R);const r=this._renderer;this.removeClass(te);this.removeClass(Y);while(n.length>t.length){o.removeChild(n.pop())}while(n.length{e.classList.remove(Y);e.classList.remove(ne);e.classList.remove(ee);const n=r.getCheckboxNode(e);if(n){n.checked=false}const i=r.getNameNode(e);if(i){if(t===this._focusIndex){i.setAttribute("tabIndex","0");i.setAttribute("role","button")}else{i.setAttribute("tabIndex","-1");i.removeAttribute("role")}}}));const a=r.getCheckboxNode(this.headerNode);if(a){const e=Object.keys(this.selection).length;const n=t.length>0&&e===t.length;const i=!n&&e>0;a.checked=n;a.indeterminate=i;a.dataset.checked=String(n);a.dataset.indeterminate=String(i);const s=this.translator.load("jupyterlab");a===null||a===void 0?void 0:a.setAttribute("aria-label",n||i?s.__("Deselect all files and directories"):s.__("Select all files and directories"))}this.updateNodes(t,n);if(s){this._width=this._computeContentWidth();this._updateColumnSizes()}this._prevPath=this._model.path}onResize(e){const{width:t}=e.width===-1?this.node.getBoundingClientRect():e;this._width=this._computeContentWidth(t);this._updateColumnSizes()}setColumnVisibility(e,t){if(t){this._hiddenColumns.delete(e)}else{this._hiddenColumns.add(e)}this.headerNode.innerHTML="";this._renderer.populateHeaderNode(this.headerNode,this.translator,this._hiddenColumns,this._columnSizes);this._updateColumnSizes()}_updateColumnSizes(e=null){const t=this._visibleColumns.map((e=>({...e,element:i.DOMUtils.findElement(this.node,e.className)}))).filter((e=>e.element));let n=0;for(const i of t){let e=this._columnSizes[i.id];if(e===null){e=i.element.getBoundingClientRect().width}e=Math.max(e,i.minWidth);if(this._width){let n=0;for(const e of t){if(e.id===i.id){continue}n+=e.minWidth}e=Math.min(e,this._width-n)}this._columnSizes[i.id]=e;n+=e}if(this._width){const i=this._width-n;let s=e===null;const o=t.filter((t=>{if(s){return true}if(t.id===e){s=true}return false}));const r=o.map((e=>e.grow)).reduce(((e,t)=>e+t),0);for(const e of o){const t=i*e.grow/r;this._columnSizes[e.id]=this._columnSizes[e.id]+t}}const s=this.node.getElementsByClassName(Q);const o=t.map((e=>he.isResizable(e)));let r=0;for(const i of t){let e=this._columnSizes[i.id];if(he.isResizable(i)&&e){e-=this._handleWidth*s.length/o.length;if(r===0||r===o.length-1){e+=this._paddingWidth}r+=1}i.element.style.width=e===null?"":e+"px"}this._updateModifiedStyleAndSize();if(this.isVisible){const e=this._items;if(e.length!==0){this.updateNodes(this._sortedItems,this._items,true)}}if(this._state&&this._stateColumnsKey){void this._state.save(this._stateColumnsKey,{sizes:this._columnSizes})}}get _visibleColumns(){return ce.columns.filter((e=>{var t;return e.id==="name"||!((t=this._hiddenColumns)===null||t===void 0?void 0:t.has(e.id))}))}_setColumnSize(e,t){var n;const s=this._columnSizes[e];if(s&&t&&t>s){let s=0;let o=true;for(const r of this._visibleColumns){if(r.id===e){s+=t;o=false;continue}if(o){const e=i.DOMUtils.findElement(this.node,r.className);s+=(n=this._columnSizes[r.id])!==null&&n!==void 0?n:e.getBoundingClientRect().width}else{s+=r.minWidth}}if(this._width&&s>this._width){return}}this._columnSizes[e]=t;this._updateColumnSizes(e)}setNotebooksFirstSorting(e){let t=this._sortNotebooksFirst;this._sortNotebooksFirst=e;if(this._sortNotebooksFirst!==t){this.sort(this._sortState)}}setAllowSingleClickNavigation(e){this._allowSingleClick=e}isWithinCheckboxHitArea(e){let t=e.target;while(t){if(t.classList.contains(W)){return true}t=t.parentElement}return false}_evtClick(e){const t=e.target;const n=this.headerNode;const i=this._renderer;if(n.contains(t)){const t=i.getCheckboxNode(n);if(t&&this.isWithinCheckboxHitArea(e)){const e=t.dataset.indeterminate==="false"&&t.dataset.checked==="false";if(e){this._sortedItems.forEach((e=>this.selection[e.path]=true))}else{this.clearSelectedItems()}this.update()}else{const t=this.renderer.handleHeaderClick(n,e);if(t){this.sort(t)}}return}else{this._focusItem(this._focusIndex)}if(this._allowSingleClick){this.evtDblClick(e)}}_evtScroll(e){this.headerNode.scrollLeft=this.contentNode.scrollLeft}_evtMousedown(e){if(e.target===this._editNode){return}if(this._editNode.parentNode){if(this._editNode!==e.target){this._editNode.focus();this._editNode.blur();clearTimeout(this._selectTimer)}else{return}}let t=he.hitTestNodes(this._items,e);if(t===-1){if(e.button===0){const t=e.target;if(t instanceof HTMLElement&&t.classList.contains(Q)){const n=t.dataset.column;if(!n){throw Error("Column resize handle is missing data-column attribute")}const s=ce.columns.find((e=>e.id===n));if(!s){throw Error(`Column with identifier ${n} not found`)}const o=i.DOMUtils.findElement(this.node,s.className);t.classList.add(ie);const r=j.Drag.overrideCursor("col-resize");this._resizeData={pressX:e.clientX,column:n,initialSize:o.getBoundingClientRect().width,overrides:new k.DisposableDelegate((()=>{r.dispose();t.classList.remove(ie)}))};document.addEventListener("mouseup",this,true);document.addEventListener("mousemove",this,true);return}}return}this.handleFileSelect(e);if(e.button!==0){clearTimeout(this._selectTimer)}const n=le&&e.ctrlKey||e.button===2;if(n){return}if(e.button===0){this._dragData={pressX:e.clientX,pressY:e.clientY,index:t};document.addEventListener("mouseup",this,true);document.addEventListener("mousemove",this,true)}}_evtMouseup(e){if(this._softSelection){const t=e.metaKey||e.shiftKey||e.ctrlKey;if(!t&&e.button===0){this.clearSelectedItems();this.selection[this._softSelection]=true;this.update()}this._softSelection=""}if(e.button===0){this._focusItem(this._focusIndex)}if(this._resizeData){this._resizeData.overrides.dispose();this._resizeData=null;document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true);return}if(e.button!==0||!this._drag){document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true);return}e.preventDefault();e.stopPropagation()}_evtMousemove(e){e.preventDefault();e.stopPropagation();if(this._resizeData){const{initialSize:t,column:n,pressX:i}=this._resizeData;this._setColumnSize(n,t+e.clientX-i);return}if(this._drag||!this._dragData){return}const t=this._dragData;const n=Math.abs(e.clientX-t.pressX);const i=Math.abs(e.clientY-t.pressY);if(n(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Open directory"),e)))}else{const t=e.path;this._manager.openOrReveal(t)}}_getNextFocusIndex(e,t){const n=e+t;if(n===-1||n===this._items.length){return e}else{return n}}_handleArrowY(e,t){if(e.altKey||e.metaKey){return}if(!this._items.length){return}if(!e.target.classList.contains(O)){return}e.stopPropagation();e.preventDefault();const n=this._focusIndex;let i=this._getNextFocusIndex(n,t);if(t>0&&n===0&&!e.ctrlKey&&Object.keys(this.selection).length===0){i=0}if(e.shiftKey){this._handleMultiSelect(i)}else if(!e.ctrlKey){this._selectItem(i,e.shiftKey,false)}this._focusItem(i);this.update()}async goUp(){const e=this.model;if(e.path===e.rootPath){return}try{await e.cd("..")}catch(t){console.warn(`Failed to go to parent directory of ${e.path}`,t)}}evtKeydown(e){if(this._inRename){return}switch(e.keyCode){case 13:{if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey){return}e.preventDefault();e.stopPropagation();for(const e of this.selectedItems()){this.handleOpen(e)}return}case 38:this._handleArrowY(e,-1);return;case 40:this._handleArrowY(e,1);return;case 32:{if(e.ctrlKey){if(e.metaKey||e.shiftKey||e.altKey){return}const t=this._items[this._focusIndex];if(!(t.contains(e.target)&&t.contains(document.activeElement))){return}e.stopPropagation();e.preventDefault();const{path:n}=this._sortedItems[this._focusIndex];if(this.selection[n]){delete this.selection[n]}else{this.selection[n]=true}this.update();return}break}}if(e.key!==undefined&&e.key.length===1&&!((e.key===" "||e.keyCode===32)&&e.target.type==="checkbox")){if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey){return}this._searchPrefix+=e.key;clearTimeout(this._searchPrefixTimer);this._searchPrefixTimer=window.setTimeout((()=>{this._searchPrefix=""}),oe);this.selectByPrefix();e.stopPropagation();e.preventDefault()}}evtDblClick(e){if(e.button!==0){return}if(e.ctrlKey||e.shiftKey||e.altKey||e.metaKey){return}if(this.isWithinCheckboxHitArea(e)){return}e.preventDefault();e.stopPropagation();clearTimeout(this._selectTimer);this._editNode.blur();const t=e.target;const n=u.ArrayExt.findFirstIndex(this._items,(e=>e.contains(t)));if(n===-1){return}const i=this._sortedItems[n];this.handleOpen(i)}evtNativeDrop(e){var t,n,i;e.preventDefault();const s=(t=e.dataTransfer)===null||t===void 0?void 0:t.items;if(!s){const t=(n=e.dataTransfer)===null||n===void 0?void 0:n.files;if(!t||t.length===0){return}const i=[];for(const e of t){const t=this._model.upload(e);i.push(t)}Promise.all(i).then((()=>this._allUploaded.emit())).catch((e=>{console.error("Error while uploading files: ",e)}));return}const o=async(e,t)=>{if(he.isDirectoryEntry(e)){const n=await he.createDirectory(this._model.manager,t,e.name);const i=e.createReader();const s=await he.collectEntries(i);for(const e of s){await o(e,n)}}else if(he.isFileEntry(e)){const n=await he.readFile(e);await this._model.upload(n,t)}};const r=[];for(const a of s){const e=he.defensiveGetAsEntry(a);if(!e){continue}const t=o(e,(i=this._model.path)!==null&&i!==void 0?i:"/");r.push(t)}Promise.all(r).then((()=>this._allUploaded.emit())).catch((e=>{console.error("Error while uploading files: ",e)}))}get allUploaded(){return this._allUploaded}evtDragEnter(e){if(e.mimeData.hasData(K)){const t=he.hitTestNodes(this._items,e);if(t===-1){return}const n=this._sortedItems[t];if(n.type!=="directory"||this.selection[n.path]){return}const i=e.target;i.classList.add(G);e.preventDefault();e.stopPropagation()}}evtDragLeave(e){e.preventDefault();e.stopPropagation();const t=i.DOMUtils.findElement(this.node,G);if(t){t.classList.remove(G)}}evtDragOver(e){e.preventDefault();e.stopPropagation();e.dropAction=e.proposedAction;const t=i.DOMUtils.findElement(this.node,G);if(t){t.classList.remove(G)}const n=he.hitTestNodes(this._items,e);this._items[n].classList.add(G)}evtDrop(e){e.preventDefault();e.stopPropagation();clearTimeout(this._selectTimer);if(e.proposedAction==="none"){e.dropAction="none";return}if(!e.mimeData.hasData(K)){return}let t=e.target;while(t&&t.parentElement){if(t.classList.contains(G)){t.classList.remove(G);break}t=t.parentElement}const n=u.ArrayExt.firstIndexOf(this._items,t);const o=this._sortedItems;let r=this._model.path;if(o[n].type==="directory"){r=s.PathExt.join(r,o[n].name)}const a=this._manager;const l=[];const d=e.mimeData.getData(K);if(e.ctrlKey&&e.proposedAction==="move"){e.dropAction="copy"}else{e.dropAction=e.proposedAction}for(const i of d){const t=a.services.contents.localPath(i);const n=s.PathExt.basename(t);const o=s.PathExt.join(r,n);if(o===i){continue}if(e.dropAction==="copy"){l.push(a.copy(i,r))}else{l.push((0,h.renameFile)(a,i,o))}}Promise.all(l).catch((e=>{void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Error while copying/moving files"),e)}))}_startDrag(e,t,n){let i=Object.keys(this.selection);const s=this._items[e];const o=this._sortedItems;let r;let a;if(!s.classList.contains(Y)){a=o[e];i=[a.path];r=[a]}else{const e=i[0];a=o.find((t=>t.path===e));r=this.selectedItems()}if(!a){return}const l=this._manager.registry.getFileTypeForModel(a);const d=this.renderer.createDragImage(s,i.length,this._trans,l);this._drag=new j.Drag({dragImage:d,mimeData:new p.MimeData,supportedActions:"move",proposedAction:"move"});this._drag.mimeData.setData(K,i);const c=this.model.manager.services;for(const h of r){this._drag.mimeData.setData(J,{model:h,withContent:async()=>await c.contents.get(h.path)})}if(a&&a.type!=="directory"){const e=i.slice(1).reverse();this._drag.mimeData.setData(de,(()=>{if(!a){return}const t=a.path;let n=this._manager.findWidget(t);if(!n){n=this._manager.open(a.path)}if(e.length){const t=new p.PromiseDelegate;void t.promise.then((()=>{let t=n;e.forEach((e=>{const n={ref:t===null||t===void 0?void 0:t.id,mode:"tab-after"};t=this._manager.openOrReveal(e,void 0,void 0,n);this._manager.openOrReveal(a.path)}))}));t.resolve(void 0)}return n}))}document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true);clearTimeout(this._selectTimer);void this._drag.start(t,n).then((e=>{this._drag=null;clearTimeout(this._selectTimer)}))}handleFileSelect(e){const t=this._sortedItems;const n=he.hitTestNodes(this._items,e);clearTimeout(this._selectTimer);if(n===-1){return}this._softSelection="";const i=t[n].path;const s=Object.keys(this.selection);const o=e.button===0&&!(le&&e.ctrlKey)&&this.isWithinCheckboxHitArea(e);if(le&&e.metaKey||!le&&e.ctrlKey||o){if(this.selection[i]){delete this.selection[i]}else{this.selection[i]=true}this._focusItem(n)}else if(e.shiftKey){this._handleMultiSelect(n);this._focusItem(n)}else if(i in this.selection&&s.length>1){this._softSelection=i}else{return this._selectItem(n,false,true)}this.update()}_focusItem(e){const t=this._items;if(t.length===0){this._focusIndex=0;this.node.focus();return}this._focusIndex=e;const n=t[e];const i=this.renderer.getNameNode(n);if(i){i.tabIndex=0;i.focus()}}_allSelectedBetween(e,t){if(e===t){return}const[n,i]=ee&&this.selection[t.path]),true)}_handleMultiSelect(e){const t=this._sortedItems;const n=this._focusIndex;const i=t[e];let s=true;if(e===n){this.selection[i.path]=true;return}if(this.selection[i.path]){if(Math.abs(e-n)===1){const i=t[n];const s=t[n+(ethis._model.manager.deleteFile(e).catch((e=>{void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Delete Failed"),e)})))))}async _doRename(){this._inRename=true;const e=Object.keys(this.selection);if(e.length===0){this._inRename=false;return Promise.resolve("")}const t=this._sortedItems;let{path:n}=t[this._focusIndex];if(!this.selection[n]){n=e.slice(-1)[0]}const o=u.ArrayExt.findFirstIndex(t,(e=>e.path===n));const r=this._items[o];const a=t[o];const l=this.renderer.getNameNode(r);const d=a.name;this._editNode.value=d;this._selectItem(o,false,true);const c=await he.userInputForRename(l,this._editNode,d);if(this.isDisposed){this._inRename=false;throw new Error("File browser is disposed.")}let p=c;if(!c||c===d){p=d}else if(!(0,h.isValidFileName)(c)){void(0,i.showErrorMessage)(this._trans.__("Rename Error"),Error(this._trans._p("showErrorMessage",'"%1" is not a valid name for a file. Names must have nonzero length, and cannot include "/", "\\", or ":"',c)));p=d}else{const e=this._manager;const t=s.PathExt.join(this._model.path,d);const n=s.PathExt.join(this._model.path,c);try{await(0,h.renameFile)(e,t,n)}catch(m){if(m!=="File not renamed"){void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Rename Error"),m)}p=d}if(this.isDisposed){this._inRename=false;throw new Error("File browser is disposed.")}}if(!this.isDisposed&&Object.keys(this.selection).length===1&&this.selection[a.path]){try{await this._selectItemByName(p,true,true)}catch(g){console.warn("After rename, failed to select file",p)}}this._inRename=false;return p}_selectItem(e,t,n=true){const i=this._sortedItems;if(!t){this.clearSelectedItems()}const s=i[e].path;this.selection[s]=true;if(n){this._focusItem(e)}this.update()}_onModelRefreshed(){const e=Object.keys(this.selection);this.clearSelectedItems();for(const t of this._model.items()){const n=t.path;if(e.indexOf(n)!==-1){this.selection[n]=true}}if(this.isVisible){this.sort(this.sortState)}else{this._isDirty=true}}_onPathChanged(){this.clearSelectedItems();this.sort(this.sortState);requestAnimationFrame((()=>{this._focusItem(0)}))}_onFileChanged(e,t){const n=t.newValue;if(!n){return}const i=n.name;if(t.type!=="new"||!i){return}void this.selectItemByName(i).catch((()=>{}))}_onActivateRequested(e,t){const n=s.PathExt.dirname(t);if(n!==this._model.path){return}const i=s.PathExt.basename(t);this.selectItemByName(i).catch((()=>{}))}}(function(e){e.columns=[{id:"is_selected",className:W,itemClassName:W,minWidth:18,resizable:false,sortable:false,grow:0},{id:"name",className:U,itemClassName:B,minWidth:60,resizable:true,sortable:true,caretSide:"right",grow:3},{id:"last_modified",className:q,itemClassName:z,minWidth:60,resizable:true,sortable:true,caretSide:"left",grow:1},{id:"file_size",className:$,itemClassName:H,minWidth:60,resizable:true,sortable:true,caretSide:"left",grow:.5}];class t{constructor(){this.itemFactories={name:()=>{const e=document.createElement("span");const t=document.createElement("span");const n=document.createElement("span");t.className=F;n.className=O;e.className=B;e.appendChild(t);e.appendChild(n);return e},last_modified:()=>{const e=document.createElement("span");e.className=z;return e},file_size:()=>{const e=document.createElement("span");e.className=H;return e},is_selected:()=>this.createCheckboxWrapperNode()};this._modifiedColumnLastUpdate=new WeakMap;this._lastRenderedState=new WeakMap}createNode(){const e=document.createElement("div");const t=document.createElement("div");const n=document.createElement("ul");n.setAttribute("data-lm-dragscroll","true");n.className=R;t.className=D;e.appendChild(t);e.appendChild(n);e.tabIndex=-1;return e}populateHeaderNode(t,n,s,o){n=n||r.nullTranslator;const a=n.load("jupyterlab");const l={name:()=>this.createHeaderItemNode(a.__("Name")),last_modified:()=>this._createHeaderItemNodeWithSizes({small:a.__("Modified"),large:a.__("Last Modified")}),file_size:()=>this._createHeaderItemNodeWithSizes({small:a.__("Size"),large:a.__("File Size")}),is_selected:()=>this.createCheckboxWrapperNode({alwaysVisible:true,headerNode:true})};const d=e.columns.filter((e=>e.id==="name"||!(s===null||s===void 0?void 0:s.has(e.id))));for(const e of d){const n=l[e.id];const i=n();i.classList.add(e.className);const s=e.id===d[d.length-1].id;if(o){const t=o[e.id];if(!s){i.style.width=t+"px"}}t.appendChild(i);if(he.isResizable(e)&&!s){const n=document.createElement("div");n.classList.add(Q);n.dataset.column=e.id;t.appendChild(n)}}const c=i.DOMUtils.findElement(t,U);c.classList.add(Y);he.updateCaret(i.DOMUtils.findElement(c,L),"right","up")}handleHeaderClick(t,n){const s={direction:"ascending",key:"name"};const o=n.target;const r=e.columns.filter(he.isSortable);for(const e of r){const n=t.querySelector(`.${e.className}`);if(!n){continue}if(n.contains(o)){s.key=e.id;const o=i.DOMUtils.findElement(n,L);if(n.classList.contains(Y)){if(!n.classList.contains(se)){s.direction="descending";n.classList.add(se);he.updateCaret(o,e.caretSide,"down")}else{n.classList.remove(se);he.updateCaret(o,e.caretSide,"up")}}else{n.classList.remove(se);he.updateCaret(o,e.caretSide,"up")}n.classList.add(Y);for(const n of r){if(n.id===e.id){continue}const s=t.querySelector(`.${n.className}`);if(!s){continue}s.classList.remove(Y);s.classList.remove(se);const o=i.DOMUtils.findElement(s,L);he.updateCaret(o,n.caretSide)}return s}}return s}createItemNode(t,n){const i=document.createElement("li");for(const s of e.columns){if(s.id!="name"&&(t===null||t===void 0?void 0:t.has(s.id))){continue}const e=this.itemFactories[s.id];const o=e();i.appendChild(o);if(n){const e=n[s.id];o.style.width=e+"px"}}return i}createCheckboxWrapperNode(e){const t=document.createElement("label");t.classList.add(W);const n=document.createElement("input");n.type="checkbox";if(!(e===null||e===void 0?void 0:e.headerNode)){n.addEventListener("click",(e=>{e.preventDefault()}))}if(e===null||e===void 0?void 0:e.alwaysVisible){t.classList.add("jp-mod-visible")}else{n.tabIndex=-1}t.appendChild(n);return t}updateItemModified(e,t,n){const i=this._modifiedColumnLastUpdate.get(e);if((i===null||i===void 0?void 0:i.date)===t&&(i===null||i===void 0?void 0:i.style)===n){return}const o=new Date(t);const r=s.Time.formatHuman(o,n);const a=s.Time.format(o);e.textContent=r;e.title=a;this._modifiedColumnLastUpdate.set(e,{date:t,style:n})}updateItemNode(e,t,n,o,l,d,c,h){if(d){e.classList.add(Y)}n=n||S.DocumentRegistry.getDefaultTextFileType(o);const{icon:p,iconClass:m,name:g}=n;o=o||r.nullTranslator;const f=o.load("jupyterlab");const v=this._lastRenderedState.get(e);const _=JSON.stringify({name:t.name,selected:d,lastModified:t.last_modified,modifiedStyle:c,hiddenColumns:l,columnsSizes:h,fileSize:t.size});const b=i.DOMUtils.findElement(e,W);const y=b===null||b===void 0?void 0:b.querySelector('input[type="checkbox"]');if(y)y.checked=d!==null&&d!==void 0?d:false;if(v===_)return;this._lastRenderedState.set(e,_);const w=i.DOMUtils.findElement(e,F);const C=i.DOMUtils.findElement(e,O);const x=i.DOMUtils.findElement(e,B);let k=i.DOMUtils.findElement(e,z);let j=i.DOMUtils.findElement(e,H);const I=!(l===null||l===void 0?void 0:l.has("is_selected"));if(b&&!I){e.removeChild(b)}else if(I&&!b){const e=this.createCheckboxWrapperNode();x.insertAdjacentElement("beforebegin",e)}const E=!(l===null||l===void 0?void 0:l.has("last_modified"));if(k&&!E){e.removeChild(k)}else if(E&&!k){k=this.itemFactories.last_modified();x.insertAdjacentElement("afterend",k)}const M=!(l===null||l===void 0?void 0:l.has("file_size"));if(j&&!M){e.removeChild(j)}else if(M&&!j){j=this.itemFactories.file_size();(k!==null&&k!==void 0?k:x).insertAdjacentElement("afterend",j)}requestAnimationFrame((()=>{a.LabIcon.resolveElement({icon:p,iconClass:(0,a.classes)(m,"jp-Icon"),container:w,className:F,stylesheet:"listing"})}));let D=f.__("Name: %1",t.name);if(t.size!==null&&t.size!==undefined){const e=he.formatFileSize(t.size,1,1024);if(j){j.textContent=e}D+=f.__("\nSize: %1",he.formatFileSize(t.size,1,1024))}else if(j){j.textContent=""}if(t.path){const e=s.PathExt.dirname(t.path);if(e){D+=f.__("\nPath: %1",e.substr(0,50));if(e.length>50){D+="..."}}}if(t.created){D+=f.__("\nCreated: %1",s.Time.format(new Date(t.created)))}if(t.last_modified){D+=f.__("\nModified: %1",s.Time.format(new Date(t.last_modified)))}D+=f.__("\nWritable: %1",t.writable);e.title=D;e.setAttribute("data-file-type",g);if(t.name.startsWith(".")){e.setAttribute("data-is-dot","true")}else{e.removeAttribute("data-is-dot")}const A=!t.indices?[]:t.indices;let P=u.StringExt.highlight(t.name,A,T.h.mark);if(C){T.VirtualDOM.render(T.h.span(P),C)}if(y){let e;if(n.contentType==="directory"){e=d?f.__('Deselect directory "%1"',P):f.__('Select directory "%1"',P)}else{e=d?f.__('Deselect file "%1"',P):f.__('Select file "%1"',P)}y.setAttribute("aria-label",e);y.checked=d!==null&&d!==void 0?d:false}this.updateItemSize(e,t,c,h)}updateItemSize(t,n,s,o){if(o){for(const n of e.columns){const e=i.DOMUtils.findElement(t,n.itemClassName);if(!e){continue}const s=o[n.id];const r=s===null?"":s+"px";if(r!==e.style.width){e.style.width=r}}}let r=i.DOMUtils.findElement(t,z);if(n.last_modified&&r){this.updateItemModified(r,n.last_modified,s!==null&&s!==void 0?s:"short")}}getNameNode(e){return i.DOMUtils.findElement(e,O)}getCheckboxNode(e){return e.querySelector(`.${W} input[type=checkbox]`)}createDragImage(t,n,s,o){const r=t.cloneNode(true);const a=i.DOMUtils.findElement(r,F);const l=e.columns.filter((e=>e.id!=="name"));for(const e of l){const t=i.DOMUtils.findElement(r,e.itemClassName);if(!t){continue}r.removeChild(t)}if(!o){a.textContent="";a.className=""}else{a.textContent=o.iconLabel||"";a.className=o.iconClass||""}a.classList.add(X);if(n>1){const e=i.DOMUtils.findElement(r,O);e.textContent=s._n("%1 Item","%1 Items",n)}return r}createHeaderItemNode(e){const t=document.createElement("div");const n=document.createElement("span");const i=document.createElement("span");t.className=A;n.className=P;i.className=L;n.textContent=e;t.appendChild(n);t.appendChild(i);return t}_createHeaderItemNodeWithSizes(e){const t=document.createElement("div");t.className=A;const n=document.createElement("span");n.className=L;for(let i of Object.keys(e)){const n=document.createElement("span");n.classList.add(P,P+"-"+i);n.textContent=e[i];t.appendChild(n)}t.appendChild(n);return t}}e.Renderer=t;e.defaultRenderer=new t})(ce||(ce={}));var he;(function(e){function t(e,t,n){const i=e.parentElement;i.replaceChild(t,e);t.focus();const s=t.value.lastIndexOf(".");if(s===-1){t.setSelectionRange(0,t.value.length)}else{t.setSelectionRange(0,s)}return new Promise((s=>{t.onblur=()=>{i.replaceChild(e,t);s(t.value)};t.onkeydown=i=>{switch(i.keyCode){case 13:i.stopPropagation();i.preventDefault();t.blur();break;case 27:i.stopPropagation();i.preventDefault();t.value=n;t.blur();e.focus();break;default:break}}}))}e.userInputForRename=t;function n(e,t,n=false,i){const s=Array.from(e);const o=t.direction==="descending"?1:-1;function r(e,t){if(n){return e.type!==t.type}return e.type==="directory"!==(t.type==="directory")}function a(e){if(e.type==="directory"){return 2}if(e.type==="notebook"&&n){return 1}return 0}function l(e,t){var n;const s=navigator.language.split("@")[0];const o=((n=i.languageCode)!==null&&n!==void 0?n:s).replace("_","-");try{return e.name.localeCompare(t.name,o,{numeric:true,sensitivity:"base"})}catch(r){console.warn(`localeCompare failed to compare ${e.name} and ${t.name} under languageCode: ${o}`);return e.name.localeCompare(t.name,s,{numeric:true,sensitivity:"base"})}}function d(e){return(t,n)=>{if(r(t,n)){return a(n)-a(t)}const i=e(t,n);if(i!==0){return i*o}return l(t,n)}}if(t.key==="last_modified"){s.sort(d(((e,t)=>new Date(e.last_modified).getTime()-new Date(t.last_modified).getTime())))}else if(t.key==="file_size"){s.sort(d(((e,t)=>{var n,i;return((n=t.size)!==null&&n!==void 0?n:0)-((i=e.size)!==null&&i!==void 0?i:0)})))}else{s.sort(d(((e,t)=>l(t,e))))}return s}e.sort=n;e.isResizable=e=>"resizable"in e&&e.resizable;e.isSortable=e=>"sortable"in e&&e.sortable;function i(e,t){return u.ArrayExt.findFirstIndex(e,(e=>m.ElementExt.hitTest(e,t.clientX,t.clientY)||t.target===e))}e.hitTestNodes=i;function o(e,t,n){if(e===0){return"0 B"}const i=t||2;const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];const o=Math.floor(Math.log(e)/Math.log(n));if(o>=0&&oe.readEntries(t,n)))}function g(e){return new Promise(((t,n)=>e.file(t,n)))}e.readFile=g;async function f(e){const t=[];let n=false;while(!n){const i=await p(e);if(i.length===0){n=true}else{t.push(...i)}}return t}e.collectEntries=f})(he||(he={}));const ue="jp-FileBrowser";const pe="jp-FileBrowser-Panel";const me="jp-FileBrowser-crumbs";const ge="jp-FileBrowser-toolbar";const fe="jp-FileBrowser-filterToolbar";const ve="jp-FileBrowser-listing";const _e="jp-FileBrowser-filterBox";class be extends a.SidePanel{constructor(e){var t;super({content:new l.Panel,translator:e.translator});this._directoryPending=null;this._filePending=null;this._fileFilterRef=(0,d.createRef)();this._allowSingleClick=false;this._showFileCheckboxes=false;this._showFileFilter=false;this._showFileSizeColumn=false;this._showHiddenFiles=false;this._showLastModifiedColumn=true;this._sortNotebooksFirst=false;this.addClass(ue);this.toolbar.addClass(ge);this.id=e.id;const n=this.translator=(t=e.translator)!==null&&t!==void 0?t:r.nullTranslator;const i=this.model=e.model;const s=e.renderer;i.connectionFailure.connect(this._onConnectionFailure,this);this._manager=i.manager;this.toolbar.node.setAttribute("aria-label",this._trans.__("file browser"));this.mainPanel=new l.Panel;this.mainPanel.addClass(pe);this.mainPanel.title.label=this._trans.__("File Browser");this.crumbs=new C({model:i,translator:n});this.crumbs.addClass(me);const o=(0,a.FilenameSearcher)({updateFilter:(e,t)=>{this.model.setFilter((t=>e(t.name.toLowerCase())))},useFuzzyFilter:this.model.useFuzzyFilter,placeholder:this._trans.__("Filter files by name"),forceRefresh:false,showIcon:false,inputRef:this._fileFilterRef,filterSettingsChanged:this.model.filterSettingsChanged});o.addClass(_e);this.filterToolbar=new a.Toolbar;this.filterToolbar.addClass(fe);this.filterToolbar.node.setAttribute("aria-label",this._trans.__("File browser toolbar"));this.filterToolbar.addItem("fileNameSearcher",o);this.filterToolbar.setHidden(!this.showFileFilter);this.listing=this.createDirListing({model:i,renderer:s,translator:n,state:e.state});this.listing.addClass(ve);this.mainPanel.addWidget(this.crumbs);this.mainPanel.addWidget(this.filterToolbar);this.mainPanel.addWidget(this.listing);this.addWidget(this.mainPanel);if(e.restore!==false){void i.restore(this.id)}void this.listing.restore(this.id)}get navigateToCurrentDirectory(){return this._navigateToCurrentDirectory}set navigateToCurrentDirectory(e){this._navigateToCurrentDirectory=e}get showLastModifiedColumn(){return this._showLastModifiedColumn}set showLastModifiedColumn(e){if(this.listing.setColumnVisibility){this.listing.setColumnVisibility("last_modified",e);this._showLastModifiedColumn=e}else{console.warn("Listing does not support toggling column visibility")}}get showFullPath(){return this.crumbs.fullPath}set showFullPath(e){this.crumbs.fullPath=e}get showFileSizeColumn(){return this._showFileSizeColumn}set showFileSizeColumn(e){if(this.listing.setColumnVisibility){this.listing.setColumnVisibility("file_size",e);this._showFileSizeColumn=e}else{console.warn("Listing does not support toggling column visibility")}}get showHiddenFiles(){return this._showHiddenFiles}set showHiddenFiles(e){this.model.showHiddenFiles(e);this._showHiddenFiles=e}get showFileCheckboxes(){return this._showFileCheckboxes}set showFileCheckboxes(e){if(this.listing.setColumnVisibility){this.listing.setColumnVisibility("is_selected",e);this._showFileCheckboxes=e}else{console.warn("Listing does not support toggling column visibility")}}get showFileFilter(){return this._showFileFilter}set showFileFilter(e){var t;const n=this.showFileFilter;if(n&&!e){if(this._fileFilterRef.current){this._fileFilterRef.current.value=""}this.model.setFilter((e=>({})));this.model.refresh().catch(console.warn)}this._showFileFilter=e;this.filterToolbar.setHidden(!this.showFileFilter);if(this.showFileFilter){(t=this._fileFilterRef.current)===null||t===void 0?void 0:t.focus()}}get sortNotebooksFirst(){return this._sortNotebooksFirst}set sortNotebooksFirst(e){if(this.listing.setNotebooksFirstSorting){this.listing.setNotebooksFirstSorting(e);this._sortNotebooksFirst=e}else{console.warn("Listing does not support sorting notebooks first")}}get singleClickNavigation(){return this._allowSingleClick}set singleClickNavigation(e){if(this.listing.setAllowSingleClickNavigation){this.listing.setAllowSingleClickNavigation(e);this._allowSingleClick=e}else{console.warn("Listing does not support single click navigation")}}selectedItems(){return this.listing.selectedItems()}async selectItemByName(e){await this.listing.selectItemByName(e)}clearSelectedItems(){this.listing.clearSelectedItems()}rename(){return this.listing.rename()}cut(){this.listing.cut()}copy(){this.listing.copy()}paste(){return this.listing.paste()}async _createNew(e){if(e.path){const t=this._manager.services.contents.localPath(e.path);e.path=this._toDrivePath(this.model.driveName,t)}try{const t=await this._manager.newUntitled(e);await this.listing.selectItemByName(t.name,true);await this.rename();return t}catch(t){void(0,i.showErrorMessage)(this._trans.__("Error"),t);throw t}}async createNewDirectory(){if(this._directoryPending){return this._directoryPending}this._directoryPending=this._createNew({path:this.model.path,type:"directory"});try{return await this._directoryPending}finally{this._directoryPending=null}}async createNewFile(e){if(this._filePending){return this._filePending}this._filePending=this._createNew({path:this.model.path,type:"file",ext:e.ext});try{return await this._filePending}finally{this._filePending=null}}delete(){return this.listing.delete()}duplicate(){return this.listing.duplicate()}download(){return this.listing.download()}async goUp(){return this.listing.goUp()}shutdownKernels(){return this.listing.shutdownKernels()}selectNext(){this.listing.selectNext()}selectPrevious(){this.listing.selectPrevious()}modelForClick(e){return this.listing.modelForClick(e)}createDirListing(e){return new ce(e)}_onConnectionFailure(e,t){if(t instanceof o.ServerConnection.ResponseError&&t.response.status===404){const e=this._trans.__("Directory not found");t.message=this._trans.__('Directory not found: "%1"',this.model.path);void(0,i.showErrorMessage)(e,t)}}_toDrivePath(e,t){if(e===""){return t}else{return`${e}:${s.PathExt.removeSlash(t)}`}}}var ye=n(26568);const we=1e4;const Ce=15*1024*1024;const xe=1024*1024;class Se{constructor(e){var t;this._connectionFailure=new E.Signal(this);this._fileChanged=new E.Signal(this);this._items=[];this._key="";this._pathChanged=new E.Signal(this);this._paths=new Set;this._pending=null;this._pendingPath=null;this._refreshed=new E.Signal(this);this._sessions=[];this._state=null;this._isDisposed=false;this._restored=new p.PromiseDelegate;this._uploads=[];this._uploadChanged=new E.Signal(this);this.manager=e.manager;this.translator=e.translator||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this._driveName=e.driveName||"";this._model={path:this.rootPath,name:s.PathExt.basename(this.rootPath),type:"directory",content:undefined,writable:false,created:"unknown",last_modified:"unknown",mimetype:"text/plain",format:"text"};this._state=e.state||null;const n=e.refreshInterval||we;const{services:i}=e.manager;i.contents.fileChanged.connect(this.onFileChanged,this);i.sessions.runningChanged.connect(this.onRunningChanged,this);this._unloadEventListener=e=>{if(this._uploads.length>0){const t=this._trans.__("Files still uploading");e.returnValue=t;return t}};window.addEventListener("beforeunload",this._unloadEventListener);this._poll=new ye.Poll({auto:(t=e.auto)!==null&&t!==void 0?t:true,name:"@jupyterlab/filebrowser:Model",factory:()=>this.cd("."),frequency:{interval:n,backoff:true,max:300*1e3},standby:e.refreshStandby||"when-hidden"})}get connectionFailure(){return this._connectionFailure}get driveName(){return this._driveName}get restored(){return this._restored.promise}get fileChanged(){return this._fileChanged}get path(){return this._model?this._model.path:""}get rootPath(){return this._driveName?this._driveName+":":""}get pathChanged(){return this._pathChanged}get refreshed(){return this._refreshed}get specs(){return this.manager.services.kernelspecs.specs}get isDisposed(){return this._isDisposed}get uploadChanged(){return this._uploadChanged}uploads(){return this._uploads[Symbol.iterator]()}dispose(){if(this.isDisposed){return}window.removeEventListener("beforeunload",this._unloadEventListener);this._isDisposed=true;this._poll.dispose();this._sessions.length=0;this._items.length=0;E.Signal.clearData(this)}items(){return this._items[Symbol.iterator]()}sessions(){return this._sessions[Symbol.iterator]()}async refresh(){await this._poll.refresh();await this._poll.tick;this._refreshed.emit(void 0)}async cd(e="."){if(e!=="."){e=this.manager.services.contents.resolvePath(this._model.path,e)}else{e=this._pendingPath||this._model.path}if(this._pending){if(e===this._pendingPath){return this._pending}await this._pending}const t=this.path;const n={content:true};this._pendingPath=e;if(t!==e){this._sessions.length=0}const i=this.manager.services;this._pending=i.contents.get(e,n).then((n=>{if(this.isDisposed){return}this.handleContents(n);this._pendingPath=null;this._pending=null;if(t!==e){if(this._state&&this._key){void this._state.save(this._key,{path:e})}this._pathChanged.emit({name:"path",oldValue:t,newValue:e})}this.onRunningChanged(i.sessions,i.sessions.running());this._refreshed.emit(void 0)})).catch((t=>{this._pendingPath=null;this._pending=null;if(t.response&&t.response.status===404&&e!=="/"){t.message=this._trans.__('Directory not found: "%1"',this._model.path);console.error(t);this._connectionFailure.emit(t);return this.cd("/")}else{this._connectionFailure.emit(t)}}));return this._pending}async download(e){const t=await this.manager.services.contents.getDownloadUrl(e);const n=document.createElement("a");n.href=t;n.download="";document.body.appendChild(n);n.click();document.body.removeChild(n);return void 0}async restore(e,t=true){const{manager:n}=this;const i=`file-browser-${e}:cwd`;const s=this._state;const o=!!this._key;if(o){return}this._key=i;if(!t||!s){this._restored.resolve(undefined);return}await n.services.ready;try{const e=await s.fetch(i);if(!e){this._restored.resolve(undefined);return}const t=e["path"];if(t){await this.cd("/")}const o=n.services.contents.localPath(t);await n.services.contents.get(t);await this.cd(o)}catch(r){await s.remove(i)}this._restored.resolve(undefined)}async upload(e,t){const n=s.PageConfig.getNotebookVersion();const i=n<[4,0,0]||n>=[5,1,0];const o=e.size>Ce;if(o&&!i){const t=this._trans.__("Cannot upload file (>%1 MB). %2",Ce/(1024*1024),e.name);console.warn(t);throw t}const r="File not uploaded";if(o&&!(await this._shouldUploadLarge(e))){throw"Cancelled large file upload"}await this._uploadCheckDisposed();await this.refresh();await this._uploadCheckDisposed();if(this._items.find((t=>t.name===e.name))&&!(await(0,h.shouldOverwrite)(e.name))){throw r}await this._uploadCheckDisposed();const a=i&&e.size>xe;return await this._upload(e,a,t)}async _shouldUploadLarge(e){const{button:t}=await(0,i.showDialog)({title:this._trans.__("Large file size warning"),body:this._trans.__("The file size is %1 MB. Do you still want to upload it?",Math.round(e.size/(1024*1024))),buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.warnButton({label:this._trans.__("Upload")})]});return t.accept}async _upload(e,t,n){let i=typeof n==="undefined"?this._model.path:n;i=i?i+"/"+e.name:e.name;const s=e.name;const o="file";const r="base64";const a=async(t,n)=>{await this._uploadCheckDisposed();const a=new FileReader;a.readAsDataURL(t);await new Promise(((t,n)=>{a.onload=t;a.onerror=t=>n(`Failed to upload "${e.name}":`+t)}));await this._uploadCheckDisposed();const l=a.result.split(",")[1];const d={type:o,format:r,name:s,chunk:n,content:l};return await this.manager.services.contents.save(i,d)};if(!t){try{return await a(e)}catch(c){u.ArrayExt.removeFirstWhere(this._uploads,(t=>e.name===t.path));throw c}}let l;let d={path:i,progress:0};this._uploadChanged.emit({name:"start",newValue:d,oldValue:null});for(let h=0;!l;h+=xe){const t=h+xe;const n=t>=e.size;const s=n?-1:t/xe;const o={path:i,progress:h/e.size};this._uploads.splice(this._uploads.indexOf(d));this._uploads.push(o);this._uploadChanged.emit({name:"update",newValue:o,oldValue:d});d=o;let r;try{r=await a(e.slice(h,t),s)}catch(c){u.ArrayExt.removeFirstWhere(this._uploads,(t=>e.name===t.path));this._uploadChanged.emit({name:"failure",newValue:d,oldValue:null});throw c}if(n){l=r}}this._uploads.splice(this._uploads.indexOf(d));this._uploadChanged.emit({name:"finish",newValue:null,oldValue:d});return l}_uploadCheckDisposed(){if(this.isDisposed){return Promise.reject("Filemanager disposed. File upload canceled")}return Promise.resolve()}handleContents(e){this._model={name:e.name,path:e.path,type:e.type,content:undefined,writable:e.writable,created:e.created,last_modified:e.last_modified,size:e.size,mimetype:e.mimetype,format:e.format};this._items=e.content;this._paths.clear();e.content.forEach((e=>{this._paths.add(e.path)}))}onRunningChanged(e,t){this._populateSessions(t);this._refreshed.emit(void 0)}onFileChanged(e,t){const n=this._model.path;const{sessions:i}=this.manager.services;const{oldValue:o,newValue:r}=t;const a=this.driveName.length>0?this.driveName+":":"";const l=o&&o.path&&a+s.PathExt.dirname(o.path)===n?o:r&&r.path&&a+s.PathExt.dirname(r.path)===n?r:undefined;if(l){void this._poll.refresh();this._populateSessions(i.running());this._fileChanged.emit(t);return}}_populateSessions(e){this._sessions.length=0;for(const t of e){if(this._paths.has(t.path)){this._sessions.push(t)}}}}class ke extends Se{constructor(e){super(e);this._includeHiddenFiles=e.includeHiddenFiles||false}items(){return this._includeHiddenFiles?super.items():(0,u.filter)(super.items(),(e=>!e.name.startsWith(".")))}showHiddenFiles(e){this._includeHiddenFiles=e;void this.refresh()}}class je extends ke{constructor(e){var t,n,i;super(e);this._filterSettingsChanged=new E.Signal(this);this._filter=(t=e.filter)!==null&&t!==void 0?t:e=>({});this._filterDirectories=(n=e.filterDirectories)!==null&&n!==void 0?n:true;this._useFuzzyFilter=(i=e.useFuzzyFilter)!==null&&i!==void 0?i:true}get filterDirectories(){return this._filterDirectories}set filterDirectories(e){this._filterDirectories=e}get useFuzzyFilter(){return this._useFuzzyFilter}set useFuzzyFilter(e){if(this._useFuzzyFilter===e){return}this._useFuzzyFilter=e;this._filterSettingsChanged.emit({useFuzzyFilter:e})}get filterSettingsChanged(){return this._filterSettingsChanged}items(){return(0,u.filter)(super.items(),(e=>{if(!this._filterDirectories&&e.type==="directory"){return true}else{const t=this._filter(e);e.indices=t===null||t===void 0?void 0:t.indices;return!!t}}))}setFilter(e){this._filter=e;void this.refresh()}}const Ie="jp-Open-Dialog";const Ee="jp-Open-Dialog-label";var Te;(function(e){async function t(e){const t=e.translator||r.nullTranslator;const n=t.load("jupyterlab");const s=new Me(e.manager,e.filter,t,e.defaultPath,e.label);const o={title:e.title,buttons:[i.Dialog.cancelButton(),i.Dialog.okButton({label:n.__("Select")})],focusNodeSelector:e.focusNodeSelector,host:e.host,renderer:e.renderer,body:s};await s.ready;const a=new i.Dialog(o);return a.launch()}e.getOpenFiles=t;function n(e){return t({...e,filter:e=>e.type==="directory"?{}:null})}e.getExistingDirectory=n})(Te||(Te={}));class Me extends l.Widget{constructor(e,t,n,s,o,d){super();this._ready=new p.PromiseDelegate;n=n!==null&&n!==void 0?n:r.nullTranslator;const c=n.load("jupyterlab");this.addClass(Ie);De.createFilteredFileBrowser("filtered-file-browser-dialog",e,t,{},n,s,d).then((e=>{this._browser=e;(0,i.setToolbar)(this._browser,(e=>[{name:"new-folder",widget:new i.ToolbarButton({icon:a.newFolderIcon,onClick:()=>{void e.createNewDirectory()},tooltip:c.__("New Folder")})},{name:"refresher",widget:new i.ToolbarButton({icon:a.refreshIcon,onClick:()=>{e.model.refresh().catch((e=>{console.error("Failed to refresh file browser in open dialog.",e)}))},tooltip:c.__("Refresh File List")})}]));const t=new l.PanelLayout;if(o){const e=new l.Widget;e.addClass(Ee);e.node.textContent=o;t.addWidget(e)}t.addWidget(this._browser);this.dispose=()=>{if(this.isDisposed){return}this._browser.model.dispose();super.dispose()};this.layout=t;this._ready.resolve()})).catch((e=>{console.error("Error while creating file browser in open dialog",e);this._ready.reject(void 0)}))}getValue(){const e=Array.from(this._browser.selectedItems());if(e.length===0){return[{path:this._browser.model.path,name:s.PathExt.basename(this._browser.model.path),type:"directory",content:undefined,writable:false,created:"unknown",last_modified:"unknown",mimetype:"text/plain",format:"text"}]}else{return e}}get ready(){return this._ready.promise}}var De;(function(e){e.createFilteredFileBrowser=async(e,t,n,i={},s,o,a)=>{s=s||r.nullTranslator;const l=new je({manager:t,filter:n,translator:s,driveName:i.driveName,refreshInterval:i.refreshInterval,filterDirectories:a});const d=new be({id:e,model:l,translator:s});if(o){await d.model.cd(o)}return d}})(De||(De={}));const Ae=new p.Token("@jupyterlab/filebrowser:IFileBrowserFactory",`A factory object that creates file browsers.\n Use this if you want to create your own file browser (e.g., for a custom storage backend),\n or to interact with other file browsers that have been created by extensions.`);const Pe=new p.Token("@jupyterlab/filebrowser:IDefaultFileBrowser","A service for the default file browser.");const Le=new p.Token("@jupyterlab/filebrowser:IFileBrowserCommands","A token to ensure file browser commands are loaded.");class Re extends a.ToolbarButton{constructor(e){super({icon:a.fileUploadIcon,label:e.label,onClick:()=>{this._input.click()},tooltip:Ne.translateToolTip(e.translator)});this._onInputChanged=()=>{const e=Array.prototype.slice.call(this._input.files);const t=e.map((e=>this.fileBrowserModel.upload(e)));void Promise.all(t).catch((e=>{void(0,i.showErrorMessage)(this._trans._p("showErrorMessage","Upload Error"),e)}))};this._onInputClicked=()=>{this._input.value=""};this._input=Ne.createUploadInput();this.fileBrowserModel=e.model;this.translator=e.translator||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this._input.onclick=this._onInputClicked;this._input.onchange=this._onInputChanged;this.addClass("jp-id-upload")}}var Ne;(function(e){function t(){const e=document.createElement("input");e.type="file";e.multiple=true;return e}e.createUploadInput=t;function n(e){e=e||r.nullTranslator;const t=e.load("jupyterlab");return t.__("Upload Files")}e.translateToolTip=n})(Ne||(Ne={}));var Oe=n(66987);const Be=4;function Fe(e){const t=e.translator||r.nullTranslator;const n=t.load("jupyterlab");return c().createElement(Oe.GroupItem,{spacing:Be},c().createElement(Oe.TextItem,{source:n.__("Uploading…")}),c().createElement(Oe.ProgressBar,{percentage:e.upload}))}const ze=2e3;class He extends a.VDomRenderer{constructor(e){super(new He.Model(e.tracker.currentWidget&&e.tracker.currentWidget.model));this._onBrowserChange=(e,t)=>{if(t===null){this.model.browserModel=null}else{this.model.browserModel=t.model}};this.translator=e.translator||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this._tracker=e.tracker;this._tracker.currentChanged.connect(this._onBrowserChange)}render(){const e=this.model.items;if(e.length>0){const e=this.model.items[0];if(e.complete){return c().createElement(Oe.TextItem,{source:this._trans.__("Complete!")})}else{return c().createElement(Fe,{upload:this.model.items[0].progress,translator:this.translator})}}else{return c().createElement(Fe,{upload:100,translator:this.translator})}}dispose(){super.dispose();this._tracker.currentChanged.disconnect(this._onBrowserChange)}}(function(e){class t extends a.VDomModel{constructor(e){super();this._uploadChanged=(e,t)=>{if(t.name==="start"){this._items.push({path:t.newValue.path,progress:t.newValue.progress*100,complete:false})}else if(t.name==="update"){const e=u.ArrayExt.findFirstIndex(this._items,(e=>e.path===t.oldValue.path));if(e!==-1){this._items[e].progress=t.newValue.progress*100}}else if(t.name==="finish"){const e=u.ArrayExt.findFirstValue(this._items,(e=>e.path===t.oldValue.path));if(e){e.complete=true;setTimeout((()=>{u.ArrayExt.removeFirstOf(this._items,e);this.stateChanged.emit(void 0)}),ze)}}else if(t.name==="failure"){u.ArrayExt.removeFirstWhere(this._items,(e=>e.path===t.newValue.path))}this.stateChanged.emit(void 0)};this._items=[];this._browserModel=null;this.browserModel=e}get items(){return this._items}get browserModel(){return this._browserModel}set browserModel(e){const t=this._browserModel;if(t){t.uploadChanged.disconnect(this._uploadChanged)}this._browserModel=e;this._items=[];if(this._browserModel!==null){this._browserModel.uploadChanged.connect(this._uploadChanged)}this.stateChanged.emit(void 0)}}e.Model=t})(He||(He={}))},39063:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(38457);var a=n(79010);var l=n(41603);var d=n(85072);var c=n.n(d);var h=n(97825);var u=n.n(h);var p=n(77659);var m=n.n(p);var g=n(55056);var f=n.n(g);var v=n(10540);var _=n.n(v);var b=n(41113);var y=n.n(b);var w=n(96562);var C={};C.styleTagTransform=y();C.setAttributes=f();C.insert=m().bind(null,"head");C.domAPI=u();C.insertStyleElement=_();var x=c()(w.A,C);const S=w.A&&w.A.locals?w.A.locals:undefined},57256:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Commands:()=>T,default:()=>F,tabSpaceStatus:()=>P});var i=n(74991);var s=n(72050);var o=n(98335);var r=n(90567);var a=n(26087);var l=n(16015);var d=n(87277);var c=n(45231);var h=n(38894);var u=n(11447);var p=n(90295);var m=n(56759);var g=n(15615);var f=n(66987);var v=n(10553);var _=n(61927);var b=n(66127);var y=n(34236);var w=n(58285);var C=n(43370);var x=n(37737);var S=n(90044);const k="notebook:toggle-autoclosing-brackets";const j="console:toggle-autoclosing-brackets";var I;(function(e){e.createNew="fileeditor:create-new";e.createNewMarkdown="fileeditor:create-new-markdown-file";e.changeFontSize="fileeditor:change-font-size";e.lineNumbers="fileeditor:toggle-line-numbers";e.currentLineNumbers="fileeditor:toggle-current-line-numbers";e.lineWrap="fileeditor:toggle-line-wrap";e.currentLineWrap="fileeditor:toggle-current-line-wrap";e.changeTabs="fileeditor:change-tabs";e.matchBrackets="fileeditor:toggle-match-brackets";e.currentMatchBrackets="fileeditor:toggle-current-match-brackets";e.autoClosingBrackets="fileeditor:toggle-autoclosing-brackets";e.autoClosingBracketsUniversal="fileeditor:toggle-autoclosing-brackets-universal";e.createConsole="fileeditor:create-console";e.replaceSelection="fileeditor:replace-selection";e.restartConsole="fileeditor:restart-console";e.runCode="fileeditor:run-code";e.runAllCode="fileeditor:run-all";e.markdownPreview="fileeditor:markdown-preview";e.undo="fileeditor:undo";e.redo="fileeditor:redo";e.cut="fileeditor:cut";e.copy="fileeditor:copy";e.paste="fileeditor:paste";e.selectAll="fileeditor:select-all";e.invokeCompleter="completer:invoke-file";e.selectCompleter="completer:select-file";e.openCodeViewer="code-viewer:open";e.changeTheme="fileeditor:change-theme";e.changeLanguage="fileeditor:change-language";e.find="fileeditor:find";e.goToLine="fileeditor:go-to-line"})(I||(I={}));const E="Editor";var T;(function(e){let t={};let n=true;function i(e,t){return async function n(i,s){var o,r,a;const l=s||{};const d=await e.execute("console:create",{activate:l["activate"],name:(o=i.context.contentsModel)===null||o===void 0?void 0:o.name,path:i.context.path,preferredLanguage:i.context.model.defaultKernelLanguage||((a=(r=t.findByFileName(i.context.path))===null||r===void 0?void 0:r.name)!==null&&a!==void 0?a:""),ref:i.id,insertMode:"split-bottom"});i.context.pathChanged.connect(((e,t)=>{var n;d.session.setPath(t);d.session.setName((n=i.context.contentsModel)===null||n===void 0?void 0:n.name)}))}}function r(e,i){var s;t=(s=e.get("editorConfig").composite)!==null&&s!==void 0?s:{};n=e.get("scrollPasteEnd").composite;i.notifyCommandChanged(I.lineNumbers);i.notifyCommandChanged(I.currentLineNumbers);i.notifyCommandChanged(I.lineWrap);i.notifyCommandChanged(I.currentLineWrap);i.notifyCommandChanged(I.changeTabs);i.notifyCommandChanged(I.matchBrackets);i.notifyCommandChanged(I.currentMatchBrackets);i.notifyCommandChanged(I.autoClosingBrackets);i.notifyCommandChanged(I.changeLanguage)}e.updateSettings=r;function a(e){e.forEach((e=>{l(e.content)}))}e.updateTracker=a;function l(e){const i=e.editor;i.setOptions({...t,scrollPastEnd:n})}e.updateWidget=l;function d(e,n,r,a,l,d,c,m,g,f,v,_){var y;e.addCommand(I.changeFontSize,{execute:e=>{var i;const s=Number(e["delta"]);if(Number.isNaN(s)){console.error(`${I.changeFontSize}: delta arg must be a number`);return}const o=window.getComputedStyle(document.documentElement);const r=parseInt(o.getPropertyValue("--jp-code-font-size"),10);if(!t.customStyles){t.customStyles={}}const l=((i=t["customStyles"]["fontSize"])!==null&&i!==void 0?i:m.baseConfiguration["customStyles"]["fontSize"])||r;t.customStyles.fontSize=l+s;return n.set(a,"editorConfig",t).catch((e=>{console.error(`Failed to set ${a}: ${e.message}`)}))},label:e=>{const t=Number(e["delta"]);if(Number.isNaN(t)){console.error(`${I.changeFontSize}: delta arg must be a number`)}if(t>0){return e.isMenu?r.__("Increase Text Editor Font Size"):r.__("Increase Font Size")}else{return e.isMenu?r.__("Decrease Text Editor Font Size"):r.__("Decrease Font Size")}}});e.addCommand(I.lineNumbers,{execute:async()=>{var e;t.lineNumbers=!((e=t.lineNumbers)!==null&&e!==void 0?e:m.baseConfiguration.lineNumbers);try{return await n.set(a,"editorConfig",t)}catch(i){console.error(`Failed to set ${a}: ${i.message}`)}},isEnabled:l,isToggled:()=>{var e;return(e=t.lineNumbers)!==null&&e!==void 0?e:m.baseConfiguration.lineNumbers},label:r.__("Show Line Numbers")});e.addCommand(I.currentLineNumbers,{label:r.__("Show Line Numbers"),caption:r.__("Show the line numbers for the current file."),execute:()=>{const e=d.currentWidget;if(!e){return}const t=!e.content.editor.getOption("lineNumbers");e.content.editor.setOption("lineNumbers",t)},isEnabled:l,isToggled:()=>{var e;const t=d.currentWidget;return(e=t===null||t===void 0?void 0:t.content.editor.getOption("lineNumbers"))!==null&&e!==void 0?e:false}});e.addCommand(I.lineWrap,{execute:async e=>{var i;t.lineWrap=(i=e["mode"])!==null&&i!==void 0?i:false;try{return await n.set(a,"editorConfig",t)}catch(s){console.error(`Failed to set ${a}: ${s.message}`)}},isEnabled:l,isToggled:e=>{var n,i;const s=(n=e["mode"])!==null&&n!==void 0?n:false;return s===((i=t.lineWrap)!==null&&i!==void 0?i:m.baseConfiguration.lineWrap)},label:r.__("Word Wrap")});e.addCommand(I.currentLineWrap,{label:r.__("Wrap Words"),caption:r.__("Wrap words for the current file."),execute:()=>{const e=d.currentWidget;if(!e){return}const t=e.content.editor.getOption("lineWrap");e.content.editor.setOption("lineWrap",!t)},isEnabled:l,isToggled:()=>{var e;const t=d.currentWidget;return(e=t===null||t===void 0?void 0:t.content.editor.getOption("lineWrap"))!==null&&e!==void 0?e:false}});e.addCommand(I.changeTabs,{label:e=>{var t;if(e.size){return r._p("v4","Spaces: %1",(t=e.size)!==null&&t!==void 0?t:"")}else{return r.__("Indent with Tab")}},execute:async e=>{var i;t.indentUnit=e["size"]!==undefined?((i=e["size"])!==null&&i!==void 0?i:"4").toString():"Tab";try{return await n.set(a,"editorConfig",t)}catch(s){console.error(`Failed to set ${a}: ${s.message}`)}},isToggled:e=>{var n;const i=(n=t.indentUnit)!==null&&n!==void 0?n:m.baseConfiguration.indentUnit;return e["size"]?e["size"]===i:"Tab"==i}});e.addCommand(I.matchBrackets,{execute:async()=>{var e;t.matchBrackets=!((e=t.matchBrackets)!==null&&e!==void 0?e:m.baseConfiguration.matchBrackets);try{return await n.set(a,"editorConfig",t)}catch(i){console.error(`Failed to set ${a}: ${i.message}`)}},label:r.__("Match Brackets"),isEnabled:l,isToggled:()=>{var e;return(e=t.matchBrackets)!==null&&e!==void 0?e:m.baseConfiguration.matchBrackets}});e.addCommand(I.currentMatchBrackets,{label:r.__("Match Brackets"),caption:r.__("Change match brackets for the current file."),execute:()=>{const e=d.currentWidget;if(!e){return}const t=!e.content.editor.getOption("matchBrackets");e.content.editor.setOption("matchBrackets",t)},isEnabled:l,isToggled:()=>{var e;const t=d.currentWidget;return(e=t===null||t===void 0?void 0:t.content.editor.getOption("matchBrackets"))!==null&&e!==void 0?e:false}});e.addCommand(I.autoClosingBrackets,{execute:async e=>{var i,s;t.autoClosingBrackets=!!((i=e["force"])!==null&&i!==void 0?i:!((s=t.autoClosingBrackets)!==null&&s!==void 0?s:m.baseConfiguration.autoClosingBrackets));try{return await n.set(a,"editorConfig",t)}catch(o){console.error(`Failed to set ${a}: ${o.message}`)}},label:r.__("Auto Close Brackets in Text Editor"),isToggled:()=>{var e;return(e=t.autoClosingBrackets)!==null&&e!==void 0?e:m.baseConfiguration.autoClosingBrackets}});e.addCommand(I.autoClosingBracketsUniversal,{execute:()=>{const t=e.isToggled(I.autoClosingBrackets)||e.isToggled(k)||e.isToggled(j);if(t){void e.execute(I.autoClosingBrackets,{force:false});void e.execute(k,{force:false});void e.execute(j,{force:false})}else{void e.execute(I.autoClosingBrackets,{force:true});void e.execute(k,{force:true});void e.execute(j,{force:true})}},label:r.__("Auto Close Brackets"),isToggled:()=>e.isToggled(I.autoClosingBrackets)||e.isToggled(k)||e.isToggled(j)});e.addCommand(I.changeTheme,{label:e=>{var n,i,s,o;return(o=(s=(i=(n=e.displayName)!==null&&n!==void 0?n:e.theme)!==null&&i!==void 0?i:t.theme)!==null&&s!==void 0?s:m.baseConfiguration.theme)!==null&&o!==void 0?o:r.__("Editor Theme")},execute:async e=>{var i;t.theme=(i=e["theme"])!==null&&i!==void 0?i:t.theme;try{return await n.set(a,"editorConfig",t)}catch(s){console.error(`Failed to set theme - ${s.message}`)}},isToggled:e=>{var n;return e["theme"]===((n=t.theme)!==null&&n!==void 0?n:m.baseConfiguration.theme)}});e.addCommand(I.find,{label:r.__("Find…"),execute:()=>{const e=d.currentWidget;if(!e){return}const t=e.content.editor;t.execCommand(C.findNext)},isEnabled:l});e.addCommand(I.goToLine,{label:r.__("Go to Line…"),execute:e=>{const t=d.currentWidget;if(!t){return}const n=t.content.editor;const i=e["line"];const s=e["column"];if(i!==undefined||s!==undefined){n.setCursorPosition({line:(i!==null&&i!==void 0?i:1)-1,column:(s!==null&&s!==void 0?s:1)-1})}else{n.execCommand(C.gotoLine)}},isEnabled:l});e.addCommand(I.changeLanguage,{label:e=>{var t,n;return(n=(t=e["displayName"])!==null&&t!==void 0?t:e["name"])!==null&&n!==void 0?n:r.__("Change editor language.")},execute:e=>{var t;const n=e["name"];const i=d.currentWidget;if(n&&i){const e=g.findByName(n);if(e){if(Array.isArray(e.mime)){i.content.model.mimeType=(t=e.mime[0])!==null&&t!==void 0?t:o.IEditorMimeTypeService.defaultMimeType}else{i.content.model.mimeType=e.mime}}}},isEnabled:l,isToggled:e=>{const t=d.currentWidget;if(!t){return false}const n=t.content.model.mimeType;const i=g.findByMIME(n);const s=i&&i.name;return e["name"]===s}});e.addCommand(I.replaceSelection,{execute:e=>{var t,n;const i=e["text"]||"";const s=d.currentWidget;if(!s){return}(n=(t=s.content.editor).replaceSelection)===null||n===void 0?void 0:n.call(t,i)},isEnabled:l,label:r.__("Replace Selection in Editor")});e.addCommand(I.createConsole,{execute:t=>{const n=d.currentWidget;if(!n){return}return i(e,g)(n,t)},isEnabled:l,icon:b.consoleIcon,label:r.__("Create Console for Editor")});e.addCommand(I.restartConsole,{execute:async()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t||f===null){return}const n=f.find((e=>{var n;return((n=e.sessionContext.session)===null||n===void 0?void 0:n.path)===t.context.path}));if(n){return v.restart(n.sessionContext)}},label:r.__("Restart Kernel"),isEnabled:()=>f!==null&&l()});e.addCommand(I.runCode,{execute:()=>{var t;const n=(t=d.currentWidget)===null||t===void 0?void 0:t.content;if(!n){return}let i="";const s=n.editor;const o=n.context.path;const r=x.PathExt.extname(o);const a=s.getSelection();const{start:l,end:c}=a;let h=l.column!==c.column||l.line!==c.line;if(h){const e=s.getOffsetAt(a.start);const t=s.getOffsetAt(a.end);i=s.model.sharedModel.getSource().substring(e,t)}else if(x.MarkdownCodeBlocks.isMarkdown(r)){const e=s.model.sharedModel.getSource();const t=x.MarkdownCodeBlocks.findMarkdownCodeBlocks(e);for(const n of t){if(n.startLine<=l.line&&l.line<=n.endLine){i=n.code;h=true;break}}}if(!h){i=s.getLine(a.start.line);const e=s.getCursorPosition();if(e.line+1===s.lineCount){const e=s.model.sharedModel.getSource();s.model.sharedModel.setSource(e+"\n")}s.setCursorPosition({line:e.line+1,column:e.column})}const u=false;if(i){return e.execute("console:inject",{activate:u,code:i,path:o})}else{return Promise.resolve(void 0)}},isEnabled:l,label:r.__("Run Selected Code")});e.addCommand(I.runAllCode,{execute:()=>{var t;const n=(t=d.currentWidget)===null||t===void 0?void 0:t.content;if(!n){return}let i="";const s=n.editor;const o=s.model.sharedModel.getSource();const r=n.context.path;const a=x.PathExt.extname(r);if(x.MarkdownCodeBlocks.isMarkdown(a)){const e=x.MarkdownCodeBlocks.findMarkdownCodeBlocks(o);for(const t of e){i+=t.code}}else{i=o}const l=false;if(i){return e.execute("console:inject",{activate:l,code:i,path:r})}else{return Promise.resolve(void 0)}},isEnabled:l,label:r.__("Run All Code")});e.addCommand(I.markdownPreview,{execute:()=>{const t=d.currentWidget;if(!t){return}const n=t.context.path;return e.execute("markdownviewer:open",{path:n,options:{mode:"split-right"}})},isVisible:()=>{const e=d.currentWidget;return e&&x.PathExt.extname(e.context.path)===".md"||false},icon:b.markdownIcon,label:r.__("Show Markdown Preview")});e.addCommand(I.createNew,{label:e=>{var t,n;if(e.isPalette){return(t=e.paletteLabel)!==null&&t!==void 0?t:r.__("New Text File")}return(n=e.launcherLabel)!==null&&n!==void 0?n:r.__("Text File")},caption:e=>{var t;return(t=e.caption)!==null&&t!==void 0?t:r.__("Create a new text file")},icon:e=>{var t;return e.isPalette?undefined:b.LabIcon.resolve({icon:(t=e.iconName)!==null&&t!==void 0?t:b.textEditorIcon})},execute:t=>{var n;const i=t.cwd||c.model.path;return p(e,i,(n=t.fileExt)!==null&&n!==void 0?n:"txt")}});e.addCommand(I.createNewMarkdown,{label:e=>e["isPalette"]?r.__("New Markdown File"):r.__("Markdown File"),caption:r.__("Create a new markdown file"),icon:e=>e["isPalette"]?undefined:b.markdownIcon,execute:t=>{const n=t["cwd"]||c.model.path;return p(e,n,"md")}});e.addCommand(I.undo,{execute:()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return}t.editor.undo()},isEnabled:()=>{var e;if(!l()){return false}const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return false}return t.editor.model.sharedModel.canUndo()},icon:b.undoIcon.bindprops({stylesheet:"menuItem"}),label:r.__("Undo")});e.addCommand(I.redo,{execute:()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return}t.editor.redo()},isEnabled:()=>{var e;if(!l()){return false}const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return false}return t.editor.model.sharedModel.canRedo()},icon:b.redoIcon.bindprops({stylesheet:"menuItem"}),label:r.__("Redo")});e.addCommand(I.cut,{execute:()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return}const n=t.editor;const i=u(n);s.Clipboard.copyToSystem(i);n.replaceSelection&&n.replaceSelection("")},isEnabled:()=>{var e;if(!l()){return false}const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return false}return h(t.editor)},icon:b.cutIcon.bindprops({stylesheet:"menuItem"}),label:r.__("Cut")});e.addCommand(I.copy,{execute:()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return}const n=t.editor;const i=u(n);s.Clipboard.copyToSystem(i)},isEnabled:()=>{var e;if(!l()){return false}const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return false}return h(t.editor)},icon:b.copyIcon.bindprops({stylesheet:"menuItem"}),label:r.__("Copy")});e.addCommand(I.paste,{execute:async()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return}const n=t.editor;const i=window.navigator.clipboard;const s=await i.readText();if(s){n.replaceSelection&&n.replaceSelection(s)}},isEnabled:()=>{var e;return Boolean(l()&&((e=d.currentWidget)===null||e===void 0?void 0:e.content))},icon:b.pasteIcon.bindprops({stylesheet:"menuItem"}),label:r.__("Paste")});e.addCommand(I.selectAll,{execute:()=>{var e;const t=(e=d.currentWidget)===null||e===void 0?void 0:e.content;if(!t){return}const n=t.editor;n.execCommand(w.selectAll)},isEnabled:()=>{var e;return Boolean(l()&&((e=d.currentWidget)===null||e===void 0?void 0:e.content))},label:r.__("Select All")});const S=[I.lineNumbers,I.currentLineNumbers,I.lineWrap,I.currentLineWrap,I.matchBrackets,I.currentMatchBrackets,I.find,I.goToLine,I.changeLanguage,I.replaceSelection,I.createConsole,I.restartConsole,I.runCode,I.runAllCode,I.undo,I.redo,I.cut,I.copy,I.paste,I.selectAll,I.createConsole];const E=()=>{S.forEach((t=>e.notifyCommandChanged(t)))};d.currentChanged.connect(E);(y=_.currentChanged)===null||y===void 0?void 0:y.connect(E)}e.addCommands=d;function c(e,t,n,i){const s=(i!==null&&i!==void 0?i:_.nullTranslator).load("jupyterlab");e.addCommand(I.invokeCompleter,{label:s.__("Display the completion helper."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e){return n.invoke(e)}}});e.addCommand(I.selectCompleter,{label:s.__("Select the completion suggestion."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e){return n.select(e)}}});e.addKeyBinding({command:I.selectCompleter,keys:["Enter"],selector:".jp-FileEditor .jp-mod-completer-active"})}e.addCompleterCommands=c;function h(e){const t=e.getSelection();const{start:n,end:i}=t;const s=n.column!==i.column||n.line!==i.line;return s}function u(e){const t=e.getSelection();const n=e.getOffsetAt(t.start);const i=e.getOffsetAt(t.end);const s=e.model.sharedModel.getSource().substring(n,i);return s}async function p(e,t,n="txt"){const i=await e.execute("docmanager:new-untitled",{path:t,type:"file",ext:n});if(i!=undefined){const t=await e.execute("docmanager:open",{path:i.path,factory:E});t.isUntitled=true;return t}}function m(e,t){g(e,t);f(e,t)}e.addLauncherItems=m;function g(e,t){e.add({command:I.createNew,category:t.__("Other"),rank:1})}e.addCreateNewToLauncher=g;function f(e,t){e.add({command:I.createNewMarkdown,category:t.__("Other"),rank:2})}e.addCreateNewMarkdownToLauncher=f;function v(e,t,n){const i=new S.DisposableSet;for(const s of n){i.add(e.add({command:I.createNew,category:t.__("Other"),rank:3,args:s}))}return i}e.addKernelLanguageLauncherItems=v;function T(e,t){M(e,t);D(e,t);A(e,t);P(e,t)}e.addPaletteItems=T;function M(e,t){const n=t.__("Text Editor");const i={size:4};const s=I.changeTabs;e.addItem({command:s,args:i,category:n});for(const o of[1,2,4,8]){const t={size:o};e.addItem({command:s,args:t,category:n})}}e.addChangeTabsCommandsToPalette=M;function D(e,t){const n=t.__("Text Editor");e.addItem({command:I.createNew,args:{isPalette:true},category:n})}e.addCreateNewCommandToPalette=D;function A(e,t){const n=t.__("Text Editor");e.addItem({command:I.createNewMarkdown,args:{isPalette:true},category:n})}e.addCreateNewMarkdownCommandToPalette=A;function P(e,t){const n=t.__("Text Editor");const i=I.changeFontSize;let s={delta:1};e.addItem({command:i,args:s,category:n});s={delta:-1};e.addItem({command:i,args:s,category:n})}e.addChangeFontSizeCommandsToPalette=P;function L(e,t,n){const i=new S.DisposableSet;const s=t.__("Text Editor");for(const o of n){i.add(e.addItem({command:I.createNew,args:{...o,isPalette:true},category:s}))}return i}e.addKernelLanguagePaletteItems=L;function R(e,t,n,i){e.editMenu.undoers.redo.add({id:I.redo,isEnabled:i});e.editMenu.undoers.undo.add({id:I.undo,isEnabled:i});e.viewMenu.editorViewers.toggleLineNumbers.add({id:I.currentLineNumbers,isEnabled:i});e.viewMenu.editorViewers.toggleMatchBrackets.add({id:I.currentMatchBrackets,isEnabled:i});e.viewMenu.editorViewers.toggleWordWrap.add({id:I.currentLineWrap,isEnabled:i});e.fileMenu.consoleCreators.add({id:I.createConsole,isEnabled:i});if(n){O(e,n,i)}}e.addMenuItems=R;function N(e,t){const n=new S.DisposableSet;for(const i of t){n.add(e.fileMenu.newMenu.addItem({command:I.createNew,args:i,rank:31}))}return n}e.addKernelLanguageMenuItems=N;function O(e,t,n){const i=e=>n()&&e.context&&!!t.find((t=>{var n;return((n=t.sessionContext.session)===null||n===void 0?void 0:n.path)===e.context.path}));e.runMenu.codeRunners.restart.add({id:I.restartConsole,isEnabled:i});e.runMenu.codeRunners.run.add({id:I.runCode,isEnabled:i});e.runMenu.codeRunners.runAll.add({id:I.runAllCode,isEnabled:i})}e.addCodeRunnersToRunMenu=O;function B(e,t,n,i){const r=async r=>{var a;const l=t.factoryService.newDocumentEditor;const d=e=>l(e);let c=r.mimeType;if(!c&&r.extension){c=t.mimeTypeService.getMimeTypeByFilePath(`temp.${r.extension.replace(/\\.$/,"")}`)}const h=o.CodeViewerWidget.createCodeViewer({factory:d,content:r.content,mimeType:c});h.title.label=r.label||i.__("Code Viewer");h.title.caption=h.title.label;const u=(0,y.find)(e.docRegistry.fileTypes(),(e=>c?e.mimeTypes.includes(c):false));h.title.icon=(a=u===null||u===void 0?void 0:u.icon)!==null&&a!==void 0?a:b.textEditorIcon;if(r.widgetId){h.id=r.widgetId}const p=new s.MainAreaWidget({content:h});await n.add(p);e.shell.add(p,"main");return h};e.commands.addCommand(I.openCodeViewer,{label:i.__("Open Code Viewer"),execute:e=>r(e)})}e.addOpenCodeViewerCommand=B})(T||(T={}));const M={id:"@jupyterlab/fileeditor-extension:editor-syntax-status",description:"Adds a file editor syntax status widget.",autoStart:true,requires:[h.IEditorTracker,r.IEditorLanguageRegistry,i.ILabShell,_.ITranslator],optional:[f.IStatusBar],activate:(e,t,n,i,s,o)=>{if(!o){return}const r=new h.EditorSyntaxStatus({commands:e.commands,languages:n,translator:s});i.currentChanged.connect((()=>{const e=i.currentWidget;if(e&&t.has(e)&&r.model){r.model.editor=e.content.editor}}));o.registerStatusItem(M.id,{item:r,align:"left",rank:0,isActive:()=>!!i.currentWidget&&!!t.currentWidget&&i.currentWidget===t.currentWidget})}};const D={activate:z,id:"@jupyterlab/fileeditor-extension:plugin",description:"Provides the file editor widget tracker.",requires:[h.IEditorWidgetFactory,o.IEditorServices,r.IEditorExtensionRegistry,r.IEditorLanguageRegistry,r.IEditorThemeRegistry,c.IDefaultFileBrowser,g.ISettingRegistry],optional:[l.IConsoleTracker,s.ICommandPalette,u.ILauncher,m.IMainMenu,i.ILayoutRestorer,s.ISessionContextDialogs,v.ITableOfContentsRegistry,_.ITranslator,b.IFormRendererRegistry],provides:h.IEditorTracker,autoStart:true};const A={id:"@jupyterlab/fileeditor-extension:widget-factory",description:"Provides the factory for creating file editors.",autoStart:true,requires:[o.IEditorServices,g.ISettingRegistry],optional:[s.IToolbarWidgetRegistry,_.ITranslator],provides:h.IEditorWidgetFactory,activate:(e,t,n,i,o)=>{const r=D.id;const a=o!==null&&o!==void 0?o:_.nullTranslator;const l=a.load("jupyterlab");let d;if(i){d=(0,s.createToolbarFactory)(i,n,E,r,a)}const c=new h.FileEditorFactory({editorServices:t,factoryOptions:{name:E,label:l.__("Editor"),fileTypes:["markdown","*"],defaultFor:["markdown","*"],toolbarFactory:d,translator:a}});e.docRegistry.addWidgetFactory(c);return c}};const P={id:"@jupyterlab/fileeditor-extension:tab-space-status",description:"Adds a file editor indentation status widget.",autoStart:true,requires:[h.IEditorTracker,r.IEditorExtensionRegistry,g.ISettingRegistry,_.ITranslator],optional:[f.IStatusBar],activate:(e,t,n,i,s,o)=>{const r=s.load("jupyterlab");if(!o){return}const a=new b.MenuSvg({commands:e.commands});const l="fileeditor:change-tabs";const{shell:d}=e;const c={name:r.__("Indent with Tab")};a.addItem({command:l,args:c});for(const h of["1","2","4","8"]){const e={size:h,name:r._p("v4","Spaces: %1",h)};a.addItem({command:l,args:e})}const u=new h.TabSpaceStatus({menu:a,translator:s});const p=e=>{var t,i,s;u.model.indentUnit=(s=(i=(t=e.get("editorConfig").composite)===null||t===void 0?void 0:t.indentUnit)!==null&&i!==void 0?i:n.baseConfiguration.indentUnit)!==null&&s!==void 0?s:null};void Promise.all([i.load("@jupyterlab/fileeditor-extension:plugin"),e.restored]).then((([e])=>{p(e);e.changed.connect(p)}));o.registerStatusItem("@jupyterlab/fileeditor-extension:tab-space-status",{item:u,align:"right",rank:1,isActive:()=>!!d.currentWidget&&t.has(d.currentWidget)})}};const L={id:"@jupyterlab/fileeditor-extension:cursor-position",description:"Adds a file editor cursor position status widget.",activate:(e,t,n)=>{n.addEditorProvider((e=>Promise.resolve(e&&t.has(e)?e.content.editor:null)))},requires:[h.IEditorTracker,o.IPositionModel],autoStart:true};const R={id:"@jupyterlab/fileeditor-extension:completer",description:"Adds the completer capability to the file editor.",requires:[h.IEditorTracker],optional:[a.ICompletionProviderManager,_.ITranslator,s.ISanitizer],activate:H,autoStart:true};const N={id:"@jupyterlab/fileeditor-extension:search",description:"Adds search capability to the file editor.",requires:[d.ISearchProviderRegistry],autoStart:true,activate:(e,t)=>{t.add("jp-fileeditorSearchProvider",h.FileEditorSearchProvider)}};const O={id:"@jupyterlab/fileeditor-extension:language-server",description:"Adds Language Server capability to the file editor.",requires:[h.IEditorTracker,p.ILSPDocumentConnectionManager,p.ILSPFeatureManager,p.ILSPCodeExtractorsManager,p.IWidgetLSPAdapterTracker],activate:W,autoStart:true};const B=[A,D,L,R,O,N,M,P];const F=B;function z(e,t,n,i,o,r,a,l,d,c,u,p,m,g,f,v,b){const y=D.id;const w=v!==null&&v!==void 0?v:_.nullTranslator;const C=g!==null&&g!==void 0?g:new s.SessionContextDialogs({translator:w});const x=w.load("jupyterlab");const S="editor";const{commands:k,restored:j,shell:M}=e;const A=new s.WidgetTracker({namespace:S});const P=()=>A.currentWidget!==null&&A.currentWidget===M.currentWidget;const L=new Map([["python",[{fileExt:"py",iconName:"ui-components:python",launcherLabel:x.__("Python File"),paletteLabel:x.__("New Python File"),caption:x.__("Create a new Python file")}]],["julia",[{fileExt:"jl",iconName:"ui-components:julia",launcherLabel:x.__("Julia File"),paletteLabel:x.__("New Julia File"),caption:x.__("Create a new Julia file")}]],["R",[{fileExt:"r",iconName:"ui-components:r-kernel",launcherLabel:x.__("R File"),paletteLabel:x.__("New R File"),caption:x.__("Create a new R file")}]]]);const R=async()=>{var t,n;const i=e.serviceManager.kernelspecs;await i.ready;let s=new Set;const o=(n=(t=i.specs)===null||t===void 0?void 0:t.kernelspecs)!==null&&n!==void 0?n:{};Object.keys(o).forEach((e=>{const t=o[e];if(t){const e=L.get(t.language);e===null||e===void 0?void 0:e.forEach((e=>s.add(e)))}}));return s};let N=null;let O=null;let B=null;const F=e=>{if(N){N.dispose();N=null}if(O){O.dispose();O=null}if(B){B.dispose();B=null}if(u){N=T.addKernelLanguageLauncherItems(u,x,e)}if(c){O=T.addKernelLanguagePaletteItems(c,x,e)}if(p){B=T.addKernelLanguageMenuItems(p,e)}};const z=e.serviceManager.kernelspecs;z.specsChanged.connect((async()=>{try{const e=await R();F(e)}catch(e){console.error("Error updating kernel file types:",e)}}));if(m){void m.restore(A,{command:"docmanager:open",args:e=>({path:e.context.path,factory:E}),name:e=>e.context.path})}Promise.all([l.load(y),j]).then((([e])=>{var t,n,i;if(p){const e=(t=p.viewMenu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-mainmenu-view-codemirror-language"})))===null||t===void 0?void 0:t.submenu;if(e){o.getLanguages().sort(((e,t)=>{const n=e.name;const i=t.name;return n.localeCompare(i)})).forEach((t=>{if(t.name.toLowerCase().indexOf("brainf")===0){return}e.addItem({command:I.changeLanguage,args:{...t}})}))}const s=(n=p.settingsMenu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-mainmenu-settings-codemirror-theme"})))===null||n===void 0?void 0:n.submenu;if(s){for(const e of r.themes){s.addItem({command:I.changeTheme,args:{theme:e.name,displayName:(i=e.displayName)!==null&&i!==void 0?i:e.name}})}}p.editMenu.goToLiners.add({id:I.goToLine,isEnabled:e=>A.currentWidget!==null&&A.has(e)})}T.updateSettings(e,k);T.updateTracker(A);e.changed.connect((()=>{T.updateSettings(e,k);T.updateTracker(A)}))})).catch((e=>{console.error(e.message);T.updateTracker(A)}));if(b){const e=b.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");if(e){b.addRenderer("@jupyterlab/fileeditor-extension:plugin.editorConfig",e)}}t.widgetCreated.connect(((e,t)=>{t.context.pathChanged.connect((()=>{void A.save(t)}));void A.add(t);T.updateWidget(t.content)}));A.widgetAdded.connect(((e,t)=>{T.updateWidget(t.content)}));T.addCommands(e.commands,l,x,y,P,A,a,i,o,d,C,e.shell);const H=new s.WidgetTracker({namespace:"codeviewer"});if(m){void m.restore(H,{command:I.openCodeViewer,args:e=>({content:e.content.content,label:e.content.title.label,mimeType:e.content.mimeType,widgetId:e.content.id}),name:e=>e.content.id})}T.addOpenCodeViewerCommand(e,n,H,x);if(u){T.addLauncherItems(u,x)}if(c){T.addPaletteItems(c,x)}if(p){T.addMenuItems(p,A,d,P)}R().then(F).catch((e=>{console.error(e.message)}));if(f){f.add(new h.LaTeXTableOfContentsFactory(A));f.add(new h.MarkdownTableOfContentsFactory(A));f.add(new h.PythonTableOfContentsFactory(A))}return A}function H(e,t,n,i,o){if(!n){return}T.addCompleterCommands(e.commands,t,n,i);const r=e.serviceManager.sessions;const a=o!==null&&o!==void 0?o:new s.Sanitizer;const l=new Map;const d=async(e,t)=>{const i={editor:t.content.editor,widget:t};await n.updateCompleter(i);const s=(e,i)=>{const s=l.get(t.id);const o=(0,y.find)(i,(e=>e.path===t.context.path));if(o){if(s&&s.id===o.id){return}if(s){l.delete(t.id);s.dispose()}const e=r.connectTo({model:o});const i={editor:t.content.editor,widget:t,session:e,sanitizer:a};n.updateCompleter(i).catch(console.error);l.set(t.id,e)}else{if(s){l.delete(t.id);s.dispose()}}};s(r,Array.from(r.running()));r.runningChanged.connect(s);t.disposed.connect((()=>{r.runningChanged.disconnect(s);const e=l.get(t.id);if(e){l.delete(t.id);e.dispose()}}))};t.widgetAdded.connect(d);n.activeProvidersChanged.connect((()=>{t.forEach((e=>{d(t,e).catch(console.error)}))}))}function W(e,t,n,i,s,o){t.widgetAdded.connect((async(t,r)=>{const a=new h.FileEditorAdapter(r,{connectionManager:n,featureManager:i,foreignCodeExtractorsManager:s,docRegistry:e.docRegistry});o.add(a)}))}},61689:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(17325);var l=n(79010);var d=n(3579);var c=n(19562);var h=n(23359);var u=n(36060);var p=n(39063);var m=n(66731);var g=n(50286);var f=n(13137);var v=n(77748);var _=n(75797);var b=n(67996)},53062:(e,t,n)=>{"use strict";n.r(t);n.d(t,{EditorSyntaxStatus:()=>x,EditorTableOfContentsFactory:()=>I,FileEditor:()=>m,FileEditorAdapter:()=>r,FileEditorFactory:()=>f,FileEditorSearchProvider:()=>v,FileEditorWidget:()=>g,IEditorTracker:()=>O,IEditorWidgetFactory:()=>B,LaTeXTableOfContentsFactory:()=>D,LaTeXTableOfContentsModel:()=>M,MarkdownTableOfContentsFactory:()=>P,MarkdownTableOfContentsModel:()=>A,PythonTableOfContentsFactory:()=>N,PythonTableOfContentsModel:()=>R,TabSpaceStatus:()=>k});var i=n(98335);var s=n(90295);var o=n(5592);class r extends s.WidgetLSPAdapter{constructor(e,t){const{docRegistry:n,...i}=t;super(e,i);this._readyDelegate=new o.PromiseDelegate;this.editor=e.content;this._docRegistry=n;this._virtualEditor=Object.freeze({getEditor:()=>this.editor.editor,ready:()=>Promise.resolve(this.editor.editor),reveal:()=>Promise.resolve(this.editor.editor)});Promise.all([this.editor.context.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady();this._readyDelegate.resolve();this._editorAdded.emit({editor:this._virtualEditor})})).catch(console.error)}get ready(){return this._readyDelegate.promise}get documentPath(){return this.widget.context.path}get mimeType(){var e;const t=this.editor.model.mimeType;const n=Array.isArray(t)?(e=t[0])!==null&&e!==void 0?e:i.IEditorMimeTypeService.defaultMimeType:t;const s=this.editor.context.contentsModel;if(n!=i.IEditorMimeTypeService.defaultMimeType){return n}else if(s){let e=this._docRegistry.getFileTypeForModel(s);return e.mimeTypes[0]}else{return n}}get languageFileExtension(){let e=this.documentPath.split(".");return e[e.length-1]}get ceEditor(){return this.editor.editor}get activeEditor(){return this._virtualEditor}get wrapperElement(){return this.widget.node}get path(){return this.widget.context.path}get editors(){var e,t;return[{ceEditor:this._virtualEditor,type:"code",value:(t=(e=this.editor)===null||e===void 0?void 0:e.model.sharedModel.getSource())!==null&&t!==void 0?t:""}]}dispose(){if(this.isDisposed){return}this._editorRemoved.emit({editor:this._virtualEditor});this.editor.model.mimeTypeChanged.disconnect(this.reloadConnection);super.dispose()}createVirtualDocument(){return new s.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:true,hasLspSupportedFile:true})}getEditorIndexAt(e){return 0}getEditorIndex(e){return 0}getEditorWrapper(e){return this.wrapperElement}async initOnceReady(){this.initVirtual();await this.connectDocument(this.virtualDocument,false);this.editor.model.mimeTypeChanged.connect(this.reloadConnection,this)}}var a=n(72050);var l=n(90567);var d=n(44185);var c=n(66127);var h=n(1143);const u="jpCodeRunner";const p="jpUndoer";class m extends h.Widget{constructor(e){super();this._ready=new o.PromiseDelegate;this.addClass("jp-FileEditor");const t=this._context=e.context;this._mimeTypeService=e.mimeTypeService;const n=this._editorWidget=new i.CodeEditorWrapper({factory:e.factory,model:t.model,editorOptions:{config:m.defaultEditorConfig}});this._editorWidget.addClass("jp-FileEditorCodeWrapper");this._editorWidget.node.dataset[u]="true";this._editorWidget.node.dataset[p]="true";this.editor=n.editor;this.model=n.model;void t.ready.then((()=>{this._onContextReady()}));this._onPathChanged();t.pathChanged.connect(this._onPathChanged,this);const s=this.layout=new h.StackedLayout;s.addWidget(n)}get context(){return this._context}get ready(){return this._ready.promise}handleEvent(e){if(!this.model){return}switch(e.type){case"mousedown":this._ensureFocus();break;default:break}}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("mousedown",this)}onBeforeDetach(e){const t=this.node;t.removeEventListener("mousedown",this)}onActivateRequest(e){this._ensureFocus()}_ensureFocus(){if(!this.editor.hasFocus()){this.editor.focus()}}_onContextReady(){if(this.isDisposed){return}this.editor.clearHistory();this._ready.resolve(undefined)}_onPathChanged(){const e=this.editor;const t=this._context.localPath;e.model.mimeType=this._mimeTypeService.getMimeTypeByFilePath(t)}}(function(e){e.defaultEditorConfig={lineNumbers:true,scrollPastEnd:true}})(m||(m={}));class g extends d.DocumentWidget{async setFragment(e){const t=e.split("=");if(t[0]!=="#line"){return}const n=t[1];let i;if(n.includes(",")){i=n.split(",")[0]||"0"}else{i=n}return this.context.ready.then((()=>{const e={line:parseInt(i,10),column:0};this.content.editor.setCursorPosition(e);this.content.editor.revealPosition(e)}))}}class f extends d.ABCWidgetFactory{constructor(e){super(e.factoryOptions);this._services=e.editorServices}createNewWidget(e){const t=this._services.factoryService.newDocumentEditor;const n=e=>t(e);const i=new m({factory:n,context:e,mimeTypeService:this._services.mimeTypeService});i.title.icon=c.textEditorIcon;const s=new g({content:i,context:e});return s}}class v extends l.EditorSearchProvider{constructor(e){super();this.widget=e;this._searchActive=false}get isReadOnly(){return this.editor.getOption("readOnly")}get replaceOptionsSupport(){return{preserveCase:true}}get editor(){return this.widget.content.editor}get model(){return this.widget.content.model}async startQuery(e,t){this._searchActive=true;await super.startQuery(e,t);await this.highlightNext(true,{from:"selection-start",scroll:false,select:false})}async endQuery(){this._searchActive=false;await super.endQuery()}async onSharedModelChanged(e,t){if(this._searchActive){return super.onSharedModelChanged(e,t)}}static createNew(e,t){return new v(e)}static isApplicable(e){return e instanceof a.MainAreaWidget&&e.content instanceof m&&e.content.editor instanceof l.CodeMirrorEditor}getInitialQuery(){const e=this.editor;const t=e.state.sliceDoc(e.state.selection.main.from,e.state.selection.main.to);return t}}var _=n(66987);var b=n(61927);var y=n(44914);var w=n.n(y);function C(e){return w().createElement(_.TextItem,{role:"button","aria-haspopup":true,tabIndex:0,source:e.language,onClick:e.handleClick,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){e.handleClick()}}})}class x extends c.VDomRenderer{constructor(e){var t;super(new x.Model(e.languages));this._handleClick=()=>{const e=new h.Menu({commands:this._commands});const t="fileeditor:change-language";if(this._popup){this._popup.dispose()}this.model.languages.getLanguages().sort(((e,t)=>{var n,i;const s=(n=e.displayName)!==null&&n!==void 0?n:e.name;const o=(i=t.displayName)!==null&&i!==void 0?i:t.name;return s.localeCompare(o)})).forEach((n=>{var i;if(n.name.toLowerCase().indexOf("brainf")===0){return}const s={name:n.name,displayName:(i=n.displayName)!==null&&i!==void 0?i:n.name};e.addItem({command:t,args:s})}));this._popup=(0,_.showPopup)({body:e,anchor:this,align:"left"})};this._popup=null;this._commands=e.commands;this.translator=(t=e.translator)!==null&&t!==void 0?t:b.nullTranslator;const n=this.translator.load("jupyterlab");this.addClass("jp-mod-highlighted");this.title.caption=n.__("Change text editor syntax highlighting")}render(){if(!this.model){return null}return w().createElement(C,{language:this.model.language,handleClick:this._handleClick})}}(function(e){class t extends c.VDomModel{constructor(e){super();this.languages=e;this._onMIMETypeChange=(e,t)=>{var n;const s=this._language;const o=this.languages.findByMIME(t.newValue);this._language=(n=o===null||o===void 0?void 0:o.name)!==null&&n!==void 0?n:i.IEditorMimeTypeService.defaultMimeType;this._triggerChange(s,this._language)};this._language="";this._editor=null}get language(){return this._language}get editor(){return this._editor}set editor(e){var t;const n=this._editor;if(n!==null){n.model.mimeTypeChanged.disconnect(this._onMIMETypeChange)}const s=this._language;this._editor=e;if(this._editor===null){this._language=""}else{const e=this.languages.findByMIME(this._editor.model.mimeType);this._language=(t=e===null||e===void 0?void 0:e.name)!==null&&t!==void 0?t:i.IEditorMimeTypeService.defaultMimeType;this._editor.model.mimeTypeChanged.connect(this._onMIMETypeChange)}this._triggerChange(s,this._language)}_triggerChange(e,t){if(e!==t){this.stateChanged.emit(void 0)}}}e.Model=t})(x||(x={}));function S(e){const t=e.translator||b.nullTranslator;const n=t.load("jupyterlab");const i=typeof e.tabSpace==="number"?n.__("Spaces"):n.__("Tab Indent");return w().createElement(_.TextItem,{role:"button","aria-haspopup":true,tabIndex:0,onClick:e.handleClick,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){e.handleClick()}},source:typeof e.tabSpace==="number"?`${i}: ${e.tabSpace}`:i,title:n.__("Change the indentation…")})}class k extends c.VDomRenderer{constructor(e){super(new k.Model);this._popup=null;this._menu=e.menu;this.translator=e.translator||b.nullTranslator;this.addClass("jp-mod-highlighted")}render(){var e;if(!((e=this.model)===null||e===void 0?void 0:e.indentUnit)){return null}else{const e=this.model.indentUnit==="Tab"?null:parseInt(this.model.indentUnit,10);return w().createElement(S,{tabSpace:e,handleClick:()=>this._handleClick(),translator:this.translator})}}_handleClick(){const e=this._menu;if(this._popup){this._popup.dispose()}e.aboutToClose.connect(this._menuClosed,this);this._popup=(0,_.showPopup)({body:e,anchor:this,align:"right"});e.update()}_menuClosed(){this.removeClass("jp-mod-clicked")}}(function(e){class t extends c.VDomModel{get indentUnit(){return this._indentUnit}set indentUnit(e){if(e!==this._indentUnit){this._indentUnit=e;this.stateChanged.emit()}}}e.Model=t})(k||(k={}));var j=n(10553);class I extends j.TableOfContentsFactory{createNew(e,t){const n=super.createNew(e,t);const i=(t,n)=>{if(n){e.content.editor.setCursorPosition({line:n.line,column:0})}};n.activeHeadingChanged.connect(i);e.disposed.connect((()=>{n.activeHeadingChanged.disconnect(i)}));return n}}const E={part:1,chapter:1,section:1,subsection:2,subsubsection:3,paragraph:4,subparagraph:5};const T=/^\s*\\(section|subsection|subsubsection){(.+)}/;class M extends j.TableOfContentsModel{get documentType(){return"latex"}get supportedOptions(){return["maximalDepth","numberHeaders"]}getHeadings(){if(!this.isActive){return Promise.resolve(null)}const e=this.widget.content.model.sharedModel.getSource().split("\n");const t=new Array;let n=t.length;const i=new Array;for(let s=0;s0){s=n}const a=["from ","import "].includes(e[1]);if(a&&i){continue}i=a;const l=1+n/s;if(l>this.configuration.maximalDepth){continue}t.push({text:r.slice(n),level:l,line:o})}}return Promise.resolve(t)}}class N extends I{isApplicable(e){var t,n;const i=super.isApplicable(e);if(i){let i=(n=(t=e.content)===null||t===void 0?void 0:t.model)===null||n===void 0?void 0:n.mimeType;return i&&(i==="application/x-python-code"||i==="text/x-python")}return false}_createNew(e,t){return new R(e,t)}}const O=new o.Token("@jupyterlab/fileeditor:IEditorTracker",`A widget tracker for file editors.\n Use this if you want to be able to iterate over and interact with file editors\n created by the application.`);const B=new o.Token("@jupyterlab/fileeditor:IEditorWidgetFactory","A factory for creating file editors.")},77748:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(17325);var a=n(19562);var l=n(23359);var d=n(79010);var c=n(13137);var h=n(66731);var u=n(85072);var p=n.n(u);var m=n(97825);var g=n.n(m);var f=n(77659);var v=n.n(f);var _=n(55056);var b=n.n(_);var y=n(10540);var w=n.n(y);var C=n(41113);var x=n.n(C);var S=n(98561);var k={};k.styleTagTransform=x();k.setAttributes=b();k.insert=v().bind(null,"head");k.domAPI=g();k.insertStyleElement=w();var j=p()(S.A,k);const I=S.A&&S.A.locals?S.A.locals:undefined},97491:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>j});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(37737);var l=n.n(a);var d=n(56759);var c=n.n(d);var h=n(61927);var u=n.n(h);var p=n(66127);var m=n.n(p);var g=n(44914);var f=n.n(g);var v;(function(e){e.open="help:open";e.about="help:about";e.activate="help:activate";e.close="help:close";e.show="help:show";e.hide="help:hide";e.jupyterForum="help:jupyter-forum";e.licenses="help:licenses";e.licenseReport="help:license-report";e.refreshLicenses="help:licenses-refresh"})(v||(v={}));const _=window.location.protocol==="https:";const b="jp-Help";const y={id:"@jupyterlab/help-extension:licenses-commands",autoStart:true,optional:[h.ITranslator],description:"Add licenses commands for backwards compatibility.",activate:(e,t)=>{const{commands:n}=e;const i=(t!==null&&t!==void 0?t:h.nullTranslator).load("jupyterlab");const s=i.__("Licenses");const o=i.__("Download All Licenses");const r=i.__("Refresh Licenses");const a="apputils:licenses";n.addCommand(v.licenses,{label:s,execute:e=>{console.warn(`The command ${v.licenses} is deprecated, use ${a} instead.`);return n.execute(a,e)}});const l="apputils:license-report";n.addCommand(v.licenseReport,{label:o,execute:e=>{console.warn(`The command ${v.licenseReport} is deprecated, use ${l} instead.`);return n.execute(l,e)}});const d="apputils:licenses-refresh";n.addCommand(v.refreshLicenses,{label:r,execute:e=>{console.warn(`The command ${v.refreshLicenses} is deprecated, use ${d} instead.`);return n.execute(d,e)}})}};const w={id:"@jupyterlab/help-extension:about",description:'Adds a "About" dialog feature.',autoStart:true,requires:[h.ITranslator],optional:[o.ICommandPalette],activate:(e,t,n)=>{const{commands:i}=e;const s=t.load("jupyterlab");const r=s.__("Help");i.addCommand(v.about,{label:s.__("About %1",e.name),execute:()=>{const t=s.__("Version %1",e.version);const n=g.createElement("span",{className:"jp-About-version-info"},g.createElement("span",{className:"jp-About-version"},t));const i=g.createElement("span",{className:"jp-About-header"},g.createElement(p.jupyterIcon.react,{margin:"7px 9.5px",height:"auto",width:"58px"}),g.createElement("div",{className:"jp-About-header-info"},g.createElement(p.jupyterlabWordmarkIcon.react,{height:"auto",width:"196px"}),n));const r="https://jupyter.org/about.html";const a="https://github.com/jupyterlab/jupyterlab/graphs/contributors";const l=g.createElement("span",{className:"jp-About-externalLinks"},g.createElement("a",{href:a,target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},s.__("CONTRIBUTOR LIST")),g.createElement("a",{href:r,target:"_blank",rel:"noopener noreferrer",className:"jp-Button-flat"},s.__("ABOUT PROJECT JUPYTER")));const d=g.createElement("span",{className:"jp-About-copyright"},s.__("© %1-%2 Project Jupyter Contributors",2015,2025));const c=g.createElement("div",{className:"jp-About-body"},l,d);return(0,o.showDialog)({title:i,body:c,buttons:[o.Dialog.cancelButton({label:s.__("Close")})]})}});if(n){n.addItem({command:v.about,category:r})}}};const C={id:"@jupyterlab/help-extension:jupyter-forum",description:"Adds command to open the Jupyter Forum website.",autoStart:true,requires:[h.ITranslator],optional:[o.ICommandPalette],activate:(e,t,n)=>{const{commands:i}=e;const s=t.load("jupyterlab");const o=s.__("Help");i.addCommand(v.jupyterForum,{label:s.__("Jupyter Forum"),execute:()=>{window.open("https://discourse.jupyter.org/c/jupyterlab")}});if(n){n.addItem({command:v.jupyterForum,category:o})}}};const x={id:"@jupyterlab/help-extension:open",description:"Add command to open websites as panel or browser tab.",autoStart:true,requires:[h.ITranslator],optional:[i.ILayoutRestorer],activate:(e,t,n)=>{const{commands:i,shell:s}=e;const r=t.load("jupyterlab");const l="help-doc";const d=new o.WidgetTracker({namespace:l});let c=0;function h(e,t){const n=new p.IFrame({sandbox:["allow-scripts","allow-forms"],loading:"lazy"});n.url=e;n.addClass(b);n.title.label=t;n.id=`${l}-${++c}`;const i=new o.MainAreaWidget({content:n});i.addClass("jp-Help");return i}i.addCommand(v.open,{label:e=>{var t;return(t=e["text"])!==null&&t!==void 0?t:r.__("Open the provided `url` in a tab.")},execute:e=>{const t=e["url"];const n=e["text"];const i=e["newBrowserTab"]||false;if(i||_&&a.URLExt.parse(t).protocol!=="https:"){window.open(t);return}const o=h(t,n);void d.add(o);s.add(o,"main");return o}});if(n){void n.restore(d,{command:v.open,args:e=>({url:e.content.url,text:e.content.title.label}),name:e=>e.content.url})}}};const S={id:"@jupyterlab/help-extension:resources",description:"Adds menu entries to Jupyter reference documentation websites.",autoStart:true,requires:[d.IMainMenu,h.ITranslator],optional:[i.ILabShell,o.ICommandPalette],activate:(e,t,n,i,s)=>{const r=n.load("jupyterlab");const a=r.__("Help");const{commands:l,serviceManager:d}=e;const c=[{text:r.__("JupyterLab Reference"),url:"https://jupyterlab.readthedocs.io/en/stable/"},{text:r.__("JupyterLab FAQ"),url:"https://jupyterlab.readthedocs.io/en/stable/getting_started/faq.html"},{text:r.__("Jupyter Reference"),url:"https://jupyter.org/documentation"},{text:r.__("Markdown Reference"),url:"https://commonmark.org/help/"}];c.sort(((e,t)=>e.text.localeCompare(t.text)));const h=t.helpMenu;const u=c.map((e=>({args:e,command:v.open})));h.addGroup(u,10);const p=new Map;const m=(e,t)=>{var n;if(!t.length){return}const s=t[t.length-1];if(!s.kernel||p.has(s.kernel.name)){return}const a=d.sessions.connectTo({model:s,kernelConnectionOptions:{handleComms:false}});void((n=a.kernel)===null||n===void 0?void 0:n.info.then((e=>{var t,n;const s=a.kernel.name;if(p.has(s)){return}const c=(n=(t=d.kernelspecs)===null||t===void 0?void 0:t.specs)===null||n===void 0?void 0:n.kernelspecs[s];if(!c){return}p.set(s,e);let u=false;const m=async()=>{const e=await l.execute("helpmenu:get-kernel");u=(e===null||e===void 0?void 0:e.name)===s};m().catch((e=>{console.error("Failed to get the kernel for the current widget.",e)}));if(i){i.currentChanged.connect(m)}const f=()=>u;const _=`help-menu-${s}:banner`;const b=c.display_name;const y=c.resources["logo-svg"]||c.resources["logo-64x64"];l.addCommand(_,{label:r.__("About the %1 Kernel",b),isVisible:f,isEnabled:f,execute:()=>{const t=g.createElement("img",{src:y,alt:r.__("Kernel Icon")});const n=g.createElement("span",{className:"jp-About-header"},t,g.createElement("div",{className:"jp-About-header-info"},b));const i=g.createElement("pre",null,e.banner);const s=g.createElement("div",{className:"jp-About-body"},i);return(0,o.showDialog)({title:n,body:s,buttons:[o.Dialog.cancelButton({label:r.__("Close")})]})}});h.addGroup([{command:_}],20);const w=[];(e.help_links||[]).forEach((e=>{const t=`help-menu-${s}:${e.text}`;l.addCommand(t,{label:l.label(v.open,e),isVisible:f,isEnabled:f,execute:()=>l.execute(v.open,e)});w.push({command:t})}));h.addGroup(w,21)})).then((()=>{a.dispose()})))};for(const o of d.sessions.running()){m(d.sessions,[o])}d.sessions.runningChanged.connect(m);if(s){c.forEach((e=>{s.addItem({args:e,command:v.open,category:a})}));s.addItem({args:{reload:true},command:"apputils:reset",category:a})}}};const k=[w,C,y,x,S];const j=k},34072:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(67996);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(31569);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},1951:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>y});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(629);var l=n.n(a);var d=n(15615);var c=n.n(d);var h=n(61927);var u=n.n(h);var p=n(66127);var m=n.n(p);const g="@jupyterlab/htmlviewer-extension:plugin";const f="HTML Viewer";var v;(function(e){e.trustHTML="htmlviewer:trust-html"})(v||(v={}));const _={activate:b,id:g,description:"Adds HTML file viewer and provides its tracker.",provides:a.IHTMLViewerTracker,requires:[h.ITranslator],optional:[o.ICommandPalette,i.ILayoutRestorer,d.ISettingRegistry,o.IToolbarWidgetRegistry],autoStart:true};function b(e,t,n,i,s,r){let l;const d=t.load("jupyterlab");if(r){r.addFactory(f,"refresh",(e=>a.ToolbarItems.createRefreshButton(e,t)));r.addFactory(f,"trust",(e=>a.ToolbarItems.createTrustButton(e,t)));if(s){l=(0,o.createToolbarFactory)(r,s,f,_.id,t)}}const c={name:"html",contentType:"file",fileFormat:"text",displayName:d.__("HTML File"),extensions:[".html"],mimeTypes:["text/html"],icon:p.html5Icon};e.docRegistry.addFileType(c);const h=new a.HTMLViewerFactory({name:f,label:d.__("HTML Viewer"),fileTypes:["html"],defaultFor:["html"],readOnly:true,toolbarFactory:l,translator:t});const u=new o.WidgetTracker({namespace:"htmlviewer"});if(i){void i.restore(u,{command:"docmanager:open",args:e=>({path:e.context.path,factory:"HTML Viewer"}),name:e=>e.context.path})}let m=false;if(s){const t=s.load(g);const n=e=>{m=e.get("trustByDefault").composite};Promise.all([t,e.restored]).then((([e])=>{n(e);e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}e.docRegistry.addWidgetFactory(h);h.widgetCreated.connect(((t,n)=>{var i,s;void u.add(n);n.context.pathChanged.connect((()=>{void u.save(n)}));n.trustedChanged.connect((()=>{e.commands.notifyCommandChanged(v.trustHTML)}));n.trusted=m;n.title.icon=c.icon;n.title.iconClass=(i=c.iconClass)!==null&&i!==void 0?i:"";n.title.iconLabel=(s=c.iconLabel)!==null&&s!==void 0?s:""}));e.commands.addCommand(v.trustHTML,{label:d.__("Trust HTML File"),caption:d.__(`Whether the HTML file is trusted.\n Trusting the file allows scripts to run in it,\n which may result in security risks.\n Only enable for files you trust.`),isEnabled:()=>!!u.currentWidget,isToggled:()=>{const e=u.currentWidget;if(!e){return false}const t=e.content.sandbox;return t.indexOf("allow-scripts")!==-1},execute:()=>{const e=u.currentWidget;if(!e){return}e.trusted=!e.trusted}});u.currentChanged.connect((()=>{e.commands.notifyCommandChanged(v.trustHTML)}));if(n){n.addItem({command:v.trustHTML,category:d.__("File Operations")})}return u}const y=_},54336:(e,t,n)=>{"use strict";var i=n(40662);var s=n(97913);var o=n(79010);var r=n(3579);var a=n(10395);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(20813);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},43947:(e,t,n)=>{"use strict";n.r(t);n.d(t,{HTMLViewer:()=>m,HTMLViewerFactory:()=>g,IHTMLViewerTracker:()=>s,ToolbarItems:()=>f});var i=n(5592);const s=new i.Token("@jupyterlab/htmlviewer:IHTMLViewerTracker",`A widget tracker for rendered HTML documents.\n Use this if you want to be able to iterate over and interact with HTML documents\n viewed by the application.`);var o=n(37737);var r=n(44185);var a=n(61927);var l=n(66127);var d=n(2336);var c=n(44914);const h=1e3;const u="jp-HTMLViewer";const p=e=>``;class m extends r.DocumentWidget{constructor(e){super({...e,content:new l.IFrame({sandbox:["allow-same-origin"],loading:"lazy"})});this._renderPending=false;this._parser=new DOMParser;this._monitor=null;this._objectUrl="";this._trustedChanged=new d.Signal(this);this.translator=e.translator||a.nullTranslator;this.content.addClass(u);void this.context.ready.then((()=>{this.update();this._monitor=new o.ActivityMonitor({signal:this.context.model.contentChanged,timeout:h});this._monitor.activityStopped.connect(this.update,this)}))}get trusted(){return this.content.sandbox.indexOf("allow-scripts")!==-1}set trusted(e){if(this.trusted===e){return}if(e){this.content.sandbox=v.trusted}else{this.content.sandbox=v.untrusted}this.update();this._trustedChanged.emit(e)}get trustedChanged(){return this._trustedChanged}dispose(){if(this._objectUrl){try{URL.revokeObjectURL(this._objectUrl)}catch(e){}}super.dispose()}onUpdateRequest(){if(this._renderPending){return}this._renderPending=true;void this._renderModel().then((()=>this._renderPending=false))}async _renderModel(){let e=this.context.model.toString();e=await this._setupDocument(e);const t=new Blob([e],{type:"text/html"});const n=this._objectUrl;this._objectUrl=URL.createObjectURL(t);this.content.url=this._objectUrl;if(n){try{URL.revokeObjectURL(n)}catch(i){}}return}async _setupDocument(e){const t=this._parser.parseFromString(e,"text/html");let n=t.querySelector("base");if(!n){n=t.createElement("base");t.head.insertBefore(n,t.head.firstChild)}const i=this.context.path;const s=await this.context.urlResolver.getDownloadUrl(i);n.href=s;n.target="_self";if(!this.trusted){const e=this.translator.load("jupyterlab");const n=e.__("Action disabled as the file is not trusted.");t.body.insertAdjacentHTML("beforeend",p({warning:n}))}return t.documentElement.innerHTML}}class g extends r.ABCWidgetFactory{createNewWidget(e){return new m({context:e})}defaultToolbarFactory(e){return[{name:"refresh",widget:f.createRefreshButton(e,this.translator)},{name:"trust",widget:f.createTrustButton(e,this.translator)}]}}var f;(function(e){function t(e,t){const n=(t!==null&&t!==void 0?t:a.nullTranslator).load("jupyterlab");return new l.ToolbarButton({icon:l.refreshIcon,onClick:async()=>{if(!e.context.model.dirty){await e.context.revert();e.update()}},tooltip:n.__("Rerender HTML Document")})}e.createRefreshButton=t;function n(e,t){return l.ReactWidget.create(c.createElement(v.TrustButtonComponent,{htmlDocument:e,translator:t}))}e.createTrustButton=n})(f||(f={}));var v;(function(e){e.untrusted=[];e.trusted=["allow-scripts","allow-popups"];function t(e){const t=e.translator||a.nullTranslator;const n=t.load("jupyterlab");return c.createElement(l.UseSignal,{signal:e.htmlDocument.trustedChanged,initialSender:e.htmlDocument},(()=>c.createElement(l.ToolbarButtonComponent,{className:"",onClick:()=>e.htmlDocument.trusted=!e.htmlDocument.trusted,tooltip:n.__(`Whether the HTML file is trusted.\nTrusting the file allows opening pop-ups and running scripts\nwhich may result in security risks.\nOnly enable for files you trust.`),label:e.htmlDocument.trusted?n.__("Distrust HTML"):n.__("Trust HTML")})))}e.TrustButtonComponent=t})(v||(v={}))},44031:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CommandIDs:()=>h,default:()=>f});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(37737);var l=n.n(a);var d=n(61927);var c=n.n(d);var h;(function(e){e.controlPanel="hub:control-panel";e.logout="hub:logout";e.restart="hub:restart"})(h||(h={}));function u(e,t,n,i){const s=n.load("jupyterlab");const o=t.urls.hubHost||"";const r=t.urls.hubPrefix||"";const l=t.urls.hubUser||"";const d=t.urls.hubServerName||"";const c=t.urls.base;if(!r){return}console.debug("hub-extension: Found configuration ",{hubHost:o,hubPrefix:r});const u=a.URLExt.join(r,"spawn");let p=o+u;if(d){const e=a.URLExt.join(u,l,d);if(!e.startsWith(u)){throw new Error("Can only be used for spawn requests")}p=o+e}const{commands:m}=e;m.addCommand(h.restart,{label:s.__("Restart Server"),caption:s.__("Request that the Hub restart this server"),execute:()=>{window.open(p,"_blank")}});m.addCommand(h.controlPanel,{label:s.__("Hub Control Panel"),caption:s.__("Open the Hub control panel in a new browser tab"),execute:()=>{window.open(o+a.URLExt.join(r,"home"),"_blank")}});m.addCommand(h.logout,{label:s.__("Log Out"),caption:s.__("Log out of the Hub"),execute:()=>{window.location.href=o+a.URLExt.join(c,"logout")}});if(i){const e=s.__("Hub");i.addItem({category:e,command:h.controlPanel});i.addItem({category:e,command:h.logout})}}const p={activate:u,id:"@jupyterlab/hub-extension:plugin",description:"Registers commands related to the hub server",requires:[i.JupyterFrontEnd.IPaths,d.ITranslator],optional:[o.ICommandPalette],autoStart:true};const m={activate:()=>void 0,id:"@jupyterlab/hub-extension:menu",description:"Adds hub related commands to the menu.",autoStart:true};const g={id:"@jupyterlab/hub-extension:connectionlost",description:"Provides a service to be notified when the connection to the hub server is lost.",requires:[i.JupyterFrontEnd.IPaths,d.ITranslator],optional:[i.JupyterLab.IInfo],activate:(e,t,n,s)=>{const r=n.load("jupyterlab");const a=t.urls.hubPrefix||"";const l=t.urls.base;if(!a){return i.ConnectionLost}let d=false;const c=async(t,n)=>{if(d){return}d=true;if(s){s.isConnected=false}const i=await(0,o.showDialog)({title:r.__("Server unavailable or unreachable"),body:r.__("Your server at %1 is not running.\nWould you like to restart it?",l),buttons:[o.Dialog.okButton({label:r.__("Restart")}),o.Dialog.cancelButton({label:r.__("Dismiss")})]});if(s){s.isConnected=true}d=false;if(i.button.accept){await e.commands.execute(h.restart)}};return c},autoStart:true,provides:i.IConnectionLost};const f=[p,m,g]},19457:(e,t,n)=>{"use strict";var i=n(97913);var s=n(3579)},55575:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>_});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(26367);var l=n.n(a);var d=n(61927);var c=n.n(d);var h;(function(e){e.resetImage="imageviewer:reset-image";e.zoomIn="imageviewer:zoom-in";e.zoomOut="imageviewer:zoom-out";e.flipHorizontal="imageviewer:flip-horizontal";e.flipVertical="imageviewer:flip-vertical";e.rotateClockwise="imageviewer:rotate-clockwise";e.rotateCounterclockwise="imageviewer:rotate-counterclockwise";e.invertColors="imageviewer:invert-colors"})(h||(h={}));const u=["png","gif","jpeg","bmp","ico","tiff"];const p="Image";const m="Image (Text)";const g=["svg","xbm"];const f=new RegExp(`[.](${g.join("|")})$`);const v={activate:b,description:"Adds image viewer and provide its tracker.",id:"@jupyterlab/imageviewer-extension:plugin",provides:a.IImageTracker,requires:[d.ITranslator],optional:[o.ICommandPalette,i.ILayoutRestorer],autoStart:true};const _=v;function b(e,t,n,i){const s=t.load("jupyterlab");const r="image-widget";function l(t,n){var i,s;n.context.pathChanged.connect((()=>{void v.save(n)}));void v.add(n);const o=e.docRegistry.getFileTypesForPath(n.context.path);if(o.length>0){n.title.icon=o[0].icon;n.title.iconClass=(i=o[0].iconClass)!==null&&i!==void 0?i:"";n.title.iconLabel=(s=o[0].iconLabel)!==null&&s!==void 0?s:""}}const d=new a.ImageViewerFactory({name:p,label:s.__("Image"),modelName:"base64",fileTypes:[...u,...g],defaultFor:u,readOnly:true});const c=new a.ImageViewerFactory({name:m,label:s.__("Image (Text)"),modelName:"text",fileTypes:g,defaultFor:g,readOnly:true});[d,c].forEach((t=>{e.docRegistry.addWidgetFactory(t);t.widgetCreated.connect(l)}));const v=new o.WidgetTracker({namespace:r});if(i){void i.restore(v,{command:"docmanager:open",args:e=>({path:e.context.path,factory:f.test(e.context.path)?m:p}),name:e=>e.context.path})}y(e,v,t);if(n){const e=s.__("Image Viewer");[h.zoomIn,h.zoomOut,h.resetImage,h.rotateClockwise,h.rotateCounterclockwise,h.flipHorizontal,h.flipVertical,h.invertColors].forEach((t=>{n.addItem({command:t,category:e})}))}return v}function y(e,t,n){var i;const s=n.load("jupyterlab");const{commands:o,shell:r}=e;function a(){return t.currentWidget!==null&&t.currentWidget===r.currentWidget}o.addCommand(h.zoomIn,{execute:d,label:s.__("Zoom In"),isEnabled:a});o.addCommand(h.zoomOut,{execute:c,label:s.__("Zoom Out"),isEnabled:a});o.addCommand(h.resetImage,{execute:u,label:s.__("Reset Image"),isEnabled:a});o.addCommand(h.rotateClockwise,{execute:p,label:s.__("Rotate Clockwise"),isEnabled:a});o.addCommand(h.rotateCounterclockwise,{execute:m,label:s.__("Rotate Counterclockwise"),isEnabled:a});o.addCommand(h.flipHorizontal,{execute:g,label:s.__("Flip image horizontally"),isEnabled:a});o.addCommand(h.flipVertical,{execute:f,label:s.__("Flip image vertically"),isEnabled:a});o.addCommand(h.invertColors,{execute:v,label:s.__("Invert Colors"),isEnabled:a});const l=()=>{Object.values(h).forEach((e=>o.notifyCommandChanged(e)))};t.currentChanged.connect(l);(i=r.currentChanged)===null||i===void 0?void 0:i.connect(l);function d(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.scale=n.scale>1?n.scale+.5:n.scale*2}}function c(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.scale=n.scale>1?n.scale-.5:n.scale/2}}function u(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.scale=1;n.colorinversion=0;n.resetRotationFlip()}}function p(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.rotateClockwise()}}function m(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.rotateCounterclockwise()}}function g(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.flipHorizontal()}}function f(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.flipVertical()}}function v(){var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(n){n.colorinversion+=1;n.colorinversion%=2}}}},43017:(e,t,n)=>{"use strict";var i=n(97913);var s=n(79010);var o=n(3579);var r=n(10395);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(70047);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},70496:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IImageTracker:()=>s,ImageViewer:()=>c,ImageViewerFactory:()=>h});var i=n(5592);const s=new i.Token("@jupyterlab/imageviewer:IImageTracker",`A widget tracker for images.\n Use this if you want to be able to iterate over and interact with images\n viewed by the application.`);var o=n(37737);var r=n(72050);var a=n(44185);var l=n(1143);const d="jp-ImageViewer";class c extends l.Widget{constructor(e){super();this._scale=1;this._matrix=[1,0,0,1];this._colorinversion=0;this._ready=new i.PromiseDelegate;this.context=e;this.node.tabIndex=0;this.addClass(d);this._img=document.createElement("img");this.node.appendChild(this._img);this._onTitleChanged();e.pathChanged.connect(this._onTitleChanged,this);void e.ready.then((()=>{if(this.isDisposed){return}const t=e.contentsModel;this._mimeType=t.mimetype;this._render();e.model.contentChanged.connect(this.update,this);e.fileChanged.connect(this.update,this);this._ready.resolve(void 0)}))}[r.Printing.symbol](){return()=>r.Printing.printWidget(this)}get ready(){return this._ready.promise}get scale(){return this._scale}set scale(e){if(e===this._scale){return}this._scale=e;this._updateStyle()}get colorinversion(){return this._colorinversion}set colorinversion(e){if(e===this._colorinversion){return}this._colorinversion=e;this._updateStyle()}dispose(){if(this._img.src){URL.revokeObjectURL(this._img.src||"")}super.dispose()}resetRotationFlip(){this._matrix=[1,0,0,1];this._updateStyle()}rotateCounterclockwise(){this._matrix=u.prod(this._matrix,u.rotateCounterclockwiseMatrix);this._updateStyle()}rotateClockwise(){this._matrix=u.prod(this._matrix,u.rotateClockwiseMatrix);this._updateStyle()}flipHorizontal(){this._matrix=u.prod(this._matrix,u.flipHMatrix);this._updateStyle()}flipVertical(){this._matrix=u.prod(this._matrix,u.flipVMatrix);this._updateStyle()}onUpdateRequest(e){if(this.isDisposed||!this.context.isReady){return}this._render()}onActivateRequest(e){this.node.focus()}_onTitleChanged(){this.title.label=o.PathExt.basename(this.context.localPath)}_render(){const e=this.context;const t=e.contentsModel;if(!t){return}const n=this._img.src||"";let i=e.model.toString();if(t.format==="base64"){this._img.src=`data:${this._mimeType};base64,${i}`}else{const e=new Blob([i],{type:this._mimeType});this._img.src=URL.createObjectURL(e)}URL.revokeObjectURL(n)}_updateStyle(){const[e,t,n,i]=this._matrix;const[s,o]=u.prodVec(this._matrix,[1,1]);const r=`matrix(${e}, ${t}, ${n}, ${i}, 0, 0) translate(${s<0?-100:0}%, ${o<0?-100:0}%) `;this._img.style.transform=`scale(${this._scale}) ${r}`;this._img.style.filter=`invert(${this._colorinversion})`}}class h extends a.ABCWidgetFactory{createNewWidget(e){const t=new c(e);const n=new a.DocumentWidget({content:t,context:e});return n}}var u;(function(e){function t([e,t,n,i],[s,o,r,a]){return[e*s+t*r,e*o+t*a,n*s+i*r,n*o+i*a]}e.prod=t;function n([e,t,n,i],[s,o]){return[e*s+t*o,n*s+i*o]}e.prodVec=n;e.rotateClockwiseMatrix=[0,1,-1,0];e.rotateCounterclockwiseMatrix=[0,-1,1,0];e.flipHMatrix=[-1,0,0,1];e.flipVMatrix=[1,0,0,-1]})(u||(u={}))},33389:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>S});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(16015);var l=n.n(a);var d=n(54195);var c=n.n(d);var h=n(11447);var u=n.n(h);var p=n(54281);var m=n.n(p);var g=n(61927);var f=n.n(g);var v=n(66127);var _=n.n(v);var b;(function(e){e.open="inspector:open";e.close="inspector:close";e.toggle="inspector:toggle"})(b||(b={}));const y={id:"@jupyterlab/inspector-extension:inspector",description:"Provides the code introspection widget.",requires:[g.ITranslator],optional:[o.ICommandPalette,h.ILauncher,i.ILayoutRestorer],provides:d.IInspector,autoStart:true,activate:(e,t,n,i,s)=>{const r=t.load("jupyterlab");const{commands:a,shell:l}=e;const c=r.__("Live updating code documentation from the active kernel");const h=r.__("Contextual Help");const u="inspector";const p="jpInspector";const m=new o.WidgetTracker({namespace:u});function g(){return _&&!_.isDisposed}let f=null;let _;function y(e){var n;if(!g()){_=new o.MainAreaWidget({content:new d.InspectorPanel({translator:t})});_.id="jp-inspector";_.title.label=h;_.title.icon=v.inspectorIcon;void m.add(_);f=f&&!f.isDisposed?f:null;_.content.source=f;(n=_.content.source)===null||n===void 0?void 0:n.onEditorChange(e)}if(!_.isAttached){l.add(_,"main",{activate:false,mode:"split-right",type:"Inspector"})}l.activateById(_.id);document.body.dataset[p]="open";return _}function w(){_.dispose();delete document.body.dataset[p]}const C=r.__("Show Contextual Help");a.addCommand(b.open,{caption:c,isEnabled:()=>!_||_.isDisposed||!_.isAttached||!_.isVisible,label:C,icon:e=>e.isLauncher?v.inspectorIcon:undefined,execute:e=>{var t;const n=e&&e.text;const i=e&&e.refresh;if(g()&&i)(t=_.content.source)===null||t===void 0?void 0:t.onEditorChange(n);else y(n)}});const x=r.__("Hide Contextual Help");a.addCommand(b.close,{caption:c,isEnabled:()=>g(),label:x,icon:e=>e.isLauncher?v.inspectorIcon:undefined,execute:()=>w()});const S=r.__("Show Contextual Help");a.addCommand(b.toggle,{caption:c,label:S,isToggled:()=>g(),execute:e=>{if(g()){w()}else{const t=e&&e.text;y(t)}}});if(i){i.add({command:b.open,args:{isLauncher:true}})}if(n){n.addItem({command:b.toggle,category:S})}if(s){void s.restore(m,{command:b.toggle,name:()=>"inspector"})}const k=Object.defineProperty({},"source",{get:()=>!_||_.isDisposed?null:_.content.source,set:e=>{f=e&&!e.isDisposed?e:null;if(_&&!_.isDisposed){_.content.source=f}}});return k}};const w={id:"@jupyterlab/inspector-extension:consoles",description:"Adds code introspection support to consoles.",requires:[d.IInspector,a.IConsoleTracker,i.ILabShell],autoStart:true,activate:(e,t,n,i,s)=>{const o={};n.widgetAdded.connect(((e,t)=>{const n=t.console.sessionContext;const i=t.console.rendermime;const s=new d.KernelConnector({sessionContext:n});const r=new d.InspectionHandler({connector:s,rendermime:i});o[t.id]=r;const a=t.console.promptCell;r.editor=a&&a.editor;t.console.promptCellCreated.connect(((e,t)=>{r.editor=t&&t.editor}));t.disposed.connect((()=>{delete o[t.id];r.dispose()}))}));const r=e=>{if(e&&n.has(e)&&o[e.id]){t.source=o[e.id]}};i.currentChanged.connect(((e,t)=>r(t.newValue)));void e.restored.then((()=>r(i.currentWidget)))}};const C={id:"@jupyterlab/inspector-extension:notebooks",description:"Adds code introspection to notebooks.",requires:[d.IInspector,p.INotebookTracker,i.ILabShell],autoStart:true,activate:(e,t,n,i)=>{const s={};n.widgetAdded.connect(((e,t)=>{const n=t.sessionContext;const i=t.content.rendermime;const o=new d.KernelConnector({sessionContext:n});const r=new d.InspectionHandler({connector:o,rendermime:i});s[t.id]=r;const a=t.content.activeCell;r.editor=a&&a.editor;t.content.activeCellChanged.connect(((e,n)=>{void(n===null||n===void 0?void 0:n.ready.then((()=>{if(n===t.content.activeCell){r.editor=n.editor}})))}));t.disposed.connect((()=>{delete s[t.id];r.dispose()}))}));const o=e=>{if(e&&n.has(e)&&s[e.id]){t.source=s[e.id]}};i.currentChanged.connect(((e,t)=>o(t.newValue)));void e.restored.then((()=>o(i.currentWidget)))}};const x=[y,w,C];const S=x},45695:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(3579);var a=n(50286);var l=n(52638);var d=n(75797);var c=n(28006)},40516:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IInspector:()=>_,InspectionHandler:()=>l,InspectorPanel:()=>g,KernelConnector:()=>v});var i=n(37737);var s=n(90943);var o=n(5592);var r=n(26568);var a=n(2336);class l{constructor(e){this._cleared=new a.Signal(this);this._disposed=new a.Signal(this);this._editor=null;this._inspected=new a.Signal(this);this._isDisposed=false;this._pending=0;this._standby=true;this._lastInspectedReply=null;this._connector=e.connector;this._rendermime=e.rendermime;this._debouncer=new r.Debouncer(this.onEditorChange.bind(this),250)}get cleared(){return this._cleared}get disposed(){return this._disposed}get inspected(){return this._inspected}get editor(){return this._editor}set editor(e){if(e===this._editor){return}a.Signal.disconnectReceiver(this);const t=this._editor=e;if(t){this._cleared.emit(void 0);this.onEditorChange();t.model.selections.changed.connect(this._onChange,this);t.model.sharedModel.changed.connect(this._onChange,this)}}get standby(){return this._standby}set standby(e){this._standby=e}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._debouncer.dispose();this._disposed.emit(void 0);a.Signal.clearData(this)}onEditorChange(e){if(this._standby){return}const t=this.editor;if(!t){return}const n=e?e:t.model.sharedModel.getSource();const r=t.getCursorPosition();const a=i.Text.jsIndexToCharIndex(t.getOffsetAt(r),n);const l={content:null};const d=++this._pending;void this._connector.fetch({offset:a,text:n}).then((e=>{if(!e||this.isDisposed||d!==this._pending){this._lastInspectedReply=null;this._inspected.emit(l);return}const{data:t}=e;if(this._lastInspectedReply&&o.JSONExt.deepEqual(this._lastInspectedReply,t)){return}const n=this._rendermime.preferredMimeType(t);if(n){const e=this._rendermime.createRenderer(n);const i=new s.MimeModel({data:t});void e.renderModel(i);l.content=e}this._lastInspectedReply=e.data;this._inspected.emit(l)})).catch((e=>{this._lastInspectedReply=null;this._inspected.emit(l)}))}_onChange(){void this._debouncer.invoke()}}var d=n(72050);var c=n(61927);var h=n(1143);const u="jp-Inspector";const p="jp-Inspector-content";const m="jp-Inspector-placeholderContent";class g extends h.Panel{constructor(e={}){super();this._source=null;this.translator=e.translator||c.nullTranslator;this._trans=this.translator.load("jupyterlab");if(e.initialContent instanceof h.Widget){this._content=e.initialContent}else if(typeof e.initialContent==="string"){this._content=g._generateContentWidget(`

${e.initialContent}

`)}else{const e=`

${this._trans.__("No Documentation")}

`;const t=`

${this._trans.__("Move the cursor to a code fragment (e.g. function or object) to request information about it from the kernel attached to the editor.")}

`;this._content=g._generateContentWidget(`${e}${t}`)}this.addClass(u);this.layout.addWidget(this._content)}[d.Printing.symbol](){return()=>d.Printing.printWidget(this)}get source(){return this._source}set source(e){if(this._source===e){return}if(this._source){this._source.standby=true;this._source.inspected.disconnect(this.onInspectorUpdate,this);this._source.disposed.disconnect(this.onSourceDisposed,this)}if(e&&e.isDisposed){e=null}this._source=e;if(this._source){this._source.standby=false;this._source.inspected.connect(this.onInspectorUpdate,this);this._source.disposed.connect(this.onSourceDisposed,this)}}dispose(){if(this.isDisposed){return}this.source=null;super.dispose()}onInspectorUpdate(e,t){const{content:n}=t;if(!n||n===this._content){return}this._content.dispose();this._content=n;n.addClass(p);this.layout.addWidget(n)}onSourceDisposed(e,t){this.source=null}static _generateContentWidget(e){const t=new h.Widget;t.node.innerHTML=e;t.addClass(p);t.addClass(m);return t}}var f=n(86503);class v extends f.DataConnector{constructor(e){super();this._sessionContext=e.sessionContext}fetch(e){var t;const n=(t=this._sessionContext.session)===null||t===void 0?void 0:t.kernel;if(!n){return Promise.reject(new Error("Inspection fetch requires a kernel."))}const i={code:e.text,cursor_pos:e.offset,detail_level:1};return n.requestInspect(i).then((e=>{const t=e.content;if(t.status!=="ok"||!t.found){throw new Error("Inspection fetch failed to return successfully.")}return{data:t.data,metadata:t.metadata}}))}}const _=new o.Token("@jupyterlab/inspector:IInspector",`A service for adding contextual help to widgets (visible using "Show Contextual Help" from the Help menu).\n Use this to hook into the contextual help system in your extension.`)},52638:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(17325);var r=n(5893);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(96741);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},42147:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.r(__webpack_exports__);__webpack_require__.d(__webpack_exports__,{APPLICATION_JAVASCRIPT_MIMETYPE:()=>APPLICATION_JAVASCRIPT_MIMETYPE,ExperimentalRenderedJavascript:()=>ExperimentalRenderedJavascript,TEXT_JAVASCRIPT_MIMETYPE:()=>TEXT_JAVASCRIPT_MIMETYPE,default:()=>__WEBPACK_DEFAULT_EXPORT__,rendererFactory:()=>rendererFactory});var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(90943);var _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(_jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__);const TEXT_JAVASCRIPT_MIMETYPE="text/javascript";const APPLICATION_JAVASCRIPT_MIMETYPE="application/javascript";function evalInContext(code,element,document,window){return eval(code)}class ExperimentalRenderedJavascript extends _jupyterlab_rendermime__WEBPACK_IMPORTED_MODULE_0__.RenderedJavaScript{render(e){const t=this.translator.load("jupyterlab");const n=()=>{try{const t=e.data[this.mimeType];if(t){evalInContext(t,this.node,document,window)}return Promise.resolve()}catch(t){return Promise.reject(t)}};if(!e.trusted){const e=document.createElement("pre");e.textContent=t.__("Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const i=document.createElement("button");i.textContent=t.__("Run");this.node.appendChild(e);this.node.appendChild(i);i.onclick=e=>{this.node.textContent="";void n()};return Promise.resolve()}return n()}}const rendererFactory={safe:false,mimeTypes:[TEXT_JAVASCRIPT_MIMETYPE,APPLICATION_JAVASCRIPT_MIMETYPE],createRenderer:e=>new ExperimentalRenderedJavascript(e)};const extension={id:"@jupyterlab/javascript-extension:factory",description:"Adds renderer for JavaScript content.",rendererFactory,rank:0,dataType:"string"};const __WEBPACK_DEFAULT_EXPORT__=extension},53640:(e,t,n)=>{"use strict";var i=n(5893);var s=n(85072);var o=n.n(s);var r=n(97825);var a=n.n(r);var l=n(77659);var d=n.n(l);var c=n(55056);var h=n.n(c);var u=n(10540);var p=n.n(u);var m=n(41113);var g=n.n(m);var f=n(67613);var v={};v.styleTagTransform=g();v.setAttributes=h();v.insert=d().bind(null,"head");v.domAPI=a();v.insertStyleElement=p();var _=o()(f.A,v);const b=f.A&&f.A.locals?f.A.locals:undefined},60885:(e,t,n)=>{"use strict";n.d(t,{Component:()=>C});var i=n(90567);var s=n.n(i);var o=n(61927);var r=n.n(o);var a=n(66127);var l=n.n(a);var d=n(45145);var c=n.n(d);var h=n(5592);var u=n.n(h);var p=n(44914);var m=n.n(p);var g=n(80171);var f=n.n(g);var v=n(64368);var _=n.n(v);var b=n(23546);var y=n.n(b);function w(e){var t;return(t=i.jupyterHighlightStyle.style([e]))!==null&&t!==void 0?t:""}class C extends p.Component{constructor(){super(...arguments);this.state={filter:"",value:""};this.timer=0;this.handleChange=e=>{const{value:t}=e.target;this.setState({value:t});window.clearTimeout(this.timer);this.timer=window.setTimeout((()=>{this.setState({filter:t})}),300)}}componentDidMount(){b.StyleModule.mount(document,i.jupyterHighlightStyle.module)}render(){const e=this.props.translator||o.nullTranslator;const t=e.load("jupyterlab");const{data:n,metadata:i,forwardedRef:s}=this.props;const r=i&&i.root?i.root:"root";const l=this.state.filter?k(n,this.state.filter,[r]):[r];return p.createElement("div",{className:"container",ref:s},p.createElement(a.InputGroup,{className:"filter",type:"text",placeholder:t.__("Find…"),onChange:this.handleChange,value:this.state.value,rightIcon:"ui-components:search"}),p.createElement(v.JSONTree,{data:n,collectionLimit:100,theme:{extend:x,valueLabel:w(d.tags.variableName),valueText:w(d.tags.string),nestedNodeItemString:w(d.tags.comment)},invertTheme:false,keyPath:[r],getItemString:(e,t,n,i)=>Array.isArray(t)?p.createElement("span",null,n," ",i):Object.keys(t).length===0?p.createElement("span",null,n):null,labelRenderer:([e,t])=>p.createElement("span",{className:w(d.tags.keyword)},p.createElement(f(),{searchWords:[this.state.filter],textToHighlight:`${e}`,highlightClassName:"jp-mod-selected"})),valueRenderer:e=>{let t=w(d.tags.string);if(typeof e==="number"){t=w(d.tags.number)}if(e==="true"||e==="false"){t=w(d.tags.keyword)}return p.createElement("span",{className:t},p.createElement(f(),{searchWords:[this.state.filter],textToHighlight:`${e}`,highlightClassName:"jp-mod-selected"}))},shouldExpandNodeInitially:(e,t,n)=>i&&i.expanded?true:l.join(",").includes(e.join(","))}))}}const x={scheme:"jupyter",base00:"invalid",base01:"invalid",base02:"invalid",base03:"invalid",base04:"invalid",base05:"invalid",base06:"invalid",base07:"invalid",base08:"invalid",base09:"invalid",base0A:"invalid",base0B:"invalid",base0C:"invalid",base0D:"invalid",base0E:"invalid",base0F:"invalid",author:"invalid"};function S(e,t){return JSON.stringify(e).includes(t)}function k(e,t,n=["root"]){if(h.JSONExt.isArray(e)){return e.reduce(((e,i,s)=>{if(i&&typeof i==="object"&&S(i,t)){return[...e,[s,...n].join(","),...k(i,t,[s,...n])]}return e}),[])}if(h.JSONExt.isObject(e)){return Object.keys(e).reduce(((i,s)=>{const o=e[s];if(o&&typeof o==="object"&&(s.includes(t)||S(o,t))){return[...i,[s,...n].join(","),...k(o,t,[s,...n])]}return i}),[])}return[]}},94206:(e,t,n)=>{"use strict";n.r(t);n.d(t,{MIME_TYPE:()=>p,MIME_TYPES_JSONL:()=>m,RenderedJSON:()=>g,default:()=>_,rendererFactory:()=>f});var i=n(72050);var s=n.n(i);var o=n(61927);var r=n.n(o);var a=n(1143);var l=n.n(a);var d=n(44914);var c=n.n(d);var h=n(5338);const u="jp-RenderedJSON";const p="application/json";const m=["text/jsonl","application/jsonl","application/json-lines"];class g extends a.Widget{constructor(e){super();this._rootDOM=null;this.addClass(u);this.addClass("CodeMirror");this._mimeType=e.mimeType;this.translator=e.translator||o.nullTranslator}[i.Printing.symbol](){return()=>i.Printing.printWidget(this)}async renderModel(e){const{Component:t}=await Promise.all([n.e(4470),n.e(6127),n.e(5592),n.e(567),n.e(5145),n.e(3546),n.e(5930)]).then(n.bind(n,60885));let i;if(m.indexOf(this._mimeType)>=0){const t=(e.data[this._mimeType]||"").trim().split(/\n/);i=JSON.parse(`[${t.join(",")}]`)}else{i=e.data[this._mimeType]||{}}const s=e.metadata[this._mimeType]||{};if(this._rootDOM===null){this._rootDOM=(0,h.H)(this.node)}return new Promise(((e,n)=>{this._rootDOM.render(d.createElement(t,{data:i,metadata:s,translator:this.translator,forwardedRef:()=>e()}))}))}onBeforeDetach(e){if(this._rootDOM){this._rootDOM.unmount();this._rootDOM=null}}}const f={safe:true,mimeTypes:[p,...m],createRenderer:e=>new g(e)};const v=[{id:"@jupyterlab/json-extension:factory",description:"Adds renderer for JSON content.",rendererFactory:f,rank:0,dataType:"json",documentWidgetFactoryOptions:{name:"JSON",primaryFileType:"json",fileTypes:["json","notebook","geojson"],defaultFor:["json"]}},{id:"@jupyterlab/json-lines-extension:factory",description:"Adds renderer for JSONLines content.",rendererFactory:f,rank:0,dataType:"string",documentWidgetFactoryOptions:{name:"JSONLines",primaryFileType:"jsonl",fileTypes:["jsonl","ndjson"],defaultFor:["jsonl","ndjson"]}}];const _=v},367:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(23359);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(34176);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},960:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>b});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(45231);var l=n.n(a);var d=n(11447);var c=n.n(d);var h=n(61927);var u=n.n(h);var p=n(66127);var m=n.n(p);var g=n(34236);var f=n.n(g);var v;(function(e){e.create="launcher:create"})(v||(v={}));const _={activate:y,id:"@jupyterlab/launcher-extension:plugin",description:"Provides the launcher tab service.",requires:[h.ITranslator],optional:[i.ILabShell,o.ICommandPalette,a.IDefaultFileBrowser],provides:d.ILauncher,autoStart:true};const b=_;function y(e,t,n,i,s){const{commands:r,shell:a}=e;const l=t.load("jupyterlab");const c=new d.LauncherModel;r.addCommand(v.create,{label:l.__("New Launcher"),icon:e=>e.toolbar?p.addIcon:undefined,execute:e=>{var i,h;const u=(h=(i=e["cwd"])!==null&&i!==void 0?i:s===null||s===void 0?void 0:s.model.path)!==null&&h!==void 0?h:"";const m=`launcher-${w.id++}`;const f=e=>{if((0,g.find)(a.widgets("main"),(t=>t===e))){a.add(e,"main",{ref:m});v.dispose()}};const v=new d.Launcher({model:c,cwd:u,callback:f,commands:r,translator:t});v.model=c;v.title.icon=p.launcherIcon;v.title.label=l.__("Launcher");const _=new o.MainAreaWidget({content:v});_.title.closable=!!Array.from(a.widgets("main")).length;_.id=m;a.add(_,"main",{activate:e["activate"],ref:e["ref"]});if(n){n.layoutModified.connect((()=>{_.title.closable=Array.from(n.widgets("main")).length>1}),_)}if(s){const e=e=>{v.cwd=e.path};s.model.pathChanged.connect(e);v.disposed.connect((()=>{s.model.pathChanged.disconnect(e)}))}return _}});if(n){void Promise.all([e.restored,s===null||s===void 0?void 0:s.model.restored]).then((()=>{function e(){if(n.isEmpty("main")){void r.execute(v.create)}}n.layoutModified.connect((()=>{e()}))}))}if(i){i.addItem({command:v.create,category:l.__("Launcher")})}if(n){n.addButtonEnabled=true;n.addRequested.connect(((e,t)=>{var n;const i=((n=t.currentTitle)===null||n===void 0?void 0:n.owner.id)||t.titles[t.titles.length-1].owner.id;return r.execute(v.create,{ref:i})}))}return c}var w;(function(e){e.id=0})(w||(w={}))},68149:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(3579);var a=n(39063);var l=n(75797);var d=n(85072);var c=n.n(d);var h=n(97825);var u=n.n(h);var p=n(77659);var m=n.n(p);var g=n(55056);var f=n.n(g);var v=n(10540);var _=n.n(v);var b=n(41113);var y=n.n(b);var w=n(41782);var C={};C.styleTagTransform=y();C.setAttributes=f();C.insert=m().bind(null,"head");C.domAPI=u();C.insertStyleElement=_();var x=c()(w.A,C);const S=w.A&&w.A.locals?w.A.locals:undefined},70322:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ILauncher:()=>s,Launcher:()=>g,LauncherModel:()=>m});var i=n(5592);const s=new i.Token("@jupyterlab/launcher:ILauncher",`A service for the application activity launcher.\n Use this to add your extension activities to the launcher panel.`);var o=n(72050);var r=n(61927);var a=n(66127);var l=n(34236);var d=n(90044);var c=n(94466);var h=n(1143);var u=n(44914);const p="jp-Launcher";class m extends a.VDomModel{constructor(){super(...arguments);this.itemsList=[]}add(e){const t=v.createItem(e);this.itemsList.push(t);this.stateChanged.emit(void 0);return new d.DisposableDelegate((()=>{l.ArrayExt.removeFirstOf(this.itemsList,t);this.stateChanged.emit(void 0)}))}items(){return this.itemsList[Symbol.iterator]()}}class g extends a.VDomRenderer{constructor(e){super(e.model);this._pending=false;this._cwd="";this._cwd=e.cwd;this.translator=e.translator||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this._callback=e.callback;this._commands=e.commands;this.addClass(p)}get cwd(){return this._cwd}set cwd(e){this._cwd=e;this.update()}get pending(){return this._pending}set pending(e){this._pending=e}render(){if(!this.model){return null}const e=[this._trans.__("Notebook"),this._trans.__("Console"),this._trans.__("Other")];const t=[this._trans.__("Notebook"),this._trans.__("Console")];const n=Object.create(null);for(const r of this.model.items()){const e=r.category||this._trans.__("Other");if(!(e in n)){n[e]=[]}n[e].push(r)}for(const r in n){n[r]=n[r].sort(((e,t)=>v.sortCmp(e,t,this._cwd,this._commands)))}const i=[];let s;const o=[];for(const r of e){o.push(r)}for(const r in n){if(e.indexOf(r)===-1){o.push(r)}}o.forEach((e=>{if(!n[e]){return}const o=n[e][0];const r={...o.args,cwd:this.cwd};const d=t.indexOf(e)>-1;const c=this._commands.iconClass(o.command,r);const h=this._commands.icon(o.command,r);if(e in n){s=u.createElement("div",{className:"jp-Launcher-section",key:e},u.createElement("div",{className:"jp-Launcher-sectionHeader"},u.createElement(a.LabIcon.resolveReact,{icon:h,iconClass:(0,a.classes)(c,"jp-Icon-cover"),stylesheet:"launcherSection","aria-hidden":"true"}),u.createElement("h2",{className:"jp-Launcher-sectionTitle"},e)),u.createElement("div",{className:"jp-Launcher-cardContainer"},Array.from((0,l.map)(n[e],(e=>f(d,e,this,this._commands,this._trans,this._callback))))));i.push(s)}}));return u.createElement("div",{className:"jp-Launcher-body"},u.createElement("div",{className:"jp-Launcher-content"},u.createElement("div",{className:"jp-Launcher-cwd"},u.createElement("h3",null,this.cwd)),i))}}function f(e,t,n,i,s,r){const l=t.command;const d={...t.args,cwd:n.cwd};const c=i.caption(l,d);const p=i.label(l,d);const m=e?p:c||p;const g=()=>{if(n.pending===true){return}n.pending=true;void i.execute(l,{...t.args,cwd:n.cwd}).then((e=>{n.pending=false;if(e instanceof h.Widget){r(e)}})).catch((e=>{console.error(e);n.pending=false;void(0,o.showErrorMessage)(s._p("Error","Launcher Error"),e)}))};const f=e=>{if(e.key==="Enter"){g()}};const _=i.iconClass(l,d);const b=i.icon(l,d);return u.createElement("div",{className:"jp-LauncherCard",title:m,role:"button",onClick:g,onKeyDown:f,tabIndex:0,"data-category":t.category||s.__("Other"),key:v.keyProperty.get(t)},u.createElement("div",{className:"jp-LauncherCard-icon"},e?t.kernelIconUrl?u.createElement("img",{src:t.kernelIconUrl,className:"jp-Launcher-kernelIcon",alt:m}):u.createElement("div",{className:"jp-LauncherCard-noKernelIcon"},p[0].toUpperCase()):u.createElement(a.LabIcon.resolveReact,{icon:b,iconClass:(0,a.classes)(_,"jp-Icon-cover"),stylesheet:"launcherCard"})),u.createElement("div",{className:"jp-LauncherCard-label",title:m},u.createElement("p",null,p)))}var v;(function(e){let t=0;e.keyProperty=new c.AttachedProperty({name:"key",create:()=>t++});function n(e){return{...e,category:e.category||"",rank:e.rank!==undefined?e.rank:Infinity}}e.createItem=n;function i(e,t,n,i){const s=e.rank;const o=t.rank;if(s!==o&&s!==undefined&&o!==undefined){return s{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(97718);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},62062:(e,t,n)=>{"use strict";n.r(t);n.d(t,{LogLevelSwitcher:()=>C,default:()=>x});var i=n(74991);var s=n(72050);var o=n(44185);var r=n(39357);var a=n(90943);var l=n(15615);var d=n(66987);var c=n(61927);var h=n(66127);var u=n(5592);var p=n(44914);var m=n.n(p);var g=n(2336);function f(e){const t=e.translator||c.nullTranslator;const n=t.load("jupyterlab");let i="";if(e.newMessages>0){i=n.__("%1 new messages, %2 log entries for %3",e.newMessages,e.logEntries,e.source)}else{i+=n.__("%1 log entries for %2",e.logEntries,e.source)}return m().createElement(d.GroupItem,{role:"button",tabIndex:0,spacing:0,onClick:e.handleClick,onKeyDown:t=>{if(t.key==="Enter"||t.key===" "){e.handleClick()}},title:i},m().createElement(h.listIcon.react,{top:"2px",stylesheet:"statusBar"}),e.newMessages>0?m().createElement(d.TextItem,{source:e.newMessages}):m().createElement(m().Fragment,null))}class v extends h.VDomRenderer{constructor(e){super(new v.Model(e.loggerRegistry));this.translator=e.translator||c.nullTranslator;this._handleClick=e.handleClick;this.addClass("jp-mod-highlighted");this.addClass("jp-LogConsoleStatusItem")}render(){if(this.model===null||this.model.version===0){return null}const{flashEnabled:e,messages:t,source:n,version:i,versionDisplayed:s,versionNotified:o}=this.model;if(n!==null&&e&&i>o){this._flashHighlight();this.model.sourceNotified(n,i)}else if(n!==null&&e&&i>s){this._showHighlighted()}else{this._clearHighlight()}return m().createElement(f,{handleClick:this._handleClick,logEntries:t,newMessages:i-s,source:this.model.source,translator:this.translator})}_flashHighlight(){this._showHighlighted();this.removeClass("jp-LogConsole-flash");requestAnimationFrame((()=>{this.addClass("jp-LogConsole-flash")}))}_showHighlighted(){this.addClass("jp-mod-selected")}_clearHighlight(){this.removeClass("jp-LogConsole-flash");this.removeClass("jp-mod-selected")}}(function(e){class t extends h.VDomModel{constructor(e){super();this.flashEnabledChanged=new g.Signal(this);this._flashEnabled=true;this._source=null;this._sourceVersion=new Map;this._loggerRegistry=e;this._loggerRegistry.registryChanged.connect(this._handleLogRegistryChange,this);this._handleLogRegistryChange()}get messages(){if(this._source===null){return 0}const e=this._loggerRegistry.getLogger(this._source);return e.length}get version(){if(this._source===null){return 0}const e=this._loggerRegistry.getLogger(this._source);return e.version}get source(){return this._source}set source(e){if(this._source===e){return}this._source=e;this.stateChanged.emit()}get versionDisplayed(){var e,t;if(this._source===null){return 0}return(t=(e=this._sourceVersion.get(this._source))===null||e===void 0?void 0:e.lastDisplayed)!==null&&t!==void 0?t:0}get versionNotified(){var e,t;if(this._source===null){return 0}return(t=(e=this._sourceVersion.get(this._source))===null||e===void 0?void 0:e.lastNotified)!==null&&t!==void 0?t:0}get flashEnabled(){return this._flashEnabled}set flashEnabled(e){if(this._flashEnabled===e){return}this._flashEnabled=e;this.flashEnabledChanged.emit();this.stateChanged.emit()}sourceDisplayed(e,t){if(e===null||t===null){return}const n=this._sourceVersion.get(e);let i=false;if(n.lastDisplayed"logconsole"})}const y=new v({loggerRegistry:g,handleClick:()=>{var t;if(!p){x({insertMode:"split-bottom",ref:(t=e.shell.currentWidget)===null||t===void 0?void 0:t.id})}else{e.shell.activateById(p.id)}},translator:n});const w=()=>{const t=e.shell.currentWidget;if(i===null||i===void 0?void 0:i.currentPath){return i.currentPath}if(t&&t instanceof o.DocumentWidget){return t.context.path}return null};const x=(t={})=>{var i,o;m=new r.LogConsolePanel(g,n);m.source=(o=(i=t.source)!==null&&i!==void 0?i:w())!==null&&o!==void 0?o:null;p=new s.MainAreaWidget({content:m});p.addClass("jp-LogConsole");p.title.closable=true;p.title.icon=h.listIcon;p.title.label=u.__("Log Console");const a=new h.CommandToolbarButton({commands:e.commands,id:b.addCheckpoint});const l=new h.CommandToolbarButton({commands:e.commands,id:b.clear});const d=()=>{e.commands.notifyCommandChanged(b.addCheckpoint);e.commands.notifyCommandChanged(b.clear);e.commands.notifyCommandChanged(b.open);e.commands.notifyCommandChanged(b.setLevel)};p.toolbar.addItem("lab-log-console-add-checkpoint",a);p.toolbar.addItem("lab-log-console-clear",l);p.toolbar.addItem("level",new C(p.content,n));m.sourceChanged.connect((()=>{d()}));m.sourceDisplayed.connect(((e,{source:t,version:n})=>{y.model.sourceDisplayed(t,n)}));p.disposed.connect((()=>{p=null;m=null;d()}));e.shell.add(p,"down",{ref:t.ref,mode:t.insertMode,type:"Log Console"});void f.add(p);e.shell.activateById(p.id);p.update();d()};e.commands.addCommand(b.open,{label:u.__("Show Log Console"),execute:(e={})=>{if(p){p.dispose()}else{x(e)}},isToggled:()=>p!==null});e.commands.addCommand(b.addCheckpoint,{execute:()=>{var e;(e=m===null||m===void 0?void 0:m.logger)===null||e===void 0?void 0:e.checkpoint()},icon:h.addIcon,isEnabled:()=>!!m&&m.source!==null,label:u.__("Add Checkpoint")});e.commands.addCommand(b.clear,{execute:()=>{var e;(e=m===null||m===void 0?void 0:m.logger)===null||e===void 0?void 0:e.clear()},icon:h.clearIcon,isEnabled:()=>!!m&&m.source!==null,label:u.__("Clear Log")});function S(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}e.commands.addCommand(b.setLevel,{execute:e=>{if(m===null||m===void 0?void 0:m.logger){m.logger.level=e.level}},isEnabled:()=>!!m&&m.source!==null,label:e=>e["level"]?u.__("Set Log Level to %1",S(e.level)):u.__("Set log level to `level`.")});if(a){a.addItem({command:b.open,category:u.__("Main Area")})}if(c){c.registerStatusItem("@jupyterlab/logconsole-extension:status",{item:y,align:"left",isActive:()=>{var e;return((e=y.model)===null||e===void 0?void 0:e.version)>0},activeStateChanged:y.model.stateChanged})}function k(e){if(m){m.source=e}y.model.source=e}void e.restored.then((()=>{var e;if(i){i.currentPathChanged.connect(((e,{newValue:t})=>k(t)));k((e=i.currentPath)!==null&&e!==void 0?e:null)}else{k(w())}}));if(d){const t=e=>{g.maxLength=e.get("maxLogEntries").composite;y.model.flashEnabled=e.get("flash").composite};Promise.all([d.load(_),e.restored]).then((([e])=>{t(e);e.changed.connect((e=>{t(e)}))})).catch((e=>{console.error(e.message)}))}return g}class C extends h.ReactWidget{constructor(e,t){super();this.handleChange=e=>{if(this._logConsole.logger){this._logConsole.logger.level=e.target.value}this.update()};this.handleKeyDown=e=>{if(e.keyCode===13){this._logConsole.activate()}};this._id=`level-${u.UUID.uuid4()}`;this.translator=t!==null&&t!==void 0?t:c.nullTranslator;this._trans=this.translator.load("jupyterlab");this.addClass("jp-LogConsole-toolbarLogLevel");this._logConsole=e;if(e.source){this.update()}e.sourceChanged.connect(this._updateSource,this)}_updateSource(e,{oldValue:t,newValue:n}){if(t!==null){const n=e.loggerRegistry.getLogger(t);n.stateChanged.disconnect(this.update,this)}if(n!==null){const t=e.loggerRegistry.getLogger(n);t.stateChanged.connect(this.update,this)}this.update()}render(){const e=this._logConsole.logger;return p.createElement(p.Fragment,null,p.createElement("label",{htmlFor:this._id,className:e===null?"jp-LogConsole-toolbarLogLevel-disabled":undefined},this._trans.__("Log Level:")),p.createElement(h.HTMLSelect,{id:this._id,className:"jp-LogConsole-toolbarLogLevelDropdown",onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e===null||e===void 0?void 0:e.level,"aria-label":this._trans.__("Log level"),disabled:e===null,options:e===null?[]:[[this._trans.__("Critical"),"Critical"],[this._trans.__("Error"),"Error"],[this._trans.__("Warning"),"Warning"],[this._trans.__("Info"),"Info"],[this._trans.__("Debug"),"Debug"]].map((e=>({label:e[0],value:e[1].toLowerCase()})))}))}}const x=y},87456:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(5893);var l=n(79010);var d=n(3579);var c=n(69704);var h=n(85072);var u=n.n(h);var p=n(97825);var m=n.n(p);var g=n(77659);var f=n.n(g);var v=n(55056);var _=n.n(v);var b=n(10540);var y=n.n(b);var w=n(41113);var C=n.n(w);var x=n(39817);var S={};S.styleTagTransform=C();S.setAttributes=_();S.insert=f().bind(null,"head");S.domAPI=m();S.insertStyleElement=y();var k=u()(x.A,S);const j=x.A&&x.A.locals?x.A.locals:undefined},42708:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ILoggerRegistry:()=>p,LogConsolePanel:()=>w,LogOutputModel:()=>r,Logger:()=>d,LoggerOutputAreaModel:()=>l,LoggerRegistry:()=>h,ScrollingWidget:()=>y});var i=n(8329);var s=n(90943);var o=n(2336);class r extends s.OutputModel{constructor(e){super(e);this.timestamp=new Date(e.value.timestamp);this.level=e.value.level}}class a extends i.OutputAreaModel.ContentFactory{createOutputModel(e){return new r(e)}}class l extends i.OutputAreaModel{constructor({maxLength:e,...t}){super(t);this.maxLength=e}add(e){super.add(e);this._applyMaxLength();return this.length}shouldCombine(e){const{value:t,lastModel:n}=e;const i=Math.trunc(n.timestamp.getTime()/1e3);const s=Math.trunc(t.timestamp/1e3);return i===s}get(e){return super.get(e)}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e;this._applyMaxLength()}_applyMaxLength(){if(this.list.length>this._maxLength){this.list.removeRange(0,this.list.length-this._maxLength)}}}class d{constructor(e){this._isDisposed=false;this._contentChanged=new o.Signal(this);this._stateChanged=new o.Signal(this);this._rendermime=null;this._version=0;this._level="warning";this.source=e.source;this.outputAreaModel=new l({contentFactory:new a,maxLength:e.maxLength})}get maxLength(){return this.outputAreaModel.maxLength}set maxLength(e){this.outputAreaModel.maxLength=e}get level(){return this._level}set level(e){const t=this._level;if(t===e){return}this._level=e;this._log({output:{output_type:"display_data",data:{"text/plain":`Log level set to ${e}`}},level:"metadata"});this._stateChanged.emit({name:"level",oldValue:t,newValue:e})}get length(){return this.outputAreaModel.length}get contentChanged(){return this._contentChanged}get stateChanged(){return this._stateChanged}get rendermime(){return this._rendermime}set rendermime(e){if(e!==this._rendermime){const t=this._rendermime;const n=this._rendermime=e;this._stateChanged.emit({name:"rendermime",oldValue:t,newValue:n})}}get version(){return this._version}log(e){if(c.LogLevel[e.level]"}},level:"metadata"})}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this.clear();this._rendermime=null;o.Signal.clearData(this)}_log(e){this._version++;this.outputAreaModel.add({...e.output,timestamp:Date.now(),level:e.level});this._contentChanged.emit("append")}}var c;(function(e){let t;(function(e){e[e["debug"]=0]="debug";e[e["info"]=1]="info";e[e["warning"]=2]="warning";e[e["error"]=3]="error";e[e["critical"]=4]="critical";e[e["metadata"]=5]="metadata"})(t=e.LogLevel||(e.LogLevel={}))})(c||(c={}));class h{constructor(e){this._loggers=new Map;this._registryChanged=new o.Signal(this);this._isDisposed=false;this._defaultRendermime=e.defaultRendermime;this._maxLength=e.maxLength}getLogger(e){const t=this._loggers;let n=t.get(e);if(n){return n}n=new d({source:e,maxLength:this.maxLength});n.rendermime=this._defaultRendermime;t.set(e,n);this._registryChanged.emit("append");return n}getLoggers(){return Array.from(this._loggers.values())}get registryChanged(){return this._registryChanged}get maxLength(){return this._maxLength}set maxLength(e){this._maxLength=e;this._loggers.forEach((t=>{t.maxLength=e}))}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._loggers.forEach((e=>e.dispose()));o.Signal.clearData(this)}}var u=n(5592);const p=new u.Token("@jupyterlab/logconsole:ILoggerRegistry","A service providing a logger infrastructure.");var m=n(61927);var g=n(1143);function f(e){return e.length===0?e:e[0].toUpperCase()+e.slice(1)}class v extends g.Widget{constructor(){super();this._timestampNode=document.createElement("div");this.node.append(this._timestampNode)}set timestamp(e){this._timestamp=e;this._timestampNode.innerHTML=this._timestamp.toLocaleTimeString();this.update()}set level(e){this._level=e;this.node.dataset.logLevel=e;this.update()}update(){if(this._level!==undefined&&this._timestamp!==undefined){this.node.title=`${this._timestamp.toLocaleString()}; ${f(this._level)} level`}}}class _ extends i.OutputArea{createOutputItem(e){const t=super.createOutputItem(e);if(t===null){return null}const n=t.widgets[0];n.timestamp=e.timestamp;n.level=e.level;return t}onInputRequest(e,t){return}}class b extends i.OutputArea.ContentFactory{createOutputPrompt(){return new v}}class y extends g.Widget{constructor({content:e,...t}){super(t);this._observer=null;this.addClass("jp-Scrolling");const n=this.layout=new g.PanelLayout;n.addWidget(e);this._content=e;this._sentinel=document.createElement("div");this.node.appendChild(this._sentinel)}get content(){return this._content}onAfterAttach(e){super.onAfterAttach(e);requestAnimationFrame((()=>{this._sentinel.scrollIntoView();this._scrollHeight=this.node.scrollHeight}));if(typeof IntersectionObserver!=="undefined"){this._observer=new IntersectionObserver((e=>{this._handleScroll(e)}),{root:this.node,threshold:1});this._observer.observe(this._sentinel)}}onBeforeDetach(e){if(this._observer){this._observer.disconnect()}}onAfterShow(e){if(this._tracking){this._sentinel.scrollIntoView()}}_handleScroll([e]){if(e.isIntersecting){this._tracking=true}else if(this.isVisible){const e=this.node.scrollHeight;if(e===this._scrollHeight){this._tracking=false}else{this._sentinel.scrollIntoView();this._scrollHeight=e;this._tracking=true}}}}class w extends g.StackedPanel{constructor(e,t){super();this._outputAreas=new Map;this._source=null;this._sourceChanged=new o.Signal(this);this._sourceDisplayed=new o.Signal(this);this._loggersWatched=new Set;this.translator=t||m.nullTranslator;this._trans=this.translator.load("jupyterlab");this._loggerRegistry=e;this.addClass("jp-LogConsolePanel");e.registryChanged.connect(((e,t)=>{this._bindLoggerSignals()}),this);this._bindLoggerSignals();this._placeholder=new g.Widget;this._placeholder.addClass("jp-LogConsoleListPlaceholder");this.addWidget(this._placeholder)}get loggerRegistry(){return this._loggerRegistry}get logger(){if(this.source===null){return null}return this.loggerRegistry.getLogger(this.source)}get source(){return this._source}set source(e){if(e===this._source){return}const t=this._source;const n=this._source=e;this._showOutputFromSource(n);this._handlePlaceholder();this._sourceChanged.emit({oldValue:t,newValue:n,name:"source"})}get sourceVersion(){const e=this.source;return e!==null?this._loggerRegistry.getLogger(e).version:null}get sourceChanged(){return this._sourceChanged}get sourceDisplayed(){return this._sourceDisplayed}onAfterAttach(e){super.onAfterAttach(e);this._updateOutputAreas();this._showOutputFromSource(this._source);this._handlePlaceholder()}onAfterShow(e){super.onAfterShow(e);if(this.source!==null){this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})}}_bindLoggerSignals(){const e=this._loggerRegistry.getLoggers();for(const t of e){if(this._loggersWatched.has(t.source)){continue}t.contentChanged.connect(((e,t)=>{this._updateOutputAreas();this._handlePlaceholder()}),this);t.stateChanged.connect(((e,t)=>{if(t.name!=="rendermime"){return}const n=`source:${e.source}`;const i=this._outputAreas.get(n);if(i){if(t.newValue){i.rendermime=t.newValue}else{i.dispose()}}}),this);this._loggersWatched.add(t.source)}}_showOutputFromSource(e){const t=e===null?"null source":`source:${e}`;this._outputAreas.forEach(((e,n)=>{var i,s;if(e.id===t){(i=e.parent)===null||i===void 0?void 0:i.show();if(e.isVisible){this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})}}else{(s=e.parent)===null||s===void 0?void 0:s.hide()}}));const n=e===null?this._trans.__("Log Console"):this._trans.__("Log: %1",e);this.title.label=n;this.title.caption=n}_handlePlaceholder(){if(this.source===null){this._placeholder.node.textContent=this._trans.__("No source selected.");this._placeholder.show()}else if(this._loggerRegistry.getLogger(this.source).length===0){this._placeholder.node.textContent=this._trans.__("No log messages.");this._placeholder.show()}else{this._placeholder.hide();this._placeholder.node.textContent=""}}_updateOutputAreas(){const e=new Set;const t=this._loggerRegistry.getLoggers();for(const i of t){const t=i.source;const n=`source:${t}`;e.add(n);if(!this._outputAreas.has(n)){const e=new _({rendermime:i.rendermime,contentFactory:new b,model:i.outputAreaModel});e.id=n;const s=new y({content:e});this.addWidget(s);this._outputAreas.set(n,e);const o=e=>{if(this.source===t&&e.isVisible){this._sourceDisplayed.emit({source:this.source,version:this.sourceVersion})}};e.outputLengthChanged.connect(o,this);o(e)}}const n=this._outputAreas.keys();for(const i of n){if(!e.has(i)){const e=this._outputAreas.get(i);e===null||e===void 0?void 0:e.dispose();this._outputAreas.delete(i)}}}}},69704:(e,t,n)=>{"use strict";var i=n(10395);var s=n(5893);var o=n(1649);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(42769);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},8113:(e,t,n)=>{"use strict";n.r(t);n.d(t,{RunningLanguageServer:()=>j,default:()=>T});var i=n(90295);var s=n(69085);var o=n(15615);var r=n(61927);var a=n(66127);var l=n(2336);var d=n(5592);var c=n(26568);var h=n(44914);var u=n.n(h);var p=n(72050);const m="languageServers";const g="configuration";function f(e){const{[g]:t,...n}=e.schema;const{[g]:i,serverName:s,...o}=e.settings;const[r,a]=(0,h.useState)(s);const l=t=>{e.updateSetting.invoke(e.serverHash,{serverName:t.target.value}).catch(console.error);a(t.target.value)};const m={};Object.entries(i).forEach((([e,t])=>{const n={property:e,type:typeof t,value:t};m[d.UUID.uuid4()]=n}));const[f,_]=(0,h.useState)(m);const b={};Object.entries(n).forEach((([e,t])=>{if(e in o){b[e]=o[e]}else{b[e]=t["default"]}}));const[y,w]=(0,h.useState)(b);const C=(t,n,i)=>{let s=n;if(i==="number"){s=parseFloat(n)}const o={...y,[t]:s};e.updateSetting.invoke(e.serverHash,o).catch(console.error);w(o)};const x=()=>{const t=d.UUID.uuid4();const n={...f,[t]:{property:"",type:"string",value:""}};const i={};Object.values(n).forEach((e=>{i[e.property]=e.value}));e.updateSetting.invoke(e.serverHash,{[g]:i}).catch(console.error);_(n)};const S=t=>{const n={};Object.entries(f).forEach((([i,s])=>{if(i!==t){n[i]=s}const o={};Object.values(n).forEach((e=>{o[e.property]=e.value}));e.updateSetting.invoke(e.serverHash,{[g]:o}).catch(console.error);_(n)}))};const k=(t,n)=>{if(t in f){const i={...f,[t]:n};const s={};Object.values(i).forEach((e=>{s[e.property]=e.value}));_(i);e.updateSetting.invoke(e.serverHash,{[g]:s}).catch(console.error)}};const j=new c.Debouncer(k);const I=(0,h.useRef)(p.DOMUtils.createDomID()+"-line-number-input");return u().createElement("div",{className:"array-item"},u().createElement("div",{className:"form-group "},u().createElement("div",{className:"jp-FormGroup-content"},u().createElement("div",{className:"jp-objectFieldWrapper"},u().createElement("fieldset",null,u().createElement("div",{className:"form-group small-field"},u().createElement("div",{className:"jp-modifiedIndicator jp-errorIndicator"}),u().createElement("div",{className:"jp-FormGroup-content"},u().createElement("label",{htmlFor:I.current,className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},e.trans.__("Server name:")),u().createElement("div",{className:"jp-inputFieldWrapper jp-FormGroup-contentItem"},u().createElement("input",{id:I.current,className:"form-control",type:"text",required:true,value:r,onChange:e=>{l(e)}})),u().createElement("div",{className:"validationErrors"},u().createElement("div",null,u().createElement("ul",{className:"error-detail bs-callout bs-callout-info"},u().createElement("li",{className:"text-danger"},e.trans.__("is a required property"))))))),Object.entries(n).map((([e,t],n)=>u().createElement("div",{key:`${n}-${e}`,className:"form-group small-field"},u().createElement("div",{className:"jp-FormGroup-content"},u().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},t.title),u().createElement("div",{className:"jp-inputFieldWrapper jp-FormGroup-contentItem"},u().createElement("input",{className:"form-control",placeholder:"",type:t.type,value:y[e],onChange:n=>C(e,n.target.value,t.type)})),u().createElement("div",{className:"jp-FormGroup-description"},t.description),u().createElement("div",{className:"validationErrors"}))))),u().createElement("fieldset",null,u().createElement("legend",null,t["title"]),Object.entries(f).map((([e,t])=>u().createElement(v,{key:e,hash:e,property:t,removeProperty:S,setProperty:j}))),u().createElement("span",null,t["description"])))))),u().createElement("div",{className:"jp-ArrayOperations"},u().createElement("button",{className:"jp-mod-styled jp-mod-reject",onClick:x},e.trans.__("Add property")),u().createElement("button",{className:"jp-mod-styled jp-mod-warn jp-FormGroup-removeButton",onClick:()=>e.removeSetting(e.serverHash)},e.trans.__("Remove server"))))}function v(e){const[t,n]=(0,h.useState)({...e.property});const i={string:"text",number:"number",boolean:"checkbox"};const s=()=>{e.removeProperty(e.hash)};const o=i=>{const s={...t,property:i};e.setProperty.invoke(e.hash,s).catch(console.error);n(s)};const r=(i,s)=>{let o=i;if(s==="number"){o=parseFloat(i)}const r={...t,value:o};e.setProperty.invoke(e.hash,r).catch(console.error);n(r)};const l=i=>{let s;if(i==="boolean"){s=false}else if(i==="number"){s=0}else{s=""}const o={...t,type:i,value:s};n(o);e.setProperty.invoke(e.hash,o).catch(console.error)};return u().createElement("div",{key:e.hash,className:"form-group small-field"},u().createElement("div",{className:"jp-FormGroup-content jp-LSPExtension-FormGroup-content"},u().createElement("input",{className:"form-control",type:"text",required:true,placeholder:"Property name",value:t.property,onChange:e=>{o(e.target.value)}}),u().createElement("select",{className:"form-control",value:t.type,onChange:e=>l(e.target.value)},u().createElement("option",{value:"string"},"String"),u().createElement("option",{value:"number"},"Number"),u().createElement("option",{value:"boolean"},"Boolean")),u().createElement("input",{className:"form-control",type:i[t.type],required:false,placeholder:"Property value",value:t.type!=="boolean"?t.value:undefined,checked:t.type==="boolean"?t.value:undefined,onChange:t.type!=="boolean"?e=>r(e.target.value,t.type):e=>r(e.target.checked,t.type)}),u().createElement("button",{className:"jp-mod-minimal jp-Button",onClick:s},u().createElement(a.closeIcon.react,null))))}class _ extends u().Component{constructor(e){super(e);this.removeSetting=e=>{if(e in this.state.items){const t={};for(const n in this.state.items){if(n!==e){t[n]=this.state.items[n]}}this.setState((e=>({...e,items:t})),(()=>{this.saveServerSetting()}))}};this.updateSetting=(e,t)=>{if(e in this.state.items){const n={};for(const i in this.state.items){if(i===e){n[i]={...this.state.items[i],...t}}else{n[i]=this.state.items[i]}}this.setState((e=>({...e,items:n})),(()=>{this.saveServerSetting()}))}};this.addServerSetting=()=>{let e=0;let t="newKey";while(Object.values(this.state.items).map((e=>e.serverName)).includes(t)){e+=1;t=`newKey-${e}`}this.setState((e=>({...e,items:{...e.items,[d.UUID.uuid4()]:{...this._defaultSetting,serverName:t}}})),(()=>{this.saveServerSetting()}))};this.saveServerSetting=()=>{const e={};Object.values(this.state.items).forEach((t=>{const{serverName:n,...i}=t;e[n]=i}));this._setting.set(m,e).catch(console.error)};this._setting=e.formContext.settings;this._trans=e.translator.load("jupyterlab");const t=this._setting.schema["definitions"];this._defaultSetting=t["languageServer"]["default"];this._schema=t["languageServer"]["properties"];const n=e.schema.title;const i=e.schema.description;const s=e.formContext.settings;const o=s.get(m).composite;let r={};if(o){Object.entries(o).forEach((([e,t])=>{if(t){const n=d.UUID.uuid4();r[n]={serverName:e,...t}}}))}this.state={title:n,desc:i,items:r};this._debouncedUpdateSetting=new c.Debouncer(this.updateSetting.bind(this))}render(){return u().createElement("div",null,u().createElement("fieldset",null,u().createElement("legend",null,this.state.title),u().createElement("p",{className:"field-description"},this.state.desc),u().createElement("div",{className:"field field-array field-array-of-object"},Object.entries(this.state.items).map((([e,t],n)=>u().createElement(f,{key:`${n}-${e}`,trans:this._trans,removeSetting:this.removeSetting,updateSetting:this._debouncedUpdateSetting,serverHash:e,settings:t,schema:this._schema})))),u().createElement("div",null,u().createElement("button",{style:{margin:2},className:"jp-mod-styled jp-mod-reject",onClick:this.addServerSetting},this._trans.__("Add server")))))}}function b(e,t){return u().createElement(_,{...e,translator:t})}const y={activate:S,id:"@jupyterlab/lsp-extension:plugin",description:"Provides the language server connection manager.",requires:[r.ITranslator,i.IWidgetLSPAdapterTracker],optional:[s.IRunningSessionManagers],provides:i.ILSPDocumentConnectionManager,autoStart:true};const w={id:"@jupyterlab/lsp-extension:feature",description:"Provides the language server feature manager.",activate:()=>new i.FeatureManager,provides:i.ILSPFeatureManager,autoStart:true};const C={activate:k,id:"@jupyterlab/lsp-extension:settings",description:"Provides the language server settings.",requires:[i.ILSPDocumentConnectionManager,o.ISettingRegistry,r.ITranslator],optional:[a.IFormRendererRegistry],autoStart:true};const x={id:"@jupyterlab/lsp-extension:code-extractor-manager",autoStart:true,description:"Provides the code extractor manager.",provides:i.ILSPCodeExtractorsManager,activate:e=>{const t=new i.CodeExtractorsManager;const n=new i.TextForeignCodeExtractor({language:"markdown",isStandalone:false,file_extension:"md",cellType:["markdown"]});t.register(n,null);const s=new i.TextForeignCodeExtractor({language:"text",isStandalone:false,file_extension:"txt",cellType:["raw"]});t.register(s,null);return t}};function S(e,t,n,s){const o=new i.LanguageServerManager({settings:e.serviceManager.serverSettings});const r=new i.DocumentConnectionManager({languageServerManager:o,adapterTracker:n});if(s){I(s,r,t)}return r}function k(e,t,n,i,s){const o="languageServers";const r=t.languageServerManager;const a=e=>{const n=e.composite;const i=n.languageServers||{};if(n.activate==="on"&&!r.isEnabled){r.enable().catch(console.error)}else if(n.activate==="off"&&r.isEnabled){r.disable();return}t.initialConfigurations=i;t.updateConfiguration(i);t.updateServerConfigurations(i);t.updateLogging(n.logAllCommunication,n.setTrace)};n.transform(y.id,{fetch:e=>{const t=e.schema.properties;const n={};r.sessions.forEach(((e,t)=>{n[t]={rank:50,configuration:{}}}));t[o]["default"]=n;return e},compose:e=>{const t=e.schema.properties;const n=e.data.user;const i=t[o]["default"];const s=n[o];let r={...i};if(s){r={...r,...s}}const a={[o]:r};Object.entries(t).forEach((([e,t])=>{if(e!==o){if(e in n){a[e]=n[e]}else{a[e]=t.default}}}));e.data.composite=a;return e}});r.sessionsChanged.connect((async()=>{await n.load(y.id,true)}));n.load(y.id).then((e=>{a(e);e.changed.connect((()=>{a(e)}));r.disable()})).catch((e=>{console.error(e.message)}));if(s){const e={fieldRenderer:e=>b(e,i)};s.addRenderer(`${y.id}.${o}`,e)}}class j{constructor(e,t){this._connection=new WeakSet([e]);this._manager=t;this._serverIdentifier=e.serverIdentifier;this._serverLanguage=e.serverLanguage}open(){}icon(){return a.pythonIcon}label(){var e,t;return`${(e=this._serverIdentifier)!==null&&e!==void 0?e:""} (${(t=this._serverLanguage)!==null&&t!==void 0?t:""})`}shutdown(){for(const[e,t]of this._manager.connections.entries()){if(this._connection.has(t)){const{uri:t}=this._manager.documents.get(e);this._manager.unregisterDocument(t)}}this._manager.disconnect(this._serverIdentifier)}}function I(e,t,n){const i=n.load("jupyterlab");const s=new l.Signal(t);t.connected.connect((()=>s.emit(t)));t.disconnected.connect((()=>s.emit(t)));t.closed.connect((()=>s.emit(t)));t.documentsChanged.connect((()=>s.emit(t)));let o=[];e.add({name:i.__("Language servers"),supportsMultipleViews:false,running:()=>{const e=new Set([...t.connections.values()]);o=[...e].map((e=>new j(e,t)));return o},shutdownAll:()=>{o.forEach((e=>{e.shutdown()}))},refreshRunning:()=>void 0,runningChanged:s,shutdownLabel:i.__("Shut Down"),shutdownAllLabel:i.__("Shut Down All"),shutdownAllConfirmationText:i.__("Are you sure you want to permanently shut down all running language servers?")})}const E={id:"@jupyterlab/lsp-extension:tracker",description:"Provides the tracker of `WidgetLSPAdapter`.",autoStart:true,provides:i.IWidgetLSPAdapterTracker,activate:e=>new i.WidgetLSPAdapterTracker({shell:e.shell})};const T=[y,w,C,x,E]},4380:(e,t,n)=>{"use strict";var i=n(40662);var s=n(97913);var o=n(3579);var r=n(13137);var a=n(94780);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(37347);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},15771:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CodeExtractorsManager:()=>F,DefaultMap:()=>j,DocumentConnectionManager:()=>O,EditorAdapter:()=>l,FeatureManager:()=>q,ILSPCodeExtractorsManager:()=>b,ILSPDocumentConnectionManager:()=>v,ILSPFeatureManager:()=>_,ILanguageServerManager:()=>f,IWidgetLSPAdapterTracker:()=>y,LanguageServerManager:()=>K,Method:()=>w,ProtocolCoordinates:()=>V,TextForeignCodeExtractor:()=>U,UpdateManager:()=>Q,VirtualDocument:()=>Y,VirtualDocumentInfo:()=>G,WidgetLSPAdapter:()=>h,WidgetLSPAdapterTracker:()=>p,collectDocuments:()=>X,expandDottedPaths:()=>S,expandPath:()=>k,isEqual:()=>z,isWithinRange:()=>J,offsetAtPosition:()=>W,positionAtOffset:()=>H,sleep:()=>C,untilReady:()=>x});var i=n(8394);var s=n.n(i);var o=n(72050);var r=n(61927);var a=n(2336);class l{constructor(e){this._widgetAdapter=e.widgetAdapter;this._extensions=e.extensions;void e.editor.ready().then((t=>{this._injectExtensions(e.editor)}))}dispose(){if(this.isDisposed){return}this.isDisposed=true;a.Signal.clearData(this)}_injectExtensions(e){const t=e.getEditor();if(!t||t.isDisposed){return}this._extensions.forEach((n=>{const i=n.factory({path:this._widgetAdapter.widget.context.path,editor:e,widgetAdapter:this._widgetAdapter,model:t.model,inline:true});if(!i){return}t.injectExtension(i.instance(t))}))}}const d=o.Dialog.createButton;const c={"text/x-rsrc":"r","text/x-r-source":"r","text/x-ipython":"python"};class h{constructor(e,t){this.widget=e;this.options=t;this._adapterConnected=new a.Signal(this);this._activeEditorChanged=new a.Signal(this);this._editorAdded=new a.Signal(this);this._editorRemoved=new a.Signal(this);this._disposed=new a.Signal(this);this._isDisposed=false;this._virtualDocument=null;this._connectionManager=t.connectionManager;this._isConnected=false;this._trans=(t.translator||r.nullTranslator).load("jupyterlab");this.widget.context.saveState.connect(this.onSaveState,this);this.connectionManager.closed.connect(this.onConnectionClosed,this);this.widget.disposed.connect(this.dispose,this);this._editorToAdapter=new WeakMap;this.editorAdded.connect(this._onEditorAdded,this);this.editorRemoved.connect(this._onEditorRemoved,this);this._connectionManager.languageServerManager.sessionsChanged.connect(this._onLspSessionOrFeatureChanged,this);this.options.featureManager.featureRegistered.connect(this._onLspSessionOrFeatureChanged,this)}get isDisposed(){return this._isDisposed}get hasMultipleEditors(){return this.editors.length>1}get widgetId(){return this.widget.id}get language(){if(c.hasOwnProperty(this.mimeType)){return c[this.mimeType]}else{let e=this.mimeType.split(";")[0];let[t,n]=e.split("/");if(t==="application"||t==="text"){if(n.startsWith("x-")){return n.substring(2)}else{return n}}else{return this.mimeType}}}get adapterConnected(){return this._adapterConnected}get activeEditorChanged(){return this._activeEditorChanged}get disposed(){return this._disposed}get editorAdded(){return this._editorAdded}get editorRemoved(){return this._editorRemoved}get isConnected(){return this._isConnected}get connectionManager(){return this._connectionManager}get trans(){return this._trans}get updateFinished(){return this._updateFinished}get virtualDocument(){return this._virtualDocument}onConnectionClosed(e,{virtualDocument:t}){if(t===this.virtualDocument){this.dispose()}}dispose(){if(this._isDisposed){return}this.editorAdded.disconnect(this._onEditorAdded,this);this.editorRemoved.disconnect(this._onEditorRemoved,this);this._connectionManager.languageServerManager.sessionsChanged.disconnect(this._onLspSessionOrFeatureChanged,this);this.options.featureManager.featureRegistered.disconnect(this._onLspSessionOrFeatureChanged,this);this._isDisposed=true;this.disconnect();this._virtualDocument=null;this._disposed.emit();a.Signal.clearData(this)}disconnect(){var e,t;const n=(e=this.virtualDocument)===null||e===void 0?void 0:e.uri;const{model:i}=this.widget.context;if(n){this.connectionManager.unregisterDocument(n)}i.contentChanged.disconnect(this._onContentChanged,this);for(let{ceEditor:s}of this.editors){this._editorRemoved.emit({editor:s})}(t=this.virtualDocument)===null||t===void 0?void 0:t.dispose()}updateDocuments(){if(this._isDisposed){console.warn("Cannot update documents: adapter disposed");return Promise.reject("Cannot update documents: adapter disposed")}return this.virtualDocument.updateManager.updateDocuments(this.editors)}documentChanged(e,t,n=false){if(this._isDisposed){console.warn("Cannot swap document: adapter disposed");return}let i=this.connectionManager.connections.get(e.uri);if(!(i===null||i===void 0?void 0:i.isReady)){console.log("Skipping document update signal: connection not ready");return}i.sendFullTextChange(e.value,e.documentInfo)}reloadConnection(){if(this.virtualDocument===null){return}this.disconnect();this.initVirtual();this.connectDocument(this.virtualDocument,true).catch(console.warn)}onSaveState(e,t){if(this.virtualDocument===null){return}if(t==="completed"){const e=[this.virtualDocument];for(let t of e){let n=this.connectionManager.connections.get(t.uri);if(!n){continue}n.sendSaved(t.documentInfo);for(let i of t.foreignDocuments.values()){e.push(i)}}}}async onConnected(e){let{virtualDocument:t}=e;this._adapterConnected.emit(e);this._isConnected=true;try{await this.updateDocuments()}catch(n){console.warn("Could not update documents",n);return}this.documentChanged(t,t,true);e.connection.serverNotifications["$/logTrace"].connect(((n,i)=>{console.log(e.connection.serverIdentifier,"trace",t.uri,i)}));e.connection.serverNotifications["window/logMessage"].connect(((e,t)=>{console.log(e.serverIdentifier+": "+t.message)}));e.connection.serverNotifications["window/showMessage"].connect(((e,t)=>{void(0,o.showDialog)({title:this.trans.__("Message from ")+e.serverIdentifier,body:t.message})}));e.connection.serverRequests["window/showMessageRequest"].setHandler((async t=>{const n=t.actions;const i=n?n.map((e=>d({label:e.title}))):[d({label:this.trans.__("Dismiss")})];const s=await(0,o.showDialog)({title:this.trans.__("Message from ")+e.connection.serverIdentifier,body:t.message,buttons:i});const r=i.indexOf(s.button);if(r===-1){return null}if(n){return n[r]}return null}))}async connectDocument(e,t=false){e.foreignDocumentOpened.connect(this.onForeignDocumentOpened,this);const n=await this._connect(e).catch(console.error);if(n&&n.connection){e.changed.connect(this.documentChanged,this);if(t){n.connection.sendOpenWhenReady(e.documentInfo)}}}initVirtual(){var e;(e=this._virtualDocument)===null||e===void 0?void 0:e.dispose();this._virtualDocument=this.createVirtualDocument();this._onLspSessionOrFeatureChanged()}async onForeignDocumentOpened(e,t){const{foreignDocument:n}=t;await this.connectDocument(n,true);n.foreignDocumentClosed.connect(this._onForeignDocumentClosed,this)}_onEditorAdded(e,t){const{editor:n}=t;const i=new l({editor:n,widgetAdapter:this,extensions:this.options.featureManager.extensionFactories()});this._editorToAdapter.set(n,i)}_onEditorRemoved(e,t){const{editor:n}=t;const i=this._editorToAdapter.get(n);i===null||i===void 0?void 0:i.dispose();this._editorToAdapter.delete(n)}_onForeignDocumentClosed(e,t){const{foreignDocument:n}=t;n.foreignDocumentClosed.disconnect(this._onForeignDocumentClosed,this);n.foreignDocumentOpened.disconnect(this.onForeignDocumentOpened,this);n.changed.disconnect(this.documentChanged,this)}async _connect(e){let t=e.language;let n={textDocument:{synchronization:{dynamicRegistration:true,willSave:false,didSave:true,willSaveWaitUntil:false}},workspace:{didChangeConfiguration:{dynamicRegistration:true}}};n=s()(n,this.options.featureManager.clientCapabilities());let i={capabilities:n,virtualDocument:e,language:t,hasLspSupportedFile:e.hasLspSupportedFile};let o=await this.connectionManager.connect(i);if(o){await this.onConnected({virtualDocument:e,connection:o});return{connection:o,virtualDocument:e}}else{return undefined}}async _onContentChanged(e){const t=this.updateDocuments();if(!t){console.warn("Could not update documents");return}this._updateFinished=t.catch(console.warn);await this.updateFinished}_shouldUpdateVirtualDocument(){const{languageServerManager:e}=this.connectionManager;return e.isEnabled&&this.options.featureManager.features.length>0}_onLspSessionOrFeatureChanged(){if(!this._virtualDocument){return}const{model:e}=this.widget.context;if(this._shouldUpdateVirtualDocument()){e.contentChanged.connect(this._onContentChanged,this)}else{e.contentChanged.disconnect(this._onContentChanged,this)}}}var u=n(44185);class p{constructor(e){this._isDisposed=false;this._current=null;this._adapters=new Set;this._adapterAdded=new a.Signal(this);this._adapterUpdated=new a.Signal(this);this._currentChanged=new a.Signal(this);const t=this._shell=e.shell;t.currentChanged.connect(((e,t)=>{let n=t.newValue;if(!n||!(n instanceof u.DocumentWidget)){return}const i=this.find((e=>e.widget===n));if(!i){return}this._current=i;this._currentChanged.emit(i)}))}get currentChanged(){return this._currentChanged}get currentAdapter(){return this._current}get size(){return this._adapters.size}get adapterAdded(){return this._adapterAdded}get adapterUpdated(){return this._adapterUpdated}add(e){if(e.isDisposed){const t="A disposed object cannot be added.";console.warn(t,e);throw new Error(t)}if(this._adapters.has(e)){const t="This object already exists in the pool.";console.warn(t,e);throw new Error(t)}this._adapters.add(e);this._adapterAdded.emit(e);e.disposed.connect((()=>{this._adapters.delete(e);if(e===this._current){this._current=null;this._currentChanged.emit(this._current)}}),this);const t=this._shell.activeWidget;if(!t||!(t instanceof u.DocumentWidget)){this._current=e;this._currentChanged.emit(e)}}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._adapters.clear();a.Signal.clearData(this)}find(e){const t=this._adapters.values();for(const n of t){if(e(n)){return n}}return undefined}forEach(e){this._adapters.forEach(e)}filter(e){const t=[];this.forEach((n=>{if(e(n)){t.push(n)}}));return t}has(e){return this._adapters.has(e)}}var m=n(37737);var g=n(5592);var f;(function(e){e.URL_NS="lsp"})(f||(f={}));const v=new g.Token("@jupyterlab/lsp:ILSPDocumentConnectionManager","Provides the virtual documents and language server connections service.");const _=new g.Token("@jupyterlab/lsp:ILSPFeatureManager","Provides the language server feature manager. This token is required to register new client capabilities.");const b=new g.Token("@jupyterlab/lsp:ILSPCodeExtractorsManager","Provides the code extractor manager. This token is required in your extension to register code extractor allowing the creation of multiple virtual document from an opened document.");const y=new g.Token("@jupyterlab/lsp:IWidgetLSPAdapterTracker","Provides the WidgetLSPAdapter tracker. This token is required in your extension to track WidgetLSPAdapters.");var w;(function(e){let t;(function(e){e["PUBLISH_DIAGNOSTICS"]="textDocument/publishDiagnostics";e["SHOW_MESSAGE"]="window/showMessage";e["LOG_TRACE"]="$/logTrace";e["LOG_MESSAGE"]="window/logMessage"})(t=e.ServerNotification||(e.ServerNotification={}));let n;(function(e){e["DID_CHANGE"]="textDocument/didChange";e["DID_CHANGE_CONFIGURATION"]="workspace/didChangeConfiguration";e["DID_OPEN"]="textDocument/didOpen";e["DID_SAVE"]="textDocument/didSave";e["INITIALIZED"]="initialized";e["SET_TRACE"]="$/setTrace"})(n=e.ClientNotification||(e.ClientNotification={}));let i;(function(e){e["REGISTER_CAPABILITY"]="client/registerCapability";e["SHOW_MESSAGE_REQUEST"]="window/showMessageRequest";e["UNREGISTER_CAPABILITY"]="client/unregisterCapability";e["WORKSPACE_CONFIGURATION"]="workspace/configuration"})(i=e.ServerRequest||(e.ServerRequest={}));let s;(function(e){e["CODE_ACTION"]="textDocument/codeAction";e["COMPLETION"]="textDocument/completion";e["COMPLETION_ITEM_RESOLVE"]="completionItem/resolve";e["DEFINITION"]="textDocument/definition";e["DOCUMENT_COLOR"]="textDocument/documentColor";e["DOCUMENT_HIGHLIGHT"]="textDocument/documentHighlight";e["DOCUMENT_SYMBOL"]="textDocument/documentSymbol";e["HOVER"]="textDocument/hover";e["IMPLEMENTATION"]="textDocument/implementation";e["INITIALIZE"]="initialize";e["REFERENCES"]="textDocument/references";e["RENAME"]="textDocument/rename";e["SIGNATURE_HELP"]="textDocument/signatureHelp";e["TYPE_DEFINITION"]="textDocument/typeDefinition";e["LINKED_EDITING_RANGE"]="textDocument/linkedEditingRange";e["INLINE_VALUE"]="textDocument/inlineValue";e["INLAY_HINT"]="textDocument/inlayHint";e["WORKSPACE_SYMBOL"]="workspace/symbol";e["WORKSPACE_SYMBOL_RESOLVE"]="workspaceSymbol/resolve";e["FORMATTING"]="textDocument/formatting";e["RANGE_FORMATTING"]="textDocument/rangeFormatting"})(s=e.ClientRequest||(e.ClientRequest={}))})(w||(w={}));async function C(e){return new Promise((t=>{setTimeout((()=>{t()}),e)}))}function x(e,t=35,n=50,i=e=>e){return(async()=>{let s=0;while(e()!==true){s+=1;if(t!==-1&&s>t){throw Error("Too many retrials")}n=i(n);await C(n)}return e})()}function S(e){const t=[];for(let n in e){const i=k(n.split("."),e[n]);t.push(i)}return s()({},...t)}const k=(e,t)=>{const n=Object.create(null);let i=n;e.forEach(((n,s)=>{i[n]=Object.create(null);if(s===e.length-1){i[n]=t}else{i=i[n]}}));return n};class j extends Map{constructor(e,t){super(t);this.defaultFactory=e}get(e){return this.getOrCreate(e)}getOrCreate(e,...t){if(this.has(e)){return super.get(e)}else{let n=this.defaultFactory(e,...t);this.set(e,n);return n}}}function I(e,t){const n=JSON.parse(JSON.stringify(e));const{method:i,registerOptions:s}=t;const o=i.substring(13)+"Provider";if(o){if(!s){n[o]=true}else{n[o]=JSON.parse(JSON.stringify(s))}}else{console.warn("Could not register server capability.",t);return null}return n}function E(e,t){const n=JSON.parse(JSON.stringify(e));const{method:i}=t;const s=i.substring(13)+"Provider";delete n[s];return n}var T=n(96092);class M{constructor(e){this.openedUris=new Map;this._isConnected=false;this._isInitialized=false;this._disposables=[];this._disposed=new a.Signal(this);this._isDisposed=false;this._rootUri=e.rootUri}get isConnected(){return this._isConnected}get isInitialized(){return this._isInitialized}get isReady(){return this._isConnected&&this._isInitialized}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}connect(e){this.socket=e;(0,T.listen)({webSocket:this.socket,logger:new T.ConsoleLogger,onConnection:e=>{e.listen();this._isConnected=true;this.connection=e;this.sendInitialize();const t=this.connection.onRequest("client/registerCapability",(e=>{e.registrations.forEach((e=>{try{this.serverCapabilities=I(this.serverCapabilities,e)}catch(t){console.error(t)}}))}));this._disposables.push(t);const n=this.connection.onRequest("client/unregisterCapability",(e=>{e.unregisterations.forEach((e=>{this.serverCapabilities=E(this.serverCapabilities,e)}))}));this._disposables.push(n);const i=this.connection.onClose((()=>{this._isConnected=false}));this._disposables.push(i)}})}close(){if(this.connection){this.connection.dispose()}this.openedUris.clear();this.socket.close()}sendInitialize(){if(!this._isConnected){return}this.openedUris.clear();const e=this.initializeParams();this.connection.sendRequest("initialize",e).then((e=>{this.onServerInitialized(e)}),(e=>{console.warn("LSP websocket connection initialization failure",e)}))}sendOpen(e){const t={textDocument:{uri:e.uri,languageId:e.languageId,text:e.text,version:e.version}};this.connection.sendNotification("textDocument/didOpen",t).catch(console.error);this.openedUris.set(e.uri,true);this.sendChange(e)}sendChange(e){if(!this.isReady){return}if(!this.openedUris.get(e.uri)){this.sendOpen(e);return}const t={textDocument:{uri:e.uri,version:e.version},contentChanges:[{text:e.text}]};this.connection.sendNotification("textDocument/didChange",t).catch(console.error);e.version++}sendSaved(e){if(!this.isReady){return}const t={textDocument:{uri:e.uri,version:e.version},text:e.text};this.connection.sendNotification("textDocument/didSave",t).catch(console.error)}sendConfigurationChange(e){if(!this.isReady){return}this.connection.sendNotification("workspace/didChangeConfiguration",e).catch(console.error)}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._disposables.forEach((e=>{e.dispose()}));this._disposed.emit();a.Signal.clearData(this)}onServerInitialized(e){this._isInitialized=true;this.serverCapabilities=e.capabilities;this.connection.sendNotification("initialized",{}).catch(console.error);this.connection.sendNotification("workspace/didChangeConfiguration",{settings:{}}).catch(console.error)}initializeParams(){return{capabilities:{},processId:null,rootUri:this._rootUri,workspaceFolders:null}}}class D{constructor(e,t,n){this.connection=e;this.method=t;this.emitter=n}request(e){this.emitter.log(R.clientRequested,{method:this.method,message:e});return this.connection.sendRequest(this.method,e).then((t=>{this.emitter.log(R.resultForClient,{method:this.method,message:e});return t}))}}class A{constructor(e,t,n){this.connection=e;this.method=t;this.emitter=n;this.connection.onRequest(t,this._handle.bind(this));this._handler=null}setHandler(e){this._handler=e}clearHandler(){this._handler=null}_handle(e){this.emitter.log(R.serverRequested,{method:this.method,message:e});if(!this._handler){return new Promise((()=>undefined))}return this._handler(e,this.emitter).then((e=>{this.emitter.log(R.responseForServer,{method:this.method,message:e});return e}))}}const P={TEXT_DOCUMENT_SYNC:"textDocumentSync",COMPLETION:"completionProvider",HOVER:"hoverProvider",SIGNATURE_HELP:"signatureHelpProvider",DECLARATION:"declarationProvider",DEFINITION:"definitionProvider",TYPE_DEFINITION:"typeDefinitionProvider",IMPLEMENTATION:"implementationProvider",REFERENCES:"referencesProvider",DOCUMENT_HIGHLIGHT:"documentHighlightProvider",DOCUMENT_SYMBOL:"documentSymbolProvider",CODE_ACTION:"codeActionProvider",CODE_LENS:"codeLensProvider",DOCUMENT_LINK:"documentLinkProvider",COLOR:"colorProvider",DOCUMENT_FORMATTING:"documentFormattingProvider",DOCUMENT_RANGE_FORMATTING:"documentRangeFormattingProvider",DOCUMENT_ON_TYPE_FORMATTING:"documentOnTypeFormattingProvider",RENAME:"renameProvider",FOLDING_RANGE:"foldingRangeProvider",EXECUTE_COMMAND:"executeCommandProvider",SELECTION_RANGE:"selectionRangeProvider",WORKSPACE_SYMBOL:"workspaceSymbolProvider",WORKSPACE:"workspace"};function L(e,t){const n={};for(let i of Object.values(e)){n[i]=t(i)}return n}var R;(function(e){e[e["clientNotifiedServer"]=0]="clientNotifiedServer";e[e["serverNotifiedClient"]=1]="serverNotifiedClient";e[e["serverRequested"]=2]="serverRequested";e[e["clientRequested"]=3]="clientRequested";e[e["resultForClient"]=4]="resultForClient";e[e["responseForServer"]=5]="responseForServer"})(R||(R={}));class N extends M{constructor(e){super(e);this._closingManually=false;this._closeSignal=new a.Signal(this);this._errorSignal=new a.Signal(this);this._serverInitialized=new a.Signal(this);this._options=e;this.logAllCommunication=false;this.serverIdentifier=e.serverIdentifier;this.serverLanguage=e.languageId;this.documentsToOpen=[];this.clientNotifications=this.constructNotificationHandlers(w.ClientNotification);this.serverNotifications=this.constructNotificationHandlers(w.ServerNotification)}get closeSignal(){return this._closeSignal}get errorSignal(){return this._errorSignal}get serverInitialized(){return this._serverInitialized}dispose(){if(this.isDisposed){return}if(this.serverRequests){Object.values(this.serverRequests).forEach((e=>e.clearHandler()))}this.close();super.dispose()}log(e,t){if(this.logAllCommunication){console.log(e,t)}}sendOpenWhenReady(e){if(this.isReady){this.sendOpen(e)}else{this.documentsToOpen.push(e)}}sendSelectiveChange(e,t){this._sendChange([e],t)}sendFullTextChange(e,t){this._sendChange([{text:e}],t)}provides(e){return!!(this.serverCapabilities&&this.serverCapabilities[e])}close(){try{this._closingManually=true;super.close()}catch(e){this._closingManually=false}}connect(e){super.connect(e);x((()=>this.isConnected),-1).then((()=>{const e=this.connection.onClose((()=>{this._isConnected=false;this._closeSignal.emit(this._closingManually)}));this._disposables.push(e)})).catch((()=>{console.error("Could not connect onClose signal")}))}async getCompletionResolve(e){if(!this.isReady){return}return this.connection.sendRequest("completionItem/resolve",e)}constructNotificationHandlers(e){const t=()=>new a.Signal(this);return L(e,t)}constructClientRequestHandler(e){return L(e,(e=>new D(this.connection,e,this)))}constructServerRequestHandler(e){return L(e,(e=>new A(this.connection,e,this)))}initializeParams(){return{...super.initializeParams(),capabilities:this._options.capabilities,initializationOptions:null,processId:null,workspaceFolders:null}}onServerInitialized(e){this.afterInitialized();super.onServerInitialized(e);while(this.documentsToOpen.length){this.sendOpen(this.documentsToOpen.pop())}this._serverInitialized.emit(this.serverCapabilities)}afterInitialized(){const e=this.connection.onError((e=>this._errorSignal.emit(e)));this._disposables.push(e);for(const t of Object.values(w.ServerNotification)){const e=this.serverNotifications[t];const n=this.connection.onNotification(t,(n=>{this.log(R.serverNotifiedClient,{method:t,message:n});e.emit(n)}));this._disposables.push(n)}for(const t of Object.values(w.ClientNotification)){const e=this.clientNotifications[t];e.connect(((e,n)=>{this.log(R.clientNotifiedServer,{method:t,message:n});this.connection.sendNotification(t,n).catch(console.error)}))}this.clientRequests=this.constructClientRequestHandler(w.ClientRequest);this.serverRequests=this.constructServerRequestHandler(w.ServerRequest);this.serverRequests["client/registerCapability"].setHandler((async e=>{e.registrations.forEach((e=>{try{const t=I(this.serverCapabilities,e);if(t===null){console.error(`Failed to register server capability: ${e}`);return}this.serverCapabilities=t}catch(t){console.error(t)}}))}));this.serverRequests["client/unregisterCapability"].setHandler((async e=>{e.unregisterations.forEach((e=>{this.serverCapabilities=E(this.serverCapabilities,e)}))}));this.serverRequests["workspace/configuration"].setHandler((async e=>e.items.map((e=>null))))}_sendChange(e,t){if(!this.isReady){return}if(t.uri.length===0){return}if(!this.openedUris.get(t.uri)){this.sendOpen(t)}const n={textDocument:{uri:t.uri,version:t.version},contentChanges:e};this.connection.sendNotification("textDocument/didChange",n).catch(console.error);t.version++}}class O{constructor(e){this.onNewConnection=e=>{const t=(t,n)=>{console.error(n);let i=n.length&&n.length>=1?n[0]:new Error;if(i.message.indexOf("code = 1005")!==-1){console.error(`Connection failed for ${e}`);this._forEachDocumentOfConnection(e,(t=>{console.error("disconnecting "+t.uri);this._closed.emit({connection:e,virtualDocument:t});this._ignoredLanguages.add(t.language);console.error(`Cancelling further attempts to connect ${t.uri} and other documents for this language (no support from the server)`)}))}else if(i.message.indexOf("code = 1006")!==-1){console.error("Connection closed by the server")}else{console.error("Connection error:",n)}};e.errorSignal.connect(t);const n=()=>{this._forEachDocumentOfConnection(e,(t=>{this._initialized.emit({connection:e,virtualDocument:t})}));this.updateServerConfigurations(this.initialConfigurations)};e.serverInitialized.connect(n);const i=(t,n)=>{if(!n){console.error("Connection unexpectedly disconnected")}else{console.log("Connection closed");this._forEachDocumentOfConnection(e,(t=>{this._closed.emit({connection:e,virtualDocument:t})}))}};e.closeSignal.connect(i)};this._initialized=new a.Signal(this);this._connected=new a.Signal(this);this._disconnected=new a.Signal(this);this._closed=new a.Signal(this);this._documentsChanged=new a.Signal(this);this.connections=new Map;this.documents=new Map;this.adapters=new Map;this._ignoredLanguages=new Set;this.languageServerManager=e.languageServerManager;B.setLanguageServerManager(e.languageServerManager);e.adapterTracker.adapterAdded.connect(((e,t)=>{const n=t.widget.context.path;this.registerAdapter(n,t)}))}get initialized(){return this._initialized}get connected(){return this._connected}get disconnected(){return this._disconnected}get closed(){return this._closed}get documentsChanged(){return this._documentsChanged}get ready(){return B.getLanguageServerManager().ready}connectDocumentSignals(e){e.foreignDocumentOpened.connect(this.onForeignDocumentOpened,this);e.foreignDocumentClosed.connect(this.onForeignDocumentClosed,this);this.documents.set(e.uri,e);this._documentsChanged.emit(this.documents)}disconnectDocumentSignals(e,t=true){e.foreignDocumentOpened.disconnect(this.onForeignDocumentOpened,this);e.foreignDocumentClosed.disconnect(this.onForeignDocumentClosed,this);this.documents.delete(e.uri);for(const n of e.foreignDocuments.values()){this.disconnectDocumentSignals(n,false)}if(t){this._documentsChanged.emit(this.documents)}}onForeignDocumentOpened(e,t){}onForeignDocumentClosed(e,t){const{foreignDocument:n}=t;this.unregisterDocument(n.uri,false);this.disconnectDocumentSignals(n)}registerAdapter(e,t){this.adapters.set(e,t);t.widget.context.pathChanged.connect(((n,i)=>{this.adapters.delete(e);this.adapters.set(i,t)}));t.disposed.connect((()=>{if(t.virtualDocument){this.documents.delete(t.virtualDocument.uri)}this.adapters.delete(e)}))}updateConfiguration(e){this.languageServerManager.setConfiguration(e)}updateServerConfigurations(e){let t;for(t in e){if(!e.hasOwnProperty(t)){continue}const n=e[t];const i=S(n.configuration||{});const s={settings:i};B.updateServerConfiguration(t,s)}}async retryToConnect(e,t,n=-1){let{virtualDocument:i}=e;if(this._ignoredLanguages.has(i.language)){return}let s=t*1e3;let o=false;while(n!==0&&!o){await this.connect(e).then((()=>{o=true})).catch((e=>{console.warn(e)}));console.log("will attempt to re-connect in "+s/1e3+" seconds");await C(s);s=s<5*1e3?s+500:s}}disconnect(e){B.disconnect(e)}async connect(e,t=30,n=5){let i=await this._connectSocket(e);let{virtualDocument:s}=e;if(!i){return}if(!i.isReady){try{await x((()=>i.isReady),Math.round(t*1e3/150),150)}catch(o){console.log(`Connection to ${s.uri} timed out after ${t} seconds, will continue retrying for another ${n} minutes`);try{await x((()=>i.isReady),60*n,1e3)}catch(r){console.log(`Connection to ${s.uri} timed out again after ${n} minutes, giving up`);return}}}this._connected.emit({connection:i,virtualDocument:s});return i}unregisterDocument(e,t=true){const n=this.connections.get(e);if(n){this.connections.delete(e);const i=new Set(this.connections.values());if(!i.has(n)){this.disconnect(n.serverIdentifier);n.dispose()}if(t){this._documentsChanged.emit(this.documents)}}}updateLogging(e,t){for(const n of this.connections.values()){n.logAllCommunication=e;if(t!==null){n.clientNotifications["$/setTrace"].emit({value:t})}}}async _connectSocket(e){let{language:t,capabilities:n,virtualDocument:i}=e;this.connectDocumentSignals(i);const s=O.solveUris(i,t);const o=this.languageServerManager.getMatchingServers({language:t});const r=o.length===0?null:o[0];if(!s){return}const a=await B.connection(t,r,s,this.onNewConnection,n);this.connections.set(i.uri,a);return a}_forEachDocumentOfConnection(e,t){for(const[n,i]of this.connections.entries()){if(e!==i){continue}t(this.documents.get(n))}}}(function(e){function t(e,t){var n;const i=B.getLanguageServerManager();const s=i.settings.wsUrl;const o=m.PageConfig.getOption("rootUri");const r=m.PageConfig.getOption("virtualDocumentsUri");const a={language:t};const l=i.getMatchingServers(a);const d=l.length===0?null:l[0];if(d===null){return}const c=i.getMatchingSpecs(a);const h=c.get(d);if(!h){console.warn(`Specification not available for server ${d}`)}const u=(n=h===null||h===void 0?void 0:h.requires_documents_on_disk)!==null&&n!==void 0?n:true;const p=!u;const g=e.hasLspSupportedFile||p?o:r;let f=m.URLExt.join(g,e.uri);if(!f.startsWith("file:///")&&f.startsWith("file://")){f=f.replace("file://","file:///");if(f.startsWith("file:///users/")&&g.startsWith("file:///Users/")){f=f.replace("file:///users/","file:///Users/")}}return{base:g,document:f,server:m.URLExt.join("ws://jupyter-lsp",t),socket:m.URLExt.join(s,"lsp","ws",d)}}e.solveUris=t})(O||(O={}));var B;(function(e){const t=new Map;let n;function i(){return n}e.getLanguageServerManager=i;function s(e){n=e}e.setLanguageServerManager=s;function o(e){const n=t.get(e);if(n){n.close();t.delete(e)}}e.disconnect=o;async function r(n,i,s,o,r){let a=t.get(i);if(!a){const{settings:a}=e.getLanguageServerManager();const l=new a.WebSocket(s.socket);const d=new N({languageId:n,serverUri:s.server,rootUri:s.base,serverIdentifier:i,capabilities:r});t.set(i,d);d.connect(l);o(d)}a=t.get(i);return a}e.connection=r;function a(e,n){const i=t.get(e);if(i){i.sendConfigurationChange(n)}}e.updateServerConfiguration=a})(B||(B={}));class F{constructor(){this._extractorMap=new Map;this._extractorMapAnyLanguage=new Map}getExtractors(e,t){var n,i;if(t){const i=this._extractorMap.get(e);if(!i){return[]}return(n=i.get(t))!==null&&n!==void 0?n:[]}else{return(i=this._extractorMapAnyLanguage.get(e))!==null&&i!==void 0?i:[]}}register(e,t){const n=e.cellType;if(t){n.forEach((n=>{if(!this._extractorMap.has(n)){this._extractorMap.set(n,new Map)}const i=this._extractorMap.get(n);const s=i.get(t);if(!s){i.set(t,[e])}else{s.push(e)}}))}else{n.forEach((t=>{if(!this._extractorMapAnyLanguage.has(t)){this._extractorMapAnyLanguage.set(t,[])}this._extractorMapAnyLanguage.get(t).push(e)}))}}}function z(e,t){return t&&e.line===t.line&&e.ch===t.ch}function H(e,t){let n=0;let i=0;for(let s of t){if(s.length+1<=e){e-=s.length+1;n+=1}else{i=e;break}}return{line:n,column:i}}function W(e,t,n=false){let i=n?0:1;let s=0;for(let o=0;oo){s+=n.length+i}else{s+=e.column;break}}return s}var V;(function(e){function t(e,t){const{line:n,character:i}=e;return n>=t.start.line&&n<=t.end.line&&(n!=t.start.line||i>t.start.character)&&(n!=t.end.line||i<=t.end.character)}e.isWithinRange=t})(V||(V={}));class U{constructor(e){this.language=e.language;this.standalone=e.isStandalone;this.fileExtension=e.file_extension;this.cellType=e.cellType}hasForeignCode(e,t){return this.cellType.includes(t)}extractForeignCode(e){let t=e.split("\n");let n=new Array;let i=e;let s=H(0,t);let o=H(i.length,t);n.push({hostCode:"",foreignCode:i,range:{start:s,end:o},virtualShift:null});return n}}class q{constructor(){this.features=[];this._featureRegistered=new a.Signal(this)}get featureRegistered(){return this._featureRegistered}register(e){if(this.features.some((t=>t.id===e.id))){console.warn(`Feature with id ${e.id} is already registered, skipping.`)}else{this.features.push(e);this._featureRegistered.emit(e)}}clientCapabilities(){let e={};for(const t of this.features){if(!t.capabilities){continue}e=s()(e,t.capabilities)}return e}extensionFactories(){const e=[];for(const t of this.features){if(!t.extensionFactory){continue}e.push(t.extensionFactory)}return e}}var $=n(77256);class K{constructor(e){this._sessions=new Map;this._specs=new Map;this._warningsEmitted=new Set;this._ready=new g.PromiseDelegate;this._sessionsChanged=new a.Signal(this);this._isDisposed=false;this._enabled=true;this._settings=e.settings||$.ServerConnection.makeSettings();this._baseUrl=e.baseUrl||m.PageConfig.getBaseUrl();this._retries=e.retries||2;this._retriesInterval=e.retriesInterval||1e4;this._statusCode=-1;this._configuration={};this.fetchSessions().catch((e=>console.log(e)))}get isEnabled(){return this._enabled}get isDisposed(){return this._isDisposed}get settings(){return this._settings}get specs(){return this._specs}get statusUrl(){return m.URLExt.join(this._baseUrl,f.URL_NS,"status")}get sessionsChanged(){return this._sessionsChanged}get sessions(){return this._sessions}get ready(){return this._ready.promise}get statusCode(){return this._statusCode}async enable(){this._enabled=true;await this.fetchSessions()}disable(){this._enabled=false;this._sessions=new Map;this._sessionsChanged.emit(void 0)}dispose(){if(this._isDisposed){return}this._isDisposed=true;a.Signal.clearData(this)}setConfiguration(e){this._configuration=e}getMatchingServers(e){if(!e.language){console.error("Cannot match server by language: language not available; ensure that kernel and specs provide language and MIME type");return[]}const t=[];for(const[n,i]of this._sessions.entries()){if(this.isMatchingSpec(e,i.spec)){t.push(n)}}return t.sort(this.compareRanks.bind(this))}getMatchingSpecs(e){const t=new Map;for(const[n,i]of this._specs.entries()){if(this.isMatchingSpec(e,i)){t.set(n,i)}}return t}async fetchSessions(){if(!this._enabled){return}let e=await $.ServerConnection.makeRequest(this.statusUrl,{method:"GET"},this._settings);this._statusCode=e.status;if(!e.ok){if(this._retries>0){this._retries-=1;setTimeout(this.fetchSessions.bind(this),this._retriesInterval)}else{this._ready.resolve(undefined);console.log("Missing jupyter_lsp server extension, skipping.")}return}let t;try{const n=await e.json();t=n.sessions;try{this.version=n.version;this._specs=new Map(Object.entries(n.specs))}catch(i){console.warn(i)}}catch(i){console.warn(i);this._ready.resolve(undefined);return}for(let s of Object.keys(t)){let e=s;if(this._sessions.has(e)){Object.assign(this._sessions.get(e)||{},t[s])}else{this._sessions.set(e,t[s])}}const n=this._sessions.keys();for(const s in n){if(!t[s]){let e=s;this._sessions.delete(e)}}this._sessionsChanged.emit(void 0);this._ready.resolve(undefined)}isMatchingSpec(e,t){const n=e.language.toLocaleLowerCase();return t.languages.some((e=>e.toLocaleLowerCase()==n))}warnOnce(e){if(!this._warningsEmitted.has(e)){this._warningsEmitted.add(e);console.warn(e)}}compareRanks(e,t){var n,i,s,o;const r=50;const a=(i=(n=this._configuration[e])===null||n===void 0?void 0:n.rank)!==null&&i!==void 0?i:r;const l=(o=(s=this._configuration[t])===null||s===void 0?void 0:s.rank)!==null&&o!==void 0?o:r;if(a==l){this.warnOnce(`Two matching servers: ${e} and ${t} have the same rank; choose which one to use by changing the rank in Advanced Settings Editor`);return e.localeCompare(t)}return l-a}}function J(e,t){if(t.start.line===t.end.line){return e.line===t.start.line&&e.column>=t.start.column&&e.column<=t.end.column}return e.line===t.start.line&&e.column>=t.start.column&&e.linet.start.line&&e.column<=t.end.column&&e.line===t.end.line||e.line>t.start.line&&e.linenew Array));this._remainingLifetime=6;this.documentInfo=new G(this);this.updateManager=new Q(this);this.updateManager.updateBegan.connect(this._updateBeganSlot,this);this.updateManager.blockAdded.connect(this._blockAddedSlot,this);this.updateManager.updateFinished.connect(this._updateFinishedSlot,this);this.clear()}static ceToCm(e){return{line:e.line,ch:e.column}}get isDisposed(){return this._isDisposed}get foreignDocumentClosed(){return this._foreignDocumentClosed}get foreignDocumentOpened(){return this._foreignDocumentOpened}get changed(){return this._changed}get virtualId(){return this.standalone?this.instanceId+"("+this.language+")":this.language}get ancestry(){if(!this.parent){return[this]}return this.parent.ancestry.concat([this])}get idPath(){if(!this.parent){return this.virtualId}return this.parent.idPath+"-"+this.virtualId}get uri(){const e=encodeURI(this.path);if(!this.parent){return e}return e+"."+this.idPath+"."+this.fileExtension}get value(){let e="\n".repeat(this.blankLinesBetweenCells);return this.lineBlocks.join(e)}get lastLine(){const e=this.lineBlocks[this.lineBlocks.length-1].split("\n");return e[e.length-1]}get root(){return this.parent?this.parent.root:this}dispose(){if(this._isDisposed){return}this._isDisposed=true;this.parent=null;this.closeAllForeignDocuments();this.updateManager.dispose();this.foreignDocuments.clear();this.sourceLines.clear();this.unusedStandaloneDocuments.clear();this.virtualLines.clear();this.documentInfo=null;this.lineBlocks=null;a.Signal.clearData(this)}clear(){this.unusedStandaloneDocuments.clear();for(let e of this.foreignDocuments.values()){e.clear();if(e.standalone){let t=this.unusedStandaloneDocuments.get(e.language);t.push(e)}}this.virtualLines.clear();this.sourceLines.clear();this.lastVirtualLine=0;this.lastSourceLine=0;this.lineBlocks=[]}documentAtSourcePosition(e){let t=this.sourceLines.get(e.line);if(!t){return this}let n={line:t.editorLine,column:e.ch};for(let[i,{virtualDocument:s}]of t.foreignDocumentsMap){if(J(n,i)){let e={line:n.line-i.start.line,ch:n.column-i.start.column};return s.documentAtSourcePosition(e)}}return this}isWithinForeign(e){let t=this.sourceLines.get(e.line);let n={line:t.editorLine,column:e.ch};for(let[i]of t.foreignDocumentsMap){if(J(n,i)){return true}}return false}transformFromEditorToRoot(e,t){if(!this._editorToSourceLine.has(e)){console.log("Editor not found in _editorToSourceLine map");return null}let n=this._editorToSourceLine.get(e);return{...t,line:t.line+n}}virtualPositionAtDocument(e){let t=this.sourceLines.get(e.line);if(t==null){throw new Error("Source line not mapped to virtual position")}let n=t.virtualLine;let i={line:t.editorLine,column:e.ch};for(let[s,o]of t.foreignDocumentsMap){const{virtualLine:e,virtualDocument:t}=o;if(J(i,s)){let n={line:i.line-s.start.line,ch:i.column-s.start.column};if(t.isWithinForeign(n)){return this.virtualPositionAtDocument(n)}else{n.line+=e;return n}}}return{ch:e.ch,line:n}}appendCodeBlock(e,t={line:0,column:0},n){let i=e.value;let s=e.ceEditor;if(this.isDisposed){console.warn("Cannot append code block: document disposed");return}let o=i.split("\n");let{lines:r,foreignDocumentsMap:a}=this.prepareCodeBlock(e,t);for(let l=0;l!e.has(t))));for(let s of i.values()){s.remainingLifetime-=1;if(s.remainingLifetime<=0){s.dispose();const e=t.get(s);for(const t of e){this.foreignDocuments.delete(t)}}}}transformSourceToEditor(e){let t=this.sourceLines.get(e.line);let n=t.editorLine;let i=t.editorShift;return{ch:e.ch+(n===0?i.column:0),line:n+i.line}}transformVirtualToEditor(e){let t=this.transformVirtualToSource(e);if(t==null){return null}return this.transformSourceToEditor(t)}transformVirtualToSource(e){const t=this.virtualLines.get(e.line).sourceLine;if(t==null){return null}return{ch:e.ch,line:t}}transformVirtualToRoot(e){var t;const n=(t=this.virtualLines.get(e.line))===null||t===void 0?void 0:t.editor;const i=this.transformVirtualToEditor(e);if(!n||!i){return null}return this.root.transformFromEditorToRoot(n,i)}getEditorAtVirtualLine(e){let t=e.line;if(!this.virtualLines.has(t)){t-=1}return this.virtualLines.get(t).editor}getEditorAtSourceLine(e){return this.sourceLines.get(e.line).editor}maybeEmitChanged(){if(this.value!==this.previousValue){this._changed.emit(this)}this.previousValue=this.value;for(let e of this.foreignDocuments.values()){e.maybeEmitChanged()}}get remainingLifetime(){if(!this.parent){return Infinity}return this._remainingLifetime}set remainingLifetime(e){if(this.parent){this._remainingLifetime=e}}_chooseForeignDocument(e){let t;let n=this.foreignDocuments.has(e.language);if(!e.standalone&&n){t=this.foreignDocuments.get(e.language)}else{let n=this.unusedStandaloneDocuments.get(e.language);if(e.standalone&&n.length>0){t=n.pop()}else{t=this.openForeign(e.language,e.standalone,e.fileExtension)}}return t}openForeign(e,t,n){let i=new this.constructor({...this.options,parent:this,standalone:t,fileExtension:n,language:e});const s={foreignDocument:i,parentHost:this};this._foreignDocumentOpened.emit(s);i.foreignDocumentClosed.connect(this.forwardClosedSignal,this);i.foreignDocumentOpened.connect(this.forwardOpenedSignal,this);this.foreignDocuments.set(i.virtualId,i);return i}forwardClosedSignal(e,t){this._foreignDocumentClosed.emit(t)}forwardOpenedSignal(e,t){this._foreignDocumentOpened.emit(t)}_updateBeganSlot(){this._editorToSourceLineNew=new Map}_blockAddedSlot(e,t){this._editorToSourceLineNew.set(t.block.ceEditor,t.virtualDocument.lastSourceLine)}_updateFinishedSlot(){this._editorToSourceLine=this._editorToSourceLineNew}}Y.instancesCount=0;function X(e){let t=new Set;t.add(e);for(let n of e.foreignDocuments.values()){let e=X(n);e.forEach(t.add,t)}return t}class Q{constructor(e){this.virtualDocument=e;this._isDisposed=false;this._updateDone=new Promise((e=>{e()}));this._isUpdateInProgress=false;this._updateLock=false;this._blockAdded=new a.Signal(this);this._documentUpdated=new a.Signal(this);this._updateBegan=new a.Signal(this);this._updateFinished=new a.Signal(this);this.documentUpdated.connect(this._onUpdated,this)}get updateDone(){return this._updateDone}get isDisposed(){return this._isDisposed}get blockAdded(){return this._blockAdded}get documentUpdated(){return this._documentUpdated}get updateBegan(){return this._updateBegan}get updateFinished(){return this._updateFinished}dispose(){if(this._isDisposed){return}this._isDisposed=true;this.documentUpdated.disconnect(this._onUpdated);a.Signal.clearData(this)}async withUpdateLock(e){await x((()=>this._canUpdate()),12,10).then((()=>{try{this._updateLock=true;e()}finally{this._updateLock=false}}))}async updateDocuments(e){let t=new Promise(((t,n)=>{x((()=>this._canUpdate()),10,5).then((()=>{if(this.isDisposed||!this.virtualDocument){t()}try{this._isUpdateInProgress=true;this._updateBegan.emit(e);this.virtualDocument.clear();for(let t of e){this._blockAdded.emit({block:t,virtualDocument:this.virtualDocument});this.virtualDocument.appendCodeBlock(t)}this._updateFinished.emit(e);if(this.virtualDocument){this._documentUpdated.emit(this.virtualDocument);this.virtualDocument.maybeEmitChanged()}t()}catch(i){console.warn("Documents update failed:",i);n(i)}finally{this._isUpdateInProgress=false}})).catch(console.error)}));this._updateDone=t;return t}_onUpdated(e,t){try{t.closeExpiredDocuments()}catch(n){console.warn("Failed to close expired documents")}}_canUpdate(){return!this.isDisposed&&!this._isUpdateInProgress&&!this._updateLock}}},13137:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(17325);var r=n(23359);var a=n(79010)},72825:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CommandIDs:()=>w,default:()=>M});var i=n(74991);var s=n(72050);var o=n(37737);var r=n(56759);var a=n(77256);var l=n(15615);var d=n(61927);var c=n(66127);var h=n(34236);var u=n(5592);var p=n(1143);var m=n(65189);var g=n(45231);const f="@jupyterlab/mainmenu-extension:recents";var v;(function(e){e.openRecent="recentmenu:open-recent";e.reopenLast="recentmenu:reopen-last";e.clearRecents="docmanager:clear-recents"})(v||(v={}));class _ extends p.Menu{constructor(e){super(e);this._manager=e.manager;this._showDirectories=e.showDirectories;this.updateItems();this._manager.changed.connect(this.updateItems,this)}async _validateRecentlyOpened(){return void Promise.all(this._manager.recentlyOpened.map((e=>this._manager.validate(e))))}onBeforeAttach(e){const t=new u.PromiseDelegate;setTimeout((()=>{t.reject("Recents validation timed out.")}),550);Promise.race([t.promise,this._validateRecentlyOpened()]).then((()=>{this.update()})).catch((()=>{}));super.onBeforeAttach(e)}updateItems(){this.clearItems();this.addItem({command:v.reopenLast});this.addItem({type:"separator"});let e=true;let t=false;this._manager.recentlyOpened.sort(((e,t)=>{if(e.contentType===t.contentType){return 0}else{return e.contentType!=="directory"?1:-1}})).forEach((n=>{const i=n.contentType==="directory";if(i){if(!this._showDirectories){return}t=true}else if(e&&t){e=false;this.addItem({type:"separator"})}this.addItem({command:v.openRecent,args:{recent:n}})}));this.addItem({type:"separator"});this.addItem({command:v.clearRecents})}}const b={id:f,description:"Adds sub-menu for opening recent documents to the File section of the main menu.",autoStart:true,requires:[m.IRecentsManager,r.IMainMenu],optional:[g.IFileBrowserCommands,d.ITranslator],activate:(e,t,n,i,r)=>{const{commands:a}=e;const l=(r!==null&&r!==void 0?r:d.nullTranslator).load("jupyterlab");const c=i!==null;const h=async e=>{const n=await t.validate(e);if(!n){await(0,s.showErrorMessage)(l.__("Could Not Open Recent"),l.__("%1 is no longer valid and will be removed from the list",e.path))}return n};a.addCommand(v.openRecent,{execute:async e=>{const t=e.recent;const n=t.path===""?"/":t.path;const s=await h(t);if(!s){return}if(i&&t.contentType==="directory"){await a.execute(i.openPath,{path:n})}else{await a.execute("docmanager:open",{path:n,factory:t.factory})}},label:e=>{const t=e.recent;if(t){return o.PathExt.joinWithLeadingSlash(t.root,t.path)}else{return l.__("Open a Recent Document (given by `recent` argument)")}},isEnabled:e=>t.recentlyOpened.includes(e.recent)});e.commands.addCommand(v.reopenLast,{execute:async()=>{const e=t.recentlyClosed[0];if(!e){return}const n=await h(e);if(!n){return}await a.execute("docmanager:open",{path:e.path,factory:e.factory});t.removeRecent(e,"closed")},label:()=>{const e=t.recentlyClosed[0];return e?l.__("Reopen %1",e.path):l.__("Reopen Closed Document")},isEnabled:()=>t.recentlyClosed.length!==0,caption:l.__("Reopen recently closed file or notebook.")});const u=new _({commands:a,manager:t,showDirectories:c});u.title.label=l.__("Open Recent");n.fileMenu.addItem({type:"submenu",submenu:u,rank:1})}};const y="@jupyterlab/mainmenu-extension:plugin";var w;(function(e){e.openEdit="editmenu:open";e.undo="editmenu:undo";e.redo="editmenu:redo";e.clearCurrent="editmenu:clear-current";e.clearAll="editmenu:clear-all";e.find="editmenu:find";e.goToLine="editmenu:go-to-line";e.openFile="filemenu:open";e.closeAndCleanup="filemenu:close-and-cleanup";e.createConsole="filemenu:create-console";e.shutdown="filemenu:shutdown";e.logout="filemenu:logout";e.openKernel="kernelmenu:open";e.interruptKernel="kernelmenu:interrupt";e.reconnectToKernel="kernelmenu:reconnect-to-kernel";e.restartKernel="kernelmenu:restart";e.restartKernelAndClear="kernelmenu:restart-and-clear";e.changeKernel="kernelmenu:change";e.shutdownKernel="kernelmenu:shutdown";e.shutdownAllKernels="kernelmenu:shutdownAll";e.openView="viewmenu:open";e.wordWrap="viewmenu:word-wrap";e.lineNumbering="viewmenu:line-numbering";e.matchBrackets="viewmenu:match-brackets";e.openRun="runmenu:open";e.run="runmenu:run";e.runAll="runmenu:run-all";e.restartAndRunAll="runmenu:restart-and-run-all";e.runAbove="runmenu:run-above";e.runBelow="runmenu:run-below";e.openTabs="tabsmenu:open";e.activateById="tabsmenu:activate-by-id";e.activatePreviouslyUsedTab="tabsmenu:activate-previously-used-tab";e.openSettings="settingsmenu:open";e.openHelp="helpmenu:open";e.getKernel="helpmenu:get-kernel";e.openFirst="mainmenu:open-first"})(w||(w={}));const C={id:y,description:"Adds and provides the application main menu.",requires:[i.IRouter,d.ITranslator],optional:[s.ICommandPalette,i.ILabShell,l.ISettingRegistry],provides:r.IMainMenu,activate:async(e,t,n,i,s,a)=>{const{commands:l}=e;const d=n.load("jupyterlab");const c=new r.MainMenu(l);c.id="jp-MainMenu";c.addClass("jp-scrollbar-tiny");if(a){await D.loadSettingsMenu(a,(e=>{c.addMenu(e,false,{rank:e.rank})}),(e=>r.MainMenu.generateMenu(l,e,d)),n);c.update()}const h=o.PageConfig.getOption("quitButton").toLowerCase();c.fileMenu.quitEntry=h==="true";x(e,c.editMenu,d);S(e,c.fileMenu,t,d);k(e,c.kernelMenu,d);I(e,c.runMenu,d);j(e,c.viewMenu,d);T(e,c.helpMenu,d);if(s){E(e,c.tabsMenu,s,d)}const u=e=>{c.activeMenu=e;c.openActiveMenu()};l.addCommand(w.openEdit,{label:d.__("Open Edit Menu"),execute:()=>u(c.editMenu)});l.addCommand(w.openFile,{label:d.__("Open File Menu"),execute:()=>u(c.fileMenu)});l.addCommand(w.openKernel,{label:d.__("Open Kernel Menu"),execute:()=>u(c.kernelMenu)});l.addCommand(w.openRun,{label:d.__("Open Run Menu"),execute:()=>u(c.runMenu)});l.addCommand(w.openView,{label:d.__("Open View Menu"),execute:()=>u(c.viewMenu)});l.addCommand(w.openSettings,{label:d.__("Open Settings Menu"),execute:()=>u(c.settingsMenu)});l.addCommand(w.openTabs,{label:d.__("Open Tabs Menu"),execute:()=>u(c.tabsMenu)});l.addCommand(w.openHelp,{label:d.__("Open Help Menu"),execute:()=>u(c.helpMenu)});l.addCommand(w.openFirst,{label:d.__("Open First Menu"),execute:()=>{c.activeIndex=0;c.openActiveMenu()}});if(i){i.addItem({command:w.shutdown,category:d.__("Main Area")});i.addItem({command:w.logout,category:d.__("Main Area")});i.addItem({command:w.shutdownAllKernels,category:d.__("Kernel Operations")});i.addItem({command:w.activatePreviouslyUsedTab,category:d.__("Main Area")})}e.shell.add(c,"menu",{rank:100});return c}};function x(e,t,n){const{commands:s,shell:o}=e;(0,i.addSemanticCommand)({id:w.undo,commands:s,shell:o,semanticCommands:t.undoers.undo,default:{label:n.__("Undo")},trans:n});(0,i.addSemanticCommand)({id:w.redo,commands:s,shell:o,semanticCommands:t.undoers.redo,default:{label:n.__("Redo")},trans:n});(0,i.addSemanticCommand)({id:w.clearCurrent,commands:s,shell:o,semanticCommands:t.clearers.clearCurrent,default:{label:n.__("Clear")},trans:n});(0,i.addSemanticCommand)({id:w.clearAll,commands:s,shell:o,semanticCommands:t.clearers.clearAll,default:{label:n.__("Clear All")},trans:n});(0,i.addSemanticCommand)({id:w.goToLine,commands:s,shell:o,semanticCommands:t.goToLiners,default:{label:n.__("Go to Line…")},trans:n})}function S(e,t,n,r){const{commands:l,shell:d}=e;(0,i.addSemanticCommand)({id:w.closeAndCleanup,commands:l,shell:d,semanticCommands:t.closeAndCleaners,default:{execute:"application:close",label:r.__("Close and Shut Down"),isEnabled:true},overrides:{isEnabled:()=>!!e.shell.currentWidget&&!!e.shell.currentWidget.title.closable},trans:r});(0,i.addSemanticCommand)({id:w.createConsole,commands:l,shell:d,semanticCommands:t.consoleCreators,default:{label:r.__("New Console for Activity")},trans:r});l.addCommand(w.shutdown,{label:r.__("Shut Down"),caption:r.__("Shut down %1",e.name),isVisible:()=>t.quitEntry,isEnabled:()=>t.quitEntry,execute:()=>(0,s.showDialog)({title:r.__("Shutdown confirmation"),body:r.__("Please confirm you want to shut down %1.",e.name),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:r.__("Shut Down")})]}).then((async t=>{if(t.button.accept){const t=a.ServerConnection.makeSettings();const i=o.URLExt.join(t.baseUrl,"api/shutdown");try{await Promise.all([e.serviceManager.sessions.shutdownAll(),e.serviceManager.terminals.shutdownAll()])}catch(n){console.log(`Failed to shutdown sessions and terminals: ${n}`)}return a.ServerConnection.makeRequest(i,{method:"POST"},t).then((t=>{if(t.ok){const t=document.createElement("div");const n=document.createElement("p");n.textContent=r.__("You have shut down the Jupyter server. You can now close this tab.");const i=document.createElement("p");i.textContent=r.__("To use %1 again, you will need to relaunch it.",e.name);t.appendChild(n);t.appendChild(i);void(0,s.showDialog)({title:r.__("Server stopped"),body:new p.Widget({node:t}),buttons:[]});window.close()}else{throw new a.ServerConnection.ResponseError(t)}})).catch((e=>{throw new a.ServerConnection.NetworkError(e)}))}}))});l.addCommand(w.logout,{label:r.__("Log Out"),caption:r.__("Log out of %1",e.name),isVisible:()=>t.quitEntry,isEnabled:()=>t.quitEntry,execute:()=>{n.navigate("/logout",{hard:true})}})}function k(e,t,n){const{commands:o,shell:r}=e;(0,i.addSemanticCommand)({id:w.interruptKernel,commands:o,shell:r,semanticCommands:t.kernelUsers.interruptKernel,default:{label:n.__("Interrupt Kernel"),caption:n.__("Interrupt the kernel")},overrides:{icon:e=>e.toolbar?c.stopIcon:undefined},trans:n});(0,i.addSemanticCommand)({id:w.reconnectToKernel,commands:o,shell:r,semanticCommands:t.kernelUsers.reconnectToKernel,default:{label:n.__("Reconnect to Kernel")},trans:n});(0,i.addSemanticCommand)({id:w.restartKernel,commands:o,shell:r,semanticCommands:t.kernelUsers.restartKernel,default:{label:n.__("Restart Kernel…"),caption:n.__("Restart the kernel")},overrides:{icon:e=>e.toolbar?c.refreshIcon:undefined},trans:n});(0,i.addSemanticCommand)({id:w.restartKernelAndClear,commands:o,shell:r,semanticCommands:[t.kernelUsers.restartKernel,t.kernelUsers.clearWidget],default:{label:n.__("Restart Kernel and Clear…")},trans:n});(0,i.addSemanticCommand)({id:w.changeKernel,commands:o,shell:r,semanticCommands:t.kernelUsers.changeKernel,default:{label:n.__("Change Kernel…")},trans:n});(0,i.addSemanticCommand)({id:w.shutdownKernel,commands:o,shell:r,semanticCommands:t.kernelUsers.shutdownKernel,default:{label:n.__("Shut Down Kernel"),caption:n.__("Shut down kernel")},trans:n});o.addCommand(w.shutdownAllKernels,{label:n.__("Shut Down All Kernels…"),isEnabled:()=>!e.serviceManager.sessions.running().next().done,execute:()=>(0,s.showDialog)({title:n.__("Shut Down All?"),body:n._n("Are you sure you want to permanently shut down the running kernel?","Are you sure you want to permanently shut down the %1 running kernels?",e.serviceManager.kernels.runningCount),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:n.__("Shut Down All")})]}).then((t=>{if(t.button.accept){return e.serviceManager.sessions.shutdownAll()}}))})}function j(e,t,n){const{commands:s,shell:o}=e;(0,i.addSemanticCommand)({id:w.lineNumbering,commands:s,shell:o,semanticCommands:t.editorViewers.toggleLineNumbers,default:{label:n.__("Show Line Numbers")},trans:n});(0,i.addSemanticCommand)({id:w.matchBrackets,commands:s,shell:o,semanticCommands:t.editorViewers.toggleMatchBrackets,default:{label:n.__("Match Brackets")},trans:n});(0,i.addSemanticCommand)({id:w.wordWrap,commands:s,shell:o,semanticCommands:t.editorViewers.toggleWordWrap,default:{label:n.__("Wrap Words")},trans:n})}function I(e,t,n){const{commands:s,shell:o}=e;(0,i.addSemanticCommand)({id:w.run,commands:s,shell:o,semanticCommands:t.codeRunners.run,default:{label:n.__("Run Selected"),caption:n.__("Run Selected")},overrides:{icon:e=>e.toolbar?c.runIcon:undefined},trans:n});(0,i.addSemanticCommand)({id:w.runAll,commands:s,shell:o,semanticCommands:t.codeRunners.runAll,default:{label:n.__("Run All"),caption:n.__("Run All")},trans:n});(0,i.addSemanticCommand)({id:w.restartAndRunAll,commands:s,shell:o,semanticCommands:[t.codeRunners.restart,t.codeRunners.runAll],default:{label:n.__("Restart Kernel and Run All"),caption:n.__("Restart Kernel and Run All")},overrides:{icon:e=>e.toolbar?c.fastForwardIcon:undefined},trans:n})}function E(e,t,n,i){const s=e.commands;const o=[];let r;s.addCommand(w.activateById,{label:t=>{if(t.id===undefined){return i.__("Activate a widget by its `id`.")}const n=t["id"]||"";const s=(0,h.find)(e.shell.widgets("main"),(e=>e.id===n));return s&&s.title.label||""},isToggled:t=>{const n=t["id"]||"";return!!e.shell.currentWidget&&e.shell.currentWidget.id===n},execute:t=>e.shell.activateById(t["id"]||"")});let a="";s.addCommand(w.activatePreviouslyUsedTab,{label:i.__("Activate Previously Used Tab"),isEnabled:()=>!!a,execute:()=>s.execute(w.activateById,{id:a})});if(n){void e.restored.then((()=>{const i=()=>{if(r&&!r.isDisposed){r.dispose()}o.length=0;let n=false;for(const t of e.shell.widgets("main")){if(t.id===a){n=true}o.push({command:w.activateById,args:{id:t.id}})}r=t.addGroup(o,1);a=n?a:""};i();n.layoutModified.connect((()=>{i()}));n.currentChanged.connect(((e,t)=>{const n=t.oldValue;if(!n){return}a=n.id}))}))}}function T(e,t,n){const{commands:s,shell:o}=e;(0,i.addSemanticCommand)({id:w.getKernel,commands:s,shell:o,semanticCommands:t.getKernel,default:{label:n.__("Get Kernel"),isVisible:false},trans:n})}const M=[C,b];var D;(function(e){async function t(e){const t=await(0,s.showDialog)({title:e.__("Information"),body:e.__("Menu customization has changed. You will need to reload JupyterLab to see the changes."),buttons:[s.Dialog.cancelButton(),s.Dialog.okButton({label:e.__("Reload")})]});if(t.button.accept){location.reload()}}async function n(e,n,i,o){var r;const a=o.load("jupyterlab");let d=null;let c={};function h(t){var n,i;c={};const s=Object.keys(e.plugins).map((t=>{var n,i;const s=(i=(n=e.plugins[t].schema["jupyter.lab.menus"])===null||n===void 0?void 0:n.main)!==null&&i!==void 0?i:[];c[t]=s;return s})).concat([(i=(n=t["jupyter.lab.menus"])===null||n===void 0?void 0:n.main)!==null&&i!==void 0?i:[]]).reduceRight(((e,t)=>l.SettingRegistry.reconcileMenus(e,t,true)),t.properties.menus.default);t.properties.menus.default=l.SettingRegistry.reconcileMenus(s,t.properties.menus.default,true).sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Infinity)-((i=t.rank)!==null&&i!==void 0?i:Infinity)}))}e.transform(y,{compose:e=>{var t,n,i,s;if(!d){d=u.JSONExt.deepCopy(e.schema);h(d)}const o=(i=(n=(t=d.properties)===null||t===void 0?void 0:t.menus)===null||n===void 0?void 0:n.default)!==null&&i!==void 0?i:[];const r={...e.data.user,menus:(s=e.data.user.menus)!==null&&s!==void 0?s:[]};const a={...e.data.composite,menus:l.SettingRegistry.reconcileMenus(o,r.menus)};e.data={composite:a,user:r};return e},fetch:e=>{if(!d){d=u.JSONExt.deepCopy(e.schema);h(d)}return{data:e.data,id:e.id,raw:e.raw,schema:d,version:e.version}}});const p=await e.load(y);const m=(r=u.JSONExt.deepCopy(p.composite.menus))!==null&&r!==void 0?r:[];const g=new Array;s.MenuFactory.createMenus(m.filter((e=>!e.disabled)).map((e=>{var t;return{...e,items:l.SettingRegistry.filterDisabledItems((t=e.items)!==null&&t!==void 0?t:[])}})),i).forEach((e=>{g.push(e);n(e)}));p.changed.connect((()=>{var e;const n=(e=p.composite.menus)!==null&&e!==void 0?e:[];if(!u.JSONExt.deepEqual(m,n)){void t(a)}}));e.pluginChanged.connect((async(o,r)=>{var d,h,p;if(r!==y){const o=(d=c[r])!==null&&d!==void 0?d:[];const f=(p=(h=e.plugins[r].schema["jupyter.lab.menus"])===null||h===void 0?void 0:h.main)!==null&&p!==void 0?p:[];if(!u.JSONExt.deepEqual(o,f)){if(c[r]){await t(a)}else{c[r]=u.JSONExt.deepCopy(f);const e=l.SettingRegistry.reconcileMenus(f,m,false,false).filter((e=>!e.disabled)).map((e=>{var t;return{...e,items:l.SettingRegistry.filterDisabledItems((t=e.items)!==null&&t!==void 0?t:[])}}));s.MenuFactory.updateMenus(g,e,i).forEach((e=>{n(e)}))}}}}))}e.loadSettingsMenu=n})(D||(D={}))},61132:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(3579);var a=n(41603);var l=n(39063);var d=n(67996)},43744:(e,t,n)=>{"use strict";n.r(t);n.d(t,{EditMenu:()=>a,FileMenu:()=>l,HelpMenu:()=>d,IMainMenu:()=>_,KernelMenu:()=>c,MainMenu:()=>g,RunMenu:()=>h,SettingsMenu:()=>u,TabsMenu:()=>p,ViewMenu:()=>m});var i=n(66127);var s=n(34236);var o=n(1143);var r=n(72050);class a extends i.RankedMenu{constructor(e){super(e);this.undoers={redo:new r.SemanticCommand,undo:new r.SemanticCommand};this.clearers={clearAll:new r.SemanticCommand,clearCurrent:new r.SemanticCommand};this.goToLiners=new r.SemanticCommand}}class l extends i.RankedMenu{constructor(e){super(e);this.quitEntry=false;this.closeAndCleaners=new r.SemanticCommand;this.consoleCreators=new r.SemanticCommand}get newMenu(){var e,t;if(!this._newMenu){this._newMenu=(t=(e=(0,s.find)(this.items,(e=>{var t;return((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-mainmenu-file-new"})))===null||e===void 0?void 0:e.submenu)!==null&&t!==void 0?t:new i.RankedMenu({commands:this.commands})}return this._newMenu}dispose(){var e;(e=this._newMenu)===null||e===void 0?void 0:e.dispose();super.dispose()}}class d extends i.RankedMenu{constructor(e){super(e);this.getKernel=new r.SemanticCommand}}class c extends i.RankedMenu{constructor(e){super(e);this.kernelUsers={changeKernel:new r.SemanticCommand,clearWidget:new r.SemanticCommand,interruptKernel:new r.SemanticCommand,reconnectToKernel:new r.SemanticCommand,restartKernel:new r.SemanticCommand,shutdownKernel:new r.SemanticCommand}}}class h extends i.RankedMenu{constructor(e){super(e);this.codeRunners={restart:new r.SemanticCommand,run:new r.SemanticCommand,runAll:new r.SemanticCommand}}}class u extends i.RankedMenu{constructor(e){super(e)}}class p extends i.RankedMenu{constructor(e){super(e)}}class m extends i.RankedMenu{constructor(e){super(e);this.editorViewers={toggleLineNumbers:new r.SemanticCommand,toggleMatchBrackets:new r.SemanticCommand,toggleWordWrap:new r.SemanticCommand}}}class g extends o.MenuBar{constructor(e){let t={forceItemsPosition:{forceX:false,forceY:true}};super(t);this._items=[];this._commands=e}get editMenu(){if(!this._editMenu){this._editMenu=new a({commands:this._commands,rank:2,renderer:i.MenuSvg.defaultRenderer})}return this._editMenu}get fileMenu(){if(!this._fileMenu){this._fileMenu=new l({commands:this._commands,rank:1,renderer:i.MenuSvg.defaultRenderer})}return this._fileMenu}get helpMenu(){if(!this._helpMenu){this._helpMenu=new d({commands:this._commands,rank:1e3,renderer:i.MenuSvg.defaultRenderer})}return this._helpMenu}get kernelMenu(){if(!this._kernelMenu){this._kernelMenu=new c({commands:this._commands,rank:5,renderer:i.MenuSvg.defaultRenderer})}return this._kernelMenu}get runMenu(){if(!this._runMenu){this._runMenu=new h({commands:this._commands,rank:4,renderer:i.MenuSvg.defaultRenderer})}return this._runMenu}get settingsMenu(){if(!this._settingsMenu){this._settingsMenu=new u({commands:this._commands,rank:999,renderer:i.MenuSvg.defaultRenderer})}return this._settingsMenu}get viewMenu(){if(!this._viewMenu){this._viewMenu=new m({commands:this._commands,rank:3,renderer:i.MenuSvg.defaultRenderer})}return this._viewMenu}get tabsMenu(){if(!this._tabsMenu){this._tabsMenu=new p({commands:this._commands,rank:500,renderer:i.MenuSvg.defaultRenderer})}return this._tabsMenu}addMenu(e,t=true,n={}){if(s.ArrayExt.firstIndexOf(this.menus,e)>-1){return}i.MenuSvg.overrideDefaultRenderer(e);const o="rank"in n?n.rank:"rank"in e?e.rank:i.IRankedMenu.DEFAULT_RANK;const r={menu:e,rank:o};const g=s.ArrayExt.upperBound(this._items,r,f.itemCmp);e.disposed.connect(this._onMenuDisposed,this);s.ArrayExt.insert(this._items,g,r);this.insertMenu(g,e);switch(e.id){case"jp-mainmenu-file":if(!this._fileMenu&&e instanceof l){this._fileMenu=e}break;case"jp-mainmenu-edit":if(!this._editMenu&&e instanceof a){this._editMenu=e}break;case"jp-mainmenu-view":if(!this._viewMenu&&e instanceof m){this._viewMenu=e}break;case"jp-mainmenu-run":if(!this._runMenu&&e instanceof h){this._runMenu=e}break;case"jp-mainmenu-kernel":if(!this._kernelMenu&&e instanceof c){this._kernelMenu=e}break;case"jp-mainmenu-tabs":if(!this._tabsMenu&&e instanceof p){this._tabsMenu=e}break;case"jp-mainmenu-settings":if(!this._settingsMenu&&e instanceof u){this._settingsMenu=e}break;case"jp-mainmenu-help":if(!this._helpMenu&&e instanceof d){this._helpMenu=e}break}}dispose(){var e,t,n,i,s,o,r,a;(e=this._editMenu)===null||e===void 0?void 0:e.dispose();(t=this._fileMenu)===null||t===void 0?void 0:t.dispose();(n=this._helpMenu)===null||n===void 0?void 0:n.dispose();(i=this._kernelMenu)===null||i===void 0?void 0:i.dispose();(s=this._runMenu)===null||s===void 0?void 0:s.dispose();(o=this._settingsMenu)===null||o===void 0?void 0:o.dispose();(r=this._viewMenu)===null||r===void 0?void 0:r.dispose();(a=this._tabsMenu)===null||a===void 0?void 0:a.dispose();super.dispose()}static generateMenu(e,t,n){let s;const{id:o,label:r,rank:g}=t;switch(o){case"jp-mainmenu-file":s=new l({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-edit":s=new a({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-view":s=new m({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-run":s=new h({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-kernel":s=new c({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-tabs":s=new p({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-settings":s=new u({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;case"jp-mainmenu-help":s=new d({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer});break;default:s=new i.RankedMenu({commands:e,rank:g,renderer:i.MenuSvg.defaultRenderer})}if(r){s.title.label=n._p("menu",r)}return s}_onMenuDisposed(e){this.removeMenu(e);const t=s.ArrayExt.findFirstIndex(this._items,(t=>t.menu===e));if(t!==-1){s.ArrayExt.removeAt(this._items,t)}}}var f;(function(e){function t(e,t){return e.rank-t.rank}e.itemCmp=t})(f||(f={}));var v=n(5592);const _=new v.Token("@jupyterlab/mainmenu:IMainMenu",`A service for the main menu bar for the application.\n Use this if you want to add your own menu items or provide implementations for standardized menu items for specific activities.`)},67996:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913)},69195:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>x});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(37737);var l=n.n(a);var d=n(91053);var c=n.n(d);var h=n(90943);var u=n.n(h);var p=n(15615);var m=n.n(p);var g=n(10553);var f=n.n(g);var v=n(61927);var _=n.n(v);var b;(function(e){e.markdownPreview="markdownviewer:open";e.markdownEditor="markdownviewer:edit"})(b||(b={}));const y="Markdown Preview";const w={activate:C,id:"@jupyterlab/markdownviewer-extension:plugin",description:"Adds markdown file viewer and provides its tracker.",provides:d.IMarkdownViewerTracker,requires:[h.IRenderMimeRegistry,v.ITranslator],optional:[i.ILayoutRestorer,p.ISettingRegistry,g.ITableOfContentsRegistry,o.ISanitizer],autoStart:true};function C(e,t,n,i,s,r,l){const c=n.load("jupyterlab");const{commands:u,docRegistry:p}=e;t.addFactory(h.markdownRendererFactory);const m="markdownviewer-widget";const g=new o.WidgetTracker({namespace:m});let f={...d.MarkdownViewer.defaultConfig};function v(e){Object.keys(f).forEach((t=>{var n;e.setOption(t,(n=f[t])!==null&&n!==void 0?n:null)}))}if(s){const e=e=>{f=e.composite;g.forEach((e=>{v(e.content)}))};s.load(w.id).then((t=>{t.changed.connect((()=>{e(t)}));e(t)})).catch((e=>{console.error(e.message)}))}const _=new d.MarkdownViewerFactory({rendermime:t,name:y,label:c.__("Markdown Preview"),primaryFileType:p.getFileType("markdown"),fileTypes:["markdown"],defaultRendered:["markdown"]});_.widgetCreated.connect(((e,t)=>{t.context.pathChanged.connect((()=>{void g.save(t)}));v(t.content);void g.add(t)}));p.addWidgetFactory(_);if(i){void i.restore(g,{command:"docmanager:open",args:e=>({path:e.context.path,factory:y}),name:e=>e.context.path})}u.addCommand(b.markdownPreview,{label:c.__("Markdown Preview"),execute:e=>{const t=e["path"];if(typeof t!=="string"){return}return u.execute("docmanager:open",{path:t,factory:y,options:e["options"]})}});u.addCommand(b.markdownEditor,{execute:()=>{const e=g.currentWidget;if(!e){return}const t=e.context.path;return u.execute("docmanager:open",{path:t,factory:"Editor",options:{mode:"split-right"}})},isVisible:()=>{const e=g.currentWidget;return e&&a.PathExt.extname(e.context.path)===".md"||false},label:c.__("Show Markdown Editor")});if(r){r.add(new d.MarkdownViewerTableOfContentsFactory(g,t.markdownParser,l!==null&&l!==void 0?l:t.sanitizer))}return g}const x=w},57996:(e,t,n)=>{"use strict";var i=n(97913);var s=n(5893);var o=n(3579);var r=n(66731);var a=n(10395);var l=n(79010);var d=n(85072);var c=n.n(d);var h=n(97825);var u=n.n(h);var p=n(77659);var m=n.n(p);var g=n(55056);var f=n.n(g);var v=n(10540);var _=n.n(v);var b=n(41113);var y=n.n(b);var w=n(80877);var C={};C.styleTagTransform=y();C.setAttributes=f();C.insert=m().bind(null,"head");C.domAPI=u();C.insertStyleElement=_();var x=c()(w.A,C);const S=w.A&&w.A.locals?w.A.locals:undefined},34572:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IMarkdownViewerTracker:()=>a,MarkdownDocument:()=>_,MarkdownViewer:()=>v,MarkdownViewerFactory:()=>b,MarkdownViewerTableOfContentsFactory:()=>o,MarkdownViewerTableOfContentsModel:()=>s});var i=n(10553);class s extends i.TableOfContentsModel{constructor(e,t,n){super(e,n);this.parser=t}get documentType(){return"markdown-viewer"}get isAlwaysActive(){return true}get supportedOptions(){return["maximalDepth","numberingH1","numberHeaders"]}getHeadings(){const e=this.widget.context.model.toString();const t=i.TableOfContentsUtils.filterHeadings(i.TableOfContentsUtils.Markdown.getHeadings(e),{...this.configuration,baseNumbering:1});return Promise.resolve(t)}}class o extends i.TableOfContentsFactory{constructor(e,t,n){super(e);this.parser=t;this.sanitizer=n}_createNew(e,t){const n=new s(e,this.parser,t);let o=new WeakMap;const r=(t,n)=>{if(n){const t=o.get(n);if(t){const n=e.content.node.getBoundingClientRect();const i=t.getBoundingClientRect();if(i.top>n.bottom||i.bottom{if(!this.parser){return}i.TableOfContentsUtils.clearNumbering(e.content.node);o=new WeakMap;n.headings.forEach((async t=>{var n;const s=await i.TableOfContentsUtils.Markdown.getHeadingId(this.parser,t.raw,t.level,this.sanitizer);if(!s){return}const r=`h${t.level}[id="${CSS.escape(s)}"]`;o.set(t,i.TableOfContentsUtils.addPrefix(e.content.node,r,(n=t.prefix)!==null&&n!==void 0?n:""))}))};void e.content.ready.then((()=>{a();e.content.rendered.connect(a);n.activeHeadingChanged.connect(r);n.headingsChanged.connect(a);e.disposed.connect((()=>{e.content.rendered.disconnect(a);n.activeHeadingChanged.disconnect(r);n.headingsChanged.disconnect(a)}))}));return n}}var r=n(5592);const a=new r.Token("@jupyterlab/markdownviewer:IMarkdownViewerTracker",`A widget tracker for markdown\n document viewers. Use this if you want to iterate over and interact with rendered markdown documents.`);var l=n(72050);var d=n(37737);var c=n(44185);var h=n(90943);var u=n(61927);var p=n(2336);var m=n(1143);const g="jp-MarkdownViewer";const f="text/markdown";class v extends m.Widget{constructor(e){super();this._config={...v.defaultConfig};this._fragment="";this._ready=new r.PromiseDelegate;this._isRendering=false;this._renderRequested=false;this._rendered=new p.Signal(this);this.context=e.context;this.translator=e.translator||u.nullTranslator;this._trans=this.translator.load("jupyterlab");this.renderer=e.renderer;this.node.tabIndex=0;this.addClass(g);const t=this.layout=new m.StackedLayout;t.addWidget(this.renderer);void this.context.ready.then((async()=>{await this._render();this._monitor=new d.ActivityMonitor({signal:this.context.model.contentChanged,timeout:this._config.renderTimeout});this._monitor.activityStopped.connect(this.update,this);this._ready.resolve(undefined)}))}get ready(){return this._ready.promise}get rendered(){return this._rendered}setFragment(e){this._fragment=e;this.update()}setOption(e,t){if(this._config[e]===t){return}this._config[e]=t;const{style:n}=this.renderer.node;switch(e){case"fontFamily":n.setProperty("font-family",t);break;case"fontSize":n.setProperty("font-size",t?t+"px":null);break;case"hideFrontMatter":this.update();break;case"lineHeight":n.setProperty("line-height",t?t.toString():null);break;case"lineWidth":{const e=t?`calc(50% - ${t/2}ch)`:null;n.setProperty("padding-left",e);n.setProperty("padding-right",e);break}case"renderTimeout":if(this._monitor){this._monitor.timeout=t}break;default:break}}dispose(){if(this.isDisposed){return}if(this._monitor){this._monitor.dispose()}this._monitor=null;super.dispose()}onUpdateRequest(e){if(this.context.isReady&&!this.isDisposed){void this._render();this._fragment=""}}onActivateRequest(e){this.node.focus()}async _render(){if(this.isDisposed){return}if(this._isRendering){this._renderRequested=true;return}this._renderRequested=false;const{context:e}=this;const{model:t}=e;const n=t.toString();const i={};i[f]=this._config.hideFrontMatter?y.removeFrontMatter(n):n;const s=new h.MimeModel({data:i,metadata:{fragment:this._fragment}});try{this._isRendering=true;await this.renderer.renderModel(s);this._isRendering=false;if(this._renderRequested){return this._render()}else{this._rendered.emit()}}catch(o){requestAnimationFrame((()=>{this.dispose()}));void(0,l.showErrorMessage)(this._trans.__("Renderer Failure: %1",e.path),o)}}}(function(e){e.defaultConfig={fontFamily:null,fontSize:null,lineHeight:null,lineWidth:null,hideFrontMatter:true,renderTimeout:1e3}})(v||(v={}));class _ extends c.DocumentWidget{setFragment(e){this.content.setFragment(e)}}class b extends c.ABCWidgetFactory{constructor(e){super(y.createRegistryOptions(e));this._fileType=e.primaryFileType;this._rendermime=e.rendermime}createNewWidget(e){var t,n,i,s,o;const r=this._rendermime.clone({resolver:e.urlResolver});const a=r.createRenderer(f);const l=new v({context:e,renderer:a});l.title.icon=(t=this._fileType)===null||t===void 0?void 0:t.icon;l.title.iconClass=(i=(n=this._fileType)===null||n===void 0?void 0:n.iconClass)!==null&&i!==void 0?i:"";l.title.iconLabel=(o=(s=this._fileType)===null||s===void 0?void 0:s.iconLabel)!==null&&o!==void 0?o:"";l.title.caption=this.label;const d=new _({content:l,context:e});return d}}var y;(function(e){function t(e){return{...e,readOnly:true}}e.createRegistryOptions=t;function n(e){const t=/^---\n[^]*?\n(---|...)\n/;const n=e.match(t);if(!n){return e}const{length:i}=n[0];return e.slice(i)}e.removeFrontMatter=n})(y||(y={}))},55151:(e,t,n)=>{"use strict";n.r(t);n.d(t,{createMarkdownParser:()=>m,default:()=>f});var i=n(5592);var s=n.n(i);var o=n(37737);var r=n.n(o);var a=n(90567);var l=n.n(a);var d=n(90943);var c=n.n(d);var h=n(55115);var u=n.n(h);const p="```~~~";function m(e,t){return{render:n=>v.render(n,e,t)}}const g={id:"@jupyterlab/markedparser-extension:plugin",description:"Provides the Markdown parser.",autoStart:true,provides:d.IMarkdownParser,requires:[a.IEditorLanguageRegistry],optional:[h.IMermaidMarkdown],activate:(e,t,n)=>m(t,{blocks:n?[n]:[]})};const f=g;var v;(function(e){let t=null;let s=null;let r=[];let a=null;let l={};let d=new o.LruCache;async function c(e,t,n){a=t;if(!s){s=await h(n)}return s(e,l)}e.render=c;async function h(e){if(s){return s}if(t){return await t.promise}r=(e===null||e===void 0?void 0:e.blocks)||[];r=r.sort(((e,t)=>{var n,i;return((n=e.rank)!==null&&n!==void 0?n:Infinity)-((i=t.rank)!==null&&i!==void 0?i:Infinity)}));t=new i.PromiseDelegate;const[{marked:o,Renderer:a},d]=await Promise.all([n.e(4507).then(n.t.bind(n,14507,23)),u()]);for(const t of d){o.use(t)}l={async:true,gfm:true,walkTokens:f,renderer:m(a)};s=o;t.resolve(s);return s}e.initializeMarked=h;async function u(){return Promise.all([(async()=>(await n.e(8022).then(n.t.bind(n,18022,23))).gfmHeadingId())(),(async()=>(await n.e(3825).then(n.t.bind(n,3825,23))).mangle())()])}function m(e){const t=new e;const n=t.code;t.code=({text:e,lang:i,escaped:s})=>{for(const t of r){if(i&&t.languages.includes(i)){const n=t.render(e);if(n!=null){return n}}}const o=`${i}${p}${e}${p}`;const a=d.get(o);if(a!=null){return a}return n.call(t,{text:e,lang:i,escaped:s})};return t}async function g(e){const{lang:t,text:n}=e;if(!t||!a){return}const i=`${t}${p}${n}${p}`;if(d.get(i)){return}const s=document.createElement("div");try{await a.highlight(n,a.findBest(t),s);const e=`
${s.innerHTML}
`;d.set(i,e)}catch(o){console.error(`Failed to highlight ${t} code`,o)}finally{s.remove()}}async function f(e){switch(e.type){case"code":if(e.lang){for(const t of r){if(t.languages.includes(e.lang)){await t.walk(e.text);return}}}await g(e)}}})(v||(v={}))},41884:(e,t,n)=>{"use strict";var i=n(5893);var s=n(3579);var o=n(23359);var r=n(69240);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(23865);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},31217:(e,t,n)=>{"use strict";n.r(t);n.d(t,{MathJaxTypesetter:()=>l,default:()=>c});var i=n(5592);var s=n.n(i);var o=n(90943);var r=n.n(o);var a;(function(e){e.copy="mathjax:clipboard";e.scale="mathjax:scale"})(a||(a={}));class l{constructor(){this._initialized=false}async _ensureInitialized(){if(!this._initialized){this._mathDocument=await h.ensureMathDocument();this._initialized=true}}async mathDocument(){await this._ensureInitialized();return this._mathDocument}async typeset(e){try{await this._ensureInitialized()}catch(t){console.error(t);return}this._mathDocument.options.elements=[e];this._mathDocument.clear().render();delete this._mathDocument.options.elements}}const d={id:"@jupyterlab/mathjax-extension:plugin",description:"Provides the LaTeX mathematical expression interpreter.",provides:o.ILatexTypesetter,activate:e=>{const t=new l;e.commands.addCommand(a.copy,{execute:async()=>{const e=await t.mathDocument();const n=e.outputJax;await navigator.clipboard.writeText(n.math.math)},label:"MathJax Copy Latex"});e.commands.addCommand(a.scale,{execute:async e=>{const n=await t.mathDocument();const i=e["scale"]||1;n.outputJax.options.scale=i;n.rerender()},label:e=>"Mathjax Scale "+(e["scale"]?`x${e["scale"]}`:"Reset")});return t},autoStart:true};const c=d;var h;(function(e){let t=null;async function s(){if(!t){t=new i.PromiseDelegate;void Promise.all([n.e(2353),n.e(2633),n.e(8816)]).then(n.t.bind(n,58816,23));const[{mathjax:e},{CHTML:s},{TeX:o},{TeXFont:r},{AllPackages:a},{SafeHandler:l},{HTMLHandler:d},{browserAdaptor:c},{AssistiveMmlHandler:h}]=await Promise.all([n.e(1039).then(n.bind(n,81039)),Promise.all([n.e(2353),n.e(6275),n.e(1673),n.e(4090)]).then(n.t.bind(n,24090,23)),Promise.all([n.e(2353),n.e(2633),n.e(2707),n.e(4928)]).then(n.t.bind(n,4928,23)),Promise.all([n.e(1673),n.e(4981)]).then(n.t.bind(n,1673,23)),Promise.all([n.e(2353),n.e(2633),n.e(2707),n.e(1909)]).then(n.bind(n,31909)),n.e(5244).then(n.t.bind(n,75244,23)),Promise.all([n.e(2353),n.e(6275),n.e(4001),n.e(1969)]).then(n.t.bind(n,1969,23)),n.e(9400).then(n.bind(n,59400)),Promise.all([n.e(2353),n.e(6275),n.e(4001),n.e(4855)]).then(n.t.bind(n,34855,23))]);e.handlers.register(h(l(new d(c()))));class u extends r{}u.defaultFonts={};const p=new s({font:new u});const m=new o({packages:a.concat("require"),inlineMath:[["$","$"],["\\(","\\)"]],displayMath:[["$$","$$"],["\\[","\\]"]],processEscapes:true,processEnvironments:true});const g=e.document(window.document,{InputJax:m,OutputJax:p});t.resolve(g)}return t.promise}e.ensureMathDocument=s})(h||(h={}))},51874:(e,t,n)=>{"use strict";var i=n(5893);var s=n(3579);var o=n(85072);var r=n.n(o);var a=n(97825);var l=n.n(a);var d=n(77659);var c=n.n(d);var h=n(55056);var u=n.n(h);var p=n(10540);var m=n.n(p);var g=n(41113);var f=n.n(g);var v=n(25149);var _={};_.styleTagTransform=f();_.setAttributes=u();_.insert=c().bind(null,"head");_.domAPI=l();_.insertStyleElement=m();var b=r()(v.A,_);const y=v.A&&v.A.locals?v.A.locals:undefined},71579:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CommandIDs:()=>d,default:()=>p});var i=n(72050);var s=n.n(i);var o=n(55115);var r=n.n(o);var a=n(61927);var l=n.n(a);var d;(function(e){e.copySource="mermaid:copy-source"})(d||(d={}));const c={id:"@jupyterlab/mermaid-extension:core",description:"Provides the Mermaid manager.",autoStart:true,optional:[i.IThemeManager],provides:o.IMermaidManager,activate:(e,t)=>{const n=new o.MermaidManager({themes:t});o.RenderedMermaid.manager=n;return n}};const h={id:"@jupyterlab/mermaid-extension:markdown",description:"Provides the Mermaid markdown renderer.",autoStart:true,requires:[o.IMermaidManager],provides:o.IMermaidMarkdown,activate:(e,t)=>new o.MermaidMarkdown({mermaid:t})};const u={id:"@jupyterlab/mermaid-extension:context-commands",description:"Provides context menu commands for mermaid diagrams.",autoStart:true,requires:[o.IMermaidManager],optional:[a.ITranslator],activate:(e,t,n)=>{const i=e=>e.classList.contains(o.MERMAID_CLASS);const s=(n!==null&&n!==void 0?n:a.nullTranslator).load("jupyterlab");e.commands.addCommand(d.copySource,{label:s.__("Mermaid Copy Diagram Source"),execute:async t=>{const n=e.contextMenuHitTest(i);if(!n){return}const s=n.querySelector(`.${o.MERMAID_CODE_CLASS}`);if(!s||!s.textContent){return}await navigator.clipboard.writeText(s.textContent)}});const r={selector:`.${o.MERMAID_CLASS}`,rank:13};e.contextMenu.addItem({command:d.copySource,...r});e.contextMenu.addItem({type:"separator",...r})}};const p=[c,h,u]},47375:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>r});var i=n(55115);var s=n.n(i);const o={id:"@jupyterlab/mermaid-extension:factory",description:"Provides a renderer for mermaid text-based diagrams.",rendererFactory:i.rendererFactory,rank:61,dataType:"string",documentWidgetFactoryOptions:[{name:"Mermaid",primaryFileType:"mermaid",fileTypes:["mermaid"],defaultFor:["mermaid"]}],fileTypes:[{mimeTypes:[i.MERMAID_MIME_TYPE],name:"mermaid",extensions:i.MERMAID_FILE_EXTENSIONS,icon:"ui-components:mermaid"}]};const r=o},90288:(e,t,n)=>{"use strict";var i=n(97913);var s=n(3579);var o=n(69240);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(4555);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},63005:(e,t,n)=>{"use strict";n.r(t);n.d(t,{DETAILS_CLASS:()=>p,IMermaidManager:()=>g,IMermaidMarkdown:()=>f,MERMAID_CLASS:()=>c,MERMAID_CODE_CLASS:()=>h,MERMAID_DARK_THEME:()=>d,MERMAID_DEFAULT_THEME:()=>l,MERMAID_FILE_EXTENSIONS:()=>r,MERMAID_MIME_TYPE:()=>o,MermaidManager:()=>v,MermaidMarkdown:()=>b,RE_DEFAULT_RENDERER:()=>a,RenderedMermaid:()=>C,SUMMARY_CLASS:()=>m,WARNING_CLASS:()=>u,rendererFactory:()=>x});var i=n(5592);var s=n(37737);const o="text/vnd.mermaid";const r=[".mmd",".mermaid"];const a=/\bdefaultRenderer["']?\s*:\s*(["']?)(\b[^"'\s]+\b)(\1)/gm;const l="default";const d="dark";const c="jp-RenderedMermaid";const h="mermaid";const u="jp-mod-warning";const p="jp-RenderedMermaid-Details";const m="jp-RenderedMermaid-Summary";const g=new i.Token("@jupyterlab/mermaid:IMermaidManager",`a manager for rendering mermaid text-based diagrams`);const f=new i.Token("@jupyterlab/mermaid:IMermaidMarkdown",`a manager for rendering mermaid text-based diagrams in markdown fenced code blocks`);class v{constructor(e={}){this._diagrams=new s.LruCache({maxSize:e.maxCacheSize||null});if(e.themes){_.initThemes(e.themes||null);e.themes.themeChanged.connect(this.initialize,this)}}static cleanMermaidSvg(e){e=e.replace(_.RE_VOID_ELEMENT,_.replaceVoidElement);return`${_.SVG_XML_HEADER}${e}`}initialize(){this._diagrams.clear();_.initMermaid()}async getMermaid(){return await _.ensureMermaid()}getMermaidVersion(){return _.version()}getCachedFigure(e){return this._diagrams.get(e)}async renderSvg(e){const t=await this.getMermaid();await _.ensureRenderers(e);const n=`jp-mermaid-${_.nextMermaidId()}`;const i=document.createElement("div");document.body.appendChild(i);try{let{svg:s}=await t.render(n,e,i);s=v.cleanMermaidSvg(s);const o=new DOMParser;const r=o.parseFromString(s,"image/svg+xml");const a={text:e,svg:s};const l=r.querySelector("svg");const{maxWidth:d}=(l===null||l===void 0?void 0:l.style)||{};a.width=d?parseFloat(d):null;const c=r.querySelector("title");const h=r.querySelector("desc");if(c){a.accessibleTitle=c.textContent}if(h){a.accessibleDescription=h.textContent}return a}finally{i.remove()}}async renderFigure(e){let t=this._diagrams.get(e);if(t!=null){return t}let n=c;let i=null;t=document.createElement("div");t.className=n;try{const t=await this.renderSvg(e);i=this.makeMermaidFigure(t)}catch(o){t.classList.add(u);i=await this.makeMermaidError(e)}let s=this.getMermaidVersion();if(s){i.dataset.jpMermaidVersion=s}t.appendChild(i);this._diagrams.set(e,t);return t}makeMermaidCode(e){const t=document.createElement("pre");const n=document.createElement("code");n.innerText=e;t.appendChild(n);n.className=h;n.textContent=e;return t}async makeMermaidError(e){const t=await this.getMermaid();let n="";try{await t.parse(e)}catch(r){n=`${r}`}const i=document.createElement("details");i.className=p;const s=document.createElement("summary");s.className=m;s.appendChild(this.makeMermaidCode(e));i.appendChild(s);const o=document.createElement("pre");o.innerText=n;i.appendChild(o);return i}makeMermaidFigure(e){const t=document.createElement("figure");const n=document.createElement("img");t.appendChild(n);n.setAttribute("src",`data:image/svg+xml,${encodeURIComponent(e.svg)}`);if(e.width){n.width=e.width}if(e.accessibleTitle){n.setAttribute("alt",e.accessibleTitle)}t.appendChild(this.makeMermaidCode(e.text));if(e.accessibleDescription){const n=document.createElement("figcaption");n.className="sr-only";n.textContent=e.accessibleDescription;t.appendChild(n)}return t}}var _;(function(e){let t=null;let s=null;let o=null;let r=null;let c=null;let h=0;let u=null;function p(e){t=e}e.initThemes=p;function m(){return u}e.version=m;function g(e=null){e=s;if(!e){return false}let n=l;if(t){const e=t.theme;n=e&&t.isLight(e)?l:d}const i=window.getComputedStyle(document.body).getPropertyValue("--jp-ui-font-family");e.initialize({theme:n,fontFamily:i,securityLevel:"strict",maxTextSize:1e5,maxEdges:1e5,startOnLoad:false});return true}e.initMermaid=g;function f(){return s}e.getMermaid=f;function v(){return h++}e.nextMermaidId=v;async function _(){if(s!=null){return s}if(r){return r.promise}r=new i.PromiseDelegate;u=(await n.e(3763).then(n.t.bind(n,73763,19))).version;const e=s=(await Promise.all([n.e(8606),n.e(2601),n.e(227),n.e(4507)]).then(n.bind(n,90227))).default;g(e);s=e;r.resolve(s);return s}e.ensureMermaid=_;async function b(t){let n=[];for(const i of[...t.matchAll(a)]){switch(i&&i[2]||null){case"elk":n.push(e.ensureMermaidElk());break}}if(n.length){await Promise.all(n)}}e.ensureRenderers=b;async function y(){if(o!=null){return o}if(c){return c.promise}c=new i.PromiseDelegate;const e=await _();const t=(await n.e(6986).then(n.bind(n,96986))).default;e.registerLayoutLoaders(t);o=t;c.resolve(o);return o}e.ensureMermaidElk=y;e.RE_VOID_ELEMENT=/<\s*(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)\s*([^>]*?)\s*>/gi;function w(e,t,n){n=n.trim();if(!n.endsWith("/")){n=`${n} /`}return`<${t} ${n}>`}e.replaceVoidElement=w;e.HTML_ENTITIES=`\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n`.replace(/\n/g," ");const C='';const x=`";e.SVG_XML_HEADER=`${C}\n ${x}${e.HTML_ENTITIES}${S}`})(_||(_={}));class b{constructor(e){this.languages=["mermaid"];this.rank=100;this._mermaid=e.mermaid}async walk(e){await this._mermaid.renderFigure(e)}render(e){let t=this._mermaid.getCachedFigure(e);if(t){return t.outerHTML}return null}}var y=n(1143);const w="image/svg+xml";class C extends y.Widget{constructor(e){super();this._lastRendered=null;this._mimeType=e.mimeType;this.addClass(c)}static set manager(e){if(C._manager){console.warn("Mermaid manager may only be set once, and is already set.");return}C._manager=e;C._managerReady.resolve(e)}async renderModel(e){const t=await C._managerReady.promise;const n=e.data[this._mimeType];if(n==null||n===this._lastRendered){return}this._lastRendered=n;const i=await t.renderFigure(n);if(i.classList.contains(u)){this.node.classList.add(u)}else{this.node.classList.remove(u)}if(!i.firstChild){return}if(this.node.innerHTML!==i.innerHTML){this.node.innerHTML=i.innerHTML}const s=t.getMermaidVersion();const r={...e.metadata[o]||{},version:s};const a={...e.metadata,[o]:r};const l=i.querySelector("img");if(l){const t=decodeURIComponent(l.src.split(",")[1]);const n=e.data[w];if(t!==n){e.setData({data:{...e.data,[w]:t},metadata:a})}}else{const t={...e.data};delete t[w];e.setData({data:t,metadata:a})}}}C._manager=null;C._managerReady=new i.PromiseDelegate;const x={safe:true,mimeTypes:[o],createRenderer:e=>new C(e)}},69240:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(85072);var r=n.n(o);var a=n(97825);var l=n.n(a);var d=n(77659);var c=n.n(d);var h=n(55056);var u=n.n(h);var p=n(10540);var m=n.n(p);var g=n(41113);var f=n.n(g);var v=n(9979);var _={};_.styleTagTransform=f();_.setAttributes=u();_.insert=c().bind(null,"head");_.domAPI=l();_.insertStyleElement=m();var b=r()(v.A,_);const y=v.A&&v.A.locals?v.A.locals:undefined},24039:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>_});var i=n(54281);var s=n.n(i);var o=n(15615);var r=n.n(o);var a=n(61927);var l=n.n(a);var d=n(66127);var c=n.n(d);var h=n(5592);var u=n.n(h);var p=n(82169);var m=n.n(p);const g="@jupyterlab/metadataform-extension:metadataforms";var f;(function(e){async function t(e,t,n,i,s){var o;let r;let a={};function l(e){a={};e.properties.metadataforms.default=Object.keys(t.plugins).map((e=>{var n;const i=(n=t.plugins[e].schema["jupyter.lab.metadataforms"])!==null&&n!==void 0?n:[];i.forEach((t=>{t._origin=e}));a[e]=i;return i})).concat([e["jupyter.lab.metadataforms"]]).reduce(((e,t)=>{t.forEach((t=>{const n=e.find((e=>e.id===t.id));if(n){for(let[e,i]of Object.entries(t.metadataSchema.properties)){n.metadataSchema.properties[e]=i}if(t.metadataSchema.required){if(!n.metadataSchema.required){n.metadataSchema.required=t.metadataSchema.required}else{n.metadataSchema.required.concat(t.metadataSchema.required)}}if(t.metadataSchema.allOf){if(!n.metadataSchema.allOf){n.metadataSchema.allOf=t.metadataSchema.allOf}else{n.metadataSchema.allOf.concat(t.metadataSchema.allOf)}}if(t.uiSchema){if(!n.uiSchema)n.uiSchema={};for(let[e,i]of Object.entries(t.uiSchema)){n.uiSchema[e]=i}}if(t.metadataOptions){if(!n.metadataOptions)n.metadataOptions={};for(let[e,i]of Object.entries(t.metadataOptions)){n.metadataOptions[e]=i}}}else{e.push(t)}}));return e}),[])}t.transform(g,{compose:e=>{var t,n,i,s;if(!r){r=h.JSONExt.deepCopy(e.schema);l(r)}const o=(i=(n=(t=r.properties)===null||t===void 0?void 0:t.metadataforms)===null||n===void 0?void 0:n.default)!==null&&i!==void 0?i:[];const a={metadataforms:(s=e.data.user.metadataforms)!==null&&s!==void 0?s:[]};const d={metadataforms:o.concat(a.metadataforms)};e.data={composite:d,user:a};return e},fetch:e=>{if(!r){r=h.JSONExt.deepCopy(e.schema);l(r)}return{data:e.data,id:e.id,raw:e.raw,schema:r,version:e.version}}});r=null;const d=await t.load(g);const c=new p.MetadataFormProvider;for(let u of d.composite.metadataforms){let e={};let t=h.JSONExt.deepCopy(u.metadataSchema);let r={};if(u.uiSchema){r=h.JSONExt.deepCopy(u.uiSchema)}for(let[n,i]of Object.entries(t.properties)){if(i.default){if(!e[n])e[n]={};e[n].default=i.default}}if(u.metadataOptions){for(let[t,n]of Object.entries(u.metadataOptions)){if(n.cellTypes){if(!e[t])e[t]={};e[t].cellTypes=n.cellTypes}if(n.metadataLevel){if(!e[t])e[t]={};e[t].level=n.metadataLevel}if(n.writeDefault!==undefined){if(!e[t])e[t]={};e[t].writeDefault=n.writeDefault}if(n.customRenderer){const e=s.getRenderer(n.customRenderer);if(e!==undefined){if(!r[t])r[t]={};if(e.fieldRenderer){r[t]["ui:field"]=e.fieldRenderer}else{r[t]["ui:widget"]=e.widgetRenderer}}}}}n.addSection({sectionName:u.id,rank:u.rank,label:(o=u.label)!==null&&o!==void 0?o:u.id});const a=new p.MetadataFormWidget({metadataSchema:t,metaInformation:e,uiSchema:r,pluginId:u._origin,translator:i,showModified:u.showModified});n.addItem({section:u.id,tool:a});c.add(u.id,a)}return c}e.loadSettingsMetadataForm=t})(f||(f={}));const v={id:g,description:"Provides the metadata form registry.",autoStart:true,requires:[i.INotebookTools,a.ITranslator,d.IFormRendererRegistry,o.ISettingRegistry],provides:p.IMetadataFormProvider,activate:async(e,t,n,i,s)=>await f.loadSettingsMetadataForm(e,s,t,n,i)};const _=v},87145:(e,t,n)=>{"use strict";var i=n(40662);var s=n(3579);var o=n(28006);var r=n(69540)},32822:(e,t,n)=>{"use strict";n.r(t);n.d(t,{FormWidget:()=>d,IMetadataFormProvider:()=>_,MetadataFormProvider:()=>v,MetadataFormWidget:()=>g});var i=n(72050);var s=n(66127);var o=n(41742);var r=n.n(o);var a=n(44914);var l=n.n(a);class d extends i.ReactWidget{constructor(e){super();this.addClass("jp-FormWidget");this._props=e}render(){const e={defaultFormData:this._props.settings.default(),updateMetadata:this._props.metadataFormWidget.updateMetadata};return l().createElement(s.FormComponent,{validator:r(),schema:this._props.properties,formData:this._props.formData,formContext:e,uiSchema:this._props.uiSchema,liveValidate:true,idPrefix:`jp-MetadataForm-${this._props.pluginId}`,onChange:e=>{this._props.metadataFormWidget.updateMetadata(e.formData||{})},compact:true,showModifiedFromDefault:this._props.showModified,translator:this._props.translator})}}var c=n(54281);var h=n(15615);var u=n(61927);var p=n(5592);var m=n(1143);class g extends c.NotebookTools.Tool{constructor(e){super();this.updateMetadata=(e,t)=>{var n,i,s,o,r,a,l,d;if(this.notebookTools==undefined)return;const c=this.notebookTools.activeNotebookPanel;const h=this.notebookTools.activeCell;if(h==null)return;this._updatingMetadata=true;const u={};const p={};for(let[m,g]of Object.entries(e)){if(!this.metadataKeys.includes(m))continue;if(((n=this._metaInformation[m])===null||n===void 0?void 0:n.level)==="notebook"&&this._notebookModelNull)continue;if(((i=this._metaInformation[m])===null||i===void 0?void 0:i.cellTypes)&&!((o=(s=this._metaInformation[m])===null||s===void 0?void 0:s.cellTypes)===null||o===void 0?void 0:o.includes(h.model.type))){continue}let e;let t;if(((r=this._metaInformation[m])===null||r===void 0?void 0:r.level)==="notebook"){e=c.model.metadata;t=p}else{e=h.model.metadata;t=u}let v=m.replace(/^\/+/,"").replace(/\/+$/,"").split("/");let _=v[0];if(_==undefined)continue;let b=g!==undefined&&(((l=(a=this._metaInformation[m])===null||a===void 0?void 0:a.writeDefault)!==null&&l!==void 0?l:true)||g!==((d=this._metaInformation[m])===null||d===void 0?void 0:d.default));if(v.length==1){if(b)t[_]=g;else t[_]=undefined;continue}let y=v.slice(1,-1);let w=v[v.length-1];if(!(_ in t)){t[_]=e[_]}if(t[_]===undefined)t[_]={};let C=t[_];let x=true;for(let n of y){if(!(n in C)){if(!b){x=false;break}else C[n]={}}C=C[n]}if(x){if(!b)delete C[w];else C[w]=g}if(!b){t[_]=f.deleteEmptyNested(t[_],v.slice(1));if(!Object.keys(t[_]).length)t[_]=undefined}}for(let[m,g]of Object.entries(u)){if(g===undefined)h.model.deleteMetadata(m);else h.model.setMetadata(m,g)}if(!this._notebookModelNull){for(let[e,t]of Object.entries(p)){if(t===undefined)c.model.deleteMetadata(e);else c.model.setMetadata(e,t)}}this._updatingMetadata=false;if(t){this._update()}};this._notebookModelNull=false;this._metadataSchema=e.metadataSchema;this._metaInformation=e.metaInformation;this._uiSchema=e.uiSchema||{};this._pluginId=e.pluginId;this._showModified=e.showModified||false;this.translator=e.translator||u.nullTranslator;this._trans=this.translator.load("jupyterlab");this._updatingMetadata=false;const t=this.layout=new m.SingletonLayout;const n=document.createElement("div");const i=document.createElement("div");i.textContent=this._trans.__("No metadata.");i.className="jp-MetadataForm-placeholderContent";n.appendChild(i);this._placeholder=new m.Widget({node:n});this._placeholder.addClass("jp-MetadataForm-placeholder");t.widget=this._placeholder}get form(){return this._form}get metadataKeys(){var e;const t=[];for(let n of Object.keys(this._metadataSchema.properties)){t.push(n)}(e=this._metadataSchema.allOf)===null||e===void 0?void 0:e.forEach((e=>{if(e.then!==undefined){if(e.then.properties!==undefined){let n=e.then.properties;for(let e of Object.keys(n)){if(!t.includes(e))t.push(e)}}}if(e.else!==undefined){if(e.else.properties!==undefined){let n=e.else.properties;for(let e of Object.keys(n)){if(!t.includes(e))t.push(e)}}}}));return t}getProperties(e){return p.JSONExt.deepCopy(this._metadataSchema.properties[e])||null}setProperties(e,t){Object.entries(t).forEach((([t,n])=>{this._metadataSchema.properties[e][t]=n}))}setContent(e){const t=this.layout;if(t.widget){t.widget.removeClass("jp-MetadataForm-content");t.removeWidget(t.widget)}if(!e){e=this._placeholder}e.addClass("jp-MetadataForm-content");t.widget=e}buildWidget(e){this._form=new d(e);this._form.addClass("jp-MetadataForm");this.setContent(this._form)}onAfterShow(e){this._update()}onActiveCellChanged(e){if(this.isVisible)this._update()}onActiveCellMetadataChanged(e){if(!this._updatingMetadata&&this.isVisible)this._update()}onActiveNotebookPanelChanged(e){const t=this.notebookTools.activeNotebookPanel;this._notebookModelNull=t===null||t.model===null;if(!this._updatingMetadata&&this.isVisible)this._update()}onActiveNotebookPanelMetadataChanged(e){if(!this._updatingMetadata&&this.isVisible)this._update()}_update(){var e,t,n,i,s;const o=this.notebookTools.activeNotebookPanel;const r=this.notebookTools.activeCell;if(r==undefined)return;const a=p.JSONExt.deepCopy(this._metadataSchema);const l={};for(let d of Object.keys(this._metadataSchema.properties||p.JSONExt.emptyObject)){if(((e=this._metaInformation[d])===null||e===void 0?void 0:e.level)==="notebook"&&this._notebookModelNull){delete a.properties[d];continue}if(((t=this._metaInformation[d])===null||t===void 0?void 0:t.cellTypes)&&!((i=(n=this._metaInformation[d])===null||n===void 0?void 0:n.cellTypes)===null||i===void 0?void 0:i.includes(r.model.type))){delete a.properties[d];continue}let c;let h=d.replace(/^\/+/,"").replace(/\/+$/,"").split("/");if(((s=this._metaInformation[d])===null||s===void 0?void 0:s.level)==="notebook"){c=o.model.metadata}else{c=r.model.metadata}let u=true;for(let e of h){if(e in c)c=c[e];else{u=false;break}}if(u)l[d]=c}this.buildWidget({properties:a,settings:new h.BaseSettings({schema:this._metadataSchema}),uiSchema:this._uiSchema,translator:this.translator||null,formData:l,metadataFormWidget:this,showModified:this._showModified,pluginId:this._pluginId})}}var f;(function(e){function t(e,n){let i=n.shift();if(i!==undefined&&i in e){if(Object.keys(e[i]).length)e[i]=t(e[i],n);if(!Object.keys(e[i]).length)delete e[i]}return e}e.deleteEmptyNested=t})(f||(f={}));class v{constructor(){this._items={}}add(e,t){if(!this._items[e]){this._items[e]=t}else{console.warn(`A MetadataformWidget is already registered with id ${e}`)}}get(e){if(this._items[e]){return this._items[e]}else{console.warn(`There is no MetadataformWidget registered with id ${e}`)}}}const _=new p.Token("@jupyterlab/metadataform:IMetadataFormProvider",`A service to register new metadata editor widgets.`)},69540:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(28006);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(62129);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},15555:(e,t,n)=>{"use strict";n.r(t);n.d(t,{MAJOR_VERSION:()=>o,MINOR_VERSION:()=>r,isCode:()=>c,isDisplayData:()=>u,isDisplayUpdate:()=>p,isError:()=>g,isExecuteResult:()=>h,isMarkdown:()=>d,isRaw:()=>l,isStream:()=>m,validateMimeValue:()=>a});var i=n(5592);var s=n.n(i);const o=4;const r=4;function a(e,t){const n=/^application\/.+\+json$/;const s=e==="application/json"||n.test(e);const o=e=>Object.prototype.toString.call(e)==="[object String]";if(Array.isArray(t)){if(s){return false}let e=true;t.forEach((t=>{if(!o(t)){e=false}}));return e}if(o(t)){return!s}if(!s){return false}return i.JSONExt.isObject(t)}function l(e){return e.cell_type==="raw"}function d(e){return e.cell_type==="markdown"}function c(e){return e.cell_type==="code"}function h(e){return e.output_type==="execute_result"}function u(e){return e.output_type==="display_data"}function p(e){return e.output_type==="update_display_data"}function m(e){return e.output_type==="stream"}function g(e){return e.output_type==="error"}},65463:(e,t,n)=>{"use strict";n.r(t);n.d(t,{commandEditItem:()=>se,default:()=>Ce,executionIndicator:()=>oe,exportPlugin:()=>re,notebookTrustItem:()=>ae});var i=n(74991);var s=n(72050);var o=n(93681);var r=n(98335);var a=n(37737);var l=n(90567);var d=n(26087);var c=n(65189);var h=n(66465);var u=n(87277);var p=n(45231);var m=n(11447);var g=n(90295);var f=n(56759);var v=n(82169);var _=n(54281);var b=n(12173);var y=n(90943);var w=n(15615);var C=n(86503);var x=n(66987);var S=n(10553);var k=n(61927);var j=n(66127);var I=n(34236);var E=n(5592);var T=n(90044);var M=n(42856);var D=n(1143);var A=n(17355);const P={id:"@jupyterlab/notebook-extension:cell-executor",description:"Provides the notebook cell executor.",autoStart:true,provides:_.INotebookCellExecutor,activate:()=>Object.freeze({runCell:_.runCell})};var L=n(39357);var R=n(77256);const N={activate:O,id:"@jupyterlab/notebook-extension:log-output",description:"Adds cell outputs log to the application logger.",requires:[_.INotebookTracker],optional:[L.ILoggerRegistry],autoStart:true};function O(e,t,n){if(!n){return}function i(e){function t(t,i,s){if(R.KernelMessage.isDisplayDataMsg(t)||R.KernelMessage.isStreamMsg(t)||R.KernelMessage.isErrorMsg(t)||R.KernelMessage.isExecuteResultMsg(t)){const o=n.getLogger(e.context.path);o.rendermime=e.content.rendermime;const r={...t.content,output_type:t.header.msg_type};let a=i;if(R.KernelMessage.isErrorMsg(t)||R.KernelMessage.isStreamMsg(t)&&t.content.name==="stderr"){a=s}o.log({type:"output",data:r,level:a})}}e.context.sessionContext.iopubMessage.connect(((e,n)=>t(n,"info","info")));e.context.sessionContext.unhandledMessage.connect(((e,n)=>t(n,"warning","error")))}t.forEach((e=>i(e)));t.widgetAdded.connect(((e,t)=>i(t)))}var B=n(44914);var F=n.n(B);var z=n(26568);const H="jp-ActiveCellTool";const W="jp-ActiveCellTool-Content";const V="jp-ActiveCellTool-CellContent";class U extends _.NotebookTools.Tool{constructor(e){super();const{languages:t}=e;this._tracker=e.tracker;this.addClass(H);this.layout=new D.PanelLayout;this._inputPrompt=new o.InputPrompt;this.layout.addWidget(this._inputPrompt);const n=document.createElement("div");n.classList.add(W);const i=n.appendChild(document.createElement("div"));const s=i.appendChild(document.createElement("pre"));i.className=V;this._editorEl=s;this.layout.addWidget(new D.Widget({node:n}));const r=async()=>{var e,n;this._editorEl.innerHTML="";if(((e=this._cellModel)===null||e===void 0?void 0:e.type)==="code"){this._inputPrompt.executionCount=`${(n=this._cellModel.executionCount)!==null&&n!==void 0?n:""}`;this._inputPrompt.show()}else{this._inputPrompt.executionCount=null;this._inputPrompt.hide()}if(this._cellModel){await t.highlight(this._cellModel.sharedModel.getSource().split("\n")[0],t.findByMIME(this._cellModel.mimeType),this._editorEl)}};this._refreshDebouncer=new z.Debouncer(r,150)}render(e){var t,n;const i=this._tracker.activeCell;if(i)this._cellModel=(i===null||i===void 0?void 0:i.model)||null;((t=this._cellModel)===null||t===void 0?void 0:t.sharedModel).changed.connect(this.refresh,this);(n=this._cellModel)===null||n===void 0?void 0:n.mimeTypeChanged.connect(this.refresh,this);this.refresh().then((()=>undefined)).catch((()=>undefined));return F().createElement("div",{ref:e=>e===null||e===void 0?void 0:e.appendChild(this.node)})}async refresh(){await this._refreshDebouncer.invoke()}}var q=n(68148);const $="jp-CellMetadataEditor";const K="jp-NotebookMetadataEditor";class J extends _.NotebookTools.MetadataEditorTool{constructor(e){super(e);this._tracker=e.tracker;this.editor.editorHostNode.addEventListener("blur",this.editor,true);this.editor.editorHostNode.addEventListener("click",this.editor,true);this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,t,n;const i=(e=this._tracker.activeCell)===null||e===void 0?void 0:e.model.sharedModel;if(i&&this.editor.source){const e=Object.keys((t=i.metadata)!==null&&t!==void 0?t:{});const s=(n=this.editor.source.toJSON())!==null&&n!==void 0?n:{};i.transact((()=>{e.forEach((e=>i.deleteMetadata(e)));i.setMetadata(s)}))}}render(e){var t;const n=this._tracker.activeCell;this.editor.source=n?new q.ObservableJSON({values:n.model.metadata}):null;(t=this.editor.source)===null||t===void 0?void 0:t.changed.connect(this._onSourceChanged,this);return F().createElement("div",{className:$},F().createElement("div",{ref:e=>e===null||e===void 0?void 0:e.appendChild(this.node)}))}}class G extends _.NotebookTools.MetadataEditorTool{constructor(e){super(e);this._tracker=e.tracker;this.editor.editorHostNode.addEventListener("blur",this.editor,true);this.editor.editorHostNode.addEventListener("click",this.editor,true);this.editor.headerNode.addEventListener("click",this.editor)}_onSourceChanged(){var e,t;if(this.editor.source){(t=(e=this._tracker.currentWidget)===null||e===void 0?void 0:e.model)===null||t===void 0?void 0:t.sharedModel.setMetadata(this.editor.source.toJSON())}}render(e){var t,n;const i=this._tracker.currentWidget;this.editor.source=i?new q.ObservableJSON({values:(t=i.model)===null||t===void 0?void 0:t.metadata}):null;(n=this.editor.source)===null||n===void 0?void 0:n.changed.connect(this._onSourceChanged,this);return F().createElement("div",{className:K},F().createElement("div",{ref:e=>e===null||e===void 0?void 0:e.appendChild(this.node)}))}}var Y;(function(e){e.createNew="notebook:create-new";e.interrupt="notebook:interrupt-kernel";e.restart="notebook:restart-kernel";e.restartClear="notebook:restart-clear-output";e.restartAndRunToSelected="notebook:restart-and-run-to-selected";e.restartRunAll="notebook:restart-run-all";e.reconnectToKernel="notebook:reconnect-to-kernel";e.changeKernel="notebook:change-kernel";e.getKernel="notebook:get-kernel";e.createConsole="notebook:create-console";e.createSubshellConsole="notebook:create-subshell-console";e.createOutputView="notebook:create-output-view";e.clearAllOutputs="notebook:clear-all-cell-outputs";e.shutdown="notebook:shutdown-kernel";e.closeAndShutdown="notebook:close-and-shutdown";e.trust="notebook:trust";e.exportToFormat="notebook:export-to-format";e.run="notebook:run-cell";e.runAndAdvance="notebook:run-cell-and-select-next";e.runAndInsert="notebook:run-cell-and-insert-below";e.runInConsole="notebook:run-in-console";e.runAll="notebook:run-all-cells";e.runAllAbove="notebook:run-all-above";e.runAllBelow="notebook:run-all-below";e.renderAllMarkdown="notebook:render-all-markdown";e.toCode="notebook:change-cell-to-code";e.toMarkdown="notebook:change-cell-to-markdown";e.toRaw="notebook:change-cell-to-raw";e.cut="notebook:cut-cell";e.copy="notebook:copy-cell";e.pasteAbove="notebook:paste-cell-above";e.pasteBelow="notebook:paste-cell-below";e.duplicateBelow="notebook:duplicate-below";e.pasteAndReplace="notebook:paste-and-replace-cell";e.moveUp="notebook:move-cell-up";e.moveDown="notebook:move-cell-down";e.clearOutputs="notebook:clear-cell-output";e.deleteCell="notebook:delete-cell";e.insertAbove="notebook:insert-cell-above";e.insertBelow="notebook:insert-cell-below";e.selectAbove="notebook:move-cursor-up";e.selectBelow="notebook:move-cursor-down";e.selectHeadingAboveOrCollapse="notebook:move-cursor-heading-above-or-collapse";e.selectHeadingBelowOrExpand="notebook:move-cursor-heading-below-or-expand";e.insertHeadingAbove="notebook:insert-heading-above";e.insertHeadingBelow="notebook:insert-heading-below";e.extendAbove="notebook:extend-marked-cells-above";e.extendTop="notebook:extend-marked-cells-top";e.extendBelow="notebook:extend-marked-cells-below";e.extendBottom="notebook:extend-marked-cells-bottom";e.selectAll="notebook:select-all";e.deselectAll="notebook:deselect-all";e.editMode="notebook:enter-edit-mode";e.merge="notebook:merge-cells";e.mergeAbove="notebook:merge-cell-above";e.mergeBelow="notebook:merge-cell-below";e.split="notebook:split-cell-at-cursor";e.commandMode="notebook:enter-command-mode";e.toggleAllLines="notebook:toggle-all-cell-line-numbers";e.undoCellAction="notebook:undo-cell-action";e.redoCellAction="notebook:redo-cell-action";e.redo="notebook:redo";e.undo="notebook:undo";e.markdown1="notebook:change-cell-to-heading-1";e.markdown2="notebook:change-cell-to-heading-2";e.markdown3="notebook:change-cell-to-heading-3";e.markdown4="notebook:change-cell-to-heading-4";e.markdown5="notebook:change-cell-to-heading-5";e.markdown6="notebook:change-cell-to-heading-6";e.hideCode="notebook:hide-cell-code";e.showCode="notebook:show-cell-code";e.hideAllCode="notebook:hide-all-cell-code";e.showAllCode="notebook:show-all-cell-code";e.hideOutput="notebook:hide-cell-outputs";e.showOutput="notebook:show-cell-outputs";e.toggleOutput="notebook:toggle-cell-outputs";e.hideAllOutputs="notebook:hide-all-cell-outputs";e.showAllOutputs="notebook:show-all-cell-outputs";e.toggleRenderSideBySideCurrentNotebook="notebook:toggle-render-side-by-side-current";e.setSideBySideRatio="notebook:set-side-by-side-ratio";e.enableOutputScrolling="notebook:enable-output-scrolling";e.disableOutputScrolling="notebook:disable-output-scrolling";e.selectLastRunCell="notebook:select-last-run-cell";e.replaceSelection="notebook:replace-selection";e.autoClosingBrackets="notebook:toggle-autoclosing-brackets";e.toggleCollapseCmd="notebook:toggle-heading-collapse";e.collapseAllCmd="notebook:collapse-all-headings";e.expandAllCmd="notebook:expand-all-headings";e.copyToClipboard="notebook:copy-to-clipboard";e.invokeCompleter="completer:invoke-notebook";e.selectCompleter="completer:select-notebook";e.tocRunCells="toc:run-cells";e.accessPreviousHistory="notebook:access-previous-history-entry";e.accessNextHistory="notebook:access-next-history-entry";e.virtualScrollbar="notebook:toggle-virtual-scrollbar"})(Y||(Y={}));const X="Notebook";const Q=["notebook","python","custom"];const Z="@jupyterlab/notebook-extension:panel";const ee="jp-NotebookExtension-sideBySideMargins";const te={id:"@jupyterlab/notebook-extension:tracker",description:"Provides the notebook widget tracker.",provides:_.INotebookTracker,requires:[_.INotebookWidgetFactory,l.IEditorExtensionRegistry,_.INotebookCellExecutor],optional:[s.ICommandPalette,p.IDefaultFileBrowser,m.ILauncher,i.ILayoutRestorer,f.IMainMenu,i.IRouter,w.ISettingRegistry,s.ISessionContextDialogs,k.ITranslator,j.IFormRendererRegistry,p.IFileBrowserFactory],activate:Ee,autoStart:true};const ne={id:"@jupyterlab/notebook-extension:factory",description:"Provides the notebook cell factory.",provides:_.NotebookPanel.IContentFactory,requires:[r.IEditorServices],autoStart:true,activate:(e,t)=>{const n=t.factoryService.newInlineEditor;return new _.NotebookPanel.ContentFactory({editorFactory:n})}};const ie={activate:xe,provides:_.INotebookTools,id:"@jupyterlab/notebook-extension:tools",description:"Provides the notebook tools.",autoStart:true,requires:[_.INotebookTracker,r.IEditorServices,l.IEditorLanguageRegistry,C.IStateDB,k.ITranslator],optional:[b.IPropertyInspectorProvider]};const se={id:"@jupyterlab/notebook-extension:mode-status",description:"Adds a notebook mode status widget.",autoStart:true,requires:[_.INotebookTracker,k.ITranslator],optional:[x.IStatusBar],activate:(e,t,n,i)=>{if(!i){return}const{shell:s}=e;const o=new _.CommandEditStatus(n);t.currentChanged.connect((()=>{const e=t.currentWidget;o.model.notebook=e&&e.content}));i.registerStatusItem("@jupyterlab/notebook-extension:mode-status",{priority:1,item:o,align:"right",rank:4,isActive:()=>!!s.currentWidget&&!!t.currentWidget&&s.currentWidget===t.currentWidget})}};const oe={id:"@jupyterlab/notebook-extension:execution-indicator",description:"Adds a notebook execution status widget.",autoStart:true,requires:[_.INotebookTracker,i.ILabShell,k.ITranslator],optional:[x.IStatusBar,w.ISettingRegistry],activate:(e,t,n,i,s,o)=>{let r;let a;let l;const d=e=>{var o,d;let{showOnToolBar:c,showProgress:h}=e;if(!c){if(!s){return}if(!(r===null||r===void 0?void 0:r.model)){r=new _.ExecutionIndicator(i);a=(e,n)=>{const{newValue:i}=n;if(i&&t.has(i)){const e=i;r.model.attachNotebook({content:e.content,context:e.sessionContext})}};l=s.registerStatusItem("@jupyterlab/notebook-extension:execution-indicator",{item:r,align:"left",rank:3,isActive:()=>{const e=n.currentWidget;return!!e&&t.has(e)}});r.model.attachNotebook({content:(o=t.currentWidget)===null||o===void 0?void 0:o.content,context:(d=t.currentWidget)===null||d===void 0?void 0:d.sessionContext});n.currentChanged.connect(a);r.disposed.connect((()=>{n.currentChanged.disconnect(a)}))}r.model.displayOption={showOnToolBar:c,showProgress:h}}else{if(l){n.currentChanged.disconnect(a);l.dispose()}}};if(o){const t=o.load(te.id);Promise.all([t,e.restored]).then((([e])=>{d(_.ExecutionIndicator.getSettingValue(e));e.changed.connect((e=>d(_.ExecutionIndicator.getSettingValue(e))))})).catch((e=>{console.error(e.message)}))}}};const re={id:"@jupyterlab/notebook-extension:export",description:"Adds the export notebook commands.",autoStart:true,requires:[k.ITranslator,_.INotebookTracker],optional:[f.IMainMenu,s.ICommandPalette],activate:(e,t,n,i,s)=>{var o;const r=t.load("jupyterlab");const{commands:l,shell:d}=e;const c=e.serviceManager;const h=()=>Re.isEnabled(d,n);l.addCommand(Y.exportToFormat,{label:e=>{if(e.label===undefined){return r.__("Save and Export Notebook to the given `format`.")}const t=e["label"];return e["isPalette"]?r.__("Save and Export Notebook: %1",t):t},execute:e=>{const t=De(n,d,e);if(!t){return}const i=a.PageConfig.getNBConvertURL({format:e["format"],download:true,path:t.context.path});const{context:s}=t;if(s.model.dirty&&!s.model.readOnly){return s.save().then((()=>{window.open(i,"_blank","noopener")}))}return new Promise((e=>{window.open(i,"_blank","noopener");e(undefined)}))},isEnabled:h});let u;if(i){u=(o=i.fileMenu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-mainmenu-file-notebookexport"})))===null||o===void 0?void 0:o.submenu}let p=false;const m=async()=>{if(p){return}n.widgetAdded.disconnect(m);p=true;const e=await c.nbconvert.getExportFormats(false);if(!e){return}const i=Re.getFormatLabels(t);const o=Object.keys(e);o.forEach((function(e){const t=r.__(e[0].toUpperCase()+e.substr(1));const n=i[e]?i[e]:t;let o={format:e,label:n,isPalette:false};if(Q.indexOf(e)===-1){if(u){u.addItem({command:Y.exportToFormat,args:o})}if(s){o={format:e,label:n,isPalette:true};const t=r.__("Notebook Operations");s.addItem({command:Y.exportToFormat,category:t,args:o})}}}))};n.widgetAdded.connect(m)}};const ae={id:"@jupyterlab/notebook-extension:trust-status",description:"Adds the notebook trusted status widget.",autoStart:true,requires:[_.INotebookTracker,k.ITranslator],optional:[x.IStatusBar],activate:(e,t,n,i)=>{if(!i){return}const{shell:s}=e;const o=new _.NotebookTrustStatus(n);t.currentChanged.connect((()=>{const e=t.currentWidget;o.model.notebook=e&&e.content}));i.registerStatusItem("@jupyterlab/notebook-extension:trust-status",{item:o,align:"right",rank:3,isActive:()=>!!s.currentWidget&&!!t.currentWidget&&s.currentWidget===t.currentWidget})}};const le={id:"@jupyterlab/notebook-extension:widget-factory",description:"Provides the notebook widget factory.",provides:_.INotebookWidgetFactory,requires:[_.NotebookPanel.IContentFactory,r.IEditorServices,y.IRenderMimeRegistry,s.IToolbarWidgetRegistry],optional:[w.ISettingRegistry,s.ISessionContextDialogs,k.ITranslator],activate:Se,autoStart:true};const de={id:"@jupyterlab/notebook-extension:cloned-outputs",description:"Adds the clone output feature.",requires:[c.IDocumentManager,_.INotebookTracker,k.ITranslator],optional:[i.ILayoutRestorer],activate:ke,autoStart:true};const ce={id:"@jupyterlab/notebook-extension:code-console",description:"Adds the notebook code consoles features.",requires:[_.INotebookTracker,k.ITranslator],activate:je,autoStart:true};const he={id:"@jupyterlab/notebook-extension:copy-output",description:"Adds the copy cell outputs feature.",activate:Ie,requires:[k.ITranslator,_.INotebookTracker],autoStart:true};const ue={id:"@jupyterlab/notebook-extension:kernel-status",description:"Adds the notebook kernel status.",activate:(e,t,n)=>{const i=e=>{let n=null;if(e&&t.has(e)){return e.sessionContext}return n};n.addSessionProvider(i)},requires:[_.INotebookTracker,s.IKernelStatusModel],autoStart:true};const pe={id:"@jupyterlab/notebook-extension:cursor-position",description:"Adds the notebook cursor position status.",activate:(e,t,n)=>{let i=null;const s=async e=>{let s=null;if(e!==i){i===null||i===void 0?void 0:i.content.activeCellChanged.disconnect(n.update);i=null;if(e&&t.has(e)){e.content.activeCellChanged.connect(n.update);const t=e.content.activeCell;s=null;if(t){await t.ready;s=t.editor}i=e}}else if(e){const t=e.content.activeCell;s=null;if(t){await t.ready;s=t.editor}}return s};n.addEditorProvider(s)},requires:[_.INotebookTracker,r.IPositionModel],autoStart:true};const me={id:"@jupyterlab/notebook-extension:completer",description:"Adds the code completion capability to notebooks.",requires:[_.INotebookTracker],optional:[d.ICompletionProviderManager,k.ITranslator,s.ISanitizer],activate:Te,autoStart:true};const ge={id:"@jupyterlab/notebook-extension:search",description:"Adds search capability to notebooks.",requires:[u.ISearchProviderRegistry],autoStart:true,activate:(e,t)=>{t.add("jp-notebookSearchProvider",_.NotebookSearchProvider)}};const fe={id:"@jupyterlab/notebook-extension:toc",description:"Adds table of content capability to the notebooks",requires:[_.INotebookTracker,S.ITableOfContentsRegistry,s.ISanitizer],optional:[y.IMarkdownParser,w.ISettingRegistry],autoStart:true,activate:(e,t,n,i,s,o)=>{const r=new _.NotebookToCFactory(t,s,i);n.add(r);if(o){Promise.all([e.restored,o.load(te.id)]).then((([e,t])=>{const n=()=>{var e;r.scrollToTop=(e=t.composite["scrollHeadingToTop"])!==null&&e!==void 0?e:true};n();t.changed.connect(n)})).catch((e=>{console.error("Failed to load notebook table of content settings.",e)}))}}};const ve={id:"@jupyterlab/notebook-extension:language-server",description:"Adds language server capability to the notebooks.",requires:[_.INotebookTracker,g.ILSPDocumentConnectionManager,g.ILSPFeatureManager,g.ILSPCodeExtractorsManager,g.IWidgetLSPAdapterTracker],activate:Me,autoStart:true};const _e={id:"@jupyterlab/notebook-extension:update-raw-mimetype",description:"Adds metadata form editor for raw cell mimetype.",autoStart:true,requires:[_.INotebookTracker,v.IMetadataFormProvider,k.ITranslator],activate:(e,t,n,i)=>{const s=i.load("jupyterlab");let o=false;async function r(){if(o){return}if(!n.get("commonToolsSection")){return}const a=n.get("commonToolsSection").getProperties("/raw_mimetype");if(!a){return}t.widgetAdded.disconnect(r);o=true;const l=e.serviceManager;const d=await l.nbconvert.getExportFormats(false);if(!d){return}const c=Object.keys(d);const h=Re.getFormatLabels(i);c.forEach((function(e){var t;const n=((t=a.oneOf)===null||t===void 0?void 0:t.filter((t=>t.const===e)).length)>0;if(!n){const t=s.__(e[0].toUpperCase()+e.substr(1));const n=h[e]?h[e]:t;const i=d[e].output_mimetype;a.oneOf.push({const:i,title:n})}}));n.get("commonToolsSection").setProperties("/raw_mimetype",a)}t.widgetAdded.connect(r)}};const be={id:"@jupyterlab/notebook-extension:metadata-editor",description:"Adds metadata form for full metadata editor.",autoStart:true,requires:[_.INotebookTracker,r.IEditorServices,j.IFormRendererRegistry],optional:[k.ITranslator],activate:(e,t,n,i,s)=>{const o=e=>n.factoryService.newInlineEditor(e);const r={fieldRenderer:e=>new J({editorFactory:o,tracker:t,label:"Cell metadata",translator:s}).render(e)};i.addRenderer("@jupyterlab/notebook-extension:metadata-editor.cell-metadata",r);const a={fieldRenderer:e=>new G({editorFactory:o,tracker:t,label:"Notebook metadata",translator:s}).render(e)};i.addRenderer("@jupyterlab/notebook-extension:metadata-editor.notebook-metadata",a)}};const ye={id:"@jupyterlab/notebook-extension:active-cell-tool",description:"Adds active cell field in the metadata editor tab.",autoStart:true,requires:[_.INotebookTracker,j.IFormRendererRegistry,l.IEditorLanguageRegistry],activate:(e,t,n,i)=>{const s={fieldRenderer:e=>new U({tracker:t,languages:i}).render(e)};n.addRenderer("@jupyterlab/notebook-extension:active-cell-tool.renderer",s)}};const we=[P,ne,te,oe,re,ie,se,ae,le,N,de,ce,he,ue,pe,me,ge,fe,ve,_e,be,ye];const Ce=we;function xe(e,t,n,i,s,o,r){const a=o.load("jupyterlab");const l="notebook-tools";const d=new _.NotebookTools({tracker:t,translator:o});const c=(e,t)=>{switch(t.type){case"activate-request":void s.save(l,{open:true});break;case"after-hide":case"close-request":void s.remove(l);break;default:break}return true};d.title.icon=j.buildIcon;d.title.caption=a.__("Notebook Tools");d.id=l;M.MessageLoop.installMessageHook(d,c);if(r){t.widgetAdded.connect(((e,t)=>{const n=r.register(t);n.render(d)}))}return d}function Se(e,t,n,i,o,r,l,d){const c=d!==null&&d!==void 0?d:k.nullTranslator;const u=l!==null&&l!==void 0?l:new s.SessionContextDialogs({translator:c});const p=a.PageConfig.getOption("notebookStartsKernel");const m=p===""||p.toLowerCase()==="true";const{commands:g}=e;let f;o.addFactory(X,"save",(e=>h.ToolbarItems.createSaveButton(g,e.context.fileChanged)));o.addFactory(X,"cellType",(e=>_.ToolbarItems.createCellTypeItem(e,c)));o.addFactory(X,"kernelName",(e=>s.Toolbar.createKernelNameItem(e.sessionContext,u,c)));o.addFactory(X,"executionProgress",(e=>{const t=r===null||r===void 0?void 0:r.load(te.id);const n=_.ExecutionIndicator.createExecutionIndicatorItem(e,c,t);void(t===null||t===void 0?void 0:t.then((t=>{e.disposed.connect((()=>{t.dispose()}))})));return n}));if(r){f=(0,s.createToolbarFactory)(o,r,X,Z,c)}const v=c.load("jupyterlab");const b=new _.NotebookWidgetFactory({name:X,label:v.__("Notebook"),fileTypes:["notebook"],modelName:"notebook",defaultFor:["notebook"],preferKernel:m,canStartKernel:true,rendermime:i,contentFactory:t,editorConfig:_.StaticNotebook.defaultEditorConfig,notebookConfig:_.StaticNotebook.defaultNotebookConfig,mimeTypeService:n.mimeTypeService,toolbarFactory:f,translator:c});e.docRegistry.addWidgetFactory(b);return b}function ke(e,t,n,i,o){const r=i.load("jupyterlab");const a=new s.WidgetTracker({namespace:"cloned-outputs"});if(o){void o.restore(a,{command:Y.createOutputView,args:e=>({path:e.content.path,index:e.content.index}),name:e=>`${e.content.path}:${e.content.index}`,when:n.restored})}const{commands:l,shell:d}=e;const c=()=>Re.isEnabledAndSingleSelected(d,n);l.addCommand(Y.createOutputView,{label:r.__("Create New View for Cell Output"),execute:async e=>{var o;let r;let l;const d=e.path;let c=e.index;if(d&&c!==undefined&&c!==null){l=t.findWidget(d,X);if(!l){return}}else{l=n.currentWidget;if(!l){return}r=l.content.activeCell;c=l.content.activeCellIndex}const h=new Re.ClonedOutputArea({notebook:l,cell:r,index:c,translator:i});const u=new s.MainAreaWidget({content:h});l.context.addSibling(u,{ref:l.id,mode:"split-bottom",type:"Cloned Output"});const p=()=>{void a.save(u)};l.context.pathChanged.connect(p);(o=l.context.model)===null||o===void 0?void 0:o.cells.changed.connect(p);void a.add(u);l.content.disposed.connect((()=>{var e;l.context.pathChanged.disconnect(p);(e=l.context.model)===null||e===void 0?void 0:e.cells.changed.disconnect(p);u.dispose()}))},isEnabled:c})}function je(e,t,n){const i=n.load("jupyterlab");const{commands:s,shell:o}=e;const r=()=>Re.isEnabled(o,t);s.addCommand(Y.createConsole,{label:i.__("New Console for Notebook"),execute:e=>{const n=t.currentWidget;if(!n){return}return Re.createConsole(s,n,e["activate"])},isEnabled:r});s.addCommand(Y.createSubshellConsole,{label:i.__("New Subshell Console for Notebook"),execute:e=>{const n=t.currentWidget;if(!n){return}return Re.createConsole(s,n,e["activate"],true)},isEnabled:r,isVisible:()=>{var e,n,i;const s=(n=(e=t.currentWidget)===null||e===void 0?void 0:e.context.sessionContext.session)===null||n===void 0?void 0:n.kernel;return(i=s===null||s===void 0?void 0:s.supportsSubshells)!==null&&i!==void 0?i:false}});s.addCommand(Y.runInConsole,{label:i.__("Run Selected Text or Current Line in Console"),execute:async e=>{var n,i;const o=t.currentWidget;if(!o){return}const{context:r,content:a}=o;const l=a.activeCell;const d=l===null||l===void 0?void 0:l.model.metadata;const c=r.path;if(!l||l.model.type!=="code"){return}let h;const u=l.editor;if(!u){return}const p=u.getSelection();const{start:m,end:g}=p;const f=m.column!==g.column||m.line!==g.line;if(f){const e=u.getOffsetAt(p.start);const t=u.getOffsetAt(p.end);h=u.model.sharedModel.getSource().substring(e,t)}else{const e=u.getCursorPosition();const t=u.model.sharedModel.getSource().split("\n");let s=p.start.line;while(s0;let a=0;let l=a+1;while(true){h=t.slice(a,l).join("\n");const d=await((i=(n=o.context.sessionContext.session)===null||n===void 0?void 0:n.kernel)===null||i===void 0?void 0:i.requestIsComplete({code:h+"\n\n"}));if((d===null||d===void 0?void 0:d.content.status)==="complete"){if(st.addRange(e)))}e.commands.addCommand(Y.copyToClipboard,{label:i.__("Copy Output to Clipboard"),execute:e=>{var t;const i=(t=n.currentWidget)===null||t===void 0?void 0:t.content.activeCell;if(i==null){return}const o=i.outputArea.outputTracker.currentWidget;if(o==null){return}const r=o.node.getElementsByClassName("jp-OutputArea-output");if(r.length>0){const e=r[0];s(e)}}});e.contextMenu.addItem({command:Y.copyToClipboard,selector:".jp-Notebook .jp-OutputArea-child",rank:0})}function Ee(e,t,n,i,o,r,a,l,d,c,h,u,p,m,g){(0,_.setCellExecutor)(i);const f=p!==null&&p!==void 0?p:k.nullTranslator;const v=u!==null&&u!==void 0?u:new s.SessionContextDialogs({translator:f});const b=f.load("jupyterlab");const y=e.serviceManager;const{commands:w,shell:C}=e;const x=new _.NotebookTracker({namespace:"notebook"});function S(e,t){if(t.hash&&x.currentWidget){x.currentWidget.setFragment(t.hash)}}c===null||c===void 0?void 0:c.routed.connect(S);const I=()=>Re.isEnabled(C,x);const M=e=>document.documentElement.style.setProperty("--jp-side-by-side-output-size",`${e}fr`);const D=h?h.load(te.id):Promise.reject(new Error(`No setting registry for ${te.id}`));D.then((t=>{O(t);t.changed.connect((()=>{O(t);w.notifyCommandChanged(Y.virtualScrollbar)}));const i=(e,n)=>{const{newValue:i,oldValue:s}=n;const o=i.autoStartDefault;if(typeof o==="boolean"&&o!==s.autoStartDefault){if(o!==t.get("autoStartDefaultKernel").composite)t.set("autoStartDefaultKernel",o).catch((e=>{console.error(`Failed to set ${t.id}.autoStartDefaultKernel`)}))}};const o=new WeakSet;const r=e=>{const t=e.context.sessionContext;if(!t.isDisposed&&!o.has(t)){o.add(t);t.kernelPreferenceChanged.connect(i);t.disposed.connect((()=>{t.kernelPreferenceChanged.disconnect(i)}))}};x.forEach(r);x.widgetAdded.connect(((e,t)=>{r(t)}));w.addCommand(Y.autoClosingBrackets,{execute:e=>{var n;const i=t.get("codeCellConfig").composite;const s=t.get("markdownCellConfig").composite;const o=t.get("rawCellConfig").composite;const r=i.autoClosingBrackets||s.autoClosingBrackets||o.autoClosingBrackets;const a=!!((n=e["force"])!==null&&n!==void 0?n:!r);[i.autoClosingBrackets,s.autoClosingBrackets,o.autoClosingBrackets]=[a,a,a];void t.set("codeCellConfig",i);void t.set("markdownCellConfig",s);void t.set("rawCellConfig",o)},label:b.__("Auto Close Brackets for All Notebook Cell Types"),isToggled:()=>["codeCellConfig","markdownCellConfig","rawCellConfig"].some((e=>{var i;return((i=t.get(e).composite.autoClosingBrackets)!==null&&i!==void 0?i:n.baseConfiguration["autoClosingBrackets"])===true}))});w.addCommand(Y.setSideBySideRatio,{label:b.__("Set side-by-side ratio"),execute:e=>{s.InputDialog.getNumber({title:b.__("Width of the output in side-by-side mode"),value:t.get("sideBySideOutputRatio").composite}).then((e=>{M(e.value);if(e.value){void t.set("sideBySideOutputRatio",e.value)}})).catch(console.error)}});Ae(e,x,f,v,t,I)})).catch((n=>{console.warn(n.message);N({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault});Ae(e,x,f,v,null,I)}));if(m){const e=m.getRenderer("@jupyterlab/codemirror-extension:plugin.defaultConfig");if(e){m.addRenderer("@jupyterlab/notebook-extension:tracker.codeCellConfig",e);m.addRenderer("@jupyterlab/notebook-extension:tracker.markdownCellConfig",e);m.addRenderer("@jupyterlab/notebook-extension:tracker.rawCellConfig",e)}}if(l){void l.restore(x,{command:"docmanager:open",args:e=>({path:e.context.path,factory:X}),name:e=>e.context.path,when:y.ready})}const A=e.docRegistry;const P=new _.NotebookModelFactory({disableDocumentWideUndoRedo:t.notebookConfig.disableDocumentWideUndoRedo,collaborative:true});A.addModelFactory(P);if(o){Pe(o,f)}let L=0;const R=e.docRegistry.getFileType("notebook");t.widgetCreated.connect(((e,t)=>{var n,i;t.id=t.id||`notebook-${++L}`;t.title.icon=R===null||R===void 0?void 0:R.icon;t.title.iconClass=(n=R===null||R===void 0?void 0:R.iconClass)!==null&&n!==void 0?n:"";t.title.iconLabel=(i=R===null||R===void 0?void 0:R.iconLabel)!==null&&i!==void 0?i:"";t.context.pathChanged.connect((()=>{void x.save(t)}));void x.add(t)}));function N(e){x.forEach((t=>{t.setConfig(e)}));if(e.notebookConfig.windowingMode!=="full"){x.forEach((e=>{if(e.content.scrollbar){e.content.scrollbar=false}}))}}function O(e){const n={..._.StaticNotebook.defaultEditorConfig.code,...e.get("codeCellConfig").composite};const i={..._.StaticNotebook.defaultEditorConfig.markdown,...e.get("markdownCellConfig").composite};const s={..._.StaticNotebook.defaultEditorConfig.raw,...e.get("rawCellConfig").composite};t.editorConfig={code:n,markdown:i,raw:s};t.notebookConfig={enableKernelInitNotification:e.get("enableKernelInitNotification").composite,autoRenderMarkdownCells:e.get("autoRenderMarkdownCells").composite,showHiddenCellsButton:e.get("showHiddenCellsButton").composite,scrollPastEnd:e.get("scrollPastEnd").composite,defaultCell:e.get("defaultCell").composite,recordTiming:e.get("recordTiming").composite,overscanCount:e.get("overscanCount").composite,showInputPlaceholder:e.get("showInputPlaceholder").composite,inputHistoryScope:e.get("inputHistoryScope").composite,maxNumberOutputs:e.get("maxNumberOutputs").composite,showEditorForReadOnlyMarkdown:e.get("showEditorForReadOnlyMarkdown").composite,disableDocumentWideUndoRedo:!e.get("documentWideUndoRedo").composite,renderingLayout:e.get("renderingLayout").composite,sideBySideLeftMarginOverride:e.get("sideBySideLeftMarginOverride").composite,sideBySideRightMarginOverride:e.get("sideBySideRightMarginOverride").composite,sideBySideOutputRatio:e.get("sideBySideOutputRatio").composite,windowingMode:e.get("windowingMode").composite,accessKernelHistory:e.get("accessKernelHistory").composite};M(t.notebookConfig.sideBySideOutputRatio);const o=`.jp-mod-sideBySide.jp-Notebook .jp-Notebook-cell {\n margin-left: ${t.notebookConfig.sideBySideLeftMarginOverride} !important;\n margin-right: ${t.notebookConfig.sideBySideRightMarginOverride} !important;`;const r=document.getElementById(ee);if(r){r.innerText=o}else{document.head.insertAdjacentHTML("beforeend",``)}t.autoStartDefault=e.get("autoStartDefaultKernel").composite;t.shutdownOnClose=e.get("kernelShutdown").composite;P.disableDocumentWideUndoRedo=!e.get("documentWideUndoRedo").composite;N({editorConfig:t.editorConfig,notebookConfig:t.notebookConfig,kernelShutdown:t.shutdownOnClose,autoStartDefault:t.autoStartDefault})}if(d){Le(d,I)}const B=async(e,t,n)=>{const i=await w.execute("docmanager:new-untitled",{path:e,type:"notebook"});if(i!==undefined){const e=await w.execute("docmanager:open",{path:i.path,factory:X,kernel:{id:t,name:n}});e.isUntitled=true;return e}};w.addCommand(Y.createNew,{label:e=>{var t,n,i;const s=e["kernelName"]||"";if(e["isLauncher"]&&e["kernelName"]&&y.kernelspecs){return(i=(n=(t=y.kernelspecs.specs)===null||t===void 0?void 0:t.kernelspecs[s])===null||n===void 0?void 0:n.display_name)!==null&&i!==void 0?i:""}if(e["isPalette"]||e["isContextMenu"]){return b.__("New Notebook")}return b.__("Notebook")},caption:b.__("Create a new notebook"),icon:e=>e["isPalette"]?undefined:j.notebookIcon,execute:e=>{var t,n;const i=(t=g===null||g===void 0?void 0:g.tracker.currentWidget)!==null&&t!==void 0?t:r;const s=e["cwd"]||((n=i===null||i===void 0?void 0:i.model.path)!==null&&n!==void 0?n:"");const o=e["kernelId"]||"";const a=e["kernelName"]||"";return B(s,o,a)}});if(a){void y.ready.then((()=>{let e=null;const t=()=>{if(e){e.dispose();e=null}const t=y.kernelspecs.specs;if(!t){return}e=new T.DisposableSet;for(const n in t.kernelspecs){const i=n===t.default?0:Infinity;const s=t.kernelspecs[n];const o=s.resources["logo-svg"]||s.resources["logo-64x64"];e.add(a.add({command:Y.createNew,args:{isLauncher:true,kernelName:n},category:b.__("Notebook"),rank:i,kernelIconUrl:o,metadata:{kernel:E.JSONExt.deepCopy(s.metadata||{})}}))}};t();y.kernelspecs.specsChanged.connect(t)}))}return x}function Te(e,t,n,i,o){if(!n){return}const r=(i!==null&&i!==void 0?i:k.nullTranslator).load("jupyterlab");const a=o!==null&&o!==void 0?o:new s.Sanitizer;e.commands.addCommand(Y.invokeCompleter,{label:r.__("Display the completion helper."),execute:e=>{var i;const s=t.currentWidget;if(s&&((i=s.content.activeCell)===null||i===void 0?void 0:i.model.type)==="code"){n.invoke(s.id)}}});e.commands.addCommand(Y.selectCompleter,{label:r.__("Select the completion suggestion."),execute:()=>{const e=t.currentWidget&&t.currentWidget.id;if(e){return n.select(e)}}});e.commands.addKeyBinding({command:Y.selectCompleter,keys:["Enter"],selector:".jp-Notebook .jp-mod-completer-active"});const l=async(e,t)=>{var i,s;const o={editor:(s=(i=t.content.activeCell)===null||i===void 0?void 0:i.editor)!==null&&s!==void 0?s:null,session:t.sessionContext.session,widget:t,sanitizer:a};await n.updateCompleter(o);t.content.activeCellChanged.connect(((e,i)=>{i===null||i===void 0?void 0:i.ready.then((()=>{const e={editor:i.editor,session:t.sessionContext.session,widget:t,sanitizer:a};return n.updateCompleter(e)})).catch(console.error)}));t.sessionContext.sessionChanged.connect((()=>{var e;(e=t.content.activeCell)===null||e===void 0?void 0:e.ready.then((()=>{var e,i;const s={editor:(i=(e=t.content.activeCell)===null||e===void 0?void 0:e.editor)!==null&&i!==void 0?i:null,session:t.sessionContext.session,widget:t};return n.updateCompleter(s)})).catch(console.error)}))};t.widgetAdded.connect(l);n.activeProvidersChanged.connect((()=>{t.forEach((e=>{l(undefined,e).catch((e=>console.error(e)))}))}))}function Me(e,t,n,i,s,o){t.widgetAdded.connect((async(e,t)=>{const r=new _.NotebookAdapter(t,{connectionManager:n,featureManager:i,foreignCodeExtractorsManager:s});o.add(r)}))}function De(e,t,n){var i,o;let r=null;if(n[A.CellBarExtension.WIDGET_ID_ARG]){r=(i=e.find((e=>e.id===n[A.CellBarExtension.WIDGET_ID_ARG])))!==null&&i!==void 0?i:null}else if(n[s.SemanticCommand.WIDGET]){r=(o=e.find((e=>e.id===n[s.SemanticCommand.WIDGET])))!==null&&o!==void 0?o:null}else{r=e.currentWidget}const a=n["activate"]!==false;if(a&&r){t.activateById(r.id)}return r}function Ae(e,t,n,i,r,a){var l;const d=n.load("jupyterlab");const{commands:c,shell:h}=e;const u=()=>Re.isEnabledAndSingleSelected(h,t);const p=e=>{var t,n;for(const i of e.widgets){if(i instanceof o.MarkdownCell&&i.headingCollapsed){_.NotebookActions.setHeadingCollapse(i,true,e)}if(i.model.id===((n=(t=e.activeCell)===null||t===void 0?void 0:t.model)===null||n===void 0?void 0:n.id)){_.NotebookActions.expandParent(i,e)}}};const m=()=>Re.isEnabledAndHeadingSelected(h,t);t.currentChanged.connect(((e,t)=>{var n,i;if(!((i=(n=t===null||t===void 0?void 0:t.content)===null||n===void 0?void 0:n.model)===null||i===void 0?void 0:i.cells)){return}t.content.model.cells.changed.connect(((e,n)=>{p(t.content)}));t.content.activeCellChanged.connect(((e,t)=>{_.NotebookActions.expandParent(t,e)}))}));t.selectionChanged.connect((()=>{c.notifyCommandChanged(Y.duplicateBelow);c.notifyCommandChanged(Y.deleteCell);c.notifyCommandChanged(Y.copy);c.notifyCommandChanged(Y.cut);c.notifyCommandChanged(Y.pasteBelow);c.notifyCommandChanged(Y.pasteAbove);c.notifyCommandChanged(Y.pasteAndReplace);c.notifyCommandChanged(Y.moveUp);c.notifyCommandChanged(Y.moveDown);c.notifyCommandChanged(Y.run);c.notifyCommandChanged(Y.runAll);c.notifyCommandChanged(Y.runAndAdvance);c.notifyCommandChanged(Y.runAndInsert)}));t.activeCellChanged.connect((()=>{c.notifyCommandChanged(Y.moveUp);c.notifyCommandChanged(Y.moveDown)}));c.addCommand(Y.runAndAdvance,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Run Selected Cell","Run Selected Cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Run this cell and advance","Run these %1 cells and advance",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const s=De(t,h,e);if(s){const{context:e,content:t}=s;return _.NotebookActions.runAndAdvance(t,e.sessionContext,i,n)}},isEnabled:e=>e.toolbar?true:a(),icon:e=>e.toolbar?j.runIcon:undefined});c.addCommand(Y.run,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Run Selected Cell and Do not Advance","Run Selected Cells and Do not Advance",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const s=De(t,h,e);if(s){const{context:e,content:t}=s;return _.NotebookActions.run(t,e.sessionContext,i,n)}},isEnabled:a});c.addCommand(Y.runAndInsert,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Run Selected Cell and Insert Below","Run Selected Cells and Insert Below",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const s=De(t,h,e);if(s){const{context:e,content:t}=s;return _.NotebookActions.runAndInsert(t,e.sessionContext,i,n)}},isEnabled:a});c.addCommand(Y.runAll,{label:d.__("Run All Cells"),caption:d.__("Run all cells"),execute:e=>{const s=De(t,h,e);if(s){const{context:e,content:t}=s;return _.NotebookActions.runAll(t,e.sessionContext,i,n)}},isEnabled:a});c.addCommand(Y.runAllAbove,{label:d.__("Run All Above Selected Cell"),execute:e=>{const s=De(t,h,e);if(s){const{context:e,content:t}=s;return _.NotebookActions.runAllAbove(t,e.sessionContext,i,n)}},isEnabled:()=>u()&&t.currentWidget.content.activeCellIndex!==0});c.addCommand(Y.runAllBelow,{label:d.__("Run Selected Cell and All Below"),execute:e=>{const s=De(t,h,e);if(s){const{context:e,content:t}=s;return _.NotebookActions.runAllBelow(t,e.sessionContext,i,n)}},isEnabled:()=>u()&&(t.currentWidget.content.widgets.length===1||t.currentWidget.content.activeCellIndex!==t.currentWidget.content.widgets.length-1)});c.addCommand(Y.renderAllMarkdown,{label:d.__("Render All Markdown Cells"),execute:e=>{const n=De(t,h,e);if(n){const{content:e}=n;return _.NotebookActions.renderAllMarkdown(e)}},isEnabled:a});c.addCommand(Y.restart,{label:d.__("Restart Kernel…"),caption:d.__("Restart the kernel"),execute:e=>{const n=De(t,h,e);if(n){return i.restart(n.sessionContext)}},isEnabled:e=>e.toolbar?true:a(),icon:e=>e.toolbar?j.refreshIcon:undefined});c.addCommand(Y.shutdown,{label:d.__("Shut Down Kernel"),execute:e=>{const n=De(t,h,e);if(!n){return}return n.context.sessionContext.shutdown()},isEnabled:a});c.addCommand(Y.closeAndShutdown,{label:d.__("Close and Shut Down Notebook…"),execute:e=>{const n=De(t,h,e);if(!n){return}const i=n.title.label;return(0,s.showDialog)({title:d.__("Shut down the notebook?"),body:d.__('Are you sure you want to close "%1"?',i),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton()]}).then((e=>{if(e.button.accept){return c.execute(Y.shutdown,{activate:false}).then((()=>{n.dispose()}))}}))},isEnabled:a});c.addCommand(Y.trust,{label:()=>d.__("Trust Notebook"),execute:e=>{const n=De(t,h,e);if(n){const{context:e,content:t}=n;return _.NotebookActions.trust(t).then((()=>e.save()))}},isEnabled:a});c.addCommand(Y.restartClear,{label:d.__("Restart Kernel and Clear Outputs of All Cells…"),caption:d.__("Restart the kernel and clear all outputs of all cells"),execute:async()=>{const e=await c.execute(Y.restart,{activate:false});if(e){await c.execute(Y.clearAllOutputs)}},isEnabled:a});c.addCommand(Y.restartAndRunToSelected,{label:d.__("Restart Kernel and Run up to Selected Cell…"),execute:async e=>{const s=De(t,h,{activate:false,...e});if(!s){return}const{context:o,content:r}=s;const a=r.widgets.slice(0,r.activeCellIndex+1);const l=await i.restart(s.sessionContext);if(l){return _.NotebookActions.runCells(r,a,o.sessionContext,i,n)}},isEnabled:u});c.addCommand(Y.restartRunAll,{label:d.__("Restart Kernel and Run All Cells…"),caption:d.__("Restart the kernel and run all cells"),execute:async e=>{const s=De(t,h,{activate:false,...e});if(!s){return}const{context:o,content:r}=s;const a=r.widgets;const l=await i.restart(s.sessionContext);if(l){return _.NotebookActions.runCells(r,a,o.sessionContext,i,n)}},isEnabled:e=>e.toolbar?true:a(),icon:e=>e.toolbar?j.fastForwardIcon:undefined});c.addCommand(Y.clearAllOutputs,{label:d.__("Clear Outputs of All Cells"),caption:d.__("Clear all outputs of all cells"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.clearAllOutputs(n.content)}},isEnabled:a});c.addCommand(Y.clearOutputs,{label:d.__("Clear Cell Output"),caption:d.__("Clear outputs for the selected cells"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.clearOutputs(n.content)}},isEnabled:a});c.addCommand(Y.interrupt,{label:d.__("Interrupt Kernel"),caption:d.__("Interrupt the kernel"),execute:e=>{var n;const i=De(t,h,e);if(!i){return}const s=(n=i.context.sessionContext.session)===null||n===void 0?void 0:n.kernel;if(s){return s.interrupt()}},isEnabled:e=>e.toolbar?true:a(),icon:e=>e.toolbar?j.stopIcon:undefined});c.addCommand(Y.toCode,{label:d.__("Change to Code Cell Type"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.changeCellType(i.content,"code",n)}},isEnabled:a});c.addCommand(Y.toMarkdown,{label:d.__("Change to Markdown Cell Type"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.changeCellType(i.content,"markdown",n)}},isEnabled:a});c.addCommand(Y.toRaw,{label:d.__("Change to Raw Cell Type"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.changeCellType(i.content,"raw",n)}},isEnabled:a});c.addCommand(Y.cut,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Cut Cell","Cut Cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Cut this cell","Cut these %1 cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.cut(n.content)}},icon:e=>e.toolbar?j.cutIcon:undefined,isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.copy,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Copy Cell","Copy Cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Copy this cell","Copy these %1 cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.copy(n.content)}},icon:e=>e.toolbar?j.copyIcon:undefined,isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.pasteBelow,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Paste Cell Below","Paste Cells Below",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.paste(n.content,"below")}},icon:e=>e.toolbar?j.pasteIcon:undefined,isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.pasteAbove,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Paste Cell Above","Paste Cells Above",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Paste this cell from the clipboard","Paste these %1 cells from the clipboard",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.paste(n.content,"above")}},isEnabled:a});c.addCommand(Y.duplicateBelow,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Duplicate Cell Below","Duplicate Cells Below",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Create a duplicate of this cell below","Create duplicates of %1 cells below",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){_.NotebookActions.duplicate(n.content,"belowSelected")}},icon:e=>e.toolbar?j.duplicateIcon:undefined,isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.pasteAndReplace,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Paste Cell and Replace","Paste Cells and Replace",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.paste(n.content,"replace")}},isEnabled:a});c.addCommand(Y.deleteCell,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Delete Cell","Delete Cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Delete this cell","Delete these %1 cells",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.deleteCells(n.content)}},isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.split,{label:d.__("Split Cell"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.splitCell(n.content)}},isEnabled:a});c.addCommand(Y.merge,{label:d.__("Merge Selected Cells"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.mergeCells(n.content)}},isEnabled:a});c.addCommand(Y.mergeAbove,{label:d.__("Merge Cell Above"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.mergeCells(n.content,true)}},isEnabled:a});c.addCommand(Y.mergeBelow,{label:d.__("Merge Cell Below"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.mergeCells(n.content,false)}},isEnabled:a});c.addCommand(Y.insertAbove,{label:d.__("Insert Cell Above"),caption:d.__("Insert a cell above"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.insertAbove(n.content)}},icon:e=>e.toolbar?j.addAboveIcon:undefined,isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.insertBelow,{label:d.__("Insert Cell Below"),caption:d.__("Insert a cell below"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.insertBelow(n.content)}},icon:e=>e.toolbar?j.addBelowIcon:undefined,isEnabled:e=>e.toolbar?true:a()});c.addCommand(Y.selectAbove,{label:d.__("Select Cell Above"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.selectAbove(n.content)}},isEnabled:a});c.addCommand(Y.selectBelow,{label:d.__("Select Cell Below"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.selectBelow(n.content)}},isEnabled:a});c.addCommand(Y.insertHeadingAbove,{label:d.__("Insert Heading Above Current Heading"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.insertSameLevelHeadingAbove(n.content)}},isEnabled:a});c.addCommand(Y.insertHeadingBelow,{label:d.__("Insert Heading Below Current Heading"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.insertSameLevelHeadingBelow(n.content)}},isEnabled:a});c.addCommand(Y.selectHeadingAboveOrCollapse,{label:d.__("Select Heading Above or Collapse Heading"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.selectHeadingAboveOrCollapseHeading(n.content)}},isEnabled:a});c.addCommand(Y.selectHeadingBelowOrExpand,{label:d.__("Select Heading Below or Expand Heading"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.selectHeadingBelowOrExpandHeading(n.content)}},isEnabled:a});c.addCommand(Y.extendAbove,{label:d.__("Extend Selection Above"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.extendSelectionAbove(n.content)}},isEnabled:a});c.addCommand(Y.extendTop,{label:d.__("Extend Selection to Top"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.extendSelectionAbove(n.content,true)}},isEnabled:a});c.addCommand(Y.extendBelow,{label:d.__("Extend Selection Below"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.extendSelectionBelow(n.content)}},isEnabled:a});c.addCommand(Y.extendBottom,{label:d.__("Extend Selection to Bottom"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.extendSelectionBelow(n.content,true)}},isEnabled:a});c.addCommand(Y.selectAll,{label:d.__("Select All Cells"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.selectAll(n.content)}},isEnabled:a});c.addCommand(Y.deselectAll,{label:d.__("Deselect All Cells"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.deselectAll(n.content)}},isEnabled:a});c.addCommand(Y.moveUp,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Move Cell Up","Move Cells Up",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Move this cell up","Move these %1 cells up",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){_.NotebookActions.moveUp(n.content);Re.raiseSilentNotification(d.__("Notebook cell shifted up successfully"),n.node)}},isEnabled:e=>{const n=De(t,h,{...e,activate:false});if(!n){return false}return n.content.activeCellIndex>=1},icon:e=>e.toolbar?j.moveUpIcon:undefined});c.addCommand(Y.moveDown,{label:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Move Cell Down","Move Cells Down",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},caption:e=>{var n;const i=De(t,h,{...e,activate:false});return d._n("Move this cell down","Move these %1 cells down",(n=i===null||i===void 0?void 0:i.content.selectedCells.length)!==null&&n!==void 0?n:1)},execute:e=>{const n=De(t,h,e);if(n){_.NotebookActions.moveDown(n.content);Re.raiseSilentNotification(d.__("Notebook cell shifted down successfully"),n.node)}},isEnabled:e=>{const n=De(t,h,{...e,activate:false});if(!n||!n.content.model){return false}const i=n.content.model.cells.length;return n.content.activeCellIndexe.toolbar?j.moveDownIcon:undefined});c.addCommand(Y.toggleAllLines,{label:d.__("Show Line Numbers"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.toggleAllLineNumbers(n.content)}},isEnabled:a,isToggled:e=>{const n=De(t,h,{...e,activate:false});if(n){const e=n.content.editorConfig;return!!(e.code.lineNumbers&&e.markdown.lineNumbers&&e.raw.lineNumbers)}else{return false}}});c.addCommand(Y.commandMode,{label:d.__("Enter Command Mode"),execute:e=>{const n=De(t,h,e);if(n){n.content.mode="command"}},isEnabled:a});c.addCommand(Y.editMode,{label:d.__("Enter Edit Mode"),execute:e=>{const n=De(t,h,e);if(n){n.content.mode="edit"}},isEnabled:a});c.addCommand(Y.undoCellAction,{label:d.__("Undo Cell Operation"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.undo(n.content)}},isEnabled:a});c.addCommand(Y.redoCellAction,{label:d.__("Redo Cell Operation"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.redo(n.content)}},isEnabled:a});c.addCommand(Y.redo,{label:d.__("Redo"),execute:e=>{var n;const i=De(t,h,e);if(i){const e=i.content.activeCell;if(e){e.inputHidden=false;return(n=e.editor)===null||n===void 0?void 0:n.redo()}}}});c.addCommand(Y.undo,{label:d.__("Undo"),execute:e=>{var n;const i=De(t,h,e);if(i){const e=i.content.activeCell;if(e){e.inputHidden=false;return(n=e.editor)===null||n===void 0?void 0:n.undo()}}}});c.addCommand(Y.changeKernel,{label:d.__("Change Kernel…"),execute:e=>{const n=De(t,h,e);if(n){return i.selectKernel(n.context.sessionContext)}},isEnabled:a});c.addCommand(Y.getKernel,{label:d.__("Get Kernel"),execute:e=>{var n;const i=De(t,h,{activate:false,...e});if(i){return(n=i.sessionContext.session)===null||n===void 0?void 0:n.kernel}},isEnabled:a});c.addCommand(Y.reconnectToKernel,{label:d.__("Reconnect to Kernel"),execute:e=>{var n;const i=De(t,h,e);if(!i){return}const s=(n=i.context.sessionContext.session)===null||n===void 0?void 0:n.kernel;if(s){return s.reconnect()}},isEnabled:a});c.addCommand(Y.markdown1,{label:d.__("Change to Heading 1"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.setMarkdownHeader(i.content,1,n)}},isEnabled:a});c.addCommand(Y.markdown2,{label:d.__("Change to Heading 2"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.setMarkdownHeader(i.content,2,n)}},isEnabled:a});c.addCommand(Y.markdown3,{label:d.__("Change to Heading 3"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.setMarkdownHeader(i.content,3,n)}},isEnabled:a});c.addCommand(Y.markdown4,{label:d.__("Change to Heading 4"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.setMarkdownHeader(i.content,4,n)}},isEnabled:a});c.addCommand(Y.markdown5,{label:d.__("Change to Heading 5"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.setMarkdownHeader(i.content,5,n)}},isEnabled:a});c.addCommand(Y.markdown6,{label:d.__("Change to Heading 6"),execute:e=>{const i=De(t,h,e);if(i){return _.NotebookActions.setMarkdownHeader(i.content,6,n)}},isEnabled:a});c.addCommand(Y.hideCode,{label:d.__("Collapse Selected Code"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.hideCode(n.content)}},isEnabled:a});c.addCommand(Y.showCode,{label:d.__("Expand Selected Code"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.showCode(n.content)}},isEnabled:a});c.addCommand(Y.hideAllCode,{label:d.__("Collapse All Code"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.hideAllCode(n.content)}},isEnabled:a});c.addCommand(Y.showAllCode,{label:d.__("Expand All Code"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.showAllCode(n.content)}},isEnabled:a});c.addCommand(Y.hideOutput,{label:d.__("Collapse Selected Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.hideOutput(n.content)}},isEnabled:a});c.addCommand(Y.showOutput,{label:d.__("Expand Selected Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.showOutput(n.content)}},isEnabled:a});c.addCommand(Y.toggleOutput,{label:d.__("Toggle Visibility of Selected Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.toggleOutput(n.content)}},isEnabled:a});c.addCommand(Y.hideAllOutputs,{label:d.__("Collapse All Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.hideAllOutputs(n.content)}},isEnabled:a});c.addCommand(Y.toggleRenderSideBySideCurrentNotebook,{label:d.__("Render Side-by-Side"),execute:e=>{const n=De(t,h,e);if(n){if(n.content.renderingLayout==="side-by-side"){return _.NotebookActions.renderDefault(n.content)}return _.NotebookActions.renderSideBySide(n.content)}},isEnabled:a,isToggled:e=>{const n=De(t,h,{...e,activate:false});if(n){return n.content.renderingLayout==="side-by-side"}else{return false}}});c.addCommand(Y.showAllOutputs,{label:d.__("Expand All Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.showAllOutputs(n.content)}},isEnabled:a});c.addCommand(Y.enableOutputScrolling,{label:d.__("Enable Scrolling for Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.enableOutputScrolling(n.content)}},isEnabled:a});c.addCommand(Y.disableOutputScrolling,{label:d.__("Disable Scrolling for Outputs"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.disableOutputScrolling(n.content)}},isEnabled:a});c.addCommand(Y.selectLastRunCell,{label:d.__("Select current running or last run cell"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.selectLastRunCell(n.content)}},isEnabled:a});c.addCommand(Y.replaceSelection,{label:d.__("Replace Selection in Notebook Cell"),execute:e=>{const n=De(t,h,e);const i=e["text"]||"";if(n){return _.NotebookActions.replaceSelection(n.content,i)}},isEnabled:a});c.addCommand(Y.toggleCollapseCmd,{label:d.__("Toggle Collapse Notebook Heading"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.toggleCurrentHeadingCollapse(n.content)}},isEnabled:m});c.addCommand(Y.collapseAllCmd,{label:d.__("Collapse All Headings"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.collapseAllHeadings(n.content)}}});c.addCommand(Y.expandAllCmd,{label:d.__("Expand All Headings"),execute:e=>{const n=De(t,h,e);if(n){return _.NotebookActions.expandAllHeadings(n.content)}}});c.addCommand(Y.tocRunCells,{label:d.__("Select and Run Cell(s) for this Heading"),execute:e=>{const s=De(t,h,{activate:false,...e});if(s===null){return}const r=s.content.activeCell;let a=s.content.activeCellIndex;if(r instanceof o.MarkdownCell){const e=s.content.widgets;const t=r.headingInfo.level;for(let n=s.content.activeCellIndex+1;n=0&&i.headingInfo.level<=t){break}a=n}}s.content.extendContiguousSelectionTo(a);void _.NotebookActions.run(s.content,s.sessionContext,i,n)}});c.addCommand(Y.accessPreviousHistory,{label:d.__("Access Previous Kernel History Entry"),execute:async e=>{const n=De(t,h,e);if(n){return await _.NotebookActions.accessPreviousHistory(n.content)}}});c.addCommand(Y.accessNextHistory,{label:d.__("Access Next Kernel History Entry"),execute:async e=>{const n=De(t,h,e);if(n){return await _.NotebookActions.accessNextHistory(n.content)}}});c.addCommand(Y.virtualScrollbar,{label:d.__("Show Minimap"),caption:d.__("Show Minimap (virtual scrollbar, enabled with windowing mode: full)"),execute:e=>{const n=De(t,h,e);if(n){n.content.scrollbar=!n.content.scrollbar}},icon:e=>e.toolbar?j.tableRowsIcon:undefined,isEnabled:e=>{var t;const n=(e.toolbar?true:a())&&((t=(r===null||r===void 0?void 0:r.composite.windowingMode)==="full")!==null&&t!==void 0?t:false);return n},isToggled:()=>{var e;const n=t.currentWidget;return(e=n===null||n===void 0?void 0:n.content.scrollbar)!==null&&e!==void 0?e:false},isVisible:e=>{var t;const n=(e.toolbar?true:a())&&((t=(r===null||r===void 0?void 0:r.composite.windowingMode)==="full")!==null&&t!==void 0?t:false);return n}});const g=[Y.createNew,Y.createOutputView];const f=()=>{Object.values(Y).filter((t=>!g.includes(t)&&e.commands.hasCommand(t))).forEach((t=>e.commands.notifyCommandChanged(t)))};t.currentChanged.connect(f);(l=h.currentChanged)===null||l===void 0?void 0:l.connect(f)}function Pe(e,t){const n=t.load("jupyterlab");let i=n.__("Notebook Operations");[Y.interrupt,Y.restart,Y.restartClear,Y.restartRunAll,Y.runAll,Y.renderAllMarkdown,Y.runAllAbove,Y.runAllBelow,Y.restartAndRunToSelected,Y.selectAll,Y.deselectAll,Y.clearAllOutputs,Y.toggleAllLines,Y.editMode,Y.commandMode,Y.changeKernel,Y.reconnectToKernel,Y.createConsole,Y.createSubshellConsole,Y.closeAndShutdown,Y.trust,Y.toggleCollapseCmd,Y.collapseAllCmd,Y.expandAllCmd,Y.accessPreviousHistory,Y.accessNextHistory,Y.virtualScrollbar].forEach((t=>{e.addItem({command:t,category:i})}));e.addItem({command:Y.createNew,category:i,args:{isPalette:true}});i=n.__("Notebook Cell Operations");[Y.run,Y.runAndAdvance,Y.runAndInsert,Y.runInConsole,Y.clearOutputs,Y.toCode,Y.toMarkdown,Y.toRaw,Y.cut,Y.copy,Y.pasteBelow,Y.pasteAbove,Y.pasteAndReplace,Y.deleteCell,Y.split,Y.merge,Y.mergeAbove,Y.mergeBelow,Y.insertAbove,Y.insertBelow,Y.selectAbove,Y.selectBelow,Y.selectHeadingAboveOrCollapse,Y.selectHeadingBelowOrExpand,Y.insertHeadingAbove,Y.insertHeadingBelow,Y.extendAbove,Y.extendTop,Y.extendBelow,Y.extendBottom,Y.moveDown,Y.moveUp,Y.undoCellAction,Y.redoCellAction,Y.markdown1,Y.markdown2,Y.markdown3,Y.markdown4,Y.markdown5,Y.markdown6,Y.hideCode,Y.showCode,Y.hideAllCode,Y.showAllCode,Y.hideOutput,Y.showOutput,Y.toggleOutput,Y.hideAllOutputs,Y.showAllOutputs,Y.toggleRenderSideBySideCurrentNotebook,Y.setSideBySideRatio,Y.enableOutputScrolling,Y.disableOutputScrolling].forEach((t=>{e.addItem({command:t,category:i})}))}function Le(e,t){e.editMenu.undoers.redo.add({id:Y.redo,isEnabled:t});e.editMenu.undoers.undo.add({id:Y.undo,isEnabled:t});e.editMenu.clearers.clearAll.add({id:Y.clearAllOutputs,isEnabled:t});e.editMenu.clearers.clearCurrent.add({id:Y.clearOutputs,isEnabled:t});e.fileMenu.consoleCreators.add({id:Y.createConsole,isEnabled:t});e.fileMenu.closeAndCleaners.add({id:Y.closeAndShutdown,isEnabled:t});e.kernelMenu.kernelUsers.changeKernel.add({id:Y.changeKernel,isEnabled:t});e.kernelMenu.kernelUsers.clearWidget.add({id:Y.clearAllOutputs,isEnabled:t});e.kernelMenu.kernelUsers.interruptKernel.add({id:Y.interrupt,isEnabled:t});e.kernelMenu.kernelUsers.reconnectToKernel.add({id:Y.reconnectToKernel,isEnabled:t});e.kernelMenu.kernelUsers.restartKernel.add({id:Y.restart,isEnabled:t});e.kernelMenu.kernelUsers.shutdownKernel.add({id:Y.shutdown,isEnabled:t});e.viewMenu.editorViewers.toggleLineNumbers.add({id:Y.toggleAllLines,isEnabled:t});e.runMenu.codeRunners.restart.add({id:Y.restart,isEnabled:t});e.runMenu.codeRunners.run.add({id:Y.runAndAdvance,isEnabled:t});e.runMenu.codeRunners.runAll.add({id:Y.runAll,isEnabled:t});e.helpMenu.getKernel.add({id:Y.getKernel,isEnabled:t})}var Re;(function(e){function t(e,t,n,i){const s={path:t.context.path,preferredLanguage:t.context.model.defaultKernelLanguage,activate:n,subshell:i,ref:t.id,insertMode:"split-bottom",type:"Linked Console"};return e.execute("console:create",s)}e.createConsole=t;function n(e,t){return t.currentWidget!==null&&t.currentWidget===e.currentWidget}e.isEnabled=n;function i(t,n){if(!e.isEnabled(t,n)){return false}const{content:i}=n.currentWidget;const s=i.activeCellIndex;for(let e=0;e{if(!this._cell){this._cell=this._notebook.content.widgets[this._index]}if(!this._cell||this._cell.model.type!=="code"){this.dispose();return}const e=this._cell.cloneOutputArea();this.addWidget(e)}))}get index(){return this._cell?I.ArrayExt.findFirstIndex(this._notebook.content.widgets,(e=>e===this._cell)):this._index}get path(){return this._notebook.context.path}}e.ClonedOutputArea=l})(Re||(Re={}))},90167:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(17325);var l=n(5893);var d=n(79010);var c=n(3579);var h=n(19562);var u=n(23359);var p=n(41603);var m=n(39063);var g=n(66731);var f=n(53377);var v=n(13137);var _=n(28006);var b=n(36060);var y=n(87779);var w=n(75797);var C=n(69704);var x=n(67996);var S=n(69540);var k=n(58130)},97846:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CellList:()=>b,CellTypeSwitcher:()=>S,CommandEditStatus:()=>N,ExecutionIndicator:()=>E,ExecutionIndicatorComponent:()=>I,INotebookCellExecutor:()=>Je,INotebookTools:()=>$e,INotebookTracker:()=>Ke,INotebookWidgetFactory:()=>qe,KernelError:()=>g,Notebook:()=>Pe,NotebookActions:()=>f,NotebookAdapter:()=>F,NotebookHistory:()=>T,NotebookModel:()=>P,NotebookModelFactory:()=>L,NotebookPanel:()=>Be,NotebookSearchProvider:()=>ze,NotebookToCFactory:()=>Ve,NotebookToCModel:()=>We,NotebookTools:()=>U,NotebookTracker:()=>Ge,NotebookTrustStatus:()=>Ze,NotebookViewModel:()=>ie,NotebookWidgetFactory:()=>et,NotebookWindowedLayout:()=>se,RunningStatus:()=>He,StaticNotebook:()=>De,ToolbarItems:()=>x,getIdForHeading:()=>Ue,runCell:()=>u,setCellExecutor:()=>v});var i=n(72050);var s=n(93681);var o=n(37737);var r=n(61927);var a=n(34236);var l=n(5592);var d=n(2336);var c=n(44914);var h=n.n(c);async function u({cell:e,notebook:t,notebookConfig:n,onCellExecuted:o,onCellExecutionScheduled:a,sessionContext:l,sessionDialogs:d,translator:c}){var h;c=c!==null&&c!==void 0?c:r.nullTranslator;const u=c.load("jupyterlab");switch(e.model.type){case"markdown":e.rendered=true;e.inputHidden=false;o({cell:e,success:true});break;case"code":if(l){if(l.isTerminating){await(0,i.showDialog)({title:u.__("Kernel Terminating"),body:u.__("The kernel for %1 appears to be terminating. You can not run any cell for now.",(h=l.session)===null||h===void 0?void 0:h.path),buttons:[i.Dialog.okButton()]});break}if(l.pendingInput){await(0,i.showDialog)({title:u.__("Cell not executed due to pending input"),body:u.__("The cell has not been executed to avoid kernel deadlock as there is another pending input! Type your input in the input box, press Enter and try again."),buttons:[i.Dialog.okButton()]});return false}if(l.hasNoKernel){const e=await l.startKernel();if(e&&d){await d.selectKernel(l)}}if(l.hasNoKernel){e.model.sharedModel.transact((()=>{e.model.clearExecution()}));return true}const r=t.deletedCells;a({cell:e});let c=false;try{const i=await s.CodeCell.execute(e,l,{deletedCells:r,recordTiming:n.recordTiming});r.splice(0,r.length);c=(()=>{if(e.isDisposed){return false}if(!i){return true}if(i.content.status==="ok"){const n=i.content;if(n.payload&&n.payload.length){p(n,t,e)}return true}else{throw new g(i.content)}})()}catch(m){if(e.isDisposed||m.message.startsWith("Canceled")){c=false}else{o({cell:e,success:false,error:m});throw m}}if(c){o({cell:e,success:true})}return c}e.model.sharedModel.transact((()=>{e.model.clearExecution()}),false);break;default:break}return Promise.resolve(true)}function p(e,t,n){var i;const s=(i=e.payload)===null||i===void 0?void 0:i.filter((e=>e.source==="set_next_input"))[0];if(!s){return}const o=s.text;const r=s.replace;if(r){n.model.sharedModel.setSource(o);return}const l=t.sharedModel;const d=t.cells;const c=(0,a.findIndex)(d,(e=>e===n.model));if(c===-1){l.insertCell(l.cells.length,{cell_type:"code",source:o,metadata:{trusted:false}})}else{l.insertCell(c+1,{cell_type:"code",source:o,metadata:{trusted:false}})}}const m="application/vnd.jupyter.cells";class g extends Error{constructor(e){const t=e;const n=t.ename;const i=t.evalue;super(`KernelReplyNotOK: ${n} ${i}`);this.errorName=n;this.errorValue=i;this.traceback=t.traceback;Object.setPrototypeOf(this,g.prototype)}}class f{static get executed(){return _.executed}static get executionScheduled(){return _.executionScheduled}static get selectionExecuted(){return _.selectionExecuted}static get outputCleared(){return _.outputCleared}constructor(){}}(function(e){function t(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.mode="edit";e.deselectAll();const n=e.model;const i=e.activeCellIndex;const o=e.widgets[i];const r=o.editor;if(!r){return}const a=r.getSelections();const l=o.model.sharedModel.getSource();const d=[0];let c=-1;let h=-1;for(let s=0;s{const{cell_type:n,metadata:i}=o.model.sharedModel.toJSON();return{cell_type:n,metadata:i,source:l.slice(e,d[t+1]).replace(/^\n+/,"").replace(/\n+$/,""),outputs:undefined}}));const p=d[d.length-2];const m=d[d.length-1];const g=l.slice(p,m).replace(/^\n+/,"").replace(/\n+$/,"");n.sharedModel.transact((()=>{if(u.length>0){n.sharedModel.insertCells(i,u)}o.model.sharedModel.setSource(g);if(o.model instanceof s.CodeCellModel){const e=o.model;if(e.executionState==="running"){e.isDirty=true}}}));let f;if(c!==h){let e=0;for(let t=0;t=d[t]&&c{var t;(t=e.activeCell)===null||t===void 0?void 0:t.editor.focus()})).catch((e=>{}));void _.handleState(e,t)}e.splitCell=t;function n(e,t=false){if(!e.model||!e.activeCell){return}const n=_.getState(e);const i=[];const o=[];const r=e.model;const a=r.cells;const l=e.activeCell;const d=e.activeCellIndex;const c={};e.widgets.forEach(((t,n)=>{if(e.isSelectedOrActive(t)){i.push(t.model.sharedModel.getSource());if(n!==d){o.push(n)}const e=t.model;if((0,s.isRawCellModel)(e)||(0,s.isMarkdownCellModel)(e)){for(const t of e.attachments.keys){c[t]=e.attachments.get(t).toJSON()}}}}));if(i.length===1){if(t===true){if(d===0){return}const e=a.get(d-1);i.unshift(e.sharedModel.getSource());o.push(d-1)}else if(t===false){if(d===a.length-1){return}const e=a.get(d+1);i.push(e.sharedModel.getSource());o.push(d+1)}}e.deselectAll();const h=l.model.sharedModel;const{cell_type:u,metadata:p}=h.toJSON();if(h.cell_type==="code"){p.trusted=true}const m={cell_type:u,metadata:p,source:i.join("\n\n"),attachments:h.cell_type==="markdown"||h.cell_type==="raw"?c:undefined};r.sharedModel.transact((()=>{r.sharedModel.deleteCell(d);r.sharedModel.insertCell(d,m);o.sort(((e,t)=>t-e)).forEach((e=>{r.sharedModel.deleteCell(e)}))}));if(l instanceof s.MarkdownCell){e.activeCell.rendered=false}void _.handleState(e,n)}e.mergeCells=n;function d(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);_.deleteCells(e);void _.handleState(e,t,true)}e.deleteCells=d;function h(e){if(!e.model){return}const t=_.getState(e);const n=e.model;const i=e.activeCell?e.activeCellIndex:0;n.sharedModel.insertCell(i,{cell_type:e.notebookConfig.defaultCell,metadata:e.notebookConfig.defaultCell==="code"?{trusted:true}:{}});e.activeCellIndex=i;e.deselectAll();void _.handleState(e,t,true)}e.insertAbove=h;function u(e){if(!e.model){return}const t=_.getState(e);const n=e.model;const i=e.activeCell?e.activeCellIndex+1:0;n.sharedModel.insertCell(i,{cell_type:e.notebookConfig.defaultCell,metadata:e.notebookConfig.defaultCell==="code"?{trusted:true}:{}});e.activeCellIndex=i;e.deselectAll();void _.handleState(e,t,true)}e.insertBelow=u;function p(e,t){if(!e.model||!e.activeCell){return}const n=_.getState(e);const i=e.widgets.findIndex((t=>e.isSelectedOrActive(t)));let s=e.widgets.slice(i+1).findIndex((t=>!e.isSelectedOrActive(t)));if(s>=0){s+=i+1}else{s=e.model.cells.length}if(t>0){e.moveCell(i,s,s-i)}else{e.moveCell(i,i+t,s-i)}void _.handleState(e,n,true)}function g(e){p(e,1)}e.moveDown=g;function f(e){p(e,-1)}e.moveUp=f;function v(e,t,n){if(!e.model||!e.activeCell){return}const i=_.getState(e);_.changeCellType(e,t,n);void _.handleState(e,i)}e.changeCellType=v;function b(e,t,n,i){if(!e.model||!e.activeCell){return Promise.resolve(false)}const s=_.getState(e);const o=_.runSelected(e,t,n,i);void _.handleRunState(e,s);return o}e.run=b;function y(e,t,n,i,s){if(!e.model){return Promise.resolve(false)}const o=_.getState(e);const r=_.runCells(e,t,n,i,s);void _.handleRunState(e,o);return r}e.runCells=y;async function w(e,t,n,i){var s;if(!e.model||!e.activeCell){return Promise.resolve(false)}const r=_.getState(e);const a=_.runSelected(e,t,n,i);const l=e.model;if(e.activeCellIndex===e.widgets.length-1){l.sharedModel.insertCell(e.widgets.length,{cell_type:e.notebookConfig.defaultCell,metadata:e.notebookConfig.defaultCell==="code"?{trusted:true}:{}});e.activeCellIndex++;if(((s=e.activeCell)===null||s===void 0?void 0:s.inViewport)===false){await(0,o.signalToPromise)(e.activeCell.inViewportChanged,200).catch((()=>{}))}e.mode="edit"}else{e.activeCellIndex++}void _.handleRunState(e,r,"center");return a}e.runAndAdvance=w;async function C(e,t,n,i){var s;if(!e.model||!e.activeCell){return Promise.resolve(false)}const r=_.getState(e);const a=_.runSelected(e,t,n,i);const l=e.model;l.sharedModel.insertCell(e.activeCellIndex+1,{cell_type:e.notebookConfig.defaultCell,metadata:e.notebookConfig.defaultCell==="code"?{trusted:true}:{}});e.activeCellIndex++;if(((s=e.activeCell)===null||s===void 0?void 0:s.inViewport)===false){await(0,o.signalToPromise)(e.activeCell.inViewportChanged,200).catch((()=>{}))}e.mode="edit";void _.handleRunState(e,r,"center");return a}e.runAndInsert=C;function x(e,t,n,i){if(!e.model||!e.activeCell){return Promise.resolve(false)}const s=_.getState(e);const o=e.widgets.length;const r=_.runCells(e,e.widgets,t,n,i);e.activeCellIndex=o;e.deselectAll();void _.handleRunState(e,s);return r}e.runAll=x;function S(e){if(!e.model||!e.activeCell){return Promise.resolve(false)}const t=e.activeCellIndex;const n=_.getState(e);e.widgets.forEach(((t,n)=>{if(t.model.type==="markdown"){e.select(t);e.activeCellIndex=n}}));if(e.activeCell.model.type!=="markdown"){return Promise.resolve(true)}const i=_.runSelected(e);e.activeCellIndex=t;void _.handleRunState(e,n);return i}e.renderAllMarkdown=S;function k(e,t,n,i){const{activeCell:s,activeCellIndex:o,model:r}=e;if(!r||!s||o<1){return Promise.resolve(false)}const a=_.getState(e);const l=_.runCells(e,e.widgets.slice(0,e.activeCellIndex),t,n,i);e.deselectAll();void _.handleRunState(e,a);return l}e.runAllAbove=k;function j(e,t,n,i){if(!e.model||!e.activeCell){return Promise.resolve(false)}const s=_.getState(e);const o=e.widgets.length;const r=_.runCells(e,e.widgets.slice(e.activeCellIndex),t,n,i);e.activeCellIndex=o;e.deselectAll();void _.handleRunState(e,s);return r}e.runAllBelow=j;function I(e,t){var n,i,s;if(!e.model||!((n=e.activeCell)===null||n===void 0?void 0:n.editor)){return}(s=(i=e.activeCell.editor).replaceSelection)===null||s===void 0?void 0:s.call(i,t)}e.replaceSelection=I;function E(e){if(!e.model||!e.activeCell){return}const t=e.layout.footer;if(t&&document.activeElement===t.node){t.node.blur();e.mode="command";return}if(e.activeCellIndex===0){return}let n=e.activeCellIndex-1;while(n>=0){const t=e.widgets[n];if(!t.inputHidden&&!t.isHidden){break}n-=1}const i=_.getState(e);e.activeCellIndex=n;e.deselectAll();void _.handleState(e,i,true)}e.selectAbove=E;function T(e){if(!e.model||!e.activeCell){return}let t=e.widgets.length-1;while(e.widgets[t].isHidden||e.widgets[t].inputHidden){t-=1}if(e.activeCellIndex===t){const t=e.layout.footer;t===null||t===void 0?void 0:t.node.focus();return}let n=e.activeCellIndex+1;while(n-1?t:1;let n=_.Headings.findLowerEqualLevelHeadingBelow(e.activeCell,e,true);await _.Headings.insertHeadingAboveCellIndex(n==-1?e.model.cells.length:n,t,e)}e.insertSameLevelHeadingBelow=D;function A(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);let n=ve(e.activeCell);if(n.isHeading&&!n.collapsed){me(e.activeCell,true,e)}else{let t=_.Headings.findLowerEqualLevelParentHeadingAbove(e.activeCell,e,true);if(t>-1){e.activeCellIndex=t}}e.deselectAll();void _.handleState(e,t,true)}e.selectHeadingAboveOrCollapseHeading=A;function P(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);let n=ve(e.activeCell);if(n.isHeading&&n.collapsed){me(e.activeCell,false,e)}else{let t=_.Headings.findHeadingBelow(e.activeCell,e,true);if(t>-1){e.activeCellIndex=t}}e.deselectAll();void _.handleState(e,t,true)}e.selectHeadingBelowOrExpandHeading=P;function L(e,t=false){if(!e.model||!e.activeCell){return}if(e.activeCellIndex===0){return}const n=_.getState(e);e.mode="command";if(t){e.extendContiguousSelectionTo(0)}else{e.extendContiguousSelectionTo(e.activeCellIndex-1)}void _.handleState(e,n,true)}e.extendSelectionAbove=L;function R(e,t=false){if(!e.model||!e.activeCell){return}if(e.activeCellIndex===e.widgets.length-1){return}const n=_.getState(e);e.mode="command";if(t){e.extendContiguousSelectionTo(e.widgets.length-1)}else{e.extendContiguousSelectionTo(e.activeCellIndex+1)}void _.handleState(e,n,true)}e.extendSelectionBelow=R;function N(e){if(!e.model||!e.activeCell){return}e.widgets.forEach((t=>{e.select(t)}))}e.selectAll=N;function O(e){if(!e.model||!e.activeCell){return}e.deselectAll()}e.deselectAll=O;function B(e){_.copyOrCut(e,false)}e.copy=B;function F(e){_.copyOrCut(e,true)}e.cut=F;function z(e,t="below"){const n=i.Clipboard.getInstance();if(!n.hasData(m)){return}const s=n.getData(m);W(e,t,s,true);void be(e)}e.paste=z;function H(e,t="below"){const n=_.selectedCells(e);if(!n||n.length===0){return}W(e,t,n,false)}e.duplicate=H;function W(e,t="below",n,i=false){if(!e.model||!e.activeCell){return}const s=_.getState(e);const o=e.model;e.mode="command";let r=0;const a=e.activeCellIndex;o.sharedModel.transact((()=>{switch(t){case"below":r=e.activeCellIndex+1;break;case"belowSelected":e.widgets.forEach(((t,n)=>{if(e.isSelectedOrActive(t)){r=n+1}}));break;case"above":r=e.activeCellIndex;break;case"replace":{const t=[];e.widgets.forEach(((n,i)=>{const s=n.model.sharedModel.getMetadata("deletable")!==false;if(e.isSelectedOrActive(n)&&s){t.push(i)}}));if(t.length>0){t.reverse().forEach((e=>{o.sharedModel.deleteCell(e)}))}r=t[0];break}default:break}o.sharedModel.insertCells(r,n.map((t=>{t.id=t.cell_type==="code"&&e.lastClipboardInteraction==="cut"&&typeof t.id==="string"?t.id:undefined;return t})))}));e.activeCellIndex=a+n.length;e.deselectAll();if(i){e.lastClipboardInteraction="paste"}void _.handleState(e,s,true)}function V(e){if(!e.model){return}const t=_.getState(e);e.mode="command";e.model.sharedModel.undo();e.deselectAll();void _.handleState(e,t)}e.undo=V;function U(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.mode="command";e.model.sharedModel.redo();e.deselectAll();void _.handleState(e,t)}e.redo=U;function q(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);const n=e.editorConfig;const i=!(n.code.lineNumbers&&n.markdown.lineNumbers&&n.raw.lineNumbers);const s={code:{...n.code,lineNumbers:i},markdown:{...n.markdown,lineNumbers:i},raw:{...n.raw,lineNumbers:i}};e.editorConfig=s;void _.handleState(e,t)}e.toggleAllLineNumbers=q;function $(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);let n=-1;for(const i of e.model.cells){const t=e.widgets[++n];if(e.isSelectedOrActive(t)&&i.type==="code"){i.sharedModel.transact((()=>{i.clearExecution();t.outputHidden=false}),false);_.outputCleared.emit({notebook:e,cell:t})}}void _.handleState(e,t,true)}e.clearOutputs=$;function K(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);let n=-1;for(const i of e.model.cells){const t=e.widgets[++n];if(i.type==="code"){i.sharedModel.transact((()=>{i.clearExecution();t.outputHidden=false}),false);_.outputCleared.emit({notebook:e,cell:t})}}void _.handleState(e,t,true)}e.clearAllOutputs=K;function J(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((t=>{if(e.isSelectedOrActive(t)&&t.model.type==="code"){t.inputHidden=true}}));void _.handleState(e,t)}e.hideCode=J;function G(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((t=>{if(e.isSelectedOrActive(t)&&t.model.type==="code"){t.inputHidden=false}}));void _.handleState(e,t)}e.showCode=G;function Y(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((e=>{if(e.model.type==="code"){e.inputHidden=true}}));void _.handleState(e,t)}e.hideAllCode=Y;function X(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((e=>{if(e.model.type==="code"){e.inputHidden=false}}));void _.handleState(e,t)}e.showAllCode=X;function Q(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((t=>{if(e.isSelectedOrActive(t)&&t.model.type==="code"){t.outputHidden=true}}));void _.handleState(e,t,true)}e.hideOutput=Q;function Z(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((t=>{if(e.isSelectedOrActive(t)&&t.model.type==="code"){t.outputHidden=false}}));void _.handleState(e,t)}e.showOutput=Z;function ee(e){if(!e.model||!e.activeCell){return}for(const t of e.widgets){if(e.isSelectedOrActive(t)&&t.model.type==="code"){if(t.outputHidden===false){return Q(e)}}}return Z(e)}e.toggleOutput=ee;function te(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((e=>{if(e.model.type==="code"){e.outputHidden=true}}));void _.handleState(e,t,true)}e.hideAllOutputs=te;function ne(e){e.renderingLayout="side-by-side"}e.renderSideBySide=ne;function ie(e){e.renderingLayout="default"}e.renderDefault=ie;function se(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((e=>{if(e.model.type==="code"){e.outputHidden=false}}));void _.handleState(e,t)}e.showAllOutputs=se;function oe(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((t=>{if(e.isSelectedOrActive(t)&&t.model.type==="code"){t.outputsScrolled=true}}));void _.handleState(e,t,true)}e.enableOutputScrolling=oe;function re(e){if(!e.model||!e.activeCell){return}const t=_.getState(e);e.widgets.forEach((t=>{if(e.isSelectedOrActive(t)&&t.model.type==="code"){t.outputsScrolled=false}}));void _.handleState(e,t)}e.disableOutputScrolling=re;function ae(e){let t=null;let n=null;e.widgets.forEach(((e,i)=>{if(e.model.type==="code"){const s=e.model.getMetadata("execution");if(s&&l.JSONExt.isObject(s)&&s["iopub.status.busy"]!==undefined){const e=s["iopub.status.busy"].toString();if(e){const s=new Date(e);if(!t||s>=t){t=s;n=i}}}}}));if(n!==null){e.activeCellIndex=n}}e.selectLastRunCell=ae;function le(e,t,n){if(!e.model||!e.activeCell){return}const i=_.getState(e);const s=e.model.cells;t=Math.min(Math.max(t,1),6);e.widgets.forEach(((n,i)=>{if(e.isSelectedOrActive(n)){_.setMarkdownHeader(s.get(i),t)}}));_.changeCellType(e,"markdown",n);void _.handleState(e,i)}e.setMarkdownHeader=le;function de(t){const n=_.getState(t);for(const i of t.widgets){if(e.getHeadingInfo(i).isHeading){e.setHeadingCollapse(i,true,t);e.setCellCollapse(i,true)}}t.activeCellIndex=0;void _.handleState(t,n,true)}e.collapseAllHeadings=de;function ce(t){for(const n of t.widgets){if(e.getHeadingInfo(n).isHeading){e.setHeadingCollapse(n,false,t);e.setCellCollapse(n,false)}}}e.expandAllHeadings=ce;function he(e,t){const n=(0,a.findIndex)(t.widgets,((t,n)=>e.model.id===t.model.id));if(n===-1){return}if(n>=t.widgets.length){return}let i=ve(t.widgets[n]);for(let s=n-1;s>=0;s--){if(se.model.id===t.model.id));if(n===-1){return-1}let i=ve(e);for(n=n+1;nt.model.id===e.model.id));if(o===-1){return-1}if(!i.widgets.length){return o+1}let r=e.getHeadingInfo(t);if(t.isHidden||!(t instanceof s.MarkdownCell)||!r.isHeading){return o+1}let l=false;let d=0;let c;for(c=o+1;c{}))}e.toggleCurrentHeadingCollapse=ge;function fe(e,t){if(e instanceof s.MarkdownCell){e.headingCollapsed=t}else{e.setHidden(t)}}e.setCellCollapse=fe;function ve(e){if(!(e instanceof s.MarkdownCell)){return{isHeading:false,headingLevel:7}}let t=e.headingInfo.level;let n=e.headingCollapsed;return{isHeading:t>0,headingLevel:t,collapsed:n}}e.getHeadingInfo=ve;function _e(e,t){t=t||r.nullTranslator;const n=t.load("jupyterlab");if(!e.model){return Promise.resolve()}const s=(0,a.every)(e.model.cells,(e=>e.trusted));const o=c.createElement("p",null,n.__("A trusted Jupyter notebook may execute hidden malicious code when you open it."),c.createElement("br",null),n.__('Selecting "Trust" will re-render this notebook in a trusted state.'),c.createElement("br",null),n.__("For more information, see")," ",c.createElement("a",{href:"https://jupyter-server.readthedocs.io/en/stable/operators/security.html",target:"_blank",rel:"noopener noreferrer"},n.__("the Jupyter security documentation")),".");if(s){return(0,i.showDialog)({body:n.__("Notebook is already trusted"),buttons:[i.Dialog.okButton()]}).then((()=>undefined))}return(0,i.showDialog)({body:o,title:n.__("Trust this notebook?"),buttons:[i.Dialog.cancelButton(),i.Dialog.warnButton({label:n.__("Trust"),ariaLabel:n.__("Confirm Trusting this notebook")})]}).then((t=>{if(t.button.accept){if(e.model){for(const t of e.model.cells){t.trusted=true}}}}))}e.trust=_e;async function be(e,t={waitUntilReady:true,preventScroll:false}){const{activeCell:n}=e;const{waitUntilReady:i,preventScroll:s}=t;if(!n){return}if(i){await n.ready}if(e.isDisposed||n.isDisposed){return}n.node.focus({preventScroll:s})}e.focusActiveCell=be;async function ye(e){if(!e.notebookConfig.accessKernelHistory){return}const t=e.activeCell;if(t){if(e.kernelHistory){const n=await e.kernelHistory.back(t);e.kernelHistory.updateEditor(t,n)}}}e.accessPreviousHistory=ye;async function we(e){if(!e.notebookConfig.accessKernelHistory){return}const t=e.activeCell;if(t){if(e.kernelHistory){const n=await e.kernelHistory.forward(t);e.kernelHistory.updateEditor(t,n)}}}e.accessNextHistory=we})(f||(f={}));function v(e){if(_.executor){throw new Error("Cell executor can only be set once.")}_.executor=e}var _;(function(e){e.executed=new d.Signal({});e.executionScheduled=new d.Signal({});e.selectionExecuted=new d.Signal({});e.outputCleared=new d.Signal({});function t(e){var t,n;return{wasFocused:e.node.contains(document.activeElement),activeCellId:(n=(t=e.activeCell)===null||t===void 0?void 0:t.model.id)!==null&&n!==void 0?n:null}}e.getState=t;async function n(e,t,n=false){const{activeCell:i,activeCellIndex:s}=e;if(n&&i){await e.scrollToItem(s,"auto",0).catch((e=>{}))}if(t.wasFocused||e.mode==="edit"){e.activate()}}e.handleState=n;async function s(e,t,n){const{activeCell:i,activeCellIndex:s}=e;if(i){await e.scrollToItem(s,"smart",0,n).catch((e=>{}))}if(t.wasFocused||e.mode==="edit"){e.activate()}}e.handleRunState=s;function a(t,n,s,o,a){const l=n[n.length-1];t.mode="command";let d=false;return Promise.all(n.map((e=>{if(e.model.type==="code"&&t.notebookConfig.enableKernelInitNotification&&s&&s.kernelDisplayStatus==="initializing"&&!d){d=true;a=a||r.nullTranslator;const e=a.load("jupyterlab");i.Notification.emit(e.__(`Kernel '${s.kernelDisplayName}' for '${s.path}' is still initializing. You can run code cells when the kernel has initialized.`),"warning",{autoClose:false});return Promise.resolve(false)}if(e.model.type==="code"&&t.notebookConfig.enableKernelInitNotification&&d){return Promise.resolve(false)}return c(t,e,s,o,a)}))).then((n=>{if(t.isDisposed){return false}e.selectionExecuted.emit({notebook:t,lastCell:l});t.update();return n.every((e=>e))})).catch((i=>{if(i.message.startsWith("KernelReplyNotOK")){n.map((e=>{if(e.model.type==="code"&&e.model.executionCount==null){e.model.executionState="idle"}}))}else{throw i}e.selectionExecuted.emit({notebook:t,lastCell:l});t.update();return false}))}e.runCells=a;function l(e,t,n,i){e.mode="command";let s=e.activeCellIndex;const o=e.widgets.filter(((t,n)=>{const i=e.isSelectedOrActive(t);if(i){s=n}return i}));e.activeCellIndex=s;e.deselectAll();return a(e,o,t,n,i)}e.runSelected=l;async function c(t,n,i,s,o){if(!e.executor){console.warn("Requesting cell execution without any cell executor defined. Falling back to default execution.")}const r={cell:n,notebook:t.model,notebookConfig:t.notebookConfig,onCellExecuted:n=>{e.executed.emit({notebook:t,...n})},onCellExecutionScheduled:n=>{e.executionScheduled.emit({notebook:t,...n})},sessionContext:i,sessionDialogs:s,translator:o};return e.executor?e.executor.runCell(r):u(r)}function h(e){return e.widgets.filter((t=>e.isSelectedOrActive(t))).map((e=>e.model.toJSON())).map((e=>{if(e.metadata.deletable!==undefined){delete e.metadata.deletable}return e}))}e.selectedCells=h;function p(s,o){if(!s.model||!s.activeCell){return}const r=t(s);const a=i.Clipboard.getInstance();s.mode="command";a.clear();const l=e.selectedCells(s);a.setData(m,l);if(o){v(s)}else{s.deselectAll()}if(o){s.lastClipboardInteraction="cut"}else{s.lastClipboardInteraction="copy"}void n(s,r)}e.copyOrCut=p;function g(e,t,n){const s=e.model.sharedModel;e.widgets.forEach(((o,a)=>{if(!e.isSelectedOrActive(o)){return}if(o.model.type==="code"&&o.outputArea.pendingInput){n=n||r.nullTranslator;const e=n.load("jupyterlab");void(0,i.showDialog)({title:e.__("Cell type not changed due to pending input"),body:e.__("The cell type has not been changed to avoid kernel deadlock as this cell has pending input! Submit your pending input and try again."),buttons:[i.Dialog.okButton()]});return}if(o.model.getMetadata("editable")==false){n=n||r.nullTranslator;const e=n.load("jupyterlab");void(0,i.showDialog)({title:e.__("Cell is read-only"),body:e.__("The cell is read-only, its type cannot be changed!"),buttons:[i.Dialog.okButton()]});return}if(o.model.type!==t){const e=o.model.toJSON();s.transact((()=>{s.deleteCell(a);if(t==="code"){e.metadata.trusted=true}else{e.metadata.trusted=undefined}const n=s.insertCell(a,{cell_type:t,source:e.source,metadata:e.metadata});if(e.attachments&&["markdown","raw"].includes(t)){n.attachments=e.attachments}}))}if(t==="markdown"){o=e.widgets[a];o.rendered=false}}));e.deselectAll()}e.changeCellType=g;function v(e){const t=e.model;const n=t.sharedModel;const i=[];e.mode="command";e.widgets.forEach(((t,n)=>{var s;const o=t.model.getMetadata("deletable")!==false;if(e.isSelectedOrActive(t)&&o){i.push(n);(s=e.model)===null||s===void 0?void 0:s.deletedCells.push(t.model.id)}}));if(i.length>0){n.transact((()=>{i.reverse().forEach((e=>{n.deleteCell(e)}));if(n.cells.length==i.length){n.insertCell(0,{cell_type:e.notebookConfig.defaultCell,metadata:e.notebookConfig.defaultCell==="code"?{trusted:true}:{}})}}));e.activeCellIndex=i[0]-i.length+1}e.deselectAll()}e.deleteCells=v;function _(e,t){let n=e.sharedModel.getSource();const i=/^(#+\s*)|^(\s*)/;const s=Array(t+1).join("#")+" ";const o=i.exec(n);if(o){n=n.slice(o[0].length)}e.sharedModel.setSource(s+n)}e.setMarkdownHeader=_;let b;(function(t){function n(e,t,n=false,i=false){let s=t.widgets.indexOf(e)-(n?1:0);while(s>=0){let e=f.getHeadingInfo(t.widgets[s]);if(e.isHeading){return i?s:t.widgets[s]}s--}return i?-1:null}t.findParentHeading=n;function i(t,n,i=false){let s=e.Headings.determineHeadingLevel(t,n);if(s==-1){s=1}let o=n.widgets.indexOf(t)-1;while(o>=0){let e=n.widgets[o];let t=f.getHeadingInfo(e);if(t.isHeading&&t.headingLevel<=s){return i?o:e}o--}return i?-1:null}t.findLowerEqualLevelParentHeadingAbove=i;function s(t,n,i=false){let s=e.Headings.determineHeadingLevel(t,n);if(s==-1){s=1}let o=n.widgets.indexOf(t)+1;while(o{}))}i.deselectAll();void e.handleState(i,r,true);i.mode="edit";i.widgets[t].setHidden(false)}t.insertHeadingAboveCellIndex=l})(b=e.Headings||(e.Headings={}))})(_||(_={}));class b{constructor(e){this.model=e;this._cellMap=new WeakMap;this._changed=new d.Signal(this);this._isDisposed=false;this._insertCells(0,this.model.cells);this.model.changed.connect(this._onSharedModelChanged,this)}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get length(){return this.model.cells.length}*[Symbol.iterator](){for(const e of this.model.cells){yield this._cellMap.get(e)}}dispose(){var e;if(this._isDisposed){return}this._isDisposed=true;for(const t of this.model.cells){(e=this._cellMap.get(t))===null||e===void 0?void 0:e.dispose()}d.Signal.clearData(this)}get(e){return this._cellMap.get(this.model.cells[e])}_insertCells(e,t){t.forEach((e=>{let t;switch(e.cell_type){case"code":{t=new s.CodeCellModel({sharedModel:e});break}case"markdown":{t=new s.MarkdownCellModel({sharedModel:e});break}default:{t=new s.RawCellModel({sharedModel:e})}}this._cellMap.set(e,t);e.disposed.connect((()=>{t.dispose();this._cellMap.delete(e)}))}));return this.length}_onSharedModelChanged(e,t){var n;let i=0;const s=new Array;(n=t.cellsChange)===null||n===void 0?void 0:n.forEach((e=>{if(e.insert!=null){this._insertCells(i,e.insert);s.push({type:"add",newIndex:i,newValues:e.insert.map((e=>this._cellMap.get(e))),oldIndex:-2,oldValues:[]});i+=e.insert.length}else if(e.delete!=null){s.push({type:"remove",newIndex:-1,newValues:[],oldIndex:i,oldValues:new Array(e.delete).fill(undefined)})}else if(e.retain!=null){i+=e.retain}}));s.forEach((e=>this._changed.emit(e)))}}var y=n(66127);const w="jp-Notebook-toolbarCellType";const C="jp-Notebook-toolbarCellTypeDropdown";var x;(function(e){function t(e,t){const n=(t||r.nullTranslator).load("jupyterlab");function s(){if(e.context.model.readOnly){return(0,i.showDialog)({title:n.__("Cannot Save"),body:n.__("Document is read-only"),buttons:[i.Dialog.okButton()]})}void e.context.save().then((()=>{if(!e.isDisposed){return e.context.createCheckpoint()}}))}return(0,y.addToolbarButtonClass)(y.ReactWidget.create(c.createElement(y.UseSignal,{signal:e.context.fileChanged},(()=>c.createElement(y.ToolbarButtonComponent,{icon:y.saveIcon,onClick:s,tooltip:n.__("Save the notebook contents and create checkpoint"),enabled:!!(e&&e.context&&e.context.contentsModel&&e.context.contentsModel.writable)})))))}e.createSaveButton=t;function n(e,t){const n=(t||r.nullTranslator).load("jupyterlab");return new y.ToolbarButton({icon:y.addIcon,onClick:()=>{f.insertBelow(e.content)},tooltip:n.__("Insert a cell below")})}e.createInsertButton=n;function s(e,t){const n=(t||r.nullTranslator).load("jupyterlab");return new y.ToolbarButton({icon:y.cutIcon,onClick:()=>{f.cut(e.content)},tooltip:n.__("Cut the selected cells")})}e.createCutButton=s;function o(e,t){const n=(t||r.nullTranslator).load("jupyterlab");return new y.ToolbarButton({icon:y.copyIcon,onClick:()=>{f.copy(e.content)},tooltip:n.__("Copy the selected cells")})}e.createCopyButton=o;function a(e,t){const n=(t||r.nullTranslator).load("jupyterlab");return new y.ToolbarButton({icon:y.pasteIcon,onClick:()=>{f.paste(e.content)},tooltip:n.__("Paste cells from the clipboard")})}e.createPasteButton=a;function l(e,t,n){const i=(n!==null&&n!==void 0?n:r.nullTranslator).load("jupyterlab");return new y.ToolbarButton({icon:y.runIcon,onClick:()=>{void f.runAndAdvance(e.content,e.sessionContext,t,n)},tooltip:i.__("Run the selected cells and advance")})}e.createRunButton=l;function d(e,t,n){const s=(n!==null&&n!==void 0?n:r.nullTranslator).load("jupyterlab");return new y.ToolbarButton({icon:y.fastForwardIcon,onClick:()=>{const s=t!==null&&t!==void 0?t:new i.SessionContextDialogs({translator:n});void s.restart(e.sessionContext).then((t=>{if(t){void f.runAll(e.content,e.sessionContext,s,n)}return t}))},tooltip:s.__("Restart the kernel, then re-run the whole notebook")})}e.createRestartRunAllButton=d;function h(e,t){return new S(e.content,t)}e.createCellTypeItem=h;function u(e,r,c){return[{name:"save",widget:t(e,c)},{name:"insert",widget:n(e,c)},{name:"cut",widget:s(e,c)},{name:"copy",widget:o(e,c)},{name:"paste",widget:a(e,c)},{name:"run",widget:l(e,r,c)},{name:"interrupt",widget:i.Toolbar.createInterruptButton(e.sessionContext,c)},{name:"restart",widget:i.Toolbar.createRestartButton(e.sessionContext,r,c)},{name:"restart-and-run",widget:d(e,r,c)},{name:"cellType",widget:h(e,c)},{name:"spacer",widget:y.Toolbar.createSpacerItem()},{name:"kernelName",widget:i.Toolbar.createKernelNameItem(e.sessionContext,r,c)}]}e.getDefaultItems=u})(x||(x={}));class S extends y.ReactWidget{constructor(e,t){super();this.handleChange=e=>{if(e.target.value!=="-"){f.changeCellType(this._notebook,e.target.value);this._notebook.activate()}};this.handleKeyDown=e=>{if(e.keyCode===13){this._notebook.activate()}};this._trans=(t||r.nullTranslator).load("jupyterlab");this.addClass(w);this._notebook=e;if(e.model){this.update()}e.activeCellChanged.connect(this.update,this);e.selectionChanged.connect(this.update,this)}render(){let e="-";if(this._notebook.activeCell){e=this._notebook.activeCell.model.type}for(const t of this._notebook.widgets){if(this._notebook.isSelectedOrActive(t)){if(t.model.type!==e){e="-";break}}}return c.createElement(y.HTMLSelect,{className:C,onChange:this.handleChange,onKeyDown:this.handleKeyDown,value:e,"aria-label":this._trans.__("Cell type"),title:this._trans.__("Select the cell type")},c.createElement("option",{value:"-"},"-"),c.createElement("option",{value:"code"},this._trans.__("Code")),c.createElement("option",{value:"markdown"},this._trans.__("Markdown")),c.createElement("option",{value:"raw"},this._trans.__("Raw")))}}var k=n(66987);var j=n(77256);function I(e){const t=e.translator||r.nullTranslator;const n=(0,i.translateKernelStatuses)(t);const s=t.load("jupyterlab");const o=e.state;const a=e.displayOption.showOnToolBar;const l=e.displayOption.showProgress;const d=a?"down":"up";const c=h().createElement("div",null);if(!o){return c}const u=o.kernelStatus;const p={alignSelf:"normal",height:"24px"};const m=o.totalTime;const g=o.scheduledCellNumber||0;const f=o.scheduledCell.size||0;const v=g-f;let _=100*v/g;let b=l?"":"hidden";if(!l&&_<100){_=0}const w=e=>h().createElement(k.ProgressCircle,{progress:e,width:16,height:24,label:s.__("Kernel status")});const C=e=>s.__("Kernel status: %1",e);const x=(e,t,i)=>h().createElement("div",{className:"jp-Notebook-ExecutionIndicator",title:l?"":C(n[e]),"data-status":e},t,h().createElement("div",{className:`jp-Notebook-ExecutionIndicator-tooltip ${d} ${b}`},h().createElement("span",null," ",C(n[e])," "),i));if(o.kernelStatus==="connecting"||o.kernelStatus==="disconnected"||o.kernelStatus==="unknown"){return x(u,h().createElement(y.offlineBoltIcon.react,{...p}),[])}if(o.kernelStatus==="starting"||o.kernelStatus==="terminating"||o.kernelStatus==="restarting"||o.kernelStatus==="initializing"){return x(u,h().createElement(y.circleIcon.react,{...p}),[])}if(o.executionStatus==="busy"){return x("busy",w(_),[h().createElement("span",{key:0},s.__(`Executed ${v}/${g} cells`)),h().createElement("span",{key:1},s._n("Elapsed time: %1 second","Elapsed time: %1 seconds",m))])}else{const e=o.kernelStatus==="busy"?0:100;const t=o.kernelStatus==="busy"||m===0?[]:[h().createElement("span",{key:0},s._n("Executed %1 cell","Executed %1 cells",g)),h().createElement("span",{key:1},s._n("Elapsed time: %1 second","Elapsed time: %1 seconds",m))];return x(o.kernelStatus,w(e),t)}}class E extends y.VDomRenderer{constructor(e,t=true){super(new E.Model);this.translator=e||r.nullTranslator;this.addClass("jp-mod-highlighted")}render(){if(this.model===null||!this.model.renderFlag){return h().createElement("div",null)}else{const e=this.model.currentNotebook;if(!e){return h().createElement(I,{displayOption:this.model.displayOption,state:undefined,translator:this.translator})}return h().createElement(I,{displayOption:this.model.displayOption,state:this.model.executionState(e),translator:this.translator})}}}(function(e){class t extends y.VDomModel{constructor(){super();this._notebookExecutionProgress=new WeakMap;this._displayOption={showOnToolBar:true,showProgress:true};this._renderFlag=true}attachNotebook(e){var t,n,i,s;if(e&&e.content&&e.context){const o=e.content;const r=e.context;this._currentNotebook=o;if(!this._notebookExecutionProgress.has(o)){this._notebookExecutionProgress.set(o,{executionStatus:"idle",kernelStatus:"idle",totalTime:0,interval:0,timeout:0,scheduledCell:new Set,scheduledCellNumber:0,needReset:true});const e=this._notebookExecutionProgress.get(o);const a=t=>{if(e){e.kernelStatus=t.kernelDisplayStatus}this.stateChanged.emit(void 0)};r.statusChanged.connect(a,this);const l=t=>{if(e){e.kernelStatus=t.kernelDisplayStatus}this.stateChanged.emit(void 0)};r.connectionStatusChanged.connect(l,this);r.disposed.connect((e=>{e.connectionStatusChanged.disconnect(l,this);e.statusChanged.disconnect(a,this)}));const d=(e,t)=>{const n=t.msg;const i=n.header.msg_id;if(n.header.msg_type==="execute_request"){this._cellScheduledCallback(o,i)}else if(j.KernelMessage.isStatusMsg(n)&&n.content.execution_state==="idle"){const e=n.parent_header.msg_id;this._cellExecutedCallback(o,e)}else if(j.KernelMessage.isStatusMsg(n)&&n.content.execution_state==="restarting"){this._restartHandler(o)}else if(n.header.msg_type==="execute_input"){this._startTimer(o)}};(n=(t=r.session)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.anyMessage.connect(d);(s=(i=r.session)===null||i===void 0?void 0:i.kernel)===null||s===void 0?void 0:s.disposed.connect((e=>e.anyMessage.disconnect(d)));const c=(t,n)=>{if(e){this._resetTime(e);this.stateChanged.emit(void 0);if(n.newValue){n.newValue.anyMessage.connect(d)}}};r.kernelChanged.connect(c);r.disposed.connect((e=>e.kernelChanged.disconnect(c)))}}}get currentNotebook(){return this._currentNotebook}get displayOption(){return this._displayOption}set displayOption(e){this._displayOption=e}executionState(e){return this._notebookExecutionProgress.get(e)}_scheduleSwitchToIdle(e){window.setTimeout((()=>{e.executionStatus="idle";clearInterval(e.interval);this.stateChanged.emit(void 0)}),150);e.timeout=window.setTimeout((()=>{e.needReset=true}),1e3)}_cellExecutedCallback(e,t){const n=this._notebookExecutionProgress.get(e);if(n&&n.scheduledCell.has(t)){n.scheduledCell.delete(t);if(n.scheduledCell.size===0){this._scheduleSwitchToIdle(n)}}}_restartHandler(e){const t=this._notebookExecutionProgress.get(e);if(t){t.scheduledCell.clear();this._scheduleSwitchToIdle(t)}}_startTimer(e){const t=this._notebookExecutionProgress.get(e);if(!t){return}if(t.scheduledCell.size>0){if(t.executionStatus!=="busy"){t.executionStatus="busy";clearTimeout(t.timeout);this.stateChanged.emit(void 0);t.interval=window.setInterval((()=>{this._tick(t)}),1e3)}}else{this._resetTime(t)}}_cellScheduledCallback(e,t){const n=this._notebookExecutionProgress.get(e);if(n&&!n.scheduledCell.has(t)){if(n.needReset){this._resetTime(n)}n.scheduledCell.add(t);n.scheduledCellNumber+=1}}_tick(e){e.totalTime+=1;this.stateChanged.emit(void 0)}_resetTime(e){e.totalTime=0;e.scheduledCellNumber=0;e.executionStatus="idle";e.scheduledCell=new Set;clearTimeout(e.timeout);clearInterval(e.interval);e.needReset=false}get renderFlag(){return this._renderFlag}updateRenderOption(e){if(this.displayOption.showOnToolBar){if(!e.showOnToolBar){this._renderFlag=false}else{this._renderFlag=true}}this.displayOption.showProgress=e.showProgress;this.stateChanged.emit(void 0)}}e.Model=t;function n(t,n,s){const o=new e(n);o.model.displayOption={showOnToolBar:true,showProgress:true};o.model.attachNotebook({content:t.content,context:t.sessionContext});if(s){s.then((e=>{const t=e=>{o.model.updateRenderOption(i(e))};e.changed.connect(t);t(e);o.disposed.connect((()=>{e.changed.disconnect(t)}))})).catch((e=>{console.error(e.message)}))}return o}e.createExecutionIndicatorItem=n;function i(e){let t=true;let n=true;const i=e.get("kernelStatus").composite;if(i){t=!i.showOnStatusBar;n=i.showProgress}return{showOnToolBar:t,showProgress:n}}e.getSettingValue=i})(E||(E={}));class T{constructor(e){this._requestBatchSize=10;this._cursor=0;this._hasSession=false;this._history=[];this._placeholder="";this._kernelSession="";this._setByHistory=false;this._isDisposed=false;this._editor=null;this._filtered=[];this._kernel=null;this._sessionContext=e.sessionContext;this._trans=(e.translator||r.nullTranslator).load("jupyterlab");void this._handleKernel().then((()=>{this._sessionContext.kernelChanged.connect(this._handleKernel,this)}));this._toRequest=this._requestBatchSize}get editor(){return this._editor}set editor(e){if(this._editor===e){return}const t=this._editor;if(t){t.model.sharedModel.changed.disconnect(this.onTextChange,this)}this._editor=e;if(e){e.model.sharedModel.changed.connect(this.onTextChange,this)}}get placeholder(){return this._placeholder}get kernelSession(){return this._kernelSession}get isDisposed(){return this._isDisposed}dispose(){this._isDisposed=true;this._history.length=0;d.Signal.clearData(this)}async checkSession(e){var t;if(!this._hasSession){await this._retrieveHistory();this._hasSession=true;this.editor=e.editor;this._placeholder=((t=this._editor)===null||t===void 0?void 0:t.model.sharedModel.getSource())||"";this.setFilter(this._placeholder);this._cursor=this._filtered.length-1}}async back(e){await this.checkSession(e);--this._cursor;if(this._cursor<0){await this.fetchBatch()}this._cursor=Math.max(0,this._cursor);const t=this._filtered[this._cursor];return t}async forward(e){await this.checkSession(e);++this._cursor;this._cursor=Math.min(this._filtered.length-1,this._cursor);const t=this._filtered[this._cursor];return t}updateEditor(e,t){var n,i;if(e){const s=(n=e.editor)===null||n===void 0?void 0:n.model;const o=s===null||s===void 0?void 0:s.sharedModel.getSource();if(this.isDisposed||!t){return}if(o===t){return}this._setByHistory=true;s===null||s===void 0?void 0:s.sharedModel.setSource(t);let r=0;r=t.indexOf("\n");if(r<0){r=t.length}(i=e.editor)===null||i===void 0?void 0:i.setCursorPosition({line:0,column:r})}}reset(){this._hasSession=false;this._placeholder="";this._toRequest=this._requestBatchSize}async fetchBatch(){this._toRequest+=this._requestBatchSize;let e=this._filtered.slice().reverse();let t=this._history.slice();await this._retrieveHistory().then((()=>{this.setFilter(this._placeholder);let t=0;let n=this._filtered.slice().reverse();for(let i=0;it.length){await this.fetchBatch()}}}onHistory(e,t){this._history.length=0;let n=["","",""];let i=["","",""];let s="";if(e.content.status==="ok"){for(let t=0;t{this.onHistory(t,e)})).catch((()=>{console.warn(this._trans.__("History was unable to be retrieved"))})))}setFilter(e=""){this._filtered.length=0;let t="";let n="";for(let i=0;io;let t;if(e){t=this._trans.__(`This notebook has been converted from an older notebook format (v%1)\nto the current notebook format (v%2).\nThe next time you save this notebook, the current notebook format (v%2) will be used.\n'Older versions of Jupyter may not be able to read the new format.' To preserve the original format version,\nclose the notebook without saving it.`,o,s.nbformat)}else{t=this._trans.__(`This notebook has been converted from an newer notebook format (v%1)\nto the current notebook format (v%2).\nThe next time you save this notebook, the current notebook format (v%2) will be used.\nSome features of the original notebook may not be available.' To preserve the original format version,\nclose the notebook without saving it.`,o,s.nbformat)}void(0,i.showDialog)({title:this._trans.__("Notebook converted"),body:t,buttons:[i.Dialog.okButton({label:this._trans.__("Ok")})]})}if(((n=(t=s.cells)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0)===0){s["cells"]=[{cell_type:"code",source:"",metadata:{trusted:true}}]}this.sharedModel.fromJSON(s);this._ensureMetadata();this.dirty=true}_onCellsChanged(e,t){switch(t.type){case"add":t.newValues.forEach((e=>{e.contentChanged.connect(this.triggerContentChange,this)}));break;case"remove":break;case"set":t.newValues.forEach((e=>{e.contentChanged.connect(this.triggerContentChange,this)}));break;default:break}this.triggerContentChange()}_onMetadataChanged(e,t){this._metadataChanged.emit(t);this.triggerContentChange()}_onStateChanged(e,t){if(t.stateChange){t.stateChange.forEach((e=>{if(e.name==="dirty"){this.dirty=e.newValue}else if(e.oldValue!==e.newValue){this.triggerStateChange({newValue:undefined,oldValue:undefined,...e})}}))}}_ensureMetadata(e=""){if(!this.getMetadata("language_info")){this.sharedModel.setMetadata("language_info",{name:e})}if(!this.getMetadata("kernelspec")){this.sharedModel.setMetadata("kernelspec",{name:"",display_name:""})}}triggerStateChange(e){this._stateChanged.emit(e)}triggerContentChange(){this._contentChanged.emit(void 0);this.dirty=true}get isDisposed(){return this._isDisposed}}class L{constructor(e={}){var t,n;this._disposed=false;this._disableDocumentWideUndoRedo=(t=e.disableDocumentWideUndoRedo)!==null&&t!==void 0?t:true;this._collaborative=(n=e.collaborative)!==null&&n!==void 0?n:true}get disableDocumentWideUndoRedo(){return this._disableDocumentWideUndoRedo}set disableDocumentWideUndoRedo(e){this._disableDocumentWideUndoRedo=e}get name(){return"notebook"}get contentType(){return"notebook"}get fileFormat(){return"json"}get collaborative(){return this._collaborative}get isDisposed(){return this._disposed}dispose(){this._disposed=true}createNew(e={}){return new P({languagePreference:e.languagePreference,sharedModel:e.sharedModel,collaborationEnabled:e.collaborationEnabled&&this.collaborative,disableDocumentWideUndoRedo:this._disableDocumentWideUndoRedo})}preferredLanguage(e){return""}}function R(e){const t=(e.translator||r.nullTranslator).load("jupyterlab");return c.createElement(k.TextItem,{source:t.__("Mode: %1",e.modeNames[e.notebookMode])})}class N extends y.VDomRenderer{constructor(e){super(new N.Model);this.translator=e||r.nullTranslator;this._trans=this.translator.load("jupyterlab");this._modeNames={command:this._trans.__("Command"),edit:this._trans.__("Edit")}}render(){if(!this.model){return null}this.node.title=this._trans.__("Notebook is in %1 mode",this._modeNames[this.model.notebookMode]);return c.createElement(R,{notebookMode:this.model.notebookMode,translator:this.translator,modeNames:this._modeNames})}}(function(e){class t extends y.VDomModel{constructor(){super(...arguments);this._onChanged=e=>{const t=this._notebookMode;if(this._notebook){this._notebookMode=e.mode}else{this._notebookMode="command"}this._triggerChange(t,this._notebookMode)};this._notebookMode="command";this._notebook=null}get notebookMode(){return this._notebookMode}set notebook(e){const t=this._notebook;if(t!==null){t.stateChanged.disconnect(this._onChanged,this);t.activeCellChanged.disconnect(this._onChanged,this);t.modelContentChanged.disconnect(this._onChanged,this)}const n=this._notebookMode;this._notebook=e;if(this._notebook===null){this._notebookMode="command"}else{this._notebookMode=this._notebook.mode;this._notebook.stateChanged.connect(this._onChanged,this);this._notebook.activeCellChanged.connect(this._onChanged,this);this._notebook.modelContentChanged.connect(this._onChanged,this)}this._triggerChange(n,this._notebookMode)}_triggerChange(e,t){if(e!==t){this.stateChanged.emit(void 0)}}}e.Model=t})(N||(N={}));var O=n(98335);var B=n(90295);class F extends B.WidgetLSPAdapter{constructor(e,t){super(e,t);this.editorWidget=e;this.options=t;this._type="code";this._readyDelegate=new l.PromiseDelegate;this._editorToCell=new Map;this.editor=e.content;this._cellToEditor=new WeakMap;this.isReady=this.isReady.bind(this);Promise.all([this.widget.context.sessionContext.ready,this.connectionManager.ready]).then((async()=>{await this.initOnceReady();this._readyDelegate.resolve()})).catch(console.error)}get documentPath(){return this.widget.context.path}get mimeType(){var e;let t;let n=this.language_info();if(!n||!n.mimetype){t=this.widget.content.codeMimetype}else{t=n.mimetype}return Array.isArray(t)?(e=t[0])!==null&&e!==void 0?e:O.IEditorMimeTypeService.defaultMimeType:t}get languageFileExtension(){let e=this.language_info();if(!e||!e.file_extension){return}return e.file_extension.replace(".","")}get wrapperElement(){return this.widget.node}get editors(){if(this.isDisposed){return[]}let e=this.widget.content;this._editorToCell.clear();if(e.isDisposed){return[]}return e.widgets.map((e=>({ceEditor:this._getCellEditor(e),type:e.model.type,value:e.model.sharedModel.getSource()})))}get activeEditor(){return this.editor.activeCell?this._getCellEditor(this.editor.activeCell):undefined}get ready(){return this._readyDelegate.promise}getEditorIndexAt(e){let t=this._getCellAt(e);let n=this.widget.content;return n.widgets.findIndex((e=>t===e))}getEditorIndex(e){let t=this._editorToCell.get(e);return this.editor.widgets.findIndex((e=>t===e))}getEditorWrapper(e){let t=this._editorToCell.get(e);return t.node}async onKernelChanged(e,t){if(!t.newValue){return}try{const e=this._languageInfo;await(0,B.untilReady)(this.isReady,-1);await this._updateLanguageInfo();const t=this._languageInfo;if((e===null||e===void 0?void 0:e.name)!=t.name||(e===null||e===void 0?void 0:e.mimetype)!=(t===null||t===void 0?void 0:t.mimetype)||(e===null||e===void 0?void 0:e.file_extension)!=(t===null||t===void 0?void 0:t.file_extension)){console.log(`Changed to ${this._languageInfo.name} kernel, reconnecting`);this.reloadConnection()}else{console.log("Keeping old LSP connection as the new kernel uses the same language")}}catch(n){console.warn(n);this.reloadConnection()}}dispose(){if(this.isDisposed){return}this.widget.context.sessionContext.kernelChanged.disconnect(this.onKernelChanged,this);this.widget.content.activeCellChanged.disconnect(this._activeCellChanged,this);super.dispose();this._editorToCell.clear();d.Signal.clearData(this)}isReady(){var e;return!this.widget.isDisposed&&this.widget.context.isReady&&this.widget.content.isVisible&&this.widget.content.widgets.length>0&&((e=this.widget.context.sessionContext.session)===null||e===void 0?void 0:e.kernel)!=null}async handleCellChange(e,t){let n=[];let i=[];const s=this._type;if(t.type==="set"){let e=[];let o=[];if(t.newValues.length===t.oldValues.length){for(let n=0;ne.type===s))}if(i.length||n.length||t.type==="set"||t.type==="move"||t.type==="remove"){await this.updateDocuments()}for(let o of n){let e=this.widget.content.widgets.find((e=>e.model.id===o.id));if(!e){console.warn(`Widget for added cell with ID: ${o.id} not found!`);continue}this._getCellEditor(e)}}createVirtualDocument(){return new B.VirtualDocument({language:this.language,foreignCodeExtractors:this.options.foreignCodeExtractorsManager,path:this.documentPath,fileExtension:this.languageFileExtension,standalone:false,hasLspSupportedFile:false})}language_info(){return this._languageInfo}async initOnceReady(){await(0,B.untilReady)(this.isReady.bind(this),-1);await this._updateLanguageInfo();this.initVirtual();this.connectDocument(this.virtualDocument,false).catch(console.warn);this.widget.context.sessionContext.kernelChanged.connect(this.onKernelChanged,this);this.widget.content.activeCellChanged.connect(this._activeCellChanged,this);this._connectModelSignals(this.widget);this.editor.modelChanged.connect((e=>{console.warn("Model changed, connecting cell change handler; this is not something we were expecting");this._connectModelSignals(e)}))}_connectModelSignals(e){if(e.model===null){console.warn(`Model is missing for notebook ${e}, cannot connect cell changed signal!`)}else{e.model.cells.changed.connect(this.handleCellChange,this)}}async _updateLanguageInfo(){var e,t,n,i;const s=(i=await((n=(t=(e=this.widget.context.sessionContext)===null||e===void 0?void 0:e.session)===null||t===void 0?void 0:t.kernel)===null||n===void 0?void 0:n.info))===null||i===void 0?void 0:i.language_info;if(s){this._languageInfo=s}else{throw new Error("Language info update failed (no session, kernel, or info available)")}}_activeCellChanged(e,t){if(!t||t.model.type!==this._type){return}this._activeEditorChanged.emit({editor:this._getCellEditor(t)})}_getCellAt(e){let t=this.virtualDocument.getEditorAtVirtualLine(e);return this._editorToCell.get(t)}_getCellEditor(e){if(!this._cellToEditor.has(e)){const t=Object.freeze({getEditor:()=>e.editor,ready:async()=>{await e.ready;return e.editor},reveal:async()=>{await this.editor.scrollToCell(e);return e.editor}});this._cellToEditor.set(e,t);this._editorToCell.set(t,e);e.disposed.connect((()=>{this._cellToEditor.delete(e);this._editorToCell.delete(t);this._editorRemoved.emit({editor:t})}));this._editorAdded.emit({editor:t})}return this._cellToEditor.get(e)}}var z=n(68148);var H=n(42856);var W=n(1143);class V extends W.Widget{constructor(){super();this._items=[];this.layout=new W.PanelLayout;this.addClass("jp-RankedPanel")}addWidget(e,t){const n={widget:e,rank:t};const i=a.ArrayExt.upperBound(this._items,n,q.itemCmp);a.ArrayExt.insert(this._items,i,n);const s=this.layout;s.insertWidget(i,e)}onChildRemoved(e){const t=a.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e.child));if(t!==-1){a.ArrayExt.removeAt(this._items,t)}}}class U extends W.Widget{constructor(e){super();this.addClass("jp-NotebookTools");this.translator=e.translator||r.nullTranslator;this._tools=[];this.layout=new W.PanelLayout;this._tracker=e.tracker;this._tracker.currentChanged.connect(this._onActiveNotebookPanelChanged,this);this._tracker.activeCellChanged.connect(this._onActiveCellChanged,this);this._tracker.selectionChanged.connect(this._onSelectionChanged,this);this._onActiveNotebookPanelChanged();this._onActiveCellChanged();this._onSelectionChanged()}get activeCell(){return this._tracker.activeCell}get selectedCells(){const e=this._tracker.currentWidget;if(!e){return[]}const t=e.content;return t.widgets.filter((e=>t.isSelectedOrActive(e)))}get activeNotebookPanel(){return this._tracker.currentWidget}addItem(e){var t;const n=e.tool;const i=(t=e.rank)!==null&&t!==void 0?t:100;let s;const o=this._tools.find((t=>t.section===e.section));if(o)s=o.panel;else{throw new Error(`The section ${e.section} does not exist`)}n.addClass("jp-NotebookTools-tool");s.addWidget(n,i);n.notebookTools=this;H.MessageLoop.sendMessage(n,U.ActiveNotebookPanelMessage);H.MessageLoop.sendMessage(n,U.ActiveCellMessage)}addSection(e){var t;const n=e.sectionName;const i=e.label||e.sectionName;const s=e.tool;let o=(t=e.rank)!==null&&t!==void 0?t:null;const r=new V;r.title.label=i;if(s)r.addWidget(s,0);this._tools.push({section:n,panel:r,rank:o});if(o!=null)this.layout.insertWidget(o,new y.Collapser({widget:r}));else{let e=null;const t=this.layout;for(let n=0;n{this._delayCallbackInScrollingNotebook(e)}),t);this.callback=e;this._delayCallbackInScrollingNotebook=e=>{const t=[];const n=[];for(const i of e){if(te(i.target)&&!ne(i.target)){t.push(i)}else{n.push(i)}}if(n.length){this.callback(n,this)}if(t.length){void this._throttler.invoke(t)}};this._throttler=new ee.Throttler((e=>{this._delayCallbackInScrollingNotebook(e)}),{limit:1e3,edge:"trailing"})}};window.ResizeObserver=class extends window.ResizeObserver{constructor(e){super((e=>{this._delayCallbackInScrollingNotebook(e)}));this.callback=e;this._delayCallbackInScrollingNotebook=e=>{const t=[];const n=[];for(const i of e){if(te(i.target)){t.push(i)}else{n.push(i)}}if(n.length){this.callback(n,this)}if(t.length){void this._throttler.invoke(t)}};this._throttler=new ee.Throttler((e=>{this._delayCallbackInScrollingNotebook(e)}),{limit:1e3,edge:"trailing"})}};class ie extends y.WindowedListModel{constructor(e,t){super(t);this.cells=e;this.estimateWidgetSize=e=>{const t=this.cells[e];if(!t){console.warn(`estimateWidgetSize requested for cell ${e} in notebook with only ${this.cells.length} cells`);return 0}const n=t.model;const i=this.cellsEstimatedHeight.get(n.id);if(typeof i==="number"){return i}const o=n.sharedModel.getSource().split("\n").length;let r=0;if(n instanceof s.CodeCellModel&&!n.isDisposed){for(let e=0;ethis.cells[e];this.scrollDownThreshold=ie.DEFAULT_CELL_MARGIN/2+ie.DEFAULT_EDITOR_LINE_HEIGHT;this.scrollUpThreshold=ie.DEFAULT_CELL_MARGIN/2;this.cellsEstimatedHeight=new Map;this._emitEstimatedHeightChanged=new ee.Debouncer((()=>{this._stateChanged.emit({name:"estimatedWidgetSize",newValue:null,oldValue:null})}));this._estimatedWidgetSize=ie.DEFAULT_CELL_SIZE}setEstimatedWidgetSize(e,t){if(t===null){if(this.cellsEstimatedHeight.has(e)){this.cellsEstimatedHeight.delete(e)}}else{this.cellsEstimatedHeight.set(e,t);this._emitEstimatedHeightChanged.invoke().catch((e=>{console.error("Fail to trigger an update following a estimated height update.",e)}))}}}ie.DEFAULT_CELL_SIZE=39;ie.DEFAULT_EDITOR_LINE_HEIGHT=17;ie.DEFAULT_CELL_MARGIN=22;class se extends y.WindowedLayout{constructor(){super(...arguments);this._header=null;this._footer=null;this._willBeRemoved=null;this._topHiddenCodeCells=-1}get header(){return this._header}set header(e){var t;if(this._header&&this._header.isAttached){W.Widget.detach(this._header)}this._header=e;if(this._header&&((t=this.parent)===null||t===void 0?void 0:t.isAttached)){W.Widget.attach(this._header,this.parent.node)}}get footer(){return this._footer}set footer(e){var t;if(this._footer&&this._footer.isAttached){W.Widget.detach(this._footer)}this._footer=e;if(this._footer&&((t=this.parent)===null||t===void 0?void 0:t.isAttached)){W.Widget.attach(this._footer,this.parent.outerNode)}}get activeCell(){return this._activeCell}set activeCell(e){this._activeCell=e}dispose(){var e,t;if(this.isDisposed){return}(e=this._header)===null||e===void 0?void 0:e.dispose();(t=this._footer)===null||t===void 0?void 0:t.dispose();super.dispose()}removeWidget(e){const t=this.widgets.indexOf(e);if(t>=0){this.removeWidgetAt(t)}else if(e===this._willBeRemoved&&this.parent){this.detachWidget(t,e)}}attachWidget(e,t){const n=t.isPlaceholder();const i=this._isSoftHidden(t);if(this.parent.isAttached&&!i){H.MessageLoop.sendMessage(t,W.Widget.Msg.BeforeAttach)}if(i){this._toggleSoftVisibility(t,true)}if(!n&&t instanceof s.CodeCell&&t.node.parentElement){t.node.style.display="";this._topHiddenCodeCells=-1;if(this.parent.isAttached&&!t.isAttached){t.setFlag(W.Widget.Flag.IsAttached)}}else if(!i){const e=this._findNearestChildBinarySearch(this.parent.viewportNode.childElementCount-1,0,parseInt(t.dataset.windowedListIndex,10)+1);let n=this.parent.viewportNode.children[e];this.parent.viewportNode.insertBefore(t.node,n);if(this.parent.isAttached){H.MessageLoop.sendMessage(t,W.Widget.Msg.AfterAttach)}}t.inViewport=true}detachWidget(e,t){t.inViewport=false;if(t===this.activeCell&&t!==this._willBeRemoved){this._toggleSoftVisibility(t,false);return}const n=t.node.querySelector("defs,.myst");if(n){this._toggleSoftVisibility(t,false);return}if(t instanceof s.CodeCell&&!t.node.classList.contains(Z)&&t!==this._willBeRemoved){t.node.style.display="none";this._topHiddenCodeCells=-1}else{if(this.parent.isAttached){H.MessageLoop.sendMessage(t,W.Widget.Msg.BeforeDetach)}this.parent.viewportNode.removeChild(t.node);t.node.classList.remove(Q)}if(this.parent.isAttached){H.MessageLoop.sendMessage(t,W.Widget.Msg.AfterDetach)}}moveWidget(e,t,n){if(this._topHiddenCodeCells<0){this._topHiddenCodeCells=0;for(let e=0;en){e=i-1}}if(t>0){return t}else{return 0}}}const oe="jp-Notebook-footer";class re extends W.Widget{constructor(e){super({node:document.createElement("button")});this.notebook=e;const t=e.translator.load("jupyterlab");this.addClass(oe);this.node.setAttribute("tabindex","-1");this.node.innerText=t.__("Click to add a cell.")}handleEvent(e){switch(e.type){case"click":this.onClick();break;case"keydown":if(e.key==="ArrowUp"){this.onArrowUp();break}}}onClick(){if(this.notebook.widgets.length>0){this.notebook.activeCellIndex=this.notebook.widgets.length-1}f.insertBelow(this.notebook);void f.focusActiveCell(this.notebook)}onArrowUp(){}onAfterAttach(e){super.onAfterAttach(e);this.node.addEventListener("click",this);this.node.addEventListener("keydown",this)}onBeforeDetach(e){this.node.removeEventListener("click",this);this.node.removeEventListener("keydown",this);super.onBeforeDetach(e)}}const ae="jpKernelUser";const le="jpCodeRunner";const de="jpUndoer";const ce="jp-Notebook";const he="jp-Notebook-cell";const ue="jp-mod-editMode";const pe="jp-mod-commandMode";const me="jp-mod-active";const ge="jp-mod-selected";const fe="jp-mod-dirty";const ve="jp-mod-multiSelected";const _e="jp-mod-unconfined";const be="jp-mod-readWrite";const ye="jp-dragImage";const we="jp-dragImage-singlePrompt";const Ce="jp-dragImage-content";const xe="jp-dragImage-prompt";const Se="jp-dragImage-multipleBack";const ke="application/vnd.jupyter.cells";const je=5;const Ie=50;const Ee="jp-collapseHeadingButton";const Te="jp-mod-showHiddenCellsButton";const Me="jp-mod-sideBySide";if(window.requestIdleCallback===undefined){window.requestIdleCallback=function(e){let t=Date.now();return setTimeout((function(){e({didTimeout:false,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})}),1)};window.cancelIdleCallback=function(e){clearTimeout(e)}}class De extends y.WindowedList{constructor(e){var t,n,i,s,o,a;const l=new Array;const c=((n=(t=e.notebookConfig)===null||t===void 0?void 0:t.windowingMode)!==null&&n!==void 0?n:De.defaultNotebookConfig.windowingMode)==="full";super({model:new ie(l,{overscanCount:(s=(i=e.notebookConfig)===null||i===void 0?void 0:i.overscanCount)!==null&&s!==void 0?s:De.defaultNotebookConfig.overscanCount,windowingActive:c}),layout:new se,renderer:(o=e.renderer)!==null&&o!==void 0?o:y.WindowedList.defaultRenderer,scrollbar:false});this._cellCollapsed=new d.Signal(this);this._cellInViewportChanged=new d.Signal(this);this._renderingLayoutChanged=new d.Signal(this);this.addClass(ce);this.cellsArray=l;this._idleCallBack=null;this._editorConfig=De.defaultEditorConfig;this._notebookConfig=De.defaultNotebookConfig;this._mimetype=O.IEditorMimeTypeService.defaultMimeType;this._notebookModel=null;this._modelChanged=new d.Signal(this);this._modelContentChanged=new d.Signal(this);this.node.dataset[ae]="true";this.node.dataset[de]="true";this.node.dataset[le]="true";this.rendermime=e.rendermime;this.translator=e.translator||r.nullTranslator;this.contentFactory=e.contentFactory;this.editorConfig=e.editorConfig||De.defaultEditorConfig;this.notebookConfig=e.notebookConfig||De.defaultNotebookConfig;this._updateNotebookConfig();this._mimetypeService=e.mimeTypeService;this.renderingLayout=(a=e.notebookConfig)===null||a===void 0?void 0:a.renderingLayout;this.kernelHistory=e.kernelHistory}get cellCollapsed(){return this._cellCollapsed}get cellInViewportChanged(){return this._cellInViewportChanged}get modelChanged(){return this._modelChanged}get modelContentChanged(){return this._modelContentChanged}get renderingLayoutChanged(){return this._renderingLayoutChanged}get model(){return this._notebookModel}set model(e){var t;e=e||null;if(this._notebookModel===e){return}const n=this._notebookModel;this._notebookModel=e;this._onModelChanged(n,e);this.onModelChanged(n,e);this._modelChanged.emit(void 0);this.viewModel.itemsList=(t=e===null||e===void 0?void 0:e.cells)!==null&&t!==void 0?t:null}get codeMimetype(){return this._mimetype}get widgets(){return this.cellsArray}get editorConfig(){return this._editorConfig}set editorConfig(e){this._editorConfig=e;this._updateEditorConfig()}get notebookConfig(){return this._notebookConfig}set notebookConfig(e){this._notebookConfig=e;this._updateNotebookConfig()}get renderingLayout(){return this._renderingLayout}set renderingLayout(e){var t;this._renderingLayout=e;if(this._renderingLayout==="side-by-side"){this.node.classList.add(Me)}else{this.node.classList.remove(Me)}this._renderingLayoutChanged.emit((t=this._renderingLayout)!==null&&t!==void 0?t:"default")}dispose(){var e;if(this.isDisposed){return}this._notebookModel=null;(e=this.layout.header)===null||e===void 0?void 0:e.dispose();super.dispose()}moveCell(e,t,n=1){if(!this.model){return}const i=Math.min(this.model.cells.length-1,Math.max(0,t));if(i===e){return}const s=new Array(n);let o=new Array(n);for(let r=0;rt){if(this.widgets[t+r].model.type==="code"){this.widgets[t+r].model.isDirty=o[r]}}else{if(this.widgets[t+r-n+1].model.type==="code"){this.widgets[t+r-n+1].model.isDirty=o[r]}}}}renderCellOutputs(e){const t=this.viewModel.widgetRenderer(e);if(t instanceof s.CodeCell&&t.isPlaceholder()){t.dataset.windowedListIndex=`${e}`;this.layout.insertWidget(e,t);if(this.notebookConfig.windowingMode==="full"){requestAnimationFrame((()=>{this.layout.removeWidget(t)}))}}}addHeader(){const e=this.translator.load("jupyterlab");const t=new W.Widget;t.node.textContent=e.__("The notebook is empty. Click the + button on the toolbar to add a new cell.");this.layout.header=t}removeHeader(){var e;(e=this.layout.header)===null||e===void 0?void 0:e.dispose();this.layout.header=null}onModelChanged(e,t){}onModelContentChanged(e,t){this._modelContentChanged.emit(void 0)}onMetadataChanged(e,t){switch(t.key){case"language_info":this._updateMimetype();break;default:break}}onCellInserted(e,t){}onCellRemoved(e,t){}onUpdateRequest(e){if(this.notebookConfig.windowingMode==="defer"){void this._runOnIdleTime()}else{super.onUpdateRequest(e)}}_onModelChanged(e,t){var n;if(e){e.contentChanged.disconnect(this.onModelContentChanged,this);e.metadataChanged.disconnect(this.onMetadataChanged,this);e.cells.changed.disconnect(this._onCellsChanged,this);while(this.cellsArray.length){this._removeCell(0)}}if(!t){this._mimetype=O.IEditorMimeTypeService.defaultMimeType;return}this._updateMimetype();const i=t.cells;const s=(n=t.collaborative)!==null&&n!==void 0?n:false;if(!s&&!i.length){t.sharedModel.insertCell(0,{cell_type:this.notebookConfig.defaultCell,metadata:this.notebookConfig.defaultCell==="code"?{trusted:true}:{}})}let o=-1;for(const r of i){this._insertCell(++o,r)}t.cells.changed.connect(this._onCellsChanged,this);t.metadataChanged.connect(this.onMetadataChanged,this);t.contentChanged.connect(this.onModelContentChanged,this)}_onCellsChanged(e,t){this.removeHeader();switch(t.type){case"add":{let e=0;e=t.newIndex;for(const n of t.newValues){this._insertCell(e++,n)}this._updateDataWindowedListIndex(t.newIndex,this.model.cells.length,t.newValues.length);break}case"remove":for(let e=t.oldValues.length;e>0;e--){this._removeCell(t.oldIndex)}this._updateDataWindowedListIndex(t.oldIndex,this.model.cells.length+t.oldValues.length,-1*t.oldValues.length);if(!e.length){const e=this.model;requestAnimationFrame((()=>{if(e&&!e.isDisposed&&!e.sharedModel.cells.length){e.sharedModel.insertCell(0,{cell_type:this.notebookConfig.defaultCell,metadata:this.notebookConfig.defaultCell==="code"?{trusted:true}:{}})}}))}break;default:return}if(!this.model.sharedModel.cells.length){this.addHeader()}this.update()}_insertCell(e,t){let n;switch(t.type){case"code":n=this._createCodeCell(t);n.model.mimeType=this._mimetype;break;case"markdown":n=this._createMarkdownCell(t);if(t.sharedModel.getSource()===""){n.rendered=false}break;default:n=this._createRawCell(t)}n.inViewportChanged.connect(this._onCellInViewportChanged,this);n.addClass(he);a.ArrayExt.insert(this.cellsArray,e,n);this.onCellInserted(e,n);this._scheduleCellRenderOnIdle()}_createCodeCell(e){const t=this.rendermime;const n=this.contentFactory;const i=this.editorConfig.code;const s={contentFactory:n,editorConfig:i,inputHistoryScope:this.notebookConfig.inputHistoryScope,showInputPlaceholder:this.notebookConfig.showInputPlaceholder,maxNumberOutputs:this.notebookConfig.maxNumberOutputs,model:e,placeholder:this._notebookConfig.windowingMode!=="none",rendermime:t,translator:this.translator};const o=this.contentFactory.createCodeCell(s);o.syncCollapse=true;o.syncEditable=true;o.syncScrolled=true;o.outputArea.inputRequested.connect(((e,t)=>{this._onInputRequested(o).catch((e=>{console.error("Failed to scroll to cell requesting input.",e)}));t.disposed.connect((()=>{o.node.focus()}))}));return o}_createMarkdownCell(e){const t=this.rendermime;const n=this.contentFactory;const i=this.editorConfig.markdown;const s={contentFactory:n,editorConfig:i,model:e,placeholder:this._notebookConfig.windowingMode!=="none",rendermime:t,showEditorForReadOnlyMarkdown:this._notebookConfig.showEditorForReadOnlyMarkdown};const o=this.contentFactory.createMarkdownCell(s);o.syncCollapse=true;o.syncEditable=true;o.headingCollapsedChanged.connect(this._onCellCollapsed,this);return o}_createRawCell(e){const t=this.contentFactory;const n=this.editorConfig.raw;const i={editorConfig:n,model:e,contentFactory:t,placeholder:this._notebookConfig.windowingMode!=="none"};const s=this.contentFactory.createRawCell(i);s.syncCollapse=true;s.syncEditable=true;return s}_removeCell(e){const t=this.cellsArray[e];t.parent=null;a.ArrayExt.removeAt(this.cellsArray,e);this.onCellRemoved(e,t);t.dispose()}_updateMimetype(){var e;const t=(e=this._notebookModel)===null||e===void 0?void 0:e.getMetadata("language_info");if(!t){return}this._mimetype=this._mimetypeService.getMimeTypeByLanguage(t);for(const n of this.widgets){if(n.model.type==="code"){n.model.mimeType=this._mimetype}}}_onCellCollapsed(e,t){f.setHeadingCollapse(e,t,this);this._cellCollapsed.emit(e)}_onCellInViewportChanged(e){this._cellInViewportChanged.emit(e)}async _onInputRequested(e){if(!e.inViewport){const t=this.widgets.findIndex((t=>t===e));if(t>=0){await this.scrollToItem(t);const n=e.node.querySelector(".jp-Stdin");if(n){J.ElementExt.scrollIntoViewIfNeeded(this.node,n);n.focus()}}}}_scheduleCellRenderOnIdle(){if(this.notebookConfig.windowingMode!=="none"&&!this.isDisposed){if(!this._idleCallBack){this._idleCallBack=requestIdleCallback((e=>{this._idleCallBack=null;void this._runOnIdleTime(e.didTimeout?Ie:e.timeRemaining())}),{timeout:3e3})}}}_updateDataWindowedListIndex(e,t,n){for(let i=0;i=e&&o{this.viewModel.setEstimatedWidgetSize(e.model.id,e.node.getBoundingClientRect().height);this.layout.removeWidget(e)}))}}}n++}if(n{if(!this._element){this._element=this._createElement();this._notebook.activeCellChanged.connect(this._updateActive);this._notebook.selectionChanged.connect(this._updateSelection);if(this._model.type==="code"){const e=this._model;e.outputs.changed.connect(this._updatePrompt);e.stateChanged.connect(this._updateState)}}if(this._model.type!=this._element.dataset.type){this._element.dataset.type=this._model.type}const t=this._model.sharedModel.source;const n=t.length>1e4?t.substring(0,1e4):t;if(n!==this._source.textContent){this._source.textContent=n}this._updateActive();this._updateSelection();this._updatePrompt();this._updateDirty();return this._element};this.dispose=()=>{this._isDisposed=true;this._notebook.activeCellChanged.disconnect(this._updateActive);this._notebook.selectionChanged.disconnect(this._updateSelection);if(this._model.type==="code"){const e=this._model;if(e.outputs){e.outputs.changed.disconnect(this._updatePrompt);e.stateChanged.disconnect(this._updateState)}}};this._updateState=(e,t)=>{switch(t.name){case"executionCount":case"executionState":this._updatePrompt();break;case"isDirty":{this._updateDirty();break}}};this._updatePrompt=()=>{if(this._model.type!=="code"){return}const e=this._model;let t=false;for(let s=0;s{var e;if(!this._element){this._element=this._createElement()}const t=this._element;const n=t.classList.contains(me);if(((e=this._notebook.activeCell)===null||e===void 0?void 0:e.model)===this._model){if(!n){t.classList.add(me)}}else if(n){t.classList.remove(me);t.classList.remove(ge)}};this._updateSelection=()=>{if(!this._element){this._element=this._createElement()}const e=this._element;const t=e.classList.contains(ge);if(this._notebook.selectedCells.some((e=>this._model===e.model))){if(!t){e.classList.add(ge)}}else if(t){e.classList.remove(ge)}};this._isDisposed=false;this._element=null;this._model=e.model;this._notebook=e.notebook}get key(){return this._model.id}get isDisposed(){if(!this._isDisposed&&this._model.isDisposed){this.dispose()}return this._isDisposed}_updateDirty(){if(this._model.type!=="code"||!this._element){return}const e=this._model;const t=this._element.classList.contains(fe);if(t!==e.isDirty){if(e.isDirty){this._element.classList.add(fe)}else{this._element.classList.remove(fe)}}}_createElement(){const e=document.createElement("li");const t=this._executionIndicator=document.createElement("div");t.className="jp-scrollbarItem-executionIndicator";const n=this._source=document.createElement("div");n.className="jp-scrollbarItem-source";e.append(t);e.append(n);return e}}class Pe extends De{constructor(e){super({renderer:{createOuter(){return document.createElement("div")},createViewport(){const e=document.createElement("div");e.setAttribute("role","feed");e.setAttribute("aria-label","Cells");return e},createScrollbar(){return document.createElement("ol")},createScrollbarViewportIndicator(){return document.createElement("div")},createScrollbarItem(e,t,n){return new Ae({notebook:e,model:n})}},...e});this._activeCellIndex=-1;this._activeCell=null;this._mode="command";this._drag=null;this._dragData=null;this._selectData=null;this._mouseMode=null;this._activeCellChanged=new d.Signal(this);this._stateChanged=new d.Signal(this);this._selectionChanged=new d.Signal(this);this._checkCacheOnNextResize=false;this._lastClipboardInteraction=null;this._selectedCells=[];this.outerNode.setAttribute("data-lm-dragscroll","true");this.activeCellChanged.connect(this._updateSelectedCells,this);this.jumped.connect(((e,t)=>this.activeCellIndex=t));this.selectionChanged.connect(this._updateSelectedCells,this);this.addFooter()}get selectedCells(){return this._selectedCells}addFooter(){const e=new re(this);this.layout.footer=e}_onCellsChanged(e,t){var n,i;const s=(n=this.activeCell)===null||n===void 0?void 0:n.model.id;super._onCellsChanged(e,t);if(s){const e=(i=this.model)===null||i===void 0?void 0:i.sharedModel.cells.findIndex((e=>e.getId()===s));if(e!=null){this.activeCellIndex=e}}}get activeCellChanged(){return this._activeCellChanged}get stateChanged(){return this._stateChanged}get selectionChanged(){return this._selectionChanged}get mode(){return this._mode}set mode(e){this.setMode(e)}setMode(e,t={}){var n;const i=(n=t.focus)!==null&&n!==void 0?n:true;const o=this.activeCell;if(!o){e="command"}if(e===this._mode){if(i){this._ensureFocus()}return}this.update();const r=this._mode;this._mode=e;if(e==="edit"){for(const e of this.widgets){this.deselect(e)}if(o instanceof s.MarkdownCell){o.rendered=false}o.inputHidden=false}else{if(i){void f.focusActiveCell(this,{waitUntilReady:false,preventScroll:true})}}this._stateChanged.emit({name:"mode",oldValue:r,newValue:e});if(i){this._ensureFocus()}}get activeCellIndex(){if(!this.model){return-1}return this.widgets.length?this._activeCellIndex:-1}set activeCellIndex(e){var t,n;const i=this._activeCellIndex;if(!this.model||!this.widgets.length){e=-1}else{e=Math.max(e,0);e=Math.min(e,this.widgets.length-1)}this._activeCellIndex=e;const o=(t=this.widgets[i])!==null&&t!==void 0?t:null;const r=(n=this.widgets[e])!==null&&n!==void 0?n:null;this.layout.activeCell=r;const a=r!==this._activeCell;if(a){this.update();this._activeCell=r}if(a||e!=i){this._activeCellChanged.emit(r)}if(this.mode==="edit"){if(r instanceof s.MarkdownCell){r.rendered=false}if(this.notebookConfig.autoRenderMarkdownCells&&a&&o instanceof s.MarkdownCell){o.rendered=true}}this._ensureFocus();if(e===i){return}this._trimSelections();this._stateChanged.emit({name:"activeCellIndex",oldValue:i,newValue:e})}get activeCell(){return this._activeCell}get lastClipboardInteraction(){return this._lastClipboardInteraction}set lastClipboardInteraction(e){this._lastClipboardInteraction=e}dispose(){if(this.isDisposed){return}this._activeCell=null;super.dispose()}moveCell(e,t,n=1){const i=e<=this.activeCellIndex&&this.activeCellIndext?0:n-1):-1;const s=this.widgets.slice(e,e+n).map((e=>this.isSelected(e)));super.moveCell(e,t,n);if(i>=0){this.activeCellIndex=i}if(e>t){s.forEach(((e,n)=>{if(e){this.select(this.widgets[t+n])}}))}else{s.forEach(((e,i)=>{if(e){this.select(this.widgets[t-n+1+i])}}))}}select(e){if(Le.selectedProperty.get(e)){return}Le.selectedProperty.set(e,true);this._selectionChanged.emit(void 0);this.update()}deselect(e){if(!Le.selectedProperty.get(e)){return}Le.selectedProperty.set(e,false);this._selectionChanged.emit(void 0);this.update()}isSelected(e){return Le.selectedProperty.get(e)}isSelectedOrActive(e){if(e===this._activeCell){return true}return Le.selectedProperty.get(e)}deselectAll(){let e=false;for(const t of this.widgets){if(Le.selectedProperty.get(t)){e=true}Le.selectedProperty.set(t,false)}if(e){this._selectionChanged.emit(void 0)}this.activeCellIndex=this.activeCellIndex;this.update()}extendContiguousSelectionTo(e){let{head:t,anchor:n}=this.getContiguousSelection();let i;if(n===null||t===null){if(e===this.activeCellIndex){return}t=this.activeCellIndex;n=this.activeCellIndex}this.activeCellIndex=e;e=this.activeCellIndex;if(e===n){this.deselectAll();return}let s=false;if(tthis.isSelected(e)));if(t===-1){return{head:null,anchor:null}}const n=a.ArrayExt.findLastIndex(e,(e=>this.isSelected(e)),-1,t);for(let s=t;s<=n;s++){if(!this.isSelected(e[s])){throw new Error("Selection not contiguous")}}const i=this.activeCellIndex;if(t!==i&&n!==i){throw new Error("Active cell not at endpoint of selection")}if(t===i){return{head:t,anchor:n}}else{return{head:n,anchor:t}}}async scrollToCell(e,t="auto"){try{await this.scrollToItem(this.widgets.findIndex((t=>t===e)),t)}catch(n){}this.deselectAll();this.select(e);e.activate()}_parseFragment(e){const t=e.slice(1);if(!t){return}const n=t.split("=");if(n.length===1){return{kind:"legacy",value:t}}return{kind:n[0],value:n.slice(1).join("=")}}async setFragment(e){const t=this._parseFragment(e);if(!t){return}let n;switch(t.kind){case"heading":n=await this._findHeading(t.value);break;case"cell-id":n=this._findCellById(t.value);break;case"legacy":n=await this._findLegacy(t.value);break;default:console.warn(`Unknown target type for URI fragment ${e}, interpreting as a heading`);n=await this._findLegacy(t.kind+"="+t.value);break}if(n==null){return}let{cell:i,element:s}=n;if(!i.inViewport){await this.scrollToCell(i,"center")}if(s==null){s=i.node}s.scrollIntoView()}handleEvent(e){if(!this.model){return}switch(e.type){case"contextmenu":if(e.eventPhase===Event.CAPTURING_PHASE){this._evtContextMenuCapture(e)}break;case"mousedown":if(e.eventPhase===Event.CAPTURING_PHASE){this._evtMouseDownCapture(e)}else{if(!e.defaultPrevented){this._evtMouseDown(e)}}break;case"mouseup":if(e.currentTarget===document){this._evtDocumentMouseup(e)}break;case"mousemove":if(e.currentTarget===document){this._evtDocumentMousemove(e)}break;case"keydown":this._ensureFocus(true);break;case"dblclick":this._evtDblClick(e);break;case"focusin":this._evtFocusIn(e);break;case"focusout":this._evtFocusOut(e);break;case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;default:super.handleEvent(e);break}}onAfterAttach(e){super.onAfterAttach(e);const t=this.node;t.addEventListener("contextmenu",this,true);t.addEventListener("mousedown",this,true);t.addEventListener("mousedown",this);t.addEventListener("keydown",this);t.addEventListener("dblclick",this);t.addEventListener("focusin",this);t.addEventListener("focusout",this);t.addEventListener("lm-dragenter",this,true);t.addEventListener("lm-dragleave",this,true);t.addEventListener("lm-dragover",this,true);t.addEventListener("lm-drop",this,true)}onBeforeDetach(e){const t=this.node;t.removeEventListener("contextmenu",this,true);t.removeEventListener("mousedown",this,true);t.removeEventListener("mousedown",this);t.removeEventListener("keydown",this);t.removeEventListener("dblclick",this);t.removeEventListener("focusin",this);t.removeEventListener("focusout",this);t.removeEventListener("lm-dragenter",this,true);t.removeEventListener("lm-dragleave",this,true);t.removeEventListener("lm-dragover",this,true);t.removeEventListener("lm-drop",this,true);document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true);super.onBeforeAttach(e)}onAfterShow(e){super.onAfterShow(e);this._checkCacheOnNextResize=true}onResize(e){var t;if(!this._checkCacheOnNextResize){return super.onResize(e)}super.onResize(e);this._checkCacheOnNextResize=false;const n=this._cellLayoutStateCache;const i=parseInt(this.node.style.width,10);if(n){if(i===n.width){return}}this._cellLayoutStateCache={width:i};for(const o of this.widgets){if(o instanceof s.Cell&&o.inViewport){(t=o.editorWidget)===null||t===void 0?void 0:t.update()}}}onBeforeHide(e){super.onBeforeHide(e);const t=parseInt(this.node.style.width,10);this._cellLayoutStateCache={width:t}}onActivateRequest(e){super.onActivateRequest(e);this._ensureFocus(true)}onUpdateRequest(e){super.onUpdateRequest(e);const t=this.activeCell;if(this.mode==="edit"){this.addClass(ue);this.removeClass(pe)}else{this.addClass(pe);this.removeClass(ue)}let n=0;for(const i of this.widgets){if(i===t){t.addClass(me);t.addClass(ge);t.node.tabIndex=0}else{i.node.tabIndex=-1;i.removeClass(me);i.removeClass(ve)}if(this.isSelectedOrActive(i)){i.addClass(ge);n++}else{i.removeClass(ge)}}if(t&&n>1){t.addClass(ve)}}onCellInserted(e,t){void t.ready.then((()=>{if(!t.isDisposed){t.editor.edgeRequested.connect(this._onEdgeRequest,this)}}));t.scrollRequested.connect(((e,n)=>{if(t!==this.activeCell){return}if(!n.defaultPrevented){return}const i=this.outerNode;if(t.inViewport){return n.scrollWithinCell({scroller:i})}this.scrollToItem(this.activeCellIndex).then((()=>{void t.ready.then((()=>{n.scrollWithinCell({scroller:i})}))})).catch((e=>{}))}));this.activeCellIndex=e<=this.activeCellIndex?this.activeCellIndex+1:this.activeCellIndex}onCellRemoved(e,t){this.activeCellIndex=e<=this.activeCellIndex?this.activeCellIndex-1:this.activeCellIndex;if(this.isSelected(t)){this._selectionChanged.emit(void 0)}}onModelChanged(e,t){super.onModelChanged(e,t);this.activeCellIndex=0}_onEdgeRequest(e,t){const n=this.activeCellIndex;if(t==="top"){this.activeCellIndex--;if(this.activeCellIndexn){const e=this.activeCell.editor;if(e){e.setCursorPosition({line:0,column:0})}}}this.mode="edit"}_ensureFocus(e=false){var t,n;const i=this.layout.footer;if(i&&document.activeElement===i.node){return}const s=this.activeCell;if(this.mode==="edit"&&s){if(((t=s.editor)===null||t===void 0?void 0:t.hasFocus())!==true){if(s.inViewport){(n=s.editor)===null||n===void 0?void 0:n.focus()}else{this.scrollToItem(this.activeCellIndex).then((()=>{void s.ready.then((()=>{var e;(e=s.editor)===null||e===void 0?void 0:e.focus()}))})).catch((e=>{}))}}}if(e&&s&&!s.node.contains(document.activeElement)){void f.focusActiveCell(this,{preventScroll:true})}}_findCell(e){let t=e;while(t&&t!==this.node){if(t.classList.contains(he)){const e=a.ArrayExt.findFirstIndex(this.widgets,(e=>e.node===t));if(e!==-1){return e}break}t=t.parentElement}return-1}_findEventTargetAndCell(e){let t=e.target;let n=this._findCell(t);if(n===-1){t=document.elementFromPoint(e.clientX,e.clientY);n=this._findCell(t)}return[t,n]}async _findHeading(e){var t;for(let n=0;n=je||i>=je){this._mouseMode=null;this._startDrag(t.index,e.clientX,e.clientY)}break}default:break}}_evtDragEnter(e){if(!e.mimeData.hasData(ke)){return}e.preventDefault();e.stopPropagation();const t=e.target;const n=this._findCell(t);if(n===-1){return}const i=this.cellsArray[n];i.node.classList.add(Q)}_evtDragLeave(e){if(!e.mimeData.hasData(ke)){return}e.preventDefault();e.stopPropagation();const t=this.node.getElementsByClassName(Q);if(t.length){t[0].classList.remove(Q)}}_evtDragOver(e){if(!e.mimeData.hasData(ke)){return}e.preventDefault();e.stopPropagation();e.dropAction=e.proposedAction;const t=this.node.getElementsByClassName(Q);if(t.length){t[0].classList.remove(Q)}const n=e.target;const i=this._findCell(n);if(i===-1){return}const s=this.cellsArray[i];s.node.classList.add(Q)}_evtDrop(e){if(!e.mimeData.hasData(ke)){return}e.preventDefault();e.stopPropagation();if(e.proposedAction==="none"){e.dropAction="none";return}let t=e.target;while(t&&t.parentElement){if(t.classList.contains(Q)){t.classList.remove(Q);break}t=t.parentElement}const n=this.model;const i=e.source;if(i===this){e.dropAction="move";const n=e.mimeData.getData("internal:cells");const o=n[n.length-1];if(o instanceof s.MarkdownCell&&o.headingCollapsed){const e=f.findNextParentHeading(o,i);if(e>0){const t=(0,a.findIndex)(i.widgets,(e=>o.model.id===e.model.id));n.push(...i.widgets.slice(t+1,e))}}let r=a.ArrayExt.firstIndexOf(this.widgets,n[0]);let l=this._findCell(t);if(l!==-1&&l>r){l-=1}else if(l===-1){l=this.widgets.length-1}if(l>=r&&le.model.sharedModel.getSource())).join("\n");this._drag.mimeData.setData("text/plain",u);document.removeEventListener("mousemove",this,true);document.removeEventListener("mouseup",this,true);this._mouseMode=null;void this._drag.start(t,n).then((e=>{if(this.isDisposed){return}this._drag=null;for(const t of r){t.removeClass(Z)}}))}_updateReadWrite(){const e=i.DOMUtils.hasActiveEditableElement(this.node);this.node.classList.toggle(be,e)}_evtFocusIn(e){var t,n;this._updateReadWrite();const i=e.target;const s=this._findCell(i);if(s!==-1){const e=this.widgets[s];if(e.editorWidget&&!e.editorWidget.node.contains(i)){this.setMode("command",{focus:false})}this.activeCellIndex=s;const n=(t=e.editorWidget)===null||t===void 0?void 0:t.node;if(n===null||n===void 0?void 0:n.contains(i)){this.setMode("edit",{focus:false})}}else{this.setMode("command",{focus:false});e.preventDefault();const t=e.relatedTarget;if(this._activeCell&&!this._activeCell.node.contains(t)){this._activeCell.ready.then((()=>{var e;(e=this._activeCell)===null||e===void 0?void 0:e.node.focus({preventScroll:true})})).catch((()=>{var e;(e=this.layout.footer)===null||e===void 0?void 0:e.node.focus({preventScroll:true})}))}else{(n=this.layout.footer)===null||n===void 0?void 0:n.node.focus({preventScroll:true})}}}_evtFocusOut(e){var t;this._updateReadWrite();const n=e.relatedTarget;if(!n){return}const i=this._findCell(n);if(i!==-1){const e=this.widgets[i];if((t=e.editorWidget)===null||t===void 0?void 0:t.node.contains(n)){return}}if(this.mode!=="command"){this.setMode("command",{focus:false})}}_evtDblClick(e){const t=this.model;if(!t){return}this.deselectAll();const[n,i]=this._findEventTargetAndCell(e);if(e.target.classList.contains(Ee)){return}if(i===-1){return}this.activeCellIndex=i;if(t.cells.get(i).type==="markdown"){const e=this.widgets[i];e.rendered=false}else if(n.localName==="img"){n.classList.toggle(_e)}}_trimSelections(){for(let e=0;ethis.isSelectedOrActive(e)));if(this.kernelHistory){this.kernelHistory.reset()}}}(function(e){class t extends De.ContentFactory{}e.ContentFactory=t})(Pe||(Pe={}));var Le;(function(e){e.selectedProperty=new Y.AttachedProperty({name:"selected",create:()=>false});class t extends W.PanelLayout{onUpdateRequest(e){}}e.NotebookPanelLayout=t;function n(e,t,n){if(e>1){if(t!==""){return X.VirtualDOM.realize(X.h.div(X.h.div({className:ye},X.h.span({className:xe},"["+t+"]:"),X.h.span({className:Ce},n)),X.h.div({className:Se},"")))}else{return X.VirtualDOM.realize(X.h.div(X.h.div({className:ye},X.h.span({className:xe}),X.h.span({className:Ce},n)),X.h.div({className:Se},"")))}}else{if(t!==""){return X.VirtualDOM.realize(X.h.div(X.h.div({className:`${ye} ${we}`},X.h.span({className:xe},"["+t+"]:"),X.h.span({className:Ce},n))))}else{return X.VirtualDOM.realize(X.h.div(X.h.div({className:`${ye} ${we}`},X.h.span({className:xe}),X.h.span({className:Ce},n))))}}}e.createDragImage=n})(Le||(Le={}));const Re="jp-NotebookPanel";const Ne="jp-NotebookPanel-toolbar";const Oe="jp-NotebookPanel-notebook";class Be extends $.DocumentWidget{constructor(e){super(e);this._autorestarting=false;this.addClass(Re);this.toolbar.addClass(Ne);this.content.addClass(Oe);this.content.model=this.context.model;this.context.sessionContext.kernelChanged.connect(this._onKernelChanged,this);this.context.sessionContext.statusChanged.connect(this._onSessionStatusChanged,this);this.context.saveState.connect(this._onSave,this);void this.revealed.then((()=>{if(this.isDisposed){return}if(this.content.widgets.length===1){const e=this.content.widgets[0].model;if(e.type==="code"&&e.sharedModel.getSource()===""){this.content.mode="edit"}}}))}_onSave(e,t){if(t==="started"&&this.model){for(const e of this.model.cells){if((0,s.isMarkdownCellModel)(e)){for(const t of e.attachments.keys){if(!e.sharedModel.getSource().includes(t)){e.attachments.remove(t)}}}}}}get sessionContext(){return this.context.sessionContext}get model(){return this.content.model}setConfig(e){this.content.editorConfig=e.editorConfig;this.content.notebookConfig=e.notebookConfig;const t=this.context.sessionContext.kernelPreference;this.context.sessionContext.kernelPreference={...t,shutdownOnDispose:e.kernelShutdown,autoStartDefault:e.autoStartDefault}}setFragment(e){void this.context.ready.then((()=>{void this.content.setFragment(e)}))}dispose(){this.content.dispose();super.dispose()}[i.Printing.symbol](){return async()=>{if(this.context.model.dirty&&!this.context.model.readOnly){await this.context.save()}await i.Printing.printURL(o.PageConfig.getNBConvertURL({format:"html",download:false,path:this.context.path}))}}onBeforeHide(e){super.onBeforeHide(e);this.content.isParentHidden=true}onBeforeShow(e){this.content.isParentHidden=false;super.onBeforeShow(e)}_onKernelChanged(e,t){if(!this.model||!t.newValue){return}const{newValue:n}=t;void n.info.then((e=>{var t;if(this.model&&((t=this.context.sessionContext.session)===null||t===void 0?void 0:t.kernel)===n){this._updateLanguage(e.language_info)}}));void this._updateSpec(n)}_onSessionStatusChanged(e,t){var n;if(t==="autorestarting"&&!this._autorestarting){void(0,i.showDialog)({title:this._trans.__("Kernel Restarting"),body:this._trans.__("The kernel for %1 appears to have died. It will restart automatically.",(n=this.sessionContext.session)===null||n===void 0?void 0:n.path),buttons:[i.Dialog.okButton({label:this._trans.__("Ok")})]});this._autorestarting=true}else if(t==="restarting"){}else{this._autorestarting=false}}_updateLanguage(e){this.model.setMetadata("language_info",e)}async _updateSpec(e){const t=await e.spec;if(this.isDisposed){return}this.model.setMetadata("kernelspec",{name:e.name,display_name:t===null||t===void 0?void 0:t.display_name,language:t===null||t===void 0?void 0:t.language})}}(function(e){class t extends Pe.ContentFactory{createNotebook(e){return new Pe(e)}}e.ContentFactory=t;e.IContentFactory=new l.Token("@jupyterlab/notebook:IContentFactory",`A factory object that creates new notebooks.\n Use this if you want to create and host notebooks in your own UI elements.`)})(Be||(Be={}));var Fe=n(87277);class ze extends Fe.SearchProvider{constructor(e,t=r.nullTranslator){super(e);this.translator=t;this._textSelection=null;this._currentProviderIndex=null;this._delayedActiveCellChangeHandler=null;this._onSelection=false;this._selectedCells=1;this._selectedLines=0;this._query=null;this._searchProviders=[];this._editorSelectionsObservable=null;this._selectionSearchMode="cells";this._selectionLock=false;this._searchActive=false;this._handleHighlightsAfterActiveCellChange=this._handleHighlightsAfterActiveCellChange.bind(this);this.widget.model.cells.changed.connect(this._onCellsChanged,this);this.widget.content.activeCellChanged.connect(this._onActiveCellChanged,this);this.widget.content.selectionChanged.connect(this._onCellSelectionChanged,this);this.widget.content.stateChanged.connect(this._onNotebookStateChanged,this);this._observeActiveCell();this._filtersChanged.connect(this._setEnginesSelectionSearchMode,this)}_onNotebookStateChanged(e,t){if(t.name==="mode"){window.setTimeout((()=>{var e;if(t.newValue==="command"&&((e=document.activeElement)===null||e===void 0?void 0:e.closest(".jp-DocumentSearch-overlay"))){return}this._updateSelectionMode();this._filtersChanged.emit()}),0)}}static isApplicable(e){return e instanceof Be}static createNew(e,t){return new ze(e,t)}get currentMatchIndex(){let e=0;let t=false;for(let n=0;ne+=t.matchesCount),0)}get isReadOnly(){var e,t,n;return(n=(t=(e=this.widget)===null||e===void 0?void 0:e.content.model)===null||t===void 0?void 0:t.readOnly)!==null&&n!==void 0?n:false}get replaceOptionsSupport(){return{preserveCase:true}}getSelectionState(){const e=this._selectionSearchMode==="cells";const t=e?this._selectedCells:this._selectedLines;return t>1?"multiple":t===1&&!e?"single":"none"}dispose(){var e;if(this.isDisposed){return}this.widget.content.activeCellChanged.disconnect(this._onActiveCellChanged,this);(e=this.widget.model)===null||e===void 0?void 0:e.cells.changed.disconnect(this._onCellsChanged,this);this.widget.content.stateChanged.disconnect(this._onNotebookStateChanged,this);this.widget.content.selectionChanged.disconnect(this._onCellSelectionChanged,this);this._stopObservingLastCell();super.dispose();const t=this.widget.content.activeCellIndex;this.endQuery().then((()=>{if(!this.widget.isDisposed){this.widget.content.activeCellIndex=t}})).catch((e=>{console.error(`Fail to end search query in notebook:\n${e}`)}))}getFilters(){const e=this.translator.load("jupyterlab");return{output:{title:e.__("Search Cell Outputs"),description:e.__("Search in the cell outputs."),disabledDescription:e.__("Search in the cell outputs (not available when replace options are shown)."),default:false,supportReplace:false},selection:{title:this._selectionSearchMode==="cells"?e._n("Search in %1 Selected Cell","Search in %1 Selected Cells",this._selectedCells):e._n("Search in %1 Selected Line","Search in %1 Selected Lines",this._selectedLines),description:e.__("Search only in the selected cells or text (depending on edit/command mode)."),default:false,supportReplace:true}}}_updateSelectionMode(){if(this._selectionLock){return}this._selectionSearchMode=this._selectedCells===1&&this.widget.content.mode==="edit"&&this._selectedLines!==0?"text":"cells"}getInitialQuery(){var e;return((e=window.getSelection())===null||e===void 0?void 0:e.toString())||""}async clearHighlight(){this._selectionLock=true;if(this._currentProviderIndex!==null&&this._currentProviderIndex{const o=(0,s.createCellSearchProvider)(t);await o.setIsActive(!this._filters.selection||this.widget.content.isSelectedOrActive(t));if(this._onSelection&&this._selectionSearchMode==="text"&&n===i){if(this._textSelection){await o.setSearchSelection(this._textSelection)}}await o.startQuery(e,this._filters);return o})));this._currentProviderIndex=i;await this.highlightNext(true,{from:"selection-start",scroll:false,select:false});return Promise.resolve()}async endQuery(){await Promise.all(this._searchProviders.map((e=>e.endQuery().then((()=>{e.dispose()})))));this._searchActive=false;this._searchProviders.length=0;this._currentProviderIndex=null}async replaceCurrentMatch(e,t=true,n){let i=false;const s=async(e=false)=>{var n;const i=(n=this.widget)===null||n===void 0?void 0:n.content.activeCell;if((i===null||i===void 0?void 0:i.model.type)==="markdown"&&i.rendered){i.rendered=false;if(e){await this.highlightNext(t)}}};if(this._currentProviderIndex!==null){await s();const o=this._searchProviders[this._currentProviderIndex];i=await o.replaceCurrentMatch(e,false,n);if(o.currentMatchIndex===null){await this.highlightNext(t,{from:"previous-match"})}}await s(true);return i}async replaceAllMatches(e,t){const n=await Promise.all(this._searchProviders.map((n=>n.replaceAllMatches(e,t))));return n.includes(true)}async validateFilter(e,t){if(e!=="output"){return t}if(t&&this.widget.content.widgets.some((e=>e instanceof s.CodeCell&&e.isPlaceholder()))){const e=this.translator.load("jupyterlab");const t=await(0,i.showDialog)({title:e.__("Confirmation"),body:e.__("Searching outputs requires you to run all cells and render their outputs. Are you sure you want to search in the cell outputs?"),buttons:[i.Dialog.cancelButton({label:e.__("Cancel")}),i.Dialog.okButton({label:e.__("Ok")})]});if(t.button.accept){this.widget.content.widgets.forEach(((e,t)=>{if(e instanceof s.CodeCell&&e.isPlaceholder()){this.widget.content.renderCellOutputs(t)}}))}else{return false}}return t}_addCellProvider(e){var t,n;const i=this.widget.content.widgets[e];const o=(0,s.createCellSearchProvider)(i);a.ArrayExt.insert(this._searchProviders,e,o);void o.setIsActive(!((n=(t=this._filters)===null||t===void 0?void 0:t.selection)!==null&&n!==void 0?n:false)||this.widget.content.isSelectedOrActive(i)).then((()=>{if(this._searchActive){void o.startQuery(this._query,this._filters)}}))}_removeCellProvider(e){const t=a.ArrayExt.removeAt(this._searchProviders,e);t===null||t===void 0?void 0:t.dispose()}async _onCellsChanged(e,t){switch(t.type){case"add":t.newValues.forEach(((e,n)=>{this._addCellProvider(t.newIndex+n)}));break;case"move":a.ArrayExt.move(this._searchProviders,t.oldIndex,t.newIndex);break;case"remove":for(let e=0;e{this._addCellProvider(t.newIndex+n);this._removeCellProvider(t.newIndex+n+1)}));break}this._stateChanged.emit()}async _stepNext(e=false,t=false,n){var i;const s=async e=>{var t;const i=(t=n===null||n===void 0?void 0:n.scroll)!==null&&t!==void 0?t:true;if(!i){return}this._selectionLock=true;if(this.widget.content.activeCellIndex!==this._currentProviderIndex){this.widget.content.activeCellIndex=this._currentProviderIndex}if(this.widget.content.activeCellIndex===-1){console.warn("No active cell (no cells or no model), aborting search");this._selectionLock=false;return}const s=this.widget.content.activeCell;if(!s.inViewport){try{await this.widget.content.scrollToItem(this._currentProviderIndex)}catch(r){}}if(s.inputHidden){s.inputHidden=false}if(!s.inViewport){this._selectionLock=false;return}await s.ready;const o=s.editor;o.revealPosition(o.getPositionAt(e.position));this._selectionLock=false};if(this._currentProviderIndex===null){this._currentProviderIndex=this.widget.content.activeCellIndex}if(e&&this.widget.content.mode==="command"){const e=this._searchProviders[this._currentProviderIndex];const n=e.getCurrentMatch();if(!n){this._currentProviderIndex-=1}if(t){this._currentProviderIndex=(this._currentProviderIndex+this._searchProviders.length)%this._searchProviders.length}}const o=(i=n===null||n===void 0?void 0:n.from)!==null&&i!==void 0?i:"";const r=o==="previous-match"&&this._searchProviders[this._currentProviderIndex].currentMatchIndex===null;const a=this._currentProviderIndex;if(r){void this._searchProviders[this._currentProviderIndex].clearHighlight()}if(t&&r&&this._currentProviderIndex+1>=this._searchProviders.length){this._currentProviderIndex=0}else{this._currentProviderIndex+=r?1:0}do{const i=this._searchProviders[this._currentProviderIndex];const o=e?await i.highlightPrevious(false,n):await i.highlightNext(false,n);if(o){await s(o);return o}else{this._currentProviderIndex=this._currentProviderIndex+(e?-1:1);if(t){this._currentProviderIndex=(this._currentProviderIndex+this._searchProviders.length)%this._searchProviders.length}}}while(t?this._currentProviderIndex!==a:0<=this._currentProviderIndex&&this._currentProviderIndex{this.delayedActiveCellChangeHandlerReady=this._handleHighlightsAfterActiveCellChange()}),0)}this._observeActiveCell()}async _handleHighlightsAfterActiveCellChange(){if(this._onSelection){const e=this._currentProviderIndex!==null&&this._currentProviderIndex{const i=this.widget.content.activeCellIndex===n;t.setProtectSelection(i&&this._onSelection);return t.setSearchSelection(i&&e?this._textSelection:null)})))}async _onCellSelectionChanged(){if(this._delayedActiveCellChangeHandler!==null){clearTimeout(this._delayedActiveCellChangeHandler);this._delayedActiveCellChangeHandler=null}await this._updateCellSelection();if(this._currentProviderIndex===null){const e=this.widget.content.widgets.findIndex((e=>this.widget.content.isSelectedOrActive(e)));this._currentProviderIndex=e}await this._ensureCurrentMatch()}async _updateCellSelection(){const e=this.widget.content.widgets;let t=0;await Promise.all(e.map((async(e,n)=>{const i=this._searchProviders[n];const s=this.widget.content.isSelectedOrActive(e);if(s){t+=1}if(i&&this._onSelection){await i.setIsActive(s)}})));if(t!==this._selectedCells){this._selectedCells=t;this._updateSelectionMode()}this._filtersChanged.emit()}}var He;(function(e){e[e["Idle"]=-1]="Idle";e[e["Error"]=-.5]="Error";e[e["Scheduled"]=0]="Scheduled";e[e["Running"]=1]="Running"})(He||(He={}));class We extends K.TableOfContentsModel{constructor(e,t,n,i){super(e,i);this.parser=t;this.sanitizer=n;this.configMetadataMap={numberHeaders:["toc-autonumbering","toc/number_sections"],numberingH1:["!toc/skip_h1_title"],baseNumbering:["toc/base_numbering"]};this._runningCells=new Array;this._errorCells=new Array;this._cellToHeadingIndex=new WeakMap;void e.context.ready.then((()=>{this.setConfiguration({})}));this.widget.context.model.metadataChanged.connect(this.onMetadataChanged,this);this.widget.content.activeCellChanged.connect(this.onActiveCellChanged,this);f.executionScheduled.connect(this.onExecutionScheduled,this);f.executed.connect(this.onExecuted,this);f.outputCleared.connect(this.onOutputCleared,this);this.headingsChanged.connect(this.onHeadingsChanged,this)}get documentType(){return"notebook"}get isAlwaysActive(){return true}get supportedOptions(){return["baseNumbering","maximalDepth","numberingH1","numberHeaders","includeOutput","syncCollapseState"]}getCellHeadings(e){const t=new Array;let n=this._cellToHeadingIndex.get(e);if(n!==undefined){const e=this.headings[n];t.push(e);while(this.headings[n-1]&&this.headings[n-1].cellRef===e.cellRef){n--;t.unshift(this.headings[n])}}return t}dispose(){var e,t,n;if(this.isDisposed){return}this.headingsChanged.disconnect(this.onHeadingsChanged,this);(t=(e=this.widget.context)===null||e===void 0?void 0:e.model)===null||t===void 0?void 0:t.metadataChanged.disconnect(this.onMetadataChanged,this);(n=this.widget.content)===null||n===void 0?void 0:n.activeCellChanged.disconnect(this.onActiveCellChanged,this);f.executionScheduled.disconnect(this.onExecutionScheduled,this);f.executed.disconnect(this.onExecuted,this);f.outputCleared.disconnect(this.onOutputCleared,this);this._runningCells.length=0;this._errorCells.length=0;super.dispose()}setConfiguration(e){const t=this.loadConfigurationFromMetadata();super.setConfiguration({...this.configuration,...t,...e})}toggleCollapse(e){super.toggleCollapse(e);this.updateRunningStatus(this.headings)}getHeadings(){const e=this.widget.content.widgets;const t=[];const n=new Array;for(let i=0;i({...e,cellRef:s,collapsed:false,isRunning:He.Idle}))))}break}case"markdown":{const e=K.TableOfContentsUtils.filterHeadings(s.headings,this.configuration,n).map(((e,t)=>({...e,cellRef:s,collapsed:false,isRunning:He.Idle})));if(this.configuration.syncCollapseState&&s.headingCollapsed){const t=Math.min(...e.map((e=>e.level)));const n=e.find((e=>e.level===t));n.collapsed=s.headingCollapsed}t.push(...e);break}}if(t.length>0){this._cellToHeadingIndex.set(s,t.length-1)}else{this._cellToHeadingIndex.delete(s)}}this.updateRunningStatus(t);return Promise.resolve(t)}isHeadingEqual(e,t){return super.isHeadingEqual(e,t)&&e.cellRef===t.cellRef}loadConfigurationFromMetadata(){const e=this.widget.content.model;const t={};if(e){for(const n in this.configMetadataMap){const i=this.configMetadataMap[n];for(const s of i){let i=s;const o=i[0]==="!";if(o){i=i.slice(1)}const r=i.split("/");let a=e.getMetadata(r[0]);for(let e=1;e{var i;if(e===t.cell){this._runningCells.splice(n,1);const s=this._cellToHeadingIndex.get(e);if(s!==undefined){const n=this.headings[s];if(t.success||((i=t.error)===null||i===void 0?void 0:i.errorName)===undefined){n.isRunning=He.Idle;return}n.isRunning=He.Error;if(!this._errorCells.includes(e)){this._errorCells.push(e)}}}}));this.updateRunningStatus(this.headings);this.stateChanged.emit()}onExecutionScheduled(e,t){if(!this._runningCells.includes(t.cell)){this._runningCells.push(t.cell)}this._errorCells.forEach(((e,n)=>{if(e===t.cell){this._errorCells.splice(n,1)}}));this.updateRunningStatus(this.headings);this.stateChanged.emit()}onOutputCleared(e,t){this._errorCells.forEach(((e,n)=>{if(e===t.cell){this._errorCells.splice(n,1);const t=this._cellToHeadingIndex.get(e);if(t!==undefined){const e=this.headings[t];e.isRunning=He.Idle}}}));this.updateRunningStatus(this.headings);this.stateChanged.emit()}onMetadataChanged(){this.setConfiguration({})}updateRunningStatus(e){this._runningCells.forEach(((e,t)=>{const n=this._cellToHeadingIndex.get(e);if(n!==undefined){const e=this.headings[n];if(e.isRunning!==He.Running){e.isRunning=t>0?He.Scheduled:He.Running}}}));this._errorCells.forEach(((e,t)=>{const n=this._cellToHeadingIndex.get(e);if(n!==undefined){const e=this.headings[n];if(e.isRunning===He.Idle){e.isRunning=He.Error}}}));let t=0;while(ti){t++;s=Math.max(o.isRunning,s);if(o.collapsed){s=Math.max(s,n(e,o.level));o.dataset={...o.dataset,"data-running":s.toString()}}}else{break}}return s}}}class Ve extends K.TableOfContentsFactory{constructor(e,t,n){super(e);this.parser=t;this.sanitizer=n;this._scrollToTop=true}get scrollToTop(){return this._scrollToTop}set scrollToTop(e){this._scrollToTop=e}_createNew(e,t){const n=new We(e,this.parser,this.sanitizer,t);let i=new WeakMap;const o=(t,n)=>{if(n){const t=async t=>{if(!t.inViewport){return}const s=i.get(n);if(s){if(this.scrollToTop){s.scrollIntoView({block:"start"})}else{const t=e.content.node.getBoundingClientRect();const n=s.getBoundingClientRect();if(n.top>t.bottom||n.bottom{console.error(`Fail to scroll to cell to display the required heading (${e}).`)}))}else{e.content.scrollToItem(r,this.scrollToTop?"start":undefined).then((()=>t(s))).catch((e=>{console.error(`Fail to scroll to cell to display the required heading (${e}).`)}))}}};const r=e=>{n.getCellHeadings(e).forEach((async e=>{var t,n,s;const o=await Ue(e,this.parser,this.sanitizer);const r=((t=this.sanitizer.allowNamedProperties)!==null&&t!==void 0?t:false)?"id":"data-jupyter-id";const a=o?`h${e.level}[${r}="${CSS.escape(o)}"]`:`h${e.level}`;if(e.outputIndex!==undefined){i.set(e,K.TableOfContentsUtils.addPrefix(e.cellRef.outputArea.widgets[e.outputIndex].node,a,(n=e.prefix)!==null&&n!==void 0?n:""))}else{i.set(e,K.TableOfContentsUtils.addPrefix(e.cellRef.node,a,(s=e.prefix)!==null&&s!==void 0?s:""))}}))};const a=t=>{if(!this.parser){return}K.TableOfContentsUtils.clearNumbering(e.content.node);i=new WeakMap;e.content.widgets.forEach((e=>{r(e)}))};const l=(t,i)=>{var o,r,a,l;if(n.configuration.syncCollapseState){if(i!==null){const e=i.cellRef;if(e.headingCollapsed!==((o=i.collapsed)!==null&&o!==void 0?o:false)){e.headingCollapsed=(r=i.collapsed)!==null&&r!==void 0?r:false}}else{const t=(l=(a=n.headings[0])===null||a===void 0?void 0:a.collapsed)!==null&&l!==void 0?l:false;e.content.widgets.forEach((e=>{if(e instanceof s.MarkdownCell){if(e.headingInfo.level>=0){e.headingCollapsed=t}}}))}}};const d=(e,t)=>{if(n.configuration.syncCollapseState){const e=n.getCellHeadings(t)[0];if(e){n.toggleCollapse({heading:e,collapsed:t.headingCollapsed})}}};const c=(e,t)=>{if(t.inViewport){r(t)}else{K.TableOfContentsUtils.clearNumbering(t.node)}};void e.context.ready.then((()=>{a(n);n.activeHeadingChanged.connect(o);n.headingsChanged.connect(a);n.collapseChanged.connect(l);e.content.cellCollapsed.connect(d);e.content.cellInViewportChanged.connect(c);e.disposed.connect((()=>{n.activeHeadingChanged.disconnect(o);n.headingsChanged.disconnect(a);n.collapseChanged.disconnect(l);e.content.cellCollapsed.disconnect(d);e.content.cellInViewportChanged.disconnect(c)}))}));return n}}async function Ue(e,t,n){let i=null;if(e.type===s.Cell.HeadingType.Markdown){i=await K.TableOfContentsUtils.Markdown.getHeadingId(t,e.raw,e.level,n)}else if(e.type===s.Cell.HeadingType.HTML){i=e.id}return i}const qe=new l.Token("@jupyterlab/notebook:INotebookWidgetFactory","A service to create the notebook viewer.");const $e=new l.Token("@jupyterlab/notebook:INotebookTools",`A service for the "Notebook Tools" panel in the\n right sidebar. Use this to add your own functionality to the panel.`);const Ke=new l.Token("@jupyterlab/notebook:INotebookTracker",`A widget tracker for notebooks.\n Use this if you want to be able to iterate over and interact with notebooks\n created by the application.`);const Je=new l.Token("@jupyterlab/notebook:INotebookCellExecutor",`The notebook cell executor`);class Ge extends i.WidgetTracker{constructor(){super(...arguments);this._activeCell=null;this._activeCellChanged=new d.Signal(this);this._selectionChanged=new d.Signal(this)}get activeCell(){const e=this.currentWidget;if(!e){return null}return e.content.activeCell||null}get activeCellChanged(){return this._activeCellChanged}get selectionChanged(){return this._selectionChanged}add(e){const t=super.add(e);e.content.activeCellChanged.connect(this._onActiveCellChanged,this);e.content.selectionChanged.connect(this._onSelectionChanged,this);return t}dispose(){this._activeCell=null;super.dispose()}onCurrentChanged(e){const t=this.activeCell;if(t&&t===this._activeCell){return}this._activeCell=t;if(!e){return}this._activeCellChanged.emit(e.content.activeCell||null)}_onActiveCellChanged(e,t){if(this.currentWidget&&this.currentWidget.content===e){this._activeCell=t||null;this._activeCellChanged.emit(this._activeCell)}}_onSelectionChanged(e){if(this.currentWidget&&this.currentWidget.content===e){this._selectionChanged.emit(void 0)}}}const Ye="jp-StatusItem-trust";function Xe(e,t){t=t||r.nullTranslator;const n=t.load("jupyterlab");if(e.trustedCells===e.totalCells){return n.__("Notebook trusted: %1 of %2 code cells trusted.",e.trustedCells,e.totalCells)}else if(e.activeCellTrusted){return n.__("Active cell trusted: %1 of %2 code cells trusted.",e.trustedCells,e.totalCells)}else{return n.__("Notebook not trusted: %1 of %2 code cells trusted.",e.trustedCells,e.totalCells)}}function Qe(e){if(e.allCellsTrusted){return h().createElement(y.trustedIcon.react,{top:"2px",stylesheet:"statusBar"})}else{return h().createElement(y.notTrustedIcon.react,{top:"2px",stylesheet:"statusBar"})}}class Ze extends y.VDomRenderer{constructor(e){super(new Ze.Model);this.translator=e||r.nullTranslator;this.node.classList.add(Ye)}render(){if(!this.model){return null}const e=Xe(this.model,this.translator);if(e!==this.node.title){this.node.title=e}return h().createElement(Qe,{allCellsTrusted:this.model.trustedCells===this.model.totalCells,activeCellTrusted:this.model.activeCellTrusted,totalCells:this.model.totalCells,trustedCells:this.model.trustedCells})}}(function(e){class t extends y.VDomModel{constructor(){super(...arguments);this._trustedCells=0;this._totalCells=0;this._activeCellTrusted=false;this._notebook=null}get trustedCells(){return this._trustedCells}get totalCells(){return this._totalCells}get activeCellTrusted(){return this._activeCellTrusted}get notebook(){return this._notebook}set notebook(e){const t=this._notebook;if(t!==null){t.activeCellChanged.disconnect(this._onActiveCellChanged,this);t.modelContentChanged.disconnect(this._onModelChanged,this)}const n=this._getAllState();this._notebook=e;if(this._notebook===null){this._trustedCells=0;this._totalCells=0;this._activeCellTrusted=false}else{this._notebook.activeCellChanged.connect(this._onActiveCellChanged,this);this._notebook.modelContentChanged.connect(this._onModelChanged,this);if(this._notebook.activeCell){this._activeCellTrusted=this._notebook.activeCell.model.trusted}else{this._activeCellTrusted=false}const{total:e,trusted:t}=this._deriveCellTrustState(this._notebook.model);this._totalCells=e;this._trustedCells=t}this._triggerChange(n,this._getAllState())}_onModelChanged(e){const t=this._getAllState();const{total:n,trusted:i}=this._deriveCellTrustState(e.model);this._totalCells=n;this._trustedCells=i;this._triggerChange(t,this._getAllState())}_onActiveCellChanged(e,t){const n=this._getAllState();if(t){this._activeCellTrusted=t.model.trusted}else{this._activeCellTrusted=false}this._triggerChange(n,this._getAllState())}_deriveCellTrustState(e){if(e===null){return{total:0,trusted:0}}let t=0;let n=0;for(const i of e.cells){if(i.type!=="code"){continue}t++;if(i.trusted){n++}}return{total:t,trusted:n}}_getAllState(){return[this._trustedCells,this._totalCells,this.activeCellTrusted]}_triggerChange(e,t){if(e[0]!==t[0]||e[1]!==t[1]||e[2]!==t[2]){this.stateChanged.emit(void 0)}}}e.Model=t})(Ze||(Ze={}));class et extends $.ABCWidgetFactory{constructor(e){super(e);this.rendermime=e.rendermime;this.contentFactory=e.contentFactory;this.mimeTypeService=e.mimeTypeService;this._editorConfig=e.editorConfig||De.defaultEditorConfig;this._notebookConfig=e.notebookConfig||De.defaultNotebookConfig}get editorConfig(){return this._editorConfig}set editorConfig(e){this._editorConfig=e}get notebookConfig(){return this._notebookConfig}set notebookConfig(e){this._notebookConfig=e}createNewWidget(e,t){const n=e.translator;const i=new T({sessionContext:e.sessionContext,translator:n});const s={rendermime:t?t.content.rendermime:this.rendermime.clone({resolver:e.urlResolver}),contentFactory:this.contentFactory,mimeTypeService:this.mimeTypeService,editorConfig:t?t.content.editorConfig:this._editorConfig,notebookConfig:t?t.content.notebookConfig:this._notebookConfig,translator:n,kernelHistory:i};const o=this.contentFactory.createNotebook(s);return new Be({context:e,content:o})}}},28006:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(24800);var r=n(97913);var a=n(5893);var l=n(38457);var d=n(17325);var c=n(19562);var h=n(23359);var u=n(79010);var p=n(66731);var m=n(53377);var g=n(13137);var f=n(85072);var v=n.n(f);var _=n(97825);var b=n.n(_);var y=n(77659);var w=n.n(y);var C=n(55056);var x=n.n(C);var S=n(10540);var k=n.n(S);var j=n(41113);var I=n.n(j);var E=n(30979);var T={};T.styleTagTransform=I();T.setAttributes=x();T.insert=w().bind(null,"head");T.domAPI=b();T.insertStyleElement=k();var M=v()(E.A,T);const D=E.A&&E.A.locals?E.A.locals:undefined},56701:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ModelDB:()=>f,ObservableJSON:()=>d,ObservableList:()=>u,ObservableMap:()=>a,ObservableString:()=>c,ObservableUndoableList:()=>m,ObservableValue:()=>g});var i=n(5592);var s=n(90044);var o=n(2336);var r=n(42856);class a{constructor(e={}){this._map=new Map;this._changed=new o.Signal(this);this._isDisposed=false;this._itemCmp=e.itemCmp||l.itemCmp;if(e.values){for(const t in e.values){this._map.set(t,e.values[t])}}}get type(){return"Map"}get changed(){return this._changed}get isDisposed(){return this._isDisposed}get size(){return this._map.size}set(e,t){const n=this._map.get(e);if(t===undefined){throw Error("Cannot set an undefined value, use remove")}const i=this._itemCmp;if(n!==undefined&&i(n,t)){return n}this._map.set(e,t);this._changed.emit({type:n?"change":"add",key:e,oldValue:n,newValue:t});return n}get(e){return this._map.get(e)}has(e){return this._map.has(e)}keys(){const e=[];this._map.forEach(((t,n)=>{e.push(n)}));return e}values(){const e=[];this._map.forEach(((t,n)=>{e.push(t)}));return e}delete(e){const t=this._map.get(e);const n=this._map.delete(e);if(n){this._changed.emit({type:"remove",key:e,oldValue:t,newValue:undefined})}return t}clear(){const e=this.keys();for(let t=0;tt(n,e)));this.remove(n);return n}remove(e){const t=h.ArrayExt.removeAt(this._array,e);if(t===undefined){return}this._changed.emit({type:"remove",oldIndex:e,newIndex:-1,newValues:[],oldValues:[t]});return t}clear(){const e=this._array.slice();this._array.length=0;this._changed.emit({type:"clear",oldIndex:0,newIndex:0,newValues:[],oldValues:e})}move(e,t){if(this.length<=1||e===t){return}const n=[this._array[e]];h.ArrayExt.move(this._array,e,t);this._changed.emit({type:"move",oldIndex:e,newIndex:t,oldValues:n,newValues:n})}pushAll(e){const t=this.length;for(const n of e){this._array.push(n)}this._changed.emit({type:"add",oldIndex:-1,newIndex:t,oldValues:[],newValues:Array.from(e)});return this.length}insertAll(e,t){const n=e;for(const i of t){h.ArrayExt.insert(this._array,e++,i)}this._changed.emit({type:"add",oldIndex:-2,newIndex:n,oldValues:[],newValues:Array.from(t)})}removeRange(e,t){const n=this._array.slice(e,t);for(let i=e;i=0}beginCompoundOperation(e){this._inCompound=true;this._isUndoable=e!==false;this._madeCompoundChange=false}endCompoundOperation(){this._inCompound=false;this._isUndoable=true;if(this._madeCompoundChange){this._index++}}undo(){if(!this.canUndo){return}const e=this._stack[this._index];this._isUndoable=false;for(const t of e.reverse()){this._undoChange(t)}this._isUndoable=true;this._index--}redo(){if(!this.canRedo){return}this._index++;const e=this._stack[this._index];this._isUndoable=false;for(const t of e){this._redoChange(t)}this._isUndoable=true}clearUndo(){this._index=-1;this._stack=[]}_onListChanged(e,t){if(this.isDisposed||!this._isUndoable){return}if(!this._inCompound||!this._madeCompoundChange){this._stack=this._stack.slice(0,this._index+1)}const n=this._copyChange(t);if(this._stack[this._index+1]){this._stack[this._index+1].push(n)}else{this._stack.push([n])}if(!this._inCompound){this._index++}else{this._madeCompoundChange=true}}_undoChange(e){let t=0;const n=this._serializer;switch(e.type){case"add":for(let t=e.newValues.length;t>0;t--){this.remove(e.newIndex)}break;case"set":t=e.oldIndex;for(const i of e.oldValues){this.set(t++,n.fromJSON(i))}break;case"remove":t=e.oldIndex;for(const i of e.oldValues){this.insert(t++,n.fromJSON(i))}break;case"move":this.move(e.newIndex,e.oldIndex);break;default:return}}_redoChange(e){let t=0;const n=this._serializer;switch(e.type){case"add":t=e.newIndex;for(const i of e.newValues){this.insert(t++,n.fromJSON(i))}break;case"set":t=e.newIndex;for(const t of e.newValues){this.set(e.newIndex++,n.fromJSON(t))}break;case"remove":for(let t=e.oldValues.length;t>0;t--){this.remove(e.oldIndex)}break;case"move":this.move(e.oldIndex,e.newIndex);break;default:return}}_copyChange(e){const t=[];for(const i of e.oldValues){t.push(this._serializer.toJSON(i))}const n=[];for(const i of e.newValues){n.push(this._serializer.toJSON(i))}return{type:e.type,oldIndex:e.oldIndex,newIndex:e.newIndex,oldValues:t,newValues:n}}}(function(e){class t{toJSON(e){return e}fromJSON(e){return e}}e.IdentitySerializer=t})(m||(m={}));class g{constructor(e=null){this._value=null;this._changed=new o.Signal(this);this._isDisposed=false;this._value=e}get type(){return"Value"}get isDisposed(){return this._isDisposed}get changed(){return this._changed}get(){return this._value}set(e){const t=this._value;if(i.JSONExt.deepEqual(t,e)){return}this._value=e;this._changed.emit({oldValue:t,newValue:e})}dispose(){if(this._isDisposed){return}this._isDisposed=true;o.Signal.clearData(this);this._value=null}}(function(e){class t{}e.IChangedArgs=t})(g||(g={}));class f{constructor(e={}){this.isPrepopulated=false;this.isCollaborative=false;this.connected=Promise.resolve(void 0);this._toDispose=false;this._isDisposed=false;this._disposables=new s.DisposableSet;this._basePath=e.basePath||"";if(e.baseDB){this._db=e.baseDB}else{this._db=new a;this._toDispose=true}}get basePath(){return this._basePath}get isDisposed(){return this._isDisposed}get(e){return this._db.get(this._resolvePath(e))}has(e){return this._db.has(this._resolvePath(e))}createString(e){const t=new c;this._disposables.add(t);this.set(e,t);return t}createList(e){const t=new m(new m.IdentitySerializer);this._disposables.add(t);this.set(e,t);return t}createMap(e){const t=new d;this._disposables.add(t);this.set(e,t);return t}createValue(e){const t=new g;this._disposables.add(t);this.set(e,t);return t}getValue(e){const t=this.get(e);if(!t||t.type!=="Value"){throw Error("Can only call getValue for an ObservableValue")}return t.get()}setValue(e,t){const n=this.get(e);if(!n||n.type!=="Value"){throw Error("Can only call setValue on an ObservableValue")}n.set(t)}view(e){const t=new f({basePath:e,baseDB:this});this._disposables.add(t);return t}set(e,t){this._db.set(this._resolvePath(e),t)}dispose(){if(this.isDisposed){return}this._isDisposed=true;if(this._toDispose){this._db.dispose()}this._disposables.dispose()}_resolvePath(e){if(this._basePath){e=this._basePath+"."+e}return e}}},66990:(e,t,n)=>{"use strict";n.r(t);n.d(t,{OutputArea:()=>E,OutputAreaModel:()=>d,OutputPrompt:()=>M,SimplifiedOutputArea:()=>T,Stdin:()=>D});var i=n(34501);var s=n(68148);var o=n(90943);var r=n(34236);var a=n(5592);var l=n(2336);class d{constructor(e={}){this.clearNext=false;this._lastStreamName="";this._trusted=false;this._isDisposed=false;this._stateChanged=new l.Signal(this);this._changed=new l.Signal(this);this._streamIndex=0;this._trusted=!!e.trusted;this.contentFactory=e.contentFactory||d.defaultContentFactory;this.list=new s.ObservableList;if(e.values){for(const t of e.values){const e=this._add(t)-1;const n=this.list.get(e);n.changed.connect(this._onGenericChange,this)}}this.list.changed.connect(this._onListChanged,this)}get stateChanged(){return this._stateChanged}get changed(){return this._changed}get length(){return this.list?this.list.length:0}get trusted(){return this._trusted}set trusted(e){if(e===this._trusted){return}const t=this._trusted=e;for(let n=0;ne.toJSON())))}_add(e){const t=this._trusted;e=a.JSONExt.deepCopy(e);c.normalize(e);if(i.isStream(e)&&e.name===this._lastStreamName&&this.length>0&&this.shouldCombine({value:e,lastModel:this.list.get(this.length-1)})){const t=this.list.get(this.length-1);const n=t.streamText;const i=typeof e.text==="string"?e.text:e.text.join("");this._streamIndex=c.addText(this._streamIndex,n,i);return this.length}if(i.isStream(e)){if(typeof e.text!=="string"){e.text=e.text.join("")}const{text:t,index:n}=c.processText(0,e.text);this._streamIndex=n;e.text=t}const n=this._createItem({value:e,trusted:t});const s=this.list.push(n);if(i.isStream(e)){this._lastStreamName=e.name}else{this._lastStreamName=""}return s}shouldCombine(e){return true}_createItem(e){const t=this.contentFactory;const n=t.createOutputModel(e);return n}_onListChanged(e,t){switch(t.type){case"add":t.newValues.forEach((e=>{e.changed.connect(this._onGenericChange,this)}));break;case"remove":t.oldValues.forEach((e=>{e.changed.disconnect(this._onGenericChange,this)}));break;case"set":t.newValues.forEach((e=>{e.changed.connect(this._onGenericChange,this)}));t.oldValues.forEach((e=>{e.changed.disconnect(this._onGenericChange,this)}));break}this._changed.emit(t)}_onGenericChange(e){let t;let n=null;for(t=0;t=0?i+n:i}function s(e,t,i){if(i===undefined){i=""}if(!(t.includes("\b")||t.includes("\r")||t.includes("\n"))){i=i.slice(0,e)+t+i.slice(e+t.length);return{text:i,index:e+t.length}}let s=e;let o=-1;let r=0;const a=/[\n\b\r]/;while(true){o=n(t,a,r);const e=t.slice(r,o===-1?t.length:o);i=i.slice(0,s)+e+i.slice(s+e.length);r=o+1;s+=e.length;if(o===-1){break}const l=t[o];if(l==="\b"){if(s>0&&i[s-1]!=="\n"){i=i.slice(0,s-1)+i.slice(s+1);s--}}else if(l==="\r"){let e=false;while(!e){if(s===0){e=true}else if(i[s-1]==="\n"){e=true}else{s--}}}else if(l==="\n"){i=i+"\n";s=i.length}else{throw Error(`This should not happen`)}}return{text:i,index:s}}e.processText=s;function o(e){return JSON.parse(JSON.stringify(e))}function r(e,t,n){const{text:i,index:r}=s(e,n,t.text);let a=false;let l=0;while(!a){if(l===i.length){if(l===t.text.length){a=true}else{t.remove(l,t.text.length);a=true}}else if(l===t.text.length){if(l!==i.length){t.insert(t.text.length,o(i.slice(l)));a=true}}else if(i[l]!==t.text[l]){t.remove(l,t.text.length);t.insert(l,o(i.slice(l)));a=true}else{l++}}return r}e.addText=r})(c||(c={}));var h=n(72050);var u=n(77256);var p=n(61927);var m=n(94466);var g=n(1143);const f="jp-OutputArea";const v="jp-OutputArea-child";const _="jp-OutputArea-output";const b="jp-OutputArea-prompt";const y="jp-OutputArea-stdin-hiding";const w="jp-OutputPrompt";const C="jp-OutputArea-executeResult";const x="jp-OutputArea-stdin-item";const S="jp-Stdin";const k="jp-Stdin-prompt";const j="jp-Stdin-input";const I="jp-OutputArea-promptOverlay";class E extends g.Widget{constructor(e){var t,n,i,s,o;super();this.outputLengthChanged=new l.Signal(this);this._onIOPub=e=>{const t=this.model;const n=e.header.msg_type;let i;const s=e.content.transient||{};const o=s["display_id"];let r;switch(n){case"execute_result":case"display_data":case"stream":case"error":i={...e.content,output_type:n};t.add(i);break;case"clear_output":{const n=e.content.wait;t.clear(n);break}case"update_display_data":i={...e.content,output_type:"display_data"};r=this._displayIdMap.get(o);if(r){for(const e of r){t.set(e,i)}}break;case"status":{const t=e.content.execution_state;if(t==="idle"){this._pendingInput=false}break}default:break}if(o&&n==="display_data"){r=this._displayIdMap.get(o)||[];r.push(t.length-1);this._displayIdMap.set(o,r)}};this._onExecuteReply=e=>{const t=this.model;const n=e.content;if(n.status!=="ok"){return}const i=n&&n.payload;if(!i||!i.length){return}const s=i.filter((e=>e.source==="page"));if(!s.length){return}const o=JSON.parse(JSON.stringify(s[0]));const r={output_type:"display_data",data:o.data,metadata:{}};t.add(r)};this._displayIdMap=new Map;this._minHeightTimeout=null;this._inputRequested=new l.Signal(this);this._toggleScrolling=new l.Signal(this);this._initialize=new l.Signal(this);this._outputTracker=new h.WidgetTracker({namespace:a.UUID.uuid4()});this._inputHistoryScope="global";this._pendingInput=false;this._showInputPlaceholder=true;super.layout=new g.PanelLayout;this.addClass(f);this.contentFactory=(t=e.contentFactory)!==null&&t!==void 0?t:E.defaultContentFactory;this.rendermime=e.rendermime;this._maxNumberOutputs=(n=e.maxNumberOutputs)!==null&&n!==void 0?n:Infinity;this._translator=(i=e.translator)!==null&&i!==void 0?i:p.nullTranslator;this._inputHistoryScope=(s=e.inputHistoryScope)!==null&&s!==void 0?s:"global";this._showInputPlaceholder=(o=e.showInputPlaceholder)!==null&&o!==void 0?o:true;const r=this.model=e.model;for(let a=0;a{this._setOutput(a,e)}))}}r.changed.connect(this.onModelChanged,this);r.stateChanged.connect(this.onStateChanged,this);if(e.promptOverlay){this._addPromptOverlay()}}get layout(){return super.layout}get widgets(){return this.layout.widgets}get future(){return this._future}set future(e){if(this.model.isDisposed){throw Error("Model is disposed")}if(this._future===e){return}if(this._future){this._future.dispose()}this._future=e;e.done.finally((()=>{this._pendingInput=false})).catch((()=>{}));this.model.clear();if(this.widgets.length){this._clear();this.outputLengthChanged.emit(Math.min(this.model.length,this._maxNumberOutputs))}e.onIOPub=this._onIOPub;e.onReply=this._onExecuteReply;e.onStdin=t=>{if(u.KernelMessage.isInputRequestMsg(t)){this.onInputRequest(t,e)}}}get inputRequested(){return this._inputRequested}get pendingInput(){return this._pendingInput}get maxNumberOutputs(){return this._maxNumberOutputs}set maxNumberOutputs(e){if(e<=0){console.warn(`OutputArea.maxNumberOutputs must be strictly positive.`);return}const t=this._maxNumberOutputs;this._maxNumberOutputs=e;if(t{this._setOutput(t.newIndex,e)}))}break;case"remove":if(this.widgets.length){if(this.model.length===0){this._clear()}else{const e=t.oldIndex;for(let n=0;n{this._toggleScrolling.emit()}));this.node.appendChild(e);requestAnimationFrame((()=>{this._initialize.emit()}))}_moveDisplayIdIndices(e,t){this._displayIdMap.forEach((n=>{const i=e+t;const s=n.length;for(let o=s-1;o>=0;--o){const s=n[o];if(s>=e&&s=i){n[o]-=t}}}))}onStateChanged(e,t){const n=Math.min(this.model.length,this._maxNumberOutputs);if(t){if(t>=this._maxNumberOutputs){return}this._setOutput(t,this.model.get(t))}else{for(let e=0;e{if(this.isDisposed){return}this.node.style.minHeight=""}),50)}onInputRequest(e,t){const n=this.contentFactory;const i=e.content.prompt;const s=e.content.password;const o=new g.Panel;o.addClass(v);o.addClass(x);const r=n.createOutputPrompt();r.addClass(b);o.addWidget(r);this._pendingInput=true;const a=n.createStdin({parent_header:e.header,prompt:i,password:s,future:t,translator:this._translator,inputHistoryScope:this._inputHistoryScope,showInputPlaceholder:this._showInputPlaceholder});a.addClass(_);o.addWidget(a);if(this.model.length>=this.maxNumberOutputs){this.maxNumberOutputs=this.model.length}this._inputRequested.emit(a);const l=a.node.getElementsByTagName("input")[0];void a.value.then((e=>{if(this.model.length>=this.maxNumberOutputs){this.maxNumberOutputs=this.model.length+1}o.addClass(y);this.model.add({output_type:"stream",name:"stdin",text:e+"\n"});l.focus();this._pendingInput=false;window.setTimeout((()=>{const e=document.activeElement;o.dispose();if(e&&e instanceof HTMLElement){e.focus()}}),500)}));this.layout.addWidget(o)}_setOutput(e,t){if(e>=this._maxNumberOutputs){return}const n=this.layout.widgets[e];const i=n.widgets?n.widgets.filter((e=>"renderModel"in e)).pop():n;const s=this.rendermime.preferredMimeType(t.data,t.trusted?"any":"ensure");if(A.currentPreferredMimetype.get(i)===s&&E.isIsolated(s,t.metadata)===i instanceof A.IsolatedRenderer){void i.renderModel(t)}else{this.layout.widgets[e].dispose();this._insertOutput(e,t)}}_insertOutput(e,t){if(e>this._maxNumberOutputs){return}const n=this.layout;if(e===this._maxNumberOutputs){const t=new A.TrimmedOutputs(this._maxNumberOutputs,(()=>{const e=this._maxNumberOutputs;this._maxNumberOutputs=Infinity;this._showTrimmedOutputs(e)}));n.insertWidget(e,this._wrappedOutput(t))}else{let i=this.createOutputItem(t);if(i){i.toggleClass(C,t.executionCount!==null)}else{i=new g.Widget}if(!this._outputTracker.has(i)){void this._outputTracker.add(i)}n.insertWidget(e,i)}}get outputTracker(){return this._outputTracker}_showTrimmedOutputs(e){this.widgets[e].dispose();for(let t=e;t{const t=document.createElement("pre");const i=this._translator.load("jupyterlab");t.textContent=i.__("Javascript Error: %1",e.message);n.node.appendChild(t);n.node.className="lm-Widget jp-RenderedText";n.node.setAttribute("data-mime-type","application/vnd.jupyter.stderr")}));return n}_wrappedOutput(e,t=null){const n=new A.OutputPanel;n.addClass(v);const i=this.contentFactory.createOutputPrompt();i.executionCount=t;i.addClass(b);n.addWidget(i);e.addClass(_);n.addWidget(e);return n}}class T extends E{onInputRequest(e,t){return}createOutputItem(e){const t=this.createRenderedMimetype(e);if(!t){return null}const n=new A.OutputPanel;n.addClass(v);t.addClass(_);n.addWidget(t);return n}}(function(e){async function t(e,t,n,i){var s;let o=true;if(i&&Array.isArray(i.tags)&&i.tags.indexOf("raises-exception")!==-1){o=false}const r={code:e,stop_on_error:o};const a=(s=n.session)===null||s===void 0?void 0:s.kernel;if(!a){throw new Error("Session has no kernel.")}const l=a.requestExecute(r,false,i);t.future=l;return l.done}e.execute=t;function n(e,t){const n=t[e];if(n&&n["isolated"]!==undefined){return!!n["isolated"]}else{return!!t["isolated"]}}e.isIsolated=n;class i{createOutputPrompt(){return new M}createStdin(e){return new D(e)}}e.ContentFactory=i;e.defaultContentFactory=new i})(E||(E={}));class M extends g.Widget{constructor(){super();this._executionCount=null;this.addClass(w)}get executionCount(){return this._executionCount}set executionCount(e){this._executionCount=e;if(e===null){this.node.textContent=""}else{this.node.textContent=`[${e}]:`}}}class D extends g.Widget{static _historyIx(e,t){const n=D._history.get(e);if(!n){return undefined}const i=n.length;if(t<=0){return i+t}}static _historyAt(e,t){const n=D._history.get(e);if(!n){return undefined}const i=n.length;const s=D._historyIx(e,t);if(s!==undefined&&s1e3){n.shift()}}static _historySearch(e,t,n,i=true){const s=D._history.get(e);const o=s.length;const r=D._historyIx(e,n);const a=e=>e.search(t)!==-1;if(r===undefined){return}if(i){if(r===0){return}const e=s.slice(0,r).findLastIndex(a);if(e!==-1){return e-o}}else{if(r>=o-1){return}const e=s.slice(r+1).findIndex(a);if(e!==-1){return e-o+r+1}}}constructor(e){var t;super({node:A.createInputWidgetNode(e.prompt,e.password)});this._promise=new a.PromiseDelegate;this._resolved=false;this.addClass(S);this._future=e.future;this._historyIndex=0;this._historyKey=e.inputHistoryScope==="session"?e.parent_header.session:"";this._historyPat="";this._parentHeader=e.parent_header;this._password=e.password;this._trans=((t=e.translator)!==null&&t!==void 0?t:p.nullTranslator).load("jupyterlab");this._value=e.prompt+" ";this._input=this.node.getElementsByTagName("input")[0];if(e.showInputPlaceholder&&!this._password){this._input.placeholder=this._trans.__("↑↓ for history. Search history with c-↑/c-↓")}else{this._input.placeholder=""}if(!D._history.has(this._historyKey)){D._history.set(this._historyKey,[])}}get value(){return this._promise.promise.then((()=>this._value))}handleEvent(e){e.stopPropagation();if(this._resolved){e.preventDefault();return}const t=this._input;if(e.type==="keydown"){if(e.key==="Enter"){this.resetSearch();this._future.sendInputReply({status:"ok",value:t.value},this._parentHeader);if(this._password){this._value+="········"}else{this._value+=t.value;D._historyPush(this._historyKey,t.value)}this._resolved=true;this._promise.resolve(void 0)}else if(e.key==="Escape"){this.resetSearch();t.blur()}else if(e.ctrlKey&&(e.key==="ArrowUp"||e.key==="ArrowDown")){if(this._historyPat===""){this._historyPat=t.value}const n=e.key==="ArrowUp";const i=D._historySearch(this._historyKey,this._historyPat,this._historyIndex,n);if(i!==undefined){const n=D._historyAt(this._historyKey,i);if(n!==undefined){if(this._historyIndex===0){this._valueCache=t.value}this._setInputValue(n);this._historyIndex=i;e.preventDefault()}}}else if(e.key==="ArrowUp"){this.resetSearch();const n=D._historyAt(this._historyKey,this._historyIndex-1);if(n){if(this._historyIndex===0){this._valueCache=t.value}this._setInputValue(n);--this._historyIndex;e.preventDefault()}}else if(e.key==="ArrowDown"){this.resetSearch();if(this._historyIndex===0){}else if(this._historyIndex===-1){this._setInputValue(this._valueCache);++this._historyIndex}else{const e=D._historyAt(this._historyKey,this._historyIndex+1);if(e){this._setInputValue(e);++this._historyIndex}}}}}resetSearch(){this._historyPat=""}onAfterAttach(e){this._input.addEventListener("keydown",this);this._input.focus()}onBeforeDetach(e){this._input.removeEventListener("keydown",this)}_setInputValue(e){this._input.value=e;this._input.setSelectionRange(e.length,e.length)}}D._history=new Map;var A;(function(e){function t(e,t){const n=document.createElement("div");const i=document.createElement("pre");i.className=k;i.textContent=e;const s=document.createElement("input");s.className=j;if(t){s.type="password"}n.appendChild(i);i.appendChild(s);return n}e.createInputWidgetNode=t;class n extends g.Widget{constructor(e){super({node:document.createElement("iframe")});this.addClass("jp-mod-isolated");this._wrapped=e;const t=this.node;t.frameBorder="0";t.scrolling="auto";t.addEventListener("load",(()=>{t.contentDocument.open();t.contentDocument.write(this._wrapped.node.innerHTML);t.contentDocument.close();const e=t.contentDocument.body;t.style.height=`${e.scrollHeight}px`;t.heightChangeObserver=new ResizeObserver((()=>{t.style.height=`${e.scrollHeight}px`}));t.heightChangeObserver.observe(e)}))}renderModel(e){return this._wrapped.renderModel(e)}}e.IsolatedRenderer=n;e.currentPreferredMimetype=new m.AttachedProperty({name:"preferredMimetype",create:e=>""});class i extends g.Panel{constructor(e){super(e)}_onContext(e){this.node.focus()}onAfterAttach(e){super.onAfterAttach(e);this.node.addEventListener("contextmenu",this._onContext.bind(this))}onBeforeDetach(e){super.onAfterDetach(e);this.node.removeEventListener("contextmenu",this._onContext.bind(this))}}e.OutputPanel=i;class s extends g.Widget{constructor(e,t){const n=document.createElement("div");const i=`The first ${e} are displayed`;const s="Show more outputs";n.insertAdjacentHTML("afterbegin",`\n
${s}
\n
`);super({node:n});this._onClick=t;this.addClass("jp-TrimmedOutputs");this.addClass("jp-RenderedHTMLCommon")}handleEvent(e){if(e.type==="click"){this._onClick(e)}}onAfterAttach(e){super.onAfterAttach(e);this.node.addEventListener("click",this)}onBeforeDetach(e){super.onBeforeDetach(e);this.node.removeEventListener("click",this)}}e.TrimmedOutputs=s})(A||(A={}))},1649:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(5893);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(5526);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},93034:(e,t,n)=>{"use strict";n.r(t);n.d(t,{RenderedPDF:()=>c,default:()=>p,rendererFactory:()=>h});var i=n(5592);var s=n.n(i);var o=n(90044);var r=n.n(o);var a=n(1143);var l=n.n(a);const d="application/pdf";class c extends a.Widget{constructor(){super();this._base64="";this._disposable=null;this._ready=new i.PromiseDelegate;this.addClass("jp-PDFContainer");const e=document.createElement("iframe");e.setAttribute("loading","lazy");this.node.appendChild(e);e.onload=()=>{const t=e.contentWindow.document.createElement("body");t.style.margin="0px";e.contentWindow.document.body=t;this._object=e.contentWindow.document.createElement("object");if(!window.safari){this._object.type=d}this._object.width="100%";this._object.height="100%";t.appendChild(this._object);this._ready.resolve(void 0)}}async renderModel(e){await this._ready.promise;const t=e.data[d];if(!t||t.length===this._base64.length&&t===this._base64){if(e.metadata.fragment&&this._object.data){const t=this._object.data;this._object.data=`${t.split("#")[0]}${e.metadata.fragment}`}if(m.IS_FIREFOX){this._object.data=this._object.data}return Promise.resolve(void 0)}this._base64=t;const n=m.b64toBlob(t,d);if(this._disposable){this._disposable.dispose()}let i=URL.createObjectURL(n);if(e.metadata.fragment){i+=e.metadata.fragment}this._object.data=i;this._disposable=new o.DisposableDelegate((()=>{try{URL.revokeObjectURL(i)}catch(e){}}));return}onBeforeHide(){if(m.IS_FIREFOX){this._object.data=this._object.data.split("#")[0]}}dispose(){if(this._disposable){this._disposable.dispose()}super.dispose()}}const h={safe:false,mimeTypes:[d],defaultRank:100,createRenderer:e=>new c};const u=[{id:"@jupyterlab/pdf-extension:factory",description:"Adds renderer for PDF content.",rendererFactory:h,dataType:"string",documentWidgetFactoryOptions:{name:"PDF",modelName:"base64",primaryFileType:"PDF",fileTypes:["PDF"],defaultFor:["PDF"]}}];const p=u;var m;(function(e){e.IS_FIREFOX=/Firefox/.test(navigator.userAgent);function t(e,t="",n=512){const i=atob(e);const s=[];for(let o=0;o{"use strict";var i=n(10395);var s=n(85072);var o=n.n(s);var r=n(97825);var a=n.n(r);var l=n(77659);var d=n.n(l);var c=n(55056);var h=n.n(c);var u=n(10540);var p=n.n(u);var m=n(41113);var g=n.n(m);var f=n(44486);var v={};v.styleTagTransform=g();v.setAttributes=h();v.insert=d().bind(null,"head");v.domAPI=a();v.insertStyleElement=p();var _=o()(f.A,v);const b=f.A&&f.A.locals?f.A.locals:undefined},49870:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>v});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(61927);var l=n.n(a);var d=n(66127);var c=n.n(d);var h=n(12063);var u=n.n(h);var p;(function(e){e.open="pluginmanager:open";e.refreshPlugins="pluginmanager:refresh"})(p||(p={}));const m="@jupyterlab/pluginmanager-extension:plugin";const g={id:m,description:"Enable or disable individual plugins.",autoStart:true,requires:[i.JupyterLab.IInfo],optional:[a.ITranslator,o.ICommandPalette,i.ILayoutRestorer],provides:h.IPluginManager,activate:(e,t,n,i,s)=>{const{commands:r,shell:l}=e;n=n!==null&&n!==void 0?n:a.nullTranslator;const c=n.load("jupyterlab");const u=c.__("Plugin Manager");const g=c.__("Advanced Plugin Manager");const f=c.__("Refresh Plugin List");const v="plugin-manager";const _=new o.WidgetTracker({namespace:v});function b(i){const s=new h.PluginListModel({...i,pluginData:{availablePlugins:t.availablePlugins},serverSettings:e.serviceManager.serverSettings,extraLockedPlugins:[m,"@jupyterlab/services-extension:service-manager","@jupyterlab/application-extension:layout","@jupyterlab/apputils-extension:resolver"],translator:n!==null&&n!==void 0?n:a.nullTranslator});const l=new h.Plugins({model:s,translator:n!==null&&n!==void 0?n:a.nullTranslator});l.title.label=g;l.title.icon=d.extensionIcon;l.title.caption=c.__("Plugin Manager");const u=new o.MainAreaWidget({content:l,reveal:s.ready});u.toolbar.addItem("refresh-plugins",new d.CommandToolbarButton({id:p.refreshPlugins,args:{noLabel:true},commands:r}));return u}r.addCommand(p.open,{label:g,execute:e=>{const t=b(e);l.add(t,"main",{type:"Plugins"});void _.add(t);t.content.model.trackerDataChanged.connect((()=>{void _.save(t)}));return t}});r.addCommand(p.refreshPlugins,{label:e=>e.noLabel?"":f,caption:c.__("Refresh plugins list"),icon:d.refreshIcon,execute:async()=>{var e;return(e=_.currentWidget)===null||e===void 0?void 0:e.content.model.refresh().catch((e=>{console.error(`Failed to refresh the available plugins list:\n${e}`)}))}});if(i){i.addItem({command:p.open,category:u})}if(s){void s.restore(_,{command:p.open,name:e=>"plugins",args:e=>{const{query:t,isDisclaimed:n}=e.content.model;const i={query:t,isDisclaimed:n};return i}})}return{open:()=>e.commands.execute(p.open)}}};const f=[g];const v=f},57292:(e,t,n)=>{"use strict";var i=n(40662);var s=n(97913);var o=n(3579);var r=n(14383)},13125:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IPluginManager:()=>w,PluginListModel:()=>m,Plugins:()=>f});var i=n(72050);var s=n(37737);var o=n(77256);var r=n(66127);var a=n(2336);var l=n(5592);var d=n(61927);var c=n(44914);function h(e){return c.createElement(c.Fragment,null,e.trans.__('The plugin "%1" cannot be disabled as it is required by other plugins:',e.plugin.id),c.createElement("ul",null,e.dependants.map((e=>c.createElement("li",{key:"dependantsDialog-"+e.id},e.id)))),e.trans.__("Please disable the dependent plugins first."))}function u(e){return c.createElement("div",{className:"jp-pluginmanager-PluginInUseMessage"},e.trans.__('While the plugin "%1" is not required by other enabled plugins, some plugins provide optional features depending on it. These plugins are:',e.plugin.id),c.createElement("ul",null,e.optionalDependants.map((e=>c.createElement("li",{key:"optionalDependantsDialog-"+e.id},e.id)))),e.trans.__("Do you want to disable it anyway?"))}const p="lab/api/plugins";class m extends r.VDomModel{constructor(e){var t,n,i;super();this.statusError=null;this.actionError=null;this._trackerDataChanged=new a.Signal(this);this._isLoading=false;this._pendingActions=[];this._ready=new l.PromiseDelegate;this._pluginData=e.pluginData;this._serverSettings=e.serverSettings||o.ServerConnection.makeSettings();this._query=e.query||"";this._isDisclaimed=(t=e.isDisclaimed)!==null&&t!==void 0?t:false;this._extraLockedPlugins=(n=e.extraLockedPlugins)!==null&&n!==void 0?n:[];this.refresh().then((()=>this._ready.resolve())).catch((e=>this._ready.reject(e)));this._trans=((i=e.translator)!==null&&i!==void 0?i:d.nullTranslator).load("jupyterlab")}get available(){return[...this._available.values()]}get isLoading(){return this._isLoading}get isDisclaimed(){return this._isDisclaimed}set isDisclaimed(e){if(e!==this._isDisclaimed){this._isDisclaimed=e;this.stateChanged.emit();this._trackerDataChanged.emit(void 0)}}get query(){return this._query}set query(e){if(this._query!==e){this._query=e;this.stateChanged.emit();this._trackerDataChanged.emit(void 0)}}get trackerDataChanged(){return this._trackerDataChanged}get ready(){return this._ready.promise}async enable(e){if(!this.isDisclaimed){throw new Error("User has not confirmed the disclaimer")}await this._performAction("enable",e);e.enabled=true}async disable(e){if(!this.isDisclaimed){throw new Error("User has not confirmed the disclaimer")}const{dependants:t,optionalDependants:n}=this.getDependants(e);if(t.length>0){void(0,i.showDialog)({title:this._trans.__("This plugin is required by other plugins"),body:h({plugin:e,dependants:t,trans:this._trans}),buttons:[i.Dialog.okButton()]});return}if(n.length>0){const t=await(0,i.showDialog)({title:this._trans.__("This plugin is used by other plugins"),body:u({plugin:e,optionalDependants:n,trans:this._trans}),buttons:[i.Dialog.okButton({label:this._trans.__("Disable anyway")}),i.Dialog.cancelButton()]});if(!t.button.accept){return}}await this._performAction("disable",e);if(this.actionError){return}e.enabled=false}getDependants(e){const t=[];const n=[];if(e.provides){const i=e.provides.name;for(const e of this._available.values()){if(!e.enabled){continue}if(e.requires.filter((e=>!!e)).some((e=>e.name===i))){t.push(e)}if(e.optional.filter((e=>!!e)).some((e=>e.name===i))){n.push(e)}}}return{dependants:t,optionalDependants:n}}hasPendingActions(){return this._pendingActions.length>0}_performAction(e,t){this.actionError=null;const n=this._requestAPI({},{method:"POST",body:JSON.stringify({cmd:e,plugin_name:t.id})});n.catch((e=>{this.actionError=e.toString()}));this._addPendingAction(n);return n}_addPendingAction(e){this._pendingActions.push(e);const t=()=>{const t=this._pendingActions.indexOf(e);this._pendingActions.splice(t,1);this.stateChanged.emit(undefined)};e.then(t,t);this.stateChanged.emit(undefined)}async refresh(){var e;this.statusError=null;this._isLoading=true;this.stateChanged.emit();try{const t={allLocked:true,lockRules:[]};const n=(e=await this._requestAPI())!==null&&e!==void 0?e:t;this._available=new Map(this._pluginData.availablePlugins.map((e=>{let t=e.provides?e.provides.name.split(":")[1]:undefined;if(e.provides&&!t){t=e.provides.name}return[e.id,{...e,locked:this._isLocked(e.id,n),tokenLabel:t}]})))}catch(t){this.statusError=t.toString()}finally{this._isLoading=false;this.stateChanged.emit()}}_isLocked(e,t){if(t.allLocked){return true}if(this._extraLockedPlugins.includes(e)){return true}const n=e.split(":")[0];if(t.lockRules.includes(n)){return true}if(t.lockRules.includes(e)){return true}return false}async _requestAPI(e={},t={}){const n=this._serverSettings;const i=s.URLExt.join(n.baseUrl,p);let r;try{r=await o.ServerConnection.makeRequest(i+s.URLExt.objectToQueryString(e),t,n)}catch(l){throw new o.ServerConnection.NetworkError(l)}let a=await r.text();if(a.length>0){try{a=JSON.parse(a)}catch(l){console.log("Not a JSON response body.",r)}}if(!r.ok){throw new o.ServerConnection.ResponseError(r,a.message||a)}return a}}var g=n(1143);class f extends g.Panel{constructor(e){const{model:t,translator:n}=e;super();this.model=t;this.addClass("jp-pluginmanager");this.trans=n.load("jupyterlab");this.addWidget(new _(t,this.trans));const i=new b(t,this.trans);this.addWidget(i);const s=new v(t,this.trans);this.addWidget(s)}}class v extends i.VDomRenderer{constructor(e,t){super(e);this.trans=t;this.addClass("jp-pluginmanager-AvailableList")}render(){return c.createElement(c.Fragment,null,this.model.statusError!==null?c.createElement(y,null,this.trans.__("Error querying installed extensions%1",this.model.statusError?`: ${this.model.statusError}`:".")):this.model.isLoading?c.createElement("div",{className:"jp-pluginmanager-loader"},this.trans.__("Updating plugin list…")):c.createElement(r.Table,{blankIndicator:()=>c.createElement("div",null,this.trans.__("No entries")),sortKey:"plugin-id",rows:this.model.available.filter((e=>{const t=new RegExp(this.model.query,"i");return t.test(e.id)||t.test(e.extension)||e.tokenLabel&&t.test(e.tokenLabel)})).map((e=>({data:e,key:e.id}))),columns:[{id:"plugin-id",label:this.trans.__("Plugin"),renderCell:e=>c.createElement(c.Fragment,null,c.createElement("code",null,e.id),c.createElement("br",null),e.description),sort:(e,t)=>e.id.localeCompare(t.id)},{id:"description",label:this.trans.__("Description"),renderCell:e=>c.createElement(c.Fragment,null,e.description),sort:(e,t)=>e.description&&t.description?e.description.localeCompare(t.description):undefined,isHidden:true},{id:"autostart",label:this.trans.__("Autostart?"),renderCell:e=>{switch(e.autoStart){case"defer":return this.trans.__("Defer");case true:return this.trans.__("Yes");case false:case undefined:return this.trans.__("No");default:const t=e.autoStart;throw new Error(`Unknown value: ${t}`)}},sort:(e,t)=>e.autoStart===t.autoStart?0:e.autoStart?-1:1},{id:"requires",label:this.trans.__("Depends on"),renderCell:e=>c.createElement(c.Fragment,null,e.requires.map((e=>e.name)).join("\n")),sort:(e,t)=>(e.requires||[]).length-(t.requires||[]).length,isHidden:true},{id:"extension",label:this.trans.__("Extension"),renderCell:e=>c.createElement(c.Fragment,null,e.extension),sort:(e,t)=>e.extension.localeCompare(t.extension)},{id:"provides",label:this.trans.__("Provides"),renderCell:e=>c.createElement(c.Fragment,null,e.provides?c.createElement("code",{title:e.provides.name},e.tokenLabel):"-"),sort:(e,t)=>(e.tokenLabel||"").localeCompare(t.tokenLabel||"")},{id:"enabled",label:this.trans.__("Enabled"),renderCell:e=>c.createElement(c.Fragment,null,c.createElement("input",{type:"checkbox",checked:e.enabled,disabled:e.locked||!this.model.isDisclaimed,title:e.locked||!this.model.isDisclaimed?e.locked?this.trans.__("This plugin is locked."):this.trans.__("To enable/disable, please acknowledge the disclaimer."):e.enabled?this.trans.__("Disable %1 plugin",e.id):this.trans.__("Enable %1 plugin",e.id),onChange:t=>{if(!this.model.isDisclaimed){return}if(t.target.checked){void this.onAction("enable",e)}else{void this.onAction("disable",e)}}}),e.locked?c.createElement(r.lockIcon.react,{tag:"span",title:this.trans.__("This plugin was locked by system administrator or is a critical dependency and cannot be enabled/disabled.")}):""),sort:(e,t)=>+e.enabled-+t.enabled}]}))}onAction(e,t){switch(e){case"enable":return this.model.enable(t);case"disable":return this.model.disable(t);default:throw new Error(`Invalid action: ${e}`)}}}class _ extends i.VDomRenderer{constructor(e,t){super(e);this.trans=t;this.addClass("jp-pluginmanager-Disclaimer")}render(){return c.createElement("div",null,c.createElement("div",null,this.trans.__("Customise your experience/improve performance by disabling plugins you do not need. To disable or uninstall an entire extension use the Extension Manager instead. Changes will apply after reloading JupyterLab.")),c.createElement("label",null,c.createElement("input",{type:"checkbox",className:"jp-mod-styled jp-pluginmanager-Disclaimer-checkbox",defaultChecked:this.model.isDisclaimed,onChange:e=>{this.model.isDisclaimed=e.target.checked}}),this.trans.__("I understand that disabling core application plugins may render features and parts of the user interface unavailable and recovery using `jupyter labextension enable ` command may be required")))}}class b extends i.VDomRenderer{constructor(e,t){super(e);this.trans=t;this.addClass("jp-pluginmanager-Header")}render(){return c.createElement(c.Fragment,null,c.createElement(r.FilterBox,{placeholder:this.trans.__("Filter"),updateFilter:(e,t)=>{this.model.query=t!==null&&t!==void 0?t:""},initialQuery:this.model.query,useFuzzyFilter:false}),c.createElement("div",{className:`jp-pluginmanager-pending ${this.model.hasPendingActions()?"jp-mod-hasPending":""}`}),this.model.actionError&&c.createElement(y,null,c.createElement("p",null,this.trans.__("Error when performing an action.")),c.createElement("p",null,this.trans.__("Reason given:")),c.createElement("pre",null,this.model.actionError)))}}function y(e){return c.createElement("div",{className:"jp-pluginmanager-error"},e.children)}const w=new l.Token("@jupyterlab/pluginmanager:IPluginManager",`A canary for plugin manager presence, with a method to open the plugin manager widget.`)},14383:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(3579);var a=n(85072);var l=n.n(a);var d=n(97825);var c=n.n(d);var h=n(77659);var u=n.n(h);var p=n(55056);var m=n.n(p);var g=n(10540);var f=n.n(g);var v=n(41113);var _=n.n(v);var b=n(37442);var y={};y.styleTagTransform=_();y.setAttributes=m();y.insert=u().bind(null,"head");y.domAPI=c();y.insertStyleElement=f();var w=l()(b.A,y);const C=b.A&&b.A.locals?b.A.locals:undefined},87221:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IPropertyInspectorProvider:()=>l,SideBarPropertyInspectorProvider:()=>c});var i=n(61927);var s=n(66127);var o=n(2336);var r=n(1143);var a=n(5592);const l=new a.Token("@jupyterlab/property-inspector:IPropertyInspectorProvider","A service to register new widgets in the property inspector side panel.");class d extends r.Widget{constructor(){super();this._tracker=new r.FocusTracker;this._inspectors=new Map;this.addClass("jp-PropertyInspector");this._tracker=new r.FocusTracker;this._tracker.currentChanged.connect(this._onCurrentChanged,this)}register(e){if(this._inspectors.has(e)){throw new Error("Widget is already registered")}const t=new h.PropertyInspector(e);e.disposed.connect(this._onWidgetDisposed,this);this._inspectors.set(e,t);t.onAction.connect(this._onInspectorAction,this);this._tracker.add(e);return t}get currentWidget(){return this._tracker.currentWidget}refresh(){const e=this._tracker.currentWidget;if(!e){this.setContent(null);return}const t=this._inspectors.get(e);if(t){this.setContent(t.content)}}_onWidgetDisposed(e){const t=this._inspectors.get(e);if(t){t.dispose();this._inspectors.delete(e)}}_onInspectorAction(e,t){const n=e.owner;const i=this._tracker.currentWidget;switch(t){case"content":if(i===n){this.setContent(e.content)}break;case"dispose":if(n){this._tracker.remove(n);this._inspectors.delete(n)}break;case"show-panel":if(i===n){this.showPanel()}break;default:throw new Error("Unsupported inspector action")}}_onCurrentChanged(){const e=this._tracker.currentWidget;if(e){const t=this._inspectors.get(e);const n=t.content;this.setContent(n)}else{this.setContent(null)}}}class c extends d{constructor({shell:e,placeholder:t,translator:n}){super();this._labshell=e;this.translator=n||i.nullTranslator;this._trans=this.translator.load("jupyterlab");const s=this.layout=new r.SingletonLayout;if(t){this._placeholder=t}else{const e=document.createElement("div");const t=document.createElement("div");const n=document.createElement("h3");const i=document.createElement("p");n.textContent=this._trans.__("No Properties");i.textContent=this._trans.__("The property inspector allows to view and edit properties of a selected notebook.");t.className="jp-PropertyInspector-placeholderContent";t.appendChild(n);t.appendChild(i);e.appendChild(t);this._placeholder=new r.Widget({node:e});this._placeholder.addClass("jp-PropertyInspector-placeholder")}s.widget=this._placeholder;this._labshell.currentChanged.connect(this._onShellCurrentChanged,this);this._onShellCurrentChanged()}setContent(e){const t=this.layout;if(t.widget){t.widget.removeClass("jp-PropertyInspector-content");t.removeWidget(t.widget)}if(!e){e=this._placeholder}e.addClass("jp-PropertyInspector-content");t.widget=e}showPanel(){this._labshell.activateById(this.id)}_onShellCurrentChanged(){const e=this.currentWidget;if(!e){this.setContent(null);return}const t=this._labshell.currentWidget;if(t===null||t===void 0?void 0:t.node.contains(e.node)){this.refresh()}else{this.setContent(null)}}}var h;(function(e){class t{constructor(e){this._isDisposed=false;this._content=null;this._owner=null;this._onAction=new o.Signal(this);this._owner=e}get owner(){return this._owner}get content(){return this._content}get isDisposed(){return this._isDisposed}get onAction(){return this._onAction}showPanel(){if(this._isDisposed){return}this._onAction.emit("show-panel")}render(e){if(this._isDisposed){return}if(e instanceof r.Widget){this._content=e}else{this._content=s.ReactWidget.create(e)}this._onAction.emit("content")}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._content=null;this._owner=null;o.Signal.clearData(this)}}e.PropertyInspector=t})(h||(h={}))},58130:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(3579);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(35667);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},97872:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>p});var i=n(72050);var s=n.n(i);var o=n(65189);var r=n.n(o);var a=n(90943);var l=n.n(a);var d=n(61927);var c=n.n(d);var h;(function(e){e.handleLink="rendermime:handle-local-link"})(h||(h={}));const u={id:"@jupyterlab/rendermime-extension:plugin",description:"Provides the render mime registry.",optional:[o.IDocumentManager,a.ILatexTypesetter,i.ISanitizer,a.IMarkdownParser,d.ITranslator],provides:a.IRenderMimeRegistry,activate:g,autoStart:true};const p=u;const m="debugger:open-source";function g(e,t,n,i,s,o){const r=(o!==null&&o!==void 0?o:d.nullTranslator).load("jupyterlab");if(t){e.commands.addCommand(h.handleLink,{label:r.__("Handle Local Link"),execute:n=>{const i=n["path"];const s=n["id"];const o=n["scope"]||"server";if(!i){return}if(o==="kernel"){if(!e.commands.hasCommand(m)){console.warn("Cannot open kernel file: debugger sources provider not available");return}return e.commands.execute(m,{path:i})}return t.services.contents.get(i,{content:false}).then((()=>{const e=t.registry.defaultRenderedWidgetFactory(i);const n=t.openOrReveal(i,e.name);if(n&&s){n.setFragment(s)}}))}})}return new a.RenderMimeRegistry({initialFactories:a.standardRendererFactories,linkHandler:!t?undefined:{handleLink:(t,n,i)=>{if(t.tagName==="A"&&t.hasAttribute("download")){return}e.commandLinker.connectNode(t,h.handleLink,{path:n,id:i})},handlePath:(t,n,i,s)=>{e.commandLinker.connectNode(t,h.handleLink,{path:n,id:s,scope:i})}},latexTypesetter:n!==null&&n!==void 0?n:undefined,markdownParser:s!==null&&s!==void 0?s:undefined,translator:o!==null&&o!==void 0?o:undefined,sanitizer:i!==null&&i!==void 0?i:undefined})}},80046:(e,t,n)=>{"use strict";var i=n(97913);var s=n(5893);var o=n(3579);var r=n(41603)},60479:(e,t,n)=>{"use strict";n.r(t)},32278:(e,t,n)=>{"use strict";n.d(t,{l:()=>d});var i=n(68148);var s=n.n(i);var o=n(5592);var r=n.n(o);var a=n(2336);var l=n.n(a);class d{constructor(e){this.trusted=false;this._changed=new a.Signal(this);this._raw={};const t=c.getData(e.value);this._data=new i.ObservableJSON({values:t});this._rawData=t;const n=e.value;for(const i in n){switch(i){case"data":break;default:this._raw[i]=c.extract(n,i)}}}get changed(){return this._changed}dispose(){this._data.dispose();a.Signal.clearData(this)}get data(){return this._rawData}get metadata(){return{}}setData(e){if(e.data){this._updateObservable(this._data,e.data);this._rawData=e.data}this._changed.emit(void 0)}toJSON(){const e={};for(const t in this._raw){e[t]=c.extract(this._raw,t)}return e}_updateObservable(e,t){const n=e.keys();const i=Object.keys(t);for(const s of n){if(i.indexOf(s)===-1){e.delete(s)}}for(const s of i){const n=e.get(s);const i=t[s];if(n!==i){e.set(s,i)}}}}(function(e){function t(e){return c.getData(e)}e.getData=t})(d||(d={}));var c;(function(e){function t(e){return s(e)}e.getData=t;function n(e){const n=t(e.value);return{data:n}}e.getBundleOptions=n;function i(e,t){const n=e[t];if(n===undefined||o.JSONExt.isPrimitive(n)){return n}return o.JSONExt.deepCopy(n)}e.extract=i;function s(e){const t=Object.create(null);for(const n in e){t[n]=i(e,n)}return t}})(c||(c={}))},41586:(e,t,n)=>{"use strict";n.d(t,{Fh:()=>s,NQ:()=>o,SF:()=>r,U1:()=>l,dn:()=>u,hL:()=>a,hY:()=>h,jn:()=>c,qQ:()=>d});var i=n(18901);const s={safe:true,mimeTypes:["text/html"],defaultRank:50,createRenderer:e=>new i.TH(e)};const o={safe:true,mimeTypes:["image/bmp","image/png","image/jpeg","image/gif","image/webp"],defaultRank:90,createRenderer:e=>new i.vf(e)};const r={safe:true,mimeTypes:["text/latex"],defaultRank:70,createRenderer:e=>new i.Kc(e)};const a={safe:true,mimeTypes:["text/markdown"],defaultRank:60,createRenderer:e=>new i.jL(e)};const l={safe:false,mimeTypes:["image/svg+xml"],defaultRank:80,createRenderer:e=>new i.Yk(e)};const d={safe:true,mimeTypes:["application/vnd.jupyter.stderr"],defaultRank:110,createRenderer:e=>new i.A6(e)};const c={safe:true,mimeTypes:["text/plain","application/vnd.jupyter.stdout"],defaultRank:120,createRenderer:e=>new i.Vx(e)};const h={safe:false,mimeTypes:["text/javascript","application/javascript"],defaultRank:110,createRenderer:e=>new i.TS(e)};const u=[s,a,r,l,o,h,d,c]},17200:(e,t,n)=>{"use strict";n.r(t);n.d(t,{AttachmentModel:()=>r.l,ILatexTypesetter:()=>p.nc,IMarkdownParser:()=>p.co,IRenderMimeRegistry:()=>p.N3,MimeModel:()=>d.w,OutputModel:()=>c.L,RenderMimeRegistry:()=>h.K,RenderedCommon:()=>m.nZ,RenderedError:()=>m.A6,RenderedHTML:()=>m.TH,RenderedHTMLCommon:()=>m.C6,RenderedImage:()=>m.vf,RenderedJavaScript:()=>m.TS,RenderedLatex:()=>m.Kc,RenderedMarkdown:()=>m.jL,RenderedSVG:()=>m.Yk,RenderedText:()=>m.Vx,errorRendererFactory:()=>a.qQ,htmlRendererFactory:()=>a.Fh,imageRendererFactory:()=>a.NQ,javaScriptRendererFactory:()=>a.hY,latexRendererFactory:()=>a.SF,markdownRendererFactory:()=>a.hL,removeMath:()=>l.r,renderError:()=>u.vr,renderHTML:()=>u.e2,renderImage:()=>u.mx,renderLatex:()=>u.zG,renderMarkdown:()=>u.Gc,renderSVG:()=>u.d8,renderText:()=>u.S5,replaceMath:()=>l.H,standardRendererFactories:()=>a.dn,svgRendererFactory:()=>a.U1,textRendererFactory:()=>a.jn});var i=n(89265);var s=n.n(i);var o={};for(const g in i)if(g!=="default")o[g]=()=>i[g];n.d(t,o);var r=n(32278);var a=n(41586);var l=n(52608);var d=n(29549);var c=n(34354);var h=n(71153);var u=n(11364);var p=n(21944);var m=n(18901)},52608:(e,t,n)=>{"use strict";n.d(t,{H:()=>r,r:()=>o});const i="$";const s=/(\$\$?|\\(?:begin|end)\{[a-z]*\*?\}|\\[{}$]|[{}]|(?:\n\s*)+|@@\d+@@|\\\\(?:\(|\)|\[|\]))/i;function o(e){const t=[];let n=null;let o=null;let r=null;let l=0;let d;const c=e.includes("`")||e.includes("~~~");if(c){e=e.replace(/~/g,"~T").replace(/^(?`{3,}|(~T){3,})[^`\n]*\n([\s\S]*?)^\k`*$/gm,(e=>e.replace(/\$/g,"~D"))).replace(/(^|[^\\])(`+)([^\n]*?[^`\n])\2(?!`)/gm,(e=>e.replace(/\$/g,"~D")));d=e=>e.replace(/~([TD])/g,((e,t)=>t==="T"?"~":i))}else{d=e=>e}let h=e.replace(/\r\n?/g,"\n").split(s);for(let s=1,u=h.length;s{let i=t[n];if(i.substr(0,3)==="\\\\("&&i.substr(i.length-3)==="\\\\)"){i="\\("+i.substring(3,i.length-3)+"\\)"}else if(i.substr(0,3)==="\\\\["&&i.substr(i.length-3)==="\\\\]"){i="\\["+i.substring(3,i.length-3)+"\\]"}return i};return e.replace(/@@(\d+)@@/g,n)}function a(e,t,n,i,s){let o=s.slice(e,t+1).join("").replace(/&/g,"&").replace(//g,">");if(navigator&&navigator.appName==="Microsoft Internet Explorer"){o=o.replace(/(%[^\n]*)\n/g,"$1
\n")}while(t>e){s[t]="";t--}s[e]="@@"+i.length+"@@";if(n){o=n(o)}i.push(o);return s}},29549:(e,t,n)=>{"use strict";n.d(t,{w:()=>i});class i{constructor(e={}){this.trusted=!!e.trusted;this._data=e.data||{};this._metadata=e.metadata||{};this._callback=e.callback||s.noOp}get data(){return this._data}get metadata(){return this._metadata}setData(e){this._data=e.data||this._data;this._metadata=e.metadata||this._metadata;this._callback(e)}}var s;(function(e){function t(){}e.noOp=t})(s||(s={}))},34354:(e,t,n)=>{"use strict";n.d(t,{L:()=>h});var i=n(34501);var s=n.n(i);var o=n(68148);var r=n.n(o);var a=n(5592);var l=n.n(a);var d=n(2336);var c=n.n(d);class h{constructor(e){this._changed=new d.Signal(this);this._raw={};this._text=undefined;const{data:t,metadata:n,trusted:s}=u.getBundleOptions(e);this._rawData=t;if(e.value!==undefined&&i.isStream(e.value)){this._text=new o.ObservableString(typeof e.value.text==="string"?e.value.text:e.value.text.join(""))}this._metadata=new o.ObservableJSON({values:n});this._rawMetadata=n;this.trusted=s;const r=e.value;for(const i in r){switch(i){case"data":case"metadata":break;default:this._raw[i]=u.extract(r,i)}}this.type=r.output_type;if(i.isExecuteResult(r)){this.executionCount=r.execution_count}else{this.executionCount=null}}get changed(){return this._changed}dispose(){var e;(e=this._text)===null||e===void 0?void 0:e.dispose();this._metadata.dispose();d.Signal.clearData(this)}get data(){return u.getData(this.toJSON())}get streamText(){return this._text}get metadata(){return this._rawMetadata}setData(e){if(e.data){this._rawData=e.data}if(e.metadata){this._updateObservable(this._metadata,e.metadata);this._rawMetadata=e.metadata}this._changed.emit()}toJSON(){const e={};for(const t in this._raw){e[t]=u.extract(this._raw,t)}if(this._text!==undefined){e["text"]=this._text.text}switch(this.type){case"display_data":case"execute_result":case"update_display_data":e["data"]=this._rawData;e["metadata"]=this.metadata;break;default:break}delete e["transient"];return e}_updateObservable(e,t){const n=e.keys();const i=Object.keys(t);for(const s of n){if(i.indexOf(s)===-1){e.delete(s)}}for(const s of i){const n=e.get(s);const i=t[s];if(n!==i){e.set(s,i)}}}}(function(e){function t(e){return u.getData(e)}e.getData=t;function n(e){return u.getMetadata(e)}e.getMetadata=n})(h||(h={}));var u;(function(e){function t(e){let t={};if(i.isExecuteResult(e)||i.isDisplayData(e)||i.isDisplayUpdate(e)){t=e.data}else if(i.isStream(e)){if(e.name==="stderr"){t["application/vnd.jupyter.stderr"]=e.text}else{t["application/vnd.jupyter.stdout"]=e.text}}else if(i.isError(e)){t["application/vnd.jupyter.error"]=e;const n=e.traceback.join("\n");t["application/vnd.jupyter.stderr"]=n||`${e.ename}: ${e.evalue}`}return r(t)}e.getData=t;function n(e){const t=Object.create(null);if(i.isExecuteResult(e)||i.isDisplayData(e)){for(const n in e.metadata){t[n]=o(e.metadata,n)}}return t}e.getMetadata=n;function s(e){const i=t(e.value);const s=n(e.value);const o=!!e.trusted;return{data:i,metadata:s,trusted:o}}e.getBundleOptions=s;function o(e,t){const n=e[t];if(n===undefined||a.JSONExt.isPrimitive(n)){return n}return JSON.parse(JSON.stringify(n))}e.extract=o;function r(e){const t=Object.create(null);for(const n in e){t[n]=o(e,n)}return t}})(u||(u={}))},71153:(e,t,n)=>{"use strict";n.d(t,{K:()=>c});var i=n(72050);var s=n.n(i);var o=n(37737);var r=n.n(o);var a=n(61927);var l=n.n(a);var d=n(29549);class c{constructor(e={}){var t,n,s,o,r,l;this._id=0;this._ranks={};this._types=null;this._factories={};this.translator=(t=e.translator)!==null&&t!==void 0?t:a.nullTranslator;this.resolver=(n=e.resolver)!==null&&n!==void 0?n:null;this.linkHandler=(s=e.linkHandler)!==null&&s!==void 0?s:null;this.latexTypesetter=(o=e.latexTypesetter)!==null&&o!==void 0?o:null;this.markdownParser=(r=e.markdownParser)!==null&&r!==void 0?r:null;this.sanitizer=(l=e.sanitizer)!==null&&l!==void 0?l:new i.Sanitizer;if(e.initialFactories){for(const t of e.initialFactories){this.addFactory(t)}}}get mimeTypes(){return this._types||(this._types=h.sortedTypes(this._ranks))}preferredMimeType(e,t="ensure"){if(t==="ensure"||t==="prefer"){for(const t of this.mimeTypes){if(t in e&&this._factories[t].safe){return t}}}if(t!=="ensure"){for(const t of this.mimeTypes){if(t in e){return t}}}return undefined}createRenderer(e){if(!(e in this._factories)){throw new Error(`No factory for mime type: '${e}'`)}return this._factories[e].createRenderer({mimeType:e,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}createModel(e={}){return new d.w(e)}clone(e={}){var t,n,i,s,o,r,a,l,d,h;const u=new c({resolver:(n=(t=e.resolver)!==null&&t!==void 0?t:this.resolver)!==null&&n!==void 0?n:undefined,sanitizer:(s=(i=e.sanitizer)!==null&&i!==void 0?i:this.sanitizer)!==null&&s!==void 0?s:undefined,linkHandler:(r=(o=e.linkHandler)!==null&&o!==void 0?o:this.linkHandler)!==null&&r!==void 0?r:undefined,latexTypesetter:(l=(a=e.latexTypesetter)!==null&&a!==void 0?a:this.latexTypesetter)!==null&&l!==void 0?l:undefined,markdownParser:(h=(d=e.markdownParser)!==null&&d!==void 0?d:this.markdownParser)!==null&&h!==void 0?h:undefined,translator:this.translator});u._factories={...this._factories};u._ranks={...this._ranks};u._id=this._id;return u}getFactory(e){return this._factories[e]}addFactory(e,t){if(t===undefined){t=e.defaultRank;if(t===undefined){t=100}}for(const n of e.mimeTypes){this._factories[n]=e;this._ranks[n]={rank:t,id:this._id++}}this._types=null}removeMimeType(e){delete this._factories[e];delete this._ranks[e];this._types=null}getRank(e){const t=this._ranks[e];return t&&t.rank}setRank(e,t){if(!this._ranks[e]){return}const n=this._id++;this._ranks[e]={rank:t,id:n};this._types=null}}(function(e){class t{constructor(e){this._path=e.path;this._contents=e.contents}get path(){return this._path}set path(e){this._path=e}async resolveUrl(e){if(this.isLocal(e)){const t=encodeURI(o.PathExt.dirname(this.path));e=o.PathExt.resolve(t,e)}return e}async getDownloadUrl(e){if(this.isLocal(e)){return this._contents.getDownloadUrl(decodeURIComponent(e))}return e}isLocal(e,t=false){if(this.isMalformed(e)){return false}return o.URLExt.isLocal(e,t)||!!this._contents.driveName(decodeURI(e))}async resolvePath(e){const t=o.PageConfig.getOption("rootUri").replace("file://","");if(e.startsWith("~/")&&t.startsWith("/home/")){e=t.split("/").slice(0,3).join("/")+e.substring(1)}if(e.startsWith(t)||e.startsWith("./")){try{const n=e.replace(t,"");const i=await this._contents.get(n,{content:false});return{path:i.path,scope:"server"}}catch(n){console.warn(`Could not resolve location of ${e} on server`);return null}}return{path:e,scope:"kernel"}}isMalformed(e){try{decodeURI(e);return false}catch(t){if(t instanceof URIError){return true}throw t}}}e.UrlResolver=t})(c||(c={}));var h;(function(e){function t(e){return Object.keys(e).sort(((t,n)=>{const i=e[t];const s=e[n];if(i.rank!==s.rank){return i.rank-s.rank}return i.id-s.id}))}e.sortedTypes=t})(h||(h={}))},11364:(e,t,n)=>{"use strict";n.d(t,{Gc:()=>p,S5:()=>C,d8:()=>m,e2:()=>c,mx:()=>h,vr:()=>I,zG:()=>u});var i=n(37737);var s=n.n(i);var o=n(61927);var r=n.n(o);var a=n(67901);var l=n.n(a);var d=n(52608);async function c(e){let{host:t,source:n,trusted:i,sanitizer:s,resolver:r,linkHandler:a,shouldTypeset:l,latexTypesetter:d,translator:c}=e;c=c||o.nullTranslator;const h=c===null||c===void 0?void 0:c.load("jupyterlab");let u=n;if(!n){t.textContent="";return}if(!i){u=`${n}`;n=s.sanitize(n)}t.innerHTML=n;if(t.getElementsByTagName("script").length>0){if(i){T.evalInnerHTMLScriptTags(t)}else{const e=document.createElement("div");const n=document.createElement("pre");n.textContent=h.__("This HTML output contains inline scripts. Are you sure that you want to run arbitrary Javascript within your JupyterLab session?");const i=document.createElement("button");i.textContent=h.__("Run");i.onclick=e=>{t.innerHTML=u;T.evalInnerHTMLScriptTags(t);if(t.firstChild){t.removeChild(t.firstChild)}};e.appendChild(n);e.appendChild(i);t.insertBefore(e,t.firstChild)}}T.handleDefaults(t,r);if(r){await T.handleUrls(t,r,a)}if(l&&d){d.typeset(t)}}async function h(e){const{host:t,mimeType:n,source:i,width:s,height:o,needsBackground:r,unconfined:a}=e;t.textContent="";const l=document.createElement("img");l.src=`data:${n};base64,${i}`;if(typeof o==="number"){l.height=o}if(typeof s==="number"){l.width=s}if(r==="light"){l.classList.add("jp-needs-light-background")}else if(r==="dark"){l.classList.add("jp-needs-dark-background")}if(a===true){l.classList.add("jp-mod-unconfined")}t.appendChild(l)}async function u(e){const{host:t,source:n,shouldTypeset:i,latexTypesetter:s}=e;t.textContent=n;if(i&&s){s.typeset(t)}}async function p(e){var t;const{host:n,source:i,markdownParser:s,...o}=e;if(!i){n.textContent="";return}let r="";if(s){const e=(0,d.r)(i);r=await s.render(e["text"]);r=(0,d.H)(r,e["math"])}else{r=`
${i}
`}await c({host:n,source:r,...o});T.headerAnchors(n,(t=e.sanitizer.allowNamedProperties)!==null&&t!==void 0?t:false)}(function(e){function t(e){var t;return((t=e.textContent)!==null&&t!==void 0?t:"").replace(/ /g,"-")}e.createHeaderId=t})(p||(p={}));async function m(e){let{host:t,source:n,trusted:i,unconfined:s}=e;if(!n){t.textContent="";return}if(!i){t.textContent="Cannot display an untrusted SVG. Maybe you need to run the cell?";return}const o="]+xmlns=[^>]+svg";if(n.search(o)<0){n=n.replace("(?:[a-zA-Z][a-zA-Z0-9+.-]{2,"+t+"}:\\/\\/|data:|www\\.)[^\\s"+n+'"]{2,}[^\\s'+n+"\"'(){}\\[\\],:;.!?])","ug");const i=/(?:[a-zA-Z]:(?:(?:\\|\/)[\w\.-]*)+)/;const s=/(?:(?:\~|\.)(?:(?:\\|\/)[\w\.-]*)+)/;const o=new RegExp(`(${i.source}|${s.source})`);const r=/((?:\~|\.)?(?:\/[\w\.-]*)+)/;const a=/(?:(?:\:|", line )(?[\d]+))?(?:\:(?[\d]+))?/;const l=navigator.userAgent.indexOf("Windows")>=0;e.pathLinkRegex=new RegExp(`(?${l?o.source:r.source})${a.source}`,"g")})(g||(g={}));class f{constructor(){this.regex=g.webLinkRegex}createAnchor(e,t){const n=document.createElement("a");n.href=e.startsWith("www.")?"https://"+e:e;n.rel="noopener";n.target="_blank";n.appendChild(document.createTextNode(t));return n}processPath(e){const t=e.slice(-1);const n=[">","<"].indexOf(t)!==-1;const i=n?e.length-1:e.length;e=e.slice(0,i);return e}processLabel(e){return this.processPath(e)}}class v{constructor(){this.regex=g.pathLinkRegex}createAnchor(e,t,n){const i=document.createElement("a");i.dataset.path=e;const s=parseInt(n["line"],10);let o=!isNaN(s)?`line=${s-1}`:"";i.dataset.locator=o;i.appendChild(document.createTextNode(t));return i}}function _(e,t){const n=[];if(t.checkWeb){n.push(new f)}if(t.checkPaths){n.push(new v)}const i=[];const s=(e,t)=>{if(t>=n.length){i.push(document.createTextNode(e));return}const o=n[t];let r;let a=0;const l=o.regex;l.lastIndex=0;while(null!=(r=l.exec(e))){const n=e.substring(a,r.index);if(n){s(n,t+1)}const{path:l,...d}=r.groups;const c=o.processPath?o.processPath(l):l;const h=o.processLabel?o.processLabel(r[0]):r[0];i.push(o.createAnchor(c,h,d));a=r.index+h.length}const d=e.substring(a);if(d){s(d,t+1)}};s(e,0);return i}function b(e,t){var n,i;const s=e.cloneNode();s.textContent=(n=e.textContent)===null||n===void 0?void 0:n.slice(0,t);const o=e.cloneNode();o.textContent=(i=e.textContent)===null||i===void 0?void 0:i.slice(t);return{pre:s,post:o}}function*y(e){var t;let n=0;let i;for(let s of e){i=n+(((t=s.textContent)===null||t===void 0?void 0:t.length)||0);yield{node:s,start:n,end:i,isText:s.nodeType===Node.TEXT_NODE};n=i}}function*w(e,t){var n,i;let s=y(e);let o=y(t);let r=s.next();let a=o.next();while(!r.done&&!a.done){let e=r.value;let t=a.value;if(e.isText&&e.start<=t.start&&e.end>=t.end){yield[null,t.node];a=o.next()}else if(t.isText&&t.start<=e.start&&t.end>=e.end){yield[e.node,null];r=s.next()}else{if(e.end===t.end&&e.start===t.start){yield[e.node,t.node];r=s.next();a=o.next()}else if(e.end>t.end){let{pre:i,post:s}=b(e.node,t.end-e.start);if(t.starte.end){let{pre:n,post:o}=b(t.node,e.end-t.start);if(e.starte.cloneNode(true)))})}else{e=[document.createTextNode(l)]}const r=Array.from(d.childNodes);m=E(r,e)}else{m=document.createElement("pre")}s.appendChild(m)}function j(e,t){if(!e){return null}if(t.lengthc(e,t,n))))}e.handlePaths=o;function r(e,t){const n=["h1","h2","h3","h4","h5","h6"];for(const i of n){const n=e.getElementsByTagName(i);for(let e=0;e{const s=decodeURIComponent(i);if(n){n.handleLink(e,s,r)}return t.getDownloadUrl(i)})).then((t=>{e.href=t+r})).catch((t=>{e.href=""}))}async function c(e,t,n){let s=e.dataset.path||"";let o=e.dataset.locator?"#"+e.dataset.locator:"";delete e.dataset.path;delete e.dataset.locator;const r=true;const a=t.isLocal?t.isLocal(s,r):i.URLExt.isLocal(s,r);if(!s||!a||!t.resolvePath||!n||!n.handlePath){e.replaceWith(...e.childNodes);return}try{const i=await t.resolvePath(s);if(!i){console.log("Path resolution bailing: does not exist");return}n.handlePath(e,i.path,i.scope,o);e.href=i.path+o}catch(l){console.warn("Path anchor error:",l);e.href="#linking-failed-see-console"}}const h=["ansi-black","ansi-red","ansi-green","ansi-yellow","ansi-blue","ansi-magenta","ansi-cyan","ansi-white","ansi-black-intense","ansi-red-intense","ansi-green-intense","ansi-yellow-intense","ansi-blue-intense","ansi-magenta-intense","ansi-cyan-intense","ansi-white-intense"];function u(e,t,n,i,s,o,r){if(e){const a=[];const l=[];if(i&&typeof t==="number"&&0<=t&&t<8){t+=8}if(o){[t,n]=[n,t]}if(typeof t==="number"){a.push(h[t]+"-fg")}else if(t.length){l.push(`color: rgb(${t})`)}else if(o){a.push("ansi-default-inverse-fg")}if(typeof n==="number"){a.push(h[n]+"-bg")}else if(n.length){l.push(`background-color: rgb(${n})`)}else if(o){a.push("ansi-default-inverse-bg")}if(i){a.push("ansi-bold")}if(s){a.push("ansi-underline")}if(a.length||l.length){r.push("");r.push(e);r.push("")}else{r.push(e)}}}function m(e){let t;let n;let i;const s=e.shift();if(s===2&&e.length>=3){t=e.shift();n=e.shift();i=e.shift();if([t,n,i].some((e=>e<0||255=1){const s=e.shift();if(s<0){throw new RangeError("Color index must be >= 0")}else if(s<16){return s}else if(s<232){t=Math.floor((s-16)/36);t=t>0?55+t*40:0;n=Math.floor((s-16)%36/6);n=n>0?55+n*40:0;i=(s-16)%6;i=i>0?55+i*40:0}else if(s<256){t=n=i=(s-232)*10+8}else{throw new RangeError("Color index must be < 256")}}else{throw new RangeError("Invalid extended color specification")}return[t,n,i]}function g(e){const t=/\x1b\[(.*?)([@-~])/g;let n=[];let i=[];let s=false;let o=false;let r=false;let a;const d=[];const c=[];let h=0;e=l()(e);e+="";while(a=t.exec(e)){if(a[2]==="m"){const e=a[1].split(";");for(let t=0;t{"use strict";n.d(t,{N3:()=>o,co:()=>a,nc:()=>r});var i=n(5592);var s=n.n(i);const o=new i.Token("@jupyterlab/rendermime:IRenderMimeRegistry",'A service for the rendermime registry for the application. Use this to create renderers for various mime-types in your extension. Many times it will be easier to create a "mime renderer extension" rather than using this service directly.');const r=new i.Token("@jupyterlab/rendermime:ILatexTypesetter","A service for the LaTeX typesetter for the application. Use this if you want to typeset math in your extension.");const a=new i.Token("@jupyterlab/rendermime:IMarkdownParser","A service for rendering markdown syntax as HTML content.")},18901:(e,t,n)=>{"use strict";n.d(t,{A6:()=>f,C6:()=>d,Kc:()=>h,TH:()=>c,TS:()=>v,Vx:()=>g,Yk:()=>m,jL:()=>p,nZ:()=>l,vf:()=>u});var i=n(61927);var s=n.n(i);var o=n(1143);var r=n.n(o);var a=n(11364);class l extends o.Widget{constructor(e){var t,n;super();this.mimeType=e.mimeType;this.sanitizer=e.sanitizer;this.resolver=e.resolver;this.linkHandler=e.linkHandler;this.translator=(t=e.translator)!==null&&t!==void 0?t:i.nullTranslator;this.latexTypesetter=e.latexTypesetter;this.markdownParser=(n=e.markdownParser)!==null&&n!==void 0?n:null;this.node.dataset["mimeType"]=this.mimeType}async renderModel(e,t){if(!t){while(this.node.firstChild){this.node.removeChild(this.node.firstChild)}}this.toggleClass("jp-mod-trusted",e.trusted);await this.render(e);const{fragment:n}=e.metadata;if(n){this.setFragment(n)}}setFragment(e){}}class d extends l{constructor(e){super(e);this.addClass("jp-RenderedHTMLCommon")}setFragment(e){let t;try{t=this.node.querySelector(e.startsWith("#")?`#${CSS.escape(e.slice(1))}`:e)}catch(n){console.warn("Unable to set URI fragment identifier.",n)}if(t){t.scrollIntoView()}}}class c extends d{constructor(e){super(e);this._rendered=Promise.resolve();this.addClass("jp-RenderedHTML")}render(e){return this._rendered=a.e2({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,translator:this.translator})}onAfterAttach(e){this._rendered.then((()=>{if(this.latexTypesetter){this.latexTypesetter.typeset(this.node)}})).catch(console.warn)}}class h extends l{constructor(e){super(e);this._rendered=Promise.resolve();this.addClass("jp-RenderedLatex")}render(e){return this._rendered=a.zG({host:this.node,source:String(e.data[this.mimeType]),shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter})}onAfterAttach(e){this._rendered.then((()=>{if(this.latexTypesetter){this.latexTypesetter.typeset(this.node)}})).catch(console.warn)}}class u extends l{constructor(e){super(e);this.addClass("jp-RenderedImage")}render(e){const t=e.metadata[this.mimeType];return a.mx({host:this.node,mimeType:this.mimeType,source:String(e.data[this.mimeType]),width:t&&t.width,height:t&&t.height,needsBackground:e.metadata["needs_background"],unconfined:t&&t.unconfined})}}class p extends d{constructor(e){super(e);this._rendered=Promise.resolve();this.addClass("jp-RenderedMarkdown")}render(e){return this._rendered=a.Gc({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,resolver:this.resolver,sanitizer:this.sanitizer,linkHandler:this.linkHandler,shouldTypeset:this.isAttached,latexTypesetter:this.latexTypesetter,markdownParser:this.markdownParser,translator:this.translator})}async renderModel(e){await super.renderModel(e,true)}onAfterAttach(e){this._rendered.then((()=>{if(this.latexTypesetter){this.latexTypesetter.typeset(this.node)}})).catch(console.warn)}}class m extends l{constructor(e){super(e);this._rendered=Promise.resolve();this.addClass("jp-RenderedSVG")}render(e){const t=e.metadata[this.mimeType];return this._rendered=a.d8({host:this.node,source:String(e.data[this.mimeType]),trusted:e.trusted,unconfined:t&&t.unconfined,translator:this.translator})}onAfterAttach(e){this._rendered.then((()=>{if(this.latexTypesetter){this.latexTypesetter.typeset(this.node)}})).catch(console.warn)}}class g extends l{constructor(e){super(e);this.addClass("jp-RenderedText")}render(e){return a.S5({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),translator:this.translator})}}class f extends l{constructor(e){super(e);this.addClass("jp-RenderedText")}render(e){return a.vr({host:this.node,sanitizer:this.sanitizer,source:String(e.data[this.mimeType]),linkHandler:this.linkHandler,resolver:this.resolver,translator:this.translator})}}class v extends l{constructor(e){super(e);this.addClass("jp-RenderedJavaScript")}render(e){const t=this.translator.load("jupyterlab");return a.S5({host:this.node,sanitizer:this.sanitizer,source:t.__("JavaScript output is disabled in JupyterLab"),translator:this.translator})}}},5893:(e,t,n)=>{"use strict";var i=n(10395);var s=n(97913);var o=n(85072);var r=n.n(o);var a=n(97825);var l=n.n(a);var d=n(77659);var c=n.n(d);var h=n(55056);var u=n.n(h);var p=n(10540);var m=n.n(p);var g=n(41113);var f=n.n(g);var v=n(30354);var _={};_.styleTagTransform=f();_.setAttributes=u();_.insert=c().bind(null,"head");_.domAPI=l();_.insertStyleElement=m();var b=r()(v.A,_);const y=v.A&&v.A.locals?v.A.locals:undefined},51883:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CommandIDs:()=>j,default:()=>D});var i=n(74991);var s=n(72050);var o=n(69085);var r=n(65189);var a=n(86503);var l=n(61927);var d=n(66127);var c=n(37737);var h=n(77256);var u=n(26568);var p=n(2336);var m=n(44914);var g=n.n(m);const f="jp-mod-kernel";const v="jp-mod-kernelspec";const _="jp-mod-kernel-widget";const b="jp-RunningSessions-item-label-kernel-id";async function y(e,t,n){const{commands:i,contextMenu:o,serviceManager:r}=n;const{kernels:a,kernelspecs:l,sessions:p}=r;const{runningChanged:m,RunningKernel:v}=w;const _=new u.Throttler((()=>m.emit(undefined)),100);const b=t.load("jupyterlab");const y=b.__("Shut Down Unused");let C=false;const x=new u.Throttler(k,1e4);a.runningChanged.connect((()=>{void _.invoke();void x.invoke()}));p.runningChanged.connect((()=>void _.invoke()));await Promise.all([a.ready,l.ready,p.ready]);function S(){return Array.from(a.running()).filter((e=>{var t;return((t=e.connections)!==null&&t!==void 0?t:1)<1}))}async function k(){const e=C;C=S().length>0;if(e!==C){i.notifyCommandChanged(j.kernelShutDownUnused)}}i.addCommand(j.kernelShutDownUnused,{label:e=>e.toolbar?"":y,icon:e=>e.toolbar?d.cleaningIcon:undefined,execute:async()=>{const e=S();if(e.length===0){return}const t=await(0,s.showDialog)({title:y,body:g().createElement(g().Fragment,null,b.__("Are you sure you want to shut down the following unused kernels?"),g().createElement("ul",null,e.map((e=>g().createElement("li",{key:e.id},b.__("%1 (%2)",e.name,e.id.slice(0,8))))))),buttons:[s.Dialog.cancelButton(),s.Dialog.warnButton({label:y})]});if(t.button.accept){await Promise.allSettled(e.map((e=>h.KernelAPI.shutdownKernel(e.id))));await Promise.all([a.refreshRunning(),p.refreshRunning()])}},isEnabled:()=>C});e.add({name:b.__("Kernels"),supportsMultipleViews:true,running:e=>{var t;const n=new Map;for(const o of a.running()){const s=(t=n.get(o.name))!==null&&t!==void 0?t:[];n.set(o.name,s);s.push(new v({commands:i,kernel:o,kernels:a,sessions:p,trans:b,mode:e.mode}))}const s=Array.from(n.entries()).map((([e,t])=>{var n;return new w.KernelSpecItem({name:e,kernels:t,spec:(n=l.specs)===null||n===void 0?void 0:n.kernelspecs[e],trans:b})}));return e.mode==="tree"?s:s.map((e=>e.children.map((e=>{var t;return(t=e.children)!==null&&t!==void 0?t:[]})).flat())).flat()},shutdownAll:()=>a.shutdownAll(),refreshRunning:()=>Promise.all([a.refreshRunning(),p.refreshRunning()]),runningChanged:m,shutdownLabel:b.__("Shut Down Kernel"),shutdownAllLabel:b.__("Shut Down All"),shutdownAllConfirmationText:()=>b._n("Are you sure you want to permanently shut down the running kernel?","Are you sure you want to permanently shut down the %1 running kernels?",a.runningCount),toolbarButtons:[new d.CommandToolbarButton({commands:i,id:j.kernelShutDownUnused,caption:y,args:{toolbar:true}})]});const I=e=>e.classList.contains(f);i.addCommand(j.kernelNewConsole,{icon:d.consoleIcon,label:b.__("New Console for Kernel"),execute:e=>{var t;const s=n.contextMenuHitTest(I);const o=(t=e.id)!==null&&t!==void 0?t:s===null||s===void 0?void 0:s.dataset["context"];if(o){return i.execute("console:create",{kernelPreference:{id:o}})}}});i.addCommand(j.kernelNewNotebook,{icon:d.notebookIcon,label:b.__("New Notebook for Kernel"),execute:e=>{var t;const s=n.contextMenuHitTest(I);const o=(t=e.id)!==null&&t!==void 0?t:s===null||s===void 0?void 0:s.dataset["context"];if(o){return i.execute("notebook:create-new",{kernelId:o})}}});i.addCommand(j.kernelOpenSession,{icon:e=>e.type==="console"?d.consoleIcon:e.type==="notebook"?d.notebookIcon:undefined,isEnabled:({path:e,type:t})=>!!t||e!==undefined,label:({name:e,path:t})=>e||c.PathExt.basename(t||b.__("Unknown Session")),execute:({path:e,type:t})=>{if(!t||e===undefined){return}const n=t==="console"?"console:open":"docmanager:open";return i.execute(n,{path:e})}});i.addCommand(j.kernelShutDown,{icon:d.closeIcon,label:b.__("Shut Down Kernel"),execute:e=>{var t;const i=n.contextMenuHitTest(I);const s=(t=e.id)!==null&&t!==void 0?t:i===null||i===void 0?void 0:i.dataset["context"];if(s){return a.shutdown(s)}}});const E=[];o.opened.connect((async()=>{var e,t,i;const s=(t=(e=o.menu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-contextmenu-connected-sessions"})))===null||e===void 0?void 0:e.submenu)!==null&&t!==void 0?t:null;if(!s){return}E.forEach((e=>e.dispose()));E.length=0;s.clearItems();const r=n.contextMenuHitTest(I);const a=r===null||r===void 0?void 0:r.dataset["context"];if(!a){return}const l=j.kernelOpenSession;for(const n of p.running()){if(a===((i=n.kernel)===null||i===void 0?void 0:i.id)){const{name:e,path:t,type:i}=n;E.push(s.addItem({command:l,args:{name:e,path:t,type:i}}))}}}))}var w;(function(e){class t{constructor(e){this._name=e.name;this.className=v;this._kernels=e.kernels;this.spec=e.spec||null;this.trans=e.trans}icon(){const{spec:e}=this;if(!e||!e.resources){return d.jupyterIcon}return e.resources["logo-svg"]||e.resources["logo-64x64"]||e.resources["logo-32x32"]}label(){const{_name:e,spec:t}=this;return(t===null||t===void 0?void 0:t.display_name)||e}get children(){return this._kernels}}e.KernelSpecItem=t;class n{constructor(e){this.className=f;this.commands=e.commands;this.kernel=e.kernel;this.context=this.kernel.id;this.kernels=e.kernels;this.sessions=e.sessions;this.trans=e.trans;this._mode=e.mode}get children(){var e;const t=[];const n=j.kernelOpenSession;const{commands:i}=this;for(const s of this.sessions.running()){if(this.kernel.id===((e=s.kernel)===null||e===void 0?void 0:e.id)){const{name:e,path:o,type:r}=s;t.push({className:_,context:this.kernel.id,open:()=>void i.execute(n,{name:e,path:o,type:r}),icon:()=>r==="console"?d.consoleIcon:r==="notebook"?d.notebookIcon:d.jupyterIcon,label:()=>{if(this._mode==="tree"){return e}const t=this.kernel.id.split("-")[0];return g().createElement(g().Fragment,null,e," ",g().createElement("span",{className:b},"(",t,")"))},labelTitle:()=>o,name:()=>e})}}return t}shutdown(){return this.kernels.shutdown(this.kernel.id)}icon(){return d.kernelIcon}label(){const{kernel:e}=this;const t=e.id.split("-")[0];return g().createElement(g().Fragment,null,this._summary," ",g().createElement("span",{className:b},"(",t,")"))}labelTitle(){var e;const{trans:t}=this;const{id:n}=this.kernel;const i=[`${this._summary}: ${n}`];for(const s of this.sessions.running()){if(this.kernel.id===((e=s.kernel)===null||e===void 0?void 0:e.id)){const{path:e,type:n}=s;i.push(t.__(`%1\nPath: %2`,n,e))}}return i.join("\n\n")}get _summary(){const e=this.children;if(e.length===0){return this.trans.__("No sessions connected")}else if(e.length==1){return e[0].name()}else{return this.trans.__("%1 and %2 more",e[0].name(),e.length-1)}}}e.RunningKernel=n;e.runningChanged=new p.Signal({})})(w||(w={}));var C=n(44185);class x{constructor(e){this._tabsChanged=new p.Signal(this);this._widgets=[];this._labShell=e;this._labShell.layoutModified.connect(this._emitTabsChanged,this)}get tabsChanged(){return this._tabsChanged}addWidget(e){e.title.changed.connect(this._emitTabsChanged,this);this._widgets.push(e)}_emitTabsChanged(){this._widgets.forEach((e=>{e.title.changed.disconnect(this._emitTabsChanged,this)}));this._widgets=[];this._tabsChanged.emit(void 0)}}function S(e,t,n){const i=new x(n);const s=t.load("jupyterlab");e.add({name:s.__("Open Tabs"),supportsMultipleViews:false,running:()=>Array.from(n.widgets("main")).map((e=>{i.addWidget(e);return new o(e)})),shutdownAll:()=>{const e=Array.from(n.widgets("main"));for(const t of e){t.close()}},refreshRunning:()=>void 0,runningChanged:i.tabsChanged,shutdownLabel:s.__("Close"),shutdownAllLabel:s.__("Close All"),shutdownAllConfirmationText:s.__("Are you sure you want to close all open tabs?")});class o{constructor(e){this._widget=e}open(){n.activateById(this._widget.id)}shutdown(){this._widget.close()}icon(){const e=this._widget.title.icon;return e instanceof d.LabIcon?e:d.fileIcon}label(){return this._widget.title.label}labelTitle(){let e;if(this._widget instanceof C.DocumentWidget){e=this._widget.context.path}else{e=this._widget.title.label}return e}}}function k(e,t,n,i,s){const o=s.load("jupyterlab");e.add({name:o.__("Recently Closed"),supportsMultipleViews:false,running:()=>t.recentlyClosed.map((e=>new r(e))),shutdownAll:()=>{for(const e of t.recentlyClosed){t.removeRecent(e,"closed")}},refreshRunning:()=>void 0,runningChanged:t.changed,shutdownLabel:o.__("Forget"),shutdownAllLabel:o.__("Forget All"),shutdownAllConfirmationText:o.__("Are you sure you want to clear recently closed tabs?")});class r{constructor(e){this._recent=e}async open(){const e=this._recent;const i=await t.validate(e);if(!i){return}await n.execute("docmanager:open",{path:e.path,factory:e.factory});t.removeRecent(e,"closed")}shutdown(){t.removeRecent(this._recent,"closed")}icon(){if(!this._recent.factory){return d.fileIcon}const e=i.getFileTypesForPath(this._recent.path);for(const n of e){const e=n.icon;if(e instanceof d.LabIcon){return e}}const t=i.getWidgetFactory(this._recent.factory);if(t){for(const e of t.fileTypes){const t=i.getFileType(e);const n=t===null||t===void 0?void 0:t.icon;if(n instanceof d.LabIcon){return n}}}return d.fileIcon}label(){return c.PathExt.basename(this._recent.path)}labelTitle(){return this._recent.path}}}var j;(function(e){e.kernelNewConsole="running:kernel-new-console";e.kernelNewNotebook="running:kernel-new-notebook";e.kernelOpenSession="running:kernel-open-session";e.kernelShutDown="running:kernel-shut-down";e.kernelShutDownUnused="running:kernel-shut-down-unused";e.showPanel="running:show-panel";e.showModal="running:show-modal"})(j||(j={}));const I={id:"@jupyterlab/running-extension:plugin",description:"Provides the running session managers.",provides:o.IRunningSessionManagers,requires:[l.ITranslator],optional:[i.ILabShell],autoStart:true,activate:(e,t,n)=>{const i=new o.RunningSessionManagers;if(n){S(i,t,n)}void y(i,t,e);return i}};const E={id:"@jupyterlab/running-extension:sidebar",description:"Provides the running session sidebar.",provides:o.IRunningSessionSidebar,requires:[o.IRunningSessionManagers,l.ITranslator],optional:[i.ILayoutRestorer,a.IStateDB],autoStart:true,activate:(e,t,n,i,s)=>{const r=n.load("jupyterlab");const a=new o.RunningSessions(t,n,s);a.id="jp-running-sessions";a.title.caption=r.__("Running Terminals and Kernels");a.title.icon=d.runningIcon;a.node.setAttribute("role","region");a.node.setAttribute("aria-label",r.__("Running Sessions section"));if(i){i.add(a,"running-sessions")}e.shell.add(a,"left",{rank:200,type:"Sessions and Tabs"});e.commands.addCommand(j.showPanel,{label:r.__("Sessions and Tabs"),execute:()=>{e.shell.activateById(a.id)}});return a}};const T={id:"@jupyterlab/running-extension:recently-closed",description:"Adds recently closed documents list.",requires:[o.IRunningSessionManagers,r.IRecentsManager,l.ITranslator],autoStart:true,activate:(e,t,n,i)=>{k(t,n,e.commands,e.docRegistry,i)}};const M={id:"@jupyterlab/running-extension:search-tabs",description:"Adds a widget to search open and closed tabs.",requires:[o.IRunningSessionManagers,l.ITranslator],optional:[s.ICommandPalette,o.IRunningSessionSidebar],autoStart:true,activate:(e,t,n,i,r)=>{const a=n.load("jupyterlab");e.commands.addCommand(j.showModal,{execute:()=>{const e=new o.SearchableSessions(t,n);const i=new s.Dialog({title:a.__("Tabs and Running Sessions"),body:e,buttons:[s.Dialog.okButton({})],hasClose:true});i.addClass("jp-SearchableSessions-modal");return i.launch()},label:a.__("Search Tabs and Running Sessions")});if(i){i.addItem({command:j.showModal,category:a.__("Running")})}if(r){const t=new d.CommandToolbarButton({commands:e.commands,id:j.showModal,icon:d.launcherIcon,label:""});r.toolbar.addItem("open-as-modal",t)}}};const D=[I,E,T,M]},54289:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(79010);var a=n(3579);var l=n(41603);var d=n(94780)},19503:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IRunningSessionManagers:()=>O,IRunningSessionSidebar:()=>B,RunningSessionManagers:()=>F,RunningSessions:()=>q,SearchableSessions:()=>J,SearchableSessionsList:()=>G});var i=n(54158);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(61927);var l=n.n(a);var d=n(66127);var c=n.n(d);var h=n(5592);var u=n.n(h);var p=n(90044);var m=n.n(p);var g=n(76326);var f=n.n(g);var v=n(2336);var _=n.n(v);var b=n(1143);var y=n.n(b);var w=n(44914);var C=n.n(w);const x="jp-RunningSessions";const S="jp-SearchableSessions";const k="jp-RunningSessions-section";const j="jp-RunningSessions-sectionContainer";const I="jp-RunningSessions-item";const E="jp-RunningSessions-itemLabel";const T="jp-RunningSessions-itemDetail";const M="jp-RunningSessions-itemShutdown";const D="jp-RunningSessions-shutdownAll";const A="jp-RunningSessions-icon";const P="jp-mod-running-list-view";const L="jp-RunningSessions-viewButton";const R="jp-RunningSessions-collapseButton";const N="jp-running-sessions";const O=new h.Token("@jupyterlab/running:IRunningSessionManagers","A service to add running session managers.");const B=new h.Token("@jupyterlab/running:IRunningSessionsSidebar","A token allowing to modify the running sessions sidebar.");class F{constructor(){this._added=new v.Signal(this);this._managers=[]}get added(){return this._added}add(e){this._managers.push(e);this._added.emit(e);return new p.DisposableDelegate((()=>{const t=this._managers.indexOf(e);if(t>-1){this._managers.splice(t,1)}}))}items(){return this._managers}}function z(e){var t,n;const{runningItem:s}=e;const[o,r]=C().useState(false);const l=(0,w.useRef)(false);const c=[I];const h=(t=s.detail)===null||t===void 0?void 0:t.call(s);const u=s.icon();const p=s.labelTitle?s.labelTitle():"";const m=e.translator||a.nullTranslator;const g=m.load("jupyterlab");const f=e.shutdownItemIcon||d.closeIcon;const v=(n=typeof e.shutdownLabel==="function"?e.shutdownLabel(s):e.shutdownLabel)!==null&&n!==void 0?n:g.__("Shut Down");const _=(0,w.useCallback)((e=>{var t;l.current=true;e.preventDefault();(t=s.shutdown)===null||t===void 0?void 0:t.call(s)}),[s,l]);const b=s.children;const y=!!(b===null||b===void 0?void 0:b.length);const x=(0,w.useCallback)((e=>{if(l.current){return}const t=(0,d.getTreeItemElement)(e.target);if(e.currentTarget!==t){return}if(y){r(!o)}}),[y,o,l]);e.collapseToggled.connect(((e,t)=>r(t)));if(s.className){c.push(s.className)}return C().createElement(C().Fragment,null,C().createElement(i.TreeItem,{className:`${c.join(" ")} jp-TreeItem nested`,onClick:x,"data-context":s.context||"",expanded:!o},u?typeof u==="string"?C().createElement("img",{src:u,className:A,slot:"start"}):C().createElement(u.react,{slot:"start",tag:"span",className:A}):undefined,C().createElement("span",{className:E,title:p,onClick:s.open&&(()=>s.open())},s.label()),h&&C().createElement("span",{className:T},h),s.shutdown&&C().createElement(i.Button,{appearance:"stealth",className:M,onClick:_,title:v,slot:"end"},C().createElement(f.react,{tag:null})),b&&C().createElement(H,{runningItems:b,shutdownItemIcon:f,translator:m,collapseToggled:e.collapseToggled})))}function H(e){const t=e.filter;const n=t?e.runningItems.map((e=>({item:e,score:t(e)}))).filter((({score:e})=>e!==null)).sort(((e,t)=>e.score.score-t.score.score)).map((({item:e})=>e)):e.runningItems;return C().createElement(C().Fragment,null,n.map(((t,n)=>C().createElement(z,{child:e.child,key:n,runningItem:t,shutdownLabel:e.shutdownLabel,shutdownItemIcon:e.shutdownItemIcon,translator:e.translator,collapseToggled:e.collapseToggled}))))}class W extends d.ReactWidget{constructor(e){super();this._filterFn=e=>({score:0});this._filterChanged=new v.Signal(this);this.filter=this.filter.bind(this);this._updateFilter=this._updateFilter.bind(this);this._trans=e.load("jupyterlab");this.addClass("jp-SearchableSessions-filter")}get filterChanged(){return this._filterChanged}render(){return C().createElement(d.FilterBox,{placeholder:this._trans.__("Search"),updateFilter:this._updateFilter,useFuzzyFilter:false,caseSensitive:false})}filter(e){var t;const n=[this._getTextContent(e.label())];for(const i of(t=e.children)!==null&&t!==void 0?t:[]){n.push(this._getTextContent(i.label()))}return this._filterFn(n.join(" "))}_getTextContent(e){if(typeof e==="string"){return e}if(typeof e==="number"){return""+e}if(typeof e==="boolean"){return""+e}if(Array.isArray(e)){return e.map((e=>this._getTextContent(e))).join(" ")}if(e&&(0,w.isValidElement)(e)){return e.props.children.map((e=>this._getTextContent(e))).join(" ")}return""}_updateFilter(e){this._filterFn=e;this._filterChanged.emit()}}class V extends d.ReactWidget{constructor(e){super();this._options=e;this._update=new v.Signal(this);e.manager.runningChanged.connect(this._emitUpdate,this);if(e.filterProvider){e.filterProvider.filterChanged.connect(this._emitUpdate,this)}}get mode(){return this._mode}set mode(e){if(this._mode!==e){this._mode=e;this._update.emit()}}dispose(){v.Signal.clearData(this);super.dispose()}onBeforeShow(e){super.onBeforeShow(e);this._update.emit()}render(){const e=this._options;let t=true;return C().createElement(d.UseSignal,{signal:this._update},(()=>{var n;if(t){t=false}else{e.runningItems=e.manager.running({mode:this.mode})}const s=["jp-TreeView"];if(this.mode==="list"){s.push("jp-mod-flat")}return C().createElement("div",{className:j},C().createElement(i.TreeView,{className:s.join(" ")},C().createElement(H,{runningItems:e.runningItems,shutdownLabel:e.manager.shutdownLabel,shutdownItemIcon:e.manager.shutdownItemIcon,filter:(n=e.filterProvider)===null||n===void 0?void 0:n.filter,translator:e.translator,collapseToggled:e.collapseToggled})))}))}_emitUpdate(){if(!this.isVisible){return}this._update.emit()}}class U extends d.PanelWithToolbar{constructor(e){var t;super();this._buttons=null;this._listView=false;this._collapseToggled=new v.Signal(this);this._viewChanged=new v.Signal(this);this._listView=((t=e.viewMode)!==null&&t!==void 0?t:"tree")==="list";this._manager=e.manager;this._filterProvider=e.filterProvider;const n=e.translator||a.nullTranslator;this._trans=n.load("jupyterlab");this.addClass(k);this.title.label=e.manager.name;this._manager.runningChanged.connect(this._onListChanged,this);if(e.filterProvider){e.filterProvider.filterChanged.connect(this._onListChanged,this)}this._updateEmptyClass();const i=e.manager.running({mode:e.manager.supportsMultipleViews&&!this._listView?"tree":"list"});if(e.showToolbar!==false){this._initializeToolbar(i)}this._listWidget=new V({runningItems:i,collapseToggled:this._collapseToggled,...e});this._listWidget.mode=e.manager.supportsMultipleViews&&!this._listView?"tree":"list";this.addWidget(this._listWidget)}toggleListView(e){const t=typeof e!=="undefined"?e:!this._listView;this._listView=t;if(this._buttons){const e=this._buttons["switch-view"];e.pressed=t}this._collapseToggled.emit(false);if(this._manager.supportsMultipleViews===undefined){this.toggleClass(P,t)}this._updateButtons();this._listWidget.mode=this._manager.supportsMultipleViews&&!this._listView?"tree":"list";this._viewChanged.emit({mode:t?"list":"tree"})}dispose(){if(this.isDisposed){return}v.Signal.clearData(this);super.dispose()}get _shutdownAllLabel(){return this._manager.shutdownAllLabel||this._trans.__("Shut Down All")}_initializeToolbar(e){const t=e.length>0;const n=this._shutdownAllLabel;const i=`${n}?`;const s=()=>{var e;const t=(e=typeof this._manager.shutdownAllConfirmationText==="function"?this._manager.shutdownAllConfirmationText():this._manager.shutdownAllConfirmationText)!==null&&e!==void 0?e:`${n} ${this._manager.name}`;void(0,o.showDialog)({title:i,body:t,buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:n})]}).then((e=>{if(e.button.accept){this._manager.shutdownAll()}}))};const r=new d.ToolbarButton({label:n,className:`${D}${!t?" jp-mod-disabled":""}`,enabled:t,onClick:s.bind(this)});const a=new d.ToolbarButton({className:L,enabled:t,icon:d.tableRowsIcon,pressedIcon:d.treeViewIcon,onClick:()=>this.toggleListView(),tooltip:this._trans.__("Switch to List View"),pressedTooltip:this._trans.__("Switch to Tree View")});const l=new d.ToolbarButton({className:R,enabled:t,icon:d.collapseAllIcon,pressedIcon:d.expandAllIcon,onClick:()=>{const e=!l.pressed;this._collapseToggled.emit(e);l.pressed=e},tooltip:this._trans.__("Collapse All"),pressedTooltip:this._trans.__("Expand All")});this._buttons={"switch-view":a,"collapse-expand":l,"shutdown-all":r};this._updateButtons();this._manager.runningChanged.connect(this._updateButtons,this);if(this._manager.toolbarButtons){this._manager.toolbarButtons.forEach((e=>this.toolbar.addItem(e instanceof d.CommandToolbarButton?e.commandId:e.id,e)))}for(const o of["collapse-expand","switch-view","shutdown-all"]){this.toolbar.addItem(o,this._buttons[o])}this.toolbar.addClass("jp-RunningSessions-toolbar");this._toolbar.node.setAttribute("aria-label",this._trans.__("%1 toolbar",this.title.label))}_onListChanged(){this._updateButtons();this._updateEmptyClass()}_updateEmptyClass(){if(this._filterProvider){const e=this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"}).filter(this._filterProvider.filter);const t=e.length===0;if(t){this.node.classList.toggle("jp-mod-empty",true)}else{this.node.classList.toggle("jp-mod-empty",false)}}}get viewChanged(){return this._viewChanged}_updateButtons(){if(!this._buttons){return}let e=this._manager.running({mode:this._manager.supportsMultipleViews&&!this._listView?"tree":"list"});const t=e.length>0;const n=this._manager.supportsMultipleViews===undefined?e.filter((e=>e.children)).length!==0:this._manager.supportsMultipleViews;const i=n&&!this._buttons["switch-view"].pressed;this._buttons["switch-view"].node.style.display=n?"flex":"none";this._buttons["collapse-expand"].node.style.display=i?"flex":"none";this._buttons["collapse-expand"].enabled=t;this._buttons["switch-view"].enabled=t;this._buttons["shutdown-all"].enabled=t}}class q extends d.SidePanel{constructor(e,t,n){super();this.managers=e;this._stateDB=n!==null&&n!==void 0?n:null;this.translator=t!==null&&t!==void 0?t:a.nullTranslator;const i=this.translator.load("jupyterlab");this.addClass(x);this.toolbar.addItem("refresh",new d.ToolbarButton({tooltip:i.__("Refresh List"),icon:d.refreshIcon,onClick:()=>e.items().forEach((e=>e.refreshRunning()))}));e.items().forEach((t=>this.addSection(e,t)));e.added.connect(this.addSection,this)}dispose(){if(this.isDisposed){return}this.managers.added.disconnect(this.addSection,this);super.dispose()}async addSection(e,t){const n=new U({manager:t,translator:this.translator});this.addWidget(n);const i=await this._getState();const s=i.listViewSections;const o=t.name;if(s&&s.includes(o)){n.toggleListView(true)}n.viewChanged.connect((async(e,t)=>{await this._updateState(o,t.mode)}))}async _updateState(e,t){var n;const i=await this._getState();let s=(n=i.listViewSections)!==null&&n!==void 0?n:[];if(t==="list"&&!s.includes(e)){s.push(e)}else{s=s.filter((t=>t!==e))}const o={listViewSections:s};if(this._stateDB){await this._stateDB.save(N,o)}}async _getState(){var e;if(!this._stateDB){return{}}return(e=await this._stateDB.fetch(N))!==null&&e!==void 0?e:{}}}class $ extends U{constructor(e){super(e);const t=document.createElement("h3");t.className="jp-SearchableSessions-title";const n=t.appendChild(document.createElement("span"));n.className="jp-SearchableSessions-titleLabel";n.textContent=this.title.label;this.node.insertAdjacentElement("afterbegin",t)}}class K extends b.Widget{constructor(e){super();const t=e.load("jupyterlab");this.addClass("jp-SearchableSessions-emptyIndicator");this.node.textContent=t.__("No matches")}}class J extends b.Panel{constructor(e,t){super();this._activeIndex=0;this._translator=t!==null&&t!==void 0?t:a.nullTranslator;this.addClass(x);this.addClass(S);this._filterWidget=new W(this._translator);this.addWidget(this._filterWidget);this._list=new G(e,this._filterWidget,t);this.addWidget(this._list);this._filterWidget.filterChanged.connect((()=>{this._activeIndex=0;this._updateActive(0)}),this)}dispose(){if(this.isDisposed){return}v.Signal.clearData(this);super.dispose()}getValue(){const e=[...this.node.querySelectorAll("."+E)];const t=Math.min(Math.max(this._activeIndex,0),e.length-1);e[t].click()}handleEvent(e){switch(e.type){case"keydown":this._evtKeydown(e);break}}onAfterAttach(e){this._forceFocusInput();this.node.addEventListener("keydown",this);setTimeout((()=>{this._updateActive(0)}),0)}onAfterDetach(e){this.node.removeEventListener("keydown",this)}_forceFocusInput(){var e;(e=this._filterWidget.renderPromise)===null||e===void 0?void 0:e.then((()=>{var e;const t=this._filterWidget.node.querySelector("jp-search");const n=(e=t===null||t===void 0?void 0:t.shadowRoot)===null||e===void 0?void 0:e.querySelector("input");if(!n){console.warn("Input element not found, cannot focus");return}n.focus()})).catch(console.warn)}_evtKeydown(e){if(e.key==="ArrowDown"||e.key==="ArrowUp"){const t=e.key==="ArrowDown"?+1:-1;const n=this._updateActive(t);if(n){e.preventDefault()}}}_updateActive(e){const t=[...this.node.querySelectorAll("."+I)].filter((e=>e.checkVisibility()));if(!t.length){return false}for(const s of t){if(s.classList.contains("jp-mod-active")){s.classList.toggle("jp-mod-active",false)}}const n=this._activeIndex;let i=null;if(n===-1){i=e===+1?0:t.length-1}else{i=Math.min(Math.max(n+e,0),t.length-1)}if(i!==null){t[i].classList.add("jp-mod-active");g.ElementExt.scrollIntoViewIfNeeded(this._list.node,t[i]);this._activeIndex=i;return true}return false}}class G extends b.Panel{constructor(e,t,n){super();this._managers=e;this._translator=n!==null&&n!==void 0?n:a.nullTranslator;this._filterWidget=t;this.addClass("jp-SearchableSessions-list");this._emptyIndicator=new K(this._translator);this.addWidget(this._emptyIndicator);e.items().forEach((t=>this.addSection(e,t)));e.added.connect(this.addSection,this)}dispose(){if(this.isDisposed){return}this._managers.added.disconnect(this.addSection,this);super.dispose()}addSection(e,t){const n=new $({manager:t,translator:this._translator,showToolbar:false,filterProvider:this._filterWidget,viewMode:"list"});n.toggleListView(true);this.addWidget(n);this.addWidget(this._emptyIndicator)}}},94780:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(18799);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},28560:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>y});var i=n(77256);var s=n.n(i);const o={id:"@jupyterlab/services-extension:config-section-manager",autoStart:true,provides:i.IConfigSectionManager,optional:[i.IServerSettings],description:"Provides the config section manager.",activate:(e,t)=>{const n=new i.ConfigSectionManager({serverSettings:t});i.ConfigSection._setConfigSectionManager(n);return n}};const r={id:"@jupyterlab/services-extension:connection-status",autoStart:true,provides:i.IConnectionStatus,description:"Provides the default connection status.",activate:()=>new i.ConnectionStatus};const a={id:"@jupyterlab/services-extension:contents-manager",description:"The default contents manager plugin.",autoStart:true,provides:i.IContentsManager,requires:[i.IDefaultDrive,i.IServerSettings],activate:(e,t,n)=>new i.ContentsManager({defaultDrive:t,serverSettings:n})};const l={id:"@jupyterlab/services-extension:default-drive",description:"The default drive for the contents manager.",autoStart:true,provides:i.IDefaultDrive,optional:[i.IServerSettings],activate:(e,t)=>new i.Drive({serverSettings:t!==null&&t!==void 0?t:undefined})};const d={id:"@jupyterlab/services-extension:event-manager",description:"The event manager plugin.",autoStart:true,provides:i.IEventManager,optional:[i.IServerSettings,i.IConnectionStatus],activate:(e,t,n)=>new i.EventManager({serverSettings:t,standby:()=>!(n===null||n===void 0?void 0:n.isConnected)||"when-hidden"})};const c={id:"@jupyterlab/services-extension:kernel-manager",description:"The kernel manager plugin.",autoStart:true,provides:i.IKernelManager,optional:[i.IServerSettings,i.IConnectionStatus],activate:(e,t,n)=>new i.KernelManager({serverSettings:t,standby:()=>!(n===null||n===void 0?void 0:n.isConnected)||"when-hidden"})};const h={id:"@jupyterlab/services-extension:kernel-spec-manager",description:"The kernel spec manager plugin.",autoStart:true,provides:i.IKernelSpecManager,optional:[i.IServerSettings,i.IConnectionStatus],activate:(e,t,n)=>new i.KernelSpecManager({serverSettings:t,standby:()=>!(n===null||n===void 0?void 0:n.isConnected)||"when-hidden"})};const u={id:"@jupyterlab/services-extension:nbconvert-manager",description:"The nbconvert manager plugin.",autoStart:true,provides:i.INbConvertManager,optional:[i.IServerSettings],activate:(e,t)=>new i.NbConvertManager({serverSettings:t})};const p={id:"@jupyterlab/services-extension:session-manager",description:"The session manager plugin.",autoStart:true,provides:i.ISessionManager,requires:[i.IKernelManager],optional:[i.IServerSettings,i.IConnectionStatus],activate:(e,t,n,s)=>new i.SessionManager({kernelManager:t,serverSettings:n,standby:()=>!(s===null||s===void 0?void 0:s.isConnected)||"when-hidden"})};const m={id:"@jupyterlab/services-extension:setting-manager",description:"The setting manager plugin.",autoStart:true,provides:i.ISettingManager,optional:[i.IServerSettings],activate:(e,t)=>new i.SettingManager({serverSettings:t})};const g={id:"@jupyterlab/services-extension:terminal-manager",description:"The terminal manager plugin.",autoStart:true,provides:i.ITerminalManager,optional:[i.IServerSettings,i.IConnectionStatus],activate:(e,t,n)=>new i.TerminalManager({serverSettings:t,standby:()=>!(n===null||n===void 0?void 0:n.isConnected)||"when-hidden"})};const f={id:"@jupyterlab/services-extension:user-manager",description:"The user manager plugin.",autoStart:true,provides:i.IUserManager,optional:[i.IServerSettings,i.IConnectionStatus],activate:(e,t,n)=>new i.UserManager({serverSettings:t,standby:()=>!(n===null||n===void 0?void 0:n.isConnected)||"when-hidden"})};const v={id:"@jupyterlab/services-extension:workspace-manager",description:"The workspace manager plugin.",autoStart:true,provides:i.IWorkspaceManager,optional:[i.IServerSettings],activate:(e,t)=>new i.WorkspaceManager({serverSettings:t})};const _={id:"@jupyterlab/services-extension:server-settings",description:"The default server settings plugin.",autoStart:true,provides:i.IServerSettings,activate:e=>i.ServerConnection.makeSettings()};const b={id:"@jupyterlab/services-extension:service-manager",description:"The default service manager plugin.",autoStart:true,provides:i.IServiceManager,optional:[i.IConnectionStatus,i.IContentsManager,i.IDefaultDrive,i.IServerSettings,i.IEventManager,i.IKernelManager,i.IKernelSpecManager,i.INbConvertManager,i.ISessionManager,i.ISettingManager,i.ITerminalManager,i.IUserManager,i.IWorkspaceManager],activate:(e,t,n,s,o,r,a,l,d,c,h,u,p,m)=>new i.ServiceManager({standby:()=>!(t===null||t===void 0?void 0:t.isConnected)||"when-hidden",contents:n,defaultDrive:s,serverSettings:o,events:r,kernels:a,kernelspecs:l,nbconvert:d,sessions:c,settings:h,terminals:u,user:p,workspaces:m})};const y=[o,r,a,l,d,c,h,u,p,m,_,b,g,f,v]},5412:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BaseManager=void 0;const i=n(2336);const s=n(1089);class o{constructor(e){var t;this._isDisposed=false;this._disposed=new i.Signal(this);this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:s.ServerConnection.makeSettings()}get disposed(){return this._disposed}get isDisposed(){return this._isDisposed}get isActive(){return true}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._disposed.emit(undefined);i.Signal.clearData(this)}}t.BaseManager=o},44816:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.BuildManager=void 0;const i=n(37737);const s=n(1089);const o="api/build";class r{constructor(e={}){var t;this._url="";this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:s.ServerConnection.makeSettings();const{baseUrl:n,appUrl:r}=this.serverSettings;this._url=i.URLExt.join(n,r,o)}get isAvailable(){return i.PageConfig.getOption("buildAvailable").toLowerCase()==="true"}get shouldCheck(){return i.PageConfig.getOption("buildCheck").toLowerCase()==="true"}getStatus(){const{_url:e,serverSettings:t}=this;const n=s.ServerConnection.makeRequest(e,{},t);return n.then((e=>{if(e.status!==200){throw new s.ServerConnection.ResponseError(e)}return e.json()})).then((e=>{if(typeof e.status!=="string"){throw new Error("Invalid data")}if(typeof e.message!=="string"){throw new Error("Invalid data")}return e}))}build(){const{_url:e,serverSettings:t}=this;const n={method:"POST"};const i=s.ServerConnection.makeRequest(e,n,t);return i.then((e=>{if(e.status===400){throw new s.ServerConnection.ResponseError(e,"Build aborted")}if(e.status!==200){const t=`Build failed with ${e.status}.\n\n If you are experiencing the build failure after installing an extension (or trying to include previously installed extension after updating JupyterLab) please check the extension repository for new installation instructions as many extensions migrated to the prebuilt extensions system which no longer requires rebuilding JupyterLab (but uses a different installation procedure, typically involving a package manager such as 'pip' or 'conda').\n\n If you specifically intended to install a source extension, please run 'jupyter lab build' on the server for full output.`;throw new s.ServerConnection.ResponseError(e,t)}}))}cancel(){const{_url:e,serverSettings:t}=this;const n={method:"DELETE"};const i=s.ServerConnection.makeRequest(e,n,t);return i.then((e=>{if(e.status!==204){throw new s.ServerConnection.ResponseError(e)}}))}}t.BuildManager=r},39851:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ConfigWithDefaults=t.ConfigSection=t.ConfigSectionManager=void 0;const i=n(37737);const s=n(50608);const o="api/config";class r{constructor(e){var t;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:s.ServerConnection.makeSettings()}async create(e){const t=new l({...e,serverSettings:this.serverSettings});await t.load();return t}}t.ConfigSectionManager=r;var a;(function(e){async function t(e){if(!n){const t=new l(e);await t.load();return t}const t=await n.create(e);return t}e.create=t;let n;function i(e){if(n){throw new Error("ConfigSectionManager already set. If you would like to create a config section, use the `IConfigSectionManager` token in a plugin.")}n=e}e._setConfigSectionManager=i})(a||(t.ConfigSection=a={}));class l{constructor(e){var t;this._url="unknown";const n=this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:s.ServerConnection.makeSettings();this._url=i.URLExt.join(n.baseUrl,o,encodeURIComponent(e.name))}get data(){return this._data}async load(){const e=await s.ServerConnection.makeRequest(this._url,{},this.serverSettings);if(e.status!==200){const t=await s.ServerConnection.ResponseError.create(e);throw t}this._data=await e.json()}async update(e){this._data={...this._data,...e};const t={method:"PATCH",body:JSON.stringify(e)};const n=await s.ServerConnection.makeRequest(this._url,t,this.serverSettings);if(n.status!==200){const e=await s.ServerConnection.ResponseError.create(n);throw e}this._data=await n.json();return this._data}}class d{constructor(e){var t,n;this._className="";this._section=e.section;this._defaults=(t=e.defaults)!==null&&t!==void 0?t:{};this._className=(n=e.className)!==null&&n!==void 0?n:""}get(e){const t=this._classData();return e in t?t[e]:this._defaults[e]}set(e,t){const n={};n[e]=t;if(this._className){const e={};e[this._className]=n;return this._section.update(e)}else{return this._section.update(n)}}_classData(){const e=this._section.data;if(this._className&&this._className in e){return e[this._className]}return e}}t.ConfigWithDefaults=d},39923:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ConnectionStatus=void 0;class n{constructor(){this.isConnected=true}}t.ConnectionStatus=n},97375:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.RestContentProvider=t.Drive=t.ContentsManager=t.Contents=void 0;const r=n(37737);const a=n(90044);const l=n(2336);const d=n(50608);const c=o(n(77821));const h="api/contents";const u="files";var p;(function(e){function t(e){c.validateContentsModel(e)}e.validateContentsModel=t;function n(e){c.validateCheckpointModel(e)}e.validateCheckpointModel=n})(p||(t.Contents=p={}));class m{constructor(e={}){var t,n;this._isDisposed=false;this._additionalDrives=new Map;this._fileChanged=new l.Signal(this);const i=this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:d.ServerConnection.makeSettings();this._defaultDrive=(n=e.defaultDrive)!==null&&n!==void 0?n:new g({serverSettings:i});this._defaultDrive.fileChanged.connect(this._onFileChanged,this)}get defaultDrive(){return this._defaultDrive}get fileChanged(){return this._fileChanged}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;l.Signal.clearData(this)}addDrive(e){this._additionalDrives.set(e.name,e);e.fileChanged.connect(this._onFileChanged,this)}getSharedModelFactory(e,t){var n,i;const[s]=this._driveForPath(e);const o=(n=s.contentProviderRegistry)===null||n===void 0?void 0:n.getProvider(t===null||t===void 0?void 0:t.contentProviderId);if(o===null||o===void 0?void 0:o.sharedModelFactory){return o.sharedModelFactory}return(i=s.sharedModelFactory)!==null&&i!==void 0?i:null}localPath(e){const t=e.split("/");const n=t[0].split(":");if(n.length===1||!this._additionalDrives.has(n[0])){return r.PathExt.removeSlash(e)}return r.PathExt.join(n.slice(1).join(":"),...t.slice(1))}normalize(e){const t=e.split(":");if(t.length===1){return r.PathExt.normalize(e)}return`${t[0]}:${r.PathExt.normalize(t.slice(1).join(":"))}`}resolvePath(e,t){const n=this.driveName(e);const i=this.localPath(e);const s=r.PathExt.resolve("/",i,t);return n?`${n}:${s}`:s}driveName(e){const t=e.split("/");const n=t[0].split(":");if(n.length===1){return""}if(this._additionalDrives.has(n[0])){return n[0]}return""}get(e,t){const[n,i]=this._driveForPath(e);return n.get(i,t).then((e=>{const t=[];if(e.type==="directory"&&e.content){for(const i of e.content){t.push({...i,path:this._toGlobalPath(n,i.path)})}return{...e,path:this._toGlobalPath(n,i),content:t,serverPath:e.path}}else{return{...e,path:this._toGlobalPath(n,i),serverPath:e.path}}}))}getDownloadUrl(e){const[t,n]=this._driveForPath(e);return t.getDownloadUrl(n)}newUntitled(e={}){if(e.path){const t=this.normalize(e.path);const[n,i]=this._driveForPath(t);return n.newUntitled({...e,path:i}).then((e=>({...e,path:r.PathExt.join(t,e.name),serverPath:e.path})))}else{return this._defaultDrive.newUntitled(e)}}delete(e){const[t,n]=this._driveForPath(e);return t.delete(n)}rename(e,t){const[n,i]=this._driveForPath(e);const[s,o]=this._driveForPath(t);if(n!==s){throw Error("ContentsManager: renaming files must occur within a Drive")}return n.rename(i,o).then((e=>({...e,path:this._toGlobalPath(n,o),serverPath:e.path})))}save(e,t={}){const n=this.normalize(e);const[i,s]=this._driveForPath(e);return i.save(s,{...t,path:s}).then((e=>({...e,path:n,serverPath:e.path})))}copy(e,t){const[n,i]=this._driveForPath(e);const[s,o]=this._driveForPath(t);if(n===s){return n.copy(i,o).then((e=>({...e,path:this._toGlobalPath(n,e.path),serverPath:e.path})))}else{throw Error("Copying files between drives is not currently implemented")}}createCheckpoint(e){const[t,n]=this._driveForPath(e);return t.createCheckpoint(n)}listCheckpoints(e){const[t,n]=this._driveForPath(e);return t.listCheckpoints(n)}restoreCheckpoint(e,t){const[n,i]=this._driveForPath(e);return n.restoreCheckpoint(i,t)}deleteCheckpoint(e,t){const[n,i]=this._driveForPath(e);return n.deleteCheckpoint(i,t)}_toGlobalPath(e,t){if(e===this._defaultDrive){return r.PathExt.removeSlash(t)}else{return`${e.name}:${r.PathExt.removeSlash(t)}`}}_driveForPath(e){const t=this.driveName(e);const n=this.localPath(e);if(t){return[this._additionalDrives.get(t),n]}else{return[this._defaultDrive,n]}}_onFileChanged(e,t){var n,i;if(e===this._defaultDrive){this._fileChanged.emit(t)}else{let s=null;let o=null;if((n=t.newValue)===null||n===void 0?void 0:n.path){s={...t.newValue,path:this._toGlobalPath(e,t.newValue.path)}}if((i=t.oldValue)===null||i===void 0?void 0:i.path){o={...t.oldValue,path:this._toGlobalPath(e,t.oldValue.path)}}this._fileChanged.emit({type:t.type,newValue:s,oldValue:o})}}}t.ContentsManager=m;class g{constructor(e={}){var t,n,i;this._isDisposed=false;this._fileChanged=new l.Signal(this);this.name=(t=e.name)!==null&&t!==void 0?t:"Default";this._apiEndpoint=(n=e.apiEndpoint)!==null&&n!==void 0?n:h;this.serverSettings=(i=e.serverSettings)!==null&&i!==void 0?i:d.ServerConnection.makeSettings();const s=new _({apiEndpoint:this._apiEndpoint,serverSettings:this.serverSettings});this.contentProviderRegistry=new v({defaultProvider:s});this.contentProviderRegistry.fileChanged.connect(((e,t)=>{this._fileChanged.emit(t)}))}get fileChanged(){return this._fileChanged}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;l.Signal.clearData(this)}async get(e,t){const n=this.contentProviderRegistry.getProvider(t===null||t===void 0?void 0:t.contentProviderId);return n.get(e,t)}getDownloadUrl(e){const t=this.serverSettings.baseUrl;let n=r.URLExt.join(t,u,r.URLExt.encodeParts(e));let i="";try{i=document.cookie}catch(o){}const s=i.match("\\b_xsrf=([^;]*)\\b");if(s){const e=new URL(n);e.searchParams.append("_xsrf",s[1]);n=e.toString()}return Promise.resolve(n)}async newUntitled(e={}){var t;let n="{}";if(e){if(e.ext){e.ext=f.normalizeExtension(e.ext)}n=JSON.stringify(e)}const i=this.serverSettings;const s=this._getUrl((t=e.path)!==null&&t!==void 0?t:"");const o={method:"POST",body:n};const r=await d.ServerConnection.makeRequest(s,o,i);if(r.status!==201){const e=await d.ServerConnection.ResponseError.create(r);throw e}const a=await r.json();c.validateContentsModel(a);this._fileChanged.emit({type:"new",oldValue:null,newValue:a});return a}async delete(e){const t=this._getUrl(e);const n=this.serverSettings;const i={method:"DELETE"};const s=await d.ServerConnection.makeRequest(t,i,n);if(s.status!==204){const e=await d.ServerConnection.ResponseError.create(s);throw e}this._fileChanged.emit({type:"delete",oldValue:{path:e},newValue:null})}async rename(e,t){const n=this.serverSettings;const i=this._getUrl(e);const s={method:"PATCH",body:JSON.stringify({path:t})};const o=await d.ServerConnection.makeRequest(i,s,n);if(o.status!==200){const e=await d.ServerConnection.ResponseError.create(o);throw e}const r=await o.json();c.validateContentsModel(r);this._fileChanged.emit({type:"rename",oldValue:{path:e},newValue:r});return r}async save(e,t={}){const n=this.contentProviderRegistry.getProvider(t===null||t===void 0?void 0:t.contentProviderId);const i=await n.save(e,t);this._fileChanged.emit({type:"save",oldValue:null,newValue:i});return i}async copy(e,t){const n=this.serverSettings;const i=this._getUrl(t);const s={method:"POST",body:JSON.stringify({copy_from:e})};const o=await d.ServerConnection.makeRequest(i,s,n);if(o.status!==201){const e=await d.ServerConnection.ResponseError.create(o);throw e}const r=await o.json();c.validateContentsModel(r);this._fileChanged.emit({type:"new",oldValue:null,newValue:r});return r}async createCheckpoint(e){const t=this._getUrl(e,"checkpoints");const n={method:"POST"};const i=await d.ServerConnection.makeRequest(t,n,this.serverSettings);if(i.status!==201){const e=await d.ServerConnection.ResponseError.create(i);throw e}const s=await i.json();c.validateCheckpointModel(s);return s}async listCheckpoints(e){const t=this._getUrl(e,"checkpoints");const n=await d.ServerConnection.makeRequest(t,{},this.serverSettings);if(n.status!==200){const e=await d.ServerConnection.ResponseError.create(n);throw e}const i=await n.json();if(!Array.isArray(i)){throw new Error("Invalid Checkpoint list")}for(let s=0;sr.URLExt.encodeParts(e)));const n=this.serverSettings.baseUrl;return r.URLExt.join(n,this._apiEndpoint,...t)}}t.Drive=g;var f;(function(e){function t(e){if(e.length>0&&e.indexOf(".")!==0){e=`.${e}`}return e}e.normalizeExtension=t})(f||(f={}));class v{constructor(e){this._providers=new Map;this._fileChanged=new l.Signal(this);this.register("default",e.defaultProvider);this._defaultProvider=e.defaultProvider}register(e,t){if(this._providers.has(e)){throw Error(`Provider with ${e} identifier was already registered on this drive`)}this._providers.set(e,t);const n=(e,t)=>{this._fileChanged.emit(t)};if(t.fileChanged){t.fileChanged.connect(n)}return new a.DisposableDelegate((()=>{if(t.fileChanged){t.fileChanged.disconnect(n)}if(this._providers.has(e)){this._providers.delete(e)}}))}getProvider(e){if(!e){return this._defaultProvider}const t=this._providers.get(e);if(!t){throw Error(`Provider ${e} is not registered`)}return t}get fileChanged(){return this._fileChanged}}class _{constructor(e){this._options=e}async get(e,t){let n=this._getUrl(e);if(t){if(t.type==="notebook"){delete t["format"]}const e=t.content?"1":"0";const i=t.hash?"1":"0";const s={...t,content:e,hash:i};n+=r.URLExt.objectToQueryString(s)}const i=this._options.serverSettings;const s=await d.ServerConnection.makeRequest(n,{},i);if(s.status!==200){const e=await d.ServerConnection.ResponseError.create(s);throw e}const o=await s.json();c.validateContentsModel(o);return o}async save(e,t={}){const n=this._options.serverSettings;const i=this._getUrl(e);const s=new File([JSON.stringify(t)],"data.json",{type:"application/json"});const o={method:"PUT",body:s};const r=await d.ServerConnection.makeRequest(i,o,n);if(r.status!==200&&r.status!==201){const e=await d.ServerConnection.ResponseError.create(r);throw e}const a=await r.json();c.validateContentsModel(a);return a}_getUrl(...e){const t=e.map((e=>r.URLExt.encodeParts(e)));const n=this._options.serverSettings.baseUrl;return r.URLExt.join(n,this._options.apiEndpoint,...t)}}t.RestContentProvider=_},77821:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateContentsModel=s;t.validateCheckpointModel=o;const i=n(1480);function s(e){(0,i.validateProperty)(e,"name","string");(0,i.validateProperty)(e,"path","string");(0,i.validateProperty)(e,"type","string");(0,i.validateProperty)(e,"created","string");(0,i.validateProperty)(e,"last_modified","string");(0,i.validateProperty)(e,"mimetype","object");(0,i.validateProperty)(e,"content","object");(0,i.validateProperty)(e,"format","object")}function o(e){(0,i.validateProperty)(e,"id","string");(0,i.validateProperty)(e,"last_modified","string")}},1091:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.EventManager=void 0;const i=n(37737);const s=n(26568);const o=n(2336);const r=n(1089);const a="api/events";class l{constructor(e={}){var t,n;this._socket=null;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:r.ServerConnection.makeSettings();this._poll=new s.Poll({factory:()=>this._subscribe(),standby:(n=e.standby)!==null&&n!==void 0?n:"when-hidden"});this._stream=new o.Stream(this);void this._poll.start()}get isDisposed(){return this._poll.isDisposed}get stream(){return this._stream}dispose(){if(this.isDisposed){return}this._poll.dispose();const e=this._socket;if(e){this._socket=null;e.onopen=()=>undefined;e.onerror=()=>undefined;e.onmessage=()=>undefined;e.onclose=()=>undefined;e.close()}o.Signal.clearData(this);this._stream.stop()}async emit(e){const{serverSettings:t}=this;const{baseUrl:n}=t;const{makeRequest:s,ResponseError:o}=r.ServerConnection;const l=i.URLExt.join(n,a);const d={body:JSON.stringify(e),method:"POST"};const c=await s(l,d,t);if(c.status!==204){throw new o(c)}}_subscribe(){return new Promise(((e,t)=>{if(this.isDisposed){return}const{appendToken:n,token:s,WebSocket:o,wsUrl:r}=this.serverSettings;let l=i.URLExt.join(r,a,"subscribe");if(n&&s!==""){l+=`?token=${encodeURIComponent(s)}`}const d=this._socket=new o(l);const c=this._stream;d.onclose=()=>t(new Error("EventManager socket closed"));d.onmessage=e=>e.data&&c.emit(JSON.parse(e.data))}))}}t.EventManager=l},50608:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))i(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});s(n(5412),t);s(n(39851),t);s(n(39923),t);s(n(97375),t);s(n(1091),t);s(n(14272),t);s(n(76807),t);s(n(90139),t);s(n(1089),t);s(n(86923),t);s(n(95399),t);s(n(67569),t);s(n(80856),t);s(n(18430),t);s(n(90362),t);s(n(93892),t)},52570:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.CommHandler=t.CommsOverSubshells=void 0;const r=n(5592);const a=n(90044);const l=o(n(59798));var d;(function(e){e["Disabled"]="disabled";e["PerComm"]="perComm";e["PerCommTarget"]="perCommTarget"})(d||(t.CommsOverSubshells=d={}));class c extends a.DisposableDelegate{constructor(e,t,n,i,s){super(i);this._subshellStarted=new r.PromiseDelegate;this._subshellId=null;this._target="";this._id="";this._id=t;this._target=e;this._kernel=n;this._kernel.statusChanged.connect((()=>{if(this._kernel.status==="restarting"){this._cleanSubshells()}}));this.commsOverSubshells=s!==null&&s!==void 0?s:d.PerCommTarget}get commId(){return this._id}get targetName(){return this._target}get subshellId(){return this._subshellId}get subshellStarted(){return this._subshellStarted.promise}get commsOverSubshells(){return this._commsOverSubshells}set commsOverSubshells(e){this._commsOverSubshells=e;if(this._commsOverSubshells===d.Disabled){this._maybeCloseSubshell()}else{void this._maybeStartSubshell()}}get onClose(){return this._onClose}set onClose(e){this._onClose=e}get onMsg(){return this._onMsg}set onMsg(e){this._onMsg=e}open(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed){throw new Error("Cannot open")}const i=l.createMessage({msgType:"comm_open",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,subshellId:this._subshellId||this._kernel.subshellId,content:{comm_id:this._id,target_name:this._target,data:e!==null&&e!==void 0?e:{}},metadata:t,buffers:n});return this._kernel.sendShellMessage(i,false,true)}send(e,t,n=[],i=true){if(this.isDisposed||this._kernel.isDisposed){throw new Error("Cannot send")}const s=l.createMessage({msgType:"comm_msg",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,subshellId:this._subshellId||this._kernel.subshellId,content:{comm_id:this._id,data:e},metadata:t,buffers:n});return this._kernel.sendShellMessage(s,false,i)}close(e,t,n=[]){if(this.isDisposed||this._kernel.isDisposed){throw new Error("Cannot close")}const i=l.createMessage({msgType:"comm_close",channel:"shell",username:this._kernel.username,session:this._kernel.clientId,subshellId:this._subshellId||this._kernel.subshellId,content:{comm_id:this._id,data:e!==null&&e!==void 0?e:{}},metadata:t,buffers:n});const s=this._kernel.sendShellMessage(i,false,true);const o=this._onClose;if(o){const i=l.createMessage({msgType:"comm_close",channel:"iopub",username:this._kernel.username,session:this._kernel.clientId,subshellId:this._subshellId||this._kernel.subshellId,content:{comm_id:this._id,data:e!==null&&e!==void 0?e:{}},metadata:t,buffers:n});void o(i)}this.dispose();return s}dispose(){this._maybeCloseSubshell();super.dispose()}_cleanSubshells(){const e=this._kernel.id;if(c._commTargetSubShellsId.hasOwnProperty(e)){delete c._commTargetSubShellsId[e]}}async _maybeStartSubshell(){await this._kernel.info;if(!this._kernel.supportsSubshells){return}if(this._commsOverSubshells===d.PerComm){const e=await this._kernel.requestCreateSubshell({}).done;this._subshellId=e.content.subshell_id;this._subshellStarted.resolve();return}const e=this._kernel.id;if(!c._commTargetSubShellsId.hasOwnProperty(e)){c._commTargetSubShellsId[e]={}}const t=c._commTargetSubShellsId[e];if(t[this._target]){this._subshellId=await t[this._target];this._subshellStarted.resolve()}else{t[this._target]=this._kernel.requestCreateSubshell({}).done.then((e=>{this._subshellId=e.content.subshell_id;return this._subshellId}));await t[this._target];this._subshellStarted.resolve()}}_maybeCloseSubshell(){if(this._commsOverSubshells!==d.PerComm){this._subshellId=null;return}if(this._subshellId&&this._kernel.status!=="dead"){this._kernel.requestDeleteSubshell({subshell_id:this._subshellId},true)}this._subshellId=null}}t.CommHandler=c;c._commTargetSubShellsId={}},45089:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.KernelConnection=void 0;const r=n(37737);const a=n(5592);const l=n(2336);const d=n(50608);const c=n(52570);const h=o(n(59798));const u=n(46073);const p=o(n(38872));const m=n(38662);const g=n(321);const f=3e3;const v="_RESTARTING_";const _="";class b{constructor(e){var t,n,i,s,o,c,u,f;this._createSocket=(e=true)=>{this._errorIfDisposed();this._clearSocket();this._updateConnectionStatus("connecting");const t=this.serverSettings;const n=r.URLExt.join(t.wsUrl,m.KERNEL_SERVICE_URL,encodeURIComponent(this._id));const i=n.replace(/^((?:\w+:)?\/\/)(?:[^@\/]+@)/,"$1");console.debug(`Starting WebSocket: ${i}`);let s=r.URLExt.join(n,"channels?session_id="+encodeURIComponent(this._clientId));const o=t.token;if(t.appendToken&&o!==""){s=s+`&token=${encodeURIComponent(o)}`}const a=e?this._supportedProtocols:[];this._ws=new t.WebSocket(s,a);this._ws.binaryType="arraybuffer";let l=false;const c=async e=>{var t,n;if(this._isDisposed){return}this._reason="";this._model=undefined;try{const t=await this._kernelAPIClient.getModel(this._id);this._model=t;if((t===null||t===void 0?void 0:t.execution_state)==="dead"){this._updateStatus("dead")}else{this._onWSClose(e)}}catch(i){if(i instanceof d.ServerConnection.NetworkError||((t=i.response)===null||t===void 0?void 0:t.status)===503||((n=i.response)===null||n===void 0?void 0:n.status)===424){const t=y.getRandomIntInclusive(10,30)*1e3;setTimeout(c,t,e)}else{this._reason="Kernel died unexpectedly";this._updateStatus("dead")}}return};const h=async e=>{if(l){return}l=true;await c(e);return};this._ws.onmessage=this._onWSMessage;this._ws.onopen=this._onWSOpen;this._ws.onclose=h;this._ws.onerror=h};this._onWSOpen=e=>{if(this._ws.protocol!==""&&!this._supportedProtocols.includes(this._ws.protocol)){console.log("Server selected unknown kernel wire protocol:",this._ws.protocol);this._updateStatus("dead");throw new Error(`Unknown kernel wire protocol: ${this._ws.protocol}`)}this._selectedProtocol=this._ws.protocol;this._ws.onclose=this._onWSClose;this._ws.onerror=this._onWSClose;this._updateConnectionStatus("connected")};this._onWSMessage=e=>{let t;try{t=this.serverSettings.serializer.deserialize(e.data,this._ws.protocol);p.validateMessage(t)}catch(n){n.message=`Kernel message validation error: ${n.message}`;throw n}this._kernelSession=t.header.session;this._msgChain=this._msgChain.then((()=>this._handleMessage(t))).catch((e=>{if(e.message.startsWith("Canceled future for ")){console.error(e)}}));this._anyMessage.emit({msg:t,direction:"recv"})};this._onWSClose=e=>{if(!this.isDisposed){this._reconnect()}};this._id="";this._name="";this._status="unknown";this._connectionStatus="connecting";this._kernelSession="";this._isDisposed=false;this._ws=null;this._username="";this._reconnectLimit=7;this._reconnectAttempt=0;this._reconnectTimeout=null;this._supportedProtocols=Object.values(h.supportedKernelWebSocketProtocols);this._selectedProtocol="";this._commsOverSubshells=d.CommsOverSubshells.PerCommTarget;this._futures=new Map;this._comms=new Map;this._targetRegistry=Object.create(null);this._info=new a.PromiseDelegate;this._pendingMessages=[];this._statusChanged=new l.Signal(this);this._connectionStatusChanged=new l.Signal(this);this._disposed=new l.Signal(this);this._iopubMessage=new l.Signal(this);this._anyMessage=new l.Signal(this);this._pendingInput=new l.Signal(this);this._unhandledMessage=new l.Signal(this);this._displayIdToParentIds=new Map;this._msgIdToDisplayIds=new Map;this._msgChain=Promise.resolve();this._hasPendingInput=false;this._reason="";this._noOp=()=>{};this._supportsSubshells=false;this._name=e.model.name;this._id=e.model.id;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:d.ServerConnection.makeSettings();this._kernelAPIClient=(n=e.kernelAPIClient)!==null&&n!==void 0?n:new m.KernelAPIClient({serverSettings:this.serverSettings});this._kernelSpecAPIClient=(i=e.kernelSpecAPIClient)!==null&&i!==void 0?i:new g.KernelSpecAPIClient({serverSettings:this.serverSettings});this._clientId=(s=e.clientId)!==null&&s!==void 0?s:a.UUID.uuid4();this._username=(o=e.username)!==null&&o!==void 0?o:"";this.handleComms=(c=e.handleComms)!==null&&c!==void 0?c:true;this._commsOverSubshells=(u=e.commsOverSubshells)!==null&&u!==void 0?u:d.CommsOverSubshells.PerCommTarget;this._subshellId=(f=e.subshellId)!==null&&f!==void 0?f:null;this._createSocket()}get disposed(){return this._disposed}get commsOverSubshells(){return this._commsOverSubshells}set commsOverSubshells(e){this._commsOverSubshells=e;for(const[t,n]of this._comms){n.commsOverSubshells=e}}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get model(){return this._model||{id:this.id,name:this.name,reason:this._reason}}get anyMessage(){return this._anyMessage}get pendingInput(){return this._pendingInput}get id(){return this._id}get name(){return this._name}get username(){return this._username}get clientId(){return this._clientId}get subshellId(){return this._subshellId}set subshellId(e){this._subshellId=e}get status(){return this._status}get connectionStatus(){return this._connectionStatus}get isDisposed(){return this._isDisposed}get info(){return this._info.promise}get spec(){if(this._specPromise){return this._specPromise}this._specPromise=this._kernelSpecAPIClient.get().then((e=>e.kernelspecs[this._name]));return this._specPromise}get supportsSubshells(){return this._supportsSubshells}clone(e={}){return new b({model:this.model,username:this.username,serverSettings:this.serverSettings,handleComms:false,kernelAPIClient:this._kernelAPIClient,commsOverSubshells:d.CommsOverSubshells.Disabled,...e})}dispose(){if(this.isDisposed){return}const e=()=>{this._isDisposed=true;this._disposed.emit();this._updateConnectionStatus("disconnected");this._clearKernelState();this._pendingMessages=[];this._clearSocket();l.Signal.clearData(this)};if(this._subshellId!==null){const t=this.requestDeleteSubshell({subshell_id:this._subshellId},true);t.onReply=t=>{e()}}else{e()}}sendShellMessage(e,t=false,n=true){return this._sendKernelShellControl(u.KernelShellFutureHandler,e,t,n)}sendControlMessage(e,t=false,n=true){return this._sendKernelShellControl(u.KernelControlFutureHandler,e,t,n)}_sendKernelShellControl(e,t,n=false,i=true){this._sendMessage(t);this._anyMessage.emit({msg:t,direction:"send"});const s=new e((()=>{const e=t.header.msg_id;this._futures.delete(e);const n=this._msgIdToDisplayIds.get(e);if(!n){return}n.forEach((t=>{const n=this._displayIdToParentIds.get(t);if(n){const i=n.indexOf(e);if(i===-1){return}if(n.length===1){this._displayIdToParentIds.delete(t)}else{n.splice(i,1);this._displayIdToParentIds.set(t,n)}}}));this._msgIdToDisplayIds.delete(e)}),t,n,i,this);this._futures.set(t.header.msg_id,s);return s}_sendMessage(e,t=true){if(this.status==="dead"){throw new Error("Kernel is dead")}if((this._kernelSession===_||this._kernelSession===v)&&h.isInfoRequestMsg(e)){if(this.connectionStatus==="connected"){this._ws.send(this.serverSettings.serializer.serialize(e,this._ws.protocol));return}else{throw new Error("Could not send message: status is not connected")}}if(t&&this._pendingMessages.length>0){this._pendingMessages.push(e);return}if(this.connectionStatus==="connected"&&this._kernelSession!==v){this._ws.send(this.serverSettings.serializer.serialize(e,this._ws.protocol))}else if(t){this._pendingMessages.push(e)}else{throw new Error("Could not send message")}}async interrupt(){this.hasPendingInput=false;if(this.status==="dead"){throw new Error("Kernel is dead")}return this._kernelAPIClient.interrupt(this.id)}async restart(){if(this.status==="dead"){throw new Error("Kernel is dead")}this._updateStatus("restarting");this._clearKernelState();this._kernelSession=v;await this._kernelAPIClient.restart(this.id);await this.reconnect();this.hasPendingInput=false}reconnect(){this._errorIfDisposed();const e=new a.PromiseDelegate;const t=(n,i)=>{if(i==="connected"){e.resolve();this.connectionStatusChanged.disconnect(t,this)}else if(i==="disconnected"){e.reject(new Error("Kernel connection disconnected"));this.connectionStatusChanged.disconnect(t,this)}};this.connectionStatusChanged.connect(t,this);this._reconnectAttempt=0;this._reconnect();return e.promise}async shutdown(){if(this.status!=="dead"){await this._kernelAPIClient.shutdown(this.id)}this.handleShutdown()}handleShutdown(){this._updateStatus("dead");this.dispose()}async requestKernelInfo(){const e=h.createMessage({msgType:"kernel_info_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:{}});let t;try{t=await y.handleShellMessage(this,e)}catch(i){if(this.isDisposed){return}else{throw i}}this._errorIfDisposed();if(!t){return}if(t.content.status===undefined){t.content.status="ok"}if(t.content.status!=="ok"){this._info.reject("Kernel info reply errored");return t}this._info.resolve(t.content);this._kernelSession=t.header.session;const n=t.content.supported_features;this._supportsSubshells=n!==undefined&&n.includes("kernel subshells");return t}requestComplete(e){const t=h.createMessage({msgType:"complete_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:e});return y.handleShellMessage(this,t)}requestInspect(e){const t=h.createMessage({msgType:"inspect_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:e});return y.handleShellMessage(this,t)}requestHistory(e){const t=h.createMessage({msgType:"history_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:e});return y.handleShellMessage(this,t)}requestExecute(e,t=true,n){const i={silent:false,store_history:true,user_expressions:{},allow_stdin:true,stop_on_error:false};const s=h.createMessage({msgType:"execute_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:{...i,...e},metadata:n});return this.sendShellMessage(s,true,t)}requestDebug(e,t=true){const n=h.createMessage({msgType:"debug_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,true,t)}requestCreateSubshell(e,t=true){if(!this.supportsSubshells){throw new Error("Kernel subshells are not supported")}const n=h.createMessage({msgType:"create_subshell_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,true,t)}requestDeleteSubshell(e,t=true){if(!this.supportsSubshells){throw new Error("Kernel subshells are not supported")}const n=h.createMessage({msgType:"delete_subshell_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,true,t)}requestListSubshell(e,t=true){if(!this.supportsSubshells){throw new Error("Kernel subshells are not supported")}const n=h.createMessage({msgType:"list_subshell_request",channel:"control",username:this._username,session:this._clientId,content:e});return this.sendControlMessage(n,true,t)}requestIsComplete(e){const t=h.createMessage({msgType:"is_complete_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:e});return y.handleShellMessage(this,t)}requestCommInfo(e){const t=h.createMessage({msgType:"comm_info_request",channel:"shell",username:this._username,session:this._clientId,subshellId:this._subshellId,content:e});return y.handleShellMessage(this,t)}sendInputReply(e,t){const n=h.createMessage({msgType:"input_reply",channel:"stdin",username:this._username,session:this._clientId,content:e});n.parent_header=t;this._sendMessage(n);this._anyMessage.emit({msg:n,direction:"send"});this.hasPendingInput=false}createComm(e,t=a.UUID.uuid4()){if(!this.handleComms){throw new Error("Comms are disabled on this kernel connection")}if(this._comms.has(t)){throw new Error("Comm is already created")}const n=new c.CommHandler(e,t,this,(()=>{this._unregisterComm(t)}),this._commsOverSubshells);this._comms.set(t,n);return n}hasComm(e){return this._comms.has(e)}registerCommTarget(e,t){if(!this.handleComms){return}this._targetRegistry[e]=t}removeCommTarget(e,t){if(!this.handleComms){return}if(!this.isDisposed&&this._targetRegistry[e]===t){delete this._targetRegistry[e]}}registerMessageHook(e,t){var n;const i=(n=this._futures)===null||n===void 0?void 0:n.get(e);if(i){i.registerMessageHook(t)}}removeMessageHook(e,t){var n;const i=(n=this._futures)===null||n===void 0?void 0:n.get(e);if(i){i.removeMessageHook(t)}}removeInputGuard(){this.hasPendingInput=false}async _handleDisplayId(e,t){var n,i;const s=t.parent_header.msg_id;let o=this._displayIdToParentIds.get(e);if(o){const e={header:a.JSONExt.deepCopy(t.header),parent_header:a.JSONExt.deepCopy(t.parent_header),metadata:a.JSONExt.deepCopy(t.metadata),content:a.JSONExt.deepCopy(t.content),channel:t.channel,buffers:t.buffers?t.buffers.slice():[]};e.header.msg_type="update_display_data";await Promise.all(o.map((async t=>{const n=this._futures&&this._futures.get(t);if(n){await n.handleMsg(e)}})))}if(t.header.msg_type==="update_display_data"){return true}o=(n=this._displayIdToParentIds.get(e))!==null&&n!==void 0?n:[];if(o.indexOf(s)===-1){o.push(s)}this._displayIdToParentIds.set(e,o);const r=(i=this._msgIdToDisplayIds.get(s))!==null&&i!==void 0?i:[];if(r.indexOf(s)===-1){r.push(s)}this._msgIdToDisplayIds.set(s,r);return false}_clearSocket(){if(this._ws!==null){this._ws.onopen=this._noOp;this._ws.onclose=this._noOp;this._ws.onerror=this._noOp;this._ws.onmessage=this._noOp;this._ws.close();this._ws=null}}_updateStatus(e){if(this._status===e||this._status==="dead"){return}this._status=e;y.logKernelStatus(this);this._statusChanged.emit(e);if(e==="dead"){this.dispose()}}_sendPending(){while(this.connectionStatus==="connected"&&this._kernelSession!==v&&this._pendingMessages.length>0){this._sendMessage(this._pendingMessages[0],false);this._pendingMessages.shift()}}_clearKernelState(){this._kernelSession="";this._pendingMessages=[];this._futures.forEach((e=>{e.dispose()}));this._comms.forEach((e=>{e.dispose()}));this._msgChain=Promise.resolve();this._futures=new Map;this._comms=new Map;this._displayIdToParentIds.clear();this._msgIdToDisplayIds.clear()}_assertCurrentMessage(e){this._errorIfDisposed();if(e.header.session!==this._kernelSession){throw new Error(`Canceling handling of old message: ${e.header.msg_type}`)}}async _handleCommOpen(e){this._assertCurrentMessage(e);const t=e.content;const n=new c.CommHandler(t.target_name,t.comm_id,this,(()=>{this._unregisterComm(t.comm_id)}),this.commsOverSubshells);this._comms.set(t.comm_id,n);try{const i=await y.loadObject(t.target_name,t.target_module,this._targetRegistry);await i(n,e)}catch(i){n.close();console.error("Exception opening new comm");throw i}}async _handleCommClose(e){this._assertCurrentMessage(e);const t=e.content;const n=this._comms.get(t.comm_id);if(!n){console.error("Comm not found for comm id "+t.comm_id);return}this._unregisterComm(n.commId);const i=n.onClose;if(i){await i(e)}n.dispose()}async _handleCommMsg(e){this._assertCurrentMessage(e);const t=e.content;const n=this._comms.get(t.comm_id);if(!n){return}const i=n.onMsg;if(i){await i(e)}}_unregisterComm(e){this._comms.delete(e)}_updateConnectionStatus(e){if(this._connectionStatus===e){return}this._connectionStatus=e;if(e!=="connecting"){this._reconnectAttempt=0;clearTimeout(this._reconnectTimeout)}if(this.status!=="dead"){if(e==="connected"){let e=this._kernelSession===v;let t=this.requestKernelInfo();let n=false;let i=()=>{if(n){return}n=true;if(e&&this._kernelSession===v){this._kernelSession=""}clearTimeout(s);if(this._pendingMessages.length>0){this._sendPending()}};void t.then(i);let s=setTimeout(i,f)}else{this._updateStatus("unknown")}}this._connectionStatusChanged.emit(e)}async _handleMessage(e){var t,n;let i=false;if(e.parent_header&&e.channel==="iopub"&&(h.isDisplayDataMsg(e)||h.isUpdateDisplayDataMsg(e)||h.isExecuteResultMsg(e))){const n=(t=e.content.transient)!==null&&t!==void 0?t:{};const s=n["display_id"];if(s){i=await this._handleDisplayId(s,e);this._assertCurrentMessage(e)}}if(!i&&e.parent_header){const t=e.parent_header;const i=(n=this._futures)===null||n===void 0?void 0:n.get(t.msg_id);if(i){await i.handleMsg(e);this._assertCurrentMessage(e)}else{const n=t.session===this.clientId;if(e.channel!=="iopub"&&n){this._unhandledMessage.emit(e)}}}if(e.channel==="iopub"){switch(e.header.msg_type){case"status":{const t=e.content.execution_state;if(t==="restarting"){void Promise.resolve().then((async()=>{this._updateStatus("autorestarting");this._clearKernelState();await this.reconnect()}))}this._updateStatus(t);break}case"comm_open":if(this.handleComms){await this._handleCommOpen(e)}break;case"comm_msg":if(this.handleComms){await this._handleCommMsg(e)}break;case"comm_close":if(this.handleComms){await this._handleCommClose(e)}break;default:break}if(!this.isDisposed){this._assertCurrentMessage(e);this._iopubMessage.emit(e)}}}_reconnect(){this._errorIfDisposed();clearTimeout(this._reconnectTimeout);if(this._reconnectAttempt{if(t){if(typeof requirejs==="undefined"){throw new Error("requirejs not found")}requirejs([t],(n=>{if(n[e]===void 0){const n=`Object '${e}' not found in module '${t}'`;s(new Error(n))}else{i(n[e])}}),s)}else{if(n===null||n===void 0?void 0:n[e]){i(n[e])}else{s(new Error(`Object '${e}' not found in registry`))}}}))}e.loadObject=i;function s(e,t){e=Math.ceil(e);t=Math.floor(t);return Math.floor(Math.random()*(t-e+1))+e}e.getRandomIntInclusive=s})(y||(y={}))},46073:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.KernelShellFutureHandler=t.KernelControlFutureHandler=t.KernelFutureHandler=void 0;const r=n(5592);const a=n(90044);const l=o(n(59798));class d extends a.DisposableDelegate{constructor(e,t,n,i,s){super(e);this._status=0;this._stdin=u.noOp;this._iopub=u.noOp;this._reply=u.noOp;this._done=new r.PromiseDelegate;this._hooks=new u.HookList;this._disposeOnDone=true;this._msg=t;if(!n){this._setFlag(u.KernelFutureFlag.GotReply)}this._disposeOnDone=i;this._kernel=s}get msg(){return this._msg}get done(){return this._done.promise}get onReply(){return this._reply}set onReply(e){this._reply=e}get onIOPub(){return this._iopub}set onIOPub(e){this._iopub=e}get onStdin(){return this._stdin}set onStdin(e){this._stdin=e}registerMessageHook(e){if(this.isDisposed){throw new Error("Kernel future is disposed")}this._hooks.add(e)}removeMessageHook(e){if(this.isDisposed){return}this._hooks.remove(e)}sendInputReply(e,t){this._kernel.sendInputReply(e,t)}dispose(){this._stdin=u.noOp;this._iopub=u.noOp;this._reply=u.noOp;this._hooks=null;if(!this._testFlag(u.KernelFutureFlag.IsDone)){this._done.promise.catch((()=>{}));this._done.reject(new Error(`Canceled future for ${this.msg.header.msg_type} message before replies were done`))}super.dispose()}async handleMsg(e){switch(e.channel){case"control":case"shell":if(e.channel===this.msg.channel&&e.parent_header.msg_id===this.msg.header.msg_id){await this._handleReply(e)}break;case"stdin":await this._handleStdin(e);break;case"iopub":await this._handleIOPub(e);break;default:break}}async _handleReply(e){const t=this._reply;if(t){await t(e)}this._replyMsg=e;this._setFlag(u.KernelFutureFlag.GotReply);if(this._testFlag(u.KernelFutureFlag.GotIdle)){this._handleDone()}}async _handleStdin(e){this._kernel.hasPendingInput=true;const t=this._stdin;if(t){await t(e)}}async _handleIOPub(e){const t=await this._hooks.process(e);const n=this._iopub;if(t&&n){await n(e)}if(l.isStatusMsg(e)&&e.content.execution_state==="idle"){this._setFlag(u.KernelFutureFlag.GotIdle);if(this._testFlag(u.KernelFutureFlag.GotReply)){this._handleDone()}}}_handleDone(){if(this._testFlag(u.KernelFutureFlag.IsDone)){return}this._setFlag(u.KernelFutureFlag.IsDone);this._done.resolve(this._replyMsg);if(this._disposeOnDone){this.dispose()}}_testFlag(e){return(this._status&e)!==0}_setFlag(e){this._status|=e}}t.KernelFutureHandler=d;class c extends d{}t.KernelControlFutureHandler=c;class h extends d{}t.KernelShellFutureHandler=h;var u;(function(e){e.noOp=()=>{};const t=(()=>{const e=typeof requestAnimationFrame==="function";return e?requestAnimationFrame:setImmediate})();class n{constructor(){this._hooks=[]}add(e){this.remove(e);this._hooks.push(e)}remove(e){const t=this._hooks.indexOf(e);if(t>=0){this._hooks[t]=null;this._scheduleCompact()}}async process(e){await this._processing;const t=new r.PromiseDelegate;this._processing=t.promise;let n;for(let s=this._hooks.length-1;s>=0;s--){const o=this._hooks[s];if(o===null){continue}try{n=await o(e)}catch(i){n=true;console.error(i)}if(n===false){t.resolve(undefined);return false}}t.resolve(undefined);return true}_scheduleCompact(){if(!this._compactScheduled){this._compactScheduled=true;t((()=>{this._processing=this._processing.then((()=>{this._compactScheduled=false;this._compact()}))}))}}_compact(){let e=0;for(let t=0,n=this._hooks.length;t{"use strict";Object.defineProperty(t,"__esModule",{value:true})},47275:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.KernelManager=void 0;const i=n(26568);const s=n(2336);const o=n(50608);const r=n(5412);const a=n(38662);const l=n(45089);const d=n(321);class c extends r.BaseManager{constructor(e={}){var t,n,r;super(e);this._commsOverSubshells=o.CommsOverSubshells.PerCommTarget;this._isReady=false;this._kernelConnections=new Set;this._models=new Map;this._runningChanged=new s.Signal(this);this._connectionFailure=new s.Signal(this);this._kernelAPIClient=(t=e.kernelAPIClient)!==null&&t!==void 0?t:new a.KernelAPIClient({serverSettings:this.serverSettings});this._kernelSpecAPIClient=(n=e.kernelSpecAPIClient)!==null&&n!==void 0?n:new d.KernelSpecAPIClient({serverSettings:this.serverSettings});this._pollModels=new i.Poll({auto:false,factory:()=>this.requestRunning(),frequency:{interval:10*1e3,backoff:true,max:300*1e3},name:`@jupyterlab/services:KernelManager#models`,standby:(r=e.standby)!==null&&r!==void 0?r:"when-hidden"});this._ready=(async()=>{await this._pollModels.start();await this._pollModels.tick;this._isReady=true})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){if(this.isDisposed){return}this._models.clear();this._kernelConnections.forEach((e=>e.dispose()));this._pollModels.dispose();super.dispose()}connectTo(e){var t;const{id:n}=e.model;let i=(t=e.handleComms)!==null&&t!==void 0?t:true;if(e.handleComms===undefined){for(const e of this._kernelConnections){if(e.id===n&&e.handleComms){i=false;break}}}e.commsOverSubshells=this._commsOverSubshells;const s=new l.KernelConnection({handleComms:i,...e,serverSettings:this.serverSettings,kernelAPIClient:this._kernelAPIClient,kernelSpecAPIClient:this._kernelSpecAPIClient});this._onStarted(s);if(!this._models.has(n)){void this.refreshRunning().catch((()=>{}))}return s}running(){return this._models.values()}get runningCount(){return this._models.size}get commsOverSubshells(){return this._commsOverSubshells}set commsOverSubshells(e){this._commsOverSubshells=e;for(const t of this._kernelConnections){t.commsOverSubshells=e}}async refreshRunning(){await this._pollModels.refresh();await this._pollModels.tick}async startNew(e={},t={}){const n=await this._kernelAPIClient.startNew(e);return this.connectTo({...t,model:n})}async shutdown(e){await this._kernelAPIClient.shutdown(e);await this.refreshRunning()}async shutdownAll(){await this.refreshRunning();await Promise.all([...this._models.keys()].map((e=>this._kernelAPIClient.shutdown(e))));await this.refreshRunning()}async findById(e){if(this._models.has(e)){return this._models.get(e)}await this.refreshRunning();return this._models.get(e)}async requestRunning(){var e,t;let n;try{n=await this._kernelAPIClient.listRunning()}catch(i){if(i instanceof o.ServerConnection.NetworkError||((e=i.response)===null||e===void 0?void 0:e.status)===503||((t=i.response)===null||t===void 0?void 0:t.status)===424){this._connectionFailure.emit(i)}throw i}if(this.isDisposed){return}if(this._models.size===n.length&&n.every((e=>{const t=this._models.get(e.id);if(!t){return false}return t.connections===e.connections&&t.execution_state===e.execution_state&&t.last_activity===e.last_activity&&t.name===e.name&&t.reason===e.reason&&t.traceback===e.traceback}))){return}this._models=new Map(n.map((e=>[e.id,e])));this._kernelConnections.forEach((e=>{if(!this._models.has(e.id)){e.handleShutdown()}}));this._runningChanged.emit(n)}_onStarted(e){this._kernelConnections.add(e);e.statusChanged.connect(this._onStatusChanged,this);e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._kernelConnections.delete(e);void this.refreshRunning().catch((()=>{}))}_onStatusChanged(e,t){if(t==="dead"){void this.refreshRunning().catch((()=>{}))}}}t.KernelManager=c;(function(e){class t extends e{constructor(){super(...arguments);this._readyPromise=new Promise((()=>{}))}get isActive(){return false}get parentReady(){return super.ready}async startNew(e={},t={}){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}connectTo(e){throw new Error("Not implemented in no-op Kernel Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Kernel Manager"))}get ready(){return this.parentReady.then((()=>this._readyPromise))}async requestRunning(){return Promise.resolve()}}e.NoopManager=t})(c||(t.KernelManager=c={}))},59798:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.supportedKernelWebSocketProtocols=void 0;t.createMessage=s;t.isStreamMsg=o;t.isDisplayDataMsg=r;t.isUpdateDisplayDataMsg=a;t.isExecuteInputMsg=l;t.isExecuteResultMsg=d;t.isErrorMsg=c;t.isStatusMsg=h;t.isClearOutputMsg=u;t.isDebugEventMsg=p;t.isCommOpenMsg=m;t.isCommCloseMsg=g;t.isCommMsgMsg=f;t.isInfoRequestMsg=v;t.isExecuteReplyMsg=_;t.isDebugRequestMsg=b;t.isDebugReplyMsg=y;t.isInputRequestMsg=w;t.isInputReplyMsg=C;const i=n(5592);function s(e){var t,n,s,o,r,a;return{buffers:(t=e.buffers)!==null&&t!==void 0?t:[],channel:e.channel,content:e.content,header:{date:(new Date).toISOString(),msg_id:(n=e.msgId)!==null&&n!==void 0?n:i.UUID.uuid4(),msg_type:e.msgType,session:e.session,username:(s=e.username)!==null&&s!==void 0?s:"",subshell_id:(o=e.subshellId)!==null&&o!==void 0?o:null,version:"5.2"},metadata:(r=e.metadata)!==null&&r!==void 0?r:{},parent_header:(a=e.parentHeader)!==null&&a!==void 0?a:{}}}function o(e){return e.header.msg_type==="stream"}function r(e){return e.header.msg_type==="display_data"}function a(e){return e.header.msg_type==="update_display_data"}function l(e){return e.header.msg_type==="execute_input"}function d(e){return e.header.msg_type==="execute_result"}function c(e){return e.header.msg_type==="error"}function h(e){return e.header.msg_type==="status"}function u(e){return e.header.msg_type==="clear_output"}function p(e){return e.header.msg_type==="debug_event"}function m(e){return e.header.msg_type==="comm_open"}function g(e){return e.header.msg_type==="comm_close"}function f(e){return e.header.msg_type==="comm_msg"}function v(e){return e.header.msg_type==="kernel_info_request"}function _(e){return e.header.msg_type==="execute_reply"}function b(e){return e.header.msg_type==="debug_request"}function y(e){return e.header.msg_type==="debug_reply"}function w(e){return e.header.msg_type==="input_request"}function C(e){return e.header.msg_type==="input_reply"}var x;(function(e){e["v1KernelWebsocketJupyterOrg"]="v1.kernel.websocket.jupyter.org"})(x||(t.supportedKernelWebSocketProtocols=x={}))},38662:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.KernelAPIClient=t.KERNEL_SERVICE_URL=void 0;t.listRunning=r;t.startNew=a;t.restartKernel=l;t.interruptKernel=d;t.shutdownKernel=c;t.getKernelModel=h;const i=n(1089);const s=n(37737);const o=n(38872);t.KERNEL_SERVICE_URL="api/kernels";async function r(e=i.ServerConnection.makeSettings()){const n=s.URLExt.join(e.baseUrl,t.KERNEL_SERVICE_URL);const r=await i.ServerConnection.makeRequest(n,{},e);if(r.status!==200){const e=await i.ServerConnection.ResponseError.create(r);throw e}const a=await r.json();(0,o.validateModels)(a);return a}async function a(e={},n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL);const a={method:"POST",body:JSON.stringify(e)};const l=await i.ServerConnection.makeRequest(r,a,n);if(l.status!==201){const e=await i.ServerConnection.ResponseError.create(l);throw e}const d=await l.json();(0,o.validateModel)(d);return d}async function l(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"restart");const a={method:"POST"};const l=await i.ServerConnection.makeRequest(r,a,n);if(l.status!==200){const e=await i.ServerConnection.ResponseError.create(l);throw e}const d=await l.json();(0,o.validateModel)(d)}async function d(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e),"interrupt");const r={method:"POST"};const a=await i.ServerConnection.makeRequest(o,r,n);if(a.status!==204){const e=await i.ServerConnection.ResponseError.create(a);throw e}}async function c(e,n=i.ServerConnection.makeSettings()){const o=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e));const r={method:"DELETE"};const a=await i.ServerConnection.makeRequest(o,r,n);if(a.status===404){const t=`The kernel "${e}" does not exist on the server`;console.warn(t)}else if(a.status!==204){const e=await i.ServerConnection.ResponseError.create(a);throw e}}async function h(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.KERNEL_SERVICE_URL,encodeURIComponent(e));const a=await i.ServerConnection.makeRequest(r,{},n);if(a.status===404){return undefined}else if(a.status!==200){const e=await i.ServerConnection.ResponseError.create(a);throw e}const l=await a.json();(0,o.validateModel)(l);return l}class u{constructor(e={}){var t;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:i.ServerConnection.makeSettings()}async listRunning(){return r(this.serverSettings)}async getModel(e){return h(e,this.serverSettings)}async startNew(e={}){return a(e,this.serverSettings)}async restart(e){return l(e,this.serverSettings)}async interrupt(e){return d(e,this.serverSettings)}async shutdown(e){return c(e,this.serverSettings)}}t.KernelAPIClient=u},93962:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};Object.defineProperty(t,"__esModule",{value:true});t.serialize=a;t.deserialize=l;const r=o(n(59798));function a(e,t=""){switch(t){case r.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg:return d.serializeV1KernelWebsocketJupyterOrg(e);default:return d.serializeDefault(e)}}function l(e,t=""){switch(t){case r.supportedKernelWebSocketProtocols.v1KernelWebsocketJupyterOrg:return d.deserializeV1KernelWebsocketJupyterOrg(e);default:return d.deserializeDefault(e)}}var d;(function(e){function t(e){let t;const n=new DataView(e);const i=Number(n.getBigUint64(0,true));let s=[];for(let u=0;u{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateMessage=a;t.validateModel=d;t.validateModels=c;const i=n(1480);const s=["username","version","session","msg_id","msg_type"];const o={stream:{name:"string",text:"string"},display_data:{data:"object",metadata:"object"},execute_input:{code:"string",execution_count:"number"},execute_result:{execution_count:"number",data:"object",metadata:"object"},error:{ename:"string",evalue:"string",traceback:"object"},status:{execution_state:["string",["starting","idle","busy","restarting","dead"]]},clear_output:{wait:"boolean"},comm_open:{comm_id:"string",target_name:"string",data:"object"},comm_msg:{comm_id:"string",data:"object"},comm_close:{comm_id:"string"},shutdown_reply:{restart:"boolean"}};function r(e){for(let t=0;td(e)))}},76807:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))i(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.KernelSpecAPI=t.KernelSpec=void 0;const a=o(n(51229));t.KernelSpec=a;const l=o(n(321));t.KernelSpecAPI=l;r(n(26224),t)},51229:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},26224:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.KernelSpecManager=void 0;const i=n(5592);const s=n(26568);const o=n(2336);const r=n(5412);const a=n(321);class l extends r.BaseManager{constructor(e={}){var t,n;super(e);this._isReady=false;this._connectionFailure=new o.Signal(this);this._specs=null;this._specsChanged=new o.Signal(this);this._kernelSpecAPIClient=(t=e.kernelSpecAPIClient)!==null&&t!==void 0?t:new a.KernelSpecAPIClient({serverSettings:this.serverSettings});this._ready=Promise.all([this.requestSpecs()]).then((e=>undefined)).catch((e=>undefined)).then((()=>{if(this.isDisposed){return}this._isReady=true}));this._pollSpecs=new s.Poll({auto:false,factory:()=>this.requestSpecs(),frequency:{interval:61*1e3,backoff:true,max:300*1e3},name:`@jupyterlab/services:KernelSpecManager#specs`,standby:(n=e.standby)!==null&&n!==void 0?n:"when-hidden"});void this.ready.then((()=>{void this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get specs(){return this._specs}get specsChanged(){return this._specsChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose();super.dispose()}async refreshSpecs(){await this._pollSpecs.refresh();await this._pollSpecs.tick}async requestSpecs(){const e=await this._kernelSpecAPIClient.get();if(this.isDisposed){return}if(!i.JSONExt.deepEqual(e,this._specs)){this._specs=e;this._specsChanged.emit(e)}}}t.KernelSpecManager=l},321:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.KernelSpecAPIClient=void 0;t.getSpecs=a;const i=n(1089);const s=n(79237);const o=n(37737);const r="api/kernelspecs";async function a(e=i.ServerConnection.makeSettings()){const t=o.URLExt.join(e.baseUrl,r);const n=await i.ServerConnection.makeRequest(t,{},e);if(n.status!==200){const e=await i.ServerConnection.ResponseError.create(n);throw e}const a=await n.json();return(0,s.validateSpecModels)(a)}class l{constructor(e={}){var t;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:i.ServerConnection.makeSettings()}async get(){return a(this.serverSettings)}}t.KernelSpecAPIClient=l},79237:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateSpecModel=s;t.validateSpecModels=o;const i=n(1480);function s(e){const t=e.spec;if(!t){throw new Error("Invalid kernel spec")}(0,i.validateProperty)(e,"name","string");(0,i.validateProperty)(e,"resources","object");(0,i.validateProperty)(t,"language","string");(0,i.validateProperty)(t,"display_name","string");(0,i.validateProperty)(t,"argv","array");let n=null;if(t.hasOwnProperty("metadata")){(0,i.validateProperty)(t,"metadata","object");n=t.metadata}let s=null;if(t.hasOwnProperty("env")){(0,i.validateProperty)(t,"env","object");s=t.env}return{name:e.name,resources:e.resources,language:t.language,display_name:t.display_name,argv:t.argv,metadata:n,env:s}}function o(e){if(!e.hasOwnProperty("kernelspecs")){throw new Error("No kernelspecs found")}let t=Object.keys(e.kernelspecs);const n=Object.create(null);let i=e.default;for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.ServiceManager=void 0;const i=n(2336);const s=n(44816);const o=n(97375);const r=n(1091);const a=n(14272);const l=n(76807);const d=n(93892);const c=n(1089);const h=n(86923);const u=n(95399);const p=n(67569);const m=n(18430);const g=n(90362);class f{constructor(e={}){var t,n;this._isDisposed=false;this._connectionFailure=new i.Signal(this);this._isReady=false;const f=e.defaultDrive;const v=(t=e.serverSettings)!==null&&t!==void 0?t:c.ServerConnection.makeSettings();const _=(n=e.standby)!==null&&n!==void 0?n:"when-hidden";const b={defaultDrive:f,serverSettings:v,standby:_};this.serverSettings=v;this.contents=e.contents||new o.ContentsManager(b);this.events=e.events||new r.EventManager(b);this.kernels=e.kernels||new a.KernelManager(b);this.sessions=e.sessions||new h.SessionManager({...b,kernelManager:this.kernels});this.settings=e.settings||new u.SettingManager(b);this.terminals=e.terminals||new p.TerminalManager(b);this.builder=e.builder||new s.BuildManager(b);this.workspaces=e.workspaces||new g.WorkspaceManager(b);this.nbconvert=e.nbconvert||new d.NbConvertManager(b);this.kernelspecs=e.kernelspecs||new l.KernelSpecManager(b);this.user=e.user||new m.UserManager(b);this.kernelspecs.connectionFailure.connect(this._onConnectionFailure,this);this.sessions.connectionFailure.connect(this._onConnectionFailure,this);this.terminals.connectionFailure.connect(this._onConnectionFailure,this);const y=[this.sessions.ready,this.kernelspecs.ready];if(this.terminals.isAvailable()){y.push(this.terminals.ready)}this._readyPromise=Promise.all(y).then((()=>{this._isReady=true}))}get connectionFailure(){return this._connectionFailure}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;i.Signal.clearData(this);this.contents.dispose();this.events.dispose();this.sessions.dispose();this.terminals.dispose()}get isReady(){return this._isReady}get ready(){return this._readyPromise}_onConnectionFailure(e,t){this._connectionFailure.emit(t)}}t.ServiceManager=f},93892:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.NbConvertManager=void 0;const i=n(37737);const s=n(1089);const o=n(5592);const r="api/nbconvert";class a{constructor(e={}){var t;this._exportFormats=null;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:s.ServerConnection.makeSettings()}async fetchExportFormats(){this._requestingFormats=new o.PromiseDelegate;this._exportFormats=null;const e=this.serverSettings.baseUrl;const t=i.URLExt.join(e,r);const{serverSettings:n}=this;const a=await s.ServerConnection.makeRequest(t,{},n);if(a.status!==200){const e=await s.ServerConnection.ResponseError.create(a);throw e}const l=await a.json();const d={};const c=Object.keys(l);c.forEach((function(e){const t=l[e].output_mimetype;d[e]={output_mimetype:t}}));this._exportFormats=d;this._requestingFormats.resolve(d);return d}async getExportFormats(e=true){if(this._requestingFormats){return this._requestingFormats.promise}if(e||!this._exportFormats){return await this.fetchExportFormats()}return this._exportFormats}}t.NbConvertManager=a},1089:(e,t,n)=>{"use strict";var i=n(65606);Object.defineProperty(t,"__esModule",{value:true});t.ServerConnection=void 0;const s=n(37737);const o=n(93962);let r;if(typeof window==="undefined"){r=n(36513)}else{r=WebSocket}var a;(function(e){function t(e){return l.makeSettings(e)}e.makeSettings=t;function n(e,t,n){return l.handleRequest(e,t,n)}e.makeRequest=n;class i extends Error{static async create(e){try{const t=await e.json();const{message:n,traceback:s}=t;if(s){console.error(s)}return new i(e,n!==null&&n!==void 0?n:i._defaultMessage(e),s!==null&&s!==void 0?s:"")}catch(t){console.debug(t);return new i(e)}}constructor(e,t=i._defaultMessage(e),n=""){super(t);this.response=e;this.traceback=n}static _defaultMessage(e){return`Invalid response: ${e.status} ${e.statusText}`}}e.ResponseError=i;class s extends TypeError{constructor(e){super(e.message);this.stack=e.stack}}e.NetworkError=s})(a||(t.ServerConnection=a={}));var l;(function(e){function t(e={}){var t;const n=s.PageConfig.getBaseUrl();const a=s.PageConfig.getWsUrl();const l=s.URLExt.normalize(e.baseUrl)||n;let d=e.wsUrl;if(!d&&l===n){d=a}if(!d&&l.indexOf("http")===0){d="ws"+l.slice(4)}d=d!==null&&d!==void 0?d:a;const c=s.PageConfig.getOption("appendToken").toLowerCase();let h;if(c===""){h=typeof window==="undefined"||typeof i!=="undefined"&&((t=i===null||i===void 0?void 0:i.env)===null||t===void 0?void 0:t.JEST_WORKER_ID)!==undefined||s.URLExt.getHostName(n)!==s.URLExt.getHostName(d)}else{h=c==="true"}return{init:{cache:"no-store",credentials:"same-origin"},fetch,Headers,Request,WebSocket:r,token:s.PageConfig.getToken(),appUrl:s.PageConfig.getOption("appUrl"),appendToken:h,serializer:{serialize:o.serialize,deserialize:o.deserialize},...e,baseUrl:l,wsUrl:d}}e.makeSettings=t;function n(e,t,n){var i;if(e.indexOf(n.baseUrl)!==0){throw new Error("Can only be used for notebook server requests")}const s=(i=t.cache)!==null&&i!==void 0?i:n.init.cache;if(s==="no-store"){e+=(/\?/.test(e)?"&":"?")+(new Date).getTime()}const o=new n.Request(e,{...n.init,...t});let r=false;if(n.token){r=true;o.headers.append("Authorization",`token ${n.token}`)}if(typeof document!=="undefined"){const e=l("_xsrf");if(e!==undefined){r=true;o.headers.append("X-XSRFToken",e)}}if(!o.headers.has("Content-Type")&&r){o.headers.set("Content-Type","application/json")}return n.fetch.call(null,o).catch((e=>{throw new a.NetworkError(e)}))}e.handleRequest=n;function l(e){let t="";try{t=document.cookie}catch(i){return}const n=t.match("\\b"+e+"=([^;]*)\\b");return n===null||n===void 0?void 0:n[1]}})(l||(l={}))},26830:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SessionConnection=void 0;const i=n(2336);const s=n(50608);const o=n(5592);const r=n(70637);class a{constructor(e){var t,n,a,l,d;this._id="";this._path="";this._name="";this._type="";this._kernel=null;this._isDisposed=false;this._disposed=new i.Signal(this);this._kernelChanged=new i.Signal(this);this._statusChanged=new i.Signal(this);this._connectionStatusChanged=new i.Signal(this);this._pendingInput=new i.Signal(this);this._iopubMessage=new i.Signal(this);this._unhandledMessage=new i.Signal(this);this._anyMessage=new i.Signal(this);this._propertyChanged=new i.Signal(this);this._id=e.model.id;this._name=e.model.name;this._path=e.model.path;this._type=e.model.type;this._username=(t=e.username)!==null&&t!==void 0?t:"";this._clientId=(n=e.clientId)!==null&&n!==void 0?n:o.UUID.uuid4();this._connectToKernel=e.connectToKernel;this._kernelConnectionOptions=(a=e.kernelConnectionOptions)!==null&&a!==void 0?a:{};this.serverSettings=(l=e.serverSettings)!==null&&l!==void 0?l:s.ServerConnection.makeSettings();this._sessionAPIClient=(d=e.sessionAPIClient)!==null&&d!==void 0?d:new r.SessionAPIClient({serverSettings:this.serverSettings});this.setupKernel(e.model.kernel)}get disposed(){return this._disposed}get kernelChanged(){return this._kernelChanged}get statusChanged(){return this._statusChanged}get connectionStatusChanged(){return this._connectionStatusChanged}get pendingInput(){return this._pendingInput}get iopubMessage(){return this._iopubMessage}get unhandledMessage(){return this._unhandledMessage}get anyMessage(){return this._anyMessage}get propertyChanged(){return this._propertyChanged}get id(){return this._id}get kernel(){return this._kernel}get path(){return this._path}get type(){return this._type}get name(){return this._name}get model(){return{id:this.id,kernel:this.kernel&&{id:this.kernel.id,name:this.kernel.name},path:this._path,type:this._type,name:this._name}}get isDisposed(){return this._isDisposed}update(e){const t=this.model;this._path=e.path;this._name=e.name;this._type=e.type;if(this._kernel===null&&e.kernel!==null||this._kernel!==null&&e.kernel===null||this._kernel!==null&&e.kernel!==null&&this._kernel.id!==e.kernel.id){if(this._kernel!==null){this._kernel.dispose()}const t=this._kernel||null;this.setupKernel(e.kernel);const n=this._kernel||null;this._kernelChanged.emit({name:"kernel",oldValue:t,newValue:n})}this._handleModelChange(t)}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._disposed.emit();if(this._kernel){this._kernel.dispose();const e=this._kernel;this._kernel=null;const t=this._kernel;this._kernelChanged.emit({name:"kernel",oldValue:e,newValue:t})}i.Signal.clearData(this)}async setPath(e){if(this.isDisposed){throw new Error("Session is disposed")}await this._patch({path:e})}async setName(e){if(this.isDisposed){throw new Error("Session is disposed")}await this._patch({name:e})}async setType(e){if(this.isDisposed){throw new Error("Session is disposed")}await this._patch({type:e})}async changeKernel(e){if(this.isDisposed){throw new Error("Session is disposed")}await this._patch({kernel:e});return this.kernel}async shutdown(){if(this.isDisposed){throw new Error("Session is disposed")}await this._sessionAPIClient.shutdown(this.id);this.dispose()}setupKernel(e){if(e===null){this._kernel=null;return}const t=this._connectToKernel({...this._kernelConnectionOptions,model:e,username:this._username,clientId:this._clientId,serverSettings:this.serverSettings});this._kernel=t;t.statusChanged.connect(this.onKernelStatus,this);t.connectionStatusChanged.connect(this.onKernelConnectionStatus,this);t.pendingInput.connect(this.onPendingInput,this);t.unhandledMessage.connect(this.onUnhandledMessage,this);t.iopubMessage.connect(this.onIOPubMessage,this);t.anyMessage.connect(this.onAnyMessage,this)}onKernelStatus(e,t){this._statusChanged.emit(t)}onKernelConnectionStatus(e,t){this._connectionStatusChanged.emit(t)}onPendingInput(e,t){this._pendingInput.emit(t)}onIOPubMessage(e,t){this._iopubMessage.emit(t)}onUnhandledMessage(e,t){this._unhandledMessage.emit(t)}onAnyMessage(e,t){this._anyMessage.emit(t)}async _patch(e){const t=await this._sessionAPIClient.update({...e,id:this._id});this.update(t);return t}_handleModelChange(e){if(e.name!==this._name){this._propertyChanged.emit("name")}if(e.type!==this._type){this._propertyChanged.emit("type")}if(e.path!==this._path){this._propertyChanged.emit("path")}}}t.SessionConnection=a},86923:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:true,value:t})}:function(e,t){e["default"]=t});var o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n in e)if(n!=="default"&&Object.prototype.hasOwnProperty.call(e,n))i(t,e,n);s(t,e);return t};var r=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))i(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});t.SessionAPI=t.Session=void 0;const a=o(n(82827));t.Session=a;const l=o(n(70637));t.SessionAPI=l;r(n(57740),t)},57740:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SessionManager=void 0;const i=n(26568);const s=n(2336);const o=n(1089);const r=n(5412);const a=n(26830);const l=n(70637);class d extends r.BaseManager{constructor(e){var t,n;super(e);this._isReady=false;this._sessionConnections=new Set;this._models=new Map;this._runningChanged=new s.Signal(this);this._connectionFailure=new s.Signal(this);this._connectToKernel=e=>this._kernelManager.connectTo(e);this._kernelManager=e.kernelManager;this._sessionAPIClient=(t=e.sessionAPIClient)!==null&&t!==void 0?t:new l.SessionAPIClient({serverSettings:e.serverSettings});this._pollModels=new i.Poll({auto:false,factory:()=>this.requestRunning(),frequency:{interval:10*1e3,backoff:true,max:300*1e3},name:`@jupyterlab/services:SessionManager#models`,standby:(n=e.standby)!==null&&n!==void 0?n:"when-hidden"});this._ready=(async()=>{await this._pollModels.start();await this._pollModels.tick;if(this._kernelManager.isActive){await this._kernelManager.ready}this._isReady=true})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){if(this.isDisposed){return}this._models.clear();this._sessionConnections.forEach((e=>e.dispose()));this._pollModels.dispose();super.dispose()}connectTo(e){const t=new a.SessionConnection({...e,connectToKernel:this._connectToKernel,serverSettings:this.serverSettings,sessionAPIClient:this._sessionAPIClient});this._onStarted(t);if(!this._models.has(e.model.id)){void this.refreshRunning().catch((()=>{}))}return t}running(){return this._models.values()}async refreshRunning(){await this._pollModels.refresh();await this._pollModels.tick}async startNew(e,t={}){const n=await this._sessionAPIClient.startNew(e);await this.refreshRunning();return this.connectTo({...t,model:n})}async shutdown(e){await this._sessionAPIClient.shutdown(e);await this.refreshRunning()}async shutdownAll(){await this.refreshRunning();await Promise.all([...this._models.keys()].map((e=>this._sessionAPIClient.shutdown(e))));await this.refreshRunning()}async stopIfNeeded(e){try{const t=await this._sessionAPIClient.listRunning();const n=t.filter((t=>t.path===e));if(n.length===1){const e=n[0].id;await this.shutdown(e)}}catch(t){}}async findById(e){if(this._models.has(e)){return this._models.get(e)}await this.refreshRunning();return this._models.get(e)}async findByPath(e){for(const t of this._models.values()){if(t.path===e){return t}}await this.refreshRunning();for(const t of this._models.values()){if(t.path===e){return t}}return undefined}async requestRunning(){var e,t;let n;try{n=await this._sessionAPIClient.listRunning()}catch(i){if(i instanceof o.ServerConnection.NetworkError||((e=i.response)===null||e===void 0?void 0:e.status)===503||((t=i.response)===null||t===void 0?void 0:t.status)===424){this._connectionFailure.emit(i)}throw i}if(this.isDisposed){return}if(this._models.size===n.length&&n.every((e=>{var t,n,i,s;const o=this._models.get(e.id);if(!o){return false}return((t=o.kernel)===null||t===void 0?void 0:t.id)===((n=e.kernel)===null||n===void 0?void 0:n.id)&&((i=o.kernel)===null||i===void 0?void 0:i.name)===((s=e.kernel)===null||s===void 0?void 0:s.name)&&o.name===e.name&&o.path===e.path&&o.type===e.type}))){return}this._models=new Map(n.map((e=>[e.id,e])));this._sessionConnections.forEach((e=>{if(this._models.has(e.id)){e.update(this._models.get(e.id))}else{e.dispose()}}));this._runningChanged.emit(n)}_onStarted(e){this._sessionConnections.add(e);e.disposed.connect(this._onDisposed,this);e.propertyChanged.connect(this._onChanged,this);e.kernelChanged.connect(this._onChanged,this)}_onDisposed(e){this._sessionConnections.delete(e);void this.refreshRunning().catch((()=>{}))}_onChanged(){void this.refreshRunning().catch((()=>{}))}}t.SessionManager=d;(function(e){class t extends e{constructor(){super(...arguments);this._readyPromise=new Promise((()=>{}))}get isActive(){return false}get parentReady(){return super.ready}async startNew(e,t={}){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}connectTo(e){throw Error("Not implemented in no-op Session Manager")}get ready(){return this.parentReady.then((()=>this._readyPromise))}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Session Manager"))}async requestRunning(){return Promise.resolve()}}e.NoopManager=t})(d||(t.SessionManager=d={}))},70637:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SessionAPIClient=t.SESSION_SERVICE_URL=void 0;t.listRunning=r;t.getSessionUrl=a;t.shutdownSession=l;t.getSessionModel=d;t.startSession=c;t.updateSession=h;const i=n(1089);const s=n(37737);const o=n(11521);t.SESSION_SERVICE_URL="api/sessions";async function r(e=i.ServerConnection.makeSettings()){const n=s.URLExt.join(e.baseUrl,t.SESSION_SERVICE_URL);const r=await i.ServerConnection.makeRequest(n,{},e);if(r.status!==200){const e=await i.ServerConnection.ResponseError.create(r);throw e}const a=await r.json();if(!Array.isArray(a)){throw new Error("Invalid Session list")}a.forEach((e=>{(0,o.updateLegacySessionModel)(e);(0,o.validateModel)(e)}));return a}function a(e,n){const i=s.URLExt.join(e,t.SESSION_SERVICE_URL);const o=s.URLExt.join(i,n);if(!o.startsWith(i)){throw new Error("Can only be used for services requests")}return o}async function l(e,t=i.ServerConnection.makeSettings()){var n;const s=a(t.baseUrl,e);const o={method:"DELETE"};const r=await i.ServerConnection.makeRequest(s,o,t);if(r.status===404){const t=await r.json();const i=(n=t.message)!==null&&n!==void 0?n:`The session "${e}"" does not exist on the server`;console.warn(i)}else if(r.status===410){throw new i.ServerConnection.ResponseError(r,"The kernel was deleted but the session was not")}else if(r.status!==204){const e=await i.ServerConnection.ResponseError.create(r);throw e}}async function d(e,t=i.ServerConnection.makeSettings()){const n=a(t.baseUrl,e);const s=await i.ServerConnection.makeRequest(n,{},t);if(s.status!==200){const e=await i.ServerConnection.ResponseError.create(s);throw e}const r=await s.json();(0,o.updateLegacySessionModel)(r);(0,o.validateModel)(r);return r}async function c(e,n=i.ServerConnection.makeSettings()){const r=s.URLExt.join(n.baseUrl,t.SESSION_SERVICE_URL);const a={method:"POST",body:JSON.stringify(e)};const l=await i.ServerConnection.makeRequest(r,a,n);if(l.status!==201){const e=await i.ServerConnection.ResponseError.create(l);throw e}const d=await l.json();(0,o.updateLegacySessionModel)(d);(0,o.validateModel)(d);return d}async function h(e,t=i.ServerConnection.makeSettings()){const n=a(t.baseUrl,e.id);const s={method:"PATCH",body:JSON.stringify(e)};const r=await i.ServerConnection.makeRequest(n,s,t);if(r.status!==200){const e=await i.ServerConnection.ResponseError.create(r);throw e}const l=await r.json();(0,o.updateLegacySessionModel)(l);(0,o.validateModel)(l);return l}class u{constructor(e){var t;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:i.ServerConnection.makeSettings()}async listRunning(){return r(this.serverSettings)}async getModel(e){return d(e,this.serverSettings)}async startNew(e){return c(e,this.serverSettings)}async shutdown(e){return l(e,this.serverSettings)}async update(e){return h(e,this.serverSettings)}}t.SessionAPIClient=u},82827:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},11521:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateModel=o;t.updateLegacySessionModel=r;t.validateModels=a;const i=n(38872);const s=n(1480);function o(e){(0,s.validateProperty)(e,"id","string");(0,s.validateProperty)(e,"type","string");(0,s.validateProperty)(e,"name","string");(0,s.validateProperty)(e,"path","string");(0,s.validateProperty)(e,"kernel","object");(0,i.validateModel)(e.kernel)}function r(e){if(e.path===undefined&&e.notebook!==undefined){e.path=e.notebook.path;e.type="notebook";e.name=""}}function a(e){if(!Array.isArray(e)){throw new Error("Invalid session list")}e.forEach((e=>o(e)))}},95399:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.SettingManager=void 0;const i=n(37737);const s=n(86503);const o=n(1089);const r="api/settings";class a extends s.DataConnector{constructor(e={}){var t;super();this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:o.ServerConnection.makeSettings()}async fetch(e){if(!e){throw new Error("Plugin `id` parameter is required for settings fetch.")}const{serverSettings:t}=this;const{baseUrl:n,appUrl:i}=t;const{makeRequest:s,ResponseError:r}=o.ServerConnection;const a=n+i;const d=l.url(a,e);const c=await s(d,{},t);if(c.status!==200){const e=await r.create(c);throw e}return c.json()}async list(e){var t,n,i,s;const{serverSettings:r}=this;const{baseUrl:a,appUrl:d}=r;const{makeRequest:c,ResponseError:h}=o.ServerConnection;const u=a+d;const p=l.url(u,"",e==="ids");const m=await c(p,{},r);if(m.status!==200){throw new h(m)}const g=await m.json();const f=(n=(t=g===null||g===void 0?void 0:g["settings"])===null||t===void 0?void 0:t.map((e=>e.id)))!==null&&n!==void 0?n:[];let v=[];if(!e){v=(s=(i=g===null||g===void 0?void 0:g["settings"])===null||i===void 0?void 0:i.map((e=>{e.data={composite:{},user:{}};return e})))!==null&&s!==void 0?s:[]}return{ids:f,values:v}}async save(e,t){const{serverSettings:n}=this;const{baseUrl:i,appUrl:s}=n;const{makeRequest:r,ResponseError:a}=o.ServerConnection;const d=i+s;const c=l.url(d,e);const h={body:JSON.stringify({raw:t}),method:"PUT"};const u=await r(c,h,n);if(u.status!==204){throw new a(u)}}}t.SettingManager=a;var l;(function(e){function t(e,t,n){const s=n?i.URLExt.objectToQueryString({ids_only:true}):"";const o=i.URLExt.join(e,r);const a=i.URLExt.join(o,t);if(!a.startsWith(o)){throw new Error("Can only be used for workspaces requests")}return`${a}${s}`}e.url=t})(l||(l={}))},12100:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TerminalConnection=void 0;const i=n(37737);const s=n(5592);const o=n(2336);const r=n(50608);const a=n(84903);class l{constructor(e){var t,n;this._createSocket=()=>{this._errorIfDisposed();this._clearSocket();this._updateConnectionStatus("connecting");const e=this._name;const t=this.serverSettings;let n=i.URLExt.join(t.wsUrl,"terminals","websocket",encodeURIComponent(e));const s=t.token;if(t.appendToken&&s!==""){n=n+`?token=${encodeURIComponent(s)}`}this._ws=new t.WebSocket(n);this._ws.onmessage=this._onWSMessage;this._ws.onclose=this._onWSClose;this._ws.onerror=this._onWSClose};this._onWSMessage=e=>{if(this._isDisposed){return}const t=JSON.parse(e.data);if(t[0]==="disconnect"){this.dispose()}if(this._connectionStatus==="connecting"){if(t[0]==="setup"){this._updateConnectionStatus("connected")}return}this._messageReceived.emit({type:t[0],content:t.slice(1)})};this._onWSClose=e=>{console.warn(`Terminal websocket closed: ${e.code}`);if(!this.isDisposed){this._reconnect()}};this._connectionStatus="connecting";this._connectionStatusChanged=new o.Signal(this);this._isDisposed=false;this._disposed=new o.Signal(this);this._messageReceived=new o.Signal(this);this._reconnectTimeout=null;this._ws=null;this._noOp=()=>{};this._reconnectLimit=7;this._reconnectAttempt=0;this._pendingMessages=[];this._name=e.model.name;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:r.ServerConnection.makeSettings();this._terminalAPIClient=(n=e.terminalAPIClient)!==null&&n!==void 0?n:new a.TerminalAPIClient({serverSettings:this.serverSettings});this._createSocket()}get disposed(){return this._disposed}get messageReceived(){return this._messageReceived}get name(){return this._name}get model(){return{name:this._name}}get isDisposed(){return this._isDisposed}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._disposed.emit();this._updateConnectionStatus("disconnected");this._clearSocket();o.Signal.clearData(this)}send(e){this._sendMessage(e)}_sendMessage(e,t=true){if(this._isDisposed||!e.content){return}if(this.connectionStatus==="connected"&&this._ws){const t=[e.type,...e.content];this._ws.send(JSON.stringify(t))}else if(t){this._pendingMessages.push(e)}else{throw new Error(`Could not send message: ${JSON.stringify(e)}`)}}_sendPending(){while(this.connectionStatus==="connected"&&this._pendingMessages.length>0){this._sendMessage(this._pendingMessages[0],false);this._pendingMessages.shift()}}reconnect(){this._errorIfDisposed();const e=new s.PromiseDelegate;const t=(n,i)=>{if(i==="connected"){e.resolve();this.connectionStatusChanged.disconnect(t,this)}else if(i==="disconnected"){e.reject(new Error("Terminal connection disconnected"));this.connectionStatusChanged.disconnect(t,this)}};this.connectionStatusChanged.connect(t,this);this._reconnectAttempt=0;this._reconnect();return e.promise}_reconnect(){this._errorIfDisposed();clearTimeout(this._reconnectTimeout);if(this._reconnectAttempt{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TerminalManager=void 0;const i=n(26568);const s=n(2336);const o=n(50608);const r=n(5412);const a=n(84903);const l=n(12100);class d extends r.BaseManager{constructor(e={}){var t,n;super(e);this._isReady=false;this._names=[];this._terminalConnections=new Set;this._runningChanged=new s.Signal(this);this._connectionFailure=new s.Signal(this);this._terminalAPIClient=(t=e.terminalAPIClient)!==null&&t!==void 0?t:new a.TerminalAPIClient({serverSettings:this.serverSettings});if(!this.isAvailable()){this._ready=Promise.reject("Terminals unavailable");this._ready.catch((e=>undefined));return}this._pollModels=new i.Poll({auto:false,factory:()=>this.requestRunning(),frequency:{interval:10*1e3,backoff:true,max:300*1e3},name:`@jupyterlab/services:TerminalManager#models`,standby:(n=e.standby)!==null&&n!==void 0?n:"when-hidden"});this._ready=(async()=>{await this._pollModels.start();await this._pollModels.tick;this._isReady=true})()}get isReady(){return this._isReady}get ready(){return this._ready}get runningChanged(){return this._runningChanged}get connectionFailure(){return this._connectionFailure}dispose(){if(this.isDisposed){return}this._names.length=0;this._terminalConnections.forEach((e=>e.dispose()));this._pollModels.dispose();super.dispose()}isAvailable(){return this._terminalAPIClient.isAvailable}connectTo(e){const t=new l.TerminalConnection({...e,serverSettings:this.serverSettings,terminalAPIClient:this._terminalAPIClient});this._onStarted(t);if(!this._names.includes(e.model.name)){void this.refreshRunning().catch((()=>{}))}return t}running(){return this._models[Symbol.iterator]()}async refreshRunning(){await this._pollModels.refresh();await this._pollModels.tick}async startNew(e={}){const{name:t,cwd:n}=e;const i=await this._terminalAPIClient.startNew({name:t,cwd:n});await this.refreshRunning();return this.connectTo({model:i})}async shutdown(e){await this._terminalAPIClient.shutdown(e);await this.refreshRunning()}async shutdownAll(){await this.refreshRunning();await Promise.all(this._names.map((e=>this._terminalAPIClient.shutdown(e))));await this.refreshRunning()}async requestRunning(){var e,t;let n;try{n=await this._terminalAPIClient.listRunning()}catch(s){if(s instanceof o.ServerConnection.NetworkError||((e=s.response)===null||e===void 0?void 0:e.status)===503||((t=s.response)===null||t===void 0?void 0:t.status)===424){this._connectionFailure.emit(s)}throw s}if(this.isDisposed){return}const i=n.map((({name:e})=>e)).sort();if(i===this._names){return}this._names=i;this._terminalConnections.forEach((e=>{if(!i.includes(e.name)){e.dispose()}}));this._runningChanged.emit(this._models)}_onStarted(e){this._terminalConnections.add(e);e.disposed.connect(this._onDisposed,this)}_onDisposed(e){this._terminalConnections.delete(e);void this.refreshRunning().catch((()=>{}))}get _models(){return this._names.map((e=>({name:e})))}}t.TerminalManager=d;(function(e){class t extends e{constructor(){super(...arguments);this._readyPromise=new Promise((()=>{}))}get isActive(){return false}get parentReady(){return super.ready}get ready(){return this.parentReady.then((()=>this._readyPromise))}async startNew(e){return Promise.reject(new Error("Not implemented in no-op Terminal Manager"))}connectTo(e){throw Error("Not implemented in no-op Terminal Manager")}async shutdown(e){return Promise.reject(new Error("Not implemented in no-op Terminal Manager"))}async requestRunning(){return Promise.resolve()}}e.NoopManager=t})(d||(t.TerminalManager=d={}))},84903:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.TerminalAPIClient=t.TERMINAL_SERVICE_URL=void 0;t.isAvailable=o;t.startNew=r;t.listRunning=a;t.shutdownTerminal=l;const i=n(37737);const s=n(1089);t.TERMINAL_SERVICE_URL="api/terminals";function o(){const e=String(i.PageConfig.getOption("terminalsAvailable"));return e.toLowerCase()==="true"}async function r(e=s.ServerConnection.makeSettings(),n,o){c.errorIfNotAvailable();const r=i.URLExt.join(e.baseUrl,t.TERMINAL_SERVICE_URL);const a={method:"POST",body:JSON.stringify({name:n,cwd:o})};const l=await s.ServerConnection.makeRequest(r,a,e);if(l.status!==200){const e=await s.ServerConnection.ResponseError.create(l);throw e}const d=await l.json();return d}async function a(e=s.ServerConnection.makeSettings()){c.errorIfNotAvailable();const n=i.URLExt.join(e.baseUrl,t.TERMINAL_SERVICE_URL);const o=await s.ServerConnection.makeRequest(n,{},e);if(o.status!==200){const e=await s.ServerConnection.ResponseError.create(o);throw e}const r=await o.json();if(!Array.isArray(r)){throw new Error("Invalid terminal list")}return r}async function l(e,n=s.ServerConnection.makeSettings()){var o;c.errorIfNotAvailable();const r=i.URLExt.join(n.baseUrl,t.TERMINAL_SERVICE_URL);const a=i.URLExt.join(r,e);if(!a.startsWith(r)){throw new Error("Can only be used for terminal requests")}const l={method:"DELETE"};const d=await s.ServerConnection.makeRequest(a,l,n);if(d.status===404){const t=await d.json();const n=(o=t.message)!==null&&o!==void 0?o:`The terminal session "${e}"" does not exist on the server`;console.warn(n)}else if(d.status!==204){const e=await s.ServerConnection.ResponseError.create(d);throw e}}class d{constructor(e={}){var t;this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:s.ServerConnection.makeSettings()}get isAvailable(){return o()}async startNew(e={}){const{name:t,cwd:n}=e;return r(this.serverSettings,t,n)}async listRunning(){return a(this.serverSettings)}async shutdown(e){return l(e,this.serverSettings)}}t.TerminalAPIClient=d;var c;(function(e){function t(){if(!o()){throw new Error("Terminals Unavailable")}}e.errorIfNotAvailable=t})(c||(c={}))},88917:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.isAvailable=void 0;const i=n(84903);Object.defineProperty(t,"isAvailable",{enumerable:true,get:function(){return i.isAvailable}})},80856:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.IWorkspaceManager=t.IUserManager=t.ITerminalManager=t.IServiceManager=t.ISettingManager=t.ISessionManager=t.IServerSettings=t.INbConvertManager=t.IKernelSpecManager=t.IKernelManager=t.IEventManager=t.IDefaultDrive=t.IContentsManager=t.IConfigSectionManager=t.IConnectionStatus=void 0;const i=n(5592);t.IConnectionStatus=new i.Token("@jupyterlab/application:IConnectionStatus","A service providing the application connection status.");t.IConfigSectionManager=new i.Token("@jupyterlab/services:IConfigSectionManager","A service providing the config section manager.");t.IContentsManager=new i.Token("@jupyterlab/services:IContentsManager","The contents manager token.");t.IDefaultDrive=new i.Token("@jupyterlab/services:IDefaultDrive","The default drive for the contents manager.");t.IEventManager=new i.Token("@jupyterlab/services:IEventManager","The event manager token.");t.IKernelManager=new i.Token("@jupyterlab/services:IKernelManager","The kernel manager token.");t.IKernelSpecManager=new i.Token("@jupyterlab/services:IKernelSpecManager","The kernel spec manager token.");t.INbConvertManager=new i.Token("@jupyterlab/services:INbConvertManager","The nbconvert manager token.");t.IServerSettings=new i.Token("@jupyterlab/services:IServerSettings","The server settings for the application.");t.ISessionManager=new i.Token("@jupyterlab/services:ISessionManager","The session manager token.");t.ISettingManager=new i.Token("@jupyterlab/services:ISettingManager","The setting manager token.");t.IServiceManager=new i.Token("@jupyterlab/services:IServiceManager","The service manager for the application.");t.ITerminalManager=new i.Token("@jupyterlab/services:ITerminalManager","The terminal manager token.");t.IUserManager=new i.Token("@jupyterlab/services:IUserManager","The user manager token.");t.IWorkspaceManager=new i.Token("@jupyterlab/services:IWorkspaceManager","The workspace manager token.")},18430:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.UserManager=void 0;const i=n(37737);const s=n(5592);const o=n(26568);const r=n(2336);const a=n(1089);const l=n(5412);const d="api/me";const c="@jupyterlab/services:UserManager#user";class h extends l.BaseManager{constructor(e={}){var t;super(e);this._isReady=false;this._userChanged=new r.Signal(this);this._connectionFailure=new r.Signal(this);this._ready=this.requestUser().then((()=>{if(this.isDisposed){return}this._isReady=true})).catch((e=>new Promise((()=>{}))));this._pollSpecs=new o.Poll({auto:false,factory:()=>this.requestUser(),frequency:{interval:61*1e3,backoff:true,max:300*1e3},name:c,standby:(t=e.standby)!==null&&t!==void 0?t:"when-hidden"});void this.ready.then((()=>{void this._pollSpecs.start()}))}get isReady(){return this._isReady}get ready(){return this._ready}get identity(){return this._identity}get permissions(){return this._permissions}get userChanged(){return this._userChanged}get connectionFailure(){return this._connectionFailure}dispose(){this._pollSpecs.dispose();super.dispose()}async refreshUser(){await this._pollSpecs.refresh();await this._pollSpecs.tick}async requestUser(){if(this.isDisposed){return}const{baseUrl:e}=this.serverSettings;const{makeRequest:t,ResponseError:n}=a.ServerConnection;const o=i.URLExt.join(e,d);const r=await t(o,{},this.serverSettings);if(r.status!==200){const e=await n.create(r);throw e}const l={identity:this._identity,permissions:this._permissions};const h=await r.json();const p=h.identity;const{localStorage:m}=window;const g=m.getItem(c);if(g&&(!p.initials||!p.color)){const e=JSON.parse(g);p.initials=p.initials||e.initials||p.name.substring(0,1);p.color=p.color||e.color||u.getRandomColor()}if(!s.JSONExt.deepEqual(h,l)){this._identity=p;this._permissions=h.permissions;m.setItem(c,JSON.stringify(p));this._userChanged.emit(h)}}}t.UserManager=h;var u;(function(e){const t=["var(--jp-collaborator-color1)","var(--jp-collaborator-color2)","var(--jp-collaborator-color3)","var(--jp-collaborator-color4)","var(--jp-collaborator-color5)","var(--jp-collaborator-color6)","var(--jp-collaborator-color7)"];e.getRandomColor=()=>t[Math.floor(Math.random()*t.length)]})(u||(u={}))},1480:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.validateProperty=n;function n(e,t,n,i=[]){if(!e.hasOwnProperty(t)){throw Error(`Missing property '${t}'`)}const s=e[t];if(n!==void 0){let e=true;switch(n){case"array":e=Array.isArray(s);break;case"object":e=typeof s!=="undefined";break;default:e=typeof s===n}if(!e){throw new Error(`Property '${t}' is not of type '${n}'`)}if(i.length>0){let e=true;switch(n){case"string":case"number":case"boolean":e=i.includes(s);break;default:e=i.findIndex((e=>e===s))>=0;break}if(!e){throw new Error(`Property '${t}' is not one of the valid values ${JSON.stringify(i)}`)}}}}},90362:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.WorkspaceManager=void 0;const i=n(37737);const s=n(86503);const o=n(1089);const r="api/workspaces";class a extends s.DataConnector{constructor(e={}){var t;super();this.serverSettings=(t=e.serverSettings)!==null&&t!==void 0?t:o.ServerConnection.makeSettings()}async fetch(e){const{serverSettings:t}=this;const{baseUrl:n,appUrl:i}=t;const{makeRequest:s,ResponseError:r}=o.ServerConnection;const a=n+i;const d=l.url(a,e);const c=await s(d,{},t);if(c.status!==200){const e=await r.create(c);throw e}return c.json()}async list(){const{serverSettings:e}=this;const{baseUrl:t,appUrl:n}=e;const{makeRequest:i,ResponseError:s}=o.ServerConnection;const r=t+n;const a=l.url(r,"");const d=await i(a,{},e);if(d.status!==200){const e=await s.create(d);throw e}const c=await d.json();return c.workspaces}async remove(e){const{serverSettings:t}=this;const{baseUrl:n,appUrl:i}=t;const{makeRequest:s,ResponseError:r}=o.ServerConnection;const a=n+i;const d=l.url(a,e);const c={method:"DELETE"};const h=await s(d,c,t);if(h.status!==204){const e=await r.create(h);throw e}}async save(e,t){const{serverSettings:n}=this;const{baseUrl:i,appUrl:s}=n;const{makeRequest:r,ResponseError:a}=o.ServerConnection;const d=i+s;const c=l.url(d,e);const h={body:JSON.stringify(t),method:"PUT"};const u=await r(c,h,n);if(u.status!==204){const e=await a.create(u);throw e}}}t.WorkspaceManager=a;var l;(function(e){function t(e,t){const n=i.URLExt.join(e,r);const s=i.URLExt.join(n,t);if(!s.startsWith(n)){throw new Error("Can only be used for workspaces requests")}return s}e.url=t})(l||(l={}))},34194:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>S});var i=n(74991);var s=n(72050);var o=n(98335);var r=n(66127);var a=n(90943);var l=n(667);var d=n(12063);var c=n(15615);var h=n(86503);var u=n(61927);var p=n(44914);var m=n.n(p);const g=e=>{const t=e.translator.load("jupyterlab");const[n,i]=(0,p.useState)(e.importedSettings.reduce(((e,t)=>{e[t]=true;return e}),{}));const s=(e,t)=>{const s={...n,[e]:t};i(s)};return m().createElement("div",{className:"jp-SettingsImport-container"},m().createElement("div",{className:"jp-SettingsImport-header"},m().createElement("span",{className:"jp-SettingsImport-title"},t.__("Select settings sections to import")),m().createElement("button",{className:"jp-Button jp-mod-styled jp-mod-accept",onClick:()=>{e.handleImport(Object.keys(n).filter((e=>!n[e])))}},t.__("Import"))),m().createElement("div",{className:"jp-SettingsImport-list"},e.importedSettings.map((e=>m().createElement("label",{key:e,className:"jp-SettingsImport-item"},m().createElement("span",{className:"jp-SettingsImport-itemKey"},e),m().createElement("input",{type:"checkbox",checked:n[e],onChange:t=>s(e,t.target.checked),className:"jp-SettingsImport-checkbox"}))))))};class f extends r.ReactWidget{constructor(e){const{importedSettings:t,handleImport:n,translator:i}=e;super();this.importedSettings=t;this.handleImport=n;this.addClass("jp-SettingsImport-widget");this.translator=i}render(){return m().createElement(g,{importedSettings:this.importedSettings,handleImport:this.handleImport,translator:this.translator})}}const v=e=>m().createElement("div",null,m().createElement("div",null,e.successMessage),e.failureMessage&&m().createElement("div",null,m().createElement("br",null),m().createElement("div",null,e.failureMessage),e.failedSettings&&e.failedSettings.map(((e,t)=>m().createElement("div",{key:t},e)))));class _ extends r.ReactWidget{constructor(e){super();this._props=e}render(){return m().createElement(v,{...this._props})}}var b;(function(e){e.open="settingeditor:open";e.openJSON="settingeditor:open-json";e.revert="settingeditor:revert";e.save="settingeditor:save";e.exportSettings="settingeditor:export";e.importSettings="settingeditor:import"})(b||(b={}));const y={id:"@jupyterlab/settingeditor-extension:form-ui",description:"Adds the interactive settings editor and provides its tracker.",requires:[c.ISettingRegistry,h.IStateDB,u.ITranslator,r.IFormRendererRegistry,i.ILabStatus],optional:[i.ILayoutRestorer,s.ICommandPalette,l.F,d.IPluginManager],autoStart:true,provides:l.z,activate:w};function w(e,t,i,o,a,l,d,c,h,u){const p=o.load("jupyterlab");const{commands:m,shell:g}=e;const f="setting-editor";const v=new s.WidgetTracker({namespace:f});if(d){void d.restore(v,{command:b.open,args:e=>({}),name:e=>f})}const _=async e=>{if(v.currentWidget&&!v.currentWidget.isDisposed){if(!v.currentWidget.isAttached){g.add(v.currentWidget,"main",{type:"Settings"})}g.activateById(v.currentWidget.id);if(e.query){v.currentWidget.content.updateQuery(e.query)}return}const d=y.id;const{SettingsEditor:c}=await n.e(9015).then(n.t.bind(n,59015,23));const _=new s.MainAreaWidget({content:new c({editorRegistry:a,key:d,registry:t,state:i,commands:m,toSkip:["@jupyterlab/application-extension:context-menu","@jupyterlab/mainmenu-extension:plugin"],translator:o,status:l,query:e.query})});_.toolbar.addItem("export-settings",new r.CommandToolbarButton({commands:m,id:b.exportSettings,icon:r.downloadIcon,label:p.__("Export"),caption:p.__("Export settings to a JSON file")}));_.toolbar.addItem("import-settings",new r.CommandToolbarButton({commands:m,id:b.importSettings,icon:r.fileUploadIcon,label:p.__("Import"),caption:p.__("Import settings from a JSON file")}));_.toolbar.addItem("spacer",r.Toolbar.createSpacerItem());if(u){_.toolbar.addItem("open-plugin-manager",new r.ToolbarButton({onClick:async()=>{await u.open()},icon:r.launchIcon,label:p.__("Plugin Manager")}))}if(h){_.toolbar.addItem("open-json-editor",new r.CommandToolbarButton({commands:m,id:b.openJSON,icon:r.launchIcon,label:p.__("JSON Settings Editor")}))}_.id=f;_.title.icon=r.settingsIcon;_.title.label=p.__("Settings");_.title.closable=true;void v.add(_);g.add(_,"main",{type:"Settings"})};m.addCommand(b.open,{execute:async e=>{var n;if(e.settingEditorType==="ui"){void m.execute(b.open,{query:(n=e.query)!==null&&n!==void 0?n:""})}else if(e.settingEditorType==="json"){void m.execute(b.openJSON)}else{void t.load(y.id).then((t=>{var n;t.get("settingEditorType").composite==="json"?void m.execute(b.openJSON):void _({query:(n=e.query)!==null&&n!==void 0?n:""})}))}},label:e=>{if(e.label){return e.label}return p.__("Settings Editor")}});if(c){c.addItem({category:p.__("Settings"),command:b.open,args:{settingEditorType:"ui"}})}return v}const C={id:"@jupyterlab/settingeditor-extension:plugin",description:"Adds the JSON settings editor and provides its tracker.",requires:[c.ISettingRegistry,o.IEditorServices,h.IStateDB,a.IRenderMimeRegistry,i.ILabStatus,u.ITranslator],optional:[i.ILayoutRestorer,s.ICommandPalette],autoStart:true,provides:l.F,activate:x};function x(e,t,i,o,a,l,d,c,h){const u=d.load("jupyterlab");const{commands:p,shell:m}=e;const g="json-setting-editor";const v=i.factoryService;const w=v.newInlineEditor;const C=new s.WidgetTracker({namespace:g});if(c){void c.restore(C,{command:b.openJSON,args:e=>({}),name:e=>g})}p.addCommand(b.openJSON,{execute:async()=>{if(C.currentWidget&&!C.currentWidget.isDisposed){if(!C.currentWidget.isAttached){m.add(C.currentWidget,"main",{type:"Advanced Settings"})}m.activateById(C.currentWidget.id);return}const i=y.id;const c=e.restored;const{JsonSettingEditor:h}=await n.e(9015).then(n.t.bind(n,59015,23));const f=new h({commands:{registry:p,revert:b.revert,save:b.save},editorFactory:w,key:i,registry:t,rendermime:a,state:o,translator:d,when:c});let v=null;f.commandsChanged.connect(((e,t)=>{t.forEach((e=>{p.notifyCommandChanged(e)}));if(f.canSaveRaw){if(!v){v=l.setDirty()}}else if(v){v.dispose();v=null}f.disposed.connect((()=>{if(v){v.dispose()}}))}));const _=new s.MainAreaWidget({content:f});_.id=g;_.title.icon=r.settingsIcon;_.title.label=u.__("Advanced Settings Editor");_.title.closable=true;void C.add(_);m.add(_,"main",{type:"Advanced Settings"})},label:u.__("Advanced Settings Editor")});if(h){h.addItem({category:u.__("Settings"),command:b.openJSON})}p.addCommand(b.revert,{execute:()=>{var e;(e=C.currentWidget)===null||e===void 0?void 0:e.content.revert()},icon:r.undoIcon,label:u.__("Revert User Settings"),isEnabled:()=>{var e,t;return(t=(e=C.currentWidget)===null||e===void 0?void 0:e.content.canRevertRaw)!==null&&t!==void 0?t:false}});p.addCommand(b.save,{execute:()=>{var e;return(e=C.currentWidget)===null||e===void 0?void 0:e.content.save()},icon:r.saveIcon,label:u.__("Save User Settings"),isEnabled:()=>{var e,t;return(t=(e=C.currentWidget)===null||e===void 0?void 0:e.content.canSaveRaw)!==null&&t!==void 0?t:false}});p.addCommand(b.exportSettings,{execute:()=>{const e=x(t);const n=JSON.stringify(e,null,2);S(n,"overrides.json")},label:u.__("Export Settings"),icon:r.downloadIcon});p.addCommand(b.importSettings,{execute:()=>{const n=document.createElement("input");n.type="file";n.accept=".json";const i=4;n.addEventListener("change",(async n=>{var o;const a=(o=n.target.files)===null||o===void 0?void 0:o[0];if(!a){return}try{const n=await a.text();const o=JSON.parse(n);if(typeof o!=="object"||Array.isArray(o)){throw new Error("Invalid settings file format")}const l=[];const c=async n=>{var r;const a=Object.entries(o);for(const[e,s]of a){if(typeof s==="object"&&!Array.isArray(s)){try{await t.upload(e,JSON.stringify(s,undefined,i))}catch(d){console.warn(`Failed to save settings for ${e}:`,d);l.push(e)}}else{console.warn(`Invalid settings for plugin ${e}. Skipping.`)}}(r=e.shell.currentWidget)===null||r===void 0?void 0:r.close();if(a.length){const e=a.length-l.length;const t=u.__(`Imported settings across ${e} ${e===1?"category":"categories"} successfully.`);const n=l.length?u.__(`Failed to upload settings for the following ${l.length} ${l.length===1?"plugin":"plugins"}`):"";const i=new _({successMessage:t,failureMessage:n,failedSettings:l});await(0,s.showDialog)({title:u.__("Settings Imported"),body:i,buttons:[s.Dialog.okButton()]})}};const h=Object.keys(o);const p=new f({importedSettings:h,handleImport:c,translator:d});const m=new s.MainAreaWidget({content:p});m.title.label=u.__("Import Settings");m.title.icon=r.fileUploadIcon;e.shell.add(m,"main");e.shell.activateById(m.id)}catch(l){await(0,s.showErrorMessage)("Failed to import settings",l)}}));n.click()},label:u.__("Import Settings"),icon:r.fileUploadIcon});function x(e){const t={};for(const[i,s]of Object.entries(e.plugins)){if(s){try{if(s.raw){const e=s.raw.replace(/\/\/.*$/gm,"");const n=e.replace(/\/\*[\s\S]*?\*\//g,"");const o=JSON.parse(n);if(Object.keys(o).length>0){t[i]=o}}}catch(n){console.error(`Error loading settings for plugin ${i}:`,n)}}}return t}function S(e,t){const n=new Blob([e],{type:"application/json"});const i=URL.createObjectURL(n);const s=document.createElement("a");s.href=i;s.download=t;document.body.appendChild(s);s.click();document.body.removeChild(s);URL.revokeObjectURL(i)}return C}const S=[y,C]},40779:(e,t,n)=>{"use strict";var i=n(40662);var s=n(97913);var o=n(17325);var r=n(5893);var a=n(3579);var l=n(14383);var d=n(10395);var c=n(52638);var h=n(85072);var u=n.n(h);var p=n(97825);var m=n.n(p);var g=n(77659);var f=n.n(g);var v=n(55056);var _=n.n(v);var b=n(10540);var y=n.n(b);var w=n(41113);var C=n.n(w);var x=n(45453);var S={};S.styleTagTransform=C();S.setAttributes=_();S.insert=f().bind(null,"head");S.domAPI=m();S.insertStyleElement=y();var k=u()(x.A,S);const j=x.A&&x.A.locals?x.A.locals:undefined},33296:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IJSONSettingEditorTracker:()=>H.F,ISettingEditorTracker:()=>H.z,JsonSettingEditor:()=>F,SettingsEditor:()=>x});var i=n(72050);var s=n(61927);var o=n(66127);var r=n(2336);var a=n(1143);var l=n(44914);var d=n.n(l);var c=n(34236);var h=n(5592);const u="jupyter.lab.setting-icon";const p="jupyter.lab.setting-icon-class";const m="jupyter.lab.setting-icon-label";class g extends i.ReactWidget{constructor(e){var t,n;super();this._changed=new r.Signal(this);this._handleSelectSignal=new r.Signal(this);this._updateFilterSignal=new r.Signal(this);this._scrollTop=0;this._selection="";this._registry=this.registry=e.registry;this.translator=e.translator||s.nullTranslator;this.addClass("jp-PluginList");this._confirm=e.confirm;this._model=(t=e.model)!==null&&t!==void 0?t:new g.Model(e);this._model.ready.then((()=>{this.update();this._model.changed.connect((()=>{this.update()}))})).catch((e=>{console.error(`Failed to load the plugin list model:\n${e}`)}));this.mapPlugins=this.mapPlugins.bind(this);this.setFilter=this.setFilter.bind(this);this.setFilter(e.query?(0,o.updateFilterFunction)(e.query,false,false):null);this.setError=this.setError.bind(this);this._evtMousedown=this._evtMousedown.bind(this);this._query=(n=e.query)!==null&&n!==void 0?n:"";this._errors={}}get changed(){return this._changed}get scrollTop(){var e;return(e=this.node.querySelector("ul"))===null||e===void 0?void 0:e.scrollTop}get hasErrors(){for(const e in this._errors){if(this._errors[e]){return true}}return false}get filter(){return this._filter}get selection(){return this._selection}set selection(e){this._selection=e;this.update()}get updateFilterSignal(){return this._updateFilterSignal}get handleSelectSignal(){return this._handleSelectSignal}onUpdateRequest(e){const t=this.node.querySelector("ul");if(t&&this._scrollTop!==undefined){t.scrollTop=this._scrollTop}super.onUpdateRequest(e)}_evtMousedown(e){const t=e.currentTarget;const n=t.getAttribute("data-id");if(!n){return}if(this._confirm){this._confirm(n).then((()=>{this.selection=n;this._changed.emit(undefined);this.update()})).catch((()=>{}))}else{this._scrollTop=this.scrollTop;this._selection=n;this._handleSelectSignal.emit(n);this._changed.emit(undefined);this.update()}}getHint(e,t,n){let i=n.data.user[e];if(!i){i=n.data.composite[e]}if(!i){i=n.schema[e]}if(!i){const{properties:n}=t.schema;i=n&&n[e]&&n[e].default}return typeof i==="string"?i:""}getFilterString(e,t,n,i){var s;if(i&&n){i=i.replace("#/definitions/","");t=(s=n[i])!==null&&s!==void 0?s:{}}if(t.properties){t=t.properties}else if(t.items){t=t.items}else{return[]}if(t["$ref"]){return this.getFilterString(e,t,n,t["$ref"])}if(Object.keys(t).length===0){return[]}return Object.keys(t).reduce(((i,s)=>{var o,r;const a=t[s];if(!a){if(e((o=t.title)!==null&&o!==void 0?o:"")){return t.title}if(e(s)){return s}}if(e((r=a.title)!==null&&r!==void 0?r:"")){i.push(a.title)}if(e(s)){i.push(s)}i.concat(this.getFilterString(e,a,n,a["$ref"]));return i}),[])}setFilter(e,t){if(e){this._filter=t=>{var n,i;if(!e||e((n=t.schema.title)!==null&&n!==void 0?n:"")){return null}const s=this.getFilterString(e,(i=t.schema)!==null&&i!==void 0?i:{},t.schema.definitions);return s}}else{this._filter=null}this._query=t;this._updateFilterSignal.emit(this._filter);this.update()}setError(e,t){if(this._errors[e]!==t){this._errors[e]=t;this.update()}else{this._errors[e]=t}}mapPlugins(e){var t,n,i,s;const{id:r,schema:a,version:l}=e;const h=this.translator.load("jupyterlab");const g=typeof a.title==="string"?h._p("schema",a.title):r;const f=c.StringExt.matchSumOfSquares(g.toLocaleLowerCase(),(n=(t=this._query)===null||t===void 0?void 0:t.toLocaleLowerCase())!==null&&n!==void 0?n:"");const v=c.StringExt.highlight(g,(i=f===null||f===void 0?void 0:f.indices)!==null&&i!==void 0?i:[],(e=>d().createElement("mark",null,e)));const _=typeof a.description==="string"?h._p("schema",a.description):"";const b=`${_}\n${r}\n${l}`;const y=this.getHint(u,this._registry,e);const w=this.getHint(p,this._registry,e);const C=this.getHint(m,this._registry,e);const x=this._filter?(s=this._filter(e))===null||s===void 0?void 0:s.map((e=>{var t,n,i;const s=c.StringExt.matchSumOfSquares(e.toLocaleLowerCase(),(n=(t=this._query)===null||t===void 0?void 0:t.toLocaleLowerCase())!==null&&n!==void 0?n:"");const o=c.StringExt.highlight(e,(i=s===null||s===void 0?void 0:s.indices)!==null&&i!==void 0?i:[],(e=>d().createElement("mark",null,e)));return d().createElement("li",{key:`${r}-${e}`}," ",o," ")})):undefined;return d().createElement("div",{onClick:this._evtMousedown,className:`${r===this.selection?"jp-mod-selected jp-PluginList-entry":"jp-PluginList-entry"} ${this._errors[r]?"jp-ErrorPlugin":""}`,"data-id":r,key:r,title:b},d().createElement("div",{className:"jp-PluginList-entry-label",role:"tab"},d().createElement("div",{className:"jp-SelectedIndicator"}),d().createElement(o.LabIcon.resolveReact,{icon:y||(w?undefined:o.settingsIcon),iconClass:(0,o.classes)(w,"jp-Icon"),title:C,tag:"span",stylesheet:"settingsEditor"}),d().createElement("span",{className:"jp-PluginList-entry-label-text"},v)),d().createElement("ul",null,x))}render(){const e=this.translator.load("jupyterlab");const t=this._model.plugins.filter((e=>{if(!this._filter){return false}const t=this._filter(e);return t===null||t.length>0}));const n=t.filter((e=>{var t;return(t=this._model.settings[e.id])===null||t===void 0?void 0:t.isModified}));const i=n.map(this.mapPlugins);const s=t.filter((e=>!n.includes(e))).map(this.mapPlugins);return d().createElement("div",{className:"jp-PluginList-wrapper"},d().createElement(o.FilterBox,{updateFilter:this.setFilter,useFuzzyFilter:false,placeholder:e.__("Search settings…"),forceRefresh:false,caseSensitive:false,initialQuery:this._query}),i.length>0&&d().createElement("div",null,d().createElement("h1",{className:"jp-PluginList-header"},e.__("Modified")),d().createElement("ul",null,i)),s.length>0&&d().createElement("div",null,d().createElement("h1",{className:"jp-PluginList-header"},e.__("Settings")),d().createElement("ul",null,s)),i.length===0&&s.length===0&&d().createElement("p",{className:"jp-PluginList-noResults"},e.__("No items match your search.")))}}(function(e){function t(e){return Object.keys(e.plugins).map((t=>e.plugins[t])).sort(((e,t)=>(e.schema.title||e.id).localeCompare(t.schema.title||t.id)))}e.sortPlugins=t;class n{constructor(e){var t;this._plugins=[];this._changed=new r.Signal(this);this._ready=new h.PromiseDelegate;this._settings={};this._settingsModified={};this._toSkip=(t=e.toSkip)!==null&&t!==void 0?t:[];this._registry=e.registry;this._registry.pluginChanged.connect((async(e,t)=>{let n=false;if(!this._plugins.map((e=>e.id)).includes(t)){this._plugins=this._loadPlugins();n=true}if(!this._settings[t]){const e=this._plugins.filter((e=>e.id===t));await this._loadSettings(e);n=true}if(n){this._changed.emit()}}),this);this._plugins=this._loadPlugins();this._loadSettings(this._plugins).then((()=>{this._ready.resolve(undefined)})).catch((e=>{console.error(`Failed to load the settings:\n${e}`)}))}get plugins(){return this._plugins}get ready(){return this._ready.promise}get settings(){return this._settings}get changed(){return this._changed}_loadPlugins(){return this._sortPlugins(this._registry).filter((e=>{const{schema:t}=e;const n=t["jupyter.lab.setting-deprecated"]===true;const i=Object.keys(t.properties||{}).length>0;const s=t.additionalProperties!==false;const o=!this._toSkip.includes(e.id);return!n&&o&&(i||s)}))}async _loadSettings(e){for(const t of e){const e=await this._registry.load(t.id);e.changed.connect((()=>{if(e.isModified!==this._settingsModified[t.id]){this._changed.emit();this._settingsModified[t.id]=e.isModified}}));this._settings[t.id]=e;this._settingsModified[t.id]=e.isModified}}_sortPlugins(e){return Object.keys(e.plugins).map((t=>e.plugins[t])).sort(((e,t)=>(e.schema.title||e.id).localeCompare(t.schema.title||t.id)))}}e.Model=n})(g||(g={}));var f=n(26568);var v=n(41742);var _=n.n(v);const b=4;class y extends d().Component{constructor(e){super(e);this.reset=async e=>{e.stopPropagation();for(const t in this.props.settings.user){await this.props.settings.remove(t)}this._formData=this.props.settings.composite;this.setState({isModified:false})};this._syncFormDataWithSettings=()=>{this._formData=this.props.settings.composite;this.setState(((e,t)=>({isModified:t.settings.isModified})))};this._onChange=e=>{this.props.hasError(e.errors.length!==0);const t=h.JSONExt.deepCopy(this._formData);if(e.formData){Object.keys(e.formData).forEach((n=>{const i=e.formData;if(i&&n in i){t[n]=i[n]}}))}this._formData=t;if(e.errors.length===0){this.props.updateDirtyState(true);void this._debouncer.invoke()}this.props.onSelect(this.props.settings.id)};const{settings:t}=e;t.changed.connect(this._syncFormDataWithSettings);this._formData=t.composite;this.state={isModified:t.isModified,uiSchema:{},filteredSchema:this.props.settings.schema,formContext:{defaultFormData:this.props.settings.default(),settings:this.props.settings,schema:h.JSONExt.deepCopy(this.props.settings.schema)}};this.handleChange=this.handleChange.bind(this);this._debouncer=new f.Debouncer(this.handleChange)}componentDidMount(){this._setUiSchema();this._setFilteredSchema()}componentDidUpdate(e){this._setUiSchema(e.renderers[e.settings.id]);this._setFilteredSchema(e.filteredValues);if(e.settings!==this.props.settings){this.setState((e=>({formContext:{...e.formContext,settings:this.props.settings,defaultFormData:this.props.settings.default()}})))}}componentWillUnmount(){this._debouncer.dispose()}handleChange(){if(!this.props.settings.isModified&&this._formData&&this.props.settings.isDefault(this._formData)){this.props.updateDirtyState(false);return}this.props.settings.save(JSON.stringify(this._formData,undefined,b)).then((()=>{this.props.updateDirtyState(false);this.setState({isModified:this.props.settings.isModified})})).catch((e=>{this.props.updateDirtyState(false);const t=this.props.translator.load("jupyterlab");void(0,i.showErrorMessage)(t.__("Error saving settings."),e)}))}render(){const e=this.props.translator.load("jupyterlab");return d().createElement(d().Fragment,null,d().createElement("div",{className:"jp-SettingsHeader"},d().createElement("h2",{className:"jp-SettingsHeader-title",title:this.props.settings.schema.description},this.props.settings.schema.title),d().createElement("div",{className:"jp-SettingsHeader-buttonbar"},this.state.isModified&&d().createElement(o.Button,{className:"jp-RestoreButton",onClick:this.reset},e.__("Restore to Defaults"))),d().createElement("div",{className:"jp-SettingsHeader-description"},this.props.settings.schema.description)),d().createElement(o.FormComponent,{validator:_(),schema:this.state.filteredSchema,formData:this._getFilteredFormData(this.state.filteredSchema),uiSchema:this.state.uiSchema,fields:this.props.renderers[this.props.settings.id],formContext:this.state.formContext,liveValidate:true,idPrefix:`jp-SettingsEditor-${this.props.settings.id}`,onChange:this._onChange,translator:this.props.translator,experimental_defaultFormStateBehavior:{emptyObjectFields:"populateRequiredDefaults"}}))}_setUiSchema(e){var t;const n=this.props.renderers[this.props.settings.id];if(!h.JSONExt.deepEqual(Object.keys(e!==null&&e!==void 0?e:{}).sort(),Object.keys(n!==null&&n!==void 0?n:{}).sort())){const e={};for(const n in this.props.renderers[this.props.settings.id]){if(Object.keys((t=this.props.settings.schema.properties)!==null&&t!==void 0?t:{}).includes(n)){e[n]={"ui:field":n}}}this.setState({uiSchema:e})}}_setFilteredSchema(e){var t,n,i,s;if(e===undefined||!h.JSONExt.deepEqual(e,this.props.filteredValues)||!h.JSONExt.deepEqual(this.state.formContext.schema,this.props.settings.schema)){const e=h.JSONExt.deepCopy(this.props.settings.schema);if((n=(t=this.props.filteredValues)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0>0){for(const t in e.properties){if(!((i=this.props.filteredValues)===null||i===void 0?void 0:i.includes((s=e.properties[t].title)!==null&&s!==void 0?s:t))){delete e.properties[t]}}}this.setState((t=>({filteredSchema:e,formContext:{...t.formContext,schema:h.JSONExt.deepCopy(this.props.settings.schema)}})))}}_getFilteredFormData(e){if(!(e===null||e===void 0?void 0:e.properties)){return this._formData}const t=h.JSONExt.deepCopy(this._formData);for(const n in t){if(!e.properties[n]){delete t[n]}}return t}}const w=({translator:e})=>{const t=e.load("jupyterlab");return d().createElement("div",{className:"jp-SettingsEditor-placeholder"},d().createElement("div",{className:"jp-SettingsEditor-placeholderContent"},d().createElement("h3",null,t.__("No Plugin Selected")),d().createElement("p",null,t.__("Select a plugin from the list to view and edit its preferences."))))};const C=({settings:e,editorRegistry:t,onSelect:n,handleSelectSignal:i,hasError:s,updateDirtyState:o,updateFilterSignal:r,translator:a,initialFilter:c})=>{const[h,u]=(0,l.useState)(null);const[p,m]=(0,l.useState)(c?()=>c:null);const g=d().useRef(null);const f=d().useRef({});(0,l.useEffect)((()=>{var e;const t=(e,t)=>{t?m((()=>t)):m(null)};r.connect(t);const n=(e,t)=>{u(t)};(e=i===null||i===void 0?void 0:i.connect)===null||e===void 0?void 0:e.call(i,n);return()=>{var e;r.disconnect(t);(e=i===null||i===void 0?void 0:i.disconnect)===null||e===void 0?void 0:e.call(i,n)}}),[]);const v=d().useCallback(((e,t)=>{if(f.current){f.current[e]=t;for(const e in f.current){if(f.current[e]){o(true);return}}}o(false)}),[f,o]);const _=d().useMemo((()=>Object.entries(t.renderers).reduce(((e,[t,n])=>{const i=t.lastIndexOf(".");const s=t.substring(0,i);const o=t.substring(i+1);if(!e[s]){e[s]={}}if(!e[s][o]&&n.fieldRenderer){e[s][o]=n.fieldRenderer}return e}),{})),[t]);if(!h&&!p){return d().createElement(w,{translator:a})}return d().createElement("div",{className:"jp-SettingsPanel",ref:g},e.map((e=>{const t=p?p(e.plugin):null;if(h&&h!==e.id||t!==null&&t.length===0){return undefined}return d().createElement("div",{className:"jp-SettingsForm",key:`${e.id}SettingsEditor`},d().createElement(y,{filteredValues:t,settings:e,renderers:_,hasError:t=>{s(e.id,t)},updateDirtyState:t=>{v(e.id,t)},onSelect:n,translator:a}))})))};class x extends a.SplitPanel{constructor(e){super({orientation:"horizontal",renderer:a.SplitPanel.defaultRenderer,spacing:1});this._clearDirty=null;this._dirty=false;this._saveStateChange=new r.Signal(this);this.translator=e.translator||s.nullTranslator;this._status=e.status;this._listModel=new g.Model({registry:e.registry,toSkip:e.toSkip});this._list=new g({registry:e.registry,translator:this.translator,query:e.query,model:this._listModel});this._listModel.changed.connect((()=>{this.update()}));this.addWidget(this._list);this.setDirtyState=this.setDirtyState.bind(this);const t=o.ReactWidget.create(d().createElement(o.UseSignal,{signal:this._listModel.changed},(()=>d().createElement(C,{settings:[...Object.values(this._listModel.settings)],editorRegistry:e.editorRegistry,handleSelectSignal:this._list.handleSelectSignal,onSelect:e=>this._list.selection=e,hasError:this._list.setError,updateFilterSignal:this._list.updateFilterSignal,updateDirtyState:this.setDirtyState,translator:this.translator,initialFilter:this._list.filter}))));this._listModel.ready.then((()=>{this.addWidget(t)})).catch((e=>{console.error(`Failed to load the setting plugins:\n${e}`)}))}get saveStateChanged(){return this._saveStateChange}setDirtyState(e){this._dirty=e;if(this._dirty&&!this._clearDirty){this._clearDirty=this._status.setDirty()}else if(!this._dirty&&this._clearDirty){this._clearDirty.dispose();this._clearDirty=null}if(e){if(!this.title.className.includes("jp-mod-dirty")){this.title.className+=" jp-mod-dirty"}}else{this.title.className=this.title.className.replace("jp-mod-dirty","")}this._saveStateChange.emit(e?"started":"completed")}updateQuery(e){this._list.setFilter(e?(0,o.updateFilterFunction)(e,false,false):null,e)}onCloseRequest(e){const t=this.translator.load("jupyterlab");if(this._list.hasErrors){void(0,i.showDialog)({title:t.__("Warning"),body:t.__("Unsaved changes due to validation error. Continue without saving?")}).then((t=>{if(t.button.accept){this.dispose();super.onCloseRequest(e)}}))}else if(this._dirty){void(0,i.showDialog)({title:t.__("Warning"),body:t.__("Some changes have not been saved. Continue without saving?")}).then((t=>{if(t.button.accept){this.dispose();super.onCloseRequest(e)}}))}else{this.dispose();super.onCloseRequest(e)}}}var S=n(98335);var k=n(54195);var j=n(90943);var I=n(86503);function E(e,t,n){n=n||s.nullTranslator;const i=n.load("jupyterlab");const o=new T(e,n);const r=new k.InspectorPanel({initialContent:i.__("Any errors will be listed here"),translator:n});const a=new k.InspectionHandler({connector:o,rendermime:t||new j.RenderMimeRegistry({initialFactories:j.standardRendererFactories,translator:n})});r.addClass("jp-SettingsDebug");r.source=a;a.editor=e.source;return r}class T extends I.DataConnector{constructor(e,t){super();this._current=0;this._editor=e;this._trans=(t!==null&&t!==void 0?t:s.nullTranslator).load("jupyterlab")}fetch(e){return new Promise((t=>{const n=this._current=window.setTimeout((()=>{if(n!==this._current){return t(undefined)}const i=this._validate(e.text);if(!i){return t({data:{"text/markdown":this._trans.__("No errors found")},metadata:{}})}t({data:this.render(i),metadata:{}})}),100)}))}render(e){return{"text/markdown":e.map(this.renderError.bind(this)).join("")}}renderError(e){var t;switch(e.keyword){case"additionalProperties":return`**\`[${this._trans.__("additional property error")}]\`**\n ${this._trans.__("`%1` is not a valid property",(t=e.params)===null||t===void 0?void 0:t.additionalProperty)}`;case"syntax":return`**\`[${this._trans.__("syntax error")}]\`** *${e.message}*`;case"type":return`**\`[${this._trans.__("type error")}]\`**\n \`${e.instancePath}\` ${e.message}`;default:return`**\`[${this._trans.__("error")}]\`** *${e.message}*`}}_validate(e){const t=this._editor;if(!t.settings){return null}const{id:n,schema:i,version:s}=t.settings;const o={composite:{},user:{}};const r=t.registry.validator;return r.validateData({data:o,id:n,raw:e,schema:i,version:s},false)}}const M="jp-SettingsRawEditor";const D="jp-SettingsRawEditor-user";const A="jp-mod-error";class P extends a.SplitPanel{constructor(e){super({orientation:"horizontal",renderer:a.SplitPanel.defaultRenderer,spacing:1});this._canRevert=false;this._canSave=false;this._commandsChanged=new r.Signal(this);this._settings=null;this._toolbar=new o.Toolbar;const{commands:t,editorFactory:n,registry:i,translator:l}=e;this.registry=i;this.translator=l||s.nullTranslator;this._commands=t;const d=this._defaults=new S.CodeEditorWrapper({editorOptions:{config:{readOnly:true}},model:new S.CodeEditor.Model({mimeType:"text/javascript"}),factory:n});const c=this._user=new S.CodeEditorWrapper({editorOptions:{config:{lineNumbers:true}},model:new S.CodeEditor.Model({mimeType:"text/javascript"}),factory:n});c.addClass(D);c.editor.model.sharedModel.changed.connect(this._onTextChanged,this);this._inspector=E(this,e.rendermime,this.translator);this.addClass(M);this._onSaveError=e.onSaveError;this.addWidget(L.defaultsEditor(d,this.translator));this.addWidget(L.userEditor(c,this._toolbar,this._inspector,this.translator))}get canRevert(){return this._canRevert}get canSave(){return this._canSave}get commandsChanged(){return this._commandsChanged}get isDirty(){var e,t;return(t=this._user.editor.model.sharedModel.getSource()!==((e=this._settings)===null||e===void 0?void 0:e.raw))!==null&&t!==void 0?t:""}get settings(){return this._settings}set settings(e){if(!e&&!this._settings){return}const t=e&&this._settings&&e.plugin===this._settings.plugin;if(t){return}const n=this._defaults;const i=this._user;if(this._settings){this._settings.changed.disconnect(this._onSettingsChanged,this)}if(e){this._settings=e;this._settings.changed.connect(this._onSettingsChanged,this);this._onSettingsChanged()}else{this._settings=null;n.editor.model.sharedModel.setSource("");i.editor.model.sharedModel.setSource("")}this.update()}get sizes(){return this.relativeSizes()}set sizes(e){this.setRelativeSizes(e)}get source(){return this._user.editor}dispose(){if(this.isDisposed){return}this._defaults.model.dispose();this._defaults.dispose();this._user.model.dispose();this._user.dispose();super.dispose()}revert(){var e,t;this._user.editor.model.sharedModel.setSource((t=(e=this.settings)===null||e===void 0?void 0:e.raw)!==null&&t!==void 0?t:"");this._updateToolbar(false,false)}save(){if(!this.isDirty||!this._settings){return Promise.resolve(undefined)}const e=this._settings;const t=this._user.editor.model.sharedModel.getSource();return e.save(t).then((()=>{this._updateToolbar(false,false)})).catch((e=>{this._updateToolbar(true,false);this._onSaveError(e,this.translator)}))}onAfterAttach(e){L.populateToolbar(this._commands,this._toolbar);this.update()}_onTextChanged(){const e=this._user.editor.model.sharedModel.getSource();const t=this._settings;this.removeClass(A);if(!t||t.raw===e){this._updateToolbar(false,false);return}const n=t.validate(e);if(n){this.addClass(A);this._updateToolbar(true,false);return}this._updateToolbar(true,true)}_onSettingsChanged(){var e,t;const n=this._settings;const i=this._defaults;const s=this._user;i.editor.model.sharedModel.setSource((e=n===null||n===void 0?void 0:n.annotatedDefaults())!==null&&e!==void 0?e:"");s.editor.model.sharedModel.setSource((t=n===null||n===void 0?void 0:n.raw)!==null&&t!==void 0?t:"")}_updateToolbar(e=this._canRevert,t=this._canSave){const n=this._commands;this._canRevert=e;this._canSave=t;this._commandsChanged.emit([n.revert,n.save])}}var L;(function(e){function t(e,t){t=t||s.nullTranslator;const n=t.load("jupyterlab");const i=new a.Widget;const r=i.layout=new a.BoxLayout({spacing:0});const l=new a.Widget;const d=new o.Toolbar;d.node.setAttribute("aria-label",n.__("Default editor toolbar"));const c=n.__("System Defaults");l.node.innerText=c;d.insertItem(0,"banner",l);r.addWidget(d);r.addWidget(e);return i}e.defaultsEditor=t;function n(e,t){const{registry:n,revert:i,save:s}=e;t.addItem("spacer",o.Toolbar.createSpacerItem());[i,s].forEach((e=>{const i=new o.CommandToolbarButton({commands:n,id:e});t.addItem(e,i)}))}e.populateToolbar=n;function i(e,t,n,i){i=i||s.nullTranslator;const o=i.load("jupyterlab");const r=o.__("User Preferences");const l=new a.Widget;const d=l.layout=new a.BoxLayout({spacing:0});const c=new a.Widget;c.node.innerText=r;t.insertItem(0,"banner",c);d.addWidget(t);d.addWidget(e);d.addWidget(n);return l}e.userEditor=i})(L||(L={}));const R="jp-PluginEditor";class N extends a.Widget{constructor(e){super();this._settings=null;this._stateChanged=new r.Signal(this);this.addClass(R);const{commands:t,editorFactory:n,registry:i,rendermime:o,translator:l}=e;this.translator=l||s.nullTranslator;this._trans=this.translator.load("jupyterlab");const d=this.layout=new a.StackedLayout;const{onSaveError:c}=O;this.raw=this._rawEditor=new P({commands:t,editorFactory:n,onSaveError:c,registry:i,rendermime:o,translator:l});this._rawEditor.handleMoved.connect(this._onStateChanged,this);d.addWidget(this._rawEditor)}get isDirty(){return this._rawEditor.isDirty}get settings(){return this._settings}set settings(e){if(this._settings===e){return}const t=this._rawEditor;this._settings=t.settings=e;this.update()}get state(){const e=this._settings?this._settings.id:"";const{sizes:t}=this._rawEditor;return{plugin:e,sizes:t}}set state(e){if(h.JSONExt.deepEqual(this.state,e)){return}this._rawEditor.sizes=e.sizes;this.update()}get stateChanged(){return this._stateChanged}confirm(){if(this.isHidden||!this.isAttached||!this.isDirty){return Promise.resolve(undefined)}return(0,i.showDialog)({title:this._trans.__("You have unsaved changes."),body:this._trans.__("Do you want to leave without saving?"),buttons:[i.Dialog.cancelButton({label:this._trans.__("Cancel")}),i.Dialog.okButton({label:this._trans.__("Ok")})]}).then((e=>{if(!e.button.accept){throw new Error("User canceled.")}}))}dispose(){if(this.isDisposed){return}super.dispose();this._rawEditor.dispose()}onAfterAttach(e){this.update()}onUpdateRequest(e){const t=this._rawEditor;const n=this._settings;if(!n){this.hide();return}this.show();t.show()}_onStateChanged(){this.stateChanged.emit(undefined)}}var O;(function(e){function t(e,t){t=t||s.nullTranslator;const n=t.load("jupyterlab");console.error(`Saving setting editor value failed: ${e.message}`);void(0,i.showErrorMessage)(n.__("Your changes were not saved."),e)}e.onSaveError=t})(O||(O={}));const B={sizes:[1,3],container:{editor:"raw",plugin:"",sizes:[1,1]}};class F extends a.SplitPanel{constructor(e){super({orientation:"horizontal",renderer:a.SplitPanel.defaultRenderer,spacing:1});this._fetching=null;this._saving=false;this._state=h.JSONExt.deepCopy(B);this.translator=e.translator||s.nullTranslator;this.addClass("jp-SettingEditor");this.key=e.key;this.state=e.state;const{commands:t,editorFactory:n,rendermime:i}=e;const r=this.registry=e.registry;const d=this._instructions=o.ReactWidget.create(l.createElement(w,{translator:this.translator}));d.addClass("jp-SettingEditorInstructions");const c=this._editor=new N({commands:t,editorFactory:n,registry:r,rendermime:i,translator:this.translator});const u=()=>c.confirm();const p=this._list=new g({confirm:u,registry:r,translator:this.translator});const m=e.when;if(m){this._when=Array.isArray(m)?Promise.all(m):m}this.addWidget(p);this.addWidget(d);a.SplitPanel.setStretch(p,0);a.SplitPanel.setStretch(d,1);a.SplitPanel.setStretch(c,1);c.stateChanged.connect(this._onStateChanged,this);p.changed.connect(this._onStateChanged,this);this.handleMoved.connect(this._onStateChanged,this)}get canRevertRaw(){return this._editor.raw.canRevert}get canSaveRaw(){return this._editor.raw.canSave}get commandsChanged(){return this._editor.raw.commandsChanged}get settings(){return this._editor.settings}get source(){return this._editor.raw.source}dispose(){if(this.isDisposed){return}super.dispose();this._editor.dispose();this._instructions.dispose();this._list.dispose()}revert(){this._editor.raw.revert()}save(){return this._editor.raw.save()}onAfterAttach(e){super.onAfterAttach(e);this.hide();this._fetchState().then((()=>{this.show();this._setState()})).catch((e=>{console.error("Fetching setting editor state failed",e);this.show();this._setState()}))}onCloseRequest(e){this._editor.confirm().then((()=>{super.onCloseRequest(e);this.dispose()})).catch((()=>{}))}_fetchState(){if(this._fetching){return this._fetching}const{key:e,state:t}=this;const n=[t.fetch(e),this._when];return this._fetching=Promise.all(n).then((([e])=>{this._fetching=null;if(this._saving){return}this._state=z.normalizeState(e,this._state)}))}async _onStateChanged(){this._state.sizes=this.relativeSizes();this._state.container=this._editor.state;this._state.container.plugin=this._list.selection;try{await this._saveState()}catch(e){console.error("Saving setting editor state failed",e)}this._setState()}async _saveState(){const{key:e,state:t}=this;const n=this._state;this._saving=true;try{await t.save(e,n);this._saving=false}catch(i){this._saving=false;throw i}}_setLayout(){const e=this._editor;const t=this._state;e.state=t.container;requestAnimationFrame((()=>{this.setRelativeSizes(t.sizes)}))}_setState(){const e=this._editor;const t=this._list;const{container:n}=this._state;if(!n.plugin){e.settings=null;t.selection="";this._setLayout();return}if(e.settings&&e.settings.id===n.plugin){this._setLayout();return}const i=this._instructions;this.registry.load(n.plugin).then((s=>{if(i.isAttached){i.parent=null}if(!e.isAttached){this.addWidget(e)}e.settings=s;t.selection=n.plugin;this._setLayout()})).catch((i=>{console.error(`Loading ${n.plugin} settings failed.`,i);t.selection=this._state.container.plugin="";e.settings=null;this._setLayout()}))}}var z;(function(e){function t(e,t){if(!e){return h.JSONExt.deepCopy(B)}if(!("sizes"in e)||!n(e.sizes)){e.sizes=h.JSONExt.deepCopy(B.sizes)}if(!("container"in e)){e.container=h.JSONExt.deepCopy(B.container);return e}const i="container"in e&&e.container&&typeof e.container==="object"?e.container:{};e.container={plugin:typeof i.plugin==="string"?i.plugin:B.container.plugin,sizes:n(i.sizes)?i.sizes:h.JSONExt.deepCopy(B.container.sizes)};return e}e.normalizeState=t;function n(e){return Array.isArray(e)&&e.every((e=>typeof e==="number"))}})(z||(z={}));var H=n(667)},667:(e,t,n)=>{"use strict";n.d(t,{F:()=>r,z:()=>o});var i=n(5592);var s=n.n(i);const o=new i.Token("@jupyterlab/settingeditor:ISettingEditorTracker",`A widget tracker for the interactive setting editor.\n Use this if you want to be able to iterate over and interact with setting editors\n created by the application.`);const r=new i.Token("@jupyterlab/settingeditor:IJSONSettingEditorTracker",`A widget tracker for the JSON setting editor.\n Use this if you want to be able to iterate over and interact with setting editors\n created by the application.`)},63075:(e,t,n)=>{"use strict";n.r(t);n.d(t,{BaseSettings:()=>f,DefaultSchemaValidator:()=>m,ISettingConnector:()=>b,ISettingRegistry:()=>y,SettingRegistry:()=>g,Settings:()=>v});var i=n(93247);var s=n(5592);var o=n(90044);var r=n(2336);var a=n(63282);var l=n.n(a);var d=n(81219);const c=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema","title":"JupyterLab Plugin Settings/Preferences Schema","description":"JupyterLab plugin settings/preferences schema","version":"1.0.0","type":"object","additionalProperties":true,"properties":{"jupyter.lab.internationalization":{"type":"object","properties":{"selectors":{"type":"array","items":{"type":"string","minLength":1}},"domain":{"type":"string","minLength":1}}},"jupyter.lab.menus":{"type":"object","properties":{"main":{"title":"Main menu entries","description":"List of menu items to add to the main menubar.","items":{"$ref":"#/definitions/menu"},"type":"array","default":[]},"context":{"title":"The application context menu.","description":"List of context menu items.","items":{"allOf":[{"$ref":"#/definitions/menuItem"},{"properties":{"selector":{"description":"The CSS selector for the context menu item.","type":"string"}}}]},"type":"array","default":[]}},"additionalProperties":false},"jupyter.lab.metadataforms":{"items":{"$ref":"#/definitions/metadataForm"},"type":"array","default":[]},"jupyter.lab.setting-deprecated":{"type":"boolean","default":false},"jupyter.lab.setting-icon":{"type":"string","default":""},"jupyter.lab.setting-icon-class":{"type":"string","default":""},"jupyter.lab.setting-icon-label":{"type":"string","default":"Plugin"},"jupyter.lab.shortcuts":{"items":{"$ref":"#/definitions/shortcut"},"type":"array","default":[]},"jupyter.lab.toolbars":{"properties":{"^\\\\w[\\\\w-\\\\.]*$":{"items":{"$ref":"#/definitions/toolbarItem"},"type":"array","default":[]}},"type":"object","default":{}},"jupyter.lab.transform":{"type":"boolean","default":false}},"definitions":{"menu":{"properties":{"disabled":{"description":"Whether the menu is disabled or not","type":"boolean","default":false},"icon":{"description":"Menu icon id","type":"string"},"id":{"description":"Menu unique id","oneOf":[{"type":"string","enum":["jp-menu-file","jp-menu-file-new","jp-menu-edit","jp-menu-help","jp-menu-kernel","jp-menu-run","jp-menu-settings","jp-menu-view","jp-menu-tabs"]},{"type":"string","pattern":"[a-z][a-z0-9\\\\-_]+"}]},"items":{"description":"Menu items","type":"array","items":{"$ref":"#/definitions/menuItem"}},"label":{"description":"Menu label","type":"string"},"mnemonic":{"description":"Mnemonic index for the label","type":"number","minimum":-1,"default":-1},"rank":{"description":"Menu rank","type":"number","minimum":0}},"required":["id"],"type":"object"},"menuItem":{"properties":{"args":{"description":"Command arguments","type":"object"},"command":{"description":"Command id","type":"string"},"disabled":{"description":"Whether the item is disabled or not","type":"boolean","default":false},"type":{"description":"Item type","type":"string","enum":["command","submenu","separator"],"default":"command"},"rank":{"description":"Item rank","type":"number","minimum":0},"submenu":{"oneOf":[{"$ref":"#/definitions/menu"},{"type":"null"}]}},"type":"object"},"shortcut":{"properties":{"args":{"title":"The arguments for the command","type":"object"},"command":{"title":"The command id","description":"The command executed when the binding is matched.","type":"string"},"disabled":{"description":"Whether this shortcut is disabled or not.","type":"boolean","default":false},"keys":{"title":"The key sequence for the binding","description":"The key shortcut like `Accel A` or the sequence of shortcuts to press like [`Accel A`, `B`]","items":{"type":"string"},"type":"array"},"macKeys":{"title":"The key sequence for the binding on macOS","description":"The key shortcut like `Cmd A` or the sequence of shortcuts to press like [`Cmd A`, `B`]","items":{"type":"string"},"type":"array"},"winKeys":{"title":"The key sequence for the binding on Windows","description":"The key shortcut like `Ctrl A` or the sequence of shortcuts to press like [`Ctrl A`, `B`]","items":{"type":"string"},"type":"array"},"linuxKeys":{"title":"The key sequence for the binding on Linux","description":"The key shortcut like `Ctrl A` or the sequence of shortcuts to press like [`Ctrl A`, `B`]","items":{"type":"string"},"type":"array"},"selector":{"title":"CSS selector","type":"string"}},"required":["command","keys","selector"],"type":"object"},"toolbarItem":{"properties":{"name":{"title":"Unique name","type":"string"},"args":{"title":"Command arguments","type":"object"},"command":{"title":"Command id","type":"string","default":""},"disabled":{"title":"Whether the item is ignored or not","type":"boolean","default":false},"icon":{"title":"Item icon id","description":"If defined, it will override the command icon","type":"string"},"label":{"title":"Item label","description":"If defined, it will override the command label","type":"string"},"caption":{"title":"Item caption","description":"If defined, it will override the command caption","type":"string"},"type":{"title":"Item type","type":"string","enum":["command","spacer"]},"rank":{"title":"Item rank","type":"number","minimum":0,"default":50}},"required":["name"],"additionalProperties":false,"type":"object"},"metadataForm":{"type":"object","properties":{"id":{"type":"string","description":"The section ID"},"metadataSchema":{"type":"object","items":{"$ref":"#/definitions/metadataSchema"}},"uiSchema":{"type":"object"},"metadataOptions":{"type":"object","items":{"$ref":"#/definitions/metadataOptions"}},"label":{"type":"string","description":"The section label"},"rank":{"type":"integer","description":"The rank of the section in the right panel"},"showModified":{"type":"boolean","description":"Whether to show modified values from defaults"}},"required":["id","metadataSchema"]},"metadataSchema":{"properties":{"properties":{"type":"object","description":"The property set up by extension","properties":{"title":{"type":"string"},"description":{"type":"string"},"type":{"type":"string"}}}},"type":"object","required":["properties"]},"metadataOptions":{"properties":{"customRenderer":{"type":"string"},"metadataLevel":{"type":"string","enum":["cell","notebook"],"default":"cell"},"cellTypes":{"type":"array","items":{"type":"string","enum":["code","markdown","raw"]}},"writeDefault":{"type":"boolean"}},"type":"object"}}}');const h=s.JSONExt.deepCopy;const u={strict:false};const p=String.fromCharCode(30);class m{constructor(){this._composer=new(l())({useDefaults:true,...u});this._validator=new(l())({...u});this._composer.addSchema(c,"jupyterlab-plugin-schema");this._validator.addSchema(c,"jupyterlab-plugin-schema")}validateData(e,t=true){const n=this._validator.getSchema(e.id);const i=this._composer.getSchema(e.id);if(!n||!i){if(e.schema.type!=="object"){const t="schema";const n=`Setting registry schemas' root-level type must be `+`'object', rejecting type: ${e.schema.type}`;return[{instancePath:"type",keyword:t,schemaPath:"",message:n}]}const t=this._addSchema(e.id,e.schema);return t||this.validateData(e)}let s;try{s=d.parse(e.raw)}catch(r){if(r instanceof SyntaxError){return[{instancePath:"",keyword:"syntax",schemaPath:"",message:r.message}]}const{column:e,description:t}=r;const n=r.lineNumber;return[{instancePath:"",keyword:"parse",schemaPath:"",message:`${t} (line ${n} column ${e})`}]}if(!n(s)){return n.errors}const o=h(s);if(!i(o)){return i.errors}if(t){e.data={composite:o,user:s}}return null}_addSchema(e,t){const n=this._composer;const i=this._validator;const s=i.getSchema("jupyterlab-plugin-schema");if(!s(t)){return s.errors}if(!i.validateSchema(t)){return i.errors}n.removeSchema(e);i.removeSchema(e);n.addSchema(t,e);i.addSchema(t,e);return null}}class g{constructor(e){this.schema=c;this.plugins=Object.create(null);this._pluginChanged=new r.Signal(this);this._ready=Promise.resolve();this._transformers=Object.create(null);this._unloadedPlugins=new Map;this.connector=e.connector;this.validator=e.validator||new m;if(e.plugins){e.plugins.filter((e=>e.schema["jupyter.lab.transform"])).forEach((e=>this._unloadedPlugins.set(e.id,e)));this._ready=this._preload(e.plugins)}}get pluginChanged(){return this._pluginChanged}async get(e,t){await this._ready;const n=this.plugins;if(e in n){const{composite:i,user:s}=n[e].data;return{composite:i[t]!==undefined?h(i[t]):undefined,user:s[t]!==undefined?h(s[t]):undefined}}return this.load(e).then((()=>this.get(e,t)))}async load(e,t=false){await this._ready;const n=this.plugins;const i=this;if(e in n){if(t){n[e].data={composite:{},user:{}};await this._load(await this._transform("fetch",n[e]));this._pluginChanged.emit(e)}return new v({plugin:n[e],registry:i})}if(this._unloadedPlugins.has(e)&&e in this._transformers){await this._load(await this._transform("fetch",this._unloadedPlugins.get(e)));if(e in n){this._pluginChanged.emit(e);this._unloadedPlugins.delete(e);return new v({plugin:n[e],registry:i})}}return this.reload(e)}async reload(e){await this._ready;const t=await this.connector.fetch(e);const n=this.plugins;const i=this;if(t===undefined){throw[{instancePath:"",keyword:"id",message:`Could not fetch settings for ${e}.`,schemaPath:""}]}await this._load(await this._transform("fetch",t));this._pluginChanged.emit(e);return new v({plugin:n[e],registry:i})}async remove(e,t){await this._ready;const n=this.plugins;if(!(e in n)){return}const i=d.parse(n[e].raw);delete i[t];delete i[`// ${t}`];n[e].raw=_.annotatedPlugin(n[e],i);return this._save(e)}async set(e,t,n){await this._ready;const i=this.plugins;if(!(e in i)){return this.load(e).then((()=>this.set(e,t,n)))}const s=d.parse(i[e].raw);i[e].raw=_.annotatedPlugin(i[e],{...s,[t]:n});return this._save(e)}transform(e,t){const n=this._transformers;if(e in n){const t=new Error(`${e} already has a transformer.`);t.name="TransformError";throw t}n[e]={fetch:t.fetch||(e=>e),compose:t.compose||(e=>e)};return new o.DisposableDelegate((()=>{delete n[e]}))}async upload(e,t){await this._ready;const n=this.plugins;if(!(e in n)){return this.load(e).then((()=>this.upload(e,t)))}n[e].raw=t;return this._save(e)}get ready(){return this._ready}async _load(e){const t=e.id;try{await this._validate(e)}catch(n){const e=[`Validating ${t} failed:`];n.forEach(((t,n)=>{const{instancePath:i,schemaPath:s,keyword:o,message:r}=t;if(i||s){e.push(`${n} - schema @ ${s}, data @ ${i}`)}e.push(`{${o}} ${r}`)}));console.warn(e.join("\n"));throw n}}async _preload(e){await Promise.all(e.map((async e=>{var t;try{await this._load(await this._transform("fetch",e))}catch(n){if(((t=n[0])===null||t===void 0?void 0:t.keyword)!=="unset"){console.warn("Ignored setting registry preload errors.",n)}}})))}async _save(e){const t=this.plugins;if(!(e in t)){throw new Error(`${e} does not exist in setting registry.`)}try{await this._validate(t[e])}catch(i){console.warn(`${e} validation errors:`,i);throw new Error(`${e} failed to validate; check console.`)}await this.connector.save(e,t[e].raw);const n=await this.connector.fetch(e);if(n===undefined){throw[{instancePath:"",keyword:"id",message:`Could not fetch settings for ${e}.`,schemaPath:""}]}await this._load(await this._transform("fetch",n));this._pluginChanged.emit(e)}async _transform(e,t){const n=t.id;const i=this._transformers;if(!t.schema["jupyter.lab.transform"]){return t}if(n in i){const s=i[n][e].call(null,t);if(s.id!==n){throw[{instancePath:"",keyword:"id",message:"Plugin transformations cannot change plugin IDs.",schemaPath:""}]}return s}throw[{instancePath:"",keyword:"unset",message:`${t.id} has no transformers yet.`,schemaPath:""}]}async _validate(e){const t=this.validator.validateData(e);if(t){throw t}this.plugins[e.id]=await this._transform("compose",e)}}class f{constructor(e){this._schema=e.schema}get schema(){return this._schema}isDefault(e){for(const t in this.schema.properties){const n=e[t];const i=this.default(t);if(n===undefined||i===undefined||s.JSONExt.deepEqual(n,s.JSONExt.emptyObject)||s.JSONExt.deepEqual(n,s.JSONExt.emptyArray)){continue}if(!s.JSONExt.deepEqual(n,i)){return false}}return true}default(e){return _.reifyDefault(this.schema,e)}}class v extends f{constructor(e){super({schema:e.plugin.schema});this._changed=new r.Signal(this);this._isDisposed=false;this.id=e.plugin.id;this.registry=e.registry;this.registry.pluginChanged.connect(this._onPluginChanged,this)}get changed(){return this._changed}get composite(){return this.plugin.data.composite}get isDisposed(){return this._isDisposed}get plugin(){return this.registry.plugins[this.id]}get raw(){return this.plugin.raw}get isModified(){return!this.isDefault(this.user)}get user(){return this.plugin.data.user}get version(){return this.plugin.version}annotatedDefaults(){return _.annotatedDefaults(this.schema,this.id)}dispose(){if(this._isDisposed){return}this._isDisposed=true;r.Signal.clearData(this)}get(e){const{composite:t,user:n}=this;return{composite:t[e]!==undefined?h(t[e]):undefined,user:n[e]!==undefined?h(n[e]):undefined}}remove(e){return this.registry.remove(this.plugin.id,e)}save(e){return this.registry.upload(this.plugin.id,e)}set(e,t){return this.registry.set(this.plugin.id,e,t)}validate(e){const t={composite:{},user:{}};const{id:n,schema:i}=this.plugin;const s=this.registry.validator;const o=this.version;return s.validateData({data:t,id:n,raw:e,schema:i,version:o},false)}_onPluginChanged(e,t){if(t===this.plugin.id){this._changed.emit(undefined)}}}(function(e){function t(e,t,i=false,o=true){if(!e){return t&&o?s.JSONExt.deepCopy(t):[]}if(!t){return s.JSONExt.deepCopy(e)}const r=s.JSONExt.deepCopy(e);t.forEach((e=>{const t=r.findIndex((t=>t.id===e.id));if(t>=0){r[t]={...r[t],...e,items:n(r[t].items,e.items,i,o)}}else{if(o){r.push(e)}}}));return r}e.reconcileMenus=t;function n(e,n,i=false,o=true){if(!e){return n?s.JSONExt.deepCopy(n):undefined}if(!n){return s.JSONExt.deepCopy(e)}const r=s.JSONExt.deepCopy(e);n.forEach((e=>{var n;switch((n=e.type)!==null&&n!==void 0?n:"command"){case"separator":if(o){r.push({...e})}break;case"submenu":if(e.submenu){const n=r.findIndex((t=>{var n,i;return t.type==="submenu"&&((n=t.submenu)===null||n===void 0?void 0:n.id)===((i=e.submenu)===null||i===void 0?void 0:i.id)}));if(n<0){if(o){r.push(s.JSONExt.deepCopy(e))}}else{r[n]={...r[n],...e,submenu:t(r[n].submenu?[r[n].submenu]:null,[e.submenu],i,o)[0]}}}break;case"command":if(e.command){const t=r.findIndex((t=>{var n,i;return t.command===e.command&&t.selector===e.selector&&s.JSONExt.deepEqual((n=t.args)!==null&&n!==void 0?n:{},(i=e.args)!==null&&i!==void 0?i:{})}));if(t<0){if(o){r.push({...e})}}else{if(i){console.warn(`Menu entry for command '${e.command}' is duplicated.`)}r[t]={...r[t],...e}}}}}));return r}e.reconcileItems=n;function o(e){return e.reduce(((e,t)=>{var n;const i={...t};if(!i.disabled){if(i.type==="submenu"){const{submenu:e}=i;if(e&&!e.disabled){i.submenu={...e,items:o((n=e.items)!==null&&n!==void 0?n:[])}}}e.push(i)}return e}),[])}e.filterDisabledItems=o;function r(e,t){const n={};t=[...t.filter((e=>!!e.disabled)),...t.filter((e=>!e.disabled))].filter((e=>{const t=i.CommandRegistry.normalizeKeys(e).join(p);if(!t){console.warn("Skipping this shortcut because there are no actionable keys on this platform",e);return false}if(!(t in n)){n[t]={}}const{disabled:s,selector:o}=e;if(!(o in n[t])){n[t][o]={enabledUserShortcut:s?null:e,enabledDefaultShortcut:null,shouldDisableDefaultShortcut:!!s};return!s}if(n[t][o].enabledUserShortcut===null){if(s){n[t][o].shouldDisableDefaultShortcut=true;return false}else{n[t][o].enabledUserShortcut=e;return true}}else{console.warn("Skipping",e,"shortcut because it collides with another enabled shortcut:",n[t][o].enabledUserShortcut);return false}}));e=[...e.filter((e=>!!e.disabled)),...e.filter((e=>!e.disabled))].filter((e=>{const t=i.CommandRegistry.normalizeKeys(e).join(p);if(!t){return false}if(!(t in n)){n[t]={}}const{disabled:s,selector:o}=e;if(!(o in n[t])){n[t][o]={enabledUserShortcut:null,enabledDefaultShortcut:s?null:e,shouldDisableDefaultShortcut:!!s};return!s}if(n[t][o].enabledDefaultShortcut===null){if(s){n[t][o].shouldDisableDefaultShortcut=true;return false}else{if(n[t][o].shouldDisableDefaultShortcut){return false}else{n[t][o].enabledDefaultShortcut=e;return true}}}else{if(n[t][o].shouldDisableDefaultShortcut){return false}else{console.warn("Skipping",e,"default shortcut because it collides with another enabled default shortcut:",n[t][o].enabledDefaultShortcut);return false}}}));return _.upgradeShortcuts(t.concat(e).filter((e=>!e.disabled)).map((e=>({args:{},...e}))))}e.reconcileShortcuts=r;function a(e,t,n=false){if(!e){return t?s.JSONExt.deepCopy(t):undefined}if(!t){return s.JSONExt.deepCopy(e)}const i=s.JSONExt.deepCopy(e);t.forEach((e=>{const t=i.findIndex((t=>t.name===e.name));if(t<0){i.push({...e})}else{if(n&&s.JSONExt.deepEqual(Object.keys(e),Object.keys(i[t]))){console.warn(`Toolbar item '${e.name}' is duplicated.`)}i[t]={...i[t],...e}}}));return i}e.reconcileToolbarItems=a})(g||(g={}));var _;(function(e){const t=" ";const n="[missing schema description]";const i="[missing schema title]";function o(e,t){const{description:s,properties:o,title:r}=e;const l=o?Object.keys(o).sort(((e,t)=>e.localeCompare(t))):[];const h=Math.max((s||n).length,t.length);return["{",c(`${r||i}`),c(t),c(s||n),c("*".repeat(h)),"",d(l.map((t=>a(e,t)))),"}"].join("\n")}e.annotatedDefaults=o;function r(e,t){const{description:s,title:o}=e.schema;const r=Object.keys(t).sort(((e,t)=>e.localeCompare(t)));const a=Math.max((s||n).length,e.id.length);return["{",c(`${o||i}`),c(e.id),c(s||n),c("*".repeat(a)),"",d(r.map((n=>l(e.schema,n,t[n])))),"}"].join("\n")}e.annotatedPlugin=r;function a(e,i){const s=e.properties&&e.properties[i]||{};const o=s["type"];const r=s["description"]||n;const a=s["title"]||"";const l=h(e,i);const d=t.length;const u=l!==undefined?c(`"${i}": ${JSON.stringify(l,null,d)}`,t):c(`"${i}": ${o}`);return[c(a),c(r),u].filter((e=>e.length)).join("\n")}function l(e,s,o){const r=e.properties&&e.properties[s];const a=r&&r["description"]||n;const l=r&&r["title"]||i;const d=t.length;const h=c(`"${s}": ${JSON.stringify(o,null,d)}`,t);return[c(l),c(a),h].join("\n")}function d(e){return e.reduce(((t,n,i)=>{const s=n.split("\n");const o=s[s.length-1];const r=o.trim().indexOf("//")===0;const a=r||i===e.length-1?"":",";const l=i===e.length-1?"":"\n\n";return t+n+a+l}),"")}function c(e,n=`${t}// `){return n+e.split("\n").join(`\n${n}`)}function h(e,t,n,i){var o,r,a,l,d,c,u;n=n!==null&&n!==void 0?n:e.definitions;i=t?e.required instanceof Array&&((o=e.required)===null||o===void 0?void 0:o.includes(t)):i;e=(t?(r=e.properties)===null||r===void 0?void 0:r[t]:e)||{};if(e.type==="object"){const t=s.JSONExt.deepCopy(e.default);const i=e.properties||{};for(const s in i){t[s]=h(i[s],undefined,n,e.required instanceof Array&&((a=e.required)===null||a===void 0?void 0:a.includes(s)))}return t}else if(e.type==="array"){const t=typeof e.default!=="undefined";const o=t||i;if(!o){return undefined}const r=t?s.JSONExt.deepCopy(e.default):[];let a=e.items||{};if(a["$ref"]&&n){const e=a["$ref"].replace("#/definitions/","");a=(l=n[e])!==null&&l!==void 0?l:{}}for(const e in r){if(a.type==="object"){const t=(c=(d=h(a,undefined,n))!==null&&d!==void 0?d:r[e])!==null&&c!==void 0?c:{};for(const n in t){if((u=r[e])===null||u===void 0?void 0:u[n]){t[n]=r[e][n]}}r[e]=t}}return r}else{return e.default}}e.reifyDefault=h;const u=new Set;function p(e){const t=new Set;const n=[{old:".jp-Notebook:focus.jp-mod-commandMode",new:".jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus",versionDeprecated:"JupyterLab 4.1"},{old:".jp-Notebook.jp-mod-commandMode :focus:not(:read-write)",new:".jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus",versionDeprecated:"JupyterLab 4.1.1"},{old:".jp-Notebook:focus",new:".jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus",versionDeprecated:"JupyterLab 4.1"},{old:"[data-jp-traversable]:focus",new:".jp-Notebook.jp-mod-commandMode:not(.jp-mod-readWrite) :focus",versionDeprecated:"JupyterLab 4.1"},{old:"[data-jp-kernel-user]:focus",new:"[data-jp-kernel-user]:not(.jp-mod-readWrite) :focus:not(:read-write)",versionDeprecated:"JupyterLab 4.1"},{old:"[data-jp-kernel-user] :focus:not(:read-write)",new:"[data-jp-kernel-user]:not(.jp-mod-readWrite) :focus:not(:read-write)",versionDeprecated:"JupyterLab 4.1.1"}];const i=e.map((e=>{const i=e.selector;let s=i;for(const o of n){if(i.includes(o.old)){s=i.replace(o.old,o.new);if(!u.has(i)){t.add(`"${o.old}" was replaced with "${o.new}" in ${o.versionDeprecated} (present in "${i}")`);u.add(i)}}}e.selector=s;return e}));if(t.size>0){console.warn("Deprecated shortcut selectors: "+[...t].join("\n")+"\n\nThe selectors will be substituted transparently this time, but need to be updated at source before next major release.")}return i}e.upgradeShortcuts=p})(_||(_={}));const b=new s.Token("@jupyterlab/coreutils:ISettingConnector","A service to connect to the settings endpoint.");const y=new s.Token("@jupyterlab/coreutils:ISettingRegistry",`A service for the JupyterLab settings system.\n Use this if you want to store settings for your application.\n See "schemaDir" for more information.`)},26217:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>R});var i=n(15615);var s=n(61927);var o=n(66127);var r=n(93247);var a=n(5592);var l=n(90044);var d=n(76326);var c;(function(e){e.editBinding="shortcuts:edit-keybinding";e.addBinding="shortcuts:add-keybinding";e.deleteBinding="shortcuts:delete-keybinding";e.toggleSelectors="shortcuts:toggle-selectors";e.resetAll="shortcuts:reset-all"})(c||(c={}));var h=n(44914);var u=n.n(h);var p=n(34236);var m=n(77162);const g="jp-Shortcuts-ConflictContainer";class f extends h.Component{constructor(e){super(e);this.handleSubmit=async()=>{if(!this._isReplacingExistingKeybinding){await this._updateShortcut();this.props.toggleInput()}else{if(this.state.selected){this.props.toggleInput()}else{await this._updateShortcut()}}};this._updateShortcut=async()=>{const e=[...this.state.keys,this.state.currentChain];this.setState({keys:e});if(this.props.keybinding){await this.props.replaceKeybinding(this.props.shortcut,this.props.keybinding,e)}else{await this.props.addKeybinding(this.props.shortcut,e)}};this._handleOverwrite=async(e,t)=>{for(const n of e){const e=n.keybindings.filter((e=>a.JSONExt.deepEqual(e.keys,t)||t.some((t=>a.JSONExt.deepEqual(e.keys,[t])))))[0];if(!e){console.error(`Conflicting binding could not be found for ${n} using keys ${t}`);continue}await this.props.deleteKeybinding(n,e)}await this._updateShortcut()};this.parseChaining=(e,t,n,i,s)=>{let o=m.EN_US.keyForKeydownEvent(e.nativeEvent);const r=["Shift","Control","Alt","Meta","Ctrl","Accel"];if(e.key==="Backspace"){n="";t="";i=[];s="";this.setState({value:t,userInput:n,keys:i,currentChain:s})}else if(e.key!=="CapsLock"){const t=n.substr(n.lastIndexOf(" ")+1,n.length).trim();if(r.lastIndexOf(t)===-1&&t!=""){n=n+",";i.push(s);s="";if(e.ctrlKey&&e.key!="Control"){n=(n+" Ctrl").trim();s=(s+" Ctrl").trim()}if(e.metaKey&&e.key!="Meta"){n=(n+" Accel").trim();s=(s+" Accel").trim()}if(e.altKey&&e.key!="Alt"){n=(n+" Alt").trim();s=(s+" Alt").trim()}if(e.shiftKey&&e.key!="Shift"){n=(n+" Shift").trim();s=(s+" Shift").trim()}if(r.lastIndexOf(e.key)===-1){n=(n+" "+o).trim();s=(s+" "+o).trim()}else{if(e.key==="Meta"){n=(n+" Accel").trim();s=(s+" Accel").trim()}else if(e.key==="Control"){n=(n+" Ctrl").trim();s=(s+" Ctrl").trim()}else if(e.key==="Shift"){n=(n+" Shift").trim();s=(s+" Shift").trim()}else if(e.key==="Alt"){n=(n+" Alt").trim();s=(s+" Alt").trim()}else{n=(n+" "+e.key).trim();s=(s+" "+e.key).trim()}}}else{if(e.key==="Control"){n=(n+" Ctrl").trim();s=(s+" Ctrl").trim()}else if(e.key==="Meta"){n=(n+" Accel").trim();s=(s+" Accel").trim()}else if(e.key==="Shift"){n=(n+" Shift").trim();s=(s+" Shift").trim()}else if(e.key==="Alt"){n=(n+" Alt").trim();s=(s+" Alt").trim()}else{n=(n+" "+o).trim();s=(s+" "+o).trim()}}}this.setState({keys:i,currentChain:s});return[n,i,s]};this.checkNonFunctional=()=>{const e=["Ctrl","Alt","Accel","Shift"];const t=this.state.currentChain.split(" ");const n=t[t.length-1];this.setState({isFunctional:!(e.indexOf(n)!==-1)});return e.indexOf(n)!==-1};this.checkShortcutAvailability=(e,t,n)=>{const i=this.props.findConflictsFor([...t,n],this.props.shortcut.selector);const s=e===""||i.length===0;if(!s){if(i.length===1&&i[0].id===this.props.shortcut.id&&this._isReplacingExistingKeybinding){this.setState({isAvailable:true});return[]}}this.setState({isAvailable:s});return i};this.handleInput=e=>{e.preventDefault();this.setState({selected:false});const t=this.parseChaining(e,this.state.value,this.state.userInput,this.state.keys,this.state.currentChain);const n=t[0];const i=t[1];const s=t[2];const o=this.props.toSymbols(n);let r=this.checkShortcutAvailability(n,i,s);this.setState({value:o,userInput:n,keys:i,currentChain:s},(()=>{this.checkNonFunctional();this._emitConflicts(r)}))};this._handleBlur=e=>{var t,n;if((t=this._ref.current)===null||t===void 0?void 0:t.contains(e.relatedTarget)){return}if((n=e.relatedTarget)===null||n===void 0?void 0:n.closest(`.${g}`)){return}this.props.toggleInput()};this._ref=h.createRef();this.state={value:this.props.placeholder,userInput:"",isAvailable:true,isFunctional:this._isReplacingExistingKeybinding,keys:[],currentChain:"",selected:true}}get _isReplacingExistingKeybinding(){return!!this.props.keybinding}_emitConflicts(e){const t=[...this.state.keys,this.state.currentChain];this.props.displayConflicts({conflictsWith:e,keys:this.state.keys,overwrite:async()=>{this.setState({isAvailable:true});await this._handleOverwrite(e,t);this.props.toggleInput()},cancel:()=>{this.props.toggleInput()}})}render(){const e=this.props.translator.load("jupyterlab");let t="jp-Shortcuts-Input";if(!this.state.isAvailable){t+=" jp-mod-unavailable-Input"}return h.createElement("div",{className:this.props.displayInput?!this._isReplacingExistingKeybinding?"jp-Shortcuts-InputBox jp-Shortcuts-InputBoxNew":"jp-Shortcuts-InputBox":"jp-mod-hidden",ref:this._ref,onBlur:this._handleBlur},h.createElement("div",{tabIndex:0,className:t,onKeyDown:this.handleInput,ref:e=>e&&e.focus(),"data-lm-suppress-shortcuts":"true"},h.createElement("p",{className:this.state.selected&&this._isReplacingExistingKeybinding?"jp-Shortcuts-InputText jp-mod-selected-InputText":this.state.value===""?"jp-Shortcuts-InputText jp-mod-waiting-InputText":"jp-Shortcuts-InputText"},this.state.value===""?e.__("press keys"):this.state.value)),h.createElement("button",{className:!this.state.isFunctional?"jp-Shortcuts-Submit jp-mod-defunc-Submit":!this.state.isAvailable?"jp-Shortcuts-Submit jp-mod-conflict-Submit":"jp-Shortcuts-Submit",disabled:!this.state.isAvailable||!this.state.isFunctional,onClick:this.handleSubmit,tabIndex:0},this.state.isAvailable?h.createElement(o.checkIcon.react,null):h.createElement(o.errorIcon.react,null)))}}class v extends h.Component{constructor(e){super(e);this.toggleInputNew=()=>{this.setState({displayNewInput:!this.state.displayNewInput,conflicts:new Map})};this.toSymbols=e=>e.split(" ").reduce(((e,t)=>{if(t==="Ctrl"){return(e+" ⌃").trim()}else if(t==="Alt"){return(e+" ⌥").trim()}else if(t==="Shift"){return(e+" ⇧").trim()}else if(t==="Accel"&&d.Platform.IS_MAC){return(e+" ⌘").trim()}else if(t==="Accel"){return(e+" ⌃").trim()}else{return(e+" "+t).trim()}}),"");this._trans=this.props.external.translator.load("jupyterlab");this.state={displayNewInput:false,displayReplaceInput:Object.freeze({}),conflicts:new Map}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this)}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if("shortcutId"in t&&t.shortcutId!==this.props.shortcut.id){return}if(t.request==="add-keybinding"){return this.toggleInputNew()}if(t.request==="edit-keybinding"){this.toggleInputReplaceMethod(t.keybinding)}if(t.request==="delete-keybinding"){const e=this.props.shortcut;const n=e.keybindings[t.keybinding];this.props.deleteKeybinding(e,n).catch(console.error)}}getCategoryCell(){return h.createElement("div",{className:"jp-Shortcuts-Cell"},this.props.shortcut.category)}getLabelCell(){var e;return h.createElement("div",{className:"jp-Shortcuts-Cell"},h.createElement("div",{className:"jp-label"},(e=this.props.shortcut.label)!==null&&e!==void 0?e:this._trans.__("(Command label missing)")))}getResetShortCutLink(){return h.createElement("a",{className:"jp-Shortcuts-Reset",onClick:()=>this.props.resetKeybindings(this.props.shortcut)},this._trans.__("Reset"))}getSourceCell(){const e=this.props.shortcut.keybindings.every((e=>e.isDefault));return h.createElement("div",{className:"jp-Shortcuts-Cell"},h.createElement("div",{className:"jp-Shortcuts-SourceCell"},e?this._trans.__("Default"):this._trans.__("Custom")),!e?this.getResetShortCutLink():"")}getOptionalSelectorCell(){return this.props.showSelectors?h.createElement("div",{className:"jp-Shortcuts-Cell"},h.createElement("div",{className:"jp-selector"},this.props.shortcut.selector)):null}getClassNameForShortCuts(e){const t=["jp-Shortcuts-ShortcutCell"];switch(e.length){case 1:t.push("jp-Shortcuts-SingleCell");break;case 0:t.push("jp-Shortcuts-EmptyCell");break}return t.join(" ")}toggleInputReplaceMethod(e){const t=this.state.displayReplaceInput[e];this.setState({displayReplaceInput:{...this.state.displayReplaceInput,[e]:!t},conflicts:new Map})}getDisplayReplaceInput(e){return this.state.displayReplaceInput[e]}getOrDiplayIfNeeded(e){const t=["jp-Shortcuts-Or"];if(e||this.state.displayNewInput){t.push("jp-Shortcuts-Or-Forced")}return h.createElement("div",{className:t.join(" ")},this._trans.__("or"))}getShortCutAsInput(e,t){return h.createElement(f,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:()=>this.toggleInputReplaceMethod(t),shortcut:this.props.shortcut,keybinding:e,displayConflicts:t=>{const n=new Map(this.state.conflicts);n.set(e,t);this.setState({conflicts:n})},toSymbols:this.toSymbols,displayInput:this.getDisplayReplaceInput(t),placeholder:this.toSymbols(e.keys.join(", ")),translator:this.props.external.translator})}getShortCutForDisplayOnly(e){return e.keys.map(((t,n)=>h.createElement("div",{className:"jp-Shortcuts-ShortcutKeysContainer",key:n},h.createElement("div",{className:"jp-Shortcuts-ShortcutKeys"},this.toSymbols(t)),n+1this.toggleInputReplaceMethod(e)},this.isLocationBeingEdited(e)?this.getShortCutAsInput(t,e):this.getShortCutForDisplayOnly(t),!(e===this._nonEmptyBindings.length-1&&Object.values(this.state.displayReplaceInput).some(Boolean))&&this.getOrDiplayIfNeeded(e{this.toggleInputNew()}},this._trans.__("Add"))}getInputBoxWhenToggled(){return this.state.displayNewInput?h.createElement(f,{addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,findConflictsFor:this.props.findConflictsFor,toggleInput:this.toggleInputNew,shortcut:this.props.shortcut,displayConflicts:e=>{const t=new Map(this.state.conflicts);t.set(null,e);this.setState({conflicts:t})},toSymbols:this.toSymbols,displayInput:this.state.displayNewInput,placeholder:"",translator:this.props.external.translator}):h.createElement("div",null)}getShortCutsCell(e){return h.createElement("div",{className:"jp-Shortcuts-Cell"},h.createElement("div",{className:this.getClassNameForShortCuts(e)},e.map(((t,n)=>this.getDivForKey(n,t,e))),e.length>=1&&!this.state.displayNewInput&&!Object.values(this.state.displayReplaceInput).some(Boolean)&&this.getAddLink(),e.length===0&&!this.state.displayNewInput&&this.getAddLink(),this.getInputBoxWhenToggled()))}getConflicts(){const e=[...this.state.conflicts.values()].filter((e=>e.conflictsWith.length!==0));if(e.length===0){return h.createElement(h.Fragment,null)}return h.createElement("div",{className:"jp-Shortcuts-Row jp-Shortcuts-RowWithConflict"},h.createElement("div",{className:g},e.map((e=>{const t=e.keys.join(" ")+"_"+e.conflictsWith.map((e=>e.id)).join("");return h.createElement("div",{className:"jp-Shortcuts-Conflict",key:t},h.createElement("div",{className:"jp-Shortcuts-ErrorMessage"},this._trans.__("Shortcut already in use by %1. Overwrite it?",e.conflictsWith.map((e=>{var t;return(t=e.label)!==null&&t!==void 0?t:e.command})).join(", "))),h.createElement("div",{className:"jp-Shortcuts-ErrorButton"},h.createElement("button",{className:"jp-Button jp-mod-reject jp-mod-styled",onClick:()=>{this._clearConflict(e);e.cancel()}},this._trans.__("Cancel")),h.createElement("button",{className:"jp-Button jp-mod-warn jp-mod-styled",onClick:()=>{this._clearConflict(e);e.overwrite()}},this._trans.__("Overwrite"))))}))))}_clearConflict(e){const t=new Map;const n=this._conflictId(e);for(const[i,s]of this.state.conflicts.entries()){if(this._conflictId(s)!==n){t.set(i,s)}}this.setState({conflicts:t})}_conflictId(e){return e.keys.join(" ")+"_"+e.conflictsWith.map((e=>e.id)).join("")}get _nonEmptyBindings(){return this.props.shortcut.keybindings.filter((e=>e.keys.filter((e=>e!="")).length!==0))}render(){return h.createElement(h.Fragment,null,h.createElement("div",{className:"jp-Shortcuts-Row","data-shortcut":this.props.shortcut.id},this.getCategoryCell(),this.getLabelCell(),this.getShortCutsCell(this._nonEmptyBindings),this.getSourceCell(),this.getOptionalSelectorCell()),this.getConflicts())}}const _=115;class b extends h.Component{render(){return h.createElement("div",{className:"jp-Shortcuts-ShortcutListContainer",style:{height:`${this.props.height-_}px`},id:"shortcutListContainer"},h.createElement("div",{className:"jp-Shortcuts-ShortcutList"},this.props.shortcuts.map((e=>h.createElement(v,{key:e.id,addKeybinding:this.props.addKeybinding,replaceKeybinding:this.props.replaceKeybinding,deleteKeybinding:this.props.deleteKeybinding,resetKeybindings:this.props.resetKeybindings,findConflictsFor:this.props.findConflictsFor,shortcut:e,showSelectors:this.props.showSelectors,external:this.props.external})))))}}class y extends h.Component{render(){return h.createElement("div",{className:this.props.title.toLowerCase()===this.props.active?"jp-Shortcuts-Header jp-Shortcuts-CurrentHeader":"jp-Shortcuts-Header",onClick:()=>this.props.updateSort(this.props.columnId)},this.props.title,h.createElement(o.caretDownEmptyThinIcon.react,{className:"jp-Shortcuts-SortButton jp-ShortcutTitleItem-sortButton"}))}}function w(e){return h.createElement("div",{className:"jp-Shortcuts-Symbols"},h.createElement("table",null,h.createElement("tbody",null,h.createElement("tr",null,h.createElement("td",null,h.createElement("kbd",null,"Cmd")),h.createElement("td",null,"⌘"),h.createElement("td",null,h.createElement("kbd",null,"Ctrl")),h.createElement("td",null,"⌃")),h.createElement("tr",null,h.createElement("td",null,h.createElement("kbd",null,"Alt")),h.createElement("td",null,"⌥"),h.createElement("td",null,h.createElement("kbd",null,"Shift")),h.createElement("td",null,"⇧")))))}function C(e){const t=e.translator.load("jupyterlab");return h.createElement("div",{className:"jp-Shortcuts-AdvancedOptions"},h.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>e.toggleSelectors()},e.showSelectors?t.__("Hide Selectors"):t.__("Show Selectors")),h.createElement("a",{className:"jp-Shortcuts-AdvancedOptionsLink",onClick:()=>e.resetShortcuts()},t.__("Reset All")))}class x extends h.Component{constructor(e){super(e)}getShortCutTitleItem(e,t){return h.createElement("div",{className:"jp-Shortcuts-Cell"},h.createElement(y,{title:e,updateSort:this.props.updateSort,active:this.props.currentSort,columnId:t}))}render(){const e=this.props.translator.load("jupyterlab");return h.createElement("div",{className:"jp-Shortcuts-Top"},h.createElement("div",{className:"jp-Shortcuts-TopNav"},h.createElement(w,null),h.createElement(o.FilterBox,{"aria-label":e.__("Search shortcuts"),updateFilter:(e,t)=>this.props.updateSearchQuery(t!==null&&t!==void 0?t:""),placeholder:e.__("Search…"),useFuzzyFilter:false}),h.createElement(C,{toggleSelectors:this.props.toggleSelectors,showSelectors:this.props.showSelectors,resetShortcuts:this.props.resetShortcuts,translator:this.props.translator})),h.createElement("div",{className:"jp-Shortcuts-HeaderRowContainer"},h.createElement("div",{className:"jp-Shortcuts-HeaderRow"},this.getShortCutTitleItem(e.__("Category"),"category"),this.getShortCutTitleItem(e.__("Command"),"command"),h.createElement("div",{className:"jp-Shortcuts-Cell"},h.createElement("div",{className:"title-div"},e.__("Shortcut"))),this.getShortCutTitleItem(e.__("Source"),"source"),this.props.showSelectors&&this.getShortCutTitleItem(e.__("Selectors"),"selector"))))}}class S extends Map{constructor(e){var t,n,i;super();const{settings:s,commandRegistry:o}=e;const r=(t=s.user.shortcuts)!==null&&t!==void 0?t:[];const a=new Set(r.map(this._computeKeybindingId.bind(this)));const l=(n=s.composite.shortcuts)!==null&&n!==void 0?n:[];for(const d of l){const e=this._computeTargetId(d);const t=this._computeKeybindingId(d);const n={keys:d.keys,isDefault:!a.has(t)};const s=this.get(e);if(s){s.keybindings.push(n)}else{const t=d.command.split(":");const s=(i=o.label(d.command,d.args))!==null&&i!==void 0?i:t.length>1?t[1]:undefined;const r=t[0];this.set(e,{id:e,selector:d.selector,command:d.command,category:r,label:s,args:d.args,keybindings:[n]})}}}findConflictsFor(e,t){const n=new k({registry:this});let i=n.findConflicts(e,t);if(i.length!==0){return i}for(const s of e){i=n.findConflicts([s],t);if(i.length!==0){return i}}return[]}_computeTargetId(e){var t;return e.command+"_"+e.selector+"_"+JSON.stringify((t=e.args)!==null&&t!==void 0?t:{})}_computeKeybindingId(e){var t;return[e.command,e.selector,JSON.stringify((t=e.args)!==null&&t!==void 0?t:{}),e.keys.join(" ")].join("_")}}class k{constructor(e){var t;const n=new Map;for(const i of e.registry.values()){for(const e of i.keybindings){const s=this._keybindingHash(e.keys,i.selector);const o=(t=n.get(s))!==null&&t!==void 0?t:[];o.push(i);n.set(s,o)}}this._keybindingsMap=n}findConflicts(e,t){var n;const i=this._keybindingHash(e,t);return(n=this._keybindingsMap.get(i))!==null&&n!==void 0?n:[]}_keybindingHash(e,t){return e.join(" ")+"_"+t}}function j(e){return e.replace(/\s+/g,"").toLowerCase()}function I(e,t){var n;const i=e.category.toLowerCase();const s=((n=e["label"])!==null&&n!==void 0?n:"").toLowerCase();const o=`${i} ${s}`;let r=Infinity;let a=null;const l=/\b\w/g;while(true){const e=l.exec(o);if(!e){break}const n=p.StringExt.matchSumOfDeltas(o,t,e.index);if(!n){break}if(n&&n.score<=r){r=n.score;a=n.indices}}if(!a||r===Infinity){return null}const d=i.length+1;const c=p.ArrayExt.lowerBound(a,d,((e,t)=>e-t));const h=a.slice(0,c);const u=a.slice(c);for(let p=0,m=u.length;p{this.setState({searchQuery:e},(()=>{const e=this.state.shortcutRegistry;this.setState({filteredShortcutList:this._searchFilterShortcuts(e)},(()=>{this.sortShortcuts()}))}))};this.resetShortcuts=async()=>{const e=await this.props.external.getSettings();await e.set("shortcuts",[]);await this._refreshShortcutList()};this.resetKeybindings=async e=>{await this._setKeybinding(e,[])};this.replaceKeybinding=async(e,t,n)=>this._setKeybinding(e,n,t);this.deleteKeybinding=async(e,t)=>{await this._setKeybinding(e,[],t)};this.addKeybinding=async(e,t)=>{await this._setKeybinding(e,t)};this.toggleSelectors=()=>{this.setState({showSelectors:!this.state.showSelectors})};this.updateSort=e=>{if(e!==this.state.currentSort){this.setState({currentSort:e},this.sortShortcuts)}};this.state={shortcutRegistry:null,filteredShortcutList:new Array,shortcutsFetched:false,searchQuery:"",showSelectors:false,currentSort:"category"}}componentDidMount(){this.props.external.actionRequested.connect(this._onActionRequested,this);void this._refreshShortcutList()}componentWillUnmount(){this.props.external.actionRequested.disconnect(this._onActionRequested,this)}async _onActionRequested(e,t){if(t.request==="toggle-selectors"){return this.toggleSelectors()}if(t.request==="reset-all"){await this.resetShortcuts()}}async _refreshShortcutList(){const e=await this.props.external.getSettings();const t=new S({commandRegistry:this.props.external.commandRegistry,settings:e});this.setState({shortcutRegistry:t,filteredShortcutList:this._searchFilterShortcuts(t),shortcutsFetched:true},(()=>{this.sortShortcuts()}))}_searchFilterShortcuts(e){if(!e){return[]}const t=E(e,this.state.searchQuery).map((e=>e.item));return t}async _setKeybinding(e,t,n){var i,s,o,r,l;if(t.length===1&&t[0]==""){t=[]}const d=await this.props.external.getSettings();const c=(i=d.user.shortcuts)!==null&&i!==void 0?i:[];const h=[];let u=false;for(let p of c){if(p.command===e.command&&p.selector===e.selector&&a.JSONExt.deepEqual((s=p.args)!==null&&s!==void 0?s:{},(o=e.args)!==null&&o!==void 0?o:{})&&n&&a.JSONExt.deepEqual(n.keys,p.keys)){const e=n&&n.isDefault&&a.JSONExt.deepEqual(n.keys,t);if(t.length!==0&&!e){h.push({command:p.command,selector:p.selector,keys:t})}u=true}else if(p.command===e.command&&p.selector===e.selector&&a.JSONExt.deepEqual((r=p.args)!==null&&r!==void 0?r:{},(l=e.args)!==null&&l!==void 0?l:{})&&!n&&t.length===0){continue}else{h.push(p)}}if(!u){const i=!n||!a.JSONExt.deepEqual(n.keys,t);const s=n&&n.isDefault&&i;if(s){h.push({command:e.command,selector:e.selector,disabled:true,keys:n.keys})}if(t.length!==0){h.push({command:e.command,selector:e.selector,keys:t})}}await d.set("shortcuts",h);await this._refreshShortcutList()}sortShortcuts(){const e=this.state.filteredShortcutList;let t=this.state.currentSort;if(t==="command"){t="label"}const n=e=>{var n;if(t==="source"){return e.keybindings.every((e=>e.isDefault))?"default":"other"}return(n=e[t])!==null&&n!==void 0?n:""};e.sort(((e,t)=>{var i,s;const o=n(e);const r=n(t);const a=o.localeCompare(r);if(a){return a}else{const n=(i=e["label"])!==null&&i!==void 0?i:"";const o=(s=t["label"])!==null&&s!==void 0?s:"";return n.localeCompare(o)}}));this.setState({filteredShortcutList:e})}render(){if(!this.state.shortcutsFetched){return null}return h.createElement("div",{className:"jp-Shortcuts-ShortcutUI",id:"jp-shortcutui"},h.createElement(x,{updateSearchQuery:this.updateSearchQuery,resetShortcuts:this.resetShortcuts,toggleSelectors:this.toggleSelectors,showSelectors:this.state.showSelectors,updateSort:this.updateSort,currentSort:this.state.currentSort,width:this.props.width,translator:this.props.external.translator}),h.createElement(b,{shortcuts:this.state.filteredShortcutList,resetKeybindings:this.resetKeybindings,addKeybinding:this.addKeybinding,replaceKeybinding:this.replaceKeybinding,deleteKeybinding:this.deleteKeybinding,showSelectors:this.state.showSelectors,findConflictsFor:(e,t)=>{if(this.state.shortcutRegistry){return this.state.shortcutRegistry.findConflictsFor(e,t)}else{console.error("Cannot search for keybinding conflicts at this time: registry is not ready");return[]}},height:this.props.height,external:this.props.external}))}}const M=e=>u().createElement(T,{external:e.external,height:1e3,width:1e3});var D=n(2336);const A="@jupyterlab/shortcuts-extension:shortcuts";function P(e,t,n,i){return{translator:n,getSettings:()=>e.load(A,true),commandRegistry:t.commands,actionRequested:i}}const L={id:A,description:"Adds the keyboard shortcuts editor.",requires:[i.ISettingRegistry],optional:[s.ITranslator,o.IFormRendererRegistry],activate:async(e,t,n,o)=>{const l=n!==null&&n!==void 0?n:s.nullTranslator;const h=l.load("jupyterlab");const{commands:u}=e;let p;let m;let g={};if(o){const n=new D.Signal({});const i=e=>e.dataset["shortcut"]!==undefined;e.commands.addCommand(c.editBinding,{label:h.__("Edit Keybinding"),caption:h.__("Edit existing keybinding"),execute:()=>{const t=e.contextMenuHitTest(i);const s=t===null||t===void 0?void 0:t.dataset["keybinding"];const o=t===null||t===void 0?void 0:t.dataset["shortcut"];if(!o||!s){return console.log("Missing shortcut id/keybinding information")}n.emit({request:"edit-keybinding",keybinding:parseInt(s,10),shortcutId:o})}});e.commands.addCommand(c.deleteBinding,{label:h.__("Delete Keybinding"),caption:h.__("Delete chosen keybinding"),execute:()=>{const t=e.contextMenuHitTest(i);const s=t===null||t===void 0?void 0:t.dataset["keybinding"];const o=t===null||t===void 0?void 0:t.dataset["shortcut"];if(!o||!s){return console.log("Missing shortcut id/keybinding information")}n.emit({request:"delete-keybinding",keybinding:parseInt(s,10),shortcutId:o})}});e.commands.addCommand(c.addBinding,{label:h.__("Add Keybinding"),caption:h.__("Add new keybinding for existing shortcut target"),execute:()=>{const t=e.contextMenuHitTest(i);const s=t===null||t===void 0?void 0:t.dataset["shortcut"];if(!s){return console.log("Missing shortcut id to add keybinding to")}n.emit({request:"add-keybinding",shortcutId:s})}});u.addCommand(c.toggleSelectors,{label:h.__("Toggle Selectors"),caption:h.__("Toggle command selectors"),execute:()=>{n.emit({request:"toggle-selectors"})}});u.addCommand(c.resetAll,{label:h.__("Reset All"),caption:h.__("Reset all shortcuts"),execute:()=>{n.emit({request:"reset-all"})}});const s={fieldRenderer:i=>M({external:P(t,e,l,n),...i})};o.addRenderer(`${L.id}.shortcuts`,s)}function f(n){const i=e.commands.listCommands().join("\n");if(!m){m=a.JSONExt.deepCopy(n.properties.shortcuts.default)}g={};n.properties.shortcuts.default=Object.keys(t.plugins).map((e=>{const n=t.plugins[e].schema["jupyter.lab.shortcuts"]||[];g[e]=n;return n})).concat([m]).reduce(((e,t)=>{if(d.Platform.IS_MAC){return e.concat(t)}else{return e.concat(t.filter((e=>!e.keys.some((e=>{const{cmd:t}=r.CommandRegistry.parseKeystroke(e);return t})))))}}),[]).sort(((e,t)=>e.command.localeCompare(t.command)));n.properties.shortcuts.description=h.__(`Note: To disable a system default shortcut,\ncopy it to User Preferences and add the\n"disabled" key, for example:\n{\n "command": "application:activate-next-tab",\n "keys": [\n "Ctrl Shift ]"\n ],\n "selector": "body",\n "disabled": true\n}\n\nList of commands followed by keyboard shortcuts:\n%1\n\nList of keyboard shortcuts:`,i)}t.pluginChanged.connect((async(e,n)=>{if(n!==L.id){const e=g[n];const i=t.plugins[n].schema["jupyter.lab.shortcuts"]||[];if(e===undefined||!a.JSONExt.deepEqual(e,i)){p=null;const e=t.plugins[L.id].schema;e.properties.shortcuts.default=m;await t.load(L.id,true)}}}));t.transform(L.id,{compose:e=>{var t,n,s,o;if(!p){p=a.JSONExt.deepCopy(e.schema);f(p)}const r=(s=(n=(t=p.properties)===null||t===void 0?void 0:t.shortcuts)===null||n===void 0?void 0:n.default)!==null&&s!==void 0?s:[];const l={shortcuts:(o=e.data.user.shortcuts)!==null&&o!==void 0?o:[]};const d={shortcuts:i.SettingRegistry.reconcileShortcuts(r,l.shortcuts)};e.data={composite:d,user:l};return e},fetch:e=>{if(!p){p=a.JSONExt.deepCopy(e.schema);f(p)}return{data:e.data,id:e.id,raw:e.raw,schema:p,version:e.version}}});try{p=null;const e=await t.load(L.id);N.loadShortcuts(u,e.composite);e.changed.connect((()=>{N.loadShortcuts(u,e.composite)}))}catch(v){console.error(`Loading ${L.id} failed.`,v)}},autoStart:true};const R=L;var N;(function(e){let t;function n(e,n){var s;const o=(s=n===null||n===void 0?void 0:n.shortcuts)!==null&&s!==void 0?s:[];if(t){t.dispose()}t=o.reduce(((t,n)=>{const s=i(n);if(s){t.add(e.addKeyBinding(s))}return t}),new l.DisposableSet)}e.loadShortcuts=n;function i(e){if(!e||typeof e!=="object"){return undefined}const{isArray:t}=Array;const n="command"in e&&"keys"in e&&"selector"in e&&t(e.keys);return n?e:undefined}})(N||(N={}))},48552:(e,t,n)=>{"use strict";var i=n(40662);var s=n(85072);var o=n.n(s);var r=n(97825);var a=n.n(r);var l=n(77659);var d=n.n(l);var c=n(55056);var h=n.n(c);var u=n(10540);var p=n.n(u);var m=n(41113);var g=n.n(m);var f=n(64547);var v={};v.styleTagTransform=g();v.setAttributes=h();v.insert=d().bind(null,"head");v.domAPI=a();v.insertStyleElement=p();var _=o()(f.A,v);const b=f.A&&f.A.locals?f.A.locals:undefined},4056:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.DataConnector=void 0;class n{async list(e){throw new Error("DataConnector#list method has not been implemented.")}async remove(e){throw new Error("DataConnector#remove method has not been implemented.")}async save(e,t){throw new Error("DataConnector#save method has not been implemented.")}}t.DataConnector=n},19531:function(e,t,n){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,n,i){if(i===undefined)i=n;var s=Object.getOwnPropertyDescriptor(t,n);if(!s||("get"in s?!t.__esModule:s.writable||s.configurable)){s={enumerable:true,get:function(){return t[n]}}}Object.defineProperty(e,i,s)}:function(e,t,n,i){if(i===undefined)i=n;e[i]=t[n]});var s=this&&this.__exportStar||function(e,t){for(var n in e)if(n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n))i(t,e,n)};Object.defineProperty(t,"__esModule",{value:true});s(n(4056),t);s(n(78031),t);s(n(45310),t);s(n(19864),t);s(n(82877),t)},78031:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true})},45310:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.RestorablePool=void 0;const i=n(5592);const s=n(94466);const o=n(2336);class r{constructor(e){this._added=new o.Signal(this);this._current=null;this._currentChanged=new o.Signal(this);this._hasRestored=false;this._isDisposed=false;this._objects=new Set;this._restore=null;this._restored=new i.PromiseDelegate;this._updated=new o.Signal(this);this.namespace=e.namespace}get added(){return this._added}get current(){return this._current}set current(e){if(this._current===e){return}if(e!==null&&this._objects.has(e)){this._current=e;this._currentChanged.emit(this._current)}}get currentChanged(){return this._currentChanged}get isDisposed(){return this._isDisposed}get restored(){return this._restored.promise}get size(){return this._objects.size}get updated(){return this._updated}async add(e){var t,n;if(e.isDisposed){const t="A disposed object cannot be added.";console.warn(t,e);throw new Error(t)}if(this._objects.has(e)){const t="This object already exists in the pool.";console.warn(t,e);throw new Error(t)}this._objects.add(e);e.disposed.connect(this._onInstanceDisposed,this);if(a.injectedProperty.get(e)){return}if(this._restore){const{connector:i}=this._restore;const s=this._restore.name(e);if(s){const o=`${this.namespace}:${s}`;const r=(n=(t=this._restore).args)===null||n===void 0?void 0:n.call(t,e);a.nameProperty.set(e,o);await i.save(o,{data:r})}}this._added.emit(e)}dispose(){if(this.isDisposed){return}this._current=null;this._isDisposed=true;this._objects.clear();o.Signal.clearData(this)}find(e){const t=this._objects.values();for(const n of t){if(e(n)){return n}}return undefined}forEach(e){this._objects.forEach(e)}filter(e){const t=[];this.forEach((n=>{if(e(n)){t.push(n)}}));return t}inject(e){a.injectedProperty.set(e,true);return this.add(e)}has(e){return this._objects.has(e)}async restore(e){if(this._hasRestored){throw new Error("This pool has already been restored.")}this._hasRestored=true;const{command:t,connector:n,registry:i,when:s}=e;const o=this.namespace;const r=s?[n.list(o)].concat(s):[n.list(o)];this._restore=e;const[a]=await Promise.all(r);const l=await Promise.all(a.ids.map((async(e,s)=>{const o=a.values[s];const r=o&&o.data;if(r===undefined){return n.remove(e)}return i.execute(t,r).catch((()=>n.remove(e)))})));this._restored.resolve();return l}async save(e){var t,n;const i=a.injectedProperty.get(e);if(!this._restore||!this.has(e)||i){return}const{connector:s}=this._restore;const o=this._restore.name(e);const r=a.nameProperty.get(e);const l=o?`${this.namespace}:${o}`:"";if(r&&r!==l){await s.remove(r)}a.nameProperty.set(e,l);if(l){const i=(n=(t=this._restore).args)===null||n===void 0?void 0:n.call(t,e);await s.save(l,{data:i})}if(r!==l){this._updated.emit(e)}}_onInstanceDisposed(e){this._objects.delete(e);if(e===this._current){this._current=null;this._currentChanged.emit(this._current)}if(a.injectedProperty.get(e)){return}if(!this._restore){return}const{connector:t}=this._restore;const n=a.nameProperty.get(e);if(n){void t.remove(n)}}}t.RestorablePool=r;var a;(function(e){e.injectedProperty=new s.AttachedProperty({name:"injected",create:()=>false});e.nameProperty=new s.AttachedProperty({name:"name",create:()=>""})})(a||(a={}))},19864:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.StateDB=void 0;const i=n(2336);class s{constructor(e={}){this._changed=new i.Signal(this);const{connector:t,transform:n}=e;this._connector=t||new s.Connector;if(!n){this._ready=Promise.resolve(undefined)}else{this._ready=n.then((e=>{const{contents:t,type:n}=e;switch(n){case"cancel":return;case"clear":return this._clear();case"merge":return this._merge(t||{});case"overwrite":return this._overwrite(t||{});default:return}}))}}get changed(){return this._changed}async clear(){await this._ready;await this._clear()}async fetch(e){await this._ready;return this._fetch(e)}async list(e){await this._ready;return this._list(e)}async remove(e){await this._ready;await this._remove(e);this._changed.emit({id:e,type:"remove"})}async save(e,t){await this._ready;await this._save(e,t);this._changed.emit({id:e,type:"save"})}async toJSON(){await this._ready;const{ids:e,values:t}=await this._list();return t.reduce(((t,n,i)=>{t[e[i]]=n;return t}),{})}async _clear(){await Promise.all((await this._list()).ids.map((e=>this._remove(e))))}async _fetch(e){const t=await this._connector.fetch(e);if(t){return JSON.parse(t).v}}async _list(e=""){const{ids:t,values:n}=await this._connector.list(e);return{ids:t,values:n.map((e=>JSON.parse(e).v))}}async _merge(e){await Promise.all(Object.keys(e).map((t=>e[t]&&this._save(t,e[t]))))}async _overwrite(e){await this._clear();await this._merge(e)}async _remove(e){return this._connector.remove(e)}async _save(e,t){return this._connector.save(e,JSON.stringify({v:t}))}}t.StateDB=s;(function(e){class t{constructor(){this._storage={}}async fetch(e){return this._storage[e]}async list(e=""){return Object.keys(this._storage).reduce(((t,n)=>{if(e===""?true:e===n.split(":")[0]){t.ids.push(n);t.values.push(this._storage[n])}return t}),{ids:[],values:[]})}async remove(e){delete this._storage[e]}async save(e,t){this._storage[e]=t}}e.Connector=t})(s||(t.StateDB=s={}))},82877:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:true});t.IStateDB=void 0;const i=n(5592);t.IStateDB=new i.Token("@jupyterlab/coreutils:IStateDB",`A service for the JupyterLab state database.\n Use this if you want to store data that will persist across page loads.\n See "state database" for more information.`)},6771:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>g});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(15615);var l=n.n(a);var d=n(66987);var c=n.n(d);var h=n(61927);var u=n.n(h);const p="@jupyterlab/statusbar-extension:plugin";const m={id:p,description:"Provides the application status bar.",requires:[h.ITranslator],provides:d.IStatusBar,autoStart:true,activate:(e,t,n,i,s)=>{const o=t.load("jupyterlab");const r=new d.StatusBar;r.id="jp-main-statusbar";e.shell.add(r,"bottom");if(n){n.layoutModified.connect((()=>{r.update()}))}const a=o.__("Main Area");const l="statusbar:toggle";e.commands.addCommand(l,{label:o.__("Show Status Bar"),execute:()=>{r.setHidden(r.isVisible);if(i){void i.set(p,"visible",r.isVisible)}},isToggled:()=>r.isVisible});e.commands.commandExecuted.connect(((t,n)=>{if(n.id==="application:reset-layout"&&!r.isVisible){e.commands.execute(l).catch((e=>{console.error("Failed to show the status bar.",e)}))}}));if(s){s.addItem({command:l,category:a})}if(i){const t=i.load(p);const n=e=>{const t=e.get("visible").composite;r.setHidden(!t)};Promise.all([t,e.restored]).then((([e])=>{n(e);e.changed.connect((e=>{n(e)}))})).catch((e=>{console.error(e.message)}))}return r},optional:[i.ILabShell,a.ISettingRegistry,o.ICommandPalette]};const g=m},40005:(e,t,n)=>{"use strict";var i=n(24800);var s=n(97913);var o=n(3579)},57850:(e,t,n)=>{"use strict";n.r(t);n.d(t,{GroupItem:()=>o,IStatusBar:()=>b,Popup:()=>d,ProgressBar:()=>c,ProgressCircle:()=>p,StatusBar:()=>f,TextItem:()=>u,showPopup:()=>l});var i=n(44914);var s=n.n(i);function o(e){const{spacing:t,children:n,className:s,...o}=e;const r=i.Children.toArray(n).filter(Boolean);const a=r.length;return i.createElement("div",{className:`jp-StatusBar-GroupItem ${s||""}`,...o},r.map(((e,n)=>{const s=`group-item-${n}`;if(n===0){return i.createElement("div",{key:s,style:{marginRight:`${t}px`}},e)}else if(n===a-1){return i.createElement("div",{key:s,style:{marginLeft:`${t}px`}},e)}else{return i.createElement("div",{key:s,style:{margin:`0px ${t}px`}},e)}})))}var r=n(66127);var a=n(1143);function l(e){const t=new d(e);if(!e.startHidden){t.launch()}return t}class d extends a.Widget{constructor(e){super();this.addClass("jp-ThemedContainer");this._body=e.body;this._body.addClass("jp-StatusBar-HoverItem");this._anchor=e.anchor;this._align=e.align;if(e.hasDynamicSize){this._observer=new ResizeObserver((()=>{this.update()}))}const t=this.layout=new a.PanelLayout;t.addWidget(e.body);this._body.node.addEventListener("resize",(()=>{this.update()}))}launch(){this._setGeometry();a.Widget.attach(this,document.body);this.update();this._anchor.addClass("jp-mod-clicked");this._anchor.removeClass("jp-mod-highlight")}onUpdateRequest(e){this._setGeometry();super.onUpdateRequest(e)}onAfterAttach(e){var t;document.addEventListener("click",this,false);this.node.addEventListener("keydown",this,false);window.addEventListener("resize",this,false);(t=this._observer)===null||t===void 0?void 0:t.observe(this._body.node)}onBeforeDetach(e){var t;(t=this._observer)===null||t===void 0?void 0:t.disconnect();document.removeEventListener("click",this,false);this.node.removeEventListener("keydown",this,false);window.removeEventListener("resize",this,false)}onResize(){this.update()}dispose(){var e;(e=this._observer)===null||e===void 0?void 0:e.disconnect();super.dispose();this._anchor.removeClass("jp-mod-clicked");this._anchor.addClass("jp-mod-highlight")}handleEvent(e){switch(e.type){case"keydown":this._evtKeydown(e);break;case"click":this._evtClick(e);break;case"resize":this.onResize();break;default:break}}_evtClick(e){if(!!e.target&&!(this._body.node.contains(e.target)||this._anchor.node.contains(e.target))){this.dispose()}}_evtKeydown(e){switch(e.keyCode){case 27:e.stopPropagation();e.preventDefault();this.dispose();break;default:break}}_setGeometry(){let e=0;const t=this._anchor.node.getBoundingClientRect();const n=this._body.node.getBoundingClientRect();if(this._align==="right"){e=-(n.width-t.width)}const i=window.getComputedStyle(this._body.node);r.HoverBox.setGeometry({anchor:t,host:document.body,maxHeight:500,minHeight:20,node:this._body.node,offset:{horizontal:e},privilege:"forceAbove",style:i})}}function c(e){const{width:t,percentage:n,...s}=e;return i.createElement("div",{className:"jp-Statusbar-ProgressBar-progress-bar",role:"progressbar","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n},i.createElement(h,{percentage:n,...s,contentWidth:t}))}function h(e){return i.createElement("div",{style:{width:`${e.percentage}%`}},i.createElement("p",null,e.content))}function u(e){const{title:t,source:n,className:s,...o}=e;return i.createElement("span",{className:s?`jp-StatusBar-TextItem ${s}`:"jp-StatusBar-TextItem",title:t,...o},n)}function p(e){const t=104;const n=e=>{const n=Math.max(e*3.6,.1);const i=n*Math.PI/180,s=Math.sin(i)*t,o=Math.cos(i)*-t,r=n<180?1:0,a=`M 0 0 v -${t} A ${t} ${t} 1 `+r+" 0 "+s.toFixed(4)+" "+o.toFixed(4)+" z";return a};return s().createElement("div",{className:"jp-Statusbar-ProgressCircle",role:"progressbar","aria-label":e.label||"Unlabelled progress circle","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":e.progress},s().createElement("svg",{viewBox:"0 0 250 250"},s().createElement("circle",{cx:"125",cy:"125",r:`${t}`,stroke:"var(--jp-inverse-layout-color3)",strokeWidth:"20",fill:"none"}),s().createElement("path",{className:"jp-Statusbar-ProgressCirclePath",transform:"translate(125,125) scale(.9)",d:n(e.progress),fill:"var(--jp-inverse-layout-color3)"})))}var m=n(34236);var g=n(90044);class f extends a.Widget{constructor(){super();this._isWindowNarrow=()=>window.innerWidth<=630;this._leftRankItems=[];this._rightRankItems=[];this._statusItems={};this._disposables=new g.DisposableSet;this.addClass("jp-StatusBar-Widget");const e=this.layout=new a.PanelLayout;const t=this._leftSide=new a.Panel;const n=this._middlePanel=new a.Panel;const i=this._rightSide=new a.Panel;t.addClass("jp-StatusBar-Left");n.addClass("jp-StatusBar-Middle");i.addClass("jp-StatusBar-Right");i.node.style.flexDirection="row";e.addWidget(t);e.addWidget(n);e.addWidget(i)}registerStatusItem(e,t){if(e in this._statusItems){throw new Error(`Status item ${e} already registered.`)}const n={...v.statusItemDefaults,...t};const{align:i,item:s,rank:o,priority:r}=n;const a=()=>{this._refreshItem(e)};if(n.activeStateChanged){n.activeStateChanged.connect(a)}const l={id:e,rank:o,priority:r};n.item.addClass("jp-StatusBar-Item");this._statusItems[e]=n;if(i==="left"){const e=this._findInsertIndex(this._leftRankItems,l);if(e===-1){this._leftSide.addWidget(s);this._leftRankItems.push(l)}else{m.ArrayExt.insert(this._leftRankItems,e,l);this._leftSide.insertWidget(e,s)}}else if(i==="right"){const e=m.ArrayExt.findFirstIndex(this._rightRankItems,(e=>e.rank{delete this._statusItems[e];if(n.activeStateChanged){n.activeStateChanged.disconnect(a)}s.parent=null;s.dispose()}));this._disposables.add(d);return d}dispose(){this._leftRankItems.length=0;this._rightRankItems.length=0;this._disposables.dispose();super.dispose()}onUpdateRequest(e){this._refreshAll();super.onUpdateRequest(e)}_findInsertIndex(e,t){return m.ArrayExt.findFirstIndex(e,(e=>e.rank>t.rank))}_refreshItem(e){const t=this._statusItems[e];if(t.isActive()&&!(t.priority===0&&this._isWindowNarrow())){t.item.show();t.item.update()}else{t.item.hide()}}_refreshAll(){Object.keys(this._statusItems).forEach((e=>{this._refreshItem(e)}))}}var v;(function(e){e.statusItemDefaults={align:"left",rank:0,priority:0,isActive:()=>true,activeStateChanged:undefined}})(v||(v={}));var _=n(5592);const b=new _.Token("@jupyterlab/statusbar:IStatusBar","A service for the status bar on the application. Use this if you want to add new status bar items.")},24800:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(85072);var r=n.n(o);var a=n(97825);var l=n.n(a);var d=n(77659);var c=n.n(d);var h=n(55056);var u=n.n(h);var p=n(10540);var m=n.n(p);var g=n(41113);var f=n.n(g);var v=n(28423);var _={};_.styleTagTransform=f();_.setAttributes=u();_.insert=c().bind(null,"head");_.domAPI=l();_.insertStyleElement=m();var b=r()(v.A,_);const y=v.A&&v.A.locals?v.A.locals:undefined},59464:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>I});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(11447);var l=n.n(a);var d=n(56759);var c=n.n(d);var h=n(69085);var u=n.n(h);var p=n(77256);var m=n.n(p);var g=n(15615);var f=n.n(g);var v=n(66367);var _=n.n(v);var b=n(61927);var y=n.n(b);var w=n(66127);var C=n.n(w);var x=n(1143);var S=n.n(x);var k;(function(e){e.copy="terminal:copy";e.createNew="terminal:create-new";e.open="terminal:open";e.refresh="terminal:refresh";e.increaseFont="terminal:increase-font";e.decreaseFont="terminal:decrease-font";e.paste="terminal:paste";e.setTheme="terminal:set-theme";e.shutdown="terminal:shut-down"})(k||(k={}));const j={activate:E,id:"@jupyterlab/terminal-extension:plugin",description:"Adds terminal and provides its tracker.",provides:v.ITerminalTracker,requires:[g.ISettingRegistry,b.ITranslator],optional:[o.ICommandPalette,a.ILauncher,i.ILayoutRestorer,d.IMainMenu,o.IThemeManager,h.IRunningSessionManagers],autoStart:true};const I=j;function E(e,t,n,i,s,r,a,l,d){const c=n.load("jupyterlab");const{serviceManager:h,commands:u}=e;const p=c.__("Terminal");const m="terminal";const g=new o.WidgetTracker({namespace:m});if(!h.terminals.isAvailable()){console.warn("Disabling terminals plugin because they are not available on the server");return g}if(r){void r.restore(g,{command:k.createNew,args:e=>({name:e.content.session.name}),name:e=>e.content.session.name})}const f={};function v(e){Object.keys(e.composite).forEach((t=>{f[t]=e.composite[t]}))}function _(e){const t=e.content;if(!t){return}Object.keys(f).forEach((e=>{t.setOption(e,f[e])}))}function b(){g.forEach((e=>_(e)))}t.load(j.id).then((e=>{v(e);b();e.changed.connect((()=>{v(e);b()}))})).catch(D.showErrorMessage);l===null||l===void 0?void 0:l.themeChanged.connect(((e,t)=>{g.forEach((e=>{const t=e.content;if(t.getOption("theme")==="inherit"){t.setOption("theme","inherit")}}))}));M(e,g,t,n,f);if(a){const e=new x.Menu({commands:u});e.title.label=c._p("menu","Terminal Theme");e.addItem({command:k.setTheme,args:{theme:"inherit",displayName:c.__("Inherit"),isPalette:false}});e.addItem({command:k.setTheme,args:{theme:"light",displayName:c.__("Light"),isPalette:false}});e.addItem({command:k.setTheme,args:{theme:"dark",displayName:c.__("Dark"),isPalette:false}});a.settingsMenu.addGroup([{command:k.increaseFont},{command:k.decreaseFont},{type:"submenu",submenu:e}],40);a.fileMenu.newMenu.addItem({command:k.createNew,rank:20});a.fileMenu.closeAndCleaners.add({id:k.shutdown,isEnabled:e=>g.currentWidget!==null&&g.has(e)})}if(i){[k.createNew,k.refresh,k.increaseFont,k.decreaseFont].forEach((e=>{i.addItem({command:e,category:p,args:{isPalette:true}})}));i.addItem({command:k.setTheme,category:p,args:{theme:"inherit",displayName:c.__("Inherit"),isPalette:true}});i.addItem({command:k.setTheme,category:p,args:{theme:"light",displayName:c.__("Light"),isPalette:true}});i.addItem({command:k.setTheme,category:p,args:{theme:"dark",displayName:c.__("Dark"),isPalette:true}})}if(s){s.add({command:k.createNew,category:c.__("Other"),rank:0})}if(d){T(d,e,n)}return g}function T(e,t,n){const i=n.load("jupyterlab");const s=t.serviceManager.terminals;class o{constructor(e){this._model=e}open(){void t.commands.execute("terminal:open",{name:this._model.name})}icon(){return w.terminalIcon}label(){return`terminals/${this._model.name}`}shutdown(){return s.shutdown(this._model.name)}}e.add({name:i.__("Terminals"),supportsMultipleViews:false,running:()=>Array.from(s.running()).map((e=>new o(e))),shutdownAll:()=>s.shutdownAll(),refreshRunning:()=>s.refreshRunning(),runningChanged:s.runningChanged,shutdownLabel:i.__("Shut Down"),shutdownAllLabel:i.__("Shut Down All"),shutdownAllConfirmationText:i.__("Are you sure you want to permanently shut down all running terminals?")})}function M(e,t,n,i,s){var r;const a=i.load("jupyterlab");const{commands:l,serviceManager:d}=e;const c=()=>t.currentWidget!==null&&t.currentWidget===e.shell.currentWidget;l.addCommand(k.createNew,{label:e=>e["isPalette"]?a.__("New Terminal"):a.__("Terminal"),caption:a.__("Start a new terminal session"),icon:e=>e["isPalette"]?undefined:w.terminalIcon,execute:async n=>{const r=n["name"];const a=n["cwd"];const l=a?d.contents.localPath(a):undefined;let c;if(r){const e=await p.TerminalAPI.listRunning(d.serverSettings);if(e.map((e=>e.name)).includes(r)){c=d.terminals.connectTo({model:{name:r}})}else{c=await d.terminals.startNew({name:r,cwd:l})}}else{c=await d.terminals.startNew({cwd:l})}const h=new v.Terminal(c,s,i);h.title.icon=w.terminalIcon;h.title.label="...";const u=new o.MainAreaWidget({content:h,reveal:h.ready});e.shell.add(u,"main",{type:"Terminal"});void t.add(u);e.shell.activateById(u.id);return u}});l.addCommand(k.open,{label:a.__("Open a terminal by its `name`."),execute:n=>{const i=n["name"];const s=t.find((e=>{const t=e.content;return t.session.name===i||false}));if(s){e.shell.activateById(s.id)}else{return l.execute(k.createNew,{name:i})}}});l.addCommand(k.refresh,{label:a.__("Refresh Terminal"),caption:a.__("Refresh the current terminal session"),execute:async()=>{const n=t.currentWidget;if(!n){return}e.shell.activateById(n.id);try{await n.content.refresh();if(n){n.content.activate()}}catch(i){D.showErrorMessage(i)}},icon:e=>e["isPalette"]?undefined:w.refreshIcon.bindprops({stylesheet:"menuItem"}),isEnabled:c});l.addCommand(k.copy,{execute:()=>{var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(!n){return}const i=n.getSelection();if(i){o.Clipboard.copyToSystem(i);n.activate()}},isEnabled:()=>{var e;if(!c()){return false}const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(!n){return false}return n.hasSelection()},icon:w.copyIcon.bindprops({stylesheet:"menuItem"}),label:a.__("Copy")});l.addCommand(k.paste,{execute:async()=>{var e;const n=(e=t.currentWidget)===null||e===void 0?void 0:e.content;if(!n){return}const i=window.navigator.clipboard;const s=await i.readText();if(s){n.paste(s);n.activate()}},isEnabled:()=>{var e;return Boolean(c()&&((e=t.currentWidget)===null||e===void 0?void 0:e.content))},icon:w.pasteIcon.bindprops({stylesheet:"menuItem"}),label:a.__("Paste")});l.addCommand(k.shutdown,{label:a.__("Shutdown Terminal"),execute:()=>{const e=t.currentWidget;if(!e){return}return e.content.session.shutdown()},isEnabled:c});l.addCommand(k.increaseFont,{label:a.__("Increase Terminal Font Size"),execute:async()=>{const{fontSize:e}=s;if(e&&e<72){try{await n.set(j.id,"fontSize",e+1)}catch(t){D.showErrorMessage(t)}}}});l.addCommand(k.decreaseFont,{label:a.__("Decrease Terminal Font Size"),execute:async()=>{const{fontSize:e}=s;if(e&&e>9){try{await n.set(j.id,"fontSize",e-1)}catch(t){D.showErrorMessage(t)}}}});const h={inherit:a.__("Inherit"),light:a.__("Light"),dark:a.__("Dark")};l.addCommand(k.setTheme,{label:e=>{if(e.theme===undefined){return a.__("Set terminal theme to the provided `theme`.")}const t=e["theme"];const n=t in h?h[t]:a.__(t[0].toUpperCase()+t.slice(1));return e["isPalette"]?a.__("Use Terminal Theme: %1",n):n},caption:a.__("Set the terminal theme"),isToggled:e=>{const{theme:t}=s;return e["theme"]===t},execute:async e=>{const t=e["theme"];try{await n.set(j.id,"theme",t);l.notifyCommandChanged(k.setTheme)}catch(i){console.log(i);D.showErrorMessage(i)}}});const u=[k.refresh,k.copy,k.paste,k.shutdown];const m=()=>{u.forEach((e=>l.notifyCommandChanged(e)))};t.currentChanged.connect(m);(r=e.shell.currentChanged)===null||r===void 0?void 0:r.connect(m)}var D;(function(e){function t(e){console.error(`Failed to configure ${j.id}: ${e.message}`)}e.showErrorMessage=t})(D||(D={}))},70558:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(3579);var a=n(75797);var l=n(67996);var d=n(94780);var c=n(69448);var h=n(85072);var u=n.n(h);var p=n(97825);var m=n.n(p);var g=n(77659);var f=n.n(g);var v=n(55056);var _=n.n(v);var b=n(10540);var y=n.n(b);var w=n(41113);var C=n.n(w);var x=n(51466);var S={};S.styleTagTransform=C();S.setAttributes=_();S.insert=f().bind(null,"head");S.domAPI=m();S.insertStyleElement=y();var k=u()(x.A,S);const j=x.A&&x.A.locals?x.A.locals:undefined},4202:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ITerminal:()=>o,ITerminalTracker:()=>s,Terminal:()=>u});var i=n(5592);const s=new i.Token("@jupyterlab/terminal:ITerminalTracker",`A widget tracker for terminals.\n Use this if you want to be able to iterate over and interact with terminals\n created by the application.`);var o;(function(e){e.defaultOptions={theme:"inherit",fontFamily:'Menlo, Consolas, "DejaVu Sans Mono", monospace',fontSize:13,lineHeight:1,scrollback:1e3,shutdownOnClose:false,closeOnExit:true,cursorBlink:true,initialCommand:"",screenReaderMode:false,pasteWithCtrlV:true,autoFit:true,macOptionIsMeta:false}})(o||(o={}));var r=n(61927);var a=n(76326);var l=n(42856);var d=n(1143);const c="jp-Terminal";const h="jp-Terminal-body";class u extends d.Widget{constructor(e,t={},n){super();this._needsResize=true;this._offsetWidth=-1;this._offsetHeight=-1;this._isReady=false;this._ready=new i.PromiseDelegate;this._termOpened=false;n=n||r.nullTranslator;this._trans=n.load("jupyterlab");this.session=e;this._options={...o.defaultOptions,...t};const{theme:s,...a}=this._options;const l={theme:p.getXTermTheme(s),...a};this.addClass(c);this._setThemeAttribute(s);let d="";const h=(e,t)=>{switch(t.type){case"stdout":if(t.content){d+=t.content[0]}break;default:break}};e.messageReceived.connect(h);e.disposed.connect((()=>{if(this.getOption("closeOnExit")){this.dispose()}}),this);p.createTerminal(l).then((([t,n])=>{this._term=t;this._fitAddon=n;this._initializeTerm();this.id=`jp-Terminal-${p.id++}`;this.title.label=this._trans.__("Terminal");this._isReady=true;this._ready.resolve();if(d){this._term.write(d)}e.messageReceived.disconnect(h);e.messageReceived.connect(this._onMessage,this);if(e.connectionStatus==="connected"){this._initialConnection()}else{e.connectionStatusChanged.connect(this._initialConnection,this)}this.update()})).catch((e=>{console.error("Failed to create a terminal.\n",e);this._ready.reject(e)}))}get ready(){return this._ready.promise}getOption(e){return this._options[e]}setOption(e,t){if(e!=="theme"&&(this._options[e]===t||e==="initialCommand")){return}this._options[e]=t;switch(e){case"fontFamily":this._term.options.fontFamily=t;break;case"fontSize":this._term.options.fontSize=t;break;case"lineHeight":this._term.options.lineHeight=t;break;case"screenReaderMode":this._term.options.screenReaderMode=t;break;case"scrollback":this._term.options.scrollback=t;break;case"theme":this._term.options.theme={...p.getXTermTheme(t)};this._setThemeAttribute(t);break;case"macOptionIsMeta":this._term.options.macOptionIsMeta=t;break;default:break}this._needsResize=true;this.update()}dispose(){if(!this.session.isDisposed){if(this.getOption("shutdownOnClose")){this.session.shutdown().catch((e=>{console.error(`Terminal not shut down: ${e}`)}))}}void this.ready.then((()=>{this._term.dispose()}));super.dispose()}async refresh(){if(!this.isDisposed&&this._isReady){await this.session.reconnect();this._term.clear()}}hasSelection(){if(!this.isDisposed&&this._isReady){return this._term.hasSelection()}return false}paste(e){if(!this.isDisposed&&this._isReady){return this._term.paste(e)}}getSelection(){if(!this.isDisposed&&this._isReady){return this._term.getSelection()}return null}processMessage(e){super.processMessage(e);switch(e.type){case"fit-request":this.onFitRequest(e);break;default:break}}onAfterAttach(e){this.update()}onAfterShow(e){this.update()}onResize(e){this._offsetWidth=e.width;this._offsetHeight=e.height;this._needsResize=true;this.update()}onUpdateRequest(e){var t;if(!this.isVisible||!this.isAttached||!this._isReady){return}if(!this._termOpened){this._term.open(this.node);(t=this._term.element)===null||t===void 0?void 0:t.classList.add(h);this._termOpened=true}if(this._needsResize){this._resizeTerminal()}}onFitRequest(e){const t=d.Widget.ResizeMessage.UnknownSize;l.MessageLoop.sendMessage(this,t)}onActivateRequest(e){var t;(t=this._term)===null||t===void 0?void 0:t.focus()}_initialConnection(){if(this.isDisposed){return}if(this.session.connectionStatus!=="connected"){return}this.title.label=this._trans.__("Terminal %1",this.session.name);this._setSessionSize();if(this._options.initialCommand){this.session.send({type:"stdin",content:[this._options.initialCommand+"\r"]})}this.session.connectionStatusChanged.disconnect(this._initialConnection,this)}_initializeTerm(){const e=this._term;e.onData((e=>{if(this.isDisposed){return}this.session.send({type:"stdin",content:[e]})}));e.onTitleChange((e=>{this.title.label=e}));if(a.Platform.IS_MAC){return}e.attachCustomKeyEventHandler((t=>{if(t.ctrlKey&&t.key==="c"&&e.hasSelection()){return false}if(t.ctrlKey&&t.key==="v"&&this._options.pasteWithCtrlV){return false}return true}))}_onMessage(e,t){switch(t.type){case"stdout":if(t.content){this._term.write(t.content[0])}break;case"disconnect":this._term.write("\r\n\r\n[Finished… Term Session]\r\n");break;default:break}}_resizeTerminal(){if(this._options.autoFit){this._fitAddon.fit()}if(this._offsetWidth===-1){this._offsetWidth=this.node.offsetWidth}if(this._offsetHeight===-1){this._offsetHeight=this.node.offsetHeight}this._setSessionSize();this._needsResize=false}_setSessionSize(){const e=[this._term.rows,this._term.cols,this._offsetHeight,this._offsetWidth];if(!this.isDisposed){this.session.send({type:"set_size",content:e})}}_setThemeAttribute(e){if(this.isDisposed){return}this.node.setAttribute("data-term-theme",e?e.toLowerCase():"inherit")}}var p;(function(e){e.id=0;e.lightTheme={foreground:"#000",background:"#fff",cursor:"#616161",cursorAccent:"#F5F5F5",selectionBackground:"rgba(97, 97, 97, 0.3)",selectionInactiveBackground:"rgba(189, 189, 189, 0.3)"};e.darkTheme={foreground:"#fff",background:"#000",cursor:"#fff",cursorAccent:"#000",selectionBackground:"rgba(255, 255, 255, 0.3)",selectionInactiveBackground:"rgba(238, 238, 238, 0.3)"};e.inheritTheme=()=>({foreground:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color0").trim(),background:getComputedStyle(document.body).getPropertyValue("--jp-layout-color0").trim(),cursor:getComputedStyle(document.body).getPropertyValue("--jp-ui-font-color1").trim(),cursorAccent:getComputedStyle(document.body).getPropertyValue("--jp-ui-inverse-font-color0").trim(),selectionBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color3").trim(),selectionInactiveBackground:getComputedStyle(document.body).getPropertyValue("--jp-layout-color2").trim()});function t(t){switch(t){case"light":return e.lightTheme;case"dark":return e.darkTheme;case"inherit":default:return e.inheritTheme()}}e.getXTermTheme=t})(p||(p={}));(function(e){let t=false;let i;let s;let o;let r;function a(){const e=document.createElement("canvas");const t=e.getContext("webgl")||e.getContext("experimental-webgl");try{return t instanceof WebGLRenderingContext}catch(n){return false}}function l(e){let n=new r;e.loadAddon(n);if(t){n.onContextLoss((t=>{console.debug("WebGL context lost - reinitialize Xtermjs renderer.");n.dispose();l(e)}))}}async function d(e){var d;if(!i){t=a();const[e,l,c,h]=await Promise.all([n.e(7856).then(n.t.bind(n,97856,23)),n.e(3616).then(n.t.bind(n,33616,23)),t?n.e(3799).then(n.t.bind(n,56180,23)):n.e(2880).then(n.t.bind(n,52880,23)),n.e(1832).then(n.t.bind(n,31832,23))]);i=e.Terminal;s=l.FitAddon;r=(d=c.WebglAddon)!==null&&d!==void 0?d:c.CanvasAddon;o=h.WebLinksAddon}const c=new i(e);l(c);const h=new s;c.loadAddon(h);c.loadAddon(new o);return[c,h]}e.createTerminal=d})(p||(p={}))},10020:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>l});var i=n(72050);var s=n.n(i);var o=n(61927);var r=n.n(o);const a={id:"@jupyterlab/theme-dark-extension:plugin",description:"Adds a dark theme.",requires:[i.IThemeManager,o.ITranslator],activate:(e,t,n)=>{const i=n.load("jupyterlab");const s="@jupyterlab/theme-dark-extension/index.css";t.register({name:"JupyterLab Dark",displayName:i.__("JupyterLab Dark"),isLight:false,themeScrollbars:true,load:()=>t.loadCSS(s),unload:()=>Promise.resolve(undefined)})},autoStart:true};const l=a},5180:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>l});var i=n(72050);var s=n.n(i);var o=n(61927);var r=n.n(o);const a={id:"@jupyterlab/theme-dark-high-contrast-extension:plugin",description:"Adds a dark high contrast theme.",requires:[i.IThemeManager,o.ITranslator],activate:(e,t,n)=>{const i=n.load("jupyterlab");const s="@jupyterlab/theme-dark-high-contrast-extension/index.css";t.register({name:"JupyterLab Dark High Contrast",displayName:i.__("JupyterLab Dark High Contrast"),isLight:false,themeScrollbars:true,load:()=>t.loadCSS(s),unload:()=>Promise.resolve(undefined)})},autoStart:true};const l=a},84988:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>l});var i=n(72050);var s=n.n(i);var o=n(61927);var r=n.n(o);const a={id:"@jupyterlab/theme-light-extension:plugin",description:"Adds a light theme.",requires:[i.IThemeManager,o.ITranslator],activate:(e,t,n)=>{const i=n.load("jupyterlab");const s="@jupyterlab/theme-light-extension/index.css";t.register({name:"JupyterLab Light",displayName:i.__("JupyterLab Light"),isLight:true,themeScrollbars:false,load:()=>t.loadCSS(s),unload:()=>Promise.resolve(undefined)})},autoStart:true};const l=a},27866:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>v});var i=n(74991);var s=n.n(i);var o=n(15615);var r=n.n(o);var a=n(10553);var l=n.n(a);var d=n(61927);var c=n.n(d);var h=n(66127);var u=n.n(h);var p;(function(e){e.displayNumbering="toc:display-numbering";e.displayH1Numbering="toc:display-h1-numbering";e.displayOutputNumbering="toc:display-outputs-numbering";e.showPanel="toc:show-panel";e.toggleCollapse="toc:toggle-collapse"})(p||(p={}));async function m(e,t,n,i,s,o){const r=(n!==null&&n!==void 0?n:d.nullTranslator).load("jupyterlab");let l={...a.TableOfContents.defaultConfig};const c=new a.TableOfContentsPanel(n!==null&&n!==void 0?n:undefined);c.title.icon=h.tocIcon;c.title.caption=r.__("Table of Contents");c.id="table-of-contents";c.node.setAttribute("role","region");c.node.setAttribute("aria-label",r.__("Table of Contents section"));e.commands.addCommand(p.displayH1Numbering,{label:r.__("Show first-level heading number"),execute:()=>{if(c.model){c.model.setConfiguration({numberingH1:!c.model.configuration.numberingH1})}},isEnabled:()=>{var e,t;return(t=(e=c.model)===null||e===void 0?void 0:e.supportedOptions.includes("numberingH1"))!==null&&t!==void 0?t:false},isToggled:()=>{var e,t;return(t=(e=c.model)===null||e===void 0?void 0:e.configuration.numberingH1)!==null&&t!==void 0?t:false}});e.commands.addCommand(p.displayNumbering,{label:r.__("Show heading number in the document"),icon:e=>e.toolbar?h.numberingIcon:undefined,execute:()=>{if(c.model){c.model.setConfiguration({numberHeaders:!c.model.configuration.numberHeaders});e.commands.notifyCommandChanged(p.displayNumbering)}},isEnabled:()=>{var e,t;return(t=(e=c.model)===null||e===void 0?void 0:e.supportedOptions.includes("numberHeaders"))!==null&&t!==void 0?t:false},isToggled:()=>{var e,t;return(t=(e=c.model)===null||e===void 0?void 0:e.configuration.numberHeaders)!==null&&t!==void 0?t:false}});e.commands.addCommand(p.displayOutputNumbering,{label:r.__("Show output headings"),execute:()=>{if(c.model){c.model.setConfiguration({includeOutput:!c.model.configuration.includeOutput})}},isEnabled:()=>{var e,t;return(t=(e=c.model)===null||e===void 0?void 0:e.supportedOptions.includes("includeOutput"))!==null&&t!==void 0?t:false},isToggled:()=>{var e,t;return(t=(e=c.model)===null||e===void 0?void 0:e.configuration.includeOutput)!==null&&t!==void 0?t:false}});e.commands.addCommand(p.showPanel,{label:r.__("Table of Contents"),execute:()=>{e.shell.activateById(c.id)}});function u(e){return e.headings.some((e=>{var t;return!((t=e.collapsed)!==null&&t!==void 0?t:false)}))}e.commands.addCommand(p.toggleCollapse,{label:()=>c.model&&!u(c.model)?r.__("Expand All Headings"):r.__("Collapse All Headings"),icon:e=>e.toolbar?c.model&&!u(c.model)?h.expandAllIcon:h.collapseAllIcon:undefined,execute:()=>{if(c.model){if(u(c.model)){c.model.toggleCollapse({collapsed:true})}else{c.model.toggleCollapse({collapsed:false})}}},isEnabled:()=>c.model!==null});const m=new a.TableOfContentsTracker;if(i){i.add(c,"@jupyterlab/toc:plugin")}let f;if(o){try{f=await o.load(g.id);const t=t=>{const n=t.composite;for(const e of[...Object.keys(l)]){const t=n[e];if(t!==undefined){l[e]=t}}if(s){for(const e of s.widgets("main")){const t=m.get(e);if(t){t.setConfiguration(l)}}}else{if(e.shell.currentWidget){const t=m.get(e.shell.currentWidget);if(t){t.setConfiguration(l)}}}};if(f){f.changed.connect(t);t(f)}}catch(x){console.error(`Failed to load settings for the Table of Contents extension.\n\n${x}`)}}const v=new h.CommandToolbarButton({commands:e.commands,id:p.displayNumbering,args:{toolbar:true},label:""});v.addClass("jp-toc-numberingButton");c.toolbar.node.setAttribute("aria-label",r.__("Table of contents sidepanel toolbar"));c.toolbar.addItem("display-numbering",v);c.toolbar.addItem("spacer",h.Toolbar.createSpacerItem());c.toolbar.addItem("collapse-all",new h.CommandToolbarButton({commands:e.commands,id:p.toggleCollapse,args:{toolbar:true},label:""}));const _=new h.MenuSvg({commands:e.commands});_.addItem({command:p.displayH1Numbering});_.addItem({command:p.displayOutputNumbering});const b=new h.ToolbarButton({tooltip:r.__("More actions…"),icon:h.ellipsesIcon,noFocusOnClick:false,onClick:()=>{const e=b.node.getBoundingClientRect();_.open(e.x,e.bottom)}});c.toolbar.addItem("submenu",b);e.shell.add(c,"left",{rank:400,type:"Table of Contents"});if(s){s.currentChanged.connect(y)}void e.restored.then((()=>{y()}));return m;function y(){var n;let i=e.shell.currentWidget;if(!i){return}let s=m.get(i);if(!s){s=(n=t.getModel(i,l))!==null&&n!==void 0?n:null;if(s){m.add(i,s)}i.disposed.connect((()=>{s===null||s===void 0?void 0:s.dispose()}))}if(c.model){c.model.headingsChanged.disconnect(C);c.model.collapseChanged.disconnect(C)}c.model=s;if(c.model){c.model.headingsChanged.connect(C);c.model.collapseChanged.connect(C)}w()}function w(){e.commands.notifyCommandChanged(p.displayNumbering);e.commands.notifyCommandChanged(p.toggleCollapse)}function C(){e.commands.notifyCommandChanged(p.toggleCollapse)}}const g={id:"@jupyterlab/toc-extension:registry",description:"Provides the table of contents registry.",autoStart:true,provides:a.ITableOfContentsRegistry,activate:()=>new a.TableOfContentsRegistry};const f={id:"@jupyterlab/toc-extension:tracker",description:"Adds the table of content widget and provides its tracker.",autoStart:true,provides:a.ITableOfContentsTracker,requires:[a.ITableOfContentsRegistry],optional:[d.ITranslator,i.ILayoutRestorer,i.ILabShell,o.ISettingRegistry],activate:m};const v=[g,f]},31747:(e,t,n)=>{"use strict";var i=n(40662);var s=n(3579);var o=n(66731);var r=n(85072);var a=n.n(r);var l=n(97825);var d=n.n(l);var c=n(77659);var h=n.n(c);var u=n(55056);var p=n.n(u);var m=n(10540);var g=n.n(m);var f=n(41113);var v=n.n(f);var _=n(38026);var b={};b.styleTagTransform=v();b.setAttributes=p();b.insert=h().bind(null,"head");b.domAPI=d();b.insertStyleElement=g();var y=a()(_.A,b);const w=_.A&&_.A.locals?_.A.locals:undefined},49830:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ITableOfContentsRegistry:()=>h,ITableOfContentsTracker:()=>u,TableOfContents:()=>p,TableOfContentsFactory:()=>a,TableOfContentsItem:()=>_,TableOfContentsModel:()=>m,TableOfContentsPanel:()=>w,TableOfContentsRegistry:()=>S,TableOfContentsTracker:()=>k,TableOfContentsTree:()=>b,TableOfContentsUtils:()=>s,TableOfContentsWidget:()=>y});var i={};n.r(i);n.d(i,{getHeadingId:()=>N,getHeadings:()=>O,isMarkdown:()=>z});var s={};n.r(s);n.d(s,{Markdown:()=>i,NUMBERING_CLASS:()=>j,addPrefix:()=>M,clearNumbering:()=>P,filterHeadings:()=>I,getHTMLHeadings:()=>T,getPrefix:()=>D,isHTML:()=>E});var o=n(37737);const r=1e3;class a{constructor(e){this.tracker=e}isApplicable(e){if(!this.tracker.has(e)){return false}return true}createNew(e,t){const n=this._createNew(e,t);const i=e.context;const s=()=>{n.refresh().catch((e=>{console.error("Failed to update the table of contents.",e)}))};const a=new o.ActivityMonitor({signal:i.model.contentChanged,timeout:r});a.activityStopped.connect(s);const l=()=>{n.title=o.PathExt.basename(i.localPath)};i.pathChanged.connect(l);i.ready.then((()=>{l();s()})).catch((e=>{console.error(`Failed to initiate headings for ${i.localPath}.`)}));e.disposed.connect((()=>{a.activityStopped.disconnect(s);i.pathChanged.disconnect(l)}));return n}}var l=n(66127);var d=n(5592);var c=n(2336);const h=new d.Token("@jupyterlab/toc:ITableOfContentsRegistry","A service to register table of content factory.");const u=new d.Token("@jupyterlab/toc:ITableOfContentsTracker","A widget tracker for table of contents.");var p;(function(e){e.defaultConfig={baseNumbering:1,maximalDepth:4,numberingH1:true,numberHeaders:false,includeOutput:true,syncCollapseState:false}})(p||(p={}));class m extends l.VDomModel{constructor(e,t){super();this.widget=e;this._activeHeading=null;this._activeHeadingChanged=new c.Signal(this);this._collapseChanged=new c.Signal(this);this._configuration=t!==null&&t!==void 0?t:{...p.defaultConfig};this._headings=new Array;this._headingsChanged=new c.Signal(this);this._isActive=false;this._isRefreshing=false;this._needsRefreshing=false}get activeHeading(){return this._activeHeading}get activeHeadingChanged(){return this._activeHeadingChanged}get collapseChanged(){return this._collapseChanged}get configuration(){return this._configuration}get headings(){return this._headings}get headingsChanged(){return this._headingsChanged}get isActive(){return this._isActive}set isActive(e){this._isActive=e;if(this._isActive&&!this.isAlwaysActive){this.refresh().catch((e=>{console.error("Failed to refresh ToC model.",e)}))}}get isAlwaysActive(){return false}get supportedOptions(){return["maximalDepth"]}get title(){return this._title}set title(e){if(e!==this._title){this._title=e;this.stateChanged.emit()}}async refresh(){if(this._isRefreshing){this._needsRefreshing=true;return Promise.resolve()}this._isRefreshing=true;try{const e=await this.getHeadings();if(this._needsRefreshing){this._needsRefreshing=false;this._isRefreshing=false;return this.refresh()}if(e&&!this._areHeadingsEqual(e,this._headings)){this._headings=e;this.stateChanged.emit();this._headingsChanged.emit()}}finally{this._isRefreshing=false}}setActiveHeading(e,t=true){if(this._activeHeading!==e){this._activeHeading=e;this.stateChanged.emit()}if(t){this._activeHeadingChanged.emit(this._activeHeading)}}setConfiguration(e){const t={...this._configuration,...e};if(!d.JSONExt.deepEqual(this._configuration,t)){this._configuration=t;this.refresh().catch((e=>{console.error("Failed to update the table of contents.",e)}))}}toggleCollapse(e){var t,n;if(e.heading){e.heading.collapsed=(t=e.collapsed)!==null&&t!==void 0?t:!e.heading.collapsed;this.stateChanged.emit();this._collapseChanged.emit(e.heading)}else{const t=(n=e.collapsed)!==null&&n!==void 0?n:!this.headings.some((e=>{var t;return!((t=e.collapsed)!==null&&t!==void 0?t:false)}));this.headings.forEach((e=>e.collapsed=t));this.stateChanged.emit();this._collapseChanged.emit(null)}}isHeadingEqual(e,t){return e.level===t.level&&e.text===t.text&&e.prefix===t.prefix}_areHeadingsEqual(e,t){if(e.length===t.length){for(let n=0;n{if(!e.defaultPrevented&&e.target.expanded!==!n.collapsed){e.preventDefault();i(n)}};return f.createElement(v.TreeItem,{className:"jp-tocItem jp-TreeItem nested",selected:t,expanded:!n.collapsed,onExpand:o,onMouseDown:e=>{if(!e.defaultPrevented){e.preventDefault();s(n)}},onKeyUp:e=>{if(!e.defaultPrevented&&e.key==="Enter"&&!t){e.preventDefault();s(n)}}},f.createElement("div",{className:"jp-tocItem-heading"},f.createElement("span",{className:"jp-tocItem-content",title:n.text,...n.dataset},n.prefix,n.text)),e)}}class b extends f.PureComponent{render(){const{documentType:e}=this.props;return f.createElement(v.TreeView,{className:"jp-TableOfContents-content jp-TreeView","data-document-type":e},this.buildTree())}buildTree(){if(this.props.headings.length===0){return[]}const e=t=>{const n=this.props.headings;const i=new Array;const s=n[t];let o=t+1;while(o{this.model.toggleCollapse({heading:e})},setActiveHeading:e=>{this.model.setActiveHeading(e)}})}}class w extends l.SidePanel{constructor(e){super({content:new g.Panel,translator:e});this._model=null;this.addClass("jp-TableOfContents");this._title=new C.Header(this._trans.__("Table of Contents"));this.header.addWidget(this._title);this._treeview=new y({placeholderHeadline:this._trans.__("No Headings"),placeholderText:this._trans.__("The table of contents shows headings in notebooks and supported files.")});this._treeview.addClass("jp-TableOfContents-tree");this.content.addWidget(this._treeview)}get model(){return this._model}set model(e){var t,n;if(this._model!==e){(t=this._model)===null||t===void 0?void 0:t.stateChanged.disconnect(this._onTitleChanged,this);this._model=e;if(this._model){this._model.isActive=this.isVisible}(n=this._model)===null||n===void 0?void 0:n.stateChanged.connect(this._onTitleChanged,this);this._onTitleChanged();this._treeview.model=this._model}}onAfterHide(e){super.onAfterHide(e);if(this._model){this._model.isActive=false}}onBeforeShow(e){super.onBeforeShow(e);if(this._model){this._model.isActive=true}}_onTitleChanged(){var e,t;this._title.setTitle((t=(e=this._model)===null||e===void 0?void 0:e.title)!==null&&t!==void 0?t:this._trans.__("Table of Contents"))}}var C;(function(e){class t extends g.Widget{constructor(e){const t=document.createElement("h2");t.textContent=e;t.classList.add("jp-text-truncated");super({node:t});this._title=t}setTitle(e){this._title.textContent=e}}e.Header=t})(C||(C={}));var x=n(90044);class S{constructor(){this._generators=new Map;this._idCounter=0}getModel(e,t){for(const n of this._generators.values()){if(n.isApplicable(e)){return n.createNew(e,t)}}}add(e){const t=this._idCounter++;this._generators.set(t,e);return new x.DisposableDelegate((()=>{this._generators.delete(t)}))}}class k{constructor(){this.modelMapping=new WeakMap}add(e,t){this.modelMapping.set(e,t)}get(e){const t=this.modelMapping.get(e);return!t||t.isDisposed?null:t}}const j="numbering-entry";function I(e,t,n=[]){const i={...p.defaultConfig,...t};const s=n;let o=s.length;const r=new Array;for(const a of e){if(a.skip){continue}const e=a.level;if(e>0&&e<=i.maximalDepth){const t=D(e,o,s,i);o=e;r.push({...a,prefix:t})}}return r}function E(e){return e==="text/html"}function T(e,t=true){var n;const i=document.createElement("div");i.innerHTML=e;const s=new Array;const o=i.querySelectorAll("h1, h2, h3, h4, h5, h6");for(const r of o){const e=parseInt(r.tagName[1],10);s.push({text:(n=r.textContent)!==null&&n!==void 0?n:"",level:e,id:r===null||r===void 0?void 0:r.getAttribute("id"),skip:r.classList.contains("jp-toc-ignore")||r.classList.contains("tocSkip")})}return s}function M(e,t,n){let i=e.querySelector(t);if(!i){return null}if(!i.querySelector(`span.${j}`)){A(i,n)}else{const s=e.querySelectorAll(t);for(const e of s){if(!e.querySelector(`span.${j}`)){i=e;A(e,n);break}}}return i}function D(e,t,n,i){const{baseNumbering:s,numberingH1:o,numberHeaders:r}=i;let a="";if(r){const i=o?1:2;if(e>t){for(let i=t;ie!==null&&e!==void 0?e:0)).join(".")+". "}else{if(n.length>1){a=n.slice(1).map((e=>e!==null&&e!==void 0?e:0)).join(".")+". "}}}return a}function A(e,t){e.insertAdjacentHTML("afterbegin",`${t}`)}function P(e){e===null||e===void 0?void 0:e.querySelectorAll(`span.${j}`).forEach((e=>{e.remove()}))}var L=n(72050);var R=n(90943);async function N(e,t,n,i){try{const s=document.createElement("div");await(0,R.renderMarkdown)({markdownParser:e,host:s,source:t,trusted:false,sanitizer:i!==null&&i!==void 0?i:new L.Sanitizer,shouldTypeset:false,resolver:null,linkHandler:null,latexTypesetter:null});const o=s.querySelector(`h${n}`);if(!o){return null}return(i===null||i===void 0?void 0:i.allowNamedProperties)?o.id:o.getAttribute("data-jupyter-id")}catch(s){console.error("Failed to parse a heading.",s)}return null}function O(e){const t=e.split("\n");const n=new Array;let i;let s=0;let o;let r=0;if(t[r]==="---"){for(let e=r+1;e=s){i=!i;s=0;o=""}}if(i){continue}const a=H(e,t[r+1]);if(a){n.push({...a,line:r})}}return n}function B(e){let t;if(e.startsWith("`"))t=e.match(/^(`{3,})/);else t=e.match(/^(~{3,})/);return t?t[0].length:0}const F=["text/x-ipythongfm","text/x-markdown","text/x-gfm","text/markdown"];function z(e){return F.includes(e)}function H(e,t){let n=e.match(/^([#]{1,6}) (.*)/);if(n){return{text:W(n[2]),level:n[1].length,raw:e,skip:V.test(n[0])}}if(t){n=t.match(/^ {0,3}([=]{2,}|[-]{2,})\s*$/);if(n){return{text:W(e),level:n[1][0]==="="?1:2,raw:[e,t].join("\n"),skip:V.test(e)}}}n=e.match(/(.*)<\/h\1>/i);if(n){return{text:n[2],level:parseInt(n[1],10),skip:V.test(n[0]),raw:e}}return null}function W(e){return e.replace(/\[(.+)\]\(.+\)/g,"$1")}const V=/<\w+\s(.*?\s)?class="(.*?\s)?(jp-toc-ignore|tocSkip)(\s.*?)?"(\s.*?)?>/},66731:(e,t,n)=>{"use strict";var i=n(10395);var s=n(40662);var o=n(97913);var r=n(5893);var a=n(79010);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(75682);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},77083:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>I});var i=n(16015);var s=n.n(i);var o=n(37737);var r=n.n(o);var a=n(38894);var l=n.n(a);var d=n(54281);var c=n.n(d);var h=n(90943);var u=n.n(h);var p=n(28883);var m=n.n(p);var g=n(61927);var f=n.n(g);var v=n(34236);var _=n.n(v);var b=n(1143);var y=n.n(b);var w;(function(e){e.dismiss="tooltip:dismiss";e.launchConsole="tooltip:launch-console";e.launchNotebook="tooltip:launch-notebook";e.launchFile="tooltip:launch-file"})(w||(w={}));const C={id:"@jupyterlab/tooltip-extension:manager",description:"Provides the tooltip manager.",autoStart:true,optional:[g.ITranslator],provides:p.ITooltipManager,activate:(e,t)=>{const n=(t!==null&&t!==void 0?t:g.nullTranslator).load("jupyterlab");let i=null;e.commands.addCommand(w.dismiss,{label:n.__("Dismiss the tooltip"),execute:()=>{if(i){i.dispose();i=null}}});return{invoke(e){const t=0;const{anchor:n,editor:s,kernel:o,rendermime:r}=e;if(i){i.dispose();i=null}return E.fetch({detail:t,editor:s,kernel:o}).then((e=>{i=new p.Tooltip({anchor:n,bundle:e,editor:s,rendermime:r});b.Widget.attach(i,document.body)})).catch((()=>{}))}}}};const x={id:"@jupyterlab/tooltip-extension:consoles",description:"Adds the tooltip capability to consoles.",autoStart:true,optional:[g.ITranslator],requires:[p.ITooltipManager,i.IConsoleTracker],activate:(e,t,n,i)=>{const s=(i!==null&&i!==void 0?i:g.nullTranslator).load("jupyterlab");e.commands.addCommand(w.launchConsole,{label:s.__("Open the tooltip"),execute:()=>{var e,i;const s=n.currentWidget;if(!s){return}const o=s.console;const r=(e=o.promptCell)===null||e===void 0?void 0:e.editor;const a=(i=o.sessionContext.session)===null||i===void 0?void 0:i.kernel;const l=o.rendermime;if(!!r&&!!a&&!!l){return t.invoke({anchor:o,editor:r,kernel:a,rendermime:l})}}})}};const S={id:"@jupyterlab/tooltip-extension:notebooks",description:"Adds the tooltip capability to notebooks.",autoStart:true,optional:[g.ITranslator],requires:[p.ITooltipManager,d.INotebookTracker],activate:(e,t,n,i)=>{const s=(i!==null&&i!==void 0?i:g.nullTranslator).load("jupyterlab");e.commands.addCommand(w.launchNotebook,{label:s.__("Open the tooltip"),execute:()=>{var e,i;const s=n.currentWidget;if(!s){return}const o=s.content;const r=(e=o.activeCell)===null||e===void 0?void 0:e.editor;const a=(i=s.sessionContext.session)===null||i===void 0?void 0:i.kernel;const l=o.rendermime;if(!!r&&!!a&&!!l){return t.invoke({anchor:o,editor:r,kernel:a,rendermime:l})}}})}};const k={id:"@jupyterlab/tooltip-extension:files",description:"Adds the tooltip capability to file editors.",autoStart:true,optional:[g.ITranslator],requires:[p.ITooltipManager,a.IEditorTracker,h.IRenderMimeRegistry],activate:(e,t,n,i,s)=>{const o=(s!==null&&s!==void 0?s:g.nullTranslator).load("jupyterlab");const r={};const a=e.serviceManager.sessions;const l=(e,t)=>{n.forEach((e=>{const n=(0,v.find)(t,(t=>e.context.path===t.path));if(n){const t=r[e.id];if(t&&t.id===n.id){return}if(t){delete r[e.id];t.dispose()}const i=a.connectTo({model:n});r[e.id]=i}else{const t=r[e.id];if(t){t.dispose();delete r[e.id]}}}))};l(a,a.running());a.runningChanged.connect(l);n.widgetAdded.connect(((e,t)=>{t.disposed.connect((e=>{const t=r[e.id];if(t){t.dispose();delete r[e.id]}}))}));e.commands.addCommand(w.launchFile,{label:o.__("Open the tooltip"),execute:async()=>{const e=n.currentWidget;const s=e&&r[e.id]&&r[e.id].kernel;if(!s){return}const o=e.content;const a=o===null||o===void 0?void 0:o.editor;if(!!a&&!!s&&!!i){return t.invoke({anchor:o,editor:a,kernel:s,rendermime:i})}}})}};const j=[C,x,S,k];const I=j;var E;(function(e){let t=0;function n(e){const{detail:n,editor:i,kernel:s}=e;const r=i.model.sharedModel.getSource();const a=i.getCursorPosition();const l=o.Text.jsIndexToCharIndex(i.getOffsetAt(a),r);if(!r||!s){return Promise.reject(void 0)}const d={code:r,cursor_pos:l,detail_level:n||0};const c=++t;return s.requestInspect(d).then((e=>{const n=e.content;if(c!==t){return Promise.reject(void 0)}if(n.status!=="ok"||!n.found){return Promise.reject(void 0)}return Promise.resolve(n.data)}))}e.fetch=n})(E||(E={}))},95527:(e,t,n)=>{"use strict";var i=n(10395);var s=n(17325);var o=n(5893);var r=n(3579);var a=n(50286);var l=n(77748);var d=n(28006);var c=n(40662);var h=n(85072);var u=n.n(h);var p=n(97825);var m=n.n(p);var g=n(77659);var f=n.n(g);var v=n(55056);var _=n.n(v);var b=n(10540);var y=n.n(b);var w=n(41113);var C=n.n(w);var x=n(69231);var S={};S.styleTagTransform=C();S.setAttributes=_();S.insert=f().bind(null,"head");S.domAPI=m();S.insertStyleElement=y();var k=u()(x.A,S);const j=x.A&&x.A.locals?x.A.locals:undefined},22087:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ITooltipManager:()=>s,Tooltip:()=>m});var i=n(5592);const s=new i.Token("@jupyterlab/tooltip:ITooltipManager","A service for the tooltip manager for the application. Use this to allow your extension to invoke a tooltip.");var o=n(66127);var r=n(90943);var a=n(1143);const l="jp-Tooltip";const d="jp-Tooltip-content";const c="jp-mod-tooltip";const h=20;const u=250;const p=true;class m extends a.Widget{constructor(e){super();this._content=null;this.addClass("jp-ThemedContainer");const t=this.layout=new a.PanelLayout;const n=new r.MimeModel({data:e.bundle});this.anchor=e.anchor;this.addClass(l);this.hide();this._editor=e.editor;this._position=e.position;this._rendermime=e.rendermime;const i=this._rendermime.preferredMimeType(e.bundle,"any");if(!i){return}this._content=this._rendermime.createRenderer(i);this._content.renderModel(n).then((()=>this._setGeometry())).catch((e=>console.error("tooltip rendering failed",e)));this._content.addClass(d);t.addWidget(this._content)}dispose(){if(this._content){this._content.dispose();this._content=null}super.dispose()}handleEvent(e){if(this.isHidden||this.isDisposed){return}const{node:t}=this;const n=e.target;switch(e.type){case"keydown":if(t.contains(n)){return}this.dispose();break;case"mousedown":if(t.contains(n)){this.activate();return}this.dispose();break;case"scroll":this._evtScroll(e);break;default:break}}onActivateRequest(e){this.node.tabIndex=0;this.node.focus()}onAfterAttach(e){document.body.classList.add(c);document.addEventListener("keydown",this,p);document.addEventListener("mousedown",this,p);this.anchor.node.addEventListener("scroll",this,p);this.update()}onBeforeDetach(e){document.body.classList.remove(c);document.removeEventListener("keydown",this,p);document.removeEventListener("mousedown",this,p);this.anchor.node.removeEventListener("scroll",this,p)}onUpdateRequest(e){if(this.isHidden){this.show()}this._setGeometry();super.onUpdateRequest(e)}_evtScroll(e){if(this.node.contains(e.target)){return}this.update()}_getTokenPosition(){const e=this._editor;const t=e.getCursorPosition();const n=e.getOffsetAt(t);const i=e.getLine(t.line);if(!i){return}const s=i.substring(0,n).split(/\W+/);const o=s[s.length-1];const r=o?n-o.length:n;return e.getPositionAt(r)}_setGeometry(){const e=this._position?this._position:this._getTokenPosition();if(!e){return}const t=this._editor;const n=t.getCoordinateForPosition(e);if(!n){return}const i=window.getComputedStyle(this.node);const s=parseInt(i.paddingLeft,10)||0;const r=t.host.closest(".jp-MainAreaWidget > .lm-Widget")||t.host;o.HoverBox.setGeometry({anchor:n,host:r,maxHeight:u,minHeight:h,node:this.node,offset:{horizontal:-1*s},privilege:"below",outOfViewDisplay:{top:"stick-inside",bottom:"stick-inside"},style:i})}}},30963:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>_});var i=n(74991);var s=n.n(i);var o=n(72050);var r=n.n(o);var a=n(56759);var l=n.n(a);var d=n(15615);var c=n.n(d);var h=n(61927);var u=n.n(h);const p="@jupyterlab/translation-extension:plugin";const m={id:"@jupyterlab/translation-extension:translator-connector",description:"Provides the application translation connector.",autoStart:true,requires:[i.JupyterFrontEnd.IPaths],provides:h.ITranslatorConnector,activate:(e,t)=>{const n=t.urls.translations;const i=e.serviceManager.serverSettings;return new h.TranslatorConnector(n,i)}};const g={id:"@jupyterlab/translation-extension:translator",description:"Provides the application translation object.",autoStart:true,requires:[i.JupyterFrontEnd.IPaths,d.ISettingRegistry],optional:[i.ILabShell,h.ITranslatorConnector],provides:h.ITranslator,activate:async(e,t,n,i,s)=>{const r=await n.load(p);const a=r.get("locale").composite;let l=r.get("stringsPrefix").composite;const d=r.get("displayStringsPrefix").composite;l=d?l:"";const c=e.serviceManager.serverSettings;const u=new h.TranslationManager(t.urls.translations,l,c,s!==null&&s!==void 0?s:undefined);await u.fetch(a);document.documentElement.lang=u.languageCode;if(i){i.translator=u}o.Dialog.translator=u;return u}};const f={id:p,description:"Adds translation commands and settings.",requires:[d.ISettingRegistry,h.ITranslator,h.ITranslatorConnector],optional:[a.IMainMenu,o.ICommandPalette],autoStart:true,activate:(e,t,n,i,s,r)=>{var a;const l=n.load("jupyterlab");const{commands:d}=e;const c=s?(a=s.settingsMenu.items.find((e=>{var t;return e.type==="submenu"&&((t=e.submenu)===null||t===void 0?void 0:t.id)==="jp-mainmenu-settings-language"})))===null||a===void 0?void 0:a.submenu:null;i.fetch().then((e=>{const i=n.languageCode.replace("-","_");for(const n in e.data){const s=e.data[n];const a=s.displayName;const h=s.nativeName;const u=i===n;const m=u?`${a}`:`${a} - ${h}`;const g=`jupyterlab-translation:${n}`;d.addCommand(g,{label:m,caption:l.__("Change interface language to %1",m),isEnabled:()=>!u,isToggled:()=>u,execute:async()=>{const e=await(0,o.showDialog)({title:l.__("Change interface language?"),body:l.__("After changing the interface language to %1, you will need to reload JupyterLab to see the changes.",m),buttons:[o.Dialog.cancelButton(),o.Dialog.okButton({label:l.__("Change and reload")})]});if(e.button.accept){try{await t.set(p,"locale",n);window.location.reload()}catch(i){console.error(`Failed to update language locale to ${n}`,i)}}}});if(c){c.addItem({command:g,args:{}})}if(r){r.addItem({category:l.__("Display Languages"),command:g})}}})).catch((e=>{console.error(`Available locales errored!\n${e}`)}))}};const v=[m,g,f];const _=v},50277:(e,t,n)=>{"use strict";var i=n(97913);var s=n(3579);var o=n(67996)},6401:(e,t,n)=>{"use strict";n.r(t);n.d(t,{DEFAULT_LANGUAGE_CODE:()=>d,Gettext:()=>m,ITranslator:()=>u,ITranslatorConnector:()=>c,NullTranslator:()=>g,TranslationManager:()=>_,TranslatorConnector:()=>h,nullTranslator:()=>v,requestTranslationsAPI:()=>l});var i=n(86503);var s=n(5592);var o=n(37737);var r=n(77256);const a="api/translations";async function l(e="",t="",n={},i=undefined){const s=i!==null&&i!==void 0?i:r.ServerConnection.makeSettings();e=e||`${s.appUrl}/${a}`;const l=o.URLExt.join(s.baseUrl,e);const d=o.URLExt.join(l,t);if(!d.startsWith(l)){throw new Error("Can only be used for translations requests")}let c;try{c=await r.ServerConnection.makeRequest(d,n,s)}catch(u){throw new r.ServerConnection.NetworkError(u)}let h=await c.text();if(h.length>0){try{h=JSON.parse(h)}catch(u){console.error("Not a JSON response body.",c)}}if(!c.ok){throw new r.ServerConnection.ResponseError(c,h.message||h)}return h}const d="en";const c=new s.Token("@jupyterlab/translation:ITranslatorConnector","A service to connect to the server translation endpoint.");class h extends i.DataConnector{constructor(e="",t){super();this._translationsUrl=e;this._serverSettings=t}async fetch(e){var t;return l(this._translationsUrl,(t=e===null||e===void 0?void 0:e.language)!==null&&t!==void 0?t:"",{},this._serverSettings)}}const u=new s.Token("@jupyterlab/translation:ITranslator","A service to translate strings.");function p(e){return e.replace("-","_")}class m{constructor(e){e=e||{};this._defaults={domain:"messages",locale:document.documentElement.getAttribute("lang")||d,pluralFunc:function(e){return{nplurals:2,plural:e!=1?1:0}},contextDelimiter:String.fromCharCode(4),stringsPrefix:""};this._locale=(e.locale||this._defaults.locale).replace("_","-");this._domain=p(e.domain||this._defaults.domain);this._contextDelimiter=e.contextDelimiter||this._defaults.contextDelimiter;this._stringsPrefix=e.stringsPrefix||this._defaults.stringsPrefix;this._pluralFuncs={};this._dictionary={};this._pluralForms={};if(e.messages){this._dictionary[this._domain]={};this._dictionary[this._domain][this._locale]=e.messages}if(e.pluralForms){this._pluralForms[this._locale]=e.pluralForms}}setContextDelimiter(e){this._contextDelimiter=e}getContextDelimiter(){return this._contextDelimiter}setLocale(e){this._locale=e.replace("_","-")}getLocale(){return this._locale}setDomain(e){this._domain=p(e)}getDomain(){return this._domain}setStringsPrefix(e){this._stringsPrefix=e}getStringsPrefix(){return this._stringsPrefix}static strfmt(e,...t){return e.replace(/%%/g,"%% ").replace(/%(\d+)/g,(function(e,n){return t[n-1]})).replace(/%% /g,"%")}loadJSON(e,t){if(!e[""]||!e[""]["language"]||!e[""]["pluralForms"]){throw new Error(`Wrong jsonData, it must have an empty key ("") with "language" and "pluralForms" information: ${e}`)}t=p(t);let n=e[""];let i=JSON.parse(JSON.stringify(e));delete i[""];this.setMessages(t||this._defaults.domain,n["language"],i,n["pluralForms"])}__(e,...t){return this.gettext(e,...t)}_n(e,t,n,...i){return this.ngettext(e,t,n,...i)}_p(e,t,...n){return this.pgettext(e,t,...n)}_np(e,t,n,i,...s){return this.npgettext(e,t,n,i,...s)}gettext(e,...t){return this.dcnpgettext("","",e,"",0,...t)}ngettext(e,t,n,...i){return this.dcnpgettext("","",e,t,n,...i)}pgettext(e,t,...n){return this.dcnpgettext("",e,t,"",0,...n)}npgettext(e,t,n,i,...s){return this.dcnpgettext("",e,t,n,i,...s)}dcnpgettext(e,t,n,i,s,...o){e=p(e)||this._domain;let r;let a=t?t+this._contextDelimiter+n:n;let l={pluralForm:false};let d=false;let c=this._locale;let h=this.expandLocale(this._locale);for(let p in h){c=h[p];d=this._dictionary[e]&&this._dictionary[e][c]&&this._dictionary[e][c][a];if(i){d=d&&this._dictionary[e][c][a].length>1}else{d=d&&this._dictionary[e][c][a].length==1}if(d){l.locale=c;break}}if(!d){r=[n];l.pluralFunc=this._defaults.pluralFunc}else{r=this._dictionary[e][c][a]}if(!i){return this.t(r,s,l,...o)}l.pluralForm=true;let u=d?r:[n,i];return this.t(u,s,l,...o)}expandLocale(e){let t=[e];let n=e.lastIndexOf("-");while(n>0){e=e.slice(0,n);t.push(e);n=e.lastIndexOf("-")}return t}getPluralFunc(e){let t=new RegExp("^\\s*nplurals\\s*=\\s*[0-9]+\\s*;\\s*plural\\s*=\\s*(?:\\s|[-\\?\\|&=!<>+*/%:;n0-9_()])+");if(!t.test(e))throw new Error(m.strfmt('The plural form "%1" is not valid',e));return new Function("n","let plural, nplurals; "+e+" return { nplurals: nplurals, plural: (plural === true ? 1 : (plural ? plural : 0)) };")}removeContext(e){if(e.indexOf(this._contextDelimiter)!==-1){let t=e.split(this._contextDelimiter);return t[1]}return e}t(e,t,n,...i){if(!n.pluralForm)return this._stringsPrefix+m.strfmt(this.removeContext(e[0]),...i);let s;if(n.pluralFunc){s=n.pluralFunc(t)}else if(!this._pluralFuncs[n.locale||""]){this._pluralFuncs[n.locale||""]=this.getPluralFunc(this._pluralForms[n.locale||""]);s=this._pluralFuncs[n.locale||""](t)}else{s=this._pluralFuncs[n.locale||""](t)}if("undefined"===typeof!s.plural||s.plural>s.nplurals||e.length<=s.plural)s.plural=0;return this._stringsPrefix+m.strfmt(this.removeContext(e[s.plural]),...[t].concat(i))}setMessages(e,t,n,i){e=p(e);if(i)this._pluralForms[t]=i;if(!this._dictionary[e])this._dictionary[e]={};this._dictionary[e][t]=n}}class g{constructor(e){this.languageCode=d;this._languageBundle=e}load(e){return this._languageBundle}}class f{__(e,...t){return this.gettext(e,...t)}_n(e,t,n,...i){return this.ngettext(e,t,n,...i)}_p(e,t,...n){return this.pgettext(e,t,...n)}_np(e,t,n,i,...s){return this.npgettext(e,t,n,i,...s)}gettext(e,...t){return m.strfmt(e,...t)}ngettext(e,t,n,...i){return m.strfmt(n==1?e:t,...[n].concat(i))}pgettext(e,t,...n){return m.strfmt(t,...n)}npgettext(e,t,n,i,...s){return this.ngettext(t,n,i,...s)}dcnpgettext(e,t,n,i,s,...o){return this.ngettext(n,i,s,...o)}}const v=new g(new f);class _{constructor(e="",t,n,i){this._domainData={};this._translationBundles={};this._connector=i!==null&&i!==void 0?i:new h(e,n);this._stringsPrefix=t||"";this._englishBundle=new m({stringsPrefix:this._stringsPrefix});this._currentLocale=d}get languageCode(){return this._currentLocale}async fetch(e){var t,n,i,s;this._languageData=await this._connector.fetch({language:e});let o;if(this._languageData&&e==="default"){try{for(const e of Object.values((t=this._languageData.data)!==null&&t!==void 0?t:{})){o=e[""]["language"];break}}catch(a){}}this._currentLocale=(e!=="default"?e:o!==null&&o!==void 0?o:d).replace("_","-");this._domainData=(i=(n=this._languageData)===null||n===void 0?void 0:n.data)!==null&&i!==void 0?i:{};const r=(s=this._languageData)===null||s===void 0?void 0:s.message;if(r&&this._currentLocale!==d){console.warn(r)}}load(e){if(this._domainData){if(this._currentLocale==d){return this._englishBundle}else{e=p(e);if(!(e in this._translationBundles)){let t=new m({domain:e,locale:this._currentLocale,stringsPrefix:this._stringsPrefix});if(e in this._domainData){const n=this._domainData[e][""];const i={...this._domainData[e],"":{...n,pluralForms:n.plural_forms}};t.loadJSON(i,e)}this._translationBundles[e]=t}return this._translationBundles[e]}}else{return this._englishBundle}}}},85205:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>a});var i=n(66127);var s=n.n(i);const o={id:"@jupyterlab/ui-components-extension:labicon-manager",description:"Provides the icon manager.",provides:i.ILabIconManager,autoStart:true,activate:e=>Object.create(null)};const r={id:"@jupyterlab/ui-components-extension:form-renderer-registry",description:"Provides the settings form renderer registry.",provides:i.IFormRendererRegistry,autoStart:true,activate:e=>{const t=new i.FormRendererRegistry;return t}};const a=[o,r]},77767:(e,t,n)=>{"use strict";var i=n(40662);var s=n(3579)},75634:(e,t,n)=>{"use strict";n.r(t);n.d(t,{AddButton:()=>as,Button:()=>u,Collapser:()=>es,CommandPaletteSvg:()=>wo,CommandToolbarButton:()=>Ks,CommandToolbarButtonComponent:()=>qs,ContextMenuSvg:()=>xo,DEFAULT_STYLE_CLASS:()=>ms,DEFAULT_UI_OPTIONS:()=>ss,DockPanelSvg:()=>jo,DropButton:()=>rs,FilenameSearcher:()=>no,FilterBox:()=>eo,FormComponent:()=>ps,FormRendererRegistry:()=>Po,HTMLSelect:()=>fs,HTML_SELECT_CLASS:()=>gs,HoverBox:()=>Mo,IFormRendererRegistry:()=>Do,IFrame:()=>vs,ILabIconManager:()=>Ao,IRankedMenu:()=>Cs,InputGroup:()=>bs,LabIcon:()=>C,MenuSvg:()=>So,MoveButton:()=>os,PanelWithToolbar:()=>Xs,RankedMenu:()=>xs,ReactWidget:()=>Ds,ReactiveToolbar:()=>Hs,SidePanel:()=>oo,Spinner:()=>ro,Styling:()=>ao,Switch:()=>co,TABLE_CLASS:()=>ho,TabBarSvg:()=>ko,TabPanelSvg:()=>Io,Table:()=>uo,Toolbar:()=>zs,ToolbarButton:()=>Us,ToolbarButtonComponent:()=>Ws,UseSignal:()=>Ps,VDomModel:()=>Ls,VDomRenderer:()=>As,WindowedLayout:()=>_o,WindowedList:()=>vo,WindowedListModel:()=>fo,addAboveIcon:()=>Nt,addBelowIcon:()=>Ot,addCommandToolbarButtonClass:()=>$s,addIcon:()=>Bt,addToolbarButtonClass:()=>Vs,badIcon:()=>S,bellIcon:()=>Ft,blankIcon:()=>k,bugDotIcon:()=>zt,bugIcon:()=>Ht,buildIcon:()=>Wt,caretDownEmptyIcon:()=>Vt,caretDownEmptyThinIcon:()=>Ut,caretDownIcon:()=>qt,caretLeftIcon:()=>$t,caretRightIcon:()=>Kt,caretUpEmptyThinIcon:()=>Jt,caretUpIcon:()=>Gt,caseSensitiveIcon:()=>Yt,checkIcon:()=>Xt,circleEmptyIcon:()=>Qt,circleIcon:()=>Zt,classes:()=>a,classesDedupe:()=>l,cleaningIcon:()=>en,clearIcon:()=>tn,closeAllIcon:()=>nn,closeIcon:()=>sn,codeCheckIcon:()=>on,codeIcon:()=>rn,collapseAllIcon:()=>an,collapseIcon:()=>ln,consoleIcon:()=>dn,copyIcon:()=>cn,copyrightIcon:()=>hn,cutIcon:()=>un,deleteIcon:()=>pn,dockBottomIcon:()=>mn,dockLeftIcon:()=>gn,dockRightIcon:()=>fn,dockTopIcon:()=>vn,dotsIcon:()=>_n,downloadIcon:()=>bn,duplicateIcon:()=>yn,editIcon:()=>wn,ellipsesIcon:()=>Cn,errorIcon:()=>xn,exceptionsIcon:()=>Sn,expandAllIcon:()=>kn,expandIcon:()=>jn,extensionIcon:()=>In,fastForwardIcon:()=>En,fileIcon:()=>Tn,fileUploadIcon:()=>Mn,filterDotIcon:()=>Dn,filterIcon:()=>An,filterListIcon:()=>Pn,folderFavoriteIcon:()=>Ln,folderIcon:()=>Rn,fuzzySearch:()=>Qs,getReactAttrs:()=>d,getTreeItemElement:()=>h,historyIcon:()=>Nn,homeIcon:()=>On,html5Icon:()=>Bn,imageIcon:()=>Fn,infoIcon:()=>zn,inspectorIcon:()=>Hn,jsonIcon:()=>Wn,juliaIcon:()=>Vn,jupyterFaviconIcon:()=>Un,jupyterIcon:()=>qn,jupyterlabWordmarkIcon:()=>$n,kernelIcon:()=>Kn,keyboardIcon:()=>Jn,launchIcon:()=>Gn,launcherIcon:()=>Yn,lineFormIcon:()=>Xn,linkIcon:()=>Qn,listIcon:()=>Zn,lockIcon:()=>ei,markdownIcon:()=>ti,mermaidIcon:()=>ni,moveDownIcon:()=>ii,moveUpIcon:()=>si,newFolderIcon:()=>oi,notTrustedIcon:()=>ri,notebookIcon:()=>ai,numberingIcon:()=>li,offlineBoltIcon:()=>di,openKernelSourceIcon:()=>ci,paletteIcon:()=>hi,pasteIcon:()=>ui,pauseIcon:()=>pi,pdfIcon:()=>mi,pythonIcon:()=>gi,rKernelIcon:()=>fi,reactIcon:()=>vi,redoIcon:()=>_i,refreshIcon:()=>bi,regexIcon:()=>yi,runIcon:()=>wi,runningIcon:()=>Ci,saveIcon:()=>xi,searchIcon:()=>Si,settingsIcon:()=>ki,shareIcon:()=>ji,spreadsheetIcon:()=>Ii,stepIntoIcon:()=>Ei,stepOutIcon:()=>Ti,stepOverIcon:()=>Mi,stopIcon:()=>Di,tabIcon:()=>Ai,tableRowsIcon:()=>Pi,tagIcon:()=>Li,terminalIcon:()=>Ri,textEditorIcon:()=>Ni,tocIcon:()=>Oi,treeViewIcon:()=>Bi,trustedIcon:()=>Fi,undoIcon:()=>zi,updateFilterFunction:()=>Zs,userIcon:()=>Hi,usersIcon:()=>Wi,variableIcon:()=>Vi,vegaIcon:()=>Ui,viewBreakpointIcon:()=>qi,wordIcon:()=>$i,yamlIcon:()=>Ki});var i=n(44914);var s=n.n(i);var o=n(37737);function r(e){return e.map((e=>e&&typeof e==="object"?Object.keys(e).map((t=>!!e[t]&&t)):typeof e==="string"?e.split(/\s+/):[])).reduce(((e,t)=>e.concat(t)),[]).filter((e=>!!e))}function a(...e){return r(e).join(" ")}function l(...e){return[...new Set(r(e))].join(" ")}function d(e,{ignore:t=[]}={}){return e.getAttributeNames().reduce(((n,i)=>{if(i==="style"||t.includes(i)){void 0}else if(i.startsWith("data")||i.startsWith("aria")){n[i]=e.getAttribute(i)}else{n[o.Text.camelCase(i)]=e.getAttribute(i)}return n}),{})}function c(e){return e instanceof HTMLElement&&e.getAttribute("role")==="treeitem"}function h(e){let t=e;while(t&&!c(t)){t=t.parentElement}return c(t)?t:null}function u(e){const{minimal:t,small:n,children:i,...o}=e;return s().createElement("button",{...o,className:a(e.className,t?"jp-mod-minimal":"",n?"jp-mod-small":"","jp-Button")},i)}var p=n(2336);var m=n(1143);var g=n(5592);var f=n(5338);const v='\n \n\n';const _='\n \n\n';const b='\n \n\n';var y=n(21326);var w;(function(e){const t={breadCrumb:{container:{$nest:{"&:first-child svg":{bottom:"1px",marginLeft:"0px",position:"relative"},"&:hover":{backgroundColor:"var(--jp-layout-color2)"},[".jp-mod-dropTarget&"]:{backgroundColor:"var(--jp-brand-color2)",opacity:.7}}},element:{borderRadius:"var(--jp-border-radius)",cursor:"pointer",margin:"0px 2px",padding:"0px 2px",height:"16px",width:"16px",verticalAlign:"middle"}},commandPaletteHeader:{container:{height:"14px",margin:"0 14px 0 auto"},element:{height:"14px",width:"14px"},options:{elementPosition:"center"}},commandPaletteItem:{element:{height:"16px",width:"16px"},options:{elementPosition:"center"}},launcherCard:{container:{height:"52px",width:"52px"},element:{height:"52px",width:"52px"},options:{elementPosition:"center"}},launcherSection:{container:{boxSizing:"border-box",marginRight:"12px",height:"32px",width:"32px"},element:{height:"32px",width:"32px"},options:{elementPosition:"center"}},listing:{container:{flex:"0 0 20px",marginRight:"4px",position:"relative"},element:{height:"16px",width:"16px"},options:{elementPosition:"center"}},listingHeaderItem:{container:{display:"inline",height:"16px",width:"16px"},element:{height:"auto",margin:"-2px 0 0 0",width:"20px"},options:{elementPosition:"center"}},mainAreaTab:{container:{$nest:{".lm-DockPanel-tabBar &":{marginRight:"4px"}}},element:{$nest:{".lm-DockPanel-tabBar &":{height:"14px",width:"14px"}}},options:{elementPosition:"center"}},menuItem:{container:{display:"inline-block",verticalAlign:"middle"},element:{height:"16px",width:"16px"},options:{elementPosition:"center"}},runningItem:{container:{margin:"0px 4px 0px 4px"},element:{height:"16px",width:"16px"},options:{elementPosition:"center"}},select:{container:{pointerEvents:"none"},element:{position:"absolute",height:"auto",width:"16px"}},settingsEditor:{container:{display:"flex",flex:"0 0 20px",margin:"0 3px 0 0",position:"relative",height:"20px",width:"20px"},element:{height:"16px",width:"16px"},options:{elementPosition:"center"}},sideBar:{element:{height:"auto",width:"20px"},options:{elementPosition:"center"}},splash:{container:{animation:"0.3s fade-in linear forwards",height:"100%",width:"100%",zIndex:1},element:{width:"100px"},options:{elementPosition:"center"}},statusBar:{element:{left:"0px",top:"0px",height:"18px",width:"20px",position:"relative"}},toolbarButton:{container:{display:"inline-block",verticalAlign:"middle"},element:{height:"16px",width:"16px"},options:{elementPosition:"center"}}};function n(e){return{container:{alignItems:"center",display:"flex"},element:{display:"block",...e}}}const i={center:n({margin:"0 auto",width:"100%"}),top:n({margin:"0 0 auto 0"}),right:n({margin:"0 0 0 auto"}),bottom:n({margin:"auto 0 0 0"}),left:n({margin:"0 auto 0 0"}),"top right":n({margin:"0 0 auto auto"}),"bottom right":n({margin:"auto 0 0 auto"}),"bottom left":n({margin:"auto auto 0 0"}),"top left":n({margin:"0 auto 0 auto"})};function s(e){return{element:{height:e,width:e}}}const o={small:s("14px"),normal:s("16px"),large:s("20px"),xlarge:s("24px")};function r(e){return{container:Object.assign({},...e.map((e=>e.container))),element:Object.assign({},...e.map((e=>e.element)))}}function a(e){if(!e){return[]}if(!Array.isArray(e)){e=[e]}return e.map((e=>typeof e==="string"?t[e]:e))}function l(e){const t=Object.assign({},...e.map((e=>e.options)));if(t.elementPosition){e.unshift(i[t.elementPosition])}if(t.elementSize){e.unshift(o[t.elementSize])}return r(e)}function d(e){var t;return(0,y.iF)({...e.container,$nest:{...(t=e.container)===null||t===void 0?void 0:t.$nest,["svg"]:e.element}})}const c=new Map;function h(e){if(!e||Object.keys(e).length===0){return""}let{elementPosition:t,elementSize:n,stylesheet:i,...s}=e;const o={...t&&{elementPosition:t},...n&&{elementSize:n}};const r=typeof i==="string"&&Object.keys(s).length===0;const h=r?[i,t,n].join(","):"";if(r&&c.has(h)){return c.get(h)}const u=a(i);u.push({element:s,options:o});const p=d(l(u));if(r){c.set(h,p)}return p}e.styleClass=h})(w||(w={}));class C{static remove(e){while(e.firstChild){e.firstChild.remove()}e.className="";return e}static resolve({icon:e}){if(e instanceof C){return e}if(typeof e==="string"){const t=C._instances.get(e);if(t){return t}if(C._debug){console.warn(`Lookup failed for icon, creating loading icon. icon: ${e}`)}return new C({name:e,svgstr:b,_loading:true})}return new C(e)}static resolveElement({icon:e,iconClass:t,fallback:n,...i}){if(!x.isResolvable(e)){if(!t&&n){return n.element(i)}i.className=a(t,i.className);return x.blankElement(i)}return C.resolve({icon:e}).element(i)}static resolveReact({icon:e,iconClass:t,fallback:n,...i}){if(!x.isResolvable(e)){if(!t&&n){return s().createElement(n.react,{...i})}i.className=a(t,i.className);return s().createElement(x.blankReact,{...i})}const o=C.resolve({icon:e});return s().createElement(o.react,{...i})}static resolveSvg({name:e,svgstr:t}){const n=(new DOMParser).parseFromString(x.svgstrShim(t),"image/svg+xml");const i=n.querySelector("parsererror");if(i){const n=`SVG HTML was malformed for LabIcon instance.\nname: ${e}, svgstr: ${t}`;if(C._debug){console.error(n);return i}else{console.warn(n);return null}}else{return n.documentElement}}static toggleDebug(e){C._debug=e!==null&&e!==void 0?e:!C._debug}constructor({name:e,svgstr:t,render:n,unrender:i,_loading:s=false}){this._props={};this._svgReplaced=new p.Signal(this);this._svgElement=undefined;this._svgInnerHTML=undefined;this._svgReactAttrs=undefined;if(!(e&&t)){console.error(`When defining a new LabIcon, name and svgstr must both be non-empty strings. name: ${e}, svgstr: ${t}`);return S}this._loading=s;if(C._instances.has(e)){const n=C._instances.get(e);if(this._loading){n.svgstr=t;this._loading=false;return n}else{if(C._debug){console.warn(`Redefining previously loaded icon svgstr. name: ${e}, svgstrOld: ${n.svgstr}, svgstr: ${t}`)}n.svgstr=t;return n}}this.name=e;this.react=this._initReact(e);this.svgstr=t;this._initRender({render:n,unrender:i});C._instances.set(this.name,this)}bindprops(e){const t=Object.create(this);t._props=e;t.react=t._initReact(t.name+"_bind");return t}element(e={}){var t;let{className:n,container:i,label:s,title:o,tag:r="div",...a}={...this._props,...e};const l=i===null||i===void 0?void 0:i.firstChild;if(((t=l===null||l===void 0?void 0:l.dataset)===null||t===void 0?void 0:t.iconId)===this._uuid){return l}if(!this.svgElement){return document.createElement("div")}if(i){while(i.firstChild){i.firstChild.remove()}}else if(r){i=document.createElement(r)}const d=this.svgElement.cloneNode(true);if(!i){if(s){console.warn()}return d}if(s!=null){i.textContent=s}x.initContainer({container:i,className:n,styleProps:a,title:o});i.appendChild(d);return i}render(e,t){var n;let i=(n=t===null||t===void 0?void 0:t.children)===null||n===void 0?void 0:n[0];if(typeof i!=="string"){i=undefined}this.element({container:e,label:i,...t===null||t===void 0?void 0:t.props})}get svgElement(){if(this._svgElement===undefined){this._svgElement=this._initSvg({uuid:this._uuid})}return this._svgElement}get svgInnerHTML(){if(this._svgInnerHTML===undefined){if(this.svgElement===null){this._svgInnerHTML=null}else{this._svgInnerHTML=this.svgElement.innerHTML}}return this._svgInnerHTML}get svgReactAttrs(){if(this._svgReactAttrs===undefined){if(this.svgElement===null){this._svgReactAttrs=null}else{this._svgReactAttrs=d(this.svgElement,{ignore:["data-icon-id"]})}}return this._svgReactAttrs}get svgstr(){return this._svgstr}set svgstr(e){this._svgstr=e;const t=g.UUID.uuid4();const n=this._uuid;this._uuid=t;this._svgElement=undefined;this._svgInnerHTML=undefined;this._svgReactAttrs=undefined;document.querySelectorAll(`[data-icon-id="${n}"]`).forEach((e=>{if(this.svgElement){e.replaceWith(this.svgElement.cloneNode(true))}}));this._svgReplaced.emit()}_initReact(e){const t=s().forwardRef(((e={},t)=>{const{className:n,container:i,label:o,title:r,slot:l,tag:d="div",...c}={...this._props,...e};const[,h]=s().useState(this._uuid);s().useEffect((()=>{const e=()=>{h(this._uuid)};this._svgReplaced.connect(e);return()=>{this._svgReplaced.disconnect(e)}}));const u=d!==null&&d!==void 0?d:s().Fragment;if(!(this.svgInnerHTML&&this.svgReactAttrs)){return s().createElement(s().Fragment,null)}const p={...this.svgReactAttrs};if(!d){Object.assign(p,{className:n||c?a(n,w.styleClass(c)):undefined,title:r,slot:l})}const m=s().createElement("svg",{...p,...this.svgReactAttrs,dangerouslySetInnerHTML:{__html:this.svgInnerHTML},ref:t});if(i){x.initContainer({container:i,className:n,styleProps:c,title:r});return s().createElement(s().Fragment,null,m,o)}else{let e={};if(u!==s().Fragment){e={className:n||c?a(n,w.styleClass(c)):undefined,title:r,slot:l}}return s().createElement(u,{...e},m,o)}}));t.displayName=`LabIcon_${e}`;return t}_initRender({render:e,unrender:t}){if(e){this.render=e;if(t){this.unrender=t}}else if(t){console.warn("In _initRender, ignoring unrender arg since render is undefined")}}_initSvg({title:e,uuid:t}={}){const n=C.resolveSvg(this);if(!n){return n}if(n.tagName!=="parsererror"){n.dataset.icon=this.name;if(t){n.dataset.iconId=t}if(e){x.setTitleSvg(n,e)}else{n.setAttribute("aria-hidden","true")}}return n}}C._debug=false;C._instances=new Map;var x;(function(e){function t({className:t="",container:n,label:i,title:s,tag:o="div",slot:r,...a}){if((n===null||n===void 0?void 0:n.className)===t){return n}if(n){while(n.firstChild){n.firstChild.remove()}}else{n=document.createElement(o!==null&&o!==void 0?o:"div")}if(i!=null){n.textContent=i}e.initContainer({container:n,className:t,styleProps:a,title:s});return n}e.blankElement=t;e.blankReact=s().forwardRef((({className:e="",container:t,label:i,title:o,tag:r="div",...l},d)=>{const c=r!==null&&r!==void 0?r:"div";if(t){n({container:t,className:e,styleProps:l,title:o});return s().createElement(s().Fragment,null)}else{return s().createElement(c,{className:a(e,w.styleClass(l))},d&&k.react({ref:d}),i)}}));e.blankReact.displayName="BlankReact";function n({container:e,className:t,styleProps:n,title:i}){if(i!=null){e.title=i}const s=w.styleClass(n);if(t!=null){const n=a(t,s);e.className=n;return n}else if(s){e.classList.add(s);return s}else{return""}}e.initContainer=n;function i(e){return!!(e&&(typeof e==="string"||e.name&&e.svgstr))}e.isResolvable=i;function o(e,t){const n=e.getElementsByTagName("title");if(n.length){n[0].textContent=t}else{const n=document.createElement("title");n.textContent=t;e.appendChild(n)}}e.setTitleSvg=o;function r(e,t=true){const[,n,i]=decodeURIComponent(e).replace(/>\s*\n\s*<").replace(/\s*\n\s*/g," ").match(t?/^(?:data:.*?(;base64)?,)?(.*)/:/(?:(base64).*)?({var t;const n=((t=e.translator)!==null&&t!==void 0?t:ts.nullTranslator).load("jupyterlab");let i;const o=()=>{if(e.direction==="up"){return!e.item.hasMoveUp}else{return!e.item.hasMoveDown}};if(e.buttonStyle==="icons"){const t={tag:"span",elementSize:"xlarge",elementPosition:"center"};i=e.direction==="up"?s().createElement(Gt.react,{...t}):s().createElement(qt.react,{...t})}else{i=e.direction==="up"?n.__("Move up"):n.__("Move down")}const r=e.direction==="up"?e.item.index-1:e.item.index+1;return s().createElement("button",{className:"jp-mod-styled jp-mod-reject jp-ArrayOperationsButton",onClick:e.item.onReorderClick(e.item.index,r),disabled:o()},i)};const rs=e=>{var t;const n=((t=e.translator)!==null&&t!==void 0?t:ts.nullTranslator).load("jupyterlab");let i;if(e.buttonStyle==="icons"){i=s().createElement(sn.react,{tag:"span",elementSize:"xlarge",elementPosition:"center"})}else{i=n.__("Remove")}return s().createElement("button",{className:"jp-mod-styled jp-mod-warn jp-ArrayOperationsButton",onClick:e.item.onDropIndexClick(e.item.index)},i)};const as=e=>{var t;const n=((t=e.translator)!==null&&t!==void 0?t:ts.nullTranslator).load("jupyterlab");let i;if(e.buttonStyle==="icons"){i=s().createElement(Bt.react,{tag:"span",elementSize:"xlarge",elementPosition:"center"})}else{i=n.__("Add")}return s().createElement("button",{className:"jp-mod-styled jp-mod-reject jp-ArrayOperationsButton",onClick:e.onAddClick},i)};function ls(e){const{component:t,name:n,buttonStyle:i,compact:s,showModifiedFromDefault:o,translator:r}=e;const a=s!==null&&s!==void 0?s:false;const l=i!==null&&i!==void 0?i:a?"icons":"text";const d=e=>t({...e,buttonStyle:l,compact:a,showModifiedFromDefault:o!==null&&o!==void 0?o:true,translator:r!==null&&r!==void 0?r:ts.nullTranslator});if(n){d.displayName=n}return d}function ds(e,t){const n=(0,is.getTemplate)("TitleFieldTemplate",e,t);const i=(0,is.getTemplate)("DescriptionFieldTemplate",e,t);return{TitleField:n,DescriptionField:i}}const cs=e=>ls({...e,name:"JupyterLabArrayTemplate",component:e=>{var t;const{schema:n,registry:i,uiSchema:o,required:r}=e;const a={schema:n,registry:i,uiSchema:o,required:r};const{TitleField:l,DescriptionField:d}=ds(i,o);return s().createElement("div",{className:e.className},e.compact?s().createElement("div",{className:"jp-FormGroup-compactTitle"},s().createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem",id:`${e.idSchema.$id}__title`},e.title||""),s().createElement("div",{className:"jp-FormGroup-description",id:`${e.idSchema.$id}-description`},e.schema.description||"")):s().createElement(s().Fragment,null,e.title&&s().createElement(l,{...a,title:e.title,id:`${e.idSchema.$id}-title`}),s().createElement(d,{...a,id:`${e.idSchema.$id}-description`,description:(t=e.schema.description)!==null&&t!==void 0?t:""})),e.items.map((t=>s().createElement("div",{key:t.key,className:t.className},t.children,s().createElement("div",{className:"jp-ArrayOperations"},s().createElement(os,{buttonStyle:e.buttonStyle,translator:e.translator,item:t,direction:"up"}),s().createElement(os,{buttonStyle:e.buttonStyle,translator:e.translator,item:t,direction:"down"}),s().createElement(rs,{buttonStyle:e.buttonStyle,translator:e.translator,item:t}))))),e.canAdd&&s().createElement(as,{onAddClick:e.onAddClick,buttonStyle:e.buttonStyle,translator:e.translator}))}});const hs=e=>ls({...e,name:"JupyterLabObjectTemplate",component:e=>{var t;const{schema:n,registry:i,uiSchema:o,required:r}=e;const a={schema:n,registry:i,uiSchema:o,required:r};const{TitleField:l,DescriptionField:d}=ds(i,o);return s().createElement("fieldset",{id:e.idSchema.$id},e.compact?s().createElement("div",{className:"jp-FormGroup-compactTitle"},s().createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem",id:`${e.idSchema.$id}__title`},e.title||""),s().createElement("div",{className:"jp-FormGroup-description",id:`${e.idSchema.$id}__description`},e.schema.description||"")):s().createElement(s().Fragment,null,(e.title||(e.uiSchema||g.JSONExt.emptyObject)["ui:title"])&&s().createElement(l,{...a,id:`${e.idSchema.$id}__title`,title:e.title||`${(e.uiSchema||g.JSONExt.emptyObject)["ui:title"]}`||""}),s().createElement(d,{...a,id:`${e.idSchema.$id}__description`,description:(t=e.schema.description)!==null&&t!==void 0?t:""})),e.properties.map((e=>e.content)),(0,is.canExpand)(e.schema,e.uiSchema,e.formData)&&s().createElement(as,{onAddClick:e.onAddClick(e.schema),buttonStyle:e.buttonStyle,translator:e.translator}))}});const us=e=>ls({...e,name:"JupyterLabFieldTemplate",component:e=>{var t;const n=((t=e.translator)!==null&&t!==void 0?t:ts.nullTranslator).load("jupyterlab");let i=false;let o;const{formData:r,schema:a,label:l,displayLabel:d,id:c,formContext:h,errors:u,rawErrors:p,children:m,onKeyChange:f,onDropPropertyClick:v}=e;const{defaultFormData:_}=h;const b=c.split("_");b.shift();const y=b.join(".");const w=y==="";const C=y===(e.uiSchema||g.JSONExt.emptyObject)["ui:field"];if(e.showModifiedFromDefault){o=b.reduce(((e,t)=>e===null||e===void 0?void 0:e[t]),_);i=!w&&r!==undefined&&o!==undefined&&!a.properties&&a.type!=="array"&&!g.JSONExt.deepEqual(r,o)}const x=!w&&a.type!="object"&&c!="jp-SettingsEditor-@jupyterlab/shortcuts-extension:shortcuts_shortcuts";const S=a.hasOwnProperty(is.ADDITIONAL_PROPERTY_FLAG);const k=!(a.type==="object"||a.type==="array");return s().createElement("div",{className:`form-group ${d||a.type==="boolean"?"small-field":""}`},!C&&((p===null||p===void 0?void 0:p.length)?s().createElement("div",{className:"jp-modifiedIndicator jp-errorIndicator"}):i&&s().createElement("div",{className:"jp-modifiedIndicator"})),s().createElement("div",{className:`jp-FormGroup-content ${e.compact?"jp-FormGroup-contentCompact":"jp-FormGroup-contentNormal"}`},k&&d&&!w&&l&&!S?e.compact?s().createElement("div",{className:"jp-FormGroup-compactTitle"},s().createElement("div",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},l),k&&a.description&&x&&s().createElement("div",{className:"jp-FormGroup-description"},a.description)):s().createElement("h3",{className:"jp-FormGroup-fieldLabel jp-FormGroup-contentItem"},l):s().createElement(s().Fragment,null),S&&s().createElement("input",{className:"jp-FormGroup-contentItem jp-mod-styled",type:"text",onBlur:e=>f(e.target.value),defaultValue:l}),s().createElement("div",{className:`${w?"jp-root":a.type==="object"?"jp-objectFieldWrapper":a.type==="array"?"jp-arrayFieldWrapper":"jp-inputFieldWrapper jp-FormGroup-contentItem"}`},m),S&&s().createElement("button",{className:"jp-FormGroup-contentItem jp-mod-styled jp-mod-warn jp-FormGroup-removeButton",onClick:v(l)},n.__("Remove")),!e.compact&&a.description&&x&&s().createElement("div",{className:"jp-FormGroup-description"},a.description),i&&o!==undefined&&a.type!=="object"&&s().createElement("div",{className:"jp-FormGroup-default"},n.__("Default: %1",o!==null?o.toLocaleString():"null")),s().createElement("div",{className:"validationErrors"},u)))}});function ps(e){const{buttonStyle:t,compact:n,showModifiedFromDefault:i,translator:o,formContext:r,...a}=e;const l={...a.uiSchema||g.JSONExt.emptyObject};l["ui:options"]={...ss,...l["ui:options"]};a.uiSchema=l;const{FieldTemplate:d,ArrayFieldTemplate:c,ObjectFieldTemplate:h}=e.templates||g.JSONExt.emptyObject;const u={buttonStyle:t,compact:n,showModifiedFromDefault:i,translator:o};const p=s().useMemo((()=>d!==null&&d!==void 0?d:us(u)),[d,t,n,i,o]);const m=s().useMemo((()=>c!==null&&c!==void 0?c:cs(u)),[c,t,n,i,o]);const f=s().useMemo((()=>h!==null&&h!==void 0?h:hs(u)),[h,t,n,i,o]);const v={FieldTemplate:p,ArrayFieldTemplate:m,ObjectFieldTemplate:f};return s().createElement(ns.Ay,{templates:v,formContext:r,...a})}const ms="jp-DefaultStyle";const gs="jp-HTMLSelect";class fs extends i.Component{render(){const{className:e,defaultStyle:t=true,disabled:n,elementRef:s,iconProps:o,icon:r=Vt,options:l=[],...d}=this.props;const c=a(gs,{[ms]:t},e);const h=e=>{e.stopPropagation()};const u=l.map((e=>{const t=typeof e==="object"?e:{value:e};return i.createElement("option",{...t,key:t.value},t.label||t.value)}));return i.createElement("div",{className:c},i.createElement("select",{onFocus:h,disabled:n,ref:s,...d,multiple:false},u,d.children),i.createElement(r.react,{tag:"span",stylesheet:"select",right:"4px",top:"8px",...o}))}}class vs extends m.Widget{constructor(e={}){super({node:_s.createNode()});this._sandbox=[];this.addClass("jp-IFrame");this.sandbox=e.sandbox||[];this.referrerPolicy=e.referrerPolicy||"no-referrer";this.loading=e.loading||"eager"}get referrerPolicy(){return this._referrerPolicy}set referrerPolicy(e){if(this._referrerPolicy===e){return}this._referrerPolicy=e;const t=this.node.querySelector("iframe");t.setAttribute("referrerpolicy",e)}get loading(){return this._loading}set loading(e){if(this._loading===e){return}this._loading=e;const t=this.node.querySelector("iframe");t.setAttribute("loading",e)}get sandbox(){return this._sandbox.slice()}set sandbox(e){this._sandbox=e.slice();const t=this.node.querySelector("iframe");const n=e.length?e.join(" "):"";t.setAttribute("sandbox",n)}get url(){return this.node.querySelector("iframe").getAttribute("src")||""}set url(e){this.node.querySelector("iframe").setAttribute("src",e)}}var _s;(function(e){function t(){const e=document.createElement("div");const t=document.createElement("iframe");t.setAttribute("sandbox","");t.style.height="100%";t.style.width="100%";e.appendChild(t);return e}e.createNode=t})(_s||(_s={}));function bs(e){const{className:t,inputRef:n,rightIcon:i,...o}=e;return s().createElement("div",{className:a("jp-InputGroup",t)},s().createElement("input",{ref:n,...o}),i&&s().createElement("span",{className:"jp-InputGroupAction"},typeof i==="string"?s().createElement(C.resolveReact,{icon:i,elementPosition:"center",tag:"span"}):s().createElement(i.react,{elementPosition:"center",tag:"span"})))}var ys=n(34236);var ws=n(90044);var Cs;(function(e){e.DEFAULT_RANK=100})(Cs||(Cs={}));class xs extends m.Menu{constructor(e){var t;super(e);this._ranks=[];this.addClass("jp-ThemedContainer");this._rank=e.rank;this._includeSeparators=(t=e.includeSeparators)!==null&&t!==void 0?t:true}get rank(){return this._rank}addGroup(e,t){if(e.length===0){return new ws.DisposableDelegate((()=>void 0))}const n=t!==null&&t!==void 0?t:Cs.DEFAULT_RANK;const i=e.map((e=>{var t;return{...e,rank:(t=e.rank)!==null&&t!==void 0?t:n}})).sort(((e,t)=>e.rank-t.rank));let s=this._ranks.findIndex((e=>i[0].rankthis.insertItem(s++,e))));if(this._includeSeparators){o.push(this.insertItem(s++,{type:"separator",rank:n}))}return new ws.DisposableDelegate((()=>{o.forEach((e=>e.dispose()))}))}addItem(e){let t=-1;if(e.rank){t=this._ranks.findIndex((t=>e.rank{e.disposed.disconnect(n,this);this.dispose()};this._menu.disposed.connect(n,this)}get isDisposed(){return this._isDisposed}get type(){return this._item.deref().type}get command(){return this._item.deref().command}get args(){return this._item.deref().args}get submenu(){return this._item.deref().submenu}get label(){return this._item.deref().label}get mnemonic(){return this._item.deref().mnemonic}get icon(){return this._item.deref().icon}get iconClass(){return this._item.deref().iconClass}get iconLabel(){return this._item.deref().iconLabel}get caption(){return this._item.deref().caption}get className(){return this._item.deref().className}get dataset(){return this._item.deref().dataset}get isEnabled(){return this._item.deref().isEnabled}get isToggled(){return this._item.deref().isToggled}get isVisible(){return this._item.deref().isVisible}get keyBinding(){return this._item.deref().keyBinding}dispose(){if(this._isDisposed){return}this._isDisposed=true;const e=this._item.deref();if(e&&!this._menu.isDisposed){this._menu.removeItem(e)}p.Signal.clearData(this)}}var ks=n(54158);var js=n(78173);var Is=n(93247);var Es=n(42856);var Ts=n(94466);var Ms=n(26568);class Ds extends m.Widget{constructor(){super();this._rootDOM=null}static create(e){return new class extends Ds{render(){return e}}}onUpdateRequest(e){this.renderPromise=this.renderDOM()}onAfterAttach(e){Es.MessageLoop.sendMessage(this,m.Widget.Msg.UpdateRequest)}onBeforeDetach(e){if(this._rootDOM!==null){this._rootDOM.unmount();this._rootDOM=null}}renderDOM(){return new Promise((e=>{const t=this.render();if(this._rootDOM===null){this._rootDOM=(0,f.H)(this.node)}if(Array.isArray(t)){this._rootDOM.render(t);requestIdleCallback((()=>e()))}else if(t){this._rootDOM.render(t);requestIdleCallback((()=>e()))}else{this._rootDOM.unmount();this._rootDOM=null;requestIdleCallback((()=>e()))}}))}}class As extends Ds{constructor(e){super();this._modelChanged=new p.Signal(this);this.model=e!==null&&e!==void 0?e:null}get modelChanged(){return this._modelChanged}set model(e){if(this._model===e){return}if(this._model){this._model.stateChanged.disconnect(this.update,this)}this._model=e;if(e){e.stateChanged.connect(this.update,this)}this.update();this._modelChanged.emit(void 0)}get model(){return this._model}dispose(){if(this.isDisposed){return}this._model=null;super.dispose()}}class Ps extends i.Component{constructor(e){super(e);this.slot=(e,t)=>{if(this.props.shouldUpdate&&!this.props.shouldUpdate(e,t)){return}this.setState({value:[e,t]})};this.state={value:[this.props.initialSender,this.props.initialArgs]}}componentDidMount(){this.props.signal.connect(this.slot)}componentWillUnmount(){this.props.signal.disconnect(this.slot)}render(){return this.props.children(...this.state.value)}}class Ls{constructor(){this.stateChanged=new p.Signal(this);this._isDisposed=false}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;p.Signal.clearData(this)}}(0,js.provideJupyterDesignSystem)().register([(0,js.jpButton)(),(0,js.jpToolbar)()]);(0,js.addJupyterLabThemeChangeListener)();const Rs="jp-Toolbar";const Ns="jp-Toolbar-item";const Os="toolbar-popup-opener";const Bs="jp-Toolbar-spacer";class Fs extends m.PanelLayout{constructor(){super(...arguments);this._dirty=false}onFitRequest(e){super.onFitRequest(e);if(this.parent.isAttached){if((0,ys.some)(this.widgets,(e=>!e.isHidden))){this.parent.node.style.minHeight="var(--jp-private-toolbar-height)";this.parent.removeClass("jp-Toolbar-micro")}else{this.parent.node.style.minHeight="";this.parent.addClass("jp-Toolbar-micro")}}this._dirty=true;if(this.parent.parent){Es.MessageLoop.sendMessage(this.parent.parent,m.Widget.Msg.FitRequest)}if(this._dirty){Es.MessageLoop.sendMessage(this.parent,m.Widget.Msg.UpdateRequest)}}onUpdateRequest(e){super.onUpdateRequest(e);if(this.parent.isVisible){this._dirty=false}}onChildShown(e){super.onChildShown(e);this.parent.fit()}onChildHidden(e){super.onChildHidden(e);this.parent.fit()}onBeforeAttach(e){super.onBeforeAttach(e);this.parent.fit()}attachWidget(e,t){super.attachWidget(e,t);this.parent.fit()}detachWidget(e,t){super.detachWidget(e,t);this.parent.fit()}}class zs extends m.Widget{constructor(e={}){var t,n;super({node:document.createElement("jp-toolbar")});this.addClass(Rs);this.layout=(t=e.layout)!==null&&t!==void 0?t:new Fs;this.noFocusOnClick=(n=e.noFocusOnClick)!==null&&n!==void 0?n:false}names(){const e=this.layout;return(0,ys.map)(e.widgets,(e=>Ys.nameProperty.get(e)))}addItem(e,t){const n=this.layout;return this.insertItem(n.widgets.length,e,t)}insertItem(e,t,n){const i=(0,ys.find)(this.names(),(e=>e===t));if(i){return false}n.addClass(Ns);const s=this.layout;const o=Math.max(0,Math.min(e,s.widgets.length));s.insertWidget(o,n);Ys.nameProperty.set(n,t);n.node.dataset["jpItemName"]=t;if(this.noFocusOnClick){n.node.dataset["noFocusOnClick"]="true"}return true}insertAfter(e,t,n){return this.insertRelative(e,1,t,n)}insertBefore(e,t,n){return this.insertRelative(e,0,t,n)}insertRelative(e,t,n,i){const s=(0,ys.map)(this.names(),((e,t)=>({name:e,index:t})));const o=(0,ys.find)(s,(t=>t.name===e));if(o){return this.insertItem(o.index+t,n,i)}return false}handleEvent(e){switch(e.type){case"click":this.handleClick(e);break;default:break}}handleClick(e){e.stopPropagation();if(e.target instanceof HTMLLabelElement){const t=e.target.getAttribute("for");if(t&&this.node.querySelector(`#${t}`)){return}}if(this.node.contains(document.activeElement)){return}if(this.parent){this.parent.activate()}}onAfterAttach(e){this.node.addEventListener("click",this)}onBeforeDetach(e){this.node.removeEventListener("click",this)}}class Hs extends zs{constructor(e={}){super(e);this.popupOpener=new Gs;this._widgetWidths=new Map;this._widgetPositions=new Map;this._zoomChanged=true;this.insertItem(0,Os,this.popupOpener);this.popupOpener.hide();this._resizer=new Ms.Throttler((async(e=false)=>{await this._onResize(e)}),500)}dispose(){if(this.isDisposed){return}if(this._resizer){this._resizer.dispose()}super.dispose()}insertAfter(e,t,n){if(e===Os){return false}return super.insertAfter(e,t,n)}insertRelative(e,t,n,i){const s=this._widgetPositions.get(e);const o=(s!==null&&s!==void 0?s:0)+t;return this.insertItem(o,n,i)}insertItem(e,t,n){var i;let s;if(n instanceof Gs){s=super.insertItem(e,t,n)}else{const i=Math.max(0,Math.min(e,this.layout.widgets.length-1));s=super.insertItem(i,t,n);if(i!==e){e=Math.max(0,Math.min(e,this._widgetPositions.size))}}if(t!==Os&&this._widgetPositions.get(t)!==e){const n=(i=this._widgetPositions.get(t))!==null&&i!==void 0?i:this._widgetPositions.size;this._widgetPositions.forEach(((t,i)=>{if(i!==Os){if(t>=e&&tn){this._widgetPositions.set(i,t-1)}}}));this._widgetPositions.set(t,e);if(this.isVisible){void this._resizer.invoke()}}return s}onAfterShow(e){void this._resizer.invoke(true)}onBeforeHide(e){this.popupOpener.hidePopup();super.onBeforeHide(e)}onResize(e){super.onResize(e);const t=Math.round(window.outerWidth/window.innerWidth*100);if(t!==this._zoom){this._zoomChanged=true;this._zoom=t}if(e.width>0&&this._resizer){void this._resizer.invoke()}}async _onResize(e=false){if(!(this.parent&&this.parent.isAttached)){return}const t=this.node.clientWidth;const n=this.popupOpener;const i=32;const s=2+5;let o=n.isHidden?s:s+i;return this._getWidgetsToRemove(o,t,i).then((async s=>{var o,r;let{width:a,widgetsToRemove:l}=s;while(l.length>0){const e=l.pop();const t=Ys.nameProperty.get(e);a-=this._widgetWidths.get(t)||0;const i=(o=this._widgetPositions.get(t))!==null&&o!==void 0?o:0;let s=this._widgetPositions.size;const d=n.widgetAt(0);if(d){const e=Ys.nameProperty.get(d);s=(r=this._widgetPositions.get(e))!==null&&r!==void 0?r:s}const c=i-s;n.insertWidget(c,e)}if(n.widgetCount()>0){const e=[];let s=0;const o=n.widgetCount();while(s0){const t=e.shift();const n=Ys.nameProperty.get(t);if(this._widgetPositions.has(n)){this.insertItem(this._widgetPositions.get(n),n,t)}else{this.addItem(n,t)}}}if(n.widgetCount()>0){n.updatePopup();n.show()}else{n.hide()}if(e){await this._onResize()}})).catch((e=>{console.error("Error while computing the ReactiveToolbar",e)}))}async _getWidgetsToRemove(e,t,n){var i;const s=this.popupOpener;const o=[...this.layout.widgets];const r=o.length-1;const a=[];let l=0;while(lt){e+=n}if(e>t||((i=this._widgetPositions.get(d))!==null&&i!==void 0?i:0)>l){a.push(r)}l++}this._zoomChanged=false;return{width:e,widgetsToRemove:a}}async _saveWidgetWidth(e,t){if(t instanceof Ds){await t.renderPromise}const n=t.hasClass(Bs)?2:t.node.clientWidth;this._widgetWidths.set(e,n);return n}_getWidgetWidth(e){const t=Ys.nameProperty.get(e);return this._widgetWidths.get(t)||0}}(function(e){function t(){return new Ys.Spacer}e.createSpacerItem=t})(zs||(zs={}));function Ws(e){var t,n,s;const o=((t=e.noFocusOnClick)!==null&&t!==void 0?t:false)?undefined:t=>{var n;if(t.button===0){(n=e.onClick)===null||n===void 0?void 0:n.call(e);t.target.focus()}};const r=((n=e.noFocusOnClick)!==null&&n!==void 0?n:false)?t=>{var n;if(t.button===0){t.preventDefault();(n=e.onClick)===null||n===void 0?void 0:n.call(e)}}:undefined;const l=t=>{var n;const{key:i}=t;if(i==="Enter"||i===" "){(n=e.onClick)===null||n===void 0?void 0:n.call(e)}};const d=()=>{if(e.enabled===false&&e.disabledTooltip){return e.disabledTooltip}else if(e.pressed&&e.pressedTooltip){return e.pressedTooltip}else{return e.tooltip||e.iconLabel}};const c=d();const h=e.enabled===false;return i.createElement(ks.Button,{appearance:"stealth",className:e.className?e.className+" jp-ToolbarButtonComponent":"jp-ToolbarButtonComponent","aria-disabled":h,"aria-label":e.label||c,"aria-pressed":e.pressed,...Ys.normalizeDataset(e.dataset),disabled:h,onClick:o,onMouseDown:r,onKeyDown:l,title:c},(e.icon||e.iconClass)&&i.createElement(C.resolveReact,{icon:e.pressed?(s=e.pressedIcon)!==null&&s!==void 0?s:e.icon:e.icon,iconClass:a(e.iconClass,"jp-Icon"),tag:null}),e.label&&i.createElement("span",{className:"jp-ToolbarButtonComponent-label"},e.label))}function Vs(e){e.addClass("jp-ToolbarButton");return e}class Us extends Ds{constructor(e={}){var t,n;super();this.props=e;Vs(this);this._enabled=(t=e.enabled)!==null&&t!==void 0?t:true;this._pressed=this._enabled&&((n=e.pressed)!==null&&n!==void 0?n:false);this._onClick=e.onClick}set pressed(e){if(this.enabled&&e!==this._pressed){this._pressed=e;this.update()}}get pressed(){return this._pressed}set enabled(e){if(e!=this._enabled){this._enabled=e;if(!this._enabled){this._pressed=false}this.update()}}get enabled(){return this._enabled}set onClick(e){if(e!==this._onClick){this._onClick=e;this.update()}}get onClick(){return this._onClick}render(){return i.createElement(Ws,{...this.props,noFocusOnClick:this.props.noFocusOnClick,pressed:this.pressed,enabled:this.enabled,onClick:this.onClick})}}function qs(e){return i.createElement(Ps,{signal:e.commands.commandChanged,shouldUpdate:(t,n)=>n.id===e.id&&n.type==="changed"||n.type==="many-changed"},(()=>e.commands.listCommands().includes(e.id)?i.createElement(Ws,{...Ys.propsFromCommand(e)}):null))}function $s(e){e.addClass("jp-CommandToolbarButton");return e}class Ks extends Ds{constructor(e){super();this.props=e;const{commands:t,id:n,args:i}=e;$s(this);this.setCommandAttributes(t,n,i);t.commandChanged.connect(((s,o)=>{if(o.id===e.id){this.setCommandAttributes(t,n,i)}}),this)}setCommandAttributes(e,t,n){if(e.isToggled(t,n)){this.addClass("lm-mod-toggled")}else{this.removeClass("lm-mod-toggled")}if(e.isVisible(t,n)){this.removeClass("lm-mod-hidden")}else{this.addClass("lm-mod-hidden")}if(e.isEnabled(t,n)){if("disabled"in this.node){this.node.disabled=false}}else{if("disabled"in this.node){this.node.disabled=true}}}render(){return i.createElement(qs,{...this.props})}get commandId(){return this.props.id}}class Js extends m.Widget{constructor(){super({node:document.createElement("jp-toolbar")});this.width=0;this.node.setAttribute("aria-label","Responsive popup toolbar");this.addClass("jp-Toolbar");this.addClass("jp-Toolbar-responsive-popup");this.addClass("jp-ThemedContainer");this.layout=new m.PanelLayout;m.Widget.attach(this,document.body);this.hide()}updateWidth(e){if(e>0){this.width=e;this.node.style.width=`${e}px`}}alignTo(e){const{height:t,width:n,x:i,y:s}=e.node.getBoundingClientRect();const o=this.width;this.node.style.left=`${i+n-o+1}px`;this.node.style.top=`${s+t+1}px`}insertWidget(e,t){this.layout.insertWidget(e,t)}widgetCount(){return this.layout.widgets.length}widgetAt(e){return this.layout.widgets[e]}}class Gs extends Us{constructor(e={}){const t=(e.translator||ts.nullTranslator).load("jupyterlab");super({icon:Cn,onClick:()=>{this.handleClick()},tooltip:t.__("More commands")});this.addClass("jp-Toolbar-responsive-opener");this.popup=new Js}addWidget(e){this.popup.insertWidget(0,e)}insertWidget(e,t){this.popup.insertWidget(e,t)}dispose(){if(this.isDisposed){return}this.popup.dispose();super.dispose()}hide(){super.hide();this.hidePopup()}hidePopup(){this.popup.hide()}updatePopup(){this.popup.updateWidth(this.parent.node.clientWidth);this.popup.alignTo(this.parent)}widgetAt(e){return this.popup.widgetAt(e)}widgetCount(){return this.popup.widgetCount()}handleClick(){this.updatePopup();this.popup.setHidden(!this.popup.isHidden)}}var Ys;(function(e){function t(e){if(!e){return undefined}const t={};for(const[n,i]of Object.entries(e)){const e=n.startsWith("data-")?n:`data-${n}`;t[e]=i}return t}e.normalizeDataset=t;function n(e){var t,n;const{commands:i,id:s,args:o}=e;const r=i.iconClass(s,o);const a=i.iconLabel(s,o);const l=(t=e.icon)!==null&&t!==void 0?t:i.icon(s,o);const d=i.label(s,o);let c=i.className(s,o);let h;if(i.isToggleable(s,o)){h=i.isToggled(s,o);if(h){c+=" lm-mod-toggled"}}if(!i.isVisible(s,o)){c+=" lm-mod-hidden"}const u=typeof e.label==="function"?e.label(o!==null&&o!==void 0?o:{}):e.label;let p=i.caption(s,o)||u||d||a;const m=i.keyBindings.find((e=>e.command===s));if(m){const e=m.keys.map(Is.CommandRegistry.formatKeystroke).join(", ");p=`${p} (${e})`}const g=()=>{void i.execute(s,o)};const f=i.isEnabled(s,o);return{className:c,dataset:{"data-command":e.id},noFocusOnClick:e.noFocusOnClick,icon:l,iconClass:r,tooltip:(n=e.caption)!==null&&n!==void 0?n:p,onClick:g,enabled:f,label:u!==null&&u!==void 0?u:d,pressed:h}}e.propsFromCommand=n;e.nameProperty=new Ts.AttachedProperty({name:"name",create:()=>""});class i extends m.Widget{constructor(){super();this.addClass(Bs)}}e.Spacer=i})(Ys||(Ys={}));class Xs extends m.Panel{constructor(e={}){super(e);this._toolbar=new zs}get toolbar(){return this._toolbar}}function Qs(e,t){let n=Infinity;let i=null;const s=/[\p{L}\p{N}\p{M}]+/gu;let o=true;while(o){let o=s.exec(e);if(!o){break}let r=ys.StringExt.matchSumOfDeltas(e,t,o.index);if(!r){break}if(r&&r.score<=n){n=r.score;i=r.indices}}if(!i||n===Infinity){return null}return{score:n,indices:i}}const Zs=(e,t,n)=>i=>{if(t){const t=e.toLowerCase();return Qs(i,t)}if(!n){i=i.toLocaleLowerCase();e=e.toLocaleLowerCase()}const s=i.indexOf(e);if(s===-1){return null}return{indices:[...Array(e.length).keys()].map((e=>e+s))}};const eo=e=>{var t,n,o;const[r,a]=(0,i.useState)((t=e.initialQuery)!==null&&t!==void 0?t:"");if(e.forceRefresh){(0,i.useEffect)((()=>{e.updateFilter((e=>({})))}),[])}const l=(0,i.useRef)(true);const d=(n=e.inputRef)!==null&&n!==void 0?n:(0,i.useRef)();(0,i.useEffect)((()=>{if(l.current){l.current=false;if(e.initialQuery!==undefined){e.updateFilter(Zs(e.initialQuery,e.useFuzzyFilter,e.caseSensitive),e.initialQuery)}}else{if(d.current){e.updateFilter(Zs(d.current.value,e.useFuzzyFilter,e.caseSensitive),d.current.value)}}}),[e.updateFilter,e.useFuzzyFilter,e.caseSensitive]);const c=(0,i.useCallback)((t=>{const n=t.target;a(n.value);e.updateFilter(Zs(n.value,e.useFuzzyFilter,e.caseSensitive),n.value)}),[e.updateFilter,e.useFuzzyFilter,e.caseSensitive]);const h=(o=e.showIcon)!==null&&o!==void 0?o:true;return s().createElement(ks.Search,{role:"search",className:"jp-FilterBox",ref:e.inputRef,value:r,onChange:c,onInput:c,placeholder:e.placeholder,disabled:e.disabled},h&&s().createElement(Si.react,{slot:"end",tag:null}))};class to extends Ds{constructor(e){var t;super();this._filterBoxProps={...e};(t=e===null||e===void 0?void 0:e.filterSettingsChanged)===null||t===void 0?void 0:t.connect(((e,t)=>{this._updateProps(t)}),this)}render(){return s().createElement(eo,{...this._filterBoxProps})}_updateProps(e){Object.assign(this._filterBoxProps,e);this.update()}}const no=e=>new to(e);class io extends m.AccordionLayout{constructor(){super(...arguments);this._toolbars=new WeakMap}insertWidget(e,t){if(t.toolbar){this._toolbars.set(t,t.toolbar);t.toolbar.addClass("jp-AccordionPanel-toolbar")}super.insertWidget(e,t)}removeWidgetAt(e){const t=this.widgets[e];super.removeWidgetAt(e);if(t&&this._toolbars.has(t)){this._toolbars.delete(t)}}updateTitle(e,t){super.updateTitle(e,t);this._addToolbar(e,t)}attachWidget(e,t){super.attachWidget(e,t);this._addToolbar(e,t)}detachWidget(e,t){const n=this._toolbars.get(t);if(n){if(this.parent.isAttached){Es.MessageLoop.sendMessage(n,m.Widget.Msg.BeforeDetach)}this.titles[e].removeChild(n.node);if(this.parent.isAttached){Es.MessageLoop.sendMessage(n,m.Widget.Msg.AfterDetach)}}super.detachWidget(e,t)}onBeforeAttach(e){this.notifyToolbars(e);super.onBeforeAttach(e)}onAfterAttach(e){super.onAfterAttach(e);this.notifyToolbars(e)}onBeforeDetach(e){this.notifyToolbars(e);super.onBeforeDetach(e)}onAfterDetach(e){super.onAfterDetach(e);this.notifyToolbars(e)}_addToolbar(e,t){const n=this._toolbars.get(t);if(n){if(this.parent.isAttached){Es.MessageLoop.sendMessage(n,m.Widget.Msg.BeforeAttach)}this.titles[e].appendChild(n.node);if(this.parent.isAttached){Es.MessageLoop.sendMessage(n,m.Widget.Msg.AfterAttach)}}}notifyToolbars(e){this.widgets.forEach((t=>{const n=this._toolbars.get(t);if(n){n.processMessage(e)}}))}}var so;(function(e){class t extends m.AccordionPanel.Renderer{createCollapseIcon(e){const t=document.createElement("div");qt.element({container:t});return t}createSectionTitle(e){const t=super.createSectionTitle(e);t.classList.add("jp-AccordionPanel-title");return t}}e.Renderer=t;e.defaultRenderer=new t;function n(t){var n;return t.layout||new io({renderer:t.renderer||e.defaultRenderer,orientation:t.orientation,alignment:t.alignment,spacing:t.spacing,titleSpace:(n=t.titleSpace)!==null&&n!==void 0?n:32})}e.createLayout=n})(so||(so={}));class oo extends m.Widget{constructor(e={}){var t;super();const n=this.layout=new m.PanelLayout;this.addClass("jp-SidePanel");const i=this._trans=(e.translator||ts.nullTranslator).load("jupyterlab");if(e.header){this.addHeader(e.header)}const s=this._content=(t=e.content)!==null&&t!==void 0?t:new m.AccordionPanel({...e,layout:so.createLayout(e)});s.node.setAttribute("role","region");s.node.setAttribute("aria-label",i.__("side panel content"));s.addClass("jp-SidePanel-content");n.addWidget(s);if(e.toolbar){this.addToolbar(e.toolbar)}}get content(){return this._content}get header(){if(!this._header){this.addHeader()}return this._header}get toolbar(){if(!this._toolbar){this.addToolbar()}return this._toolbar}get widgets(){return this.content.widgets}addWidget(e){this.content.addWidget(e)}insertWidget(e,t){this.content.insertWidget(e,t)}addHeader(e){const t=this._header=e||new m.Panel;t.addClass("jp-SidePanel-header");this.layout.insertWidget(0,t)}addToolbar(e){const t=this._toolbar=e!==null&&e!==void 0?e:new zs;t.addClass("jp-SidePanel-toolbar");this.layout.insertWidget(this.layout.widgets.length-1,t)}}class ro extends m.Widget{constructor(){super();this.addClass("jp-Spinner");this.node.tabIndex=-1;const e=document.createElement("div");e.className="jp-SpinnerContent";this.node.appendChild(e)}onActivateRequest(e){this.node.focus()}}var ao;(function(e){function t(e,t=""){n(e,"select",t);n(e,"textarea",t);n(e,"input",t);n(e,"button",t)}e.styleNode=t;function n(e,t,n=""){if(e.localName===t){e.classList.add("jp-mod-styled")}if(e.localName==="select"){const t=e.hasAttribute("multiple");i(e,t)}const s=e.getElementsByTagName(t);for(let o=0;o{if(e===t.sortKey){n({sortKey:e,sortDirection:t.sortDirection*-1})}else{n({sortKey:e,sortDirection:1})}};let r=e.rows;const a=e.columns.filter((e=>e.id===t.sortKey))[0];if(a){const n=a.sort.bind(a);r=e.rows.sort(((e,i)=>n(e.data,i.data)*t.sortDirection))}const l=e.columns.filter((e=>(e.isAvailable?e.isAvailable():true)&&!e.isHidden));const d=r.map((t=>{const n=l.map((e=>s().createElement("td",{key:e.id+"-"+t.key},e.renderCell(t.data))));return s().createElement("tr",{key:t.key,"data-key":t.key,onClick:e.onRowClick,className:"jp-sortable-table-tr"},n)}));const c=l.map((e=>s().createElement(po,{label:e.label,id:e.id,state:t,key:e.id,onSort:()=>{o(e.id)}})));return s().createElement("table",{className:ho},s().createElement("thead",null,s().createElement("tr",{className:"jp-sortable-table-tr"},c)),s().createElement("tbody",null,d))}function po(e){const t=e.id===e.state.sortKey;const n=!t||e.state.sortDirection===1?Gt:qt;return s().createElement("th",{key:e.id,onClick:()=>e.onSort(),className:t?"jp-sorted-header":undefined,"data-id":e.id},s().createElement("div",{className:"jp-sortable-table-th-wrapper"},s().createElement("label",null,e.label),s().createElement(n.react,{tag:"span",className:"jp-sort-icon"})))}const mo=100;let go=false;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){go={passive:true}}}))}catch(Lo){}class fo{constructor(e={}){var t,n,i,s,o,r;this.scrollDownThreshold=1;this.scrollUpThreshold=0;this.paddingTop=0;this._estimatedWidgetSize=vo.DEFAULT_WIDGET_SIZE;this._stateChanged=new p.Signal(this);this._currentWindow=[-1,-1,-1,-1];this._height=0;this._isDisposed=false;this._itemsList=null;this._measuredAllUntilIndex=-1;this._overscanCount=1;this._scrollOffset=0;this._widgetCount=0;this._widgetSizers=[];this._windowingActive=true;this._widgetCount=(i=(n=(t=e.itemsList)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:e.count)!==null&&i!==void 0?i:0;this._overscanCount=(s=e.overscanCount)!==null&&s!==void 0?s:1;this._windowingActive=(o=e.windowingActive)!==null&&o!==void 0?o:true;this.itemsList=(r=e.itemsList)!==null&&r!==void 0?r:null}get height(){return this._height}set height(e){this._height=e}get isDisposed(){return this._isDisposed}get itemsList(){return this._itemsList}set itemsList(e){var t,n,i;if(this._itemsList!==e){if(this._itemsList){this._itemsList.changed.disconnect(this.onListChanged,this)}const s=this._itemsList;this._itemsList=e;if(this._itemsList){this._itemsList.changed.connect(this.onListChanged,this)}else{this._widgetCount=0}this._stateChanged.emit({name:"list",newValue:this._itemsList,oldValue:s});this._stateChanged.emit({name:"count",newValue:(n=(t=this._itemsList)===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0,oldValue:(i=s===null||s===void 0?void 0:s.length)!==null&&i!==void 0?i:0})}}get overscanCount(){return this._overscanCount}set overscanCount(e){if(e>=1){if(this._overscanCount!==e){const t=this._overscanCount;this._overscanCount=e;this._stateChanged.emit({name:"overscanCount",newValue:e,oldValue:t})}}else{console.error(`Forbidden non-positive overscan count: got ${e}`)}}get scrollOffset(){return this._scrollOffset}set scrollOffset(e){this._scrollOffset=e}get widgetCount(){return this._itemsList?this._itemsList.length:this._widgetCount}set widgetCount(e){if(this.itemsList){console.error("It is not allow to change the widgets count of a windowed list if a items list is used.");return}if(e>=0){if(this._widgetCount!==e){const t=this._widgetCount;this._widgetCount=e;this._stateChanged.emit({name:"count",newValue:e,oldValue:t})}}else{console.error(`Forbidden negative widget count: got ${e}`)}}get windowingActive(){return this._windowingActive}set windowingActive(e){if(e!==this._windowingActive){const t=this._windowingActive;this._windowingActive=e;this._currentWindow=[-1,-1,-1,-1];this._measuredAllUntilIndex=-1;this._widgetSizers=[];this._stateChanged.emit({name:"windowingActive",newValue:e,oldValue:t})}}get stateChanged(){return this._stateChanged}dispose(){if(this.isDisposed){return}this._isDisposed=true;p.Signal.clearData(this)}getEstimatedTotalSize(){let e=0;if(this._measuredAllUntilIndex>=this.widgetCount){this._measuredAllUntilIndex=this.widgetCount-1}if(this._measuredAllUntilIndex>=0){const t=this._widgetSizers[this._measuredAllUntilIndex];e=t.offset+t.size}let t=0;for(let n=this._measuredAllUntilIndex+1;ng&&vg&&_f&&_=u-r&&p<=h+r;const n=v-g;const i=_-g;if(w||b&&n>=l||y&&ir){t="top-center"}else{t="center"}}}if(t==="auto"){if(w){return p}else if(s!==undefined){t=s}else if(b||v<=f){t="end"}else{t="start"}}switch(t){case"start":return Math.max(0,h-o*r)+m;case"end":return u+o*r+m;case"center":return u+(h-u)/2;case"top-center":return h-r/2}}getRangeToRender(){let e=[0,Math.max(this.widgetCount-1,-1),0,Math.max(this.widgetCount-1,-1)];const t=this._measuredAllUntilIndex;if(this.windowingActive){e=this._getRangeToRender()}const[n,i]=e;if(t<=i||this._currentWindow[0]!==n||this._currentWindow[1]!==i){this._currentWindow=e;return e}return null}getSpan(e,t){const n=this._getItemMetadata(e);const i=n.offset;const s=this._getItemMetadata(t);const o=s.offset-n.offset+s.size;return[i,o]}resetAfterIndex(e){const t=this._measuredAllUntilIndex;this._measuredAllUntilIndex=Math.min(e,this._measuredAllUntilIndex);for(const[n,i]of this._widgetSizers.entries()){if(n===0){continue}const e=this._widgetSizers[n-1];i.offset=e.offset+e.size}if(this._measuredAllUntilIndex!==t){this._stateChanged.emit({name:"index",newValue:e,oldValue:t})}}setWidgetSize(e){if(this._windowingActive||this._currentWindow[0]>=0){let t=Infinity;let n=-1;let i=0;let s=true;const o=new Map(e.map((e=>[e.index,e.size])));const r=Math.max(...o.keys());const a=[...this._widgetSizers.entries()];for(let e=this._widgetSizers.length;e<=r;e++){a.push([e,null])}for(let[e,l]of a){const r=o.get(e);let a=0;const d=!!l;if(!l){const t=this._widgetSizers[e-1];const n={offset:t?t.offset+t.size:0,size:r!==undefined?r:this.estimateWidgetSize(e),measured:r!==undefined};this._widgetSizers[e]=n;l=n}if(r!==undefined){if(l.size!=r){a=r-l.size;l.size=r;t=Math.min(t,e)}l.measured=true}if(s){if(l.measured){n=e}else{s=false}}if(d&&i!==0){l.offset+=i}i+=a}if(n!==-1){this._measuredAllUntilIndex=n}if(t!==Infinity){return true}}return false}onListChanged(e,t){switch(t.type){case"add":this._widgetSizers.splice(t.newIndex,0,...new Array(t.newValues.length).fill(undefined).map(((e,t)=>({offset:0,size:this.estimateWidgetSize(t)}))));this.resetAfterIndex(t.newIndex-1);break;case"move":ys.ArrayExt.move(this._widgetSizers,t.oldIndex,t.newIndex);this.resetAfterIndex(Math.min(t.newIndex,t.oldIndex)-1);break;case"remove":this._widgetSizers.splice(t.oldIndex,t.oldValues.length);this.resetAfterIndex(t.oldIndex-1);break;case"set":this.resetAfterIndex(t.newIndex-1);break}}_getItemMetadata(e){var t,n;if(e>this._measuredAllUntilIndex){let i=0;if(this._measuredAllUntilIndex>=0){const e=this._widgetSizers[this._measuredAllUntilIndex];i=e.offset+e.size}for(let s=this._measuredAllUntilIndex+1;s<=e;s++){let e=((t=this._widgetSizers[s])===null||t===void 0?void 0:t.measured)?this._widgetSizers[s].size:this.estimateWidgetSize(s);this._widgetSizers[s]={offset:i,size:e,measured:(n=this._widgetSizers[s])===null||n===void 0?void 0:n.measured};i+=e}for(let t=e+1;t0?this._widgetSizers[this._measuredAllUntilIndex].offset:0;if(t>=e){return this._findNearestItemBinarySearch(this._measuredAllUntilIndex,0,e)}else{return this._findNearestItemExponentialSearch(Math.max(0,this._measuredAllUntilIndex),e)}}_findNearestItemBinarySearch(e,t,n){while(t<=e){const i=t+Math.floor((e-t)/2);const s=this._getItemMetadata(i).offset;if(s===n){return i}else if(sn){e=i-1}}if(t>0){return t-1}else{return 0}}_findNearestItemExponentialSearch(e,t){let n=1;while(ethis.update()),50);this._viewModel=e.model;this._viewport=c;if(e.scrollbar){s.classList.add("jp-mod-virtual-scrollbar")}this.viewModel.stateChanged.connect(this.onStateChanged,this)}get isParentHidden(){return this._isParentHidden}set isParentHidden(e){this._isParentHidden=e}get layout(){return super.layout}get outerNode(){return this._outerElement}get viewportNode(){return this._viewport}get scrollbar(){return this.node.classList.contains("jp-mod-virtual-scrollbar")}set scrollbar(e){if(e){this.node.classList.add("jp-mod-virtual-scrollbar")}else{this.node.classList.remove("jp-mod-virtual-scrollbar")}this._adjustDimensionsForScrollbar();this.update()}get viewModel(){return this._viewModel}dispose(){this._updater.dispose();super.dispose()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);e.stopPropagation();break;case"scrollend":this._onScrollEnd();break;case"scroll":this.onScroll(e);break}}scrollTo(e){if(!this.viewModel.windowingActive){this._outerElement.scrollTo({top:e});return}e=Math.max(0,e);if(e!==this.viewModel.scrollOffset){this.viewModel.scrollOffset=e;this._scrollUpdateWasRequested=true;this.update()}}scrollToItem(e,t="auto",n=.25,i){if(!this._isScrolling||this._scrollToItem===null||this._scrollToItem[0]!==e||this._scrollToItem[1]!==t){if(this._isScrolling){this._isScrolling.reject("Scrolling to a new item is requested.")}this._isScrolling=new g.PromiseDelegate;this._isScrolling.promise.catch(console.debug)}this._scrollToItem=[e,t,n,i];this._resetScrollToItem();let s=undefined;if(!this.viewModel.windowingActive){const t=this._innerElement.querySelector(`[data-windowed-list-index="${e}"]`);if(!t||!(t instanceof HTMLElement)){console.debug(`Element with index ${e} not found`);return Promise.resolve()}s={totalSize:this._outerElement.scrollHeight,itemMetadata:{offset:t.offsetTop,size:t.clientHeight},currentOffset:this._outerElement.scrollTop}}this.scrollTo(this.viewModel.getOffsetForIndexAndAlignment(Math.max(0,Math.min(e,this.viewModel.widgetCount-1)),t,n,s,i));return this._isScrolling.promise}onAfterAttach(e){super.onAfterAttach(e);if(this.viewModel.windowingActive){this._applyWindowingStyles()}else{this._applyNoWindowingStyles()}this._addListeners();this.viewModel.height=this.node.getBoundingClientRect().height;const t=window.getComputedStyle(this._viewport);this.viewModel.paddingTop=parseFloat(t.paddingTop);this._viewportPaddingTop=this.viewModel.paddingTop;this._viewportPaddingBottom=parseFloat(t.paddingBottom);this._scrollbarElement.addEventListener("pointerdown",this);this._outerElement.addEventListener("scrollend",this)}onBeforeDetach(e){this._removeListeners();this._scrollbarElement.removeEventListener("pointerdown",this);this._outerElement.removeEventListener("scrollend",this);super.onBeforeDetach(e)}onScroll(e){const{clientHeight:t,scrollHeight:n,scrollTop:i}=e.currentTarget;if(!this._scrollUpdateWasRequested&&Math.abs(this.viewModel.scrollOffset-i)>1){const e=Math.max(0,Math.min(i,n-t));this.viewModel.scrollOffset=e;this._scrollUpdateWasRequested=false;if(this._viewport.dataset.isScrolling!="true"){this._viewport.dataset.isScrolling="true"}if(this._timerToClearScrollStatus){window.clearTimeout(this._timerToClearScrollStatus)}this._timerToClearScrollStatus=window.setTimeout((()=>{this._onScrollEnd()}),750);this.update()}}onResize(e){const t=this.viewModel.height;this.viewModel.height=e.height>=0?e.height:this.node.getBoundingClientRect().height;if(this.viewModel.height!==t){void this._updater.invoke()}super.onResize(e);void this._updater.invoke()}onStateChanged(e,t){switch(t.name){case"windowingActive":this._removeListeners();if(this.viewModel.windowingActive){this._applyWindowingStyles();this.onScroll({currentTarget:this.node});this._addListeners();return}else{this._applyNoWindowingStyles();this._addListeners()}break;case"estimatedWidgetSize":this._updateTotalSize();return}this.update()}onUpdateRequest(e){if(this.viewModel.windowingActive){if(this._scrollRepaint===null){this._needsUpdate=false;this._scrollRepaint=window.requestAnimationFrame((()=>{this._scrollRepaint=null;this._update();if(this._needsUpdate){this.update()}}))}else{this._needsUpdate=true}}else{this._update()}}_adjustDimensionsForScrollbar(){const e=this._outerElement;const t=this._scrollbarElement;if(this.scrollbar){let n=e.offsetWidth-e.clientWidth;if(n==0){n=1e3;e.style.paddingRight=`${n}px`;e.style.boxSizing="border-box"}else{e.style.paddingRight="0"}e.style.width=`calc(100% + ${n}px)`;this._innerElement.style.marginRight=`${t.offsetWidth}px`}else{e.style.width="100%";this._innerElement.style.marginRight="";e.style.paddingRight="0";e.style.boxSizing=""}}_addListeners(){if(this.viewModel.windowingActive){if(!this._itemsResizeObserver){this._itemsResizeObserver=new ResizeObserver(this._onItemResize.bind(this))}for(const e of this.layout.widgets){this._itemsResizeObserver.observe(e.node);e.disposed.connect((()=>{var t;return(t=this._itemsResizeObserver)===null||t===void 0?void 0:t.unobserve(e.node)}))}this._outerElement.addEventListener("scroll",this,go);this._scrollbarResizeObserver=new ResizeObserver(this._adjustDimensionsForScrollbar.bind(this));this._scrollbarResizeObserver.observe(this._outerElement);this._scrollbarResizeObserver.observe(this._scrollbarElement)}else{if(!this._areaResizeObserver){this._areaResizeObserver=new ResizeObserver(this._onAreaResize.bind(this));this._areaResizeObserver.observe(this._innerElement)}}}_applyNoWindowingStyles(){this._viewport.style.position="relative";this._viewport.style.contain="";this._viewport.style.top="0px";this._viewport.style.minHeight="";this._innerElement.style.height=""}_applyWindowingStyles(){this._viewport.style.position="absolute";this._viewport.style.contain="layout"}_removeListeners(){var e,t,n;this._outerElement.removeEventListener("scroll",this);(e=this._areaResizeObserver)===null||e===void 0?void 0:e.disconnect();this._areaResizeObserver=null;(t=this._itemsResizeObserver)===null||t===void 0?void 0:t.disconnect();this._itemsResizeObserver=null;(n=this._scrollbarResizeObserver)===null||n===void 0?void 0:n.disconnect();this._scrollbarResizeObserver=null}_update(){var e;if(this.isDisposed||!this.layout){return}const t=this.viewModel.getRangeToRender();if(t!==null){const[n,i,s,o]=t;if(this.scrollbar){const e=this._renderScrollbar();const t=e[s];const n=e[o];this._viewportIndicator.style.top=t.offsetTop-1+"px";this._viewportIndicator.style.height=n.offsetTop-t.offsetTop+n.offsetHeight+"px"}const r=[];if(i>=0){for(let e=n;e<=i;e++){const t=this.viewModel.widgetRenderer(e);t.dataset.windowedListIndex=`${e}`;r.push(t)}}const a=this.layout.widgets.length;for(let t=a-1;t>=0;t--){if(!r.includes(this.layout.widgets[t])){(e=this._itemsResizeObserver)===null||e===void 0?void 0:e.unobserve(this.layout.widgets[t].node);this.layout.removeWidget(this.layout.widgets[t])}}for(let e=0;e{var e;return(e=this._itemsResizeObserver)===null||e===void 0?void 0:e.unobserve(t.node)}))}this.layout.insertWidget(e,t)}if(this.viewModel.windowingActive){if(i>=0){this._updateTotalSize();let[e,t]=this.viewModel.getSpan(n,i);this._viewport.style.transform=`translateY(${e}px)`}else{this._innerElement.style.height=`0px`;this._viewport.style.top=`0px`;this._viewport.style.minHeight=`0px`}if(this._scrollUpdateWasRequested){this._outerElement.scrollTop=this.viewModel.scrollOffset;this._scrollUpdateWasRequested=false}}}let n=-1;for(const i of this._viewport.children){const e=parseInt(i.dataset.windowedListIndex,10);if(e{console.log(e)}))}_resetScrollToItem(){if(this._resetScrollToItemTimeout){clearTimeout(this._resetScrollToItemTimeout)}if(this._scrollToItem){this._resetScrollToItemTimeout=window.setTimeout((()=>{this._scrollToItem=null;if(this._isScrolling){this._isScrolling.resolve();this._isScrolling=null}}),mo)}}_renderScrollbar(){var e,t;const{node:n,renderer:i,viewModel:s}=this;const o=n.querySelector(".jp-WindowedPanel-scrollbar-content");const r=[];const a=(e,t)=>{if(e instanceof HTMLElement){return e}else{c.add(e.key);const n={index:t};const i=this._scrollbarItems[e.key];if(i&&!i.isDisposed){return i.render(n)}else{this._scrollbarItems[e.key]=e;const t=e.render(n);return t}}};const l=s.itemsList;const d=(e=l===null||l===void 0?void 0:l.length)!==null&&e!==void 0?e:s.widgetCount;const c=new Set;for(let p=0;p!c.has(e)));for(const p of h){this._scrollbarItems[p].dispose();delete this._scrollbarItems[p]}const u=[...o.childNodes];if(u.length!==r.length||!u.every(((e,t)=>r[t]===e))){o.replaceChildren(...r)}return r}_evtPointerDown(e){let t=e.target;while(t&&t.parentElement){if(t.hasAttribute("data-index")){const e=parseInt(t.getAttribute("data-index"),10);return void(async()=>{await this.scrollToItem(e);this.jumped.emit(e)})()}t=t.parentElement}}_onScrollEnd(){if(this._timerToClearScrollStatus){window.clearTimeout(this._timerToClearScrollStatus)}this._viewport.dataset.isScrolling="false";if(this._requiresTotalSizeUpdate){this._updateTotalSize()}this._requiresTotalSizeUpdate=false}_updateTotalSize(){if(this.viewModel.windowingActive){if(this._viewport.dataset.isScrolling=="true"){this._requiresTotalSizeUpdate=true;return}const e=this.viewModel.getEstimatedTotalSize();const t=e+this._viewportPaddingTop+this._viewportPaddingBottom;this._innerElement.style.height=`${t}px`}}}vo.DEFAULT_WIDGET_SIZE=50;class _o extends m.PanelLayout{constructor(){super({fitPolicy:"set-no-constraint"})}get parent(){return super.parent}set parent(e){super.parent=e}attachWidget(e,t){let n=this.parent.viewportNode.children[e];if(this.parent.isAttached){Es.MessageLoop.sendMessage(t,m.Widget.Msg.BeforeAttach)}this.parent.viewportNode.insertBefore(t.node,n);if(this.parent.isAttached){Es.MessageLoop.sendMessage(t,m.Widget.Msg.AfterAttach)}}detachWidget(e,t){if(this.parent.isAttached){Es.MessageLoop.sendMessage(t,m.Widget.Msg.BeforeDetach)}this.parent.viewportNode.removeChild(t.node);if(this.parent.isAttached){Es.MessageLoop.sendMessage(t,m.Widget.Msg.AfterDetach)}}moveWidget(e,t,n){let i=this.parent.viewportNode.children[t];if(e{if(n.submenu){e.overrideDefaultRenderer(n.submenu)}return i(t,n)};for(const e of n._items){if(e.submenu){t(e.submenu)}}}e.overrideDefaultRenderer=t;class n extends m.Menu.Renderer{renderIcon(e){const t=this.createIconClass(e);if(e.item.isToggled){return bo.h.div({className:t},Xt,e.item.iconLabel)}return bo.h.div({className:t},e.item.icon,e.item.iconLabel)}createIconClass(e){let t="lm-Menu-itemIcon";if(e.item.type==="separator"){return a(e.item.iconClass,t)}else{return a(w.styleClass({stylesheet:"menuItem"}),e.item.iconClass,t)}}renderSubmenu(e){const t="lm-Menu-itemSubmenuIcon";if(e.item.type==="submenu"){return bo.h.div({className:t},Co)}else{return bo.h.div({className:t})}}}e.Renderer=n;e.defaultRenderer=new n})(So||(So={}));class ko extends m.TabBar{constructor(e={}){var t;super({renderer:ko.defaultRenderer,...e});const n=((t=ko.translator)!==null&&t!==void 0?t:ts.nullTranslator).load("jupyterlab");Bt.element({container:this.addButtonNode,title:n.__("New Launcher")})}}ko.translator=null;(function(e){class t extends m.TabBar.Renderer{renderCloseIcon(t){var n;const i=((n=e.translator)!==null&&n!==void 0?n:ts.nullTranslator).load("jupyterlab");const s=t.title.label?i.__("Close %1",t.title.label):i.__("Close tab");const o=a("jp-icon-hover lm-TabBar-tabCloseIcon",w.styleClass({elementPosition:"center",height:"16px",width:"16px"}));return(0,bo.hpass)("div",{className:o,title:s},sn)}}e.Renderer=t;e.defaultRenderer=new t})(ko||(ko={}));class jo extends m.DockPanel{constructor(e={}){super({renderer:jo.defaultRenderer,...e})}}(function(e){class t extends m.DockPanel.Renderer{createTabBar(){const e=new ko;e.addClass("lm-DockPanel-tabBar");return e}}e.Renderer=t;e.defaultRenderer=new t})(jo||(jo={}));class Io extends m.TabPanel{constructor(e={}){e.renderer=e.renderer||ko.defaultRenderer;super(e)}}const Eo="jp-HoverBox";const To="-1000";var Mo;(function(e){function t(e){const{anchor:t,host:n,node:i,privilege:s,outOfViewDisplay:o}=e;const r=n.getBoundingClientRect();if(!i.classList.contains(Eo)){i.classList.add(Eo)}if(i.style.visibility){i.style.visibility=""}if(i.style.zIndex===""){i.style.zIndex=""}i.style.maxHeight="";i.style.marginTop="";const a=e.style||window.getComputedStyle(i);const l=t.top-r.top;const d=r.bottom-t.bottom;const c=parseInt(a.marginTop,10)||0;const h=parseInt(a.marginLeft,10)||0;const u=parseInt(a.minHeight,10)||e.minHeight;let p=parseInt(a.maxHeight,10)||e.maxHeight;const m=s==="forceAbove"?false:s==="forceBelow"?true:s==="above"?l=p||d>=l;if(m){p=Math.min(d-c,p)}else{p=Math.min(l,p);i.style.marginTop="0px"}i.style.maxHeight=`${p}px`;const g=p>=u&&(d>=u||l>=u);if(!g){i.style.zIndex=To;i.style.visibility="hidden";return}if(e.size){i.style.width=`${e.size.width}px`;i.style.height=`${e.size.height}px`;i.style.contain="strict"}else{i.style.contain="";i.style.width="auto";i.style.height=""}const f=e.size?e.size.height:i.getBoundingClientRect().height;const v=e.offset&&e.offset.vertical&&e.offset.vertical.above||0;const _=e.offset&&e.offset.vertical&&e.offset.vertical.below||0;let b=m?r.bottom-d+_:r.top+l-f+v;i.style.top=`${Math.floor(b)}px`;const y=e.offset&&e.offset.horizontal||0;let w=t.left+y;i.style.left=`${Math.ceil(w)}px`;let C=i.getBoundingClientRect();let x=C.right;if(x>window.innerWidth){w-=x-window.innerWidth;x=window.innerWidth;i.style.left=`${Math.ceil(w)}px`}if(wr.bottom;const O=w+hr.right;let F=false;let z=false;let H=false;if(R){switch((o===null||o===void 0?void 0:o.top)||"hidden-inside"){case"hidden-inside":if(!T){F=true}break;case"hidden-outside":if(!M){F=true}break;case"stick-inside":if(r.top>b){b=r.top;H=true}break;case"stick-outside":if(r.top>S){b=r.top-P;H=true}break}}if(N){switch((o===null||o===void 0?void 0:o.bottom)||"hidden-outside"){case"hidden-inside":if(!M){F=true}break;case"hidden-outside":if(!T){F=true}break;case"stick-inside":if(r.bottomw+h){w=r.left-h;z=true}break;case"stick-outside":if(r.left>x){w=r.left-h-L;z=true}break}}if(B){switch((o===null||o===void 0?void 0:o.right)||"hidden-outside"){case"hidden-inside":if(!A){F=true}break;case"hidden-outside":if(!D){F=true}break;case"stick-inside":if(r.right.'; got ${e}.`)}this._renderers[e]=t}get renderers(){return this._renderers}getRenderer(e){return this._renderers[e]}}},40662:(e,t,n)=>{"use strict";var i=n(10395);var s=n(85072);var o=n.n(s);var r=n(97825);var a=n.n(r);var l=n(77659);var d=n.n(l);var c=n(55056);var h=n.n(c);var u=n(10540);var p=n.n(u);var m=n(41113);var g=n.n(m);var f=n(28857);var v={};v.styleTagTransform=g();v.setAttributes=h();v.insert=d().bind(null,"head");v.domAPI=a();v.insertStyleElement=p();var _=o()(f.A,v);const b=f.A&&f.A.locals?f.A.locals:undefined},47872:(e,t,n)=>{"use strict";n.r(t);n.d(t,{RenderedVega:()=>u,VEGALITE3_MIME_TYPE:()=>d,VEGALITE4_MIME_TYPE:()=>c,VEGALITE5_MIME_TYPE:()=>h,VEGA_MIME_TYPE:()=>l,default:()=>g,rendererFactory:()=>p});var i=n(1143);var s=n.n(i);const o="jp-RenderedVegaCommon5";const r="jp-RenderedVega5";const a="jp-RenderedVegaLite";const l="application/vnd.vega.v5+json";const d="application/vnd.vegalite.v3+json";const c="application/vnd.vegalite.v4+json";const h="application/vnd.vegalite.v5+json";class u extends i.Widget{constructor(e){super();this._mimeType=e.mimeType;this._resolver=e.resolver;this.addClass(o);this.addClass(this._mimeType===l?r:a)}async renderModel(e){const t=e.data[this._mimeType];if(t===undefined){return}const n=e.metadata[this._mimeType];const i=n&&n.embed_options?n.embed_options:{};let s=document.body.dataset.jpThemeLight==="false";if(s){i.theme="dark"}const o=this._mimeType===l?"vega":"vega-lite";const r=f.vega!=null?f.vega:await f.ensureVega();const a=document.createElement("div");this.node.textContent="";this.node.appendChild(a);if(this._result){this._result.finalize()}const d=r.vega.loader({http:{credentials:"same-origin"}});const c=async(e,t)=>{const n=this._resolver;if((n===null||n===void 0?void 0:n.isLocal)&&n.isLocal(e)){const t=await n.resolveUrl(e);e=await n.getDownloadUrl(t)}return d.sanitize(e,t)};this._result=await r.default(a,t,{actions:true,defaultStyle:true,...i,mode:o,loader:{...d,sanitize:c}});if(e.data["image/png"]){return}const h=await this._result.view.toImageURL("png",typeof i.scaleFactor==="number"?i.scaleFactor:i.scaleFactor?i.scaleFactor.png:i.scaleFactor);e.setData({data:{...e.data,"image/png":h.split(",")[1]}})}dispose(){if(this._result){this._result.finalize()}super.dispose()}}const p={safe:true,mimeTypes:[l,d,c,h],createRenderer:e=>new u(e)};const m={id:"@jupyterlab/vega5-extension:factory",description:"Provides a renderer for Vega 5 and Vega-Lite 3 to 5 content.",rendererFactory:p,rank:57,dataType:"json",documentWidgetFactoryOptions:[{name:"Vega5",primaryFileType:"vega5",fileTypes:["vega5","json"],defaultFor:["vega5"]},{name:"Vega-Lite5",primaryFileType:"vega-lite5",fileTypes:["vega-lite3","vega-lite4","vega-lite5","json"],defaultFor:["vega-lite3","vega-lite4","vega-lite5"]}],fileTypes:[{mimeTypes:[l],name:"vega5",extensions:[".vg",".vg.json",".vega"],icon:"ui-components:vega"},{mimeTypes:[h],name:"vega-lite5",extensions:[".vl",".vl.json",".vegalite"],icon:"ui-components:vega"},{mimeTypes:[c],name:"vega-lite4",extensions:[],icon:"ui-components:vega"},{mimeTypes:[d],name:"vega-lite3",extensions:[],icon:"ui-components:vega"}]};const g=m;var f;(function(e){function t(){if(e.vegaReady){return e.vegaReady}e.vegaReady=n.e(908).then(n.t.bind(n,40908,23));return e.vegaReady}e.ensureVega=t})(f||(f={}))},54549:(e,t,n)=>{"use strict";var i=n(10395);var s=n(85072);var o=n.n(s);var r=n(97825);var a=n.n(r);var l=n(77659);var d=n.n(l);var c=n(55056);var h=n.n(c);var u=n(10540);var p=n.n(u);var m=n(41113);var g=n.n(m);var f=n(45512);var v={};v.styleTagTransform=g();v.setAttributes=h();v.insert=d().bind(null,"head");v.domAPI=a();v.insertStyleElement=p();var _=o()(f.A,v);const b=f.A&&f.A.locals?f.A.locals:undefined},42864:(e,t,n)=>{"use strict";n.r(t);n.d(t,{default:()=>D});var i=n(74991);var s=n(98171);var o=n(72050);var r=n(37737);var a=n(45231);var l=n(86503);var d=n(61927);var c;(function(e){e.open="workspace-ui:open";e.save="workspace-ui:save";e.saveAs="workspace-ui:save-as";e.createNew="workspace-ui:create-new";e.deleteWorkspace="workspace-ui:delete";e.clone="workspace-ui:clone";e.rename="workspace-ui:rename";e.reset="workspace-ui:reset";e.importWorkspace="workspace-ui:import";e.exportWorkspace="workspace-ui:export"})(c||(c={}));const h="jupyterlab-workspace";const u="."+h;const p="workspace-ui:lastSave";const m="jp-mod-workspace";const g={id:"@jupyterlab/workspaces-extension:commands",description:"Add workspace commands.",autoStart:true,requires:[s.IWorkspacesModel,a.IDefaultFileBrowser,o.IWindowResolver,l.IStateDB,d.ITranslator,i.JupyterFrontEnd.IPaths],provides:s.IWorkspaceCommands,optional:[i.IRouter,o.ICommandPalette],activate:(e,t,n,i,s,l,d,h,g)=>{const v=l.load("jupyterlab");const _=v.__("Naming the workspace will create a unique URL. The name may contain letters, numbers, hyphens (-), and underscores (_).");const b=r.URLExt.join(d.urls.app,"workspaces");const y=b+"/";const w="[a-zA-Z0-9\\-_]+";const C=async e=>o.InputDialog.getText({label:_,prefix:y,pattern:w,required:true,placeholder:v.__("workspace-name"),...e});const x=e=>e.classList.contains(m);e.commands.addCommand(c.open,{label:e=>{const t=e.workspace;return t?v.__("Open Workspace"):v.__("Open Workspace…")},execute:async e=>{let n=e.workspace;if(!n){const e=await o.InputDialog.getItem({title:v.__("Choose Workspace To Open"),label:v.__("Choose an existing workspace to open."),items:t.identifiers,okLabel:v.__("Choose"),prefix:y});if(!e.value||!e.button.accept){return}n=e.value}if(!n||!t.identifiers.includes(n)){return}const i=r.URLExt.join(b,n);if(!i.startsWith(b)){throw new Error("Can only be used for workspaces")}if(h){h.navigate(i,{hard:true})}else{document.location.href=i}}});e.commands.addCommand(c.deleteWorkspace,{label:v.__("Delete Workspace…"),execute:async n=>{var i;const s=e.contextMenuHitTest(x);let r=(i=n.workspace)!==null&&i!==void 0?i:s===null||s===void 0?void 0:s.dataset["context"];if(!r){const e=await o.InputDialog.getItem({title:v.__("Choose Workspace To Delete"),label:v.__("Choose an existing workspace to delete."),items:t.identifiers,okLabel:v.__("Choose")});if(!e.value||!e.button.accept){return}r=e.value}if(!r){return}const a=await(0,o.showDialog)({title:v.__("Delete workspace"),body:v.__('Deleting workspace "%1" will also delete its URL. A deleted workspace cannot be recovered.',r),buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:v.__("Delete")})],defaultButton:0});if(a.button.accept){await t.remove(r)}}});e.commands.addCommand(c.createNew,{label:v.__("Create New Workspace…"),execute:async e=>{let n=e.workspace;if(!n){const e=await C({title:v.__("Create New Workspace"),okLabel:v.__("Create")});if(!e.value||!e.button.accept){return}n=e.value}if(!n){return}await t.create(n)}});e.commands.addCommand(c.clone,{label:v.__("Clone Workspace…"),execute:async n=>{var s;const r=e.contextMenuHitTest(x);let a=(s=n.workspace)!==null&&s!==void 0?s:r===null||r===void 0?void 0:r.dataset["context"];if(!a){const e=await o.InputDialog.getItem({title:v.__("Choose Workspace To Clone"),label:v.__("Choose an existing workspace to clone."),items:t.identifiers,okLabel:v.__("Choose")});if(!e.value||!e.button.accept){return}a=e.value}const l=await C({title:v.__("Clone Workspace"),text:v.__("%1-clone",a),okLabel:v.__("Clone")});if(!l.button.accept||!l.value){return}let d=l.value;await t.saveAs(a,d);if(a===i.name){return e.commands.execute(c.open,{workspace:d})}}});e.commands.addCommand(c.rename,{label:v.__("Rename Workspace…"),execute:async n=>{var s,o;const r=e.contextMenuHitTest(x);const a=(o=(s=n.workspace)!==null&&s!==void 0?s:r===null||r===void 0?void 0:r.dataset["context"])!==null&&o!==void 0?o:i.name;const l=a;const d=await C({title:v.__("Rename Workspace"),text:l,okLabel:v.__("Rename")});if(!d.button.accept||!d.value){return}let h=d.value;await t.rename(a,h);if(a===i.name){return e.commands.execute(c.open,{workspace:h})}}});e.commands.addCommand(c.reset,{label:v.__("Reset Workspace…"),execute:async n=>{var s,r,a,l,d,h;const u=e.contextMenuHitTest(x);const p=(r=(s=n.workspace)!==null&&s!==void 0?s:u===null||u===void 0?void 0:u.dataset["context"])!==null&&r!==void 0?r:i.name;const m=await e.serviceManager.workspaces.fetch(p);const g=(h=(d=(l=(a=m.data["layout-restorer:data"])===null||a===void 0?void 0:a.main)===null||l===void 0?void 0:l.dock)===null||d===void 0?void 0:d.widgets)===null||h===void 0?void 0:h.length;const f=await(0,o.showDialog)({title:v.__("Reset Workspace"),body:v._n("Resetting workspace %2 will close its %1 tab and return to default layout.","Resetting workspace %2 will close its %1 tabs and return to default layout.",g,p),buttons:[o.Dialog.cancelButton(),o.Dialog.warnButton({label:v.__("Reset")})],defaultButton:0});if(!f.button.accept){return}await t.reset(p);if(p===i.name){return e.commands.execute(c.open,{workspace:p})}else{await t.refresh()}}});e.commands.addCommand(c.importWorkspace,{label:v.__("Import Workspace…"),execute:async()=>{const{contents:i}=e.serviceManager;const s=await a.FileDialog.getOpenFiles({manager:n.model.manager,title:v.__("Select Workspace Files to Import"),filter:e=>e.type==="directory"||e.path.endsWith(u)?{}:null,label:v.__('Choose one or more workspace files to import. A Jupyter workspace file has the extension "%1".',u),translator:l});if(s.button.accept&&s.value&&s.value.length>=1){for(const t of s.value){const n=await i.get(t.path,{content:true});const s=JSON.parse(n.content);await e.serviceManager.workspaces.save(s.metadata.id,s)}await t.refresh()}}});e.commands.addCommand(c.exportWorkspace,{label:v.__("Export Workspace…"),execute:async r=>{var d,c;const{contents:h}=e.serviceManager;const p=e.contextMenuHitTest(x);let m=(c=(d=r.workspace)!==null&&d!==void 0?d:p===null||p===void 0?void 0:p.dataset["context"])!==null&&c!==void 0?c:i.name;if(!m){const e=await o.InputDialog.getItem({title:v.__("Choose Workspace To Export"),label:v.__("Choose an existing workspace to export."),items:t.identifiers,okLabel:v.__("Choose")});if(!e.value||!e.button.accept){return}m=e.value}const g=e.serviceManager.workspaces.fetch(m);const _=await a.FileDialog.getExistingDirectory({title:v.__("Choose Workspace Export Directory"),defaultPath:n.model.path,manager:n.model.manager,label:v.__('The "%1" workspace will be saved in the chosen directory as "%1%2".',m,u),translator:l});if(!_.button.accept||!_.value||_.value.length===0){return}if(_.value.length>1){console.warn("More than one directory was selected; the workspace will be exported to the first directory only")}const b=_.value[0].path+"/"+m+u;if(b){await f.save(b,h,g,s,false)}}});e.commands.addCommand(c.saveAs,{label:v.__("Save Current Workspace As…"),execute:async()=>{const{contents:t}=e.serviceManager;const o=e.serviceManager.workspaces.fetch(i.name);await f.saveAs(n,t,o,s,l)}});e.commands.addCommand(c.save,{label:v.__("Save Current Workspace"),execute:async()=>{const{contents:t}=e.serviceManager;const o=e.serviceManager.workspaces.fetch(i.name);const r=await s.fetch(p);if(r===undefined){await f.saveAs(n,t,o,s,l)}else{await f.save(r,t,o,s)}}});if(g){const e=v.__("Workspaces");const t=[c.open,c.save,c.saveAs,c.createNew,c.rename,c.clone,c.exportWorkspace,c.importWorkspace,c.reset,c.deleteWorkspace];for(const n of t){g.addItem({command:n,category:e})}}return{open:c.open,deleteWorkspace:c.deleteWorkspace}}};var f;(function(e){function t(e){let t=e.split("/").pop();if(t===undefined){return"unnamed-workspace"}if(t.endsWith(u)){t=t.slice(0,-u.length)}return t}e.createNameFromPath=t;async function n(e,n,i,s,o=true){const r=t(e);if(!e.endsWith(u)){e=e+u}if(o){await s.save(p,e)}const a=await i;a.metadata.id=`${r}`;await n.save(e,{type:"file",format:"text",content:JSON.stringify(a)})}e.save=n;async function i(e,t,i,o,r){var a;r=r||d.nullTranslator;const l=await o.fetch(p);let c;if(l===undefined){c="new-workspace"}else{c=(a=l.split("/").pop())===null||a===void 0?void 0:a.split(".")[0]}const h=e.model.path+"/"+c+u;const m=await s(h,r);if(m){await n(m,t,i,o)}}e.saveAs=i;async function s(e,t){t=t||d.nullTranslator;const n=t.load("jupyterlab");const i=await o.InputDialog.getText({title:n.__("Save Current Workspace As…"),text:e,placeholder:n.__("Path to save the workspace in"),okLabel:n.__("Save"),selectionRange:e.length-u.length});if(i.button.accept){return i.value}else{return null}}})(f||(f={}));var v=n(69085);var _=n(66127);const b={id:"@jupyterlab/workspaces-extension:sidebar",description:"Populates running sidebar with workspaces.",requires:[s.IWorkspaceCommands,s.IWorkspacesModel,v.IRunningSessionManagers,o.IWindowResolver],optional:[d.ITranslator],autoStart:true,activate:async(e,t,n,i,s,o)=>{const r=(o!==null&&o!==void 0?o:d.nullTranslator).load("jupyterlab");class a{constructor(e){this._workspace=e;this.context=e.metadata.id;this.className=m}open(){return e.commands.execute(t.open,{workspace:this._workspace.metadata.id})}async shutdown(){await e.commands.execute(t.deleteWorkspace,{workspace:this._workspace.metadata.id});await n.refresh()}icon(){return s.name===this._workspace.metadata.id?_.checkIcon:_.blankIcon}label(){return this._workspace.metadata.id}labelTitle(){var e,t,n,i;return r.__("%1 workspace with %2 tabs, last modified on %3",this._workspace.metadata.id,(i=(n=(t=(e=this._workspace.data["layout-restorer:data"])===null||e===void 0?void 0:e.main)===null||t===void 0?void 0:t.dock)===null||n===void 0?void 0:n.widgets)===null||i===void 0?void 0:i.length,this._workspace.metadata["last_modified"])}}i.add({name:r.__("Workspaces"),supportsMultipleViews:false,running:()=>n.workspaces.map((e=>new a(e))),shutdownAll:async()=>{await Promise.all(n.workspaces.map((e=>n.remove(e.metadata.id))));await n.refresh()},shutdownItemIcon:_.deleteIcon,refreshRunning:async()=>{await n.refresh()},runningChanged:n.refreshed,shutdownLabel:e=>r.__("Delete %1",e.label()),shutdownAllLabel:r.__("Delete All"),shutdownAllConfirmationText:r.__("Are you sure you want to delete all workspaces? Deleted workspaces cannot be recovered.")})}};var y=n(44914);var w=n.n(y);const C=({currentWorkspace:e,identifiers:t,openWorkspace:n,translator:i})=>{const[s,o]=(0,y.useState)(false);const[r,a]=(0,y.useState)("");const l=(0,y.useRef)(null);const d=(0,y.useId)();const c=i.load("jupyterlab");const h=t.filter((e=>e.toLowerCase().includes(r.toLowerCase())));(0,y.useEffect)((()=>{const e=e=>{if(l.current&&!l.current.contains(e.target)){o(false)}};document.addEventListener("mousedown",e);return()=>document.removeEventListener("mousedown",e)}),[]);return w().createElement("div",{className:"jp-WorkspaceSelector",ref:l},w().createElement("button",{className:"jp-WorkspaceSelector-header",onClick:()=>o(!s),"aria-expanded":s,"aria-controls":d},w().createElement("span",{className:"jp-WorkspaceSelector-current"},e.length>12?`${e.slice(0,12)}...`:e),w().createElement("span",{className:"jp-WorkspaceSelector-caret"},w().createElement(_.LabIcon.resolveReact,{icon:s?_.caretUpEmptyThinIcon:_.caretDownEmptyThinIcon}))),s&&w().createElement("div",{className:"jp-WorkspaceSelector-dropdown",id:d},w().createElement("div",{className:"jp-WorkspaceSelector-search"},w().createElement("div",{className:"jp-WorkspaceSelector-searchIcon"},w().createElement(_.LabIcon.resolveReact,{icon:_.searchIcon})),w().createElement("input",{type:"text",className:"jp-WorkspaceSelector-input",placeholder:c.__("Search workspace"),value:r,onChange:e=>a(e.target.value),autoFocus:true,"aria-autocomplete":"list",role:"combobox"})),w().createElement("ul",{className:"jp-WorkspaceSelector-list",role:"listbox","aria-label":c.__("Workspace")},h.map((t=>w().createElement("li",{key:t,className:"jp-WorkspaceSelector-item",onClick:()=>{if(t===e)return;n(t);o(false)}},w().createElement(_.LabIcon.resolveReact,{icon:t===e?_.checkIcon:_.blankIcon}),t.length>12?`${t.slice(0,12)}...`:t))))))};class x extends _.ReactWidget{constructor(e){super();this.id="jp-workspace-top-indicator";this._identifiers=e.identifiers;this._openWorkspace=e.openWorkspace;this._currentWorkspace=e.currentWorkspace;this._translator=e.translator;e.model.refreshed.connect((()=>{this._identifiers=e.model.identifiers;this.update()}))}render(){return w().createElement(C,{currentWorkspace:this._currentWorkspace,identifiers:this._identifiers,openWorkspace:this._openWorkspace,translator:this._translator})}}var S=n(15615);const k={id:"@jupyterlab/workspaces-extension:model",description:"Provides a model for available workspaces.",provides:s.IWorkspacesModel,autoStart:true,optional:[i.JupyterLab.IInfo],activate:(e,t)=>new s.WorkspacesModel({manager:e.serviceManager.workspaces,refreshStandby:()=>{if(t){return!t.isConnected||"when-hidden"}return"when-hidden"}})};const j={id:"@jupyterlab/workspaces-extension:menu",description:'Populates "File" main menu with Workspaces submenu.',requires:[s.IWorkspaceCommands],autoStart:true,activate:()=>{}};const I="@jupyterlab/workspaces-extension:indicator";const E="workspace-indicator:toggle";const T={id:I,description:"Adds a workspace indicator element at topbar",requires:[s.IWorkspacesModel,s.IWorkspaceCommands,o.IWindowResolver,d.ITranslator,S.ISettingRegistry,o.IToolbarWidgetRegistry],autoStart:true,activate:async(e,t,n,i,s,o,r)=>{const a=s.load("jupyterlab");const l=async t=>{await e.commands.execute(n.open,{workspace:t})};const d=new x({currentWorkspace:i.name,identifiers:t.identifiers,openWorkspace:l,model:t,translator:s});r.addFactory("TopBar","workspaceIndicator",(()=>d));e.commands.addCommand(E,{label:a.__("Show Workspace Indicator"),isToggled:()=>d.isVisible,execute:async()=>{const e=await o.get("@jupyterlab/application-extension:top-bar","toolbar");if(Array.isArray(e.composite)){const t=e.composite.map((e=>{if(e.name==="workspaceIndicator"){return{...e,disabled:!e.disabled}}return e}));await o.set("@jupyterlab/application-extension:top-bar","toolbar",t)}}})}};const M=[k,g,b,j,T];const D=M},75591:(e,t,n)=>{"use strict";var i=n(40662);var s=n(97913);var o=n(3579);var r=n(39063);var a=n(94780);var l=n(85072);var d=n.n(l);var c=n(97825);var h=n.n(c);var u=n(77659);var p=n.n(u);var m=n(55056);var g=n.n(m);var f=n(10540);var v=n.n(f);var _=n(41113);var b=n.n(_);var y=n(52680);var w={};w.styleTagTransform=b();w.setAttributes=g();w.insert=p().bind(null,"head");w.domAPI=h();w.insertStyleElement=v();var C=d()(y.A,w);const x=y.A&&y.A.locals?y.A.locals:undefined},33352:(e,t,n)=>{"use strict";n.r(t);n.d(t,{IWorkspaceCommands:()=>l,IWorkspacesModel:()=>d,WorkspacesModel:()=>r});var i=n(26568);var s=n(2336);const o=1e4;class r{constructor(e){var t;this._refreshed=new s.Signal(this);this._isDisposed=false;this._workspaceData={ids:[],values:[]};this._manager=e.manager;const n=e.refreshInterval||o;this._poll=new i.Poll({auto:(t=e.auto)!==null&&t!==void 0?t:true,name:"@jupyterlab/workspaces:Model",factory:()=>this._fetchList(),frequency:{interval:n,backoff:true,max:300*1e3},standby:e.refreshStandby||"when-hidden"})}get workspaces(){return this._workspaceData.values}get identifiers(){return this._workspaceData.ids}async create(e){await this._manager.save(e,{metadata:{id:e},data:{}});await this.refresh()}get refreshed(){return this._refreshed}async refresh(){await this._poll.refresh();await this._poll.tick}async rename(e,t){const n=await this._manager.fetch(e);n.metadata.id=t;await this._manager.save(t,n);await this._manager.remove(e);await this.refresh()}async reset(e){const t=await this._manager.fetch(e);t.data={};await this._manager.save(e,t);await this.refresh()}async remove(e){await this._manager.remove(e);await this.refresh()}async saveAs(e,t){const n=await this._manager.fetch(e);n.metadata.id=t;await this._manager.save(t,n);await this.refresh()}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;this._poll.dispose();s.Signal.clearData(this)}async _fetchList(){this._workspaceData=await this._manager.list();this._refreshed.emit(void 0)}}var a=n(5592);const l=new a.Token("@jupyterlab/workspaces:IWorkspaceCommands","Provides identifiers of workspace commands.");const d=new a.Token("@jupyterlab/workspaces:IWorkspacesModel","Provides a model for available workspaces.")},56588:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ArrayExt:()=>i,StringExt:()=>I,chain:()=>s,each:()=>g,empty:()=>o,enumerate:()=>r,every:()=>f,filter:()=>a,find:()=>l,findIndex:()=>d,map:()=>_,max:()=>h,min:()=>c,minmax:()=>u,once:()=>x,range:()=>b,reduce:()=>w,repeat:()=>C,retro:()=>S,some:()=>v,stride:()=>j,take:()=>E,toArray:()=>p,toObject:()=>m,topologicSort:()=>k,zip:()=>T});var i;(function(e){function t(e,t,n=0,i=-1){let s=e.length;if(s===0){return-1}if(n<0){n=Math.max(0,n+s)}else{n=Math.min(n,s-1)}if(i<0){i=Math.max(0,i+s)}else{i=Math.min(i,s-1)}let o;if(i0){let i=a>>1;let s=r+i;if(n(e[s],t)<0){r=s+1;a-=i+1}else{a=i}}return r}e.lowerBound=a;function l(e,t,n,i=0,s=-1){let o=e.length;if(o===0){return 0}if(i<0){i=Math.max(0,i+o)}else{i=Math.min(i,o-1)}if(s<0){s=Math.max(0,s+o)}else{s=Math.min(s,o-1)}let r=i;let a=s-i+1;while(a>0){let i=a>>1;let s=r+i;if(n(e[s],t)>0){a=i}else{r=s+1;a-=i+1}}return r}e.upperBound=l;function d(e,t,n){if(e===t){return true}if(e.length!==t.length){return false}for(let i=0,s=e.length;i=o){n=s<0?o-1:o}if(i===undefined){i=s<0?-1:o}else if(i<0){i=Math.max(i+o,s<0?-1:0)}else if(i>=o){i=s<0?o-1:o}let r;if(s<0&&i>=n||s>0&&n>=i){r=0}else if(s<0){r=Math.floor((i-n+1)/s+1)}else{r=Math.floor((i-n-1)/s+1)}let a=[];for(let l=0;l=i){return}let o=i-n+1;if(t>0){t=t%o}else if(t<0){t=(t%o+o)%o}if(t===0){return}let r=n+t;u(e,n,r-1);u(e,r,i);u(e,n,i)}e.rotate=p;function m(e,t,n=0,i=-1){let s=e.length;if(s===0){return}if(n<0){n=Math.max(0,n+s)}else{n=Math.min(n,s-1)}if(i<0){i=Math.max(0,i+s)}else{i=Math.min(i,s-1)}let o;if(it;--s){e[s]=e[s-1]}e[t]=n}e.insert=g;function f(e,t){let n=e.length;if(t<0){t+=n}if(t<0||t>=n){return undefined}let i=e[t];for(let s=t+1;s=n&&r<=i&&e[r]===t){o++}else if(i=n)&&e[r]===t){o++}else if(o>0){e[r-o]=e[r]}}if(o>0){e.length=s-o}return o}e.removeAllOf=b;function y(e,t,n=0,s=-1){let o;let r=i(e,t,n,s);if(r!==-1){o=f(e,r)}return{index:r,value:o}}e.removeFirstWhere=y;function w(e,t,n=-1,i=0){let o;let r=s(e,t,n,i);if(r!==-1){o=f(e,r)}return{index:r,value:o}}e.removeLastWhere=w;function C(e,t,n=0,i=-1){let s=e.length;if(s===0){return 0}if(n<0){n=Math.max(0,n+s)}else{n=Math.min(n,s-1)}if(i<0){i=Math.max(0,i+s)}else{i=Math.min(i,s-1)}let o=0;for(let r=0;r=n&&r<=i&&t(e[r],r)){o++}else if(i=n)&&t(e[r],r)){o++}else if(o>0){e[r-o]=e[r]}}if(o>0){e.length=s-o}return o}e.removeAllWhere=C})(i||(i={}));function*s(...e){for(const t of e){yield*t}}function*o(){return}function*r(e,t=0){for(const n of e){yield[t++,n]}}function*a(e,t){let n=0;for(const i of e){if(t(i,n++)){yield i}}}function l(e,t){let n=0;for(const i of e){if(t(i,n++)){return i}}return undefined}function d(e,t){let n=0;for(const i of e){if(t(i,n++)){return n-1}}return-1}function c(e,t){let n=undefined;for(const i of e){if(n===undefined){n=i;continue}if(t(i,n)<0){n=i}}return n}function h(e,t){let n=undefined;for(const i of e){if(n===undefined){n=i;continue}if(t(i,n)>0){n=i}}return n}function u(e,t){let n=true;let i;let s;for(const o of e){if(n){i=o;s=o;n=false}else if(t(o,i)<0){i=o}else if(t(o,s)>0){s=o}}return n?undefined:[i,s]}function p(e){return Array.from(e)}function m(e){const t={};for(const[n,i]of e){t[n]=i}return t}function g(e,t){let n=0;for(const i of e){if(false===t(i,n++)){return}}}function f(e,t){let n=0;for(const i of e){if(false===t(i,n++)){return false}}return true}function v(e,t){let n=0;for(const i of e){if(t(i,n++)){return true}}return false}function*_(e,t){let n=0;for(const i of e){yield t(i,n++)}}function*b(e,t,n){if(t===undefined){t=e;e=0;n=1}else if(n===undefined){n=1}const i=y.rangeLength(e,t,n);for(let s=0;st&&n>0){return 0}if(e-1;t--){yield e[t]}}}function k(e){let t=[];let n=new Set;let i=new Map;for(const r of e){s(r)}for(const[r]of i){o(r)}return t;function s(e){let[t,n]=e;let s=i.get(n);if(s){s.push(t)}else{i.set(n,[t])}}function o(e){if(n.has(e)){return}n.add(e);let s=i.get(e);if(s){for(const e of s){o(e)}}t.push(e)}}function*j(e,t){let n=0;for(const i of e){if(0===n++%t){yield i}}}var I;(function(e){function t(e,t,n=0){let i=new Array(t.length);for(let s=0,o=n,r=t.length;st?1:0}e.cmp=o})(I||(I={}));function*E(e,t){if(t<1){return}const n=e[Symbol.iterator]();let i;while(0e[Symbol.iterator]()));let n=t.map((e=>e.next()));for(;f(n,(e=>!e.done));n=t.map((e=>e.next()))){yield n.map((e=>e.value))}}},86397:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Application:()=>d});var i=n(93247);var s=n.n(i);var o=n(5592);var r=n.n(o);var a=n(1143);var l=n.n(a);class d{constructor(e){var t;this._delegate=new o.PromiseDelegate;this._started=false;this._bubblingKeydown=false;this.pluginRegistry=(t=e.pluginRegistry)!==null&&t!==void 0?t:new o.PluginRegistry(e);this.pluginRegistry.application=this;this.commands=new i.CommandRegistry;this.contextMenu=new a.ContextMenu({commands:this.commands,renderer:e.contextMenuRenderer});this.shell=e.shell}get deferredPlugins(){return this.pluginRegistry.deferredPlugins}get started(){return this._delegate.promise}async activateDeferredPlugins(){await this.pluginRegistry.activatePlugins("defer")}async activatePlugin(e){return this.pluginRegistry.activatePlugin(e)}async deactivatePlugin(e){return this.pluginRegistry.deactivatePlugin(e)}deregisterPlugin(e,t){this.pluginRegistry.deregisterPlugin(e,t)}getPluginDescription(e){return this.pluginRegistry.getPluginDescription(e)}hasPlugin(e){return this.pluginRegistry.hasPlugin(e)}isPluginActivated(e){return this.pluginRegistry.isPluginActivated(e)}listPlugins(){return this.pluginRegistry.listPlugins()}registerPlugin(e){this.pluginRegistry.registerPlugin(e)}registerPlugins(e){this.pluginRegistry.registerPlugins(e)}async resolveOptionalService(e){return this.pluginRegistry.resolveOptionalService(e)}async resolveRequiredService(e){return this.pluginRegistry.resolveRequiredService(e)}async start(e={}){var t,n;if(this._started){return this._delegate.promise}this._started=true;this._bubblingKeydown=(t=e.bubblingKeydown)!==null&&t!==void 0?t:false;const i=(n=e.hostID)!==null&&n!==void 0?n:"";await this.pluginRegistry.activatePlugins("startUp",e);this.attachShell(i);this.addEventListeners();this._delegate.resolve()}handleEvent(e){switch(e.type){case"resize":this.evtResize(e);break;case"keydown":this.evtKeydown(e);break;case"keyup":this.evtKeyup(e);break;case"contextmenu":this.evtContextMenu(e);break}}attachShell(e){a.Widget.attach(this.shell,e&&document.getElementById(e)||document.body)}addEventListeners(){document.addEventListener("contextmenu",this);document.addEventListener("keydown",this,!this._bubblingKeydown);document.addEventListener("keyup",this,!this._bubblingKeydown);window.addEventListener("resize",this)}evtKeydown(e){this.commands.processKeydownEvent(e)}evtKeyup(e){this.commands.processKeyupEvent(e)}evtContextMenu(e){if(e.shiftKey){return}if(this.contextMenu.open(e)){e.preventDefault();e.stopPropagation()}}evtResize(e){this.shell.update()}}},893:(e,t,n)=>{"use strict";n.r(t);n.d(t,{CommandRegistry:()=>g});var i=n(34236);var s=n.n(i);var o=n(5592);var r=n.n(o);var a=n(90044);var l=n.n(a);var d=n(76326);var c=n.n(d);var h=n(77162);var u=n.n(h);var p=n(2336);var m=n.n(p);class g{constructor(){this._timerID=0;this._timerModifierID=0;this._replaying=false;this._keystrokes=[];this._keydownEvents=[];this._keyBindings=[];this._exactKeyMatch=null;this._commands=new Map;this._commandChanged=new p.Signal(this);this._commandExecuted=new p.Signal(this);this._keyBindingChanged=new p.Signal(this);this._holdKeyBindingPromises=new Map}get commandChanged(){return this._commandChanged}get commandExecuted(){return this._commandExecuted}get keyBindingChanged(){return this._keyBindingChanged}get keyBindings(){return this._keyBindings}listCommands(){return Array.from(this._commands.keys())}hasCommand(e){return this._commands.has(e)}addCommand(e,t){if(this._commands.has(e)){throw new Error(`Command '${e}' already registered.`)}this._commands.set(e,f.createCommand(t));this._commandChanged.emit({id:e,type:"added"});return new a.DisposableDelegate((()=>{this._commands.delete(e);this._commandChanged.emit({id:e,type:"removed"})}))}notifyCommandChanged(e){if(e!==undefined&&!this._commands.has(e)){throw new Error(`Command '${e}' is not registered.`)}this._commandChanged.emit({id:e,type:e?"changed":"many-changed"})}describedBy(e,t=o.JSONExt.emptyObject){var n;let i=this._commands.get(e);return Promise.resolve((n=i===null||i===void 0?void 0:i.describedBy.call(undefined,t))!==null&&n!==void 0?n:{args:null})}label(e,t=o.JSONExt.emptyObject){var n;let i=this._commands.get(e);return(n=i===null||i===void 0?void 0:i.label.call(undefined,t))!==null&&n!==void 0?n:""}mnemonic(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.mnemonic.call(undefined,t):-1}icon(e,t=o.JSONExt.emptyObject){var n;return(n=this._commands.get(e))===null||n===void 0?void 0:n.icon.call(undefined,t)}iconClass(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconClass.call(undefined,t):""}iconLabel(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.iconLabel.call(undefined,t):""}caption(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.caption.call(undefined,t):""}usage(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.usage.call(undefined,t):""}className(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.className.call(undefined,t):""}dataset(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.dataset.call(undefined,t):{}}isEnabled(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.isEnabled.call(undefined,t):false}isToggled(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.isToggled.call(undefined,t):false}isToggleable(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.isToggleable:false}isVisible(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);return n?n.isVisible.call(undefined,t):false}execute(e,t=o.JSONExt.emptyObject){let n=this._commands.get(e);if(!n){return Promise.reject(new Error(`Command '${e}' not registered.`))}let i;try{i=n.execute.call(undefined,t)}catch(r){i=Promise.reject(r)}let s=Promise.resolve(i);this._commandExecuted.emit({id:e,args:t,result:s});return s}addKeyBinding(e){let t=f.createKeyBinding(e);this._keyBindings.push(t);this._keyBindingChanged.emit({binding:t,type:"added"});return new a.DisposableDelegate((()=>{i.ArrayExt.removeFirstOf(this._keyBindings,t);this._keyBindingChanged.emit({binding:t,type:"removed"})}))}processKeydownEvent(e){if(e.defaultPrevented||this._replaying){return}const t=g.keystrokeForKeydownEvent(e);if(!t){this._replayKeydownEvents();this._clearPendingState();return}if(g.isModifierKeyPressed(e)){let{exact:n}=f.matchKeyBinding(this._keyBindings,[t],e);if(n){e.preventDefault();e.stopPropagation();this._startModifierTimer(n)}else{this._clearModifierTimer()}return}this._keystrokes.push(t);const{exact:n,partial:i}=f.matchKeyBinding(this._keyBindings,this._keystrokes,e);const s=i.length!==0;if(!n&&!s){this._replayKeydownEvents();this._clearPendingState();return}if((n===null||n===void 0?void 0:n.preventDefault)||i.some((e=>e.preventDefault))){e.preventDefault();e.stopPropagation()}this._keydownEvents.push(e);if(n&&!s){this._executeKeyBinding(n);this._clearPendingState();return}if(n){this._exactKeyMatch=n}this._startTimer()}holdKeyBindingExecution(e,t){this._holdKeyBindingPromises.set(e,t)}processKeyupEvent(e){this._clearModifierTimer()}_startModifierTimer(e){this._clearModifierTimer();this._timerModifierID=window.setTimeout((()=>{this._executeKeyBinding(e)}),f.modifierkeyTimeOut)}_clearModifierTimer(){if(this._timerModifierID!==0){clearTimeout(this._timerModifierID);this._timerModifierID=0}}_startTimer(){this._clearTimer();this._timerID=window.setTimeout((()=>{this._onPendingTimeout()}),f.CHORD_TIMEOUT)}_clearTimer(){if(this._timerID!==0){clearTimeout(this._timerID);this._timerID=0}}_replayKeydownEvents(){if(this._keydownEvents.length===0){return}this._replaying=true;this._keydownEvents.forEach(f.replayKeyEvent);this._replaying=false}async _executeKeyBinding(e){if(this._holdKeyBindingPromises.size!==0){const e=[...this._keydownEvents];const t=(await Promise.race([Promise.all(e.map((async e=>{var t;return(t=this._holdKeyBindingPromises.get(e))!==null&&t!==void 0?t:Promise.resolve(true)}))),new Promise((e=>{setTimeout((()=>e([false])),f.KEYBINDING_HOLD_TIMEOUT)}))])).every(Boolean);this._holdKeyBindingPromises.clear();if(!t){return}}let{command:t,args:n}=e;let i={_luminoEvent:{type:"keybinding",keys:e.keys},...n};if(!this.hasCommand(t)||!this.isEnabled(t,i)){let n=this.hasCommand(t)?"enabled":"registered";let i=e.keys.join(", ");let s=`Cannot execute key binding '${i}':`;let o=`command '${t}' is not ${n}.`;console.warn(`${s} ${o}`);return}await this.execute(t,i)}_clearPendingState(){this._clearTimer();this._clearModifierTimer();this._exactKeyMatch=null;this._keystrokes.length=0;this._keydownEvents.length=0}_onPendingTimeout(){this._timerID=0;if(this._exactKeyMatch){this._executeKeyBinding(this._exactKeyMatch)}else{this._replayKeydownEvents()}this._clearPendingState()}}(function(e){function t(e){let t="";let n=false;let i=false;let s=false;let o=false;for(let r of e.split(/\s+/)){if(r==="Accel"){if(d.Platform.IS_MAC){i=true}else{s=true}}else if(r==="Alt"){n=true}else if(r==="Cmd"){i=true}else if(r==="Ctrl"){s=true}else if(r==="Shift"){o=true}else if(r.length>0){t=r}}return{cmd:i,ctrl:s,alt:n,shift:o,key:t}}e.parseKeystroke=t;function n(e){let n="";let i=t(e);if(i.ctrl){n+="Ctrl "}if(i.alt){n+="Alt "}if(i.shift){n+="Shift "}if(i.cmd&&d.Platform.IS_MAC){n+="Cmd "}if(!i.key){return n.trim()}return n+i.key}e.normalizeKeystroke=n;function i(e){let t;if(d.Platform.IS_WIN){t=e.winKeys||e.keys}else if(d.Platform.IS_MAC){t=e.macKeys||e.keys}else{t=e.linuxKeys||e.keys}return t.map(n)}e.normalizeKeys=i;function s(e){return typeof e==="string"?n(e):e.map(n).join(", ");function n(e){let n=[];let i=d.Platform.IS_MAC?" ":"+";let s=t(e);if(s.ctrl){n.push("Ctrl")}if(s.alt){n.push("Alt")}if(s.shift){n.push("Shift")}if(d.Platform.IS_MAC&&s.cmd){n.push("Cmd")}n.push(s.key);return n.map(f.formatKey).join(i)}}e.formatKeystroke=s;function o(e){let t=(0,h.getKeyboardLayout)();let n=t.keyForKeydownEvent(e);return t.isModifierKey(n)}e.isModifierKeyPressed=o;function r(e){let t=(0,h.getKeyboardLayout)();let n=t.keyForKeydownEvent(e);let i=[];if(e.ctrlKey){i.push("Ctrl")}if(e.altKey){i.push("Alt")}if(e.shiftKey){i.push("Shift")}if(e.metaKey&&d.Platform.IS_MAC){i.push("Cmd")}if(!t.isModifierKey(n)){i.push(n)}return i.join(" ")}e.keystrokeForKeydownEvent=r})(g||(g={}));var f;(function(e){e.CHORD_TIMEOUT=1e3;e.KEYBINDING_HOLD_TIMEOUT=1e3;e.modifierkeyTimeOut=500;function t(e){return{execute:e.execute,describedBy:v(typeof e.describedBy==="function"?e.describedBy:{args:null,...e.describedBy},(()=>({args:null}))),label:v(e.label,c),mnemonic:v(e.mnemonic,h),icon:v(e.icon,f),iconClass:v(e.iconClass,c),iconLabel:v(e.iconLabel,c),caption:v(e.caption,c),usage:v(e.usage,c),className:v(e.className,c),dataset:v(e.dataset,m),isEnabled:e.isEnabled||u,isToggled:e.isToggled||p,isToggleable:e.isToggleable||!!e.isToggled,isVisible:e.isVisible||u}}e.createCommand=t;function n(e){var t;return{keys:g.normalizeKeys(e),selector:_(e),command:e.command,args:e.args||o.JSONExt.emptyObject,preventDefault:(t=e.preventDefault)!==null&&t!==void 0?t:true}}e.createKeyBinding=n;function i(e,t,n){let i=null;let s=[];let o=Infinity;let r=0;for(let a=0,l=e.length;ao){continue}let u=d.Selector.calculateSpecificity(l.selector);if(!i||h=r){i=l;o=h;r=u}}return{exact:i,partial:s}}e.matchKeyBinding=i;function s(e){e.target.dispatchEvent(w(e))}e.replayKeyEvent=s;function r(e){if(d.Platform.IS_MAC){return a.hasOwnProperty(e)?a[e]:e}else{return l.hasOwnProperty(e)?l[e]:e}}e.formatKey=r;const a={Backspace:"⌫",Tab:"⇥",Enter:"⏎",Shift:"⇧",Ctrl:"⌃",Alt:"⌥",Escape:"⎋",PageUp:"⇞",PageDown:"⇟",End:"↘",Home:"↖",ArrowLeft:"←",ArrowUp:"↑",ArrowRight:"→",ArrowDown:"↓",Delete:"⌦",Cmd:"⌘"};const l={Escape:"Esc",PageUp:"Page Up",PageDown:"Page Down",ArrowLeft:"Left",ArrowUp:"Up",ArrowRight:"Right",ArrowDown:"Down",Delete:"Del"};const c=()=>"";const h=()=>-1;const u=()=>true;const p=()=>false;const m=()=>({});const f=()=>undefined;function v(e,t){if(e===undefined){return t}if(typeof e==="function"){return e}return()=>e}function _(e){if(e.selector.indexOf(",")!==-1){throw new Error(`Selector cannot contain commas: ${e.selector}`)}if(!d.Selector.isValid(e.selector)){throw new Error(`Invalid selector: ${e.selector}`)}return e.selector}function b(e,t){if(e.lengtht.length){return 2}return 1}function y(e,t){let n=t.target;let i=t.currentTarget;for(let s=0;n!==null;n=n.parentElement,++s){if(n.hasAttribute("data-lm-suppress-shortcuts")){return-1}if(d.Selector.matches(n,e)){return s}if(n===i){return-1}}return-1}function w(e){let t=document.createEvent("Event");let n=e.bubbles||true;let i=e.cancelable||true;t.initEvent(e.type||"keydown",n,i);t.key=e.key||"";t.keyCode=e.keyCode||0;t.which=e.keyCode||0;t.ctrlKey=e.ctrlKey||false;t.altKey=e.altKey||false;t.shiftKey=e.shiftKey||false;t.metaKey=e.metaKey||false;t.view=e.view||window;return t}})(f||(f={}))},45899:function(e,t,n){(function(e,i){true?i(t,n(34236)):0})(this,(function(e,t){"use strict";e.JSONExt=void 0;(function(e){e.emptyObject=Object.freeze({});e.emptyArray=Object.freeze([]);function t(e){return e===null||typeof e==="boolean"||typeof e==="number"||typeof e==="string"}e.isPrimitive=t;function n(e){return Array.isArray(e)}e.isArray=n;function i(e){return!t(e)&&!n(e)}e.isObject=i;function s(e,i){if(e===i){return true}if(t(e)||t(i)){return false}let s=n(e);let o=n(i);if(s!==o){return false}if(s&&o){return r(e,i)}return a(e,i)}e.deepEqual=s;function o(e){if(t(e)){return e}if(n(e)){return l(e)}return d(e)}e.deepCopy=o;function r(e,t){if(e===t){return true}if(e.length!==t.length){return false}for(let n=0,i=e.length;ntrue;this._plugins=new Map;this._services=new Map;if(e.validatePlugin){console.info("Plugins may be rejected by the custom validation plugin method.");this._validatePlugin=e.validatePlugin}}get application(){return this._application}set application(e){if(this._application!==null){throw Error("PluginRegistry.application is already set. It cannot be overridden.")}this._application=e}get deferredPlugins(){return Array.from(this._plugins).filter((([e,t])=>t.autoStart==="defer")).map((([e,t])=>e))}getPluginDescription(e){var t,n;return(n=(t=this._plugins.get(e))===null||t===void 0?void 0:t.description)!==null&&n!==void 0?n:""}hasPlugin(e){return this._plugins.has(e)}isPluginActivated(e){var t,n;return(n=(t=this._plugins.get(e))===null||t===void 0?void 0:t.activated)!==null&&n!==void 0?n:false}listPlugins(){return Array.from(this._plugins.keys())}registerPlugin(e){if(this._plugins.has(e.id)){throw new TypeError(`Plugin '${e.id}' is already registered.`)}if(!this._validatePlugin(e)){throw new Error(`Plugin '${e.id}' is not valid.`)}const t=s.createPluginData(e);s.ensureNoCycle(t,this._plugins,this._services);if(t.provides){this._services.set(t.provides,t.id)}this._plugins.set(t.id,t)}registerPlugins(e){for(const t of e){this.registerPlugin(t)}}deregisterPlugin(e,t){const n=this._plugins.get(e);if(!n){return}if(n.activated&&!t){throw new Error(`Plugin '${e}' is still active.`)}this._plugins.delete(e)}async activatePlugin(e){const t=this._plugins.get(e);if(!t){throw new ReferenceError(`Plugin '${e}' is not registered.`)}if(t.activated){return}if(t.promise){return t.promise}const n=t.requires.map((e=>this.resolveRequiredService(e)));const i=t.optional.map((e=>this.resolveOptionalService(e)));t.promise=Promise.all([...n,...i]).then((e=>t.activate.apply(undefined,[this.application,...e]))).then((e=>{t.service=e;t.activated=true;t.promise=null})).catch((e=>{t.promise=null;throw e}));return t.promise}async activatePlugins(e,t={}){switch(e){case"defer":{const e=this.deferredPlugins.filter((e=>this._plugins.get(e).autoStart)).map((e=>this.activatePlugin(e)));await Promise.all(e);break}case"startUp":{const e=s.collectStartupPlugins(this._plugins,t);const n=e.map((async e=>{try{return await this.activatePlugin(e)}catch(t){console.error(`Plugin '${e}' failed to activate.`,t)}}));await Promise.all(n);break}}}async deactivatePlugin(e){const t=this._plugins.get(e);if(!t){throw new ReferenceError(`Plugin '${e}' is not registered.`)}if(!t.activated){return[]}if(!t.deactivate){throw new TypeError(`Plugin '${e}'#deactivate() method missing`)}const n=s.findDependents(e,this._plugins,this._services);const i=n.map((e=>this._plugins.get(e)));for(const s of i){if(!s.deactivate){throw new TypeError(`Plugin ${s.id}#deactivate() method missing (depends on ${e})`)}}for(const s of i){const e=[...s.requires,...s.optional].map((e=>{const t=this._services.get(e);return t?this._plugins.get(t).service:null}));await s.deactivate(this.application,...e);s.service=null;s.activated=false}n.pop();return n}async resolveRequiredService(e){const t=this._services.get(e);if(!t){throw new TypeError(`No provider for: ${e.name}.`)}const n=this._plugins.get(t);if(!n.activated){await this.activatePlugin(t)}return n.service}async resolveOptionalService(e){const t=this._services.get(e);if(!t){return null}const n=this._plugins.get(t);if(!n.activated){try{await this.activatePlugin(t)}catch(i){console.error(i);return null}}return n.service}}var s;(function(e){class n{constructor(e){var t,n,i,s;this._activated=false;this._promise=null;this._service=null;this.id=e.id;this.description=(t=e.description)!==null&&t!==void 0?t:"";this.activate=e.activate;this.deactivate=(n=e.deactivate)!==null&&n!==void 0?n:null;this.provides=(i=e.provides)!==null&&i!==void 0?i:null;this.autoStart=(s=e.autoStart)!==null&&s!==void 0?s:false;this.requires=e.requires?e.requires.slice():[];this.optional=e.optional?e.optional.slice():[]}get activated(){return this._activated}set activated(e){this._activated=e}get service(){return this._service}set service(e){this._service=e}get promise(){return this._promise}set promise(e){this._promise=e}}function i(e){return new n(e)}e.createPluginData=i;function s(e,t,n){const i=[...e.requires,...e.optional];const s=i=>{if(i===e.provides){return true}const r=n.get(i);if(!r){return false}const a=t.get(r);const l=[...a.requires,...a.optional];if(l.length===0){return false}o.push(r);if(l.some(s)){return true}o.pop();return false};if(!e.provides||i.length===0){return}const o=[e.id];if(i.some(s)){throw new ReferenceError(`Cycle detected: ${o.join(" -> ")}.`)}}e.ensureNoCycle=s;function o(e,n,i){const s=new Array;const o=e=>{const t=n.get(e);const o=[...t.requires,...t.optional];s.push(...o.reduce(((t,n)=>{const s=i.get(n);if(s){t.push([e,s])}return t}),[]))};for(const t of n.keys()){o(t)}const r=s.filter((t=>t[1]===e));let a=0;while(r.length>a){const e=r.length;const t=new Set(r.map((e=>e[0])));for(const n of t){s.filter((e=>e[1]===n)).forEach((e=>{if(!r.includes(e)){r.push(e)}}))}a=e}const l=t.topologicSort(r);const d=l.findIndex((t=>t===e));if(d===-1){return[e]}return l.slice(0,d+1)}e.findDependents=o;function r(e,t){const n=new Set;for(const i of e.keys()){if(e.get(i).autoStart===true){n.add(i)}}if(t.startPlugins){for(const e of t.startPlugins){n.add(e)}}if(t.ignorePlugins){for(const e of t.ignorePlugins){n.delete(e)}}return Array.from(n)}e.collectStartupPlugins=r})(s||(s={}));class o{constructor(){this.promise=new Promise(((e,t)=>{this._resolve=e;this._reject=t}))}resolve(e){let t=this._resolve;t(e)}reject(e){let t=this._reject;t(e)}}class r{constructor(e,t){this.name=e;this.description=t!==null&&t!==void 0?t:"";this._tokenStructuralPropertyT=null}}function a(e){let t=0;for(let n=0,i=e.length;n>>0}e[n]=t&255;t>>>=8}}e.Random=void 0;(function(e){e.getRandomValues=(()=>{const e=typeof window!=="undefined"&&(window.crypto||window.msCrypto)||null;if(e&&typeof e.getRandomValues==="function"){return function t(n){return e.getRandomValues(n)}}return a})()})(e.Random||(e.Random={}));function l(e){const t=new Uint8Array(16);const n=new Array(256);for(let i=0;i<16;++i){n[i]="0"+i.toString(16)}for(let i=16;i<256;++i){n[i]=i.toString(16)}return function i(){e(t);t[6]=64|t[6]&15;t[8]=128|t[8]&63;return n[t[0]]+n[t[1]]+n[t[2]]+n[t[3]]+"-"+n[t[4]]+n[t[5]]+"-"+n[t[6]]+n[t[7]]+"-"+n[t[8]]+n[t[9]]+"-"+n[t[10]]+n[t[11]]+n[t[12]]+n[t[13]]+n[t[14]]+n[t[15]]}}e.UUID=void 0;(function(t){t.uuid4=l(e.Random.getRandomValues)})(e.UUID||(e.UUID={}));e.MimeData=n;e.PluginRegistry=i;e.PromiseDelegate=o;e.Token=r}))},20785:(e,t,n)=>{"use strict";n.r(t);n.d(t,{DisposableDelegate:()=>o,DisposableSet:()=>a,ObservableDisposableDelegate:()=>r,ObservableDisposableSet:()=>l});var i=n(2336);var s=n.n(i);class o{constructor(e){this._fn=e}get isDisposed(){return!this._fn}dispose(){if(!this._fn){return}let e=this._fn;this._fn=null;e()}}class r extends o{constructor(){super(...arguments);this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){if(this.isDisposed){return}super.dispose();this._disposed.emit(undefined);i.Signal.clearData(this)}}class a{constructor(){this._isDisposed=false;this._items=new Set}get isDisposed(){return this._isDisposed}dispose(){if(this._isDisposed){return}this._isDisposed=true;this._items.forEach((e=>{e.dispose()}));this._items.clear()}contains(e){return this._items.has(e)}add(e){this._items.add(e)}remove(e){this._items.delete(e)}clear(){this._items.clear()}}(function(e){function t(t){let n=new e;for(const e of t){n.add(e)}return n}e.from=t})(a||(a={}));class l extends a{constructor(){super(...arguments);this._disposed=new i.Signal(this)}get disposed(){return this._disposed}dispose(){if(this.isDisposed){return}super.dispose();this._disposed.emit(undefined);i.Signal.clearData(this)}}(function(e){function t(t){let n=new e;for(const e of t){n.add(e)}return n}e.from=t})(l||(l={}))},60008:(e,t,n)=>{"use strict";n.r(t);n.d(t,{ClipboardExt:()=>i,ElementExt:()=>s,Platform:()=>o,Selector:()=>r});var i;(function(e){function t(e){const t=document.body;const n=i=>{i.preventDefault();i.stopPropagation();i.clipboardData.setData("text",e);t.removeEventListener("copy",n,true)};t.addEventListener("copy",n,true);document.execCommand("copy")}e.copyText=t})(i||(i={}));var s;(function(e){function t(e){let t=window.getComputedStyle(e);let n=parseFloat(t.borderTopWidth)||0;let i=parseFloat(t.borderLeftWidth)||0;let s=parseFloat(t.borderRightWidth)||0;let o=parseFloat(t.borderBottomWidth)||0;let r=parseFloat(t.paddingTop)||0;let a=parseFloat(t.paddingLeft)||0;let l=parseFloat(t.paddingRight)||0;let d=parseFloat(t.paddingBottom)||0;let c=i+a+l+s;let h=n+r+d+o;return{borderTop:n,borderLeft:i,borderRight:s,borderBottom:o,paddingTop:r,paddingLeft:a,paddingRight:l,paddingBottom:d,horizontalSum:c,verticalSum:h}}e.boxSizing=t;function n(e){let t=window.getComputedStyle(e);let n=parseFloat(t.minWidth)||0;let i=parseFloat(t.minHeight)||0;let s=parseFloat(t.maxWidth)||Infinity;let o=parseFloat(t.maxHeight)||Infinity;s=Math.max(n,s);o=Math.max(i,o);return{minWidth:n,minHeight:i,maxWidth:s,maxHeight:o}}e.sizeLimits=n;function i(e,t,n){let i=e.getBoundingClientRect();return t>=i.left&&t=i.top&&n=n.bottom){return}if(i.topn.bottom&&i.height>=n.height){e.scrollTop-=n.top-i.top;return}if(i.topn.height){e.scrollTop-=n.bottom-i.bottom;return}if(i.bottom>n.bottom&&i.height{let e=Element.prototype;return e.matches||e.matchesSelector||e.mozMatchesSelector||e.msMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector||function(e){let t=this;let n=t.ownerDocument?t.ownerDocument.querySelectorAll(e):[];return Array.prototype.indexOf.call(n,t)!==-1}})();function t(e){e=e.split(",",1)[0];let t=0;let c=0;let h=0;function u(t){let n=e.match(t);if(n===null){return false}e=e.slice(n[0].length);return true}e=e.replace(d," $1 ");while(e.length>0){if(u(n)){t++;continue}if(u(i)){c++;continue}if(u(s)){c++;continue}if(u(r)){h++;continue}if(u(a)){c++;continue}if(u(o)){h++;continue}if(u(l)){continue}return 0}t=Math.min(t,255);c=Math.min(c,255);h=Math.min(h,255);return t<<16|c<<8|h}e.calculateSingle=t;const n=/^#[^\s\+>~#\.\[:]+/;const i=/^\.[^\s\+>~#\.\[:]+/;const s=/^\[[^\]]+\]/;const o=/^[^\s\+>~#\.\[:]+/;const r=/^(::[^\s\+>~#\.\[:]+|:first-line|:first-letter|:before|:after)/;const a=/^:[^\s\+>~#\.\[:]+/;const l=/^[\s\+>~\*]+/;const d=/:not\(([^\)]+)\)/g})(a||(a={}))},1506:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Drag:()=>o});var i=n(90044);var s=n.n(i);class o{constructor(e){this._onScrollFrame=()=>{if(!this._scrollTarget){return}let{element:e,edge:t,distance:n}=this._scrollTarget;let i=r.SCROLL_EDGE_SIZE-n;let s=Math.pow(i/r.SCROLL_EDGE_SIZE,2);let o=Math.max(1,Math.round(s*r.SCROLL_EDGE_SIZE));switch(t){case"top":e.scrollTop-=o;break;case"left":e.scrollLeft-=o;break;case"right":e.scrollLeft+=o;break;case"bottom":e.scrollTop+=o;break}requestAnimationFrame(this._onScrollFrame)};this._disposed=false;this._dropAction="none";this._override=null;this._currentTarget=null;this._currentElement=null;this._promise=null;this._scrollTarget=null;this._resolve=null;this.document=e.document||document;this.mimeData=e.mimeData;this.dragImage=e.dragImage||null;this.proposedAction=e.proposedAction||"copy";this.supportedActions=e.supportedActions||"all";this.source=e.source||null}dispose(){if(this._disposed){return}this._disposed=true;if(this._currentTarget){let e=new PointerEvent("pointerup",{bubbles:true,cancelable:true,clientX:-1,clientY:-1});r.dispatchDragLeave(this,this._currentTarget,null,e)}this._finalize("none")}get isDisposed(){return this._disposed}start(e,t){if(this._disposed){return Promise.resolve("none")}if(this._promise){return this._promise}this._addListeners();this._attachDragImage(e,t);this._promise=new Promise((e=>{this._resolve=e}));let n=new PointerEvent("pointermove",{bubbles:true,cancelable:true,clientX:e,clientY:t});document.dispatchEvent(n);return this._promise}handleEvent(e){switch(e.type){case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;default:e.preventDefault();e.stopPropagation();break}}moveDragImage(e,t){if(!this.dragImage){return}let n=this.dragImage.style;n.transform=`translate(${e}px, ${t}px)`}_evtPointerMove(e){e.preventDefault();e.stopPropagation();this._updateCurrentTarget(e);this._updateDragScroll(e);this.moveDragImage(e.clientX,e.clientY)}_evtPointerUp(e){e.preventDefault();e.stopPropagation();if(e.button!==0){return}this._updateCurrentTarget(e);if(!this._currentTarget){this._finalize("none");return}if(this._dropAction==="none"){r.dispatchDragLeave(this,this._currentTarget,null,e);this._finalize("none");return}let t=r.dispatchDrop(this,this._currentTarget,e);this._finalize(t)}_evtKeyDown(e){e.preventDefault();e.stopPropagation();if(e.keyCode===27){this.dispose()}}_addListeners(){document.addEventListener("pointerdown",this,true);document.addEventListener("pointermove",this,true);document.addEventListener("pointerup",this,true);document.addEventListener("pointerenter",this,true);document.addEventListener("pointerleave",this,true);document.addEventListener("pointerover",this,true);document.addEventListener("pointerout",this,true);document.addEventListener("keydown",this,true);document.addEventListener("keyup",this,true);document.addEventListener("keypress",this,true);document.addEventListener("contextmenu",this,true)}_removeListeners(){document.removeEventListener("pointerdown",this,true);document.removeEventListener("pointermove",this,true);document.removeEventListener("pointerup",this,true);document.removeEventListener("pointerenter",this,true);document.removeEventListener("pointerleave",this,true);document.removeEventListener("pointerover",this,true);document.removeEventListener("pointerout",this,true);document.removeEventListener("keydown",this,true);document.removeEventListener("keyup",this,true);document.removeEventListener("keypress",this,true);document.removeEventListener("contextmenu",this,true)}_updateDragScroll(e){let t=r.findScrollTarget(e);if(!this._scrollTarget&&!t){return}if(!this._scrollTarget){setTimeout(this._onScrollFrame,500)}this._scrollTarget=t}_updateCurrentTarget(e){let t=this._currentTarget;let n=this._currentTarget;let i=this._currentElement;let s=r.findElementBehindBackdrop(e,this.document);this._currentElement=s;if(s!==i&&s!==n){r.dispatchDragExit(this,n,s,e)}if(s!==i&&s!==n){n=r.dispatchDragEnter(this,s,n,e)}if(n!==t){this._currentTarget=n;r.dispatchDragLeave(this,t,n,e)}let o=r.dispatchDragOver(this,n,e);this._setDropAction(o)}_attachDragImage(e,t){if(!this.dragImage){return}this.dragImage.classList.add("lm-mod-drag-image");let n=this.dragImage.style;n.pointerEvents="none";n.position="fixed";n.transform=`translate(${e}px, ${t}px)`;const i=this.document instanceof Document?this.document.body:this.document.firstElementChild;i.appendChild(this.dragImage)}_detachDragImage(){if(!this.dragImage){return}let e=this.dragImage.parentNode;if(!e){return}e.removeChild(this.dragImage)}_setDropAction(e){e=r.validateAction(e,this.supportedActions);if(this._override&&this._dropAction===e){return}switch(e){case"none":this._dropAction=e;this._override=o.overrideCursor("no-drop",this.document);break;case"copy":this._dropAction=e;this._override=o.overrideCursor("copy",this.document);break;case"link":this._dropAction=e;this._override=o.overrideCursor("alias",this.document);break;case"move":this._dropAction=e;this._override=o.overrideCursor("move",this.document);break}}_finalize(e){let t=this._resolve;this._removeListeners();this._detachDragImage();if(this._override){this._override.dispose();this._override=null}this.mimeData.clear();this._disposed=true;this._dropAction="none";this._currentTarget=null;this._currentElement=null;this._scrollTarget=null;this._promise=null;this._resolve=null;if(t){t(e)}}}(function(e){class t extends DragEvent{constructor(e,t){super(t.type,{bubbles:true,cancelable:true,altKey:e.altKey,button:e.button,clientX:e.clientX,clientY:e.clientY,ctrlKey:e.ctrlKey,detail:0,metaKey:e.metaKey,relatedTarget:t.related,screenX:e.screenX,screenY:e.screenY,shiftKey:e.shiftKey,view:window});const{drag:n}=t;this.dropAction="none";this.mimeData=n.mimeData;this.proposedAction=n.proposedAction;this.supportedActions=n.supportedActions;this.source=n.source}}e.Event=t;function n(e,t=document){return r.overrideCursor(e,t)}e.overrideCursor=n})(o||(o={}));var r;(function(e){e.SCROLL_EDGE_SIZE=20;function t(e,t){return p[e]&m[t]?e:"none"}e.validateAction=t;function n(t,n=document){if(t){if(s&&t==s.event){return s.element}e.cursorBackdrop.style.zIndex="-1000";const i=n.elementFromPoint(t.clientX,t.clientY);e.cursorBackdrop.style.zIndex="";s={event:t,element:i};return i}else{const t=e.cursorBackdrop.style.transform;if(r&&t===r.transform){return r.element}const i=e.cursorBackdrop.getBoundingClientRect();e.cursorBackdrop.style.zIndex="-1000";const s=n.elementFromPoint(i.left+i.width/2,i.top+i.height/2);e.cursorBackdrop.style.zIndex="";r={transform:t,element:s};return s}}e.findElementBehindBackdrop=n;let s=null;let r=null;function a(t){let i=t.clientX;let s=t.clientY;let o=n(t);for(;o;o=o.parentElement){if(!o.hasAttribute("data-lm-dragscroll")){continue}let t=0;let n=0;if(o===document.body){t=window.pageXOffset;n=window.pageYOffset}let r=o.getBoundingClientRect();let a=r.top+n;let l=r.left+t;let d=l+r.width;let c=a+r.height;if(i=d||s=c){continue}let h=i-l+1;let u=s-a+1;let p=d-i;let m=c-s;let g=Math.min(h,u,p,m);if(g>e.SCROLL_EDGE_SIZE){continue}let f;switch(g){case m:f="bottom";break;case u:f="top";break;case p:f="right";break;case h:f="left";break;default:throw"unreachable"}let v=o.scrollWidth-o.clientWidth;let _=o.scrollHeight-o.clientHeight;let b;switch(f){case"top":b=_>0&&o.scrollTop>0;break;case"left":b=v>0&&o.scrollLeft>0;break;case"right":b=v>0&&o.scrollLeft0&&o.scrollTop<_;break;default:throw"unreachable"}if(!b){continue}return{element:o,edge:f,distance:g}}return null}e.findScrollTarget=a;function l(e,t,n,i){if(!t){return null}let s=new o.Event(i,{drag:e,related:n,type:"lm-dragenter"});let r=!t.dispatchEvent(s);if(r){return t}const a=e.document instanceof Document?e.document.body:e.document.firstElementChild;if(t===a){return n}s=new o.Event(i,{drag:e,related:n,type:"lm-dragenter"});a.dispatchEvent(s);return a}e.dispatchDragEnter=l;function d(e,t,n,i){if(!t){return}let s=new o.Event(i,{drag:e,related:n,type:"lm-dragexit"});t.dispatchEvent(s)}e.dispatchDragExit=d;function c(e,t,n,i){if(!t){return}let s=new o.Event(i,{drag:e,related:n,type:"lm-dragleave"});t.dispatchEvent(s)}e.dispatchDragLeave=c;function h(e,t,n){if(!t){return"none"}let i=new o.Event(n,{drag:e,related:null,type:"lm-dragover"});let s=!t.dispatchEvent(i);if(s){return i.dropAction}return"none"}e.dispatchDragOver=h;function u(e,t,n){if(!t){return"none"}let i=new o.Event(n,{drag:e,related:null,type:"lm-drop"});let s=!t.dispatchEvent(i);if(s){return i.dropAction}return"none"}e.dispatchDrop=u;const p={none:0,copy:1,link:2,move:4};const m={none:p["none"],copy:p["copy"],link:p["link"],move:p["move"],"copy-link":p["copy"]|p["link"],"copy-move":p["copy"]|p["move"],"link-move":p["link"]|p["move"],all:p["copy"]|p["link"]|p["move"]};function g(t,n=document){let s=++w;const o=n instanceof Document?n.body:n.firstElementChild;if(!e.cursorBackdrop.isConnected){e.cursorBackdrop.style.transform="scale(0)";o.appendChild(e.cursorBackdrop);_();document.addEventListener("pointermove",f,{capture:true,passive:true});e.cursorBackdrop.addEventListener("scroll",v,{capture:true,passive:true})}e.cursorBackdrop.style.cursor=t;return new i.DisposableDelegate((()=>{if(s===w&&e.cursorBackdrop.isConnected){document.removeEventListener("pointermove",f,true);e.cursorBackdrop.removeEventListener("scroll",v,true);o.removeChild(e.cursorBackdrop)}}))}e.overrideCursor=g;function f(t){if(!e.cursorBackdrop){return}e.cursorBackdrop.style.transform=`translate(${t.clientX}px, ${t.clientY}px)`}function v(t){if(!e.cursorBackdrop){return}let i=n();if(!i){return}const s=i.closest("[data-lm-dragscroll]");if(!s){return}s.scrollTop+=e.cursorBackdrop.scrollTop-b;s.scrollLeft+=e.cursorBackdrop.scrollLeft-b;_()}function _(){e.cursorBackdrop.scrollTop=b;e.cursorBackdrop.scrollLeft=b}const b=500;function y(){const e=document.createElement("div");e.classList.add("lm-cursor-backdrop");return e}let w=0;e.cursorBackdrop=y()})(r||(r={}))},38457:(e,t,n)=>{"use strict";var i=n(85072);var s=n.n(i);var o=n(97825);var r=n.n(o);var a=n(77659);var l=n.n(a);var d=n(55056);var c=n.n(d);var h=n(10540);var u=n.n(h);var p=n(41113);var m=n.n(p);var g=n(91266);var f={};f.styleTagTransform=m();f.setAttributes=c();f.insert=l().bind(null,"head");f.domAPI=r();f.insertStyleElement=u();var v=s()(g.A,f);const _=g.A&&g.A.locals?g.A.locals:undefined},72996:(e,t,n)=>{"use strict";n.r(t);n.d(t,{EN_US:()=>r,KeycodeLayout:()=>o,getKeyboardLayout:()=>i,setKeyboardLayout:()=>s});function i(){return a.keyboardLayout}function s(e){a.keyboardLayout=e}class o{constructor(e,t,n=[]){this.name=e;this._codes=t;this._keys=o.extractKeys(t);this._modifierKeys=o.convertToKeySet(n)}keys(){return Object.keys(this._keys)}isValidKey(e){return e in this._keys}isModifierKey(e){return e in this._modifierKeys}keyForKeydownEvent(e){return this._codes[e.keyCode]||""}}(function(e){function t(e){let t=Object.create(null);for(let n in e){t[e[n]]=true}return t}e.extractKeys=t;function n(e){let t=Object(null);for(let n=0,i=e.length;n{"use strict";n.r(t);n.d(t,{ConflatableMessage:()=>a,Message:()=>r,MessageLoop:()=>l});var i=n(34236);class s{constructor(){this._first=null;this._last=null;this._size=0}get isEmpty(){return this._size===0}get size(){return this._size}get length(){return this._size}get first(){return this._first?this._first.value:undefined}get last(){return this._last?this._last.value:undefined}get firstNode(){return this._first}get lastNode(){return this._last}*[Symbol.iterator](){let e=this._first;while(e){yield e.value;e=e.next}}*retro(){let e=this._last;while(e){yield e.value;e=e.prev}}*nodes(){let e=this._first;while(e){yield e;e=e.next}}*retroNodes(){let e=this._last;while(e){yield e;e=e.prev}}assign(e){this.clear();for(const t of e){this.addLast(t)}}push(e){this.addLast(e)}pop(){return this.removeLast()}shift(e){this.addFirst(e)}unshift(){return this.removeFirst()}addFirst(e){let t=new o.LinkedListNode(this,e);if(!this._first){this._first=t;this._last=t}else{t.next=this._first;this._first.prev=t;this._first=t}this._size++;return t}addLast(e){let t=new o.LinkedListNode(this,e);if(!this._last){this._first=t;this._last=t}else{t.prev=this._last;this._last.next=t;this._last=t}this._size++;return t}insertBefore(e,t){if(!t||t===this._first){return this.addFirst(e)}if(!(t instanceof o.LinkedListNode)||t.list!==this){throw new Error("Reference node is not owned by the list.")}let n=new o.LinkedListNode(this,e);let i=t;let s=i.prev;n.next=i;n.prev=s;i.prev=n;s.next=n;this._size++;return n}insertAfter(e,t){if(!t||t===this._last){return this.addLast(e)}if(!(t instanceof o.LinkedListNode)||t.list!==this){throw new Error("Reference node is not owned by the list.")}let n=new o.LinkedListNode(this,e);let i=t;let s=i.next;n.next=s;n.prev=i;i.next=n;s.prev=n;this._size++;return n}removeFirst(){let e=this._first;if(!e){return undefined}if(e===this._last){this._first=null;this._last=null}else{this._first=e.next;this._first.prev=null}e.list=null;e.next=null;e.prev=null;this._size--;return e.value}removeLast(){let e=this._last;if(!e){return undefined}if(e===this._first){this._first=null;this._last=null}else{this._last=e.prev;this._last.next=null}e.list=null;e.next=null;e.prev=null;this._size--;return e.value}removeNode(e){if(!(e instanceof o.LinkedListNode)||e.list!==this){throw new Error("Node is not owned by the list.")}let t=e;if(t===this._first&&t===this._last){this._first=null;this._last=null}else if(t===this._first){this._first=t.next;this._first.prev=null}else if(t===this._last){this._last=t.prev;this._last.next=null}else{t.next.prev=t.prev;t.prev.next=t.next}t.list=null;t.next=null;t.prev=null;this._size--}clear(){let e=this._first;while(e){let t=e.next;e.list=null;e.prev=null;e.next=null;e=t}this._first=null;this._last=null;this._size=0}}(function(e){function t(t){let n=new e;n.assign(t);return n}e.from=t})(s||(s={}));var o;(function(e){class t{constructor(e,t){this.list=null;this.next=null;this.prev=null;this.list=e;this.value=t}}e.LinkedListNode=t})(o||(o={}));class r{constructor(e){this.type=e}get isConflatable(){return false}conflate(e){return false}}class a extends r{get isConflatable(){return true}conflate(e){return true}}var l;(function(e){let t=null;const n=(e=>t=>{let n=false;e.then((()=>!n&&t()));return()=>{n=true}})(Promise.resolve());function o(e,t){let n=m.get(e);if(!n||n.length===0){b(e,t);return}let s=(0,i.every)((0,i.retro)(n),(n=>n?_(n,e,t):true));if(s){b(e,t)}}e.sendMessage=o;function r(e,t){if(!t.isConflatable){y(e,t);return}let n=(0,i.some)(p,(n=>{if(n.handler!==e){return false}if(!n.msg){return false}if(n.msg.type!==t.type){return false}if(!n.msg.isConflatable){return false}return n.msg.conflate(t)}));if(!n){y(e,t)}}e.postMessage=r;function a(e,t){let n=m.get(e);if(n&&n.indexOf(t)!==-1){return}if(!n){m.set(e,[t])}else{n.push(t)}}e.installMessageHook=a;function l(e,t){let n=m.get(e);if(!n){return}let i=n.indexOf(t);if(i===-1){return}n[i]=null;C(n)}e.removeMessageHook=l;function d(e){let t=m.get(e);if(t&&t.length>0){i.ArrayExt.fill(t,null);C(t)}for(const n of p){if(n.handler===e){n.handler=null;n.msg=null}}}e.clearData=d;function c(){if(v||t===null){return}t();t=null;v=true;w();v=false}e.flush=c;function h(){return f}e.getExceptionHandler=h;function u(e){let t=f;f=e;return t}e.setExceptionHandler=u;const p=new s;const m=new WeakMap;const g=new Set;let f=e=>{console.error(e)};let v=false;function _(e,t,n){let i=true;try{if(typeof e==="function"){i=e(t,n)}else{i=e.messageHook(t,n)}}catch(s){f(s)}return i}function b(e,t){try{e.processMessage(t)}catch(n){f(n)}}function y(e,i){p.addLast({handler:e,msg:i});if(t!==null){return}t=n(w)}function w(){t=null;if(p.isEmpty){return}let e={handler:null,msg:null};p.addLast(e);while(true){let t=p.removeFirst();if(t===e){return}if(t.handler&&t.msg){o(t.handler,t.msg)}}}function C(e){if(g.size===0){n(x)}g.add(e)}function x(){g.forEach(S);g.clear()}function S(e){i.ArrayExt.removeAllWhere(e,k)}function k(e){return e===null}})(l||(l={}))},68534:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Debouncer:()=>c,Poll:()=>a,RateLimiter:()=>d,Throttler:()=>h});var i=n(5592);var s=n.n(i);var o=n(2336);var r=n.n(o);class a{constructor(e){var t;this._disposed=new o.Signal(this);this._lingered=0;this._tick=new i.PromiseDelegate;this._ticked=new o.Signal(this);this._factory=e.factory;this._linger=(t=e.linger)!==null&&t!==void 0?t:l.DEFAULT_LINGER;this._standby=e.standby||l.DEFAULT_STANDBY;this._state={...l.DEFAULT_STATE,timestamp:(new Date).getTime()};const n=e.frequency||{};const s=Math.max(n.interval||0,n.max||0,l.DEFAULT_FREQUENCY.max);this.frequency={...l.DEFAULT_FREQUENCY,...n,...{max:s}};this.name=e.name||l.DEFAULT_NAME;if("auto"in e?e.auto:true){setTimeout((()=>this.start()))}}get disposed(){return this._disposed}get frequency(){return this._frequency}set frequency(e){if(this.isDisposed||i.JSONExt.deepEqual(e,this.frequency||{})){return}let{backoff:t,interval:n,max:s}=e;n=Math.round(n);s=Math.round(s);if(typeof t==="number"&&t<1){throw new Error("Poll backoff growth factor must be at least 1")}if((n<0||n>s)&&n!==a.NEVER){throw new Error("Poll interval must be between 0 and max")}if(s>a.MAX_INTERVAL&&s!==a.NEVER){throw new Error(`Max interval must be less than ${a.MAX_INTERVAL}`)}this._frequency={backoff:t,interval:n,max:s}}get isDisposed(){return this.state.phase==="disposed"}get standby(){return this._standby}set standby(e){if(this.isDisposed||this.standby===e){return}this._standby=e}get state(){return this._state}get tick(){return this._tick.promise}get ticked(){return this._ticked}async*[Symbol.asyncIterator](){while(!this.isDisposed){yield this.state;await this.tick.catch((()=>undefined))}}dispose(){if(this.isDisposed){return}this._state={...l.DISPOSED_STATE,timestamp:(new Date).getTime()};this._tick.promise.catch((e=>undefined));this._tick.reject(new Error(`Poll (${this.name}) is disposed.`));this._disposed.emit(undefined);o.Signal.clearData(this)}refresh(){return this.schedule({cancel:({phase:e})=>e==="refreshed",interval:a.IMMEDIATE,phase:"refreshed"})}async schedule(e={}){if(this.isDisposed){return}if(e.cancel&&e.cancel(this.state)){return}const t=this._tick;const n=new i.PromiseDelegate;const s={interval:this.frequency.interval,payload:null,phase:"standby",timestamp:(new Date).getTime(),...e};this._state=s;this._tick=n;clearTimeout(this._timeout);this._ticked.emit(this.state);t.resolve(this);await t.promise;if(s.interval===a.NEVER){this._timeout=undefined;return}const o=()=>{if(this.isDisposed||this.tick!==n.promise){return}this._execute()};this._timeout=setTimeout(o,s.interval)}start(){return this.schedule({cancel:({phase:e})=>e!=="constructed"&&e!=="standby"&&e!=="stopped",interval:a.IMMEDIATE,phase:"started"})}stop(){return this.schedule({cancel:({phase:e})=>e==="stopped",interval:a.NEVER,phase:"stopped"})}get hidden(){return l.hidden}_execute(){let e=typeof this.standby==="function"?this.standby():this.standby;if(e==="never"){e=false}else if(e==="when-hidden"){if(this.hidden){e=++this._lingered>this._linger}else{this._lingered=0;e=false}}if(e){void this.schedule();return}const t=this.tick;this._factory(this.state).then((e=>{if(this.isDisposed||this.tick!==t){return}void this.schedule({payload:e,phase:this.state.phase==="rejected"?"reconnected":"resolved"})})).catch((e=>{if(this.isDisposed||this.tick!==t){return}void this.schedule({interval:l.sleep(this.frequency,this.state),payload:e,phase:"rejected"})}))}}(function(e){e.IMMEDIATE=0;e.MAX_INTERVAL=2147483647;e.NEVER=Infinity})(a||(a={}));var l;(function(e){e.DEFAULT_BACKOFF=3;e.DEFAULT_FREQUENCY={backoff:true,interval:1e3,max:30*1e3};e.DEFAULT_LINGER=1;e.DEFAULT_NAME="unknown";e.DEFAULT_STANDBY="when-hidden";e.DEFAULT_STATE={interval:a.NEVER,payload:null,phase:"constructed",timestamp:new Date(0).getTime()};e.DISPOSED_STATE={interval:a.NEVER,payload:null,phase:"disposed",timestamp:new Date(0).getTime()};function t(t,i){const{backoff:s,interval:o,max:r}=t;if(o===a.NEVER){return o}const l=s===true?e.DEFAULT_BACKOFF:s===false?1:s;const d=n(o,i.interval*l);return Math.min(r,d)}e.sleep=t;e.hidden=(()=>{if(typeof document==="undefined"){return false}document.addEventListener("visibilitychange",(()=>{e.hidden=document.visibilityState==="hidden"}));document.addEventListener("pagehide",(()=>{e.hidden=document.visibilityState==="hidden"}));return document.visibilityState==="hidden"})();function n(e,t){e=Math.ceil(e);t=Math.floor(t);return Math.floor(Math.random()*(t-e+1))+e}})(l||(l={}));class d{constructor(e,t=500){this.args=undefined;this.payload=null;this.limit=t;this.poll=new a({auto:false,factory:async()=>{const{args:t}=this;this.args=undefined;return e(...t)},frequency:{backoff:false,interval:a.NEVER,max:a.NEVER},standby:"never"});this.payload=new i.PromiseDelegate;this.poll.ticked.connect(((e,t)=>{const{payload:n}=this;if(t.phase==="resolved"){this.payload=new i.PromiseDelegate;n.resolve(t.payload);return}if(t.phase==="rejected"||t.phase==="stopped"){this.payload=new i.PromiseDelegate;n.promise.catch((e=>undefined));n.reject(t.payload);return}}),this)}get isDisposed(){return this.payload===null}dispose(){if(this.isDisposed){return}this.args=undefined;this.payload=null;this.poll.dispose()}async stop(){return this.poll.stop()}}class c extends d{invoke(...e){this.args=e;void this.poll.schedule({interval:this.limit,phase:"invoked"});return this.payload.promise}}class h extends d{constructor(e,t){super(e,typeof t==="number"?t:t&&t.limit);this._trailing=false;if(typeof t!=="number"&&t&&t.edge==="trailing"){this._trailing=true}this._interval=this._trailing?this.limit:a.IMMEDIATE}invoke(...e){const t=this.poll.state.phase!=="invoked";if(t||this._trailing){this.args=e}if(t){void this.poll.schedule({interval:this._interval,phase:"invoked"})}return this.payload.promise}}},21628:(e,t,n)=>{"use strict";n.r(t);n.d(t,{AttachedProperty:()=>i});class i{constructor(e){this._pid=s.nextPID();this.name=e.name;this._create=e.create;this._coerce=e.coerce||null;this._compare=e.compare||null;this._changed=e.changed||null}get(e){let t;let n=s.ensureMap(e);if(this._pid in n){t=n[this._pid]}else{t=n[this._pid]=this._createValue(e)}return t}set(e,t){let n;let i=s.ensureMap(e);if(this._pid in i){n=i[this._pid]}else{n=i[this._pid]=this._createValue(e)}let o=this._coerceValue(e,t);this._maybeNotify(e,n,i[this._pid]=o)}coerce(e){let t;let n=s.ensureMap(e);if(this._pid in n){t=n[this._pid]}else{t=n[this._pid]=this._createValue(e)}let i=this._coerceValue(e,t);this._maybeNotify(e,t,n[this._pid]=i)}_createValue(e){let t=this._create;return t(e)}_coerceValue(e,t){let n=this._coerce;return n?n(e,t):t}_compareValue(e,t){let n=this._compare;return n?n(e,t):e===t}_maybeNotify(e,t,n){let i=this._changed;if(i&&!this._compareValue(t,n)){i(e,t,n)}}}(function(e){function t(e){s.ownerData.delete(e)}e.clearData=t})(i||(i={}));var s;(function(e){e.ownerData=new WeakMap;e.nextPID=(()=>{let e=0;return()=>{let t=Math.random();let n=`${t}`.slice(2);return`pid-${n}-${e++}`}})();function t(t){let n=e.ownerData.get(t);if(n){return n}n=Object.create(null);e.ownerData.set(t,n);return n}e.ensureMap=t})(s||(s={}))},96903:(e,t,n)=>{"use strict";n.r(t);n.d(t,{Signal:()=>a,Stream:()=>l});var i=n(34236);var s=n.n(i);var o=n(5592);var r=n.n(o);class a{constructor(e){this.sender=e}connect(e,t){return d.connect(this,e,t)}disconnect(e,t){return d.disconnect(this,e,t)}emit(e){d.emit(this,e)}}(function(e){function t(e,t){d.disconnectBetween(e,t)}e.disconnectBetween=t;function n(e){d.disconnectSender(e)}e.disconnectSender=n;function i(e){d.disconnectReceiver(e)}e.disconnectReceiver=i;function s(e){d.disconnectAll(e)}e.disconnectAll=s;function o(e){d.disconnectAll(e)}e.clearData=o;function r(){return d.exceptionHandler}e.getExceptionHandler=r;function a(e){let t=d.exceptionHandler;d.exceptionHandler=e;return t}e.setExceptionHandler=a})(a||(a={}));class l extends a{constructor(){super(...arguments);this._pending=new o.PromiseDelegate}async*[Symbol.asyncIterator](){let e=this._pending;while(true){try{const{args:t,next:n}=await e.promise;e=n;yield t}catch(t){return}}}emit(e){const t=this._pending;const n=this._pending=new o.PromiseDelegate;t.resolve({args:e,next:n});super.emit(e)}stop(){this._pending.promise.catch((()=>undefined));this._pending.reject("stop");this._pending=new o.PromiseDelegate}}var d;(function(e){e.exceptionHandler=e=>{console.error(e)};function t(e,t,n){n=n||undefined;let i=d.get(e.sender);if(!i){i=[];d.set(e.sender,i)}if(p(i,e,t,n)){return false}let s=n||t;let o=c.get(s);if(!o){o=[];c.set(s,o)}let r={signal:e,slot:t,thisArg:n};i.push(r);o.push(r);return true}e.connect=t;function n(e,t,n){n=n||undefined;let i=d.get(e.sender);if(!i||i.length===0){return false}let s=p(i,e,t,n);if(!s){return false}let o=n||t;let r=c.get(o);s.signal=null;g(i);g(r);return true}e.disconnect=n;function s(e,t){let n=d.get(e);if(!n||n.length===0){return}let i=c.get(t);if(!i||i.length===0){return}for(const s of i){if(!s.signal){continue}if(s.signal.sender===e){s.signal=null}}g(n);g(i)}e.disconnectBetween=s;function o(e){let t=d.get(e);if(!t||t.length===0){return}for(const n of t){if(!n.signal){continue}let e=n.thisArg||n.slot;n.signal=null;g(c.get(e))}g(t)}e.disconnectSender=o;function r(e){let t=c.get(e);if(!t||t.length===0){return}for(const n of t){if(!n.signal){continue}let e=n.signal.sender;n.signal=null;g(d.get(e))}g(t)}e.disconnectReceiver=r;function a(e){o(e);r(e)}e.disconnectAll=a;function l(e,t){let n=d.get(e.sender);if(!n||n.length===0){return}for(let i=0,s=n.length;i{let e=typeof requestAnimationFrame==="function";return e?requestAnimationFrame:setImmediate})();function p(e,t,n,s){return(0,i.find)(e,(e=>e.signal===t&&e.slot===n&&e.thisArg===s))}function m(t,n){let{signal:i,slot:s,thisArg:o}=t;try{s.call(o,i.sender,n)}catch(r){e.exceptionHandler(r)}}function g(e){if(h.size===0){u(f)}h.add(e)}function f(){h.forEach(v);h.clear()}function v(e){i.ArrayExt.removeAllWhere(e,_)}function _(e){return e.signal===null}})(d||(d={}))},57340:(e,t,n)=>{"use strict";n.r(t);n.d(t,{VirtualDOM:()=>c,VirtualElement:()=>r,VirtualElementPass:()=>a,VirtualText:()=>o,h:()=>l,hpass:()=>d});var i=n(34236);var s=n.n(i);class o{constructor(e){this.type="text";this.content=e}}class r{constructor(e,t,n,i){this.type="element";this.tag=e;this.attrs=t;this.children=n;this.renderer=i}}class a extends r{constructor(e,t,n){super(e,t,[],n||undefined)}}function l(e){let t={};let n;let i=[];for(let a=1,l=arguments.length;a3){throw new Error("hpass() should be called with 1, 2, or 3 arguments")}return new a(e,t,n)}var c;(function(e){function t(e){return h.createDOMNode(e)}e.realize=t;function n(e,t){let n=h.hostMap.get(t)||[];let i=h.asContentArray(e);h.hostMap.set(t,i);h.updateContent(t,n,i)}e.render=n})(c||(c={}));var h;(function(e){e.hostMap=new WeakMap;function t(e){if(!e){return[]}if(e instanceof Array){return e}return[e]}e.asContentArray=t;function n(e){let t=arguments[1]||null;const i=arguments[2]||null;if(t){t.insertBefore(n(e),i)}else{if(e.type==="text"){return document.createTextNode(e.content)}t=document.createElement(e.tag);a(t,e.attrs);if(e.renderer){e.renderer.render(t,{attrs:e.attrs,children:e.children});return t}for(let i=0,s=e.children.length;i=d.length){n(r[o],e);continue}let t=d[o];let h=r[o];if(t===h){c=c.nextSibling;continue}if(t.type==="text"&&h.type==="text"){if(c.textContent!==h.content){c.textContent=h.content}c=c.nextSibling;continue}if(t.type==="text"||h.type==="text"){i.ArrayExt.insert(d,o,h);n(h,e,c);continue}if(!t.renderer!=!h.renderer){i.ArrayExt.insert(d,o,h);n(h,e,c);continue}let u=h.attrs.key;if(u&&u in a){let n=a[u];if(n.vNode!==t){i.ArrayExt.move(d,d.indexOf(n.vNode,o+1),o);e.insertBefore(n.element,c);t=n.vNode;c=n.element}}if(t===h){c=c.nextSibling;continue}let p=t.attrs.key;if(p&&p!==u){i.ArrayExt.insert(d,o,h);n(h,e,c);continue}if(t.tag!==h.tag){i.ArrayExt.insert(d,o,h);n(h,e,c);continue}l(c,t.attrs,h.attrs);if(h.renderer){h.renderer.render(c,{attrs:h.attrs,children:h.children})}else{s(c,t.children,h.children)}c=c.nextSibling}o(e,d,h,true)}e.updateContent=s;function o(e,t,n,i){for(let s=t.length-1;s>=n;--s){const n=t[s];const r=i?e.lastChild:e.childNodes[s];if(n.type==="text");else if(n.renderer&&n.renderer.unrender){n.renderer.unrender(r,{attrs:n.attrs,children:n.children})}else{o(r,n.children,0,false)}if(i){e.removeChild(r)}}}const r={key:true,className:true,htmlFor:true,dataset:true,style:true};function a(e,t){for(let n in t){if(n in r){continue}if(n.substr(0,2)==="on"){e[n]=t[n]}else{e.setAttribute(n,t[n])}}if(t.className!==undefined){e.setAttribute("class",t.className)}if(t.htmlFor!==undefined){e.setAttribute("for",t.htmlFor)}if(t.dataset){d(e,t.dataset)}if(t.style){h(e,t.style)}}function l(e,t,n){if(t===n){return}let i;for(i in t){if(i in r||i in n){continue}if(i.substr(0,2)==="on"){e[i]=null}else{e.removeAttribute(i)}}for(i in n){if(i in r||t[i]===n[i]){continue}if(i.substr(0,2)==="on"){e[i]=n[i]}else{e.setAttribute(i,n[i])}}if(t.className!==n.className){if(n.className!==undefined){e.setAttribute("class",n.className)}else{e.removeAttribute("class")}}if(t.htmlFor!==n.htmlFor){if(n.htmlFor!==undefined){e.setAttribute("for",n.htmlFor)}else{e.removeAttribute("for")}}if(t.dataset!==n.dataset){c(e,t.dataset||{},n.dataset||{})}if(t.style!==n.style){u(e,t.style||{},n.style||{})}}function d(e,t){for(let n in t){e.setAttribute(`data-${n}`,t[n])}}function c(e,t,n){for(let i in t){if(!(i in n)){e.removeAttribute(`data-${i}`)}}for(let i in n){if(t[i]!==n[i]){e.setAttribute(`data-${i}`,n[i])}}}function h(e,t){let n=e.style;let i;for(i in t){n[i]=t[i]}}function u(e,t,n){let i=e.style;let s;for(s in t){if(!(s in n)){i[s]=""}}for(s in n){if(t[s]!==n[s]){i[s]=n[s]}}}function p(e,t){let n=e.firstChild;let i=Object.create(null);for(let s of t){if(s.type==="element"&&s.attrs.key){i[s.attrs.key]={vNode:s,element:n}}n=n.nextSibling}return i}})(h||(h={}))},14292:(e,t,n)=>{"use strict";n.r(t);n.d(t,{AccordionLayout:()=>B,AccordionPanel:()=>U,BoxEngine:()=>j,BoxLayout:()=>$,BoxPanel:()=>J,BoxSizer:()=>k,CommandPalette:()=>Y,ContextMenu:()=>ee,DockLayout:()=>oe,DockPanel:()=>ae,FocusTracker:()=>de,GridLayout:()=>ce,Layout:()=>M,LayoutItem:()=>D,Menu:()=>Q,MenuBar:()=>ue,Panel:()=>z,PanelLayout:()=>P,ScrollBar:()=>me,SingletonLayout:()=>fe,SplitLayout:()=>N,SplitPanel:()=>W,StackedLayout:()=>ve,StackedPanel:()=>_e,TabBar:()=>ie,TabPanel:()=>ye,Title:()=>I,Widget:()=>E});var i=n(34236);var s=n.n(i);var o=n(5592);var r=n.n(o);var a=n(76326);var l=n.n(a);var d=n(42856);var c=n.n(d);var h=n(94466);var u=n.n(h);var p=n(2336);var m=n.n(p);var g=n(10970);var f=n.n(g);var v=n(93247);var _=n.n(v);var b=n(97290);var y=n.n(b);var w=n(90044);var C=n.n(w);var x=n(77162);var S=n.n(x);class k{constructor(){this.sizeHint=0;this.minSize=0;this.maxSize=Infinity;this.stretch=1;this.size=0;this.done=false}}var j;(function(e){function t(e,t){let n=e.length;if(n===0){return t}let i=0;let s=0;let o=0;let r=0;let a=0;for(let c=0;c0){r+=t.stretch;a++}}if(t===o){return 0}if(t<=i){for(let t=0;t=s){for(let t=0;t0&&i>l){let t=i;let s=r;for(let o=0;o0&&i>l){let t=i/d;for(let s=0;s0&&i>l){let t=i;let s=r;for(let o=0;o=n.maxSize){i-=n.maxSize-n.size;r-=n.stretch;n.size=n.maxSize;n.done=true;d--;a--}else{i-=l;n.size+=l}}}while(d>0&&i>l){let t=i/d;for(let s=0;s=n.maxSize){i-=n.maxSize-n.size;n.size=n.maxSize;n.done=true;d--}else{i-=t;n.size+=t}}}}return 0}e.calc=t;function n(e,t,n){if(e.length===0||n===0){return}if(n>0){i(e,t,n)}else{s(e,t,-n)}}e.adjust=n;function i(e,t,n){let i=0;for(let a=0;a<=t;++a){let t=e[a];i+=t.maxSize-t.size}let s=0;for(let a=t+1,l=e.length;a=0&&o>0;--a){let t=e[a];let n=t.maxSize-t.size;if(n>=o){t.sizeHint=t.size+o;o=0}else{t.sizeHint=t.size+n;o-=n}}let r=n;for(let a=t+1,l=e.length;a0;++a){let t=e[a];let n=t.size-t.minSize;if(n>=r){t.sizeHint=t.size-r;r=0}else{t.sizeHint=t.size-n;r-=n}}}function s(e,t,n){let i=0;for(let a=t+1,l=e.length;a0;++a){let t=e[a];let n=t.maxSize-t.size;if(n>=o){t.sizeHint=t.size+o;o=0}else{t.sizeHint=t.size+n;o-=n}}let r=n;for(let a=t;a>=0&&r>0;--a){let t=e[a];let n=t.size-t.minSize;if(n>=r){t.sizeHint=t.size-r;r=0}else{t.sizeHint=t.size-n;r-=n}}}})(j||(j={}));class I{constructor(e){this._label="";this._caption="";this._mnemonic=-1;this._icon=undefined;this._iconClass="";this._iconLabel="";this._className="";this._closable=false;this._changed=new p.Signal(this);this._isDisposed=false;this.owner=e.owner;if(e.label!==undefined){this._label=e.label}if(e.mnemonic!==undefined){this._mnemonic=e.mnemonic}if(e.icon!==undefined){this._icon=e.icon}if(e.iconClass!==undefined){this._iconClass=e.iconClass}if(e.iconLabel!==undefined){this._iconLabel=e.iconLabel}if(e.caption!==undefined){this._caption=e.caption}if(e.className!==undefined){this._className=e.className}if(e.closable!==undefined){this._closable=e.closable}this._dataset=e.dataset||{}}get changed(){return this._changed}get label(){return this._label}set label(e){if(this._label===e){return}this._label=e;this._changed.emit(undefined)}get mnemonic(){return this._mnemonic}set mnemonic(e){if(this._mnemonic===e){return}this._mnemonic=e;this._changed.emit(undefined)}get icon(){return this._icon}set icon(e){if(this._icon===e){return}this._icon=e;this._changed.emit(undefined)}get iconClass(){return this._iconClass}set iconClass(e){if(this._iconClass===e){return}this._iconClass=e;this._changed.emit(undefined)}get iconLabel(){return this._iconLabel}set iconLabel(e){if(this._iconLabel===e){return}this._iconLabel=e;this._changed.emit(undefined)}get caption(){return this._caption}set caption(e){if(this._caption===e){return}this._caption=e;this._changed.emit(undefined)}get className(){return this._className}set className(e){if(this._className===e){return}this._className=e;this._changed.emit(undefined)}get closable(){return this._closable}set closable(e){if(this._closable===e){return}this._closable=e;this._changed.emit(undefined)}get dataset(){return this._dataset}set dataset(e){if(this._dataset===e){return}this._dataset=e;this._changed.emit(undefined)}get isDisposed(){return this._isDisposed}dispose(){if(this.isDisposed){return}this._isDisposed=true;p.Signal.clearData(this)}}class E{constructor(e={}){this._flags=0;this._layout=null;this._parent=null;this._disposed=new p.Signal(this);this._hiddenMode=E.HiddenMode.Display;this.node=T.createNode(e);this.addClass("lm-Widget")}dispose(){if(this.isDisposed){return}this.setFlag(E.Flag.IsDisposed);this._disposed.emit(undefined);if(this.parent){this.parent=null}else if(this.isAttached){E.detach(this)}if(this._layout){this._layout.dispose();this._layout=null}this.title.dispose();p.Signal.clearData(this);d.MessageLoop.clearData(this);h.AttachedProperty.clearData(this)}get disposed(){return this._disposed}get isDisposed(){return this.testFlag(E.Flag.IsDisposed)}get isAttached(){return this.testFlag(E.Flag.IsAttached)}get isHidden(){return this.testFlag(E.Flag.IsHidden)}get isVisible(){let e=this;do{if(e.isHidden||!e.isAttached){return false}e=e.parent}while(e!=null);return true}get title(){return T.titleProperty.get(this)}get id(){return this.node.id}set id(e){this.node.id=e}get dataset(){return this.node.dataset}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode===e){return}if(this.isHidden){this._toggleHidden(false)}if(e==E.HiddenMode.Scale){this.node.style.willChange="transform"}else{this.node.style.willChange="auto"}this._hiddenMode=e;if(this.isHidden){this._toggleHidden(true)}}get parent(){return this._parent}set parent(e){if(this._parent===e){return}if(e&&this.contains(e)){throw new Error("Invalid parent widget.")}if(this._parent&&!this._parent.isDisposed){let e=new E.ChildMessage("child-removed",this);d.MessageLoop.sendMessage(this._parent,e)}this._parent=e;if(this._parent&&!this._parent.isDisposed){let e=new E.ChildMessage("child-added",this);d.MessageLoop.sendMessage(this._parent,e)}if(!this.isDisposed){d.MessageLoop.sendMessage(this,E.Msg.ParentChanged)}}get layout(){return this._layout}set layout(e){if(this._layout===e){return}if(this.testFlag(E.Flag.DisallowLayout)){throw new Error("Cannot set widget layout.")}if(this._layout){throw new Error("Cannot change widget layout.")}if(e.parent){throw new Error("Cannot change layout parent.")}this._layout=e;e.parent=this}*children(){if(this._layout){yield*this._layout}}contains(e){for(let t=e;t;t=t._parent){if(t===this){return true}}return false}hasClass(e){return this.node.classList.contains(e)}addClass(e){this.node.classList.add(e)}removeClass(e){this.node.classList.remove(e)}toggleClass(e,t){if(t===true){this.node.classList.add(e);return true}if(t===false){this.node.classList.remove(e);return false}return this.node.classList.toggle(e)}update(){d.MessageLoop.postMessage(this,E.Msg.UpdateRequest)}fit(){d.MessageLoop.postMessage(this,E.Msg.FitRequest)}activate(){d.MessageLoop.postMessage(this,E.Msg.ActivateRequest)}close(){d.MessageLoop.sendMessage(this,E.Msg.CloseRequest)}show(){if(!this.testFlag(E.Flag.IsHidden)){return}if(this.isAttached&&(!this.parent||this.parent.isVisible)){d.MessageLoop.sendMessage(this,E.Msg.BeforeShow)}this.clearFlag(E.Flag.IsHidden);this._toggleHidden(false);if(this.isAttached&&(!this.parent||this.parent.isVisible)){d.MessageLoop.sendMessage(this,E.Msg.AfterShow)}if(this.parent){let e=new E.ChildMessage("child-shown",this);d.MessageLoop.sendMessage(this.parent,e)}}hide(){if(this.testFlag(E.Flag.IsHidden)){return}if(this.isAttached&&(!this.parent||this.parent.isVisible)){d.MessageLoop.sendMessage(this,E.Msg.BeforeHide)}this.setFlag(E.Flag.IsHidden);this._toggleHidden(true);if(this.isAttached&&(!this.parent||this.parent.isVisible)){d.MessageLoop.sendMessage(this,E.Msg.AfterHide)}if(this.parent){let e=new E.ChildMessage("child-hidden",this);d.MessageLoop.sendMessage(this.parent,e)}}setHidden(e){if(e){this.hide()}else{this.show()}}testFlag(e){return(this._flags&e)!==0}setFlag(e){this._flags|=e}clearFlag(e){this._flags&=~e}processMessage(e){switch(e.type){case"resize":this.notifyLayout(e);this.onResize(e);break;case"update-request":this.notifyLayout(e);this.onUpdateRequest(e);break;case"fit-request":this.notifyLayout(e);this.onFitRequest(e);break;case"before-show":this.notifyLayout(e);this.onBeforeShow(e);break;case"after-show":this.setFlag(E.Flag.IsVisible);this.notifyLayout(e);this.onAfterShow(e);break;case"before-hide":this.notifyLayout(e);this.onBeforeHide(e);break;case"after-hide":this.clearFlag(E.Flag.IsVisible);this.notifyLayout(e);this.onAfterHide(e);break;case"before-attach":this.notifyLayout(e);this.onBeforeAttach(e);break;case"after-attach":if(!this.isHidden&&(!this.parent||this.parent.isVisible)){this.setFlag(E.Flag.IsVisible)}this.setFlag(E.Flag.IsAttached);this.notifyLayout(e);this.onAfterAttach(e);break;case"before-detach":this.notifyLayout(e);this.onBeforeDetach(e);break;case"after-detach":this.clearFlag(E.Flag.IsVisible);this.clearFlag(E.Flag.IsAttached);this.notifyLayout(e);this.onAfterDetach(e);break;case"activate-request":this.notifyLayout(e);this.onActivateRequest(e);break;case"close-request":this.notifyLayout(e);this.onCloseRequest(e);break;case"child-added":this.notifyLayout(e);this.onChildAdded(e);break;case"child-removed":this.notifyLayout(e);this.onChildRemoved(e);break;default:this.notifyLayout(e);break}}notifyLayout(e){if(this._layout){this._layout.processParentMessage(e)}}onCloseRequest(e){if(this.parent){this.parent=null}else if(this.isAttached){E.detach(this)}}onResize(e){}onUpdateRequest(e){}onFitRequest(e){}onActivateRequest(e){}onBeforeShow(e){}onAfterShow(e){}onBeforeHide(e){}onAfterHide(e){}onBeforeAttach(e){}onAfterAttach(e){}onBeforeDetach(e){}onAfterDetach(e){}onChildAdded(e){}onChildRemoved(e){}_toggleHidden(e){if(e){switch(this._hiddenMode){case E.HiddenMode.Display:this.addClass("lm-mod-hidden");break;case E.HiddenMode.Scale:this.node.style.transform="scale(0)";this.node.setAttribute("aria-hidden","true");break;case E.HiddenMode.ContentVisibility:this.node.style.contentVisibility="hidden";this.node.style.zIndex="-1";break}}else{switch(this._hiddenMode){case E.HiddenMode.Display:this.removeClass("lm-mod-hidden");break;case E.HiddenMode.Scale:this.node.style.transform="";this.node.removeAttribute("aria-hidden");break;case E.HiddenMode.ContentVisibility:this.node.style.contentVisibility="";this.node.style.zIndex="";break}}}}(function(e){(function(e){e[e["Display"]=0]="Display";e[e["Scale"]=1]="Scale";e[e["ContentVisibility"]=2]="ContentVisibility"})(e.HiddenMode||(e.HiddenMode={}));(function(e){e[e["IsDisposed"]=1]="IsDisposed";e[e["IsAttached"]=2]="IsAttached";e[e["IsHidden"]=4]="IsHidden";e[e["IsVisible"]=8]="IsVisible";e[e["DisallowLayout"]=16]="DisallowLayout"})(e.Flag||(e.Flag={}));(function(e){e.BeforeShow=new d.Message("before-show");e.AfterShow=new d.Message("after-show");e.BeforeHide=new d.Message("before-hide");e.AfterHide=new d.Message("after-hide");e.BeforeAttach=new d.Message("before-attach");e.AfterAttach=new d.Message("after-attach");e.BeforeDetach=new d.Message("before-detach");e.AfterDetach=new d.Message("after-detach");e.ParentChanged=new d.Message("parent-changed");e.UpdateRequest=new d.ConflatableMessage("update-request");e.FitRequest=new d.ConflatableMessage("fit-request");e.ActivateRequest=new d.ConflatableMessage("activate-request");e.CloseRequest=new d.ConflatableMessage("close-request")})(e.Msg||(e.Msg={}));class t extends d.Message{constructor(e,t){super(e);this.child=t}}e.ChildMessage=t;class n extends d.Message{constructor(e,t){super("resize");this.width=e;this.height=t}}e.ResizeMessage=n;(function(e){e.UnknownSize=new e(-1,-1)})(n=e.ResizeMessage||(e.ResizeMessage={}));function i(t,n,i=null){if(t.parent){throw new Error("Cannot attach a child widget.")}if(t.isAttached||t.node.isConnected){throw new Error("Widget is already attached.")}if(!n.isConnected){throw new Error("Host is not attached.")}d.MessageLoop.sendMessage(t,e.Msg.BeforeAttach);n.insertBefore(t.node,i);d.MessageLoop.sendMessage(t,e.Msg.AfterAttach)}e.attach=i;function s(t){if(t.parent){throw new Error("Cannot detach a child widget.")}if(!t.isAttached||!t.node.isConnected){throw new Error("Widget is not attached.")}d.MessageLoop.sendMessage(t,e.Msg.BeforeDetach);t.node.parentNode.removeChild(t.node);d.MessageLoop.sendMessage(t,e.Msg.AfterDetach)}e.detach=s})(E||(E={}));var T;(function(e){e.titleProperty=new h.AttachedProperty({name:"title",create:e=>new I({owner:e})});function t(e){return e.node||document.createElement(e.tag||"div")}e.createNode=t})(T||(T={}));class M{constructor(e={}){this._disposed=false;this._parent=null;this._fitPolicy=e.fitPolicy||"set-min-size"}dispose(){this._parent=null;this._disposed=true;p.Signal.clearData(this);h.AttachedProperty.clearData(this)}get isDisposed(){return this._disposed}get parent(){return this._parent}set parent(e){if(this._parent===e){return}if(this._parent){throw new Error("Cannot change parent widget.")}if(e.layout!==this){throw new Error("Invalid parent widget.")}this._parent=e;this.init()}get fitPolicy(){return this._fitPolicy}set fitPolicy(e){if(this._fitPolicy===e){return}this._fitPolicy=e;if(this._parent){let e=this._parent.node.style;e.minWidth="";e.minHeight="";e.maxWidth="";e.maxHeight="";this._parent.fit()}}processParentMessage(e){switch(e.type){case"resize":this.onResize(e);break;case"update-request":this.onUpdateRequest(e);break;case"fit-request":this.onFitRequest(e);break;case"before-show":this.onBeforeShow(e);break;case"after-show":this.onAfterShow(e);break;case"before-hide":this.onBeforeHide(e);break;case"after-hide":this.onAfterHide(e);break;case"before-attach":this.onBeforeAttach(e);break;case"after-attach":this.onAfterAttach(e);break;case"before-detach":this.onBeforeDetach(e);break;case"after-detach":this.onAfterDetach(e);break;case"child-removed":this.onChildRemoved(e);break;case"child-shown":this.onChildShown(e);break;case"child-hidden":this.onChildHidden(e);break}}init(){for(const e of this){e.parent=this.parent}}onResize(e){for(const t of this){d.MessageLoop.sendMessage(t,E.ResizeMessage.UnknownSize)}}onUpdateRequest(e){for(const t of this){d.MessageLoop.sendMessage(t,E.ResizeMessage.UnknownSize)}}onBeforeAttach(e){for(const t of this){d.MessageLoop.sendMessage(t,e)}}onAfterAttach(e){for(const t of this){d.MessageLoop.sendMessage(t,e)}}onBeforeDetach(e){for(const t of this){d.MessageLoop.sendMessage(t,e)}}onAfterDetach(e){for(const t of this){d.MessageLoop.sendMessage(t,e)}}onBeforeShow(e){for(const t of this){if(!t.isHidden){d.MessageLoop.sendMessage(t,e)}}}onAfterShow(e){for(const t of this){if(!t.isHidden){d.MessageLoop.sendMessage(t,e)}}}onBeforeHide(e){for(const t of this){if(!t.isHidden){d.MessageLoop.sendMessage(t,e)}}}onAfterHide(e){for(const t of this){if(!t.isHidden){d.MessageLoop.sendMessage(t,e)}}}onChildRemoved(e){this.removeWidget(e.child)}onFitRequest(e){}onChildShown(e){}onChildHidden(e){}}(function(e){function t(e){return A.horizontalAlignmentProperty.get(e)}e.getHorizontalAlignment=t;function n(e,t){A.horizontalAlignmentProperty.set(e,t)}e.setHorizontalAlignment=n;function i(e){return A.verticalAlignmentProperty.get(e)}e.getVerticalAlignment=i;function s(e,t){A.verticalAlignmentProperty.set(e,t)}e.setVerticalAlignment=s})(M||(M={}));class D{constructor(e){this._top=NaN;this._left=NaN;this._width=NaN;this._height=NaN;this._minWidth=0;this._minHeight=0;this._maxWidth=Infinity;this._maxHeight=Infinity;this._disposed=false;this.widget=e;this.widget.node.style.position="absolute";this.widget.node.style.contain="strict"}dispose(){if(this._disposed){return}this._disposed=true;let e=this.widget.node.style;e.position="";e.top="";e.left="";e.width="";e.height="";e.contain=""}get minWidth(){return this._minWidth}get minHeight(){return this._minHeight}get maxWidth(){return this._maxWidth}get maxHeight(){return this._maxHeight}get isDisposed(){return this._disposed}get isHidden(){return this.widget.isHidden}get isVisible(){return this.widget.isVisible}get isAttached(){return this.widget.isAttached}fit(){let e=a.ElementExt.sizeLimits(this.widget.node);this._minWidth=e.minWidth;this._minHeight=e.minHeight;this._maxWidth=e.maxWidth;this._maxHeight=e.maxHeight}update(e,t,n,i){let s=Math.max(this._minWidth,Math.min(n,this._maxWidth));let o=Math.max(this._minHeight,Math.min(i,this._maxHeight));if(s"center",changed:t});e.verticalAlignmentProperty=new h.AttachedProperty({name:"verticalAlignment",create:()=>"top",changed:t});function t(e){if(e.parent&&e.parent.layout){e.parent.update()}}})(A||(A={}));class P extends M{constructor(){super(...arguments);this._widgets=[]}dispose(){while(this._widgets.length>0){this._widgets.pop().dispose()}super.dispose()}get widgets(){return this._widgets}*[Symbol.iterator](){yield*this._widgets}addWidget(e){this.insertWidget(this._widgets.length,e)}insertWidget(e,t){t.parent=this.parent;let n=this._widgets.indexOf(t);let s=Math.max(0,Math.min(e,this._widgets.length));if(n===-1){i.ArrayExt.insert(this._widgets,s,t);if(this.parent){this.attachWidget(s,t)}return}if(s===this._widgets.length){s--}if(n===s){return}i.ArrayExt.move(this._widgets,n,s);if(this.parent){this.moveWidget(n,s,t)}}removeWidget(e){this.removeWidgetAt(this._widgets.indexOf(e))}removeWidgetAt(e){let t=i.ArrayExt.removeAt(this._widgets,e);if(t&&this.parent){this.detachWidget(e,t)}}init(){super.init();let e=0;for(const t of this){this.attachWidget(e++,t)}}attachWidget(e,t){let n=this.parent.node.children[e];if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeAttach)}this.parent.node.insertBefore(t.node,n);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterAttach)}}moveWidget(e,t,n){if(this.parent.isAttached){d.MessageLoop.sendMessage(n,E.Msg.BeforeDetach)}this.parent.node.removeChild(n.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(n,E.Msg.AfterDetach)}let i=this.parent.node.children[t];if(this.parent.isAttached){d.MessageLoop.sendMessage(n,E.Msg.BeforeAttach)}this.parent.node.insertBefore(n.node,i);if(this.parent.isAttached){d.MessageLoop.sendMessage(n,E.Msg.AfterAttach)}}detachWidget(e,t){if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeDetach)}this.parent.node.removeChild(t.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterDetach)}}}var L;(function(e){function t(e){return Math.max(0,Math.floor(e))}e.clampDimension=t})(L||(L={}));var R=L;class N extends P{constructor(e){super();this.widgetOffset=0;this._fixed=0;this._spacing=4;this._dirty=false;this._hasNormedSizes=false;this._sizers=[];this._items=[];this._handles=[];this._box=null;this._alignment="start";this._orientation="horizontal";this.renderer=e.renderer;if(e.orientation!==undefined){this._orientation=e.orientation}if(e.alignment!==undefined){this._alignment=e.alignment}if(e.spacing!==undefined){this._spacing=L.clampDimension(e.spacing)}}dispose(){for(const e of this._items){e.dispose()}this._box=null;this._items.length=0;this._sizers.length=0;this._handles.length=0;super.dispose()}get orientation(){return this._orientation}set orientation(e){if(this._orientation===e){return}this._orientation=e;if(!this.parent){return}this.parent.dataset["orientation"]=e;this.parent.fit()}get alignment(){return this._alignment}set alignment(e){if(this._alignment===e){return}this._alignment=e;if(!this.parent){return}this.parent.dataset["alignment"]=e;this.parent.update()}get spacing(){return this._spacing}set spacing(e){e=L.clampDimension(e);if(this._spacing===e){return}this._spacing=e;if(!this.parent){return}this.parent.fit()}get handles(){return this._handles}absoluteSizes(){return this._sizers.map((e=>e.size))}relativeSizes(){return O.normalize(this._sizers.map((e=>e.size)))}setRelativeSizes(e,t=true){let n=this._sizers.length;let i=e.slice(0,n);while(i.length0){s.sizeHint=s.size}}j.adjust(this._sizers,e,i);if(this.parent){this.parent.update()}}init(){this.parent.dataset["orientation"]=this.orientation;this.parent.dataset["alignment"]=this.alignment;super.init()}attachWidget(e,t){let n=new D(t);let s=O.createHandle(this.renderer);let o=O.averageSize(this._sizers);let r=O.createSizer(o);i.ArrayExt.insert(this._items,e,n);i.ArrayExt.insert(this._sizers,e,r);i.ArrayExt.insert(this._handles,e,s);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeAttach)}this.parent.node.appendChild(t.node);this.parent.node.appendChild(s);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterAttach)}this.parent.fit()}moveWidget(e,t,n){i.ArrayExt.move(this._items,e,t);i.ArrayExt.move(this._sizers,e,t);i.ArrayExt.move(this._handles,e,t);this.parent.fit()}detachWidget(e,t){let n=i.ArrayExt.removeAt(this._items,e);let s=i.ArrayExt.removeAt(this._handles,e);i.ArrayExt.removeAt(this._sizers,e);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeDetach)}this.parent.node.removeChild(t.node);this.parent.node.removeChild(s);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterDetach)}n.dispose();this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e);this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e);this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){if(this.parent.isVisible){this._update(e.width,e.height)}}onUpdateRequest(e){if(this.parent.isVisible){this._update(-1,-1)}}onFitRequest(e){if(this.parent.isAttached){this._fit()}}updateItemPosition(e,t,n,i,s,o,r){const a=this._items[e];if(a.isHidden){return}let l=this._handles[e].style;if(t){n+=this.widgetOffset;a.update(n,i,r,s);n+=r;l.top=`${i}px`;l.left=`${n}px`;l.width=`${this._spacing}px`;l.height=`${s}px`}else{i+=this.widgetOffset;a.update(n,i,o,r);i+=r;l.top=`${i}px`;l.left=`${n}px`;l.width=`${o}px`;l.height=`${this._spacing}px`}}_fit(){let e=0;let t=-1;for(let a=0,l=this._items.length;a0){t.sizeHint=t.size}if(e.isHidden){t.minSize=0;t.maxSize=0;continue}e.fit();t.stretch=N.getStretch(e.widget);if(n){t.minSize=e.minWidth;t.maxSize=e.maxWidth;i+=e.minWidth;s=Math.max(s,e.minHeight)}else{t.minSize=e.minHeight;t.maxSize=e.maxHeight;s+=e.minHeight;i=Math.max(i,e.minWidth)}}let o=this._box=a.ElementExt.boxSizing(this.parent.node);i+=o.horizontalSum;s+=o.verticalSum;let r=this.parent.node.style;r.minWidth=`${i}px`;r.minHeight=`${s}px`;this._dirty=true;if(this.parent.parent){d.MessageLoop.sendMessage(this.parent.parent,E.Msg.FitRequest)}if(this._dirty){d.MessageLoop.sendMessage(this.parent,E.Msg.UpdateRequest)}}_update(e,t){this._dirty=false;let n=0;for(let a=0,h=this._items.length;a0){let e;if(c){e=Math.max(0,o-this._fixed)}else{e=Math.max(0,r-this._fixed)}if(this._hasNormedSizes){for(let t of this._sizers){t.sizeHint*=e}this._hasNormedSizes=false}let t=j.calc(this._sizers,e);if(t>0){switch(this._alignment){case"start":break;case"center":l=0;d=t/2;break;case"end":l=0;d=t;break;case"justify":l=t/n;d=0;break;default:throw"unreachable"}}}for(let a=0,h=this._items.length;a0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:o});function t(e){let t=new k;t.sizeHint=Math.floor(e);return t}e.createSizer=t;function n(e){let t=e.createHandle();t.style.position="absolute";t.style.contain="style";return t}e.createHandle=n;function i(e){return e.reduce(((e,t)=>e+t.size),0)/e.length||0}e.averageSize=i;function s(e){let t=e.length;if(t===0){return[]}let n=e.reduce(((e,t)=>e+Math.abs(t)),0);return n===0?e.map((e=>1/t)):e.map((e=>e/n))}e.normalize=s;function o(e){if(e.parent&&e.parent.layout instanceof N){e.parent.fit()}}})(O||(O={}));class B extends N{constructor(e){super({...e,orientation:e.orientation||"vertical"});this._titles=[];this.titleSpace=e.titleSpace||22}get titleSpace(){return this.widgetOffset}set titleSpace(e){e=R.clampDimension(e);if(this.widgetOffset===e){return}this.widgetOffset=e;if(!this.parent){return}this.parent.fit()}get titles(){return this._titles}dispose(){if(this.isDisposed){return}this._titles.length=0;super.dispose()}updateTitle(e,t){const n=this._titles[e];const i=n.classList.contains("lm-mod-expanded");const s=F.createTitle(this.renderer,t.title,i);this._titles[e]=s;this.parent.node.replaceChild(s,n)}insertWidget(e,t){if(!t.id){t.id=`id-${o.UUID.uuid4()}`}super.insertWidget(e,t)}attachWidget(e,t){const n=F.createTitle(this.renderer,t.title);i.ArrayExt.insert(this._titles,e,n);this.parent.node.appendChild(n);t.node.setAttribute("role","region");t.node.setAttribute("aria-labelledby",n.id);super.attachWidget(e,t)}moveWidget(e,t,n){i.ArrayExt.move(this._titles,e,t);super.moveWidget(e,t,n)}detachWidget(e,t){const n=i.ArrayExt.removeAt(this._titles,e);this.parent.node.removeChild(n);super.detachWidget(e,t)}updateItemPosition(e,t,n,i,s,o,r){const a=this._titles[e].style;a.top=`${i}px`;a.left=`${n}px`;a.height=`${this.widgetOffset}px`;if(t){a.width=`${s}px`}else{a.width=`${o}px`}super.updateItemPosition(e,t,n,i,s,o,r)}}var F;(function(e){function t(e,t,n=true){const i=e.createSectionTitle(t);i.style.position="absolute";i.style.contain="strict";i.setAttribute("aria-label",`${t.label} Section`);i.setAttribute("aria-expanded",n?"true":"false");i.setAttribute("aria-controls",t.owner.id);if(n){i.classList.add("lm-mod-expanded")}return i}e.createTitle=t})(F||(F={}));class z extends E{constructor(e={}){super();this.addClass("lm-Panel");this.layout=H.createLayout(e)}get widgets(){return this.layout.widgets}addWidget(e){this.layout.addWidget(e)}insertWidget(e,t){this.layout.insertWidget(e,t)}}var H;(function(e){function t(e){return e.layout||new P}e.createLayout=t})(H||(H={}));class W extends z{constructor(e={}){super({layout:V.createLayout(e)});this._handleMoved=new p.Signal(this);this._pressData=null;this.addClass("lm-SplitPanel")}dispose(){this._releaseMouse();super.dispose()}get orientation(){return this.layout.orientation}set orientation(e){this.layout.orientation=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get renderer(){return this.layout.renderer}get handleMoved(){return this._handleMoved}get handles(){return this.layout.handles}relativeSizes(){return this.layout.relativeSizes()}setRelativeSizes(e,t=true){this.layout.setRelativeSizes(e,t)}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault();e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this);this._releaseMouse()}onChildAdded(e){e.child.addClass("lm-SplitPanel-child");this._releaseMouse()}onChildRemoved(e){e.child.removeClass("lm-SplitPanel-child");this._releaseMouse()}_evtKeyDown(e){if(this._pressData){e.preventDefault();e.stopPropagation()}if(e.keyCode===27){this._releaseMouse()}}_evtPointerDown(e){if(e.button!==0){return}let t=this.layout;let n=i.ArrayExt.findFirstIndex(t.handles,(t=>t.contains(e.target)));if(n===-1){return}e.preventDefault();e.stopPropagation();document.addEventListener("pointerup",this,true);document.addEventListener("pointermove",this,true);document.addEventListener("keydown",this,true);document.addEventListener("contextmenu",this,true);let s;let o=t.handles[n];let r=o.getBoundingClientRect();if(t.orientation==="horizontal"){s=e.clientX-r.left}else{s=e.clientY-r.top}let a=window.getComputedStyle(o);let l=g.Drag.overrideCursor(a.cursor);this._pressData={index:n,delta:s,override:l}}_evtPointerMove(e){e.preventDefault();e.stopPropagation();let t;let n=this.layout;let i=this.node.getBoundingClientRect();if(n.orientation==="horizontal"){t=e.clientX-i.left-this._pressData.delta}else{t=e.clientY-i.top-this._pressData.delta}n.moveHandle(this._pressData.index,t)}_evtPointerUp(e){if(e.button!==0){return}e.preventDefault();e.stopPropagation();this._releaseMouse()}_releaseMouse(){if(!this._pressData){return}this._pressData.override.dispose();this._pressData=null;this._handleMoved.emit();document.removeEventListener("keydown",this,true);document.removeEventListener("pointerup",this,true);document.removeEventListener("pointermove",this,true);document.removeEventListener("contextmenu",this,true)}}(function(e){class t{createHandle(){let e=document.createElement("div");e.className="lm-SplitPanel-handle";return e}}e.Renderer=t;e.defaultRenderer=new t;function n(e){return N.getStretch(e)}e.getStretch=n;function i(e,t){N.setStretch(e,t)}e.setStretch=i})(W||(W={}));var V;(function(e){function t(e){return e.layout||new N({renderer:e.renderer||W.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing})}e.createLayout=t})(V||(V={}));class U extends W{constructor(e={}){super({...e,layout:q.createLayout(e)});this._widgetSizesCache=new WeakMap;this._expansionToggled=new p.Signal(this);this.addClass("lm-AccordionPanel")}get renderer(){return this.layout.renderer}get titleSpace(){return this.layout.titleSpace}set titleSpace(e){this.layout.titleSpace=e}get titles(){return this.layout.titles}get expansionToggled(){return this._expansionToggled}addWidget(e){super.addWidget(e);e.title.changed.connect(this._onTitleChanged,this)}collapse(e){const t=this.layout.widgets[e];if(t&&!t.isHidden){this._toggleExpansion(e)}}expand(e){const t=this.layout.widgets[e];if(t&&t.isHidden){this._toggleExpansion(e)}}insertWidget(e,t){super.insertWidget(e,t);t.title.changed.connect(this._onTitleChanged,this)}handleEvent(e){super.handleEvent(e);switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._eventKeyDown(e);break}}onBeforeAttach(e){this.node.addEventListener("click",this);this.node.addEventListener("keydown",this);super.onBeforeAttach(e)}onAfterDetach(e){super.onAfterDetach(e);this.node.removeEventListener("click",this);this.node.removeEventListener("keydown",this)}_onTitleChanged(e){const t=i.ArrayExt.findFirstIndex(this.widgets,(t=>t.contains(e.owner)));if(t>=0){this.layout.updateTitle(t,e.owner);this.update()}}_computeWidgetSize(e){const t=this.layout;const n=t.widgets[e];if(!n){return undefined}const i=n.isHidden;const s=t.absoluteSizes();const o=(i?-1:1)*this.spacing;const r=s.reduce(((e,t)=>e+t));let a=[...s];if(!i){const t=s[e];this._widgetSizesCache.set(n,t);a[e]=0;const i=a.map((e=>e>0)).lastIndexOf(true);if(i===-1){return undefined}a[i]=s[i]+t+o}else{const t=this._widgetSizesCache.get(n);if(!t){return undefined}a[e]+=t;const i=a.map((e=>e-t>0)).lastIndexOf(true);if(i===-1){a.forEach(((n,i)=>{if(i!==e){a[i]-=s[i]/r*(t-o)}}))}else{a[i]-=t-o}}return a.map((e=>e/(r+o)))}_evtClick(e){const t=e.target;if(t){const n=i.ArrayExt.findFirstIndex(this.titles,(e=>e.contains(t)));if(n>=0){e.preventDefault();e.stopPropagation();this._toggleExpansion(n)}}}_eventKeyDown(e){if(e.defaultPrevented){return}const t=e.target;let n=false;if(t){const s=i.ArrayExt.findFirstIndex(this.titles,(e=>e.contains(t)));if(s>=0){const i=e.keyCode.toString();if(e.key.match(/Space|Enter/)||i.match(/13|32/)){t.click();n=true}else if(this.orientation==="horizontal"?e.key.match(/ArrowLeft|ArrowRight/)||i.match(/37|39/):e.key.match(/ArrowUp|ArrowDown/)||i.match(/38|40/)){const t=e.key.match(/ArrowLeft|ArrowUp/)||i.match(/37|38/)?-1:1;const o=this.titles.length;const r=(s+o+t)%o;this.titles[r].focus();n=true}else if(e.key==="End"||i==="35"){this.titles[this.titles.length-1].focus();n=true}else if(e.key==="Home"||i==="36"){this.titles[0].focus();n=true}}if(n){e.preventDefault()}}}_toggleExpansion(e){const t=this.titles[e];const n=this.layout.widgets[e];const i=this._computeWidgetSize(e);if(i){this.setRelativeSizes(i,false)}if(n.isHidden){t.classList.add("lm-mod-expanded");t.setAttribute("aria-expanded","true");n.show()}else{t.classList.remove("lm-mod-expanded");t.setAttribute("aria-expanded","false");n.hide()}this._expansionToggled.emit(e)}}(function(e){class t extends W.Renderer{constructor(){super();this.titleClassName="lm-AccordionPanel-title";this._titleID=0;this._titleKeys=new WeakMap;this._uuid=++t._nInstance}createCollapseIcon(e){return document.createElement("span")}createSectionTitle(e){const t=document.createElement("h3");t.setAttribute("tabindex","0");t.id=this.createTitleKey(e);t.className=this.titleClassName;for(const s in e.dataset){t.dataset[s]=e.dataset[s]}const n=t.appendChild(this.createCollapseIcon(e));n.className="lm-AccordionPanel-titleCollapser";const i=t.appendChild(document.createElement("span"));i.className="lm-AccordionPanel-titleLabel";i.textContent=e.label;i.title=e.caption||e.label;return t}createTitleKey(e){let t=this._titleKeys.get(e);if(t===undefined){t=`title-key-${this._uuid}-${this._titleID++}`;this._titleKeys.set(e,t)}return t}}t._nInstance=0;e.Renderer=t;e.defaultRenderer=new t})(U||(U={}));var q;(function(e){function t(e){return e.layout||new B({renderer:e.renderer||U.defaultRenderer,orientation:e.orientation,alignment:e.alignment,spacing:e.spacing,titleSpace:e.titleSpace})}e.createLayout=t})(q||(q={}));class $ extends P{constructor(e={}){super();this._fixed=0;this._spacing=4;this._dirty=false;this._sizers=[];this._items=[];this._box=null;this._alignment="start";this._direction="top-to-bottom";if(e.direction!==undefined){this._direction=e.direction}if(e.alignment!==undefined){this._alignment=e.alignment}if(e.spacing!==undefined){this._spacing=R.clampDimension(e.spacing)}}dispose(){for(const e of this._items){e.dispose()}this._box=null;this._items.length=0;this._sizers.length=0;super.dispose()}get direction(){return this._direction}set direction(e){if(this._direction===e){return}this._direction=e;if(!this.parent){return}this.parent.dataset["direction"]=e;this.parent.fit()}get alignment(){return this._alignment}set alignment(e){if(this._alignment===e){return}this._alignment=e;if(!this.parent){return}this.parent.dataset["alignment"]=e;this.parent.update()}get spacing(){return this._spacing}set spacing(e){e=R.clampDimension(e);if(this._spacing===e){return}this._spacing=e;if(!this.parent){return}this.parent.fit()}init(){this.parent.dataset["direction"]=this.direction;this.parent.dataset["alignment"]=this.alignment;super.init()}attachWidget(e,t){i.ArrayExt.insert(this._items,e,new D(t));i.ArrayExt.insert(this._sizers,e,new k);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeAttach)}this.parent.node.appendChild(t.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterAttach)}this.parent.fit()}moveWidget(e,t,n){i.ArrayExt.move(this._items,e,t);i.ArrayExt.move(this._sizers,e,t);this.parent.update()}detachWidget(e,t){let n=i.ArrayExt.removeAt(this._items,e);i.ArrayExt.removeAt(this._sizers,e);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeDetach)}this.parent.node.removeChild(t.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterDetach)}n.dispose();this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e);this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e);this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){if(this.parent.isVisible){this._update(e.width,e.height)}}onUpdateRequest(e){if(this.parent.isVisible){this._update(-1,-1)}}onFitRequest(e){if(this.parent.isAttached){this._fit()}}_fit(){let e=0;for(let r=0,a=this._items.length;r0){switch(this._alignment){case"start":break;case"center":d=0;c=l/2;break;case"end":d=0;c=l;break;case"justify":d=l/n;c=0;break;default:throw"unreachable"}}for(let a=0,h=this._items.length;a0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:i});e.sizeBasisProperty=new h.AttachedProperty({name:"sizeBasis",create:()=>0,coerce:(e,t)=>Math.max(0,Math.floor(t)),changed:i});function t(e){return e==="left-to-right"||e==="right-to-left"}e.isHorizontal=t;function n(e){return Math.max(0,Math.floor(e))}e.clampSpacing=n;function i(e){if(e.parent&&e.parent.layout instanceof $){e.parent.fit()}}})(K||(K={}));class J extends z{constructor(e={}){super({layout:G.createLayout(e)});this.addClass("lm-BoxPanel")}get direction(){return this.layout.direction}set direction(e){this.layout.direction=e}get alignment(){return this.layout.alignment}set alignment(e){this.layout.alignment=e}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}onChildAdded(e){e.child.addClass("lm-BoxPanel-child")}onChildRemoved(e){e.child.removeClass("lm-BoxPanel-child")}}(function(e){function t(e){return $.getStretch(e)}e.getStretch=t;function n(e,t){$.setStretch(e,t)}e.setStretch=n;function i(e){return $.getSizeBasis(e)}e.getSizeBasis=i;function s(e,t){$.setSizeBasis(e,t)}e.setSizeBasis=s})(J||(J={}));var G;(function(e){function t(e){return e.layout||new $(e)}e.createLayout=t})(G||(G={}));class Y extends E{constructor(e){super({node:X.createNode()});this._activeIndex=-1;this._items=[];this._results=null;this.addClass("lm-CommandPalette");this.setFlag(E.Flag.DisallowLayout);this.commands=e.commands;this.renderer=e.renderer||Y.defaultRenderer;this.commands.commandChanged.connect(this._onGenericChange,this);this.commands.keyBindingChanged.connect(this._onGenericChange,this)}dispose(){this._items.length=0;this._results=null;super.dispose()}get searchNode(){return this.node.getElementsByClassName("lm-CommandPalette-search")[0]}get inputNode(){return this.node.getElementsByClassName("lm-CommandPalette-input")[0]}get contentNode(){return this.node.getElementsByClassName("lm-CommandPalette-content")[0]}get items(){return this._items}addItem(e){let t=X.createItem(this.commands,e);this._items.push(t);this.refresh();return t}addItems(e){const t=e.map((e=>X.createItem(this.commands,e)));t.forEach((e=>this._items.push(e)));this.refresh();return t}removeItem(e){this.removeItemAt(this._items.indexOf(e))}removeItemAt(e){let t=i.ArrayExt.removeAt(this._items,e);if(!t){return}this.refresh()}clearItems(){if(this._items.length===0){return}this._items.length=0;this.refresh()}refresh(){this._results=null;if(this.inputNode.value!==""){let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="inherit"}else{let e=this.node.getElementsByClassName("lm-close-icon")[0];e.style.display="none"}this.update()}handleEvent(e){switch(e.type){case"click":this._evtClick(e);break;case"keydown":this._evtKeyDown(e);break;case"input":this.refresh();break;case"focus":case"blur":this._toggleFocused();break}}onBeforeAttach(e){this.node.addEventListener("click",this);this.node.addEventListener("keydown",this);this.node.addEventListener("input",this);this.node.addEventListener("focus",this,true);this.node.addEventListener("blur",this,true)}onAfterDetach(e){this.node.removeEventListener("click",this);this.node.removeEventListener("keydown",this);this.node.removeEventListener("input",this);this.node.removeEventListener("focus",this,true);this.node.removeEventListener("blur",this,true)}onAfterShow(e){this.update();super.onAfterShow(e)}onActivateRequest(e){if(this.isAttached){let e=this.inputNode;e.focus();e.select()}}onUpdateRequest(e){if(!this.isVisible){b.VirtualDOM.render(null,this.contentNode);return}let t=this.inputNode.value;let n=this.contentNode;let s=this._results;if(!s){s=this._results=X.search(this._items,t);this._activeIndex=t?i.ArrayExt.findFirstIndex(s,X.canActivate):-1}if(!t&&s.length===0){b.VirtualDOM.render(null,n);return}if(t&&s.length===0){let e=this.renderer.renderEmptyMessage({query:t});b.VirtualDOM.render(e,n);return}let o=this.renderer;let r=this._activeIndex;let l=new Array(s.length);for(let i=0,a=s.length;i=s.length){n.scrollTop=0}else{let e=n.children[r];a.ElementExt.scrollIntoViewIfNeeded(n,e)}}_evtClick(e){if(e.button!==0){return}if(e.target.classList.contains("lm-close-icon")){this.inputNode.value="";this.refresh();return}let t=i.ArrayExt.findFirstIndex(this.contentNode.children,(t=>t.contains(e.target)));if(t===-1){return}e.preventDefault();e.stopPropagation();this._execute(t)}_evtKeyDown(e){if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey){return}switch(e.keyCode){case 13:e.preventDefault();e.stopPropagation();this._execute(this._activeIndex);break;case 38:e.preventDefault();e.stopPropagation();this._activatePreviousItem();break;case 40:e.preventDefault();e.stopPropagation();this._activateNextItem();break}}_activateNextItem(){if(!this._results||this._results.length===0){return}let e=this._activeIndex;let t=this._results.length;let n=ee-t));let h=a.slice(0,c);let u=a.slice(c);for(let i=0,p=u.length;in.command===e&&o.JSONExt.deepEqual(n.args,t)))||null}}})(X||(X={}));class Q extends E{constructor(e){super({node:Z.createNode()});this._childIndex=-1;this._activeIndex=-1;this._openTimerID=0;this._closeTimerID=0;this._items=[];this._childMenu=null;this._parentMenu=null;this._aboutToClose=new p.Signal(this);this._menuRequested=new p.Signal(this);this.addClass("lm-Menu");this.setFlag(E.Flag.DisallowLayout);this.commands=e.commands;this.renderer=e.renderer||Q.defaultRenderer}dispose(){this.close();this._items.length=0;super.dispose()}get aboutToClose(){return this._aboutToClose}get menuRequested(){return this._menuRequested}get parentMenu(){return this._parentMenu}get childMenu(){return this._childMenu}get rootMenu(){let e=this;while(e._parentMenu){e=e._parentMenu}return e}get leafMenu(){let e=this;while(e._childMenu){e=e._childMenu}return e}get contentNode(){return this.node.getElementsByClassName("lm-Menu-content")[0]}get activeItem(){return this._items[this._activeIndex]||null}set activeItem(e){this.activeIndex=e?this._items.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){if(e<0||e>=this._items.length){e=-1}if(e!==-1&&!Z.canActivate(this._items[e])){e=-1}if(this._activeIndex===e){return}this._activeIndex=e;if(this._activeIndex>=0&&this.contentNode.childNodes[this._activeIndex]){this.contentNode.childNodes[this._activeIndex].focus()}this.update()}get items(){return this._items}activateNextItem(){let e=this._items.length;let t=this._activeIndex;let n=t{this.activeIndex=r}})}b.VirtualDOM.render(o,this.contentNode)}onCloseRequest(e){this._cancelOpenTimer();this._cancelCloseTimer();this.activeIndex=-1;let t=this._childMenu;if(t){this._childIndex=-1;this._childMenu=null;t._parentMenu=null;t.close()}let n=this._parentMenu;if(n){this._parentMenu=null;n._childIndex=-1;n._childMenu=null;n.activate()}if(this.isAttached){this._aboutToClose.emit(undefined)}super.onCloseRequest(e)}_evtKeyDown(e){e.preventDefault();e.stopPropagation();let t=e.keyCode;if(t===13){this.triggerActiveItem();return}if(t===27){this.close();return}if(t===37){if(this._parentMenu){this.close()}else{this._menuRequested.emit("previous")}return}if(t===38){this.activatePreviousItem();return}if(t===39){let e=this.activeItem;if(e&&e.type==="submenu"){this.triggerActiveItem()}else{this.rootMenu._menuRequested.emit("next")}return}if(t===40){this.activateNextItem();return}let n=(0,x.getKeyboardLayout)().keyForKeydownEvent(e);if(!n){return}let i=this._activeIndex+1;let s=Z.findMnemonic(this._items,n,i);if(s.index!==-1&&!s.multiple){this.activeIndex=s.index;this.triggerActiveItem()}else if(s.index!==-1){this.activeIndex=s.index}else if(s.auto!==-1){this.activeIndex=s.auto}}_evtMouseUp(e){if(e.button!==0){return}e.preventDefault();e.stopPropagation();this.triggerActiveItem()}_evtMouseMove(e){let t=i.ArrayExt.findFirstIndex(this.contentNode.children,(t=>a.ElementExt.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex){return}this.activeIndex=t;t=this.activeIndex;if(t===this._childIndex){this._cancelOpenTimer();this._cancelCloseTimer();return}if(this._childIndex!==-1){this._startCloseTimer()}this._cancelOpenTimer();let n=this.activeItem;if(!n||n.type!=="submenu"||!n.submenu){return}this._startOpenTimer()}_evtMouseEnter(e){for(let t=this._parentMenu;t;t=t._parentMenu){t._cancelOpenTimer();t._cancelCloseTimer();t.activeIndex=t._childIndex}}_evtMouseLeave(e){this._cancelOpenTimer();if(!this._childMenu){this.activeIndex=-1;return}let{clientX:t,clientY:n}=e;if(a.ElementExt.hitTest(this._childMenu.node,t,n)){this._cancelCloseTimer();return}this.activeIndex=-1;this._startCloseTimer()}_evtMouseDown(e){if(this._parentMenu){return}if(Z.hitTestMenus(this,e.clientX,e.clientY)){e.preventDefault();e.stopPropagation()}else{this.close()}}_openChildMenu(e=false){let t=this.activeItem;if(!t||t.type!=="submenu"||!t.submenu){this._closeChildMenu();return}let n=t.submenu;if(n===this._childMenu){return}Q.saveWindowData();this._closeChildMenu();this._childMenu=n;this._childIndex=this._activeIndex;n._parentMenu=this;d.MessageLoop.sendMessage(this,E.Msg.UpdateRequest);let i=this.contentNode.children[this._activeIndex];Z.openSubmenu(n,i);if(e){n.activeIndex=-1;n.activateNextItem()}n.activate()}_closeChildMenu(){if(this._childMenu){this._childMenu.close()}}_startOpenTimer(){if(this._openTimerID===0){this._openTimerID=window.setTimeout((()=>{this._openTimerID=0;this._openChildMenu()}),Z.TIMER_DELAY)}}_startCloseTimer(){if(this._closeTimerID===0){this._closeTimerID=window.setTimeout((()=>{this._closeTimerID=0;this._closeChildMenu()}),Z.TIMER_DELAY)}}_cancelOpenTimer(){if(this._openTimerID!==0){clearTimeout(this._openTimerID);this._openTimerID=0}}_cancelCloseTimer(){if(this._closeTimerID!==0){clearTimeout(this._closeTimerID);this._closeTimerID=0}}static saveWindowData(){Z.saveWindowData()}}(function(e){class t{renderItem(e){let t=this.createItemClass(e);let n=this.createItemDataset(e);let i=this.createItemARIA(e);return b.h.li({className:t,dataset:n,tabindex:"0",onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e),this.renderShortcut(e),this.renderSubmenu(e))}renderIcon(e){let t=this.createIconClass(e);return b.h.div({className:t},e.item.icon,e.item.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return b.h.div({className:"lm-Menu-itemLabel"},t)}renderShortcut(e){let t=this.formatShortcut(e);return b.h.div({className:"lm-Menu-itemShortcut"},t)}renderSubmenu(e){return b.h.div({className:"lm-Menu-itemSubmenuIcon"})}createItemClass(e){let t="lm-Menu-item";if(!e.item.isEnabled){t+=" lm-mod-disabled"}if(e.item.isToggled){t+=" lm-mod-toggled"}if(!e.item.isVisible){t+=" lm-mod-hidden"}if(e.active){t+=" lm-mod-active"}if(e.collapsed){t+=" lm-mod-collapsed"}let n=e.item.className;if(n){t+=` ${n}`}return t}createItemDataset(e){let t;let{type:n,command:i,dataset:s}=e.item;if(n==="command"){t={...s,type:n,command:i}}else{t={...s,type:n}}return t}createIconClass(e){let t="lm-Menu-itemIcon";let n=e.item.iconClass;return n?`${t} ${n}`:t}createItemARIA(e){let t={};switch(e.item.type){case"separator":t.role="presentation";break;case"submenu":t["aria-haspopup"]="true";if(!e.item.isEnabled){t["aria-disabled"]="true"}break;default:if(!e.item.isEnabled){t["aria-disabled"]="true"}if(e.item.isToggled){t.role="menuitemcheckbox";t["aria-checked"]="true"}else{t.role="menuitem"}}return t}formatLabel(e){let{label:t,mnemonic:n}=e.item;if(n<0||n>=t.length){return t}let i=t.slice(0,n);let s=t.slice(n+1);let o=t[n];let r=b.h.span({className:"lm-Menu-itemMnemonic"},o);return[i,r,s]}formatShortcut(e){let t=e.item.keyBinding;return t?v.CommandRegistry.formatKeystroke(t.keys):null}}e.Renderer=t;e.defaultRenderer=new t})(Q||(Q={}));var Z;(function(e){e.TIMER_DELAY=300;e.SUBMENU_OVERLAP=3;let t=null;let n=0;function s(){if(n>0){n--;return t}return m()}function r(){t=m();n++}e.saveWindowData=r;function l(){let e=document.createElement("div");let t=document.createElement("ul");t.className="lm-Menu-content";e.appendChild(t);t.setAttribute("role","menu");e.tabIndex=0;return e}e.createNode=l;function c(e){return e.type!=="separator"&&e.isEnabled&&e.isVisible}e.canActivate=c;function h(e,t){return new _(e.commands,t)}e.createItem=h;function u(e,t,n){for(let i=e;i;i=i.childMenu){if(a.ElementExt.hitTest(i.node,t,n)){return true}}return false}e.hitTestMenus=u;function p(e){let t=new Array(e.length);i.ArrayExt.fill(t,false);let n=0;let s=e.length;for(;n=0;--o){let n=e[o];if(!n.isVisible){continue}if(n.type!=="separator"){break}t[o]=true}let r=false;while(++nh+p){t=h+p-_}if(!o&&n+b>u+m){if(n>u+m){n=u+m-b}else{n=n-b}}v.transform=`translate(${Math.max(0,t)}px, ${Math.max(0,n)}px`;v.opacity="1"}e.openRootMenu=g;function f(t,n){const i=s();let o=i.pageXOffset;let r=i.pageYOffset;let l=i.clientWidth;let c=i.clientHeight;d.MessageLoop.sendMessage(t,E.Msg.UpdateRequest);let h=c;let u=t.node;let p=u.style;p.opacity="0";p.maxHeight=`${h}px`;E.attach(t,document.body);let{width:m,height:g}=u.getBoundingClientRect();let f=a.ElementExt.boxSizing(t.node);let v=n.getBoundingClientRect();let _=v.right-e.SUBMENU_OVERLAP;if(_+m>o+l){_=v.left+e.SUBMENU_OVERLAP-m}let b=v.top-f.borderTop-f.paddingTop;if(b+g>r+c){b=v.bottom+f.borderBottom+f.paddingBottom-g}p.transform=`translate(${Math.max(0,_)}px, ${Math.max(0,b)}px`;p.opacity="1"}e.openSubmenu=f;function v(e,t,n){let i=-1;let s=-1;let o=false;let r=t.toUpperCase();for(let a=0,l=e.length;a=0&&un.command===e&&o.JSONExt.deepEqual(n.args,t)))||null}return null}}})(Z||(Z={}));class ee{constructor(e){this._groupByTarget=true;this._idTick=0;this._items=[];this._sortBySelector=true;const{groupByTarget:t,sortBySelector:n,...i}=e;this.menu=new Q(i);this._groupByTarget=t!==false;this._sortBySelector=n!==false}addItem(e){let t=te.createItem(e,this._idTick++);this._items.push(t);return new w.DisposableDelegate((()=>{i.ArrayExt.removeFirstOf(this._items,t)}))}open(e){Q.saveWindowData();this.menu.clearItems();if(this._items.length===0){return false}let t=te.matchItems(this._items,e,this._groupByTarget,this._sortBySelector);if(!t||t.length===0){return false}for(const n of t){this.menu.addItem(n)}this.menu.open(e.clientX,e.clientY);return true}}var te;(function(e){function t(e,t){let n=i(e.selector);let s=e.rank!==undefined?e.rank:Infinity;return{...e,selector:n,rank:s,id:t}}e.createItem=t;function n(e,t,n,i){let r=t.target;if(!r){return null}let l=t.currentTarget;if(!l){return null}if(!l.contains(r)){r=document.elementFromPoint(t.clientX,t.clientY);if(!r||!l.contains(r)){return null}}let d=[];let c=e.slice();while(r!==null){let e=[];for(let t=0,n=c.length;t=this._titles.length){e=-1}if(this._currentIndex===e){return}let t=this._currentIndex;let n=this._titles[t]||null;let i=e;let s=this._titles[i]||null;this._currentIndex=i;this._previousTitle=n;this.update();this._currentChanged.emit({previousIndex:t,previousTitle:n,currentIndex:i,currentTitle:s})}get name(){return this._name}set name(e){this._name=e;if(e){this.contentNode.setAttribute("aria-label",e)}else{this.contentNode.removeAttribute("aria-label")}}get orientation(){return this._orientation}set orientation(e){if(this._orientation===e){return}this._releaseMouse();this._orientation=e;this.dataset["orientation"]=e;this.contentNode.setAttribute("aria-orientation",e)}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){if(this._addButtonEnabled===e){return}this._addButtonEnabled=e;if(e){this.addButtonNode.classList.remove("lm-mod-hidden")}else{this.addButtonNode.classList.add("lm-mod-hidden")}}get titles(){return this._titles}get contentNode(){return this.node.getElementsByClassName("lm-TabBar-content")[0]}get addButtonNode(){return this.node.getElementsByClassName("lm-TabBar-addButton")[0]}addTab(e){return this.insertTab(this._titles.length,e)}insertTab(e,t){this._releaseMouse();let n=se.asTitle(t);let s=this._titles.indexOf(n);let o=Math.max(0,Math.min(e,this._titles.length));if(s===-1){i.ArrayExt.insert(this._titles,o,n);n.changed.connect(this._onTitleChanged,this);this.update();this._adjustCurrentForInsert(o,n);return n}if(o===this._titles.length){o--}if(s===o){return n}i.ArrayExt.move(this._titles,s,o);this.update();this._adjustCurrentForMove(s,o);return n}removeTab(e){this.removeTabAt(this._titles.indexOf(e))}removeTabAt(e){this._releaseMouse();let t=i.ArrayExt.removeAt(this._titles,e);if(!t){return}t.changed.disconnect(this._onTitleChanged,this);if(t===this._previousTitle){this._previousTitle=null}this.update();this._adjustCurrentForRemove(e,t)}clearTabs(){if(this._titles.length===0){return}this._releaseMouse();for(let n of this._titles){n.changed.disconnect(this._onTitleChanged,this)}let e=this.currentIndex;let t=this.currentTitle;this._currentIndex=-1;this._previousTitle=null;this._titles.length=0;this.update();if(e===-1){return}this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}releaseMouse(){this._releaseMouse()}handleEvent(e){switch(e.type){case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"dblclick":this._evtDblClick(e);break;case"keydown":e.eventPhase===Event.CAPTURING_PHASE?this._evtKeyDownCapturing(e):this._evtKeyDown(e);break;case"contextmenu":e.preventDefault();e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("pointerdown",this);this.node.addEventListener("dblclick",this);this.node.addEventListener("keydown",this)}onAfterDetach(e){this.node.removeEventListener("pointerdown",this);this.node.removeEventListener("dblclick",this);this.node.removeEventListener("keydown",this);this._releaseMouse()}onUpdateRequest(e){var t;let n=this._titles;let i=this.renderer;let s=this.currentTitle;let o=new Array(n.length);const r=(t=this._getCurrentTabindex())!==null&&t!==void 0?t:this._currentIndex>-1?this._currentIndex:0;for(let a=0,l=n.length;aa.ElementExt.hitTest(t,e.clientX,e.clientY)));if(n===-1){return}let s=this.titles[n];let o=t[n].querySelector(".lm-TabBar-tabLabel");if(o&&o.contains(e.target)){let e=s.label||"";let t=o.innerHTML;o.innerHTML="";let n=document.createElement("input");n.classList.add("lm-TabBar-tabInput");n.value=e;o.appendChild(n);let i=()=>{n.removeEventListener("blur",i);o.innerHTML=t;this.node.addEventListener("keydown",this)};n.addEventListener("dblclick",(e=>e.stopPropagation()));n.addEventListener("blur",i);n.addEventListener("keydown",(e=>{if(e.key==="Enter"){if(n.value!==""){s.label=s.caption=n.value}i()}else if(e.key==="Escape"){i()}}));this.node.removeEventListener("keydown",this);n.select();n.focus();if(o.children.length>0){o.children[0].focus()}}}_evtKeyDownCapturing(e){if(e.eventPhase!==Event.CAPTURING_PHASE){return}e.preventDefault();e.stopPropagation();if(e.key==="Escape"){this._releaseMouse()}}_evtKeyDown(e){var t,n,s;if(e.key==="Tab"||e.eventPhase===Event.CAPTURING_PHASE){return}if(e.key==="Enter"||e.key==="Spacebar"||e.key===" "){const t=document.activeElement;if(this.addButtonEnabled&&this.addButtonNode.contains(t)){e.preventDefault();e.stopPropagation();this._addRequested.emit()}else{const n=i.ArrayExt.findFirstIndex(this.contentNode.children,(e=>e.contains(t)));if(n>=0){e.preventDefault();e.stopPropagation();this.currentIndex=n}}}else if(ne.includes(e.key)){const i=[...this.contentNode.children];if(this.addButtonEnabled){i.push(this.addButtonNode)}if(i.length<=1){return}e.preventDefault();e.stopPropagation();let o=i.indexOf(document.activeElement);if(o===-1){o=this._currentIndex}let r;if(e.key==="ArrowRight"&&this._orientation==="horizontal"||e.key==="ArrowDown"&&this._orientation==="vertical"){r=(t=i[o+1])!==null&&t!==void 0?t:i[0]}else if(e.key==="ArrowLeft"&&this._orientation==="horizontal"||e.key==="ArrowUp"&&this._orientation==="vertical"){r=(n=i[o-1])!==null&&n!==void 0?n:i[i.length-1]}else if(e.key==="Home"){r=i[0]}else if(e.key==="End"){r=i[i.length-1]}if(r){(s=i[o])===null||s===void 0?void 0:s.setAttribute("tabindex","-1");r===null||r===void 0?void 0:r.setAttribute("tabindex","0");r.focus()}}}_evtPointerDown(e){if(e.button!==0&&e.button!==1){return}if(this._dragData){return}if(e.target.classList.contains("lm-TabBar-tabInput")){return}let t=this.addButtonEnabled&&this.addButtonNode.contains(e.target);let n=this.contentNode.children;let s=i.ArrayExt.findFirstIndex(n,(t=>a.ElementExt.hitTest(t,e.clientX,e.clientY)));if(s===-1&&!t){return}e.preventDefault();e.stopPropagation();this._dragData={tab:n[s],index:s,pressX:e.clientX,pressY:e.clientY,tabPos:-1,tabSize:-1,tabPressPos:-1,targetIndex:-1,tabLayout:null,contentRect:null,override:null,dragActive:false,dragAborted:false,detachRequested:false};this.document.addEventListener("pointerup",this,true);if(e.button===1||t){return}let o=n[s].querySelector(this.renderer.closeIconSelector);if(o&&o.contains(e.target)){return}if(this.tabsMovable){this.document.addEventListener("pointermove",this,true);this.document.addEventListener("keydown",this,true);this.document.addEventListener("contextmenu",this,true)}if(this.allowDeselect&&this.currentIndex===s){this.currentIndex=-1}else{this.currentIndex=s}if(this.currentIndex===-1){return}this._tabActivateRequested.emit({index:this.currentIndex,title:this.currentTitle})}_evtPointerMove(e){let t=this._dragData;if(!t){return}e.preventDefault();e.stopPropagation();let n=this.contentNode.children;if(!t.dragActive&&!se.dragExceeded(t,e)){return}if(!t.dragActive){let e=t.tab.getBoundingClientRect();if(this._orientation==="horizontal"){t.tabPos=t.tab.offsetLeft;t.tabSize=e.width;t.tabPressPos=t.pressX-e.left}else{t.tabPos=t.tab.offsetTop;t.tabSize=e.height;t.tabPressPos=t.pressY-e.top}t.tabPressOffset={x:t.pressX-e.left,y:t.pressY-e.top};t.tabLayout=se.snapTabLayout(n,this._orientation);t.contentRect=this.contentNode.getBoundingClientRect();t.override=g.Drag.overrideCursor("default");t.tab.classList.add("lm-mod-dragging");this.addClass("lm-mod-dragging");t.dragActive=true}if(!t.detachRequested&&se.detachExceeded(t,e)){t.detachRequested=true;let i=t.index;let s=e.clientX;let o=e.clientY;let r=n[i];let a=this._titles[i];this._tabDetachRequested.emit({index:i,title:a,tab:r,clientX:s,clientY:o,offset:t.tabPressOffset});if(t.dragAborted){return}}se.layoutTabs(n,t,e,this._orientation)}_evtPointerUp(e){if(e.button!==0&&e.button!==1){return}const t=this._dragData;if(!t){return}e.preventDefault();e.stopPropagation();this.document.removeEventListener("pointermove",this,true);this.document.removeEventListener("pointerup",this,true);this.document.removeEventListener("keydown",this,true);this.document.removeEventListener("contextmenu",this,true);if(!t.dragActive){this._dragData=null;let n=this.addButtonEnabled&&this.addButtonNode.contains(e.target);if(n){this._addRequested.emit(undefined);return}let s=this.contentNode.children;let o=i.ArrayExt.findFirstIndex(s,(t=>a.ElementExt.hitTest(t,e.clientX,e.clientY)));if(o!==t.index){return}let r=this._titles[o];if(!r.closable){return}if(e.button===1){this._tabCloseRequested.emit({index:o,title:r});return}let l=s[o].querySelector(this.renderer.closeIconSelector);if(l&&l.contains(e.target)){this._tabCloseRequested.emit({index:o,title:r});return}return}if(e.button!==0){return}se.finalizeTabPosition(t,this._orientation);t.tab.classList.remove("lm-mod-dragging");let n=se.parseTransitionDuration(t.tab);setTimeout((()=>{if(t.dragAborted){return}this._dragData=null;se.resetTabPositions(this.contentNode.children,this._orientation);t.override.dispose();this.removeClass("lm-mod-dragging");let e=t.index;let n=t.targetIndex;if(n===-1||e===n){return}i.ArrayExt.move(this._titles,e,n);this._adjustCurrentForMove(e,n);this._tabMoved.emit({fromIndex:e,toIndex:n,title:this._titles[n]});d.MessageLoop.sendMessage(this,E.Msg.UpdateRequest)}),n)}_releaseMouse(){let e=this._dragData;if(!e){return}this._dragData=null;this.document.removeEventListener("pointermove",this,true);this.document.removeEventListener("pointerup",this,true);this.document.removeEventListener("keydown",this,true);this.document.removeEventListener("contextmenu",this,true);e.dragAborted=true;if(!e.dragActive){return}se.resetTabPositions(this.contentNode.children,this._orientation);e.override.dispose();e.tab.classList.remove("lm-mod-dragging");this.removeClass("lm-mod-dragging")}_adjustCurrentForInsert(e,t){let n=this.currentTitle;let i=this._currentIndex;let s=this.insertBehavior;if(s==="select-tab"||s==="select-tab-if-needed"&&i===-1){this._currentIndex=e;this._previousTitle=n;this._currentChanged.emit({previousIndex:i,previousTitle:n,currentIndex:e,currentTitle:t});return}if(i>=e){this._currentIndex++}}_adjustCurrentForMove(e,t){if(this._currentIndex===e){this._currentIndex=t}else if(this._currentIndex=t){this._currentIndex++}else if(this._currentIndex>e&&this._currentIndex<=t){this._currentIndex--}}_adjustCurrentForRemove(e,t){let n=this._currentIndex;let i=this.removeBehavior;if(n!==e){if(n>e){this._currentIndex--}return}if(this._titles.length===0){this._currentIndex=-1;this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null});return}if(i==="select-tab-after"){this._currentIndex=Math.min(e,this._titles.length-1);this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(i==="select-tab-before"){this._currentIndex=Math.max(0,e-1);this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}if(i==="select-previous-tab"){if(this._previousTitle){this._currentIndex=this._titles.indexOf(this._previousTitle);this._previousTitle=null}else{this._currentIndex=Math.min(e,this._titles.length-1)}this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:this._currentIndex,currentTitle:this.currentTitle});return}this._currentIndex=-1;this._currentChanged.emit({previousIndex:e,previousTitle:t,currentIndex:-1,currentTitle:null})}_onTitleChanged(e){this.update()}}(function(e){class t{constructor(){this.closeIconSelector=".lm-TabBar-tabCloseIcon";this._tabID=0;this._tabKeys=new WeakMap;this._uuid=++t._nInstance}renderTab(e){let t=e.title.caption;let n=this.createTabKey(e);let i=n;let s=this.createTabStyle(e);let o=this.createTabClass(e);let r=this.createTabDataset(e);let a=this.createTabARIA(e);if(e.title.closable){return b.h.li({id:i,key:n,className:o,title:t,style:s,dataset:r,...a},this.renderIcon(e),this.renderLabel(e),this.renderCloseIcon(e))}else{return b.h.li({id:i,key:n,className:o,title:t,style:s,dataset:r,...a},this.renderIcon(e),this.renderLabel(e))}}renderIcon(e){const{title:t}=e;let n=this.createIconClass(e);return b.h.div({className:n},t.icon,t.iconLabel)}renderLabel(e){return b.h.div({className:"lm-TabBar-tabLabel"},e.title.label)}renderCloseIcon(e){return b.h.div({className:"lm-TabBar-tabCloseIcon"})}createTabKey(e){let t=this._tabKeys.get(e.title);if(t===undefined){t=`tab-key-${this._uuid}-${this._tabID++}`;this._tabKeys.set(e.title,t)}return t}createTabStyle(e){return{zIndex:`${e.zIndex}`}}createTabClass(e){let t="lm-TabBar-tab";if(e.title.className){t+=` ${e.title.className}`}if(e.title.closable){t+=" lm-mod-closable"}if(e.current){t+=" lm-mod-current"}return t}createTabDataset(e){return e.title.dataset}createTabARIA(e){var t;return{role:"tab","aria-selected":e.current.toString(),tabindex:`${(t=e.tabIndex)!==null&&t!==void 0?t:"-1"}`}}createIconClass(e){let t="lm-TabBar-tabIcon";let n=e.title.iconClass;return n?`${t} ${n}`:t}}t._nInstance=0;e.Renderer=t;e.defaultRenderer=new t;e.addButtonSelector=".lm-TabBar-addButton"})(ie||(ie={}));var se;(function(e){e.DRAG_THRESHOLD=5;e.DETACH_THRESHOLD=20;function t(){let e=document.createElement("div");let t=document.createElement("ul");t.setAttribute("role","tablist");t.className="lm-TabBar-content";e.appendChild(t);let n=document.createElement("div");n.className="lm-TabBar-addButton lm-mod-hidden";n.setAttribute("tabindex","-1");n.setAttribute("role","button");e.appendChild(n);return e}e.createNode=t;function n(e){return e instanceof I?e:new I(e)}e.asTitle=n;function i(e){let t=window.getComputedStyle(e);return 1e3*(parseFloat(t.transitionDuration)||0)}e.parseTransitionDuration=i;function s(e,t){let n=new Array(e.length);for(let i=0,s=e.length;i=e.DRAG_THRESHOLD||s>=e.DRAG_THRESHOLD}e.dragExceeded=o;function r(t,n){let i=t.contentRect;return n.clientX=i.right+e.DETACH_THRESHOLD||n.clientY=i.bottom+e.DETACH_THRESHOLD}e.detachExceeded=r;function a(e,t,n,i){let s;let o;let r;let a;if(i==="horizontal"){s=t.pressX;o=n.clientX-t.contentRect.left;r=n.clientX;a=t.contentRect.width}else{s=t.pressY;o=n.clientY-t.contentRect.top;r=n.clientY;a=t.contentRect.height}let l=t.index;let d=o-t.tabPressPos;let c=d+t.tabSize;for(let h=0,u=e.length;h>1);if(ht.index&&c>u){n=`${-t.tabSize-o.margin}px`;l=Math.max(l,h)}else if(h===t.index){let e=r-s;let i=a-(t.tabPos+t.tabSize);n=`${Math.max(-t.tabPos,Math.min(e,i))}px`}else{n=""}if(i==="horizontal"){e[h].style.left=n}else{e[h].style.top=n}}t.targetIndex=l}e.layoutTabs=a;function l(e,t){let n;if(t==="horizontal"){n=e.contentRect.width}else{n=e.contentRect.height}let i;if(e.targetIndex===e.index){i=0}else if(e.targetIndex>e.index){let t=e.tabLayout[e.targetIndex];i=t.pos+t.size-e.tabSize-e.tabPos}else{let t=e.tabLayout[e.targetIndex];i=t.pos-e.tabPos}let s=n-(e.tabPos+e.tabSize);let o=Math.max(-e.tabPos,Math.min(i,s));if(t==="horizontal"){e.tab.style.left=`${o}px`}else{e.tab.style.top=`${o}px`}}e.finalizeTabPosition=l;function d(e,t){for(const n of e){if(t==="horizontal"){n.style.left=""}else{n.style.top=""}}}e.resetTabPositions=d})(se||(se={}));class oe extends M{constructor(e){super();this._spacing=4;this._dirty=false;this._root=null;this._box=null;this._items=new Map;this.renderer=e.renderer;if(e.spacing!==undefined){this._spacing=R.clampDimension(e.spacing)}this._document=e.document||document;this._hiddenMode=e.hiddenMode!==undefined?e.hiddenMode:E.HiddenMode.Display}dispose(){let e=this[Symbol.iterator]();this._items.forEach((e=>{e.dispose()}));this._box=null;this._root=null;this._items.clear();for(const t of e){t.dispose()}super.dispose()}get hiddenMode(){return this._hiddenMode}set hiddenMode(e){if(this._hiddenMode===e){return}this._hiddenMode=e;for(const t of this.tabBars()){if(t.titles.length>1){for(const e of t.titles){e.owner.hiddenMode=this._hiddenMode}}}}get spacing(){return this._spacing}set spacing(e){e=R.clampDimension(e);if(this._spacing===e){return}this._spacing=e;if(!this.parent){return}this.parent.fit()}get isEmpty(){return this._root===null}[Symbol.iterator](){return this._root?this._root.iterAllWidgets():(0,i.empty)()}widgets(){return this._root?this._root.iterUserWidgets():(0,i.empty)()}selectedWidgets(){return this._root?this._root.iterSelectedWidgets():(0,i.empty)()}tabBars(){return this._root?this._root.iterTabBars():(0,i.empty)()}handles(){return this._root?this._root.iterHandles():(0,i.empty)()}moveHandle(e,t,n){let i=e.classList.contains("lm-mod-hidden");if(!this._root||i){return}let s=this._root.findSplitNode(e);if(!s){return}let o;if(s.node.orientation==="horizontal"){o=t-e.offsetLeft}else{o=n-e.offsetTop}if(o===0){return}s.node.holdSizes();j.adjust(s.node.sizers,s.index,o);if(this.parent){this.parent.update()}}saveLayout(){if(!this._root){return{main:null}}this._root.holdAllSizes();return{main:this._root.createConfig()}}restoreLayout(e){let t=new Set;let n;if(e.main){n=re.normalizeAreaConfig(e.main,t)}else{n=null}let i=this.widgets();let s=this.tabBars();let o=this.handles();this._root=null;for(const r of i){if(!t.has(r)){r.parent=null}}for(const r of s){r.dispose()}for(const r of o){if(r.parentNode){r.parentNode.removeChild(r)}}for(const r of t){r.parent=this.parent}if(n){this._root=re.realizeAreaConfig(n,{createTabBar:e=>this._createTabBar(),createHandle:()=>this._createHandle()},this._document)}else{this._root=null}if(!this.parent){return}t.forEach((e=>{this.attachWidget(e)}));this.parent.fit()}addWidget(e,t={}){let n=t.ref||null;let i=t.mode||"tab-after";let s=null;if(this._root&&n){s=this._root.findTabNode(n)}if(n&&!s){throw new Error("Reference widget is not in the layout.")}e.parent=this.parent;switch(i){case"tab-after":this._insertTab(e,n,s,true);break;case"tab-before":this._insertTab(e,n,s,false);break;case"split-top":this._insertSplit(e,n,s,"vertical",false);break;case"split-left":this._insertSplit(e,n,s,"horizontal",false);break;case"split-right":this._insertSplit(e,n,s,"horizontal",true);break;case"split-bottom":this._insertSplit(e,n,s,"vertical",true);break;case"merge-top":this._insertSplit(e,n,s,"vertical",false,true);break;case"merge-left":this._insertSplit(e,n,s,"horizontal",false,true);break;case"merge-right":this._insertSplit(e,n,s,"horizontal",true,true);break;case"merge-bottom":this._insertSplit(e,n,s,"vertical",true,true);break}if(!this.parent){return}this.attachWidget(e);this.parent.fit()}removeWidget(e){this._removeWidget(e);if(!this.parent){return}this.detachWidget(e);this.parent.fit()}hitTestTabAreas(e,t){if(!this._root||!this.parent||!this.parent.isVisible){return null}if(!this._box){this._box=a.ElementExt.boxSizing(this.parent.node)}let n=this.parent.node.getBoundingClientRect();let i=e-n.left-this._box.borderLeft;let s=t-n.top-this._box.borderTop;let o=this._root.hitTestTabNodes(i,s);if(!o){return null}let{tabBar:r,top:l,left:d,width:c,height:h}=o;let u=this._box.borderLeft+this._box.borderRight;let p=this._box.borderTop+this._box.borderBottom;let m=n.width-u-(d+c);let g=n.height-p-(l+h);return{tabBar:r,x:i,y:s,top:l,left:d,right:m,bottom:g,width:c,height:h}}init(){super.init();for(const e of this){this.attachWidget(e)}for(const e of this.handles()){this.parent.node.appendChild(e)}this.parent.fit()}attachWidget(e){if(this.parent.node===e.node.parentNode){return}this._items.set(e,new D(e));if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.BeforeAttach)}this.parent.node.appendChild(e.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.AfterAttach)}}detachWidget(e){if(this.parent.node!==e.node.parentNode){return}if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.BeforeDetach)}this.parent.node.removeChild(e.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.AfterDetach)}let t=this._items.get(e);if(t){this._items.delete(e);t.dispose()}}onBeforeShow(e){super.onBeforeShow(e);this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e);this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){if(this.parent.isVisible){this._update(e.width,e.height)}}onUpdateRequest(e){if(this.parent.isVisible){this._update(-1,-1)}}onFitRequest(e){if(this.parent.isAttached){this._fit()}}_removeWidget(e){if(!this._root){return}let t=this._root.findTabNode(e);if(!t){return}re.removeAria(e);if(t.tabBar.titles.length>1){t.tabBar.removeTab(e.title);if(this._hiddenMode===E.HiddenMode.Scale&&t.tabBar.titles.length==1){const e=t.tabBar.titles[0].owner;e.hiddenMode=E.HiddenMode.Display}return}t.tabBar.dispose();if(this._root===t){this._root=null;return}this._root.holdAllSizes();let n=t.parent;t.parent=null;let s=i.ArrayExt.removeFirstOf(n.children,t);let o=i.ArrayExt.removeAt(n.handles,s);i.ArrayExt.removeAt(n.sizers,s);if(o.parentNode){o.parentNode.removeChild(o)}if(n.children.length>1){n.syncHandles();return}let r=n.parent;n.parent=null;let a=n.children[0];let l=n.handles[0];n.children.length=0;n.handles.length=0;n.sizers.length=0;if(l.parentNode){l.parentNode.removeChild(l)}if(this._root===n){a.parent=null;this._root=a;return}let d=r;let c=d.children.indexOf(n);if(a instanceof re.TabLayoutNode){a.parent=d;d.children[c]=a;return}let h=i.ArrayExt.removeAt(d.handles,c);i.ArrayExt.removeAt(d.children,c);i.ArrayExt.removeAt(d.sizers,c);if(h.parentNode){h.parentNode.removeChild(h)}for(let u=0,p=a.children.length;u=this._left+this._width){return null}if(t=this._top+this._height){return null}return this}createConfig(){let e=this.tabBar.titles.map((e=>e.owner));let t=this.tabBar.currentIndex;return{type:"tab-area",widgets:e,currentIndex:t}}holdAllSizes(){return}fit(e,t){let n=0;let i=0;let s=Infinity;let o=Infinity;let r=t.get(this.tabBar);let a=this.tabBar.currentTitle;let l=a?t.get(a.owner):undefined;let[d,c]=this.sizers;if(r){r.fit()}if(l){l.fit()}if(r&&!r.isHidden){n=Math.max(n,r.minWidth);i+=r.minHeight;d.minSize=r.minHeight;d.maxSize=r.maxHeight}else{d.minSize=0;d.maxSize=0}if(l&&!l.isHidden){n=Math.max(n,l.minWidth);i+=l.minHeight;c.minSize=l.minHeight;c.maxSize=Infinity}else{c.minSize=0;c.maxSize=Infinity}return{minWidth:n,minHeight:i,maxWidth:s,maxHeight:o}}update(e,t,n,i,s,o){this._top=t;this._left=e;this._width=n;this._height=i;let r=o.get(this.tabBar);let a=this.tabBar.currentTitle;let l=a?o.get(a.owner):undefined;j.calc(this.sizers,i);if(r&&!r.isHidden){let i=this.sizers[0].size;r.update(e,t,n,i);t+=i}if(l&&!l.isHidden){let i=this.sizers[1].size;l.update(e,t,n,i)}}}e.TabLayoutNode=s;class o{constructor(e){this.parent=null;this.normalized=false;this.children=[];this.sizers=[];this.handles=[];this.orientation=e}*iterAllWidgets(){for(const e of this.children){yield*e.iterAllWidgets()}}*iterUserWidgets(){for(const e of this.children){yield*e.iterUserWidgets()}}*iterSelectedWidgets(){for(const e of this.children){yield*e.iterSelectedWidgets()}}*iterTabBars(){for(const e of this.children){yield*e.iterTabBars()}}*iterHandles(){yield*this.handles;for(const e of this.children){yield*e.iterHandles()}}findTabNode(e){for(let t=0,n=this.children.length;te.createConfig()));return{type:"split-area",orientation:e,children:n,sizes:t}}syncHandles(){this.handles.forEach(((e,t)=>{e.setAttribute("data-orientation",this.orientation);if(t===this.handles.length-1){e.classList.add("lm-mod-hidden")}else{e.classList.remove("lm-mod-hidden")}}))}holdSizes(){for(const e of this.sizers){e.sizeHint=e.size}}holdAllSizes(){for(const e of this.children){e.holdAllSizes()}this.holdSizes()}normalizeSizes(){let e=this.sizers.length;if(e===0){return}this.holdSizes();let t=this.sizers.reduce(((e,t)=>e+t.sizeHint),0);if(t===0){for(const t of this.sizers){t.size=t.sizeHint=1/e}}else{for(const e of this.sizers){e.size=e.sizeHint/=t}}this.normalized=true}createNormalizedSizes(){let e=this.sizers.length;if(e===0){return[]}let t=this.sizers.map((e=>e.size));let n=t.reduce(((e,t)=>e+t),0);if(n===0){for(let n=t.length-1;n>-1;n--){t[n]=1/e}}else{for(let e=t.length-1;e>-1;e--){t[e]/=n}}return t}fit(e,t){let n=this.orientation==="horizontal";let i=Math.max(0,this.children.length-1)*e;let s=n?i:0;let o=n?0:i;let r=Infinity;let a=Infinity;for(let l=0,d=this.children.length;l=n.length)){i=0}return{type:"tab-area",widgets:n,currentIndex:i}}function d(e,t){let i=e.orientation;let s=[];let o=[];for(let r=0,a=e.children.length;r{let l=i(o,n,s);let d=t(e.sizes[a]);let c=n.createHandle();r.children.push(l);r.handles.push(c);r.sizers.push(d);l.parent=r}));r.syncHandles();r.normalizeSizes();return r}})(re||(re={}));class ae extends E{constructor(e={}){super();this._drag=null;this._tabsMovable=true;this._tabsConstrained=false;this._addButtonEnabled=false;this._pressData=null;this._layoutModified=new p.Signal(this);this._addRequested=new p.Signal(this);this.addClass("lm-DockPanel");this._document=e.document||document;this._mode=e.mode||"multiple-document";this._renderer=e.renderer||ae.defaultRenderer;this._edges=e.edges||le.DEFAULT_EDGES;if(e.tabsMovable!==undefined){this._tabsMovable=e.tabsMovable}if(e.tabsConstrained!==undefined){this._tabsConstrained=e.tabsConstrained}if(e.addButtonEnabled!==undefined){this._addButtonEnabled=e.addButtonEnabled}this.dataset["mode"]=this._mode;let t={createTabBar:()=>this._createTabBar(),createHandle:()=>this._createHandle()};this.layout=new oe({document:this._document,renderer:t,spacing:e.spacing,hiddenMode:e.hiddenMode});this.overlay=e.overlay||new ae.Overlay;this.node.appendChild(this.overlay.node)}dispose(){this._releaseMouse();this.overlay.hide(0);if(this._drag){this._drag.dispose()}super.dispose()}get hiddenMode(){return this.layout.hiddenMode}set hiddenMode(e){this.layout.hiddenMode=e}get layoutModified(){return this._layoutModified}get addRequested(){return this._addRequested}get renderer(){return this.layout.renderer}get spacing(){return this.layout.spacing}set spacing(e){this.layout.spacing=e}get mode(){return this._mode}set mode(e){if(this._mode===e){return}this._mode=e;this.dataset["mode"]=e;let t=this.layout;switch(e){case"multiple-document":for(const e of t.tabBars()){e.show()}break;case"single-document":t.restoreLayout(le.createSingleDocumentConfig(this));break;default:throw"unreachable"}d.MessageLoop.postMessage(this,le.LayoutModified)}get tabsMovable(){return this._tabsMovable}set tabsMovable(e){this._tabsMovable=e;for(const t of this.tabBars()){t.tabsMovable=e}}get tabsConstrained(){return this._tabsConstrained}set tabsConstrained(e){this._tabsConstrained=e}get addButtonEnabled(){return this._addButtonEnabled}set addButtonEnabled(e){this._addButtonEnabled=e;for(const t of this.tabBars()){t.addButtonEnabled=e}}get isEmpty(){return this.layout.isEmpty}*widgets(){yield*this.layout.widgets()}*selectedWidgets(){yield*this.layout.selectedWidgets()}*tabBars(){yield*this.layout.tabBars()}*handles(){yield*this.layout.handles()}selectWidget(e){let t=(0,i.find)(this.tabBars(),(t=>t.titles.indexOf(e.title)!==-1));if(!t){throw new Error("Widget is not contained in the dock panel.")}t.currentTitle=e.title}activateWidget(e){this.selectWidget(e);e.activate()}saveLayout(){return this.layout.saveLayout()}restoreLayout(e){this._mode="multiple-document";this.layout.restoreLayout(e);if(a.Platform.IS_EDGE||a.Platform.IS_IE){d.MessageLoop.flush()}d.MessageLoop.postMessage(this,le.LayoutModified)}addWidget(e,t={}){if(this._mode==="single-document"){this.layout.addWidget(e)}else{this.layout.addWidget(e,t)}d.MessageLoop.postMessage(this,le.LayoutModified)}processMessage(e){if(e.type==="layout-modified"){this._layoutModified.emit(undefined)}else{super.processMessage(e)}}handleEvent(e){switch(e.type){case"lm-dragenter":this._evtDragEnter(e);break;case"lm-dragleave":this._evtDragLeave(e);break;case"lm-dragover":this._evtDragOver(e);break;case"lm-drop":this._evtDrop(e);break;case"pointerdown":this._evtPointerDown(e);break;case"pointermove":this._evtPointerMove(e);break;case"pointerup":this._evtPointerUp(e);break;case"keydown":this._evtKeyDown(e);break;case"contextmenu":e.preventDefault();e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("lm-dragenter",this);this.node.addEventListener("lm-dragleave",this);this.node.addEventListener("lm-dragover",this);this.node.addEventListener("lm-drop",this);this.node.addEventListener("pointerdown",this)}onAfterDetach(e){this.node.removeEventListener("lm-dragenter",this);this.node.removeEventListener("lm-dragleave",this);this.node.removeEventListener("lm-dragover",this);this.node.removeEventListener("lm-drop",this);this.node.removeEventListener("pointerdown",this);this._releaseMouse()}onChildAdded(e){if(le.isGeneratedTabBarProperty.get(e.child)){return}e.child.addClass("lm-DockPanel-widget")}onChildRemoved(e){if(le.isGeneratedTabBarProperty.get(e.child)){return}e.child.removeClass("lm-DockPanel-widget");d.MessageLoop.postMessage(this,le.LayoutModified)}_evtDragEnter(e){if(e.mimeData.hasData("application/vnd.lumino.widget-factory")){e.preventDefault();e.stopPropagation()}}_evtDragLeave(e){e.preventDefault();if(this._tabsConstrained&&e.source!==this)return;e.stopPropagation();this.overlay.hide(1)}_evtDragOver(e){e.preventDefault();if(this._tabsConstrained&&e.source!==this||this._showOverlay(e.clientX,e.clientY)==="invalid"){e.dropAction="none"}else{e.stopPropagation();e.dropAction=e.proposedAction}}_evtDrop(e){e.preventDefault();this.overlay.hide(0);if(e.proposedAction==="none"){e.dropAction="none";return}let{clientX:t,clientY:n}=e;let{zone:i,target:s}=le.findDropTarget(this,t,n,this._edges);if(this._tabsConstrained&&e.source!==this||i==="invalid"){e.dropAction="none";return}let o=e.mimeData;let r=o.getData("application/vnd.lumino.widget-factory");if(typeof r!=="function"){e.dropAction="none";return}let a=r();if(!(a instanceof E)){e.dropAction="none";return}if(a.contains(this)){e.dropAction="none";return}let l=s?le.getDropRef(s.tabBar):null;switch(i){case"root-all":this.addWidget(a);break;case"root-top":this.addWidget(a,{mode:"split-top"});break;case"root-left":this.addWidget(a,{mode:"split-left"});break;case"root-right":this.addWidget(a,{mode:"split-right"});break;case"root-bottom":this.addWidget(a,{mode:"split-bottom"});break;case"widget-all":this.addWidget(a,{mode:"tab-after",ref:l});break;case"widget-top":this.addWidget(a,{mode:"split-top",ref:l});break;case"widget-left":this.addWidget(a,{mode:"split-left",ref:l});break;case"widget-right":this.addWidget(a,{mode:"split-right",ref:l});break;case"widget-bottom":this.addWidget(a,{mode:"split-bottom",ref:l});break;case"widget-tab":this.addWidget(a,{mode:"tab-after",ref:l});break;default:throw"unreachable"}e.dropAction=e.proposedAction;e.stopPropagation();this.activateWidget(a)}_evtKeyDown(e){e.preventDefault();e.stopPropagation();if(e.keyCode===27){this._releaseMouse();d.MessageLoop.postMessage(this,le.LayoutModified)}}_evtPointerDown(e){if(e.button!==0){return}let t=this.layout;let n=e.target;let s=(0,i.find)(t.handles(),(e=>e.contains(n)));if(!s){return}e.preventDefault();e.stopPropagation();this._document.addEventListener("keydown",this,true);this._document.addEventListener("pointerup",this,true);this._document.addEventListener("pointermove",this,true);this._document.addEventListener("contextmenu",this,true);let o=s.getBoundingClientRect();let r=e.clientX-o.left;let a=e.clientY-o.top;let l=window.getComputedStyle(s);let d=g.Drag.overrideCursor(l.cursor,this._document);this._pressData={handle:s,deltaX:r,deltaY:a,override:d}}_evtPointerMove(e){if(!this._pressData){return}e.preventDefault();e.stopPropagation();let t=this.node.getBoundingClientRect();let n=e.clientX-t.left-this._pressData.deltaX;let i=e.clientY-t.top-this._pressData.deltaY;let s=this.layout;s.moveHandle(this._pressData.handle,n,i)}_evtPointerUp(e){if(e.button!==0){return}e.preventDefault();e.stopPropagation();this._releaseMouse();d.MessageLoop.postMessage(this,le.LayoutModified)}_releaseMouse(){if(!this._pressData){return}this._pressData.override.dispose();this._pressData=null;this._document.removeEventListener("keydown",this,true);this._document.removeEventListener("pointerup",this,true);this._document.removeEventListener("pointermove",this,true);this._document.removeEventListener("contextmenu",this,true)}_showOverlay(e,t){let{zone:n,target:i}=le.findDropTarget(this,e,t,this._edges);if(n==="invalid"){this.overlay.hide(100);return n}let s;let o;let r;let l;let d=a.ElementExt.boxSizing(this.node);let c=this.node.getBoundingClientRect();switch(n){case"root-all":s=d.paddingTop;o=d.paddingLeft;r=d.paddingRight;l=d.paddingBottom;break;case"root-top":s=d.paddingTop;o=d.paddingLeft;r=d.paddingRight;l=c.height*le.GOLDEN_RATIO;break;case"root-left":s=d.paddingTop;o=d.paddingLeft;r=c.width*le.GOLDEN_RATIO;l=d.paddingBottom;break;case"root-right":s=d.paddingTop;o=c.width*le.GOLDEN_RATIO;r=d.paddingRight;l=d.paddingBottom;break;case"root-bottom":s=c.height*le.GOLDEN_RATIO;o=d.paddingLeft;r=d.paddingRight;l=d.paddingBottom;break;case"widget-all":s=i.top;o=i.left;r=i.right;l=i.bottom;break;case"widget-top":s=i.top;o=i.left;r=i.right;l=i.bottom+i.height/2;break;case"widget-left":s=i.top;o=i.left;r=i.right+i.width/2;l=i.bottom;break;case"widget-right":s=i.top;o=i.left+i.width/2;r=i.right;l=i.bottom;break;case"widget-bottom":s=i.top+i.height/2;o=i.left;r=i.right;l=i.bottom;break;case"widget-tab":{const e=i.tabBar.node.getBoundingClientRect().height;s=i.top;o=i.left;r=i.right;l=i.bottom+i.height-e;break}default:throw"unreachable"}this.overlay.show({top:s,left:o,right:r,bottom:l});return n}_createTabBar(){let e=this._renderer.createTabBar(this._document);le.isGeneratedTabBarProperty.set(e,true);if(this._mode==="single-document"){e.hide()}e.tabsMovable=this._tabsMovable;e.allowDeselect=false;e.addButtonEnabled=this._addButtonEnabled;e.removeBehavior="select-previous-tab";e.insertBehavior="select-tab-if-needed";e.tabMoved.connect(this._onTabMoved,this);e.currentChanged.connect(this._onCurrentChanged,this);e.tabCloseRequested.connect(this._onTabCloseRequested,this);e.tabDetachRequested.connect(this._onTabDetachRequested,this);e.tabActivateRequested.connect(this._onTabActivateRequested,this);e.addRequested.connect(this._onTabAddRequested,this);return e}_createHandle(){return this._renderer.createHandle()}_onTabMoved(){d.MessageLoop.postMessage(this,le.LayoutModified)}_onCurrentChanged(e,t){let{previousTitle:n,currentTitle:i}=t;if(n){n.owner.hide()}if(i){i.owner.show()}if(a.Platform.IS_EDGE||a.Platform.IS_IE){d.MessageLoop.flush()}d.MessageLoop.postMessage(this,le.LayoutModified)}_onTabAddRequested(e){this._addRequested.emit(e)}_onTabActivateRequested(e,t){t.title.owner.activate()}_onTabCloseRequested(e,t){t.title.owner.close()}_onTabDetachRequested(e,t){if(this._drag){return}e.releaseMouse();let{title:n,tab:i,clientX:s,clientY:r,offset:a}=t;let l=new o.MimeData;let d=()=>n.owner;l.setData("application/vnd.lumino.widget-factory",d);let c=i.cloneNode(true);if(a){c.style.top=`-${a.y}px`;c.style.left=`-${a.x}px`}this._drag=new g.Drag({document:this._document,mimeData:l,dragImage:c,proposedAction:"move",supportedActions:"move",source:this});i.classList.add("lm-mod-hidden");let h=()=>{this._drag=null;i.classList.remove("lm-mod-hidden")};this._drag.start(s,r).then(h)}}(function(e){class t{constructor(){this._timer=-1;this._hidden=true;this.node=document.createElement("div");this.node.classList.add("lm-DockPanel-overlay");this.node.classList.add("lm-mod-hidden");this.node.style.position="absolute";this.node.style.contain="strict"}show(e){let t=this.node.style;t.top=`${e.top}px`;t.left=`${e.left}px`;t.right=`${e.right}px`;t.bottom=`${e.bottom}px`;clearTimeout(this._timer);this._timer=-1;if(!this._hidden){return}this._hidden=false;this.node.classList.remove("lm-mod-hidden")}hide(e){if(this._hidden){return}if(e<=0){clearTimeout(this._timer);this._timer=-1;this._hidden=true;this.node.classList.add("lm-mod-hidden");return}if(this._timer!==-1){return}this._timer=window.setTimeout((()=>{this._timer=-1;this._hidden=true;this.node.classList.add("lm-mod-hidden")}),e)}}e.Overlay=t;class n{createTabBar(e){let t=new ie({document:e});t.addClass("lm-DockPanel-tabBar");return t}createHandle(){let e=document.createElement("div");e.className="lm-DockPanel-handle";return e}}e.Renderer=n;e.defaultRenderer=new n})(ae||(ae={}));var le;(function(e){e.GOLDEN_RATIO=.618;e.DEFAULT_EDGES={top:12,right:40,bottom:40,left:40};e.LayoutModified=new d.ConflatableMessage("layout-modified");e.isGeneratedTabBarProperty=new h.AttachedProperty({name:"isGeneratedTabBar",create:()=>false});function t(e){if(e.isEmpty){return{main:null}}let t=Array.from(e.widgets());let n=e.selectedWidgets().next().value;let i=n?t.indexOf(n):-1;return{main:{type:"tab-area",widgets:t,currentIndex:i}}}e.createSingleDocumentConfig=t;function n(e,t,n,i){if(!a.ElementExt.hitTest(e.node,t,n)){return{zone:"invalid",target:null}}let s=e.layout;if(s.isEmpty){return{zone:"root-all",target:null}}if(e.mode==="multiple-document"){let s=e.node.getBoundingClientRect();let o=t-s.left+1;let r=n-s.top+1;let a=s.right-t;let l=s.bottom-n;let d=Math.min(r,a,l,o);switch(d){case r:if(ru&&d>u&&l>p&&c>p){return{zone:"widget-all",target:o}}r/=u;l/=p;d/=u;c/=p;let m=Math.min(r,l,d,c);let g;switch(m){case r:g="widget-left";break;case l:g="widget-top";break;case d:g="widget-right";break;case c:g="widget-bottom";break;default:throw"unreachable"}return{zone:g,target:o}}e.findDropTarget=n;function i(e){if(e.titles.length===0){return null}if(e.currentTitle){return e.currentTitle.owner}return e.titles[e.titles.length-1].owner}e.getDropRef=i})(le||(le={}));class de{constructor(){this._counter=0;this._widgets=[];this._activeWidget=null;this._currentWidget=null;this._numbers=new Map;this._nodes=new Map;this._activeChanged=new p.Signal(this);this._currentChanged=new p.Signal(this)}dispose(){if(this._counter<0){return}this._counter=-1;p.Signal.clearData(this);for(const e of this._widgets){e.node.removeEventListener("focus",this,true);e.node.removeEventListener("blur",this,true)}this._activeWidget=null;this._currentWidget=null;this._nodes.clear();this._numbers.clear();this._widgets.length=0}get currentChanged(){return this._currentChanged}get activeChanged(){return this._activeChanged}get isDisposed(){return this._counter<0}get currentWidget(){return this._currentWidget}get activeWidget(){return this._activeWidget}get widgets(){return this._widgets}focusNumber(e){let t=this._numbers.get(e);return t===undefined?-1:t}has(e){return this._numbers.has(e)}add(e){if(this._numbers.has(e)){return}let t=e.node.contains(document.activeElement);let n=t?this._counter++:-1;this._widgets.push(e);this._numbers.set(e,n);this._nodes.set(e.node,e);e.node.addEventListener("focus",this,true);e.node.addEventListener("blur",this,true);e.disposed.connect(this._onWidgetDisposed,this);if(t){this._setWidgets(e,e)}}remove(e){if(!this._numbers.has(e)){return}e.disposed.disconnect(this._onWidgetDisposed,this);e.node.removeEventListener("focus",this,true);e.node.removeEventListener("blur",this,true);i.ArrayExt.removeFirstOf(this._widgets,e);this._nodes.delete(e.node);this._numbers.delete(e);if(this._currentWidget!==e){return}let t=this._widgets.filter((e=>this._numbers.get(e)!==-1));let n=(0,i.max)(t,((e,t)=>{let n=this._numbers.get(e);let i=this._numbers.get(t);return n-i}))||null;this._setWidgets(n,null)}handleEvent(e){switch(e.type){case"focus":this._evtFocus(e);break;case"blur":this._evtBlur(e);break}}_setWidgets(e,t){let n=this._currentWidget;this._currentWidget=e;let i=this._activeWidget;this._activeWidget=t;if(n!==e){this._currentChanged.emit({oldValue:n,newValue:e})}if(i!==t){this._activeChanged.emit({oldValue:i,newValue:t})}}_evtFocus(e){let t=this._nodes.get(e.currentTarget);if(t!==this._currentWidget){this._numbers.set(t,this._counter++)}this._setWidgets(t,t)}_evtBlur(e){let t=this._nodes.get(e.currentTarget);let n=e.relatedTarget;if(!n){this._setWidgets(this._currentWidget,null);return}if(t.node.contains(n)){return}if(!(0,i.find)(this._widgets,(e=>e.node.contains(n)))){this._setWidgets(this._currentWidget,null);return}}_onWidgetDisposed(e){this.remove(e)}}class ce extends M{constructor(e={}){super(e);this._dirty=false;this._rowSpacing=4;this._columnSpacing=4;this._items=[];this._rowStarts=[];this._columnStarts=[];this._rowSizers=[new k];this._columnSizers=[new k];this._box=null;if(e.rowCount!==undefined){he.reallocSizers(this._rowSizers,e.rowCount)}if(e.columnCount!==undefined){he.reallocSizers(this._columnSizers,e.columnCount)}if(e.rowSpacing!==undefined){this._rowSpacing=he.clampValue(e.rowSpacing)}if(e.columnSpacing!==undefined){this._columnSpacing=he.clampValue(e.columnSpacing)}}dispose(){for(const e of this._items){let t=e.widget;e.dispose();t.dispose()}this._box=null;this._items.length=0;this._rowStarts.length=0;this._rowSizers.length=0;this._columnStarts.length=0;this._columnSizers.length=0;super.dispose()}get rowCount(){return this._rowSizers.length}set rowCount(e){if(e===this.rowCount){return}he.reallocSizers(this._rowSizers,e);if(this.parent){this.parent.fit()}}get columnCount(){return this._columnSizers.length}set columnCount(e){if(e===this.columnCount){return}he.reallocSizers(this._columnSizers,e);if(this.parent){this.parent.fit()}}get rowSpacing(){return this._rowSpacing}set rowSpacing(e){e=he.clampValue(e);if(this._rowSpacing===e){return}this._rowSpacing=e;if(this.parent){this.parent.fit()}}get columnSpacing(){return this._columnSpacing}set columnSpacing(e){e=he.clampValue(e);if(this._columnSpacing===e){return}this._columnSpacing=e;if(this.parent){this.parent.fit()}}rowStretch(e){let t=this._rowSizers[e];return t?t.stretch:-1}setRowStretch(e,t){let n=this._rowSizers[e];if(!n){return}t=he.clampValue(t);if(n.stretch===t){return}n.stretch=t;if(this.parent){this.parent.update()}}columnStretch(e){let t=this._columnSizers[e];return t?t.stretch:-1}setColumnStretch(e,t){let n=this._columnSizers[e];if(!n){return}t=he.clampValue(t);if(n.stretch===t){return}n.stretch=t;if(this.parent){this.parent.update()}}*[Symbol.iterator](){for(const e of this._items){yield e.widget}}addWidget(e){let t=i.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e));if(t!==-1){return}this._items.push(new D(e));if(this.parent){this.attachWidget(e)}}removeWidget(e){let t=i.ArrayExt.findFirstIndex(this._items,(t=>t.widget===e));if(t===-1){return}let n=i.ArrayExt.removeAt(this._items,t);if(this.parent){this.detachWidget(e)}n.dispose()}init(){super.init();for(const e of this){this.attachWidget(e)}}attachWidget(e){if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.BeforeAttach)}this.parent.node.appendChild(e.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.AfterAttach)}this.parent.fit()}detachWidget(e){if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.BeforeDetach)}this.parent.node.removeChild(e.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(e,E.Msg.AfterDetach)}this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e);this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e);this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){if(this.parent.isVisible){this._update(e.width,e.height)}}onUpdateRequest(e){if(this.parent.isVisible){this._update(-1,-1)}}onFitRequest(e){if(this.parent.isAttached){this._fit()}}_fit(){for(let a=0,l=this.rowCount;a!e.isHidden));for(let a=0,l=e.length;a({row:0,column:0,rowSpan:1,columnSpan:1}),changed:a});function t(e){let t=Math.max(0,Math.floor(e.row||0));let n=Math.max(0,Math.floor(e.column||0));let i=Math.max(1,Math.floor(e.rowSpan||0));let s=Math.max(1,Math.floor(e.columnSpan||0));return{row:t,column:n,rowSpan:i,columnSpan:s}}e.normalizeConfig=t;function n(e){return Math.max(0,Math.floor(e))}e.clampValue=n;function i(t,n){let i=e.cellConfigProperty.get(t.widget);let s=e.cellConfigProperty.get(n.widget);return i.rowSpan-s.rowSpan}e.rowSpanCmp=i;function s(t,n){let i=e.cellConfigProperty.get(t.widget);let s=e.cellConfigProperty.get(n.widget);return i.columnSpan-s.columnSpan}e.columnSpanCmp=s;function o(e,t){t=Math.max(1,Math.floor(t));while(e.lengtht){e.length=t}}e.reallocSizers=o;function r(e,t,n,i){if(n=i){return}let o=(i-s)/(n-t+1);for(let r=t;r<=n;++r){e[r].minSize+=o}}e.distributeMin=r;function a(e){if(e.parent&&e.parent.layout instanceof ce){e.parent.fit()}}})(he||(he={}));class ue extends E{constructor(e={}){super({node:pe.createNode()});this._activeIndex=-1;this._tabFocusIndex=0;this._menus=[];this._childMenu=null;this._overflowMenu=null;this._menuItemSizes=[];this._overflowIndex=-1;this.addClass("lm-MenuBar");this.setFlag(E.Flag.DisallowLayout);this.renderer=e.renderer||ue.defaultRenderer;this._forceItemsPosition=e.forceItemsPosition||{forceX:true,forceY:true};this._overflowMenuOptions=e.overflowMenuOptions||{isVisible:true}}dispose(){this._closeChildMenu();this._menus.length=0;super.dispose()}get childMenu(){return this._childMenu}get overflowIndex(){return this._overflowIndex}get overflowMenu(){return this._overflowMenu}get contentNode(){return this.node.getElementsByClassName("lm-MenuBar-content")[0]}get activeMenu(){return this._menus[this._activeIndex]||null}set activeMenu(e){this.activeIndex=e?this._menus.indexOf(e):-1}get activeIndex(){return this._activeIndex}set activeIndex(e){if(e<0||e>=this._menus.length){e=-1}if(e>-1&&this._menus[e].items.length===0){e=-1}if(this._activeIndex===e){return}this._activeIndex=e;this.update()}get menus(){return this._menus}openActiveMenu(){if(this._activeIndex===-1){return}this._openChildMenu();if(this._childMenu){this._childMenu.activeIndex=-1;this._childMenu.activateNextItem()}}addMenu(e,t=true){this.insertMenu(this._menus.length,e,t)}insertMenu(e,t,n=true){this._closeChildMenu();let s=this._menus.indexOf(t);let o=Math.max(0,Math.min(e,this._menus.length));if(s===-1){i.ArrayExt.insert(this._menus,o,t);t.addClass("lm-MenuBar-menu");t.aboutToClose.connect(this._onMenuAboutToClose,this);t.menuRequested.connect(this._onMenuMenuRequested,this);t.title.changed.connect(this._onTitleChanged,this);if(n){this.update()}return}if(o===this._menus.length){o--}if(s===o){return}i.ArrayExt.move(this._menus,s,o);if(n){this.update()}}removeMenu(e,t=true){this.removeMenuAt(this._menus.indexOf(e),t)}removeMenuAt(e,t=true){this._closeChildMenu();let n=i.ArrayExt.removeAt(this._menus,e);if(!n){return}n.aboutToClose.disconnect(this._onMenuAboutToClose,this);n.menuRequested.disconnect(this._onMenuMenuRequested,this);n.title.changed.disconnect(this._onTitleChanged,this);n.removeClass("lm-MenuBar-menu");if(t){this.update()}}clearMenus(){if(this._menus.length===0){return}this._closeChildMenu();for(let e of this._menus){e.aboutToClose.disconnect(this._onMenuAboutToClose,this);e.menuRequested.disconnect(this._onMenuMenuRequested,this);e.title.changed.disconnect(this._onTitleChanged,this);e.removeClass("lm-MenuBar-menu")}this._menus.length=0;this.update()}handleEvent(e){switch(e.type){case"keydown":this._evtKeyDown(e);break;case"mousedown":this._evtMouseDown(e);break;case"mousemove":this._evtMouseMove(e);break;case"focusout":this._evtFocusOut(e);break;case"contextmenu":e.preventDefault();e.stopPropagation();break}}onBeforeAttach(e){this.node.addEventListener("keydown",this);this.node.addEventListener("mousedown",this);this.node.addEventListener("mousemove",this);this.node.addEventListener("focusout",this);this.node.addEventListener("contextmenu",this)}onAfterDetach(e){this.node.removeEventListener("keydown",this);this.node.removeEventListener("mousedown",this);this.node.removeEventListener("mousemove",this);this.node.removeEventListener("focusout",this);this.node.removeEventListener("contextmenu",this);this._closeChildMenu()}onActivateRequest(e){if(this.isAttached){this._focusItemAt(0)}}onResize(e){this.update();super.onResize(e)}onUpdateRequest(e){var t;let n=this._menus;let i=this.renderer;let s=this._activeIndex;let o=this._tabFocusIndex>=0&&this._tabFocusIndex-1?this._overflowIndex:n.length;let a=0;let l=false;r=this._overflowMenu!==null?r-1:r;let d=new Array(r);for(let c=0;c{this._tabFocusIndex=c;this.activeIndex=c}});a+=this._menuItemSizes[c];if(n[c].title.label===this._overflowMenuOptions.title){l=true;r--}}if(this._overflowMenuOptions.isVisible){if(this._overflowIndex>-1&&!l){if(this._overflowMenu===null){const e=(t=this._overflowMenuOptions.title)!==null&&t!==void 0?t:"...";this._overflowMenu=new Q({commands:new v.CommandRegistry});this._overflowMenu.title.label=e;this._overflowMenu.title.mnemonic=0;this.addMenu(this._overflowMenu,false)}for(let e=n.length-2;e>=r;e--){const t=this.menus[e];t.title.mnemonic=0;this._overflowMenu.insertItem(0,{type:"submenu",submenu:t});this.removeMenu(t,false)}d[r]=i.renderItem({title:this._overflowMenu.title,active:r===s&&n[r].items.length!==0,tabbable:r===o,disabled:n[r].items.length===0,onfocus:()=>{this._tabFocusIndex=r;this.activeIndex=r}});r++}else if(this._overflowMenu!==null){let e=this._overflowMenu.items;let t=this.node.offsetWidth;let s=this._overflowMenu.items.length;for(let l=0;lthis._menuItemSizes[s]){let t=e[0].submenu;this._overflowMenu.removeItemAt(0);this.insertMenu(r,t,false);d[r]=i.renderItem({title:t.title,active:false,tabbable:r===o,disabled:n[r].items.length===0,onfocus:()=>{this._tabFocusIndex=r;this.activeIndex=r}});r++}}if(this._overflowMenu.items.length===0){this.removeMenu(this._overflowMenu,false);d.pop();this._overflowMenu=null;this._overflowIndex=-1}}}b.VirtualDOM.render(d,this.contentNode);this._updateOverflowIndex()}_updateOverflowIndex(){if(!this._overflowMenuOptions.isVisible){return}const e=this.contentNode.childNodes;let t=this.node.offsetWidth;let n=0;let i=-1;let s=e.length;if(this._menuItemSizes.length==0){for(let o=0;ot&&i===-1){i=o}}}else{for(let e=0;et){i=e;break}}}this._overflowIndex=i}_evtKeyDown(e){let t=e.keyCode;if(t===9){this.activeIndex=-1;return}e.preventDefault();e.stopPropagation();if(t===13||t===32||t===38||t===40){this.activeIndex=this._tabFocusIndex;if(this.activeIndex!==this._tabFocusIndex){return}this.openActiveMenu();return}if(t===27){this._closeChildMenu();this._focusItemAt(this.activeIndex);return}if(t===37||t===39){let e=t===37?-1:1;let n=this._tabFocusIndex+e;let i=this._menus.length;for(let t=0;ta.ElementExt.hitTest(t,e.clientX,e.clientY)));if(t===-1){this._closeChildMenu();return}if(e.button!==0){return}if(this._childMenu){this._closeChildMenu();this.activeIndex=t}else{e.preventDefault();const n=this._positionForMenu(t);Q.saveWindowData();this.activeIndex=t;this._openChildMenu(n)}}_evtMouseMove(e){let t=i.ArrayExt.findFirstIndex(this.contentNode.children,(t=>a.ElementExt.hitTest(t,e.clientX,e.clientY)));if(t===this._activeIndex){return}if(t===-1&&this._childMenu){return}const n=t>=0&&this._childMenu?this._positionForMenu(t):null;Q.saveWindowData();this.activeIndex=t;if(n){this._openChildMenu(n)}}_positionForMenu(e){let t=this.contentNode.children[e];let{left:n,bottom:i}=t.getBoundingClientRect();return{top:i,left:n}}_evtFocusOut(e){if(!this._childMenu&&!this.node.contains(e.relatedTarget)){this.activeIndex=-1}}_focusItemAt(e){const t=this.contentNode.childNodes[e];if(t){t.focus()}}_openChildMenu(e={}){let t=this.activeMenu;if(!t){this._closeChildMenu();return}let n=this._childMenu;if(n===t){return}this._childMenu=t;if(n){n.close()}else{document.addEventListener("mousedown",this,true)}this._tabFocusIndex=this.activeIndex;d.MessageLoop.sendMessage(this,E.Msg.UpdateRequest);let{left:i,top:s}=e;if(typeof i==="undefined"||typeof s==="undefined"){({left:i,top:s}=this._positionForMenu(this._activeIndex))}if(!n){this.addClass("lm-mod-active")}if(t.items.length>0){t.open(i,s,this._forceItemsPosition)}}_closeChildMenu(){if(!this._childMenu){return}this.removeClass("lm-mod-active");document.removeEventListener("mousedown",this,true);let e=this._childMenu;this._childMenu=null;e.close();this.activeIndex=-1}_onMenuAboutToClose(e){if(e!==this._childMenu){return}this.removeClass("lm-mod-active");document.removeEventListener("mousedown",this,true);this._childMenu=null;this.activeIndex=-1}_onMenuMenuRequested(e,t){if(e!==this._childMenu){return}let n=this._activeIndex;let i=this._menus.length;switch(t){case"next":this.activeIndex=n===i-1?0:n+1;break;case"previous":this.activeIndex=n===0?i-1:n-1;break}this.openActiveMenu()}_onTitleChanged(){this.update()}}(function(e){class t{renderItem(e){let t=this.createItemClass(e);let n=this.createItemDataset(e);let i=this.createItemARIA(e);return b.h.li({className:t,dataset:n,...e.disabled?{}:{tabindex:e.tabbable?"0":"-1"},onfocus:e.onfocus,...i},this.renderIcon(e),this.renderLabel(e))}renderIcon(e){let t=this.createIconClass(e);return b.h.div({className:t},e.title.icon,e.title.iconLabel)}renderLabel(e){let t=this.formatLabel(e);return b.h.div({className:"lm-MenuBar-itemLabel"},t)}createItemClass(e){let t="lm-MenuBar-item";if(e.title.className){t+=` ${e.title.className}`}if(e.active&&!e.disabled){t+=" lm-mod-active"}return t}createItemDataset(e){return e.title.dataset}createItemARIA(e){return{role:"menuitem","aria-haspopup":"true","aria-disabled":e.disabled?"true":"false"}}createIconClass(e){let t="lm-MenuBar-itemIcon";let n=e.title.iconClass;return n?`${t} ${n}`:t}formatLabel(e){let{label:t,mnemonic:n}=e.title;if(n<0||n>=t.length){return t}let i=t.slice(0,n);let s=t.slice(n+1);let o=t[n];let r=b.h.span({className:"lm-MenuBar-itemMnemonic"},o);return[i,r,s]}}e.Renderer=t;e.defaultRenderer=new t})(ue||(ue={}));var pe;(function(e){function t(){let e=document.createElement("div");let t=document.createElement("ul");t.className="lm-MenuBar-content";e.appendChild(t);t.setAttribute("role","menubar");return e}e.createNode=t;function n(e,t,n){let i=-1;let s=-1;let o=false;let r=t.toUpperCase();for(let a=0,l=e.length;a=0&&c{this._repeatTimer=-1;if(!this._pressData){return}let e=this._pressData.part;if(e==="thumb"){return}this._repeatTimer=window.setTimeout(this._onRepeat,20);let t=this._pressData.mouseX;let n=this._pressData.mouseY;if(e==="decrement"){if(!a.ElementExt.hitTest(this.decrementNode,t,n)){return}this._stepRequested.emit("decrement");return}if(e==="increment"){if(!a.ElementExt.hitTest(this.incrementNode,t,n)){return}this._stepRequested.emit("increment");return}if(e==="track"){if(!a.ElementExt.hitTest(this.trackNode,t,n)){return}let e=this.thumbNode;if(a.ElementExt.hitTest(e,t,n)){return}let i=e.getBoundingClientRect();let s;if(this._orientation==="horizontal"){s=t1){this.widgets.forEach((e=>{e.hiddenMode=this._hiddenMode}))}}dispose(){for(const e of this._items){e.dispose()}this._box=null;this._items.length=0;super.dispose()}attachWidget(e,t){if(this._hiddenMode===E.HiddenMode.Scale&&this._items.length>0){if(this._items.length===1){this.widgets[0].hiddenMode=E.HiddenMode.Scale}t.hiddenMode=E.HiddenMode.Scale}else{t.hiddenMode=E.HiddenMode.Display}i.ArrayExt.insert(this._items,e,new D(t));if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeAttach)}this.parent.node.appendChild(t.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterAttach)}this.parent.fit()}moveWidget(e,t,n){i.ArrayExt.move(this._items,e,t);this.parent.update()}detachWidget(e,t){let n=i.ArrayExt.removeAt(this._items,e);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.BeforeDetach)}this.parent.node.removeChild(t.node);if(this.parent.isAttached){d.MessageLoop.sendMessage(t,E.Msg.AfterDetach)}n.widget.node.style.zIndex="";if(this._hiddenMode===E.HiddenMode.Scale){t.hiddenMode=E.HiddenMode.Display;if(this._items.length===1){this._items[0].widget.hiddenMode=E.HiddenMode.Display}}n.dispose();this.parent.fit()}onBeforeShow(e){super.onBeforeShow(e);this.parent.update()}onBeforeAttach(e){super.onBeforeAttach(e);this.parent.fit()}onChildShown(e){this.parent.fit()}onChildHidden(e){this.parent.fit()}onResize(e){if(this.parent.isVisible){this._update(e.width,e.height)}}onUpdateRequest(e){if(this.parent.isVisible){this._update(-1,-1)}}onFitRequest(e){if(this.parent.isAttached){this._fit()}}_fit(){let e=0;let t=0;for(let s=0,o=this._items.length;s{"use strict";var i=n(85072);var s=n.n(i);var o=n(97825);var r=n.n(o);var a=n(77659);var l=n.n(a);var d=n(55056);var c=n.n(d);var h=n(10540);var u=n.n(h);var p=n(41113);var m=n.n(p);var g=n(43210);var f={};f.styleTagTransform=m();f.setAttributes=c();f.insert=l().bind(null,"head");f.domAPI=r();f.insertStyleElement=u();var v=s()(g.A,f);const _=g.A&&g.A.locals?g.A.locals:undefined},24118:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n|\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n#jp-MainLogo {\n width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));\n}\n\n#jp-top-bar {\n --jp-private-toolbar-height: var(--jp-private-menu-panel-height);\n\n flex: 1 1 auto;\n padding: 0 2px;\n box-shadow: none;\n border: none;\n align-items: center;\n}\n",""]);const l=a},30966:(e,t,n)=>{"use strict";n.d(t,{A:()=>_});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(14016);var l=n(5173);var d=n(51632);var c=n(60341);var h=n(10891);var u=n(83161);var p=n(68010);var m=n(40348);var g=n(43701);var f=n(93768);var v=r()(s());v.i(a.A);v.i(l.A);v.i(d.A);v.i(c.A);v.i(h.A);v.i(u.A);v.i(p.A);v.i(m.A);v.i(g.A);v.i(f.A);v.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Sibling imports */\n",""]);const _=v},68010:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-flat-button-height: 24px;\n --jp-flat-button-padding: 8px 12px;\n}\n\n/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-ThemedContainer button {\n border-radius: var(--jp-border-radius);\n}\n\n.jp-ThemedContainer button:focus-visible {\n outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));\n outline-offset: -1px;\n}\n\nbutton.jp-mod-styled.jp-mod-accept {\n background: var(--jp-accept-color-normal, var(--md-blue-500, #2196f3));\n border: 0;\n color: white;\n}\n\nbutton.jp-mod-styled.jp-mod-accept:hover {\n background: var(--jp-accept-color-hover, var(--md-blue-600, #1e88e5));\n}\n\nbutton.jp-mod-styled.jp-mod-accept:active {\n background: var(--jp-accept-color-active, var(--md-blue-700, #1976d2));\n}\n\nbutton.jp-mod-styled.jp-mod-accept:focus-visible {\n outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));\n}\n\nbutton.jp-mod-styled.jp-mod-reject {\n background: var(--jp-reject-color-normal, var(--md-grey-500, #9e9e9e));\n border: 0;\n color: white;\n}\n\nbutton.jp-mod-styled.jp-mod-reject:hover {\n background: var(--jp-reject-color-hover, var(--md-grey-600, #757575));\n}\n\nbutton.jp-mod-styled.jp-mod-reject:active {\n background: var(--jp-reject-color-active, var(--md-grey-700, #616161));\n}\n\nbutton.jp-mod-styled.jp-mod-reject:focus-visible {\n outline: 1px solid var(--jp-reject-color-active, var(--md-grey-700, #616161));\n}\n\nbutton.jp-mod-styled.jp-mod-warn {\n background: var(--jp-warn-color-normal, var(--jp-error-color1));\n border: 0;\n color: white;\n}\n\nbutton.jp-mod-styled.jp-mod-warn:hover {\n background: var(--jp-warn-color-hover, var(--md-red-600, #e53935));\n}\n\nbutton.jp-mod-styled.jp-mod-warn:active {\n background: var(--jp-warn-color-active, var(--md-red-700, #d32f2f));\n}\n\nbutton.jp-mod-styled.jp-mod-warn:focus-visible {\n outline: 1px solid var(--jp-warn-color-active, var(--md-red-700, #d32f2f));\n}\n\n.jp-Button-flat {\n text-decoration: none;\n padding: var(--jp-flat-button-padding);\n font-weight: 500;\n background-color: transparent;\n height: var(--jp-private-running-shutdown-button-height);\n line-height: var(--jp-private-running-shutdown-button-height);\n transition: background-color 0.1s ease;\n border-radius: 2px;\n}\n\n.jp-Button-flat:focus {\n border: none;\n box-shadow: none;\n}\n",""]);const l=a},14016:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-menu-panel-height: 27px;\n}\n\n.lm-Widget.lm-mod-hidden {\n display: none !important;\n}\n\n.jp-ThemedContainer {\n font-family: var(--jp-ui-font-family);\n background: var(--jp-layout-color3);\n margin: 0;\n padding: 0;\n overflow: hidden;\n}\n\n.jp-LabShell {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n}\n\n.jp-LabShell.jp-mod-devMode {\n border-top: 4px solid red;\n}\n\n#jp-main-dock-panel {\n padding: 5px;\n}\n\n#jp-main-dock-panel[data-mode='single-document'] {\n padding: 0;\n}\n\n#jp-main-dock-panel[data-mode='single-document'] .jp-MainAreaWidget {\n border: none;\n}\n\n#jp-top-panel {\n border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n background: var(--jp-layout-color1);\n display: flex;\n min-height: var(--jp-private-menubar-height);\n overflow: visible;\n\n /* relax lumino strict CSS contaiment to allow painting the menu bar item\n over the menu in order to create an illusion of partial border */\n contain: style size !important;\n}\n\n#jp-menu-panel {\n min-height: var(--jp-private-menu-panel-height);\n background: var(--jp-layout-color1);\n}\n\n#jp-down-stack {\n border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.jp-LabShell[data-shell-mode='single-document'] #jp-top-panel {\n border-bottom: none;\n}\n\n.jp-LabShell[data-shell-mode='single-document'] #jp-menu-panel {\n padding-left: calc(\n var(--jp-private-sidebar-tab-width) + var(--jp-border-width)\n );\n border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n\n /* Adjust min-height so open menus show up in the right place */\n min-height: calc(\n var(--jp-private-menu-panel-height) + var(--jp-border-width)\n );\n}\n\n#jp-bottom-panel {\n background: var(--jp-layout-color1);\n display: flex;\n}\n\n#jp-single-document-mode {\n margin: 0 8px;\n display: flex;\n align-items: center;\n}\n",""]);const l=a},5173:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.lm-DataGrid {\n min-width: 64px;\n min-height: 64px;\n border: 1px solid #a0a0a0;\n}\n\n.lm-DataGrid-scrollCorner {\n background-color: #f0f0f0;\n}\n\n.lm-DataGrid-scrollCorner::after {\n content: '';\n position: absolute;\n top: 0;\n left: 0;\n width: 1px;\n height: 1px;\n background-color: #a0a0a0;\n}\n",""]);const l=a},51632:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| DockPanel\n|----------------------------------------------------------------------------*/\n\n.lm-DockPanel-widget,\n.lm-TabPanel-stackedPanel {\n background: var(--jp-layout-color0);\n border-left: var(--jp-border-width) solid var(--jp-border-color1);\n border-right: var(--jp-border-width) solid var(--jp-border-color1);\n border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.lm-DockPanel-overlay {\n background: rgba(33, 150, 243, 0.1);\n border: var(--jp-border-width) dashed var(--jp-brand-color1);\n transition-property: top, left, right, bottom;\n transition-duration: 150ms;\n transition-timing-function: ease;\n}\n\n.lm-DockPanel-overlay.lm-mod-root-top,\n.lm-DockPanel-overlay.lm-mod-root-left,\n.lm-DockPanel-overlay.lm-mod-root-right,\n.lm-DockPanel-overlay.lm-mod-root-bottom,\n.lm-DockPanel-overlay.lm-mod-root-center {\n border-width: 2px;\n}\n",""]);const l=a},60341:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-menubar-height: 28px;\n --jp-private-menu-item-height: 24px;\n}\n\n/*-----------------------------------------------------------------------------\n| MenuBar\n|----------------------------------------------------------------------------*/\n\n.lm-MenuBar {\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n font-size: var(--jp-ui-font-size1);\n overflow: hidden;\n}\n\n.lm-MenuBar:hover {\n overflow-x: auto;\n}\n\n.lm-MenuBar-menu.jp-ThemedContainer {\n top: calc(-2 * var(--jp-border-width));\n scrollbar-width: none;\n -ms-overflow-style: none;\n overflow: auto;\n background:\n linear-gradient(var(--jp-layout-color0) 30%, rgba(0, 0, 0, 0)) center top,\n linear-gradient(rgba(0, 0, 0, 0), var(--jp-layout-color0) 70%) center bottom,\n radial-gradient(\n farthest-side at 50% 0,\n color-mix(\n in hsl,\n var(--jp-layout-color0) 50%,\n var(--jp-inverse-layout-color0) 30%\n ),\n rgba(0, 0, 0, 0)\n )\n center top,\n radial-gradient(\n farthest-side at 50% 100%,\n color-mix(\n in hsl,\n var(--jp-layout-color0) 50%,\n var(--jp-inverse-layout-color0) 30%\n ),\n rgba(0, 0, 0, 0)\n )\n center bottom;\n background-color: var(--jp-layout-color0);\n background-repeat: no-repeat;\n background-size:\n 100% 40px,\n 100% 40px,\n 100% 14px,\n 100% 14px;\n background-attachment: local, local, scroll, scroll;\n}\n\n.lm-MenuBar-menu.jp-ThemedContainer::-webkit-scrollbar {\n display: none;\n}\n\n.lm-MenuBar-item {\n padding: 0 8px;\n border-left: var(--jp-border-width) solid transparent;\n border-right: var(--jp-border-width) solid transparent;\n border-top: var(--jp-border-width) solid transparent;\n line-height: calc(\n var(--jp-private-menubar-height) - var(--jp-border-width) * 2\n );\n}\n\n.lm-MenuBar-content:focus-visible {\n outline-offset: -3px; /* this value is a compromise between Firefox, Chrome,\n and Safari over this outline's visibility and discretion */\n}\n\n.lm-MenuBar:focus-visible {\n outline: 1px solid var(--jp-accept-color-active, var(--jp-brand-color1));\n outline-offset: -1px;\n}\n\n.lm-MenuBar-menu:focus-visible,\n.lm-MenuBar-item:focus-visible,\n.lm-Menu-item:focus-visible {\n outline: unset;\n outline-offset: unset;\n -moz-outline-radius: unset;\n}\n\n.lm-MenuBar-item.lm-mod-active {\n background: var(--jp-layout-color2);\n}\n\n.lm-MenuBar.lm-mod-active .lm-MenuBar-item.lm-mod-active {\n z-index: 10001;\n background: var(--jp-layout-color0);\n color: var(--jp-ui-font-color0);\n border-left: var(--jp-border-width) solid var(--jp-border-color1);\n border-right: var(--jp-border-width) solid var(--jp-border-color1);\n box-shadow: var(--jp-elevation-z6);\n}\n\n/* stylelint-disable-next-line selector-max-class */\n.jp-LabShell[data-shell-mode='single-document']\n .lm-MenuBar.lm-mod-active\n .lm-MenuBar-item.lm-mod-active {\n border-top: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.lm-MenuBar-item.lm-mod-disabled {\n color: var(--jp-ui-font-color3);\n}\n\n.lm-MenuBar-item.lm-type-separator {\n margin: 2px;\n padding: 0;\n border: none;\n border-left: var(--jp-border-width) solid var(--jp-border-color2);\n}\n\n.lm-MenuBar-itemMnemonic {\n text-decoration: underline;\n}\n\n/*-----------------------------------------------------------------------------\n| Menu\n|----------------------------------------------------------------------------*/\n\n.lm-Menu {\n z-index: 10000;\n padding: 4px 0;\n background: var(--jp-layout-color0);\n color: var(--jp-ui-font-color0);\n border: var(--jp-border-width) solid var(--jp-border-color1);\n font-size: var(--jp-ui-font-size1);\n box-shadow: var(--jp-elevation-z6);\n}\n\n.lm-Menu-item {\n min-height: var(--jp-private-menu-item-height);\n max-height: var(--jp-private-menu-item-height);\n padding: 0;\n line-height: var(--jp-private-menu-item-height);\n}\n\n.lm-Menu-item.lm-mod-active {\n background: var(--jp-layout-color2);\n}\n\n.lm-Menu-item.lm-mod-disabled {\n color: var(--jp-ui-font-color3);\n}\n\n.lm-Menu-itemIcon {\n width: 21px;\n padding: 0 2px 0 4px;\n margin-top: -2px;\n}\n\n.lm-Menu-itemLabel {\n padding: 0 32px 0 2px;\n}\n\n.lm-Menu-itemMnemonic {\n text-decoration: underline;\n}\n\n.lm-Menu-itemShortcut {\n padding: 0;\n}\n\n.lm-Menu-itemSubmenuIcon {\n width: 18px;\n padding: 0 4px 0 0;\n}\n\n.lm-Menu-item[data-type='separator'] > div {\n padding: 0;\n height: 9px;\n}\n\n.lm-Menu-item[data-type='separator'] > div::after {\n content: '';\n display: block;\n position: relative;\n top: 4px;\n border-top: var(--jp-border-width) solid var(--jp-layout-color2);\n mix-blend-mode: multiply;\n}\n\n/* gray out icon/caret for disabled menu items */\n.lm-Menu-item.lm-mod-disabled > .lm-Menu-itemIcon,\n.lm-Menu-item[data-type='submenu'].lm-mod-disabled > .lm-Menu-itemSubmenuIcon {\n opacity: 0.4;\n}\n",""]);const l=a},10891:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*\n * Mozilla scrollbar styling\n */\n\n/* use standard opaque scrollbars for most nodes */\n[data-jp-theme-scrollbars='true'] {\n scrollbar-color: rgb(var(--jp-scrollbar-thumb-color))\n var(--jp-scrollbar-background-color);\n}\n\n/* for code nodes, use a transparent style of scrollbar. These selectors\n * will match lower in the tree, and so will override the above */\n[data-jp-theme-scrollbars='true'] .CodeMirror-hscrollbar,\n[data-jp-theme-scrollbars='true'] .CodeMirror-vscrollbar {\n scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;\n}\n\n/* tiny scrollbar */\n\n.jp-scrollbar-tiny {\n scrollbar-color: rgba(var(--jp-scrollbar-thumb-color), 0.5) transparent;\n scrollbar-width: thin;\n}\n\n/* tiny scrollbar */\n\n.jp-scrollbar-tiny::-webkit-scrollbar,\n.jp-scrollbar-tiny::-webkit-scrollbar-corner {\n background-color: transparent;\n height: 4px;\n width: 4px;\n}\n\n.jp-scrollbar-tiny::-webkit-scrollbar-thumb {\n background: rgba(var(--jp-scrollbar-thumb-color), 0.5);\n}\n\n.jp-scrollbar-tiny::-webkit-scrollbar-track:horizontal {\n border-left: 0 solid transparent;\n border-right: 0 solid transparent;\n}\n\n.jp-scrollbar-tiny::-webkit-scrollbar-track:vertical {\n border-top: 0 solid transparent;\n border-bottom: 0 solid transparent;\n}\n\n/*\n * Lumino\n */\n\n.lm-ScrollBar[data-orientation='horizontal'] {\n min-height: 16px;\n max-height: 16px;\n min-width: 45px;\n border-top: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='vertical'] {\n min-width: 16px;\n max-width: 16px;\n min-height: 45px;\n border-left: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar-button {\n background-color: #f0f0f0;\n background-position: center center;\n min-height: 15px;\n max-height: 15px;\n min-width: 15px;\n max-width: 15px;\n}\n\n.lm-ScrollBar-button:hover {\n background-color: #dadada;\n}\n\n.lm-ScrollBar-button.lm-mod-active {\n background-color: #cdcdcd;\n}\n\n.lm-ScrollBar-track {\n background: #f0f0f0;\n}\n\n.lm-ScrollBar-thumb {\n background: #cdcdcd;\n}\n\n.lm-ScrollBar-thumb:hover {\n background: #bababa;\n}\n\n.lm-ScrollBar-thumb.lm-mod-active {\n background: #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='horizontal'] .lm-ScrollBar-thumb {\n height: 100%;\n min-width: 15px;\n border-left: 1px solid #a0a0a0;\n border-right: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='vertical'] .lm-ScrollBar-thumb {\n width: 100%;\n min-height: 15px;\n border-top: 1px solid #a0a0a0;\n border-bottom: 1px solid #a0a0a0;\n}\n\n.lm-ScrollBar[data-orientation='horizontal']\n .lm-ScrollBar-button[data-action='decrement'] {\n background-image: var(--jp-icon-caret-left);\n background-size: 17px;\n}\n\n.lm-ScrollBar[data-orientation='horizontal']\n .lm-ScrollBar-button[data-action='increment'] {\n background-image: var(--jp-icon-caret-right);\n background-size: 17px;\n}\n\n.lm-ScrollBar[data-orientation='vertical']\n .lm-ScrollBar-button[data-action='decrement'] {\n background-image: var(--jp-icon-caret-up);\n background-size: 17px;\n}\n\n.lm-ScrollBar[data-orientation='vertical']\n .lm-ScrollBar-button[data-action='increment'] {\n background-image: var(--jp-icon-caret-down);\n background-size: 17px;\n}\n",""]);const l=a},40348:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-sidebar-tab-width: 32px;\n}\n\n/*-----------------------------------------------------------------------------\n| SideBar\n|----------------------------------------------------------------------------*/\n\n.jp-SideBar {\n /* This is needed so that all font sizing of children done in ems is\n * relative to this base size */\n font-size: var(--jp-ui-font-size1);\n}\n\n.jp-SideBar.lm-TabBar,\n#jp-down-stack .lm-TabBar {\n color: var(--jp-ui-font-color2);\n background: var(--jp-layout-color2);\n font-size: var(--jp-ui-font-size1);\n overflow: visible;\n}\n\n.jp-SideBar.lm-TabBar {\n min-width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));\n max-width: calc(var(--jp-private-sidebar-tab-width) + var(--jp-border-width));\n display: block;\n}\n\n.jp-SideBar .lm-TabBar-content {\n margin: 0;\n padding: 0;\n display: flex;\n align-items: stretch;\n list-style-type: none;\n height: var(--jp-private-sidebar-tab-width);\n}\n\n.jp-SideBar .lm-TabBar-tab {\n padding: 16px 0;\n border: none;\n overflow: visible;\n flex-direction: column;\n position: relative;\n}\n\n.jp-SideBar .lm-TabBar-tab:focus-visible {\n /* --accent-fill-focus is computed by the jp toolkit to ensure accessibility */\n outline: 2px solid var(--accent-fill-focus, var(--jp-brand-color1));\n outline-offset: -3px;\n}\n\n.jp-SideBar .lm-TabBar-tab.lm-mod-current::after {\n /* Internal border override pseudo-element */\n position: absolute;\n content: '';\n bottom: 0;\n right: 0;\n top: 0;\n left: 0;\n border: var(--jp-border-width) solid var(--jp-layout-color1);\n}\n\n.jp-SideBar .lm-TabBar-tab:not(.lm-mod-current),\n#jp-down-stack .lm-TabBar-tab:not(.lm-mod-current) {\n background: var(--jp-layout-color2);\n}\n\n.jp-SideBar .lm-TabBar-tabIcon.jp-SideBar-tabIcon {\n min-width: 20px;\n min-height: 20px;\n background-size: 20px;\n display: inline-block;\n vertical-align: middle;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.jp-SideBar .lm-TabBar-tabLabel {\n line-height: var(--jp-private-sidebar-tab-width);\n}\n\n.jp-SideBar .lm-TabBar-tab:hover:not(.lm-mod-current),\n#jp-down-stack .lm-TabBar-tab:hover:not(.lm-mod-current) {\n background: var(--jp-layout-color1);\n}\n\n.jp-SideBar.lm-TabBar::after {\n /* Internal border pseudo-element */\n position: absolute;\n content: '';\n bottom: 0;\n right: 0;\n top: 0;\n left: 0;\n pointer-events: none;\n}\n\n/* Borders */\n\n/* stylelint-disable selector-max-class */\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab + .lm-TabBar-tab {\n border-top: var(--jp-border-width) solid var(--jp-layout-color2);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab.lm-mod-current + .lm-TabBar-tab {\n border-top: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab + .lm-TabBar-tab.lm-mod-current {\n border-top: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tab.lm-mod-current:last-child {\n border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n.jp-SideBar.lm-TabBar .lm-TabBar-tabLabel {\n writing-mode: vertical-rl;\n}\n\n/* Left */\n\n/* Borders */\n\n.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-content {\n /* Internal border spacing */\n margin-right: var(--jp-border-width);\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-tab.lm-mod-current::after {\n /* Internal border override */\n right: calc(-1 * var(--jp-border-width));\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-left::after {\n /* Internal border */\n border-right: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n/* Transforms */\n\n.jp-SideBar.lm-TabBar.jp-mod-left .lm-TabBar-tabLabel {\n transform: rotate(180deg);\n}\n\n/* Right */\n\n/* Borders */\n\n.jp-SideBar.lm-TabBar.jp-mod-right .lm-TabBar-content {\n /* Internal border spacing */\n margin-left: var(--jp-border-width);\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-right .lm-TabBar-tab.lm-mod-current::after {\n /* Internal border override */\n left: calc(-1 * var(--jp-border-width));\n}\n\n.jp-SideBar.lm-TabBar.jp-mod-right::after {\n /* Internal border */\n border-left: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n/* Down */\n\n/* Borders */\n\n#jp-down-stack > .lm-TabBar {\n border-top: var(--jp-border-width) solid var(--jp-border-color0);\n border-bottom: var(--jp-border-width) solid var(--jp-border-color0);\n}\n\n#jp-down-stack > .lm-TabBar .lm-TabBar-tab {\n border-left: none;\n border-right: none;\n}\n\n#jp-down-stack > .lm-TabBar .lm-TabBar-tab.lm-mod-current {\n border: var(--jp-border-width) solid var(--jp-border-color1);\n border-bottom: none;\n transform: translateY(var(--jp-border-width));\n}\n\n#jp-down-stack > .lm-TabBar .lm-TabBar-tab.lm-mod-current:first-child {\n border: none;\n border-right: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n/* stylelint-enable selector-max-class */\n\n/* Stack panels */\n\n#jp-left-stack > .lm-Widget,\n#jp-right-stack > .lm-Widget {\n min-width: var(--jp-sidebar-min-width);\n background-color: var(--jp-layout-color1);\n}\n\n#jp-right-stack {\n border-left: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n#jp-left-stack {\n border-right: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n#jp-down-stack > .lm-TabPanel-stackedPanel {\n border: none;\n}\n",""]);const l=a},93768:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n|\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-skiplink-wrapper {\n overflow: visible;\n\n /* override strict containment added via Lumino PR\n [#506](https://github.com/jupyterlab/lumino/pull/506) */\n contain: size style !important;\n}\n\n.jp-skiplink {\n position: absolute;\n top: -100em;\n}\n\n.jp-skiplink:focus-within {\n position: absolute;\n z-index: 10000;\n top: 0;\n left: 46%;\n margin: 0 auto;\n padding: 1em;\n width: 15%;\n box-shadow: var(--jp-elevation-z4);\n border-radius: 4px;\n background: var(--jp-layout-color0);\n text-align: center;\n}\n\n.jp-skiplink:focus-within a {\n text-decoration: underline;\n color: var(--jp-content-link-color);\n}\n",""]);const l=a},83161:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n /* These need to be root because tabs get attached to the body during dragging. */\n --jp-private-horizontal-tab-height: 24px;\n --jp-private-horizontal-tab-width: 216px;\n --jp-private-horizontal-tab-active-top-border: 2px;\n}\n\n/*-----------------------------------------------------------------------------\n| Tabs in the dock panel\n|----------------------------------------------------------------------------*/\n\n.lm-DockPanel-tabBar,\n.lm-TabPanel-tabBar {\n overflow: visible;\n color: var(--jp-ui-font-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n.lm-DockPanel-tabBar[data-orientation='horizontal'],\n.lm-TabPanel-tabBar[data-orientation='horizontal'] {\n min-height: calc(\n var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)\n );\n}\n\n.lm-DockPanel-tabBar[data-orientation='vertical'] {\n min-width: 80px;\n}\n\n.lm-DockPanel-tabBar > .lm-TabBar-content,\n.lm-TabPanel-tabBar > .lm-TabBar-content {\n align-items: flex-end;\n min-width: 0;\n min-height: 0;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab,\n.lm-TabPanel-tabBar .lm-TabBar-tab {\n flex: 0 1 var(--jp-private-horizontal-tab-width);\n align-items: center;\n min-height: calc(\n var(--jp-private-horizontal-tab-height) + 2 * var(--jp-border-width)\n );\n min-width: 0;\n margin-left: calc(-1 * var(--jp-border-width));\n line-height: var(--jp-private-horizontal-tab-height);\n padding: 0 8px;\n background: var(--jp-layout-color2);\n border: var(--jp-border-width) solid var(--jp-border-color1);\n border-bottom: none;\n position: relative;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:focus-visible,\n.lm-DockPanel-tabBar .lm-TabBar-addButton:focus-visible,\n.lm-TabPanel-tabBar .lm-TabBar-tab:focus-visible {\n border: 1px solid var(--accent-fill-focus);\n border-bottom: none;\n\n /* Thicken the border by 1px within the element border */\n box-shadow: 0 0 0 1px inset var(--accent-fill-focus);\n outline: none;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current):focus-visible::after,\n.lm-TabPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current):focus-visible::after {\n border-bottom-color: var(--accent-fill-focus);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:hover:not(.lm-mod-current),\n.lm-TabPanel-tabBar .lm-TabBar-tab:hover:not(.lm-mod-current) {\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:not(.lm-mod-current)::after,\n.lm-DockPanel-tabBar .lm-TabBar-addButton::after {\n position: absolute;\n content: '';\n bottom: 0;\n left: calc(-1 * var(--jp-border-width));\n width: calc(100% + 2 * var(--jp-border-width));\n border-bottom: var(--jp-border-width) solid var(--jp-border-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab:first-child,\n.lm-TabPanel-tabBar .lm-TabBar-tab:first-child {\n margin-left: 0;\n}\n\n/* This is a current tab of a tab bar in the dock panel: each tab bar has 1. */\n.lm-DockPanel-tabBar .lm-TabBar-tab.lm-mod-current {\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.lm-TabPanel-tabBar .lm-TabBar-tab.lm-mod-current {\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n}\n\n/* This is the main application level current tab: only 1 exists. */\n.lm-DockPanel-tabBar .lm-TabBar-tab.jp-mod-current::before {\n position: absolute;\n top: calc(-1 * var(--jp-border-width) + 1px);\n left: calc(-1 * var(--jp-border-width));\n content: '';\n height: var(--jp-private-horizontal-tab-active-top-border);\n width: calc(100% + 2 * var(--jp-border-width));\n background: var(--jp-brand-color1);\n}\n\n/* This is the left tab bar current tab: only 1 exists. */\n.lm-TabBar-tab.lm-mod-current {\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab,\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab {\n flex: 0 1 40px;\n margin-top: -1px;\n line-height: 40px;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab {\n border-right: none;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab {\n border-left: none;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab:first-child,\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab:first-child {\n margin-top: 0;\n}\n\n/* stylelint-disable selector-max-class */\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-left .lm-TabBar-tab.lm-mod-current,\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab.lm-mod-current {\n min-width: 80px;\n max-width: 80px;\n}\n\n.lm-DockPanel-tabBar .lm-TabBar.lm-mod-right .lm-TabBar-tab.lm-mod-current {\n transform: translateX(-1px);\n}\n\n.lm-DockPanel-tabBar .lm-TabBar-tab .lm-TabBar-tabIcon,\n.lm-TabBar-tab.lm-mod-drag-image .lm-TabBar-tabIcon,\n.lm-TabPanel-tabBar .lm-TabBar-tab .lm-TabBar-tabIcon {\n width: 14px;\n background-position: left center;\n background-repeat: no-repeat;\n background-size: 14px;\n margin-right: 4px;\n}\n\n/* stylelint-enable selector-max-class */\n\n.lm-TabBar-tab.lm-mod-drag-image {\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n border: var(--jp-border-width) solid var(--jp-border-color1);\n border-top: var(--jp-border-width) solid var(--jp-brand-color1);\n box-shadow: var(--jp-elevation-z4);\n font-size: var(--jp-ui-font-size1);\n line-height: var(--jp-private-horizontal-tab-height);\n min-height: var(--jp-private-horizontal-tab-height);\n min-width: var(--jp-private-horizontal-tab-width);\n padding: 0 10px;\n transform: translateX(-40%) translateY(-58%);\n}\n",""]);const l=a},43701:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-title-panel-height: 28px;\n}\n\n#jp-title-panel {\n min-height: var(--jp-private-title-panel-height);\n width: 100%;\n display: flex;\n background: var(--jp-layout-color1);\n}\n\n#jp-title-panel-title {\n flex: 1 1 auto;\n margin-left: 8px;\n}\n\n#jp-title-panel-title input {\n background: transparent;\n margin: 0;\n height: 28px;\n width: 100%;\n box-sizing: border-box;\n border: none;\n font-size: 18px;\n font-weight: normal;\n font-family: var(--jp-ui-font-family);\n line-height: var(--jp-private-title-panel-height);\n color: var(--jp-ui-font-color0);\n outline: none;\n appearance: none;\n -webkit-appearance: none;\n -moz-appearance: none;\n}\n",""]);const l=a},61510:(e,t,n)=>{"use strict";n.d(t,{A:()=>h});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(7924);var l=n(97980);var d=n(1165);var c=r()(s());c.i(a.A);c.i(l.A);c.i(d.A);c.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n",""]);const h=c},1165:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n:root {\n --jp-private-shortcuts-key-padding-horizontal: 0.47em;\n --jp-private-shortcuts-key-padding-vertical: 0.28em;\n --jp-private-shortcuts-label-padding-horizontal: 0.47em;\n}\n\n.jp-ContextualShortcut-TableRow {\n font-size: var(--jp-ui-font-size1);\n font-family: var(--jp-ui-font-family);\n}\n\n.jp-ContextualShortcut-TableItem {\n margin-left: auto;\n margin-right: auto;\n color: var(--jp-inverse-layout-color0);\n font-size: var(--jp-ui-font-size1);\n line-height: 2em;\n padding-right: var(--jp-private-shortcuts-label-padding-horizontal);\n}\n\n.jp-ContextualShortcut-TableLastRow {\n height: 2em;\n}\n\n.jp-ContextualShortcut-Key {\n font-family: var(--jp-code-font-family);\n border-width: var(--jp-border-width);\n border-radius: var(--jp-border-radius);\n border-style: solid;\n border-color: var(--jp-border-color1);\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n padding-left: var(--jp-private-shortcuts-key-padding-horizontal);\n padding-right: var(--jp-private-shortcuts-key-padding-horizontal);\n padding-top: var(--jp-private-shortcuts-key-padding-vertical);\n padding-bottom: var(--jp-private-shortcuts-key-padding-vertical);\n}\n",""]);const l=a},7924:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(9112);var l=r()(s());l.i(a.A);l.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n:root {\n --toastify-color-light: var(--jp-layout-color1);\n --toastify-color-dark: var(--jp-layout-color1);\n --toastify-color-info: var(--jp-info-color1);\n --toastify-color-success: var(--jp-success-color1);\n --toastify-color-warning: var(--jp-warn-color1);\n --toastify-color-error: var(--jp-error-color1);\n --toastify-color-transparent: rgba(255, 255, 255, 0.7);\n --toastify-icon-color-info: var(--toastify-color-info);\n --toastify-icon-color-success: var(--toastify-color-success);\n --toastify-icon-color-warning: var(--toastify-color-warning);\n --toastify-icon-color-error: var(--toastify-color-error);\n --toastify-toast-width: 25em;\n --toastify-toast-background: var(--jp-layout-color1);\n --toastify-toast-min-height: 64px;\n --toastify-toast-max-height: 800px;\n --toastify-font-family: var(--jp-ui-font-family);\n --toastify-z-index: 9999;\n --toastify-text-color-light: var(--jp-ui-font-color1);\n --toastify-text-color-dark: var(--jp-ui-font-color1);\n --toastify-text-color-info: var(--jp-ui-font-color1);\n --toastify-text-color-success: var(--jp-ui-font-color1);\n --toastify-text-color-warning: var(--jp-ui-font-color1);\n --toastify-text-color-error: var(--jp-ui-font-color1);\n --toastify-spinner-color: #616161;\n --toastify-spinner-color-empty-area: #e0e0e0;\n --toastify-color-progress-light: linear-gradient(\n to right,\n #4cd964,\n #5ac8fa,\n #007aff,\n #34aadc,\n #5856d6,\n #ff2d55\n );\n --toastify-color-progress-dark: #bb86fc;\n --toastify-color-progress-info: var(--toastify-color-info);\n --toastify-color-progress-success: var(--toastify-color-success);\n --toastify-color-progress-warning: var(--toastify-color-warning);\n --toastify-color-progress-error: var(--toastify-color-error);\n}\n\n.jp-Notification-List {\n list-style: none;\n margin: 0;\n padding: 4px;\n width: var(--toastify-toast-width);\n overflow-y: auto;\n max-height: 55vh;\n box-sizing: border-box;\n background-color: var(--jp-layout-color2);\n}\n\n.jp-Notification-Header {\n display: flex;\n font-size: var(--jp-ui-font-size1);\n padding-left: 8px;\n padding-right: 4px;\n margin: 0;\n align-items: center;\n user-select: none;\n}\n\n.jp-Notification-List-Item {\n padding: 2px 0;\n}\n\n.jp-Notification-List .Toastify__toast {\n margin: 0;\n}\n\n.jp-Notification-Status.jp-mod-selected {\n background-color: var(--jp-brand-color1);\n}\n\n.jp-Notification-Status.jp-mod-selected .jp-Notification-Status-Text {\n color: var(--jp-ui-inverse-font-color1);\n}\n\n.Toastify__toast {\n min-height: unset;\n padding: 4px;\n font-size: var(--jp-ui-font-size1);\n border-width: var(--jp-border-width);\n border-radius: var(--jp-border-radius);\n border-color: var(--jp-border-color1);\n box-shadow: var(--jp-elevation-z4);\n cursor: default;\n}\n\n.Toastify__toast-body {\n display: flex;\n flex-grow: 1;\n}\n\n.jp-Notification-Toast-Close {\n padding: 0;\n position: absolute;\n right: 0.1px;\n cursor: pointer;\n}\n\n.jp-Notification-Toast-Close-Margin {\n margin-right: 4px;\n}\n\n.jp-toastContainer .jp-Notification-Toast-Close:hover {\n /* The close button has its own hover style */\n background: none;\n}\n\n.Toastify__toast.jp-Notification-Toast-error {\n border-top: 5px solid var(--jp-error-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-warning {\n border-top: 5px solid var(--jp-warn-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-info {\n border-top: 5px solid var(--jp-info-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-success {\n border-top: 5px solid var(--jp-success-color1);\n}\n\n.Toastify__toast.jp-Notification-Toast-in-progress {\n border-top: 5px solid var(--jp-layout-color1);\n}\n\n.Toastify__toast-body a {\n color: var(--jp-content-link-color);\n}\n\n.Toastify__toast-body a:hover {\n color: var(--jp-content-link-color);\n text-decoration: underline;\n}\n\n.jp-toast-message {\n padding-inline-end: 16px;\n}\n\n/* p elements are added by the markdown rendering.\n * Removing its default margin allows to reduce toast size.\n */\n.Toastify__toast-body p:first-child,\n.Toastify__toast-body h1:first-child,\n.Toastify__toast-body h2:first-child,\n.Toastify__toast-body h3:first-child,\n.Toastify__toast-body h4:first-child,\n.Toastify__toast-body h5:first-child,\n.Toastify__toast-body h6:first-child,\n.Toastify__toast-body ol:first-child,\n.Toastify__toast-body ul:first-child {\n margin-top: 0;\n}\n\n.Toastify__toast-body p:last-child,\n.Toastify__toast-body h1:last-child,\n.Toastify__toast-body h2:last-child,\n.Toastify__toast-body h3:last-child,\n.Toastify__toast-body h4:last-child,\n.Toastify__toast-body h5:last-child,\n.Toastify__toast-body h6:last-child,\n.Toastify__toast-body ol:last-child,\n.Toastify__toast-body ul:last-child {\n margin-bottom: 0;\n}\n\n.jp-toast-buttonBar {\n display: flex;\n flex-direction: row;\n flex-wrap: nowrap;\n flex: 0 0 auto;\n padding-block-start: 8px;\n}\n\n.jp-toast-spacer {\n flex-grow: 1;\n flex-shrink: 1;\n}\n\n.jp-toast-button {\n margin-top: 1px;\n margin-bottom: 1px;\n margin-right: 0;\n margin-left: 3px;\n color: var(--jp-ui-font-color1);\n background-color: var(--jp-layout-color2);\n border: none;\n}\n\n.jp-toast-button:focus {\n outline: 1px solid var(--jp-reject-color-normal, var(--jp-layout-color2));\n outline-offset: 1px;\n -moz-outline-radius: 0;\n}\n\n.jp-toast-button:focus-visible {\n border: none;\n}\n\n.jp-toast-button:hover {\n background-color: var(--jp-layout-color3);\n}\n\n.jp-toast-button.jp-mod-accept {\n background: var(--jp-accept-color-normal, var(--jp-brand-color1));\n color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-toast-button.jp-mod-accept:focus {\n outline-color: var(--jp-accept-color-normal, var(--jp-brand-color1));\n}\n\n.jp-toast-button.jp-mod-accept:hover {\n background: var(--jp-accept-color-hover, var(--jp-brand-color0));\n}\n\n.jp-toast-button.jp-mod-warn {\n background: var(--jp-warn-color-normal, var(--jp-warn-color1));\n color: var(--jp-ui-inverse-font-color1);\n}\n\n.jp-toast-button.jp-mod-warn:focus {\n outline-color: var(--jp-warn-color-normal, var(--jp-warn-color1));\n}\n\n.jp-toast-button.jp-mod-warn:hover {\n background: var(--jp-warn-color-hover, var(--jp-warn-color0));\n}\n\n.jp-toast-button.jp-mod-link {\n color: var(--jp-content-link-color);\n text-decoration: underline;\n text-decoration-color: var(--jp-content-link-color);\n}\n",""]);const d=l},97980:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n#jupyterlab-splash {\n z-index: 10;\n position: absolute;\n overflow: hidden;\n width: 100%;\n height: 100%;\n background-position: center 40%;\n background-repeat: no-repeat;\n background-size: cover;\n}\n\n#jupyterlab-splash.light {\n background-color: white;\n}\n\n#jupyterlab-splash.dark {\n background-color: var(--md-grey-900, #212121);\n}\n\n.splash-fade {\n animation: 0.5s fade-out forwards;\n}\n\n#galaxy {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.planet {\n background-repeat: no-repeat;\n background-size: cover;\n animation-iteration-count: infinite;\n animation-name: orbit;\n}\n\n#moon1.orbit {\n opacity: 1;\n animation: orbit 2s ease;\n width: 200px;\n height: 140px;\n margin-top: -53px;\n margin-left: -54px;\n}\n\n#moon2.orbit {\n opacity: 1;\n animation: orbit 2s ease;\n width: 132px;\n height: 180px;\n margin-top: -66px;\n margin-left: -85px;\n}\n\n#moon3.orbit {\n opacity: 1;\n display: flex;\n align-items: flex-end;\n animation: orbit 2s ease;\n width: 220px;\n height: 166px;\n margin-top: -96px;\n margin-left: -50px;\n}\n\n#moon1 .planet {\n height: 12px;\n width: 12px;\n border-radius: 50%;\n}\n\n#moon2 .planet {\n height: 16px;\n width: 16px;\n border-radius: 50%;\n float: right;\n}\n\n#moon3 .planet {\n height: 20px;\n width: 20px;\n border-radius: 50%;\n}\n\n#jupyterlab-splash.light #moon1 .planet {\n background-color: #6f7070;\n}\n\n#jupyterlab-splash.light #moon2 .planet {\n background-color: #767677;\n}\n\n#jupyterlab-splash.light #moon3 .planet {\n background-color: #989798;\n}\n\n#jupyterlab-splash.dark #moon1 .planet,\n#jupyterlab-splash.dark #moon2 .planet,\n#jupyterlab-splash.dark #moon3 .planet {\n background-color: white;\n}\n\n.orbit {\n animation-iteration-count: 1;\n position: absolute;\n top: 50%;\n left: 50%;\n border-radius: 50%;\n}\n\n@keyframes orbit {\n 0% {\n transform: rotateZ(0deg);\n }\n\n 100% {\n transform: rotateZ(-720deg);\n }\n}\n\n@keyframes orbit2 {\n 0% {\n transform: rotateZ(0deg);\n }\n\n 100% {\n transform: rotateZ(720deg);\n }\n}\n\n@keyframes fade-in {\n 0% {\n opacity: 0;\n }\n\n 100% {\n opacity: 1;\n }\n}\n\n@keyframes fade-out {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n",""]);const l=a},41510:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(28261);var l=n(52269);var d=n(5729);var c=n(48293);var h=n(17333);var u=n(76486);var p=n(8812);var m=r()(s());m.i(a.A);m.i(l.A);m.i(d.A);m.i(c.A);m.i(h.A);m.i(u.A);m.i(p.A);m.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n",""]);const g=m},28261:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Variables\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-commandpalette-search-height: 28px;\n}\n\n/*-----------------------------------------------------------------------------\n| Overall styles\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette {\n padding-bottom: 0;\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n\n /* This is needed so that all font sizing of children done in ems is\n * relative to this base size */\n font-size: var(--jp-ui-font-size1);\n}\n\n/*-----------------------------------------------------------------------------\n| Modal variant\n|----------------------------------------------------------------------------*/\n\n.jp-ModalCommandPalette.jp-ThemedContainer {\n position: absolute;\n z-index: 10000;\n top: 38px;\n left: 30%;\n margin: 0;\n padding: 4px;\n width: 40%;\n box-shadow: var(--jp-elevation-z4);\n border-radius: 4px;\n background: var(--jp-layout-color0);\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette {\n max-height: 40vh;\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette .lm-close-icon::after {\n display: none;\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-header {\n display: none;\n}\n\n.jp-ModalCommandPalette .lm-CommandPalette .lm-CommandPalette-item {\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.jp-ModalCommandPalette\n .lm-CommandPalette\n .lm-CommandPalette-item.lm-mod-disabled {\n display: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Search\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette-search {\n padding: 4px;\n background-color: var(--jp-layout-color1);\n z-index: 2;\n}\n\n.lm-CommandPalette-wrapper {\n /* stylelint-disable-next-line csstree/validator */\n overflow: overlay;\n padding: 0 9px;\n background-color: var(--jp-input-active-background);\n height: 30px;\n box-shadow: inset 0 0 0 var(--jp-border-width) var(--jp-input-border-color);\n}\n\n.lm-CommandPalette.lm-mod-focused .lm-CommandPalette-wrapper {\n box-shadow:\n inset 0 0 0 1px var(--jp-input-active-box-shadow-color),\n inset 0 0 0 3px var(--jp-input-active-box-shadow-color);\n}\n\n.jp-SearchIconGroup {\n color: white;\n background-color: var(--jp-brand-color1);\n position: absolute;\n top: 4px;\n right: 4px;\n padding: 5px 5px 1px;\n}\n\n.jp-SearchIconGroup svg {\n height: 20px;\n width: 20px;\n}\n\n.jp-SearchIconGroup .jp-icon3[fill] {\n fill: var(--jp-layout-color0);\n}\n\n.lm-CommandPalette-input {\n background: transparent;\n width: calc(100% - 18px);\n float: left;\n border: none;\n outline: none;\n font-size: var(--jp-ui-font-size1);\n color: var(--jp-ui-font-color0);\n line-height: var(--jp-private-commandpalette-search-height);\n}\n\n.lm-CommandPalette-input::-webkit-input-placeholder,\n.lm-CommandPalette-input::-moz-placeholder,\n.lm-CommandPalette-input:-ms-input-placeholder {\n color: var(--jp-ui-font-color2);\n font-size: var(--jp-ui-font-size1);\n}\n\n/*-----------------------------------------------------------------------------\n| Results\n|----------------------------------------------------------------------------*/\n\n.lm-CommandPalette-header:first-child {\n margin-top: 0;\n}\n\n.lm-CommandPalette-header {\n border-bottom: solid var(--jp-border-width) var(--jp-border-color2);\n color: var(--jp-ui-font-color1);\n cursor: pointer;\n display: flex;\n font-size: var(--jp-ui-font-size0);\n font-weight: 600;\n letter-spacing: 1px;\n margin-top: 8px;\n padding: 8px 0 8px 12px;\n text-transform: uppercase;\n}\n\n.lm-CommandPalette-header.lm-mod-active {\n background: var(--jp-layout-color2);\n}\n\n.lm-CommandPalette-header > mark {\n background-color: transparent;\n font-weight: bold;\n color: var(--jp-ui-font-color1);\n}\n\n.lm-CommandPalette-item {\n padding: 4px 12px 4px 4px;\n color: var(--jp-ui-font-color1);\n font-size: var(--jp-ui-font-size1);\n font-weight: 400;\n display: flex;\n}\n\n.lm-CommandPalette-item.lm-mod-disabled {\n color: var(--jp-ui-font-color2);\n}\n\n.lm-CommandPalette-item.lm-mod-active {\n color: var(--jp-ui-inverse-font-color1);\n background: var(--jp-brand-color1);\n}\n\n.lm-CommandPalette-item.lm-mod-active .lm-CommandPalette-itemLabel > mark {\n color: var(--jp-ui-inverse-font-color0);\n}\n\n.lm-CommandPalette-item.lm-mod-active .jp-icon-selectable[fill] {\n fill: var(--jp-layout-color0);\n}\n\n.lm-CommandPalette-item.lm-mod-active:hover:not(.lm-mod-disabled) {\n color: var(--jp-ui-inverse-font-color1);\n background: var(--jp-brand-color1);\n}\n\n.lm-CommandPalette-item:hover:not(.lm-mod-active):not(.lm-mod-disabled) {\n background: var(--jp-layout-color2);\n}\n\n.lm-CommandPalette-itemContent {\n overflow: hidden;\n}\n\n.lm-CommandPalette-itemLabel > mark {\n color: var(--jp-ui-font-color0);\n background-color: transparent;\n font-weight: bold;\n}\n\n.lm-CommandPalette-item.lm-mod-disabled mark {\n color: var(--jp-ui-font-color2);\n}\n\n.lm-CommandPalette-item .lm-CommandPalette-itemIcon {\n margin: 0 4px 0 0;\n position: relative;\n width: 16px;\n top: 2px;\n flex: 0 0 auto;\n}\n\n.lm-CommandPalette-item.lm-mod-disabled .lm-CommandPalette-itemIcon {\n opacity: 0.6;\n}\n\n.lm-CommandPalette-item .lm-CommandPalette-itemShortcut {\n flex: 0 0 auto;\n}\n\n.lm-CommandPalette-itemCaption {\n display: none;\n}\n\n.lm-CommandPalette-content {\n background-color: var(--jp-layout-color1);\n}\n\n.lm-CommandPalette-content:empty::after {\n content: 'No results';\n margin: auto;\n margin-top: 20px;\n width: 100px;\n display: block;\n font-size: var(--jp-ui-font-size2);\n font-family: var(--jp-ui-font-family);\n font-weight: lighter;\n}\n\n.lm-CommandPalette-emptyMessage {\n text-align: center;\n margin-top: 24px;\n line-height: 1.32;\n padding: 0 8px;\n color: var(--jp-content-font-color3);\n}\n",""]);const l=a},52269:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Dialog.jp-ThemedContainer {\n position: absolute;\n z-index: 10000;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n top: 0;\n left: 0;\n margin: 0;\n padding: 0;\n width: 100%;\n height: 100%;\n background: var(--jp-dialog-background);\n /* stylelint-disable */\n container-type: inline-size;\n /* stylelint-enable */\n}\n\n.jp-Dialog-content {\n display: flex;\n flex-direction: column;\n margin-left: auto;\n margin-right: auto;\n background: var(--jp-layout-color1);\n padding: 24px 24px 12px;\n min-width: 300px;\n min-height: 150px;\n max-width: 1000px;\n max-height: 500px;\n box-sizing: border-box;\n box-shadow: var(--jp-elevation-z20);\n word-wrap: break-word;\n border-radius: var(--jp-border-radius);\n\n /* This is needed so that all font sizing of children done in ems is\n * relative to this base size */\n font-size: var(--jp-ui-font-size1);\n color: var(--jp-ui-font-color1);\n resize: both;\n overflow: hidden;\n}\n\n.jp-Dialog-content.jp-Dialog-content-small {\n max-width: 500px;\n}\n\n.jp-Dialog-button {\n overflow: visible;\n}\n\nbutton.jp-Dialog-button:disabled {\n opacity: 0.6;\n}\n\nbutton.jp-Dialog-button:focus {\n outline: 1px solid var(--jp-brand-color1);\n outline-offset: 4px;\n -moz-outline-radius: 0;\n}\n\nbutton.jp-Dialog-button:focus::-moz-focus-inner {\n border: 0;\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus,\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus,\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {\n outline-offset: 4px;\n -moz-outline-radius: 0;\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-accept:focus {\n outline: 1px solid var(--jp-accept-color-normal, var(--jp-brand-color1));\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-warn:focus {\n outline: 1px solid var(--jp-warn-color-normal, var(--jp-error-color1));\n}\n\nbutton.jp-Dialog-button.jp-mod-styled.jp-mod-reject:focus {\n outline: 1px solid var(--jp-reject-color-normal, var(--md-grey-600, #757575));\n}\n\nbutton.jp-Dialog-close-button {\n padding: 0;\n height: 100%;\n min-width: unset;\n min-height: unset;\n}\n\n.jp-Dialog-header {\n display: flex;\n justify-content: space-between;\n flex: 0 0 auto;\n padding-bottom: 12px;\n font-size: var(--jp-ui-font-size3);\n font-weight: 400;\n color: var(--jp-ui-font-color1);\n}\n\n.jp-Dialog-body {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n font-size: var(--jp-ui-font-size1);\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n overflow: auto;\n}\n\n.jp-Dialog-footer {\n display: flex;\n flex-direction: row;\n justify-content: flex-end;\n align-items: center;\n flex: 0 0 auto;\n margin-left: -12px;\n margin-right: -12px;\n padding: 12px;\n}\n\n.jp-Dialog-checkbox {\n padding-right: 5px;\n display: flex;\n align-items: center;\n}\n\n.jp-Dialog-spacer {\n flex: 1 1 auto;\n}\n\n.jp-Dialog-title {\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.jp-Dialog-body > .jp-select-wrapper {\n width: 100%;\n}\n\n.jp-Dialog-body > button {\n padding: 0 16px;\n}\n\n.jp-Dialog-body > label {\n line-height: 1.4;\n color: var(--jp-ui-font-color0);\n}\n\n.jp-Dialog-button.jp-mod-styled:not(:last-child) {\n margin-right: 12px;\n}\n\n/* stylelint-disable */\n@container (max-width: 560px) {\n /* stylelint-enable */\n .jp-Dialog-footer {\n flex-direction: column;\n align-items: center;\n gap: 7px;\n }\n}\n",""]);const l=a},5729:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-Input-Boolean-Dialog {\n flex-direction: row-reverse;\n align-items: end;\n width: 100%;\n}\n\n.jp-Input-Boolean-Dialog > label {\n flex: 1 1 auto;\n}\n\n.jp-InputDialog-inputWrapper {\n display: flex;\n align-items: baseline;\n}\n\n.jp-InputDialog-inputWrapper > input.jp-mod-styled:invalid {\n border-color: var(--jp-error-color0);\n background: var(--jp-error-color3);\n}\n\n.jp-InputDialog-inputWrapper\n > input[required].jp-mod-styled:invalid:placeholder-shown {\n /* Do not show invalid style when placeholder is shown */\n border-color: unset;\n background: unset;\n}\n",""]);const l=a},48293:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* licenses */\n.jp-Licenses {\n display: flex;\n flex-direction: row;\n align-items: stretch;\n background-color: var(--jp-layout-color0);\n}\n\n.jp-Licenses-FormArea {\n display: flex;\n flex-direction: column;\n min-width: calc(10 * var(--jp-ui-font-size1));\n width: calc(18 * var(--jp-ui-font-size1));\n}\n\n.jp-Licenses .lm-SplitPanel-handle:hover {\n background-color: var(--jp-brand-color2);\n}\n\n/* filters */\n.jp-Licenses-Filters {\n padding: var(--jp-ui-font-size1) calc(var(--jp-ui-font-size1) / 2) 0\n var(--jp-ui-font-size1);\n}\n\n.jp-Licenses-Filters label {\n display: block;\n}\n\n.jp-Licenses-Filters-title {\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 1px;\n font-size: var(--jp-ui-font-size0);\n color: var(--jp-ui-font-color0);\n}\n\n.jp-RenderedHTMLCommon.jp-Licenses-Filters ul,\n.jp-RenderedHTMLCommon.jp-Licenses-Filters li {\n list-style: none;\n color: var(--jp-ui-font-color0);\n}\n\n.jp-Licenses-Filters input {\n width: 100%;\n}\n\n.jp-RenderedHTMLCommon.jp-Licenses-Filters ul {\n padding: 0 0 var(--jp-ui-font-size1) 0;\n margin: 0;\n padding-bottom: var(--jp-ui-font-size1);\n}\n\n/* bundles */\n.jp-Licenses-Bundles {\n background-color: var(--jp-layout-color2);\n overflow-y: auto;\n flex: 1;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-content {\n width: 100%;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab {\n padding: calc(var(--jp-ui-font-size1) / 2);\n background-color: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tabLabel {\n text-overflow: ellipsis;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab label {\n background-color: var(--jp-layout-color2);\n border-radius: var(--jp-ui-font-size1);\n width: calc(2.5 * var(--jp-ui-font-size1));\n padding: 0 calc(var(--jp-ui-font-size1) / 2);\n text-align: center;\n margin-left: calc(var(--jp-ui-font-size1) / 2);\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab.lm-mod-current {\n background-color: var(--jp-brand-color1);\n color: #fff;\n}\n\n.jp-Licenses-Bundles .lm-TabBar-tab.lm-mod-current label {\n background-color: #fff;\n color: var(--jp-brand-color1);\n}\n\n/* license grid */\n.jp-Licenses-Grid.jp-RenderedHTMLCommon {\n min-width: calc(var(--jp-ui-font-size1) * 10);\n display: flex;\n flex-direction: column;\n padding: 0;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon form {\n flex: 1;\n display: flex;\n flex-direction: column;\n overflow-y: scroll;\n margin: 0;\n padding: 0;\n}\n\n.jp-RenderedHTMLCommon.jp-Licenses-Grid table {\n flex: 1;\n max-width: 100%;\n border: solid var(--jp-border-width) var(--jp-border-color2);\n border-top: 0;\n border-bottom: 0;\n margin: 0;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon td,\n.jp-Licenses-Grid.jp-RenderedHTMLCommon th {\n text-align: left;\n}\n\n.jp-Licenses-Grid td:nth-child(1) {\n max-width: calc(2 * var(--jp-ui-font-size1));\n}\n\n.jp-Licenses-Grid label {\n width: 100%;\n}\n\n.jp-Licenses .jp-Licenses-Grid.jp-RenderedHTMLCommon code {\n background-color: transparent;\n padding: 0;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon tr.jp-mod-selected {\n background-color: var(--jp-brand-color1);\n color: #fff;\n}\n\n.jp-Licenses-Grid.jp-RenderedHTMLCommon .jp-mod-selected code {\n color: #fff;\n}\n\n/* license text */\n.jp-Licenses-Text {\n min-width: calc(10 * var(--jp-ui-font-size1));\n padding: 0 0 0 var(--jp-ui-font-size1);\n display: flex;\n flex-direction: column;\n}\n\n.jp-Licenses-Text h1 {\n flex: initial;\n margin-bottom: 0;\n}\n\n.jp-Licenses-Text h1:empty {\n display: none;\n}\n\n.jp-Licenses-Text blockquote {\n flex: initial;\n}\n\n.jp-Licenses-Text.jp-RenderedHTMLCommon code {\n overflow-wrap: anywhere;\n overflow-y: auto;\n flex: 1;\n padding-right: var(--jp-ui-font-size1);\n margin-bottom: 0;\n padding-bottom: var(--jp-ui-font-size1);\n}\n\n.jp-Licenses-Text code:empty {\n display: none;\n}\n",""]);const l=a},17333:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-MainAreaWidget > :focus {\n outline: none;\n}\n\n.jp-MainAreaWidget .jp-MainAreaWidget-error {\n padding: 6px;\n}\n\n.jp-MainAreaWidget .jp-MainAreaWidget-error > pre {\n width: auto;\n padding: 10px;\n background: var(--jp-error-color3);\n border: var(--jp-border-width) solid var(--jp-error-color1);\n border-radius: var(--jp-border-radius);\n color: var(--jp-ui-font-color1);\n font-size: var(--jp-ui-font-size1);\n white-space: pre-wrap;\n word-wrap: break-word;\n}\n",""]);const l=a},76486:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/**\n * google-material-color v1.2.6\n * https://github.com/danlevan/google-material-color\n */\n:root {\n --md-red-50: #ffebee;\n --md-red-100: #ffcdd2;\n --md-red-200: #ef9a9a;\n --md-red-300: #e57373;\n --md-red-400: #ef5350;\n --md-red-500: #f44336;\n --md-red-600: #e53935;\n --md-red-700: #d32f2f;\n --md-red-800: #c62828;\n --md-red-900: #b71c1c;\n --md-red-A100: #ff8a80;\n --md-red-A200: #ff5252;\n --md-red-A400: #ff1744;\n --md-red-A700: #d50000;\n --md-pink-50: #fce4ec;\n --md-pink-100: #f8bbd0;\n --md-pink-200: #f48fb1;\n --md-pink-300: #f06292;\n --md-pink-400: #ec407a;\n --md-pink-500: #e91e63;\n --md-pink-600: #d81b60;\n --md-pink-700: #c2185b;\n --md-pink-800: #ad1457;\n --md-pink-900: #880e4f;\n --md-pink-A100: #ff80ab;\n --md-pink-A200: #ff4081;\n --md-pink-A400: #f50057;\n --md-pink-A700: #c51162;\n --md-purple-50: #f3e5f5;\n --md-purple-100: #e1bee7;\n --md-purple-200: #ce93d8;\n --md-purple-300: #ba68c8;\n --md-purple-400: #ab47bc;\n --md-purple-500: #9c27b0;\n --md-purple-600: #8e24aa;\n --md-purple-700: #7b1fa2;\n --md-purple-800: #6a1b9a;\n --md-purple-900: #4a148c;\n --md-purple-A100: #ea80fc;\n --md-purple-A200: #e040fb;\n --md-purple-A400: #d500f9;\n --md-purple-A700: #a0f;\n --md-deep-purple-50: #ede7f6;\n --md-deep-purple-100: #d1c4e9;\n --md-deep-purple-200: #b39ddb;\n --md-deep-purple-300: #9575cd;\n --md-deep-purple-400: #7e57c2;\n --md-deep-purple-500: #673ab7;\n --md-deep-purple-600: #5e35b1;\n --md-deep-purple-700: #512da8;\n --md-deep-purple-800: #4527a0;\n --md-deep-purple-900: #311b92;\n --md-deep-purple-A100: #b388ff;\n --md-deep-purple-A200: #7c4dff;\n --md-deep-purple-A400: #651fff;\n --md-deep-purple-A700: #6200ea;\n --md-indigo-50: #e8eaf6;\n --md-indigo-100: #c5cae9;\n --md-indigo-200: #9fa8da;\n --md-indigo-300: #7986cb;\n --md-indigo-400: #5c6bc0;\n --md-indigo-500: #3f51b5;\n --md-indigo-600: #3949ab;\n --md-indigo-700: #303f9f;\n --md-indigo-800: #283593;\n --md-indigo-900: #1a237e;\n --md-indigo-A100: #8c9eff;\n --md-indigo-A200: #536dfe;\n --md-indigo-A400: #3d5afe;\n --md-indigo-A700: #304ffe;\n --md-blue-50: #e3f2fd;\n --md-blue-100: #bbdefb;\n --md-blue-200: #90caf9;\n --md-blue-300: #64b5f6;\n --md-blue-400: #42a5f5;\n --md-blue-500: #2196f3;\n --md-blue-600: #1e88e5;\n --md-blue-700: #1976d2;\n --md-blue-800: #1565c0;\n --md-blue-900: #0d47a1;\n --md-blue-A100: #82b1ff;\n --md-blue-A200: #448aff;\n --md-blue-A400: #2979ff;\n --md-blue-A700: #2962ff;\n --md-light-blue-50: #e1f5fe;\n --md-light-blue-100: #b3e5fc;\n --md-light-blue-200: #81d4fa;\n --md-light-blue-300: #4fc3f7;\n --md-light-blue-400: #29b6f6;\n --md-light-blue-500: #03a9f4;\n --md-light-blue-600: #039be5;\n --md-light-blue-700: #0288d1;\n --md-light-blue-800: #0277bd;\n --md-light-blue-900: #01579b;\n --md-light-blue-A100: #80d8ff;\n --md-light-blue-A200: #40c4ff;\n --md-light-blue-A400: #00b0ff;\n --md-light-blue-A700: #0091ea;\n --md-cyan-50: #e0f7fa;\n --md-cyan-100: #b2ebf2;\n --md-cyan-200: #80deea;\n --md-cyan-300: #4dd0e1;\n --md-cyan-400: #26c6da;\n --md-cyan-500: #00bcd4;\n --md-cyan-600: #00acc1;\n --md-cyan-700: #0097a7;\n --md-cyan-800: #00838f;\n --md-cyan-900: #006064;\n --md-cyan-A100: #84ffff;\n --md-cyan-A200: #18ffff;\n --md-cyan-A400: #00e5ff;\n --md-cyan-A700: #00b8d4;\n --md-teal-50: #e0f2f1;\n --md-teal-100: #b2dfdb;\n --md-teal-200: #80cbc4;\n --md-teal-300: #4db6ac;\n --md-teal-400: #26a69a;\n --md-teal-500: #009688;\n --md-teal-600: #00897b;\n --md-teal-700: #00796b;\n --md-teal-800: #00695c;\n --md-teal-900: #004d40;\n --md-teal-A100: #a7ffeb;\n --md-teal-A200: #64ffda;\n --md-teal-A400: #1de9b6;\n --md-teal-A700: #00bfa5;\n --md-green-50: #e8f5e9;\n --md-green-100: #c8e6c9;\n --md-green-200: #a5d6a7;\n --md-green-300: #81c784;\n --md-green-400: #66bb6a;\n --md-green-500: #4caf50;\n --md-green-600: #43a047;\n --md-green-700: #388e3c;\n --md-green-800: #2e7d32;\n --md-green-900: #1b5e20;\n --md-green-A100: #b9f6ca;\n --md-green-A200: #69f0ae;\n --md-green-A400: #00e676;\n --md-green-A700: #00c853;\n --md-light-green-50: #f1f8e9;\n --md-light-green-100: #dcedc8;\n --md-light-green-200: #c5e1a5;\n --md-light-green-300: #aed581;\n --md-light-green-400: #9ccc65;\n --md-light-green-500: #8bc34a;\n --md-light-green-600: #7cb342;\n --md-light-green-700: #689f38;\n --md-light-green-800: #558b2f;\n --md-light-green-900: #33691e;\n --md-light-green-A100: #ccff90;\n --md-light-green-A200: #b2ff59;\n --md-light-green-A400: #76ff03;\n --md-light-green-A700: #64dd17;\n --md-lime-50: #f9fbe7;\n --md-lime-100: #f0f4c3;\n --md-lime-200: #e6ee9c;\n --md-lime-300: #dce775;\n --md-lime-400: #d4e157;\n --md-lime-500: #cddc39;\n --md-lime-600: #c0ca33;\n --md-lime-700: #afb42b;\n --md-lime-800: #9e9d24;\n --md-lime-900: #827717;\n --md-lime-A100: #f4ff81;\n --md-lime-A200: #eeff41;\n --md-lime-A400: #c6ff00;\n --md-lime-A700: #aeea00;\n --md-yellow-50: #fffde7;\n --md-yellow-100: #fff9c4;\n --md-yellow-200: #fff59d;\n --md-yellow-300: #fff176;\n --md-yellow-400: #ffee58;\n --md-yellow-500: #ffeb3b;\n --md-yellow-600: #fdd835;\n --md-yellow-700: #fbc02d;\n --md-yellow-800: #f9a825;\n --md-yellow-900: #f57f17;\n --md-yellow-A100: #ffff8d;\n --md-yellow-A200: #ff0;\n --md-yellow-A400: #ffea00;\n --md-yellow-A700: #ffd600;\n --md-amber-50: #fff8e1;\n --md-amber-100: #ffecb3;\n --md-amber-200: #ffe082;\n --md-amber-300: #ffd54f;\n --md-amber-400: #ffca28;\n --md-amber-500: #ffc107;\n --md-amber-600: #ffb300;\n --md-amber-700: #ffa000;\n --md-amber-800: #ff8f00;\n --md-amber-900: #ff6f00;\n --md-amber-A100: #ffe57f;\n --md-amber-A200: #ffd740;\n --md-amber-A400: #ffc400;\n --md-amber-A700: #ffab00;\n --md-orange-50: #fff3e0;\n --md-orange-100: #ffe0b2;\n --md-orange-200: #ffcc80;\n --md-orange-300: #ffb74d;\n --md-orange-400: #ffa726;\n --md-orange-500: #ff9800;\n --md-orange-600: #fb8c00;\n --md-orange-700: #f57c00;\n --md-orange-800: #ef6c00;\n --md-orange-900: #e65100;\n --md-orange-A100: #ffd180;\n --md-orange-A200: #ffab40;\n --md-orange-A400: #ff9100;\n --md-orange-A700: #ff6d00;\n --md-deep-orange-50: #fbe9e7;\n --md-deep-orange-100: #ffccbc;\n --md-deep-orange-200: #ffab91;\n --md-deep-orange-300: #ff8a65;\n --md-deep-orange-400: #ff7043;\n --md-deep-orange-500: #ff5722;\n --md-deep-orange-600: #f4511e;\n --md-deep-orange-700: #e64a19;\n --md-deep-orange-800: #d84315;\n --md-deep-orange-900: #bf360c;\n --md-deep-orange-A100: #ff9e80;\n --md-deep-orange-A200: #ff6e40;\n --md-deep-orange-A400: #ff3d00;\n --md-deep-orange-A700: #dd2c00;\n --md-brown-50: #efebe9;\n --md-brown-100: #d7ccc8;\n --md-brown-200: #bcaaa4;\n --md-brown-300: #a1887f;\n --md-brown-400: #8d6e63;\n --md-brown-500: #795548;\n --md-brown-600: #6d4c41;\n --md-brown-700: #5d4037;\n --md-brown-800: #4e342e;\n --md-brown-900: #3e2723;\n --md-grey-50: #fafafa;\n --md-grey-100: #f5f5f5;\n --md-grey-200: #eee;\n --md-grey-300: #e0e0e0;\n --md-grey-400: #bdbdbd;\n --md-grey-500: #9e9e9e;\n --md-grey-600: #757575;\n --md-grey-700: #616161;\n --md-grey-800: #424242;\n --md-grey-900: #212121;\n --md-blue-grey-50: #eceff1;\n --md-blue-grey-100: #cfd8dc;\n --md-blue-grey-200: #b0bec5;\n --md-blue-grey-300: #90a4ae;\n --md-blue-grey-400: #78909c;\n --md-blue-grey-500: #607d8b;\n --md-blue-grey-600: #546e7a;\n --md-blue-grey-700: #455a64;\n --md-blue-grey-800: #37474f;\n --md-blue-grey-900: #263238;\n}\n",""]);const l=a},8812:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n/* @deprecated dead code to be removed in JupyterLab 5 */\n.jp-Toolbar-item.jp-Toolbar-kernelStatus {\n display: inline-block;\n width: 32px;\n background-repeat: no-repeat;\n background-position: center;\n background-size: 16px;\n}\n",""]);const l=a},31772:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-cell-button .jp-icon3[fill] {\n fill: var(--jp-inverse-layout-color4);\n}\n\n.jp-cell-button:hover .jp-icon3[fill] {\n fill: var(--jp-inverse-layout-color2);\n}\n\n.jp-toolbar-overlap .jp-cell-toolbar {\n display: none;\n}\n\n.jp-cell-toolbar {\n display: flex;\n flex-direction: row;\n padding: 0;\n min-height: 25px;\n z-index: 6;\n position: absolute;\n right: 3px;\n\n /* Override .jp-Toolbar */\n background-color: transparent;\n border-bottom: inherit;\n box-shadow: none;\n}\n\n/* Overrides for mobile view hiding cell toolbar */\n@media only screen and (width <= 760px) {\n .jp-cell-toolbar {\n display: none;\n }\n}\n\n.jp-cell-toolbar button.jp-ToolbarButtonComponent {\n cursor: pointer;\n}\n\n.jp-cell-toolbar .jp-ToolbarButton button {\n display: none;\n}\n\n.jp-cell-toolbar .jp-ToolbarButton .jp-cell-all,\n.jp-CodeCell .jp-ToolbarButton .jp-cell-code,\n.jp-MarkdownCell .jp-ToolbarButton .jp-cell-markdown,\n.jp-RawCell .jp-ToolbarButton .jp-cell-raw {\n display: block;\n}\n\n.jp-cell-toolbar .jp-Toolbar-spacer {\n flex: 1 1 auto;\n}\n\n.jp-cell-mod-click {\n cursor: pointer;\n}\n\n/* Custom styling for rendered markdown cells so that cell toolbar is visible */\n.jp-MarkdownOutput {\n border-width: var(--jp-border-width);\n border-color: transparent;\n border-style: solid;\n}\n\n.jp-mod-active .jp-MarkdownOutput {\n border-color: var(--jp-cell-editor-border-color);\n}\n",""]);const l=a},55717:(e,t,n)=>{"use strict";n.d(t,{A:()=>p});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(35541);var l=n(30684);var d=n(25147);var c=n(88771);var h=n(60846);var u=r()(s());u.i(a.A);u.i(l.A);u.i(d.A);u.i(c.A);u.i(h.A);u.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n",""]);const p=u},35541:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,'/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-Collapser {\n flex: 0 0 var(--jp-cell-collapser-width);\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background: transparent;\n border-radius: var(--jp-border-radius);\n opacity: 1;\n}\n\n.jp-Collapser-child {\n display: block;\n width: 100%;\n box-sizing: border-box;\n\n /* height: 100% doesn\'t work because the height of its parent is computed from content */\n position: absolute;\n top: 0;\n bottom: 0;\n}\n\n/*-----------------------------------------------------------------------------\n| Printing\n|----------------------------------------------------------------------------*/\n\n/*\nHiding collapsers in print mode.\n\nNote: input and output wrappers have "display: block" property in print mode.\n*/\n\n@media print {\n .jp-Collapser {\n display: none;\n }\n}\n',""]);const l=a},30684:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Header/Footer\n|----------------------------------------------------------------------------*/\n\n/* Hidden by zero height by default */\n.jp-CellHeader,\n.jp-CellFooter {\n height: 0;\n width: 100%;\n padding: 0;\n margin: 0;\n border: none;\n outline: none;\n background: transparent;\n}\n",""]);const l=a},25147:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Input\n|----------------------------------------------------------------------------*/\n\n/* All input areas */\n.jp-InputArea {\n display: flex;\n flex-direction: row;\n width: 100%;\n overflow: hidden;\n}\n\n.jp-InputArea-editor {\n flex: 1 1 auto;\n overflow: hidden;\n\n /* This is the non-active, default styling */\n border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);\n border-radius: 0;\n background: var(--jp-cell-editor-background);\n}\n\n.jp-InputPrompt {\n flex: 0 0 var(--jp-cell-prompt-width);\n width: var(--jp-cell-prompt-width);\n color: var(--jp-cell-inprompt-font-color);\n font-family: var(--jp-cell-prompt-font-family);\n padding: var(--jp-code-padding);\n letter-spacing: var(--jp-cell-prompt-letter-spacing);\n opacity: var(--jp-cell-prompt-opacity);\n line-height: var(--jp-code-line-height);\n font-size: var(--jp-code-font-size);\n border: var(--jp-border-width) solid transparent;\n\n /* Right align prompt text, don't wrap to handle large prompt numbers */\n text-align: right;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n\n /* Disable text selection */\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Print\n|----------------------------------------------------------------------------*/\n@media print {\n .jp-InputArea {\n display: table;\n table-layout: fixed;\n }\n\n .jp-InputArea-editor {\n display: table-cell;\n vertical-align: top;\n }\n\n .jp-InputPrompt {\n display: table-cell;\n vertical-align: top;\n }\n}\n\n/*-----------------------------------------------------------------------------\n| Mobile\n|----------------------------------------------------------------------------*/\n@media only screen and (width <= 760px) {\n .jp-InputArea {\n flex-direction: column;\n }\n\n .jp-InputArea-editor {\n margin-left: var(--jp-code-padding);\n }\n\n .jp-InputPrompt {\n flex: 0 0 auto;\n text-align: left;\n }\n}\n",""]);const l=a},88771:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Placeholder\n|----------------------------------------------------------------------------*/\n\n.jp-Placeholder {\n display: flex;\n flex-direction: row;\n width: 100%;\n}\n\n.jp-Placeholder-prompt {\n flex: 0 0 var(--jp-cell-prompt-width);\n box-sizing: border-box;\n}\n\n.jp-Placeholder-content {\n flex: 1 1 auto;\n padding: 4px 6px;\n border: 1px solid transparent;\n border-radius: 0;\n background: none;\n box-sizing: border-box;\n cursor: pointer;\n}\n\n.jp-Placeholder-contentContainer {\n display: flex;\n}\n\n.jp-Placeholder-content:hover,\n.jp-InputPlaceholder > .jp-Placeholder-content:hover {\n border-color: var(--jp-layout-color3);\n}\n\n.jp-Placeholder-content .jp-MoreHorizIcon {\n width: 32px;\n height: 16px;\n border: 1px solid transparent;\n border-radius: var(--jp-border-radius);\n}\n\n.jp-Placeholder-content .jp-MoreHorizIcon:hover {\n border: 1px solid var(--jp-border-color1);\n box-shadow: var(--jp-toolbar-box-shadow);\n background-color: var(--jp-layout-color0);\n}\n\n.jp-PlaceholderText {\n white-space: nowrap;\n overflow-x: hidden;\n color: var(--jp-inverse-layout-color3);\n font-family: var(--jp-code-font-family);\n}\n\n.jp-InputPlaceholder > .jp-Placeholder-content {\n border-color: var(--jp-cell-editor-border-color);\n background: var(--jp-cell-editor-background);\n}\n\n/*-----------------------------------------------------------------------------\n| Print\n|----------------------------------------------------------------------------*/\n@media print {\n .jp-Placeholder {\n display: table;\n table-layout: fixed;\n }\n\n .jp-Placeholder-content {\n display: table-cell;\n }\n\n .jp-Placeholder-prompt {\n display: table-cell;\n }\n}\n",""]);const l=a},60846:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| Private CSS variables\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-cell-scrolling-output-offset: 5px;\n}\n\n/*-----------------------------------------------------------------------------\n| Cell\n|----------------------------------------------------------------------------*/\n\n.jp-Cell {\n padding: var(--jp-cell-padding);\n margin: 0;\n border: none;\n outline: none;\n background: transparent;\n}\n\n/*-----------------------------------------------------------------------------\n| Common input/output\n|----------------------------------------------------------------------------*/\n\n.jp-Cell-inputWrapper,\n.jp-Cell-outputWrapper {\n display: flex;\n flex-direction: row;\n padding: 0;\n margin: 0;\n\n /* Added to reveal the box-shadow on the input and output collapsers. */\n overflow: visible;\n}\n\n/* Only input/output areas inside cells */\n.jp-Cell-inputArea,\n.jp-Cell-outputArea {\n flex: 1 1 auto;\n}\n\n/*-----------------------------------------------------------------------------\n| Collapser\n|----------------------------------------------------------------------------*/\n\n/* Make the output collapser disappear when there is not output, but do so\n * in a manner that leaves it in the layout and preserves its width.\n */\n.jp-Cell.jp-mod-noOutputs .jp-Cell-outputCollapser {\n border: none !important;\n background: transparent !important;\n}\n\n.jp-Cell:not(.jp-mod-noOutputs) .jp-Cell-outputCollapser {\n min-height: var(--jp-cell-collapser-min-height);\n}\n\n/*-----------------------------------------------------------------------------\n| Output\n|----------------------------------------------------------------------------*/\n\n/* Put a space between input and output when there IS output */\n.jp-Cell:not(.jp-mod-noOutputs) .jp-Cell-outputWrapper {\n margin-top: 5px;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea {\n overflow-y: auto;\n max-height: 24em;\n margin-left: var(--jp-private-cell-scrolling-output-offset);\n resize: vertical;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea[style*='height'] {\n max-height: unset;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea::after {\n content: ' ';\n box-shadow: inset 0 0 6px 2px rgb(0 0 0 / 30%);\n width: 100%;\n height: 100%;\n position: sticky;\n bottom: 0;\n top: 0;\n margin-top: -50%;\n float: left;\n display: block;\n pointer-events: none;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-child {\n padding-top: 6px;\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-prompt {\n width: calc(\n var(--jp-cell-prompt-width) - var(--jp-private-cell-scrolling-output-offset)\n );\n flex: 0 0\n calc(\n var(--jp-cell-prompt-width) -\n var(--jp-private-cell-scrolling-output-offset)\n );\n}\n\n.jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-promptOverlay {\n left: calc(-1 * var(--jp-private-cell-scrolling-output-offset));\n}\n\n/*-----------------------------------------------------------------------------\n| CodeCell\n|----------------------------------------------------------------------------*/\n\n/*-----------------------------------------------------------------------------\n| MarkdownCell\n|----------------------------------------------------------------------------*/\n\n.jp-MarkdownOutput {\n flex: 1 1 auto;\n width: 100%;\n margin-top: 0;\n margin-bottom: 0;\n padding-left: var(--jp-code-padding);\n}\n\n.jp-MarkdownOutput.jp-RenderedHTMLCommon {\n overflow: auto;\n}\n\n/* collapseHeadingButton (show always if hiddenCellsButton is _not_ shown) */\n.jp-collapseHeadingButton {\n display: flex;\n min-height: var(--jp-cell-collapser-min-height);\n font-size: var(--jp-code-font-size);\n position: absolute;\n background-color: transparent;\n background-size: 25px;\n background-repeat: no-repeat;\n background-position-x: center;\n background-position-y: top;\n background-image: var(--jp-icon-caret-down);\n right: 0;\n top: 0;\n bottom: 0;\n}\n\n.jp-collapseHeadingButton.jp-mod-collapsed {\n background-image: var(--jp-icon-caret-right);\n}\n\n/*\n set the container font size to match that of content\n so that the nested collapse buttons have the right size\n*/\n.jp-MarkdownCell .jp-InputPrompt {\n font-size: var(--jp-content-font-size1);\n}\n\n/*\n Align collapseHeadingButton with cell top header\n The font sizes are identical to the ones in packages/rendermime/style/base.css\n*/\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='1'] {\n font-size: var(--jp-content-font-size5);\n background-position-y: calc(0.3 * var(--jp-content-font-size5));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='2'] {\n font-size: var(--jp-content-font-size4);\n background-position-y: calc(0.3 * var(--jp-content-font-size4));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='3'] {\n font-size: var(--jp-content-font-size3);\n background-position-y: calc(0.3 * var(--jp-content-font-size3));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='4'] {\n font-size: var(--jp-content-font-size2);\n background-position-y: calc(0.3 * var(--jp-content-font-size2));\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='5'] {\n font-size: var(--jp-content-font-size1);\n background-position-y: top;\n}\n\n.jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='6'] {\n font-size: var(--jp-content-font-size0);\n background-position-y: top;\n}\n\n/* collapseHeadingButton (show only on (hover,active) if hiddenCellsButton is shown) */\n.jp-Notebook.jp-mod-showHiddenCellsButton .jp-collapseHeadingButton {\n display: none;\n}\n\n.jp-Notebook.jp-mod-showHiddenCellsButton\n :is(.jp-MarkdownCell:hover, .jp-mod-active)\n .jp-collapseHeadingButton {\n display: flex;\n}\n\n/* showHiddenCellsButton (only show if jp-mod-showHiddenCellsButton is set, which\nis a consequence of the showHiddenCellsButton option in Notebook Settings)*/\n.jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton {\n margin-left: calc(var(--jp-cell-prompt-width) + 2 * var(--jp-code-padding));\n margin-top: var(--jp-code-padding);\n border: 1px solid var(--jp-border-color2);\n background-color: var(--jp-border-color3) !important;\n color: var(--jp-content-font-color0) !important;\n display: flex;\n}\n\n.jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton:hover {\n background-color: var(--jp-border-color2) !important;\n}\n\n.jp-showHiddenCellsButton {\n display: none;\n}\n\n/*-----------------------------------------------------------------------------\n| Printing\n|----------------------------------------------------------------------------*/\n\n/*\nUsing block instead of flex to allow the use of the break-inside CSS property for\ncell outputs.\n*/\n\n@media print {\n .jp-Cell-inputWrapper,\n .jp-Cell-outputWrapper {\n display: block;\n }\n\n .jp-MarkdownOutput {\n display: table-cell;\n }\n}\n",""]);const l=a},96415:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n:root {\n --jp-add-tag-extra-width: 8px;\n}\n\n.jp-CellTags-Tag {\n height: 20px;\n border-radius: 10px;\n margin-right: 5px;\n margin-bottom: 10px;\n padding: 0 8px;\n font-size: var(--jp-ui-font-size1);\n display: inline-flex;\n justify-content: center;\n align-items: center;\n max-width: calc(100% - 25px);\n border: 1px solid var(--jp-border-color1);\n color: var(--jp-ui-font-color1);\n -webkit-touch-callout: none;\n -webkit-user-select: none;\n -khtml-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n.jp-CellTags-Unapplied {\n background-color: var(--jp-layout-color2);\n}\n\n.jp-CellTags-Applied {\n background-color: var(--jp-layout-color3);\n}\n\n.jp-CellTags-Add {\n white-space: nowrap;\n overflow: hidden;\n border: none;\n outline: none;\n resize: horizontal;\n font-size: var(--jp-ui-font-size1);\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color2);\n}\n\n.jp-CellTags-Holder {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.jp-CellTags-Empty {\n width: 4em;\n}\n",""]);const l=a},9534:(e,t,n)=>{"use strict";n.d(t,{A:()=>d});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(94925);var l=r()(s());l.i(a.A);l.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-JSONEditor {\n display: flex;\n flex-direction: column;\n width: 100%;\n}\n\n.jp-JSONEditor-host {\n flex: 1 1 auto;\n border: var(--jp-border-width) solid var(--jp-input-border-color);\n border-radius: 0;\n background: var(--jp-layout-color0);\n min-height: 50px;\n padding: 1px;\n}\n\n.jp-JSONEditor.jp-mod-error .jp-JSONEditor-host {\n border-color: red;\n outline-color: red;\n}\n\n.jp-JSONEditor-header {\n display: flex;\n flex: 1 0 auto;\n padding: 0 0 0 12px;\n}\n\n.jp-JSONEditor-header label {\n flex: 0 0 auto;\n}\n\n.jp-JSONEditor-commitButton {\n height: 16px;\n width: 16px;\n background-size: 18px;\n background-repeat: no-repeat;\n background-position: center;\n}\n\n.jp-JSONEditor-host.jp-mod-focused {\n background-color: var(--jp-input-active-background);\n border: 1px solid var(--jp-input-active-border-color);\n box-shadow: var(--jp-input-box-shadow);\n}\n\n.jp-Editor.jp-mod-dropTarget {\n border: var(--jp-border-width) solid var(--jp-input-active-border-color);\n box-shadow: var(--jp-input-box-shadow);\n}\n",""]);const d=l},94925:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*\n * Copyright (c) Jupyter Development Team.\n * Distributed under the terms of the Modified BSD License.\n */\n\n.jp-lineFormSearch {\n padding: 4px 12px;\n background-color: var(--jp-layout-color2);\n box-shadow: var(--jp-toolbar-box-shadow);\n z-index: 2;\n font-size: var(--jp-ui-font-size1);\n}\n\n.jp-lineFormCaption {\n font-size: var(--jp-ui-font-size0);\n line-height: var(--jp-ui-font-size1);\n margin-top: 4px;\n color: var(--jp-ui-font-color0);\n}\n\n.jp-baseLineForm {\n border: none;\n border-top-right-radius: var(--jp-border-radius);\n border-bottom-right-radius: var(--jp-border-radius);\n position: absolute;\n background-size: 16px;\n background-repeat: no-repeat;\n background-position: center;\n outline: none;\n}\n\n.jp-lineFormButtonContainer {\n top: 4px;\n right: 8px;\n height: 24px;\n padding: 0 12px;\n width: 12px;\n}\n\n.jp-lineFormButtonIcon {\n top: 0;\n right: 0;\n background-color: var(--jp-brand-color1);\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n padding: 4px 6px;\n}\n\n.jp-lineFormButton {\n top: 0;\n right: 0;\n background-color: transparent;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n}\n\n.jp-lineFormWrapper {\n overflow: hidden;\n padding: 0 8px;\n border: 1px solid var(--jp-border-color0);\n border-top-left-radius: var(--jp-border-radius);\n border-bottom-left-radius: var(--jp-border-radius);\n background-color: var(--jp-input-active-background);\n height: 22px;\n}\n\n.jp-lineFormWrapperFocusWithin {\n border: var(--jp-border-width) solid var(--jp-input-active-border-color);\n box-shadow: var(--jp-input-box-shadow);\n}\n\n.jp-lineFormInput {\n background: transparent;\n width: 200px;\n height: 100%;\n border: none;\n outline: none;\n color: var(--jp-ui-font-color0);\n padding: 0;\n}\n",""]);const l=a},29500:(e,t,n)=>{"use strict";n.d(t,{A:()=>u});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(4417);var l=n.n(a);var d=new URL(n(78269),n.b);var c=r()(s());var h=l()(d);c.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.cm-editor {\n line-height: var(--jp-code-line-height);\n font-size: var(--jp-code-font-size);\n font-family: var(--jp-code-font-family);\n border: 0;\n border-radius: 0;\n height: auto;\n\n /* Changed to auto to autogrow */\n}\n\n/* Suppress automatic focus indicator outline */\n.cm-editor.cm-focused {\n outline: unset;\n}\n\n.cm-editor pre {\n padding: 0 var(--jp-code-padding);\n}\n\n.jp-CodeMirrorEditor[data-type='inline'] .cm-dialog {\n background-color: var(--jp-layout-color0);\n color: var(--jp-content-font-color1);\n}\n\n.jp-CodeMirrorEditor {\n cursor: text;\n}\n\n/* When zoomed out 67% and 33% on a screen of 1440 width x 900 height */\n@media screen and (width >= 2138px) and (width <= 4319px) {\n .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {\n border-left: var(--jp-code-cursor-width1) solid\n var(--jp-editor-cursor-color);\n }\n}\n\n/* When zoomed out less than 33% */\n@media screen and (width >= 4320px) {\n .jp-CodeMirrorEditor[data-type='inline'] .cm-cursor {\n border-left: var(--jp-code-cursor-width2) solid\n var(--jp-editor-cursor-color);\n }\n}\n\n/* stylelint-disable selector-max-class */\n\n/* We need all this classes for higher specificity to override CodeMirror's rule */\n.cm-editor.jp-mod-readOnly > .cm-scroller > .cm-cursorLayer .cm-cursor {\n display: none;\n}\n\n/* stylelint-enable selector-max-class */\n\n.jp-CollaboratorCursor {\n border-left: 5px solid transparent;\n border-right: 5px solid transparent;\n border-top: none;\n border-bottom: 3px solid;\n background-clip: content-box;\n margin-left: -5px;\n margin-right: -5px;\n}\n\n.cm-builtin {\n color: var(--jp-mirror-editor-builtin-color);\n}\n\n.cm-searching,\n.cm-searching span {\n /* `.cm-searching span`: we need to override syntax highlighting */\n background-color: var(--jp-search-unselected-match-background-color);\n color: var(--jp-search-unselected-match-color);\n}\n\n.cm-searching::selection,\n.cm-searching span::selection {\n background-color: var(--jp-search-unselected-match-background-color);\n color: var(--jp-search-unselected-match-color);\n}\n\n.jp-current-match > .cm-searching,\n.jp-current-match > .cm-searching span,\n.cm-searching > .jp-current-match,\n.cm-searching > .jp-current-match span {\n background-color: var(--jp-search-selected-match-background-color);\n color: var(--jp-search-selected-match-color);\n}\n\n.jp-current-match > .cm-searching::selection,\n.jp-current-match > .cm-searching span::selection,\n.cm-searching > .jp-current-match::selection,\n.cm-searching > .jp-current-match span::selection {\n background-color: var(--jp-search-selected-match-background-color);\n color: var(--jp-search-selected-match-color);\n}\n\n.cm-trailingspace {\n background-image: url("+h+");\n background-position: center left;\n background-repeat: repeat-x;\n}\n\n.jp-CollaboratorCursor-hover {\n position: absolute;\n z-index: 1;\n transform: translateX(-50%);\n color: white;\n border-radius: 3px;\n padding-left: 4px;\n padding-right: 4px;\n padding-top: 1px;\n padding-bottom: 1px;\n text-align: center;\n font-size: var(--jp-ui-font-size1);\n white-space: nowrap;\n}\n\n.jp-CodeMirror-ruler {\n border-left: 1px dashed var(--jp-border-color2);\n}\n\n/* Styles for shared cursors (remote cursor locations and selected ranges) */\n.jp-CodeMirrorEditor .cm-ySelectionCaret {\n position: relative;\n border-left: 1px solid black;\n margin-left: -1px;\n margin-right: -1px;\n box-sizing: border-box;\n}\n\n.jp-CodeMirrorEditor .cm-ySelectionCaret > .cm-ySelectionInfo {\n white-space: nowrap;\n position: absolute;\n top: -1.15em;\n padding-bottom: 0.05em;\n left: -1px;\n font-size: 0.95em;\n font-family: var(--jp-ui-font-family);\n font-weight: bold;\n line-height: normal;\n user-select: none;\n color: white;\n padding-left: 2px;\n padding-right: 2px;\n z-index: 101;\n transition: opacity 0.3s ease-in-out;\n}\n\n.jp-CodeMirrorEditor .cm-ySelectionInfo {\n transition-delay: 0.7s;\n opacity: 0;\n}\n\n.jp-CodeMirrorEditor .cm-ySelectionCaret:hover > .cm-ySelectionInfo {\n opacity: 1;\n transition-delay: 0s;\n}\n",""]);const u=c},57331:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n:root {\n --jp-private-completer-item-height: 24px;\n\n /* Shift the baseline of the type character to align with the match text */\n --jp-private-completer-type-offset: 2px;\n}\n\n.jp-Completer {\n box-shadow: var(--jp-elevation-z6);\n background: var(--jp-layout-color1);\n color: var(--jp-content-font-color1);\n border: var(--jp-border-width) solid var(--jp-border-color1);\n padding: 0;\n display: flex;\n flex-direction: row;\n\n /* Needed to avoid scrollbar issues when using cached width. */\n box-sizing: content-box;\n\n /* Position the completer relative to the text editor, align the '.' */\n margin: 4px 0 0 -30px;\n z-index: 10001;\n}\n\n.jp-Completer-docpanel {\n border-left: var(--jp-border-width) solid var(--jp-border-color1);\n width: 400px;\n flex-shrink: 0;\n overflow-y: scroll;\n overflow-x: auto;\n padding: 8px;\n max-height: calc((10 * var(--jp-private-completer-item-height)) - 16px);\n}\n\n.jp-Completer-docpanel pre {\n border: none;\n margin: 0;\n padding: 0;\n white-space: pre-wrap;\n}\n\n.jp-Completer-list {\n margin: 0;\n padding: 0;\n list-style-type: none;\n overflow-y: scroll;\n overflow-x: hidden;\n max-height: calc((10 * var(--jp-private-completer-item-height)));\n min-height: calc(var(--jp-private-completer-item-height));\n width: 100%;\n}\n\n.jp-Completer-item {\n box-sizing: border-box;\n margin: 0;\n padding: 0;\n height: var(--jp-private-completer-item-height);\n min-width: 150px;\n display: grid;\n grid-template-columns: min-content 1fr min-content;\n position: relative;\n}\n\n.jp-Completer-item .jp-Completer-match {\n box-sizing: border-box;\n margin: 0;\n padding: 0 8px 0 6px;\n height: var(--jp-private-completer-item-height);\n font-family: var(--jp-code-font-family);\n font-size: var(--jp-code-font-size);\n line-height: var(--jp-private-completer-item-height);\n white-space: nowrap;\n}\n\n.jp-Completer-deprecated .jp-Completer-match {\n text-decoration: line-through;\n color: var(--jp-content-font-color2);\n}\n\n.jp-Completer-item .jp-Completer-type {\n box-sizing: border-box;\n height: var(--jp-private-completer-item-height);\n background: transparent;\n width: var(--jp-private-completer-item-height);\n}\n\n.jp-Completer-item .jp-Completer-icon {\n /* Normal element size from LabIconStyle.ISheetOptions */\n height: 16px;\n width: 16px;\n}\n\n.jp-Completer-item .jp-Completer-monogram {\n text-align: center;\n color: white;\n width: var(--jp-private-completer-item-height);\n font-family: var(--jp-ui-font-family);\n font-size: var(--jp-ui-font-size1);\n line-height: calc(\n var(--jp-private-completer-item-height) -\n var(--jp-private-completer-type-offset)\n );\n padding-bottom: var(--jp-private-completer-type-offset);\n}\n\n.jp-Completer-item .jp-Completer-typeExtended {\n box-sizing: border-box;\n height: var(--jp-private-completer-item-height);\n text-align: right;\n background: transparent;\n color: var(--jp-ui-font-color2);\n font-family: var(--jp-code-font-family);\n font-size: var(--jp-code-font-size);\n line-height: var(--jp-private-completer-item-height);\n padding-right: 8px;\n}\n\n.jp-Completer-item:hover {\n background: var(--jp-layout-color2);\n opacity: 0.8;\n}\n\n.jp-Completer-item.jp-mod-active {\n background: var(--jp-brand-color1);\n color: white;\n}\n\n.jp-Completer-item .jp-Completer-match mark {\n font-weight: bold;\n background: inherit;\n color: inherit;\n}\n\n.jp-Completer-type[data-color-index='0'] {\n background: var(--jp-completer-type-background0, transparent);\n}\n\n.jp-Completer-type[data-color-index='1'] {\n background: var(--jp-completer-type-background1, #1f77b4);\n}\n\n.jp-Completer-type[data-color-index='2'] {\n background: var(--jp-completer-type-background2, #ff7f0e);\n}\n\n.jp-Completer-type[data-color-index='3'] {\n background: var(--jp-completer-type-background3, #2ca02c);\n}\n\n.jp-Completer-type[data-color-index='4'] {\n background: var(--jp-completer-type-background4, #d62728);\n}\n\n.jp-Completer-type[data-color-index='5'] {\n background: var(--jp-completer-type-background5, #9467bd);\n}\n\n.jp-Completer-type[data-color-index='6'] {\n background: var(--jp-completer-type-background6, #8c564b);\n}\n\n.jp-Completer-type[data-color-index='7'] {\n background: var(--jp-completer-type-background7, #e377c2);\n}\n\n.jp-Completer-type[data-color-index='8'] {\n background: var(--jp-completer-type-background8, #7f7f7f);\n}\n\n.jp-Completer-type[data-color-index='9'] {\n background: var(--jp-completer-type-background9, #bcbd22);\n}\n\n.jp-Completer-type[data-color-index='10'] {\n background: var(--jp-completer-type-background10, #17becf);\n}\n\n.jp-Completer-loading-bar-container {\n height: 2px;\n width: calc(100% - var(--jp-private-completer-item-height));\n left: var(--jp-private-completer-item-height);\n position: absolute;\n overflow: hidden;\n top: 0;\n}\n\n.jp-Completer-loading-bar {\n height: 100%;\n width: 50%;\n background-color: var(--jp-accent-color2);\n position: absolute;\n left: -50%;\n animation: jp-Completer-loading 2s ease-in 0.5s infinite;\n}\n\n@keyframes jp-Completer-loading {\n 0% {\n transform: translateX(0);\n }\n\n 100% {\n transform: translateX(400%);\n }\n}\n\n.jp-GhostText {\n color: var(--jp-ui-font-color3);\n white-space: pre-wrap;\n}\n\n.jp-GhostText-lineSpacer,\n.jp-GhostText-letterSpacer {\n opacity: 0;\n display: inline-block;\n vertical-align: top;\n /* stylelint-disable-next-line csstree/validator */\n text-wrap: none;\n}\n\n.jp-GhostText-letterSpacer {\n max-width: 0;\n}\n\n.jp-GhostText-lineSpacer {\n /* duration and delay are overwritten by inline styles */\n animation: jp-GhostText-hide 300ms 700ms ease-out forwards;\n}\n\n@keyframes jp-GhostText-hide {\n 0% {\n font-size: unset;\n }\n\n 100% {\n font-size: 0;\n }\n}\n\n.jp-GhostText-expandHidden {\n border: 1px solid var(--jp-border-color0);\n border-radius: var(--jp-border-radius);\n background: var(--jp-layout-color0);\n color: var(--jp-content-font-color3);\n padding: 0 4px;\n margin: 0 4px;\n cursor: default;\n}\n\n.jp-GhostText-hiddenWrapper:hover > .jp-GhostText-hiddenLines {\n display: inline;\n}\n\n.jp-GhostText-hiddenLines {\n display: none;\n}\n\n.jp-GhostText[data-animation='uncover'] {\n position: relative;\n}\n\n.jp-GhostText-streamedToken {\n white-space: pre;\n}\n\n.jp-GhostText[data-animation='uncover'] > .jp-GhostText-streamedToken {\n animation: jp-GhostText-typing 2s forwards;\n display: inline-flex;\n overflow: hidden;\n}\n\n@keyframes jp-GhostText-typing {\n from {\n max-width: 0;\n }\n\n to {\n max-width: 100%;\n }\n}\n\n.jp-GhostText-streamingIndicator::after {\n animation: jp-GhostText-streaming 2s infinite;\n animation-delay: 400ms;\n content: ' ';\n background: var(--jp-layout-color4);\n opacity: 0.2;\n}\n\n@keyframes jp-GhostText-streaming {\n 0% {\n opacity: 0.2;\n }\n\n 20% {\n opacity: 0.4;\n }\n\n 40% {\n opacity: 0.2;\n }\n}\n\n.jp-GhostText-errorIndicator::after {\n animation: jp-GhostText-error 500ms 1;\n animation-delay: 3500ms;\n color: var(--jp-error-color1);\n font-size: 150%;\n line-height: 10px;\n margin-left: 2px;\n padding: 0 4px;\n content: '⚠';\n cursor: help;\n position: relative;\n top: 2px;\n}\n\n@keyframes jp-GhostText-error {\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n}\n\n.jp-InlineCompleter {\n box-shadow: var(--jp-elevation-z2);\n background: var(--jp-layout-color1);\n color: var(--jp-content-font-color1);\n border: var(--jp-border-width) solid var(--jp-border-color1);\n display: flex;\n flex-direction: row;\n align-items: center;\n padding: 0 8px;\n}\n\n.jp-InlineCompleter-progressBar {\n height: 2px;\n position: absolute;\n top: 0;\n left: 0;\n background-color: var(--jp-accent-color2);\n}\n\n.jp-InlineCompleter[data-display='onHover'] {\n opacity: 0;\n transition:\n visibility 0s linear 0.1s,\n opacity 0.1s linear;\n visibility: hidden;\n}\n\n.jp-InlineCompleter[data-display='onHover']:hover,\n.jp-InlineCompleter-hover[data-display='onHover'] {\n opacity: 1;\n visibility: visible;\n transition-delay: 0s;\n}\n\n.jp-InlineCompleter[data-display='never'] {\n display: none;\n}\n\n.jp-InlineCompleter > .jp-Toolbar {\n box-shadow: none;\n border-bottom: none;\n background: none;\n}\n\n.jp-InlineCompleter[data-show-shortcuts='false']\n .jp-ToolbarButtonComponent-label {\n display: none;\n}\n\n.jp-InlineCompleter [data-command='inline-completer:next'] > svg,\n.jp-InlineCompleter [data-command='inline-completer:previous'] > svg {\n scale: 1.5;\n}\n",""]);const l=a},19961:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n/* Toolbar menu to select the prompt cell position */\n.jp-CodeConsolePromptMenu {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n}\n\n.jp-CodeConsolePromptMenu .lm-Menu-itemIcon > svg {\n vertical-align: sub;\n}\n",""]);const l=a},16513:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-ConsolePanel {\n display: flex;\n margin-top: -1px;\n min-width: 240px;\n min-height: 120px;\n}\n\n.jp-CodeConsole {\n height: 100%;\n padding: 0;\n display: flex;\n}\n\n.jp-CodeConsole .jp-Cell {\n padding: var(--jp-cell-padding);\n}\n\n/*-----------------------------------------------------------------------------\n| Content (already run cells)\n|----------------------------------------------------------------------------*/\n\n.jp-CodeConsole-content {\n background: var(--jp-layout-color0);\n overflow: auto;\n padding: 0 var(--jp-console-padding);\n min-width: calc(10 * var(--jp-ui-font-size1));\n min-height: calc(5 * var(--jp-ui-font-size1));\n}\n\n.jp-CodeConsole-content .jp-Cell:not(.jp-mod-active) .jp-InputPrompt {\n opacity: var(--jp-cell-prompt-not-active-opacity);\n color: var(--jp-cell-inprompt-font-color);\n cursor: move;\n}\n\n.jp-CodeConsole-content .jp-Cell:not(.jp-mod-active) .jp-OutputPrompt {\n opacity: var(--jp-cell-prompt-not-active-opacity);\n color: var(--jp-cell-outprompt-font-color);\n}\n\n/* This rule is for styling cell run by another activity in this console */\n\n/* .jp-CodeConsole-content .jp-Cell.jp-CodeConsole-foreignCell {\n} */\n\n.jp-CodeConsole-content .jp-InputArea-editor.jp-InputArea-editor {\n background: transparent;\n border: 1px solid transparent;\n}\n\n.jp-CodeConsole-content .jp-CodeConsole-banner .jp-InputPrompt {\n display: none;\n}\n\n/* collapser is hovered */\n.jp-CodeConsole-content .jp-Cell .jp-Collapser:hover {\n box-shadow: var(--jp-elevation-z2);\n background: var(--jp-brand-color1);\n opacity: var(--jp-cell-collapser-not-active-hover-opacity);\n}\n\n/*-----------------------------------------------------------------------------\n| Input/prompt cell\n|----------------------------------------------------------------------------*/\n\n.jp-CodeConsole-input {\n overflow: auto;\n padding: var(--jp-cell-padding) var(--jp-console-padding);\n\n /* This matches the box shadow on the notebook toolbar, eventually we should create\n * CSS variables for this */\n box-shadow: 0 0.4px 6px 0 rgba(0, 0, 0, 0.1);\n background: var(--jp-layout-color0);\n min-width: calc(10 * var(--jp-ui-font-size1));\n min-height: calc(4 * var(--jp-ui-font-size1));\n}\n\n.jp-CodeConsole-input .jp-CodeConsole-prompt .jp-InputArea {\n height: 100%;\n min-height: 100%;\n}\n\n.jp-CodeConsole-promptCell .jp-InputArea-editor.jp-mod-focused {\n border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);\n box-shadow: var(--jp-input-box-shadow);\n background-color: var(--jp-cell-editor-active-background);\n}\n\n/*-----------------------------------------------------------------------------\n| Presentation Mode (.jp-mod-presentationMode)\n|----------------------------------------------------------------------------*/\n\n.jp-mod-presentationMode .jp-CodeConsole {\n --jp-content-font-size1: var(--jp-content-presentation-font-size1);\n --jp-code-font-size: var(--jp-code-presentation-font-size);\n}\n\n.jp-mod-presentationMode .jp-CodeConsole .jp-Cell .jp-InputPrompt,\n.jp-mod-presentationMode .jp-CodeConsole .jp-Cell .jp-OutputPrompt {\n flex: 0 0 110px;\n}\n\n/*-----------------------------------------------------------------------------\n| Split Panel Container\n|----------------------------------------------------------------------------*/\n.jp-CodeConsole-split {\n display: flex;\n height: 100%;\n width: 100%;\n overflow: hidden;\n}\n\n.jp-CodeConsole-split.lm-SplitPanel .lm-SplitPanel-handle::after {\n background-color: var(--jp-border-color2);\n min-height: calc(2 * var(--jp-border-width));\n min-width: calc(2 * var(--jp-border-width));\n}\n\n/*-----------------------------------------------------------------------------\n| Mobile\n|----------------------------------------------------------------------------*/\n@media only screen and (width <= 760px) {\n .jp-CodeConsole-input {\n min-height: calc(6 * var(--jp-ui-font-size1));\n }\n}\n",""]);const l=a},40538:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-CSVViewer {\n display: flex;\n flex-direction: column;\n outline: none;\n\n /* This is needed so that all font sizing of children done in ems is\n * relative to this base size */\n font-size: var(--jp-ui-font-size1);\n}\n\n.jp-CSVDelimiter {\n display: flex;\n flex: 0 0 auto;\n flex-direction: row;\n border: none;\n min-height: 24px;\n background: var(--jp-toolbar-background);\n z-index: 1;\n}\n\n.jp-CSVDelimiter .jp-CSVDelimiter-label {\n color: var(--jp-ui-font-color1);\n font-size: var(--jp-ui-font-size1);\n padding-left: 8px;\n padding-right: 8px;\n}\n\n.jp-CSVDelimiter .jp-CSVDelimiter-dropdown {\n flex: 0 0 auto;\n vertical-align: middle;\n border-radius: 0;\n outline: none;\n height: 20px;\n margin-top: 2px;\n margin-bottom: 2px;\n}\n\n.jp-CSVDelimiter .jp-CSVDelimiter-dropdown select.jp-mod-styled {\n color: var(--jp-ui-font-color1);\n background: var(--jp-layout-color1);\n font-size: var(--jp-ui-font-size1);\n height: 20px;\n padding-right: 20px;\n}\n\n.jp-CSVViewer-grid {\n flex: 1 1 auto;\n}\n",""]);const l=a},1597:(e,t,n)=>{"use strict";n.d(t,{A:()=>g});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=n(21584);var l=n(41076);var d=n(26933);var c=n(41575);var h=n(16204);var u=n(52498);var p=n(11919);var m=r()(s());m.i(a.A);m.i(l.A);m.i(d.A);m.i(c.A);m.i(h.A);m.i(u.A);m.i(p.A);m.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-left-truncated {\n overflow: hidden;\n text-overflow: ellipsis;\n direction: rtl;\n}\n\n#jp-debugger .jp-switch-label {\n margin-right: 0;\n}\n\n.jp-DebuggerBugButton[aria-pressed='true'] {\n /* Undo default toolkit style */\n box-shadow: none;\n}\n\n.jp-DebuggerBugButton[aria-pressed='true'] path {\n fill: var(--jp-warn-color0);\n}\n",""]);const g=m},21584:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerBreakpoints {\n display: flex;\n flex-direction: column;\n min-height: 50px;\n padding-top: 3px;\n}\n\n.jp-DebuggerBreakpoints-body {\n padding: 10px;\n overflow: auto;\n}\n\n.jp-DebuggerBreakpoint {\n display: flex;\n align-items: center;\n}\n\n.jp-DebuggerBreakpoint:hover {\n background: var(--jp-layout-color2);\n cursor: pointer;\n}\n\n.jp-DebuggerBreakpoint-marker {\n font-size: 20px;\n padding-right: 5px;\n content: '●';\n color: var(--jp-error-color1);\n}\n\n.jp-DebuggerBreakpoint-source {\n white-space: nowrap;\n margin-right: 5px;\n}\n\n.jp-DebuggerBreakpoint-line {\n margin-left: auto;\n}\n\n.jp-DebuggerCallstackFrame {\n display: flex;\n align-items: center;\n}\n\n.jp-DebuggerCallstackFrame-name {\n white-space: nowrap;\n margin-right: 5px;\n}\n\n.jp-DebuggerCallstackFrame-location {\n margin-left: auto;\n}\n\n[data-jp-debugger='true'] .cm-breakpoint-gutter .cm-gutterElement:empty::after {\n content: '●';\n color: var(--jp-error-color1);\n opacity: 0;\n}\n\n.cm-gutter {\n cursor: default;\n}\n\n.cm-breakpoint-gutter .cm-gutterElement {\n color: var(--jp-error-color1);\n padding-left: 5px;\n font-size: 20px;\n position: relative;\n top: -5px;\n}\n\n[data-jp-debugger='true'].jp-Editor\n .cm-breakpoint-gutter\n .cm-gutterElement:empty:hover::after,\n[data-jp-debugger='true']\n .jp-Notebook\n .jp-CodeCell.jp-mod-selected\n .cm-breakpoint-gutter:empty:hover::after,\n[data-jp-debugger='true']\n .jp-Editor\n .cm-breakpoint-gutter\n .cm-gutterElement:empty:hover::after {\n opacity: 0.5;\n}\n",""]);const l=a},41076:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerCallstack {\n display: flex;\n flex-direction: column;\n min-height: 50px;\n padding-top: 3px;\n}\n\n.jp-DebuggerCallstack-body {\n overflow: auto;\n}\n\n.jp-DebuggerCallstack-body ul {\n list-style: none;\n margin: 0;\n padding: 0;\n background: var(--jp-layout-color1);\n color: var(--jp-ui-font-color1);\n font-size: var(--jp-ui-font-size1);\n}\n\n.jp-DebuggerCallstack-body li {\n padding: 5px;\n padding-left: 8px;\n}\n\n.jp-DebuggerCallstack-body li.selected {\n color: white;\n background: var(--jp-brand-color1);\n}\n\n.jp-DebuggerCallstack .jp-ToolbarButtonComponent-label {\n display: none;\n}\n",""]);const l=a},26933:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerEditor-highlight {\n text-shadow: 0 0 1px var(--jp-layout-color0);\n outline: 1px solid;\n}\n\nbody[data-jp-theme-light='false'] .jp-DebuggerEditor-highlight {\n background-color: var(--md-brown-800, #4e342e);\n outline-color: var(--md-brown-600, #6d4c41);\n}\n\nbody[data-jp-theme-light='true'] .jp-DebuggerEditor-highlight {\n background-color: var(--md-brown-100, #d7ccc8);\n outline-color: var(--md-brown-300, #a1887f);\n}\n\n.jp-DebuggerEditor-marker {\n position: absolute;\n left: -34px;\n top: -1px;\n color: var(--jp-error-color1);\n}\n",""]);const l=a},41575:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerKernelSources {\n min-height: 50px;\n margin-top: 3px;\n}\n\n[data-jp-debugger='true'].jp-Editor .jp-mod-readOnly {\n background: var(--jp-layout-color2);\n height: 100%;\n}\n\n.jp-DebuggerKernelSources-body [data-jp-debugger='true'].jp-Editor {\n height: 100%;\n}\n\n.jp-DebuggerKernelSources-body {\n height: 100%;\n overflow-y: auto;\n}\n\n.jp-DebuggerKernelSource-filterBox {\n padding: 0;\n flex: 0 0 auto;\n margin: 0;\n position: sticky;\n top: 0;\n background-color: var(--jp-layout-color1);\n}\n\n.jp-DebuggerKernelSource-filterBox-hidden {\n display: none;\n}\n\n.jp-DebuggerKernelSource-source {\n display: flex;\n align-items: center;\n padding: 4px;\n cursor: pointer;\n}\n\n.jp-DebuggerKernelSource-source:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.jp-DebuggerKernelSource-source > svg {\n height: 16px;\n width: 16px;\n}\n",""]);const l=a},16204:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-SidePanel-header > h2 {\n /* Set font-size to override default h2 sizing but keeping default --jp-ui-font-size0 */\n font-size: 100%;\n font-weight: 600;\n margin: 0 auto 0 0;\n padding: 4px 10px;\n}\n\n.jp-DebuggerSidebar-body\n .jp-AccordionPanel-title\n jp-toolbar::part(positioning-region) {\n flex-wrap: nowrap;\n}\n",""]);const l=a},52498:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerSources {\n min-height: 50px;\n margin-top: 3px;\n}\n\n[data-jp-debugger='true'].jp-Editor .jp-mod-readOnly {\n background: var(--jp-layout-color2);\n height: 100%;\n}\n\n.jp-DebuggerSources-body [data-jp-debugger='true'].jp-Editor {\n height: 100%;\n}\n\n.jp-DebuggerSources-body {\n height: 100%;\n}\n\n.jp-DebuggerSources-header-path {\n overflow: hidden;\n cursor: pointer;\n text-overflow: ellipsis;\n white-space: nowrap;\n font-size: var(--jp-ui-font-size0);\n color: var(--jp-ui-font-color1);\n user-select: text;\n}\n",""]);const l=a},11919:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-DebuggerVariables {\n display: flex;\n flex-direction: column;\n min-height: 50px;\n padding-top: 3px;\n}\n\n.jp-DebuggerVariables-body {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 24px;\n overflow: auto;\n\n /* For absolute positioning of jp-DebuggerVariables-buttons. */\n position: relative;\n}\n\n.jp-DebuggerVariables-name {\n color: var(--jp-mirror-editor-attribute-color);\n grid-area: name;\n}\n\n.jp-DebuggerVariables-name:last-of-type {\n flex: 1 1 auto;\n}\n\n.jp-DebuggerVariables-name::after {\n content: ':';\n margin-right: 5px;\n}\n\n.jp-DebuggerVariables-detail {\n /* detail contains value for primitive types or name of the type otherwise */\n color: var(--jp-mirror-editor-string-color);\n flex: 1 1 auto;\n overflow: hidden;\n white-space: nowrap;\n text-overflow: ellipsis;\n}\n\n.jp-DebuggerVariables-grid {\n flex: 1 1 auto;\n}\n\n.jp-DebuggerVariables-grid .lm-DataGrid {\n border: none;\n}\n\n.jp-DebuggerVariables-colorPalette {\n visibility: hidden;\n z-index: -999;\n position: absolute;\n left: -999px;\n top: -999px;\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-void {\n color: var(--jp-layout-color1);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-background {\n color: var(--jp-rendermime-table-row-background);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-header-background {\n color: var(--jp-layout-color2);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-grid-line {\n color: var(--jp-border-color3);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-header-grid-line {\n color: var(--jp-border-color3);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-selection {\n /* TODO: Fix JupyterLab light theme (alpha) so this can be a variable. */\n color: rgba(3, 169, 244, 0.2);\n}\n\n.jp-DebuggerVariables-colorPalette .jp-mod-text {\n color: var(--jp-content-font-color0);\n}\n\n.jp-VariableRendererPanel {\n overflow: auto;\n}\n\n.jp-VariableRendererPanel-renderer {\n overflow: auto;\n height: 100%;\n}\n\n.jp-VariableRenderer-TrustButton[aria-pressed='true'] {\n box-shadow: inset 0 var(--jp-border-width) 4px\n rgba(\n var(--jp-shadow-base-lightness),\n var(--jp-shadow-base-lightness),\n var(--jp-shadow-base-lightness),\n 0.6\n );\n}\n\n.jp-DebuggerRichVariable div[data-mime-type='text/plain'] > pre {\n white-space: normal;\n}\n",""]);const l=a},79993:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n\n.jp-MimeDocument {\n outline: none;\n}\n",""]);const l=a},20939:(e,t,n)=>{"use strict";n.d(t,{A:()=>l});var i=n(31601);var s=n.n(i);var o=n(76314);var r=n.n(o);var a=r()(s());a.push([e.id,"/*-----------------------------------------------------------------------------\n| Copyright (c) Jupyter Development Team.\n| Distributed under the terms of the Modified BSD License.\n|----------------------------------------------------------------------------*/\n.jp-DocumentSearch-input {\n border: none;\n outline: none;\n color: var(--jp-ui-font-color0);\n font-size: var(--jp-ui-font-size1);\n background-color: var(--jp-layout-color0);\n font-family: var(--jp-ui-font-family);\n padding: 2px 1px;\n resize: none;\n white-space: pre;\n}\n\n.jp-DocumentSearch-overlay {\n position: absolute;\n background-color: var(--jp-toolbar-background);\n border-bottom: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n border-left: var(--jp-border-width) solid var(--jp-toolbar-border-color);\n top: 0;\n right: 0;\n z-index: 7;\n min-width: 405px;\n padding: 2px;\n font-size: var(--jp-ui-font-size1);\n\n --jp-private-document-search-button-height: 20px;\n}\n\n.jp-DocumentSearch-overlay button {\n background-color: var(--jp-toolbar-background);\n outline: 0;\n}\n\n.jp-DocumentSearch-button-wrapper:disabled > .jp-DocumentSearch-button-content {\n opacity: 0.6;\n cursor: not-allowed;\n}\n\n.jp-DocumentSearch-overlay button:not(:disabled):hover {\n background-color: var(--jp-layout-color2);\n}\n\n.jp-DocumentSearch-overlay button:not(:disabled):active {\n background-color: var(--jp-layout-color3);\n}\n\n.jp-DocumentSearch-overlay-row {\n display: flex;\n align-items: center;\n margin-bottom: 2px;\n}\n\n.jp-DocumentSearch-button-content {\n display: inline-block;\n cursor: pointer;\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n}\n\n.jp-DocumentSearch-button-content svg {\n width: 100%;\n height: 100%;\n}\n\n.jp-DocumentSearch-input-wrapper {\n border: var(--jp-border-width) solid var(--jp-border-color0);\n display: flex;\n background-color: var(--jp-layout-color0);\n margin: 2px;\n}\n\n.jp-DocumentSearch-input-wrapper:focus-within {\n border-color: var(--jp-cell-editor-active-border-color);\n}\n\n.jp-DocumentSearch-toggle-wrapper,\n.jp-DocumentSearch-button-wrapper {\n all: initial;\n overflow: hidden;\n display: inline-block;\n border: none;\n box-sizing: border-box;\n}\n\n.jp-DocumentSearch-toggle-wrapper {\n flex-shrink: 0;\n width: 14px;\n height: 14px;\n}\n\n.jp-DocumentSearch-button-wrapper {\n flex-shrink: 0;\n width: var(--jp-private-document-search-button-height);\n height: var(--jp-private-document-search-button-height);\n}\n\n.jp-DocumentSearch-toggle-wrapper:focus,\n.jp-DocumentSearch-button-wrapper:focus {\n outline: var(--jp-border-width) solid\n var(--jp-cell-editor-active-border-color);\n outline-offset: -1px;\n}\n\n.jp-DocumentSearch-toggle-wrapper,\n.jp-DocumentSearch-button-wrapper,\n.jp-DocumentSearch-button-content:focus {\n outline: none;\n}\n\n.jp-DocumentSearch-toggle-placeholder {\n width: 5px;\n}\n\n.jp-DocumentSearch-input-button::before {\n display: block;\n padding-top: 100%;\n}\n\n.jp-DocumentSearch-input-button-off {\n opacity: var(--jp-search-toggle-off-opacity);\n}\n\n.jp-DocumentSearch-input-button-off:hover {\n opacity: var(--jp-search-toggle-hover-opacity);\n}\n\n.jp-DocumentSearch-input-button-on {\n opacity: var(--jp-search-toggle-on-opacity);\n}\n\n.jp-DocumentSearch-index-counter {\n padding-left: 10px;\n padding-right: 10px;\n user-select: none;\n min-width: 35px;\n display: inline-block;\n}\n\n.jp-DocumentSearch-up-down-wrapper {\n display: inline-block;\n padding-right: 2px;\n margin-left: auto;\n white-space: nowrap;\n}\n\n.jp-DocumentSearch-spacer {\n margin-left: auto;\n}\n\n.jp-DocumentSearch-up-down-wrapper button {\n outline: 0;\n border: none;\n width: var(--jp-private-document-search-button-height);\n height: var(--jp-private-document-search-button-height);\n vertical-align: middle;\n margin: 1px 5px 2px;\n}\n\nbutton:not(:disabled) > .jp-DocumentSearch-up-down-button:hover {\n background-color: var(--jp-layout-color2);\n}\n\nbutton:not(:disabled) > .jp-DocumentSearch-up-down-button:active {\n background-color: var(--jp-layout-color3);\n}\n\n.jp-DocumentSearch-filter-button {\n border-radius: var(--jp-border-radius);\n}\n\n.jp-DocumentSearch-filter-button:hover {\n background-color: var(--jp-layout-color2);\n}\n\n.jp-DocumentSearch-filter-button-enabled {\n background-color: var(--jp-layout-color2);\n}\n\n.jp-DocumentSearch-filter-button-enabled:hover {\n background-color: var(--jp-layout-color3);\n}\n\n.jp-DocumentSearch-search-options {\n padding: 0 8px;\n margin-left: 3px;\n width: 100%;\n display: grid;\n justify-content: start;\n grid-template-columns: 1fr 1fr;\n align-items: center;\n justify-items: stretch;\n}\n\n.jp-DocumentSearch-search-filter-disabled {\n color: var(--jp-ui-font-color2);\n}\n\n.jp-DocumentSearch-search-filter {\n display: flex;\n align-items: center;\n user-select: none;\n}\n\n.jp-DocumentSearch-regex-error {\n color: var(--jp-error-color0);\n}\n\n.jp-DocumentSearch-replace-button-wrapper {\n overflow: hidden;\n display: inline-block;\n box-sizing: border-box;\n border: var(--jp-border-width) solid var(--jp-border-color0);\n margin: auto 2px;\n padding: 1px 4px;\n height: calc(var(--jp-private-document-search-button-height) + 2px);\n flex-shrink: 0;\n}\n\n.jp-DocumentSearch-replace-button-wrapper:focus {\n border: var(--jp-border-width) solid var(--jp-cell-editor-active-border-color);\n}\n\n.jp-DocumentSearch-replace-button {\n display: inline-block;\n text-align: center;\n cursor: pointer;\n box-sizing: border-box;\n color: var(--jp-ui-font-color1);\n\n /* height - 2 * (padding of wrapper) */\n line-height: calc(var(--jp-private-document-search-button-height) - 2px);\n width: 100%;\n height: 100%;\n}\n\n.jp-DocumentSearch-replace-button:focus {\n outline: none;\n}\n\n.jp-DocumentSearch-replace-wrapper-class {\n margin-left: 14px;\n display: flex;\n}\n\n.jp-DocumentSearch-replace-toggle {\n border: none;\n background-color: var(--jp-toolbar-background);\n border-radius: var(--jp-border-radius);\n}\n\n.jp-DocumentSearch-replace-toggle:hover {\n background-color: var(--jp-layout-color2);\n}\n\n/*\n The following few rules allow the search box to expand horizontally,\n as the text within it grows. This is done by using putting\n the text within a wrapper element and using that wrapper for sizing,\n as