From 08dd5605a8e1164a578c719df6e69e6778c3ea38 Mon Sep 17 00:00:00 2001 From: Branko May Trinkwald Date: Tue, 23 Dec 2025 22:25:11 +0100 Subject: [PATCH] fun in the sun <3 --- README.md | 8 + crumbblocks/lib/blockly/blockly.min.js | 2740 ++++++++ crumbblocks/lib/blockly/blocks_compressed.js | 193 + crumbblocks/lib/blockly/de.js | 465 ++ crumbblocks/lib/blockly/javascript.min.js | 264 + crumbblocks/solar_kettle_dark.html | 687 ++ missions/evaluate_mission_data.sh | 5 + missions/robots/evaluate_solar_kettle.sh | 47 + missions/robots/solar_kettle.meta.json | 8 + missions/robots/solar_kettle.sh | 51 + release_notes.md | 10 + schnippsi_ui/error.txt | 6018 ------------------ schnippsi_ui/index.html | 103 - schnippsi_ui/ttyd | 1 - 14 files changed, 4478 insertions(+), 6122 deletions(-) create mode 100644 crumbblocks/lib/blockly/blockly.min.js create mode 100644 crumbblocks/lib/blockly/blocks_compressed.js create mode 100644 crumbblocks/lib/blockly/de.js create mode 100644 crumbblocks/lib/blockly/javascript.min.js create mode 100644 crumbblocks/solar_kettle_dark.html create mode 100755 missions/robots/evaluate_solar_kettle.sh create mode 100644 missions/robots/solar_kettle.meta.json create mode 100755 missions/robots/solar_kettle.sh delete mode 100755 schnippsi_ui/error.txt delete mode 100755 schnippsi_ui/index.html delete mode 160000 schnippsi_ui/ttyd diff --git a/README.md b/README.md index 3db823a..aa4586f 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,13 @@ Drei komplette Missionen zum Roboter-Bauen mit der ganzen Crew: - OpenCV + Weather APIs + Astronomical calculations - Bonus: Learn about Lunar Rainbows! 🌙🌈 +### ☀️ Solar Wasserkocher +"Physik ist der Algorithmus der Natur" +- 6 Phasen: Energie → Schleifen → Optimierung +- Simuliere einen solargetriebenen Wasserkocher mit Physik-Engine +- 3 Waldwächter: CapaciTobi, Schnecki, FunkFox +- Lerne: Variablen, While-Loops und Energie-Management ($E = c \cdot m \cdot \Delta T$) + ## 📚 Features - **Interaktive Lernmissionen** - Von Basics bis Advanced & Robots @@ -101,6 +108,7 @@ Drei komplette Missionen zum Roboter-Bauen mit der ganzen Crew: - **🔋 LiPo Power Academy** - Batterie-Wissen für Roboter - **🌈 Regenbogen-Zählmaschine** - Farb-Event-Counter - **🌙 Mond Maschine** - Rainbow Predictor mit Computer Vision +- **☀️ Solar Wasserkocher** - Physik-Simulation & Schleifen-Logik ## 🤖 Waldwächter nutzen diff --git a/crumbblocks/lib/blockly/blockly.min.js b/crumbblocks/lib/blockly/blockly.min.js new file mode 100644 index 0000000..b257bd7 --- /dev/null +++ b/crumbblocks/lib/blockly/blockly.min.js @@ -0,0 +1,2740 @@ +// Do not edit this file; automatically generated. + +/* eslint-disable */ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { // AMD + define([], factory); + } else if (typeof exports === 'object') { // Node.js + module.exports = factory(); + } else { // Script + root.Blockly = factory(); + } +}(this, function() { +var $={}; +var register$$module$build$src$core$registry,validate$$module$build$src$core$registry,unregister$$module$build$src$core$registry,getItem$$module$build$src$core$registry,hasItem$$module$build$src$core$registry,getClass$$module$build$src$core$registry,getObject$$module$build$src$core$registry,getAllItems$$module$build$src$core$registry,getClassFromOptions$$module$build$src$core$registry,longStart$$module$build$src$core$touch,longStop$$module$build$src$core$touch,clearTouchIdentifier$$module$build$src$core$touch, +shouldHandleEvent$$module$build$src$core$touch,getTouchIdentifierFromEvent$$module$build$src$core$touch,checkTouchIdentifier$$module$build$src$core$touch,conditionalBind$$module$build$src$core$browser_events,bind$$module$build$src$core$browser_events,unbind$$module$build$src$core$browser_events,isTargetInput$$module$build$src$core$browser_events,isRightButton$$module$build$src$core$browser_events,mouseToSvg$$module$build$src$core$browser_events,getScrollDeltaPixels$$module$build$src$core$browser_events, +getNextUniqueId$$module$build$src$core$utils$idgenerator,genUid$$module$build$src$core$utils$idgenerator,isBlockCreate$$module$build$src$core$events$predicates,isBlockDelete$$module$build$src$core$events$predicates,isBlockChange$$module$build$src$core$events$predicates,isBlockFieldIntermediateChange$$module$build$src$core$events$predicates,isBlockMove$$module$build$src$core$events$predicates,isVarCreate$$module$build$src$core$events$predicates,isVarDelete$$module$build$src$core$events$predicates, +isVarRename$$module$build$src$core$events$predicates,isBlockDrag$$module$build$src$core$events$predicates,isSelected$$module$build$src$core$events$predicates,isClick$$module$build$src$core$events$predicates,isBubbleOpen$$module$build$src$core$events$predicates,isTrashcanOpen$$module$build$src$core$events$predicates,isToolboxItemSelect$$module$build$src$core$events$predicates,isThemeChange$$module$build$src$core$events$predicates,isViewportChange$$module$build$src$core$events$predicates,isCommentCreate$$module$build$src$core$events$predicates, +isCommentDelete$$module$build$src$core$events$predicates,isCommentChange$$module$build$src$core$events$predicates,isCommentMove$$module$build$src$core$events$predicates,isCommentResize$$module$build$src$core$events$predicates,isCommentDrag$$module$build$src$core$events$predicates,isCommentCollapse$$module$build$src$core$events$predicates,isFinishedLoading$$module$build$src$core$events$predicates,getRecordUndo$$module$build$src$core$events$utils,fire$$module$build$src$core$events$utils,fireInternal$$module$build$src$core$events$utils, +fireNow$$module$build$src$core$events$utils,enqueueEvent$$module$build$src$core$events$utils,filter$$module$build$src$core$events$utils,clearPendingUndo$$module$build$src$core$events$utils,isEnabled$$module$build$src$core$events$utils,setGroupInternal$$module$build$src$core$events$utils,getDescendantIds$$module$build$src$core$events$utils,fromJson$$module$build$src$core$events$utils,get$$module$build$src$core$events$utils,disableOrphans$$module$build$src$core$events$utils,createSvgElement$$module$build$src$core$utils$dom, +addClass$$module$build$src$core$utils$dom,removeClasses$$module$build$src$core$utils$dom,removeClass$$module$build$src$core$utils$dom,hasClass$$module$build$src$core$utils$dom,removeNode$$module$build$src$core$utils$dom,insertAfter$$module$build$src$core$utils$dom,setCssTransform$$module$build$src$core$utils$dom,startTextWidthCache$$module$build$src$core$utils$dom,stopTextWidthCache$$module$build$src$core$utils$dom,getTextWidth$$module$build$src$core$utils$dom,getFastTextWidth$$module$build$src$core$utils$dom, +getFastTextWidthWithSizeString$$module$build$src$core$utils$dom,measureFontMetrics$$module$build$src$core$utils$dom,isFocusableNode$$module$build$src$core$interfaces$i_focusable_node,isSelectable$$module$build$src$core$interfaces$i_selectable,deepMerge$$module$build$src$core$utils$object,getWorkspaceById$$module$build$src$core$common,getAllWorkspaces$$module$build$src$core$common,registerWorkspace$$module$build$src$core$common,unregisterWorkpace$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$common, +setMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$common,setSelected$$module$build$src$core$common,fireSelectedEvent$$module$build$src$core$common,getParentContainer$$module$build$src$core$common,setParentContainer$$module$build$src$core$common,svgResize$$module$build$src$core$common,getBlockTypeCounts$$module$build$src$core$common,jsonInitFactory$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$common,defineBlocksWithJsonArrayInternal$$module$build$src$core$common, +globalShortcutHandler$$module$build$src$core$common,removeElem$$module$build$src$core$utils$array,register$$module$build$src$core$css,inject$$module$build$src$core$css,getSize$$module$build$src$core$utils$style,getSizeInternal$$module$build$src$core$utils$style,getSizeWithDisplay$$module$build$src$core$utils$style,getComputedStyle$$module$build$src$core$utils$style,getPageOffset$$module$build$src$core$utils$style,getViewportPageOffset$$module$build$src$core$utils$style,getBorderBox$$module$build$src$core$utils$style, +scrollIntoContainerView$$module$build$src$core$utils$style,getContainerOffsetToScrollInto$$module$build$src$core$utils$style,getRelativeXY$$module$build$src$core$utils$svg_math,getInjectionDivXY$$module$build$src$core$utils$svg_math,getViewportBBox$$module$build$src$core$utils$svg_math,getDocumentScroll$$module$build$src$core$utils$svg_math,screenToWsCoordinates$$module$build$src$core$utils$svg_math,wsToScreenCoordinates$$module$build$src$core$utils$svg_math,injectDependencies$$module$build$src$core$utils$xml, +domToText$$module$build$src$core$utils$xml,sanitizeText$$module$build$src$core$utils$xml,convertToolboxDefToJson$$module$build$src$core$utils$toolbox,validateToolbox$$module$build$src$core$utils$toolbox,convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox,hasCategories$$module$build$src$core$utils$toolbox,hasCategoriesInternal$$module$build$src$core$utils$toolbox,isCategoryCollapsible$$module$build$src$core$utils$toolbox,convertToToolboxJson$$module$build$src$core$utils$toolbox,xmlToJsonArray$$module$build$src$core$utils$toolbox, +addAttributes$$module$build$src$core$utils$toolbox,parseToolboxTree$$module$build$src$core$utils$toolbox,getStartPositionRect$$module$build$src$core$positionable_helpers,getCornerOppositeToolbox$$module$build$src$core$positionable_helpers,bumpPositionRect$$module$build$src$core$positionable_helpers,register$$module$build$src$core$serialization$registry,unregister$$module$build$src$core$serialization$registry,save$$module$build$src$core$serialization$workspace_comments,append$$module$build$src$core$serialization$workspace_comments, +register$$module$build$src$core$clipboard$registry,unregister$$module$build$src$core$clipboard$registry,moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster,commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster,setRole$$module$build$src$core$utils$aria,setState$$module$build$src$core$utils$aria,isSerializable$$module$build$src$core$interfaces$i_serializable,queueRender$$module$build$src$core$render_management,finishQueuedRenders$$module$build$src$core$render_management, +triggerQueuedRenders$$module$build$src$core$render_management,alwaysImmediatelyRender$$module$build$src$core$render_management,queueBlock$$module$build$src$core$render_management,doRenders$$module$build$src$core$render_management,dequeueBlock$$module$build$src$core$render_management,shouldRenderRootBlock$$module$build$src$core$render_management,renderBlock$$module$build$src$core$render_management,alert$$module$build$src$core$dialog,setAlert$$module$build$src$core$dialog,confirm$$module$build$src$core$dialog, +setConfirm$$module$build$src$core$dialog,prompt$$module$build$src$core$dialog,setPrompt$$module$build$src$core$dialog,toast$$module$build$src$core$dialog,setToast$$module$build$src$core$dialog,isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks,isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model,warn$$module$build$src$core$utils$deprecation, +internalFlyoutCategory$$module$build$src$core$variables,flyoutCategory$$module$build$src$core$variables,generateVariableFieldJson$$module$build$src$core$variables,jsonFlyoutCategoryBlocks$$module$build$src$core$variables,xmlFlyoutCategory$$module$build$src$core$variables,flyoutCategoryBlocks$$module$build$src$core$variables,generateUniqueName$$module$build$src$core$variables,generateUniqueNameInternal$$module$build$src$core$variables,generateUniqueNameFromOptions$$module$build$src$core$variables, +createVariableButtonHandler$$module$build$src$core$variables,promptName$$module$build$src$core$variables,nameUsedWithOtherType$$module$build$src$core$variables,nameUsedWithAnyType$$module$build$src$core$variables,nameUsedWithConflictingParam$$module$build$src$core$variables,checkForConflictingParamWithProcedureModels$$module$build$src$core$variables,checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables,generateVariableFieldDom$$module$build$src$core$variables,createVariable$$module$build$src$core$variables, +getAddedVariables$$module$build$src$core$variables,compareByName$$module$build$src$core$variables,getVariableUsesById$$module$build$src$core$variables,save$$module$build$src$core$serialization$blocks,saveAttributes$$module$build$src$core$serialization$blocks,saveCoords$$module$build$src$core$serialization$blocks,saveExtraState$$module$build$src$core$serialization$blocks,saveIcons$$module$build$src$core$serialization$blocks,saveFields$$module$build$src$core$serialization$blocks,saveInputBlocks$$module$build$src$core$serialization$blocks, +saveNextBlocks$$module$build$src$core$serialization$blocks,saveConnection$$module$build$src$core$serialization$blocks,append$$module$build$src$core$serialization$blocks,appendInternal$$module$build$src$core$serialization$blocks,appendPrivate$$module$build$src$core$serialization$blocks,checkNewVariables$$module$build$src$core$serialization$blocks,loadCoords$$module$build$src$core$serialization$blocks,loadAttributes$$module$build$src$core$serialization$blocks,loadExtraState$$module$build$src$core$serialization$blocks, +tryToConnectParent$$module$build$src$core$serialization$blocks,loadIcons$$module$build$src$core$serialization$blocks,loadFields$$module$build$src$core$serialization$blocks,loadInputBlocks$$module$build$src$core$serialization$blocks,loadNextBlocks$$module$build$src$core$serialization$blocks,loadConnection$$module$build$src$core$serialization$blocks,initBlock$$module$build$src$core$serialization$blocks,hasBubble$$module$build$src$core$interfaces$i_has_bubble,toRadians$$module$build$src$core$utils$math, +toDegrees$$module$build$src$core$utils$math,clamp$$module$build$src$core$utils$math,createDom$$module$build$src$core$dropdowndiv,setBoundsElement$$module$build$src$core$dropdowndiv,getOwner$$module$build$src$core$dropdowndiv,getContentDiv$$module$build$src$core$dropdowndiv,clearContent$$module$build$src$core$dropdowndiv,setColour$$module$build$src$core$dropdowndiv,showPositionedByBlock$$module$build$src$core$dropdowndiv,showPositionedByField$$module$build$src$core$dropdowndiv,getScaledBboxOfBlock$$module$build$src$core$dropdowndiv, +getScaledBboxOfField$$module$build$src$core$dropdowndiv,showPositionedByRect$$module$build$src$core$dropdowndiv,show$$module$build$src$core$dropdowndiv,getPositionBelowMetrics$$module$build$src$core$dropdowndiv,getPositionAboveMetrics$$module$build$src$core$dropdowndiv,getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv,getPositionX$$module$build$src$core$dropdowndiv,isVisible$$module$build$src$core$dropdowndiv,hideIfOwner$$module$build$src$core$dropdowndiv,hide$$module$build$src$core$dropdowndiv, +hideWithoutAnimation$$module$build$src$core$dropdowndiv,positionInternal$$module$build$src$core$dropdowndiv,repositionForWindowResize$$module$build$src$core$dropdowndiv,shortestStringLength$$module$build$src$core$utils$string,commonWordPrefix$$module$build$src$core$utils$string,commonWordSuffix$$module$build$src$core$utils$string,wrapLine$$module$build$src$core$utils$string,wrapScore$$module$build$src$core$utils$string,wrapMutate$$module$build$src$core$utils$string,wrapToText$$module$build$src$core$utils$string, +setCustomTooltip$$module$build$src$core$tooltip,getCustomTooltip$$module$build$src$core$tooltip,isVisible$$module$build$src$core$tooltip,getDiv$$module$build$src$core$tooltip,getTooltipOfObject$$module$build$src$core$tooltip,getTargetObject$$module$build$src$core$tooltip,createDom$$module$build$src$core$tooltip,bindMouseEvents$$module$build$src$core$tooltip,unbindMouseEvents$$module$build$src$core$tooltip,onMouseOver$$module$build$src$core$tooltip,onMouseOut$$module$build$src$core$tooltip,onMouseMove$$module$build$src$core$tooltip, +dispose$$module$build$src$core$tooltip,hide$$module$build$src$core$tooltip,block$$module$build$src$core$tooltip,unblock$$module$build$src$core$tooltip,renderContent$$module$build$src$core$tooltip,renderDefaultContent$$module$build$src$core$tooltip,getPosition$$module$build$src$core$tooltip,show$$module$build$src$core$tooltip,getHsvSaturation$$module$build$src$core$utils$colour,setHsvSaturation$$module$build$src$core$utils$colour,getHsvValue$$module$build$src$core$utils$colour,setHsvValue$$module$build$src$core$utils$colour, +parse$$module$build$src$core$utils$colour,rgbToHex$$module$build$src$core$utils$colour,hexToRgb$$module$build$src$core$utils$colour,hsvToHex$$module$build$src$core$utils$colour,blend$$module$build$src$core$utils$colour,hueToHex$$module$build$src$core$utils$colour,tokenizeInterpolationInternal$$module$build$src$core$utils$parsing,tokenizeInterpolation$$module$build$src$core$utils$parsing,replaceMessageReferences$$module$build$src$core$utils$parsing,checkMessageReferences$$module$build$src$core$utils$parsing, +parseBlockColour$$module$build$src$core$utils$parsing,getDiv$$module$build$src$core$widgetdiv,testOnly_setDiv$$module$build$src$core$widgetdiv,createDom$$module$build$src$core$widgetdiv,show$$module$build$src$core$widgetdiv,hide$$module$build$src$core$widgetdiv,isVisible$$module$build$src$core$widgetdiv,hideIfOwner$$module$build$src$core$widgetdiv,hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv,positionInternal$$module$build$src$core$widgetdiv,positionWithAnchor$$module$build$src$core$widgetdiv, +calculateX$$module$build$src$core$widgetdiv,calculateY$$module$build$src$core$widgetdiv,isRepositionable$$module$build$src$core$widgetdiv,repositionForWindowResize$$module$build$src$core$widgetdiv,getCurrentBlock$$module$build$src$core$contextmenu,setCurrentBlock$$module$build$src$core$contextmenu,show$$module$build$src$core$contextmenu,populate_$$module$build$src$core$contextmenu,position_$$module$build$src$core$contextmenu,createWidget_$$module$build$src$core$contextmenu,haltPropagation$$module$build$src$core$contextmenu, +hide$$module$build$src$core$contextmenu,dispose$$module$build$src$core$contextmenu,mouseToWorkspacePoint$$module$build$src$core$utils$drag,start$$module$build$src$core$utils$drag,move$$module$build$src$core$utils$drag,workspaceToDom$$module$build$src$core$xml,saveWorkspaceComment$$module$build$src$core$xml,variablesToDom$$module$build$src$core$xml,blockToDomWithXY$$module$build$src$core$xml,fieldToDom$$module$build$src$core$xml,allFieldsToDom$$module$build$src$core$xml,blockToDom$$module$build$src$core$xml, +cloneShadow$$module$build$src$core$xml,domToText$$module$build$src$core$xml,domToPrettyText$$module$build$src$core$xml,clearWorkspaceAndLoadFromXml$$module$build$src$core$xml,loadWorkspaceComment$$module$build$src$core$xml,appendDomToWorkspace$$module$build$src$core$xml,domToBlockInternal$$module$build$src$core$xml,domToVariables$$module$build$src$core$xml,mapSupportedXmlTags$$module$build$src$core$xml,applyMutationTagNodes$$module$build$src$core$xml,applyCommentTagNodes$$module$build$src$core$xml, +applyDataTagNodes$$module$build$src$core$xml,applyFieldTagNodes$$module$build$src$core$xml,findChildBlocks$$module$build$src$core$xml,applyInputTagNodes$$module$build$src$core$xml,applyNextTagNodes$$module$build$src$core$xml,domToBlockHeadless$$module$build$src$core$xml,domToField$$module$build$src$core$xml,deleteNext$$module$build$src$core$xml,isElement$$module$build$src$core$xml,register$$module$build$src$core$field_registry,unregister$$module$build$src$core$field_registry,fromJsonInternal$$module$build$src$core$field_registry, +isImageProperties$$module$build$src$core$field_dropdown,unregister$$module$build$src$core$extensions,isRegistered$$module$build$src$core$extensions,apply$$module$build$src$core$extensions,checkNoMutatorProperties$$module$build$src$core$extensions,checkXmlHooks$$module$build$src$core$extensions,checkJsonHooks$$module$build$src$core$extensions,checkMutatorDialog$$module$build$src$core$extensions,checkHasFunctionPair$$module$build$src$core$extensions,checkHasMutatorProperties$$module$build$src$core$extensions, +getMutatorProperties$$module$build$src$core$extensions,mutatorPropertiesMatch$$module$build$src$core$extensions,runAfterPageLoad$$module$build$src$core$extensions,checkDropdownOptionsInTable$$module$build$src$core$extensions,extensionParentTooltip$$module$build$src$core$extensions,point$$module$build$src$core$utils$svg_paths,curve$$module$build$src$core$utils$svg_paths,moveTo$$module$build$src$core$utils$svg_paths,moveBy$$module$build$src$core$utils$svg_paths,lineTo$$module$build$src$core$utils$svg_paths, +line$$module$build$src$core$utils$svg_paths,lineOnAxis$$module$build$src$core$utils$svg_paths,arc$$module$build$src$core$utils$svg_paths,connectReciprocally$$module$build$src$core$connection,getSingleConnection$$module$build$src$core$connection,getConnectionForOrphanedOutput$$module$build$src$core$connection,isIcon$$module$build$src$core$interfaces$i_icon,isCommentIcon$$module$build$src$core$interfaces$i_comment_icon,disposeUiEffect$$module$build$src$core$block_animations,disposeUiStep$$module$build$src$core$block_animations, +connectionUiEffect$$module$build$src$core$block_animations,disconnectUiEffect$$module$build$src$core$block_animations,disconnectUiStep$$module$build$src$core$block_animations,disconnectUiStop$$module$build$src$core$block_animations,moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster,blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster,blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster,bumpObjectIntoBounds$$module$build$src$core$bump_objects,bumpIntoBoundsHandler$$module$build$src$core$bump_objects, +extractObjectFromEvent$$module$build$src$core$bump_objects,bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects,isDeletable$$module$build$src$core$interfaces$i_deletable,getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy,navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy,navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy,register$$module$build$src$core$icons$registry,unregister$$module$build$src$core$icons$registry, +isDraggable$$module$build$src$core$interfaces$i_draggable,isAutoHideable$$module$build$src$core$interfaces$i_autohideable,isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block,isObservable$$module$build$src$core$interfaces$i_observable,allProcedures$$module$build$src$core$procedures,procTupleComparator$$module$build$src$core$procedures,isLegalName$$module$build$src$core$procedures,isNameUsed$$module$build$src$core$procedures,xmlFlyoutCategory$$module$build$src$core$procedures,internalFlyoutCategory$$module$build$src$core$procedures, +flyoutCategory$$module$build$src$core$procedures,updateMutatorFlyout$$module$build$src$core$procedures,mutatorOpenListener$$module$build$src$core$procedures,mutatorChangeListener$$module$build$src$core$procedures,getCallers$$module$build$src$core$procedures,blockIsModernCallerFor$$module$build$src$core$procedures,isDynamicShape$$module$build$src$core$renderers$common$constants,isPuzzleTab$$module$build$src$core$renderers$common$constants,isNotch$$module$build$src$core$renderers$common$constants,register$$module$build$src$core$renderers$common$block_rendering, +unregister$$module$build$src$core$renderers$common$block_rendering,init$$module$build$src$core$renderers$common$block_rendering,stringButtonClickHandler$$module$build$src$core$variables_dynamic,numberButtonClickHandler$$module$build$src$core$variables_dynamic,colourButtonClickHandler$$module$build$src$core$variables_dynamic,internalFlyoutCategory$$module$build$src$core$variables_dynamic,flyoutCategory$$module$build$src$core$variables_dynamic,xmlFlyoutCategory$$module$build$src$core$variables_dynamic, +flyoutCategoryBlocks$$module$build$src$core$variables_dynamic,resizeSvgContents$$module$build$src$core$workspace_svg,copy$$module$build$src$core$clipboard,getLastCopiedData$$module$build$src$core$clipboard,setLastCopiedData$$module$build$src$core$clipboard,getLastCopiedWorkspace$$module$build$src$core$clipboard,setLastCopiedWorkspace$$module$build$src$core$clipboard,getLastCopiedLocation$$module$build$src$core$clipboard,setLastCopiedLocation$$module$build$src$core$clipboard,paste$$module$build$src$core$clipboard, +pasteFromData$$module$build$src$core$clipboard,isCopyable$$module$build$src$core$interfaces$i_copyable,registerEscape$$module$build$src$core$shortcut_items,registerDelete$$module$build$src$core$shortcut_items,isCopyable$$module$build$src$core$shortcut_items,isCuttable$$module$build$src$core$shortcut_items,registerCopy$$module$build$src$core$shortcut_items,registerCut$$module$build$src$core$shortcut_items,registerPaste$$module$build$src$core$shortcut_items,registerUndo$$module$build$src$core$shortcut_items, +registerRedo$$module$build$src$core$shortcut_items,registerDefaultShortcuts$$module$build$src$core$shortcut_items,saveProcedure$$module$build$src$core$serialization$procedures,loadProcedure$$module$build$src$core$serialization$procedures,save$$module$build$src$core$serialization$workspaces,load$$module$build$src$core$serialization$workspaces,inject$$module$build$src$core$inject,createDom$$module$build$src$core$inject,createMainWorkspace$$module$build$src$core$inject,init$$module$build$src$core$inject, +bindDocumentEvents$$module$build$src$core$inject,loadSounds$$module$build$src$core$inject,isFullBlockField$$module$build$src$core$contextmenu_items,registerUndo$$module$build$src$core$contextmenu_items,registerRedo$$module$build$src$core$contextmenu_items,registerCleanup$$module$build$src$core$contextmenu_items,toggleOption_$$module$build$src$core$contextmenu_items,registerCollapse$$module$build$src$core$contextmenu_items,registerExpand$$module$build$src$core$contextmenu_items,addDeletableBlocks_$$module$build$src$core$contextmenu_items, +getDeletableBlocks_$$module$build$src$core$contextmenu_items,deleteNext_$$module$build$src$core$contextmenu_items,registerDeleteAll$$module$build$src$core$contextmenu_items,registerWorkspaceOptions_$$module$build$src$core$contextmenu_items,registerDuplicate$$module$build$src$core$contextmenu_items,registerComment$$module$build$src$core$contextmenu_items,registerInline$$module$build$src$core$contextmenu_items,registerCollapseExpandBlock$$module$build$src$core$contextmenu_items,registerDisable$$module$build$src$core$contextmenu_items, +registerDelete$$module$build$src$core$contextmenu_items,registerHelp$$module$build$src$core$contextmenu_items,registerCommentDelete$$module$build$src$core$contextmenu_items,registerCommentDuplicate$$module$build$src$core$contextmenu_items,registerCommentCreate$$module$build$src$core$contextmenu_items,registerBlockOptions_$$module$build$src$core$contextmenu_items,registerCommentOptions$$module$build$src$core$contextmenu_items,registerDefaultOptions$$module$build$src$core$contextmenu_items,isPaster$$module$build$src$core$interfaces$i_paster, +isRenderedElement$$module$build$src$core$interfaces$i_rendered_element,isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item,hideChaff$$module$build$src$core$blockly,isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree,$jscomp; +register$$module$build$src$core$registry=function(a,b,c,d){if(!(a instanceof Type$$module$build$src$core$registry)&&typeof a!=="string"||`${a}`.trim()==="")throw Error('Invalid type "'+a+'". The type must be a non-empty string or a Blockly.registry.Type.');a=`${a}`.toLowerCase();if(typeof b!=="string"||b.trim()==="")throw Error('Invalid name "'+b+'". The name must be a non-empty string.');const e=b.toLowerCase();if(!c)throw Error("Can not register a null value");let f=typeMap$$module$build$src$core$registry[a], +g=nameMap$$module$build$src$core$registry[a];f||(f=typeMap$$module$build$src$core$registry[a]=Object.create(null),g=nameMap$$module$build$src$core$registry[a]=Object.create(null));validate$$module$build$src$core$registry(a,c);if(!d&&f[e]&&f[e]!==c)throw Error('Name "'+e+'" with type "'+a+'" already registered.');f[e]=c;g[e]=b}; +validate$$module$build$src$core$registry=function(a,b){switch(a){case String(Type$$module$build$src$core$registry.FIELD):if(typeof b.fromJson!=="function")throw Error('Type "'+a+'" must have a fromJson function');}}; +unregister$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();const c=typeMap$$module$build$src$core$registry[a];c&&c[b]?(delete typeMap$$module$build$src$core$registry[a][b],delete nameMap$$module$build$src$core$registry[a][b]):console.warn("Unable to unregister ["+b+"]["+a+"] from the registry.")}; +getItem$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();b=b.toLowerCase();const d=typeMap$$module$build$src$core$registry[a];if(!d||!d[b]){b="Unable to find ["+b+"]["+a+"] in the registry.";if(c)throw Error(b+" You must require or register a "+a+" plugin.");console.warn(b);return null}return d[b]};hasItem$$module$build$src$core$registry=function(a,b){a=`${a}`.toLowerCase();b=b.toLowerCase();return(a=typeMap$$module$build$src$core$registry[a])?!!a[b]:!1}; +getClass$$module$build$src$core$registry=function(a,b,c){return getItem$$module$build$src$core$registry(a,b,c)};getObject$$module$build$src$core$registry=function(a,b,c){return getItem$$module$build$src$core$registry(a,b,c)}; +getAllItems$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase();var d=typeMap$$module$build$src$core$registry[a];if(!d){d=`Unable to find [${a}] in the registry.`;if(c)throw Error(`${d} You must require or register a ${a} plugin.`);console.warn(d);return null}if(!b)return d;a=nameMap$$module$build$src$core$registry[a];c=Object.create(null);for(const e of Object.keys(d))c[a[e]]=d[e];return c}; +getClassFromOptions$$module$build$src$core$registry=function(a,b,c){b=b.plugins[String(a)]||DEFAULT$$module$build$src$core$registry;return typeof b==="function"?b:getClass$$module$build$src$core$registry(a,b,c)};longStart$$module$build$src$core$touch=function(a,b){longStop$$module$build$src$core$touch();longPid_$$module$build$src$core$touch=setTimeout(function(){b&&b.handleRightClick(a)},LONGPRESS$$module$build$src$core$touch)}; +longStop$$module$build$src$core$touch=function(){longPid_$$module$build$src$core$touch&&(clearTimeout(longPid_$$module$build$src$core$touch),longPid_$$module$build$src$core$touch=0)};clearTouchIdentifier$$module$build$src$core$touch=function(){touchIdentifier_$$module$build$src$core$touch=null};shouldHandleEvent$$module$build$src$core$touch=function(a){return!a.type.startsWith("pointer")||a instanceof PointerEvent&&checkTouchIdentifier$$module$build$src$core$touch(a)}; +getTouchIdentifierFromEvent$$module$build$src$core$touch=function(a){return`${a.pointerId}`};checkTouchIdentifier$$module$build$src$core$touch=function(a){const b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);return touchIdentifier_$$module$build$src$core$touch?touchIdentifier_$$module$build$src$core$touch===b:a.type==="pointerdown"?(touchIdentifier_$$module$build$src$core$touch=b,!0):!1}; +conditionalBind$$module$build$src$core$browser_events=function(a,b,c,d,e){function f(h){if(e||shouldHandleEvent$$module$build$src$core$touch(h))c?d.call(c,h):d(h)}const g=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let h=0;h{setTimeout(fireNow$$module$build$src$core$events$utils,0)})}catch(b){setTimeout(fireNow$$module$build$src$core$events$utils,0)}enqueueEvent$$module$build$src$core$events$utils(a)}}; +fireNow$$module$build$src$core$events$utils=function(){const a=filter$$module$build$src$core$events$utils(FIRE_QUEUE$$module$build$src$core$events$utils);FIRE_QUEUE$$module$build$src$core$events$utils.length=0;for(const b of a){if(!b.workspaceId)continue;let c;(c=getWorkspaceById$$module$build$src$core$common(b.workspaceId))==null||c.fireChangeListener(b)}}; +enqueueEvent$$module$build$src$core$events$utils=function(a){if(isBlockChange$$module$build$src$core$events$predicates(a)&&a.element==="mutation"){let b;for(b=FIRE_QUEUE$$module$build$src$core$events$utils.length;b>0;b--){const c=FIRE_QUEUE$$module$build$src$core$events$utils[b-1];if(c.group!==a.group||c.workspaceId!==a.workspaceId||!isBlockMove$$module$build$src$core$events$predicates(c)||c.newParentId!==a.blockId)break}FIRE_QUEUE$$module$build$src$core$events$utils.splice(b,0,a)}else FIRE_QUEUE$$module$build$src$core$events$utils.push(a)}; +filter$$module$build$src$core$events$utils=function(a){const b=[];for(const c of a)if(a=b[b.length-1],!c.isNull())if(a&&a.workspaceId===c.workspaceId&&a.group===c.group)if(isBlockMove$$module$build$src$core$events$predicates(c)&&isBlockMove$$module$build$src$core$events$predicates(a)&&c.blockId===a.blockId){if(a.newParentId=c.newParentId,a.newInputName=c.newInputName,a.newCoordinate=c.newCoordinate,a.reason||c.reason){let d,e;a.reason=Array.from(new Set(((d=a.reason)!=null?d:[]).concat((e=c.reason)!= +null?e:[])))}}else isBlockChange$$module$build$src$core$events$predicates(c)&&isBlockChange$$module$build$src$core$events$predicates(a)&&c.blockId===a.blockId&&c.element===a.element&&c.name===a.name?a.newValue=c.newValue:isViewportChange$$module$build$src$core$events$predicates(c)&&isViewportChange$$module$build$src$core$events$predicates(a)?(a.viewTop=c.viewTop,a.viewLeft=c.viewLeft,a.scale=c.scale,a.oldScale=c.oldScale):isClick$$module$build$src$core$events$predicates(c)&&isBubbleOpen$$module$build$src$core$events$predicates(a)|| +b.push(c);else b.push(c);return a=b.filter(c=>!c.isNull())};clearPendingUndo$$module$build$src$core$events$utils=function(){for(let a=0,b;b=FIRE_QUEUE$$module$build$src$core$events$utils[a];a++)b.recordUndo=!1};$.disable$$module$build$src$core$events$utils=function(){disabled$$module$build$src$core$events$utils++};$.enable$$module$build$src$core$events$utils=function(){disabled$$module$build$src$core$events$utils--}; +isEnabled$$module$build$src$core$events$utils=function(){return disabled$$module$build$src$core$events$utils===0};$.getGroup$$module$build$src$core$events$utils=function(){return group$$module$build$src$core$events$utils};$.setGroup$$module$build$src$core$events$utils=function(a){TEST_ONLY$$module$build$src$core$events$utils.setGroupInternal(a)}; +setGroupInternal$$module$build$src$core$events$utils=function(a){group$$module$build$src$core$events$utils=typeof a==="boolean"?a?genUid$$module$build$src$core$utils$idgenerator():"":a};getDescendantIds$$module$build$src$core$events$utils=function(a){const b=[];a=a.getDescendants(!1);for(let c=0,d;d=a[c];c++)b[c]=d.id;return b}; +fromJson$$module$build$src$core$events$utils=function(a,b){const c=get$$module$build$src$core$events$utils(a.type);if(!c)throw Error("Unknown event type.");return c.fromJson(a,b)};get$$module$build$src$core$events$utils=function(a){const b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,a);if(!b)throw Error(`Event type ${a} not found in registry.`);return b}; +disableOrphans$$module$build$src$core$events$utils=function(a){if((isBlockMove$$module$build$src$core$events$predicates(a)||isBlockCreate$$module$build$src$core$events$predicates(a))&&a.workspaceId){var b=getWorkspaceById$$module$build$src$core$common(a.workspaceId);if(!a.blockId)throw Error("Encountered a blockEvent without a proper blockId");if(a=b.getBlockById(a.blockId)){const c=recordUndo$$module$build$src$core$events$utils;try{recordUndo$$module$build$src$core$events$utils=!1;const d=a.getParent(); +if(d&&!d.hasDisabledReason(ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils)){const e=a.getDescendants(!1);for(let f=0,g;g=e[f];f++)g.setDisabledReason(!1,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils)}else if((a.outputConnection||a.previousConnection)&&!b.isDragging()){do a.setDisabledReason(!0,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils),a=a.getNextBlock();while(a)}}finally{recordUndo$$module$build$src$core$events$utils=c}}}}; +createSvgElement$$module$build$src$core$utils$dom=function(a,b,c){a=document.createElementNS(SVG_NS$$module$build$src$core$utils$dom,`${a}`);for(const d in b)a.setAttribute(d,`${b[d]}`);c&&c.appendChild(a);return a};addClass$$module$build$src$core$utils$dom=function(a,b){b=b.split(" ");if(b.every(c=>a.classList.contains(c)))return!1;a.classList.add(...b);return!0};removeClasses$$module$build$src$core$utils$dom=function(a,b){a.classList.remove(...b.split(" "))}; +removeClass$$module$build$src$core$utils$dom=function(a,b){b=b.split(" ");if(b.every(c=>!a.classList.contains(c)))return!1;a.classList.remove(...b);return!0};hasClass$$module$build$src$core$utils$dom=function(a,b){return a.classList.contains(b)};removeNode$$module$build$src$core$utils$dom=function(a){return a&&a.parentNode?a.parentNode.removeChild(a):null}; +insertAfter$$module$build$src$core$utils$dom=function(a,b){const c=b.nextSibling;b=b.parentNode;if(!b)throw Error("Reference node has no parent.");c?b.insertBefore(a,c):b.appendChild(a)};setCssTransform$$module$build$src$core$utils$dom=function(a,b){a.style.transform=b;a.style["-webkit-transform"]=b}; +startTextWidthCache$$module$build$src$core$utils$dom=function(){cacheReference$$module$build$src$core$utils$dom++;cacheWidths$$module$build$src$core$utils$dom||(cacheWidths$$module$build$src$core$utils$dom=Object.create(null))};stopTextWidthCache$$module$build$src$core$utils$dom=function(){cacheReference$$module$build$src$core$utils$dom--;cacheReference$$module$build$src$core$utils$dom||(cacheWidths$$module$build$src$core$utils$dom=null)}; +getTextWidth$$module$build$src$core$utils$dom=function(a){const b=a.textContent+"\n"+a.className.baseVal;var c;if(cacheWidths$$module$build$src$core$utils$dom&&(c=cacheWidths$$module$build$src$core$utils$dom[b]))return c;c=window.getComputedStyle(a);c=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(a,c.fontSize,c.fontWeight,c.fontFamily);cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[b]=c);return c}; +getFastTextWidth$$module$build$src$core$utils$dom=function(a,b,c,d){return getFastTextWidthWithSizeString$$module$build$src$core$utils$dom(a,b+"pt",c,d)}; +getFastTextWidthWithSizeString$$module$build$src$core$utils$dom=function(a,b,c,d){const e=a.textContent;a=e+"\n"+a.className.baseVal;var f;if(cacheWidths$$module$build$src$core$utils$dom&&(f=cacheWidths$$module$build$src$core$utils$dom[a]))return f;canvasContext$$module$build$src$core$utils$dom||(f=document.createElement("canvas"),f.className="blocklyComputeCanvas",document.body.appendChild(f),canvasContext$$module$build$src$core$utils$dom=f.getContext("2d"));e&&canvasContext$$module$build$src$core$utils$dom? +(canvasContext$$module$build$src$core$utils$dom.font=c+" "+b+" "+d,f=canvasContext$$module$build$src$core$utils$dom.measureText(e).width):f=0;cacheWidths$$module$build$src$core$utils$dom&&(cacheWidths$$module$build$src$core$utils$dom[a]=f);return f}; +measureFontMetrics$$module$build$src$core$utils$dom=function(a,b,c,d){const e=document.createElement("span");e.style.font=c+" "+b+" "+d;e.textContent=a;a=document.createElement("div");a.style.width="1px";a.style.height="0";b=document.createElement("div");b.style.display="flex";b.style.position="fixed";b.style.top="0";b.style.left="0";b.appendChild(e);b.appendChild(a);document.body.appendChild(b);c={height:0,baseline:0};try{b.style.alignItems="baseline",c.baseline=a.offsetTop-e.offsetTop,b.style.alignItems= +"flex-end",c.height=a.offsetTop-e.offsetTop}finally{document.body.removeChild(b)}return c};$.getFocusManager$$module$build$src$core$focus_manager=function(){return FocusManager$$module$build$src$core$focus_manager.getFocusManager()};isFocusableNode$$module$build$src$core$interfaces$i_focusable_node=function(a){return a&&typeof a.getFocusableElement==="function"&&typeof a.getFocusableTree==="function"&&typeof a.onNodeFocus==="function"&&typeof a.onNodeBlur==="function"&&typeof a.canBeFocused==="function"}; +isSelectable$$module$build$src$core$interfaces$i_selectable=function(a){return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(a)&&typeof a.id==="string"&&typeof a.workspace==="object"&&typeof a.select==="function"&&typeof a.unselect==="function"}; +deepMerge$$module$build$src$core$utils$object=function(a,b){for(const c in b)b[c]!==null&&Array.isArray(b[c])?a[c]=deepMerge$$module$build$src$core$utils$object(a[c]||[],b[c]):a[c]=b[c]!==null&&typeof b[c]==="object"?deepMerge$$module$build$src$core$utils$object(a[c]||Object.create(null),b[c]):b[c];return a};getWorkspaceById$$module$build$src$core$common=function(a){return WorkspaceDB_$$module$build$src$core$common[a]||null}; +getAllWorkspaces$$module$build$src$core$common=function(){const a=[];for(const b in WorkspaceDB_$$module$build$src$core$common)a.push(WorkspaceDB_$$module$build$src$core$common[b]);return a};registerWorkspace$$module$build$src$core$common=function(a){WorkspaceDB_$$module$build$src$core$common[a.id]=a};unregisterWorkpace$$module$build$src$core$common=function(a){delete WorkspaceDB_$$module$build$src$core$common[a.id]};getMainWorkspace$$module$build$src$core$common=function(){return mainWorkspace$$module$build$src$core$common}; +setMainWorkspace$$module$build$src$core$common=function(a){mainWorkspace$$module$build$src$core$common=a};getSelected$$module$build$src$core$common=function(){const a=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();return a&&isSelectable$$module$build$src$core$interfaces$i_selectable(a)?a:null};setSelected$$module$build$src$core$common=function(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}; +fireSelectedEvent$$module$build$src$core$common=function(a){const b=getSelected$$module$build$src$core$common();let c,d,e,f;const g=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.SELECTED))((c=b==null?void 0:b.id)!=null?c:null,(d=a==null?void 0:a.id)!=null?d:null,(f=(e=a==null?void 0:a.workspace.id)!=null?e:b==null?void 0:b.workspace.id)!=null?f:"");fire$$module$build$src$core$events$utils(g)};getParentContainer$$module$build$src$core$common=function(){return parentContainer$$module$build$src$core$common}; +setParentContainer$$module$build$src$core$common=function(a){parentContainer$$module$build$src$core$common=a}; +svgResize$$module$build$src$core$common=function(a){for(;a.options.parentWorkspace;)a=a.options.parentWorkspace;const b=a.getParentSvg(),c=a.getCachedParentSvgSize();var d=b.parentElement;if(d instanceof HTMLElement){var e=d.offsetWidth;d=d.offsetHeight;c.width!==e&&(b.setAttribute("width",e+"px"),a.setCachedParentSvgSize(e,null));c.height!==d&&(b.setAttribute("height",d+"px"),a.setCachedParentSvgSize(null,d));a.resize()}}; +getBlockTypeCounts$$module$build$src$core$common=function(a,b){const c=Object.create(null),d=a.getDescendants(!0);b&&(a=a.getNextBlock())&&(a=d.indexOf(a),d.splice(a,d.length-a));for(let e=0,f;f=d[e];e++)c[f.type]?c[f.type]++:c[f.type]=1;return c};jsonInitFactory$$module$build$src$core$common=function(a){return function(){this.jsonInit(a)}};defineBlocksWithJsonArray$$module$build$src$core$common=function(a){TEST_ONLY$$module$build$src$core$common.defineBlocksWithJsonArrayInternal(a)}; +defineBlocksWithJsonArrayInternal$$module$build$src$core$common=function(a){$.defineBlocks$$module$build$src$core$common($.createBlockDefinitionsFromJsonArray$$module$build$src$core$common(a))}; +$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common=function(a){const b={};for(let c=0;c>>/g,a),content$$module$build$src$core$css="",a=document.createElement("style"),a.id="blockly-common-style",b=document.createTextNode(b),a.appendChild(b),document.head.insertBefore(a,document.head.firstChild)))};getSize$$module$build$src$core$utils$style=function(a){return TEST_ONLY$$module$build$src$core$utils$style.getSizeInternal(a)}; +getSizeInternal$$module$build$src$core$utils$style=function(a){if(getComputedStyle$$module$build$src$core$utils$style(a,"display")!=="none")return getSizeWithDisplay$$module$build$src$core$utils$style(a);const b=a.style,c=b.display,d=b.visibility,e=b.position;b.visibility="hidden";b.position="absolute";b.display="inline";const f=a.offsetWidth;a=a.offsetHeight;b.display=c;b.position=e;b.visibility=d;return new Size$$module$build$src$core$utils$size(f,a)}; +getSizeWithDisplay$$module$build$src$core$utils$style=function(a){return new Size$$module$build$src$core$utils$size(a.offsetWidth,a.offsetHeight)};getComputedStyle$$module$build$src$core$utils$style=function(a,b){a=window.getComputedStyle(a);return a[b]||a.getPropertyValue(b)}; +getPageOffset$$module$build$src$core$utils$style=function(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(0,0);a=a.getBoundingClientRect();var c=document.documentElement;c=new Coordinate$$module$build$src$core$utils$coordinate(window.pageXOffset||c.scrollLeft,window.pageYOffset||c.scrollTop);b.x=a.left+c.x;b.y=a.top+c.y;return b}; +getViewportPageOffset$$module$build$src$core$utils$style=function(){const a=document.body,b=document.documentElement;return new Coordinate$$module$build$src$core$utils$coordinate(a.scrollLeft||b.scrollLeft,a.scrollTop||b.scrollTop)}; +getBorderBox$$module$build$src$core$utils$style=function(a){const b=parseFloat(getComputedStyle$$module$build$src$core$utils$style(a,"borderLeftWidth")),c=parseFloat(getComputedStyle$$module$build$src$core$utils$style(a,"borderRightWidth")),d=parseFloat(getComputedStyle$$module$build$src$core$utils$style(a,"borderTopWidth"));a=parseFloat(getComputedStyle$$module$build$src$core$utils$style(a,"borderBottomWidth"));return new Rect$$module$build$src$core$utils$rect(d,a,b,c)}; +scrollIntoContainerView$$module$build$src$core$utils$style=function(a,b,c){a=getContainerOffsetToScrollInto$$module$build$src$core$utils$style(a,b,c);b.scrollLeft=a.x;b.scrollTop=a.y}; +getContainerOffsetToScrollInto$$module$build$src$core$utils$style=function(a,b,c){var d=getPageOffset$$module$build$src$core$utils$style(a),e=getPageOffset$$module$build$src$core$utils$style(b),f=getBorderBox$$module$build$src$core$utils$style(b);const g=d.x-e.x-f.left;d=d.y-e.y-f.top;e=getSizeWithDisplay$$module$build$src$core$utils$style(a);a=b.clientWidth-e.width;e=b.clientHeight-e.height;f=b.scrollLeft;b=b.scrollTop;c?(f+=g-a/2,b+=d-e/2):(f+=Math.min(g,Math.max(g-a,0)),b+=Math.min(d,Math.max(d- +e,0)));return new Coordinate$$module$build$src$core$utils$coordinate(f,b)}; +getRelativeXY$$module$build$src$core$utils$svg_math=function(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(0,0);var c=a.x&&a.getAttribute("x");const d=a.y&&a.getAttribute("y");c&&(b.x=parseInt(c));d&&(b.y=parseInt(d));if(c=(c=a.getAttribute("transform"))&&c.match(XY_REGEX$$module$build$src$core$utils$svg_math))b.x+=Number(c[1]),c[3]&&(b.y+=Number(c[3]));(a=a.getAttribute("style"))&&a.includes("translate")&&(a=a.match(XY_STYLE_REGEX$$module$build$src$core$utils$svg_math))&&(b.x+= +Number(a[1]),a[3]&&(b.y+=Number(a[3])));return b};getInjectionDivXY$$module$build$src$core$utils$svg_math=function(a){let b=0,c=0;for(;a;){const d=getRelativeXY$$module$build$src$core$utils$svg_math(a);b+=d.x;c+=d.y;if((" "+(a.getAttribute("class")||"")+" ").includes(" injectionDiv "))break;a=a.parentNode}return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}; +getViewportBBox$$module$build$src$core$utils$svg_math=function(){const a=getViewportPageOffset$$module$build$src$core$utils$style();return new Rect$$module$build$src$core$utils$rect(a.y,document.documentElement.clientHeight+a.y,a.x,document.documentElement.clientWidth+a.x)};getDocumentScroll$$module$build$src$core$utils$svg_math=function(){const a=document.documentElement,b=window;return new Coordinate$$module$build$src$core$utils$coordinate(b.pageXOffset||a.scrollLeft,b.pageYOffset||a.scrollTop)}; +screenToWsCoordinates$$module$build$src$core$utils$svg_math=function(a,b){var c=b.x;b=b.y;const d=a.getInjectionDiv().getBoundingClientRect();c=new Coordinate$$module$build$src$core$utils$coordinate(c-d.left,b-d.top);b=a.getOriginOffsetInPixels();return Coordinate$$module$build$src$core$utils$coordinate.difference(c,b).scale(1/a.scale)}; +wsToScreenCoordinates$$module$build$src$core$utils$svg_math=function(a,b){var c=b.scale(a.scale);b=c.x;c=c.y;const d=a.getInjectionDiv().getBoundingClientRect();a=a.getOriginOffsetInPixels();return new Coordinate$$module$build$src$core$utils$coordinate(b+d.left+a.x,c+d.top+a.y)}; +injectDependencies$$module$build$src$core$utils$xml=function(a){({document:document$$module$build$src$core$utils$xml=document$$module$build$src$core$utils$xml,DOMParser:DOMParser$$module$build$src$core$utils$xml=DOMParser$$module$build$src$core$utils$xml,XMLSerializer:XMLSerializer$$module$build$src$core$utils$xml=XMLSerializer$$module$build$src$core$utils$xml}=a);domParser$$module$build$src$core$utils$xml=new DOMParser$$module$build$src$core$utils$xml;xmlSerializer$$module$build$src$core$utils$xml= +new XMLSerializer$$module$build$src$core$utils$xml};$.createElement$$module$build$src$core$utils$xml=function(a){return document$$module$build$src$core$utils$xml.createElementNS(NAME_SPACE$$module$build$src$core$utils$xml,a)};$.createTextNode$$module$build$src$core$utils$xml=function(a){return document$$module$build$src$core$utils$xml.createTextNode(a)}; +$.textToDom$$module$build$src$core$utils$xml=function(a){let b=domParser$$module$build$src$core$utils$xml.parseFromString(a,"text/xml");if(b&&b.documentElement&&!b.getElementsByTagName("parsererror").length)return b.documentElement;if((b=domParser$$module$build$src$core$utils$xml.parseFromString(a,"text/html"))&&b.body.firstChild&&b.body.firstChild.nodeName.toLowerCase()==="xml")return b.body.firstChild;throw Error(`DOMParser was unable to parse: ${a}`);}; +domToText$$module$build$src$core$utils$xml=function(a){return sanitizeText$$module$build$src$core$utils$xml(xmlSerializer$$module$build$src$core$utils$xml.serializeToString(a))};sanitizeText$$module$build$src$core$utils$xml=function(a){return a.replace(INVALID_CONTROL_CHARS$$module$build$src$core$utils$xml,b=>`&#${b.charCodeAt(0)};`)}; +convertToolboxDefToJson$$module$build$src$core$utils$toolbox=function(a){if(!a)return null;if(a instanceof Element||typeof a==="string")a=parseToolboxTree$$module$build$src$core$utils$toolbox(a),a=convertToToolboxJson$$module$build$src$core$utils$toolbox(a);validateToolbox$$module$build$src$core$utils$toolbox(a);return a}; +validateToolbox$$module$build$src$core$utils$toolbox=function(a){const b=a.kind;a=a.contents;if(b&&b!==FLYOUT_TOOLBOX_KIND$$module$build$src$core$utils$toolbox&&b!==CATEGORY_TOOLBOX_KIND$$module$build$src$core$utils$toolbox)throw Error("Invalid toolbox kind "+b+". Please supply either "+FLYOUT_TOOLBOX_KIND$$module$build$src$core$utils$toolbox+" or "+CATEGORY_TOOLBOX_KIND$$module$build$src$core$utils$toolbox);if(!a)throw Error("Toolbox must have a contents attribute.");}; +convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox=function(a){return a?a.contents?a.contents:Array.isArray(a)&&a.length>0&&!a[0].nodeType?a:xmlToJsonArray$$module$build$src$core$utils$toolbox(a):[]};hasCategories$$module$build$src$core$utils$toolbox=function(a){return TEST_ONLY$$module$build$src$core$utils$toolbox.hasCategoriesInternal(a)}; +hasCategoriesInternal$$module$build$src$core$utils$toolbox=function(a){if(!a)return!1;const b=a.kind;return b?b===CATEGORY_TOOLBOX_KIND$$module$build$src$core$utils$toolbox:!!a.contents.filter(c=>c.kind.toUpperCase()==="CATEGORY").length};isCategoryCollapsible$$module$build$src$core$utils$toolbox=function(a){return a&&a.contents?!!a.contents.filter(function(b){return b.kind.toUpperCase()==="CATEGORY"}).length:!1}; +convertToToolboxJson$$module$build$src$core$utils$toolbox=function(a){const b={contents:xmlToJsonArray$$module$build$src$core$utils$toolbox(a)};a instanceof Node&&addAttributes$$module$build$src$core$utils$toolbox(a,b);return b}; +xmlToJsonArray$$module$build$src$core$utils$toolbox=function(a){const b=[];let c=a.childNodes;c||(c=a);for(let d=0,e;e=c[d];d++){if(!e.tagName)continue;a={};const f=e.tagName.toUpperCase();a.kind=f;f==="BLOCK"?a.blockxml=e:e.childNodes&&e.childNodes.length>0&&(a.contents=xmlToJsonArray$$module$build$src$core$utils$toolbox(e));addAttributes$$module$build$src$core$utils$toolbox(e,a);b.push(a)}return b}; +addAttributes$$module$build$src$core$utils$toolbox=function(a,b){for(let c=0;c document.");}else a instanceof Element&&(b=a);return b}; +getStartPositionRect$$module$build$src$core$positionable_helpers=function(a,b,c,d,e,f){const g=f.scrollbar&&f.scrollbar.canScrollVertically();a.horizontal===horizontalPosition$$module$build$src$core$positionable_helpers.LEFT?(c=e.absoluteMetrics.left+c,g&&f.RTL&&(c+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness)):(c=e.absoluteMetrics.left+e.viewMetrics.width-b.width-c,g&&!f.RTL&&(c-=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness));a.vertical===verticalPosition$$module$build$src$core$positionable_helpers.TOP? +a=e.absoluteMetrics.top+d:(a=e.absoluteMetrics.top+e.viewMetrics.height-b.height-d,f.scrollbar&&f.scrollbar.canScrollHorizontally()&&(a-=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness));return new Rect$$module$build$src$core$utils$rect(a,a+b.height,c,c+b.width)}; +getCornerOppositeToolbox$$module$build$src$core$positionable_helpers=function(a,b){return{horizontal:b.toolboxMetrics.position===Position$$module$build$src$core$utils$toolbox.LEFT||a.horizontalLayout&&!a.RTL?horizontalPosition$$module$build$src$core$positionable_helpers.RIGHT:horizontalPosition$$module$build$src$core$positionable_helpers.LEFT,vertical:b.toolboxMetrics.position===Position$$module$build$src$core$utils$toolbox.BOTTOM?verticalPosition$$module$build$src$core$positionable_helpers.TOP:verticalPosition$$module$build$src$core$positionable_helpers.BOTTOM}}; +bumpPositionRect$$module$build$src$core$positionable_helpers=function(a,b,c,d){const e=a.left,f=a.right-a.left,g=a.bottom-a.top;for(let h=0;hf.id!==a.id).map(f=>f.getRelativeToSurfaceXY());for(;commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster(Coordinate$$module$build$src$core$utils$coordinate.sum(c,d),e);)d.translate(b.RTL?-30:30,30);a.moveTo(Coordinate$$module$build$src$core$utils$coordinate.sum(c, +d))};commentOverlapsOtherExactly$$module$build$src$core$clipboard$workspace_comment_paster=function(a,b){return b.some(c=>Math.abs(c.x-a.x)<=1&&Math.abs(c.y-a.y)<=1)};setRole$$module$build$src$core$utils$aria=function(a,b){a.setAttribute(ROLE_ATTRIBUTE$$module$build$src$core$utils$aria,b)};setState$$module$build$src$core$utils$aria=function(a,b,c){Array.isArray(c)&&(c=c.join(" "));a.setAttribute(ARIA_PREFIX$$module$build$src$core$utils$aria+b,`${c}`)}; +isSerializable$$module$build$src$core$interfaces$i_serializable=function(a){return a&&typeof a.saveState==="function"&&typeof a.loadState==="function"}; +queueRender$$module$build$src$core$render_management=function(a){queueBlock$$module$build$src$core$render_management(a);if(alwaysImmediatelyRender$$module$build$src$core$render_management())return doRenders$$module$build$src$core$render_management(),Promise.resolve();afterRendersPromise$$module$build$src$core$render_management||(afterRendersPromise$$module$build$src$core$render_management=new Promise(b=>{afterRendersResolver$$module$build$src$core$render_management=b;animationRequestId$$module$build$src$core$render_management= +window.requestAnimationFrame(()=>{doRenders$$module$build$src$core$render_management();b()})}));return afterRendersPromise$$module$build$src$core$render_management};finishQueuedRenders$$module$build$src$core$render_management=function(){return afterRendersPromise$$module$build$src$core$render_management?afterRendersPromise$$module$build$src$core$render_management:Promise.resolve()}; +triggerQueuedRenders$$module$build$src$core$render_management=function(a){a||window.cancelAnimationFrame(animationRequestId$$module$build$src$core$render_management);doRenders$$module$build$src$core$render_management(a);!a&&afterRendersResolver$$module$build$src$core$render_management&&afterRendersResolver$$module$build$src$core$render_management()};alwaysImmediatelyRender$$module$build$src$core$render_management=function(){return JavaFx$$module$build$src$core$utils$useragent}; +queueBlock$$module$build$src$core$render_management=function(a){dirtyBlocks$$module$build$src$core$render_management.add(a);eventGroups$$module$build$src$core$render_management.set(a,$.getGroup$$module$build$src$core$events$utils());const b=a.getParent();b?queueBlock$$module$build$src$core$render_management(b):rootBlocks$$module$build$src$core$render_management.add(a)}; +doRenders$$module$build$src$core$render_management=function(a){const b=a?new Set([a]):new Set([...rootBlocks$$module$build$src$core$render_management].map(f=>f.workspace)),c=[...rootBlocks$$module$build$src$core$render_management].filter(shouldRenderRootBlock$$module$build$src$core$render_management).filter(f=>b.has(f.workspace));for(var d of c)renderBlock$$module$build$src$core$render_management(d);for(const f of b)f.resizeContents();for(var e of c)d=e.getRelativeToSurfaceXY(),e.updateComponentLocations(d); +for(const f of c)e=$.getGroup$$module$build$src$core$events$utils(),(d=eventGroups$$module$build$src$core$render_management.get(f))&&$.setGroup$$module$build$src$core$events$utils(d),f.bumpNeighbours(),$.setGroup$$module$build$src$core$events$utils(e);for(const f of c)dequeueBlock$$module$build$src$core$render_management(f);a||(afterRendersPromise$$module$build$src$core$render_management=null)}; +dequeueBlock$$module$build$src$core$render_management=function(a){rootBlocks$$module$build$src$core$render_management.delete(a);dirtyBlocks$$module$build$src$core$render_management.delete(a);eventGroups$$module$build$src$core$render_management.delete(a);for(const b of a.getChildren(!1))dequeueBlock$$module$build$src$core$render_management(b)};shouldRenderRootBlock$$module$build$src$core$render_management=function(a){return!a.isDisposed()&&!a.getParent()}; +renderBlock$$module$build$src$core$render_management=function(a){if(dirtyBlocks$$module$build$src$core$render_management.has(a)&&a.initialized){for(const b of a.getChildren(!1))renderBlock$$module$build$src$core$render_management(b);a.renderEfficiently()}};alert$$module$build$src$core$dialog=function(a,b){alertImplementation$$module$build$src$core$dialog(a,b)}; +setAlert$$module$build$src$core$dialog=function(a=defaultAlert$$module$build$src$core$dialog){alertImplementation$$module$build$src$core$dialog=a};confirm$$module$build$src$core$dialog=function(a,b){confirmImplementation$$module$build$src$core$dialog(a,b)};setConfirm$$module$build$src$core$dialog=function(a=defaultConfirm$$module$build$src$core$dialog){confirmImplementation$$module$build$src$core$dialog=a}; +prompt$$module$build$src$core$dialog=function(a,b,c){promptImplementation$$module$build$src$core$dialog(a,b,c)};setPrompt$$module$build$src$core$dialog=function(a=defaultPrompt$$module$build$src$core$dialog){promptImplementation$$module$build$src$core$dialog=a};toast$$module$build$src$core$dialog=function(a,b){toastImplementation$$module$build$src$core$dialog(a,b)}; +setToast$$module$build$src$core$dialog=function(a=defaultToast$$module$build$src$core$dialog){toastImplementation$$module$build$src$core$dialog=a};isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return a&&typeof a.getProcedureDef==="function"};isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks=function(a){return a&&typeof a.getProcedureCall==="function"&&typeof a.renameProcedure==="function"}; +isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model=function(a){return a.getVariableModel!==void 0};warn$$module$build$src$core$utils$deprecation=function(a,b,c,d){a=a+" was deprecated in "+b+" and will be deleted in "+c+".";d&&(a+="\nUse "+d+" instead.");previousWarnings$$module$build$src$core$utils$deprecation.has(a)||(previousWarnings$$module$build$src$core$utils$deprecation.add(a),console.warn(a))}; +$.allUsedVarModels$$module$build$src$core$variables=function(a){a=a.getAllBlocks(!1);const b=new Set;for(let c=0;c({kind:"block",type:d,gap:8,fields:generateVariableFieldJson$$module$build$src$core$variables(g)})));return a}; +xmlFlyoutCategory$$module$build$src$core$variables=function(a){let b=[];const c=document.createElement("button");c.setAttribute("text","%{BKY_NEW_VARIABLE}");c.setAttribute("callbackKey","CREATE_VARIABLE");a.registerButtonCallback("CREATE_VARIABLE",function(d){createVariableButtonHandler$$module$build$src$core$variables(d.getTargetWorkspace())});b.push(c);a=flyoutCategoryBlocks$$module$build$src$core$variables(a);return b=b.concat(a)}; +flyoutCategoryBlocks$$module$build$src$core$variables=function(a){a=a.getVariableMap().getVariablesOfType("");const b=[];if(a.length>0){var c=a[a.length-1];if(Blocks$$module$build$src$core$blocks.variables_set){var d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","variables_set");d.setAttribute("gap",Blocks$$module$build$src$core$blocks.math_change?"8":"24");d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c));b.push(d)}Blocks$$module$build$src$core$blocks.math_change&& +(d=$.createElement$$module$build$src$core$utils$xml("block"),d.setAttribute("type","math_change"),d.setAttribute("gap",Blocks$$module$build$src$core$blocks.variables_get?"20":"8"),d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c)),c=$.textToDom$$module$build$src$core$utils$xml('1'),d.appendChild(c),b.push(d));if(Blocks$$module$build$src$core$blocks.variables_get){a.sort(compareByName$$module$build$src$core$variables); +for(let e=0,f;f=a[e];e++)c=$.createElement$$module$build$src$core$utils$xml("block"),c.setAttribute("type","variables_get"),c.setAttribute("gap","8"),c.appendChild(generateVariableFieldDom$$module$build$src$core$variables(f)),b.push(c)}}return b};generateUniqueName$$module$build$src$core$variables=function(a){return TEST_ONLY$$module$build$src$core$variables.generateUniqueNameInternal(a)}; +generateUniqueNameInternal$$module$build$src$core$variables=function(a){return generateUniqueNameFromOptions$$module$build$src$core$variables(VAR_LETTER_OPTIONS$$module$build$src$core$variables.charAt(0),a.getVariableMap().getAllVariables().map(b=>b.getName()))}; +generateUniqueNameFromOptions$$module$build$src$core$variables=function(a,b){if(!b.length)return a;const c=VAR_LETTER_OPTIONS$$module$build$src$core$variables;let d="",e=c.indexOf(a);for(;;){let f=!1;for(let g=0;gf.getVariableModel().getName());if(d&&(c=d.some(f=>f.toLowerCase()===a),d=d.some(f=>f.toLowerCase()===b),c&&d))return e.getName()}return null}; +checkForConflictingParamWithLegacyProcedures$$module$build$src$core$variables=function(a,b,c){a=a.toLowerCase();b=b.toLowerCase();c=c.getAllBlocks(!1);for(const e of c){if(!isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(e))continue;c=e.getProcedureDef();var d=c[1];const f=d.some(g=>g.toLowerCase()===a);d=d.some(g=>g.toLowerCase()===b);if(f&&d)return c[0]}return null}; +generateVariableFieldDom$$module$build$src$core$variables=function(a){const b=$.createElement$$module$build$src$core$utils$xml("field");b.setAttribute("name","VAR");b.setAttribute("id",a.getId());b.setAttribute("variabletype",a.getType());a=$.createTextNode$$module$build$src$core$utils$xml(a.getName());b.appendChild(a);return b}; +$.getOrCreateVariablePackage$$module$build$src$core$variables=function(a,b,c,d){let e=$.getVariable$$module$build$src$core$variables(a,b,c,d);e||(e=createVariable$$module$build$src$core$variables(a,b,c,d));return e}; +$.getVariable$$module$build$src$core$variables=function(a,b,c,d){const e=a.getPotentialVariableMap();let f=null;if(b&&(f=a.getVariableById(b),!f&&e&&(f=e.getVariableById(b)),f))return f;if(c){if(d===void 0)throw Error("Tried to look up a variable by name without a type");f=a.getVariable(c,d);!f&&e&&(f=e.getVariable(c,d))}return f}; +createVariable$$module$build$src$core$variables=function(a,b,c,d){const e=a.getVariableMap(),f=a.getPotentialVariableMap();c||(c=generateUniqueName$$module$build$src$core$variables(a.isFlyout?a.targetWorkspace:a));return f?f.createVariable(c,d,b!=null?b:void 0):e.createVariable(c,d,b)};getAddedVariables$$module$build$src$core$variables=function(a,b){a=a.getAllVariables();const c=[];if(b.length!==a.length)for(let d=0;d=0;f--){const g=e[f];if(g.type==="procedures_defnoreturn"||g.type==="procedures_defreturn"){c=String(g.getFieldValue("NAME"));d=$.Msg$$module$build$src$core$msg.CANNOT_DELETE_VARIABLE_PROCEDURE.replace("%1",d).replace("%2",c);alert$$module$build$src$core$dialog(d);return}g===c&&e.splice(f,1)}c&&e.length||e.length>1?(d= +$.Msg$$module$build$src$core$msg.DELETE_VARIABLE_CONFIRMATION.replace("%1",String(e.length+(c&&!c.workspace.isFlyout?1:0))).replace("%2",d),confirm$$module$build$src$core$dialog(d,f=>{f&&b&&a.getVariableMap().deleteVariable(b)})):a.getVariableMap().deleteVariable(b)}; +save$$module$build$src$core$serialization$blocks=function(a,{addCoordinates:b=!1,addInputBlocks:c=!0,addNextBlocks:d=!0,doFullSerialization:e=!0,saveIds:f=!0}={}){if(a.isInsertionMarker())return null;const g={type:a.type,id:f?a.id:void 0};b&&saveCoords$$module$build$src$core$serialization$blocks(a,g);saveAttributes$$module$build$src$core$serialization$blocks(a,g);saveExtraState$$module$build$src$core$serialization$blocks(a,g,e);saveIcons$$module$build$src$core$serialization$blocks(a,g,e);saveFields$$module$build$src$core$serialization$blocks(a, +g,e);c&&saveInputBlocks$$module$build$src$core$serialization$blocks(a,g,e,f);d&&saveNextBlocks$$module$build$src$core$serialization$blocks(a,g,e,f);return g}; +saveAttributes$$module$build$src$core$serialization$blocks=function(a,b){a.isCollapsed()&&(b.collapsed=!0);a.isEnabled()||(b.disabledReasons=Array.from(a.getDisabledReasons()));a.isOwnDeletable()||(b.deletable=!1);a.isOwnMovable()||(b.movable=!1);a.isOwnEditable()||(b.editable=!1);a.inputsInline!==void 0&&a.inputsInline!==a.inputsInlineDefault&&(b.inline=a.inputsInline);a.data&&(b.data=a.data)}; +saveCoords$$module$build$src$core$serialization$blocks=function(a,b){const c=a.workspace;a=a.getRelativeToSurfaceXY();b.x=Math.round(c.RTL?c.getWidth()-a.x:a.x);b.y=Math.round(a.y)};saveExtraState$$module$build$src$core$serialization$blocks=function(a,b,c){a.saveExtraState?(a=a.saveExtraState(c),a!==null&&(b.extraState=a)):a.mutationToDom&&(a=a.mutationToDom(),a!==null&&(b.extraState=domToText$$module$build$src$core$xml(a).replace(' xmlns="https://developers.google.com/blockly/xml"',"")))}; +saveIcons$$module$build$src$core$serialization$blocks=function(a,b,c){const d=Object.create(null);for(const e of a.getIcons())isSerializable$$module$build$src$core$interfaces$i_serializable(e)&&(a=e.saveState(c))&&(d[e.getType().toString()]=a);Object.keys(d).length&&(b.icons=d)};saveFields$$module$build$src$core$serialization$blocks=function(a,b,c){const d=Object.create(null);for(const e of a.getFields())e.isSerializable()&&(d[e.name]=e.saveState(c));Object.keys(d).length&&(b.fields=d)}; +saveInputBlocks$$module$build$src$core$serialization$blocks=function(a,b,c,d){const e=Object.create(null);for(let f=0;f{k.disposed||k.setConnectionTracking(!0)}, +1)}return h}; +appendPrivate$$module$build$src$core$serialization$blocks=function(a,b,{parentConnection:c,isShadow:d=!1}={}){if(!a.type)throw new MissingBlockType$$module$build$src$core$serialization$exceptions(a);const e=b.newBlock(a.type,a.id);e.setShadow(d);loadCoords$$module$build$src$core$serialization$blocks(e,a);loadAttributes$$module$build$src$core$serialization$blocks(e,a);loadExtraState$$module$build$src$core$serialization$blocks(e,a);tryToConnectParent$$module$build$src$core$serialization$blocks(c,e, +a);loadIcons$$module$build$src$core$serialization$blocks(e,a);loadFields$$module$build$src$core$serialization$blocks(e,a);loadInputBlocks$$module$build$src$core$serialization$blocks(e,a);loadNextBlocks$$module$build$src$core$serialization$blocks(e,a);initBlock$$module$build$src$core$serialization$blocks(e,b.rendered);return e}; +checkNewVariables$$module$build$src$core$serialization$blocks=function(a,b){if(isEnabled$$module$build$src$core$events$utils())for(a=getAddedVariables$$module$build$src$core$variables(a,b),b=0;bb&&(b=c[d].length);var e=-Infinity;let f,g=1;do{d=e;f=a;a=[];e=c.length/g;let h=1;for(let k=0;kd);return f}; +wrapScore$$module$build$src$core$utils$string=function(a,b,c){const d=[0],e=[];for(var f=0;f1&&d[d.length-1]<=d[d.length-2]&&(b+=.5);return b}; +wrapMutate$$module$build$src$core$utils$string=function(a,b,c){let d=wrapScore$$module$build$src$core$utils$string(a,b,c),e;for(let f=0;fd&&(d=h,e=g)}return e?wrapMutate$$module$build$src$core$utils$string(a,e,c):b}; +wrapToText$$module$build$src$core$utils$string=function(a,b){const c=[];for(let d=0;dRADIUS_OK$$module$build$src$core$tooltip&&hide$$module$build$src$core$tooltip()}else poisonedElement$$module$build$src$core$tooltip!==element$$module$build$src$core$tooltip&& +(clearTimeout(showPid$$module$build$src$core$tooltip),lastX$$module$build$src$core$tooltip=a.pageX,lastY$$module$build$src$core$tooltip=a.pageY,showPid$$module$build$src$core$tooltip=setTimeout(show$$module$build$src$core$tooltip,HOVER_MS$$module$build$src$core$tooltip))};dispose$$module$build$src$core$tooltip=function(){poisonedElement$$module$build$src$core$tooltip=element$$module$build$src$core$tooltip=null;hide$$module$build$src$core$tooltip()}; +hide$$module$build$src$core$tooltip=function(){visible$$module$build$src$core$tooltip&&(visible$$module$build$src$core$tooltip=!1,containerDiv$$module$build$src$core$tooltip&&(containerDiv$$module$build$src$core$tooltip.style.display="none"));showPid$$module$build$src$core$tooltip&&(clearTimeout(showPid$$module$build$src$core$tooltip),showPid$$module$build$src$core$tooltip=0)}; +block$$module$build$src$core$tooltip=function(){hide$$module$build$src$core$tooltip();blocked$$module$build$src$core$tooltip=!0};unblock$$module$build$src$core$tooltip=function(){blocked$$module$build$src$core$tooltip=!1}; +renderContent$$module$build$src$core$tooltip=function(){containerDiv$$module$build$src$core$tooltip&&element$$module$build$src$core$tooltip&&(typeof customTooltip$$module$build$src$core$tooltip==="function"?customTooltip$$module$build$src$core$tooltip(containerDiv$$module$build$src$core$tooltip,element$$module$build$src$core$tooltip):renderDefaultContent$$module$build$src$core$tooltip())}; +renderDefaultContent$$module$build$src$core$tooltip=function(){var a=getTooltipOfObject$$module$build$src$core$tooltip(element$$module$build$src$core$tooltip);a=$.wrap$$module$build$src$core$utils$string(a,LIMIT$$module$build$src$core$tooltip);a=a.split("\n");for(let b=0;bc+window.scrollY&&(e-=containerDiv$$module$build$src$core$tooltip.offsetHeight+ +2*OFFSET_Y$$module$build$src$core$tooltip);a?d=Math.max(MARGINS$$module$build$src$core$tooltip-window.scrollX,d):d+containerDiv$$module$build$src$core$tooltip.offsetWidth>b+window.scrollX-2*MARGINS$$module$build$src$core$tooltip&&(d=b-containerDiv$$module$build$src$core$tooltip.offsetWidth-2*MARGINS$$module$build$src$core$tooltip);return{x:d,y:e}}; +show$$module$build$src$core$tooltip=function(){if(!blocked$$module$build$src$core$tooltip&&(poisonedElement$$module$build$src$core$tooltip=element$$module$build$src$core$tooltip,containerDiv$$module$build$src$core$tooltip)){containerDiv$$module$build$src$core$tooltip.textContent="";renderContent$$module$build$src$core$tooltip();var a=element$$module$build$src$core$tooltip.RTL;containerDiv$$module$build$src$core$tooltip.style.direction=a?"rtl":"ltr";containerDiv$$module$build$src$core$tooltip.style.display= +"block";visible$$module$build$src$core$tooltip=!0;var {x:b,y:c}=getPosition$$module$build$src$core$tooltip(a);containerDiv$$module$build$src$core$tooltip.style.left=b+"px";containerDiv$$module$build$src$core$tooltip.style.top=c+"px"}};getHsvSaturation$$module$build$src$core$utils$colour=function(){return hsvSaturation$$module$build$src$core$utils$colour};setHsvSaturation$$module$build$src$core$utils$colour=function(a){hsvSaturation$$module$build$src$core$utils$colour=a}; +getHsvValue$$module$build$src$core$utils$colour=function(){return hsvValue$$module$build$src$core$utils$colour};setHsvValue$$module$build$src$core$utils$colour=function(a){hsvValue$$module$build$src$core$utils$colour=a}; +parse$$module$build$src$core$utils$colour=function(a){a=`${a}`.toLowerCase().trim();var b=names$$module$build$src$core$utils$colour[a];if(b)return b;b=a.substring(0,2)==="0x"?"#"+a.substring(2):a;b=b[0]==="#"?b:"#"+b;if(/^#[0-9a-f]{6}$/.test(b))return b;if(/^#[0-9a-f]{3}$/.test(b))return["#",b[1],b[1],b[2],b[2],b[3],b[3]].join("");var c=a.match(/^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/);return c&&(a=Number(c[1]),b=Number(c[2]),c=Number(c[3]),a>=0&&a<256&&b>=0&&b<256&&c>=0&&c<256)?rgbToHex$$module$build$src$core$utils$colour(a, +b,c):null};rgbToHex$$module$build$src$core$utils$colour=function(a,b,c){b=a<<16|b<<8|c;return a<16?"#"+(16777216|b).toString(16).substr(1):"#"+b.toString(16)};hexToRgb$$module$build$src$core$utils$colour=function(a){a=parse$$module$build$src$core$utils$colour(a);if(!a)return[0,0,0];a=parseInt(a.substr(1),16);return[a>>16,a>>8&255,a&255]}; +hsvToHex$$module$build$src$core$utils$colour=function(a,b,c){let d=0,e=0,f=0;if(b===0)f=e=d=c;else{const g=Math.floor(a/60),h=a/60-g;a=c*(1-b);const k=c*(1-b*h);b=c*(1-b*(1-h));switch(g){case 1:d=k;e=c;f=a;break;case 2:d=a;e=c;f=b;break;case 3:d=a;e=k;f=c;break;case 4:d=b;e=a;f=c;break;case 5:d=c;e=a;f=k;break;case 6:case 0:d=c,e=b,f=a}}return rgbToHex$$module$build$src$core$utils$colour(Math.floor(d),Math.floor(e),Math.floor(f))}; +blend$$module$build$src$core$utils$colour=function(a,b,c){a=parse$$module$build$src$core$utils$colour(a);if(!a)return null;b=parse$$module$build$src$core$utils$colour(b);if(!b)return null;a=hexToRgb$$module$build$src$core$utils$colour(a);b=hexToRgb$$module$build$src$core$utils$colour(b);return rgbToHex$$module$build$src$core$utils$colour(Math.round(b[0]+c*(a[0]-b[0])),Math.round(b[1]+c*(a[1]-b[1])),Math.round(b[2]+c*(a[2]-b[2])))}; +hueToHex$$module$build$src$core$utils$colour=function(a){return hsvToHex$$module$build$src$core$utils$colour(a,hsvSaturation$$module$build$src$core$utils$colour,hsvValue$$module$build$src$core$utils$colour*255)}; +tokenizeInterpolationInternal$$module$build$src$core$utils$parsing=function(a,b,c){const d=[];var e=a.split("");e.push("");var f=0;a=[];let g=null;for(let l=0;l=a.bottom?b.top-c.height:b.bottom};isRepositionable$$module$build$src$core$widgetdiv=function(a){return!(a==null||!a.repositionForWindowResize)};repositionForWindowResize$$module$build$src$core$widgetdiv=function(){isRepositionable$$module$build$src$core$widgetdiv(owner$$module$build$src$core$widgetdiv)&&owner$$module$build$src$core$widgetdiv.repositionForWindowResize()||hide$$module$build$src$core$widgetdiv()}; +getCurrentBlock$$module$build$src$core$contextmenu=function(){return currentBlock$$module$build$src$core$contextmenu};setCurrentBlock$$module$build$src$core$contextmenu=function(a){currentBlock$$module$build$src$core$contextmenu=a}; +show$$module$build$src$core$contextmenu=function(a,b,c,d,e){show$$module$build$src$core$widgetdiv(dummyOwner$$module$build$src$core$contextmenu,c,dispose$$module$build$src$core$contextmenu,d);if(b.length){e||(a instanceof PointerEvent?e=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):(console.warn("Context menu opened with keyboard but no location given"),e=new Coordinate$$module$build$src$core$utils$coordinate(0,0)));var f=populate_$$module$build$src$core$contextmenu(b, +c,a,e);menu_$$module$build$src$core$contextmenu=f;position_$$module$build$src$core$contextmenu(f,c,e);setTimeout(function(){f.focus()},1);currentBlock$$module$build$src$core$contextmenu=null}else hide$$module$build$src$core$contextmenu()}; +populate_$$module$build$src$core$contextmenu=function(a,b,c,d){const e=new Menu$$module$build$src$core$menu;e.setRole(Role$$module$build$src$core$utils$aria.MENU);for(let f=0;f{setTimeout(()=>{g.callback(g.scope,c,l,d)},0)})},{})}return e}; +position_$$module$build$src$core$contextmenu=function(a,b,c){const d=getViewportBBox$$module$build$src$core$utils$svg_math();c=new Rect$$module$build$src$core$utils$rect(c.y+d.top,c.y+d.top,c.x+d.left,c.x+d.left);createWidget_$$module$build$src$core$contextmenu(a);const e=a.getSize();b&&(c.left+=e.width,c.right+=e.width,d.left+=e.width,d.right+=e.width);positionWithAnchor$$module$build$src$core$widgetdiv(d,c,e,b);a.focus()}; +createWidget_$$module$build$src$core$contextmenu=function(a){var b=getDiv$$module$build$src$core$widgetdiv();if(!b)throw Error("Attempting to create a context menu when widget div is null");b=a.render(b);addClass$$module$build$src$core$utils$dom(b,"blocklyContextMenu");conditionalBind$$module$build$src$core$browser_events(b,"contextmenu",null,haltPropagation$$module$build$src$core$contextmenu);a.focus()};haltPropagation$$module$build$src$core$contextmenu=function(a){a.preventDefault();a.stopPropagation()}; +hide$$module$build$src$core$contextmenu=function(){hideIfOwner$$module$build$src$core$widgetdiv(dummyOwner$$module$build$src$core$contextmenu);currentBlock$$module$build$src$core$contextmenu=null};dispose$$module$build$src$core$contextmenu=function(){menu_$$module$build$src$core$contextmenu&&(menu_$$module$build$src$core$contextmenu.dispose(),menu_$$module$build$src$core$contextmenu=null)}; +$.callbackFactory$$module$build$src$core$contextmenu=function(a,b){return()=>{$.disable$$module$build$src$core$events$utils();let c;try{c=b instanceof Element?domToBlockInternal$$module$build$src$core$xml(b,a.workspace):appendInternal$$module$build$src$core$serialization$blocks(b,a.workspace);const d=a.getRelativeToSurfaceXY();d.x=a.RTL?d.x-$.config$$module$build$src$core$config.snapRadius:d.x+$.config$$module$build$src$core$config.snapRadius;d.y+=$.config$$module$build$src$core$config.snapRadius* +2;c.moveBy(d.x,d.y)}finally{$.enable$$module$build$src$core$events$utils()}isEnabled$$module$build$src$core$events$utils()&&!c.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(c));$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c);return c}}; +mouseToWorkspacePoint$$module$build$src$core$utils$drag=function(a,b){b=mouseToSvg$$module$build$src$core$browser_events(b,a.getParentSvg(),a.getInverseScreenCTM());b.x/=a.scale;b.y/=a.scale;return b};start$$module$build$src$core$utils$drag=function(a,b,c){b=mouseToWorkspacePoint$$module$build$src$core$utils$drag(a,b);workspaceToDragDelta$$module$build$src$core$utils$drag.set(a,Coordinate$$module$build$src$core$utils$coordinate.difference(c,b))}; +move$$module$build$src$core$utils$drag=function(a,b){b=mouseToWorkspacePoint$$module$build$src$core$utils$drag(a,b);a=workspaceToDragDelta$$module$build$src$core$utils$drag.get(a);if(!a)throw Error("Drag not initialized");return Coordinate$$module$build$src$core$utils$coordinate.sum(a,b)}; +workspaceToDom$$module$build$src$core$xml=function(a,b=!1){const c=$.createElement$$module$build$src$core$utils$xml("xml");var d=variablesToDom$$module$build$src$core$xml($.allUsedVarModels$$module$build$src$core$variables(a));d.hasChildNodes()&&c.appendChild(d);for(const e of a.getTopComments())c.appendChild(saveWorkspaceComment$$module$build$src$core$xml(e,b));a=a.getTopBlocks(!0);for(d=0;d/g,"<$1$2>")}; +domToPrettyText$$module$build$src$core$xml=function(a){a=domToText$$module$build$src$core$xml(a).split("<");let b="";for(let c=1;c"&&(b+=" ")}a=a.join("\n");a=a.replace(/(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g,"$1");return a.replace(/^\n/,"")}; +clearWorkspaceAndLoadFromXml$$module$build$src$core$xml=function(a,b){b.setResizesEnabled(!1);b.clear();a=$.domToWorkspace$$module$build$src$core$xml(a,b);b.setResizesEnabled(!0);return a}; +$.domToWorkspace$$module$build$src$core$xml=function(a,b){let c=0;b.RTL&&(c=b.getWidth());const d=[];startTextWidthCache$$module$build$src$core$utils$dom();const e=$.getGroup$$module$build$src$core$events$utils();e||$.setGroup$$module$build$src$core$events$utils(!0);b.setResizesEnabled&&b.setResizesEnabled(!1);let f=!0;try{for(let g=0,h;h=a.childNodes[g];g++){const k=h.nodeName.toLowerCase(),l=h;if(k==="block"||k==="shadow"&&!getRecordUndo$$module$build$src$core$events$utils()){const m=domToBlockInternal$$module$build$src$core$xml(l, +b);d.push(m.id);let n;const p=parseInt((n=l.getAttribute("x"))!=null?n:"10",10);let r;const q=parseInt((r=l.getAttribute("y"))!=null?r:"10",10);isNaN(p)||isNaN(q)||m.moveBy(b.RTL?c-p:p,q,["create"]);f=!1}else{if(k==="shadow")throw TypeError("Shadow block cannot be a top-level block.");if(k==="comment")loadWorkspaceComment$$module$build$src$core$xml(l,b);else if(k==="variables"){if(f)domToVariables$$module$build$src$core$xml(l,b);else throw Error("'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location."); +f=!1}}}}finally{$.setGroup$$module$build$src$core$events$utils(e),b.setResizesEnabled&&b.setResizesEnabled(!0),b.rendered&&triggerQueuedRenders$$module$build$src$core$render_management(),stopTextWidthCache$$module$build$src$core$utils$dom()}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.FINISHED_LOADING))(b));return d}; +loadWorkspaceComment$$module$build$src$core$xml=function(a,b){var c;const d=(c=a.getAttribute("id"))!=null?c:void 0;c=b.rendered?new RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment(b,d):new WorkspaceComment$$module$build$src$core$comments$workspace_comment(b,d);var e;c.setText((e=a.textContent)!=null?e:"");var f;e=parseInt((f=a.getAttribute("x"))!=null?f:"",10);let g;f=parseInt((g=a.getAttribute("y"))!=null?g:"",10);isNaN(e)||isNaN(f)||(e=b.RTL?b.getWidth()-e:e, +c.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(e,f)));var h;b=parseInt((h=a.getAttribute("w"))!=null?h:"",10);let k;h=parseInt((k=a.getAttribute("h"))!=null?k:"",10);isNaN(b)||isNaN(h)||c.setSize(new Size$$module$build$src$core$utils$size(b,h));a.getAttribute("collapsed")==="true"&&c.setCollapsed(!0);a.getAttribute("editable")==="false"&&c.setEditable(!1);a.getAttribute("movable")==="false"&&c.setMovable(!1);a.getAttribute("deletable")==="false"&&c.setDeletable(!1);return c}; +appendDomToWorkspace$$module$build$src$core$xml=function(a,b){if(!b.getBlocksBoundingBox)return $.domToWorkspace$$module$build$src$core$xml(a,b);var c=b.getBlocksBoundingBox();a=$.domToWorkspace$$module$build$src$core$xml(a,b);if(c&&c.top!==c.bottom){var d=c.bottom;c=b.RTL?c.right:c.left;var e=Infinity;let f=-Infinity,g=Infinity;for(let h=0;hf&&(f=k.x)}d=d-g+10;c=b.RTL?c-f:c-e;for(e=0;e=0;g--)f[g].initSvg();for(let g=f.length-1;g>=0;g--)f[g].queueRender();setTimeout(function(){e.disposed||e.setConnectionTracking(!0)},1);b.resizeContents()}else{const e=d.getDescendants(!1);for(let f=e.length- +1;f>=0;f--)e[f].initModel()}}finally{$.enable$$module$build$src$core$events$utils()}if(isEnabled$$module$build$src$core$events$utils()){a=getAddedVariables$$module$build$src$core$variables(b,c);for(b=0;b{isNaN(n)||isNaN(r)||(n=b.workspace.RTL?b.workspace.getWidth()-(n+h):n,q.setBubbleLocation(new Coordinate$$module$build$src$core$utils$coordinate(n,r)));q.setBubbleVisible(f)},1)}};applyDataTagNodes$$module$build$src$core$xml=function(a,b){for(let c=0;c100)){var b=a.workspace,c=a.getSvgRoot();b.getAudioManager().play("delete");var d=a.getRelativeToSurfaceXY(),e=c.cloneNode(!0);e.setAttribute("transform","translate("+d.x+","+d.y+")");var f;(f=b.getLayerManager())==null||f.appendToAnimationLayer({getSvgRoot:()=>e});disposeUiStep$$module$build$src$core$block_animations(e,{x:d.x,y:d.y,width:a.width,height:a.height},b.RTL,new Date)}}; +disposeUiStep$$module$build$src$core$block_animations=function(a,b,c,d){const e=((new Date).getTime()-d.getTime())/150;e>1?removeNode$$module$build$src$core$utils$dom(a):(a.setAttribute("transform","translate("+(b.x+(c?-1:1)*b.width/2*e)+","+(b.y+b.height/2*e)+") scale("+(1-e)+")"),setTimeout(disposeUiStep$$module$build$src$core$block_animations,10,a,b,c,d))}; +connectionUiEffect$$module$build$src$core$block_animations=function(a){var b=a.workspace;const c=b.scale;b.getAudioManager().play("click");if(!(c<1)){var d=b.getSvgXY(a.getSvgRoot());a.outputConnection?(d.x+=(a.RTL?3:-3)*c,d.y+=13*c):a.previousConnection&&(d.x+=(a.RTL?-23:23)*c,d.y+=3*c);var e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{cx:d.x,cy:d.y,r:0,fill:"none",stroke:"#888","stroke-width":10},b.getParentSvg());a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.ANIMATE, +{id:"animationCircle",begin:"indefinite",attributeName:"r",dur:"150ms",from:0,to:25*c},e);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.ANIMATE,{id:"animationOpacity",begin:"indefinite",attributeName:"opacity",dur:"150ms",from:1,to:0},e);a.beginElement();b.beginElement();setTimeout(()=>void removeNode$$module$build$src$core$utils$dom(e),150)}}; +disconnectUiEffect$$module$build$src$core$block_animations=function(a){disconnectUiStop$$module$build$src$core$block_animations();a.workspace.getAudioManager().play("disconnect");if(!(a.workspace.scale<1)){var b=a.getHeightWidth().height;b=Math.atan(10/b)/Math.PI*180;a.RTL||(b*=-1);wobblingBlock$$module$build$src$core$block_animations=a;disconnectUiStep$$module$build$src$core$block_animations(a,b,new Date,0)}}; +disconnectUiStep$$module$build$src$core$block_animations=function(a,b,c,d){const e=[.66,1,.66,0,-.66,-1,-.66,0];let f="";c.getTime()+200>(new Date).getTime()&&(f=`skewX(${Math.round(e[d%e.length]*b)})`,disconnectPid$$module$build$src$core$block_animations=setTimeout(disconnectUiStep$$module$build$src$core$block_animations,15,a,b,c,d+1));a.getSvgRoot().setAttribute("transform",`${a.getTranslation()} ${f}`)}; +disconnectUiStop$$module$build$src$core$block_animations=function(){wobblingBlock$$module$build$src$core$block_animations&&(disconnectPid$$module$build$src$core$block_animations&&(clearTimeout(disconnectPid$$module$build$src$core$block_animations),disconnectPid$$module$build$src$core$block_animations=null),wobblingBlock$$module$build$src$core$block_animations.getSvgRoot().setAttribute("transform",wobblingBlock$$module$build$src$core$block_animations.getTranslation()),wobblingBlock$$module$build$src$core$block_animations= +null)}; +moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster=function(a,b){a.workspace.RTL&&(b.x=a.workspace.getWidth()-b.x);const c=a.workspace,d=$.config$$module$build$src$core$config.snapRadius,e=Coordinate$$module$build$src$core$utils$coordinate.difference(b,a.getRelativeToSurfaceXY()),f=new Coordinate$$module$build$src$core$utils$coordinate(0,0),g=c.getAllBlocks(!1).filter(h=>h.id!=a.id).map(h=>h.getRelativeToSurfaceXY());for(;blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster(Coordinate$$module$build$src$core$utils$coordinate.sum(b,f), +g)||blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster(a,Coordinate$$module$build$src$core$utils$coordinate.sum(e,f),d);)c.RTL?f.translate(-d,d*2):f.translate(d,d*2);a.moveTo(Coordinate$$module$build$src$core$utils$coordinate.sum(b,f))};blockOverlapsOtherExactly$$module$build$src$core$clipboard$block_paster=function(a,b){return b.some(c=>Math.abs(c.x-a.x)<=1&&Math.abs(c.y-a.y)<=1)}; +blockIsInSnapRadius$$module$build$src$core$clipboard$block_paster=function(a,b,c){return a.getConnections_(!1).some(d=>!!d.closest(c,b).connection)}; +bumpObjectIntoBounds$$module$build$src$core$bump_objects=function(a,b,c){const d=c.getBoundingRectangle(),e=d.right-d.left,f=clamp$$module$build$src$core$utils$math(b.top,d.top,b.top+b.height-(d.bottom-d.top))-d.top;let g=b.left;b=b.left+b.width-e;a.RTL?g=Math.min(b,g):b=Math.max(g,b);return(a=clamp$$module$build$src$core$utils$math(g,d.left,b)-d.left)||f?(c.moveBy(a,f,["inbounds"]),!0):!1}; +bumpIntoBoundsHandler$$module$build$src$core$bump_objects=function(a){return b=>{var c=a.getMetricsManager();if(c.hasFixedEdges()&&!a.isDragging()){var d;if(BUMP_EVENTS$$module$build$src$core$events$type.includes((d=b.type)!=null?d:"")){d=c.getScrollMetrics(!0);const e=extractObjectFromEvent$$module$build$src$core$bump_objects(a,b);e&&(c=$.getGroup$$module$build$src$core$events$utils()||!1,$.setGroup$$module$build$src$core$events$utils(b.group),bumpObjectIntoBounds$$module$build$src$core$bump_objects(a, +d,e)&&!b.group&&console.warn("Moved object in bounds but there was no event group. This may break undo."),$.setGroup$$module$build$src$core$events$utils(c))}else isViewportChange$$module$build$src$core$events$predicates(b)&&b.scale&&b.oldScale&&b.scale>b.oldScale&&bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)}}}; +extractObjectFromEvent$$module$build$src$core$bump_objects=function(a,b){let c=null;switch(b.type){case EventType$$module$build$src$core$events$type.BLOCK_CREATE:case EventType$$module$build$src$core$events$type.BLOCK_MOVE:(c=a.getBlockById(b.blockId))&&(c=c.getRootBlock());break;case EventType$$module$build$src$core$events$type.COMMENT_CREATE:case EventType$$module$build$src$core$events$type.COMMENT_MOVE:case EventType$$module$build$src$core$events$type.COMMENT_RESIZE:c=a.getCommentById(b.commentId)}return c}; +bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects=function(a){var b=a.getMetricsManager();if(b.hasFixedEdges()&&!a.isDragging()){b=b.getScrollMetrics(!0);var c=a.getTopBoundedElements();for(let d=0,e;e=c[d];d++)bumpObjectIntoBounds$$module$build$src$core$bump_objects(a,b,e)}};isDeletable$$module$build$src$core$interfaces$i_deletable=function(a){return a&&typeof a.isDeletable==="function"&&typeof a.dispose==="function"&&typeof a.setDeleteStyle==="function"}; +getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){const c=a.getIcons();for(const d of a.inputList){if(!d.isVisible())continue;c.push(...d.fieldRow);let e;if((e=d.connection)==null?0:e.targetBlock())if(a=d.connection.targetBlock(),d.connection.type!==ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||b)c.push(a);else{let f;(a=(f=a.lastConnectionInStack(!1))==null?void 0:f.getSourceBlock())&&c.push(a)}else{let f;((f=d.connection)== +null?void 0:f.type)===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE&&c.push(d.connection)}}return c}; +navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){const c=a.workspace.getTopBoundedElements(!0).filter(e=>isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(e));a=c.indexOf(a instanceof BlockSvg$$module$build$src$core$block_svg?a.getRootBlock():a)+b;let d=null;a>=0&&a=c.length&&(d=c[0]);if(b<0&&d instanceof BlockSvg$$module$build$src$core$block_svg){let e,f;return(f=(e=d.lastConnectionInStack(!1))==null? +void 0:e.getSourceBlock())!=null?f:d}return d}; +navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy=function(a,b){var c;let d;const e=a instanceof BlockSvg$$module$build$src$core$block_svg?(d=(c=a.outputConnection)==null?void 0:c.targetBlock())!=null?d:a.getSurroundParent():a.getSourceBlock();if(!(e instanceof BlockSvg$$module$build$src$core$block_svg))return null;c=getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(e,b>0);a=c.indexOf(a);if(a===-1)return null;b=a+b;return b>=0&&b!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!1]);a.getBlocksByType("procedures_defnoreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&b.push(d.getProcedureDef())});const c=a.getProcedureMap().getProcedures().filter(d=> +!!d.getReturnTypes()).map(d=>[d.getName(),d.getParameters().map(e=>e.getName()),!0]);a.getBlocksByType("procedures_defreturn",!1).forEach(d=>{!isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(d)&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&c.push(d.getProcedureDef())});b.sort(procTupleComparator$$module$build$src$core$procedures);c.sort(procTupleComparator$$module$build$src$core$procedures);return[b,c]}; +procTupleComparator$$module$build$src$core$procedures=function(a,b){return a[0].localeCompare(b[0],void 0,{sensitivity:"base"})};$.findLegalName$$module$build$src$core$procedures=function(a,b){if(b.isInFlyout)return a;for(a=a||$.Msg$$module$build$src$core$msg.UNNAMED_KEY||"unnamed";!isLegalName$$module$build$src$core$procedures(a,b.workspace,b);){const c=a.match(/^(.*?)(\d+)$/);a=c?c[1]+(parseInt(c[2])+1):a+"2"}return a}; +isLegalName$$module$build$src$core$procedures=function(a,b,c){return!isNameUsed$$module$build$src$core$procedures(a,b,c)}; +isNameUsed$$module$build$src$core$procedures=function(a,b,c){for(const d of b.getAllBlocks(!1))if(d!==c&&isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(d)&&$.Names$$module$build$src$core$names.equals(d.getProcedureDef()[0],a))return!0;c=c&&isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)?c==null?void 0:c.getProcedureModel():void 0;for(const d of b.getProcedureMap().getProcedures())if(d!==c&&$.Names$$module$build$src$core$names.equals(d.getName(), +a))return!0;return!1}; +$.rename$$module$build$src$core$procedures=function(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;a=a.trim();const c=$.findLegalName$$module$build$src$core$procedures(a,b);isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(b)&&!b.isInsertionMarker()&&b.getProcedureModel().setName(c);const d=this.getValue();if(d!==a&&d!==c)for(a=b.workspace.getAllBlocks(!1),b=0;bblockIsModernCallerFor$$module$build$src$core$procedures(c,a)||isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureCall(),a))}; +blockIsModernCallerFor$$module$build$src$core$procedures=function(a,b){return isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(a)&&!a.isProcedureDef()&&a.getProcedureModel()&&$.Names$$module$build$src$core$names.equals(a.getProcedureModel().getName(),b)}; +$.mutateCallers$$module$build$src$core$procedures=function(a){const b=getRecordUndo$$module$build$src$core$events$utils();var c=a.getProcedureDef()[0];const d=a.mutationToDom(!0);a=getCallers$$module$build$src$core$procedures(c,a.workspace);for(let f=0,g;g=a[f];f++){c=(c=g.mutationToDom())&&domToText$$module$build$src$core$utils$xml(c);g.domToMutation&&g.domToMutation(d);var e=g.mutationToDom();e=e&&domToText$$module$build$src$core$utils$xml(e);c!==e&&($.setRecordUndo$$module$build$src$core$events$utils(!1), +fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(g,"mutation",null,c,e)),$.setRecordUndo$$module$build$src$core$events$utils(b))}}; +$.getDefinition$$module$build$src$core$procedures=function(a,b){for(const c of b.getAllBlocks(!1))if(isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block(c)&&c.isProcedureDef()&&$.Names$$module$build$src$core$names.equals(c.getProcedureModel().getName(),a)||isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks(c)&&$.Names$$module$build$src$core$names.equals(c.getProcedureDef()[0],a))return c;return null}; +isDynamicShape$$module$build$src$core$renderers$common$constants=function(a){return a.isDynamic};isPuzzleTab$$module$build$src$core$renderers$common$constants=function(a){return a.pathDown!==void 0&&a.pathUp!==void 0};isNotch$$module$build$src$core$renderers$common$constants=function(a){return a.pathLeft!==void 0&&a.pathRight!==void 0}; +register$$module$build$src$core$renderers$common$block_rendering=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a,b)};unregister$$module$build$src$core$renderers$common$block_rendering=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a)}; +init$$module$build$src$core$renderers$common$block_rendering=function(a,b,c){a=new (getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.RENDERER,a))(a);a.init(b,c);return a};stringButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"String")}; +numberButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Number")};colourButtonClickHandler$$module$build$src$core$variables_dynamic=function(a){createVariableButtonHandler$$module$build$src$core$variables(a.getTargetWorkspace(),void 0,"Colour")}; +internalFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){return flyoutCategory$$module$build$src$core$variables_dynamic(a,!1)}; +flyoutCategory$$module$build$src$core$variables_dynamic=function(a,b=!0){Blocks$$module$build$src$core$blocks.variables_set_dynamic||Blocks$$module$build$src$core$blocks.variables_get_dynamic||console.warn("There are no dynamic variable blocks, but there is a dynamic variable category.");if(b)return warn$$module$build$src$core$utils$deprecation("The XML return value of Blockly.VariablesDynamic.flyoutCategory()","v12","v13","the same method, but handle a return type of FlyoutItemInfo[] (JSON) instead."), +xmlFlyoutCategory$$module$build$src$core$variables_dynamic(a);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);return[{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE,callbackkey:"CREATE_VARIABLE_STRING"}, +{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE,callbackkey:"CREATE_VARIABLE_NUMBER"},{kind:"button",text:$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE,callbackkey:"CREATE_VARIABLE_COLOUR"},...jsonFlyoutCategoryBlocks$$module$build$src$core$variables(a,a.getVariableMap().getAllVariables(),!1,"variables_get_dynamic","variables_set_dynamic")]}; +xmlFlyoutCategory$$module$build$src$core$variables_dynamic=function(a){let b=[],c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_STRING_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_STRING");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_NUMBER_VARIABLE);c.setAttribute("callbackKey","CREATE_VARIABLE_NUMBER");b.push(c);c=document.createElement("button");c.setAttribute("text",$.Msg$$module$build$src$core$msg.NEW_COLOUR_VARIABLE); +c.setAttribute("callbackKey","CREATE_VARIABLE_COLOUR");b.push(c);a.registerButtonCallback("CREATE_VARIABLE_STRING",stringButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_NUMBER",numberButtonClickHandler$$module$build$src$core$variables_dynamic);a.registerButtonCallback("CREATE_VARIABLE_COLOUR",colourButtonClickHandler$$module$build$src$core$variables_dynamic);a=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic(a);return b=b.concat(a)}; +flyoutCategoryBlocks$$module$build$src$core$variables_dynamic=function(a){a=a.getVariableMap().getAllVariables();const b=[];if(a.length>0){if(Blocks$$module$build$src$core$blocks.variables_set_dynamic){var c=a[a.length-1];const d=$.createElement$$module$build$src$core$utils$xml("block");d.setAttribute("type","variables_set_dynamic");d.setAttribute("gap","24");d.appendChild(generateVariableFieldDom$$module$build$src$core$variables(c));b.push(d)}if(Blocks$$module$build$src$core$blocks.variables_get_dynamic){a.sort(compareByName$$module$build$src$core$variables); +for(let d=0,e;e=a[d];d++)c=$.createElement$$module$build$src$core$utils$xml("block"),c.setAttribute("type","variables_get_dynamic"),c.setAttribute("gap","8"),c.appendChild(generateVariableFieldDom$$module$build$src$core$variables(e)),b.push(c)}}return b};resizeSvgContents$$module$build$src$core$workspace_svg=function(a){a.resizeContents()}; +copy$$module$build$src$core$clipboard=function(a,b){const c=a.toCopyData();stashedCopyData$$module$build$src$core$clipboard=c;stashedWorkspace$$module$build$src$core$clipboard=isSelectable$$module$build$src$core$interfaces$i_selectable(a)&&a.workspace instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?a.workspace:null;stashedCoordinates$$module$build$src$core$clipboard=b;return c};getLastCopiedData$$module$build$src$core$clipboard=function(){return stashedCopyData$$module$build$src$core$clipboard}; +setLastCopiedData$$module$build$src$core$clipboard=function(a){stashedCopyData$$module$build$src$core$clipboard=a};getLastCopiedWorkspace$$module$build$src$core$clipboard=function(){return stashedWorkspace$$module$build$src$core$clipboard};setLastCopiedWorkspace$$module$build$src$core$clipboard=function(a){stashedWorkspace$$module$build$src$core$clipboard=a};getLastCopiedLocation$$module$build$src$core$clipboard=function(){return stashedCoordinates$$module$build$src$core$clipboard}; +setLastCopiedLocation$$module$build$src$core$clipboard=function(a){stashedCoordinates$$module$build$src$core$clipboard=a}; +paste$$module$build$src$core$clipboard=function(a,b,c){return a&&b?pasteFromData$$module$build$src$core$clipboard(a,b,c):stashedCopyData$$module$build$src$core$clipboard&&stashedWorkspace$$module$build$src$core$clipboard?pasteFromData$$module$build$src$core$clipboard(stashedCopyData$$module$build$src$core$clipboard,stashedWorkspace$$module$build$src$core$clipboard,stashedCoordinates$$module$build$src$core$clipboard):null}; +pasteFromData$$module$build$src$core$clipboard=function(a,b,c){let d;b=b.isMutator?b:(d=b.options.parentWorkspace)!=null?d:b;let e,f;return(f=(e=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.PASTER,a.paster,!1))==null?void 0:e.paste(a,b,c))!=null?f:null};isCopyable$$module$build$src$core$interfaces$i_copyable=function(a){return a&&typeof a.toCopyData==="function"}; +registerEscape$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.ESCAPE,preconditionFn(a){return!a.isReadOnly()},callback(a){a.hideChaff();return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.ESC]})}; +registerDelete$$module$build$src$core$shortcut_items=function(){ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.DELETE,preconditionFn(a,b){b=b.focusedNode;return!a.isReadOnly()&&b!=null&&isDeletable$$module$build$src$core$interfaces$i_deletable(b)&&b.isDeletable()&&!a.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(a,b,c,d){b.preventDefault();a=d.focusedNode;a instanceof +BlockSvg$$module$build$src$core$block_svg?a.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()&&($.setGroup$$module$build$src$core$events$utils(!0),a.dispose(),$.setGroup$$module$build$src$core$events$utils(!1));return!0},keyCodes:[KeyCodes$$module$build$src$core$utils$keycodes.DELETE,KeyCodes$$module$build$src$core$utils$keycodes.BACKSPACE]})}; +isCopyable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$interfaces$i_copyable(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&isDraggable$$module$build$src$core$interfaces$i_draggable(a)?a.isCopyable?a.isCopyable():a instanceof BlockSvg$$module$build$src$core$block_svg||a instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment?a.isOwnDeletable()&&a.isOwnMovable():a.isDeletable()&&a.isMovable():!1}; +isCuttable$$module$build$src$core$shortcut_items=function(a){return isCopyable$$module$build$src$core$shortcut_items(a)&&isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable()}; +registerCopy$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.C,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.COPY, +preconditionFn(c,d){d=d.focusedNode;c=c.isFlyout?c.targetWorkspace:c;return!!d&&!!c&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&isCopyable$$module$build$src$core$shortcut_items(d)},callback(c,d,e,f){d.preventDefault();d=f.focusedNode;if(!d||!isCopyable$$module$build$src$core$interfaces$i_copyable(d)||!isCopyable$$module$build$src$core$shortcut_items(d))return!1;c=c.isFlyout?c.targetWorkspace:c;if(!c)return!1;d.workspace.isFlyout||c.hideChaff(); +c=isDraggable$$module$build$src$core$interfaces$i_draggable(d)&&d.workspace==c?d.getRelativeToSurfaceXY():void 0;return!!copy$$module$build$src$core$clipboard(d,c)},keyCodes:[a,b]})}; +registerCut$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.X,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.CUT, +preconditionFn(c,d){d=d.focusedNode;return!!d&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()&&isCuttable$$module$build$src$core$shortcut_items(d)},callback(c,d,e,f){c=f.focusedNode;if(!c||!isCuttable$$module$build$src$core$shortcut_items(c)||!isCopyable$$module$build$src$core$interfaces$i_copyable(c))return!1;d=isDraggable$$module$build$src$core$interfaces$i_draggable(c)?c.getRelativeToSurfaceXY():void 0;d=copy$$module$build$src$core$clipboard(c, +d);c instanceof BlockSvg$$module$build$src$core$block_svg?c.checkAndDelete():isDeletable$$module$build$src$core$interfaces$i_deletable(c)&&c.dispose();return!!d},keyCodes:[a,b]})}; +registerPaste$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.V,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.PASTE, +preconditionFn(){var c=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!c||!c.rendered)return!1;c=c.isFlyout?c.targetWorkspace:c;return!!getLastCopiedData$$module$build$src$core$clipboard()&&!!c&&!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){c=getLastCopiedData$$module$build$src$core$clipboard();if(!c)return!1;var e=getLastCopiedWorkspace$$module$build$src$core$clipboard();if(!e)return!1;e=e.isFlyout?e.targetWorkspace: +e;if(!e||e.isReadOnly())return!1;if(d instanceof PointerEvent)return d=screenToWsCoordinates$$module$build$src$core$utils$svg_math(e,new Coordinate$$module$build$src$core$utils$coordinate(d.clientX,d.clientY)),!!paste$$module$build$src$core$clipboard(c,e,d);d=getLastCopiedLocation$$module$build$src$core$clipboard();if(!d)return!!paste$$module$build$src$core$clipboard(c,e);const {left:f,top:g,width:h,height:k}=e.getMetricsManager().getViewMetrics(!0);if((new Rect$$module$build$src$core$utils$rect(g, +g+k,f,f+h)).contains(d.x,d.y))return!!paste$$module$build$src$core$clipboard(c,e);d=new Coordinate$$module$build$src$core$utils$coordinate(f+h/2,g+k/2);return!!paste$$module$build$src$core$clipboard(c,e,d)},keyCodes:[a,b]})}; +registerUndo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.META]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.UNDO, +preconditionFn(c){return!c.isReadOnly()&&!c.isDragging()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()},callback(c,d){c.hideChaff();c.undo(!1);d.preventDefault();return!0},keyCodes:[a,b]})}; +registerRedo$$module$build$src$core$shortcut_items=function(){const a=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL,KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]),b=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Z,[KeyCodes$$module$build$src$core$utils$keycodes.META, +KeyCodes$$module$build$src$core$utils$keycodes.SHIFT]),c=ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.createSerializedKey(KeyCodes$$module$build$src$core$utils$keycodes.Y,[KeyCodes$$module$build$src$core$utils$keycodes.CTRL]);ShortcutRegistry$$module$build$src$core$shortcut_registry.registry.register({name:names$$module$build$src$core$shortcut_items.REDO,preconditionFn(d){return!d.isDragging()&&!d.isReadOnly()&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()}, +callback(d,e){d.hideChaff();d.undo(!0);e.preventDefault();return!0},keyCodes:[a,b,c]})};registerDefaultShortcuts$$module$build$src$core$shortcut_items=function(){registerEscape$$module$build$src$core$shortcut_items();registerDelete$$module$build$src$core$shortcut_items();registerCopy$$module$build$src$core$shortcut_items();registerCut$$module$build$src$core$shortcut_items();registerPaste$$module$build$src$core$shortcut_items();registerUndo$$module$build$src$core$shortcut_items();registerRedo$$module$build$src$core$shortcut_items()}; +saveProcedure$$module$build$src$core$serialization$procedures=function(a){const b=a.saveState();if(!a.getParameters().length)return b;b.parameters=a.getParameters().map(c=>c.saveState());return b};loadProcedure$$module$build$src$core$serialization$procedures=function(a,b,c,d){a=a.loadState(c,d);if(!c.parameters)return a;for(const [e,f]of c.parameters.entries())a.insertParameter(b.loadState(f,d),e);return a}; +save$$module$build$src$core$serialization$workspaces=function(a){const b=Object.create(null),c=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);for(const d in c){let e;const f=(e=c[d])==null?void 0:e.save(a);f&&(b[d]=f)}return b}; +load$$module$build$src$core$serialization$workspaces=function(a,b,{recordUndo:c=!1}={}){var d=getAllItems$$module$build$src$core$registry(Type$$module$build$src$core$registry.SERIALIZER,!0);if(d){d=Object.entries(d).sort((f,g)=>g[1].priority-f[1].priority);var e=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(c);(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);startTextWidthCache$$module$build$src$core$utils$dom(); +b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!1);for(const [,f]of d.reverse()){let g;(g=f)==null||g.clear(b)}for(const [f,g]of d.reverse())if(a[f]){let h;(h=g)==null||h.load(a[f],b)}b instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&b.setResizesEnabled(!0);stopTextWidthCache$$module$build$src$core$utils$dom();fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.FINISHED_LOADING))(b)); +$.setGroup$$module$build$src$core$events$utils(c);$.setRecordUndo$$module$build$src$core$events$utils(e)}}; +inject$$module$build$src$core$inject=function(a,b){let c=null;c=typeof a==="string"?document.getElementById(a)||document.querySelector(a):a;var d;if(!document.contains(c)&&document!==((d=c)==null?void 0:d.ownerDocument))throw Error("Error: container is not in current document");a=new Options$$module$build$src$core$options(b||{});d=document.createElement("div");addClass$$module$build$src$core$utils$dom(d,"injectionDiv");(b==null?0:b.rtl)&&addClass$$module$build$src$core$utils$dom(d,"blocklyRTL");c.appendChild(d); +b=createDom$$module$build$src$core$inject(d,a);const e=createMainWorkspace$$module$build$src$core$inject(d,b,a);init$$module$build$src$core$inject(e);setMainWorkspace$$module$build$src$core$common(e);svgResize$$module$build$src$core$common(e);d.addEventListener("focusin",function(){setMainWorkspace$$module$build$src$core$common(e)});conditionalBind$$module$build$src$core$browser_events(d,"keydown",null,globalShortcutHandler$$module$build$src$core$common);return e}; +createDom$$module$build$src$core$inject=function(a,b){a.setAttribute("dir","LTR");inject$$module$build$src$core$css(b.hasCss,b.pathToMedia);const c=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","class":"blocklySvg"},a),d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.DEFS, +{},c),e=String(Math.random()).substring(2);b.gridPattern=Grid$$module$build$src$core$grid.createDom(e,b.gridOptions,d,a);return c}; +createMainWorkspace$$module$build$src$core$inject=function(a,b,c){c.parentWorkspace=null;c=new WorkspaceSvg$$module$build$src$core$workspace_svg(c);const d=c.options;c.scale=d.zoomOptions.startScale;b.appendChild(c.createDom("blocklyMainBackground",a));var e=c.getRenderer().getClassName();e&&addClass$$module$build$src$core$utils$dom(a,e);(e=c.getTheme().getClassName())&&addClass$$module$build$src$core$utils$dom(a,e);!d.hasCategories&&d.languageTree&&(a=c.addFlyout(Svg$$module$build$src$core$utils$svg.SVG), +insertAfter$$module$build$src$core$utils$dom(a,b));d.hasTrashcan&&c.addTrashcan();d.zoomOptions&&d.zoomOptions.controls&&c.addZoomControls();c.getThemeManager().subscribe(b,"workspaceBackgroundColour","background-color");c.translate(0,0);c.addChangeListener(bumpIntoBoundsHandler$$module$build$src$core$bump_objects(c));svgResize$$module$build$src$core$common(c);createDom$$module$build$src$core$widgetdiv();createDom$$module$build$src$core$dropdowndiv();createDom$$module$build$src$core$tooltip();return c}; +init$$module$build$src$core$inject=function(a){const b=a.options;var c=a.getParentSvg();conditionalBind$$module$build$src$core$browser_events(c.parentNode,"contextmenu",null,function(d){isTargetInput$$module$build$src$core$browser_events(d)||d.preventDefault()});c=conditionalBind$$module$build$src$core$browser_events(window,"resize",null,function(){hide$$module$build$src$core$tooltip();a.hideComponents(!0);repositionForWindowResize$$module$build$src$core$dropdowndiv();repositionForWindowResize$$module$build$src$core$widgetdiv(); +svgResize$$module$build$src$core$common(a);bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects(a)});a.setResizeHandlerWrapper(c);bindDocumentEvents$$module$build$src$core$inject();if(b.languageTree){c=a.getToolbox();const d=a.getFlyout(!0);c?c.init():d&&(d.init(a),d.show(b.languageTree),typeof d.scrollToStart==="function"&&d.scrollToStart())}b.hasTrashcan&&a.trashcan.init();b.zoomOptions&&b.zoomOptions.controls&&a.zoomControls_.init();b.moveOptions&&b.moveOptions.scrollbars?(a.scrollbar= +new ScrollbarPair$$module$build$src$core$scrollbar_pair(a,b.moveOptions.scrollbars===!0||!!b.moveOptions.scrollbars.horizontal,b.moveOptions.scrollbars===!0||!!b.moveOptions.scrollbars.vertical,"blocklyMainWorkspaceScrollbar"),a.scrollbar.resize()):a.setMetrics({x:.5,y:.5});b.hasSounds&&loadSounds$$module$build$src$core$inject(b.pathToMedia,a)}; +bindDocumentEvents$$module$build$src$core$inject=function(){documentEventsBound$$module$build$src$core$inject||(conditionalBind$$module$build$src$core$browser_events(document,"scroll",null,function(){const a=getAllWorkspaces$$module$build$src$core$common();for(let b=0,c;c=a[b];b++)c instanceof WorkspaceSvg$$module$build$src$core$workspace_svg&&c.updateInverseScreenCTM()}),bind$$module$build$src$core$browser_events(document,"touchend",null,longStop$$module$build$src$core$touch),bind$$module$build$src$core$browser_events(document, +"touchcancel",null,longStop$$module$build$src$core$touch));documentEventsBound$$module$build$src$core$inject=!0}; +loadSounds$$module$build$src$core$inject=function(a,b){function c(){for(;e.length;){const f=e.pop();f&&unbind$$module$build$src$core$browser_events(f)}d.preload()}const d=b.getAudioManager();d.load([a+"click.mp3",a+"click.wav",a+"click.ogg"],"click");d.load([a+"disconnect.wav",a+"disconnect.mp3",a+"disconnect.ogg"],"disconnect");d.load([a+"delete.mp3",a+"delete.ogg",a+"delete.wav"],"delete");const e=[];e.push(conditionalBind$$module$build$src$core$browser_events(document,"pointermove",null,c,!0)); +e.push(conditionalBind$$module$build$src$core$browser_events(document,"touchstart",null,c,!0))};isFullBlockField$$module$build$src$core$contextmenu_items=function(a){if(!a||!a.isSimpleReporter())return!1;let b;return(b=a.getFields().next().value)==null?void 0:b.isFullBlockField()}; +registerUndo$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.UNDO},preconditionFn(a){return a.workspace.getUndoStack().length>0?"enabled":"disabled"},callback(a){a.workspace.undo(!1)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"undoWorkspace",weight:1})}; +registerRedo$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.REDO},preconditionFn(a){return a.workspace.getRedoStack().length>0?"enabled":"disabled"},callback(a){a.workspace.undo(!0)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"redoWorkspace",weight:2})}; +registerCleanup$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.CLEAN_UP},preconditionFn(a){return a.workspace.isMovable()?a.workspace.getTopBlocks(!1).length>1?"enabled":"disabled":"hidden"},callback(a){a.workspace.cleanUp()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"cleanWorkspace",weight:3})}; +toggleOption_$$module$build$src$core$contextmenu_items=function(a,b){function c(f){e--;f.setCollapsed(a);e===0&&$.setGroup$$module$build$src$core$events$utils(!1)}let d=0,e=0;$.setGroup$$module$build$src$core$events$utils(!0);for(let f=0;f +0?"enabled":"disabled":"disabled"},callback(a){if(a.workspace){a.workspace.cancelCurrentGesture();var b=getDeletableBlocks_$$module$build$src$core$contextmenu_items(a.workspace);b.length<2?deleteNext_$$module$build$src$core$contextmenu_items(b):confirm$$module$build$src$core$dialog($.Msg$$module$build$src$core$msg.DELETE_ALL_BLOCKS.replace("%1",String(b.length)),function(c){c&&deleteNext_$$module$build$src$core$contextmenu_items(b)})}},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE, +id:"workspaceDelete",weight:6})};registerWorkspaceOptions_$$module$build$src$core$contextmenu_items=function(){registerUndo$$module$build$src$core$contextmenu_items();registerRedo$$module$build$src$core$contextmenu_items();registerCleanup$$module$build$src$core$contextmenu_items();registerCollapse$$module$build$src$core$contextmenu_items();registerExpand$$module$build$src$core$contextmenu_items();registerDeleteAll$$module$build$src$core$contextmenu_items()}; +registerDuplicate$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.DUPLICATE_BLOCK},preconditionFn(a){a=a.block;return!a.isInFlyout&&a.isDeletable()&&a.isMovable()?a.isDuplicatable()?"enabled":"disabled":"hidden"},callback(a){if(a.block){var b=a.block.toCopyData();b&&paste$$module$build$src$core$clipboard(b,a.block.workspace)}},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK, +id:"blockDuplicate",weight:1})}; +registerComment$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){return a.block.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)?$.Msg$$module$build$src$core$msg.REMOVE_COMMENT:$.Msg$$module$build$src$core$msg.ADD_COMMENT},preconditionFn(a){a=a.block;return!a||a.isInFlyout||!a.workspace.options.comments||a.isCollapsed()||!a.isEditable()||!a.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)&&isFullBlockField$$module$build$src$core$contextmenu_items(a)? +"hidden":"enabled"},callback(a){(a=a.block)&&a.hasIcon(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE)?a.setCommentText(null):a.setCommentText("")},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockComment",weight:2})}; +registerInline$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){return a.block.getInputsInline()?$.Msg$$module$build$src$core$msg.EXTERNAL_INPUTS:$.Msg$$module$build$src$core$msg.INLINE_INPUTS},preconditionFn(a){a=a.block;if(!a.isInFlyout&&a.isMovable()&&!a.isCollapsed())for(let b=1;b(b.has(MANUALLY_DISABLED$$module$build$src$core$constants)? +1:0);return a.getInheritedDisabled()||b?"disabled":"enabled"}return"hidden"},callback(a){a=a.block;const b=$.getGroup$$module$build$src$core$events$utils();b||$.setGroup$$module$build$src$core$events$utils(!0);a.setDisabledReason(!a.hasDisabledReason(MANUALLY_DISABLED$$module$build$src$core$constants),MANUALLY_DISABLED$$module$build$src$core$constants);$.setGroup$$module$build$src$core$events$utils(b)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockDisable", +weight:5})}; +registerDelete$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(a){var b=a.block;a=b.getDescendants(!1).length;(b=b.getNextBlock())&&(a-=b.getDescendants(!1).length);return a===1?$.Msg$$module$build$src$core$msg.DELETE_BLOCK:$.Msg$$module$build$src$core$msg.DELETE_X_BLOCKS.replace("%1",`${a}`)},preconditionFn(a){return!a.block.isInFlyout&&a.block.isDeletable()?"enabled":"hidden"},callback(a){a.block&&a.block.checkAndDelete()}, +scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockDelete",weight:6})}; +registerHelp$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText(){return $.Msg$$module$build$src$core$msg.HELP},preconditionFn(a){a=a.block;return(typeof a.helpUrl==="function"?a.helpUrl():a.helpUrl)?"enabled":"hidden"},callback(a){a.block.showHelp()},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.BLOCK,id:"blockHelp",weight:7})}; +registerCommentDelete$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText:()=>$.Msg$$module$build$src$core$msg.REMOVE_COMMENT,preconditionFn(a){let b;return((b=a.comment)==null?0:b.isDeletable())?"enabled":"hidden"},callback(a){$.setGroup$$module$build$src$core$events$utils(!0);let b;(b=a.comment)==null||b.dispose();$.setGroup$$module$build$src$core$events$utils(!1)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT, +id:"commentDelete",weight:6})}; +registerCommentDuplicate$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText:()=>$.Msg$$module$build$src$core$msg.DUPLICATE_COMMENT,preconditionFn(a){let b;return((b=a.comment)==null?0:b.isMovable())?"enabled":"hidden"},callback(a){if(a.comment){var b=a.comment.toCopyData();b&&paste$$module$build$src$core$clipboard(b,a.comment.workspace)}},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.COMMENT,id:"commentDuplicate", +weight:1})}; +registerCommentCreate$$module$build$src$core$contextmenu_items=function(){ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.register({displayText:()=>$.Msg$$module$build$src$core$msg.ADD_COMMENT,preconditionFn:a=>{let b;return((b=a.workspace)==null?0:b.isMutator)?"hidden":"enabled"},callback:(a,b,c,d)=>{if(a=a.workspace)$.setGroup$$module$build$src$core$events$utils(!0),b=new RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment(a),b.setPlaceholderText($.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT), +b.moveTo(screenToWsCoordinates$$module$build$src$core$utils$svg_math(a,new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y))),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b),$.setGroup$$module$build$src$core$events$utils(!1)},scopeType:ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType.WORKSPACE,id:"commentCreate",weight:8})}; +registerBlockOptions_$$module$build$src$core$contextmenu_items=function(){registerDuplicate$$module$build$src$core$contextmenu_items();registerComment$$module$build$src$core$contextmenu_items();registerInline$$module$build$src$core$contextmenu_items();registerCollapseExpandBlock$$module$build$src$core$contextmenu_items();registerDisable$$module$build$src$core$contextmenu_items();registerDelete$$module$build$src$core$contextmenu_items();registerHelp$$module$build$src$core$contextmenu_items()}; +registerCommentOptions$$module$build$src$core$contextmenu_items=function(){registerCommentDuplicate$$module$build$src$core$contextmenu_items();registerCommentDelete$$module$build$src$core$contextmenu_items();registerCommentCreate$$module$build$src$core$contextmenu_items()};registerDefaultOptions$$module$build$src$core$contextmenu_items=function(){registerWorkspaceOptions_$$module$build$src$core$contextmenu_items();registerBlockOptions_$$module$build$src$core$contextmenu_items()}; +isPaster$$module$build$src$core$interfaces$i_paster=function(a){return a&&typeof a.paste==="function"};isRenderedElement$$module$build$src$core$interfaces$i_rendered_element=function(a){return a&&typeof a.getSvgRoot==="function"};isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item=function(a){return a.isSelectable()};hideChaff$$module$build$src$core$blockly=function(a){getMainWorkspace$$module$build$src$core$common().hideChaff(a)}; +isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree=function(a){return a&&typeof a.getRootFocusableNode==="function"&&typeof a.getRestoredFocusableNode==="function"&&typeof a.getNestedTrees==="function"&&typeof a.lookUpFocusableNode==="function"&&typeof a.onTreeFocus==="function"&&typeof a.onTreeBlur==="function"};$jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_ES6=!1;$jscomp.ASSUME_ES2020=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1; +$jscomp.ISOLATE_POLYFILLS=!1;$jscomp.FORCE_POLYFILL_PROMISE=!1;$jscomp.FORCE_POLYFILL_PROMISE_WHEN_NO_UNHANDLED_REJECTION=!1;$jscomp.INSTRUMENT_ASYNC_CONTEXT=!0;$jscomp.objectCreate=$jscomp.ASSUME_ES5||typeof Object.create=="function"?Object.create:function(a){var b=function(){};b.prototype=a;return new b};$jscomp.defineProperty=$jscomp.ASSUME_ES5||typeof Object.defineProperties=="function"?Object.defineProperty:function(a,b,c){if(a==Array.prototype||a==Object.prototype)return a;a[b]=c.value;return a}; +$jscomp.getGlobal=function(a){a=["object"==typeof globalThis&&globalThis,a,"object"==typeof window&&window,"object"==typeof self&&self,"object"==typeof global&&global];for(var b=0;b>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE? +$jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+c+"$"+e),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))}; +$jscomp.getConstructImplementation=function(){function a(){function c(){}new c;Reflect.construct(c,[],function(){});return new c instanceof c}if($jscomp.TRUST_ES6_POLYFILLS&&typeof Reflect!="undefined"&&Reflect.construct){if(a())return Reflect.construct;var b=Reflect.construct;return function(c,d,e){c=b(c,d);e&&Reflect.setPrototypeOf(c,e.prototype);return c}}return function(c,d,e){e===void 0&&(e=c);e=$jscomp.objectCreate(e.prototype||Object.prototype);return Function.prototype.apply.call(c,e,d)|| +e}};$jscomp.construct={valueOf:$jscomp.getConstructImplementation}.valueOf();$jscomp.underscoreProtoCanBeSet=function(){var a={a:!0},b={};try{return b.__proto__=a,b.a}catch(c){}return!1};$jscomp.setPrototypeOf=$jscomp.ASSUME_ES6||$jscomp.TRUST_ES6_POLYFILLS&&typeof Object.setPrototypeOf=="function"?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null; +$jscomp.inherits=function(a,b){a.prototype=$jscomp.objectCreate(b.prototype);a.prototype.constructor=a;if($jscomp.ASSUME_ES6||$jscomp.setPrototypeOf){var c=$jscomp.setPrototypeOf;c(a,b)}else for(c in b)if(c!="prototype")if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.superClass_=b.prototype};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b0;){var a=this.properties_.pop();if(a in this.object_)return a}return null};$jscomp.generator.Engine_=function(a){this.context_=new $jscomp.generator.Context;this.program_=a}; +$jscomp.generator.Engine_.prototype.next_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_.next,a,this.context_.next_);this.context_.next_(a);return this.nextStep_()}; +$jscomp.generator.Engine_.prototype.return_=function(a){this.context_.start_();var b=this.context_.yieldAllIterator_;if(b)return this.yieldAllStep_("return"in b?b["return"]:function(c){return{value:c,done:!0}},a,this.context_.return);this.context_.return(a);return this.nextStep_()}; +$jscomp.generator.Engine_.prototype.throw_=function(a){this.context_.start_();if(this.context_.yieldAllIterator_)return this.yieldAllStep_(this.context_.yieldAllIterator_["throw"],a,this.context_.next_);this.context_.throw_(a);return this.nextStep_()}; +$jscomp.generator.Engine_.prototype.yieldAllStep_=function(a,b,c){try{var d=a.call(this.context_.yieldAllIterator_,b);$jscomp.generator.ensureIteratorResultIsObject_(d);if(!d.done)return this.context_.stop_(),d;var e=d.value}catch(f){return this.context_.yieldAllIterator_=null,this.context_.throw_(f),this.nextStep_()}this.context_.yieldAllIterator_=null;c.call(this.context_,e);return this.nextStep_()}; +$jscomp.generator.Engine_.prototype.nextStep_=function(){for(;this.context_.nextAddress;)try{var a=this.program_(this.context_);if(a)return this.context_.stop_(),{value:a.value,done:!1}}catch(b){this.context_.yieldResult=void 0,this.context_.throw_(b)}this.context_.stop_();if(this.context_.abruptCompletion_){a=this.context_.abruptCompletion_;this.context_.abruptCompletion_=null;if(a.isException)throw a.exception;return{value:a.return,done:!0}}return{value:void 0,done:!0}}; +$jscomp.generator.Generator_=function(a){this.next=function(b){return a.next_(b)};this.throw=function(b){return a.throw_(b)};this.return=function(b){return a.return_(b)};this[Symbol.iterator]=function(){return this}};$jscomp.generator.createGenerator=function(a,b){b=new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(b));$jscomp.setPrototypeOf&&a.prototype&&$jscomp.setPrototypeOf(b,a.prototype);return b}; +$jscomp.asyncExecutePromiseGenerator=function(a){function b(d){return a.next(d)}function c(d){return a.throw(d)}return new Promise(function(d,e){function f(g){g.done?d(g.value):Promise.resolve(g.value).then(b,c).then(f,e)}f(a.next())})};$jscomp.asyncExecutePromiseGeneratorFunction=function(a){return $jscomp.asyncExecutePromiseGenerator(a())};$jscomp.asyncExecutePromiseGeneratorProgram=function(a){return $jscomp.asyncExecutePromiseGenerator(new $jscomp.generator.Generator_(new $jscomp.generator.Engine_(a)))}; +$jscomp.polyfill("globalThis",function(a){return a||$jscomp.global},"es_2020","es3");$jscomp.polyfill("Array.prototype.includes",function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(c<0&&(c=Math.max(c+e,0));c0?(d=Array.prototype.flat.call(d,b-1),c.push.apply(c,d)):c.push(d)});return c}},"es9","es5"); +$jscomp.polyfill("Object.entries",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push([d,b[d]]);return c}},"es8","es3");$jscomp.polyfill("Object.values",function(a){return a?a:function(b){var c=[],d;for(d in b)$jscomp.owns(b,d)&&c.push(b[d]);return c}},"es8","es3"); +var typeMap$$module$build$src$core$registry=Object.create(null),TEST_ONLY$$module$build$src$core$registry={typeMap:typeMap$$module$build$src$core$registry},nameMap$$module$build$src$core$registry=Object.create(null),DEFAULT$$module$build$src$core$registry="default",Type$$module$build$src$core$registry=class{constructor(a){this.name=a}toString(){return this.name}};Type$$module$build$src$core$registry.CONNECTION_CHECKER=new Type$$module$build$src$core$registry("connectionChecker"); +Type$$module$build$src$core$registry.CONNECTION_PREVIEWER=new Type$$module$build$src$core$registry("connectionPreviewer");Type$$module$build$src$core$registry.CURSOR=new Type$$module$build$src$core$registry("cursor");Type$$module$build$src$core$registry.EVENT=new Type$$module$build$src$core$registry("event");Type$$module$build$src$core$registry.FIELD=new Type$$module$build$src$core$registry("field");Type$$module$build$src$core$registry.INPUT=new Type$$module$build$src$core$registry("input"); +Type$$module$build$src$core$registry.RENDERER=new Type$$module$build$src$core$registry("renderer");Type$$module$build$src$core$registry.TOOLBOX=new Type$$module$build$src$core$registry("toolbox");Type$$module$build$src$core$registry.THEME=new Type$$module$build$src$core$registry("theme");Type$$module$build$src$core$registry.TOOLBOX_ITEM=new Type$$module$build$src$core$registry("toolboxItem");Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX=new Type$$module$build$src$core$registry("flyoutsVerticalToolbox"); +Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX=new Type$$module$build$src$core$registry("flyoutsHorizontalToolbox");Type$$module$build$src$core$registry.FLYOUT_INFLATER=new Type$$module$build$src$core$registry("flyoutInflater");Type$$module$build$src$core$registry.METRICS_MANAGER=new Type$$module$build$src$core$registry("metricsManager");Type$$module$build$src$core$registry.BLOCK_DRAGGER=new Type$$module$build$src$core$registry("blockDragger"); +Type$$module$build$src$core$registry.SERIALIZER=new Type$$module$build$src$core$registry("serializer");Type$$module$build$src$core$registry.ICON=new Type$$module$build$src$core$registry("icon");Type$$module$build$src$core$registry.PASTER=new Type$$module$build$src$core$registry("paster");Type$$module$build$src$core$registry.VARIABLE_MODEL=new Type$$module$build$src$core$registry("variableModel");Type$$module$build$src$core$registry.VARIABLE_MAP=new Type$$module$build$src$core$registry("variableMap"); +var module$build$src$core$registry={DEFAULT:DEFAULT$$module$build$src$core$registry,TEST_ONLY:TEST_ONLY$$module$build$src$core$registry};module$build$src$core$registry.Type=Type$$module$build$src$core$registry;module$build$src$core$registry.getAllItems=getAllItems$$module$build$src$core$registry;module$build$src$core$registry.getClass=getClass$$module$build$src$core$registry;module$build$src$core$registry.getClassFromOptions=getClassFromOptions$$module$build$src$core$registry; +module$build$src$core$registry.getObject=getObject$$module$build$src$core$registry;module$build$src$core$registry.hasItem=hasItem$$module$build$src$core$registry;module$build$src$core$registry.register=register$$module$build$src$core$registry;module$build$src$core$registry.unregister=unregister$$module$build$src$core$registry;var Blocks$$module$build$src$core$blocks=Object.create(null),module$build$src$core$blocks={Blocks:Blocks$$module$build$src$core$blocks};var LONGPRESS$$module$build$src$core$touch=750,TOUCH_ENABLED$$module$build$src$core$touch="ontouchstart"in globalThis||!!(globalThis.document&&document.documentElement&&"ontouchstart"in document.documentElement)||!(!globalThis.navigator||!globalThis.navigator.maxTouchPoints&&!globalThis.navigator.msMaxTouchPoints),touchIdentifier_$$module$build$src$core$touch=null,TOUCH_MAP$$module$build$src$core$touch={mousedown:["pointerdown"],mouseenter:["pointerenter"],mouseleave:["pointerleave"],mousemove:["pointermove"], +mouseout:["pointerout"],mouseover:["pointerover"],mouseup:["pointerup","pointercancel"],touchend:["pointerup"],touchcancel:["pointercancel"]},longPid_$$module$build$src$core$touch=0,module$build$src$core$touch={TOUCH_ENABLED:TOUCH_ENABLED$$module$build$src$core$touch,TOUCH_MAP:TOUCH_MAP$$module$build$src$core$touch};module$build$src$core$touch.checkTouchIdentifier=checkTouchIdentifier$$module$build$src$core$touch;module$build$src$core$touch.clearTouchIdentifier=clearTouchIdentifier$$module$build$src$core$touch; +module$build$src$core$touch.getTouchIdentifierFromEvent=getTouchIdentifierFromEvent$$module$build$src$core$touch;module$build$src$core$touch.longStart=longStart$$module$build$src$core$touch;module$build$src$core$touch.longStop=longStop$$module$build$src$core$touch;module$build$src$core$touch.shouldHandleEvent=shouldHandleEvent$$module$build$src$core$touch;var rawUserAgent$$module$build$src$core$utils$useragent,isJavaFx$$module$build$src$core$utils$useragent,isWebKit$$module$build$src$core$utils$useragent,isGecko$$module$build$src$core$utils$useragent,isAndroid$$module$build$src$core$utils$useragent,isIPad$$module$build$src$core$utils$useragent,isIPhone$$module$build$src$core$utils$useragent,isMac$$module$build$src$core$utils$useragent,isTablet$$module$build$src$core$utils$useragent,isMobile$$module$build$src$core$utils$useragent; +(function(a){function b(d){return c.includes(d.toUpperCase())}rawUserAgent$$module$build$src$core$utils$useragent=a;const c=rawUserAgent$$module$build$src$core$utils$useragent.toUpperCase();isJavaFx$$module$build$src$core$utils$useragent=b("JavaFX");isWebKit$$module$build$src$core$utils$useragent=b("WebKit");isGecko$$module$build$src$core$utils$useragent=b("Gecko")&&!isWebKit$$module$build$src$core$utils$useragent;isAndroid$$module$build$src$core$utils$useragent=b("Android");a=globalThis.navigator&& +globalThis.navigator.maxTouchPoints;isIPad$$module$build$src$core$utils$useragent=b("iPad")||b("Macintosh")&&a>0;isIPhone$$module$build$src$core$utils$useragent=b("iPhone")&&!isIPad$$module$build$src$core$utils$useragent;isMac$$module$build$src$core$utils$useragent=b("Macintosh");isTablet$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent&&!b("Mobile")||b("Silk");isMobile$$module$build$src$core$utils$useragent=!isTablet$$module$build$src$core$utils$useragent&& +(isIPhone$$module$build$src$core$utils$useragent||isAndroid$$module$build$src$core$utils$useragent)})(globalThis.navigator&&globalThis.navigator.userAgent||""); +var raw$$module$build$src$core$utils$useragent=rawUserAgent$$module$build$src$core$utils$useragent,JavaFx$$module$build$src$core$utils$useragent=isJavaFx$$module$build$src$core$utils$useragent,GECKO$$module$build$src$core$utils$useragent=isGecko$$module$build$src$core$utils$useragent,ANDROID$$module$build$src$core$utils$useragent=isAndroid$$module$build$src$core$utils$useragent,IPAD$$module$build$src$core$utils$useragent=isIPad$$module$build$src$core$utils$useragent,IPHONE$$module$build$src$core$utils$useragent= +isIPhone$$module$build$src$core$utils$useragent,MAC$$module$build$src$core$utils$useragent=isMac$$module$build$src$core$utils$useragent,MOBILE$$module$build$src$core$utils$useragent=isMobile$$module$build$src$core$utils$useragent,module$build$src$core$utils$useragent={ANDROID:ANDROID$$module$build$src$core$utils$useragent,GECKO:GECKO$$module$build$src$core$utils$useragent,IPAD:IPAD$$module$build$src$core$utils$useragent,IPHONE:IPHONE$$module$build$src$core$utils$useragent,JavaFx:JavaFx$$module$build$src$core$utils$useragent, +MAC:MAC$$module$build$src$core$utils$useragent,MOBILE:MOBILE$$module$build$src$core$utils$useragent,raw:raw$$module$build$src$core$utils$useragent};var LINE_MODE_MULTIPLIER$$module$build$src$core$browser_events=40,PAGE_MODE_MULTIPLIER$$module$build$src$core$browser_events=125,module$build$src$core$browser_events={};module$build$src$core$browser_events.bind=bind$$module$build$src$core$browser_events;module$build$src$core$browser_events.conditionalBind=conditionalBind$$module$build$src$core$browser_events;module$build$src$core$browser_events.getScrollDeltaPixels=getScrollDeltaPixels$$module$build$src$core$browser_events; +module$build$src$core$browser_events.isRightButton=isRightButton$$module$build$src$core$browser_events;module$build$src$core$browser_events.isTargetInput=isTargetInput$$module$build$src$core$browser_events;module$build$src$core$browser_events.mouseToSvg=mouseToSvg$$module$build$src$core$browser_events;module$build$src$core$browser_events.unbind=unbind$$module$build$src$core$browser_events;var EventType$$module$build$src$core$events$type; +(function(a){a.BLOCK_CREATE="create";a.BLOCK_DELETE="delete";a.BLOCK_CHANGE="change";a.BLOCK_FIELD_INTERMEDIATE_CHANGE="block_field_intermediate_change";a.BLOCK_MOVE="move";a.VAR_CREATE="var_create";a.VAR_DELETE="var_delete";a.VAR_RENAME="var_rename";a.VAR_TYPE_CHANGE="var_type_change";a.UI="ui";a.BLOCK_DRAG="drag";a.SELECTED="selected";a.CLICK="click";a.MARKER_MOVE="marker_move";a.BUBBLE_OPEN="bubble_open";a.TRASHCAN_OPEN="trashcan_open";a.TOOLBOX_ITEM_SELECT="toolbox_item_select";a.THEME_CHANGE= +"theme_change";a.VIEWPORT_CHANGE="viewport_change";a.COMMENT_CREATE="comment_create";a.COMMENT_DELETE="comment_delete";a.COMMENT_CHANGE="comment_change";a.COMMENT_MOVE="comment_move";a.COMMENT_RESIZE="comment_resize";a.COMMENT_DRAG="comment_drag";a.COMMENT_COLLAPSE="comment_collapse";a.FINISHED_LOADING="finished_loading"})(EventType$$module$build$src$core$events$type||(EventType$$module$build$src$core$events$type={})); +var BUMP_EVENTS$$module$build$src$core$events$type=[EventType$$module$build$src$core$events$type.BLOCK_CREATE,EventType$$module$build$src$core$events$type.BLOCK_MOVE,EventType$$module$build$src$core$events$type.COMMENT_CREATE,EventType$$module$build$src$core$events$type.COMMENT_MOVE],module$build$src$core$events$type={BUMP_EVENTS:BUMP_EVENTS$$module$build$src$core$events$type};module$build$src$core$events$type.EventType=EventType$$module$build$src$core$events$type;var soup$$module$build$src$core$utils$idgenerator="!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",internal$$module$build$src$core$utils$idgenerator={genUid:()=>{const a=soup$$module$build$src$core$utils$idgenerator.length,b=[];for(let c=0;c<20;c++)b[c]=soup$$module$build$src$core$utils$idgenerator.charAt(Math.random()*a);return b.join("")}},TEST_ONLY$$module$build$src$core$utils$idgenerator=internal$$module$build$src$core$utils$idgenerator,nextId$$module$build$src$core$utils$idgenerator= +0,module$build$src$core$utils$idgenerator={TEST_ONLY:internal$$module$build$src$core$utils$idgenerator};module$build$src$core$utils$idgenerator.genUid=genUid$$module$build$src$core$utils$idgenerator;module$build$src$core$utils$idgenerator.getNextUniqueId=getNextUniqueId$$module$build$src$core$utils$idgenerator;var module$build$src$core$events$predicates={};module$build$src$core$events$predicates.isBlockChange=isBlockChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockCreate=isBlockCreate$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockDelete=isBlockDelete$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockDrag=isBlockDrag$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isBlockFieldIntermediateChange=isBlockFieldIntermediateChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBlockMove=isBlockMove$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isBubbleOpen=isBubbleOpen$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isClick=isClick$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isCommentChange=isCommentChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentCollapse=isCommentCollapse$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentCreate=isCommentCreate$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentDelete=isCommentDelete$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isCommentDrag=isCommentDrag$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentMove=isCommentMove$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isCommentResize=isCommentResize$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isFinishedLoading=isFinishedLoading$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isSelected=isSelected$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isThemeChange=isThemeChange$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isToolboxItemSelect=isToolboxItemSelect$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isTrashcanOpen=isTrashcanOpen$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isVarCreate=isVarCreate$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isVarDelete=isVarDelete$$module$build$src$core$events$predicates; +module$build$src$core$events$predicates.isVarRename=isVarRename$$module$build$src$core$events$predicates;module$build$src$core$events$predicates.isViewportChange=isViewportChange$$module$build$src$core$events$predicates;var group$$module$build$src$core$events$utils="",recordUndo$$module$build$src$core$events$utils=!0,disabled$$module$build$src$core$events$utils=0,ORPHANED_BLOCK_DISABLED_REASON$$module$build$src$core$events$utils="ORPHANED_BLOCK",FIRE_QUEUE$$module$build$src$core$events$utils=[],TEST_ONLY$$module$build$src$core$events$utils={FIRE_QUEUE:FIRE_QUEUE$$module$build$src$core$events$utils,enqueueEvent:enqueueEvent$$module$build$src$core$events$utils,fireNow:fireNow$$module$build$src$core$events$utils,fireInternal:fireInternal$$module$build$src$core$events$utils, +setGroupInternal:setGroupInternal$$module$build$src$core$events$utils},module$build$src$core$events$utils={TEST_ONLY:TEST_ONLY$$module$build$src$core$events$utils};module$build$src$core$events$utils.clearPendingUndo=clearPendingUndo$$module$build$src$core$events$utils;module$build$src$core$events$utils.disable=$.disable$$module$build$src$core$events$utils;module$build$src$core$events$utils.disableOrphans=disableOrphans$$module$build$src$core$events$utils; +module$build$src$core$events$utils.enable=$.enable$$module$build$src$core$events$utils;module$build$src$core$events$utils.filter=filter$$module$build$src$core$events$utils;module$build$src$core$events$utils.fire=fire$$module$build$src$core$events$utils;module$build$src$core$events$utils.fromJson=fromJson$$module$build$src$core$events$utils;module$build$src$core$events$utils.get=get$$module$build$src$core$events$utils;module$build$src$core$events$utils.getDescendantIds=getDescendantIds$$module$build$src$core$events$utils; +module$build$src$core$events$utils.getGroup=$.getGroup$$module$build$src$core$events$utils;module$build$src$core$events$utils.getRecordUndo=getRecordUndo$$module$build$src$core$events$utils;module$build$src$core$events$utils.isEnabled=isEnabled$$module$build$src$core$events$utils;module$build$src$core$events$utils.setGroup=$.setGroup$$module$build$src$core$events$utils;module$build$src$core$events$utils.setRecordUndo=$.setRecordUndo$$module$build$src$core$events$utils;var SVG_NS$$module$build$src$core$utils$dom="http://www.w3.org/2000/svg",HTML_NS$$module$build$src$core$utils$dom="http://www.w3.org/1999/xhtml",XLINK_NS$$module$build$src$core$utils$dom="http://www.w3.org/1999/xlink",NodeType$$module$build$src$core$utils$dom;(function(a){a[a.ELEMENT_NODE=1]="ELEMENT_NODE";a[a.TEXT_NODE=3]="TEXT_NODE";a[a.COMMENT_NODE=8]="COMMENT_NODE"})(NodeType$$module$build$src$core$utils$dom||(NodeType$$module$build$src$core$utils$dom={})); +var cacheWidths$$module$build$src$core$utils$dom=null,cacheReference$$module$build$src$core$utils$dom=0,canvasContext$$module$build$src$core$utils$dom=null,module$build$src$core$utils$dom={HTML_NS:HTML_NS$$module$build$src$core$utils$dom};module$build$src$core$utils$dom.NodeType=NodeType$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.SVG_NS=SVG_NS$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.XLINK_NS=XLINK_NS$$module$build$src$core$utils$dom; +module$build$src$core$utils$dom.addClass=addClass$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.createSvgElement=createSvgElement$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.getFastTextWidth=getFastTextWidth$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.getFastTextWidthWithSizeString=getFastTextWidthWithSizeString$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.getTextWidth=getTextWidth$$module$build$src$core$utils$dom; +module$build$src$core$utils$dom.hasClass=hasClass$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.insertAfter=insertAfter$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.measureFontMetrics=measureFontMetrics$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.removeClass=removeClass$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.removeClasses=removeClasses$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.removeNode=removeNode$$module$build$src$core$utils$dom; +module$build$src$core$utils$dom.setCssTransform=setCssTransform$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.startTextWidthCache=startTextWidthCache$$module$build$src$core$utils$dom;module$build$src$core$utils$dom.stopTextWidthCache=stopTextWidthCache$$module$build$src$core$utils$dom;var FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser=class{static findFocusedNode(a){var b=a.getRootFocusableNode();if(!b.canBeFocused())return null;var c=b.getFocusableElement();if(hasClass$$module$build$src$core$utils$dom(c,FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME)||hasClass$$module$build$src$core$utils$dom(c,FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME))return b; +b=c.querySelector(this.ACTIVE_FOCUS_NODE_CSS_SELECTOR);if(b instanceof HTMLElement||b instanceof SVGElement)if(b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(b,a))return b;c=c.querySelector(this.PASSIVE_FOCUS_NODE_CSS_SELECTOR);if(c instanceof HTMLElement||c instanceof SVGElement)if(a=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,a))return a;return null}static findFocusableNodeFor(a,b){if(!a.id|| +a.id==="null"||b.getNestedTrees().map(e=>FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(a,e)).findIndex(e=>!!e)!==-1)return null;var c=b.getRootFocusableNode();if(c.canBeFocused()&&a===c.getFocusableElement())return c;var d;if(c=(d=b.lookUpFocusableNode(a.id))!=null?d:null)return c;d=a.parentElement;return!c&&d?FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(d,b):null}}; +FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME="blocklyActiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.ACTIVE_CLASS_NAME}`; +FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_FOCUS_NODE_CSS_SELECTOR=`.${FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.PASSIVE_CSS_CLASS_NAME}`;var module$build$src$core$utils$focusable_tree_traverser={};module$build$src$core$utils$focusable_tree_traverser.FocusableTreeTraverser=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser;var TreeRegistration$$module$build$src$core$focus_manager=class{constructor(a,b){this.tree=a;this.rootShouldBeAutoTabbable=b}},FocusManager$$module$build$src$core$focus_manager=class{constructor(a){this.previouslyFocusedNode=this.focusedNode=null;this.registeredTrees=[];this.isUpdatingFocusedNode=this.recentlyLostAllFocus=this.lockFocusStateChanges=this.currentlyHoldsEphemeralFocus=!1;const b=c=>{if(!this.isUpdatingFocusedNode){this.recentlyLostAllFocus=!c;var d=null;if(c instanceof HTMLElement|| +c instanceof SVGElement)for(var e of this.registeredTrees)if(d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(c,e.tree))break;if(d&&d.canBeFocused()){c=d.getFocusableTree();let f;e=(f=this.focusedNode)==null?void 0:f.getFocusableTree();d===c.getRootFocusableNode()&&c!==e?this.focusTree(c):this.focusNode(d)}else this.defocusCurrentFocusedNode()}};a("focusin",c=>{c instanceof FocusEvent&&b(document.activeElement)});a("focusout",c=>{c instanceof FocusEvent&& +b(c.relatedTarget)})}registerTree(a,b=!1){this.ensureManagerIsUnlocked();if(this.isRegistered(a))throw Error(`Attempted to re-register already registered tree: ${a}.`);this.registeredTrees.push(new TreeRegistration$$module$build$src$core$focus_manager(a,b));const c=a.getRootFocusableNode().getFocusableElement();if(!c.id||c.id==="null")throw Error("Attempting to register a tree with a root element that has an "+`invalid ID: ${a}.`);b&&(c.tabIndex=0)}isRegistered(a){return!!this.lookUpRegistration(a)}lookUpRegistration(a){let b; +return(b=this.registeredTrees.find(c=>c.tree===a))!=null?b:null}unregisterTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to unregister not registered tree: ${a}.`);var b=this.registeredTrees.findIndex(e=>e.tree===a);const c=this.registeredTrees[b];this.registeredTrees.splice(b,1);b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a);const d=a.getRootFocusableNode();b&&this.removeHighlight(b);this.focusedNode!==b&& +this.focusedNode!==d||this.updateFocusedNode(null);this.removeHighlight(d);c.rootShouldBeAutoTabbable&&a.getRootFocusableNode().getFocusableElement().removeAttribute("tabindex")}getFocusedTree(){let a,b;return(b=(a=this.focusedNode)==null?void 0:a.getFocusableTree())!=null?b:null}getFocusedNode(){return this.focusedNode}focusTree(a){this.ensureManagerIsUnlocked();if(!this.isRegistered(a))throw Error(`Attempted to focus unregistered tree: ${a}.`);const b=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(a), +c=a.getRestoredFocusableNode(b);a=a.getRootFocusableNode();let d;this.focusNode((d=c!=null?c:b)!=null?d:a)}focusNode(a){this.ensureManagerIsUnlocked();const b=!this.currentlyHoldsEphemeralFocus;b&&(this.isUpdatingFocusedNode=!0);var c,d=((c=this.focusedNode)==null?void 0:c.getFocusableElement())!==document.activeElement;if(this.focusedNode!==a||d)if(a.canBeFocused()){c=a.getFocusableTree();if(!this.isRegistered(c))throw Error(`Attempted to focus unregistered node: ${a}.`);d=a.getFocusableElement(); +d.id&&d.id!=="null"||console.warn("Trying to focus a node that has an invalid ID.");var e=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusableNodeFor(d,c);d=FocusableTreeTraverser$$module$build$src$core$utils$focusable_tree_traverser.findFocusedNode(c);var f=a;if(e!==a){f=c.getRestoredFocusableNode(d);a=c.getRootFocusableNode();var g;f=(g=f!=null?f:d)!=null?g:a}a=this.focusedNode;g=a==null?void 0:a.getFocusableTree();a&&this.passivelyFocusNode(a,c);c=c.getRootFocusableNode(); +d&&this.removeHighlight(d);c!==f&&this.removeHighlight(c);this.currentlyHoldsEphemeralFocus||this.activelyFocusNode(f,g!=null?g:null);this.updateFocusedNode(f)}else console.warn("Trying to focus a node that can't be focused.");b&&(this.isUpdatingFocusedNode=!1)}takeEphemeralFocus(a){this.ensureManagerIsUnlocked();if(this.currentlyHoldsEphemeralFocus)throw Error("Attempted to take ephemeral focus when it's already held, "+`with new element: ${a}.`);this.currentlyHoldsEphemeralFocus=!0;this.focusedNode&& +this.passivelyFocusNode(this.focusedNode,null);a.focus({preventScroll:!0});let b=!1;return()=>{if(b)throw Error("Attempted to finish ephemeral focus twice for element: "+`${a}.`);b=!0;this.currentlyHoldsEphemeralFocus=!1;if(this.focusedNode){this.activelyFocusNode(this.focusedNode,null);const c=this.focusedNode;setTimeout(()=>{!this.focusedNode&&this.previouslyFocusedNode===c&&this.recentlyLostAllFocus&&this.focusNode(c)},0)}}}ephemeralFocusTaken(){return this.currentlyHoldsEphemeralFocus}ensureManagerIsUnlocked(){if(this.lockFocusStateChanges)throw Error("FocusManager state changes cannot happen in a tree/node focus/blur callback."); +}updateFocusedNode(a){this.previouslyFocusedNode=this.focusedNode;this.focusedNode=a}defocusCurrentFocusedNode(){this.focusedNode&&!this.currentlyHoldsEphemeralFocus&&(this.passivelyFocusNode(this.focusedNode,null),this.updateFocusedNode(null))}activelyFocusNode(a,b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree(),d=a.getFocusableElement();let e;const f=(e=this.lookUpRegistration(c))==null?void 0:e.rootShouldBeAutoTabbable;c!==b&&(c.onTreeFocus(a,b),f&&(c.getRootFocusableNode().getFocusableElement().tabIndex= +-1));a.onNodeFocus();this.lockFocusStateChanges=!1;f&&a===c.getRootFocusableNode()||d.hasAttribute("tabindex")||(d.tabIndex=-1);this.setNodeToVisualActiveFocus(a);d.focus({preventScroll:!0})}passivelyFocusNode(a,b){this.lockFocusStateChanges=!0;const c=a.getFocusableTree();if(c!==b){c.onTreeBlur(b);let d;if((d=this.lookUpRegistration(c))==null?0:d.rootShouldBeAutoTabbable)c.getRootFocusableNode().getFocusableElement().tabIndex=0}a.onNodeBlur();this.lockFocusStateChanges=!1;c!==b&&this.setNodeToVisualPassiveFocus(a)}setNodeToVisualActiveFocus(a){a= +a.getFocusableElement();addClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}setNodeToVisualPassiveFocus(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);addClass$$module$build$src$core$utils$dom(a, +FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}removeHighlight(a){a=a.getFocusableElement();removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME);removeClass$$module$build$src$core$utils$dom(a,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME)}static getFocusManager(){FocusManager$$module$build$src$core$focus_manager.focusManager||(FocusManager$$module$build$src$core$focus_manager.focusManager= +new FocusManager$$module$build$src$core$focus_manager(document.addEventListener));return FocusManager$$module$build$src$core$focus_manager.focusManager}};FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyActiveFocus";FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME="blocklyPassiveFocus";FocusManager$$module$build$src$core$focus_manager.focusManager=null;var module$build$src$core$focus_manager={}; +module$build$src$core$focus_manager.FocusManager=FocusManager$$module$build$src$core$focus_manager;module$build$src$core$focus_manager.getFocusManager=$.getFocusManager$$module$build$src$core$focus_manager;var module$build$src$core$interfaces$i_focusable_node={};module$build$src$core$interfaces$i_focusable_node.isFocusableNode=isFocusableNode$$module$build$src$core$interfaces$i_focusable_node;var module$build$src$core$interfaces$i_selectable={};module$build$src$core$interfaces$i_selectable.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;var module$build$src$core$utils$object={};module$build$src$core$utils$object.deepMerge=deepMerge$$module$build$src$core$utils$object;var ShortcutRegistry$$module$build$src$core$shortcut_registry=class{constructor(){this.shortcuts=new Map;this.keyMap=new Map;this.reset()}reset(){this.shortcuts.clear();this.keyMap.clear()}register(a,b){if(this.shortcuts.get(a.name)&&!b)throw Error(`Shortcut named "${a.name}" already exists.`);this.shortcuts.set(a.name,a);b=a.keyCodes;if(b==null?0:b.length)for(const c of b)this.addKeyMapping(c,a.name,!!a.allowCollision)}unregister(a){if(!this.shortcuts.get(a))return console.warn(`Keyboard shortcut named "${a}" not found.`), +!1;this.removeAllKeyMappings(a);this.shortcuts.delete(a);return!0}addKeyMapping(a,b,c){a=`${a}`;const d=this.keyMap.get(a);if(d&&!c)throw Error(`Shortcut named "${b}" collides with shortcuts "${d}"`);d&&c?d.unshift(b):this.keyMap.set(a,[b])}removeKeyMapping(a,b,c){const d=this.keyMap.get(a);if(!d)return c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`),!1;const e=d.indexOf(b);if(e>-1)return d.splice(e,1),d.length===0&&this.keyMap.delete(a),!0;c||console.warn(`No keyboard shortcut named "${b}" registered with key code "${a}"`); +return!1}removeAllKeyMappings(a){for(const b of this.keyMap.keys())this.removeKeyMapping(b,a,!0)}setKeyMap(a){this.keyMap.clear();for(const b in a)this.keyMap.set(b,a[b])}getKeyMap(){const a=Object.create(null);for(const [b,c]of this.keyMap)a[b]=c;return a}getRegistry(){const a=Object.create(null);for(const [b,c]of this.shortcuts)a[b]=c;return deepMerge$$module$build$src$core$utils$object(Object.create(null),a)}onKeyDown(a,b){var c=this.serializeKeyEvent(b);c=this.getShortcutNamesByKeyCode(c);if(!c)return!1; +for(const d of c){c=this.shortcuts.get(d);let e;if(!c||c.preconditionFn&&!c.preconditionFn(a,{focusedNode:(e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())!=null?e:void 0}))continue;let f,g,h;if((g=(f=c).callback)==null?0:g.call(f,a,b,c,{focusedNode:(h=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode())!=null?h:void 0}))return!0}return!1}getShortcutNamesByKeyCode(a){let b;return((b=this.keyMap.get(a))==null?void 0:b.slice())||[]}getKeyCodesByShortcutName(a){const b= +[];for(const [c,d]of this.keyMap)d.indexOf(a)>-1&&b.push(c);return b}serializeKeyEvent(a){let b="";for(const c in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)a.getModifierState(c)&&(b!==""&&(b+="+"),b+=c);b!==""&&a.keyCode?b+="+"+a.keyCode:a.keyCode&&(b=String(a.keyCode));return b}checkModifiers(a){for(const b of a)if(!(b in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys))throw Error(b+" is not a valid modifier key.");}createSerializedKey(a,b){let c= +"";if(b){this.checkModifiers(b);for(const d in ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys)b.includes(ShortcutRegistry$$module$build$src$core$shortcut_registry.modifierKeys[d])&&(c!==""&&(c+="+"),c+=d)}c!==""&&a?c+="+"+a:a&&(c=`${a}`);return c}};ShortcutRegistry$$module$build$src$core$shortcut_registry.registry=new ShortcutRegistry$$module$build$src$core$shortcut_registry; +(function(a){a=a.modifierKeys||(a.modifierKeys={});a[a.Shift=16]="Shift";a[a.Control=17]="Control";a[a.Alt=18]="Alt";a[a.Meta=91]="Meta"})(ShortcutRegistry$$module$build$src$core$shortcut_registry||(ShortcutRegistry$$module$build$src$core$shortcut_registry={}));var module$build$src$core$shortcut_registry={};module$build$src$core$shortcut_registry.ShortcutRegistry=ShortcutRegistry$$module$build$src$core$shortcut_registry;var WorkspaceDB_$$module$build$src$core$common=Object.create(null),mainWorkspace$$module$build$src$core$common,parentContainer$$module$build$src$core$common,draggingConnections$$module$build$src$core$common=[],TEST_ONLY$$module$build$src$core$common={defineBlocksWithJsonArrayInternal:defineBlocksWithJsonArrayInternal$$module$build$src$core$common},module$build$src$core$common={TEST_ONLY:TEST_ONLY$$module$build$src$core$common};module$build$src$core$common.createBlockDefinitionsFromJsonArray=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common; +module$build$src$core$common.defineBlocks=$.defineBlocks$$module$build$src$core$common;module$build$src$core$common.defineBlocksWithJsonArray=defineBlocksWithJsonArray$$module$build$src$core$common;module$build$src$core$common.draggingConnections=draggingConnections$$module$build$src$core$common;module$build$src$core$common.fireSelectedEvent=fireSelectedEvent$$module$build$src$core$common;module$build$src$core$common.getAllWorkspaces=getAllWorkspaces$$module$build$src$core$common; +module$build$src$core$common.getBlockTypeCounts=getBlockTypeCounts$$module$build$src$core$common;module$build$src$core$common.getMainWorkspace=getMainWorkspace$$module$build$src$core$common;module$build$src$core$common.getParentContainer=getParentContainer$$module$build$src$core$common;module$build$src$core$common.getSelected=getSelected$$module$build$src$core$common;module$build$src$core$common.getWorkspaceById=getWorkspaceById$$module$build$src$core$common; +module$build$src$core$common.globalShortcutHandler=globalShortcutHandler$$module$build$src$core$common;module$build$src$core$common.registerWorkspace=registerWorkspace$$module$build$src$core$common;module$build$src$core$common.setMainWorkspace=setMainWorkspace$$module$build$src$core$common;module$build$src$core$common.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$common.setSelected=setSelected$$module$build$src$core$common; +module$build$src$core$common.svgResize=svgResize$$module$build$src$core$common;module$build$src$core$common.unregisterWorkpace=unregisterWorkpace$$module$build$src$core$common;var Abstract$$module$build$src$core$events$events_abstract=class{constructor(){this.workspaceId=void 0;this.isUiEvent=!1;this.type="";this.group=$.getGroup$$module$build$src$core$events$utils();this.recordUndo=getRecordUndo$$module$build$src$core$events$utils()}toJson(){return{type:this.type,group:this.group}}static fromJson(a,b,c){c.isBlank=!1;c.group=a.group||"";c.workspaceId=b.id;return c}isNull(){return!1}run(a){}getEventWorkspace_(){let a;this.workspaceId&&(a=getWorkspaceById$$module$build$src$core$common(this.workspaceId)); +if(!a)throw Error("Workspace is null. Event must have been generated from real Blockly events.");return a}},module$build$src$core$events$events_abstract={};module$build$src$core$events$events_abstract.Abstract=Abstract$$module$build$src$core$events$events_abstract;var UiBase$$module$build$src$core$events$events_ui_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.recordUndo=!1;this.isUiEvent=!0;this.isBlank=typeof a==="undefined";this.workspaceId=a?a:""}},module$build$src$core$events$events_ui_base={};module$build$src$core$events$events_ui_base.UiBase=UiBase$$module$build$src$core$events$events_ui_base;var Click$$module$build$src$core$events$events_click=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){b=a?a.workspace.id:b;b===null&&(b=void 0);super(b);this.type=EventType$$module$build$src$core$events$type.CLICK;this.blockId=a?a.id:void 0;this.targetType=c}toJson(){const a=super.toJson();if(!this.targetType)throw Error("The click target type is undefined. Either pass a block to the constructor, or call fromJson");a.targetType=this.targetType;a.blockId=this.blockId; +return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new Click$$module$build$src$core$events$events_click);b.targetType=a.targetType;b.blockId=a.blockId;return b}},ClickTarget$$module$build$src$core$events$events_click;(function(a){a.BLOCK="block";a.WORKSPACE="workspace";a.ZOOM_CONTROLS="zoom_controls"})(ClickTarget$$module$build$src$core$events$events_click||(ClickTarget$$module$build$src$core$events$events_click={})); +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.CLICK,Click$$module$build$src$core$events$events_click);var module$build$src$core$events$events_click={};module$build$src$core$events$events_click.Click=Click$$module$build$src$core$events$events_click;module$build$src$core$events$events_click.ClickTarget=ClickTarget$$module$build$src$core$events$events_click;var module$build$src$core$utils$array={};module$build$src$core$utils$array.removeElem=removeElem$$module$build$src$core$utils$array;var Capability$$module$build$src$core$component_manager=class{constructor(a){this.name=a}toString(){return this.name}};Capability$$module$build$src$core$component_manager.POSITIONABLE=new Capability$$module$build$src$core$component_manager("positionable");Capability$$module$build$src$core$component_manager.DRAG_TARGET=new Capability$$module$build$src$core$component_manager("drag_target");Capability$$module$build$src$core$component_manager.DELETE_AREA=new Capability$$module$build$src$core$component_manager("delete_area"); +Capability$$module$build$src$core$component_manager.AUTOHIDEABLE=new Capability$$module$build$src$core$component_manager("autohideable"); +var ComponentManager$$module$build$src$core$component_manager=class{constructor(){this.componentData=new Map;this.capabilityToComponentIds=new Map}addComponent(a,b){const c=a.component.id;if(!b&&this.componentData.has(c)){var d;throw Error('Plugin "'+c+'" with capabilities "'+((d=this.componentData.get(c))==null?void 0:d.capabilities)+'" already added.');}this.componentData.set(c,a);b=[];for(d=0;d +{d.push(this.componentData.get(e))});d.sort(function(e,f){return e.weight-f.weight});d.forEach(function(e){c.push(e.component)})}else a.forEach(d=>{c.push(this.componentData.get(d).component)});return c}};ComponentManager$$module$build$src$core$component_manager.Capability=Capability$$module$build$src$core$component_manager; +(function(a){a=a.ComponentWeight||(a.ComponentWeight={});a[a.TOOLBOX_WEIGHT=0]="TOOLBOX_WEIGHT";a[a.FLYOUT_WEIGHT=1]="FLYOUT_WEIGHT";a[a.TRASHCAN_WEIGHT=2]="TRASHCAN_WEIGHT";a[a.ZOOM_CONTROLS_WEIGHT=3]="ZOOM_CONTROLS_WEIGHT"})(ComponentManager$$module$build$src$core$component_manager||(ComponentManager$$module$build$src$core$component_manager={})); +var ComponentWeight$$module$build$src$core$component_manager=ComponentManager$$module$build$src$core$component_manager.ComponentWeight,module$build$src$core$component_manager={};module$build$src$core$component_manager.ComponentManager=ComponentManager$$module$build$src$core$component_manager;module$build$src$core$component_manager.ComponentWeight=ComponentWeight$$module$build$src$core$component_manager;var injected$$module$build$src$core$css=!1,content$$module$build$src$core$css='\n.blocklySvg {\n background-color: #fff;\n outline: none;\n overflow: hidden; /* IE overflows by default. */\n position: absolute;\n display: block;\n}\n\n.blocklyWidgetDiv {\n display: none;\n position: absolute;\n z-index: 99999; /* big value for bootstrap3 compatibility */\n}\n\n.injectionDiv {\n height: 100%;\n position: relative;\n overflow: hidden; /* So blocks in drag surface disappear at edges */\n touch-action: none;\n user-select: none;\n -webkit-user-select: none;\n}\n\n.blocklyBlockCanvas.blocklyCanvasTransitioning,\n.blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\n}\n\n.blocklyEmboss {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyTooltipDiv {\n background-color: #ffffc7;\n border: 1px solid #ddc;\n box-shadow: 4px 4px 20px 1px rgba(0,0,0,.15);\n color: #000;\n display: none;\n font: 9pt sans-serif;\n opacity: .9;\n padding: 2px;\n position: absolute;\n z-index: 100000; /* big value for bootstrap3 compatibility */\n}\n\n.blocklyDropDownDiv {\n position: absolute;\n left: 0;\n top: 0;\n z-index: 1000;\n display: none;\n border: 1px solid;\n border-color: #dadce0;\n background-color: #fff;\n border-radius: 2px;\n padding: 4px;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownContent {\n max-height: 300px; /* @todo: spec for maximum height. */\n}\n\n.blocklyDropDownArrow {\n position: absolute;\n left: 0;\n top: 0;\n width: 16px;\n height: 16px;\n z-index: -1;\n background-color: inherit;\n border-color: inherit;\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n}\n\n.blocklyHighlighted>.blocklyPath {\n filter: var(--blocklyEmbossFilter);\n}\n\n.blocklyHighlightedConnectionPath {\n fill: none;\n stroke: #fc3;\n stroke-width: 4px;\n}\n\n.blocklyPathLight {\n fill: none;\n stroke-linecap: round;\n stroke-width: 1;\n}\n\n.blocklySelected>.blocklyPathLight {\n display: none;\n}\n\n.blocklyDraggable {\n cursor: grab;\n cursor: -webkit-grab;\n}\n\n.blocklyDragging {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n /* Drag surface disables events to not block the toolbox, so we have to\n * reenable them here for the cursor values to work. */\n pointer-events: auto;\n}\n\n /* Changes cursor on mouse down. Not effective in Firefox because of\n https://bugzilla.mozilla.org/show_bug.cgi?id=771241 */\n.blocklyDraggable:active {\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n.blocklyDragging.blocklyDraggingDelete,\n.blocklyDragging.blocklyDraggingDelete .blocklyField {\n cursor: url("<<>>/handdelete.cur"), auto;\n}\n\n.blocklyDragging>.blocklyPath,\n.blocklyDragging>.blocklyPathLight {\n fill-opacity: .8;\n stroke-opacity: .8;\n}\n\n.blocklyDragging>.blocklyPathDark {\n display: none;\n}\n\n.blocklyDisabledPattern>.blocklyPath {\n fill: var(--blocklyDisabledPattern);\n fill-opacity: .5;\n stroke-opacity: .5;\n}\n\n.blocklyDisabled>.blocklyPathLight,\n.blocklyDisabled>.blocklyPathDark {\n display: none;\n}\n\n.blocklyInsertionMarker>.blocklyPath,\n.blocklyInsertionMarker>.blocklyPathLight,\n.blocklyInsertionMarker>.blocklyPathDark {\n fill-opacity: .2;\n stroke: none;\n}\n\n.blocklyNonEditableField>text {\n pointer-events: none;\n}\n\n.blocklyFlyout {\n position: absolute;\n z-index: 20;\n}\n\n.blocklyText text {\n cursor: default;\n}\n\n/*\n Don\'t allow users to select text. It gets annoying when trying to\n drag a block and selected text moves instead.\n*/\n.blocklySvg text {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n cursor: inherit;\n}\n\n.blocklyIconGroup {\n cursor: default;\n}\n\n.blocklyIconGroup:not(:hover):not(:focus),\n.blocklyIconGroupReadonly {\n opacity: .6;\n}\n\n.blocklyIconShape {\n fill: #00f;\n stroke: #fff;\n stroke-width: 1px;\n}\n\n.blocklyIconSymbol {\n fill: #fff;\n}\n\n.blocklyMinimalBody {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\n.blocklyHtmlInput {\n border: none;\n border-radius: 4px;\n height: 100%;\n margin: 0;\n outline: none;\n padding: 0;\n width: 100%;\n text-align: center;\n display: block;\n box-sizing: border-box;\n}\n\n/* Remove the increase and decrease arrows on the field number editor */\ninput.blocklyHtmlInput[type=number]::-webkit-inner-spin-button,\ninput.blocklyHtmlInput[type=number]::-webkit-outer-spin-button {\n -webkit-appearance: none;\n margin: 0;\n}\n\ninput[type=number] {\n -moz-appearance: textfield;\n}\n\n.blocklyMainBackground {\n stroke-width: 1;\n stroke: #c6c6c6; /* Equates to #ddd due to border being off-pixel. */\n}\n\n.blocklyMutatorBackground {\n fill: #fff;\n stroke: #ddd;\n stroke-width: 1;\n}\n\n.blocklyFlyoutBackground {\n fill: #ddd;\n fill-opacity: .8;\n}\n\n.blocklyMainWorkspaceScrollbar {\n z-index: 20;\n}\n\n.blocklyFlyoutScrollbar {\n z-index: 30;\n}\n\n.blocklyScrollbarHorizontal,\n.blocklyScrollbarVertical {\n position: absolute;\n outline: none;\n}\n\n.blocklyScrollbarBackground {\n opacity: 0;\n pointer-events: none;\n}\n\n.blocklyScrollbarHandle {\n fill: #ccc;\n}\n\n.blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyScrollbarHandle:hover {\n fill: #bbb;\n}\n\n/* Darken flyout scrollbars due to being on a grey background. */\n/* By contrast, workspace scrollbars are on a white background. */\n.blocklyFlyout .blocklyScrollbarHandle {\n fill: #bbb;\n}\n\n.blocklyFlyout .blocklyScrollbarBackground:hover+.blocklyScrollbarHandle,\n.blocklyFlyout .blocklyScrollbarHandle:hover {\n fill: #aaa;\n}\n\n.blocklyInvalidInput {\n background: #faa;\n}\n\n.blocklyVerticalMarker {\n stroke-width: 3px;\n fill: rgba(255,255,255,.5);\n pointer-events: none;\n}\n\n.blocklyComputeCanvas {\n position: absolute;\n width: 0;\n height: 0;\n}\n\n.blocklyNoPointerEvents {\n pointer-events: none;\n}\n\n.blocklyContextMenu {\n border-radius: 4px;\n max-height: 100%;\n}\n\n.blocklyDropdownMenu {\n border-radius: 2px;\n padding: 0 !important;\n}\n\n.blocklyDropdownMenu .blocklyMenuItem {\n /* 28px on the left for icon or checkbox. */\n padding-left: 28px;\n}\n\n/* BiDi override for the resting state. */\n.blocklyDropdownMenu .blocklyMenuItemRtl {\n /* Flip left/right padding for BiDi. */\n padding-left: 5px;\n padding-right: 28px;\n}\n\n.blocklyWidgetDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: #fff;\n border: 1px solid transparent;\n box-shadow: 0 0 3px 1px rgba(0,0,0,.3);\n font: normal 13px Arial, sans-serif;\n margin: 0;\n outline: none;\n padding: 4px 0;\n position: absolute;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n.blocklyWidgetDiv .blocklyMenu:focus {\n box-shadow: 0 0 6px 1px rgba(0,0,0,.3);\n}\n\n.blocklyDropDownDiv .blocklyMenu {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background: inherit; /* Compatibility with gapi, reset from goog-menu */\n border: inherit; /* Compatibility with gapi, reset from goog-menu */\n font: normal 13px "Helvetica Neue", Helvetica, sans-serif;\n outline: none;\n overflow-y: auto;\n overflow-x: hidden;\n max-height: 100%;\n z-index: 20000; /* Arbitrary, but some apps depend on it... */\n}\n\n/* State: resting. */\n.blocklyMenuItem {\n border: none;\n color: #000;\n cursor: pointer;\n list-style: none;\n margin: 0;\n /* 7em on the right for shortcut. */\n min-width: 7em;\n padding: 6px 15px;\n white-space: nowrap;\n}\n\n/* State: disabled. */\n.blocklyMenuItemDisabled {\n color: #ccc;\n cursor: inherit;\n}\n\n/* State: hover. */\n.blocklyMenuItemHighlight {\n background-color: rgba(0,0,0,.1);\n}\n\n/* State: selected/checked. */\n.blocklyMenuItemCheckbox {\n height: 16px;\n position: absolute;\n width: 16px;\n}\n\n.blocklyMenuItemSelected .blocklyMenuItemCheckbox {\n background: url(<<>>/sprites.png) no-repeat -48px -16px;\n float: left;\n margin-left: -24px;\n position: static; /* Scroll with the menu. */\n}\n\n.blocklyMenuItemRtl .blocklyMenuItemCheckbox {\n float: right;\n margin-right: -24px;\n}\n\n.blocklyMenuSeparator {\n background-color: #ccc;\n height: 1px;\n border: 0;\n margin-left: 4px;\n margin-right: 4px;\n}\n\n.blocklyBlockDragSurface, .blocklyAnimationLayer {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 80;\n pointer-events: none;\n}\n\n.blocklyField {\n cursor: default;\n}\n\n.blocklyInputField {\n cursor: text;\n}\n\n.blocklyDragging .blocklyField,\n.blocklyDragging .blocklyIconGroup {\n cursor: grabbing;\n}\n\n.blocklyActiveFocus:is(\n .blocklyFlyout,\n .blocklyWorkspace,\n .blocklyField,\n .blocklyPath,\n .blocklyHighlightedConnectionPath,\n .blocklyComment,\n .blocklyBubble,\n .blocklyIconGroup,\n .blocklyTextarea\n) {\n outline: none;\n}\n', +module$build$src$core$css={};module$build$src$core$css.inject=inject$$module$build$src$core$css;module$build$src$core$css.register=register$$module$build$src$core$css;var Coordinate$$module$build$src$core$utils$coordinate=class{constructor(a,b){this.x=a;this.y=b}clone(){return new Coordinate$$module$build$src$core$utils$coordinate(this.x,this.y)}scale(a){this.x*=a;this.y*=a;return this}translate(a,b){this.x+=a;this.y+=b;return this}static equals(a,b){return a===b?!0:a&&b?a.x===b.x&&a.y===b.y:!1}static distance(a,b){const c=a.x-b.x;a=a.y-b.y;return Math.sqrt(c*c+a*a)}static magnitude(a){return Math.sqrt(a.x*a.x+a.y*a.y)}static difference(a,b){return new Coordinate$$module$build$src$core$utils$coordinate(a.x- +b.x,a.y-b.y)}static sum(a,b){return new Coordinate$$module$build$src$core$utils$coordinate(a.x+b.x,a.y+b.y)}},module$build$src$core$utils$coordinate={};module$build$src$core$utils$coordinate.Coordinate=Coordinate$$module$build$src$core$utils$coordinate;var Svg$$module$build$src$core$utils$svg=class{constructor(a){this.tagName=a}toString(){return this.tagName}};Svg$$module$build$src$core$utils$svg.ANIMATE=new Svg$$module$build$src$core$utils$svg("animate");Svg$$module$build$src$core$utils$svg.CIRCLE=new Svg$$module$build$src$core$utils$svg("circle");Svg$$module$build$src$core$utils$svg.CLIPPATH=new Svg$$module$build$src$core$utils$svg("clipPath");Svg$$module$build$src$core$utils$svg.DEFS=new Svg$$module$build$src$core$utils$svg("defs"); +Svg$$module$build$src$core$utils$svg.FECOMPOSITE=new Svg$$module$build$src$core$utils$svg("feComposite");Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER=new Svg$$module$build$src$core$utils$svg("feComponentTransfer");Svg$$module$build$src$core$utils$svg.FEFLOOD=new Svg$$module$build$src$core$utils$svg("feFlood");Svg$$module$build$src$core$utils$svg.FEFUNCA=new Svg$$module$build$src$core$utils$svg("feFuncA");Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR=new Svg$$module$build$src$core$utils$svg("feGaussianBlur"); +Svg$$module$build$src$core$utils$svg.FEPOINTLIGHT=new Svg$$module$build$src$core$utils$svg("fePointLight");Svg$$module$build$src$core$utils$svg.FESPECULARLIGHTING=new Svg$$module$build$src$core$utils$svg("feSpecularLighting");Svg$$module$build$src$core$utils$svg.FILTER=new Svg$$module$build$src$core$utils$svg("filter");Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT=new Svg$$module$build$src$core$utils$svg("foreignObject");Svg$$module$build$src$core$utils$svg.G=new Svg$$module$build$src$core$utils$svg("g"); +Svg$$module$build$src$core$utils$svg.IMAGE=new Svg$$module$build$src$core$utils$svg("image");Svg$$module$build$src$core$utils$svg.LINE=new Svg$$module$build$src$core$utils$svg("line");Svg$$module$build$src$core$utils$svg.PATH=new Svg$$module$build$src$core$utils$svg("path");Svg$$module$build$src$core$utils$svg.PATTERN=new Svg$$module$build$src$core$utils$svg("pattern");Svg$$module$build$src$core$utils$svg.POLYGON=new Svg$$module$build$src$core$utils$svg("polygon"); +Svg$$module$build$src$core$utils$svg.RECT=new Svg$$module$build$src$core$utils$svg("rect");Svg$$module$build$src$core$utils$svg.SVG=new Svg$$module$build$src$core$utils$svg("svg");Svg$$module$build$src$core$utils$svg.TEXT=new Svg$$module$build$src$core$utils$svg("text");Svg$$module$build$src$core$utils$svg.TSPAN=new Svg$$module$build$src$core$utils$svg("tspan");var module$build$src$core$utils$svg={};module$build$src$core$utils$svg.Svg=Svg$$module$build$src$core$utils$svg;var Rect$$module$build$src$core$utils$rect=class{constructor(a,b,c,d){this.top=a;this.bottom=b;this.left=c;this.right=d}static from(a){return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}clone(){return new Rect$$module$build$src$core$utils$rect(this.top,this.bottom,this.left,this.right)}getHeight(){return this.bottom-this.top}getWidth(){return this.right-this.left}getOrigin(){return new Coordinate$$module$build$src$core$utils$coordinate(this.left,this.top)}contains(a, +b){return a>=this.left&&a<=this.right&&b>=this.top&&b<=this.bottom}intersects(a){return this.left<=a.right&&this.right>=a.left&&this.bottom>=a.top&&this.top<=a.bottom}static equals(a,b){return a===b?!0:a&&b?a.top===b.top&&a.bottom===b.bottom&&a.left===b.left&&a.right===b.right:!1}static createFromPoint(a,b,c){const d=a.x;a=a.y;return new Rect$$module$build$src$core$utils$rect(a,a+c,d,d+b)}},module$build$src$core$utils$rect={};module$build$src$core$utils$rect.Rect=Rect$$module$build$src$core$utils$rect;var Size$$module$build$src$core$utils$size=class{constructor(a,b){this.width=a;this.height=b}static equals(a,b){return a===b?!0:a&&b?a.width===b.width&&a.height===b.height:!1}static max(a,b){return new Size$$module$build$src$core$utils$size(Math.max(a.width,b.width),Math.max(a.height,b.height))}static min(a,b){return new Size$$module$build$src$core$utils$size(Math.min(a.width,b.width),Math.min(a.height,b.height))}},module$build$src$core$utils$size={};module$build$src$core$utils$size.Size=Size$$module$build$src$core$utils$size;var TEST_ONLY$$module$build$src$core$utils$style={getSizeInternal:getSizeInternal$$module$build$src$core$utils$style},module$build$src$core$utils$style={TEST_ONLY:TEST_ONLY$$module$build$src$core$utils$style};module$build$src$core$utils$style.getBorderBox=getBorderBox$$module$build$src$core$utils$style;module$build$src$core$utils$style.getComputedStyle=getComputedStyle$$module$build$src$core$utils$style;module$build$src$core$utils$style.getContainerOffsetToScrollInto=getContainerOffsetToScrollInto$$module$build$src$core$utils$style; +module$build$src$core$utils$style.getPageOffset=getPageOffset$$module$build$src$core$utils$style;module$build$src$core$utils$style.getSize=getSize$$module$build$src$core$utils$style;module$build$src$core$utils$style.getViewportPageOffset=getViewportPageOffset$$module$build$src$core$utils$style;module$build$src$core$utils$style.scrollIntoContainerView=scrollIntoContainerView$$module$build$src$core$utils$style;var XY_REGEX$$module$build$src$core$utils$svg_math=/translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/,XY_STYLE_REGEX$$module$build$src$core$utils$svg_math=/transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/,TEST_ONLY$$module$build$src$core$utils$svg_math={XY_REGEX:XY_REGEX$$module$build$src$core$utils$svg_math,XY_STYLE_REGEX:XY_STYLE_REGEX$$module$build$src$core$utils$svg_math},module$build$src$core$utils$svg_math={TEST_ONLY:TEST_ONLY$$module$build$src$core$utils$svg_math}; +module$build$src$core$utils$svg_math.getDocumentScroll=getDocumentScroll$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.getInjectionDivXY=getInjectionDivXY$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.getRelativeXY=getRelativeXY$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.getViewportBBox=getViewportBBox$$module$build$src$core$utils$svg_math;module$build$src$core$utils$svg_math.screenToWsCoordinates=screenToWsCoordinates$$module$build$src$core$utils$svg_math; +module$build$src$core$utils$svg_math.wsToScreenCoordinates=wsToScreenCoordinates$$module$build$src$core$utils$svg_math;var Scrollbar$$module$build$src$core$scrollbar=class{constructor(a,b,c,d,e){this.workspace=a;this.horizontal=b;this.oldHostMetrics=null;this.ratio=1;this.origin=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.startDragHandle=this.handlePosition=this.handleLength=this.scrollbarLength=this.startDragMouse=0;this.containerVisible=this.isHandleVisible=!0;this.position=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.onMouseMoveWrapper_=this.onMouseUpWrapper_=null;this.pair= +c||!1;this.margin=e!==void 0?e:Scrollbar$$module$build$src$core$scrollbar.DEFAULT_SCROLLBAR_MARGIN;a="blocklyScrollbar"+(this.horizontal?"Horizontal":"Vertical");d&&(a+=" "+d);this.outerSvg=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{"class":a});d=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},this.outerSvg);this.svgBackground=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT, +{"class":"blocklyScrollbarBackground"},d);a=Math.floor((Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness-5)/2);this.svgHandle=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyScrollbarHandle",rx:a,ry:a},d);this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarColour","fill");this.workspace.getThemeManager().subscribe(this.svgHandle,"scrollbarOpacity","fill-opacity");insertAfter$$module$build$src$core$utils$dom(this.outerSvg, +this.workspace.getParentSvg());this.setInitialThickness();b?(this.lengthAttribute_="width",this.positionAttribute_="x"):(this.lengthAttribute_="height",this.positionAttribute_="y");this.onMouseDownBarWrapper_=conditionalBind$$module$build$src$core$browser_events(this.svgBackground,"pointerdown",this,this.onMouseDownBar);this.onMouseDownHandleWrapper_=conditionalBind$$module$build$src$core$browser_events(this.svgHandle,"pointerdown",this,this.onMouseDownHandle)}setInitialThickness(){const a=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness; +this.horizontal?(this.svgBackground.setAttribute("height",String(a)),this.outerSvg.setAttribute("height",String(a)),this.svgHandle.setAttribute("height",String(a-5)),this.svgHandle.setAttribute("y","2.5")):(this.svgBackground.setAttribute("width",String(a)),this.outerSvg.setAttribute("width",String(a)),this.svgHandle.setAttribute("width",String(a-5)),this.svgHandle.setAttribute("x","2.5"))}dispose(){this.cleanUp();unbind$$module$build$src$core$browser_events(this.onMouseDownBarWrapper_);unbind$$module$build$src$core$browser_events(this.onMouseDownHandleWrapper_); +removeNode$$module$build$src$core$utils$dom(this.outerSvg);this.workspace.getThemeManager().unsubscribe(this.svgHandle)}constrainHandleLength(a){return a=a<=0||isNaN(a)?0:Math.min(a,this.scrollbarLength)}setHandleLength(a){this.handleLength=a;this.svgHandle.setAttribute(this.lengthAttribute_,String(this.handleLength))}constrainHandlePosition(a){return a=a<=0||isNaN(a)?0:Math.min(a,this.scrollbarLength-this.handleLength)}setHandlePosition(a){this.handlePosition=a;this.svgHandle.setAttribute(this.positionAttribute_, +String(this.handlePosition))}setScrollbarLength(a){this.scrollbarLength=a;this.outerSvg.setAttribute(this.lengthAttribute_,String(this.scrollbarLength));this.svgBackground.setAttribute(this.lengthAttribute_,String(this.scrollbarLength))}setPosition(a,b){this.position.x=a;this.position.y=b;setCssTransform$$module$build$src$core$utils$dom(this.outerSvg,"translate("+(this.position.x+this.origin.x)+"px,"+(this.position.y+this.origin.y)+"px)")}resize(a){if(!a&&(a=this.workspace.getMetrics(),!a))return; +this.oldHostMetrics&&Scrollbar$$module$build$src$core$scrollbar.metricsAreEquivalent(a,this.oldHostMetrics)||(this.horizontal?this.resizeHorizontal(a):this.resizeVertical(a),this.oldHostMetrics=a,this.updateMetrics())}requiresViewResize(a){return this.oldHostMetrics?this.oldHostMetrics.viewWidth!==a.viewWidth||this.oldHostMetrics.viewHeight!==a.viewHeight||this.oldHostMetrics.absoluteLeft!==a.absoluteLeft||this.oldHostMetrics.absoluteTop!==a.absoluteTop:!0}resizeHorizontal(a){this.requiresViewResize(a)? +this.resizeViewHorizontal(a):this.resizeContentHorizontal(a)}resizeViewHorizontal(a){var b=a.viewWidth-this.margin*2;this.pair&&(b-=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness);this.setScrollbarLength(Math.max(0,b));b=a.absoluteLeft+this.margin;this.pair&&this.workspace.RTL&&(b+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness);this.setPosition(b,a.absoluteTop+a.viewHeight-Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness-this.margin);this.resizeContentHorizontal(a)}resizeContentHorizontal(a){if(a.viewWidth>= +a.scrollWidth)this.setHandleLength(this.scrollbarLength),this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var b=this.scrollbarLength*a.viewWidth/a.scrollWidth;b=this.constrainHandleLength(b);this.setHandleLength(b);b=a.scrollWidth-a.viewWidth;var c=this.scrollbarLength-this.handleLength;a=(a.viewLeft-a.scrollLeft)/b*c;a=this.constrainHandlePosition(a);this.setHandlePosition(a);this.ratio=c/b}}resizeVertical(a){this.requiresViewResize(a)?this.resizeViewVertical(a): +this.resizeContentVertical(a)}resizeViewVertical(a){let b=a.viewHeight-this.margin*2;this.pair&&(b-=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness);this.setScrollbarLength(Math.max(0,b));this.setPosition(this.workspace.RTL?a.absoluteLeft+this.margin:a.absoluteLeft+a.viewWidth-Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness-this.margin,a.absoluteTop+this.margin);this.resizeContentVertical(a)}resizeContentVertical(a){if(a.viewHeight>=a.scrollHeight)this.setHandleLength(this.scrollbarLength), +this.setHandlePosition(0),this.pair||this.setVisible(!1);else{this.pair||this.setVisible(!0);var b=this.scrollbarLength*a.viewHeight/a.scrollHeight;b=this.constrainHandleLength(b);this.setHandleLength(b);b=a.scrollHeight-a.viewHeight;var c=this.scrollbarLength-this.handleLength;a=(a.viewTop-a.scrollTop)/b*c;a=this.constrainHandlePosition(a);this.setHandlePosition(a);this.ratio=c/b}}isVisible(){return this.isHandleVisible}setContainerVisible(a){const b=a!==this.containerVisible;this.containerVisible= +a;b&&this.updateDisplay_()}setVisible(a){if(this.pair)throw Error("Unable to toggle visibility of paired scrollbars.");this.setVisibleInternal(a)}setVisibleInternal(a){const b=a!==this.isVisible();this.isHandleVisible=a;b&&this.updateDisplay_()}updateDisplay_(){this.containerVisible&&this.isVisible()?this.outerSvg.setAttribute("display","block"):this.outerSvg.setAttribute("display","none")}onMouseDownBar(a){this.workspace.markFocused();clearTouchIdentifier$$module$build$src$core$touch();this.cleanUp(); +if(isRightButton$$module$build$src$core$browser_events(a))a.stopPropagation();else{var b=mouseToSvg$$module$build$src$core$browser_events(a,this.workspace.getParentSvg(),this.workspace.getInverseScreenCTM());b=this.horizontal?b.x:b.y;var c=getInjectionDivXY$$module$build$src$core$utils$svg_math(this.svgHandle);c=this.horizontal?c.x:c.y;var d=this.handlePosition,e=this.handleLength*.95;b<=c?d-=e:b>=c+this.handleLength&&(d+=e);this.setHandlePosition(this.constrainHandlePosition(d));this.updateMetrics(); +a.stopPropagation();a.preventDefault()}}onMouseDownHandle(a){this.workspace.markFocused();this.cleanUp();isRightButton$$module$build$src$core$browser_events(a)?a.stopPropagation():(this.startDragHandle=this.handlePosition,this.startDragMouse=this.horizontal?a.clientX:a.clientY,this.onMouseUpWrapper_=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onMouseUpHandle),this.onMouseMoveWrapper_=conditionalBind$$module$build$src$core$browser_events(document,"pointermove", +this,this.onMouseMoveHandle),a.stopPropagation(),a.preventDefault())}onMouseMoveHandle(a){this.setHandlePosition(this.constrainHandlePosition(this.startDragHandle+((this.horizontal?a.clientX:a.clientY)-this.startDragMouse)));this.updateMetrics()}onMouseUpHandle(){clearTouchIdentifier$$module$build$src$core$touch();this.cleanUp()}cleanUp(){this.workspace.hideChaff(!0);this.onMouseUpWrapper_&&(unbind$$module$build$src$core$browser_events(this.onMouseUpWrapper_),this.onMouseUpWrapper_=null);this.onMouseMoveWrapper_&& +(unbind$$module$build$src$core$browser_events(this.onMouseMoveWrapper_),this.onMouseMoveWrapper_=null)}getRatio_(){let a=this.handlePosition/(this.scrollbarLength-this.handleLength);isNaN(a)&&(a=0);return a}updateMetrics(){const a=this.getRatio_();this.horizontal?this.workspace.setMetrics({x:a}):this.workspace.setMetrics({y:a})}set(a,b){this.setHandlePosition(this.constrainHandlePosition(a*this.ratio));(b||b===void 0)&&this.updateMetrics()}setOrigin(a,b){this.origin=new Coordinate$$module$build$src$core$utils$coordinate(a, +b)}static metricsAreEquivalent(a,b){return a.viewWidth===b.viewWidth&&a.viewHeight===b.viewHeight&&a.viewLeft===b.viewLeft&&a.viewTop===b.viewTop&&a.absoluteTop===b.absoluteTop&&a.absoluteLeft===b.absoluteLeft&&a.scrollWidth===b.scrollWidth&&a.scrollHeight===b.scrollHeight&&a.scrollLeft===b.scrollLeft&&a.scrollTop===b.scrollTop}};Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness=TOUCH_ENABLED$$module$build$src$core$touch?25:15; +Scrollbar$$module$build$src$core$scrollbar.DEFAULT_SCROLLBAR_MARGIN=.5;var module$build$src$core$scrollbar={};module$build$src$core$scrollbar.Scrollbar=Scrollbar$$module$build$src$core$scrollbar;var domParser$$module$build$src$core$utils$xml={parseFromString:function(){throw Error("DOMParser was not found in the global scope and was not properly injected using injectDependencies");}},xmlSerializer$$module$build$src$core$utils$xml={serializeToString:function(){throw Error("XMLSerializer was not foundin the global scope and was not properly injected using injectDependencies");}},{document:document$$module$build$src$core$utils$xml,DOMParser:DOMParser$$module$build$src$core$utils$xml,XMLSerializer:XMLSerializer$$module$build$src$core$utils$xml}= +globalThis;DOMParser$$module$build$src$core$utils$xml&&(domParser$$module$build$src$core$utils$xml=new DOMParser$$module$build$src$core$utils$xml);XMLSerializer$$module$build$src$core$utils$xml&&(xmlSerializer$$module$build$src$core$utils$xml=new XMLSerializer$$module$build$src$core$utils$xml); +var NAME_SPACE$$module$build$src$core$utils$xml="https://developers.google.com/blockly/xml",INVALID_CONTROL_CHARS$$module$build$src$core$utils$xml=/[\x00-\x09\x0B\x0C\x0E-\x1F]/g,module$build$src$core$utils$xml={NAME_SPACE:NAME_SPACE$$module$build$src$core$utils$xml};module$build$src$core$utils$xml.createElement=$.createElement$$module$build$src$core$utils$xml;module$build$src$core$utils$xml.createTextNode=$.createTextNode$$module$build$src$core$utils$xml; +module$build$src$core$utils$xml.domToText=domToText$$module$build$src$core$utils$xml;module$build$src$core$utils$xml.injectDependencies=injectDependencies$$module$build$src$core$utils$xml;module$build$src$core$utils$xml.textToDom=$.textToDom$$module$build$src$core$utils$xml;var CATEGORY_TOOLBOX_KIND$$module$build$src$core$utils$toolbox="categoryToolbox",FLYOUT_TOOLBOX_KIND$$module$build$src$core$utils$toolbox="flyoutToolbox",Position$$module$build$src$core$utils$toolbox;(function(a){a[a.TOP=0]="TOP";a[a.BOTTOM=1]="BOTTOM";a[a.LEFT=2]="LEFT";a[a.RIGHT=3]="RIGHT"})(Position$$module$build$src$core$utils$toolbox||(Position$$module$build$src$core$utils$toolbox={})); +var TEST_ONLY$$module$build$src$core$utils$toolbox={hasCategoriesInternal:hasCategoriesInternal$$module$build$src$core$utils$toolbox},module$build$src$core$utils$toolbox={};module$build$src$core$utils$toolbox.Position=Position$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.TEST_ONLY=TEST_ONLY$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.convertFlyoutDefToJsonArray=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox; +module$build$src$core$utils$toolbox.convertToolboxDefToJson=convertToolboxDefToJson$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.hasCategories=hasCategories$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.isCategoryCollapsible=isCategoryCollapsible$$module$build$src$core$utils$toolbox;module$build$src$core$utils$toolbox.parseToolboxTree=parseToolboxTree$$module$build$src$core$utils$toolbox;var verticalPosition$$module$build$src$core$positionable_helpers;(function(a){a[a.TOP=0]="TOP";a[a.BOTTOM=1]="BOTTOM"})(verticalPosition$$module$build$src$core$positionable_helpers||(verticalPosition$$module$build$src$core$positionable_helpers={}));var horizontalPosition$$module$build$src$core$positionable_helpers;(function(a){a[a.LEFT=0]="LEFT";a[a.RIGHT=1]="RIGHT"})(horizontalPosition$$module$build$src$core$positionable_helpers||(horizontalPosition$$module$build$src$core$positionable_helpers={})); +var bumpDirection$$module$build$src$core$positionable_helpers;(function(a){a[a.UP=0]="UP";a[a.DOWN=1]="DOWN"})(bumpDirection$$module$build$src$core$positionable_helpers||(bumpDirection$$module$build$src$core$positionable_helpers={}));var module$build$src$core$positionable_helpers={};module$build$src$core$positionable_helpers.bumpDirection=bumpDirection$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.bumpPositionRect=bumpPositionRect$$module$build$src$core$positionable_helpers; +module$build$src$core$positionable_helpers.getCornerOppositeToolbox=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.getStartPositionRect=getStartPositionRect$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.horizontalPosition=horizontalPosition$$module$build$src$core$positionable_helpers;module$build$src$core$positionable_helpers.verticalPosition=verticalPosition$$module$build$src$core$positionable_helpers;var SPRITE$$module$build$src$core$sprites={width:96,height:124,url:"sprites.png"},module$build$src$core$sprites={SPRITE:SPRITE$$module$build$src$core$sprites};var ZoomControls$$module$build$src$core$zoom_controls=class{constructor(a){this.workspace=a;this.id="zoomControls";this.boundEvents=[];this.zoomResetGroup=this.zoomOutGroup=this.zoomInGroup=null;this.HEIGHT=this.WIDTH=32;this.SMALL_SPACING=2;this.LARGE_SPACING=11;this.MARGIN_HORIZONTAL=this.MARGIN_VERTICAL=20;this.svgGroup=null;this.top=this.left=0;this.initialized=!1}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});const a=String(Math.random()).substring(2); +this.createZoomOutSvg(a);this.createZoomInSvg(a);this.workspace.isMovable()&&this.createZoomResetSvg(a);return this.svgGroup}init(){this.workspace.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.ZOOM_CONTROLS_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE]});this.initialized=!0}dispose(){this.workspace.getComponentManager().removeComponent("zoomControls");this.svgGroup&& +removeNode$$module$build$src$core$utils$dom(this.svgGroup);for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);this.boundEvents.length=0}getBoundingRectangle(){let a=this.SMALL_SPACING+2*this.HEIGHT;this.zoomResetGroup&&(a+=this.LARGE_SPACING+this.HEIGHT);return new Rect$$module$build$src$core$utils$rect(this.top,this.top+a,this.left,this.left+this.WIDTH)}position(a,b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace, +a),d=this.SMALL_SPACING+2*this.HEIGHT;this.zoomResetGroup&&(d+=this.LARGE_SPACING+this.HEIGHT);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(this.WIDTH,d),this.MARGIN_HORIZONTAL,this.MARGIN_VERTICAL,a,this.workspace);c=c.vertical;b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,this.MARGIN_VERTICAL,c===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN: +bumpDirection$$module$build$src$core$positionable_helpers.UP,b);if(c===verticalPosition$$module$build$src$core$positionable_helpers.TOP){var e=this.SMALL_SPACING+this.HEIGHT,f;(f=this.zoomInGroup)==null||f.setAttribute("transform","translate(0, "+e+")");this.zoomResetGroup&&this.zoomResetGroup.setAttribute("transform","translate(0, "+(e+this.LARGE_SPACING+this.HEIGHT)+")")}else{f=this.zoomResetGroup?this.LARGE_SPACING+this.HEIGHT:0;let h;(h=this.zoomInGroup)==null||h.setAttribute("transform","translate(0, "+ +f+")");f=f+this.SMALL_SPACING+this.HEIGHT;(e=this.zoomOutGroup)==null||e.setAttribute("transform","translate(0, "+f+")")}this.top=b.top;this.left=b.left;var g;(g=this.svgGroup)==null||g.setAttribute("transform","translate("+this.left+","+this.top+")")}}createZoomOutSvg(a){this.zoomOutGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomOut"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH, +{id:"blocklyZoomoutClipPath"+a},this.zoomOutGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-64,y:-92,"clip-path":"url(#blocklyZoomoutClipPath"+a+")"},this.zoomOutGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href", +this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomOutGroup,"pointerdown",null,this.zoom.bind(this,-1)))}createZoomInSvg(a){this.zoomInGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomIn"},this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoominClipPath"+ +a},this.zoomInGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,x:-32,y:-92,"clip-path":"url(#blocklyZoominClipPath"+a+")"},this.zoomInGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+ +SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomInGroup,"pointerdown",null,this.zoom.bind(this,1)))}zoom(a,b){this.workspace.markFocused();this.workspace.zoomCenter(a);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();b.stopPropagation();b.preventDefault()}createZoomResetSvg(a){this.zoomResetGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyZoom blocklyZoomReset"}, +this.svgGroup);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyZoomresetClipPath"+a},this.zoomResetGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:32,height:32},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,height:SPRITE$$module$build$src$core$sprites.height,y:-92,"clip-path":"url(#blocklyZoomresetClipPath"+ +a+")"},this.zoomResetGroup).setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.zoomResetGroup,"pointerdown",null,this.resetZoom.bind(this)))}resetZoom(a){this.workspace.markFocused();const b=Math.log(this.workspace.options.zoomOptions.startScale/this.workspace.scale)/Math.log(this.workspace.options.zoomOptions.scaleSpeed); +this.workspace.beginCanvasTransition();this.workspace.zoomCenter(b);this.workspace.scrollCenter();setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),500);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();a.stopPropagation();a.preventDefault()}fireZoomEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(null,this.workspace.id,"zoom_controls");fire$$module$build$src$core$events$utils(a)}};register$$module$build$src$core$css("\n.blocklyZoom>image, .blocklyZoom>svg>image {\n opacity: .4;\n}\n\n.blocklyZoom>image:hover, .blocklyZoom>svg>image:hover {\n opacity: .6;\n}\n\n.blocklyZoom>image:active, .blocklyZoom>svg>image:active {\n opacity: .8;\n}\n"); +var module$build$src$core$zoom_controls={};module$build$src$core$zoom_controls.ZoomControls=ZoomControls$$module$build$src$core$zoom_controls;var VARIABLES$$module$build$src$core$serialization$priorities=100,PROCEDURES$$module$build$src$core$serialization$priorities=75,BLOCKS$$module$build$src$core$serialization$priorities=50,WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities=25,module$build$src$core$serialization$priorities={BLOCKS:BLOCKS$$module$build$src$core$serialization$priorities,PROCEDURES:PROCEDURES$$module$build$src$core$serialization$priorities,VARIABLES:VARIABLES$$module$build$src$core$serialization$priorities, +WORKSPACE_COMMENTS:WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities};var module$build$src$core$serialization$registry={};module$build$src$core$serialization$registry.register=register$$module$build$src$core$serialization$registry;module$build$src$core$serialization$registry.unregister=unregister$$module$build$src$core$serialization$registry;var saveComment$$module$build$src$core$serialization$workspace_comments=save$$module$build$src$core$serialization$workspace_comments,WorkspaceCommentSerializer$$module$build$src$core$serialization$workspace_comments=class{constructor(){this.priority=WORKSPACE_COMMENTS$$module$build$src$core$serialization$priorities}save(a){const b=[];for(const c of a.getTopComments())(a=save$$module$build$src$core$serialization$workspace_comments(c,{addCoordinates:!0,saveIds:!0}))&&b.push(a);return b.length?b:null}load(a, +b){for(const c of a)append$$module$build$src$core$serialization$workspace_comments(c,b,{recordUndo:getRecordUndo$$module$build$src$core$events$utils()})}clear(a){for(const b of a.getTopComments())b.dispose()}};register$$module$build$src$core$serialization$registry("workspaceComments",new WorkspaceCommentSerializer$$module$build$src$core$serialization$workspace_comments);var module$build$src$core$serialization$workspace_comments={}; +module$build$src$core$serialization$workspace_comments.WorkspaceCommentSerializer=WorkspaceCommentSerializer$$module$build$src$core$serialization$workspace_comments;module$build$src$core$serialization$workspace_comments.append=append$$module$build$src$core$serialization$workspace_comments;module$build$src$core$serialization$workspace_comments.save=save$$module$build$src$core$serialization$workspace_comments;var module$build$src$core$clipboard$registry={};module$build$src$core$clipboard$registry.register=register$$module$build$src$core$clipboard$registry;module$build$src$core$clipboard$registry.unregister=unregister$$module$build$src$core$clipboard$registry;var WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster=class{paste(a,b,c){a=a.commentState;c&&(a.x=c.x,a.y=c.y);$.disable$$module$build$src$core$events$utils();let d;try{d=append$$module$build$src$core$serialization$workspace_comments(a,b),moveCommentToNotConflict$$module$build$src$core$clipboard$workspace_comment_paster(d)}finally{$.enable$$module$build$src$core$events$utils()}if(!d)return null;isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CREATE))(d)); +$.getFocusManager$$module$build$src$core$focus_manager().focusNode(d);return d}};WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE="workspace-comment";register$$module$build$src$core$clipboard$registry(WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,new WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster);var module$build$src$core$clipboard$workspace_comment_paster={}; +module$build$src$core$clipboard$workspace_comment_paster.WorkspaceCommentPaster=WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster;var DEFAULT_SNAP_RADIUS$$module$build$src$core$config,module$build$src$core$config;DEFAULT_SNAP_RADIUS$$module$build$src$core$config=28;$.config$$module$build$src$core$config={dragRadius:5,flyoutDragRadius:10,snapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,connectingSnapRadius:DEFAULT_SNAP_RADIUS$$module$build$src$core$config,currentConnectionPreference:8,bumpDelay:250};module$build$src$core$config={config:$.config$$module$build$src$core$config};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";a.SEPARATOR="separator";a.STATUS="status"})(Role$$module$build$src$core$utils$aria||(Role$$module$build$src$core$utils$aria={}));var State$$module$build$src$core$utils$aria; +(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";a.LIVE="live";a.HIDDEN="hidden"})(State$$module$build$src$core$utils$aria||(State$$module$build$src$core$utils$aria={})); +var module$build$src$core$utils$aria={};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 MenuItem$$module$build$src$core$menuitem=class{constructor(a,b){this.content=a;this.opt_value=b;this.enabled=!0;this.element=null;this.rightToLeft=!1;this.roleName=null;this.highlight=this.checked=this.checkable=!1;this.actionHandler=null}createDom(){const a=document.createElement("div");a.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.element=a;a.className="blocklyMenuItem "+(this.enabled?"":"blocklyMenuItemDisabled ")+(this.checked?"blocklyMenuItemSelected ":"")+(this.highlight? +"blocklyMenuItemHighlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl ":"");const b=document.createElement("div");b.className="blocklyMenuItemContent";if(this.checkable){var c=document.createElement("div");c.className="blocklyMenuItemCheckbox ";b.appendChild(c)}c=this.content;typeof this.content==="string"&&(c=document.createTextNode(this.content));b.appendChild(c);a.appendChild(b);this.roleName&&setRole$$module$build$src$core$utils$aria(a,this.roleName);setState$$module$build$src$core$utils$aria(a, +State$$module$build$src$core$utils$aria.SELECTED,this.checkable&&this.checked||!1);setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.DISABLED,!this.enabled);return a}dispose(){this.element=null}getElement(){return this.element}getId(){return this.element.id}getValue(){let a;return(a=this.opt_value)!=null?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"):removeClass$$module$build$src$core$utils$dom(b,"blocklyMenuItemHighlight"))}isEnabled(){return this.enabled}setEnabled(a){this.enabled=a}performAction(a){this.isEnabled()&&this.actionHandler&&this.actionHandler(this,a)}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 Menu$$module$build$src$core$menu=class{constructor(){this.menuItems=[];this.roleName=this.element=this.onKeyDownHandler=this.pointerLeaveHandler=this.pointerEnterHandler=this.clickHandler=this.pointerMoveHandler=this.highlightedItem=this.openingCoords=null}addChild(a){this.menuItems.push(a)}render(a){const b=document.createElement("div");b.className="blocklyMenu";b.tabIndex=0;this.roleName&&setRole$$module$build$src$core$utils$aria(b,this.roleName);this.element=b;for(let c=0,d;d=this.menuItems[c];c++)b.appendChild(d.createDom()); +this.pointerMoveHandler=conditionalBind$$module$build$src$core$browser_events(b,"pointermove",this,this.handlePointerMove,!0);this.clickHandler=conditionalBind$$module$build$src$core$browser_events(b,"pointerup",this,this.handleClick,!0);this.pointerEnterHandler=conditionalBind$$module$build$src$core$browser_events(b,"pointerenter",this,this.handlePointerEnter,!0);this.pointerLeaveHandler=conditionalBind$$module$build$src$core$browser_events(b,"pointerleave",this,this.handlePointerLeave,!0);this.onKeyDownHandler= +conditionalBind$$module$build$src$core$browser_events(b,"keydown",this,this.handleKeyEvent);a.appendChild(b);return b}getElement(){return this.element}focus(){const a=this.getElement();a&&a.focus({preventScroll:!0})}blur(){const a=this.getElement();a&&a.blur()}setRole(a){this.roleName=a}dispose(){this.pointerMoveHandler&&(unbind$$module$build$src$core$browser_events(this.pointerMoveHandler),this.pointerMoveHandler=null);this.clickHandler&&(unbind$$module$build$src$core$browser_events(this.clickHandler), +this.clickHandler=null);this.pointerEnterHandler&&(unbind$$module$build$src$core$browser_events(this.pointerEnterHandler),this.pointerEnterHandler=null);this.pointerLeaveHandler&&(unbind$$module$build$src$core$browser_events(this.pointerLeaveHandler),this.pointerLeaveHandler=null);this.onKeyDownHandler&&(unbind$$module$build$src$core$browser_events(this.onKeyDownHandler),this.onKeyDownHandler=null);for(let a=0,b;b=this.menuItems[a];a++)b.dispose();this.element=null}getMenuItem(a){const b=this.getElement(); +for(;a&&a!==b;){if(a.classList.contains("blocklyMenuItem")){const c=this.getMenuItems();for(let d=0,e;e=c[d];d++)if(e.getElement()===a)return e}a=a.parentElement}return null}setHighlighted(a){var b=this.highlightedItem;b&&(b.setHighlighted(!1),this.highlightedItem=null);if(a){a.setHighlighted(!0);this.highlightedItem=a;b=this.getElement();const c=a.getElement();b&&c&&(scrollIntoContainerView$$module$build$src$core$utils$style(c,b),setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.ACTIVEDESCENDANT, +a.getId()))}}highlightNext(){const a=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(a,1)}highlightPrevious(){const a=this.highlightedItem?this.menuItems.indexOf(this.highlightedItem):-1;this.highlightHelper(a<0?this.menuItems.length:a,-1)}highlightFirst(){this.highlightHelper(-1,1)}highlightLast(){this.highlightHelper(this.menuItems.length,-1)}highlightHelper(a,b){a+=b;let c;const d=this.getMenuItems();for(;c=d[a];){if(c.isEnabled()){this.setHighlighted(c); +break}a+=b}}handlePointerMove(a){Math.max(Math.abs(a.movementX),Math.abs(a.movementY))!==0&&(a=this.getMenuItem(a.target))&&(a.isEnabled()?this.highlightedItem!==a&&this.setHighlighted(a):this.setHighlighted(null))}handleClick(a){var b=this.openingCoords;this.openingCoords=null;if(b&&typeof a.clientX==="number"){const c=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);if(Coordinate$$module$build$src$core$utils$coordinate.distance(b,c)<1)return}(b=this.getMenuItem(a.target))&& +b.performAction(a)}handlePointerEnter(a){this.focus()}handlePointerLeave(a){this.getElement()&&this.setHighlighted(null)}handleKeyEvent(a){if(this.menuItems.length&&!(a.shiftKey||a.ctrlKey||a.metaKey||a.altKey)){var b=this.highlightedItem;switch(a.key){case "Enter":case " ":b&&b.performAction(a);break;case "ArrowUp":this.highlightPrevious();break;case "ArrowDown":this.highlightNext();break;case "PageUp":case "Home":this.highlightFirst();break;case "PageDown":case "End":this.highlightLast();break; +default:return}a.preventDefault();a.stopPropagation()}}getSize(){const a=this.getElement(),b=getSize$$module$build$src$core$utils$style(a);b.height=a.scrollHeight;return b}getMenuItems(){return this.menuItems.filter(a=>a instanceof MenuItem$$module$build$src$core$menuitem)}},module$build$src$core$menu={};module$build$src$core$menu.Menu=Menu$$module$build$src$core$menu;var MenuSeparator$$module$build$src$core$menu_separator=class{constructor(){this.element=null}createDom(){this.element=document.createElement("hr");this.element.className="blocklyMenuSeparator";setRole$$module$build$src$core$utils$aria(this.element,Role$$module$build$src$core$utils$aria.SEPARATOR);return this.element}dispose(){let a;(a=this.element)==null||a.remove();this.element=null}},module$build$src$core$menu_separator={};module$build$src$core$menu_separator.MenuSeparator=MenuSeparator$$module$build$src$core$menu_separator;var COLLAPSED_INPUT_NAME$$module$build$src$core$constants="_TEMP_COLLAPSED_INPUT",COLLAPSED_FIELD_NAME$$module$build$src$core$constants="_TEMP_COLLAPSED_FIELD",MANUALLY_DISABLED$$module$build$src$core$constants="MANUALLY_DISABLED",module$build$src$core$constants={COLLAPSED_FIELD_NAME:COLLAPSED_FIELD_NAME$$module$build$src$core$constants,COLLAPSED_INPUT_NAME:COLLAPSED_INPUT_NAME$$module$build$src$core$constants,MANUALLY_DISABLED:MANUALLY_DISABLED$$module$build$src$core$constants};(function(a){a[a.VALUE=1]="VALUE";a[a.STATEMENT=3]="STATEMENT";a[a.DUMMY=5]="DUMMY";a[a.CUSTOM=6]="CUSTOM";a[a.END_ROW=7]="END_ROW"})($.inputTypes$$module$build$src$core$inputs$input_types||($.inputTypes$$module$build$src$core$inputs$input_types={}));var module$build$src$core$inputs$input_types={};module$build$src$core$inputs$input_types.inputTypes=$.inputTypes$$module$build$src$core$inputs$input_types;var module$build$src$core$interfaces$i_serializable={};module$build$src$core$interfaces$i_serializable.isSerializable=isSerializable$$module$build$src$core$interfaces$i_serializable;var rootBlocks$$module$build$src$core$render_management=new Set,dirtyBlocks$$module$build$src$core$render_management=new WeakSet,eventGroups$$module$build$src$core$render_management=new WeakMap,afterRendersPromise$$module$build$src$core$render_management=null,afterRendersResolver$$module$build$src$core$render_management=null,animationRequestId$$module$build$src$core$render_management=0,module$build$src$core$render_management={};module$build$src$core$render_management.finishQueuedRenders=finishQueuedRenders$$module$build$src$core$render_management; +module$build$src$core$render_management.queueRender=queueRender$$module$build$src$core$render_management;module$build$src$core$render_management.triggerQueuedRenders=triggerQueuedRenders$$module$build$src$core$render_management;var setLocale$$module$build$src$core$msg,module$build$src$core$msg;$.Msg$$module$build$src$core$msg=Object.create(null);setLocale$$module$build$src$core$msg=function(a){Object.keys(a).forEach(function(b){$.Msg$$module$build$src$core$msg[b]=a[b]})};module$build$src$core$msg={Msg:$.Msg$$module$build$src$core$msg,setLocale:setLocale$$module$build$src$core$msg};var CLASS_NAME$$module$build$src$core$toast="blocklyToast",MESSAGE_CLASS_NAME$$module$build$src$core$toast="blocklyToastMessage",CLOSE_BUTTON_CLASS_NAME$$module$build$src$core$toast="blocklyToastCloseButton",Toast$$module$build$src$core$toast=class{static show(a,b){if(b.oncePerSession&&b.id){if(this.shownIds.has(b.id))return;this.shownIds.add(b.id)}this.hide(a);const c=this.createDom(a,b);requestAnimationFrame(()=>{c.style.bottom="2rem"})}static createDom(a,b){const {message:c,duration:d=5,assertiveness:e= +Toast$$module$build$src$core$toast.Assertiveness.POLITE}=b,f=document.createElement("div");a.getInjectionDiv().appendChild(f);f.dataset.toastId=b.id;f.className=CLASS_NAME$$module$build$src$core$toast;setRole$$module$build$src$core$utils$aria(f,Role$$module$build$src$core$utils$aria.STATUS);setState$$module$build$src$core$utils$aria(f,State$$module$build$src$core$utils$aria.LIVE,e);b=f.appendChild(document.createElement("div"));b.className=MESSAGE_CLASS_NAME$$module$build$src$core$toast;b.innerText= +c;b=f.appendChild(document.createElement("button"));b.className=CLOSE_BUTTON_CLASS_NAME$$module$build$src$core$toast;setState$$module$build$src$core$utils$aria(b,State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.CLOSE);var g=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{width:24,height:24,viewBox:"0 0 24 24",fill:"none"},b);setState$$module$build$src$core$utils$aria(g,State$$module$build$src$core$utils$aria.HIDDEN,!0);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT, +{x:19.7782,y:2.80762,width:2,height:24,transform:"rotate(45, 19.7782, 2.80762)",fill:"black"},g);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{x:2.80762,y:4.22183,width:2,height:24,transform:"rotate(-45, 2.80762, 4.22183)",fill:"black"},g);b.addEventListener("click",()=>{f.remove();a.markFocused()});let h;b=()=>{h=setTimeout(()=>f.remove(),d*1E3)};g=()=>clearTimeout(h);f.addEventListener("focusin",g);f.addEventListener("focusout",b);f.addEventListener("mouseenter", +g);f.addEventListener("mousemove",g);f.addEventListener("mouseleave",b);b();return f}static hide(a,b){a=a.getInjectionDiv().querySelector(`.${CLASS_NAME$$module$build$src$core$toast}`);a instanceof HTMLElement&&(!b||b===a.dataset.toastId)&&a.remove()}};Toast$$module$build$src$core$toast.shownIds=new Set;(function(a){a=a.Assertiveness||(a.Assertiveness={});a.ASSERTIVE="assertive";a.POLITE="polite"})(Toast$$module$build$src$core$toast||(Toast$$module$build$src$core$toast={}));register$$module$build$src$core$css(` +.${CLASS_NAME$$module$build$src$core$toast} { + font-size: 1.2rem; + position: absolute; + bottom: -10rem; + right: 2rem; + padding: 1rem; + color: black; + background-color: white; + border: 2px solid black; + border-radius: 0.4rem; + z-index: 999; + display: flex; + align-items: center; + gap: 0.8rem; + line-height: 1.5; + transition: bottom 0.3s ease-out; +} + +.${CLASS_NAME$$module$build$src$core$toast} .${MESSAGE_CLASS_NAME$$module$build$src$core$toast} { + maxWidth: 18rem; +} + +.${CLASS_NAME$$module$build$src$core$toast} .${CLOSE_BUTTON_CLASS_NAME$$module$build$src$core$toast} { + margin: 0; + padding: 0.2rem; + background-color: transparent; + color: black; + border: none; + cursor: pointer; +} +`);var module$build$src$core$toast={};module$build$src$core$toast.Toast=Toast$$module$build$src$core$toast;var defaultAlert$$module$build$src$core$dialog=function(a,b){window.alert(a);b&&b()},alertImplementation$$module$build$src$core$dialog=defaultAlert$$module$build$src$core$dialog,defaultConfirm$$module$build$src$core$dialog=function(a,b){b(window.confirm(a))},confirmImplementation$$module$build$src$core$dialog=defaultConfirm$$module$build$src$core$dialog,defaultPrompt$$module$build$src$core$dialog=function(a,b,c){c(window.prompt(a,b))},promptImplementation$$module$build$src$core$dialog=defaultPrompt$$module$build$src$core$dialog, +defaultToast$$module$build$src$core$dialog=Toast$$module$build$src$core$toast.show.bind(Toast$$module$build$src$core$toast),toastImplementation$$module$build$src$core$dialog=defaultToast$$module$build$src$core$dialog,module$build$src$core$dialog={};module$build$src$core$dialog.alert=alert$$module$build$src$core$dialog;module$build$src$core$dialog.confirm=confirm$$module$build$src$core$dialog;module$build$src$core$dialog.prompt=prompt$$module$build$src$core$dialog; +module$build$src$core$dialog.setAlert=setAlert$$module$build$src$core$dialog;module$build$src$core$dialog.setConfirm=setConfirm$$module$build$src$core$dialog;module$build$src$core$dialog.setPrompt=setPrompt$$module$build$src$core$dialog;module$build$src$core$dialog.setToast=setToast$$module$build$src$core$dialog;module$build$src$core$dialog.toast=toast$$module$build$src$core$dialog;var module$build$src$core$interfaces$i_legacy_procedure_blocks={};module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureCallBlock=isLegacyProcedureCallBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;module$build$src$core$interfaces$i_legacy_procedure_blocks.isLegacyProcedureDefBlock=isLegacyProcedureDefBlock$$module$build$src$core$interfaces$i_legacy_procedure_blocks;var module$build$src$core$interfaces$i_variable_backed_parameter_model={};module$build$src$core$interfaces$i_variable_backed_parameter_model.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;var previousWarnings$$module$build$src$core$utils$deprecation=new Set,module$build$src$core$utils$deprecation={};module$build$src$core$utils$deprecation.warn=warn$$module$build$src$core$utils$deprecation;var CATEGORY_NAME$$module$build$src$core$variables="VARIABLE",VAR_LETTER_OPTIONS$$module$build$src$core$variables="ijkmnopqrstuvwxyzabcdefgh",TEST_ONLY$$module$build$src$core$variables={generateUniqueNameInternal:generateUniqueNameInternal$$module$build$src$core$variables},module$build$src$core$variables={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables,TEST_ONLY:TEST_ONLY$$module$build$src$core$variables,VAR_LETTER_OPTIONS:VAR_LETTER_OPTIONS$$module$build$src$core$variables}; +module$build$src$core$variables.allDeveloperVariables=$.allDeveloperVariables$$module$build$src$core$variables;module$build$src$core$variables.allUsedVarModels=$.allUsedVarModels$$module$build$src$core$variables;module$build$src$core$variables.compareByName=compareByName$$module$build$src$core$variables;module$build$src$core$variables.createVariableButtonHandler=createVariableButtonHandler$$module$build$src$core$variables;module$build$src$core$variables.deleteVariable=$.deleteVariable$$module$build$src$core$variables; +module$build$src$core$variables.flyoutCategory=flyoutCategory$$module$build$src$core$variables;module$build$src$core$variables.flyoutCategoryBlocks=flyoutCategoryBlocks$$module$build$src$core$variables;module$build$src$core$variables.generateUniqueName=generateUniqueName$$module$build$src$core$variables;module$build$src$core$variables.generateUniqueNameFromOptions=generateUniqueNameFromOptions$$module$build$src$core$variables;module$build$src$core$variables.generateVariableFieldDom=generateVariableFieldDom$$module$build$src$core$variables; +module$build$src$core$variables.getAddedVariables=getAddedVariables$$module$build$src$core$variables;module$build$src$core$variables.getOrCreateVariablePackage=$.getOrCreateVariablePackage$$module$build$src$core$variables;module$build$src$core$variables.getVariable=$.getVariable$$module$build$src$core$variables;module$build$src$core$variables.getVariableUsesById=getVariableUsesById$$module$build$src$core$variables;module$build$src$core$variables.internalFlyoutCategory=internalFlyoutCategory$$module$build$src$core$variables; +module$build$src$core$variables.jsonFlyoutCategoryBlocks=jsonFlyoutCategoryBlocks$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithAnyType=nameUsedWithAnyType$$module$build$src$core$variables;module$build$src$core$variables.nameUsedWithConflictingParam=nameUsedWithConflictingParam$$module$build$src$core$variables;module$build$src$core$variables.promptName=promptName$$module$build$src$core$variables;module$build$src$core$variables.renameVariable=$.renameVariable$$module$build$src$core$variables;var DeserializationError$$module$build$src$core$serialization$exceptions=class extends Error{},MissingBlockType$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Expected to find a 'type' property, defining the block type");this.state=a}},MissingConnection$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a, +b,c){super(`The block ${b.toDevString()} is missing a(n) ${a} +connection`);this.block=b;this.state=c}},BadConnectionCheck$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a,b,c,d){super(`The block ${c.toDevString()} could not connect its +${b} to its parent, because: ${a}`);this.childBlock=c;this.childState=d}},RealChildOfShadow$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a){super("Encountered a real block which is defined as a child of a shadow\nblock. It is an invariant of Blockly that shadow blocks only have shadow\nchildren");this.state=a}},UnregisteredIcon$$module$build$src$core$serialization$exceptions=class extends DeserializationError$$module$build$src$core$serialization$exceptions{constructor(a, +b,c){super(`Cannot add an icon of type '${a}' to the block `+`${b.toDevString()}, because there is no icon registered with `+`type '${a}'. Make sure that all of your icons have been `+"registered.");this.block=b;this.state=c}},module$build$src$core$serialization$exceptions={};module$build$src$core$serialization$exceptions.BadConnectionCheck=BadConnectionCheck$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.DeserializationError=DeserializationError$$module$build$src$core$serialization$exceptions; +module$build$src$core$serialization$exceptions.MissingBlockType=MissingBlockType$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.MissingConnection=MissingConnection$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.RealChildOfShadow=RealChildOfShadow$$module$build$src$core$serialization$exceptions;module$build$src$core$serialization$exceptions.UnregisteredIcon=UnregisteredIcon$$module$build$src$core$serialization$exceptions;var saveBlock$$module$build$src$core$serialization$blocks=save$$module$build$src$core$serialization$blocks,BlockSerializer$$module$build$src$core$serialization$blocks=class{constructor(){this.priority=BLOCKS$$module$build$src$core$serialization$priorities}save(a){const b=[];for(const c of a.getTopBlocks(!1))(a=save$$module$build$src$core$serialization$blocks(c,{addCoordinates:!0,doFullSerialization:!1}))&&b.push(a);return b.length?{languageVersion:0,blocks:b}:null}load(a,b){a=a.blocks;for(const c of a)append$$module$build$src$core$serialization$blocks(c, +b,{recordUndo:getRecordUndo$$module$build$src$core$events$utils()})}clear(a){for(const b of a.getTopBlocks(!1))b.dispose(!1)}};register$$module$build$src$core$serialization$registry("blocks",new BlockSerializer$$module$build$src$core$serialization$blocks);var module$build$src$core$serialization$blocks={};module$build$src$core$serialization$blocks.BlockSerializer=BlockSerializer$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.append=append$$module$build$src$core$serialization$blocks; +module$build$src$core$serialization$blocks.appendInternal=appendInternal$$module$build$src$core$serialization$blocks;module$build$src$core$serialization$blocks.save=save$$module$build$src$core$serialization$blocks;var IconType$$module$build$src$core$icons$icon_types=class{constructor(a){this.name=a}toString(){return this.name}equals(a){return this.name===a.toString()}};IconType$$module$build$src$core$icons$icon_types.MUTATOR=new IconType$$module$build$src$core$icons$icon_types("mutator");IconType$$module$build$src$core$icons$icon_types.WARNING=new IconType$$module$build$src$core$icons$icon_types("warning");IconType$$module$build$src$core$icons$icon_types.COMMENT=new IconType$$module$build$src$core$icons$icon_types("comment"); +var module$build$src$core$icons$icon_types={};module$build$src$core$icons$icon_types.IconType=IconType$$module$build$src$core$icons$icon_types;var module$build$src$core$interfaces$i_has_bubble={};module$build$src$core$interfaces$i_has_bubble.hasBubble=hasBubble$$module$build$src$core$interfaces$i_has_bubble;var BlockBase$$module$build$src$core$events$events_block_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!a;a&&(this.blockId=a.id,this.workspaceId=a.workspace.id)}toJson(){const a=super.toJson();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");a.blockId=this.blockId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BlockBase$$module$build$src$core$events$events_block_base); +b.blockId=a.blockId;return b}},module$build$src$core$events$events_block_base={};module$build$src$core$events$events_block_base.BlockBase=BlockBase$$module$build$src$core$events$events_block_base;var BlockChange$$module$build$src$core$events$events_block_change=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a,b,c,d,e){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CHANGE;a&&(this.element=b,this.name=c||void 0,this.oldValue=d,this.newValue=e)}toJson(){const a=super.toJson();if(!this.element)throw Error("The changed element is undefined. Either pass an element to the constructor, or call fromJson");a.element=this.element;a.name=this.name; +a.oldValue=this.oldValue;a.newValue=this.newValue;this.disabledReason&&(a.disabledReason=this.disabledReason);return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BlockChange$$module$build$src$core$events$events_block_change);b.element=a.element;b.name=a.name;b.oldValue=a.oldValue;b.newValue=a.newValue;a.disabledReason!==void 0&&(b.disabledReason=a.disabledReason);return b}setDisabledReason(a){if(this.element!=="disabled")throw Error('Cannot set the disabled reason for a BlockChange event if the element is not "disabled".'); +this.disabledReason=a}isNull(){return this.oldValue===this.newValue}run(a){var b=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");b=b.getBlockById(this.blockId);if(!b)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");const c=b.getIcon(IconType$$module$build$src$core$icons$icon_types.MUTATOR);c&&hasBubble$$module$build$src$core$interfaces$i_has_bubble(c)&& +c.bubbleIsVisible()&&c.setBubbleVisible(!1);a=a?this.newValue:this.oldValue;switch(this.element){case "field":(b=b.getField(this.name))?b.setValue(a):console.warn("Can't set non-existent field: "+this.name);break;case "comment":b.setCommentText(a||null);break;case "collapsed":b.setCollapsed(!!a);break;case "disabled":var d;b.setDisabledReason(!!a,(d=this.disabledReason)!=null?d:MANUALLY_DISABLED$$module$build$src$core$constants);break;case "inline":b.setInputsInline(!!a);break;case "mutation":d=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(b); +b.loadExtraState?b.loadExtraState(JSON.parse(a||"{}")):b.domToMutation&&b.domToMutation($.textToDom$$module$build$src$core$utils$xml(a||""));fire$$module$build$src$core$events$utils(new BlockChange$$module$build$src$core$events$events_block_change(b,"mutation",null,d,a));break;default:console.warn("Unknown change type: "+this.element)}}static getExtraBlockState_(a){return a.saveExtraState?(a=a.saveExtraState(!0))?JSON.stringify(a):"":a.mutationToDom?(a=a.mutationToDom())?domToText$$module$build$src$core$xml(a): +"":""}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_CHANGE,BlockChange$$module$build$src$core$events$events_block_change);var module$build$src$core$events$events_block_change={};module$build$src$core$events$events_block_change.BlockChange=BlockChange$$module$build$src$core$events$events_block_change;var module$build$src$core$utils$math={};module$build$src$core$utils$math.clamp=clamp$$module$build$src$core$utils$math;module$build$src$core$utils$math.toDegrees=toDegrees$$module$build$src$core$utils$math;module$build$src$core$utils$math.toRadians=toRadians$$module$build$src$core$utils$math;var ARROW_SIZE$$module$build$src$core$dropdowndiv=16,BORDER_SIZE$$module$build$src$core$dropdowndiv=1,ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv=12,PADDING_Y$$module$build$src$core$dropdowndiv=16,ANIMATION_TIME$$module$build$src$core$dropdowndiv=.25,animateOutTimer$$module$build$src$core$dropdowndiv=null,onHide$$module$build$src$core$dropdowndiv=null,renderedClassName$$module$build$src$core$dropdowndiv="",themeClassName$$module$build$src$core$dropdowndiv="",div$$module$build$src$core$dropdowndiv, +content$$module$build$src$core$dropdowndiv,arrow$$module$build$src$core$dropdowndiv,boundsElement$$module$build$src$core$dropdowndiv=null,owner$$module$build$src$core$dropdowndiv=null,positionToField$$module$build$src$core$dropdowndiv=null,returnEphemeralFocus$$module$build$src$core$dropdowndiv=null,keydownListener$$module$build$src$core$dropdowndiv=null,internal$$module$build$src$core$dropdowndiv={getBoundsInfo:function(){const a=getPageOffset$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv), +b=getSize$$module$build$src$core$utils$style(boundsElement$$module$build$src$core$dropdowndiv);return{left:a.x,right:a.x+b.width,top:a.y,bottom:a.y+b.height,width:b.width,height:b.height}},getPositionMetrics:function(a,b,c,d){const e=internal$$module$build$src$core$dropdowndiv.getBoundsInfo(),f=getSize$$module$build$src$core$utils$style(div$$module$build$src$core$dropdowndiv);return b+f.heighte.top?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c, +d,e,f):b+f.heightdocument.documentElement.clientTop?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,d,e,f):getPositionTopOfPageMetrics$$module$build$src$core$dropdowndiv(a,e,f)}},TEST_ONLY$$module$build$src$core$dropdowndiv=internal$$module$build$src$core$dropdowndiv,module$build$src$core$dropdowndiv={ANIMATION_TIME:ANIMATION_TIME$$module$build$src$core$dropdowndiv,ARROW_HORIZONTAL_PADDING:ARROW_HORIZONTAL_PADDING$$module$build$src$core$dropdowndiv, +ARROW_SIZE:ARROW_SIZE$$module$build$src$core$dropdowndiv,BORDER_SIZE:BORDER_SIZE$$module$build$src$core$dropdowndiv,PADDING_Y:PADDING_Y$$module$build$src$core$dropdowndiv,TEST_ONLY:internal$$module$build$src$core$dropdowndiv};module$build$src$core$dropdowndiv.clearContent=clearContent$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.createDom=createDom$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.getContentDiv=getContentDiv$$module$build$src$core$dropdowndiv; +module$build$src$core$dropdowndiv.getOwner=getOwner$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.getPositionX=getPositionX$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.hide=hide$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.hideIfOwner=hideIfOwner$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.hideWithoutAnimation=hideWithoutAnimation$$module$build$src$core$dropdowndiv; +module$build$src$core$dropdowndiv.isVisible=isVisible$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.repositionForWindowResize=repositionForWindowResize$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.setBoundsElement=setBoundsElement$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.setColour=setColour$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.show=show$$module$build$src$core$dropdowndiv; +module$build$src$core$dropdowndiv.showPositionedByBlock=showPositionedByBlock$$module$build$src$core$dropdowndiv;module$build$src$core$dropdowndiv.showPositionedByField=showPositionedByField$$module$build$src$core$dropdowndiv;var module$build$src$core$utils$string={};module$build$src$core$utils$string.commonWordPrefix=commonWordPrefix$$module$build$src$core$utils$string;module$build$src$core$utils$string.commonWordSuffix=commonWordSuffix$$module$build$src$core$utils$string;module$build$src$core$utils$string.isNumber=$.isNumber$$module$build$src$core$utils$string;module$build$src$core$utils$string.shortestStringLength=shortestStringLength$$module$build$src$core$utils$string;module$build$src$core$utils$string.wrap=$.wrap$$module$build$src$core$utils$string;var customTooltip$$module$build$src$core$tooltip=void 0,visible$$module$build$src$core$tooltip=!1,blocked$$module$build$src$core$tooltip=!1,LIMIT$$module$build$src$core$tooltip=50,mouseOutPid$$module$build$src$core$tooltip=0,showPid$$module$build$src$core$tooltip=0,lastX$$module$build$src$core$tooltip=0,lastY$$module$build$src$core$tooltip=0,element$$module$build$src$core$tooltip=null,poisonedElement$$module$build$src$core$tooltip=null,OFFSET_X$$module$build$src$core$tooltip=0,OFFSET_Y$$module$build$src$core$tooltip= +10,RADIUS_OK$$module$build$src$core$tooltip=10,HOVER_MS$$module$build$src$core$tooltip=750,MARGINS$$module$build$src$core$tooltip=5,containerDiv$$module$build$src$core$tooltip=null,module$build$src$core$tooltip={HOVER_MS:HOVER_MS$$module$build$src$core$tooltip,LIMIT:LIMIT$$module$build$src$core$tooltip,MARGINS:MARGINS$$module$build$src$core$tooltip,OFFSET_X:OFFSET_X$$module$build$src$core$tooltip,OFFSET_Y:OFFSET_Y$$module$build$src$core$tooltip,RADIUS_OK:RADIUS_OK$$module$build$src$core$tooltip}; +module$build$src$core$tooltip.bindMouseEvents=bindMouseEvents$$module$build$src$core$tooltip;module$build$src$core$tooltip.block=block$$module$build$src$core$tooltip;module$build$src$core$tooltip.createDom=createDom$$module$build$src$core$tooltip;module$build$src$core$tooltip.dispose=dispose$$module$build$src$core$tooltip;module$build$src$core$tooltip.getCustomTooltip=getCustomTooltip$$module$build$src$core$tooltip;module$build$src$core$tooltip.getDiv=getDiv$$module$build$src$core$tooltip; +module$build$src$core$tooltip.getTooltipOfObject=getTooltipOfObject$$module$build$src$core$tooltip;module$build$src$core$tooltip.hide=hide$$module$build$src$core$tooltip;module$build$src$core$tooltip.isVisible=isVisible$$module$build$src$core$tooltip;module$build$src$core$tooltip.setCustomTooltip=setCustomTooltip$$module$build$src$core$tooltip;module$build$src$core$tooltip.unbindMouseEvents=unbindMouseEvents$$module$build$src$core$tooltip;module$build$src$core$tooltip.unblock=unblock$$module$build$src$core$tooltip;var hsvSaturation$$module$build$src$core$utils$colour=.45,hsvValue$$module$build$src$core$utils$colour=.65,names$$module$build$src$core$utils$colour={aqua:"#00ffff",black:"#000000",blue:"#0000ff",fuchsia:"#ff00ff",gray:"#808080",green:"#008000",lime:"#00ff00",maroon:"#800000",navy:"#000080",olive:"#808000",purple:"#800080",red:"#ff0000",silver:"#c0c0c0",teal:"#008080",white:"#ffffff",yellow:"#ffff00"},module$build$src$core$utils$colour={};module$build$src$core$utils$colour.blend=blend$$module$build$src$core$utils$colour; +module$build$src$core$utils$colour.getHsvSaturation=getHsvSaturation$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.getHsvValue=getHsvValue$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hexToRgb=hexToRgb$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hsvToHex=hsvToHex$$module$build$src$core$utils$colour;module$build$src$core$utils$colour.hueToHex=hueToHex$$module$build$src$core$utils$colour; +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 Field$$module$build$src$core$field=class{get size_(){return this.size}set size_(a){this.size=a}constructor(a,b,c){this.DEFAULT_VALUE=null;this.name=void 0;this.tooltip=this.validator_=null;this.size=new Size$$module$build$src$core$utils$size(0,0);this.constants_=this.mouseDownWrapper=this.textContent_=this.textElement_=this.borderRect_=this.fieldGroup_=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.id_=null;this.value_="DEFAULT_VALUE"in new.target.prototype?new.target.prototype.DEFAULT_VALUE:this.DEFAULT_VALUE;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;if(a.id.includes("_field"))throw Error("Field ID indicator is contained in block ID. This may cause "+`problems with focus: ${a.id}.`);this.id_=`${a.id}_field_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`}getConstants(){!this.constants_&&this.sourceBlock_&&!this.sourceBlock_.isDeadOrDying()&&this.sourceBlock_.workspace.rendered&&(this.constants_=this.sourceBlock_.workspace.getRenderer().getConstants());return this.constants_}getSourceBlock(){return this.sourceBlock_}init(){if(!this.fieldGroup_){var a= +this.id_;if(!a)throw Error("Expected ID to be defined prior to init.");this.fieldGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{id:a});this.isVisible()||(this.fieldGroup_.style.display="none");this.sourceBlock_.getSvgRoot().appendChild(this.fieldGroup_);this.initView();this.updateEditable();this.setTooltip(this.tooltip);this.bindEvents_();this.initModel();this.applyColour()}}initView(){this.createBorderRect_();this.createTextElement_();this.fieldGroup_&& +addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField")}initModel(){}isFullBlockField(){return!this.borderRect_}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_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT, +{"class":"blocklyText blocklyFieldText"},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=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown", +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 a!==null?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||""), +domToText$$module$build$src$core$utils$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$utils$xml(b)),!0):!1}dispose(){hideIfOwner$$module$build$src$core$dropdowndiv(this);hideIfOwner$$module$build$src$core$widgetdiv(this);let a;((a=this.getSourceBlock())==null?0:a.isDeadOrDying())||removeNode$$module$build$src$core$utils$dom(this.fieldGroup_); +this.disposed=!0}updateEditable(){const a=this.fieldGroup_,b=this.getSourceBlock();this.EDITABLE&&a&&b&&(this.enabled_&&b.isEditable()?(addClass$$module$build$src$core$utils$dom(a,"blocklyEditableField"),removeClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableField")):(addClass$$module$build$src$core$utils$dom(a,"blocklyNonEditableField"),removeClass$$module$build$src$core$utils$dom(a,"blocklyEditableField")))}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_}isClickableInFlyout(a){return!a}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."), +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_}.`);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){}repositionForWindowResize(){return!1}updateSize_(a){const b=this.getConstants();a=a!==void 0?a:this.isFullBlockField()?0:this.getConstants().FIELD_BORDER_RECT_X_PADDING;let c=a*2,d=b.FIELD_TEXT_HEIGHT,e=0;this.textElement_&&(e=getTextWidth$$module$build$src$core$utils$dom(this.textElement_), +c+=e);this.isFullBlockField()||(d=Math.max(d,b.FIELD_BORDER_RECT_HEIGHT));this.size_=new Size$$module$build$src$core$utils$size(c,d);this.positionTextElement_(a,e);this.positionBorderRect_()}positionTextElement_(a,b){if(this.textElement_){var c=this.getConstants(),d=this.size_.height/2,e;this.textElement_.setAttribute("x",String(((e=this.getSourceBlock())==null?0:e.RTL)?this.size_.width-b-a:a));this.textElement_.setAttribute("y",String(c.FIELD_TEXT_BASELINE_CENTER?d:d-c.FIELD_TEXT_HEIGHT/2+c.FIELD_TEXT_BASELINE))}}positionBorderRect_(){this.borderRect_&& +(this.borderRect_.setAttribute("width",String(this.size_.width)),this.borderRect_.setAttribute("height",String(this.size_.height)),this.borderRect_.setAttribute("rx",String(this.getConstants().FIELD_BORDER_RECT_RADIUS)),this.borderRect_.setAttribute("ry",String(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);return this.size_}getScaledBBox(){let a;var b=this.getSourceBlock(); +if(!b)throw new UnattachedFieldError$$module$build$src$core$field;if(this.isFullBlockField()){var c=this.sourceBlock_.getHeightWidth();const d=b.workspace.scale;a=this.getAbsoluteXY_();b=(c.width+1)*d;c=(c.height+1)*d;GECKO$$module$build$src$core$utils$useragent?(a.x+=1.5*d,a.y+=1.5*d):(a.x-=.5*d,a.y-=.5*d)}else c=this.borderRect_.getBoundingClientRect(),a=getPageOffset$$module$build$src$core$utils$style(this.borderRect_),b=c.width,c=c.height;return new Rect$$module$build$src$core$utils$rect(a.y, +a.y+c,a.x,a.x+b)}onLocationChange(a){}getDisplayText_(){let a=this.getText();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");return a}getText(){const a=this.getText_();return a!==null?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_.queueRender()}setValue(a,b=!0){if(a!==null){var c=$.getGroup$$module$build$src$core$events$utils();c||$.setGroup$$module$build$src$core$events$utils(!0);try{const k=this.doClassValidation_(a),l=this.processValidation(a,k,b);if(!(l instanceof Error)){var d,e=(d=this.getValidator())==null?void 0:d.call(this,l),f=this.processValidation(l,e,b);if(!(f instanceof Error)){var g=this.sourceBlock_;if(!g||!g.disposed){var h=this.getValue();h===f?this.doValueUpdate_(f):(this.doValueUpdate_(f), +b&&g&&isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(g,"field",this.name||null,h,f)),this.isDirty_&&this.forceRerender())}}}}finally{$.setGroup$$module$build$src$core$events$utils(c)}}}processValidation(a,b,c){return b===null?(this.doValueInvalid_(a,c),this.isDirty_&&this.forceRerender(),Error()):b===void 0?a:b}getValue(){return this.value_}doClassValidation_(a){return a=== +null||a===void 0?null:a}doValueUpdate_(a){this.value_=a;this.isDirty_=!0}doValueInvalid_(a,b){}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):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();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;const c=b.inputList;for(let d=0;d{d.stopPropagation();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this);clearTouchIdentifier$$module$build$src$core$touch()}); +conditionalBind$$module$build$src$core$browser_events(this.textArea,"wheel",this,d=>{d.stopPropagation()});conditionalBind$$module$build$src$core$browser_events(this.textArea,"keydown",this,this.handleKeyDown)}getDom(){return this.foreignObject}getText(){return this.text}setText(a){this.textArea.value=a;this.onTextChange()}onTextChange(){const a=this.text;this.text=this.textArea.value;for(let b=this.textChangeListeners.length-1;b>=0;b--)this.textChangeListeners[b](a,this.text)}handleKeyDown(a){if(a.key=== +"Escape"||a.key==="Enter"&&(a.ctrlKey||a.metaKey)){if(this.onFinishEditing)this.onFinishEditing();a.stopPropagation()}}addTextChangeListener(a){this.textChangeListeners.push(a)}removeTextChangeListener(a){this.textChangeListeners.splice(this.textChangeListeners.indexOf(a),1)}setPlaceholderText(a){this.textArea.placeholder=a}setEditable(a){a?this.textArea.removeAttribute("readonly"):this.textArea.setAttribute("readonly","true")}updateSize(a,b){this.foreignObject.setAttribute("height",`${a.height-b.height}`); +this.foreignObject.setAttribute("width",`${a.width}`);this.foreignObject.setAttribute("y",`${b.height}`);this.workspace.RTL&&this.foreignObject.setAttribute("x",`${-a.width}`)}getFocusableElement(){return this.textArea}getFocusableTree(){return this.workspace}onNodeFocus(){const a=Rect$$module$build$src$core$utils$rect.from(this.foreignObject.getBoundingClientRect());this.workspace.scrollBoundsIntoView(Rect$$module$build$src$core$utils$rect.createFromPoint(screenToWsCoordinates$$module$build$src$core$utils$svg_math(this.workspace, +a.getOrigin()),a.getWidth(),a.getHeight()))}onNodeBlur(){}canBeFocused(){return this.id?!0:!1}},module$build$src$core$comments$comment_editor={COMMENT_EDITOR_FOCUS_IDENTIFIER:COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor};module$build$src$core$comments$comment_editor.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;var COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button="_delete_bar_button",DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button=class extends CommentBarButton$$module$build$src$core$comments$comment_bar_button{constructor(a,b,c,d){super(a,b,c,d);this.id=a;this.workspace=b;this.container=c;this.commentView=d;this.icon=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyDeleteIcon", +href:`${this.workspace.options.pathToMedia}delete-icon.svg`,id:`${this.id}${COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button}`},c);this.bindId=conditionalBind$$module$build$src$core$browser_events(this.icon,"pointerdown",this,this.performAction.bind(this))}dispose(){unbind$$module$build$src$core$browser_events(this.bindId)}reposition(){const a=this.getMargin();this.icon.setAttribute("x","0");const b=this.container.getBBox();this.icon.setAttribute("y", +`${a}`);this.icon.setAttribute("x",`${b.width-this.getSize(!0).getWidth()}`)}performAction(a){clearTouchIdentifier$$module$build$src$core$touch();a&&a instanceof PointerEvent&&isRightButton$$module$build$src$core$browser_events(a)?a.stopPropagation():(this.getCommentView().dispose(),a==null||a.stopPropagation(),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.workspace))}},module$build$src$core$comments$delete_comment_bar_button={COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER:COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button}; +module$build$src$core$comments$delete_comment_bar_button.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;var CommentView$$module$build$src$core$comments$comment_view=class{constructor(a,b){this.workspace=a;this.commentId=b;this.collapsed=!1;this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.sizeChangeListeners=[];this.disposeListeners=[];this.collapseChangeListeners=[];this.resizePointerMoveListener=this.resizePointerUpListener=null;this.disposed=this.disposing=!1;this.svgRoot=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G, +{"class":"blocklyComment blocklyEditable blocklyDraggable"});this.highlightRect=this.createHighlightRect(this.svgRoot);({topBarGroup:this.topBarGroup,topBarBackground:this.topBarBackground,deleteButton:this.deleteButton,foldoutButton:this.foldoutButton,textPreview:this.textPreview,textPreviewNode:this.textPreviewNode}=this.createTopBar(this.svgRoot));this.commentEditor=this.createTextArea();this.resizeHandle=this.createResizeHandle(this.svgRoot,a);let c;(c=a.getLayerManager())==null||c.append(this, +BLOCK$$module$build$src$core$layers);this.size=CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize;this.setSizeWithoutFiringEvents(this.size);this.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(0,0))}createHighlightRect(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentHighlight"},a)}createTopBar(a){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G, +{"class":"blocklyCommentTopbar"},a);const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyCommentTopbarBackground"},a),c=new DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button(this.commentId,this.workspace,a,this),d=new CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button(this.commentId,this.workspace,a,this);this.addDisposeListener(()=>{c.dispose();d.dispose()});const e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT, +{"class":"blocklyCommentPreview blocklyCommentText blocklyText"},a),f=document.createTextNode("");e.appendChild(f);return{topBarGroup:a,topBarBackground:b,deleteButton:c,foldoutButton:d,textPreview:e,textPreviewNode:f}}createTextArea(){const a=new CommentEditor$$module$build$src$core$comments$comment_editor(this.workspace,this.commentId,()=>this.svgRoot.focus());this.svgRoot.appendChild(a.getDom());a.addTextChangeListener((b,c)=>{this.updateTextPreview(c);this.setSize(this.size)});return a}getEditorFocusableNode(){return this.commentEditor}createResizeHandle(a, +b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}getSvgRoot(){return this.svgRoot}getSize(){return this.collapsed?this.topBarBackground.getBBox():this.size}setSizeWithoutFiringEvents(a){const b=this.topBarBackground.getBBox(),c=this.textPreview.getBBox(),d=this.resizeHandle.getBBox(); +this.size=a=Size$$module$build$src$core$utils$size.max(a,this.calcMinSize(b));this.svgRoot.setAttribute("height",`${a.height}`);this.svgRoot.setAttribute("width",`${a.width}`);this.updateHighlightRect(a);this.updateTopBarSize(a);this.commentEditor.updateSize(a,b);this.deleteButton.reposition();this.foldoutButton.reposition();this.updateTextPreviewSize(a,b,c);this.updateResizeHandlePosition(a,d)}setSize(a){const b=this.preResizeSize||this.size;this.setSizeWithoutFiringEvents(a);this.onSizeChange(b, +this.size)}calcMinSize(a){var b;this.updateTextPreview((b=this.commentEditor.getText())!=null?b:"");let c=b=getTextWidth$$module$build$src$core$utils$dom(this.textPreview);this.foldoutButton.isVisible()?c+=this.foldoutButton.getSize(!0).getWidth():b&&(c+=4);this.deleteButton.isVisible()?c+=this.deleteButton.getSize(!0).getWidth():b&&(c+=4);return new Size$$module$build$src$core$utils$size(c,a.height+20)}updateHighlightRect(a){this.highlightRect.setAttribute("height",`${a.height}`);this.highlightRect.setAttribute("width", +`${a.width}`);this.workspace.RTL&&this.highlightRect.setAttribute("x",`${-a.width}`)}updateTopBarSize(a){this.topBarBackground.setAttribute("width",`${a.width}`)}updateTextPreviewSize(a,b,c){b=(b.height-c.height)/2;const d=this.foldoutButton.getSize(!0),e=this.deleteButton.getSize(!0);a=a.width-d.getWidth()-e.getWidth();this.textPreview.setAttribute("x",`${(this.workspace.RTL?-1:1)*d.getWidth()}`);this.textPreview.setAttribute("y",`${b+c.height/2}`);this.textPreview.setAttribute("width",`${a}`)}updateResizeHandlePosition(a, +b){this.resizeHandle.setAttribute("y",`${a.height-b.height}`);this.resizeHandle.setAttribute("x",`${a.width-b.width}`)}onSizeChange(a,b){for(let c=this.sizeChangeListeners.length-1;c>=0;c--)this.sizeChangeListeners[c](a,b)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}removeSizeChangeListener(a){this.sizeChangeListeners.splice(this.sizeChangeListeners.indexOf(a),1)}onResizePointerDown(a){this.isEditable()&&(this.bringToFront(),isRightButton$$module$build$src$core$browser_events(a)||(this.preResizeSize= +this.getSize(),start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width,this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff()), +a.stopPropagation())}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener),this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null);this.setSize(this.size);this.preResizeSize=void 0}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace, +a);this.setSizeWithoutFiringEvents(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y))}isCollapsed(){return this.collapsed}setCollapsed(a){(this.collapsed=a)?addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCollapsed"):removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCollapsed");this.setSizeWithoutFiringEvents(this.size);this.onCollapse()}onCollapse(){for(let a=this.collapseChangeListeners.length-1;a>=0;a--)this.collapseChangeListeners[a](this.collapsed)}addOnCollapseListener(a){this.collapseChangeListeners.push(a)}removeOnCollapseListener(a){this.collapseChangeListeners.splice(this.collapseChangeListeners.indexOf(a), +1)}isEditable(){return this.editable}setEditable(a){(this.editable=a)?(addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyEditable"),removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyReadonly")):(removeClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyEditable"),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyReadonly"));this.commentEditor.setEditable(a)}getRelativeToSurfaceXY(){return this.location}moveTo(a){this.location=a;this.svgRoot.setAttribute("transform", +`translate(${a.x}, ${a.y})`)}getText(){return this.commentEditor.getText()}setText(a){this.commentEditor.setText(a)}setPlaceholderText(a){this.commentEditor.setPlaceholderText(a)}addTextChangeListener(a){this.commentEditor.addTextChangeListener(a)}removeTextChangeListener(a){this.commentEditor.removeTextChangeListener(a)}updateTextPreview(a){this.textPreviewNode.textContent=this.truncateText(a)}truncateText(a){return a.length>=12?`${a.substring(0,9)}...`:a}bringToFront(){const a=this.svgRoot.parentNode, +b=a.childNodes;b[b.length-1]!==this.svgRoot&&a.appendChild(this.svgRoot)}onDeleteDown(a){clearTouchIdentifier$$module$build$src$core$touch();isRightButton$$module$build$src$core$browser_events(a)||this.dispose();a.stopPropagation()}dispose(){this.disposing=!0;removeNode$$module$build$src$core$utils$dom(this.svgRoot);for(let a=this.disposeListeners.length-1;a>=0;a--)this.disposeListeners[a]();this.disposeListeners.length=0;this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing|| +this.disposed}addDisposeListener(a){this.disposeListeners.push(a)}removeDisposeListener(a){this.disposeListeners.splice(this.disposeListeners.indexOf(a),1)}getCommentBarButtons(){return[this.foldoutButton,this.deleteButton]}};CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize=new Size$$module$build$src$core$utils$size(120,100);register$$module$build$src$core$css("\n.injectionDiv {\n --commentFillColour: #FFFCC7;\n --commentBorderColour: #F2E49B;\n}\n\n.blocklyComment .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 1px solid var(--commentBorderColour);\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n\n.blocklyReadonly.blocklyComment .blocklyTextarea {\n cursor: inherit;\n}\n\n.blocklyDeleteIcon {\n width: 20px;\n height: 20px;\n display: none;\n cursor: pointer;\n}\n\n.blocklyFoldoutIcon {\n width: 20px;\n height: 20px;\n transform-origin: 12px 12px;\n cursor: pointer;\n}\n.blocklyResizeHandle {\n width: 12px;\n height: 12px;\n cursor: se-resize;\n}\n.blocklyReadonly.blocklyComment .blocklyResizeHandle {\n cursor: inherit;\n}\n\n.blocklyCommentTopbarBackground {\n fill: var(--commentBorderColour);\n height: 24px;\n}\n\n.blocklyComment .blocklyCommentPreview.blocklyText {\n fill: #000;\n dominant-baseline: middle;\n visibility: hidden;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyCommentPreview {\n visibility: visible;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyCommentForeignObject,\n.blocklyCollapsed.blocklyComment .blocklyResizeHandle {\n display: none;\n}\n\n.blocklyCollapsed.blocklyComment .blocklyFoldoutIcon {\n transform: rotate(-90deg);\n}\n\n.blocklyRTL .blocklyCommentTopbar {\n transform: scale(-1, 1);\n}\n\n.blocklyRTL .blocklyCommentForeignObject {\n direction: rtl;\n}\n\n.blocklyRTL .blocklyCommentPreview {\n /* Revert the scale and control RTL using direction instead. */\n transform: scale(-1, 1);\n direction: rtl;\n}\n\n.blocklyRTL .blocklyResizeHandle {\n transform: scale(-1, 1);\n cursor: sw-resize;\n}\n\n.blocklyCommentHighlight {\n fill: none;\n}\n\n.blocklyCommentText.blocklyActiveFocus {\n border-color: #fc3;\n border-width: 2px;\n}\n\n.blocklySelected .blocklyCommentHighlight {\n stroke: #fc3;\n stroke-width: 3px;\n}\n\n.blocklyCollapsed.blocklySelected .blocklyCommentHighlight {\n stroke: none;\n}\n\n.blocklyCollapsed.blocklySelected .blocklyCommentTopbarBackground {\n stroke: #fc3;\n stroke-width: 3px;\n}\n"); +var module$build$src$core$comments$comment_view={};module$build$src$core$comments$comment_view.CommentView=CommentView$$module$build$src$core$comments$comment_view;var WorkspaceComment$$module$build$src$core$comments$workspace_comment=class{constructor(a,b){this.workspace=a;this.text="";this.collapsed=!1;this.deletable=this.movable=this.editable=!0;this.location=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.disposing=this.disposed=!1;this.id=b&&!a.getCommentById(b)?b:genUid$$module$build$src$core$utils$idgenerator();this.size=CommentView$$module$build$src$core$comments$comment_view.defaultCommentSize;a.addTopComment(this);this.fireCreateEvent()}fireCreateEvent(){isEnabled$$module$build$src$core$events$utils()&& +fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CREATE))(this))}fireDeleteEvent(){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DELETE))(this))}fireChangeEvent(a,b){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_CHANGE))(this, +a,b))}fireCollapseEvent(a){isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE))(this,a))}setText(a){const b=this.text;this.text=a;this.fireChangeEvent(b,a)}getText(){return this.text}setSize(a){const b=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_RESIZE))(this);this.size=a;b.recordCurrentSizeAsNewSize(); +fire$$module$build$src$core$events$utils(b)}getSize(){return this.size}setCollapsed(a){this.collapsed=a;this.fireCollapseEvent(a)}isCollapsed(){return this.collapsed}setEditable(a){this.editable=a}isEditable(){return this.isOwnEditable()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setMovable(a){this.movable=a}isMovable(){return this.isOwnMovable()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnMovable(){return this.movable}setDeletable(a){this.deletable=a}isDeletable(){return this.isOwnDeletable()&& +!this.isDeadOrDying()&&!this.workspace.isReadOnly()&&!this.workspace.isFlyout}isOwnDeletable(){return this.deletable}moveTo(a,b){const c=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_MOVE))(this);b&&c.setReason(b);this.location=a;c.recordNew();fire$$module$build$src$core$events$utils(c)}getRelativeToSurfaceXY(){return this.location}dispose(){this.disposing=!0;this.fireDeleteEvent();this.workspace.removeTopComment(this);this.disposed=!0}isDisposed(){return this.disposed}isDeadOrDying(){return this.disposing|| +this.disposed}},module$build$src$core$comments$workspace_comment={};module$build$src$core$comments$workspace_comment.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment=class extends WorkspaceComment$$module$build$src$core$comments$workspace_comment{constructor(a,b){super(a,b);this.dragStrategy=new CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy(this);this.workspace=a;this.view=new CommentView$$module$build$src$core$comments$comment_view(a,this.id);this.view.setSize(this.getSize());this.view.setEditable(this.isEditable());this.view.getSvgRoot().setAttribute("data-id", +this.id);this.view.getSvgRoot().setAttribute("id",this.id);this.addModelUpdateBindings();conditionalBind$$module$build$src$core$browser_events(this.view.getSvgRoot(),"pointerdown",this,this.startGesture)}addModelUpdateBindings(){this.view.addTextChangeListener((a,b)=>void super.setText(b));this.view.addSizeChangeListener((a,b)=>void super.setSize(b));this.view.addOnCollapseListener(()=>void super.setCollapsed(this.view.isCollapsed()));this.view.addDisposeListener(()=>{this.isDeadOrDying()||this.dispose()})}setText(a){this.view.setText(a)}setPlaceholderText(a){this.view.setPlaceholderText(a)}setSize(a){this.view.setSize(a)}setCollapsed(a){this.view.setCollapsed(a)}setEditable(a){super.setEditable(a); +this.view.setEditable(this.isEditable())}getSvgRoot(){return this.view.getSvgRoot()}getSize(){return super.getSize()}getBoundingRectangle(){const a=this.getRelativeToSurfaceXY();var b,c;const d=(c=(b=this.view)==null?void 0:b.getSize())!=null?c:this.getSize();this.workspace.RTL?(b=a.x-d.width,c=a.x):(b=a.x,c=a.x+d.width);return new Rect$$module$build$src$core$utils$rect(a.y,a.y+d.height,b,c)}moveBy(a,b,c){const d=this.getRelativeToSurfaceXY();a=new Coordinate$$module$build$src$core$utils$coordinate(d.x+ +a,d.y+b);this.moveTo(a,c)}moveTo(a,b){super.moveTo(a,b);this.view.moveTo(a)}moveDuringDrag(a){this.location=a;this.view.moveTo(a)}setDragging(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDragging")}dispose(){this.disposing=!0;const a=$.getFocusManager$$module$build$src$core$focus_manager();a.getFocusedNode()===this&&setTimeout(()=>a.focusTree(this.workspace),0);this.view.isDeadOrDying()|| +this.view.dispose();super.dispose()}startGesture(a){const b=this.workspace.getGesture(a);b&&(b.handleCommentStart(a,this),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this))}setDeleteStyle(a){a?addClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete"):removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklyDraggingDelete")}isCopyable(){return this.isOwnMovable()&&this.isOwnDeletable()}isMovable(){return this.dragStrategy.isMovable()}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){addClass$$module$build$src$core$utils$dom(this.getSvgRoot(), +"blocklySelected");fireSelectedEvent$$module$build$src$core$common(this)}unselect(){removeClass$$module$build$src$core$utils$dom(this.getSvgRoot(),"blocklySelected");fireSelectedEvent$$module$build$src$core$common(null)}toCopyData(){return{paster:WorkspaceCommentPaster$$module$build$src$core$clipboard$workspace_comment_paster.TYPE,commentState:save$$module$build$src$core$serialization$workspace_comments(this,{addCoordinates:!0,saveIds:!1})}}showContextMenu(a){const b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({comment:this, +focusedNode:this},a);let c;c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY()).translate(10,10);show$$module$build$src$core$contextmenu(a,b,this.workspace.RTL,this.workspace,c)}snapToGrid(){if(!this.isDeadOrDying()){var a=this.workspace.getGrid();if(a!=null&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a, +["snap"])}}}getEditorFocusableNode(){return this.view.getEditorFocusableNode()}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();let a;(a=this.workspace.getLayerManager())==null||a.append(this,BLOCK$$module$build$src$core$layers);this.workspace.scrollBoundsIntoView(this.getBoundingRectangle())}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={}; +module$build$src$core$comments$rendered_workspace_comment.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;var module$build$src$core$xml={};module$build$src$core$xml.appendDomToWorkspace=appendDomToWorkspace$$module$build$src$core$xml;module$build$src$core$xml.blockToDom=blockToDom$$module$build$src$core$xml;module$build$src$core$xml.blockToDomWithXY=blockToDomWithXY$$module$build$src$core$xml;module$build$src$core$xml.clearWorkspaceAndLoadFromXml=clearWorkspaceAndLoadFromXml$$module$build$src$core$xml;module$build$src$core$xml.deleteNext=deleteNext$$module$build$src$core$xml; +module$build$src$core$xml.domToBlock=$.domToBlock$$module$build$src$core$xml;module$build$src$core$xml.domToBlockInternal=domToBlockInternal$$module$build$src$core$xml;module$build$src$core$xml.domToPrettyText=domToPrettyText$$module$build$src$core$xml;module$build$src$core$xml.domToText=domToText$$module$build$src$core$xml;module$build$src$core$xml.domToVariables=domToVariables$$module$build$src$core$xml;module$build$src$core$xml.domToWorkspace=$.domToWorkspace$$module$build$src$core$xml; +module$build$src$core$xml.loadWorkspaceComment=loadWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.saveWorkspaceComment=saveWorkspaceComment$$module$build$src$core$xml;module$build$src$core$xml.variablesToDom=variablesToDom$$module$build$src$core$xml;module$build$src$core$xml.workspaceToDom=workspaceToDom$$module$build$src$core$xml;var BlockCreate$$module$build$src$core$events$events_block_create=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_CREATE;a&&(a.isShadow()&&(this.recordUndo=!1),this.xml=blockToDomWithXY$$module$build$src$core$xml(a),this.ids=getDescendantIds$$module$build$src$core$events$utils(a),this.json=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0}))}toJson(){const a=super.toJson(); +if(!this.xml)throw Error("The block XML is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.ids=this.ids;a.json=this.json;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a, +b,c){b=super.fromJson(a,b,c!=null?c:new BlockCreate$$module$build$src$core$events$events_block_create);b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml);b.ids=a.ids;b.json=a.json;a.recordUndo!==void 0&&(b.recordUndo=a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();if(!this.json)throw Error("The block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson"); +if(!allShadowBlocks$$module$build$src$core$events$events_block_create(b,this.ids))if(a)append$$module$build$src$core$serialization$blocks(this.json,b);else for(a=0;aa.getBlockById(c)).filter(c=>c&&c.isShadow()).length===b.length}; +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_CREATE,BlockCreate$$module$build$src$core$events$events_block_create);var module$build$src$core$events$events_block_create={};module$build$src$core$events$events_block_create.BlockCreate=BlockCreate$$module$build$src$core$events$events_block_create;var ThemeChange$$module$build$src$core$events$events_theme_change=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(b);this.type=EventType$$module$build$src$core$events$type.THEME_CHANGE;this.themeName=a}toJson(){const a=super.toJson();if(!this.themeName)throw Error("The theme name is undefined. Either pass a theme name to the constructor, or call fromJson");a.themeName=this.themeName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new ThemeChange$$module$build$src$core$events$events_theme_change); +b.themeName=a.themeName;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.THEME_CHANGE,ThemeChange$$module$build$src$core$events$events_theme_change);var module$build$src$core$events$events_theme_change={};module$build$src$core$events$events_theme_change.ThemeChange=ThemeChange$$module$build$src$core$events$events_theme_change;var ViewportChange$$module$build$src$core$events$events_viewport=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c,d,e){super(d);this.type=EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE;this.viewTop=a;this.viewLeft=b;this.scale=c;this.oldScale=e}toJson(){const a=super.toJson();if(this.viewTop===void 0)throw Error("The view top is undefined. Either pass a value to the constructor, or call fromJson");if(this.viewLeft===void 0)throw Error("The view left is undefined. Either pass a value to the constructor, or call fromJson"); +if(this.scale===void 0)throw Error("The scale is undefined. Either pass a value to the constructor, or call fromJson");if(this.oldScale===void 0)throw Error("The old scale is undefined. Either pass a value to the constructor, or call fromJson");a.viewTop=this.viewTop;a.viewLeft=this.viewLeft;a.scale=this.scale;a.oldScale=this.oldScale;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new ViewportChange$$module$build$src$core$events$events_viewport);b.viewTop=a.viewTop;b.viewLeft=a.viewLeft; +b.scale=a.scale;b.oldScale=a.oldScale;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE,ViewportChange$$module$build$src$core$events$events_viewport);var module$build$src$core$events$events_viewport={};module$build$src$core$events$events_viewport.ViewportChange=ViewportChange$$module$build$src$core$events$events_viewport;var TEST_ONLY$$module$build$src$core$field_registry={fromJsonInternal:fromJsonInternal$$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 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.clickTarget_=this.suffixField=this.prefixField=this.generatedOptions=null;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(this.setOptions(a),c&&this.configure_(c),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();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");this.fieldGroup_&&(addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyField"),addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyDropdownField"))}shouldAddBorderRect_(){let a;return!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW&&!((a=this.getSourceBlock())== +null?0:a.isShadow())}createTextArrow_(){this.arrow=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TSPAN,{},this.textElement_);let a;this.arrow.appendChild(document.createTextNode(((a=this.getSourceBlock())==null?0:a.RTL)?FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR+" ":" "+FieldDropdown$$module$build$src$core$field_dropdown.ARROW_CHAR));this.getConstants().FIELD_TEXT_BASELINE_CENTER&&this.arrow.setAttribute("dominant-baseline","central");let b; +((b=this.getSourceBlock())==null?0:b.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,{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){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.dropdownCreate();this.menu_&&(this.menu_.openingCoords=a&&typeof a.clientX==="number"?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):null,clearContent$$module$build$src$core$dropdowndiv(),a=this.menu_.render(getContentDiv$$module$build$src$core$dropdowndiv()),addClass$$module$build$src$core$utils$dom(a, +"blocklyDropdownMenu"),this.getConstants().FIELD_DROPDOWN_COLOURED_DIV&&(b=b.getColour(),a=this.sourceBlock_.getColourTertiary(),setColour$$module$build$src$core$dropdowndiv(b,a)),showPositionedByField$$module$build$src$core$dropdowndiv(this,this.dropdownDispose_.bind(this)),getContentDiv$$module$build$src$core$dropdowndiv().style.height=`${this.menu_.getSize().height}px`,this.menu_.focus(),this.selectedMenuItem&&this.menu_.setHighlighted(this.selectedMenuItem),this.applyColour())}dropdownCreate(){const a= +this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;const b=new Menu$$module$build$src$core$menu;b.setRole(Role$$module$build$src$core$utils$aria.LISTBOX);this.menu_=b;const c=this.getOptions(!1);this.selectedMenuItem=null;for(let e=0;eb[1]===a)?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]===this.value_&&(this.selectedOption=c)}applyColour(){const a=this.sourceBlock_;this.borderRect_&&(this.borderRect_.setAttribute("stroke",a.getColourTertiary()),this.menu_?this.borderRect_.setAttribute("fill",a.getColourTertiary()):this.borderRect_.setAttribute("fill","transparent"));a&&this.arrow&&(a.isShadow()?this.arrow.style.fill=a.getColourSecondary():this.arrow.style.fill=a.getColour())}render_(){this.getTextContent().nodeValue="";this.imageElement.style.display= +"none";const a=this.selectedOption&&this.selectedOption[0];isImageProperties$$module$build$src$core$field_dropdown(a)?this.renderSelectedImage(a):this.renderSelectedText();this.positionBorderRect_()}renderSelectedImage(a){const b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.imageElement.style.display="";this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",a.src);this.imageElement.setAttribute("height",String(a.height)); +this.imageElement.setAttribute("width",String(a.width));const c=Number(a.height);a=Number(a.width);var d=!!this.borderRect_;const e=Math.max(d?this.getConstants().FIELD_DROPDOWN_BORDER_RECT_HEIGHT:0,c+FieldDropdown$$module$build$src$core$field_dropdown.IMAGE_Y_PADDING);d=d?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let f;f=this.svgArrow?this.positionSVGArrow(a+d,e/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2):getTextWidth$$module$build$src$core$utils$dom(this.arrow);this.size_=new Size$$module$build$src$core$utils$size(a+ +f+d*2,e);let g=0;b.RTL?this.imageElement.setAttribute("x",`${d+f}`):(g=a+f,this.getTextElement().setAttribute("text-anchor","end"),this.imageElement.setAttribute("x",`${d}`));this.imageElement.setAttribute("y",String(e/2-c/2));this.positionTextElement_(g+d,a+f)}renderSelectedText(){this.getTextContent().nodeValue=this.getDisplayText_();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=getTextWidth$$module$build$src$core$utils$dom(this.getTextElement());b=b?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0;let d=0;this.svgArrow&&(d=this.positionSVGArrow(c+b,a/2-this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE/2));this.size_=new Size$$module$build$src$core$utils$size(c+d+b*2,a);this.positionTextElement_(b,c)}positionSVGArrow(a,b){if(!this.svgArrow)return 0;const c=this.getSourceBlock(); +if(!c)throw new UnattachedFieldError$$module$build$src$core$field;const d=this.borderRect_?this.getConstants().FIELD_BORDER_RECT_X_PADDING:0,e=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_PADDING,f=this.getConstants().FIELD_DROPDOWN_SVG_ARROW_SIZE;this.svgArrow.setAttribute("transform","translate("+(c.RTL?d:a+e)+","+b+")");return f+e}getText_(){if(!this.selectedOption)return null;const a=this.selectedOption[0];if(isImageProperties$$module$build$src$core$field_dropdown(a))return a.alt;if(typeof HTMLElement!== +"undefined"&&a instanceof HTMLElement){let b,c;return(c=(b=a.title)!=null?b:a.ariaLabel)!=null?c:a.innerText}if(typeof a==="string")return a;console.warn("Can't get text for existing dropdown option. If you're using HTMLElement dropdown options in node, ensure you're using jsdom-global or similar.");return null}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)}trimOptions(a){let b=!1;const c=a.map(g=>{if(g===FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR)return b=!0,g;const [h,k]=g;if(typeof h==="string")return[replaceMessageReferences$$module$build$src$core$utils$parsing(h),k];b=!0;return[isImageProperties$$module$build$src$core$field_dropdown(h)?Object.assign({},h,{alt:replaceMessageReferences$$module$build$src$core$utils$parsing(h.alt)}):h,k]});if(b||a.length<2)return{options:c};var d=c.map(([g])=>g), +e=shortestStringLength$$module$build$src$core$utils$string(d);a=commonWordPrefix$$module$build$src$core$utils$string(d,e);const f=commonWordSuffix$$module$build$src$core$utils$string(d,e);if(!a&&!f||e<=a+f)return{options:c};e=a?d[0].substring(0,a-1):void 0;d=f?d[0].substr(1-f):void 0;return{options:this.applyTrim(c,a,f),prefix:e,suffix:d}}applyTrim(a,b,c){return a.map(([d,e])=>[d.substring(b,d.length-c),e])}validateOptions(a){if(!Array.isArray(a))throw TypeError("FieldDropdown options must be an array."); +if(!a.length)throw TypeError("FieldDropdown options must not be an empty array.");let b=!1;for(let c=0;c0&&!!a.snap;return b}static parseThemeOptions(a){a=a.theme||Classic$$module$build$src$core$theme$classic;return typeof a==="string"?getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.THEME,a):a instanceof Theme$$module$build$src$core$theme?a:Theme$$module$build$src$core$theme.defineTheme(a.name||"builtin"+getNextUniqueId$$module$build$src$core$utils$idgenerator(),a)}},module$build$src$core$options= +{};module$build$src$core$options.Options=Options$$module$build$src$core$options;var BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy=class{constructor(a,b){this.bubble=a;this.workspace=b;this.startLoc=null}isMovable(){return!0}startDrag(){this.startLoc=this.bubble.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.bubble);this.bubble.setDragging&&this.bubble.setDragging(!0)}drag(a){this.bubble.moveDuringDrag(a)}endDrag(){this.workspace.setResizesEnabled(!0);let a;(a=this.workspace.getLayerManager())== +null||a.moveOffDragLayer(this.bubble,BUBBLE$$module$build$src$core$layers);this.bubble.setDragging(!1)}revertDrag(){this.startLoc&&this.bubble.moveDuringDrag(this.startLoc)}},module$build$src$core$dragging$bubble_drag_strategy={};module$build$src$core$dragging$bubble_drag_strategy.BubbleDragStrategy=BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy;var _a$$module$build$src$core$bubbles$bubble,Bubble$$module$build$src$core$bubbles$bubble=class{constructor(a,b,c,d,e){this.workspace=a;this.anchor=b;this.ownerRect=c;this.owner=e;this.size=new Size$$module$build$src$core$utils$size(0,0);this.colour="#ffffff";this.disposed=!1;this.relativeLeft=this.relativeTop=0;this.dragStrategy=new BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy(this,this.workspace);this.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.svgRoot= +createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyBubble"},a.getBubbleCanvas());a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyEmboss"},this.svgRoot);this.tail=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyBubbleTail"},a);this.background=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT, +{"class":"blocklyDraggable",x:0,y:0,rx:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,ry:_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);this.contentContainer=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},this.svgRoot);this.focusableElement=d!=null?d:this.svgRoot;this.focusableElement.setAttribute("id",this.id);conditionalBind$$module$build$src$core$browser_events(this.background,"pointerdown",this,this.onMouseDown);conditionalBind$$module$build$src$core$browser_events(this.focusableElement, +"keydown",this,this.onKeyDown)}dispose(){removeNode$$module$build$src$core$utils$dom(this.svgRoot);this.disposed=!0}setAnchorLocation(a,b=!1){this.anchor=a;b?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor();this.renderTail()}setPositionRelativeToAnchor(a,b){this.relativeLeft=a;this.relativeTop=b;this.positionRelativeToAnchor();this.renderTail()}getSize(){return this.size}setSize(a,b=!1){a.width=Math.max(a.width,_a$$module$build$src$core$bubbles$bubble.MIN_SIZE);a.height=Math.max(a.height, +_a$$module$build$src$core$bubbles$bubble.MIN_SIZE);this.size=a;this.background.setAttribute("width",`${a.width}`);this.background.setAttribute("height",`${a.height}`);b?this.positionByRect(this.ownerRect):this.positionRelativeToAnchor();this.renderTail()}getColour(){return this.colour}setColour(a){this.colour=a;this.tail.setAttribute("fill",a);this.background.setAttribute("fill",a)}onMouseDown(a){let b;(b=this.workspace.getGesture(a))==null||b.handleBubbleStart(a,this);$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this)}onKeyDown(a){a.key=== +"Escape"&&this.owner&&(this.owner.setBubbleVisible(!1),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.owner))}positionRelativeToAnchor(){let a=this.anchor.x;a=this.workspace.RTL?a-(this.relativeLeft+this.size.width):a+this.relativeLeft;this.moveTo(a,this.relativeTop+this.anchor.y)}moveTo(a,b){this.svgRoot.setAttribute("transform",`translate(${a}, ${b})`)}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){var b=this.workspace.getMetricsManager().getViewMetrics(!0), +c=this.getOptimalRelativeLeft(b),d=this.getOptimalRelativeTop(b);const e={x:c,y:-this.size.height-this.workspace.getRenderer().getConstants().MIN_BLOCK_HEIGHT},f={x:-this.size.width-30,y:d};d={x:a.getWidth(),y:d};var g={x:c,y:a.getHeight()};c=a.getWidth()a.width)return b;a=this.getWorkspaceViewRect(a);if(this.workspace.RTL){var c=this.anchor.x-b;c-this.size.widtha.right&&(b=-(a.right-this.anchor.x))}else{c=b+this.anchor.x;const d=c+this.size.width;ca.right&&(b=a.right-this.anchor.x-this.size.width)}return b}getOptimalRelativeTop(a){let b=-this.size.height/4;if(this.size.height>a.height)return b;const c=this.anchor.y+b,d=c+this.size.height;a=this.getWorkspaceViewRect(a); +ca.bottom&&(b=a.bottom-this.anchor.y-this.size.height);return b}getWorkspaceViewRect(a){const b=a.top;let c=a.top+a.height,d=a.left;a=a.left+a.width;c-=this.getScrollbarThickness();this.workspace.RTL?d-=this.getScrollbarThickness():a-=this.getScrollbarThickness();return new Rect$$module$build$src$core$utils$rect(b,c,d,a)}getScrollbarThickness(){return Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness/this.workspace.scale}renderTail(){const a=[];var b=this.size.width/ +2,c=this.size.height/2,d=-this.relativeLeft,e=-this.relativeTop;if(b===d&&c===e)a.push("M "+b+","+c);else{e-=c;d-=b;this.workspace.RTL&&(d*=-1);var f=Math.sqrt(e*e+d*d),g=Math.acos(d/f);e<0&&(g=2*Math.PI-g);var h=g+Math.PI/2;h>Math.PI*2&&(h-=Math.PI*2);var k=Math.sin(h);const m=Math.cos(h);let n=(this.size.width+this.size.height)/_a$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS;n=Math.min(n,this.size.width,this.size.height)/4;h=1-_a$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS/f;d=b+ +h*d;e=c+h*e;h=b+n*m;const p=c+n*k;b-=n*m;c-=n*k;k=toRadians$$module$build$src$core$utils$math(this.workspace.RTL?-_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE:_a$$module$build$src$core$bubbles$bubble.TAIL_ANGLE);k=g+k;k>Math.PI*2&&(k-=Math.PI*2);g=Math.sin(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;f=Math.cos(k)*f/_a$$module$build$src$core$bubbles$bubble.TAIL_BEND;a.push("M"+h+","+p);a.push("C"+(h+f)+","+(p+g)+" "+d+","+e+" "+d+","+e);a.push("C"+d+","+e+" "+(b+f)+","+(c+g)+" "+ +b+","+c)}a.push("z");let l;(l=this.tail)==null||l.setAttribute("d",a.join(" "))}bringToFront(){let a;const b=(a=this.svgRoot)==null?void 0:a.parentNode;return this.svgRoot&&(b==null?void 0:b.lastChild)!==this.svgRoot?(b==null||b.appendChild(this.svgRoot),!0):!1}getRelativeToSurfaceXY(){return new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.relativeLeft+this.anchor.x-this.size.width:this.anchor.x+this.relativeLeft,this.anchor.y+this.relativeTop)}getSvgRoot(){return this.svgRoot}moveDuringDrag(a){this.moveTo(a.x, +a.y);this.relativeLeft=this.workspace.RTL?this.anchor.x-a.x-this.size.width:a.x-this.anchor.x;this.relativeTop=a.y-this.anchor.y;this.renderTail()}setDragging(a){}setDeleteStyle(a){}isDeletable(){return!1}showContextMenu(a){}isMovable(){return!0}startDrag(){this.dragStrategy.startDrag()}drag(a){this.dragStrategy.drag(a)}endDrag(){this.dragStrategy.endDrag()}revertDrag(){this.dragStrategy.revertDrag()}select(){fireSelectedEvent$$module$build$src$core$common(this)}unselect(){fireSelectedEvent$$module$build$src$core$common(null)}getFocusableElement(){return this.focusableElement}getFocusableTree(){return this.workspace}onNodeFocus(){this.select(); +this.bringToFront();var a=this.getRelativeToSurfaceXY();const b=this.getSize();a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+b.height,a.x,a.x+b.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){this.unselect()}canBeFocused(){return!0}getOwner(){return this.owner}};_a$$module$build$src$core$bubbles$bubble=Bubble$$module$build$src$core$bubbles$bubble;Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH=6; +Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER=_a$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2;Bubble$$module$build$src$core$bubbles$bubble.MIN_SIZE=_a$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;Bubble$$module$build$src$core$bubbles$bubble.TAIL_THICKNESS=1;Bubble$$module$build$src$core$bubbles$bubble.TAIL_ANGLE=20;Bubble$$module$build$src$core$bubbles$bubble.TAIL_BEND=4;Bubble$$module$build$src$core$bubbles$bubble.ANCHOR_RADIUS=8; +var module$build$src$core$bubbles$bubble={};module$build$src$core$bubbles$bubble.Bubble=Bubble$$module$build$src$core$bubbles$bubble;var MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d){super(b,c,d);this.workspace=b;this.anchor=c;this.ownerRect=d;this.autoLayout=!0;b=new Options$$module$build$src$core$options(a);this.validateWorkspaceOptions(b);this.svgDialog=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH,y:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}, +this.contentContainer);a.parentWorkspace=this.workspace;this.miniWorkspace=this.newWorkspaceSvg(new Options$$module$build$src$core$options(a));this.miniWorkspace.internalIsMutator=!0;a=this.miniWorkspace.createDom("blocklyMutatorBackground");this.svgDialog.appendChild(a);b.languageTree&&(a.insertBefore(this.miniWorkspace.addFlyout(Svg$$module$build$src$core$utils$svg.G),this.miniWorkspace.getCanvas()),a=this.miniWorkspace.getFlyout(),a==null||a.init(this.miniWorkspace),a==null||a.show(b.languageTree)); +addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMiniWorkspaceBubble");this.miniWorkspace.addChangeListener(this.onWorkspaceChange.bind(this));let e,f;(e=this.miniWorkspace.getFlyout())==null||(f=e.getWorkspace())==null||f.addChangeListener(this.onWorkspaceChange.bind(this));this.updateBubbleSize()}dispose(){this.miniWorkspace.dispose();super.dispose()}getWorkspace(){return this.miniWorkspace}addWorkspaceChangeListener(a){this.miniWorkspace.addChangeListener(a)}validateWorkspaceOptions(a){if(a.hasCategories)throw Error("The miniworkspace bubble does not support toolboxes with categories"); +if(a.hasTrashcan)throw Error("The miniworkspace bubble does not support trashcans");if(a.zoomOptions.controls||a.zoomOptions.wheel||a.zoomOptions.pinch)throw Error("The miniworkspace bubble does not support zooming");if(a.moveOptions.scrollbars||a.moveOptions.wheel||a.moveOptions.drag)throw Error("The miniworkspace bubble does not scrolling/moving the workspace");if(a.horizontalLayout)throw Error("The miniworkspace bubble does not support horizontal layouts");}onWorkspaceChange(){this.bumpBlocksIntoBounds(); +this.updateBubbleSize()}bumpBlocksIntoBounds(){if(!this.miniWorkspace.isDragging()||this.miniWorkspace.keyboardMoveInProgress)for(const a of this.miniWorkspace.getTopBlocks(!1)){const b=a.getRelativeToSurfaceXY();b.y<20&&a.moveBy(0,20-b.y);if(a.RTL){let c=-20;const d=this.miniWorkspace.getFlyout();d&&(c-=d.getWidth());b.x>c&&a.moveBy(c-b.x,0)}else b.x<20&&a.moveBy(20-b.x,0)}}updateBubbleSize(){if(!this.miniWorkspace.isDragging()||this.miniWorkspace.keyboardMoveInProgress){this.autoLayout&&(this.autoLayout= +!this.miniWorkspace.keyboardMoveInProgress);var a=this.getSize(),b=this.calculateWorkspaceSize();Math.abs(a.width-b.width)({kind:"block",type:c}))});return b}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$mutator_icon/ +2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){const a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}createRootBlock(){if(!this.sourceBlock.decompose)throw Error("Blocks with mutator icons must include a decompose method");this.rootBlock=this.sourceBlock.decompose(this.miniWorkspaceBubble.getWorkspace()); +for(var a of this.rootBlock.getDescendants(!1))a.queueRender();this.rootBlock.setMovable(!1);this.rootBlock.setDeletable(!1);let b,c,d,e;a=(e=(b=this.miniWorkspaceBubble)==null?void 0:(c=b.getWorkspace())==null?void 0:(d=c.getFlyout())==null?void 0:d.getWidth())!=null?e:0;this.rootBlock.moveBy(this.rootBlock.RTL?-(a+WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon):WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon)}addSaveConnectionsListener(){this.sourceBlock.saveConnections&& +this.rootBlock&&(this.saveConnectionsListener=()=>{this.sourceBlock.saveConnections&&this.rootBlock&&this.sourceBlock.saveConnections(this.rootBlock)},this.saveConnectionsListener(),this.sourceBlock.workspace.addChangeListener(this.saveConnectionsListener))}createMiniWorkspaceChangeListener(){return a=>{$.MutatorIcon$$module$build$src$core$icons$mutator_icon.isIgnorableMutatorEvent(a)||this.updateWorkspacePid||(this.updateWorkspacePid=setTimeout(()=>{this.updateWorkspacePid=null;this.recomposeSourceBlock()}, +0))}}static isIgnorableMutatorEvent(a){return a.isUiEvent||isBlockCreate$$module$build$src$core$events$predicates(a)||isBlockChange$$module$build$src$core$events$predicates(a)&&a.element==="disabled"}recomposeSourceBlock(){if(this.rootBlock){if(!this.sourceBlock.compose)throw Error("Blocks with mutator icons must include a compose method");var a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock); +this.sourceBlock.compose(this.rootBlock);var c=BlockChange$$module$build$src$core$events$events_block_change.getExtraBlockState_(this.sourceBlock);b!==c&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,"mutation",null,b,c));$.setGroup$$module$build$src$core$events$utils(a)}}getWorkspace(){let a;return(a=this.miniWorkspaceBubble)==null?void 0:a.getWorkspace()}}; +$.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.MUTATOR;$.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT=1;var module$build$src$core$icons$mutator_icon={};module$build$src$core$icons$mutator_icon.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;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);var 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; +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; +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;var KeyCodes$$module$build$src$core$utils$keycodes; +(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]= +"DOWN";a[a.PLUS_SIGN=43]="PLUS_SIGN";a[a.PRINT_SCREEN=44]="PRINT_SCREEN";a[a.INSERT=45]="INSERT";a[a.DELETE=46]="DELETE";a[a.ZERO=48]="ZERO";a[a.ONE=49]="ONE";a[a.TWO=50]="TWO";a[a.THREE=51]="THREE";a[a.FOUR=52]="FOUR";a[a.FIVE=53]="FIVE";a[a.SIX=54]="SIX";a[a.SEVEN=55]="SEVEN";a[a.EIGHT=56]="EIGHT";a[a.NINE=57]="NINE";a[a.FF_SEMICOLON=59]="FF_SEMICOLON";a[a.FF_EQUALS=61]="FF_EQUALS";a[a.FF_DASH=173]="FF_DASH";a[a.FF_HASH=163]="FF_HASH";a[a.QUESTION_MARK=63]="QUESTION_MARK";a[a.AT_SIGN=64]="AT_SIGN"; +a[a.A=65]="A";a[a.B=66]="B";a[a.C=67]="C";a[a.D=68]="D";a[a.E=69]="E";a[a.F=70]="F";a[a.G=71]="G";a[a.H=72]="H";a[a.I=73]="I";a[a.J=74]="J";a[a.K=75]="K";a[a.L=76]="L";a[a.M=77]="M";a[a.N=78]="N";a[a.O=79]="O";a[a.P=80]="P";a[a.Q=81]="Q";a[a.R=82]="R";a[a.S=83]="S";a[a.T=84]="T";a[a.U=85]="U";a[a.V=86]="V";a[a.W=87]="W";a[a.X=88]="X";a[a.Y=89]="Y";a[a.Z=90]="Z";a[a.META=91]="META";a[a.WIN_KEY_RIGHT=92]="WIN_KEY_RIGHT";a[a.CONTEXT_MENU=93]="CONTEXT_MENU";a[a.NUM_ZERO=96]="NUM_ZERO";a[a.NUM_ONE=97]= +"NUM_ONE";a[a.NUM_TWO=98]="NUM_TWO";a[a.NUM_THREE=99]="NUM_THREE";a[a.NUM_FOUR=100]="NUM_FOUR";a[a.NUM_FIVE=101]="NUM_FIVE";a[a.NUM_SIX=102]="NUM_SIX";a[a.NUM_SEVEN=103]="NUM_SEVEN";a[a.NUM_EIGHT=104]="NUM_EIGHT";a[a.NUM_NINE=105]="NUM_NINE";a[a.NUM_MULTIPLY=106]="NUM_MULTIPLY";a[a.NUM_PLUS=107]="NUM_PLUS";a[a.NUM_MINUS=109]="NUM_MINUS";a[a.NUM_PERIOD=110]="NUM_PERIOD";a[a.NUM_DIVISION=111]="NUM_DIVISION";a[a.F1=112]="F1";a[a.F2=113]="F2";a[a.F3=114]="F3";a[a.F4=115]="F4";a[a.F5=116]="F5";a[a.F6= +117]="F6";a[a.F7=118]="F7";a[a.F8=119]="F8";a[a.F9=120]="F9";a[a.F10=121]="F10";a[a.F11=122]="F11";a[a.F12=123]="F12";a[a.NUMLOCK=144]="NUMLOCK";a[a.SCROLL_LOCK=145]="SCROLL_LOCK";a[a.FIRST_MEDIA_KEY=166]="FIRST_MEDIA_KEY";a[a.LAST_MEDIA_KEY=183]="LAST_MEDIA_KEY";a[a.SEMICOLON=186]="SEMICOLON";a[a.DASH=189]="DASH";a[a.EQUALS=187]="EQUALS";a[a.COMMA=188]="COMMA";a[a.PERIOD=190]="PERIOD";a[a.SLASH=191]="SLASH";a[a.APOSTROPHE=192]="APOSTROPHE";a[a.TILDE=192]="TILDE";a[a.SINGLE_QUOTE=222]="SINGLE_QUOTE"; +a[a.OPEN_SQUARE_BRACKET=219]="OPEN_SQUARE_BRACKET";a[a.BACKSLASH=220]="BACKSLASH";a[a.CLOSE_SQUARE_BRACKET=221]="CLOSE_SQUARE_BRACKET";a[a.WIN_KEY=224]="WIN_KEY";a[a.MAC_FF_META=224]="MAC_FF_META";a[a.MAC_WK_CMD_LEFT=91]="MAC_WK_CMD_LEFT";a[a.MAC_WK_CMD_RIGHT=93]="MAC_WK_CMD_RIGHT";a[a.WIN_IME=229]="WIN_IME";a[a.VK_NONAME=252]="VK_NONAME";a[a.PHANTOM=255]="PHANTOM"})(KeyCodes$$module$build$src$core$utils$keycodes||(KeyCodes$$module$build$src$core$utils$keycodes={})); +var module$build$src$core$utils$keycodes={};module$build$src$core$utils$keycodes.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;var module$build$src$core$utils$svg_paths={};module$build$src$core$utils$svg_paths.arc=arc$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.curve=curve$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.line=line$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineOnAxis=lineOnAxis$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.lineTo=lineTo$$module$build$src$core$utils$svg_paths; +module$build$src$core$utils$svg_paths.moveBy=moveBy$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.moveTo=moveTo$$module$build$src$core$utils$svg_paths;module$build$src$core$utils$svg_paths.point=point$$module$build$src$core$utils$svg_paths;var module$build$src$core$utils={};module$build$src$core$utils.Coordinate=Coordinate$$module$build$src$core$utils$coordinate;module$build$src$core$utils.KeyCodes=KeyCodes$$module$build$src$core$utils$keycodes;module$build$src$core$utils.Rect=Rect$$module$build$src$core$utils$rect;module$build$src$core$utils.Size=Size$$module$build$src$core$utils$size;module$build$src$core$utils.Svg=Svg$$module$build$src$core$utils$svg;module$build$src$core$utils.aria=module$build$src$core$utils$aria; +module$build$src$core$utils.array=module$build$src$core$utils$array;module$build$src$core$utils.browserEvents=module$build$src$core$browser_events;module$build$src$core$utils.colour=module$build$src$core$utils$colour;module$build$src$core$utils.deprecation=module$build$src$core$utils$deprecation;module$build$src$core$utils.dom=module$build$src$core$utils$dom;module$build$src$core$utils.extensions=module$build$src$core$extensions;module$build$src$core$utils.idGenerator=module$build$src$core$utils$idgenerator; +module$build$src$core$utils.math=module$build$src$core$utils$math;module$build$src$core$utils.object=module$build$src$core$utils$object;module$build$src$core$utils.parsing=module$build$src$core$utils$parsing;module$build$src$core$utils.string=module$build$src$core$utils$string;module$build$src$core$utils.style=module$build$src$core$utils$style;module$build$src$core$utils.svgMath=module$build$src$core$utils$svg_math;module$build$src$core$utils.svgPaths=module$build$src$core$utils$svg_paths; +module$build$src$core$utils.toolbox=module$build$src$core$utils$toolbox;module$build$src$core$utils.userAgent=module$build$src$core$utils$useragent;module$build$src$core$utils.xml=module$build$src$core$utils$xml;var TextInputBubble$$module$build$src$core$bubbles$textinput_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d){super(a,b,c,void 0,d);this.workspace=a;this.anchor=b;this.ownerRect=c;this.owner=d;this.resizePointerMoveListener=this.resizePointerUpListener=null;this.sizeChangeListeners=[];this.locationChangeListeners=[];this.DEFAULT_SIZE=new Size$$module$build$src$core$utils$size(160+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,80+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER); +this.MIN_SIZE=new Size$$module$build$src$core$utils$size(45+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,20+Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER);this.editable=!0;addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextInputBubble");this.editor=new CommentEditor$$module$build$src$core$comments$comment_editor(a,this.id,()=>{$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this)});this.contentContainer.appendChild(this.editor.getDom()); +this.resizeGroup=this.createResizeHandle(this.svgRoot,a);this.setSize(this.DEFAULT_SIZE,!0)}getText(){return this.editor.getText()}setText(a){this.editor.setText(a)}setEditable(a){this.editable=a;this.editor.setEditable(a)}isEditable(){return this.editable}addTextChangeListener(a){this.editor.addTextChangeListener(a)}addSizeChangeListener(a){this.sizeChangeListeners.push(a)}addLocationChangeListener(a){this.locationChangeListeners.push(a)}createResizeHandle(a,b){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE, +{"class":"blocklyResizeHandle",href:`${b.options.pathToMedia}resize-handle.svg`},a);conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onResizePointerDown);return a}setSize(a,b=!1){a.width=Math.max(a.width,this.MIN_SIZE.width);a.height=Math.max(a.height,this.MIN_SIZE.height);const c=a.width-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER,d=a.height-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER;this.editor.updateSize(new Size$$module$build$src$core$utils$size(c, +d),new Size$$module$build$src$core$utils$size(0,0));this.editor.getDom().setAttribute("x",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.editor.getDom().setAttribute("y",`${Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER/2}`);this.resizeGroup.setAttribute("y",`${d}`);this.workspace.RTL?this.resizeGroup.setAttribute("x",`${-Bubble$$module$build$src$core$bubbles$bubble.DOUBLE_BORDER}`):this.resizeGroup.setAttribute("x",`${c}`);super.setSize(a,b);this.onSizeChange()}getSize(){return super.getSize()}moveDuringDrag(a){super.moveDuringDrag(a); +this.onLocationChange()}setPositionRelativeToAnchor(a,b){super.setPositionRelativeToAnchor(a,b);this.onLocationChange()}positionByRect(a=new Rect$$module$build$src$core$utils$rect(0,0,0,0)){super.positionByRect(a);this.onLocationChange()}onResizePointerDown(a){this.bringToFront();isRightButton$$module$build$src$core$browser_events(a)||(start$$module$build$src$core$utils$drag(this.workspace,a,new Coordinate$$module$build$src$core$utils$coordinate(this.workspace.RTL?-this.getSize().width:this.getSize().width, +this.getSize().height)),this.resizePointerUpListener=conditionalBind$$module$build$src$core$browser_events(document,"pointerup",this,this.onResizePointerUp),this.resizePointerMoveListener=conditionalBind$$module$build$src$core$browser_events(document,"pointermove",this,this.onResizePointerMove),this.workspace.hideChaff());a.stopPropagation()}onResizePointerUp(a){clearTouchIdentifier$$module$build$src$core$touch();this.resizePointerUpListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerUpListener), +this.resizePointerUpListener=null);this.resizePointerMoveListener&&(unbind$$module$build$src$core$browser_events(this.resizePointerMoveListener),this.resizePointerMoveListener=null)}onResizePointerMove(a){a=move$$module$build$src$core$utils$drag(this.workspace,a);this.setSize(new Size$$module$build$src$core$utils$size(this.workspace.RTL?-a.x:a.x,a.y),!1);this.onSizeChange()}onSizeChange(){for(const a of this.sizeChangeListeners)a()}onLocationChange(){for(const a of this.locationChangeListeners)a()}getEditor(){return this.editor}}; +register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea {\n background-color: var(--commentFillColour);\n border: 0;\n box-sizing: border-box;\n display: block;\n outline: 0;\n padding: 5px;\n resize: none;\n width: 100%;\n height: 100%;\n}\n");var module$build$src$core$bubbles$textinput_bubble={};module$build$src$core$bubbles$textinput_bubble.TextInputBubble=TextInputBubble$$module$build$src$core$bubbles$textinput_bubble;var ConnectionType$$module$build$src$core$connection_type;(function(a){a[a.INPUT_VALUE=1]="INPUT_VALUE";a[a.OUTPUT_VALUE=2]="OUTPUT_VALUE";a[a.NEXT_STATEMENT=3]="NEXT_STATEMENT";a[a.PREVIOUS_STATEMENT=4]="PREVIOUS_STATEMENT"})(ConnectionType$$module$build$src$core$connection_type||(ConnectionType$$module$build$src$core$connection_type={}));var module$build$src$core$connection_type={};module$build$src$core$connection_type.ConnectionType=ConnectionType$$module$build$src$core$connection_type;var ConnectionDB$$module$build$src$core$connection_db=class{constructor(a){this.connectionChecker=a;this.connections=[]}addConnection(a,b){b=this.calculateIndexForYPos(b);this.connections.splice(b,0,a)}findIndexOfConnection(a,b){if(!this.connections.length)return-1;const c=this.calculateIndexForYPos(b);if(c>=this.connections.length)return-1;b=a.y;let d=c;for(;d>=0&&this.connections[d].y===b;){if(this.connections[d]===a)return d;d--}for(d=c;da)c=d;else{b=d;break}}return b}removeConnection(a,b){a=this.findIndexOfConnection(a,b);if(a===-1)throw Error("Unable to find connection in connectionDB.");this.connections.splice(a,1)}getNeighbours(a,b){function c(l){const m=e-d[l].x,n=f-d[l].y;Math.sqrt(m*m+n*n)<=b&&k.push(d[l]); +return n=0&&c(a);)a--;do g++;while(g=0&&this.isInYRange(k,a.y,b);)h=this.connections[k], +this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),k--;for(;fthis.fieldRow.length)throw Error("index "+a+" out of bounds.");if(!(b|| +b===""&&c))return a;typeof b==="string"&&(b=$.fromJson$$module$build$src$core$field_registry({type:"field_label",text:b}));b.setSourceBlock(this.sourceBlock);this.sourceBlock.initialized&&this.initField(b);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.queueRender();return a}removeField(a,b){for(let c=0,d;d=this.fieldRow[c];c++)if(d.name=== +a)return d.dispose(),this.fieldRow.splice(c,1),this.sourceBlock.rendered&&this.sourceBlock.queueRender(),!0;if(b)return!1;throw Error('Field "'+a+'" not found.');}isVisible(){return this.visible}setVisible(a){let b=[];if(this.visible===a)return b;this.visible=a;for(let c=0,d;d=this.fieldRow[c];c++)d.setVisible(a);if(this.connection&&this.connection instanceof RenderedConnection$$module$build$src$core$rendered_connection){a?b=this.connection.startTrackingAll():this.connection.stopTrackingAll();const c= +this.connection.targetBlock();c&&(c.getSvgRoot().style.display=a?"block":"none")}return b}markDirty(){for(let a=0,b;b=this.fieldRow[a];a++)b.markDirty()}setCheck(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setCheck(a);return this}setAlign(a){this.align=a;this.sourceBlock.rendered&&this.sourceBlock.queueRender();return this}setShadowDom(a){if(!this.connection)throw Error("This input does not have a connection.");this.connection.setShadowDom(a);return this}getShadowDom(){if(!this.connection)throw Error("This input does not have a connection."); +return this.connection.getShadowDom()}init(){for(const a of this.fieldRow)a.init()}initModel(){for(const a of this.fieldRow)a.initModel()}initField(a){this.sourceBlock.rendered?a.init():a.initModel()}dispose(){for(let a=0,b;b=this.fieldRow[a];a++)b.dispose();this.connection&&this.connection.dispose()}makeConnection(a){return this.sourceBlock.makeConnection_(a)}},module$build$src$core$inputs$input={};module$build$src$core$inputs$input.Input=Input$$module$build$src$core$inputs$input;var DummyInput$$module$build$src$core$inputs$dummy_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.DUMMY}},module$build$src$core$inputs$dummy_input={};module$build$src$core$inputs$dummy_input.DummyInput=DummyInput$$module$build$src$core$inputs$dummy_input;var EndRowInput$$module$build$src$core$inputs$end_row_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.END_ROW}},module$build$src$core$inputs$end_row_input={};module$build$src$core$inputs$end_row_input.EndRowInput=EndRowInput$$module$build$src$core$inputs$end_row_input;var StatementInput$$module$build$src$core$inputs$statement_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Statement inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.STATEMENT;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)}},module$build$src$core$inputs$statement_input={}; +module$build$src$core$inputs$statement_input.StatementInput=StatementInput$$module$build$src$core$inputs$statement_input;var module$build$src$core$inputs$value_input;$.ValueInput$$module$build$src$core$inputs$value_input=class extends Input$$module$build$src$core$inputs$input{constructor(a,b){if(!a)throw Error("Value inputs must have a non-empty name");super(a,b);this.name=a;this.type=$.inputTypes$$module$build$src$core$inputs$input_types.VALUE;this.connection=this.makeConnection(ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE)}};module$build$src$core$inputs$value_input={}; +module$build$src$core$inputs$value_input.ValueInput=$.ValueInput$$module$build$src$core$inputs$value_input;var module$build$src$core$interfaces$i_icon={};module$build$src$core$interfaces$i_icon.isIcon=isIcon$$module$build$src$core$interfaces$i_icon;var module$build$src$core$interfaces$i_comment_icon={};module$build$src$core$interfaces$i_comment_icon.isCommentIcon=isCommentIcon$$module$build$src$core$interfaces$i_comment_icon;var Block$$module$build$src$core$block=class{constructor(a,b,c){this.data=null;this.disposed=!1;this.hue=null;this.colour_="#000000";this.styleName_="";this.suppressPrefixSuffix=!1;this.previousConnection=this.nextConnection=this.outputConnection=null;this.inputList=[];this.icons=[];this.disabledReasons=new Set;this.tooltip="";this.contextMenu=!0;this.parentBlock_=null;this.childBlocks_=[];this.editable=this.movable=this.deletable=!0;this.collapsed_=this.shadow=!1;this.outputShape_=null;this.rendered= +this.isInsertionMarker_=this.initialized=this.disposing=!1;this.onchangeWrapper=this.helpUrl=null;this.statementInputCount=0;this.workspace=a;this.id=c&&!a.getBlockById(c)?c:genUid$$module$build$src$core$utils$idgenerator();a.setBlockById(this.id,this);this.xy=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.isInFlyout=a.isFlyout;this.isInMutator=a.isMutator;this.RTL=a.RTL;if(b){this.type=b;c=Blocks$$module$build$src$core$blocks[b];if(!c||typeof c!=="object")throw TypeError("Invalid block definition for type: "+ +b);Object.assign(this,c)}a.addTopBlock(this);a.addTypedBlock(this);new.target===Block$$module$build$src$core$block&&this.doInit_()}doInit_(){const a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);const b=getRecordUndo$$module$build$src$core$events$utils();try{typeof this.init==="function"&&($.setRecordUndo$$module$build$src$core$events$utils(!1),this.init(),$.setRecordUndo$$module$build$src$core$events$utils(b)),isEnabled$$module$build$src$core$events$utils()&& +fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(this))}finally{$.setGroup$$module$build$src$core$events$utils(a),$.setRecordUndo$$module$build$src$core$events$utils(b)}this.inputsInlineDefault=this.inputsInline;typeof this.onchange==="function"&&this.setOnChange(this.onchange)}dispose(a=!1){this.disposing=!0;this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.unplug(a); +isEnabled$$module$build$src$core$events$utils()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DELETE))(this));this.workspace.removeTopBlock(this);this.disposeInternal()}disposeInternal(){this.disposing=!0;this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.workspace.removeTypedBlock(this);this.workspace.removeBlockById(this.id);typeof this.destroy==="function"&&this.destroy(); +this.childBlocks_.forEach(a=>a.disposeInternal());this.inputList.forEach(a=>a.dispose());this.inputList.length=0;this.getConnections_(!0).forEach(a=>a.dispose());this.disposed=!0}isDeadOrDying(){return this.disposing||this.disposed}initModel(){if(!this.initialized){for(const a of this.inputList)a.initModel();this.initialized=!0}}unplug(a){this.outputConnection&&this.unplugFromRow(a);this.previousConnection&&this.unplugFromStack(a)}unplugFromRow(a){let b=null,c;if((c=this.outputConnection)==null?0: +c.isConnected())b=this.outputConnection.targetConnection,this.outputConnection.disconnect();b&&a&&(a=this.getOnlyValueConnection())&&a.isConnected()&&!a.targetBlock().isShadow()&&(a=a.targetConnection,a==null||a.disconnect(),this.workspace.connectionChecker.canConnect(a,b,!1)?b.connect(a):a==null||a.onFailedConnect(b))}getOnlyValueConnection(){let a=null;for(let b=0;b1)return!1;return!0}getMatchingConnection(a, +b){const c=this.getConnections_(!0);a=a.getConnections_(!0);if(c.length!==a.length)throw Error("Connection lists did not match in length.");for(let d=0;d{d=d+(c==="("||e===")"?"":" ")+e;c=e[e.length-1];return d},"");b=b.trim()||"???";a&&b.length>a&&(b=b.substring(0,a-3)+"...");return b}toTokens(a="?"){const b=[];for(const d of this.inputList)if(d.name!=COLLAPSED_INPUT_NAME$$module$build$src$core$constants){for(const e of d.fieldRow)b.push(e.getText());if(d.connection){const e=d.connection.targetBlock();if(e){var c=d.connection;let f=c.getCheck(); +!f&&c.targetConnection&&(f=c.targetConnection.getCheck());(c=!!f&&(f.includes("Boolean")||f.includes("Number")))&&b.push("(");b.push(...e.toTokens(a));c&&b.push(")")}else b.push(a)}}return b}appendValueInput(a){return this.appendInput(new $.ValueInput$$module$build$src$core$inputs$value_input(a,this))}appendStatementInput(a){this.statementInputCount++;return this.appendInput(new StatementInput$$module$build$src$core$inputs$statement_input(a,this))}appendDummyInput(a=""){return this.appendInput(new DummyInput$$module$build$src$core$inputs$dummy_input(a, +this))}appendEndRowInput(a=""){return this.appendInput(new EndRowInput$$module$build$src$core$inputs$end_row_input(a,this))}appendInput(a){this.inputList.push(a);return a}appendInputFromRegistry(a,b){return(a=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.INPUT,a,!1))?this.appendInput(new a(b,this)):null}jsonInit(a){var b=a.type?'Block "'+a.type+'": ':"";if(a.output&&a.previousStatement)throw Error(b+"Must not have both an output and a previousStatement.");for(var c= +0;a["args"+c];){if(a["message"+c]===void 0)throw Error(b+`args${c} must have a corresponding message (message${c}).`);c++}a.style&&a.style.hat&&(this.hat=a.style.hat,a.style=null);if(a.style&&a.colour)throw Error(b+"Must not have both a colour and a style.");a.style?this.jsonInitStyle(a,b):this.jsonInitColour(a,b);for(c=0;a["message"+c]!==void 0;)this.interpolate(a["message"+c],a["args"+c]||[],a["implicitAlign"+c]||a["lastDummyAlign"+c],b),c++;a.inputsInline!==void 0&&($.disable$$module$build$src$core$events$utils(), +this.setInputsInline(a.inputsInline),$.enable$$module$build$src$core$events$utils());a.output!==void 0&&this.setOutput(!0,a.output);a.outputShape!==void 0&&this.setOutputShape(a.outputShape);a.previousStatement!==void 0&&this.setPreviousStatement(!0,a.previousStatement);a.nextStatement!==void 0&&this.setNextStatement(!0,a.nextStatement);a.tooltip!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.tooltip),this.setTooltip(c));a.enableContextMenu!==void 0&&(this.contextMenu= +!!a.enableContextMenu);a.suppressPrefixSuffix!==void 0&&(this.suppressPrefixSuffix=!!a.suppressPrefixSuffix);a.helpUrl!==void 0&&(c=replaceMessageReferences$$module$build$src$core$utils$parsing(a.helpUrl),this.setHelpUrl(c));typeof a.extensions==="string"&&(console.warn(b+"JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '"+a.type+"' block."),a.extensions=[a.extensions]);a.mutator!==void 0&&apply$$module$build$src$core$extensions(a.mutator,this,!0);a=a.extensions; +if(Array.isArray(a))for(b=0;bb)throw Error('Block "'+this.type+'": Message index %'+f+" out of range.");if(c[f])throw Error('Block "'+this.type+'": Message index %'+f+" duplicated.");c[f]=!0;d++}}if(d!==b)throw Error('Block "'+this.type+'": Message does not reference all '+b+" arg(s).");}interpolateArguments(a,b,c){const d=[];for(let f=0;f=this.inputList.length)throw RangeError("Input index "+a+" out of bounds.");if(b>this.inputList.length)throw RangeError("Reference input "+b+" out of bounds.");const c=this.inputList[a];this.inputList.splice(a,1);ab.getWeight()-c.getWeight());return a}removeIcon(a){if(!this.hasIcon(a))return!1;let b;(b=this.getIcon(a))==null||b.dispose();this.icons=this.icons.filter(c=>!c.getType().equals(a));return!0}hasIcon(a){return this.icons.some(b=>b.getType().equals(a))}getIcon(a){return a instanceof IconType$$module$build$src$core$icons$icon_types? +this.icons.find(b=>b.getType().equals(a)):this.icons.find(b=>b.getType().toString()===a)}getIcons(){return[...this.icons]}getRelativeToSurfaceXY(){return this.xy}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");const d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this);c&&d.setReason(c);this.xy.translate(a,b);d.recordNew();fire$$module$build$src$core$events$utils(d)}makeConnection_(a){return new Connection$$module$build$src$core$connection(this, +a)}allInputsFilled(a){a===void 0&&(a=!0);if(!a&&this.isShadow())return!1;for(let c=0,d;d=this.inputList[c];c++)if(d.connection){var b=d.connection.targetBlock();if(!b||!b.allInputsFilled(a))return!1}return(b=this.getNextBlock())?b.allInputsFilled(a):!0}toDevString(){let a=this.type?'"'+this.type+'" block':"Block";this.id&&(a+=' (id="'+this.id+'")');return a}};Block$$module$build$src$core$block.COLLAPSED_INPUT_NAME=COLLAPSED_INPUT_NAME$$module$build$src$core$constants; +Block$$module$build$src$core$block.COLLAPSED_FIELD_NAME=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;var module$build$src$core$block={};module$build$src$core$block.Block=Block$$module$build$src$core$block;var disconnectPid$$module$build$src$core$block_animations=null,wobblingBlock$$module$build$src$core$block_animations=null,module$build$src$core$block_animations={};module$build$src$core$block_animations.connectionUiEffect=connectionUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiEffect=disconnectUiEffect$$module$build$src$core$block_animations;module$build$src$core$block_animations.disconnectUiStop=disconnectUiStop$$module$build$src$core$block_animations; +module$build$src$core$block_animations.disposeUiEffect=disposeUiEffect$$module$build$src$core$block_animations;var BlockPaster$$module$build$src$core$clipboard$block_paster=class{paste(a,b,c){if(!b.isCapacityAvailable(a.typeCounts))return null;c&&(a.blockState.x=c.x,a.blockState.y=c.y);c=c||new Coordinate$$module$build$src$core$utils$coordinate(a.blockState.x||0,a.blockState.y||0);$.disable$$module$build$src$core$events$utils();let d;try{d=append$$module$build$src$core$serialization$blocks(a.blockState,b),moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster(d,c)}finally{$.enable$$module$build$src$core$events$utils()}if(!d)return d; +isEnabled$$module$build$src$core$events$utils()&&!d.isShadow()&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(d));const e=d;finishQueuedRenders$$module$build$src$core$render_management().then(()=>$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e));return d}};BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE="block"; +register$$module$build$src$core$clipboard$registry(BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,new BlockPaster$$module$build$src$core$clipboard$block_paster);var module$build$src$core$clipboard$block_paster={};module$build$src$core$clipboard$block_paster.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard$block_paster.moveBlockToNotConflict=moveBlockToNotConflict$$module$build$src$core$clipboard$block_paster;var bumpIntoBounds$$module$build$src$core$bump_objects=bumpObjectIntoBounds$$module$build$src$core$bump_objects,module$build$src$core$bump_objects={};module$build$src$core$bump_objects.bumpIntoBounds=bumpObjectIntoBounds$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpIntoBoundsHandler=bumpIntoBoundsHandler$$module$build$src$core$bump_objects;module$build$src$core$bump_objects.bumpTopObjectsIntoBounds=bumpTopObjectsIntoBounds$$module$build$src$core$bump_objects;var BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy=class{constructor(a){this.block=a;this.connectionPreviewer=this.connectionCandidate=this.startLoc=this.startChildConn=this.startParentConn=null;this.dragging=!1;this.dragOffset=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.originalEventGroup="";this.workspace=a.workspace}isMovable(){if(this.block.isShadow()){let a,b;return(b=(a=this.block.getParent())==null?void 0:a.isMovable())!=null?b:!1}return this.block.isOwnMovable()&& +!this.block.isDeadOrDying()&&!this.workspace.isReadOnly()&&!this.block.isInFlyout}startDrag(a){if(this.block.isShadow())this.startDraggingShadow(a);else{this.dragging=!0;this.fireDragStartEvent();this.startLoc=this.block.getRelativeToSurfaceXY();this.connectionCandidate=null;this.connectionPreviewer=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_PREVIEWER,this.workspace.options))(this.block);startTextWidthCache$$module$build$src$core$utils$dom(); +this.workspace.setResizesEnabled(!1);disconnectUiStop$$module$build$src$core$block_animations();a=this.shouldHealStack(a);this.shouldDisconnect(a)&&this.disconnectBlock(a);this.block.setDragging(!0);var b;(b=this.workspace.getLayerManager())==null||b.moveToDragLayer(this.block)}}shouldHealStack(a){return!!a&&(a.altKey||a.ctrlKey||a.metaKey)}startDraggingShadow(a){const b=this.block.getParent();if(!b)throw Error("Tried to drag a shadow block with no parent. Shadow blocks should always have parents."); +this.dragOffset=Coordinate$$module$build$src$core$utils$coordinate.difference(b.getRelativeToSurfaceXY(),this.block.getRelativeToSurfaceXY());b.startDrag(a)}shouldDisconnect(a){return!!(this.block.getParent()||a&&this.block.nextConnection&&this.block.nextConnection.targetBlock())}disconnectBlock(a){let b,c,d;this.startParentConn=(d=(b=this.block.outputConnection)==null?void 0:b.targetConnection)!=null?d:(c=this.block.previousConnection)==null?void 0:c.targetConnection;if(a){let e;this.startChildConn= +(e=this.block.nextConnection)==null?void 0:e.targetConnection}this.block.unplug(a);disconnectUiEffect$$module$build$src$core$block_animations(this.block)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block,!0,this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireDragEndEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_DRAG))(this.block, +!1,this.block.getDescendants(!1));fire$$module$build$src$core$events$utils(a)}fireMoveEvent(){if(!this.block.isDeadOrDying()){var a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this.block);a.setReason(["drag"]);a.oldCoordinate=this.startLoc;a.recordNew();fire$$module$build$src$core$events$utils(a)}}drag(a){if(this.block.isShadow()){let b;(b=this.block.getParent())==null||b.drag(Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.dragOffset))}else this.block.moveDuringDrag(a), +this.updateConnectionPreview(this.block,Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.startLoc))}updateConnectionPreview(a,b){var c=this.connectionCandidate;const d=this.getConnectionCandidate(a,b);if(d){this.connectionCandidate=b=c&&this.currCandidateIsBetter(c,b,d)?c:d;var {local:e,neighbour:f}=b;b=e.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE||e.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT;var g;c=f.isConnected()&& +!((g=f.targetBlock())==null?0:g.isInsertionMarker());if(b&&c&&!this.orphanCanConnectAtEnd(a,f.targetBlock(),e.type)){let k;(k=this.connectionPreviewer)==null||k.previewReplacement(e,f,f.targetBlock())}else{var h;(h=this.connectionPreviewer)==null||h.previewConnection(e,f)}}else{let k;(k=this.connectionPreviewer)==null||k.hidePreview();this.connectionCandidate=null}}orphanCanConnectAtEnd(a,b,c){return!!Connection$$module$build$src$core$connection.getConnectionForOrphanedConnection(a,c===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE? +b.outputConnection:b.previousConnection)}currCandidateIsBetter(a,b,c){const {local:d,neighbour:e}=a;a=new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y);const f=new Coordinate$$module$build$src$core$utils$coordinate(e.x,e.y);b=Coordinate$$module$build$src$core$utils$coordinate.distance(Coordinate$$module$build$src$core$utils$coordinate.sum(a,b),f);return c.distance>b-$.config$$module$build$src$core$config.currentConnectionPreference}getConnectionCandidate(a,b){a=this.getLocalConnections(a); +let c=this.getSearchRadius(),d=null;for(const e of a){const {connection:f,radius:g}=e.closest(c,b);f&&(d={local:e,neighbour:f,distance:g},c=g)}return d}getSearchRadius(){return this.connectionCandidate?$.config$$module$build$src$core$config.connectingSnapRadius:$.config$$module$build$src$core$config.snapRadius}getLocalConnections(a){const b=a.getConnections_(!1),c=a.lastConnectionInStack(!0);c&&c!==a.nextConnection&&b.push(c);return b}endDrag(a){if(this.block.isShadow()){let c;(c=this.block.getParent())== +null||c.endDrag(a)}else{this.originalEventGroup=$.getGroup$$module$build$src$core$events$utils();this.fireDragEndEvent();this.fireMoveEvent();stopTextWidthCache$$module$build$src$core$utils$dom();disconnectUiStop$$module$build$src$core$block_animations();var b;(b=this.connectionPreviewer)==null||b.hidePreview();if(!this.block.isDeadOrDying()&&this.dragging){let c;(c=this.workspace.getLayerManager())==null||c.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);this.block.setDragging(!1)}this.connectionCandidate? +(this.applyConnections(this.connectionCandidate),this.disposeStep()):this.block.queueRender().then(()=>this.disposeStep())}}disposeStep(){const a=$.getGroup$$module$build$src$core$events$utils();$.setGroup$$module$build$src$core$events$utils(this.originalEventGroup);this.block.snapToGrid();let b;(b=this.connectionPreviewer)==null||b.dispose();this.workspace.setResizesEnabled(!0);$.setGroup$$module$build$src$core$events$utils(a)}applyConnections(a){const {local:b,neighbour:c}=a;b.connect(c);const d= +b.isSuperior()?c:b,e=this.block.getRootBlock();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{connectionUiEffect$$module$build$src$core$block_animations(d.getSourceBlock());setTimeout(()=>{e.bringToFront()},0)})}revertDrag(){if(this.block.isShadow()){let c;(c=this.block.getParent())==null||c.revertDrag()}else{var a;(a=this.connectionPreviewer)==null||a.hidePreview();this.connectionCandidate=null;var b;(b=this.startChildConn)==null||b.connect(this.block.nextConnection);if(this.startParentConn)switch(this.startParentConn.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:this.startParentConn.connect(this.block.outputConnection); +break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:this.startParentConn.connect(this.block.previousConnection)}else{this.block.moveTo(this.startLoc,["drag"]);let c;(c=this.workspace.getLayerManager())==null||c.moveOffDragLayer(this.block,BLOCK$$module$build$src$core$layers);bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace,this.workspace.getMetricsManager().getScrollMetrics(!0),this.block)}this.startParentConn=this.startChildConn=null;this.block.setDragging(!1); +this.dragging=!1}}},module$build$src$core$dragging$block_drag_strategy={};module$build$src$core$dragging$block_drag_strategy.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;var TextBubble$$module$build$src$core$bubbles$text_bubble=class extends Bubble$$module$build$src$core$bubbles$bubble{constructor(a,b,c,d){super(b,c,d);this.text=a;this.workspace=b;this.anchor=c;this.ownerRect=d;this.paragraph=this.stringToSvg(a,this.contentContainer);this.updateBubbleSize();addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyTextBubble")}getText(){return this.text}setText(a){this.text=a;removeNode$$module$build$src$core$utils$dom(this.paragraph);this.paragraph=this.stringToSvg(a, +this.contentContainer);this.updateBubbleSize()}stringToSvg(a,b){b=this.createParagraph(b);a=this.createTextFragments(b,a);this.workspace.RTL&&this.rightAlignTextFragments(b.getBBox().width,a);return b}createParagraph(a){return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyText blocklyBubbleText blocklyNoPointerEvents",transform:`translate(0,${Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH})`,style:`direction: ${this.workspace.RTL? +"rtl":"ltr"}`},a)}createTextFragments(a,b){let c=1;return b.split("\n").map(d=>{const e=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.TEXT,{y:`${c}em`,x:Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH},a);d=document.createTextNode(d);e.appendChild(d);c+=1;return e})}rightAlignTextFragments(a,b){for(const c of b)c.setAttribute("text-anchor","start"),c.setAttribute("x",`${a+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH}`)}updateBubbleSize(){const a= +this.paragraph.getBBox();this.setSize(new Size$$module$build$src$core$utils$size(a.width+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2,a.height+Bubble$$module$build$src$core$bubbles$bubble.BORDER_WIDTH*2),!0)}},module$build$src$core$bubbles$text_bubble={};module$build$src$core$bubbles$text_bubble.TextBubble=TextBubble$$module$build$src$core$bubbles$text_bubble;var SIZE$$module$build$src$core$icons$warning_icon=17,WarningIcon$$module$build$src$core$icons$warning_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textMap=new Map;this.textBubble=null}getType(){return WarningIcon$$module$build$src$core$icons$warning_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconShape",d:"M2,15Q-1,15 0.5,12L6.5,1.7Q8,-1 9.5,1.7L15.5,12Q17,15 14,15z"}, +this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconSymbol",x:"7",y:"11",height:"2",width:"2"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyWarningIcon"))}dispose(){super.dispose();let a;(a=this.textBubble)==null|| +a.dispose()}getWeight(){return WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$warning_icon,SIZE$$module$build$src$core$icons$warning_icon)}applyColour(){super.applyColour();let a;(a=this.textBubble)==null||a.setColour(this.sourceBlock.getColour())}updateCollapsed(){}isShownWhenCollapsed(){return!0}onLocationChange(a){super.onLocationChange(a);let b;(b=this.textBubble)==null||b.setAnchorLocation(this.getAnchorLocation())}addMessage(a, +b){if(this.textMap.get(b)===a)return this;a?this.textMap.set(b,a):this.textMap.delete(b);let c;(c=this.textBubble)==null||c.setText(this.getText());return this}getText(){return[...this.textMap.values()].join("\n")}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}bubbleIsVisible(){return!!this.textBubble}setBubbleVisible(a){const b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(b.bubbleIsVisible()!==a){yield finishQueuedRenders$$module$build$src$core$render_management(); +if(a)b.textBubble=new TextBubble$$module$build$src$core$bubbles$text_bubble(b.getText(),b.sourceBlock.workspace,b.getAnchorLocation(),b.getBubbleOwnerRect()),b.applyColour();else{let c;(c=b.textBubble)==null||c.dispose();b.textBubble=null}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"warning"))}})}getBubble(){return this.textBubble}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$warning_icon/ +2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation,new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){const a=this.sourceBlock.getSvgRoot().getBBox();return new Rect$$module$build$src$core$utils$rect(a.y,a.y+a.height,a.x,a.x+a.width)}};WarningIcon$$module$build$src$core$icons$warning_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.WARNING;WarningIcon$$module$build$src$core$icons$warning_icon.WEIGHT=2; +var module$build$src$core$icons$warning_icon={};module$build$src$core$icons$warning_icon.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon;var BlockSvg$$module$build$src$core$block_svg=class extends Block$$module$build$src$core$block{constructor(a,b,c){super(a,b,c);this.childlessWidth=this.width=this.height=0;this.warningTextDb=new Map;this.mutator=null;this.rendered=!0;this.visuallyDisabled=!1;this.translation="";this.dragging=!1;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.dragStrategy=new BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy(this);if(!a.rendered)throw TypeError("Cannot create a rendered block in a headless workspace"); +this.workspace=a;this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});b&&addClass$$module$build$src$core$utils$dom(this.svgGroup,b);this.style=a.getRenderer().getConstants().getBlockStyle(null);this.pathObject=a.getRenderer().makePathObject(this.svgGroup,this.style);a=this.pathObject.svgPath;a.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(a);this.svgGroup.setAttribute("data-id",this.id);a.id=getNextUniqueId$$module$build$src$core$utils$idgenerator(); +this.doInit_()}initSvg(){if(!this.initialized){for(var a of this.inputList)a.init();for(const b of this.getIcons())b.initView(this.createIconPointerDownListener(b)),b.updateEditable();this.applyColour();this.pathObject.updateMovable(this.isMovable()||this.isInFlyout);(a=this.getSvgRoot())&&conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onMouseDown);a.parentNode||this.workspace.getCanvas().appendChild(a);this.initialized=!0}}getColourSecondary(){return this.style.colourSecondary}getColourTertiary(){return this.style.colourTertiary}select(){this.addSelect(); +fireSelectedEvent$$module$build$src$core$common(this)}unselect(){this.removeSelect();fireSelectedEvent$$module$build$src$core$common(null)}setParent(a){var b=this.parentBlock_;if(a!==b){startTextWidthCache$$module$build$src$core$utils$dom();super.setParent(a);stopTextWidthCache$$module$build$src$core$utils$dom();var c=this.getSvgRoot();if(!this.workspace.isClearing&&c){var d=this.getRelativeToSurfaceXY(),e=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode(),f,g=this.getSvgRoot().contains((f= +e==null?void 0:e.getFocusableElement())!=null?f:null);a?(a.getSvgRoot().appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)):b&&(a=this.workspace.getCanvas().querySelector(".blocklyDragging"),b=a==null?void 0:a.parentElement,f=this.workspace.getCanvas(),b===f?f.insertBefore(c,a):(f.appendChild(c),g&&e&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(e)),this.translate(d.x,d.y));this.applyColour()}}}getRelativeToSurfaceXY(){const a=this.workspace.getLayerManager(); +if(!a)throw Error("Cannot calculate position because the workspace has not been appended");let b=0,c=0,d=this.getSvgRoot();if(d){do{const e=getRelativeXY$$module$build$src$core$utils$svg_math(d);b+=e.x;c+=e.y;d=d.parentNode}while(d&&!a.hasLayer(d))}return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}moveBy(a,b,c){if(this.parentBlock_)throw Error("Block has parent");const d=isEnabled$$module$build$src$core$events$utils();let e=null;d&&(e=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(this), +c&&e.setReason(c));a=new Coordinate$$module$build$src$core$utils$coordinate(a,b);b=this.getRelativeToSurfaceXY();a=Coordinate$$module$build$src$core$utils$coordinate.sum(b,a);this.translate(a.x,a.y);this.updateComponentLocations(a);d&&e&&(e.recordNew(),fire$$module$build$src$core$events$utils(e));this.workspace.resizeContents()}translate(a,b){this.translation=`translate(${a}, ${b})`;this.relativeCoords=new Coordinate$$module$build$src$core$utils$coordinate(a,b);this.getSvgRoot().setAttribute("transform", +this.getTranslation())}getTranslation(){return this.translation}moveTo(a,b){const c=this.getRelativeToSurfaceXY();this.moveBy(a.x-c.x,a.y-c.y,b)}moveDuringDrag(a){this.translate(a.x,a.y);this.getSvgRoot().setAttribute("transform",this.getTranslation());this.updateComponentLocations(a)}snapToGrid(){if(!this.isDeadOrDying()&&!this.getParent()&&!this.isInFlyout){var a=this.workspace.getGrid();if(a!=null&&a.shouldSnap()){var b=this.getRelativeToSurfaceXY();a=a.alignXY(b);a!==b&&this.moveTo(a,["snap"])}}}getBoundingRectangle(){return this.getBoundingRectangleWithDimensions(this.getHeightWidth())}getBoundingRectangleWithoutChildren(){return this.getBoundingRectangleWithDimensions({height:this.height, +width:this.childlessWidth})}getBoundingRectangleWithDimensions(a){const b=this.getRelativeToSurfaceXY();let c,d;this.RTL?(c=b.x-a.width,d=b.x):(c=b.x,d=b.x+a.width);return new Rect$$module$build$src$core$utils$rect(b.y,b.y+a.height,c,d)}markDirty(){this.pathObject.constants=this.workspace.getRenderer().getConstants();for(let a=0,b;b=this.inputList[a];a++)b.markDirty()}setCollapsed(a){this.collapsed_!==a&&(super.setCollapsed(a),this.updateCollapsed())}childHasWarning(){const a=this.getChildren(!1); +for(const b of a)if(b.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)||b.childHasWarning())return!0;return!1}updateCollapsed(){var a=this.isCollapsed();const b=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,c=COLLAPSED_FIELD_NAME$$module$build$src$core$constants;for(let e=0,f;f=this.inputList[e];e++)f.name!==b&&f.setVisible(!a);for(var d of this.getIcons())d.updateCollapsed();a?(addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyCollapsed"),this.childHasWarning()&& +this.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID),a=this.toString(COLLAPSE_CHARS$$module$build$src$core$internal_constants),(d=this.getField(c))?d.setValue(a):(this.getInput(b)||this.appendDummyInput(b)).appendField(new FieldLabel$$module$build$src$core$field_label(a),c)):(this.updateDisabled(),this.removeInput(b),removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyCollapsed"),this.setWarningText(null, +BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID))}onMouseDown(a){if(!this.workspace.isReadOnly()){var b=this.workspace.getGesture(a);b&&b.handleBlockStart(a,this)}}showHelp(){const a=typeof this.helpUrl==="function"?this.helpUrl():this.helpUrl;a&&window.open(a)}generateContextMenu(a){if(this.workspace.isReadOnly()||!this.contextMenu)return null;a=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({block:this,focusedNode:this},a);this.customContextMenu&& +this.customContextMenu(a);return a}calculateContextMenuLocation(a){if(a instanceof PointerEvent)return new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);a=wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this.workspace,this.getRelativeToSurfaceXY());let b,c;const d=(b=this.inputList.filter(e=>e.isVisible()).flatMap(e=>e.fieldRow).find(e=>e.isVisible()))==null?void 0:(c=b.getSvgRoot())==null?void 0:c.getBoundingClientRect();return new Coordinate$$module$build$src$core$utils$coordinate(this.RTL? +a.x-5:a.x+5,(d&&d.height?d.y+d.height:a.y+this.height)+5)}showContextMenu(a){const b=this.generateContextMenu(a),c=this.calculateContextMenuLocation(a);b&&b.length&&(show$$module$build$src$core$contextmenu(a,b,this.RTL,this.workspace,c),setCurrentBlock$$module$build$src$core$contextmenu(this))}updateComponentLocations(a){this.dragging||this.updateConnectionLocations(a);this.updateIconLocations(a);this.updateFieldLocations(a);for(const b of this.getChildren(!1))b.updateComponentLocations(Coordinate$$module$build$src$core$utils$coordinate.sum(a, +b.relativeCoords))}updateConnectionLocations(a){for(const b of this.getConnections_(!1))b.moveToOffset(a)}updateIconLocations(a){for(const b of this.getIcons())b.onLocationChange(a)}updateFieldLocations(a){for(const b of this.inputList)for(const c of b.fieldRow)c.onLocationChange(a)}addClass(a){addClass$$module$build$src$core$utils$dom(this.svgGroup,a)}removeClass(a){removeClass$$module$build$src$core$utils$dom(this.svgGroup,a)}setDragging(a){(this.dragging=a)?(this.translation="",draggingConnections$$module$build$src$core$common.push(...this.getConnections_(!0)), +this.addClass("blocklyDragging")):(draggingConnections$$module$build$src$core$common.length=0,this.removeClass("blocklyDragging"));for(let b=0;bc.focusTree(this.workspace),0)}b&&(this.unplug(a),disposeUiEffect$$module$build$src$core$block_animations(this));super.dispose(!!a); +removeNode$$module$build$src$core$utils$dom(this.svgGroup)}disposeInternal(){this.disposing=!0;super.disposeInternal();$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===this&&this.workspace.cancelCurrentGesture();[...this.warningTextDb.values()].forEach(a=>clearTimeout(a));this.warningTextDb.clear();this.getIcons().forEach(a=>a.dispose())}checkAndDelete(){this.workspace.isFlyout||($.setGroup$$module$build$src$core$events$utils(!0),this.workspace.hideChaff(),this.outputConnection? +this.dispose(!1,!0):this.dispose(!0,!0),$.setGroup$$module$build$src$core$events$utils(!1))}toCopyData(a=!1){return this.isInsertionMarker_?null:{paster:BlockPaster$$module$build$src$core$clipboard$block_paster.TYPE,blockState:save$$module$build$src$core$serialization$blocks(this,{addCoordinates:!0,addNextBlocks:a,saveIds:!1}),typeCounts:getBlockTypeCounts$$module$build$src$core$common(this,!0)}}applyColour(){var a,b;(b=(a=this.pathObject).applyColour)==null||b.call(a,this);a=this.getIcons();for(b= +0;b{this.isDeadOrDying()||(this.warningTextDb.delete(b),this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;for(;d;)d.isCollapsed()&&(e=d),d=d.getSurroundParent();e&&e.setWarningText($.Msg$$module$build$src$core$msg.COLLAPSED_WARNINGS_WARNING,BlockSvg$$module$build$src$core$block_svg.COLLAPSED_WARNING_ID); +c?c.addMessage(a,b):this.addIcon((new WarningIcon$$module$build$src$core$icons$warning_icon(this)).addMessage(a,b))}else c&&(b?(c.addMessage("",b),c.getText()||this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE)):this.removeIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))}setMutator(a){this.removeIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);a&&this.addIcon(a)}addIcon(a){super.addIcon(a);a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&& +(this.mutator=a);a.initView(this.createIconPointerDownListener(a));a.applyColour();a.updateEditable();this.queueRender();return a}createIconPointerDownListener(a){return b=>{this.isDeadOrDying()||(b=this.workspace.getGesture(b))&&b.setStartIcon(a)}}removeIcon(a){const b=super.removeIcon(a);a.equals($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE)&&(this.mutator=null);this.queueRender();return b}setDisabledReason(a,b){const c=this.isEnabled();super.setDisabledReason(a,b);this.isEnabled()=== +c||this.getInheritedDisabled()||this.updateDisabled()}setDeletable(a){super.setDeletable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotDeletable")}setHighlighted(a){this.pathObject.updateHighlighted(a)}addSelect(){this.pathObject.updateSelected(!0)}removeSelect(){this.pathObject.updateSelected(!1)}setDeleteStyle(a){this.pathObject.updateDraggingDelete(a)}getColour(){return this.style.colourPrimary}setColour(a){super.setColour(a); +a=this.workspace.getRenderer().getConstants().getBlockStyleForColour(this.colour_);let b,c;(c=(b=this.pathObject).setStyle)==null||c.call(b,a.style);this.style=a.style;this.styleName_=a.name;this.applyColour()}setStyle(a){const b=this.workspace.getRenderer().getConstants().getBlockStyle(a);this.styleName_&&removeClass$$module$build$src$core$utils$dom(this.svgGroup,this.styleName_);if(b){this.hat=b.hat;let c,d;(d=(c=this.pathObject).setStyle)==null||d.call(c,b);this.colour_=b.colourPrimary;this.style= +b;this.applyColour();addClass$$module$build$src$core$utils$dom(this.svgGroup,a);this.styleName_=a}else throw Error("Invalid style name: "+a);}getStyle(){return this.style}bringToFront(a=!1){const b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();let c=this;if(!c.isDeadOrDying()){do{const d=c.getSvgRoot(),e=d.parentNode,f=e.childNodes;f[f.length-1]!==d&&e.appendChild(d);if(a)break;c=c.getParent()}while(c);b&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b)}}setPreviousStatement(a, +b){super.setPreviousStatement(a,b);this.queueRender()}setNextStatement(a,b){super.setNextStatement(a,b);this.queueRender()}setOutput(a,b){super.setOutput(a,b);this.queueRender()}setInputsInline(a){super.setInputsInline(a);this.queueRender()}removeInput(a,b){a=super.removeInput(a,b);this.queueRender();return a}moveNumberedInputBefore(a,b){super.moveNumberedInputBefore(a,b);this.queueRender()}appendInput(a){super.appendInput(a);this.queueRender();return a}setConnectionTracking(a){this.previousConnection&& +this.previousConnection.setTracking(a);this.outputConnection&&this.outputConnection.setTracking(a);if(this.nextConnection){this.nextConnection.setTracking(a);var b=this.nextConnection.targetBlock();b&&b.setConnectionTracking(a)}if(!this.collapsed_)for(b=0;bd.getElement()===a);if(c===-1)return null;c++;c>=b.length&&(c=0);return b[c].getElement()}getPreviousSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()=== +a);if(c===-1)return null;c--;c<0&&(c=b.length-1);return b[c].getElement()}isNavigable(a){return this.policy.isNavigable(a)}isApplicable(a){return this.policy.isApplicable(a)}},module$build$src$core$keyboard_nav$flyout_navigation_policy={};module$build$src$core$keyboard_nav$flyout_navigation_policy.FlyoutNavigationPolicy=FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy;var FlyoutSeparator$$module$build$src$core$flyout_separator=class{constructor(a,b){this.gap=a;this.axis=b;this.y=this.x=0}getBoundingRectangle(){switch(this.axis){case "x":return new Rect$$module$build$src$core$utils$rect(this.y,this.y,this.x,this.x+this.gap);case "y":return new Rect$$module$build$src$core$utils$rect(this.y,this.y+this.gap,this.x,this.x)}}moveBy(a,b,c){this.x+=a;this.y+=b}isNavigable(){return!1}getFocusableElement(){throw Error("Cannot be focused");}getFocusableTree(){throw Error("Cannot be focused"); +}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}},module$build$src$core$flyout_separator={};module$build$src$core$flyout_separator.FlyoutSeparator=FlyoutSeparator$$module$build$src$core$flyout_separator;var FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return!1}isApplicable(a){return a instanceof FlyoutSeparator$$module$build$src$core$flyout_separator}},module$build$src$core$keyboard_nav$flyout_separator_navigation_policy={}; +module$build$src$core$keyboard_nav$flyout_separator_navigation_policy.FlyoutSeparatorNavigationPolicy=FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy;var BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$block_comment_navigation_policy=class{getFirstChild(a){return a.getEditor()}getParent(a){let b;return(b=a.getOwner())!=null?b:null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof TextInputBubble$$module$build$src$core$bubbles$textinput_bubble}},module$build$src$core$keyboard_nav$block_comment_navigation_policy={}; +module$build$src$core$keyboard_nav$block_comment_navigation_policy.BlockCommentNavigationPolicy=BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$block_comment_navigation_policy;var BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy=class{getFirstChild(a){return getBlockNavigationCandidates$$module$build$src$core$keyboard_nav$block_navigation_policy(a,!0)[0]}getParent(a){var b;if((b=a.previousConnection)==null?0:b.targetBlock()){if(b=a.getSurroundParent())return b}else{let c;if((c=a.outputConnection)==null?0:c.targetBlock())return a.outputConnection.targetBlock()}return a.workspace}getNextSibling(a){let b;if((b=a.nextConnection)==null?0:b.targetBlock()){let d; +return(d=a.nextConnection)==null?void 0:d.targetBlock()}let c;return((c=a.outputConnection)==null?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):a.getSurroundParent()?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a.getTopStackBlock(),1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1):null}getPreviousSibling(a){let b; +if((b=a.previousConnection)==null?0:b.targetBlock()){let d;return(d=a.previousConnection)==null?void 0:d.targetBlock()}let c;return((c=a.outputConnection)==null?0:c.targetBlock())?navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):this.getParent(a)instanceof WorkspaceSvg$$module$build$src$core$workspace_svg?navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1):null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof BlockSvg$$module$build$src$core$block_svg}}, +module$build$src$core$keyboard_nav$block_navigation_policy={};module$build$src$core$keyboard_nav$block_navigation_policy.BlockNavigationPolicy=BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$keyboard_nav$block_navigation_policy.navigateStacks=navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy;var CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$comment_bar_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getCommentView().workspace.getCommentById(a.getCommentView().commentId)}getNextSibling(a){const b=a.getCommentView().getCommentBarButtons();a=b.indexOf(a);return a>=0&&a+10?b[a-1]:null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof +CommentBarButton$$module$build$src$core$comments$comment_bar_button}},module$build$src$core$keyboard_nav$comment_bar_button_navigation_policy={};module$build$src$core$keyboard_nav$comment_bar_button_navigation_policy.CommentBarButtonNavigationPolicy=CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$comment_bar_button_navigation_policy;var CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$comment_editor_navigation_policy=class{getFirstChild(a){return null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof CommentEditor$$module$build$src$core$comments$comment_editor}},module$build$src$core$keyboard_nav$comment_editor_navigation_policy={}; +module$build$src$core$keyboard_nav$comment_editor_navigation_policy.CommentEditorNavigationPolicy=CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$comment_editor_navigation_policy;var ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy=class{getFirstChild(a){return a.getParentInput()?a.targetConnection:null}getParent(a){return a.getSourceBlock()}getNextSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1);if(a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){const c=a.targetConnection;var b=a.getSourceBlock();if(!c&&b.getRootBlock().lastConnectionInStack(!1)=== +a){a=b.workspace.getTopBlocks(!0);b=a.indexOf(b.getRootBlock())+1;b>=a.length&&(b=0);b=a[b];let d;return(d=this.getParentConnection(b))!=null?d:b}return c}return a.getSourceBlock()}getPreviousSibling(a){if(a.getParentInput())return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1);if(a.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||a.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE){const c=a.targetConnection&& +!a.targetConnection.getParentInput()?a.targetConnection:null;var b=a.getSourceBlock();if(!c&&this.getParentConnection(b.getRootBlock())===a){a=b.workspace.getTopBlocks(!0);b=a.indexOf(b.getRootBlock())-1;b<0&&(b=a.length-1);b=a[b];let d;return(d=b.lastConnectionInStack(!1))!=null?d:b}return c}return a.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT?a.getSourceBlock():null}getParentConnection(a){let b;return!a.outputConnection||((b=a.previousConnection)==null?0:b.isConnected())? +a.previousConnection:a.outputConnection}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedConnection$$module$build$src$core$rendered_connection}},module$build$src$core$keyboard_nav$connection_navigation_policy={};module$build$src$core$keyboard_nav$connection_navigation_policy.ConnectionNavigationPolicy=ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy;var FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){let b;return a.canBeFocused()&&a.isVisible()&&(a.isClickable()||a.isCurrentlyEditable())&&!(((b=a.getSourceBlock())== +null?0:b.isSimpleReporter())&&a.isFullBlockField())&&a.getParentInput().isVisible()}isApplicable(a){return a instanceof Field$$module$build$src$core$field}},module$build$src$core$keyboard_nav$field_navigation_policy={};module$build$src$core$keyboard_nav$field_navigation_policy.FieldNavigationPolicy=FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy;var module$build$src$core$icons$registry={};module$build$src$core$icons$registry.register=register$$module$build$src$core$icons$registry;module$build$src$core$icons$registry.unregister=unregister$$module$build$src$core$icons$registry;var SIZE$$module$build$src$core$icons$comment_icon=17,DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon=160,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon=80,CommentIcon$$module$build$src$core$icons$comment_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a){super(a);this.sourceBlock=a;this.textInputBubble=null;this.text="";this.bubbleSize=new Size$$module$build$src$core$utils$size(DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon); +this.bubbleVisiblity=!1}getType(){return CommentIcon$$module$build$src$core$icons$comment_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"8",cx:"8",cy:"8"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z"}, +this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconSymbol",x:"6.8",y:"10.78",height:"2",width:"2"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyCommentIcon"))}dispose(){super.dispose();let a;(a=this.textInputBubble)==null||a.dispose()}getWeight(){return CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$comment_icon, +SIZE$$module$build$src$core$icons$comment_icon)}applyColour(){super.applyColour();const a=this.sourceBlock.getColour();let b;(b=this.textInputBubble)==null||b.setColour(a)}updateEditable(){const a=this,b=()=>super.updateEditable;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){b().call(a);a.bubbleIsVisible()&&(yield a.setBubbleVisible(!1),yield a.setBubbleVisible(!0))})}onLocationChange(a){const b=this.workspaceLocation;super.onLocationChange(a);this.bubbleLocation&&(a=Coordinate$$module$build$src$core$utils$coordinate.difference(this.workspaceLocation, +b),this.bubbleLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(this.bubbleLocation,a));a=this.getAnchorLocation();let c;(c=this.textInputBubble)==null||c.setAnchorLocation(a)}setText(a){const b=this.text;fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock,"comment",null,b,a));this.text=a;let c;(c=this.textInputBubble)==null||c.setText(this.text)}getText(){return this.text}setBubbleSize(a){this.bubbleSize= +a;let b;(b=this.textInputBubble)==null||b.setSize(this.bubbleSize,!0)}getBubbleSize(){return this.bubbleSize}setBubbleLocation(a){this.bubbleLocation=a;let b;(b=this.textInputBubble)==null||b.moveDuringDrag(a)}getBubbleLocation(){return this.bubbleLocation}saveState(){if(this.text){const a={text:this.text,pinned:this.bubbleIsVisible(),height:this.bubbleSize.height,width:this.bubbleSize.width},b=this.getBubbleLocation();b&&(a.x=this.sourceBlock.workspace.RTL?this.sourceBlock.workspace.getWidth()-(b.x+ +this.bubbleSize.width):b.x,a.y=b.y);return a}return null}loadState(a){let b;this.text=(b=a.text)!=null?b:"";let c,d;this.bubbleSize=new Size$$module$build$src$core$utils$size((c=a.width)!=null?c:DEFAULT_BUBBLE_WIDTH$$module$build$src$core$icons$comment_icon,(d=a.height)!=null?d:DEFAULT_BUBBLE_HEIGHT$$module$build$src$core$icons$comment_icon);let e;this.bubbleVisiblity=(e=a.pinned)!=null?e:!1;this.setBubbleVisible(this.bubbleVisiblity);let f=a.x;const g=a.y;finishQueuedRenders$$module$build$src$core$render_management().then(()=> +{f&&g&&(f=this.sourceBlock.workspace.RTL?this.sourceBlock.workspace.getWidth()-(f+this.bubbleSize.width):f,this.setBubbleLocation(new Coordinate$$module$build$src$core$utils$coordinate(f,g)))})}onClick(){super.onClick();this.setBubbleVisible(!this.bubbleIsVisible())}isClickableInFlyout(){return!1}onTextChange(){if(this.textInputBubble){var a=this.textInputBubble.getText();this.text!==a&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock, +"comment",null,this.text,a)),this.text=a)}}onSizeChange(){this.textInputBubble&&(this.bubbleSize=this.textInputBubble.getSize())}onBubbleLocationChange(){this.textInputBubble&&(this.bubbleLocation=this.textInputBubble.getRelativeToSurfaceXY())}bubbleIsVisible(){return this.bubbleVisiblity}setBubbleVisible(a){const b=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){b.bubbleVisiblity!==a&&(b.bubbleVisiblity=a,yield finishQueuedRenders$$module$build$src$core$render_management(), +!b.sourceBlock.rendered||b.sourceBlock.isInFlyout||b.sourceBlock.isInsertionMarker()||(a?(b.sourceBlock.isEditable()?b.showEditableBubble():b.showNonEditableBubble(),b.applyColour()):b.hideBubble(),fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BUBBLE_OPEN))(b.sourceBlock,a,"comment"))))})}getBubble(){return this.textInputBubble}showEditableBubble(){this.createBubble();let a;(a=this.textInputBubble)==null||a.addTextChangeListener(()=> +this.onTextChange());let b;(b=this.textInputBubble)==null||b.addSizeChangeListener(()=>this.onSizeChange())}showNonEditableBubble(){this.createBubble();let a;(a=this.textInputBubble)==null||a.setEditable(!1)}createBubble(){this.textInputBubble=new TextInputBubble$$module$build$src$core$bubbles$textinput_bubble(this.sourceBlock.workspace,this.getAnchorLocation(),this.getBubbleOwnerRect(),this);this.textInputBubble.setText(this.getText());this.textInputBubble.setSize(this.bubbleSize,!0);this.bubbleLocation&& +this.textInputBubble.moveDuringDrag(this.bubbleLocation);this.textInputBubble.addTextChangeListener(()=>this.onTextChange());this.textInputBubble.addSizeChangeListener(()=>this.onSizeChange());this.textInputBubble.addLocationChangeListener(()=>this.onBubbleLocationChange())}hideBubble(){let a;(a=this.textInputBubble)==null||a.dispose();this.textInputBubble=null}getAnchorLocation(){const a=SIZE$$module$build$src$core$icons$comment_icon/2;return Coordinate$$module$build$src$core$utils$coordinate.sum(this.workspaceLocation, +new Coordinate$$module$build$src$core$utils$coordinate(a,a))}getBubbleOwnerRect(){return this.sourceBlock.getBoundingRectangleWithoutChildren()}};CommentIcon$$module$build$src$core$icons$comment_icon.TYPE=IconType$$module$build$src$core$icons$icon_types.COMMENT;CommentIcon$$module$build$src$core$icons$comment_icon.WEIGHT=3;register$$module$build$src$core$icons$registry(CommentIcon$$module$build$src$core$icons$comment_icon.TYPE,CommentIcon$$module$build$src$core$icons$comment_icon); +var module$build$src$core$icons$comment_icon={};module$build$src$core$icons$comment_icon.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;var IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy=class{getFirstChild(a){if(a instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()===a){let b,c;return(c=(b=a.getBubble())==null?void 0:b.getWorkspace())!=null?c:null}if(a instanceof CommentIcon$$module$build$src$core$icons$comment_icon&&a.bubbleIsVisible()&&$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()=== +a){let b,c;return(c=(b=a.getBubble())==null?void 0:b.getEditor())!=null?c:null}return null}getParent(a){return a.getSourceBlock()}getNextSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof Icon$$module$build$src$core$icons$icon}},module$build$src$core$keyboard_nav$icon_navigation_policy= +{};module$build$src$core$keyboard_nav$icon_navigation_policy.IconNavigationPolicy=IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy;var WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_comment_navigation_policy=class{getFirstChild(a){return a.view.getCommentBarButtons()[0]}getParent(a){return a.workspace}getNextSibling(a){return navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,1)}getPreviousSibling(a){return navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy(a,-1)}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment}}, +module$build$src$core$keyboard_nav$workspace_comment_navigation_policy={};module$build$src$core$keyboard_nav$workspace_comment_navigation_policy.WorkspaceCommentNavigationPolicy=WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_comment_navigation_policy;var WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy=class{getFirstChild(a){a=a.getTopBlocks(!0);return a.length?a[0]:null}getParent(a){return null}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()&&!a.isMutator}isApplicable(a){return a instanceof WorkspaceSvg$$module$build$src$core$workspace_svg}},module$build$src$core$keyboard_nav$workspace_navigation_policy={}; +module$build$src$core$keyboard_nav$workspace_navigation_policy.WorkspaceNavigationPolicy=WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy;var Navigator$$module$build$src$core$navigator=class{constructor(){this.rules=[new BlockNavigationPolicy$$module$build$src$core$keyboard_nav$block_navigation_policy,new FieldNavigationPolicy$$module$build$src$core$keyboard_nav$field_navigation_policy,new ConnectionNavigationPolicy$$module$build$src$core$keyboard_nav$connection_navigation_policy,new WorkspaceNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_navigation_policy,new IconNavigationPolicy$$module$build$src$core$keyboard_nav$icon_navigation_policy, +new WorkspaceCommentNavigationPolicy$$module$build$src$core$keyboard_nav$workspace_comment_navigation_policy,new CommentBarButtonNavigationPolicy$$module$build$src$core$keyboard_nav$comment_bar_button_navigation_policy,new BlockCommentNavigationPolicy$$module$build$src$core$keyboard_nav$block_comment_navigation_policy,new CommentEditorNavigationPolicy$$module$build$src$core$keyboard_nav$comment_editor_navigation_policy]}addNavigationPolicy(a){this.rules.push(a)}get(a){return this.rules.find(b=>b.isApplicable(a))}getFirstChild(a){let b; +const c=(b=this.get(a))==null?void 0:b.getFirstChild(a);if(!c)return null;let d;return(d=this.get(c))!=null&&d.isNavigable(c)?c:this.getFirstChild(c)||this.getNextSibling(c)}getParent(a){let b;const c=(b=this.get(a))==null?void 0:b.getParent(a);if(!c)return null;let d;return(d=this.get(c))!=null&&d.isNavigable(c)?c:this.getParent(c)}getNextSibling(a){let b;const c=(b=this.get(a))==null?void 0:b.getNextSibling(a);if(!c)return null;let d;return(d=this.get(c))!=null&&d.isNavigable(c)?c:this.getNextSibling(c)}getPreviousSibling(a){let b; +const c=(b=this.get(a))==null?void 0:b.getPreviousSibling(a);if(!c)return null;let d;return(d=this.get(c))!=null&&d.isNavigable(c)?c:this.getPreviousSibling(c)}},module$build$src$core$navigator={};module$build$src$core$navigator.Navigator=Navigator$$module$build$src$core$navigator;var FlyoutNavigator$$module$build$src$core$flyout_navigator=class extends Navigator$$module$build$src$core$navigator{constructor(a){super();this.rules.push(new FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy,new FlyoutSeparatorNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_separator_navigation_policy);this.rules=this.rules.map(b=>new FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy(b,a))}},module$build$src$core$flyout_navigator= +{};module$build$src$core$flyout_navigator.FlyoutNavigator=FlyoutNavigator$$module$build$src$core$flyout_navigator;var ScrollbarPair$$module$build$src$core$scrollbar_pair=class{constructor(a,b,c,d,e){this.workspace=a;this.oldHostMetrics=this.corner_=this.vScroll=this.hScroll=null;b=b===void 0?!0:b;c=c===void 0?!0:c;const f=b&&c;b&&(this.hScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!0,f,d,e));c&&(this.vScroll=new Scrollbar$$module$build$src$core$scrollbar(a,!1,f,d,e));f&&(this.corner_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness, +width:Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness,"class":"blocklyScrollbarBackground"}),insertAfter$$module$build$src$core$utils$dom(this.corner_,a.getBubbleCanvas()))}dispose(){removeNode$$module$build$src$core$utils$dom(this.corner_);this.oldHostMetrics=this.corner_=null;this.hScroll&&(this.hScroll.dispose(),this.hScroll=null);this.vScroll&&(this.vScroll.dispose(),this.vScroll=null)}resize(){const a=this.workspace.getMetrics();if(a){var b=!1,c=!1;this.oldHostMetrics&&this.oldHostMetrics.viewWidth=== +a.viewWidth&&this.oldHostMetrics.viewHeight===a.viewHeight&&this.oldHostMetrics.absoluteTop===a.absoluteTop&&this.oldHostMetrics.absoluteLeft===a.absoluteLeft?(this.oldHostMetrics&&this.oldHostMetrics.scrollWidth===a.scrollWidth&&this.oldHostMetrics.viewLeft===a.viewLeft&&this.oldHostMetrics.scrollLeft===a.scrollLeft||(b=!0),this.oldHostMetrics&&this.oldHostMetrics.scrollHeight===a.scrollHeight&&this.oldHostMetrics.viewTop===a.viewTop&&this.oldHostMetrics.scrollTop===a.scrollTop||(c=!0)):c=b=!0;if(b|| +c){try{$.disable$$module$build$src$core$events$utils(),this.hScroll&&b&&this.hScroll.resize(a),this.vScroll&&c&&this.vScroll.resize(a)}finally{$.enable$$module$build$src$core$events$utils()}this.workspace.maybeFireViewportChangeEvent()}if(this.hScroll&&this.vScroll){if(!this.oldHostMetrics||this.oldHostMetrics.viewWidth!==a.viewWidth||this.oldHostMetrics.absoluteLeft!==a.absoluteLeft){let d;(d=this.corner_)==null||d.setAttribute("x",String(this.vScroll.position.x))}if(!this.oldHostMetrics||this.oldHostMetrics.viewHeight!== +a.viewHeight||this.oldHostMetrics.absoluteTop!==a.absoluteTop){let d;(d=this.corner_)==null||d.setAttribute("y",String(this.hScroll.position.y))}}this.oldHostMetrics=a}}canScrollHorizontally(){return!!this.hScroll}canScrollVertically(){return!!this.vScroll}setOrigin(a,b){this.hScroll&&this.hScroll.setOrigin(a,b);this.vScroll&&this.vScroll.setOrigin(a,b)}set(a,b,c){this.hScroll&&this.hScroll.set(a,!1);this.vScroll&&this.vScroll.set(b,!1);if(c||c===void 0)a={},this.hScroll&&(a.x=this.hScroll.getRatio_()), +this.vScroll&&(a.y=this.vScroll.getRatio_()),this.workspace.setMetrics(a)}setX(a){this.hScroll&&this.hScroll.set(a,!0)}setY(a){this.vScroll&&this.vScroll.set(a,!0)}setContainerVisible(a){this.hScroll&&this.hScroll.setContainerVisible(a);this.vScroll&&this.vScroll.setContainerVisible(a)}isVisible(){let a=!1;this.hScroll&&(a=this.hScroll.isVisible());this.vScroll&&(a=a||this.vScroll.isVisible());return a}setVisible(a){this.hScroll&&this.hScroll.setVisibleInternal(a);this.vScroll&&this.vScroll.setVisibleInternal(a)}resizeContent(a){this.hScroll&& +this.hScroll.resizeContentHorizontal(a);this.vScroll&&this.vScroll.resizeContentVertical(a)}resizeView(a){this.hScroll&&this.hScroll.resizeViewHorizontal(a);this.vScroll&&this.vScroll.resizeViewVertical(a)}},module$build$src$core$scrollbar_pair={};module$build$src$core$scrollbar_pair.ScrollbarPair=ScrollbarPair$$module$build$src$core$scrollbar_pair;var SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater="sep",SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater=class{load(a,b){a=new FlyoutSeparator$$module$build$src$core$flyout_separator(0,b.horizontalLayout?"x":"y");return new FlyoutItem$$module$build$src$core$flyout_item(a,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater)}gapForItem(a,b){let c;return(c=parseInt(String(a.gap)))!=null?c:b}disposeItem(a){}getType(){return SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater}}; +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater,SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater);var module$build$src$core$separator_flyout_inflater={SEPARATOR_TYPE:SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater};module$build$src$core$separator_flyout_inflater.SeparatorFlyoutInflater=SeparatorFlyoutInflater$$module$build$src$core$separator_flyout_inflater;var Flyout$$module$build$src$core$flyout_base=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.horizontalLayout=!1;this.boundEvents=[];this.reflowWrapper=null;this.contents=[];this.autoClose=!0;this.visible=!1;this.containerVisible=!0;this.CORNER_RADIUS=8;this.SCROLLBAR_MARGIN=2.5;this.height_=this.width_=0;this.dragAngleRange_=70;this.svgGroup_=this.svgBackground_=null;this.inflaters=new Map;a.setMetrics=this.setMetrics_.bind(this);this.workspace_=new WorkspaceSvg$$module$build$src$core$workspace_svg(a); +this.workspace_.setMetricsManager(new FlyoutMetricsManager$$module$build$src$core$flyout_metrics_manager(this.workspace_,this));this.workspace_.internalIsFlyout=!0;this.workspace_.setVisible(this.visible);this.workspace_.setNavigator(new FlyoutNavigator$$module$build$src$core$flyout_navigator(this));this.id=genUid$$module$build$src$core$utils$idgenerator();this.RTL=!!a.RTL;this.toolboxPosition_=a.toolboxPosition;this.tabWidth_=this.workspace_.getRenderer().getConstants().TAB_WIDTH;this.MARGIN=this.CORNER_RADIUS; +this.GAP_X=this.MARGIN*3;this.GAP_Y=this.MARGIN*3}createDom(a){this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(a,{"class":"blocklyFlyout"});this.svgGroup_.style.display="none";this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyFlyoutBackground"},this.svgGroup_);this.svgGroup_.appendChild(this.workspace_.createDom());this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutBackgroundColour", +"fill");this.workspace_.getThemeManager().subscribe(this.svgBackground_,"flyoutOpacity","fill-opacity");return this.svgGroup_}init(a){this.targetWorkspace=a;this.workspace_.targetWorkspace=a;this.workspace_.scrollbar=new ScrollbarPair$$module$build$src$core$scrollbar_pair(this.workspace_,this.horizontalLayout,!this.horizontalLayout,"blocklyFlyoutScrollbar",this.SCROLLBAR_MARGIN);this.hide();this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"wheel",this,this.wheel_)); +this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(this.svgBackground_,"pointerdown",this,this.onMouseDown));this.workspace_.getGesture=this.targetWorkspace.getGesture.bind(this.targetWorkspace);this.workspace_.setVariableMap(this.targetWorkspace.getVariableMap());this.workspace_.createPotentialVariableMap();a.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.FLYOUT_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE, +ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET]})}dispose(){this.hide();this.targetWorkspace.getComponentManager().removeComponent(this.id);for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);this.boundEvents.length=0;this.workspace_&&(this.workspace_.getThemeManager().unsubscribe(this.svgBackground_),this.workspace_.dispose());this.svgGroup_&&removeNode$$module$build$src$core$utils$dom(this.svgGroup_)}getWidth(){return this.width_}getHeight(){return this.height_}getFlyoutScale(){return this.targetWorkspace.scale}getWorkspace(){return this.workspace_}setAutoClose(a){this.autoClose= +a;this.targetWorkspace.recordDragTargets();this.targetWorkspace.resizeContents()}autoHide(a){!a&&this.targetWorkspace.getFlyout(!0)===this&&this.autoClose&&this.hide()}getTargetWorkspace(){return this.targetWorkspace}isVisible(){return this.visible}setVisible(a){const b=a!==this.isVisible();this.visible=a;b&&(this.autoClose||this.targetWorkspace.recordDragTargets(),this.updateDisplay())}setContainerVisible(a){const b=a!==this.containerVisible;this.containerVisible=a;b&&this.updateDisplay()}getContents(){return this.contents}setContents(a){this.contents= +a}updateDisplay(){let a;a=this.containerVisible?this.isVisible():!1;this.svgGroup_&&(this.svgGroup_.style.display=a?"block":"none");let b;(b=this.workspace_.scrollbar)==null||b.setContainerVisible(a)}positionAt_(a,b,c,d){let e;(e=this.svgGroup_)==null||e.setAttribute("width",`${a}`);let f;(f=this.svgGroup_)==null||f.setAttribute("height",`${b}`);this.workspace_.setCachedParentSvgSize(a,b);this.svgGroup_&&setCssTransform$$module$build$src$core$utils$dom(this.svgGroup_,"translate("+c+"px,"+d+"px)"); +if(a=this.workspace_.scrollbar)a.setOrigin(c,d),a.resize(),a.hScroll&&a.hScroll.setPosition(a.hScroll.position.x,a.hScroll.position.y),a.vScroll&&a.vScroll.setPosition(a.vScroll.position.x,a.vScroll.position.y)}hide(){this.isVisible()&&(this.setVisible(!1),this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null))}show(a){this.workspace_.setResizesEnabled(!1);this.hide();this.clearOldBlocks();typeof a==="string"&&(a=this.getDynamicCategoryContents(a)); +this.setVisible(!0);a=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a);a=this.createFlyoutInfo(a);triggerQueuedRenders$$module$build$src$core$render_management(this.workspace_);this.setContents(a);this.layout_(a);this.horizontalLayout?this.height_=0:this.width_=0;this.reflow();this.workspace_.setResizesEnabled(!0);this.reflowWrapper=b=>{b.type!==EventType$$module$build$src$core$events$type.BLOCK_CHANGE&&b.type!==EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE|| +this.reflow()};this.workspace_.addChangeListener(this.reflowWrapper)}createFlyoutInfo(a){const b=[],c=this.horizontalLayout?this.GAP_X:this.GAP_Y;for(const d of a)if("custom"in d&&(a=this.getDynamicCategoryContents(d.custom),a=convertFlyoutDefToJsonArray$$module$build$src$core$utils$toolbox(a),b.push(...this.createFlyoutInfo(a))),a=d.kind.toLowerCase(),a=this.getInflaterForType(a))b.push(a.load(d,this)),(a=a.gapForItem(d,c))&&b.push(new FlyoutItem$$module$build$src$core$flyout_item(new FlyoutSeparator$$module$build$src$core$flyout_separator(a, +this.horizontalLayout?"x":"y"),SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater));return this.normalizeSeparators(b)}normalizeSeparators(a){for(let b=a.length-1;b>0;b--){const c=a[b].getType().toLowerCase(),d=a[b-1].getType().toLowerCase();c===SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater&&d===SEPARATOR_TYPE$$module$build$src$core$separator_flyout_inflater&&a.splice(b-1,1)}return a}getDynamicCategoryContents(a){a=this.workspace_.targetWorkspace.getToolboxCategoryCallback(a); +if(typeof a!=="function")throw TypeError("Couldn't find a callback function when opening a toolbox category.");return a(this.workspace_.targetWorkspace)}clearOldBlocks(){this.getContents().forEach(b=>{let c;(c=this.getInflaterForType(b.getType()))==null||c.disposeItem(b)});let a;(a=this.workspace_.getPotentialVariableMap())==null||a.clear()}onMouseDown(a){const b=this.targetWorkspace.getGesture(a);b&&b.handleFlyoutStart(a,this)}isBlockCreatable(a){return a.isEnabled()&&!this.getTargetWorkspace().isReadOnly()}createBlock(a){let b= +null;$.disable$$module$build$src$core$events$utils();var c=this.targetWorkspace.getAllVariables();this.targetWorkspace.setResizesEnabled(!1);try{b=this.placeNewBlock(a)}finally{$.enable$$module$build$src$core$events$utils()}this.targetWorkspace.hideChaff();a=getAddedVariables$$module$build$src$core$variables(this.targetWorkspace,c);if(isEnabled$$module$build$src$core$events$utils()){$.setGroup$$module$build$src$core$events$utils(!0);for(c=0;c +(this.flyout?$.config$$module$build$src$core$config.flyoutDragRadius:$.config$$module$build$src$core$config.dragRadius)}updateIsDraggingFromFlyout(){let a;if(!this.targetBlock||(a=this.flyout)==null||!a.isBlockCreatable(this.targetBlock))return!1;if(!this.flyout.targetWorkspace)throw Error("Cannot update dragging from the flyout because the ' +\n 'flyout's target workspace is undefined");return!this.flyout.isScrollable()||this.flyout.isDragTowardWorkspace(this.currentDragDeltaXY)?(this.startWorkspace_= +this.flyout.targetWorkspace,this.startWorkspace_.updateScreenCalculationsIfScrolled(),$.getGroup$$module$build$src$core$events$utils()||$.setGroup$$module$build$src$core$events$utils(!0),this.startBlock=null,this.targetBlock=this.flyout.createBlock(this.targetBlock),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.targetBlock),!0):!1}updateIsDraggingWorkspace(){if(!this.startWorkspace_)throw Error("Cannot update dragging the workspace because the start workspace is undefined"); +if(this.flyout?this.flyout.isScrollable():this.startWorkspace_&&this.startWorkspace_.isDraggable())this.dragging=!0,this.workspaceDragger=new WorkspaceDragger$$module$build$src$core$workspace_dragger(this.startWorkspace_),this.workspaceDragger.startDrag()}updateIsDragging(a){if(!this.startWorkspace_)throw Error("Cannot update dragging because the start workspace is undefined");if(this.calledUpdateIsDragging)throw Error("updateIsDragging_ should only be called once per gesture.");this.calledUpdateIsDragging= +!0;this.flyout&&this.updateIsDraggingFromFlyout();const b=getSelected$$module$build$src$core$common();b&&isDraggable$$module$build$src$core$interfaces$i_draggable(b)&&b.isMovable()?(this.dragging=!0,this.dragger=this.createDragger(b,this.startWorkspace_),this.dragger.onDragStart(a),this.dragger.onDrag(a,this.currentDragDeltaXY)):this.updateIsDraggingWorkspace()}createDragger(a,b){return new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,this.creatorWorkspace.options, +!0))(a,b)}doStart(a){if(!this.startWorkspace_)throw Error("Cannot start the touch gesture becauase the start workspace is undefined");this.isPinchZoomEnabled=this.startWorkspace_.options.zoomOptions&&this.startWorkspace_.options.zoomOptions.pinch;isTargetInput$$module$build$src$core$browser_events(a)?this.cancel():(this.gestureHasStarted=!0,disconnectUiStop$$module$build$src$core$block_animations(),this.startWorkspace_.updateScreenCalculationsIfScrolled(),this.startWorkspace_.isMutator&&this.startWorkspace_.resize(), +this.currentDropdownOwner=getOwner$$module$build$src$core$dropdowndiv(),this.startWorkspace_.hideChaff(!!this.flyout),this.startWorkspace_.markFocused(),this.mostRecentEvent=a,block$$module$build$src$core$tooltip(),isRightButton$$module$build$src$core$browser_events(a)?this.handleRightClick(a):(a.type.toLowerCase()==="pointerdown"&&a.pointerType!=="mouse"&&longStart$$module$build$src$core$touch(a,this),this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY),this.bindMouseEvents(a), +this.isEnding_||this.handleTouchStart(a)))}bindMouseEvents(a){this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointerdown",null,this.handleStart.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointermove",null,this.handleMove.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document,"pointerup",null,this.handleUp.bind(this),!0));this.boundEvents.push(conditionalBind$$module$build$src$core$browser_events(document, +"pointercancel",null,this.handleUp.bind(this),!0));a.preventDefault();a.stopPropagation()}handleStart(a){this.isDragging()||(this.handleTouchStart(a),this.isMultiTouch()&&longStop$$module$build$src$core$touch())}handleMove(a){if(this.isDragging()&&shouldHandleEvent$$module$build$src$core$touch(a)||!this.isMultiTouch()){this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);else if(this.dragger)this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY); +a.preventDefault();a.stopPropagation()}else this.isMultiTouch()&&(this.handleTouchMove(a),longStop$$module$build$src$core$touch())}handleUp(a){this.isDragging()||this.handleTouchEnd(a);if(!this.isMultiTouch()||this.isDragging()){if(!shouldHandleEvent$$module$build$src$core$touch(a))return;this.updateFromEvent(a);longStop$$module$build$src$core$touch();if(this.isEnding_){console.log("Trying to end a gesture recursively.");return}this.isEnding_=!0;this.dragger?(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1), +this.dragger.onDragEnd(a,this.currentDragDeltaXY)):this.workspaceDragger?(keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1),this.workspaceDragger.endDrag(this.currentDragDeltaXY)):this.isBubbleClick()||this.isCommentClick()||(this.isFieldClick()?this.doFieldClick():this.isIconClick()?this.doIconClick():this.isBlockClick()?this.doBlockClick():this.isWorkspaceClick()&&this.doWorkspaceClick(a))}a.preventDefault();a.stopPropagation();this.dispose()}handleTouchStart(a){var b= +getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));var c=Array.from(this.cachedPoints.keys());c.length===2&&(b=this.cachedPoints.get(c[0]),c=this.cachedPoints.get(c[1]),this.startDistance=Coordinate$$module$build$src$core$utils$coordinate.distance(b,c),this.multiTouch=!0,a.preventDefault())}handleTouchMove(a){const b=getTouchIdentifierFromEvent$$module$build$src$core$touch(a);this.cachedPoints.set(b,this.getTouchPoint(a));if(this.isPinchZoomEnabled&& +this.cachedPoints.size===2)this.handlePinch(a);else{this.updateFromEvent(a);if(this.workspaceDragger)this.workspaceDragger.drag(this.currentDragDeltaXY);else if(this.dragger)this.dragger.onDrag(this.mostRecentEvent,this.currentDragDeltaXY);a.preventDefault();a.stopPropagation()}}handlePinch(a){var b=Array.from(this.cachedPoints.keys()),c=this.cachedPoints.get(b[0]);b=this.cachedPoints.get(b[1]);c=Coordinate$$module$build$src$core$utils$coordinate.distance(c,b)/this.startDistance;if(this.previousScale> +0&&this.previousScale0?b*ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture:b*ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture;if(!this.startWorkspace_)throw Error("Cannot handle a pinch because the start workspace is undefined");const d=this.startWorkspace_,e=mouseToSvg$$module$build$src$core$browser_events(a,d.getParentSvg(),d.getInverseScreenCTM());d.zoom(e.x,e.y,b)}this.previousScale=c;a.preventDefault()}handleTouchEnd(a){a=getTouchIdentifierFromEvent$$module$build$src$core$touch(a); +this.cachedPoints.has(a)&&this.cachedPoints.delete(a);this.cachedPoints.size<2&&(this.cachedPoints.clear(),this.previousScale=0)}getTouchPoint(a){return this.startWorkspace_?new Coordinate$$module$build$src$core$utils$coordinate(a.pageX,a.pageY):null}isMultiTouch(){return this.multiTouch}cancel(){if(!this.isEnding_){longStop$$module$build$src$core$touch();if(this.dragger)this.dragger.onDragEnd(this.mostRecentEvent,this.currentDragDeltaXY);else this.workspaceDragger&&this.workspaceDragger.endDrag(this.currentDragDeltaXY); +this.dispose()}}handleRightClick(a){this.targetBlock?(this.bringBlockToFront(),this.targetBlock.workspace.hideChaff(!!this.flyout),this.targetBlock.showContextMenu(a)):this.startBubble?this.startBubble.showContextMenu(a):this.startComment?(this.startComment.workspace.hideChaff(),this.startComment.showContextMenu(a)):this.startWorkspace_&&!this.flyout&&(this.startWorkspace_.hideChaff(),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.startWorkspace_),this.startWorkspace_.showContextMenu(a)); +a.preventDefault();a.stopPropagation();keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller.setIsActive(!1);this.dispose()}handleWsStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleWsStart, but the gesture had already been started.");this.setStartWorkspace(b);this.mostRecentEvent=a;this.startBlock||this.startBubble||this.startComment?this.startBlock&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.startBlock):$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b); +this.doStart(a)}fireWorkspaceClick(a){fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(null,a.id,"workspace"))}handleFlyoutStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleFlyoutStart, but the gesture had already been started.");this.setStartFlyout(b);this.handleWsStart(a,b.getWorkspace())}handleBlockStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBlockStart, but the gesture had already been started."); +this.setStartBlock(b);this.mostRecentEvent=a}handleBubbleStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleBubbleStart, but the gesture had already been started.");this.setStartBubble(b);this.mostRecentEvent=a}handleCommentStart(a,b){if(this.gestureHasStarted)throw Error("Tried to call gesture.handleCommentStart, but the gesture had already been started.");this.setStartComment(b);this.mostRecentEvent=a}doFieldClick(){if(!this.startField)throw Error("Cannot do a field click because the start field is undefined"); +this.bringBlockToFront();this.currentDropdownOwner!==this.startField&&this.startField.showEditor(this.mostRecentEvent)}doIconClick(){if(!this.startIcon)throw Error("Cannot do an icon click because the start icon is undefined");this.bringBlockToFront();this.startIcon.onClick()}doBlockClick(){if(this.flyout&&this.flyout.autoClose){if(!this.targetBlock)throw Error("Cannot do a block click because the target block is undefined");if(this.flyout.isBlockCreatable(this.targetBlock)){$.getGroup$$module$build$src$core$events$utils()|| +$.setGroup$$module$build$src$core$events$utils(!0);var a=this.flyout.createBlock(this.targetBlock);a.snapToGrid();a.bumpNeighbours();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}}else{if(!this.startWorkspace_)throw Error("Cannot do a block click because the start workspace is undefined");a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.CLICK))(this.startBlock,this.startWorkspace_.id,"block");fire$$module$build$src$core$events$utils(a)}this.bringBlockToFront(); +$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){this.fireWorkspaceClick(this.startWorkspace_||this.creatorWorkspace)}bringBlockToFront(){this.targetBlock&&!this.flyout&&($.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.targetBlock),this.targetBlock.bringToFront())}setStartField(a){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartField, but the gesture had already been started.");this.startField||(this.startField=a)}setStartIcon(a){if(this.gestureHasStarted)throw Error("Tried to call gesture.setStartIcon, but the gesture had already been started."); +this.startIcon||(this.startIcon=a)}setStartBubble(a){this.startBubble||(this.startBubble=a)}setStartComment(a){this.startComment||(this.startComment=a)}setStartBlock(a){this.startBlock||this.startBubble||(this.startBlock=a,a.isInFlyout&&a!==a.getRootBlock()?this.setTargetBlock(a.getRootBlock()):this.setTargetBlock(a))}setTargetBlock(a){a.isShadow()?this.setTargetBlock(a.getParent()):(this.targetBlock=a,$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a))}setStartWorkspace(a){this.startWorkspace_|| +(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&!this.hasExceededDragRadius}isCommentClick(){return!!this.startComment&&!this.hasExceededDragRadius}isBlockClick(){return!!this.startBlock&&!this.hasExceededDragRadius&&!this.isFieldClick()&&!this.isIconClick()}isFieldClick(){return this.startField?this.startField.isClickable()&&!this.hasExceededDragRadius&&(!this.flyout||this.startField.isClickableInFlyout(this.flyout.autoClose)):!1}isIconClick(){if(!this.startIcon)return!1; +const a=!this.flyout||!this.startIcon.isClickableInFlyout||this.startIcon.isClickableInFlyout(this.flyout.autoClose);return!this.hasExceededDragRadius&&a}isWorkspaceClick(){return!this.startBlock&&!this.startBubble&&!this.startField&&!this.hasExceededDragRadius}getCurrentDragger(){let a,b;return(b=(a=this.workspaceDragger)!=null?a:this.dragger)!=null?b:null}isDragging(){return this.dragging}hasStarted(){return this.gestureHasStarted}static inProgress(){const a=getAllWorkspaces$$module$build$src$core$common(); +for(let b=0,c;c=a[b];b++)if(c.currentGesture_)return!0;return!1}},module$build$src$core$gesture={};module$build$src$core$gesture.Gesture=Gesture$$module$build$src$core$gesture;var Grid$$module$build$src$core$grid=class{constructor(a,b){this.pattern=a;this.scale=1;let c;this.spacing=(c=b.spacing)!=null?c:0;let d;this.length=(d=b.length)!=null?d:1;this.line2=(this.line1=a.firstChild)&&this.line1.nextSibling;let e;this.snapToGrid=(e=b.snap)!=null?e:!1}setSpacing(a){this.spacing=a;this.update(this.scale)}getSpacing(){return this.spacing}setLength(a){this.length=a;this.update(this.scale)}getLength(){return this.length}setSnapToGrid(a){this.snapToGrid=a}shouldSnap(){return this.snapToGrid}getPatternId(){return this.pattern.id}update(a){this.scale= +a;var b=this.spacing*a;this.pattern.setAttribute("width",`${b}`);this.pattern.setAttribute("height",`${b}`);b=Math.floor(this.spacing/2)+.5;let c=b-this.length/2,d=b+this.length/2;b*=a;c*=a;d*=a;this.setLineAttributes(this.line1,a,c,d,b,b);this.setLineAttributes(this.line2,a,b,b,c,d)}setLineAttributes(a,b,c,d,e,f){a&&(a.setAttribute("stroke-width",`${b}`),a.setAttribute("x1",`${c}`),a.setAttribute("y1",`${e}`),a.setAttribute("x2",`${d}`),a.setAttribute("y2",`${f}`))}moveTo(a,b){this.pattern.setAttribute("x", +`${a}`);this.pattern.setAttribute("y",`${b}`)}alignXY(a){var b=this.getSpacing();const c=b/2,d=Math.round(Math.round((a.x-c)/b)*b+c);b=Math.round(Math.round((a.y-c)/b)*b+c);return d===a.x&&b===a.y?a:new Coordinate$$module$build$src$core$utils$coordinate(d,b)}static createDom(a,b,c,d){a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATTERN,{id:"blocklyGridPattern"+a,patternUnits:"userSpaceOnUse"},c);let e,f;if(((e=b.length)!=null?e:1)>0&&((f=b.spacing)!=null? +f:0)>0){createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a);let g;(g=b.length)!=null&&g&&createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{stroke:b.colour},a)}else createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.LINE,{},a);d&&d.style.setProperty("--blocklyGridPattern",`url(#${a.id})`);return a}},module$build$src$core$grid={}; +module$build$src$core$grid.Grid=Grid$$module$build$src$core$grid;var module$build$src$core$interfaces$i_autohideable={};module$build$src$core$interfaces$i_autohideable.isAutoHideable=isAutoHideable$$module$build$src$core$interfaces$i_autohideable;var LayerManager$$module$build$src$core$layer_manager=class{constructor(a){this.workspace=a;this.layers=new Map;if(a=a.getInjectionDiv())this.dragLayer=this.createDragLayer(a),this.animationLayer=this.createAnimationLayer(a);a=this.createLayer(BLOCK$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBlockCanvas");a=this.createLayer(BUBBLE$$module$build$src$core$layers);addClass$$module$build$src$core$utils$dom(a,"blocklyBubbleCanvas")}createDragLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG, +{"class":"blocklyBlockDragSurface",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"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}createAnimationLayer(a){const b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.SVG,{"class":"blocklyAnimationLayer",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"});a.append(b);return createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{},b)}appendToAnimationLayer(a){let b;const c=(b=this.dragLayer)==null?void 0:b.getAttribute("transform");if(c){let e;(e=this.animationLayer)==null||e.setAttribute("transform",c)}let d;(d=this.animationLayer)==null||d.appendChild(a.getSvgRoot())}translateLayers(a,b){a= +`translate(${a.x}, ${a.y}) scale(${b})`;let c;(c=this.dragLayer)==null||c.setAttribute("transform",a);for(const [,d]of this.layers)d.setAttribute("transform",a)}moveToDragLayer(a){let b;(b=this.dragLayer)==null||b.appendChild(a.getSvgRoot());a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}moveOffDragLayer(a,b){this.append(a,b);a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}append(a,b){this.layers.has(b)||this.createLayer(b); +a=a.getSvgRoot();let c;if(((c=this.layers.get(b))==null?void 0:c.lastChild)!==a){let d;(d=this.layers.get(b))==null||d.appendChild(a)}}createLayer(a){const b=this.workspace.getSvgGroup(),c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{});let d=!1;const e=[...this.layers].sort((f,g)=>f[0]-g[0]);for(const [f,g]of e)if(a{let c;return b instanceof BlockSvg$$module$build$src$core$block_svg&&!((c=b.outputConnection)==null?0:c.targetBlock())||b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment}, +!0))&&this.setCurNode(a);return a}in(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode(a,()=>!0,!0))&&this.setCurNode(a);return a}prev(){var a=this.getCurNode();if(!a)return null;(a=this.getPreviousNode(a,b=>{let c;return b instanceof BlockSvg$$module$build$src$core$block_svg&&!((c=b.outputConnection)==null?0:c.targetBlock())||b instanceof RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment},!0))&&this.setCurNode(a);return a}out(){var a=this.getCurNode(); +if(!a)return null;(a=this.getPreviousNode(a,()=>!0,!0))&&this.setCurNode(a);return a}atEndOfLine(){var a=this.getCurNode();if(!a)return!1;const b=this.getNextNode(a,()=>!0,!0);a=this.getNextNode(a,c=>{let d;return c instanceof BlockSvg$$module$build$src$core$block_svg&&!((d=c.outputConnection)==null?0:d.targetBlock())},!0);return b===a}getNextNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;let d=this.workspace.getNavigator().getFirstChild(a)||this.workspace.getNavigator().getNextSibling(a);for(var e= +a;e&&!d;){e=this.workspace.getNavigator().getParent(e);if(!e)break;d=this.workspace.getNavigator().getNextSibling(e)}return b(d)?d:d?(c.add(a),this.getNextNodeImpl(d,b,c)):null}getNextNode(a,b,c){return!a||!c&&this.getLastNode()===a?null:this.getNextNodeImpl(a,b)}getPreviousNodeImpl(a,b,c=new Set){if(!a||c.has(a))return null;const d=this.getRightMostChild(this.workspace.getNavigator().getPreviousSibling(a),a)||this.workspace.getNavigator().getParent(a);return b(d)?d:d?(c.add(a),this.getPreviousNodeImpl(d, +b,c)):null}getPreviousNode(a,b,c){return!a||!c&&this.getFirstNode()===a?null:this.getPreviousNodeImpl(a,b)}getRightMostChild(a,b){if(!a)return a;let c=this.workspace.getNavigator().getFirstChild(a);if(!c||c===b)return a;for(a=c;a&&a!==b;a=this.workspace.getNavigator().getNextSibling(c))c=a;return this.getRightMostChild(c,b)}preDelete(a){var b=this.getCurNode();b=b?[b]:[];var c;let d,e;const f=(e=(c=a.previousConnection)==null?void 0:c.targetConnection)!=null?e:(d=a.outputConnection)==null?void 0: +d.targetConnection;f&&b.push(f);(c=a.getNextBlock())&&b.push(c);(a=a.getParent())&&b.push(a);b.push(this.workspace);this.potentialNodes=b}postDelete(){const a=this.potentialNodes;this.potentialNodes=null;if(!a)throw Error("must call preDelete first");for(const b of a){let c;if((c=this.getSourceBlockFromNode(b))==null||!c.disposed){this.setCurNode(b);return}}throw Error("no valid nodes in this.potentialNodes");}getCurNode(){return $.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode()}setCurNode(a){$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}getFirstNode(){return this.workspace.getNavigator().getFirstChild(this.workspace)}getLastNode(){const a= +this.getFirstNode();return this.getPreviousNode(a,()=>!0,!0)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,DEFAULT$$module$build$src$core$registry,LineCursor$$module$build$src$core$keyboard_nav$line_cursor);var module$build$src$core$keyboard_nav$line_cursor={};module$build$src$core$keyboard_nav$line_cursor.LineCursor=LineCursor$$module$build$src$core$keyboard_nav$line_cursor;var MarkerManager$$module$build$src$core$marker_manager=class{constructor(a){this.workspace=a;this.markers=new Map;this.cursor=new LineCursor$$module$build$src$core$keyboard_nav$line_cursor(this.workspace)}registerMarker(a,b){this.markers.has(a)&&this.unregisterMarker(a);this.markers.set(a,b)}unregisterMarker(a){const b=this.markers.get(a);if(b)b.dispose(),this.markers.delete(a);else throw Error("Marker with ID "+a+" does not exist. Can only unregister markers that exist.");}getCursor(){return this.cursor}getMarker(a){return this.markers.get(a)|| +null}setCursor(a){this.cursor=a}dispose(){const a=Object.keys(this.markers);for(let b=0,c;c=a[b];b++)this.unregisterMarker(c);this.markers.clear();this.cursor.dispose()}};MarkerManager$$module$build$src$core$marker_manager.LOCAL_MARKER="local_marker_1";var module$build$src$core$marker_manager={};module$build$src$core$marker_manager.MarkerManager=MarkerManager$$module$build$src$core$marker_manager;var module$build$src$core$icons={};module$build$src$core$icons.CommentIcon=CommentIcon$$module$build$src$core$icons$comment_icon;module$build$src$core$icons.Icon=Icon$$module$build$src$core$icons$icon;module$build$src$core$icons.IconType=IconType$$module$build$src$core$icons$icon_types;module$build$src$core$icons.MutatorIcon=$.MutatorIcon$$module$build$src$core$icons$mutator_icon;module$build$src$core$icons.WarningIcon=WarningIcon$$module$build$src$core$icons$warning_icon; +module$build$src$core$icons.exceptions=module$build$src$core$icons$exceptions;module$build$src$core$icons.registry=module$build$src$core$icons$registry;var module$build$src$core$interfaces$i_procedure_block={};module$build$src$core$interfaces$i_procedure_block.isProcedureBlock=isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block;$.Names$$module$build$src$core$names=class{constructor(a,b){this.db=new Map;this.dbReverse=new Set;this.variableMap=null;this.variablePrefix=b||"";this.reservedWords=new Set(a?a.split(","):[])}reset(){this.db.clear();this.dbReverse.clear();this.variableMap=null}setVariableMap(a){this.variableMap=a}getNameForUserVariable(a){return this.variableMap?(a=this.variableMap.getVariableById(a))?a.getName():null:(console.warn("Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:\nBlockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());"), +null)}populateVariables(a){a=$.allUsedVarModels$$module$build$src$core$variables(a);for(let b=0;b=1}isHat(a){return(a.type&this.HAT)>=1}isIcon(a){return(a.type& +this.ICON)>=1}isSpacer(a){return(a.type&this.SPACER)>=1}isInRowSpacer(a){return(a.type&this.IN_ROW_SPACER)>=1}isSpacerRow(a){return(a.type&this.BETWEEN_ROW_SPACER)>=1}isInput(a){return(a.type&this.INPUT)>=1}isExternalInput(a){return(a.type&this.EXTERNAL_VALUE_INPUT)>=1}isInlineInput(a){return(a.type&this.INLINE_INPUT)>=1}isStatementInput(a){return(a.type&this.STATEMENT_INPUT)>=1}isPreviousConnection(a){return(a.type&this.PREVIOUS_CONNECTION)>=1}isNextConnection(a){return(a.type&this.NEXT_CONNECTION)>= +1}isPreviousOrNextConnection(a){return this.isPreviousConnection(a)||this.isNextConnection(a)}isRoundCorner(a){return(a.type&this.LEFT_ROUND_CORNER)>=1||(a.type&this.RIGHT_ROUND_CORNER)>=1}isLeftRoundedCorner(a){return this.isRoundCorner(a)&&(a.type&this.LEFT_ROUND_CORNER)>=1}isRightRoundedCorner(a){return this.isRoundCorner(a)&&(a.type&this.RIGHT_ROUND_CORNER)>=1}isLeftSquareCorner(a){return(a.type&this.LEFT_SQUARE_CORNER)>=1}isRightSquareCorner(a){return(a.type&this.RIGHT_SQUARE_CORNER)>=1}isCorner(a){return(a.type& +this.CORNER)>=1}isJaggedEdge(a){return(a.type&this.JAGGED_EDGE)>=1}isRow(a){return(a.type&this.ROW)>=1}isBetweenRowSpacer(a){return(a.type&this.BETWEEN_ROW_SPACER)>=1}isTopRow(a){return(a.type&this.TOP_ROW)>=1}isBottomRow(a){return(a.type&this.BOTTOM_ROW)>=1}isTopOrBottomRow(a){return this.isTopRow(a)||this.isBottomRow(a)}isInputRow(a){return(a.type&this.INPUT_ROW)>=1}},Types$$module$build$src$core$renderers$measurables$types=new TypesContainer$$module$build$src$core$renderers$measurables$types,module$build$src$core$renderers$measurables$types= +{Types:Types$$module$build$src$core$renderers$measurables$types};var Measurable$$module$build$src$core$renderers$measurables$base=class{constructor(a){this.centerline=this.xPos=this.height=this.width=0;this.constants_=a;this.type=Types$$module$build$src$core$renderers$measurables$types.NONE;this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}},module$build$src$core$renderers$measurables$base={};module$build$src$core$renderers$measurables$base.Measurable=Measurable$$module$build$src$core$renderers$measurables$base;var Row$$module$build$src$core$renderers$measurables$row=class{constructor(a){this.elements=[];this.xPos=this.yPos=this.widthWithConnectedBlocks=this.minWidth=this.minHeight=this.width=this.height=0;this.hasStatement=this.hasExternalInput=!1;this.statementEdge=0;this.hasJaggedEdge=this.hasDummyInput=this.hasInlineInput=!1;this.align=null;this.constants_=a;this.type=Types$$module$build$src$core$renderers$measurables$types.ROW;this.notchOffset=this.constants_.NOTCH_OFFSET_LEFT}getLastInput(){for(let a= +this.elements.length-1;a>=0;a--){const b=this.elements[a];if(Types$$module$build$src$core$renderers$measurables$types.isInput(b))return b}return null}measure(){throw Error("Unexpected attempt to measure a base Row.");}startsWithElemSpacer(){return!0}endsWithElemSpacer(){return!0}getFirstSpacer(){for(let a=0;a=0;a--){const b=this.elements[a];if(Types$$module$build$src$core$renderers$measurables$types.isInRowSpacer(b))return b}return null}},module$build$src$core$renderers$measurables$row={};module$build$src$core$renderers$measurables$row.Row=Row$$module$build$src$core$renderers$measurables$row;var BottomRow$$module$build$src$core$renderers$measurables$bottom_row=class extends Row$$module$build$src$core$renderers$measurables$row{constructor(a){super(a);this.hasNextConnection=!1;this.connection=null;this.baseline=this.descenderHeight=0;this.type|=Types$$module$build$src$core$renderers$measurables$types.BOTTOM_ROW}hasLeftSquareCorner(a){return!!a.outputConnection||!!a.getNextBlock()}hasRightSquareCorner(a){return!0}measure(){let a=0,b=0,c=0;for(let d=0;drect,`,`${a} .blocklyEditableField>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text {`, +"fill: #000;","}",`${a} .blocklyFlyoutLabelText {`,"fill: #000;","}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #000;","}",`${a} .blocklyEditableField:not(.blocklyEditing):hover>rect {`,"stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"}",`${a} .blocklySelected>.blocklyPath {`,"stroke: #fc3;","stroke-width: 3px;","}",`${a} .blocklyHighlightedConnectionPath {`,"stroke: #fc3;","}",`${a} .blocklyReplaceable .blocklyPath {`, +"fill-opacity: .5;","}",`${a} .blocklyReplaceable .blocklyPathLight,`,`${a} .blocklyReplaceable .blocklyPathDark {`,"display: none;","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;","}"]}},module$build$src$core$renderers$common$constants={};module$build$src$core$renderers$common$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$common$constants; +module$build$src$core$renderers$common$constants.isDynamicShape=isDynamicShape$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isNotch=isNotch$$module$build$src$core$renderers$common$constants;module$build$src$core$renderers$common$constants.isPuzzleTab=isPuzzleTab$$module$build$src$core$renderers$common$constants;var Drawer$$module$build$src$core$renderers$common$drawer=class{constructor(a,b){this.inlinePath_=this.outlinePath_="";this.block_=a;this.info_=b;this.topLeft_=a.getRelativeToSurfaceXY();this.constants_=b.getRenderer().getConstants()}draw(){this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();this.block_.pathObject.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&this.block_.pathObject.flipRTL();this.recordSizeOnBlock_()}recordSizeOnBlock_(){this.block_.height= +this.info_.height;this.block_.width=this.info_.widthWithChildren;this.block_.childlessWidth=this.info_.width}drawOutline_(){this.drawTop_();for(let a=1;a0&&this.addAlignmentPadding_(c,a);Types$$module$build$src$core$renderers$measurables$types.isTopOrBottomRow(c)&&(c.widthWithConnectedBlocks=c.width)}}getDesiredRowWidth_(a){return this.width-this.startX}addAlignmentPadding_(a, +b){const c=a.getFirstSpacer(),d=a.getLastSpacer();if(a.hasExternalInput||a.hasStatement)a.widthWithConnectedBlocks+=b;if(a.align===$.Align$$module$build$src$core$inputs$align.LEFT&&d)d.width+=b;else if(a.align===$.Align$$module$build$src$core$inputs$align.CENTRE&&c&&d)c.width+=b/2,d.width+=b/2;else if(a.align===$.Align$$module$build$src$core$inputs$align.RIGHT&&c)c.width+=b;else if(d)d.width+=b;else return;a.width+=b}alignStatementRow_(a){const b=a.getLastInput();if(b){var c=a.width-b.width,d=this.statementEdge; +c=d-c;c>0&&this.addAlignmentPadding_(a,c);c=a.width;d=this.getDesiredRowWidth_(a);b.width+=d-c;b.height=Math.max(b.height,a.height);a.width+=d-c;a.widthWithConnectedBlocks=Math.max(a.width,this.statementEdge+a.connectedBlockWidths)}}addRowSpacing_(){const a=this.rows;this.rows=[];for(let b=0;b=0;d--)c[d].element===a&&c.splice(d,1);c.length||this.componentDB.delete(b)}}dispose(){this.subscribedWorkspaces.length=0;this.componentDB.clear()}},module$build$src$core$theme_manager={};module$build$src$core$theme_manager.ThemeManager=ThemeManager$$module$build$src$core$theme_manager;var CATEGORY_NAME$$module$build$src$core$variables_dynamic="VARIABLE_DYNAMIC",onCreateVariableButtonClick_String$$module$build$src$core$variables_dynamic=stringButtonClickHandler$$module$build$src$core$variables_dynamic,onCreateVariableButtonClick_Number$$module$build$src$core$variables_dynamic=numberButtonClickHandler$$module$build$src$core$variables_dynamic,onCreateVariableButtonClick_Colour$$module$build$src$core$variables_dynamic=colourButtonClickHandler$$module$build$src$core$variables_dynamic, +module$build$src$core$variables_dynamic={CATEGORY_NAME:CATEGORY_NAME$$module$build$src$core$variables_dynamic};module$build$src$core$variables_dynamic.flyoutCategory=flyoutCategory$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.flyoutCategoryBlocks=flyoutCategoryBlocks$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.internalFlyoutCategory=internalFlyoutCategory$$module$build$src$core$variables_dynamic; +module$build$src$core$variables_dynamic.onCreateVariableButtonClick_Colour=colourButtonClickHandler$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.onCreateVariableButtonClick_Number=numberButtonClickHandler$$module$build$src$core$variables_dynamic;module$build$src$core$variables_dynamic.onCreateVariableButtonClick_String=stringButtonClickHandler$$module$build$src$core$variables_dynamic;var ConnectionChecker$$module$build$src$core$connection_checker=class{canConnect(a,b,c,d){return this.canConnectWithReason(a,b,c,d)===Connection$$module$build$src$core$connection.CAN_CONNECT}canConnectWithReason(a,b,c,d){const e=this.doSafetyChecks(a,b);return e!==Connection$$module$build$src$core$connection.CAN_CONNECT?e:this.doTypeChecks(a,b)?c&&!this.doDragChecks(a,b,d||0)?Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED:Connection$$module$build$src$core$connection.CAN_CONNECT: +Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED}getErrorMessage(a,b,c){switch(a){case Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION:return"Attempted to connect a block to itself.";case Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES:return"Blocks not on same workspace.";case Connection$$module$build$src$core$connection.REASON_WRONG_TYPE:return"Attempt to connect incompatible types.";case Connection$$module$build$src$core$connection.REASON_TARGET_NULL:return"Target connection is null."; +case Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED:return"Connection checks failed. "+(b+" expected "+b.getCheck()+", found "+c.getCheck());case Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT:return"Connecting non-shadow to shadow block.";case Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED:return"Drag checks failed.";case Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT:return"Block would have an output and a previous connection."; +default:return"Unknown connection failure: this should never happen!"}}doSafetyChecks(a,b){if(!a||!b)return Connection$$module$build$src$core$connection.REASON_TARGET_NULL;let c,d,e;a.isSuperior()?(c=a.getSourceBlock(),d=b.getSourceBlock(),e=b):(d=a.getSourceBlock(),c=b.getSourceBlock(),e=a,a=b);return c===d?Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION:e.type!==OPPOSITE_TYPE$$module$build$src$core$internal_constants[a.type]?Connection$$module$build$src$core$connection.REASON_WRONG_TYPE: +c.workspace!==d.workspace?Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES:c.isShadow()&&!d.isShadow()?Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT:e.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE&&d.previousConnection&&d.previousConnection.isConnected()||e.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT&&d.outputConnection&&d.outputConnection.isConnected()?Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT: +Connection$$module$build$src$core$connection.CAN_CONNECT}doTypeChecks(a,b){a=a.getCheck();b=b.getCheck();if(!a||!b)return!0;for(let c=0;cc||b.getSourceBlock().isInsertionMarker())return!1;switch(b.type){case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:return this.canConnectToPrevious_(a,b);case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:if(b.isConnected()&& +!b.targetBlock().isInsertionMarker()||a.isConnected())return!1;break;case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:if(b.isConnected()&&!b.targetBlock().isMovable()&&!b.targetBlock().isShadow())return!1;break;case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:if(b.isConnected()&&!a.getSourceBlock().nextConnection&&!b.targetBlock().isShadow()&&b.targetBlock().nextConnection||b.targetBlock()&&!b.targetBlock().isMovable()&&!b.targetBlock().isShadow())return!1; +break;default:return!1}return draggingConnections$$module$build$src$core$common.includes(b)?!1:!0}canConnectToPrevious_(a,b){if(a.targetConnection||draggingConnections$$module$build$src$core$common.includes(b))return!1;if(!b.targetConnection)return!0;a=b.targetBlock();return a.isInsertionMarker()?!a.getPreviousBlock():!1}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_CHECKER,DEFAULT$$module$build$src$core$registry,ConnectionChecker$$module$build$src$core$connection_checker); +var module$build$src$core$connection_checker={};module$build$src$core$connection_checker.ConnectionChecker=ConnectionChecker$$module$build$src$core$connection_checker;var Workspace$$module$build$src$core$workspace=class{get isFlyout(){return this.internalIsFlyout}get isMutator(){return this.internalIsMutator}constructor(a){this.isClearing=this.internalIsMutator=this.internalIsFlyout=this.rendered=!1;this.MAX_UNDO=1024;this.connectionDBList=[];this.topBlocks=[];this.topComments=[];this.commentDB=new Map;this.listeners=[];this.undoStack_=[];this.redoStack_=[];this.blockDB=new Map;this.typedBlocksDB=new Map;this.procedureMap=new ObservableProcedureMap$$module$build$src$core$observable_procedure_map; +this.readOnly=!1;this.potentialVariableMap=null;this.id=genUid$$module$build$src$core$utils$idgenerator();registerWorkspace$$module$build$src$core$common(this);this.options=a||new Options$$module$build$src$core$options({});this.RTL=!!this.options.RTL;this.horizontalLayout=!!this.options.horizontalLayout;this.toolboxPosition=this.options.toolboxPosition;this.connectionChecker=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CONNECTION_CHECKER,this.options, +!0))(this);this.variableMap=new (this.getVariableMapClass())(this);this.setIsReadOnly(this.options.readOnly)}dispose(){this.listeners.length=0;this.clear();unregisterWorkpace$$module$build$src$core$common(this)}sortObjects(a,b){const c=d=>({getBoundingRectangle:()=>{const e=d.getRelativeToSurfaceXY();return new Rect$$module$build$src$core$utils$rect(e.y,e.y,e.x,e.x)},moveBy:()=>{}});return this.sortByOrigin(c(a),c(b))}sortByOrigin(a,b){const c=Math.sin(toRadians$$module$build$src$core$utils$math(Workspace$$module$build$src$core$workspace.SCAN_ANGLE))* +(this.RTL?-1:1);a=a.getBoundingRectangle().getOrigin();b=b.getBoundingRectangle().getOrigin();return a.y+c*a.x-(b.y+c*b.x)}addTopBlock(a){this.topBlocks.push(a)}removeTopBlock(a){if(!removeElem$$module$build$src$core$utils$array(this.topBlocks,a))throw Error("Block not present in workspace's list of top-most blocks.");}getTopBlocks(a=!1){const b=[].concat(this.topBlocks);a&&b.length>1&&b.sort(this.sortObjects.bind(this));return b}addTypedBlock(a){this.typedBlocksDB.has(a.type)||this.typedBlocksDB.set(a.type, +[]);this.typedBlocksDB.get(a.type).push(a)}removeTypedBlock(a){removeElem$$module$build$src$core$utils$array(this.typedBlocksDB.get(a.type),a);this.typedBlocksDB.get(a.type).length||this.typedBlocksDB.delete(a.type)}getBlocksByType(a,b=!1){if(!this.typedBlocksDB.has(a))return[];a=this.typedBlocksDB.get(a).slice(0);b&&a&&a.length>1&&a.sort(this.sortObjects.bind(this));return a.filter(c=>!c.isInsertionMarker())}addTopComment(a){this.topComments.push(a);this.commentDB.has(a.id)&&console.warn('Overriding an existing comment on this workspace, with id "'+ +a.id+'"');this.commentDB.set(a.id,a)}removeTopComment(a){if(!removeElem$$module$build$src$core$utils$array(this.topComments,a))throw Error("Comment not present in workspace's list of top-most comments.");this.commentDB.delete(a.id)}getTopComments(a=!1){const b=[].concat(this.topComments);a&&b.length>1&&b.sort(this.sortObjects.bind(this));return b}getAllBlocks(a=!1){if(a){var b=this.getTopBlocks(!0);a=[];for(let c=0;c!c.isInsertionMarker())}clear(){this.isClearing=!0;try{const a=$.getGroup$$module$build$src$core$events$utils();for(a||$.setGroup$$module$build$src$core$events$utils(!0);this.topBlocks.length;)this.topBlocks[0].dispose(!1);for(;this.topComments.length;)this.topComments[this.topComments.length-1].dispose();$.setGroup$$module$build$src$core$events$utils(a);this.isFlyout||this.variableMap.clear();this.potentialVariableMap&&this.potentialVariableMap.clear()}finally{this.isClearing= +!1}}renameVariableById(a,b){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.renameVariableById","v12","v13","Blockly.Workspace.getVariableMap().renameVariable");(a=this.variableMap.getVariableById(a))&&this.variableMap.renameVariable(a,b)}createVariable(a,b,c){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.createVariable","v12","v13","Blockly.Workspace.getVariableMap().createVariable");return this.variableMap.createVariable(a,b!=null?b:void 0,c!=null?c:void 0)}getVariableUsesById(a){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariableUsesById", +"v12","v13","Blockly.Variables.getVariableUsesById");return getVariableUsesById$$module$build$src$core$variables(this,a)}deleteVariableById(a){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.deleteVariableById","v12","v13","Blockly.Workspace.getVariableMap().deleteVariable");const b=this.variableMap.getVariableById(a);b?$.deleteVariable$$module$build$src$core$variables(this,b):console.warn(`Can't delete non-existent variable: ${a}`)}getVariable(a,b){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariable", +"v12","v13","Blockly.Workspace.getVariableMap().getVariable");return this.variableMap.getVariable(a,b)}getVariableById(a){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariableById","v12","v13","Blockly.Workspace.getVariableMap().getVariableById");return this.variableMap.getVariableById(a)}getVariablesOfType(a){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getVariablesOfType","v12","v13","Blockly.Workspace.getVariableMap().getVariablesOfType");return this.variableMap.getVariablesOfType(a!= +null?a:"")}getAllVariables(){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getAllVariables","v12","v13","Blockly.Workspace.getVariableMap().getAllVariables");return this.variableMap.getAllVariables()}getAllVariableNames(){warn$$module$build$src$core$utils$deprecation("Blockly.Workspace.getAllVariableNames","v12","v13","Blockly.Workspace.getVariableMap().getAllVariables");return this.variableMap.getAllVariables().map(a=>a.getName())}getWidth(){return 0}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts"); +}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}remainingCapacity(){return isNaN(this.options.maxBlocks)?Infinity:this.options.maxBlocks-this.getAllBlocks(!1).length}remainingCapacityOfType(a){return this.options.maxInstances?(this.options.maxInstances[a]!==void 0?this.options.maxInstances[a]:Infinity)-this.getBlocksByType(a,!1).length:Infinity}isCapacityAvailable(a){if(!this.hasBlockLimits())return!0;let b=0;for(const c in a){if(a[c]>this.remainingCapacityOfType(c))return!1; +b+=a[c]}return b>this.remainingCapacity()?!1:!0}hasBlockLimits(){return this.options.maxBlocks!==Infinity||!!this.options.maxInstances}getUndoStack(){return this.undoStack_}getRedoStack(){return this.redoStack_}undo(a){var b=a?this.redoStack_:this.undoStack_,c=a?this.undoStack_:this.redoStack_;const d=b.pop();if(d){for(var e=[d];b.length&&d.group&&d.group===b[b.length-1].group;){const f=b.pop();f&&e.push(f)}for(b=0;bthis.MAX_UNDO&&this.MAX_UNDO>= +0;)this.undoStack_.shift();for(let b=0;b!!b.getStyleName()));this.refreshToolboxSelection();this.toolbox&&this.toolbox.refreshTheme();this.isVisible()&&this.setVisible(!0);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.THEME_CHANGE))(this.getTheme().name,this.id);fire$$module$build$src$core$events$utils(a)}updateBlockStyles(a){for(let b=0,c;c=a[b];b++){const d= +c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCTMDirty){const a=this.getParentSvg().getScreenCTM();a&&(this.inverseScreenCTM=a.inverse(),this.inverseScreenCTMDirty=!1)}return this.inverseScreenCTM}updateInverseScreenCTM(){this.inverseScreenCTMDirty=!0}isVisible(){return this.visible}getSvgXY(a){let b=0,c=0,d=1;if(this.getCanvas().contains(a)||this.getBubbleCanvas().contains(a))d=this.scale;do{const e=getRelativeXY$$module$build$src$core$utils$svg_math(a);if(a===this.getCanvas()|| +a===this.getBubbleCanvas())d=1;b+=e.x*d;c+=e.y*d;a=a.parentNode}while(a&&a!==this.getParentSvg()&&a!==this.getInjectionDiv());return new Coordinate$$module$build$src$core$utils$coordinate(b,c)}getCachedParentSvgSize(){const a=this.cachedParentSvgSize;return new Size$$module$build$src$core$utils$size(a.width,a.height)}getOriginOffsetInPixels(){return getInjectionDivXY$$module$build$src$core$utils$svg_math(this.getCanvas())}getInjectionDiv(){if(!this.injectionDiv){let a=this.svgGroup_;for(;a;){if((" "+ +(a.getAttribute("class")||"")+" ").includes(" injectionDiv ")){this.injectionDiv=a;break}a=a.parentNode}}return this.injectionDiv}getSvgGroup(){return this.svgGroup_}getBlockCanvas(){return this.getCanvas()}setResizeHandlerWrapper(a){this.resizeHandlerWrapper=a}createDom(a,b){this.injectionDiv||(this.injectionDiv=b!=null?b:null);this.svgGroup_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyWorkspace",id:this.id});b&&setState$$module$build$src$core$utils$aria(this.svgGroup_, +State$$module$build$src$core$utils$aria.LABEL,$.Msg$$module$build$src$core$msg.WORKSPACE_ARIA_LABEL);a&&(this.svgBackground_=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{height:"100%",width:"100%","class":a},this.svgGroup_),a==="blocklyMainBackground"&&this.grid?this.svgBackground_.style.fill="var(--blocklyGridPattern)":this.themeManager_.subscribe(this.svgBackground_,"workspaceBackgroundColour","fill"));this.layerManager=new LayerManager$$module$build$src$core$layer_manager(this); +this.svgBlockCanvas_=this.layerManager.getBlockLayer();this.svgBubbleCanvas_=this.layerManager.getBubbleLayer();this.isFlyout||(conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"pointerdown",this,this.onMouseDown,!1),this.dummyWheelListener=()=>{},document.body.addEventListener("wheel",this.dummyWheelListener),conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"wheel",this,this.onMouseWheel));this.options.hasCategories&&(this.toolbox=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX, +this.options,!0))(this));this.grid&&this.grid.update(this.scale);this.recordDragTargets();(a=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.CURSOR,this.options))&&this.markerManager.setCursor(new a(this));a=this.options.parentWorkspace===null;this.renderer.createDom(this.svgGroup_,this.getTheme(),a?this.getInjectionDiv():void 0);$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!!this.injectionDiv||this.isFlyout);return this.svgGroup_}dispose(){this.rendered= +!1;this.currentGesture_&&this.currentGesture_.cancel();this.svgGroup_&&removeNode$$module$build$src$core$utils$dom(this.svgGroup_);this.toolbox&&(this.toolbox.dispose(),this.toolbox=null);this.flyout&&(this.flyout.dispose(),this.flyout=null);this.trashcan&&(this.trashcan.dispose(),this.trashcan=null);this.scrollbar&&(this.scrollbar.dispose(),this.scrollbar=null);this.zoomControls_&&this.zoomControls_.dispose();this.audioManager&&this.audioManager.dispose();this.grid&&(this.grid=null);this.renderer.dispose(); +this.markerManager.dispose();super.dispose();this.themeManager_&&(this.themeManager_.unsubscribeWorkspace(this),this.themeManager_.unsubscribe(this.svgBackground_),this.options.parentWorkspace||this.themeManager_.dispose());this.connectionDBList.length=0;this.toolboxCategoryCallbacks.clear();this.flyoutButtonCallbacks.clear();if(!this.options.parentWorkspace){const a=this.getParentSvg();a&&a.parentNode&&removeNode$$module$build$src$core$utils$dom(a.parentNode)}this.resizeHandlerWrapper&&(unbind$$module$build$src$core$browser_events(this.resizeHandlerWrapper), +this.resizeHandlerWrapper=null);this.dummyWheelListener&&(document.body.removeEventListener("wheel",this.dummyWheelListener),this.dummyWheelListener=null);$.getFocusManager$$module$build$src$core$focus_manager().isRegistered(this)&&$.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}addTrashcan(){this.trashcan=WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan(this);const a=this.trashcan.createDom();this.svgGroup_.insertBefore(a,this.getCanvas())}static newTrashcan(a){throw Error("The implementation of newTrashcan should be monkey-patched in by blockly.ts"); +}addZoomControls(){this.zoomControls_=new ZoomControls$$module$build$src$core$zoom_controls(this);const a=this.zoomControls_.createDom();this.svgGroup_.appendChild(a)}copyOptionsForFlyout(){return new Options$$module$build$src$core$options({parentWorkspace:this,rtl:this.RTL,oneBasedIndex:this.options.oneBasedIndex,horizontalLayout:this.horizontalLayout,renderer:this.options.renderer,rendererOverrides:this.options.rendererOverrides,plugins:this.options.plugins,modalInputs:this.options.modalInputs, +move:{scrollbars:!0}})}addFlyout(a){const b=this.copyOptionsForFlyout();b.toolboxPosition=this.options.toolboxPosition;this.flyout=this.horizontalLayout?new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,this.options,!0))(b):new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.options,!0))(b);this.flyout.autoClose=!1;this.flyout.getWorkspace().setVisible(!0); +return this.flyout.createDom(a)}getFlyout(a){return this.flyout||a?this.flyout:this.toolbox?this.toolbox.getFlyout():null}getToolbox(){return this.toolbox}updateScreenCalculations(){this.updateInverseScreenCTM();this.recordDragTargets()}resizeContents(){this.resizesEnabled&&this.rendered&&(this.scrollbar&&this.scrollbar.resize(),this.updateInverseScreenCTM())}resize(){this.toolbox?this.toolbox.position():this.flyout&&this.flyout.position();const a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE, +!0),b=this.getMetricsManager().getUiMetrics(),c=[];for(let d=0,e;e=a[d];d++){e.position(b,c);const f=e.getBoundingRectangle();f&&c.push(f)}this.scrollbar&&this.scrollbar.resize();this.updateScreenCalculations()}updateScreenCalculationsIfScrolled(){const a=getDocumentScroll$$module$build$src$core$utils$svg_math();Coordinate$$module$build$src$core$utils$coordinate.equals(this.lastRecordedPageScroll,a)||(this.lastRecordedPageScroll=a,this.updateScreenCalculations())}getLayerManager(){return this.layerManager}getCanvas(){return this.layerManager.getBlockLayer()}setCachedParentSvgSize(a, +b){const c=this.getParentSvg();a!=null&&(this.cachedParentSvgSize.width=a,c.setAttribute("data-cached-width",`${a}`));b!=null&&(this.cachedParentSvgSize.height=b,c.setAttribute("data-cached-height",`${b}`))}getBubbleCanvas(){return this.layerManager.getBubbleLayer()}getParentSvg(){if(!this.cachedParentSvg){let a=this.svgGroup_;for(;a;){if(a.tagName==="svg"){this.cachedParentSvg=a;break}a=a.parentNode}}return this.cachedParentSvg}maybeFireViewportChangeEvent(){if(isEnabled$$module$build$src$core$events$utils()){var a= +this.scale,b=-this.scrollY,c=-this.scrollX;if(!(a===this.oldScale&&Math.abs(b-this.oldTop)<1&&Math.abs(c-this.oldLeft)<1)){var d=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VIEWPORT_CHANGE))(b,c,a,this.id,this.oldScale);this.oldScale=a;this.oldTop=b;this.oldLeft=c;fire$$module$build$src$core$events$utils(d)}}}translate(a,b){let c;(c=this.layerManager)==null||c.translateLayers(new Coordinate$$module$build$src$core$utils$coordinate(a,b),this.scale);let d; +(d=this.grid)==null||d.moveTo(a,b);this.maybeFireViewportChangeEvent()}getWidth(){const a=this.getMetrics();return a?a.viewWidth/this.scale:0}setVisible(a){this.visible=a;this.svgGroup_&&(this.scrollbar&&this.scrollbar.setContainerVisible(a),this.getFlyout()&&this.getFlyout().setContainerVisible(a),this.getParentSvg().style.display=a?"block":"none",this.toolbox&&this.toolbox.setVisible(a),a||this.hideChaff(!0))}render(){const a=this.getAllBlocks(!1);for(let b=a.length-1;b>=0;b--)a[b].queueRender(); +this.getTopBlocks().flatMap(b=>b.getDescendants(!1)).filter(b=>b.isInsertionMarker()).forEach(b=>b.queueRender())}highlightBlock(a,b){if(b===void 0){for(let c=0,d;d=this.highlightedBlocks[c];c++)d.setHighlighted(!1);this.highlightedBlocks.length=0}if(a=a?this.getBlockById(a):null)(b=b===void 0||b)?this.highlightedBlocks.includes(a)||this.highlightedBlocks.push(a):removeElem$$module$build$src$core$utils$array(this.highlightedBlocks,a),a.setHighlighted(b)}variableChangeCallback(a){switch(a.type){case EventType$$module$build$src$core$events$type.VAR_CREATE:case EventType$$module$build$src$core$events$type.VAR_DELETE:case EventType$$module$build$src$core$events$type.VAR_RENAME:case EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE:this.refreshToolboxSelection()}}refreshToolboxSelection(){const a= +this.isFlyout?this.targetWorkspace:this;a&&!a.currentGesture_&&a.toolbox&&a.toolbox.getFlyout()&&a.toolbox.refreshSelection()}recordDragTargets(){const a=this.componentManager.getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET,!0);this.dragTargetAreas=[];for(let b=0,c;c=a[b];b++){const d=c.getClientRect();d&&this.dragTargetAreas.push({component:c,clientRect:d})}}newBlock(a,b){throw Error("The implementation of newBlock should be monkey-patched in by blockly.ts"); +}newComment(a){throw Error("The implementation of newComment should be monkey-patched in by blockly.ts");}getDragTarget(a){for(let b=0,c;c=this.dragTargetAreas[b];b++)if(c.clientRect.contains(a.clientX,a.clientY))return c.component;return null}onMouseDown(a){const b=this.getGesture(a);b&&b.handleWsStart(a,this)}startDrag(a,b){start$$module$build$src$core$utils$drag(this,a,b)}moveDrag(a){return move$$module$build$src$core$utils$drag(this,a)}setKeyboardMoveInProgress(a){this.keyboardMoveInProgress= +a}isDragging(){return this.keyboardMoveInProgress||this.currentGesture_!==null&&this.currentGesture_.isDragging()}isDraggable(){return this.options.moveOptions&&this.options.moveOptions.drag}isMovable(){return this.options.moveOptions&&!!this.options.moveOptions.scrollbars||this.options.moveOptions&&this.options.moveOptions.wheel||this.options.moveOptions&&this.options.moveOptions.drag||this.options.zoomOptions&&this.options.zoomOptions.wheel||this.options.zoomOptions&&this.options.zoomOptions.pinch}isMovableHorizontally(){const a= +!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollHorizontally())}isMovableVertically(){const a=!!this.scrollbar;return this.isMovable()&&(!a||a&&this.scrollbar.canScrollVertically())}onMouseWheel(a){if(Gesture$$module$build$src$core$gesture.inProgress())a.preventDefault(),a.stopPropagation();else{var b=this.options.zoomOptions&&this.options.zoomOptions.wheel,c=this.options.moveOptions&&this.options.moveOptions.wheel;if(b||c){var d=getScrollDeltaPixels$$module$build$src$core$browser_events(a); +if(MAC$$module$build$src$core$utils$useragent)var e=a.metaKey;b&&(a.ctrlKey||e||!c)?(d=-d.y/50,b=mouseToSvg$$module$build$src$core$browser_events(a,this.getParentSvg(),this.getInverseScreenCTM()),this.zoom(b.x,b.y,d)):(b=this.scrollX-d.x,c=this.scrollY-d.y,a.shiftKey&&!d.x&&(b=this.scrollX-d.y,c=this.scrollY),this.scroll(b,c));a.preventDefault()}}}getBlocksBoundingBox(){const a=this.getTopBoundedElements();if(!a.length)return new Rect$$module$build$src$core$utils$rect(0,0,0,0);const b=a[0].getBoundingRectangle(); +for(let d=1;db.bottom&&(b.bottom=c.bottom),c.leftb.right&&(b.right=c.right))}return b}cleanUp(){this.setResizesEnabled(!1);const a=$.getGroup$$module$build$src$core$events$utils();a||$.setGroup$$module$build$src$core$events$utils(!0);var b=this.getTopBlocks(!0),c=b.filter(g=>g.isMovable());const d=b.filter(g=>!g.isMovable()).map(g=> +g.getBoundingRectangle());b=function(g){for(const h of d)if(g.intersects(h))return h;return null};var e=0;const f=this.renderer.getConstants().MIN_BLOCK_HEIGHT;for(const g of c){c=g.getBoundingRectangle();g.moveBy(-c.left,e-c.top,["cleanup"]);g.snapToGrid();c=g.getBoundingRectangle();for(e=b(c);e!=null;)e=e.top+e.getHeight()+f,g.moveBy(0,e-c.top,["cleanup"]),g.snapToGrid(),c=g.getBoundingRectangle(),e=b(c);e=g.getRelativeToSurfaceXY().y+g.getHeightWidth().height+f}$.setGroup$$module$build$src$core$events$utils(a); +this.setResizesEnabled(!0)}showContextMenu(a){if(!this.isReadOnly()&&!this.isFlyout){var b=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.registry.getContextMenuOptions({workspace:this,focusedNode:this},a);this.configureContextMenu&&this.configureContextMenu(b,a);var c=a instanceof PointerEvent?new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY):wsToScreenCoordinates$$module$build$src$core$utils$svg_math(this,new Coordinate$$module$build$src$core$utils$coordinate(5, +5));show$$module$build$src$core$contextmenu(a,b,this.RTL,this,c)}}updateToolbox(a){if(a=convertToolboxDefToJson$$module$build$src$core$utils$toolbox(a)){if(!this.options.languageTree)throw Error("Existing toolbox is null. Can't create new toolbox.");if(hasCategories$$module$build$src$core$utils$toolbox(a)){if(!this.toolbox)throw Error("Existing toolbox has no categories. Can't change mode.");this.options.languageTree=a;this.toolbox.render(a)}else{if(!this.flyout)throw Error("Existing toolbox has categories. Can't change mode."); +this.options.languageTree=a;this.flyout.show(a)}}else if(this.options.languageTree)throw Error("Can't nullify an existing toolbox.");}markFocused(){this.options.parentWorkspace?this.options.parentWorkspace.markFocused():(setMainWorkspace$$module$build$src$core$common(this),this.getParentSvg().focus({preventScroll:!0}))}zoom(a,b,c){c=Math.pow(this.options.zoomOptions.scaleSpeed,c);const d=this.scale*c;if(this.scale!==d){d>this.options.zoomOptions.maxScale?c=this.options.zoomOptions.maxScale/this.scale: +dthis.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.options.zoomOptions.minScale&&a{if(c.isFlyout){let d;const e=(d=c.targetWorkspace)==null?void 0:d.getFlyout();if(e instanceof Flyout$$module$build$src$core$flyout_base)return e.getFlyoutScale()}return c.getScale()},b=(c,d)=>c.options.parentWorkspace&&c.options.parentWorkspace.getSvgGroup().contains(c.getSvgGroup())?b(c.options.parentWorkspace,d*a(c)):d*a(c);return b(this,1)}scroll(a,b){this.hideChaff(!0); +const c=this.getMetrics();a=Math.min(a,-c.scrollLeft);b=Math.min(b,-c.scrollTop);const d=c.scrollTop+Math.max(0,c.scrollHeight-c.viewHeight);a=Math.max(a,-(c.scrollLeft+Math.max(0,c.scrollWidth-c.viewWidth)));b=Math.max(b,-d);this.scrollX=a;this.scrollY=b;this.scrollbar&&this.scrollbar.set(-(a+c.scrollLeft),-(b+c.scrollTop),!1);a+=c.absoluteLeft;b+=c.absoluteTop;this.translate(a,b)}getBlockById(a){return super.getBlockById(a)}getAllBlocks(a=!1){return super.getAllBlocks(a)}getTopBlocks(a=!1){return super.getTopBlocks(a)}addTopBlock(a){this.addTopBoundedElement(a); +super.addTopBlock(a)}removeTopBlock(a){this.removeTopBoundedElement(a);super.removeTopBlock(a)}addTopComment(a){this.addTopBoundedElement(a);super.addTopComment(a)}removeTopComment(a){this.removeTopBoundedElement(a);super.removeTopComment(a)}getTopComments(a=!1){return super.getTopComments(a)}getCommentById(a){return super.getCommentById(a)}getRootWorkspace(){return super.getRootWorkspace()}addTopBoundedElement(a){this.topBoundedElements.push(a)}removeTopBoundedElement(a){removeElem$$module$build$src$core$utils$array(this.topBoundedElements, +a)}getTopBoundedElements(a=!1){const b=[].concat(this.topBoundedElements);a&&b.sort(this.sortByOrigin.bind(this));return b}setResizesEnabled(a){const b=!this.resizesEnabled&&a;this.resizesEnabled=a;b&&this.resizeContents()}clear(){this.setResizesEnabled(!1);super.clear();this.topBoundedElements=[];this.setResizesEnabled(!0)}registerButtonCallback(a,b){if(typeof b!=="function")throw TypeError("Button callbacks must be functions.");this.flyoutButtonCallbacks.set(a,b)}getButtonCallback(a){let b;return(b= +this.flyoutButtonCallbacks.get(a))!=null?b:null}removeButtonCallback(a){this.flyoutButtonCallbacks.delete(a)}registerToolboxCategoryCallback(a,b){if(typeof b!=="function")throw TypeError("Toolbox category callbacks must be functions.");this.toolboxCategoryCallbacks.set(a,b)}getToolboxCategoryCallback(a){return this.toolboxCategoryCallbacks.get(a)||null}removeToolboxCategoryCallback(a){this.toolboxCategoryCallbacks.delete(a)}getGesture(a){if(this.keyboardMoveInProgress)return a.preventDefault(),a.stopPropagation(), +null;const b=a.type==="pointerdown";let c;b&&((c=this.currentGesture_)==null?0:c.hasStarted())&&(console.warn("Tried to start the same gesture twice."),this.currentGesture_.cancel());!this.currentGesture_&&b&&(this.currentGesture_=new Gesture$$module$build$src$core$gesture(a,this));return this.currentGesture_}clearGesture(){this.currentGesture_=null}cancelCurrentGesture(){this.currentGesture_&&this.currentGesture_.cancel()}getAudioManager(){return this.audioManager}getGrid(){return this.grid}hideChaff(a= +!1){hide$$module$build$src$core$tooltip();hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this);hideWithoutAnimation$$module$build$src$core$dropdowndiv();this.hideComponents(a)}hideComponents(a=!1){this.getComponentManager().getComponents(ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE,!0).forEach(b=>b.autoHide(a))}static setTopLevelWorkspaceMetrics(a){const b=this.getMetrics();typeof a.x==="number"&&(this.scrollX=-(b.scrollLeft+(b.scrollWidth-b.viewWidth)* +a.x));typeof a.y==="number"&&(this.scrollY=-(b.scrollTop+(b.scrollHeight-b.viewHeight)*a.y));this.translate(this.scrollX+b.absoluteLeft,this.scrollY+b.absoluteTop)}addClass(a){this.injectionDiv&&addClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}removeClass(a){this.injectionDiv&&removeClass$$module$build$src$core$utils$dom(this.injectionDiv,a)}setIsReadOnly(a){super.setIsReadOnly(a);a?this.addClass("blocklyReadOnly"):this.removeClass("blocklyReadOnly")}scrollBoundsIntoView(a,b=10){if(!Gesture$$module$build$src$core$gesture.inProgress()){var c= +this.getScale(),d=this.getMetricsManager().getViewMetrics(!0);d=new Rect$$module$build$src$core$utils$rect(d.top,d.top+d.height,d.left,d.left+d.width);if(!(a.left>=d.left&&a.top>=d.top&&a.right<=d.right&&a.bottom<=d.bottom)){a=a.clone();a.top-=b;a.bottom+=b;a.left-=b;a.right+=b;var e=b=0;a.leftd.right&&(b=this.RTL?d.right-a.right:Math.max(d.right-a.right,d.left-a.left));a.topd.bottom&&(e= +Math.max(d.bottom-a.bottom,d.top-a.top));this.scroll(this.scrollX+b*c,this.scrollY+e*c)}}}getFocusableElement(){return this.svgGroup_}getFocusableTree(){return this.isMutator&&this.options.parentWorkspace||this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(a)return null;let b;a=(b=this.targetWorkspace)==null?void 0:b.getFlyout();if(this.isFlyout&&a){let d,e;return(e=(d=a.getContents().find(f=>{f=f.getElement();return isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(f)&& +f.canBeFocused()}))==null?void 0:d.getElement())!=null?e:null}let c;return(c=this.getTopBlocks(!0)[0])!=null?c:null}getNestedTrees(){const a=this.getAllBlocks().map(c=>c.getIcons()).flat().filter(c=>c instanceof $.MutatorIcon$$module$build$src$core$icons$mutator_icon&&c.bubbleIsVisible()).map(c=>{let d;return(d=c.getBubble())==null?void 0:d.getWorkspace()}).filter(c=>!!c),b=this.getFlyout(!0);b&&a.push(b.getWorkspace());return a}searchForWorkspaceComment(a){for(const b of this.getTopComments())if(b instanceof +RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment&&b.canBeFocused()&&b.getFocusableElement().id===a)return b}lookUpFocusableNode(a){var b;const c=(b=this.targetWorkspace)==null?void 0:b.getFlyout();if(this.isFlyout&&c)for(var d of c.getContents())if(b=d.getElement(),isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(b)&&b.canBeFocused()&&b.getFocusableElement().id===a)return b;d=a.indexOf("_field_");b=a.indexOf("_connection_");if(d!==-1){var e=a.substring(0, +d);if(e=this.getBlockById(e))for(var f of e.getFields())if(f.canBeFocused()&&f.getFocusableElement().id===a)return f;return null}if(b!==-1){e=a.substring(0,b);if(e=this.getBlockById(e))for(const h of e.getConnections_(!0))if(h.id===a)return h;return null}f=Math.max(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor),a.indexOf(COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button),a.indexOf(COMMENT_DELETE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$delete_comment_bar_button)); +if(f!==-1&&(f=a.substring(0,f),f=this.searchForWorkspaceComment(f))){if(a.indexOf(COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor)>-1)return f.getEditorFocusableNode();var g;return(g=f.view.getCommentBarButtons().find(h=>h.getFocusableElement().id.includes(a)))!=null?g:null}if((g=this.getAllBlocks(!1).find(h=>h.getFocusableElement().id===a))||(g=this.searchForWorkspaceComment(a)))return g;g=this.getAllBlocks().map(h=>h.getIcons()).flat();for(e of g){if(e.canBeFocused()&& +e.getFocusableElement().id===a)return e;if(hasBubble$$module$build$src$core$interfaces$i_has_bubble(e)){if((g=e.getBubble())&&g.canBeFocused()&&g.getFocusableElement().id===a)return g;if(g instanceof TextInputBubble$$module$build$src$core$bubbles$textinput_bubble&&g.getEditor().getFocusableElement().id===a)return g.getEditor()}}return null}onTreeFocus(a,b){}onTreeBlur(a){if(this.isFlyout&&this.targetWorkspace&&!$.getFocusManager$$module$build$src$core$focus_manager().ephemeralFocusTaken()){var b= +this.targetWorkspace.getToolbox();b&&a===b||isAutoHideable$$module$build$src$core$interfaces$i_autohideable(b)&&b.autoHide(!1)}}getNavigator(){return this.navigator}setNavigator(a){this.navigator=a}},module$build$src$core$workspace_svg={};module$build$src$core$workspace_svg.WorkspaceSvg=WorkspaceSvg$$module$build$src$core$workspace_svg;module$build$src$core$workspace_svg.resizeSvgContents=resizeSvgContents$$module$build$src$core$workspace_svg;var VarBase$$module$build$src$core$events$events_var_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=typeof a==="undefined";a&&(this.varId=a.getId(),this.workspaceId=a.getWorkspace().id)}toJson(){const a=super.toJson();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");a.varId=this.varId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new VarBase$$module$build$src$core$events$events_var_base); +b.varId=a.varId;return b}},module$build$src$core$events$events_var_base={};module$build$src$core$events$events_var_base.VarBase=VarBase$$module$build$src$core$events$events_var_base;var VarCreate$$module$build$src$core$events$events_var_create=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_CREATE;a&&(this.varType=a.getType(),this.varName=a.getName())}toJson(){const a=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson"); +a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new VarCreate$$module$build$src$core$events$events_var_create);b.varType=a.varType;b.varName=a.varName;return b}run(a){var b=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");b=b.getVariableMap(); +a?b.createVariable(this.varName,this.varType,this.varId):(a=b.getVariableById(this.varId))&&b.deleteVariable(a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_CREATE,VarCreate$$module$build$src$core$events$events_var_create);var module$build$src$core$events$events_var_create={};module$build$src$core$events$events_var_create.VarCreate=VarCreate$$module$build$src$core$events$events_var_create;var VariableModel$$module$build$src$core$variable_model=class{constructor(a,b,c,d){this.workspace=a;this.name=b;this.type=c||"";this.id=d||genUid$$module$build$src$core$utils$idgenerator()}getId(){return this.id}getName(){return this.name}setName(a){this.name=a;return this}getType(){return this.type}setType(a){this.type=a;return this}getWorkspace(){return this.workspace}save(){const a={name:this.getName(),id:this.getId()},b=this.getType();b&&(a.type=b);return a}static load(a,b){a=new this(b,a.name, +a.type,a.id);b.getVariableMap().addVariable(a);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(a))}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry,VariableModel$$module$build$src$core$variable_model);var module$build$src$core$variable_model={};module$build$src$core$variable_model.VariableModel=VariableModel$$module$build$src$core$variable_model;var VarDelete$$module$build$src$core$events$events_var_delete=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_DELETE;a&&(this.varType=a.getType(),this.varName=a.getName())}toJson(){const a=super.toJson();if(this.varType===void 0)throw Error("The var type is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson"); +a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new VarDelete$$module$build$src$core$events$events_var_delete);b.varType=a.varType;b.varName=a.varName;return b}run(a){var b=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.varName)throw Error("The var name is undefined. Either pass a variable to the constructor, or call fromJson");b=b.getVariableMap(); +a?(a=b.getVariableById(this.varId))&&b.deleteVariable(a):b.createVariable(this.varName,this.varType,this.varId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_DELETE,VarDelete$$module$build$src$core$events$events_var_delete);var module$build$src$core$events$events_var_delete={};module$build$src$core$events$events_var_delete.VarDelete=VarDelete$$module$build$src$core$events$events_var_delete;var VarRename$$module$build$src$core$events$events_var_rename=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a,b){super(a);this.type=EventType$$module$build$src$core$events$type.VAR_RENAME;a&&(this.oldName=a.getName(),this.newName=typeof b==="undefined"?"":b)}toJson(){const a=super.toJson();if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson"); +a.oldName=this.oldName;a.newName=this.newName;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new VarRename$$module$build$src$core$events$events_var_rename);b.oldName=a.oldName;b.newName=a.newName;return b}run(a){var b=this.getEventWorkspace_();if(!this.varId)throw Error("The var ID is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.oldName)throw Error("The old var name is undefined. Either pass a variable to the constructor, or call fromJson");if(!this.newName)throw Error("The new var name is undefined. Either pass a value to the constructor, or call fromJson"); +b=b.getVariableMap();const c=b.getVariableById(this.varId);a?c&&b.renameVariable(c,this.newName):c&&b.renameVariable(c,this.oldName)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_RENAME,VarRename$$module$build$src$core$events$events_var_rename);var module$build$src$core$events$events_var_rename={};module$build$src$core$events$events_var_rename.VarRename=VarRename$$module$build$src$core$events$events_var_rename;var VariableMap$$module$build$src$core$variable_map=class{constructor(a,b=!1){this.workspace=a;this.potentialMap=b;this.variableMap=new Map}clear(){for(const a of this.variableMap.values())for(const b of a.values())this.deleteVariable(b);if(this.variableMap.size!==0)throw Error("Non-empty variable map");}renameVariable(a,b){if(a.getName()===b)return a;var c=a.getType();c=this.getVariable(b,c);const d=this.workspace.getAllBlocks(!1);let e="";this.potentialMap||(e=$.getGroup$$module$build$src$core$events$utils())|| +$.setGroup$$module$build$src$core$events$utils(!0);try{c&&c.getId()!==a.getId()?this.renameVariableWithConflict(a,b,c,d):this.renameVariableAndUses(a,b,d)}finally{this.potentialMap||$.setGroup$$module$build$src$core$events$utils(e)}return a}changeVariableType(a,b){const c=a.getType();if(c===b)return a;var d=this.variableMap.get(c);d==null||d.delete(a.getId());(d==null?void 0:d.size)===0&&this.variableMap.delete(c);a.setType(b);let e;d=(e=this.variableMap.get(b))!=null?e:new Map;d.set(a.getId(),a); +this.variableMap.has(b)||this.variableMap.set(b,d);fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE))(a,c,b));return a}renameVariableById(a,b){warn$$module$build$src$core$utils$deprecation("VariableMap.renameVariableById","v12","v13","VariableMap.renameVariable");const c=this.getVariableById(a);if(!c)throw Error("Tried to rename a variable that didn't exist. ID: "+a);this.renameVariable(c,b)}renameVariableAndUses(a, +b,c){this.potentialMap||fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_RENAME))(a,b));a.setName(b);for(b=0;b$.Names$$module$build$src$core$names.equals(d.getName(), +a)))!=null?c:null}getVariableById(a){for(const b of this.variableMap.values())if(b.has(a)){let c;return(c=b.get(a))!=null?c:null}return null}getVariablesOfType(a){return(a=this.variableMap.get(a||""))?[...a.values()]:[]}getTypes(){return[...this.variableMap.keys()]}getAllVariables(){let a=[];for(const b of this.variableMap.values())a=a.concat(...b.values());return a}getAllVariableNames(){warn$$module$build$src$core$utils$deprecation("VariableMap.getAllVariableNames","v12","v13","Blockly.Variables.getAllVariables"); +const a=[];for(const b of this.variableMap.values())for(const c of b.values())a.push(c.getName());return a}getVariableUsesById(a){warn$$module$build$src$core$utils$deprecation("VariableMap.getVariableUsesById","v12","v13","Blockly.Variables.getVariableUsesById");return getVariableUsesById$$module$build$src$core$variables(this.workspace,a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,DEFAULT$$module$build$src$core$registry,VariableMap$$module$build$src$core$variable_map); +var module$build$src$core$variable_map={};module$build$src$core$variable_map.VariableMap=VariableMap$$module$build$src$core$variable_map;var TrashcanOpen$$module$build$src$core$events$events_trashcan_open=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(b);this.type=EventType$$module$build$src$core$events$type.TRASHCAN_OPEN;this.isOpen=a}toJson(){const a=super.toJson();if(this.isOpen===void 0)throw Error("Whether this is already open or not is undefined. Either pass a value to the constructor, or call fromJson");a.isOpen=this.isOpen;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null? +c:new TrashcanOpen$$module$build$src$core$events$events_trashcan_open);b.isOpen=a.isOpen;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.TRASHCAN_OPEN,TrashcanOpen$$module$build$src$core$events$events_trashcan_open);var module$build$src$core$events$events_trashcan_open={};module$build$src$core$events$events_trashcan_open.TrashcanOpen=TrashcanOpen$$module$build$src$core$events$events_trashcan_open;var Trashcan$$module$build$src$core$trashcan=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.workspace=a;this.id="trashcan";this.contents=[];this.flyout=null;this.isLidOpen=!1;this.minOpenness=0;this.lidTask=this.svgLid=this.svgGroup=null;this.top=this.left=this.lidOpen=0;this.initialized=!1;this.workspace.options.maxTrashcanContents<=0||(a=this.workspace.copyOptionsForFlyout(),this.workspace.horizontalLayout?(a.toolboxPosition=this.workspace.toolboxPosition=== +Position$$module$build$src$core$utils$toolbox.TOP?Position$$module$build$src$core$utils$toolbox.BOTTOM:Position$$module$build$src$core$utils$toolbox.TOP,this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,this.workspace.options,!0))(a)):(a.toolboxPosition=this.workspace.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT?Position$$module$build$src$core$utils$toolbox.LEFT:Position$$module$build$src$core$utils$toolbox.RIGHT, +this.flyout=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,this.workspace.options,!0))(a)),this.workspace.addChangeListener(this.onDelete.bind(this)))}createDom(){this.svgGroup=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.G,{"class":"blocklyTrash"});let a;const b=String(Math.random()).substring(2);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH, +{id:"blocklyTrashBodyClipPath"+b},this.svgGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan,height:BODY_HEIGHT$$module$build$src$core$trashcan,y:LID_HEIGHT$$module$build$src$core$trashcan},a);const c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,x:-SPRITE_LEFT$$module$build$src$core$trashcan,height:SPRITE$$module$build$src$core$sprites.height, +y:-SPRITE_TOP$$module$build$src$core$trashcan,"clip-path":"url(#blocklyTrashBodyClipPath"+b+")"},this.svgGroup);c.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CLIPPATH,{id:"blocklyTrashLidClipPath"+b},this.svgGroup);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{width:WIDTH$$module$build$src$core$trashcan, +height:LID_HEIGHT$$module$build$src$core$trashcan},a);this.svgLid=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{width:SPRITE$$module$build$src$core$sprites.width,x:-SPRITE_LEFT$$module$build$src$core$trashcan,height:SPRITE$$module$build$src$core$sprites.height,y:-SPRITE_TOP$$module$build$src$core$trashcan,"clip-path":"url(#blocklyTrashLidClipPath"+b+")"},this.svgGroup);this.svgLid.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href", +this.workspace.options.pathToMedia+SPRITE$$module$build$src$core$sprites.url);bind$$module$build$src$core$browser_events(this.svgGroup,"pointerdown",this,this.blockMouseDownWhenOpenable);bind$$module$build$src$core$browser_events(this.svgGroup,"pointerup",this,this.click);bind$$module$build$src$core$browser_events(c,"pointerover",this,this.mouseOver);bind$$module$build$src$core$browser_events(c,"pointerout",this,this.mouseOut);this.animateLid();return this.svgGroup}init(){if(this.workspace.options.maxTrashcanContents> +0){const a=this.flyout.createDom(Svg$$module$build$src$core$utils$svg.SVG);addClass$$module$build$src$core$utils$dom(a,"blocklyTrashcanFlyout");insertAfter$$module$build$src$core$utils$dom(a,this.workspace.getParentSvg());this.flyout.init(this.workspace)}this.workspace.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TRASHCAN_WEIGHT,capabilities:[ComponentManager$$module$build$src$core$component_manager.Capability.AUTOHIDEABLE, +ComponentManager$$module$build$src$core$component_manager.Capability.DELETE_AREA,ComponentManager$$module$build$src$core$component_manager.Capability.DRAG_TARGET,ComponentManager$$module$build$src$core$component_manager.Capability.POSITIONABLE]});this.initialized=!0;this.setLidOpen(!1)}dispose(){this.workspace.getComponentManager().removeComponent("trashcan");this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup);this.lidTask&&clearTimeout(this.lidTask)}hasContents(){return!!this.contents.length}contentsIsOpen(){return!!this.flyout&& +this.flyout.isVisible()}openFlyout(){if(!this.contentsIsOpen()){var a=this.contents.map(function(c){return JSON.parse(c)}),b=this.workspace.getParentSvg().style;b.cursor="wait";setTimeout(()=>{let c;(c=this.flyout)==null||c.show(a);b.cursor="";let d;(d=this.workspace.scrollbar)==null||d.setVisible(!1)},10);this.fireUiEvent(!0)}}closeFlyout(){if(this.contentsIsOpen()){var a;(a=this.flyout)==null||a.hide();var b;(b=this.workspace.scrollbar)==null||b.setVisible(!0);this.fireUiEvent(!1);this.workspace.recordDragTargets()}}autoHide(a){!a&& +this.flyout&&this.closeFlyout()}emptyContents(){this.hasContents()&&(this.contents.length=0,this.setMinOpenness(0),this.closeFlyout())}position(a,b){if(this.initialized){var c=getCornerOppositeToolbox$$module$build$src$core$positionable_helpers(this.workspace,a);a=getStartPositionRect$$module$build$src$core$positionable_helpers(c,new Size$$module$build$src$core$utils$size(WIDTH$$module$build$src$core$trashcan,BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan), +MARGIN_HORIZONTAL$$module$build$src$core$trashcan,MARGIN_VERTICAL$$module$build$src$core$trashcan,a,this.workspace);b=bumpPositionRect$$module$build$src$core$positionable_helpers(a,MARGIN_VERTICAL$$module$build$src$core$trashcan,c.vertical===verticalPosition$$module$build$src$core$positionable_helpers.TOP?bumpDirection$$module$build$src$core$positionable_helpers.DOWN:bumpDirection$$module$build$src$core$positionable_helpers.UP,b);this.top=b.top;this.left=b.left;var d;(d=this.svgGroup)==null||d.setAttribute("transform", +"translate("+this.left+","+this.top+")");var e;(e=this.flyout)==null||e.position()}}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.top,this.top+BODY_HEIGHT$$module$build$src$core$trashcan+LID_HEIGHT$$module$build$src$core$trashcan,this.left,this.left+WIDTH$$module$build$src$core$trashcan)}getClientRect(){if(!this.svgGroup)return null;var a=this.svgGroup.getBoundingClientRect();const b=a.top+SPRITE_TOP$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan; +a=a.left+SPRITE_LEFT$$module$build$src$core$trashcan-MARGIN_HOTSPOT$$module$build$src$core$trashcan;return new Rect$$module$build$src$core$utils$rect(b,b+LID_HEIGHT$$module$build$src$core$trashcan+BODY_HEIGHT$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan,a,a+WIDTH$$module$build$src$core$trashcan+2*MARGIN_HOTSPOT$$module$build$src$core$trashcan)}onDragOver(a){this.setLidOpen(this.wouldDelete_)}onDragExit(a){this.setLidOpen(!1)}onDrop(a){setTimeout(this.setLidOpen.bind(this, +!1),100)}setLidOpen(a){this.isLidOpen!==a&&(this.lidTask&&clearTimeout(this.lidTask),this.isLidOpen=a,this.animateLid())}animateLid(){const a=ANIMATION_FRAMES$$module$build$src$core$trashcan;var b=1/(a+1);this.lidOpen+=this.isLidOpen?b:-b;this.lidOpen=Math.min(Math.max(this.lidOpen,this.minOpenness),1);this.setLidAngle(this.lidOpen*MAX_LID_ANGLE$$module$build$src$core$trashcan);b=OPACITY_MIN$$module$build$src$core$trashcan+this.lidOpen*(OPACITY_MAX$$module$build$src$core$trashcan-OPACITY_MIN$$module$build$src$core$trashcan); +this.svgGroup&&(this.svgGroup.style.opacity=`${b}`);this.lidOpen>this.minOpenness&&this.lidOpen<1&&(this.lidTask=setTimeout(this.animateLid.bind(this),ANIMATION_LENGTH$$module$build$src$core$trashcan/a))}setLidAngle(a){const b=this.workspace.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT||this.workspace.horizontalLayout&&this.workspace.RTL;let c;(c=this.svgLid)==null||c.setAttribute("transform","rotate("+(b?-a:a)+","+(b?4:WIDTH$$module$build$src$core$trashcan-4)+","+(LID_HEIGHT$$module$build$src$core$trashcan- +2)+")")}setMinOpenness(a){this.minOpenness=a;this.isLidOpen||this.setLidAngle(a*MAX_LID_ANGLE$$module$build$src$core$trashcan)}closeLid(){this.setLidOpen(!1)}click(){this.hasContents()&&!this.workspace.isDragging()&&this.openFlyout()}fireUiEvent(a){a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.TRASHCAN_OPEN))(a,this.workspace.id);fire$$module$build$src$core$events$utils(a)}blockMouseDownWhenOpenable(a){!this.contentsIsOpen()&&this.hasContents()&&a.stopPropagation()}mouseOver(){this.hasContents()&& +this.setLidOpen(!0)}mouseOut(){this.setLidOpen(!1)}onDelete(a){if(!(this.workspace.options.maxTrashcanContents<=0||!isBlockDelete$$module$build$src$core$events$predicates(a)||a.wasShadow)){if(!a.oldJson)throw Error("Encountered a delete event without proper oldJson");a=JSON.stringify(this.cleanBlockJson(a.oldJson));if(!this.contents.includes(a)){for(this.contents.unshift(a);this.contents.length>this.workspace.options.maxTrashcanContents;)this.contents.pop();this.setMinOpenness(HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan)}}}cleanBlockJson(a){function b(c){if(c){delete c.id; +delete c.x;delete c.y;delete c.enabled;delete c.disabledReasons;if(c.icons&&c.icons.comment){var d=c.icons.comment;delete d.height;delete d.width;delete d.pinned}d=c.inputs;for(var e in d){var f=d[e];const g=f.block;f=f.shadow;g&&b(g);f&&b(f)}c.next&&(e=c.next,c=e.block,e=e.shadow,c&&b(c),e&&b(e))}}a=JSON.parse(JSON.stringify(a));b(a);return Object.assign({},{kind:"BLOCK"},a)}},WIDTH$$module$build$src$core$trashcan=47,BODY_HEIGHT$$module$build$src$core$trashcan=44,LID_HEIGHT$$module$build$src$core$trashcan= +16,MARGIN_VERTICAL$$module$build$src$core$trashcan=20,MARGIN_HORIZONTAL$$module$build$src$core$trashcan=20,MARGIN_HOTSPOT$$module$build$src$core$trashcan=10,SPRITE_LEFT$$module$build$src$core$trashcan=0,SPRITE_TOP$$module$build$src$core$trashcan=32,HAS_BLOCKS_LID_ANGLE$$module$build$src$core$trashcan=.1,ANIMATION_LENGTH$$module$build$src$core$trashcan=80,ANIMATION_FRAMES$$module$build$src$core$trashcan=4,OPACITY_MIN$$module$build$src$core$trashcan=.4,OPACITY_MAX$$module$build$src$core$trashcan=.8, +MAX_LID_ANGLE$$module$build$src$core$trashcan=45,module$build$src$core$trashcan={};module$build$src$core$trashcan.Trashcan=Trashcan$$module$build$src$core$trashcan;var stashedCopyData$$module$build$src$core$clipboard=null,stashedWorkspace$$module$build$src$core$clipboard=null,stashedCoordinates$$module$build$src$core$clipboard=void 0,module$build$src$core$clipboard={};module$build$src$core$clipboard.BlockPaster=BlockPaster$$module$build$src$core$clipboard$block_paster;module$build$src$core$clipboard.copy=copy$$module$build$src$core$clipboard;module$build$src$core$clipboard.getLastCopiedData=getLastCopiedData$$module$build$src$core$clipboard; +module$build$src$core$clipboard.getLastCopiedLocation=getLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.getLastCopiedWorkspace=getLastCopiedWorkspace$$module$build$src$core$clipboard;module$build$src$core$clipboard.paste=paste$$module$build$src$core$clipboard;module$build$src$core$clipboard.registry=module$build$src$core$clipboard$registry;module$build$src$core$clipboard.setLastCopiedData=setLastCopiedData$$module$build$src$core$clipboard; +module$build$src$core$clipboard.setLastCopiedLocation=setLastCopiedLocation$$module$build$src$core$clipboard;module$build$src$core$clipboard.setLastCopiedWorkspace=setLastCopiedWorkspace$$module$build$src$core$clipboard;var module$build$src$core$comments={};module$build$src$core$comments.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;module$build$src$core$comments.CommentBarButton=CommentBarButton$$module$build$src$core$comments$comment_bar_button;module$build$src$core$comments.CommentEditor=CommentEditor$$module$build$src$core$comments$comment_editor;module$build$src$core$comments.CommentView=CommentView$$module$build$src$core$comments$comment_view; +module$build$src$core$comments.DeleteCommentBarButton=DeleteCommentBarButton$$module$build$src$core$comments$delete_comment_bar_button;module$build$src$core$comments.RenderedWorkspaceComment=RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment;module$build$src$core$comments.WorkspaceComment=WorkspaceComment$$module$build$src$core$comments$workspace_comment;var module$build$src$core$interfaces$i_copyable={};module$build$src$core$interfaces$i_copyable.isCopyable=isCopyable$$module$build$src$core$interfaces$i_copyable;var names$$module$build$src$core$shortcut_items;(function(a){a.ESCAPE="escape";a.DELETE="delete";a.COPY="copy";a.CUT="cut";a.PASTE="paste";a.UNDO="undo";a.REDO="redo"})(names$$module$build$src$core$shortcut_items||(names$$module$build$src$core$shortcut_items={}));registerDefaultShortcuts$$module$build$src$core$shortcut_items();var module$build$src$core$shortcut_items={};module$build$src$core$shortcut_items.names=names$$module$build$src$core$shortcut_items; +module$build$src$core$shortcut_items.registerCopy=registerCopy$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerCut=registerCut$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDefaultShortcuts=registerDefaultShortcuts$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerDelete=registerDelete$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerEscape=registerEscape$$module$build$src$core$shortcut_items; +module$build$src$core$shortcut_items.registerPaste=registerPaste$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerRedo=registerRedo$$module$build$src$core$shortcut_items;module$build$src$core$shortcut_items.registerUndo=registerUndo$$module$build$src$core$shortcut_items;var ProcedureSerializer$$module$build$src$core$serialization$procedures=class{constructor(a,b){this.procedureModelClass=a;this.parameterModelClass=b;this.priority=PROCEDURES$$module$build$src$core$serialization$priorities}save(a){a=a.getProcedureMap().getProcedures().map(b=>saveProcedure$$module$build$src$core$serialization$procedures(b));return a.length?a:null}load(a,b){const c=b.getProcedureMap();for(const d of a)c.add(loadProcedure$$module$build$src$core$serialization$procedures(this.procedureModelClass, +this.parameterModelClass,d,b))}clear(a){a.getProcedureMap().clear()}},module$build$src$core$serialization$procedures={};module$build$src$core$serialization$procedures.ProcedureSerializer=ProcedureSerializer$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.loadProcedure=loadProcedure$$module$build$src$core$serialization$procedures;module$build$src$core$serialization$procedures.saveProcedure=saveProcedure$$module$build$src$core$serialization$procedures;var VariableSerializer$$module$build$src$core$serialization$variables=class{constructor(){this.priority=VARIABLES$$module$build$src$core$serialization$priorities}save(a){a=a.getAllVariables().map(b=>b.save());return a.length?a:null}load(a,b){const c=getObject$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,DEFAULT$$module$build$src$core$registry);a.forEach(d=>{c==null||c.load(d,b)})}clear(a){a.getVariableMap().clear()}}; +register$$module$build$src$core$serialization$registry("variables",new VariableSerializer$$module$build$src$core$serialization$variables);var module$build$src$core$serialization$variables={};module$build$src$core$serialization$variables.VariableSerializer=VariableSerializer$$module$build$src$core$serialization$variables;var module$build$src$core$serialization$workspaces={};module$build$src$core$serialization$workspaces.load=load$$module$build$src$core$serialization$workspaces;module$build$src$core$serialization$workspaces.save=save$$module$build$src$core$serialization$workspaces;var module$build$src$core$serialization={blocks:module$build$src$core$serialization$blocks,exceptions:module$build$src$core$serialization$exceptions,priorities:module$build$src$core$serialization$priorities,procedures:module$build$src$core$serialization$procedures,registry:module$build$src$core$serialization$registry,variables:module$build$src$core$serialization$variables,workspaceComments:module$build$src$core$serialization$workspace_comments,workspaces:module$build$src$core$serialization$workspaces};"Blockly"in globalThis||(globalThis.Blockly={Msg:module$build$src$core$msg});var module$build$src$core$main={};var LABEL_TYPE$$module$build$src$core$label_flyout_inflater="label",LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater=class{load(a,b){a=new FlyoutButton$$module$build$src$core$flyout_button(b.getWorkspace(),b.targetWorkspace,a,!0);a.show();return new FlyoutItem$$module$build$src$core$flyout_item(a,LABEL_TYPE$$module$build$src$core$label_flyout_inflater)}gapForItem(a,b){return b}disposeItem(a){a=a.getElement();a instanceof FlyoutButton$$module$build$src$core$flyout_button&&a.dispose()}getType(){return LABEL_TYPE$$module$build$src$core$label_flyout_inflater}}; +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,LABEL_TYPE$$module$build$src$core$label_flyout_inflater,LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater);var module$build$src$core$label_flyout_inflater={};module$build$src$core$label_flyout_inflater.LabelFlyoutInflater=LabelFlyoutInflater$$module$build$src$core$label_flyout_inflater;var ConstantProvider$$module$build$src$core$renderers$zelos$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(a){super();this.GRID_UNIT=4;this.CURSOR_COLOUR="#ffa200";this.CURSOR_RADIUS=5;this.JAGGED_TEETH_WIDTH=this.JAGGED_TEETH_HEIGHT=0;this.START_HAT_HEIGHT=22;this.START_HAT_WIDTH=96;this.SHAPES={HEXAGONAL:1,ROUND:2,SQUARE:3,PUZZLE:4,NOTCH:5};this.SHAPE_IN_SHAPE_PADDING={1:{0:5*this.GRID_UNIT,1:2*this.GRID_UNIT,2:5*this.GRID_UNIT,3:5*this.GRID_UNIT}, +2:{0:3*this.GRID_UNIT,1:3*this.GRID_UNIT,2:1*this.GRID_UNIT,3:2*this.GRID_UNIT},3:{0:2*this.GRID_UNIT,1:2*this.GRID_UNIT,2:2*this.GRID_UNIT,3:2*this.GRID_UNIT}};this.FULL_BLOCK_FIELDS=!0;this.FIELD_TEXT_FONTWEIGHT="bold";this.FIELD_TEXT_FONTFAMILY='"Helvetica Neue", "Segoe UI", Helvetica, sans-serif';this.FIELD_COLOUR_FULL_BLOCK=this.FIELD_TEXTINPUT_BOX_SHADOW=this.FIELD_DROPDOWN_SVG_ARROW=this.FIELD_DROPDOWN_COLOURED_DIV=this.FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW=!0;this.SELECTED_GLOW_COLOUR="#fff200"; +this.SELECTED_GLOW_SIZE=.5;this.REPLACEMENT_GLOW_COLOUR="#fff200";this.REPLACEMENT_GLOW_SIZE=2;this.selectedGlowFilterId="";this.selectedGlowFilter=null;this.replacementGlowFilterId="";this.SQUARED=this.ROUNDED=this.HEXAGONAL=this.replacementGlowFilter=null;a&&(this.GRID_UNIT=a);this.SMALL_PADDING=this.GRID_UNIT;this.MEDIUM_PADDING=2*this.GRID_UNIT;this.MEDIUM_LARGE_PADDING=3*this.GRID_UNIT;this.LARGE_PADDING=4*this.GRID_UNIT;this.CORNER_RADIUS=1*this.GRID_UNIT;this.NOTCH_WIDTH=9*this.GRID_UNIT;this.NOTCH_HEIGHT= +2*this.GRID_UNIT;this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT=3*this.GRID_UNIT;this.MIN_BLOCK_WIDTH=2*this.GRID_UNIT;this.MIN_BLOCK_HEIGHT=12*this.GRID_UNIT;this.EMPTY_STATEMENT_INPUT_HEIGHT=6*this.GRID_UNIT;this.TOP_ROW_MIN_HEIGHT=this.CORNER_RADIUS;this.TOP_ROW_PRECEDES_STATEMENT_MIN_HEIGHT=this.LARGE_PADDING;this.BOTTOM_ROW_MIN_HEIGHT=this.CORNER_RADIUS;this.BOTTOM_ROW_AFTER_STATEMENT_MIN_HEIGHT=6*this.GRID_UNIT;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT;this.STATEMENT_INPUT_SPACER_MIN_WIDTH= +40*this.GRID_UNIT;this.STATEMENT_INPUT_PADDING_LEFT=4*this.GRID_UNIT;this.EMPTY_INLINE_INPUT_PADDING=4*this.GRID_UNIT;this.EMPTY_INLINE_INPUT_HEIGHT=8*this.GRID_UNIT;this.DUMMY_INPUT_MIN_HEIGHT=8*this.GRID_UNIT;this.DUMMY_INPUT_SHADOW_MIN_HEIGHT=6*this.GRID_UNIT;this.CURSOR_WS_WIDTH=20*this.GRID_UNIT;this.FIELD_TEXT_FONTSIZE=3*this.GRID_UNIT;this.FIELD_BORDER_RECT_RADIUS=this.CORNER_RADIUS;this.FIELD_BORDER_RECT_X_PADDING=2*this.GRID_UNIT;this.FIELD_BORDER_RECT_Y_PADDING=1.625*this.GRID_UNIT;this.FIELD_BORDER_RECT_HEIGHT= +8*this.GRID_UNIT;this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=8*this.GRID_UNIT;this.FIELD_DROPDOWN_SVG_ARROW_PADDING=this.FIELD_BORDER_RECT_X_PADDING;this.FIELD_COLOUR_DEFAULT_WIDTH=6*this.GRID_UNIT;this.FIELD_COLOUR_DEFAULT_HEIGHT=8*this.GRID_UNIT;this.FIELD_CHECKBOX_X_OFFSET=1*this.GRID_UNIT;this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH=12*this.GRID_UNIT}setFontConstants_(a){super.setFontConstants_(a);this.FIELD_DROPDOWN_BORDER_RECT_HEIGHT=this.FIELD_BORDER_RECT_HEIGHT=this.FIELD_TEXT_HEIGHT+this.FIELD_BORDER_RECT_Y_PADDING* +2}init(){super.init();this.HEXAGONAL=this.makeHexagonal();this.ROUNDED=this.makeRounded();this.SQUARED=this.makeSquared();this.STATEMENT_INPUT_NOTCH_OFFSET=this.NOTCH_OFFSET_LEFT+this.INSIDE_CORNERS.rightWidth}setDynamicProperties_(a){super.setDynamicProperties_(a);this.SELECTED_GLOW_COLOUR=a.getComponentStyle("selectedGlowColour")||this.SELECTED_GLOW_COLOUR;const b=Number(a.getComponentStyle("selectedGlowSize"));this.SELECTED_GLOW_SIZE=b&&!isNaN(b)?b:this.SELECTED_GLOW_SIZE;this.REPLACEMENT_GLOW_COLOUR= +a.getComponentStyle("replacementGlowColour")||this.REPLACEMENT_GLOW_COLOUR;this.REPLACEMENT_GLOW_SIZE=(a=Number(a.getComponentStyle("replacementGlowSize")))&&!isNaN(a)?a:this.REPLACEMENT_GLOW_SIZE}dispose(){super.dispose();this.selectedGlowFilter&&removeNode$$module$build$src$core$utils$dom(this.selectedGlowFilter);this.replacementGlowFilter&&removeNode$$module$build$src$core$utils$dom(this.replacementGlowFilter)}makeStartHat(){const a=this.START_HAT_HEIGHT,b=this.START_HAT_WIDTH,c=curve$$module$build$src$core$utils$svg_paths("c", +[point$$module$build$src$core$utils$svg_paths(25,-a),point$$module$build$src$core$utils$svg_paths(71,-a),point$$module$build$src$core$utils$svg_paths(b,0)]);return{height:a*.75,width:b,path:c}}makeHexagonal(){function a(c,d,e){var f=c/2;f=f>b?b:f;e=e?-1:1;c=(d?-1:1)*c/2;return lineTo$$module$build$src$core$utils$svg_paths(-e*f,c)+lineTo$$module$build$src$core$utils$svg_paths(e*f,c)}const b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH;return{type:this.SHAPES.HEXAGONAL,isDynamic:!0,width(c){c/=2;return c> +b?b:c},height(c){return c},connectionOffsetY(c){return c/2},connectionOffsetX(c){return-c},pathDown(c){return a(c,!1,!1)},pathUp(c){return a(c,!0,!1)},pathRightDown(c){return a(c,!1,!0)},pathRightUp(c){return a(c,!1,!0)}}}makeRounded(){function a(d,e,f){const g=d>c?d-c:0;d=(d>c?c:d)/2;const h=f===e?"0":"1";return arc$$module$build$src$core$utils$svg_paths("a","0 0,"+h,d,point$$module$build$src$core$utils$svg_paths((f?1:-1)*d,(e?-1:1)*d))+lineOnAxis$$module$build$src$core$utils$svg_paths("v",(e?-1: +1)*g)+arc$$module$build$src$core$utils$svg_paths("a","0 0,"+h,d,point$$module$build$src$core$utils$svg_paths((f?-1:1)*d,(e?-1:1)*d))}const b=this.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,c=b*2;return{type:this.SHAPES.ROUND,isDynamic:!0,width(d){d/=2;return d>b?b:d},height(d){return d},connectionOffsetY(d){return d/2},connectionOffsetX(d){return-d},pathDown(d){return a(d,!1,!1)},pathUp(d){return a(d,!0,!1)},pathRightDown(d){return a(d,!1,!0)},pathRightUp(d){return a(d,!1,!0)}}}makeSquared(){function a(c, +d,e){c-=b*2;const f=e===d?"0":"1";return arc$$module$build$src$core$utils$svg_paths("a","0 0,"+f,b,point$$module$build$src$core$utils$svg_paths((e?1:-1)*b,(d?-1:1)*b))+lineOnAxis$$module$build$src$core$utils$svg_paths("v",(d?-1:1)*c)+arc$$module$build$src$core$utils$svg_paths("a","0 0,"+f,b,point$$module$build$src$core$utils$svg_paths((e?-1:1)*b,(d?-1:1)*b))}const b=this.CORNER_RADIUS;return{type:this.SHAPES.SQUARE,isDynamic:!0,width(c){return b},height(c){return c},connectionOffsetY(c){return c/ +2},connectionOffsetX(c){return-c},pathDown(c){return a(c,!1,!1)},pathUp(c){return a(c,!0,!1)},pathRightDown(c){return a(c,!1,!0)},pathRightUp(c){return a(c,!1,!0)}}}shapeFor(a){let b=a.getCheck();!b&&a.targetConnection&&(b=a.targetConnection.getCheck());switch(a.type){case ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE:case ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE:a=a.getSourceBlock().getOutputShape();if(a!==null)switch(a){case this.SHAPES.HEXAGONAL:return this.HEXAGONAL; +case this.SHAPES.ROUND:return this.ROUNDED;case this.SHAPES.SQUARE:return this.SQUARED}if(b&&b.includes("Boolean"))return this.HEXAGONAL;if(b&&b.includes("Number"))return this.ROUNDED;b&&b.includes("String");return this.ROUNDED;case ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT:case ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT:return this.NOTCH;default:throw Error("Unknown type");}}makeNotch(){function a(l){return curve$$module$build$src$core$utils$svg_paths("c", +[point$$module$build$src$core$utils$svg_paths(l*e/2,0),point$$module$build$src$core$utils$svg_paths(l*e*3/4,g/2),point$$module$build$src$core$utils$svg_paths(l*e,g)])+line$$module$build$src$core$utils$svg_paths([point$$module$build$src$core$utils$svg_paths(l*e,f)])+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*e/4,g/2),point$$module$build$src$core$utils$svg_paths(l*e/2,g),point$$module$build$src$core$utils$svg_paths(l*e,g)])+lineOnAxis$$module$build$src$core$utils$svg_paths("h", +l*d)+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*e/2,0),point$$module$build$src$core$utils$svg_paths(l*e*3/4,-(g/2)),point$$module$build$src$core$utils$svg_paths(l*e,-g)])+line$$module$build$src$core$utils$svg_paths([point$$module$build$src$core$utils$svg_paths(l*e,-f)])+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(l*e/4,-(g/2)),point$$module$build$src$core$utils$svg_paths(l*e/2,-g),point$$module$build$src$core$utils$svg_paths(l* +e,-g)])}const b=this.NOTCH_WIDTH,c=this.NOTCH_HEIGHT,d=b/3,e=d/3,f=c/2,g=f/2,h=a(1),k=a(-1);return{type:this.SHAPES.NOTCH,width:b,height:c,pathLeft:h,pathRight:k}}makeInsideCorners(){const a=this.CORNER_RADIUS,b=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(-a,a)),c=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(-a,a)),d=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(a, +a)),e=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$build$src$core$utils$svg_paths(a,a));return{width:a,height:a,pathTop:b,pathBottom:d,rightWidth:a,rightHeight:a,pathTopRight:c,pathBottomRight:e}}generateSecondaryColour_(a){return blend$$module$build$src$core$utils$colour("#000",a,.15)||a}generateTertiaryColour_(a){return blend$$module$build$src$core$utils$colour("#000",a,.25)||a}createDom(a,b,c,d){super.createDom(a,b,c,d);a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.DEFS, +{},a);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,{id:"blocklySelectedGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR,{"in":"SourceGraphic",stdDeviation:this.SELECTED_GLOW_SIZE},b);c=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER,{result:"outBlur"},b); +createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},c);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFLOOD,{"flood-color":this.SELECTED_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in",result:"outGlow"},b); +this.selectedGlowFilterId=b.id;this.selectedGlowFilter=b;a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,{id:"blocklyReplacementGlowFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEGAUSSIANBLUR,{"in":"SourceGraphic",stdDeviation:this.REPLACEMENT_GLOW_SIZE},a);b=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPONENTTRANSFER, +{result:"outBlur"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFUNCA,{type:"table",tableValues:"0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1"},b);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FEFLOOD,{"flood-color":this.REPLACEMENT_GLOW_COLOUR,"flood-opacity":1,result:"outColor"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"outColor",in2:"outBlur",operator:"in", +result:"outGlow"},a);createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FECOMPOSITE,{"in":"SourceGraphic",in2:"outGlow",operator:"over"},a);this.replacementGlowFilterId=a.id;this.replacementGlowFilter=a;d&&(d.style.setProperty("--blocklySelectedGlowFilter",`url(#${this.selectedGlowFilterId})`),d.style.setProperty("--blocklyReplacementGlowFilter",`url(#${this.replacementGlowFilterId})`))}getCSS_(a){return[`${a} .blocklyText,`,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}`+ +`pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyTextInputBubble textarea {`,"font-weight: normal;","}",`${a} .blocklyText {`,"fill: #fff;","}",`${a} .blocklyNonEditableField>rect:not(.blocklyDropdownRect),`,`${a} .blocklyEditableField>rect:not(.blocklyDropdownRect) {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text,`,`${a} .blocklyNonEditableField>g>text,`,`${a} .blocklyEditableField>g>text {`,"fill: #575E75;","}",`${a} .blocklyFlyoutLabelText {`, +"fill: #575E75;","}",`${a} .blocklyText.blocklyBubbleText {`,"fill: #575E75;","}",`${a} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableField:not(.blocklyEditing):hover>rect,",`${a} .blocklyDraggable:not(.blocklyDisabled)`," .blocklyEditableField:not(.blocklyEditing):hover>.blocklyPath {","stroke: #fff;","stroke-width: 2;","}",`${a} .blocklyHtmlInput {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,`font-weight: ${this.FIELD_TEXT_FONTWEIGHT};`,"color: #575E75;","}",`${a} .blocklyDropdownText {`, +"fill: #fff !important;","}",`${a}.blocklyWidgetDiv .blocklyMenuItem,`,`${a}.blocklyDropDownDiv .blocklyMenuItem {`,`font-family: ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a}.blocklyDropDownDiv .blocklyMenuItemContent {`,"color: #fff;","}",`${a} .blocklyHighlightedConnectionPath {`,`stroke: ${this.SELECTED_GLOW_COLOUR};`,"}",`${a} .blocklyDisabledPattern > .blocklyOutlinePath {`,"fill: var(--blocklyDisabledPattern)","}",`${a} .blocklyInsertionMarker>.blocklyPath {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`, +"stroke: none;","}",`${a} .blocklySelected>.blocklyPath.blocklyPathSelected {`,"fill: none;","filter: var(--blocklySelectedGlowFilter);","}",`${a} .blocklyReplaceable>.blocklyPath {`,"filter: var(--blocklyReplacementGlowFilter);","}"]}},module$build$src$core$renderers$zelos$constants={};module$build$src$core$renderers$zelos$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$zelos$constants;var Drawer$$module$build$src$core$renderers$zelos$drawer=class extends Drawer$$module$build$src$core$renderers$common$drawer{constructor(a,b){super(a,b)}draw(){const a=this.block_.pathObject;a.beginDrawing();this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();a.setPath(this.outlinePath_+"\n"+this.inlinePath_);this.info_.RTL&&a.flipRTL();this.recordSizeOnBlock_();this.info_.outputConnection&&(a.outputShapeType=this.info_.outputConnection.shape.type);a.endDrawing()}drawOutline_(){this.info_.outputConnection&& +this.info_.outputConnection.isDynamicShape&&!this.info_.hasStatementInput&&!this.info_.bottomRow.hasNextConnection?(this.drawFlatTop_(),this.drawRightDynamicConnection_(),this.drawFlatBottom_(),this.drawLeftDynamicConnection_()):super.drawOutline_()}drawLeft_(){this.info_.outputConnection&&this.info_.outputConnection.isDynamicShape?this.drawLeftDynamicConnection_():super.drawLeft_()}drawRightSideRow_(a){if(!(a.height<=0)){if(Types$$module$build$src$core$renderers$measurables$types.isSpacer(a)){const d= +a.precedesStatement;var b=a.followsStatement;if(d||b){const e=this.constants_.INSIDE_CORNERS;var c=e.rightHeight;c=a.height-(d?c:0);b=b?e.pathBottomRight:"";a=c>0?lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.yPos+c):"";this.outlinePath_+=b+a+(d?e.pathTopRight:"");return}}this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.yPos+a.height)}}drawRightDynamicConnection_(){if(!this.info_.outputConnection)throw Error("Cannot draw the output connection of a block that doesn't have one"); +this.outlinePath_+=this.info_.outputConnection.shape.pathRightDown(this.info_.outputConnection.height)}drawLeftDynamicConnection_(){if(!this.info_.outputConnection)throw Error("Cannot draw the output connection of a block that doesn't have one");this.positionOutputConnection_();this.outlinePath_+=this.info_.outputConnection.shape.pathUp(this.info_.outputConnection.height);this.outlinePath_+="z"}drawFlatTop_(){const a=this.info_.topRow;this.positionPreviousConnection_();this.outlinePath_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos, +this.info_.startY);this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("h",a.width)}drawFlatBottom_(){const a=this.info_.bottomRow;this.positionNextConnection_();this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.baseline);this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("h",-a.width)}drawInlineInput_(a){this.positionInlineInputConnection_(a);const b=a.input.name;a.connectedBlock||this.info_.isInsertionMarker||(a=moveTo$$module$build$src$core$utils$svg_paths(a.xPos+ +a.connectionWidth,a.centerline-a.height/2)+this.getInlineInputPath(a),this.block_.pathObject.setOutlinePath(b,a))}getInlineInputPath(a){const b=a.width-a.connectionWidth*2,c=a.height;return lineOnAxis$$module$build$src$core$utils$svg_paths("h",b)+a.shape.pathRightDown(c)+lineOnAxis$$module$build$src$core$utils$svg_paths("h",-b)+a.shape.pathUp(c)+"z"}drawStatementInput_(a){var b=a.getLastInput();const c=b.xPos+b.notchOffset+b.shape.width,d=this.constants_.INSIDE_CORNERS,e=b.shape.pathRight+lineOnAxis$$module$build$src$core$utils$svg_paths("h", +-(b.notchOffset-d.width))+d.pathTop,f=a.height-2*d.height;b=d.pathBottom+lineOnAxis$$module$build$src$core$utils$svg_paths("h",b.notchOffset-d.width)+(b.connectedBottomNextConnection?"":b.shape.pathLeft);this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",c)+e+lineOnAxis$$module$build$src$core$utils$svg_paths("v",f)+b+lineOnAxis$$module$build$src$core$utils$svg_paths("H",a.xPos+a.width);this.positionStatementInputConnection_(a)}drawConnectionHighlightPath(a){const b=a.connectionModel; +if(b.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT||b.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE&&!a.isDynamicShape)return super.drawConnectionHighlightPath(a);a=b.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE?moveTo$$module$build$src$core$utils$svg_paths(a.connectionWidth,-a.height/2)+this.getInlineInputPath(a):moveTo$$module$build$src$core$utils$svg_paths(a.width, +-a.height/2)+a.shape.pathDown(a.height);const c=b.getSourceBlock();let d,e;return(e=(d=c.pathObject).addConnectionHighlight)==null?void 0:e.call(d,b,a,b.getOffsetInBlock(),c.RTL)}},module$build$src$core$renderers$zelos$drawer={};module$build$src$core$renderers$zelos$drawer.Drawer=Drawer$$module$build$src$core$renderers$zelos$drawer;var FieldImage$$module$build$src$core$field_image=class extends Field$$module$build$src$core$field{constructor(a,b,c,d,e,f,g){super(Field$$module$build$src$core$field.SKIP_SETUP);this.imageElement=this.clickHandler=null;this.flipRtl=this.isDirty_=this.EDITABLE=!1;this.altText="";c=Number(replaceMessageReferences$$module$build$src$core$utils$parsing(c));b=Number(replaceMessageReferences$$module$build$src$core$utils$parsing(b));if(isNaN(c)||isNaN(b))throw Error("Height and width values of an image field must cast to numbers."); +if(c<=0||b<=0)throw Error("Height and width values of an image field must be greater than 0.");this.size_=new Size$$module$build$src$core$utils$size(b,c+FieldImage$$module$build$src$core$field_image.Y_PADDING);this.imageHeight=c;typeof e==="function"&&(this.clickHandler=e);a!==Field$$module$build$src$core$field.SKIP_SETUP&&(g?this.configure_(g):(this.flipRtl=!!f,this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(d)||""),this.setValue(replaceMessageReferences$$module$build$src$core$utils$parsing(a)))}configure_(a){super.configure_(a); +a.flipRtl&&(this.flipRtl=a.flipRtl);a.alt&&(this.altText=replaceMessageReferences$$module$build$src$core$utils$parsing(a.alt))}initView(){this.imageElement=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.IMAGE,{height:this.imageHeight+"px",width:this.size_.width+"px",alt:this.altText},this.fieldGroup_);this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_);this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_, +"blocklyImageField");this.clickHandler&&(this.imageElement.style.cursor="pointer")}updateSize_(){}doClassValidation_(a){return typeof a!=="string"?null:a}doValueUpdate_(a){this.value_=a;this.imageElement&&this.imageElement.setAttributeNS(XLINK_NS$$module$build$src$core$utils$dom,"xlink:href",this.value_)}getFlipRtl(){return this.flipRtl}setAlt(a){a!==this.altText&&(this.altText=a||"",this.imageElement&&this.imageElement.setAttribute("alt",this.altText))}isClickable(){return super.isClickable()&&!!this.clickHandler}showEditor_(){this.clickHandler&& +this.clickHandler(this)}setOnClickHandler(a){this.clickHandler=a}getText_(){return this.altText}static fromJson(a){if(!a.src||!a.width||!a.height)throw Error("src, width, and height values for an image field arerequired. The width and height must be non-zero.");return new this(a.src,a.width,a.height,void 0,void 0,void 0,a)}};FieldImage$$module$build$src$core$field_image.Y_PADDING=1;register$$module$build$src$core$field_registry("field_image",FieldImage$$module$build$src$core$field_image); +FieldImage$$module$build$src$core$field_image.prototype.DEFAULT_VALUE="";var module$build$src$core$field_image={};module$build$src$core$field_image.FieldImage=FieldImage$$module$build$src$core$field_image;var MINIMUM_WIDTH$$module$build$src$core$field_input=14,FieldInput$$module$build$src$core$field_input=class extends Field$$module$build$src$core$field{set size_(a){super.size_=a}get size_(){const a=super.size_;a.width{a!==null&&this.setValue(this.getValueFromEditorText_(a));this.onFinishEditing_(this.value_)})}showInlineEditor(a,b){const c=this.getSourceBlock();if(!c)throw new UnattachedFieldError$$module$build$src$core$field;show$$module$build$src$core$widgetdiv(this,c.RTL,this.widgetDispose_.bind(this),this.workspace_,b);this.htmlInput_=this.widgetCreate_();this.isBeingEdited_=!0;this.valueWhenEditorWasOpened_=this.value_;a||(this.htmlInput_.focus({preventScroll:!0}),this.htmlInput_.select())}widgetCreate_(){var a= +this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;$.setGroup$$module$build$src$core$events$utils(!0);const b=getDiv$$module$build$src$core$widgetdiv();var c=this.getClickTarget_();if(!c)throw Error("A click target has not been set.");addClass$$module$build$src$core$utils$dom(c,"blocklyEditing");c=document.createElement("input");c.className="blocklyHtmlInput";c.setAttribute("spellcheck",this.spellcheck_);const d=this.workspace_.getAbsoluteScale();var e=this.getConstants().FIELD_TEXT_FONTSIZE* +d+"pt";b.style.fontSize=e;c.style.fontSize=e;e=FieldInput$$module$build$src$core$field_input.BORDERRADIUS*d+"px";this.isFullBlockField()&&(e=this.getScaledBBox(),e=(e.bottom-e.top)/2+"px",a=a.getParent()?a.getParent().getColourTertiary():this.sourceBlock_.getColourTertiary(),c.style.border=1*d+"px solid "+a,b.style.borderRadius=e,b.style.transition="box-shadow 0.25s ease 0s",this.getConstants().FIELD_TEXTINPUT_BOX_SHADOW&&(b.style.boxShadow="rgba(255, 255, 255, 0.3) 0 0 0 "+4*d+"px"));c.style.borderRadius= +e;b.appendChild(c);c.value=c.defaultValue=this.getEditorText_(this.value_);c.setAttribute("data-untyped-default-value",String(this.value_));this.resizeEditor_();this.bindInputEvents_(c);return c}widgetDispose_(){this.isBeingEdited_=!1;this.isTextValid_=!0;this.forceRerender();this.onFinishEditing_(this.value_);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.valueWhenEditorWasOpened_!==null&&this.valueWhenEditorWasOpened_!==this.value_&&(fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CHANGE))(this.sourceBlock_, +"field",this.name||null,this.valueWhenEditorWasOpened_,this.value_)),this.valueWhenEditorWasOpened_=null);$.setGroup$$module$build$src$core$events$utils(!1);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,"blocklyEditing")}onFinishEditing_(a){}bindInputEvents_(a){this.onKeyDownWrapper= +conditionalBind$$module$build$src$core$browser_events(a,"keydown",this,this.onHtmlInputKeyDown_);this.onInputWrapper=conditionalBind$$module$build$src$core$browser_events(a,"input",this,this.onHtmlInputChange)}unbindInputEvents_(){this.onKeyDownWrapper&&(unbind$$module$build$src$core$browser_events(this.onKeyDownWrapper),this.onKeyDownWrapper=null);this.onInputWrapper&&(unbind$$module$build$src$core$browser_events(this.onInputWrapper),this.onInputWrapper=null)}onHtmlInputKeyDown_(a){if(a.key==="Enter")hideIfOwner$$module$build$src$core$widgetdiv(this), +hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Escape")this.setValue(this.htmlInput_.getAttribute("data-untyped-default-value"),!1),hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv();else if(a.key==="Tab"){a.preventDefault();var b,c=(b=this.workspace_)==null?void 0:b.getCursor();b=d=>(d instanceof FieldInput$$module$build$src$core$field_input||d instanceof BlockSvg$$module$build$src$core$block_svg&&d.isSimpleReporter())&& +d!==this.getSourceBlock();a=a.shiftKey?c==null?void 0:c.getPreviousNode(this,b,!1):c==null?void 0:c.getNextNode(this,b,!1);a=a instanceof BlockSvg$$module$build$src$core$block_svg&&a.isSimpleReporter()?a.getFields().next().value:a;a instanceof FieldInput$$module$build$src$core$field_input&&(hideIfOwner$$module$build$src$core$widgetdiv(this),hideWithoutAnimation$$module$build$src$core$dropdowndiv(),c=a.getSourceBlock(),a.isFullBlockField()&&c&&c instanceof BlockSvg$$module$build$src$core$block_svg? +$.getFocusManager$$module$build$src$core$focus_manager().focusNode(c):$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a),a.showEditor())}}onHtmlInputChange(a){a=this.value_;this.setValue(this.getValueFromEditorText_(this.htmlInput_.value),!1);this.sourceBlock_&&isEnabled$$module$build$src$core$events$utils()&&this.value_!==a&&fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE))(this.sourceBlock_, +this.name||null,a,this.value_))}setEditorValue_(a,b=!0){this.isDirty_=!0;this.isBeingEdited_&&(this.htmlInput_.value=this.getEditorText_(a));this.setValue(a,b)}resizeEditor_(){finishQueuedRenders$$module$build$src$core$render_management().then(()=>{const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;const b=getDiv$$module$build$src$core$widgetdiv(),c=this.getScaledBBox();b.style.width=c.right-c.left+"px";b.style.height=c.bottom-c.top+"px";const d=c.top; +b.style.left=`${a.RTL?c.right-b.offsetWidth:c.left}px`;b.style.top=`${d}px`})}repositionForWindowResize(){let a;const b=(a=this.getSourceBlock())==null?void 0:a.getRootBlock();if(!(b instanceof BlockSvg$$module$build$src$core$block_svg))return!1;bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace_,this.workspace_.getMetricsManager().getViewMetrics(!0),b)||this.resizeEditor_();return!0}positionTextElement_(a,b){const c=a*2+b;super.positionTextElement_(a+(c0;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?b instanceof EndRowInput$$module$build$src$core$inputs$end_row_input|| +a instanceof StatementInput$$module$build$src$core$inputs$statement_input||b instanceof StatementInput$$module$build$src$core$inputs$statement_input?!0:a instanceof $.ValueInput$$module$build$src$core$inputs$value_input||a instanceof DummyInput$$module$build$src$core$inputs$dummy_input||a instanceof EndRowInput$$module$build$src$core$inputs$end_row_input?!this.isInline||this.isMultiRow:!1:!1}getDesiredRowWidth_(a){return a.hasStatement?this.width-this.startX-(this.constants_.INSIDE_CORNERS.rightWidth|| +0):super.getDesiredRowWidth_(a)}getInRowSpacing_(a,b){return a&&b||!this.outputConnection||!this.outputConnection.isDynamicShape||this.hasStatementInput||this.bottomRow.hasNextConnection?!a&&b&&Types$$module$build$src$core$renderers$measurables$types.isStatementInput(b)?this.constants_.STATEMENT_INPUT_PADDING_LEFT:a&&Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(a)&&b&&(Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(b)||Types$$module$build$src$core$renderers$measurables$types.isNextConnection(b))? +b.notchOffset-this.constants_.CORNER_RADIUS:a&&Types$$module$build$src$core$renderers$measurables$types.isLeftSquareCorner(a)&&b&&Types$$module$build$src$core$renderers$measurables$types.isHat(b)||a&&Types$$module$build$src$core$renderers$measurables$types.isField(a)&&a.width===0?this.constants_.NO_PADDING:this.constants_.MEDIUM_PADDING:this.constants_.NO_PADDING}getSpacerRowHeight_(a,b){if(Types$$module$build$src$core$renderers$measurables$types.isTopRow(a)&&Types$$module$build$src$core$renderers$measurables$types.isBottomRow(b))return this.constants_.EMPTY_BLOCK_SPACER_HEIGHT; +const c=Types$$module$build$src$core$renderers$measurables$types.isInputRow(a)&&a.hasStatement,d=Types$$module$build$src$core$renderers$measurables$types.isInputRow(b)&&b.hasStatement;return d||c?(a=Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.INSIDE_CORNERS.rightHeight||0),d&&c?Math.max(a,this.constants_.DUMMY_INPUT_MIN_HEIGHT):a):Types$$module$build$src$core$renderers$measurables$types.isTopRow(a)?a.hasPreviousConnection||this.outputConnection&&!this.hasStatementInput?this.constants_.NO_PADDING: +Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):Types$$module$build$src$core$renderers$measurables$types.isBottomRow(b)?this.outputConnection?!b.hasNextConnection&&this.hasStatementInput?Math.abs(this.constants_.NOTCH_HEIGHT-this.constants_.CORNER_RADIUS):this.constants_.NO_PADDING:Math.max(this.topRow.minHeight,Math.max(this.constants_.NOTCH_HEIGHT,this.constants_.CORNER_RADIUS))-this.constants_.CORNER_RADIUS:this.constants_.MEDIUM_PADDING}getSpacerRowWidth_(a,b){const c=this.width- +this.startX;return Types$$module$build$src$core$renderers$measurables$types.isInputRow(a)&&a.hasStatement||Types$$module$build$src$core$renderers$measurables$types.isInputRow(b)&&b.hasStatement?Math.max(c,this.constants_.STATEMENT_INPUT_SPACER_MIN_WIDTH):c}getElemCenterline_(a,b){if(a.hasStatement&&!Types$$module$build$src$core$renderers$measurables$types.isSpacer(b)&&!Types$$module$build$src$core$renderers$measurables$types.isStatementInput(b))return a.yPos+this.constants_.EMPTY_STATEMENT_INPUT_HEIGHT/ +2;if(Types$$module$build$src$core$renderers$measurables$types.isInlineInput(b)){const c=b.connectedBlock;if(c&&c.outputConnection&&c.nextConnection)return a.yPos+c.height/2}return super.getElemCenterline_(a,b)}addInput_(a,b){if((a instanceof DummyInput$$module$build$src$core$inputs$dummy_input||a instanceof EndRowInput$$module$build$src$core$inputs$end_row_input)&&b.hasDummyInput&&b.align===$.Align$$module$build$src$core$inputs$align.LEFT&&a.align===$.Align$$module$build$src$core$inputs$align.RIGHT)this.rightAlignedDummyInputs.set(b, +a);else if(a instanceof StatementInput$$module$build$src$core$inputs$statement_input){b.elements.push(new StatementInput$$module$build$src$core$renderers$zelos$measurables$inputs(this.constants_,a));b.hasStatement=!0;b.align===null&&(b.align=a.align);return}super.addInput_(a,b)}addAlignmentPadding_(a,b){if(this.rightAlignedDummyInputs.get(a)){let c;for(let d=0;d=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!d.precedesStatement;if(Types$$module$build$src$core$renderers$measurables$types.isInputRow(f)&& +f.hasStatement){f.measure();let g,h;b=f.width-((h=(g=f.getLastInput())==null?void 0:g.width)!=null?h:0)+a}else if(c&&(e===2||d)&&Types$$module$build$src$core$renderers$measurables$types.isInputRow(f)&&!f.hasStatement){d=f.xPos;c=null;for(let g=0;g1)switch(c){case d.SHAPES.ROUND:return c=this.constants_.MAX_DYNAMIC_CONNECTION_SHAPE_WIDTH,c=this.height/2>c?c:this.height/2,b-c*(1-Math.sin(Math.acos((c-this.constants_.SMALL_PADDING)/c)));default:return 0}if(Types$$module$build$src$core$renderers$measurables$types.isInlineInput(a)){const e=a.connectedBlock;a= +e?e.pathObject.outputShapeType:a.shape.type;return a==null||e&&e.outputConnection&&(e.statementInputCount||e.nextConnection)||c===d.SHAPES.HEXAGONAL&&c!==a?0:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][a]}return Types$$module$build$src$core$renderers$measurables$types.isField(a)?c===d.SHAPES.ROUND&&a.field instanceof $.FieldTextInput$$module$build$src$core$field_textinput?b-2.75*d.GRID_UNIT:b-this.constants_.SHAPE_IN_SHAPE_PADDING[c][0]:Types$$module$build$src$core$renderers$measurables$types.isIcon(a)? +this.constants_.SMALL_PADDING:0}finalizeVerticalAlignment_(){if(!this.outputConnection)for(let d=2;d=this.rows.length-1?!!this.bottomRow.hasNextConnection:!!g.precedesStatement;if(a?this.topRow.hasPreviousConnection:e.followsStatement){var c=f.elements[1];c=f.elements.length===3&&c instanceof Field$$module$build$src$core$renderers$measurables$field&&(c.field instanceof FieldLabel$$module$build$src$core$field_label|| +c.field instanceof FieldImage$$module$build$src$core$field_image);if(!a&&c)e.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.SMALL_PADDING,f.height-=this.constants_.MEDIUM_PADDING;else if(!a&&!b)e.height+=this.constants_.SMALL_PADDING;else if(b){a=!1;for(b=0;b=40){a=!0;break}a&& +(e.height-=this.constants_.SMALL_PADDING,g.height-=this.constants_.SMALL_PADDING)}}}}finalize_(){this.finalizeOutputConnection_();this.finalizeHorizontalAlignment_();this.finalizeVerticalAlignment_();super.finalize_();this.rightSide&&(this.widthWithChildren+=this.rightSide.width)}},module$build$src$core$renderers$zelos$info={};module$build$src$core$renderers$zelos$info.RenderInfo=RenderInfo$$module$build$src$core$renderers$zelos$info;var PathObject$$module$build$src$core$renderers$zelos$path_object=class extends PathObject$$module$build$src$core$renderers$common$path_object{constructor(a,b,c){super(a,b,c);this.svgPathSelected=null;this.outlines=new Map;this.remainingOutlines=new Set;this.outputShapeType=null;this.constants=c}setPath(a){super.setPath(a);this.svgPathSelected&&this.svgPathSelected.setAttribute("d",a)}applyColour(a){super.applyColour(a);const b=a.getParent();a.isShadow()&&b&&this.svgPath.setAttribute("stroke",b.getColourTertiary()); +for(const c of this.outlines.values())c.setAttribute("fill",this.style.colourTertiary)}flipRTL(){super.flipRTL();for(const a of this.outlines.values())a.setAttribute("transform","scale(-1 1)")}updateSelected(a){this.setClass_("blocklySelected",a);a?this.svgPathSelected||(this.svgPathSelected=this.svgPath.cloneNode(!0),this.svgPathSelected.classList.add("blocklyPathSelected"),removeClass$$module$build$src$core$utils$dom(this.svgPathSelected,FocusManager$$module$build$src$core$focus_manager.ACTIVE_FOCUS_NODE_CSS_CLASS_NAME), +removeClass$$module$build$src$core$utils$dom(this.svgPathSelected,FocusManager$$module$build$src$core$focus_manager.PASSIVE_FOCUS_NODE_CSS_CLASS_NAME),this.svgPathSelected.removeAttribute("tabindex"),this.svgPathSelected.removeAttribute("id"),this.svgRoot.appendChild(this.svgPathSelected)):this.svgPathSelected&&(this.svgRoot.removeChild(this.svgPathSelected),this.svgPathSelected=null)}updateReplacementFade(a){this.setClass_("blocklyReplaceable",a)}updateShapeForInputHighlight(a,b){a=a.getParentInput().name; +(a=this.getOutlinePath(a))&&(b?a.setAttribute("filter","url(#"+this.constants.replacementGlowFilterId+")"):a.removeAttribute("filter"))}beginDrawing(){this.remainingOutlines.clear();for(const a of this.outlines.keys())this.remainingOutlines.add(a)}endDrawing(){if(this.remainingOutlines.size)for(const a of this.remainingOutlines)this.removeOutlinePath(a);this.remainingOutlines.clear()}setOutlinePath(a,b){a=this.getOutlinePath(a);a.setAttribute("d",b);a.setAttribute("fill",this.style.colourTertiary)}getOutlinePath(a){this.outlines.has(a)|| +this.outlines.set(a,createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyOutlinePath",d:""},this.svgRoot));this.remainingOutlines.delete(a);return this.outlines.get(a)}removeOutlinePath(a){let b,c;(b=this.outlines.get(a))==null||(c=b.parentNode)==null||c.removeChild(this.outlines.get(a));this.outlines.delete(a)}},module$build$src$core$renderers$zelos$path_object={};module$build$src$core$renderers$zelos$path_object.PathObject=PathObject$$module$build$src$core$renderers$zelos$path_object;var Renderer$$module$build$src$core$renderers$zelos$renderer=class extends Renderer$$module$build$src$core$renderers$common$renderer{constructor(a){super(a)}makeConstants_(){return new ConstantProvider$$module$build$src$core$renderers$zelos$constants}makeRenderInfo_(a){return new RenderInfo$$module$build$src$core$renderers$zelos$info(this,a)}makeDrawer_(a,b){return new Drawer$$module$build$src$core$renderers$zelos$drawer(a,b)}makePathObject(a,b){return new PathObject$$module$build$src$core$renderers$zelos$path_object(a, +b,this.getConstants())}getConstants(){return this.constants_}};register$$module$build$src$core$renderers$common$block_rendering("zelos",Renderer$$module$build$src$core$renderers$zelos$renderer);var module$build$src$core$renderers$zelos$renderer={};module$build$src$core$renderers$zelos$renderer.Renderer=Renderer$$module$build$src$core$renderers$zelos$renderer;var InsertionMarkerPreviewer$$module$build$src$core$insertion_marker_previewer=class{constructor(a){this.staticConn=this.draggedConn=this.markerConn=this.fadedBlock=null;this.workspace=a.workspace}previewReplacement(a,b,c){$.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.fadedBlock=c,c.fadeForReplacement(!0),this.workspace.getRenderer().shouldHighlightConnection(b)&&(b.highlight(),this.staticConn=b)}finally{$.enable$$module$build$src$core$events$utils()}}previewConnection(a, +b){if(a!==this.draggedConn||b!==this.staticConn){$.disable$$module$build$src$core$events$utils();try{this.hidePreview(),this.shouldUseMarkerPreview(a,b)&&(this.markerConn=this.previewMarker(a,b)),this.workspace.getRenderer().shouldHighlightConnection(b)&&b.highlight(),this.draggedConn=a,this.staticConn=b}finally{$.enable$$module$build$src$core$events$utils()}}}shouldUseMarkerPreview(a,b){return b.type===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT||b.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT|| +!(this.workspace.getRenderer()instanceof Renderer$$module$build$src$core$renderers$zelos$renderer)}previewMarker(a,b){const c=a.getSourceBlock(),d=this.createInsertionMarker(c),e=this.getMatchingConnection(c,d,a);if(!e)return null;d.queueRender();triggerQueuedRenders$$module$build$src$core$render_management();e.connect(b);const f={x:b.x-e.x,y:b.y-e.y},g=e.getOffsetInBlock().clone();finishQueuedRenders$$module$build$src$core$render_management().then(()=>{if(!d.isDeadOrDying()){$.disable$$module$build$src$core$events$utils(); +try{d==null||d.positionNearConnection(e,f,g),d==null||d.getSvgRoot().setAttribute("visibility","visible")}finally{$.enable$$module$build$src$core$events$utils()}}});return e}serializeBlockToInsertionMarker(a){const b=save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!1,addInputBlocks:!1,addNextBlocks:!1,doFullSerialization:!1});if(!b)throw Error(`Failed to serialize source block. ${a.toDevString()}`);return b}createInsertionMarker(a){a=this.serializeBlockToInsertionMarker(a);a=append$$module$build$src$core$serialization$blocks(a, +this.workspace);for(const b of a.getDescendants(!1))b.setInsertionMarker(!0);a.initSvg();a.getSvgRoot().setAttribute("visibility","hidden");return a}getMatchingConnection(a,b,c){a=a.getConnections_(!0);b=b.getConnections_(!0);if(a.length!==b.length)return null;for(let d=0;d-b||a<-180+b||a>180-b?!0:!1}getClientRect(){if(!this.svgGroup_||this.autoClose||!this.isVisible())return null;const a=this.svgGroup_.getBoundingClientRect(),b=a.left;return this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.LEFT?new Rect$$module$build$src$core$utils$rect(-1E9,1E9,-1E9,b+a.width):new Rect$$module$build$src$core$utils$rect(-1E9,1E9,b,1E9)}reflowInternal_(){this.workspace_.scale=this.getFlyoutScale(); +let a=this.getContents().reduce((b,c)=>Math.max(b,c.getElement().getBoundingRectangle().getWidth()),0);a+=this.MARGIN*1.5+this.tabWidth_;a*=this.workspace_.scale;a+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness;if(this.getWidth()!==a){if(this.RTL)for(const b of this.getContents()){const c=b.getElement().getBoundingRectangle().left,d=a/this.workspace_.scale-b.getElement().getBoundingRectangle().getWidth()-this.MARGIN-this.tabWidth_;b.getElement().moveBy(d-c,0)}this.targetWorkspace.scrollbar|| +this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Position$$module$build$src$core$utils$toolbox.LEFT||this.targetWorkspace.translate(this.targetWorkspace.scrollX+a,this.targetWorkspace.scrollY);this.width_=a;this.position();this.targetWorkspace.resizeContents();this.targetWorkspace.recordDragTargets()}}};VerticalFlyout$$module$build$src$core$flyout_vertical.registryName="verticalFlyout"; +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,DEFAULT$$module$build$src$core$registry,VerticalFlyout$$module$build$src$core$flyout_vertical);var module$build$src$core$flyout_vertical={};module$build$src$core$flyout_vertical.VerticalFlyout=VerticalFlyout$$module$build$src$core$flyout_vertical;var HorizontalFlyout$$module$build$src$core$flyout_horizontal=class extends Flyout$$module$build$src$core$flyout_base{constructor(a){super(a);this.horizontalLayout=!0}setMetrics_(a){if(this.isVisible()){var b=this.workspace_.getMetricsManager(),c=b.getScrollMetrics(),d=b.getViewMetrics();b=b.getAbsoluteMetrics();typeof a.x==="number"&&(this.workspace_.scrollX=-(c.left+(c.width-d.width)*a.x));this.workspace_.translate(this.workspace_.scrollX+b.left,this.workspace_.scrollY+b.top)}}getX(){return 0}getY(){if(!this.isVisible())return 0; +var a=this.targetWorkspace.getMetricsManager();const b=a.getAbsoluteMetrics(),c=a.getViewMetrics();a=a.getToolboxMetrics();const d=this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.TOP;return this.targetWorkspace.toolboxPosition===this.toolboxPosition_?this.targetWorkspace.getToolbox()?d?a.height:c.height-this.getHeight():d?0:c.height:d?0:c.height+b.top-this.getHeight()}position(){if(this.isVisible()&&this.targetWorkspace.isVisible()){var a=this.targetWorkspace.getMetricsManager().getViewMetrics(); +this.width_=a.width;a=a.width-2*this.CORNER_RADIUS;var b=this.getHeight()-this.CORNER_RADIUS;this.setBackgroundPath(a,b);a=this.getX();b=this.getY();this.positionAt_(this.getWidth(),this.getHeight(),a,b)}}setBackgroundPath(a,b){const c=this.toolboxPosition_===Position$$module$build$src$core$utils$toolbox.TOP,d=["M 0,"+(c?0:this.CORNER_RADIUS)];c?(d.push("h",a+2*this.CORNER_RADIUS),d.push("v",b),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,this.CORNER_RADIUS),d.push("h", +-a),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,-this.CORNER_RADIUS,-this.CORNER_RADIUS)):(d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,-this.CORNER_RADIUS),d.push("h",a),d.push("a",this.CORNER_RADIUS,this.CORNER_RADIUS,0,0,1,this.CORNER_RADIUS,this.CORNER_RADIUS),d.push("v",b),d.push("h",-a-2*this.CORNER_RADIUS));d.push("z");this.svgBackground_.setAttribute("d",d.join(" "))}scrollToStart(){let a;(a=this.workspace_.scrollbar)==null||a.setX(this.RTL?Infinity: +0)}wheel_(a){var b=getScrollDeltaPixels$$module$build$src$core$browser_events(a);if(b=b.x||b.y){const c=this.workspace_.getMetricsManager(),d=c.getScrollMetrics();b=c.getViewMetrics().left-d.left+b;let e;(e=this.workspace_.scrollbar)==null||e.setX(b);hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv(this.workspace_);hideWithoutAnimation$$module$build$src$core$dropdowndiv()}a.preventDefault();a.stopPropagation()}layout_(a){this.workspace_.scale=this.targetWorkspace.scale;const b=this.MARGIN; +let c=b+this.tabWidth_;this.RTL&&(a=a.reverse());for(const d of a)a=d.getElement().getBoundingRectangle(),a=this.RTL?c+a.getWidth():c,d.getElement().moveBy(a,b),c+=d.getElement().getBoundingRectangle().getWidth()}isDragTowardWorkspace(a){a=Math.atan2(a.y,a.x)/Math.PI*180;const b=this.dragAngleRange_;return a<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=this.getContents().reduce((b,c)=>Math.max(b,c.getElement().getBoundingRectangle().getHeight()),0);a+=this.MARGIN*1.5;a*=this.workspace_.scale;a+=Scrollbar$$module$build$src$core$scrollbar.scrollbarThickness;this.getHeight()!==a&&(this.targetWorkspace.scrollbar|| +this.autoClose||this.targetWorkspace.getFlyout()!==this||this.toolboxPosition_!==Position$$module$build$src$core$utils$toolbox.TOP||this.targetWorkspace.translate(this.targetWorkspace.scrollX,this.targetWorkspace.scrollY+a),this.height_=a,this.position(),this.targetWorkspace.resizeContents(),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=typeof a==="string"?a:"";this.size_=new Size$$module$build$src$core$utils$size(0,0);a!==Field$$module$build$src$core$field.SKIP_SETUP&& +(e?this.configure_(e):this.setTypes(c,d),b&&this.setValidator(b))}configure_(a){super.configure_(a);this.setTypes(a.variableTypes,a.defaultType)}initModel(){var a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;this.variable||(a=$.getOrCreateVariablePackage$$module$build$src$core$variables(a.workspace,null,this.defaultVariableName,this.defaultType),this.doValueUpdate_(a.getId()))}initView(){super.initView();addClass$$module$build$src$core$utils$dom(this.fieldGroup_, +"blocklyVariableField")}shouldAddBorderRect_(){const a=this.getSourceBlock();if(!a)throw new UnattachedFieldError$$module$build$src$core$field;return super.shouldAddBorderRect_()&&(!this.getConstants().FIELD_DROPDOWN_NO_BORDER_RECT_SHADOW||a.type!=="variables_get")}fromXml(a){var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;const c=a.getAttribute("id"),d=a.textContent,e=a.getAttribute("variabletype")||a.getAttribute("variableType")||"";b=$.getOrCreateVariablePackage$$module$build$src$core$variables(b.workspace, +c,d,e);if(e!==null&&e!==b.getType())throw Error("Serialized variable type with id '"+b.getId()+"' had type "+b.getType()+", 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=this.variable.getName();this.variable.getType()&&a.setAttribute("variabletype",this.variable.getType());return a}saveState(a){var b=this.saveLegacyState(FieldVariable$$module$build$src$core$field_variable); +if(b!==null)return b;this.initModel();b={id:this.variable.getId()};a&&(b.name=this.variable.getName(),b.type=this.variable.getType());return b}loadState(a){const b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.loadLegacyState(FieldVariable$$module$build$src$core$field_variable,a)||(a=$.getOrCreateVariablePackage$$module$build$src$core$variables(b.workspace,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.getName():""}getVariable(){return this.variable}getDefaultType(){return this.defaultType}getValidator(){return this.variable?this.validator_:null}doClassValidation_(a){if(a===null)return null;var b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;b=$.getVariable$$module$build$src$core$variables(b.workspace,a);if(!b)return console.warn("Variable id doesn't point to a real variable! ID was "+ +a),null;b=b.getType();return this.typeIsAllowed(b)?a:(console.warn("Variable type doesn't match this field! Type was "+b),null)}doValueUpdate_(a){const b=this.getSourceBlock();if(!b)throw new UnattachedFieldError$$module$build$src$core$field;this.variable=$.getVariable$$module$build$src$core$variables(b.workspace,a);super.doValueUpdate_(a)}typeIsAllowed(a){const b=this.getVariableTypes();if(!b)return!0;for(let c=0;c-Infinity&&(a.min=`${this.min_}`,setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.VALUEMIN,this.min_));this.max_c.isInFlyout=!0);this.addBlockListeners(a);return new FlyoutItem$$module$build$src$core$flyout_item(a,BLOCK_TYPE$$module$build$src$core$block_flyout_inflater)}createBlock(a,b){a.blockxml?(a=typeof a.blockxml==="string"?$.textToDom$$module$build$src$core$utils$xml(a.blockxml):a.blockxml,b=domToBlockInternal$$module$build$src$core$xml(a,b)):(a.enabled===void 0&&(a.enabled=a.disabled!=="true"&&a.disabled!==!0),a.disabledReasons=== +void 0&&a.enabled===!1&&(a.disabledReasons=[MANUALLY_DISABLED$$module$build$src$core$constants]),"x"in a&&delete a.x,"y"in a&&delete a.y,b=appendInternal$$module$build$src$core$serialization$blocks(a,b));return b}gapForItem(a,b){let c;a.gap?c=parseInt(String(a.gap)):a.blockxml&&(a=typeof a.blockxml==="string"?$.textToDom$$module$build$src$core$utils$xml(a.blockxml):a.blockxml,c=parseInt(a.getAttribute("gap")));return!c||isNaN(c)?b:c}disposeItem(a){a=a.getElement();a instanceof BlockSvg$$module$build$src$core$block_svg&& +(this.removeListeners(a.id),a.dispose(!1,!1))}removeListeners(a){let b;((b=this.listeners.get(a))!=null?b:[]).forEach(c=>unbind$$module$build$src$core$browser_events(c));this.listeners.delete(a)}setFlyout(a){if(this.flyout!==a){if(this.flyout){let c;(c=this.flyout.targetWorkspace)==null||c.removeChangeListener(this.capacityWrapper)}this.flyout=a;var b;(b=this.flyout.targetWorkspace)==null||b.addChangeListener(this.capacityWrapper)}}updateStateBasedOnCapacity(a){let b,c;const d=(b=this.flyout)==null? +void 0:(c=b.targetWorkspace)==null?void 0:c.isCapacityAvailable(getBlockTypeCounts$$module$build$src$core$common(a));for(;a;)a.setDisabledReason(!d,WORKSPACE_AT_BLOCK_CAPACITY_DISABLED_REASON$$module$build$src$core$block_flyout_inflater),a=a.getNextBlock()}addBlockListeners(a){const b=[];b.push(conditionalBind$$module$build$src$core$browser_events(a.getSvgRoot(),"pointerdown",a,c=>{let d,e;const f=(d=this.flyout)==null?void 0:(e=d.targetWorkspace)==null?void 0:e.getGesture(c);f&&this.flyout&&(f.setStartBlock(a), +f.handleFlyoutStart(c,this.flyout))}));b.push(bind$$module$build$src$core$browser_events(a.getSvgRoot(),"pointermove",null,()=>{let c,d;((c=this.flyout)==null?0:(d=c.targetWorkspace)==null?0:d.isDragging())||a.addSelect()}));b.push(bind$$module$build$src$core$browser_events(a.getSvgRoot(),"pointerleave",null,()=>{let c,d;((c=this.flyout)==null?0:(d=c.targetWorkspace)==null?0:d.isDragging())||a.removeSelect()}));this.listeners.set(a.id,b)}filterFlyoutBasedOnCapacity(a){!this.flyout||a&&a.type!==EventType$$module$build$src$core$events$type.BLOCK_CREATE&& +a.type!==EventType$$module$build$src$core$events$type.BLOCK_DELETE||this.flyout.getWorkspace().getTopBlocks(!1).forEach(b=>{this.permanentlyDisabledBlocks.has(b)||this.updateStateBasedOnCapacity(b)})}getType(){return BLOCK_TYPE$$module$build$src$core$block_flyout_inflater}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,BLOCK_TYPE$$module$build$src$core$block_flyout_inflater,BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater); +var module$build$src$core$block_flyout_inflater={};module$build$src$core$block_flyout_inflater.BlockFlyoutInflater=BlockFlyoutInflater$$module$build$src$core$block_flyout_inflater;var module$build$src$core$interfaces$i_paster={};module$build$src$core$interfaces$i_paster.isPaster=isPaster$$module$build$src$core$interfaces$i_paster;var module$build$src$core$interfaces$i_rendered_element={};module$build$src$core$interfaces$i_rendered_element.isRenderedElement=isRenderedElement$$module$build$src$core$interfaces$i_rendered_element;var ConstantProvider$$module$build$src$core$renderers$geras$constants=class extends ConstantProvider$$module$build$src$core$renderers$common$constants{constructor(){super();this.FIELD_TEXT_BASELINE_CENTER=!1;this.DARK_PATH_OFFSET=1;this.MAX_BOTTOM_WIDTH=30;this.STATEMENT_BOTTOM_SPACER=-this.NOTCH_HEIGHT/2}getCSS_(a){return super.getCSS_(a).concat([`${a} .blocklyInsertionMarker>.blocklyPathLight,`,`${a} .blocklyInsertionMarker>.blocklyPathDark {`,`fill-opacity: ${this.INSERTION_MARKER_OPACITY};`,"stroke: none;", +"}"])}},module$build$src$core$renderers$geras$constants={};module$build$src$core$renderers$geras$constants.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$geras$constants;var Highlighter$$module$build$src$core$renderers$geras$highlighter=class{constructor(a){this.inlineSteps_=this.steps_="";this.info_=a;this.RTL_=this.info_.RTL;a=a.getRenderer();this.constants_=a.getConstants();this.highlightConstants_=a.getHighlightConstants();this.highlightOffset=this.highlightConstants_.OFFSET;this.outsideCornerPaths_=this.highlightConstants_.OUTSIDE_CORNER;this.insideCornerPaths_=this.highlightConstants_.INSIDE_CORNER;this.puzzleTabPaths_=this.highlightConstants_.PUZZLE_TAB;this.notchPaths_= +this.highlightConstants_.NOTCH;this.startPaths_=this.highlightConstants_.START_HAT;this.jaggedTeethPaths_=this.highlightConstants_.JAGGED_TEETH}getPath(){return this.steps_+"\n"+this.inlineSteps_}drawTopCorner(a){this.steps_+=moveBy$$module$build$src$core$utils$svg_paths(a.xPos,this.info_.startY);for(let b=0,c;c=a.elements[b];b++)Types$$module$build$src$core$renderers$measurables$types.isLeftSquareCorner(c)?this.steps_+=this.highlightConstants_.START_POINT:Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(c)? +this.steps_+=this.outsideCornerPaths_.topLeft(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isPreviousConnection(c)?this.steps_+=this.notchPaths_.pathLeft:Types$$module$build$src$core$renderers$measurables$types.isHat(c)?this.steps_+=this.startPaths_.path(this.RTL_):Types$$module$build$src$core$renderers$measurables$types.isSpacer(c)&&c.width!==0&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",c.xPos+c.width-this.highlightOffset));this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H", +a.xPos+a.width-this.highlightOffset)}drawJaggedEdge_(a){this.info_.RTL&&(this.steps_+=this.jaggedTeethPaths_.pathLeft+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a.height-this.jaggedTeethPaths_.height-this.highlightOffset))}drawValueInput(a){const b=a.getLastInput();if(this.RTL_){const c=a.height-b.connectionHeight;this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(b.xPos+b.width-this.highlightOffset,a.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)+lineOnAxis$$module$build$src$core$utils$svg_paths("v", +c)}else this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(b.xPos+b.width,a.yPos)+this.puzzleTabPaths_.pathDown(this.RTL_)}drawStatementInput(a){const b=a.getLastInput();if(b)if(this.RTL_){const c=a.height-2*this.insideCornerPaths_.height;this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(b.xPos,a.yPos)+this.insideCornerPaths_.pathTop(this.RTL_)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",c)+this.insideCornerPaths_.pathBottom(this.RTL_)+lineTo$$module$build$src$core$utils$svg_paths(a.width- +b.xPos-this.insideCornerPaths_.width,0)}else this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(b.xPos,a.yPos+a.height)+this.insideCornerPaths_.pathBottom(this.RTL_)+lineTo$$module$build$src$core$utils$svg_paths(a.width-b.xPos-this.insideCornerPaths_.width,0)}drawRightSideRow(a){const b=a.xPos+a.width-this.highlightOffset;a instanceof SpacerRow$$module$build$src$core$renderers$measurables$spacer_row&&a.followsStatement&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",b)); +this.RTL_&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",b),a.height>this.highlightOffset&&(this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.yPos+a.height-this.highlightOffset)))}drawBottomRow(a){if(this.RTL_)this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.baseline-this.highlightOffset);else{const b=this.info_.bottomRow.elements[0];Types$$module$build$src$core$renderers$measurables$types.isLeftSquareCorner(b)?this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(a.xPos+ +this.highlightOffset,a.baseline-this.highlightOffset):Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(b)&&(this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(a.xPos,a.baseline),this.steps_+=this.outsideCornerPaths_.bottomLeft())}}drawLeft(){var a=this.info_.outputConnection;a&&(a=a.connectionOffsetY+a.height,this.RTL_?this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(this.info_.startX,a):(this.steps_+=moveTo$$module$build$src$core$utils$svg_paths(this.info_.startX+ +this.highlightOffset,this.info_.bottomRow.baseline-this.highlightOffset),this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a)),this.steps_+=this.puzzleTabPaths_.pathUp(this.RTL_));this.RTL_||(a=this.info_.topRow,Types$$module$build$src$core$renderers$measurables$types.isLeftRoundedCorner(a.elements[0])?this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",this.outsideCornerPaths_.height):this.steps_+=lineOnAxis$$module$build$src$core$utils$svg_paths("V",a.capline+this.highlightOffset))}drawInlineInput(a){const b= +this.highlightOffset,c=a.xPos+a.connectionWidth;var d=a.centerline-a.height/2;const e=a.width-a.connectionWidth,f=d+b;this.RTL_?(d=a.connectionOffsetY-b,a=a.height-(a.connectionOffsetY+a.connectionHeight)+b,this.inlineSteps_+=moveTo$$module$build$src$core$utils$svg_paths(c-b,f)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",d)+this.puzzleTabPaths_.pathDown(this.RTL_)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a)+lineOnAxis$$module$build$src$core$utils$svg_paths("h",e)):this.inlineSteps_+= +moveTo$$module$build$src$core$utils$svg_paths(a.xPos+a.width+b,f)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",a.height)+lineOnAxis$$module$build$src$core$utils$svg_paths("h",-e)+moveTo$$module$build$src$core$utils$svg_paths(c,d+a.connectionOffsetY)+this.puzzleTabPaths_.pathDown(this.RTL_)}},module$build$src$core$renderers$geras$highlighter={};module$build$src$core$renderers$geras$highlighter.Highlighter=Highlighter$$module$build$src$core$renderers$geras$highlighter;var Drawer$$module$build$src$core$renderers$geras$drawer=class extends Drawer$$module$build$src$core$renderers$common$drawer{constructor(a,b){super(a,b);this.highlighter_=new Highlighter$$module$build$src$core$renderers$geras$highlighter(b)}draw(){this.drawOutline_();this.drawInternals_();this.updateConnectionHighlights();const a=this.block_.pathObject;a.setPath(this.outlinePath_+"\n"+this.inlinePath_);a.setHighlightPath(this.highlighter_.getPath());this.info_.RTL&&a.flipRTL();this.recordSizeOnBlock_()}drawTop_(){this.highlighter_.drawTopCorner(this.info_.topRow); +this.highlighter_.drawRightSideRow(this.info_.topRow);super.drawTop_()}drawJaggedEdge_(a){this.highlighter_.drawJaggedEdge_(a);super.drawJaggedEdge_(a)}drawValueInput_(a){this.highlighter_.drawValueInput(a);super.drawValueInput_(a)}drawStatementInput_(a){this.highlighter_.drawStatementInput(a);super.drawStatementInput_(a)}drawRightSideRow_(a){this.highlighter_.drawRightSideRow(a);this.outlinePath_+=lineOnAxis$$module$build$src$core$utils$svg_paths("H",a.xPos+a.width)+lineOnAxis$$module$build$src$core$utils$svg_paths("V", +a.yPos+a.height)}drawBottom_(){this.highlighter_.drawBottomRow(this.info_.bottomRow);super.drawBottom_()}drawLeft_(){this.highlighter_.drawLeft();super.drawLeft_()}drawInlineInput_(a){this.highlighter_.drawInlineInput(a);super.drawInlineInput_(a)}positionInlineInputConnection_(a){const b=a.centerline-a.height/2;if(a.connectionModel){let c=a.xPos+a.connectionWidth+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(c*=-1);a.connectionModel.setOffsetInBlock(c,b+a.connectionOffsetY+this.constants_.DARK_PATH_OFFSET)}}positionStatementInputConnection_(a){const b= +a.getLastInput();if(b==null?0:b.connectionModel){let c=a.xPos+a.statementEdge+b.notchOffset;c=this.info_.RTL?c*-1:c+this.constants_.DARK_PATH_OFFSET;b.connectionModel.setOffsetInBlock(c,a.yPos+this.constants_.DARK_PATH_OFFSET)}}positionExternalValueConnection_(a){const b=a.getLastInput();if(b&&b.connectionModel){let c=a.xPos+a.width+this.constants_.DARK_PATH_OFFSET;this.info_.RTL&&(c*=-1);b.connectionModel.setOffsetInBlock(c,a.yPos)}}positionNextConnection_(){const a=this.info_.bottomRow;if(a.connection){const b= +a.connection,c=b.xPos;b.connectionModel.setOffsetInBlock((this.info_.RTL?-c:c)+this.constants_.DARK_PATH_OFFSET/2,a.baseline+this.constants_.DARK_PATH_OFFSET)}}},module$build$src$core$renderers$geras$drawer={};module$build$src$core$renderers$geras$drawer.Drawer=Drawer$$module$build$src$core$renderers$geras$drawer;var HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight_constants=class{constructor(a){this.OFFSET=.5;this.constantProvider=a;this.START_POINT=moveBy$$module$build$src$core$utils$svg_paths(this.OFFSET,this.OFFSET)}init(){this.INSIDE_CORNER=this.makeInsideCorner();this.OUTSIDE_CORNER=this.makeOutsideCorner();this.PUZZLE_TAB=this.makePuzzleTab();this.NOTCH=this.makeNotch();this.JAGGED_TEETH=this.makeJaggedTeeth();this.START_HAT=this.makeStartHat()}makeInsideCorner(){const a=this.constantProvider.CORNER_RADIUS, +b=this.OFFSET,c=(1-Math.SQRT1_2)*(a+b)-b,d=moveBy$$module$build$src$core$utils$svg_paths(c,c)+arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a,point$$module$build$src$core$utils$svg_paths(-c-b,a-c)),e=arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a+b,point$$module$build$src$core$utils$svg_paths(a+b,a+b)),f=moveBy$$module$build$src$core$utils$svg_paths(c,-c)+arc$$module$build$src$core$utils$svg_paths("a","0 0,0",a+b,point$$module$build$src$core$utils$svg_paths(a-c,c+b));return{width:a+ +b,height:a,pathTop(g){return g?d:""},pathBottom(g){return g?e:f}}}makeOutsideCorner(){const a=this.constantProvider.CORNER_RADIUS,b=this.OFFSET,c=(1-Math.SQRT1_2)*(a-b)+b,d=moveBy$$module$build$src$core$utils$svg_paths(c,c)+arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a-b,point$$module$build$src$core$utils$svg_paths(a-c,-c+b)),e=moveBy$$module$build$src$core$utils$svg_paths(b,a)+arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a-b,point$$module$build$src$core$utils$svg_paths(a,-a+ +b)),f=-c,g=moveBy$$module$build$src$core$utils$svg_paths(c,f)+arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a-b,point$$module$build$src$core$utils$svg_paths(-c+b,-f-a));return{height:a,topLeft(h){return h?d:e},bottomLeft(){return g}}}makePuzzleTab(){const a=this.constantProvider.TAB_WIDTH,b=this.constantProvider.TAB_HEIGHT,c=moveBy$$module$build$src$core$utils$svg_paths(-2,-b+2.5+.9)+lineTo$$module$build$src$core$utils$svg_paths(a*-.45,-2.1),d=lineOnAxis$$module$build$src$core$utils$svg_paths("v", +2.5)+moveBy$$module$build$src$core$utils$svg_paths(-a*.97,2.5)+curve$$module$build$src$core$utils$svg_paths("q",[point$$module$build$src$core$utils$svg_paths(-a*.05,10),point$$module$build$src$core$utils$svg_paths(a*.3,9.5)])+moveBy$$module$build$src$core$utils$svg_paths(a*.67,-1.9)+lineOnAxis$$module$build$src$core$utils$svg_paths("v",2.5),e=lineOnAxis$$module$build$src$core$utils$svg_paths("v",-1.5)+moveBy$$module$build$src$core$utils$svg_paths(a*-.92,-.5)+curve$$module$build$src$core$utils$svg_paths("q", +[point$$module$build$src$core$utils$svg_paths(a*-.19,-5.5),point$$module$build$src$core$utils$svg_paths(0,-11)])+moveBy$$module$build$src$core$utils$svg_paths(a*.92,1),f=moveBy$$module$build$src$core$utils$svg_paths(-5,b-.7)+lineTo$$module$build$src$core$utils$svg_paths(a*.46,-2.1);return{width:a,height:b,pathUp(g){return g?c:e},pathDown(g){return g?d:f}}}makeNotch(){return{pathLeft:lineOnAxis$$module$build$src$core$utils$svg_paths("h",this.OFFSET)+this.constantProvider.NOTCH.pathLeft}}makeJaggedTeeth(){return{pathLeft:lineTo$$module$build$src$core$utils$svg_paths(5.1, +2.6)+moveBy$$module$build$src$core$utils$svg_paths(-10.2,6.8)+lineTo$$module$build$src$core$utils$svg_paths(5.1,2.6),height:12,width:10.2}}makeStartHat(){const a=this.constantProvider.START_HAT.height,b=moveBy$$module$build$src$core$utils$svg_paths(25,-8.7)+curve$$module$build$src$core$utils$svg_paths("c",[point$$module$build$src$core$utils$svg_paths(29.7,-6.2),point$$module$build$src$core$utils$svg_paths(57.2,-.5),point$$module$build$src$core$utils$svg_paths(75,8.7)]),c=curve$$module$build$src$core$utils$svg_paths("c", +[point$$module$build$src$core$utils$svg_paths(17.8,-9.2),point$$module$build$src$core$utils$svg_paths(45.3,-14.9),point$$module$build$src$core$utils$svg_paths(75,-8.7)])+moveTo$$module$build$src$core$utils$svg_paths(100.5,a+.5);return{path(d){return d?b:c}}}},module$build$src$core$renderers$geras$highlight_constants={};module$build$src$core$renderers$geras$highlight_constants.HighlightConstantProvider=HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight_constants;var InlineInput$$module$build$src$core$renderers$geras$measurables$inline_input=class extends InlineInput$$module$build$src$core$renderers$measurables$inline_input{constructor(a,b){super(a,b);this.constants_=a;this.connectedBlock&&(this.width+=this.constants_.DARK_PATH_OFFSET,this.height+=this.constants_.DARK_PATH_OFFSET)}},module$build$src$core$renderers$geras$measurables$inline_input={};module$build$src$core$renderers$geras$measurables$inline_input.InlineInput=InlineInput$$module$build$src$core$renderers$geras$measurables$inline_input;var StatementInput$$module$build$src$core$renderers$geras$measurables$statement_input=class extends StatementInput$$module$build$src$core$renderers$measurables$statement_input{constructor(a,b){super(a,b);this.constants_=a;this.connectedBlock&&(this.height+=this.constants_.DARK_PATH_OFFSET)}},module$build$src$core$renderers$geras$measurables$statement_input={};module$build$src$core$renderers$geras$measurables$statement_input.StatementInput=StatementInput$$module$build$src$core$renderers$geras$measurables$statement_input;var RenderInfo$$module$build$src$core$renderers$geras$info=class extends RenderInfo$$module$build$src$core$renderers$common$info{constructor(a,b){super(a,b);this.renderer_=a}getRenderer(){return this.renderer_}populateBottomRow_(){super.populateBottomRow_();this.block_.inputList.length&&this.block_.inputList[this.block_.inputList.length-1]instanceof StatementInput$$module$build$src$core$inputs$statement_input||(this.bottomRow.minHeight=this.constants_.MEDIUM_PADDING-this.constants_.DARK_PATH_OFFSET)}addInput_(a, +b){if(this.isInline&&a instanceof $.ValueInput$$module$build$src$core$inputs$value_input)b.elements.push(new InlineInput$$module$build$src$core$renderers$geras$measurables$inline_input(this.constants_,a)),b.hasInlineInput=!0;else if(a instanceof StatementInput$$module$build$src$core$inputs$statement_input)b.elements.push(new StatementInput$$module$build$src$core$renderers$geras$measurables$statement_input(this.constants_,a)),b.hasStatement=!0;else if(a instanceof $.ValueInput$$module$build$src$core$inputs$value_input)b.elements.push(new ExternalValueInput$$module$build$src$core$renderers$measurables$external_value_input(this.constants_, +a)),b.hasExternalInput=!0;else if(a instanceof DummyInput$$module$build$src$core$inputs$dummy_input||a instanceof EndRowInput$$module$build$src$core$inputs$end_row_input)b.minHeight=Math.max(b.minHeight,this.constants_.DUMMY_INPUT_MIN_HEIGHT),b.hasDummyInput=!0;this.isInline||b.align!==null||(b.align=a.align)}addElemSpacing_(){let a=!1;for(let c=0,d;d=this.rows[c];c++)d.hasExternalInput&&(a=!0);for(let c=0,d;d=this.rows[c];c++){var b=d.elements;d.elements=[];d.startsWithElemSpacer()&&d.elements.push(new InRowSpacer$$module$build$src$core$renderers$measurables$in_row_spacer(this.constants_, +this.getInRowSpacing_(null,b[0])));if(b.length){for(let e=0;e0&&this.addAlignmentPadding_(e,a),a=e.width)}else super.alignRowElements_()}getDesiredRowWidth_(a){return this.isInline&&a.hasStatement?this.statementEdge+ +this.constants_.MAX_BOTTOM_WIDTH+this.startX:super.getDesiredRowWidth_(a)}finalize_(){let a=0,b=0;for(let d=0,e;e=this.rows[d];d++){e.yPos=b;e.xPos=this.startX;b+=e.height;a=Math.max(a,e.widthWithConnectedBlocks);var c=b-this.topRow.ascenderHeight;e===this.bottomRow&&c>>/sprites.png);\n height: 16px;\n vertical-align: middle;\n visibility: hidden;\n width: 16px;\n}\n\n.blocklyToolboxCategoryIconClosed {\n background-position: -32px -1px;\n}\n\n.blocklyToolbox[dir="RTL"] .blocklyToolboxCategoryIconClosed {\n background-position: 0 -1px;\n}\n\n.blocklyToolboxSelected>.blocklyToolboxCategoryIconClosed {\n background-position: -32px -17px;\n}\n\n.blocklyToolbox[dir="RTL"] .blocklyToolboxSelected>.blocklyToolboxCategoryIconClosed {\n background-position: 0 -17px;\n}\n\n.blocklyToolboxCategoryIconOpen {\n background-position: -16px -1px;\n}\n\n.blocklyToolboxSelected>.blocklyToolboxCategoryIconOpen {\n background-position: -16px -17px;\n}\n\n.blocklyToolboxCategoryLabel {\n cursor: default;\n font: 16px sans-serif;\n padding: 0 3px;\n vertical-align: middle;\n}\n\n.blocklyToolboxDelete .blocklyToolboxCategoryLabel {\n cursor: url("<<>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxSelected .blocklyToolboxCategoryLabel {\n color: #fff;\n}\n'); +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,ToolboxCategory$$module$build$src$core$toolbox$category.registrationName,ToolboxCategory$$module$build$src$core$toolbox$category);var module$build$src$core$toolbox$category={};module$build$src$core$toolbox$category.ToolboxCategory=ToolboxCategory$$module$build$src$core$toolbox$category;var ToolboxSeparator$$module$build$src$core$toolbox$separator=class extends ToolboxItem$$module$build$src$core$toolbox$toolbox_item{constructor(a,b){super(a,b);this.cssConfig_={container:"blocklyTreeSeparator"};this.htmlDiv=null;Object.assign(this.cssConfig_,a.cssconfig||a.cssConfig)}init(){this.createDom_()}createDom_(){const a=document.createElement("div");a.tabIndex=-1;a.id=this.getId();const b=this.cssConfig_.container;b&&addClass$$module$build$src$core$utils$dom(a,b);return this.htmlDiv=a}getDiv(){return this.htmlDiv}dispose(){removeNode$$module$build$src$core$utils$dom(this.htmlDiv)}}; +ToolboxSeparator$$module$build$src$core$toolbox$separator.registrationName="sep";register$$module$build$src$core$css('\n.blocklyTreeSeparator {\n border-bottom: solid #e5e5e5 1px;\n height: 0;\n margin: 5px 0;\n}\n\n.blocklyToolbox[layout="h"] .blocklyTreeSeparator {\n border-right: solid #e5e5e5 1px;\n border-bottom: none;\n height: auto;\n margin: 0 5px 0 5px;\n padding: 5px 0;\n width: 0;\n}\n'); +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,ToolboxSeparator$$module$build$src$core$toolbox$separator.registrationName,ToolboxSeparator$$module$build$src$core$toolbox$separator);var module$build$src$core$toolbox$separator={};module$build$src$core$toolbox$separator.ToolboxSeparator=ToolboxSeparator$$module$build$src$core$toolbox$separator;var CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category=class extends ToolboxCategory$$module$build$src$core$toolbox$category{constructor(a,b,c){super(a,b,c);this.subcategoriesDiv_=null;this.expanded_=!1;this.toolboxItems_=[]}makeDefaultCssConfig_(){const a=super.makeDefaultCssConfig_();a.contents="blocklyToolboxCategoryGroup";return a}parseContents_(a){if("custom"in a)this.flyoutItems_=a.custom;else{const b=a.contents;if(b){this.flyoutItems_=[];a=!0;for(let c=0;cb.dispose());this.contents.clear();this.renderContents_(a.contents);this.position();this.handleToolboxItemResize()}renderContents_(a){const b=document.createDocumentFragment(); +for(let c=0;c +{a.refreshTheme&&a.refreshTheme()})}refreshSelection(){this.selectedItem_&&this.selectedItem_.isSelectable()&&this.selectedItem_.getContents().length&&this.flyout.show(this.selectedItem_.getContents())}setVisible(a){this.isVisible_!==a&&(this.HtmlDiv.style.display=a?"block":"none",this.isVisible_=a,this.workspace_.recordDragTargets())}autoHide(a){!a&&this.flyout&&this.flyout.autoClose&&this.clearSelection()}setSelectedItem(a){const b=this.selectedItem_;!a&&!b||a&&!isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item(a)|| +(this.shouldDeselectItem_(b,a)&&b!==null&&this.deselectItem_(b),this.shouldSelectItem_(b,a)&&a!==null&&this.selectItem_(b,a),this.updateFlyout_(b,a),this.fireSelectEvent(b,a))}shouldDeselectItem_(a,b){return a!==null&&(!a.isCollapsible()||a!==b)}shouldSelectItem_(a,b){return b!==null&&b!==a}deselectItem_(a){this.selectedItem_=null;this.previouslySelectedItem_=a;a.setSelected(!1);setState$$module$build$src$core$utils$aria(this.contentsDiv_,State$$module$build$src$core$utils$aria.ACTIVEDESCENDANT,"")}selectItem_(a, +b){this.selectedItem_=b;this.previouslySelectedItem_=a;b.setSelected(!0);setState$$module$build$src$core$utils$aria(this.contentsDiv_,State$$module$build$src$core$utils$aria.ACTIVEDESCENDANT,b.getId())}selectItemByPosition(a){(a=this.getToolboxItems()[a])&&this.setSelectedItem(a)}updateFlyout_(a,b){b&&(a!==b||b.isCollapsible())&&b.getContents().length?(this.flyout.show(b.getContents()),this.flyout.scrollToStart()):this.flyout.hide()}fireSelectEvent(a,b){const c=a&&a.getName();let d=b&&b.getName(); +a===b&&(d=null);a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT))(c,d,this.workspace_.id);fire$$module$build$src$core$events$utils(a)}selectParent(){return this.selectedItem_?this.selectedItem_.isCollapsible()&&this.selectedItem_.isExpanded()?(this.selectedItem_.toggleExpanded(),!0):this.selectedItem_.getParent()&&this.selectedItem_.getParent().isSelectable()?(this.setSelectedItem(this.selectedItem_.getParent()),!0):!1:!1}selectChild(){if(!this.selectedItem_|| +!this.selectedItem_.isCollapsible())return!1;const a=this.selectedItem_;a.isExpanded()?this.selectNext():a.toggleExpanded();return!0}selectNext(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)+1;if(b>-1&&b-1&&ba.dispose());for(let a=0;ac.isSelectable()))!=null?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a, +b){a!==this?this.getSelectedItem()!==a&&this.setSelectedItem(a):this.clearSelection()}onTreeBlur(a){let b;a&&a===((b=this.flyout)==null?void 0:b.getWorkspace())||this.autoHide(!1)}};register$$module$build$src$core$css('\n.blocklyToolboxDelete {\n cursor: url("<<>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n box-sizing: border-box;\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n background-color: #ddd;\n overflow-x: visible;\n overflow-y: auto;\n padding: 4px 0 4px 0;\n position: absolute;\n z-index: 70; /* so blocks go under toolbox when dragging */\n -webkit-tap-highlight-color: transparent; /* issue #1345 */\n}\n\n.blocklyToolboxCategoryGroup {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n}\n\n.blocklyToolboxCategoryGroup:focus {\n outline: none;\n}\n'); +register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX,DEFAULT$$module$build$src$core$registry,Toolbox$$module$build$src$core$toolbox$toolbox);var module$build$src$core$toolbox$toolbox={};module$build$src$core$toolbox$toolbox.Toolbox=Toolbox$$module$build$src$core$toolbox$toolbox;var module$build$src$core$interfaces$i_navigation_policy={};var VERSION$$module$build$src$core$blockly="12.3.1",INPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,OUTPUT_VALUE$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE,NEXT_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT,PREVIOUS_STATEMENT$$module$build$src$core$blockly=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT, +TOOLBOX_AT_TOP$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.TOP,TOOLBOX_AT_BOTTOM$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.BOTTOM,TOOLBOX_AT_LEFT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.LEFT,TOOLBOX_AT_RIGHT$$module$build$src$core$blockly=Position$$module$build$src$core$utils$toolbox.RIGHT,svgResize$$module$build$src$core$blockly=svgResize$$module$build$src$core$common,getMainWorkspace$$module$build$src$core$blockly= +getMainWorkspace$$module$build$src$core$common,getSelected$$module$build$src$core$blockly=getSelected$$module$build$src$core$common,defineBlocksWithJsonArray$$module$build$src$core$blockly=defineBlocksWithJsonArray$$module$build$src$core$common,setParentContainer$$module$build$src$core$blockly=setParentContainer$$module$build$src$core$common,COLLAPSE_CHARS$$module$build$src$core$blockly=COLLAPSE_CHARS$$module$build$src$core$internal_constants,OPPOSITE_TYPE$$module$build$src$core$blockly=OPPOSITE_TYPE$$module$build$src$core$internal_constants, +RENAME_VARIABLE_ID$$module$build$src$core$blockly=RENAME_VARIABLE_ID$$module$build$src$core$internal_constants,DELETE_VARIABLE_ID$$module$build$src$core$blockly=DELETE_VARIABLE_ID$$module$build$src$core$internal_constants,COLLAPSED_INPUT_NAME$$module$build$src$core$blockly=COLLAPSED_INPUT_NAME$$module$build$src$core$constants,COLLAPSED_FIELD_NAME$$module$build$src$core$blockly=COLLAPSED_FIELD_NAME$$module$build$src$core$constants,VARIABLE_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$variables, +VARIABLE_DYNAMIC_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$variables_dynamic,PROCEDURE_CATEGORY_NAME$$module$build$src$core$blockly=CATEGORY_NAME$$module$build$src$core$procedures;Workspace$$module$build$src$core$workspace.prototype.newBlock=function(a,b){return new Block$$module$build$src$core$block(this,a,b)};WorkspaceSvg$$module$build$src$core$workspace_svg.prototype.newBlock=function(a,b){return new BlockSvg$$module$build$src$core$block_svg(this,a,b)}; +Workspace$$module$build$src$core$workspace.prototype.newComment=function(a){return new WorkspaceComment$$module$build$src$core$comments$workspace_comment(this,a)};WorkspaceSvg$$module$build$src$core$workspace_svg.prototype.newComment=function(a){return new RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comment(this,a)};WorkspaceSvg$$module$build$src$core$workspace_svg.newTrashcan=function(a){return new Trashcan$$module$build$src$core$trashcan(a)}; +MiniWorkspaceBubble$$module$build$src$core$bubbles$mini_workspace_bubble.prototype.newWorkspaceSvg=function(a){return new WorkspaceSvg$$module$build$src$core$workspace_svg(a)};$.Names$$module$build$src$core$names.prototype.populateProcedures=function(a){a=allProcedures$$module$build$src$core$procedures(a);a=a[0].concat(a[1]);for(let b=0;b0,text:c.replace("%1",d.getText()),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,b)})}else if(this.type==="variables_get_dynamic"||this.type==="variables_get_reporter_dynamic")c={text:$.Msg$$module$build$src$core$msg.RENAME_VARIABLE, +enabled:!0,callback:renameOptionCallbackFactory$$module$build$src$blocks$variables_dynamic(this)},d=this.getField("VAR").getText(),d={text:$.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",d),enabled:!0,callback:deleteOptionCallbackFactory$$module$build$src$blocks$variables_dynamic(this)},a.unshift(c),a.unshift(d)},onchange:function(a){a=this.getFieldValue("VAR");a=$.getVariable$$module$build$src$core$variables(this.workspace,a);this.type==="variables_get_dynamic"?this.outputConnection.setCheck(a.getType()): +this.getInput("VALUE").connection.setCheck(a.getType())}},renameOptionCallbackFactory$$module$build$src$blocks$variables_dynamic=function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();$.renameVariable$$module$build$src$core$variables(b,c)}},deleteOptionCallbackFactory$$module$build$src$blocks$variables_dynamic=function(a){return function(){const b=a.getField("VAR").getVariable();b&&$.deleteVariable$$module$build$src$core$variables(b.getWorkspace(),b,a)}}; +$.registerMixin$$module$build$src$core$extensions("contextMenu_variableDynamicSetterGetter",CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables_dynamic);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$variables_dynamic);var module$build$src$blocks$variables_dynamic={blocks:blocks$$module$build$src$blocks$variables_dynamic};var blocks$$module$build$src$blocks$variables=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}, +{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables={customContextMenu:function(a){if(!this.isInFlyout){if(this.type==="variables_get"){var b="variables_set";var c=$.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET}else b="variables_get", +c=$.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var d=this.getField("VAR");b={type:b,fields:{VAR:d.saveState(!0)}};a.push({enabled:this.workspace.remainingCapacity()>0,text:c.replace("%1",d.getText()),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,b)})}else if(this.type==="variables_get"||this.type==="variables_get_reporter")c={text:$.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:renameOptionCallbackFactory$$module$build$src$blocks$variables(this)}, +d=this.getField("VAR").getText(),d={text:$.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",d),enabled:!0,callback:deleteOptionCallbackFactory$$module$build$src$blocks$variables(this)},a.unshift(c),a.unshift(d)}},renameOptionCallbackFactory$$module$build$src$blocks$variables=function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();$.renameVariable$$module$build$src$core$variables(b,c)}},deleteOptionCallbackFactory$$module$build$src$blocks$variables=function(a){return function(){const b= +a.getField("VAR").getVariable();b&&$.deleteVariable$$module$build$src$core$variables(b.getWorkspace(),b,a)}};$.registerMixin$$module$build$src$core$extensions("contextMenu_variableSetterGetter",CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$variables);var module$build$src$blocks$variables={blocks:blocks$$module$build$src$blocks$variables};var blocks$$module$build$src$blocks$text=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"}, +{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"},{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}", +args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}", +args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks", +helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}", +inputsInline:!0,mutator:"text_charAt_mutator"}]),GET_SUBSTRING_BLOCK$$module$build$src$blocks$text={init:function(){this.WHERE_OPTIONS_1=[[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_END, +"FROM_END"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_HELPURL);this.setStyle("text_blocks");this.appendValueInput("STRING").setCheck("String").appendField($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);const a=b=>{const c=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+b]});c.setValidator(function(d){const e=this.getValue();d=d=== +"FROM_START"||d==="FROM_END";d!==(e==="FROM_START"||e==="FROM_END")&&this.getSourceBlock().updateAt_(b,d)});return c};this.appendDummyInput("WHERE1_INPUT").appendField(a(1),"WHERE1");this.appendDummyInput("AT1");this.appendDummyInput("WHERE2_INPUT").appendField(a(2),"WHERE2");this.appendDummyInput("AT2");$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL);this.setInputsInline(!0);this.setOutput(!0, +"String");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");var b=this.getInput("AT1")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at1",`${b}`);b=this.getInput("AT2")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at2",`${b}`);return a},domToMutation:function(a){const b= +a.getAttribute("at1")==="true";a=a.getAttribute("at2")==="true";this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+a);a===2&&$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL", +!0),this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL));a===1&&(this.moveInputBefore("AT1","WHERE2_INPUT"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","WHERE2_INPUT"))}};blocks$$module$build$src$blocks$text.text_getSubstring=GET_SUBSTRING_BLOCK$$module$build$src$blocks$text; +blocks$$module$build$src$blocks$text.text_changeCase={init:function(){const a=[[$.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[$.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[$.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_HELPURL);this.setStyle("text_blocks");this.appendValueInput("TEXT").setCheck("String").appendField($.fromJson$$module$build$src$core$field_registry({type:"field_dropdown", +options:a}),"CASE");this.setOutput(!0,"String");this.setTooltip($.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_TOOLTIP)}}; +blocks$$module$build$src$blocks$text.text_trim={init:function(){const a=[[$.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[$.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[$.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_TRIM_HELPURL);this.setStyle("text_blocks");this.appendValueInput("TEXT").setCheck("String").appendField($.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a}), +"MODE");this.setOutput(!0,"String");this.setTooltip($.Msg$$module$build$src$core$msg.TEXT_TRIM_TOOLTIP)}};blocks$$module$build$src$blocks$text.text_print={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_PRINT_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_PRINT_HELPURL})}}; +var PROMPT_COMMON$$module$build$src$blocks$text={updateType_:function(a){this.outputConnection.setCheck(a==="NUMBER"?"Number":"String")},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("type",this.getFieldValue("TYPE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("type"))}}; +blocks$$module$build$src$blocks$text.text_prompt_ext=Object.assign({},PROMPT_COMMON$$module$build$src$blocks$text,{init:function(){var a=[[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL);this.setStyle("text_blocks");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a});a.setValidator(b=>{this.updateType_(b)});this.appendValueInput("TEXT").appendField(a, +"TYPE");this.setOutput(!0,"String");this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}}); +blocks$$module$build$src$blocks$text.text_prompt=Object.assign({},PROMPT_COMMON$$module$build$src$blocks$text,{init:function(){this.mixin(QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text);var a=[[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL);this.setStyle("text_blocks");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a}); +a.setValidator(b=>{this.updateType_(b)});this.appendDummyInput().appendField(a,"TYPE").appendField(this.newQuote_(!0)).appendField($.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}}); +blocks$$module$build$src$blocks$text.text_count={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}}; +blocks$$module$build$src$blocks$text.text_replace={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}}; +blocks$$module$build$src$blocks$text.text_reverse={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}}; +var QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==", +QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(a){for(let b=0,c;c=this.inputList[b];b++)for(let d=0,e;e=c.fieldRow[d];d++)if(a===e.name){c.insertFieldAt(d,this.newQuote_(!0));c.insertFieldAt(d+2,this.newQuote_(!1));return}console.warn('field named "'+a+'" not found in '+this.toDevString())},newQuote_:function(a){a=this.RTL?!a:a;return $.fromJson$$module$build$src$core$field_registry({type:"field_image",src:a?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH, +height:this.QUOTE_IMAGE_HEIGHT,alt:a?"\u201c":"\u201d"})}},QUOTES_EXTENSION$$module$build$src$blocks$text=function(){this.mixin(QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text);this.quoteField_("TEXT")},JOIN_MUTATOR_MIXIN$$module$build$src$blocks$text={itemCount_:0,mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("items",`${this.itemCount_}`);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()}, +saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(a){this.itemCount_=a.itemCount;this.updateShape_()},decompose:function(a){const b=a.newBlock("text_create_join_container");b.initSvg();let c=b.getInput("STACK").connection;for(let d=0;d$.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},CHARAT_MUTATOR_MIXIN$$module$build$src$blocks$text={isAt_:!1,mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("at",`${this.isAt_}`);return a},domToMutation:function(a){a=a.getAttribute("at")!=="false";this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT", +!0);this.removeInput("ORDINAL",!0);a&&(this.appendValueInput("AT").setCheck("Number"),$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX));$.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL));this.isAt_=a}},CHARAT_EXTENSION$$module$build$src$blocks$text=function(){this.getField("WHERE").setValidator(function(a){a= +a==="FROM_START"||a==="FROM_END";const b=this.getSourceBlock();a!==b.isAt_&&b.updateAt_(a)});this.updateAt_(!0);this.setTooltip(()=>{var a=this.getFieldValue("WHERE");let b=$.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;(a==="FROM_START"||a==="FROM_END")&&(a=a==="FROM_START"?$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(b+=" "+a.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0"));return b})}; +$.register$$module$build$src$core$extensions("text_indexOf_tooltip",INDEXOF_TOOLTIP_EXTENSION$$module$build$src$blocks$text);$.register$$module$build$src$core$extensions("text_quotes",QUOTES_EXTENSION$$module$build$src$blocks$text);$.registerMixin$$module$build$src$core$extensions("quote_image_mixin",QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text);$.registerMutator$$module$build$src$core$extensions("text_join_mutator",JOIN_MUTATOR_MIXIN$$module$build$src$blocks$text,JOIN_EXTENSION$$module$build$src$blocks$text); +$.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",CHARAT_MUTATOR_MIXIN$$module$build$src$blocks$text,CHARAT_EXTENSION$$module$build$src$blocks$text);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$text);var module$build$src$blocks$text={blocks:blocks$$module$build$src$blocks$text};var blocks$$module$build$src$blocks$procedures={},PROCEDURE_DEF_COMMON$$module$build$src$blocks$procedures={setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=a)},updateParams_:function(){let a="";this.arguments_.length&&(a=$.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+ +" "+this.arguments_.join(", "));$.disable$$module$build$src$core$events$utils();try{this.setFieldValue(a,"PARAMS")}finally{$.enable$$module$build$src$core$events$utils()}},mutationToDom:function(a){const b=$.createElement$$module$build$src$core$utils$xml("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(let c=0;c","GT"],["\u200f\u2265","GTE"]]},{type:"input_value",name:"B"}], +inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]}, +{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}], +message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif", +message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),TOOLTIPS_BY_OP$$module$build$src$blocks$logic={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}", +LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};$.register$$module$build$src$core$extensions("logic_op_tooltip",$.buildTooltipForDropdown$$module$build$src$core$extensions("OP",TOOLTIPS_BY_OP$$module$build$src$blocks$logic)); +var CONTROLS_IF_MUTATOR_MIXIN$$module$build$src$blocks$logic={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const a=$.createElement$$module$build$src$core$utils$xml("mutation");this.elseifCount_&&a.setAttribute("elseif",String(this.elseifCount_));this.elseCount_&&a.setAttribute("else","1");return a},domToMutation:function(a){this.elseifCount_=parseInt(a.getAttribute("elseif"),10)||0;this.elseCount_=parseInt(a.getAttribute("else"),10)||0;this.rebuildShape_()}, +saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const a=Object.create(null);this.elseifCount_&&(a.elseIfCount=this.elseifCount_);this.elseCount_&&(a.hasElse=!0);return a},loadExtraState:function(a){this.elseifCount_=a.elseIfCount||0;this.elseCount_=a.hasElse?1:0;this.updateShape_()},decompose:function(a){const b=a.newBlock("controls_if_if");b.initSvg();let c=b.nextConnection;for(let d=1;d<=this.elseifCount_;d++){const e=a.newBlock("controls_if_elseif");e.initSvg();c.connect(e.previousConnection); +c=e.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},compose:function(a){a=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;const b=[null],c=[null];let d=null;for(;a;){if(!a.isInsertionMarker())switch(a.type){case "controls_if_elseif":this.elseifCount_++;b.push(a.valueConnection_);c.push(a.statementConnection_);break;case "controls_if_else":this.elseCount_++;d=a.statementConnection_;break;default:throw TypeError("Unknown block type: "+ +a.type);}a=a.getNextBlock()}this.updateShape_();this.reconnectChildBlocks_(b,c,d)},saveConnections:function(a){a=a.nextConnection.targetBlock();let b=1;for(;a;){if(!a.isInsertionMarker())switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b);const d=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;a.statementConnection_=d&&d.connection.targetConnection;b++;break;case "controls_if_else":c=this.getInput("ELSE");a.statementConnection_=c&&c.connection.targetConnection; +break;default:throw TypeError("Unknown block type: "+a.type);}a=a.getNextBlock()}},rebuildShape_:function(){const a=[null],b=[null];let c=null;this.getInput("ELSE")&&(c=this.getInput("ELSE").connection.targetConnection);for(let d=1;this.getInput("IF"+d);d++){const e=this.getInput("IF"+d),f=this.getInput("DO"+d);a.push(e.connection.targetConnection);b.push(f.connection.targetConnection)}this.updateShape_();this.reconnectChildBlocks_(a,b,c)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE"); +for(var a=1;this.getInput("IF"+a);a++)this.removeInput("IF"+a),this.removeInput("DO"+a);for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField($.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField($.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField($.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(a,b,c){for(let d= +1;d<=this.elseifCount_;d++){let e;(e=a[d])==null||e.reconnect(this,"IF"+d);let f;(f=b[d])==null||f.reconnect(this,"DO"+d)}c==null||c.reconnect(this,"ELSE")}};$.registerMutator$$module$build$src$core$extensions("controls_if_mutator",CONTROLS_IF_MUTATOR_MIXIN$$module$build$src$blocks$logic,null,["controls_if_elseif","controls_if_else"]); +var CONTROLS_IF_TOOLTIP_EXTENSION$$module$build$src$blocks$logic=function(){this.setTooltip(function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1; +return""}.bind(this))};$.register$$module$build$src$core$extensions("controls_if_tooltip",CONTROLS_IF_TOOLTIP_EXTENSION$$module$build$src$blocks$logic); +var LOGIC_COMPARE_ONCHANGE_MIXIN$$module$build$src$blocks$logic={onchange:function(a){this.prevBlocks_||(this.prevBlocks_=[null,null]);var b=this.getInputTargetBlock("A");const c=this.getInputTargetBlock("B");b&&c&&!this.workspace.connectionChecker.doTypeChecks(b.outputConnection,c.outputConnection)&&($.setGroup$$module$build$src$core$events$utils(a.group),a=this.prevBlocks_[0],a!==b&&(b.unplug(),!a||a.isDisposed()||a.isShadow()||this.getInput("A").connection.connect(a.outputConnection)),b=this.prevBlocks_[1], +b!==c&&(c.unplug(),!b||b.isDisposed()||b.isShadow()||this.getInput("B").connection.connect(b.outputConnection)),this.bumpNeighbours(),$.setGroup$$module$build$src$core$events$utils(!1));this.prevBlocks_[0]=this.getInputTargetBlock("A");this.prevBlocks_[1]=this.getInputTargetBlock("B")}},LOGIC_COMPARE_EXTENSION$$module$build$src$blocks$logic=function(){this.mixin(LOGIC_COMPARE_ONCHANGE_MIXIN$$module$build$src$blocks$logic)};$.register$$module$build$src$core$extensions("logic_compare",LOGIC_COMPARE_EXTENSION$$module$build$src$blocks$logic); +var LOGIC_TERNARY_ONCHANGE_MIXIN$$module$build$src$blocks$logic={prevParentConnection_:null,onchange:function(a){const b=this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(let e=0;e<2;e++){const f=e===1?b:c;f&&!f.workspace.connectionChecker.doTypeChecks(f.outputConnection,d)&&($.setGroup$$module$build$src$core$events$utils(a.group),d===this.prevParentConnection_?(this.unplug(),d.getSourceBlock().bumpNeighbours()):(f.unplug(), +f.bumpNeighbours()),$.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=d}};$.registerMixin$$module$build$src$core$extensions("logic_ternary",LOGIC_TERNARY_ONCHANGE_MIXIN$$module$build$src$blocks$logic);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$logic);var module$build$src$blocks$logic={blocks:blocks$$module$build$src$blocks$logic};var blocks$$module$build$src$blocks$lists=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}", +helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"}, +{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),LISTS_CREATE_WITH$$module$build$src$blocks$lists={init:function(){this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL);this.setStyle("list_blocks");this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new $.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"], +this));this.setTooltip($.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("items",String(this.itemCount_));return a},domToMutation:function(a){a=a.getAttribute("items");if(!a)throw new TypeError("element did not have items");this.itemCount_=parseInt(a,10);this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(a){this.itemCount_=a.itemCount; +this.updateShape_()},decompose:function(a){const b=a.newBlock("lists_create_with_container");b.initSvg();let c=b.getInput("STACK").connection;for(let d=0;d$.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};blocks$$module$build$src$blocks$lists.lists_indexOf=LISTS_INDEXOF$$module$build$src$blocks$lists; +var LISTS_GETINDEX$$module$build$src$blocks$lists={init:function(){var a=[[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"], +[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL);this.setStyle("list_blocks");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a});a.setValidator(function(b){b=b==="REMOVE";this.getSourceBlock().updateStatement_(b)});this.appendValueInput("VALUE").setCheck("Array").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST); +this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});a.setValidator(function(b){const c=this.getValue();b=b==="FROM_START"||b==="FROM_END";b!==(c==="FROM_START"||c==="FROM_END")&&this.getSourceBlock().updateAt_(b)});this.appendDummyInput().appendField(a,"WHERE");this.appendDummyInput("AT");$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL); +this.setInputsInline(!0);this.setOutput(!0);this.updateAt_(!0);this.setTooltip(()=>{const b=this.getFieldValue("MODE"),c=this.getFieldValue("WHERE");let d="";switch(b+" "+c){case "GET FROM_START":case "GET FROM_END":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case "GET FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case "GET LAST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case "GET RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM; +break;case "GET_REMOVE FROM_START":case "GET_REMOVE FROM_END":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case "GET_REMOVE FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case "GET_REMOVE LAST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case "GET_REMOVE RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case "REMOVE FROM_START":case "REMOVE FROM_END":d= +$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case "REMOVE FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case "REMOVE LAST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case "REMOVE RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}if(c==="FROM_START"||c==="FROM_END")d+=" "+(c==="FROM_START"?$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1", +this.workspace.options.oneBasedIndex?"#1":"#0");return d})},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("statement",String(!this.outputConnection));const b=this.getInput("AT")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at",String(b));return a},domToMutation:function(a){const b=a.getAttribute("statement")==="true";this.updateStatement_(b);a=a.getAttribute("at")!=="false";this.updateAt_(a)},saveExtraState:function(){return this.outputConnection? +null:{isStatement:!0}},loadExtraState:function(a){a.isStatement?this.updateStatement_(!0):typeof a==="string"&&this.domToMutation($.textToDom$$module$build$src$core$utils$xml(a))},updateStatement_:function(a){a!==!this.outputConnection&&(this.unplug(!0,!0),a?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"), +$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};blocks$$module$build$src$blocks$lists.lists_getIndex=LISTS_GETINDEX$$module$build$src$blocks$lists; +var LISTS_SETINDEX$$module$build$src$blocks$lists={init:function(){var a=[[$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM, +"RANDOM"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL);this.setStyle("list_blocks");this.appendValueInput("LIST").setCheck("Array").appendField($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST);a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a});this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});a.setValidator(function(b){const c= +this.getValue();b=b==="FROM_START"||b==="FROM_END";b!==(c==="FROM_START"||c==="FROM_END")&&this.getSourceBlock().updateAt_(b)});this.appendDummyInput().appendField(a,"WHERE");this.appendDummyInput("AT");this.appendValueInput("TO").appendField($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP);this.updateAt_(!0);this.setTooltip(()=>{const b= +this.getFieldValue("MODE"),c=this.getFieldValue("WHERE");let d="";switch(b+" "+c){case "SET FROM_START":case "SET FROM_END":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case "SET FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case "SET LAST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case "SET RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case "INSERT FROM_START":case "INSERT FROM_END":d= +$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case "INSERT FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case "INSERT LAST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case "INSERT RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}if(c==="FROM_START"||c==="FROM_END")d+=" "+$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex? +"#1":"#0");return d})},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation"),b=this.getInput("AT")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at",String(b));return a},domToMutation:function(a){a=a.getAttribute("at")!=="false";this.updateAt_(a)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"), +$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");this.moveInputBefore("AT","TO");this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO")}};blocks$$module$build$src$blocks$lists.lists_setIndex=LISTS_SETINDEX$$module$build$src$blocks$lists; +var LISTS_GETSUBLIST$$module$build$src$blocks$lists={init:function(){this.WHERE_OPTIONS_1=[[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"], +[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL);this.setStyle("list_blocks");this.appendValueInput("LIST").setCheck("Array").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);const a=b=>{const c=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+b]});c.setValidator(function(d){const e=this.getValue();d=d==="FROM_START"||d=== +"FROM_END";d!==(e==="FROM_START"||e==="FROM_END")&&this.getSourceBlock().updateAt_(b,d)});return c};this.appendDummyInput("WHERE1_INPUT").appendField(a(1),"WHERE1");this.appendDummyInput("AT1");this.appendDummyInput("WHERE2_INPUT").appendField(a(2),"WHERE2");this.appendDummyInput("AT2");$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1, +!0);this.updateAt_(2,!0);this.setTooltip($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");var b=this.getInput("AT1")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at1",String(b));b=this.getInput("AT2")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at2",String(b));return a},domToMutation:function(a){const b=a.getAttribute("at1")=== +"true";a=a.getAttribute("at2")==="true";this.updateAt_(1,b);this.updateAt_(2,a)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+a);a===1&&(this.moveInputBefore("AT1", +"WHERE2_INPUT"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","WHERE2_INPUT"));$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};blocks$$module$build$src$blocks$lists.lists_getSublist=LISTS_GETSUBLIST$$module$build$src$blocks$lists; +blocks$$module$build$src$blocks$lists.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array", +style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}}; +blocks$$module$build$src$blocks$lists.lists_split={init:function(){const a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[$.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[$.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!a)throw Error("field_dropdown not found");a.setValidator(b=>{this.updateType_(b)});this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL);this.setStyle("list_blocks");this.appendValueInput("INPUT").setCheck("String").appendField(a, +"MODE");this.appendValueInput("DELIM").setCheck("String").appendField($.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);this.setOutput(!0,"Array");this.setTooltip(()=>{const b=this.getFieldValue("MODE");if(b==="SPLIT")return $.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(b==="JOIN")return $.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+b);})},updateType_:function(a){if(this.getFieldValue("MODE")!==a){const b= +this.getInput("INPUT").connection;b.setShadowDom(null);const c=b.targetBlock();c&&(b.disconnect(),c.isShadow()?c.dispose(!1):this.bumpNeighbours())}a==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("mode",this.getFieldValue("MODE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("mode"))}, +saveExtraState:function(){return{mode:this.getFieldValue("MODE")}},loadExtraState:function(a){this.updateType_(a.mode)}};$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$lists);var module$build$src$blocks$lists={blocks:blocks$$module$build$src$blocks$lists};var blocks$$module$build$src$blocks$blocks=Object.assign({},blocks$$module$build$src$blocks$lists,blocks$$module$build$src$blocks$logic,blocks$$module$build$src$blocks$loops,blocks$$module$build$src$blocks$math,blocks$$module$build$src$blocks$procedures,blocks$$module$build$src$blocks$text,blocks$$module$build$src$blocks$variables,blocks$$module$build$src$blocks$variables_dynamic),module$build$src$blocks$blocks={blocks:blocks$$module$build$src$blocks$blocks,lists:module$build$src$blocks$lists,logic:module$build$src$blocks$logic, +loops:module$build$src$blocks$loops,math:module$build$src$blocks$math,procedures:module$build$src$blocks$procedures,texts:module$build$src$blocks$text,variables:module$build$src$blocks$variables,variablesDynamic:module$build$src$blocks$variables_dynamic}; +module$build$src$blocks$blocks.__namespace__=$; +return module$build$src$blocks$blocks; +})); + + +//# sourceMappingURL=blocks_compressed.js.map + +// Do not edit this file; automatically generated. + +/* eslint-disable */ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { // AMD + define(["./blockly_compressed.js"], factory); + } else if (typeof exports === 'object') { // Node.js + module.exports = factory(require("./blockly_compressed.js")); + } else { // Script + root.javascript = factory(root.Blockly); + root.Blockly.JavaScript = root.javascript.javascriptGenerator; + } +}(this, function(__parent__) { +var $=__parent__.__namespace__; +var lists_create_empty$$module$build$src$generators$javascript$lists=function(a,b){return["[]",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]},lists_create_with$$module$build$src$generators$javascript$lists=function(a,b){const c=Array(a.itemCount_);for(let d=0;d String(b) ? 1 : -1; }, + 'IGNORE_CASE': function(a, b) { + return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; }, + }; + var compare = compareFuncs[type]; + return function(a, b) { return compare(a, b) * direction; }; +} + `);return[c+".slice().sort("+b+'("'+a+'", '+d+"))",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},lists_split$$module$build$src$generators$javascript$lists=function(a,b){let c=b.valueToCode(a,"INPUT",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER);b=b.valueToCode(a,"DELIM",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"''";a=a.getFieldValue("MODE");if(a==="SPLIT")c||(c="''"),a="split";else if(a==="JOIN")c|| +(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+b+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},lists_reverse$$module$build$src$generators$javascript$lists=function(a,b){return[(b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL)||"[]")+".slice().reverse()",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},controls_if$$module$build$src$generators$javascript$logic= +function(a,b){var c=0;let d="";b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do{const e=b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"false";let f=b.statementToCode(a,"DO"+c);b.STATEMENT_SUFFIX&&(f=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+f);d+=(c>0?" else ":"")+"if ("+e+") {\n"+f+"}";c++}while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)c=a.getInput("ELSE")?b.statementToCode(a,"ELSE"):"",b.STATEMENT_SUFFIX&& +(c=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+c),d+=" else {\n"+c+"}";return d+"\n"},logic_compare$$module$build$src$generators$javascript$logic=function(a,b){const c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d=c==="=="||c==="!="?Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY:Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+ +c+" "+a,d]},logic_operation$$module$build$src$generators$javascript$logic=function(a,b){const c=a.getFieldValue("OP")==="AND"?"&&":"||",d=c==="&&"?Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_AND:Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_OR;let e=b.valueToCode(a,"A",d);a=b.valueToCode(a,"B",d);e||a?(b=c==="&&"?"true":"false",e||(e=b),a||(a=b)):a=e="false";return[e+" "+c+" "+a,d]},logic_negate$$module$build$src$generators$javascript$logic= +function(a,b){const c=Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_NOT;return["!"+(b.valueToCode(a,"BOOL",c)||"true"),c]},logic_boolean$$module$build$src$generators$javascript$logic=function(a,b){return[a.getFieldValue("BOOL")==="TRUE"?"true":"false",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]},logic_null$$module$build$src$generators$javascript$logic=function(a,b){return["null",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]}, +logic_ternary$$module$build$src$generators$javascript$logic=function(a,b){const c=b.valueToCode(a,"IF",Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL)||"false",d=b.valueToCode(a,"THEN",Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL)||"null";a=b.valueToCode(a,"ELSE",Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL)||"null";return[c+" ? "+d+" : "+a,Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL]}, +controls_repeat_ext$$module$build$src$generators$javascript$loops=function(a,b){let c;c=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):b.valueToCode(a,"TIMES",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"0";let d=b.statementToCode(a,"DO");d=b.addLoopTrap(d,a);a="";const e=b.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE);let f=c;c.match(/^\w+$/)||$.isNumber$$module$build$src$core$utils$string(c)||(f=b.nameDB_.getDistinctName("repeat_end", +$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")},controls_whileUntil$$module$build$src$generators$javascript$loops=function(a,b){const c=a.getFieldValue("MODE")==="UNTIL";let d=b.valueToCode(a,"BOOL",c?Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_NOT:Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"false",e=b.statementToCode(a,"DO");e=b.addLoopTrap(e, +a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"},controls_for$$module$build$src$generators$javascript$loops=function(a,b){var c=b.getVariableName(a.getFieldValue("VAR")),d=b.valueToCode(a,"FROM",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"0",e=b.valueToCode(a,"TO",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"0";const f=b.valueToCode(a,"BY",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"1"; +let g=b.statementToCode(a,"DO");g=b.addLoopTrap(g,a);if($.isNumber$$module$build$src$core$utils$string(d)&&$.isNumber$$module$build$src$core$utils$string(e)&&$.isNumber$$module$build$src$core$utils$string(f))b=Number(d)<=Number(e),a="for ("+c+" = "+d+"; "+c+(b?" <= ":" >= ")+e+"; "+c,c=Math.abs(Number(f)),a=c===1?a+(b?"++":"--"):a+((b?" += ":" -= ")+c),a+=") {\n"+g+"}\n";else{a="";let h=d;d.match(/^\w+$/)||$.isNumber$$module$build$src$core$utils$string(d)||(h=b.nameDB_.getDistinctName(c+"_start", +$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+h+" = "+d+";\n");d=e;e.match(/^\w+$/)||$.isNumber$$module$build$src$core$utils$string(e)||(d=b.nameDB_.getDistinctName(c+"_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+d+" = "+e+";\n");e=b.nameDB_.getDistinctName(c+"_inc",$.NameType$$module$build$src$core$names.VARIABLE);a+="var "+e+" = ";a=$.isNumber$$module$build$src$core$utils$string(f)?a+(Math.abs(Number(f))+";\n"):a+("Math.abs("+f+");\n");a+="if ("+h+" > "+d+") {\n"; +a+=b.INDENT+e+" = -"+e+";\n";a=a+"}\nfor ("+(c+" = "+h+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+g+"}\n")}return a},controls_forEach$$module$build$src$generators$javascript$loops=function(a,b){const c=b.getVariableName(a.getFieldValue("VAR"));var d=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"[]";let e=b.statementToCode(a,"DO");e=b.addLoopTrap(e,a);a="";let f=d;d.match(/^\w+$/)||(f=b.nameDB_.getDistinctName(c+"_list", +$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+f+" = "+d+";\n");d=b.nameDB_.getDistinctName(c+"_index",$.NameType$$module$build$src$core$names.VARIABLE);e=b.INDENT+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")},controls_flow_statements$$module$build$src$generators$javascript$loops=function(a,b){let c="";b.STATEMENT_PREFIX&&(c+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(c+=b.injectId(b.STATEMENT_SUFFIX,a));if(b.STATEMENT_PREFIX){const d=a.getSurroundLoop(); +d&&!d.suppressPrefixSuffix&&(c+=b.injectId(b.STATEMENT_PREFIX,d))}switch(a.getFieldValue("FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");},math_number$$module$build$src$generators$javascript$math=function(a,b){a=Number(a.getFieldValue("NUM"));return[String(a),a>=0?Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC:Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION]},math_arithmetic$$module$build$src$generators$javascript$math= +function(a,b){var c={ADD:[" + ",Order$$module$build$src$generators$javascript$javascript_generator.ADDITION],MINUS:[" - ",Order$$module$build$src$generators$javascript$javascript_generator.SUBTRACTION],MULTIPLY:[" * ",Order$$module$build$src$generators$javascript$javascript_generator.MULTIPLICATION],DIVIDE:[" / ",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION],POWER:[null,Order$$module$build$src$generators$javascript$javascript_generator.NONE]}[a.getFieldValue("OP")]; +const d=c[0];c=c[1];const e=b.valueToCode(a,"A",c)||"0";a=b.valueToCode(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_single$$module$build$src$generators$javascript$math=function(a,b){const c=a.getFieldValue("OP");let d;if(c==="NEG")return a=b.valueToCode(a,"NUM",Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION)||"0",a[0]==="-"&&(a=" "+a),["-"+a,Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION]; +a=c==="SIN"||c==="COS"||c==="TAN"?b.valueToCode(a,"NUM",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION)||"0":b.valueToCode(a,"NUM",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";switch(c){case "ABS":d="Math.abs("+a+")";break;case "ROOT":d="Math.sqrt("+a+")";break;case "LN":d="Math.log("+a+")";break;case "EXP":d="Math.exp("+a+")";break;case "POW10":d="Math.pow(10,"+a+")";break;case "ROUND":d="Math.round("+a+")";break;case "ROUNDUP":d="Math.ceil("+ +a+")";break;case "ROUNDDOWN":d="Math.floor("+a+")";break;case "SIN":d="Math.sin("+a+" / 180 * Math.PI)";break;case "COS":d="Math.cos("+a+" / 180 * Math.PI)";break;case "TAN":d="Math.tan("+a+" / 180 * Math.PI)"}if(d)return[d,Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL];switch(c){case "LOG10":d="Math.log("+a+") / Math.log(10)";break;case "ASIN":d="Math.asin("+a+") / Math.PI * 180";break;case "ACOS":d="Math.acos("+a+") / Math.PI * 180";break;case "ATAN":d="Math.atan("+ +a+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+c);}return[d,Order$$module$build$src$generators$javascript$javascript_generator.DIVISION]},math_constant$$module$build$src$generators$javascript$math=function(a,b){return{PI:["Math.PI",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],E:["Math.E",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION], +SQRT2:["Math.SQRT2",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],SQRT1_2:["Math.SQRT1_2",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],INFINITY:["Infinity",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]}[a.getFieldValue("CONSTANT")]},math_number_property$$module$build$src$generators$javascript$math=function(a,b){var c={EVEN:[" % 2 === 0",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS, +Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],ODD:[" % 2 === 1",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS,Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],WHOLE:[" % 1 === 0",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS,Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],POSITIVE:[" > 0",Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL, +Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL],NEGATIVE:[" < 0",Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL,Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL],DIVISIBLE_BY:[null,Order$$module$build$src$generators$javascript$javascript_generator.MODULUS,Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],PRIME:[null,Order$$module$build$src$generators$javascript$javascript_generator.NONE, +Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]};const d=a.getFieldValue("PROPERTY"),[e,f,g]=c[d];c=b.valueToCode(a,"NUMBER_TO_CHECK",f)||"0";d==="PRIME"?a=b.provideFunction_("mathIsPrime",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(n) { + // https://en.wikipedia.org/wiki/Primality_test#Naive_methods + if (n == 2 || n == 3) { + return true; + } + // False if n is NaN, negative, is 1, or not whole. + // And false if n is divisible by 2 or 3. + if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) { + return false; + } + // Check all the numbers of form 6k +/- 1, up to sqrt(n). + for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) { + if (n % (x - 1) === 0 || n % (x + 1) === 0) { + return false; + } + } + return true; +} +`)+"("+c+")":d==="DIVISIBLE_BY"?(a=b.valueToCode(a,"DIVISOR",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS)||"0",a=c+" % "+a+" === 0"):a=c+e;return[a,g]},math_change$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"DELTA",Order$$module$build$src$generators$javascript$javascript_generator.ADDITION)||"0";a=b.getVariableName(a.getFieldValue("VAR"));return a+" = (typeof "+a+" === 'number' ? "+a+" : 0) + "+c+";\n"},math_on_list$$module$build$src$generators$javascript$math= +function(a,b){var c=a.getFieldValue("OP");switch(c){case "SUM":a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER)||"[]";a+=".reduce(function(x, y) {return x + y;}, 0)";break;case "MIN":a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a="Math.max.apply(null, "+ +a+")";break;case "AVERAGE":c=b.provideFunction_("mathMean",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(myList) { + return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "MEDIAN":c=b.provideFunction_("mathMedian",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(myList) { + var localList = myList.filter(function (x) {return typeof x === 'number';}); + if (!localList.length) return null; + localList.sort(function(a, b) {return b - a;}); + if (localList.length % 2 === 0) { + return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2; + } else { + return localList[(localList.length - 1) / 2]; + } +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "MODE":c=b.provideFunction_("mathModes",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(values) { + var modes = []; + var counts = []; + var maxCount = 0; + for (var i = 0; i < values.length; i++) { + var value = values[i]; + var found = false; + var thisCount; + for (var j = 0; j < counts.length; j++) { + if (counts[j][0] === value) { + thisCount = ++counts[j][1]; + found = true; + break; + } + } + if (!found) { + counts.push([value, 1]); + thisCount = 1; + } + maxCount = Math.max(thisCount, maxCount); + } + for (var j = 0; j < counts.length; j++) { + if (counts[j][1] === maxCount) { + modes.push(counts[j][0]); + } + } + return modes; +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=b.provideFunction_("mathStandardDeviation",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(numbers) { + var n = numbers.length; + if (!n) return null; + var mean = numbers.reduce(function(x, y) {return x + y;}) / n; + var variance = 0; + for (var j = 0; j < n; j++) { + variance += Math.pow(numbers[j] - mean, 2); + } + variance /= n; + return Math.sqrt(variance); +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "RANDOM":c=b.provideFunction_("mathRandomList",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(list) { + var x = Math.floor(Math.random() * list.length); + return list[x]; +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_modulo$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"DIVIDEND",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS)||"0";a=b.valueToCode(a,"DIVISOR",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS)|| +"0";return[c+" % "+a,Order$$module$build$src$generators$javascript$javascript_generator.MODULUS]},math_constrain$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"VALUE",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0",d=b.valueToCode(a,"LOW",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";a=b.valueToCode(a,"HIGH",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"Infinity";return["Math.min(Math.max("+ +c+", "+d+"), "+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_random_int$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"FROM",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";a=b.valueToCode(a,"TO",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";return[b.provideFunction_("mathRandomInt",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(a, b) { + if (a > b) { + // Swap a and b to ensure a is smaller. + var c = a; + a = b; + b = c; + } + return Math.floor(Math.random() * (b - a + 1) + a); +} +`)+"("+c+", "+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_random_float$$module$build$src$generators$javascript$math=function(a,b){return["Math.random()",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_atan2$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"X",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";return["Math.atan2("+(b.valueToCode(a,"Y", +Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0")+", "+c+") / Math.PI * 180",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION]},procedures_defreturn$$module$build$src$generators$javascript$procedures=function(a,b){const c=b.getProcedureName(a.getFieldValue("NAME"));var d="";b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(d+=b.injectId(b.STATEMENT_SUFFIX,a));d&&(d=b.prefixLines(d,b.INDENT));let e="";b.INFINITE_LOOP_TRAP&& +(e=b.prefixLines(b.injectId(b.INFINITE_LOOP_TRAP,a),b.INDENT));let f="";a.getInput("STACK")&&(f=b.statementToCode(a,"STACK"));let g="";a.getInput("RETURN")&&(g=b.valueToCode(a,"RETURN",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"");let h="";f&&g&&(h=d);g&&(g=b.INDENT+"return "+g+";\n");const k=[],l=a.getVars();for(let m=0;m0?g=Order$$module$build$src$generators$javascript$javascript_generator.ADDITION:c<0?g=Order$$module$build$src$generators$javascript$javascript_generator.SUBTRACTION:d&&(g=Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION);a=this.valueToCode(a,b,g)||f;if(c=== +0&&!d)return a;if($.isNumber$$module$build$src$core$utils$string(a))return a=String(Number(a)+c),d&&(a=String(-Number(a))),a;c>0?a=`${a} + ${c}`:c<0&&(a=`${a} - ${-c}`);d&&(a=c?`-(${a})`:`-${a}`);Math.floor(e)>=Math.floor(g)&&(a=`(${a})`);return a}},module$build$src$generators$javascript$javascript_generator={};module$build$src$generators$javascript$javascript_generator.JavascriptGenerator=JavascriptGenerator$$module$build$src$generators$javascript$javascript_generator; +module$build$src$generators$javascript$javascript_generator.Order=Order$$module$build$src$generators$javascript$javascript_generator;var getSubstringIndex$$module$build$src$generators$javascript$lists=function(a,b,c){return b==="FIRST"?"0":b==="FROM_END"?a+".length - 1 - "+c:b==="LAST"?a+".length - 1":c},module$build$src$generators$javascript$lists={};module$build$src$generators$javascript$lists.lists_create_empty=lists_create_empty$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_create_with=lists_create_with$$module$build$src$generators$javascript$lists; +module$build$src$generators$javascript$lists.lists_getIndex=lists_getIndex$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_getSublist=lists_getSublist$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_indexOf=lists_indexOf$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_isEmpty=lists_isEmpty$$module$build$src$generators$javascript$lists; +module$build$src$generators$javascript$lists.lists_length=lists_length$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_repeat=lists_repeat$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_reverse=lists_reverse$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_setIndex=lists_setIndex$$module$build$src$generators$javascript$lists; +module$build$src$generators$javascript$lists.lists_sort=lists_sort$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_split=lists_split$$module$build$src$generators$javascript$lists;var controls_ifelse$$module$build$src$generators$javascript$logic=controls_if$$module$build$src$generators$javascript$logic,module$build$src$generators$javascript$logic={};module$build$src$generators$javascript$logic.controls_if=controls_if$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.controls_ifelse=controls_if$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_boolean=logic_boolean$$module$build$src$generators$javascript$logic; +module$build$src$generators$javascript$logic.logic_compare=logic_compare$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_negate=logic_negate$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_null=logic_null$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_operation=logic_operation$$module$build$src$generators$javascript$logic; +module$build$src$generators$javascript$logic.logic_ternary=logic_ternary$$module$build$src$generators$javascript$logic;var controls_repeat$$module$build$src$generators$javascript$loops=controls_repeat_ext$$module$build$src$generators$javascript$loops,module$build$src$generators$javascript$loops={};module$build$src$generators$javascript$loops.controls_flow_statements=controls_flow_statements$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_for=controls_for$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_forEach=controls_forEach$$module$build$src$generators$javascript$loops; +module$build$src$generators$javascript$loops.controls_repeat=controls_repeat_ext$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_repeat_ext=controls_repeat_ext$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_whileUntil=controls_whileUntil$$module$build$src$generators$javascript$loops;var math_round$$module$build$src$generators$javascript$math=math_single$$module$build$src$generators$javascript$math,math_trig$$module$build$src$generators$javascript$math=math_single$$module$build$src$generators$javascript$math,module$build$src$generators$javascript$math={};module$build$src$generators$javascript$math.math_arithmetic=math_arithmetic$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_atan2=math_atan2$$module$build$src$generators$javascript$math; +module$build$src$generators$javascript$math.math_change=math_change$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_constant=math_constant$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_constrain=math_constrain$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_modulo=math_modulo$$module$build$src$generators$javascript$math; +module$build$src$generators$javascript$math.math_number=math_number$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_number_property=math_number_property$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_on_list=math_on_list$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_random_float=math_random_float$$module$build$src$generators$javascript$math; +module$build$src$generators$javascript$math.math_random_int=math_random_int$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_round=math_single$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_single=math_single$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_trig=math_single$$module$build$src$generators$javascript$math;var procedures_defnoreturn$$module$build$src$generators$javascript$procedures=procedures_defreturn$$module$build$src$generators$javascript$procedures,module$build$src$generators$javascript$procedures={};module$build$src$generators$javascript$procedures.procedures_callnoreturn=procedures_callnoreturn$$module$build$src$generators$javascript$procedures;module$build$src$generators$javascript$procedures.procedures_callreturn=procedures_callreturn$$module$build$src$generators$javascript$procedures; +module$build$src$generators$javascript$procedures.procedures_defnoreturn=procedures_defreturn$$module$build$src$generators$javascript$procedures;module$build$src$generators$javascript$procedures.procedures_defreturn=procedures_defreturn$$module$build$src$generators$javascript$procedures;module$build$src$generators$javascript$procedures.procedures_ifreturn=procedures_ifreturn$$module$build$src$generators$javascript$procedures;var strRegExp$$module$build$src$generators$javascript$text=/^\s*'([^']|\\')*'\s*$/,forceString$$module$build$src$generators$javascript$text=function(a){return strRegExp$$module$build$src$generators$javascript$text.test(a)?[a,Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]:["String("+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},getSubstringIndex$$module$build$src$generators$javascript$text=function(a,b,c){return b==="FIRST"?"0": +b==="FROM_END"?a+".length - 1 - "+c:b==="LAST"?a+".length - 1":c},text_prompt$$module$build$src$generators$javascript$text=text_prompt_ext$$module$build$src$generators$javascript$text,module$build$src$generators$javascript$text={};module$build$src$generators$javascript$text.text=text$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_append=text_append$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_changeCase=text_changeCase$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_charAt=text_charAt$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_count=text_count$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_getSubstring=text_getSubstring$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_indexOf=text_indexOf$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_isEmpty=text_isEmpty$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_join=text_join$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_length=text_length$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_print=text_print$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_prompt=text_prompt_ext$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_prompt_ext=text_prompt_ext$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_replace=text_replace$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_reverse=text_reverse$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_trim=text_trim$$module$build$src$generators$javascript$text;var module$build$src$generators$javascript$variables={};module$build$src$generators$javascript$variables.variables_get=variables_get$$module$build$src$generators$javascript$variables;module$build$src$generators$javascript$variables.variables_set=variables_set$$module$build$src$generators$javascript$variables;var module$build$src$generators$javascript$variables_dynamic={};module$build$src$generators$javascript$variables_dynamic.variables_get_dynamic=variables_get$$module$build$src$generators$javascript$variables;module$build$src$generators$javascript$variables_dynamic.variables_set_dynamic=variables_set$$module$build$src$generators$javascript$variables;var javascriptGenerator$$module$build$src$generators$javascript=new JavascriptGenerator$$module$build$src$generators$javascript$javascript_generator,generators$$module$build$src$generators$javascript=Object.assign({},module$build$src$generators$javascript$lists,module$build$src$generators$javascript$logic,module$build$src$generators$javascript$loops,module$build$src$generators$javascript$math,module$build$src$generators$javascript$procedures,module$build$src$generators$javascript$text,module$build$src$generators$javascript$variables, +module$build$src$generators$javascript$variables_dynamic);for(const a in generators$$module$build$src$generators$javascript)javascriptGenerator$$module$build$src$generators$javascript.forBlock[a]=generators$$module$build$src$generators$javascript[a];var module$build$src$generators$javascript={};module$build$src$generators$javascript.JavascriptGenerator=JavascriptGenerator$$module$build$src$generators$javascript$javascript_generator;module$build$src$generators$javascript.Order=Order$$module$build$src$generators$javascript$javascript_generator; +module$build$src$generators$javascript.javascriptGenerator=javascriptGenerator$$module$build$src$generators$javascript; +module$build$src$generators$javascript.__namespace__=$; +return module$build$src$generators$javascript; +})); + + +//# sourceMappingURL=javascript_compressed.js.map diff --git a/crumbblocks/lib/blockly/blocks_compressed.js b/crumbblocks/lib/blockly/blocks_compressed.js new file mode 100644 index 0000000..d7cb63c --- /dev/null +++ b/crumbblocks/lib/blockly/blocks_compressed.js @@ -0,0 +1,193 @@ +// Do not edit this file; automatically generated. + +/* eslint-disable */ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { // AMD + define(["./blockly_compressed.js"], factory); + } else if (typeof exports === 'object') { // Node.js + module.exports = factory(require("./blockly_compressed.js")); + } else { // Script + root.Blockly.libraryBlocks = factory(root.Blockly); + } +}(this, function(__parent__) { +var $=__parent__.__namespace__; +var blocks$$module$build$src$blocks$variables_dynamic=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get_dynamic",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_dynamic_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableDynamicSetterGetter"]},{type:"variables_set_dynamic",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable", +name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"},{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_dynamic_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableDynamicSetterGetter"]}]),CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables_dynamic={customContextMenu:function(a){if(!this.isInFlyout){if(this.type==="variables_get_dynamic"){var b="variables_set_dynamic"; +var c=$.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET}else b="variables_get_dynamic",c=$.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var d=this.getField("VAR");b={type:b,fields:{VAR:d.saveState(!0)}};a.push({enabled:this.workspace.remainingCapacity()>0,text:c.replace("%1",d.getText()),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,b)})}else if(this.type==="variables_get_dynamic"||this.type==="variables_get_reporter_dynamic")c={text:$.Msg$$module$build$src$core$msg.RENAME_VARIABLE, +enabled:!0,callback:renameOptionCallbackFactory$$module$build$src$blocks$variables_dynamic(this)},d=this.getField("VAR").getText(),d={text:$.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",d),enabled:!0,callback:deleteOptionCallbackFactory$$module$build$src$blocks$variables_dynamic(this)},a.unshift(c),a.unshift(d)},onchange:function(a){a=this.getFieldValue("VAR");a=$.getVariable$$module$build$src$core$variables(this.workspace,a);this.type==="variables_get_dynamic"?this.outputConnection.setCheck(a.getType()): +this.getInput("VALUE").connection.setCheck(a.getType())}},renameOptionCallbackFactory$$module$build$src$blocks$variables_dynamic=function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();$.renameVariable$$module$build$src$core$variables(b,c)}},deleteOptionCallbackFactory$$module$build$src$blocks$variables_dynamic=function(a){return function(){const b=a.getField("VAR").getVariable();b&&$.deleteVariable$$module$build$src$core$variables(b.getWorkspace(),b,a)}}; +$.registerMixin$$module$build$src$core$extensions("contextMenu_variableDynamicSetterGetter",CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables_dynamic);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$variables_dynamic);var module$build$src$blocks$variables_dynamic={blocks:blocks$$module$build$src$blocks$variables_dynamic};var blocks$$module$build$src$blocks$variables=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"variables_get",message0:"%1",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}],output:null,style:"variable_blocks",helpUrl:"%{BKY_VARIABLES_GET_HELPURL}",tooltip:"%{BKY_VARIABLES_GET_TOOLTIP}",extensions:["contextMenu_variableSetterGetter"]},{type:"variables_set",message0:"%{BKY_VARIABLES_SET}",args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_VARIABLES_DEFAULT_NAME}"}, +{type:"input_value",name:"VALUE"}],previousStatement:null,nextStatement:null,style:"variable_blocks",tooltip:"%{BKY_VARIABLES_SET_TOOLTIP}",helpUrl:"%{BKY_VARIABLES_SET_HELPURL}",extensions:["contextMenu_variableSetterGetter"]}]),CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables={customContextMenu:function(a){if(!this.isInFlyout){if(this.type==="variables_get"){var b="variables_set";var c=$.Msg$$module$build$src$core$msg.VARIABLES_GET_CREATE_SET}else b="variables_get", +c=$.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET;var d=this.getField("VAR");b={type:b,fields:{VAR:d.saveState(!0)}};a.push({enabled:this.workspace.remainingCapacity()>0,text:c.replace("%1",d.getText()),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,b)})}else if(this.type==="variables_get"||this.type==="variables_get_reporter")c={text:$.Msg$$module$build$src$core$msg.RENAME_VARIABLE,enabled:!0,callback:renameOptionCallbackFactory$$module$build$src$blocks$variables(this)}, +d=this.getField("VAR").getText(),d={text:$.Msg$$module$build$src$core$msg.DELETE_VARIABLE.replace("%1",d),enabled:!0,callback:deleteOptionCallbackFactory$$module$build$src$blocks$variables(this)},a.unshift(c),a.unshift(d)}},renameOptionCallbackFactory$$module$build$src$blocks$variables=function(a){return function(){const b=a.workspace,c=a.getField("VAR").getVariable();$.renameVariable$$module$build$src$core$variables(b,c)}},deleteOptionCallbackFactory$$module$build$src$blocks$variables=function(a){return function(){const b= +a.getField("VAR").getVariable();b&&$.deleteVariable$$module$build$src$core$variables(b.getWorkspace(),b,a)}};$.registerMixin$$module$build$src$core$extensions("contextMenu_variableSetterGetter",CUSTOM_CONTEXT_MENU_VARIABLE_GETTER_SETTER_MIXIN$$module$build$src$blocks$variables);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$variables);var module$build$src$blocks$variables={blocks:blocks$$module$build$src$blocks$variables};var blocks$$module$build$src$blocks$text=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"text",message0:"%1",args0:[{type:"field_input",name:"TEXT",text:""}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_TEXT_HELPURL}",tooltip:"%{BKY_TEXT_TEXT_TOOLTIP}",extensions:["text_quotes","parent_tooltip_when_inline"]},{type:"text_join",message0:"",output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_JOIN_HELPURL}",tooltip:"%{BKY_TEXT_JOIN_TOOLTIP}",mutator:"text_join_mutator"}, +{type:"text_create_join_container",message0:"%{BKY_TEXT_CREATE_JOIN_TITLE_JOIN} %1 %2",args0:[{type:"input_dummy"},{type:"input_statement",name:"STACK"}],style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_TOOLTIP}",enableContextMenu:!1},{type:"text_create_join_item",message0:"%{BKY_TEXT_CREATE_JOIN_ITEM_TITLE_ITEM}",previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:"%{BKY_TEXT_CREATE_JOIN_ITEM_TOOLTIP}",enableContextMenu:!1},{type:"text_append",message0:"%{BKY_TEXT_APPEND_TITLE}", +args0:[{type:"field_variable",name:"VAR",variable:"%{BKY_TEXT_APPEND_VARIABLE}"},{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",extensions:["text_append_tooltip"]},{type:"text_length",message0:"%{BKY_TEXT_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"text_blocks",tooltip:"%{BKY_TEXT_LENGTH_TOOLTIP}",helpUrl:"%{BKY_TEXT_LENGTH_HELPURL}"},{type:"text_isEmpty",message0:"%{BKY_TEXT_ISEMPTY_TITLE}", +args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"text_blocks",tooltip:"%{BKY_TEXT_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_TEXT_ISEMPTY_HELPURL}"},{type:"text_indexOf",message0:"%{BKY_TEXT_INDEXOF_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"END",options:[["%{BKY_TEXT_INDEXOF_OPERATOR_FIRST}","FIRST"],["%{BKY_TEXT_INDEXOF_OPERATOR_LAST}","LAST"]]},{type:"input_value",name:"FIND",check:"String"}],output:"Number",style:"text_blocks", +helpUrl:"%{BKY_TEXT_INDEXOF_HELPURL}",inputsInline:!0,extensions:["text_indexOf_tooltip"]},{type:"text_charAt",message0:"%{BKY_TEXT_CHARAT_TITLE}",args0:[{type:"input_value",name:"VALUE",check:"String"},{type:"field_dropdown",name:"WHERE",options:[["%{BKY_TEXT_CHARAT_FROM_START}","FROM_START"],["%{BKY_TEXT_CHARAT_FROM_END}","FROM_END"],["%{BKY_TEXT_CHARAT_FIRST}","FIRST"],["%{BKY_TEXT_CHARAT_LAST}","LAST"],["%{BKY_TEXT_CHARAT_RANDOM}","RANDOM"]]}],output:"String",style:"text_blocks",helpUrl:"%{BKY_TEXT_CHARAT_HELPURL}", +inputsInline:!0,mutator:"text_charAt_mutator"}]),GET_SUBSTRING_BLOCK$$module$build$src$blocks$text={init:function(){this.WHERE_OPTIONS_1=[[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_FROM_END, +"FROM_END"],[$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_END_LAST,"LAST"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_HELPURL);this.setStyle("text_blocks");this.appendValueInput("STRING").setCheck("String").appendField($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_INPUT_IN_TEXT);const a=b=>{const c=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+b]});c.setValidator(function(d){const e=this.getValue();d=d=== +"FROM_START"||d==="FROM_END";d!==(e==="FROM_START"||e==="FROM_END")&&this.getSourceBlock().updateAt_(b,d)});return c};this.appendDummyInput("WHERE1_INPUT").appendField(a(1),"WHERE1");this.appendDummyInput("AT1");this.appendDummyInput("WHERE2_INPUT").appendField(a(2),"WHERE2");this.appendDummyInput("AT2");$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL);this.setInputsInline(!0);this.setOutput(!0, +"String");this.updateAt_(1,!0);this.updateAt_(2,!0);this.setTooltip($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TOOLTIP)},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");var b=this.getInput("AT1")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at1",`${b}`);b=this.getInput("AT2")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at2",`${b}`);return a},domToMutation:function(a){const b= +a.getAttribute("at1")==="true";a=a.getAttribute("at2")==="true";this.updateAt_(1,b);this.updateAt_(2,a)},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+a);a===2&&$.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL&&(this.removeInput("TAIL", +!0),this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.TEXT_GET_SUBSTRING_TAIL));a===1&&(this.moveInputBefore("AT1","WHERE2_INPUT"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","WHERE2_INPUT"))}};blocks$$module$build$src$blocks$text.text_getSubstring=GET_SUBSTRING_BLOCK$$module$build$src$blocks$text; +blocks$$module$build$src$blocks$text.text_changeCase={init:function(){const a=[[$.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_UPPERCASE,"UPPERCASE"],[$.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_LOWERCASE,"LOWERCASE"],[$.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_OPERATOR_TITLECASE,"TITLECASE"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_HELPURL);this.setStyle("text_blocks");this.appendValueInput("TEXT").setCheck("String").appendField($.fromJson$$module$build$src$core$field_registry({type:"field_dropdown", +options:a}),"CASE");this.setOutput(!0,"String");this.setTooltip($.Msg$$module$build$src$core$msg.TEXT_CHANGECASE_TOOLTIP)}}; +blocks$$module$build$src$blocks$text.text_trim={init:function(){const a=[[$.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_BOTH,"BOTH"],[$.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_LEFT,"LEFT"],[$.Msg$$module$build$src$core$msg.TEXT_TRIM_OPERATOR_RIGHT,"RIGHT"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_TRIM_HELPURL);this.setStyle("text_blocks");this.appendValueInput("TEXT").setCheck("String").appendField($.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a}), +"MODE");this.setOutput(!0,"String");this.setTooltip($.Msg$$module$build$src$core$msg.TEXT_TRIM_TOOLTIP)}};blocks$$module$build$src$blocks$text.text_print={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_PRINT_TITLE,args0:[{type:"input_value",name:"TEXT"}],previousStatement:null,nextStatement:null,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_PRINT_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_PRINT_HELPURL})}}; +var PROMPT_COMMON$$module$build$src$blocks$text={updateType_:function(a){this.outputConnection.setCheck(a==="NUMBER"?"Number":"String")},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("type",this.getFieldValue("TYPE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("type"))}}; +blocks$$module$build$src$blocks$text.text_prompt_ext=Object.assign({},PROMPT_COMMON$$module$build$src$blocks$text,{init:function(){var a=[[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL);this.setStyle("text_blocks");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a});a.setValidator(b=>{this.updateType_(b)});this.appendValueInput("TEXT").appendField(a, +"TYPE");this.setOutput(!0,"String");this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}}); +blocks$$module$build$src$blocks$text.text_prompt=Object.assign({},PROMPT_COMMON$$module$build$src$blocks$text,{init:function(){this.mixin(QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text);var a=[[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_TEXT,"TEXT"],[$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TYPE_NUMBER,"NUMBER"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.TEXT_PROMPT_HELPURL);this.setStyle("text_blocks");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a}); +a.setValidator(b=>{this.updateType_(b)});this.appendDummyInput().appendField(a,"TYPE").appendField(this.newQuote_(!0)).appendField($.fromJson$$module$build$src$core$field_registry({type:"field_input",text:""}),"TEXT").appendField(this.newQuote_(!1));this.setOutput(!0,"String");this.setTooltip(()=>this.getFieldValue("TYPE")==="TEXT"?$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_TEXT:$.Msg$$module$build$src$core$msg.TEXT_PROMPT_TOOLTIP_NUMBER)}}); +blocks$$module$build$src$blocks$text.text_count={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_COUNT_MESSAGE0,args0:[{type:"input_value",name:"SUB",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"Number",inputsInline:!0,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_COUNT_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_COUNT_HELPURL})}}; +blocks$$module$build$src$blocks$text.text_replace={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_REPLACE_MESSAGE0,args0:[{type:"input_value",name:"FROM",check:"String"},{type:"input_value",name:"TO",check:"String"},{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_REPLACE_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_REPLACE_HELPURL})}}; +blocks$$module$build$src$blocks$text.text_reverse={init:function(){this.jsonInit({message0:$.Msg$$module$build$src$core$msg.TEXT_REVERSE_MESSAGE0,args0:[{type:"input_value",name:"TEXT",check:"String"}],output:"String",inputsInline:!0,style:"text_blocks",tooltip:$.Msg$$module$build$src$core$msg.TEXT_REVERSE_TOOLTIP,helpUrl:$.Msg$$module$build$src$core$msg.TEXT_REVERSE_HELPURL})}}; +var QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text={QUOTE_IMAGE_LEFT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAn0lEQVQI1z3OMa5BURSF4f/cQhAKjUQhuQmFNwGJEUi0RKN5rU7FHKhpjEH3TEMtkdBSCY1EIv8r7nFX9e29V7EBAOvu7RPjwmWGH/VuF8CyN9/OAdvqIXYLvtRaNjx9mMTDyo+NjAN1HNcl9ZQ5oQMM3dgDUqDo1l8DzvwmtZN7mnD+PkmLa+4mhrxVA9fRowBWmVBhFy5gYEjKMfz9AylsaRRgGzvZAAAAAElFTkSuQmCC",QUOTE_IMAGE_RIGHT_DATAURI:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAKCAQAAAAqJXdxAAAAqUlEQVQI1z3KvUpCcRiA8ef9E4JNHhI0aFEacm1o0BsI0Slx8wa8gLauoDnoBhq7DcfWhggONDmJJgqCPA7neJ7p934EOOKOnM8Q7PDElo/4x4lFb2DmuUjcUzS3URnGib9qaPNbuXvBO3sGPHJDRG6fGVdMSeWDP2q99FQdFrz26Gu5Tq7dFMzUvbXy8KXeAj57cOklgA+u1B5AoslLtGIHQMaCVnwDnADZIFIrXsoXrgAAAABJRU5ErkJggg==", +QUOTE_IMAGE_WIDTH:12,QUOTE_IMAGE_HEIGHT:12,quoteField_:function(a){for(let b=0,c;c=this.inputList[b];b++)for(let d=0,e;e=c.fieldRow[d];d++)if(a===e.name){c.insertFieldAt(d,this.newQuote_(!0));c.insertFieldAt(d+2,this.newQuote_(!1));return}console.warn('field named "'+a+'" not found in '+this.toDevString())},newQuote_:function(a){a=this.RTL?!a:a;return $.fromJson$$module$build$src$core$field_registry({type:"field_image",src:a?this.QUOTE_IMAGE_LEFT_DATAURI:this.QUOTE_IMAGE_RIGHT_DATAURI,width:this.QUOTE_IMAGE_WIDTH, +height:this.QUOTE_IMAGE_HEIGHT,alt:a?"\u201c":"\u201d"})}},QUOTES_EXTENSION$$module$build$src$blocks$text=function(){this.mixin(QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text);this.quoteField_("TEXT")},JOIN_MUTATOR_MIXIN$$module$build$src$blocks$text={itemCount_:0,mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("items",`${this.itemCount_}`);return a},domToMutation:function(a){this.itemCount_=parseInt(a.getAttribute("items"),10);this.updateShape_()}, +saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(a){this.itemCount_=a.itemCount;this.updateShape_()},decompose:function(a){const b=a.newBlock("text_create_join_container");b.initSvg();let c=b.getInput("STACK").connection;for(let d=0;d$.Msg$$module$build$src$core$msg.TEXT_INDEXOF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))},CHARAT_MUTATOR_MIXIN$$module$build$src$blocks$text={isAt_:!1,mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("at",`${this.isAt_}`);return a},domToMutation:function(a){a=a.getAttribute("at")!=="false";this.updateAt_(a)},updateAt_:function(a){this.removeInput("AT", +!0);this.removeInput("ORDINAL",!0);a&&(this.appendValueInput("AT").setCheck("Number"),$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX));$.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL&&(this.removeInput("TAIL",!0),this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.TEXT_CHARAT_TAIL));this.isAt_=a}},CHARAT_EXTENSION$$module$build$src$blocks$text=function(){this.getField("WHERE").setValidator(function(a){a= +a==="FROM_START"||a==="FROM_END";const b=this.getSourceBlock();a!==b.isAt_&&b.updateAt_(a)});this.updateAt_(!0);this.setTooltip(()=>{var a=this.getFieldValue("WHERE");let b=$.Msg$$module$build$src$core$msg.TEXT_CHARAT_TOOLTIP;(a==="FROM_START"||a==="FROM_END")&&(a=a==="FROM_START"?$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP)&&(b+=" "+a.replace("%1",this.workspace.options.oneBasedIndex?"#1":"#0"));return b})}; +$.register$$module$build$src$core$extensions("text_indexOf_tooltip",INDEXOF_TOOLTIP_EXTENSION$$module$build$src$blocks$text);$.register$$module$build$src$core$extensions("text_quotes",QUOTES_EXTENSION$$module$build$src$blocks$text);$.registerMixin$$module$build$src$core$extensions("quote_image_mixin",QUOTE_IMAGE_MIXIN$$module$build$src$blocks$text);$.registerMutator$$module$build$src$core$extensions("text_join_mutator",JOIN_MUTATOR_MIXIN$$module$build$src$blocks$text,JOIN_EXTENSION$$module$build$src$blocks$text); +$.registerMutator$$module$build$src$core$extensions("text_charAt_mutator",CHARAT_MUTATOR_MIXIN$$module$build$src$blocks$text,CHARAT_EXTENSION$$module$build$src$blocks$text);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$text);var module$build$src$blocks$text={blocks:blocks$$module$build$src$blocks$text};var blocks$$module$build$src$blocks$procedures={},PROCEDURE_DEF_COMMON$$module$build$src$blocks$procedures={setStatements_:function(a){this.hasStatements_!==a&&(a?(this.appendStatementInput("STACK").appendField($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_DO),this.getInput("RETURN")&&this.moveInputBefore("STACK","RETURN")):this.removeInput("STACK",!0),this.hasStatements_=a)},updateParams_:function(){let a="";this.arguments_.length&&(a=$.Msg$$module$build$src$core$msg.PROCEDURES_BEFORE_PARAMS+ +" "+this.arguments_.join(", "));$.disable$$module$build$src$core$events$utils();try{this.setFieldValue(a,"PARAMS")}finally{$.enable$$module$build$src$core$events$utils()}},mutationToDom:function(a){const b=$.createElement$$module$build$src$core$utils$xml("mutation");a&&b.setAttribute("name",this.getFieldValue("NAME"));for(let c=0;c","GT"],["\u200f\u2265","GTE"]]},{type:"input_value",name:"B"}], +inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_COMPARE_HELPURL}",extensions:["logic_compare","logic_op_tooltip"]},{type:"logic_operation",message0:"%1 %2 %3",args0:[{type:"input_value",name:"A",check:"Boolean"},{type:"field_dropdown",name:"OP",options:[["%{BKY_LOGIC_OPERATION_AND}","AND"],["%{BKY_LOGIC_OPERATION_OR}","OR"]]},{type:"input_value",name:"B",check:"Boolean"}],inputsInline:!0,output:"Boolean",style:"logic_blocks",helpUrl:"%{BKY_LOGIC_OPERATION_HELPURL}",extensions:["logic_op_tooltip"]}, +{type:"logic_negate",message0:"%{BKY_LOGIC_NEGATE_TITLE}",args0:[{type:"input_value",name:"BOOL",check:"Boolean"}],output:"Boolean",style:"logic_blocks",tooltip:"%{BKY_LOGIC_NEGATE_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NEGATE_HELPURL}"},{type:"logic_null",message0:"%{BKY_LOGIC_NULL}",output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_NULL_TOOLTIP}",helpUrl:"%{BKY_LOGIC_NULL_HELPURL}"},{type:"logic_ternary",message0:"%{BKY_LOGIC_TERNARY_CONDITION} %1",args0:[{type:"input_value",name:"IF",check:"Boolean"}], +message1:"%{BKY_LOGIC_TERNARY_IF_TRUE} %1",args1:[{type:"input_value",name:"THEN"}],message2:"%{BKY_LOGIC_TERNARY_IF_FALSE} %1",args2:[{type:"input_value",name:"ELSE"}],output:null,style:"logic_blocks",tooltip:"%{BKY_LOGIC_TERNARY_TOOLTIP}",helpUrl:"%{BKY_LOGIC_TERNARY_HELPURL}",extensions:["logic_ternary"]},{type:"controls_if_if",message0:"%{BKY_CONTROLS_IF_IF_TITLE_IF}",nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_IF_TOOLTIP}"},{type:"controls_if_elseif", +message0:"%{BKY_CONTROLS_IF_ELSEIF_TITLE_ELSEIF}",previousStatement:null,nextStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSEIF_TOOLTIP}"},{type:"controls_if_else",message0:"%{BKY_CONTROLS_IF_ELSE_TITLE_ELSE}",previousStatement:null,enableContextMenu:!1,style:"logic_blocks",tooltip:"%{BKY_CONTROLS_IF_ELSE_TOOLTIP}"}]),TOOLTIPS_BY_OP$$module$build$src$blocks$logic={EQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_EQ}",NEQ:"%{BKY_LOGIC_COMPARE_TOOLTIP_NEQ}",LT:"%{BKY_LOGIC_COMPARE_TOOLTIP_LT}", +LTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_LTE}",GT:"%{BKY_LOGIC_COMPARE_TOOLTIP_GT}",GTE:"%{BKY_LOGIC_COMPARE_TOOLTIP_GTE}",AND:"%{BKY_LOGIC_OPERATION_TOOLTIP_AND}",OR:"%{BKY_LOGIC_OPERATION_TOOLTIP_OR}"};$.register$$module$build$src$core$extensions("logic_op_tooltip",$.buildTooltipForDropdown$$module$build$src$core$extensions("OP",TOOLTIPS_BY_OP$$module$build$src$blocks$logic)); +var CONTROLS_IF_MUTATOR_MIXIN$$module$build$src$blocks$logic={elseifCount_:0,elseCount_:0,mutationToDom:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const a=$.createElement$$module$build$src$core$utils$xml("mutation");this.elseifCount_&&a.setAttribute("elseif",String(this.elseifCount_));this.elseCount_&&a.setAttribute("else","1");return a},domToMutation:function(a){this.elseifCount_=parseInt(a.getAttribute("elseif"),10)||0;this.elseCount_=parseInt(a.getAttribute("else"),10)||0;this.rebuildShape_()}, +saveExtraState:function(){if(!this.elseifCount_&&!this.elseCount_)return null;const a=Object.create(null);this.elseifCount_&&(a.elseIfCount=this.elseifCount_);this.elseCount_&&(a.hasElse=!0);return a},loadExtraState:function(a){this.elseifCount_=a.elseIfCount||0;this.elseCount_=a.hasElse?1:0;this.updateShape_()},decompose:function(a){const b=a.newBlock("controls_if_if");b.initSvg();let c=b.nextConnection;for(let d=1;d<=this.elseifCount_;d++){const e=a.newBlock("controls_if_elseif");e.initSvg();c.connect(e.previousConnection); +c=e.nextConnection}this.elseCount_&&(a=a.newBlock("controls_if_else"),a.initSvg(),c.connect(a.previousConnection));return b},compose:function(a){a=a.nextConnection.targetBlock();this.elseCount_=this.elseifCount_=0;const b=[null],c=[null];let d=null;for(;a;){if(!a.isInsertionMarker())switch(a.type){case "controls_if_elseif":this.elseifCount_++;b.push(a.valueConnection_);c.push(a.statementConnection_);break;case "controls_if_else":this.elseCount_++;d=a.statementConnection_;break;default:throw TypeError("Unknown block type: "+ +a.type);}a=a.getNextBlock()}this.updateShape_();this.reconnectChildBlocks_(b,c,d)},saveConnections:function(a){a=a.nextConnection.targetBlock();let b=1;for(;a;){if(!a.isInsertionMarker())switch(a.type){case "controls_if_elseif":var c=this.getInput("IF"+b);const d=this.getInput("DO"+b);a.valueConnection_=c&&c.connection.targetConnection;a.statementConnection_=d&&d.connection.targetConnection;b++;break;case "controls_if_else":c=this.getInput("ELSE");a.statementConnection_=c&&c.connection.targetConnection; +break;default:throw TypeError("Unknown block type: "+a.type);}a=a.getNextBlock()}},rebuildShape_:function(){const a=[null],b=[null];let c=null;this.getInput("ELSE")&&(c=this.getInput("ELSE").connection.targetConnection);for(let d=1;this.getInput("IF"+d);d++){const e=this.getInput("IF"+d),f=this.getInput("DO"+d);a.push(e.connection.targetConnection);b.push(f.connection.targetConnection)}this.updateShape_();this.reconnectChildBlocks_(a,b,c)},updateShape_:function(){this.getInput("ELSE")&&this.removeInput("ELSE"); +for(var a=1;this.getInput("IF"+a);a++)this.removeInput("IF"+a),this.removeInput("DO"+a);for(a=1;a<=this.elseifCount_;a++)this.appendValueInput("IF"+a).setCheck("Boolean").appendField($.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSEIF),this.appendStatementInput("DO"+a).appendField($.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_THEN);this.elseCount_&&this.appendStatementInput("ELSE").appendField($.Msg$$module$build$src$core$msg.CONTROLS_IF_MSG_ELSE)},reconnectChildBlocks_:function(a,b,c){for(let d= +1;d<=this.elseifCount_;d++){let e;(e=a[d])==null||e.reconnect(this,"IF"+d);let f;(f=b[d])==null||f.reconnect(this,"DO"+d)}c==null||c.reconnect(this,"ELSE")}};$.registerMutator$$module$build$src$core$extensions("controls_if_mutator",CONTROLS_IF_MUTATOR_MIXIN$$module$build$src$blocks$logic,null,["controls_if_elseif","controls_if_else"]); +var CONTROLS_IF_TOOLTIP_EXTENSION$$module$build$src$blocks$logic=function(){this.setTooltip(function(){if(this.elseifCount_||this.elseCount_){if(!this.elseifCount_&&this.elseCount_)return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_2;if(this.elseifCount_&&!this.elseCount_)return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_3;if(this.elseifCount_&&this.elseCount_)return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_4}else return $.Msg$$module$build$src$core$msg.CONTROLS_IF_TOOLTIP_1; +return""}.bind(this))};$.register$$module$build$src$core$extensions("controls_if_tooltip",CONTROLS_IF_TOOLTIP_EXTENSION$$module$build$src$blocks$logic); +var LOGIC_COMPARE_ONCHANGE_MIXIN$$module$build$src$blocks$logic={onchange:function(a){this.prevBlocks_||(this.prevBlocks_=[null,null]);var b=this.getInputTargetBlock("A");const c=this.getInputTargetBlock("B");b&&c&&!this.workspace.connectionChecker.doTypeChecks(b.outputConnection,c.outputConnection)&&($.setGroup$$module$build$src$core$events$utils(a.group),a=this.prevBlocks_[0],a!==b&&(b.unplug(),!a||a.isDisposed()||a.isShadow()||this.getInput("A").connection.connect(a.outputConnection)),b=this.prevBlocks_[1], +b!==c&&(c.unplug(),!b||b.isDisposed()||b.isShadow()||this.getInput("B").connection.connect(b.outputConnection)),this.bumpNeighbours(),$.setGroup$$module$build$src$core$events$utils(!1));this.prevBlocks_[0]=this.getInputTargetBlock("A");this.prevBlocks_[1]=this.getInputTargetBlock("B")}},LOGIC_COMPARE_EXTENSION$$module$build$src$blocks$logic=function(){this.mixin(LOGIC_COMPARE_ONCHANGE_MIXIN$$module$build$src$blocks$logic)};$.register$$module$build$src$core$extensions("logic_compare",LOGIC_COMPARE_EXTENSION$$module$build$src$blocks$logic); +var LOGIC_TERNARY_ONCHANGE_MIXIN$$module$build$src$blocks$logic={prevParentConnection_:null,onchange:function(a){const b=this.getInputTargetBlock("THEN"),c=this.getInputTargetBlock("ELSE"),d=this.outputConnection.targetConnection;if((b||c)&&d)for(let e=0;e<2;e++){const f=e===1?b:c;f&&!f.workspace.connectionChecker.doTypeChecks(f.outputConnection,d)&&($.setGroup$$module$build$src$core$events$utils(a.group),d===this.prevParentConnection_?(this.unplug(),d.getSourceBlock().bumpNeighbours()):(f.unplug(), +f.bumpNeighbours()),$.setGroup$$module$build$src$core$events$utils(!1))}this.prevParentConnection_=d}};$.registerMixin$$module$build$src$core$extensions("logic_ternary",LOGIC_TERNARY_ONCHANGE_MIXIN$$module$build$src$blocks$logic);$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$logic);var module$build$src$blocks$logic={blocks:blocks$$module$build$src$blocks$logic};var blocks$$module$build$src$blocks$lists=$.createBlockDefinitionsFromJsonArray$$module$build$src$core$common([{type:"lists_create_empty",message0:"%{BKY_LISTS_CREATE_EMPTY_TITLE}",output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_CREATE_EMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_CREATE_EMPTY_HELPURL}"},{type:"lists_repeat",message0:"%{BKY_LISTS_REPEAT_TITLE}",args0:[{type:"input_value",name:"ITEM"},{type:"input_value",name:"NUM",check:"Number"}],output:"Array",style:"list_blocks",tooltip:"%{BKY_LISTS_REPEAT_TOOLTIP}", +helpUrl:"%{BKY_LISTS_REPEAT_HELPURL}"},{type:"lists_reverse",message0:"%{BKY_LISTS_REVERSE_MESSAGE0}",args0:[{type:"input_value",name:"LIST",check:"Array"}],output:"Array",inputsInline:!0,style:"list_blocks",tooltip:"%{BKY_LISTS_REVERSE_TOOLTIP}",helpUrl:"%{BKY_LISTS_REVERSE_HELPURL}"},{type:"lists_isEmpty",message0:"%{BKY_LISTS_ISEMPTY_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Boolean",style:"list_blocks",tooltip:"%{BKY_LISTS_ISEMPTY_TOOLTIP}",helpUrl:"%{BKY_LISTS_ISEMPTY_HELPURL}"}, +{type:"lists_length",message0:"%{BKY_LISTS_LENGTH_TITLE}",args0:[{type:"input_value",name:"VALUE",check:["String","Array"]}],output:"Number",style:"list_blocks",tooltip:"%{BKY_LISTS_LENGTH_TOOLTIP}",helpUrl:"%{BKY_LISTS_LENGTH_HELPURL}"}]),LISTS_CREATE_WITH$$module$build$src$blocks$lists={init:function(){this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_HELPURL);this.setStyle("list_blocks");this.itemCount_=3;this.updateShape_();this.setOutput(!0,"Array");this.setMutator(new $.MutatorIcon$$module$build$src$core$icons$mutator_icon(["lists_create_with_item"], +this));this.setTooltip($.Msg$$module$build$src$core$msg.LISTS_CREATE_WITH_TOOLTIP)},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("items",String(this.itemCount_));return a},domToMutation:function(a){a=a.getAttribute("items");if(!a)throw new TypeError("element did not have items");this.itemCount_=parseInt(a,10);this.updateShape_()},saveExtraState:function(){return{itemCount:this.itemCount_}},loadExtraState:function(a){this.itemCount_=a.itemCount; +this.updateShape_()},decompose:function(a){const b=a.newBlock("lists_create_with_container");b.initSvg();let c=b.getInput("STACK").connection;for(let d=0;d$.Msg$$module$build$src$core$msg.LISTS_INDEX_OF_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex?"0":"-1"))}};blocks$$module$build$src$blocks$lists.lists_indexOf=LISTS_INDEXOF$$module$build$src$blocks$lists; +var LISTS_GETINDEX$$module$build$src$blocks$lists={init:function(){var a=[[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET,"GET"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_GET_REMOVE,"GET_REMOVE"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_REMOVE,"REMOVE"]];this.WHERE_OPTIONS=[[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"], +[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM,"RANDOM"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_HELPURL);this.setStyle("list_blocks");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a});a.setValidator(function(b){b=b==="REMOVE";this.getSourceBlock().updateStatement_(b)});this.appendValueInput("VALUE").setCheck("Array").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_INPUT_IN_LIST); +this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});a.setValidator(function(b){const c=this.getValue();b=b==="FROM_START"||b==="FROM_END";b!==(c==="FROM_START"||c==="FROM_END")&&this.getSourceBlock().updateAt_(b)});this.appendDummyInput().appendField(a,"WHERE");this.appendDummyInput("AT");$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL); +this.setInputsInline(!0);this.setOutput(!0);this.updateAt_(!0);this.setTooltip(()=>{const b=this.getFieldValue("MODE"),c=this.getFieldValue("WHERE");let d="";switch(b+" "+c){case "GET FROM_START":case "GET FROM_END":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FROM;break;case "GET FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_FIRST;break;case "GET LAST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_LAST;break;case "GET RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_RANDOM; +break;case "GET_REMOVE FROM_START":case "GET_REMOVE FROM_END":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM;break;case "GET_REMOVE FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST;break;case "GET_REMOVE LAST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST;break;case "GET_REMOVE RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM;break;case "REMOVE FROM_START":case "REMOVE FROM_END":d= +$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM;break;case "REMOVE FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST;break;case "REMOVE LAST":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST;break;case "REMOVE RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM}if(c==="FROM_START"||c==="FROM_END")d+=" "+(c==="FROM_START"?$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP:$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_END_TOOLTIP).replace("%1", +this.workspace.options.oneBasedIndex?"#1":"#0");return d})},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("statement",String(!this.outputConnection));const b=this.getInput("AT")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at",String(b));return a},domToMutation:function(a){const b=a.getAttribute("statement")==="true";this.updateStatement_(b);a=a.getAttribute("at")!=="false";this.updateAt_(a)},saveExtraState:function(){return this.outputConnection? +null:{isStatement:!0}},loadExtraState:function(a){a.isStatement?this.updateStatement_(!0):typeof a==="string"&&this.domToMutation($.textToDom$$module$build$src$core$utils$xml(a))},updateStatement_:function(a){a!==!this.outputConnection&&(this.unplug(!0,!0),a?(this.setOutput(!1),this.setPreviousStatement(!0),this.setNextStatement(!0)):(this.setPreviousStatement(!1),this.setNextStatement(!1),this.setOutput(!0)))},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"), +$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_TAIL&&this.moveInputBefore("TAIL",null)}};blocks$$module$build$src$blocks$lists.lists_getIndex=LISTS_GETINDEX$$module$build$src$blocks$lists; +var LISTS_SETINDEX$$module$build$src$blocks$lists={init:function(){var a=[[$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_SET,"SET"],[$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INSERT,"INSERT"]];this.WHERE_OPTIONS=[[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_FIRST,"FIRST"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_LAST,"LAST"],[$.Msg$$module$build$src$core$msg.LISTS_GET_INDEX_RANDOM, +"RANDOM"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_HELPURL);this.setStyle("list_blocks");this.appendValueInput("LIST").setCheck("Array").appendField($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_IN_LIST);a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:a});this.appendDummyInput().appendField(a,"MODE").appendField("","SPACE");a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this.WHERE_OPTIONS});a.setValidator(function(b){const c= +this.getValue();b=b==="FROM_START"||b==="FROM_END";b!==(c==="FROM_START"||c==="FROM_END")&&this.getSourceBlock().updateAt_(b)});this.appendDummyInput().appendField(a,"WHERE");this.appendDummyInput("AT");this.appendValueInput("TO").appendField($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_INPUT_TO);this.setInputsInline(!0);this.setPreviousStatement(!0);this.setNextStatement(!0);this.setTooltip($.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP);this.updateAt_(!0);this.setTooltip(()=>{const b= +this.getFieldValue("MODE"),c=this.getFieldValue("WHERE");let d="";switch(b+" "+c){case "SET FROM_START":case "SET FROM_END":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FROM;break;case "SET FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_FIRST;break;case "SET LAST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_LAST;break;case "SET RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_SET_RANDOM;break;case "INSERT FROM_START":case "INSERT FROM_END":d= +$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FROM;break;case "INSERT FIRST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST;break;case "INSERT LAST":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_LAST;break;case "INSERT RANDOM":d=$.Msg$$module$build$src$core$msg.LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM}if(c==="FROM_START"||c==="FROM_END")d+=" "+$.Msg$$module$build$src$core$msg.LISTS_INDEX_FROM_START_TOOLTIP.replace("%1",this.workspace.options.oneBasedIndex? +"#1":"#0");return d})},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation"),b=this.getInput("AT")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at",String(b));return a},domToMutation:function(a){a=a.getAttribute("at")!=="false";this.updateAt_(a)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(a){this.removeInput("AT");this.removeInput("ORDINAL",!0);a?(this.appendValueInput("AT").setCheck("Number"), +$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL").appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT");this.moveInputBefore("AT","TO");this.getInput("ORDINAL")&&this.moveInputBefore("ORDINAL","TO")}};blocks$$module$build$src$blocks$lists.lists_setIndex=LISTS_SETINDEX$$module$build$src$blocks$lists; +var LISTS_GETSUBLIST$$module$build$src$blocks$lists={init:function(){this.WHERE_OPTIONS_1=[[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FROM_END,"FROM_END"],[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_START_FIRST,"FIRST"]];this.WHERE_OPTIONS_2=[[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_START,"FROM_START"],[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_FROM_END,"FROM_END"], +[$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_END_LAST,"LAST"]];this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_HELPURL);this.setStyle("list_blocks");this.appendValueInput("LIST").setCheck("Array").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_INPUT_IN_LIST);const a=b=>{const c=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:this["WHERE_OPTIONS_"+b]});c.setValidator(function(d){const e=this.getValue();d=d==="FROM_START"||d=== +"FROM_END";d!==(e==="FROM_START"||e==="FROM_END")&&this.getSourceBlock().updateAt_(b,d)});return c};this.appendDummyInput("WHERE1_INPUT").appendField(a(1),"WHERE1");this.appendDummyInput("AT1");this.appendDummyInput("WHERE2_INPUT").appendField(a(2),"WHERE2");this.appendDummyInput("AT2");$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.appendDummyInput("TAIL").appendField($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL);this.setInputsInline(!0);this.setOutput(!0,"Array");this.updateAt_(1, +!0);this.updateAt_(2,!0);this.setTooltip($.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TOOLTIP)},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");var b=this.getInput("AT1")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at1",String(b));b=this.getInput("AT2")instanceof $.ValueInput$$module$build$src$core$inputs$value_input;a.setAttribute("at2",String(b));return a},domToMutation:function(a){const b=a.getAttribute("at1")=== +"true";a=a.getAttribute("at2")==="true";this.updateAt_(1,b);this.updateAt_(2,a)},saveExtraState:function(){return null},loadExtraState:function(){},updateAt_:function(a,b){this.removeInput("AT"+a);this.removeInput("ORDINAL"+a,!0);b?(this.appendValueInput("AT"+a).setCheck("Number"),$.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX&&this.appendDummyInput("ORDINAL"+a).appendField($.Msg$$module$build$src$core$msg.ORDINAL_NUMBER_SUFFIX)):this.appendDummyInput("AT"+a);a===1&&(this.moveInputBefore("AT1", +"WHERE2_INPUT"),this.getInput("ORDINAL1")&&this.moveInputBefore("ORDINAL1","WHERE2_INPUT"));$.Msg$$module$build$src$core$msg.LISTS_GET_SUBLIST_TAIL&&this.moveInputBefore("TAIL",null)}};blocks$$module$build$src$blocks$lists.lists_getSublist=LISTS_GETSUBLIST$$module$build$src$blocks$lists; +blocks$$module$build$src$blocks$lists.lists_sort={init:function(){this.jsonInit({message0:"%{BKY_LISTS_SORT_TITLE}",args0:[{type:"field_dropdown",name:"TYPE",options:[["%{BKY_LISTS_SORT_TYPE_NUMERIC}","NUMERIC"],["%{BKY_LISTS_SORT_TYPE_TEXT}","TEXT"],["%{BKY_LISTS_SORT_TYPE_IGNORECASE}","IGNORE_CASE"]]},{type:"field_dropdown",name:"DIRECTION",options:[["%{BKY_LISTS_SORT_ORDER_ASCENDING}","1"],["%{BKY_LISTS_SORT_ORDER_DESCENDING}","-1"]]},{type:"input_value",name:"LIST",check:"Array"}],output:"Array", +style:"list_blocks",tooltip:"%{BKY_LISTS_SORT_TOOLTIP}",helpUrl:"%{BKY_LISTS_SORT_HELPURL}"})}}; +blocks$$module$build$src$blocks$lists.lists_split={init:function(){const a=$.fromJson$$module$build$src$core$field_registry({type:"field_dropdown",options:[[$.Msg$$module$build$src$core$msg.LISTS_SPLIT_LIST_FROM_TEXT,"SPLIT"],[$.Msg$$module$build$src$core$msg.LISTS_SPLIT_TEXT_FROM_LIST,"JOIN"]]});if(!a)throw Error("field_dropdown not found");a.setValidator(b=>{this.updateType_(b)});this.setHelpUrl($.Msg$$module$build$src$core$msg.LISTS_SPLIT_HELPURL);this.setStyle("list_blocks");this.appendValueInput("INPUT").setCheck("String").appendField(a, +"MODE");this.appendValueInput("DELIM").setCheck("String").appendField($.Msg$$module$build$src$core$msg.LISTS_SPLIT_WITH_DELIMITER);this.setInputsInline(!0);this.setOutput(!0,"Array");this.setTooltip(()=>{const b=this.getFieldValue("MODE");if(b==="SPLIT")return $.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_SPLIT;if(b==="JOIN")return $.Msg$$module$build$src$core$msg.LISTS_SPLIT_TOOLTIP_JOIN;throw Error("Unknown mode: "+b);})},updateType_:function(a){if(this.getFieldValue("MODE")!==a){const b= +this.getInput("INPUT").connection;b.setShadowDom(null);const c=b.targetBlock();c&&(b.disconnect(),c.isShadow()?c.dispose(!1):this.bumpNeighbours())}a==="SPLIT"?(this.outputConnection.setCheck("Array"),this.getInput("INPUT").setCheck("String")):(this.outputConnection.setCheck("String"),this.getInput("INPUT").setCheck("Array"))},mutationToDom:function(){const a=$.createElement$$module$build$src$core$utils$xml("mutation");a.setAttribute("mode",this.getFieldValue("MODE"));return a},domToMutation:function(a){this.updateType_(a.getAttribute("mode"))}, +saveExtraState:function(){return{mode:this.getFieldValue("MODE")}},loadExtraState:function(a){this.updateType_(a.mode)}};$.defineBlocks$$module$build$src$core$common(blocks$$module$build$src$blocks$lists);var module$build$src$blocks$lists={blocks:blocks$$module$build$src$blocks$lists};var blocks$$module$build$src$blocks$blocks=Object.assign({},blocks$$module$build$src$blocks$lists,blocks$$module$build$src$blocks$logic,blocks$$module$build$src$blocks$loops,blocks$$module$build$src$blocks$math,blocks$$module$build$src$blocks$procedures,blocks$$module$build$src$blocks$text,blocks$$module$build$src$blocks$variables,blocks$$module$build$src$blocks$variables_dynamic),module$build$src$blocks$blocks={blocks:blocks$$module$build$src$blocks$blocks,lists:module$build$src$blocks$lists,logic:module$build$src$blocks$logic, +loops:module$build$src$blocks$loops,math:module$build$src$blocks$math,procedures:module$build$src$blocks$procedures,texts:module$build$src$blocks$text,variables:module$build$src$blocks$variables,variablesDynamic:module$build$src$blocks$variables_dynamic}; +module$build$src$blocks$blocks.__namespace__=$; +return module$build$src$blocks$blocks; +})); + + +//# sourceMappingURL=blocks_compressed.js.map diff --git a/crumbblocks/lib/blockly/de.js b/crumbblocks/lib/blockly/de.js new file mode 100644 index 0000000..4fa15f9 --- /dev/null +++ b/crumbblocks/lib/blockly/de.js @@ -0,0 +1,465 @@ +/* eslint-disable */ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { // AMD + define([], factory); + } else if (typeof exports === 'object') { // Node.js + module.exports = factory(); + } else { // Browser + var messages = factory(); + for (var key in messages) { + root.Blockly.Msg[key] = messages[key]; + } + } +}(this, function() { +// This file was automatically generated. Do not modify. + +'use strict'; + +var Blockly = Blockly || { Msg: Object.create(null) }; + +Blockly.Msg["ADD_COMMENT"] = "Kommentar hinzufügen"; +Blockly.Msg["ALT_KEY"] = "Alt"; // untranslated +Blockly.Msg["CANNOT_DELETE_VARIABLE_PROCEDURE"] = "Die Variable „%1“ kann nicht gelöscht werden, da sie Teil der Definition der Funktion „%2“ ist."; +Blockly.Msg["CHANGE_VALUE_TITLE"] = "Wert ändern:"; +Blockly.Msg["CHROME_OS"] = "ChromeOS"; // untranslated +Blockly.Msg["CLEAN_UP"] = "Bausteine aufräumen"; +Blockly.Msg["CLOSE"] = "Close"; // untranslated +Blockly.Msg["COLLAPSED_WARNINGS_WARNING"] = "Eingeklappte Blöcke enthalten Warnungen."; +Blockly.Msg["COLLAPSE_ALL"] = "Alle Bausteine zusammenfalten"; +Blockly.Msg["COLLAPSE_BLOCK"] = "Baustein zusammenfalten"; +Blockly.Msg["COLOUR_BLEND_COLOUR1"] = "Farbe 1"; +Blockly.Msg["COLOUR_BLEND_COLOUR2"] = "und Farbe 2"; +Blockly.Msg["COLOUR_BLEND_HELPURL"] = "https://meyerweb.com/eric/tools/color-blend/#:::rgbp"; // untranslated +Blockly.Msg["COLOUR_BLEND_RATIO"] = "im Verhältnis"; +Blockly.Msg["COLOUR_BLEND_TITLE"] = "mische"; +Blockly.Msg["COLOUR_BLEND_TOOLTIP"] = "Vermischt 2 Farben mit konfigurierbarem Farbverhältnis (0.0 - 1.0)."; +Blockly.Msg["COLOUR_PICKER_HELPURL"] = "https://de.wikipedia.org/wiki/Farbe"; +Blockly.Msg["COLOUR_PICKER_TOOLTIP"] = "Wähle eine Farbe aus der Palette."; +Blockly.Msg["COLOUR_RANDOM_HELPURL"] = "http://randomcolour.com"; // untranslated +Blockly.Msg["COLOUR_RANDOM_TITLE"] = "zufällige Farbe"; +Blockly.Msg["COLOUR_RANDOM_TOOLTIP"] = "Erzeugt eine Farbe nach dem Zufallsprinzip."; +Blockly.Msg["COLOUR_RGB_BLUE"] = "blau"; +Blockly.Msg["COLOUR_RGB_GREEN"] = "grün"; +Blockly.Msg["COLOUR_RGB_HELPURL"] = "https://www.december.com/html/spec/colorpercompact.html"; // untranslated +Blockly.Msg["COLOUR_RGB_RED"] = "rot"; +Blockly.Msg["COLOUR_RGB_TITLE"] = "Farbe aus"; +Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "Erzeugt eine Farbe mit selbst definierten Rot-, Grün- und Blauwerten. Alle Werte müssen zwischen 0 und 100 liegen."; +Blockly.Msg["COMMAND_KEY"] = "⌘ Command"; // untranslated +Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://de.wikipedia.org/wiki/Kontrollstruktur"; +Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "die Schleife abbrechen"; +Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "sofort mit nächstem Schleifendurchlauf fortfahren"; +Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Die umgebende Schleife beenden."; +Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Diese Anweisung abbrechen und mit dem nächsten Schleifendurchlauf fortfahren."; +Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warnung: Dieser Baustein kann nur in einer Schleife verwendet werden."; +Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://de.wikipedia.org/wiki/For-Schleife"; +Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "für jeden Wert %1 aus der Liste %2"; +Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "Führt eine Anweisung für jeden Wert in der Liste aus und setzt dabei die Variable \"%1\" auf den aktuellen Listenwert."; +Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://de.wikipedia.org/wiki/For-Schleife"; +Blockly.Msg["CONTROLS_FOR_TITLE"] = "zähle %1 von %2 bis %3 in Schritten von %4"; +Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "Zählt die Variable \"%1\" von einem Startwert bis zu einem Endwert und führt für jeden Wert eine Anweisung aus."; +Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Eine weitere Bedingung hinzufügen."; +Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Eine sonst-Bedingung hinzufügen. Führt eine Anweisung aus, falls keine Bedingung zutrifft."; +Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse"; // untranslated +Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Hinzufügen, entfernen oder sortieren von Sektionen"; +Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "sonst"; +Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "sonst falls"; +Blockly.Msg["CONTROLS_IF_MSG_IF"] = "falls"; +Blockly.Msg["CONTROLS_IF_TOOLTIP_1"] = "Führt eine Anweisung aus, falls eine Bedingung wahr ist."; +Blockly.Msg["CONTROLS_IF_TOOLTIP_2"] = "Führt die erste Anweisung aus, falls eine Bedingung wahr ist. Führt ansonsten die zweite Anweisung aus."; +Blockly.Msg["CONTROLS_IF_TOOLTIP_3"] = "Führt die erste Anweisung aus, falls die erste Bedingung wahr ist. Führt ansonsten die zweite Anweisung aus, falls die zweite Bedingung wahr ist."; +Blockly.Msg["CONTROLS_IF_TOOLTIP_4"] = "Führe die erste Anweisung aus, falls die erste Bedingung wahr ist. Führt ansonsten die zweite Anweisung aus, falls die zweite Bedingung wahr ist. Führt die dritte Anweisung aus, falls keine der beiden Bedingungen wahr ist."; +Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://de.wikipedia.org/wiki/For-Schleife"; +Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "mache"; +Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "wiederhole %1-mal:"; +Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Eine Anweisung mehrfach ausführen."; +Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://de.wikipedia.org/wiki/Schleife_(Programmierung)#Kopfgesteuerte_Schleife"; +Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "wiederhole bis"; +Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "wiederhole solange"; +Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "Führt Anweisungen aus, solange die Bedingung unwahr ist."; +Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_WHILE"] = "Führt Anweisungen aus, solange die Bedingung wahr ist."; +Blockly.Msg["CONTROL_KEY"] = "Ctrl"; // untranslated +Blockly.Msg["COPY_SHORTCUT"] = "Copy"; // untranslated +Blockly.Msg["CUT_SHORTCUT"] = "Cut"; // untranslated +Blockly.Msg["DELETE_ALL_BLOCKS"] = "Alle %1 Bausteine löschen?"; +Blockly.Msg["DELETE_BLOCK"] = "Baustein löschen"; +Blockly.Msg["DELETE_VARIABLE"] = "Die Variable „%1“ löschen"; +Blockly.Msg["DELETE_VARIABLE_CONFIRMATION"] = "%1 Verwendungen der Variable „%2“ löschen?"; +Blockly.Msg["DELETE_X_BLOCKS"] = "%1 Bausteine löschen"; +Blockly.Msg["DIALOG_CANCEL"] = "Abbrechen"; +Blockly.Msg["DIALOG_OK"] = "Okay"; +Blockly.Msg["DISABLE_BLOCK"] = "Baustein deaktivieren"; +Blockly.Msg["DUPLICATE_BLOCK"] = "Kopieren"; +Blockly.Msg["DUPLICATE_COMMENT"] = "Kommentar duplizieren"; +Blockly.Msg["EDIT_BLOCK_CONTENTS"] = "Edit Block contents"; // untranslated +Blockly.Msg["ENABLE_BLOCK"] = "Baustein aktivieren"; +Blockly.Msg["EXPAND_ALL"] = "Alle Bausteine entfalten"; +Blockly.Msg["EXPAND_BLOCK"] = "Baustein entfalten"; +Blockly.Msg["EXTERNAL_INPUTS"] = "externe Eingänge"; +Blockly.Msg["HELP"] = "Hilfe"; +Blockly.Msg["HELP_PROMPT"] = "Press %1 for help on keyboard controls"; // untranslated +Blockly.Msg["INLINE_INPUTS"] = "interne Eingänge"; +Blockly.Msg["KEYBOARD_NAV_CONSTRAINED_MOVE_HINT"] = "Use the arrow keys to move, then %1 to accept the position"; // untranslated +Blockly.Msg["KEYBOARD_NAV_COPIED_HINT"] = "Copied. Press %1 to paste."; // untranslated +Blockly.Msg["KEYBOARD_NAV_CUT_HINT"] = "Cut. Press %1 to paste."; // untranslated +Blockly.Msg["KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT"] = "Hold %1 and use arrow keys to move freely, then %2 to accept the position"; // untranslated +Blockly.Msg["LINUX"] = "Linux"; // untranslated +Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list"; // untranslated +Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "erzeuge eine leere Liste"; +Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Erzeugt eine leere Liste ohne Inhalt."; +Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "Liste"; +Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Hinzufügen, entfernen und sortieren von Elementen."; +Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated +Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "erzeuge Liste mit"; +Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Ein Element zur Liste hinzufügen."; +Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Erzeugt eine Liste aus den angegebenen Elementen."; +Blockly.Msg["LISTS_GET_INDEX_FIRST"] = "das erste"; +Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "von hinten das"; +Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "das"; +Blockly.Msg["LISTS_GET_INDEX_GET"] = "nimm"; +Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "nimm und entferne"; +Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list"; // untranslated +Blockly.Msg["LISTS_GET_INDEX_LAST"] = "das letzte"; +Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "ein zufälliges"; +Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "entferne"; +Blockly.Msg["LISTS_GET_INDEX_TAIL"] = "Element"; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FIRST"] = "Extrahiert das erste Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_FROM"] = "Extrahiert das Element an der angegebenen Position in der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_LAST"] = "Extrahiert das letzte Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_RANDOM"] = "Extrahiert ein zufälliges Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FIRST"] = "Extrahiert und entfernt das erste Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_FROM"] = "Extrahiert und entfernt das Element an der angegebenen Position aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_LAST"] = "Extrahiert und entfernt das letzte Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_GET_REMOVE_RANDOM"] = "Extrahiert und entfernt ein zufälliges Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FIRST"] = "Entfernt das erste Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_FROM"] = "Entfernt das Element an der angegebenen Position aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_LAST"] = "Entfernt das letzte Element aus der Liste."; +Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Entfernt ein zufälliges Element aus der Liste."; +Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "bis von hinten"; +Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "bis"; +Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "bis letztes"; +Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist"; // untranslated +Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "nimm Teilliste ab erstes"; +Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "nimm Teilliste ab von hinten"; +Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "nimm Teilliste ab"; +Blockly.Msg["LISTS_GET_SUBLIST_TAIL"] = "Element"; +Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Erstellt eine Kopie mit dem angegebenen Abschnitt der Liste."; +Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 ist das letzte Element."; +Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 ist das erste Element."; +Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "suche erstes Auftreten von"; +Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#finding-items-in-a-list"; // untranslated +Blockly.Msg["LISTS_INDEX_OF_LAST"] = "suche letztes Auftreten von"; +Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "Sucht die Position (Index) eines Elementes in der Liste. Gibt %1 zurück, falls kein Element gefunden wurde."; +Blockly.Msg["LISTS_INLIST"] = "in der Liste"; +Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty"; // untranslated +Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 ist leer"; +Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Ist wahr, falls die Liste leer ist."; +Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of"; // untranslated +Blockly.Msg["LISTS_LENGTH_TITLE"] = "Länge von %1"; +Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Die Anzahl von Elementen in der Liste."; +Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with"; // untranslated +Blockly.Msg["LISTS_REPEAT_TITLE"] = "erzeuge Liste mit %2-mal dem Element %1"; +Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Erzeugt eine Liste mit der angegebenen Anzahl an Elementen des angegebenen Wertes."; +Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list"; // untranslated +Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "kehre %1 um"; +Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Kehre eine Kopie einer Liste um."; +Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set"; // untranslated +Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "ein"; +Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "füge als"; +Blockly.Msg["LISTS_SET_INDEX_SET"] = "setze für"; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FIRST"] = "Fügt das Element an den Anfang der Liste an."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_FROM"] = "Fügt das Element an der angegebenen Position in die Liste ein."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_LAST"] = "Fügt das Element an das Ende der Liste an."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_INSERT_RANDOM"] = "Fügt das Element zufällig in die Liste ein."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Setzt das erste Element in der Liste."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Setzt das Element an der angegebenen Position in der Liste."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Setzt das letzte Element in die Liste."; +Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Setzt ein zufälliges Element in der Liste."; +Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list"; // untranslated +Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "aufsteigend"; +Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "absteigend"; +Blockly.Msg["LISTS_SORT_TITLE"] = "%1 %2 %3 sortieren"; +Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Eine Kopie einer Liste sortieren."; +Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetisch, Großschreibung ignorieren"; +Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numerisch"; +Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetisch"; +Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists"; // untranslated +Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "Liste aus Text erstellen"; +Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "Text aus Liste erstellen"; +Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Liste mit Texten in einen Text vereinen, getrennt durch ein Trennzeichen."; +Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Text in eine Liste mit Texten aufteilen, unterbrochen bei jedem Trennzeichen."; +Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "mit Trennzeichen"; +Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "falsch"; +Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values"; // untranslated +Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Ist entweder wahr oder falsch."; +Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "wahr"; +Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://de.wikipedia.org/wiki/Vergleich_(Zahlen)"; +Blockly.Msg["LOGIC_COMPARE_TOOLTIP_EQ"] = "Ist wahr, falls beide Werte gleich sind."; +Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GT"] = "Ist wahr, falls der erste Wert größer als der zweite Wert ist."; +Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Ist wahr, falls der erste Wert größer als oder gleich groß wie der zweite Wert ist."; +Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Ist wahr, falls der erste Wert kleiner als der zweite Wert ist."; +Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Ist wahr, falls der erste Wert kleiner als oder gleich groß wie der zweite Wert ist."; +Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Ist wahr, falls beide Werte unterschiedlich sind."; +Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not"; // untranslated +Blockly.Msg["LOGIC_NEGATE_TITLE"] = "nicht %1"; +Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Ist wahr, falls der Eingabewert unwahr ist. Ist unwahr, falls der Eingabewert wahr ist."; +Blockly.Msg["LOGIC_NULL"] = "null"; +Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://de.wikipedia.org/wiki/Nullwert"; +Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Ist \"null\"."; +Blockly.Msg["LOGIC_OPERATION_AND"] = "und"; +Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations"; // untranslated +Blockly.Msg["LOGIC_OPERATION_OR"] = "oder"; +Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Ist wahr, falls beide Werte wahr sind."; +Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Gibt true zurück, wenn mindestens eine der Eingaben wahr ist."; +Blockly.Msg["LOGIC_TERNARY_CONDITION"] = "prüfe"; +Blockly.Msg["LOGIC_TERNARY_HELPURL"] = "https://de.wikipedia.org/wiki/%3F:#Auswahloperator"; +Blockly.Msg["LOGIC_TERNARY_IF_FALSE"] = "falls falsch"; +Blockly.Msg["LOGIC_TERNARY_IF_TRUE"] = "falls wahr"; +Blockly.Msg["LOGIC_TERNARY_TOOLTIP"] = "Überprüft eine Bedingung \"prüfe\". Falls die Bedingung wahr ist, wird der \"falls wahr\"-Wert zurückgegeben, andernfalls der \"falls unwahr\"-Wert"; +Blockly.Msg["MAC_OS"] = "macOS"; // untranslated +Blockly.Msg["MATH_ADDITION_SYMBOL"] = "+"; // untranslated +Blockly.Msg["MATH_ARITHMETIC_HELPURL"] = "https://de.wikipedia.org/wiki/Grundrechenart"; +Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_ADD"] = "Ist die Summe zweier Zahlen."; +Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_DIVIDE"] = "Ist der Quotient zweier Zahlen."; +Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MINUS"] = "Ist die Differenz zweier Zahlen."; +Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_MULTIPLY"] = "Ist das Produkt zweier Zahlen."; +Blockly.Msg["MATH_ARITHMETIC_TOOLTIP_POWER"] = "Ist die erste Zahl potenziert mit der zweiten Zahl."; +Blockly.Msg["MATH_ATAN2_HELPURL"] = "https://de.wikipedia.org/wiki/Arctan2"; +Blockly.Msg["MATH_ATAN2_TITLE"] = "atan2 von X:%1 Y:%2"; +Blockly.Msg["MATH_ATAN2_TOOLTIP"] = "Gibt den Arkustangens des Punktes (X, Y) in Grad von -180 bis 180 zurück."; +Blockly.Msg["MATH_CHANGE_HELPURL"] = "https://de.wikipedia.org/wiki/Inkrement_und_Dekrement"; +Blockly.Msg["MATH_CHANGE_TITLE"] = "erhöhe %1 um %2"; +Blockly.Msg["MATH_CHANGE_TOOLTIP"] = "Addiert eine Zahl zur Variable „%1“."; +Blockly.Msg["MATH_CONSTANT_HELPURL"] = "https://de.wikipedia.org/wiki/Mathematische_Konstante"; +Blockly.Msg["MATH_CONSTANT_TOOLTIP"] = "Mathematische Konstanten wie: π (3.141…), e (2.718…), φ (1.618…), sqrt(2) (1.414…), sqrt(½) (0.707…) oder ∞ (unendlich)."; +Blockly.Msg["MATH_CONSTRAIN_HELPURL"] = "https://en.wikipedia.org/wiki/Clamping_(graphics)"; // untranslated +Blockly.Msg["MATH_CONSTRAIN_TITLE"] = "begrenze %1 zwischen %2 und %3"; +Blockly.Msg["MATH_CONSTRAIN_TOOLTIP"] = "Begrenzt eine Zahl auf den Wertebereich zwischen zwei anderen Zahlen (inklusiv)."; +Blockly.Msg["MATH_DIVISION_SYMBOL"] = "÷"; // untranslated +Blockly.Msg["MATH_IS_DIVISIBLE_BY"] = "ist teilbar durch"; +Blockly.Msg["MATH_IS_EVEN"] = "ist gerade"; +Blockly.Msg["MATH_IS_NEGATIVE"] = "ist negativ"; +Blockly.Msg["MATH_IS_ODD"] = "ist ungerade"; +Blockly.Msg["MATH_IS_POSITIVE"] = "ist positiv"; +Blockly.Msg["MATH_IS_PRIME"] = "ist eine Primzahl"; +Blockly.Msg["MATH_IS_TOOLTIP"] = "Überprüft, ob eine Zahl gerade, ungerade, eine Primzahl, ganzzahlig, positiv, negativ oder durch eine zweite Zahl teilbar ist. Gibt wahr oder falsch zurück."; +Blockly.Msg["MATH_IS_WHOLE"] = "ist eine ganze Zahl"; +Blockly.Msg["MATH_MODULO_HELPURL"] = "https://de.wikipedia.org/wiki/Modulo"; +Blockly.Msg["MATH_MODULO_TITLE"] = "Rest von %1 ÷ %2"; +Blockly.Msg["MATH_MODULO_TOOLTIP"] = "Der Rest nach einer Division."; +Blockly.Msg["MATH_MULTIPLICATION_SYMBOL"] = "×"; // untranslated +Blockly.Msg["MATH_NUMBER_HELPURL"] = "https://de.wikipedia.org/wiki/Zahl"; +Blockly.Msg["MATH_NUMBER_TOOLTIP"] = "Eine Zahl."; +Blockly.Msg["MATH_ONLIST_HELPURL"] = ""; +Blockly.Msg["MATH_ONLIST_OPERATOR_AVERAGE"] = "Mittelwert der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_MAX"] = "Maximalwert der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_MEDIAN"] = "Median der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_MIN"] = "Minimalwert der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_MODE"] = "am häufigsten in der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_RANDOM"] = "Zufallswert aus der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_STD_DEV"] = "Standardabweichung der Liste"; +Blockly.Msg["MATH_ONLIST_OPERATOR_SUM"] = "Summe über die Liste"; +Blockly.Msg["MATH_ONLIST_TOOLTIP_AVERAGE"] = "Ist der Durchschnittswert aller Zahlen in einer Liste."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_MAX"] = "Ist die größte Zahl in einer Liste."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_MEDIAN"] = "Ist der Median aller Zahlen in einer Liste."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_MIN"] = "Ist die kleinste Zahl in einer Liste."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_MODE"] = "Findet die Werte mit dem häufigsten Vorkommen in der Liste."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_RANDOM"] = "Gibt einen zufälligen Wert aus der Liste zurück."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_STD_DEV"] = "Ist die Standardabweichung aller Werte in der Liste."; +Blockly.Msg["MATH_ONLIST_TOOLTIP_SUM"] = "Ist die Summe aller Zahlen in einer Liste."; +Blockly.Msg["MATH_POWER_SYMBOL"] = "^"; // untranslated +Blockly.Msg["MATH_RANDOM_FLOAT_HELPURL"] = "https://de.wikipedia.org/wiki/Zufallszahlen"; +Blockly.Msg["MATH_RANDOM_FLOAT_TITLE_RANDOM"] = "Zufallszahl (0.0 - 1.0)"; +Blockly.Msg["MATH_RANDOM_FLOAT_TOOLTIP"] = "Erzeugt eine Zufallszahl zwischen 0.0 (inklusiv) und 1.0 (exklusiv)."; +Blockly.Msg["MATH_RANDOM_INT_HELPURL"] = "https://de.wikipedia.org/wiki/Zufallszahlen"; +Blockly.Msg["MATH_RANDOM_INT_TITLE"] = "ganzzahlige Zufallszahl zwischen %1 und %2"; +Blockly.Msg["MATH_RANDOM_INT_TOOLTIP"] = "Erzeugt eine ganzzahlige Zufallszahl zwischen zwei Zahlen (inklusiv)."; +Blockly.Msg["MATH_ROUND_HELPURL"] = "https://de.wikipedia.org/wiki/Runden"; +Blockly.Msg["MATH_ROUND_OPERATOR_ROUND"] = "runde"; +Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDDOWN"] = "runde ab"; +Blockly.Msg["MATH_ROUND_OPERATOR_ROUNDUP"] = "runde auf"; +Blockly.Msg["MATH_ROUND_TOOLTIP"] = "Eine Zahl auf- oder abrunden."; +Blockly.Msg["MATH_SINGLE_HELPURL"] = "https://de.wikipedia.org/wiki/Quadratwurzel"; +Blockly.Msg["MATH_SINGLE_OP_ABSOLUTE"] = "Absolutbetrag"; +Blockly.Msg["MATH_SINGLE_OP_ROOT"] = "Quadratwurzel"; +Blockly.Msg["MATH_SINGLE_TOOLTIP_ABS"] = "Ist der Absolutbetrag einer Zahl."; +Blockly.Msg["MATH_SINGLE_TOOLTIP_EXP"] = "Ist Wert der Exponentialfunktion einer Zahl."; +Blockly.Msg["MATH_SINGLE_TOOLTIP_LN"] = "Ist der natürliche Logarithmus einer Zahl."; +Blockly.Msg["MATH_SINGLE_TOOLTIP_LOG10"] = "Ist der dekadische Logarithmus einer Zahl."; +Blockly.Msg["MATH_SINGLE_TOOLTIP_NEG"] = "Negiert eine Zahl."; +Blockly.Msg["MATH_SINGLE_TOOLTIP_POW10"] = "Rechnet 10 hoch eine Zahl."; +Blockly.Msg["MATH_SINGLE_TOOLTIP_ROOT"] = "Ist die Quadratwurzel einer Zahl."; +Blockly.Msg["MATH_SUBTRACTION_SYMBOL"] = "-"; // untranslated +Blockly.Msg["MATH_TRIG_ACOS"] = "acos"; +Blockly.Msg["MATH_TRIG_ASIN"] = "asin"; +Blockly.Msg["MATH_TRIG_ATAN"] = "atan"; +Blockly.Msg["MATH_TRIG_COS"] = "cos"; +Blockly.Msg["MATH_TRIG_HELPURL"] = "https://de.wikipedia.org/wiki/Trigonometrie"; +Blockly.Msg["MATH_TRIG_SIN"] = "sin"; +Blockly.Msg["MATH_TRIG_TAN"] = "tan"; +Blockly.Msg["MATH_TRIG_TOOLTIP_ACOS"] = "Ist der Arkuskosinus des Eingabewertes."; +Blockly.Msg["MATH_TRIG_TOOLTIP_ASIN"] = "Ist der Arkussinus des Eingabewertes."; +Blockly.Msg["MATH_TRIG_TOOLTIP_ATAN"] = "Ist der Arkustangens des Eingabewertes."; +Blockly.Msg["MATH_TRIG_TOOLTIP_COS"] = "Ist der Kosinus des Winkels (nicht Radiant)."; +Blockly.Msg["MATH_TRIG_TOOLTIP_SIN"] = "Ist der Sinus des Winkels (nicht Radiant)."; +Blockly.Msg["MATH_TRIG_TOOLTIP_TAN"] = "Ist der Tangens des Winkels (nicht Radiant)."; +Blockly.Msg["MOVE_BLOCK"] = "Move Block"; // untranslated +Blockly.Msg["NEW_COLOUR_VARIABLE"] = "Farbvariable erstellen …"; +Blockly.Msg["NEW_NUMBER_VARIABLE"] = "Zahlenvariable erstellen …"; +Blockly.Msg["NEW_STRING_VARIABLE"] = "Zeichenfolgenvariable erstellen …"; +Blockly.Msg["NEW_VARIABLE"] = "Variable erstellen …"; +Blockly.Msg["NEW_VARIABLE_TITLE"] = "Name der neuen Variable:"; +Blockly.Msg["NEW_VARIABLE_TYPE_TITLE"] = "Neuer Variablentyp:"; +Blockly.Msg["OPTION_KEY"] = "⌥ Option"; // untranslated +Blockly.Msg["ORDINAL_NUMBER_SUFFIX"] = "."; +Blockly.Msg["PASTE_SHORTCUT"] = "Paste"; // untranslated +Blockly.Msg["PROCEDURES_ALLOW_STATEMENTS"] = "Anweisungen erlauben"; +Blockly.Msg["PROCEDURES_BEFORE_PARAMS"] = "mit:"; +Blockly.Msg["PROCEDURES_CALLNORETURN_HELPURL"] = "https://de.wikipedia.org/wiki/Unterprogramm"; +Blockly.Msg["PROCEDURES_CALLNORETURN_TOOLTIP"] = "Ruft die benutzerdefinierte Funktion „%1“ auf."; +Blockly.Msg["PROCEDURES_CALLRETURN_HELPURL"] = "https://de.wikipedia.org/wiki/Unterprogramm"; +Blockly.Msg["PROCEDURES_CALLRETURN_TOOLTIP"] = "Ruft die benutzerdefinierte Funktion „%1“ auf und verwendet ihre Ausgabe."; +Blockly.Msg["PROCEDURES_CALL_BEFORE_PARAMS"] = "mit:"; +Blockly.Msg["PROCEDURES_CALL_DISABLED_DEF_WARNING"] = "Die benutzerdefinierte Funktion '%1' kann nicht ausgeführt werden, weil der Definitionsblock deaktiviert ist."; +Blockly.Msg["PROCEDURES_CREATE_DO"] = "Erzeuge \"Aufruf %1\""; +Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"] = "Beschreibe diese Funktion …"; +Blockly.Msg["PROCEDURES_DEFNORETURN_DO"] = ""; // untranslated +Blockly.Msg["PROCEDURES_DEFNORETURN_HELPURL"] = "https://en.wikipedia.org/wiki/Subroutine"; // untranslated +Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"] = "etwas tun"; +Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"] = "um"; +Blockly.Msg["PROCEDURES_DEFNORETURN_TOOLTIP"] = "Ein Funktionsblock ohne Rückgabewert."; +Blockly.Msg["PROCEDURES_DEFRETURN_HELPURL"] = "https://de.wikipedia.org/wiki/Prozedur_(Programmierung)"; +Blockly.Msg["PROCEDURES_DEFRETURN_RETURN"] = "gib zurück"; +Blockly.Msg["PROCEDURES_DEFRETURN_TOOLTIP"] = "Ein Funktionsblock mit Rückgabewert."; +Blockly.Msg["PROCEDURES_DEF_DUPLICATE_WARNING"] = "Warnung: Dieser Funktionsblock hat zwei gleich benannte Parameter."; +Blockly.Msg["PROCEDURES_HIGHLIGHT_DEF"] = "Markiere Funktionsblock"; +Blockly.Msg["PROCEDURES_IFRETURN_HELPURL"] = "https://c2.com/cgi/wiki?GuardClause"; // untranslated +Blockly.Msg["PROCEDURES_IFRETURN_TOOLTIP"] = "Gibt den zweiten Wert zurück und verlässt die Funktion, falls der erste Wert wahr ist."; +Blockly.Msg["PROCEDURES_IFRETURN_WARNING"] = "Warnung: Dieser Block darf nur innerhalb eines Funktionsblocks genutzt werden."; +Blockly.Msg["PROCEDURES_MUTATORARG_TITLE"] = "Variable:"; +Blockly.Msg["PROCEDURES_MUTATORARG_TOOLTIP"] = "Eine Eingabe zur Funktion hinzufügen."; +Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TITLE"] = "Parameter"; +Blockly.Msg["PROCEDURES_MUTATORCONTAINER_TOOLTIP"] = "Die Eingaben zu dieser Funktion hinzufügen, entfernen oder neu anordnen."; +Blockly.Msg["REDO"] = "Wiederholen"; +Blockly.Msg["REMOVE_COMMENT"] = "Kommentar entfernen"; +Blockly.Msg["RENAME_VARIABLE"] = "Variable umbenennen …"; +Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Alle „%1“-Variablen umbenennen in:"; +Blockly.Msg["SHORTCUTS_CODE_NAVIGATION"] = "Code navigation"; // untranslated +Blockly.Msg["SHORTCUTS_EDITING"] = "Editing"; // untranslated +Blockly.Msg["SHORTCUTS_GENERAL"] = "General"; // untranslated +Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated +Blockly.Msg["TEXT_APPEND_TITLE"] = "zu %1 Text %2 anhängen"; +Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Text an die Variable \"%1\" anhängen."; +Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case"; // untranslated +Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "wandel um in kleinbuchstaben"; +Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "wandel um in Substantive"; +Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "wandel um in GROSSBUCHSTABEN"; +Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Wandelt Schreibweise von Texten um, in Großbuchstaben, Kleinbuchstaben oder den ersten Buchstaben jedes Wortes groß und die anderen klein."; +Blockly.Msg["TEXT_CHARAT_FIRST"] = "nimm ersten"; +Blockly.Msg["TEXT_CHARAT_FROM_END"] = "nimm von hinten"; +Blockly.Msg["TEXT_CHARAT_FROM_START"] = "nimm"; +Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text"; // untranslated +Blockly.Msg["TEXT_CHARAT_LAST"] = "nimm letzten"; +Blockly.Msg["TEXT_CHARAT_RANDOM"] = "nimm zufälligen"; +Blockly.Msg["TEXT_CHARAT_TAIL"] = "Buchstaben"; +Blockly.Msg["TEXT_CHARAT_TITLE"] = "im Text %1 %2"; +Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Extrahiert einen Buchstaben von einer bestimmten Position."; +Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings"; // untranslated +Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "zähle %1 in %2"; +Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Zähle, wie oft ein Text innerhalb eines anderen Textes vorkommt."; +Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Ein Element zum Text hinzufügen."; +Blockly.Msg["TEXT_CREATE_JOIN_TITLE_JOIN"] = "verbinden"; +Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Hinzufügen, entfernen und sortieren von Elementen."; +Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "bis von hinten"; +Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "bis"; +Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "bis letzter"; +Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text"; // untranslated +Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "im Text"; +Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "nimm Teil ab erster"; +Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "nimm Teil ab von hinten"; +Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "nimm Teil ab"; +Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = "Buchstabe"; +Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Gibt den angegebenen Textabschnitt zurück."; +Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text"; // untranslated +Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "suche erstes Auftreten des Begriffs"; +Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "suche letztes Auftreten des Begriffs"; +Blockly.Msg["TEXT_INDEXOF_TITLE"] = "im Text %1 %2 %3"; +Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "Findet das erste / letzte Auftreten eines Suchbegriffs in einem Text. Gibt die Position des Begriffs zurück oder %1, falls der Suchbegriff nicht gefunden wurde."; +Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text"; // untranslated +Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 ist leer"; +Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Ist wahr, falls der Text keine Zeichen enthält."; +Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation"; // untranslated +Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "erstelle Text aus"; +Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Erstellt einen Text durch das Verbinden von mehreren Textelementen."; +Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification"; // untranslated +Blockly.Msg["TEXT_LENGTH_TITLE"] = "Länge von %1"; +Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Die Anzahl von Zeichen in einem Text (inkl. Leerzeichen)."; +Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text"; // untranslated +Blockly.Msg["TEXT_PRINT_TITLE"] = "gib aus %1"; +Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Gibt den Text aus."; +Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user"; // untranslated +Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Fragt den Benutzer nach einer Zahl."; +Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Fragt den Benutzer nach einem Text."; +Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "frage nach Zahl mit Hinweis"; +Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "frage nach Text mit Hinweis"; +Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings"; // untranslated +Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "ersetze %1 durch %2 in %3"; +Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Ersetze alle Vorkommen eines Textes innerhalb eines anderen Textes."; +Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text"; // untranslated +Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "kehre %1 um"; +Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Kehre die Reihenfolge der Zeichen im Text um."; +Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://de.wikipedia.org/wiki/Zeichenkette"; +Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "Ein Buchstabe, Text oder Satz."; +Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces"; // untranslated +Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "entferne Leerzeichen vom Anfang und vom Ende (links und rechts)"; +Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "entferne Leerzeichen vom Anfang (links)"; +Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "entferne Leerzeichen vom Ende (rechts)"; +Blockly.Msg["TEXT_TRIM_TOOLTIP"] = "Entfernt Leerzeichen vom Anfang und / oder Ende eines Textes."; +Blockly.Msg["TODAY"] = "Heute"; +Blockly.Msg["UNDO"] = "Rückgängig"; +Blockly.Msg["UNKNOWN"] = "Unknown"; // untranslated +Blockly.Msg["UNNAMED_KEY"] = "unbenannt"; +Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "Element"; +Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Erzeuge \"Schreibe %1\""; +Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get"; // untranslated +Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Gibt den Wert der Variable zurück."; +Blockly.Msg["VARIABLES_SET"] = "setze %1 auf %2"; +Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Erzeuge \"Lies %1\""; +Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set"; // untranslated +Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Setzt den Wert einer Variable."; +Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "Eine Variable namens „%1“ ist bereits vorhanden."; +Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "Eine Variable namens „%1“ ist bereits für einen anderen Typ vorhanden: „%2“."; +Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_A_PARAMETER"] = "Eine Variable mit dem Namen „%1“ ist bereits als Parameter in der Funktion „%2“ vorhanden."; +Blockly.Msg["WINDOWS"] = "Windows"; // untranslated +Blockly.Msg["WORKSPACE_ARIA_LABEL"] = "Blockly-Arbeitsbereich"; +Blockly.Msg["WORKSPACE_COMMENT_DEFAULT_TEXT"] = "Teile etwas mit…"; +Blockly.Msg["CONTROLS_FOREACH_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"]; +Blockly.Msg["CONTROLS_FOR_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"]; +Blockly.Msg["CONTROLS_IF_ELSEIF_TITLE_ELSEIF"] = Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"]; +Blockly.Msg["CONTROLS_IF_ELSE_TITLE_ELSE"] = Blockly.Msg["CONTROLS_IF_MSG_ELSE"]; +Blockly.Msg["CONTROLS_IF_IF_TITLE_IF"] = Blockly.Msg["CONTROLS_IF_MSG_IF"]; +Blockly.Msg["CONTROLS_IF_MSG_THEN"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"]; +Blockly.Msg["CONTROLS_WHILEUNTIL_INPUT_DO"] = Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"]; +Blockly.Msg["LISTS_CREATE_WITH_ITEM_TITLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"]; +Blockly.Msg["LISTS_GET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"]; +Blockly.Msg["LISTS_GET_SUBLIST_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"]; +Blockly.Msg["LISTS_INDEX_OF_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"]; +Blockly.Msg["LISTS_SET_INDEX_INPUT_IN_LIST"] = Blockly.Msg["LISTS_INLIST"]; +Blockly.Msg["MATH_CHANGE_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"]; +Blockly.Msg["PROCEDURES_DEFRETURN_COMMENT"] = Blockly.Msg["PROCEDURES_DEFNORETURN_COMMENT"]; +Blockly.Msg["PROCEDURES_DEFRETURN_DO"] = Blockly.Msg["PROCEDURES_DEFNORETURN_DO"]; +Blockly.Msg["PROCEDURES_DEFRETURN_PROCEDURE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_PROCEDURE"]; +Blockly.Msg["PROCEDURES_DEFRETURN_TITLE"] = Blockly.Msg["PROCEDURES_DEFNORETURN_TITLE"]; +Blockly.Msg["TEXT_APPEND_VARIABLE"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"]; +Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TITLE_ITEM"] = Blockly.Msg["VARIABLES_DEFAULT_NAME"]; + +Blockly.Msg["COLOUR_HUE"] = "20"; +Blockly.Msg["LISTS_HUE"] = "260"; +Blockly.Msg["LOGIC_HUE"] = "210"; +Blockly.Msg["LOOPS_HUE"] = "120"; +Blockly.Msg["MATH_HUE"] = "230"; +Blockly.Msg["PROCEDURES_HUE"] = "290"; +Blockly.Msg["TEXTS_HUE"] = "160"; +Blockly.Msg["VARIABLES_DYNAMIC_HUE"] = "310"; +Blockly.Msg["VARIABLES_HUE"] = "330"; +return Blockly.Msg; +})); diff --git a/crumbblocks/lib/blockly/javascript.min.js b/crumbblocks/lib/blockly/javascript.min.js new file mode 100644 index 0000000..3c8ce6f --- /dev/null +++ b/crumbblocks/lib/blockly/javascript.min.js @@ -0,0 +1,264 @@ +// Do not edit this file; automatically generated. + +/* eslint-disable */ +;(function(root, factory) { + if (typeof define === 'function' && define.amd) { // AMD + define(["./blockly_compressed.js"], factory); + } else if (typeof exports === 'object') { // Node.js + module.exports = factory(require("./blockly_compressed.js")); + } else { // Script + root.javascript = factory(root.Blockly); + root.Blockly.JavaScript = root.javascript.javascriptGenerator; + } +}(this, function(__parent__) { +var $=__parent__.__namespace__; +var lists_create_empty$$module$build$src$generators$javascript$lists=function(a,b){return["[]",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]},lists_create_with$$module$build$src$generators$javascript$lists=function(a,b){const c=Array(a.itemCount_);for(let d=0;d String(b) ? 1 : -1; }, + 'IGNORE_CASE': function(a, b) { + return String(a).toLowerCase() > String(b).toLowerCase() ? 1 : -1; }, + }; + var compare = compareFuncs[type]; + return function(a, b) { return compare(a, b) * direction; }; +} + `);return[c+".slice().sort("+b+'("'+a+'", '+d+"))",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},lists_split$$module$build$src$generators$javascript$lists=function(a,b){let c=b.valueToCode(a,"INPUT",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER);b=b.valueToCode(a,"DELIM",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"''";a=a.getFieldValue("MODE");if(a==="SPLIT")c||(c="''"),a="split";else if(a==="JOIN")c|| +(c="[]"),a="join";else throw Error("Unknown mode: "+a);return[c+"."+a+"("+b+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},lists_reverse$$module$build$src$generators$javascript$lists=function(a,b){return[(b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL)||"[]")+".slice().reverse()",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},controls_if$$module$build$src$generators$javascript$logic= +function(a,b){var c=0;let d="";b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));do{const e=b.valueToCode(a,"IF"+c,Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"false";let f=b.statementToCode(a,"DO"+c);b.STATEMENT_SUFFIX&&(f=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+f);d+=(c>0?" else ":"")+"if ("+e+") {\n"+f+"}";c++}while(a.getInput("IF"+c));if(a.getInput("ELSE")||b.STATEMENT_SUFFIX)c=a.getInput("ELSE")?b.statementToCode(a,"ELSE"):"",b.STATEMENT_SUFFIX&& +(c=b.prefixLines(b.injectId(b.STATEMENT_SUFFIX,a),b.INDENT)+c),d+=" else {\n"+c+"}";return d+"\n"},logic_compare$$module$build$src$generators$javascript$logic=function(a,b){const c={EQ:"==",NEQ:"!=",LT:"<",LTE:"<=",GT:">",GTE:">="}[a.getFieldValue("OP")],d=c==="=="||c==="!="?Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY:Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL,e=b.valueToCode(a,"A",d)||"0";a=b.valueToCode(a,"B",d)||"0";return[e+" "+ +c+" "+a,d]},logic_operation$$module$build$src$generators$javascript$logic=function(a,b){const c=a.getFieldValue("OP")==="AND"?"&&":"||",d=c==="&&"?Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_AND:Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_OR;let e=b.valueToCode(a,"A",d);a=b.valueToCode(a,"B",d);e||a?(b=c==="&&"?"true":"false",e||(e=b),a||(a=b)):a=e="false";return[e+" "+c+" "+a,d]},logic_negate$$module$build$src$generators$javascript$logic= +function(a,b){const c=Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_NOT;return["!"+(b.valueToCode(a,"BOOL",c)||"true"),c]},logic_boolean$$module$build$src$generators$javascript$logic=function(a,b){return[a.getFieldValue("BOOL")==="TRUE"?"true":"false",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]},logic_null$$module$build$src$generators$javascript$logic=function(a,b){return["null",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]}, +logic_ternary$$module$build$src$generators$javascript$logic=function(a,b){const c=b.valueToCode(a,"IF",Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL)||"false",d=b.valueToCode(a,"THEN",Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL)||"null";a=b.valueToCode(a,"ELSE",Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL)||"null";return[c+" ? "+d+" : "+a,Order$$module$build$src$generators$javascript$javascript_generator.CONDITIONAL]}, +controls_repeat_ext$$module$build$src$generators$javascript$loops=function(a,b){let c;c=a.getField("TIMES")?String(Number(a.getFieldValue("TIMES"))):b.valueToCode(a,"TIMES",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"0";let d=b.statementToCode(a,"DO");d=b.addLoopTrap(d,a);a="";const e=b.nameDB_.getDistinctName("count",$.NameType$$module$build$src$core$names.VARIABLE);let f=c;c.match(/^\w+$/)||$.isNumber$$module$build$src$core$utils$string(c)||(f=b.nameDB_.getDistinctName("repeat_end", +$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+f+" = "+c+";\n");return a+("for (var "+e+" = 0; "+e+" < "+f+"; "+e+"++) {\n"+d+"}\n")},controls_whileUntil$$module$build$src$generators$javascript$loops=function(a,b){const c=a.getFieldValue("MODE")==="UNTIL";let d=b.valueToCode(a,"BOOL",c?Order$$module$build$src$generators$javascript$javascript_generator.LOGICAL_NOT:Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"false",e=b.statementToCode(a,"DO");e=b.addLoopTrap(e, +a);c&&(d="!"+d);return"while ("+d+") {\n"+e+"}\n"},controls_for$$module$build$src$generators$javascript$loops=function(a,b){var c=b.getVariableName(a.getFieldValue("VAR")),d=b.valueToCode(a,"FROM",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"0",e=b.valueToCode(a,"TO",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"0";const f=b.valueToCode(a,"BY",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"1"; +let g=b.statementToCode(a,"DO");g=b.addLoopTrap(g,a);if($.isNumber$$module$build$src$core$utils$string(d)&&$.isNumber$$module$build$src$core$utils$string(e)&&$.isNumber$$module$build$src$core$utils$string(f))b=Number(d)<=Number(e),a="for ("+c+" = "+d+"; "+c+(b?" <= ":" >= ")+e+"; "+c,c=Math.abs(Number(f)),a=c===1?a+(b?"++":"--"):a+((b?" += ":" -= ")+c),a+=") {\n"+g+"}\n";else{a="";let h=d;d.match(/^\w+$/)||$.isNumber$$module$build$src$core$utils$string(d)||(h=b.nameDB_.getDistinctName(c+"_start", +$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+h+" = "+d+";\n");d=e;e.match(/^\w+$/)||$.isNumber$$module$build$src$core$utils$string(e)||(d=b.nameDB_.getDistinctName(c+"_end",$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+d+" = "+e+";\n");e=b.nameDB_.getDistinctName(c+"_inc",$.NameType$$module$build$src$core$names.VARIABLE);a+="var "+e+" = ";a=$.isNumber$$module$build$src$core$utils$string(f)?a+(Math.abs(Number(f))+";\n"):a+("Math.abs("+f+");\n");a+="if ("+h+" > "+d+") {\n"; +a+=b.INDENT+e+" = -"+e+";\n";a=a+"}\nfor ("+(c+" = "+h+"; "+e+" >= 0 ? "+c+" <= "+d+" : "+c+" >= "+d+"; "+c+" += "+e+") {\n"+g+"}\n")}return a},controls_forEach$$module$build$src$generators$javascript$loops=function(a,b){const c=b.getVariableName(a.getFieldValue("VAR"));var d=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.ASSIGNMENT)||"[]";let e=b.statementToCode(a,"DO");e=b.addLoopTrap(e,a);a="";let f=d;d.match(/^\w+$/)||(f=b.nameDB_.getDistinctName(c+"_list", +$.NameType$$module$build$src$core$names.VARIABLE),a+="var "+f+" = "+d+";\n");d=b.nameDB_.getDistinctName(c+"_index",$.NameType$$module$build$src$core$names.VARIABLE);e=b.INDENT+c+" = "+f+"["+d+"];\n"+e;return a+("for (var "+d+" in "+f+") {\n"+e+"}\n")},controls_flow_statements$$module$build$src$generators$javascript$loops=function(a,b){let c="";b.STATEMENT_PREFIX&&(c+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(c+=b.injectId(b.STATEMENT_SUFFIX,a));if(b.STATEMENT_PREFIX){const d=a.getSurroundLoop(); +d&&!d.suppressPrefixSuffix&&(c+=b.injectId(b.STATEMENT_PREFIX,d))}switch(a.getFieldValue("FLOW")){case "BREAK":return c+"break;\n";case "CONTINUE":return c+"continue;\n"}throw Error("Unknown flow statement.");},math_number$$module$build$src$generators$javascript$math=function(a,b){a=Number(a.getFieldValue("NUM"));return[String(a),a>=0?Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC:Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION]},math_arithmetic$$module$build$src$generators$javascript$math= +function(a,b){var c={ADD:[" + ",Order$$module$build$src$generators$javascript$javascript_generator.ADDITION],MINUS:[" - ",Order$$module$build$src$generators$javascript$javascript_generator.SUBTRACTION],MULTIPLY:[" * ",Order$$module$build$src$generators$javascript$javascript_generator.MULTIPLICATION],DIVIDE:[" / ",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION],POWER:[null,Order$$module$build$src$generators$javascript$javascript_generator.NONE]}[a.getFieldValue("OP")]; +const d=c[0];c=c[1];const e=b.valueToCode(a,"A",c)||"0";a=b.valueToCode(a,"B",c)||"0";return d?[e+d+a,c]:["Math.pow("+e+", "+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_single$$module$build$src$generators$javascript$math=function(a,b){const c=a.getFieldValue("OP");let d;if(c==="NEG")return a=b.valueToCode(a,"NUM",Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION)||"0",a[0]==="-"&&(a=" "+a),["-"+a,Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION]; +a=c==="SIN"||c==="COS"||c==="TAN"?b.valueToCode(a,"NUM",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION)||"0":b.valueToCode(a,"NUM",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";switch(c){case "ABS":d="Math.abs("+a+")";break;case "ROOT":d="Math.sqrt("+a+")";break;case "LN":d="Math.log("+a+")";break;case "EXP":d="Math.exp("+a+")";break;case "POW10":d="Math.pow(10,"+a+")";break;case "ROUND":d="Math.round("+a+")";break;case "ROUNDUP":d="Math.ceil("+ +a+")";break;case "ROUNDDOWN":d="Math.floor("+a+")";break;case "SIN":d="Math.sin("+a+" / 180 * Math.PI)";break;case "COS":d="Math.cos("+a+" / 180 * Math.PI)";break;case "TAN":d="Math.tan("+a+" / 180 * Math.PI)"}if(d)return[d,Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL];switch(c){case "LOG10":d="Math.log("+a+") / Math.log(10)";break;case "ASIN":d="Math.asin("+a+") / Math.PI * 180";break;case "ACOS":d="Math.acos("+a+") / Math.PI * 180";break;case "ATAN":d="Math.atan("+ +a+") / Math.PI * 180";break;default:throw Error("Unknown math operator: "+c);}return[d,Order$$module$build$src$generators$javascript$javascript_generator.DIVISION]},math_constant$$module$build$src$generators$javascript$math=function(a,b){return{PI:["Math.PI",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],E:["Math.E",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],GOLDEN_RATIO:["(1 + Math.sqrt(5)) / 2",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION], +SQRT2:["Math.SQRT2",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],SQRT1_2:["Math.SQRT1_2",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER],INFINITY:["Infinity",Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]}[a.getFieldValue("CONSTANT")]},math_number_property$$module$build$src$generators$javascript$math=function(a,b){var c={EVEN:[" % 2 === 0",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS, +Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],ODD:[" % 2 === 1",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS,Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],WHOLE:[" % 1 === 0",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS,Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],POSITIVE:[" > 0",Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL, +Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL],NEGATIVE:[" < 0",Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL,Order$$module$build$src$generators$javascript$javascript_generator.RELATIONAL],DIVISIBLE_BY:[null,Order$$module$build$src$generators$javascript$javascript_generator.MODULUS,Order$$module$build$src$generators$javascript$javascript_generator.EQUALITY],PRIME:[null,Order$$module$build$src$generators$javascript$javascript_generator.NONE, +Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]};const d=a.getFieldValue("PROPERTY"),[e,f,g]=c[d];c=b.valueToCode(a,"NUMBER_TO_CHECK",f)||"0";d==="PRIME"?a=b.provideFunction_("mathIsPrime",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(n) { + // https://en.wikipedia.org/wiki/Primality_test#Naive_methods + if (n == 2 || n == 3) { + return true; + } + // False if n is NaN, negative, is 1, or not whole. + // And false if n is divisible by 2 or 3. + if (isNaN(n) || n <= 1 || n % 1 !== 0 || n % 2 === 0 || n % 3 === 0) { + return false; + } + // Check all the numbers of form 6k +/- 1, up to sqrt(n). + for (var x = 6; x <= Math.sqrt(n) + 1; x += 6) { + if (n % (x - 1) === 0 || n % (x + 1) === 0) { + return false; + } + } + return true; +} +`)+"("+c+")":d==="DIVISIBLE_BY"?(a=b.valueToCode(a,"DIVISOR",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS)||"0",a=c+" % "+a+" === 0"):a=c+e;return[a,g]},math_change$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"DELTA",Order$$module$build$src$generators$javascript$javascript_generator.ADDITION)||"0";a=b.getVariableName(a.getFieldValue("VAR"));return a+" = (typeof "+a+" === 'number' ? "+a+" : 0) + "+c+";\n"},math_on_list$$module$build$src$generators$javascript$math= +function(a,b){var c=a.getFieldValue("OP");switch(c){case "SUM":a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.MEMBER)||"[]";a+=".reduce(function(x, y) {return x + y;}, 0)";break;case "MIN":a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a="Math.min.apply(null, "+a+")";break;case "MAX":a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a="Math.max.apply(null, "+ +a+")";break;case "AVERAGE":c=b.provideFunction_("mathMean",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(myList) { + return myList.reduce(function(x, y) {return x + y;}, 0) / myList.length; +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "MEDIAN":c=b.provideFunction_("mathMedian",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(myList) { + var localList = myList.filter(function (x) {return typeof x === 'number';}); + if (!localList.length) return null; + localList.sort(function(a, b) {return b - a;}); + if (localList.length % 2 === 0) { + return (localList[localList.length / 2 - 1] + localList[localList.length / 2]) / 2; + } else { + return localList[(localList.length - 1) / 2]; + } +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "MODE":c=b.provideFunction_("mathModes",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(values) { + var modes = []; + var counts = []; + var maxCount = 0; + for (var i = 0; i < values.length; i++) { + var value = values[i]; + var found = false; + var thisCount; + for (var j = 0; j < counts.length; j++) { + if (counts[j][0] === value) { + thisCount = ++counts[j][1]; + found = true; + break; + } + } + if (!found) { + counts.push([value, 1]); + thisCount = 1; + } + maxCount = Math.max(thisCount, maxCount); + } + for (var j = 0; j < counts.length; j++) { + if (counts[j][1] === maxCount) { + modes.push(counts[j][0]); + } + } + return modes; +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "STD_DEV":c=b.provideFunction_("mathStandardDeviation",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(numbers) { + var n = numbers.length; + if (!n) return null; + var mean = numbers.reduce(function(x, y) {return x + y;}) / n; + var variance = 0; + for (var j = 0; j < n; j++) { + variance += Math.pow(numbers[j] - mean, 2); + } + variance /= n; + return Math.sqrt(variance); +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;case "RANDOM":c=b.provideFunction_("mathRandomList",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(list) { + var x = Math.floor(Math.random() * list.length); + return list[x]; +} +`);a=b.valueToCode(a,"LIST",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"[]";a=c+"("+a+")";break;default:throw Error("Unknown operator: "+c);}return[a,Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_modulo$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"DIVIDEND",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS)||"0";a=b.valueToCode(a,"DIVISOR",Order$$module$build$src$generators$javascript$javascript_generator.MODULUS)|| +"0";return[c+" % "+a,Order$$module$build$src$generators$javascript$javascript_generator.MODULUS]},math_constrain$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"VALUE",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0",d=b.valueToCode(a,"LOW",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";a=b.valueToCode(a,"HIGH",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"Infinity";return["Math.min(Math.max("+ +c+", "+d+"), "+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_random_int$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"FROM",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";a=b.valueToCode(a,"TO",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";return[b.provideFunction_("mathRandomInt",` +function ${b.FUNCTION_NAME_PLACEHOLDER_}(a, b) { + if (a > b) { + // Swap a and b to ensure a is smaller. + var c = a; + a = b; + b = c; + } + return Math.floor(Math.random() * (b - a + 1) + a); +} +`)+"("+c+", "+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_random_float$$module$build$src$generators$javascript$math=function(a,b){return["Math.random()",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},math_atan2$$module$build$src$generators$javascript$math=function(a,b){const c=b.valueToCode(a,"X",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0";return["Math.atan2("+(b.valueToCode(a,"Y", +Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"0")+", "+c+") / Math.PI * 180",Order$$module$build$src$generators$javascript$javascript_generator.DIVISION]},procedures_defreturn$$module$build$src$generators$javascript$procedures=function(a,b){const c=b.getProcedureName(a.getFieldValue("NAME"));var d="";b.STATEMENT_PREFIX&&(d+=b.injectId(b.STATEMENT_PREFIX,a));b.STATEMENT_SUFFIX&&(d+=b.injectId(b.STATEMENT_SUFFIX,a));d&&(d=b.prefixLines(d,b.INDENT));let e="";b.INFINITE_LOOP_TRAP&& +(e=b.prefixLines(b.injectId(b.INFINITE_LOOP_TRAP,a),b.INDENT));let f="";a.getInput("STACK")&&(f=b.statementToCode(a,"STACK"));let g="";a.getInput("RETURN")&&(g=b.valueToCode(a,"RETURN",Order$$module$build$src$generators$javascript$javascript_generator.NONE)||"");let h="";f&&g&&(h=d);g&&(g=b.INDENT+"return "+g+";\n");const k=[],l=a.getVars();for(let m=0;m0?g=Order$$module$build$src$generators$javascript$javascript_generator.ADDITION:c<0?g=Order$$module$build$src$generators$javascript$javascript_generator.SUBTRACTION:d&&(g=Order$$module$build$src$generators$javascript$javascript_generator.UNARY_NEGATION);a=this.valueToCode(a,b,g)||f;if(c=== +0&&!d)return a;if($.isNumber$$module$build$src$core$utils$string(a))return a=String(Number(a)+c),d&&(a=String(-Number(a))),a;c>0?a=`${a} + ${c}`:c<0&&(a=`${a} - ${-c}`);d&&(a=c?`-(${a})`:`-${a}`);Math.floor(e)>=Math.floor(g)&&(a=`(${a})`);return a}},module$build$src$generators$javascript$javascript_generator={};module$build$src$generators$javascript$javascript_generator.JavascriptGenerator=JavascriptGenerator$$module$build$src$generators$javascript$javascript_generator; +module$build$src$generators$javascript$javascript_generator.Order=Order$$module$build$src$generators$javascript$javascript_generator;var getSubstringIndex$$module$build$src$generators$javascript$lists=function(a,b,c){return b==="FIRST"?"0":b==="FROM_END"?a+".length - 1 - "+c:b==="LAST"?a+".length - 1":c},module$build$src$generators$javascript$lists={};module$build$src$generators$javascript$lists.lists_create_empty=lists_create_empty$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_create_with=lists_create_with$$module$build$src$generators$javascript$lists; +module$build$src$generators$javascript$lists.lists_getIndex=lists_getIndex$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_getSublist=lists_getSublist$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_indexOf=lists_indexOf$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_isEmpty=lists_isEmpty$$module$build$src$generators$javascript$lists; +module$build$src$generators$javascript$lists.lists_length=lists_length$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_repeat=lists_repeat$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_reverse=lists_reverse$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_setIndex=lists_setIndex$$module$build$src$generators$javascript$lists; +module$build$src$generators$javascript$lists.lists_sort=lists_sort$$module$build$src$generators$javascript$lists;module$build$src$generators$javascript$lists.lists_split=lists_split$$module$build$src$generators$javascript$lists;var controls_ifelse$$module$build$src$generators$javascript$logic=controls_if$$module$build$src$generators$javascript$logic,module$build$src$generators$javascript$logic={};module$build$src$generators$javascript$logic.controls_if=controls_if$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.controls_ifelse=controls_if$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_boolean=logic_boolean$$module$build$src$generators$javascript$logic; +module$build$src$generators$javascript$logic.logic_compare=logic_compare$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_negate=logic_negate$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_null=logic_null$$module$build$src$generators$javascript$logic;module$build$src$generators$javascript$logic.logic_operation=logic_operation$$module$build$src$generators$javascript$logic; +module$build$src$generators$javascript$logic.logic_ternary=logic_ternary$$module$build$src$generators$javascript$logic;var controls_repeat$$module$build$src$generators$javascript$loops=controls_repeat_ext$$module$build$src$generators$javascript$loops,module$build$src$generators$javascript$loops={};module$build$src$generators$javascript$loops.controls_flow_statements=controls_flow_statements$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_for=controls_for$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_forEach=controls_forEach$$module$build$src$generators$javascript$loops; +module$build$src$generators$javascript$loops.controls_repeat=controls_repeat_ext$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_repeat_ext=controls_repeat_ext$$module$build$src$generators$javascript$loops;module$build$src$generators$javascript$loops.controls_whileUntil=controls_whileUntil$$module$build$src$generators$javascript$loops;var math_round$$module$build$src$generators$javascript$math=math_single$$module$build$src$generators$javascript$math,math_trig$$module$build$src$generators$javascript$math=math_single$$module$build$src$generators$javascript$math,module$build$src$generators$javascript$math={};module$build$src$generators$javascript$math.math_arithmetic=math_arithmetic$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_atan2=math_atan2$$module$build$src$generators$javascript$math; +module$build$src$generators$javascript$math.math_change=math_change$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_constant=math_constant$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_constrain=math_constrain$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_modulo=math_modulo$$module$build$src$generators$javascript$math; +module$build$src$generators$javascript$math.math_number=math_number$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_number_property=math_number_property$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_on_list=math_on_list$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_random_float=math_random_float$$module$build$src$generators$javascript$math; +module$build$src$generators$javascript$math.math_random_int=math_random_int$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_round=math_single$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_single=math_single$$module$build$src$generators$javascript$math;module$build$src$generators$javascript$math.math_trig=math_single$$module$build$src$generators$javascript$math;var procedures_defnoreturn$$module$build$src$generators$javascript$procedures=procedures_defreturn$$module$build$src$generators$javascript$procedures,module$build$src$generators$javascript$procedures={};module$build$src$generators$javascript$procedures.procedures_callnoreturn=procedures_callnoreturn$$module$build$src$generators$javascript$procedures;module$build$src$generators$javascript$procedures.procedures_callreturn=procedures_callreturn$$module$build$src$generators$javascript$procedures; +module$build$src$generators$javascript$procedures.procedures_defnoreturn=procedures_defreturn$$module$build$src$generators$javascript$procedures;module$build$src$generators$javascript$procedures.procedures_defreturn=procedures_defreturn$$module$build$src$generators$javascript$procedures;module$build$src$generators$javascript$procedures.procedures_ifreturn=procedures_ifreturn$$module$build$src$generators$javascript$procedures;var strRegExp$$module$build$src$generators$javascript$text=/^\s*'([^']|\\')*'\s*$/,forceString$$module$build$src$generators$javascript$text=function(a){return strRegExp$$module$build$src$generators$javascript$text.test(a)?[a,Order$$module$build$src$generators$javascript$javascript_generator.ATOMIC]:["String("+a+")",Order$$module$build$src$generators$javascript$javascript_generator.FUNCTION_CALL]},getSubstringIndex$$module$build$src$generators$javascript$text=function(a,b,c){return b==="FIRST"?"0": +b==="FROM_END"?a+".length - 1 - "+c:b==="LAST"?a+".length - 1":c},text_prompt$$module$build$src$generators$javascript$text=text_prompt_ext$$module$build$src$generators$javascript$text,module$build$src$generators$javascript$text={};module$build$src$generators$javascript$text.text=text$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_append=text_append$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_changeCase=text_changeCase$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_charAt=text_charAt$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_count=text_count$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_getSubstring=text_getSubstring$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_indexOf=text_indexOf$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_isEmpty=text_isEmpty$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_join=text_join$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_length=text_length$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_print=text_print$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_prompt=text_prompt_ext$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_prompt_ext=text_prompt_ext$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_replace=text_replace$$module$build$src$generators$javascript$text; +module$build$src$generators$javascript$text.text_reverse=text_reverse$$module$build$src$generators$javascript$text;module$build$src$generators$javascript$text.text_trim=text_trim$$module$build$src$generators$javascript$text;var module$build$src$generators$javascript$variables={};module$build$src$generators$javascript$variables.variables_get=variables_get$$module$build$src$generators$javascript$variables;module$build$src$generators$javascript$variables.variables_set=variables_set$$module$build$src$generators$javascript$variables;var module$build$src$generators$javascript$variables_dynamic={};module$build$src$generators$javascript$variables_dynamic.variables_get_dynamic=variables_get$$module$build$src$generators$javascript$variables;module$build$src$generators$javascript$variables_dynamic.variables_set_dynamic=variables_set$$module$build$src$generators$javascript$variables;var javascriptGenerator$$module$build$src$generators$javascript=new JavascriptGenerator$$module$build$src$generators$javascript$javascript_generator,generators$$module$build$src$generators$javascript=Object.assign({},module$build$src$generators$javascript$lists,module$build$src$generators$javascript$logic,module$build$src$generators$javascript$loops,module$build$src$generators$javascript$math,module$build$src$generators$javascript$procedures,module$build$src$generators$javascript$text,module$build$src$generators$javascript$variables, +module$build$src$generators$javascript$variables_dynamic);for(const a in generators$$module$build$src$generators$javascript)javascriptGenerator$$module$build$src$generators$javascript.forBlock[a]=generators$$module$build$src$generators$javascript[a];var module$build$src$generators$javascript={};module$build$src$generators$javascript.JavascriptGenerator=JavascriptGenerator$$module$build$src$generators$javascript$javascript_generator;module$build$src$generators$javascript.Order=Order$$module$build$src$generators$javascript$javascript_generator; +module$build$src$generators$javascript.javascriptGenerator=javascriptGenerator$$module$build$src$generators$javascript; +module$build$src$generators$javascript.__namespace__=$; +return module$build$src$generators$javascript; +})); + + +//# sourceMappingURL=javascript_compressed.js.map diff --git a/crumbblocks/solar_kettle_dark.html b/crumbblocks/solar_kettle_dark.html new file mode 100644 index 0000000..e27fd98 --- /dev/null +++ b/crumbblocks/solar_kettle_dark.html @@ -0,0 +1,687 @@ + + + + + + ☀️ Solar Wasserkocher + + + + + + + + +
+

☀️ Solar-Wasserkocher Sim

+ Bereit. + + + +
+ +
+
+
+
+
+
+
+
+
+
+
+
+
+ Temp: 20.0 °C
+ Power: 0 W
+ Energie: 0 kJ
+ Zeit: 0 s +
+
+
Logs:
+
+
+ + + + + + + \ No newline at end of file diff --git a/missions/evaluate_mission_data.sh b/missions/evaluate_mission_data.sh index 4c983db..c22674b 100755 --- a/missions/evaluate_mission_data.sh +++ b/missions/evaluate_mission_data.sh @@ -43,6 +43,11 @@ if [[ "$MISSION_ID" == "schnippsi_ui" ]]; then echo ">> Routing zu: Dein Zeichen im Wald (Schnippsi UI)" echo "$INPUT_DATA" | "${MISSION_DIR}/evaluate_sign.sh" exit $? +elif [[ "$MISSION_ID" == "solar_kettle" ]]; then + # --> Rerouting zur Solar Mission + echo ">> Routing zu: Solar Wasserkocher (Tobi Physics)" + echo "$INPUT_DATA" | "${MISSION_DIR}/robots/evaluate_solar_kettle.sh" + exit $? fi # ============================================================ diff --git a/missions/robots/evaluate_solar_kettle.sh b/missions/robots/evaluate_solar_kettle.sh new file mode 100755 index 0000000..c807015 --- /dev/null +++ b/missions/robots/evaluate_solar_kettle.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# ☀️ Auswertung: Solar Wasserkocher + +MISSION_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +source "${MISSION_DIR}/../../lib/waldwaechter.sh" + +# Input lesen +INPUT_DATA=$(cat) + +# Extrahieren (Fallback grep) +TEMP=$(echo "$INPUT_DATA" | grep -o '"final_temp": *"[^"]*"' | cut -d'"' -f4) +ENERGY=$(echo "$INPUT_DATA" | grep -o '"energy_kj": *"[^"]*"' | cut -d'"' -f4) +TIME=$(echo "$INPUT_DATA" | grep -o '"sim_time": *"[^"]*"' | cut -d'"' -f4) + +# Default values +TEMP=${TEMP:-0} +ENERGY=${ENERGY:-0} + +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "📊 Messdaten empfangen:" +echo " Temp: ${TEMP}°C" +echo " Energie: ${ENERGY} kJ" +echo " Zeit: ${TIME} s" +echo "" + +echo "🐿️ Tobi rechnet nach..." +sleep 1 + +# Physik Check +# Ziel: 100 Grad. +# Allow 95-105 tolerance (simulation steps) +if (( $(echo "$TEMP >= 95" | bc -l) )) && (( $(echo "$TEMP <= 105" | bc -l) )); then + tobi "Perfekt! Das Wasser kocht ($TEMP°C). Energie effizient genutzt." + echo "" + echo "🦊 FunkFox:" + funkfox "Der Loop war tight! Genau im richtigen Moment den Drop (Break) gesetzt." +elif (( $(echo "$TEMP < 95" | bc -l) )); then + tobi "Zu kalt! ($TEMP°C). Der Tee wird nichts. Du hast zu früh aufgehört zu heizen." +else + tobi "VORSICHT! $TEMP°C! Das ist Dampf unter Druck! Energieverschwendung!" + echo " (Du hast zu lange geheizt. Prüfe deine Abbruchbedingung!)" +fi + +echo "" +cat << "EOF" + ✅ MISSION STATUS: EVALUIERT +EOF diff --git a/missions/robots/solar_kettle.meta.json b/missions/robots/solar_kettle.meta.json new file mode 100644 index 0000000..e9b5d38 --- /dev/null +++ b/missions/robots/solar_kettle.meta.json @@ -0,0 +1,8 @@ +{ + "title": "Solar Wasserkocher", + "icon": "☀️", + "description": "Lerne Schleifen und Physik: Heize Wasser mit der Kraft der Sonne!", + "difficulty": "medium", + "author": "CapaciTobi", + "enabled": true +} diff --git a/missions/robots/solar_kettle.sh b/missions/robots/solar_kettle.sh new file mode 100755 index 0000000..26725ff --- /dev/null +++ b/missions/robots/solar_kettle.sh @@ -0,0 +1,51 @@ +#!/bin/bash +# ☀️ Solar Wasserkocher - Die Physik-Schleife +# Mission: Robots / Algorithms + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +# Relativer Pfad zur Lib (missions/robots -> ../../lib) +LIB_PATH="${SCRIPT_DIR}/../../lib/waldwaechter.sh" + +if [ -f "$LIB_PATH" ]; then + source "$LIB_PATH" +else + echo "⚠️ Waldwächter Lib nicht gefunden." + exit 1 +fi + +clear +cat << "EOF" + ☀️ SOLAR WASSERKOCHER ☀️ + + Eine Mission über Energie, Schleifen und Variablen. +EOF +echo "" +sleep 1 + +echo "🐌 Schnecki kriecht herein..." +schnecki "Huhu! Wir haben einen neuen Solar-Kocher. Aber er hat keinen Ausschalter! Er heizt einfach immer weiter, bis er explodiert! Waaaah!" +echo "" +sleep 1 + +echo "🐿️ (Capaci)Tobi eilt herbei..." +tobi "Ganz ruhig, Schnecki. Physikalisch betrachtet brauchen wir nur einen Regelkreis. Einen Algorithmus." +tobi "Energie rein -> Temperatur hoch -> Prüfen -> Stop." +echo "" +sleep 1 + +echo "🦊 FunkFox nickt..." +funkfox "Yo, das ist ein Loop! 'While not boiling, keep heating'. Ein klassischer Beat." +echo "" +echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━" +echo "📋 DEINE MISSION:" +echo "1. Öffne: crumbblocks/solar_kettle_dark.html" +echo " (Nutze './start_crumbblocks.sh', falls Server aus ist)" +echo "2. Baue den Algorithmus:" +echo " - Messe die Temperatur." +echo " - Wenn 'kühl', dann Heizung AN." +echo " - Warte kurz (Physik braucht Zeit!)." +echo " - Wiederhole, bis 100°C erreicht sind." +echo "3. Sende die Daten an die Crew." +echo "" + +read -p "🚀 Bereit zum Kochen? (Enter) " diff --git a/release_notes.md b/release_notes.md index 1a03a4d..edbef63 100644 --- a/release_notes.md +++ b/release_notes.md @@ -24,6 +24,16 @@ Dieser Release Candidate bringt das erste visuelle Design-Abenteuer in den Wald - Es erkennt automatisch, ob es sich um Roboter-Daten oder ein UI-Design handelt. - **Auto-Routing:** Leitet UI-JSON automatisch an Schnippsi (`evaluate_sign.sh`) weiter. +### 4. Neue Robot-Mission: "Solar Wasserkocher" +- **Kategorie:** 🤖 Robots +- **Ziel:** Bringe Wasser zum Kochen, nutze Solar-Energie effizient. +- **Tech-Stack:** Physics Engine (JS) + Blockly Loop-Logic. +- **Features:** + - Echtzeit-Simulation (Sonne, Wolken, Wärme, Energie). + - Asynchrone Loop-Ausführung im Browser ("Non-Blocking"). + - **Dark Mint Forest UI:** Augenfreundliches Dark-Theme für lange Sessions 🌙 + + ### 4. Logging & Bugfixes - **Templatus & Schnippsi:** Pfad-Fehler (`/home/zero`) auf macOS behoben. - **Logging:** Alle Logs landen jetzt zuverlässig in deinem Repo-Ordner (`logs/`), wo sie hingehören. diff --git a/schnippsi_ui/error.txt b/schnippsi_ui/error.txt deleted file mode 100755 index bfa5f4a..0000000 --- a/schnippsi_ui/error.txt +++ /dev/null @@ -1,6018 +0,0 @@ - - - - - - Error: Method Not Allowed - - - - - -
-

- Method Not Allowed - 📋 -

- Cake\Http\Exception\MethodNotAllowedException -
-
- -
- -
- - -
- - CORE/src/Http/ServerRequest.php at line 1442 - (edit) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
                return true;
            }
        }
        $allowed = strtoupper(implode(', ', $methods));
        $e = new MethodNotAllowedException();
        $e->setHeader('Allow', $allowed);
        throw $e;
    }
-
- -
    -
  • -
    - - -
    - - APP/Controller/CrumbapiController.php - - - at line45 - - - in - Cake\Http\ServerRequest->allowMethod - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Controller/Controller.php - - - at line505 - - - in - App\Controller\CrumbapiController->toylog - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Controller/ControllerFactory.php - - - at line166 - - - in - Cake\Controller\Controller->invokeAction - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Controller/ControllerFactory.php - - - at line141 - - - in - Cake\Controller\ControllerFactory->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/BaseApplication.php - - - at line362 - - - in - Cake\Controller\ControllerFactory->invoke - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line86 - - - in - Cake\Http\BaseApplication->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - APP/Application.php - - - at line67 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Middleware/ClosureDecoratorMiddleware.php - - - at line67 - - - in - App\Application->{closure:App\Application::middleware():60} - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - Cake\Http\Middleware\ClosureDecoratorMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Middleware/BodyParserMiddleware.php - - - at line157 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - Cake\Http\Middleware\BodyParserMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - ROOT/vendor/cakephp/authentication/src/Middleware/AuthenticationMiddleware.php - - - at line106 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - Authentication\Middleware\AuthenticationMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Routing/Middleware/RoutingMiddleware.php - - - at line117 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - Cake\Routing\Middleware\RoutingMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Routing/Middleware/AssetMiddleware.php - - - at line70 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - Cake\Routing\Middleware\AssetMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Error/Middleware/ErrorHandlerMiddleware.php - - - at line115 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - Cake\Error\Middleware\ErrorHandlerMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - ROOT/vendor/cakephp/debug_kit/src/Middleware/DebugKitMiddleware.php - - - at line60 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line82 - - - in - DebugKit\Middleware\DebugKitMiddleware->process - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Runner.php - - - at line60 - - - in - Cake\Http\Runner->handle - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - CORE/src/Http/Server.php - - - at line104 - - - in - Cake\Http\Runner->run - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - ROOT/webroot/index.php - - - at line37 - - - in - Cake\Http\Server->run - - (edit)
    -
    - -
  • -
  • -
    - - -
    - - [main] - - - - - -
    -
    - -
  • -
- -

- If you want to customize this error message, create - templates/Error/error400.php -

-
- - - - diff --git a/schnippsi_ui/index.html b/schnippsi_ui/index.html deleted file mode 100755 index b6696f2..0000000 --- a/schnippsi_ui/index.html +++ /dev/null @@ -1,103 +0,0 @@ - - - - - Schnippsis Live-Editor 🧁 - - - - -
- 🧁 Schnippsis Web-Baukasten – HTML, CSS & JS live! -
- -
-
- - - -
-
- - - - - - diff --git a/schnippsi_ui/ttyd b/schnippsi_ui/ttyd deleted file mode 160000 index 05422dc..0000000 --- a/schnippsi_ui/ttyd +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 05422dc91fc51da7b41e6bae020ac7a562f04a63