blockly 12.0.0 → 12.0.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/blockly.min.js CHANGED
@@ -214,15 +214,15 @@ loadInputBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.i
214
214
  loadNextBlocks$$module$build$src$core$serialization$blocks=function(a,b){if(b.next){if(!a.nextConnection)throw new MissingConnection$$module$build$src$core$serialization$exceptions("next",a,b);loadConnection$$module$build$src$core$serialization$blocks(a.nextConnection,b.next)}};loadConnection$$module$build$src$core$serialization$blocks=function(a,b){b.shadow&&a.setShadowState(b.shadow);b.block&&appendPrivate$$module$build$src$core$serialization$blocks(b.block,a.getSourceBlock().workspace,{parentConnection:a})};
215
215
  initBlock$$module$build$src$core$serialization$blocks=function(a,b){if(b){a.setConnectionTracking(!1);a.initSvg();a.queueRender();for(const c of a.getIcons())c.onLocationChange(a.getRelativeToSurfaceXY())}else a.initModel()};hasBubble$$module$build$src$core$interfaces$i_has_bubble=function(a){return void 0!==a.bubbleIsVisible&&void 0!==a.setBubbleVisible};toRadians$$module$build$src$core$utils$math=function(a){return a*Math.PI/180};
216
216
  toDegrees$$module$build$src$core$utils$math=function(a){return 180*a/Math.PI};clamp$$module$build$src$core$utils$math=function(a,b,c){if(c<a){const d=c;c=a;a=d}return Math.max(a,Math.min(b,c))};
217
- createDom$$module$build$src$core$dropdowndiv=function(){document.querySelector(".blocklyDropDownDiv")||(div$$module$build$src$core$dropdowndiv=document.createElement("div"),div$$module$build$src$core$dropdowndiv.className="blocklyDropDownDiv",(getParentContainer$$module$build$src$core$common()||document.body).appendChild(div$$module$build$src$core$dropdowndiv),content$$module$build$src$core$dropdowndiv=document.createElement("div"),content$$module$build$src$core$dropdowndiv.className="blocklyDropDownContent",
218
- div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$core$dropdowndiv),arrow$$module$build$src$core$dropdowndiv=document.createElement("div"),arrow$$module$build$src$core$dropdowndiv.className="blocklyDropDownArrow",div$$module$build$src$core$dropdowndiv.appendChild(arrow$$module$build$src$core$dropdowndiv),div$$module$build$src$core$dropdowndiv.style.opacity="0",div$$module$build$src$core$dropdowndiv.style.transition="transform "+ANIMATION_TIME$$module$build$src$core$dropdowndiv+
217
+ createDom$$module$build$src$core$dropdowndiv=function(){document.querySelector(".blocklyDropDownDiv")||(div$$module$build$src$core$dropdowndiv=document.createElement("div"),div$$module$build$src$core$dropdowndiv.className="blocklyDropDownDiv",div$$module$build$src$core$dropdowndiv.tabIndex=-1,(getParentContainer$$module$build$src$core$common()||document.body).appendChild(div$$module$build$src$core$dropdowndiv),content$$module$build$src$core$dropdowndiv=document.createElement("div"),content$$module$build$src$core$dropdowndiv.className=
218
+ "blocklyDropDownContent",div$$module$build$src$core$dropdowndiv.appendChild(content$$module$build$src$core$dropdowndiv),arrow$$module$build$src$core$dropdowndiv=document.createElement("div"),arrow$$module$build$src$core$dropdowndiv.className="blocklyDropDownArrow",div$$module$build$src$core$dropdowndiv.appendChild(arrow$$module$build$src$core$dropdowndiv),div$$module$build$src$core$dropdowndiv.style.opacity="0",div$$module$build$src$core$dropdowndiv.style.transition="transform "+ANIMATION_TIME$$module$build$src$core$dropdowndiv+
219
219
  "s, opacity "+ANIMATION_TIME$$module$build$src$core$dropdowndiv+"s")};setBoundsElement$$module$build$src$core$dropdowndiv=function(a){boundsElement$$module$build$src$core$dropdowndiv=a};getOwner$$module$build$src$core$dropdowndiv=function(){return owner$$module$build$src$core$dropdowndiv};getContentDiv$$module$build$src$core$dropdowndiv=function(){return content$$module$build$src$core$dropdowndiv};
220
220
  clearContent$$module$build$src$core$dropdowndiv=function(){div$$module$build$src$core$dropdowndiv.remove();createDom$$module$build$src$core$dropdowndiv()};setColour$$module$build$src$core$dropdowndiv=function(a,b){div$$module$build$src$core$dropdowndiv.style.backgroundColor=a;div$$module$build$src$core$dropdowndiv.style.borderColor=b};
221
- showPositionedByBlock$$module$build$src$core$dropdowndiv=function(a,b,c,d){return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfBlock$$module$build$src$core$dropdowndiv(b),a,c,d)};showPositionedByField$$module$build$src$core$dropdowndiv=function(a,b,c){positionToField$$module$build$src$core$dropdowndiv=!0;return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfField$$module$build$src$core$dropdowndiv(a),a,b,c)};
221
+ showPositionedByBlock$$module$build$src$core$dropdowndiv=function(a,b,c,d,e=!0){return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfBlock$$module$build$src$core$dropdowndiv(b),a,e,c,d)};showPositionedByField$$module$build$src$core$dropdowndiv=function(a,b,c,d=!0){positionToField$$module$build$src$core$dropdowndiv=!0;return showPositionedByRect$$module$build$src$core$dropdowndiv(getScaledBboxOfField$$module$build$src$core$dropdowndiv(a),a,d,b,c)};
222
222
  getScaledBboxOfBlock$$module$build$src$core$dropdowndiv=function(a){var b=a.getSvgRoot();const c=a.workspace.scale,d=a.height*c;a=a.width*c;b=getPageOffset$$module$build$src$core$utils$style(b);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)};getScaledBboxOfField$$module$build$src$core$dropdowndiv=function(a){a=a.getScaledBBox();return new Rect$$module$build$src$core$utils$rect(a.top,a.bottom,a.left,a.right)};
223
- showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e=!0){const f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;d&&(a+=d);d=b.getSourceBlock();let h=d.workspace;for(;h.options.parentWorkspace;)h=h.options.parentWorkspace;setBoundsElement$$module$build$src$core$dropdowndiv(h.getParentSvg().parentNode);return show$$module$build$src$core$dropdowndiv(b,d.RTL,f,g,f,a,e,c)};
223
+ showPositionedByRect$$module$build$src$core$dropdowndiv=function(a,b,c,d,e){const f=a.left+(a.right-a.left)/2,g=a.bottom;a=a.top;e&&(a+=e);e=b.getSourceBlock();let h=e.workspace;for(;h.options.parentWorkspace;)h=h.options.parentWorkspace;setBoundsElement$$module$build$src$core$dropdowndiv(h.getParentSvg().parentNode);return show$$module$build$src$core$dropdowndiv(b,e.RTL,f,g,f,a,c,d)};
224
224
  show$$module$build$src$core$dropdowndiv=function(a,b,c,d,e,f,g,h){owner$$module$build$src$core$dropdowndiv=a;onHide$$module$build$src$core$dropdowndiv=h||null;div$$module$build$src$core$dropdowndiv.style.direction=b?"rtl":"ltr";a=getMainWorkspace$$module$build$src$core$common();renderedClassName$$module$build$src$core$dropdowndiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$dropdowndiv=a.getTheme().getClassName();addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,
225
- renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));return positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f)};
225
+ renderedClassName$$module$build$src$core$dropdowndiv);addClass$$module$build$src$core$utils$dom(div$$module$build$src$core$dropdowndiv,themeClassName$$module$build$src$core$dropdowndiv);c=positionInternal$$module$build$src$core$dropdowndiv(c,d,e,f);g&&(returnEphemeralFocus$$module$build$src$core$dropdowndiv=$.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(div$$module$build$src$core$dropdowndiv));return c};
226
226
  getPositionBelowMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b,finalX:a.divX,finalY:b+PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:-(ARROW_SIZE$$module$build$src$core$dropdowndiv/2+BORDER_SIZE$$module$build$src$core$dropdowndiv),arrowAtTop:!0,arrowVisible:!0}};
227
227
  getPositionAboveMetrics$$module$build$src$core$dropdowndiv=function(a,b,c,d){a=getPositionX$$module$build$src$core$dropdowndiv(a,c.left,c.right,d.width);return{initialX:a.divX,initialY:b-d.height,finalX:a.divX,finalY:b-d.height-PADDING_Y$$module$build$src$core$dropdowndiv,arrowX:a.arrowX,arrowY:d.height-2*BORDER_SIZE$$module$build$src$core$dropdowndiv-ARROW_SIZE$$module$build$src$core$dropdowndiv/2,arrowAtTop:!1,arrowVisible:!0}};
228
228
  getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv=function(a,b,c){a=getPositionX$$module$build$src$core$dropdowndiv(a,b.left,b.right,c.width);return{initialX:a.divX,initialY:0,finalX:a.divX,finalY:0,arrowAtTop:null,arrowX:null,arrowY:null,arrowVisible:!1}};
@@ -271,8 +271,8 @@ replaceMessageReferences$$module$build$src$core$utils$parsing=function(a){if("st
271
271
  checkMessageReferences$$module$build$src$core$utils$parsing=function(a){let b=!0;const c=$.Msg$$module$build$src$core$msg,d=a.match(/%{BKY_[A-Z]\w*}/gi);if(d)for(let e=0;e<d.length;e++){const f=d[e].toUpperCase();void 0===c[f.slice(6,-1)]&&(console.warn("No message string for "+d[e]+" in "+a),b=!1)}return b};
272
272
  parseBlockColour$$module$build$src$core$utils$parsing=function(a){const b="string"===typeof a?replaceMessageReferences$$module$build$src$core$utils$parsing(a):a;var c=Number(b);if(!isNaN(c)&&0<=c&&360>=c)return{hue:c,hex:hsvToHex$$module$build$src$core$utils$colour(c,getHsvSaturation$$module$build$src$core$utils$colour(),255*getHsvValue$$module$build$src$core$utils$colour())};if(c=parse$$module$build$src$core$utils$colour(b))return{hue:null,hex:c};c='Invalid colour: "'+b+'"';a!==b&&(c+=' (from "'+
273
273
  a+'")');throw Error(c);};getDiv$$module$build$src$core$widgetdiv=function(){return containerDiv$$module$build$src$core$widgetdiv};testOnly_setDiv$$module$build$src$core$widgetdiv=function(a){containerDiv$$module$build$src$core$widgetdiv=a;if(null===a){let b;null==(b=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv))||b.remove()}};
274
- createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body;document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv)?containerDiv$$module$build$src$core$widgetdiv=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv):(containerDiv$$module$build$src$core$widgetdiv=document.createElement("div"),containerDiv$$module$build$src$core$widgetdiv.className=containerClassName$$module$build$src$core$widgetdiv);
275
- a.appendChild(containerDiv$$module$build$src$core$widgetdiv)};
274
+ createDom$$module$build$src$core$widgetdiv=function(){const a=getParentContainer$$module$build$src$core$common()||document.body;document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv)?containerDiv$$module$build$src$core$widgetdiv=document.querySelector("."+containerClassName$$module$build$src$core$widgetdiv):(containerDiv$$module$build$src$core$widgetdiv=document.createElement("div"),containerDiv$$module$build$src$core$widgetdiv.className=containerClassName$$module$build$src$core$widgetdiv,
275
+ containerDiv$$module$build$src$core$widgetdiv.tabIndex=-1);a.appendChild(containerDiv$$module$build$src$core$widgetdiv)};
276
276
  show$$module$build$src$core$widgetdiv=function(a,b,c,d,e=!0){hide$$module$build$src$core$widgetdiv();owner$$module$build$src$core$widgetdiv=a;dispose$$module$build$src$core$widgetdiv=c;if(c=containerDiv$$module$build$src$core$widgetdiv){c.style.direction=b?"rtl":"ltr";c.style.display="block";if(!d&&a instanceof Field$$module$build$src$core$field){let h;d=null==(h=a.getSourceBlock())?void 0:h.workspace}var f;ownerWorkspace$$module$build$src$core$widgetdiv=null!=(f=d)?f:null;var g;a=null!=(g=d)?g:getMainWorkspace$$module$build$src$core$common();
277
277
  rendererClassName$$module$build$src$core$widgetdiv=a.getRenderer().getClassName();themeClassName$$module$build$src$core$widgetdiv=a.getTheme().getClassName();rendererClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,rendererClassName$$module$build$src$core$widgetdiv);themeClassName$$module$build$src$core$widgetdiv&&addClass$$module$build$src$core$utils$dom(c,themeClassName$$module$build$src$core$widgetdiv);e&&(returnEphemeralFocus$$module$build$src$core$widgetdiv=
278
278
  $.getFocusManager$$module$build$src$core$focus_manager().takeEphemeralFocus(c))}};
@@ -541,18 +541,19 @@ module$build$src$core$utils$dom.setCssTransform=setCssTransform$$module$build$sr
541
541
  b=c.querySelector(this.ACTIVE_FOCUS_NODE_CSS_SELECTOR);if(b instanceof HTMLElement||b instanceof SVGElement)if(b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(b,a))return b;c=c.querySelector(this.PASSIVE_FOCUS_NODE_CSS_SELECTOR);if(c instanceof HTMLElement||c instanceof SVGElement)if(a=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,a))return a;return null}static findFocusableNodeFor(a,b){if(-1!==
542
542
  b.getNestedTrees().map(e=>FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a,e)).findIndex(e=>!!e))return null;var c=b.getRootFocusableNode();if(c.canBeFocused()&&a===c.getFocusableElement())return c;var d;if(c=null!=(d=b.lookUpFocusableNode(a.id))?d:null)return c;d=a.parentElement;return!c&&d?FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(d,b):null}};
543
543
  FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME="blocklyActiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME}`;
544
- FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME}`;var module$build$src$core$utils$focusable_tree_traverser={};module$build$src$core$utils$focusable_tree_traverser.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;var FocusManager$$module$build$src$core$focus_manager=class{constructor(a){this.previouslyFocusedNode=this.focusedNode=null;this.registeredTrees=[];this.recentlyLostAllFocus=this.lockFocusStateChanges=this.currentlyHoldsEphemeralFocus=!1;const b=c=>{this.recentlyLostAllFocus=!c;let d=null;if(c instanceof HTMLElement||c instanceof SVGElement)for(var e of this.registeredTrees)if(d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,e))break;if(d&&d.canBeFocused()){c=
545
- d.getFocusableTree();let f;e=null==(f=this.focusedNode)?void 0:f.getFocusableTree();d===c.getRootFocusableNode()&&c!==e?this.focusTree(c):this.focusNode(d)}else this.defocusCurrentFocusedNode()};a("focusin",c=>{c instanceof FocusEvent&&b(document.activeElement)});a("focusout",c=>{c instanceof FocusEvent&&b(c.relatedTarget)})}registerTree(a){this.ensureManagerIsUnlocked();if(this.isRegistered(a))throw Error(`Attempted to re-register already registered tree: ${a}.`);this.registeredTrees.push(a)}isRegistered(a){return-1!==
546
- this.registeredTrees.findIndex(b=>b===a)}unregisterTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to unregister not registered tree: ${a}.`);var b=this.registeredTrees.findIndex(d=>d===a);this.registeredTrees.splice(b,1);b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a);const c=a.getRootFocusableNode();b&&this.removeHighlight(b);this.focusedNode!==b&&this.focusedNode!==c||this.updateFocusedNode(null);this.removeHighlight(c)}getFocusedTree(){let a,
547
- b;return null!=(b=null==(a=this.focusedNode)?void 0:a.getFocusableTree())?b:null}getFocusedNode(){return this.focusedNode}focusTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to focus unregistered tree: ${a}.`);const b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a),c=a.getRestoredFocusableNode(b);a=a.getRootFocusableNode();let d;this.focusNode(null!=(d=null!=c?c:b)?d:a)}focusNode(a){this.ensureManagerIsUnlocked();
548
- if(this.focusedNode!==a)if(a.canBeFocused()){var b=a.getFocusableTree();if(!this.isRegistered(b))throw Error(`Attempted to focus unregistered node: ${a}.`);var c=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a.getFocusableElement(),b),d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(b),e=a;if(c!==a){e=b.getRestoredFocusableNode(d);a=b.getRootFocusableNode();var f;e=null!=(f=null!=e?e:d)?f:a}a=this.focusedNode;
549
- f=null==a?void 0:a.getFocusableTree();a&&this.passivelyFocusNode(a,b);b=b.getRootFocusableNode();d&&this.removeHighlight(d);b!==e&&this.removeHighlight(b);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(e,null!=f?f:null);this.updateFocusedNode(e)}else console.warn("Trying to focus a node that can't be focused.")}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();if(this.currentlyHoldsEphemeralFocus)throw Error("Attempted to take ephemeral focus when it's already held, "+`with new element: ${a}.`);
550
- this.currentlyHoldsEphemeralFocus=!0;this.focusedNode&&this.passivelyFocusNode(this.focusedNode,null);a.focus();let b=!1;return()=>{if(b)throw Error("Attempted to finish ephemeral focus twice for element: "+`${a}.`);b=!0;this.currentlyHoldsEphemeralFocus=!1;if(this.focusedNode){this.activelyFocusNode(this.focusedNode,null);const c=this.focusedNode;setTimeout(()=>{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback.");
551
- }updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&!this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,null),this.updateFocusedNode(null))}activelyFocusNode(a,b){this.lockFocusStateChanges=!0;if(a.getFocusableTree()!==b)a.getFocusableTree().onTreeFocus(a,b);a.onNodeFocus();this.lockFocusStateChanges=!1;this.setNodeToVisualActiveFocus(a);a.getFocusableElement().focus()}passivelyFocusNode(a,b){this.lockFocusStateChanges=
552
- !0;if(a.getFocusableTree()!==b)a.getFocusableTree().onTreeBlur(b);a.onNodeBlur();this.lockFocusStateChanges=!1;a.getFocusableTree()!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a=a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}setNodeToVisualPassiveFocus(a){a=
553
- a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}removeHighlight(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,
554
- FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}static getFocusManager(){FocusManager$$module$build$src$core$focus_manager.focusManager||(FocusManager$$module$build$src$core$focus_manager.focusManager=new FocusManager$$module$build$src$core$focus_manager(document.addEventListener));return FocusManager$$module$build$src$core$focus_manager.focusManager}};FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyActiveFocus";
555
- FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusManager$$module$build$src$core$focus_manager.focusManager=null;var module$build$src$core$focus_manager={};module$build$src$core$focus_manager.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$focus_manager.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;var module$build$src$core$interfaces$i_focusable_node={};module$build$src$core$interfaces$i_focusable_node.isFocusableNode=isFocusableNode$$module$build$src$core$interfaces$i_focusable_node;var module$build$src$core$interfaces$i_selectable={};module$build$src$core$interfaces$i_selectable.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common};module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common;
544
+ FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME}`;var module$build$src$core$utils$focusable_tree_traverser={};module$build$src$core$utils$focusable_tree_traverser.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;var FocusManager$$module$build$src$core$focus_manager=class{constructor(a){this.previouslyFocusedNode=this.focusedNode=null;this.registeredTrees=[];this.isUpdatingFocusedNode=this.recentlyLostAllFocus=this.lockFocusStateChanges=this.currentlyHoldsEphemeralFocus=!1;const b=c=>{if(!this.isUpdatingFocusedNode){this.recentlyLostAllFocus=!c;var d=null;if(c instanceof HTMLElement||c instanceof SVGElement)for(var e of this.registeredTrees)if(d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,
545
+ e))break;if(d&&d.canBeFocused()){c=d.getFocusableTree();let f;e=null==(f=this.focusedNode)?void 0:f.getFocusableTree();d===c.getRootFocusableNode()&&c!==e?this.focusTree(c):this.focusNode(d)}else this.defocusCurrentFocusedNode()}};a("focusin",c=>{c instanceof FocusEvent&&b(document.activeElement)});a("focusout",c=>{c instanceof FocusEvent&&b(c.relatedTarget)})}registerTree(a){this.ensureManagerIsUnlocked();if(this.isRegistered(a))throw Error(`Attempted to re-register already registered tree: ${a}.`);
546
+ this.registeredTrees.push(a)}isRegistered(a){return-1!==this.registeredTrees.findIndex(b=>b===a)}unregisterTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to unregister not registered tree: ${a}.`);var b=this.registeredTrees.findIndex(d=>d===a);this.registeredTrees.splice(b,1);b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a);const c=a.getRootFocusableNode();b&&this.removeHighlight(b);this.focusedNode!==b&&this.focusedNode!==
547
+ c||this.updateFocusedNode(null);this.removeHighlight(c)}getFocusedTree(){let a,b;return null!=(b=null==(a=this.focusedNode)?void 0:a.getFocusableTree())?b:null}getFocusedNode(){return this.focusedNode}focusTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to focus unregistered tree: ${a}.`);const b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a),c=a.getRestoredFocusableNode(b);a=a.getRootFocusableNode();let d;this.focusNode(null!=
548
+ (d=null!=c?c:b)?d:a)}focusNode(a){this.ensureManagerIsUnlocked();this.currentlyHoldsEphemeralFocus||(this.isUpdatingFocusedNode=!0);var b,c=(null==(b=this.focusedNode)?void 0:b.getFocusableElement())!==document.activeElement;if(this.focusedNode!==a||c)if(a.canBeFocused()){c=a.getFocusableTree();if(!this.isRegistered(c))throw Error(`Attempted to focus unregistered node: ${a}.`);var d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a.getFocusableElement(),
549
+ c);b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(c);var e=a;if(d!==a){e=c.getRestoredFocusableNode(b);a=c.getRootFocusableNode();var f;e=null!=(f=null!=e?e:b)?f:a}a=this.focusedNode;f=null==a?void 0:a.getFocusableTree();a&&this.passivelyFocusNode(a,c);c=c.getRootFocusableNode();b&&this.removeHighlight(b);c!==e&&this.removeHighlight(c);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(e,null!=f?f:null);this.updateFocusedNode(e);this.currentlyHoldsEphemeralFocus||
550
+ (this.isUpdatingFocusedNode=!1)}else console.warn("Trying to focus a node that can't be focused.")}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();if(this.currentlyHoldsEphemeralFocus)throw Error("Attempted to take ephemeral focus when it's already held, "+`with new element: ${a}.`);this.currentlyHoldsEphemeralFocus=!0;this.focusedNode&&this.passivelyFocusNode(this.focusedNode,null);a.focus();let b=!1;return()=>{if(b)throw Error("Attempted to finish ephemeral focus twice for element: "+`${a}.`);
551
+ b=!0;this.currentlyHoldsEphemeralFocus=!1;if(this.focusedNode){this.activelyFocusNode(this.focusedNode,null);const c=this.focusedNode;setTimeout(()=>{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback.");}updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&
552
+ !this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,null),this.updateFocusedNode(null))}activelyFocusNode(a,b){this.lockFocusStateChanges=!0;if(a.getFocusableTree()!==b)a.getFocusableTree().onTreeFocus(a,b);a.onNodeFocus();this.lockFocusStateChanges=!1;this.setNodeToVisualActiveFocus(a);a.getFocusableElement().focus()}passivelyFocusNode(a,b){this.lockFocusStateChanges=!0;if(a.getFocusableTree()!==b)a.getFocusableTree().onTreeBlur(b);a.onNodeBlur();this.lockFocusStateChanges=
553
+ !1;a.getFocusableTree()!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a=a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}setNodeToVisualPassiveFocus(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);
554
+ addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}removeHighlight(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}static getFocusManager(){FocusManager$$module$build$src$core$focus_manager.focusManager||
555
+ (FocusManager$$module$build$src$core$focus_manager.focusManager=new FocusManager$$module$build$src$core$focus_manager(document.addEventListener));return FocusManager$$module$build$src$core$focus_manager.focusManager}};FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyActiveFocus";FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusManager$$module$build$src$core$focus_manager.focusManager=null;
556
+ var module$build$src$core$focus_manager={};module$build$src$core$focus_manager.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$focus_manager.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;var module$build$src$core$interfaces$i_focusable_node={};module$build$src$core$interfaces$i_focusable_node.isFocusableNode=isFocusableNode$$module$build$src$core$interfaces$i_focusable_node;var module$build$src$core$interfaces$i_selectable={};module$build$src$core$interfaces$i_selectable.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common};module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common;
556
557
  module$build$src$core$common.defineBlocks=$.defineBlocks$$module$build$src$core$common;module$build$src$core$common.defineBlocksWithJsonArray=defineBlocksWithJsonArray$$module$build$src$core$common;module$build$src$core$common.draggingConnections=draggingConnections$$module$build$src$core$common;module$build$src$core$common.fireSelectedEvent=fireSelectedEvent$$module$build$src$core$common;module$build$src$core$common.getAllWorkspaces=getAllWorkspaces$$module$build$src$core$common;
557
558
  module$build$src$core$common.getBlockTypeCounts=getBlockTypeCounts$$module$build$src$core$common;module$build$src$core$common.getMainWorkspace=getMainWorkspace$$module$build$src$core$common;module$build$src$core$common.getParentContainer=getParentContainer$$module$build$src$core$common;module$build$src$core$common.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$common.getWorkspaceById=getWorkspaceById$$module$build$src$core$common;
558
559
  module$build$src$core$common.registerWorkspace=registerWorkspace$$module$build$src$core$common;module$build$src$core$common.setMainWorkspace=setMainWorkspace$$module$build$src$core$common;module$build$src$core$common.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$common.setSelected=setSelected$$module$build$src$core$common;module$build$src$core$common.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$common.unregisterWorkpace=unregisterWorkpace$$module$build$src$core$common;var Abstract$$module$build$src$core$events$events_abstract=class{constructor(){this.workspaceId=void 0;this.isUiEvent=!1;this.type="";this.group=$.getGroup$$module$build$src$core$events$utils();this.recordUndo=getRecordUndo$$module$build$src$core$events$utils()}toJson(){return{type:this.type,group:this.group}}static fromJson(a,b,c){c.isBlank=!1;c.group=a.group||"";c.workspaceId=b.id;return c}isNull(){return!1}run(a){}getEventWorkspace_(){let a;this.workspaceId&&(a=getWorkspaceById$$module$build$src$core$common(this.workspaceId));
@@ -771,11 +772,11 @@ this.disposed}},module$build$src$core$comments$workspace_comment={};module$build
771
772
  this.id);this.view.getSvgRoot().setAttribute("id",this.id);this.view.getSvgRoot().setAttribute("tabindex","-1");this.addModelUpdateBindings();conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"pointerdown",this,this.startGesture);conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"wheel",this,c=>{c.stopPropagation()})}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));
772
773
  this.view.addOnCollapseListener(()=>void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(a){this.view.setText(a)}setPlaceholderText(a){this.view.setPlaceholderText(a)}setSize(a){this.view.setSize(a)}setCollapsed(a){this.view.setCollapsed(a)}setEditable(a){super.setEditable(a);this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const a=
773
774
  this.getRelativeToSurfaceXY();var b,c;const d=null!=(c=null==(b=this.view)?void 0:b.getSize())?c:this.getSize();this.workspace.RTL?(b=a.x-d.width,c=a.x):(b=a.x,c=a.x+d.width);return new Rect$$module$build$src$core$utils$rect(a.y,a.y+d.height,b,c)}moveBy(a,b,c){const d=this.getRelativeToSurfaceXY();a=new Coordinate$$module$build$src$core$utils$coordinate(d.x+a,d.y+b);this.moveTo(a,c)}moveTo(a,b){super.moveTo(a,b);this.view.moveTo(a)}moveDuringDrag(a){this.location=a;this.view.moveTo(a)}setDragging(a){a?
774
- addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(isTargetInput$$module$build$src$core$browser_events(a)?a.stopPropagation():b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?
775
- addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected");fireSelectedEvent$$module$build$src$core$common(this)}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
776
- "blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,focusedNode:this},a);let c;c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,
777
- a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();
778
- let a;null==(a=this.workspace.getLayerManager())||a.append(this,BLOCK$$module$build$src$core$layers)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={};module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
775
+ addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;const a=$.getFocusManager$$module$build$src$core$focus_manager();a.getFocusedNode()===this&&setTimeout(()=>a.focusTree(this.workspace),0);this.view.isDeadOrDying()||this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(isTargetInput$$module$build$src$core$browser_events(a)?
776
+ a.stopPropagation():b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),
777
+ "blocklySelected");fireSelectedEvent$$module$build$src$core$common(this)}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this,
778
+ focusedNode:this},a);let c;c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(null!=a&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,
779
+ ["snap"])}}}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();let a;null==(a=this.workspace.getLayerManager())||a.append(this,BLOCK$$module$build$src$core$layers)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={};module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml;
779
780
  module$build$src$core$xml.domToBlock=$.domToBlock$$module$build$src$core$xml;module$build$src$core$xml.domToBlockInternal=domToBlockInternal$$module$build$src$core$xml;module$build$src$core$xml.domToPrettyText=domToPrettyText$$module$build$src$core$xml;module$build$src$core$xml.domToText=domToText$$module$build$src$core$xml;module$build$src$core$xml.domToVariables=domToVariables$$module$build$src$core$xml;module$build$src$core$xml.domToWorkspace=$.domToWorkspace$$module$build$src$core$xml;
780
781
  module$build$src$core$xml.loadWorkspaceComment=loadWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.saveWorkspaceComment=saveWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.variablesToDom=variablesToDom$$module$build$src$core$xml;module$build$src$core$xml.workspaceToDom=workspaceToDom$$module$build$src$core$xml;var BlockCreate$$module$build$src$core$events$events_block_create=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.xml=blockToDomWithXY$$module$build$src$core$xml(a),this.ids=getDescendantIds$$module$build$src$core$events$utils(a),this.json=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0}))}toJson(){const a=super.toJson();
781
782
  if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,
@@ -855,8 +856,8 @@ a=Math.max(a,d.height+20);b+=c.getWidth()}return new Size$$module$build$src$core
855
856
  }};MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MINIMUM_VIEW_CHANGE=10;MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.MARGIN=3*Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;var module$build$src$core$bubbles$mini_workspace_bubble={};module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble;var Icon$$module$build$src$core$icons$icon=class{constructor(a){this.sourceBlock=a;this.offsetInBlock=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.workspaceLocation=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.svgRoot=null;this.tooltip=a;this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator()}getType(){throw Error("Icons must implement getType");}initView(a){if(!this.svgRoot){var b=this.sourceBlock;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,
856
857
  {"class":"blocklyIconGroup",tabindex:"-1",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot)}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,
857
858
  0)}setTooltip(a){this.tooltip=null!=a?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){let a;
858
- null==(a=this.svgRoot)||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){const a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}},module$build$src$core$icons$icon=
859
- {};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
859
+ null==(a=this.svgRoot)||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){const a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getSourceBlock(){return this.sourceBlock}},
860
+ module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
860
861
  $.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a,b){super(b);this.flyoutBlockTypes=a;this.sourceBlock=b;this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconShape",
861
862
  rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},
862
863
  this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMutatorIcon"))}dispose(){super.dispose();let a;null==(a=this.miniWorkspaceBubble)||a.dispose()}getWeight(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$mutator_icon,
@@ -1004,24 +1005,25 @@ a.clientY);a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.wo
1004
1005
  b&&b.length&&(show$$module$build$src$core$contextmenu(a,b,this.RTL,this.workspace,c),setCurrentBlock$$module$build$src$core$contextmenu(this))}updateComponentLocations(a){this.dragging||this.updateConnectionLocations(a);this.updateIconLocations(a);this.updateFieldLocations(a);for(const b of this.getChildren(!1))b.updateComponentLocations(Coordinate$$module$build$src$core$utils$coordinate.sum(a,b.relativeCoords))}updateConnectionLocations(a){for(const b of this.getConnections_(!1))b.moveToOffset(a)}updateIconLocations(a){for(const b of this.getIcons())b.onLocationChange(a)}updateFieldLocations(a){for(const b of this.inputList)for(const c of b.fieldRow)c.onLocationChange(a)}addClass(a){addClass$$module$build$src$core$utils$dom(this.svgGroup,
1005
1006
  a)}removeClass(a){removeClass$$module$build$src$core$utils$dom(this.svgGroup,a)}setDragging(a){(this.dragging=a)?(this.translation="",draggingConnections$$module$build$src$core$common.push(...this.getConnections_(!0)),this.addClass("blocklyDragging")):(draggingConnections$$module$build$src$core$common.length=0,this.removeClass("blocklyDragging"));for(let b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)}setMovable(a){super.setMovable(a);this.pathObject.updateMovable(a)}setEditable(a){super.setEditable(a);
1006
1007
  a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable");a=this.getIcons();for(let b=0;b<a.length;b++)a[b].updateEditable()}setShadow(a){super.setShadow(a);this.applyColour()}setInsertionMarker(a){this.isInsertionMarker_!==a&&(this.isInsertionMarker_=a)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))}getSvgRoot(){return this.svgGroup}dispose(a,
1007
- b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));super.dispose(!!a);removeNode$$module$build$src$core$utils$dom(this.svgGroup)}disposeInternal(){this.disposing=!0;super.disposeInternal();$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===this&&this.workspace.cancelCurrentGesture();[...this.warningTextDb.values()].forEach(a=>clearTimeout(a));
1008
- this.warningTextDb.clear();this.getIcons().forEach(a=>a.dispose())}checkAndDelete(){this.workspace.isFlyout||($.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),$.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,
1009
- addNextBlocks:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;null==(b=(a=this.pathObject).applyColour)||b.call(a,this);a=this.getIcons();for(b=0;b<a.length;b++)a[b].applyColour();for(const c of this.getFields())c.applyColour()}updateDisabled(){const a=!this.isEnabled()||this.getInheritedDisabled();if(this.visuallyDisabled===a){let b;null==(b=this.getNextBlock())||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(const b of this.getChildren(!1))b.updateDisabled()}}setWarningText(a,
1010
- b=""){if(b)this.warningTextDb.has(b)&&(clearTimeout(this.warningTextDb.get(b)),this.warningTextDb.delete(b));else{for(var c of this.warningTextDb.values())clearTimeout(c);this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(b,setTimeout(()=>{this.isDeadOrDying()||(this.warningTextDb.delete(b),this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;
1011
- for(;d;)d.isCollapsed()&&(e=d),d=d.getSurroundParent();e&&e.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID);c?c.addMessage(a,b):this.addIcon((new WarningIcon$$module$build$src$core$icons$warning_icon(this)).addMessage(a,b))}else c&&(b?(c.addMessage("",b),c.getText()||this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)):this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))}setMutator(a){this.removeIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);
1012
- a&&this.addIcon(a)}addIcon(a){super.addIcon(a);a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=a);a.initView(this.createIconPointerDownListener(a));a.applyColour();a.updateEditable();this.queueRender();return a}createIconPointerDownListener(a){return b=>{this.isDeadOrDying()||(b=this.workspace.getGesture(b))&&b.setStartIcon(a)}}removeIcon(a){const b=super.removeIcon(a);a.equals($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null);this.queueRender();
1013
- return b}setDisabledReason(a,b){const c=this.isEnabled();super.setDisabledReason(a,b);this.isEnabled()===c||this.getInheritedDisabled()||this.updateDisabled()}setDeletable(a){super.setDeletable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable")}setHighlighted(a){this.pathObject.updateHighlighted(a)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(a){this.pathObject.updateDraggingDelete(a)}getColour(){return this.style.colourPrimary}setColour(a){super.setColour(a);
1014
- a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_);let b,c;null==(c=(b=this.pathObject).setStyle)||c.call(b,a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()}setStyle(a){const b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_&&removeClass$$module$build$src$core$utils$dom(this.svgGroup,this.styleName_);if(b){this.hat=b.hat;let c,d;null==(d=(c=this.pathObject).setStyle)||d.call(c,b);this.colour_=b.colourPrimary;this.style=
1015
- b;this.applyColour();addClass$$module$build$src$core$utils$dom(this.svgGroup,a);this.styleName_=a}else throw Error("Invalid style name: "+a);}getStyle(){return this.style}bringToFront(a=!1){const b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();let c=this;if(!c.isDeadOrDying()){do{const d=c.getSvgRoot(),e=d.parentNode,f=e.childNodes;f[f.length-1]!==d&&e.appendChild(d);if(a)break;c=c.getParent()}while(c);b&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b)}}setPreviousStatement(a,
1016
- b){super.setPreviousStatement(a,b);this.queueRender()}setNextStatement(a,b){super.setNextStatement(a,b);this.queueRender()}setOutput(a,b){super.setOutput(a,b);this.queueRender()}setInputsInline(a){super.setInputsInline(a);this.queueRender()}removeInput(a,b){a=super.removeInput(a,b);this.queueRender();return a}moveNumberedInputBefore(a,b){super.moveNumberedInputBefore(a,b);this.queueRender()}appendInput(a){super.appendInput(a);this.queueRender();return a}setConnectionTracking(a){this.previousConnection&&
1017
- this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;b<this.inputList.length;b++){var c=this.inputList[b].connection;c&&(c.setTracking(a),(c=c.targetBlock())&&c.setConnectionTracking(a))}}getConnections_(a){const b=[];this.outputConnection&&b.push(this.outputConnection);this.previousConnection&&b.push(this.previousConnection);
1018
- this.nextConnection&&b.push(this.nextConnection);if(a||!this.collapsed_)for(let c=0,d;d=this.inputList[c];c++)d.connection&&b.push(d.connection);return b}lastConnectionInStack(a){return super.lastConnectionInStack(a)}getMatchingConnection(a,b){return super.getMatchingConnection(a,b)}makeConnection_(a){return new RenderedConnection$$module$build$src$core$rendered_connection(this,a)}getNextBlock(){return super.getNextBlock()}getPreviousBlock(){return super.getPreviousBlock()}bumpNeighbours(){const a=
1019
- this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||a.isInFlyout))for(const b of this.getConnections_(!1)){if(b.isSuperior()){let c;null==(c=b.targetBlock())||c.bumpNeighbours()}for(const c of b.neighbours($.config$$module$build$src$core$config.snapRadius))c.getSourceBlock().getRootBlock()!==a&&(b.isConnected()&&c.isConnected()||(b.isSuperior()?c.bumpAwayFrom(b,!1):b.bumpAwayFrom(c,!0)))}}scheduleSnapAndBump(){this.snapToGrid();this.bumpNeighbours()}positionNearConnection(a,
1020
- b,c){if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){let d=b.x;b=b.y;d+=c.x-a.getOffsetInBlock().x;b+=c.y-a.getOffsetInBlock().y;this.moveBy(d,b)}}getChildren(a){return super.getChildren(a)}queueRender(){return queueRender$$module$build$src$core$render_management(this)}render(){this.queueRender();triggerQueuedRenders$$module$build$src$core$render_management()}renderEfficiently(){startTextWidthCache$$module$build$src$core$utils$dom();
1021
- this.isCollapsed()&&this.updateCollapsed();this.isEnabled()||this.updateDisabled();this.workspace.getRenderer().render(this);this.tightenChildrenEfficiently();stopTextWidthCache$$module$build$src$core$utils$dom()}tightenChildrenEfficiently(){for(const a of this.inputList){const b=a.connection;b&&b.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}getHeightWidth(){let a=this.height,b=this.width;var c=this.getNextBlock();if(c){c=c.getHeightWidth();const d=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;
1022
- a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}}fadeForReplacement(a){this.pathObject.updateReplacementFade(a)}highlightShapeForInput(a,b){this.pathObject.updateShapeForInputHighlight(a,b)}getDragStrategy(){return this.dragStrategy}setDragStrategy(a){this.dragStrategy=a}isMovable(){return this.dragStrategy.isMovable()}startDrag(a){this.dragStrategy.startDrag(a)}drag(a,b){this.dragStrategy.drag(a,b)}endDrag(a){this.dragStrategy.endDrag(a)}revertDrag(){this.dragStrategy.revertDrag()}toFlyoutInfo(){const a=
1023
- Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),b=new Set(["id","height","width","pinned","enabled"]),c=function(d){for(const e in d)b.has(e)?delete d[e]:"object"===typeof d[e]&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getFocusableElement(){return this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.select()}onNodeBlur(){this.unselect()}canBeFocused(){return!0}};
1024
- BlockSvg$$module$build$src$core$block_svg.INLINE=-1;BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};module$build$src$core$block_svg.BlockSvg=BlockSvg$$module$build$src$core$block_svg;var DragTarget$$module$build$src$core$drag_target=class{constructor(){}onDragEnter(a){}onDragOver(a){}onDragExit(a){}onDrop(a){}getClientRect(){return null}shouldPreventMove(a){return!1}},module$build$src$core$drag_target={};module$build$src$core$drag_target.DragTarget=DragTarget$$module$build$src$core$drag_target;var module$build$src$core$interfaces$i_deletable={};module$build$src$core$interfaces$i_deletable.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){a instanceof BlockSvg$$module$build$src$core$block_svg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a)):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}updateWouldDelete_(a){this.wouldDelete_=a}},module$build$src$core$delete_area={};
1008
+ b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();const c=$.getFocusManager$$module$build$src$core$focus_manager();if(c.getFocusedNode()===this){const d=this.getParent();d?c.focusNode(d):setTimeout(()=>c.focusTree(this.workspace),0)}b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));super.dispose(!!a);removeNode$$module$build$src$core$utils$dom(this.svgGroup)}disposeInternal(){this.disposing=!0;super.disposeInternal();
1009
+ $.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===this&&this.workspace.cancelCurrentGesture();[...this.warningTextDb.values()].forEach(a=>clearTimeout(a));this.warningTextDb.clear();this.getIcons().forEach(a=>a.dispose())}checkAndDelete(){this.workspace.isFlyout||($.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection?this.dispose(!1,!0):this.dispose(!0,!0),$.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(){return this.isInsertionMarker_?
1010
+ null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,addNextBlocks:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;null==(b=(a=this.pathObject).applyColour)||b.call(a,this);a=this.getIcons();for(b=0;b<a.length;b++)a[b].applyColour();for(const c of this.getFields())c.applyColour()}updateDisabled(){const a=!this.isEnabled()||this.getInheritedDisabled();
1011
+ if(this.visuallyDisabled===a){let b;null==(b=this.getNextBlock())||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(const b of this.getChildren(!1))b.updateDisabled()}}setWarningText(a,b=""){if(b)this.warningTextDb.has(b)&&(clearTimeout(this.warningTextDb.get(b)),this.warningTextDb.delete(b));else{for(var c of this.warningTextDb.values())clearTimeout(c);this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(b,setTimeout(()=>{this.isDeadOrDying()||(this.warningTextDb.delete(b),
1012
+ this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;for(;d;)d.isCollapsed()&&(e=d),d=d.getSurroundParent();e&&e.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID);c?c.addMessage(a,b):this.addIcon((new WarningIcon$$module$build$src$core$icons$warning_icon(this)).addMessage(a,b))}else c&&
1013
+ (b?(c.addMessage("",b),c.getText()||this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)):this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))}setMutator(a){this.removeIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);a&&this.addIcon(a)}addIcon(a){super.addIcon(a);a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&(this.mutator=a);a.initView(this.createIconPointerDownListener(a));a.applyColour();a.updateEditable();
1014
+ this.queueRender();return a}createIconPointerDownListener(a){return b=>{this.isDeadOrDying()||(b=this.workspace.getGesture(b))&&b.setStartIcon(a)}}removeIcon(a){const b=super.removeIcon(a);a.equals($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null);this.queueRender();return b}setDisabledReason(a,b){const c=this.isEnabled();super.setDisabledReason(a,b);this.isEnabled()===c||this.getInheritedDisabled()||this.updateDisabled()}setDeletable(a){super.setDeletable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,
1015
+ "blocklyNotDeletable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable")}setHighlighted(a){this.pathObject.updateHighlighted(a)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(a){this.pathObject.updateDraggingDelete(a)}getColour(){return this.style.colourPrimary}setColour(a){super.setColour(a);a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_);let b,c;null==(c=(b=this.pathObject).setStyle)||
1016
+ c.call(b,a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()}setStyle(a){const b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_&&removeClass$$module$build$src$core$utils$dom(this.svgGroup,this.styleName_);if(b){this.hat=b.hat;let c,d;null==(d=(c=this.pathObject).setStyle)||d.call(c,b);this.colour_=b.colourPrimary;this.style=b;this.applyColour();addClass$$module$build$src$core$utils$dom(this.svgGroup,a);this.styleName_=a}else throw Error("Invalid style name: "+
1017
+ a);}getStyle(){return this.style}bringToFront(a=!1){const b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();let c=this;if(!c.isDeadOrDying()){do{const d=c.getSvgRoot(),e=d.parentNode,f=e.childNodes;f[f.length-1]!==d&&e.appendChild(d);if(a)break;c=c.getParent()}while(c);b&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b)}}setPreviousStatement(a,b){super.setPreviousStatement(a,b);this.queueRender()}setNextStatement(a,b){super.setNextStatement(a,b);this.queueRender()}setOutput(a,
1018
+ b){super.setOutput(a,b);this.queueRender()}setInputsInline(a){super.setInputsInline(a);this.queueRender()}removeInput(a,b){a=super.removeInput(a,b);this.queueRender();return a}moveNumberedInputBefore(a,b){super.moveNumberedInputBefore(a,b);this.queueRender()}appendInput(a){super.appendInput(a);this.queueRender();return a}setConnectionTracking(a){this.previousConnection&&this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);
1019
+ var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;b<this.inputList.length;b++){var c=this.inputList[b].connection;c&&(c.setTracking(a),(c=c.targetBlock())&&c.setConnectionTracking(a))}}getConnections_(a){const b=[];this.outputConnection&&b.push(this.outputConnection);this.previousConnection&&b.push(this.previousConnection);this.nextConnection&&b.push(this.nextConnection);if(a||!this.collapsed_)for(let c=0,d;d=this.inputList[c];c++)d.connection&&b.push(d.connection);
1020
+ return b}lastConnectionInStack(a){return super.lastConnectionInStack(a)}getMatchingConnection(a,b){return super.getMatchingConnection(a,b)}makeConnection_(a){return new RenderedConnection$$module$build$src$core$rendered_connection(this,a)}getNextBlock(){return super.getNextBlock()}getPreviousBlock(){return super.getPreviousBlock()}bumpNeighbours(){const a=this.getRootBlock();if(!(this.isDeadOrDying()||this.workspace.isDragging()||a.isInFlyout))for(const b of this.getConnections_(!1)){if(b.isSuperior()){let c;
1021
+ null==(c=b.targetBlock())||c.bumpNeighbours()}for(const c of b.neighbours($.config$$module$build$src$core$config.snapRadius))c.getSourceBlock().getRootBlock()!==a&&(b.isConnected()&&c.isConnected()||(b.isSuperior()?c.bumpAwayFrom(b,!1):b.bumpAwayFrom(c,!0)))}}scheduleSnapAndBump(){this.snapToGrid();this.bumpNeighbours()}positionNearConnection(a,b,c){if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){let d=
1022
+ b.x;b=b.y;d+=c.x-a.getOffsetInBlock().x;b+=c.y-a.getOffsetInBlock().y;this.moveBy(d,b)}}getChildren(a){return super.getChildren(a)}queueRender(){return queueRender$$module$build$src$core$render_management(this)}render(){this.queueRender();triggerQueuedRenders$$module$build$src$core$render_management()}renderEfficiently(){startTextWidthCache$$module$build$src$core$utils$dom();this.isCollapsed()&&this.updateCollapsed();this.isEnabled()||this.updateDisabled();this.workspace.getRenderer().render(this);
1023
+ this.tightenChildrenEfficiently();stopTextWidthCache$$module$build$src$core$utils$dom()}tightenChildrenEfficiently(){for(const a of this.inputList){const b=a.connection;b&&b.tightenEfficiently()}this.nextConnection&&this.nextConnection.tightenEfficiently()}getHeightWidth(){let a=this.height,b=this.width;var c=this.getNextBlock();if(c){c=c.getHeightWidth();const d=this.workspace.getRenderer().getConstants().NOTCH_HEIGHT;a+=c.height-d;b=Math.max(b,c.width)}return{height:a,width:b}}fadeForReplacement(a){this.pathObject.updateReplacementFade(a)}highlightShapeForInput(a,
1024
+ b){this.pathObject.updateShapeForInputHighlight(a,b)}getDragStrategy(){return this.dragStrategy}setDragStrategy(a){this.dragStrategy=a}isMovable(){return this.dragStrategy.isMovable()}startDrag(a){this.dragStrategy.startDrag(a)}drag(a,b){this.dragStrategy.drag(a,b)}endDrag(a){this.dragStrategy.endDrag(a)}revertDrag(){this.dragStrategy.revertDrag()}toFlyoutInfo(){const a=Object.assign({},{kind:"BLOCK"},save$$module$build$src$core$serialization$blocks(this)),b=new Set(["id","height","width","pinned",
1025
+ "enabled"]),c=function(d){for(const e in d)b.has(e)?delete d[e]:"object"===typeof d[e]&&c(d[e])};c(a);return[a]}jsonInit(a){super.jsonInit(a);a.classes&&this.addClass(Array.isArray(a.classes)?a.classes.join(" "):a.classes)}getFocusableElement(){return this.pathObject.svgPath}getFocusableTree(){return this.workspace}onNodeFocus(){this.select()}onNodeBlur(){this.unselect()}canBeFocused(){return!0}};BlockSvg$$module$build$src$core$block_svg.INLINE=-1;
1026
+ BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID="TEMP_COLLAPSED_WARNING_";var module$build$src$core$block_svg={};module$build$src$core$block_svg.BlockSvg=BlockSvg$$module$build$src$core$block_svg;var DragTarget$$module$build$src$core$drag_target=class{constructor(){}onDragEnter(a){}onDragOver(a){}onDragExit(a){}onDrop(a){}getClientRect(){return null}shouldPreventMove(a){return!1}},module$build$src$core$drag_target={};module$build$src$core$drag_target.DragTarget=DragTarget$$module$build$src$core$drag_target;var module$build$src$core$interfaces$i_deletable={};module$build$src$core$interfaces$i_deletable.isDeletable=isDeletable$$module$build$src$core$interfaces$i_deletable;var DeleteArea$$module$build$src$core$delete_area=class extends DragTarget$$module$build$src$core$drag_target{constructor(){super();this.wouldDelete_=!1}wouldDelete(a){a instanceof BlockSvg$$module$build$src$core$block_svg?(a=!a.getParent()&&a.isDeletable(),this.updateWouldDelete_(a)):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}updateWouldDelete_(a){this.wouldDelete_=a}},module$build$src$core$delete_area={};
1025
1027
  module$build$src$core$delete_area.DeleteArea=DeleteArea$$module$build$src$core$delete_area;var FlyoutItem$$module$build$src$core$flyout_item=class{constructor(a,b){this.element=a;this.type=b}getElement(){return this.element}getType(){return this.type}},module$build$src$core$flyout_item={};module$build$src$core$flyout_item.FlyoutItem=FlyoutItem$$module$build$src$core$flyout_item;var MetricsManager$$module$build$src$core$metrics_manager=class{constructor(a){this.workspace_=a}getDimensionsPx_(a){let b=0,c=0;a&&(b=a.getWidth(),c=a.getHeight());return new Size$$module$build$src$core$utils$size(b,c)}getFlyoutMetrics(a){a=this.getDimensionsPx_(this.workspace_.getFlyout(a));return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getToolboxMetrics(){const a=this.getDimensionsPx_(this.workspace_.getToolbox());return{width:a.width,height:a.height,position:this.workspace_.toolboxPosition}}getSvgMetrics(){return this.workspace_.getCachedParentSvgSize()}getAbsoluteMetrics(){let a=
1026
1028
  0,b=0;const c=this.getToolboxMetrics(),d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox();var f;const g=!(null==(f=this.workspace_.getFlyout())?0:f.autoClose);f=e?c.position:d.position;const h=f===Position$$module$build$src$core$utils$toolbox.TOP;f===Position$$module$build$src$core$utils$toolbox.LEFT&&(e&&(a+=c.width),g&&(a+=d.width));h&&(e&&(b+=c.height),g&&(b+=d.height));return{top:b,left:a}}getViewMetrics(a){a=a?this.workspace_.scale:1;const b=this.getSvgMetrics(),c=this.getToolboxMetrics(),
1027
1029
  d=this.getFlyoutMetrics(),e=!!this.workspace_.getToolbox();var f;const g=!(null==(f=this.workspace_.getFlyout())?0:f.autoClose);f=e?c.position:d.position;const h=f===Position$$module$build$src$core$utils$toolbox.LEFT||f===Position$$module$build$src$core$utils$toolbox.RIGHT;if(f===Position$$module$build$src$core$utils$toolbox.TOP||f===Position$$module$build$src$core$utils$toolbox.BOTTOM)e&&(b.height-=c.height),g&&(b.height-=d.height);h&&(e&&(b.width-=c.width),g&&(b.width-=d.width));return{height:b.height/
@@ -1044,17 +1046,19 @@ var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.F
1044
1046
  module$build$src$core$keyboard_nav$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy;var FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy=class{constructor(a,b){this.policy=a;this.flyout=b}getFirstChild(a){return null}getParent(a){return this.policy.getParent(a)}getNextSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===a);if(-1===c)return null;c++;c>=b.length&&(c=0);return b[c].getElement()}getPreviousSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===
1045
1047
  a);if(-1===c)return null;c--;0>c&&(c=b.length-1);return b[c].getElement()}isNavigable(a){return this.policy.isNavigable(a)}isApplicable(a){return this.policy.isApplicable(a)}},module$build$src$core$keyboard_nav$flyout_navigation_policy={};module$build$src$core$keyboard_nav$flyout_navigation_policy.FlyoutNavigationPolicy=FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy;var FlyoutSeparator$$module$build$src$core$flyout_separator=class{constructor(a,b){this.gap=a;this.axis=b;this.y=this.x=0}getBoundingRectangle(){switch(this.axis){case "x":return new Rect$$module$build$src$core$utils$rect(this.y,this.y,this.x,this.x+this.gap);case "y":return new Rect$$module$build$src$core$utils$rect(this.y,this.y+this.gap,this.x,this.x)}}moveBy(a,b,c){this.x+=a;this.y+=b}isNavigable(){return!1}getFocusableElement(){throw Error("Cannot be focused");}getFocusableTree(){throw Error("Cannot be focused");
1046
1048
  }onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}},module$build$src$core$flyout_separator={};module$build$src$core$flyout_separator.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;var FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return!1}isApplicable(a){return a instanceof FlyoutSeparator$$module$build$src$core$flyout_separator}},module$build$src$core$keyboard_nav$flyout_separator_navigation_policy={};
1047
- module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){for(const b of a.inputList){for(const d of b.fieldRow)return d;let c;if(null==(c=b.connection)?0:c.targetBlock())return b.connection.targetBlock()}return null}getParent(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if(null==(c=a.outputConnection)?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){var b;
1048
- if(null==(b=a.nextConnection)?0:b.targetBlock()){var c;return null==(c=a.nextConnection)?void 0:c.targetBlock()}const d=this.getParent(a);b=!1;c=[];if(d instanceof BlockSvg$$module$build$src$core$block_svg)for(let e=0,f;f=d.inputList[e];e++){if(f.connection){c.push(...f.fieldRow);const g=f.connection.targetBlock();g&&c.push(g)}}else if(d instanceof WorkspaceSvg$$module$build$src$core$workspace_svg)c=d.getTopBlocks(!0),b=!0;else return null;a=c.indexOf(b?a.getRootBlock():a);return 0<=a&&a<c.length-
1049
- 1?c[a+1]:a===c.length-1&&b?c[0]:null}getPreviousSibling(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){var c;return null==(c=a.previousConnection)?void 0:c.targetBlock()}var d=this.getParent(a);b=!1;c=[];if(d instanceof BlockSvg$$module$build$src$core$block_svg)for(let e=0,f;f=d.inputList[e];e++){if(f.connection){c.push(...f.fieldRow);const g=f.connection.targetBlock();g&&c.push(g)}}else if(d instanceof WorkspaceSvg$$module$build$src$core$workspace_svg)c=d.getTopBlocks(!0),b=!0;else return null;
1050
- a=c.indexOf(a);d=null;1<=a?d=c[a-1]:0===a&&b&&(d=c[c.length-1]);if(b&&d instanceof BlockSvg$$module$build$src$core$block_svg){let e,f;return null!=(f=null==(e=d.lastConnectionInStack(!1))?void 0:e.getSourceBlock())?f:d}return d}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}},module$build$src$core$keyboard_nav$block_navigation_policy={};module$build$src$core$keyboard_nav$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy=class{getFirstChild(a){return a.getParentInput()?a.targetConnection:null}getParent(a){if(a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE){let f;return null!=(f=a.targetConnection)?f:a.getSourceBlock()}if(a.getParentInput())return a.getSourceBlock();a=a.getSourceBlock().getTopStackBlock();let b,c,d,e;return null!=(e=null==(b=this.getParentConnection(a))?void 0:null==(c=b.targetConnection)?
1049
+ module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){const b=a.getIcons();if(b.length)return b[0];for(const c of a.inputList){for(const e of c.fieldRow)return e;let d;if(null==(d=c.connection)?0:d.targetBlock())return c.connection.targetBlock()}return null}getParent(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if(null==(c=a.outputConnection)?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){var b;
1050
+ if(null==(b=a.nextConnection)?0:b.targetBlock()){var c;return null==(c=a.nextConnection)?void 0:c.targetBlock()}const d=this.getParent(a);b=!1;c=[];if(d instanceof BlockSvg$$module$build$src$core$block_svg)for(let e=0,f;f=d.inputList[e];e++){c.push(...f.fieldRow);let g;const h=null==(g=f.connection)?void 0:g.targetBlock();h&&c.push(h)}else if(d instanceof WorkspaceSvg$$module$build$src$core$workspace_svg)c=d.getTopBlocks(!0),b=!0;else return null;a=c.indexOf(b?a.getRootBlock():a);return 0<=a&&a<c.length-
1051
+ 1?c[a+1]:a===c.length-1&&b?c[0]:null}getPreviousSibling(a){var b;if(null==(b=a.previousConnection)?0:b.targetBlock()){var c;return null==(c=a.previousConnection)?void 0:c.targetBlock()}const d=this.getParent(a);b=!1;c=[];if(d instanceof BlockSvg$$module$build$src$core$block_svg)for(let f=0,g;g=d.inputList[f];f++){c.push(...g.fieldRow);var e=void 0;const h=null==(e=g.connection)?void 0:e.targetBlock();h&&c.push(h)}else if(d instanceof WorkspaceSvg$$module$build$src$core$workspace_svg)c=d.getTopBlocks(!0),
1052
+ b=!0;else return null;a=c.indexOf(a);e=null;1<=a?e=c[a-1]:0===a&&b&&(e=c[c.length-1]);if(b&&e instanceof BlockSvg$$module$build$src$core$block_svg){let f,g;return null!=(g=null==(f=e.lastConnectionInStack(!1))?void 0:f.getSourceBlock())?g:e}return e}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}},module$build$src$core$keyboard_nav$block_navigation_policy={};
1053
+ module$build$src$core$keyboard_nav$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy=class{getFirstChild(a){return a.getParentInput()?a.targetConnection:null}getParent(a){if(a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE){let f;return null!=(f=a.targetConnection)?f:a.getSourceBlock()}if(a.getParentInput())return a.getSourceBlock();a=a.getSourceBlock().getTopStackBlock();let b,c,d,e;return null!=(e=null==(b=this.getParentConnection(a))?void 0:null==(c=b.targetConnection)?
1051
1054
  void 0:null==(d=c.getParentInput())?void 0:d.connection)?e:a}getNextSibling(a){if(a.getParentInput()){var b=a.getParentInput(),c=null==b?void 0:b.getSourceBlock();if(!c||!b)return null;b=c.inputList.indexOf(b);for(b+=1;b<c.inputList.length;b++){a=c.inputList[b];var d=a.fieldRow;if(d.length)return d[0];if(a.connection)return a.connection}return null}return a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?(d=a.targetConnection,b=a.getSourceBlock(),d||b.getRootBlock().lastConnectionInStack(!1)!==
1052
1055
  a?d:(a=b.workspace.getTopBlocks(!0),b=a.indexOf(b.getRootBlock())+1,b>=a.length&&(b=0),b=a[b],null!=(c=this.getParentConnection(b))?c:b)):a.getSourceBlock()}getPreviousSibling(a){if(a.getParentInput()){var b=a.getParentInput(),c=null==b?void 0:b.getSourceBlock();if(!c||!b)return null;for(a=c.inputList.indexOf(b);0<=a;a--){var d=c.inputList[a];if(d.connection&&d!==b)return d.connection;d=d.fieldRow;if(d.length)return d[d.length-1]}}else{if(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||
1053
1056
  a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return d=a.targetConnection&&!a.targetConnection.getParentInput()?a.targetConnection:null,c=a.getSourceBlock(),d||this.getParentConnection(c.getRootBlock())!==a?d:(a=c.workspace.getTopBlocks(!0),c=a.indexOf(c.getRootBlock())-1,0>c&&(c=a.length-1),c=a[c],null!=(b=c.lastConnectionInStack(!1))?b:c);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)return a.getSourceBlock()}return null}getParentConnection(a){let b;
1054
1057
  return!a.outputConnection||(null==(b=a.previousConnection)?0:b.isConnected())?a.previousConnection:a.outputConnection}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$connection_navigation_policy={};module$build$src$core$keyboard_nav$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){var b=a.getParentInput();const c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)+1;d<c.inputList.length;d++){b=c.inputList[d];const e=b.fieldRow;if(a<e.length)return e[a];a=0;let f;if(null==(f=b.connection)?0:f.targetBlock())return b.connection.targetBlock()}return null}getPreviousSibling(a){const b=
1055
- a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let f;if((null==(f=e.connection)?0:f.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}return null}isNavigable(a){let b;return a.canBeFocused()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?0:b.isSimpleReporter())&&a.isFullBlockField())&&
1056
- a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
1057
- module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>
1058
+ a.getParentInput(),c=a.getSourceBlock();if(!c)return null;var d=c.inputList.indexOf(b);for(a=b.fieldRow.indexOf(a)-1;0<=d;d--){var e=c.inputList[d];let g;if((null==(g=e.connection)?0:g.targetBlock())&&e!==b)return e.connection.targetBlock();e=e.fieldRow;if(-1<a)return e[a];0<=d-1&&(a=c.inputList[d-1].fieldRow.length-1)}let f;return null!=(f=c.getIcons().pop())?f:null}isNavigable(a){let b;return a.canBeFocused()&&a.isVisible()&&(a.isClickable()||a.isCurrentlyEditable())&&!((null==(b=a.getSourceBlock())?
1059
+ 0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){const b=a.getSourceBlock(),c=b.getIcons();a=c.indexOf(a);if(0<=a&&a+1<c.length)return c[a+1];for(const d of b.inputList){if(d.fieldRow.length)return d.fieldRow[0];let e;if(null==(e=d.connection)?0:e.targetBlock())return d.connection.targetBlock()}return null}getPreviousSibling(a){const b=a.getSourceBlock().getIcons();a=b.indexOf(a);
1060
+ return 1<=a?b[a-1]:null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof Icon$$module$build$src$core$icons$icon}},module$build$src$core$keyboard_nav$icon_navigation_policy={};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={};
1061
+ module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy,new IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>
1058
1062
  b.isApplicable(a))}getFirstChild(a){let b;const c=null==(b=this.get(a))?void 0:b.getFirstChild(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getNextSibling(c)}getParent(a){let b;const c=null==(b=this.get(a))?void 0:b.getParent(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getParent(c)}getNextSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getNextSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?
1059
1063
  c:this.getNextSibling(c)}getPreviousSibling(a){let b;const c=null==(b=this.get(a))?void 0:b.getPreviousSibling(a);if(!c)return null;let d;return null!=(d=this.get(c))&&d.isNavigable(c)?c:this.getPreviousSibling(c)}},module$build$src$core$navigator={};module$build$src$core$navigator.Navigator=Navigator$$module$build$src$core$navigator;var FlyoutNavigator$$module$build$src$core$flyout_navigator=class extends Navigator$$module$build$src$core$navigator{constructor(a){super();this.rules.push(new FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy,new FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy);this.rules=this.rules.map(b=>new FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy(b,a))}},module$build$src$core$flyout_navigator=
1060
1064
  {};module$build$src$core$flyout_navigator.FlyoutNavigator=FlyoutNavigator$$module$build$src$core$flyout_navigator;var ScrollbarPair$$module$build$src$core$scrollbar_pair=class{constructor(a,b,c,d,e){this.workspace=a;this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null;b=void 0===b?!0:b;c=void 0===c?!0:c;const f=b&&c;b&&(this.hScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!0,f,d,e));c&&(this.vScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!1,f,d,e));f&&(this.corner_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness,
@@ -1423,9 +1427,9 @@ if(b.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT
1423
1427
  -a.height/2)+a.shape.pathDown(a.height);const c=b.getSourceBlock();let d,e;return null==(e=(d=c.pathObject).addConnectionHighlight)?void 0:e.call(d,b,a,b.getOffsetInBlock(),c.RTL)}},module$build$src$core$renderers$zelos$drawer={};module$build$src$core$renderers$zelos$drawer.Drawer=Drawer$$module$build$src$core$renderers$zelos$drawer;var FieldImage$$module$build$src$core$field_image=class extends Field$$module$build$src$core$field{constructor(a,b,c,d,e,f,g){super(Field$$module$build$src$core$field.SKIP_SETUP);this.imageElement=this.clickHandler=null;this.flipRtl=this.isDirty_=this.EDITABLE=!1;this.altText="";c=Number(replaceMessageReferences$$module$build$src$core$utils$parsing(c));b=Number(replaceMessageReferences$$module$build$src$core$utils$parsing(b));if(isNaN(c)||isNaN(b))throw Error("Height and width values of an image field must cast to numbers.");
1424
1428
  if(0>=c||0>=b)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Size$$module$build$src$core$utils$size(b,c+FieldImage$$module$build$src$core$field_image.Y_PADDING);this.imageHeight=c;"function"===typeof e&&(this.clickHandler=e);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(g?this.configure_(g):(this.flipRtl=!!f,this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(d)||""),this.setValue(replaceMessageReferences$$module$build$src$core$utils$parsing(a)))}configure_(a){super.configure_(a);
1425
1429
  a.flipRtl&&(this.flipRtl=a.flipRtl);a.alt&&(this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(a.alt))}initView(){this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_);this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_);this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,
1426
- "blocklyImageField");this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(a){return"string"!==typeof a?null:a}doValueUpdate_(a){this.value_=a;this.imageElement&&this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(a){a!==this.altText&&(this.altText=a||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}showEditor_(){this.clickHandler&&this.clickHandler(this)}setOnClickHandler(a){this.clickHandler=
1427
- a}getText_(){return this.altText}static fromJson(a){if(!a.src||!a.width||!a.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(a.src,a.width,a.height,void 0,void 0,void 0,a)}};FieldImage$$module$build$src$core$field_image.Y_PADDING=1;register$$module$build$src$core$field_registry("field_image",FieldImage$$module$build$src$core$field_image);FieldImage$$module$build$src$core$field_image.prototype.DEFAULT_VALUE="";
1428
- var module$build$src$core$field_image={};module$build$src$core$field_image.FieldImage=FieldImage$$module$build$src$core$field_image;var FieldInput$$module$build$src$core$field_input=class extends Field$$module$build$src$core$field{set size_(a){super.size_=a}get size_(){const a=super.size_;14>a.width&&(a.width=14);return a}constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.spellcheck_=!0;this.htmlInput_=null;this.isTextValid_=this.isBeingEdited_=!1;this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;a!==
1430
+ "blocklyImageField");this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(a){return"string"!==typeof a?null:a}doValueUpdate_(a){this.value_=a;this.imageElement&&this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(a){a!==this.altText&&(this.altText=a||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}isClickable(){return super.isClickable()&&!!this.clickHandler}showEditor_(){this.clickHandler&&
1431
+ this.clickHandler(this)}setOnClickHandler(a){this.clickHandler=a}getText_(){return this.altText}static fromJson(a){if(!a.src||!a.width||!a.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(a.src,a.width,a.height,void 0,void 0,void 0,a)}};FieldImage$$module$build$src$core$field_image.Y_PADDING=1;register$$module$build$src$core$field_registry("field_image",FieldImage$$module$build$src$core$field_image);
1432
+ FieldImage$$module$build$src$core$field_image.prototype.DEFAULT_VALUE="";var module$build$src$core$field_image={};module$build$src$core$field_image.FieldImage=FieldImage$$module$build$src$core$field_image;var FieldInput$$module$build$src$core$field_input=class extends Field$$module$build$src$core$field{set size_(a){super.size_=a}get size_(){const a=super.size_;14>a.width&&(a.width=14);return a}constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.spellcheck_=!0;this.htmlInput_=null;this.isTextValid_=this.isBeingEdited_=!1;this.onKeyInputWrapper=this.onKeyDownWrapper=this.valueWhenEditorWasOpened_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;a!==
1429
1433
  Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);void 0!==a.spellcheck&&(this.spellcheck_=a.spellcheck)}initView(){if(!this.getSourceBlock())throw new UnattachedFieldError$$module$build$src$core$field;super.initView();this.isFullBlockField()&&(this.clickTarget_=this.sourceBlock_.getSvgRoot());this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyInputField")}isFullBlockField(){const a=
1430
1434
  this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;let b;return this.fullBlockClickTarget_=!(null==(b=this.getConstants())||!b.FULL_BLOCK_FIELDS)&&a.isSimpleReporter()}doValueInvalid_(a,b=!0){this.isBeingEdited_&&(this.isDirty_=!0,this.isTextValid_=!1,a=this.value_,this.value_=this.valueWhenEditorWasOpened_,this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&b&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_,
1431
1435
  "field",this.name||null,a,this.value_)))}doValueUpdate_(a){this.isTextValid_=this.isDirty_=!0;this.value_=a}applyColour(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.getConstants().FULL_BLOCK_FIELDS&&this.fieldGroup_&&(!this.isFullBlockField()&&this.borderRect_?(this.borderRect_.style.display="block",this.borderRect_.setAttribute("stroke",a.getColourTertiary())):(this.borderRect_.style.display="none",a.pathObject.svgPath.setAttribute("fill",
@@ -1609,9 +1613,9 @@ module$build$src$core$keyboard_nav$marker={};module$build$src$core$keyboard_nav$
1609
1613
  c=>{let d;return c instanceof BlockSvg$$module$build$src$core$block_svg&&!(null==(d=c.outputConnection)?0:d.targetBlock())},!0);return b===a}getNextNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;let d=this.workspace.getNavigator().getFirstChild(a)||this.workspace.getNavigator().getNextSibling(a);for(var e=a;e&&!d;){e=this.workspace.getNavigator().getParent(e);if(!e)break;d=this.workspace.getNavigator().getNextSibling(e)}return b(d)?d:d?(c.add(a),this.getNextNodeImpl(d,b,c)):null}getNextNode(a,
1610
1614
  b,c){return!a||!c&&this.getLastNode()===a?null:this.getNextNodeImpl(a,b)}getPreviousNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;const d=this.getRightMostChild(this.workspace.getNavigator().getPreviousSibling(a),a)||this.workspace.getNavigator().getParent(a);return b(d)?d:d?(c.add(a),this.getPreviousNodeImpl(d,b,c)):null}getPreviousNode(a,b,c){return!a||!c&&this.getFirstNode()===a?null:this.getPreviousNodeImpl(a,b)}getRightMostChild(a,b){if(!a)return a;let c=this.workspace.getNavigator().getFirstChild(a);
1611
1615
  if(!c||c===b)return a;for(a=c;a&&a!==b;a=this.workspace.getNavigator().getNextSibling(c))c=a;return this.getRightMostChild(c,b)}preDelete(a){var b=this.getCurNode();b=b?[b]:[];var c;let d,e;const f=null!=(e=null==(c=a.previousConnection)?void 0:c.targetConnection)?e:null==(d=a.outputConnection)?void 0:d.targetConnection;f&&b.push(f);(c=a.getNextBlock())&&b.push(c);(a=a.getParent())&&b.push(a);b.push(this.workspace);this.potentialNodes=b}postDelete(){const a=this.potentialNodes;this.potentialNodes=
1612
- null;if(!a)throw Error("must call preDelete first");for(const b of a){let c;if(null==(c=this.getSourceBlockFromNode(b))||!c.disposed){this.setCurNode(b);return}}throw Error("no valid nodes in this.potentialNodes");}getCurNode(){const a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),b=this.getSourceBlockFromNode(a);b&&b.workspace!==this.workspace||this.setCurNode(a);return super.getCurNode()}setCurNode(a){super.setCurNode(a);isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&
1613
- $.getFocusManager$$module$build$src$core$focus_manager().focusNode(a);a instanceof BlockSvg$$module$build$src$core$block_svg&&a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren())}getFirstNode(){return this.workspace.getNavigator().getFirstChild(this.workspace)}getLastNode(){const a=this.getFirstNode();return this.getPreviousNode(a,()=>!0,!0)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,DEFAULT$$module$build$src$core$registry,LineCursor$$module$build$src$core$keyboard_nav$line_cursor);
1614
- var module$build$src$core$keyboard_nav$line_cursor={};module$build$src$core$keyboard_nav$line_cursor.LineCursor=LineCursor$$module$build$src$core$keyboard_nav$line_cursor;var ConstantProvider$$module$build$src$core$renderers$geras$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(){super();this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(a){return super.getCSS_(a).concat([`${a} .blocklyInsertionMarker>.blocklyPathLight,`,`${a} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;",
1616
+ null;if(!a)throw Error("must call preDelete first");for(const b of a){let c;if(null==(c=this.getSourceBlockFromNode(b))||!c.disposed){this.setCurNode(b);return}}throw Error("no valid nodes in this.potentialNodes");}getCurNode(){const a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),b=this.getSourceBlockFromNode(a);b&&b.workspace===this.workspace&&this.setCurNode(a);return super.getCurNode()}setCurNode(a){super.setCurNode(a);isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&
1617
+ $.getFocusManager$$module$build$src$core$focus_manager().focusNode(a);a instanceof BlockSvg$$module$build$src$core$block_svg?a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren()):a instanceof Field$$module$build$src$core$field&&(a=a.getSourceBlock(),a.workspace.scrollBoundsIntoView(a.getBoundingRectangleWithoutChildren()))}getFirstNode(){return this.workspace.getNavigator().getFirstChild(this.workspace)}getLastNode(){const a=this.getFirstNode();return this.getPreviousNode(a,()=>
1618
+ !0,!0)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,DEFAULT$$module$build$src$core$registry,LineCursor$$module$build$src$core$keyboard_nav$line_cursor);var module$build$src$core$keyboard_nav$line_cursor={};module$build$src$core$keyboard_nav$line_cursor.LineCursor=LineCursor$$module$build$src$core$keyboard_nav$line_cursor;var ConstantProvider$$module$build$src$core$renderers$geras$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(){super();this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(a){return super.getCSS_(a).concat([`${a} .blocklyInsertionMarker>.blocklyPathLight,`,`${a} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;",
1615
1619
  "}"])}},module$build$src$core$renderers$geras$constants={};module$build$src$core$renderers$geras$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$geras$constants;var Highlighter$$module$build$src$core$renderers$geras$highlighter=class{constructor(a){this.inlineSteps_=this.steps_="";this.info_=a;this.RTL_=this.info_.RTL;a=a.getRenderer();this.constants_=a.getConstants();this.highlightConstants_=a.getHighlightConstants();this.highlightOffset=this.highlightConstants_.OFFSET;this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER;this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER;this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB;this.notchPaths_=
1616
1620
  this.highlightConstants_.NOTCH;this.startPaths_=this.highlightConstants_.START_HAT;this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+"\n"+this.inlineSteps_}drawTopCorner(a){this.steps_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos,this.info_.startY);for(let b=0,c;c=a.elements[b];b++)Types$$module$build$src$core$renderers$measurables$types.isLeftSquareCorner(c)?this.steps_+=this.highlightConstants_.START_POINT:Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(c)?
1617
1621
  this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(c)?this.steps_+=this.notchPaths_.pathLeft:Types$$module$build$src$core$renderers$measurables$types.isHat(c)?this.steps_+=this.startPaths_.path(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isSpacer(c)&&0!==c.width&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",c.xPos+c.width-this.highlightOffset));this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",
@@ -1720,7 +1724,7 @@ d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}selectParent()
1720
1724
  a.toggleExpanded();return!0}selectNext(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)+1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[++b];if(c&&c.isSelectable())return this.setSelectedItem(c),!0}return!1}selectPrevious(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)-1;if(-1<b&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[--b];if(c&&c.isSelectable())return this.setSelectedItem(c),
1721
1725
  !0}return!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");this.flyout.dispose();this.contents.forEach(a=>a.dispose());for(let a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");
1722
1726
  return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return null!=(b=this.getToolboxItems().find(c=>c.isSelectable()))?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n');
1723
- register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.0.0",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
1727
+ register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.0.1-beta.1",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT,
1724
1728
  TOOLBOX_AT_TOP$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.TOP,TOOLBOX_AT_BOTTOM$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.BOTTOM,TOOLBOX_AT_LEFT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.LEFT,TOOLBOX_AT_RIGHT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.RIGHT,svgResize$$module$build$src$core$blockly=svgResize$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$blockly=
1725
1729
  getMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$blockly=getSelected$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$blockly=defineBlocksWithJsonArray$$module$build$src$core$common,setParentContainer$$module$build$src$core$blockly=setParentContainer$$module$build$src$core$common,COLLAPSE_CHARS$$module$build$src$core$blockly=COLLAPSE_CHARS$$module$build$src$core$internal_constants,OPPOSITE_TYPE$$module$build$src$core$blockly=OPPOSITE_TYPE$$module$build$src$core$internal_constants,
1726
1730
  RENAME_VARIABLE_ID$$module$build$src$core$blockly=RENAME_VARIABLE_ID$$module$build$src$core$internal_constants,DELETE_VARIABLE_ID$$module$build$src$core$blockly=DELETE_VARIABLE_ID$$module$build$src$core$internal_constants,COLLAPSED_INPUT_NAME$$module$build$src$core$blockly=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,COLLAPSED_FIELD_NAME$$module$build$src$core$blockly=COLLAPSED_FIELD_NAME$$module$build$src$core$constants,VARIABLE_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$variables,