blockly 12.3.1 → 12.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/blockly.min.js +285 -277
  2. package/blockly_compressed.js +241 -234
  3. package/blockly_compressed.js.map +1 -1
  4. package/blocks_compressed.js +8 -7
  5. package/blocks_compressed.js.map +1 -1
  6. package/core/browser_events.d.ts +8 -2
  7. package/core/contextmenu_registry.d.ts +2 -2
  8. package/core/dragging/block_drag_strategy.d.ts +9 -0
  9. package/core/flyout_base.d.ts +5 -7
  10. package/core/flyout_button.d.ts +2 -1
  11. package/core/gesture.d.ts +0 -5
  12. package/core/icons/icon.d.ts +3 -1
  13. package/core/interfaces/i_contextmenu.d.ts +2 -0
  14. package/core/layer_manager.d.ts +17 -2
  15. package/core/menuitem.d.ts +8 -0
  16. package/core/rendered_connection.d.ts +1 -2
  17. package/core/toolbox/toolbox.d.ts +2 -0
  18. package/core/workspace_audio.d.ts +12 -11
  19. package/core/workspace_dragger.d.ts +0 -6
  20. package/core/workspace_svg.d.ts +1 -1
  21. package/dart_compressed.js +1 -1
  22. package/dart_compressed.js.map +1 -1
  23. package/msg/ab.js +36 -36
  24. package/msg/ace.js +36 -36
  25. package/msg/af.js +36 -36
  26. package/msg/am.js +36 -36
  27. package/msg/ar.js +36 -36
  28. package/msg/ast.js +36 -36
  29. package/msg/az.js +36 -36
  30. package/msg/ba.js +36 -36
  31. package/msg/bcc.js +36 -36
  32. package/msg/be-tarask.js +36 -36
  33. package/msg/be.js +36 -36
  34. package/msg/bg.js +36 -36
  35. package/msg/bn.js +36 -36
  36. package/msg/br.js +36 -36
  37. package/msg/bs.js +36 -36
  38. package/msg/ca.js +36 -36
  39. package/msg/cdo.js +36 -36
  40. package/msg/ce.js +36 -36
  41. package/msg/cs.js +36 -36
  42. package/msg/da.js +36 -36
  43. package/msg/de.js +32 -32
  44. package/msg/diq.js +36 -36
  45. package/msg/dtp.js +36 -36
  46. package/msg/dty.js +36 -36
  47. package/msg/ee.js +36 -36
  48. package/msg/el.js +36 -36
  49. package/msg/en-gb.js +36 -36
  50. package/msg/en.js +36 -36
  51. package/msg/eo.js +36 -36
  52. package/msg/es.js +34 -34
  53. package/msg/et.js +36 -36
  54. package/msg/eu.js +36 -36
  55. package/msg/fa.js +36 -36
  56. package/msg/fi.js +36 -36
  57. package/msg/fo.js +36 -36
  58. package/msg/fr.js +28 -28
  59. package/msg/frr.js +36 -36
  60. package/msg/gl.js +35 -35
  61. package/msg/gn.js +36 -36
  62. package/msg/gor.js +36 -36
  63. package/msg/ha.js +36 -36
  64. package/msg/hak.js +36 -36
  65. package/msg/he.js +36 -36
  66. package/msg/hi.js +36 -36
  67. package/msg/hr.js +36 -36
  68. package/msg/hrx.js +36 -36
  69. package/msg/hsb.js +36 -36
  70. package/msg/hu.js +36 -36
  71. package/msg/hy.js +36 -36
  72. package/msg/ia.js +35 -35
  73. package/msg/id.js +36 -36
  74. package/msg/ig.js +36 -36
  75. package/msg/inh.js +36 -36
  76. package/msg/is.js +36 -36
  77. package/msg/it.js +36 -36
  78. package/msg/ja.js +36 -36
  79. package/msg/ka.js +36 -36
  80. package/msg/kab.js +36 -36
  81. package/msg/kbd-cyrl.js +36 -36
  82. package/msg/km.js +36 -36
  83. package/msg/kn.js +36 -36
  84. package/msg/ko.js +26 -26
  85. package/msg/ksh.js +36 -36
  86. package/msg/ku-latn.js +36 -36
  87. package/msg/ky.js +36 -36
  88. package/msg/la.js +36 -36
  89. package/msg/lb.js +36 -36
  90. package/msg/lki.js +36 -36
  91. package/msg/lo.js +36 -36
  92. package/msg/lrc.js +36 -36
  93. package/msg/lt.js +36 -36
  94. package/msg/lv.js +36 -36
  95. package/msg/mg.js +36 -36
  96. package/msg/mk.js +36 -36
  97. package/msg/ml.js +36 -36
  98. package/msg/mnw.js +36 -36
  99. package/msg/ms.js +36 -36
  100. package/msg/my.js +36 -36
  101. package/msg/mzn.js +36 -36
  102. package/msg/nb.js +36 -36
  103. package/msg/ne.js +36 -36
  104. package/msg/nl.js +36 -36
  105. package/msg/oc.js +36 -36
  106. package/msg/olo.js +36 -36
  107. package/msg/pa.js +36 -36
  108. package/msg/pl.js +36 -36
  109. package/msg/pms.js +36 -36
  110. package/msg/ps.js +36 -36
  111. package/msg/pt-br.js +36 -36
  112. package/msg/pt.js +36 -36
  113. package/msg/ro.js +36 -36
  114. package/msg/ru.js +35 -35
  115. package/msg/sc.js +36 -36
  116. package/msg/sco.js +36 -36
  117. package/msg/sd.js +36 -36
  118. package/msg/shn.js +36 -36
  119. package/msg/si.js +36 -36
  120. package/msg/sk.js +36 -36
  121. package/msg/skr-arab.js +36 -36
  122. package/msg/sl.js +26 -26
  123. package/msg/smn.js +36 -36
  124. package/msg/sq.js +36 -36
  125. package/msg/sr-latn.js +36 -36
  126. package/msg/sr.js +36 -36
  127. package/msg/sv.js +36 -36
  128. package/msg/sw.js +36 -36
  129. package/msg/ta.js +36 -36
  130. package/msg/tcy.js +36 -36
  131. package/msg/tdd.js +36 -36
  132. package/msg/te.js +36 -36
  133. package/msg/th.js +36 -36
  134. package/msg/ti.js +36 -36
  135. package/msg/tl.js +36 -36
  136. package/msg/tlh.js +36 -36
  137. package/msg/tr.js +36 -36
  138. package/msg/ug-arab.js +36 -36
  139. package/msg/uk.js +36 -36
  140. package/msg/ur.js +36 -36
  141. package/msg/uz.js +36 -36
  142. package/msg/vi.js +36 -36
  143. package/msg/xmf.js +36 -36
  144. package/msg/yo.js +36 -36
  145. package/msg/zgh.js +36 -36
  146. package/msg/zh-hans.js +35 -35
  147. package/msg/zh-hant.js +35 -35
  148. package/package.json +2 -2
  149. package/media/click.ogg +0 -0
  150. package/media/click.wav +0 -0
  151. package/media/delete.ogg +0 -0
  152. package/media/delete.wav +0 -0
  153. package/media/disconnect.ogg +0 -0
  154. package/media/disconnect.wav +0 -0
package/blockly.min.js CHANGED
@@ -48,16 +48,16 @@ getMutatorProperties$$module$build$src$core$extensions,mutatorPropertiesMatch$$m
48
48
  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,
49
49
  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,
50
50
  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,
51
- 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,
52
- 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,
53
- 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,
54
- 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,
55
- 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,
56
- 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,
57
- 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,
58
- 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,
59
- 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,
60
- 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;
51
+ hasContextMenu$$module$build$src$core$interfaces$i_contextmenu,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,
52
+ 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,
53
+ 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,
54
+ 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,
55
+ 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,
56
+ 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,
57
+ 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,
58
+ 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,
59
+ 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,
60
+ 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;
61
61
  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],
62
62
  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};
63
63
  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');}};
@@ -68,8 +68,8 @@ getAllItems$$module$build$src$core$registry=function(a,b,c){a=`${a}`.toLowerCase
68
68
  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)};
69
69
  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)};
70
70
  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};
71
- 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<TOUCH_MAP$$module$build$src$core$touch[b].length;h++){const k=TOUCH_MAP$$module$build$src$core$touch[b][h];a.addEventListener(k,f,!1);g.push([a,k,f])}else a.addEventListener(b,f,!1),g.push([a,b,f]);return g};
72
- bind$$module$build$src$core$browser_events=function(a,b,c,d){function e(g){c?d.call(c,g):d(g)}const f=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let g=0;g<TOUCH_MAP$$module$build$src$core$touch[b].length;g++){const h=TOUCH_MAP$$module$build$src$core$touch[b][g];a.addEventListener(h,e,!1);f.push([a,h,e])}else a.addEventListener(b,e,!1),f.push([a,b,e]);return f};
71
+ conditionalBind$$module$build$src$core$browser_events=function(a,b,c,d,e,f){function g(k){if(e||shouldHandleEvent$$module$build$src$core$touch(k))c?d.call(c,k):d(k)}const h=[];if(b in TOUCH_MAP$$module$build$src$core$touch)for(let k=0;k<TOUCH_MAP$$module$build$src$core$touch[b].length;k++){const l=TOUCH_MAP$$module$build$src$core$touch[b][k];a.addEventListener(l,g,Object.assign({},{capture:!1},f));h.push([a,l,g])}else a.addEventListener(b,g,Object.assign({},{capture:!1},f)),h.push([a,b,g]);return h};
72
+ bind$$module$build$src$core$browser_events=function(a,b,c,d,e){function f(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<TOUCH_MAP$$module$build$src$core$touch[b].length;h++){const k=TOUCH_MAP$$module$build$src$core$touch[b][h];a.addEventListener(k,f,Object.assign({},{capture:!1},e));g.push([a,k,f])}else a.addEventListener(b,f,Object.assign({},{capture:!1},e)),g.push([a,b,f]);return g};
73
73
  unbind$$module$build$src$core$browser_events=function(a){const b=a[a.length-1][2];for(;a.length;){const [c,d,e]=a.pop();c.removeEventListener(d,e,!1)}return b};
74
74
  isTargetInput$$module$build$src$core$browser_events=function(a){if(a.target instanceof HTMLElement){if(a.target.isContentEditable||a.target.getAttribute("data-is-text-input")==="true")return!0;if(a.target instanceof HTMLInputElement)return a=a.target,a.type==="text"||a.type==="number"||a.type==="email"||a.type==="password"||a.type==="search"||a.type==="tel"||a.type==="url";if(a.target instanceof HTMLTextAreaElement)return!0}return!1};
75
75
  isRightButton$$module$build$src$core$browser_events=function(a){return a.ctrlKey&&MAC$$module$build$src$core$utils$useragent?!0:a.button===2};mouseToSvg$$module$build$src$core$browser_events=function(a,b,c){const d=b.createSVGPoint();d.x=a.clientX;d.y=a.clientY;c||(c=b.getScreenCTM().inverse());return d.matrixTransform(c)};
@@ -189,8 +189,8 @@ checkForConflictingParamWithProcedureModels$$module$build$src$core$variables=fun
189
189
  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};
190
190
  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};
191
191
  $.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};
192
- $.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};
193
- 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<a.length;d++){const e=a[d];b.includes(e)||c.push(e)}return c};
192
+ $.getVariable$$module$build$src$core$variables=function(a,b,c,d){const e=a.getPotentialVariableMap();let f=null;if(b&&(f=a.getVariableMap().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.getVariableMap().getVariable(c,d);!f&&e&&(f=e.getVariable(c,d))}return f};
193
+ 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.getVariableMap().getAllVariables();const c=[];if(b.length!==a.length)for(let d=0;d<a.length;d++){const e=a[d];b.includes(e)||c.push(e)}return c};
194
194
  compareByName$$module$build$src$core$variables=function(a,b){return a.getName().localeCompare(b.getName(),void 0,{sensitivity:"base"})};getVariableUsesById$$module$build$src$core$variables=function(a,b){const c=[];a=a.getAllBlocks(!1);for(let d=0;d<a.length;d++){const e=a[d].getVarModels();if(e)for(let f=0;f<e.length;f++)e[f].getId()===b&&c.push(a[d])}return c};
195
195
  $.deleteVariable$$module$build$src$core$variables=function(a,b,c){var d=b.getName();const e=getVariableUsesById$$module$build$src$core$variables(a,b.getId());for(let f=e.length-1;f>=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=
196
196
  $.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)};
@@ -202,9 +202,9 @@ saveIcons$$module$build$src$core$serialization$blocks=function(a,b,c){const d=Ob
202
202
  saveInputBlocks$$module$build$src$core$serialization$blocks=function(a,b,c,d){const e=Object.create(null);for(let f=0;f<a.inputList.length;f++){const g=a.inputList[f];if(!g.connection)continue;const h=saveConnection$$module$build$src$core$serialization$blocks(g.connection,c,d);h&&(e[g.name]=h)}Object.keys(e).length&&(b.inputs=e)};
203
203
  saveNextBlocks$$module$build$src$core$serialization$blocks=function(a,b,c,d){a.nextConnection&&(a=saveConnection$$module$build$src$core$serialization$blocks(a.nextConnection,c,d))&&(b.next=a)};saveConnection$$module$build$src$core$serialization$blocks=function(a,b,c){const d=a.getShadowState(!0);a=a.targetBlock();if(!d&&!a)return null;const e=Object.create(null);d&&(e.shadow=d);a&&!a.isShadow()&&(e.block=save$$module$build$src$core$serialization$blocks(a,{doFullSerialization:b,saveIds:c}));return e};
204
204
  append$$module$build$src$core$serialization$blocks=function(a,b,{recordUndo:c=!1}={}){a=appendInternal$$module$build$src$core$serialization$blocks(a,b,{recordUndo:c});b.rendered&&triggerQueuedRenders$$module$build$src$core$render_management();return a};
205
- appendInternal$$module$build$src$core$serialization$blocks=function(a,b,{parentConnection:c,isShadow:d=!1,recordUndo:e=!1}={}){const f=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(e);(e=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);$.disable$$module$build$src$core$events$utils();const g=b.getAllVariables();let h;try{h=appendPrivate$$module$build$src$core$serialization$blocks(a,b,{parentConnection:c,
206
- isShadow:d})}finally{$.enable$$module$build$src$core$events$utils()}checkNewVariables$$module$build$src$core$serialization$blocks(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_CREATE))(h));$.setGroup$$module$build$src$core$events$utils(e);$.setRecordUndo$$module$build$src$core$events$utils(f);if(b.rendered){const k=h;setTimeout(()=>{k.disposed||k.setConnectionTracking(!0)},
207
- 1)}return h};
205
+ appendInternal$$module$build$src$core$serialization$blocks=function(a,b,{parentConnection:c,isShadow:d=!1,recordUndo:e=!1}={}){const f=getRecordUndo$$module$build$src$core$events$utils();$.setRecordUndo$$module$build$src$core$events$utils(e);(e=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);$.disable$$module$build$src$core$events$utils();const g=b.getVariableMap().getAllVariables();let h;try{h=appendPrivate$$module$build$src$core$serialization$blocks(a,
206
+ b,{parentConnection:c,isShadow:d})}finally{$.enable$$module$build$src$core$events$utils()}checkNewVariables$$module$build$src$core$serialization$blocks(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_CREATE))(h));$.setGroup$$module$build$src$core$events$utils(e);$.setRecordUndo$$module$build$src$core$events$utils(f);if(b.rendered){const k=h;setTimeout(()=>
207
+ {k.disposed||k.setConnectionTracking(!0)},1)}return h};
208
208
  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,
209
209
  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};
210
210
  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;b<a.length;b++){const c=a[b];fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(c))}};
@@ -323,8 +323,8 @@ loadWorkspaceComment$$module$build$src$core$xml=function(a,b){var c;const d=(c=a
323
323
  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};
324
324
  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;h<a.length;h++){const k=b.getBlockById(a[h]).getRelativeToSurfaceXY();k.y<g&&(g=k.y);k.x<e&&(e=k.x);k.x>f&&(f=k.x)}d=d-g+10;c=b.RTL?c-f:c-e;for(e=0;e<a.length;e++)b.getBlockById(a[e]).moveBy(c,
325
325
  d,["create"])}return a};$.domToBlock$$module$build$src$core$xml=function(a,b){a=domToBlockInternal$$module$build$src$core$xml(a,b);b.rendered&&triggerQueuedRenders$$module$build$src$core$render_management();return a};
326
- domToBlockInternal$$module$build$src$core$xml=function(a,b){$.disable$$module$build$src$core$events$utils();var c=b.getAllVariables();let d;try{if(d=domToBlockHeadless$$module$build$src$core$xml(a,b),b.rendered){const e=d,f=d.getDescendants(!1);e.setConnectionTracking(!1);for(let g=f.length-1;g>=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-
327
- 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<a.length;b++)c=a[b],fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(c));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))}return d};
326
+ domToBlockInternal$$module$build$src$core$xml=function(a,b){$.disable$$module$build$src$core$events$utils();var c=b.getVariableMap().getAllVariables();let d;try{if(d=domToBlockHeadless$$module$build$src$core$xml(a,b),b.rendered){const e=d,f=d.getDescendants(!1);e.setConnectionTracking(!1);for(let g=f.length-1;g>=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);
327
+ 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<a.length;b++)c=a[b],fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(c));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))}return d};
328
328
  domToVariables$$module$build$src$core$xml=function(a,b){for(let d=0;d<a.children.length;d++){var c=a.children[d];const e=c.getAttribute("type"),f=c.getAttribute("id");c=c.textContent;if(!c)break;let g;b.getVariableMap().createVariable(c,(g=e)!=null?g:void 0,f)}};
329
329
  mapSupportedXmlTags$$module$build$src$core$xml=function(a){const b={mutation:[],comment:[],data:[],field:[],input:[],next:[]};for(let c=0;c<a.children.length;c++){const d=a.children[c];if(d.nodeType!==NodeType$$module$build$src$core$utils$dom.TEXT_NODE)switch(d.nodeName.toLowerCase()){case "mutation":b.mutation.push(d);break;case "comment":b.comment.push(d);break;case "data":b.data.push(d);break;case "title":case "field":b.field.push(d);break;case "value":case "statement":b.input.push(d);break;case "next":b.next.push(d);
330
330
  break;default:console.warn("Ignoring unknown tag: "+d.nodeName)}}return b};applyMutationTagNodes$$module$build$src$core$xml=function(a,b){let c=!1;for(let d=0;d<a.length;d++){const e=a[d];b.domToMutation&&(b.domToMutation(e),b.initSvg&&(c=!0))}return c};
@@ -355,7 +355,7 @@ getMutatorProperties$$module$build$src$core$extensions=function(a){const b=[];a.
355
355
  mutatorPropertiesMatch$$module$build$src$core$extensions=function(a,b){b=getMutatorProperties$$module$build$src$core$extensions(b);if(b.length!==a.length)return!1;for(let c=0;c<b.length;c++)if(a[c]!==b[c])return!1;return!0};
356
356
  runAfterPageLoad$$module$build$src$core$extensions=function(a){if(typeof document!=="object")throw Error("runAfterPageLoad() requires browser document.");if(document.readyState==="complete")a();else{const b=setInterval(function(){document.readyState==="complete"&&(clearInterval(b),a())},10)}};
357
357
  $.buildTooltipForDropdown$$module$build$src$core$extensions=function(a,b){const c=[];return function(){c.includes(this.type)||(checkDropdownOptionsInTable$$module$build$src$core$extensions(this,a,b),c.push(this.type));this.setTooltip(function(){const d=String(this.getFieldValue(a));return replaceMessageReferences$$module$build$src$core$utils$parsing(b[d])}.bind(this))}};
358
- checkDropdownOptionsInTable$$module$build$src$core$extensions=function(a,b,c){var d=a.getField(b);if(d instanceof FieldDropdown$$module$build$src$core$field_dropdown&&!d.isOptionListDynamic()){d=d.getOptions();for(const e of d)e!==FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR&&([,d]=e,c[d]===void 0&&console.warn(`No tooltip mapping for value ${d} of field `+`${b} of block type ${a.type}.`))}};
358
+ checkDropdownOptionsInTable$$module$build$src$core$extensions=function(a,b,c){var d=a.getField(b);if(d instanceof FieldDropdown$$module$build$src$core$field_dropdown&&!d.isOptionListDynamic()){d=d.getOptions();for(const e of d)e!==FieldDropdown$$module$build$src$core$field_dropdown.SEPARATOR&&([,d]=e,c[d]===void 0&&console.warn(`No tooltip mapping for value ${d} of field ${b} of block type ${a.type}.`))}};
359
359
  $.buildTooltipWithFieldText$$module$build$src$core$extensions=function(a,b){return function(){this.setTooltip(function(){const c=this.getField(b);return replaceMessageReferences$$module$build$src$core$utils$parsing(a).replace("%1",c?c.getText():"")}.bind(this))}};extensionParentTooltip$$module$build$src$core$extensions=function(){const a=this.tooltip;this.setTooltip(function(){const b=this.getParent();return b&&b.getInputsInline()&&b.tooltip||a}.bind(this))};
360
360
  point$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+","+b+" "};curve$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+b.join("")};moveTo$$module$build$src$core$utils$svg_paths=function(a,b){return" M "+a+","+b+" "};moveBy$$module$build$src$core$utils$svg_paths=function(a,b){return" m "+a+","+b+" "};lineTo$$module$build$src$core$utils$svg_paths=function(a,b){return" l "+a+","+b+" "};line$$module$build$src$core$utils$svg_paths=function(a){return" l"+a.join("")};
361
361
  lineOnAxis$$module$build$src$core$utils$svg_paths=function(a,b){return" "+a+" "+b+" "};arc$$module$build$src$core$utils$svg_paths=function(a,b,c,d){return a+" "+c+" "+c+" "+b+d};connectReciprocally$$module$build$src$core$connection=function(a,b){if(!a||!b)throw Error("Cannot connect null connections.");a.targetConnection=b;b.targetConnection=a};
@@ -384,7 +384,7 @@ null?void 0:f.type)===ConnectionType$$module$build$src$core$connection_type.INPU
384
384
  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[a]:a<0?d=c[c.length-1]: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?
385
385
  void 0:e.getSourceBlock())!=null?f:d}return d};
386
386
  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<c.length?
387
- c[b]:null};register$$module$build$src$core$icons$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a.toString(),b)};unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)};
387
+ c[b]:null};register$$module$build$src$core$icons$registry=function(a,b){register$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a.toString(),b)};unregister$$module$build$src$core$icons$registry=function(a){unregister$$module$build$src$core$registry(Type$$module$build$src$core$registry.ICON,a)};hasContextMenu$$module$build$src$core$interfaces$i_contextmenu=function(a){return a&&typeof a.showContextMenu==="function"};
388
388
  isDraggable$$module$build$src$core$interfaces$i_draggable=function(a){return a&&typeof a.getRelativeToSurfaceXY==="function"&&typeof a.isMovable==="function"&&typeof a.startDrag==="function"&&typeof a.drag==="function"&&typeof a.endDrag==="function"&&typeof a.revertDrag==="function"};isAutoHideable$$module$build$src$core$interfaces$i_autohideable=function(a){return a&&typeof a.autoHide==="function"};
389
389
  isProcedureBlock$$module$build$src$core$interfaces$i_procedure_block=function(a){return typeof a.getProcedureModel==="function"&&typeof a.doProcedureUpdate==="function"&&typeof a.isProcedureDef==="function"};isObservable$$module$build$src$core$interfaces$i_observable=function(a){return a&&typeof a.startPublishing==="function"&&typeof a.stopPublishing==="function"};
390
390
  allProcedures$$module$build$src$core$procedures=function(a){const b=a.getProcedureMap().getProcedures().filter(d=>!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=>
@@ -462,9 +462,7 @@ init$$module$build$src$core$inject=function(a){const b=a.options;var c=a.getPare
462
462
  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=
463
463
  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)};
464
464
  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,
465
- "touchcancel",null,longStop$$module$build$src$core$touch));documentEventsBound$$module$build$src$core$inject=!0};
466
- 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));
467
- 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()};
465
+ "touchcancel",null,longStop$$module$build$src$core$touch));documentEventsBound$$module$build$src$core$inject=!0};loadSounds$$module$build$src$core$inject=function(a,b){b=b.getAudioManager();b.load([`${a}click.mp3`],"click");b.load([`${a}disconnect.mp3`],"disconnect");b.load([`${a}delete.mp3`],"delete")};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()};
468
466
  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})};
469
467
  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})};
470
468
  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})};
@@ -496,15 +494,16 @@ registerCommentDelete$$module$build$src$core$contextmenu_items=function(){Contex
496
494
  id:"commentDelete",weight:6})};
497
495
  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",
498
496
  weight:1})};
499
- 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),
500
- 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})};
497
+ 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.moveTo(screenToWsCoordinates$$module$build$src$core$utils$svg_math(a,
498
+ 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})};
501
499
  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()};
502
500
  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()};
503
501
  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)};
504
502
  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;
505
503
  $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};
506
504
  $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<a.length;++b){var c=a[b];if(c&&c.Math==Math)return c}throw Error("Cannot find global object");};$jscomp.global=$jscomp.ASSUME_ES2020?globalThis:$jscomp.getGlobal(this);$jscomp.IS_SYMBOL_NATIVE=typeof Symbol==="function"&&typeof Symbol("x")==="symbol";$jscomp.TRUST_ES6_POLYFILLS=!$jscomp.ISOLATE_POLYFILLS||$jscomp.IS_SYMBOL_NATIVE;
507
- $jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b,c){if(!c||a!=null){c=$jscomp.propertyToPolyfillSymbol[b];if(c==null)return a[b];c=a[c];return c!==void 0?c:a[b]}};$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};
505
+ $jscomp.polyfills={};$jscomp.propertyToPolyfillSymbol={};$jscomp.POLYFILL_PREFIX="$jscp$";var $jscomp$lookupPolyfilledValue=function(a,b,c){if(!c||a!=null){c=$jscomp.propertyToPolyfillSymbol[b];if(c==null)return a[b];c=a[c];return c!==void 0?c:a[b]}};$jscomp.TYPED_ARRAY_CLASSES=function(){var a="Int8 Uint8 Uint8Clamped Int16 Uint16 Int32 Uint32 Float32 Float64".split(" ");$jscomp.global.BigInt64Array&&(a.push("BigInt64"),a.push("BigUint64"));return a}();
506
+ $jscomp.polyfillTypedArrayMethod=function(a,b,c,d){if(b)for(var e=0;e<$jscomp.TYPED_ARRAY_CLASSES.length;e++){var f=$jscomp.TYPED_ARRAY_CLASSES[e]+"Array.prototype."+a;$jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(f,b,c,d):$jscomp.polyfillUnisolated(f,b,c,d)}};$jscomp.polyfill=function(a,b,c,d){b&&($jscomp.ISOLATE_POLYFILLS?$jscomp.polyfillIsolated(a,b,c,d):$jscomp.polyfillUnisolated(a,b,c,d))};
508
507
  $jscomp.polyfillUnisolated=function(a,b,c,d){c=$jscomp.global;a=a.split(".");for(d=0;d<a.length-1;d++){var e=a[d];if(!(e in c))return;c=c[e]}a=a[a.length-1];d=c[a];b=b(d);b!=d&&b!=null&&$jscomp.defineProperty(c,a,{configurable:!0,writable:!0,value:b})};
509
508
  $jscomp.polyfillIsolated=function(a,b,c,d){var e=a.split(".");a=e.length===1;d=e[0];d=!a&&d in $jscomp.polyfills?$jscomp.polyfills:$jscomp.global;for(var f=0;f<e.length-1;f++){var g=e[f];if(!(g in d))return;d=d[g]}e=e[e.length-1];c=$jscomp.IS_SYMBOL_NATIVE&&c==="es6"?d[e]:null;b=b(c);b!=null&&(a?$jscomp.defineProperty($jscomp.polyfills,e,{configurable:!0,writable:!0,value:b}):b!==c&&($jscomp.propertyToPolyfillSymbol[e]===void 0&&(c=Math.random()*1E9>>>0,$jscomp.propertyToPolyfillSymbol[e]=$jscomp.IS_SYMBOL_NATIVE?
510
509
  $jscomp.global.Symbol(e):$jscomp.POLYFILL_PREFIX+c+"$"+e),$jscomp.defineProperty(d,$jscomp.propertyToPolyfillSymbol[e],{configurable:!0,writable:!0,value:b})))};
@@ -514,12 +513,15 @@ $jscomp.inherits=function(a,b){a.prototype=$jscomp.objectCreate(b.prototype);a.p
514
513
  $jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];if(b)return b.call(a);if(typeof a.length=="number")return $jscomp.arrayIterator(a);throw Error(String(a)+" is not an iterable or ArrayLike");};$jscomp.arrayFromIterator=function(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c};$jscomp.arrayFromIterable=function(a){return a instanceof Array?a:$jscomp.arrayFromIterator($jscomp.makeIterator(a))};
515
514
  $jscomp.generator={};$jscomp.generator.ensureIteratorResultIsObject_=function(a){if(!(a instanceof Object))throw new TypeError("Iterator result "+a+" is not an object");};$jscomp.generator.Context=function(){this.isRunning_=!1;this.yieldAllIterator_=null;this.yieldResult=void 0;this.nextAddress=1;this.finallyAddress_=this.catchAddress_=0;this.finallyContexts_=this.abruptCompletion_=null};
516
515
  $jscomp.generator.Context.prototype.start_=function(){if(this.isRunning_)throw new TypeError("Generator is already running");this.isRunning_=!0};$jscomp.generator.Context.prototype.stop_=function(){this.isRunning_=!1};$jscomp.generator.Context.prototype.jumpToErrorHandler_=function(){this.nextAddress=this.catchAddress_||this.finallyAddress_};$jscomp.generator.Context.prototype.next_=function(a){this.yieldResult=a};
517
- $jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.return=function(a){this.abruptCompletion_={return:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(a){this.abruptCompletion_={jumpTo:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.yield=function(a,b){this.nextAddress=b;return{value:a}};
518
- $jscomp.generator.Context.prototype.yieldAll=function(a,b){a=$jscomp.makeIterator(a);var c=a.next();$jscomp.generator.ensureIteratorResultIsObject_(c);if(c.done)this.yieldResult=c.value,this.nextAddress=b;else return this.yieldAllIterator_=a,this.yield(c.value,b)};$jscomp.generator.Context.prototype.jumpTo=function(a){this.nextAddress=a};$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};
519
- $jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(a,b){this.catchAddress_=a;b!=void 0&&(this.finallyAddress_=b)};$jscomp.generator.Context.prototype.setFinallyBlock=function(a){this.catchAddress_=0;this.finallyAddress_=a||0};$jscomp.generator.Context.prototype.leaveTryBlock=function(a,b){this.nextAddress=a;this.catchAddress_=b||0};
520
- $jscomp.generator.Context.prototype.enterCatchBlock=function(a){this.catchAddress_=a||0;a=this.abruptCompletion_.exception;this.abruptCompletion_=null;return a};$jscomp.generator.Context.prototype.enterFinallyBlock=function(a,b,c){c?this.finallyContexts_[c]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=a||0;this.finallyAddress_=b||0};
521
- $jscomp.generator.Context.prototype.leaveFinallyBlock=function(a,b){b=this.finallyContexts_.splice(b||0)[0];if(b=this.abruptCompletion_=this.abruptCompletion_||b){if(b.isException)return this.jumpToErrorHandler_();b.jumpTo!=void 0&&this.finallyAddress_<b.jumpTo?(this.nextAddress=b.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=a};$jscomp.generator.Context.prototype.forIn=function(a){return new $jscomp.generator.Context.PropertyIterator(a)};
522
- $jscomp.generator.Context.PropertyIterator=function(a){this.object_=a;this.properties_=[];for(var b in a)this.properties_.push(b);this.properties_.reverse()};$jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;this.properties_.length>0;){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};
516
+ $jscomp.generator.Context.prototype.throw_=function(a){this.abruptCompletion_={exception:a,isException:!0};this.jumpToErrorHandler_()};$jscomp.generator.Context.prototype.getNextAddress=function(){return this.nextAddress};$jscomp.generator.Context.prototype.getNextAddress=$jscomp.generator.Context.prototype.getNextAddress;$jscomp.generator.Context.prototype.getYieldResult=function(){return this.yieldResult};$jscomp.generator.Context.prototype.getYieldResult=$jscomp.generator.Context.prototype.getYieldResult;
517
+ $jscomp.generator.Context.prototype.return=function(a){this.abruptCompletion_={return:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype["return"]=$jscomp.generator.Context.prototype.return;$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=function(a){this.abruptCompletion_={jumpTo:a};this.nextAddress=this.finallyAddress_};$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks=$jscomp.generator.Context.prototype.jumpThroughFinallyBlocks;
518
+ $jscomp.generator.Context.prototype.yield=function(a,b){this.nextAddress=b;return{value:a}};$jscomp.generator.Context.prototype.yield=$jscomp.generator.Context.prototype.yield;$jscomp.generator.Context.prototype.yieldAll=function(a,b){a=$jscomp.makeIterator(a);var c=a.next();$jscomp.generator.ensureIteratorResultIsObject_(c);if(c.done)this.yieldResult=c.value,this.nextAddress=b;else return this.yieldAllIterator_=a,this.yield(c.value,b)};$jscomp.generator.Context.prototype.yieldAll=$jscomp.generator.Context.prototype.yieldAll;
519
+ $jscomp.generator.Context.prototype.jumpTo=function(a){this.nextAddress=a};$jscomp.generator.Context.prototype.jumpTo=$jscomp.generator.Context.prototype.jumpTo;$jscomp.generator.Context.prototype.jumpToEnd=function(){this.nextAddress=0};$jscomp.generator.Context.prototype.jumpToEnd=$jscomp.generator.Context.prototype.jumpToEnd;$jscomp.generator.Context.prototype.setCatchFinallyBlocks=function(a,b){this.catchAddress_=a;b!=void 0&&(this.finallyAddress_=b)};
520
+ $jscomp.generator.Context.prototype.setCatchFinallyBlocks=$jscomp.generator.Context.prototype.setCatchFinallyBlocks;$jscomp.generator.Context.prototype.setFinallyBlock=function(a){this.catchAddress_=0;this.finallyAddress_=a||0};$jscomp.generator.Context.prototype.setFinallyBlock=$jscomp.generator.Context.prototype.setFinallyBlock;$jscomp.generator.Context.prototype.leaveTryBlock=function(a,b){this.nextAddress=a;this.catchAddress_=b||0};$jscomp.generator.Context.prototype.leaveTryBlock=$jscomp.generator.Context.prototype.leaveTryBlock;
521
+ $jscomp.generator.Context.prototype.enterCatchBlock=function(a){this.catchAddress_=a||0;a=this.abruptCompletion_.exception;this.abruptCompletion_=null;return a};$jscomp.generator.Context.prototype.enterCatchBlock=$jscomp.generator.Context.prototype.enterCatchBlock;$jscomp.generator.Context.prototype.enterFinallyBlock=function(a,b,c){c?this.finallyContexts_[c]=this.abruptCompletion_:this.finallyContexts_=[this.abruptCompletion_];this.catchAddress_=a||0;this.finallyAddress_=b||0};
522
+ $jscomp.generator.Context.prototype.enterFinallyBlock=$jscomp.generator.Context.prototype.enterFinallyBlock;$jscomp.generator.Context.prototype.leaveFinallyBlock=function(a,b){b=this.finallyContexts_.splice(b||0)[0];if(b=this.abruptCompletion_=this.abruptCompletion_||b){if(b.isException)return this.jumpToErrorHandler_();b.jumpTo!=void 0&&this.finallyAddress_<b.jumpTo?(this.nextAddress=b.jumpTo,this.abruptCompletion_=null):this.nextAddress=this.finallyAddress_}else this.nextAddress=a};
523
+ $jscomp.generator.Context.prototype.leaveFinallyBlock=$jscomp.generator.Context.prototype.leaveFinallyBlock;$jscomp.generator.Context.prototype.forIn=function(a){return new $jscomp.generator.Context.PropertyIterator(a)};$jscomp.generator.Context.prototype.forIn=$jscomp.generator.Context.prototype.forIn;$jscomp.generator.Context.PropertyIterator=function(a){this.object_=a;this.properties_=[];for(var b in a)this.properties_.push(b);this.properties_.reverse()};
524
+ $jscomp.generator.Context.PropertyIterator.prototype.getNext=function(){for(;this.properties_.length>0;){var a=this.properties_.pop();if(a in this.object_)return a}return null};$jscomp.generator.Context.PropertyIterator.prototype.getNext=$jscomp.generator.Context.PropertyIterator.prototype.getNext;$jscomp.generator.Engine_=function(a){this.context_=new $jscomp.generator.Context;this.program_=a};
523
525
  $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_()};
524
526
  $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_()};
525
527
  $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_()};
@@ -595,8 +597,8 @@ module$build$src$core$common.defineBlocks=$.defineBlocks$$module$build$src$core$
595
597
  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;
596
598
  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;
597
599
  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));
598
- 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;
599
- 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={}));
600
+ 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.isBlank=!0;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;
601
+ return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.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={}));
600
602
  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");
601
603
  Capability$$module$build$src$core$component_manager.AUTOHIDEABLE=new Capability$$module$build$src$core$component_manager("autohideable");
602
604
  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<a.capabilities.length;d++){const e=String(a.capabilities[d]).toLowerCase();b.push(e);if(this.capabilityToComponentIds.has(e)){let f;
@@ -605,7 +607,7 @@ a+'" has not been added to the ComponentManager');if(this.hasCapability(a,b))con
605
607
  b),removeElem$$module$build$src$core$utils$array(this.capabilityToComponentIds.get(b),a)):console.warn('Plugin "'+a+"doesn't have capability \""+b+'" to remove')}hasCapability(a,b){b=`${b}`.toLowerCase();return this.componentData.has(a)&&this.componentData.get(a).capabilities.includes(b)}getComponent(a){let b;return(b=this.componentData.get(a))==null?void 0:b.component}getComponents(a,b){a=`${a}`.toLowerCase();a=this.capabilityToComponentIds.get(a);if(!a)return[];const c=[];if(b){const d=[];a.forEach(e=>
606
608
  {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;
607
609
  (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={}));
608
- 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("<<<PATH>>>/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(<<<PATH>>>/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',
610
+ 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 .15s;\n}\n\n@media (prefers-reduced-motion) {\n .blocklyBlockCanvas.blocklyCanvasTransitioning,\n .blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: none;\n }\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("<<<PATH>>>/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(<<<PATH>>>/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',
609
611
  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-
610
612
  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");
611
613
  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");
@@ -649,11 +651,11 @@ f+")");f=f+this.SMALL_SPACING+this.HEIGHT;(e=this.zoomOutGroup)==null||e.setAttr
649
651
  {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",
650
652
  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"+
651
653
  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+
652
- 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"},
653
- 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"+
654
- 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);
655
- 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");
656
- 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,
654
+ 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.beginCanvasTransition();this.workspace.markFocused();this.workspace.zoomCenter(a);setTimeout(this.workspace.endCanvasTransition.bind(this.workspace),150);this.fireZoomEvent();clearTouchIdentifier$$module$build$src$core$touch();b.stopPropagation();b.preventDefault()}createZoomResetSvg(a){this.zoomResetGroup=
655
+ 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,
656
+ {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();
657
+ 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),150);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,
658
+ 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,
657
659
  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,
658
660
  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={};
659
661
  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));
@@ -662,14 +664,16 @@ module$build$src$core$clipboard$workspace_comment_paster.WorkspaceCommentPaster=
662
664
  (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;
663
665
  (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={}));
664
666
  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?
665
- "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,
666
- 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=
667
- 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());
667
+ "blocklyMenuItemHighlight ":"")+(this.rightToLeft?"blocklyMenuItemRtl ":"");const b=document.createElement("div");b.className="blocklyMenuItemContent";let c=this.content;typeof this.content==="string"&&(c=document.createTextNode(this.content));b.appendChild(c);a.appendChild(b);this.checkable&&this.toggleHasCheckbox(!0);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&&
668
+ 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;let b;(b=this.getElement())==null||b.classList.toggle("blocklyMenuItemRtl",this.rightToLeft)}setRole(a){this.roleName=a}setCheckable(a){(this.checkable=a)||this.setChecked(!1);this.toggleHasCheckbox(a)}setChecked(a){if(!a||
669
+ this.checkable)if(this.checked=a,a=this.getElement())a.classList.toggle("blocklyMenuItemSelected",this.checked),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.SELECTED,this.checked)}setHighlighted(a){this.highlight=a;if(this.isEnabled()){let b;(b=this.getElement())==null||b.classList.toggle("blocklyMenuItemHighlight",this.highlight)}}isEnabled(){return this.enabled}setEnabled(a){this.enabled=a;if(a=this.getElement())a.classList.toggle("blocklyMenuItemDisabled",
670
+ !this.enabled),setState$$module$build$src$core$utils$aria(a,State$$module$build$src$core$utils$aria.DISABLED,!this.enabled)}performAction(a){this.isEnabled()&&this.actionHandler&&this.actionHandler(this,a)}onAction(a,b){this.actionHandler=a.bind(b)}toggleHasCheckbox(a){if(a){let d;if((d=this.getElement())==null||!d.querySelector(".blocklyMenuItemContent .blocklyMenuItemCheckbox")){a=document.createElement("div");a.className="blocklyMenuItemCheckbox ";var b,c;(b=this.getElement())==null||(c=b.querySelector(".blocklyMenuItemContent"))==
671
+ null||c.prepend(a)}}else{let d,e;(d=this.getElement())==null||(e=d.querySelector(".blocklyMenuItemContent .blocklyMenuItemCheckbox"))==null||e.remove()}}},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());
668
672
  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=
669
673
  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),
670
674
  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();
671
675
  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,
672
- 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);
676
+ a.getId()))}}highlightNext(){const a=this.highlightedItem?this.getMenuItems().indexOf(this.highlightedItem):-1;this.highlightHelper(a,1)}highlightPrevious(){const a=this.highlightedItem?this.getMenuItems().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);
673
677
  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))&&
674
678
  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;
675
679
  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;
@@ -718,17 +722,17 @@ module$build$src$core$variables.jsonFlyoutCategoryBlocks=jsonFlyoutCategoryBlock
718
722
  b,c){super(`The block ${b.toDevString()} is missing a(n) ${a}
719
723
  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
720
724
  ${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,
721
- 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;
725
+ 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;
722
726
  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,
723
727
  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;
724
728
  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");
725
- 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);
726
- 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;
727
- 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".');
729
+ 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=!0;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=Abstract$$module$build$src$core$events$events_abstract.fromJson(a,
730
+ 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;
731
+ a.oldValue=this.oldValue;a.newValue=this.newValue;this.disabledReason&&(a.disabledReason=this.disabledReason);return a}static fromJson(a,b,c){b=BlockBase$$module$build$src$core$events$events_block_base.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".');
728
732
  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)&&
729
- 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);
730
- b.loadExtraState?b.loadExtraState(JSON.parse(a||"{}")):b.domToMutation&&b.domToMutation($.textToDom$$module$build$src$core$utils$xml(a||"<mutation/>"));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):
731
- "":""}};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,
733
+ 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?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=
734
+ 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||"<mutation/>"));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))?
735
+ 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,
732
736
  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),
733
737
  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.height<e.bottom?getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>e.top?getPositionAboveMetrics$$module$build$src$core$dropdowndiv(c,
734
738
  d,e,f):b+f.height<document.documentElement.clientHeight?getPositionBelowMetrics$$module$build$src$core$dropdowndiv(a,b,e,f):d-f.height>document.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,
@@ -765,8 +769,8 @@ Field$$module$build$src$core$field.SKIP_SETUP=Symbol("SKIP_SETUP");var Unattache
765
769
  module$build$src$core$widgetdiv.createDom=createDom$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.getDiv=getDiv$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hide=hide$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hideIfOwner=hideIfOwner$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.hideIfOwnerIsInWorkspace=hideIfOwnerIsInWorkspace$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.isVisible=isVisible$$module$build$src$core$widgetdiv;
766
770
  module$build$src$core$widgetdiv.positionWithAnchor=positionWithAnchor$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.repositionForWindowResize=repositionForWindowResize$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.show=show$$module$build$src$core$widgetdiv;module$build$src$core$widgetdiv.testOnly_setDiv=testOnly_setDiv$$module$build$src$core$widgetdiv;var currentBlock$$module$build$src$core$contextmenu=null,dummyOwner$$module$build$src$core$contextmenu={},menu_$$module$build$src$core$contextmenu=null,module$build$src$core$contextmenu={};module$build$src$core$contextmenu.callbackFactory=$.callbackFactory$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.dispose=dispose$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.getCurrentBlock=getCurrentBlock$$module$build$src$core$contextmenu;
767
771
  module$build$src$core$contextmenu.hide=hide$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.setCurrentBlock=setCurrentBlock$$module$build$src$core$contextmenu;module$build$src$core$contextmenu.show=show$$module$build$src$core$contextmenu;var ContextMenuRegistry$$module$build$src$core$contextmenu_registry=class{constructor(){this.registeredItems=new Map;this.reset()}reset(){this.registeredItems.clear()}register(a){if(this.registeredItems.has(a.id))throw Error('Menu item with ID "'+a.id+'" is already registered.');this.registeredItems.set(a.id,a)}unregister(a){if(!this.registeredItems.has(a))throw Error('Menu item with ID "'+a+'" not found.');this.registeredItems.delete(a)}getItem(a){let b;return(b=this.registeredItems.get(a))!=null?
768
- b:null}getContextMenuOptions(a,b){const c=[];for(const d of this.registeredItems.values()){if(d.scopeType){if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.BLOCK&&!a.block)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.COMMENT&&!a.comment)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.WORKSPACE&&!a.workspace)continue}let e;e={scope:a,weight:d.weight};if(d.separator)e=Object.assign({},e,{separator:!0});else{const f=
769
- d.preconditionFn(a,b);if(f==="hidden")continue;const g=typeof d.displayText==="function"?d.displayText(a):d.displayText;e=Object.assign({},e,{text:g,callback:d.callback,enabled:f==="enabled"})}c.push(e)}c.sort(function(d,e){return d.weight-e.weight});return c}};
772
+ b:null}getContextMenuOptions(a,b){const c=[];for(const d of this.registeredItems.values()){if(d.scopeType){if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.BLOCK&&!a.block)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.COMMENT&&!a.comment)continue;if(d.scopeType===ScopeType$$module$build$src$core$contextmenu_registry.WORKSPACE&&!a.workspace)continue}let e;e={scope:a,weight:d.weight};let f,g;const h=(g=(f=d).preconditionFn)==null?void 0:g.call(f,
773
+ a,b);if(h!=="hidden"){if(d.separator)e=Object.assign({},e,{separator:!0});else{const k=typeof d.displayText==="function"?d.displayText(a):d.displayText;e=Object.assign({},e,{text:k,callback:d.callback,enabled:h==="enabled"})}c.push(e)}}c.sort(function(d,e){return d.weight-e.weight});return c}};
770
774
  (function(a){var b=a.ScopeType||(a.ScopeType={});b.BLOCK="block";b.WORKSPACE="workspace";b.COMMENT="comment";a.registry=new a})(ContextMenuRegistry$$module$build$src$core$contextmenu_registry||(ContextMenuRegistry$$module$build$src$core$contextmenu_registry={}));var ScopeType$$module$build$src$core$contextmenu_registry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry.ScopeType,module$build$src$core$contextmenu_registry={};
771
775
  module$build$src$core$contextmenu_registry.ContextMenuRegistry=ContextMenuRegistry$$module$build$src$core$contextmenu_registry;module$build$src$core$contextmenu_registry.ScopeType=ScopeType$$module$build$src$core$contextmenu_registry;var BLOCK$$module$build$src$core$layers=50,BUBBLE$$module$build$src$core$layers=100,module$build$src$core$layers={BLOCK:BLOCK$$module$build$src$core$layers,BUBBLE:BUBBLE$$module$build$src$core$layers};var CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy=class{constructor(a){this.comment=a;this.startLoc=null;this.workspace=a.workspace}isMovable(){return this.comment.isOwnMovable()&&!this.comment.isDeadOrDying()&&!this.workspace.isReadOnly()}startDrag(){this.fireDragStartEvent();this.startLoc=this.comment.getRelativeToSurfaceXY();this.workspace.setResizesEnabled(!1);let a;(a=this.workspace.getLayerManager())==null||a.moveToDragLayer(this.comment);this.comment.setDragging(!0)}drag(a){this.comment.moveDuringDrag(a)}endDrag(){this.fireDragEndEvent();
772
776
  this.fireMoveEvent();let a;(a=this.workspace.getLayerManager())==null||a.moveOffDragLayer(this.comment,BLOCK$$module$build$src$core$layers);this.comment.setDragging(!1);this.comment.snapToGrid();this.workspace.setResizesEnabled(!0)}fireDragStartEvent(){const a=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.COMMENT_DRAG))(this.comment,!0);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.COMMENT_DRAG))(this.comment,
@@ -776,11 +780,11 @@ this.getCommentView();var b=a.getRelativeToSurfaceXY();const c=a.getSize();b=new
776
780
  {"class":"blocklyFoldoutIcon",href:`${this.workspace.options.pathToMedia}foldout-icon.svg`,id:`${this.id}${COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button}`},this.container);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("y",`${a}`);this.icon.setAttribute("x",
777
781
  `${a}`)}performAction(a){clearTouchIdentifier$$module$build$src$core$touch();this.getCommentView().bringToFront();a&&a instanceof PointerEvent&&isRightButton$$module$build$src$core$browser_events(a)?a.stopPropagation():(this.getCommentView().setCollapsed(!this.getCommentView().isCollapsed()),this.workspace.hideChaff(),a==null||a.stopPropagation())}},module$build$src$core$comments$collapse_comment_bar_button={COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER:COMMENT_COLLAPSE_BAR_BUTTON_FOCUS_IDENTIFIER$$module$build$src$core$comments$collapse_comment_bar_button};
778
782
  module$build$src$core$comments$collapse_comment_bar_button.CollapseCommentBarButton=CollapseCommentBarButton$$module$build$src$core$comments$collapse_comment_bar_button;var COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor="_comment_textarea_",CommentEditor$$module$build$src$core$comments$comment_editor=class{constructor(a,b,c){this.workspace=a;this.onFinishEditing=c;this.textChangeListeners=[];this.text="";this.foreignObject=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FOREIGNOBJECT,{"class":"blocklyCommentForeignObject"});a=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"body");
779
- a.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);a.className="blocklyMinimalBody";this.textArea=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");this.textArea.setAttribute("tabindex","-1");this.textArea.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyCommentText");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyTextarea");addClass$$module$build$src$core$utils$dom(this.textArea,
780
- "blocklyText");a.appendChild(this.textArea);this.foreignObject.appendChild(a);b&&(this.id=b+COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor,this.textArea.setAttribute("id",this.id));conditionalBind$$module$build$src$core$browser_events(this.textArea,"change",this,this.onTextChange);conditionalBind$$module$build$src$core$browser_events(this.textArea,"pointerdown",this,d=>{d.stopPropagation();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this);clearTouchIdentifier$$module$build$src$core$touch()});
781
- 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===
782
- "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}`);
783
- 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,
783
+ a.setAttribute("xmlns",HTML_NS$$module$build$src$core$utils$dom);a.className="blocklyMinimalBody";this.textArea=document.createElementNS(HTML_NS$$module$build$src$core$utils$dom,"textarea");this.textArea.setAttribute("tabindex","-1");this.textArea.setAttribute("dir",this.workspace.RTL?"RTL":"LTR");this.textArea.setAttribute("placeholder",$.Msg$$module$build$src$core$msg.WORKSPACE_COMMENT_DEFAULT_TEXT);addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyCommentText");addClass$$module$build$src$core$utils$dom(this.textArea,
784
+ "blocklyTextarea");addClass$$module$build$src$core$utils$dom(this.textArea,"blocklyText");a.appendChild(this.textArea);this.foreignObject.appendChild(a);b&&(this.id=b+COMMENT_EDITOR_FOCUS_IDENTIFIER$$module$build$src$core$comments$comment_editor,this.textArea.setAttribute("id",this.id));conditionalBind$$module$build$src$core$browser_events(this.textArea,"change",this,this.onTextChange);conditionalBind$$module$build$src$core$browser_events(this.textArea,"pointerdown",this,d=>{d.stopPropagation();$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this);
785
+ clearTouchIdentifier$$module$build$src$core$touch()});conditionalBind$$module$build$src$core$browser_events(this.textArea,"wheel",this,d=>{d.stopPropagation()},!1,{passive:!0});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>=
786
+ 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,
787
+ 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,
784
788
  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",
785
789
  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",
786
790
  `${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};
@@ -813,17 +817,17 @@ a,d.y+b);this.moveTo(a,c)}moveTo(a,b){super.moveTo(a,b);this.view.moveTo(a)}move
813
817
  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(),
814
818
  "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,
815
819
  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,
816
- ["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={};
820
+ ["snap"])}}}getEditorFocusableNode(){return this.view.getEditorFocusableNode()}getFocusableElement(){return this.getSvgRoot()}getFocusableTree(){return this.workspace}onNodeFocus(){this.select();let a;(a=this.getSvgRoot().parentElement)==null||a.appendChild(this.getSvgRoot());this.workspace.scrollBoundsIntoView(this.getBoundingRectangle())}onNodeBlur(){this.unselect()}canBeFocused(){return!0}},module$build$src$core$comments$rendered_workspace_comment={};
817
821
  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;
818
822
  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;
819
823
  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();
820
824
  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,
821
- 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");
825
+ b,c){b=BlockBase$$module$build$src$core$events$events_block_base.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");
822
826
  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;a<this.ids.length;a++){const c=this.ids[a],d=b.getBlockById(c);d?d.dispose(!1):c===this.blockId&&console.warn("Can't uncreate non-existent block: "+c)}}},allShadowBlocks$$module$build$src$core$events$events_block_create=function(a,b){return b.map(c=>a.getBlockById(c)).filter(c=>c&&c.isShadow()).length===b.length};
823
- 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);
824
- 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");
825
- 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;
826
- 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()&&
827
+ 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=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,
828
+ 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");
829
+ 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=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new ViewportChange$$module$build$src$core$events$events_viewport);
830
+ 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()&&
827
831
  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?
828
832
  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())==
829
833
  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;
@@ -888,7 +892,7 @@ module$build$src$core$bubbles$mini_workspace_bubble.MiniWorkspaceBubble=MiniWork
888
892
  {"class":"blocklyIconGroup",id:this.id});b.getSvgRoot().appendChild(this.svgRoot);this.updateSvgRootOffset();conditionalBind$$module$build$src$core$browser_events(this.svgRoot,"pointerdown",this,a);this.svgRoot.tooltip=this;bindMouseEvents$$module$build$src$core$tooltip(this.svgRoot)}}dispose(){unbindMouseEvents$$module$build$src$core$tooltip(this.svgRoot);removeNode$$module$build$src$core$utils$dom(this.svgRoot)}getWeight(){return-1}getSize(){return new Size$$module$build$src$core$utils$size(0,0)}setTooltip(a){this.tooltip=
889
893
  a!=null?a:this.sourceBlock}getTooltip(){return this.tooltip}applyColour(){}updateEditable(){}updateCollapsed(){this.svgRoot&&(this.sourceBlock.isCollapsed()?this.svgRoot.style.display="none":this.svgRoot.style.display="block",hasBubble$$module$build$src$core$interfaces$i_has_bubble(this)&&this.setBubbleVisible(!1))}hideForInsertionMarker(){this.svgRoot&&(this.svgRoot.style.display="none")}isShownWhenCollapsed(){return!1}setOffsetInBlock(a){this.offsetInBlock=a;this.updateSvgRootOffset()}updateSvgRootOffset(){let a;
890
894
  (a=this.svgRoot)==null||a.setAttribute("transform",`translate(${this.offsetInBlock.x}, ${this.offsetInBlock.y})`)}onLocationChange(a){this.workspaceLocation=Coordinate$$module$build$src$core$utils$coordinate.sum(a,this.offsetInBlock)}onClick(){}isClickableInFlyout(a){return!0}getFocusableElement(){const a=this.svgRoot;if(!a)throw Error("Attempting to focus uninitialized icon.");return a}getFocusableTree(){return this.sourceBlock.workspace}onNodeFocus(){var a=this.sourceBlock.getBoundingRectangle();
891
- a=new Rect$$module$build$src$core$utils$rect(a.top+this.offsetInBlock.y,a.top+this.offsetInBlock.y+this.getSize().height,a.left+this.offsetInBlock.x,a.left+this.offsetInBlock.x+this.getSize().width);this.sourceBlock.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}getSourceBlock(){return this.sourceBlock}},module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
895
+ a=new Rect$$module$build$src$core$utils$rect(a.top+this.offsetInBlock.y,a.top+this.offsetInBlock.y+this.getSize().height,a.left+this.offsetInBlock.x,a.left+this.offsetInBlock.x+this.getSize().width);this.sourceBlock.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}getSourceBlock(){return this.sourceBlock}showContextMenu(a){this.getSourceBlock().showContextMenu(a)}},module$build$src$core$icons$icon={};module$build$src$core$icons$icon.Icon=Icon$$module$build$src$core$icons$icon;var SIZE$$module$build$src$core$icons$mutator_icon,WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon;SIZE$$module$build$src$core$icons$mutator_icon=17;WORKSPACE_MARGIN$$module$build$src$core$icons$mutator_icon=16;
892
896
  $.MutatorIcon$$module$build$src$core$icons$mutator_icon=class extends Icon$$module$build$src$core$icons$icon{constructor(a,b){super(b);this.flyoutBlockTypes=a;this.sourceBlock=b;this.saveConnectionsListener=this.updateWorkspacePid=this.rootBlock=this.miniWorkspaceBubble=null}getType(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE}initView(a){this.svgRoot||(super.initView(a),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.RECT,{"class":"blocklyIconShape",
893
897
  rx:"4",ry:"4",height:"16",width:"16"},this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyIconSymbol",d:"m4.203,7.296 0,1.368 -0.92,0.677 -0.11,0.41 0.9,1.559 0.41,0.11 1.043,-0.457 1.187,0.683 0.127,1.134 0.3,0.3 1.8,0 0.3,-0.299 0.127,-1.138 1.185,-0.682 1.046,0.458 0.409,-0.11 0.9,-1.559 -0.11,-0.41 -0.92,-0.677 0,-1.366 0.92,-0.677 0.11,-0.41 -0.9,-1.559 -0.409,-0.109 -1.046,0.458 -1.185,-0.682 -0.127,-1.138 -0.3,-0.299 -1.8,0 -0.3,0.3 -0.126,1.135 -1.187,0.682 -1.043,-0.457 -0.41,0.11 -0.899,1.559 0.108,0.409z"},
894
898
  this.svgRoot),createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.CIRCLE,{"class":"blocklyIconShape",r:"2.7",cx:"8",cy:"8"},this.svgRoot),addClass$$module$build$src$core$utils$dom(this.svgRoot,"blocklyMutatorIcon"))}dispose(){super.dispose();let a;(a=this.miniWorkspaceBubble)==null||a.dispose()}getWeight(){return $.MutatorIcon$$module$build$src$core$icons$mutator_icon.WEIGHT}getSize(){return new Size$$module$build$src$core$utils$size(SIZE$$module$build$src$core$icons$mutator_icon,
@@ -926,27 +930,27 @@ register$$module$build$src$core$css("\n.blocklyTextInputBubble .blocklyTextarea
926
930
  a)return d;d++}return-1}calculateIndexForYPos(a){if(!this.connections.length)return 0;let b=0,c=this.connections.length;for(;b<c;){const d=Math.floor((b+c)/2);if(this.connections[d].y<a)b=d+1;else if(this.connections[d].y>a)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]);
927
931
  return n<b}const d=this.connections,e=a.x,f=a.y;a=0;let g=d.length-2,h=g;for(;a<h;)d[h].y<f?a=h:g=h,h=Math.floor((a+g)/2);const k=[];g=a=h;if(d.length){for(;a>=0&&c(a);)a--;do g++;while(g<d.length&&c(g))}return k}isInYRange(a,b,c){return Math.abs(this.connections[a].y-b)<=c}searchForClosest(a,b,c){if(!this.connections.length)return{connection:null,radius:b};const d=a.y,e=a.x;a.x=e+c.x;a.y=d+c.y;var f=this.calculateIndexForYPos(a.y);c=null;let g=b,h,k=f-1;for(;k>=0&&this.isInYRange(k,a.y,b);)h=this.connections[k],
928
932
  this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),k--;for(;f<this.connections.length&&this.isInYRange(f,a.y,b);)h=this.connections[f],this.connectionChecker.canConnect(a,h,!0,g)&&(c=h,g=h.distanceFrom(a)),f++;a.x=e;a.y=d;return{connection:c,radius:g}}static init(a){const b=[];b[ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE]=new ConnectionDB$$module$build$src$core$connection_db(a);b[ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE]=new ConnectionDB$$module$build$src$core$connection_db(a);
929
- b[ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT]=new ConnectionDB$$module$build$src$core$connection_db(a);b[ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT]=new ConnectionDB$$module$build$src$core$connection_db(a);return b}},module$build$src$core$connection_db={};module$build$src$core$connection_db.ConnectionDB=ConnectionDB$$module$build$src$core$connection_db;var Selected$$module$build$src$core$events$events_selected=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(c);this.type=EventType$$module$build$src$core$events$type.SELECTED;this.oldElementId=a!=null?a:void 0;this.newElementId=b!=null?b:void 0}toJson(){const a=super.toJson();a.oldElementId=this.oldElementId;a.newElementId=this.newElementId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new Selected$$module$build$src$core$events$events_selected);
933
+ b[ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT]=new ConnectionDB$$module$build$src$core$connection_db(a);b[ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT]=new ConnectionDB$$module$build$src$core$connection_db(a);return b}},module$build$src$core$connection_db={};module$build$src$core$connection_db.ConnectionDB=ConnectionDB$$module$build$src$core$connection_db;var Selected$$module$build$src$core$events$events_selected=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(c);this.type=EventType$$module$build$src$core$events$type.SELECTED;this.oldElementId=a!=null?a:void 0;this.newElementId=b!=null?b:void 0}toJson(){const a=super.toJson();a.oldElementId=this.oldElementId;a.newElementId=this.newElementId;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new Selected$$module$build$src$core$events$events_selected);
930
934
  b.oldElementId=a.oldElementId;b.newElementId=a.newElementId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.SELECTED,Selected$$module$build$src$core$events$events_selected);var module$build$src$core$events$events_selected={};module$build$src$core$events$events_selected.Selected=Selected$$module$build$src$core$events$events_selected;var BlockDelete$$module$build$src$core$events$events_block_delete=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_DELETE;if(a){if(a.getParent())throw Error("Connected blocks cannot be deleted.");a.isShadow()&&(this.recordUndo=!1);this.oldXml=blockToDomWithXY$$module$build$src$core$xml(a);this.ids=getDescendantIds$$module$build$src$core$events$utils(a);this.wasShadow=a.isShadow();this.oldJson=
931
935
  save$$module$build$src$core$serialization$blocks(a,{addCoordinates:!0})}}toJson(){const a=super.toJson();if(!this.oldXml)throw Error("The old 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.wasShadow===void 0)throw Error("Whether the block was a shadow is undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");
932
- a.oldXml=domToText$$module$build$src$core$xml(this.oldXml);a.ids=this.ids;a.wasShadow=this.wasShadow;a.oldJson=this.oldJson;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BlockDelete$$module$build$src$core$events$events_block_delete);b.oldXml=$.textToDom$$module$build$src$core$utils$xml(a.oldXml);b.ids=a.ids;b.wasShadow=a.wasShadow||b.oldXml.tagName.toLowerCase()==="shadow";b.oldJson=a.oldJson;a.recordUndo!==void 0&&(b.recordUndo=
933
- a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(a)for(a=0;a<this.ids.length;a++){const c=this.ids[a],d=b.getBlockById(c);d?d.dispose(!1):c===this.blockId&&console.warn("Can't delete non-existent block: "+c)}else append$$module$build$src$core$serialization$blocks(this.oldJson,
934
- b)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_DELETE,BlockDelete$$module$build$src$core$events$events_block_delete);var module$build$src$core$events$events_block_delete={};module$build$src$core$events$events_block_delete.BlockDelete=BlockDelete$$module$build$src$core$events$events_block_delete;var Connection$$module$build$src$core$connection=class{constructor(a,b){this.type=b;this.targetConnection=null;this.disposed=!1;this.shadowDom=this.check=null;this.y=this.x=0;this.shadowState=null;this.sourceBlock_=a;if(a.id.includes("_connection"))throw Error("Connection ID indicator is contained in block ID. This will cause "+`problems with focus: ${a.id}.`);this.id=`${a.id}_connection_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`}connect_(a){const b=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,
936
+ a.oldXml=domToText$$module$build$src$core$xml(this.oldXml);a.ids=this.ids;a.wasShadow=this.wasShadow;a.oldJson=this.oldJson;this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,b,c){b=BlockBase$$module$build$src$core$events$events_block_base.fromJson(a,b,c!=null?c:new BlockDelete$$module$build$src$core$events$events_block_delete);b.oldXml=$.textToDom$$module$build$src$core$utils$xml(a.oldXml);b.ids=a.ids;b.wasShadow=a.wasShadow||b.oldXml.tagName.toLowerCase()==="shadow";b.oldJson=
937
+ a.oldJson;a.recordUndo!==void 0&&(b.recordUndo=a.recordUndo);return b}run(a){const b=this.getEventWorkspace_();if(!this.ids)throw Error("The block IDs are undefined. Either pass a block to the constructor, or call fromJson");if(!this.oldJson)throw Error("The old block JSON is undefined. Either pass a block to the constructor, or call fromJson");if(a)for(a=0;a<this.ids.length;a++){const c=this.ids[a],d=b.getBlockById(c);d?d.dispose(!1):c===this.blockId&&console.warn("Can't delete non-existent block: "+
938
+ c)}else append$$module$build$src$core$serialization$blocks(this.oldJson,b)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_DELETE,BlockDelete$$module$build$src$core$events$events_block_delete);var module$build$src$core$events$events_block_delete={};module$build$src$core$events$events_block_delete.BlockDelete=BlockDelete$$module$build$src$core$events$events_block_delete;var Connection$$module$build$src$core$connection=class{constructor(a,b){this.type=b;this.targetConnection=null;this.disposed=!1;this.shadowDom=this.check=null;this.y=this.x=0;this.shadowState=null;this.sourceBlock_=a;if(a.id.includes("_connection"))throw Error("Connection ID indicator is contained in block ID. This will cause "+`problems with focus: ${a.id}.`);this.id=`${a.id}_connection_${getNextUniqueId$$module$build$src$core$utils$idgenerator()}`}connect_(a){const b=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE,
935
939
  c=this.getSourceBlock();var d=a.getSourceBlock();a.isConnected()&&a.disconnectInternal(!1);let e;if(this.isConnected()){const g=this.stashShadowState(),h=this.targetBlock();h.isShadow()?h.dispose(!1):(this.disconnectInternal(),e=h);this.applyShadowState(g)}let f;isEnabled$$module$build$src$core$events$utils()&&(f=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(d),f.setReason(["connect"]));connectReciprocally$$module$build$src$core$connection(this,
936
940
  a);d.setParent(c);f&&(f.recordNew(),fire$$module$build$src$core$events$utils(f));if(e&&(a=this.type===b?e.outputConnection:e.previousConnection))if(d=Connection$$module$build$src$core$connection.getConnectionForOrphanedConnection(d,a))a.connect(d);else a.onFailedConnect(this)}dispose(){if(this.isConnected()){this.isSuperior()&&this.setShadowStateInternal();const a=this.targetBlock();a&&!a.isDeadOrDying()&&a.unplug()}this.disposed=!0}getSourceBlock(){return this.sourceBlock_}isSuperior(){return this.type===
937
941
  ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE||this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT}isConnected(){return!!this.targetConnection}getConnectionChecker(){return this.sourceBlock_.workspace.connectionChecker}onFailedConnect(a){}connect(a){if(this.targetConnection===a)return!0;if(this.getConnectionChecker().canConnect(this,a,!1)){const b=$.getGroup$$module$build$src$core$events$utils();b||$.setGroup$$module$build$src$core$events$utils(!0);
938
- this.isSuperior()?this.connect_(a):a.connect_(this);$.setGroup$$module$build$src$core$events$utils(b)}return this.isConnected()}disconnect(){this.disconnectInternal()}disconnectInternal(a=!0){const {parentConnection:b,childConnection:c}=this.getParentAndChildConnections();if(!b||!c)throw Error("Source connection not connected.");const d=$.getGroup$$module$build$src$core$events$utils();d||$.setGroup$$module$build$src$core$events$utils(!0);let e;isEnabled$$module$build$src$core$events$utils()&&(e=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(c.getSourceBlock()),
939
- e.setReason(["disconnect"]));const f=this.targetConnection;f&&(f.targetConnection=null);this.targetConnection=null;a&&c.getSourceBlock().setParent(null);e&&(e.recordNew(),fire$$module$build$src$core$events$utils(e));c.getSourceBlock().isShadow()||b.respawnShadow_();$.setGroup$$module$build$src$core$events$utils(d)}getParentAndChildConnections(){return this.targetConnection?this.isSuperior()?{parentConnection:this,childConnection:this.targetConnection}:{parentConnection:this.targetConnection,childConnection:this}:
940
- {}}respawnShadow_(){this.createShadowBlock(!0)}reconnect(a,b){if(this.getSourceBlock().isDeadOrDying())return!1;var c;b=(c=a.getInput(b))==null?void 0:c.connection;c=this.targetBlock();return c&&c!==a||!b||b.targetConnection===this?!1:(b.isConnected()&&b.disconnect(),b.connect(this),!0)}targetBlock(){if(this.isConnected()){let a,b;return(b=(a=this.targetConnection)==null?void 0:a.getSourceBlock())!=null?b:null}return null}onCheckChanged_(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,
941
- this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(a){a?(Array.isArray(a)||(a=[a]),this.check=a,this.onCheckChanged_()):this.check=null;return this}getCheck(){return this.check}setShadowDom(a){this.setShadowStateInternal({shadowDom:a})}getShadowDom(a){return a&&this.targetBlock().isShadow()?blockToDom$$module$build$src$core$xml(this.targetBlock()):this.shadowDom}setShadowState(a){this.setShadowStateInternal({shadowState:a})}getShadowState(a){return a&&
942
- this.targetBlock()&&this.targetBlock().isShadow()?save$$module$build$src$core$serialization$blocks(this.targetBlock()):this.shadowState}neighbours(a){return[]}getParentInput(){let a=null;const b=this.sourceBlock_.inputList;for(let c=0;c<b.length;c++)if(b[c].connection===this){a=b[c];break}return a}toString(){const a=this.sourceBlock_;if(!a)return"Orphan Connection";if(a.outputConnection===this)var b="Output Connection of ";else if(a.previousConnection===this)b="Previous Connection of ";else if(a.nextConnection===
943
- this)b="Next Connection of ";else{b=null;for(let c=0,d;d=a.inputList[c];c++)if(d.connection===this){b=d;break}if(b)b='Input "'+b.name+'" connection on ';else return console.warn("Connection not actually connected to sourceBlock_"),"Orphan Connection"}return b+a.toDevString()}stashShadowState(){const a=this.getShadowDom(!0),b=this.getShadowState(!0);this.shadowState=this.shadowDom=null;return{shadowDom:a,shadowState:b}}applyShadowState({shadowDom:a,shadowState:b}){this.shadowDom=a;this.shadowState=
944
- b}setShadowStateInternal({shadowDom:a=null,shadowState:b=null}={}){this.shadowDom=a;this.shadowState=b;this.getSourceBlock().isDeadOrDying()||((a=this.targetBlock())?a.isShadow()?(a.dispose(!1),this.respawnShadow_(),this.targetBlock()&&this.targetBlock().isShadow()&&this.serializeShadow(this.targetBlock())):(a=this.createShadowBlock(!1),this.serializeShadow(a),a&&a.dispose(!1)):(this.respawnShadow_(),this.targetBlock()&&this.targetBlock().isShadow()&&this.serializeShadow(this.targetBlock())))}createShadowBlock(a){var b=
945
- this.getSourceBlock();const c=this.getShadowState(),d=this.getShadowDom();if(b.isDeadOrDying()||!c&&!d)return null;if(c)return b=appendInternal$$module$build$src$core$serialization$blocks(c,b.workspace,{parentConnection:a?this:void 0,isShadow:!0,recordUndo:!1});if(d){b=domToBlockInternal$$module$build$src$core$xml(d,b.workspace);if(a)if(this.type===ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){if(!b.outputConnection)throw Error("Shadow block is missing an output connection");
946
- if(!this.connect(b.outputConnection))throw Error("Could not connect shadow block to connection");}else if(this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){if(!b.previousConnection)throw Error("Shadow block is missing previous connection");if(!this.connect(b.previousConnection))throw Error("Could not connect shadow block to connection");}else throw Error("Cannot connect a shadow block to a previous/output connection");return b}return null}serializeShadow(a){a&&(this.shadowDom=
947
- blockToDom$$module$build$src$core$xml(a),this.shadowState=save$$module$build$src$core$serialization$blocks(a))}static getConnectionForOrphanedConnection(a,b){if(b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return getConnectionForOrphanedOutput$$module$build$src$core$connection(a,b.getSourceBlock());a=a.lastConnectionInStack(!0);const c=b.getConnectionChecker();return a&&c.canConnect(b,a,!1)?a:null}};Connection$$module$build$src$core$connection.CAN_CONNECT=0;
948
- Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION=1;Connection$$module$build$src$core$connection.REASON_WRONG_TYPE=2;Connection$$module$build$src$core$connection.REASON_TARGET_NULL=3;Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED=4;Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES=5;Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT=6;Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED=7;
949
- Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT=8;var module$build$src$core$connection={};module$build$src$core$connection.Connection=Connection$$module$build$src$core$connection;var DuplicateIconType$$module$build$src$core$icons$exceptions=class extends Error{constructor(a){super(`Tried to append an icon of type ${a.getType()} when an icon of `+"that type already exists on the block. Use getIcon to access the existing icon.");this.icon=a}},module$build$src$core$icons$exceptions={};module$build$src$core$icons$exceptions.DuplicateIconType=DuplicateIconType$$module$build$src$core$icons$exceptions;(function(a){a[a.LEFT=-1]="LEFT";a[a.CENTRE=0]="CENTRE";a[a.RIGHT=1]="RIGHT"})($.Align$$module$build$src$core$inputs$align||($.Align$$module$build$src$core$inputs$align={}));var module$build$src$core$inputs$align={};module$build$src$core$inputs$align.Align=$.Align$$module$build$src$core$inputs$align;var FieldLabel$$module$build$src$core$field_label=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.class=null;this.EDITABLE=!1;this.maxDisplayLength=Infinity;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c?this.configure_(c):this.class=b||null,this.setValue(a))}configure_(a){super.configure_(a);a.class&&(this.class=a.class)}initView(){this.createTextElement_();this.class&&addClass$$module$build$src$core$utils$dom(this.getTextElement(),
942
+ this.isSuperior()?this.connect_(a):a.connect_(this);$.setGroup$$module$build$src$core$events$utils(b)}return this.isConnected()}disconnect(){this.disconnectInternal()}disconnectInternal(a=!0){const {parentConnection:b,childConnection:c}=this.getParentAndChildConnections();if(!b||!c)throw Error("Source connection not connected.");const d=$.getGroup$$module$build$src$core$events$utils();d||$.setGroup$$module$build$src$core$events$utils(!0);let e;isEnabled$$module$build$src$core$events$utils()&&!c.getSourceBlock().isDeadOrDying()&&
943
+ (e=new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_MOVE))(c.getSourceBlock()),e.setReason(["disconnect"]));const f=this.targetConnection;f&&(f.targetConnection=null);this.targetConnection=null;a&&c.getSourceBlock().setParent(null);e&&(e.recordNew(),fire$$module$build$src$core$events$utils(e));c.getSourceBlock().isShadow()||b.respawnShadow_();$.setGroup$$module$build$src$core$events$utils(d)}getParentAndChildConnections(){return this.targetConnection?
944
+ this.isSuperior()?{parentConnection:this,childConnection:this.targetConnection}:{parentConnection:this.targetConnection,childConnection:this}:{}}respawnShadow_(){this.createShadowBlock(!0)}reconnect(a,b){if(this.getSourceBlock().isDeadOrDying())return!1;var c;b=(c=a.getInput(b))==null?void 0:c.connection;c=this.targetBlock();return c&&c!==a||!b||b.targetConnection===this?!1:(b.isConnected()&&b.disconnect(),b.connect(this),!0)}targetBlock(){if(this.isConnected()){let a,b;return(b=(a=this.targetConnection)==
945
+ null?void 0:a.getSourceBlock())!=null?b:null}return null}onCheckChanged_(){!this.isConnected()||this.targetConnection&&this.getConnectionChecker().canConnect(this,this.targetConnection,!1)||(this.isSuperior()?this.targetBlock():this.sourceBlock_).unplug()}setCheck(a){a?(Array.isArray(a)||(a=[a]),this.check=a,this.onCheckChanged_()):this.check=null;return this}getCheck(){return this.check}setShadowDom(a){this.setShadowStateInternal({shadowDom:a})}getShadowDom(a){return a&&this.targetBlock().isShadow()?
946
+ blockToDom$$module$build$src$core$xml(this.targetBlock()):this.shadowDom}setShadowState(a){this.setShadowStateInternal({shadowState:a})}getShadowState(a){return a&&this.targetBlock()&&this.targetBlock().isShadow()?save$$module$build$src$core$serialization$blocks(this.targetBlock()):this.shadowState}neighbours(a){return[]}getParentInput(){let a=null;const b=this.sourceBlock_.inputList;for(let c=0;c<b.length;c++)if(b[c].connection===this){a=b[c];break}return a}toString(){const a=this.sourceBlock_;if(!a)return"Orphan Connection";
947
+ if(a.outputConnection===this)var b="Output Connection of ";else if(a.previousConnection===this)b="Previous Connection of ";else if(a.nextConnection===this)b="Next Connection of ";else{b=null;for(let c=0,d;d=a.inputList[c];c++)if(d.connection===this){b=d;break}if(b)b='Input "'+b.name+'" connection on ';else return console.warn("Connection not actually connected to sourceBlock_"),"Orphan Connection"}return b+a.toDevString()}stashShadowState(){const a=this.getShadowDom(!0),b=this.getShadowState(!0);
948
+ this.shadowState=this.shadowDom=null;return{shadowDom:a,shadowState:b}}applyShadowState({shadowDom:a,shadowState:b}){this.shadowDom=a;this.shadowState=b}setShadowStateInternal({shadowDom:a=null,shadowState:b=null}={}){this.shadowDom=a;this.shadowState=b;this.getSourceBlock().isDeadOrDying()||((a=this.targetBlock())?a.isShadow()?(a.dispose(!1),this.respawnShadow_(),this.targetBlock()&&this.targetBlock().isShadow()&&this.serializeShadow(this.targetBlock())):(a=this.createShadowBlock(!1),this.serializeShadow(a),
949
+ a&&a.dispose(!1)):(this.respawnShadow_(),this.targetBlock()&&this.targetBlock().isShadow()&&this.serializeShadow(this.targetBlock())))}createShadowBlock(a){var b=this.getSourceBlock();const c=this.getShadowState(),d=this.getShadowDom();if(b.isDeadOrDying()||!c&&!d)return null;if(c)return b=appendInternal$$module$build$src$core$serialization$blocks(c,b.workspace,{parentConnection:a?this:void 0,isShadow:!0,recordUndo:!1});if(d){b=domToBlockInternal$$module$build$src$core$xml(d,b.workspace);if(a)if(this.type===
950
+ ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE){if(!b.outputConnection)throw Error("Shadow block is missing an output connection");if(!this.connect(b.outputConnection))throw Error("Could not connect shadow block to connection");}else if(this.type===ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT){if(!b.previousConnection)throw Error("Shadow block is missing previous connection");if(!this.connect(b.previousConnection))throw Error("Could not connect shadow block to connection");
951
+ }else throw Error("Cannot connect a shadow block to a previous/output connection");return b}return null}serializeShadow(a){a&&(this.shadowDom=blockToDom$$module$build$src$core$xml(a),this.shadowState=save$$module$build$src$core$serialization$blocks(a))}static getConnectionForOrphanedConnection(a,b){if(b.type===ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)return getConnectionForOrphanedOutput$$module$build$src$core$connection(a,b.getSourceBlock());a=a.lastConnectionInStack(!0);
952
+ const c=b.getConnectionChecker();return a&&c.canConnect(b,a,!1)?a:null}};Connection$$module$build$src$core$connection.CAN_CONNECT=0;Connection$$module$build$src$core$connection.REASON_SELF_CONNECTION=1;Connection$$module$build$src$core$connection.REASON_WRONG_TYPE=2;Connection$$module$build$src$core$connection.REASON_TARGET_NULL=3;Connection$$module$build$src$core$connection.REASON_CHECKS_FAILED=4;Connection$$module$build$src$core$connection.REASON_DIFFERENT_WORKSPACES=5;
953
+ Connection$$module$build$src$core$connection.REASON_SHADOW_PARENT=6;Connection$$module$build$src$core$connection.REASON_DRAG_CHECKS_FAILED=7;Connection$$module$build$src$core$connection.REASON_PREVIOUS_AND_OUTPUT=8;var module$build$src$core$connection={};module$build$src$core$connection.Connection=Connection$$module$build$src$core$connection;var DuplicateIconType$$module$build$src$core$icons$exceptions=class extends Error{constructor(a){super(`Tried to append an icon of type ${a.getType()} when an icon of `+"that type already exists on the block. Use getIcon to access the existing icon.");this.icon=a}},module$build$src$core$icons$exceptions={};module$build$src$core$icons$exceptions.DuplicateIconType=DuplicateIconType$$module$build$src$core$icons$exceptions;(function(a){a[a.LEFT=-1]="LEFT";a[a.CENTRE=0]="CENTRE";a[a.RIGHT=1]="RIGHT"})($.Align$$module$build$src$core$inputs$align||($.Align$$module$build$src$core$inputs$align={}));var module$build$src$core$inputs$align={};module$build$src$core$inputs$align.Align=$.Align$$module$build$src$core$inputs$align;var FieldLabel$$module$build$src$core$field_label=class extends Field$$module$build$src$core$field{constructor(a,b,c){super(Field$$module$build$src$core$field.SKIP_SETUP);this.class=null;this.EDITABLE=!1;this.maxDisplayLength=Infinity;a!==Field$$module$build$src$core$field.SKIP_SETUP&&(c?this.configure_(c):this.class=b||null,this.setValue(a))}configure_(a){super.configure_(a);a.class&&(this.class=a.class)}initView(){this.createTextElement_();this.class&&addClass$$module$build$src$core$utils$dom(this.getTextElement(),
950
954
  this.class);this.fieldGroup_&&addClass$$module$build$src$core$utils$dom(this.fieldGroup_,"blocklyLabelField")}doClassValidation_(a){return a===null||a===void 0?null:`${a}`}setClass(a){this.textElement_&&(this.class&&removeClass$$module$build$src$core$utils$dom(this.textElement_,this.class),a&&addClass$$module$build$src$core$utils$dom(this.textElement_,a));this.class=a}static fromJson(a){return new this(replaceMessageReferences$$module$build$src$core$utils$parsing(a.text),void 0,a)}};
951
955
  register$$module$build$src$core$field_registry("field_label",FieldLabel$$module$build$src$core$field_label);FieldLabel$$module$build$src$core$field_label.prototype.DEFAULT_VALUE="";var module$build$src$core$field_label={};module$build$src$core$field_label.FieldLabel=FieldLabel$$module$build$src$core$field_label;var COLLAPSE_CHARS$$module$build$src$core$internal_constants=30,OPPOSITE_TYPE$$module$build$src$core$internal_constants=[];OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE]=ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE;OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE]=ConnectionType$$module$build$src$core$connection_type.INPUT_VALUE;
952
956
  OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT]=ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT;OPPOSITE_TYPE$$module$build$src$core$internal_constants[ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT]=ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT;
@@ -986,7 +990,7 @@ if(!c&&a)throw Error("Block not connected to new parent.");if(c&&!a)throw Error(
986
990
  a}isInsertionMarker(){return this.isInsertionMarker_}setInsertionMarker(a){this.isInsertionMarker_=a}isEditable(){return this.editable&&!this.isDeadOrDying()&&!this.workspace.isReadOnly()}isOwnEditable(){return this.editable}setEditable(a){this.editable=a;for(const b of this.getFields())b.updateEditable()}isDisposed(){return this.disposed}isSimpleReporter(){if(!this.outputConnection)return!1;for(const a of this.inputList)if(a.connection||a.fieldRow.length>1)return!1;return!0}getMatchingConnection(a,
987
991
  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<a.length;d++)if(a[d]===b)return c[d];return null}setHelpUrl(a){this.helpUrl=a}setTooltip(a){this.tooltip=a}getTooltip(){return getTooltipOfObject$$module$build$src$core$tooltip(this)}getColour(){return this.colour_}getStyleName(){return this.styleName_}getHue(){return this.hue}setColour(a){a=parseBlockColour$$module$build$src$core$utils$parsing(a);
988
992
  this.hue=a.hue;this.colour_=a.hex}setStyle(a){this.styleName_=a}setOnChange(a){if(a&&typeof a!=="function")throw Error("onchange must be a function.");this.onchangeWrapper&&this.workspace.removeChangeListener(this.onchangeWrapper);this.onchange=a;this.onchangeWrapper=a.bind(this);this.workspace.addChangeListener(this.onchangeWrapper)}getField(a){if(typeof a!=="string")throw TypeError("Block.prototype.getField expects a string with the field name but received "+(a===void 0?"nothing":a+" of type "+
989
- typeof a)+" instead");for(const b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(const a of this.inputList)for(const b of a.fieldRow)yield b}getVars(){const a=[];for(const b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){const a=[];for(const b of this.getFields())if(b.referencesVariables()){const c=this.workspace.getVariableById(b.getValue());c&&a.push(c)}return a}updateVarName(a){for(const b of this.getFields())b.referencesVariables()&&
993
+ typeof a)+" instead");for(const b of this.getFields())if(b.name===a)return b;return null}*getFields(){for(const a of this.inputList)for(const b of a.fieldRow)yield b}getVars(){const a=[];for(const b of this.getFields())b.referencesVariables()&&a.push(b.getValue());return a}getVarModels(){const a=[];for(const b of this.getFields())if(b.referencesVariables()){const c=this.workspace.getVariableMap().getVariableById(b.getValue());c&&a.push(c)}return a}updateVarName(a){for(const b of this.getFields())b.referencesVariables()&&
990
994
  a.getId()===b.getValue()&&b.refreshVariableName()}renameVarById(a,b){for(const c of this.getFields())c.referencesVariables()&&a===c.getValue()&&c.setValue(b)}getFieldValue(a){return(a=this.getField(a))?a.getValue():null}setFieldValue(a,b){const c=this.getField(b);if(!c)throw Error('Field "'+b+'" not found.');c.setValue(a)}setPreviousStatement(a,b){if(a)b===void 0&&(b=null),this.previousConnection||(this.previousConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT)),
991
995
  this.previousConnection.setCheck(b);else if(this.previousConnection){if(this.previousConnection.isConnected())throw Error("Must disconnect previous statement before removing connection.");this.previousConnection.dispose();this.previousConnection=null}}setNextStatement(a,b){if(a)b===void 0&&(b=null),this.nextConnection||(this.nextConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.NEXT_STATEMENT)),this.nextConnection.setCheck(b);else if(this.nextConnection){if(this.nextConnection.isConnected())throw Error("Must disconnect next statement before removing connection.");
992
996
  this.nextConnection.dispose();this.nextConnection=null}}setOutput(a,b){if(a)b===void 0&&(b=null),this.outputConnection||(this.outputConnection=this.makeConnection_(ConnectionType$$module$build$src$core$connection_type.OUTPUT_VALUE)),this.outputConnection.setCheck(b);else if(this.outputConnection){if(this.outputConnection.isConnected())throw Error("Must disconnect output value before removing connection.");this.outputConnection.dispose();this.outputConnection=null}}setInputsInline(a){this.inputsInline!==
@@ -1018,19 +1022,20 @@ module$build$src$core$block_animations.disposeUiEffect=disposeUiEffect$$module$b
1018
1022
  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";
1019
1023
  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()&&
1020
1024
  !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();
1021
- 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.");
1022
- 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=
1023
- (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,
1024
- !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),
1025
- 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()&&
1026
- !((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?
1027
- 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);
1028
- 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())==
1029
- 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?
1025
+ 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);this.getVisibleBubbles(this.block).forEach(c=>{let d;(d=this.workspace.getLayerManager())==null||d.moveToDragLayer(c,!1)})}}getVisibleBubbles(a){return a.getDescendants(!1).flatMap(b=>b.getIcons()).filter(b=>hasBubble$$module$build$src$core$interfaces$i_has_bubble(b)&&
1026
+ b.bubbleIsVisible()).map(b=>b.getBubble()).filter(b=>!!b).sort((b,c)=>{b=b.getSvgRoot().compareDocumentPosition(c.getSvgRoot());return b&Node.DOCUMENT_POSITION_PRECEDING?1:b&Node.DOCUMENT_POSITION_FOLLOWING?-1:0})}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(),
1027
+ 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=
1028
+ 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);
1029
+ 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,
1030
+ 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;
1031
+ (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,
1032
+ 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?
1033
+ $.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();
1034
+ 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.getVisibleBubbles(this.block).forEach(d=>{let e;return(e=this.workspace.getLayerManager())==null?void 0:e.moveOffDragLayer(d,BUBBLE$$module$build$src$core$layers,!1)});this.block.setDragging(!1)}this.connectionCandidate?
1030
1035
  (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=
1031
1036
  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);
1032
- 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);
1033
- 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,
1037
+ 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);this.getVisibleBubbles(this.block).forEach(d=>{let e;return(e=this.workspace.getLayerManager())==null?void 0:e.moveOffDragLayer(d,BUBBLE$$module$build$src$core$layers,!1)});bumpObjectIntoBounds$$module$build$src$core$bump_objects(this.workspace,
1038
+ 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,
1034
1039
  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?
1035
1040
  "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=
1036
1041
  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"},
@@ -1047,12 +1052,12 @@ e==null?void 0:e.getFocusableElement())!=null?f:null);a?(a.getSvgRoot().appendCh
1047
1052
  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),
1048
1053
  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",
1049
1054
  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,
1050
- 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);
1051
- 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()&&
1052
- 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,
1053
- 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&&
1054
- 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?
1055
- 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,
1055
+ 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(){var a=this.getNextBlock();a=
1056
+ a?new Set(a.getDescendants(!1)):null;const b=this.getDescendants(!1);for(const c of b){if(c===this)continue;let d;if(((d=a)==null||!d.has(c))&&c.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE))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();
1057
+ 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),
1058
+ 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,
1059
+ 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();
1060
+ 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,
1056
1061
  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)),
1057
1062
  this.addClass("blocklyDragging")):(draggingConnections$$module$build$src$core$common.length=0,this.removeClass("blocklyDragging"));for(let b=0;b<this.childBlocks_.length;b++)this.childBlocks_[b].setDragging(a)}setMovable(a){super.setMovable(a);this.pathObject.updateMovable(a)}setEditable(a){super.setEditable(a);a?removeClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable"):addClass$$module$build$src$core$utils$dom(this.svgGroup,"blocklyNotEditable");a=this.getIcons();for(let b=
1058
1063
  0;b<a.length;b++)a[b].updateEditable()}setShadow(a){super.setShadow(a);this.applyColour()}setInsertionMarker(a){this.isInsertionMarker_!==a&&(this.isInsertionMarker_=a)&&(this.setColour(this.workspace.getRenderer().getConstants().INSERTION_MARKER_COLOUR),this.pathObject.updateInsertionMarker(!0))}getSvgRoot(){return this.svgGroup}dispose(a,b){this.disposing=!0;dispose$$module$build$src$core$tooltip();hide$$module$build$src$core$contextmenu();const c=$.getFocusManager$$module$build$src$core$focus_manager();
@@ -1062,8 +1067,8 @@ this.dispose(!1,!0):this.dispose(!0,!0),$.setGroup$$module$build$src$core$events
1062
1067
  0;b<a.length;b++)a[b].applyColour();for(const c of this.getFields())c.applyColour()}updateDisabled(){const a=!this.isEnabled()||this.getInheritedDisabled();if(this.visuallyDisabled===a){let b;(b=this.getNextBlock())==null||b.updateDisabled()}else{this.applyColour();this.visuallyDisabled=a;for(const b of this.getChildren(!1))b.updateDisabled()}}setWarningText(a,b=""){if(b)this.warningTextDb.has(b)&&(clearTimeout(this.warningTextDb.get(b)),this.warningTextDb.delete(b));else{for(var c of this.warningTextDb.values())clearTimeout(c);
1063
1068
  this.warningTextDb.clear()}if(this.workspace.isDragging())this.warningTextDb.set(b,setTimeout(()=>{this.isDeadOrDying()||(this.warningTextDb.delete(b),this.setWarningText(a,b))},100));else if(this.isInFlyout&&(a=null),c=this.getIcon(WarningIcon$$module$build$src$core$icons$warning_icon.TYPE),a){let d=this.getSurroundParent(),e=null;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);
1064
1069
  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&&
1065
- (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()===
1066
- 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);
1070
+ (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))&&(this.bringToFront(),b.setStartIcon(a),$.getFocusManager$$module$build$src$core$focus_manager().focusNode(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,
1071
+ 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);
1067
1072
  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=
1068
1073
  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,
1069
1074
  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&&
@@ -1092,7 +1097,7 @@ d,f,g);this.height=this.height||c.height;if(!this.isFlyoutLabel){this.width+=2*F
1092
1097
  ")")}moveTo(a,b){this.position.x=a;this.position.y=b;this.updateTransform()}moveBy(a,b,c){this.moveTo(this.position.x+a,this.position.y+b)}isLabel(){return this.isFlyoutLabel}getPosition(){return this.position}getBoundingRectangle(){return new Rect$$module$build$src$core$utils$rect(this.position.y,this.position.y+this.height,this.position.x,this.position.x+this.width)}getButtonText(){return this.text}getTargetWorkspace(){return this.targetWorkspace}getWorkspace(){return this.workspace}dispose(){unbind$$module$build$src$core$browser_events(this.onMouseDownWrapper);
1093
1098
  unbind$$module$build$src$core$browser_events(this.onMouseUpWrapper);this.svgGroup&&removeNode$$module$build$src$core$utils$dom(this.svgGroup);this.svgText&&this.workspace.getThemeManager().unsubscribe(this.svgText)}setCursorSvg(a){a?this.svgGroup&&(this.svgGroup.appendChild(a),this.cursorSvg=a):this.cursorSvg=null}onMouseUp(a){(a=this.targetWorkspace.getGesture(a))&&a.cancel();this.isFlyoutLabel&&this.callbackKey?console.warn("Labels should not have callbacks. Label text: "+this.text):this.isFlyoutLabel||
1094
1099
  this.callbackKey&&this.targetWorkspace.getButtonCallback(this.callbackKey)?this.isFlyoutLabel||(a=this.targetWorkspace.getButtonCallback(this.callbackKey))&&a(this):console.warn("Buttons should have callbacks. Button text: "+this.text)}onMouseDown(a){const b=this.targetWorkspace.getGesture(a),c=this.targetWorkspace.getFlyout();b&&c&&b.handleFlyoutStart(a,c)}getSvgRoot(){return this.svgGroup}getFocusableElement(){return this.svgGroup}getFocusableTree(){return this.workspace}onNodeFocus(){var a=this.getPosition();
1095
- a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.height,a.x,a.x+this.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}};FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X=5;FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y=2;FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS=4;register$$module$build$src$core$css("\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n.blocklyFlyoutButton:hover {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n");
1100
+ a=new Rect$$module$build$src$core$utils$rect(a.y,a.y+this.height,a.x,a.x+this.width);this.workspace.scrollBoundsIntoView(a)}onNodeBlur(){}canBeFocused(){return!0}};FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_X=5;FlyoutButton$$module$build$src$core$flyout_button.TEXT_MARGIN_Y=2;FlyoutButton$$module$build$src$core$flyout_button.BORDER_RADIUS=4;register$$module$build$src$core$css("\n.blocklyFlyoutButton {\n fill: #888;\n cursor: default;\n}\n\n.blocklyFlyoutButtonShadow {\n fill: #666;\n}\n\n@media (hover: hover) {\n .blocklyFlyoutButton:hover {\n fill: #aaa;\n }\n}\n\n.blocklyFlyoutButton:active {\n fill: #aaa;\n}\n\n.blocklyFlyoutLabel {\n cursor: default;\n}\n\n.blocklyFlyoutLabelBackground {\n opacity: 0;\n}\n");
1096
1101
  var module$build$src$core$flyout_button={};module$build$src$core$flyout_button.FlyoutButton=FlyoutButton$$module$build$src$core$flyout_button;var FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy=class{getFirstChild(a){return null}getParent(a){return a.getWorkspace()}getNextSibling(a){return null}getPreviousSibling(a){return null}isNavigable(a){return a.canBeFocused()}isApplicable(a){return a instanceof FlyoutButton$$module$build$src$core$flyout_button}},module$build$src$core$keyboard_nav$flyout_button_navigation_policy={};
1097
1102
  module$build$src$core$keyboard_nav$flyout_button_navigation_policy.FlyoutButtonNavigationPolicy=FlyoutButtonNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_button_navigation_policy;var FlyoutNavigationPolicy$$module$build$src$core$keyboard_nav$flyout_navigation_policy=class{constructor(a,b){this.policy=a;this.flyout=b}getFirstChild(a){return null}getParent(a){return this.policy.getParent(a)}getNextSibling(a){const b=this.flyout.getContents();if(!b)return null;let c=b.findIndex(d=>d.getElement()===a);if(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()===
1098
1103
  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");
@@ -1135,62 +1140,61 @@ c){try{$.disable$$module$build$src$core$events$utils(),this.hScroll&&b&&this.hSc
1135
1140
  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_()),
1136
1141
  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&&
1137
1142
  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}};
1138
- 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);
1139
- 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;
1140
- 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",
1141
- "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_));
1142
- 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,
1143
- 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=
1144
- 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=
1145
- 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)");
1146
- 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));
1147
- 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||
1148
- 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,
1149
- 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);
1150
- 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=
1151
- 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<a.length;c++){const d=a[c];fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.VAR_CREATE))(d))}fire$$module$build$src$core$events$utils(new (get$$module$build$src$core$events$utils(EventType$$module$build$src$core$events$type.BLOCK_CREATE))(b))}this.autoClose&&
1152
- this.hide();return b}reflow(){this.reflowWrapper&&this.workspace_.removeChangeListener(this.reflowWrapper);this.reflowInternal_();this.reflowWrapper&&this.workspace_.addChangeListener(this.reflowWrapper)}isScrollable(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1}placeNewBlock(a){var b=this.targetWorkspace;if(!a.getSvgRoot())throw Error("oldBlock is not rendered");const c=this.serializeBlock(a);b.setResizesEnabled(!1);b=append$$module$build$src$core$serialization$blocks(c,
1153
- b);this.positionNewBlock(a,b);return b}serializeBlock(a){return save$$module$build$src$core$serialization$blocks(a)}positionNewBlock(a,b){const c=this.targetWorkspace;var d=c.getOriginOffsetInPixels(),e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY();a.scale(this.workspace_.scale);e=Coordinate$$module$build$src$core$utils$coordinate.sum(e,a);d=Coordinate$$module$build$src$core$utils$coordinate.difference(e,d);d.scale(1/c.scale);b.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(d.x,
1154
- d.y))}getInflaterForType(a){if(this.inflaters.has(a)){var b;return(b=this.inflaters.get(a))!=null?b:null}return(b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,a))?(b=new b,this.inflaters.set(a,b),b):null}getFocusableElement(){throw Error("Flyouts are not directly focusable.");}getFocusableTree(){throw Error("Flyouts are not directly focusable.");}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}getRootFocusableNode(){throw Error("Flyouts are not directly focusable.");
1155
- }getRestoredFocusableNode(a){throw Error("Flyouts are not directly focusable.");}getNestedTrees(){throw Error("Flyouts are not directly focusable.");}lookUpFocusableNode(a){throw Error("Flyouts are not directly focusable.");}onTreeFocus(a,b){}onTreeBlur(a){throw Error("Flyouts are not directly focusable.");}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;var module$build$src$core$interfaces$i_draggable={};module$build$src$core$interfaces$i_draggable.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=
1156
- new KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller,module$build$src$core$keyboard_navigation_controller={};module$build$src$core$keyboard_navigation_controller.KeyboardNavigationController=KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var WorkspaceDragger$$module$build$src$core$workspace_dragger=class{constructor(a){this.workspace=a;this.horizontalScrollEnabled=this.workspace.isMovableHorizontally();this.verticalScrollEnabled=this.workspace.isMovableVertically();this.startScrollXY_=new Coordinate$$module$build$src$core$utils$coordinate(a.scrollX,a.scrollY)}dispose(){this.workspace=null}startDrag(){}endDrag(a){this.drag(a)}drag(a){a=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startScrollXY_,a);if(this.horizontalScrollEnabled&&
1157
- this.verticalScrollEnabled)this.workspace.scroll(a.x,a.y);else if(this.horizontalScrollEnabled)this.workspace.scroll(a.x,this.workspace.scrollY);else if(this.verticalScrollEnabled)this.workspace.scroll(this.workspace.scrollX,a.y);else throw new TypeError("Invalid state.");}},module$build$src$core$workspace_dragger={};module$build$src$core$workspace_dragger.WorkspaceDragger=WorkspaceDragger$$module$build$src$core$workspace_dragger;var ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture=5,ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture=6,Gesture$$module$build$src$core$gesture=class{constructor(a,b){this.creatorWorkspace=b;this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.startWorkspace_=this.targetBlock=this.startComment=this.startBlock=this.startIcon=this.startField=this.startBubble=null;this.hasExceededDragRadius=!1;this.boundEvents=[];this.workspaceDragger=this.dragger=null;this.dragging=
1143
+ 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.inhibitReflowWrapper=!1;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);
1144
+ 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_=
1145
+ 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_,
1146
+ "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_,
1147
+ "wheel",this,this.wheel_,!1,{passive:!1}));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,
1148
+ 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_),
1149
+ 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=
1150
+ 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,
1151
+ 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()&&
1152
+ (this.setVisible(!1),this.reflowWrapper&&(this.workspace_.removeChangeListener(this.reflowWrapper),this.reflowWrapper=null))}show(a){this.workspace_.setResizesEnabled(!1);$.setRecordUndo$$module$build$src$core$events$utils(!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_);
1153
+ this.setContents(a);this.layout_(a);this.horizontalLayout?this.height_=0:this.width_=0;this.reflow();$.setRecordUndo$$module$build$src$core$events$utils(!0);this.workspace_.setResizesEnabled(!0);this.reflowWrapper=b=>{this.inhibitReflowWrapper||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=
1154
+ 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));
1155
+ 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.");
1156
+ 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){const b=this.targetWorkspace;if(!a.getSvgRoot())throw Error("oldBlock is not rendered");
1157
+ var c=this.serializeBlock(a);b.setResizesEnabled(!1);c=appendInternal$$module$build$src$core$serialization$blocks(c,b,{recordUndo:!0});this.positionNewBlock(a,c);b.hideChaff();return c}reflow(){this.inhibitReflowWrapper=!0;this.reflowInternal_();this.inhibitReflowWrapper=!1}isScrollable(){return this.workspace_.scrollbar?this.workspace_.scrollbar.isVisible():!1}serializeBlock(a){return save$$module$build$src$core$serialization$blocks(a)}positionNewBlock(a,b){const c=this.targetWorkspace;var d=c.getOriginOffsetInPixels(),
1158
+ e=this.workspace_.getOriginOffsetInPixels();a=a.getRelativeToSurfaceXY();a.scale(this.workspace_.scale);e=Coordinate$$module$build$src$core$utils$coordinate.sum(e,a);d=Coordinate$$module$build$src$core$utils$coordinate.difference(e,d);d.scale(1/c.scale);b.moveTo(new Coordinate$$module$build$src$core$utils$coordinate(d.x,d.y))}getInflaterForType(a){if(this.inflaters.has(a)){var b;return(b=this.inflaters.get(a))!=null?b:null}return(b=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUT_INFLATER,
1159
+ a))?(b=new b,this.inflaters.set(a,b),b):null}getFocusableElement(){throw Error("Flyouts are not directly focusable.");}getFocusableTree(){throw Error("Flyouts are not directly focusable.");}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!1}getRootFocusableNode(){throw Error("Flyouts are not directly focusable.");}getRestoredFocusableNode(a){throw Error("Flyouts are not directly focusable.");}getNestedTrees(){throw Error("Flyouts are not directly focusable.");}lookUpFocusableNode(a){throw Error("Flyouts are not directly focusable.");
1160
+ }onTreeFocus(a,b){}onTreeBlur(a){throw Error("Flyouts are not directly focusable.");}},module$build$src$core$flyout_base={};module$build$src$core$flyout_base.Flyout=Flyout$$module$build$src$core$flyout_base;var module$build$src$core$interfaces$i_contextmenu={};module$build$src$core$interfaces$i_contextmenu.hasContextMenu=hasContextMenu$$module$build$src$core$interfaces$i_contextmenu;var module$build$src$core$interfaces$i_draggable={};module$build$src$core$interfaces$i_draggable.isDraggable=isDraggable$$module$build$src$core$interfaces$i_draggable;var KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=class{constructor(){this.isActive=!1;this.activeClassName="blocklyKeyboardNavigation"}setIsActive(a=!0){this.isActive=a;this.updateActiveVisualization()}getIsActive(){return this.isActive}updateActiveVisualization(){this.isActive?document.body.classList.add(this.activeClassName):document.body.classList.remove(this.activeClassName)}},keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller=
1161
+ new KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller,module$build$src$core$keyboard_navigation_controller={};module$build$src$core$keyboard_navigation_controller.KeyboardNavigationController=KeyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$keyboard_navigation_controller.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;var WorkspaceDragger$$module$build$src$core$workspace_dragger=class{constructor(a){this.workspace=a;this.horizontalScrollEnabled=this.workspace.isMovableHorizontally();this.verticalScrollEnabled=this.workspace.isMovableVertically();this.startScrollXY_=new Coordinate$$module$build$src$core$utils$coordinate(a.scrollX,a.scrollY)}startDrag(){}endDrag(a){this.drag(a)}drag(a){a=Coordinate$$module$build$src$core$utils$coordinate.sum(this.startScrollXY_,a);if(this.horizontalScrollEnabled&&this.verticalScrollEnabled)this.workspace.scroll(a.x,
1162
+ a.y);else if(this.horizontalScrollEnabled)this.workspace.scroll(a.x,this.workspace.scrollY);else if(this.verticalScrollEnabled)this.workspace.scroll(this.workspace.scrollX,a.y);else throw new TypeError("Invalid state.");}},module$build$src$core$workspace_dragger={};module$build$src$core$workspace_dragger.WorkspaceDragger=WorkspaceDragger$$module$build$src$core$workspace_dragger;var ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture=5,ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture=6,Gesture$$module$build$src$core$gesture=class{constructor(a,b){this.creatorWorkspace=b;this.mouseDownXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0);this.startWorkspace_=this.targetBlock=this.startComment=this.startBlock=this.startIcon=this.startField=this.startBubble=null;this.hasExceededDragRadius=!1;this.boundEvents=[];this.workspaceDragger=this.dragger=null;this.dragging=
1158
1163
  !1;this.flyout=null;this.multiTouch=this.isEnding_=this.gestureHasStarted=this.calledUpdateIsDragging=!1;this.cachedPoints=new Map;this.startDistance=this.previousScale=0;this.currentDropdownOwner=this.isPinchZoomEnabled=null;this.mostRecentEvent=a;this.currentDragDeltaXY=new Coordinate$$module$build$src$core$utils$coordinate(0,0)}dispose(){clearTouchIdentifier$$module$build$src$core$touch();unblock$$module$build$src$core$tooltip();this.creatorWorkspace.clearGesture();for(const a of this.boundEvents)unbind$$module$build$src$core$browser_events(a);
1159
- this.boundEvents.length=0;this.workspaceDragger&&this.workspaceDragger.dispose()}updateFromEvent(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);this.updateDragDelta(b)&&(this.updateIsDragging(a),longStop$$module$build$src$core$touch());this.mostRecentEvent=a}updateDragDelta(a){this.currentDragDeltaXY=Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.mouseDownXY);return this.hasExceededDragRadius?!1:this.hasExceededDragRadius=Coordinate$$module$build$src$core$utils$coordinate.magnitude(this.currentDragDeltaXY)>
1160
- (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_=
1161
- 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");
1162
- 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=
1163
- !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,
1164
- !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(),
1165
- 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),
1166
- 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,
1167
- "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);
1168
- 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),
1169
- 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=
1170
- 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&&
1171
- 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>
1172
- 0&&this.previousScale<Infinity){b=c-this.previousScale;b=b>0?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);
1173
- 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);
1174
- 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));
1175
- 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);
1164
+ this.boundEvents.length=0}updateFromEvent(a){const b=new Coordinate$$module$build$src$core$utils$coordinate(a.clientX,a.clientY);this.updateDragDelta(b)&&(this.updateIsDragging(a),longStop$$module$build$src$core$touch());this.mostRecentEvent=a}updateDragDelta(a){this.currentDragDeltaXY=Coordinate$$module$build$src$core$utils$coordinate.difference(a,this.mouseDownXY);return this.hasExceededDragRadius?!1:this.hasExceededDragRadius=Coordinate$$module$build$src$core$utils$coordinate.magnitude(this.currentDragDeltaXY)>
1165
+ (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");this.startWorkspace_=this.flyout.targetWorkspace;this.startWorkspace_.updateScreenCalculationsIfScrolled();
1166
+ $.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);return!0}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=
1167
+ !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();
1168
+ 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");
1169
+ 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),
1170
+ 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,
1171
+ "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()||
1172
+ (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()||
1173
+ 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),
1174
+ 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());
1175
+ 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);
1176
+ 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.previousScale<Infinity){b=c-this.previousScale;b=b>0?b*ZOOM_IN_MULTIPLIER$$module$build$src$core$gesture:b*ZOOM_OUT_MULTIPLIER$$module$build$src$core$gesture;
1177
+ 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_?
1178
+ 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){const b=$.getFocusManager$$module$build$src$core$focus_manager().getFocusedNode();if(hasContextMenu$$module$build$src$core$interfaces$i_contextmenu(b)){let c;
1179
+ (c=this.startWorkspace_)==null||c.hideChaff(!!this.flyout);b.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.targetBlock||this.startBubble||this.startComment||this.startIcon||$.getFocusManager$$module$build$src$core$focus_manager().focusNode(b);
1176
1180
  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.");
1177
1181
  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");
1178
- 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()||
1179
- $.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();
1180
- $.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.");
1181
- 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_||
1182
- (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;
1183
- 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();
1184
- 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=
1182
+ 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.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);
1183
+ 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)}$.setGroup$$module$build$src$core$events$utils(!1)}doWorkspaceClick(a){this.fireWorkspaceClick(this.startWorkspace_||
1184
+ this.creatorWorkspace)}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||
1185
+ this.startBubble||this.startIcon||(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(this.targetBlock),this.targetBlock.bringToFront())}setStartWorkspace(a){this.startWorkspace_||(this.startWorkspace_=a)}setStartFlyout(a){this.flyout||(this.flyout=a)}isBubbleClick(){return!!this.startBubble&&
1186
+ !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);
1187
+ 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={};
1188
+ 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=
1185
1189
  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",
1186
1190
  `${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?
1187
1191
  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={};
1188
1192
  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,
1189
1193
  {"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,
1190
- "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=
1191
- `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);
1192
- 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<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}},
1193
- module$build$src$core$layer_manager={};module$build$src$core$layer_manager.LayerManager=LayerManager$$module$build$src$core$layer_manager;var Marker$$module$build$src$core$keyboard_nav$marker=class{constructor(){this.curNode=this.colour=null;this.type="marker"}getCurNode(){return this.curNode}setCurNode(a){this.curNode=a}dispose(){this.curNode=null}getSourceBlockFromNode(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?a:a instanceof Field$$module$build$src$core$field||a instanceof RenderedConnection$$module$build$src$core$rendered_connection?a.getSourceBlock():null}getSourceBlock(){return this.getSourceBlockFromNode(this.getCurNode())}},
1194
+ "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.style.transform;c&&this.animationLayer&&(this.animationLayer.style.transform=c);let d;(d=this.animationLayer)==null||d.appendChild(a.getSvgRoot())}translateLayers(a,b){a=`translate(${a.x}px, ${a.y}px) scale(${b})`;
1195
+ this.dragLayer&&(this.dragLayer.style.transform=a);for(const [,c]of this.layers)c.style.transform=a}moveToDragLayer(a,b=!0){let c;(c=this.dragLayer)==null||c.appendChild(a.getSvgRoot());b&&a.canBeFocused()&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(a)}moveOffDragLayer(a,b,c=!0){this.append(a,b);c&&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))==
1196
+ 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<f){b.insertBefore(c,g);d=!0;break}d||b.appendChild(c);this.layers.set(a,c);return c}hasLayer(a){return a===this.dragLayer||(new Set(this.layers.values())).has(a)}getBlockLayer(){return this.layers.get(BLOCK$$module$build$src$core$layers)}getBubbleLayer(){return this.layers.get(BUBBLE$$module$build$src$core$layers)}getDragLayer(){return this.dragLayer}},
1197
+ module$build$src$core$layer_manager={};module$build$src$core$layer_manager.LayerManager=LayerManager$$module$build$src$core$layer_manager;var Marker$$module$build$src$core$keyboard_nav$marker=class{constructor(){this.curNode=this.colour=null;this.type="marker"}getCurNode(){return this.curNode}setCurNode(a){this.curNode=a}dispose(){this.curNode=null}getSourceBlockFromNode(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?a:a instanceof Field$$module$build$src$core$field||a instanceof RenderedConnection$$module$build$src$core$rendered_connection||a instanceof Icon$$module$build$src$core$icons$icon?a.getSourceBlock():null}getSourceBlock(){return this.getSourceBlockFromNode(this.getCurNode())}},
1194
1198
  module$build$src$core$keyboard_nav$marker={};module$build$src$core$keyboard_nav$marker.Marker=Marker$$module$build$src$core$keyboard_nav$marker;var LineCursor$$module$build$src$core$keyboard_nav$line_cursor=class extends Marker$$module$build$src$core$keyboard_nav$marker{constructor(a){super();this.workspace=a;this.type="cursor";this.potentialNodes=null}next(){var a=this.getCurNode();if(!a)return null;(a=this.getNextNode(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},
1195
1199
  !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();
1196
1200
  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=
@@ -1255,7 +1259,7 @@ a));return{width:a,height:a,pathTop:b,pathBottom:c}}makeOutsideCorners(){const a
1255
1259
  {d:"M 0 0 L 10 10 M 10 0 L 0 10",stroke:"#cc0"},a);this.disabledPatternId=a.id;this.disabledPattern=a;this.createDebugFilter();d&&(d.style.setProperty("--blocklyEmbossFilter",`url(#${this.embossFilterId})`),d.style.setProperty("--blocklyDisabledPattern",`url(#${this.disabledPatternId})`),d.style.setProperty("--blocklyDebugFilter",`url(#${this.debugFilterId})`))}createDebugFilter(){if(!this.debugFilter){const a=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.FILTER,
1256
1260
  {id:"blocklyDebugFilter"+this.randomIdentifier,height:"160%",width:"180%",y:"-30%",x:"-40%"},this.defs),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":"#ff0000",
1257
1261
  "flood-opacity":.5,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);this.debugFilterId=a.id;this.debugFilter=a}}injectCSS_(a,b){b=this.getCSS_(b);a="blockly-renderer-style-"+a;this.cssNode=document.getElementById(a);const c=b.join("\n");this.cssNode?this.cssNode.firstChild.textContent=c:(b=document.createElement("style"),b.id=a,a=document.createTextNode(c),b.appendChild(a),
1258
- document.head.insertBefore(b,document.head.firstChild),this.cssNode=b)}getCSS_(a){return[`${a} .blocklyText, `,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} `+`${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyText {`,"fill: #fff;","}",`${a} .blocklyNonEditableField>rect,`,`${a} .blocklyEditableField>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text {`,
1262
+ document.head.insertBefore(b,document.head.firstChild),this.cssNode=b)}getCSS_(a){return[`${a} .blocklyText, `,`${a} .blocklyFlyoutLabelText {`,`font: ${this.FIELD_TEXT_FONTWEIGHT} ${this.FIELD_TEXT_FONTSIZE}pt ${this.FIELD_TEXT_FONTFAMILY};`,"}",`${a} .blocklyText {`,"fill: #fff;","}",`${a} .blocklyNonEditableField>rect,`,`${a} .blocklyEditableField>rect {`,`fill: ${this.FIELD_BORDER_RECT_COLOUR};`,"fill-opacity: .6;","stroke: none;","}",`${a} .blocklyNonEditableField>text,`,`${a} .blocklyEditableField>text {`,
1259
1263
  "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 {`,
1260
1264
  "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;
1261
1265
  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=
@@ -1338,9 +1342,9 @@ b+=a[c]}return b>this.remainingCapacity()?!1:!0}hasBlockLimits(){return this.opt
1338
1342
  try{for(c=0;c<e.length;c++)e[c].run(a)}finally{$.setRecordUndo$$module$build$src$core$events$utils(!0)}}}clearUndo(){this.undoStack_.length=0;this.redoStack_.length=0;clearPendingUndo$$module$build$src$core$events$utils()}addChangeListener(a){this.listeners.push(a);return a}removeChangeListener(a){removeElem$$module$build$src$core$utils$array(this.listeners,a)}fireChangeListener(a){if(a.recordUndo)for(this.undoStack_.push(a),this.redoStack_.length=0;this.undoStack_.length>this.MAX_UNDO&&this.MAX_UNDO>=
1339
1343
  0;)this.undoStack_.shift();for(let b=0;b<this.listeners.length;b++)(0,this.listeners[b])(a)}getBlockById(a){return this.blockDB.get(a)||null}setBlockById(a,b){this.blockDB.set(a,b)}removeBlockById(a){this.blockDB.delete(a)}getCommentById(a){let b;return(b=this.commentDB.get(a))!=null?b:null}allInputsFilled(a){const b=this.getTopBlocks(!1);for(let c=0;c<b.length;c++)if(!b[c].allInputsFilled(a))return!1;return!0}getPotentialVariableMap(){return this.potentialVariableMap}createPotentialVariableMap(){this.potentialVariableMap=
1340
1344
  new (this.getVariableMapClass())(this,!0)}getVariableMap(){return this.variableMap}setVariableMap(a){this.variableMap=a}getProcedureMap(){return this.procedureMap}getRootWorkspace(){let a=null;const b=this.options.parentWorkspace;this.isFlyout?b&&b.options&&(a=b.options.parentWorkspace):b&&(a=b);return a}static getById(a){return getWorkspaceById$$module$build$src$core$common(a)}static getAll(){return getAllWorkspaces$$module$build$src$core$common()}getVariableMapClass(){const a=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MAP,
1341
- this.options,!0);if(!a)throw Error("No variable map is registered.");return a}isReadOnly(){return this.readOnly}setIsReadOnly(a){this.readOnly=a;this.options.readOnly=a}};Workspace$$module$build$src$core$workspace.SCAN_ANGLE=3;var module$build$src$core$workspace={};module$build$src$core$workspace.Workspace=Workspace$$module$build$src$core$workspace;var SOUND_LIMIT$$module$build$src$core$workspace_audio=100,WorkspaceAudio$$module$build$src$core$workspace_audio=class{constructor(a){this.parentWorkspace=a;this.sounds=new Map;this.lastSound=null;this.muted=!1}dispose(){this.sounds.clear()}load(a,b){if(a.length){try{var c=new globalThis.Audio}catch(e){return}for(let e=0;e<a.length;e++){const f=a[e],g=f.match(/\.(\w+)$/);if(g&&c.canPlayType("audio/"+g[1])){var d=new globalThis.Audio(f);break}}d&&this.sounds.set(b,d)}}preload(){for(const a of this.sounds.values()){a.volume=
1342
- .01;const b=a.play();b!==void 0?b.then(a.pause).catch(function(){}):a.pause();if(IPAD$$module$build$src$core$utils$useragent||IPHONE$$module$build$src$core$utils$useragent)break}}play(a,b){if(!this.muted){var c=this.sounds.get(a);c?(a=new Date,this.lastSound!==null&&a.getTime()-this.lastSound.getTime()<SOUND_LIMIT$$module$build$src$core$workspace_audio||(this.lastSound=a,c=IPAD$$module$build$src$core$utils$useragent||ANDROID$$module$build$src$core$utils$useragent?c:c.cloneNode(),c.volume=b===void 0?
1343
- 1:b,c.play())):this.parentWorkspace&&this.parentWorkspace.getAudioManager().play(a,b)}}setMuted(a){this.muted=a}getMuted(){return this.muted}},module$build$src$core$workspace_audio={};module$build$src$core$workspace_audio.WorkspaceAudio=WorkspaceAudio$$module$build$src$core$workspace_audio;var ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg=20,WorkspaceSvg$$module$build$src$core$workspace_svg=class extends Workspace$$module$build$src$core$workspace{constructor(a){super(a);this.resizeHandlerWrapper=null;this.resizesEnabled=this.visible=this.rendered=!0;this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0;this.oldScale=this.scale=1;this.oldLeft=this.oldTop=0;this.inverseScreenCTM=this.targetWorkspace=this.dummyWheelListener=this.configureContextMenu=this.lastRecordedPageScroll=
1345
+ this.options,!0);if(!a)throw Error("No variable map is registered.");return a}isReadOnly(){return this.readOnly}setIsReadOnly(a){this.readOnly=a;this.options.readOnly=a}};Workspace$$module$build$src$core$workspace.SCAN_ANGLE=3;var module$build$src$core$workspace={};module$build$src$core$workspace.Workspace=Workspace$$module$build$src$core$workspace;var SOUND_LIMIT$$module$build$src$core$workspace_audio=100,WorkspaceAudio$$module$build$src$core$workspace_audio=class{constructor(a){this.parentWorkspace=a;this.sounds=new Map;this.lastSound=null;this.muted=!1;window.AudioContext&&(this.context=new AudioContext)}dispose(){this.sounds.clear();let a;(a=this.context)==null||a.close()}load(a,b){const c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(a.length){var d=yield(yield fetch(a[0])).arrayBuffer(),e;(e=c.context)==null||
1346
+ e.decodeAudioData(d,f=>{c.sounds.set(b,f)})}})}play(a,b){const c=this;return(0,$jscomp.asyncExecutePromiseGeneratorFunction)(function*(){if(!c.muted&&b!==0&&c.context){var d=c.sounds.get(a);if(d){const g=new Date;if(!(c.lastSound!==null&&g.getTime()-c.lastSound.getTime()<SOUND_LIMIT$$module$build$src$core$workspace_audio)){c.lastSound=g;c.context.state==="suspended"&&(yield c.context.resume());var e=c.context.createBufferSource(),f=c.context.createGain();f.gain.value=b!=null?b:1;f.connect(c.context.destination);
1347
+ e.buffer=d;e.connect(f);e.addEventListener("ended",()=>{e.disconnect();f.disconnect()});e.start()}}else c.parentWorkspace&&c.parentWorkspace.getAudioManager().play(a,b)}})}setMuted(a){this.muted=a}getMuted(){return this.muted}},module$build$src$core$workspace_audio={};module$build$src$core$workspace_audio.WorkspaceAudio=WorkspaceAudio$$module$build$src$core$workspace_audio;var ZOOM_TO_FIT_MARGIN$$module$build$src$core$workspace_svg=20,WorkspaceSvg$$module$build$src$core$workspace_svg=class extends Workspace$$module$build$src$core$workspace{constructor(a){super(a);this.resizeHandlerWrapper=null;this.resizesEnabled=this.visible=this.rendered=!0;this.startScrollY=this.startScrollX=this.scrollY=this.scrollX=0;this.oldScale=this.scale=1;this.oldLeft=this.oldTop=0;this.inverseScreenCTM=this.targetWorkspace=this.dummyWheelListener=this.configureContextMenu=this.lastRecordedPageScroll=
1344
1348
  this.injectionDiv=this.currentGesture_=this.toolbox=this.flyout=this.scrollbar=this.trashcan=null;this.inverseScreenCTMDirty=!0;this.highlightedBlocks=[];this.toolboxCategoryCallbacks=new Map;this.flyoutButtonCallbacks=new Map;this.cachedParentSvg=null;this.keyboardMoveInProgress=this.keyboardAccessibilityMode=!1;this.topBoundedElements=[];this.dragTargetAreas=[];this.zoomControls_=this.layerManager=null;this.navigator=new Navigator$$module$build$src$core$navigator;this.metricsManager=new (getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.METRICS_MANAGER,
1345
1349
  a,!0))(this);this.getMetrics=a.getMetrics||this.metricsManager.getMetrics.bind(this.metricsManager);this.setMetrics=a.setMetrics||WorkspaceSvg$$module$build$src$core$workspace_svg.setTopLevelWorkspaceMetrics;this.componentManager=new ComponentManager$$module$build$src$core$component_manager;this.connectionDBList=ConnectionDB$$module$build$src$core$connection_db.init(this.connectionChecker);this.audioManager=new WorkspaceAudio$$module$build$src$core$workspace_audio(a.parentWorkspace);this.grid=this.options.gridPattern?
1346
1350
  new Grid$$module$build$src$core$grid(this.options.gridPattern,a.gridOptions):null;this.markerManager=new MarkerManager$$module$build$src$core$marker_manager(this);module$build$src$core$variables&&internalFlyoutCategory$$module$build$src$core$variables&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables,internalFlyoutCategory$$module$build$src$core$variables);module$build$src$core$variables_dynamic&&internalFlyoutCategory$$module$build$src$core$variables_dynamic&&this.registerToolboxCategoryCallback(CATEGORY_NAME$$module$build$src$core$variables_dynamic,
@@ -1352,19 +1356,20 @@ c.getStyleName();d&&c.setStyle(d)}}getInverseScreenCTM(){if(this.inverseScreenCT
1352
1356
  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((" "+
1353
1357
  (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_,
1354
1358
  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);
1355
- 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,
1356
- 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=
1357
- !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();
1358
- 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),
1359
- 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");
1360
- }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,
1361
- 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);
1362
- 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,
1363
- !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,
1364
- 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=
1365
- 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;
1366
- (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();
1367
- 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=
1359
+ 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,{passive:!0}),conditionalBind$$module$build$src$core$browser_events(this.svgGroup_,"wheel",this,this.onMouseWheel,!1,{passive:!1}));this.options.hasCategories&&(this.toolbox=
1360
+ 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,
1361
+ !!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&&
1362
+ 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&&
1363
+ (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();
1364
+ 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,
1365
+ 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,
1366
+ 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&&
1367
+ 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,
1368
+ 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=
1369
+ 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=
1370
+ 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),
1371
+ 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)?
1372
+ 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=
1368
1373
  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");
1369
1374
  }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=
1370
1375
  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=
@@ -1384,8 +1389,8 @@ a>this.options.zoomOptions.maxScale?a=this.options.zoomOptions.maxScale:this.opt
1384
1389
  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);
1385
1390
  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,
1386
1391
  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=
1387
- 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(),
1388
- 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=
1392
+ 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==null||a.preventDefault(),
1393
+ a==null||a.stopPropagation(),null;const b=(a==null?void 0: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=
1389
1394
  !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)*
1390
1395
  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=
1391
1396
  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.left<d.left?b=this.RTL?Math.min(d.left-a.left,d.right-a.right):d.left-a.left:a.right>d.right&&(b=this.RTL?d.right-a.right:Math.max(d.right-a.right,d.left-a.left));a.top<d.top?e=d.top-a.top:a.bottom>d.bottom&&(e=
@@ -1395,26 +1400,27 @@ RenderedWorkspaceComment$$module$build$src$core$comments$rendered_workspace_comm
1395
1400
  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));
1396
1401
  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()&&
1397
1402
  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=
1398
- 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);
1399
- 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");
1400
- 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();
1401
- 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,
1403
+ 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=!0;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=Abstract$$module$build$src$core$events$events_abstract.fromJson(a,
1404
+ 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");
1405
+ a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=VarBase$$module$build$src$core$events$events_var_base.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");
1406
+ 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,
1402
1407
  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");
1403
- 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();
1404
- 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");
1405
- 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");
1406
- 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())||
1408
+ a.varType=this.varType;a.varName=this.varName;return a}static fromJson(a,b,c){b=VarBase$$module$build$src$core$events$events_var_base.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");
1409
+ 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");
1410
+ a.oldName=this.oldName;a.newName=this.newName;return a}static fromJson(a,b,c){b=VarBase$$module$build$src$core$events$events_var_base.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");
1411
+ 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);
1412
+ 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())||
1407
1413
  $.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);
1408
1414
  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,
1409
1415
  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<c.length;b++)c[b].updateVarName(a)}renameVariableWithConflict(a,b,c,d){const e=a.getType(),f=c.getName();b!==f&&this.renameVariableAndUses(c,b,d);for(b=0;b<d.length;b++)d[b].renameVarById(a.getId(),c.getId());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_DELETE))(a));
1410
1416
  let g;(g=this.variableMap.get(e))==null||g.delete(a.getId())}createVariable(a,b,c){var d=this.getVariable(a,b);if(d){if(c&&d.getId()!==c)throw Error('Variable "'+a+'" is already in use and its id is "'+d.getId()+'" which conflicts with the passed in id, "'+c+'".');return d}if(c&&this.getVariableById(c))throw Error('Variable id, "'+c+'", is already in use.');d=c||genUid$$module$build$src$core$utils$idgenerator();b=b||"";c=getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.VARIABLE_MODEL,
1411
1417
  this.workspace.options,!0);if(!c)throw Error("No variable model is registered.");d=new c(this.workspace,a,b,d);let e;a=(e=this.variableMap.get(b))!=null?e:new Map;a.set(d.getId(),d);this.variableMap.has(b)||this.variableMap.set(b,a);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_CREATE))(d));return d}addVariable(a){const b=a.getType();this.variableMap.has(b)||this.variableMap.set(b,new Map);
1412
- let c;(c=this.variableMap.get(b))==null||c.set(a.getId(),a)}deleteVariable(a){const b=getVariableUsesById$$module$build$src$core$variables(this.workspace,a.getId());let c="";this.potentialMap||(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);try{for(let e=0;e<b.length;e++)b[e].dispose(!0);const d=this.variableMap.get(a.getType());d&&d.has(a.getId())&&(d.delete(a.getId()),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_DELETE))(a)),
1418
+ let c;(c=this.variableMap.get(b))==null||c.set(a.getId(),a)}deleteVariable(a){const b=getVariableUsesById$$module$build$src$core$variables(this.workspace,a.getId());let c="";this.potentialMap||(c=$.getGroup$$module$build$src$core$events$utils())||$.setGroup$$module$build$src$core$events$utils(!0);try{for(let e=0;e<b.length;e++)b[e].isDeadOrDying()||b[e].dispose(!0);const d=this.variableMap.get(a.getType());d&&d.has(a.getId())&&(d.delete(a.getId()),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_DELETE))(a)),
1413
1419
  d.size===0&&this.variableMap.delete(a.getType()))}finally{this.potentialMap||$.setGroup$$module$build$src$core$events$utils(c)}}deleteVariableById(a){warn$$module$build$src$core$utils$deprecation("VariableMap.deleteVariableById","v12","v13","Blockly.Variables.deleteVariable");(a=this.getVariableById(a))&&$.deleteVariable$$module$build$src$core$variables(this.workspace,a)}getVariable(a,b){b=this.variableMap.get(b||"");if(!b)return null;let c;return(c=[...b.values()].find(d=>$.Names$$module$build$src$core$names.equals(d.getName(),
1414
1420
  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");
1415
1421
  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);
1416
- 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?
1417
- 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===
1422
+ 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=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,
1423
+ 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===
1418
1424
  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,
1419
1425
  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,
1420
1426
  {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,
@@ -1440,7 +1446,7 @@ module$build$src$core$clipboard.setLastCopiedLocation=setLastCopiedLocation$$mod
1440
1446
  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;
1441
1447
  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;
1442
1448
  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,
1443
- 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()}};
1449
+ 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.getVariableMap().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()}};
1444
1450
  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}};
1445
1451
  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},
1446
1452
  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";
@@ -1464,11 +1470,11 @@ a)),e=arc$$module$build$src$core$utils$svg_paths("a","0 0,1",a,point$$module$bui
1464
1470
  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);
1465
1471
  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,
1466
1472
  {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",
1467
- 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}`+
1468
- `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 {`,
1469
- "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 {`,
1470
- "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};`,
1471
- "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&&
1473
+ 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};`,
1474
+ "}",`${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;",
1475
+ "}",`${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;",
1476
+ "}",`${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;",
1477
+ "}",`${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&&
1472
1478
  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=
1473
1479
  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");
1474
1480
  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,
@@ -1538,7 +1544,7 @@ module$build$src$core$inputs.ValueInput=$.ValueInput$$module$build$src$core$inpu
1538
1544
  $.CodeGenerator$$module$build$src$core$generator=class{constructor(a){this.forBlock=Object.create(null);this.FUNCTION_NAME_PLACEHOLDER_="{leCUI8hutHZI4480Dc}";this.STATEMENT_SUFFIX=this.STATEMENT_PREFIX=this.INFINITE_LOOP_TRAP=null;this.INDENT=" ";this.COMMENT_WRAP=60;this.ORDER_OVERRIDES=[];this.isInitialized=null;this.RESERVED_WORDS_="";this.definitions_=Object.create(null);this.functionNames_=Object.create(null);this.nameDB_=void 0;this.name_=a;this.FUNCTION_NAME_PLACEHOLDER_REGEXP_=new RegExp(this.FUNCTION_NAME_PLACEHOLDER_,
1539
1545
  "g")}workspaceToCode(a){a||(console.warn("No workspace specified in workspaceToCode call. Guessing."),a=getMainWorkspace$$module$build$src$core$common());var b=[];this.init(a);a=a.getTopBlocks(!0);for(let c=0,d;d=a[c];c++){let e=this.blockToCode(d);Array.isArray(e)&&(e=e[0]);e&&(d.outputConnection&&(e=this.scrubNakedValue(e),this.STATEMENT_PREFIX&&!d.suppressPrefixSuffix&&(e=this.injectId(this.STATEMENT_PREFIX,d)+e),this.STATEMENT_SUFFIX&&!d.suppressPrefixSuffix&&(e+=this.injectId(this.STATEMENT_SUFFIX,
1540
1546
  d))),b.push(e))}b=b.join("\n");b=this.finish(b);b=b.replace(/^\s+\n/,"");b=b.replace(/\n\s+$/,"\n");return b=b.replace(/[ \t]+\n/g,"\n")}prefixLines(a,b){return b+a.replace(/(?!\n$)\n/g,"\n"+b)}allNestedComments(a){const b=[];a=a.getDescendants(!0);for(let c=0;c<a.length;c++){const d=a[c].getCommentText();d&&b.push(d)}b.length&&b.push("");return b.join("\n")}blockToCode(a,b){this.isInitialized===!1&&console.warn("CodeGenerator init was not called before blockToCode was called.");if(!a)return"";if(!a.isEnabled())return b?
1541
- "":this.blockToCode(a.getNextBlock());if(a.isInsertionMarker())return b?"":this.blockToCode(a.getChildren(!1)[0]);var c=this.forBlock[a.type];if(typeof c!=="function")throw Error(`${this.name_} generator does not know how to generate code `+`for block type "${a.type}".`);c=c.call(a,a,this);if(Array.isArray(c)){if(!a.outputConnection)throw TypeError("Expecting string from statement block: "+a.type);return[this.scrub_(a,c[0],b),c[1]]}if(typeof c==="string")return this.STATEMENT_PREFIX&&!a.suppressPrefixSuffix&&
1547
+ "":this.blockToCode(a.getNextBlock());if(a.isInsertionMarker())return b?"":this.blockToCode(a.getChildren(!1)[0]);var c=this.forBlock[a.type];if(typeof c!=="function")throw Error(`${this.name_} generator does not know how to generate code for block type "${a.type}".`);c=c.call(a,a,this);if(Array.isArray(c)){if(!a.outputConnection)throw TypeError("Expecting string from statement block: "+a.type);return[this.scrub_(a,c[0],b),c[1]]}if(typeof c==="string")return this.STATEMENT_PREFIX&&!a.suppressPrefixSuffix&&
1542
1548
  (c=this.injectId(this.STATEMENT_PREFIX,a)+c),this.STATEMENT_SUFFIX&&!a.suppressPrefixSuffix&&(c+=this.injectId(this.STATEMENT_SUFFIX,a)),this.scrub_(a,c,b);if(c===null)return"";throw SyntaxError("Invalid code generated: "+c);}valueToCode(a,b,c){if(isNaN(c))throw TypeError("Expecting valid order from block: "+a.type);var d=a.getInputTargetBlock(b);if(!d&&!a.getInput(b))throw ReferenceError(`Input "${b}" doesn't exist on "${a.type}"`);if(!d)return"";b=this.blockToCode(d);if(b==="")return"";if(!Array.isArray(b))throw TypeError(`Expecting tuple from value block: ${d.type} See `+
1543
1549
  "developers.google.com/blockly/guides/create-custom-blocks/generating-code for more information");a=b[0];b=b[1];if(isNaN(b))throw TypeError("Expecting valid order from value block: "+d.type);if(!a)return"";d=!1;var e=Math.floor(c);const f=Math.floor(b);if(e<=f&&(e!==f||e!==0&&e!==99))for(d=!0,e=0;e<this.ORDER_OVERRIDES.length;e++)if(this.ORDER_OVERRIDES[e][0]===c&&this.ORDER_OVERRIDES[e][1]===b){d=!1;break}d&&(a="("+a+")");return a}statementToCode(a,b){const c=a.getInputTargetBlock(b);if(!c&&!a.getInput(b))throw ReferenceError(`Input "${b}" doesn't exist on "${a.type}"`);
1544
1550
  a=this.blockToCode(c);if(typeof a!=="string")throw TypeError("Expecting code from statement block: "+(c&&c.type));a&&(a=this.prefixLines(a,this.INDENT));return a}addLoopTrap(a,b){this.INFINITE_LOOP_TRAP&&(a=this.prefixLines(this.injectId(this.INFINITE_LOOP_TRAP,b),this.INDENT)+a);this.STATEMENT_SUFFIX&&!b.suppressPrefixSuffix&&(a=this.prefixLines(this.injectId(this.STATEMENT_SUFFIX,b),this.INDENT)+a);this.STATEMENT_PREFIX&&!b.suppressPrefixSuffix&&(a+=this.prefixLines(this.injectId(this.STATEMENT_PREFIX,
@@ -1585,44 +1591,45 @@ a.wouldDelete(b):!1}onDragEnd(a){const b=$.getGroup$$module$build$src$core$event
1585
1591
  this.draggable.endDrag(a);c&&isDeletable$$module$build$src$core$interfaces$i_deletable(d)&&($.setGroup$$module$build$src$core$events$utils(b),d.dispose());$.setGroup$$module$build$src$core$events$utils(!1);!c&&isFocusableNode$$module$build$src$core$interfaces$i_focusable_node(this.draggable)&&$.getFocusManager$$module$build$src$core$focus_manager().focusNode(this.draggable)}getRoot(a){return a instanceof BlockSvg$$module$build$src$core$block_svg?a.getRootBlock():a}shouldReturnToStart(a,b){return(a=
1586
1592
  this.workspace.getDragTarget(a))?a.shouldPreventMove(b):!1}pixelsToWorkspaceUnits(a){a=new Coordinate$$module$build$src$core$utils$coordinate(a.x/this.workspace.scale,a.y/this.workspace.scale);this.workspace.isMutator&&a.scale(1/this.workspace.options.parentWorkspace.scale);return a}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.BLOCK_DRAGGER,DEFAULT$$module$build$src$core$registry,Dragger$$module$build$src$core$dragging$dragger);
1587
1593
  var module$build$src$core$dragging$dragger={};module$build$src$core$dragging$dragger.Dragger=Dragger$$module$build$src$core$dragging$dragger;var module$build$src$core$dragging={};module$build$src$core$dragging.BlockDragStrategy=BlockDragStrategy$$module$build$src$core$dragging$block_drag_strategy;module$build$src$core$dragging.BubbleDragStrategy=BubbleDragStrategy$$module$build$src$core$dragging$bubble_drag_strategy;module$build$src$core$dragging.CommentDragStrategy=CommentDragStrategy$$module$build$src$core$dragging$comment_drag_strategy;module$build$src$core$dragging.Dragger=Dragger$$module$build$src$core$dragging$dragger;var BlockDrag$$module$build$src$core$events$events_block_drag=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(a?a.workspace.id:void 0);this.type=EventType$$module$build$src$core$events$type.BLOCK_DRAG;a&&(this.blockId=a.id,this.isStart=b,this.blocks=c)}toJson(){const a=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.blockId===
1588
- void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");a.isStart=this.isStart;a.blockId=this.blockId;a.blocks=this.blocks;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BlockDrag$$module$build$src$core$events$events_block_drag);b.isStart=a.isStart;b.blockId=a.blockId;b.blocks=a.blocks;return b}};
1594
+ void 0)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");a.isStart=this.isStart;a.blockId=this.blockId;a.blocks=this.blocks;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new BlockDrag$$module$build$src$core$events$events_block_drag);b.isStart=a.isStart;b.blockId=a.blockId;b.blocks=a.blocks;return b}};
1589
1595
  register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_DRAG,BlockDrag$$module$build$src$core$events$events_block_drag);var module$build$src$core$events$events_block_drag={};module$build$src$core$events$events_block_drag.BlockDrag=BlockDrag$$module$build$src$core$events$events_block_drag;var BlockFieldIntermediateChange$$module$build$src$core$events$events_block_field_intermediate_change=class extends BlockBase$$module$build$src$core$events$events_block_base{constructor(a,b,c,d){super(a);this.type=EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE;this.recordUndo=!1;a&&(this.name=b,this.oldValue=c,this.newValue=d)}toJson(){const a=super.toJson();if(!this.name)throw Error("The changed field name is undefined. Either pass a name to the constructor, or call fromJson.");
1590
- a.name=this.name;a.oldValue=this.oldValue;a.newValue=this.newValue;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BlockFieldIntermediateChange$$module$build$src$core$events$events_block_field_intermediate_change);b.name=a.name;b.oldValue=a.oldValue;b.newValue=a.newValue;return b}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");
1596
+ a.name=this.name;a.oldValue=this.oldValue;a.newValue=this.newValue;return a}static fromJson(a,b,c){b=BlockBase$$module$build$src$core$events$events_block_base.fromJson(a,b,c!=null?c:new BlockFieldIntermediateChange$$module$build$src$core$events$events_block_field_intermediate_change);b.name=a.name;b.oldValue=a.oldValue;b.newValue=a.newValue;return b}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");
1591
1597
  b=b.getBlockById(this.blockId);if(!b)throw Error("The associated block is undefined. Either pass a block to the constructor, or call fromJson");a=a?this.newValue:this.oldValue;(b=b.getField(this.name))?b.setValue(a):console.warn("Can't set non-existent field: "+this.name)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_FIELD_INTERMEDIATE_CHANGE,BlockFieldIntermediateChange$$module$build$src$core$events$events_block_field_intermediate_change);
1592
1598
  var module$build$src$core$events$events_block_field_intermediate_change={};module$build$src$core$events$events_block_field_intermediate_change.BlockFieldIntermediateChange=BlockFieldIntermediateChange$$module$build$src$core$events$events_block_field_intermediate_change;var BlockMove$$module$build$src$core$events$events_block_move=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_MOVE;a&&(a.isShadow()&&(this.recordUndo=!1),a=this.currentLocation(),this.oldParentId=a.parentId,this.oldInputName=a.inputName,this.oldCoordinate=a.coordinate)}toJson(){const a=super.toJson();a.oldParentId=this.oldParentId;a.oldInputName=this.oldInputName;this.oldCoordinate&&(a.oldCoordinate=
1593
- `${Math.round(this.oldCoordinate.x)}, `+`${Math.round(this.oldCoordinate.y)}`);a.newParentId=this.newParentId;a.newInputName=this.newInputName;this.newCoordinate&&(a.newCoordinate=`${Math.round(this.newCoordinate.x)}, `+`${Math.round(this.newCoordinate.y)}`);this.reason&&(a.reason=this.reason);this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BlockMove$$module$build$src$core$events$events_block_move);b.oldParentId=a.oldParentId;b.oldInputName=
1594
- a.oldInputName;a.oldCoordinate&&(c=a.oldCoordinate.split(","),b.oldCoordinate=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1])));b.newParentId=a.newParentId;b.newInputName=a.newInputName;a.newCoordinate&&(c=a.newCoordinate.split(","),b.newCoordinate=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1])));a.reason!==void 0&&(b.reason=a.reason);a.recordUndo!==void 0&&(b.recordUndo=a.recordUndo);return b}recordNew(){const a=this.currentLocation();
1595
- this.newParentId=a.parentId;this.newInputName=a.inputName;this.newCoordinate=a.coordinate}setReason(a){this.reason=a}currentLocation(){var a=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var b=a.getBlockById(this.blockId);if(!b)throw Error("The block associated with the block move event could not be found");a={};const c=b.getParent();if(c){if(a.parentId=c.id,b=c.getInputWithBlock(b))a.inputName=b.name}else a.coordinate=
1596
- b.getRelativeToSurfaceXY();return a}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&Coordinate$$module$build$src$core$utils$coordinate.equals(this.oldCoordinate,this.newCoordinate)}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");var c=b.getBlockById(this.blockId);if(c){var d=a?this.newParentId:this.oldParentId,e=a?this.newInputName:this.oldInputName;
1597
- a=a?this.newCoordinate:this.oldCoordinate;if(d){var f=b.getBlockById(d);if(!f){console.warn("Can't connect to non-existent block: "+d);return}}c.getParent()&&c.unplug();if(a)e=c.getRelativeToSurfaceXY(),c.moveBy(a.x-e.x,a.y-e.y,this.reason);else{b=c.outputConnection;if(!b||c.previousConnection&&c.previousConnection.isConnected())b=c.previousConnection;let g,h;c=(h=b)==null?void 0:h.type;if(e){if(c=f.getInput(e))g=c.connection}else c===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT&&
1599
+ `${Math.round(this.oldCoordinate.x)}, ${Math.round(this.oldCoordinate.y)}`);a.newParentId=this.newParentId;a.newInputName=this.newInputName;this.newCoordinate&&(a.newCoordinate=`${Math.round(this.newCoordinate.x)}, ${Math.round(this.newCoordinate.y)}`);this.reason&&(a.reason=this.reason);this.recordUndo||(a.recordUndo=this.recordUndo);return a}static fromJson(a,b,c){b=BlockBase$$module$build$src$core$events$events_block_base.fromJson(a,b,c!=null?c:new BlockMove$$module$build$src$core$events$events_block_move);
1600
+ b.oldParentId=a.oldParentId;b.oldInputName=a.oldInputName;a.oldCoordinate&&(c=a.oldCoordinate.split(","),b.oldCoordinate=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1])));b.newParentId=a.newParentId;b.newInputName=a.newInputName;a.newCoordinate&&(c=a.newCoordinate.split(","),b.newCoordinate=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1])));a.reason!==void 0&&(b.reason=a.reason);a.recordUndo!==void 0&&(b.recordUndo=a.recordUndo);return b}recordNew(){const a=
1601
+ this.currentLocation();this.newParentId=a.parentId;this.newInputName=a.inputName;this.newCoordinate=a.coordinate}setReason(a){this.reason=a}currentLocation(){var a=this.getEventWorkspace_();if(!this.blockId)throw Error("The block ID is undefined. Either pass a block to the constructor, or call fromJson");var b=a.getBlockById(this.blockId);if(!b)throw Error("The block associated with the block move event could not be found");a={};const c=b.getParent();if(c){if(a.parentId=c.id,b=c.getInputWithBlock(b))a.inputName=
1602
+ b.name}else a.coordinate=b.getRelativeToSurfaceXY();return a}isNull(){return this.oldParentId===this.newParentId&&this.oldInputName===this.newInputName&&Coordinate$$module$build$src$core$utils$coordinate.equals(this.oldCoordinate,this.newCoordinate)}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");var c=b.getBlockById(this.blockId);if(c){var d=a?this.newParentId:this.oldParentId,e=a?this.newInputName:
1603
+ this.oldInputName;a=a?this.newCoordinate:this.oldCoordinate;if(d){var f=b.getBlockById(d);if(!f){console.warn("Can't connect to non-existent block: "+d);return}}c.getParent()&&c.unplug();if(a)e=c.getRelativeToSurfaceXY(),c.moveBy(a.x-e.x,a.y-e.y,this.reason);else{b=c.outputConnection;if(!b||c.previousConnection&&c.previousConnection.isConnected())b=c.previousConnection;let g,h;c=(h=b)==null?void 0:h.type;if(e){if(c=f.getInput(e))g=c.connection}else c===ConnectionType$$module$build$src$core$connection_type.PREVIOUS_STATEMENT&&
1598
1604
  (g=f.nextConnection);g&&b?b.connect(g):console.warn("Can't connect to non-existent input: "+e)}}else console.warn("Can't move non-existent block: "+this.blockId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BLOCK_MOVE,BlockMove$$module$build$src$core$events$events_block_move);var module$build$src$core$events$events_block_move={};module$build$src$core$events$events_block_move.BlockMove=BlockMove$$module$build$src$core$events$events_block_move;var BubbleOpen$$module$build$src$core$events$events_bubble_open=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(a?a.workspace.id:void 0);this.type=EventType$$module$build$src$core$events$type.BUBBLE_OPEN;a&&(this.blockId=a.id,this.isOpen=b,this.bubbleType=c)}toJson(){const a=super.toJson();if(this.isOpen===void 0)throw Error("Whether this event is for opening the bubble is undefined. Either pass the value to the constructor, or call fromJson");if(!this.bubbleType)throw Error("The type of bubble is undefined. Either pass the value to the constructor, or call fromJson");
1599
- a.isOpen=this.isOpen;a.bubbleType=this.bubbleType;a.blockId=this.blockId||"";return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new BubbleOpen$$module$build$src$core$events$events_bubble_open);b.isOpen=a.isOpen;b.bubbleType=a.bubbleType;b.blockId=a.blockId;return b}},BubbleType$$module$build$src$core$events$events_bubble_open;
1605
+ a.isOpen=this.isOpen;a.bubbleType=this.bubbleType;a.blockId=this.blockId||"";return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new BubbleOpen$$module$build$src$core$events$events_bubble_open);b.isOpen=a.isOpen;b.bubbleType=a.bubbleType;b.blockId=a.blockId;return b}},BubbleType$$module$build$src$core$events$events_bubble_open;
1600
1606
  (function(a){a.MUTATOR="mutator";a.COMMENT="comment";a.WARNING="warning"})(BubbleType$$module$build$src$core$events$events_bubble_open||(BubbleType$$module$build$src$core$events$events_bubble_open={}));register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.BUBBLE_OPEN,BubbleOpen$$module$build$src$core$events$events_bubble_open);var module$build$src$core$events$events_bubble_open={};
1601
- module$build$src$core$events$events_bubble_open.BubbleOpen=BubbleOpen$$module$build$src$core$events$events_bubble_open;module$build$src$core$events$events_bubble_open.BubbleType=BubbleType$$module$build$src$core$events$events_bubble_open;var CommentBase$$module$build$src$core$events$events_comment_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!a;a&&(this.commentId=a.id,this.workspaceId=a.workspace.id,this.group=$.getGroup$$module$build$src$core$events$utils(),this.recordUndo=getRecordUndo$$module$build$src$core$events$utils())}toJson(){const a=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1602
- a.commentId=this.commentId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentBase$$module$build$src$core$events$events_comment_base);b.commentId=a.commentId;return b}static CommentCreateDeleteHelper(a,b){const c=a.getEventWorkspace_();if(b){if(!a.json)throw Error("Encountered a comment event without proper json");append$$module$build$src$core$serialization$workspace_comments(a.json,c)}else{if(!a.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1607
+ module$build$src$core$events$events_bubble_open.BubbleOpen=BubbleOpen$$module$build$src$core$events$events_bubble_open;module$build$src$core$events$events_bubble_open.BubbleType=BubbleType$$module$build$src$core$events$events_bubble_open;var CommentBase$$module$build$src$core$events$events_comment_base=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!0;this.isBlank=!a;a&&(this.commentId=a.id,this.workspaceId=a.workspace.id,this.group=$.getGroup$$module$build$src$core$events$utils(),this.recordUndo=getRecordUndo$$module$build$src$core$events$utils())}toJson(){const a=super.toJson();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1608
+ a.commentId=this.commentId;return a}static fromJson(a,b,c){b=Abstract$$module$build$src$core$events$events_abstract.fromJson(a,b,c!=null?c:new CommentBase$$module$build$src$core$events$events_comment_base);b.commentId=a.commentId;return b}static CommentCreateDeleteHelper(a,b){const c=a.getEventWorkspace_();if(b){if(!a.json)throw Error("Encountered a comment event without proper json");append$$module$build$src$core$serialization$workspace_comments(a.json,c)}else{if(!a.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1603
1609
  (b=c.getCommentById(a.commentId))?b.dispose():console.warn("Can't delete non-existent comment: "+a.commentId)}}},module$build$src$core$events$events_comment_base={};module$build$src$core$events$events_comment_base.CommentBase=CommentBase$$module$build$src$core$events$events_comment_base;var CommentChange$$module$build$src$core$events$events_comment_change=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a,b,c){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_CHANGE;a&&(this.oldContents_=typeof b==="undefined"?"":b,this.newContents_=typeof c==="undefined"?"":c)}toJson(){const a=super.toJson();if(!this.oldContents_)throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");if(!this.newContents_)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");
1604
- a.oldContents=this.oldContents_;a.newContents=this.newContents_;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentChange$$module$build$src$core$events$events_comment_change);b.oldContents_=a.oldContents;b.newContents_=a.newContents;return b}isNull(){return this.oldContents_===this.newContents_}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(b=b.getCommentById(this.commentId)){var c=
1605
- a?this.newContents_:this.oldContents_;if(c===void 0){if(a)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");}b.setText(c)}else console.warn("Can't change non-existent comment: "+this.commentId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_CHANGE,CommentChange$$module$build$src$core$events$events_comment_change);
1606
- var module$build$src$core$events$events_comment_change={};module$build$src$core$events$events_comment_change.CommentChange=CommentChange$$module$build$src$core$events$events_comment_change;var CommentCollapse$$module$build$src$core$events$events_comment_collapse=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a,b){super(a);this.newCollapsed=b;this.type=EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE}toJson(){const a=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");a.newCollapsed=this.newCollapsed;return a}static fromJson(a,b,c){b=super.fromJson(a,
1610
+ a.oldContents=this.oldContents_;a.newContents=this.newContents_;return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentChange$$module$build$src$core$events$events_comment_change);b.oldContents_=a.oldContents;b.newContents_=a.newContents;return b}isNull(){return this.oldContents_===this.newContents_}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1611
+ if(b=b.getCommentById(this.commentId)){var c=a?this.newContents_:this.oldContents_;if(c===void 0){if(a)throw Error("The new contents is undefined. Either pass a value to the constructor, or call fromJson");throw Error("The old contents is undefined. Either pass a value to the constructor, or call fromJson");}b.setText(c)}else console.warn("Can't change non-existent comment: "+this.commentId)}};
1612
+ register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_CHANGE,CommentChange$$module$build$src$core$events$events_comment_change);var module$build$src$core$events$events_comment_change={};module$build$src$core$events$events_comment_change.CommentChange=CommentChange$$module$build$src$core$events$events_comment_change;var CommentCollapse$$module$build$src$core$events$events_comment_collapse=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a,b){super(a);this.newCollapsed=b;this.type=EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE}toJson(){const a=super.toJson();if(this.newCollapsed===void 0)throw Error("The new collapse value undefined. Either call recordNew, or call fromJson");a.newCollapsed=this.newCollapsed;return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,
1607
1613
  b,c!=null?c:new CommentCollapse$$module$build$src$core$events$events_comment_collapse);b.newCollapsed=a.newCollapsed;return b}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");(b=b.getCommentById(this.commentId))?b.setCollapsed(a?!!this.newCollapsed:!this.newCollapsed):console.warn("Can't collapse or uncollapse non-existent comment: "+this.commentId)}};
1608
1614
  register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_COLLAPSE,CommentCollapse$$module$build$src$core$events$events_comment_collapse);var module$build$src$core$events$events_comment_collapse={};module$build$src$core$events$events_comment_collapse.CommentCollapse=CommentCollapse$$module$build$src$core$events$events_comment_collapse;var CommentCreate$$module$build$src$core$events$events_comment_create=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_CREATE;a&&(this.xml=saveWorkspaceComment$$module$build$src$core$xml(a),this.json=save$$module$build$src$core$serialization$workspace_comments(a,{addCoordinates:!0}))}toJson(){const a=super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");
1609
- if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.json=this.json;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentCreate$$module$build$src$core$events$events_comment_create);b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml);b.json=a.json;return b}run(a){CommentBase$$module$build$src$core$events$events_comment_base.CommentCreateDeleteHelper(this,
1615
+ if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.json=this.json;return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentCreate$$module$build$src$core$events$events_comment_create);b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml);b.json=a.json;return b}run(a){CommentBase$$module$build$src$core$events$events_comment_base.CommentCreateDeleteHelper(this,
1610
1616
  a)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_CREATE,CommentCreate$$module$build$src$core$events$events_comment_create);var module$build$src$core$events$events_comment_create={};module$build$src$core$events$events_comment_create.CommentCreate=CommentCreate$$module$build$src$core$events$events_comment_create;var CommentDelete$$module$build$src$core$events$events_comment_delete=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_DELETE;a&&(this.xml=saveWorkspaceComment$$module$build$src$core$xml(a),this.json=save$$module$build$src$core$serialization$workspace_comments(a,{addCoordinates:!0}))}run(a){CommentBase$$module$build$src$core$events$events_comment_base.CommentCreateDeleteHelper(this,!a)}toJson(){const a=
1611
- super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.json=this.json;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentDelete$$module$build$src$core$events$events_comment_delete);b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml);
1612
- b.json=a.json;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_DELETE,CommentDelete$$module$build$src$core$events$events_comment_delete);var module$build$src$core$events$events_comment_delete={};module$build$src$core$events$events_comment_delete.CommentDelete=CommentDelete$$module$build$src$core$events$events_comment_delete;var CommentDrag$$module$build$src$core$events$events_comment_drag=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(a?a.workspace.id:void 0);this.type=EventType$$module$build$src$core$events$type.COMMENT_DRAG;a&&(this.commentId=a.id,this.isStart=b)}toJson(){const a=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1613
- a.isStart=this.isStart;a.commentId=this.commentId;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentDrag$$module$build$src$core$events$events_comment_drag);b.isStart=a.isStart;b.commentId=a.commentId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_DRAG,CommentDrag$$module$build$src$core$events$events_comment_drag);var module$build$src$core$events$events_comment_drag={};
1614
- module$build$src$core$events$events_comment_drag.CommentDrag=CommentDrag$$module$build$src$core$events$events_comment_drag;var CommentMove$$module$build$src$core$events$events_comment_move=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_MOVE;a&&(this.comment_=a,this.oldCoordinate_=a.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");
1615
- this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(a){this.reason=a}setOldCoordinate(a){this.oldCoordinate_=a}toJson(){const a=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");a.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, `+`${Math.round(this.oldCoordinate_.y)}`;
1616
- a.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y);return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentMove$$module$build$src$core$events$events_comment_move);c=a.oldCoordinate.split(",");b.oldCoordinate_=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1]));c=a.newCoordinate.split(",");b.newCoordinate_=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1]));return b}isNull(){return Coordinate$$module$build$src$core$utils$coordinate.equals(this.oldCoordinate_,
1617
- this.newCoordinate_)}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(b=b.getCommentById(this.commentId)){a=a?this.newCoordinate_:this.oldCoordinate_;if(!a)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");b.moveTo(a)}else console.warn("Can't move non-existent comment: "+this.commentId)}};
1618
- register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_MOVE,CommentMove$$module$build$src$core$events$events_comment_move);var module$build$src$core$events$events_comment_move={};module$build$src$core$events$events_comment_move.CommentMove=CommentMove$$module$build$src$core$events$events_comment_move;var CommentResize$$module$build$src$core$events$events_comment_resize=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_RESIZE;a&&(this.oldSize=a.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var a=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1617
+ super.toJson();if(!this.xml)throw Error("The comment XML is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.json)throw Error("The comment JSON is undefined. Either pass a block to the constructor, or call fromJson");a.xml=domToText$$module$build$src$core$xml(this.xml);a.json=this.json;return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentDelete$$module$build$src$core$events$events_comment_delete);
1618
+ b.xml=$.textToDom$$module$build$src$core$utils$xml(a.xml);b.json=a.json;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_DELETE,CommentDelete$$module$build$src$core$events$events_comment_delete);var module$build$src$core$events$events_comment_delete={};module$build$src$core$events$events_comment_delete.CommentDelete=CommentDelete$$module$build$src$core$events$events_comment_delete;var CommentDrag$$module$build$src$core$events$events_comment_drag=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b){super(a?a.workspace.id:void 0);this.type=EventType$$module$build$src$core$events$type.COMMENT_DRAG;a&&(this.commentId=a.id,this.isStart=b)}toJson(){const a=super.toJson();if(this.isStart===void 0)throw Error("Whether this event is the start of a drag is undefined. Either pass the value to the constructor, or call fromJson");if(this.commentId===void 0)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1619
+ a.isStart=this.isStart;a.commentId=this.commentId;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new CommentDrag$$module$build$src$core$events$events_comment_drag);b.isStart=a.isStart;b.commentId=a.commentId;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_DRAG,CommentDrag$$module$build$src$core$events$events_comment_drag);
1620
+ var module$build$src$core$events$events_comment_drag={};module$build$src$core$events$events_comment_drag.CommentDrag=CommentDrag$$module$build$src$core$events$events_comment_drag;var CommentMove$$module$build$src$core$events$events_comment_move=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_MOVE;a&&(this.comment_=a,this.oldCoordinate_=a.getRelativeToSurfaceXY())}recordNew(){if(this.newCoordinate_)throw Error("Tried to record the new position of a comment on the same event twice.");if(!this.comment_)throw Error("The comment is undefined. Pass a comment to the constructor if you want to use the record functionality");
1621
+ this.newCoordinate_=this.comment_.getRelativeToSurfaceXY()}setReason(a){this.reason=a}setOldCoordinate(a){this.oldCoordinate_=a}toJson(){const a=super.toJson();if(!this.oldCoordinate_)throw Error("The old comment position is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newCoordinate_)throw Error("The new comment position is undefined. Either call recordNew, or call fromJson");a.oldCoordinate=`${Math.round(this.oldCoordinate_.x)}, ${Math.round(this.oldCoordinate_.y)}`;
1622
+ a.newCoordinate=Math.round(this.newCoordinate_.x)+","+Math.round(this.newCoordinate_.y);return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentMove$$module$build$src$core$events$events_comment_move);c=a.oldCoordinate.split(",");b.oldCoordinate_=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),Number(c[1]));c=a.newCoordinate.split(",");b.newCoordinate_=new Coordinate$$module$build$src$core$utils$coordinate(Number(c[0]),
1623
+ Number(c[1]));return b}isNull(){return Coordinate$$module$build$src$core$utils$coordinate.equals(this.oldCoordinate_,this.newCoordinate_)}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(b=b.getCommentById(this.commentId)){a=a?this.newCoordinate_:this.oldCoordinate_;if(!a)throw Error("Either oldCoordinate_ or newCoordinate_ is undefined. Either pass a comment to the constructor and call recordNew, or call fromJson");
1624
+ b.moveTo(a)}else console.warn("Can't move non-existent comment: "+this.commentId)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_MOVE,CommentMove$$module$build$src$core$events$events_comment_move);var module$build$src$core$events$events_comment_move={};module$build$src$core$events$events_comment_move.CommentMove=CommentMove$$module$build$src$core$events$events_comment_move;var CommentResize$$module$build$src$core$events$events_comment_resize=class extends CommentBase$$module$build$src$core$events$events_comment_base{constructor(a){super(a);this.type=EventType$$module$build$src$core$events$type.COMMENT_RESIZE;a&&(this.oldSize=a.getSize())}recordCurrentSizeAsNewSize(){if(this.newSize)throw Error("Tried to record the new size of a comment on the same event twice.");var a=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");
1619
1625
  a=a.getCommentById(this.commentId);if(!a)throw Error("The comment associated with the comment resize event could not be found");this.newSize=a.getSize()}toJson(){const a=super.toJson();if(!this.oldSize)throw Error("The old comment size is undefined. Either pass a comment to the constructor, or call fromJson");if(!this.newSize)throw Error("The new comment size is undefined. Either call recordCurrentSizeAsNewSize, or call fromJson");a.oldWidth=Math.round(this.oldSize.width);a.oldHeight=Math.round(this.oldSize.height);
1620
- a.newWidth=Math.round(this.newSize.width);a.newHeight=Math.round(this.newSize.height);return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new CommentResize$$module$build$src$core$events$events_comment_resize);b.oldSize=new Size$$module$build$src$core$utils$size(a.oldWidth,a.oldHeight);b.newSize=new Size$$module$build$src$core$utils$size(a.newWidth,a.newHeight);return b}isNull(){return Size$$module$build$src$core$utils$size.equals(this.oldSize,this.newSize)}run(a){var b=this.getEventWorkspace_();
1621
- if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(b=b.getCommentById(this.commentId)){a=a?this.newSize:this.oldSize;if(!a)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");b.setSize(a)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};
1622
- register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_RESIZE,CommentResize$$module$build$src$core$events$events_comment_resize);var module$build$src$core$events$events_comment_resize={};module$build$src$core$events$events_comment_resize.CommentResize=CommentResize$$module$build$src$core$events$events_comment_resize;var ToolboxItemSelect$$module$build$src$core$events$events_toolbox_item_select=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(c);this.type=EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT;this.oldItem=a!=null?a:void 0;this.newItem=b!=null?b:void 0}toJson(){const a=super.toJson();a.oldItem=this.oldItem;a.newItem=this.newItem;return a}static fromJson(a,b,c){b=super.fromJson(a,b,c!=null?c:new ToolboxItemSelect$$module$build$src$core$events$events_toolbox_item_select);
1626
+ a.newWidth=Math.round(this.newSize.width);a.newHeight=Math.round(this.newSize.height);return a}static fromJson(a,b,c){b=CommentBase$$module$build$src$core$events$events_comment_base.fromJson(a,b,c!=null?c:new CommentResize$$module$build$src$core$events$events_comment_resize);b.oldSize=new Size$$module$build$src$core$utils$size(a.oldWidth,a.oldHeight);b.newSize=new Size$$module$build$src$core$utils$size(a.newWidth,a.newHeight);return b}isNull(){return Size$$module$build$src$core$utils$size.equals(this.oldSize,
1627
+ this.newSize)}run(a){var b=this.getEventWorkspace_();if(!this.commentId)throw Error("The comment ID is undefined. Either pass a comment to the constructor, or call fromJson");if(b=b.getCommentById(this.commentId)){a=a?this.newSize:this.oldSize;if(!a)throw Error("Either oldSize or newSize is undefined. Either pass a comment to the constructor and call recordCurrentSizeAsNewSize, or call fromJson");b.setSize(a)}else console.warn("Can't resize non-existent comment: "+this.commentId)}};
1628
+ register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.COMMENT_RESIZE,CommentResize$$module$build$src$core$events$events_comment_resize);var module$build$src$core$events$events_comment_resize={};module$build$src$core$events$events_comment_resize.CommentResize=CommentResize$$module$build$src$core$events$events_comment_resize;var ToolboxItemSelect$$module$build$src$core$events$events_toolbox_item_select=class extends UiBase$$module$build$src$core$events$events_ui_base{constructor(a,b,c){super(c);this.type=EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT;this.oldItem=a!=null?a:void 0;this.newItem=b!=null?b:void 0}toJson(){const a=super.toJson();a.oldItem=this.oldItem;a.newItem=this.newItem;return a}static fromJson(a,b,c){b=UiBase$$module$build$src$core$events$events_ui_base.fromJson(a,b,c!=null?c:new ToolboxItemSelect$$module$build$src$core$events$events_toolbox_item_select);
1623
1629
  b.oldItem=a.oldItem;b.newItem=a.newItem;return b}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.TOOLBOX_ITEM_SELECT,ToolboxItemSelect$$module$build$src$core$events$events_toolbox_item_select);var module$build$src$core$events$events_toolbox_item_select={};module$build$src$core$events$events_toolbox_item_select.ToolboxItemSelect=ToolboxItemSelect$$module$build$src$core$events$events_toolbox_item_select;var VarTypeChange$$module$build$src$core$events$events_var_type_change=class extends VarBase$$module$build$src$core$events$events_var_base{constructor(a,b,c){super(a);this.oldType=b;this.newType=c;this.type=EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE}toJson(){const a=super.toJson();if(!this.oldType||!this.newType)throw Error("The variable's types are undefined. Either pass them to the constructor, or call fromJson");a.oldType=this.oldType;a.newType=this.newType;return a}static fromJson(a,
1624
- b,c){b=super.fromJson(a,b,c!=null?c:new VarTypeChange$$module$build$src$core$events$events_var_type_change);b.oldType=a.oldType;b.newType=a.newType;return b}run(a){const 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.oldType||!this.newType)throw Error("The variable's types are undefined. Either pass them to the constructor, or call fromJson");const c=b.getVariableMap().getVariableById(this.varId);
1625
- c&&(a?b.getVariableMap().changeVariableType(c,this.newType):b.getVariableMap().changeVariableType(c,this.oldType))}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE,VarTypeChange$$module$build$src$core$events$events_var_type_change);var module$build$src$core$events$events_var_type_change={};module$build$src$core$events$events_var_type_change.VarTypeChange=VarTypeChange$$module$build$src$core$events$events_var_type_change;var FinishedLoading$$module$build$src$core$events$workspace_events=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!0;this.recordUndo=!1;this.type=EventType$$module$build$src$core$events$type.FINISHED_LOADING;this.isBlank=!!a;a&&(this.workspaceId=a.id)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.FINISHED_LOADING,FinishedLoading$$module$build$src$core$events$workspace_events);
1630
+ b,c){b=VarBase$$module$build$src$core$events$events_var_base.fromJson(a,b,c!=null?c:new VarTypeChange$$module$build$src$core$events$events_var_type_change);b.oldType=a.oldType;b.newType=a.newType;return b}run(a){const 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.oldType||!this.newType)throw Error("The variable's types are undefined. Either pass them to the constructor, or call fromJson");const c=
1631
+ b.getVariableMap().getVariableById(this.varId);c&&(a?b.getVariableMap().changeVariableType(c,this.newType):b.getVariableMap().changeVariableType(c,this.oldType))}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.VAR_TYPE_CHANGE,VarTypeChange$$module$build$src$core$events$events_var_type_change);var module$build$src$core$events$events_var_type_change={};
1632
+ module$build$src$core$events$events_var_type_change.VarTypeChange=VarTypeChange$$module$build$src$core$events$events_var_type_change;var FinishedLoading$$module$build$src$core$events$workspace_events=class extends Abstract$$module$build$src$core$events$events_abstract{constructor(a){super();this.isBlank=!0;this.recordUndo=!1;this.type=EventType$$module$build$src$core$events$type.FINISHED_LOADING;this.isBlank=!!a;a&&(this.workspaceId=a.id)}};register$$module$build$src$core$registry(Type$$module$build$src$core$registry.EVENT,EventType$$module$build$src$core$events$type.FINISHED_LOADING,FinishedLoading$$module$build$src$core$events$workspace_events);
1626
1633
  var module$build$src$core$events$workspace_events={};module$build$src$core$events$workspace_events.FinishedLoading=FinishedLoading$$module$build$src$core$events$workspace_events;var BLOCK_DRAG$$module$build$src$core$events$events,BLOCK_FIELD_INTERMEDIATE_CHANGE$$module$build$src$core$events$events,BUBBLE_OPEN$$module$build$src$core$events$events,CHANGE$$module$build$src$core$events$events,CLICK$$module$build$src$core$events$events,COMMENT_CHANGE$$module$build$src$core$events$events,COMMENT_CREATE$$module$build$src$core$events$events,COMMENT_DELETE$$module$build$src$core$events$events,COMMENT_MOVE$$module$build$src$core$events$events,COMMENT_RESIZE$$module$build$src$core$events$events,
1627
1634
  COMMENT_DRAG$$module$build$src$core$events$events,CREATE$$module$build$src$core$events$events,DELETE$$module$build$src$core$events$events,FINISHED_LOADING$$module$build$src$core$events$events,MOVE$$module$build$src$core$events$events,SELECTED$$module$build$src$core$events$events,THEME_CHANGE$$module$build$src$core$events$events,TOOLBOX_ITEM_SELECT$$module$build$src$core$events$events,TRASHCAN_OPEN$$module$build$src$core$events$events,UI$$module$build$src$core$events$events,VAR_CREATE$$module$build$src$core$events$events,
1628
1635
  VAR_DELETE$$module$build$src$core$events$events,VAR_RENAME$$module$build$src$core$events$events,VIEWPORT_CHANGE$$module$build$src$core$events$events,module$build$src$core$events$events;$.BLOCK_CHANGE$$module$build$src$core$events$events=EventType$$module$build$src$core$events$type.BLOCK_CHANGE;$.BLOCK_CREATE$$module$build$src$core$events$events=EventType$$module$build$src$core$events$type.BLOCK_CREATE;$.BLOCK_DELETE$$module$build$src$core$events$events=EventType$$module$build$src$core$events$type.BLOCK_DELETE;
@@ -1700,9 +1707,9 @@ Types$$module$build$src$core$renderers$measurables$types.isIcon(b)?(c+=b.height/
1700
1707
  (e.hasStatement&&this.alignStatementRow_(e),c&&c.hasStatement&&e.width<c.width?b.set(e,c.width):a=e.hasStatement?e.width:Math.max(a,e.width),c=e);a=0;for(let d=0,e;e=this.rows[d];d++)e.hasStatement?a=this.getDesiredRowWidth_(e):Types$$module$build$src$core$renderers$measurables$types.isSpacer(e)?e.width=Math.max(a,b.get(e)):(c=e.width,a=Math.max(a,b.get(e))-c,a>0&&this.addAlignmentPadding_(e,a),a=e.width)}else super.alignRowElements_()}getDesiredRowWidth_(a){return this.isInline&&a.hasStatement?this.statementEdge+
1701
1708
  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<this.constants_.MIN_BLOCK_HEIGHT&&(c=this.constants_.MIN_BLOCK_HEIGHT-c,this.bottomRow.height+=c,b+=c);this.recordElemPositions_(e)}this.outputConnection&&this.block_.nextConnection&&this.block_.nextConnection.isConnected()&&(c=this.block_.nextConnection.targetBlock())&&
1702
1709
  (a=Math.max(a,c.getHeightWidth().width-this.constants_.DARK_PATH_OFFSET));this.bottomRow.baseline=b-this.bottomRow.descenderHeight;this.widthWithChildren=a+this.startX+this.constants_.DARK_PATH_OFFSET;this.width+=this.constants_.DARK_PATH_OFFSET;this.height=b+this.constants_.DARK_PATH_OFFSET;this.startY=this.topRow.capline}},module$build$src$core$renderers$geras$info={};module$build$src$core$renderers$geras$info.RenderInfo=RenderInfo$$module$build$src$core$renderers$geras$info;var PathObject$$module$build$src$core$renderers$geras$path_object=class extends PathObject$$module$build$src$core$renderers$common$path_object{constructor(a,b,c){super(a,b,c);this.constants=c;this.colourDark="#000000";this.svgPathDark=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,{"class":"blocklyPathDark",transform:"translate(1,1)"});this.svgRoot.insertBefore(this.svgPathDark,this.svgPath);this.svgPathLight=createSvgElement$$module$build$src$core$utils$dom(Svg$$module$build$src$core$utils$svg.PATH,
1703
- {"class":"blocklyPathLight"},this.svgRoot)}setPath(a){this.svgPath.setAttribute("d",a);this.svgPathDark.setAttribute("d",a)}setHighlightPath(a){this.svgPathLight.setAttribute("d",a)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)");this.svgPathLight.setAttribute("transform","scale(-1 1)");this.svgPathDark.setAttribute("transform","translate(1,1) scale(-1 1)")}applyColour(a){this.svgPathLight.style.display="";this.svgPathDark.style.display="";if(!this.style.colourTertiary)throw Error("The renderer did not properly initialize the tertiary colour of the block style");
1704
- this.svgPathLight.setAttribute("stroke",this.style.colourTertiary);this.svgPathDark.setAttribute("fill",this.colourDark);super.applyColour(a);this.svgPath.setAttribute("stroke","none")}setStyle(a){this.style=a;this.colourDark=blend$$module$build$src$core$utils$colour("#000",this.style.colourPrimary,.2)||this.colourDark}updateHighlighted(a){super.updateHighlighted(a);this.svgPathLight.style.display=a?"none":"inline"}updateShadow_(a){if(a){this.svgPathLight.style.display="none";if(!this.style.colourSecondary)throw Error("The renderer did not properly initialize the secondary colour of the block style block style");
1705
- this.svgPathDark.setAttribute("fill",this.style.colourSecondary);this.svgPath.setAttribute("stroke","none");this.svgPath.setAttribute("fill",this.style.colourSecondary)}}updateDisabled_(a){super.updateDisabled_(a);a&&this.svgPath.setAttribute("stroke","none")}},module$build$src$core$renderers$geras$path_object={};module$build$src$core$renderers$geras$path_object.PathObject=PathObject$$module$build$src$core$renderers$geras$path_object;var Renderer$$module$build$src$core$renderers$geras$renderer=class extends Renderer$$module$build$src$core$renderers$common$renderer{constructor(a){super(a);this.highlightConstants=null}init(a,b){super.init(a,b);this.highlightConstants=this.makeHighlightConstants_();this.highlightConstants.init()}refreshDom(a,b,c){super.refreshDom(a,b,c);this.getHighlightConstants().init()}makeConstants_(){return new ConstantProvider$$module$build$src$core$renderers$geras$constants}makeRenderInfo_(a){return new RenderInfo$$module$build$src$core$renderers$geras$info(this,
1710
+ {"class":"blocklyPathLight"},this.svgRoot)}setPath(a){this.svgPath.setAttribute("d",a);this.svgPathDark.setAttribute("d",a)}setHighlightPath(a){this.svgPathLight.setAttribute("d",a)}flipRTL(){this.svgPath.setAttribute("transform","scale(-1 1)");this.svgPathLight.setAttribute("transform","scale(-1 1)");this.svgPathDark.setAttribute("transform","translate(1,1) scale(-1 1)")}applyColour(a){this.svgPathLight.style.display="";this.svgPathDark.style.display="";this.svgPathLight.setAttribute("stroke",this.style.colourTertiary);
1711
+ this.svgPathDark.setAttribute("fill",this.colourDark);super.applyColour(a);this.svgPath.setAttribute("stroke","none")}setStyle(a){this.style=a;this.colourDark=blend$$module$build$src$core$utils$colour("#000",this.style.colourPrimary,.2)||this.colourDark}updateHighlighted(a){super.updateHighlighted(a);this.svgPathLight.style.display=a?"none":"inline"}updateShadow_(a){super.updateShadow_(a);a&&(this.svgPathLight.style.display="none",this.svgPathDark.setAttribute("fill",this.style.colourSecondary))}updateDisabled_(a){super.updateDisabled_(a);
1712
+ a&&this.svgPath.setAttribute("stroke","none")}},module$build$src$core$renderers$geras$path_object={};module$build$src$core$renderers$geras$path_object.PathObject=PathObject$$module$build$src$core$renderers$geras$path_object;var Renderer$$module$build$src$core$renderers$geras$renderer=class extends Renderer$$module$build$src$core$renderers$common$renderer{constructor(a){super(a);this.highlightConstants=null}init(a,b){super.init(a,b);this.highlightConstants=this.makeHighlightConstants_();this.highlightConstants.init()}refreshDom(a,b,c){super.refreshDom(a,b,c);this.getHighlightConstants().init()}makeConstants_(){return new ConstantProvider$$module$build$src$core$renderers$geras$constants}makeRenderInfo_(a){return new RenderInfo$$module$build$src$core$renderers$geras$info(this,
1706
1713
  a)}makeDrawer_(a,b){return new Drawer$$module$build$src$core$renderers$geras$drawer(a,b)}makePathObject(a,b){return new PathObject$$module$build$src$core$renderers$geras$path_object(a,b,this.getConstants())}makeHighlightConstants_(){return new HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight_constants(this.getConstants())}getHighlightConstants(){if(!this.highlightConstants)throw Error("Cannot access the highlight constants because init has not been called");return this.highlightConstants}};
1707
1714
  register$$module$build$src$core$renderers$common$block_rendering("geras",Renderer$$module$build$src$core$renderers$geras$renderer);var module$build$src$core$renderers$geras$renderer={};module$build$src$core$renderers$geras$renderer.Renderer=Renderer$$module$build$src$core$renderers$geras$renderer;var module$build$src$core$renderers$geras$geras={};module$build$src$core$renderers$geras$geras.ConstantProvider=ConstantProvider$$module$build$src$core$renderers$geras$constants;module$build$src$core$renderers$geras$geras.Drawer=Drawer$$module$build$src$core$renderers$geras$drawer;module$build$src$core$renderers$geras$geras.HighlightConstantProvider=HighlightConstantProvider$$module$build$src$core$renderers$geras$highlight_constants;module$build$src$core$renderers$geras$geras.Highlighter=Highlighter$$module$build$src$core$renderers$geras$highlighter;
1708
1715
  module$build$src$core$renderers$geras$geras.InlineInput=InlineInput$$module$build$src$core$renderers$geras$measurables$inline_input;module$build$src$core$renderers$geras$geras.PathObject=PathObject$$module$build$src$core$renderers$geras$path_object;module$build$src$core$renderers$geras$geras.RenderInfo=RenderInfo$$module$build$src$core$renderers$geras$info;module$build$src$core$renderers$geras$geras.Renderer=Renderer$$module$build$src$core$renderers$geras$renderer;
@@ -1747,19 +1754,19 @@ this.htmlDiv_.appendChild(this.subcategoriesDiv_);this.closeIcon_(this.iconDom_)
1747
1754
  b.style.display="none";var c=this.cssConfig_.contents;c&&addClass$$module$build$src$core$utils$dom(b,c);for(c=0;c<a.length;c++){const d=a[c];d.init();const e=d.getDiv();b.appendChild(e);if(d.getClickTarget){let f;(f=d.getClickTarget())==null||f.setAttribute("id",d.getId())}}return b}setExpanded(a){if(this.expanded_!==a){if(this.expanded_=a)this.subcategoriesDiv_.style.display="block",this.openIcon_(this.iconDom_);else{let b;(b=this.parentToolbox_.getFlyout())==null||b.setVisible(!1);this.subcategoriesDiv_.style.display=
1748
1755
  "none";this.closeIcon_(this.iconDom_)}setState$$module$build$src$core$utils$aria(this.htmlDiv_,State$$module$build$src$core$utils$aria.EXPANDED,a);this.parentToolbox_.handleToolboxItemResize()}}setVisible_(a){this.htmlDiv_.style.display=a?"block":"none";const b=this.getChildToolboxItems();for(let c=0;c<b.length;c++)b[c].setVisible_(a);this.isHidden_=!a;this.parentToolbox_.getSelectedItem()===this&&this.parentToolbox_.clearSelection()}isExpanded(){return this.expanded_}isCollapsible(){return!0}onClick(a){this.toggleExpanded()}toggleExpanded(){this.setExpanded(!this.expanded_)}getDiv(){return this.htmlDiv_}getChildToolboxItems(){return this.toolboxItems_}};
1749
1756
  CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName="collapsibleCategory";register$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName,CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category);var module$build$src$core$toolbox$collapsible_category={};
1750
- module$build$src$core$toolbox$collapsible_category.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;var module$build$src$core$interfaces$i_selectable_toolbox_item={};module$build$src$core$interfaces$i_selectable_toolbox_item.isSelectableToolboxItem=isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item;var Toolbox$$module$build$src$core$toolbox$toolbox=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.id="toolbox";this.contentsDiv_=this.HtmlDiv=null;this.isVisible_=!1;this.height_=this.width_=0;this.flyout=null;this.contents=new Map;this.previouslySelectedItem_=this.selectedItem_=null;this.boundEvents_=[];this.workspace_=a;this.toolboxDef_=a.options.languageTree||{contents:[]};this.horizontalLayout=a.options.horizontalLayout;this.RTL=a.options.RTL;this.toolboxPosition=
1751
- a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_;const b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);const c=this.flyout.createDom("svg");addClass$$module$build$src$core$utils$dom(c,"blocklyToolboxFlyout");insertAfter$$module$build$src$core$utils$dom(c,b);this.setVisible(!0);this.flyout.init(a);this.render(this.toolboxDef_);a=a.getThemeManager();a.subscribe(this.HtmlDiv,"toolboxBackgroundColour","background-color");a.subscribe(this.HtmlDiv,
1752
- "toolboxForegroundColour","color");this.workspace_.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TOOLBOX_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]});$.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,
1753
- !0)}createDom_(a){a=a.getParentSvg();const b=this.createContainer_();b.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.contentsDiv_=this.createContentsContainer_();setRole$$module$build$src$core$utils$aria(this.contentsDiv_,Role$$module$build$src$core$utils$aria.TREE);b.appendChild(this.contentsDiv_);a.parentNode.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b}createContainer_(){const a=document.createElement("div");a.setAttribute("layout",this.isHorizontal()?
1754
- "h":"v");addClass$$module$build$src$core$utils$dom(a,"blocklyToolbox");a.setAttribute("dir",this.RTL?"RTL":"LTR");return a}createContentsContainer_(){const a=document.createElement("div");addClass$$module$build$src$core$utils$dom(a,"blocklyToolboxCategoryGroup");this.isHorizontal()&&(a.style.flexDirection="row");return a}attachEvents_(a,b){a=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onClick_,!1);this.boundEvents_.push(a);b=conditionalBind$$module$build$src$core$browser_events(b,
1755
- "keydown",this,this.onKeyDown_,!1);this.boundEvents_.push(b)}onClick_(a){if(isRightButton$$module$build$src$core$browser_events(a)||a.target===this.HtmlDiv)getMainWorkspace$$module$build$src$core$common().hideChaff(!1);else{var b=a.target.getAttribute("id");b&&(b=this.getToolboxItemById(b),b.isSelectable()&&(this.setSelectedItem(b),b.onClick(a)));getMainWorkspace$$module$build$src$core$common().hideChaff(!0)}clearTouchIdentifier$$module$build$src$core$touch()}onKeyDown_(a){let b=!1;switch(a.key){case "ArrowDown":b=
1756
- this.selectNext();break;case "ArrowUp":b=this.selectPrevious();break;case "ArrowLeft":b=this.selectParent();break;case "ArrowRight":b=this.selectChild();break;case "Enter":case " ":this.selectedItem_&&this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),b=!0);break;default:b=!1}!b&&this.selectedItem_&&this.selectedItem_.onKeyDown&&(b=this.selectedItem_.onKeyDown(a));b&&a.preventDefault()}createFlyout_(){const a=this.workspace_,b=a.copyOptionsForFlyout();b.toolboxPosition=a.options.toolboxPosition;
1757
- return new (a.horizontalLayout?getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,a.options,!0):getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,a.options,!0))(b)}render(a){this.toolboxDef_=a;this.contents.forEach(b=>b.dispose());this.contents.clear();this.renderContents_(a.contents);this.position();this.handleToolboxItemResize()}renderContents_(a){const b=document.createDocumentFragment();
1758
- for(let c=0;c<a.length;c++)this.createToolboxItem(a[c],b);this.contentsDiv_.appendChild(b)}createToolboxItem(a,b){var c=a.kind;c.toUpperCase()==="CATEGORY"&&isCategoryCollapsible$$module$build$src$core$utils$toolbox(a)&&(c=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName);if(c=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,c.toLowerCase()))a=new c(a,this),a.init(),this.addToolboxItem_(a),(c=a.getDiv())&&b.appendChild(c),
1759
- a.getClickTarget()&&a.getClickTarget().setAttribute("id",a.getId())}addToolboxItem_(a){this.contents.set(a.getId(),a);if(a.isCollapsible()){a=a.getChildToolboxItems();for(let b=0;b<a.length;b++)this.addToolboxItem_(a[b])}}getToolboxItems(){return[...this.contents.values()]}addStyle(a){a&&this.HtmlDiv&&addClass$$module$build$src$core$utils$dom(this.HtmlDiv,a)}removeStyle(a){a&&this.HtmlDiv&&removeClass$$module$build$src$core$utils$dom(this.HtmlDiv,a)}getClientRect(){if(!this.HtmlDiv||!this.isVisible_)return null;
1760
- var a=this.HtmlDiv.getBoundingClientRect();const b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?new Rect$$module$build$src$core$utils$rect(-1E7,c,-1E7,1E7):this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.BOTTOM?new Rect$$module$build$src$core$utils$rect(b,1E7,-1E7,1E7):this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.LEFT?new Rect$$module$build$src$core$utils$rect(-1E7,1E7,-1E7,a):new Rect$$module$build$src$core$utils$rect(-1E7,
1761
- 1E7,d,1E7)}wouldDelete(a){a instanceof BlockSvg$$module$build$src$core$block_svg?this.updateWouldDelete_(!a.getParent()&&a.isDeletable()):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}onDragEnter(a){this.updateCursorDeleteStyle_(!0)}onDragExit(a){this.updateCursorDeleteStyle_(!1)}onDrop(a){this.updateCursorDeleteStyle_(!1)}updateWouldDelete_(a){a!==this.wouldDelete_&&(this.updateCursorDeleteStyle_(!1),this.wouldDelete_=
1762
- a,this.updateCursorDeleteStyle_(!0))}updateCursorDeleteStyle_(a){const b=this.wouldDelete_?"blocklyToolboxDelete":"blocklyToolboxGrab";a?this.addStyle(b):this.removeStyle(b)}getToolboxItemById(a){return this.contents.get(a)||null}getWidth(){return this.width_}getHeight(){return this.height_}getFlyout(){return this.flyout}getWorkspace(){return this.workspace_}getSelectedItem(){return this.selectedItem_}getPreviouslySelectedItem(){return this.previouslySelectedItem_}isHorizontal(){return this.horizontalLayout}position(){const a=
1757
+ module$build$src$core$toolbox$collapsible_category.CollapsibleToolboxCategory=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category;var module$build$src$core$interfaces$i_selectable_toolbox_item={};module$build$src$core$interfaces$i_selectable_toolbox_item.isSelectableToolboxItem=isSelectableToolboxItem$$module$build$src$core$interfaces$i_selectable_toolbox_item;var Toolbox$$module$build$src$core$toolbox$toolbox=class extends DeleteArea$$module$build$src$core$delete_area{constructor(a){super();this.id="toolbox";this.contentsDiv_=this.HtmlDiv=null;this.isVisible_=!1;this.height_=this.width_=0;this.flyout=null;this.contents=new Map;this.previouslySelectedItem_=this.selectedItem_=null;this.boundEvents_=[];this.mouseDown=!1;this.workspace_=a;this.toolboxDef_=a.options.languageTree||{contents:[]};this.horizontalLayout=a.options.horizontalLayout;this.RTL=a.options.RTL;
1758
+ this.toolboxPosition=a.options.toolboxPosition}onShortcut(a){return!1}init(){var a=this.workspace_;const b=a.getParentSvg();this.flyout=this.createFlyout_();this.HtmlDiv=this.createDom_(this.workspace_);const c=this.flyout.createDom("svg");addClass$$module$build$src$core$utils$dom(c,"blocklyToolboxFlyout");insertAfter$$module$build$src$core$utils$dom(c,b);this.setVisible(!0);this.flyout.init(a);this.render(this.toolboxDef_);a=a.getThemeManager();a.subscribe(this.HtmlDiv,"toolboxBackgroundColour",
1759
+ "background-color");a.subscribe(this.HtmlDiv,"toolboxForegroundColour","color");this.workspace_.getComponentManager().addComponent({component:this,weight:ComponentManager$$module$build$src$core$component_manager.ComponentWeight.TOOLBOX_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]});
1760
+ $.getFocusManager$$module$build$src$core$focus_manager().registerTree(this,!0)}createDom_(a){a=a.getParentSvg();const b=this.createContainer_();b.id=getNextUniqueId$$module$build$src$core$utils$idgenerator();this.contentsDiv_=this.createContentsContainer_();setRole$$module$build$src$core$utils$aria(this.contentsDiv_,Role$$module$build$src$core$utils$aria.TREE);b.appendChild(this.contentsDiv_);a.parentNode.insertBefore(b,a);this.attachEvents_(b,this.contentsDiv_);return b}createContainer_(){const a=
1761
+ document.createElement("div");a.setAttribute("layout",this.isHorizontal()?"h":"v");addClass$$module$build$src$core$utils$dom(a,"blocklyToolbox");a.setAttribute("dir",this.RTL?"RTL":"LTR");return a}createContentsContainer_(){const a=document.createElement("div");addClass$$module$build$src$core$utils$dom(a,"blocklyToolboxCategoryGroup");this.isHorizontal()&&(a.style.flexDirection="row");return a}attachEvents_(a,b){const c=conditionalBind$$module$build$src$core$browser_events(a,"pointerdown",this,this.onClick_,
1762
+ !1);this.boundEvents_.push(c);a=bind$$module$build$src$core$browser_events(a,"pointerup",this,()=>{this.mouseDown=!1});this.boundEvents_.push(a);b=conditionalBind$$module$build$src$core$browser_events(b,"keydown",this,this.onKeyDown_,!1);this.boundEvents_.push(b)}onClick_(a){this.mouseDown=!0;if(isRightButton$$module$build$src$core$browser_events(a)||a.target===this.HtmlDiv)getMainWorkspace$$module$build$src$core$common().hideChaff(!1);else{var b=a.target.getAttribute("id");b&&(b=this.getToolboxItemById(b),
1763
+ b.isSelectable()&&(this.setSelectedItem(b),b.onClick(a)));getMainWorkspace$$module$build$src$core$common().hideChaff(!0)}clearTouchIdentifier$$module$build$src$core$touch()}onKeyDown_(a){let b=!1;switch(a.key){case "ArrowDown":b=this.selectNext();break;case "ArrowUp":b=this.selectPrevious();break;case "ArrowLeft":b=this.selectParent();break;case "ArrowRight":b=this.selectChild();break;case "Enter":case " ":this.selectedItem_&&this.selectedItem_.isCollapsible()&&(this.selectedItem_.toggleExpanded(),
1764
+ b=!0);break;default:b=!1}!b&&this.selectedItem_&&this.selectedItem_.onKeyDown&&(b=this.selectedItem_.onKeyDown(a));b&&a.preventDefault()}createFlyout_(){const a=this.workspace_,b=a.copyOptionsForFlyout();b.toolboxPosition=a.options.toolboxPosition;return new (a.horizontalLayout?getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_HORIZONTAL_TOOLBOX,a.options,!0):getClassFromOptions$$module$build$src$core$registry(Type$$module$build$src$core$registry.FLYOUTS_VERTICAL_TOOLBOX,
1765
+ a.options,!0))(b)}render(a){this.toolboxDef_=a;this.contents.forEach(b=>b.dispose());this.contents.clear();this.renderContents_(a.contents);this.position();this.handleToolboxItemResize()}renderContents_(a){const b=document.createDocumentFragment();for(let c=0;c<a.length;c++)this.createToolboxItem(a[c],b);this.contentsDiv_.appendChild(b)}createToolboxItem(a,b){var c=a.kind;c.toUpperCase()==="CATEGORY"&&isCategoryCollapsible$$module$build$src$core$utils$toolbox(a)&&(c=CollapsibleToolboxCategory$$module$build$src$core$toolbox$collapsible_category.registrationName);
1766
+ if(c=getClass$$module$build$src$core$registry(Type$$module$build$src$core$registry.TOOLBOX_ITEM,c.toLowerCase()))a=new c(a,this),a.init(),this.addToolboxItem_(a),(c=a.getDiv())&&b.appendChild(c),a.getClickTarget()&&a.getClickTarget().setAttribute("id",a.getId())}addToolboxItem_(a){this.contents.set(a.getId(),a);if(a.isCollapsible()){a=a.getChildToolboxItems();for(let b=0;b<a.length;b++)this.addToolboxItem_(a[b])}}getToolboxItems(){return[...this.contents.values()]}addStyle(a){a&&this.HtmlDiv&&addClass$$module$build$src$core$utils$dom(this.HtmlDiv,
1767
+ a)}removeStyle(a){a&&this.HtmlDiv&&removeClass$$module$build$src$core$utils$dom(this.HtmlDiv,a)}getClientRect(){if(!this.HtmlDiv||!this.isVisible_)return null;var a=this.HtmlDiv.getBoundingClientRect();const b=a.top,c=b+a.height,d=a.left;a=d+a.width;return this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?new Rect$$module$build$src$core$utils$rect(-1E7,c,-1E7,1E7):this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.BOTTOM?new Rect$$module$build$src$core$utils$rect(b,
1768
+ 1E7,-1E7,1E7):this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.LEFT?new Rect$$module$build$src$core$utils$rect(-1E7,1E7,-1E7,a):new Rect$$module$build$src$core$utils$rect(-1E7,1E7,d,1E7)}wouldDelete(a){a instanceof BlockSvg$$module$build$src$core$block_svg?this.updateWouldDelete_(!a.getParent()&&a.isDeletable()):this.updateWouldDelete_(isDeletable$$module$build$src$core$interfaces$i_deletable(a)&&a.isDeletable());return this.wouldDelete_}onDragEnter(a){this.updateCursorDeleteStyle_(!0)}onDragExit(a){this.updateCursorDeleteStyle_(!1)}onDrop(a){this.updateCursorDeleteStyle_(!1)}updateWouldDelete_(a){a!==
1769
+ this.wouldDelete_&&(this.updateCursorDeleteStyle_(!1),this.wouldDelete_=a,this.updateCursorDeleteStyle_(!0))}updateCursorDeleteStyle_(a){const b=this.wouldDelete_?"blocklyToolboxDelete":"blocklyToolboxGrab";a?this.addStyle(b):this.removeStyle(b)}getToolboxItemById(a){return this.contents.get(a)||null}getWidth(){return this.width_}getHeight(){return this.height_}getFlyout(){return this.flyout}getWorkspace(){return this.workspace_}getSelectedItem(){return this.selectedItem_}getPreviouslySelectedItem(){return this.previouslySelectedItem_}isHorizontal(){return this.horizontalLayout}position(){const a=
1763
1770
  this.workspace_.getMetrics(),b=this.HtmlDiv;b&&(this.horizontalLayout?(b.style.left="0",b.style.height="auto",b.style.width="100%",this.height_=b.offsetHeight,this.width_=a.viewWidth,this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?b.style.top="0":b.style.bottom="0"):(this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.RIGHT?b.style.right="0":b.style.left="0",b.style.height="100%",this.width_=b.offsetWidth,this.height_=a.viewHeight),this.flyout.position())}handleToolboxItemResize(){const a=
1764
1771
  this.workspace_;var b=this.HtmlDiv.getBoundingClientRect();const c=this.getFlyout(),d=this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.LEFT?a.scrollX+b.width+((c==null?0:c.isVisible())?c.getWidth():0):a.scrollX;b=this.toolboxPosition===Position$$module$build$src$core$utils$toolbox.TOP?a.scrollY+b.height+((c==null?0:c.isVisible())?c.getHeight():0):a.scrollY;a.translate(d,b);svgResize$$module$build$src$core$common(a)}clearSelection(){this.setSelectedItem(null)}refreshTheme(){this.contents.forEach(a=>
1765
1772
  {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)||
@@ -1769,8 +1776,8 @@ a===b&&(d=null);a=new (get$$module$build$src$core$events$utils(EventType$$module
1769
1776
  !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<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[++b];if(c&&c.isSelectable())return this.setSelectedItem(c),!0}return!1}selectPrevious(){if(!this.selectedItem_)return!1;const a=[...this.contents.values()];let b=a.indexOf(this.selectedItem_)-
1770
1777
  1;if(b>-1&&b<a.length){let c=a[b];for(;c&&!c.isSelectable();)c=a[--b];if(c&&c.isSelectable())return this.setSelectedItem(c),!0}return!1}dispose(){this.workspace_.getComponentManager().removeComponent("toolbox");this.flyout.dispose();this.contents.forEach(a=>a.dispose());for(let a=0;a<this.boundEvents_.length;a++)unbind$$module$build$src$core$browser_events(this.boundEvents_[a]);this.boundEvents_=[];this.contents.clear();this.HtmlDiv&&(this.workspace_.getThemeManager().unsubscribe(this.HtmlDiv),removeNode$$module$build$src$core$utils$dom(this.HtmlDiv));
1771
1778
  $.getFocusManager$$module$build$src$core$focus_manager().unregisterTree(this)}getFocusableElement(){if(!this.HtmlDiv)throw Error("Toolbox DOM has not yet been created.");return this.HtmlDiv}getFocusableTree(){return this}onNodeFocus(){}onNodeBlur(){}canBeFocused(){return!0}getRootFocusableNode(){return this}getRestoredFocusableNode(a){if(!a||a===this){let b;return(b=this.getToolboxItems().find(c=>c.isSelectable()))!=null?b:null}return null}getNestedTrees(){return[]}lookUpFocusableNode(a){return this.getToolboxItemById(a)}onTreeFocus(a,
1772
- 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("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n 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');
1773
- 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,
1779
+ b){a!==this?this.getSelectedItem()===a||this.mouseDown||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("<<<PATH>>>/handdelete.cur"), auto;\n}\n\n.blocklyToolboxGrab {\n cursor: url("<<<PATH>>>/handclosed.cur"), auto;\n cursor: grabbing;\n cursor: -webkit-grabbing;\n}\n\n/* Category tree in Toolbox. */\n.blocklyToolbox {\n 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');
1780
+ 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.4.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,
1774
1781
  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=
1775
1782
  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,
1776
1783
  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,
@@ -1806,7 +1813,7 @@ module$build$src$core$blockly.isCopyable=isCopyable$$module$build$src$core$inter
1806
1813
  module$build$src$core$blockly.isPaster=isPaster$$module$build$src$core$interfaces$i_paster;module$build$src$core$blockly.isRenderedElement=isRenderedElement$$module$build$src$core$interfaces$i_rendered_element;module$build$src$core$blockly.isSelectable=isSelectable$$module$build$src$core$interfaces$i_selectable;module$build$src$core$blockly.isSerializable=isSerializable$$module$build$src$core$interfaces$i_serializable;module$build$src$core$blockly.isVariableBackedParameterModel=isVariableBackedParameterModel$$module$build$src$core$interfaces$i_variable_backed_parameter_model;
1807
1814
  module$build$src$core$blockly.keyboardNavigationController=keyboardNavigationController$$module$build$src$core$keyboard_navigation_controller;module$build$src$core$blockly.layers=module$build$src$core$layers;module$build$src$core$blockly.navigateBlock=navigateBlock$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$blockly.navigateStacks=navigateStacks$$module$build$src$core$keyboard_nav$block_navigation_policy;module$build$src$core$blockly.procedures=module$build$src$core$procedures;
1808
1815
  module$build$src$core$blockly.registry=module$build$src$core$registry;module$build$src$core$blockly.renderManagement=module$build$src$core$render_management;module$build$src$core$blockly.serialization=module$build$src$core$serialization;module$build$src$core$blockly.setLocale=setLocale$$module$build$src$core$msg;module$build$src$core$blockly.setParentContainer=setParentContainer$$module$build$src$core$common;module$build$src$core$blockly.svgResize=svgResize$$module$build$src$core$common;
1809
- module$build$src$core$blockly.thrasos=module$build$src$core$renderers$thrasos$thrasos;module$build$src$core$blockly.uiPosition=module$build$src$core$positionable_helpers;module$build$src$core$blockly.utils=module$build$src$core$utils;module$build$src$core$blockly.zelos=module$build$src$core$renderers$zelos$zelos;var module$build$src$core$utils$metrics={};var module$build$src$core$renderers$common$i_path_object={};var module$build$src$core$interfaces$i_variable_model={};var module$build$src$core$interfaces$i_variable_map={};var module$build$src$core$interfaces$i_toolbox_item={};var module$build$src$core$interfaces$i_toolbox={};var module$build$src$core$interfaces$i_styleable={};var module$build$src$core$interfaces$i_serializer={};var module$build$src$core$interfaces$i_registrable={};var module$build$src$core$interfaces$i_procedure_model={};var module$build$src$core$interfaces$i_procedure_map={};var module$build$src$core$interfaces$i_positionable={};var module$build$src$core$interfaces$i_parameter_model={};var module$build$src$core$interfaces$i_movable={};var module$build$src$core$interfaces$i_metrics_manager={};var module$build$src$core$interfaces$i_keyboard_accessible={};var module$build$src$core$interfaces$i_focusable_tree={};module$build$src$core$interfaces$i_focusable_tree.isFocusableTree=isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree;var module$build$src$core$interfaces$i_flyout_inflater={};var module$build$src$core$interfaces$i_flyout={};var module$build$src$core$interfaces$i_dragger={};var module$build$src$core$interfaces$i_drag_target={};var module$build$src$core$interfaces$i_delete_area={};var module$build$src$core$interfaces$i_contextmenu={};var module$build$src$core$interfaces$i_connection_previewer={};var module$build$src$core$interfaces$i_connection_checker={};var module$build$src$core$interfaces$i_component={};var module$build$src$core$interfaces$i_collapsible_toolbox_item={};var module$build$src$core$interfaces$i_bubble={};var module$build$src$core$interfaces$i_bounded_element={};
1816
+ module$build$src$core$blockly.thrasos=module$build$src$core$renderers$thrasos$thrasos;module$build$src$core$blockly.uiPosition=module$build$src$core$positionable_helpers;module$build$src$core$blockly.utils=module$build$src$core$utils;module$build$src$core$blockly.zelos=module$build$src$core$renderers$zelos$zelos;var module$build$src$core$utils$metrics={};var module$build$src$core$renderers$common$i_path_object={};var module$build$src$core$interfaces$i_variable_model={};var module$build$src$core$interfaces$i_variable_map={};var module$build$src$core$interfaces$i_toolbox_item={};var module$build$src$core$interfaces$i_toolbox={};var module$build$src$core$interfaces$i_styleable={};var module$build$src$core$interfaces$i_serializer={};var module$build$src$core$interfaces$i_registrable={};var module$build$src$core$interfaces$i_procedure_model={};var module$build$src$core$interfaces$i_procedure_map={};var module$build$src$core$interfaces$i_positionable={};var module$build$src$core$interfaces$i_parameter_model={};var module$build$src$core$interfaces$i_movable={};var module$build$src$core$interfaces$i_metrics_manager={};var module$build$src$core$interfaces$i_keyboard_accessible={};var module$build$src$core$interfaces$i_focusable_tree={};module$build$src$core$interfaces$i_focusable_tree.isFocusableTree=isFocusableTree$$module$build$src$core$interfaces$i_focusable_tree;var module$build$src$core$interfaces$i_flyout_inflater={};var module$build$src$core$interfaces$i_flyout={};var module$build$src$core$interfaces$i_dragger={};var module$build$src$core$interfaces$i_drag_target={};var module$build$src$core$interfaces$i_delete_area={};var module$build$src$core$interfaces$i_connection_previewer={};var module$build$src$core$interfaces$i_connection_checker={};var module$build$src$core$interfaces$i_component={};var module$build$src$core$interfaces$i_collapsible_toolbox_item={};var module$build$src$core$interfaces$i_bubble={};var module$build$src$core$interfaces$i_bounded_element={};
1810
1817
  module$build$src$core$blockly.__namespace__=$;
1811
1818
  return module$build$src$core$blockly;
1812
1819
  }));
@@ -1861,21 +1868,21 @@ Blockly.Msg["COLOUR_RGB_RED"] = "red";
1861
1868
  Blockly.Msg["COLOUR_RGB_TITLE"] = "colour with";
1862
1869
  Blockly.Msg["COLOUR_RGB_TOOLTIP"] = "Create a colour with the specified amount of red, green, and blue. All values must be between 0 and 100.";
1863
1870
  Blockly.Msg["COMMAND_KEY"] = "⌘ Command";
1864
- Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#loop-termination-blocks";
1871
+ Blockly.Msg["CONTROLS_FLOW_STATEMENTS_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#loop-termination-blocks";
1865
1872
  Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_BREAK"] = "break out of loop";
1866
1873
  Blockly.Msg["CONTROLS_FLOW_STATEMENTS_OPERATOR_CONTINUE"] = "continue with next iteration of loop";
1867
1874
  Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_BREAK"] = "Break out of the containing loop.";
1868
1875
  Blockly.Msg["CONTROLS_FLOW_STATEMENTS_TOOLTIP_CONTINUE"] = "Skip the rest of this loop, and continue with the next iteration.";
1869
1876
  Blockly.Msg["CONTROLS_FLOW_STATEMENTS_WARNING"] = "Warning: This block may only be used within a loop.";
1870
- Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#for-each";
1877
+ Blockly.Msg["CONTROLS_FOREACH_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#for-each";
1871
1878
  Blockly.Msg["CONTROLS_FOREACH_TITLE"] = "for each item %1 in list %2";
1872
1879
  Blockly.Msg["CONTROLS_FOREACH_TOOLTIP"] = "For each item in a list, set the variable '%1' to the item, and then do some statements.";
1873
- Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#count-with";
1880
+ Blockly.Msg["CONTROLS_FOR_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#count-with";
1874
1881
  Blockly.Msg["CONTROLS_FOR_TITLE"] = "count with %1 from %2 to %3 by %4";
1875
1882
  Blockly.Msg["CONTROLS_FOR_TOOLTIP"] = "Have the variable '%1' take on the values from the start number to the end number, counting by the specified interval, and do the specified blocks.";
1876
1883
  Blockly.Msg["CONTROLS_IF_ELSEIF_TOOLTIP"] = "Add a condition to the if block.";
1877
1884
  Blockly.Msg["CONTROLS_IF_ELSE_TOOLTIP"] = "Add a final, catch-all condition to the if block.";
1878
- Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/google/blockly/wiki/IfElse";
1885
+ Blockly.Msg["CONTROLS_IF_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/IfElse";
1879
1886
  Blockly.Msg["CONTROLS_IF_IF_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this if block.";
1880
1887
  Blockly.Msg["CONTROLS_IF_MSG_ELSE"] = "else";
1881
1888
  Blockly.Msg["CONTROLS_IF_MSG_ELSEIF"] = "else if";
@@ -1888,7 +1895,7 @@ Blockly.Msg["CONTROLS_REPEAT_HELPURL"] = "https://en.wikipedia.org/wiki/For_loop
1888
1895
  Blockly.Msg["CONTROLS_REPEAT_INPUT_DO"] = "do";
1889
1896
  Blockly.Msg["CONTROLS_REPEAT_TITLE"] = "repeat %1 times";
1890
1897
  Blockly.Msg["CONTROLS_REPEAT_TOOLTIP"] = "Do some statements several times.";
1891
- Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/google/blockly/wiki/Loops#repeat";
1898
+ Blockly.Msg["CONTROLS_WHILEUNTIL_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Loops#repeat";
1892
1899
  Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_UNTIL"] = "repeat until";
1893
1900
  Blockly.Msg["CONTROLS_WHILEUNTIL_OPERATOR_WHILE"] = "repeat while";
1894
1901
  Blockly.Msg["CONTROLS_WHILEUNTIL_TOOLTIP_UNTIL"] = "While a value is false, then do some statements.";
@@ -1919,12 +1926,12 @@ Blockly.Msg["KEYBOARD_NAV_COPIED_HINT"] = "Copied. Press %1 to paste.";
1919
1926
  Blockly.Msg["KEYBOARD_NAV_CUT_HINT"] = "Cut. Press %1 to paste.";
1920
1927
  Blockly.Msg["KEYBOARD_NAV_UNCONSTRAINED_MOVE_HINT"] = "Hold %1 and use arrow keys to move freely, then %2 to accept the position";
1921
1928
  Blockly.Msg["LINUX"] = "Linux";
1922
- Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-empty-list";
1929
+ Blockly.Msg["LISTS_CREATE_EMPTY_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-empty-list";
1923
1930
  Blockly.Msg["LISTS_CREATE_EMPTY_TITLE"] = "create empty list";
1924
1931
  Blockly.Msg["LISTS_CREATE_EMPTY_TOOLTIP"] = "Returns a list, of length 0, containing no data records";
1925
1932
  Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TITLE_ADD"] = "list";
1926
1933
  Blockly.Msg["LISTS_CREATE_WITH_CONTAINER_TOOLTIP"] = "Add, remove, or reorder sections to reconfigure this list block.";
1927
- Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
1934
+ Blockly.Msg["LISTS_CREATE_WITH_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with";
1928
1935
  Blockly.Msg["LISTS_CREATE_WITH_INPUT_WITH"] = "create list with";
1929
1936
  Blockly.Msg["LISTS_CREATE_WITH_ITEM_TOOLTIP"] = "Add an item to the list.";
1930
1937
  Blockly.Msg["LISTS_CREATE_WITH_TOOLTIP"] = "Create a list with any number of items.";
@@ -1933,7 +1940,7 @@ Blockly.Msg["LISTS_GET_INDEX_FROM_END"] = "# from end";
1933
1940
  Blockly.Msg["LISTS_GET_INDEX_FROM_START"] = "#";
1934
1941
  Blockly.Msg["LISTS_GET_INDEX_GET"] = "get";
1935
1942
  Blockly.Msg["LISTS_GET_INDEX_GET_REMOVE"] = "get and remove";
1936
- Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-items-from-a-list";
1943
+ Blockly.Msg["LISTS_GET_INDEX_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-items-from-a-list";
1937
1944
  Blockly.Msg["LISTS_GET_INDEX_LAST"] = "last";
1938
1945
  Blockly.Msg["LISTS_GET_INDEX_RANDOM"] = "random";
1939
1946
  Blockly.Msg["LISTS_GET_INDEX_REMOVE"] = "remove";
@@ -1953,7 +1960,7 @@ Blockly.Msg["LISTS_GET_INDEX_TOOLTIP_REMOVE_RANDOM"] = "Removes a random item in
1953
1960
  Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_END"] = "to # from end";
1954
1961
  Blockly.Msg["LISTS_GET_SUBLIST_END_FROM_START"] = "to #";
1955
1962
  Blockly.Msg["LISTS_GET_SUBLIST_END_LAST"] = "to last";
1956
- Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#getting-a-sublist";
1963
+ Blockly.Msg["LISTS_GET_SUBLIST_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#getting-a-sublist";
1957
1964
  Blockly.Msg["LISTS_GET_SUBLIST_START_FIRST"] = "get sub-list from first";
1958
1965
  Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_END"] = "get sub-list from # from end";
1959
1966
  Blockly.Msg["LISTS_GET_SUBLIST_START_FROM_START"] = "get sub-list from #";
@@ -1962,23 +1969,23 @@ Blockly.Msg["LISTS_GET_SUBLIST_TOOLTIP"] = "Creates a copy of the specified port
1962
1969
  Blockly.Msg["LISTS_INDEX_FROM_END_TOOLTIP"] = "%1 is the last item.";
1963
1970
  Blockly.Msg["LISTS_INDEX_FROM_START_TOOLTIP"] = "%1 is the first item.";
1964
1971
  Blockly.Msg["LISTS_INDEX_OF_FIRST"] = "find first occurrence of item";
1965
- Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#finding-items-in-a-list";
1972
+ Blockly.Msg["LISTS_INDEX_OF_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#finding-items-in-a-list";
1966
1973
  Blockly.Msg["LISTS_INDEX_OF_LAST"] = "find last occurrence of item";
1967
1974
  Blockly.Msg["LISTS_INDEX_OF_TOOLTIP"] = "Returns the index of the first/last occurrence of the item in the list. Returns %1 if item is not found.";
1968
1975
  Blockly.Msg["LISTS_INLIST"] = "in list";
1969
- Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#is-empty";
1976
+ Blockly.Msg["LISTS_ISEMPTY_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#is-empty";
1970
1977
  Blockly.Msg["LISTS_ISEMPTY_TITLE"] = "%1 is empty";
1971
1978
  Blockly.Msg["LISTS_ISEMPTY_TOOLTIP"] = "Returns true if the list is empty.";
1972
- Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#length-of";
1979
+ Blockly.Msg["LISTS_LENGTH_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#length-of";
1973
1980
  Blockly.Msg["LISTS_LENGTH_TITLE"] = "length of %1";
1974
1981
  Blockly.Msg["LISTS_LENGTH_TOOLTIP"] = "Returns the length of a list.";
1975
- Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#create-list-with";
1982
+ Blockly.Msg["LISTS_REPEAT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#create-list-with";
1976
1983
  Blockly.Msg["LISTS_REPEAT_TITLE"] = "create list with item %1 repeated %2 times";
1977
1984
  Blockly.Msg["LISTS_REPEAT_TOOLTIP"] = "Creates a list consisting of the given value repeated the specified number of times.";
1978
- Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#reversing-a-list";
1985
+ Blockly.Msg["LISTS_REVERSE_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#reversing-a-list";
1979
1986
  Blockly.Msg["LISTS_REVERSE_MESSAGE0"] = "reverse %1";
1980
1987
  Blockly.Msg["LISTS_REVERSE_TOOLTIP"] = "Reverse a copy of a list.";
1981
- Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#in-list--set";
1988
+ Blockly.Msg["LISTS_SET_INDEX_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#in-list--set";
1982
1989
  Blockly.Msg["LISTS_SET_INDEX_INPUT_TO"] = "as";
1983
1990
  Blockly.Msg["LISTS_SET_INDEX_INSERT"] = "insert at";
1984
1991
  Blockly.Msg["LISTS_SET_INDEX_SET"] = "set";
@@ -1990,7 +1997,7 @@ Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FIRST"] = "Sets the first item in a lis
1990
1997
  Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_FROM"] = "Sets the item at the specified position in a list.";
1991
1998
  Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_LAST"] = "Sets the last item in a list.";
1992
1999
  Blockly.Msg["LISTS_SET_INDEX_TOOLTIP_SET_RANDOM"] = "Sets a random item in a list.";
1993
- Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#sorting-a-list";
2000
+ Blockly.Msg["LISTS_SORT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#sorting-a-list";
1994
2001
  Blockly.Msg["LISTS_SORT_ORDER_ASCENDING"] = "ascending";
1995
2002
  Blockly.Msg["LISTS_SORT_ORDER_DESCENDING"] = "descending";
1996
2003
  Blockly.Msg["LISTS_SORT_TITLE"] = "sort %1 %2 %3";
@@ -1998,14 +2005,14 @@ Blockly.Msg["LISTS_SORT_TOOLTIP"] = "Sort a copy of a list.";
1998
2005
  Blockly.Msg["LISTS_SORT_TYPE_IGNORECASE"] = "alphabetic, ignore case";
1999
2006
  Blockly.Msg["LISTS_SORT_TYPE_NUMERIC"] = "numeric";
2000
2007
  Blockly.Msg["LISTS_SORT_TYPE_TEXT"] = "alphabetic";
2001
- Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/google/blockly/wiki/Lists#splitting-strings-and-joining-lists";
2008
+ Blockly.Msg["LISTS_SPLIT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Lists#splitting-strings-and-joining-lists";
2002
2009
  Blockly.Msg["LISTS_SPLIT_LIST_FROM_TEXT"] = "make list from text";
2003
2010
  Blockly.Msg["LISTS_SPLIT_TEXT_FROM_LIST"] = "make text from list";
2004
2011
  Blockly.Msg["LISTS_SPLIT_TOOLTIP_JOIN"] = "Join a list of texts into one text, separated by a delimiter.";
2005
2012
  Blockly.Msg["LISTS_SPLIT_TOOLTIP_SPLIT"] = "Split text into a list of texts, breaking at each delimiter.";
2006
2013
  Blockly.Msg["LISTS_SPLIT_WITH_DELIMITER"] = "with delimiter";
2007
2014
  Blockly.Msg["LOGIC_BOOLEAN_FALSE"] = "false";
2008
- Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#values";
2015
+ Blockly.Msg["LOGIC_BOOLEAN_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#values";
2009
2016
  Blockly.Msg["LOGIC_BOOLEAN_TOOLTIP"] = "Returns either true or false.";
2010
2017
  Blockly.Msg["LOGIC_BOOLEAN_TRUE"] = "true";
2011
2018
  Blockly.Msg["LOGIC_COMPARE_HELPURL"] = "https://en.wikipedia.org/wiki/Inequality_(mathematics)";
@@ -2015,14 +2022,14 @@ Blockly.Msg["LOGIC_COMPARE_TOOLTIP_GTE"] = "Return true if the first input is gr
2015
2022
  Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LT"] = "Return true if the first input is smaller than the second input.";
2016
2023
  Blockly.Msg["LOGIC_COMPARE_TOOLTIP_LTE"] = "Return true if the first input is smaller than or equal to the second input.";
2017
2024
  Blockly.Msg["LOGIC_COMPARE_TOOLTIP_NEQ"] = "Return true if both inputs are not equal to each other.";
2018
- Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#not";
2025
+ Blockly.Msg["LOGIC_NEGATE_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#not";
2019
2026
  Blockly.Msg["LOGIC_NEGATE_TITLE"] = "not %1";
2020
2027
  Blockly.Msg["LOGIC_NEGATE_TOOLTIP"] = "Returns true if the input is false. Returns false if the input is true.";
2021
2028
  Blockly.Msg["LOGIC_NULL"] = "null";
2022
2029
  Blockly.Msg["LOGIC_NULL_HELPURL"] = "https://en.wikipedia.org/wiki/Nullable_type";
2023
2030
  Blockly.Msg["LOGIC_NULL_TOOLTIP"] = "Returns null.";
2024
2031
  Blockly.Msg["LOGIC_OPERATION_AND"] = "and";
2025
- Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/google/blockly/wiki/Logic#logical-operations";
2032
+ Blockly.Msg["LOGIC_OPERATION_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Logic#logical-operations";
2026
2033
  Blockly.Msg["LOGIC_OPERATION_OR"] = "or";
2027
2034
  Blockly.Msg["LOGIC_OPERATION_TOOLTIP_AND"] = "Return true if both inputs are true.";
2028
2035
  Blockly.Msg["LOGIC_OPERATION_TOOLTIP_OR"] = "Return true if at least one of the inputs is true.";
@@ -2162,10 +2169,10 @@ Blockly.Msg["RENAME_VARIABLE_TITLE"] = "Rename all '%1' variables to:";
2162
2169
  Blockly.Msg["SHORTCUTS_CODE_NAVIGATION"] = "Code navigation";
2163
2170
  Blockly.Msg["SHORTCUTS_EDITING"] = "Editing";
2164
2171
  Blockly.Msg["SHORTCUTS_GENERAL"] = "General";
2165
- Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
2172
+ Blockly.Msg["TEXT_APPEND_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification";
2166
2173
  Blockly.Msg["TEXT_APPEND_TITLE"] = "to %1 append text %2";
2167
2174
  Blockly.Msg["TEXT_APPEND_TOOLTIP"] = "Append some text to variable '%1'.";
2168
- Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#adjusting-text-case";
2175
+ Blockly.Msg["TEXT_CHANGECASE_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#adjusting-text-case";
2169
2176
  Blockly.Msg["TEXT_CHANGECASE_OPERATOR_LOWERCASE"] = "to lower case";
2170
2177
  Blockly.Msg["TEXT_CHANGECASE_OPERATOR_TITLECASE"] = "to Title Case";
2171
2178
  Blockly.Msg["TEXT_CHANGECASE_OPERATOR_UPPERCASE"] = "to UPPER CASE";
@@ -2173,13 +2180,13 @@ Blockly.Msg["TEXT_CHANGECASE_TOOLTIP"] = "Return a copy of the text in a differe
2173
2180
  Blockly.Msg["TEXT_CHARAT_FIRST"] = "get first letter";
2174
2181
  Blockly.Msg["TEXT_CHARAT_FROM_END"] = "get letter # from end";
2175
2182
  Blockly.Msg["TEXT_CHARAT_FROM_START"] = "get letter #";
2176
- Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-text";
2183
+ Blockly.Msg["TEXT_CHARAT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-text";
2177
2184
  Blockly.Msg["TEXT_CHARAT_LAST"] = "get last letter";
2178
2185
  Blockly.Msg["TEXT_CHARAT_RANDOM"] = "get random letter";
2179
2186
  Blockly.Msg["TEXT_CHARAT_TAIL"] = "";
2180
2187
  Blockly.Msg["TEXT_CHARAT_TITLE"] = "in text %1 %2";
2181
2188
  Blockly.Msg["TEXT_CHARAT_TOOLTIP"] = "Returns the letter at the specified position.";
2182
- Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#counting-substrings";
2189
+ Blockly.Msg["TEXT_COUNT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#counting-substrings";
2183
2190
  Blockly.Msg["TEXT_COUNT_MESSAGE0"] = "count %1 in %2";
2184
2191
  Blockly.Msg["TEXT_COUNT_TOOLTIP"] = "Count how many times some text occurs within some other text.";
2185
2192
  Blockly.Msg["TEXT_CREATE_JOIN_ITEM_TOOLTIP"] = "Add an item to the text.";
@@ -2188,44 +2195,44 @@ Blockly.Msg["TEXT_CREATE_JOIN_TOOLTIP"] = "Add, remove, or reorder sections to r
2188
2195
  Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_END"] = "to letter # from end";
2189
2196
  Blockly.Msg["TEXT_GET_SUBSTRING_END_FROM_START"] = "to letter #";
2190
2197
  Blockly.Msg["TEXT_GET_SUBSTRING_END_LAST"] = "to last letter";
2191
- Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/google/blockly/wiki/Text#extracting-a-region-of-text";
2198
+ Blockly.Msg["TEXT_GET_SUBSTRING_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#extracting-a-region-of-text";
2192
2199
  Blockly.Msg["TEXT_GET_SUBSTRING_INPUT_IN_TEXT"] = "in text";
2193
2200
  Blockly.Msg["TEXT_GET_SUBSTRING_START_FIRST"] = "get substring from first letter";
2194
2201
  Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_END"] = "get substring from letter # from end";
2195
2202
  Blockly.Msg["TEXT_GET_SUBSTRING_START_FROM_START"] = "get substring from letter #";
2196
2203
  Blockly.Msg["TEXT_GET_SUBSTRING_TAIL"] = "";
2197
2204
  Blockly.Msg["TEXT_GET_SUBSTRING_TOOLTIP"] = "Returns a specified portion of the text.";
2198
- Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/google/blockly/wiki/Text#finding-text";
2205
+ Blockly.Msg["TEXT_INDEXOF_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#finding-text";
2199
2206
  Blockly.Msg["TEXT_INDEXOF_OPERATOR_FIRST"] = "find first occurrence of text";
2200
2207
  Blockly.Msg["TEXT_INDEXOF_OPERATOR_LAST"] = "find last occurrence of text";
2201
2208
  Blockly.Msg["TEXT_INDEXOF_TITLE"] = "in text %1 %2 %3";
2202
2209
  Blockly.Msg["TEXT_INDEXOF_TOOLTIP"] = "Returns the index of the first/last occurrence of the first text in the second text. Returns %1 if text is not found.";
2203
- Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/google/blockly/wiki/Text#checking-for-empty-text";
2210
+ Blockly.Msg["TEXT_ISEMPTY_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#checking-for-empty-text";
2204
2211
  Blockly.Msg["TEXT_ISEMPTY_TITLE"] = "%1 is empty";
2205
2212
  Blockly.Msg["TEXT_ISEMPTY_TOOLTIP"] = "Returns true if the provided text is empty.";
2206
- Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-creation";
2213
+ Blockly.Msg["TEXT_JOIN_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-creation";
2207
2214
  Blockly.Msg["TEXT_JOIN_TITLE_CREATEWITH"] = "create text with";
2208
2215
  Blockly.Msg["TEXT_JOIN_TOOLTIP"] = "Create a piece of text by joining together any number of items.";
2209
- Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/google/blockly/wiki/Text#text-modification";
2216
+ Blockly.Msg["TEXT_LENGTH_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#text-modification";
2210
2217
  Blockly.Msg["TEXT_LENGTH_TITLE"] = "length of %1";
2211
2218
  Blockly.Msg["TEXT_LENGTH_TOOLTIP"] = "Returns the number of letters (including spaces) in the provided text.";
2212
- Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#printing-text";
2219
+ Blockly.Msg["TEXT_PRINT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#printing-text";
2213
2220
  Blockly.Msg["TEXT_PRINT_TITLE"] = "print %1";
2214
2221
  Blockly.Msg["TEXT_PRINT_TOOLTIP"] = "Print the specified text, number or other value.";
2215
- Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/google/blockly/wiki/Text#getting-input-from-the-user";
2222
+ Blockly.Msg["TEXT_PROMPT_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#getting-input-from-the-user";
2216
2223
  Blockly.Msg["TEXT_PROMPT_TOOLTIP_NUMBER"] = "Prompt for user for a number.";
2217
2224
  Blockly.Msg["TEXT_PROMPT_TOOLTIP_TEXT"] = "Prompt for user for some text.";
2218
2225
  Blockly.Msg["TEXT_PROMPT_TYPE_NUMBER"] = "prompt for number with message";
2219
2226
  Blockly.Msg["TEXT_PROMPT_TYPE_TEXT"] = "prompt for text with message";
2220
- Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#replacing-substrings";
2227
+ Blockly.Msg["TEXT_REPLACE_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#replacing-substrings";
2221
2228
  Blockly.Msg["TEXT_REPLACE_MESSAGE0"] = "replace %1 with %2 in %3";
2222
2229
  Blockly.Msg["TEXT_REPLACE_TOOLTIP"] = "Replace all occurances of some text within some other text.";
2223
- Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/google/blockly/wiki/Text#reversing-text";
2230
+ Blockly.Msg["TEXT_REVERSE_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#reversing-text";
2224
2231
  Blockly.Msg["TEXT_REVERSE_MESSAGE0"] = "reverse %1";
2225
2232
  Blockly.Msg["TEXT_REVERSE_TOOLTIP"] = "Reverses the order of the characters in the text.";
2226
2233
  Blockly.Msg["TEXT_TEXT_HELPURL"] = "https://en.wikipedia.org/wiki/String_(computer_science)";
2227
2234
  Blockly.Msg["TEXT_TEXT_TOOLTIP"] = "A letter, word, or line of text.";
2228
- Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/google/blockly/wiki/Text#trimming-removing-spaces";
2235
+ Blockly.Msg["TEXT_TRIM_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Text#trimming-removing-spaces";
2229
2236
  Blockly.Msg["TEXT_TRIM_OPERATOR_BOTH"] = "trim spaces from both sides of";
2230
2237
  Blockly.Msg["TEXT_TRIM_OPERATOR_LEFT"] = "trim spaces from left side of";
2231
2238
  Blockly.Msg["TEXT_TRIM_OPERATOR_RIGHT"] = "trim spaces from right side of";
@@ -2236,11 +2243,11 @@ Blockly.Msg["UNKNOWN"] = "Unknown";
2236
2243
  Blockly.Msg["UNNAMED_KEY"] = "unnamed";
2237
2244
  Blockly.Msg["VARIABLES_DEFAULT_NAME"] = "item";
2238
2245
  Blockly.Msg["VARIABLES_GET_CREATE_SET"] = "Create 'set %1'";
2239
- Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#get";
2246
+ Blockly.Msg["VARIABLES_GET_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#get";
2240
2247
  Blockly.Msg["VARIABLES_GET_TOOLTIP"] = "Returns the value of this variable.";
2241
2248
  Blockly.Msg["VARIABLES_SET"] = "set %1 to %2";
2242
2249
  Blockly.Msg["VARIABLES_SET_CREATE_GET"] = "Create 'get %1'";
2243
- Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/google/blockly/wiki/Variables#set";
2250
+ Blockly.Msg["VARIABLES_SET_HELPURL"] = "https://github.com/RaspberryPiFoundation/blockly/wiki/Variables#set";
2244
2251
  Blockly.Msg["VARIABLES_SET_TOOLTIP"] = "Sets this variable to be equal to the input.";
2245
2252
  Blockly.Msg["VARIABLE_ALREADY_EXISTS"] = "A variable named '%1' already exists.";
2246
2253
  Blockly.Msg["VARIABLE_ALREADY_EXISTS_FOR_ANOTHER_TYPE"] = "A variable named '%1' already exists for another type: '%2'.";
@@ -2343,11 +2350,12 @@ e.getId());a&&this.paramIds_&&d.setAttribute("paramId",this.paramIds_[c]);b.appe
2343
2350
  id:this.argumentVarModels_[b].getId()})}this.hasStatements_||(a.hasStatements=!1);return a},loadExtraState:function(a){this.arguments_=[];this.argumentVarModels_=[];if(a.params)for(let c=0;c<a.params.length;c++){var b=a.params[c];b=$.getOrCreateVariablePackage$$module$build$src$core$variables(this.workspace,b.id,b.name,"");this.arguments_.push(b.getName());this.argumentVarModels_.push(b)}this.updateParams_();$.mutateCallers$$module$build$src$core$procedures(this);this.setStatements_(a.hasStatements===
2344
2351
  !1?!1:!0)},decompose:function(a){const b=$.createElement$$module$build$src$core$utils$xml("block");b.setAttribute("type","procedures_mutatorcontainer");var c=$.createElement$$module$build$src$core$utils$xml("statement");c.setAttribute("name","STACK");b.appendChild(c);for(let e=0;e<this.arguments_.length;e++){const f=$.createElement$$module$build$src$core$utils$xml("block");f.setAttribute("type","procedures_mutatorarg");var d=$.createElement$$module$build$src$core$utils$xml("field");d.setAttribute("name",
2345
2352
  "NAME");const g=$.createTextNode$$module$build$src$core$utils$xml(this.arguments_[e]);d.appendChild(g);f.appendChild(d);d=$.createElement$$module$build$src$core$utils$xml("next");f.appendChild(d);c.appendChild(f);c=d}a=$.domToBlock$$module$build$src$core$xml(b,a);this.type==="procedures_defreturn"?a.setFieldValue(this.hasStatements_,"STATEMENTS"):a.removeInput("STATEMENT_INPUT");$.mutateCallers$$module$build$src$core$procedures(this);return a},compose:function(a){this.arguments_=[];this.paramIds_=
2346
- [];this.argumentVarModels_=[];let b=a.getInputTargetBlock("STACK");for(;b&&!b.isInsertionMarker();){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();$.mutateCallers$$module$build$src$core$procedures(this);a=a.getFieldValue("STATEMENTS");if(a!==null&&(a=a==="TRUE",this.hasStatements_!==a))if(a){this.setStatements_(!0);var d;(d=this.statementConnection_)==
2347
- null||d.reconnect(this,"STACK");this.statementConnection_=null}else{d=this.getInput("STACK").connection;if(this.statementConnection_=d.targetConnection)d=d.targetBlock(),d.unplug(),d.bumpNeighbours();this.setStatements_(!1)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(a,b){var c=this.workspace.getVariableById(a);if(c.getType()===""){c=c.getName();b=this.workspace.getVariableById(b);var d=!1;for(let e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()===
2348
- a&&(this.arguments_[e]=b.getName(),this.argumentVarModels_[e]=b,d=!0);d&&(this.displayRenamedVar_(c,b.getName()),$.mutateCallers$$module$build$src$core$procedures(this))}},updateVarName:function(a){const b=a.getName();let c=!1,d;for(let e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()===a.getId()&&(d=this.arguments_[e],this.arguments_[e]=b,c=!0);c&&(this.displayRenamedVar_(d,b),$.mutateCallers$$module$build$src$core$procedures(this))},displayRenamedVar_:function(a,b){this.updateParams_();
2349
- var c=this.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);if(c&&c.bubbleIsVisible()){c=c.getWorkspace().getAllBlocks(!1);for(let d=0,e;e=c[d];d++)e.type==="procedures_mutatorarg"&&$.Names$$module$build$src$core$names.equals(a,e.getFieldValue("NAME"))&&e.setFieldValue(b,"NAME")}},customContextMenu:function(a){if(!this.isInFlyout){var b=this.getFieldValue("NAME"),c={type:this.callType_,extraState:{name:b,params:this.arguments_}};a.push({enabled:!0,text:$.Msg$$module$build$src$core$msg.PROCEDURES_CREATE_DO.replace("%1",
2350
- b),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,c)});if(!this.isCollapsed())for(b=0;b<this.argumentVarModels_.length;b++){c=this.argumentVarModels_[b];const d={type:"variables_get",fields:{VAR:{name:c.getName(),id:c.getId(),type:c.getType()}}};a.push({enabled:!0,text:$.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",c.getName()),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,d)})}}}};
2353
+ [];this.argumentVarModels_=[];let b=a.getInputTargetBlock("STACK");for(;b&&!b.isInsertionMarker();){var c=b.getFieldValue("NAME");this.arguments_.push(c);c=this.workspace.getVariableMap().getVariable(c,"");this.argumentVarModels_.push(c);this.paramIds_.push(b.id);b=b.nextConnection&&b.nextConnection.targetBlock()}this.updateParams_();$.mutateCallers$$module$build$src$core$procedures(this);a=a.getFieldValue("STATEMENTS");if(a!==null&&(a=a==="TRUE",this.hasStatements_!==a))if(a){this.setStatements_(!0);
2354
+ var d;(d=this.statementConnection_)==null||d.reconnect(this,"STACK");this.statementConnection_=null}else{d=this.getInput("STACK").connection;if(this.statementConnection_=d.targetConnection)d=d.targetBlock(),d.unplug(),d.bumpNeighbours();this.setStatements_(!1)}},getVars:function(){return this.arguments_},getVarModels:function(){return this.argumentVarModels_},renameVarById:function(a,b){var c=this.workspace.getVariableMap().getVariableById(a);if(c.getType()===""){c=c.getName();b=this.workspace.getVariableMap().getVariableById(b);
2355
+ var d=!1;for(let e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()===a&&(this.arguments_[e]=b.getName(),this.argumentVarModels_[e]=b,d=!0);d&&(this.displayRenamedVar_(c,b.getName()),$.mutateCallers$$module$build$src$core$procedures(this))}},updateVarName:function(a){const b=a.getName();let c=!1,d;for(let e=0;e<this.argumentVarModels_.length;e++)this.argumentVarModels_[e].getId()===a.getId()&&(d=this.arguments_[e],this.arguments_[e]=b,c=!0);c&&(this.displayRenamedVar_(d,b),
2356
+ $.mutateCallers$$module$build$src$core$procedures(this))},displayRenamedVar_:function(a,b){this.updateParams_();var c=this.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE);if(c&&c.bubbleIsVisible()){c=c.getWorkspace().getAllBlocks(!1);for(let d=0,e;e=c[d];d++)e.type==="procedures_mutatorarg"&&$.Names$$module$build$src$core$names.equals(a,e.getFieldValue("NAME"))&&e.setFieldValue(b,"NAME")}},customContextMenu:function(a){if(!this.isInFlyout){var b=this.getFieldValue("NAME"),c=
2357
+ {type:this.callType_,extraState:{name:b,params:this.arguments_}};a.push({enabled:!0,text:$.Msg$$module$build$src$core$msg.PROCEDURES_CREATE_DO.replace("%1",b),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,c)});if(!this.isCollapsed())for(b=0;b<this.argumentVarModels_.length;b++){c=this.argumentVarModels_[b];const d={type:"variables_get",fields:{VAR:{name:c.getName(),id:c.getId(),type:c.getType()}}};a.push({enabled:!0,text:$.Msg$$module$build$src$core$msg.VARIABLES_SET_CREATE_GET.replace("%1",
2358
+ c.getName()),callback:$.callbackFactory$$module$build$src$core$contextmenu(this,d)})}}}};
2351
2359
  blocks$$module$build$src$blocks$procedures.procedures_defnoreturn=Object.assign({},PROCEDURE_DEF_COMMON$$module$build$src$blocks$procedures,{init:function(){var a=$.findLegalName$$module$build$src$core$procedures("",this);a=$.fromJson$$module$build$src$core$field_registry({type:"field_input",text:a});a.setValidator($.rename$$module$build$src$core$procedures);a.setSpellcheck(!1);this.appendDummyInput().appendField($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_TITLE).appendField(a,"NAME").appendField("",
2352
2360
  "PARAMS");this.setMutator(new $.MutatorIcon$$module$build$src$core$icons$mutator_icon(["procedures_mutatorarg"],this));(this.workspace.options.comments||this.workspace.options.parentWorkspace&&this.workspace.options.parentWorkspace.options.comments)&&$.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_COMMENT&&this.setCommentText($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_COMMENT);this.setStyle("procedure_blocks");this.setTooltip($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_TOOLTIP);
2353
2361
  this.setHelpUrl($.Msg$$module$build$src$core$msg.PROCEDURES_DEFNORETURN_HELPURL);this.arguments_=[];this.argumentVarModels_=[];this.setStatements_(!0);this.statementConnection_=null},getProcedureDef:function(){return[this.getFieldValue("NAME"),this.arguments_,!1]},callType_:"procedures_callnoreturn"});
@@ -2357,8 +2365,8 @@ this.setStyle("procedure_blocks");this.setTooltip($.Msg$$module$build$src$core$m
2357
2365
  var PROCEDURES_MUTATORCONTAINER$$module$build$src$blocks$procedures={init:function(){this.appendDummyInput().appendField($.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORCONTAINER_TITLE);this.appendStatementInput("STACK");this.appendDummyInput("STATEMENT_INPUT").appendField($.Msg$$module$build$src$core$msg.PROCEDURES_ALLOW_STATEMENTS).appendField($.fromJson$$module$build$src$core$field_registry({type:"field_checkbox",checked:!0}),"STATEMENTS");this.setStyle("procedure_blocks");this.setTooltip($.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORCONTAINER_TOOLTIP);
2358
2366
  this.contextMenu=!1}};blocks$$module$build$src$blocks$procedures.procedures_mutatorcontainer=PROCEDURES_MUTATORCONTAINER$$module$build$src$blocks$procedures;
2359
2367
  var ProcedureArgumentField$$module$build$src$blocks$procedures=class extends $.FieldTextInput$$module$build$src$core$field_textinput{constructor(){super(...arguments);this.editingInteractively=!1}showEditor_(a){super.showEditor_(a);this.editingInteractively=!0;this.editingVariable=void 0}onFinishEditing_(a){super.onFinishEditing_(a);this.editingInteractively=!1}},PROCEDURES_MUTATORARGUMENT$$module$build$src$blocks$procedures={init:function(){const a=new ProcedureArgumentField$$module$build$src$blocks$procedures($.DEFAULT_ARG$$module$build$src$core$procedures,
2360
- this.validator_);this.appendDummyInput().appendField($.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TITLE).appendField(a,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setTooltip($.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1},validator_:function(a){var b=this.getSourceBlock();const c=b.workspace.getRootWorkspace();a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"");if(!a)return null;const d=(b.workspace.targetWorkspace||
2361
- b.workspace).getAllBlocks(!1),e=a.toLowerCase();for(let f=0;f<d.length;f++){if(d[f].id===this.getSourceBlock().id)continue;const g=d[f].getFieldValue("NAME");if(g&&g.toLowerCase()===e)return null}if(b.isInFlyout)return a;(b=c.getVariable(a,""))&&b.getName()!==a&&c.renameVariableById(b.getId(),a);b||(this.editingInteractively?this.editingVariable?c.renameVariableById(this.editingVariable.getId(),a):this.editingVariable=c.createVariable(a,""):c.createVariable(a,""));return a}};
2368
+ this.validator_);this.appendDummyInput().appendField($.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TITLE).appendField(a,"NAME");this.setPreviousStatement(!0);this.setNextStatement(!0);this.setStyle("procedure_blocks");this.setTooltip($.Msg$$module$build$src$core$msg.PROCEDURES_MUTATORARG_TOOLTIP);this.contextMenu=!1},validator_:function(a){var b=this.getSourceBlock(),c=b.workspace.getRootWorkspace();a=a.replace(/[\s\xa0]+/g," ").replace(/^ | $/g,"");if(!a)return null;const d=(b.workspace.targetWorkspace||
2369
+ b.workspace).getAllBlocks(!1),e=a.toLowerCase();for(let f=0;f<d.length;f++){if(d[f].id===this.getSourceBlock().id)continue;const g=d[f].getFieldValue("NAME");if(g&&g.toLowerCase()===e)return null}if(b.isInFlyout)return a;b=c.getVariableMap();(c=b.getVariable(a,""))&&c.getName()!==a&&b.renameVariable(c,a);c||(this.editingInteractively?this.editingVariable?b.renameVariable(this.editingVariable,a):this.editingVariable=b.createVariable(a,""):b.createVariable(a,""));return a}};
2362
2370
  blocks$$module$build$src$blocks$procedures.procedures_mutatorarg=PROCEDURES_MUTATORARGUMENT$$module$build$src$blocks$procedures;
2363
2371
  var DISABLED_PROCEDURE_DEFINITION_DISABLED_REASON$$module$build$src$blocks$procedures="DISABLED_PROCEDURE_DEFINITION",PROCEDURE_CALL_COMMON$$module$build$src$blocks$procedures={getProcedureCall:function(){return this.getFieldValue("NAME")},renameProcedure:function(a,b){$.Names$$module$build$src$core$names.equals(a,this.getProcedureCall())&&(this.setFieldValue(b,"NAME"),this.setTooltip((this.outputConnection?$.Msg$$module$build$src$core$msg.PROCEDURES_CALLRETURN_TOOLTIP:$.Msg$$module$build$src$core$msg.PROCEDURES_CALLNORETURN_TOOLTIP).replace("%1",
2364
2372
  b)))},setProcedureParameters_:function(a,b){var c=$.getDefinition$$module$build$src$core$procedures(this.getProcedureCall(),this.workspace);(c=(c=c&&c.getIcon($.MutatorIcon$$module$build$src$core$icons$mutator_icon.TYPE))&&c.bubbleIsVisible())?this.setCollapsed(!1):(this.quarkConnections_={},this.quarkIds_=null);if(a.join("\n")===this.arguments_.join("\n"))this.quarkIds_=b;else{if(b.length!==a.length)throw RangeError("paramNames and paramIds must be the same length.");this.quarkIds_||(this.quarkConnections_=