blockly 9.0.0-beta.3 → 9.0.0-beta.4

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
@@ -470,24 +470,26 @@ module$build$src$core$utils$colour.getHsvSaturation=getHsvSaturation$$module$bui
470
470
  module$build$src$core$utils$colour.names=names$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.parse=parse$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.rgbToHex=rgbToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvSaturation=setHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.setHsvValue=setHsvValue$$module$build$src$core$utils$colour;var module$build$src$core$utils$parsing={};module$build$src$core$utils$parsing.checkMessageReferences=checkMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.parseBlockColour=parseBlockColour$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.replaceMessageReferences=replaceMessageReferences$$module$build$src$core$utils$parsing;module$build$src$core$utils$parsing.tokenizeInterpolation=tokenizeInterpolation$$module$build$src$core$utils$parsing;var Sentinel$$module$build$src$core$utils$sentinel=class{},module$build$src$core$utils$sentinel={};module$build$src$core$utils$sentinel.Sentinel=Sentinel$$module$build$src$core$utils$sentinel;var owner$$module$build$src$core$widgetdiv=null,dispose$$module$build$src$core$widgetdiv=null,rendererClassName$$module$build$src$core$widgetdiv="",themeClassName$$module$build$src$core$widgetdiv="",containerDiv$$module$build$src$core$widgetdiv,module$build$src$core$widgetdiv={};module$build$src$core$widgetdiv.createDom=createDom$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.getDiv=getDiv$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hide=hide$$module$build$src$core$widgetdiv;
471
471
  module$build$src$core$widgetdiv.hideIfOwner=hideIfOwner$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.isVisible=isVisible$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.positionWithAnchor=positionWithAnchor$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.show=show$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.testOnly_setDiv=testOnly_setDiv$$module$build$src$core$widgetdiv;var Field$$module$build$src$core$field=class{constructor(a,b,c){this.name=void 0;this.constants_=this.mouseDownWrapper_=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=this.markerSvg_=this.cursorSvg_=this.tooltip_=this.validator_=null;this.disposed=!1;this.maxDisplayLength=50;this.sourceBlock_=null;this.enabled_=this.visible_=this.isDirty_=!0;this.suffixField=this.prefixField=this.clickTarget_=null;this.EDITABLE=!0;this.SERIALIZABLE=!1;this.CURSOR="";this.value_="DEFAULT_VALUE"in
472
472
  new.target.prototype?new.target.prototype.DEFAULT_VALUE:null;this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){a.tooltip&&this.setTooltip(replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip))}setSourceBlock(a){if(this.sourceBlock_)throw Error("Field already bound to a block");this.sourceBlock_=a}getConstants(){!this.constants_&&this.sourceBlock_&&
473
- !this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_}getSourceBlock(){return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),this.initView(),this.updateEditable(),
474
- this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_();this.createTextElement_()}initModel(){}createBorderRect_(){this.borderRect_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=
475
- createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText"},this.fieldGroup_);this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)}bindEvents_(){bindMouseEvents$$module$build$src$core$tooltip(this.getClickTarget_());this.mouseDownWrapper_=conditionalBind$$module$build$src$core$browser_events(this.getClickTarget_(),
476
- "mousedown",this,this.onMouseDown_)}fromXml(a){this.setValue(a.textContent)}toXml(a){a.textContent=this.getValue();return a}saveState(a){a=this.saveLegacyState(Field$$module$build$src$core$field);return null!==a?a:this.getValue()}loadState(a){this.loadLegacyState(Field$$module$build$src$core$field,a)||this.setValue(a)}saveLegacyState(a){return a.prototype.saveState===this.saveState&&a.prototype.toXml!==this.toXml?(a=createElement$$module$build$src$core$utils$xml("field"),a.setAttribute("name",this.name||
477
- ""),domToText$$module$build$src$core$xml(this.toXml(a)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(a,b){return a.prototype.loadState===this.loadState&&a.prototype.fromXml!==this.fromXml?(this.fromXml(textToDom$$module$build$src$core$xml(b)),!0):!1}dispose(){hideIfOwner$$module$build$src$core$dropdowndiv(this);hideIfOwner$$module$build$src$core$widgetdiv(this);unbindMouseEvents$$module$build$src$core$tooltip(this.getClickTarget_());this.mouseDownWrapper_&&
478
- unbind$$module$build$src$core$browser_events(this.mouseDownWrapper_);removeNode$$module$build$src$core$utils$dom(this.fieldGroup_);this.disposed=!0}updateEditable(){const a=this.fieldGroup_;this.EDITABLE&&a&&(this.enabled_&&this.sourceBlock_.isEditable()?(addClass$$module$build$src$core$utils$dom(a,"blocklyEditableText"),removeClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableText"),a.style.cursor=this.CURSOR):(addClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableText"),removeClass$$module$build$src$core$utils$dom(a,
479
- "blocklyEditableText"),a.style.cursor=""))}setEnabled(a){this.enabled_=a;this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Field$$module$build$src$core$field.prototype.showEditor_}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let a=!1;this.name&&(this.SERIALIZABLE?a=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),
480
- a=!0));return a}isVisible(){return this.visible_}setVisible(a){if(this.visible_!==a){this.visible_=a;var b=this.getSvgRoot();b&&(b.style.display=a?"block":"none")}}setValidator(a){this.validator_=a}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()}showEditor(a){this.isClickable()&&this.showEditor_(a)}showEditor_(a){}updateSize_(a){const b=this.getConstants();
481
- a=void 0!==a?a:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let c=2*a,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=getFastTextWidth$$module$build$src$core$utils$dom(this.textElement_,b.FIELD_TEXT_FONTSIZE,b.FIELD_TEXT_FONTWEIGHT,b.FIELD_TEXT_FONTFAMILY),c+=e);this.borderRect_&&(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_.height=d;this.size_.width=c;this.positionTextElement_(a,e);this.positionBorderRect_()}positionTextElement_(a,b){if(this.textElement_){var c=this.getConstants(),
482
- d=this.size_.height/2;this.textElement_.setAttribute("x",this.sourceBlock_.RTL?this.size_.width-b-a:a);this.textElement_.setAttribute("y",c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE)}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",this.size_.width),this.borderRect_.setAttribute("height",this.size_.height),this.borderRect_.setAttribute("rx",this.getConstants().FIELD_BORDER_RECT_RADIUS),this.borderRect_.setAttribute("ry",this.getConstants().FIELD_BORDER_RECT_RADIUS))}getSize(){if(!this.isVisible())return new Size$$module$build$src$core$utils$size(0,
483
- 0);this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&0===this.size_.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.render_());return this.size_}getScaledBBox(){let a;let b;if(this.borderRect_){var c=this.borderRect_.getBoundingClientRect();b=getPageOffset$$module$build$src$core$utils$style(this.borderRect_);a=c.width;var d=c.height}else d=this.sourceBlock_.getHeightWidth(),c=this.sourceBlock_.workspace.scale,
484
- b=this.getAbsoluteXY_(),a=(d.width+1)*c,d=(d.height+1)*c,GECKO$$module$build$src$core$utils$useragent?(b.x+=1.5*c,b.y+=1.5*c):(b.x-=.5*c,b.y-=.5*c);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)}getDisplayText_(){let a=this.getText();if(!a)return Field$$module$build$src$core$field.NBSP;a.length>this.maxDisplayLength&&(a=a.substring(0,this.maxDisplayLength-2)+"\u2026");a=a.replace(/\s/g,Field$$module$build$src$core$field.NBSP);this.sourceBlock_&&this.sourceBlock_.RTL&&(a+="\u200f");
485
- return a}getText(){const a=this.getText_();return null!==a?String(a):String(this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0;this.constants_=null}forceRerender(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())}setValue(a){if(null!==a){var b=this.doClassValidation_(a);a=this.processValidation_(a,b);if(!(a instanceof Error)){if(b=this.getValidator())if(b=b.call(this,a),a=this.processValidation_(a,
486
- b),a instanceof Error)return;b=this.sourceBlock_;if(!b||!b.disposed){var c=this.getValue();c===a?this.doValueUpdate_(a):(this.doValueUpdate_(a),b&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(CHANGE$$module$build$src$core$events$utils))(b,"field",this.name||null,c,a)),this.isDirty_&&this.forceRerender())}}}}processValidation_(a,b){if(null===b)return this.doValueInvalid_(a),this.isDirty_&&this.forceRerender(),
487
- Error();void 0!==b&&(a=b);return a}getValue(){return this.value_}doClassValidation_(a){return null===a||void 0===a?null:a}doValueUpdate_(a){this.value_=a;this.isDirty_=!0}doValueInvalid_(a){}onMouseDown_(a){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)}setTooltip(a){a||""===a||(a=this.sourceBlock_);const b=this.getClickTarget_();b?b.tooltip=a:this.tooltip_=a}getTooltip(){const a=this.getClickTarget_();return a?getTooltipOfObject$$module$build$src$core$tooltip(a):
488
- getTooltipOfObject$$module$build$src$core$tooltip({tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return getPageOffset$$module$build$src$core$utils$style(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let a=null;const b=this.sourceBlock_,c=b.inputList;for(let d=0;d<b.inputList.length;d++){const e=c[d],f=e.fieldRow;for(let g=0;g<f.length;g++)if(f[g]===this){a=e;break}}return a}getFlipRtl(){return!1}isTabNavigable(){return!1}onShortcut(a){return!1}setCursorSvg(a){a?
489
- (this.fieldGroup_.appendChild(a),this.cursorSvg_=a):this.cursorSvg_=null}setMarkerSvg(a){a?(this.fieldGroup_.appendChild(a),this.markerSvg_=a):this.markerSvg_=null}updateMarkers_(){const a=this.sourceBlock_.workspace;a.keyboardAccessibilityMode&&this.cursorSvg_&&a.getCursor().draw();a.keyboardAccessibilityMode&&this.markerSvg_&&a.getMarker(MarkerManager$$module$build$src$core$marker_manager.LOCAL_MARKER).draw()}};Field$$module$build$src$core$field.NBSP="\u00a0";
490
- Field$$module$build$src$core$field.SKIP_SETUP=new Sentinel$$module$build$src$core$utils$sentinel;var module$build$src$core$field={};module$build$src$core$field.Field=Field$$module$build$src$core$field;var TEST_ONLY$$module$build$src$core$field_registry={fromJsonInternal:fromJsonInternal$$module$build$src$core$field_registry},module$build$src$core$field_registry={};module$build$src$core$field_registry.TEST_ONLY=TEST_ONLY$$module$build$src$core$field_registry;module$build$src$core$field_registry.fromJson=fromJson$$module$build$src$core$field_registry;module$build$src$core$field_registry.register=register$$module$build$src$core$field_registry;module$build$src$core$field_registry.unregister=unregister$$module$build$src$core$field_registry;var ARIA_PREFIX$$module$build$src$core$utils$aria="aria-",ROLE_ATTRIBUTE$$module$build$src$core$utils$aria="role",Role$$module$build$src$core$utils$aria;(function(a){a.GRID="grid";a.GRIDCELL="gridcell";a.GROUP="group";a.LISTBOX="listbox";a.MENU="menu";a.MENUITEM="menuitem";a.MENUITEMCHECKBOX="menuitemcheckbox";a.OPTION="option";a.PRESENTATION="presentation";a.ROW="row";a.TREE="tree";a.TREEITEM="treeitem"})(Role$$module$build$src$core$utils$aria||(Role$$module$build$src$core$utils$aria={}));var State$$module$build$src$core$utils$aria;
473
+ !this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_}getSourceBlock(){if(!this.sourceBlock_)throw Error(`The source block is ${this.sourceBlock_}.`);return this.sourceBlock_}init(){this.fieldGroup_||(this.fieldGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{}),this.isVisible()||(this.fieldGroup_.style.display="none"),this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_),
474
+ this.initView(),this.updateEditable(),this.setTooltip(this.tooltip_),this.bindEvents_(),this.initModel())}initView(){this.createBorderRect_();this.createTextElement_()}initModel(){}createBorderRect_(){this.borderRect_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{rx:this.getConstants().FIELD_BORDER_RECT_RADIUS,ry:this.getConstants().FIELD_BORDER_RECT_RADIUS,x:0,y:0,height:this.size_.height,width:this.size_.width,"class":"blocklyFieldRect"},this.fieldGroup_)}createTextElement_(){this.textElement_=
475
+ createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText"},this.fieldGroup_);this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.textElement_.setAttribute("dominant-baseline","central");this.textContent_=document.createTextNode("");this.textElement_.appendChild(this.textContent_)}bindEvents_(){const a=this.getClickTarget_();if(!a)throw Error("A click target has not been set.");bindMouseEvents$$module$build$src$core$tooltip(a);this.mouseDownWrapper_=
476
+ conditionalBind$$module$build$src$core$browser_events(a,"mousedown",this,this.onMouseDown_)}fromXml(a){this.setValue(a.textContent)}toXml(a){a.textContent=this.getValue();return a}saveState(a){a=this.saveLegacyState(Field$$module$build$src$core$field);return null!==a?a:this.getValue()}loadState(a){this.loadLegacyState(Field$$module$build$src$core$field,a)||this.setValue(a)}saveLegacyState(a){return a.prototype.saveState===this.saveState&&a.prototype.toXml!==this.toXml?(a=createElement$$module$build$src$core$utils$xml("field"),
477
+ a.setAttribute("name",this.name||""),domToText$$module$build$src$core$xml(this.toXml(a)).replace(' xmlns="https://developers.google.com/blockly/xml"',"")):null}loadLegacyState(a,b){return a.prototype.loadState===this.loadState&&a.prototype.fromXml!==this.fromXml?(this.fromXml(textToDom$$module$build$src$core$xml(b)),!0):!1}dispose(){hideIfOwner$$module$build$src$core$dropdowndiv(this);hideIfOwner$$module$build$src$core$widgetdiv(this);unbindMouseEvents$$module$build$src$core$tooltip(this.getClickTarget_());
478
+ this.mouseDownWrapper_&&unbind$$module$build$src$core$browser_events(this.mouseDownWrapper_);removeNode$$module$build$src$core$utils$dom(this.fieldGroup_);this.disposed=!0}updateEditable(){const a=this.fieldGroup_;this.EDITABLE&&a&&(this.enabled_&&this.getSourceBlock().isEditable()?(addClass$$module$build$src$core$utils$dom(a,"blocklyEditableText"),removeClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableText"),a.style.cursor=this.CURSOR):(addClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableText"),
479
+ removeClass$$module$build$src$core$utils$dom(a,"blocklyEditableText"),a.style.cursor=""))}setEnabled(a){this.enabled_=a;this.updateEditable()}isEnabled(){return this.enabled_}isClickable(){return this.enabled_&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()&&this.showEditor_!==Field$$module$build$src$core$field.prototype.showEditor_}isCurrentlyEditable(){return this.enabled_&&this.EDITABLE&&!!this.sourceBlock_&&this.sourceBlock_.isEditable()}isSerializable(){let a=!1;this.name&&(this.SERIALIZABLE?
480
+ a=!0:this.EDITABLE&&(console.warn("Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization."),a=!0));return a}isVisible(){return this.visible_}setVisible(a){if(this.visible_!==a){this.visible_=a;var b=this.fieldGroup_;b&&(b.style.display=a?"block":"none")}}setValidator(a){this.validator_=a}getValidator(){return this.validator_}getSvgRoot(){return this.fieldGroup_}getBorderRect(){if(!this.borderRect_)throw Error(`The border rectangle is ${this.borderRect_}.`);
481
+ return this.borderRect_}getTextElement(){if(!this.textElement_)throw Error(`The text element is ${this.textElement_}.`);return this.textElement_}getTextContent(){if(!this.textContent_)throw Error(`The text content is ${this.textContent_}.`);return this.textContent_}applyColour(){}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_()}showEditor(a){this.isClickable()&&this.showEditor_(a)}showEditor_(a){}updateSize_(a){const b=this.getConstants();a=void 0!==
482
+ a?a:this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let c=2*a,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=getFastTextWidth$$module$build$src$core$utils$dom(this.textElement_,b.FIELD_TEXT_FONTSIZE,b.FIELD_TEXT_FONTWEIGHT,b.FIELD_TEXT_FONTFAMILY),c+=e);this.borderRect_&&(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_.height=d;this.size_.width=c;this.positionTextElement_(a,e);this.positionBorderRect_()}positionTextElement_(a,b){if(this.textElement_){var c=this.getConstants(),
483
+ d=this.size_.height/2;this.textElement_.setAttribute("x",`${this.getSourceBlock().RTL?this.size_.width-b-a:a}`);this.textElement_.setAttribute("y",`${c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE}`)}}positionBorderRect_(){this.borderRect_&&(this.borderRect_.setAttribute("width",`${this.size_.width}`),this.borderRect_.setAttribute("height",`${this.size_.height}`),this.borderRect_.setAttribute("rx",`${this.getConstants().FIELD_BORDER_RECT_RADIUS}`),this.borderRect_.setAttribute("ry",
484
+ `${this.getConstants().FIELD_BORDER_RECT_RADIUS}`))}getSize(){if(!this.isVisible())return new Size$$module$build$src$core$utils$size(0,0);this.isDirty_?(this.render_(),this.isDirty_=!1):this.visible_&&0===this.size_.width&&(console.warn("Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead."),this.render_());return this.size_}getScaledBBox(){let a;let b;if(this.borderRect_){var c=this.borderRect_.getBoundingClientRect();b=getPageOffset$$module$build$src$core$utils$style(this.borderRect_);
485
+ a=c.width;var d=c.height}else d=this.sourceBlock_.getHeightWidth(),c=this.getSourceBlock().workspace.scale,b=this.getAbsoluteXY_(),a=(d.width+1)*c,d=(d.height+1)*c,GECKO$$module$build$src$core$utils$useragent?(b.x+=1.5*c,b.y+=1.5*c):(b.x-=.5*c,b.y-=.5*c);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+d,b.x,b.x+a)}getDisplayText_(){let a=this.getText();if(!a)return Field$$module$build$src$core$field.NBSP;a.length>this.maxDisplayLength&&(a=a.substring(0,this.maxDisplayLength-2)+"\u2026");
486
+ a=a.replace(/\s/g,Field$$module$build$src$core$field.NBSP);this.sourceBlock_&&this.sourceBlock_.RTL&&(a+="\u200f");return a}getText(){const a=this.getText_();return null!==a?String(a):String(this.getValue())}getText_(){return null}markDirty(){this.isDirty_=!0;this.constants_=null}forceRerender(){this.isDirty_=!0;this.sourceBlock_&&this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours(),this.updateMarkers_())}setValue(a){if(null!==a){var b=this.doClassValidation_(a);
487
+ a=this.processValidation_(a,b);if(!(a instanceof Error)){if(b=this.getValidator())if(b=b.call(this,a),a=this.processValidation_(a,b),a instanceof Error)return;b=this.sourceBlock_;if(!b||!b.disposed){var c=this.getValue();c===a?this.doValueUpdate_(a):(this.doValueUpdate_(a),b&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(CHANGE$$module$build$src$core$events$utils))(b,"field",this.name||null,c,a)),this.isDirty_&&
488
+ this.forceRerender())}}}}processValidation_(a,b){if(null===b)return this.doValueInvalid_(a),this.isDirty_&&this.forceRerender(),Error();void 0!==b&&(a=b);return a}getValue(){return this.value_}doClassValidation_(a){return null===a||void 0===a?null:a}doValueUpdate_(a){this.value_=a;this.isDirty_=!0}doValueInvalid_(a){}onMouseDown_(a){this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&(a=this.sourceBlock_.workspace.getGesture(a))&&a.setStartField(this)}setTooltip(a){a||""===a||(a=this.sourceBlock_);
489
+ const b=this.getClickTarget_();b?b.tooltip=a:this.tooltip_=a}getTooltip(){const a=this.getClickTarget_();return a?getTooltipOfObject$$module$build$src$core$tooltip(a):getTooltipOfObject$$module$build$src$core$tooltip({tooltip:this.tooltip_})}getClickTarget_(){return this.clickTarget_||this.getSvgRoot()}getAbsoluteXY_(){return getPageOffset$$module$build$src$core$utils$style(this.getClickTarget_())}referencesVariables(){return!1}refreshVariableName(){}getParentInput(){let a=null;const b=this.getSourceBlock(),
490
+ c=b.inputList;for(let d=0;d<b.inputList.length;d++){const e=c[d],f=e.fieldRow;for(let g=0;g<f.length;g++)if(f[g]===this){a=e;break}}return a}getFlipRtl(){return!1}isTabNavigable(){return!1}onShortcut(a){return!1}setCursorSvg(a){if(a){if(!this.fieldGroup_)throw Error(`The field group is ${this.fieldGroup_}.`);this.fieldGroup_.appendChild(a);this.cursorSvg_=a}else this.cursorSvg_=null}setMarkerSvg(a){if(a){if(!this.fieldGroup_)throw Error(`The field group is ${this.fieldGroup_}.`);this.fieldGroup_.appendChild(a);
491
+ this.markerSvg_=a}else this.markerSvg_=null}updateMarkers_(){const a=this.getSourceBlock().workspace;a.keyboardAccessibilityMode&&this.cursorSvg_&&a.getCursor().draw();a.keyboardAccessibilityMode&&this.markerSvg_&&a.getMarker(MarkerManager$$module$build$src$core$marker_manager.LOCAL_MARKER).draw()}};Field$$module$build$src$core$field.NBSP="\u00a0";Field$$module$build$src$core$field.SKIP_SETUP=new Sentinel$$module$build$src$core$utils$sentinel;var module$build$src$core$field={};
492
+ module$build$src$core$field.Field=Field$$module$build$src$core$field;var TEST_ONLY$$module$build$src$core$field_registry={fromJsonInternal:fromJsonInternal$$module$build$src$core$field_registry},module$build$src$core$field_registry={};module$build$src$core$field_registry.TEST_ONLY=TEST_ONLY$$module$build$src$core$field_registry;module$build$src$core$field_registry.fromJson=fromJson$$module$build$src$core$field_registry;module$build$src$core$field_registry.register=register$$module$build$src$core$field_registry;module$build$src$core$field_registry.unregister=unregister$$module$build$src$core$field_registry;var ARIA_PREFIX$$module$build$src$core$utils$aria="aria-",ROLE_ATTRIBUTE$$module$build$src$core$utils$aria="role",Role$$module$build$src$core$utils$aria;(function(a){a.GRID="grid";a.GRIDCELL="gridcell";a.GROUP="group";a.LISTBOX="listbox";a.MENU="menu";a.MENUITEM="menuitem";a.MENUITEMCHECKBOX="menuitemcheckbox";a.OPTION="option";a.PRESENTATION="presentation";a.ROW="row";a.TREE="tree";a.TREEITEM="treeitem"})(Role$$module$build$src$core$utils$aria||(Role$$module$build$src$core$utils$aria={}));var State$$module$build$src$core$utils$aria;
491
493
  (function(a){a.ACTIVEDESCENDANT="activedescendant";a.COLCOUNT="colcount";a.DISABLED="disabled";a.EXPANDED="expanded";a.INVALID="invalid";a.LABEL="label";a.LABELLEDBY="labelledby";a.LEVEL="level";a.ORIENTATION="orientation";a.POSINSET="posinset";a.ROWCOUNT="rowcount";a.SELECTED="selected";a.SETSIZE="setsize";a.VALUEMAX="valuemax";a.VALUEMIN="valuemin"})(State$$module$build$src$core$utils$aria||(State$$module$build$src$core$utils$aria={}));var module$build$src$core$utils$aria={};
492
494
  module$build$src$core$utils$aria.Role=Role$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.State=State$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.setRole=setRole$$module$build$src$core$utils$aria;module$build$src$core$utils$aria.setState=setState$$module$build$src$core$utils$aria;var KeyCodes$$module$build$src$core$utils$keycodes;
493
495
  (function(a){a[a.WIN_KEY_FF_LINUX=0]="WIN_KEY_FF_LINUX";a[a.MAC_ENTER=3]="MAC_ENTER";a[a.BACKSPACE=8]="BACKSPACE";a[a.TAB=9]="TAB";a[a.NUM_CENTER=12]="NUM_CENTER";a[a.ENTER=13]="ENTER";a[a.SHIFT=16]="SHIFT";a[a.CTRL=17]="CTRL";a[a.ALT=18]="ALT";a[a.PAUSE=19]="PAUSE";a[a.CAPS_LOCK=20]="CAPS_LOCK";a[a.ESC=27]="ESC";a[a.SPACE=32]="SPACE";a[a.PAGE_UP=33]="PAGE_UP";a[a.PAGE_DOWN=34]="PAGE_DOWN";a[a.END=35]="END";a[a.HOME=36]="HOME";a[a.LEFT=37]="LEFT";a[a.UP=38]="UP";a[a.RIGHT=39]="RIGHT";a[a.DOWN=40]=
@@ -511,22 +513,22 @@ b.appendChild(c);a.appendChild(b);this.roleName_&&setRole$$module$build$src$core
511
513
  a:null}setRightToLeft(a){this.rightToLeft_=a}setRole(a){this.roleName_=a}setCheckable(a){this.checkable_=a}setChecked(a){this.checked_=a}setHighlighted(a){this.highlight_=a;const b=this.getElement();b&&this.isEnabled()&&(a?(addClass$$module$build$src$core$utils$dom(b,"blocklyMenuItemHighlight"),addClass$$module$build$src$core$utils$dom(b,"goog-menuitem-highlight")):(removeClass$$module$build$src$core$utils$dom(b,"blocklyMenuItemHighlight"),removeClass$$module$build$src$core$utils$dom(b,"goog-menuitem-highlight")))}isEnabled(){return this.enabled_}setEnabled(a){this.enabled_=
512
514
  a}performAction(){this.isEnabled()&&this.actionHandler_&&this.actionHandler_(this)}onAction(a,b){this.actionHandler_=a.bind(b)}},module$build$src$core$menuitem={};module$build$src$core$menuitem.MenuItem=MenuItem$$module$build$src$core$menuitem;var FieldDropdown$$module$build$src$core$field_dropdown=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.svgArrow_=this.arrow_=this.imageElement_=this.menu_=this.selectedMenuItem_=null;this.SERIALIZABLE=!0;this.CURSOR="default";this.suffixField=this.prefixField=this.generatedOptions_=null;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(Array.isArray(a)&&(validateOptions$$module$build$src$core$field_dropdown(a),a=JSON.parse(JSON.stringify(a))),
513
515
  this.menuGenerator_=a,this.trimOptions_(),this.selectedOption_=this.getOptions(!1)[0],c&&this.configure_(c),this.setValue(this.selectedOption_[1]),b&&this.setValidator(b))}fromXml(a){this.isOptionListDynamic()&&this.getOptions(!1);this.setValue(a.textContent)}loadState(a){this.loadLegacyState(FieldDropdown$$module$build$src$core$field_dropdown,a)||(this.isOptionListDynamic()&&this.getOptions(!1),this.setValue(a))}initView(){this.shouldAddBorderRect_()?this.createBorderRect_():this.clickTarget_=this.sourceBlock_.getSvgRoot();
514
- this.createTextElement_();this.imageElement_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&addClass$$module$build$src$core$utils$dom(this.borderRect_,"blocklyDropdownRect")}shouldAddBorderRect_(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.sourceBlock_.isShadow()}createTextArrow_(){this.arrow_=
515
- createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.sourceBlock_.RTL?FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR+" ":" "+FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR));this.sourceBlock_.RTL?this.textElement_.insertBefore(this.arrow_,this.textContent_):this.textElement_.appendChild(this.arrow_)}createSVGArrow_(){this.svgArrow_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,
516
+ this.createTextElement_();this.imageElement_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{},this.fieldGroup_);this.getConstants().FIELD_DROPDOWN_SVG_ARROW?this.createSVGArrow_():this.createTextArrow_();this.borderRect_&&addClass$$module$build$src$core$utils$dom(this.borderRect_,"blocklyDropdownRect")}shouldAddBorderRect_(){return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!this.getSourceBlock().isShadow()}createTextArrow_(){this.arrow_=
517
+ createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{},this.textElement_);this.arrow_.appendChild(document.createTextNode(this.getSourceBlock().RTL?FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR+" ":" "+FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR));this.getSourceBlock().RTL?this.getTextElement().insertBefore(this.arrow_,this.textContent_):this.getTextElement().appendChild(this.arrow_)}createSVGArrow_(){this.svgArrow_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,
516
518
  {height:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px",width:this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE+"px"},this.fieldGroup_);this.svgArrow_.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.getConstants().FIELD_DROPDOWN_SVG_ARROW_DATAURI)}showEditor_(a){this.dropdownCreate_();this.menu_.openingCoords=a&&"number"===typeof a.clientX?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):null;clearContent$$module$build$src$core$dropdowndiv();
517
- a=this.menu_.render(getContentDiv$$module$build$src$core$dropdowndiv());addClass$$module$build$src$core$utils$dom(a,"blocklyDropdownMenu");if(this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){a=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().getColour():this.sourceBlock_.getColour();const b=this.sourceBlock_.isShadow()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;if(!b)throw Error("The renderer did not properly initialize the block style");setColour$$module$build$src$core$dropdowndiv(a,
518
- b)}showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_);this.applyColour()}dropdownCreate_(){const a=new Menu$$module$build$src$core$menu;a.setRole(Role$$module$build$src$core$utils$aria.LISTBOX);this.menu_=a;const b=this.getOptions(!1);this.selectedMenuItem_=null;for(let d=0;d<b.length;d++){var c=b[d][0];const e=b[d][1];if("object"===typeof c){const f=new Image(c.width,
519
- c.height);f.src=c.src;f.alt=c.alt||"";c=f}c=new MenuItem$$module$build$src$core$menuitem(c,e);c.setRole(Role$$module$build$src$core$utils$aria.OPTION);c.setRightToLeft(this.sourceBlock_.RTL);c.setCheckable(!0);a.addChild(c);c.setChecked(e===this.value_);e===this.value_&&(this.selectedMenuItem_=c);c.onAction(this.handleMenuActionEvent_,this)}}dropdownDispose_(){this.menu_&&this.menu_.dispose();this.selectedMenuItem_=this.menu_=null;this.applyColour()}handleMenuActionEvent_(a){hideIfOwner$$module$build$src$core$dropdowndiv(this,
519
+ a=this.menu_.render(getContentDiv$$module$build$src$core$dropdowndiv());addClass$$module$build$src$core$utils$dom(a,"blocklyDropdownMenu");if(this.getConstants().FIELD_DROPDOWN_COLOURED_DIV){a=this.getSourceBlock().isShadow()?this.getSourceBlock().getParent().getColour():this.getSourceBlock().getColour();const b=this.getSourceBlock().isShadow()?this.getSourceBlock().getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;if(!b)throw Error("The renderer did not properly initialize the block style");
520
+ setColour$$module$build$src$core$dropdowndiv(a,b)}showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this));this.menu_.focus();this.selectedMenuItem_&&this.menu_.setHighlighted(this.selectedMenuItem_);this.applyColour()}dropdownCreate_(){const a=new Menu$$module$build$src$core$menu;a.setRole(Role$$module$build$src$core$utils$aria.LISTBOX);this.menu_=a;const b=this.getOptions(!1);this.selectedMenuItem_=null;for(let d=0;d<b.length;d++){var c=b[d][0];const e=b[d][1];
521
+ if("object"===typeof c){const f=new Image(c.width,c.height);f.src=c.src;f.alt=c.alt||"";c=f}c=new MenuItem$$module$build$src$core$menuitem(c,e);c.setRole(Role$$module$build$src$core$utils$aria.OPTION);c.setRightToLeft(this.getSourceBlock().RTL);c.setCheckable(!0);a.addChild(c);c.setChecked(e===this.value_);e===this.value_&&(this.selectedMenuItem_=c);c.onAction(this.handleMenuActionEvent_,this)}}dropdownDispose_(){this.menu_&&this.menu_.dispose();this.selectedMenuItem_=this.menu_=null;this.applyColour()}handleMenuActionEvent_(a){hideIfOwner$$module$build$src$core$dropdowndiv(this,
520
522
  !0);this.onItemSelected_(this.menu_,a)}onItemSelected_(a,b){this.setValue(b.getValue())}trimOptions_(){const a=this.menuGenerator_;if(Array.isArray(a)){var b=!1;for(var c=0;c<a.length;c++){var d=a[c][0];"string"===typeof d?a[c][0]=replaceMessageReferences$$module$build$src$core$utils$parsing(d):(null!==d.alt&&(a[c][0].alt=replaceMessageReferences$$module$build$src$core$utils$parsing(d.alt)),b=!0)}if(!(b||2>a.length)){b=[];for(c=0;c<a.length;c++)b.push(a[c][0]);c=shortestStringLength$$module$build$src$core$utils$string(b);
521
523
  d=commonWordPrefix$$module$build$src$core$utils$string(b,c);var e=commonWordSuffix$$module$build$src$core$utils$string(b,c);!d&&!e||c<=d+e||(d&&(this.prefixField=b[0].substring(0,d-1)),e&&(this.suffixField=b[0].substr(1-e)),this.menuGenerator_=FieldDropdown$$module$build$src$core$field_dropdown.applyTrim_(a,d,e))}}}isOptionListDynamic(){return"function"===typeof this.menuGenerator_}getOptions(a){return this.isOptionListDynamic()?(this.generatedOptions_&&a||(this.generatedOptions_=this.menuGenerator_.call(this),
522
524
  validateOptions$$module$build$src$core$field_dropdown(this.generatedOptions_)),this.generatedOptions_):this.menuGenerator_}doClassValidation_(a){let b=!1;const c=this.getOptions(!0);for(let d=0,e;e=c[d];d++)if(e[1]===a){b=!0;break}return b?a:(this.sourceBlock_&&console.warn("Cannot set the dropdown's value to an unavailable option. Block type: "+this.sourceBlock_.type+", Field name: "+this.name+", Value: "+a),null)}doValueUpdate_(a){super.doValueUpdate_(a);a=this.getOptions(!0);for(let b=0,c;c=a[b];b++)c[1]===
523
525
  this.value_&&(this.selectedOption_=c)}applyColour(){const a=this.sourceBlock_.style;if(!a.colourSecondary)throw Error("The renderer did not properly initialize the block style");if(!a.colourTertiary)throw Error("The renderer did not properly initialize the block style");this.borderRect_&&(this.borderRect_.setAttribute("stroke",a.colourTertiary),this.menu_?this.borderRect_.setAttribute("fill",a.colourTertiary):this.borderRect_.setAttribute("fill","transparent"));this.sourceBlock_&&this.arrow_&&(this.sourceBlock_.isShadow()?
524
- this.arrow_.style.fill=a.colourSecondary:this.arrow_.style.fill=a.colourPrimary)}render_(){this.textContent_.nodeValue="";this.imageElement_.style.display="none";const a=this.selectedOption_&&this.selectedOption_[0];a&&"object"===typeof a?this.renderSelectedImage_(a):this.renderSelectedText_();this.positionBorderRect_()}renderSelectedImage_(a){this.imageElement_.style.display="";this.imageElement_.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.src);this.imageElement_.setAttribute("height",
526
+ this.arrow_.style.fill=a.colourSecondary:this.arrow_.style.fill=a.colourPrimary)}render_(){this.getTextContent().nodeValue="";this.imageElement_.style.display="none";const a=this.selectedOption_&&this.selectedOption_[0];a&&"object"===typeof a?this.renderSelectedImage_(a):this.renderSelectedText_();this.positionBorderRect_()}renderSelectedImage_(a){this.imageElement_.style.display="";this.imageElement_.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.src);this.imageElement_.setAttribute("height",
525
527
  a.height);this.imageElement_.setAttribute("width",a.width);const b=Number(a.height);a=Number(a.width);var c=!!this.borderRect_;const d=Math.max(c?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,b+IMAGE_Y_PADDING$$module$build$src$core$field_dropdown);c=c?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let e;e=this.svgArrow_?this.positionSVGArrow_(a+c,d/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):getFastTextWidth$$module$build$src$core$utils$dom(this.arrow_,this.getConstants().FIELD_TEXT_FONTSIZE,
526
- this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);this.size_.width=a+e+2*c;this.size_.height=d;let f=0;this.sourceBlock_.RTL?this.imageElement_.setAttribute("x",(c+e).toString()):(f=a+e,this.textElement_.setAttribute("text-anchor","end"),this.imageElement_.setAttribute("x",c.toString()));this.imageElement_.setAttribute("y",(d/2-b/2).toString());this.positionTextElement_(f+c,a+e)}renderSelectedText_(){this.textContent_.nodeValue=this.getDisplayText_();addClass$$module$build$src$core$utils$dom(this.textElement_,
527
- "blocklyDropdownText");this.textElement_.setAttribute("text-anchor","start");var a=!!this.borderRect_;const b=Math.max(a?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT),c=getFastTextWidth$$module$build$src$core$utils$dom(this.textElement_,this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);a=a?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let d=0;this.svgArrow_&&(d=this.positionSVGArrow_(c+
528
- a,b/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_.width=c+d+2*a;this.size_.height=b;this.positionTextElement_(a,c)}positionSVGArrow_(a,b){if(!this.svgArrow_)return 0;const c=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,d=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow_.setAttribute("transform","translate("+(this.sourceBlock_.RTL?c:a+d)+","+b+")");return e+d}getText_(){if(!this.selectedOption_)return null;
529
- const a=this.selectedOption_[0];return"object"===typeof a?a.alt:a}static fromJson(a){if(!a.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(a.options,void 0,a)}static applyTrim_(a,b,c){const d=[];for(let e=0;e<a.length;e++){let f=a[e][0];const g=a[e][1];f=f.substring(b,f.length-c);d[e]=[f,g]}return d}};
528
+ this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);this.size_.width=a+e+2*c;this.size_.height=d;let f=0;this.getSourceBlock().RTL?this.imageElement_.setAttribute("x",(c+e).toString()):(f=a+e,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement_.setAttribute("x",c.toString()));this.imageElement_.setAttribute("y",(d/2-b/2).toString());this.positionTextElement_(f+c,a+e)}renderSelectedText_(){this.getTextContent().nodeValue=this.getDisplayText_();
529
+ var a=this.getTextElement();addClass$$module$build$src$core$utils$dom(a,"blocklyDropdownText");a.setAttribute("text-anchor","start");var b=!!this.borderRect_;a=Math.max(b?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,this.getConstants().FIELD_TEXT_HEIGHT);const c=getFastTextWidth$$module$build$src$core$utils$dom(this.getTextElement(),this.getConstants().FIELD_TEXT_FONTSIZE,this.getConstants().FIELD_TEXT_FONTWEIGHT,this.getConstants().FIELD_TEXT_FONTFAMILY);b=b?this.getConstants().FIELD_BORDER_RECT_X_PADDING:
530
+ 0;let d=0;this.svgArrow_&&(d=this.positionSVGArrow_(c+b,a/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_.width=c+d+2*b;this.size_.height=a;this.positionTextElement_(b,c)}positionSVGArrow_(a,b){if(!this.svgArrow_)return 0;const c=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,d=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;a=this.getSourceBlock().RTL?c:a+d;this.svgArrow_.setAttribute("transform","translate("+
531
+ a+","+b+")");return e+d}getText_(){if(!this.selectedOption_)return null;const a=this.selectedOption_[0];return"object"===typeof a?a.alt:a}static fromJson(a){if(!a.options)throw Error("options are required for the dropdown field. The options property must be assigned an array of [humanReadableValue, languageNeutralValue] tuples.");return new this(a.options,void 0,a)}static applyTrim_(a,b,c){const d=[];for(let e=0;e<a.length;e++){let f=a[e][0];const g=a[e][1];f=f.substring(b,f.length-c);d[e]=[f,g]}return d}};
530
532
  FieldDropdown$$module$build$src$core$field_dropdown.CHECKMARK_OVERHANG=25;FieldDropdown$$module$build$src$core$field_dropdown.MAX_MENU_HEIGHT_VH=.45;var IMAGE_Y_OFFSET$$module$build$src$core$field_dropdown=5,IMAGE_Y_PADDING$$module$build$src$core$field_dropdown=2*IMAGE_Y_OFFSET$$module$build$src$core$field_dropdown;FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR=ANDROID$$module$build$src$core$utils$useragent?"\u25bc":"\u25be";
531
533
  register$$module$build$src$core$field_registry("field_dropdown",FieldDropdown$$module$build$src$core$field_dropdown);$.module$build$src$core$field_dropdown={};$.module$build$src$core$field_dropdown.FieldDropdown=FieldDropdown$$module$build$src$core$field_dropdown;var BubbleOpen$$module$build$src$core$events$events_bubble_open=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(a?a.workspace.id:void 0);this.type=BUBBLE_OPEN$$module$build$src$core$events$utils;a&&(this.blockId=a.id,this.isOpen=b,this.bubbleType=c)}toJson(){const a=super.toJson();if(void 0===this.isOpen)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");
532
534
  a.isOpen=this.isOpen;a.bubbleType=this.bubbleType;a.blockId=this.blockId||"";return a}fromJson(a){super.fromJson(a);this.isOpen=a.isOpen;this.bubbleType=a.bubbleType;this.blockId=a.blockId}},BubbleType$$module$build$src$core$events$events_bubble_open;(function(a){a.MUTATOR="mutator";a.COMMENT="comment";a.WARNING="warning"})(BubbleType$$module$build$src$core$events$events_bubble_open||(BubbleType$$module$build$src$core$events$events_bubble_open={}));
@@ -603,7 +605,7 @@ getGroup$$module$build$src$core$events$utils())||setGroup$$module$build$src$core
603
605
  this.workspace_;if(a&&a.getAllBlocks(!1)){const b=a.getAllBlocks(!1);for(let c=0,d;d=b[c];c++)d.setStyle(d.getStyleName());if(a=a.getFlyout()){a=a.getWorkspace().getAllBlocks(!1);for(let c=0,d;d=a[c];c++)d.setStyle(d.getStyleName())}}}static reconnect(a,b,c){if(!a||!a.getSourceBlock().workspace)return!1;c=b.getInput(c).connection;const d=a.targetBlock();return d&&d!==b||!c||c.targetConnection===a?!1:(c.isConnected()&&c.disconnect(),c.connect(a),!0)}static findParentWs(a){let b=null;if(a&&a.options){const c=
604
606
  a.options.parentWorkspace;a.isFlyout?c&&c.options&&(b=c.options.parentWorkspace):c&&(b=c)}return b}};module$build$src$core$mutator={};module$build$src$core$mutator.Mutator=$.Mutator$$module$build$src$core$mutator;var allExtensions$$module$build$src$core$extensions=Object.create(null),TEST_ONLY$$module$build$src$core$extensions={allExtensions:allExtensions$$module$build$src$core$extensions};register$$module$build$src$core$extensions("parent_tooltip_when_inline",extensionParentTooltip$$module$build$src$core$extensions);$.module$build$src$core$extensions={};$.module$build$src$core$extensions.TEST_ONLY=TEST_ONLY$$module$build$src$core$extensions;$.module$build$src$core$extensions.apply=apply$$module$build$src$core$extensions;
605
607
  $.module$build$src$core$extensions.buildTooltipForDropdown=buildTooltipForDropdown$$module$build$src$core$extensions;$.module$build$src$core$extensions.buildTooltipWithFieldText=buildTooltipWithFieldText$$module$build$src$core$extensions;$.module$build$src$core$extensions.isRegistered=isRegistered$$module$build$src$core$extensions;$.module$build$src$core$extensions.register=register$$module$build$src$core$extensions;$.module$build$src$core$extensions.registerMixin=registerMixin$$module$build$src$core$extensions;
606
- $.module$build$src$core$extensions.registerMutator=registerMutator$$module$build$src$core$extensions;$.module$build$src$core$extensions.runAfterPageLoad=runAfterPageLoad$$module$build$src$core$extensions;$.module$build$src$core$extensions.unregister=unregister$$module$build$src$core$extensions;$.FieldLabel$$module$build$src$core$field_label=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.class_=null;this.EDITABLE=!1;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c?this.configure_(c):this.class_=b||null,this.setValue(a))}configure_(a){super.configure_(a);a.class&&(this.class_=a.class)}initView(){this.createTextElement_();this.class_&&addClass$$module$build$src$core$utils$dom(this.textElement_,this.class_)}doClassValidation_(a){return null===
608
+ $.module$build$src$core$extensions.registerMutator=registerMutator$$module$build$src$core$extensions;$.module$build$src$core$extensions.runAfterPageLoad=runAfterPageLoad$$module$build$src$core$extensions;$.module$build$src$core$extensions.unregister=unregister$$module$build$src$core$extensions;$.FieldLabel$$module$build$src$core$field_label=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.class_=null;this.EDITABLE=!1;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c?this.configure_(c):this.class_=b||null,this.setValue(a))}configure_(a){super.configure_(a);a.class&&(this.class_=a.class)}initView(){this.createTextElement_();this.class_&&addClass$$module$build$src$core$utils$dom(this.getTextElement(),this.class_)}doClassValidation_(a){return null===
607
609
  a||void 0===a?null:String(a)}setClass(a){this.textElement_&&(this.class_&&removeClass$$module$build$src$core$utils$dom(this.textElement_,this.class_),a&&addClass$$module$build$src$core$utils$dom(this.textElement_,a));this.class_=a}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};register$$module$build$src$core$field_registry("field_label",$.FieldLabel$$module$build$src$core$field_label);
608
610
  $.FieldLabel$$module$build$src$core$field_label.prototype.DEFAULT_VALUE="";var module$build$src$core$field_label={};module$build$src$core$field_label.FieldLabel=$.FieldLabel$$module$build$src$core$field_label;var Input$$module$build$src$core$input=class{constructor(a,b,c,d){this.type=a;this.name=b;this.connection=d;this.fieldRow=[];this.visible_=!0;if(a!==inputTypes$$module$build$src$core$input_types.DUMMY&&!b)throw Error("Value inputs and statement inputs must have non-empty name.");this.sourceBlock_=c;this.align=$.Align$$module$build$src$core$input.LEFT}getSourceBlock(){return this.sourceBlock_}appendField(a,b){this.insertFieldAt(this.fieldRow.length,a,b);return this}insertFieldAt(a,b,c){if(0>a||a>this.fieldRow.length)throw Error("index "+
609
611
  a+" out of bounds.");if(!(b||""===b&&c))return a;"string"===typeof b&&(b=fromJson$$module$build$src$core$field_registry({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock_);this.sourceBlock_.rendered&&(b.init(),b.applyColour());b.name=c;b.setVisible(this.isVisible());b.prefixField&&(a=this.insertFieldAt(a,b.prefixField));this.fieldRow.splice(a,0,b);a++;b.suffixField&&(a=this.insertFieldAt(a,b.suffixField));this.sourceBlock_.rendered&&(this.sourceBlock_.render(),this.sourceBlock_.bumpNeighbours());
@@ -1179,20 +1181,20 @@ a.flipRtl&&(this.flipRtl_=a.flipRtl);a.alt&&(this.altText_=replaceMessageReferen
1179
1181
  "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",String(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_=a}getText_(){return this.altText_}static fromJson(a){if(!a.src||
1180
1182
  !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="";var module$build$src$core$field_image={};
1181
1183
  module$build$src$core$field_image.FieldImage=$.FieldImage$$module$build$src$core$field_image;$.FieldTextInput$$module$build$src$core$field_textinput=class extends Field$$module$build$src$core$field{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_=null;this.fullBlockClickTarget_=!1;this.workspace_=null;this.SERIALIZABLE=!0;this.CURSOR="text";a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);
1182
- void 0!==a.spellcheck&&(this.spellcheck_=a.spellcheck)}initView(){if(this.getConstants().FULL_BLOCK_FIELDS){let a=0,b=0;for(let c=0,d;d=this.sourceBlock_.inputList[c];c++){for(let e=0;d.fieldRow[e];e++)a++;d.connection&&b++}this.fullBlockClickTarget_=1>=a&&this.sourceBlock_.outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()}doClassValidation_(a){return null===a||void 0===
1183
- a?null:String(a)}doValueInvalid_(a){this.isBeingEdited_&&(this.isTextValid_=!1,a=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,a,this.value_)))}doValueUpdate_(a){this.isTextValid_=!0;this.value_=a;this.isBeingEdited_||(this.isDirty_=
1184
- !0)}applyColour(){if(this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS){var a=this.sourceBlock_;if(this.borderRect_){if(!a.style.colourTertiary)throw Error("The renderer did not properly initialize the block style");this.borderRect_.setAttribute("stroke",a.style.colourTertiary)}else a.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)}}render_(){super.render_();if(this.isBeingEdited_){this.resizeEditor_();const a=this.htmlInput_;this.isTextValid_?(removeClass$$module$build$src$core$utils$dom(a,
1185
- "blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0))}}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b){this.workspace_=this.sourceBlock_.workspace;a=b||!1;!a&&(MOBILE$$module$build$src$core$utils$useragent||
1186
- ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor_():this.showInlineEditor_(a)}showPromptEditor_(){prompt$$module$build$src$core$dialog(Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{null!==a&&this.setValue(this.getValueFromEditorText_(a))})}showInlineEditor_(a){show$$module$build$src$core$widgetdiv(this,this.sourceBlock_.RTL,this.widgetDispose_.bind(this));this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=
1187
- !0;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){setGroup$$module$build$src$core$events$utils(!0);const a=getDiv$$module$build$src$core$widgetdiv();addClass$$module$build$src$core$utils$dom(this.getClickTarget_(),"editing");const b=document.createElement("input");b.className="blocklyHtmlInput";b.setAttribute("spellcheck",this.spellcheck_);const c=this.workspace_.getScale();var d=this.getConstants().FIELD_TEXT_FONTSIZE*c+"pt";a.style.fontSize=d;b.style.fontSize=
1188
- d;d=$.FieldTextInput$$module$build$src$core$field_textinput.BORDERRADIUS*c+"px";if(this.fullBlockClickTarget_){d=this.getScaledBBox();d=(d.bottom-d.top)/2+"px";const e=this.sourceBlock_.getParent()?this.sourceBlock_.getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;b.style.border=1*c+"px solid "+e;a.style.borderRadius=d;a.style.transition="box-shadow 0.25s ease 0s";this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*c+"px")}b.style.borderRadius=
1189
- d;a.appendChild(b);b.value=b.defaultValue=this.getEditorText_(this.value_);b.setAttribute("data-untyped-default-value",this.value_);b.setAttribute("data-old-value","");this.resizeEditor_();this.bindInputEvents_(b);return b}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);setGroup$$module$build$src$core$events$utils(!1);this.unbindInputEvents_();const a=getDiv$$module$build$src$core$widgetdiv().style;a.width="auto";a.height="auto";
1190
- a.fontSize="";a.transition="";a.boxShadow="";this.htmlInput_=null;removeClass$$module$build$src$core$utils$dom(this.getClickTarget_(),"editing")}onFinishEditing_(a){}bindInputEvents_(a){this.onKeyDownWrapper_=conditionalBind$$module$build$src$core$browser_events(a,"keydown",this,this.onHtmlInputKeyDown_);this.onKeyInputWrapper_=conditionalBind$$module$build$src$core$browser_events(a,"input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(unbind$$module$build$src$core$browser_events(this.onKeyDownWrapper_),
1191
- this.onKeyDownWrapper_=null);this.onKeyInputWrapper_&&(unbind$$module$build$src$core$browser_events(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(a){a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.ENTER?(hide$$module$build$src$core$widgetdiv(),hideWithoutAnimation$$module$build$src$core$dropdowndiv()):a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.ESC?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value")),hide$$module$build$src$core$widgetdiv(),
1192
- hideWithoutAnimation$$module$build$src$core$dropdowndiv()):a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.TAB&&(hide$$module$build$src$core$widgetdiv(),hideWithoutAnimation$$module$build$src$core$dropdowndiv(),this.sourceBlock_.tab(this,!a.shiftKey),a.preventDefault())}onHtmlInputChange_(a){a=this.htmlInput_.value;a!==this.htmlInput_.getAttribute("data-old-value")&&(this.htmlInput_.setAttribute("data-old-value",a),a=this.getValueFromEditorText_(a),this.setValue(a),this.forceRerender(),
1193
- this.resizeEditor_())}setEditorValue_(a){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a)}resizeEditor_(){const a=getDiv$$module$build$src$core$widgetdiv();var b=this.getScaledBBox();a.style.width=b.right-b.left+"px";a.style.height=b.bottom-b.top+"px";b=new Coordinate$$module$build$src$core$utils$coordinate(this.sourceBlock_.RTL?b.right-a.offsetWidth:b.left,b.top);a.style.left=b.x+"px";a.style.top=b.y+"px"}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&
1194
- this.htmlInput_?this.htmlInput_.value:null}getEditorText_(a){return String(a)}getValueFromEditorText_(a){return a}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};$.FieldTextInput$$module$build$src$core$field_textinput.BORDERRADIUS=4;register$$module$build$src$core$field_registry("field_input",$.FieldTextInput$$module$build$src$core$field_textinput);$.FieldTextInput$$module$build$src$core$field_textinput.prototype.DEFAULT_VALUE="";
1195
- var module$build$src$core$field_textinput={};module$build$src$core$field_textinput.FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput;var BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row=class extends BottomRow$$module$build$src$core$renderers$measurables$bottom_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){return!!a.outputConnection}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$bottom_row={};module$build$src$core$renderers$zelos$measurables$bottom_row.BottomRow=BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row;var StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs=class extends StatementInput$$module$build$src$core$renderers$measurables$statement_input{constructor(a,b){super(a,b);this.connectedBottomNextConnection=!1;if(this.connectedBlock){for(a=this.connectedBlock;b=a.getNextBlock();)a=b;a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},module$build$src$core$renderers$zelos$measurables$inputs={};
1184
+ void 0!==a.spellcheck&&(this.spellcheck_=a.spellcheck)}initView(){if(this.getConstants().FULL_BLOCK_FIELDS){let a=0,b=0;for(let c=0,d;d=this.getSourceBlock().inputList[c];c++){for(let e=0;d.fieldRow[e];e++)a++;d.connection&&b++}this.fullBlockClickTarget_=1>=a&&this.getSourceBlock().outputConnection&&!b}else this.fullBlockClickTarget_=!1;this.fullBlockClickTarget_?this.clickTarget_=this.sourceBlock_.getSvgRoot():this.createBorderRect_();this.createTextElement_()}doClassValidation_(a){return null===
1185
+ a||void 0===a?null:String(a)}doValueInvalid_(a){this.isBeingEdited_&&(this.isTextValid_=!1,a=this.value_,this.value_=this.htmlInput_.getAttribute("data-untyped-default-value"),this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(CHANGE$$module$build$src$core$events$utils))(this.sourceBlock_,"field",this.name||null,a,this.value_)))}doValueUpdate_(a){this.isTextValid_=!0;this.value_=a;this.isBeingEdited_||
1186
+ (this.isDirty_=!0)}applyColour(){if(this.sourceBlock_&&this.getConstants().FULL_BLOCK_FIELDS){var a=this.sourceBlock_;if(this.borderRect_){if(!a.style.colourTertiary)throw Error("The renderer did not properly initialize the block style");this.borderRect_.setAttribute("stroke",a.style.colourTertiary)}else a.pathObject.svgPath.setAttribute("fill",this.getConstants().FIELD_BORDER_RECT_COLOUR)}}render_(){super.render_();if(this.isBeingEdited_){this.resizeEditor_();const a=this.htmlInput_;this.isTextValid_?
1187
+ (removeClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0))}}setSpellcheck(a){a!==this.spellcheck_&&(this.spellcheck_=a,this.htmlInput_&&this.htmlInput_.setAttribute("spellcheck",this.spellcheck_))}showEditor_(a,b){this.workspace_=
1188
+ this.sourceBlock_.workspace;a=b||!1;!a&&(MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent)?this.showPromptEditor_():this.showInlineEditor_(a)}showPromptEditor_(){prompt$$module$build$src$core$dialog(Msg$$module$build$src$core$msg.CHANGE_VALUE_TITLE,this.getText(),a=>{null!==a&&this.setValue(this.getValueFromEditorText_(a))})}showInlineEditor_(a){show$$module$build$src$core$widgetdiv(this,this.getSourceBlock().RTL,
1189
+ this.widgetDispose_.bind(this));this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){setGroup$$module$build$src$core$events$utils(!0);const a=getDiv$$module$build$src$core$widgetdiv();var b=this.getClickTarget_();if(!b)throw Error("A click target has not been set.");addClass$$module$build$src$core$utils$dom(b,"editing");b=document.createElement("input");b.className="blocklyHtmlInput";b.setAttribute("spellcheck",
1190
+ this.spellcheck_);const c=this.workspace_.getScale();var d=this.getConstants().FIELD_TEXT_FONTSIZE*c+"pt";a.style.fontSize=d;b.style.fontSize=d;d=$.FieldTextInput$$module$build$src$core$field_textinput.BORDERRADIUS*c+"px";if(this.fullBlockClickTarget_){d=this.getScaledBBox();d=(d.bottom-d.top)/2+"px";const e=this.getSourceBlock().getParent()?this.getSourceBlock().getParent().style.colourTertiary:this.sourceBlock_.style.colourTertiary;b.style.border=1*c+"px solid "+e;a.style.borderRadius=d;a.style.transition=
1191
+ "box-shadow 0.25s ease 0s";this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(a.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*c+"px")}b.style.borderRadius=d;a.appendChild(b);b.value=b.defaultValue=this.getEditorText_(this.value_);b.setAttribute("data-untyped-default-value",this.value_);b.setAttribute("data-old-value","");this.resizeEditor_();this.bindInputEvents_(b);return b}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);setGroup$$module$build$src$core$events$utils(!1);
1192
+ this.unbindInputEvents_();var a=getDiv$$module$build$src$core$widgetdiv().style;a.width="auto";a.height="auto";a.fontSize="";a.transition="";a.boxShadow="";this.htmlInput_=null;a=this.getClickTarget_();if(!a)throw Error("A click target has not been set.");removeClass$$module$build$src$core$utils$dom(a,"editing")}onFinishEditing_(a){}bindInputEvents_(a){this.onKeyDownWrapper_=conditionalBind$$module$build$src$core$browser_events(a,"keydown",this,this.onHtmlInputKeyDown_);this.onKeyInputWrapper_=conditionalBind$$module$build$src$core$browser_events(a,
1193
+ "input",this,this.onHtmlInputChange_)}unbindInputEvents_(){this.onKeyDownWrapper_&&(unbind$$module$build$src$core$browser_events(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null);this.onKeyInputWrapper_&&(unbind$$module$build$src$core$browser_events(this.onKeyInputWrapper_),this.onKeyInputWrapper_=null)}onHtmlInputKeyDown_(a){a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.ENTER?(hide$$module$build$src$core$widgetdiv(),hideWithoutAnimation$$module$build$src$core$dropdowndiv()):a.keyCode===
1194
+ KeyCodes$$module$build$src$core$utils$keycodes.ESC?(this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value")),hide$$module$build$src$core$widgetdiv(),hideWithoutAnimation$$module$build$src$core$dropdowndiv()):a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.TAB&&(hide$$module$build$src$core$widgetdiv(),hideWithoutAnimation$$module$build$src$core$dropdowndiv(),this.sourceBlock_.tab(this,!a.shiftKey),a.preventDefault())}onHtmlInputChange_(a){a=this.htmlInput_.value;a!==this.htmlInput_.getAttribute("data-old-value")&&
1195
+ (this.htmlInput_.setAttribute("data-old-value",a),a=this.getValueFromEditorText_(a),this.setValue(a),this.forceRerender(),this.resizeEditor_())}setEditorValue_(a){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a)}resizeEditor_(){const a=getDiv$$module$build$src$core$widgetdiv();var b=this.getScaledBBox();a.style.width=b.right-b.left+"px";a.style.height=b.bottom-b.top+"px";const c=this.getSourceBlock().RTL?b.right-a.offsetWidth:b.left;b=new Coordinate$$module$build$src$core$utils$coordinate(c,
1196
+ b.top);a.style.left=b.x+"px";a.style.top=b.y+"px"}isTabNavigable(){return!0}getText_(){return this.isBeingEdited_&&this.htmlInput_?this.htmlInput_.value:null}getEditorText_(a){return String(a)}getValueFromEditorText_(a){return a}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};$.FieldTextInput$$module$build$src$core$field_textinput.BORDERRADIUS=4;register$$module$build$src$core$field_registry("field_input",$.FieldTextInput$$module$build$src$core$field_textinput);
1197
+ $.FieldTextInput$$module$build$src$core$field_textinput.prototype.DEFAULT_VALUE="";var module$build$src$core$field_textinput={};module$build$src$core$field_textinput.FieldTextInput=$.FieldTextInput$$module$build$src$core$field_textinput;var BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row=class extends BottomRow$$module$build$src$core$renderers$measurables$bottom_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){return!!a.outputConnection}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$bottom_row={};module$build$src$core$renderers$zelos$measurables$bottom_row.BottomRow=BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row;var StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs=class extends StatementInput$$module$build$src$core$renderers$measurables$statement_input{constructor(a,b){super(a,b);this.connectedBottomNextConnection=!1;if(this.connectedBlock){for(a=this.connectedBlock;b=a.getNextBlock();)a=b;a.nextConnection||(this.height=this.connectedBlockHeight,this.connectedBottomNextConnection=!0)}}},module$build$src$core$renderers$zelos$measurables$inputs={};
1196
1198
  module$build$src$core$renderers$zelos$measurables$inputs.StatementInput=StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs;var RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements=class extends Measurable$$module$build$src$core$renderers$measurables$base{constructor(a){super(a);this.width=this.height=0;this.type|=Types$$module$build$src$core$renderers$measurables$types.getType("RIGHT_CONNECTION")}},module$build$src$core$renderers$zelos$measurables$row_elements={};module$build$src$core$renderers$zelos$measurables$row_elements.RightConnectionShape=RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements;var TopRow$$module$build$src$core$renderers$zelos$measurables$top_row=class extends TopRow$$module$build$src$core$renderers$measurables$top_row{constructor(a){super(a)}endsWithElemSpacer(){return!1}hasLeftSquareCorner(a){const b=(a.hat?"cap"===a.hat:this.constants_.ADD_START_HATS)&&!a.outputConnection&&!a.previousConnection;return!!a.outputConnection||b}hasRightSquareCorner(a){return!!a.outputConnection&&!a.statementInputCount&&!a.nextConnection}},module$build$src$core$renderers$zelos$measurables$top_row=
1197
1199
  {};module$build$src$core$renderers$zelos$measurables$top_row.TopRow=TopRow$$module$build$src$core$renderers$zelos$measurables$top_row;var RenderInfo$$module$build$src$core$renderers$zelos$info=class extends RenderInfo$$module$build$src$core$renderers$common$info{constructor(a,b){super(a,b);this.isInline=!0;this.renderer_=a;this.constants_=this.renderer_.getConstants();this.topRow=new TopRow$$module$build$src$core$renderers$zelos$measurables$top_row(this.constants_);this.bottomRow=new BottomRow$$module$build$src$core$renderers$zelos$measurables$bottom_row(this.constants_);this.isMultiRow=!b.getInputsInline()||b.isCollapsed();this.hasStatementInput=
1198
1200
  0<b.statementInputCount;this.rightSide=this.outputConnection?new RightConnectionShape$$module$build$src$core$renderers$zelos$measurables$row_elements(this.constants_):null;this.rightAlignedDummyInputs_=new WeakMap}getRenderer(){return this.renderer_}measure(){this.createRows_();this.addElemSpacing_();this.addRowSpacing_();this.adjustXPosition_();this.computeBounds_();this.alignRowElements_();this.finalize_()}shouldStartNewRow_(a,b){return b?a.type===inputTypes$$module$build$src$core$input_types.STATEMENT||
@@ -1371,11 +1373,11 @@ getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(b=b.x||b.y){con
1371
1373
  90+b&&a>90-b||a>-90-b&&a<-90+b?!0:!1}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const a=this.svgGroup_.getBoundingClientRect(),b=a.top;return this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.TOP?new Rect$$module$build$src$core$utils$rect(-1E9,b+a.height,-1E9,1E9):new Rect$$module$build$src$core$utils$rect(b,1E9,-1E9,1E9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale();let a=0;const b=this.workspace_.getTopBlocks(!1);for(let d=
1372
1374
  0,e;e=b[d];d++)a=Math.max(a,e.getHeightWidth().height);const c=this.buttons_;for(let d=0,e;e=c[d];d++)a=Math.max(a,e.height);a+=1.5*this.MARGIN;a*=this.workspace_.scale;a+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness;if(this.height_!==a){for(let d=0,e;e=b[d];d++)this.rectMap_.has(e)&&this.moveRectToBlock_(this.rectMap_.get(e),e);this.targetWorkspace.toolboxPosition!==this.toolboxPosition_||this.toolboxPosition_!==Position$$module$build$src$core$utils$toolbox.TOP||this.targetWorkspace.getToolbox()||
1373
1375
  this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+a);this.height_=a;this.position();this.targetWorkspace.recordDragTargets()}}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,DEFAULT$$module$build$src$core$registry,HorizontalFlyout$$module$build$src$core$flyout_horizontal);var module$build$src$core$flyout_horizontal={};module$build$src$core$flyout_horizontal.HorizontalFlyout=HorizontalFlyout$$module$build$src$core$flyout_horizontal;var FieldVariable$$module$build$src$core$field_variable=class extends FieldDropdown$$module$build$src$core$field_dropdown{constructor(a,b,c,d,e){super(Field$$module$build$src$core$field.SKIP_SETUP);this.defaultType_="";this.variableTypes=[];this.variable_=null;this.SERIALIZABLE=!0;this.menuGenerator_=FieldVariable$$module$build$src$core$field_variable.dropdownCreate;this.defaultVariableName="string"===typeof a?a:"";this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&&
1374
- (e?this.configure_(e):this.setTypes_(c,d),b&&this.setValidator(b))}configure_(a){super.configure_(a);this.setTypes_(a.variableTypes,a.defaultType)}initModel(){if(!this.variable_){var a=getOrCreateVariablePackage$$module$build$src$core$variables(this.sourceBlock_.workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(a.getId())}}shouldAddBorderRect_(){return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!==this.sourceBlock_.type)}fromXml(a){var b=
1375
- a.getAttribute("id");const c=a.textContent,d=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=getOrCreateVariablePackage$$module$build$src$core$variables(this.sourceBlock_.workspace,b,c,d);if(null!==d&&d!==b.type)throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.type+", and does not match variable field that references it: "+domToText$$module$build$src$core$xml(a)+".");this.setValue(b.getId())}toXml(a){this.initModel();a.id=this.variable_.getId();a.textContent=
1376
- this.variable_.name;this.variable_.type&&a.setAttribute("variabletype",this.variable_.type);return a}saveState(a){var b=this.saveLegacyState(FieldVariable$$module$build$src$core$field_variable);if(null!==b)return b;this.initModel();b={id:this.variable_.getId()};a&&(b.name=this.variable_.name,b.type=this.variable_.type);return b}loadState(a){this.loadLegacyState(FieldVariable$$module$build$src$core$field_variable,a)||(a=getOrCreateVariablePackage$$module$build$src$core$variables(this.sourceBlock_.workspace,
1377
- a.id||null,a.name,a.type||""),this.setValue(a.getId()))}setSourceBlock(a){if(a.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(a)}getValue(){return this.variable_?this.variable_.getId():null}getText(){return this.variable_?this.variable_.name:""}getVariable(){return this.variable_}getValidator(){return this.variable_?this.validator_:null}doClassValidation_(a){if(null===a)return null;var b=getVariable$$module$build$src$core$variables(this.sourceBlock_.workspace,
1378
- a);if(!b)return console.warn("Variable id doesn't point to a real variable! ID was "+a),null;b=b.type;return this.typeIsAllowed_(b)?a:(console.warn("Variable type doesn't match this field! Type was "+b),null)}doValueUpdate_(a){this.variable_=getVariable$$module$build$src$core$variables(this.sourceBlock_.workspace,a);super.doValueUpdate_(a)}typeIsAllowed_(a){const b=this.getVariableTypes_();if(!b)return!0;for(let c=0;c<b.length;c++)if(a===b[c])return!0;return!1}getVariableTypes_(){var a=this.variableTypes;
1376
+ (e?this.configure_(e):this.setTypes_(c,d),b&&this.setValidator(b))}configure_(a){super.configure_(a);this.setTypes_(a.variableTypes,a.defaultType)}initModel(){if(!this.variable_){var a=getOrCreateVariablePackage$$module$build$src$core$variables(this.getSourceBlock().workspace,null,this.defaultVariableName,this.defaultType_);this.doValueUpdate_(a.getId())}}shouldAddBorderRect_(){return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||"variables_get"!==this.getSourceBlock().type)}fromXml(a){var b=
1377
+ a.getAttribute("id");const c=a.textContent,d=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=getOrCreateVariablePackage$$module$build$src$core$variables(this.getSourceBlock().workspace,b,c,d);if(null!==d&&d!==b.type)throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.type+", and does not match variable field that references it: "+domToText$$module$build$src$core$xml(a)+".");this.setValue(b.getId())}toXml(a){this.initModel();a.id=this.variable_.getId();a.textContent=
1378
+ this.variable_.name;this.variable_.type&&a.setAttribute("variabletype",this.variable_.type);return a}saveState(a){var b=this.saveLegacyState(FieldVariable$$module$build$src$core$field_variable);if(null!==b)return b;this.initModel();b={id:this.variable_.getId()};a&&(b.name=this.variable_.name,b.type=this.variable_.type);return b}loadState(a){this.loadLegacyState(FieldVariable$$module$build$src$core$field_variable,a)||(a=getOrCreateVariablePackage$$module$build$src$core$variables(this.getSourceBlock().workspace,
1379
+ a.id||null,a.name,a.type||""),this.setValue(a.getId()))}setSourceBlock(a){if(a.isShadow())throw Error("Variable fields are not allowed to exist on shadow blocks.");super.setSourceBlock(a)}getValue(){return this.variable_?this.variable_.getId():null}getText(){return this.variable_?this.variable_.name:""}getVariable(){return this.variable_}getValidator(){return this.variable_?this.validator_:null}doClassValidation_(a){if(null===a)return null;var b=getVariable$$module$build$src$core$variables(this.getSourceBlock().workspace,
1380
+ a);if(!b)return console.warn("Variable id doesn't point to a real variable! ID was "+a),null;b=b.type;return this.typeIsAllowed_(b)?a:(console.warn("Variable type doesn't match this field! Type was "+b),null)}doValueUpdate_(a){this.variable_=getVariable$$module$build$src$core$variables(this.getSourceBlock().workspace,a);super.doValueUpdate_(a)}typeIsAllowed_(a){const b=this.getVariableTypes_();if(!b)return!0;for(let c=0;c<b.length;c++)if(a===b[c])return!0;return!1}getVariableTypes_(){var a=this.variableTypes;
1379
1381
  if(null===a&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying())return this.sourceBlock_.workspace.getVariableTypes();a=a||[""];if(0===a.length)throw a=this.getText(),Error("'variableTypes' of field variable "+a+" was an empty list");return a}setTypes_(a,b){b=b||"";if(null===a||void 0===a)a=null;else if(Array.isArray(a)){let c=!1;for(let d=0;d<a.length;d++)a[d]===b&&(c=!0);if(!c)throw Error("Invalid default type '"+b+"' in the definition of a FieldVariable");}else throw Error("'variableTypes' was not an array in the definition of a FieldVariable");
1380
1382
  this.defaultType_=b;this.variableTypes=a}refreshVariableName(){this.forceRerender()}onItemSelected_(a,b){a=b.getValue();if(this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()){if(a===RENAME_VARIABLE_ID$$module$build$src$core$internal_constants){renameVariable$$module$build$src$core$variables(this.sourceBlock_.workspace,this.variable_);return}if(a===DELETE_VARIABLE_ID$$module$build$src$core$internal_constants){this.sourceBlock_.workspace.deleteVariableById(this.variable_.getId());return}}this.setValue(a)}referencesVariables(){return!0}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.variable),
1381
1383
  void 0,void 0,void 0,a)}static dropdownCreate(){if(!this.variable_)throw Error("Tried to call dropdownCreate on a variable field with no variable selected.");const a=this.getText();let b=[];if(this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()){var c=this.getVariableTypes_();for(var d=0;d<c.length;d++){const e=this.sourceBlock_.workspace.getVariablesOfType(c[d]);b=b.concat(e)}}b.sort(VariableModel$$module$build$src$core$variable_model.compareByName);c=[];for(d=0;d<b.length;d++)c[d]=[b[d].name,
@@ -1386,9 +1388,9 @@ this.setMaxInternal_(a.max);this.setPrecisionInternal_(a.precision)}setConstrain
1386
1388
  "");a=a.replace(/infinity/i,"Infinity");a=Number(a||0);if(isNaN(a))return null;a=Math.min(Math.max(a,this.min_),this.max_);this.precision_&&isFinite(a)&&(a=Math.round(a/this.precision_)*this.precision_);null!==this.decimalPlaces_&&(a=Number(a.toFixed(this.decimalPlaces_)));return a}widgetCreate_(){const a=super.widgetCreate_();-Infinity<this.min_&&setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.VALUEMIN,this.min_);Infinity>this.max_&&setState$$module$build$src$core$utils$aria(a,
1387
1389
  State$$module$build$src$core$utils$aria.VALUEMAX,this.max_);return a}static fromJson(a){return new this(a.value,void 0,void 0,void 0,void 0,a)}};register$$module$build$src$core$field_registry("field_number",FieldNumber$$module$build$src$core$field_number);FieldNumber$$module$build$src$core$field_number.prototype.DEFAULT_VALUE=0;var module$build$src$core$field_number={};module$build$src$core$field_number.FieldNumber=FieldNumber$$module$build$src$core$field_number;var FieldMultilineInput$$module$build$src$core$field_multilineinput=class extends $.FieldTextInput$$module$build$src$core$field_textinput{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.textGroup_=null;this.maxLines_=Infinity;this.isOverflowedY_=!1;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.maxLines&&this.setMaxLines(a.maxLines)}toXml(a){a.textContent=this.getValue().replace(/\n/g,
1388
1390
  "&#10;");return a}fromXml(a){this.setValue(a.textContent.replace(/&#10;/g,"\n"))}saveState(){const a=this.saveLegacyState(FieldMultilineInput$$module$build$src$core$field_multilineinput);return null!==a?a:this.getValue()}loadState(a){this.loadLegacyState(Field$$module$build$src$core$field,a)||this.setValue(a)}initView(){this.createBorderRect_();this.textGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyEditableText"},this.fieldGroup_)}getDisplayText_(){let a=
1389
- this.getText();if(!a)return Field$$module$build$src$core$field.NBSP;const b=a.split("\n");a="";const c=this.isOverflowedY_?this.maxLines_:b.length;for(let d=0;d<c;d++){let e=b[d];e.length>this.maxDisplayLength?e=e.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&d===c-1&&(e=e.substring(0,e.length-3)+"...");e=e.replace(/\s/g,Field$$module$build$src$core$field.NBSP);a+=e;d!==c-1&&(a+="\n")}this.sourceBlock_.RTL&&(a+="\u200f");return a}doValueUpdate_(a){super.doValueUpdate_(a);this.isOverflowedY_=
1391
+ this.getText();if(!a)return Field$$module$build$src$core$field.NBSP;const b=a.split("\n");a="";const c=this.isOverflowedY_?this.maxLines_:b.length;for(let d=0;d<c;d++){let e=b[d];e.length>this.maxDisplayLength?e=e.substring(0,this.maxDisplayLength-4)+"...":this.isOverflowedY_&&d===c-1&&(e=e.substring(0,e.length-3)+"...");e=e.replace(/\s/g,Field$$module$build$src$core$field.NBSP);a+=e;d!==c-1&&(a+="\n")}this.getSourceBlock().RTL&&(a+="\u200f");return a}doValueUpdate_(a){super.doValueUpdate_(a);this.isOverflowedY_=
1390
1392
  this.value_.split("\n").length>this.maxLines_}render_(){for(var a;a=this.textGroup_.firstChild;)this.textGroup_.removeChild(a);a=this.getDisplayText_().split("\n");let b=0;for(let c=0;c<a.length;c++){const d=this.getConstants().FIELD_TEXT_HEIGHT+this.getConstants().FIELD_BORDER_RECT_Y_PADDING;createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText blocklyMultilineText",x:this.getConstants().FIELD_BORDER_RECT_X_PADDING,y:b+this.getConstants().FIELD_BORDER_RECT_Y_PADDING,
1391
- dy:this.getConstants().FIELD_TEXT_BASELINE},this.textGroup_).appendChild(document.createTextNode(a[c]));b+=d}this.isBeingEdited_&&(a=this.htmlInput_,this.isOverflowedY_?addClass$$module$build$src$core$utils$dom(a,"blocklyHtmlTextAreaInputOverflowedY"):removeClass$$module$build$src$core$utils$dom(a,"blocklyHtmlTextAreaInputOverflowedY"));this.updateSize_();this.isBeingEdited_&&(this.sourceBlock_.RTL?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),a=this.htmlInput_,this.isTextValid_?
1393
+ dy:this.getConstants().FIELD_TEXT_BASELINE},this.textGroup_).appendChild(document.createTextNode(a[c]));b+=d}this.isBeingEdited_&&(a=this.htmlInput_,this.isOverflowedY_?addClass$$module$build$src$core$utils$dom(a,"blocklyHtmlTextAreaInputOverflowedY"):removeClass$$module$build$src$core$utils$dom(a,"blocklyHtmlTextAreaInputOverflowedY"));this.updateSize_();this.isBeingEdited_&&(this.getSourceBlock().RTL?setTimeout(this.resizeEditor_.bind(this),0):this.resizeEditor_(),a=this.htmlInput_,this.isTextValid_?
1392
1394
  (removeClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!1)):(addClass$$module$build$src$core$utils$dom(a,"blocklyInvalidInput"),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.INVALID,!0)))}updateSize_(){var a=this.textGroup_.childNodes;let b=0,c=0;for(var d=0;d<a.length;d++){var e=getTextWidth$$module$build$src$core$utils$dom(a[d]);e>b&&(b=e);c+=this.getConstants().FIELD_TEXT_HEIGHT+
1393
1395
  (0<d?this.getConstants().FIELD_BORDER_RECT_Y_PADDING:0)}if(this.isBeingEdited_){a=this.value_.split("\n");d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{"class":"blocklyText blocklyMultilineText"});e=this.getConstants().FIELD_TEXT_FONTSIZE;const f=this.getConstants().FIELD_TEXT_FONTWEIGHT,g=this.getConstants().FIELD_TEXT_FONTFAMILY;for(let h=0;h<a.length;h++){a[h].length>this.maxDisplayLength&&(a[h]=a[h].substring(0,this.maxDisplayLength));d.textContent=
1394
1396
  a[h];const k=getFastTextWidth$$module$build$src$core$utils$dom(d,e,f,g);k>b&&(b=k)}b+=this.htmlInput_.offsetWidth-this.htmlInput_.clientWidth}this.borderRect_&&(c+=2*this.getConstants().FIELD_BORDER_RECT_Y_PADDING,b+=2*this.getConstants().FIELD_BORDER_RECT_X_PADDING,this.borderRect_.setAttribute("width",b),this.borderRect_.setAttribute("height",c));this.size_.width=b;this.size_.height=c;this.positionBorderRect_()}showEditor_(a,b){super.showEditor_(a,b);this.forceRerender()}widgetCreate_(){const a=
@@ -1398,7 +1400,7 @@ typeof a&&0<a&&a!==this.maxLines_&&(this.maxLines_=a,this.forceRerender())}getMa
1398
1400
  register$$module$build$src$core$field_registry("field_multilinetext",FieldMultilineInput$$module$build$src$core$field_multilineinput);var module$build$src$core$field_multilineinput={};module$build$src$core$field_multilineinput.FieldMultilineInput=FieldMultilineInput$$module$build$src$core$field_multilineinput;var FieldLabelSerializable$$module$build$src$core$field_label_serializable=class extends $.FieldLabel$$module$build$src$core$field_label{constructor(a,b,c){super(String(null!=a?a:""),b,c);this.EDITABLE=!1;this.SERIALIZABLE=!0}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};register$$module$build$src$core$field_registry("field_label_serializable",FieldLabelSerializable$$module$build$src$core$field_label_serializable);
1399
1401
  var module$build$src$core$field_label_serializable={};module$build$src$core$field_label_serializable.FieldLabelSerializable=FieldLabelSerializable$$module$build$src$core$field_label_serializable;var FieldColour$$module$build$src$core$field_colour=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.onKeyDownWrapper_=this.onMouseLeaveWrapper_=this.onMouseEnterWrapper_=this.onMouseMoveWrapper_=this.onClickWrapper_=this.highlightedIndex_=this.picker_=null;this.SERIALIZABLE=!0;this.CURSOR="default";this.isDirty_=!1;this.titles_=this.colours_=null;this.columns_=0;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),
1400
1402
  this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.colourOptions&&(this.colours_=a.colourOptions);a.colourTitles&&(this.titles_=a.colourTitles);a.columns&&(this.columns_=a.columns)}initView(){this.size_=new Size$$module$build$src$core$utils$size(this.getConstants().FIELD_COLOUR_DEFAULT_WIDTH,this.getConstants().FIELD_COLOUR_DEFAULT_HEIGHT);this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof BlockSvg$$module$build$src$core$block_svg&&(this.clickTarget_=
1401
- this.sourceBlock_.getSvgRoot()):(this.createBorderRect_(),this.borderRect_.style.fillOpacity="1")}applyColour(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof BlockSvg$$module$build$src$core$block_svg&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())}doClassValidation_(a){return"string"!==typeof a?null:parse$$module$build$src$core$utils$colour(a)}doValueUpdate_(a){this.value_=
1403
+ this.sourceBlock_.getSvgRoot()):(this.createBorderRect_(),this.getBorderRect().style.fillOpacity="1")}applyColour(){this.getConstants().FIELD_COLOUR_FULL_BLOCK?this.sourceBlock_ instanceof BlockSvg$$module$build$src$core$block_svg&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",this.getValue()),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff")):this.borderRect_&&(this.borderRect_.style.fill=this.getValue())}doClassValidation_(a){return"string"!==typeof a?null:parse$$module$build$src$core$utils$colour(a)}doValueUpdate_(a){this.value_=
1402
1404
  a;this.borderRect_?this.borderRect_.style.fill=a:this.sourceBlock_&&this.sourceBlock_.rendered&&this.sourceBlock_ instanceof BlockSvg$$module$build$src$core$block_svg&&(this.sourceBlock_.pathObject.svgPath.setAttribute("fill",a),this.sourceBlock_.pathObject.svgPath.setAttribute("stroke","#fff"))}getText(){let a=this.value_;/^#(.)\1(.)\2(.)\3$/.test(a)&&(a="#"+a[1]+a[3]+a[5]);return a}setColours(a,b){this.colours_=a;b&&(this.titles_=b);return this}setColumns(a){this.columns_=a;return this}showEditor_(){this.dropdownCreate_();
1403
1405
  getContentDiv$$module$build$src$core$dropdowndiv().appendChild(this.picker_);showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this));this.picker_.focus({preventScroll:!0})}onClick_(a){a=(a=a.target)&&a.getAttribute("data-colour");null!==a&&(this.setValue(a),hideIfOwner$$module$build$src$core$dropdowndiv(this))}onKeyDown_(a){var b=!1;if(a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.UP)this.moveHighlightBy_(0,-1),b=!0;else if(a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.DOWN)this.moveHighlightBy_(0,
1404
1406
  1),b=!0;else if(a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.LEFT)this.moveHighlightBy_(-1,0),b=!0;else if(a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.RIGHT)this.moveHighlightBy_(1,0),b=!0;else if(a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.ENTER){if(b=this.getHighlighted_())b=b&&b.getAttribute("data-colour"),null!==b&&this.setValue(b);hideWithoutAnimation$$module$build$src$core$dropdowndiv();b=!0}b&&a.stopPropagation()}moveHighlightBy_(a,b){if(this.highlightedIndex_){var c=
@@ -1413,11 +1415,11 @@ g);setRole$$module$build$src$core$utils$aria(h,Role$$module$build$src$core$utils
1413
1415
  (unbind$$module$build$src$core$browser_events(this.onKeyDownWrapper_),this.onKeyDownWrapper_=null);this.highlightedIndex_=this.picker_=null}static fromJson(a){return new this(a.colour,void 0,a)}};FieldColour$$module$build$src$core$field_colour.COLOURS="#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033".split(" ");
1414
1416
  FieldColour$$module$build$src$core$field_colour.TITLES=[];FieldColour$$module$build$src$core$field_colour.COLUMNS=7;FieldColour$$module$build$src$core$field_colour.prototype.DEFAULT_VALUE=FieldColour$$module$build$src$core$field_colour.COLOURS[0];register$$module$build$src$core$css("\n.blocklyColourTable {\n border-collapse: collapse;\n display: block;\n outline: none;\n padding: 1px;\n}\n\n.blocklyColourTable>tr>td {\n border: .5px solid #888;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n height: 20px;\n padding: 0;\n width: 20px;\n}\n\n.blocklyColourTable>tr>td.blocklyColourHighlighted {\n border-color: #eee;\n box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);\n position: relative;\n}\n\n.blocklyColourSelected, .blocklyColourSelected:hover {\n border-color: #eee !important;\n outline: 1px solid #333;\n position: relative;\n}\n");
1415
1417
  register$$module$build$src$core$field_registry("field_colour",FieldColour$$module$build$src$core$field_colour);var module$build$src$core$field_colour={};module$build$src$core$field_colour.FieldColour=FieldColour$$module$build$src$core$field_colour;$.FieldCheckbox$$module$build$src$core$field_checkbox=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.SERIALIZABLE=!0;this.CURSOR="default";this.checkChar_=$.FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);a.checkCharacter&&(this.checkChar_=a.checkCharacter)}saveState(){const a=
1416
- this.saveLegacyState($.FieldCheckbox$$module$build$src$core$field_checkbox);return null!==a?a:this.getValueBoolean()}initView(){super.initView();addClass$$module$build$src$core$utils$dom(this.textElement_,"blocklyCheckbox");this.textElement_.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar_}setCheckCharacter(a){this.checkChar_=
1418
+ this.saveLegacyState($.FieldCheckbox$$module$build$src$core$field_checkbox);return null!==a?a:this.getValueBoolean()}initView(){super.initView();const a=this.getTextElement();addClass$$module$build$src$core$utils$dom(a,"blocklyCheckbox");a.style.display=this.value_?"block":"none"}render_(){this.textContent_&&(this.textContent_.nodeValue=this.getDisplayText_());this.updateSize_(this.getConstants().FIELD_CHECKBOX_X_OFFSET)}getDisplayText_(){return this.checkChar_}setCheckCharacter(a){this.checkChar_=
1417
1419
  a||$.FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR;this.forceRerender()}showEditor_(){this.setValue(!this.value_)}doClassValidation_(a){return!0===a||"TRUE"===a?"TRUE":!1===a||"FALSE"===a?"FALSE":null}doValueUpdate_(a){this.value_=this.convertValueToBool_(a);this.textElement_&&(this.textElement_.style.display=this.value_?"block":"none")}getValue(){return this.value_?"TRUE":"FALSE"}getValueBoolean(){return this.value_}getText(){return String(this.convertValueToBool_(this.value_))}convertValueToBool_(a){return"string"===
1418
1420
  typeof a?"TRUE"===a:!!a}static fromJson(a){return new this(a.checked,void 0,a)}};$.FieldCheckbox$$module$build$src$core$field_checkbox.CHECK_CHAR="\u2713";register$$module$build$src$core$field_registry("field_checkbox",$.FieldCheckbox$$module$build$src$core$field_checkbox);$.FieldCheckbox$$module$build$src$core$field_checkbox.prototype.DEFAULT_VALUE=!1;var module$build$src$core$field_checkbox={};module$build$src$core$field_checkbox.FieldCheckbox=$.FieldCheckbox$$module$build$src$core$field_checkbox;var FieldAngle$$module$build$src$core$field_angle=class extends $.FieldTextInput$$module$build$src$core$field_textinput{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.moveSurfaceWrapper_=this.clickSurfaceWrapper_=this.clickWrapper_=this.symbol_=this.line_=this.gauge_=this.editor_=null;this.SERIALIZABLE=!0;this.clockwise_=FieldAngle$$module$build$src$core$field_angle.CLOCKWISE;this.offset_=FieldAngle$$module$build$src$core$field_angle.OFFSET;this.wrap_=FieldAngle$$module$build$src$core$field_angle.WRAP;
1419
1421
  this.round_=FieldAngle$$module$build$src$core$field_angle.ROUND;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c&&this.configure_(c),this.setValue(a),b&&this.setValidator(b))}configure_(a){super.configure_(a);switch(a.mode){case Mode$$module$build$src$core$field_angle.COMPASS:this.clockwise_=!0;this.offset_=90;break;case Mode$$module$build$src$core$field_angle.PROTRACTOR:this.clockwise_=!1,this.offset_=0}a.clockwise&&(this.clockwise_=a.clockwise);a.offset&&(this.offset_=a.offset);a.wrap&&(this.wrap_=
1420
- a.wrap);a.round&&(this.round_=a.round)}initView(){super.initView();this.symbol_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{});this.symbol_.appendChild(document.createTextNode("\u00b0"));this.textElement_.appendChild(this.symbol_)}render_(){super.render_();this.updateGraph_()}showEditor_(a){super.showEditor_(a,MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent);
1422
+ a.wrap);a.round&&(this.round_=a.round)}initView(){super.initView();this.symbol_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{});this.symbol_.appendChild(document.createTextNode("\u00b0"));this.getTextElement().appendChild(this.symbol_)}render_(){super.render_();this.updateGraph_()}showEditor_(a){super.showEditor_(a,MOBILE$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent||IPAD$$module$build$src$core$utils$useragent);
1421
1423
  this.dropdownCreate_();getContentDiv$$module$build$src$core$dropdowndiv().appendChild(this.editor_);if(this.sourceBlock_ instanceof BlockSvg$$module$build$src$core$block_svg){if(!this.sourceBlock_.style.colourTertiary)throw Error("The renderer did not properly initialize the block style");setColour$$module$build$src$core$dropdowndiv(this.sourceBlock_.style.colourPrimary,this.sourceBlock_.style.colourTertiary)}showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this));
1422
1424
  this.updateGraph_()}dropdownCreate_(){const a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{xmlns:SVG_NS$$module$build$src$core$utils$dom,"xmlns:html":HTML_NS$$module$build$src$core$utils$dom,"xmlns:xlink":XLINK_NS$$module$build$src$core$utils$dom,version:"1.1",height:2*FieldAngle$$module$build$src$core$field_angle.HALF+"px",width:2*FieldAngle$$module$build$src$core$field_angle.HALF+"px",style:"touch-action: none"}),b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,
1423
1425
  {cx:FieldAngle$$module$build$src$core$field_angle.HALF,cy:FieldAngle$$module$build$src$core$field_angle.HALF,r:FieldAngle$$module$build$src$core$field_angle.RADIUS,"class":"blocklyAngleCircle"},a);this.gauge_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyAngleGauge"},a);this.line_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{x1:FieldAngle$$module$build$src$core$field_angle.HALF,y1:FieldAngle$$module$build$src$core$field_angle.HALF,
@@ -1427,7 +1429,7 @@ transform:"rotate("+c+","+FieldAngle$$module$build$src$core$field_angle.HALF+","
1427
1429
  this.gauge_.ownerSVGElement.getBoundingClientRect();const c=a.clientX-b.left-FieldAngle$$module$build$src$core$field_angle.HALF;a=a.clientY-b.top-FieldAngle$$module$build$src$core$field_angle.HALF;b=Math.atan(-a/c);isNaN(b)||(b=toDegrees$$module$build$src$core$utils$math(b),0>c?b+=180:0<a&&(b+=360),b=this.clockwise_?this.offset_+360-b:360-(this.offset_-b),this.displayMouseOrKeyboardValue_(b))}displayMouseOrKeyboardValue_(a){this.round_&&(a=Math.round(a/this.round_)*this.round_);a=this.wrapValue_(a);
1428
1430
  a!==this.value_&&this.setEditorValue_(a)}updateGraph_(){if(this.gauge_){var a=Number(this.getText())+this.offset_,b=toRadians$$module$build$src$core$utils$math(a%360);a=["M ",FieldAngle$$module$build$src$core$field_angle.HALF,",",FieldAngle$$module$build$src$core$field_angle.HALF];var c=FieldAngle$$module$build$src$core$field_angle.HALF,d=FieldAngle$$module$build$src$core$field_angle.HALF;if(!isNaN(b)){const e=Number(this.clockwise_),f=toRadians$$module$build$src$core$utils$math(this.offset_),g=Math.cos(f)*
1429
1431
  FieldAngle$$module$build$src$core$field_angle.RADIUS,h=Math.sin(f)*-FieldAngle$$module$build$src$core$field_angle.RADIUS;e&&(b=2*f-b);c+=Math.cos(b)*FieldAngle$$module$build$src$core$field_angle.RADIUS;d-=Math.sin(b)*FieldAngle$$module$build$src$core$field_angle.RADIUS;b=Math.abs(Math.floor((b-f)/Math.PI)%2);e&&(b=1-b);a.push(" l ",g,",",h," A ",FieldAngle$$module$build$src$core$field_angle.RADIUS,",",FieldAngle$$module$build$src$core$field_angle.RADIUS," 0 ",b," ",e," ",c,",",d," z")}this.gauge_.setAttribute("d",
1430
- a.join(""));this.line_.setAttribute("x2",c);this.line_.setAttribute("y2",d)}}onHtmlInputKeyDown_(a){super.onHtmlInputKeyDown_(a);let b;a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.LEFT?b=this.sourceBlock_.RTL?1:-1:a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.RIGHT?b=this.sourceBlock_.RTL?-1:1:a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.DOWN?b=-1:a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.UP&&(b=1);if(b){const c=this.getValue();this.displayMouseOrKeyboardValue_(c+
1432
+ a.join(""));this.line_.setAttribute("x2",c);this.line_.setAttribute("y2",d)}}onHtmlInputKeyDown_(a){super.onHtmlInputKeyDown_(a);let b;a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.LEFT?b=this.getSourceBlock().RTL?1:-1:a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.RIGHT?b=this.getSourceBlock().RTL?-1:1:a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.DOWN?b=-1:a.keyCode===KeyCodes$$module$build$src$core$utils$keycodes.UP&&(b=1);if(b){const c=this.getValue();this.displayMouseOrKeyboardValue_(c+
1431
1433
  b*this.round_);a.preventDefault();a.stopPropagation()}}doClassValidation_(a){a=Number(a);return isNaN(a)||!isFinite(a)?null:this.wrapValue_(a)}wrapValue_(a){a%=360;0>a&&(a+=360);a>this.wrap_&&(a-=360);return a}static fromJson(a){return new this(a.angle,void 0,a)}};FieldAngle$$module$build$src$core$field_angle.ROUND=15;FieldAngle$$module$build$src$core$field_angle.HALF=50;FieldAngle$$module$build$src$core$field_angle.CLOCKWISE=!1;FieldAngle$$module$build$src$core$field_angle.OFFSET=0;
1432
1434
  FieldAngle$$module$build$src$core$field_angle.WRAP=360;FieldAngle$$module$build$src$core$field_angle.RADIUS=FieldAngle$$module$build$src$core$field_angle.HALF-1;register$$module$build$src$core$css("\n.blocklyAngleCircle {\n stroke: #444;\n stroke-width: 1;\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyAngleMarks {\n stroke: #444;\n stroke-width: 1;\n}\n\n.blocklyAngleGauge {\n fill: #f88;\n fill-opacity: .8;\n pointer-events: none;\n}\n\n.blocklyAngleLine {\n stroke: #f00;\n stroke-width: 2;\n stroke-linecap: round;\n pointer-events: none;\n}\n");
1433
1435
  register$$module$build$src$core$field_registry("field_angle",FieldAngle$$module$build$src$core$field_angle);FieldAngle$$module$build$src$core$field_angle.prototype.DEFAULT_VALUE=0;var Mode$$module$build$src$core$field_angle;(function(a){a.COMPASS="compass";a.PROTRACTOR="protractor"})(Mode$$module$build$src$core$field_angle||(Mode$$module$build$src$core$field_angle={}));var module$build$src$core$field_angle={};module$build$src$core$field_angle.FieldAngle=FieldAngle$$module$build$src$core$field_angle;
@@ -1489,7 +1491,7 @@ this.pixelsToWorkspaceUnits_(a);const b=Coordinate$$module$build$src$core$utils$
1489
1491
  this.draggingBlock_.render();this.draggingBlock_.scheduleSnapAndBump()}fireDragEndEvent_(){const a=new (get$$module$build$src$core$events$utils(BLOCK_DRAG$$module$build$src$core$events$utils))(this.draggingBlock_,!1,this.draggingBlock_.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}updateToolboxStyle_(a){const b=this.workspace_.getToolbox();if(b){const c=this.draggingBlock_.isDeletable()?"blocklyToolboxDelete":"blocklyToolboxGrab";a&&"function"===typeof b.removeStyle?b.removeStyle(c):
1490
1492
  a||"function"!==typeof b.addStyle||b.addStyle(c)}}fireMoveEvent_(){const a=new (get$$module$build$src$core$events$utils(MOVE$$module$build$src$core$events$utils))(this.draggingBlock_);a.oldCoordinate=this.startXY_;a.recordNew();fire$$module$build$src$core$events$utils(a)}updateCursorDuringBlockDrag_(){this.draggingBlock_.setDeleteStyle(this.wouldDeleteBlock_)}pixelsToWorkspaceUnits_(a){a=new Coordinate$$module$build$src$core$utils$coordinate(a.x/this.workspace_.scale,a.y/this.workspace_.scale);this.workspace_.isMutator&&
1491
1493
  a.scale(1/this.workspace_.options.parentWorkspace.scale);return a}dragIcons_(a){for(let b=0;b<this.dragIconData_.length;b++){const c=this.dragIconData_[b];c.icon.setIconLocation(Coordinate$$module$build$src$core$utils$coordinate.sum(c.location,a))}}getInsertionMarkers(){return this.draggedConnectionManager_&&this.draggedConnectionManager_.getInsertionMarkers?this.draggedConnectionManager_.getInsertionMarkers():[]}};
1492
- register$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,DEFAULT$$module$build$src$core$registry,BlockDragger$$module$build$src$core$block_dragger);var module$build$src$core$block_dragger={};module$build$src$core$block_dragger.BlockDragger=BlockDragger$$module$build$src$core$block_dragger;var VERSION$$module$build$src$core$blockly="9.0.0-beta.3",ALIGN_LEFT$$module$build$src$core$blockly=$.Align$$module$build$src$core$input.LEFT,ALIGN_CENTRE$$module$build$src$core$blockly=$.Align$$module$build$src$core$input.CENTRE,ALIGN_RIGHT$$module$build$src$core$blockly=$.Align$$module$build$src$core$input.RIGHT,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,
1494
+ register$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,DEFAULT$$module$build$src$core$registry,BlockDragger$$module$build$src$core$block_dragger);var module$build$src$core$block_dragger={};module$build$src$core$block_dragger.BlockDragger=BlockDragger$$module$build$src$core$block_dragger;var VERSION$$module$build$src$core$blockly="9.0.0-beta.4",ALIGN_LEFT$$module$build$src$core$blockly=$.Align$$module$build$src$core$input.LEFT,ALIGN_CENTRE$$module$build$src$core$blockly=$.Align$$module$build$src$core$input.CENTRE,ALIGN_RIGHT$$module$build$src$core$blockly=$.Align$$module$build$src$core$input.RIGHT,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,
1493
1495
  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,DUMMY_INPUT$$module$build$src$core$blockly=inputTypes$$module$build$src$core$input_types.DUMMY,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,
1494
1496
  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=getMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$blockly=getSelected$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$blockly=
1495
1497
  defineBlocksWithJsonArray$$module$build$src$core$common,setParentContainer$$module$build$src$core$blockly=setParentContainer$$module$build$src$core$common,svgSize$$module$build$src$core$blockly=svgSize$$module$build$src$core$utils$svg_math,resizeSvgContents$$module$build$src$core$blockly=resizeSvgContentsLocal$$module$build$src$core$blockly,COLLAPSE_CHARS$$module$build$src$core$blockly=COLLAPSE_CHARS$$module$build$src$core$internal_constants,DRAG_STACK$$module$build$src$core$blockly=DRAG_STACK$$module$build$src$core$internal_constants,