2022-01-03 14:02:41 +00:00
// Do not edit this file; automatically generated.
2021-01-16 14:07:51 +00:00
/* eslint-disable */
; ( function ( root , factory ) {
if ( typeof define === 'function' && define . amd ) { // AMD
define ( [ ] , factory ) ;
} else if ( typeof exports === 'object' ) { // Node.js
module . exports = factory ( ) ;
} else { // Browser
root . Blockly = factory ( ) ;
}
} ( this , function ( ) {
2022-01-03 14:02:41 +00:00
const $ = { } ;
/ *
Copyright The Closure Library Authors .
SPDX - License - Identifier : Apache - 2.0
* /
var $jscomp = $jscomp || { } ; $jscomp . scope = { } ; $jscomp . createTemplateTagFirstArg = function ( a ) { return a . raw = a } ; $jscomp . createTemplateTagFirstArgWithRaw = function ( a , b ) { a . raw = b ; return a } ; $jscomp . arrayIteratorImpl = function ( a ) { var b = 0 ; return function ( ) { return b < a . length ? { done : ! 1 , value : a [ b ++ ] } : { done : ! 0 } } } ; $jscomp . arrayIterator = function ( a ) { return { next : $jscomp . arrayIteratorImpl ( a ) } } ; $jscomp . makeIterator = function ( a ) { var b = "undefined" != typeof Symbol && Symbol . iterator && a [ Symbol . iterator ] ; return b ? b . call ( a ) : $jscomp . arrayIterator ( a ) } ;
$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 ) ) } ; $jscomp . owns = function ( a , b ) { return Object . prototype . hasOwnProperty . call ( a , b ) } ; $jscomp . ASSUME _ES5 = ! 1 ; $jscomp . ASSUME _NO _NATIVE _MAP = ! 1 ; $jscomp . ASSUME _NO _NATIVE _SET = ! 1 ; $jscomp . SIMPLE _FROUND _POLYFILL = ! 1 ; $jscomp . ISOLATE _POLYFILLS = ! 1 ; $jscomp . FORCE _POLYFILL _PROMISE = ! 1 ;
$jscomp . FORCE _POLYFILL _PROMISE _WHEN _NO _UNHANDLED _REJECTION = ! 1 ; $jscomp . defineProperty = $jscomp . ASSUME _ES5 || "function" == typeof Object . defineProperties ? Object . defineProperty : function ( a , b , c ) { if ( a == Array . prototype || a == Object . prototype ) return a ; a [ b ] = c . value ; return a } ;
$jscomp . getGlobal = function ( a ) { a = [ "object" == typeof globalThis && globalThis , a , "object" == typeof window && window , "object" == typeof self && self , "object" == typeof global && global ] ; for ( var b = 0 ; b < a . length ; ++ b ) { var c = a [ b ] ; if ( c && c . Math == Math ) return c } throw Error ( "Cannot find global object" ) ; } ; $jscomp . global = $jscomp . getGlobal ( this ) ; $jscomp . IS _SYMBOL _NATIVE = "function" === typeof Symbol && "symbol" === typeof Symbol ( "x" ) ; $jscomp . TRUST _ES6 _POLYFILLS = ! $jscomp . ISOLATE _POLYFILLS || $jscomp . IS _SYMBOL _NATIVE ; $jscomp . polyfills = { } ;
$jscomp . propertyToPolyfillSymbol = { } ; $jscomp . POLYFILL _PREFIX = "$jscp$" ; var $jscomp$lookupPolyfilledValue = function ( a , b ) { var c = $jscomp . propertyToPolyfillSymbol [ b ] ; if ( null == c ) return a [ b ] ; c = a [ c ] ; return void 0 !== c ? 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 ) ) } ;
$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 && null != b && $jscomp . defineProperty ( c , a , { configurable : ! 0 , writable : ! 0 , value : b } ) } ;
$jscomp . polyfillIsolated = function ( a , b , c , d ) { var e = a . split ( "." ) ; a = 1 === e . length ; 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 && "es6" === c ? d [ e ] : null ; b = b ( c ) ; null != b && ( a ? $jscomp . defineProperty ( $jscomp . polyfills , e , { configurable : ! 0 , writable : ! 0 , value : b } ) : b !== c && ( void 0 === $jscomp . propertyToPolyfillSymbol [ e ] && ( c = 1E9 * Math . random ( ) >>> 0 , $jscomp . propertyToPolyfillSymbol [ e ] = $jscomp . IS _SYMBOL _NATIVE ?
$jscomp . global . Symbol ( e ) : $jscomp . POLYFILL _PREFIX + c + "$" + e ) , $jscomp . defineProperty ( d , $jscomp . propertyToPolyfillSymbol [ e ] , { configurable : ! 0 , writable : ! 0 , value : b } ) ) ) } ; $jscomp . assign = $jscomp . TRUST _ES6 _POLYFILLS && "function" == typeof Object . assign ? Object . assign : function ( a , b ) { for ( var c = 1 ; c < arguments . length ; c ++ ) { var d = arguments [ c ] ; if ( d ) for ( var e in d ) $jscomp . owns ( d , e ) && ( a [ e ] = d [ e ] ) } return a } ; $jscomp . polyfill ( "Object.assign" , function ( a ) { return a || $jscomp . assign } , "es6" , "es3" ) ;
$jscomp . objectCreate = $jscomp . ASSUME _ES5 || "function" == typeof Object . create ? Object . create : function ( a ) { var b = function ( ) { } ; b . prototype = a ; return new b } ;
$jscomp . getConstructImplementation = function ( ) { function a ( ) { function c ( ) { } new c ; Reflect . construct ( c , [ ] , function ( ) { } ) ; return new c instanceof c } if ( $jscomp . TRUST _ES6 _POLYFILLS && "undefined" != typeof Reflect && Reflect . construct ) { if ( a ( ) ) return Reflect . construct ; var b = Reflect . construct ; return function ( c , d , e ) { c = b ( c , d ) ; e && Reflect . setPrototypeOf ( c , e . prototype ) ; return c } } return function ( c , d , e ) { void 0 === e && ( e = c ) ; e = $jscomp . objectCreate ( e . prototype || Object . prototype ) ; return Function . prototype . apply . call ( c , e , d ) ||
e } } ; $jscomp . construct = { valueOf : $jscomp . getConstructImplementation } . valueOf ( ) ; $jscomp . underscoreProtoCanBeSet = function ( ) { var a = { a : ! 0 } , b = { } ; try { return b . _ _proto _ _ = a , b . a } catch ( c ) { } return ! 1 } ; $jscomp . setPrototypeOf = $jscomp . TRUST _ES6 _POLYFILLS && "function" == typeof Object . setPrototypeOf ? Object . setPrototypeOf : $jscomp . underscoreProtoCanBeSet ( ) ? function ( a , b ) { a . _ _proto _ _ = b ; if ( a . _ _proto _ _ !== b ) throw new TypeError ( a + " is not extensible" ) ; return a } : null ;
$jscomp . inherits = function ( a , b ) { a . prototype = $jscomp . objectCreate ( b . prototype ) ; a . prototype . constructor = a ; if ( $jscomp . setPrototypeOf ) { var c = $jscomp . setPrototypeOf ; c ( a , b ) } else for ( c in b ) if ( "prototype" != c ) if ( Object . defineProperties ) { var d = Object . getOwnPropertyDescriptor ( b , c ) ; d && Object . defineProperty ( a , c , d ) } else a [ c ] = b [ c ] ; a . superClass _ = b . prototype } ; $jscomp . polyfill ( "Reflect" , function ( a ) { return a ? a : { } } , "es6" , "es3" ) ; $jscomp . polyfill ( "Reflect.construct" , function ( a ) { return $jscomp . construct } , "es6" , "es3" ) ;
$jscomp . polyfill ( "Reflect.setPrototypeOf" , function ( a ) { if ( a ) return a ; if ( $jscomp . setPrototypeOf ) { var b = $jscomp . setPrototypeOf ; return function ( c , d ) { try { return b ( c , d ) , ! 0 } catch ( e ) { return ! 1 } } } return null } , "es6" , "es5" ) ; $jscomp . polyfill ( "globalThis" , function ( a ) { return a || $jscomp . global } , "es_2020" , "es3" ) ;
$jscomp . checkStringArgs = function ( a , b , c ) { if ( null == a ) throw new TypeError ( "The 'this' value for String.prototype." + c + " must not be null or undefined" ) ; if ( b instanceof RegExp ) throw new TypeError ( "First argument to String.prototype." + c + " must not be a regular expression" ) ; return a + "" } ;
$jscomp . polyfill ( "String.prototype.startsWith" , function ( a ) { return a ? a : function ( b , c ) { var d = $jscomp . checkStringArgs ( this , b , "startsWith" ) ; b += "" ; var e = d . length , f = b . length ; c = Math . max ( 0 , Math . min ( c | 0 , d . length ) ) ; for ( var g = 0 ; g < f && c < e ; ) if ( d [ c ++ ] != b [ g ++ ] ) return ! 1 ; return g >= f } } , "es6" , "es3" ) ; $jscomp . initSymbol = function ( ) { } ;
$jscomp . polyfill ( "Symbol" , function ( a ) { if ( a ) return a ; var b = function ( f , g ) { this . $jscomp$symbol$id _ = f ; $jscomp . defineProperty ( this , "description" , { configurable : ! 0 , writable : ! 0 , value : g } ) } ; b . prototype . toString = function ( ) { return this . $jscomp$symbol$id _ } ; var c = "jscomp_symbol_" + ( 1E9 * Math . random ( ) >>> 0 ) + "_" , d = 0 , e = function ( f ) { if ( this instanceof e ) throw new TypeError ( "Symbol is not a constructor" ) ; return new b ( c + ( f || "" ) + "_" + d ++ , f ) } ; return e } , "es6" , "es3" ) ;
$jscomp . polyfill ( "Symbol.iterator" , function ( a ) { if ( a ) return a ; a = Symbol ( "Symbol.iterator" ) ; for ( var b = "Array Int8Array Uint8Array Uint8ClampedArray Int16Array Uint16Array Int32Array Uint32Array Float32Array Float64Array" . split ( " " ) , c = 0 ; c < b . length ; c ++ ) { var d = $jscomp . global [ b [ c ] ] ; "function" === typeof d && "function" != typeof d . prototype [ a ] && $jscomp . defineProperty ( d . prototype , a , { configurable : ! 0 , writable : ! 0 , value : function ( ) { return $jscomp . iteratorPrototype ( $jscomp . arrayIteratorImpl ( this ) ) } } ) } return a } , "es6" ,
"es3" ) ; $jscomp . iteratorPrototype = function ( a ) { a = { next : a } ; a [ Symbol . iterator ] = function ( ) { return this } ; return a } ; $jscomp . iteratorFromArray = function ( a , b ) { a instanceof String && ( a += "" ) ; var c = 0 , d = ! 1 , e = { next : function ( ) { if ( ! d && c < a . length ) { var f = c ++ ; return { value : b ( f , a [ f ] ) , done : ! 1 } } d = ! 0 ; return { done : ! 0 , value : void 0 } } } ; e [ Symbol . iterator ] = function ( ) { return e } ; return e } ; $jscomp . polyfill ( "Array.prototype.keys" , function ( a ) { return a ? a : function ( ) { return $jscomp . iteratorFromArray ( this , function ( b ) { return b } ) } } , "es6" , "es3" ) ;
$jscomp . polyfill ( "Object.setPrototypeOf" , function ( a ) { return a || $jscomp . setPrototypeOf } , "es6" , "es5" ) ; $jscomp . polyfill ( "Array.prototype.values" , function ( a ) { return a ? a : function ( ) { return $jscomp . iteratorFromArray ( this , function ( b , c ) { return c } ) } } , "es8" , "es3" ) ; $jscomp . polyfill ( "Object.entries" , function ( a ) { return a ? a : function ( b ) { var c = [ ] , d ; for ( d in b ) $jscomp . owns ( b , d ) && c . push ( [ d , b [ d ] ] ) ; return c } } , "es8" , "es3" ) ;
$jscomp . polyfill ( "Object.getOwnPropertySymbols" , function ( a ) { return a ? a : function ( ) { return [ ] } } , "es6" , "es5" ) ; $jscomp . polyfill ( "Reflect.ownKeys" , function ( a ) { return a ? a : function ( b ) { var c = [ ] , d = Object . getOwnPropertyNames ( b ) ; b = Object . getOwnPropertySymbols ( b ) ; for ( var e = 0 ; e < d . length ; e ++ ) ( "jscomp_symbol_" == d [ e ] . substring ( 0 , 14 ) ? b : c ) . push ( d [ e ] ) ; return c . concat ( b ) } } , "es6" , "es5" ) ;
$jscomp . polyfill ( "Object.getOwnPropertyDescriptors" , function ( a ) { return a ? a : function ( b ) { for ( var c = { } , d = Reflect . ownKeys ( b ) , e = 0 ; e < d . length ; e ++ ) c [ d [ e ] ] = Object . getOwnPropertyDescriptor ( b , d [ e ] ) ; return c } } , "es8" , "es5" ) ; $jscomp . polyfill ( "Array.prototype.fill" , function ( a ) { return a ? a : function ( b , c , d ) { var e = this . length || 0 ; 0 > c && ( c = Math . max ( 0 , e + c ) ) ; if ( null == d || d > e ) d = e ; d = Number ( d ) ; 0 > d && ( d = Math . max ( 0 , e + d ) ) ; for ( c = Number ( c || 0 ) ; c < d ; c ++ ) this [ c ] = b ; return this } } , "es6" , "es3" ) ;
$jscomp . typedArrayFill = function ( a ) { return a ? a : Array . prototype . fill } ; $jscomp . polyfill ( "Int8Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Uint8Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Uint8ClampedArray.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Int16Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Uint16Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ;
$jscomp . polyfill ( "Int32Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Uint32Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Float32Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Float64Array.prototype.fill" , $jscomp . typedArrayFill , "es6" , "es5" ) ; $jscomp . polyfill ( "Object.is" , function ( a ) { return a ? a : function ( b , c ) { return b === c ? 0 !== b || 1 / b === 1 / c : b !== b && c !== c } } , "es6" , "es3" ) ;
$jscomp . polyfill ( "Array.prototype.includes" , function ( a ) { return a ? a : function ( b , c ) { var d = this ; d instanceof String && ( d = String ( d ) ) ; var e = d . length ; c = c || 0 ; for ( 0 > c && ( c = Math . max ( c + e , 0 ) ) ; c < e ; c ++ ) { var f = d [ c ] ; if ( f === b || Object . is ( f , b ) ) return ! 0 } return ! 1 } } , "es7" , "es3" ) ; $jscomp . polyfill ( "String.prototype.includes" , function ( a ) { return a ? a : function ( b , c ) { return - 1 !== $jscomp . checkStringArgs ( this , b , "includes" ) . indexOf ( b , c || 0 ) } } , "es6" , "es3" ) ; var COMPILED = ! 0 , goog = goog || { } ; goog . global = globalThis || root ;
goog . define = function ( a , b ) { return b } ; goog . DEBUG = ! 1 ; goog . DISALLOW _TEST _ONLY _CODE = COMPILED && ! goog . DEBUG ; goog . provide = function ( a ) { } ; goog . module = function ( a ) { } ; goog . module . get = function ( a ) { } ; goog . module . declareLegacyNamespace = function ( ) { } ; goog . setTestOnly = function ( a ) { if ( goog . DISALLOW _TEST _ONLY _CODE ) throw a = a || "" , Error ( "Importing test-only code into non-debug environment" + ( a ? ": " + a : "." ) ) ; } ; goog . require = function ( a ) { } ; goog . requireType = function ( a ) { } ; var module$exports$Blockly$utils$deprecation = { warn : function ( a , b , c , d ) { a = a + " was deprecated on " + b + " and will be deleted on " + c + "." ; d && ( a += "\nUse " + d + " instead." ) ; console . warn ( a ) } } ; var module$exports$Blockly$Css = { } , module$contents$Blockly$Css _injected = ! 1 ; module$exports$Blockly$Css . register = function ( a ) { if ( module$contents$Blockly$Css _injected ) throw Error ( "CSS already injected" ) ; Array . isArray ( a ) ? ( ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Registering CSS by passing an array of strings" , "September 2021" , "September 2022" , "css.register passing a multiline string" ) , module$exports$Blockly$Css . content += "\n" + a . join ( "\n" ) ) : module$exports$Blockly$Css . content += "\n" + a } ;
module$exports$Blockly$Css . inject = function ( a , b ) { module$contents$Blockly$Css _injected || ( module$contents$Blockly$Css _injected = ! 0 , a && ( a = b . replace ( /[\\/]$/ , "" ) , b = module$exports$Blockly$Css . content . replace ( /<<<PATH>>>/g , a ) , module$exports$Blockly$Css . content = "" , a = document . createElement ( "style" ) , a . id = "blockly-common-style" , b = document . createTextNode ( b ) , a . appendChild ( b ) , document . head . insertBefore ( a , document . head . firstChild ) ) ) } ; module$exports$Blockly$Css . content = '\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 }\n\n .blocklyNonSelectable {\n user-select: none;\n -ms-user-select: none;\n -webkit-user-select: none;\n }\n\n .blocklyWsDragSurface {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n }\n\n /* Added as a separate rule with multiple classes to make it more specific\n than a bootstrap rule that selects svg:root. See issue #1275 for context.\n */\n .blocklyWsDragSurface.blocklyOverflowVisible {\n overflow: visible;\n }\n\n .blocklyBlockDragSurface {\n display: none;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: visible !important;\n z-index: 50; /* Display below toolbox, but above everything else. */\n }\n\n .blocklyBlockCanvas.blocklyCanvasTransitioning,\n .blocklyBubbleCanvas.blocklyCanvasTransitioning {\n transition: transform .5s;\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.blocklyFocused {\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 overflow: auto;\n overflow-x: hidden;\n position: relative;\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 }\n\n .blocklyDropDownButton {\n display: inline-block;\n float: left;\n padding: 0;\n margin: 4px;\n border-radius: 4px;\n outline: none;\n border: 1px solid;\n transition: box-shadow .1s;\n cursor: pointer;\n }\n\n .blocklyArrowTop {\n border-top: 1px solid;\n border-left: 1px solid;\n border-top-left-radius: 4px;\n border-color: inherit;\n }\n\n .blocklyArrowBottom {\n border-bottom: 1px solid;\n border-right: 1px solid;\n border-bottom-right-radius: 4px;\n border-color: inherit;\n }\n\n .blocklyResizeSE {\n cursor: se-resize;\n fill: #aaa;\n }\n\n .blocklyResizeSW {\n cursor: sw-resize;\n fill: #aaa;\n }\n\n .blocklyResizeLine {\n stroke: #515A5A;\n stroke-width: 1;\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 /* backup for browsers (e.g. IE11) that don\' t support grab * / \ n c u r s o r : u r l ( " < < < P A T H > > > / h a n d o p e n . c u r " ) , a u t o ; \ n c u r s o r : g r a b ; \ n
$ . module$exports$Blockly$utils$string = { startsWith : function ( a , b ) { return 0 === a . lastIndexOf ( b , 0 ) } , shortestStringLength : function ( a ) { return a . length ? a . reduce ( function ( b , c ) { return b . length < c . length ? b : c } ) . length : 0 } , commonWordPrefix : function ( a , b ) { if ( ! a . length ) return 0 ; if ( 1 === a . length ) return a [ 0 ] . length ; var c = 0 ; b = b || ( 0 , $ . module$exports$Blockly$utils$string . shortestStringLength ) ( a ) ; var d ; for ( d = 0 ; d < b ; d ++ ) { for ( var e = a [ 0 ] [ d ] , f = 1 ; f < a . length ; f ++ ) if ( e !== a [ f ] [ d ] ) return c ; " " === e && ( c = d + 1 ) } for ( e = 1 ; e < a . length ; e ++ ) if ( ( f =
a [ e ] [ d ] ) && " " !== f ) return c ; return b } , commonWordSuffix : function ( a , b ) { if ( ! a . length ) return 0 ; if ( 1 === a . length ) return a [ 0 ] . length ; var c = 0 ; b = b || ( 0 , $ . module$exports$Blockly$utils$string . shortestStringLength ) ( a ) ; var d ; for ( d = 0 ; d < b ; d ++ ) { for ( var e = a [ 0 ] . substr ( - d - 1 , 1 ) , f = 1 ; f < a . length ; f ++ ) if ( e !== a [ f ] . substr ( - d - 1 , 1 ) ) return c ; " " === e && ( c = d + 1 ) } for ( e = 1 ; e < a . length ; e ++ ) if ( ( f = a [ e ] . charAt ( a [ e ] . length - d - 1 ) ) && " " !== f ) return c ; return b } , wrap : function ( a , b ) { a = a . split ( "\n" ) ; for ( var c = 0 ; c < a . length ; c ++ ) a [ c ] = module$contents$Blockly$utils$string _wrapLine ( a [ c ] ,
b ) ; return a . join ( "\n" ) } } ; module$contents$Blockly$utils$string _wrapLine = function ( a , b ) { if ( a . length <= b ) return a ; for ( var c = a . trim ( ) . split ( /\s+/ ) , d = 0 ; d < c . length ; d ++ ) c [ d ] . length > b && ( b = c [ d ] . length ) ; var e = - Infinity , f = 1 ; do { d = e ; var g = a ; a = [ ] ; e = c . length / f ; for ( var h = 1 , k = 0 ; k < c . length - 1 ; k ++ ) h < ( k + 1.5 ) / e ? ( h ++ , a [ k ] = ! 0 ) : a [ k ] = ! 1 ; a = module$contents$Blockly$utils$string _wrapMutate ( c , a , b ) ; e = module$contents$Blockly$utils$string _wrapScore ( c , a , b ) ; a = module$contents$Blockly$utils$string _wrapToText ( c , a ) ; f ++ } while ( e > d ) ; return g } ;
module$contents$Blockly$utils$string _wrapScore = function ( a , b , c ) { for ( var d = [ 0 ] , e = [ ] , f = 0 ; f < a . length ; f ++ ) d [ d . length - 1 ] += a [ f ] . length , ! 0 === b [ f ] ? ( d . push ( 0 ) , e . push ( a [ f ] . charAt ( a [ f ] . length - 1 ) ) ) : ! 1 === b [ f ] && d [ d . length - 1 ] ++ ; a = Math . max . apply ( Math , d ) ; for ( f = b = 0 ; f < d . length ; f ++ ) b -= 2 * Math . pow ( Math . abs ( c - d [ f ] ) , 1.5 ) , b -= Math . pow ( a - d [ f ] , 1.5 ) , - 1 !== ".?!" . indexOf ( e [ f ] ) ? b += c / 3 : - 1 !== ",;)]}" . indexOf ( e [ f ] ) && ( b += c / 4 ) ; 1 < d . length && d [ d . length - 1 ] <= d [ d . length - 2 ] && ( b += . 5 ) ; return b } ;
module$contents$Blockly$utils$string _wrapMutate = function ( a , b , c ) { for ( var d = module$contents$Blockly$utils$string _wrapScore ( a , b , c ) , e , f = 0 ; f < b . length - 1 ; f ++ ) if ( b [ f ] !== b [ f + 1 ] ) { var g = [ ] . concat ( b ) ; g [ f ] = ! g [ f ] ; g [ f + 1 ] = ! g [ f + 1 ] ; var h = module$contents$Blockly$utils$string _wrapScore ( a , g , c ) ; h > d && ( d = h , e = g ) } return e ? module$contents$Blockly$utils$string _wrapMutate ( a , e , c ) : b } ; module$contents$Blockly$utils$string _wrapToText = function ( a , b ) { for ( var c = [ ] , d = 0 ; d < a . length ; d ++ ) c . push ( a [ d ] ) , void 0 !== b [ d ] && c . push ( b [ d ] ? "\n" : " " ) ; return c . join ( "" ) } ;
$ . module$exports$Blockly$utils$string . isNumber = function ( a ) { return /^\s*-?\d+(\.\d+)?\s*$/ . test ( a ) } ; $ . module$exports$Blockly$ConnectionType = { ConnectionType : { INPUT _VALUE : 1 , OUTPUT _VALUE : 2 , NEXT _STATEMENT : 3 , PREVIOUS _STATEMENT : 4 } } ; $ . module$exports$Blockly$internalConstants = { LINE _MODE _MULTIPLIER : 40 , PAGE _MODE _MULTIPLIER : 125 , DRAG _RADIUS : 5 , FLYOUT _DRAG _RADIUS : 10 , SNAP _RADIUS : 28 } ; $ . module$exports$Blockly$internalConstants . CONNECTING _SNAP _RADIUS = $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ; $ . module$exports$Blockly$internalConstants . CURRENT _CONNECTION _PREFERENCE = 8 ; $ . module$exports$Blockly$internalConstants . BUMP _DELAY = 250 ; $ . module$exports$Blockly$internalConstants . BUMP _RANDOMNESS = 10 ;
$ . module$exports$Blockly$internalConstants . COLLAPSE _CHARS = 30 ; $ . module$exports$Blockly$internalConstants . LONGPRESS = 750 ; $ . module$exports$Blockly$internalConstants . SOUND _LIMIT = 100 ; $ . module$exports$Blockly$internalConstants . DRAG _STACK = ! 0 ; $ . module$exports$Blockly$internalConstants . SPRITE = { width : 96 , height : 124 , url : "sprites.png" } ; $ . module$exports$Blockly$internalConstants . DRAG _NONE = 0 ; $ . module$exports$Blockly$internalConstants . DRAG _STICKY = 1 ; $ . module$exports$Blockly$internalConstants . DRAG _BEGIN = 1 ;
$ . module$exports$Blockly$internalConstants . DRAG _FREE = 2 ; $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE = [ ] ; $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE [ $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE ] = $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ; $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE [ $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ] = $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE ;
$ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE [ $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ] = $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ; $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE [ $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ] = $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ; $ . module$exports$Blockly$internalConstants . RENAME _VARIABLE _ID = "RENAME_VARIABLE_ID" ;
$ . module$exports$Blockly$internalConstants . DELETE _VARIABLE _ID = "DELETE_VARIABLE_ID" ; $ . module$exports$Blockly$utils$global = { } ; $ . module$exports$Blockly$utils$global . globalThis = function ( ) { return "object" === typeof globalThis ? globalThis : "object" === typeof self ? self : "object" === typeof window ? window : "object" === typeof global ? global : this } ( ) ; var module$exports$Blockly$Touch = { } ; module$exports$Blockly$Touch . TOUCH _ENABLED = "ontouchstart" in $ . module$exports$Blockly$utils$global . globalThis || ! ! ( $ . module$exports$Blockly$utils$global . globalThis . document && document . documentElement && "ontouchstart" in document . documentElement ) || ! ( ! $ . module$exports$Blockly$utils$global . globalThis . navigator || ! $ . module$exports$Blockly$utils$global . globalThis . navigator . maxTouchPoints && ! $ . module$exports$Blockly$utils$global . globalThis . navigator . msMaxTouchPoints ) ;
var module$contents$Blockly$Touch _touchIdentifier _ = null ; module$exports$Blockly$Touch . TOUCH _MAP = { } ;
$ . module$exports$Blockly$utils$global . globalThis . PointerEvent ? module$exports$Blockly$Touch . TOUCH _MAP = { mousedown : [ "pointerdown" ] , mouseenter : [ "pointerenter" ] , mouseleave : [ "pointerleave" ] , mousemove : [ "pointermove" ] , mouseout : [ "pointerout" ] , mouseover : [ "pointerover" ] , mouseup : [ "pointerup" , "pointercancel" ] , touchend : [ "pointerup" ] , touchcancel : [ "pointercancel" ] } : module$exports$Blockly$Touch . TOUCH _ENABLED && ( module$exports$Blockly$Touch . TOUCH _MAP = { mousedown : [ "touchstart" ] , mousemove : [ "touchmove" ] , mouseup : [ "touchend" ,
"touchcancel" ] } ) ; var module$contents$Blockly$Touch _longPid _ = 0 ; module$exports$Blockly$Touch . longStart = function ( a , b ) { ( 0 , module$exports$Blockly$Touch . longStop ) ( ) ; a . changedTouches && 1 !== a . changedTouches . length || ( module$contents$Blockly$Touch _longPid _ = setTimeout ( function ( ) { a . changedTouches && ( a . button = 2 , a . clientX = a . changedTouches [ 0 ] . clientX , a . clientY = a . changedTouches [ 0 ] . clientY ) ; b && b . handleRightClick ( a ) } , $ . module$exports$Blockly$internalConstants . LONGPRESS ) ) } ;
module$exports$Blockly$Touch . longStop = function ( ) { module$contents$Blockly$Touch _longPid _ && ( clearTimeout ( module$contents$Blockly$Touch _longPid _ ) , module$contents$Blockly$Touch _longPid _ = 0 ) } ; module$exports$Blockly$Touch . clearTouchIdentifier = function ( ) { module$contents$Blockly$Touch _touchIdentifier _ = null } ; module$exports$Blockly$Touch . shouldHandleEvent = function ( a ) { return ! ( 0 , module$exports$Blockly$Touch . isMouseOrTouchEvent ) ( a ) || ( 0 , module$exports$Blockly$Touch . checkTouchIdentifier ) ( a ) } ;
module$exports$Blockly$Touch . getTouchIdentifierFromEvent = function ( a ) { return void 0 !== a . pointerId ? a . pointerId : a . changedTouches && a . changedTouches [ 0 ] && void 0 !== a . changedTouches [ 0 ] . identifier && null !== a . changedTouches [ 0 ] . identifier ? a . changedTouches [ 0 ] . identifier : "mouse" } ;
module$exports$Blockly$Touch . checkTouchIdentifier = function ( a ) { var b = ( 0 , module$exports$Blockly$Touch . getTouchIdentifierFromEvent ) ( a ) ; return void 0 !== module$contents$Blockly$Touch _touchIdentifier _ && null !== module$contents$Blockly$Touch _touchIdentifier _ ? module$contents$Blockly$Touch _touchIdentifier _ === b : "mousedown" === a . type || "touchstart" === a . type || "pointerdown" === a . type ? ( module$contents$Blockly$Touch _touchIdentifier _ = b , ! 0 ) : ! 1 } ;
module$exports$Blockly$Touch . setClientFromTouch = function ( a ) { if ( ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( a . type , "touch" ) ) { var b = a . changedTouches [ 0 ] ; a . clientX = b . clientX ; a . clientY = b . clientY } } ; module$exports$Blockly$Touch . isMouseOrTouchEvent = function ( a ) { return ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( a . type , "touch" ) || ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( a . type , "mouse" ) || ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( a . type , "pointer" ) } ;
module$exports$Blockly$Touch . isTouchEvent = function ( a ) { return ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( a . type , "touch" ) || ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( a . type , "pointer" ) } ;
module$exports$Blockly$Touch . splitEventByTouches = function ( a ) { var b = [ ] ; if ( a . changedTouches ) for ( var c = 0 ; c < a . changedTouches . length ; c ++ ) b [ c ] = { type : a . type , changedTouches : [ a . changedTouches [ c ] ] , target : a . target , stopPropagation : function ( ) { a . stopPropagation ( ) } , preventDefault : function ( ) { a . preventDefault ( ) } } ; else b . push ( a ) ; return b } ; var module$exports$Blockly$utils$userAgent = { } ;
( function ( a ) { function b ( d ) { return - 1 !== c . indexOf ( d . toUpperCase ( ) ) } module$exports$Blockly$utils$userAgent . raw = a ; var c = module$exports$Blockly$utils$userAgent . raw . toUpperCase ( ) ; module$exports$Blockly$utils$userAgent . IE = b ( "Trident" ) || b ( "MSIE" ) ; module$exports$Blockly$utils$userAgent . EDGE = b ( "Edge" ) ; module$exports$Blockly$utils$userAgent . JavaFx = b ( "JavaFX" ) ; module$exports$Blockly$utils$userAgent . CHROME = ( b ( "Chrome" ) || b ( "CriOS" ) ) && ! module$exports$Blockly$utils$userAgent . EDGE ; module$exports$Blockly$utils$userAgent . WEBKIT =
b ( "WebKit" ) && ! module$exports$Blockly$utils$userAgent . EDGE ; module$exports$Blockly$utils$userAgent . GECKO = b ( "Gecko" ) && ! module$exports$Blockly$utils$userAgent . WEBKIT && ! module$exports$Blockly$utils$userAgent . IE && ! module$exports$Blockly$utils$userAgent . EDGE ; module$exports$Blockly$utils$userAgent . ANDROID = b ( "Android" ) ; a = $ . module$exports$Blockly$utils$global . globalThis . navigator && $ . module$exports$Blockly$utils$global . globalThis . navigator . maxTouchPoints ; module$exports$Blockly$utils$userAgent . IPAD = b ( "iPad" ) ||
b ( "Macintosh" ) && 0 < a ; module$exports$Blockly$utils$userAgent . IPOD = b ( "iPod" ) ; module$exports$Blockly$utils$userAgent . IPHONE = b ( "iPhone" ) && ! module$exports$Blockly$utils$userAgent . IPAD && ! module$exports$Blockly$utils$userAgent . IPOD ; module$exports$Blockly$utils$userAgent . MAC = b ( "Macintosh" ) ; module$exports$Blockly$utils$userAgent . TABLET = module$exports$Blockly$utils$userAgent . IPAD || module$exports$Blockly$utils$userAgent . ANDROID && ! b ( "Mobile" ) || b ( "Silk" ) ; module$exports$Blockly$utils$userAgent . MOBILE = ! module$exports$Blockly$utils$userAgent . TABLET &&
( module$exports$Blockly$utils$userAgent . IPOD || module$exports$Blockly$utils$userAgent . IPHONE || module$exports$Blockly$utils$userAgent . ANDROID || b ( "IEMobile" ) ) } ) ( $ . module$exports$Blockly$utils$global . globalThis . navigator && $ . module$exports$Blockly$utils$global . globalThis . navigator . userAgent || "" ) ; var module$exports$Blockly$browserEvents = { conditionalBind : function ( a , b , c , d , e , f ) { var g = ! 1 , h = function ( p ) { var q = ! e ; p = ( 0 , module$exports$Blockly$Touch . splitEventByTouches ) ( p ) ; for ( var r = 0 ; r < p . length ; r ++ ) { var t = p [ r ] ; if ( ! q || ( 0 , module$exports$Blockly$Touch . shouldHandleEvent ) ( t ) ) ( 0 , module$exports$Blockly$Touch . setClientFromTouch ) ( t ) , c ? d . call ( c , t ) : d ( t ) , g = ! 0 } } , k = [ ] ; if ( $ . module$exports$Blockly$utils$global . globalThis . PointerEvent && b in module$exports$Blockly$Touch . TOUCH _MAP ) for ( var l = 0 ; l < module$exports$Blockly$Touch . TOUCH _MAP [ b ] . length ; l ++ ) { var m =
module$exports$Blockly$Touch . TOUCH _MAP [ b ] [ l ] ; a . addEventListener ( m , h , ! 1 ) ; k . push ( [ a , m , h ] ) } else if ( a . addEventListener ( b , h , ! 1 ) , k . push ( [ a , b , h ] ) , b in module$exports$Blockly$Touch . TOUCH _MAP ) for ( l = function ( p ) { h ( p ) ; var q = ! f ; g && q && p . preventDefault ( ) } , m = 0 ; m < module$exports$Blockly$Touch . TOUCH _MAP [ b ] . length ; m ++ ) { var n = module$exports$Blockly$Touch . TOUCH _MAP [ b ] [ m ] ; a . addEventListener ( n , l , ! 1 ) ; k . push ( [ a , n , l ] ) } return k } , bind : function ( a , b , c , d ) { var e = function ( l ) { c ? d . call ( c , l ) : d ( l ) } , f = [ ] ; if ( $ . module$exports$Blockly$utils$global . globalThis . PointerEvent &&
b in module$exports$Blockly$Touch . TOUCH _MAP ) for ( var g = 0 ; g < module$exports$Blockly$Touch . TOUCH _MAP [ b ] . length ; g ++ ) { var h = module$exports$Blockly$Touch . TOUCH _MAP [ b ] [ g ] ; a . addEventListener ( h , e , ! 1 ) ; f . push ( [ a , h , e ] ) } else if ( a . addEventListener ( b , e , ! 1 ) , f . push ( [ a , b , e ] ) , b in module$exports$Blockly$Touch . TOUCH _MAP ) for ( g = function ( l ) { if ( l . changedTouches && 1 === l . changedTouches . length ) { var m = l . changedTouches [ 0 ] ; l . clientX = m . clientX ; l . clientY = m . clientY } e ( l ) ; l . preventDefault ( ) } , h = 0 ; h < module$exports$Blockly$Touch . TOUCH _MAP [ b ] . length ; h ++ ) { var k =
module$exports$Blockly$Touch . TOUCH _MAP [ b ] [ h ] ; a . addEventListener ( k , g , ! 1 ) ; f . push ( [ a , k , g ] ) } return f } , unbind : function ( a ) { for ( var b ; a . length ; ) { b = a . pop ( ) ; var c = b [ 0 ] , d = b [ 1 ] ; b = b [ 2 ] ; c . removeEventListener ( d , b , ! 1 ) } return b } , isTargetInput : function ( a ) { return "textarea" === a . target . type || "text" === a . target . type || "number" === a . target . type || "email" === a . target . type || "password" === a . target . type || "search" === a . target . type || "tel" === a . target . type || "url" === a . target . type || a . target . isContentEditable || a . target . dataset && "true" ===
a . target . dataset . isTextInput } , isRightButton : function ( a ) { return a . ctrlKey && module$exports$Blockly$utils$userAgent . MAC ? ! 0 : 2 === a . button } , mouseToSvg : function ( a , b , c ) { var d = b . createSVGPoint ( ) ; d . x = a . clientX ; d . y = a . clientY ; c || ( c = b . getScreenCTM ( ) . inverse ( ) ) ; return d . matrixTransform ( c ) } , getScrollDeltaPixels : function ( a ) { switch ( a . deltaMode ) { default : return { x : a . deltaX , y : a . deltaY } ; case 1 : return { x : a . deltaX * $ . module$exports$Blockly$internalConstants . LINE _MODE _MULTIPLIER , y : a . deltaY * $ . module$exports$Blockly$internalConstants . LINE _MODE _MULTIPLIER } ;
case 2 : return { x : a . deltaX * $ . module$exports$Blockly$internalConstants . PAGE _MODE _MULTIPLIER , y : a . deltaY * $ . module$exports$Blockly$internalConstants . PAGE _MODE _MULTIPLIER } } } } ; $ . module$exports$Blockly$blocks = { } ; $ . module$exports$Blockly$blocks . Blocks = Object . create ( null ) ; var module$contents$Blockly$common _mainWorkspace ; $ . module$exports$Blockly$common = { } ; $ . module$exports$Blockly$common . getMainWorkspace = function ( ) { return module$contents$Blockly$common _mainWorkspace } ; $ . module$exports$Blockly$common . setMainWorkspace = function ( a ) { module$contents$Blockly$common _mainWorkspace = a } ; var module$contents$Blockly$common _selected = null ; $ . module$exports$Blockly$common . getSelected = function ( ) { return module$contents$Blockly$common _selected } ;
$ . module$exports$Blockly$common . setSelected = function ( a ) { module$contents$Blockly$common _selected = a } ; var module$contents$Blockly$common _parentContainer ; $ . module$exports$Blockly$common . getParentContainer = function ( ) { return module$contents$Blockly$common _parentContainer } ; $ . module$exports$Blockly$common . setParentContainer = function ( a ) { module$contents$Blockly$common _parentContainer = a } ;
$ . module$exports$Blockly$common . svgResize = function ( a ) { for ( ; a . options . parentWorkspace ; ) a = a . options . parentWorkspace ; var b = a . getParentSvg ( ) , c = a . getCachedParentSvgSize ( ) , d = b . parentNode ; if ( d ) { var e = d . offsetWidth ; d = d . offsetHeight ; c . width !== e && ( b . setAttribute ( "width" , e + "px" ) , a . setCachedParentSvgSize ( e , null ) ) ; c . height !== d && ( b . setAttribute ( "height" , d + "px" ) , a . setCachedParentSvgSize ( null , d ) ) ; a . resize ( ) } } ; $ . module$exports$Blockly$common . draggingConnections = [ ] ;
$ . module$exports$Blockly$common . getBlockTypeCounts = function ( a , b ) { var c = Object . create ( null ) , d = a . getDescendants ( ! 0 ) ; b && ( a = a . getNextBlock ( ) ) && ( a = d . indexOf ( a ) , d . splice ( a , d . length - a ) ) ; for ( a = 0 ; b = d [ a ] ; a ++ ) c [ b . type ] ? c [ b . type ] ++ : c [ b . type ] = 1 ; return c } ; var module$contents$Blockly$common _jsonInitFactory = function ( a ) { return function ( ) { this . jsonInit ( a ) } } ;
$ . module$exports$Blockly$common . defineBlocksWithJsonArray = function ( a ) { for ( var b = 0 ; b < a . length ; b ++ ) { var c = a [ b ] ; if ( c ) { var d = c . type ; d ? ( $ . module$exports$Blockly$blocks . Blocks [ d ] && console . warn ( "Block definition #" + b + ' in JSON array overwrites prior definition of "' + d + '".' ) , $ . module$exports$Blockly$blocks . Blocks [ d ] = { init : module$contents$Blockly$common _jsonInitFactory ( c ) } ) : console . warn ( "Block definition #" + b + " in JSON array is missing a type attribute. Skipping." ) } else console . warn ( "Block definition #" + b +
" in JSON array is " + c + ". Skipping." ) } } ; var module$exports$Blockly$Tooltip = { } , module$contents$Blockly$Tooltip _visible = ! 1 ; module$exports$Blockly$Tooltip . isVisible = function ( ) { return module$contents$Blockly$Tooltip _visible } ; Object . defineProperties ( module$exports$Blockly$Tooltip , { visible : { get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.Tooltip.visible" , "September 2021" , "September 2022" , "Blockly.Tooltip.isVisible()" ) ; return ( 0 , module$exports$Blockly$Tooltip . isVisible ) ( ) } } } ) ;
var module$contents$Blockly$Tooltip _blocked = ! 1 ; module$exports$Blockly$Tooltip . LIMIT = 50 ; var module$contents$Blockly$Tooltip _mouseOutPid = 0 , module$contents$Blockly$Tooltip _showPid = 0 , module$contents$Blockly$Tooltip _lastX = 0 , module$contents$Blockly$Tooltip _lastY = 0 , module$contents$Blockly$Tooltip _element = null , module$contents$Blockly$Tooltip _poisonedElement = null ; module$exports$Blockly$Tooltip . OFFSET _X = 0 ; module$exports$Blockly$Tooltip . OFFSET _Y = 10 ; module$exports$Blockly$Tooltip . RADIUS _OK = 10 ;
module$exports$Blockly$Tooltip . HOVER _MS = 750 ; module$exports$Blockly$Tooltip . MARGINS = 5 ; var module$contents$Blockly$Tooltip _DIV = null ; module$exports$Blockly$Tooltip . getDiv = function ( ) { return module$contents$Blockly$Tooltip _DIV } ; Object . defineProperties ( module$exports$Blockly$Tooltip , { DIV : { get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.Tooltip.DIV" , "September 2021" , "September 2022" , "Blockly.Tooltip.getDiv()" ) ; return ( 0 , module$exports$Blockly$Tooltip . getDiv ) ( ) } } } ) ;
module$exports$Blockly$Tooltip . getTooltipOfObject = function ( a ) { if ( a = module$contents$Blockly$Tooltip _getTargetObject ( a ) ) { for ( a = a . tooltip ; "function" === typeof a ; ) a = a ( ) ; if ( "string" !== typeof a ) throw Error ( "Tooltip function must return a string." ) ; return a } return "" } ; var module$contents$Blockly$Tooltip _getTargetObject = function ( a ) { for ( ; a && a . tooltip ; ) { if ( "string" === typeof a . tooltip || "function" === typeof a . tooltip ) return a ; a = a . tooltip } return null } ;
module$exports$Blockly$Tooltip . createDom = function ( ) { module$contents$Blockly$Tooltip _DIV || ( module$contents$Blockly$Tooltip _DIV = document . createElement ( "div" ) , module$contents$Blockly$Tooltip _DIV . className = "blocklyTooltipDiv" , ( ( 0 , $ . module$exports$Blockly$common . getParentContainer ) ( ) || document . body ) . appendChild ( module$contents$Blockly$Tooltip _DIV ) ) } ;
module$exports$Blockly$Tooltip . bindMouseEvents = function ( a ) { a . mouseOverWrapper _ = ( 0 , module$exports$Blockly$browserEvents . bind ) ( a , "mouseover" , null , module$contents$Blockly$Tooltip _onMouseOver ) ; a . mouseOutWrapper _ = ( 0 , module$exports$Blockly$browserEvents . bind ) ( a , "mouseout" , null , module$contents$Blockly$Tooltip _onMouseOut ) ; a . addEventListener ( "mousemove" , module$contents$Blockly$Tooltip _onMouseMove , ! 1 ) } ;
module$exports$Blockly$Tooltip . unbindMouseEvents = function ( a ) { a && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( a . mouseOverWrapper _ ) , ( 0 , module$exports$Blockly$browserEvents . unbind ) ( a . mouseOutWrapper _ ) , a . removeEventListener ( "mousemove" , module$contents$Blockly$Tooltip _onMouseMove ) ) } ;
var module$contents$Blockly$Tooltip _onMouseOver = function ( a ) { module$contents$Blockly$Tooltip _blocked || ( a = module$contents$Blockly$Tooltip _getTargetObject ( a . currentTarget ) , module$contents$Blockly$Tooltip _element !== a && ( ( 0 , module$exports$Blockly$Tooltip . hide ) ( ) , module$contents$Blockly$Tooltip _poisonedElement = null , module$contents$Blockly$Tooltip _element = a ) , clearTimeout ( module$contents$Blockly$Tooltip _mouseOutPid ) ) } , module$contents$Blockly$Tooltip _onMouseOut = function ( a ) { module$contents$Blockly$Tooltip _blocked ||
( module$contents$Blockly$Tooltip _mouseOutPid = setTimeout ( function ( ) { module$contents$Blockly$Tooltip _poisonedElement = module$contents$Blockly$Tooltip _element = null ; ( 0 , module$exports$Blockly$Tooltip . hide ) ( ) } , 1 ) , clearTimeout ( module$contents$Blockly$Tooltip _showPid ) ) } , module$contents$Blockly$Tooltip _onMouseMove = function ( a ) { if ( module$contents$Blockly$Tooltip _element && module$contents$Blockly$Tooltip _element . tooltip && ! module$contents$Blockly$Tooltip _blocked ) if ( module$contents$Blockly$Tooltip _visible ) { var b =
module$contents$Blockly$Tooltip _lastX - a . pageX ; a = module$contents$Blockly$Tooltip _lastY - a . pageY ; Math . sqrt ( b * b + a * a ) > module$exports$Blockly$Tooltip . RADIUS _OK && ( 0 , module$exports$Blockly$Tooltip . hide ) ( ) } else module$contents$Blockly$Tooltip _poisonedElement !== module$contents$Blockly$Tooltip _element && ( clearTimeout ( module$contents$Blockly$Tooltip _showPid ) , module$contents$Blockly$Tooltip _lastX = a . pageX , module$contents$Blockly$Tooltip _lastY = a . pageY , module$contents$Blockly$Tooltip _showPid = setTimeout ( module$contents$Blockly$Tooltip _show ,
module$exports$Blockly$Tooltip . HOVER _MS ) ) } ; module$exports$Blockly$Tooltip . dispose = function ( ) { module$contents$Blockly$Tooltip _poisonedElement = module$contents$Blockly$Tooltip _element = null ; ( 0 , module$exports$Blockly$Tooltip . hide ) ( ) } ; module$exports$Blockly$Tooltip . hide = function ( ) { module$contents$Blockly$Tooltip _visible && ( module$contents$Blockly$Tooltip _visible = ! 1 , module$contents$Blockly$Tooltip _DIV && ( module$contents$Blockly$Tooltip _DIV . style . display = "none" ) ) ; module$contents$Blockly$Tooltip _showPid && clearTimeout ( module$contents$Blockly$Tooltip _showPid ) } ;
module$exports$Blockly$Tooltip . block = function ( ) { ( 0 , module$exports$Blockly$Tooltip . hide ) ( ) ; module$contents$Blockly$Tooltip _blocked = ! 0 } ; module$exports$Blockly$Tooltip . unblock = function ( ) { module$contents$Blockly$Tooltip _blocked = ! 1 } ;
var module$contents$Blockly$Tooltip _show = function ( ) { if ( ! module$contents$Blockly$Tooltip _blocked && ( module$contents$Blockly$Tooltip _poisonedElement = module$contents$Blockly$Tooltip _element , module$contents$Blockly$Tooltip _DIV ) ) { module$contents$Blockly$Tooltip _DIV . textContent = "" ; var a = ( 0 , module$exports$Blockly$Tooltip . getTooltipOfObject ) ( module$contents$Blockly$Tooltip _element ) ; a = ( 0 , $ . module$exports$Blockly$utils$string . wrap ) ( a , module$exports$Blockly$Tooltip . LIMIT ) ; a = a . split ( "\n" ) ; for ( var b = 0 ; b < a . length ; b ++ ) { var c =
document . createElement ( "div" ) ; c . appendChild ( document . createTextNode ( a [ b ] ) ) ; module$contents$Blockly$Tooltip _DIV . appendChild ( c ) } a = module$contents$Blockly$Tooltip _element . RTL ; b = document . documentElement . clientWidth ; c = document . documentElement . clientHeight ; module$contents$Blockly$Tooltip _DIV . style . direction = a ? "rtl" : "ltr" ; module$contents$Blockly$Tooltip _DIV . style . display = "block" ; module$contents$Blockly$Tooltip _visible = ! 0 ; var d = module$contents$Blockly$Tooltip _lastX ; d = a ? d - ( module$exports$Blockly$Tooltip . OFFSET _X +
module$contents$Blockly$Tooltip _DIV . offsetWidth ) : d + module$exports$Blockly$Tooltip . OFFSET _X ; var e = module$contents$Blockly$Tooltip _lastY + module$exports$Blockly$Tooltip . OFFSET _Y ; e + module$contents$Blockly$Tooltip _DIV . offsetHeight > c + window . scrollY && ( e -= module$contents$Blockly$Tooltip _DIV . offsetHeight + 2 * module$exports$Blockly$Tooltip . OFFSET _Y ) ; a ? d = Math . max ( module$exports$Blockly$Tooltip . MARGINS - window . scrollX , d ) : d + module$contents$Blockly$Tooltip _DIV . offsetWidth > b + window . scrollX - 2 * module$exports$Blockly$Tooltip . MARGINS &&
( d = b - module$contents$Blockly$Tooltip _DIV . offsetWidth - 2 * module$exports$Blockly$Tooltip . MARGINS ) ; module$contents$Blockly$Tooltip _DIV . style . top = e + "px" ; module$contents$Blockly$Tooltip _DIV . style . left = d + "px" } } ; var module$exports$Blockly$utils$dom = { SVG _NS : "http://www.w3.org/2000/svg" , HTML _NS : "http://www.w3.org/1999/xhtml" , XLINK _NS : "http://www.w3.org/1999/xlink" , NodeType : { ELEMENT _NODE : 1 , TEXT _NODE : 3 , COMMENT _NODE : 8 , DOCUMENT _POSITION _CONTAINED _BY : 16 } } , module$contents$Blockly$utils$dom _cacheWidths = null , module$contents$Blockly$utils$dom _cacheReference = 0 , module$contents$Blockly$utils$dom _canvasContext = null ;
module$exports$Blockly$utils$dom . createSvgElement = function ( a , b , c ) { a = document . createElementNS ( module$exports$Blockly$utils$dom . SVG _NS , String ( a ) ) ; for ( var d in b ) a . setAttribute ( d , b [ d ] ) ; document . body . runtimeStyle && ( a . runtimeStyle = a . currentStyle = a . style ) ; c && c . appendChild ( a ) ; return a } ; module$exports$Blockly$utils$dom . addClass = function ( a , b ) { var c = a . getAttribute ( "class" ) || "" ; if ( - 1 !== ( " " + c + " " ) . indexOf ( " " + b + " " ) ) return ! 1 ; c && ( c += " " ) ; a . setAttribute ( "class" , c + b ) ; return ! 0 } ;
module$exports$Blockly$utils$dom . removeClasses = function ( a , b ) { b = b . split ( " " ) ; for ( var c = 0 ; c < b . length ; c ++ ) ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , b [ c ] ) } ; module$exports$Blockly$utils$dom . removeClass = function ( a , b ) { var c = a . getAttribute ( "class" ) ; if ( - 1 === ( " " + c + " " ) . indexOf ( " " + b + " " ) ) return ! 1 ; c = c . split ( /\s+/ ) ; for ( var d = 0 ; d < c . length ; d ++ ) c [ d ] && c [ d ] !== b || ( c . splice ( d , 1 ) , d -- ) ; c . length ? a . setAttribute ( "class" , c . join ( " " ) ) : a . removeAttribute ( "class" ) ; return ! 0 } ;
module$exports$Blockly$utils$dom . hasClass = function ( a , b ) { return - 1 !== ( " " + a . getAttribute ( "class" ) + " " ) . indexOf ( " " + b + " " ) } ; module$exports$Blockly$utils$dom . removeNode = function ( a ) { return a && a . parentNode ? a . parentNode . removeChild ( a ) : null } ; module$exports$Blockly$utils$dom . insertAfter = function ( a , b ) { var c = b . nextSibling ; b = b . parentNode ; if ( ! b ) throw Error ( "Reference node has no parent." ) ; c ? b . insertBefore ( a , c ) : b . appendChild ( a ) } ;
module$exports$Blockly$utils$dom . containsNode = function ( a , b ) { return ! ! ( a . compareDocumentPosition ( b ) & module$exports$Blockly$utils$dom . NodeType . DOCUMENT _POSITION _CONTAINED _BY ) } ; module$exports$Blockly$utils$dom . setCssTransform = function ( a , b ) { a . style . transform = b ; a . style [ "-webkit-transform" ] = b } ; module$exports$Blockly$utils$dom . startTextWidthCache = function ( ) { module$contents$Blockly$utils$dom _cacheReference ++ ; module$contents$Blockly$utils$dom _cacheWidths || ( module$contents$Blockly$utils$dom _cacheWidths = Object . create ( null ) ) } ;
module$exports$Blockly$utils$dom . stopTextWidthCache = function ( ) { module$contents$Blockly$utils$dom _cacheReference -- ; module$contents$Blockly$utils$dom _cacheReference || ( module$contents$Blockly$utils$dom _cacheWidths = null ) } ;
module$exports$Blockly$utils$dom . getTextWidth = function ( a ) { var b = a . textContent + "\n" + a . className . baseVal , c ; if ( module$contents$Blockly$utils$dom _cacheWidths && ( c = module$contents$Blockly$utils$dom _cacheWidths [ b ] ) ) return c ; try { c = module$exports$Blockly$utils$userAgent . IE || module$exports$Blockly$utils$userAgent . EDGE ? a . getBBox ( ) . width : a . getComputedTextLength ( ) } catch ( d ) { return 8 * a . textContent . length } module$contents$Blockly$utils$dom _cacheWidths && ( module$contents$Blockly$utils$dom _cacheWidths [ b ] = c ) ; return c } ;
module$exports$Blockly$utils$dom . getFastTextWidth = function ( a , b , c , d ) { return ( 0 , module$exports$Blockly$utils$dom . getFastTextWidthWithSizeString ) ( a , b + "pt" , c , d ) } ;
module$exports$Blockly$utils$dom . getFastTextWidthWithSizeString = function ( a , b , c , d ) { var e = a . textContent ; a = e + "\n" + a . className . baseVal ; var f ; if ( module$contents$Blockly$utils$dom _cacheWidths && ( f = module$contents$Blockly$utils$dom _cacheWidths [ a ] ) ) return f ; module$contents$Blockly$utils$dom _canvasContext || ( f = document . createElement ( "canvas" ) , f . className = "blocklyComputeCanvas" , document . body . appendChild ( f ) , module$contents$Blockly$utils$dom _canvasContext = f . getContext ( "2d" ) ) ; module$contents$Blockly$utils$dom _canvasContext . font =
c + " " + b + " " + d ; f = module$contents$Blockly$utils$dom _canvasContext . measureText ( e ) . width ; module$contents$Blockly$utils$dom _cacheWidths && ( module$contents$Blockly$utils$dom _cacheWidths [ a ] = f ) ; return f } ;
module$exports$Blockly$utils$dom . measureFontMetrics = function ( a , b , c , d ) { var e = document . createElement ( "span" ) ; e . style . font = c + " " + b + " " + d ; e . textContent = a ; a = document . createElement ( "div" ) ; a . style . width = "1px" ; a . style . height = 0 ; b = document . createElement ( "div" ) ; b . setAttribute ( "style" , "position: fixed; top: 0; left: 0; display: flex;" ) ; b . appendChild ( e ) ; b . appendChild ( a ) ; document . body . appendChild ( b ) ; c = { height : 0 , baseline : 0 } ; try { b . style . alignItems = "baseline" , c . baseline = a . offsetTop - e . offsetTop , b . style . alignItems =
"flex-end" , c . height = a . offsetTop - e . offsetTop } finally { document . body . removeChild ( b ) } return c } ; var module$exports$Blockly$WidgetDiv = { } , module$contents$Blockly$WidgetDiv _owner = null , module$contents$Blockly$WidgetDiv _dispose = null , module$contents$Blockly$WidgetDiv _rendererClassName = "" , module$contents$Blockly$WidgetDiv _themeClassName = "" , module$contents$Blockly$WidgetDiv _DIV ; module$exports$Blockly$WidgetDiv . getDiv = function ( ) { return module$contents$Blockly$WidgetDiv _DIV } ; module$exports$Blockly$WidgetDiv . testOnly _setDiv = function ( a ) { module$contents$Blockly$WidgetDiv _DIV = a } ;
Object . defineProperties ( module$exports$Blockly$WidgetDiv , { DIV : { get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.WidgetDiv.DIV" , "September 2021" , "September 2022" , "Blockly.WidgetDiv.getDiv()" ) ; return ( 0 , module$exports$Blockly$WidgetDiv . getDiv ) ( ) } } } ) ;
module$exports$Blockly$WidgetDiv . createDom = function ( ) { module$contents$Blockly$WidgetDiv _DIV || ( module$contents$Blockly$WidgetDiv _DIV = document . createElement ( "div" ) , module$contents$Blockly$WidgetDiv _DIV . className = "blocklyWidgetDiv" , ( ( 0 , $ . module$exports$Blockly$common . getParentContainer ) ( ) || document . body ) . appendChild ( module$contents$Blockly$WidgetDiv _DIV ) ) } ;
module$exports$Blockly$WidgetDiv . show = function ( a , b , c ) { ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) ; module$contents$Blockly$WidgetDiv _owner = a ; module$contents$Blockly$WidgetDiv _dispose = c ; a = module$contents$Blockly$WidgetDiv _DIV ; a . style . direction = b ? "rtl" : "ltr" ; a . style . display = "block" ; b = ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) ; module$contents$Blockly$WidgetDiv _rendererClassName = b . getRenderer ( ) . getClassName ( ) ; module$contents$Blockly$WidgetDiv _themeClassName = b . getTheme ( ) . getClassName ( ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a ,
module$contents$Blockly$WidgetDiv _rendererClassName ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , module$contents$Blockly$WidgetDiv _themeClassName ) } ;
module$exports$Blockly$WidgetDiv . hide = function ( ) { if ( ( 0 , module$exports$Blockly$WidgetDiv . isVisible ) ( ) ) { module$contents$Blockly$WidgetDiv _owner = null ; var a = module$contents$Blockly$WidgetDiv _DIV ; a . style . display = "none" ; a . style . left = "" ; a . style . top = "" ; module$contents$Blockly$WidgetDiv _dispose && module$contents$Blockly$WidgetDiv _dispose ( ) ; module$contents$Blockly$WidgetDiv _dispose = null ; a . textContent = "" ; module$contents$Blockly$WidgetDiv _rendererClassName && ( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a ,
module$contents$Blockly$WidgetDiv _rendererClassName ) , module$contents$Blockly$WidgetDiv _rendererClassName = "" ) ; module$contents$Blockly$WidgetDiv _themeClassName && ( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , module$contents$Blockly$WidgetDiv _themeClassName ) , module$contents$Blockly$WidgetDiv _themeClassName = "" ) ; ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) . markFocused ( ) } } ; module$exports$Blockly$WidgetDiv . isVisible = function ( ) { return ! ! module$contents$Blockly$WidgetDiv _owner } ;
module$exports$Blockly$WidgetDiv . hideIfOwner = function ( a ) { module$contents$Blockly$WidgetDiv _owner === a && ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) } ; var module$contents$Blockly$WidgetDiv _positionInternal = function ( a , b , c ) { module$contents$Blockly$WidgetDiv _DIV . style . left = a + "px" ; module$contents$Blockly$WidgetDiv _DIV . style . top = b + "px" ; module$contents$Blockly$WidgetDiv _DIV . style . height = c + "px" } ;
module$exports$Blockly$WidgetDiv . positionWithAnchor = function ( a , b , c , d ) { var e = module$contents$Blockly$WidgetDiv _calculateY ( a , b , c ) ; a = module$contents$Blockly$WidgetDiv _calculateX ( a , b , c , d ) ; 0 > e ? module$contents$Blockly$WidgetDiv _positionInternal ( a , 0 , c . height + e ) : module$contents$Blockly$WidgetDiv _positionInternal ( a , e , c . height ) } ;
var module$contents$Blockly$WidgetDiv _calculateX = function ( a , b , c , d ) { return d ? Math . min ( Math . max ( b . right - c . width , a . left ) , a . right - c . width ) : Math . max ( Math . min ( b . left , a . right - c . width ) , a . left ) } , module$contents$Blockly$WidgetDiv _calculateY = function ( a , b , c ) { return b . bottom + c . height >= a . bottom ? b . top - c . height : b . bottom } ; var module$exports$Blockly$utils$aria = { } , module$contents$Blockly$utils$aria _ARIA _PREFIX = "aria-" , module$contents$Blockly$utils$aria _ROLE _ATTRIBUTE = "role" ; module$exports$Blockly$utils$aria . Role = { GRID : "grid" , GRIDCELL : "gridcell" , GROUP : "group" , LISTBOX : "listbox" , MENU : "menu" , MENUITEM : "menuitem" , MENUITEMCHECKBOX : "menuitemcheckbox" , OPTION : "option" , PRESENTATION : "presentation" , ROW : "row" , TREE : "tree" , TREEITEM : "treeitem" } ;
module$exports$Blockly$utils$aria . State = { ACTIVEDESCENDANT : "activedescendant" , COLCOUNT : "colcount" , DISABLED : "disabled" , EXPANDED : "expanded" , INVALID : "invalid" , LABEL : "label" , LABELLEDBY : "labelledby" , LEVEL : "level" , ORIENTATION : "orientation" , POSINSET : "posinset" , ROWCOUNT : "rowcount" , SELECTED : "selected" , SETSIZE : "setsize" , VALUEMAX : "valuemax" , VALUEMIN : "valuemin" } ; module$exports$Blockly$utils$aria . setRole = function ( a , b ) { a . setAttribute ( module$contents$Blockly$utils$aria _ROLE _ATTRIBUTE , b ) } ;
module$exports$Blockly$utils$aria . setState = function ( a , b , c ) { Array . isArray ( c ) && ( c = c . join ( " " ) ) ; a . setAttribute ( module$contents$Blockly$utils$aria _ARIA _PREFIX + b , c ) } ; var module$exports$Blockly$utils$idGenerator = { TEST _ONLY : { } } , module$contents$Blockly$utils$idGenerator _nextId = 0 ; module$exports$Blockly$utils$idGenerator . getNextUniqueId = function ( ) { return "blockly-" + ( module$contents$Blockly$utils$idGenerator _nextId ++ ) . toString ( 36 ) } ; var module$contents$Blockly$utils$idGenerator _soup = "!#$%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ;
module$exports$Blockly$utils$idGenerator . TEST _ONLY . genUid = function ( ) { for ( var a = module$contents$Blockly$utils$idGenerator _soup . length , b = [ ] , c = 0 ; 20 > c ; c ++ ) b [ c ] = module$contents$Blockly$utils$idGenerator _soup . charAt ( Math . random ( ) * a ) ; return b . join ( "" ) } ; module$exports$Blockly$utils$idGenerator . genUid = function ( ) { return module$exports$Blockly$utils$idGenerator . TEST _ONLY . genUid ( ) } ; var module$exports$Blockly$registry = { } , module$contents$Blockly$registry _typeMap = Object . create ( null ) ; module$exports$Blockly$registry . TEST _ONLY = { typeMap : module$contents$Blockly$registry _typeMap } ; var module$contents$Blockly$registry _nameMap = Object . create ( null ) ; module$exports$Blockly$registry . DEFAULT = "default" ; module$exports$Blockly$registry . Type = function ( a ) { this . name _ = a } ; module$exports$Blockly$registry . Type . prototype . toString = function ( ) { return this . name _ } ;
module$exports$Blockly$registry . Type . CONNECTION _CHECKER = new module$exports$Blockly$registry . Type ( "connectionChecker" ) ; module$exports$Blockly$registry . Type . CURSOR = new module$exports$Blockly$registry . Type ( "cursor" ) ; module$exports$Blockly$registry . Type . EVENT = new module$exports$Blockly$registry . Type ( "event" ) ; module$exports$Blockly$registry . Type . FIELD = new module$exports$Blockly$registry . Type ( "field" ) ; module$exports$Blockly$registry . Type . RENDERER = new module$exports$Blockly$registry . Type ( "renderer" ) ;
module$exports$Blockly$registry . Type . TOOLBOX = new module$exports$Blockly$registry . Type ( "toolbox" ) ; module$exports$Blockly$registry . Type . THEME = new module$exports$Blockly$registry . Type ( "theme" ) ; module$exports$Blockly$registry . Type . TOOLBOX _ITEM = new module$exports$Blockly$registry . Type ( "toolboxItem" ) ; module$exports$Blockly$registry . Type . FLYOUTS _VERTICAL _TOOLBOX = new module$exports$Blockly$registry . Type ( "flyoutsVerticalToolbox" ) ; module$exports$Blockly$registry . Type . FLYOUTS _HORIZONTAL _TOOLBOX = new module$exports$Blockly$registry . Type ( "flyoutsHorizontalToolbox" ) ;
module$exports$Blockly$registry . Type . METRICS _MANAGER = new module$exports$Blockly$registry . Type ( "metricsManager" ) ; module$exports$Blockly$registry . Type . BLOCK _DRAGGER = new module$exports$Blockly$registry . Type ( "blockDragger" ) ; module$exports$Blockly$registry . Type . SERIALIZER = new module$exports$Blockly$registry . Type ( "serializer" ) ;
module$exports$Blockly$registry . register = function ( a , b , c , d ) { if ( ! ( a instanceof module$exports$Blockly$registry . Type ) && "string" !== typeof a || "" === String ( a ) . trim ( ) ) throw Error ( 'Invalid type "' + a + '". The type must be a non-empty string or a Blockly.registry.Type.' ) ; a = String ( a ) . toLowerCase ( ) ; if ( "string" !== typeof b || "" === b . trim ( ) ) throw Error ( 'Invalid name "' + b + '". The name must be a non-empty string.' ) ; var e = b . toLowerCase ( ) ; if ( ! c ) throw Error ( "Can not register a null value" ) ; var f = module$contents$Blockly$registry _typeMap [ a ] ,
g = module$contents$Blockly$registry _nameMap [ a ] ; f || ( f = module$contents$Blockly$registry _typeMap [ a ] = Object . create ( null ) , g = module$contents$Blockly$registry _nameMap [ a ] = Object . create ( null ) ) ; module$contents$Blockly$registry _validate ( a , c ) ; if ( ! d && f [ e ] ) throw Error ( 'Name "' + e + '" with type "' + a + '" already registered.' ) ; f [ e ] = c ; g [ e ] = b } ;
var module$contents$Blockly$registry _validate = function ( a , b ) { switch ( a ) { case String ( module$exports$Blockly$registry . Type . FIELD ) : if ( "function" !== typeof b . fromJson ) throw Error ( 'Type "' + a + '" must have a fromJson function' ) ; } } ;
module$exports$Blockly$registry . unregister = function ( a , b ) { a = String ( a ) . toLowerCase ( ) ; b = b . toLowerCase ( ) ; var c = module$contents$Blockly$registry _typeMap [ a ] ; c && c [ b ] ? ( delete module$contents$Blockly$registry _typeMap [ a ] [ b ] , delete module$contents$Blockly$registry _nameMap [ a ] [ b ] ) : console . warn ( "Unable to unregister [" + b + "][" + a + "] from the registry." ) } ;
var module$contents$Blockly$registry _getItem = function ( a , b , c ) { a = String ( a ) . toLowerCase ( ) ; b = b . toLowerCase ( ) ; var d = module$contents$Blockly$registry _typeMap [ a ] ; if ( ! d || ! d [ b ] ) { b = "Unable to find [" + b + "][" + a + "] in the registry." ; if ( c ) throw Error ( b + " You must require or register a " + a + " plugin." ) ; console . warn ( b ) ; return null } return d [ b ] } ; module$exports$Blockly$registry . hasItem = function ( a , b ) { a = String ( a ) . toLowerCase ( ) ; b = b . toLowerCase ( ) ; return ( a = module$contents$Blockly$registry _typeMap [ a ] ) ? ! ! a [ b ] : ! 1 } ;
module$exports$Blockly$registry . getClass = function ( a , b , c ) { return module$contents$Blockly$registry _getItem ( a , b , c ) } ; module$exports$Blockly$registry . getObject = function ( a , b , c ) { return module$contents$Blockly$registry _getItem ( a , b , c ) } ;
module$exports$Blockly$registry . getAllItems = function ( a , b , c ) { a = String ( a ) . toLowerCase ( ) ; var d = module$contents$Blockly$registry _typeMap [ a ] ; if ( ! d ) { d = "Unable to find [" + a + "] in the registry." ; if ( c ) throw Error ( d + " You must require or register a " + a + " plugin." ) ; console . warn ( d ) ; return null } if ( ! b ) return d ; a = module$contents$Blockly$registry _nameMap [ a ] ; c = Object . create ( null ) ; b = Object . keys ( d ) ; for ( var e = 0 ; e < b . length ; e ++ ) { var f = b [ e ] ; c [ a [ f ] ] = d [ f ] } return c } ;
module$exports$Blockly$registry . getClassFromOptions = function ( a , b , c ) { b = b . plugins [ a . toString ( ) ] || module$exports$Blockly$registry . DEFAULT ; return "function" === typeof b ? b : ( 0 , module$exports$Blockly$registry . getClass ) ( a , b , c ) } ; var module$exports$Blockly$Events$utils = { } , module$contents$Blockly$Events$utils _group = "" , module$contents$Blockly$Events$utils _recordUndo = ! 0 ; module$exports$Blockly$Events$utils . setRecordUndo = function ( a ) { module$contents$Blockly$Events$utils _recordUndo = a } ; module$exports$Blockly$Events$utils . getRecordUndo = function ( ) { return module$contents$Blockly$Events$utils _recordUndo } ; var module$contents$Blockly$Events$utils _disabled = 0 ; module$exports$Blockly$Events$utils . CREATE = "create" ;
module$exports$Blockly$Events$utils . BLOCK _CREATE = module$exports$Blockly$Events$utils . CREATE ; module$exports$Blockly$Events$utils . DELETE = "delete" ; module$exports$Blockly$Events$utils . BLOCK _DELETE = module$exports$Blockly$Events$utils . DELETE ; module$exports$Blockly$Events$utils . CHANGE = "change" ; module$exports$Blockly$Events$utils . BLOCK _CHANGE = module$exports$Blockly$Events$utils . CHANGE ; module$exports$Blockly$Events$utils . MOVE = "move" ; module$exports$Blockly$Events$utils . BLOCK _MOVE = module$exports$Blockly$Events$utils . MOVE ;
module$exports$Blockly$Events$utils . VAR _CREATE = "var_create" ; module$exports$Blockly$Events$utils . VAR _DELETE = "var_delete" ; module$exports$Blockly$Events$utils . VAR _RENAME = "var_rename" ; module$exports$Blockly$Events$utils . UI = "ui" ; module$exports$Blockly$Events$utils . BLOCK _DRAG = "drag" ; module$exports$Blockly$Events$utils . SELECTED = "selected" ; module$exports$Blockly$Events$utils . CLICK = "click" ; module$exports$Blockly$Events$utils . MARKER _MOVE = "marker_move" ; module$exports$Blockly$Events$utils . BUBBLE _OPEN = "bubble_open" ;
module$exports$Blockly$Events$utils . TRASHCAN _OPEN = "trashcan_open" ; module$exports$Blockly$Events$utils . TOOLBOX _ITEM _SELECT = "toolbox_item_select" ; module$exports$Blockly$Events$utils . THEME _CHANGE = "theme_change" ; module$exports$Blockly$Events$utils . VIEWPORT _CHANGE = "viewport_change" ; module$exports$Blockly$Events$utils . COMMENT _CREATE = "comment_create" ; module$exports$Blockly$Events$utils . COMMENT _DELETE = "comment_delete" ; module$exports$Blockly$Events$utils . COMMENT _CHANGE = "comment_change" ;
module$exports$Blockly$Events$utils . COMMENT _MOVE = "comment_move" ; module$exports$Blockly$Events$utils . FINISHED _LOADING = "finished_loading" ; module$exports$Blockly$Events$utils . BUMP _EVENTS = [ module$exports$Blockly$Events$utils . CREATE , module$exports$Blockly$Events$utils . MOVE , module$exports$Blockly$Events$utils . COMMENT _CREATE , module$exports$Blockly$Events$utils . COMMENT _MOVE ] ; var module$contents$Blockly$Events$utils _FIRE _QUEUE = [ ] ;
module$exports$Blockly$Events$utils . fire = function ( a ) { ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( module$contents$Blockly$Events$utils _FIRE _QUEUE . length || setTimeout ( module$contents$Blockly$Events$utils _fireNow , 0 ) , module$contents$Blockly$Events$utils _FIRE _QUEUE . push ( a ) ) } ;
var module$contents$Blockly$Events$utils _fireNow = function ( ) { for ( var a = ( 0 , module$exports$Blockly$Events$utils . filter ) ( module$contents$Blockly$Events$utils _FIRE _QUEUE , ! 0 ) , b = module$contents$Blockly$Events$utils _FIRE _QUEUE . length = 0 , c ; c = a [ b ] ; b ++ ) if ( c . workspaceId ) { var d = module$exports$Blockly$Workspace . Workspace . getById ( c . workspaceId ) ; d && d . fireChangeListener ( c ) } } ;
module$exports$Blockly$Events$utils . filter = function ( a , b ) { a = a . slice ( ) ; b || a . reverse ( ) ; for ( var c = [ ] , d = Object . create ( null ) , e = 0 , f = void 0 ; f = a [ e ] ; e ++ ) if ( ! f . isNull ( ) ) { var g = [ f . isUiEvent ? module$exports$Blockly$Events$utils . UI : f . type , f . blockId , f . workspaceId ] . join ( " " ) , h = d [ g ] , k = h ? h . event : null ; if ( ! h ) d [ g ] = { event : f , index : e } , c . push ( f ) ; else if ( f . type === module$exports$Blockly$Events$utils . MOVE && h . index === e - 1 ) k . newParentId = f . newParentId , k . newInputName = f . newInputName , k . newCoordinate = f . newCoordinate , h . index = e ; else if ( f . type ===
module$exports$Blockly$Events$utils . CHANGE && f . element === k . element && f . name === k . name ) k . newValue = f . newValue ; else if ( f . type === module$exports$Blockly$Events$utils . VIEWPORT _CHANGE ) k . viewTop = f . viewTop , k . viewLeft = f . viewLeft , k . scale = f . scale , k . oldScale = f . oldScale ; else if ( f . type !== module$exports$Blockly$Events$utils . CLICK || k . type !== module$exports$Blockly$Events$utils . BUBBLE _OPEN ) d [ g ] = { event : f , index : e } , c . push ( f ) } a = c . filter ( function ( l ) { return ! l . isNull ( ) } ) ; b || a . reverse ( ) ; b = 1 ; for ( c = void 0 ; c = a [ b ] ; b ++ ) c . type === module$exports$Blockly$Events$utils . CHANGE &&
"mutation" === c . element && a . unshift ( a . splice ( b , 1 ) [ 0 ] ) ; return a } ; module$exports$Blockly$Events$utils . clearPendingUndo = function ( ) { for ( var a = 0 , b ; b = module$contents$Blockly$Events$utils _FIRE _QUEUE [ a ] ; a ++ ) b . recordUndo = ! 1 } ; module$exports$Blockly$Events$utils . disable = function ( ) { module$contents$Blockly$Events$utils _disabled ++ } ; module$exports$Blockly$Events$utils . enable = function ( ) { module$contents$Blockly$Events$utils _disabled -- } ; module$exports$Blockly$Events$utils . isEnabled = function ( ) { return 0 === module$contents$Blockly$Events$utils _disabled } ;
module$exports$Blockly$Events$utils . getGroup = function ( ) { return module$contents$Blockly$Events$utils _group } ; module$exports$Blockly$Events$utils . setGroup = function ( a ) { module$contents$Blockly$Events$utils _group = "boolean" === typeof a ? a ? ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) : "" : a } ; module$exports$Blockly$Events$utils . getDescendantIds = function ( a ) { var b = [ ] ; a = a . getDescendants ( ! 1 ) ; for ( var c = 0 , d ; d = a [ c ] ; c ++ ) b [ c ] = d . id ; return b } ;
module$exports$Blockly$Events$utils . fromJson = function ( a , b ) { var c = ( 0 , module$exports$Blockly$Events$utils . get ) ( a . type ) ; if ( ! c ) throw Error ( "Unknown event type." ) ; c = new c ; c . fromJson ( a ) ; c . workspaceId = b . id ; return c } ; module$exports$Blockly$Events$utils . get = function ( a ) { return ( 0 , module$exports$Blockly$registry . getClass ) ( module$exports$Blockly$registry . Type . EVENT , a ) } ;
module$exports$Blockly$Events$utils . disableOrphans = function ( a ) { if ( ( a . type === module$exports$Blockly$Events$utils . MOVE || a . type === module$exports$Blockly$Events$utils . CREATE ) && a . workspaceId ) { var b = module$exports$Blockly$Workspace . Workspace . getById ( a . workspaceId ) , c = b . getBlockById ( a . blockId ) ; if ( c ) { a = module$contents$Blockly$Events$utils _recordUndo ; try { module$contents$Blockly$Events$utils _recordUndo = ! 1 ; var d = c . getParent ( ) ; if ( d && d . isEnabled ( ) ) { var e = c . getDescendants ( ! 1 ) ; b = 0 ; for ( d = void 0 ; d = e [ b ] ; b ++ ) d . setEnabled ( ! 0 ) } else if ( ( c . outputConnection ||
c . previousConnection ) && ! b . isDragging ( ) ) { do c . setEnabled ( ! 1 ) , c = c . getNextBlock ( ) ; while ( c ) } } finally { module$contents$Blockly$Events$utils _recordUndo = a } } } } ; module$exports$Blockly$Events$utils . TEST _ONLY = { FIRE _QUEUE : module$contents$Blockly$Events$utils _FIRE _QUEUE , fireNow : module$contents$Blockly$Events$utils _fireNow } ; var module$exports$Blockly$utils$math = { toRadians : function ( a ) { return a * Math . PI / 180 } , toDegrees : function ( a ) { return 180 * a / Math . PI } , clamp : function ( a , b , c ) { if ( c < a ) { var d = c ; c = a ; a = d } return Math . max ( a , Math . min ( b , c ) ) } } ; var module$exports$Blockly$bumpObjects = { bumpIntoBounds : function ( a , b , c ) { var d = c . getBoundingRectangle ( ) , e = d . right - d . left , f = ( 0 , module$exports$Blockly$utils$math . clamp ) ( b . top , d . top , b . top + b . height - ( d . bottom - d . top ) ) - d . top , g = b . left ; b = b . left + b . width - e ; a . RTL ? g = Math . min ( b , g ) : b = Math . max ( g , b ) ; return ( a = ( 0 , module$exports$Blockly$utils$math . clamp ) ( g , d . left , b ) - d . left ) || f ? ( c . moveBy ( a , f ) , ! 0 ) : ! 1 } , bumpIntoBoundsHandler : function ( a ) { return function ( b ) { var c = a . getMetricsManager ( ) ; if ( c . hasFixedEdges ( ) && ! a . isDragging ( ) ) if ( - 1 !==
module$exports$Blockly$Events$utils . BUMP _EVENTS . indexOf ( b . type ) ) { c = c . getScrollMetrics ( ! 0 ) ; var d = module$contents$Blockly$bumpObjects _extractObjectFromEvent ( a , b ) ; if ( d ) { var e = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( b . group ) ; ( 0 , module$exports$Blockly$bumpObjects . bumpIntoBounds ) ( a , c , d ) && ! b . group && console . warn ( "Moved object in bounds but there was no event group. This may break undo." ) ; null !== e && ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( e ) } } else b . type ===
module$exports$Blockly$Events$utils . VIEWPORT _CHANGE && b . scale > b . oldScale && ( 0 , module$exports$Blockly$bumpObjects . bumpTopObjectsIntoBounds ) ( a ) } } } , module$contents$Blockly$bumpObjects _extractObjectFromEvent = function ( a , b ) { var c = null ; switch ( b . type ) { case module$exports$Blockly$Events$utils . CREATE : case module$exports$Blockly$Events$utils . MOVE : ( c = a . getBlockById ( b . blockId ) ) && ( c = c . getRootBlock ( ) ) ; break ; case module$exports$Blockly$Events$utils . COMMENT _CREATE : case module$exports$Blockly$Events$utils . COMMENT _MOVE : c =
a . getCommentById ( b . commentId ) } return c } ; module$exports$Blockly$bumpObjects . bumpTopObjectsIntoBounds = function ( a ) { var b = a . getMetricsManager ( ) ; if ( b . hasFixedEdges ( ) && ! a . isDragging ( ) ) { b = b . getScrollMetrics ( ! 0 ) ; for ( var c = a . getTopBoundedElements ( ) , d = 0 , e ; e = c [ d ] ; d ++ ) ( 0 , module$exports$Blockly$bumpObjects . bumpIntoBounds ) ( a , b , e ) } } ; var module$exports$Blockly$utils$Coordinate = { Coordinate : function ( a , b ) { this . x = a ; this . y = b } } ; module$exports$Blockly$utils$Coordinate . Coordinate . equals = function ( a , b ) { return a === b ? ! 0 : a && b ? a . x === b . x && a . y === b . y : ! 1 } ; module$exports$Blockly$utils$Coordinate . Coordinate . distance = function ( a , b ) { var c = a . x - b . x ; a = a . y - b . y ; return Math . sqrt ( c * c + a * a ) } ; module$exports$Blockly$utils$Coordinate . Coordinate . magnitude = function ( a ) { return Math . sqrt ( a . x * a . x + a . y * a . y ) } ;
module$exports$Blockly$utils$Coordinate . Coordinate . difference = function ( a , b ) { return new module$exports$Blockly$utils$Coordinate . Coordinate ( a . x - b . x , a . y - b . y ) } ; module$exports$Blockly$utils$Coordinate . Coordinate . sum = function ( a , b ) { return new module$exports$Blockly$utils$Coordinate . Coordinate ( a . x + b . x , a . y + b . y ) } ; module$exports$Blockly$utils$Coordinate . Coordinate . prototype . clone = function ( ) { return new module$exports$Blockly$utils$Coordinate . Coordinate ( this . x , this . y ) } ;
module$exports$Blockly$utils$Coordinate . Coordinate . prototype . scale = function ( a ) { this . x *= a ; this . y *= a ; return this } ; module$exports$Blockly$utils$Coordinate . Coordinate . prototype . translate = function ( a , b ) { this . x += a ; this . y += b ; return this } ; var module$exports$Blockly$utils$Size = { Size : function ( a , b ) { this . width = a ; this . height = b } } ; module$exports$Blockly$utils$Size . Size . equals = function ( a , b ) { return a === b ? ! 0 : a && b ? a . width === b . width && a . height === b . height : ! 1 } ; var module$exports$Blockly$utils$style = { getSize : function ( a ) { if ( "none" !== module$contents$Blockly$utils$style _getStyle ( a , "display" ) ) return module$contents$Blockly$utils$style _getSizeWithDisplay ( a ) ; var b = a . style , c = b . display , d = b . visibility , e = b . position ; b . visibility = "hidden" ; b . position = "absolute" ; b . display = "inline" ; var f = a . offsetWidth ; a = a . offsetHeight ; b . display = c ; b . position = e ; b . visibility = d ; return new module$exports$Blockly$utils$Size . Size ( f , a ) } } , module$contents$Blockly$utils$style _getSizeWithDisplay =
function ( a ) { return new module$exports$Blockly$utils$Size . Size ( a . offsetWidth , a . offsetHeight ) } , module$contents$Blockly$utils$style _getStyle = function ( a , b ) { return ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( a , b ) || ( 0 , module$exports$Blockly$utils$style . getCascadedStyle ) ( a , b ) || a . style && a . style [ b ] } ;
module$exports$Blockly$utils$style . getComputedStyle = function ( a , b ) { return document . defaultView && document . defaultView . getComputedStyle && ( a = document . defaultView . getComputedStyle ( a , null ) ) ? a [ b ] || a . getPropertyValue ( b ) || "" : "" } ; module$exports$Blockly$utils$style . getCascadedStyle = function ( a , b ) { return a . currentStyle ? a . currentStyle [ b ] : null } ;
module$exports$Blockly$utils$style . getPageOffset = function ( a ) { var b = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; a = a . getBoundingClientRect ( ) ; var c = document . documentElement ; c = new module$exports$Blockly$utils$Coordinate . Coordinate ( window . pageXOffset || c . scrollLeft , window . pageYOffset || c . scrollTop ) ; b . x = a . left + c . x ; b . y = a . top + c . y ; return b } ;
module$exports$Blockly$utils$style . getViewportPageOffset = function ( ) { var a = document . body , b = document . documentElement ; return new module$exports$Blockly$utils$Coordinate . Coordinate ( a . scrollLeft || b . scrollLeft , a . scrollTop || b . scrollTop ) } ; module$exports$Blockly$utils$style . setElementShown = function ( a , b ) { a . style . display = b ? "" : "none" } ; module$exports$Blockly$utils$style . isRightToLeft = function ( a ) { return "rtl" === module$contents$Blockly$utils$style _getStyle ( a , "direction" ) } ;
module$exports$Blockly$utils$style . getBorderBox = function ( a ) { var b = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( a , "borderLeftWidth" ) , c = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( a , "borderRightWidth" ) , d = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( a , "borderTopWidth" ) ; a = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( a , "borderBottomWidth" ) ; return { top : parseFloat ( d ) , right : parseFloat ( c ) , bottom : parseFloat ( a ) , left : parseFloat ( b ) } } ;
module$exports$Blockly$utils$style . scrollIntoContainerView = function ( a , b , c ) { a = ( 0 , module$exports$Blockly$utils$style . getContainerOffsetToScrollInto ) ( a , b , c ) ; b . scrollLeft = a . x ; b . scrollTop = a . y } ;
module$exports$Blockly$utils$style . getContainerOffsetToScrollInto = function ( a , b , c ) { var d = ( 0 , module$exports$Blockly$utils$style . getPageOffset ) ( a ) , e = ( 0 , module$exports$Blockly$utils$style . getPageOffset ) ( b ) , f = ( 0 , module$exports$Blockly$utils$style . getBorderBox ) ( b ) , g = d . x - e . x - f . left ; d = d . y - e . y - f . top ; e = module$contents$Blockly$utils$style _getSizeWithDisplay ( a ) ; a = b . clientWidth - e . width ; e = b . clientHeight - e . height ; f = b . scrollLeft ; b = b . scrollTop ; c ? ( f += g - a / 2 , b += d - e / 2 ) : ( f += Math . min ( g , Math . max ( g - a , 0 ) ) , b += Math . min ( d , Math . max ( d -
e , 0 ) ) ) ; return new module$exports$Blockly$utils$Coordinate . Coordinate ( f , b ) } ; var module$exports$Blockly$utils$Rect = { Rect : function ( a , b , c , d ) { this . top = a ; this . bottom = b ; this . left = c ; this . right = d } } ; module$exports$Blockly$utils$Rect . Rect . prototype . contains = function ( a , b ) { return a >= this . left && a <= this . right && b >= this . top && b <= this . bottom } ; module$exports$Blockly$utils$Rect . Rect . prototype . intersects = function ( a ) { return ! ( this . left > a . right || this . right < a . left || this . top > a . bottom || this . bottom < a . top ) } ; var module$exports$Blockly$utils$svgMath = { } , module$contents$Blockly$utils$svgMath _XY _REGEX = /translate\(\s*([-+\d.e]+)([ ,]\s*([-+\d.e]+)\s*)?/ , module$contents$Blockly$utils$svgMath _XY _STYLE _REGEX = /transform:\s*translate(?:3d)?\(\s*([-+\d.e]+)\s*px([ ,]\s*([-+\d.e]+)\s*px)?/ ;
module$exports$Blockly$utils$svgMath . getRelativeXY = function ( a ) { var b = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) , c = a . getAttribute ( "x" ) ; c && ( b . x = parseInt ( c , 10 ) ) ; if ( c = a . getAttribute ( "y" ) ) b . y = parseInt ( c , 10 ) ; if ( c = ( c = a . getAttribute ( "transform" ) ) && c . match ( module$contents$Blockly$utils$svgMath _XY _REGEX ) ) b . x += Number ( c [ 1 ] ) , c [ 3 ] && ( b . y += Number ( c [ 3 ] ) ) ; ( a = a . getAttribute ( "style" ) ) && - 1 < a . indexOf ( "translate" ) && ( a = a . match ( module$contents$Blockly$utils$svgMath _XY _STYLE _REGEX ) ) && ( b . x += Number ( a [ 1 ] ) , a [ 3 ] &&
( b . y += Number ( a [ 3 ] ) ) ) ; return b } ; module$exports$Blockly$utils$svgMath . getInjectionDivXY = function ( a ) { for ( var b = 0 , c = 0 ; a ; ) { var d = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( a ) ; b += d . x ; c += d . y ; if ( - 1 !== ( " " + ( a . getAttribute ( "class" ) || "" ) + " " ) . indexOf ( " injectionDiv " ) ) break ; a = a . parentNode } return new module$exports$Blockly$utils$Coordinate . Coordinate ( b , c ) } ;
module$exports$Blockly$utils$svgMath . is3dSupported = function ( ) { if ( void 0 !== module$exports$Blockly$utils$svgMath . is3dSupported . cached _ ) return module$exports$Blockly$utils$svgMath . is3dSupported . cached _ ; if ( ! $ . module$exports$Blockly$utils$global . globalThis . getComputedStyle ) return ! 1 ; var a = document . createElement ( "p" ) , b = "none" , c = { webkitTransform : "-webkit-transform" , OTransform : "-o-transform" , msTransform : "-ms-transform" , MozTransform : "-moz-transform" , transform : "transform" } ; document . body . insertBefore ( a , null ) ;
for ( var d in c ) if ( void 0 !== a . style [ d ] ) { a . style [ d ] = "translate3d(1px,1px,1px)" ; b = $ . module$exports$Blockly$utils$global . globalThis . getComputedStyle ( a ) ; if ( ! b ) return document . body . removeChild ( a ) , ! 1 ; b = b . getPropertyValue ( c [ d ] ) } document . body . removeChild ( a ) ; module$exports$Blockly$utils$svgMath . is3dSupported . cached _ = "none" !== b ; return module$exports$Blockly$utils$svgMath . is3dSupported . cached _ } ;
module$exports$Blockly$utils$svgMath . getViewportBBox = function ( ) { var a = ( 0 , module$exports$Blockly$utils$style . getViewportPageOffset ) ( ) ; return new module$exports$Blockly$utils$Rect . Rect ( a . y , document . documentElement . clientHeight + a . y , a . x , document . documentElement . clientWidth + a . x ) } ;
module$exports$Blockly$utils$svgMath . getDocumentScroll = function ( ) { var a = document . documentElement , b = window ; return module$exports$Blockly$utils$userAgent . IE && b . pageYOffset !== a . scrollTop ? new module$exports$Blockly$utils$Coordinate . Coordinate ( a . scrollLeft , a . scrollTop ) : new module$exports$Blockly$utils$Coordinate . Coordinate ( b . pageXOffset || a . scrollLeft , b . pageYOffset || a . scrollTop ) } ;
module$exports$Blockly$utils$svgMath . screenToWsCoordinates = function ( a , b ) { var c = b . x ; b = b . y ; var d = a . getInjectionDiv ( ) . getBoundingClientRect ( ) ; c = new module$exports$Blockly$utils$Coordinate . Coordinate ( c - d . left , b - d . top ) ; b = a . getOriginOffsetInPixels ( ) ; return module$exports$Blockly$utils$Coordinate . Coordinate . difference ( c , b ) . scale ( 1 / a . scale ) } ;
module$exports$Blockly$utils$svgMath . svgSize = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.svgSize" , "March 2021" , "March 2022" , "workspace.getCachedParentSvgSize" ) ; return new module$exports$Blockly$utils$Size . Size ( a . cachedWidth _ , a . cachedHeight _ ) } ; module$exports$Blockly$utils$svgMath . TEST _ONLY = { XY _REGEX : module$contents$Blockly$utils$svgMath _XY _REGEX , XY _STYLE _REGEX : module$contents$Blockly$utils$svgMath _XY _STYLE _REGEX } ; var module$exports$Blockly$utils$Svg = { Svg : function ( a ) { this . tagName _ = a } } ; module$exports$Blockly$utils$Svg . Svg . prototype . toString = function ( ) { return this . tagName _ } ; module$exports$Blockly$utils$Svg . Svg . ANIMATE = new module$exports$Blockly$utils$Svg . Svg ( "animate" ) ; module$exports$Blockly$utils$Svg . Svg . CIRCLE = new module$exports$Blockly$utils$Svg . Svg ( "circle" ) ; module$exports$Blockly$utils$Svg . Svg . CLIPPATH = new module$exports$Blockly$utils$Svg . Svg ( "clipPath" ) ; module$exports$Blockly$utils$Svg . Svg . DEFS = new module$exports$Blockly$utils$Svg . Svg ( "defs" ) ;
module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE = new module$exports$Blockly$utils$Svg . Svg ( "feComposite" ) ; module$exports$Blockly$utils$Svg . Svg . FECOMPONENTTRANSFER = new module$exports$Blockly$utils$Svg . Svg ( "feComponentTransfer" ) ; module$exports$Blockly$utils$Svg . Svg . FEFLOOD = new module$exports$Blockly$utils$Svg . Svg ( "feFlood" ) ; module$exports$Blockly$utils$Svg . Svg . FEFUNCA = new module$exports$Blockly$utils$Svg . Svg ( "feFuncA" ) ; module$exports$Blockly$utils$Svg . Svg . FEGAUSSIANBLUR = new module$exports$Blockly$utils$Svg . Svg ( "feGaussianBlur" ) ;
module$exports$Blockly$utils$Svg . Svg . FEPOINTLIGHT = new module$exports$Blockly$utils$Svg . Svg ( "fePointLight" ) ; module$exports$Blockly$utils$Svg . Svg . FESPECULARLIGHTING = new module$exports$Blockly$utils$Svg . Svg ( "feSpecularLighting" ) ; module$exports$Blockly$utils$Svg . Svg . FILTER = new module$exports$Blockly$utils$Svg . Svg ( "filter" ) ; module$exports$Blockly$utils$Svg . Svg . FOREIGNOBJECT = new module$exports$Blockly$utils$Svg . Svg ( "foreignObject" ) ; module$exports$Blockly$utils$Svg . Svg . G = new module$exports$Blockly$utils$Svg . Svg ( "g" ) ;
module$exports$Blockly$utils$Svg . Svg . IMAGE = new module$exports$Blockly$utils$Svg . Svg ( "image" ) ; module$exports$Blockly$utils$Svg . Svg . LINE = new module$exports$Blockly$utils$Svg . Svg ( "line" ) ; module$exports$Blockly$utils$Svg . Svg . PATH = new module$exports$Blockly$utils$Svg . Svg ( "path" ) ; module$exports$Blockly$utils$Svg . Svg . PATTERN = new module$exports$Blockly$utils$Svg . Svg ( "pattern" ) ; module$exports$Blockly$utils$Svg . Svg . POLYGON = new module$exports$Blockly$utils$Svg . Svg ( "polygon" ) ;
module$exports$Blockly$utils$Svg . Svg . RECT = new module$exports$Blockly$utils$Svg . Svg ( "rect" ) ; module$exports$Blockly$utils$Svg . Svg . SVG = new module$exports$Blockly$utils$Svg . Svg ( "svg" ) ; module$exports$Blockly$utils$Svg . Svg . TEXT = new module$exports$Blockly$utils$Svg . Svg ( "text" ) ; module$exports$Blockly$utils$Svg . Svg . TSPAN = new module$exports$Blockly$utils$Svg . Svg ( "tspan" ) ; var module$exports$Blockly$BlockDragSurfaceSvg = { BlockDragSurfaceSvg : function ( a ) { this . container _ = a ; this . createDom ( ) } } ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . SVG _ = null ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . dragGroup _ = null ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . container _ = null ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . scale _ = 1 ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . surfaceXY _ = null ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . childSurfaceXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . createDom = function ( ) { this . SVG _ || ( this . SVG _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . SVG , { xmlns : module$exports$Blockly$utils$dom . SVG _NS , "xmlns:html" : module$exports$Blockly$utils$dom . HTML _NS , "xmlns:xlink" : module$exports$Blockly$utils$dom . XLINK _NS , version : "1.1" , "class" : "blocklyBlockDragSurface" } , this . container _ ) , this . dragGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G ,
{ } , this . SVG _ ) ) } ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . setBlocksAndShow = function ( a ) { if ( this . dragGroup _ . childNodes . length ) throw Error ( "Already dragging a block." ) ; this . dragGroup _ . appendChild ( a ) ; this . SVG _ . style . display = "block" ; this . surfaceXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) } ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . translateAndScaleGroup = function ( a , b , c ) { this . scale _ = c ; a = a . toFixed ( 0 ) ; b = b . toFixed ( 0 ) ; this . childSurfaceXY _ . x = parseInt ( a , 10 ) ; this . childSurfaceXY _ . y = parseInt ( b , 10 ) ; this . dragGroup _ . setAttribute ( "transform" , "translate(" + a + "," + b + ") scale(" + c + ")" ) } ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . translateSurfaceInternal _ = function ( ) { var a = this . surfaceXY _ . x , b = this . surfaceXY _ . y ; a = a . toFixed ( 0 ) ; b = b . toFixed ( 0 ) ; this . SVG _ . style . display = "block" ; ( 0 , module$exports$Blockly$utils$dom . setCssTransform ) ( this . SVG _ , "translate3d(" + a + "px, " + b + "px, 0)" ) } ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . translateBy = function ( a , b ) { this . surfaceXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( this . surfaceXY _ . x + a , this . surfaceXY _ . y + b ) ; this . translateSurfaceInternal _ ( ) } ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . translateSurface = function ( a , b ) { this . surfaceXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( a * this . scale _ , b * this . scale _ ) ; this . translateSurfaceInternal _ ( ) } ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . getSurfaceTranslation = function ( ) { var a = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( this . SVG _ ) ; return new module$exports$Blockly$utils$Coordinate . Coordinate ( a . x / this . scale _ , a . y / this . scale _ ) } ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . getGroup = function ( ) { return this . dragGroup _ } ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . getSvgRoot = function ( ) { return this . SVG _ } ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . getCurrentBlock = function ( ) { return this . dragGroup _ . firstChild } ; module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . getWsTranslation = function ( ) { return this . childSurfaceXY _ . clone ( ) } ;
module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg . prototype . clearAndHide = function ( a ) { a ? a . appendChild ( this . getCurrentBlock ( ) ) : this . dragGroup _ . removeChild ( this . getCurrentBlock ( ) ) ; this . SVG _ . style . display = "none" ; if ( this . dragGroup _ . childNodes . length ) throw Error ( "Drag group was not cleared." ) ; this . surfaceXY _ = null } ; var module$exports$Blockly$DropDownDiv = { DropDownDiv : function ( ) { } } ; module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _SIZE = 16 ; module$exports$Blockly$DropDownDiv . DropDownDiv . BORDER _SIZE = 1 ; module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _HORIZONTAL _PADDING = 12 ; module$exports$Blockly$DropDownDiv . DropDownDiv . PADDING _Y = 16 ; module$exports$Blockly$DropDownDiv . DropDownDiv . ANIMATION _TIME = . 25 ; module$exports$Blockly$DropDownDiv . DropDownDiv . animateOutTimer _ = null ;
module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ = null ; module$exports$Blockly$DropDownDiv . DropDownDiv . rendererClassName _ = "" ; module$exports$Blockly$DropDownDiv . DropDownDiv . themeClassName _ = "" ; module$exports$Blockly$DropDownDiv . DropDownDiv . boundsElement _ = null ; module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ = null ; module$exports$Blockly$DropDownDiv . DropDownDiv . positionToField _ = null ;
module$exports$Blockly$DropDownDiv . DropDownDiv . createDom = function ( ) { if ( ! module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ ) { var a = document . createElement ( "div" ) ; a . className = "blocklyDropDownDiv" ; ( ( 0 , $ . module$exports$Blockly$common . getParentContainer ) ( ) || document . body ) . appendChild ( a ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ = a ; a = document . createElement ( "div" ) ; a . className = "blocklyDropDownContent" ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . appendChild ( a ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . content _ =
a ; a = document . createElement ( "div" ) ; a . className = "blocklyDropDownArrow" ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . appendChild ( a ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . arrow _ = a ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . style . opacity = 0 ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . style . transition = "transform " + module$exports$Blockly$DropDownDiv . DropDownDiv . ANIMATION _TIME + "s, opacity " + module$exports$Blockly$DropDownDiv . DropDownDiv . ANIMATION _TIME + "s" ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . addEventListener ( "focusin" ,
function ( ) { ( 0 , module$exports$Blockly$utils$dom . addClass ) ( module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ , "blocklyFocused" ) } ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . addEventListener ( "focusout" , function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ , "blocklyFocused" ) } ) } } ; module$exports$Blockly$DropDownDiv . DropDownDiv . setBoundsElement = function ( a ) { module$exports$Blockly$DropDownDiv . DropDownDiv . boundsElement _ = a } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . getContentDiv = function ( ) { return module$exports$Blockly$DropDownDiv . DropDownDiv . content _ } ; module$exports$Blockly$DropDownDiv . DropDownDiv . clearContent = function ( ) { module$exports$Blockly$DropDownDiv . DropDownDiv . content _ . textContent = "" ; module$exports$Blockly$DropDownDiv . DropDownDiv . content _ . style . width = "" } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . setColour = function ( a , b ) { module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . style . backgroundColor = a ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . style . borderColor = b } ; module$exports$Blockly$DropDownDiv . DropDownDiv . showPositionedByBlock = function ( a , b , c , d ) { return module$contents$Blockly$DropDownDiv _showPositionedByRect ( module$contents$Blockly$DropDownDiv _getScaledBboxOfBlock ( b ) , a , c , d ) } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . showPositionedByField = function ( a , b , c ) { module$exports$Blockly$DropDownDiv . DropDownDiv . positionToField _ = ! 0 ; return module$contents$Blockly$DropDownDiv _showPositionedByRect ( module$contents$Blockly$DropDownDiv _getScaledBboxOfField ( a ) , a , b , c ) } ;
var module$contents$Blockly$DropDownDiv _internal = { } , module$contents$Blockly$DropDownDiv _getScaledBboxOfBlock = function ( a ) { var b = a . getSvgRoot ( ) , c = b . getBBox ( ) , d = a . workspace . scale ; a = c . height * d ; c = c . width * d ; b = ( 0 , module$exports$Blockly$utils$style . getPageOffset ) ( b ) ; return new module$exports$Blockly$utils$Rect . Rect ( b . y , b . y + a , b . x , b . x + c ) } , module$contents$Blockly$DropDownDiv _getScaledBboxOfField = function ( a ) { a = a . getScaledBBox ( ) ; return new module$exports$Blockly$utils$Rect . Rect ( a . top , a . bottom , a . left , a . right ) } ,
module$contents$Blockly$DropDownDiv _showPositionedByRect = function ( a , b , c , d ) { var e = a . left + ( a . right - a . left ) / 2 , f = a . bottom ; a = a . top ; d && ( a += d ) ; d = b . getSourceBlock ( ) ; for ( var g = d . workspace ; g . options . parentWorkspace ; ) g = g . options . parentWorkspace ; module$exports$Blockly$DropDownDiv . DropDownDiv . setBoundsElement ( g . getParentSvg ( ) . parentNode ) ; return module$exports$Blockly$DropDownDiv . DropDownDiv . show ( b , d . RTL , e , f , e , a , c ) } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . show = function ( a , b , c , d , e , f , g ) { module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ = a ; module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ = g || null ; a = module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ ; a . style . direction = b ? "rtl" : "ltr" ; b = ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . rendererClassName _ = b . getRenderer ( ) . getClassName ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . themeClassName _ = b . getTheme ( ) . getClassName ( ) ;
( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , module$exports$Blockly$DropDownDiv . DropDownDiv . rendererClassName _ ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , module$exports$Blockly$DropDownDiv . DropDownDiv . themeClassName _ ) ; return module$contents$Blockly$DropDownDiv _positionInternal ( c , d , e , f ) } ;
module$contents$Blockly$DropDownDiv _internal . getBoundsInfo = function ( ) { var a = ( 0 , module$exports$Blockly$utils$style . getPageOffset ) ( module$exports$Blockly$DropDownDiv . DropDownDiv . boundsElement _ ) , b = ( 0 , module$exports$Blockly$utils$style . getSize ) ( module$exports$Blockly$DropDownDiv . DropDownDiv . boundsElement _ ) ; return { left : a . x , right : a . x + b . width , top : a . y , bottom : a . y + b . height , width : b . width , height : b . height } } ;
module$contents$Blockly$DropDownDiv _internal . getPositionMetrics = function ( a , b , c , d ) { var e = module$contents$Blockly$DropDownDiv _internal . getBoundsInfo ( ) , f = ( 0 , module$exports$Blockly$utils$style . getSize ) ( module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ ) ; return b + f . height < e . bottom ? module$contents$Blockly$DropDownDiv _getPositionBelowMetrics ( a , b , e , f ) : d - f . height > e . top ? module$contents$Blockly$DropDownDiv _getPositionAboveMetrics ( c , d , e , f ) : b + f . height < document . documentElement . clientHeight ? module$contents$Blockly$DropDownDiv _getPositionBelowMetrics ( a ,
b , e , f ) : d - f . height > document . documentElement . clientTop ? module$contents$Blockly$DropDownDiv _getPositionAboveMetrics ( c , d , e , f ) : module$contents$Blockly$DropDownDiv _getPositionTopOfPageMetrics ( a , e , f ) } ;
var module$contents$Blockly$DropDownDiv _getPositionBelowMetrics = function ( a , b , c , d ) { a = module$exports$Blockly$DropDownDiv . DropDownDiv . getPositionX ( a , c . left , c . right , d . width ) ; return { initialX : a . divX , initialY : b , finalX : a . divX , finalY : b + module$exports$Blockly$DropDownDiv . DropDownDiv . PADDING _Y , arrowX : a . arrowX , arrowY : - ( module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _SIZE / 2 + module$exports$Blockly$DropDownDiv . DropDownDiv . BORDER _SIZE ) , arrowAtTop : ! 0 , arrowVisible : ! 0 } } , module$contents$Blockly$DropDownDiv _getPositionAboveMetrics =
function ( a , b , c , d ) { a = module$exports$Blockly$DropDownDiv . DropDownDiv . getPositionX ( a , c . left , c . right , d . width ) ; return { initialX : a . divX , initialY : b - d . height , finalX : a . divX , finalY : b - d . height - module$exports$Blockly$DropDownDiv . DropDownDiv . PADDING _Y , arrowX : a . arrowX , arrowY : d . height - 2 * module$exports$Blockly$DropDownDiv . DropDownDiv . BORDER _SIZE - module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _SIZE / 2 , arrowAtTop : ! 1 , arrowVisible : ! 0 } } , module$contents$Blockly$DropDownDiv _getPositionTopOfPageMetrics = function ( a , b , c ) { a =
module$exports$Blockly$DropDownDiv . DropDownDiv . getPositionX ( a , b . left , b . right , c . width ) ; return { initialX : a . divX , initialY : 0 , finalX : a . divX , finalY : 0 , arrowAtTop : null , arrowX : null , arrowY : null , arrowVisible : ! 1 } } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . getPositionX = function ( a , b , c , d ) { b = ( 0 , module$exports$Blockly$utils$math . clamp ) ( b , a - d / 2 , c - d ) ; a = a - module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _SIZE / 2 - b ; c = module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _HORIZONTAL _PADDING ; a = ( 0 , module$exports$Blockly$utils$math . clamp ) ( c , a , d - c - module$exports$Blockly$DropDownDiv . DropDownDiv . ARROW _SIZE ) ; return { arrowX : a , divX : b } } ; module$exports$Blockly$DropDownDiv . DropDownDiv . isVisible = function ( ) { return ! ! module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . hideIfOwner = function ( a , b ) { return module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ === a ? ( b ? module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) : module$exports$Blockly$DropDownDiv . DropDownDiv . hide ( ) , ! 0 ) : ! 1 } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . hide = function ( ) { module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . style . transform = "translate(0, 0)" ; module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ . style . opacity = 0 ; module$exports$Blockly$DropDownDiv . DropDownDiv . animateOutTimer _ = setTimeout ( function ( ) { module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) } , 1E3 * module$exports$Blockly$DropDownDiv . DropDownDiv . ANIMATION _TIME ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ && ( module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ ( ) ,
module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ = null ) } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation = function ( ) { if ( module$exports$Blockly$DropDownDiv . DropDownDiv . isVisible ( ) ) { module$exports$Blockly$DropDownDiv . DropDownDiv . animateOutTimer _ && clearTimeout ( module$exports$Blockly$DropDownDiv . DropDownDiv . animateOutTimer _ ) ; var a = module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ ; a . style . transform = "" ; a . style . left = "" ; a . style . top = "" ; a . style . opacity = 0 ; a . style . display = "none" ; a . style . backgroundColor = "" ; a . style . borderColor = "" ; module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ &&
( module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ ( ) , module$exports$Blockly$DropDownDiv . DropDownDiv . onHide _ = null ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . clearContent ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ = null ; module$exports$Blockly$DropDownDiv . DropDownDiv . rendererClassName _ && ( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , module$exports$Blockly$DropDownDiv . DropDownDiv . rendererClassName _ ) , module$exports$Blockly$DropDownDiv . DropDownDiv . rendererClassName _ = "" ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . themeClassName _ &&
( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , module$exports$Blockly$DropDownDiv . DropDownDiv . themeClassName _ ) , module$exports$Blockly$DropDownDiv . DropDownDiv . themeClassName _ = "" ) ; ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) . markFocused ( ) } } ;
var module$contents$Blockly$DropDownDiv _positionInternal = function ( a , b , c , d ) { a = module$contents$Blockly$DropDownDiv _internal . getPositionMetrics ( a , b , c , d ) ; a . arrowVisible ? ( module$exports$Blockly$DropDownDiv . DropDownDiv . arrow _ . style . display = "" , module$exports$Blockly$DropDownDiv . DropDownDiv . arrow _ . style . transform = "translate(" + a . arrowX + "px," + a . arrowY + "px) rotate(45deg)" , module$exports$Blockly$DropDownDiv . DropDownDiv . arrow _ . setAttribute ( "class" , a . arrowAtTop ? "blocklyDropDownArrow blocklyArrowTop" : "blocklyDropDownArrow blocklyArrowBottom" ) ) :
module$exports$Blockly$DropDownDiv . DropDownDiv . arrow _ . style . display = "none" ; b = Math . floor ( a . initialX ) ; c = Math . floor ( a . initialY ) ; d = Math . floor ( a . finalX ) ; var e = Math . floor ( a . finalY ) , f = module$exports$Blockly$DropDownDiv . DropDownDiv . DIV _ ; f . style . left = b + "px" ; f . style . top = c + "px" ; f . style . display = "block" ; f . style . opacity = 1 ; f . style . transform = "translate(" + ( d - b ) + "px," + ( e - c ) + "px)" ; return ! ! a . arrowAtTop } ;
module$exports$Blockly$DropDownDiv . DropDownDiv . repositionForWindowResize = function ( ) { if ( module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ ) { var a = module$exports$Blockly$DropDownDiv . DropDownDiv . owner _ , b = a . getSourceBlock ( ) ; a = module$exports$Blockly$DropDownDiv . DropDownDiv . positionToField _ ? module$contents$Blockly$DropDownDiv _getScaledBboxOfField ( a ) : module$contents$Blockly$DropDownDiv _getScaledBboxOfBlock ( b ) ; b = a . left + ( a . right - a . left ) / 2 ; module$contents$Blockly$DropDownDiv _positionInternal ( b , a . bottom ,
b , a . top ) } else module$exports$Blockly$DropDownDiv . DropDownDiv . hide ( ) } ; module$exports$Blockly$DropDownDiv . DropDownDiv . TEST _ONLY = module$contents$Blockly$DropDownDiv _internal ; var module$exports$Blockly$Grid = { Grid : function ( a , b ) { this . gridPattern _ = a ; this . spacing _ = b . spacing ; this . length _ = b . length ; this . line2 _ = ( this . line1 _ = a . firstChild ) && this . line1 _ . nextSibling ; this . snapToGrid _ = b . snap } } ; module$exports$Blockly$Grid . Grid . prototype . scale _ = 1 ; module$exports$Blockly$Grid . Grid . prototype . dispose = function ( ) { this . gridPattern _ = null } ; module$exports$Blockly$Grid . Grid . prototype . shouldSnap = function ( ) { return this . snapToGrid _ } ; module$exports$Blockly$Grid . Grid . prototype . getSpacing = function ( ) { return this . spacing _ } ;
module$exports$Blockly$Grid . Grid . prototype . getPatternId = function ( ) { return this . gridPattern _ . id } ; module$exports$Blockly$Grid . Grid . prototype . update = function ( a ) { this . scale _ = a ; var b = this . spacing _ * a || 100 ; this . gridPattern _ . setAttribute ( "width" , b ) ; this . gridPattern _ . setAttribute ( "height" , b ) ; b = Math . floor ( this . spacing _ / 2 ) + . 5 ; var 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 ) } ;
module$exports$Blockly$Grid . Grid . prototype . setLineAttributes _ = function ( 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 ) ) } ; module$exports$Blockly$Grid . Grid . prototype . moveTo = function ( a , b ) { this . gridPattern _ . setAttribute ( "x" , a ) ; this . gridPattern _ . setAttribute ( "y" , b ) ; ( module$exports$Blockly$utils$userAgent . IE || module$exports$Blockly$utils$userAgent . EDGE ) && this . update ( this . scale _ ) } ;
module$exports$Blockly$Grid . Grid . createDom = function ( a , b , c ) { a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATTERN , { id : "blocklyGridPattern" + a , patternUnits : "userSpaceOnUse" } , c ) ; 0 < b . length && 0 < b . spacing ? ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { stroke : b . colour } , a ) , 1 < b . length && ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { stroke : b . colour } , a ) ) : ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE ,
{ } , a ) ; return a } ; $ . module$exports$Blockly$Msg = { } ; $ . module$exports$Blockly$Msg . Msg = Object . create ( null ) ; var module$contents$Blockly$utils$xml _xmlDocument ; $ . module$exports$Blockly$utils$xml = { NAME _SPACE : "https://developers.google.com/blockly/xml" } ; module$contents$Blockly$utils$xml _xmlDocument = $ . module$exports$Blockly$utils$global . globalThis . document ; $ . module$exports$Blockly$utils$xml . getDocument = function ( ) { return module$contents$Blockly$utils$xml _xmlDocument } ; $ . module$exports$Blockly$utils$xml . setDocument = function ( a ) { module$contents$Blockly$utils$xml _xmlDocument = a } ;
$ . module$exports$Blockly$utils$xml . createElement = function ( a ) { return module$contents$Blockly$utils$xml _xmlDocument . createElementNS ( $ . module$exports$Blockly$utils$xml . NAME _SPACE , a ) } ; $ . module$exports$Blockly$utils$xml . createTextNode = function ( a ) { return module$contents$Blockly$utils$xml _xmlDocument . createTextNode ( a ) } ; $ . module$exports$Blockly$utils$xml . textToDomDocument = function ( a ) { return ( new DOMParser ) . parseFromString ( a , "text/xml" ) } ; $ . module$exports$Blockly$utils$xml . domToText = function ( a ) { return ( new XMLSerializer ) . serializeToString ( a ) } ; $ . module$exports$Blockly$inputTypes = { } ; $ . module$exports$Blockly$inputTypes . inputTypes = { VALUE : $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE , STATEMENT : $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT , DUMMY : 5 } ; var module$contents$Blockly$Xml _fieldToDom , module$contents$Blockly$Xml _allFieldsToDom ;
$ . module$exports$Blockly$Xml = { workspaceToDom : function ( a , b ) { var c = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "xml" ) , d = ( 0 , $ . module$exports$Blockly$Xml . variablesToDom ) ( $ . module$exports$Blockly$Variables . allUsedVarModels ( a ) ) ; d . hasChildNodes ( ) && c . appendChild ( d ) ; d = a . getTopComments ( ! 0 ) ; for ( var e = 0 ; e < d . length ; e ++ ) c . appendChild ( d [ e ] . toXmlWithXY ( b ) ) ; a = a . getTopBlocks ( ! 0 ) ; for ( d = 0 ; d < a . length ; d ++ ) c . appendChild ( ( 0 , $ . module$exports$Blockly$Xml . blockToDomWithXY ) ( a [ d ] , b ) ) ; return c } , variablesToDom : function ( a ) { for ( var b =
( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "variables" ) , c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] , e = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "variable" ) ; e . appendChild ( ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( d . name ) ) ; d . type && e . setAttribute ( "type" , d . type ) ; e . id = d . getId ( ) ; b . appendChild ( e ) } return b } , blockToDomWithXY : function ( a , b ) { if ( a . isInsertionMarker ( ) && ( a = a . getChildren ( ! 1 ) [ 0 ] , ! a ) ) return new DocumentFragment ; var c ; a . workspace . RTL && ( c = a . workspace . getWidth ( ) ) ; b = ( 0 , $ . module$exports$Blockly$Xml . blockToDom ) ( a ,
b ) ; var d = a . getRelativeToSurfaceXY ( ) ; b . setAttribute ( "x" , Math . round ( a . workspace . RTL ? c - d . x : d . x ) ) ; b . setAttribute ( "y" , Math . round ( d . y ) ) ; return b } } ; module$contents$Blockly$Xml _fieldToDom = function ( a ) { if ( a . isSerializable ( ) ) { var b = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "field" ) ; b . setAttribute ( "name" , a . name || "" ) ; return a . toXml ( b ) } return null } ;
module$contents$Blockly$Xml _allFieldsToDom = function ( a , b ) { for ( var c = 0 ; c < a . inputList . length ; c ++ ) for ( var d = a . inputList [ c ] , e = 0 ; e < d . fieldRow . length ; e ++ ) { var f = module$contents$Blockly$Xml _fieldToDom ( d . fieldRow [ e ] ) ; f && b . appendChild ( f ) } } ;
$ . module$exports$Blockly$Xml . blockToDom = function ( a , b ) { if ( a . isInsertionMarker ( ) ) return ( b = a . getChildren ( ! 1 ) [ 0 ] ) ? ( 0 , $ . module$exports$Blockly$Xml . blockToDom ) ( b ) : new DocumentFragment ; var c = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( a . isShadow ( ) ? "shadow" : "block" ) ; c . setAttribute ( "type" , a . type ) ; b || c . setAttribute ( "id" , a . id ) ; if ( a . mutationToDom ) { var d = a . mutationToDom ( ) ; d && ( d . hasChildNodes ( ) || d . hasAttributes ( ) ) && c . appendChild ( d ) } module$contents$Blockly$Xml _allFieldsToDom ( a , c ) ; if ( d = a . getCommentText ( ) ) { var e =
a . commentModel . size , f = a . commentModel . pinned , g = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "comment" ) ; g . appendChild ( ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( d ) ) ; g . setAttribute ( "pinned" , f ) ; g . setAttribute ( "h" , e . height ) ; g . setAttribute ( "w" , e . width ) ; c . appendChild ( g ) } a . data && ( d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "data" ) , d . appendChild ( ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( a . data ) ) , c . appendChild ( d ) ) ; for ( d = 0 ; d < a . inputList . length ; d ++ ) if ( e = a . inputList [ d ] ,
f = void 0 , g = ! 0 , e . type !== $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ) { var h = e . connection . targetBlock ( ) ; e . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ? f = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "value" ) : e . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT && ( f = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "statement" ) ) ; var k = e . connection . getShadowDom ( ) ; ! k || h && h . isShadow ( ) || f . appendChild ( module$contents$Blockly$Xml _cloneShadow ( k , b ) ) ; h && ( h = ( 0 , $ . module$exports$Blockly$Xml . blockToDom ) ( h ,
b ) , h . nodeType === module$exports$Blockly$utils$dom . NodeType . ELEMENT _NODE && ( f . appendChild ( h ) , g = ! 1 ) ) ; f . setAttribute ( "name" , e . name ) ; g || c . appendChild ( f ) } void 0 !== a . inputsInline && a . inputsInline !== a . inputsInlineDefault && c . setAttribute ( "inline" , a . inputsInline ) ; a . isCollapsed ( ) && c . setAttribute ( "collapsed" , ! 0 ) ; a . isEnabled ( ) || c . setAttribute ( "disabled" , ! 0 ) ; a . isDeletable ( ) || a . isShadow ( ) || c . setAttribute ( "deletable" , ! 1 ) ; a . isMovable ( ) || a . isShadow ( ) || c . setAttribute ( "movable" , ! 1 ) ; a . isEditable ( ) || c . setAttribute ( "editable" ,
! 1 ) ; d = a . getNextBlock ( ) ; if ( d && ( e = ( 0 , $ . module$exports$Blockly$Xml . blockToDom ) ( d , b ) , e . nodeType === module$exports$Blockly$utils$dom . NodeType . ELEMENT _NODE ) ) { var l = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "next" ) ; l . appendChild ( e ) ; c . appendChild ( l ) } a = a . nextConnection && a . nextConnection . getShadowDom ( ) ; ! a || d && d . isShadow ( ) || l . appendChild ( module$contents$Blockly$Xml _cloneShadow ( a , b ) ) ; return c } ;
var module$contents$Blockly$Xml _cloneShadow = function ( a , b ) { for ( var c = a = a . cloneNode ( ! 0 ) , d ; c ; ) if ( b && "shadow" === c . nodeName && c . removeAttribute ( "id" ) , c . firstChild ) c = c . firstChild ; else { for ( ; c && ! c . nextSibling ; ) d = c , c = c . parentNode , d . nodeType === module$exports$Blockly$utils$dom . NodeType . TEXT _NODE && "" === d . data . trim ( ) && c . firstChild !== d && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( d ) ; c && ( d = c , c = c . nextSibling , d . nodeType === module$exports$Blockly$utils$dom . NodeType . TEXT _NODE && "" === d . data . trim ( ) && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( d ) ) } return a } ;
$ . module$exports$Blockly$Xml . domToText = function ( a ) { return ( 0 , $ . module$exports$Blockly$utils$xml . domToText ) ( a ) . replace ( /<(\w+)([^<]*)\/>/g , "<$1$2></$1>" ) } ; $ . module$exports$Blockly$Xml . domToPrettyText = function ( a ) { a = ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( a ) . split ( "<" ) ; for ( var b = "" , c = 1 ; c < a . length ; c ++ ) { var d = a [ c ] ; "/" === d [ 0 ] && ( b = b . substring ( 2 ) ) ; a [ c ] = b + "<" + d ; "/" !== d [ 0 ] && "/>" !== d . slice ( - 2 ) && ( b += " " ) } a = a . join ( "\n" ) ; a = a . replace ( /(<(\w+)\b[^>]*>[^\n]*)\n *<\/\2>/g , "$1</$2>" ) ; return a . replace ( /^\n/ , "" ) } ;
$ . module$exports$Blockly$Xml . textToDom = function ( a ) { var b = ( 0 , $ . module$exports$Blockly$utils$xml . textToDomDocument ) ( a ) ; if ( ! b || ! b . documentElement || b . getElementsByTagName ( "parsererror" ) . length ) throw Error ( "textToDom was unable to parse: " + a ) ; return b . documentElement } ; $ . module$exports$Blockly$Xml . clearWorkspaceAndLoadFromXml = function ( a , b ) { b . setResizesEnabled ( ! 1 ) ; b . clear ( ) ; a = ( 0 , $ . module$exports$Blockly$Xml . domToWorkspace ) ( a , b ) ; b . setResizesEnabled ( ! 0 ) ; return a } ;
$ . module$exports$Blockly$Xml . domToWorkspace = function ( a , b ) { if ( a instanceof module$exports$Blockly$Workspace . Workspace ) { var c = a ; a = b ; b = c ; console . warn ( "Deprecated call to domToWorkspace, swap the arguments." ) } var d ; b . RTL && ( d = b . getWidth ( ) ) ; c = [ ] ; ( 0 , module$exports$Blockly$utils$dom . startTextWidthCache ) ( ) ; var e = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; e || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; b . setResizesEnabled && b . setResizesEnabled ( ! 1 ) ; var f = ! 0 ; try { for ( var g = 0 , h = void 0 ; h = a . childNodes [ g ] ; g ++ ) { var k =
h . nodeName . toLowerCase ( ) , l = h ; if ( "block" === k || "shadow" === k && ! ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) ) { var m = ( 0 , $ . module$exports$Blockly$Xml . domToBlock ) ( l , b ) ; c . push ( m . id ) ; var n = l . hasAttribute ( "x" ) ? parseInt ( l . getAttribute ( "x" ) , 10 ) : 10 , p = l . hasAttribute ( "y" ) ? parseInt ( l . getAttribute ( "y" ) , 10 ) : 10 ; isNaN ( n ) || isNaN ( p ) || m . moveBy ( b . RTL ? d - n : n , p ) ; f = ! 1 } else { if ( "shadow" === k ) throw TypeError ( "Shadow block cannot be a top-level block." ) ; if ( "comment" === k ) if ( b . rendered ) { var q = module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg ;
q ? q . fromXml ( l , b , d ) : console . warn ( "Missing require for Blockly.WorkspaceCommentSvg, ignoring workspace comment." ) } else { var r = module$exports$Blockly$WorkspaceComment . WorkspaceComment ; r ? r . fromXml ( l , b ) : console . warn ( "Missing require for Blockly.WorkspaceComment, ignoring workspace comment." ) } else if ( "variables" === k ) { if ( f ) ( 0 , $ . module$exports$Blockly$Xml . domToVariables ) ( l , b ) ; else throw Error ( "'variables' tag must exist once before block and shadow tag elements in the workspace XML, but it was found in another location." ) ;
f = ! 1 } } } } finally { e || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) , ( 0 , module$exports$Blockly$utils$dom . stopTextWidthCache ) ( ) } b . setResizesEnabled && b . setResizesEnabled ( ! 0 ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . FINISHED _LOADING ) ) ( b ) ) ; return c } ;
$ . module$exports$Blockly$Xml . appendDomToWorkspace = function ( a , b ) { var c ; Object . prototype . hasOwnProperty . call ( b , "scale" ) && ( c = b . getBlocksBoundingBox ( ) ) ; a = ( 0 , $ . module$exports$Blockly$Xml . domToWorkspace ) ( a , b ) ; if ( c && c . top !== c . bottom ) { var d = c . bottom ; c = b . RTL ? c . right : c . left ; for ( var e = Infinity , f = - Infinity , g = Infinity , h = 0 ; h < a . length ; h ++ ) { var 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 ,
d ) } return a } ;
$ . module$exports$Blockly$Xml . domToBlock = function ( a , b ) { if ( a instanceof module$exports$Blockly$Workspace . Workspace ) { var c = a ; a = b ; b = c ; console . warn ( "Deprecated call to domToBlock, swap the arguments." ) } ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; c = b . getAllVariables ( ) ; try { var d = module$contents$Blockly$Xml _domToBlockHeadless ( a , b ) ; var e = d . getDescendants ( ! 1 ) ; if ( b . rendered ) { d . setConnectionTracking ( ! 1 ) ; for ( var f = e . length - 1 ; 0 <= f ; f -- ) e [ f ] . initSvg ( ) ; for ( var g = e . length - 1 ; 0 <= g ; g -- ) e [ g ] . render ( ! 1 ) ; setTimeout ( function ( ) { d . disposed ||
d . setConnectionTracking ( ! 0 ) } , 1 ) ; d . updateDisabled ( ) ; b . resizeContents ( ) } else for ( var h = e . length - 1 ; 0 <= h ; h -- ) e [ h ] . initModel ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } if ( ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) ) { a = $ . module$exports$Blockly$Variables . getAddedVariables ( b , c ) ; for ( b = 0 ; b < a . length ; b ++ ) e = a [ b ] , ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VAR _CREATE ) ) ( e ) ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CREATE ) ) ( d ) ) } return d } ;
$ . module$exports$Blockly$Xml . domToVariables = function ( a , b ) { for ( var c = 0 ; c < a . childNodes . length ; c ++ ) { var d = a . childNodes [ c ] ; if ( d . nodeType === module$exports$Blockly$utils$dom . NodeType . ELEMENT _NODE ) { var e = d . getAttribute ( "type" ) , f = d . getAttribute ( "id" ) ; b . createVariable ( d . textContent , e , f ) } } } ;
var module$contents$Blockly$Xml _childNodeTagMap , module$contents$Blockly$Xml _mapSupportedXmlTags = function ( a ) { for ( var b = { mutation : [ ] , comment : [ ] , data : [ ] , field : [ ] , input : [ ] , next : [ ] } , c = 0 ; c < a . childNodes . length ; c ++ ) { var d = a . childNodes [ c ] ; if ( d . nodeType !== module$exports$Blockly$utils$dom . NodeType . TEXT _NODE ) switch ( d . nodeName . toLowerCase ( ) ) { case "mutation" : b . mutation . push ( d ) ; break ; case "comment" : if ( ! module$exports$Blockly$Comment ) { console . warn ( "Missing require for Comment, ignoring block comment." ) ; break } 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 ) ; break ; default : console . warn ( "Ignoring unknown tag: " + d . nodeName ) } } return b } , module$contents$Blockly$Xml _applyMutationTagNodes = function ( a , b ) { for ( var c = ! 1 , d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] ; b . domToMutation && ( b . domToMutation ( e ) , b . initSvg && ( c = ! 0 ) ) } return c } , module$contents$Blockly$Xml _applyCommentTagNodes = function ( a , b ) { for ( var c = 0 ; c < a . length ; c ++ ) { var d =
a [ c ] , e = d . textContent , f = "true" === d . getAttribute ( "pinned" ) , g = parseInt ( d . getAttribute ( "w" ) , 10 ) ; d = parseInt ( d . getAttribute ( "h" ) , 10 ) ; b . setCommentText ( e ) ; b . commentModel . pinned = f ; isNaN ( g ) || isNaN ( d ) || ( b . commentModel . size = new module$exports$Blockly$utils$Size . Size ( g , d ) ) ; f && b . getCommentIcon && ! b . isInFlyout && setTimeout ( function ( ) { b . getCommentIcon ( ) . setVisible ( ! 0 ) } , 1 ) } } , module$contents$Blockly$Xml _applyDataTagNodes = function ( a , b ) { for ( var c = 0 ; c < a . length ; c ++ ) b . data = a [ c ] . textContent } , module$contents$Blockly$Xml _applyFieldTagNodes =
function ( a , b ) { for ( var c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] , e = d . getAttribute ( "name" ) ; module$contents$Blockly$Xml _domToField ( b , e , d ) } } , module$contents$Blockly$Xml _findChildBlocks = function ( a ) { for ( var b = { childBlockElement : null , childShadowElement : null } , c = 0 ; c < a . childNodes . length ; c ++ ) { var d = a . childNodes [ c ] ; d . nodeType === module$exports$Blockly$utils$dom . NodeType . ELEMENT _NODE && ( "block" === d . nodeName . toLowerCase ( ) ? b . childBlockElement = d : "shadow" === d . nodeName . toLowerCase ( ) && ( b . childShadowElement = d ) ) } return b } , module$contents$Blockly$Xml _applyInputTagNodes =
function ( a , b , c , d ) { for ( var e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] , g = f . getAttribute ( "name" ) , h = c . getInput ( g ) ; if ( ! h ) { console . warn ( "Ignoring non-existent input " + g + " in block " + d ) ; break } f = module$contents$Blockly$Xml _findChildBlocks ( f ) ; if ( f . childBlockElement ) { if ( ! h . connection ) throw TypeError ( "Input connection does not exist." ) ; module$contents$Blockly$Xml _domToBlockHeadless ( f . childBlockElement , b , h . connection , ! 1 ) } f . childShadowElement && h . connection . setShadowDom ( f . childShadowElement ) } } , module$contents$Blockly$Xml _applyNextTagNodes =
function ( a , b , c ) { for ( var d = 0 ; d < a . length ; d ++ ) { var e = module$contents$Blockly$Xml _findChildBlocks ( a [ d ] ) ; if ( e . childBlockElement ) { if ( ! c . nextConnection ) throw TypeError ( "Next statement does not exist." ) ; if ( c . nextConnection . isConnected ( ) ) throw TypeError ( "Next statement is already connected." ) ; module$contents$Blockly$Xml _domToBlockHeadless ( e . childBlockElement , b , c . nextConnection , ! 0 ) } e . childShadowElement && c . nextConnection && c . nextConnection . setShadowDom ( e . childShadowElement ) } } , module$contents$Blockly$Xml _domToBlockHeadless =
function ( a , b , c , d ) { var e = a . getAttribute ( "type" ) ; if ( ! e ) throw TypeError ( "Block type unspecified: " + a . outerHTML ) ; var f = a . getAttribute ( "id" ) ; f = b . newBlock ( e , f ) ; var g = module$contents$Blockly$Xml _mapSupportedXmlTags ( a ) , h = module$contents$Blockly$Xml _applyMutationTagNodes ( g . mutation , f ) ; module$contents$Blockly$Xml _applyCommentTagNodes ( g . comment , f ) ; module$contents$Blockly$Xml _applyDataTagNodes ( g . data , f ) ; if ( c ) if ( d ) if ( f . previousConnection ) c . connect ( f . previousConnection ) ; else throw TypeError ( "Next block does not have previous statement." ) ;
else if ( f . outputConnection ) c . connect ( f . outputConnection ) ; else if ( f . previousConnection ) c . connect ( f . previousConnection ) ; else throw TypeError ( "Child block does not have output or previous statement." ) ; module$contents$Blockly$Xml _applyFieldTagNodes ( g . field , f ) ; module$contents$Blockly$Xml _applyInputTagNodes ( g . input , b , f , e ) ; module$contents$Blockly$Xml _applyNextTagNodes ( g . next , b , f ) ; h && f . initSvg ( ) ; ( b = a . getAttribute ( "inline" ) ) && f . setInputsInline ( "true" === b ) ; ( b = a . getAttribute ( "disabled" ) ) && f . setEnabled ( "true" !==
b && "disabled" !== b ) ; ( b = a . getAttribute ( "deletable" ) ) && f . setDeletable ( "true" === b ) ; ( b = a . getAttribute ( "movable" ) ) && f . setMovable ( "true" === b ) ; ( b = a . getAttribute ( "editable" ) ) && f . setEditable ( "true" === b ) ; ( b = a . getAttribute ( "collapsed" ) ) && f . setCollapsed ( "true" === b ) ; if ( "shadow" === a . nodeName . toLowerCase ( ) ) { a = f . getChildren ( ! 1 ) ; for ( b = 0 ; b < a . length ; b ++ ) if ( ! a [ b ] . isShadow ( ) ) throw TypeError ( "Shadow block not allowed non-shadow child." ) ; if ( f . getVarModels ( ) . length ) throw TypeError ( "Shadow blocks cannot have variable references." ) ;
f . setShadow ( ! 0 ) } return f } , module$contents$Blockly$Xml _domToField = function ( a , b , c ) { var d = a . getField ( b ) ; d ? d . fromXml ( c ) : console . warn ( "Ignoring non-existent field " + b + " in block " + a . type ) } ; $ . module$exports$Blockly$Xml . deleteNext = function ( a ) { for ( var b = 0 ; b < a . childNodes . length ; b ++ ) { var c = a . childNodes [ b ] ; if ( "next" === c . nodeName . toLowerCase ( ) ) { a . removeChild ( c ) ; break } } } ; var module$exports$Blockly$utils$toolbox = { } , module$contents$Blockly$utils$toolbox _CATEGORY _TOOLBOX _KIND = "categoryToolbox" , module$contents$Blockly$utils$toolbox _FLYOUT _TOOLBOX _KIND = "flyoutToolbox" ; module$exports$Blockly$utils$toolbox . Position = { TOP : 0 , BOTTOM : 1 , LEFT : 2 , RIGHT : 3 } ;
module$exports$Blockly$utils$toolbox . convertToolboxDefToJson = function ( a ) { if ( ! a ) return null ; if ( a instanceof Element || "string" === typeof a ) a = ( 0 , module$exports$Blockly$utils$toolbox . parseToolboxTree ) ( a ) , a = module$contents$Blockly$utils$toolbox _convertToToolboxJson ( a ) ; module$contents$Blockly$utils$toolbox _validateToolbox ( a ) ; return a } ;
var module$contents$Blockly$utils$toolbox _validateToolbox = function ( a ) { var b = a . kind ; a = a . contents ; if ( b && b !== module$contents$Blockly$utils$toolbox _FLYOUT _TOOLBOX _KIND && b !== module$contents$Blockly$utils$toolbox _CATEGORY _TOOLBOX _KIND ) throw Error ( "Invalid toolbox kind " + b + ". Please supply either " + module$contents$Blockly$utils$toolbox _FLYOUT _TOOLBOX _KIND + " or " + module$contents$Blockly$utils$toolbox _CATEGORY _TOOLBOX _KIND ) ; if ( ! a ) throw Error ( "Toolbox must have a contents attribute." ) ; } ;
module$exports$Blockly$utils$toolbox . convertFlyoutDefToJsonArray = function ( a ) { return a ? a . contents ? a . contents : Array . isArray ( a ) && 0 < a . length && ! a [ 0 ] . nodeType ? a : module$contents$Blockly$utils$toolbox _xmlToJsonArray ( a ) : [ ] } ; module$exports$Blockly$utils$toolbox . hasCategories = function ( a ) { if ( ! a ) return ! 1 ; var b = a . kind ; return b ? b === module$contents$Blockly$utils$toolbox _CATEGORY _TOOLBOX _KIND : ! ! a . contents . filter ( function ( c ) { return "CATEGORY" === c . kind . toUpperCase ( ) } ) . length } ;
module$exports$Blockly$utils$toolbox . isCategoryCollapsible = function ( a ) { return a && a . contents ? ! ! a . contents . filter ( function ( b ) { return "CATEGORY" === b . kind . toUpperCase ( ) } ) . length : ! 1 } ;
var module$contents$Blockly$utils$toolbox _convertToToolboxJson = function ( a ) { var b = { contents : module$contents$Blockly$utils$toolbox _xmlToJsonArray ( a ) } ; a instanceof Node && module$contents$Blockly$utils$toolbox _addAttributes ( a , b ) ; return b } , module$contents$Blockly$utils$toolbox _xmlToJsonArray = function ( a ) { var b = [ ] , c = a . childNodes ; c || ( c = a ) ; a = 0 ; for ( var d ; d = c [ a ] ; a ++ ) if ( d . tagName ) { var e = { } , f = d . tagName . toUpperCase ( ) ; e . kind = f ; "BLOCK" === f ? e . blockxml = d : d . childNodes && 0 < d . childNodes . length && ( e . contents = module$contents$Blockly$utils$toolbox _xmlToJsonArray ( d ) ) ;
module$contents$Blockly$utils$toolbox _addAttributes ( d , e ) ; b . push ( e ) } return b } , module$contents$Blockly$utils$toolbox _addAttributes = function ( a , b ) { for ( var c = 0 ; c < a . attributes . length ; c ++ ) { var d = a . attributes [ c ] ; - 1 < d . nodeName . indexOf ( "css-" ) ? ( b . cssconfig = b . cssconfig || { } , b . cssconfig [ d . nodeName . replace ( "css-" , "" ) ] = d . value ) : b [ d . nodeName ] = d . value } } ;
module$exports$Blockly$utils$toolbox . parseToolboxTree = function ( a ) { if ( a ) { if ( "string" !== typeof a && ( module$exports$Blockly$utils$userAgent . IE && a . outerHTML ? a = a . outerHTML : a instanceof Element || ( a = null ) ) , "string" === typeof a && ( a = ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a ) , "xml" !== a . nodeName . toLowerCase ( ) ) ) throw TypeError ( "Toolbox should be an <xml> document." ) ; } else a = null ; return a } ; $ . module$exports$Blockly$utils$object = { inherits : function ( a , b ) { a . superClass _ = b . prototype ; Object . setPrototypeOf ( a , b ) ; a . prototype = Object . create ( b . prototype ) ; a . prototype . constructor = a } , mixin : function ( a , b ) { for ( var c in b ) a [ c ] = b [ c ] } , deepMerge : function ( a , b ) { for ( var c in b ) a [ c ] = null !== b [ c ] && "object" === typeof b [ c ] ? ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( a [ c ] || Object . create ( null ) , b [ c ] ) : b [ c ] ; return a } , values : function ( a ) { return Object . values ? Object . values ( a ) : Object . keys ( a ) . map ( function ( b ) { return a [ b ] } ) } } ; var module$exports$Blockly$Theme = { Theme : function ( a , b , c , d ) { this . name = a ; this . blockStyles = b || Object . create ( null ) ; this . categoryStyles = c || Object . create ( null ) ; this . componentStyles = d || Object . create ( null ) ; this . fontStyle = Object . create ( null ) ; this . startHats = null ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . THEME , a , this ) } } ; module$exports$Blockly$Theme . Theme . prototype . getClassName = function ( ) { return this . name + "-theme" } ;
module$exports$Blockly$Theme . Theme . prototype . setBlockStyle = function ( a , b ) { this . blockStyles [ a ] = b } ; module$exports$Blockly$Theme . Theme . prototype . setCategoryStyle = function ( a , b ) { this . categoryStyles [ a ] = b } ; module$exports$Blockly$Theme . Theme . prototype . getComponentStyle = function ( a ) { return ( a = this . componentStyles [ a ] ) && "string" === typeof a && this . getComponentStyle ( a ) ? this . getComponentStyle ( a ) : a ? String ( a ) : null } ; module$exports$Blockly$Theme . Theme . prototype . setComponentStyle = function ( a , b ) { this . componentStyles [ a ] = b } ;
module$exports$Blockly$Theme . Theme . prototype . setFontStyle = function ( a ) { this . fontStyle = a } ; module$exports$Blockly$Theme . Theme . prototype . setStartHats = function ( a ) { this . startHats = a } ;
module$exports$Blockly$Theme . Theme . defineTheme = function ( a , b ) { var c = new module$exports$Blockly$Theme . Theme ( a ) , d = b . base ; d && ( "string" === typeof d && ( d = ( 0 , module$exports$Blockly$registry . getObject ) ( module$exports$Blockly$registry . Type . THEME , d ) ) , d instanceof module$exports$Blockly$Theme . Theme && ( ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( c , d ) , c . name = a ) ) ; ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( c . blockStyles , b . blockStyles ) ; ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( c . categoryStyles ,
b . categoryStyles ) ; ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( c . componentStyles , b . componentStyles ) ; ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( c . fontStyle , b . fontStyle ) ; null !== b . startHats && ( c . startHats = b . startHats ) ; return c } ; var module$exports$Blockly$Themes$Classic = { } , module$contents$Blockly$Themes$Classic _defaultBlockStyles = { colour _blocks : { colourPrimary : "20" } , list _blocks : { colourPrimary : "260" } , logic _blocks : { colourPrimary : "210" } , loop _blocks : { colourPrimary : "120" } , math _blocks : { colourPrimary : "230" } , procedure _blocks : { colourPrimary : "290" } , text _blocks : { colourPrimary : "160" } , variable _blocks : { colourPrimary : "330" } , variable _dynamic _blocks : { colourPrimary : "310" } , hat _blocks : { colourPrimary : "330" , hat : "cap" } } , module$contents$Blockly$Themes$Classic _categoryStyles =
{ colour _category : { colour : "20" } , list _category : { colour : "260" } , logic _category : { colour : "210" } , loop _category : { colour : "120" } , math _category : { colour : "230" } , procedure _category : { colour : "290" } , text _category : { colour : "160" } , variable _category : { colour : "330" } , variable _dynamic _category : { colour : "310" } } ; module$exports$Blockly$Themes$Classic . Classic = new module$exports$Blockly$Theme . Theme ( "classic" , module$contents$Blockly$Themes$Classic _defaultBlockStyles , module$contents$Blockly$Themes$Classic _categoryStyles ) ; var module$exports$Blockly$Options = { Options : function ( a ) { var b = null , c = ! 1 , d = ! 1 , e = ! 1 , f = ! 1 , g = ! 1 , h = ! 1 , k = ! ! a . readOnly ; k || ( b = ( 0 , module$exports$Blockly$utils$toolbox . convertToolboxDefToJson ) ( a . toolbox ) , c = ( 0 , module$exports$Blockly$utils$toolbox . hasCategories ) ( b ) , d = a . trashcan , void 0 === d && ( d = c ) , e = a . collapse , void 0 === e && ( e = c ) , f = a . comments , void 0 === f && ( f = c ) , g = a . disable , void 0 === g && ( g = c ) , h = a . sounds , void 0 === h && ( h = ! 0 ) ) ; var l = a . maxTrashcanContents ; d ? void 0 === l && ( l = 32 ) : l = 0 ; var m = ! ! a . rtl , n = a . horizontalLayout ; void 0 ===
n && ( n = ! 1 ) ; var p = a . toolboxPosition ; p = "end" !== p ; p = n ? p ? module$exports$Blockly$utils$toolbox . Position . TOP : module$exports$Blockly$utils$toolbox . Position . BOTTOM : p === m ? module$exports$Blockly$utils$toolbox . Position . RIGHT : module$exports$Blockly$utils$toolbox . Position . LEFT ; var q = a . css ; void 0 === q && ( q = ! 0 ) ; var r = "https://blockly-demo.appspot.com/static/media/" ; a . media ? r = a . media : a . path && ( r = a . path + "media/" ) ; var t = void 0 === a . oneBasedIndex ? ! 0 : ! ! a . oneBasedIndex ; var u = a . renderer || "geras" , v = a . plugins || { } ; this . RTL = m ;
this . oneBasedIndex = t ; this . collapse = e ; this . comments = f ; this . disable = g ; this . readOnly = k ; this . maxBlocks = a . maxBlocks || Infinity ; this . maxInstances = a . maxInstances ; this . pathToMedia = r ; this . hasCategories = c ; this . moveOptions = module$exports$Blockly$Options . Options . parseMoveOptions _ ( a , c ) ; this . hasScrollbars = ! ! this . moveOptions . scrollbars ; this . hasTrashcan = d ; this . maxTrashcanContents = l ; this . hasSounds = h ; this . hasCss = q ; this . horizontalLayout = n ; this . languageTree = b ; this . gridOptions = module$exports$Blockly$Options . Options . parseGridOptions _ ( a ) ;
this . zoomOptions = module$exports$Blockly$Options . Options . parseZoomOptions _ ( a ) ; this . toolboxPosition = p ; this . theme = module$exports$Blockly$Options . Options . parseThemeOptions _ ( a ) ; this . renderer = u ; this . rendererOverrides = a . rendererOverrides ; this . gridPattern = null ; this . parentWorkspace = a . parentWorkspace ; this . plugins = v } } ;
module$exports$Blockly$Options . Options . parseMoveOptions _ = function ( a , b ) { var c = a . move || { } , d = { } ; void 0 === c . scrollbars && void 0 === a . scrollbars ? d . scrollbars = b : "object" === typeof c . scrollbars ? ( d . scrollbars = { } , d . scrollbars . horizontal = ! ! c . scrollbars . horizontal , d . scrollbars . vertical = ! ! c . scrollbars . vertical , d . scrollbars . horizontal && d . scrollbars . vertical ? d . scrollbars = ! 0 : d . scrollbars . horizontal || d . scrollbars . vertical || ( d . scrollbars = ! 1 ) ) : d . scrollbars = ! ! c . scrollbars || ! ! a . scrollbars ; d . wheel = d . scrollbars && void 0 !==
c . wheel ? ! ! c . wheel : "object" === typeof d . scrollbars ; d . drag = d . scrollbars ? void 0 === c . drag ? ! 0 : ! ! c . drag : ! 1 ; return d } ;
module$exports$Blockly$Options . Options . parseZoomOptions _ = function ( a ) { a = a . zoom || { } ; var b = { } ; b . controls = void 0 === a . controls ? ! 1 : ! ! a . controls ; b . wheel = void 0 === a . wheel ? ! 1 : ! ! a . wheel ; b . startScale = void 0 === a . startScale ? 1 : Number ( a . startScale ) ; b . maxScale = void 0 === a . maxScale ? 3 : Number ( a . maxScale ) ; b . minScale = void 0 === a . minScale ? . 3 : Number ( a . minScale ) ; b . scaleSpeed = void 0 === a . scaleSpeed ? 1.2 : Number ( a . scaleSpeed ) ; b . pinch = void 0 === a . pinch ? b . wheel || b . controls : ! ! a . pinch ; return b } ;
module$exports$Blockly$Options . Options . parseGridOptions _ = function ( a ) { a = a . grid || { } ; var b = { } ; b . spacing = Number ( a . spacing ) || 0 ; b . colour = a . colour || "#888" ; b . length = void 0 === a . length ? 1 : Number ( a . length ) ; b . snap = 0 < b . spacing && ! ! a . snap ; return b } ;
module$exports$Blockly$Options . Options . parseThemeOptions _ = function ( a ) { a = a . theme || module$exports$Blockly$Themes$Classic . Classic ; return "string" === typeof a ? ( 0 , module$exports$Blockly$registry . getObject ) ( module$exports$Blockly$registry . Type . THEME , a ) : a instanceof module$exports$Blockly$Theme . Theme ? a : module$exports$Blockly$Theme . Theme . defineTheme ( a . name || "builtin" + ( 0 , module$exports$Blockly$utils$idGenerator . getNextUniqueId ) ( ) , a ) } ; var module$exports$Blockly$Scrollbar = { Scrollbar : function ( a , b , c , d , e ) { this . workspace _ = a ; this . pair _ = c || ! 1 ; this . horizontal _ = b ; this . margin _ = void 0 !== e ? e : module$exports$Blockly$Scrollbar . Scrollbar . DEFAULT _SCROLLBAR _MARGIN ; this . ratio = this . oldHostMetrics _ = null ; this . createDom _ ( d ) ; this . position = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; a = module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ; b ? ( this . svgBackground _ . setAttribute ( "height" , a ) , this . outerSvg _ . setAttribute ( "height" , a ) , this . svgHandle _ . setAttribute ( "height" ,
a - 5 ) , this . svgHandle _ . setAttribute ( "y" , 2.5 ) , this . lengthAttribute _ = "width" , this . positionAttribute _ = "x" ) : ( this . svgBackground _ . setAttribute ( "width" , a ) , this . outerSvg _ . setAttribute ( "width" , a ) , this . svgHandle _ . setAttribute ( "width" , a - 5 ) , this . svgHandle _ . setAttribute ( "x" , 2.5 ) , this . lengthAttribute _ = "height" , this . positionAttribute _ = "y" ) ; this . onMouseDownBarWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgBackground _ , "mousedown" , this , this . onMouseDownBar _ ) ; this . onMouseDownHandleWrapper _ =
( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgHandle _ , "mousedown" , this , this . onMouseDownHandle _ ) } } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . origin _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . startDragMouse _ = 0 ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . scrollbarLength _ = 0 ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . handleLength _ = 0 ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . handlePosition _ = 0 ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . isVisible _ = ! 0 ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . containerVisible _ = ! 0 ; module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness = 15 ; module$exports$Blockly$Touch . TOUCH _ENABLED && ( module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness = 25 ) ; module$exports$Blockly$Scrollbar . Scrollbar . DEFAULT _SCROLLBAR _MARGIN = . 5 ;
module$exports$Blockly$Scrollbar . Scrollbar . metricsAreEquivalent _ = function ( a , b ) { return a . viewWidth === b . viewWidth && a . viewHeight === b . viewHeight && a . viewLeft === b . viewLeft && a . viewTop === b . viewTop && a . absoluteTop === b . absoluteTop && a . absoluteLeft === b . absoluteLeft && a . scrollWidth === b . scrollWidth && a . scrollHeight === b . scrollHeight && a . scrollLeft === b . scrollLeft && a . scrollTop === b . scrollTop } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . dispose = function ( ) { this . cleanUp _ ( ) ; ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseDownBarWrapper _ ) ; this . onMouseDownBarWrapper _ = null ; ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseDownHandleWrapper _ ) ; this . onMouseDownHandleWrapper _ = null ; ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . outerSvg _ ) ; this . svgBackground _ = this . svgGroup _ = this . outerSvg _ = null ; this . svgHandle _ && ( this . workspace _ . getThemeManager ( ) . unsubscribe ( this . svgHandle _ ) ,
this . svgHandle _ = null ) ; this . workspace _ = null } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . constrainHandleLength _ = function ( a ) { return a = 0 >= a || isNaN ( a ) ? 0 : Math . min ( a , this . scrollbarLength _ ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . setHandleLength _ = function ( a ) { this . handleLength _ = a ; this . svgHandle _ . setAttribute ( this . lengthAttribute _ , this . handleLength _ ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . constrainHandlePosition _ = function ( a ) { return a = 0 >= a || isNaN ( a ) ? 0 : Math . min ( a , this . scrollbarLength _ - this . handleLength _ ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . setHandlePosition = function ( a ) { this . handlePosition _ = a ; this . svgHandle _ . setAttribute ( this . positionAttribute _ , this . handlePosition _ ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . setScrollbarLength _ = function ( a ) { this . scrollbarLength _ = a ; this . outerSvg _ . setAttribute ( this . lengthAttribute _ , this . scrollbarLength _ ) ; this . svgBackground _ . setAttribute ( this . lengthAttribute _ , this . scrollbarLength _ ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . setPosition = function ( a , b ) { this . position . x = a ; this . position . y = b ; ( 0 , module$exports$Blockly$utils$dom . setCssTransform ) ( this . outerSvg _ , "translate(" + ( this . position . x + this . origin _ . x ) + "px," + ( this . position . y + this . origin _ . y ) + "px)" ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . resize = function ( a ) { if ( ! a && ( a = this . workspace _ . getMetrics ( ) , ! a ) ) return ; this . oldHostMetrics _ && module$exports$Blockly$Scrollbar . Scrollbar . metricsAreEquivalent _ ( a , this . oldHostMetrics _ ) || ( this . horizontal _ ? this . resizeHorizontal _ ( a ) : this . resizeVertical _ ( a ) , this . oldHostMetrics _ = a , this . updateMetrics _ ( ) ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . requiresViewResize _ = function ( a ) { return this . oldHostMetrics _ ? this . oldHostMetrics _ . viewWidth !== a . viewWidth || this . oldHostMetrics _ . viewHeight !== a . viewHeight || this . oldHostMetrics _ . absoluteLeft !== a . absoluteLeft || this . oldHostMetrics _ . absoluteTop !== a . absoluteTop : ! 0 } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . resizeHorizontal _ = function ( a ) { this . requiresViewResize _ ( a ) ? this . resizeViewHorizontal ( a ) : this . resizeContentHorizontal ( a ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . resizeViewHorizontal = function ( a ) { var b = a . viewWidth - 2 * this . margin _ ; this . pair _ && ( b -= module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ) ; this . setScrollbarLength _ ( Math . max ( 0 , b ) ) ; b = a . absoluteLeft + this . margin _ ; this . pair _ && this . workspace _ . RTL && ( b += module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ) ; this . setPosition ( b , a . absoluteTop + a . viewHeight - module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness - this . margin _ ) ; this . resizeContentHorizontal ( a ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . resizeContentHorizontal = function ( a ) { if ( a . viewWidth >= a . scrollWidth ) this . setHandleLength _ ( this . scrollbarLength _ ) , this . setHandlePosition ( 0 ) , this . pair _ || this . setVisible ( ! 1 ) ; else { this . pair _ || this . setVisible ( ! 0 ) ; var b = this . scrollbarLength _ * a . viewWidth / a . scrollWidth ; b = this . constrainHandleLength _ ( b ) ; this . setHandleLength _ ( b ) ; b = a . scrollWidth - a . viewWidth ; var c = this . scrollbarLength _ - this . handleLength _ ; a = ( a . viewLeft - a . scrollLeft ) / b * c ; a = this . constrainHandlePosition _ ( a ) ;
this . setHandlePosition ( a ) ; this . ratio = c / b } } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . resizeVertical _ = function ( a ) { this . requiresViewResize _ ( a ) ? this . resizeViewVertical ( a ) : this . resizeContentVertical ( a ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . resizeViewVertical = function ( a ) { var b = a . viewHeight - 2 * this . margin _ ; this . pair _ && ( b -= module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ) ; this . setScrollbarLength _ ( Math . max ( 0 , b ) ) ; this . setPosition ( this . workspace _ . RTL ? a . absoluteLeft + this . margin _ : a . absoluteLeft + a . viewWidth - module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness - this . margin _ , a . absoluteTop + this . margin _ ) ; this . resizeContentVertical ( a ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . resizeContentVertical = function ( a ) { if ( a . viewHeight >= a . scrollHeight ) this . setHandleLength _ ( this . scrollbarLength _ ) , this . setHandlePosition ( 0 ) , this . pair _ || this . setVisible ( ! 1 ) ; else { this . pair _ || this . setVisible ( ! 0 ) ; var b = this . scrollbarLength _ * a . viewHeight / a . scrollHeight ; b = this . constrainHandleLength _ ( b ) ; this . setHandleLength _ ( b ) ; b = a . scrollHeight - a . viewHeight ; var c = this . scrollbarLength _ - this . handleLength _ ; a = ( a . viewTop - a . scrollTop ) / b * c ; a = this . constrainHandlePosition _ ( a ) ;
this . setHandlePosition ( a ) ; this . ratio = c / b } } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . createDom _ = function ( a ) { var b = "blocklyScrollbar" + ( this . horizontal _ ? "Horizontal" : "Vertical" ) ; a && ( b += " " + a ) ; this . outerSvg _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . SVG , { "class" : b } , null ) ; this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { } , this . outerSvg _ ) ; this . svgBackground _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyScrollbarBackground" } ,
this . svgGroup _ ) ; a = Math . floor ( ( module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness - 5 ) / 2 ) ; this . svgHandle _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyScrollbarHandle" , rx : a , ry : a } , this . svgGroup _ ) ; this . workspace _ . getThemeManager ( ) . subscribe ( this . svgHandle _ , "scrollbarColour" , "fill" ) ; this . workspace _ . getThemeManager ( ) . subscribe ( this . svgHandle _ , "scrollbarOpacity" , "fill-opacity" ) ; ( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( this . outerSvg _ ,
this . workspace _ . getParentSvg ( ) ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . isVisible = function ( ) { return this . isVisible _ } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . setContainerVisible = function ( a ) { var b = a !== this . containerVisible _ ; this . containerVisible _ = a ; b && this . updateDisplay _ ( ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . setVisible = function ( a ) { var b = a !== this . isVisible ( ) ; if ( this . pair _ ) throw Error ( "Unable to toggle visibility of paired scrollbars." ) ; this . isVisible _ = a ; b && this . updateDisplay _ ( ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . updateDisplay _ = function ( ) { this . containerVisible _ && this . isVisible ( ) ? this . outerSvg _ . setAttribute ( "display" , "block" ) : this . outerSvg _ . setAttribute ( "display" , "none" ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . onMouseDownBar _ = function ( a ) { this . workspace _ . markFocused ( ) ; ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ; this . cleanUp _ ( ) ; if ( ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) ) a . stopPropagation ( ) ; else { var b = ( 0 , module$exports$Blockly$browserEvents . mouseToSvg ) ( a , this . workspace _ . getParentSvg ( ) , this . workspace _ . getInverseScreenCTM ( ) ) ; b = this . horizontal _ ? b . x : b . y ; var c = ( 0 , module$exports$Blockly$utils$svgMath . getInjectionDivXY ) ( this . svgHandle _ ) ;
c = this . horizontal _ ? c . x : c . y ; var d = this . handlePosition _ , e = . 95 * this . handleLength _ ; b <= c ? d -= e : b >= c + this . handleLength _ && ( d += e ) ; this . setHandlePosition ( this . constrainHandlePosition _ ( d ) ) ; this . updateMetrics _ ( ) ; a . stopPropagation ( ) ; a . preventDefault ( ) } } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . onMouseDownHandle _ = function ( a ) { this . workspace _ . markFocused ( ) ; this . cleanUp _ ( ) ; ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) ? a . stopPropagation ( ) : ( this . startDragHandle = this . handlePosition _ , this . workspace _ . setupDragSurface ( ) , this . startDragMouse _ = this . horizontal _ ? a . clientX : a . clientY , module$exports$Blockly$Scrollbar . Scrollbar . onMouseUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mouseup" , this , this . onMouseUpHandle _ ) ,
module$exports$Blockly$Scrollbar . Scrollbar . onMouseMoveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mousemove" , this , this . onMouseMoveHandle _ ) , a . stopPropagation ( ) , a . preventDefault ( ) ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . onMouseMoveHandle _ = function ( a ) { this . setHandlePosition ( this . constrainHandlePosition _ ( this . startDragHandle + ( ( this . horizontal _ ? a . clientX : a . clientY ) - this . startDragMouse _ ) ) ) ; this . updateMetrics _ ( ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . onMouseUpHandle _ = function ( ) { this . workspace _ . resetDragSurface ( ) ; ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ; this . cleanUp _ ( ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . cleanUp _ = function ( ) { this . workspace _ . hideChaff ( ! 0 ) ; module$exports$Blockly$Scrollbar . Scrollbar . onMouseUpWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( module$exports$Blockly$Scrollbar . Scrollbar . onMouseUpWrapper _ ) , module$exports$Blockly$Scrollbar . Scrollbar . onMouseUpWrapper _ = null ) ; module$exports$Blockly$Scrollbar . Scrollbar . onMouseMoveWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( module$exports$Blockly$Scrollbar . Scrollbar . onMouseMoveWrapper _ ) ,
module$exports$Blockly$Scrollbar . Scrollbar . onMouseMoveWrapper _ = null ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . getRatio _ = function ( ) { var a = this . handlePosition _ / ( this . scrollbarLength _ - this . handleLength _ ) ; isNaN ( a ) && ( a = 0 ) ; return a } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . updateMetrics _ = function ( ) { var a = this . getRatio _ ( ) , b = { } ; this . horizontal _ ? b . x = a : b . y = a ; this . workspace _ . setMetrics ( b ) } ;
module$exports$Blockly$Scrollbar . Scrollbar . prototype . set = function ( a , b ) { this . setHandlePosition ( this . constrainHandlePosition _ ( a * this . ratio ) ) ; ( b || void 0 === b ) && this . updateMetrics _ ( ) } ; module$exports$Blockly$Scrollbar . Scrollbar . prototype . setOrigin = function ( a , b ) { this . origin _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( a , b ) } ; var module$exports$Blockly$ScrollbarPair = { ScrollbarPair : function ( a , b , c , d , e ) { this . workspace _ = a ; b = void 0 === b ? ! 0 : b ; c = void 0 === c ? ! 0 : c ; var f = b && c ; b && ( this . hScroll = new module$exports$Blockly$Scrollbar . Scrollbar ( a , ! 0 , f , d , e ) ) ; c && ( this . vScroll = new module$exports$Blockly$Scrollbar . Scrollbar ( a , ! 1 , f , d , e ) ) ; f && ( this . corner _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { height : module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness , width : module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ,
"class" : "blocklyScrollbarBackground" } , null ) , ( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( this . corner _ , a . getBubbleCanvas ( ) ) ) ; this . oldHostMetrics _ = null } } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . dispose = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . corner _ ) ; this . oldHostMetrics _ = this . workspace _ = this . corner _ = null ; this . hScroll && ( this . hScroll . dispose ( ) , this . hScroll = null ) ; this . vScroll && ( this . vScroll . dispose ( ) , this . vScroll = null ) } ;
module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . resize = function ( ) { var a = this . workspace _ . getMetrics ( ) ; if ( a ) { var b = ! 1 , c = ! 1 ; this . oldHostMetrics _ && this . oldHostMetrics _ . viewWidth === a . viewWidth && this . oldHostMetrics _ . viewHeight === a . viewHeight && this . oldHostMetrics _ . absoluteTop === a . absoluteTop && this . oldHostMetrics _ . absoluteLeft === a . absoluteLeft ? ( this . oldHostMetrics _ && this . oldHostMetrics _ . scrollWidth === a . scrollWidth && this . oldHostMetrics _ . viewLeft === a . viewLeft && this . oldHostMetrics _ . scrollLeft ===
a . scrollLeft || ( b = ! 0 ) , this . oldHostMetrics _ && this . oldHostMetrics _ . scrollHeight === a . scrollHeight && this . oldHostMetrics _ . viewTop === a . viewTop && this . oldHostMetrics _ . scrollTop === a . scrollTop || ( c = ! 0 ) ) : c = b = ! 0 ; if ( b || c ) { try { ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) , this . hScroll && b && this . hScroll . resize ( a ) , this . vScroll && c && this . vScroll . resize ( a ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } this . workspace _ . maybeFireViewportChangeEvent ( ) } this . hScroll && this . vScroll && ( this . oldHostMetrics _ && this . oldHostMetrics _ . viewWidth ===
a . viewWidth && this . oldHostMetrics _ . absoluteLeft === a . absoluteLeft || this . corner _ . setAttribute ( "x" , this . vScroll . position . x ) , this . oldHostMetrics _ && this . oldHostMetrics _ . viewHeight === a . viewHeight && this . oldHostMetrics _ . absoluteTop === a . absoluteTop || this . corner _ . setAttribute ( "y" , this . hScroll . position . y ) ) ; this . oldHostMetrics _ = a } } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . canScrollHorizontally = function ( ) { return ! ! this . hScroll } ;
module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . canScrollVertically = function ( ) { return ! ! this . vScroll } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . setOrigin = function ( a , b ) { this . hScroll && this . hScroll . setOrigin ( a , b ) ; this . vScroll && this . vScroll . setOrigin ( a , b ) } ;
module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . set = function ( a , b , c ) { this . hScroll && this . hScroll . set ( a , ! 1 ) ; this . vScroll && this . vScroll . set ( b , ! 1 ) ; if ( c || void 0 === c ) a = { } , this . hScroll && ( a . x = this . hScroll . getRatio _ ( ) ) , this . vScroll && ( a . y = this . vScroll . getRatio _ ( ) ) , this . workspace _ . setMetrics ( a ) } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . setX = function ( a ) { this . hScroll && this . hScroll . set ( a , ! 0 ) } ;
module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . setY = function ( a ) { this . vScroll && this . vScroll . set ( a , ! 0 ) } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . setContainerVisible = function ( a ) { this . hScroll && this . hScroll . setContainerVisible ( a ) ; this . vScroll && this . vScroll . setContainerVisible ( a ) } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . isVisible = function ( ) { var a = ! 1 ; this . hScroll && ( a = this . hScroll . isVisible ( ) ) ; this . vScroll && ( a = a || this . vScroll . isVisible ( ) ) ; return a } ;
module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . resizeContent = function ( a ) { this . hScroll && this . hScroll . resizeContentHorizontal ( a ) ; this . vScroll && this . vScroll . resizeContentVertical ( a ) } ; module$exports$Blockly$ScrollbarPair . ScrollbarPair . prototype . resizeView = function ( a ) { this . hScroll && this . hScroll . resizeViewHorizontal ( a ) ; this . vScroll && this . vScroll . resizeViewVertical ( a ) } ; var module$exports$Blockly$utils$KeyCodes = { KeyCodes : { WIN _KEY _FF _LINUX : 0 , MAC _ENTER : 3 , BACKSPACE : 8 , TAB : 9 , NUM _CENTER : 12 , ENTER : 13 , SHIFT : 16 , CTRL : 17 , ALT : 18 , PAUSE : 19 , CAPS _LOCK : 20 , ESC : 27 , SPACE : 32 , PAGE _UP : 33 , PAGE _DOWN : 34 , END : 35 , HOME : 36 , LEFT : 37 , UP : 38 , RIGHT : 39 , DOWN : 40 , PLUS _SIGN : 43 , PRINT _SCREEN : 44 , INSERT : 45 , DELETE : 46 , ZERO : 48 , ONE : 49 , TWO : 50 , THREE : 51 , FOUR : 52 , FIVE : 53 , SIX : 54 , SEVEN : 55 , EIGHT : 56 , NINE : 57 , FF _SEMICOLON : 59 , FF _EQUALS : 61 , FF _DASH : 173 , FF _HASH : 163 , QUESTION _MARK : 63 , AT _SIGN : 64 , A : 65 , B : 66 , C : 67 , D : 68 , E : 69 , F : 70 , G : 71 ,
H : 72 , I : 73 , J : 74 , K : 75 , L : 76 , M : 77 , N : 78 , O : 79 , P : 80 , Q : 81 , R : 82 , S : 83 , T : 84 , U : 85 , V : 86 , W : 87 , X : 88 , Y : 89 , Z : 90 , META : 91 , WIN _KEY _RIGHT : 92 , CONTEXT _MENU : 93 , NUM _ZERO : 96 , NUM _ONE : 97 , NUM _TWO : 98 , NUM _THREE : 99 , NUM _FOUR : 100 , NUM _FIVE : 101 , NUM _SIX : 102 , NUM _SEVEN : 103 , NUM _EIGHT : 104 , NUM _NINE : 105 , NUM _MULTIPLY : 106 , NUM _PLUS : 107 , NUM _MINUS : 109 , NUM _PERIOD : 110 , NUM _DIVISION : 111 , F1 : 112 , F2 : 113 , F3 : 114 , F4 : 115 , F5 : 116 , F6 : 117 , F7 : 118 , F8 : 119 , F9 : 120 , F10 : 121 , F11 : 122 , F12 : 123 , NUMLOCK : 144 , SCROLL _LOCK : 145 , FIRST _MEDIA _KEY : 166 , LAST _MEDIA _KEY : 183 , SEMICOLON : 186 ,
DASH : 189 , EQUALS : 187 , COMMA : 188 , PERIOD : 190 , SLASH : 191 , APOSTROPHE : 192 , TILDE : 192 , SINGLE _QUOTE : 222 , OPEN _SQUARE _BRACKET : 219 , BACKSLASH : 220 , CLOSE _SQUARE _BRACKET : 221 , WIN _KEY : 224 , MAC _FF _META : 224 , MAC _WK _CMD _LEFT : 91 , MAC _WK _CMD _RIGHT : 93 , WIN _IME : 229 , VK _NONAME : 252 , PHANTOM : 255 } } ; var module$exports$Blockly$ShortcutRegistry = { ShortcutRegistry : function ( ) { module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry = this ; this . registry _ = Object . create ( null ) ; this . keyMap _ = Object . create ( null ) } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . modifierKeys = { Shift : module$exports$Blockly$utils$KeyCodes . KeyCodes . SHIFT , Control : module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL , Alt : module$exports$Blockly$utils$KeyCodes . KeyCodes . ALT , Meta : module$exports$Blockly$utils$KeyCodes . KeyCodes . META } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . register = function ( a , b ) { if ( this . registry _ [ a . name ] && ! b ) throw Error ( 'Shortcut with name "' + a . name + '" already exists.' ) ; this . registry _ [ a . name ] = a } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . unregister = function ( a ) { if ( ! this . registry _ [ a ] ) return console . warn ( 'Keyboard shortcut with name "' + a + '" not found.' ) , ! 1 ; this . removeAllKeyMappings ( a ) ; delete this . registry _ [ a ] ; return ! 0 } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . addKeyMapping = function ( a , b , c ) { a = String ( a ) ; var d = this . keyMap _ [ a ] ; if ( d && ! c ) throw Error ( 'Shortcut with name "' + b + '" collides with shortcuts ' + d . toString ( ) ) ; d && c ? d . unshift ( b ) : this . keyMap _ [ a ] = [ b ] } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . removeKeyMapping = function ( a , b , c ) { var d = this . keyMap _ [ a ] ; if ( ! d && ! c ) return console . warn ( 'No keyboard shortcut with name "' + b + '" registered with key code "' + a + '"' ) , ! 1 ; var e = d . indexOf ( b ) ; if ( - 1 < e ) return d . splice ( e , 1 ) , 0 === d . length && delete this . keyMap _ [ a ] , ! 0 ; c || console . warn ( 'No keyboard shortcut with name "' + b + '" registered with key code "' + a + '"' ) ; return ! 1 } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . removeAllKeyMappings = function ( a ) { for ( var b in this . keyMap _ ) this . removeKeyMapping ( b , a , ! 0 ) } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . setKeyMap = function ( a ) { this . keyMap _ = a } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . getKeyMap = function ( ) { return ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( Object . create ( null ) , this . keyMap _ ) } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . getRegistry = function ( ) { return ( 0 , $ . module$exports$Blockly$utils$object . deepMerge ) ( Object . create ( null ) , this . registry _ ) } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . onKeyDown = function ( a , b ) { var c = this . serializeKeyEvent _ ( b ) ; c = this . getShortcutNamesByKeyCode ( c ) ; if ( ! c ) return ! 1 ; for ( var d = 0 , e ; e = c [ d ] ; d ++ ) if ( e = this . registry _ [ e ] , ( ! e . preconditionFn || e . preconditionFn ( a ) ) && e . callback && e . callback ( a , b , e ) ) return ! 0 ; return ! 1 } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . getShortcutNamesByKeyCode = function ( a ) { return this . keyMap _ [ a ] || [ ] } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . getKeyCodesByShortcutName = function ( a ) { var b = [ ] , c ; for ( c in this . keyMap _ ) - 1 < this . keyMap _ [ c ] . indexOf ( a ) && b . push ( c ) ; return b } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . serializeKeyEvent _ = function ( a ) { var b = "" , c ; for ( c in module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . modifierKeys ) a . getModifierState ( c ) && ( "" !== b && ( b += "+" ) , b += c ) ; "" !== b && a . keyCode ? b = b + "+" + a . keyCode : a . keyCode && ( b = a . keyCode . toString ( ) ) ; return b } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . checkModifiers _ = function ( a ) { for ( var b = ( 0 , $ . module$exports$Blockly$utils$object . values ) ( module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . modifierKeys ) , c = 0 , d ; d = a [ c ] ; c ++ ) if ( 0 > b . indexOf ( d ) ) throw Error ( d + " is not a valid modifier key." ) ; } ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . prototype . createSerializedKey = function ( a , b ) { var c = "" ; if ( b ) { this . checkModifiers _ ( b ) ; for ( var d in module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . modifierKeys ) - 1 < b . indexOf ( module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . modifierKeys [ d ] ) && ( "" !== c && ( c += "+" ) , c += d ) } "" !== c && a ? c = c + "+" + a : a && ( c = a . toString ( ) ) ; return c } ; new module$exports$Blockly$ShortcutRegistry . ShortcutRegistry ; var module$exports$Blockly$WorkspaceDragSurfaceSvg = { WorkspaceDragSurfaceSvg : function ( a ) { this . container _ = a ; this . createDom ( ) } } ; module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . SVG _ = null ; module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . container _ = null ;
module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . createDom = function ( ) { this . SVG _ || ( this . SVG _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . SVG , { xmlns : module$exports$Blockly$utils$dom . SVG _NS , "xmlns:html" : module$exports$Blockly$utils$dom . HTML _NS , "xmlns:xlink" : module$exports$Blockly$utils$dom . XLINK _NS , version : "1.1" , "class" : "blocklyWsDragSurface blocklyOverflowVisible" } , null ) , this . container _ . appendChild ( this . SVG _ ) ) } ;
module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . translateSurface = function ( a , b ) { a = a . toFixed ( 0 ) ; b = b . toFixed ( 0 ) ; this . SVG _ . style . display = "block" ; ( 0 , module$exports$Blockly$utils$dom . setCssTransform ) ( this . SVG _ , "translate3d(" + a + "px, " + b + "px, 0)" ) } ; module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . getSurfaceTranslation = function ( ) { return ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( this . SVG _ ) } ;
module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . clearAndHide = function ( a ) { if ( ! a ) throw Error ( "Couldn't clear and hide the drag surface: missing new surface." ) ; var b = this . SVG _ . childNodes [ 0 ] , c = this . SVG _ . childNodes [ 1 ] ; if ( ! ( b && c && ( 0 , module$exports$Blockly$utils$dom . hasClass ) ( b , "blocklyBlockCanvas" ) && ( 0 , module$exports$Blockly$utils$dom . hasClass ) ( c , "blocklyBubbleCanvas" ) ) ) throw Error ( "Couldn't clear and hide the drag surface. A node was missing." ) ; null !== this . previousSibling _ ?
( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( b , this . previousSibling _ ) : a . insertBefore ( b , a . firstChild ) ; ( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( c , b ) ; this . SVG _ . style . display = "none" ; if ( this . SVG _ . childNodes . length ) throw Error ( "Drag surface was not cleared." ) ; ( 0 , module$exports$Blockly$utils$dom . setCssTransform ) ( this . SVG _ , "" ) ; this . previousSibling _ = null } ;
module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg . prototype . setContentsAndShow = function ( a , b , c , d , e , f ) { if ( this . SVG _ . childNodes . length ) throw Error ( "Already dragging a block." ) ; this . previousSibling _ = c ; a . setAttribute ( "transform" , "translate(0, 0) scale(" + f + ")" ) ; b . setAttribute ( "transform" , "translate(0, 0) scale(" + f + ")" ) ; this . SVG _ . setAttribute ( "width" , d ) ; this . SVG _ . setAttribute ( "height" , e ) ; this . SVG _ . appendChild ( a ) ; this . SVG _ . appendChild ( b ) ; this . SVG _ . style . display = "block" } ; var module$exports$Blockly$clipboard = { } , module$contents$Blockly$clipboard _copyData = null ; module$exports$Blockly$clipboard . copy = function ( a ) { module$contents$Blockly$clipboard _copyData = a . toCopyData ( ) } ;
module$exports$Blockly$clipboard . paste = function ( ) { if ( ! module$contents$Blockly$clipboard _copyData ) return ! 1 ; var a = module$contents$Blockly$clipboard _copyData . source ; a . isFlyout && ( a = a . targetWorkspace ) ; return module$contents$Blockly$clipboard _copyData . typeCounts && a . isCapacityAvailable ( module$contents$Blockly$clipboard _copyData . typeCounts ) ? ( ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) , a . paste ( module$contents$Blockly$clipboard _copyData . saveInfo ) , ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) ,
! 0 ) : ! 1 } ; module$exports$Blockly$clipboard . duplicate = function ( a ) { var b = module$contents$Blockly$clipboard _copyData ; ( 0 , module$exports$Blockly$clipboard . copy ) ( a ) ; a . workspace . paste ( module$contents$Blockly$clipboard _copyData . saveInfo ) ; module$contents$Blockly$clipboard _copyData = b } ; var module$exports$Blockly$MenuItem = { MenuItem : function ( a , b ) { this . content _ = a ; this . value _ = b ; this . enabled _ = ! 0 ; this . element _ = null ; this . rightToLeft _ = ! 1 ; this . roleName _ = null ; this . highlight _ = this . checked _ = this . checkable _ = ! 1 ; this . actionHandler _ = null } } ;
module$exports$Blockly$MenuItem . MenuItem . prototype . createDom = function ( ) { var a = document . createElement ( "div" ) ; a . id = ( 0 , module$exports$Blockly$utils$idGenerator . getNextUniqueId ) ( ) ; this . element _ = a ; a . className = "blocklyMenuItem goog-menuitem " + ( this . enabled _ ? "" : "blocklyMenuItemDisabled goog-menuitem-disabled " ) + ( this . checked _ ? "blocklyMenuItemSelected goog-option-selected " : "" ) + ( this . highlight _ ? "blocklyMenuItemHighlight goog-menuitem-highlight " : "" ) + ( this . rightToLeft _ ? "blocklyMenuItemRtl goog-menuitem-rtl " :
"" ) ; var b = document . createElement ( "div" ) ; b . className = "blocklyMenuItemContent goog-menuitem-content" ; if ( this . checkable _ ) { var c = document . createElement ( "div" ) ; c . className = "blocklyMenuItemCheckbox goog-menuitem-checkbox" ; b . appendChild ( c ) } c = this . content _ ; "string" === typeof this . content _ && ( c = document . createTextNode ( this . content _ ) ) ; b . appendChild ( c ) ; a . appendChild ( b ) ; this . roleName _ && ( 0 , module$exports$Blockly$utils$aria . setRole ) ( a , this . roleName _ ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . SELECTED ,
this . checkable _ && this . checked _ || ! 1 ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . DISABLED , ! this . enabled _ ) ; return a } ; module$exports$Blockly$MenuItem . MenuItem . prototype . dispose = function ( ) { this . element _ = null } ; module$exports$Blockly$MenuItem . MenuItem . prototype . getElement = function ( ) { return this . element _ } ; module$exports$Blockly$MenuItem . MenuItem . prototype . getId = function ( ) { return this . element _ . id } ; module$exports$Blockly$MenuItem . MenuItem . prototype . getValue = function ( ) { return this . value _ } ;
module$exports$Blockly$MenuItem . MenuItem . prototype . setRightToLeft = function ( a ) { this . rightToLeft _ = a } ; module$exports$Blockly$MenuItem . MenuItem . prototype . setRole = function ( a ) { this . roleName _ = a } ; module$exports$Blockly$MenuItem . MenuItem . prototype . setCheckable = function ( a ) { this . checkable _ = a } ; module$exports$Blockly$MenuItem . MenuItem . prototype . setChecked = function ( a ) { this . checked _ = a } ;
module$exports$Blockly$MenuItem . MenuItem . prototype . setHighlighted = function ( a ) { this . highlight _ = a ; var b = this . getElement ( ) ; b && this . isEnabled ( ) && ( a ? ( ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b , "blocklyMenuItemHighlight" ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b , "goog-menuitem-highlight" ) ) : ( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( b , "blocklyMenuItemHighlight" ) , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( b , "goog-menuitem-highlight" ) ) ) } ;
module$exports$Blockly$MenuItem . MenuItem . prototype . isEnabled = function ( ) { return this . enabled _ } ; module$exports$Blockly$MenuItem . MenuItem . prototype . setEnabled = function ( a ) { this . enabled _ = a } ; module$exports$Blockly$MenuItem . MenuItem . prototype . performAction = function ( ) { this . isEnabled ( ) && this . actionHandler _ && this . actionHandler _ ( this ) } ; module$exports$Blockly$MenuItem . MenuItem . prototype . onAction = function ( a , b ) { this . actionHandler _ = a . bind ( b ) } ; var module$exports$Blockly$Menu = { Menu : function ( ) { this . menuItems _ = [ ] ; this . roleName _ = this . element _ = this . onKeyDownHandler _ = this . mouseLeaveHandler _ = this . mouseEnterHandler _ = this . clickHandler _ = this . mouseOverHandler _ = this . highlightedItem _ = this . openingCoords = null } } ; module$exports$Blockly$Menu . Menu . prototype . addChild = function ( a ) { this . menuItems _ . push ( a ) } ;
module$exports$Blockly$Menu . Menu . prototype . render = function ( a ) { var b = document . createElement ( "div" ) ; b . className = "blocklyMenu goog-menu blocklyNonSelectable" ; b . tabIndex = 0 ; this . roleName _ && ( 0 , module$exports$Blockly$utils$aria . setRole ) ( b , this . roleName _ ) ; this . element _ = b ; for ( var c = 0 , d ; d = this . menuItems _ [ c ] ; c ++ ) b . appendChild ( d . createDom ( ) ) ; this . mouseOverHandler _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "mouseover" , this , this . handleMouseOver _ , ! 0 ) ; this . clickHandler _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b ,
"click" , this , this . handleClick _ , ! 0 ) ; this . mouseEnterHandler _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "mouseenter" , this , this . handleMouseEnter _ , ! 0 ) ; this . mouseLeaveHandler _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "mouseleave" , this , this . handleMouseLeave _ , ! 0 ) ; this . onKeyDownHandler _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "keydown" , this , this . handleKeyEvent _ ) ; a . appendChild ( b ) } ; module$exports$Blockly$Menu . Menu . prototype . getElement = function ( ) { return this . element _ } ;
module$exports$Blockly$Menu . Menu . prototype . focus = function ( ) { var a = this . getElement ( ) ; a && ( a . focus ( { preventScroll : ! 0 } ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyFocused" ) ) } ; module$exports$Blockly$Menu . Menu . prototype . blur _ = function ( ) { var a = this . getElement ( ) ; a && ( a . blur ( ) , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyFocused" ) ) } ; module$exports$Blockly$Menu . Menu . prototype . setRole = function ( a ) { this . roleName _ = a } ;
module$exports$Blockly$Menu . Menu . prototype . dispose = function ( ) { this . mouseOverHandler _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . mouseOverHandler _ ) , this . mouseOverHandler _ = null ) ; this . clickHandler _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . clickHandler _ ) , this . clickHandler _ = null ) ; this . mouseEnterHandler _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . mouseEnterHandler _ ) , this . mouseEnterHandler _ = null ) ; this . mouseLeaveHandler _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . mouseLeaveHandler _ ) ,
this . mouseLeaveHandler _ = null ) ; this . onKeyDownHandler _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onKeyDownHandler _ ) , this . onKeyDownHandler _ = null ) ; for ( var a = 0 , b ; b = this . menuItems _ [ a ] ; a ++ ) b . dispose ( ) ; this . element _ = null } ; module$exports$Blockly$Menu . Menu . prototype . getMenuItem _ = function ( a ) { for ( var b = this . getElement ( ) ; a && a !== b ; ) { if ( ( 0 , module$exports$Blockly$utils$dom . hasClass ) ( a , "blocklyMenuItem" ) ) for ( var c = 0 , d ; d = this . menuItems _ [ c ] ; c ++ ) if ( d . getElement ( ) === a ) return d ; a = a . parentElement } return null } ;
module$exports$Blockly$Menu . Menu . prototype . setHighlighted = function ( a ) { var b = this . highlightedItem _ ; b && ( b . setHighlighted ( ! 1 ) , this . highlightedItem _ = null ) ; a && ( a . setHighlighted ( ! 0 ) , this . highlightedItem _ = a , b = this . getElement ( ) , ( 0 , module$exports$Blockly$utils$style . scrollIntoContainerView ) ( a . getElement ( ) , b ) , ( 0 , module$exports$Blockly$utils$aria . setState ) ( b , module$exports$Blockly$utils$aria . State . ACTIVEDESCENDANT , a . getId ( ) ) ) } ;
module$exports$Blockly$Menu . Menu . prototype . highlightNext = function ( ) { var a = this . menuItems _ . indexOf ( this . highlightedItem _ ) ; this . highlightHelper _ ( a , 1 ) } ; module$exports$Blockly$Menu . Menu . prototype . highlightPrevious = function ( ) { var a = this . menuItems _ . indexOf ( this . highlightedItem _ ) ; this . highlightHelper _ ( 0 > a ? this . menuItems _ . length : a , - 1 ) } ; module$exports$Blockly$Menu . Menu . prototype . highlightFirst _ = function ( ) { this . highlightHelper _ ( - 1 , 1 ) } ;
module$exports$Blockly$Menu . Menu . prototype . highlightLast _ = function ( ) { this . highlightHelper _ ( this . menuItems _ . length , - 1 ) } ; module$exports$Blockly$Menu . Menu . prototype . highlightHelper _ = function ( a , b ) { a += b ; for ( var c ; c = this . menuItems _ [ a ] ; ) { if ( c . isEnabled ( ) ) { this . setHighlighted ( c ) ; break } a += b } } ; module$exports$Blockly$Menu . Menu . prototype . handleMouseOver _ = function ( a ) { ( a = this . getMenuItem _ ( a . target ) ) && ( a . isEnabled ( ) ? this . highlightedItem _ !== a && this . setHighlighted ( a ) : this . setHighlighted ( null ) ) } ;
module$exports$Blockly$Menu . Menu . prototype . handleClick _ = function ( a ) { var b = this . openingCoords ; this . openingCoords = null ; if ( b && "number" === typeof a . clientX ) { var c = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . clientX , a . clientY ) ; if ( 1 > module$exports$Blockly$utils$Coordinate . Coordinate . distance ( b , c ) ) return } ( a = this . getMenuItem _ ( a . target ) ) && a . performAction ( ) } ; module$exports$Blockly$Menu . Menu . prototype . handleMouseEnter _ = function ( a ) { this . focus ( ) } ;
module$exports$Blockly$Menu . Menu . prototype . handleMouseLeave _ = function ( a ) { this . getElement ( ) && ( this . blur _ ( ) , this . setHighlighted ( null ) ) } ;
module$exports$Blockly$Menu . Menu . prototype . handleKeyEvent _ = function ( a ) { if ( this . menuItems _ . length && ! ( a . shiftKey || a . ctrlKey || a . metaKey || a . altKey ) ) { var b = this . highlightedItem _ ; switch ( a . keyCode ) { case module$exports$Blockly$utils$KeyCodes . KeyCodes . ENTER : case module$exports$Blockly$utils$KeyCodes . KeyCodes . SPACE : b && b . performAction ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . UP : this . highlightPrevious ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . DOWN : this . highlightNext ( ) ; break ;
case module$exports$Blockly$utils$KeyCodes . KeyCodes . PAGE _UP : case module$exports$Blockly$utils$KeyCodes . KeyCodes . HOME : this . highlightFirst _ ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . PAGE _DOWN : case module$exports$Blockly$utils$KeyCodes . KeyCodes . END : this . highlightLast _ ( ) ; break ; default : return } a . preventDefault ( ) ; a . stopPropagation ( ) } } ;
module$exports$Blockly$Menu . Menu . prototype . getSize = function ( ) { var a = this . getElement ( ) , b = ( 0 , module$exports$Blockly$utils$style . getSize ) ( a ) ; b . height = a . scrollHeight ; return b } ; var module$exports$Blockly$serialization$priorities = { VARIABLES : 100 , BLOCKS : 50 } ; var module$exports$Blockly$serialization$registry = { register : function ( a , b ) { ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . SERIALIZER , a , b ) } , unregister : function ( a ) { ( 0 , module$exports$Blockly$registry . unregister ) ( module$exports$Blockly$registry . Type . SERIALIZER , a ) } } ; var module$exports$Blockly$serialization$exceptions = { DeserializationError : function ( ) { var a = Error . apply ( this , arguments ) ; this . message = a . message ; "stack" in a && ( this . stack = a . stack ) } } ; $jscomp . inherits ( module$exports$Blockly$serialization$exceptions . DeserializationError , Error ) ;
module$exports$Blockly$serialization$exceptions . MissingBlockType = function ( a ) { module$exports$Blockly$serialization$exceptions . DeserializationError . call ( this , "Expected to find a 'type' property, defining the block type" ) ; this . state = a } ; $jscomp . inherits ( module$exports$Blockly$serialization$exceptions . MissingBlockType , module$exports$Blockly$serialization$exceptions . DeserializationError ) ;
module$exports$Blockly$serialization$exceptions . MissingConnection = function ( a , b , c ) { module$exports$Blockly$serialization$exceptions . DeserializationError . call ( this , "The block " + b . toDevString ( ) + " is missing a(n) " + a + "\nconnection" ) ; this . block = b ; this . state = c } ; $jscomp . inherits ( module$exports$Blockly$serialization$exceptions . MissingConnection , module$exports$Blockly$serialization$exceptions . DeserializationError ) ;
module$exports$Blockly$serialization$exceptions . BadConnectionCheck = function ( a , b , c , d ) { module$exports$Blockly$serialization$exceptions . DeserializationError . call ( this , "The block " + c . toDevString ( ) + " could not connect its\n" + b + " to its parent, because: " + a ) ; this . childBlock = c ; this . childState = d } ; $jscomp . inherits ( module$exports$Blockly$serialization$exceptions . BadConnectionCheck , module$exports$Blockly$serialization$exceptions . DeserializationError ) ;
module$exports$Blockly$serialization$exceptions . RealChildOfShadow = function ( a ) { module$exports$Blockly$serialization$exceptions . DeserializationError . call ( this , "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 } ; $jscomp . inherits ( module$exports$Blockly$serialization$exceptions . RealChildOfShadow , module$exports$Blockly$serialization$exceptions . DeserializationError ) ; var module$exports$Blockly$serialization$ISerializer = { ISerializer : function ( ) { } } ; module$exports$Blockly$serialization$ISerializer . ISerializer . prototype . save = function ( a ) { } ; module$exports$Blockly$serialization$ISerializer . ISerializer . prototype . load = function ( a , b ) { } ; module$exports$Blockly$serialization$ISerializer . ISerializer . prototype . clear = function ( a ) { } ; var module$exports$Blockly$serialization$blocks = { save : function ( a , b ) { var c = void 0 === b ? { } : b ; b = void 0 === c . addCoordinates ? ! 1 : c . addCoordinates ; var d = void 0 === c . addInputBlocks ? ! 0 : c . addInputBlocks , e = void 0 === c . addNextBlocks ? ! 0 : c . addNextBlocks ; c = void 0 === c . doFullSerialization ? ! 0 : c . doFullSerialization ; if ( a . isInsertionMarker ( ) ) return null ; var f = { type : a . type , id : a . id } ; b && module$contents$Blockly$serialization$blocks _saveCoords ( a , f ) ; module$contents$Blockly$serialization$blocks _saveAttributes ( a , f ) ; module$contents$Blockly$serialization$blocks _saveExtraState ( a ,
f ) ; module$contents$Blockly$serialization$blocks _saveIcons ( a , f ) ; module$contents$Blockly$serialization$blocks _saveFields ( a , f , c ) ; d && module$contents$Blockly$serialization$blocks _saveInputBlocks ( a , f , c ) ; e && module$contents$Blockly$serialization$blocks _saveNextBlocks ( a , f , c ) ; return f } } , module$contents$Blockly$serialization$blocks _saveAttributes = function ( a , b ) { a . isCollapsed ( ) && ( b . collapsed = ! 0 ) ; a . isEnabled ( ) || ( b . enabled = ! 1 ) ; void 0 !== a . inputsInline && a . inputsInline !== a . inputsInlineDefault && ( b . inline = a . inputsInline ) ;
a . data && ( b . data = a . data ) } , module$contents$Blockly$serialization$blocks _saveCoords = function ( a , b ) { var c = a . workspace ; a = a . getRelativeToSurfaceXY ( ) ; b . x = Math . round ( c . RTL ? c . getWidth ( ) - a . x : a . x ) ; b . y = Math . round ( a . y ) } , module$contents$Blockly$serialization$blocks _saveExtraState = function ( a , b ) { a . saveExtraState ? ( a = a . saveExtraState ( ) , null !== a && ( b . extraState = a ) ) : a . mutationToDom && ( a = a . mutationToDom ( ) , null !== a && ( b . extraState = ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( a ) . replace ( ' xmlns="https://developers.google.com/blockly/xml"' ,
"" ) ) ) } , module$contents$Blockly$serialization$blocks _saveIcons = function ( a , b ) { a . getCommentText ( ) && ( b . icons = { comment : { text : a . getCommentText ( ) , pinned : a . commentModel . pinned , height : Math . round ( a . commentModel . size . height ) , width : Math . round ( a . commentModel . size . width ) } } ) } , module$contents$Blockly$serialization$blocks _saveFields = function ( a , b , c ) { for ( var d = Object . create ( null ) , e = 0 ; e < a . inputList . length ; e ++ ) for ( var f = a . inputList [ e ] , g = 0 ; g < f . fieldRow . length ; g ++ ) { var h = f . fieldRow [ g ] ; h . isSerializable ( ) && ( d [ h . name ] = h . saveState ( c ) ) } Object . keys ( d ) . length &&
( b . fields = d ) } , module$contents$Blockly$serialization$blocks _saveInputBlocks = function ( a , b , c ) { for ( var d = Object . create ( null ) , e = 0 ; e < a . inputList . length ; e ++ ) { var f = a . inputList [ e ] ; if ( f . type !== $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ) { var g = module$contents$Blockly$serialization$blocks _saveConnection ( f . connection , c ) ; g && ( d [ f . name ] = g ) } } Object . keys ( d ) . length && ( b . inputs = d ) } , module$contents$Blockly$serialization$blocks _saveNextBlocks = function ( a , b , c ) { a . nextConnection && ( a = module$contents$Blockly$serialization$blocks _saveConnection ( a . nextConnection ,
c ) ) && ( b . next = a ) } , module$contents$Blockly$serialization$blocks _saveConnection = function ( a , b ) { var c = a . getShadowState ( ! 0 ) ; a = a . targetBlock ( ) ; if ( ! c && ! a ) return null ; var d = Object . create ( null ) ; c && ( d . shadow = c ) ; a && ! a . isShadow ( ) && ( d . block = ( 0 , module$exports$Blockly$serialization$blocks . save ) ( a , { doFullSerialization : b } ) ) ; return d } ;
module$exports$Blockly$serialization$blocks . append = function ( a , b , c ) { c = void 0 === c ? { } : c ; return ( 0 , module$exports$Blockly$serialization$blocks . appendInternal ) ( a , b , { recordUndo : void 0 === c . recordUndo ? ! 1 : c . recordUndo } ) } ;
module$exports$Blockly$serialization$blocks . appendInternal = function ( a , b , c ) { var d = void 0 === c ? { } : c ; c = void 0 === d . parentConnection ? void 0 : d . parentConnection ; var e = void 0 === d . isShadow ? ! 1 : d . isShadow , f = void 0 === d . recordUndo ? ! 1 : d . recordUndo ; d = ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) ; ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( f ) ; ( f = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ;
var g = module$contents$Blockly$serialization$blocks _appendPrivate ( a , b , { parentConnection : c , isShadow : e } ) ; ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CREATE ) ) ( g ) ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( f ) ; ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( d ) ; b . rendered && setTimeout ( function ( ) { g . disposed || g . setConnectionTracking ( ! 0 ) } , 1 ) ; return g } ;
var module$contents$Blockly$serialization$blocks _appendPrivate = function ( a , b , c ) { var d = void 0 === c ? { } : c ; c = void 0 === d . parentConnection ? void 0 : d . parentConnection ; d = void 0 === d . isShadow ? ! 1 : d . isShadow ; if ( ! a . type ) throw new module$exports$Blockly$serialization$exceptions . MissingBlockType ( a ) ; var e = b . newBlock ( a . type , a . id ) ; e . setShadow ( d ) ; module$contents$Blockly$serialization$blocks _loadCoords ( e , a ) ; module$contents$Blockly$serialization$blocks _loadAttributes ( e , a ) ; module$contents$Blockly$serialization$blocks _loadExtraState ( e ,
a ) ; module$contents$Blockly$serialization$blocks _tryToConnectParent ( c , e , a ) ; module$contents$Blockly$serialization$blocks _loadIcons ( e , a ) ; module$contents$Blockly$serialization$blocks _loadFields ( e , a ) ; module$contents$Blockly$serialization$blocks _loadInputBlocks ( e , a ) ; module$contents$Blockly$serialization$blocks _loadNextBlocks ( e , a ) ; module$contents$Blockly$serialization$blocks _initBlock ( e , b . rendered ) ; return e } , module$contents$Blockly$serialization$blocks _loadCoords = function ( a , b ) { var c = void 0 === b . x ? 0 : b . x ; b =
void 0 === b . y ? 0 : b . y ; var d = a . workspace ; c = d . RTL ? d . getWidth ( ) - c : c ; a . moveBy ( c , b ) } , module$contents$Blockly$serialization$blocks _loadAttributes = function ( a , b ) { b . collapsed && a . setCollapsed ( ! 0 ) ; ! 1 === b . enabled && a . setEnabled ( ! 1 ) ; void 0 !== b . inline && a . setInputsInline ( b . inline ) ; void 0 !== b . data && ( a . data = b . data ) } , module$contents$Blockly$serialization$blocks _loadExtraState = function ( a , b ) { b . extraState && ( a . loadExtraState ? a . loadExtraState ( b . extraState ) : a . domToMutation ( ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( b . extraState ) ) ) } ,
module$contents$Blockly$serialization$blocks _tryToConnectParent = function ( a , b , c ) { if ( a ) { if ( a . getSourceBlock ( ) . isShadow ( ) && ! b . isShadow ( ) ) throw new module$exports$Blockly$serialization$exceptions . RealChildOfShadow ( c ) ; if ( a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ) { var d = b . outputConnection ; if ( ! d ) throw new module$exports$Blockly$serialization$exceptions . MissingConnection ( "output" , b , c ) ; } else if ( d = b . previousConnection , ! d ) throw new module$exports$Blockly$serialization$exceptions . MissingConnection ( "previous" ,
b , c ) ; if ( ! a . connect ( d ) ) { var e = b . workspace . connectionChecker ; throw new module$exports$Blockly$serialization$exceptions . BadConnectionCheck ( e . getErrorMessage ( e . canConnectWithReason ( d , a , ! 1 ) , d , a ) , a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ? "output connection" : "previous connection" , b , c ) ; } } } , module$contents$Blockly$serialization$blocks _loadIcons = function ( a , b ) { b . icons && ( b = b . icons . comment ) && ( a . setCommentText ( b . text ) , a . commentModel . pinned = b . pinned , a . commentModel . size = new module$exports$Blockly$utils$Size . Size ( b . width ,
b . height ) , b . pinned && a . getCommentIcon && ! a . isInFlyout && setTimeout ( function ( ) { return a . getCommentIcon ( ) . setVisible ( ! 0 ) } , 1 ) ) } , module$contents$Blockly$serialization$blocks _loadFields = function ( a , b ) { if ( b . fields ) for ( var c = Object . keys ( b . fields ) , d = 0 ; d < c . length ; d ++ ) { var e = c [ d ] , f = b . fields [ e ] , g = a . getField ( e ) ; g ? g . loadState ( f ) : console . warn ( "Ignoring non-existant field " + e + " in block " + a . type ) } } , module$contents$Blockly$serialization$blocks _loadInputBlocks = function ( a , b ) { if ( b . inputs ) for ( var c = Object . keys ( b . inputs ) ,
d = 0 ; d < c . length ; d ++ ) { var e = c [ d ] , f = a . getInput ( e ) ; if ( ! f || ! f . connection ) throw new module$exports$Blockly$serialization$exceptions . MissingConnection ( e , a , b ) ; module$contents$Blockly$serialization$blocks _loadConnection ( f . connection , b . inputs [ e ] ) } } , module$contents$Blockly$serialization$blocks _loadNextBlocks = function ( a , b ) { if ( b . next ) { if ( ! a . nextConnection ) throw new module$exports$Blockly$serialization$exceptions . MissingConnection ( "next" , a , b ) ; module$contents$Blockly$serialization$blocks _loadConnection ( a . nextConnection ,
b . next ) } } , module$contents$Blockly$serialization$blocks _loadConnection = function ( a , b ) { b . shadow && a . setShadowState ( b . shadow ) ; b . block && module$contents$Blockly$serialization$blocks _appendPrivate ( b . block , a . getSourceBlock ( ) . workspace , { parentConnection : a } ) } , module$contents$Blockly$serialization$blocks _initBlock = function ( a , b ) { b ? ( a . setConnectionTracking ( ! 1 ) , a . initSvg ( ) , a . render ( ! 1 ) ) : a . initModel ( ) } , module$contents$Blockly$serialization$blocks _saveBlock = module$exports$Blockly$serialization$blocks . save , module$contents$Blockly$serialization$blocks _BlockSerializer =
function ( ) { this . priority = module$exports$Blockly$serialization$priorities . BLOCKS } ; module$contents$Blockly$serialization$blocks _BlockSerializer . prototype . save = function ( a ) { var b = [ ] ; a = $jscomp . makeIterator ( a . getTopBlocks ( ! 1 ) ) ; for ( var c = a . next ( ) ; ! c . done ; c = a . next ( ) ) ( c = module$contents$Blockly$serialization$blocks _saveBlock ( c . value , { addCoordinates : ! 0 , doFullSerialization : ! 1 } ) ) && b . push ( c ) ; return b . length ? { languageVersion : 0 , blocks : b } : null } ;
module$contents$Blockly$serialization$blocks _BlockSerializer . prototype . load = function ( a , b ) { a = $jscomp . makeIterator ( a . blocks ) ; for ( var c = a . next ( ) ; ! c . done ; c = a . next ( ) ) ( 0 , module$exports$Blockly$serialization$blocks . append ) ( c . value , b , { recordUndo : ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) } ) } ; module$contents$Blockly$serialization$blocks _BlockSerializer . prototype . clear = function ( a ) { a = $jscomp . makeIterator ( a . getTopBlocks ( ! 1 ) ) ; for ( var b = a . next ( ) ; ! b . done ; b = a . next ( ) ) b . value . dispose ( ! 1 ) } ;
( 0 , module$exports$Blockly$serialization$registry . register ) ( "blocks" , new module$contents$Blockly$serialization$blocks _BlockSerializer ) ; var module$exports$Blockly$Events$Abstract = function ( ) { this . isBlank = null ; this . workspaceId = void 0 ; this . group = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; this . recordUndo = ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) } ; module$exports$Blockly$Events$Abstract . prototype . isUiEvent = ! 1 ; module$exports$Blockly$Events$Abstract . prototype . toJson = function ( ) { var a = { type : this . type } ; this . group && ( a . group = this . group ) ; return a } ;
module$exports$Blockly$Events$Abstract . prototype . fromJson = function ( a ) { this . isBlank = ! 1 ; this . group = a . group } ; module$exports$Blockly$Events$Abstract . prototype . isNull = function ( ) { return ! 1 } ; module$exports$Blockly$Events$Abstract . prototype . run = function ( a ) { } ;
module$exports$Blockly$Events$Abstract . prototype . getEventWorkspace _ = function ( ) { var a ; this . workspaceId && ( a = module$exports$Blockly$Workspace . Workspace . getById ( this . workspaceId ) ) ; if ( ! a ) throw Error ( "Workspace is null. Event must have been generated from real Blockly events." ) ; return a } ; var module$exports$Blockly$Events$BlockBase = { BlockBase : function ( a ) { module$exports$Blockly$Events$BlockBase . BlockBase . superClass _ . constructor . call ( this ) ; this . blockId = ( this . isBlank = "undefined" === typeof a ) ? "" : a . id ; this . workspaceId = this . isBlank ? "" : a . workspace . id } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BlockBase . BlockBase , module$exports$Blockly$Events$Abstract ) ;
module$exports$Blockly$Events$BlockBase . BlockBase . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BlockBase . BlockBase . superClass _ . toJson . call ( this ) ; a . blockId = this . blockId ; return a } ; module$exports$Blockly$Events$BlockBase . BlockBase . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BlockBase . BlockBase . superClass _ . fromJson . call ( this , a ) ; this . blockId = a . blockId } ; var module$exports$Blockly$Events$BlockCreate = { BlockCreate : function ( a ) { module$exports$Blockly$Events$BlockCreate . BlockCreate . superClass _ . constructor . call ( this , a ) ; a && ( a . isShadow ( ) && ( this . recordUndo = ! 1 ) , this . xml = ( 0 , $ . module$exports$Blockly$Xml . blockToDomWithXY ) ( a ) , this . ids = ( 0 , module$exports$Blockly$Events$utils . getDescendantIds ) ( a ) , this . json = ( 0 , module$exports$Blockly$serialization$blocks . save ) ( a , { addCoordinates : ! 0 } ) ) } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BlockCreate . BlockCreate , module$exports$Blockly$Events$BlockBase . BlockBase ) ; module$exports$Blockly$Events$BlockCreate . BlockCreate . prototype . type = module$exports$Blockly$Events$utils . CREATE ;
module$exports$Blockly$Events$BlockCreate . BlockCreate . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BlockCreate . BlockCreate . superClass _ . toJson . call ( this ) ; a . xml = ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( this . xml ) ; a . ids = this . ids ; a . json = this . json ; this . recordUndo || ( a . recordUndo = this . recordUndo ) ; return a } ;
module$exports$Blockly$Events$BlockCreate . BlockCreate . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BlockCreate . BlockCreate . superClass _ . fromJson . call ( this , a ) ; this . xml = ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a . xml ) ; this . ids = a . ids ; this . json = a . json ; void 0 !== a . recordUndo && ( this . recordUndo = a . recordUndo ) } ;
module$exports$Blockly$Events$BlockCreate . BlockCreate . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; if ( a ) ( 0 , module$exports$Blockly$serialization$blocks . append ) ( this . json , b ) ; else for ( a = 0 ; a < this . ids . length ; a ++ ) { var c = this . ids [ a ] , d = b . getBlockById ( c ) ; d ? d . dispose ( ! 1 ) : c === this . blockId && console . warn ( "Can't uncreate non-existent block: " + c ) } } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . CREATE , module$exports$Blockly$Events$BlockCreate . BlockCreate ) ; var module$contents$Blockly$ContextMenu _currentBlock ; $ . module$exports$Blockly$ContextMenu = { } ; module$contents$Blockly$ContextMenu _currentBlock = null ; $ . module$exports$Blockly$ContextMenu . getCurrentBlock = function ( ) { return module$contents$Blockly$ContextMenu _currentBlock } ; $ . module$exports$Blockly$ContextMenu . setCurrentBlock = function ( a ) { module$contents$Blockly$ContextMenu _currentBlock = a } ;
Object . defineProperties ( $ . module$exports$Blockly$ContextMenu , { currentBlock : { get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.ContextMenu.currentBlock" , "September 2021" , "September 2022" , "Blockly.Tooltip.getCurrentBlock()" ) ; return ( 0 , $ . module$exports$Blockly$ContextMenu . getCurrentBlock ) ( ) } , set : function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.ContextMenu.currentBlock" , "September 2021" , "September 2022" , "Blockly.Tooltip.setCurrentBlock(block)" ) ; ( 0 , $ . module$exports$Blockly$ContextMenu . setCurrentBlock ) ( a ) } } } ) ;
var module$contents$Blockly$ContextMenu _menu _ = null ; $ . module$exports$Blockly$ContextMenu . show = function ( a , b , c ) { ( 0 , module$exports$Blockly$WidgetDiv . show ) ( $ . module$exports$Blockly$ContextMenu , c , $ . module$exports$Blockly$ContextMenu . dispose ) ; if ( b . length ) { var d = module$contents$Blockly$ContextMenu _populate _ ( b , c ) ; module$contents$Blockly$ContextMenu _menu _ = d ; module$contents$Blockly$ContextMenu _position _ ( d , a , c ) ; setTimeout ( function ( ) { d . focus ( ) } , 1 ) ; module$contents$Blockly$ContextMenu _currentBlock = null } else ( 0 , $ . module$exports$Blockly$ContextMenu . hide ) ( ) } ;
var module$contents$Blockly$ContextMenu _populate _ = function ( a , b ) { var c = new module$exports$Blockly$Menu . Menu ; c . setRole ( module$exports$Blockly$utils$aria . Role . MENU ) ; for ( var d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] , f = new module$exports$Blockly$MenuItem . MenuItem ( e . text ) ; f . setRightToLeft ( b ) ; f . setRole ( module$exports$Blockly$utils$aria . Role . MENUITEM ) ; c . addChild ( f ) ; f . setEnabled ( e . enabled ) ; if ( e . enabled ) f . onAction ( function ( g ) { ( 0 , $ . module$exports$Blockly$ContextMenu . hide ) ( ) ; this . callback ( this . scope ) } , e ) } return c } , module$contents$Blockly$ContextMenu _position _ =
function ( a , b , c ) { var d = ( 0 , module$exports$Blockly$utils$svgMath . getViewportBBox ) ( ) ; b = new module$exports$Blockly$utils$Rect . Rect ( b . clientY + d . top , b . clientY + d . top , b . clientX + d . left , b . clientX + d . left ) ; module$contents$Blockly$ContextMenu _createWidget _ ( a ) ; var e = a . getSize ( ) ; c && ( b . left += e . width , b . right += e . width , d . left += e . width , d . right += e . width ) ; ( 0 , module$exports$Blockly$WidgetDiv . positionWithAnchor ) ( d , b , e , c ) ; a . focus ( ) } , module$contents$Blockly$ContextMenu _createWidget _ = function ( a ) { var b = ( 0 , module$exports$Blockly$WidgetDiv . getDiv ) ( ) ;
if ( ! b ) throw Error ( "Attempting to create a context menu when widget div is null" ) ; a . render ( b ) ; b = a . getElement ( ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b , "blocklyContextMenu" ) ; ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "contextmenu" , null , module$contents$Blockly$ContextMenu _haltPropagation ) ; a . focus ( ) } , module$contents$Blockly$ContextMenu _haltPropagation = function ( a ) { a . preventDefault ( ) ; a . stopPropagation ( ) } ;
$ . module$exports$Blockly$ContextMenu . hide = function ( ) { ( 0 , module$exports$Blockly$WidgetDiv . hideIfOwner ) ( $ . module$exports$Blockly$ContextMenu ) ; module$contents$Blockly$ContextMenu _currentBlock = null } ; $ . module$exports$Blockly$ContextMenu . dispose = function ( ) { module$contents$Blockly$ContextMenu _menu _ && ( module$contents$Blockly$ContextMenu _menu _ . dispose ( ) , module$contents$Blockly$ContextMenu _menu _ = null ) } ;
$ . module$exports$Blockly$ContextMenu . callbackFactory = function ( a , b ) { return function ( ) { ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { var c = ( 0 , $ . module$exports$Blockly$Xml . domToBlock ) ( b , a . workspace ) ; var d = a . getRelativeToSurfaceXY ( ) ; d . x = a . RTL ? d . x - $ . module$exports$Blockly$internalConstants . SNAP _RADIUS : d . x + $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ; d . y += 2 * $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ; c . moveBy ( d . x , d . y ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) &&
! c . isShadow ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CREATE ) ) ( c ) ) ; c . select ( ) } } ; $ . module$exports$Blockly$ContextMenu . commentDeleteOption = function ( a ) { return { text : $ . module$exports$Blockly$Msg . Msg . REMOVE _COMMENT , enabled : ! 0 , callback : function ( ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; a . dispose ( ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } } } ;
$ . module$exports$Blockly$ContextMenu . commentDuplicateOption = function ( a ) { return { text : $ . module$exports$Blockly$Msg . Msg . DUPLICATE _COMMENT , enabled : ! 0 , callback : function ( ) { ( 0 , module$exports$Blockly$clipboard . duplicate ) ( a ) } } } ;
$ . module$exports$Blockly$ContextMenu . workspaceCommentOption = function ( a , b ) { var c = module$exports$Blockly$WorkspaceCommentSvg ; if ( ! c ) throw Error ( "Missing require for Blockly.WorkspaceCommentSvg" ) ; var d = { enabled : ! module$exports$Blockly$utils$userAgent . IE } ; d . text = $ . module$exports$Blockly$Msg . Msg . ADD _COMMENT ; d . callback = function ( ) { var e = new c ( a , $ . module$exports$Blockly$Msg . Msg . WORKSPACE _COMMENT _DEFAULT _TEXT , c . DEFAULT _SIZE , c . DEFAULT _SIZE ) , f = a . getInjectionDiv ( ) . getBoundingClientRect ( ) ; f = new module$exports$Blockly$utils$Coordinate . Coordinate ( b . clientX -
f . left , b . clientY - f . top ) ; var g = a . getOriginOffsetInPixels ( ) ; f = module$exports$Blockly$utils$Coordinate . Coordinate . difference ( f , g ) ; f . scale ( 1 / a . scale ) ; e . moveBy ( f . x , f . y ) ; a . rendered && ( e . initSvg ( ) , e . render ( ) , e . select ( ) ) } ; return d } ; var module$exports$Blockly$utils$array = { removeElem : function ( a , b ) { b = a . indexOf ( b ) ; if ( - 1 === b ) return ! 1 ; a . splice ( b , 1 ) ; return ! 0 } } ; var module$exports$Blockly$blockRendering$debug = { } , module$contents$Blockly$blockRendering$debug _useDebugger = ! 1 ; module$exports$Blockly$blockRendering$debug . isDebuggerEnabled = function ( ) { return module$contents$Blockly$blockRendering$debug _useDebugger } ; module$exports$Blockly$blockRendering$debug . startDebugger = function ( ) { module$contents$Blockly$blockRendering$debug _useDebugger = ! 0 } ;
module$exports$Blockly$blockRendering$debug . stopDebugger = function ( ) { module$contents$Blockly$blockRendering$debug _useDebugger = ! 1 } ; var module$exports$Blockly$blockRendering$Types = { Types : { NONE : 0 , FIELD : 1 , HAT : 2 , ICON : 4 , SPACER : 8 , BETWEEN _ROW _SPACER : 16 , IN _ROW _SPACER : 32 , EXTERNAL _VALUE _INPUT : 64 , INPUT : 128 , INLINE _INPUT : 256 , STATEMENT _INPUT : 512 , CONNECTION : 1024 , PREVIOUS _CONNECTION : 2048 , NEXT _CONNECTION : 4096 , OUTPUT _CONNECTION : 8192 , CORNER : 16384 , LEFT _SQUARE _CORNER : 32768 , LEFT _ROUND _CORNER : 65536 , RIGHT _SQUARE _CORNER : 131072 , RIGHT _ROUND _CORNER : 262144 , JAGGED _EDGE : 524288 , ROW : 1048576 , TOP _ROW : 2097152 , BOTTOM _ROW : 4194304 , INPUT _ROW : 8388608 } } ;
module$exports$Blockly$blockRendering$Types . Types . LEFT _CORNER = module$exports$Blockly$blockRendering$Types . Types . LEFT _SQUARE _CORNER | module$exports$Blockly$blockRendering$Types . Types . LEFT _ROUND _CORNER ; module$exports$Blockly$blockRendering$Types . Types . RIGHT _CORNER = module$exports$Blockly$blockRendering$Types . Types . RIGHT _SQUARE _CORNER | module$exports$Blockly$blockRendering$Types . Types . RIGHT _ROUND _CORNER ; module$exports$Blockly$blockRendering$Types . Types . nextTypeValue _ = 16777216 ;
module$exports$Blockly$blockRendering$Types . Types . getType = function ( a ) { Object . prototype . hasOwnProperty . call ( module$exports$Blockly$blockRendering$Types . Types , a ) || ( module$exports$Blockly$blockRendering$Types . Types [ a ] = module$exports$Blockly$blockRendering$Types . Types . nextTypeValue _ , module$exports$Blockly$blockRendering$Types . Types . nextTypeValue _ <<= 1 ) ; return module$exports$Blockly$blockRendering$Types . Types [ a ] } ; module$exports$Blockly$blockRendering$Types . Types . isField = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . FIELD } ;
module$exports$Blockly$blockRendering$Types . Types . isHat = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . HAT } ; module$exports$Blockly$blockRendering$Types . Types . isIcon = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . ICON } ; module$exports$Blockly$blockRendering$Types . Types . isSpacer = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . SPACER } ;
module$exports$Blockly$blockRendering$Types . Types . isInRowSpacer = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . IN _ROW _SPACER } ; module$exports$Blockly$blockRendering$Types . Types . isInput = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . INPUT } ; module$exports$Blockly$blockRendering$Types . Types . isExternalInput = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . EXTERNAL _VALUE _INPUT } ;
module$exports$Blockly$blockRendering$Types . Types . isInlineInput = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . INLINE _INPUT } ; module$exports$Blockly$blockRendering$Types . Types . isStatementInput = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . STATEMENT _INPUT } ; module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . PREVIOUS _CONNECTION } ;
module$exports$Blockly$blockRendering$Types . Types . isNextConnection = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . NEXT _CONNECTION } ; module$exports$Blockly$blockRendering$Types . Types . isPreviousOrNextConnection = function ( a ) { return a . type & ( module$exports$Blockly$blockRendering$Types . Types . PREVIOUS _CONNECTION | module$exports$Blockly$blockRendering$Types . Types . NEXT _CONNECTION ) } ; module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . LEFT _ROUND _CORNER } ;
module$exports$Blockly$blockRendering$Types . Types . isRightRoundedCorner = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . RIGHT _ROUND _CORNER } ; module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . LEFT _SQUARE _CORNER } ; module$exports$Blockly$blockRendering$Types . Types . isRightSquareCorner = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . RIGHT _SQUARE _CORNER } ;
module$exports$Blockly$blockRendering$Types . Types . isCorner = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . CORNER } ; module$exports$Blockly$blockRendering$Types . Types . isJaggedEdge = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . JAGGED _EDGE } ; module$exports$Blockly$blockRendering$Types . Types . isRow = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . ROW } ;
module$exports$Blockly$blockRendering$Types . Types . isBetweenRowSpacer = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . BETWEEN _ROW _SPACER } ; module$exports$Blockly$blockRendering$Types . Types . isTopRow = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . TOP _ROW } ; module$exports$Blockly$blockRendering$Types . Types . isBottomRow = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . BOTTOM _ROW } ;
module$exports$Blockly$blockRendering$Types . Types . isTopOrBottomRow = function ( a ) { return a . type & ( module$exports$Blockly$blockRendering$Types . Types . TOP _ROW | module$exports$Blockly$blockRendering$Types . Types . BOTTOM _ROW ) } ; module$exports$Blockly$blockRendering$Types . Types . isInputRow = function ( a ) { return a . type & module$exports$Blockly$blockRendering$Types . Types . INPUT _ROW } ; var module$exports$Blockly$blockRendering$Row = { Row : function ( a ) { this . type = module$exports$Blockly$blockRendering$Types . Types . ROW ; this . elements = [ ] ; this . xPos = this . yPos = this . widthWithConnectedBlocks = this . minWidth = this . minHeight = this . width = this . height = 0 ; this . hasJaggedEdge = this . hasDummyInput = this . hasInlineInput = this . hasStatement = this . hasExternalInput = ! 1 ; this . constants _ = a ; this . notchOffset = this . constants _ . NOTCH _OFFSET _LEFT ; this . align = null } } ;
module$exports$Blockly$blockRendering$Row . Row . prototype . getLastInput = function ( ) { for ( var a = this . elements . length - 1 ; 0 <= a ; a -- ) { var b = this . elements [ a ] ; if ( module$exports$Blockly$blockRendering$Types . Types . isInput ( b ) ) return b } return null } ; module$exports$Blockly$blockRendering$Row . Row . prototype . measure = function ( ) { throw Error ( "Unexpected attempt to measure a base Row." ) ; } ; module$exports$Blockly$blockRendering$Row . Row . prototype . startsWithElemSpacer = function ( ) { return ! 0 } ;
module$exports$Blockly$blockRendering$Row . Row . prototype . endsWithElemSpacer = function ( ) { return ! 0 } ; module$exports$Blockly$blockRendering$Row . Row . prototype . getFirstSpacer = function ( ) { for ( var a = 0 ; a < this . elements . length ; a ++ ) { var b = this . elements [ a ] ; if ( module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) ) return b } return null } ; module$exports$Blockly$blockRendering$Row . Row . prototype . getLastSpacer = function ( ) { for ( var a = this . elements . length - 1 ; 0 <= a ; a -- ) { var b = this . elements [ a ] ; if ( module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) ) return b } return null } ; var module$exports$Blockly$blockRendering$BottomRow = { BottomRow : function ( a ) { module$exports$Blockly$blockRendering$BottomRow . BottomRow . superClass _ . constructor . call ( this , a ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . BOTTOM _ROW ; this . hasNextConnection = ! 1 ; this . connection = null ; this . baseline = this . descenderHeight = 0 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$BottomRow . BottomRow , module$exports$Blockly$blockRendering$Row . Row ) ;
module$exports$Blockly$blockRendering$BottomRow . BottomRow . prototype . hasLeftSquareCorner = function ( a ) { return ! ! a . outputConnection || ! ! a . getNextBlock ( ) } ; module$exports$Blockly$blockRendering$BottomRow . BottomRow . prototype . hasRightSquareCorner = function ( a ) { return ! 0 } ;
module$exports$Blockly$blockRendering$BottomRow . BottomRow . prototype . measure = function ( ) { for ( var a = 0 , b = 0 , c = 0 , d = 0 ; d < this . elements . length ; d ++ ) { var e = this . elements [ d ] ; b += e . width ; module$exports$Blockly$blockRendering$Types . Types . isSpacer ( e ) || ( module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( e ) ? c = Math . max ( c , e . height ) : a = Math . max ( a , e . height ) ) } this . width = Math . max ( this . minWidth , b ) ; this . height = Math . max ( this . minHeight , a ) + c ; this . descenderHeight = c ; this . widthWithConnectedBlocks = this . width } ;
module$exports$Blockly$blockRendering$BottomRow . BottomRow . prototype . startsWithElemSpacer = function ( ) { return ! 1 } ; module$exports$Blockly$blockRendering$BottomRow . BottomRow . prototype . endsWithElemSpacer = function ( ) { return ! 1 } ; var module$exports$Blockly$blockRendering$Measurable = { Measurable : function ( a ) { this . height = this . width = 0 ; this . type = module$exports$Blockly$blockRendering$Types . Types . NONE ; this . centerline = this . xPos = 0 ; this . constants _ = a ; this . notchOffset = this . constants _ . NOTCH _OFFSET _LEFT } } ; var module$exports$Blockly$blockRendering$Connection = { Connection : function ( a , b ) { module$exports$Blockly$blockRendering$Connection . Connection . superClass _ . constructor . call ( this , a ) ; this . connectionModel = b ; this . shape = this . constants _ . shapeFor ( b ) ; this . isDynamicShape = ! ! this . shape . isDynamic ; this . type |= module$exports$Blockly$blockRendering$Types . Types . CONNECTION } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$Connection . Connection , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$utils$colour = { } , module$contents$Blockly$utils$colour _hsvSaturation = . 45 ; module$exports$Blockly$utils$colour . getHsvSaturation = function ( ) { return module$contents$Blockly$utils$colour _hsvSaturation } ; module$exports$Blockly$utils$colour . setHsvSaturation = function ( a ) { module$contents$Blockly$utils$colour _hsvSaturation = a } ; var module$contents$Blockly$utils$colour _hsvValue = . 65 ; module$exports$Blockly$utils$colour . getHsvValue = function ( ) { return module$contents$Blockly$utils$colour _hsvValue } ;
module$exports$Blockly$utils$colour . setHsvValue = function ( a ) { module$contents$Blockly$utils$colour _hsvValue = a } ;
module$exports$Blockly$utils$colour . parse = function ( a ) { a = String ( a ) . toLowerCase ( ) . trim ( ) ; var b = module$exports$Blockly$utils$colour . names [ a ] ; if ( b ) return b ; b = "0x" === a . substring ( 0 , 2 ) ? "#" + a . substring ( 2 ) : a ; b = "#" === b [ 0 ] ? b : "#" + b ; if ( /^#[0-9a-f]{6}$/ . test ( b ) ) return b ; if ( /^#[0-9a-f]{3}$/ . test ( b ) ) return [ "#" , b [ 1 ] , b [ 1 ] , b [ 2 ] , b [ 2 ] , b [ 3 ] , b [ 3 ] ] . join ( "" ) ; var c = a . match ( /^(?:rgb)?\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/ ) ; return c && ( a = Number ( c [ 1 ] ) , b = Number ( c [ 2 ] ) , c = Number ( c [ 3 ] ) , 0 <= a && 256 > a && 0 <= b && 256 > b && 0 <= c && 256 > c ) ?
( 0 , module$exports$Blockly$utils$colour . rgbToHex ) ( a , b , c ) : null } ; module$exports$Blockly$utils$colour . rgbToHex = function ( a , b , c ) { b = a << 16 | b << 8 | c ; return 16 > a ? "#" + ( 16777216 | b ) . toString ( 16 ) . substr ( 1 ) : "#" + b . toString ( 16 ) } ; module$exports$Blockly$utils$colour . hexToRgb = function ( a ) { a = ( 0 , module$exports$Blockly$utils$colour . parse ) ( a ) ; if ( ! a ) return [ 0 , 0 , 0 ] ; a = parseInt ( a . substr ( 1 ) , 16 ) ; return [ a >> 16 , a >> 8 & 255 , a & 255 ] } ;
module$exports$Blockly$utils$colour . hsvToHex = function ( a , b , c ) { var d = 0 , e = 0 , f = 0 ; if ( 0 === b ) f = e = d = c ; else { var g = Math . floor ( a / 60 ) , h = a / 60 - g ; a = c * ( 1 - b ) ; var k = c * ( 1 - b * h ) ; b = c * ( 1 - b * ( 1 - h ) ) ; switch ( g ) { case 1 : d = k ; e = c ; f = a ; break ; case 2 : d = a ; e = c ; f = b ; break ; case 3 : d = a ; e = k ; f = c ; break ; case 4 : d = b ; e = a ; f = c ; break ; case 5 : d = c ; e = a ; f = k ; break ; case 6 : case 0 : d = c , e = b , f = a } } return ( 0 , module$exports$Blockly$utils$colour . rgbToHex ) ( Math . floor ( d ) , Math . floor ( e ) , Math . floor ( f ) ) } ;
module$exports$Blockly$utils$colour . blend = function ( a , b , c ) { a = ( 0 , module$exports$Blockly$utils$colour . parse ) ( a ) ; if ( ! a ) return null ; b = ( 0 , module$exports$Blockly$utils$colour . parse ) ( b ) ; if ( ! b ) return null ; a = ( 0 , module$exports$Blockly$utils$colour . hexToRgb ) ( a ) ; b = ( 0 , module$exports$Blockly$utils$colour . hexToRgb ) ( b ) ; return ( 0 , module$exports$Blockly$utils$colour . rgbToHex ) ( Math . round ( b [ 0 ] + c * ( a [ 0 ] - b [ 0 ] ) ) , Math . round ( b [ 1 ] + c * ( a [ 1 ] - b [ 1 ] ) ) , Math . round ( b [ 2 ] + c * ( a [ 2 ] - b [ 2 ] ) ) ) } ;
module$exports$Blockly$utils$colour . names = { aqua : "#00ffff" , black : "#000000" , blue : "#0000ff" , fuchsia : "#ff00ff" , gray : "#808080" , green : "#008000" , lime : "#00ff00" , maroon : "#800000" , navy : "#000080" , olive : "#808000" , purple : "#800080" , red : "#ff0000" , silver : "#c0c0c0" , teal : "#008080" , white : "#ffffff" , yellow : "#ffff00" } ; module$exports$Blockly$utils$colour . hueToHex = function ( a ) { return ( 0 , module$exports$Blockly$utils$colour . hsvToHex ) ( a , module$contents$Blockly$utils$colour _hsvSaturation , 255 * module$contents$Blockly$utils$colour _hsvValue ) } ; var module$exports$Blockly$utils$svgPaths = { point : function ( a , b ) { return " " + a + "," + b + " " } , curve : function ( a , b ) { return " " + a + b . join ( "" ) } , moveTo : function ( a , b ) { return " M " + a + "," + b + " " } , moveBy : function ( a , b ) { return " m " + a + "," + b + " " } , lineTo : function ( a , b ) { return " l " + a + "," + b + " " } , line : function ( a ) { return " l" + a . join ( "" ) } , lineOnAxis : function ( a , b ) { return " " + a + " " + b + " " } , arc : function ( a , b , c , d ) { return a + " " + c + " " + c + " " + b + d } } ; var module$exports$Blockly$utils$parsing = { } , module$contents$Blockly$utils$parsing _tokenizeInterpolationInternal = function ( a , b ) { var c = [ ] , d = a . split ( "" ) ; d . push ( "" ) ; var e = 0 ; a = [ ] ; for ( var f = null , g = 0 ; g < d . length ; g ++ ) { var h = d [ g ] ; 0 === e ? "%" === h ? ( ( e = a . join ( "" ) ) && c . push ( e ) , a . length = 0 , e = 1 ) : a . push ( h ) : 1 === e ? "%" === h ? ( a . push ( h ) , e = 0 ) : b && "0" <= h && "9" >= h ? ( e = 2 , f = h , ( h = a . join ( "" ) ) && c . push ( h ) , a . length = 0 ) : "{" === h ? e = 3 : ( a . push ( "%" , h ) , e = 0 ) : 2 === e ? "0" <= h && "9" >= h ? f += h : ( c . push ( parseInt ( f , 10 ) ) , g -- , e = 0 ) : 3 === e && ( "" === h ? ( a . splice ( 0 , 0 ,
"%{" ) , g -- , e = 0 ) : "}" !== h ? a . push ( h ) : ( e = a . join ( "" ) , /[A-Z]\w*/i . test ( e ) ? ( h = e . toUpperCase ( ) , ( h = ( 0 , $ . module$exports$Blockly$utils$string . startsWith ) ( h , "BKY_" ) ? h . substring ( 4 ) : null ) && h in $ . module$exports$Blockly$Msg . Msg ? ( e = $ . module$exports$Blockly$Msg . Msg [ h ] , "string" === typeof e ? Array . prototype . push . apply ( c , module$contents$Blockly$utils$parsing _tokenizeInterpolationInternal ( e , b ) ) : b ? c . push ( String ( e ) ) : c . push ( e ) ) : c . push ( "%{" + e + "}" ) ) : c . push ( "%{" + e + "}" ) , e = a . length = 0 ) ) } ( b = a . join ( "" ) ) && c . push ( b ) ; d = [ ] ; for ( f = a . length =
0 ; f < c . length ; f ++ ) "string" === typeof c [ f ] ? a . push ( c [ f ] ) : ( ( b = a . join ( "" ) ) && d . push ( b ) , a . length = 0 , d . push ( c [ f ] ) ) ; ( b = a . join ( "" ) ) && d . push ( b ) ; a . length = 0 ; return d } ; module$exports$Blockly$utils$parsing . tokenizeInterpolation = function ( a ) { return module$contents$Blockly$utils$parsing _tokenizeInterpolationInternal ( a , ! 0 ) } ;
module$exports$Blockly$utils$parsing . replaceMessageReferences = function ( a ) { if ( "string" !== typeof a ) return a ; a = module$contents$Blockly$utils$parsing _tokenizeInterpolationInternal ( a , ! 1 ) ; return a . length ? String ( a [ 0 ] ) : "" } ; module$exports$Blockly$utils$parsing . checkMessageReferences = function ( a ) { for ( var b = ! 0 , c = $ . module$exports$Blockly$Msg . Msg , d = a . match ( /%{BKY_[A-Z]\w*}/ig ) , e = 0 ; e < d . length ; e ++ ) { var f = d [ e ] . toUpperCase ( ) ; void 0 === c [ f . slice ( 6 , - 1 ) ] && ( console . warn ( "No message string for " + d [ e ] + " in " + a ) , b = ! 1 ) } return b } ;
module$exports$Blockly$utils$parsing . parseBlockColour = function ( a ) { var b = "string" === typeof a ? ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a ) : a , c = Number ( b ) ; if ( ! isNaN ( c ) && 0 <= c && 360 >= c ) return { hue : c , hex : ( 0 , module$exports$Blockly$utils$colour . hsvToHex ) ( c , ( 0 , module$exports$Blockly$utils$colour . getHsvSaturation ) ( ) , 255 * ( 0 , module$exports$Blockly$utils$colour . getHsvValue ) ( ) ) } ; if ( c = ( 0 , module$exports$Blockly$utils$colour . parse ) ( b ) ) return { hue : null , hex : c } ; c = 'Invalid colour: "' + b + '"' ; a !== b &&
( c += ' (from "' + a + '")' ) ; throw Error ( c ) ; } ; var module$exports$Blockly$blockRendering$ConstantProvider = { ConstantProvider : function ( ) { this . NO _PADDING = 0 ; this . SMALL _PADDING = 3 ; this . MEDIUM _PADDING = 5 ; this . MEDIUM _LARGE _PADDING = 8 ; this . LARGE _PADDING = 10 ; this . TALL _INPUT _FIELD _OFFSET _Y = this . MEDIUM _PADDING ; this . TAB _HEIGHT = 15 ; this . TAB _OFFSET _FROM _TOP = 5 ; this . TAB _VERTICAL _OVERLAP = 2.5 ; this . TAB _WIDTH = 8 ; this . NOTCH _WIDTH = 15 ; this . NOTCH _HEIGHT = 4 ; this . MIN _BLOCK _WIDTH = 12 ; this . EMPTY _BLOCK _SPACER _HEIGHT = 16 ; this . DUMMY _INPUT _SHADOW _MIN _HEIGHT = this . DUMMY _INPUT _MIN _HEIGHT =
this . TAB _HEIGHT ; this . CORNER _RADIUS = 8 ; this . STATEMENT _INPUT _NOTCH _OFFSET = this . NOTCH _OFFSET _LEFT = 15 ; this . STATEMENT _BOTTOM _SPACER = 0 ; this . STATEMENT _INPUT _PADDING _LEFT = 20 ; this . BETWEEN _STATEMENT _PADDING _Y = 4 ; this . TOP _ROW _MIN _HEIGHT = this . MEDIUM _PADDING ; this . TOP _ROW _PRECEDES _STATEMENT _MIN _HEIGHT = this . LARGE _PADDING ; this . BOTTOM _ROW _MIN _HEIGHT = this . MEDIUM _PADDING ; this . BOTTOM _ROW _AFTER _STATEMENT _MIN _HEIGHT = this . LARGE _PADDING ; this . ADD _START _HATS = ! 1 ; this . START _HAT _HEIGHT = 15 ; this . START _HAT _WIDTH = 100 ; this . SPACER _DEFAULT _HEIGHT =
15 ; this . MIN _BLOCK _HEIGHT = 24 ; this . EMPTY _INLINE _INPUT _PADDING = 14.5 ; this . EMPTY _INLINE _INPUT _HEIGHT = this . TAB _HEIGHT + 11 ; this . EXTERNAL _VALUE _INPUT _PADDING = 2 ; this . EMPTY _STATEMENT _INPUT _HEIGHT = this . MIN _BLOCK _HEIGHT ; this . START _POINT = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( 0 , 0 ) ; this . JAGGED _TEETH _HEIGHT = 12 ; this . JAGGED _TEETH _WIDTH = 6 ; this . FIELD _TEXT _FONTSIZE = 11 ; this . FIELD _TEXT _FONTWEIGHT = "normal" ; this . FIELD _TEXT _FONTFAMILY = "sans-serif" ; this . FIELD _TEXT _BASELINE = this . FIELD _TEXT _HEIGHT = - 1 ; this . FIELD _BORDER _RECT _RADIUS =
4 ; this . FIELD _BORDER _RECT _HEIGHT = 16 ; this . FIELD _BORDER _RECT _X _PADDING = 5 ; this . FIELD _BORDER _RECT _Y _PADDING = 3 ; this . FIELD _BORDER _RECT _COLOUR = "#fff" ; this . FIELD _TEXT _BASELINE _CENTER = ! module$exports$Blockly$utils$userAgent . IE && ! module$exports$Blockly$utils$userAgent . EDGE ; this . FIELD _DROPDOWN _BORDER _RECT _HEIGHT = this . FIELD _BORDER _RECT _HEIGHT ; this . FIELD _DROPDOWN _SVG _ARROW = this . FIELD _DROPDOWN _COLOURED _DIV = this . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW = ! 1 ; this . FIELD _DROPDOWN _SVG _ARROW _PADDING = this . FIELD _BORDER _RECT _X _PADDING ;
this . FIELD _DROPDOWN _SVG _ARROW _SIZE = 12 ; this . FIELD _DROPDOWN _SVG _ARROW _DATAURI = "data:image/svg+xml;base64,PHN2ZyBpZD0iTGF5ZXJfMSIgZGF0YS1uYW1lPSJMYXllciAxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMi43MSIgaGVpZ2h0PSI4Ljc5IiB2aWV3Qm94PSIwIDAgMTIuNzEgOC43OSI+PHRpdGxlPmRyb3Bkb3duLWFycm93PC90aXRsZT48ZyBvcGFjaXR5PSIwLjEiPjxwYXRoIGQ9Ik0xMi43MSwyLjQ0QTIuNDEsMi40MSwwLDAsMSwxMiw0LjE2TDguMDgsOC4wOGEyLjQ1LDIuNDUsMCwwLDEtMy40NSwwTDAuNzIsNC4xNkEyLjQyLDIuNDIsMCwwLDEsMCwyLjQ0LDIuNDgsMi40OCwwLDAsMSwuNzEuNzFDMSwwLjQ3LDEuNDMsMCw2LjM2LDBTMTEuNzUsMC40NiwxMiwuNzFBMi40NCwyLjQ0LDAsMCwxLDEyLjcxLDIuNDRaIiBmaWxsPSIjMjMxZjIwIi8+PC9nPjxwYXRoIGQ9Ik02LjM2LDcuNzlhMS40MywxLjQzLDAsMCwxLTEtLjQyTDEuNDIsMy40NWExLjQ0LDEuNDQsMCwwLDEsMC0yYzAuNTYtLjU2LDkuMzEtMC41Niw5Ljg3LDBhMS40NCwxLjQ0LDAsMCwxLDAsMkw3LjM3LDcuMzdBMS40MywxLjQzLDAsMCwxLDYuMzYsNy43OVoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=" ;
this . FIELD _COLOUR _FULL _BLOCK = this . FIELD _TEXTINPUT _BOX _SHADOW = ! 1 ; this . FIELD _COLOUR _DEFAULT _WIDTH = 26 ; this . FIELD _COLOUR _DEFAULT _HEIGHT = this . FIELD _BORDER _RECT _HEIGHT ; this . FIELD _CHECKBOX _X _OFFSET = this . FIELD _BORDER _RECT _X _PADDING - 3 ; this . randomIdentifier = String ( Math . random ( ) ) . substring ( 2 ) ; this . defs _ = null ; this . embossFilterId = "" ; this . embossFilter _ = null ; this . disabledPatternId = "" ; this . disabledPattern _ = null ; this . debugFilterId = "" ; this . cssNode _ = this . debugFilter _ = null ; this . CURSOR _COLOUR = "#cc0a0a" ; this . MARKER _COLOUR =
"#4286f4" ; this . CURSOR _WS _WIDTH = 100 ; this . WS _CURSOR _HEIGHT = 5 ; this . CURSOR _STACK _PADDING = 10 ; this . CURSOR _BLOCK _PADDING = 2 ; this . CURSOR _STROKE _WIDTH = 4 ; this . FULL _BLOCK _FIELDS = ! 1 ; this . INSERTION _MARKER _COLOUR = "#000000" ; this . INSERTION _MARKER _OPACITY = . 2 ; this . SHAPES = { PUZZLE : 1 , NOTCH : 2 } } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . init = function ( ) { this . JAGGED _TEETH = this . makeJaggedTeeth ( ) ; this . NOTCH = this . makeNotch ( ) ; this . START _HAT = this . makeStartHat ( ) ; this . PUZZLE _TAB = this . makePuzzleTab ( ) ; this . INSIDE _CORNERS = this . makeInsideCorners ( ) ; this . OUTSIDE _CORNERS = this . makeOutsideCorners ( ) } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . setTheme = function ( a ) { this . blockStyles = Object . create ( null ) ; var b = a . blockStyles , c ; for ( c in b ) this . blockStyles [ c ] = this . validatedBlockStyle _ ( b [ c ] ) ; this . setDynamicProperties _ ( a ) } ; module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . setDynamicProperties _ = function ( a ) { this . setFontConstants _ ( a ) ; this . setComponentConstants _ ( a ) ; this . ADD _START _HATS = null !== a . startHats ? a . startHats : this . ADD _START _HATS } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . setFontConstants _ = function ( a ) { this . FIELD _TEXT _FONTFAMILY = a . fontStyle && void 0 !== a . fontStyle . family ? a . fontStyle . family : this . FIELD _TEXT _FONTFAMILY ; this . FIELD _TEXT _FONTWEIGHT = a . fontStyle && void 0 !== a . fontStyle . weight ? a . fontStyle . weight : this . FIELD _TEXT _FONTWEIGHT ; this . FIELD _TEXT _FONTSIZE = a . fontStyle && void 0 !== a . fontStyle . size ? a . fontStyle . size : this . FIELD _TEXT _FONTSIZE ; a = ( 0 , module$exports$Blockly$utils$dom . measureFontMetrics ) ( "Hg" ,
this . FIELD _TEXT _FONTSIZE + "pt" , this . FIELD _TEXT _FONTWEIGHT , this . FIELD _TEXT _FONTFAMILY ) ; this . FIELD _TEXT _HEIGHT = a . height ; this . FIELD _TEXT _BASELINE = a . baseline } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . setComponentConstants _ = function ( a ) { this . CURSOR _COLOUR = a . getComponentStyle ( "cursorColour" ) || this . CURSOR _COLOUR ; this . MARKER _COLOUR = a . getComponentStyle ( "markerColour" ) || this . MARKER _COLOUR ; this . INSERTION _MARKER _COLOUR = a . getComponentStyle ( "insertionMarkerColour" ) || this . INSERTION _MARKER _COLOUR ; this . INSERTION _MARKER _OPACITY = Number ( a . getComponentStyle ( "insertionMarkerOpacity" ) ) || this . INSERTION _MARKER _OPACITY } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . getBlockStyleForColour = function ( a ) { var b = "auto_" + a ; this . blockStyles [ b ] || ( this . blockStyles [ b ] = this . createBlockStyle _ ( a ) ) ; return { style : this . blockStyles [ b ] , name : b } } ; module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . getBlockStyle = function ( a ) { return this . blockStyles [ a || "" ] || ( a && 0 === a . indexOf ( "auto_" ) ? this . getBlockStyleForColour ( a . substring ( 5 ) ) . style : this . createBlockStyle _ ( "#000000" ) ) } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . createBlockStyle _ = function ( a ) { return this . validatedBlockStyle _ ( { colourPrimary : a } ) } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . validatedBlockStyle _ = function ( a ) { var b = { } ; a && ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( b , a ) ; a = ( 0 , module$exports$Blockly$utils$parsing . parseBlockColour ) ( b . colourPrimary || "#000" ) ; b . colourPrimary = a . hex ; b . colourSecondary = b . colourSecondary ? ( 0 , module$exports$Blockly$utils$parsing . parseBlockColour ) ( b . colourSecondary ) . hex : this . generateSecondaryColour _ ( b . colourPrimary ) ; b . colourTertiary = b . colourTertiary ? ( 0 , module$exports$Blockly$utils$parsing . parseBlockColour ) ( b . colourTertiary ) . hex :
this . generateTertiaryColour _ ( b . colourPrimary ) ; b . hat = b . hat || "" ; return b } ; module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . generateSecondaryColour _ = function ( a ) { return ( 0 , module$exports$Blockly$utils$colour . blend ) ( "#fff" , a , . 6 ) || a } ; module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . generateTertiaryColour _ = function ( a ) { return ( 0 , module$exports$Blockly$utils$colour . blend ) ( "#fff" , a , . 3 ) || a } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . dispose = function ( ) { this . embossFilter _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . embossFilter _ ) ; this . disabledPattern _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . disabledPattern _ ) ; this . debugFilter _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . debugFilter _ ) ; this . cssNode _ = null } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . makeJaggedTeeth = function ( ) { var a = this . JAGGED _TEETH _HEIGHT , b = this . JAGGED _TEETH _WIDTH , c = ( 0 , module$exports$Blockly$utils$svgPaths . line ) ( [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( b , a / 4 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 2 * - b , a / 2 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( b , a / 4 ) ] ) ; return { height : a , width : b , path : c } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . makeStartHat = function ( ) { var a = this . START _HAT _HEIGHT , b = this . START _HAT _WIDTH , c = ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 30 , - a ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 70 , - a ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( b , 0 ) ] ) ; return { height : a , width : b , path : c } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . makePuzzleTab = function ( ) { function a ( f ) { f = f ? - 1 : 1 ; var g = - f , h = c / 2 , k = h + 2.5 , l = h + . 5 , m = ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - b , f * h ) ; h = ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( b , f * h ) ; return ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 0 , f * k ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - b , g * l ) , m ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "s" ,
[ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( b , 2.5 * g ) , h ] ) } var b = this . TAB _WIDTH , c = this . TAB _HEIGHT , d = a ( ! 0 ) , e = a ( ! 1 ) ; return { type : this . SHAPES . PUZZLE , width : b , height : c , pathDown : e , pathUp : d } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . makeNotch = function ( ) { function a ( g ) { return ( 0 , module$exports$Blockly$utils$svgPaths . line ) ( [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( g * d , c ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 3 * g , 0 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( g * d , - c ) ] ) } var b = this . NOTCH _WIDTH , c = this . NOTCH _HEIGHT , d = ( b - 3 ) / 2 , e = a ( 1 ) , f = a ( - 1 ) ; return { type : this . SHAPES . NOTCH , width : b , height : c , pathLeft : e , pathRight : f } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . makeInsideCorners = function ( ) { var a = this . CORNER _RADIUS , b = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - a , a ) ) , c = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a , a ) ) ; return { width : a , height : a , pathTop : b , pathBottom : c } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . makeOutsideCorners = function ( ) { var a = this . CORNER _RADIUS , b = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( 0 , a ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a , - a ) ) , c = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a , a ) ) , d = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - a ,
- a ) ) , e = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - a , a ) ) ; return { topLeft : b , topRight : c , bottomRight : e , bottomLeft : d , rightHeight : a } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . shapeFor = function ( a ) { switch ( a . type ) { case $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE : case $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE : return this . PUZZLE _TAB ; case $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT : case $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT : return this . NOTCH ; default : throw Error ( "Unknown connection type" ) ;
} } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . createDom = function ( a , b , c ) { this . injectCSS _ ( b , c ) ; this . defs _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . DEFS , { } , a ) ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FILTER , { id : "blocklyEmbossFilter" + this . randomIdentifier } , this . defs _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEGAUSSIANBLUR , { "in" : "SourceAlpha" ,
stdDeviation : 1 , result : "blur" } , a ) ; b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FESPECULARLIGHTING , { "in" : "blur" , surfaceScale : 1 , specularConstant : . 5 , specularExponent : 10 , "lighting-color" : "white" , result : "specOut" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEPOINTLIGHT , { x : - 5E3 , y : - 1E4 , z : 2E4 } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE , { "in" : "specOut" ,
in2 : "SourceAlpha" , operator : "in" , result : "specOut" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE , { "in" : "SourceGraphic" , in2 : "specOut" , operator : "arithmetic" , k1 : 0 , k2 : 1 , k3 : 1 , k4 : 0 } , a ) ; this . embossFilterId = a . id ; this . embossFilter _ = a ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATTERN , { id : "blocklyDisabledPattern" + this . randomIdentifier , patternUnits : "userSpaceOnUse" , width : 10 , height : 10 } , this . defs _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT ,
{ width : 10 , height : 10 , fill : "#aaa" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { 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 ( ) } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . createDebugFilter = function ( ) { if ( ! this . debugFilter _ ) { var a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FILTER , { id : "blocklyDebugFilter" + this . randomIdentifier , height : "160%" , width : "180%" , y : "-30%" , x : "-40%" } , this . defs _ ) , b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPONENTTRANSFER , { result : "outBlur" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEFUNCA ,
{ type : "table" , tableValues : "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEFLOOD , { "flood-color" : "#ff0000" , "flood-opacity" : . 5 , result : "outColor" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE , { "in" : "outColor" , in2 : "outBlur" , operator : "in" , result : "outGlow" } , a ) ; this . debugFilterId = a . id ; this . debugFilter _ = a } } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . injectCSS _ = function ( a , b ) { b = this . getCSS _ ( b ) ; a = "blockly-renderer-style-" + a ; this . cssNode _ = document . getElementById ( a ) ; var 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 ) , document . head . insertBefore ( b , document . head . firstChild ) , this . cssNode _ = b ) } ;
module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider . prototype . getCSS _ = function ( 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 + " .blocklyNonEditableText>rect," , a + " .blocklyEditableText>rect {" , "fill: " + this . FIELD _BORDER _RECT _COLOUR + ";" , "fill-opacity: .6;" , "stroke: none;" , "}" , a + " .blocklyNonEditableText>text," , a + " .blocklyEditableText>text {" ,
"fill: #000;" , "}" , a + " .blocklyFlyoutLabelText {" , "fill: #000;" , "}" , a + " .blocklyText.blocklyBubbleText {" , "fill: #000;" , "}" , a + " .blocklyEditableText:not(.editing):hover>rect {" , "stroke: #fff;" , "stroke-width: 2;" , "}" , a + " .blocklyHtmlInput {" , "font-family: " + this . FIELD _TEXT _FONTFAMILY + ";" , "font-weight: " + this . FIELD _TEXT _FONTWEIGHT + ";" , "}" , a + " .blocklySelected>.blocklyPath {" , "stroke: #fc3;" , "stroke-width: 3px;" , "}" , a + " .blocklyHighlightedConnectionPath {" , "stroke: #fc3;" , "}" , a + " .blocklyReplaceable .blocklyPath {" ,
"fill-opacity: .5;" , "}" , a + " .blocklyReplaceable .blocklyPathLight," , a + " .blocklyReplaceable .blocklyPathDark {" , "display: none;" , "}" , a + " .blocklyInsertionMarker>.blocklyPath {" , "fill-opacity: " + this . INSERTION _MARKER _OPACITY + ";" , "stroke: none;" , "}" ] } ; var module$exports$Blockly$fieldRegistry = { register : function ( a , b ) { ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . FIELD , a , b ) } , unregister : function ( a ) { ( 0 , module$exports$Blockly$registry . unregister ) ( module$exports$Blockly$registry . Type . FIELD , a ) } , fromJson : function ( a ) { var b = ( 0 , module$exports$Blockly$registry . getObject ) ( module$exports$Blockly$registry . Type . FIELD , a . type ) ; return b ? b . fromJson ( a ) : ( console . warn ( "Blockly could not create a field of type " + a . type + ". The field is probably not being registered. This could be because the file is not loaded, the field does not register itself (Issue #1584), or the registration is not being reached." ) ,
null ) } } ; var module$exports$Blockly$IASTNodeLocation = { IASTNodeLocation : function ( ) { } } ; var module$exports$Blockly$IASTNodeLocationSvg = { IASTNodeLocationSvg : function ( ) { } } ; var module$exports$Blockly$IASTNodeLocationWithBlock = { IASTNodeLocationWithBlock : function ( ) { } } ; var module$exports$Blockly$IKeyboardAccessible = { IKeyboardAccessible : function ( ) { } } ; var module$exports$Blockly$IRegistrable = { IRegistrable : function ( ) { } } ; var module$exports$Blockly$MarkerManager = { MarkerManager : function ( a ) { this . cursorSvg _ = this . cursor _ = null ; this . markers _ = Object . create ( null ) ; this . workspace _ = a } } ; module$exports$Blockly$MarkerManager . MarkerManager . LOCAL _MARKER = "local_marker_1" ;
module$exports$Blockly$MarkerManager . MarkerManager . prototype . registerMarker = function ( a , b ) { this . markers _ [ a ] && this . unregisterMarker ( a ) ; b . setDrawer ( this . workspace _ . getRenderer ( ) . makeMarkerDrawer ( this . workspace _ , b ) ) ; this . setMarkerSvg ( b . getDrawer ( ) . createDom ( ) ) ; this . markers _ [ a ] = b } ;
module$exports$Blockly$MarkerManager . MarkerManager . prototype . unregisterMarker = function ( a ) { var b = this . markers _ [ a ] ; if ( b ) b . dispose ( ) , delete this . markers _ [ a ] ; else throw Error ( "Marker with ID " + a + " does not exist. Can only unregister markers that exist." ) ; } ; module$exports$Blockly$MarkerManager . MarkerManager . prototype . getCursor = function ( ) { return this . cursor _ } ; module$exports$Blockly$MarkerManager . MarkerManager . prototype . getMarker = function ( a ) { return this . markers _ [ a ] || null } ;
module$exports$Blockly$MarkerManager . MarkerManager . prototype . setCursor = function ( a ) { this . cursor _ && this . cursor _ . getDrawer ( ) && this . cursor _ . getDrawer ( ) . dispose ( ) ; if ( this . cursor _ = a ) a = this . workspace _ . getRenderer ( ) . makeMarkerDrawer ( this . workspace _ , this . cursor _ ) , this . cursor _ . setDrawer ( a ) , this . setCursorSvg ( this . cursor _ . getDrawer ( ) . createDom ( ) ) } ;
module$exports$Blockly$MarkerManager . MarkerManager . prototype . setCursorSvg = function ( a ) { a ? ( this . workspace _ . getBlockCanvas ( ) . appendChild ( a ) , this . cursorSvg _ = a ) : this . cursorSvg _ = null } ; module$exports$Blockly$MarkerManager . MarkerManager . prototype . setMarkerSvg = function ( a ) { a ? this . workspace _ . getBlockCanvas ( ) && ( this . cursorSvg _ ? this . workspace _ . getBlockCanvas ( ) . insertBefore ( a , this . cursorSvg _ ) : this . workspace _ . getBlockCanvas ( ) . appendChild ( a ) ) : this . markerSvg _ = null } ;
module$exports$Blockly$MarkerManager . MarkerManager . prototype . updateMarkers = function ( ) { this . workspace _ . keyboardAccessibilityMode && this . cursorSvg _ && this . workspace _ . getCursor ( ) . draw ( ) } ; module$exports$Blockly$MarkerManager . MarkerManager . prototype . dispose = function ( ) { for ( var a = Object . keys ( this . markers _ ) , b = 0 , c ; c = a [ b ] ; b ++ ) this . unregisterMarker ( c ) ; this . markers _ = null ; this . cursor _ && ( this . cursor _ . dispose ( ) , this . cursor _ = null ) } ; var module$exports$Blockly$Events$BlockChange = { BlockChange : function ( a , b , c , d , e ) { module$exports$Blockly$Events$BlockChange . BlockChange . superClass _ . constructor . call ( this , a ) ; a && ( this . element = "undefined" === typeof b ? "" : b , this . name = "undefined" === typeof c ? "" : c , this . oldValue = "undefined" === typeof d ? "" : d , this . newValue = "undefined" === typeof e ? "" : e ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BlockChange . BlockChange , module$exports$Blockly$Events$BlockBase . BlockBase ) ;
module$exports$Blockly$Events$BlockChange . BlockChange . prototype . type = module$exports$Blockly$Events$utils . CHANGE ; module$exports$Blockly$Events$BlockChange . BlockChange . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BlockChange . BlockChange . superClass _ . toJson . call ( this ) ; a . element = this . element ; this . name && ( a . name = this . name ) ; a . oldValue = this . oldValue ; a . newValue = this . newValue ; return a } ;
module$exports$Blockly$Events$BlockChange . BlockChange . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BlockChange . BlockChange . superClass _ . fromJson . call ( this , a ) ; this . element = a . element ; this . name = a . name ; this . oldValue = a . oldValue ; this . newValue = a . newValue } ; module$exports$Blockly$Events$BlockChange . BlockChange . prototype . isNull = function ( ) { return this . oldValue === this . newValue } ;
module$exports$Blockly$Events$BlockChange . BlockChange . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) . getBlockById ( this . blockId ) ; if ( b ) switch ( b . mutator && b . mutator . setVisible ( ! 1 ) , a = a ? this . newValue : this . oldValue , 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" : b . setEnabled ( ! a ) ; break ; case "inline" : b . setInputsInline ( ! ! a ) ;
break ; case "mutation" : var c = module$exports$Blockly$Events$BlockChange . BlockChange . getExtraBlockState _ ( b ) ; b . loadExtraState ? b . loadExtraState ( JSON . parse ( a || "{}" ) ) : b . domToMutation && b . domToMutation ( ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a || "<mutation/>" ) ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new module$exports$Blockly$Events$BlockChange . BlockChange ( b , "mutation" , null , c , a ) ) ; break ; default : console . warn ( "Unknown change type: " + this . element ) } else console . warn ( "Can't change non-existent block: " +
this . blockId ) } ; module$exports$Blockly$Events$BlockChange . BlockChange . getExtraBlockState _ = function ( a ) { return a . saveExtraState ? ( a = a . saveExtraState ( ) ) ? JSON . stringify ( a ) : "" : a . mutationToDom ? ( a = a . mutationToDom ( ) ) ? ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( a ) : "" : "" } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . CHANGE , module$exports$Blockly$Events$BlockChange . BlockChange ) ; var module$exports$Blockly$blockAnimations = { } , module$contents$Blockly$blockAnimations _disconnectPid = 0 , module$contents$Blockly$blockAnimations _disconnectGroup = null ;
module$exports$Blockly$blockAnimations . disposeUiEffect = function ( a ) { var b = a . workspace , c = a . getSvgRoot ( ) ; b . getAudioManager ( ) . play ( "delete" ) ; a = b . getSvgXY ( c ) ; c = c . cloneNode ( ! 0 ) ; c . translateX _ = a . x ; c . translateY _ = a . y ; c . setAttribute ( "transform" , "translate(" + a . x + "," + a . y + ")" ) ; b . getParentSvg ( ) . appendChild ( c ) ; c . bBox _ = c . getBBox ( ) ; module$contents$Blockly$blockAnimations _disposeUiStep ( c , b . RTL , new Date , b . scale ) } ;
var module$contents$Blockly$blockAnimations _disposeUiStep = function ( a , b , c , d ) { var e = ( new Date - c ) / 150 ; 1 < e ? ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( a ) : ( a . setAttribute ( "transform" , "translate(" + ( a . translateX _ + ( b ? - 1 : 1 ) * a . bBox _ . width * d / 2 * e ) + "," + ( a . translateY _ + a . bBox _ . height * d * e ) + ") scale(" + ( 1 - e ) * d + ")" ) , setTimeout ( module$contents$Blockly$blockAnimations _disposeUiStep , 10 , a , b , c , d ) ) } ;
module$exports$Blockly$blockAnimations . connectionUiEffect = function ( a ) { var b = a . workspace , c = b . scale ; b . getAudioManager ( ) . play ( "click" ) ; if ( ! ( 1 > c ) ) { var d = b . getSvgXY ( a . getSvgRoot ( ) ) ; a . outputConnection ? ( d . x += ( a . RTL ? 3 : - 3 ) * c , d . y += 13 * c ) : a . previousConnection && ( d . x += ( a . RTL ? - 23 : 23 ) * c , d . y += 3 * c ) ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { cx : d . x , cy : d . y , r : 0 , fill : "none" , stroke : "#888" , "stroke-width" : 10 } , b . getParentSvg ( ) ) ; module$contents$Blockly$blockAnimations _connectionUiStep ( a ,
new Date , c ) } } ; var module$contents$Blockly$blockAnimations _connectionUiStep = function ( a , b , c ) { var d = ( new Date - b ) / 150 ; 1 < d ? ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( a ) : ( a . setAttribute ( "r" , 25 * d * c ) , a . style . opacity = 1 - d , module$contents$Blockly$blockAnimations _disconnectPid = setTimeout ( module$contents$Blockly$blockAnimations _connectionUiStep , 10 , a , b , c ) ) } ;
module$exports$Blockly$blockAnimations . disconnectUiEffect = function ( a ) { a . workspace . getAudioManager ( ) . play ( "disconnect" ) ; if ( ! ( 1 > a . workspace . scale ) ) { var b = a . getHeightWidth ( ) . height ; b = Math . atan ( 10 / b ) / Math . PI * 180 ; a . RTL || ( b *= - 1 ) ; module$contents$Blockly$blockAnimations _disconnectUiStep ( a . getSvgRoot ( ) , b , new Date ) } } ;
var module$contents$Blockly$blockAnimations _disconnectUiStep = function ( a , b , c ) { var d = ( new Date - c ) / 200 ; 1 < d ? a . skew _ = "" : ( a . skew _ = "skewX(" + Math . round ( Math . sin ( d * Math . PI * 3 ) * ( 1 - d ) * b ) + ")" , module$contents$Blockly$blockAnimations _disconnectGroup = a , module$contents$Blockly$blockAnimations _disconnectPid = setTimeout ( module$contents$Blockly$blockAnimations _disconnectUiStep , 10 , a , b , c ) ) ; a . setAttribute ( "transform" , a . translate _ + a . skew _ ) } ;
module$exports$Blockly$blockAnimations . disconnectUiStop = function ( ) { if ( module$contents$Blockly$blockAnimations _disconnectGroup ) { clearTimeout ( module$contents$Blockly$blockAnimations _disconnectPid ) ; var a = module$contents$Blockly$blockAnimations _disconnectGroup ; a . skew _ = "" ; a . setAttribute ( "transform" , a . translate _ ) ; module$contents$Blockly$blockAnimations _disconnectGroup = null } } ; var module$exports$Blockly$ComponentManager = { ComponentManager : function ( ) { this . componentData _ = Object . create ( null ) ; this . capabilityToComponentIds _ = Object . create ( null ) } } ;
module$exports$Blockly$ComponentManager . ComponentManager . prototype . addComponent = function ( a , b ) { var c = a . component . id ; if ( ! b && this . componentData _ [ c ] ) throw Error ( 'Plugin "' + c + '" with capabilities "' + this . componentData _ [ c ] . capabilities + '" already added.' ) ; this . componentData _ [ c ] = a ; b = [ ] ; for ( var d = 0 ; d < a . capabilities . length ; d ++ ) { var e = String ( a . capabilities [ d ] ) . toLowerCase ( ) ; b . push ( e ) ; void 0 === this . capabilityToComponentIds _ [ e ] ? this . capabilityToComponentIds _ [ e ] = [ c ] : this . capabilityToComponentIds _ [ e ] . push ( c ) } this . componentData _ [ c ] . capabilities =
b } ; module$exports$Blockly$ComponentManager . ComponentManager . prototype . removeComponent = function ( a ) { var b = this . componentData _ [ a ] ; if ( b ) { for ( var c = 0 ; c < b . capabilities . length ; c ++ ) { var d = String ( b . capabilities [ c ] ) . toLowerCase ( ) ; ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . capabilityToComponentIds _ [ d ] , a ) } delete this . componentData _ [ a ] } } ;
module$exports$Blockly$ComponentManager . ComponentManager . prototype . addCapability = function ( a , b ) { if ( ! this . getComponent ( a ) ) throw Error ( 'Cannot add capability, "' + b + '". Plugin "' + a + '" has not been added to the ComponentManager' ) ; this . hasCapability ( a , b ) ? console . warn ( 'Plugin "' + a + 'already has capability "' + b + '"' ) : ( b = String ( b ) . toLowerCase ( ) , this . componentData _ [ a ] . capabilities . push ( b ) , this . capabilityToComponentIds _ [ b ] . push ( a ) ) } ;
module$exports$Blockly$ComponentManager . ComponentManager . prototype . removeCapability = function ( a , b ) { if ( ! this . getComponent ( a ) ) throw Error ( 'Cannot remove capability, "' + b + '". Plugin "' + a + '" has not been added to the ComponentManager' ) ; this . hasCapability ( a , b ) ? ( b = String ( b ) . toLowerCase ( ) , ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . componentData _ [ a ] . capabilities , b ) , ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . capabilityToComponentIds _ [ b ] , a ) ) : console . warn ( 'Plugin "' + a + "doesn't have capability \"" +
b + '" to remove' ) } ; module$exports$Blockly$ComponentManager . ComponentManager . prototype . hasCapability = function ( a , b ) { b = String ( b ) . toLowerCase ( ) ; return - 1 !== this . componentData _ [ a ] . capabilities . indexOf ( b ) } ; module$exports$Blockly$ComponentManager . ComponentManager . prototype . getComponent = function ( a ) { return this . componentData _ [ a ] && this . componentData _ [ a ] . component } ;
module$exports$Blockly$ComponentManager . ComponentManager . prototype . getComponents = function ( a , b ) { a = String ( a ) . toLowerCase ( ) ; a = this . capabilityToComponentIds _ [ a ] ; if ( ! a ) return [ ] ; var c = [ ] ; if ( b ) { var d = [ ] , e = this . componentData _ ; a . forEach ( function ( g ) { d . push ( e [ g ] ) } ) ; d . sort ( function ( g , h ) { return g . weight - h . weight } ) ; d . forEach ( function ( g ) { c . push ( g . component ) } ) } else { var f = this . componentData _ ; a . forEach ( function ( g ) { c . push ( f [ g ] . component ) } ) } return c } ;
module$exports$Blockly$ComponentManager . ComponentManager . Capability = function ( a ) { this . name _ = a } ; module$exports$Blockly$ComponentManager . ComponentManager . Capability . prototype . toString = function ( ) { return this . name _ } ; module$exports$Blockly$ComponentManager . ComponentManager . Capability . POSITIONABLE = new module$exports$Blockly$ComponentManager . ComponentManager . Capability ( "positionable" ) ; module$exports$Blockly$ComponentManager . ComponentManager . Capability . DRAG _TARGET = new module$exports$Blockly$ComponentManager . ComponentManager . Capability ( "drag_target" ) ;
module$exports$Blockly$ComponentManager . ComponentManager . Capability . DELETE _AREA = new module$exports$Blockly$ComponentManager . ComponentManager . Capability ( "delete_area" ) ; module$exports$Blockly$ComponentManager . ComponentManager . Capability . AUTOHIDEABLE = new module$exports$Blockly$ComponentManager . ComponentManager . Capability ( "autohideable" ) ; var module$exports$Blockly$IContextMenu = { IContextMenu : function ( ) { } } ; var module$exports$Blockly$IDeletable = { IDeletable : function ( ) { } } ; var module$exports$Blockly$IDraggable = { IDraggable : function ( ) { } } ; var module$exports$Blockly$IBubble = { IBubble : function ( ) { } } ; var module$exports$Blockly$dialog = { } , module$contents$Blockly$dialog _alertImplementation = function ( a , b ) { window . alert ( a ) ; b && b ( ) } , module$contents$Blockly$dialog _confirmImplementation = function ( a , b ) { b ( window . confirm ( a ) ) } , module$contents$Blockly$dialog _promptImplementation = function ( a , b , c ) { c ( window . prompt ( a , b ) ) } ; module$exports$Blockly$dialog . alert = function ( a , b ) { module$contents$Blockly$dialog _alertImplementation ( a , b ) } ;
module$exports$Blockly$dialog . setAlert = function ( a ) { module$contents$Blockly$dialog _alertImplementation = a } ; module$exports$Blockly$dialog . confirm = function ( a , b ) { module$contents$Blockly$dialog _confirmImplementation ( a , b ) } ; module$exports$Blockly$dialog . setConfirm = function ( a ) { module$contents$Blockly$dialog _confirmImplementation = a } ; module$exports$Blockly$dialog . prompt = function ( a , b , c ) { module$contents$Blockly$dialog _promptImplementation ( a , b , c ) } ;
module$exports$Blockly$dialog . setPrompt = function ( a ) { module$contents$Blockly$dialog _promptImplementation = a } ; var module$exports$Blockly$Events$VarBase = { VarBase : function ( a ) { module$exports$Blockly$Events$VarBase . VarBase . superClass _ . constructor . call ( this ) ; this . varId = ( this . isBlank = "undefined" === typeof a ) ? "" : a . getId ( ) ; this . workspaceId = this . isBlank ? "" : a . workspace . id } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$VarBase . VarBase , module$exports$Blockly$Events$Abstract ) ;
module$exports$Blockly$Events$VarBase . VarBase . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$VarBase . VarBase . superClass _ . toJson . call ( this ) ; a . varId = this . varId ; return a } ; module$exports$Blockly$Events$VarBase . VarBase . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$VarBase . VarBase . superClass _ . toJson . call ( this ) ; this . varId = a . varId } ; var module$exports$Blockly$Events$VarCreate = { VarCreate : function ( a ) { module$exports$Blockly$Events$VarCreate . VarCreate . superClass _ . constructor . call ( this , a ) ; a && ( this . varType = a . type , this . varName = a . name ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$VarCreate . VarCreate , module$exports$Blockly$Events$VarBase . VarBase ) ; module$exports$Blockly$Events$VarCreate . VarCreate . prototype . type = module$exports$Blockly$Events$utils . VAR _CREATE ;
module$exports$Blockly$Events$VarCreate . VarCreate . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$VarCreate . VarCreate . superClass _ . toJson . call ( this ) ; a . varType = this . varType ; a . varName = this . varName ; return a } ; module$exports$Blockly$Events$VarCreate . VarCreate . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$VarCreate . VarCreate . superClass _ . fromJson . call ( this , a ) ; this . varType = a . varType ; this . varName = a . varName } ;
module$exports$Blockly$Events$VarCreate . VarCreate . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? b . createVariable ( this . varName , this . varType , this . varId ) : b . deleteVariableById ( this . varId ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . VAR _CREATE , module$exports$Blockly$Events$VarCreate . VarCreate ) ; var module$exports$Blockly$VariableModel = { VariableModel : function ( a , b , c , d ) { this . workspace = a ; this . name = b ; this . type = c || "" ; this . id _ = d || ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VAR _CREATE ) ) ( this ) ) } } ; module$exports$Blockly$VariableModel . VariableModel . prototype . getId = function ( ) { return this . id _ } ;
module$exports$Blockly$VariableModel . VariableModel . compareByName = function ( a , b ) { return a . name . localeCompare ( b . name , void 0 , { sensitivity : "base" } ) } ; var module$contents$Blockly$Variables _ALL _DEVELOPER _VARS _WARNINGS _BY _BLOCK _TYPE ; $ . module$exports$Blockly$Variables = { CATEGORY _NAME : "VARIABLE" , allUsedVarModels : function ( a ) { var b = a . getAllBlocks ( ! 1 ) ; a = Object . create ( null ) ; for ( var c = 0 ; c < b . length ; c ++ ) { var d = b [ c ] . getVarModels ( ) ; if ( d ) for ( var e = 0 ; e < d . length ; e ++ ) { var f = d [ e ] , g = f . getId ( ) ; g && ( a [ g ] = f ) } } b = [ ] ; for ( var h in a ) b . push ( a [ h ] ) ; return b } } ; module$contents$Blockly$Variables _ALL _DEVELOPER _VARS _WARNINGS _BY _BLOCK _TYPE = { } ;
$ . module$exports$Blockly$Variables . allDeveloperVariables = function ( a ) { a = a . getAllBlocks ( ! 1 ) ; for ( var b = Object . create ( null ) , c = 0 , d ; d = a [ c ] ; c ++ ) { var e = d . getDeveloperVariables ; ! e && d . getDeveloperVars && ( e = d . getDeveloperVars , module$contents$Blockly$Variables _ALL _DEVELOPER _VARS _WARNINGS _BY _BLOCK _TYPE [ d . type ] || ( console . warn ( "Function getDeveloperVars() deprecated. Use getDeveloperVariables() (block type '" + d . type + "')" ) , module$contents$Blockly$Variables _ALL _DEVELOPER _VARS _WARNINGS _BY _BLOCK _TYPE [ d . type ] = ! 0 ) ) ; if ( e ) for ( d =
e ( ) , e = 0 ; e < d . length ; e ++ ) b [ d [ e ] ] = ! 0 } return Object . keys ( b ) } ; $ . module$exports$Blockly$Variables . flyoutCategory = function ( a ) { var b = [ ] , c = document . createElement ( "button" ) ; c . setAttribute ( "text" , "%{BKY_NEW_VARIABLE}" ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE" ) ; a . registerButtonCallback ( "CREATE_VARIABLE" , function ( d ) { ( 0 , $ . module$exports$Blockly$Variables . createVariableButtonHandler ) ( d . getTargetWorkspace ( ) ) } ) ; b . push ( c ) ; a = ( 0 , $ . module$exports$Blockly$Variables . flyoutCategoryBlocks ) ( a ) ; return b = b . concat ( a ) } ;
$ . module$exports$Blockly$Variables . flyoutCategoryBlocks = function ( a ) { a = a . getVariablesOfType ( "" ) ; var b = [ ] ; if ( 0 < a . length ) { var c = a [ a . length - 1 ] ; if ( $ . module$exports$Blockly$blocks . Blocks . variables _set ) { var d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; d . setAttribute ( "type" , "variables_set" ) ; d . setAttribute ( "gap" , $ . module$exports$Blockly$blocks . Blocks . math _change ? 8 : 24 ) ; d . appendChild ( ( 0 , $ . module$exports$Blockly$Variables . generateVariableFieldDom ) ( c ) ) ; b . push ( d ) } $ . module$exports$Blockly$blocks . Blocks . math _change &&
( d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) , d . setAttribute ( "type" , "math_change" ) , d . setAttribute ( "gap" , $ . module$exports$Blockly$blocks . Blocks . variables _get ? 20 : 8 ) , d . appendChild ( ( 0 , $ . module$exports$Blockly$Variables . generateVariableFieldDom ) ( c ) ) , c = ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( '<value name="DELTA"><shadow type="math_number"><field name="NUM">1</field></shadow></value>' ) , d . appendChild ( c ) , b . push ( d ) ) ; if ( $ . module$exports$Blockly$blocks . Blocks . variables _get ) for ( a . sort ( module$exports$Blockly$VariableModel . VariableModel . compareByName ) ,
c = 0 ; d = a [ c ] ; c ++ ) { var e = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; e . setAttribute ( "type" , "variables_get" ) ; e . setAttribute ( "gap" , 8 ) ; e . appendChild ( ( 0 , $ . module$exports$Blockly$Variables . generateVariableFieldDom ) ( d ) ) ; b . push ( e ) } } return b } ; $ . module$exports$Blockly$Variables . VAR _LETTER _OPTIONS = "ijkmnopqrstuvwxyzabcdefgh" ;
$ . module$exports$Blockly$Variables . generateUniqueName = function ( a ) { return ( 0 , $ . module$exports$Blockly$Variables . generateUniqueNameFromOptions ) ( $ . module$exports$Blockly$Variables . VAR _LETTER _OPTIONS . charAt ( 0 ) , a . getAllVariableNames ( ) ) } ;
$ . module$exports$Blockly$Variables . generateUniqueNameFromOptions = function ( a , b ) { if ( ! b . length ) return a ; for ( var c = $ . module$exports$Blockly$Variables . VAR _LETTER _OPTIONS , d = "" , e = c . indexOf ( a ) ; ; ) { for ( var f = ! 1 , g = 0 ; g < b . length ; g ++ ) if ( b [ g ] . toLowerCase ( ) === a ) { f = ! 0 ; break } if ( ! f ) return a ; e ++ ; e === c . length && ( e = 0 , d = Number ( d ) + 1 ) ; a = c . charAt ( e ) + d } } ;
$ . module$exports$Blockly$Variables . createVariableButtonHandler = function ( a , b , c ) { var d = c || "" , e = function ( f ) { ( 0 , $ . module$exports$Blockly$Variables . promptName ) ( $ . module$exports$Blockly$Msg . Msg . NEW _VARIABLE _TITLE , f , function ( g ) { if ( g ) { var h = ( 0 , $ . module$exports$Blockly$Variables . nameUsedWithAnyType ) ( g , a ) ; if ( h ) { if ( h . type === d ) var k = $ . module$exports$Blockly$Msg . Msg . VARIABLE _ALREADY _EXISTS . replace ( "%1" , h . name ) ; else k = $ . module$exports$Blockly$Msg . Msg . VARIABLE _ALREADY _EXISTS _FOR _ANOTHER _TYPE , k = k . replace ( "%1" , h . name ) . replace ( "%2" ,
h . type ) ; ( 0 , module$exports$Blockly$dialog . alert ) ( k , function ( ) { e ( g ) } ) } else a . createVariable ( g , d ) , b && b ( g ) } else b && b ( null ) } ) } ; e ( "" ) } ;
$ . module$exports$Blockly$Variables . renameVariable = function ( a , b , c ) { var d = function ( e ) { var f = $ . module$exports$Blockly$Msg . Msg . RENAME _VARIABLE _TITLE . replace ( "%1" , b . name ) ; ( 0 , $ . module$exports$Blockly$Variables . promptName ) ( f , e , function ( g ) { if ( g ) { var h = module$contents$Blockly$Variables _nameUsedWithOtherType ( g , b . type , a ) ; h ? ( h = $ . module$exports$Blockly$Msg . Msg . VARIABLE _ALREADY _EXISTS _FOR _ANOTHER _TYPE . replace ( "%1" , h . name ) . replace ( "%2" , h . type ) , ( 0 , module$exports$Blockly$dialog . alert ) ( h , function ( ) { d ( g ) } ) ) : ( a . renameVariableById ( b . getId ( ) ,
g ) , c && c ( g ) ) } else c && c ( null ) } ) } ; d ( "" ) } ; $ . module$exports$Blockly$Variables . promptName = function ( a , b , c ) { ( 0 , module$exports$Blockly$dialog . prompt ) ( a , b , function ( d ) { d && ( d = d . replace ( /[\s\xa0]+/g , " " ) . trim ( ) , d === $ . module$exports$Blockly$Msg . Msg . RENAME _VARIABLE || d === $ . module$exports$Blockly$Msg . Msg . NEW _VARIABLE ) && ( d = null ) ; c ( d ) } ) } ;
var module$contents$Blockly$Variables _nameUsedWithOtherType = function ( a , b , c ) { c = c . getVariableMap ( ) . getAllVariables ( ) ; a = a . toLowerCase ( ) ; for ( var d = 0 , e ; e = c [ d ] ; d ++ ) if ( e . name . toLowerCase ( ) === a && e . type !== b ) return e ; return null } ; $ . module$exports$Blockly$Variables . nameUsedWithAnyType = function ( a , b ) { b = b . getVariableMap ( ) . getAllVariables ( ) ; a = a . toLowerCase ( ) ; for ( var c = 0 , d ; d = b [ c ] ; c ++ ) if ( d . name . toLowerCase ( ) === a ) return d ; return null } ;
$ . module$exports$Blockly$Variables . generateVariableFieldDom = function ( a ) { var b = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "field" ) ; b . setAttribute ( "name" , "VAR" ) ; b . setAttribute ( "id" , a . getId ( ) ) ; b . setAttribute ( "variabletype" , a . type ) ; a = ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( a . name ) ; b . appendChild ( a ) ; return b } ;
$ . module$exports$Blockly$Variables . getOrCreateVariablePackage = function ( a , b , c , d ) { var e = ( 0 , $ . module$exports$Blockly$Variables . getVariable ) ( a , b , c , d ) ; e || ( e = module$contents$Blockly$Variables _createVariable ( a , b , c , d ) ) ; return e } ;
$ . module$exports$Blockly$Variables . getVariable = function ( a , b , c , d ) { var e = a . getPotentialVariableMap ( ) , f = null ; if ( b && ( f = a . getVariableById ( b ) , ! f && e && ( f = e . getVariableById ( b ) ) , f ) ) return f ; if ( c ) { if ( void 0 === d ) 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 } ;
var module$contents$Blockly$Variables _createVariable = function ( a , b , c , d ) { var e = a . getPotentialVariableMap ( ) ; c || ( c = $ . module$exports$Blockly$Variables . generateUniqueName ( a . isFlyout ? a . targetWorkspace : a ) ) ; return e ? e . createVariable ( c , d , b ) : a . createVariable ( c , d , b ) } ; $ . module$exports$Blockly$Variables . getAddedVariables = function ( a , b ) { a = a . getAllVariables ( ) ; var c = [ ] ; if ( b . length !== a . length ) for ( var d = 0 ; d < a . length ; d ++ ) { var e = a [ d ] ; - 1 === b . indexOf ( e ) && c . push ( e ) } return c } ; $ . module$exports$Blockly$Names = { Names : function ( a , b ) { this . variablePrefix _ = b || "" ; this . reservedDict _ = Object . create ( null ) ; if ( a ) for ( a = a . split ( "," ) , b = 0 ; b < a . length ; b ++ ) this . reservedDict _ [ a [ b ] ] = ! 0 ; this . reset ( ) } , NameType : { DEVELOPER _VARIABLE : "DEVELOPER_VARIABLE" , VARIABLE : "VARIABLE" , PROCEDURE : "PROCEDURE" } } ; $ . module$exports$Blockly$Names . Names . DEVELOPER _VARIABLE _TYPE = $ . module$exports$Blockly$Names . NameType . DEVELOPER _VARIABLE ;
$ . module$exports$Blockly$Names . Names . prototype . reset = function ( ) { this . db _ = Object . create ( null ) ; this . dbReverse _ = Object . create ( null ) ; this . variableMap _ = null } ; $ . module$exports$Blockly$Names . Names . prototype . setVariableMap = function ( a ) { this . variableMap _ = a } ;
$ . module$exports$Blockly$Names . Names . prototype . getNameForUserVariable _ = function ( a ) { return this . variableMap _ ? ( a = this . variableMap _ . getVariableById ( a ) ) ? a . name : null : ( console . warn ( "Deprecated call to Names.prototype.getName without defining a variable map. To fix, add the following code in your generator's init() function:\nBlockly.YourGeneratorName.nameDB_.setVariableMap(workspace.getVariableMap());" ) , null ) } ;
$ . module$exports$Blockly$Names . Names . prototype . populateVariables = function ( a ) { a = ( 0 , $ . module$exports$Blockly$Variables . allUsedVarModels ) ( a ) ; for ( var b = 0 ; b < a . length ; b ++ ) this . getName ( a [ b ] . getId ( ) , $ . module$exports$Blockly$Names . NameType . VARIABLE ) } ; $ . module$exports$Blockly$Names . Names . prototype . populateProcedures = function ( a ) { a = $ . module$exports$Blockly$Procedures . allProcedures ( a ) ; a = a [ 0 ] . concat ( a [ 1 ] ) ; for ( var b = 0 ; b < a . length ; b ++ ) this . getName ( a [ b ] [ 0 ] , $ . module$exports$Blockly$Names . NameType . PROCEDURE ) } ;
$ . module$exports$Blockly$Names . Names . prototype . getName = function ( a , b ) { var c = a ; b === $ . module$exports$Blockly$Names . NameType . VARIABLE && ( a = this . getNameForUserVariable _ ( a ) ) && ( c = a ) ; a = c . toLowerCase ( ) ; var d = b === $ . module$exports$Blockly$Names . NameType . VARIABLE || b === $ . module$exports$Blockly$Names . NameType . DEVELOPER _VARIABLE ? this . variablePrefix _ : "" ; b in this . db _ || ( this . db _ [ b ] = Object . create ( null ) ) ; var e = this . db _ [ b ] ; if ( a in e ) return d + e [ a ] ; b = this . getDistinctName ( c , b ) ; e [ a ] = b . substr ( d . length ) ; return b } ;
$ . module$exports$Blockly$Names . Names . prototype . getUserNames = function ( a ) { return Object . keys ( this . db _ [ a ] || { } ) } ; $ . module$exports$Blockly$Names . Names . prototype . getDistinctName = function ( a , b ) { a = this . safeName _ ( a ) ; for ( var c = "" ; this . dbReverse _ [ a + c ] || a + c in this . reservedDict _ ; ) c = c ? c + 1 : 2 ; a += c ; this . dbReverse _ [ a ] = ! 0 ; return ( b === $ . module$exports$Blockly$Names . NameType . VARIABLE || b === $ . module$exports$Blockly$Names . NameType . DEVELOPER _VARIABLE ? this . variablePrefix _ : "" ) + a } ;
$ . module$exports$Blockly$Names . Names . prototype . safeName _ = function ( a ) { a ? ( a = encodeURI ( a . replace ( / /g , "_" ) ) . replace ( /[^\w]/g , "_" ) , - 1 !== "0123456789" . indexOf ( a [ 0 ] ) && ( a = "my_" + a ) ) : a = $ . module$exports$Blockly$Msg . Msg . UNNAMED _KEY || "unnamed" ; return a } ; $ . module$exports$Blockly$Names . Names . equals = function ( a , b ) { return a . toLowerCase ( ) === b . toLowerCase ( ) } ; var module$exports$Blockly$Events$VarDelete = { VarDelete : function ( a ) { module$exports$Blockly$Events$VarDelete . VarDelete . superClass _ . constructor . call ( this , a ) ; a && ( this . varType = a . type , this . varName = a . name ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$VarDelete . VarDelete , module$exports$Blockly$Events$VarBase . VarBase ) ; module$exports$Blockly$Events$VarDelete . VarDelete . prototype . type = module$exports$Blockly$Events$utils . VAR _DELETE ;
module$exports$Blockly$Events$VarDelete . VarDelete . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$VarDelete . VarDelete . superClass _ . toJson . call ( this ) ; a . varType = this . varType ; a . varName = this . varName ; return a } ; module$exports$Blockly$Events$VarDelete . VarDelete . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$VarDelete . VarDelete . superClass _ . fromJson . call ( this , a ) ; this . varType = a . varType ; this . varName = a . varName } ;
module$exports$Blockly$Events$VarDelete . VarDelete . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? b . deleteVariableById ( this . varId ) : b . createVariable ( this . varName , this . varType , this . varId ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . VAR _DELETE , module$exports$Blockly$Events$VarDelete . VarDelete ) ; var module$exports$Blockly$Events$VarRename = { VarRename : function ( a , b ) { module$exports$Blockly$Events$VarRename . VarRename . superClass _ . constructor . call ( this , a ) ; a && ( this . oldName = a . name , this . newName = "undefined" === typeof b ? "" : b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$VarRename . VarRename , module$exports$Blockly$Events$VarBase . VarBase ) ; module$exports$Blockly$Events$VarRename . VarRename . prototype . type = module$exports$Blockly$Events$utils . VAR _RENAME ;
module$exports$Blockly$Events$VarRename . VarRename . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$VarRename . VarRename . superClass _ . toJson . call ( this ) ; a . oldName = this . oldName ; a . newName = this . newName ; return a } ; module$exports$Blockly$Events$VarRename . VarRename . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$VarRename . VarRename . superClass _ . fromJson . call ( this , a ) ; this . oldName = a . oldName ; this . newName = a . newName } ;
module$exports$Blockly$Events$VarRename . VarRename . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; a ? b . renameVariableById ( this . varId , this . newName ) : b . renameVariableById ( this . varId , this . oldName ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . VAR _RENAME , module$exports$Blockly$Events$VarRename . VarRename ) ; var module$exports$Blockly$VariableMap = { VariableMap : function ( a ) { this . variableMap _ = Object . create ( null ) ; this . workspace = a } } ; module$exports$Blockly$VariableMap . VariableMap . prototype . clear = function ( ) { this . variableMap _ = Object . create ( null ) } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . renameVariable = function ( a , b ) { var c = this . getVariable ( b , a . type ) , d = this . workspace . getAllBlocks ( ! 1 ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; try { c && c . getId ( ) !== a . getId ( ) ? this . renameVariableWithConflict _ ( a , b , c , d ) : this . renameVariableAndUses _ ( a , b , d ) } finally { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . renameVariableById = function ( a , b ) { var c = this . getVariableById ( a ) ; if ( ! c ) throw Error ( "Tried to rename a variable that didn't exist. ID: " + a ) ; this . renameVariable ( c , b ) } ; module$exports$Blockly$VariableMap . VariableMap . prototype . renameVariableAndUses _ = function ( a , b , c ) { ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VAR _RENAME ) ) ( a , b ) ) ; a . name = b ; for ( b = 0 ; b < c . length ; b ++ ) c [ b ] . updateVarName ( a ) } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . renameVariableWithConflict _ = function ( a , b , c , d ) { var e = a . type ; b !== c . name && this . renameVariableAndUses _ ( c , b , d ) ; for ( b = 0 ; b < d . length ; b ++ ) d [ b ] . renameVarById ( a . getId ( ) , c . getId ( ) ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VAR _DELETE ) ) ( a ) ) ; ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . variableMap _ [ e ] , a ) } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . createVariable = function ( 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 || ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; b = b || "" ; d = new module$exports$Blockly$VariableModel . VariableModel ( this . workspace ,
a , b , d ) ; a = this . variableMap _ [ b ] || [ ] ; a . push ( d ) ; delete this . variableMap _ [ b ] ; this . variableMap _ [ b ] = a ; return d } ; module$exports$Blockly$VariableMap . VariableMap . prototype . deleteVariable = function ( a ) { for ( var b = a . getId ( ) , c = this . variableMap _ [ a . type ] , d = 0 ; d < c . length ; d ++ ) if ( c [ d ] . getId ( ) === b ) { c . splice ( d , 1 ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VAR _DELETE ) ) ( a ) ) ; break } } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . deleteVariableById = function ( a ) { var b = this . getVariableById ( a ) ; if ( b ) { var c = b . name , d = this . getVariableUsesById ( a ) ; a = 0 ; for ( var e = void 0 ; e = d [ a ] ; a ++ ) if ( "procedures_defnoreturn" === e . type || "procedures_defreturn" === e . type ) { a = String ( e . getFieldValue ( "NAME" ) ) ; c = $ . module$exports$Blockly$Msg . Msg . CANNOT _DELETE _VARIABLE _PROCEDURE . replace ( "%1" , c ) . replace ( "%2" , a ) ; ( 0 , module$exports$Blockly$dialog . alert ) ( c ) ; return } var f = this ; 1 < d . length ? ( c = $ . module$exports$Blockly$Msg . Msg . DELETE _VARIABLE _CONFIRMATION . replace ( "%1" ,
String ( d . length ) ) . replace ( "%2" , c ) , ( 0 , module$exports$Blockly$dialog . confirm ) ( c , function ( g ) { g && b && f . deleteVariableInternal ( b , d ) } ) ) : f . deleteVariableInternal ( b , d ) } else console . warn ( "Can't delete non-existent variable: " + a ) } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . deleteVariableInternal = function ( a , b ) { var c = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; c || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; try { for ( var d = 0 ; d < b . length ; d ++ ) b [ d ] . dispose ( ! 0 ) ; this . deleteVariable ( a ) } finally { c || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . getVariable = function ( a , b ) { if ( b = this . variableMap _ [ b || "" ] ) for ( var c = 0 , d ; d = b [ c ] ; c ++ ) if ( $ . module$exports$Blockly$Names . Names . equals ( d . name , a ) ) return d ; return null } ; module$exports$Blockly$VariableMap . VariableMap . prototype . getVariableById = function ( a ) { for ( var b = Object . keys ( this . variableMap _ ) , c = 0 ; c < b . length ; c ++ ) for ( var d = b [ c ] , e = 0 , f ; f = this . variableMap _ [ d ] [ e ] ; e ++ ) if ( f . getId ( ) === a ) return f ; return null } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . getVariablesOfType = function ( a ) { return ( a = this . variableMap _ [ a || "" ] ) ? a . slice ( ) : [ ] } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . getVariableTypes = function ( a ) { var b = { } ; ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( b , this . variableMap _ ) ; a && a . getPotentialVariableMap ( ) && ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( b , a . getPotentialVariableMap ( ) . variableMap _ ) ; a = Object . keys ( b ) ; b = ! 1 ; for ( var c = 0 ; c < a . length ; c ++ ) "" === a [ c ] && ( b = ! 0 ) ; b || a . push ( "" ) ; return a } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . getAllVariables = function ( ) { var a = [ ] , b ; for ( b in this . variableMap _ ) a = a . concat ( this . variableMap _ [ b ] ) ; return a } ; module$exports$Blockly$VariableMap . VariableMap . prototype . getAllVariableNames = function ( ) { var a = [ ] , b ; for ( b in this . variableMap _ ) for ( var c = this . variableMap _ [ b ] , d = 0 , e ; e = c [ d ] ; d ++ ) a . push ( e . name ) ; return a } ;
module$exports$Blockly$VariableMap . VariableMap . prototype . getVariableUsesById = function ( a ) { for ( var b = [ ] , c = this . workspace . getAllBlocks ( ! 1 ) , d = 0 ; d < c . length ; d ++ ) { var e = c [ d ] . getVarModels ( ) ; if ( e ) for ( var f = 0 ; f < e . length ; f ++ ) e [ f ] . getId ( ) === a && b . push ( c [ d ] ) } return b } ; var module$exports$Blockly$Events$BlockMove = { BlockMove : function ( a ) { module$exports$Blockly$Events$BlockMove . BlockMove . superClass _ . constructor . call ( this , a ) ; a && ( a . isShadow ( ) && ( this . recordUndo = ! 1 ) , a = this . currentLocation _ ( ) , this . oldParentId = a . parentId , this . oldInputName = a . inputName , this . oldCoordinate = a . coordinate ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BlockMove . BlockMove , module$exports$Blockly$Events$BlockBase . BlockBase ) ;
module$exports$Blockly$Events$BlockMove . BlockMove . prototype . type = module$exports$Blockly$Events$utils . MOVE ;
module$exports$Blockly$Events$BlockMove . BlockMove . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BlockMove . BlockMove . superClass _ . toJson . call ( this ) ; this . newParentId && ( a . newParentId = this . newParentId ) ; this . newInputName && ( a . newInputName = this . newInputName ) ; this . newCoordinate && ( a . newCoordinate = Math . round ( this . newCoordinate . x ) + "," + Math . round ( this . newCoordinate . y ) ) ; this . recordUndo || ( a . recordUndo = this . recordUndo ) ; return a } ;
module$exports$Blockly$Events$BlockMove . BlockMove . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BlockMove . BlockMove . superClass _ . fromJson . call ( this , a ) ; this . newParentId = a . newParentId ; this . newInputName = a . newInputName ; if ( a . newCoordinate ) { var b = a . newCoordinate . split ( "," ) ; this . newCoordinate = new module$exports$Blockly$utils$Coordinate . Coordinate ( Number ( b [ 0 ] ) , Number ( b [ 1 ] ) ) } void 0 !== a . recordUndo && ( this . recordUndo = a . recordUndo ) } ;
module$exports$Blockly$Events$BlockMove . BlockMove . prototype . recordNew = function ( ) { var a = this . currentLocation _ ( ) ; this . newParentId = a . parentId ; this . newInputName = a . inputName ; this . newCoordinate = a . coordinate } ; module$exports$Blockly$Events$BlockMove . BlockMove . prototype . currentLocation _ = function ( ) { var a = this . getEventWorkspace _ ( ) . getBlockById ( this . blockId ) , b = { } , c = a . getParent ( ) ; if ( c ) { if ( b . parentId = c . id , a = c . getInputWithBlock ( a ) ) b . inputName = a . name } else b . coordinate = a . getRelativeToSurfaceXY ( ) ; return b } ;
module$exports$Blockly$Events$BlockMove . BlockMove . prototype . isNull = function ( ) { return this . oldParentId === this . newParentId && this . oldInputName === this . newInputName && module$exports$Blockly$utils$Coordinate . Coordinate . equals ( this . oldCoordinate , this . newCoordinate ) } ;
module$exports$Blockly$Events$BlockMove . BlockMove . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) , c = b . getBlockById ( this . blockId ) ; if ( c ) { var d = a ? this . newParentId : this . oldParentId , e = a ? this . newInputName : 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 ) ; else { b = c . outputConnection ; if ( ! b || c . previousConnection &&
c . previousConnection . isConnected ( ) ) b = c . previousConnection ; c = b . type ; if ( e ) { if ( c = f . getInput ( e ) ) var g = c . connection } else c === $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT && ( g = f . nextConnection ) ; g ? b . connect ( g ) : console . warn ( "Can't connect to non-existent input: " + e ) } } else console . warn ( "Can't move non-existent block: " + this . blockId ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . MOVE , module$exports$Blockly$Events$BlockMove . BlockMove ) ; var module$exports$Blockly$constants = { COLLAPSED _INPUT _NAME : "_TEMP_COLLAPSED_INPUT" , COLLAPSED _FIELD _NAME : "_TEMP_COLLAPSED_FIELD" } ; var module$exports$Blockly$Connection = { Connection : function ( a , b ) { this . sourceBlock _ = a ; this . type = b } } ; module$exports$Blockly$Connection . Connection . CAN _CONNECT = 0 ; module$exports$Blockly$Connection . Connection . REASON _SELF _CONNECTION = 1 ; module$exports$Blockly$Connection . Connection . REASON _WRONG _TYPE = 2 ; module$exports$Blockly$Connection . Connection . REASON _TARGET _NULL = 3 ; module$exports$Blockly$Connection . Connection . REASON _CHECKS _FAILED = 4 ; module$exports$Blockly$Connection . Connection . REASON _DIFFERENT _WORKSPACES = 5 ;
module$exports$Blockly$Connection . Connection . REASON _SHADOW _PARENT = 6 ; module$exports$Blockly$Connection . Connection . REASON _DRAG _CHECKS _FAILED = 7 ; module$exports$Blockly$Connection . Connection . REASON _PREVIOUS _AND _OUTPUT = 8 ; module$exports$Blockly$Connection . Connection . prototype . targetConnection = null ; module$exports$Blockly$Connection . Connection . prototype . disposed = ! 1 ; module$exports$Blockly$Connection . Connection . prototype . check _ = null ; module$exports$Blockly$Connection . Connection . prototype . shadowDom _ = null ;
module$exports$Blockly$Connection . Connection . prototype . x = 0 ; module$exports$Blockly$Connection . Connection . prototype . y = 0 ;
module$exports$Blockly$Connection . Connection . prototype . connect _ = function ( a ) { var b = $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE , c = this . getSourceBlock ( ) , d = a . getSourceBlock ( ) ; a . isConnected ( ) && a . disconnect ( ) ; if ( this . isConnected ( ) ) { var e = this . stashShadowState _ ( ) , f = this . targetBlock ( ) ; if ( f . isShadow ( ) ) f . dispose ( ! 1 ) ; else { this . disconnect ( ) ; var g = f } this . applyShadowState _ ( e ) } var h ; ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( h = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . MOVE ) ) ( d ) ) ;
module$contents$Blockly$Connection _connectReciprocally ( this , a ) ; d . setParent ( c ) ; h && ( h . recordNew ( ) , ( 0 , module$exports$Blockly$Events$utils . fire ) ( h ) ) ; if ( g ) if ( a = this . type === b ? g . outputConnection : g . previousConnection , d = module$exports$Blockly$Connection . Connection . getConnectionForOrphanedConnection ( d , a ) ) a . connect ( d ) ; else a . onFailedConnect ( this ) } ;
module$exports$Blockly$Connection . Connection . prototype . dispose = function ( ) { if ( this . isConnected ( ) ) { this . setShadowStateInternal _ ( ) ; var a = this . targetBlock ( ) ; a && a . unplug ( ) } this . disposed = ! 0 } ; module$exports$Blockly$Connection . Connection . prototype . getSourceBlock = function ( ) { return this . sourceBlock _ } ; module$exports$Blockly$Connection . Connection . prototype . isSuperior = function ( ) { return this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE || this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT } ;
module$exports$Blockly$Connection . Connection . prototype . isConnected = function ( ) { return ! ! this . targetConnection } ; module$exports$Blockly$Connection . Connection . prototype . getConnectionChecker = function ( ) { return this . sourceBlock _ . workspace . connectionChecker } ; module$exports$Blockly$Connection . Connection . prototype . onFailedConnect = function ( a ) { } ;
module$exports$Blockly$Connection . Connection . prototype . connect = function ( a ) { if ( this . targetConnection === a ) return ! 0 ; if ( this . getConnectionChecker ( ) . canConnect ( this , a , ! 1 ) ) { var b = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; b || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; this . isSuperior ( ) ? this . connect _ ( a ) : a . connect _ ( this ) ; b || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } return this . isConnected ( ) } ;
var module$contents$Blockly$Connection _connectReciprocally = function ( a , b ) { if ( ! a || ! b ) throw Error ( "Cannot connect null connections." ) ; a . targetConnection = b ; b . targetConnection = a } , module$contents$Blockly$Connection _getSingleConnection = function ( a , b ) { var c = null ; b = b . outputConnection ; for ( var d = b . getConnectionChecker ( ) , e = 0 , f ; f = a . inputList [ e ] ; e ++ ) if ( ( f = f . connection ) && d . canConnect ( b , f , ! 1 ) ) { if ( c ) return null ; c = f } return c } , module$contents$Blockly$Connection _getConnectionForOrphanedOutput = function ( a , b ) { for ( var c ; c =
module$contents$Blockly$Connection _getSingleConnection ( a , b ) ; ) if ( a = c . targetBlock ( ) , ! a || a . isShadow ( ) ) return c ; return null } ; module$exports$Blockly$Connection . Connection . getConnectionForOrphanedConnection = function ( a , b ) { if ( b . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ) return module$contents$Blockly$Connection _getConnectionForOrphanedOutput ( a , b . getSourceBlock ( ) ) ; a = a . lastConnectionInStack ( ! 0 ) ; var c = b . getConnectionChecker ( ) ; return a && c . canConnect ( b , a , ! 1 ) ? a : null } ;
module$exports$Blockly$Connection . Connection . prototype . disconnect = function ( ) { var a = this . targetConnection ; if ( ! a ) throw Error ( "Source connection not connected." ) ; if ( a . targetConnection !== this ) throw Error ( "Target connection not connected to source connection." ) ; if ( this . isSuperior ( ) ) { var b = this . sourceBlock _ ; var c = a . getSourceBlock ( ) ; a = this } else b = a . getSourceBlock ( ) , c = this . sourceBlock _ ; var d = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; d || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; this . disconnectInternal _ ( b ,
c ) ; c . isShadow ( ) || a . respawnShadow _ ( ) ; d || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } ; module$exports$Blockly$Connection . Connection . prototype . disconnectInternal _ = function ( a , b ) { var c ; ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( c = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . MOVE ) ) ( b ) ) ; this . targetConnection = this . targetConnection . targetConnection = null ; b . setParent ( null ) ; c && ( c . recordNew ( ) , ( 0 , module$exports$Blockly$Events$utils . fire ) ( c ) ) } ;
module$exports$Blockly$Connection . Connection . prototype . respawnShadow _ = function ( ) { this . createShadowBlock _ ( ! 0 ) } ; module$exports$Blockly$Connection . Connection . prototype . targetBlock = function ( ) { return this . isConnected ( ) ? this . targetConnection . getSourceBlock ( ) : null } ; module$exports$Blockly$Connection . Connection . prototype . onCheckChanged _ = function ( ) { ! this . isConnected ( ) || this . targetConnection && this . getConnectionChecker ( ) . canConnect ( this , this . targetConnection , ! 1 ) || ( this . isSuperior ( ) ? this . targetBlock ( ) : this . sourceBlock _ ) . unplug ( ) } ;
module$exports$Blockly$Connection . Connection . prototype . setCheck = function ( a ) { a ? ( Array . isArray ( a ) || ( a = [ a ] ) , this . check _ = a , this . onCheckChanged _ ( ) ) : this . check _ = null ; return this } ; module$exports$Blockly$Connection . Connection . prototype . getCheck = function ( ) { return this . check _ } ; module$exports$Blockly$Connection . Connection . prototype . setShadowDom = function ( a ) { this . setShadowStateInternal _ ( { shadowDom : a } ) } ;
module$exports$Blockly$Connection . Connection . prototype . getShadowDom = function ( a ) { return a && this . targetBlock ( ) . isShadow ( ) ? ( 0 , $ . module$exports$Blockly$Xml . blockToDom ) ( this . targetBlock ( ) ) : this . shadowDom _ } ; module$exports$Blockly$Connection . Connection . prototype . setShadowState = function ( a ) { this . setShadowStateInternal _ ( { shadowState : a } ) } ;
module$exports$Blockly$Connection . Connection . prototype . getShadowState = function ( a ) { return a && this . targetBlock ( ) && this . targetBlock ( ) . isShadow ( ) ? ( 0 , module$exports$Blockly$serialization$blocks . save ) ( this . targetBlock ( ) ) : this . shadowState _ } ; module$exports$Blockly$Connection . Connection . prototype . neighbours = function ( a ) { return [ ] } ;
module$exports$Blockly$Connection . Connection . prototype . getParentInput = function ( ) { for ( var a = null , b = this . sourceBlock _ . inputList , c = 0 ; c < b . length ; c ++ ) if ( b [ c ] . connection === this ) { a = b [ c ] ; break } return a } ;
module$exports$Blockly$Connection . Connection . prototype . toString = function ( ) { var 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 === this ) b = "Next Connection of " ; else { b = null ; for ( var 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 ( ) } ; module$exports$Blockly$Connection . Connection . prototype . stashShadowState _ = function ( ) { var a = this . getShadowDom ( ! 0 ) , b = this . getShadowState ( ! 0 ) ; this . shadowState _ = this . shadowDom _ = null ; return { shadowDom : a , shadowState : b } } ; module$exports$Blockly$Connection . Connection . prototype . applyShadowState _ = function ( a ) { var b = a . shadowState ; this . shadowDom _ = a . shadowDom ; this . shadowState _ = b } ;
module$exports$Blockly$Connection . Connection . prototype . setShadowStateInternal _ = function ( a ) { a = void 0 === a ? { } : a ; var b = void 0 === a . shadowState ? null : a . shadowState ; this . shadowDom _ = void 0 === a . shadowDom ? null : a . shadowDom ; this . shadowState _ = b ; ( 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 ( ) ) ) } ;
module$exports$Blockly$Connection . Connection . prototype . createShadowBlock _ = function ( a ) { var b = this . getSourceBlock ( ) , c = this . getShadowState ( ) , d = this . getShadowDom ( ) ; if ( ! b . workspace || ! c && ! d ) return null ; if ( c ) return b = ( 0 , module$exports$Blockly$serialization$blocks . appendInternal ) ( c , b . workspace , { parentConnection : a ? this : void 0 , isShadow : ! 0 , recordUndo : ! 1 } ) ; if ( d ) { b = ( 0 , $ . module$exports$Blockly$Xml . domToBlock ) ( d , b . workspace ) ; if ( a ) if ( this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . 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 === $ . module$exports$Blockly$ConnectionType . ConnectionType . 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 } ;
module$exports$Blockly$Connection . Connection . prototype . serializeShadow _ = function ( a ) { a && ( this . shadowDom _ = ( 0 , $ . module$exports$Blockly$Xml . blockToDom ) ( a ) , this . shadowState _ = ( 0 , module$exports$Blockly$serialization$blocks . save ) ( a ) ) } ; var module$exports$Blockly$IConnectionChecker = { IConnectionChecker : function ( ) { } } ; var module$exports$Blockly$ConnectionChecker = { ConnectionChecker : function ( ) { } } ; module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . canConnect = function ( a , b , c , d ) { return this . canConnectWithReason ( a , b , c , d ) === module$exports$Blockly$Connection . Connection . CAN _CONNECT } ;
module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . canConnectWithReason = function ( a , b , c , d ) { var e = this . doSafetyChecks ( a , b ) ; return e !== module$exports$Blockly$Connection . Connection . CAN _CONNECT ? e : this . doTypeChecks ( a , b ) ? c && ! this . doDragChecks ( a , b , d || 0 ) ? module$exports$Blockly$Connection . Connection . REASON _DRAG _CHECKS _FAILED : module$exports$Blockly$Connection . Connection . CAN _CONNECT : module$exports$Blockly$Connection . Connection . REASON _CHECKS _FAILED } ;
module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . getErrorMessage = function ( a , b , c ) { switch ( a ) { case module$exports$Blockly$Connection . Connection . REASON _SELF _CONNECTION : return "Attempted to connect a block to itself." ; case module$exports$Blockly$Connection . Connection . REASON _DIFFERENT _WORKSPACES : return "Blocks not on same workspace." ; case module$exports$Blockly$Connection . Connection . REASON _WRONG _TYPE : return "Attempt to connect incompatible types." ; case module$exports$Blockly$Connection . Connection . REASON _TARGET _NULL : return "Target connection is null." ;
case module$exports$Blockly$Connection . Connection . REASON _CHECKS _FAILED : return "Connection checks failed. " + ( b + " expected " + b . getCheck ( ) + ", found " + c . getCheck ( ) ) ; case module$exports$Blockly$Connection . Connection . REASON _SHADOW _PARENT : return "Connecting non-shadow to shadow block." ; case module$exports$Blockly$Connection . Connection . REASON _DRAG _CHECKS _FAILED : return "Drag checks failed." ; case module$exports$Blockly$Connection . Connection . REASON _PREVIOUS _AND _OUTPUT : return "Block would have an output and a previous connection." ;
default : return "Unknown connection failure: this should never happen!" } } ;
module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . doSafetyChecks = function ( a , b ) { if ( ! a || ! b ) return module$exports$Blockly$Connection . Connection . REASON _TARGET _NULL ; if ( a . isSuperior ( ) ) { var c = a . getSourceBlock ( ) ; var d = b . getSourceBlock ( ) ; var e = b } else d = a . getSourceBlock ( ) , c = b . getSourceBlock ( ) , e = a , a = b ; return c === d ? module$exports$Blockly$Connection . Connection . REASON _SELF _CONNECTION : e . type !== $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE [ a . type ] ? module$exports$Blockly$Connection . Connection . REASON _WRONG _TYPE :
c . workspace !== d . workspace ? module$exports$Blockly$Connection . Connection . REASON _DIFFERENT _WORKSPACES : c . isShadow ( ) && ! d . isShadow ( ) ? module$exports$Blockly$Connection . Connection . REASON _SHADOW _PARENT : e . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE && d . previousConnection && d . previousConnection . isConnected ( ) || e . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT && d . outputConnection && d . outputConnection . isConnected ( ) ? module$exports$Blockly$Connection . Connection . REASON _PREVIOUS _AND _OUTPUT :
module$exports$Blockly$Connection . Connection . CAN _CONNECT } ; module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . doTypeChecks = function ( a , b ) { a = a . getCheck ( ) ; b = b . getCheck ( ) ; if ( ! a || ! b ) return ! 0 ; for ( var c = 0 ; c < a . length ; c ++ ) if ( - 1 !== b . indexOf ( a [ c ] ) ) return ! 0 ; return ! 1 } ;
module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . doDragChecks = function ( a , b , c ) { if ( a . distanceFrom ( b ) > c || b . getSourceBlock ( ) . isInsertionMarker ( ) ) return ! 1 ; switch ( b . type ) { case $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT : return this . canConnectToPrevious _ ( a , b ) ; case $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE : if ( b . isConnected ( ) && ! b . targetBlock ( ) . isInsertionMarker ( ) || a . isConnected ( ) ) return ! 1 ; break ; case $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE : if ( b . isConnected ( ) &&
! b . targetBlock ( ) . isMovable ( ) && ! b . targetBlock ( ) . isShadow ( ) ) return ! 1 ; break ; case $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT : if ( b . isConnected ( ) && ! a . getSourceBlock ( ) . nextConnection && ! b . targetBlock ( ) . isShadow ( ) && b . targetBlock ( ) . nextConnection ) return ! 1 ; break ; default : return ! 1 } return - 1 !== $ . module$exports$Blockly$common . draggingConnections . indexOf ( b ) ? ! 1 : ! 0 } ;
module$exports$Blockly$ConnectionChecker . ConnectionChecker . prototype . canConnectToPrevious _ = function ( a , b ) { if ( a . targetConnection || - 1 !== $ . module$exports$Blockly$common . draggingConnections . indexOf ( b ) ) return ! 1 ; if ( ! b . targetConnection ) return ! 0 ; a = b . targetBlock ( ) ; return a . isInsertionMarker ( ) ? ! a . getPreviousBlock ( ) : ! 1 } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . CONNECTION _CHECKER , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$ConnectionChecker . ConnectionChecker ) ; var module$exports$Blockly$Workspace = { } , module$contents$Blockly$Workspace _WorkspaceDB _ = Object . create ( null ) ;
module$exports$Blockly$Workspace . Workspace = function ( a ) { this . id = ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; module$contents$Blockly$Workspace _WorkspaceDB _ [ this . id ] = this ; this . options = a || new module$exports$Blockly$Options . Options ( { } ) ; this . RTL = ! ! this . options . RTL ; this . horizontalLayout = ! ! this . options . horizontalLayout ; this . toolboxPosition = this . options . toolboxPosition ; this . connectionChecker = new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . CONNECTION _CHECKER ,
this . options , ! 0 ) ) ( this ) ; this . topBlocks _ = [ ] ; this . topComments _ = [ ] ; this . commentDB _ = Object . create ( null ) ; this . listeners _ = [ ] ; this . undoStack _ = [ ] ; this . redoStack _ = [ ] ; this . blockDB _ = Object . create ( null ) ; this . typedBlocksDB _ = Object . create ( null ) ; this . variableMap _ = new module$exports$Blockly$VariableMap . VariableMap ( this ) ; this . potentialVariableMap _ = null } ; module$exports$Blockly$Workspace . Workspace . prototype . rendered = ! 1 ; module$exports$Blockly$Workspace . Workspace . prototype . isClearing = ! 1 ;
module$exports$Blockly$Workspace . Workspace . prototype . MAX _UNDO = 1024 ; module$exports$Blockly$Workspace . Workspace . prototype . connectionDBList = null ; module$exports$Blockly$Workspace . Workspace . prototype . dispose = function ( ) { this . listeners _ . length = 0 ; this . clear ( ) ; delete module$contents$Blockly$Workspace _WorkspaceDB _ [ this . id ] } ; module$exports$Blockly$Workspace . Workspace . SCAN _ANGLE = 3 ;
module$exports$Blockly$Workspace . Workspace . prototype . sortObjects _ = function ( a , b ) { a = a . getRelativeToSurfaceXY ( ) ; b = b . getRelativeToSurfaceXY ( ) ; return a . y + module$exports$Blockly$Workspace . Workspace . prototype . sortObjects _ . offset * a . x - ( b . y + module$exports$Blockly$Workspace . Workspace . prototype . sortObjects _ . offset * b . x ) } ; module$exports$Blockly$Workspace . Workspace . prototype . addTopBlock = function ( a ) { this . topBlocks _ . push ( a ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . removeTopBlock = function ( a ) { if ( ! ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . topBlocks _ , a ) ) throw Error ( "Block not present in workspace's list of top-most blocks." ) ; } ;
module$exports$Blockly$Workspace . Workspace . prototype . getTopBlocks = function ( a ) { var b = [ ] . concat ( this . topBlocks _ ) ; a && 1 < b . length && ( this . sortObjects _ . offset = Math . sin ( ( 0 , module$exports$Blockly$utils$math . toRadians ) ( module$exports$Blockly$Workspace . Workspace . SCAN _ANGLE ) ) , this . RTL && ( this . sortObjects _ . offset *= - 1 ) , b . sort ( this . sortObjects _ ) ) ; return b } ; module$exports$Blockly$Workspace . Workspace . prototype . addTypedBlock = function ( a ) { this . typedBlocksDB _ [ a . type ] || ( this . typedBlocksDB _ [ a . type ] = [ ] ) ; this . typedBlocksDB _ [ a . type ] . push ( a ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . removeTypedBlock = function ( a ) { ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . typedBlocksDB _ [ a . type ] , a ) ; this . typedBlocksDB _ [ a . type ] . length || delete this . typedBlocksDB _ [ a . type ] } ;
module$exports$Blockly$Workspace . Workspace . prototype . getBlocksByType = function ( a , b ) { if ( ! this . typedBlocksDB _ [ a ] ) return [ ] ; a = this . typedBlocksDB _ [ a ] . slice ( 0 ) ; b && 1 < a . length && ( this . sortObjects _ . offset = Math . sin ( ( 0 , module$exports$Blockly$utils$math . toRadians ) ( module$exports$Blockly$Workspace . Workspace . SCAN _ANGLE ) ) , this . RTL && ( this . sortObjects _ . offset *= - 1 ) , a . sort ( this . sortObjects _ ) ) ; return a . filter ( function ( c ) { return ! c . isInsertionMarker ( ) } ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . addTopComment = function ( a ) { this . topComments _ . push ( a ) ; this . commentDB _ [ a . id ] && console . warn ( 'Overriding an existing comment on this workspace, with id "' + a . id + '"' ) ; this . commentDB _ [ a . id ] = a } ; module$exports$Blockly$Workspace . Workspace . prototype . removeTopComment = function ( a ) { if ( ! ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . topComments _ , a ) ) throw Error ( "Comment not present in workspace's list of top-most comments." ) ; delete this . commentDB _ [ a . id ] } ;
module$exports$Blockly$Workspace . Workspace . prototype . getTopComments = function ( a ) { var b = [ ] . concat ( this . topComments _ ) ; a && 1 < b . length && ( this . sortObjects _ . offset = Math . sin ( ( 0 , module$exports$Blockly$utils$math . toRadians ) ( module$exports$Blockly$Workspace . Workspace . SCAN _ANGLE ) ) , this . RTL && ( this . sortObjects _ . offset *= - 1 ) , b . sort ( this . sortObjects _ ) ) ; return b } ;
module$exports$Blockly$Workspace . Workspace . prototype . getAllBlocks = function ( a ) { if ( a ) { var b = this . getTopBlocks ( ! 0 ) ; a = [ ] ; for ( var c = 0 ; c < b . length ; c ++ ) a . push . apply ( a , b [ c ] . getDescendants ( ! 0 ) ) } else for ( a = this . getTopBlocks ( ! 1 ) , b = 0 ; b < a . length ; b ++ ) a . push . apply ( a , a [ b ] . getChildren ( ! 1 ) ) ; return a . filter ( function ( d ) { return ! d . isInsertionMarker ( ) } ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . clear = function ( ) { this . isClearing = ! 0 ; try { var a = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; for ( a || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; this . topBlocks _ . length ; ) this . topBlocks _ [ 0 ] . dispose ( ! 1 ) ; for ( ; this . topComments _ . length ; ) this . topComments _ [ this . topComments _ . length - 1 ] . dispose ( ) ; a || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) ; this . variableMap _ . clear ( ) ; this . potentialVariableMap _ && this . potentialVariableMap _ . clear ( ) } finally { this . isClearing =
! 1 } } ; module$exports$Blockly$Workspace . Workspace . prototype . renameVariableById = function ( a , b ) { this . variableMap _ . renameVariableById ( a , b ) } ; module$exports$Blockly$Workspace . Workspace . prototype . createVariable = function ( a , b , c ) { return this . variableMap _ . createVariable ( a , b , c ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getVariableUsesById = function ( a ) { return this . variableMap _ . getVariableUsesById ( a ) } ; module$exports$Blockly$Workspace . Workspace . prototype . deleteVariableById = function ( a ) { this . variableMap _ . deleteVariableById ( a ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . getVariable = function ( a , b ) { return this . variableMap _ . getVariable ( a , b ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getVariableById = function ( a ) { return this . variableMap _ . getVariableById ( a ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getVariablesOfType = function ( a ) { return this . variableMap _ . getVariablesOfType ( a ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getVariableTypes = function ( ) { return this . variableMap _ . getVariableTypes ( this ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . getAllVariables = function ( ) { return this . variableMap _ . getAllVariables ( ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getAllVariableNames = function ( ) { return this . variableMap _ . getAllVariableNames ( ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getWidth = function ( ) { return 0 } ; module$exports$Blockly$Workspace . Workspace . prototype . newBlock = function ( a , b ) { return new module$exports$Blockly$Block . Block ( this , a , b ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . remainingCapacity = function ( ) { return isNaN ( this . options . maxBlocks ) ? Infinity : this . options . maxBlocks - this . getAllBlocks ( ! 1 ) . length } ; module$exports$Blockly$Workspace . Workspace . prototype . remainingCapacityOfType = function ( a ) { return this . options . maxInstances ? ( void 0 !== this . options . maxInstances [ a ] ? this . options . maxInstances [ a ] : Infinity ) - this . getBlocksByType ( a , ! 1 ) . length : Infinity } ;
module$exports$Blockly$Workspace . Workspace . prototype . isCapacityAvailable = function ( a ) { if ( ! this . hasBlockLimits ( ) ) return ! 0 ; var b = 0 , c ; for ( c in a ) { if ( a [ c ] > this . remainingCapacityOfType ( c ) ) return ! 1 ; b += a [ c ] } return b > this . remainingCapacity ( ) ? ! 1 : ! 0 } ; module$exports$Blockly$Workspace . Workspace . prototype . hasBlockLimits = function ( ) { return Infinity !== this . options . maxBlocks || ! ! this . options . maxInstances } ; module$exports$Blockly$Workspace . Workspace . prototype . getUndoStack = function ( ) { return this . undoStack _ } ;
module$exports$Blockly$Workspace . Workspace . prototype . getRedoStack = function ( ) { return this . redoStack _ } ;
module$exports$Blockly$Workspace . Workspace . prototype . undo = function ( a ) { var b = a ? this . redoStack _ : this . undoStack _ , c = a ? this . undoStack _ : this . redoStack _ , d = b . pop ( ) ; if ( d ) { for ( var e = [ d ] ; b . length && d . group && d . group === b [ b . length - 1 ] . group ; ) e . push ( b . pop ( ) ) ; for ( b = 0 ; b < e . length ; b ++ ) c . push ( e [ b ] ) ; e = ( 0 , module$exports$Blockly$Events$utils . filter ) ( e , a ) ; ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( ! 1 ) ; try { for ( c = 0 ; c < e . length ; c ++ ) e [ c ] . run ( a ) } finally { ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( ! 0 ) } } } ;
module$exports$Blockly$Workspace . Workspace . prototype . clearUndo = function ( ) { this . undoStack _ . length = 0 ; this . redoStack _ . length = 0 ; ( 0 , module$exports$Blockly$Events$utils . clearPendingUndo ) ( ) } ; module$exports$Blockly$Workspace . Workspace . prototype . addChangeListener = function ( a ) { this . listeners _ . push ( a ) ; return a } ; module$exports$Blockly$Workspace . Workspace . prototype . removeChangeListener = function ( a ) { ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . listeners _ , a ) } ;
module$exports$Blockly$Workspace . Workspace . prototype . fireChangeListener = function ( a ) { if ( a . recordUndo ) for ( this . undoStack _ . push ( a ) , this . redoStack _ . length = 0 ; this . undoStack _ . length > this . MAX _UNDO && 0 <= this . MAX _UNDO ; ) this . undoStack _ . shift ( ) ; for ( var b = 0 ; b < this . listeners _ . length ; b ++ ) ( 0 , this . listeners _ [ b ] ) ( a ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getBlockById = function ( a ) { return this . blockDB _ [ a ] || null } ;
module$exports$Blockly$Workspace . Workspace . prototype . setBlockById = function ( a , b ) { this . blockDB _ [ a ] = b } ; module$exports$Blockly$Workspace . Workspace . prototype . removeBlockById = function ( a ) { delete this . blockDB _ [ a ] } ; module$exports$Blockly$Workspace . Workspace . prototype . getCommentById = function ( a ) { return this . commentDB _ [ a ] || null } ; module$exports$Blockly$Workspace . Workspace . prototype . allInputsFilled = function ( a ) { for ( var b = this . getTopBlocks ( ! 1 ) , c = 0 ; c < b . length ; c ++ ) if ( ! b [ c ] . allInputsFilled ( a ) ) return ! 1 ; return ! 0 } ;
module$exports$Blockly$Workspace . Workspace . prototype . getPotentialVariableMap = function ( ) { return this . potentialVariableMap _ } ; module$exports$Blockly$Workspace . Workspace . prototype . createPotentialVariableMap = function ( ) { this . potentialVariableMap _ = new module$exports$Blockly$VariableMap . VariableMap ( this ) } ; module$exports$Blockly$Workspace . Workspace . prototype . getVariableMap = function ( ) { return this . variableMap _ } ;
module$exports$Blockly$Workspace . Workspace . prototype . setVariableMap = function ( a ) { this . variableMap _ = a } ; module$exports$Blockly$Workspace . Workspace . getById = function ( a ) { return module$contents$Blockly$Workspace _WorkspaceDB _ [ a ] || null } ; module$exports$Blockly$Workspace . Workspace . getAll = function ( ) { var a = [ ] , b ; for ( b in module$contents$Blockly$Workspace _WorkspaceDB _ ) a . push ( module$contents$Blockly$Workspace _WorkspaceDB _ [ b ] ) ; return a } ; var module$exports$Blockly$Bubble = { Bubble : function ( a , b , c , d , e , f ) { this . workspace _ = a ; this . content _ = b ; this . shape _ = c ; this . onMouseDownResizeWrapper _ = this . onMouseDownBubbleWrapper _ = this . moveCallback _ = this . resizeCallback _ = null ; this . disposed = ! 1 ; c = module$exports$Blockly$Bubble . Bubble . ARROW _ANGLE ; this . workspace _ . RTL && ( c = - c ) ; this . arrow _radians _ = ( 0 , module$exports$Blockly$utils$math . toRadians ) ( c ) ; a . getBubbleCanvas ( ) . appendChild ( this . createDom _ ( b , ! ( ! e || ! f ) ) ) ; this . setAnchorLocation ( d ) ; e && f || ( a = this . content _ . getBBox ( ) ,
e = a . width + 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH , f = a . height + 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH ) ; this . setBubbleSize ( e , f ) ; this . positionBubble _ ( ) ; this . renderArrow _ ( ) ; this . rendered _ = ! 0 } } ; module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH = 6 ; module$exports$Blockly$Bubble . Bubble . ARROW _THICKNESS = 5 ; module$exports$Blockly$Bubble . Bubble . ARROW _ANGLE = 20 ; module$exports$Blockly$Bubble . Bubble . ARROW _BEND = 4 ; module$exports$Blockly$Bubble . Bubble . ANCHOR _RADIUS = 8 ;
module$exports$Blockly$Bubble . Bubble . onMouseUpWrapper _ = null ; module$exports$Blockly$Bubble . Bubble . onMouseMoveWrapper _ = null ;
module$exports$Blockly$Bubble . Bubble . unbindDragEvents _ = function ( ) { module$exports$Blockly$Bubble . Bubble . onMouseUpWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( module$exports$Blockly$Bubble . Bubble . onMouseUpWrapper _ ) , module$exports$Blockly$Bubble . Bubble . onMouseUpWrapper _ = null ) ; module$exports$Blockly$Bubble . Bubble . onMouseMoveWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( module$exports$Blockly$Bubble . Bubble . onMouseMoveWrapper _ ) , module$exports$Blockly$Bubble . Bubble . onMouseMoveWrapper _ =
null ) } ; module$exports$Blockly$Bubble . Bubble . bubbleMouseUp _ = function ( a ) { ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ; module$exports$Blockly$Bubble . Bubble . unbindDragEvents _ ( ) } ; module$exports$Blockly$Bubble . Bubble . prototype . rendered _ = ! 1 ; module$exports$Blockly$Bubble . Bubble . prototype . anchorXY _ = null ; module$exports$Blockly$Bubble . Bubble . prototype . relativeLeft _ = 0 ; module$exports$Blockly$Bubble . Bubble . prototype . relativeTop _ = 0 ; module$exports$Blockly$Bubble . Bubble . prototype . width _ = 0 ;
module$exports$Blockly$Bubble . Bubble . prototype . height _ = 0 ; module$exports$Blockly$Bubble . Bubble . prototype . autoLayout _ = ! 0 ;
module$exports$Blockly$Bubble . Bubble . prototype . createDom _ = function ( a , b ) { this . bubbleGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { } , null ) ; var c = { filter : "url(#" + this . workspace _ . getRenderer ( ) . getConstants ( ) . embossFilterId + ")" } ; module$exports$Blockly$utils$userAgent . JAVA _FX && ( c = { } ) ; c = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , c , this . bubbleGroup _ ) ; this . bubbleArrow _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH ,
{ } , c ) ; this . bubbleBack _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyDraggable" , x : 0 , y : 0 , rx : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH , ry : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH } , c ) ; b ? ( this . resizeGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : this . workspace _ . RTL ? "blocklyResizeSW" : "blocklyResizeSE" } , this . bubbleGroup _ ) , b = 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH ,
( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . POLYGON , { points : "0,x x,x x,0" . replace ( /x/g , b . toString ( ) ) } , this . resizeGroup _ ) , ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { "class" : "blocklyResizeLine" , x1 : b / 3 , y1 : b - 1 , x2 : b - 1 , y2 : b / 3 } , this . resizeGroup _ ) , ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { "class" : "blocklyResizeLine" , x1 : 2 * b / 3 , y1 : b - 1 , x2 : b - 1 , y2 : 2 * b / 3 } , this . resizeGroup _ ) ) :
this . resizeGroup _ = null ; this . workspace _ . options . readOnly || ( this . onMouseDownBubbleWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . bubbleBack _ , "mousedown" , this , this . bubbleMouseDown _ ) , this . resizeGroup _ && ( this . onMouseDownResizeWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . resizeGroup _ , "mousedown" , this , this . resizeMouseDown _ ) ) ) ; this . bubbleGroup _ . appendChild ( a ) ; return this . bubbleGroup _ } ; module$exports$Blockly$Bubble . Bubble . prototype . getSvgRoot = function ( ) { return this . bubbleGroup _ } ;
module$exports$Blockly$Bubble . Bubble . prototype . setSvgId = function ( a ) { this . bubbleGroup _ . dataset && ( this . bubbleGroup _ . dataset . blockId = a ) } ; module$exports$Blockly$Bubble . Bubble . prototype . bubbleMouseDown _ = function ( a ) { var b = this . workspace _ . getGesture ( a ) ; b && b . handleBubbleStart ( a , this ) } ; module$exports$Blockly$Bubble . Bubble . prototype . showContextMenu = function ( a ) { } ; module$exports$Blockly$Bubble . Bubble . prototype . isDeletable = function ( ) { return ! 1 } ; module$exports$Blockly$Bubble . Bubble . prototype . setDeleteStyle = function ( a ) { } ;
module$exports$Blockly$Bubble . Bubble . prototype . resizeMouseDown _ = function ( a ) { this . promote ( ) ; module$exports$Blockly$Bubble . Bubble . unbindDragEvents _ ( ) ; ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) || ( this . workspace _ . startDrag ( a , new module$exports$Blockly$utils$Coordinate . Coordinate ( this . workspace _ . RTL ? - this . width _ : this . width _ , this . height _ ) ) , module$exports$Blockly$Bubble . Bubble . onMouseUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mouseup" , this , module$exports$Blockly$Bubble . Bubble . bubbleMouseUp _ ) ,
module$exports$Blockly$Bubble . Bubble . onMouseMoveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mousemove" , this , this . resizeMouseMove _ ) , this . workspace _ . hideChaff ( ) ) ; a . stopPropagation ( ) } ; module$exports$Blockly$Bubble . Bubble . prototype . resizeMouseMove _ = function ( a ) { this . autoLayout _ = ! 1 ; a = this . workspace _ . moveDrag ( a ) ; this . setBubbleSize ( this . workspace _ . RTL ? - a . x : a . x , a . y ) ; this . workspace _ . RTL && this . positionBubble _ ( ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . registerResizeEvent = function ( a ) { this . resizeCallback _ = a } ; module$exports$Blockly$Bubble . Bubble . prototype . registerMoveEvent = function ( a ) { this . moveCallback _ = a } ; module$exports$Blockly$Bubble . Bubble . prototype . promote = function ( ) { var a = this . bubbleGroup _ . parentNode ; return a . lastChild !== this . bubbleGroup _ ? ( a . appendChild ( this . bubbleGroup _ ) , ! 0 ) : ! 1 } ; module$exports$Blockly$Bubble . Bubble . prototype . setAnchorLocation = function ( a ) { this . anchorXY _ = a ; this . rendered _ && this . positionBubble _ ( ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . layoutBubble _ = function ( ) { var a = this . workspace _ . getMetricsManager ( ) . getViewMetrics ( ! 0 ) , b = this . getOptimalRelativeLeft _ ( a ) , c = this . getOptimalRelativeTop _ ( a ) , d = this . shape _ . getBBox ( ) , e = { x : b , y : - this . height _ - this . workspace _ . getRenderer ( ) . getConstants ( ) . MIN _BLOCK _HEIGHT } , f = { x : - this . width _ - 30 , y : c } ; c = { x : d . width , y : c } ; var g = { x : b , y : d . height } ; b = d . width < d . height ? c : g ; d = d . width < d . height ? g : c ; c = this . getOverlap _ ( e , a ) ; g = this . getOverlap _ ( f , a ) ; var h = this . getOverlap _ ( b , a ) ; a =
this . getOverlap _ ( d , a ) ; a = Math . max ( c , g , h , a ) ; c === a ? ( this . relativeLeft _ = e . x , this . relativeTop _ = e . y ) : g === a ? ( this . relativeLeft _ = f . x , this . relativeTop _ = f . y ) : h === a ? ( this . relativeLeft _ = b . x , this . relativeTop _ = b . y ) : ( this . relativeLeft _ = d . x , this . relativeTop _ = d . y ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . getOverlap _ = function ( a , b ) { var c = this . workspace _ . RTL ? this . anchorXY _ . x - a . x - this . width _ : a . x + this . anchorXY _ . x ; a = a . y + this . anchorXY _ . y ; return Math . max ( 0 , Math . min ( 1 , ( Math . min ( c + this . width _ , b . left + b . width ) - Math . max ( c , b . left ) ) * ( Math . min ( a + this . height _ , b . top + b . height ) - Math . max ( a , b . top ) ) / ( this . width _ * this . height _ ) ) ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . getOptimalRelativeLeft _ = function ( a ) { var b = - this . width _ / 4 ; if ( this . width _ > a . width ) return b ; if ( this . workspace _ . RTL ) { var c = this . anchorXY _ . x - b , d = a . left + a . width ; a = a . left + module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness / this . workspace _ . scale ; c - this . width _ < a ? b = - ( a - this . anchorXY _ . x + this . width _ ) : c > d && ( b = - ( d - this . anchorXY _ . x ) ) } else { c = b + this . anchorXY _ . x ; d = c + this . width _ ; var e = a . left ; a = a . left + a . width - module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness /
this . workspace _ . scale ; c < e ? b = e - this . anchorXY _ . x : d > a && ( b = a - this . anchorXY _ . x - this . width _ ) } return b } ; module$exports$Blockly$Bubble . Bubble . prototype . getOptimalRelativeTop _ = function ( a ) { var b = - this . height _ / 4 ; if ( this . height _ > a . height ) return b ; var c = this . anchorXY _ . y + b , d = c + this . height _ , e = a . top ; a = a . top + a . height - module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness / this . workspace _ . scale ; var f = this . anchorXY _ . y ; c < e ? b = e - f : d > a && ( b = a - f - this . height _ ) ; return b } ;
module$exports$Blockly$Bubble . Bubble . prototype . positionBubble _ = function ( ) { var a = this . anchorXY _ . x ; a = this . workspace _ . RTL ? a - ( this . relativeLeft _ + this . width _ ) : a + this . relativeLeft _ ; this . moveTo ( a , this . relativeTop _ + this . anchorXY _ . y ) } ; module$exports$Blockly$Bubble . Bubble . prototype . moveTo = function ( a , b ) { this . bubbleGroup _ . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } ; module$exports$Blockly$Bubble . Bubble . prototype . setDragging = function ( a ) { ! a && this . moveCallback _ && this . moveCallback _ ( ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . getBubbleSize = function ( ) { return new module$exports$Blockly$utils$Size . Size ( this . width _ , this . height _ ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . setBubbleSize = function ( a , b ) { var c = 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH ; a = Math . max ( a , c + 45 ) ; b = Math . max ( b , c + 20 ) ; this . width _ = a ; this . height _ = b ; this . bubbleBack _ . setAttribute ( "width" , a ) ; this . bubbleBack _ . setAttribute ( "height" , b ) ; this . resizeGroup _ && ( this . workspace _ . RTL ? this . resizeGroup _ . setAttribute ( "transform" , "translate(" + 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH + "," + ( b - c ) + ") scale(-1 1)" ) : this . resizeGroup _ . setAttribute ( "transform" ,
"translate(" + ( a - c ) + "," + ( b - c ) + ")" ) ) ; this . autoLayout _ && this . layoutBubble _ ( ) ; this . positionBubble _ ( ) ; this . renderArrow _ ( ) ; this . resizeCallback _ && this . resizeCallback _ ( ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . renderArrow _ = function ( ) { var a = [ ] , b = this . width _ / 2 , c = this . height _ / 2 , d = - this . relativeLeft _ , e = - this . relativeTop _ ; if ( b === d && c === e ) a . push ( "M " + b + "," + c ) ; else { e -= c ; d -= b ; this . workspace _ . RTL && ( d *= - 1 ) ; var f = Math . sqrt ( e * e + d * d ) , g = Math . acos ( d / f ) ; 0 > e && ( g = 2 * Math . PI - g ) ; var h = g + Math . PI / 2 ; h > 2 * Math . PI && ( h -= 2 * Math . PI ) ; var k = Math . sin ( h ) , l = Math . cos ( h ) , m = this . getBubbleSize ( ) ; h = ( m . width + m . height ) / module$exports$Blockly$Bubble . Bubble . ARROW _THICKNESS ; h = Math . min ( h , m . width , m . height ) /
4 ; m = 1 - module$exports$Blockly$Bubble . Bubble . ANCHOR _RADIUS / f ; d = b + m * d ; e = c + m * e ; m = b + h * l ; var n = c + h * k ; b -= h * l ; c -= h * k ; k = g + this . arrow _radians _ ; k > 2 * Math . PI && ( k -= 2 * Math . PI ) ; g = Math . sin ( k ) * f / module$exports$Blockly$Bubble . Bubble . ARROW _BEND ; f = Math . cos ( k ) * f / module$exports$Blockly$Bubble . Bubble . ARROW _BEND ; a . push ( "M" + m + "," + n ) ; a . push ( "C" + ( m + f ) + "," + ( n + g ) + " " + d + "," + e + " " + d + "," + e ) ; a . push ( "C" + d + "," + e + " " + ( b + f ) + "," + ( c + g ) + " " + b + "," + c ) } a . push ( "z" ) ; this . bubbleArrow _ . setAttribute ( "d" , a . join ( " " ) ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . setColour = function ( a ) { this . bubbleBack _ . setAttribute ( "fill" , a ) ; this . bubbleArrow _ . setAttribute ( "fill" , a ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . dispose = function ( ) { this . onMouseDownBubbleWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseDownBubbleWrapper _ ) ; this . onMouseDownResizeWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseDownResizeWrapper _ ) ; module$exports$Blockly$Bubble . Bubble . unbindDragEvents _ ( ) ; ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . bubbleGroup _ ) ; this . disposed = ! 0 } ;
module$exports$Blockly$Bubble . Bubble . prototype . moveDuringDrag = function ( a , b ) { a ? a . translateSurface ( b . x , b . y ) : this . moveTo ( b . x , b . y ) ; this . relativeLeft _ = this . workspace _ . RTL ? this . anchorXY _ . x - b . x - this . width _ : b . x - this . anchorXY _ . x ; this . relativeTop _ = b . y - this . anchorXY _ . y ; this . renderArrow _ ( ) } ;
module$exports$Blockly$Bubble . Bubble . prototype . getRelativeToSurfaceXY = function ( ) { return new module$exports$Blockly$utils$Coordinate . Coordinate ( this . workspace _ . RTL ? - this . relativeLeft _ + this . anchorXY _ . x - this . width _ : this . anchorXY _ . x + this . relativeLeft _ , this . anchorXY _ . y + this . relativeTop _ ) } ; module$exports$Blockly$Bubble . Bubble . prototype . setAutoLayout = function ( a ) { this . autoLayout _ = a } ;
module$exports$Blockly$Bubble . Bubble . textToDom = function ( a ) { var b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TEXT , { "class" : "blocklyText blocklyBubbleText blocklyNoPointerEvents" , y : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH } , null ) ; a = a . split ( "\n" ) ; for ( var c = 0 ; c < a . length ; c ++ ) { var d = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TSPAN , { dy : "1em" , x : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH } , b ) , e = document . createTextNode ( a [ c ] ) ;
d . appendChild ( e ) } return b } ; module$exports$Blockly$Bubble . Bubble . createNonEditableBubble = function ( a , b , c ) { c = new module$exports$Blockly$Bubble . Bubble ( b . workspace , a , b . pathObject . svgPath , c , null , null ) ; c . setSvgId ( b . id ) ; if ( b . RTL ) { b = a . getBBox ( ) . width ; for ( var d = 0 , e ; e = a . childNodes [ d ] ; d ++ ) e . setAttribute ( "text-anchor" , "end" ) , e . setAttribute ( "x" , b + module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH ) } return c } ; var module$exports$Blockly$Events$CommentBase = { CommentBase : function ( a ) { this . commentId = ( this . isBlank = "undefined" === typeof a ) ? "" : a . id ; this . workspaceId = this . isBlank ? "" : a . workspace . id ; this . group = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; this . recordUndo = ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$CommentBase . CommentBase , module$exports$Blockly$Events$Abstract ) ;
module$exports$Blockly$Events$CommentBase . CommentBase . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$CommentBase . CommentBase . superClass _ . toJson . call ( this ) ; this . commentId && ( a . commentId = this . commentId ) ; return a } ; module$exports$Blockly$Events$CommentBase . CommentBase . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$CommentBase . CommentBase . superClass _ . fromJson . call ( this , a ) ; this . commentId = a . commentId } ;
module$exports$Blockly$Events$CommentBase . CommentBase . CommentCreateDeleteHelper = function ( a , b ) { var c = a . getEventWorkspace _ ( ) ; b ? ( b = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "xml" ) , b . appendChild ( a . xml ) , ( 0 , $ . module$exports$Blockly$Xml . domToWorkspace ) ( b , c ) ) : ( c = c . getCommentById ( a . commentId ) ) ? c . dispose ( ) : console . warn ( "Can't uncreate non-existent comment: " + a . commentId ) } ; var module$exports$Blockly$Events$CommentMove = { CommentMove : function ( a ) { module$exports$Blockly$Events$CommentMove . CommentMove . superClass _ . constructor . call ( this , a ) ; a && ( this . comment _ = a , this . oldCoordinate _ = a . getXY ( ) , this . newCoordinate _ = null ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$CommentMove . CommentMove , module$exports$Blockly$Events$CommentBase . CommentBase ) ;
module$exports$Blockly$Events$CommentMove . CommentMove . prototype . recordNew = function ( ) { if ( ! this . comment _ ) throw Error ( "Tried to record the new position of a comment on the same event twice." ) ; this . newCoordinate _ = this . comment _ . getXY ( ) ; this . comment _ = null } ; module$exports$Blockly$Events$CommentMove . CommentMove . prototype . type = module$exports$Blockly$Events$utils . COMMENT _MOVE ; module$exports$Blockly$Events$CommentMove . CommentMove . prototype . setOldCoordinate = function ( a ) { this . oldCoordinate _ = a } ;
module$exports$Blockly$Events$CommentMove . CommentMove . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$CommentMove . CommentMove . superClass _ . toJson . call ( this ) ; this . oldCoordinate _ && ( a . oldCoordinate = Math . round ( this . oldCoordinate _ . x ) + "," + Math . round ( this . oldCoordinate _ . y ) ) ; this . newCoordinate _ && ( a . newCoordinate = Math . round ( this . newCoordinate _ . x ) + "," + Math . round ( this . newCoordinate _ . y ) ) ; return a } ;
module$exports$Blockly$Events$CommentMove . CommentMove . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$CommentMove . CommentMove . superClass _ . fromJson . call ( this , a ) ; if ( a . oldCoordinate ) { var b = a . oldCoordinate . split ( "," ) ; this . oldCoordinate _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( Number ( b [ 0 ] ) , Number ( b [ 1 ] ) ) } a . newCoordinate && ( a = a . newCoordinate . split ( "," ) , this . newCoordinate _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( Number ( a [ 0 ] ) , Number ( a [ 1 ] ) ) ) } ;
module$exports$Blockly$Events$CommentMove . CommentMove . prototype . isNull = function ( ) { return module$exports$Blockly$utils$Coordinate . Coordinate . equals ( this . oldCoordinate _ , this . newCoordinate _ ) } ; module$exports$Blockly$Events$CommentMove . CommentMove . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) . getCommentById ( this . commentId ) ; if ( b ) { a = a ? this . newCoordinate _ : this . oldCoordinate _ ; var c = b . getXY ( ) ; b . moveBy ( a . x - c . x , a . y - c . y ) } else console . warn ( "Can't move non-existent comment: " + this . commentId ) } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . COMMENT _MOVE , module$exports$Blockly$Events$CommentMove . CommentMove ) ; var module$exports$Blockly$BubbleDragger = { BubbleDragger : function ( a , b ) { this . draggingBubble _ = a ; this . workspace _ = b ; this . dragTarget _ = null ; this . wouldDeleteBubble _ = ! 1 ; this . startXY _ = this . draggingBubble _ . getRelativeToSurfaceXY ( ) ; this . dragSurface _ = ( 0 , module$exports$Blockly$utils$svgMath . is3dSupported ) ( ) && b . getBlockDragSurface ( ) ? b . getBlockDragSurface ( ) : null } } ; module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . dispose = function ( ) { this . dragSurface _ = this . workspace _ = this . draggingBubble _ = null } ;
module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . startBubbleDrag = function ( ) { ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; this . workspace _ . setResizesEnabled ( ! 1 ) ; this . draggingBubble _ . setAutoLayout ( ! 1 ) ; this . dragSurface _ && this . moveToDragSurface _ ( ) ; this . draggingBubble _ . setDragging && this . draggingBubble _ . setDragging ( ! 0 ) } ;
module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . dragBubble = function ( a , b ) { b = this . pixelsToWorkspaceUnits _ ( b ) ; b = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . startXY _ , b ) ; this . draggingBubble _ . moveDuringDrag ( this . dragSurface _ , b ) ; b = this . dragTarget _ ; this . dragTarget _ = this . workspace _ . getDragTarget ( a ) ; a = this . wouldDeleteBubble _ ; this . wouldDeleteBubble _ = this . shouldDelete _ ( this . dragTarget _ ) ; a !== this . wouldDeleteBubble _ && this . updateCursorDuringBubbleDrag _ ( ) ; this . dragTarget _ !== b && ( b && b . onDragExit ( this . draggingBubble _ ) ,
this . dragTarget _ && this . dragTarget _ . onDragEnter ( this . draggingBubble _ ) ) ; this . dragTarget _ && this . dragTarget _ . onDragOver ( this . draggingBubble _ ) } ; module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . shouldDelete _ = function ( a ) { return a && this . workspace _ . getComponentManager ( ) . hasCapability ( a . id , module$exports$Blockly$ComponentManager . ComponentManager . Capability . DELETE _AREA ) ? a . wouldDelete ( this . draggingBubble _ , ! 1 ) : ! 1 } ;
module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . updateCursorDuringBubbleDrag _ = function ( ) { this . draggingBubble _ . setDeleteStyle ( this . wouldDeleteBubble _ ) } ;
module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . endBubbleDrag = function ( a , b ) { this . dragBubble ( a , b ) ; this . dragTarget _ && this . dragTarget _ . shouldPreventMove ( this . draggingBubble _ ) ? a = this . startXY _ : ( a = this . pixelsToWorkspaceUnits _ ( b ) , a = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . startXY _ , a ) ) ; this . draggingBubble _ . moveTo ( a . x , a . y ) ; if ( this . dragTarget _ ) this . dragTarget _ . onDrop ( this . draggingBubble _ ) ; this . wouldDeleteBubble _ ? ( this . fireMoveEvent _ ( ) , this . draggingBubble _ . dispose ( ! 1 , ! 0 ) ) : ( this . dragSurface _ &&
this . dragSurface _ . clearAndHide ( this . workspace _ . getBubbleCanvas ( ) ) , this . draggingBubble _ . setDragging && this . draggingBubble _ . setDragging ( ! 1 ) , this . fireMoveEvent _ ( ) ) ; this . workspace _ . setResizesEnabled ( ! 0 ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } ;
module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . fireMoveEvent _ = function ( ) { if ( this . draggingBubble _ . isComment ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _MOVE ) ) ( this . draggingBubble _ ) ; a . setOldCoordinate ( this . startXY _ ) ; a . recordNew ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } } ;
module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . pixelsToWorkspaceUnits _ = function ( a ) { a = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . x / this . workspace _ . scale , a . y / this . workspace _ . scale ) ; this . workspace _ . isMutator && a . scale ( 1 / this . workspace _ . options . parentWorkspace . scale ) ; return a } ; module$exports$Blockly$BubbleDragger . BubbleDragger . prototype . moveToDragSurface _ = function ( ) { this . draggingBubble _ . moveTo ( 0 , 0 ) ; this . dragSurface _ . translateSurface ( this . startXY _ . x , this . startXY _ . y ) ; this . dragSurface _ . setBlocksAndShow ( this . draggingBubble _ . getSvgRoot ( ) ) } ; var module$exports$Blockly$WorkspaceDragger = { WorkspaceDragger : function ( a ) { this . workspace _ = a ; this . horizontalScrollEnabled _ = this . workspace _ . isMovableHorizontally ( ) ; this . verticalScrollEnabled _ = this . workspace _ . isMovableVertically ( ) ; this . startScrollXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . scrollX , a . scrollY ) } } ; module$exports$Blockly$WorkspaceDragger . WorkspaceDragger . prototype . dispose = function ( ) { this . workspace _ = null } ;
module$exports$Blockly$WorkspaceDragger . WorkspaceDragger . prototype . startDrag = function ( ) { ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) && ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . unselect ( ) ; this . workspace _ . setupDragSurface ( ) } ; module$exports$Blockly$WorkspaceDragger . WorkspaceDragger . prototype . endDrag = function ( a ) { this . drag ( a ) ; this . workspace _ . resetDragSurface ( ) } ;
module$exports$Blockly$WorkspaceDragger . WorkspaceDragger . prototype . drag = function ( a ) { a = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . startScrollXY _ , a ) ; if ( this . horizontalScrollEnabled _ && 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." ) ; } ; var module$exports$Blockly$IBlockDragger = { IBlockDragger : function ( ) { } } ; var module$exports$Blockly$InsertionMarkerManager = { InsertionMarkerManager : function ( a ) { ( 0 , $ . module$exports$Blockly$common . setSelected ) ( a ) ; this . topBlock _ = a ; this . workspace _ = a . workspace ; this . lastMarker _ = this . lastOnStack _ = null ; this . firstMarker _ = this . createMarkerBlock _ ( this . topBlock _ ) ; this . localConnection _ = this . closestConnection _ = null ; this . wouldDeleteBlock _ = ! 1 ; this . fadedBlock _ = this . highlightedBlock _ = this . markerConnection _ = null ; this . availableConnections _ = this . initAvailableConnections _ ( ) } } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE = { INSERTION _MARKER : 0 , INPUT _OUTLINE : 1 , REPLACEMENT _FADE : 2 } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . DUPLICATE _BLOCK _ERROR = "The insertion marker manager tried to create a marker but the result is missing %1. If you are using a mutator, make sure your domToMutation method is properly defined." ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . dispose = function ( ) { this . availableConnections _ . length = 0 ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { this . firstMarker _ && this . firstMarker _ . dispose ( ) , this . lastMarker _ && this . lastMarker _ . dispose ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . updateAvailableConnections = function ( ) { this . availableConnections _ = this . initAvailableConnections _ ( ) } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . wouldDeleteBlock = function ( ) { return this . wouldDeleteBlock _ } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . wouldConnectBlock = function ( ) { return ! ! this . closestConnection _ } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . applyConnections = function ( ) { if ( this . closestConnection _ && ( ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) , this . hidePreview _ ( ) , ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) , this . localConnection _ . connect ( this . closestConnection _ ) , this . topBlock _ . rendered ) ) { var a = this . localConnection _ . isSuperior ( ) ? this . closestConnection _ : this . localConnection _ ; ( 0 , module$exports$Blockly$blockAnimations . connectionUiEffect ) ( a . getSourceBlock ( ) ) ;
this . topBlock _ . getRootBlock ( ) . bringToFront ( ) } } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . update = function ( a , b ) { var c = this . getCandidate _ ( a ) ; if ( ( this . wouldDeleteBlock _ = this . shouldDelete _ ( c , b ) ) || this . shouldUpdatePreviews _ ( c , a ) ) ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) , this . maybeHidePreview _ ( c ) , this . maybeShowPreview _ ( c ) , ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . createMarkerBlock _ = function ( a ) { var b = a . type ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { var c = this . workspace _ . newBlock ( b ) ; c . setInsertionMarker ( ! 0 ) ; if ( a . saveExtraState ) { var d = a . saveExtraState ( ) ; d && c . loadExtraState ( d ) } else if ( a . mutationToDom ) { var e = a . mutationToDom ( ) ; e && c . domToMutation ( e ) } for ( b = 0 ; b < a . inputList . length ; b ++ ) { var f = a . inputList [ b ] ; if ( f . name !== module$exports$Blockly$constants . COLLAPSED _INPUT _NAME ) { var g =
c . inputList [ b ] ; if ( ! g ) throw Error ( module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . DUPLICATE _BLOCK _ERROR . replace ( "%1" , "an input" ) ) ; for ( d = 0 ; d < f . fieldRow . length ; d ++ ) { var h = f . fieldRow [ d ] , k = g . fieldRow [ d ] ; if ( ! k ) throw Error ( module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . DUPLICATE _BLOCK _ERROR . replace ( "%1" , "a field" ) ) ; k . setValue ( h . getValue ( ) ) } } } c . setCollapsed ( a . isCollapsed ( ) ) ; c . setInputsInline ( a . getInputsInline ( ) ) ; c . initSvg ( ) ; c . getSvgRoot ( ) . setAttribute ( "visibility" ,
"hidden" ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } return c } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . initAvailableConnections _ = function ( ) { var a = this . topBlock _ . getConnections _ ( ! 1 ) , b = this . topBlock _ . lastConnectionInStack ( ! 0 ) ; if ( b && b !== this . topBlock _ . nextConnection ) { a . push ( b ) ; this . lastOnStack _ = b ; if ( this . lastMarker _ ) { ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { this . lastMarker _ . dispose ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } } this . lastMarker _ = this . createMarkerBlock _ ( b . getSourceBlock ( ) ) } return a } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . shouldUpdatePreviews _ = function ( a , b ) { var c = a . local , d = a . closest ; a = a . radius ; if ( c && d ) { if ( this . localConnection _ && this . closestConnection _ ) { if ( this . closestConnection _ === d && this . localConnection _ === c ) return ! 1 ; c = this . localConnection _ . x + b . x - this . closestConnection _ . x ; b = this . localConnection _ . y + b . y - this . closestConnection _ . y ; b = Math . sqrt ( c * c + b * b ) ; return ! ( d && a > b - $ . module$exports$Blockly$internalConstants . CURRENT _CONNECTION _PREFERENCE ) } if ( this . localConnection _ ||
this . closestConnection _ ) console . error ( "Only one of localConnection_ and closestConnection_ was set." ) ; else return ! 0 } else return ! ( ! this . localConnection _ || ! this . closestConnection _ ) ; console . error ( "Returning true from shouldUpdatePreviews, but it's not clear why." ) ; return ! 0 } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . getCandidate _ = function ( a ) { for ( var b = this . getStartRadius _ ( ) , c = null , d = null , e = 0 ; e < this . availableConnections _ . length ; e ++ ) { var f = this . availableConnections _ [ e ] , g = f . closest ( b , a ) ; g . connection && ( c = g . connection , d = f , b = g . radius ) } return { closest : c , local : d , radius : b } } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . getStartRadius _ = function ( ) { return $ . module$exports$Blockly$internalConstants . SNAP _RADIUS } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . shouldDelete _ = function ( a , b ) { return b && this . workspace _ . getComponentManager ( ) . hasCapability ( b . id , module$exports$Blockly$ComponentManager . ComponentManager . Capability . DELETE _AREA ) ? b . wouldDelete ( this . topBlock _ , a && ! ! a . closest ) : ! 1 } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . maybeShowPreview _ = function ( a ) { if ( ! this . wouldDeleteBlock _ ) { var b = a . closest ; a = a . local ; b && ( b === this . closestConnection _ || b . getSourceBlock ( ) . isInsertionMarker ( ) ? console . log ( "Trying to connect to an insertion marker" ) : ( this . closestConnection _ = b , this . localConnection _ = a , this . showPreview _ ( ) ) ) } } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . showPreview _ = function ( ) { var a = this . closestConnection _ , b = this . workspace _ . getRenderer ( ) ; switch ( b . getConnectionPreviewMethod ( a , this . localConnection _ , this . topBlock _ ) ) { case module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . INPUT _OUTLINE : this . showInsertionInputOutline _ ( ) ; break ; case module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . INSERTION _MARKER : this . showInsertionMarker _ ( ) ;
break ; case module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . REPLACEMENT _FADE : this . showReplacementFade _ ( ) } a && b . shouldHighlightConnection ( a ) && a . highlight ( ) } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . maybeHidePreview _ = function ( a ) { if ( a . closest ) { var b = this . closestConnection _ !== a . closest ; a = this . localConnection _ !== a . local ; this . closestConnection _ && this . localConnection _ && ( b || a || this . wouldDeleteBlock _ ) && this . hidePreview _ ( ) } else this . hidePreview _ ( ) ; this . localConnection _ = this . closestConnection _ = this . markerConnection _ = null } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . hidePreview _ = function ( ) { this . closestConnection _ && this . closestConnection _ . targetBlock ( ) && this . workspace _ . getRenderer ( ) . shouldHighlightConnection ( this . closestConnection _ ) && this . closestConnection _ . unhighlight ( ) ; this . fadedBlock _ ? this . hideReplacementFade _ ( ) : this . highlightedBlock _ ? this . hideInsertionInputOutline _ ( ) : this . markerConnection _ && this . hideInsertionMarker _ ( ) } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . showInsertionMarker _ = function ( ) { var a = this . localConnection _ , b = this . closestConnection _ , c = this . lastOnStack _ && a === this . lastOnStack _ ? this . lastMarker _ : this . firstMarker _ ; a = c . getMatchingConnection ( a . getSourceBlock ( ) , a ) ; if ( a === this . markerConnection _ ) throw Error ( "Made it to showInsertionMarker_ even though the marker isn't changing" ) ; c . render ( ) ; c . rendered = ! 0 ; c . getSvgRoot ( ) . setAttribute ( "visibility" , "visible" ) ; a && b && c . positionNearConnection ( a ,
b ) ; b && a . connect ( b ) ; this . markerConnection _ = a } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . hideInsertionMarker _ = function ( ) { if ( this . markerConnection _ ) { var a = this . markerConnection _ , b = a . getSourceBlock ( ) , c = b . nextConnection , d = b . previousConnection , e = b . outputConnection ; e = a . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE && ! ( e && e . targetConnection ) ; ! ( a !== c || d && d . targetConnection ) || e ? a . targetBlock ( ) . unplug ( ! 1 ) : a . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT && a !==
c ? ( c = a . targetConnection , c . getSourceBlock ( ) . unplug ( ! 1 ) , d = d ? d . targetConnection : null , b . unplug ( ! 0 ) , d && d . connect ( c ) ) : b . unplug ( ! 0 ) ; if ( a . targetConnection ) throw Error ( "markerConnection_ still connected at the end of disconnectInsertionMarker" ) ; this . markerConnection _ = null ; ( a = b . getSvgRoot ( ) ) && a . setAttribute ( "visibility" , "hidden" ) } else console . log ( "No insertion marker connection to disconnect" ) } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . showInsertionInputOutline _ = function ( ) { var a = this . closestConnection _ ; this . highlightedBlock _ = a . getSourceBlock ( ) ; this . highlightedBlock _ . highlightShapeForInput ( a , ! 0 ) } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . hideInsertionInputOutline _ = function ( ) { this . highlightedBlock _ . highlightShapeForInput ( this . closestConnection _ , ! 1 ) ; this . highlightedBlock _ = null } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . showReplacementFade _ = function ( ) { this . fadedBlock _ = this . closestConnection _ . targetBlock ( ) ; this . fadedBlock _ . fadeForReplacement ( ! 0 ) } ; module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . hideReplacementFade _ = function ( ) { this . fadedBlock _ . fadeForReplacement ( ! 1 ) ; this . fadedBlock _ = null } ;
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . prototype . getInsertionMarkers = function ( ) { var a = [ ] ; this . firstMarker _ && a . push ( this . firstMarker _ ) ; this . lastMarker _ && a . push ( this . lastMarker _ ) ; return a } ; var module$exports$Blockly$Events$UiBase = { UiBase : function ( a ) { module$exports$Blockly$Events$UiBase . UiBase . superClass _ . constructor . call ( this ) ; this . isBlank = "undefined" === typeof a ; this . workspaceId = a ? a : "" ; this . recordUndo = ! 1 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$UiBase . UiBase , module$exports$Blockly$Events$Abstract ) ; module$exports$Blockly$Events$UiBase . UiBase . prototype . isUiEvent = ! 0 ; var module$exports$Blockly$Events$BlockDrag = { BlockDrag : function ( a , b , c ) { module$exports$Blockly$Events$BlockDrag . BlockDrag . superClass _ . constructor . call ( this , a ? a . workspace . id : void 0 ) ; this . blockId = a ? a . id : null ; this . isStart = b ; this . blocks = c } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BlockDrag . BlockDrag , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$BlockDrag . BlockDrag . prototype . type = module$exports$Blockly$Events$utils . BLOCK _DRAG ;
module$exports$Blockly$Events$BlockDrag . BlockDrag . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BlockDrag . BlockDrag . superClass _ . toJson . call ( this ) ; a . isStart = this . isStart ; a . blockId = this . blockId ; a . blocks = this . blocks ; return a } ; module$exports$Blockly$Events$BlockDrag . BlockDrag . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BlockDrag . BlockDrag . superClass _ . fromJson . call ( this , a ) ; this . isStart = a . isStart ; this . blockId = a . blockId ; this . blocks = a . blocks } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . BLOCK _DRAG , module$exports$Blockly$Events$BlockDrag . BlockDrag ) ; var module$exports$Blockly$BlockDragger = { BlockDragger : function ( a , b ) { this . draggingBlock _ = a ; this . workspace _ = b ; this . draggedConnectionManager _ = new module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager ( this . draggingBlock _ ) ; this . dragTarget _ = null ; this . wouldDeleteBlock _ = ! 1 ; this . startXY _ = this . draggingBlock _ . getRelativeToSurfaceXY ( ) ; this . dragIconData _ = module$contents$Blockly$BlockDragger _initIconData ( a ) } } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . dispose = function ( ) { this . dragIconData _ . length = 0 ; this . draggedConnectionManager _ && this . draggedConnectionManager _ . dispose ( ) } ; var module$contents$Blockly$BlockDragger _initIconData = function ( a ) { var b = [ ] ; a = a . getDescendants ( ! 1 ) ; for ( var c = 0 , d ; d = a [ c ] ; c ++ ) { d = d . getIcons ( ) ; for ( var e = 0 ; e < d . length ; e ++ ) { var f = { location : d [ e ] . getIconLocation ( ) , icon : d [ e ] } ; b . push ( f ) } } return b } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . startDrag = function ( a , b ) { ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; this . fireDragStartEvent _ ( ) ; this . workspace _ . isMutator && this . draggingBlock _ . bringToFront ( ) ; ( 0 , module$exports$Blockly$utils$dom . startTextWidthCache ) ( ) ; this . workspace _ . setResizesEnabled ( ! 1 ) ; ( 0 , module$exports$Blockly$blockAnimations . disconnectUiStop ) ( ) ; this . shouldDisconnect _ ( b ) && this . disconnectBlock _ ( b , a ) ; this . draggingBlock _ . setDragging ( ! 0 ) ;
this . draggingBlock _ . moveToDragSurface ( ) } ; module$exports$Blockly$BlockDragger . BlockDragger . prototype . shouldDisconnect _ = function ( a ) { return ! ! ( this . draggingBlock _ . getParent ( ) || a && this . draggingBlock _ . nextConnection && this . draggingBlock _ . nextConnection . targetBlock ( ) ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . disconnectBlock _ = function ( a , b ) { this . draggingBlock _ . unplug ( a ) ; a = this . pixelsToWorkspaceUnits _ ( b ) ; a = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . startXY _ , a ) ; this . draggingBlock _ . translate ( a . x , a . y ) ; ( 0 , module$exports$Blockly$blockAnimations . disconnectUiEffect ) ( this . draggingBlock _ ) ; this . draggedConnectionManager _ . updateAvailableConnections ( ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . fireDragStartEvent _ = function ( ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . BLOCK _DRAG ) ) ( this . draggingBlock _ , ! 0 , this . draggingBlock _ . getDescendants ( ! 1 ) ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . drag = function ( a , b ) { b = this . pixelsToWorkspaceUnits _ ( b ) ; var c = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . startXY _ , b ) ; this . draggingBlock _ . moveDuringDrag ( c ) ; this . dragIcons _ ( b ) ; c = this . dragTarget _ ; this . dragTarget _ = this . workspace _ . getDragTarget ( a ) ; this . draggedConnectionManager _ . update ( b , this . dragTarget _ ) ; a = this . wouldDeleteBlock _ ; this . wouldDeleteBlock _ = this . draggedConnectionManager _ . wouldDeleteBlock ( ) ; a !== this . wouldDeleteBlock _ && this . updateCursorDuringBlockDrag _ ( ) ;
this . dragTarget _ !== c && ( c && c . onDragExit ( this . draggingBlock _ ) , this . dragTarget _ && this . dragTarget _ . onDragEnter ( this . draggingBlock _ ) ) ; this . dragTarget _ && this . dragTarget _ . onDragOver ( this . draggingBlock _ ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . endDrag = function ( a , b ) { this . drag ( a , b ) ; this . dragIconData _ = [ ] ; this . fireDragEndEvent _ ( ) ; ( 0 , module$exports$Blockly$utils$dom . stopTextWidthCache ) ( ) ; ( 0 , module$exports$Blockly$blockAnimations . disconnectUiStop ) ( ) ; if ( this . dragTarget _ && this . dragTarget _ . shouldPreventMove ( this . draggingBlock _ ) ) a = this . startXY _ ; else { a = this . getNewLocationAfterDrag _ ( b ) ; var c = a . delta ; a = a . newLocation } this . draggingBlock _ . moveOffDragSurface ( a ) ; if ( this . dragTarget _ ) this . dragTarget _ . onDrop ( this . draggingBlock _ ) ;
this . maybeDeleteBlock _ ( ) || ( this . draggingBlock _ . setDragging ( ! 1 ) , c ? this . updateBlockAfterMove _ ( c ) : ( 0 , module$exports$Blockly$bumpObjects . bumpIntoBounds ) ( this . draggingBlock _ . workspace , this . workspace _ . getMetricsManager ( ) . getScrollMetrics ( ! 0 ) , this . draggingBlock _ ) ) ; this . workspace _ . setResizesEnabled ( ! 0 ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . getNewLocationAfterDrag _ = function ( a ) { var b = { } ; b . delta = this . pixelsToWorkspaceUnits _ ( a ) ; b . newLocation = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . startXY _ , b . delta ) ; return b } ; module$exports$Blockly$BlockDragger . BlockDragger . prototype . maybeDeleteBlock _ = function ( ) { return this . wouldDeleteBlock _ ? ( this . fireMoveEvent _ ( ) , this . draggingBlock _ . dispose ( ! 1 , ! 0 ) , $ . module$exports$Blockly$common . draggingConnections . length = 0 , ! 0 ) : ! 1 } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . updateBlockAfterMove _ = function ( a ) { this . draggingBlock _ . moveConnections ( a . x , a . y ) ; this . fireMoveEvent _ ( ) ; this . draggedConnectionManager _ . wouldConnectBlock ( ) ? this . draggedConnectionManager _ . applyConnections ( ) : this . draggingBlock _ . render ( ) ; this . draggingBlock _ . scheduleSnapAndBump ( ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . fireDragEndEvent _ = function ( ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . BLOCK _DRAG ) ) ( this . draggingBlock _ , ! 1 , this . draggingBlock _ . getDescendants ( ! 1 ) ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . updateToolboxStyle _ = function ( a ) { var b = this . workspace _ . getToolbox ( ) ; if ( b ) { var c = this . draggingBlock _ . isDeletable ( ) ? "blocklyToolboxDelete" : "blocklyToolboxGrab" ; a && "function" === typeof b . removeStyle ? b . removeStyle ( c ) : a || "function" !== typeof b . addStyle || b . addStyle ( c ) } } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . fireMoveEvent _ = function ( ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . MOVE ) ) ( this . draggingBlock _ ) ; a . oldCoordinate = this . startXY _ ; a . recordNew ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ; module$exports$Blockly$BlockDragger . BlockDragger . prototype . updateCursorDuringBlockDrag _ = function ( ) { this . draggingBlock _ . setDeleteStyle ( this . wouldDeleteBlock _ ) } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . pixelsToWorkspaceUnits _ = function ( a ) { a = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . x / this . workspace _ . scale , a . y / this . workspace _ . scale ) ; this . workspace _ . isMutator && a . scale ( 1 / this . workspace _ . options . parentWorkspace . scale ) ; return a } ;
module$exports$Blockly$BlockDragger . BlockDragger . prototype . dragIcons _ = function ( a ) { for ( var b = 0 ; b < this . dragIconData _ . length ; b ++ ) { var c = this . dragIconData _ [ b ] ; c . icon . setIconLocation ( module$exports$Blockly$utils$Coordinate . Coordinate . sum ( c . location , a ) ) } } ; module$exports$Blockly$BlockDragger . BlockDragger . prototype . getInsertionMarkers = function ( ) { return this . draggedConnectionManager _ && this . draggedConnectionManager _ . getInsertionMarkers ? this . draggedConnectionManager _ . getInsertionMarkers ( ) : [ ] } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . BLOCK _DRAGGER , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$BlockDragger . BlockDragger ) ; var module$exports$Blockly$Events$Click = { Click : function ( a , b , c ) { module$exports$Blockly$Events$Click . Click . superClass _ . constructor . call ( this , a ? a . workspace . id : b ) ; this . blockId = a ? a . id : null ; this . targetType = c } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$Click . Click , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$Click . Click . prototype . type = module$exports$Blockly$Events$utils . CLICK ;
module$exports$Blockly$Events$Click . Click . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$Click . Click . superClass _ . toJson . call ( this ) ; a . targetType = this . targetType ; this . blockId && ( a . blockId = this . blockId ) ; return a } ; module$exports$Blockly$Events$Click . Click . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$Click . Click . superClass _ . fromJson . call ( this , a ) ; this . targetType = a . targetType ; this . blockId = a . blockId } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . CLICK , module$exports$Blockly$Events$Click . Click ) ; var module$exports$Blockly$Gesture = { Gesture : function ( a , b ) { this . mouseDownXY _ = null ; this . currentDragDeltaXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; this . startWorkspace _ = this . targetBlock _ = this . startBlock _ = this . startField _ = this . startBubble _ = null ; this . creatorWorkspace _ = b ; this . isDraggingBubble _ = this . isDraggingBlock _ = this . isDraggingWorkspace _ = this . hasExceededDragRadius _ = ! 1 ; this . mostRecentEvent _ = a ; this . flyout _ = this . workspaceDragger _ = this . blockDragger _ = this . bubbleDragger _ = this . onUpWrapper _ =
this . onMoveWrapper _ = null ; this . isEnding _ = this . hasStarted _ = this . calledUpdateIsDragging _ = ! 1 ; this . healStack _ = ! $ . module$exports$Blockly$internalConstants . DRAG _STACK } } ;
module$exports$Blockly$Gesture . Gesture . prototype . dispose = function ( ) { ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ; ( 0 , module$exports$Blockly$Tooltip . unblock ) ( ) ; this . creatorWorkspace _ . clearGesture ( ) ; this . onMoveWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMoveWrapper _ ) ; this . onUpWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onUpWrapper _ ) ; this . blockDragger _ && this . blockDragger _ . dispose ( ) ; this . workspaceDragger _ && this . workspaceDragger _ . dispose ( ) ; this . bubbleDragger _ &&
this . bubbleDragger _ . dispose ( ) } ; module$exports$Blockly$Gesture . Gesture . prototype . updateFromEvent _ = function ( a ) { var b = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . clientX , a . clientY ) ; this . updateDragDelta _ ( b ) && ( this . updateIsDragging _ ( ) , ( 0 , module$exports$Blockly$Touch . longStop ) ( ) ) ; this . mostRecentEvent _ = a } ;
module$exports$Blockly$Gesture . Gesture . prototype . updateDragDelta _ = function ( a ) { this . currentDragDeltaXY _ = module$exports$Blockly$utils$Coordinate . Coordinate . difference ( a , this . mouseDownXY _ ) ; return this . hasExceededDragRadius _ ? ! 1 : this . hasExceededDragRadius _ = module$exports$Blockly$utils$Coordinate . Coordinate . magnitude ( this . currentDragDeltaXY _ ) > ( this . flyout _ ? $ . module$exports$Blockly$internalConstants . FLYOUT _DRAG _RADIUS : $ . module$exports$Blockly$internalConstants . DRAG _RADIUS ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . updateIsDraggingFromFlyout _ = function ( ) { return this . targetBlock _ && this . flyout _ . isBlockCreatable _ ( this . targetBlock _ ) ? ! this . flyout _ . isScrollable ( ) || this . flyout _ . isDragTowardWorkspace ( this . currentDragDeltaXY _ ) ? ( this . startWorkspace _ = this . flyout _ . targetWorkspace , this . startWorkspace _ . updateScreenCalculationsIfScrolled ( ) , ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) , this . startBlock _ = null , this . targetBlock _ =
this . flyout _ . createBlock ( this . targetBlock _ ) , this . targetBlock _ . select ( ) , ! 0 ) : ! 1 : ! 1 } ; module$exports$Blockly$Gesture . Gesture . prototype . updateIsDraggingBubble _ = function ( ) { if ( ! this . startBubble _ ) return ! 1 ; this . isDraggingBubble _ = ! 0 ; this . startDraggingBubble _ ( ) ; return ! 0 } ;
module$exports$Blockly$Gesture . Gesture . prototype . updateIsDraggingBlock _ = function ( ) { if ( ! this . targetBlock _ ) return ! 1 ; this . flyout _ ? this . isDraggingBlock _ = this . updateIsDraggingFromFlyout _ ( ) : this . targetBlock _ . isMovable ( ) && ( this . isDraggingBlock _ = ! 0 ) ; return this . isDraggingBlock _ ? ( this . startDraggingBlock _ ( ) , ! 0 ) : ! 1 } ;
module$exports$Blockly$Gesture . Gesture . prototype . updateIsDraggingWorkspace _ = function ( ) { if ( this . flyout _ ? this . flyout _ . isScrollable ( ) : this . startWorkspace _ && this . startWorkspace _ . isDraggable ( ) ) this . workspaceDragger _ = new module$exports$Blockly$WorkspaceDragger . WorkspaceDragger ( this . startWorkspace _ ) , this . isDraggingWorkspace _ = ! 0 , this . workspaceDragger _ . startDrag ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . updateIsDragging _ = function ( ) { if ( this . calledUpdateIsDragging _ ) throw Error ( "updateIsDragging_ should only be called once per gesture." ) ; this . calledUpdateIsDragging _ = ! 0 ; this . updateIsDraggingBubble _ ( ) || this . updateIsDraggingBlock _ ( ) || this . updateIsDraggingWorkspace _ ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . startDraggingBlock _ = function ( ) { this . blockDragger _ = new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . BLOCK _DRAGGER , this . creatorWorkspace _ . options , ! 0 ) ) ( this . targetBlock _ , this . startWorkspace _ ) ; this . blockDragger _ . startDrag ( this . currentDragDeltaXY _ , this . healStack _ ) ; this . blockDragger _ . drag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . startDraggingBubble _ = function ( ) { this . bubbleDragger _ = new module$exports$Blockly$BubbleDragger . BubbleDragger ( this . startBubble _ , this . startWorkspace _ ) ; this . bubbleDragger _ . startBubbleDrag ( ) ; this . bubbleDragger _ . dragBubble ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . doStart = function ( a ) { ( 0 , module$exports$Blockly$browserEvents . isTargetInput ) ( a ) ? this . cancel ( ) : ( this . hasStarted _ = ! 0 , ( 0 , module$exports$Blockly$blockAnimations . disconnectUiStop ) ( ) , this . startWorkspace _ . updateScreenCalculationsIfScrolled ( ) , this . startWorkspace _ . isMutator && this . startWorkspace _ . resize ( ) , this . startWorkspace _ . hideChaff ( ! ! this . flyout _ ) , this . startWorkspace _ . markFocused ( ) , this . mostRecentEvent _ = a , ( 0 , module$exports$Blockly$Tooltip . block ) ( ) , this . targetBlock _ &&
this . targetBlock _ . select ( ) , ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) ? this . handleRightClick ( a ) : ( "touchstart" !== a . type . toLowerCase ( ) && "pointerdown" !== a . type . toLowerCase ( ) || "mouse" === a . pointerType || ( 0 , module$exports$Blockly$Touch . longStart ) ( a , this ) , this . mouseDownXY _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . clientX , a . clientY ) , this . healStack _ = a . altKey || a . ctrlKey || a . metaKey , this . bindMouseEvents ( a ) ) ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . bindMouseEvents = function ( a ) { this . onMoveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mousemove" , null , this . handleMove . bind ( this ) ) ; this . onUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mouseup" , null , this . handleUp . bind ( this ) ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . handleMove = function ( a ) { this . updateFromEvent _ ( a ) ; this . isDraggingWorkspace _ ? this . workspaceDragger _ . drag ( this . currentDragDeltaXY _ ) : this . isDraggingBlock _ ? this . blockDragger _ . drag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . isDraggingBubble _ && this . bubbleDragger _ . dragBubble ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . handleUp = function ( a ) { this . updateFromEvent _ ( a ) ; ( 0 , module$exports$Blockly$Touch . longStop ) ( ) ; this . isEnding _ ? console . log ( "Trying to end a gesture recursively." ) : ( this . isEnding _ = ! 0 , this . isDraggingBubble _ ? this . bubbleDragger _ . endBubbleDrag ( a , this . currentDragDeltaXY _ ) : this . isDraggingBlock _ ? this . blockDragger _ . endDrag ( a , this . currentDragDeltaXY _ ) : this . isDraggingWorkspace _ ? this . workspaceDragger _ . endDrag ( this . currentDragDeltaXY _ ) : this . isBubbleClick _ ( ) ? this . doBubbleClick _ ( ) :
this . isFieldClick _ ( ) ? this . doFieldClick _ ( ) : this . isBlockClick _ ( ) ? this . doBlockClick _ ( ) : this . isWorkspaceClick _ ( ) && this . doWorkspaceClick _ ( a ) , a . preventDefault ( ) , a . stopPropagation ( ) , this . dispose ( ) ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . cancel = function ( ) { this . isEnding _ || ( ( 0 , module$exports$Blockly$Touch . longStop ) ( ) , this . isDraggingBubble _ ? this . bubbleDragger _ . endBubbleDrag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . isDraggingBlock _ ? this . blockDragger _ . endDrag ( this . mostRecentEvent _ , this . currentDragDeltaXY _ ) : this . isDraggingWorkspace _ && this . workspaceDragger _ . endDrag ( this . currentDragDeltaXY _ ) , this . dispose ( ) ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . handleRightClick = function ( a ) { this . targetBlock _ ? ( this . bringBlockToFront _ ( ) , this . targetBlock _ . workspace . hideChaff ( ! ! this . flyout _ ) , this . targetBlock _ . showContextMenu ( a ) ) : this . startBubble _ ? this . startBubble _ . showContextMenu ( a ) : this . startWorkspace _ && ! this . flyout _ && ( this . startWorkspace _ . hideChaff ( ) , this . startWorkspace _ . showContextMenu ( a ) ) ; a . preventDefault ( ) ; a . stopPropagation ( ) ; this . dispose ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . handleWsStart = function ( a , b ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.handleWsStart, but the gesture had already been started." ) ; this . setStartWorkspace _ ( b ) ; this . mostRecentEvent _ = a ; this . doStart ( a ) } ; module$exports$Blockly$Gesture . Gesture . prototype . fireWorkspaceClick _ = function ( a ) { ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CLICK ) ) ( null , a . id , "workspace" ) ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . handleFlyoutStart = function ( a , b ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.handleFlyoutStart, but the gesture had already been started." ) ; this . setStartFlyout _ ( b ) ; this . handleWsStart ( a , b . getWorkspace ( ) ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . handleBlockStart = function ( a , b ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.handleBlockStart, but the gesture had already been started." ) ; this . setStartBlock ( b ) ; this . mostRecentEvent _ = a } ; module$exports$Blockly$Gesture . Gesture . prototype . handleBubbleStart = function ( a , b ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.handleBubbleStart, but the gesture had already been started." ) ; this . setStartBubble ( b ) ; this . mostRecentEvent _ = a } ;
module$exports$Blockly$Gesture . Gesture . prototype . doBubbleClick _ = function ( ) { this . startBubble _ . setFocus && this . startBubble _ . setFocus ( ) ; this . startBubble _ . select && this . startBubble _ . select ( ) } ; module$exports$Blockly$Gesture . Gesture . prototype . doFieldClick _ = function ( ) { this . startField _ . showEditor ( this . mostRecentEvent _ ) ; this . bringBlockToFront _ ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . doBlockClick _ = function ( ) { if ( this . flyout _ && this . flyout _ . autoClose ) this . targetBlock _ . isEnabled ( ) && ( ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) , this . flyout _ . createBlock ( this . targetBlock _ ) . scheduleSnapAndBump ( ) ) ; else { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CLICK ) ) ( this . startBlock _ , this . startWorkspace _ . id , "block" ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } this . bringBlockToFront _ ( ) ;
( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } ; module$exports$Blockly$Gesture . Gesture . prototype . doWorkspaceClick _ = function ( a ) { a = this . creatorWorkspace _ ; ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) && ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . unselect ( ) ; this . fireWorkspaceClick _ ( this . startWorkspace _ || a ) } ; module$exports$Blockly$Gesture . Gesture . prototype . bringBlockToFront _ = function ( ) { this . targetBlock _ && ! this . flyout _ && this . targetBlock _ . bringToFront ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . setStartField = function ( a ) { if ( this . hasStarted _ ) throw Error ( "Tried to call gesture.setStartField, but the gesture had already been started." ) ; this . startField _ || ( this . startField _ = a ) } ; module$exports$Blockly$Gesture . Gesture . prototype . setStartBubble = function ( a ) { this . startBubble _ || ( this . startBubble _ = a ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . setStartBlock = function ( a ) { this . startBlock _ || this . startBubble _ || ( this . startBlock _ = a , a . isInFlyout && a !== a . getRootBlock ( ) ? this . setTargetBlock _ ( a . getRootBlock ( ) ) : this . setTargetBlock _ ( a ) ) } ; module$exports$Blockly$Gesture . Gesture . prototype . setTargetBlock _ = function ( a ) { a . isShadow ( ) ? this . setTargetBlock _ ( a . getParent ( ) ) : this . targetBlock _ = a } ;
module$exports$Blockly$Gesture . Gesture . prototype . setStartWorkspace _ = function ( a ) { this . startWorkspace _ || ( this . startWorkspace _ = a ) } ; module$exports$Blockly$Gesture . Gesture . prototype . setStartFlyout _ = function ( a ) { this . flyout _ || ( this . flyout _ = a ) } ; module$exports$Blockly$Gesture . Gesture . prototype . isBubbleClick _ = function ( ) { return ! ! this . startBubble _ && ! this . hasExceededDragRadius _ } ; module$exports$Blockly$Gesture . Gesture . prototype . isBlockClick _ = function ( ) { return ! ! this . startBlock _ && ! this . hasExceededDragRadius _ && ! this . isFieldClick _ ( ) } ;
module$exports$Blockly$Gesture . Gesture . prototype . isFieldClick _ = function ( ) { return ( this . startField _ ? this . startField _ . isClickable ( ) : ! 1 ) && ! this . hasExceededDragRadius _ && ( ! this . flyout _ || ! this . flyout _ . autoClose ) } ; module$exports$Blockly$Gesture . Gesture . prototype . isWorkspaceClick _ = function ( ) { return ! this . startBlock _ && ! this . startBubble _ && ! this . startField _ && ! this . hasExceededDragRadius _ } ;
module$exports$Blockly$Gesture . Gesture . prototype . isDragging = function ( ) { return this . isDraggingWorkspace _ || this . isDraggingBlock _ || this . isDraggingBubble _ } ; module$exports$Blockly$Gesture . Gesture . prototype . hasStarted = function ( ) { return this . hasStarted _ } ; module$exports$Blockly$Gesture . Gesture . prototype . getInsertionMarkers = function ( ) { return this . blockDragger _ ? this . blockDragger _ . getInsertionMarkers ( ) : [ ] } ;
module$exports$Blockly$Gesture . Gesture . prototype . getCurrentDragger = function ( ) { return this . isDraggingBlock _ ? this . blockDragger _ : this . isDraggingWorkspace _ ? this . workspaceDragger _ : this . isDraggingBubble _ ? this . bubbleDragger _ : null } ; module$exports$Blockly$Gesture . Gesture . inProgress = function ( ) { for ( var a = module$exports$Blockly$Workspace . Workspace . getAll ( ) , b = 0 , c ; c = a [ b ] ; b ++ ) if ( c . currentGesture _ ) return ! 0 ; return ! 1 } ; var module$exports$Blockly$Field = { Field : function ( a , b , c ) { this . value _ = this . DEFAULT _VALUE ; this . tooltip _ = this . validator _ = null ; this . size _ = new module$exports$Blockly$utils$Size . Size ( 0 , 0 ) ; this . constants _ = this . mouseDownWrapper _ = this . textContent _ = this . textElement _ = this . borderRect _ = this . fieldGroup _ = this . markerSvg _ = this . cursorSvg _ = null ; c && this . configure _ ( c ) ; this . setValue ( a ) ; b && this . setValidator ( b ) } } ; module$exports$Blockly$Field . Field . prototype . DEFAULT _VALUE = null ;
module$exports$Blockly$Field . Field . prototype . name = void 0 ; module$exports$Blockly$Field . Field . prototype . disposed = ! 1 ; module$exports$Blockly$Field . Field . prototype . maxDisplayLength = 50 ; module$exports$Blockly$Field . Field . prototype . sourceBlock _ = null ; module$exports$Blockly$Field . Field . prototype . isDirty _ = ! 0 ; module$exports$Blockly$Field . Field . prototype . visible _ = ! 0 ; module$exports$Blockly$Field . Field . prototype . enabled _ = ! 0 ; module$exports$Blockly$Field . Field . prototype . clickTarget _ = null ;
module$exports$Blockly$Field . Field . NBSP = "\u00a0" ; module$exports$Blockly$Field . Field . prototype . EDITABLE = ! 0 ; module$exports$Blockly$Field . Field . prototype . SERIALIZABLE = ! 1 ; module$exports$Blockly$Field . Field . prototype . configure _ = function ( a ) { var b = a . tooltip ; "string" === typeof b && ( b = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . tooltip ) ) ; b && this . setTooltip ( b ) } ;
module$exports$Blockly$Field . Field . prototype . setSourceBlock = function ( a ) { if ( this . sourceBlock _ ) throw Error ( "Field already bound to a block" ) ; this . sourceBlock _ = a } ; module$exports$Blockly$Field . Field . prototype . getConstants = function ( ) { ! this . constants _ && this . sourceBlock _ && this . sourceBlock _ . workspace && this . sourceBlock _ . workspace . rendered && ( this . constants _ = this . sourceBlock _ . workspace . getRenderer ( ) . getConstants ( ) ) ; return this . constants _ } ; module$exports$Blockly$Field . Field . prototype . getSourceBlock = function ( ) { return this . sourceBlock _ } ;
module$exports$Blockly$Field . Field . prototype . init = function ( ) { this . fieldGroup _ || ( this . fieldGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { } , null ) , this . isVisible ( ) || ( this . fieldGroup _ . style . display = "none" ) , this . sourceBlock _ . getSvgRoot ( ) . appendChild ( this . fieldGroup _ ) , this . initView ( ) , this . updateEditable ( ) , this . setTooltip ( this . tooltip _ ) , this . bindEvents _ ( ) , this . initModel ( ) ) } ;
module$exports$Blockly$Field . Field . prototype . initView = function ( ) { this . createBorderRect _ ( ) ; this . createTextElement _ ( ) } ; module$exports$Blockly$Field . Field . prototype . initModel = function ( ) { } ;
module$exports$Blockly$Field . Field . prototype . createBorderRect _ = function ( ) { this . borderRect _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { rx : this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS , ry : this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS , x : 0 , y : 0 , height : this . size _ . height , width : this . size _ . width , "class" : "blocklyFieldRect" } , this . fieldGroup _ ) } ;
module$exports$Blockly$Field . Field . prototype . createTextElement _ = function ( ) { this . textElement _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TEXT , { "class" : "blocklyText" } , this . fieldGroup _ ) ; this . getConstants ( ) . FIELD _TEXT _BASELINE _CENTER && this . textElement _ . setAttribute ( "dominant-baseline" , "central" ) ; this . textContent _ = document . createTextNode ( "" ) ; this . textElement _ . appendChild ( this . textContent _ ) } ;
module$exports$Blockly$Field . Field . prototype . bindEvents _ = function ( ) { ( 0 , module$exports$Blockly$Tooltip . bindMouseEvents ) ( this . getClickTarget _ ( ) ) ; this . mouseDownWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . getClickTarget _ ( ) , "mousedown" , this , this . onMouseDown _ ) } ; module$exports$Blockly$Field . Field . prototype . fromXml = function ( a ) { this . setValue ( a . textContent ) } ; module$exports$Blockly$Field . Field . prototype . toXml = function ( a ) { a . textContent = this . getValue ( ) ; return a } ;
module$exports$Blockly$Field . Field . prototype . saveState = function ( a ) { a = this . saveLegacyState ( module$exports$Blockly$Field . Field ) ; return null !== a ? a : this . getValue ( ) } ; module$exports$Blockly$Field . Field . prototype . loadState = function ( a ) { this . loadLegacyState ( module$exports$Blockly$Field . Field , a ) || this . setValue ( a ) } ;
module$exports$Blockly$Field . Field . prototype . saveLegacyState = function ( a ) { return a . prototype . saveState === this . saveState && a . prototype . toXml !== this . toXml ? ( a = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "field" ) , a . setAttribute ( "name" , this . name || "" ) , ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( this . toXml ( a ) ) . replace ( ' xmlns="https://developers.google.com/blockly/xml"' , "" ) ) : null } ;
module$exports$Blockly$Field . Field . prototype . loadLegacyState = function ( a , b ) { return a . prototype . loadState === this . loadState && a . prototype . fromXml !== this . fromXml ? ( this . fromXml ( ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( b ) ) , ! 0 ) : ! 1 } ;
module$exports$Blockly$Field . Field . prototype . dispose = function ( ) { module$exports$Blockly$DropDownDiv . DropDownDiv . hideIfOwner ( this ) ; ( 0 , module$exports$Blockly$WidgetDiv . hideIfOwner ) ( this ) ; ( 0 , module$exports$Blockly$Tooltip . unbindMouseEvents ) ( this . getClickTarget _ ( ) ) ; this . mouseDownWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . mouseDownWrapper _ ) ; ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . fieldGroup _ ) ; this . disposed = ! 0 } ;
module$exports$Blockly$Field . Field . prototype . updateEditable = function ( ) { var a = this . fieldGroup _ ; this . EDITABLE && a && ( this . enabled _ && this . sourceBlock _ . isEditable ( ) ? ( ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyEditableText" ) , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyNonEditableText" ) , a . style . cursor = this . CURSOR ) : ( ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyNonEditableText" ) , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyEditableText" ) , a . style . cursor = "" ) ) } ;
module$exports$Blockly$Field . Field . prototype . setEnabled = function ( a ) { this . enabled _ = a ; this . updateEditable ( ) } ; module$exports$Blockly$Field . Field . prototype . isEnabled = function ( ) { return this . enabled _ } ; module$exports$Blockly$Field . Field . prototype . isClickable = function ( ) { return this . enabled _ && ! ! this . sourceBlock _ && this . sourceBlock _ . isEditable ( ) && ! ! this . showEditor _ && "function" === typeof this . showEditor _ } ;
module$exports$Blockly$Field . Field . prototype . isCurrentlyEditable = function ( ) { return this . enabled _ && this . EDITABLE && ! ! this . sourceBlock _ && this . sourceBlock _ . isEditable ( ) } ; module$exports$Blockly$Field . Field . prototype . isSerializable = function ( ) { var a = ! 1 ; this . name && ( this . SERIALIZABLE ? a = ! 0 : this . EDITABLE && ( console . warn ( "Detected an editable field that was not serializable. Please define SERIALIZABLE property as true on all editable custom fields. Proceeding with serialization." ) , a = ! 0 ) ) ; return a } ;
module$exports$Blockly$Field . Field . prototype . isVisible = function ( ) { return this . visible _ } ; module$exports$Blockly$Field . Field . prototype . setVisible = function ( a ) { if ( this . visible _ !== a ) { this . visible _ = a ; var b = this . getSvgRoot ( ) ; b && ( b . style . display = a ? "block" : "none" ) } } ; module$exports$Blockly$Field . Field . prototype . setValidator = function ( a ) { this . validator _ = a } ; module$exports$Blockly$Field . Field . prototype . getValidator = function ( ) { return this . validator _ } ; module$exports$Blockly$Field . Field . prototype . getSvgRoot = function ( ) { return this . fieldGroup _ } ;
module$exports$Blockly$Field . Field . prototype . applyColour = function ( ) { } ; module$exports$Blockly$Field . Field . prototype . render _ = function ( ) { this . textContent _ && ( this . textContent _ . nodeValue = this . getDisplayText _ ( ) ) ; this . updateSize _ ( ) } ; module$exports$Blockly$Field . Field . prototype . showEditor = function ( a ) { this . isClickable ( ) && this . showEditor _ ( a ) } ;
module$exports$Blockly$Field . Field . prototype . updateSize _ = function ( a ) { var b = this . getConstants ( ) ; a = void 0 !== a ? a : this . borderRect _ ? this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING : 0 ; var c = 2 * a , d = b . FIELD _TEXT _HEIGHT , e = 0 ; this . textElement _ && ( e = ( 0 , module$exports$Blockly$utils$dom . getFastTextWidth ) ( this . textElement _ , b . FIELD _TEXT _FONTSIZE , b . FIELD _TEXT _FONTWEIGHT , b . FIELD _TEXT _FONTFAMILY ) , c += e ) ; this . borderRect _ && ( d = Math . max ( d , b . FIELD _BORDER _RECT _HEIGHT ) ) ; this . size _ . height = d ; this . size _ . width = c ; this . positionTextElement _ ( a ,
e ) ; this . positionBorderRect _ ( ) } ; module$exports$Blockly$Field . Field . prototype . positionTextElement _ = function ( a , b ) { if ( this . textElement _ ) { var c = this . getConstants ( ) , d = this . size _ . height / 2 ; this . textElement _ . setAttribute ( "x" , this . sourceBlock _ . RTL ? this . size _ . width - b - a : a ) ; this . textElement _ . setAttribute ( "y" , c . FIELD _TEXT _BASELINE _CENTER ? d : d - c . FIELD _TEXT _HEIGHT / 2 + c . FIELD _TEXT _BASELINE ) } } ;
module$exports$Blockly$Field . Field . prototype . positionBorderRect _ = function ( ) { this . borderRect _ && ( this . borderRect _ . setAttribute ( "width" , this . size _ . width ) , this . borderRect _ . setAttribute ( "height" , this . size _ . height ) , this . borderRect _ . setAttribute ( "rx" , this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS ) , this . borderRect _ . setAttribute ( "ry" , this . getConstants ( ) . FIELD _BORDER _RECT _RADIUS ) ) } ;
module$exports$Blockly$Field . Field . prototype . getSize = function ( ) { if ( ! this . isVisible ( ) ) return new module$exports$Blockly$utils$Size . Size ( 0 , 0 ) ; this . isDirty _ ? ( this . render _ ( ) , this . isDirty _ = ! 1 ) : this . visible _ && 0 === this . size _ . width && ( console . warn ( "Deprecated use of setting size_.width to 0 to rerender a field. Set field.isDirty_ to true instead." ) , this . render _ ( ) ) ; return this . size _ } ;
module$exports$Blockly$Field . Field . prototype . getScaledBBox = function ( ) { if ( this . borderRect _ ) { var a = this . borderRect _ . getBoundingClientRect ( ) ; var b = ( 0 , module$exports$Blockly$utils$style . getPageOffset ) ( this . borderRect _ ) ; var c = a . width ; var d = a . height } else d = this . sourceBlock _ . getHeightWidth ( ) , a = this . sourceBlock _ . workspace . scale , b = this . getAbsoluteXY _ ( ) , c = d . width * a , d = d . height * a , module$exports$Blockly$utils$userAgent . GECKO ? ( b . x += 1.5 * a , b . y += 1.5 * a ) : module$exports$Blockly$utils$userAgent . EDGE || module$exports$Blockly$utils$userAgent . IE ||
( b . x -= . 5 * a , b . y -= . 5 * a ) , c += 1 * a , d += 1 * a ; return new module$exports$Blockly$utils$Rect . Rect ( b . y , b . y + d , b . x , b . x + c ) } ; module$exports$Blockly$Field . Field . prototype . getDisplayText _ = function ( ) { var a = this . getText ( ) ; if ( ! a ) return module$exports$Blockly$Field . Field . NBSP ; a . length > this . maxDisplayLength && ( a = a . substring ( 0 , this . maxDisplayLength - 2 ) + "\u2026" ) ; a = a . replace ( /\s/g , module$exports$Blockly$Field . Field . NBSP ) ; this . sourceBlock _ && this . sourceBlock _ . RTL && ( a += "\u200f" ) ; return a } ;
module$exports$Blockly$Field . Field . prototype . getText = function ( ) { if ( this . getText _ ) { var a = this . getText _ . call ( this ) ; if ( null !== a ) return String ( a ) } return String ( this . getValue ( ) ) } ; module$exports$Blockly$Field . Field . prototype . markDirty = function ( ) { this . isDirty _ = ! 0 ; this . constants _ = null } ; module$exports$Blockly$Field . Field . prototype . forceRerender = function ( ) { this . isDirty _ = ! 0 ; this . sourceBlock _ && this . sourceBlock _ . rendered && ( this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours ( ) , this . updateMarkers _ ( ) ) } ;
module$exports$Blockly$Field . Field . prototype . setValue = function ( a ) { if ( null !== a ) { var b = this . doClassValidation _ ( a ) ; a = this . processValidation _ ( a , b ) ; if ( ! ( a instanceof Error ) ) { if ( b = this . getValidator ( ) ) if ( b = b . call ( this , a ) , a = this . processValidation _ ( a , b ) , a instanceof Error ) return ; b = this . sourceBlock _ ; if ( ! b || ! b . disposed ) { var c = this . getValue ( ) ; c === a ? this . doValueUpdate _ ( a ) : ( this . doValueUpdate _ ( a ) , b && ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( b ,
"field" , this . name || null , c , a ) ) , this . isDirty _ && this . forceRerender ( ) ) } } } } ; module$exports$Blockly$Field . Field . prototype . processValidation _ = function ( a , b ) { if ( null === b ) return this . doValueInvalid _ ( a ) , this . isDirty _ && this . forceRerender ( ) , Error ( ) ; void 0 !== b && ( a = b ) ; return a } ; module$exports$Blockly$Field . Field . prototype . getValue = function ( ) { return this . value _ } ; module$exports$Blockly$Field . Field . prototype . doClassValidation _ = function ( a ) { return null === a || void 0 === a ? null : a } ;
module$exports$Blockly$Field . Field . prototype . doValueUpdate _ = function ( a ) { this . value _ = a ; this . isDirty _ = ! 0 } ; module$exports$Blockly$Field . Field . prototype . doValueInvalid _ = function ( a ) { } ; module$exports$Blockly$Field . Field . prototype . onMouseDown _ = function ( a ) { this . sourceBlock _ && this . sourceBlock _ . workspace && ( a = this . sourceBlock _ . workspace . getGesture ( a ) ) && a . setStartField ( this ) } ;
module$exports$Blockly$Field . Field . prototype . setTooltip = function ( a ) { a || "" === a || ( a = this . sourceBlock _ ) ; var b = this . getClickTarget _ ( ) ; b ? b . tooltip = a : this . tooltip _ = a } ; module$exports$Blockly$Field . Field . prototype . getTooltip = function ( ) { var a = this . getClickTarget _ ( ) ; return a ? ( 0 , module$exports$Blockly$Tooltip . getTooltipOfObject ) ( a ) : ( 0 , module$exports$Blockly$Tooltip . getTooltipOfObject ) ( { tooltip : this . tooltip _ } ) } ;
module$exports$Blockly$Field . Field . prototype . getClickTarget _ = function ( ) { return this . clickTarget _ || this . getSvgRoot ( ) } ; module$exports$Blockly$Field . Field . prototype . getAbsoluteXY _ = function ( ) { return ( 0 , module$exports$Blockly$utils$style . getPageOffset ) ( this . getClickTarget _ ( ) ) } ; module$exports$Blockly$Field . Field . prototype . referencesVariables = function ( ) { return ! 1 } ;
module$exports$Blockly$Field . Field . prototype . getParentInput = function ( ) { for ( var a = null , b = this . sourceBlock _ , c = b . inputList , d = 0 ; d < b . inputList . length ; d ++ ) for ( var e = c [ d ] , f = e . fieldRow , g = 0 ; g < f . length ; g ++ ) if ( f [ g ] === this ) { a = e ; break } return a } ; module$exports$Blockly$Field . Field . prototype . getFlipRtl = function ( ) { return ! 1 } ; module$exports$Blockly$Field . Field . prototype . isTabNavigable = function ( ) { return ! 1 } ; module$exports$Blockly$Field . Field . prototype . onShortcut = function ( a ) { return ! 1 } ;
module$exports$Blockly$Field . Field . prototype . setCursorSvg = function ( a ) { a ? ( this . fieldGroup _ . appendChild ( a ) , this . cursorSvg _ = a ) : this . cursorSvg _ = null } ; module$exports$Blockly$Field . Field . prototype . setMarkerSvg = function ( a ) { a ? ( this . fieldGroup _ . appendChild ( a ) , this . markerSvg _ = a ) : this . markerSvg _ = null } ;
module$exports$Blockly$Field . Field . prototype . updateMarkers _ = function ( ) { var a = this . sourceBlock _ . workspace ; a . keyboardAccessibilityMode && this . cursorSvg _ && a . getCursor ( ) . draw ( ) ; a . keyboardAccessibilityMode && this . markerSvg _ && a . getMarker ( module$exports$Blockly$MarkerManager . MarkerManager . LOCAL _MARKER ) . draw ( ) } ; $ . module$exports$Blockly$FieldLabel = { FieldLabel : function ( a , b , c ) { this . class _ = null ; $ . module$exports$Blockly$FieldLabel . FieldLabel . superClass _ . constructor . call ( this , a , null , c ) ; c || ( this . class _ = b || null ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( $ . module$exports$Blockly$FieldLabel . FieldLabel , module$exports$Blockly$Field . Field ) ; $ . module$exports$Blockly$FieldLabel . FieldLabel . prototype . DEFAULT _VALUE = "" ;
$ . module$exports$Blockly$FieldLabel . FieldLabel . fromJson = function ( a ) { return new this ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . text ) , void 0 , a ) } ; $ . module$exports$Blockly$FieldLabel . FieldLabel . prototype . EDITABLE = ! 1 ; $ . module$exports$Blockly$FieldLabel . FieldLabel . prototype . configure _ = function ( a ) { $ . module$exports$Blockly$FieldLabel . FieldLabel . superClass _ . configure _ . call ( this , a ) ; this . class _ = a [ "class" ] } ;
$ . module$exports$Blockly$FieldLabel . FieldLabel . prototype . initView = function ( ) { this . createTextElement _ ( ) ; this . class _ && ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . textElement _ , this . class _ ) } ; $ . module$exports$Blockly$FieldLabel . FieldLabel . prototype . doClassValidation _ = function ( a ) { return null === a || void 0 === a ? null : String ( a ) } ;
$ . module$exports$Blockly$FieldLabel . FieldLabel . prototype . setClass = function ( a ) { this . textElement _ && ( this . class _ && ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . textElement _ , this . class _ ) , a && ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . textElement _ , a ) ) ; this . class _ = a } ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_label" , $ . module$exports$Blockly$FieldLabel . FieldLabel ) ; var module$exports$Blockly$blockRendering$Debug = { Debug : function ( a ) { this . debugElements _ = [ ] ; this . svgRoot _ = null ; this . constants _ = a } } ; module$exports$Blockly$blockRendering$Debug . Debug . config = { rowSpacers : ! 0 , elemSpacers : ! 0 , rows : ! 0 , elems : ! 0 , connections : ! 0 , blockBounds : ! 0 , connectedBlockBounds : ! 0 , render : ! 0 } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . clearElems = function ( ) { for ( var a = 0 ; a < this . debugElements _ . length ; a ++ ) ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . debugElements _ [ a ] ) ; this . debugElements _ = [ ] } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawSpacerRow = function ( a , b , c ) { if ( module$exports$Blockly$blockRendering$Debug . Debug . config . rowSpacers ) { var d = Math . abs ( a . height ) , e = 0 > a . height ; e && ( b -= d ) ; this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "rowSpacerRect blockRenderDebug" , x : c ? - ( a . xPos + a . width ) : a . xPos , y : b , width : a . width , height : d , stroke : e ? "black" : "blue" , fill : "blue" , "fill-opacity" : "0.5" , "stroke-width" : "1px" } ,
this . svgRoot _ ) ) } } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawSpacerElem = function ( a , b , c ) { if ( module$exports$Blockly$blockRendering$Debug . Debug . config . elemSpacers ) { b = Math . abs ( a . width ) ; var d = 0 > a . width , e = d ? a . xPos - b : a . xPos ; c && ( e = - ( e + b ) ) ; this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "elemSpacerRect blockRenderDebug" , x : e , y : a . centerline - a . height / 2 , width : b , height : a . height , stroke : "pink" , fill : d ? "black" : "pink" , "fill-opacity" : "0.5" ,
"stroke-width" : "1px" } , this . svgRoot _ ) ) } } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawRenderedElem = function ( a , b ) { if ( module$exports$Blockly$blockRendering$Debug . Debug . config . elems ) { var c = a . xPos ; b && ( c = - ( c + a . width ) ) ; b = a . centerline - a . height / 2 ; this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "rowRenderingRect blockRenderDebug" , x : c , y : b , width : a . width , height : a . height , stroke : "black" , fill : "none" , "stroke-width" : "1px" } , this . svgRoot _ ) ) ; module$exports$Blockly$blockRendering$Types . Types . isField ( a ) &&
a . field instanceof $ . module$exports$Blockly$FieldLabel . FieldLabel && this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "rowRenderingRect blockRenderDebug" , x : c , y : b + this . constants _ . FIELD _TEXT _BASELINE , width : a . width , height : "0.1px" , stroke : "red" , fill : "none" , "stroke-width" : "0.5px" } , this . svgRoot _ ) ) } module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) && module$exports$Blockly$blockRendering$Debug . Debug . config . connections &&
this . drawConnection ( a . connectionModel ) } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawConnection = function ( a ) { if ( module$exports$Blockly$blockRendering$Debug . Debug . config . connections ) { if ( a . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE ) { var b = 4 ; var c = "magenta" ; var d = "none" } else a . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ? ( b = 2 , d = c = "magenta" ) : a . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ? ( b = 4 , c = "goldenrod" , d = "none" ) : a . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT &&
( b = 2 , d = c = "goldenrod" ) ; this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { "class" : "blockRenderDebug" , cx : a . offsetInBlock _ . x , cy : a . offsetInBlock _ . y , r : b , fill : d , stroke : c } , this . svgRoot _ ) ) } } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawRenderedRow = function ( a , b , c ) { module$exports$Blockly$blockRendering$Debug . Debug . config . rows && ( this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "elemRenderingRect blockRenderDebug" , x : c ? - ( a . xPos + a . width ) : a . xPos , y : a . yPos , width : a . width , height : a . height , stroke : "red" , fill : "none" , "stroke-width" : "1px" } , this . svgRoot _ ) ) , module$exports$Blockly$blockRendering$Types . Types . isTopOrBottomRow ( a ) ||
module$exports$Blockly$blockRendering$Debug . Debug . config . connectedBlockBounds && this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "connectedBlockWidth blockRenderDebug" , x : c ? - ( a . xPos + a . widthWithConnectedBlocks ) : a . xPos , y : a . yPos , width : a . widthWithConnectedBlocks , height : a . height , stroke : this . randomColour _ , fill : "none" , "stroke-width" : "1px" , "stroke-dasharray" : "3,3" } , this . svgRoot _ ) ) ) } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawRowWithElements = function ( a , b , c ) { for ( var d = 0 ; d < a . elements . length ; d ++ ) { var e = a . elements [ d ] ; e ? module$exports$Blockly$blockRendering$Types . Types . isSpacer ( e ) ? this . drawSpacerElem ( e , a . height , c ) : this . drawRenderedElem ( e , c ) : console . warn ( "A row has an undefined or null element." , a , e ) } this . drawRenderedRow ( a , b , c ) } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawBoundingBox = function ( a ) { if ( module$exports$Blockly$blockRendering$Debug . Debug . config . blockBounds ) { var b = a . RTL ? - a . width : 0 ; this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blockBoundingBox blockRenderDebug" , x : b , y : 0 , width : a . width , height : a . height , stroke : "black" , fill : "none" , "stroke-width" : "1px" , "stroke-dasharray" : "5,5" } , this . svgRoot _ ) ) ; module$exports$Blockly$blockRendering$Debug . Debug . config . connectedBlockBounds &&
( b = a . RTL ? - a . widthWithChildren : 0 , this . debugElements _ . push ( ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blockRenderDebug" , x : b , y : 0 , width : a . widthWithChildren , height : a . height , stroke : "#DF57BC" , fill : "none" , "stroke-width" : "1px" , "stroke-dasharray" : "3,3" } , this . svgRoot _ ) ) ) } } ;
module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawDebug = function ( a , b ) { this . clearElems ( ) ; this . svgRoot _ = a . getSvgRoot ( ) ; this . randomColour _ = "#" + Math . floor ( 16777215 * Math . random ( ) ) . toString ( 16 ) ; for ( var c = 0 , d = 0 ; d < b . rows . length ; d ++ ) { var e = b . rows [ d ] ; module$exports$Blockly$blockRendering$Types . Types . isBetweenRowSpacer ( e ) ? this . drawSpacerRow ( e , c , b . RTL ) : this . drawRowWithElements ( e , c , b . RTL ) ; c += e . height } a . previousConnection && this . drawConnection ( a . previousConnection ) ; a . nextConnection && this . drawConnection ( a . nextConnection ) ;
a . outputConnection && this . drawConnection ( a . outputConnection ) ; b . rightSide && this . drawRenderedElem ( b . rightSide , b . RTL ) ; this . drawBoundingBox ( b ) ; this . drawRender ( a . pathObject . svgPath ) } ; module$exports$Blockly$blockRendering$Debug . Debug . prototype . drawRender = function ( a ) { module$exports$Blockly$blockRendering$Debug . Debug . config . render && ( a . setAttribute ( "filter" , "url(#" + this . constants _ . debugFilterId + ")" ) , setTimeout ( function ( ) { a . setAttribute ( "filter" , "" ) } , 100 ) ) } ; var module$exports$Blockly$blockRendering$Drawer = { Drawer : function ( a , b ) { this . block _ = a ; this . info _ = b ; this . topLeft _ = a . getRelativeToSurfaceXY ( ) ; this . inlinePath _ = this . outlinePath _ = "" ; this . constants _ = b . getRenderer ( ) . getConstants ( ) } } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . draw = function ( ) { this . hideHiddenIcons _ ( ) ; this . drawOutline _ ( ) ; this . drawInternals _ ( ) ; this . block _ . pathObject . setPath ( this . outlinePath _ + "\n" + this . inlinePath _ ) ; this . info _ . RTL && this . block _ . pathObject . flipRTL ( ) ; ( 0 , module$exports$Blockly$blockRendering$debug . isDebuggerEnabled ) ( ) && this . block _ . renderingDebugger . drawDebug ( this . block _ , this . info _ ) ; this . recordSizeOnBlock _ ( ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . recordSizeOnBlock _ = function ( ) { this . block _ . height = this . info _ . height ; this . block _ . width = this . info _ . widthWithChildren } ; module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . hideHiddenIcons _ = function ( ) { for ( var a = 0 , b ; b = this . info _ . hiddenIcons [ a ] ; a ++ ) b . icon . iconGroup _ . setAttribute ( "display" , "none" ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawOutline _ = function ( ) { this . drawTop _ ( ) ; for ( var a = 1 ; a < this . info _ . rows . length - 1 ; a ++ ) { var b = this . info _ . rows [ a ] ; b . hasJaggedEdge ? this . drawJaggedEdge _ ( b ) : b . hasStatement ? this . drawStatementInput _ ( b ) : b . hasExternalInput ? this . drawValueInput _ ( b ) : this . drawRightSideRow _ ( b ) } this . drawBottom _ ( ) ; this . drawLeft _ ( ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawTop _ = function ( ) { var a = this . info _ . topRow , b = a . elements ; this . positionPreviousConnection _ ( ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( a . xPos , this . info _ . startY ) ; for ( var c = 0 , d ; d = b [ c ] ; c ++ ) module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( d ) ? this . outlinePath _ += this . constants _ . OUTSIDE _CORNERS . topLeft : module$exports$Blockly$blockRendering$Types . Types . isRightRoundedCorner ( d ) ? this . outlinePath _ += this . constants _ . OUTSIDE _CORNERS . topRight :
module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( d ) ? this . outlinePath _ += d . shape . pathLeft : module$exports$Blockly$blockRendering$Types . Types . isHat ( d ) ? this . outlinePath _ += this . constants _ . START _HAT . path : module$exports$Blockly$blockRendering$Types . Types . isSpacer ( d ) && ( this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , d . width ) ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , a . height ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawJaggedEdge _ = function ( a ) { this . outlinePath _ += this . constants _ . JAGGED _TEETH . path + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , a . height - this . constants _ . JAGGED _TEETH . height ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawValueInput _ = function ( a ) { var b = a . getLastInput ( ) ; this . positionExternalValueConnection _ ( a ) ; var c = "function" === typeof b . shape . pathDown ? b . shape . pathDown ( b . height ) : b . shape . pathDown ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , b . xPos + b . width ) + c + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , a . height - b . connectionHeight ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawStatementInput _ = function ( a ) { var b = a . getLastInput ( ) , c = b . xPos + b . notchOffset + b . shape . width ; b = b . shape . pathRight + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - ( b . notchOffset - this . constants _ . INSIDE _CORNERS . width ) ) + this . constants _ . INSIDE _CORNERS . pathTop ; var d = a . height - 2 * this . constants _ . INSIDE _CORNERS . height ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , c ) + b + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" ,
d ) + this . constants _ . INSIDE _CORNERS . pathBottom + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a . xPos + a . width ) ; this . positionStatementInputConnection _ ( a ) } ; module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawRightSideRow _ = function ( a ) { this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . yPos + a . height ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawBottom _ = function ( ) { var a = this . info _ . bottomRow , b = a . elements ; this . positionNextConnection _ ( ) ; for ( var c = 0 , d = "" , e = b . length - 1 , f ; f = b [ e ] ; e -- ) module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( f ) ? d += f . shape . pathRight : module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( f ) ? d += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a . xPos ) : module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( f ) ?
d += this . constants _ . OUTSIDE _CORNERS . bottomLeft : module$exports$Blockly$blockRendering$Types . Types . isRightRoundedCorner ( f ) ? ( d += this . constants _ . OUTSIDE _CORNERS . bottomRight , c = this . constants _ . OUTSIDE _CORNERS . rightHeight ) : module$exports$Blockly$blockRendering$Types . Types . isSpacer ( f ) && ( d += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - 1 * f . width ) ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . baseline - c ) ; this . outlinePath _ += d } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawLeft _ = function ( ) { var a = this . info _ . outputConnection ; this . positionOutputConnection _ ( ) ; if ( a ) { var b = a . connectionOffsetY + a . height ; a = "function" === typeof a . shape . pathUp ? a . shape . pathUp ( a . height ) : a . shape . pathUp ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , b ) + a } this . outlinePath _ += "z" } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawInternals _ = function ( ) { for ( var a = 0 , b ; b = this . info _ . rows [ a ] ; a ++ ) for ( var c = 0 , d ; d = b . elements [ c ] ; c ++ ) module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( d ) ? this . drawInlineInput _ ( d ) : ( module$exports$Blockly$blockRendering$Types . Types . isIcon ( d ) || module$exports$Blockly$blockRendering$Types . Types . isField ( d ) ) && this . layoutField _ ( d ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . layoutField _ = function ( a ) { if ( module$exports$Blockly$blockRendering$Types . Types . isField ( a ) ) var b = a . field . getSvgRoot ( ) ; else module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) && ( b = a . icon . iconGroup _ ) ; var c = a . centerline - a . height / 2 , d = a . xPos , e = "" ; this . info _ . RTL && ( d = - ( d + a . width ) , a . flipRtl && ( d += a . width , e = "scale(-1 1)" ) ) ; module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) ? ( b . setAttribute ( "display" , "block" ) , b . setAttribute ( "transform" ,
"translate(" + d + "," + c + ")" ) , a . icon . computeIconLocation ( ) ) : b . setAttribute ( "transform" , "translate(" + d + "," + c + ")" + e ) ; this . info _ . isInsertionMarker && b . setAttribute ( "display" , "none" ) } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . drawInlineInput _ = function ( a ) { var b = a . width , c = a . height , d = a . connectionOffsetY , e = a . connectionHeight + d ; this . inlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( a . xPos + a . connectionWidth , a . centerline - c / 2 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , d ) + a . shape . pathDown + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , c - e ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , b - a . connectionWidth ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" ,
- c ) + "z" ; this . positionInlineInputConnection _ ( a ) } ; module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . positionInlineInputConnection _ = function ( a ) { var b = a . centerline - a . height / 2 ; if ( a . connectionModel ) { var c = a . xPos + a . connectionWidth + a . connectionOffsetX ; this . info _ . RTL && ( c *= - 1 ) ; a . connectionModel . setOffsetInBlock ( c , b + a . connectionOffsetY ) } } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . positionStatementInputConnection _ = function ( a ) { var b = a . getLastInput ( ) ; if ( b . connectionModel ) { var c = a . xPos + a . statementEdge + b . notchOffset ; this . info _ . RTL && ( c *= - 1 ) ; b . connectionModel . setOffsetInBlock ( c , a . yPos ) } } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . positionExternalValueConnection _ = function ( a ) { var b = a . getLastInput ( ) ; if ( b . connectionModel ) { var c = a . xPos + a . width ; this . info _ . RTL && ( c *= - 1 ) ; b . connectionModel . setOffsetInBlock ( c , a . yPos ) } } ; module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . positionPreviousConnection _ = function ( ) { var a = this . info _ . topRow ; if ( a . connection ) { var b = a . xPos + a . notchOffset ; a . connection . connectionModel . setOffsetInBlock ( this . info _ . RTL ? - b : b , 0 ) } } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . positionNextConnection _ = function ( ) { var a = this . info _ . bottomRow ; if ( a . connection ) { var b = a . connection , c = b . xPos ; b . connectionModel . setOffsetInBlock ( this . info _ . RTL ? - c : c , a . baseline ) } } ;
module$exports$Blockly$blockRendering$Drawer . Drawer . prototype . positionOutputConnection _ = function ( ) { if ( this . info _ . outputConnection ) { var a = this . info _ . startX + this . info _ . outputConnection . connectionOffsetX ; this . block _ . outputConnection . setOffsetInBlock ( this . info _ . RTL ? - a : a , this . info _ . outputConnection . connectionOffsetY ) } } ; var module$exports$Blockly$blockRendering$InputConnection = { InputConnection : function ( a , b ) { module$exports$Blockly$blockRendering$InputConnection . InputConnection . superClass _ . constructor . call ( this , a , b . connection ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . INPUT ; this . input = b ; this . align = b . align ; ( this . connectedBlock = b . connection && b . connection . targetBlock ( ) ? b . connection . targetBlock ( ) : null ) ? ( a = this . connectedBlock . getHeightWidth ( ) , this . connectedBlockWidth = a . width , this . connectedBlockHeight =
a . height ) : this . connectedBlockHeight = this . connectedBlockWidth = 0 ; this . connectionOffsetY = this . connectionOffsetX = 0 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$InputConnection . InputConnection , module$exports$Blockly$blockRendering$Connection . Connection ) ; var module$exports$Blockly$blockRendering$ExternalValueInput = { ExternalValueInput : function ( a , b ) { module$exports$Blockly$blockRendering$ExternalValueInput . ExternalValueInput . superClass _ . constructor . call ( this , a , b ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . EXTERNAL _VALUE _INPUT ; this . height = this . connectedBlock ? this . connectedBlockHeight - this . constants _ . TAB _OFFSET _FROM _TOP - this . constants _ . MEDIUM _PADDING : this . shape . height ; this . width = this . shape . width + this . constants _ . EXTERNAL _VALUE _INPUT _PADDING ;
this . connectionOffsetY = this . constants _ . TAB _OFFSET _FROM _TOP ; this . connectionHeight = this . shape . height ; this . connectionWidth = this . shape . width } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$ExternalValueInput . ExternalValueInput , module$exports$Blockly$blockRendering$InputConnection . InputConnection ) ; var module$exports$Blockly$blockRendering$Field = { Field : function ( a , b , c ) { module$exports$Blockly$blockRendering$Field . Field . superClass _ . constructor . call ( this , a ) ; this . field = b ; this . isEditable = b . EDITABLE ; this . flipRtl = b . getFlipRtl ( ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . FIELD ; a = this . field . getSize ( ) ; this . height = a . height ; this . width = a . width ; this . parentInput = c } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$Field . Field , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$blockRendering$Hat = { Hat : function ( a ) { module$exports$Blockly$blockRendering$Hat . Hat . superClass _ . constructor . call ( this , a ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . HAT ; this . height = this . constants _ . START _HAT . height ; this . width = this . constants _ . START _HAT . width ; this . ascenderHeight = this . height } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$Hat . Hat , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$blockRendering$IPathObject = { IPathObject : function ( a , b ) { } } ; var module$exports$Blockly$blockRendering$Icon = { Icon : function ( a , b ) { module$exports$Blockly$blockRendering$Icon . Icon . superClass _ . constructor . call ( this , a ) ; this . icon = b ; this . isVisible = b . isVisible ( ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . ICON ; a = b . getCorrectedSize ( ) ; this . height = a . height ; this . width = a . width } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$Icon . Icon , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$blockRendering$InRowSpacer = { InRowSpacer : function ( a , b ) { module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer . superClass _ . constructor . call ( this , a ) ; this . type = this . type | module$exports$Blockly$blockRendering$Types . Types . SPACER | module$exports$Blockly$blockRendering$Types . Types . IN _ROW _SPACER ; this . width = b ; this . height = this . constants _ . SPACER _DEFAULT _HEIGHT } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$blockRendering$InlineInput = { InlineInput : function ( a , b ) { module$exports$Blockly$blockRendering$InlineInput . InlineInput . superClass _ . constructor . call ( this , a , b ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . INLINE _INPUT ; this . connectedBlock ? ( this . width = this . connectedBlockWidth , this . height = this . connectedBlockHeight ) : ( this . height = this . constants _ . EMPTY _INLINE _INPUT _HEIGHT , this . width = this . constants _ . EMPTY _INLINE _INPUT _PADDING ) ; this . connectionHeight = this . isDynamicShape ?
this . shape . height ( this . height ) : this . shape . height ; this . connectionWidth = this . isDynamicShape ? this . shape . width ( this . height ) : this . shape . width ; this . connectedBlock || ( this . width += this . connectionWidth * ( this . isDynamicShape ? 2 : 1 ) ) ; this . connectionOffsetY = this . isDynamicShape ? this . shape . connectionOffsetY ( this . connectionHeight ) : this . constants _ . TAB _OFFSET _FROM _TOP ; this . connectionOffsetX = this . isDynamicShape ? this . shape . connectionOffsetX ( this . connectionWidth ) : 0 } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$InlineInput . InlineInput , module$exports$Blockly$blockRendering$InputConnection . InputConnection ) ; var module$exports$Blockly$blockRendering$InputRow = { InputRow : function ( a ) { module$exports$Blockly$blockRendering$InputRow . InputRow . superClass _ . constructor . call ( this , a ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . INPUT _ROW ; this . connectedBlockWidths = 0 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$InputRow . InputRow , module$exports$Blockly$blockRendering$Row . Row ) ;
module$exports$Blockly$blockRendering$InputRow . InputRow . prototype . measure = function ( ) { this . width = this . minWidth ; this . height = this . minHeight ; for ( var a = 0 , b = 0 ; b < this . elements . length ; b ++ ) { var c = this . elements [ b ] ; this . width += c . width ; module$exports$Blockly$blockRendering$Types . Types . isInput ( c ) && ( module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( c ) ? a += c . connectedBlockWidth : module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( c ) && 0 !== c . connectedBlockWidth && ( a += c . connectedBlockWidth -
c . connectionWidth ) ) ; module$exports$Blockly$blockRendering$Types . Types . isSpacer ( c ) || ( this . height = Math . max ( this . height , c . height ) ) } this . connectedBlockWidths = a ; this . widthWithConnectedBlocks = this . width + a } ; module$exports$Blockly$blockRendering$InputRow . InputRow . prototype . endsWithElemSpacer = function ( ) { return ! this . hasExternalInput && ! this . hasStatement } ; var module$exports$Blockly$blockRendering$JaggedEdge = { JaggedEdge : function ( a ) { module$exports$Blockly$blockRendering$JaggedEdge . JaggedEdge . superClass _ . constructor . call ( this , a ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . JAGGED _EDGE ; this . height = this . constants _ . JAGGED _TEETH . height ; this . width = this . constants _ . JAGGED _TEETH . width } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$JaggedEdge . JaggedEdge , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$ASTNode = { ASTNode : function ( a , b , c ) { if ( ! b ) throw Error ( "Cannot create a node without a location." ) ; this . type _ = a ; this . isConnection _ = module$exports$Blockly$ASTNode . ASTNode . isConnectionType _ ( a ) ; this . location _ = b ; this . wsCoordinate _ = null ; this . processParams _ ( c || null ) } } ; module$exports$Blockly$ASTNode . ASTNode . types = { FIELD : "field" , BLOCK : "block" , INPUT : "input" , OUTPUT : "output" , NEXT : "next" , PREVIOUS : "previous" , STACK : "stack" , WORKSPACE : "workspace" } ;
module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS = ! 1 ; module$exports$Blockly$ASTNode . ASTNode . DEFAULT _OFFSET _Y = - 20 ; module$exports$Blockly$ASTNode . ASTNode . isConnectionType _ = function ( a ) { switch ( a ) { case module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS : case module$exports$Blockly$ASTNode . ASTNode . types . NEXT : case module$exports$Blockly$ASTNode . ASTNode . types . INPUT : case module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT : return ! 0 } return ! 1 } ;
module$exports$Blockly$ASTNode . ASTNode . createFieldNode = function ( a ) { return a ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . FIELD , a ) : null } ;
module$exports$Blockly$ASTNode . ASTNode . createConnectionNode = function ( a ) { if ( ! a ) return null ; var b = a . type ; return b === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE || b === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT && a . getParentInput ( ) ? module$exports$Blockly$ASTNode . ASTNode . createInputNode ( a . getParentInput ( ) ) : b === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . NEXT ,
a ) : b === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT , a ) : b === $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS , a ) : null } ;
module$exports$Blockly$ASTNode . ASTNode . createInputNode = function ( a ) { return a && a . connection ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . INPUT , a . connection ) : null } ; module$exports$Blockly$ASTNode . ASTNode . createBlockNode = function ( a ) { return a ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . BLOCK , a ) : null } ;
module$exports$Blockly$ASTNode . ASTNode . createStackNode = function ( a ) { return a ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . STACK , a ) : null } ; module$exports$Blockly$ASTNode . ASTNode . createWorkspaceNode = function ( a , b ) { return b && a ? new module$exports$Blockly$ASTNode . ASTNode ( module$exports$Blockly$ASTNode . ASTNode . types . WORKSPACE , a , { wsCoordinate : b } ) : null } ;
var module$contents$Blockly$ASTNode _getParentConnection = function ( a ) { var b = a . outputConnection ; if ( ! b || a . previousConnection && a . previousConnection . isConnected ( ) ) b = a . previousConnection ; return b } ; module$exports$Blockly$ASTNode . ASTNode . createTopNode = function ( a ) { var b = module$contents$Blockly$ASTNode _getParentConnection ( a ) ; return b ? module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( b ) : module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( a ) } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . processParams _ = function ( a ) { a && a . wsCoordinate && ( this . wsCoordinate _ = a . wsCoordinate ) } ; module$exports$Blockly$ASTNode . ASTNode . prototype . getLocation = function ( ) { return this . location _ } ; module$exports$Blockly$ASTNode . ASTNode . prototype . getType = function ( ) { return this . type _ } ; module$exports$Blockly$ASTNode . ASTNode . prototype . getWsCoordinate = function ( ) { return this . wsCoordinate _ } ; module$exports$Blockly$ASTNode . ASTNode . prototype . isConnection = function ( ) { return this . isConnection _ } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . findNextForInput _ = function ( ) { var a = this . location _ . getParentInput ( ) , b = a . getSourceBlock ( ) ; for ( a = b . inputList . indexOf ( a ) + 1 ; a < b . inputList . length ; a ++ ) { for ( var c = b . inputList [ a ] , d = c . fieldRow , e = 0 ; e < d . length ; e ++ ) { var f = d [ e ] ; if ( f . isClickable ( ) || module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS ) return module$exports$Blockly$ASTNode . ASTNode . createFieldNode ( f ) } if ( c . connection ) return module$exports$Blockly$ASTNode . ASTNode . createInputNode ( c ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . findNextForField _ = function ( ) { var a = this . location _ , b = a . getParentInput ( ) , c = a . getSourceBlock ( ) , d = c . inputList . indexOf ( b ) ; for ( a = b . fieldRow . indexOf ( a ) + 1 ; d < c . inputList . length ; d ++ ) { b = c . inputList [ d ] ; for ( var e = b . fieldRow ; a < e . length ; ) { if ( e [ a ] . isClickable ( ) || module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS ) return module$exports$Blockly$ASTNode . ASTNode . createFieldNode ( e [ a ] ) ; a ++ } a = 0 ; if ( b . connection ) return module$exports$Blockly$ASTNode . ASTNode . createInputNode ( b ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . findPrevForInput _ = function ( ) { for ( var a = this . location _ . getParentInput ( ) , b = a . getSourceBlock ( ) , c = b . inputList . indexOf ( a ) ; 0 <= c ; c -- ) { var d = b . inputList [ c ] ; if ( d . connection && d !== a ) return module$exports$Blockly$ASTNode . ASTNode . createInputNode ( d ) ; d = d . fieldRow ; for ( var e = d . length - 1 ; 0 <= e ; e -- ) { var f = d [ e ] ; if ( f . isClickable ( ) || module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS ) return module$exports$Blockly$ASTNode . ASTNode . createFieldNode ( f ) } } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . findPrevForField _ = function ( ) { var a = this . location _ , b = a . getParentInput ( ) , c = a . getSourceBlock ( ) , d = c . inputList . indexOf ( b ) ; for ( a = b . fieldRow . indexOf ( a ) - 1 ; 0 <= d ; d -- ) { var e = c . inputList [ d ] ; if ( e . connection && e !== b ) return module$exports$Blockly$ASTNode . ASTNode . createInputNode ( e ) ; for ( e = e . fieldRow ; - 1 < a ; ) { if ( e [ a ] . isClickable ( ) || module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS ) return module$exports$Blockly$ASTNode . ASTNode . createFieldNode ( e [ a ] ) ; a -- } 0 <= d - 1 &&
( a = c . inputList [ d - 1 ] . fieldRow . length - 1 ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . navigateBetweenStacks _ = function ( a ) { var b = this . getLocation ( ) ; b . getSourceBlock && ( b = b . getSourceBlock ( ) ) ; if ( ! b || ! b . workspace ) return null ; var c = b . getRootBlock ( ) ; b = c . workspace . getTopBlocks ( ! 0 ) ; for ( var d = 0 ; d < b . length ; d ++ ) if ( c . id === b [ d ] . id ) return a = d + ( a ? 1 : - 1 ) , - 1 === a || a === b . length ? null : module$exports$Blockly$ASTNode . ASTNode . createStackNode ( b [ a ] ) ; throw Error ( "Couldn't find " + ( a ? "next" : "previous" ) + " stack?!" ) ; } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . findTopASTNodeForBlock _ = function ( a ) { var b = module$contents$Blockly$ASTNode _getParentConnection ( a ) ; return b ? module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( b ) : module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( a ) } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . getOutAstNodeForBlock _ = function ( a ) { if ( ! a ) return null ; a = a . getTopStackBlock ( ) ; var b = module$contents$Blockly$ASTNode _getParentConnection ( a ) ; return b && b . targetConnection && b . targetConnection . getParentInput ( ) ? module$exports$Blockly$ASTNode . ASTNode . createInputNode ( b . targetConnection . getParentInput ( ) ) : module$exports$Blockly$ASTNode . ASTNode . createStackNode ( a ) } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . findFirstFieldOrInput _ = function ( a ) { a = a . inputList ; for ( var b = 0 ; b < a . length ; b ++ ) { for ( var c = a [ b ] , d = c . fieldRow , e = 0 ; e < d . length ; e ++ ) { var f = d [ e ] ; if ( f . isClickable ( ) || module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS ) return module$exports$Blockly$ASTNode . ASTNode . createFieldNode ( f ) } if ( c . connection ) return module$exports$Blockly$ASTNode . ASTNode . createInputNode ( c ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . getSourceBlock = function ( ) { return this . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . BLOCK ? this . getLocation ( ) : this . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . STACK ? this . getLocation ( ) : this . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . WORKSPACE ? null : this . getLocation ( ) . getSourceBlock ( ) } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . next = function ( ) { switch ( this . type _ ) { case module$exports$Blockly$ASTNode . ASTNode . types . STACK : return this . navigateBetweenStacks _ ( ! 0 ) ; case module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT : return module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( this . location _ . getSourceBlock ( ) ) ; case module$exports$Blockly$ASTNode . ASTNode . types . FIELD : return this . findNextForField _ ( ) ; case module$exports$Blockly$ASTNode . ASTNode . types . INPUT : return this . findNextForInput _ ( ) ;
case module$exports$Blockly$ASTNode . ASTNode . types . BLOCK : return module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( this . location _ . nextConnection ) ; case module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS : return module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( this . location _ . getSourceBlock ( ) ) ; case module$exports$Blockly$ASTNode . ASTNode . types . NEXT : return module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( this . location _ . targetConnection ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . in = function ( ) { switch ( this . type _ ) { case module$exports$Blockly$ASTNode . ASTNode . types . WORKSPACE : var a = this . location _ . getTopBlocks ( ! 0 ) ; if ( 0 < a . length ) return module$exports$Blockly$ASTNode . ASTNode . createStackNode ( a [ 0 ] ) ; break ; case module$exports$Blockly$ASTNode . ASTNode . types . STACK : return this . findTopASTNodeForBlock _ ( this . location _ ) ; case module$exports$Blockly$ASTNode . ASTNode . types . BLOCK : return this . findFirstFieldOrInput _ ( this . location _ ) ; case module$exports$Blockly$ASTNode . ASTNode . types . INPUT : return module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( this . location _ . targetConnection ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . prev = function ( ) { switch ( this . type _ ) { case module$exports$Blockly$ASTNode . ASTNode . types . STACK : return this . navigateBetweenStacks _ ( ! 1 ) ; case module$exports$Blockly$ASTNode . ASTNode . types . FIELD : return this . findPrevForField _ ( ) ; case module$exports$Blockly$ASTNode . ASTNode . types . INPUT : return this . findPrevForInput _ ( ) ; case module$exports$Blockly$ASTNode . ASTNode . types . BLOCK : var a = module$contents$Blockly$ASTNode _getParentConnection ( this . location _ ) ; return module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( a ) ;
case module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS : if ( ( a = this . location _ . targetConnection ) && ! a . getParentInput ( ) ) return module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( a ) ; break ; case module$exports$Blockly$ASTNode . ASTNode . types . NEXT : return module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( this . location _ . getSourceBlock ( ) ) } return null } ;
module$exports$Blockly$ASTNode . ASTNode . prototype . out = function ( ) { switch ( this . type _ ) { case module$exports$Blockly$ASTNode . ASTNode . types . STACK : var a = this . location _ , b = a . getRelativeToSurfaceXY ( ) ; b = new module$exports$Blockly$utils$Coordinate . Coordinate ( b . x , b . y + module$exports$Blockly$ASTNode . ASTNode . DEFAULT _OFFSET _Y ) ; return module$exports$Blockly$ASTNode . ASTNode . createWorkspaceNode ( a . workspace , b ) ; case module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT : return a = this . location _ , ( b = a . targetConnection ) ? module$exports$Blockly$ASTNode . ASTNode . createConnectionNode ( b ) :
module$exports$Blockly$ASTNode . ASTNode . createStackNode ( a . getSourceBlock ( ) ) ; case module$exports$Blockly$ASTNode . ASTNode . types . FIELD : return module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( this . location _ . getSourceBlock ( ) ) ; case module$exports$Blockly$ASTNode . ASTNode . types . INPUT : return module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( this . location _ . getSourceBlock ( ) ) ; case module$exports$Blockly$ASTNode . ASTNode . types . BLOCK : return this . getOutAstNodeForBlock _ ( this . location _ ) ; case module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS : return this . getOutAstNodeForBlock _ ( this . location _ . getSourceBlock ( ) ) ;
case module$exports$Blockly$ASTNode . ASTNode . types . NEXT : return this . getOutAstNodeForBlock _ ( this . location _ . getSourceBlock ( ) ) } return null } ; var module$exports$Blockly$Events$MarkerMove = { MarkerMove : function ( a , b , c , d ) { var e = a ? a . workspace . id : void 0 ; d && d . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . WORKSPACE && ( e = d . getLocation ( ) . id ) ; module$exports$Blockly$Events$MarkerMove . MarkerMove . superClass _ . constructor . call ( this , e ) ; this . blockId = a ? a . id : null ; this . oldNode = c ; this . newNode = d ; this . isCursor = b } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$MarkerMove . MarkerMove , module$exports$Blockly$Events$UiBase . UiBase ) ;
module$exports$Blockly$Events$MarkerMove . MarkerMove . prototype . type = module$exports$Blockly$Events$utils . MARKER _MOVE ; module$exports$Blockly$Events$MarkerMove . MarkerMove . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$MarkerMove . MarkerMove . superClass _ . toJson . call ( this ) ; a . isCursor = this . isCursor ; a . blockId = this . blockId ; a . oldNode = this . oldNode ; a . newNode = this . newNode ; return a } ;
module$exports$Blockly$Events$MarkerMove . MarkerMove . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$MarkerMove . MarkerMove . superClass _ . fromJson . call ( this , a ) ; this . isCursor = a . isCursor ; this . blockId = a . blockId ; this . oldNode = a . oldNode ; this . newNode = a . newNode } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . MARKER _MOVE , module$exports$Blockly$Events$MarkerMove . MarkerMove ) ; var module$exports$Blockly$blockRendering$MarkerSvg = { } , module$contents$Blockly$blockRendering$MarkerSvg _CURSOR _CLASS = "blocklyCursor" , module$contents$Blockly$blockRendering$MarkerSvg _MARKER _CLASS = "blocklyMarker" , module$contents$Blockly$blockRendering$MarkerSvg _HEIGHT _MULTIPLIER = . 75 ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg = function ( a , b , c ) { this . workspace _ = a ; this . marker _ = c ; this . parent _ = null ; this . constants _ = b ; this . currentMarkerSvg = null ; a = this . isCursor ( ) ? this . constants _ . CURSOR _COLOUR : this . constants _ . MARKER _COLOUR ; this . colour _ = c . colour || a } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . getSvgRoot = function ( ) { return this . svgGroup _ } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . getMarker = function ( ) { return this . marker _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . isCursor = function ( ) { return "cursor" === this . marker _ . type } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . createDom = function ( ) { var a = this . isCursor ( ) ? module$contents$Blockly$blockRendering$MarkerSvg _CURSOR _CLASS : module$contents$Blockly$blockRendering$MarkerSvg _MARKER _CLASS ; this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : a } , null ) ; this . createDomInternal _ ( ) ; return this . svgGroup _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . setParent _ = function ( a ) { this . isCursor ( ) ? ( this . parent _ && this . parent _ . setCursorSvg ( null ) , a . setCursorSvg ( this . getSvgRoot ( ) ) ) : ( this . parent _ && this . parent _ . setMarkerSvg ( null ) , a . setMarkerSvg ( this . getSvgRoot ( ) ) ) ; this . parent _ = a } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . draw = function ( a , b ) { if ( b ) { this . constants _ = this . workspace _ . getRenderer ( ) . getConstants ( ) ; var c = this . isCursor ( ) ? this . constants _ . CURSOR _COLOUR : this . constants _ . MARKER _COLOUR ; this . colour _ = this . marker _ . colour || c ; this . applyColour _ ( b ) ; this . showAtLocation _ ( b ) ; this . fireMarkerEvent _ ( a , b ) ; a = this . currentMarkerSvg . childNodes [ 0 ] ; void 0 !== a && a . beginElement && a . beginElement ( ) } else this . hide ( ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showAtLocation _ = function ( a ) { var b = a . getLocation ( ) . type ; a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . BLOCK ? this . showWithBlock _ ( a ) : a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT ? this . showWithOutput _ ( a ) : b === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE ? this . showWithInput _ ( a ) : b === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ? this . showWithNext _ ( a ) : a . getType ( ) ===
module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS ? this . showWithPrevious _ ( a ) : a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . FIELD ? this . showWithField _ ( a ) : a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . WORKSPACE ? this . showWithCoordinates _ ( a ) : a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . STACK && this . showWithStack _ ( a ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithBlockPrevOutput _ = function ( a ) { a = a . getSourceBlock ( ) ; var b = a . width , c = a . height , d = c * module$contents$Blockly$blockRendering$MarkerSvg _HEIGHT _MULTIPLIER , e = this . constants _ . CURSOR _BLOCK _PADDING ; a . previousConnection ? ( c = this . constants _ . shapeFor ( a . previousConnection ) , this . positionPrevious _ ( b , e , d , c ) ) : a . outputConnection ? ( d = this . constants _ . shapeFor ( a . outputConnection ) , this . positionOutput _ ( b , c , d ) ) : this . positionBlock _ ( b , e , d ) ; this . setParent _ ( a ) ;
this . showCurrent _ ( ) } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithBlock _ = function ( a ) { this . showWithBlockPrevOutput _ ( a ) } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithPrevious _ = function ( a ) { this . showWithBlockPrevOutput _ ( a ) } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithOutput _ = function ( a ) { this . showWithBlockPrevOutput _ ( a ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithCoordinates _ = function ( a ) { var b = a . getWsCoordinate ( ) ; a = b . x ; b = b . y ; this . workspace _ . RTL && ( a -= this . constants _ . CURSOR _WS _WIDTH ) ; this . positionLine _ ( a , b , this . constants _ . CURSOR _WS _WIDTH ) ; this . setParent _ ( this . workspace _ ) ; this . showCurrent _ ( ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithField _ = function ( a ) { a = a . getLocation ( ) ; var b = a . getSize ( ) . width , c = a . getSize ( ) . height ; this . positionRect _ ( 0 , 0 , b , c ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithInput _ = function ( a ) { a = a . getLocation ( ) ; var b = a . getSourceBlock ( ) ; this . positionInput _ ( a ) ; this . setParent _ ( b ) ; this . showCurrent _ ( ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithNext _ = function ( a ) { var b = a . getLocation ( ) ; a = b . getSourceBlock ( ) ; var c = 0 ; b = b . getOffsetInBlock ( ) . y ; var d = a . getHeightWidth ( ) . width ; this . workspace _ . RTL && ( c = - d ) ; this . positionLine _ ( c , b , d ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showWithStack _ = function ( a ) { a = a . getLocation ( ) ; var b = a . getHeightWidth ( ) , c = b . width + this . constants _ . CURSOR _STACK _PADDING ; b = b . height + this . constants _ . CURSOR _STACK _PADDING ; var d = - this . constants _ . CURSOR _STACK _PADDING / 2 , e = - this . constants _ . CURSOR _STACK _PADDING / 2 , f = d ; this . workspace _ . RTL && ( f = - ( c + d ) ) ; this . positionRect _ ( f , e , c , b ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . showCurrent _ = function ( ) { this . hide ( ) ; this . currentMarkerSvg . style . display = "" } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . positionBlock _ = function ( a , b , c ) { a = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - b , c ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , - b ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a + 2 * b ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , c ) ; this . markerBlock _ . setAttribute ( "d" , a ) ; this . workspace _ . RTL && this . flipRtl _ ( this . markerBlock _ ) ; this . currentMarkerSvg = this . markerBlock _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . positionInput _ = function ( a ) { var b = a . getOffsetInBlock ( ) . x , c = a . getOffsetInBlock ( ) . y ; a = ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( 0 , 0 ) + this . constants _ . shapeFor ( a ) . pathDown ; this . markerInput _ . setAttribute ( "d" , a ) ; this . markerInput _ . setAttribute ( "transform" , "translate(" + b + "," + c + ")" + ( this . workspace _ . RTL ? " scale(-1 1)" : "" ) ) ; this . currentMarkerSvg = this . markerInput _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . positionLine _ = function ( a , b , c ) { this . markerSvgLine _ . setAttribute ( "x" , a ) ; this . markerSvgLine _ . setAttribute ( "y" , b ) ; this . markerSvgLine _ . setAttribute ( "width" , c ) ; this . currentMarkerSvg = this . markerSvgLine _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . positionOutput _ = function ( a , b , c ) { a = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( a , 0 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - ( a - c . width ) ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , this . constants _ . TAB _OFFSET _FROM _TOP ) + c . pathDown + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , b ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a ) ; this . markerBlock _ . setAttribute ( "d" , a ) ; this . workspace _ . RTL &&
this . flipRtl _ ( this . markerBlock _ ) ; this . currentMarkerSvg = this . markerBlock _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . positionPrevious _ = function ( a , b , c , d ) { a = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - b , c ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , - b ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , this . constants _ . NOTCH _OFFSET _LEFT ) + d . pathLeft + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a + 2 * b ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , c ) ; this . markerBlock _ . setAttribute ( "d" , a ) ; this . workspace _ . RTL &&
this . flipRtl _ ( this . markerBlock _ ) ; this . currentMarkerSvg = this . markerBlock _ } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . positionRect _ = function ( a , b , c , d ) { this . markerSvgRect _ . setAttribute ( "x" , a ) ; this . markerSvgRect _ . setAttribute ( "y" , b ) ; this . markerSvgRect _ . setAttribute ( "width" , c ) ; this . markerSvgRect _ . setAttribute ( "height" , d ) ; this . currentMarkerSvg = this . markerSvgRect _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . flipRtl _ = function ( a ) { a . setAttribute ( "transform" , "scale(-1 1)" ) } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . hide = function ( ) { this . markerSvgLine _ . style . display = "none" ; this . markerSvgRect _ . style . display = "none" ; this . markerInput _ . style . display = "none" ; this . markerBlock _ . style . display = "none" } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . fireMarkerEvent _ = function ( a , b ) { var c = b . getSourceBlock ( ) ; a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . MARKER _MOVE ) ) ( c , this . isCursor ( ) , a , b ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . getBlinkProperties _ = function ( ) { return { attributeType : "XML" , attributeName : "fill" , dur : "1s" , values : this . colour _ + ";transparent;transparent;" , repeatCount : "indefinite" } } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . createDomInternal _ = function ( ) { this . markerSvg _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { width : this . constants _ . CURSOR _WS _WIDTH , height : this . constants _ . WS _CURSOR _HEIGHT } , this . svgGroup _ ) ; this . markerSvgLine _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { width : this . constants _ . CURSOR _WS _WIDTH , height : this . constants _ . WS _CURSOR _HEIGHT , style : "display: none" } ,
this . markerSvg _ ) ; this . markerSvgRect _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyVerticalMarker" , rx : 10 , ry : 10 , style : "display: none" } , this . markerSvg _ ) ; this . markerInput _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { transform : "" , style : "display: none" } , this . markerSvg _ ) ; this . markerBlock _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { transform : "" ,
style : "display: none" , fill : "none" , "stroke-width" : this . constants _ . CURSOR _STROKE _WIDTH } , this . markerSvg _ ) ; if ( this . isCursor ( ) ) { var a = this . getBlinkProperties _ ( ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . ANIMATE , a , this . markerSvgLine _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . ANIMATE , a , this . markerInput _ ) ; a . attributeName = "stroke" ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . ANIMATE ,
a , this . markerBlock _ ) } return this . markerSvg _ } ;
module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . applyColour _ = function ( a ) { this . markerSvgLine _ . setAttribute ( "fill" , this . colour _ ) ; this . markerSvgRect _ . setAttribute ( "stroke" , this . colour _ ) ; this . markerInput _ . setAttribute ( "fill" , this . colour _ ) ; this . markerBlock _ . setAttribute ( "stroke" , this . colour _ ) ; this . isCursor ( ) && ( a = this . colour _ + ";transparent;transparent;" , this . markerSvgLine _ . firstChild . setAttribute ( "values" , a ) , this . markerInput _ . firstChild . setAttribute ( "values" , a ) , this . markerBlock _ . firstChild . setAttribute ( "values" ,
a ) ) } ; module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg . prototype . dispose = function ( ) { this . svgGroup _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) } ; var module$exports$Blockly$blockRendering$NextConnection = { NextConnection : function ( a , b ) { module$exports$Blockly$blockRendering$NextConnection . NextConnection . superClass _ . constructor . call ( this , a , b ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . NEXT _CONNECTION ; this . height = this . shape . height ; this . width = this . shape . width } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$NextConnection . NextConnection , module$exports$Blockly$blockRendering$Connection . Connection ) ; var module$exports$Blockly$blockRendering$OutputConnection = { OutputConnection : function ( a , b ) { module$exports$Blockly$blockRendering$OutputConnection . OutputConnection . superClass _ . constructor . call ( this , a , b ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . OUTPUT _CONNECTION ; this . height = this . isDynamicShape ? 0 : this . shape . height ; this . startX = this . width = this . isDynamicShape ? 0 : this . shape . width ; this . connectionOffsetY = this . constants _ . TAB _OFFSET _FROM _TOP ; this . connectionOffsetX = 0 } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$OutputConnection . OutputConnection , module$exports$Blockly$blockRendering$Connection . Connection ) ; var module$exports$Blockly$blockRendering$PathObject = { PathObject : function ( a , b , c ) { this . constants = c ; this . svgRoot = a ; this . svgPath = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyPath" } , this . svgRoot ) ; this . style = b ; this . markerSvg = this . cursorSvg = null } } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . setPath = function ( a ) { this . svgPath . setAttribute ( "d" , a ) } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . flipRTL = function ( ) { this . svgPath . setAttribute ( "transform" , "scale(-1 1)" ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . setCursorSvg = function ( a ) { a ? ( this . svgRoot . appendChild ( a ) , this . cursorSvg = a ) : this . cursorSvg = null } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . setMarkerSvg = function ( a ) { a ? ( this . cursorSvg ? this . svgRoot . insertBefore ( a , this . cursorSvg ) : this . svgRoot . appendChild ( a ) , this . markerSvg = a ) : this . markerSvg = null } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . applyColour = function ( a ) { this . svgPath . setAttribute ( "stroke" , this . style . colourTertiary ) ; this . svgPath . setAttribute ( "fill" , this . style . colourPrimary ) ; this . updateShadow _ ( a . isShadow ( ) ) ; this . updateDisabled _ ( ! a . isEnabled ( ) || a . getInheritedDisabled ( ) ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . setStyle = function ( a ) { this . style = a } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . setClass _ = function ( a , b ) { b ? ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgRoot , a ) : ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgRoot , a ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateHighlighted = function ( a ) { a ? this . svgPath . setAttribute ( "filter" , "url(#" + this . constants . embossFilterId + ")" ) : this . svgPath . setAttribute ( "filter" , "none" ) } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateShadow _ = function ( a ) { a && ( this . svgPath . setAttribute ( "stroke" , "none" ) , this . svgPath . setAttribute ( "fill" , this . style . colourSecondary ) ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateDisabled _ = function ( a ) { this . setClass _ ( "blocklyDisabled" , a ) ; a && this . svgPath . setAttribute ( "fill" , "url(#" + this . constants . disabledPatternId + ")" ) } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateSelected = function ( a ) { this . setClass _ ( "blocklySelected" , a ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateDraggingDelete = function ( a ) { this . setClass _ ( "blocklyDraggingDelete" , a ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateInsertionMarker = function ( a ) { this . setClass _ ( "blocklyInsertionMarker" , a ) } ;
module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateMovable = function ( a ) { this . setClass _ ( "blocklyDraggable" , a ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateReplacementFade = function ( a ) { this . setClass _ ( "blocklyReplaceable" , a ) } ; module$exports$Blockly$blockRendering$PathObject . PathObject . prototype . updateShapeForInputHighlight = function ( a , b ) { } ; var module$exports$Blockly$blockRendering$PreviousConnection = { PreviousConnection : function ( a , b ) { module$exports$Blockly$blockRendering$PreviousConnection . PreviousConnection . superClass _ . constructor . call ( this , a , b ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . PREVIOUS _CONNECTION ; this . height = this . shape . height ; this . width = this . shape . width } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$PreviousConnection . PreviousConnection , module$exports$Blockly$blockRendering$Connection . Connection ) ; $ . module$exports$Blockly$Input = { Align : { LEFT : - 1 , CENTRE : 0 , RIGHT : 1 } , Input : function ( a , b , c , d ) { if ( a !== $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY && ! b ) throw Error ( "Value inputs and statement inputs must have non-empty name." ) ; this . type = a ; this . name = b ; this . sourceBlock _ = c ; this . connection = d ; this . fieldRow = [ ] } } ; $ . module$exports$Blockly$Input . Input . prototype . align = $ . module$exports$Blockly$Input . Align . LEFT ; $ . module$exports$Blockly$Input . Input . prototype . visible _ = ! 0 ;
$ . module$exports$Blockly$Input . Input . prototype . getSourceBlock = function ( ) { return this . sourceBlock _ } ; $ . module$exports$Blockly$Input . Input . prototype . appendField = function ( a , b ) { this . insertFieldAt ( this . fieldRow . length , a , b ) ; return this } ;
$ . module$exports$Blockly$Input . Input . prototype . insertFieldAt = function ( a , b , c ) { if ( 0 > a || a > this . fieldRow . length ) throw Error ( "index " + a + " out of bounds." ) ; if ( ! ( b || "" === b && c ) ) return a ; "string" === typeof b && ( b = ( 0 , module$exports$Blockly$fieldRegistry . fromJson ) ( { type : "field_label" , text : b } ) ) ; b . setSourceBlock ( this . sourceBlock _ ) ; this . sourceBlock _ . rendered && ( b . init ( ) , b . applyColour ( ) ) ; b . name = c ; b . setVisible ( this . isVisible ( ) ) ; b . prefixField && ( a = this . insertFieldAt ( a , b . prefixField ) ) ; this . fieldRow . splice ( a , 0 , b ) ; a ++ ; b . suffixField &&
( a = this . insertFieldAt ( a , b . suffixField ) ) ; this . sourceBlock _ . rendered && ( this . sourceBlock _ = this . sourceBlock _ , this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours ( ) ) ; return a } ;
$ . module$exports$Blockly$Input . Input . prototype . removeField = function ( a , b ) { for ( var c = 0 , d ; d = this . fieldRow [ c ] ; c ++ ) if ( d . name === a ) return d . dispose ( ) , this . fieldRow . splice ( c , 1 ) , this . sourceBlock _ . rendered && ( this . sourceBlock _ = this . sourceBlock _ , this . sourceBlock _ . render ( ) , this . sourceBlock _ . bumpNeighbours ( ) ) , ! 0 ; if ( b ) return ! 1 ; throw Error ( 'Field "' + a + '" not found.' ) ; } ; $ . module$exports$Blockly$Input . Input . prototype . isVisible = function ( ) { return this . visible _ } ;
$ . module$exports$Blockly$Input . Input . prototype . setVisible = function ( a ) { var b = [ ] ; if ( this . visible _ === a ) return b ; this . visible _ = a ; for ( var c = 0 , d ; d = this . fieldRow [ c ] ; c ++ ) d . setVisible ( a ) ; this . connection && ( this . connection = this . connection , a ? b = this . connection . startTrackingAll ( ) : this . connection . stopTrackingAll ( ) , c = this . connection . targetBlock ( ) ) && ( c . getSvgRoot ( ) . style . display = a ? "block" : "none" ) ; return b } ; $ . module$exports$Blockly$Input . Input . prototype . markDirty = function ( ) { for ( var a = 0 , b ; b = this . fieldRow [ a ] ; a ++ ) b . markDirty ( ) } ;
$ . module$exports$Blockly$Input . Input . prototype . setCheck = function ( a ) { if ( ! this . connection ) throw Error ( "This input does not have a connection." ) ; this . connection . setCheck ( a ) ; return this } ; $ . module$exports$Blockly$Input . Input . prototype . setAlign = function ( a ) { this . align = a ; this . sourceBlock _ . rendered && ( this . sourceBlock _ = this . sourceBlock _ , this . sourceBlock _ . render ( ) ) ; return this } ;
$ . module$exports$Blockly$Input . Input . prototype . setShadowDom = function ( a ) { if ( ! this . connection ) throw Error ( "This input does not have a connection." ) ; this . connection . setShadowDom ( a ) ; return this } ; $ . module$exports$Blockly$Input . Input . prototype . getShadowDom = function ( ) { if ( ! this . connection ) throw Error ( "This input does not have a connection." ) ; return this . connection . getShadowDom ( ) } ; $ . module$exports$Blockly$Input . Input . prototype . init = function ( ) { if ( this . sourceBlock _ . workspace . rendered ) for ( var a = 0 ; a < this . fieldRow . length ; a ++ ) this . fieldRow [ a ] . init ( ) } ;
$ . module$exports$Blockly$Input . Input . prototype . dispose = function ( ) { for ( var a = 0 , b ; b = this . fieldRow [ a ] ; a ++ ) b . dispose ( ) ; this . connection && this . connection . dispose ( ) ; this . sourceBlock _ = null } ; var module$exports$Blockly$blockRendering$RoundCorner = { RoundCorner : function ( a , b ) { module$exports$Blockly$blockRendering$RoundCorner . RoundCorner . superClass _ . constructor . call ( this , a ) ; this . type = ( b && "left" !== b ? module$exports$Blockly$blockRendering$Types . Types . RIGHT _ROUND _CORNER : module$exports$Blockly$blockRendering$Types . Types . LEFT _ROUND _CORNER ) | module$exports$Blockly$blockRendering$Types . Types . CORNER ; this . width = this . constants _ . CORNER _RADIUS ; this . height = this . constants _ . CORNER _RADIUS / 2 } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$RoundCorner . RoundCorner , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$blockRendering$SpacerRow = { SpacerRow : function ( a , b , c ) { module$exports$Blockly$blockRendering$SpacerRow . SpacerRow . superClass _ . constructor . call ( this , a ) ; this . type = this . type | module$exports$Blockly$blockRendering$Types . Types . SPACER | module$exports$Blockly$blockRendering$Types . Types . BETWEEN _ROW _SPACER ; this . width = c ; this . height = b ; this . followsStatement = ! 1 ; this . widthWithConnectedBlocks = 0 ; this . elements = [ new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ ,
c ) ] } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$SpacerRow . SpacerRow , module$exports$Blockly$blockRendering$Row . Row ) ; module$exports$Blockly$blockRendering$SpacerRow . SpacerRow . prototype . measure = function ( ) { } ; var module$exports$Blockly$blockRendering$SquareCorner = { SquareCorner : function ( a , b ) { module$exports$Blockly$blockRendering$SquareCorner . SquareCorner . superClass _ . constructor . call ( this , a ) ; this . type = ( b && "left" !== b ? module$exports$Blockly$blockRendering$Types . Types . RIGHT _SQUARE _CORNER : module$exports$Blockly$blockRendering$Types . Types . LEFT _SQUARE _CORNER ) | module$exports$Blockly$blockRendering$Types . Types . CORNER ; this . width = this . height = this . constants _ . NO _PADDING } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$SquareCorner . SquareCorner , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$blockRendering$StatementInput = { StatementInput : function ( a , b ) { module$exports$Blockly$blockRendering$StatementInput . StatementInput . superClass _ . constructor . call ( this , a , b ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . STATEMENT _INPUT ; this . height = this . connectedBlock ? this . connectedBlockHeight + this . constants _ . STATEMENT _BOTTOM _SPACER : this . constants _ . EMPTY _STATEMENT _INPUT _HEIGHT ; this . width = this . constants _ . STATEMENT _INPUT _NOTCH _OFFSET + this . shape . width } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$StatementInput . StatementInput , module$exports$Blockly$blockRendering$InputConnection . InputConnection ) ; var module$exports$Blockly$blockRendering$TopRow = { TopRow : function ( a ) { module$exports$Blockly$blockRendering$TopRow . TopRow . superClass _ . constructor . call ( this , a ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . TOP _ROW ; this . ascenderHeight = this . capline = 0 ; this . hasPreviousConnection = ! 1 ; this . connection = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$blockRendering$TopRow . TopRow , module$exports$Blockly$blockRendering$Row . Row ) ;
module$exports$Blockly$blockRendering$TopRow . TopRow . prototype . hasLeftSquareCorner = function ( a ) { var b = ( a . hat ? "cap" === a . hat : this . constants _ . ADD _START _HATS ) && ! a . outputConnection && ! a . previousConnection , c = a . getPreviousBlock ( ) ; return ! ! a . outputConnection || b || ( c ? c . getNextBlock ( ) === a : ! 1 ) } ; module$exports$Blockly$blockRendering$TopRow . TopRow . prototype . hasRightSquareCorner = function ( a ) { return ! 0 } ;
module$exports$Blockly$blockRendering$TopRow . TopRow . prototype . measure = function ( ) { for ( var a = 0 , b = 0 , c = 0 , d = 0 ; d < this . elements . length ; d ++ ) { var e = this . elements [ d ] ; b += e . width ; module$exports$Blockly$blockRendering$Types . Types . isSpacer ( e ) || ( module$exports$Blockly$blockRendering$Types . Types . isHat ( e ) ? c = Math . max ( c , e . ascenderHeight ) : a = Math . max ( a , e . height ) ) } this . width = Math . max ( this . minWidth , b ) ; this . height = Math . max ( this . minHeight , a ) + c ; this . capline = this . ascenderHeight = c ; this . widthWithConnectedBlocks = this . width } ;
module$exports$Blockly$blockRendering$TopRow . TopRow . prototype . startsWithElemSpacer = function ( ) { return ! 1 } ; module$exports$Blockly$blockRendering$TopRow . TopRow . prototype . endsWithElemSpacer = function ( ) { return ! 1 } ; var module$exports$Blockly$blockRendering$RenderInfo = { RenderInfo : function ( a , b ) { this . block _ = b ; this . renderer _ = a ; this . constants _ = this . renderer _ . getConstants ( ) ; this . outputConnection = b . outputConnection ? new module$exports$Blockly$blockRendering$OutputConnection . OutputConnection ( this . constants _ , b . outputConnection ) : null ; this . isInline = b . getInputsInline ( ) && ! b . isCollapsed ( ) ; this . isCollapsed = b . isCollapsed ( ) ; this . isInsertionMarker = b . isInsertionMarker ( ) ; this . RTL = b . RTL ; this . statementEdge = this . width = this . widthWithChildren =
this . height = 0 ; this . rows = [ ] ; this . inputRows = [ ] ; this . hiddenIcons = [ ] ; this . topRow = new module$exports$Blockly$blockRendering$TopRow . TopRow ( this . constants _ ) ; this . bottomRow = new module$exports$Blockly$blockRendering$BottomRow . BottomRow ( this . constants _ ) ; this . startY = this . startX = 0 } } ; module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . getRenderer = function ( ) { return this . renderer _ } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . measure = function ( ) { this . createRows _ ( ) ; this . addElemSpacing _ ( ) ; this . addRowSpacing _ ( ) ; this . computeBounds _ ( ) ; this . alignRowElements _ ( ) ; this . finalize _ ( ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . createRows _ = function ( ) { this . populateTopRow _ ( ) ; this . rows . push ( this . topRow ) ; var a = new module$exports$Blockly$blockRendering$InputRow . InputRow ( this . constants _ ) ; this . inputRows . push ( a ) ; for ( var b = this . block _ . getIcons ( ) , c = 0 , d ; d = b [ c ] ; c ++ ) { var e = new module$exports$Blockly$blockRendering$Icon . Icon ( this . constants _ , d ) ; this . isCollapsed && d . collapseHidden ? this . hiddenIcons . push ( e ) : a . elements . push ( e ) } d = null ; for ( b = 0 ; c = this . block _ . inputList [ b ] ; b ++ ) if ( c . isVisible ( ) ) { this . shouldStartNewRow _ ( c ,
d ) && ( this . rows . push ( a ) , a = new module$exports$Blockly$blockRendering$InputRow . InputRow ( this . constants _ ) , this . inputRows . push ( a ) ) ; for ( d = 0 ; e = c . fieldRow [ d ] ; d ++ ) a . elements . push ( new module$exports$Blockly$blockRendering$Field . Field ( this . constants _ , e , c ) ) ; this . addInput _ ( c , a ) ; d = c } this . isCollapsed && ( a . hasJaggedEdge = ! 0 , a . elements . push ( new module$exports$Blockly$blockRendering$JaggedEdge . JaggedEdge ( this . constants _ ) ) ) ; ( a . elements . length || a . hasDummyInput ) && this . rows . push ( a ) ; this . populateBottomRow _ ( ) ; this . rows . push ( this . bottomRow ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . populateTopRow _ = function ( ) { var a = ! ! this . block _ . previousConnection , b = ( this . block _ . hat ? "cap" === this . block _ . hat : this . constants _ . ADD _START _HATS ) && ! this . outputConnection && ! a , c = this . topRow . hasLeftSquareCorner ( this . block _ ) ? module$exports$Blockly$blockRendering$SquareCorner . SquareCorner : module$exports$Blockly$blockRendering$RoundCorner . RoundCorner ; this . topRow . elements . push ( new c ( this . constants _ ) ) ; b ? ( a = new module$exports$Blockly$blockRendering$Hat . Hat ( this . constants _ ) ,
this . topRow . elements . push ( a ) , this . topRow . capline = a . ascenderHeight ) : a && ( this . topRow . hasPreviousConnection = ! 0 , this . topRow . connection = new module$exports$Blockly$blockRendering$PreviousConnection . PreviousConnection ( this . constants _ , this . block _ . previousConnection ) , this . topRow . elements . push ( this . topRow . connection ) ) ; this . block _ . inputList . length && this . block _ . inputList [ 0 ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT && ! this . block _ . isCollapsed ( ) ? this . topRow . minHeight = this . constants _ . TOP _ROW _PRECEDES _STATEMENT _MIN _HEIGHT :
this . topRow . minHeight = this . constants _ . TOP _ROW _MIN _HEIGHT ; c = this . topRow . hasRightSquareCorner ( this . block _ ) ? module$exports$Blockly$blockRendering$SquareCorner . SquareCorner : module$exports$Blockly$blockRendering$RoundCorner . RoundCorner ; this . topRow . elements . push ( new c ( this . constants _ , "right" ) ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . populateBottomRow _ = function ( ) { this . bottomRow . hasNextConnection = ! ! this . block _ . nextConnection ; this . bottomRow . minHeight = this . block _ . inputList . length && this . block _ . inputList [ this . block _ . inputList . length - 1 ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ? this . constants _ . BOTTOM _ROW _AFTER _STATEMENT _MIN _HEIGHT : this . constants _ . BOTTOM _ROW _MIN _HEIGHT ; this . bottomRow . hasLeftSquareCorner ( this . block _ ) ? this . bottomRow . elements . push ( new module$exports$Blockly$blockRendering$SquareCorner . SquareCorner ( this . constants _ ) ) :
this . bottomRow . elements . push ( new module$exports$Blockly$blockRendering$RoundCorner . RoundCorner ( this . constants _ ) ) ; this . bottomRow . hasNextConnection && ( this . bottomRow . connection = new module$exports$Blockly$blockRendering$NextConnection . NextConnection ( this . constants _ , this . block _ . nextConnection ) , this . bottomRow . elements . push ( this . bottomRow . connection ) ) ; this . bottomRow . hasRightSquareCorner ( this . block _ ) ? this . bottomRow . elements . push ( new module$exports$Blockly$blockRendering$SquareCorner . SquareCorner ( this . constants _ ,
"right" ) ) : this . bottomRow . elements . push ( new module$exports$Blockly$blockRendering$RoundCorner . RoundCorner ( this . constants _ , "right" ) ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . addInput _ = function ( a , b ) { this . isInline && a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ? ( b . elements . push ( new module$exports$Blockly$blockRendering$InlineInput . InlineInput ( this . constants _ , a ) ) , b . hasInlineInput = ! 0 ) : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ? ( b . elements . push ( new module$exports$Blockly$blockRendering$StatementInput . StatementInput ( this . constants _ , a ) ) , b . hasStatement = ! 0 ) : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ?
( b . elements . push ( new module$exports$Blockly$blockRendering$ExternalValueInput . ExternalValueInput ( this . constants _ , a ) ) , b . hasExternalInput = ! 0 ) : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY && ( b . minHeight = Math . max ( b . minHeight , a . getSourceBlock ( ) && a . getSourceBlock ( ) . isShadow ( ) ? this . constants _ . DUMMY _INPUT _SHADOW _MIN _HEIGHT : this . constants _ . DUMMY _INPUT _MIN _HEIGHT ) , b . hasDummyInput = ! 0 ) ; null === b . align && ( b . align = a . align ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . shouldStartNewRow _ = function ( a , b ) { return b ? a . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT || b . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ? ! 0 : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE || a . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ? ! this . isInline : ! 1 : ! 1 } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . addElemSpacing _ = function ( ) { for ( var a = 0 , b ; b = this . rows [ a ] ; a ++ ) { var c = b . elements ; b . elements = [ ] ; b . startsWithElemSpacer ( ) && b . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , this . getInRowSpacing _ ( null , c [ 0 ] ) ) ) ; if ( c . length ) { for ( var d = 0 ; d < c . length - 1 ; d ++ ) { b . elements . push ( c [ d ] ) ; var e = this . getInRowSpacing _ ( c [ d ] , c [ d + 1 ] ) ; b . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ ,
e ) ) } b . elements . push ( c [ c . length - 1 ] ) ; b . endsWithElemSpacer ( ) && b . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , this . getInRowSpacing _ ( c [ c . length - 1 ] , null ) ) ) } } } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . getInRowSpacing _ = function ( a , b ) { if ( ! a && b && module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ) return this . constants _ . STATEMENT _INPUT _PADDING _LEFT ; if ( a && module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) && ! b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( a ) ) return this . constants _ . NO _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( a ) ) return this . constants _ . LARGE _PADDING ;
if ( module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( a ) ) return this . constants _ . NO _PADDING } return a && module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( a ) && b && ( module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( b ) || module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ) ? b . notchOffset : a && module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a ) && b && ( module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( b ) ||
module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ) ? b . notchOffset - this . constants _ . CORNER _RADIUS : this . constants _ . MEDIUM _PADDING } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . computeBounds _ = function ( ) { for ( var a = 0 , b = 0 , c = 0 , d = 0 , e ; e = this . rows [ d ] ; d ++ ) { e . measure ( ) ; b = Math . max ( b , e . width ) ; if ( e . hasStatement ) { var f = e . getLastInput ( ) ; a = Math . max ( a , e . width - f . width ) } c = Math . max ( c , e . widthWithConnectedBlocks ) } this . statementEdge = a ; this . width = b ; for ( a = 0 ; d = this . rows [ a ] ; a ++ ) d . hasStatement && ( d . statementEdge = this . statementEdge ) ; this . widthWithChildren = Math . max ( b , c ) ; this . outputConnection && ( this . startX = this . outputConnection . width ,
this . width += this . outputConnection . width , this . widthWithChildren += this . outputConnection . width ) } ; module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . alignRowElements _ = function ( ) { for ( var a = 0 , b ; b = this . rows [ a ] ; a ++ ) if ( b . hasStatement ) this . alignStatementRow _ ( b ) ; else { var c = b . width ; c = this . getDesiredRowWidth _ ( b ) - c ; 0 < c && this . addAlignmentPadding _ ( b , c ) ; module$exports$Blockly$blockRendering$Types . Types . isTopOrBottomRow ( b ) && ( b . widthWithConnectedBlocks = b . width ) } } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . getDesiredRowWidth _ = function ( a ) { return this . width - this . startX } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . addAlignmentPadding _ = function ( a , b ) { var c = a . getFirstSpacer ( ) , d = a . getLastSpacer ( ) ; if ( a . hasExternalInput || a . hasStatement ) a . widthWithConnectedBlocks += b ; a . align === $ . module$exports$Blockly$Input . Align . LEFT ? d . width += b : a . align === $ . module$exports$Blockly$Input . Align . CENTRE ? ( c . width += b / 2 , d . width += b / 2 ) : a . align === $ . module$exports$Blockly$Input . Align . RIGHT ? c . width += b : d . width += b ; a . width += b } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . alignStatementRow _ = function ( a ) { var b = a . getLastInput ( ) , c = a . width - b . width , d = this . statementEdge ; c = d - c ; 0 < c && this . addAlignmentPadding _ ( a , c ) ; c = a . width ; d = this . getDesiredRowWidth _ ( a ) ; b . width += d - c ; b . height = Math . max ( b . height , a . height ) ; a . width += d - c ; a . widthWithConnectedBlocks = Math . max ( a . width , this . statementEdge + a . connectedBlockWidths ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . addRowSpacing _ = function ( ) { var a = this . rows ; this . rows = [ ] ; for ( var b = 0 ; b < a . length ; b ++ ) this . rows . push ( a [ b ] ) , b !== a . length - 1 && this . rows . push ( this . makeSpacerRow _ ( a [ b ] , a [ b + 1 ] ) ) } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . makeSpacerRow _ = function ( a , b ) { var c = this . getSpacerRowHeight _ ( a , b ) , d = this . getSpacerRowWidth _ ( a , b ) ; c = new module$exports$Blockly$blockRendering$SpacerRow . SpacerRow ( this . constants _ , c , d ) ; a . hasStatement && ( c . followsStatement = ! 0 ) ; b . hasStatement && ( c . precedesStatement = ! 0 ) ; return c } ; module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . getSpacerRowWidth _ = function ( a , b ) { return this . width - this . startX } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . getSpacerRowHeight _ = function ( a , b ) { return this . constants _ . MEDIUM _PADDING } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . getElemCenterline _ = function ( a , b ) { return module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) ? a . yPos + b . height / 2 : module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( a ) ? ( a = a . yPos + a . height - a . descenderHeight , module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ? a + b . height / 2 : a - b . height / 2 ) : module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) ? module$exports$Blockly$blockRendering$Types . Types . isHat ( b ) ?
a . capline - b . height / 2 : a . capline + b . height / 2 : a . yPos + a . height / 2 } ; module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . recordElemPositions _ = function ( a ) { for ( var b = a . xPos , c = 0 , d ; d = a . elements [ c ] ; c ++ ) module$exports$Blockly$blockRendering$Types . Types . isSpacer ( d ) && ( d . height = a . height ) , d . xPos = b , d . centerline = this . getElemCenterline _ ( a , d ) , b += d . width } ;
module$exports$Blockly$blockRendering$RenderInfo . RenderInfo . prototype . finalize _ = function ( ) { for ( var a = 0 , b = 0 , c = 0 , d ; d = this . rows [ c ] ; c ++ ) d . yPos = b , d . xPos = this . startX , b += d . height , a = Math . max ( a , d . widthWithConnectedBlocks ) , this . recordElemPositions _ ( d ) ; this . outputConnection && this . block _ . nextConnection && this . block _ . nextConnection . isConnected ( ) && ( a = Math . max ( a , this . block _ . nextConnection . targetBlock ( ) . getHeightWidth ( ) . width ) ) ; this . widthWithChildren = a + this . startX ; this . height = b ; this . startY = this . topRow . capline ; this . bottomRow . baseline =
b - this . bottomRow . descenderHeight } ; var module$exports$Blockly$blockRendering$Renderer = { Renderer : function ( a ) { this . name = a ; this . overrides = this . constants _ = null } } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . getClassName = function ( ) { return this . name + "-renderer" } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . init = function ( a , b ) { this . constants _ = this . makeConstants _ ( ) ; b && ( this . overrides = b , ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( this . constants _ , b ) ) ; this . constants _ . setTheme ( a ) ; this . constants _ . init ( ) } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . createDom = function ( a , b ) { this . constants _ . createDom ( a , this . name + "-" + b . name , "." + this . getClassName ( ) + "." + b . getClassName ( ) ) } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . refreshDom = function ( a , b ) { var c = this . getConstants ( ) ; c . dispose ( ) ; this . constants _ = this . makeConstants _ ( ) ; this . overrides && ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( this . constants _ , this . overrides ) ; this . constants _ . randomIdentifier = c . randomIdentifier ; this . constants _ . setTheme ( b ) ; this . constants _ . init ( ) ; this . createDom ( a , b ) } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . dispose = function ( ) { this . constants _ && this . constants _ . dispose ( ) } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . makeConstants _ = function ( ) { return new module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . makeRenderInfo _ = function ( a ) { return new module$exports$Blockly$blockRendering$RenderInfo . RenderInfo ( this , a ) } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . makeDrawer _ = function ( a , b ) { return new module$exports$Blockly$blockRendering$Drawer . Drawer ( a , b ) } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . makeDebugger _ = function ( ) { var a = module$exports$Blockly$blockRendering$Debug . Debug ; if ( ! a ) throw Error ( "Missing require for Blockly.blockRendering.Debug" ) ; return new a ( this . getConstants ( ) ) } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . makeMarkerDrawer = function ( a , b ) { return new module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg ( a , this . getConstants ( ) , b ) } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . makePathObject = function ( a , b ) { return new module$exports$Blockly$blockRendering$PathObject . PathObject ( a , b , this . constants _ ) } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . getConstants = function ( ) { return this . constants _ } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . shouldHighlightConnection = function ( a ) { return ! 0 } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . orphanCanConnectAtEnd = function ( a , b , c ) { return ! ! module$exports$Blockly$Connection . Connection . getConnectionForOrphanedConnection ( a , c === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ? b . outputConnection : b . previousConnection ) } ;
module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . getConnectionPreviewMethod = function ( a , b , c ) { return b . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE || b . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ? ! a . isConnected ( ) || this . orphanCanConnectAtEnd ( c , a . targetBlock ( ) , b . type ) ? module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . INSERTION _MARKER : module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . REPLACEMENT _FADE :
module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . INSERTION _MARKER } ; module$exports$Blockly$blockRendering$Renderer . Renderer . prototype . render = function ( a ) { ( 0 , module$exports$Blockly$blockRendering$debug . isDebuggerEnabled ) ( ) && ! a . renderingDebugger && ( a . renderingDebugger = this . makeDebugger _ ( ) ) ; var b = this . makeRenderInfo _ ( a ) ; b . measure ( ) ; this . makeDrawer _ ( a , b ) . draw ( ) } ; var module$exports$Blockly$blockRendering = { isDebuggerEnabled : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.blockRendering.isDebuggerEnabled()" , "September 2021" , "September 2022" , "Blockly.blockRendering.debug.isDebuggerEnabled()" ) ; return ( 0 , module$exports$Blockly$blockRendering$debug . isDebuggerEnabled ) ( ) } , register : function ( a , b ) { ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . RENDERER , a , b ) } , unregister : function ( a ) { ( 0 , module$exports$Blockly$registry . unregister ) ( module$exports$Blockly$registry . Type . RENDERER ,
a ) } , startDebugger : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.blockRendering.startDebugger()" , "September 2021" , "September 2022" , "Blockly.blockRendering.debug.startDebugger()" ) ; ( 0 , module$exports$Blockly$blockRendering$debug . startDebugger ) ( ) } , stopDebugger : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.blockRendering.stopDebugger()" , "September 2021" , "September 2022" , "Blockly.blockRendering.debug.stopDebugger()" ) ; ( 0 , module$exports$Blockly$blockRendering$debug . stopDebugger ) ( ) } ,
init : function ( a , b , c ) { a = new ( ( 0 , module$exports$Blockly$registry . getClass ) ( module$exports$Blockly$registry . Type . RENDERER , a ) ) ( a ) ; a . init ( b , c ) ; return a } } ; module$exports$Blockly$blockRendering . BottomRow = module$exports$Blockly$blockRendering$BottomRow . BottomRow ; module$exports$Blockly$blockRendering . Connection = module$exports$Blockly$blockRendering$Connection . Connection ; module$exports$Blockly$blockRendering . ConstantProvider = module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider ;
module$exports$Blockly$blockRendering . Debug = module$exports$Blockly$blockRendering$Debug . Debug ; module$exports$Blockly$blockRendering . Drawer = module$exports$Blockly$blockRendering$Drawer . Drawer ; module$exports$Blockly$blockRendering . ExternalValueInput = module$exports$Blockly$blockRendering$ExternalValueInput . ExternalValueInput ; module$exports$Blockly$blockRendering . Field = module$exports$Blockly$blockRendering$Field . Field ; module$exports$Blockly$blockRendering . Hat = module$exports$Blockly$blockRendering$Hat . Hat ;
module$exports$Blockly$blockRendering . Icon = module$exports$Blockly$blockRendering$Icon . Icon ; module$exports$Blockly$blockRendering . InRowSpacer = module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ; module$exports$Blockly$blockRendering . InlineInput = module$exports$Blockly$blockRendering$InlineInput . InlineInput ; module$exports$Blockly$blockRendering . InputConnection = module$exports$Blockly$blockRendering$InputConnection . InputConnection ; module$exports$Blockly$blockRendering . InputRow = module$exports$Blockly$blockRendering$InputRow . InputRow ;
module$exports$Blockly$blockRendering . IPathObject = module$exports$Blockly$blockRendering$IPathObject . IPathObject ; module$exports$Blockly$blockRendering . JaggedEdge = module$exports$Blockly$blockRendering$JaggedEdge . JaggedEdge ; module$exports$Blockly$blockRendering . MarkerSvg = module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg ; module$exports$Blockly$blockRendering . Measurable = module$exports$Blockly$blockRendering$Measurable . Measurable ; module$exports$Blockly$blockRendering . NextConnection = module$exports$Blockly$blockRendering$NextConnection . NextConnection ;
module$exports$Blockly$blockRendering . OutputConnection = module$exports$Blockly$blockRendering$OutputConnection . OutputConnection ; module$exports$Blockly$blockRendering . PathObject = module$exports$Blockly$blockRendering$PathObject . PathObject ; module$exports$Blockly$blockRendering . PreviousConnection = module$exports$Blockly$blockRendering$PreviousConnection . PreviousConnection ; module$exports$Blockly$blockRendering . Renderer = module$exports$Blockly$blockRendering$Renderer . Renderer ;
module$exports$Blockly$blockRendering . RenderInfo = module$exports$Blockly$blockRendering$RenderInfo . RenderInfo ; module$exports$Blockly$blockRendering . RoundCorner = module$exports$Blockly$blockRendering$RoundCorner . RoundCorner ; module$exports$Blockly$blockRendering . Row = module$exports$Blockly$blockRendering$Row . Row ; module$exports$Blockly$blockRendering . SpacerRow = module$exports$Blockly$blockRendering$SpacerRow . SpacerRow ; module$exports$Blockly$blockRendering . SquareCorner = module$exports$Blockly$blockRendering$SquareCorner . SquareCorner ;
module$exports$Blockly$blockRendering . StatementInput = module$exports$Blockly$blockRendering$StatementInput . StatementInput ; module$exports$Blockly$blockRendering . TopRow = module$exports$Blockly$blockRendering$TopRow . TopRow ; module$exports$Blockly$blockRendering . Types = module$exports$Blockly$blockRendering$Types . Types ; module$exports$Blockly$blockRendering . debug = module$exports$Blockly$blockRendering$debug ; var module$contents$Blockly$Extensions _allExtensions ; $ . module$exports$Blockly$Extensions = { } ; module$contents$Blockly$Extensions _allExtensions = Object . create ( null ) ; $ . module$exports$Blockly$Extensions . TEST _ONLY = { allExtensions : module$contents$Blockly$Extensions _allExtensions } ;
$ . module$exports$Blockly$Extensions . register = function ( a , b ) { if ( "string" !== typeof a || "" === a . trim ( ) ) throw Error ( 'Error: Invalid extension name "' + a + '"' ) ; if ( module$contents$Blockly$Extensions _allExtensions [ a ] ) throw Error ( 'Error: Extension "' + a + '" is already registered.' ) ; if ( "function" !== typeof b ) throw Error ( 'Error: Extension "' + a + '" must be a function' ) ; module$contents$Blockly$Extensions _allExtensions [ a ] = b } ;
$ . module$exports$Blockly$Extensions . registerMixin = function ( a , b ) { if ( ! b || "object" !== typeof b ) throw Error ( 'Error: Mixin "' + a + '" must be a object' ) ; ( 0 , $ . module$exports$Blockly$Extensions . register ) ( a , function ( ) { this . mixin ( b ) } ) } ;
$ . module$exports$Blockly$Extensions . registerMutator = function ( a , b , c , d ) { var e = 'Error when registering mutator "' + a + '": ' ; module$contents$Blockly$Extensions _checkHasMutatorProperties ( e , b ) ; var f = module$contents$Blockly$Extensions _checkMutatorDialog ( b , e ) ; if ( c && "function" !== typeof c ) throw Error ( e + 'Extension "' + a + '" is not a function' ) ; ( 0 , $ . module$exports$Blockly$Extensions . register ) ( a , function ( ) { if ( f ) { var g = $ . module$exports$Blockly$Mutator . Mutator ; if ( ! g ) throw Error ( e + "Missing require for Blockly.Mutator" ) ;
this . setMutator ( new g ( d || [ ] ) ) } this . mixin ( b ) ; c && c . apply ( this ) } ) } ; $ . module$exports$Blockly$Extensions . unregister = function ( a ) { ( 0 , $ . module$exports$Blockly$Extensions . isRegistered ) ( a ) ? delete module$contents$Blockly$Extensions _allExtensions [ a ] : console . warn ( 'No extension mapping for name "' + a + '" found to unregister' ) } ; $ . module$exports$Blockly$Extensions . isRegistered = function ( a ) { return ! ! module$contents$Blockly$Extensions _allExtensions [ a ] } ;
$ . module$exports$Blockly$Extensions . apply = function ( a , b , c ) { var d = module$contents$Blockly$Extensions _allExtensions [ a ] ; if ( "function" !== typeof d ) throw Error ( 'Error: Extension "' + a + '" not found.' ) ; var e ; c ? module$contents$Blockly$Extensions _checkNoMutatorProperties ( a , b ) : e = module$contents$Blockly$Extensions _getMutatorProperties ( b ) ; d . apply ( b ) ; if ( c ) module$contents$Blockly$Extensions _checkHasMutatorProperties ( 'Error after applying mutator "' + a + '": ' , b ) ; else if ( ! module$contents$Blockly$Extensions _mutatorPropertiesMatch ( e ,
b ) ) throw Error ( 'Error when applying extension "' + a + '": mutation properties changed when applying a non-mutator extension.' ) ; } ;
var module$contents$Blockly$Extensions _checkNoMutatorProperties = function ( a , b ) { if ( module$contents$Blockly$Extensions _getMutatorProperties ( b ) . length ) throw Error ( 'Error: tried to apply mutation "' + a + '" to a block that already has mutator functions. Block id: ' + b . id ) ; } , module$contents$Blockly$Extensions _checkXmlHooks = function ( a , b ) { return module$contents$Blockly$Extensions _checkHasFunctionPair ( a . mutationToDom , a . domToMutation , b + " mutationToDom/domToMutation" ) } , module$contents$Blockly$Extensions _checkJsonHooks =
function ( a , b ) { return module$contents$Blockly$Extensions _checkHasFunctionPair ( a . saveExtraState , a . loadExtraState , b + " saveExtraState/loadExtraState" ) } , module$contents$Blockly$Extensions _checkMutatorDialog = function ( a , b ) { return module$contents$Blockly$Extensions _checkHasFunctionPair ( a . compose , a . decompose , b + " compose/decompose" ) } , module$contents$Blockly$Extensions _checkHasFunctionPair = function ( a , b , c ) { if ( a && b ) { if ( "function" !== typeof a || "function" !== typeof b ) throw Error ( c + " must be a function" ) ; return ! 0 } if ( ! a &&
! b ) return ! 1 ; throw Error ( c + "Must have both or neither functions" ) ; } , module$contents$Blockly$Extensions _checkHasMutatorProperties = function ( a , b ) { var c = module$contents$Blockly$Extensions _checkXmlHooks ( b , a ) , d = module$contents$Blockly$Extensions _checkJsonHooks ( b , a ) ; if ( ! c && ! d ) throw Error ( a + "Mutations must contain either XML hooks, or JSON hooks, or both" ) ; module$contents$Blockly$Extensions _checkMutatorDialog ( b , a ) } , module$contents$Blockly$Extensions _getMutatorProperties = function ( a ) { var b = [ ] ; void 0 !== a . domToMutation &&
b . push ( a . domToMutation ) ; void 0 !== a . mutationToDom && b . push ( a . mutationToDom ) ; void 0 !== a . saveExtraState && b . push ( a . saveExtraState ) ; void 0 !== a . loadExtraState && b . push ( a . loadExtraState ) ; void 0 !== a . compose && b . push ( a . compose ) ; void 0 !== a . decompose && b . push ( a . decompose ) ; return b } , module$contents$Blockly$Extensions _mutatorPropertiesMatch = function ( a , b ) { b = module$contents$Blockly$Extensions _getMutatorProperties ( b ) ; if ( b . length !== a . length ) return ! 1 ; for ( var c = 0 ; c < b . length ; c ++ ) if ( a [ c ] !== b [ c ] ) return ! 1 ; return ! 0 } ;
$ . module$exports$Blockly$Extensions . runAfterPageLoad = function ( a ) { if ( "object" !== typeof document ) throw Error ( "runAfterPageLoad() requires browser document." ) ; if ( "complete" === document . readyState ) a ( ) ; else var b = setInterval ( function ( ) { "complete" === document . readyState && ( clearInterval ( b ) , a ( ) ) } , 10 ) } ;
$ . module$exports$Blockly$Extensions . buildTooltipForDropdown = function ( a , b ) { var c = [ ] ; "object" === typeof document && ( 0 , $ . module$exports$Blockly$Extensions . runAfterPageLoad ) ( function ( ) { for ( var d in b ) ( 0 , module$exports$Blockly$utils$parsing . checkMessageReferences ) ( b [ d ] ) } ) ; return function ( ) { this . type && - 1 === c . indexOf ( this . type ) && ( module$contents$Blockly$Extensions _checkDropdownOptionsInTable ( this , a , b ) , c . push ( this . type ) ) ; this . setTooltip ( function ( ) { var d = String ( this . getFieldValue ( a ) ) , e = b [ d ] ; null === e ? - 1 === c . indexOf ( this . type ) &&
( d = "No tooltip mapping for value " + d + " of field " + a , null !== this . type && ( d += " of block type " + this . type ) , console . warn ( d + "." ) ) : e = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( e ) ; return e } . bind ( this ) ) } } ;
var module$contents$Blockly$Extensions _checkDropdownOptionsInTable = function ( a , b , c ) { var d = a . getField ( b ) ; if ( ! d . isOptionListDynamic ( ) ) { d = d . getOptions ( ) ; for ( var e = 0 ; e < d . length ; e ++ ) { var f = d [ e ] [ 1 ] ; null === c [ f ] && console . warn ( "No tooltip mapping for value " + f + " of field " + b + " of block type " + a . type ) } } } ;
$ . module$exports$Blockly$Extensions . buildTooltipWithFieldText = function ( a , b ) { "object" === typeof document && ( 0 , $ . module$exports$Blockly$Extensions . runAfterPageLoad ) ( function ( ) { ( 0 , module$exports$Blockly$utils$parsing . checkMessageReferences ) ( a ) } ) ; return function ( ) { this . setTooltip ( function ( ) { var c = this . getField ( b ) ; return ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a ) . replace ( "%1" , c ? c . getText ( ) : "" ) } . bind ( this ) ) } } ;
var module$contents$Blockly$Extensions _extensionParentTooltip = function ( ) { this . tooltipWhenNotConnected = this . tooltip ; this . setTooltip ( function ( ) { var a = this . getParent ( ) ; return a && a . getInputsInline ( ) && a . tooltip || this . tooltipWhenNotConnected } . bind ( this ) ) } ; ( 0 , $ . module$exports$Blockly$Extensions . register ) ( "parent_tooltip_when_inline" , module$contents$Blockly$Extensions _extensionParentTooltip ) ; var module$exports$Blockly$utils$Metrics = { Metrics : function ( ) { } } ; var module$exports$Blockly$utils = { aria : module$exports$Blockly$utils$aria , colour : module$exports$Blockly$utils$colour } ; module$exports$Blockly$utils . Coordinate = module$exports$Blockly$utils$Coordinate . Coordinate ; module$exports$Blockly$utils . deprecation = module$exports$Blockly$utils$deprecation ; module$exports$Blockly$utils . dom = module$exports$Blockly$utils$dom ; module$exports$Blockly$utils . global = $ . module$exports$Blockly$utils$global . globalThis ; module$exports$Blockly$utils . idGenerator = module$exports$Blockly$utils$idGenerator ;
module$exports$Blockly$utils . KeyCodes = module$exports$Blockly$utils$KeyCodes . KeyCodes ; module$exports$Blockly$utils . math = module$exports$Blockly$utils$math ; module$exports$Blockly$utils . Metrics = module$exports$Blockly$utils$Metrics . Metrics ; module$exports$Blockly$utils . object = $ . module$exports$Blockly$utils$object ; module$exports$Blockly$utils . parsing = module$exports$Blockly$utils$parsing ; module$exports$Blockly$utils . Rect = module$exports$Blockly$utils$Rect . Rect ; module$exports$Blockly$utils . Size = module$exports$Blockly$utils$Size . Size ;
module$exports$Blockly$utils . string = $ . module$exports$Blockly$utils$string ; module$exports$Blockly$utils . style = module$exports$Blockly$utils$style ; module$exports$Blockly$utils . Svg = module$exports$Blockly$utils$Svg . Svg ; module$exports$Blockly$utils . svgPaths = module$exports$Blockly$utils$svgPaths ; module$exports$Blockly$utils . svgMath = module$exports$Blockly$utils$svgMath ; module$exports$Blockly$utils . toolbox = module$exports$Blockly$utils$toolbox ; module$exports$Blockly$utils . userAgent = module$exports$Blockly$utils$userAgent ;
module$exports$Blockly$utils . xml = $ . module$exports$Blockly$utils$xml ; module$exports$Blockly$utils . noEvent = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.noEvent" , "September 2021" , "September 2022" ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } ; module$exports$Blockly$utils . isTargetInput = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.isTargetInput" , "September 2021" , "September 2022" , "Blockly.browserEvents.isTargetInput" ) ; return ( 0 , module$exports$Blockly$browserEvents . isTargetInput ) ( a ) } ;
module$exports$Blockly$utils . getRelativeXY = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.getRelativeXY" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getRelativeXY" ) ; return ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( a ) } ; module$exports$Blockly$utils . getInjectionDivXY _ = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.getInjectionDivXY_" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getInjectionDivXY" ) ; return ( 0 , module$exports$Blockly$utils$svgMath . getInjectionDivXY ) ( a ) } ;
module$exports$Blockly$utils . isRightButton = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.isRightButton" , "September 2021" , "September 2022" , "Blockly.browserEvents.isRightButton" ) ; return ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) } ;
module$exports$Blockly$utils . mouseToSvg = function ( a , b , c ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.mouseToSvg" , "September 2021" , "September 2022" , "Blockly.browserEvents.mouseToSvg" ) ; return ( 0 , module$exports$Blockly$browserEvents . mouseToSvg ) ( a , b , c ) } ; module$exports$Blockly$utils . getScrollDeltaPixels = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.getScrollDeltaPixels" , "September 2021" , "September 2022" , "Blockly.browserEvents.getScrollDeltaPixels" ) ; return ( 0 , module$exports$Blockly$browserEvents . getScrollDeltaPixels ) ( a ) } ;
module$exports$Blockly$utils . tokenizeInterpolation = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.tokenizeInterpolation" , "December 2021" , "December 2022" , "Blockly.utils.parsing.tokenizeInterpolation" ) ; return ( 0 , module$exports$Blockly$utils$parsing . tokenizeInterpolation ) ( a ) } ;
module$exports$Blockly$utils . replaceMessageReferences = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.replaceMessageReferences" , "December 2021" , "December 2022" , "Blockly.utils.parsing.replaceMessageReferences" ) ; return ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a ) } ;
module$exports$Blockly$utils . checkMessageReferences = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.checkMessageReferences" , "December 2021" , "December 2022" , "Blockly.utils.parsing.checkMessageReferences" ) ; return ( 0 , module$exports$Blockly$utils$parsing . checkMessageReferences ) ( a ) } ; module$exports$Blockly$utils . genUid = function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.genUid" , "September 2021" , "September 2022" , "Blockly.utils.idGenerator.genUid" ) ; return ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) } ;
module$exports$Blockly$utils . is3dSupported = function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.is3dSupported" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.is3dSupported" ) ; return ( 0 , module$exports$Blockly$utils$svgMath . is3dSupported ) ( ) } ; module$exports$Blockly$utils . getViewportBBox = function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.getViewportBBox" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getViewportBBox" ) ; return ( 0 , module$exports$Blockly$utils$svgMath . getViewportBBox ) ( ) } ;
module$exports$Blockly$utils . arrayRemove = function ( a , b ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.arrayRemove" , "December 2021" , "December 2022" ) ; return ( 0 , module$exports$Blockly$utils$array . removeElem ) ( a , b ) } ; module$exports$Blockly$utils . getDocumentScroll = function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.getDocumentScroll" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.getDocumentScroll" ) ; return ( 0 , module$exports$Blockly$utils$svgMath . getDocumentScroll ) ( ) } ;
module$exports$Blockly$utils . getBlockTypeCounts = function ( a , b ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.getBlockTypeCounts" , "December 2021" , "December 2022" , "Blockly.common.getBlockTypeCounts" ) ; return ( 0 , $ . module$exports$Blockly$common . getBlockTypeCounts ) ( a , b ) } ;
module$exports$Blockly$utils . screenToWsCoordinates = function ( a , b ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.screenToWsCoordinates" , "December 2021" , "December 2022" , "Blockly.utils.svgMath.screenToWsCoordinates" ) ; return ( 0 , module$exports$Blockly$utils$svgMath . screenToWsCoordinates ) ( a , b ) } ;
module$exports$Blockly$utils . parseBlockColour = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.parseBlockColour" , "December 2021" , "December 2022" , "Blockly.utils.parsing.parseBlockColour" ) ; return ( 0 , module$exports$Blockly$utils$parsing . parseBlockColour ) ( a ) } ; module$exports$Blockly$utils . runAfterPageLoad = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.utils.runAfterPageLoad" , "December 2021" , "December 2022" ) ; ( 0 , $ . module$exports$Blockly$Extensions . runAfterPageLoad ) ( a ) } ; var module$exports$Blockly$Events$BlockDelete = { BlockDelete : function ( a ) { module$exports$Blockly$Events$BlockDelete . BlockDelete . superClass _ . constructor . call ( this , a ) ; if ( a ) { if ( a . getParent ( ) ) throw Error ( "Connected blocks cannot be deleted." ) ; a . isShadow ( ) && ( this . recordUndo = ! 1 ) ; this . oldXml = ( 0 , $ . module$exports$Blockly$Xml . blockToDomWithXY ) ( a ) ; this . ids = ( 0 , module$exports$Blockly$Events$utils . getDescendantIds ) ( a ) ; this . wasShadow = a . isShadow ( ) ; this . oldJson = ( 0 , module$exports$Blockly$serialization$blocks . save ) ( a ,
{ addCoordinates : ! 0 } ) } } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BlockDelete . BlockDelete , module$exports$Blockly$Events$BlockBase . BlockBase ) ; module$exports$Blockly$Events$BlockDelete . BlockDelete . prototype . type = module$exports$Blockly$Events$utils . DELETE ;
module$exports$Blockly$Events$BlockDelete . BlockDelete . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BlockDelete . BlockDelete . superClass _ . toJson . call ( this ) ; a . oldXml = ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( this . oldXml ) ; a . ids = this . ids ; a . wasShadow = this . wasShadow ; a . oldJson = this . oldJson ; this . recordUndo || ( a . recordUndo = this . recordUndo ) ; return a } ;
module$exports$Blockly$Events$BlockDelete . BlockDelete . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BlockDelete . BlockDelete . superClass _ . fromJson . call ( this , a ) ; this . oldXml = ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a . oldXml ) ; this . ids = a . ids ; this . wasShadow = a . wasShadow || "shadow" === this . oldXml . tagName . toLowerCase ( ) ; this . oldJson = a . oldJson ; void 0 !== a . recordUndo && ( this . recordUndo = a . recordUndo ) } ;
module$exports$Blockly$Events$BlockDelete . BlockDelete . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) ; if ( a ) for ( a = 0 ; a < this . ids . length ; a ++ ) { var 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 ( 0 , module$exports$Blockly$serialization$blocks . append ) ( this . oldJson , b ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . DELETE , module$exports$Blockly$Events$BlockDelete . BlockDelete ) ; var module$exports$Blockly$Block = { Block : function ( a , b , c ) { var d = $ . module$exports$Blockly$Generator . Generator ; if ( d && "undefined" !== typeof d . prototype [ b ] ) throw Error ( 'Block prototypeName "' + b + '" conflicts with Blockly.Generator members.' ) ; this . id = c && ! a . getBlockById ( c ) ? c : ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; a . setBlockById ( this . id , this ) ; this . previousConnection = this . nextConnection = this . outputConnection = null ; this . inputList = [ ] ; this . inputsInline = void 0 ; this . disabled = ! 1 ; this . tooltip = "" ; this . contextMenu =
! 0 ; this . parentBlock _ = null ; this . childBlocks _ = [ ] ; this . editable _ = this . movable _ = this . deletable _ = ! 0 ; this . collapsed _ = this . isShadow _ = ! 1 ; this . comment = this . outputShape _ = null ; this . commentModel = { text : null , pinned : ! 1 , size : new module$exports$Blockly$utils$Size . Size ( 160 , 80 ) } ; this . xy _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; this . workspace = a ; this . isInFlyout = a . isFlyout ; this . isInMutator = a . isMutator ; this . RTL = a . RTL ; this . isInsertionMarker _ = ! 1 ; this . hat = void 0 ; this . rendered = null ; this . statementInputCount =
0 ; if ( b ) { this . type = b ; c = $ . module$exports$Blockly$blocks . Blocks [ b ] ; if ( ! c || "object" !== typeof c ) throw TypeError ( "Unknown block type: " + b ) ; ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( this , c ) } a . addTopBlock ( this ) ; a . addTypedBlock ( this ) ; ( a = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; b = ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) ; try { "function" === typeof this . init && ( ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( ! 1 ) , this . init ( ) ,
( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( b ) ) , ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CREATE ) ) ( this ) ) } finally { a || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) , ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( b ) } this . inputsInlineDefault = this . inputsInline ; "function" === typeof this . onchange && this . setOnChange ( this . onchange ) } } ;
module$exports$Blockly$Block . Block . COLLAPSED _INPUT _NAME = module$exports$Blockly$constants . COLLAPSED _INPUT _NAME ; module$exports$Blockly$Block . Block . COLLAPSED _FIELD _NAME = module$exports$Blockly$constants . COLLAPSED _FIELD _NAME ; module$exports$Blockly$Block . Block . prototype . data = null ; module$exports$Blockly$Block . Block . prototype . disposed = ! 1 ; module$exports$Blockly$Block . Block . prototype . hue _ = null ; module$exports$Blockly$Block . Block . prototype . colour _ = "#000000" ;
module$exports$Blockly$Block . Block . prototype . styleName _ = "" ;
module$exports$Blockly$Block . Block . prototype . dispose = function ( a ) { if ( this . workspace ) { this . onchangeWrapper _ && this . workspace . removeChangeListener ( this . onchangeWrapper _ ) ; this . unplug ( a ) ; ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . DELETE ) ) ( this ) ) ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { this . workspace && ( this . workspace . removeTopBlock ( this ) , this . workspace . removeTypedBlock ( this ) ,
this . workspace . removeBlockById ( this . id ) , this . workspace = null ) ; ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) === this && ( 0 , $ . module$exports$Blockly$common . setSelected ) ( null ) ; for ( var b = this . childBlocks _ . length - 1 ; 0 <= b ; b -- ) this . childBlocks _ [ b ] . dispose ( ! 1 ) ; a = 0 ; for ( b = void 0 ; b = this . inputList [ a ] ; a ++ ) b . dispose ( ) ; this . inputList . length = 0 ; var c = this . getConnections _ ( ! 0 ) ; a = 0 ; for ( b = void 0 ; b = c [ a ] ; a ++ ) b . dispose ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) , this . disposed = ! 0 } } } ;
module$exports$Blockly$Block . Block . prototype . initModel = function ( ) { for ( var a = 0 , b ; b = this . inputList [ a ] ; a ++ ) for ( var c = 0 , d ; d = b . fieldRow [ c ] ; c ++ ) d . initModel && d . initModel ( ) } ; module$exports$Blockly$Block . Block . prototype . unplug = function ( a ) { this . outputConnection && this . unplugFromRow _ ( a ) ; this . previousConnection && this . unplugFromStack _ ( a ) } ;
module$exports$Blockly$Block . Block . prototype . unplugFromRow _ = function ( a ) { var b = null ; this . outputConnection . isConnected ( ) && ( b = this . outputConnection . targetConnection , this . outputConnection . disconnect ( ) ) ; if ( b && a && ( a = this . getOnlyValueConnection _ ( ) ) && a . isConnected ( ) && ! a . targetBlock ( ) . isShadow ( ) ) if ( a = a . targetConnection , a . disconnect ( ) , this . workspace . connectionChecker . canConnect ( a , b , ! 1 ) ) b . connect ( a ) ; else a . onFailedConnect ( b ) } ;
module$exports$Blockly$Block . Block . prototype . getOnlyValueConnection _ = function ( ) { for ( var a = null , b = 0 ; b < this . inputList . length ; b ++ ) { var c = this . inputList [ b ] . connection ; if ( c && c . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE && c . targetConnection ) { if ( a ) return null ; a = c } } return a } ;
module$exports$Blockly$Block . Block . prototype . unplugFromStack _ = function ( a ) { var b = null ; this . previousConnection . isConnected ( ) && ( b = this . previousConnection . targetConnection , this . previousConnection . disconnect ( ) ) ; var c = this . getNextBlock ( ) ; a && c && ! c . isShadow ( ) && ( a = this . nextConnection . targetConnection , a . disconnect ( ) , b && this . workspace . connectionChecker . canConnect ( b , a , ! 1 ) && b . connect ( a ) ) } ;
module$exports$Blockly$Block . Block . prototype . getConnections _ = function ( a ) { a = [ ] ; this . outputConnection && a . push ( this . outputConnection ) ; this . previousConnection && a . push ( this . previousConnection ) ; this . nextConnection && a . push ( this . nextConnection ) ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) c . connection && a . push ( c . connection ) ; return a } ; module$exports$Blockly$Block . Block . prototype . lastConnectionInStack = function ( a ) { for ( var b = this . nextConnection ; b ; ) { var c = b . targetBlock ( ) ; if ( ! c || a && c . isShadow ( ) ) return b ; b = c . nextConnection } return null } ;
module$exports$Blockly$Block . Block . prototype . bumpNeighbours = function ( ) { } ; module$exports$Blockly$Block . Block . prototype . getParent = function ( ) { return this . parentBlock _ } ; module$exports$Blockly$Block . Block . prototype . getInputWithBlock = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . connection && c . connection . targetBlock ( ) === a ) return c ; return null } ;
module$exports$Blockly$Block . Block . prototype . getSurroundParent = function ( ) { var a = this ; do { var b = a ; a = a . getParent ( ) ; if ( ! a ) return null } while ( a . getNextBlock ( ) === b ) ; return a } ; module$exports$Blockly$Block . Block . prototype . getNextBlock = function ( ) { return this . nextConnection && this . nextConnection . targetBlock ( ) } ; module$exports$Blockly$Block . Block . prototype . getPreviousBlock = function ( ) { return this . previousConnection && this . previousConnection . targetBlock ( ) } ;
module$exports$Blockly$Block . Block . prototype . getFirstStatementConnection = function ( ) { for ( var a = 0 , b ; b = this . inputList [ a ] ; a ++ ) if ( b . connection && b . connection . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ) return b . connection ; return null } ; module$exports$Blockly$Block . Block . prototype . getRootBlock = function ( ) { var a = this ; do { var b = a ; a = b . parentBlock _ } while ( a ) ; return b } ;
module$exports$Blockly$Block . Block . prototype . getTopStackBlock = function ( ) { var a = this ; do var b = a . getPreviousBlock ( ) ; while ( b && b . getNextBlock ( ) === a && ( a = b ) ) ; return a } ; module$exports$Blockly$Block . Block . prototype . getChildren = function ( a ) { if ( ! a ) return this . childBlocks _ ; a = [ ] ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) c . connection && ( c = c . connection . targetBlock ( ) ) && a . push ( c ) ; ( b = this . getNextBlock ( ) ) && a . push ( b ) ; return a } ;
module$exports$Blockly$Block . Block . prototype . setParent = function ( a ) { if ( a !== this . parentBlock _ ) { var b = this . previousConnection && this . previousConnection . targetBlock ( ) || this . outputConnection && this . outputConnection . targetBlock ( ) , c = ! ! b ; if ( c && a && b !== a ) throw Error ( "Block connected to superior one that is not new parent." ) ; if ( ! c && a ) throw Error ( "Block not connected to new parent." ) ; if ( c && ! a ) throw Error ( "Cannot set parent to null while block is still connected to superior block." ) ; this . parentBlock _ ? ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . parentBlock _ . childBlocks _ ,
this ) : this . workspace . removeTopBlock ( this ) ; ( this . parentBlock _ = a ) ? a . childBlocks _ . push ( this ) : this . workspace . addTopBlock ( this ) } } ; module$exports$Blockly$Block . Block . prototype . getDescendants = function ( a ) { for ( var b = [ this ] , c = this . getChildren ( a ) , d , e = 0 ; d = c [ e ] ; e ++ ) b . push . apply ( b , d . getDescendants ( a ) ) ; return b } ; module$exports$Blockly$Block . Block . prototype . isDeletable = function ( ) { return this . deletable _ && ! this . isShadow _ && ! ( this . workspace && this . workspace . options . readOnly ) } ;
module$exports$Blockly$Block . Block . prototype . setDeletable = function ( a ) { this . deletable _ = a } ; module$exports$Blockly$Block . Block . prototype . isMovable = function ( ) { return this . movable _ && ! this . isShadow _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; module$exports$Blockly$Block . Block . prototype . setMovable = function ( a ) { this . movable _ = a } ;
module$exports$Blockly$Block . Block . prototype . isDuplicatable = function ( ) { return this . workspace . hasBlockLimits ( ) ? this . workspace . isCapacityAvailable ( ( 0 , $ . module$exports$Blockly$common . getBlockTypeCounts ) ( this , ! 0 ) ) : ! 0 } ; module$exports$Blockly$Block . Block . prototype . isShadow = function ( ) { return this . isShadow _ } ; module$exports$Blockly$Block . Block . prototype . setShadow = function ( a ) { this . isShadow _ = a } ; module$exports$Blockly$Block . Block . prototype . isInsertionMarker = function ( ) { return this . isInsertionMarker _ } ;
module$exports$Blockly$Block . Block . prototype . setInsertionMarker = function ( a ) { this . isInsertionMarker _ = a } ; module$exports$Blockly$Block . Block . prototype . isEditable = function ( ) { return this . editable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; module$exports$Blockly$Block . Block . prototype . setEditable = function ( a ) { this . editable _ = a ; a = 0 ; for ( var b ; b = this . inputList [ a ] ; a ++ ) for ( var c = 0 , d ; d = b . fieldRow [ c ] ; c ++ ) d . updateEditable ( ) } ; module$exports$Blockly$Block . Block . prototype . isDisposed = function ( ) { return this . disposed } ;
module$exports$Blockly$Block . Block . prototype . getMatchingConnection = function ( a , b ) { var c = this . getConnections _ ( ! 0 ) ; a = a . getConnections _ ( ! 0 ) ; if ( c . length !== a . length ) throw Error ( "Connection lists did not match in length." ) ; for ( var d = 0 ; d < a . length ; d ++ ) if ( a [ d ] === b ) return c [ d ] ; return null } ; module$exports$Blockly$Block . Block . prototype . setHelpUrl = function ( a ) { this . helpUrl = a } ; module$exports$Blockly$Block . Block . prototype . setTooltip = function ( a ) { this . tooltip = a } ;
module$exports$Blockly$Block . Block . prototype . getTooltip = function ( ) { return ( 0 , module$exports$Blockly$Tooltip . getTooltipOfObject ) ( this ) } ; module$exports$Blockly$Block . Block . prototype . getColour = function ( ) { return this . colour _ } ; module$exports$Blockly$Block . Block . prototype . getStyleName = function ( ) { return this . styleName _ } ; module$exports$Blockly$Block . Block . prototype . getHue = function ( ) { return this . hue _ } ;
module$exports$Blockly$Block . Block . prototype . setColour = function ( a ) { a = ( 0 , module$exports$Blockly$utils$parsing . parseBlockColour ) ( a ) ; this . hue _ = a . hue ; this . colour _ = a . hex } ; module$exports$Blockly$Block . Block . prototype . setStyle = function ( a ) { this . styleName _ = a } ;
module$exports$Blockly$Block . Block . prototype . setOnChange = function ( a ) { if ( a && "function" !== typeof a ) throw Error ( "onchange must be a function." ) ; this . onchangeWrapper _ && this . workspace . removeChangeListener ( this . onchangeWrapper _ ) ; if ( this . onchange = a ) this . onchangeWrapper _ = a . bind ( this ) , this . workspace . addChangeListener ( this . onchangeWrapper _ ) } ;
module$exports$Blockly$Block . Block . prototype . getField = function ( a ) { if ( "string" !== typeof a ) throw TypeError ( "Block.prototype.getField expects a string with the field name but received " + ( void 0 === a ? "nothing" : a + " of type " + typeof a ) + " instead" ) ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) if ( e . name === a ) return e ; return null } ;
module$exports$Blockly$Block . Block . prototype . getVars = function ( ) { for ( var a = [ ] , b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && a . push ( e . getValue ( ) ) ; return a } ; module$exports$Blockly$Block . Block . prototype . getVarModels = function ( ) { for ( var a = [ ] , b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && ( e = this . workspace . getVariableById ( e . getValue ( ) ) ) && a . push ( e ) ; return a } ;
module$exports$Blockly$Block . Block . prototype . updateVarName = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) for ( var d = 0 , e ; e = c . fieldRow [ d ] ; d ++ ) e . referencesVariables ( ) && a . getId ( ) === e . getValue ( ) && e . refreshVariableName ( ) } ; module$exports$Blockly$Block . Block . prototype . renameVarById = function ( a , b ) { for ( var c = 0 , d ; d = this . inputList [ c ] ; c ++ ) for ( var e = 0 , f ; f = d . fieldRow [ e ] ; e ++ ) f . referencesVariables ( ) && a === f . getValue ( ) && f . setValue ( b ) } ;
module$exports$Blockly$Block . Block . prototype . getFieldValue = function ( a ) { return ( a = this . getField ( a ) ) ? a . getValue ( ) : null } ; module$exports$Blockly$Block . Block . prototype . setFieldValue = function ( a , b ) { var c = this . getField ( b ) ; if ( ! c ) throw Error ( 'Field "' + b + '" not found.' ) ; c . setValue ( a ) } ;
module$exports$Blockly$Block . Block . prototype . setPreviousStatement = function ( a , b ) { if ( a ) void 0 === b && ( b = null ) , this . previousConnection || ( this . previousConnection = this . makeConnection _ ( $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ) ) , 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 } } ;
module$exports$Blockly$Block . Block . prototype . setNextStatement = function ( a , b ) { if ( a ) void 0 === b && ( b = null ) , this . nextConnection || ( this . nextConnection = this . makeConnection _ ( $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ) ) , this . nextConnection . setCheck ( b ) ; else if ( this . nextConnection ) { if ( this . nextConnection . isConnected ( ) ) throw Error ( "Must disconnect next statement before removing connection." ) ; this . nextConnection . dispose ( ) ; this . nextConnection = null } } ;
module$exports$Blockly$Block . Block . prototype . setOutput = function ( a , b ) { if ( a ) void 0 === b && ( b = null ) , this . outputConnection || ( this . outputConnection = this . makeConnection _ ( $ . module$exports$Blockly$ConnectionType . ConnectionType . 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 } } ;
module$exports$Blockly$Block . Block . prototype . setInputsInline = function ( a ) { this . inputsInline !== a && ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( this , "inline" , null , this . inputsInline , a ) ) , this . inputsInline = a ) } ;
module$exports$Blockly$Block . Block . prototype . getInputsInline = function ( ) { if ( void 0 !== this . inputsInline ) return this . inputsInline ; for ( var a = 1 ; a < this . inputList . length ; a ++ ) if ( this . inputList [ a - 1 ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY && this . inputList [ a ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ) return ! 1 ; for ( a = 1 ; a < this . inputList . length ; a ++ ) if ( this . inputList [ a - 1 ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE && this . inputList [ a ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ) return ! 0 ;
return ! 1 } ; module$exports$Blockly$Block . Block . prototype . setOutputShape = function ( a ) { this . outputShape _ = a } ; module$exports$Blockly$Block . Block . prototype . getOutputShape = function ( ) { return this . outputShape _ } ; module$exports$Blockly$Block . Block . prototype . isEnabled = function ( ) { return ! this . disabled } ;
module$exports$Blockly$Block . Block . prototype . setEnabled = function ( a ) { if ( this . isEnabled ( ) !== a ) { var b = this . disabled ; this . disabled = ! a ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( this , "disabled" , null , b , ! a ) ) } } ; module$exports$Blockly$Block . Block . prototype . getInheritedDisabled = function ( ) { for ( var a = this . getSurroundParent ( ) ; a ; ) { if ( a . disabled ) return ! 0 ; a = a . getSurroundParent ( ) } return ! 1 } ;
module$exports$Blockly$Block . Block . prototype . isCollapsed = function ( ) { return this . collapsed _ } ; module$exports$Blockly$Block . Block . prototype . setCollapsed = function ( a ) { this . collapsed _ !== a && ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( this , "collapsed" , null , this . collapsed _ , a ) ) , this . collapsed _ = a ) } ;
module$exports$Blockly$Block . Block . prototype . toString = function ( a , b ) { function c ( l ) { var m = l . getCheck ( ) ; ! m && l . targetConnection && ( m = l . targetConnection . getCheck ( ) ) ; return ! ! m && ( - 1 !== m . indexOf ( "Boolean" ) || - 1 !== m . indexOf ( "Number" ) ) } function d ( ) { g && g . getType ( ) === h . getType ( ) && g . getLocation ( ) === h . getLocation ( ) && ( g = null ) } var e = [ ] ; b = b || "?" ; var f = module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS ; module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS = ! 0 ; for ( var g = module$exports$Blockly$ASTNode . ASTNode . createBlockNode ( this ) ,
h = g ; g ; ) { switch ( g . getType ( ) ) { case module$exports$Blockly$ASTNode . ASTNode . types . INPUT : var k = g . getLocation ( ) ; g . in ( ) ? c ( k ) && e . push ( "(" ) : e . push ( b ) ; break ; case module$exports$Blockly$ASTNode . ASTNode . types . FIELD : k = g . getLocation ( ) , k . name !== module$exports$Blockly$constants . COLLAPSED _FIELD _NAME && e . push ( k . getText ( ) ) } k = g ; g = k . in ( ) || k . next ( ) ; if ( ! g ) { g = k . out ( ) ; for ( d ( ) ; g && ! g . next ( ) ; ) g = g . out ( ) , d ( ) , g && g . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . INPUT && c ( g . getLocation ( ) ) && e . push ( ")" ) ; g && ( g = g . next ( ) ) } } module$exports$Blockly$ASTNode . ASTNode . NAVIGATE _ALL _FIELDS =
f ; for ( b = 2 ; b < e . length ; b ++ ) "(" === e [ b - 2 ] && ")" === e [ b ] && ( e [ b - 2 ] = e [ b - 1 ] , e . splice ( b - 1 , 2 ) ) ; e = e . reduce ( function ( l , m ) { return l + ( "(" === l . substr ( - 1 ) || ")" === m ? "" : " " ) + m } , "" ) ; e = e . trim ( ) || "???" ; a && e . length > a && ( e = e . substring ( 0 , a - 3 ) + "..." ) ; return e } ; module$exports$Blockly$Block . Block . prototype . appendValueInput = function ( a ) { return this . appendInput _ ( $ . module$exports$Blockly$inputTypes . inputTypes . VALUE , a ) } ;
module$exports$Blockly$Block . Block . prototype . appendStatementInput = function ( a ) { return this . appendInput _ ( $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT , a ) } ; module$exports$Blockly$Block . Block . prototype . appendDummyInput = function ( a ) { return this . appendInput _ ( $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY , a || "" ) } ;
module$exports$Blockly$Block . Block . prototype . jsonInit = function ( a ) { var b = a . type ? 'Block "' + a . type + '": ' : "" ; if ( a . output && a . previousStatement ) throw Error ( b + "Must not have both an output and a previousStatement." ) ; a . style && a . style . hat && ( this . hat = a . style . hat , a . style = null ) ; if ( a . style && a . colour ) throw Error ( b + "Must not have both a colour and a style." ) ; a . style ? this . jsonInitStyle _ ( a , b ) : this . jsonInitColour _ ( a , b ) ; for ( var c = 0 ; void 0 !== a [ "message" + c ] ; ) this . interpolate _ ( a [ "message" + c ] , a [ "args" + c ] || [ ] , a [ "lastDummyAlign" +
c ] , b ) , c ++ ; void 0 !== a . inputsInline && this . setInputsInline ( a . inputsInline ) ; void 0 !== a . output && this . setOutput ( ! 0 , a . output ) ; void 0 !== a . outputShape && this . setOutputShape ( a . outputShape ) ; void 0 !== a . previousStatement && this . setPreviousStatement ( ! 0 , a . previousStatement ) ; void 0 !== a . nextStatement && this . setNextStatement ( ! 0 , a . nextStatement ) ; void 0 !== a . tooltip && ( c = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . tooltip ) , this . setTooltip ( c ) ) ; void 0 !== a . enableContextMenu && ( this . contextMenu = ! ! a . enableContextMenu ) ;
void 0 !== a . suppressPrefixSuffix && ( this . suppressPrefixSuffix = ! ! a . suppressPrefixSuffix ) ; void 0 !== a . helpUrl && ( c = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . helpUrl ) , this . setHelpUrl ( c ) ) ; "string" === typeof a . extensions && ( console . warn ( b + "JSON attribute 'extensions' should be an array of strings. Found raw string in JSON for '" + a . type + "' block." ) , a . extensions = [ a . extensions ] ) ; void 0 !== a . mutator && ( 0 , $ . module$exports$Blockly$Extensions . apply ) ( a . mutator , this , ! 0 ) ; a = a . extensions ; if ( Array . isArray ( a ) ) for ( b =
0 ; b < a . length ; b ++ ) ( 0 , $ . module$exports$Blockly$Extensions . apply ) ( a [ b ] , this , ! 1 ) } ; module$exports$Blockly$Block . Block . prototype . jsonInitColour _ = function ( a , b ) { if ( "colour" in a ) if ( void 0 === a . colour ) console . warn ( b + "Undefined colour value." ) ; else { a = a . colour ; try { this . setColour ( a ) } catch ( c ) { console . warn ( b + "Illegal colour value: " , a ) } } } ; module$exports$Blockly$Block . Block . prototype . jsonInitStyle _ = function ( a , b ) { a = a . style ; try { this . setStyle ( a ) } catch ( c ) { console . warn ( b + "Style does not exist: " , a ) } } ;
module$exports$Blockly$Block . Block . prototype . mixin = function ( a , b ) { if ( void 0 !== b && "boolean" !== typeof b ) throw Error ( "opt_disableCheck must be a boolean if provided" ) ; if ( ! b ) { b = [ ] ; for ( var c in a ) void 0 !== this [ c ] && b . push ( c ) ; if ( b . length ) throw Error ( "Mixin will overwrite block members: " + JSON . stringify ( b ) ) ; } ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( this , a ) } ;
module$exports$Blockly$Block . Block . prototype . interpolate _ = function ( a , b , c , d ) { a = ( 0 , module$exports$Blockly$utils$parsing . tokenizeInterpolation ) ( a ) ; this . validateTokens _ ( a , b . length ) ; b = this . interpolateArguments _ ( a , b , c ) ; c = [ ] ; a = 0 ; for ( var e ; e = b [ a ] ; a ++ ) if ( this . isInputKeyword _ ( e . type ) ) { if ( e = this . inputFromJson _ ( e , d ) ) { for ( var f = 0 , g ; g = c [ f ] ; f ++ ) e . appendField ( g [ 0 ] , g [ 1 ] ) ; c . length = 0 } } else ( f = this . fieldFromJson _ ( e ) ) && c . push ( [ f , e . name ] ) } ;
module$exports$Blockly$Block . Block . prototype . validateTokens _ = function ( a , b ) { for ( var c = [ ] , d = 0 , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] ; if ( "number" === typeof f ) { if ( 1 > f || f > b ) throw Error ( 'Block "' + this . type + '": Message index %' + f + " out of range." ) ; if ( c [ f ] ) throw Error ( 'Block "' + this . type + '": Message index %' + f + " duplicated." ) ; c [ f ] = ! 0 ; d ++ } } if ( d !== b ) throw Error ( 'Block "' + this . type + '": Message does not reference all ' + b + " arg(s)." ) ; } ;
module$exports$Blockly$Block . Block . prototype . interpolateArguments _ = function ( a , b , c ) { for ( var d = [ ] , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] ; "number" === typeof f && ( f = b [ f - 1 ] ) ; if ( "string" === typeof f && ( f = this . stringToFieldJson _ ( f ) , ! f ) ) continue ; d . push ( f ) } ( a = d . length ) && ! this . isInputKeyword _ ( d [ a - 1 ] . type ) && ( a = { type : "input_dummy" } , c && ( a . align = c ) , d . push ( a ) ) ; return d } ;
module$exports$Blockly$Block . Block . prototype . fieldFromJson _ = function ( a ) { var b = ( 0 , module$exports$Blockly$fieldRegistry . fromJson ) ( a ) ; return ! b && a . alt ? "string" === typeof a . alt ? ( a = this . stringToFieldJson _ ( a . alt ) ) ? this . fieldFromJson _ ( a ) : null : this . fieldFromJson _ ( a . alt ) : b } ;
module$exports$Blockly$Block . Block . prototype . inputFromJson _ = function ( a , b ) { var c = { LEFT : $ . module$exports$Blockly$Input . Align . LEFT , RIGHT : $ . module$exports$Blockly$Input . Align . RIGHT , CENTRE : $ . module$exports$Blockly$Input . Align . CENTRE , CENTER : $ . module$exports$Blockly$Input . Align . CENTRE } , d = null ; switch ( a . type ) { case "input_value" : d = this . appendValueInput ( a . name ) ; break ; case "input_statement" : d = this . appendStatementInput ( a . name ) ; break ; case "input_dummy" : d = this . appendDummyInput ( a . name ) } if ( ! d ) return null ; a . check &&
d . setCheck ( a . check ) ; a . align && ( c = c [ a . align . toUpperCase ( ) ] , void 0 === c ? console . warn ( b + "Illegal align value: " , a . align ) : d . setAlign ( c ) ) ; return d } ; module$exports$Blockly$Block . Block . prototype . isInputKeyword _ = function ( a ) { return "input_value" === a || "input_statement" === a || "input_dummy" === a } ; module$exports$Blockly$Block . Block . prototype . stringToFieldJson _ = function ( a ) { return ( a = a . trim ( ) ) ? { type : "field_label" , text : a } : null } ;
module$exports$Blockly$Block . Block . prototype . appendInput _ = function ( a , b ) { var c = null ; if ( a === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE || a === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ) c = this . makeConnection _ ( a ) ; a === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT && this . statementInputCount ++ ; a = new $ . module$exports$Blockly$Input . Input ( a , b , this , c ) ; this . inputList . push ( a ) ; return a } ;
module$exports$Blockly$Block . Block . prototype . moveInputBefore = function ( a , b ) { if ( a !== b ) { for ( var c = - 1 , d = b ? - 1 : this . inputList . length , e = 0 , f ; f = this . inputList [ e ] ; e ++ ) if ( f . name === a ) { if ( c = e , - 1 !== d ) break } else if ( b && f . name === b && ( d = e , - 1 !== c ) ) break ; if ( - 1 === c ) throw Error ( 'Named input "' + a + '" not found.' ) ; if ( - 1 === d ) throw Error ( 'Reference input "' + b + '" not found.' ) ; this . moveNumberedInputBefore ( c , d ) } } ;
module$exports$Blockly$Block . Block . prototype . moveNumberedInputBefore = function ( a , b ) { if ( a === b ) throw Error ( "Can't move input to itself." ) ; if ( a >= this . inputList . length ) throw RangeError ( "Input index " + a + " out of bounds." ) ; if ( b > this . inputList . length ) throw RangeError ( "Reference input " + b + " out of bounds." ) ; var c = this . inputList [ a ] ; this . inputList . splice ( a , 1 ) ; a < b && b -- ; this . inputList . splice ( b , 0 , c ) } ;
module$exports$Blockly$Block . Block . prototype . removeInput = function ( a , b ) { for ( var c = 0 , d ; d = this . inputList [ c ] ; c ++ ) if ( d . name === a ) return d . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT && this . statementInputCount -- , d . dispose ( ) , this . inputList . splice ( c , 1 ) , ! 0 ; if ( b ) return ! 1 ; throw Error ( "Input not found: " + a ) ; } ; module$exports$Blockly$Block . Block . prototype . getInput = function ( a ) { for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . name === a ) return c ; return null } ;
module$exports$Blockly$Block . Block . prototype . getInputTargetBlock = function ( a ) { return ( a = this . getInput ( a ) ) && a . connection && a . connection . targetBlock ( ) } ; module$exports$Blockly$Block . Block . prototype . getCommentText = function ( ) { return this . commentModel . text } ;
module$exports$Blockly$Block . Block . prototype . setCommentText = function ( a ) { this . commentModel . text !== a && ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( this , "comment" , null , this . commentModel . text , a ) ) , this . comment = this . commentModel . text = a ) } ; module$exports$Blockly$Block . Block . prototype . setWarningText = function ( a , b ) { } ; module$exports$Blockly$Block . Block . prototype . setMutator = function ( a ) { } ;
module$exports$Blockly$Block . Block . prototype . getRelativeToSurfaceXY = function ( ) { return this . xy _ } ; module$exports$Blockly$Block . Block . prototype . moveBy = function ( a , b ) { if ( this . parentBlock _ ) throw Error ( "Block has parent." ) ; var c = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . MOVE ) ) ( this ) ; this . xy _ . translate ( a , b ) ; c . recordNew ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( c ) } ;
module$exports$Blockly$Block . Block . prototype . makeConnection _ = function ( a ) { return new module$exports$Blockly$Connection . Connection ( this , a ) } ; module$exports$Blockly$Block . Block . prototype . allInputsFilled = function ( a ) { void 0 === a && ( a = ! 0 ) ; if ( ! a && this . isShadow ( ) ) return ! 1 ; for ( var b = 0 , c ; c = this . inputList [ b ] ; b ++ ) if ( c . connection && ( c = c . connection . targetBlock ( ) , ! c || ! c . allInputsFilled ( a ) ) ) return ! 1 ; return ( b = this . getNextBlock ( ) ) ? b . allInputsFilled ( a ) : ! 0 } ;
module$exports$Blockly$Block . Block . prototype . toDevString = function ( ) { var a = this . type ? '"' + this . type + '" block' : "Block" ; this . id && ( a += ' (id="' + this . id + '")' ) ; return a } ; var module$exports$Blockly$ContextMenuRegistry = { ContextMenuRegistry : function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry = this ; this . registry _ = Object . create ( null ) } } ; module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType = { BLOCK : "block" , WORKSPACE : "workspace" } ; module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry = null ;
module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . prototype . register = function ( a ) { if ( this . registry _ [ a . id ] ) throw Error ( 'Menu item with ID "' + a . id + '" is already registered.' ) ; this . registry _ [ a . id ] = a } ; module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . prototype . unregister = function ( a ) { if ( ! this . registry _ [ a ] ) throw Error ( 'Menu item with ID "' + a + '" not found.' ) ; delete this . registry _ [ a ] } ;
module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . prototype . getItem = function ( a ) { return this . registry _ [ a ] || null } ;
module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . prototype . getContextMenuOptions = function ( a , b ) { var c = [ ] , d = this . registry _ ; Object . keys ( d ) . forEach ( function ( e ) { e = d [ e ] ; if ( a === e . scopeType ) { var f = e . preconditionFn ( b ) ; "hidden" !== f && ( e = { text : "function" === typeof e . displayText ? e . displayText ( b ) : e . displayText , enabled : "enabled" === f , callback : e . callback , scope : b , weight : e . weight } , c . push ( e ) ) } } ) ; c . sort ( function ( e , f ) { return e . weight - f . weight } ) ; return c } ; new module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry ; var module$exports$Blockly$IBoundedElement = { IBoundedElement : function ( ) { } } ; var module$exports$Blockly$IMovable = { IMovable : function ( ) { } } ; var module$exports$Blockly$ISelectable = { ISelectable : function ( ) { } } ; var module$exports$Blockly$ICopyable = { ICopyable : function ( ) { } } ; var module$exports$Blockly$RenderedConnection = { RenderedConnection : function ( a , b ) { module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . constructor . call ( this , a , b ) ; this . db _ = a . workspace . connectionDBList [ b ] ; this . dbOpposite _ = a . workspace . connectionDBList [ $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE [ b ] ] ; this . offsetInBlock _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; this . trackedState _ = module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . WILL _TRACK ;
this . targetConnection = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$RenderedConnection . RenderedConnection , module$exports$Blockly$Connection . Connection ) ; module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState = { WILL _TRACK : - 1 , UNTRACKED : 0 , TRACKED : 1 } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . dispose = function ( ) { module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . dispose . call ( this ) ; this . trackedState _ === module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . TRACKED && this . db _ . removeConnection ( this , this . y ) } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . getSourceBlock = function ( ) { return module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . getSourceBlock . call ( this ) } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . targetBlock = function ( ) { return module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . targetBlock . call ( this ) } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . distanceFrom = function ( a ) { var b = this . x - a . x ; a = this . y - a . y ; return Math . sqrt ( b * b + a * a ) } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . bumpAwayFrom = function ( a ) { if ( ! this . sourceBlock _ . workspace . isDragging ( ) ) { var b = this . sourceBlock _ . getRootBlock ( ) ; if ( ! b . isInFlyout ) { var c = ! 1 ; if ( ! b . isMovable ( ) ) { b = a . getSourceBlock ( ) . getRootBlock ( ) ; if ( ! b . isMovable ( ) ) return ; a = this ; c = ! 0 } var d = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) == b ; d || b . addSelect ( ) ; var e = a . x + $ . module$exports$Blockly$internalConstants . SNAP _RADIUS + Math . floor ( Math . random ( ) * $ . module$exports$Blockly$internalConstants . BUMP _RANDOMNESS ) -
this . x , f = a . y + $ . module$exports$Blockly$internalConstants . SNAP _RADIUS + Math . floor ( Math . random ( ) * $ . module$exports$Blockly$internalConstants . BUMP _RANDOMNESS ) - this . y ; c && ( f = - f ) ; b . RTL && ( e = a . x - $ . module$exports$Blockly$internalConstants . SNAP _RADIUS - Math . floor ( Math . random ( ) * $ . module$exports$Blockly$internalConstants . BUMP _RANDOMNESS ) - this . x ) ; b . moveBy ( e , f ) ; d || b . removeSelect ( ) } } } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . moveTo = function ( a , b ) { this . trackedState _ === module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . WILL _TRACK ? ( this . db _ . addConnection ( this , b ) , this . trackedState _ = module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . TRACKED ) : this . trackedState _ === module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . TRACKED && ( this . db _ . removeConnection ( this , this . y ) , this . db _ . addConnection ( this ,
b ) ) ; this . x = a ; this . y = b } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . moveBy = function ( a , b ) { this . moveTo ( this . x + a , this . y + b ) } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . moveToOffset = function ( a ) { this . moveTo ( a . x + this . offsetInBlock _ . x , a . y + this . offsetInBlock _ . y ) } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . setOffsetInBlock = function ( a , b ) { this . offsetInBlock _ . x = a ; this . offsetInBlock _ . y = b } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . getOffsetInBlock = function ( ) { return this . offsetInBlock _ } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . tighten = function ( ) { var a = this . targetConnection . x - this . x , b = this . targetConnection . y - this . y ; if ( 0 !== a || 0 !== b ) { var c = this . targetBlock ( ) , d = c . getSvgRoot ( ) ; if ( ! d ) throw Error ( "block is not rendered." ) ; d = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( d ) ; c . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + ( d . x - a ) + "," + ( d . y - b ) + ")" ) ; c . moveConnections ( - a , - b ) } } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . closest = function ( a , b ) { return this . dbOpposite _ . searchForClosest ( this , a , b ) } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . highlight = function ( ) { var a = this . sourceBlock _ . workspace . getRenderer ( ) . getConstants ( ) ; var b = a . shapeFor ( this ) ; this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE || this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ? ( a = a . TAB _OFFSET _FROM _TOP , b = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( 0 , - a ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , a ) + b . pathDown + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" ,
a ) ) : ( a = a . NOTCH _OFFSET _LEFT - a . CORNER _RADIUS , b = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - a , 0 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , a ) + b . pathLeft + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , a ) ) ; a = this . sourceBlock _ . getRelativeToSurfaceXY ( ) ; module$exports$Blockly$Connection . Connection . highlightedPath _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyHighlightedConnectionPath" , d : b , transform : "translate(" +
( this . x - a . x ) + "," + ( this . y - a . y ) + ")" + ( this . sourceBlock _ . RTL ? " scale(-1 1)" : "" ) } , this . sourceBlock _ . getSvgRoot ( ) ) } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . unhighlight = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( module$exports$Blockly$Connection . Connection . highlightedPath _ ) ; delete module$exports$Blockly$Connection . Connection . highlightedPath _ } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . setTracking = function ( a ) { a && this . trackedState _ === module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . TRACKED || ! a && this . trackedState _ === module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . UNTRACKED || this . sourceBlock _ . isInFlyout || ( a ? ( this . db _ . addConnection ( this , this . y ) , this . trackedState _ = module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . TRACKED ) : ( this . trackedState _ ===
module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . TRACKED && this . db _ . removeConnection ( this , this . y ) , this . trackedState _ = module$exports$Blockly$RenderedConnection . RenderedConnection . TrackedState . UNTRACKED ) ) } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . stopTrackingAll = function ( ) { this . setTracking ( ! 1 ) ; if ( this . targetConnection ) for ( var a = this . targetBlock ( ) . getDescendants ( ! 1 ) , b = 0 ; b < a . length ; b ++ ) { for ( var c = a [ b ] , d = c . getConnections _ ( ! 0 ) , e = 0 ; e < d . length ; e ++ ) d [ e ] . setTracking ( ! 1 ) ; c = c . getIcons ( ) ; for ( d = 0 ; d < c . length ; d ++ ) c [ d ] . setVisible ( ! 1 ) } } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . startTrackingAll = function ( ) { this . setTracking ( ! 0 ) ; var a = [ ] ; if ( this . type !== $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE && this . type !== $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ) return a ; var b = this . targetBlock ( ) ; if ( b ) { if ( b . isCollapsed ( ) ) { var c = [ ] ; b . outputConnection && c . push ( b . outputConnection ) ; b . nextConnection && c . push ( b . nextConnection ) ; b . previousConnection && c . push ( b . previousConnection ) } else c =
b . getConnections _ ( ! 0 ) ; for ( var d = 0 ; d < c . length ; d ++ ) a . push . apply ( a , c [ d ] . startTrackingAll ( ) ) ; a . length || ( a = [ b ] ) } return a } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . onFailedConnect = function ( a ) { var b = this . getSourceBlock ( ) ; if ( ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) ) { var c = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; setTimeout ( function ( ) { b . isDisposed ( ) || b . getParent ( ) || ( ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( c ) , this . bumpAwayFrom ( a ) , ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) ) } . bind ( this ) , $ . module$exports$Blockly$internalConstants . BUMP _DELAY ) } } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . disconnectInternal _ = function ( a , b ) { module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . disconnectInternal _ . call ( this , a , b ) ; a . rendered && a . render ( ) ; b . rendered && ( b . updateDisabled ( ) , b . render ( ) , b . getSvgRoot ( ) . style . display = "block" ) } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . respawnShadow _ = function ( ) { module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . respawnShadow _ . call ( this ) ; var a = this . targetBlock ( ) ; a && ( a . initSvg ( ) , a . render ( ! 1 ) , a = this . getSourceBlock ( ) , a . rendered && a . render ( ) ) } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . neighbours = function ( a ) { return this . dbOpposite _ . getNeighbours ( this , a ) } ;
module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . connect _ = function ( a ) { module$exports$Blockly$RenderedConnection . RenderedConnection . superClass _ . connect _ . call ( this , a ) ; var b = this . getSourceBlock ( ) ; a = a . getSourceBlock ( ) ; var c = b . rendered , d = a . rendered ; c && b . updateDisabled ( ) ; d && a . updateDisabled ( ) ; c && d && ( this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT || this . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ? a . render ( ) : b . render ( ) ) ;
if ( b = b . getInputWithBlock ( a ) ) b = b . isVisible ( ) , a . getSvgRoot ( ) . style . display = b ? "block" : "none" } ; module$exports$Blockly$RenderedConnection . RenderedConnection . prototype . onCheckChanged _ = function ( ) { ! this . isConnected ( ) || this . targetConnection && this . getConnectionChecker ( ) . canConnect ( this , this . targetConnection , ! 1 ) || ( ( this . isSuperior ( ) ? this . targetBlock ( ) : this . sourceBlock _ ) . unplug ( ) , this . sourceBlock _ . bumpNeighbours ( ) ) } ; var module$exports$Blockly$Marker = { Marker : function ( ) { this . drawer _ = this . curNode _ = this . colour = null ; this . type = "marker" } } ; module$exports$Blockly$Marker . Marker . prototype . setDrawer = function ( a ) { this . drawer _ = a } ; module$exports$Blockly$Marker . Marker . prototype . getDrawer = function ( ) { return this . drawer _ } ; module$exports$Blockly$Marker . Marker . prototype . getCurNode = function ( ) { return this . curNode _ } ;
module$exports$Blockly$Marker . Marker . prototype . setCurNode = function ( a ) { var b = this . curNode _ ; this . curNode _ = a ; this . drawer _ && this . drawer _ . draw ( b , this . curNode _ ) } ; module$exports$Blockly$Marker . Marker . prototype . draw = function ( ) { this . drawer _ && this . drawer _ . draw ( this . curNode _ , this . curNode _ ) } ; module$exports$Blockly$Marker . Marker . prototype . hide = function ( ) { this . drawer _ && this . drawer _ . hide ( ) } ; module$exports$Blockly$Marker . Marker . prototype . dispose = function ( ) { this . getDrawer ( ) && this . getDrawer ( ) . dispose ( ) } ; var module$exports$Blockly$Cursor = { Cursor : function ( ) { module$exports$Blockly$Cursor . Cursor . superClass _ . constructor . call ( this ) ; this . type = "cursor" } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Cursor . Cursor , module$exports$Blockly$Marker . Marker ) ;
module$exports$Blockly$Cursor . Cursor . prototype . next = function ( ) { var a = this . getCurNode ( ) ; if ( ! a ) return null ; for ( a = a . next ( ) ; a && a . next ( ) && ( a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . NEXT || a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . BLOCK ) ; ) a = a . next ( ) ; a && this . setCurNode ( a ) ; return a } ;
module$exports$Blockly$Cursor . Cursor . prototype . in = function ( ) { var a = this . getCurNode ( ) ; if ( ! a ) return null ; if ( a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS || a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT ) a = a . next ( ) ; ( a = a . in ( ) ) && this . setCurNode ( a ) ; return a } ;
module$exports$Blockly$Cursor . Cursor . prototype . prev = function ( ) { var a = this . getCurNode ( ) ; if ( ! a ) return null ; for ( a = a . prev ( ) ; a && a . prev ( ) && ( a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . NEXT || a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . BLOCK ) ; ) a = a . prev ( ) ; a && this . setCurNode ( a ) ; return a } ;
module$exports$Blockly$Cursor . Cursor . prototype . out = function ( ) { var a = this . getCurNode ( ) ; if ( ! a ) return null ; ( a = a . out ( ) ) && a . getType ( ) === module$exports$Blockly$ASTNode . ASTNode . types . BLOCK && ( a = a . prev ( ) || a ) ; a && this . setCurNode ( a ) ; return a } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . CURSOR , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$Cursor . Cursor ) ; var module$exports$Blockly$BasicCursor = { BasicCursor : function ( ) { module$exports$Blockly$BasicCursor . BasicCursor . superClass _ . constructor . call ( this ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$BasicCursor . BasicCursor , module$exports$Blockly$Cursor . Cursor ) ; module$exports$Blockly$BasicCursor . BasicCursor . registrationName = "basicCursor" ;
module$exports$Blockly$BasicCursor . BasicCursor . prototype . next = function ( ) { var a = this . getCurNode ( ) ; if ( ! a ) return null ; ( a = this . getNextNode _ ( a , this . validNode _ ) ) && this . setCurNode ( a ) ; return a } ; module$exports$Blockly$BasicCursor . BasicCursor . prototype . in = function ( ) { return this . next ( ) } ; module$exports$Blockly$BasicCursor . BasicCursor . prototype . prev = function ( ) { var a = this . getCurNode ( ) ; if ( ! a ) return null ; ( a = this . getPreviousNode _ ( a , this . validNode _ ) ) && this . setCurNode ( a ) ; return a } ;
module$exports$Blockly$BasicCursor . BasicCursor . prototype . out = function ( ) { return this . prev ( ) } ; module$exports$Blockly$BasicCursor . BasicCursor . prototype . getNextNode _ = function ( a , b ) { if ( ! a ) return null ; var c = a . in ( ) || a . next ( ) ; if ( b ( c ) ) return c ; if ( c ) return this . getNextNode _ ( c , b ) ; a = this . findSiblingOrParent _ ( a . out ( ) ) ; return b ( a ) ? a : a ? this . getNextNode _ ( a , b ) : null } ;
module$exports$Blockly$BasicCursor . BasicCursor . prototype . getPreviousNode _ = function ( a , b ) { if ( ! a ) return null ; var c = a . prev ( ) ; c = c ? this . getRightMostChild _ ( c ) : a . out ( ) ; return b ( c ) ? c : c ? this . getPreviousNode _ ( c , b ) : null } ;
module$exports$Blockly$BasicCursor . BasicCursor . prototype . validNode _ = function ( a ) { var b = ! 1 ; a = a && a . getType ( ) ; if ( a === module$exports$Blockly$ASTNode . ASTNode . types . OUTPUT || a === module$exports$Blockly$ASTNode . ASTNode . types . INPUT || a === module$exports$Blockly$ASTNode . ASTNode . types . FIELD || a === module$exports$Blockly$ASTNode . ASTNode . types . NEXT || a === module$exports$Blockly$ASTNode . ASTNode . types . PREVIOUS || a === module$exports$Blockly$ASTNode . ASTNode . types . WORKSPACE ) b = ! 0 ; return b } ;
module$exports$Blockly$BasicCursor . BasicCursor . prototype . findSiblingOrParent _ = function ( a ) { if ( ! a ) return null ; var b = a . next ( ) ; return b ? b : this . findSiblingOrParent _ ( a . out ( ) ) } ; module$exports$Blockly$BasicCursor . BasicCursor . prototype . getRightMostChild _ = function ( a ) { if ( ! a . in ( ) ) return a ; for ( a = a . in ( ) ; a . next ( ) ; ) a = a . next ( ) ; return this . getRightMostChild _ ( a ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . CURSOR , module$exports$Blockly$BasicCursor . BasicCursor . registrationName , module$exports$Blockly$BasicCursor . BasicCursor ) ; var module$exports$Blockly$TabNavigateCursor = { TabNavigateCursor : function ( ) { module$exports$Blockly$TabNavigateCursor . TabNavigateCursor . superClass _ . constructor . call ( this ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$TabNavigateCursor . TabNavigateCursor , module$exports$Blockly$BasicCursor . BasicCursor ) ;
module$exports$Blockly$TabNavigateCursor . TabNavigateCursor . prototype . validNode _ = function ( a ) { var b = ! 1 , c = a && a . getType ( ) ; a && ( a = a . getLocation ( ) , c === module$exports$Blockly$ASTNode . ASTNode . types . FIELD && a && a . isTabNavigable ( ) && a . isClickable ( ) && ( b = ! 0 ) ) ; return b } ; var module$exports$Blockly$Events$Selected = { Selected : function ( a , b , c ) { module$exports$Blockly$Events$Selected . Selected . superClass _ . constructor . call ( this , c ) ; this . oldElementId = a ; this . newElementId = b } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$Selected . Selected , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$Selected . Selected . prototype . type = module$exports$Blockly$Events$utils . SELECTED ;
module$exports$Blockly$Events$Selected . Selected . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$Selected . Selected . superClass _ . toJson . call ( this ) ; a . oldElementId = this . oldElementId ; a . newElementId = this . newElementId ; return a } ; module$exports$Blockly$Events$Selected . Selected . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$Selected . Selected . superClass _ . fromJson . call ( this , a ) ; this . oldElementId = a . oldElementId ; this . newElementId = a . newElementId } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . SELECTED , module$exports$Blockly$Events$Selected . Selected ) ; var module$exports$Blockly$BlockSvg = { BlockSvg : function ( a , b , c ) { this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { } , null ) ; this . svgGroup _ . translate _ = "" ; this . style = a . getRenderer ( ) . getConstants ( ) . getBlockStyle ( null ) ; this . pathObject = a . getRenderer ( ) . makePathObject ( this . svgGroup _ , this . style ) ; this . renderIsInProgress _ = this . rendered = ! 1 ; this . workspace = a ; this . previousConnection = this . nextConnection = this . outputConnection = null ; this . useDragSurface _ = ( 0 , module$exports$Blockly$utils$svgMath . is3dSupported ) ( ) &&
! ! a . getBlockDragSurface ( ) ; var d = this . pathObject . svgPath ; d . tooltip = this ; ( 0 , module$exports$Blockly$Tooltip . bindMouseEvents ) ( d ) ; module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . constructor . call ( this , a , b , c ) ; this . svgGroup _ . dataset ? this . svgGroup _ . dataset . id = this . id : module$exports$Blockly$utils$userAgent . IE && this . svgGroup _ . setAttribute ( "data-id" , this . id ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$BlockSvg . BlockSvg , module$exports$Blockly$Block . Block ) ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . height = 0 ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . width = 0 ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . warningTextDb _ = null ; module$exports$Blockly$BlockSvg . BlockSvg . INLINE = - 1 ; module$exports$Blockly$BlockSvg . BlockSvg . COLLAPSED _WARNING _ID = "TEMP_COLLAPSED_WARNING_" ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . initSvg = function ( ) { if ( ! this . workspace . rendered ) throw TypeError ( "Workspace is headless." ) ; for ( var a = 0 , b ; b = this . inputList [ a ] ; a ++ ) b . init ( ) ; a = this . getIcons ( ) ; for ( b = 0 ; b < a . length ; b ++ ) a [ b ] . createIcon ( ) ; this . applyColour ( ) ; this . pathObject . updateMovable ( this . isMovable ( ) ) ; a = this . getSvgRoot ( ) ; this . workspace . options . readOnly || this . eventsInit _ || ! a || ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , "mousedown" , this , this . onMouseDown _ ) ; this . eventsInit _ = ! 0 ;
a . parentNode || this . workspace . getCanvas ( ) . appendChild ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getColourSecondary = function ( ) { return this . style . colourSecondary } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getColourTertiary = function ( ) { return this . style . colourTertiary } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . select = function ( ) { if ( this . isShadow ( ) && this . getParent ( ) ) this . getParent ( ) . select ( ) ; else if ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) !== this ) { var a = null ; if ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ) { a = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . id ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . unselect ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } } a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . SELECTED ) ) ( a ,
this . id , this . workspace . id ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) ; ( 0 , $ . module$exports$Blockly$common . setSelected ) ( this ) ; this . addSelect ( ) } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . unselect = function ( ) { if ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) === this ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . SELECTED ) ) ( this . id , null , this . workspace . id ) ; a . workspaceId = this . workspace . id ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) ; ( 0 , $ . module$exports$Blockly$common . setSelected ) ( null ) ; this . removeSelect ( ) } } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . mutator = null ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . comment = null ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . commentIcon _ = null ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . warning = null ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getIcons = function ( ) { var a = [ ] ; this . mutator && a . push ( this . mutator ) ; this . commentIcon _ && a . push ( this . commentIcon _ ) ; this . warning && a . push ( this . warning ) ; return a } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setParent = function ( a ) { var b = this . parentBlock _ ; if ( a !== b ) { ( 0 , module$exports$Blockly$utils$dom . startTextWidthCache ) ( ) ; module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setParent . call ( this , a ) ; ( 0 , module$exports$Blockly$utils$dom . stopTextWidthCache ) ( ) ; var c = this . getSvgRoot ( ) ; if ( ! this . workspace . isClearing && c ) { var d = this . getRelativeToSurfaceXY ( ) ; a ? ( a . getSvgRoot ( ) . appendChild ( c ) , a = this . getRelativeToSurfaceXY ( ) , this . moveConnections ( a . x - d . x , a . y - d . y ) ) : b &&
( this . workspace . getCanvas ( ) . appendChild ( c ) , this . translate ( d . x , d . y ) ) ; this . applyColour ( ) } } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . getRelativeToSurfaceXY = function ( ) { var a = 0 , b = 0 , c = this . useDragSurface _ ? this . workspace . getBlockDragSurface ( ) . getGroup ( ) : null , d = this . getSvgRoot ( ) ; if ( d ) { do { var e = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( d ) ; a += e . x ; b += e . y ; this . useDragSurface _ && this . workspace . getBlockDragSurface ( ) . getCurrentBlock ( ) === d && ( e = this . workspace . getBlockDragSurface ( ) . getSurfaceTranslation ( ) , a += e . x , b += e . y ) ; d = d . parentNode } while ( d && d !== this . workspace . getCanvas ( ) && d !==
c ) } return new module$exports$Blockly$utils$Coordinate . Coordinate ( a , b ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveBy = function ( a , b ) { if ( this . parentBlock _ ) throw Error ( "Block has parent." ) ; var c = ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) , d ; c && ( d = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . MOVE ) ) ( this ) ) ; var e = this . getRelativeToSurfaceXY ( ) ; this . translate ( e . x + a , e . y + b ) ; this . moveConnections ( a , b ) ; c && ( d . recordNew ( ) , ( 0 , module$exports$Blockly$Events$utils . fire ) ( d ) ) ; this . workspace . resizeContents ( ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . translate = function ( a , b ) { this . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveToDragSurface = function ( ) { if ( this . useDragSurface _ ) { var a = this . getRelativeToSurfaceXY ( ) ; this . clearTransformAttributes _ ( ) ; this . workspace . getBlockDragSurface ( ) . translateSurface ( a . x , a . y ) ; ( a = this . getSvgRoot ( ) ) && this . workspace . getBlockDragSurface ( ) . setBlocksAndShow ( a ) } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveTo = function ( a ) { var b = this . getRelativeToSurfaceXY ( ) ; this . moveBy ( a . x - b . x , a . y - b . y ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveOffDragSurface = function ( a ) { this . useDragSurface _ && ( this . translate ( a . x , a . y ) , this . workspace . getBlockDragSurface ( ) . clearAndHide ( this . workspace . getCanvas ( ) ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveDuringDrag = function ( a ) { this . useDragSurface _ ? this . workspace . getBlockDragSurface ( ) . translateSurface ( a . x , a . y ) : ( this . svgGroup _ . translate _ = "translate(" + a . x + "," + a . y + ")" , this . svgGroup _ . setAttribute ( "transform" , this . svgGroup _ . translate _ + this . svgGroup _ . skew _ ) ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . clearTransformAttributes _ = function ( ) { this . getSvgRoot ( ) . removeAttribute ( "transform" ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . snapToGrid = function ( ) { if ( this . workspace && ! this . workspace . isDragging ( ) && ! this . getParent ( ) && ! this . isInFlyout ) { var a = this . workspace . getGrid ( ) ; if ( a && a . shouldSnap ( ) ) { var b = a . getSpacing ( ) , c = b / 2 , d = this . getRelativeToSurfaceXY ( ) ; a = Math . round ( Math . round ( ( d . x - c ) / b ) * b + c - d . x ) ; b = Math . round ( Math . round ( ( d . y - c ) / b ) * b + c - d . y ) ; ( a || b ) && this . moveBy ( a , b ) } } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . getBoundingRectangle = function ( ) { var a = this . getRelativeToSurfaceXY ( ) , b = this . getHeightWidth ( ) ; if ( this . RTL ) { var c = a . x - b . width ; var d = a . x } else c = a . x , d = a . x + b . width ; return new module$exports$Blockly$utils$Rect . Rect ( a . y , a . y + b . height , c , d ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . markDirty = function ( ) { this . pathObject . constants = this . workspace . getRenderer ( ) . getConstants ( ) ; for ( var a = 0 , b ; b = this . inputList [ a ] ; a ++ ) b . markDirty ( ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setCollapsed = function ( a ) { this . collapsed _ !== a && ( module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setCollapsed . call ( this , a ) , a ? this . rendered && this . render ( ) : this . updateCollapsed _ ( ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . updateCollapsed _ = function ( ) { for ( var a = this . isCollapsed ( ) , b = module$exports$Blockly$constants . COLLAPSED _INPUT _NAME , c = module$exports$Blockly$constants . COLLAPSED _FIELD _NAME , d = 0 , e ; e = this . inputList [ d ] ; d ++ ) e . name !== b && e . setVisible ( ! a ) ; if ( a ) { a = this . getIcons ( ) ; for ( d = 0 ; e = a [ d ] ; d ++ ) e . setVisible ( ! 1 ) ; a = this . toString ( $ . module$exports$Blockly$internalConstants . COLLAPSE _CHARS ) ; ( d = this . getField ( c ) ) ? d . setValue ( a ) : ( this . getInput ( b ) || this . appendDummyInput ( b ) ) . appendField ( new $ . module$exports$Blockly$FieldLabel . FieldLabel ( a ) ,
c ) } else this . updateDisabled ( ) , this . removeInput ( b ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . tab = function ( a , b ) { var c = new module$exports$Blockly$TabNavigateCursor . TabNavigateCursor ; c . setCurNode ( module$exports$Blockly$ASTNode . ASTNode . createFieldNode ( a ) ) ; a = c . getCurNode ( ) ; b ? c . next ( ) : c . prev ( ) ; ( b = c . getCurNode ( ) ) && b !== a && ( b . getLocation ( ) . showEditor ( ) , this . workspace . keyboardAccessibilityMode && this . workspace . getCursor ( ) . setCurNode ( b ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . onMouseDown _ = function ( a ) { var b = this . workspace && this . workspace . getGesture ( a ) ; b && b . handleBlockStart ( a , this ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . showHelp = function ( ) { var a = "function" === typeof this . helpUrl ? this . helpUrl ( ) : this . helpUrl ; a && window . open ( a ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . generateContextMenu = function ( ) { if ( this . workspace . options . readOnly || ! this . contextMenu ) return null ; var a = module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . getContextMenuOptions ( module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK , { block : this } ) ; this . customContextMenu && this . customContextMenu ( a ) ; return a } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . showContextMenu = function ( a ) { var b = this . generateContextMenu ( ) ; b && b . length && ( ( 0 , $ . module$exports$Blockly$ContextMenu . show ) ( a , b , this . RTL ) , ( 0 , $ . module$exports$Blockly$ContextMenu . setCurrentBlock ) ( this ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveConnections = function ( a , b ) { if ( this . rendered ) { for ( var c = this . getConnections _ ( ! 1 ) , d = 0 ; d < c . length ; d ++ ) c [ d ] . moveBy ( a , b ) ; c = this . getIcons ( ) ; for ( d = 0 ; d < c . length ; d ++ ) c [ d ] . computeIconLocation ( ) ; for ( c = 0 ; c < this . childBlocks _ . length ; c ++ ) this . childBlocks _ [ c ] . moveConnections ( a , b ) } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setDragging = function ( a ) { if ( a ) { var b = this . getSvgRoot ( ) ; b . translate _ = "" ; b . skew _ = "" ; $ . module$exports$Blockly$common . draggingConnections . push . apply ( $ . module$exports$Blockly$common . draggingConnections , $jscomp . arrayFromIterable ( this . getConnections _ ( ! 0 ) ) ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgGroup _ , "blocklyDragging" ) } else $ . module$exports$Blockly$common . draggingConnections . length = 0 , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgGroup _ ,
"blocklyDragging" ) ; for ( b = 0 ; b < this . childBlocks _ . length ; b ++ ) this . childBlocks _ [ b ] . setDragging ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setMovable = function ( a ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setMovable . call ( this , a ) ; this . pathObject . updateMovable ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setEditable = function ( a ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setEditable . call ( this , a ) ; a = this . getIcons ( ) ; for ( var b = 0 ; b < a . length ; b ++ ) a [ b ] . updateEditable ( ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setShadow = function ( a ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setShadow . call ( this , a ) ; this . applyColour ( ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setInsertionMarker = function ( a ) { this . isInsertionMarker _ !== a && ( this . isInsertionMarker _ = a ) && ( this . setColour ( this . workspace . getRenderer ( ) . getConstants ( ) . INSERTION _MARKER _COLOUR ) , this . pathObject . updateInsertionMarker ( ! 0 ) ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getSvgRoot = function ( ) { return this . svgGroup _ } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . dispose = function ( a , b ) { if ( this . workspace ) { ( 0 , module$exports$Blockly$Tooltip . dispose ) ( ) ; ( 0 , module$exports$Blockly$Tooltip . unbindMouseEvents ) ( this . pathObject . svgPath ) ; ( 0 , module$exports$Blockly$utils$dom . startTextWidthCache ) ( ) ; var c = this . workspace ; ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) === this && ( this . unselect ( ) , this . workspace . cancelCurrentGesture ( ) ) ; ( 0 , $ . module$exports$Blockly$ContextMenu . getCurrentBlock ) ( ) === this && ( 0 , $ . module$exports$Blockly$ContextMenu . hide ) ( ) ;
b && this . rendered && ( this . unplug ( a ) , ( 0 , module$exports$Blockly$blockAnimations . disposeUiEffect ) ( this ) ) ; this . rendered = ! 1 ; if ( this . warningTextDb _ ) { for ( var d in this . warningTextDb _ ) clearTimeout ( this . warningTextDb _ [ d ] ) ; this . warningTextDb _ = null } b = this . getIcons ( ) ; for ( d = 0 ; d < b . length ; d ++ ) b [ d ] . dispose ( ) ; module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . dispose . call ( this , ! ! a ) ; ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) ; c . resizeContents ( ) ; this . svgGroup _ = null ; ( 0 , module$exports$Blockly$utils$dom . stopTextWidthCache ) ( ) } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . checkAndDelete = function ( ) { this . workspace . isFlyout || ( ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) , this . workspace . hideChaff ( ) , this . outputConnection ? this . dispose ( ! 1 , ! 0 ) : this . dispose ( ! 0 , ! 0 ) , ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . toCopyData = function ( ) { return this . isInsertionMarker _ ? null : { saveInfo : ( 0 , module$exports$Blockly$serialization$blocks . save ) ( this , { addCoordinates : ! 0 , addNextBlocks : ! 1 } ) , source : this . workspace , typeCounts : ( 0 , $ . module$exports$Blockly$common . getBlockTypeCounts ) ( this , ! 0 ) } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . applyColour = function ( ) { this . pathObject . applyColour ( this ) ; for ( var a = this . getIcons ( ) , b = 0 ; b < a . length ; b ++ ) a [ b ] . applyColour ( ) ; for ( a = 0 ; b = this . inputList [ a ] ; a ++ ) for ( var c = 0 , d ; d = b . fieldRow [ c ] ; c ++ ) d . applyColour ( ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . updateDisabled = function ( ) { var a = this . getChildren ( ! 1 ) ; this . applyColour ( ) ; if ( ! this . isCollapsed ( ) ) for ( var b = 0 , c ; c = a [ b ] ; b ++ ) c . rendered && c . updateDisabled ( ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . getCommentIcon = function ( ) { return this . commentIcon _ } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setCommentText = function ( a ) { var b = module$exports$Blockly$Comment . Comment ; if ( ! b ) throw Error ( "Missing require for Blockly.Comment" ) ; this . commentModel . text !== a && ( module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setCommentText . call ( this , a ) , a = null !== a , ! ! this . commentIcon _ === a ? this . commentIcon _ . updateText ( ) : ( a ? this . comment = this . commentIcon _ = new b ( this ) : ( this . commentIcon _ . dispose ( ) , this . comment = this . commentIcon _ = null ) , this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setWarningText = function ( a , b ) { var c = module$exports$Blockly$Warning . Warning ; if ( ! c ) throw Error ( "Missing require for Blockly.Warning" ) ; this . warningTextDb _ || ( this . warningTextDb _ = Object . create ( null ) ) ; var d = b || "" ; if ( d ) this . warningTextDb _ [ d ] && ( clearTimeout ( this . warningTextDb _ [ d ] ) , delete this . warningTextDb _ [ d ] ) ; else { b = $jscomp . makeIterator ( Object . keys ( this . warningTextDb _ ) ) ; for ( var e = b . next ( ) ; ! e . done ; e = b . next ( ) ) e = e . value , clearTimeout ( this . warningTextDb _ [ e ] ) ,
delete this . warningTextDb _ [ e ] } if ( this . workspace . isDragging ( ) ) { var f = this ; this . warningTextDb _ [ d ] = setTimeout ( function ( ) { f . workspace && ( delete f . warningTextDb _ [ d ] , f . setWarningText ( a , d ) ) } , 100 ) } else { this . isInFlyout && ( a = null ) ; b = ! 1 ; if ( "string" === typeof a ) { e = this . getSurroundParent ( ) ; for ( var g = null ; e ; ) e . isCollapsed ( ) && ( g = e ) , e = e . getSurroundParent ( ) ; g && g . setWarningText ( $ . module$exports$Blockly$Msg . Msg . COLLAPSED _WARNINGS _WARNING , module$exports$Blockly$BlockSvg . BlockSvg . COLLAPSED _WARNING _ID ) ; this . warning || ( this . warning =
new c ( this ) , b = ! 0 ) ; this . warning . setText ( a , d ) } else this . warning && ! d ? ( this . warning . dispose ( ) , b = ! 0 ) : this . warning && ( c = this . warning . getText ( ) , this . warning . setText ( "" , d ) , ( b = this . warning . getText ( ) ) || this . warning . dispose ( ) , b = c !== b ) ; b && this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setMutator = function ( a ) { this . mutator && this . mutator !== a && this . mutator . dispose ( ) ; a && ( a . setBlock ( this ) , this . mutator = a , a . createIcon ( ) ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setEnabled = function ( a ) { this . isEnabled ( ) !== a && ( module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setEnabled . call ( this , a ) , this . rendered && ! this . getInheritedDisabled ( ) && this . updateDisabled ( ) ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setHighlighted = function ( a ) { this . rendered && this . pathObject . updateHighlighted ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . addSelect = function ( ) { this . pathObject . updateSelected ( ! 0 ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . removeSelect = function ( ) { this . pathObject . updateSelected ( ! 1 ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setDeleteStyle = function ( a ) { this . pathObject . updateDraggingDelete ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getColour = function ( ) { return this . style . colourPrimary } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setColour = function ( a ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setColour . call ( this , a ) ; a = this . workspace . getRenderer ( ) . getConstants ( ) . getBlockStyleForColour ( this . colour _ ) ; this . pathObject . setStyle ( a . style ) ; this . style = a . style ; this . styleName _ = a . name ; this . applyColour ( ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setStyle = function ( a ) { var b = this . workspace . getRenderer ( ) . getConstants ( ) . getBlockStyle ( a ) ; this . styleName _ = a ; if ( b ) this . hat = b . hat , this . pathObject . setStyle ( b ) , this . colour _ = b . colourPrimary , this . style = b , this . applyColour ( ) ; else throw Error ( "Invalid style name: " + a ) ; } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . bringToFront = function ( ) { var a = this ; do { var b = a . getSvgRoot ( ) , c = b . parentNode , d = c . childNodes ; d [ d . length - 1 ] !== b && c . appendChild ( b ) ; a = a . getParent ( ) } while ( a ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setPreviousStatement = function ( a , b ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setPreviousStatement . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setNextStatement = function ( a , b ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setNextStatement . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setOutput = function ( a , b ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setOutput . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setInputsInline = function ( a ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . setInputsInline . call ( this , a ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . removeInput = function ( a , b ) { a = module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . removeInput . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) ; return a } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . moveNumberedInputBefore = function ( a , b ) { module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . moveNumberedInputBefore . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . appendInput _ = function ( a , b ) { a = module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . appendInput _ . call ( this , a , b ) ; this . rendered && ( this . render ( ) , this . bumpNeighbours ( ) ) ; return a } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setConnectionTracking = function ( a ) { this . previousConnection && this . previousConnection . setTracking ( a ) ; this . outputConnection && this . outputConnection . setTracking ( a ) ; if ( this . nextConnection ) { this . nextConnection . setTracking ( a ) ; var b = this . nextConnection . targetBlock ( ) ; b && b . setConnectionTracking ( a ) } if ( ! this . collapsed _ ) for ( b = 0 ; b < this . inputList . length ; b ++ ) { var c = this . inputList [ b ] . connection ; c && ( c . setTracking ( a ) , ( c = c . targetBlock ( ) ) && c . setConnectionTracking ( a ) ) } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . getConnections _ = function ( a ) { var b = [ ] ; if ( a || this . rendered ) if ( this . outputConnection && b . push ( this . outputConnection ) , this . previousConnection && b . push ( this . previousConnection ) , this . nextConnection && b . push ( this . nextConnection ) , a || ! this . collapsed _ ) { a = 0 ; for ( var c ; c = this . inputList [ a ] ; a ++ ) c . connection && b . push ( c . connection ) } return b } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . lastConnectionInStack = function ( a ) { return module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . lastConnectionInStack . call ( this , a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getMatchingConnection = function ( a , b ) { return module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . getMatchingConnection . call ( this , a , b ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . makeConnection _ = function ( a ) { return new module$exports$Blockly$RenderedConnection . RenderedConnection ( this , a ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . bumpNeighbours = function ( ) { if ( this . workspace && ! this . workspace . isDragging ( ) ) { var a = this . getRootBlock ( ) ; if ( ! a . isInFlyout ) for ( var b = this . getConnections _ ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) { d . isConnected ( ) && d . isSuperior ( ) && d . targetBlock ( ) . bumpNeighbours ( ) ; for ( var e = d . neighbours ( $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ) , f = 0 , g ; g = e [ f ] ; f ++ ) d . isConnected ( ) && g . isConnected ( ) || g . getSourceBlock ( ) . getRootBlock ( ) !== a && ( d . isSuperior ( ) ? g . bumpAwayFrom ( d ) : d . bumpAwayFrom ( g ) ) } } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . scheduleSnapAndBump = function ( ) { var a = this , b = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; setTimeout ( function ( ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( b ) ; a . snapToGrid ( ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } , $ . module$exports$Blockly$internalConstants . BUMP _DELAY / 2 ) ; setTimeout ( function ( ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( b ) ; a . bumpNeighbours ( ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } , $ . module$exports$Blockly$internalConstants . BUMP _DELAY ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . positionNearConnection = function ( a , b ) { a . type !== $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT && a . type !== $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE || this . moveBy ( b . x - a . x , b . y - a . y ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getParent = function ( ) { return module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . getParent . call ( this ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getRootBlock = function ( ) { return module$exports$Blockly$BlockSvg . BlockSvg . superClass _ . getRootBlock . call ( this ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . render = function ( a ) { if ( ! this . renderIsInProgress _ ) { this . renderIsInProgress _ = ! 0 ; try { this . rendered = ! 0 ; ( 0 , module$exports$Blockly$utils$dom . startTextWidthCache ) ( ) ; this . isCollapsed ( ) && this . updateCollapsed _ ( ) ; this . workspace . getRenderer ( ) . render ( this ) ; this . updateConnectionLocations _ ( ) ; if ( ! 1 !== a ) { var b = this . getParent ( ) ; b ? b . render ( ! 0 ) : this . workspace . resizeContents ( ) } ( 0 , module$exports$Blockly$utils$dom . stopTextWidthCache ) ( ) ; this . updateMarkers _ ( ) } finally { this . renderIsInProgress _ =
! 1 } } } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . updateMarkers _ = function ( ) { this . workspace . keyboardAccessibilityMode && this . pathObject . cursorSvg && this . workspace . getCursor ( ) . draw ( ) ; this . workspace . keyboardAccessibilityMode && this . pathObject . markerSvg && this . workspace . getMarker ( module$exports$Blockly$MarkerManager . MarkerManager . LOCAL _MARKER ) . draw ( ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . updateConnectionLocations _ = function ( ) { var a = this . getRelativeToSurfaceXY ( ) ; this . previousConnection && this . previousConnection . moveToOffset ( a ) ; this . outputConnection && this . outputConnection . moveToOffset ( a ) ; for ( var b = 0 ; b < this . inputList . length ; b ++ ) { var c = this . inputList [ b ] . connection ; c && ( c . moveToOffset ( a ) , c . isConnected ( ) && c . tighten ( ) ) } this . nextConnection && ( this . nextConnection . moveToOffset ( a ) , this . nextConnection . isConnected ( ) && this . nextConnection . tighten ( ) ) } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . setCursorSvg = function ( a ) { this . pathObject . setCursorSvg ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . setMarkerSvg = function ( a ) { this . pathObject . setMarkerSvg ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . getHeightWidth = function ( ) { var a = this . height , b = this . width , c = this . getNextBlock ( ) ; if ( c ) { c = c . getHeightWidth ( ) ; var d = this . workspace . getRenderer ( ) . getConstants ( ) . NOTCH _HEIGHT ; a += c . height - d ; b = Math . max ( b , c . width ) } return { height : a , width : b } } ;
module$exports$Blockly$BlockSvg . BlockSvg . prototype . fadeForReplacement = function ( a ) { this . pathObject . updateReplacementFade ( a ) } ; module$exports$Blockly$BlockSvg . BlockSvg . prototype . highlightShapeForInput = function ( a , b ) { this . pathObject . updateShapeForInputHighlight ( a , b ) } ; var module$exports$Blockly$ConnectionDB = { ConnectionDB : function ( a ) { this . connections _ = [ ] ; this . connectionChecker _ = a } } ; module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . addConnection = function ( a , b ) { b = this . calculateIndexForYPos _ ( b ) ; this . connections _ . splice ( b , 0 , a ) } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . findIndexOfConnection _ = function ( a , b ) { if ( ! this . connections _ . length ) return - 1 ; var c = this . calculateIndexForYPos _ ( b ) ; if ( c >= this . connections _ . length ) return - 1 ; b = a . y ; for ( var d = c ; 0 <= d && this . connections _ [ d ] . y === b ; ) { if ( this . connections _ [ d ] === a ) return d ; d -- } for ( d = c ; d < this . connections _ . length && this . connections _ [ d ] . y === b ; ) { if ( this . connections _ [ d ] === a ) return d ; d ++ } return - 1 } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . calculateIndexForYPos _ = function ( a ) { if ( ! this . connections _ . length ) return 0 ; for ( var b = 0 , c = this . connections _ . length ; b < c ; ) { var 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 } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . removeConnection = function ( a , b ) { a = this . findIndexOfConnection _ ( a , b ) ; if ( - 1 === a ) throw Error ( "Unable to find connection in connectionDB." ) ; this . connections _ . splice ( a , 1 ) } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . getNeighbours = function ( a , b ) { function c ( l ) { var m = e - d [ l ] . x , n = f - d [ l ] . y ; Math . sqrt ( m * m + n * n ) <= b && k . push ( d [ l ] ) ; return n < b } var d = this . connections _ , e = a . x , f = a . y ; a = 0 ; for ( var g = d . length - 2 , h = g ; a < h ; ) d [ h ] . y < f ? a = h : g = h , h = Math . floor ( ( a + g ) / 2 ) ; var k = [ ] ; g = a = h ; if ( d . length ) { for ( ; 0 <= a && c ( a ) ; ) a -- ; do g ++ ; while ( g < d . length && c ( g ) ) } return k } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . isInYRange _ = function ( a , b , c ) { return Math . abs ( this . connections _ [ a ] . y - b ) <= c } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . prototype . searchForClosest = function ( a , b , c ) { if ( ! this . connections _ . length ) return { connection : null , radius : b } ; var d = a . y , e = a . x ; a . x = e + c . x ; a . y = d + c . y ; var f = this . calculateIndexForYPos _ ( a . y ) ; c = null ; for ( var g = b , h , k = f - 1 ; 0 <= k && this . isInYRange _ ( k , a . y , b ) ; ) h = this . connections _ [ k ] , this . connectionChecker _ . canConnect ( a , h , ! 0 , g ) && ( c = h , g = h . distanceFrom ( a ) ) , k -- ; for ( ; 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 } } ;
module$exports$Blockly$ConnectionDB . ConnectionDB . init = function ( a ) { var b = [ ] ; b [ $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE ] = new module$exports$Blockly$ConnectionDB . ConnectionDB ( a ) ; b [ $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ] = new module$exports$Blockly$ConnectionDB . ConnectionDB ( a ) ; b [ $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ] = new module$exports$Blockly$ConnectionDB . ConnectionDB ( a ) ; b [ $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ] =
new module$exports$Blockly$ConnectionDB . ConnectionDB ( a ) ; return b } ; var module$exports$Blockly$ThemeManager = { ThemeManager : function ( a , b ) { this . workspace _ = a ; this . theme _ = b ; this . subscribedWorkspaces _ = [ ] ; this . componentDB _ = Object . create ( null ) } } ; module$exports$Blockly$ThemeManager . ThemeManager . prototype . getTheme = function ( ) { return this . theme _ } ;
module$exports$Blockly$ThemeManager . ThemeManager . prototype . setTheme = function ( a ) { var b = this . theme _ ; this . theme _ = a ; if ( a = this . workspace _ . getInjectionDiv ( ) ) b && ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , b . getClassName ( ) ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . theme _ . getClassName ( ) ) ; for ( b = 0 ; a = this . subscribedWorkspaces _ [ b ] ; b ++ ) a . refreshTheme ( ) ; b = 0 ; a = Object . keys ( this . componentDB _ ) ; for ( var c ; c = a [ b ] ; b ++ ) for ( var d = 0 , e ; e = this . componentDB _ [ c ] [ d ] ; d ++ ) { var f = e . element ; e = e . propertyName ; var g =
this . theme _ && this . theme _ . getComponentStyle ( c ) ; f . style [ e ] = g || "" } b = $jscomp . makeIterator ( this . subscribedWorkspaces _ ) ; for ( a = b . next ( ) ; ! a . done ; a = b . next ( ) ) a . value . hideChaff ( ) } ; module$exports$Blockly$ThemeManager . ThemeManager . prototype . subscribeWorkspace = function ( a ) { this . subscribedWorkspaces _ . push ( a ) } ;
module$exports$Blockly$ThemeManager . ThemeManager . prototype . unsubscribeWorkspace = function ( a ) { if ( ! ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . subscribedWorkspaces _ , a ) ) throw Error ( "Cannot unsubscribe a workspace that hasn't been subscribed." ) ; } ;
module$exports$Blockly$ThemeManager . ThemeManager . prototype . subscribe = function ( a , b , c ) { this . componentDB _ [ b ] || ( this . componentDB _ [ b ] = [ ] ) ; this . componentDB _ [ b ] . push ( { element : a , propertyName : c } ) ; b = this . theme _ && this . theme _ . getComponentStyle ( b ) ; a . style [ c ] = b || "" } ;
module$exports$Blockly$ThemeManager . ThemeManager . prototype . unsubscribe = function ( a ) { if ( a ) for ( var b = Object . keys ( this . componentDB _ ) , c = 0 , d ; d = b [ c ] ; c ++ ) { for ( var e = this . componentDB _ [ d ] , f = e . length - 1 ; 0 <= f ; f -- ) e [ f ] . element === a && e . splice ( f , 1 ) ; this . componentDB _ [ d ] . length || delete this . componentDB _ [ d ] } } ; module$exports$Blockly$ThemeManager . ThemeManager . prototype . dispose = function ( ) { this . componentDB _ = this . subscribedWorkspaces _ = this . theme _ = this . owner _ = null } ; var module$exports$Blockly$TouchGesture = { TouchGesture : function ( a , b ) { module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . constructor . call ( this , a , b ) ; this . isMultiTouch _ = ! 1 ; this . cachedPoints _ = Object . create ( null ) ; this . startDistance _ = this . previousScale _ = 0 ; this . isPinchZoomEnabled _ = this . onStartWrapper _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$TouchGesture . TouchGesture , module$exports$Blockly$Gesture . Gesture ) ;
module$exports$Blockly$TouchGesture . TouchGesture . ZOOM _IN _MULTIPLIER = 5 ; module$exports$Blockly$TouchGesture . TouchGesture . ZOOM _OUT _MULTIPLIER = 6 ; module$exports$Blockly$TouchGesture . TouchGesture . prototype . doStart = function ( a ) { this . isPinchZoomEnabled _ = this . startWorkspace _ . options . zoomOptions && this . startWorkspace _ . options . zoomOptions . pinch ; module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . doStart . call ( this , a ) ; ! this . isEnding _ && ( 0 , module$exports$Blockly$Touch . isTouchEvent ) ( a ) && this . handleTouchStart ( a ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . bindMouseEvents = function ( a ) { this . onStartWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mousedown" , null , this . handleStart . bind ( this ) , ! 0 ) ; this . onMoveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mousemove" , null , this . handleMove . bind ( this ) , ! 0 ) ; this . onUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mouseup" , null , this . handleUp . bind ( this ) , ! 0 ) ; a . preventDefault ( ) ;
a . stopPropagation ( ) } ; module$exports$Blockly$TouchGesture . TouchGesture . prototype . handleStart = function ( a ) { ! this . isDragging ( ) && ( 0 , module$exports$Blockly$Touch . isTouchEvent ) ( a ) && ( this . handleTouchStart ( a ) , this . isMultiTouch ( ) && ( 0 , module$exports$Blockly$Touch . longStop ) ( ) ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . handleMove = function ( a ) { this . isDragging ( ) ? ( 0 , module$exports$Blockly$Touch . shouldHandleEvent ) ( a ) && module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . handleMove . call ( this , a ) : this . isMultiTouch ( ) ? ( ( 0 , module$exports$Blockly$Touch . isTouchEvent ) ( a ) && this . handleTouchMove ( a ) , ( 0 , module$exports$Blockly$Touch . longStop ) ( ) ) : module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . handleMove . call ( this , a ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . handleUp = function ( a ) { ( 0 , module$exports$Blockly$Touch . isTouchEvent ) ( a ) && ! this . isDragging ( ) && this . handleTouchEnd ( a ) ; ! this . isMultiTouch ( ) || this . isDragging ( ) ? ( 0 , module$exports$Blockly$Touch . shouldHandleEvent ) ( a ) && module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . handleUp . call ( this , a ) : ( a . preventDefault ( ) , a . stopPropagation ( ) , this . dispose ( ) ) } ; module$exports$Blockly$TouchGesture . TouchGesture . prototype . isMultiTouch = function ( ) { return this . isMultiTouch _ } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . dispose = function ( ) { module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . dispose . call ( this ) ; this . onStartWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onStartWrapper _ ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . handleTouchStart = function ( a ) { var b = ( 0 , module$exports$Blockly$Touch . getTouchIdentifierFromEvent ) ( a ) ; this . cachedPoints _ [ b ] = this . getTouchPoint ( a ) ; b = Object . keys ( this . cachedPoints _ ) ; 2 === b . length && ( this . startDistance _ = module$exports$Blockly$utils$Coordinate . Coordinate . distance ( this . cachedPoints _ [ b [ 0 ] ] , this . cachedPoints _ [ b [ 1 ] ] ) , this . isMultiTouch _ = ! 0 , a . preventDefault ( ) ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . handleTouchMove = function ( a ) { var b = ( 0 , module$exports$Blockly$Touch . getTouchIdentifierFromEvent ) ( a ) ; this . cachedPoints _ [ b ] = this . getTouchPoint ( a ) ; b = Object . keys ( this . cachedPoints _ ) ; this . isPinchZoomEnabled _ && 2 === b . length ? this . handlePinch _ ( a ) : module$exports$Blockly$TouchGesture . TouchGesture . superClass _ . handleMove . call ( this , a ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . handlePinch _ = function ( a ) { var b = Object . keys ( this . cachedPoints _ ) ; b = module$exports$Blockly$utils$Coordinate . Coordinate . distance ( this . cachedPoints _ [ b [ 0 ] ] , this . cachedPoints _ [ b [ 1 ] ] ) / this . startDistance _ ; if ( 0 < this . previousScale _ && Infinity > this . previousScale _ ) { var c = b - this . previousScale _ ; c = 0 < c ? c * module$exports$Blockly$TouchGesture . TouchGesture . ZOOM _IN _MULTIPLIER : c * module$exports$Blockly$TouchGesture . TouchGesture . ZOOM _OUT _MULTIPLIER ; var d = this . startWorkspace _ ,
e = ( 0 , module$exports$Blockly$browserEvents . mouseToSvg ) ( a , d . getParentSvg ( ) , d . getInverseScreenCTM ( ) ) ; d . zoom ( e . x , e . y , c ) } this . previousScale _ = b ; a . preventDefault ( ) } ; module$exports$Blockly$TouchGesture . TouchGesture . prototype . handleTouchEnd = function ( a ) { a = ( 0 , module$exports$Blockly$Touch . getTouchIdentifierFromEvent ) ( a ) ; this . cachedPoints _ [ a ] && delete this . cachedPoints _ [ a ] ; 2 > Object . keys ( this . cachedPoints _ ) . length && ( this . cachedPoints _ = Object . create ( null ) , this . previousScale _ = 0 ) } ;
module$exports$Blockly$TouchGesture . TouchGesture . prototype . getTouchPoint = function ( a ) { return this . startWorkspace _ ? new module$exports$Blockly$utils$Coordinate . Coordinate ( a . changedTouches ? a . changedTouches [ 0 ] . pageX : a . pageX , a . changedTouches ? a . changedTouches [ 0 ] . pageY : a . pageY ) : null } ; var module$exports$Blockly$WorkspaceAudio = { WorkspaceAudio : function ( a ) { this . parentWorkspace _ = a ; this . SOUNDS _ = Object . create ( null ) } } ; module$exports$Blockly$WorkspaceAudio . WorkspaceAudio . prototype . lastSound _ = null ; module$exports$Blockly$WorkspaceAudio . WorkspaceAudio . prototype . dispose = function ( ) { this . SOUNDS _ = this . parentWorkspace _ = null } ;
module$exports$Blockly$WorkspaceAudio . WorkspaceAudio . prototype . load = function ( a , b ) { if ( a . length ) { try { var c = new $ . module$exports$Blockly$utils$global . globalThis . Audio } catch ( h ) { return } for ( var d , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] , g = f . match ( /\.(\w+)$/ ) ; if ( g && c . canPlayType ( "audio/" + g [ 1 ] ) ) { d = new $ . module$exports$Blockly$utils$global . globalThis . Audio ( f ) ; break } } d && d . play && ( this . SOUNDS _ [ b ] = d ) } } ;
module$exports$Blockly$WorkspaceAudio . WorkspaceAudio . prototype . preload = function ( ) { for ( var a in this . SOUNDS _ ) { var b = this . SOUNDS _ [ a ] ; b . volume = . 01 ; var c = b . play ( ) ; void 0 !== c ? c . then ( b . pause ) . catch ( function ( ) { } ) : b . pause ( ) ; if ( module$exports$Blockly$utils$userAgent . IPAD || module$exports$Blockly$utils$userAgent . IPHONE ) break } } ;
module$exports$Blockly$WorkspaceAudio . WorkspaceAudio . prototype . play = function ( a , b ) { var c = this . SOUNDS _ [ a ] ; c ? ( a = new Date , null !== this . lastSound _ && a - this . lastSound _ < $ . module$exports$Blockly$internalConstants . SOUND _LIMIT || ( this . lastSound _ = a , c = module$exports$Blockly$utils$userAgent . IPAD || module$exports$Blockly$utils$userAgent . ANDROID ? c : c . cloneNode ( ) , c . volume = void 0 === b ? 1 : b , c . play ( ) ) ) : this . parentWorkspace _ && this . parentWorkspace _ . getAudioManager ( ) . play ( a , b ) } ; var module$exports$Blockly$Events$ThemeChange = { ThemeChange : function ( a , b ) { module$exports$Blockly$Events$ThemeChange . ThemeChange . superClass _ . constructor . call ( this , b ) ; this . themeName = a } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$ThemeChange . ThemeChange , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$ThemeChange . ThemeChange . prototype . type = module$exports$Blockly$Events$utils . THEME _CHANGE ;
module$exports$Blockly$Events$ThemeChange . ThemeChange . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$ThemeChange . ThemeChange . superClass _ . toJson . call ( this ) ; a . themeName = this . themeName ; return a } ; module$exports$Blockly$Events$ThemeChange . ThemeChange . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$ThemeChange . ThemeChange . superClass _ . fromJson . call ( this , a ) ; this . themeName = a . themeName } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . THEME _CHANGE , module$exports$Blockly$Events$ThemeChange . ThemeChange ) ; var module$exports$Blockly$Events$ViewportChange = { ViewportChange : function ( a , b , c , d , e ) { module$exports$Blockly$Events$ViewportChange . ViewportChange . superClass _ . constructor . call ( this , d ) ; this . viewTop = a ; this . viewLeft = b ; this . scale = c ; this . oldScale = e } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$ViewportChange . ViewportChange , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$ViewportChange . ViewportChange . prototype . type = module$exports$Blockly$Events$utils . VIEWPORT _CHANGE ;
module$exports$Blockly$Events$ViewportChange . ViewportChange . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$ViewportChange . ViewportChange . superClass _ . toJson . call ( this ) ; a . viewTop = this . viewTop ; a . viewLeft = this . viewLeft ; a . scale = this . scale ; a . oldScale = this . oldScale ; return a } ;
module$exports$Blockly$Events$ViewportChange . ViewportChange . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$ViewportChange . ViewportChange . superClass _ . fromJson . call ( this , a ) ; this . viewTop = a . viewTop ; this . viewLeft = a . viewLeft ; this . scale = a . scale ; this . oldScale = a . oldScale } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . VIEWPORT _CHANGE , module$exports$Blockly$Events$ViewportChange . ViewportChange ) ; var module$exports$Blockly$IMetricsManager = { IMetricsManager : function ( ) { } } ; var module$exports$Blockly$MetricsManager = { MetricsManager : function ( a ) { this . workspace _ = a } } ; module$exports$Blockly$MetricsManager . MetricsManager . prototype . getDimensionsPx _ = function ( a ) { var b = 0 , c = 0 ; a && ( b = a . getWidth ( ) , c = a . getHeight ( ) ) ; return new module$exports$Blockly$utils$Size . Size ( b , c ) } ; module$exports$Blockly$MetricsManager . MetricsManager . prototype . getFlyoutMetrics = function ( a ) { a = this . getDimensionsPx _ ( this . workspace _ . getFlyout ( a ) ) ; return { width : a . width , height : a . height , position : this . workspace _ . toolboxPosition } } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getToolboxMetrics = function ( ) { var a = this . getDimensionsPx _ ( this . workspace _ . getToolbox ( ) ) ; return { width : a . width , height : a . height , position : this . workspace _ . toolboxPosition } } ; module$exports$Blockly$MetricsManager . MetricsManager . prototype . getSvgMetrics = function ( ) { return this . workspace _ . getCachedParentSvgSize ( ) } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getAbsoluteMetrics = function ( ) { var a = 0 , b = this . getToolboxMetrics ( ) , c = this . getFlyoutMetrics ( ! 0 ) , d = ! ! this . workspace _ . getToolbox ( ) , e = ! ! this . workspace _ . getFlyout ( ! 0 ) , f = d ? b . position : c . position , g = f === module$exports$Blockly$utils$toolbox . Position . LEFT ; f = f === module$exports$Blockly$utils$toolbox . Position . TOP ; d && g ? a = b . width : e && g && ( a = c . width ) ; g = 0 ; d && f ? g = b . height : e && f && ( g = c . height ) ; return { top : g , left : a } } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getViewMetrics = function ( a ) { a = a ? this . workspace _ . scale : 1 ; var b = this . getSvgMetrics ( ) , c = this . getToolboxMetrics ( ) , d = this . getFlyoutMetrics ( ! 0 ) , e = this . workspace _ . getToolbox ( ) ? c . position : d . position ; if ( this . workspace _ . getToolbox ( ) ) if ( e === module$exports$Blockly$utils$toolbox . Position . TOP || e === module$exports$Blockly$utils$toolbox . Position . BOTTOM ) b . height -= c . height ; else { if ( e === module$exports$Blockly$utils$toolbox . Position . LEFT || e === module$exports$Blockly$utils$toolbox . Position . RIGHT ) b . width -=
c . width } else if ( this . workspace _ . getFlyout ( ! 0 ) ) if ( e === module$exports$Blockly$utils$toolbox . Position . TOP || e === module$exports$Blockly$utils$toolbox . Position . BOTTOM ) b . height -= d . height ; else if ( e === module$exports$Blockly$utils$toolbox . Position . LEFT || e === module$exports$Blockly$utils$toolbox . Position . RIGHT ) b . width -= d . width ; return { height : b . height / a , width : b . width / a , top : - this . workspace _ . scrollY / a , left : - this . workspace _ . scrollX / a } } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getContentMetrics = function ( a ) { a = a ? 1 : this . workspace _ . scale ; var b = this . workspace _ . getBlocksBoundingBox ( ) ; return { height : ( b . bottom - b . top ) * a , width : ( b . right - b . left ) * a , top : b . top * a , left : b . left * a } } ; module$exports$Blockly$MetricsManager . MetricsManager . prototype . hasFixedEdges = function ( ) { return ! this . workspace _ . isMovableHorizontally ( ) || ! this . workspace _ . isMovableVertically ( ) } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getComputedFixedEdges _ = function ( a ) { if ( ! this . hasFixedEdges ( ) ) return { } ; var b = this . workspace _ . isMovableHorizontally ( ) , c = this . workspace _ . isMovableVertically ( ) ; a = a || this . getViewMetrics ( ! 1 ) ; var d = { } ; c || ( d . top = a . top , d . bottom = a . top + a . height ) ; b || ( d . left = a . left , d . right = a . left + a . width ) ; return d } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getPaddedContent _ = function ( a , b ) { var c = b . top + b . height , d = b . left + b . width , e = a . width ; a = a . height ; var f = e / 2 , g = a / 2 ; return { top : Math . min ( b . top - g , c - a ) , bottom : Math . max ( c + g , b . top + a ) , left : Math . min ( b . left - f , d - e ) , right : Math . max ( d + f , b . left + e ) } } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getScrollMetrics = function ( a , b , c ) { a = a ? this . workspace _ . scale : 1 ; b = b || this . getViewMetrics ( ! 1 ) ; var d = c || this . getContentMetrics ( ) ; c = this . getComputedFixedEdges _ ( b ) ; b = this . getPaddedContent _ ( b , d ) ; d = void 0 !== c . top ? c . top : b . top ; var e = void 0 !== c . left ? c . left : b . left ; return { top : d / a , left : e / a , width : ( ( void 0 !== c . right ? c . right : b . right ) - e ) / a , height : ( ( void 0 !== c . bottom ? c . bottom : b . bottom ) - d ) / a } } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getUiMetrics = function ( ) { return { viewMetrics : this . getViewMetrics ( ) , absoluteMetrics : this . getAbsoluteMetrics ( ) , toolboxMetrics : this . getToolboxMetrics ( ) } } ;
module$exports$Blockly$MetricsManager . MetricsManager . prototype . getMetrics = function ( ) { var a = this . getToolboxMetrics ( ) , b = this . getFlyoutMetrics ( ! 0 ) , c = this . getSvgMetrics ( ) , d = this . getAbsoluteMetrics ( ) , e = this . getViewMetrics ( ) , f = this . getContentMetrics ( ) , g = this . getScrollMetrics ( ! 1 , e , f ) ; return { contentHeight : f . height , contentWidth : f . width , contentTop : f . top , contentLeft : f . left , scrollHeight : g . height , scrollWidth : g . width , scrollTop : g . top , scrollLeft : g . left , viewHeight : e . height , viewWidth : e . width , viewTop : e . top , viewLeft : e . left ,
absoluteTop : d . top , absoluteLeft : d . left , svgHeight : c . height , svgWidth : c . width , toolboxWidth : a . width , toolboxHeight : a . height , toolboxPosition : a . position , flyoutWidth : b . width , flyoutHeight : b . height } } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . METRICS _MANAGER , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$MetricsManager . MetricsManager ) ; var module$exports$Blockly$WorkspaceSvg = { WorkspaceSvg : function ( a , b , c ) { module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . constructor . call ( this , a ) ; this . metricsManager _ = new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . METRICS _MANAGER , a , ! 0 ) ) ( this ) ; this . getMetrics = a . getMetrics || this . metricsManager _ . getMetrics . bind ( this . metricsManager _ ) ; this . setMetrics = a . setMetrics || module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . setTopLevelWorkspaceMetrics _ ;
this . componentManager _ = new module$exports$Blockly$ComponentManager . ComponentManager ; this . connectionDBList = module$exports$Blockly$ConnectionDB . ConnectionDB . init ( this . connectionChecker ) ; b && ( this . blockDragSurface _ = b ) ; c && ( this . workspaceDragSurface _ = c ) ; this . useWorkspaceDragSurface _ = ! ! this . workspaceDragSurface _ && ( 0 , module$exports$Blockly$utils$svgMath . is3dSupported ) ( ) ; this . highlightedBlocks _ = [ ] ; this . audioManager _ = new module$exports$Blockly$WorkspaceAudio . WorkspaceAudio ( a . parentWorkspace ) ; this . grid _ = this . options . gridPattern ?
new module$exports$Blockly$Grid . Grid ( this . options . gridPattern , a . gridOptions ) : null ; this . markerManager _ = new module$exports$Blockly$MarkerManager . MarkerManager ( this ) ; this . toolboxCategoryCallbacks _ = Object . create ( null ) ; this . flyoutButtonCallbacks _ = Object . create ( null ) ; ( a = $ . module$exports$Blockly$Variables ) && a . flyoutCategory && this . registerToolboxCategoryCallback ( a . CATEGORY _NAME , a . flyoutCategory ) ; ( a = module$exports$Blockly$VariablesDynamic ) && a . flyoutCategory && this . registerToolboxCategoryCallback ( a . CATEGORY _NAME ,
a . flyoutCategory ) ; ( a = $ . module$exports$Blockly$Procedures ) && a . flyoutCategory && ( this . registerToolboxCategoryCallback ( a . CATEGORY _NAME , a . flyoutCategory ) , this . addChangeListener ( a . mutatorOpenListener ) ) ; this . themeManager _ = this . options . parentWorkspace ? this . options . parentWorkspace . getThemeManager ( ) : new module$exports$Blockly$ThemeManager . ThemeManager ( this , this . options . theme || module$exports$Blockly$Themes$Classic . Classic ) ; this . themeManager _ . subscribeWorkspace ( this ) ; this . renderer _ = ( 0 , module$exports$Blockly$blockRendering . init ) ( this . options . renderer ||
"geras" , this . getTheme ( ) , this . options . rendererOverrides ) ; this . cachedParentSvg _ = null ; this . keyboardAccessibilityMode = ! 1 ; this . topBoundedElements _ = [ ] ; this . dragTargetAreas _ = [ ] ; this . cachedParentSvgSize _ = new module$exports$Blockly$utils$Size . Size ( 0 , 0 ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$WorkspaceSvg . WorkspaceSvg , module$exports$Blockly$Workspace . Workspace ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . resizeHandlerWrapper _ = null ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . rendered = ! 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isVisible _ = ! 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isFlyout = ! 1 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isMutator = ! 1 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . resizesEnabled _ = ! 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . scrollX = 0 ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . scrollY = 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . startScrollX = 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . startScrollY = 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . dragDeltaXY _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . scale = 1 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . oldScale _ = 1 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . oldTop _ = 0 ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . oldLeft _ = 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . trashcan = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . scrollbar = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . flyout _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . toolbox _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . currentGesture _ = null ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . blockDragSurface _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . workspaceDragSurface _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . useWorkspaceDragSurface _ = ! 1 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isDragSurfaceActive _ = ! 1 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . injectionDiv _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . lastRecordedPageScroll _ = null ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . targetWorkspace = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . inverseScreenCTM _ = null ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . inverseScreenCTMDirty _ = ! 0 ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getMarkerManager = function ( ) { return this . markerManager _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getMetricsManager = function ( ) { return this . metricsManager _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setMetricsManager = function ( a ) { this . metricsManager _ = a ; this . getMetrics = this . metricsManager _ . getMetrics . bind ( this . metricsManager _ ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getComponentManager = function ( ) { return this . componentManager _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setCursorSvg = function ( a ) { this . markerManager _ . setCursorSvg ( a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setMarkerSvg = function ( a ) { this . markerManager _ . setMarkerSvg ( a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getMarker = function ( a ) { return this . markerManager _ ? this . markerManager _ . getMarker ( a ) : null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getCursor = function ( ) { return this . markerManager _ ? this . markerManager _ . getCursor ( ) : null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getRenderer = function ( ) { return this . renderer _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getThemeManager = function ( ) { return this . themeManager _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getTheme = function ( ) { return this . themeManager _ . getTheme ( ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setTheme = function ( a ) { a || ( a = module$exports$Blockly$Themes$Classic . Classic ) ; this . themeManager _ . setTheme ( a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . refreshTheme = function ( ) { this . svgGroup _ && this . renderer _ . refreshDom ( this . svgGroup _ , this . getTheme ( ) ) ; this . updateBlockStyles _ ( this . getAllBlocks ( ! 1 ) . filter ( function ( b ) { return ! ! b . getStyleName ( ) } ) ) ; this . refreshToolboxSelection ( ) ; this . toolbox _ && this . toolbox _ . refreshTheme ( ) ; this . isVisible ( ) && this . setVisible ( ! 0 ) ; var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . THEME _CHANGE ) ) ( this . getTheme ( ) . name , this . id ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . updateBlockStyles _ = function ( a ) { for ( var b = 0 , c ; c = a [ b ] ; b ++ ) { var d = c . getStyleName ( ) ; d && ( c . setStyle ( d ) , c . mutator && c . mutator . updateBlockStyle ( ) ) } } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getInverseScreenCTM = function ( ) { if ( this . inverseScreenCTMDirty _ ) { var a = this . getParentSvg ( ) . getScreenCTM ( ) ; a && ( this . inverseScreenCTM _ = a . inverse ( ) , this . inverseScreenCTMDirty _ = ! 1 ) } return this . inverseScreenCTM _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . updateInverseScreenCTM = function ( ) { this . inverseScreenCTMDirty _ = ! 0 } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isVisible = function ( ) { return this . isVisible _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getSvgXY = function ( a ) { var b = 0 , c = 0 , d = 1 ; if ( ( 0 , module$exports$Blockly$utils$dom . containsNode ) ( this . getCanvas ( ) , a ) || ( 0 , module$exports$Blockly$utils$dom . containsNode ) ( this . getBubbleCanvas ( ) , a ) ) d = this . scale ; do { var e = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( a ) ; if ( a === this . getCanvas ( ) || a === this . getBubbleCanvas ( ) ) d = 1 ; b += e . x * d ; c += e . y * d ; a = a . parentNode } while ( a && a !== this . getParentSvg ( ) ) ; return new module$exports$Blockly$utils$Coordinate . Coordinate ( b ,
c ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getCachedParentSvgSize = function ( ) { var a = this . cachedParentSvgSize _ ; return new module$exports$Blockly$utils$Size . Size ( a . width , a . height ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getOriginOffsetInPixels = function ( ) { return ( 0 , module$exports$Blockly$utils$svgMath . getInjectionDivXY ) ( this . getCanvas ( ) ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getInjectionDiv = function ( ) { if ( ! this . injectionDiv _ ) for ( var a = this . svgGroup _ ; a ; ) { if ( - 1 !== ( " " + ( a . getAttribute ( "class" ) || "" ) + " " ) . indexOf ( " injectionDiv " ) ) { this . injectionDiv _ = a ; break } a = a . parentNode } return this . injectionDiv _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getBlockCanvas = function ( ) { return this . svgBlockCanvas _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setResizeHandlerWrapper = function ( a ) { this . resizeHandlerWrapper _ = a } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . createDom = function ( a ) { this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyWorkspace" } , null ) ; a && ( this . svgBackground _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { height : "100%" , width : "100%" , "class" : a } , this . svgGroup _ ) , "blocklyMainBackground" === a && this . grid _ ? this . svgBackground _ . style . fill = "url(#" + this . grid _ . getPatternId ( ) +
")" : this . themeManager _ . subscribe ( this . svgBackground _ , "workspaceBackgroundColour" , "fill" ) ) ; this . svgBlockCanvas _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyBlockCanvas" } , this . svgGroup _ ) ; this . svgBubbleCanvas _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyBubbleCanvas" } , this . svgGroup _ ) ; this . isFlyout || ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgGroup _ ,
"mousedown" , this , this . onMouseDown _ , ! 1 , ! 0 ) , document . body . addEventListener ( "wheel" , function ( ) { } ) , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgGroup _ , "wheel" , this , this . onMouseWheel _ ) ) ; this . options . hasCategories && ( this . toolbox _ = new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . TOOLBOX , this . options , ! 0 ) ) ( this ) ) ; this . grid _ && this . grid _ . update ( this . scale ) ; this . recordDragTargets ( ) ; ( a = ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . CURSOR ,
this . options ) ) && this . markerManager _ . setCursor ( new a ) ; this . renderer _ . createDom ( this . svgGroup _ , this . getTheme ( ) ) ; return this . svgGroup _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . dispose = function ( ) { this . rendered = ! 1 ; this . currentGesture _ && this . currentGesture _ . cancel ( ) ; this . svgGroup _ && ( ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . svgBubbleCanvas _ = this . svgBlockCanvas _ = null ; 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 . zoomControls _ = null ) ; this . audioManager _ && ( this . audioManager _ . dispose ( ) , this . audioManager _ = null ) ; this . grid _ && ( this . grid _ . dispose ( ) , this . grid _ = null ) ; this . renderer _ . dispose ( ) ; this . markerManager _ && ( this . markerManager _ . dispose ( ) , this . markerManager _ = null ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . dispose . call ( this ) ; this . themeManager _ && ( this . themeManager _ . unsubscribeWorkspace ( this ) , this . themeManager _ . unsubscribe ( this . svgBackground _ ) ,
this . options . parentWorkspace || ( this . themeManager _ . dispose ( ) , this . themeManager _ = null ) ) ; this . flyoutButtonCallbacks _ = this . toolboxCategoryCallbacks _ = this . connectionDBList = null ; if ( ! this . options . parentWorkspace ) { var a = this . getParentSvg ( ) ; a && a . parentNode && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( a . parentNode ) } this . resizeHandlerWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . resizeHandlerWrapper _ ) , this . resizeHandlerWrapper _ = null ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . newBlock = function ( a , b ) { return new module$exports$Blockly$BlockSvg . BlockSvg ( this , a , b ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . addTrashcan = function ( ) { var a = module$exports$Blockly$Trashcan . Trashcan ; if ( ! a ) throw Error ( "Missing require for Blockly.Trashcan" ) ; this . trashcan = new a ( this ) ; a = this . trashcan . createDom ( ) ; this . svgGroup _ . insertBefore ( a , this . svgBlockCanvas _ ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . addZoomControls = function ( ) { var a = module$exports$Blockly$ZoomControls . ZoomControls ; if ( ! a ) throw Error ( "Missing require for Blockly.ZoomControls" ) ; this . zoomControls _ = new a ( this ) ; a = this . zoomControls _ . createDom ( ) ; this . svgGroup _ . appendChild ( a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . addFlyout = function ( a ) { var b = new module$exports$Blockly$Options . Options ( { parentWorkspace : this , rtl : this . RTL , oneBasedIndex : this . options . oneBasedIndex , horizontalLayout : this . horizontalLayout , renderer : this . options . renderer , rendererOverrides : this . options . rendererOverrides , move : { scrollbars : ! 0 } } ) ; b . toolboxPosition = this . options . toolboxPosition ; this . flyout _ = this . horizontalLayout ? new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . FLYOUTS _HORIZONTAL _TOOLBOX ,
this . options , ! 0 ) ) ( b ) : new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . FLYOUTS _VERTICAL _TOOLBOX , this . options , ! 0 ) ) ( b ) ; this . flyout _ . autoClose = ! 1 ; this . flyout _ . getWorkspace ( ) . setVisible ( ! 0 ) ; return this . flyout _ . createDom ( a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getFlyout = function ( a ) { return this . flyout _ || a ? this . flyout _ : this . toolbox _ ? this . toolbox _ . getFlyout ( ) : null } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getToolbox = function ( ) { return this . toolbox _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . updateScreenCalculations _ = function ( ) { this . updateInverseScreenCTM ( ) ; this . recordDragTargets ( ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . resizeContents = function ( ) { this . resizesEnabled _ && this . rendered && ( this . scrollbar && this . scrollbar . resize ( ) , this . updateInverseScreenCTM ( ) ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . resize = function ( ) { this . toolbox _ && this . toolbox _ . position ( ) ; this . flyout _ && this . flyout _ . position ( ) ; for ( var a = this . componentManager _ . getComponents ( module$exports$Blockly$ComponentManager . ComponentManager . Capability . POSITIONABLE , ! 0 ) , b = this . getMetricsManager ( ) . getUiMetrics ( ) , c = [ ] , d = 0 , e ; e = a [ d ] ; d ++ ) e . position ( b , c ) , ( e = e . getBoundingRectangle ( ) ) && c . push ( e ) ; this . scrollbar && this . scrollbar . resize ( ) ; this . updateScreenCalculations _ ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . updateScreenCalculationsIfScrolled = function ( ) { var a = ( 0 , module$exports$Blockly$utils$svgMath . getDocumentScroll ) ( ) ; module$exports$Blockly$utils$Coordinate . Coordinate . equals ( this . lastRecordedPageScroll _ , a ) || ( this . lastRecordedPageScroll _ = a , this . updateScreenCalculations _ ( ) ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getCanvas = function ( ) { return this . svgBlockCanvas _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setCachedParentSvgSize = function ( a , b ) { var c = this . getParentSvg ( ) ; a && ( this . cachedParentSvgSize _ . width = a , c . cachedWidth _ = a ) ; b && ( this . cachedParentSvgSize _ . height = b , c . cachedHeight _ = b ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getBubbleCanvas = function ( ) { return this . svgBubbleCanvas _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getParentSvg = function ( ) { if ( ! this . cachedParentSvg _ ) for ( var a = this . svgGroup _ ; a ; ) { if ( "svg" === a . tagName ) { this . cachedParentSvg _ = a ; break } a = a . parentNode } return this . cachedParentSvg _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . maybeFireViewportChangeEvent = function ( ) { if ( ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) ) { var a = this . scale , b = - this . scrollY , c = - this . scrollX ; if ( ! ( a === this . oldScale _ && 1 > Math . abs ( b - this . oldTop _ ) && 1 > Math . abs ( c - this . oldLeft _ ) ) ) { var d = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VIEWPORT _CHANGE ) ) ( b , c , a , this . id , this . oldScale _ ) ; this . oldScale _ = a ; this . oldTop _ = b ; this . oldLeft _ = c ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( d ) } } } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . translate = function ( a , b ) { if ( this . useWorkspaceDragSurface _ && this . isDragSurfaceActive _ ) this . workspaceDragSurface _ . translateSurface ( a , b ) ; else { var c = "translate(" + a + "," + b + ") scale(" + this . scale + ")" ; this . svgBlockCanvas _ . setAttribute ( "transform" , c ) ; this . svgBubbleCanvas _ . setAttribute ( "transform" , c ) } this . blockDragSurface _ && this . blockDragSurface _ . translateAndScaleGroup ( a , b , this . scale ) ; this . grid _ && this . grid _ . moveTo ( a , b ) ; this . maybeFireViewportChangeEvent ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . resetDragSurface = function ( ) { if ( this . useWorkspaceDragSurface _ ) { this . isDragSurfaceActive _ = ! 1 ; var a = this . workspaceDragSurface _ . getSurfaceTranslation ( ) ; this . workspaceDragSurface _ . clearAndHide ( this . svgGroup _ ) ; a = "translate(" + a . x + "," + a . y + ") scale(" + this . scale + ")" ; this . svgBlockCanvas _ . setAttribute ( "transform" , a ) ; this . svgBubbleCanvas _ . setAttribute ( "transform" , a ) } } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setupDragSurface = function ( ) { if ( this . useWorkspaceDragSurface _ && ! this . isDragSurfaceActive _ ) { this . isDragSurfaceActive _ = ! 0 ; var a = this . svgBlockCanvas _ . previousSibling , b = parseInt ( this . getParentSvg ( ) . getAttribute ( "width" ) , 10 ) , c = parseInt ( this . getParentSvg ( ) . getAttribute ( "height" ) , 10 ) , d = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( this . getCanvas ( ) ) ; this . workspaceDragSurface _ . setContentsAndShow ( this . getCanvas ( ) , this . getBubbleCanvas ( ) , a , b ,
c , this . scale ) ; this . workspaceDragSurface _ . translateSurface ( d . x , d . y ) } } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getBlockDragSurface = function ( ) { return this . blockDragSurface _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getWidth = function ( ) { var a = this . getMetrics ( ) ; return a ? a . viewWidth / this . scale : 0 } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setVisible = function ( a ) { this . isVisible _ = a ; if ( this . svgGroup _ ) if ( 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 ) { a = this . getAllBlocks ( ! 1 ) ; for ( var b = a . length - 1 ; 0 <= b ; b -- ) a [ b ] . markDirty ( ) ; this . render ( ) ; this . toolbox _ && this . toolbox _ . position ( ) } else this . hideChaff ( ! 0 ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . render = function ( ) { for ( var a = this . getAllBlocks ( ! 1 ) , b = a . length - 1 ; 0 <= b ; b -- ) a [ b ] . render ( ! 1 ) ; if ( this . currentGesture _ ) for ( a = this . currentGesture _ . getInsertionMarkers ( ) , b = 0 ; b < a . length ; b ++ ) a [ b ] . render ( ! 1 ) ; this . markerManager _ . updateMarkers ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . highlightBlock = function ( a , b ) { if ( void 0 === b ) { for ( var c = 0 , d ; d = this . highlightedBlocks _ [ c ] ; c ++ ) d . setHighlighted ( ! 1 ) ; this . highlightedBlocks _ . length = 0 } if ( a = a ? this . getBlockById ( a ) : null ) ( b = void 0 === b || b ) ? - 1 === this . highlightedBlocks _ . indexOf ( a ) && this . highlightedBlocks _ . push ( a ) : ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . highlightedBlocks _ , a ) , a . setHighlighted ( b ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . paste = function ( a ) { this . rendered && ( a . type || a . tagName ) && ( this . currentGesture _ && this . currentGesture _ . cancel ( ) , a . type ? this . pasteBlock _ ( null , a ) : "comment" === a . tagName . toLowerCase ( ) ? this . pasteWorkspaceComment _ ( a ) : this . pasteBlock _ ( a , null ) ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . pasteBlock _ = function ( a , b ) { ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { var c = 0 , d = 0 ; if ( a ) { var e = ( 0 , $ . module$exports$Blockly$Xml . domToBlock ) ( a , this ) ; c = parseInt ( a . getAttribute ( "x" ) , 10 ) ; this . RTL && ( c = - c ) ; d = parseInt ( a . getAttribute ( "y" ) , 10 ) } else b && ( e = ( 0 , module$exports$Blockly$serialization$blocks . append ) ( b , this ) , c = b . x || 10 , this . RTL && ( c = this . getWidth ( ) - c ) , d = b . y || 10 ) ; if ( ! isNaN ( c ) && ! isNaN ( d ) ) { do { var f = ! 1 ; var g = this . getAllBlocks ( ! 1 ) ; a = 0 ; for ( b =
void 0 ; b = g [ a ] ; a ++ ) { var h = b . getRelativeToSurfaceXY ( ) ; if ( 1 >= Math . abs ( c - h . x ) && 1 >= Math . abs ( d - h . y ) ) { f = ! 0 ; break } } if ( ! f ) { var k = e . getConnections _ ( ! 1 ) ; a = 0 ; for ( b = void 0 ; b = k [ a ] ; a ++ ) if ( b . closest ( $ . module$exports$Blockly$internalConstants . SNAP _RADIUS , new module$exports$Blockly$utils$Coordinate . Coordinate ( c , d ) ) . connection ) { f = ! 0 ; break } } f && ( c = this . RTL ? c - $ . module$exports$Blockly$internalConstants . SNAP _RADIUS : c + $ . module$exports$Blockly$internalConstants . SNAP _RADIUS , d += 2 * $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ) } while ( f ) ;
e . moveTo ( new module$exports$Blockly$utils$Coordinate . Coordinate ( c , d ) ) } } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ! e . isShadow ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CREATE ) ) ( e ) ) ; e . select ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . pasteWorkspaceComment _ = function ( a ) { ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { var b = module$exports$Blockly$WorkspaceCommentSvg . fromXml ( a , this ) ; var c = parseInt ( a . getAttribute ( "x" ) , 10 ) , d = parseInt ( a . getAttribute ( "y" ) , 10 ) ; isNaN ( c ) || isNaN ( d ) || ( this . RTL && ( c = - c ) , b . moveBy ( c + 50 , d + 50 ) ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && module$exports$Blockly$WorkspaceComment . fireCreateEvent ( b ) ;
b . select ( ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . refreshToolboxSelection = function ( ) { var a = this . isFlyout ? this . targetWorkspace : this ; a && ! a . currentGesture _ && a . toolbox _ && a . toolbox _ . getFlyout ( ) && a . toolbox _ . refreshSelection ( ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . renameVariableById = function ( a , b ) { module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . renameVariableById . call ( this , a , b ) ; this . refreshToolboxSelection ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . deleteVariableById = function ( a ) { module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . deleteVariableById . call ( this , a ) ; this . refreshToolboxSelection ( ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . createVariable = function ( a , b , c ) { a = module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . createVariable . call ( this , a , b , c ) ; this . refreshToolboxSelection ( ) ; return a } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . recordDeleteAreas = function ( ) { module$exports$Blockly$utils . deprecation . warn ( "WorkspaceSvg.prototype.recordDeleteAreas" , "June 2021" , "June 2022" , "WorkspaceSvg.prototype.recordDragTargets" ) ; this . recordDragTargets ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . recordDragTargets = function ( ) { var a = this . componentManager _ . getComponents ( module$exports$Blockly$ComponentManager . ComponentManager . Capability . DRAG _TARGET , ! 0 ) ; this . dragTargetAreas _ = [ ] ; for ( var b = 0 , c ; c = a [ b ] ; b ++ ) { var d = c . getClientRect ( ) ; d && this . dragTargetAreas _ . push ( { component : c , clientRect : d } ) } } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getDragTarget = function ( a ) { for ( var b = 0 , c ; c = this . dragTargetAreas _ [ b ] ; b ++ ) if ( c . clientRect . contains ( a . clientX , a . clientY ) ) return c . component ; return null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . onMouseDown _ = function ( a ) { var b = this . getGesture ( a ) ; b && b . handleWsStart ( a , this ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . startDrag = function ( a , b ) { a = ( 0 , module$exports$Blockly$browserEvents . mouseToSvg ) ( a , this . getParentSvg ( ) , this . getInverseScreenCTM ( ) ) ; a . x /= this . scale ; a . y /= this . scale ; this . dragDeltaXY _ = module$exports$Blockly$utils$Coordinate . Coordinate . difference ( b , a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . moveDrag = function ( a ) { a = ( 0 , module$exports$Blockly$browserEvents . mouseToSvg ) ( a , this . getParentSvg ( ) , this . getInverseScreenCTM ( ) ) ; a . x /= this . scale ; a . y /= this . scale ; return module$exports$Blockly$utils$Coordinate . Coordinate . sum ( this . dragDeltaXY _ , a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isDragging = function ( ) { return null !== this . currentGesture _ && this . currentGesture _ . isDragging ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isDraggable = function ( ) { return this . options . moveOptions && this . options . moveOptions . drag } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isMovable = function ( ) { 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 } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isMovableHorizontally = function ( ) { var a = ! ! this . scrollbar ; return this . isMovable ( ) && ( ! a || a && this . scrollbar . canScrollHorizontally ( ) ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . isMovableVertically = function ( ) { var a = ! ! this . scrollbar ; return this . isMovable ( ) && ( ! a || a && this . scrollbar . canScrollVertically ( ) ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . onMouseWheel _ = function ( a ) { if ( module$exports$Blockly$Gesture . Gesture . inProgress ( ) ) a . preventDefault ( ) , a . stopPropagation ( ) ; else { var b = this . options . zoomOptions && this . options . zoomOptions . wheel , c = this . options . moveOptions && this . options . moveOptions . wheel ; if ( b || c ) { var d = ( 0 , module$exports$Blockly$browserEvents . getScrollDeltaPixels ) ( a ) ; if ( module$exports$Blockly$utils$userAgent . MAC ) var e = a . metaKey ; b && ( a . ctrlKey || e || ! c ) ? ( d = - d . y / 50 , b = ( 0 , module$exports$Blockly$browserEvents . mouseToSvg ) ( a ,
this . getParentSvg ( ) , this . getInverseScreenCTM ( ) ) , this . zoom ( b . x , b . y , d ) ) : ( b = this . scrollX - d . x , c = this . scrollY - d . y , a . shiftKey && ! d . x && ( b = this . scrollX - d . y , c = this . scrollY ) , this . scroll ( b , c ) ) ; a . preventDefault ( ) } } } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getBlocksBoundingBox = function ( ) { var a = this . getTopBoundedElements ( ) ; if ( ! a . length ) return new module$exports$Blockly$utils$Rect . Rect ( 0 , 0 , 0 , 0 ) ; for ( var b = a [ 0 ] . getBoundingRectangle ( ) , c = 1 ; c < a . length ; c ++ ) { var d = a [ c ] ; d . isInsertionMarker && d . isInsertionMarker ( ) || ( d = d . getBoundingRectangle ( ) , d . top < b . top && ( b . top = d . top ) , d . bottom > b . bottom && ( b . bottom = d . bottom ) , d . left < b . left && ( b . left = d . left ) , d . right > b . right && ( b . right = d . right ) ) } return b } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . cleanUp = function ( ) { this . setResizesEnabled ( ! 1 ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; for ( var a = this . getTopBlocks ( ! 0 ) , b = 0 , c = 0 , d ; d = a [ c ] ; c ++ ) if ( d . isMovable ( ) ) { var e = d . getRelativeToSurfaceXY ( ) ; d . moveBy ( - e . x , b - e . y ) ; d . snapToGrid ( ) ; b = d . getRelativeToSurfaceXY ( ) . y + d . getHeightWidth ( ) . height + this . renderer _ . getConstants ( ) . MIN _BLOCK _HEIGHT } ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) ; this . setResizesEnabled ( ! 0 ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . showContextMenu = function ( a ) { if ( ! this . options . readOnly && ! this . isFlyout ) { var b = module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . getContextMenuOptions ( module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE , { workspace : this } ) ; this . configureContextMenu && this . configureContextMenu ( b , a ) ; ( 0 , $ . module$exports$Blockly$ContextMenu . show ) ( a , b , this . RTL ) } } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . updateToolbox = function ( a ) { if ( a = ( 0 , module$exports$Blockly$utils$toolbox . convertToolboxDefToJson ) ( a ) ) { if ( ! this . options . languageTree ) throw Error ( "Existing toolbox is null. Can't create new toolbox." ) ; if ( ( 0 , module$exports$Blockly$utils$toolbox . hasCategories ) ( a ) ) { if ( ! this . toolbox _ ) throw Error ( "Existing toolbox has no categories. Can't change mode." ) ; this . options . languageTree = a ; this . toolbox _ . render ( a ) } else { if ( ! this . flyout _ ) throw Error ( "Existing toolbox has categories. Can't change mode." ) ;
this . options . languageTree = a ; this . flyout _ . show ( a ) } } else if ( this . options . languageTree ) throw Error ( "Can't nullify an existing toolbox." ) ; } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . markFocused = function ( ) { this . options . parentWorkspace ? this . options . parentWorkspace . markFocused ( ) : ( ( 0 , $ . module$exports$Blockly$common . setMainWorkspace ) ( this ) , this . setBrowserFocus ( ) ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setBrowserFocus = function ( ) { document . activeElement && document . activeElement . blur && document . activeElement . blur ( ) ; try { this . getParentSvg ( ) . focus ( { preventScroll : ! 0 } ) } catch ( a ) { try { this . getParentSvg ( ) . parentNode . setActive ( ) } catch ( b ) { this . getParentSvg ( ) . parentNode . focus ( { preventScroll : ! 0 } ) } } } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . zoom = function ( a , b , c ) { c = Math . pow ( this . options . zoomOptions . scaleSpeed , c ) ; var d = this . scale * c ; if ( this . scale !== d ) { d > this . options . zoomOptions . maxScale ? c = this . options . zoomOptions . maxScale / this . scale : d < this . options . zoomOptions . minScale && ( c = this . options . zoomOptions . minScale / this . scale ) ; var e = this . getCanvas ( ) . getCTM ( ) , f = this . getParentSvg ( ) . createSVGPoint ( ) ; f . x = a ; f . y = b ; f = f . matrixTransform ( e . inverse ( ) ) ; a = f . x ; b = f . y ; e = e . translate ( a * ( 1 - c ) , b * ( 1 - c ) ) . scale ( c ) ;
this . scrollX = e . e ; this . scrollY = e . f ; this . setScale ( d ) } } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . zoomCenter = function ( a ) { var b = this . getMetrics ( ) ; if ( this . flyout _ ) { var c = b . svgWidth ? b . svgWidth / 2 : 0 ; b = b . svgHeight ? b . svgHeight / 2 : 0 } else c = b . viewWidth / 2 + b . absoluteLeft , b = b . viewHeight / 2 + b . absoluteTop ; this . zoom ( c , b , a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . zoomToFit = function ( ) { if ( this . isMovable ( ) ) { var a = this . getMetrics ( ) , b = a . viewWidth ; a = a . viewHeight ; var c = this . getBlocksBoundingBox ( ) , d = c . right - c . left ; c = c . bottom - c . top ; if ( d ) { this . flyout _ && ( this . horizontalLayout ? ( a += this . flyout _ . getHeight ( ) , c += this . flyout _ . getHeight ( ) / this . scale ) : ( b += this . flyout _ . getWidth ( ) , d += this . flyout _ . getWidth ( ) / this . scale ) ) ; b /= d ; a /= c ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { this . setScale ( Math . min ( b , a ) ) , this . scrollCenter ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } this . maybeFireViewportChangeEvent ( ) } } else console . warn ( "Tried to move a non-movable workspace. This could result in blocks becoming inaccessible." ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . beginCanvasTransition = function ( ) { ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgBlockCanvas _ , "blocklyCanvasTransitioning" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgBubbleCanvas _ , "blocklyCanvasTransitioning" ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . endCanvasTransition = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgBlockCanvas _ , "blocklyCanvasTransitioning" ) ; ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgBubbleCanvas _ , "blocklyCanvasTransitioning" ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . scrollCenter = function ( ) { if ( this . isMovable ( ) ) { var a = this . getMetrics ( ) , b = ( a . scrollWidth - a . viewWidth ) / 2 , c = ( a . scrollHeight - a . viewHeight ) / 2 ; b = - b - a . scrollLeft ; c = - c - a . scrollTop ; this . scroll ( b , c ) } else console . warn ( "Tried to move a non-movable workspace. This could result in blocks becoming inaccessible." ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . centerOnBlock = function ( a ) { if ( this . isMovable ( ) ) { if ( a = a ? this . getBlockById ( a ) : null ) { var b = a . getRelativeToSurfaceXY ( ) , c = a . getHeightWidth ( ) , d = this . scale ; a = ( b . x + ( this . RTL ? - 1 : 1 ) * c . width / 2 ) * d ; b = ( b . y + c . height / 2 ) * d ; c = this . getMetrics ( ) ; this . scroll ( - ( a - c . viewWidth / 2 ) , - ( b - c . viewHeight / 2 ) ) } } else console . warn ( "Tried to move a non-movable workspace. This could result in blocks becoming inaccessible." ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setScale = function ( a ) { this . options . zoomOptions . maxScale && a > this . options . zoomOptions . maxScale ? a = this . options . zoomOptions . maxScale : this . options . zoomOptions . minScale && a < this . options . zoomOptions . minScale && ( a = this . options . zoomOptions . minScale ) ; this . scale = a ; this . hideChaff ( ! 1 ) ; ( a = this . getFlyout ( ! 1 ) ) && a . isVisible ( ) && ( a . reflow ( ) , this . recordDragTargets ( ) ) ; this . grid _ && this . grid _ . update ( this . scale ) ; a = this . getMetrics ( ) ; this . scrollX -= a . absoluteLeft ; this . scrollY -=
a . absoluteTop ; a . viewLeft += a . absoluteLeft ; a . viewTop += a . absoluteTop ; this . scroll ( this . scrollX , this . scrollY ) ; this . scrollbar && ( this . flyout _ ? this . scrollbar . resizeView ( a ) : this . scrollbar . resizeContent ( a ) ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getScale = function ( ) { return this . options . parentWorkspace ? this . options . parentWorkspace . getScale ( ) : this . scale } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . scroll = function ( a , b ) { this . hideChaff ( ! 0 ) ; var c = this . getMetrics ( ) ; a = Math . min ( a , - c . scrollLeft ) ; b = Math . min ( b , - c . scrollTop ) ; var 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 ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . setTopLevelWorkspaceMetrics _ = function ( a ) { var b = this . getMetrics ( ) ; "number" === typeof a . x && ( this . scrollX = - ( b . scrollLeft + ( b . scrollWidth - b . viewWidth ) * a . x ) ) ; "number" === typeof a . y && ( this . scrollY = - ( b . scrollTop + ( b . scrollHeight - b . viewHeight ) * a . y ) ) ; this . translate ( this . scrollX + b . absoluteLeft , this . scrollY + b . absoluteTop ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getBlockById = function ( a ) { return module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . getBlockById . call ( this , a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getTopBlocks = function ( a ) { return module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . getTopBlocks . call ( this , a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . addTopBlock = function ( a ) { this . addTopBoundedElement ( a ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . addTopBlock . call ( this , a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . removeTopBlock = function ( a ) { this . removeTopBoundedElement ( a ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . removeTopBlock . call ( this , a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . addTopComment = function ( a ) { this . addTopBoundedElement ( a ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . addTopComment . call ( this , a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . removeTopComment = function ( a ) { this . removeTopBoundedElement ( a ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . removeTopComment . call ( this , a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . addTopBoundedElement = function ( a ) { this . topBoundedElements _ . push ( a ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . removeTopBoundedElement = function ( a ) { ( 0 , module$exports$Blockly$utils$array . removeElem ) ( this . topBoundedElements _ , a ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getTopBoundedElements = function ( ) { return [ ] . concat ( this . topBoundedElements _ ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . setResizesEnabled = function ( a ) { var b = ! this . resizesEnabled _ && a ; this . resizesEnabled _ = a ; b && this . resizeContents ( ) } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . clear = function ( ) { this . setResizesEnabled ( ! 1 ) ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . superClass _ . clear . call ( this ) ; this . topBoundedElements _ = [ ] ; this . setResizesEnabled ( ! 0 ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . registerButtonCallback = function ( a , b ) { if ( "function" !== typeof b ) throw TypeError ( "Button callbacks must be functions." ) ; this . flyoutButtonCallbacks _ [ a ] = b } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getButtonCallback = function ( a ) { return ( a = this . flyoutButtonCallbacks _ [ a ] ) ? a : null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . removeButtonCallback = function ( a ) { this . flyoutButtonCallbacks _ [ a ] = null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . registerToolboxCategoryCallback = function ( a , b ) { if ( "function" !== typeof b ) throw TypeError ( "Toolbox category callbacks must be functions." ) ; this . toolboxCategoryCallbacks _ [ a ] = b } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getToolboxCategoryCallback = function ( a ) { return this . toolboxCategoryCallbacks _ [ a ] || null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . removeToolboxCategoryCallback = function ( a ) { this . toolboxCategoryCallbacks _ [ a ] = null } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getGesture = function ( a ) { var b = "mousedown" === a . type || "touchstart" === a . type || "pointerdown" === a . type , c = this . currentGesture _ ; return c ? b && c . hasStarted ( ) ? ( console . warn ( "Tried to start the same gesture twice." ) , c . cancel ( ) , null ) : c : b ? this . currentGesture _ = new module$exports$Blockly$TouchGesture . TouchGesture ( a , this ) : null } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . clearGesture = function ( ) { this . currentGesture _ = null } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . cancelCurrentGesture = function ( ) { this . currentGesture _ && this . currentGesture _ . cancel ( ) } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getAudioManager = function ( ) { return this . audioManager _ } ; module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . getGrid = function ( ) { return this . grid _ } ;
module$exports$Blockly$WorkspaceSvg . WorkspaceSvg . prototype . hideChaff = function ( a ) { ( 0 , module$exports$Blockly$Tooltip . hide ) ( ) ; ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) ; var b = ! ! a ; this . getComponentManager ( ) . getComponents ( module$exports$Blockly$ComponentManager . ComponentManager . Capability . AUTOHIDEABLE , ! 0 ) . forEach ( function ( c ) { return c . autoHide ( b ) } ) } ; module$exports$Blockly$WorkspaceSvg . resizeSvgContents = function ( a ) { a . resizeContents ( ) } ; var module$exports$Blockly$inject = { inject : function ( a , b ) { "string" === typeof a && ( a = document . getElementById ( a ) || document . querySelector ( a ) ) ; if ( ! a || ! ( 0 , module$exports$Blockly$utils$dom . containsNode ) ( document , a ) ) throw Error ( "Error: container is not in current document." ) ; b = new module$exports$Blockly$Options . Options ( b || { } ) ; var c = document . createElement ( "div" ) ; c . className = "injectionDiv" ; c . tabIndex = 0 ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( c , module$exports$Blockly$utils$aria . State . LABEL , $ . module$exports$Blockly$Msg . Msg . WORKSPACE _ARIA _LABEL ) ;
a . appendChild ( c ) ; a = module$contents$Blockly$inject _createDom ( c , b ) ; var d = new module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg ( c ) , e = new module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg ( c ) , f = module$contents$Blockly$inject _createMainWorkspace ( a , b , d , e ) ; module$contents$Blockly$inject _init ( f ) ; ( 0 , $ . module$exports$Blockly$common . setMainWorkspace ) ( f ) ; ( 0 , $ . module$exports$Blockly$common . svgResize ) ( f ) ; c . addEventListener ( "focusin" , function ( ) { ( 0 , $ . module$exports$Blockly$common . setMainWorkspace ) ( f ) } ) ;
return f } } , module$contents$Blockly$inject _createDom = function ( a , b ) { a . setAttribute ( "dir" , "LTR" ) ; ( 0 , module$exports$Blockly$Css . inject ) ( b . hasCss , b . pathToMedia ) ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . SVG , { xmlns : module$exports$Blockly$utils$dom . SVG _NS , "xmlns:html" : module$exports$Blockly$utils$dom . HTML _NS , "xmlns:xlink" : module$exports$Blockly$utils$dom . XLINK _NS , version : "1.1" , "class" : "blocklySvg" , tabindex : "0" } , a ) ; var c = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . DEFS ,
{ } , a ) , d = String ( Math . random ( ) ) . substring ( 2 ) ; b . gridPattern = module$exports$Blockly$Grid . Grid . createDom ( d , b . gridOptions , c ) ; return a } , module$contents$Blockly$inject _createMainWorkspace = function ( a , b , c , d ) { b . parentWorkspace = null ; b = new module$exports$Blockly$WorkspaceSvg . WorkspaceSvg ( b , c , d ) ; c = b . options ; b . scale = c . zoomOptions . startScale ; a . appendChild ( b . createDom ( "blocklyMainBackground" ) ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b . getInjectionDiv ( ) , b . getRenderer ( ) . getClassName ( ) ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b . getInjectionDiv ( ) ,
b . getTheme ( ) . getClassName ( ) ) ; ! c . hasCategories && c . languageTree && ( d = b . addFlyout ( module$exports$Blockly$utils$Svg . Svg . SVG ) , ( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( d , a ) ) ; c . hasTrashcan && b . addTrashcan ( ) ; c . zoomOptions && c . zoomOptions . controls && b . addZoomControls ( ) ; b . getThemeManager ( ) . subscribe ( a , "workspaceBackgroundColour" , "background-color" ) ; b . translate ( 0 , 0 ) ; b . addChangeListener ( ( 0 , module$exports$Blockly$bumpObjects . bumpIntoBoundsHandler ) ( b ) ) ; ( 0 , $ . module$exports$Blockly$common . svgResize ) ( b ) ; ( 0 , module$exports$Blockly$WidgetDiv . createDom ) ( ) ;
module$exports$Blockly$DropDownDiv . DropDownDiv . createDom ( ) ; ( 0 , module$exports$Blockly$Tooltip . createDom ) ( ) ; return b } , module$contents$Blockly$inject _init = function ( a ) { var b = a . options , c = a . getParentSvg ( ) ; ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( c . parentNode , "contextmenu" , null , function ( e ) { ( 0 , module$exports$Blockly$browserEvents . isTargetInput ) ( e ) || e . preventDefault ( ) } ) ; c = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( window , "resize" , null , function ( ) { a . hideChaff ( ! 0 ) ; ( 0 , $ . module$exports$Blockly$common . svgResize ) ( a ) ;
module$exports$Blockly$bumpObjects . bumpTopObjectsIntoBounds ( a ) } ) ; a . setResizeHandlerWrapper ( c ) ; module$contents$Blockly$inject _bindDocumentEvents ( ) ; if ( b . languageTree ) { c = a . getToolbox ( ) ; var d = a . getFlyout ( ! 0 ) ; c ? c . init ( ) : d && ( d . init ( a ) , d . show ( b . languageTree ) , "function" === typeof d . scrollToStart && d . scrollToStart ( ) ) } b . hasTrashcan && a . trashcan . init ( ) ; b . zoomOptions && b . zoomOptions . controls && a . zoomControls _ . init ( ) ; b . moveOptions && b . moveOptions . scrollbars ? ( a . scrollbar = new module$exports$Blockly$ScrollbarPair . ScrollbarPair ( a ,
! 0 === b . moveOptions . scrollbars || ! ! b . moveOptions . scrollbars . horizontal , ! 0 === b . moveOptions . scrollbars || ! ! b . moveOptions . scrollbars . vertical , "blocklyMainWorkspaceScrollbar" ) , a . scrollbar . resize ( ) ) : a . setMetrics ( { x : . 5 , y : . 5 } ) ; b . hasSounds && module$contents$Blockly$inject _loadSounds ( b . pathToMedia , a ) } , module$contents$Blockly$inject _onKeyDown = function ( a ) { var b = ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) ; if ( b && ! ( ( 0 , module$exports$Blockly$browserEvents . isTargetInput ) ( a ) || b . rendered && ! b . isVisible ( ) ) ) module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . onKeyDown ( b ,
a ) } , module$contents$Blockly$inject _documentEventsBound = ! 1 , module$contents$Blockly$inject _bindDocumentEvents = function ( ) { module$contents$Blockly$inject _documentEventsBound || ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "scroll" , null , function ( ) { for ( var a = module$exports$Blockly$Workspace . Workspace . getAll ( ) , b = 0 , c ; c = a [ b ] ; b ++ ) c . updateInverseScreenCTM && c . updateInverseScreenCTM ( ) } ) , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "keydown" , null , module$contents$Blockly$inject _onKeyDown ) ,
( 0 , module$exports$Blockly$browserEvents . bind ) ( document , "touchend" , null , module$exports$Blockly$Touch . longStop ) , ( 0 , module$exports$Blockly$browserEvents . bind ) ( document , "touchcancel" , null , module$exports$Blockly$Touch . longStop ) , module$exports$Blockly$utils$userAgent . IPAD && ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( window , "orientationchange" , document , function ( ) { ( 0 , $ . module$exports$Blockly$common . svgResize ) ( ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) ) } ) ) ; module$contents$Blockly$inject _documentEventsBound =
! 0 } , module$contents$Blockly$inject _loadSounds = function ( a , b ) { var c = b . getAudioManager ( ) ; c . load ( [ a + "click.mp3" , a + "click.wav" , a + "click.ogg" ] , "click" ) ; c . load ( [ a + "disconnect.wav" , a + "disconnect.mp3" , a + "disconnect.ogg" ] , "disconnect" ) ; c . load ( [ a + "delete.mp3" , a + "delete.ogg" , a + "delete.wav" ] , "delete" ) ; var d = [ ] ; a = function ( ) { for ( ; d . length ; ) ( 0 , module$exports$Blockly$browserEvents . unbind ) ( d . pop ( ) ) ; c . preload ( ) } ; d . push ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mousemove" , null , a , ! 0 ) ) ; d . push ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document ,
"touchstart" , null , a , ! 0 ) ) } ; var module$exports$Blockly$IComponent = { IComponent : function ( ) { } } ; var module$exports$Blockly$IDragTarget = { IDragTarget : function ( ) { } } ; var module$exports$Blockly$DragTarget = { DragTarget : function ( ) { } } ; module$exports$Blockly$DragTarget . DragTarget . prototype . onDragEnter = function ( a ) { } ; module$exports$Blockly$DragTarget . DragTarget . prototype . onDragOver = function ( a ) { } ; module$exports$Blockly$DragTarget . DragTarget . prototype . onDragExit = function ( a ) { } ; module$exports$Blockly$DragTarget . DragTarget . prototype . onDrop = function ( a ) { } ; module$exports$Blockly$DragTarget . DragTarget . prototype . shouldPreventMove = function ( a ) { return ! 1 } ; var module$exports$Blockly$IDeleteArea = { IDeleteArea : function ( ) { } } ; var module$exports$Blockly$DeleteArea = { DeleteArea : function ( ) { module$exports$Blockly$DeleteArea . DeleteArea . superClass _ . constructor . call ( this ) ; this . wouldDelete _ = ! 1 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$DeleteArea . DeleteArea , module$exports$Blockly$DragTarget . DragTarget ) ;
module$exports$Blockly$DeleteArea . DeleteArea . prototype . wouldDelete = function ( a , b ) { a instanceof module$exports$Blockly$BlockSvg . BlockSvg ? ( a = ! a . getParent ( ) && a . isDeletable ( ) , this . updateWouldDelete _ ( a && ! b ) ) : this . updateWouldDelete _ ( a . isDeletable ( ) ) ; return this . wouldDelete _ } ; module$exports$Blockly$DeleteArea . DeleteArea . prototype . updateWouldDelete _ = function ( a ) { this . wouldDelete _ = a } ; var module$exports$Blockly$FlyoutMetricsManager = { FlyoutMetricsManager : function ( a , b ) { this . flyout _ = b ; module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager , module$exports$Blockly$MetricsManager . MetricsManager ) ;
module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager . prototype . getBoundingBox _ = function ( ) { try { var a = this . workspace _ . getCanvas ( ) . getBBox ( ) } catch ( b ) { a = { height : 0 , y : 0 , width : 0 , x : 0 } } return a } ; module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager . prototype . getContentMetrics = function ( a ) { var b = this . getBoundingBox _ ( ) ; a = a ? 1 : this . workspace _ . scale ; return { height : b . height * a , width : b . width * a , top : b . y * a , left : b . x * a } } ;
module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager . prototype . getScrollMetrics = function ( a , b , c ) { b = c || this . getContentMetrics ( ) ; c = this . flyout _ . MARGIN * this . workspace _ . scale ; a = a ? this . workspace _ . scale : 1 ; return { height : ( b . height + 2 * c ) / a , width : ( b . width + b . left + c ) / a , top : 0 , left : 0 } } ; var module$exports$Blockly$IFlyout = { IFlyout : function ( ) { } } ; var module$exports$Blockly$Flyout = { Flyout : function ( a ) { module$exports$Blockly$Flyout . Flyout . superClass _ . constructor . call ( this ) ; a . setMetrics = this . setMetrics _ . bind ( this ) ; this . workspace _ = new module$exports$Blockly$WorkspaceSvg . WorkspaceSvg ( a ) ; this . workspace _ . setMetricsManager ( new module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager ( this . workspace _ , this ) ) ; this . workspace _ . isFlyout = ! 0 ; this . workspace _ . setVisible ( this . isVisible _ ) ; this . id = ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; this . RTL =
! ! a . RTL ; this . horizontalLayout = ! 1 ; this . toolboxPosition _ = a . toolboxPosition ; this . eventWrappers _ = [ ] ; this . mats _ = [ ] ; this . buttons _ = [ ] ; this . listeners _ = [ ] ; this . permanentlyDisabled _ = [ ] ; this . tabWidth _ = this . workspace _ . getRenderer ( ) . getConstants ( ) . TAB _WIDTH ; this . targetWorkspace = null ; this . recycledBlocks _ = [ ] } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Flyout . Flyout , module$exports$Blockly$DeleteArea . DeleteArea ) ; module$exports$Blockly$Flyout . Flyout . prototype . autoClose = ! 0 ;
module$exports$Blockly$Flyout . Flyout . prototype . isVisible _ = ! 1 ; module$exports$Blockly$Flyout . Flyout . prototype . containerVisible _ = ! 0 ; module$exports$Blockly$Flyout . Flyout . prototype . CORNER _RADIUS = 8 ; module$exports$Blockly$Flyout . Flyout . prototype . MARGIN = module$exports$Blockly$Flyout . Flyout . prototype . CORNER _RADIUS ; module$exports$Blockly$Flyout . Flyout . prototype . GAP _X = 3 * module$exports$Blockly$Flyout . Flyout . prototype . MARGIN ; module$exports$Blockly$Flyout . Flyout . prototype . GAP _Y = 3 * module$exports$Blockly$Flyout . Flyout . prototype . MARGIN ;
module$exports$Blockly$Flyout . Flyout . prototype . SCROLLBAR _MARGIN = 2.5 ; module$exports$Blockly$Flyout . Flyout . prototype . width _ = 0 ; module$exports$Blockly$Flyout . Flyout . prototype . height _ = 0 ; module$exports$Blockly$Flyout . Flyout . prototype . dragAngleRange _ = 70 ;
module$exports$Blockly$Flyout . Flyout . prototype . createDom = function ( a ) { this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( a , { "class" : "blocklyFlyout" , style : "display: none" } , null ) ; this . svgBackground _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyFlyoutBackground" } , this . svgGroup _ ) ; this . svgGroup _ . appendChild ( this . workspace _ . createDom ( ) ) ; this . workspace _ . getThemeManager ( ) . subscribe ( this . svgBackground _ , "flyoutBackgroundColour" ,
"fill" ) ; this . workspace _ . getThemeManager ( ) . subscribe ( this . svgBackground _ , "flyoutOpacity" , "fill-opacity" ) ; return this . svgGroup _ } ;
module$exports$Blockly$Flyout . Flyout . prototype . init = function ( a ) { this . targetWorkspace = a ; this . workspace _ . targetWorkspace = a ; this . workspace _ . scrollbar = new module$exports$Blockly$ScrollbarPair . ScrollbarPair ( this . workspace _ , this . horizontalLayout , ! this . horizontalLayout , "blocklyFlyoutScrollbar" , this . SCROLLBAR _MARGIN ) ; this . hide ( ) ; Array . prototype . push . apply ( this . eventWrappers _ , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgGroup _ , "wheel" , this , this . wheel _ ) ) ; this . autoClose || ( this . filterWrapper _ =
this . filterForCapacity _ . bind ( this ) , this . targetWorkspace . addChangeListener ( this . filterWrapper _ ) ) ; Array . prototype . push . apply ( this . eventWrappers _ , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgBackground _ , "mousedown" , 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 : 1 , capabilities : [ module$exports$Blockly$ComponentManager . ComponentManager . Capability . DELETE _AREA , module$exports$Blockly$ComponentManager . ComponentManager . Capability . DRAG _TARGET ] } ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . dispose = function ( ) { this . hide ( ) ; this . workspace _ . getComponentManager ( ) . removeComponent ( this . id ) ; ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . eventWrappers _ ) ; this . filterWrapper _ && ( this . targetWorkspace . removeChangeListener ( this . filterWrapper _ ) , this . filterWrapper _ = null ) ; this . workspace _ && ( this . workspace _ . getThemeManager ( ) . unsubscribe ( this . svgBackground _ ) , this . workspace _ . targetWorkspace = null , this . workspace _ . dispose ( ) , this . workspace _ = null ) ; this . svgGroup _ &&
( ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . targetWorkspace = this . svgBackground _ = null } ; module$exports$Blockly$Flyout . Flyout . prototype . getWidth = function ( ) { return this . width _ } ; module$exports$Blockly$Flyout . Flyout . prototype . getHeight = function ( ) { return this . height _ } ; module$exports$Blockly$Flyout . Flyout . prototype . getFlyoutScale = function ( ) { return this . targetWorkspace . scale } ; module$exports$Blockly$Flyout . Flyout . prototype . getWorkspace = function ( ) { return this . workspace _ } ;
module$exports$Blockly$Flyout . Flyout . prototype . isVisible = function ( ) { return this . isVisible _ } ; module$exports$Blockly$Flyout . Flyout . prototype . setVisible = function ( a ) { var b = a !== this . isVisible ( ) ; this . isVisible _ = a ; b && ( this . autoClose || this . workspace _ . recordDragTargets ( ) , this . updateDisplay _ ( ) ) } ; module$exports$Blockly$Flyout . Flyout . prototype . setContainerVisible = function ( a ) { var b = a !== this . containerVisible _ ; this . containerVisible _ = a ; b && this . updateDisplay _ ( ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . updateDisplay _ = function ( ) { var a = this . containerVisible _ ? this . isVisible ( ) : ! 1 ; this . svgGroup _ . style . display = a ? "block" : "none" ; this . workspace _ . scrollbar . setContainerVisible ( a ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . positionAt _ = function ( a , b , c , d ) { this . svgGroup _ . setAttribute ( "width" , a ) ; this . svgGroup _ . setAttribute ( "height" , b ) ; this . workspace _ . setCachedParentSvgSize ( a , b ) ; "svg" === this . svgGroup _ . tagName ? ( 0 , module$exports$Blockly$utils$dom . setCssTransform ) ( this . svgGroup _ , "translate(" + c + "px," + d + "px)" ) : this . svgGroup _ . setAttribute ( "transform" , "translate(" + c + "," + d + ")" ) ; 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 ) } ; module$exports$Blockly$Flyout . Flyout . prototype . hide = function ( ) { if ( this . isVisible ( ) ) { this . setVisible ( ! 1 ) ; for ( var a = 0 , b ; b = this . listeners _ [ a ] ; a ++ ) ( 0 , module$exports$Blockly$browserEvents . unbind ) ( b ) ; this . listeners _ . length = 0 ; this . reflowWrapper _ && ( this . workspace _ . removeChangeListener ( this . reflowWrapper _ ) , this . reflowWrapper _ = null ) } } ;
module$exports$Blockly$Flyout . Flyout . prototype . show = function ( a ) { this . workspace _ . setResizesEnabled ( ! 1 ) ; this . hide ( ) ; this . clearOldBlocks _ ( ) ; "string" === typeof a && ( a = this . getDynamicCategoryContents _ ( a ) ) ; this . setVisible ( ! 0 ) ; a = ( 0 , module$exports$Blockly$utils$toolbox . convertFlyoutDefToJsonArray ) ( a ) ; a = this . createFlyoutInfo _ ( a ) ; this . layout _ ( a . contents , a . gaps ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgBackground _ , "mouseover" , this , function ( ) { for ( var b = this . workspace _ . getTopBlocks ( ! 1 ) ,
c = 0 , d ; d = b [ c ] ; c ++ ) d . removeSelect ( ) } ) ) ; this . horizontalLayout ? this . height _ = 0 : this . width _ = 0 ; this . workspace _ . setResizesEnabled ( ! 0 ) ; this . reflow ( ) ; this . filterForCapacity _ ( ) ; this . position ( ) ; this . reflowWrapper _ = this . reflow . bind ( this ) ; this . workspace _ . addChangeListener ( this . reflowWrapper _ ) ; this . emptyRecycledBlocks _ ( ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . createFlyoutInfo _ = function ( a ) { var b = [ ] , c = [ ] ; this . permanentlyDisabled _ . length = 0 ; for ( var d = this . horizontalLayout ? this . GAP _X : this . GAP _Y , e = 0 , f ; f = a [ e ] ; e ++ ) switch ( f . custom && ( f = this . getDynamicCategoryContents _ ( f . custom ) , f = ( 0 , module$exports$Blockly$utils$toolbox . convertFlyoutDefToJsonArray ) ( f ) , a . splice . apply ( a , [ e , 1 ] . concat ( f ) ) , f = a [ e ] ) , f . kind . toUpperCase ( ) ) { case "BLOCK" : var g = this . createFlyoutBlock _ ( f ) ; b . push ( { type : "block" , block : g } ) ; this . addBlockGap _ ( f , c , d ) ; break ;
case "SEP" : this . addSeparatorGap _ ( f , c , d ) ; break ; case "LABEL" : f = this . createButton _ ( f , ! 0 ) ; b . push ( { type : "button" , button : f } ) ; c . push ( d ) ; break ; case "BUTTON" : f = this . createButton _ ( f , ! 1 ) , b . push ( { type : "button" , button : f } ) , c . push ( d ) } return { contents : b , gaps : c } } ;
module$exports$Blockly$Flyout . Flyout . prototype . getDynamicCategoryContents _ = function ( a ) { a = this . workspace _ . targetWorkspace . getToolboxCategoryCallback ( a ) ; if ( "function" !== typeof a ) throw TypeError ( "Couldn't find a callback function when opening a toolbox category." ) ; return a ( this . workspace _ . targetWorkspace ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . createButton _ = function ( a , b ) { var c = module$exports$Blockly$FlyoutButton . FlyoutButton ; if ( ! c ) throw Error ( "Missing require for Blockly.FlyoutButton" ) ; return new c ( this . workspace _ , this . targetWorkspace , a , b ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . createFlyoutBlock _ = function ( a ) { var b ; a . blockxml ? ( a = "string" === typeof a . blockxml ? ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a . blockxml ) : a . blockxml , ( b = this . getRecycledBlock _ ( a . getAttribute ( "type" ) ) ) || ( b = ( 0 , $ . module$exports$Blockly$Xml . domToBlock ) ( a , this . workspace _ ) ) ) : ( b = this . getRecycledBlock _ ( a . type ) , b || ( void 0 === a . enabled && ( a . enabled = "true" !== a . disabled && ! 0 !== a . disabled ) , b = ( 0 , module$exports$Blockly$serialization$blocks . append ) ( a , this . workspace _ ) ) ) ; b . isEnabled ( ) ||
this . permanentlyDisabled _ . push ( b ) ; return b } ; module$exports$Blockly$Flyout . Flyout . prototype . getRecycledBlock _ = function ( a ) { for ( var b = - 1 , c = 0 ; c < this . recycledBlocks _ . length ; c ++ ) if ( this . recycledBlocks _ [ c ] . type === a ) { b = c ; break } return - 1 === b ? void 0 : this . recycledBlocks _ . splice ( b , 1 ) [ 0 ] } ;
module$exports$Blockly$Flyout . Flyout . prototype . addBlockGap _ = function ( a , b , c ) { if ( a . gap ) var d = parseInt ( a . gap , 10 ) ; else a . blockxml && ( a = "string" === typeof a . blockxml ? ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a . blockxml ) : a . blockxml , d = parseInt ( a . getAttribute ( "gap" ) , 10 ) ) ; b . push ( isNaN ( d ) ? c : d ) } ; module$exports$Blockly$Flyout . Flyout . prototype . addSeparatorGap _ = function ( a , b , c ) { a = parseInt ( a . gap , 10 ) ; ! isNaN ( a ) && 0 < b . length ? b [ b . length - 1 ] = a : b . push ( c ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . clearOldBlocks _ = function ( ) { for ( var a = this . workspace _ . getTopBlocks ( ! 1 ) , b = 0 , c ; c = a [ b ] ; b ++ ) this . blockIsRecyclable _ ( c ) ? this . recycleBlock _ ( c ) : c . dispose ( ! 1 , ! 1 ) ; for ( a = 0 ; a < this . mats _ . length ; a ++ ) if ( b = this . mats _ [ a ] ) ( 0 , module$exports$Blockly$Tooltip . unbindMouseEvents ) ( b ) , ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( b ) ; for ( a = this . mats _ . length = 0 ; b = this . buttons _ [ a ] ; a ++ ) b . dispose ( ) ; this . buttons _ . length = 0 ; this . workspace _ . getPotentialVariableMap ( ) . clear ( ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . emptyRecycledBlocks _ = function ( ) { for ( var a = 0 ; a < this . recycledBlocks _ . length ; a ++ ) this . recycledBlocks _ [ a ] . dispose ( ) ; this . recycledBlocks _ = [ ] } ; module$exports$Blockly$Flyout . Flyout . prototype . blockIsRecyclable _ = function ( a ) { return ! 1 } ; module$exports$Blockly$Flyout . Flyout . prototype . recycleBlock _ = function ( a ) { var b = a . getRelativeToSurfaceXY ( ) ; a . moveBy ( - b . x , - b . y ) ; this . recycledBlocks _ . push ( a ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . addBlockListeners _ = function ( a , b , c ) { this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , "mousedown" , null , this . blockMouseDown _ ( b ) ) ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( c , "mousedown" , null , this . blockMouseDown _ ( b ) ) ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . bind ) ( a , "mouseenter" , b , b . addSelect ) ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . bind ) ( a , "mouseleave" ,
b , b . removeSelect ) ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . bind ) ( c , "mouseenter" , b , b . addSelect ) ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . bind ) ( c , "mouseleave" , b , b . removeSelect ) ) } ; module$exports$Blockly$Flyout . Flyout . prototype . blockMouseDown _ = function ( a ) { var b = this ; return function ( c ) { var d = b . targetWorkspace . getGesture ( c ) ; d && ( d . setStartBlock ( a ) , d . handleFlyoutStart ( c , b ) ) } } ;
module$exports$Blockly$Flyout . Flyout . prototype . onMouseDown _ = function ( a ) { var b = this . targetWorkspace . getGesture ( a ) ; b && b . handleFlyoutStart ( a , this ) } ; module$exports$Blockly$Flyout . Flyout . prototype . isBlockCreatable _ = function ( a ) { return a . isEnabled ( ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . createBlock = function ( a ) { var b = null ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; var c = this . targetWorkspace . getAllVariables ( ) ; this . targetWorkspace . setResizesEnabled ( ! 1 ) ; try { b = this . placeNewBlock _ ( a ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } this . targetWorkspace . hideChaff ( ) ; a = ( 0 , $ . module$exports$Blockly$Variables . getAddedVariables ) ( this . targetWorkspace , c ) ; if ( ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ;
for ( c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . VAR _CREATE ) ) ( d ) ) } ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CREATE ) ) ( b ) ) } this . autoClose ? this . hide ( ) : this . filterForCapacity _ ( ) ; return b } ;
module$exports$Blockly$Flyout . Flyout . prototype . initFlyoutButton _ = function ( a , b , c ) { var d = a . createDom ( ) ; a . moveTo ( b , c ) ; a . show ( ) ; this . listeners _ . push ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( d , "mousedown" , this , this . onMouseDown _ ) ) ; this . buttons _ . push ( a ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . createRect _ = function ( a , b , c , d , e ) { b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "fill-opacity" : 0 , x : b , y : c , height : d . height , width : d . width } , null ) ; b . tooltip = a ; ( 0 , module$exports$Blockly$Tooltip . bindMouseEvents ) ( b ) ; this . workspace _ . getCanvas ( ) . insertBefore ( b , a . getSvgRoot ( ) ) ; a . flyoutRect _ = b ; return this . mats _ [ e ] = b } ;
module$exports$Blockly$Flyout . Flyout . prototype . moveRectToBlock _ = function ( a , b ) { var c = b . getHeightWidth ( ) ; a . setAttribute ( "width" , c . width ) ; a . setAttribute ( "height" , c . height ) ; b = b . getRelativeToSurfaceXY ( ) ; a . setAttribute ( "y" , b . y ) ; a . setAttribute ( "x" , this . RTL ? b . x - c . width : b . x ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . filterForCapacity _ = function ( ) { for ( var a = this . workspace _ . getTopBlocks ( ! 1 ) , b = 0 , c ; c = a [ b ] ; b ++ ) if ( - 1 === this . permanentlyDisabled _ . indexOf ( c ) ) for ( var d = this . targetWorkspace . isCapacityAvailable ( ( 0 , $ . module$exports$Blockly$common . getBlockTypeCounts ) ( c ) ) ; c ; ) c . setEnabled ( d ) , c = c . getNextBlock ( ) } ;
module$exports$Blockly$Flyout . Flyout . prototype . reflow = function ( ) { this . reflowWrapper _ && this . workspace _ . removeChangeListener ( this . reflowWrapper _ ) ; this . reflowInternal _ ( ) ; this . reflowWrapper _ && this . workspace _ . addChangeListener ( this . reflowWrapper _ ) } ; module$exports$Blockly$Flyout . Flyout . prototype . isScrollable = function ( ) { return this . workspace _ . scrollbar ? this . workspace _ . scrollbar . isVisible ( ) : ! 1 } ;
module$exports$Blockly$Flyout . Flyout . prototype . placeNewBlock _ = function ( a ) { var b = this . targetWorkspace ; if ( ! a . getSvgRoot ( ) ) throw Error ( "oldBlock is not rendered." ) ; var c = ( 0 , module$exports$Blockly$serialization$blocks . save ) ( a ) ; b . setResizesEnabled ( ! 1 ) ; b = ( 0 , module$exports$Blockly$serialization$blocks . append ) ( c , b ) ; this . positionNewBlock _ ( a , b ) ; return b } ;
module$exports$Blockly$Flyout . Flyout . prototype . positionNewBlock _ = function ( a , b ) { var c = this . targetWorkspace , d = c . getOriginOffsetInPixels ( ) , e = this . workspace _ . getOriginOffsetInPixels ( ) ; a = a . getRelativeToSurfaceXY ( ) ; a . scale ( this . workspace _ . scale ) ; e = module$exports$Blockly$utils$Coordinate . Coordinate . sum ( e , a ) ; d = module$exports$Blockly$utils$Coordinate . Coordinate . difference ( e , d ) ; d . scale ( 1 / c . scale ) ; b . moveTo ( new module$exports$Blockly$utils$Coordinate . Coordinate ( d . x , d . y ) ) } ; var module$exports$Blockly$VerticalFlyout = { VerticalFlyout : function ( a ) { module$exports$Blockly$VerticalFlyout . VerticalFlyout . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$VerticalFlyout . VerticalFlyout , module$exports$Blockly$Flyout . Flyout ) ; module$exports$Blockly$VerticalFlyout . VerticalFlyout . registryName = "verticalFlyout" ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . setMetrics _ = function ( a ) { if ( this . isVisible ( ) ) { var b = this . workspace _ . getMetricsManager ( ) , c = b . getScrollMetrics ( ) , d = b . getViewMetrics ( ) ; b = b . getAbsoluteMetrics ( ) ; "number" === typeof a . y && ( this . workspace _ . scrollY = - ( c . top + ( c . height - d . height ) * a . y ) ) ; this . workspace _ . translate ( this . workspace _ . scrollX + b . left , this . workspace _ . scrollY + b . top ) } } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . getX = function ( ) { if ( ! this . isVisible ( ) ) return 0 ; var a = this . targetWorkspace . getMetricsManager ( ) , b = a . getAbsoluteMetrics ( ) , c = a . getViewMetrics ( ) ; a = a . getToolboxMetrics ( ) ; return this . targetWorkspace . toolboxPosition === this . toolboxPosition _ ? this . targetWorkspace . getToolbox ( ) ? this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . LEFT ? a . width : c . width - this . width _ : this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . LEFT ?
0 : c . width : this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . LEFT ? 0 : c . width + b . left - this . width _ } ; module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . getY = function ( ) { return 0 } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . position = function ( ) { if ( this . isVisible ( ) && this . targetWorkspace . isVisible ( ) ) { var a = this . targetWorkspace . getMetricsManager ( ) . getViewMetrics ( ) ; this . height _ = a . height ; this . setBackgroundPath _ ( this . width _ - this . CORNER _RADIUS , a . height - 2 * this . CORNER _RADIUS ) ; a = this . getX ( ) ; var b = this . getY ( ) ; this . positionAt _ ( this . width _ , this . height _ , a , b ) } } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . setBackgroundPath _ = function ( a , b ) { var c = this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . RIGHT , d = a + this . CORNER _RADIUS ; d = [ "M " + ( c ? d : 0 ) + ",0" ] ; d . push ( "h" , c ? - a : a ) ; d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , c ? 0 : 1 , c ? - this . CORNER _RADIUS : this . CORNER _RADIUS , this . CORNER _RADIUS ) ; d . push ( "v" , Math . max ( 0 , b ) ) ; d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , c ? 0 : 1 , c ? this . CORNER _RADIUS : - this . CORNER _RADIUS , this . CORNER _RADIUS ) ;
d . push ( "h" , c ? a : - a ) ; d . push ( "z" ) ; this . svgBackground _ . setAttribute ( "d" , d . join ( " " ) ) } ; module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . scrollToStart = function ( ) { this . workspace _ . scrollbar . setY ( 0 ) } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . wheel _ = function ( a ) { var b = ( 0 , module$exports$Blockly$browserEvents . getScrollDeltaPixels ) ( a ) ; if ( b . y ) { var c = this . workspace _ . getMetricsManager ( ) , d = c . getScrollMetrics ( ) ; b = c . getViewMetrics ( ) . top - d . top + b . y ; this . workspace _ . scrollbar . setY ( b ) ; ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) } a . preventDefault ( ) ; a . stopPropagation ( ) } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . layout _ = function ( a , b ) { this . workspace _ . scale = this . targetWorkspace . scale ; for ( var c = this . MARGIN , d = this . RTL ? c : c + this . tabWidth _ , e = 0 , f ; f = a [ e ] ; e ++ ) if ( "block" === f . type ) { f = f . block ; for ( var g = f . getDescendants ( ! 1 ) , h = 0 , k ; k = g [ h ] ; h ++ ) k . isInFlyout = ! 0 ; f . render ( ) ; g = f . getSvgRoot ( ) ; h = f . getHeightWidth ( ) ; k = f . outputConnection ? d - this . tabWidth _ : d ; f . moveBy ( k , c ) ; k = this . createRect _ ( f , this . RTL ? k - h . width : k , c , h , e ) ; this . addBlockListeners _ ( g , f , k ) ; c += h . height + b [ e ] } else "button" ===
f . type && ( this . initFlyoutButton _ ( f . button , d , c ) , c += f . button . height + b [ e ] ) } ; module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . isDragTowardWorkspace = function ( a ) { a = Math . atan2 ( a . y , a . x ) / Math . PI * 180 ; var b = this . dragAngleRange _ ; return a < b && a > - b || a < - 180 + b || a > 180 - b ? ! 0 : ! 1 } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . getClientRect = function ( ) { if ( ! this . svgGroup _ || this . autoClose || ! this . isVisible ( ) ) return null ; var a = this . svgGroup _ . getBoundingClientRect ( ) , b = a . left ; return this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . LEFT ? new module$exports$Blockly$utils$Rect . Rect ( - 1E9 , 1E9 , - 1E9 , b + a . width ) : new module$exports$Blockly$utils$Rect . Rect ( - 1E9 , 1E9 , b , 1E9 ) } ;
module$exports$Blockly$VerticalFlyout . VerticalFlyout . prototype . reflowInternal _ = function ( ) { this . workspace _ . scale = this . getFlyoutScale ( ) ; for ( var a = 0 , b = this . workspace _ . getTopBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) { var e = d . getHeightWidth ( ) . width ; d . outputConnection && ( e -= this . tabWidth _ ) ; a = Math . max ( a , e ) } for ( c = 0 ; d = this . buttons _ [ c ] ; c ++ ) a = Math . max ( a , d . width ) ; a += 1.5 * this . MARGIN + this . tabWidth _ ; a *= this . workspace _ . scale ; a += module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ; if ( this . width _ !== a ) { for ( c = 0 ; d = b [ c ] ; c ++ ) { if ( this . RTL ) { e =
d . getRelativeToSurfaceXY ( ) . x ; var f = a / this . workspace _ . scale - this . MARGIN ; d . outputConnection || ( f -= this . tabWidth _ ) ; d . moveBy ( f - e , 0 ) } d . flyoutRect _ && this . moveRectToBlock _ ( d . flyoutRect _ , d ) } if ( this . RTL ) for ( b = 0 ; c = this . buttons _ [ b ] ; b ++ ) d = c . getPosition ( ) . y , c . moveTo ( a / this . workspace _ . scale - c . width - this . MARGIN - this . tabWidth _ , d ) ; this . targetWorkspace . toolboxPosition !== this . toolboxPosition _ || this . toolboxPosition _ !== module$exports$Blockly$utils$toolbox . Position . LEFT || this . targetWorkspace . getToolbox ( ) || this . targetWorkspace . translate ( this . targetWorkspace . scrollX +
a , this . targetWorkspace . scrollY ) ; this . width _ = a ; this . position ( ) ; this . targetWorkspace . recordDragTargets ( ) } } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . FLYOUTS _VERTICAL _TOOLBOX , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$VerticalFlyout . VerticalFlyout ) ; var module$exports$Blockly$IToolboxItem = { IToolboxItem : function ( ) { } } ; var module$exports$Blockly$ISelectableToolboxItem = { ISelectableToolboxItem : function ( ) { } } ; var module$exports$Blockly$ICollapsibleToolboxItem = { ICollapsibleToolboxItem : function ( ) { } } ; var module$exports$Blockly$ToolboxItem = { ToolboxItem : function ( a , b , c ) { this . id _ = a . toolboxitemid || ( 0 , module$exports$Blockly$utils$idGenerator . getNextUniqueId ) ( ) ; this . level _ = ( this . parent _ = c || null ) ? this . parent _ . getLevel ( ) + 1 : 0 ; this . toolboxItemDef _ = a ; this . parentToolbox _ = b ; this . workspace _ = this . parentToolbox _ . getWorkspace ( ) } } ; module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . init = function ( ) { } ; module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . getDiv = function ( ) { return null } ;
module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . getId = function ( ) { return this . id _ } ; module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . getParent = function ( ) { return null } ; module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . getLevel = function ( ) { return this . level _ } ; module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . isSelectable = function ( ) { return ! 1 } ; module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . isCollapsible = function ( ) { return ! 1 } ;
module$exports$Blockly$ToolboxItem . ToolboxItem . prototype . dispose = function ( ) { } ; var module$exports$Blockly$ToolboxCategory = { ToolboxCategory : function ( a , b , c ) { module$exports$Blockly$ToolboxCategory . ToolboxCategory . superClass _ . constructor . call ( this , a , b , c ) ; this . name _ = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . name ) ; this . colour _ = this . getColour _ ( a ) ; this . labelDom _ = this . iconDom _ = this . rowContents _ = this . rowDiv _ = this . htmlDiv _ = null ; this . cssConfig _ = this . makeDefaultCssConfig _ ( ) ; ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( this . cssConfig _ , a . cssconfig || a . cssConfig ) ;
this . isDisabled _ = this . isHidden _ = ! 1 ; this . flyoutItems _ = [ ] ; this . parseContents _ ( a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$ToolboxCategory . ToolboxCategory , module$exports$Blockly$ToolboxItem . ToolboxItem ) ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . registrationName = "category" ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . nestedPadding = 19 ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . borderWidth = 8 ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . defaultBackgroundColour = "#57e" ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . makeDefaultCssConfig _ = function ( ) { return { container : "blocklyToolboxCategory" , row : "blocklyTreeRow" , rowcontentcontainer : "blocklyTreeRowContentContainer" , icon : "blocklyTreeIcon" , label : "blocklyTreeLabel" , contents : "blocklyToolboxContents" , selected : "blocklyTreeSelected" , openicon : "blocklyTreeIconOpen" , closedicon : "blocklyTreeIconClosed" } } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . parseContents _ = function ( a ) { var b = a . contents ; if ( a . custom ) this . flyoutItems _ = a . custom ; else if ( b ) for ( a = 0 ; a < b . length ; a ++ ) this . flyoutItems _ . push ( b [ a ] ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . init = function ( ) { this . createDom _ ( ) ; "true" === this . toolboxItemDef _ . hidden && this . hide ( ) } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . createDom _ = function ( ) { this . htmlDiv _ = this . createContainer _ ( ) ; ( 0 , module$exports$Blockly$utils$aria . setRole ) ( this . htmlDiv _ , module$exports$Blockly$utils$aria . Role . TREEITEM ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . htmlDiv _ , module$exports$Blockly$utils$aria . State . SELECTED , ! 1 ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . htmlDiv _ , module$exports$Blockly$utils$aria . State . LEVEL , this . level _ ) ; this . rowDiv _ = this . createRowContainer _ ( ) ;
this . rowDiv _ . style . pointerEvents = "auto" ; this . htmlDiv _ . appendChild ( this . rowDiv _ ) ; this . rowContents _ = this . createRowContentsContainer _ ( ) ; this . rowContents _ . style . pointerEvents = "none" ; this . rowDiv _ . appendChild ( this . rowContents _ ) ; this . iconDom _ = this . createIconDom _ ( ) ; ( 0 , module$exports$Blockly$utils$aria . setRole ) ( this . iconDom _ , module$exports$Blockly$utils$aria . Role . PRESENTATION ) ; this . rowContents _ . appendChild ( this . iconDom _ ) ; this . labelDom _ = this . createLabelDom _ ( this . name _ ) ; this . rowContents _ . appendChild ( this . labelDom _ ) ;
( 0 , module$exports$Blockly$utils$aria . setState ) ( this . htmlDiv _ , module$exports$Blockly$utils$aria . State . LABELLEDBY , this . labelDom _ . getAttribute ( "id" ) ) ; this . addColourBorder _ ( this . colour _ ) ; return this . htmlDiv _ } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . createContainer _ = function ( ) { var a = document . createElement ( "div" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . container ) ; return a } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . createRowContainer _ = function ( ) { var a = document . createElement ( "div" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . row ) ; var b = module$exports$Blockly$ToolboxCategory . ToolboxCategory . nestedPadding * this . getLevel ( ) ; b = b . toString ( ) + "px" ; this . workspace _ . RTL ? a . style . paddingRight = b : a . style . paddingLeft = b ; return a } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . createRowContentsContainer _ = function ( ) { var a = document . createElement ( "div" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . rowcontentcontainer ) ; return a } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . createIconDom _ = function ( ) { var a = document . createElement ( "span" ) ; this . parentToolbox _ . isHorizontal ( ) || ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . icon ) ; a . style . display = "inline-block" ; return a } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . createLabelDom _ = function ( a ) { var b = document . createElement ( "span" ) ; b . setAttribute ( "id" , this . getId ( ) + ".label" ) ; b . textContent = a ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b , this . cssConfig _ . label ) ; return b } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . refreshTheme = function ( ) { this . colour _ = this . getColour _ ( this . toolboxItemDef _ ) ; this . addColourBorder _ ( this . colour _ ) } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . addColourBorder _ = function ( a ) { a && ( a = module$exports$Blockly$ToolboxCategory . ToolboxCategory . borderWidth + "px solid " + ( a || "#ddd" ) , this . workspace _ . RTL ? this . rowDiv _ . style . borderRight = a : this . rowDiv _ . style . borderLeft = a ) } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getColour _ = function ( a ) { var b = a . categorystyle || a . categoryStyle ; if ( ( a = a . colour ) && b ) console . warn ( 'Toolbox category "' + this . name _ + '" must not have both a style and a colour' ) ; else return b ? this . getColourfromStyle _ ( b ) : this . parseColour _ ( a ) ; return "" } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getColourfromStyle _ = function ( a ) { var b = this . workspace _ . getTheme ( ) ; if ( a && b ) { if ( ( b = b . categoryStyles [ a ] ) && b . colour ) return this . parseColour _ ( b . colour ) ; console . warn ( 'Style "' + a + '" must exist and contain a colour value' ) } return "" } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getClickTarget = function ( ) { return this . rowDiv _ } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . parseColour _ = function ( a ) { a = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a ) ; if ( null == a || "" === a ) return "" ; var b = Number ( a ) ; if ( isNaN ( b ) ) { if ( b = ( 0 , module$exports$Blockly$utils$colour . parse ) ( a ) ) return b ; console . warn ( 'Toolbox category "' + this . name _ + '" has unrecognized colour attribute: ' + a ) ; return "" } return ( 0 , module$exports$Blockly$utils$colour . hueToHex ) ( b ) } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . openIcon _ = function ( a ) { a && ( ( 0 , module$exports$Blockly$utils$dom . removeClasses ) ( a , this . cssConfig _ . closedicon ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . openicon ) ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . closeIcon _ = function ( a ) { a && ( ( 0 , module$exports$Blockly$utils$dom . removeClasses ) ( a , this . cssConfig _ . openicon ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . closedicon ) ) } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . setVisible _ = function ( a ) { this . htmlDiv _ . style . display = a ? "block" : "none" ; this . isHidden _ = ! a ; this . parentToolbox _ . getSelectedItem ( ) === this && this . parentToolbox _ . clearSelection ( ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . hide = function ( ) { this . setVisible _ ( ! 1 ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . show = function ( ) { this . setVisible _ ( ! 0 ) } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . isVisible = function ( ) { return ! this . isHidden _ && this . allAncestorsExpanded _ ( ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . allAncestorsExpanded _ = function ( ) { for ( var a = this ; a . getParent ( ) ; ) if ( a = a . getParent ( ) , ! a . isExpanded ( ) ) return ! 1 ; return ! 0 } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . isSelectable = function ( ) { return this . isVisible ( ) && ! this . isDisabled _ } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . onClick = function ( a ) { } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . setSelected = function ( a ) { if ( a ) { var b = this . parseColour _ ( module$exports$Blockly$ToolboxCategory . ToolboxCategory . defaultBackgroundColour ) ; this . rowDiv _ . style . backgroundColor = this . colour _ || b ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . rowDiv _ , this . cssConfig _ . selected ) } else this . rowDiv _ . style . backgroundColor = "" , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . rowDiv _ , this . cssConfig _ . selected ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . htmlDiv _ ,
module$exports$Blockly$utils$aria . State . SELECTED , a ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . setDisabled = function ( a ) { this . isDisabled _ = a ; this . getDiv ( ) . setAttribute ( "disabled" , a ) ; a ? this . getDiv ( ) . setAttribute ( "disabled" , "true" ) : this . getDiv ( ) . removeAttribute ( "disabled" ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getName = function ( ) { return this . name _ } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getParent = function ( ) { return this . parent _ } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getDiv = function ( ) { return this . htmlDiv _ } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . getContents = function ( ) { return this . flyoutItems _ } ;
module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . updateFlyoutContents = function ( a ) { this . flyoutItems _ = [ ] ; "string" === typeof a ? this . toolboxItemDef _ . custom = a : ( delete this . toolboxItemDef _ . custom , this . toolboxItemDef _ . contents = ( 0 , module$exports$Blockly$utils$toolbox . convertFlyoutDefToJsonArray ) ( a ) ) ; this . parseContents _ ( this . toolboxItemDef _ ) } ; module$exports$Blockly$ToolboxCategory . ToolboxCategory . prototype . dispose = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . htmlDiv _ ) } ; ( 0 , module$exports$Blockly$Css . register ) ( '\n .blocklyTreeRow:not(.blocklyTreeSelected):hover {\n background-color: rgba(255, 255, 255, 0.2);\n }\n\n .blocklyToolboxDiv[layout="h"] .blocklyToolboxCategory {\n margin: 1px 5px 1px 0;\n }\n\n .blocklyToolboxDiv[dir="RTL"][layout="h"] .blocklyToolboxCategory {\n margin: 1px 0 1px 5px;\n }\n\n .blocklyTreeRow {\n height: 22px;\n line-height: 22px;\n margin-bottom: 3px;\n padding-right: 8px;\n white-space: nowrap;\n }\n\n .blocklyToolboxDiv[dir="RTL"] .blocklyTreeRow {\n margin-left: 8px;\n padding-right: 0;\n }\n\n .blocklyTreeIcon {\n background-image: url(<<<PATH>>>/sprites.png);\n height: 16px;\n vertical-align: middle;\n visibility: hidden;\n width: 16px;\n }\n\n .blocklyTreeIconClosed {\n background-position: -32px -1px;\n }\n\n .blocklyToolboxDiv[dir="RTL"] .blocklyTreeIconClosed {\n background-position: 0 -1px;\n }\n\n .blocklyTreeSelected>.blocklyTreeIconClosed {\n background-position: -32px -17px;\n }\n\n .blocklyToolboxDiv[dir="RTL"] .blocklyTreeSelected>.blocklyTreeIconClosed {\n background-position: 0 -17px;\n }\n\n .blocklyTreeIconOpen {\n background-position: -16px -1px;\n }\n\n .blocklyTreeSelected>.blocklyTreeIconOpen {\n background-position: -16px -17px;\n }\n\n .blocklyTreeLabel {\n cursor: default;\n font: 16px sans-serif;\n padding: 0 3px;\n vertical-align: middle;\n }\n\n .blocklyToolboxDelete .blocklyTreeLabel {\n cursor: url("<<<PATH>>>/handdelete.cur"), auto;\n }\n\n .blocklyTreeSelected .blocklyTreeLabel {\n color: #fff;\n }\n' ) ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . TOOLBOX _ITEM , module$exports$Blockly$ToolboxCategory . ToolboxCategory . registrationName , module$exports$Blockly$ToolboxCategory . ToolboxCategory ) ; var module$exports$Blockly$ToolboxSeparator = { ToolboxSeparator : function ( a , b ) { module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . superClass _ . constructor . call ( this , a , b ) ; this . cssConfig _ = { container : "blocklyTreeSeparator" } ; ( 0 , $ . module$exports$Blockly$utils$object . mixin ) ( this . cssConfig _ , a . cssconfig || a . cssConfig ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$ToolboxSeparator . ToolboxSeparator , module$exports$Blockly$ToolboxItem . ToolboxItem ) ;
module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . registrationName = "sep" ; module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . prototype . init = function ( ) { this . createDom _ ( ) } ; module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . prototype . createDom _ = function ( ) { var a = document . createElement ( "div" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . container ) ; return this . htmlDiv _ = a } ; module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . prototype . getDiv = function ( ) { return this . htmlDiv _ } ;
module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . prototype . dispose = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . htmlDiv _ ) } ; ( 0 , module$exports$Blockly$Css . register ) ( '\n .blocklyTreeSeparator {\n border-bottom: solid #e5e5e5 1px;\n height: 0;\n margin: 5px 0;\n }\n\n .blocklyToolboxDiv[layout="h"] .blocklyTreeSeparator {\n border-right: solid #e5e5e5 1px;\n border-bottom: none;\n height: auto;\n margin: 0 5px 0 5px;\n padding: 5px 0;\n width: 0;\n }\n' ) ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . TOOLBOX _ITEM , module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . registrationName , module$exports$Blockly$ToolboxSeparator . ToolboxSeparator ) ; var module$exports$Blockly$CollapsibleToolboxCategory = { CollapsibleToolboxCategory : function ( a , b , c ) { this . subcategoriesDiv _ = null ; this . expanded _ = ! 1 ; this . toolboxItems _ = [ ] ; module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . superClass _ . constructor . call ( this , a , b , c ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory , module$exports$Blockly$ToolboxCategory . ToolboxCategory ) ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . registrationName = "collapsibleCategory" ; module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . makeDefaultCssConfig _ = function ( ) { var a = module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . superClass _ . makeDefaultCssConfig _ . call ( this ) ; a . contents = "blocklyToolboxContents" ; return a } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . parseContents _ = function ( a ) { var b = a . contents , c = ! 0 ; if ( a . custom ) this . flyoutItems _ = a . custom ; else if ( b ) for ( a = 0 ; a < b . length ; a ++ ) { var d = b [ a ] ; ! ( 0 , module$exports$Blockly$registry . hasItem ) ( module$exports$Blockly$registry . Type . TOOLBOX _ITEM , d . kind ) || d . kind . toLowerCase ( ) === module$exports$Blockly$ToolboxSeparator . ToolboxSeparator . registrationName && c ? ( this . flyoutItems _ . push ( d ) , c = ! 0 ) : ( this . createToolboxItem _ ( d ) , c = ! 1 ) } } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . createToolboxItem _ = function ( a ) { var b = a . kind ; "CATEGORY" == b . toUpperCase ( ) && ( 0 , module$exports$Blockly$utils$toolbox . isCategoryCollapsible ) ( a ) && ( b = module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . registrationName ) ; a = new ( ( 0 , module$exports$Blockly$registry . getClass ) ( module$exports$Blockly$registry . Type . TOOLBOX _ITEM , b ) ) ( a , this . parentToolbox _ , this ) ; this . toolboxItems _ . push ( a ) } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . init = function ( ) { module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . superClass _ . init . call ( this ) ; this . setExpanded ( "true" === this . toolboxItemDef _ . expanded || this . toolboxItemDef _ . expanded ) } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . createDom _ = function ( ) { module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . superClass _ . createDom _ . call ( this ) ; var a = this . getChildToolboxItems ( ) ; this . subcategoriesDiv _ = this . createSubCategoriesDom _ ( a ) ; ( 0 , module$exports$Blockly$utils$aria . setRole ) ( this . subcategoriesDiv _ , module$exports$Blockly$utils$aria . Role . GROUP ) ; this . htmlDiv _ . appendChild ( this . subcategoriesDiv _ ) ; return this . htmlDiv _ } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . createIconDom _ = function ( ) { var a = document . createElement ( "span" ) ; this . parentToolbox _ . isHorizontal ( ) || ( ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , this . cssConfig _ . icon ) , a . style . visibility = "visible" ) ; a . style . display = "inline-block" ; return a } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . createSubCategoriesDom _ = function ( a ) { var b = document . createElement ( "div" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( b , this . cssConfig _ . contents ) ; for ( var c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] ; d . init ( ) ; var e = d . getDiv ( ) ; b . appendChild ( e ) ; d . getClickTarget && d . getClickTarget ( ) . setAttribute ( "id" , d . getId ( ) ) } return b } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . setExpanded = function ( a ) { this . expanded _ !== a && ( ( this . expanded _ = a ) ? ( this . subcategoriesDiv _ . style . display = "block" , this . openIcon _ ( this . iconDom _ ) ) : ( this . subcategoriesDiv _ . style . display = "none" , this . closeIcon _ ( this . iconDom _ ) ) , ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . htmlDiv _ , module$exports$Blockly$utils$aria . State . EXPANDED , a ) , this . parentToolbox _ . handleToolboxItemResize ( ) ) } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . setVisible _ = function ( a ) { this . htmlDiv _ . style . display = a ? "block" : "none" ; for ( var b = this . getChildToolboxItems ( ) , c = 0 ; c < b . length ; c ++ ) b [ c ] . setVisible _ ( a ) ; this . isHidden _ = ! a ; this . parentToolbox _ . getSelectedItem ( ) === this && this . parentToolbox _ . clearSelection ( ) } ; module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . isExpanded = function ( ) { return this . expanded _ } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . isCollapsible = function ( ) { return ! 0 } ; module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . onClick = function ( a ) { this . toggleExpanded ( ) } ; module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . toggleExpanded = function ( ) { this . setExpanded ( ! this . expanded _ ) } ; module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . getDiv = function ( ) { return this . htmlDiv _ } ;
module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . prototype . getChildToolboxItems = function ( ) { return this . toolboxItems _ } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . TOOLBOX _ITEM , module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . registrationName , module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory ) ; var module$exports$Blockly$IAutoHideable = { IAutoHideable : function ( ) { } } ; var module$exports$Blockly$IStyleable = { IStyleable : function ( ) { } } ; var module$exports$Blockly$IToolbox = { IToolbox : function ( ) { } } ; var module$exports$Blockly$Events$ToolboxItemSelect = { ToolboxItemSelect : function ( a , b , c ) { module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect . superClass _ . constructor . call ( this , c ) ; this . oldItem = a ; this . newItem = b } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect . prototype . type = module$exports$Blockly$Events$utils . TOOLBOX _ITEM _SELECT ;
module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect . superClass _ . toJson . call ( this ) ; a . oldItem = this . oldItem ; a . newItem = this . newItem ; return a } ; module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect . superClass _ . fromJson . call ( this , a ) ; this . oldItem = a . oldItem ; this . newItem = a . newItem } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . TOOLBOX _ITEM _SELECT , module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect ) ; var module$exports$Blockly$Toolbox = { Toolbox : function ( a ) { module$exports$Blockly$Toolbox . Toolbox . superClass _ . constructor . call ( this ) ; this . workspace _ = a ; this . id = "toolbox" ; this . toolboxDef _ = a . options . languageTree || { contents : [ ] } ; this . horizontalLayout _ = a . options . horizontalLayout ; this . contentsDiv _ = this . HtmlDiv = null ; this . isVisible _ = ! 1 ; this . contents _ = [ ] ; this . height _ = this . width _ = 0 ; this . RTL = a . options . RTL ; this . flyout _ = null ; this . contentMap _ = Object . create ( null ) ; this . toolboxPosition = a . options . toolboxPosition ; this . previouslySelectedItem _ =
this . selectedItem _ = null ; this . boundEvents _ = [ ] } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Toolbox . Toolbox , module$exports$Blockly$DeleteArea . DeleteArea ) ; module$exports$Blockly$Toolbox . Toolbox . prototype . onShortcut = function ( a ) { return ! 1 } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . init = function ( ) { var a = this . workspace _ , b = a . getParentSvg ( ) ; this . flyout _ = this . createFlyout _ ( ) ; this . HtmlDiv = this . createDom _ ( this . workspace _ ) ; ( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( this . flyout _ . createDom ( "svg" ) , 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 , "toolboxForegroundColour" , "color" ) ; this . workspace _ . getComponentManager ( ) . addComponent ( { component : this ,
weight : 1 , capabilities : [ module$exports$Blockly$ComponentManager . ComponentManager . Capability . AUTOHIDEABLE , module$exports$Blockly$ComponentManager . ComponentManager . Capability . DELETE _AREA , module$exports$Blockly$ComponentManager . ComponentManager . Capability . DRAG _TARGET ] } ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . createDom _ = function ( a ) { a = a . getParentSvg ( ) ; var b = this . createContainer _ ( ) ; this . contentsDiv _ = this . createContentsContainer _ ( ) ; this . contentsDiv _ . tabIndex = 0 ; ( 0 , module$exports$Blockly$utils$aria . setRole ) ( this . contentsDiv _ , module$exports$Blockly$utils$aria . Role . TREE ) ; b . appendChild ( this . contentsDiv _ ) ; a . parentNode . insertBefore ( b , a ) ; this . attachEvents _ ( b , this . contentsDiv _ ) ; return b } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . createContainer _ = function ( ) { var a = document . createElement ( "div" ) ; a . setAttribute ( "layout" , this . isHorizontal ( ) ? "h" : "v" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyToolboxDiv" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyNonSelectable" ) ; a . setAttribute ( "dir" , this . RTL ? "RTL" : "LTR" ) ; return a } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . createContentsContainer _ = function ( ) { var a = document . createElement ( "div" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyToolboxContents" ) ; this . isHorizontal ( ) && ( a . style . flexDirection = "row" ) ; return a } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . attachEvents _ = function ( a , b ) { a = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , "click" , this , this . onClick _ , ! 1 , ! 0 ) ; this . boundEvents _ . push ( a ) ; b = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "keydown" , this , this . onKeyDown _ , ! 1 , ! 0 ) ; this . boundEvents _ . push ( b ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . onClick _ = function ( a ) { if ( ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) || a . target === this . HtmlDiv ) ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) . hideChaff ( ! 1 ) ; else { var b = a . target . getAttribute ( "id" ) ; b && ( b = this . getToolboxItemById ( b ) , b . isSelectable ( ) && ( this . setSelectedItem ( b ) , b . onClick ( a ) ) ) ; ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) . hideChaff ( ! 0 ) } ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . onKeyDown _ = function ( a ) { var b = ! 1 ; switch ( a . keyCode ) { case module$exports$Blockly$utils$KeyCodes . KeyCodes . DOWN : b = this . selectNext _ ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . UP : b = this . selectPrevious _ ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . LEFT : b = this . selectParent _ ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . RIGHT : b = this . selectChild _ ( ) ; break ; case module$exports$Blockly$utils$KeyCodes . KeyCodes . ENTER : case module$exports$Blockly$utils$KeyCodes . KeyCodes . SPACE : 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 ( ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . createFlyout _ = function ( ) { var a = this . workspace _ , b = new module$exports$Blockly$Options . Options ( { parentWorkspace : a , rtl : a . RTL , oneBasedIndex : a . options . oneBasedIndex , horizontalLayout : a . horizontalLayout , renderer : a . options . renderer , rendererOverrides : a . options . rendererOverrides , move : { scrollbars : ! 0 } } ) ; b . toolboxPosition = a . options . toolboxPosition ; return new ( a . horizontalLayout ? ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . FLYOUTS _HORIZONTAL _TOOLBOX ,
a . options , ! 0 ) : ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . FLYOUTS _VERTICAL _TOOLBOX , a . options , ! 0 ) ) ( b ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . render = function ( a ) { this . toolboxDef _ = a ; for ( var b = 0 ; b < this . contents _ . length ; b ++ ) { var c = this . contents _ [ b ] ; c && c . dispose ( ) } this . contents _ = [ ] ; this . contentMap _ = Object . create ( null ) ; this . renderContents _ ( a . contents ) ; this . position ( ) ; this . handleToolboxItemResize ( ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . renderContents _ = function ( a ) { for ( var b = document . createDocumentFragment ( ) , c = 0 ; c < a . length ; c ++ ) this . createToolboxItem _ ( a [ c ] , b ) ; this . contentsDiv _ . appendChild ( b ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . createToolboxItem _ = function ( a , b ) { var c = a . kind ; "CATEGORY" === c . toUpperCase ( ) && ( 0 , module$exports$Blockly$utils$toolbox . isCategoryCollapsible ) ( a ) && ( c = module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory . registrationName ) ; if ( c = ( 0 , module$exports$Blockly$registry . getClass ) ( module$exports$Blockly$registry . Type . TOOLBOX _ITEM , c . toLowerCase ( ) ) ) a = new c ( a , this ) , this . addToolboxItem _ ( a ) , a . init ( ) , ( c = a . getDiv ( ) ) && b . appendChild ( c ) , a . getClickTarget &&
a . getClickTarget ( ) . setAttribute ( "id" , a . getId ( ) ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . addToolboxItem _ = function ( a ) { this . contents _ . push ( a ) ; this . contentMap _ [ a . getId ( ) ] = a ; if ( a . isCollapsible ( ) ) { a = a . getChildToolboxItems ( ) ; for ( var b = 0 ; b < a . length ; b ++ ) this . addToolboxItem _ ( a [ b ] ) } } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getToolboxItems = function ( ) { return this . contents _ } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . addStyle = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . HtmlDiv , a ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . removeStyle = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . HtmlDiv , a ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . getClientRect = function ( ) { if ( ! this . HtmlDiv || ! this . isVisible _ ) return null ; var a = this . HtmlDiv . getBoundingClientRect ( ) , b = a . top , c = b + a . height , d = a . left ; a = d + a . width ; return this . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . TOP ? new module$exports$Blockly$utils$Rect . Rect ( - 1E7 , c , - 1E7 , 1E7 ) : this . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . BOTTOM ? new module$exports$Blockly$utils$Rect . Rect ( b , 1E7 , - 1E7 , 1E7 ) : this . toolboxPosition ===
module$exports$Blockly$utils$toolbox . Position . LEFT ? new module$exports$Blockly$utils$Rect . Rect ( - 1E7 , 1E7 , - 1E7 , a ) : new module$exports$Blockly$utils$Rect . Rect ( - 1E7 , 1E7 , d , 1E7 ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . wouldDelete = function ( a , b ) { a instanceof module$exports$Blockly$BlockSvg . BlockSvg ? this . updateWouldDelete _ ( ! a . getParent ( ) && a . isDeletable ( ) ) : this . updateWouldDelete _ ( a . isDeletable ( ) ) ; return this . wouldDelete _ } ; module$exports$Blockly$Toolbox . Toolbox . prototype . onDragEnter = function ( a ) { this . updateCursorDeleteStyle _ ( ! 0 ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . onDragExit = function ( a ) { this . updateCursorDeleteStyle _ ( ! 1 ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . onDrop = function ( a ) { this . updateCursorDeleteStyle _ ( ! 1 ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . updateWouldDelete _ = function ( a ) { a !== this . wouldDelete _ && ( this . updateCursorDeleteStyle _ ( ! 1 ) , this . wouldDelete _ = a , this . updateCursorDeleteStyle _ ( ! 0 ) ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . updateCursorDeleteStyle _ = function ( a ) { var b = this . wouldDelete _ ? "blocklyToolboxDelete" : "blocklyToolboxGrab" ; a ? this . addStyle ( b ) : this . removeStyle ( b ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getToolboxItemById = function ( a ) { return this . contentMap _ [ a ] || null } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getWidth = function ( ) { return this . width _ } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getHeight = function ( ) { return this . height _ } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . getFlyout = function ( ) { return this . flyout _ } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getWorkspace = function ( ) { return this . workspace _ } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getSelectedItem = function ( ) { return this . selectedItem _ } ; module$exports$Blockly$Toolbox . Toolbox . prototype . getPreviouslySelectedItem = function ( ) { return this . previouslySelectedItem _ } ; module$exports$Blockly$Toolbox . Toolbox . prototype . isHorizontal = function ( ) { return this . horizontalLayout _ } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . position = function ( ) { var a = 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 === module$exports$Blockly$utils$toolbox . Position . TOP ? b . style . top = "0" : b . style . bottom = "0" ) : ( this . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . RIGHT ? b . style . right = "0" : b . style . left = "0" , b . style . height = "100%" ,
this . width _ = b . offsetWidth , this . height _ = a . viewHeight ) , this . flyout _ . position ( ) ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . handleToolboxItemResize = function ( ) { var a = this . workspace _ , b = this . HtmlDiv . getBoundingClientRect ( ) ; a . translate ( this . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . LEFT ? a . scrollX + b . width : a . scrollX , this . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . TOP ? a . scrollY + b . height : a . scrollY ) ; ( 0 , $ . module$exports$Blockly$common . svgResize ) ( a ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . clearSelection = function ( ) { this . setSelectedItem ( null ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . refreshTheme = function ( ) { for ( var a = 0 ; a < this . contents _ . length ; a ++ ) { var b = this . contents _ [ a ] ; b . refreshTheme && b . refreshTheme ( ) } } ; module$exports$Blockly$Toolbox . Toolbox . prototype . refreshSelection = function ( ) { this . selectedItem _ && this . selectedItem _ . isSelectable ( ) && this . selectedItem _ . getContents ( ) . length && this . flyout _ . show ( this . selectedItem _ . getContents ( ) ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . setVisible = function ( a ) { this . isVisible _ !== a && ( this . HtmlDiv . style . display = a ? "block" : "none" , this . isVisible _ = a , this . workspace _ . recordDragTargets ( ) ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . autoHide = function ( a ) { ! a && this . flyout _ && this . flyout _ . autoClose && this . clearSelection ( ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . setSelectedItem = function ( a ) { var b = this . selectedItem _ ; ! a && ! b || a && ! a . isSelectable ( ) || ( this . shouldDeselectItem _ ( b , a ) && null !== b && this . deselectItem _ ( b ) , this . shouldSelectItem _ ( b , a ) && null !== a && this . selectItem _ ( b , a ) , this . updateFlyout _ ( b , a ) , this . fireSelectEvent _ ( b , a ) ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . shouldDeselectItem _ = function ( a , b ) { return null !== a && ( ! a . isCollapsible ( ) || a !== b ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . shouldSelectItem _ = function ( a , b ) { return null !== b && b !== a } ; module$exports$Blockly$Toolbox . Toolbox . prototype . deselectItem _ = function ( a ) { this . selectedItem _ = null ; this . previouslySelectedItem _ = a ; a . setSelected ( ! 1 ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . contentsDiv _ , module$exports$Blockly$utils$aria . State . ACTIVEDESCENDANT , "" ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . selectItem _ = function ( a , b ) { this . selectedItem _ = b ; this . previouslySelectedItem _ = a ; b . setSelected ( ! 0 ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . contentsDiv _ , module$exports$Blockly$utils$aria . State . ACTIVEDESCENDANT , b . getId ( ) ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . selectItemByPosition = function ( a ) { - 1 < a && a < this . contents _ . length && ( a = this . contents _ [ a ] , a . isSelectable ( ) && this . setSelectedItem ( a ) ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . updateFlyout _ = function ( a , b ) { b && ( a !== b || b . isCollapsible ( ) ) && b . getContents ( ) . length ? ( this . flyout _ . show ( b . getContents ( ) ) , this . flyout _ . scrollToStart ( ) ) : this . flyout _ . hide ( ) } ; module$exports$Blockly$Toolbox . Toolbox . prototype . fireSelectEvent _ = function ( a , b ) { var c = a && a . getName ( ) , d = b && b . getName ( ) ; a === b && ( d = null ) ; a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . TOOLBOX _ITEM _SELECT ) ) ( c , d , this . workspace _ . id ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . selectParent _ = function ( ) { return this . selectedItem _ ? this . selectedItem _ . isCollapsible ( ) && this . selectedItem _ . isExpanded ( ) ? ( this . selectedItem _ . setExpanded ( ! 1 ) , ! 0 ) : this . selectedItem _ . getParent ( ) && this . selectedItem _ . getParent ( ) . isSelectable ( ) ? ( this . setSelectedItem ( this . selectedItem _ . getParent ( ) ) , ! 0 ) : ! 1 : ! 1 } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . selectChild _ = function ( ) { if ( ! this . selectedItem _ || ! this . selectedItem _ . isCollapsible ( ) ) return ! 1 ; var a = this . selectedItem _ ; a . isExpanded ( ) ? this . selectNext _ ( ) : a . setExpanded ( ! 0 ) ; return ! 0 } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . selectNext _ = function ( ) { if ( ! this . selectedItem _ ) return ! 1 ; var a = this . contents _ . indexOf ( this . selectedItem _ ) + 1 ; if ( - 1 < a && a < this . contents _ . length ) { for ( var b = this . contents _ [ a ] ; b && ! b . isSelectable ( ) ; ) b = this . contents _ [ ++ a ] ; if ( b && b . isSelectable ( ) ) return this . setSelectedItem ( b ) , ! 0 } return ! 1 } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . selectPrevious _ = function ( ) { if ( ! this . selectedItem _ ) return ! 1 ; var a = this . contents _ . indexOf ( this . selectedItem _ ) - 1 ; if ( - 1 < a && a < this . contents _ . length ) { for ( var b = this . contents _ [ a ] ; b && ! b . isSelectable ( ) ; ) b = this . contents _ [ -- a ] ; if ( b && b . isSelectable ( ) ) return this . setSelectedItem ( b ) , ! 0 } return ! 1 } ;
module$exports$Blockly$Toolbox . Toolbox . prototype . dispose = function ( ) { this . workspace _ . getComponentManager ( ) . removeComponent ( "toolbox" ) ; this . flyout _ . dispose ( ) ; for ( var a = 0 ; a < this . contents _ . length ; a ++ ) this . contents _ [ a ] . dispose ( ) ; for ( a = 0 ; a < this . boundEvents _ . length ; a ++ ) ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . boundEvents _ [ a ] ) ; this . boundEvents _ = [ ] ; this . contents _ = [ ] ; this . workspace _ . getThemeManager ( ) . unsubscribe ( this . HtmlDiv ) ; ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . HtmlDiv ) } ; ( 0 , module$exports$Blockly$Css . register ) ( '\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 .blocklyToolboxDiv {\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 .blocklyToolboxContents {\n display: flex;\n flex-wrap: wrap;\n flex-direction: column;\n }\n\n .blocklyToolboxContents:focus {\n outline: none;\n }\n' ) ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . TOOLBOX , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$Toolbox . Toolbox ) ; var module$exports$Blockly$HorizontalFlyout = { HorizontalFlyout : function ( a ) { module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . superClass _ . constructor . call ( this , a ) ; this . horizontalLayout = ! 0 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$HorizontalFlyout . HorizontalFlyout , module$exports$Blockly$Flyout . Flyout ) ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . setMetrics _ = function ( a ) { if ( this . isVisible ( ) ) { var b = this . workspace _ . getMetricsManager ( ) , c = b . getScrollMetrics ( ) , d = b . getViewMetrics ( ) ; b = b . getAbsoluteMetrics ( ) ; "number" === typeof a . x && ( this . workspace _ . scrollX = - ( c . left + ( c . width - d . width ) * a . x ) ) ; this . workspace _ . translate ( this . workspace _ . scrollX + b . left , this . workspace _ . scrollY + b . top ) } } ; module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . getX = function ( ) { return 0 } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . getY = function ( ) { if ( ! this . isVisible ( ) ) return 0 ; var a = this . targetWorkspace . getMetricsManager ( ) , b = a . getAbsoluteMetrics ( ) , c = a . getViewMetrics ( ) ; a = a . getToolboxMetrics ( ) ; var d = this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . TOP ; return this . targetWorkspace . toolboxPosition === this . toolboxPosition _ ? this . targetWorkspace . getToolbox ( ) ? d ? a . height : c . height - this . height _ : d ? 0 : c . height : d ? 0 : c . height + b . top - this . height _ } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . position = function ( ) { if ( this . isVisible ( ) && this . targetWorkspace . isVisible ( ) ) { var a = this . targetWorkspace . getMetricsManager ( ) . getViewMetrics ( ) ; this . width _ = a . width ; this . setBackgroundPath _ ( a . width - 2 * this . CORNER _RADIUS , this . height _ - this . CORNER _RADIUS ) ; a = this . getX ( ) ; var b = this . getY ( ) ; this . positionAt _ ( this . width _ , this . height _ , a , b ) } } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . setBackgroundPath _ = function ( a , b ) { var c = this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . TOP , d = [ "M 0," + ( c ? 0 : this . CORNER _RADIUS ) ] ; c ? ( d . push ( "h" , a + 2 * this . CORNER _RADIUS ) , d . push ( "v" , b ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , - this . CORNER _RADIUS , this . CORNER _RADIUS ) , d . push ( "h" , - a ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , - this . CORNER _RADIUS , - this . CORNER _RADIUS ) ) : ( d . push ( "a" , this . CORNER _RADIUS ,
this . CORNER _RADIUS , 0 , 0 , 1 , this . CORNER _RADIUS , - this . CORNER _RADIUS ) , d . push ( "h" , a ) , d . push ( "a" , this . CORNER _RADIUS , this . CORNER _RADIUS , 0 , 0 , 1 , this . CORNER _RADIUS , this . CORNER _RADIUS ) , d . push ( "v" , b ) , d . push ( "h" , - a - 2 * this . CORNER _RADIUS ) ) ; d . push ( "z" ) ; this . svgBackground _ . setAttribute ( "d" , d . join ( " " ) ) } ; module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . scrollToStart = function ( ) { this . workspace _ . scrollbar . setX ( this . RTL ? Infinity : 0 ) } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . wheel _ = function ( a ) { var b = ( 0 , module$exports$Blockly$browserEvents . getScrollDeltaPixels ) ( a ) ; if ( b = b . x || b . y ) { var c = this . workspace _ . getMetricsManager ( ) , d = c . getScrollMetrics ( ) ; b = c . getViewMetrics ( ) . left - d . left + b ; this . workspace _ . scrollbar . setX ( b ) ; ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) } a . preventDefault ( ) ; a . stopPropagation ( ) } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . layout _ = function ( a , b ) { this . workspace _ . scale = this . targetWorkspace . scale ; var c = this . MARGIN , d = c + this . tabWidth _ ; this . RTL && ( a = a . reverse ( ) ) ; for ( var e = 0 , f ; f = a [ e ] ; e ++ ) if ( "block" === f . type ) { f = f . block ; for ( var g = f . getDescendants ( ! 1 ) , h = 0 , k ; k = g [ h ] ; h ++ ) k . isInFlyout = ! 0 ; f . render ( ) ; g = f . getSvgRoot ( ) ; h = f . getHeightWidth ( ) ; k = f . outputConnection ? this . tabWidth _ : 0 ; k = this . RTL ? d + h . width : d - k ; f . moveBy ( k , c ) ; k = this . createRect _ ( f , k , c , h , e ) ; d += h . width + b [ e ] ; this . addBlockListeners _ ( g ,
f , k ) } else "button" === f . type && ( this . initFlyoutButton _ ( f . button , d , c ) , d += f . button . width + b [ e ] ) } ; module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . isDragTowardWorkspace = function ( a ) { a = Math . atan2 ( a . y , a . x ) / Math . PI * 180 ; var b = this . dragAngleRange _ ; return a < 90 + b && a > 90 - b || a > - 90 - b && a < - 90 + b ? ! 0 : ! 1 } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . getClientRect = function ( ) { if ( ! this . svgGroup _ || this . autoClose || ! this . isVisible ( ) ) return null ; var a = this . svgGroup _ . getBoundingClientRect ( ) , b = a . top ; return this . toolboxPosition _ === module$exports$Blockly$utils$toolbox . Position . TOP ? new module$exports$Blockly$utils$Rect . Rect ( - 1E9 , b + a . height , - 1E9 , 1E9 ) : new module$exports$Blockly$utils$Rect . Rect ( b , 1E9 , - 1E9 , 1E9 ) } ;
module$exports$Blockly$HorizontalFlyout . HorizontalFlyout . prototype . reflowInternal _ = function ( ) { this . workspace _ . scale = this . getFlyoutScale ( ) ; for ( var a = 0 , b = this . workspace _ . getTopBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) a = Math . max ( a , d . getHeightWidth ( ) . height ) ; c = this . buttons _ ; d = 0 ; for ( var e ; e = c [ d ] ; d ++ ) a = Math . max ( a , e . height ) ; a += 1.5 * this . MARGIN ; a *= this . workspace _ . scale ; a += module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ; if ( this . height _ !== a ) { for ( c = 0 ; d = b [ c ] ; c ++ ) d . flyoutRect _ && this . moveRectToBlock _ ( d . flyoutRect _ ,
d ) ; this . targetWorkspace . toolboxPosition !== this . toolboxPosition _ || this . toolboxPosition _ !== module$exports$Blockly$utils$toolbox . Position . TOP || this . targetWorkspace . getToolbox ( ) || this . targetWorkspace . translate ( this . targetWorkspace . scrollX , this . targetWorkspace . scrollY + a ) ; this . height _ = a ; this . position ( ) ; this . targetWorkspace . recordDragTargets ( ) } } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . FLYOUTS _HORIZONTAL _TOOLBOX , module$exports$Blockly$registry . DEFAULT , module$exports$Blockly$HorizontalFlyout . HorizontalFlyout ) ; $ . module$exports$Blockly$Generator = { Generator : function ( a ) { this . name _ = a ; this . FUNCTION _NAME _PLACEHOLDER _REGEXP _ = new RegExp ( this . FUNCTION _NAME _PLACEHOLDER _ , "g" ) } } ; $ . module$exports$Blockly$Generator . Generator . prototype . INFINITE _LOOP _TRAP = null ; $ . module$exports$Blockly$Generator . Generator . prototype . STATEMENT _PREFIX = null ; $ . module$exports$Blockly$Generator . Generator . prototype . STATEMENT _SUFFIX = null ; $ . module$exports$Blockly$Generator . Generator . prototype . INDENT = " " ;
$ . module$exports$Blockly$Generator . Generator . prototype . COMMENT _WRAP = 60 ; $ . module$exports$Blockly$Generator . Generator . prototype . ORDER _OVERRIDES = [ ] ; $ . module$exports$Blockly$Generator . Generator . prototype . isInitialized = null ;
$ . module$exports$Blockly$Generator . Generator . prototype . workspaceToCode = function ( a ) { a || ( console . warn ( "No workspace specified in workspaceToCode call. Guessing." ) , a = ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) ) ; var b = [ ] ; this . init ( a ) ; a = a . getTopBlocks ( ! 0 ) ; for ( var c = 0 , d ; d = a [ c ] ; c ++ ) { var 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 , 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" ) } ; $ . module$exports$Blockly$Generator . Generator . prototype . prefixLines = function ( a , b ) { return b + a . replace ( /(?!\n$)\n/g , "\n" + b ) } ;
$ . module$exports$Blockly$Generator . Generator . prototype . allNestedComments = function ( a ) { var b = [ ] ; a = a . getDescendants ( ! 0 ) ; for ( var c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] . getCommentText ( ) ; d && b . push ( d ) } b . length && b . push ( "" ) ; return b . join ( "\n" ) } ;
$ . module$exports$Blockly$Generator . Generator . prototype . blockToCode = function ( a , b ) { ! 1 === this . isInitialized && console . warn ( "Generator init was not called before blockToCode was called." ) ; if ( ! a ) return "" ; if ( ! a . isEnabled ( ) ) return b ? "" : this . blockToCode ( a . getNextBlock ( ) ) ; if ( a . isInsertionMarker ( ) ) return b ? "" : this . blockToCode ( a . getChildren ( ! 1 ) [ 0 ] ) ; var c = this [ a . type ] ; if ( "function" !== typeof c ) throw Error ( 'Language "' + this . name _ + '" does not know how to generate code for block type "' + a . type + '".' ) ; c = c . call ( a , a ) ;
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 ( "string" === typeof c ) return this . STATEMENT _PREFIX && ! a . suppressPrefixSuffix && ( 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 ( null === c ) return "" ; throw SyntaxError ( "Invalid code generated: " + c ) ; } ;
$ . module$exports$Blockly$Generator . Generator . prototype . valueToCode = function ( a , b , c ) { if ( isNaN ( c ) ) throw TypeError ( "Expecting valid order from block: " + a . type ) ; var d = a . getInputTargetBlock ( b ) ; if ( ! d ) return "" ; b = this . blockToCode ( d ) ; if ( "" === b ) return "" ; if ( ! Array . isArray ( b ) ) throw TypeError ( "Expecting tuple from value block: " + d . type ) ; 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 ) , f = Math . floor ( b ) ; if ( e <= f && ( e !== f || 0 !== e && 99 !==
e ) ) 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 } ; $ . module$exports$Blockly$Generator . Generator . prototype . statementToCode = function ( a , b ) { a = a . getInputTargetBlock ( b ) ; b = this . blockToCode ( a ) ; if ( "string" !== typeof b ) throw TypeError ( "Expecting code from statement block: " + ( a && a . type ) ) ; b && ( b = this . prefixLines ( b , this . INDENT ) ) ; return b } ;
$ . module$exports$Blockly$Generator . Generator . prototype . addLoopTrap = function ( 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 , b ) , this . INDENT ) ) ; return a } ;
$ . module$exports$Blockly$Generator . Generator . prototype . injectId = function ( a , b ) { b = b . id . replace ( /\$/g , "$$$$" ) ; return a . replace ( /%1/g , "'" + b + "'" ) } ; $ . module$exports$Blockly$Generator . Generator . prototype . RESERVED _WORDS _ = "" ; $ . module$exports$Blockly$Generator . Generator . prototype . addReservedWords = function ( a ) { this . RESERVED _WORDS _ += a + "," } ; $ . module$exports$Blockly$Generator . Generator . prototype . FUNCTION _NAME _PLACEHOLDER _ = "{leCUI8hutHZI4480Dc}" ;
Object . defineProperties ( $ . module$exports$Blockly$Generator . Generator . prototype , { variableDB _ : { get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "variableDB_" , "May 2021" , "May 2026" , "nameDB_" ) ; return this . nameDB _ } , set : function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "variableDB_" , "May 2021" , "May 2026" , "nameDB_" ) ; this . nameDB _ = a } } } ) ;
$ . module$exports$Blockly$Generator . Generator . prototype . provideFunction _ = function ( a , b ) { if ( ! this . definitions _ [ a ] ) { var c = this . nameDB _ . getDistinctName ( a , $ . module$exports$Blockly$Names . NameType . PROCEDURE ) ; this . functionNames _ [ a ] = c ; b = b . join ( "\n" ) . replace ( this . FUNCTION _NAME _PLACEHOLDER _REGEXP _ , c ) ; for ( var d ; d !== b ; ) d = b , b = b . replace ( /^(( {2})*) {2}/gm , "$1\x00" ) ; b = b . replace ( /\0/g , this . INDENT ) ; this . definitions _ [ a ] = b } return this . functionNames _ [ a ] } ;
$ . module$exports$Blockly$Generator . Generator . prototype . init = function ( a ) { this . definitions _ = Object . create ( null ) ; this . functionNames _ = Object . create ( null ) } ; $ . module$exports$Blockly$Generator . Generator . prototype . scrub _ = function ( a , b , c ) { return b } ; $ . module$exports$Blockly$Generator . Generator . prototype . finish = function ( a ) { delete this . definitions _ ; delete this . functionNames _ ; return a } ; $ . module$exports$Blockly$Generator . Generator . prototype . scrubNakedValue = function ( a ) { return a } ; $ . module$exports$Blockly$FieldDropdown = { FieldDropdown : function ( a , b , c ) { "function" !== typeof a && module$contents$Blockly$FieldDropdown _validateOptions ( a ) ; this . menuGenerator _ = a ; this . suffixField = this . prefixField = this . generatedOptions _ = null ; this . trimOptions _ ( ) ; this . selectedOption _ = this . getOptions ( ! 1 ) [ 0 ] ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . superClass _ . constructor . call ( this , this . selectedOption _ [ 1 ] , b , c ) ; this . svgArrow _ = this . arrow _ = this . imageElement _ = this . menu _ = this . selectedMenuItem _ = null } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( $ . module$exports$Blockly$FieldDropdown . FieldDropdown , module$exports$Blockly$Field . Field ) ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . fromJson = function ( a ) { return new this ( a . options , void 0 , a ) } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . fromXml = function ( a ) { this . isOptionListDynamic ( ) && this . getOptions ( ! 1 ) ; this . setValue ( a . textContent ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . loadState = function ( a ) { this . loadLegacyState ( $ . module$exports$Blockly$FieldDropdown . FieldDropdown , a ) || ( this . isOptionListDynamic ( ) && this . getOptions ( ! 1 ) , this . setValue ( a ) ) } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . SERIALIZABLE = ! 0 ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . CHECKMARK _OVERHANG = 25 ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . MAX _MENU _HEIGHT _VH = . 45 ;
var module$contents$Blockly$FieldDropdown _IMAGE _Y _OFFSET = 5 , module$contents$Blockly$FieldDropdown _IMAGE _Y _PADDING = 2 * module$contents$Blockly$FieldDropdown _IMAGE _Y _OFFSET ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . ARROW _CHAR = module$exports$Blockly$utils$userAgent . ANDROID ? "\u25bc" : "\u25be" ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . CURSOR = "default" ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . initView = function ( ) { this . shouldAddBorderRect _ ( ) ? this . createBorderRect _ ( ) : this . clickTarget _ = this . sourceBlock _ . getSvgRoot ( ) ; this . createTextElement _ ( ) ; this . imageElement _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { } , this . fieldGroup _ ) ; this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW ? this . createSVGArrow _ ( ) : this . createTextArrow _ ( ) ; this . borderRect _ && ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . borderRect _ ,
"blocklyDropdownRect" ) } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . shouldAddBorderRect _ = function ( ) { return ! this . getConstants ( ) . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW || this . getConstants ( ) . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW && ! this . sourceBlock _ . isShadow ( ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . createTextArrow _ = function ( ) { this . arrow _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TSPAN , { } , this . textElement _ ) ; this . arrow _ . appendChild ( document . createTextNode ( this . sourceBlock _ . RTL ? $ . module$exports$Blockly$FieldDropdown . FieldDropdown . ARROW _CHAR + " " : " " + $ . module$exports$Blockly$FieldDropdown . FieldDropdown . ARROW _CHAR ) ) ; this . sourceBlock _ . RTL ? this . textElement _ . insertBefore ( this . arrow _ , this . textContent _ ) :
this . textElement _ . appendChild ( this . arrow _ ) } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . createSVGArrow _ = function ( ) { this . svgArrow _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { height : this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE + "px" , width : this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE + "px" } , this . fieldGroup _ ) ; this . svgArrow _ . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _DATAURI ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . showEditor _ = function ( a ) { this . dropdownCreate _ ( ) ; this . menu _ . openingCoords = a && "number" === typeof a . clientX ? new module$exports$Blockly$utils$Coordinate . Coordinate ( a . clientX , a . clientY ) : null ; module$exports$Blockly$DropDownDiv . DropDownDiv . clearContent ( ) ; this . menu _ . render ( module$exports$Blockly$DropDownDiv . DropDownDiv . getContentDiv ( ) ) ; a = this . menu _ . getElement ( ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyDropdownMenu" ) ; if ( this . getConstants ( ) . FIELD _DROPDOWN _COLOURED _DIV ) { a =
this . sourceBlock _ . isShadow ( ) ? this . sourceBlock _ . getParent ( ) . getColour ( ) : this . sourceBlock _ . getColour ( ) ; var b = this . sourceBlock _ . isShadow ( ) ? this . sourceBlock _ . getParent ( ) . style . colourTertiary : this . sourceBlock _ . style . colourTertiary ; module$exports$Blockly$DropDownDiv . DropDownDiv . setColour ( a , b ) } module$exports$Blockly$DropDownDiv . DropDownDiv . showPositionedByField ( this , this . dropdownDispose _ . bind ( this ) ) ; this . menu _ . focus ( ) ; this . selectedMenuItem _ && this . menu _ . setHighlighted ( this . selectedMenuItem _ ) ; this . applyColour ( ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . dropdownCreate _ = function ( ) { var a = new module$exports$Blockly$Menu . Menu ; a . setRole ( module$exports$Blockly$utils$aria . Role . LISTBOX ) ; this . menu _ = a ; var b = this . getOptions ( ! 1 ) ; this . selectedMenuItem _ = null ; for ( var c = 0 ; c < b . length ; c ++ ) { var d = b [ c ] [ 0 ] , e = b [ c ] [ 1 ] ; if ( "object" === typeof d ) { var f = new Image ( d . width , d . height ) ; f . src = d . src ; f . alt = d . alt || "" ; d = f } d = new module$exports$Blockly$MenuItem . MenuItem ( d , e ) ; d . setRole ( module$exports$Blockly$utils$aria . Role . OPTION ) ;
d . setRightToLeft ( this . sourceBlock _ . RTL ) ; d . setCheckable ( ! 0 ) ; a . addChild ( d ) ; d . setChecked ( e === this . value _ ) ; e === this . value _ && ( this . selectedMenuItem _ = d ) ; d . onAction ( this . handleMenuActionEvent _ , this ) } } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . dropdownDispose _ = function ( ) { this . menu _ && this . menu _ . dispose ( ) ; this . selectedMenuItem _ = this . menu _ = null ; this . applyColour ( ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . handleMenuActionEvent _ = function ( a ) { module$exports$Blockly$DropDownDiv . DropDownDiv . hideIfOwner ( this , ! 0 ) ; this . onItemSelected _ ( this . menu _ , a ) } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . onItemSelected _ = function ( a , b ) { this . setValue ( b . getValue ( ) ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . trimOptions _ = function ( ) { var a = this . menuGenerator _ ; if ( Array . isArray ( a ) ) { for ( var b = ! 1 , c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] [ 0 ] ; "string" === typeof d ? a [ c ] [ 0 ] = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( d ) : ( null !== d . alt && ( a [ c ] [ 0 ] . alt = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( d . alt ) ) , b = ! 0 ) } if ( ! ( b || 2 > a . length ) ) { b = [ ] ; for ( c = 0 ; c < a . length ; c ++ ) b . push ( a [ c ] [ 0 ] ) ; c = ( 0 , $ . module$exports$Blockly$utils$string . shortestStringLength ) ( b ) ;
d = ( 0 , $ . module$exports$Blockly$utils$string . commonWordPrefix ) ( b , c ) ; var e = ( 0 , $ . module$exports$Blockly$utils$string . commonWordSuffix ) ( b , c ) ; ! d && ! e || c <= d + e || ( d && ( this . prefixField = b [ 0 ] . substring ( 0 , d - 1 ) ) , e && ( this . suffixField = b [ 0 ] . substr ( 1 - e ) ) , this . menuGenerator _ = $ . module$exports$Blockly$FieldDropdown . FieldDropdown . applyTrim _ ( a , d , e ) ) } } } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . applyTrim _ = function ( a , b , c ) { for ( var d = [ ] , e = 0 ; e < a . length ; e ++ ) { var f = a [ e ] [ 0 ] , g = a [ e ] [ 1 ] ; f = f . substring ( b , f . length - c ) ; d [ e ] = [ f , g ] } return d } ; $ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . isOptionListDynamic = function ( ) { return "function" === typeof this . menuGenerator _ } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . getOptions = function ( a ) { return this . isOptionListDynamic ( ) ? ( this . generatedOptions _ && a || ( this . generatedOptions _ = this . menuGenerator _ . call ( this ) , module$contents$Blockly$FieldDropdown _validateOptions ( this . generatedOptions _ ) ) , this . generatedOptions _ ) : this . menuGenerator _ } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . doClassValidation _ = function ( a ) { for ( var b = ! 1 , c = this . getOptions ( ! 0 ) , d = 0 , e ; e = c [ d ] ; d ++ ) if ( e [ 1 ] === a ) { b = ! 0 ; break } return b ? a : ( this . sourceBlock _ && console . warn ( "Cannot set the dropdown's value to an unavailable option. Block type: " + this . sourceBlock _ . type + ", Field name: " + this . name + ", Value: " + a ) , null ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . doValueUpdate _ = function ( a ) { $ . module$exports$Blockly$FieldDropdown . FieldDropdown . superClass _ . doValueUpdate _ . call ( this , a ) ; a = this . getOptions ( ! 0 ) ; for ( var b = 0 , c ; c = a [ b ] ; b ++ ) c [ 1 ] === this . value _ && ( this . selectedOption _ = c ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . applyColour = function ( ) { this . borderRect _ && ( this . borderRect _ . setAttribute ( "stroke" , this . sourceBlock _ . style . colourTertiary ) , this . menu _ ? this . borderRect _ . setAttribute ( "fill" , this . sourceBlock _ . style . colourTertiary ) : this . borderRect _ . setAttribute ( "fill" , "transparent" ) ) ; this . sourceBlock _ && this . arrow _ && ( this . sourceBlock _ . isShadow ( ) ? this . arrow _ . style . fill = this . sourceBlock _ . style . colourSecondary : this . arrow _ . style . fill = this . sourceBlock _ . style . colourPrimary ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . render _ = function ( ) { this . textContent _ . nodeValue = "" ; this . imageElement _ . style . display = "none" ; var a = this . selectedOption _ && this . selectedOption _ [ 0 ] ; a && "object" === typeof a ? this . renderSelectedImage _ ( a ) : this . renderSelectedText _ ( ) ; this . positionBorderRect _ ( ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . renderSelectedImage _ = function ( a ) { this . imageElement _ . style . display = "" ; this . imageElement _ . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , a . src ) ; this . imageElement _ . setAttribute ( "height" , a . height ) ; this . imageElement _ . setAttribute ( "width" , a . width ) ; var b = Number ( a . height ) ; a = Number ( a . width ) ; var c = ! ! this . borderRect _ , d = Math . max ( c ? this . getConstants ( ) . FIELD _DROPDOWN _BORDER _RECT _HEIGHT : 0 , b + module$contents$Blockly$FieldDropdown _IMAGE _Y _PADDING ) ;
c = c ? this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING : 0 ; var e = this . svgArrow _ ? this . positionSVGArrow _ ( a + c , d / 2 - this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE / 2 ) : ( 0 , module$exports$Blockly$utils$dom . getFastTextWidth ) ( this . arrow _ , this . getConstants ( ) . FIELD _TEXT _FONTSIZE , this . getConstants ( ) . FIELD _TEXT _FONTWEIGHT , this . getConstants ( ) . FIELD _TEXT _FONTFAMILY ) ; this . size _ . width = a + e + 2 * c ; this . size _ . height = d ; var f = 0 ; this . sourceBlock _ . RTL ? this . imageElement _ . setAttribute ( "x" , c + e ) : ( f = a + e , this . textElement _ . setAttribute ( "text-anchor" ,
"end" ) , this . imageElement _ . setAttribute ( "x" , c ) ) ; this . imageElement _ . setAttribute ( "y" , d / 2 - b / 2 ) ; this . positionTextElement _ ( f + c , a + e ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . renderSelectedText _ = function ( ) { this . textContent _ . nodeValue = this . getDisplayText _ ( ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . textElement _ , "blocklyDropdownText" ) ; this . textElement _ . setAttribute ( "text-anchor" , "start" ) ; var a = ! ! this . borderRect _ , b = Math . max ( a ? this . getConstants ( ) . FIELD _DROPDOWN _BORDER _RECT _HEIGHT : 0 , this . getConstants ( ) . FIELD _TEXT _HEIGHT ) , c = ( 0 , module$exports$Blockly$utils$dom . getFastTextWidth ) ( this . textElement _ , this . getConstants ( ) . FIELD _TEXT _FONTSIZE ,
this . getConstants ( ) . FIELD _TEXT _FONTWEIGHT , this . getConstants ( ) . FIELD _TEXT _FONTFAMILY ) ; a = a ? this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING : 0 ; var d = 0 ; this . svgArrow _ && ( d = this . positionSVGArrow _ ( c + a , b / 2 - this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE / 2 ) ) ; this . size _ . width = c + d + 2 * a ; this . size _ . height = b ; this . positionTextElement _ ( a , c ) } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . positionSVGArrow _ = function ( a , b ) { if ( ! this . svgArrow _ ) return 0 ; var c = this . borderRect _ ? this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING : 0 , d = this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _PADDING , e = this . getConstants ( ) . FIELD _DROPDOWN _SVG _ARROW _SIZE ; this . svgArrow _ . setAttribute ( "transform" , "translate(" + ( this . sourceBlock _ . RTL ? c : a + d ) + "," + b + ")" ) ; return e + d } ;
$ . module$exports$Blockly$FieldDropdown . FieldDropdown . prototype . getText _ = function ( ) { if ( ! this . selectedOption _ ) return null ; var a = this . selectedOption _ [ 0 ] ; return "object" === typeof a ? a . alt : a } ;
var module$contents$Blockly$FieldDropdown _validateOptions = function ( a ) { if ( ! Array . isArray ( a ) ) throw TypeError ( "FieldDropdown options must be an array." ) ; if ( ! a . length ) throw TypeError ( "FieldDropdown options must not be an empty array." ) ; for ( var b = ! 1 , c = 0 ; c < a . length ; c ++ ) { var d = a [ c ] ; Array . isArray ( d ) ? "string" !== typeof d [ 1 ] ? ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option id must be a string. Found " + d [ 1 ] + " in: " , d ) ) : d [ 0 ] && "string" !== typeof d [ 0 ] && "string" !== typeof d [ 0 ] . src && ( b = ! 0 , console . error ( "Invalid option[" +
c + "]: Each FieldDropdown option must have a string label or image description. Found" + d [ 0 ] + " in: " , d ) ) : ( b = ! 0 , console . error ( "Invalid option[" + c + "]: Each FieldDropdown option must be an array. Found: " , d ) ) } if ( b ) throw TypeError ( "Found invalid FieldDropdown options." ) ; } ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_dropdown" , $ . module$exports$Blockly$FieldDropdown . FieldDropdown ) ; var module$exports$Blockly$FieldVariable = { FieldVariable : function ( a , b , c , d , e ) { this . menuGenerator _ = module$exports$Blockly$FieldVariable . FieldVariable . dropdownCreate ; this . defaultVariableName = "string" === typeof a ? a : "" ; this . size _ = new module$exports$Blockly$utils$Size . Size ( 0 , 0 ) ; e && this . configure _ ( e ) ; b && this . setValidator ( b ) ; e || this . setTypes _ ( c , d ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FieldVariable . FieldVariable , $ . module$exports$Blockly$FieldDropdown . FieldDropdown ) ;
module$exports$Blockly$FieldVariable . FieldVariable . fromJson = function ( a ) { return new this ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . variable ) , void 0 , void 0 , void 0 , a ) } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . SERIALIZABLE = ! 0 ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . configure _ = function ( a ) { module$exports$Blockly$FieldVariable . FieldVariable . superClass _ . configure _ . call ( this , a ) ; this . setTypes _ ( a . variableTypes , a . defaultType ) } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . initModel = function ( ) { if ( ! this . variable _ ) { var a = ( 0 , $ . module$exports$Blockly$Variables . getOrCreateVariablePackage ) ( this . sourceBlock _ . workspace , null , this . defaultVariableName , this . defaultType _ ) ; this . doValueUpdate _ ( a . getId ( ) ) } } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . shouldAddBorderRect _ = function ( ) { return module$exports$Blockly$FieldVariable . FieldVariable . superClass _ . shouldAddBorderRect _ . call ( this ) && ( ! this . getConstants ( ) . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW || "variables_get" !== this . sourceBlock _ . type ) } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . fromXml = function ( a ) { var b = a . getAttribute ( "id" ) , c = a . textContent , d = a . getAttribute ( "variabletype" ) || a . getAttribute ( "variableType" ) || "" ; b = ( 0 , $ . module$exports$Blockly$Variables . getOrCreateVariablePackage ) ( this . sourceBlock _ . workspace , b , c , d ) ; if ( null !== d && d !== b . type ) throw Error ( "Serialized variable type with id '" + b . getId ( ) + "' had type " + b . type + ", and does not match variable field that references it: " + ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( a ) +
"." ) ; this . setValue ( b . getId ( ) ) } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . toXml = function ( a ) { this . initModel ( ) ; a . id = this . variable _ . getId ( ) ; a . textContent = this . variable _ . name ; this . variable _ . type && a . setAttribute ( "variabletype" , this . variable _ . type ) ; return a } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . saveState = function ( a ) { var b = this . saveLegacyState ( module$exports$Blockly$FieldVariable . FieldVariable ) ; if ( null !== b ) return b ; this . initModel ( ) ; b = { id : this . variable _ . getId ( ) } ; a && ( b . name = this . variable _ . name , b . type = this . variable _ . type ) ; return b } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . loadState = function ( a ) { this . loadLegacyState ( module$exports$Blockly$FieldVariable . FieldVariable , a ) || ( a = ( 0 , $ . module$exports$Blockly$Variables . getOrCreateVariablePackage ) ( this . sourceBlock _ . workspace , a . id || null , a . name , a . type || "" ) , this . setValue ( a . getId ( ) ) ) } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . setSourceBlock = function ( a ) { if ( a . isShadow ( ) ) throw Error ( "Variable fields are not allowed to exist on shadow blocks." ) ; module$exports$Blockly$FieldVariable . FieldVariable . superClass _ . setSourceBlock . call ( this , a ) } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . getValue = function ( ) { return this . variable _ ? this . variable _ . getId ( ) : null } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . getText = function ( ) { return this . variable _ ? this . variable _ . name : "" } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . getVariable = function ( ) { return this . variable _ } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . getValidator = function ( ) { return this . variable _ ? this . validator _ : null } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . doClassValidation _ = function ( a ) { if ( null === a ) return null ; var b = ( 0 , $ . module$exports$Blockly$Variables . getVariable ) ( this . sourceBlock _ . workspace , a ) ; if ( ! b ) return console . warn ( "Variable id doesn't point to a real variable! ID was " + a ) , null ; b = b . type ; return this . typeIsAllowed _ ( b ) ? a : ( console . warn ( "Variable type doesn't match this field! Type was " + b ) , null ) } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . doValueUpdate _ = function ( a ) { this . variable _ = ( 0 , $ . module$exports$Blockly$Variables . getVariable ) ( this . sourceBlock _ . workspace , a ) ; module$exports$Blockly$FieldVariable . FieldVariable . superClass _ . doValueUpdate _ . call ( this , a ) } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . typeIsAllowed _ = function ( a ) { var b = this . getVariableTypes _ ( ) ; if ( ! b ) return ! 0 ; for ( var c = 0 ; c < b . length ; c ++ ) if ( a === b [ c ] ) return ! 0 ; return ! 1 } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . getVariableTypes _ = function ( ) { var a = this . variableTypes ; if ( null === a && this . sourceBlock _ && this . sourceBlock _ . workspace ) return this . sourceBlock _ . workspace . getVariableTypes ( ) ; a = a || [ "" ] ; if ( 0 === a . length ) throw a = this . getText ( ) , Error ( "'variableTypes' of field variable " + a + " was an empty list" ) ; return a } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . setTypes _ = function ( a , b ) { b = b || "" ; if ( null === a || void 0 === a ) a = null ; else if ( Array . isArray ( a ) ) { for ( var c = ! 1 , d = 0 ; d < a . length ; d ++ ) a [ d ] === b && ( c = ! 0 ) ; if ( ! c ) throw Error ( "Invalid default type '" + b + "' in the definition of a FieldVariable" ) ; } else throw Error ( "'variableTypes' was not an array in the definition of a FieldVariable" ) ; this . defaultType _ = b ; this . variableTypes = a } ; module$exports$Blockly$FieldVariable . FieldVariable . prototype . refreshVariableName = function ( ) { this . forceRerender ( ) } ;
module$exports$Blockly$FieldVariable . FieldVariable . dropdownCreate = function ( ) { if ( ! this . variable _ ) throw Error ( "Tried to call dropdownCreate on a variable field with no variable selected." ) ; var a = this . getText ( ) , b = [ ] ; if ( this . sourceBlock _ && this . sourceBlock _ . workspace ) for ( var c = this . getVariableTypes _ ( ) , d = 0 ; d < c . length ; d ++ ) { var e = this . sourceBlock _ . workspace . getVariablesOfType ( c [ d ] ) ; b = b . concat ( e ) } b . sort ( module$exports$Blockly$VariableModel . VariableModel . compareByName ) ; c = [ ] ; for ( d = 0 ; d < b . length ; d ++ ) c [ d ] = [ b [ d ] . name ,
b [ d ] . getId ( ) ] ; c . push ( [ $ . module$exports$Blockly$Msg . Msg . RENAME _VARIABLE , $ . module$exports$Blockly$internalConstants . RENAME _VARIABLE _ID ] ) ; $ . module$exports$Blockly$Msg . Msg . DELETE _VARIABLE && c . push ( [ $ . module$exports$Blockly$Msg . Msg . DELETE _VARIABLE . replace ( "%1" , a ) , $ . module$exports$Blockly$internalConstants . DELETE _VARIABLE _ID ] ) ; return c } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . onItemSelected _ = function ( a , b ) { a = b . getValue ( ) ; if ( this . sourceBlock _ && this . sourceBlock _ . workspace ) { if ( a === $ . module$exports$Blockly$internalConstants . RENAME _VARIABLE _ID ) { ( 0 , $ . module$exports$Blockly$Variables . renameVariable ) ( this . sourceBlock _ . workspace , this . variable _ ) ; return } if ( a === $ . module$exports$Blockly$internalConstants . DELETE _VARIABLE _ID ) { this . sourceBlock _ . workspace . deleteVariableById ( this . variable _ . getId ( ) ) ; return } } this . setValue ( a ) } ;
module$exports$Blockly$FieldVariable . FieldVariable . prototype . referencesVariables = function ( ) { return ! 0 } ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_variable" , module$exports$Blockly$FieldVariable . FieldVariable ) ; $ . module$exports$Blockly$FieldTextInput = { FieldTextInput : function ( a , b , c ) { this . spellcheck _ = ! 0 ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . superClass _ . constructor . call ( this , a , b , c ) ; this . onKeyInputWrapper _ = this . onKeyDownWrapper _ = this . htmlInput _ = null ; this . fullBlockClickTarget _ = ! 1 ; this . workspace _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( $ . module$exports$Blockly$FieldTextInput . FieldTextInput , module$exports$Blockly$Field . Field ) ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . DEFAULT _VALUE = "" ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . fromJson = function ( a ) { return new this ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . text ) , void 0 , a ) } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . SERIALIZABLE = ! 0 ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . BORDERRADIUS = 4 ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . CURSOR = "text" ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . configure _ = function ( a ) { $ . module$exports$Blockly$FieldTextInput . FieldTextInput . superClass _ . configure _ . call ( this , a ) ; "boolean" === typeof a . spellcheck && ( this . spellcheck _ = a . spellcheck ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . initView = function ( ) { if ( this . getConstants ( ) . FULL _BLOCK _FIELDS ) { for ( var a = 0 , b = 0 , c = 0 , d ; d = this . sourceBlock _ . inputList [ c ] ; c ++ ) { for ( var e = 0 ; d . fieldRow [ e ] ; e ++ ) a ++ ; d . connection && b ++ } this . fullBlockClickTarget _ = 1 >= a && this . sourceBlock _ . outputConnection && ! b } else this . fullBlockClickTarget _ = ! 1 ; this . fullBlockClickTarget _ ? this . clickTarget _ = this . sourceBlock _ . getSvgRoot ( ) : this . createBorderRect _ ( ) ; this . createTextElement _ ( ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . doClassValidation _ = function ( a ) { return null === a || void 0 === a ? null : String ( a ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . doValueInvalid _ = function ( a ) { this . isBeingEdited _ && ( this . isTextValid _ = ! 1 , a = this . value _ , this . value _ = this . htmlInput _ . untypedDefaultValue _ , this . sourceBlock _ && ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( this . sourceBlock _ , "field" , this . name || null , a , this . value _ ) ) ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . doValueUpdate _ = function ( a ) { this . isTextValid _ = ! 0 ; this . value _ = a ; this . isBeingEdited _ || ( this . isDirty _ = ! 0 ) } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . applyColour = function ( ) { this . sourceBlock _ && this . getConstants ( ) . FULL _BLOCK _FIELDS && ( this . borderRect _ ? this . borderRect _ . setAttribute ( "stroke" , this . sourceBlock _ . style . colourTertiary ) : this . sourceBlock _ . pathObject . svgPath . setAttribute ( "fill" , this . getConstants ( ) . FIELD _BORDER _RECT _COLOUR ) ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . render _ = function ( ) { $ . module$exports$Blockly$FieldTextInput . FieldTextInput . superClass _ . render _ . call ( this ) ; if ( this . isBeingEdited _ ) { this . resizeEditor _ ( ) ; var a = this . htmlInput _ ; this . isTextValid _ ? ( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyInvalidInput" ) , ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . INVALID , ! 1 ) ) : ( ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyInvalidInput" ) ,
( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . INVALID , ! 0 ) ) } } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . setSpellcheck = function ( a ) { a !== this . spellcheck _ && ( this . spellcheck _ = a , this . htmlInput _ && this . htmlInput _ . setAttribute ( "spellcheck" , this . spellcheck _ ) ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . showEditor _ = function ( a , b ) { this . workspace _ = this . sourceBlock _ . workspace ; a = b || ! 1 ; ! a && ( module$exports$Blockly$utils$userAgent . MOBILE || module$exports$Blockly$utils$userAgent . ANDROID || module$exports$Blockly$utils$userAgent . IPAD ) ? this . showPromptEditor _ ( ) : this . showInlineEditor _ ( a ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . showPromptEditor _ = function ( ) { ( 0 , module$exports$Blockly$dialog . prompt ) ( $ . module$exports$Blockly$Msg . Msg . CHANGE _VALUE _TITLE , this . getText ( ) , function ( a ) { null !== a && this . setValue ( this . getValueFromEditorText _ ( a ) ) } . bind ( this ) ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . showInlineEditor _ = function ( a ) { ( 0 , module$exports$Blockly$WidgetDiv . show ) ( this , this . sourceBlock _ . RTL , this . widgetDispose _ . bind ( this ) ) ; this . htmlInput _ = this . widgetCreate _ ( ) ; this . isBeingEdited _ = ! 0 ; a || ( this . htmlInput _ . focus ( { preventScroll : ! 0 } ) , this . htmlInput _ . select ( ) ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . widgetCreate _ = function ( ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; var a = ( 0 , module$exports$Blockly$WidgetDiv . getDiv ) ( ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . getClickTarget _ ( ) , "editing" ) ; var b = document . createElement ( "input" ) ; b . className = "blocklyHtmlInput" ; b . setAttribute ( "spellcheck" , this . spellcheck _ ) ; var c = this . workspace _ . getScale ( ) , d = this . getConstants ( ) . FIELD _TEXT _FONTSIZE * c + "pt" ; a . style . fontSize = d ; b . style . fontSize =
d ; d = $ . module$exports$Blockly$FieldTextInput . FieldTextInput . BORDERRADIUS * c + "px" ; if ( this . fullBlockClickTarget _ ) { d = this . getScaledBBox ( ) ; d = ( d . bottom - d . top ) / 2 + "px" ; var e = this . sourceBlock _ . getParent ( ) ? this . sourceBlock _ . getParent ( ) . style . colourTertiary : this . sourceBlock _ . style . colourTertiary ; b . style . border = 1 * c + "px solid " + e ; a . style . borderRadius = d ; a . style . transition = "box-shadow 0.25s ease 0s" ; this . getConstants ( ) . FIELD _TEXTINPUT _BOX _SHADOW && ( a . style . boxShadow = "rgba(255, 255, 255, 0.3) 0 0 0 " + 4 * c + "px" ) } b . style . borderRadius =
d ; a . appendChild ( b ) ; b . value = b . defaultValue = this . getEditorText _ ( this . value _ ) ; b . untypedDefaultValue _ = this . value _ ; b . oldValue _ = null ; this . resizeEditor _ ( ) ; this . bindInputEvents _ ( b ) ; return b } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . widgetDispose _ = function ( ) { this . isBeingEdited _ = ! 1 ; this . isTextValid _ = ! 0 ; this . forceRerender ( ) ; if ( this . onFinishEditing _ ) this . onFinishEditing _ ( this . value _ ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) ; this . unbindInputEvents _ ( ) ; var a = ( 0 , module$exports$Blockly$WidgetDiv . getDiv ) ( ) . style ; a . width = "auto" ; a . height = "auto" ; a . fontSize = "" ; a . transition = "" ; a . boxShadow = "" ; this . htmlInput _ = null ; ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . getClickTarget _ ( ) ,
"editing" ) } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . bindInputEvents _ = function ( a ) { this . onKeyDownWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , "keydown" , this , this . onHtmlInputKeyDown _ ) ; this . onKeyInputWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , "input" , this , this . onHtmlInputChange _ ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . unbindInputEvents _ = function ( ) { this . onKeyDownWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onKeyDownWrapper _ ) , this . onKeyDownWrapper _ = null ) ; this . onKeyInputWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onKeyInputWrapper _ ) , this . onKeyInputWrapper _ = null ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . onHtmlInputKeyDown _ = function ( a ) { a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . ENTER ? ( ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) , module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) ) : a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . ESC ? ( this . setValue ( this . htmlInput _ . untypedDefaultValue _ ) , ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) , module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) ) :
a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . TAB && ( ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) , module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) , this . sourceBlock _ . tab ( this , ! a . shiftKey ) , a . preventDefault ( ) ) } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . onHtmlInputChange _ = function ( a ) { a = this . htmlInput _ . value ; a !== this . htmlInput _ . oldValue _ && ( this . htmlInput _ . oldValue _ = a , a = this . getValueFromEditorText _ ( a ) , this . setValue ( a ) , this . forceRerender ( ) , this . resizeEditor _ ( ) ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . setEditorValue _ = function ( a ) { this . isDirty _ = ! 0 ; this . isBeingEdited _ && ( this . htmlInput _ . value = this . getEditorText _ ( a ) ) ; this . setValue ( a ) } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . resizeEditor _ = function ( ) { var a = ( 0 , module$exports$Blockly$WidgetDiv . getDiv ) ( ) , b = this . getScaledBBox ( ) ; a . style . width = b . right - b . left + "px" ; a . style . height = b . bottom - b . top + "px" ; b = new module$exports$Blockly$utils$Coordinate . Coordinate ( this . sourceBlock _ . RTL ? b . right - a . offsetWidth : b . left , b . top ) ; a . style . left = b . x + "px" ; a . style . top = b . y + "px" } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . isTabNavigable = function ( ) { return ! 0 } ;
$ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . getText _ = function ( ) { return this . isBeingEdited _ && this . htmlInput _ ? this . htmlInput _ . value : null } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . getEditorText _ = function ( a ) { return String ( a ) } ; $ . module$exports$Blockly$FieldTextInput . FieldTextInput . prototype . getValueFromEditorText _ = function ( a ) { return a } ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_input" , $ . module$exports$Blockly$FieldTextInput . FieldTextInput ) ; var module$exports$Blockly$FieldNumber = { FieldNumber : function ( a , b , c , d , e , f ) { this . min _ = - Infinity ; this . max _ = Infinity ; this . precision _ = 0 ; this . decimalPlaces _ = null ; module$exports$Blockly$FieldNumber . FieldNumber . superClass _ . constructor . call ( this , a , e , f ) ; f || this . setConstraints ( b , c , d ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FieldNumber . FieldNumber , $ . module$exports$Blockly$FieldTextInput . FieldTextInput ) ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . DEFAULT _VALUE = 0 ; module$exports$Blockly$FieldNumber . FieldNumber . fromJson = function ( a ) { return new this ( a . value , void 0 , void 0 , void 0 , void 0 , a ) } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . SERIALIZABLE = ! 0 ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . configure _ = function ( a ) { module$exports$Blockly$FieldNumber . FieldNumber . superClass _ . configure _ . call ( this , a ) ; this . setMinInternal _ ( a . min ) ; this . setMaxInternal _ ( a . max ) ; this . setPrecisionInternal _ ( a . precision ) } ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . setConstraints = function ( a , b , c ) { this . setMinInternal _ ( a ) ; this . setMaxInternal _ ( b ) ; this . setPrecisionInternal _ ( c ) ; this . setValue ( this . getValue ( ) ) } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . setMin = function ( a ) { this . setMinInternal _ ( a ) ; this . setValue ( this . getValue ( ) ) } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . setMinInternal _ = function ( a ) { null == a ? this . min _ = - Infinity : ( a = Number ( a ) , isNaN ( a ) || ( this . min _ = a ) ) } ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . getMin = function ( ) { return this . min _ } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . setMax = function ( a ) { this . setMaxInternal _ ( a ) ; this . setValue ( this . getValue ( ) ) } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . setMaxInternal _ = function ( a ) { null == a ? this . max _ = Infinity : ( a = Number ( a ) , isNaN ( a ) || ( this . max _ = a ) ) } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . getMax = function ( ) { return this . max _ } ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . setPrecision = function ( a ) { this . setPrecisionInternal _ ( a ) ; this . setValue ( this . getValue ( ) ) } ; module$exports$Blockly$FieldNumber . FieldNumber . prototype . setPrecisionInternal _ = function ( a ) { this . precision _ = Number ( a ) || 0 ; var b = String ( this . precision _ ) ; - 1 !== b . indexOf ( "e" ) && ( b = this . precision _ . toLocaleString ( "en-US" , { maximumFractionDigits : 20 } ) ) ; var c = b . indexOf ( "." ) ; this . decimalPlaces _ = - 1 === c ? a ? 0 : null : b . length - c - 1 } ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . getPrecision = function ( ) { return this . precision _ } ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . doClassValidation _ = function ( a ) { if ( null === a ) return null ; a = String ( a ) ; a = a . replace ( /O/ig , "0" ) ; a = a . replace ( /,/g , "" ) ; a = a . replace ( /infinity/i , "Infinity" ) ; a = Number ( a || 0 ) ; if ( isNaN ( a ) ) return null ; a = Math . min ( Math . max ( a , this . min _ ) , this . max _ ) ; this . precision _ && isFinite ( a ) && ( a = Math . round ( a / this . precision _ ) * this . precision _ ) ; null !== this . decimalPlaces _ && ( a = Number ( a . toFixed ( this . decimalPlaces _ ) ) ) ; return a } ;
module$exports$Blockly$FieldNumber . FieldNumber . prototype . widgetCreate _ = function ( ) { var a = module$exports$Blockly$FieldNumber . FieldNumber . superClass _ . widgetCreate _ . call ( this ) ; - Infinity < this . min _ && ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . VALUEMIN , this . min _ ) ; Infinity > this . max _ && ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . VALUEMAX , this . max _ ) ; return a } ;
( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_number" , module$exports$Blockly$FieldNumber . FieldNumber ) ; var module$exports$Blockly$FieldMultilineInput = { FieldMultilineInput : function ( a , b , c ) { module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . superClass _ . constructor . call ( this , a , b , c ) ; this . textGroup _ = null ; this . maxLines _ = Infinity ; this . isOverflowedY _ = ! 1 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FieldMultilineInput . FieldMultilineInput , $ . module$exports$Blockly$FieldTextInput . FieldTextInput ) ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . configure _ = function ( a ) { module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . superClass _ . configure _ . call ( this , a ) ; a . maxLines && this . setMaxLines ( a . maxLines ) } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . fromJson = function ( a ) { return new this ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . text ) , void 0 , a ) } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . toXml = function ( a ) { a . textContent = this . getValue ( ) . replace ( /\n/g , " " ) ; return a } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . fromXml = function ( a ) { this . setValue ( a . textContent . replace ( / /g , "\n" ) ) } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . saveState = function ( ) { var a = this . saveLegacyState ( module$exports$Blockly$FieldMultilineInput . FieldMultilineInput ) ; return null !== a ? a : this . getValue ( ) } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . loadState = function ( a ) { this . loadLegacyState ( module$exports$Blockly$Field . Field , a ) || this . setValue ( a ) } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . initView = function ( ) { this . createBorderRect _ ( ) ; this . textGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyEditableText" } , this . fieldGroup _ ) } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . getDisplayText _ = function ( ) { var a = this . getText ( ) ; if ( ! a ) return module$exports$Blockly$Field . Field . NBSP ; var b = a . split ( "\n" ) ; a = "" ; for ( var c = this . isOverflowedY _ ? this . maxLines _ : b . length , d = 0 ; d < c ; d ++ ) { var e = b [ d ] ; e . length > this . maxDisplayLength ? e = e . substring ( 0 , this . maxDisplayLength - 4 ) + "..." : this . isOverflowedY _ && d === c - 1 && ( e = e . substring ( 0 , e . length - 3 ) + "..." ) ; e = e . replace ( /\s/g , module$exports$Blockly$Field . Field . NBSP ) ; a += e ; d !== c - 1 && ( a += "\n" ) } this . sourceBlock _ . RTL &&
( a += "\u200f" ) ; return a } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . doValueUpdate _ = function ( a ) { module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . superClass _ . doValueUpdate _ . call ( this , a ) ; this . isOverflowedY _ = this . value _ . split ( "\n" ) . length > this . maxLines _ } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . render _ = function ( ) { for ( var a ; a = this . textGroup _ . firstChild ; ) this . textGroup _ . removeChild ( a ) ; a = this . getDisplayText _ ( ) . split ( "\n" ) ; for ( var b = 0 , c = 0 ; c < a . length ; c ++ ) { var d = this . getConstants ( ) . FIELD _TEXT _HEIGHT + this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TEXT , { "class" : "blocklyText blocklyMultilineText" , x : this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING ,
y : b + this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING , dy : this . getConstants ( ) . FIELD _TEXT _BASELINE } , this . textGroup _ ) . appendChild ( document . createTextNode ( a [ c ] ) ) ; b += d } this . isBeingEdited _ && ( a = this . htmlInput _ , this . isOverflowedY _ ? ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyHtmlTextAreaInputOverflowedY" ) : ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyHtmlTextAreaInputOverflowedY" ) ) ; this . updateSize _ ( ) ; this . isBeingEdited _ && ( this . sourceBlock _ . RTL ? setTimeout ( this . resizeEditor _ . bind ( this ) ,
0 ) : this . resizeEditor _ ( ) , a = this . htmlInput _ , this . isTextValid _ ? ( ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyInvalidInput" ) , ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . INVALID , ! 1 ) ) : ( ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyInvalidInput" ) , ( 0 , module$exports$Blockly$utils$aria . setState ) ( a , module$exports$Blockly$utils$aria . State . INVALID , ! 0 ) ) ) } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . updateSize _ = function ( ) { for ( var a = this . textGroup _ . childNodes , b = 0 , c = 0 , d = 0 ; d < a . length ; d ++ ) { var e = ( 0 , module$exports$Blockly$utils$dom . getTextWidth ) ( a [ d ] ) ; e > b && ( b = e ) ; c += this . getConstants ( ) . FIELD _TEXT _HEIGHT + ( 0 < d ? this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING : 0 ) } if ( this . isBeingEdited _ ) { a = this . value _ . split ( "\n" ) ; d = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TEXT , { "class" : "blocklyText blocklyMultilineText" } ) ;
e = this . getConstants ( ) . FIELD _TEXT _FONTSIZE ; for ( var f = this . getConstants ( ) . FIELD _TEXT _FONTWEIGHT , g = this . getConstants ( ) . FIELD _TEXT _FONTFAMILY , h = 0 ; h < a . length ; h ++ ) { a [ h ] . length > this . maxDisplayLength && ( a [ h ] = a [ h ] . substring ( 0 , this . maxDisplayLength ) ) ; d . textContent = a [ h ] ; var k = ( 0 , module$exports$Blockly$utils$dom . getFastTextWidth ) ( d , e , f , g ) ; k > b && ( b = k ) } b += this . htmlInput _ . offsetWidth - this . htmlInput _ . clientWidth } this . borderRect _ && ( c += 2 * this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING , b += 2 * this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING ,
this . borderRect _ . setAttribute ( "width" , b ) , this . borderRect _ . setAttribute ( "height" , c ) ) ; this . size _ . width = b ; this . size _ . height = c ; this . positionBorderRect _ ( ) } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . showEditor _ = function ( a , b ) { module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . superClass _ . showEditor _ . call ( this , a , b ) ; this . forceRerender ( ) } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . widgetCreate _ = function ( ) { var a = ( 0 , module$exports$Blockly$WidgetDiv . getDiv ) ( ) , b = this . workspace _ . getScale ( ) , c = document . createElement ( "textarea" ) ; c . className = "blocklyHtmlInput blocklyHtmlTextAreaInput" ; c . setAttribute ( "spellcheck" , this . spellcheck _ ) ; var d = this . getConstants ( ) . FIELD _TEXT _FONTSIZE * b + "pt" ; a . style . fontSize = d ; c . style . fontSize = d ; c . style . borderRadius = $ . module$exports$Blockly$FieldTextInput . FieldTextInput . BORDERRADIUS * b + "px" ;
d = this . getConstants ( ) . FIELD _BORDER _RECT _X _PADDING * b ; var e = this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING * b / 2 ; c . style . padding = e + "px " + d + "px " + e + "px " + d + "px" ; d = this . getConstants ( ) . FIELD _TEXT _HEIGHT + this . getConstants ( ) . FIELD _BORDER _RECT _Y _PADDING ; c . style . lineHeight = d * b + "px" ; a . appendChild ( c ) ; c . value = c . defaultValue = this . getEditorText _ ( this . value _ ) ; c . untypedDefaultValue _ = this . value _ ; c . oldValue _ = null ; module$exports$Blockly$utils$userAgent . GECKO ? setTimeout ( this . resizeEditor _ . bind ( this ) , 0 ) : this . resizeEditor _ ( ) ;
this . bindInputEvents _ ( c ) ; return c } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . setMaxLines = function ( a ) { "number" === typeof a && 0 < a && a !== this . maxLines _ && ( this . maxLines _ = a , this . forceRerender ( ) ) } ; module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . getMaxLines = function ( ) { return this . maxLines _ } ;
module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . prototype . onHtmlInputKeyDown _ = function ( a ) { a . keyCode !== module$exports$Blockly$utils$KeyCodes . KeyCodes . ENTER && module$exports$Blockly$FieldMultilineInput . FieldMultilineInput . superClass _ . onHtmlInputKeyDown _ . call ( this , a ) } ; ( 0 , module$exports$Blockly$Css . register ) ( "\n .blocklyHtmlTextAreaInput {\n font-family: monospace;\n resize: none;\n overflow: hidden;\n height: 100%;\n text-align: left;\n }\n\n .blocklyHtmlTextAreaInputOverflowedY {\n overflow-y: scroll;\n }\n" ) ;
( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_multilinetext" , module$exports$Blockly$FieldMultilineInput . FieldMultilineInput ) ; var module$exports$Blockly$FieldLabelSerializable = { FieldLabelSerializable : function ( a , b , c ) { module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable . superClass _ . constructor . call ( this , a , b , c ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable , $ . module$exports$Blockly$FieldLabel . FieldLabel ) ;
module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable . fromJson = function ( a ) { return new this ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . text ) , void 0 , a ) } ; module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable . prototype . EDITABLE = ! 1 ; module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable . prototype . SERIALIZABLE = ! 0 ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_label_serializable" , module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable ) ; var module$exports$Blockly$FieldColour = { FieldColour : function ( a , b , c ) { module$exports$Blockly$FieldColour . FieldColour . superClass _ . constructor . call ( this , a , b , c ) ; this . onKeyDownWrapper _ = this . onMouseLeaveWrapper _ = this . onMouseEnterWrapper _ = this . onMouseMoveWrapper _ = this . onClickWrapper _ = this . highlightedIndex _ = this . picker _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FieldColour . FieldColour , module$exports$Blockly$Field . Field ) ;
module$exports$Blockly$FieldColour . FieldColour . fromJson = function ( a ) { return new this ( a . colour , void 0 , a ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . SERIALIZABLE = ! 0 ; module$exports$Blockly$FieldColour . FieldColour . prototype . CURSOR = "default" ; module$exports$Blockly$FieldColour . FieldColour . prototype . isDirty _ = ! 1 ; module$exports$Blockly$FieldColour . FieldColour . prototype . colours _ = null ; module$exports$Blockly$FieldColour . FieldColour . prototype . titles _ = null ;
module$exports$Blockly$FieldColour . FieldColour . prototype . columns _ = 0 ; module$exports$Blockly$FieldColour . FieldColour . prototype . configure _ = function ( a ) { module$exports$Blockly$FieldColour . FieldColour . superClass _ . configure _ . call ( this , a ) ; a . colourOptions && ( this . colours _ = a . colourOptions , this . titles _ = a . colourTitles ) ; a . columns && ( this . columns _ = a . columns ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . initView = function ( ) { this . size _ = new module$exports$Blockly$utils$Size . Size ( this . getConstants ( ) . FIELD _COLOUR _DEFAULT _WIDTH , this . getConstants ( ) . FIELD _COLOUR _DEFAULT _HEIGHT ) ; this . getConstants ( ) . FIELD _COLOUR _FULL _BLOCK ? this . clickTarget _ = this . sourceBlock _ . getSvgRoot ( ) : ( this . createBorderRect _ ( ) , this . borderRect _ . style . fillOpacity = "1" ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . applyColour = function ( ) { this . getConstants ( ) . FIELD _COLOUR _FULL _BLOCK ? ( this . sourceBlock _ . pathObject . svgPath . setAttribute ( "fill" , this . getValue ( ) ) , this . sourceBlock _ . pathObject . svgPath . setAttribute ( "stroke" , "#fff" ) ) : this . borderRect _ && ( this . borderRect _ . style . fill = this . getValue ( ) ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . doClassValidation _ = function ( a ) { return "string" !== typeof a ? null : ( 0 , module$exports$Blockly$utils$colour . parse ) ( a ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . doValueUpdate _ = function ( a ) { this . value _ = a ; this . borderRect _ ? this . borderRect _ . style . fill = a : this . sourceBlock _ && this . sourceBlock _ . rendered && ( this . sourceBlock _ . pathObject . svgPath . setAttribute ( "fill" , a ) , this . sourceBlock _ . pathObject . svgPath . setAttribute ( "stroke" , "#fff" ) ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . getText = function ( ) { var a = this . value _ ; /^#(.)\1(.)\2(.)\3$/ . test ( a ) && ( a = "#" + a [ 1 ] + a [ 3 ] + a [ 5 ] ) ; return a } ;
module$exports$Blockly$FieldColour . FieldColour . COLOURS = "#ffffff #cccccc #c0c0c0 #999999 #666666 #333333 #000000 #ffcccc #ff6666 #ff0000 #cc0000 #990000 #660000 #330000 #ffcc99 #ff9966 #ff9900 #ff6600 #cc6600 #993300 #663300 #ffff99 #ffff66 #ffcc66 #ffcc33 #cc9933 #996633 #663333 #ffffcc #ffff33 #ffff00 #ffcc00 #999900 #666600 #333300 #99ff99 #66ff99 #33ff33 #33cc00 #009900 #006600 #003300 #99ffff #33ffff #66cccc #00cccc #339999 #336666 #003333 #ccffff #66ffff #33ccff #3366ff #3333ff #000099 #000066 #ccccff #9999ff #6666cc #6633ff #6600cc #333399 #330099 #ffccff #ff99ff #cc66cc #cc33cc #993399 #663366 #330033" . split ( " " ) ;
module$exports$Blockly$FieldColour . FieldColour . prototype . DEFAULT _VALUE = module$exports$Blockly$FieldColour . FieldColour . COLOURS [ 0 ] ; module$exports$Blockly$FieldColour . FieldColour . TITLES = [ ] ; module$exports$Blockly$FieldColour . FieldColour . COLUMNS = 7 ; module$exports$Blockly$FieldColour . FieldColour . prototype . setColours = function ( a , b ) { this . colours _ = a ; b && ( this . titles _ = b ) ; return this } ; module$exports$Blockly$FieldColour . FieldColour . prototype . setColumns = function ( a ) { this . columns _ = a ; return this } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . showEditor _ = function ( ) { this . dropdownCreate _ ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . getContentDiv ( ) . appendChild ( this . picker _ ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . showPositionedByField ( this , this . dropdownDispose _ . bind ( this ) ) ; this . picker _ . focus ( { preventScroll : ! 0 } ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . onClick _ = function ( a ) { a = ( a = a . target ) && a . label ; null !== a && ( this . setValue ( a ) , module$exports$Blockly$DropDownDiv . DropDownDiv . hideIfOwner ( this ) ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . onKeyDown _ = function ( a ) { var b = ! 1 ; if ( a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . UP ) this . moveHighlightBy _ ( 0 , - 1 ) , b = ! 0 ; else if ( a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . DOWN ) this . moveHighlightBy _ ( 0 , 1 ) , b = ! 0 ; else if ( a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . LEFT ) this . moveHighlightBy _ ( - 1 , 0 ) , b = ! 0 ; else if ( a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . RIGHT ) this . moveHighlightBy _ ( 1 , 0 ) , b = ! 0 ;
else if ( a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . ENTER ) { if ( b = this . getHighlighted _ ( ) ) b = b && b . label , null !== b && this . setValue ( b ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . hideWithoutAnimation ( ) ; b = ! 0 } b && a . stopPropagation ( ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . moveHighlightBy _ = function ( a , b ) { var c = this . colours _ || module$exports$Blockly$FieldColour . FieldColour . COLOURS , d = this . columns _ || module$exports$Blockly$FieldColour . FieldColour . COLUMNS , e = this . highlightedIndex _ % d , f = Math . floor ( this . highlightedIndex _ / d ) ; e += a ; f += b ; 0 > a ? 0 > e && 0 < f ? ( e = d - 1 , f -- ) : 0 > e && ( e = 0 ) : 0 < a ? e > d - 1 && f < Math . floor ( c . length / d ) - 1 ? ( e = 0 , f ++ ) : e > d - 1 && e -- : 0 > b ? 0 > f && ( f = 0 ) : 0 < b && f > Math . floor ( c . length / d ) - 1 && ( f = Math . floor ( c . length / d ) - 1 ) ; this . setHighlightedCell _ ( this . picker _ . childNodes [ f ] . childNodes [ e ] ,
f * d + e ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . onMouseMove _ = function ( a ) { var b = ( a = a . target ) && Number ( a . getAttribute ( "data-index" ) ) ; null !== b && b !== this . highlightedIndex _ && this . setHighlightedCell _ ( a , b ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . onMouseEnter _ = function ( ) { this . picker _ . focus ( { preventScroll : ! 0 } ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . onMouseLeave _ = function ( ) { this . picker _ . blur ( ) ; var a = this . getHighlighted _ ( ) ; a && ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a , "blocklyColourHighlighted" ) } ; module$exports$Blockly$FieldColour . FieldColour . prototype . getHighlighted _ = function ( ) { var a = this . columns _ || module$exports$Blockly$FieldColour . FieldColour . COLUMNS , b = this . picker _ . childNodes [ Math . floor ( this . highlightedIndex _ / a ) ] ; return b ? b . childNodes [ this . highlightedIndex _ % a ] : null } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . setHighlightedCell _ = function ( a , b ) { var c = this . getHighlighted _ ( ) ; c && ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( c , "blocklyColourHighlighted" ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a , "blocklyColourHighlighted" ) ; this . highlightedIndex _ = b ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( this . picker _ , module$exports$Blockly$utils$aria . State . ACTIVEDESCENDANT , a . getAttribute ( "id" ) ) } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . dropdownCreate _ = function ( ) { var a = this . columns _ || module$exports$Blockly$FieldColour . FieldColour . COLUMNS , b = this . colours _ || module$exports$Blockly$FieldColour . FieldColour . COLOURS , c = this . titles _ || module$exports$Blockly$FieldColour . FieldColour . TITLES , d = this . getValue ( ) , e = document . createElement ( "table" ) ; e . className = "blocklyColourTable" ; e . tabIndex = 0 ; e . dir = "ltr" ; ( 0 , module$exports$Blockly$utils$aria . setRole ) ( e , module$exports$Blockly$utils$aria . Role . GRID ) ;
( 0 , module$exports$Blockly$utils$aria . setState ) ( e , module$exports$Blockly$utils$aria . State . EXPANDED , ! 0 ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( e , module$exports$Blockly$utils$aria . State . ROWCOUNT , Math . floor ( b . length / a ) ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( e , module$exports$Blockly$utils$aria . State . COLCOUNT , a ) ; for ( var f , g = 0 ; g < b . length ; g ++ ) { 0 === g % a && ( f = document . createElement ( "tr" ) , ( 0 , module$exports$Blockly$utils$aria . setRole ) ( f , module$exports$Blockly$utils$aria . Role . ROW ) , e . appendChild ( f ) ) ;
var h = document . createElement ( "td" ) ; f . appendChild ( h ) ; h . label = b [ g ] ; h . title = c [ g ] || b [ g ] ; h . id = ( 0 , module$exports$Blockly$utils$idGenerator . getNextUniqueId ) ( ) ; h . setAttribute ( "data-index" , g ) ; ( 0 , module$exports$Blockly$utils$aria . setRole ) ( h , module$exports$Blockly$utils$aria . Role . GRIDCELL ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( h , module$exports$Blockly$utils$aria . State . LABEL , b [ g ] ) ; ( 0 , module$exports$Blockly$utils$aria . setState ) ( h , module$exports$Blockly$utils$aria . State . SELECTED , b [ g ] === d ) ; h . style . backgroundColor =
b [ g ] ; b [ g ] === d && ( h . className = "blocklyColourSelected" , this . highlightedIndex _ = g ) } this . onClickWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( e , "click" , this , this . onClick _ , ! 0 ) ; this . onMouseMoveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( e , "mousemove" , this , this . onMouseMove _ , ! 0 ) ; this . onMouseEnterWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( e , "mouseenter" , this , this . onMouseEnter _ , ! 0 ) ; this . onMouseLeaveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( e ,
"mouseleave" , this , this . onMouseLeave _ , ! 0 ) ; this . onKeyDownWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( e , "keydown" , this , this . onKeyDown _ ) ; this . picker _ = e } ;
module$exports$Blockly$FieldColour . FieldColour . prototype . dropdownDispose _ = function ( ) { this . onClickWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onClickWrapper _ ) , this . onClickWrapper _ = null ) ; this . onMouseMoveWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseMoveWrapper _ ) , this . onMouseMoveWrapper _ = null ) ; this . onMouseEnterWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseEnterWrapper _ ) , this . onMouseEnterWrapper _ = null ) ; this . onMouseLeaveWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseLeaveWrapper _ ) ,
this . onMouseLeaveWrapper _ = null ) ; this . onKeyDownWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onKeyDownWrapper _ ) , this . onKeyDownWrapper _ = null ) ; this . highlightedIndex _ = this . picker _ = null } ; ( 0 , module$exports$Blockly$Css . register ) ( "\n .blocklyColourTable {\n border-collapse: collapse;\n display: block;\n outline: none;\n padding: 1px;\n }\n\n .blocklyColourTable>tr>td {\n border: .5px solid #888;\n box-sizing: border-box;\n cursor: pointer;\n display: inline-block;\n height: 20px;\n padding: 0;\n width: 20px;\n }\n\n .blocklyColourTable>tr>td.blocklyColourHighlighted {\n border-color: #eee;\n box-shadow: 2px 2px 7px 2px rgba(0,0,0,.3);\n position: relative;\n }\n\n .blocklyColourSelected, .blocklyColourSelected:hover {\n border-color: #eee !important;\n outline: 1px solid #333;\n position: relative;\n }\n" ) ;
( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_colour" , module$exports$Blockly$FieldColour . FieldColour ) ; $ . module$exports$Blockly$FieldCheckbox = { FieldCheckbox : function ( a , b , c ) { this . checkChar _ = null ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . superClass _ . constructor . call ( this , a , b , c ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox , module$exports$Blockly$Field . Field ) ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . DEFAULT _VALUE = ! 1 ;
$ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . fromJson = function ( a ) { return new this ( a . checked , void 0 , a ) } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . CHECK _CHAR = "\u2713" ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . SERIALIZABLE = ! 0 ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . CURSOR = "default" ;
$ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . configure _ = function ( a ) { $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . superClass _ . configure _ . call ( this , a ) ; a . checkCharacter && ( this . checkChar _ = a . checkCharacter ) } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . saveState = function ( ) { var a = this . saveLegacyState ( $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox ) ; return null !== a ? a : this . getValueBoolean ( ) } ;
$ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . initView = function ( ) { $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . superClass _ . initView . call ( this ) ; ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . textElement _ , "blocklyCheckbox" ) ; this . textElement _ . style . display = this . value _ ? "block" : "none" } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . render _ = function ( ) { this . textContent _ && ( this . textContent _ . nodeValue = this . getDisplayText _ ( ) ) ; this . updateSize _ ( this . getConstants ( ) . FIELD _CHECKBOX _X _OFFSET ) } ;
$ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . getDisplayText _ = function ( ) { return this . checkChar _ || $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . CHECK _CHAR } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . setCheckCharacter = function ( a ) { this . checkChar _ = a ; this . forceRerender ( ) } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . showEditor _ = function ( ) { this . setValue ( ! this . value _ ) } ;
$ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . doClassValidation _ = function ( a ) { return ! 0 === a || "TRUE" === a ? "TRUE" : ! 1 === a || "FALSE" === a ? "FALSE" : null } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . doValueUpdate _ = function ( a ) { this . value _ = this . convertValueToBool _ ( a ) ; this . textElement _ && ( this . textElement _ . style . display = this . value _ ? "block" : "none" ) } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . getValue = function ( ) { return this . value _ ? "TRUE" : "FALSE" } ;
$ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . getValueBoolean = function ( ) { return this . value _ } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . getText = function ( ) { return String ( this . convertValueToBool _ ( this . value _ ) ) } ; $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox . prototype . convertValueToBool _ = function ( a ) { return "string" === typeof a ? "TRUE" === a : ! ! a } ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_checkbox" , $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox ) ; var module$exports$Blockly$FieldAngle = { FieldAngle : function ( a , b , c ) { this . clockwise _ = module$exports$Blockly$FieldAngle . FieldAngle . CLOCKWISE ; this . offset _ = module$exports$Blockly$FieldAngle . FieldAngle . OFFSET ; this . wrap _ = module$exports$Blockly$FieldAngle . FieldAngle . WRAP ; this . round _ = module$exports$Blockly$FieldAngle . FieldAngle . ROUND ; module$exports$Blockly$FieldAngle . FieldAngle . superClass _ . constructor . call ( this , a , b , c ) ; this . moveSurfaceWrapper _ = this . clickSurfaceWrapper _ = this . clickWrapper _ = this . line _ = this . gauge _ =
this . editor _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$FieldAngle . FieldAngle , $ . module$exports$Blockly$FieldTextInput . FieldTextInput ) ; module$exports$Blockly$FieldAngle . FieldAngle . prototype . DEFAULT _VALUE = 0 ; module$exports$Blockly$FieldAngle . FieldAngle . fromJson = function ( a ) { return new this ( a . angle , void 0 , a ) } ; module$exports$Blockly$FieldAngle . FieldAngle . prototype . SERIALIZABLE = ! 0 ; module$exports$Blockly$FieldAngle . FieldAngle . ROUND = 15 ;
module$exports$Blockly$FieldAngle . FieldAngle . HALF = 50 ; module$exports$Blockly$FieldAngle . FieldAngle . CLOCKWISE = ! 1 ; module$exports$Blockly$FieldAngle . FieldAngle . OFFSET = 0 ; module$exports$Blockly$FieldAngle . FieldAngle . WRAP = 360 ; module$exports$Blockly$FieldAngle . FieldAngle . RADIUS = module$exports$Blockly$FieldAngle . FieldAngle . HALF - 1 ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . configure _ = function ( a ) { module$exports$Blockly$FieldAngle . FieldAngle . superClass _ . configure _ . call ( this , a ) ; switch ( a . mode ) { case "compass" : this . clockwise _ = ! 0 ; this . offset _ = 90 ; break ; case "protractor" : this . clockwise _ = ! 1 , this . offset _ = 0 } var b = a . clockwise ; "boolean" === typeof b && ( this . clockwise _ = b ) ; b = a . offset ; null !== b && ( b = Number ( b ) , isNaN ( b ) || ( this . offset _ = b ) ) ; b = a . wrap ; null !== b && ( b = Number ( b ) , isNaN ( b ) || ( this . wrap _ = b ) ) ; a = a . round ; null !== a && ( a = Number ( a ) , isNaN ( a ) ||
( this . round _ = a ) ) } ; module$exports$Blockly$FieldAngle . FieldAngle . prototype . initView = function ( ) { module$exports$Blockly$FieldAngle . FieldAngle . superClass _ . initView . call ( this ) ; this . symbol _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TSPAN , { } , null ) ; this . symbol _ . appendChild ( document . createTextNode ( "\u00b0" ) ) ; this . textElement _ . appendChild ( this . symbol _ ) } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . render _ = function ( ) { module$exports$Blockly$FieldAngle . FieldAngle . superClass _ . render _ . call ( this ) ; this . updateGraph _ ( ) } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . showEditor _ = function ( a ) { module$exports$Blockly$FieldAngle . FieldAngle . superClass _ . showEditor _ . call ( this , a , module$exports$Blockly$utils$userAgent . MOBILE || module$exports$Blockly$utils$userAgent . ANDROID || module$exports$Blockly$utils$userAgent . IPAD ) ; this . dropdownCreate _ ( ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . getContentDiv ( ) . appendChild ( this . editor _ ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . setColour ( this . sourceBlock _ . style . colourPrimary ,
this . sourceBlock _ . style . colourTertiary ) ; module$exports$Blockly$DropDownDiv . DropDownDiv . showPositionedByField ( this , this . dropdownDispose _ . bind ( this ) ) ; this . updateGraph _ ( ) } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . dropdownCreate _ = function ( ) { var a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . SVG , { xmlns : module$exports$Blockly$utils$dom . SVG _NS , "xmlns:html" : module$exports$Blockly$utils$dom . HTML _NS , "xmlns:xlink" : module$exports$Blockly$utils$dom . XLINK _NS , version : "1.1" , height : 2 * module$exports$Blockly$FieldAngle . FieldAngle . HALF + "px" , width : 2 * module$exports$Blockly$FieldAngle . FieldAngle . HALF + "px" , style : "touch-action: none" } ,
null ) , b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { cx : module$exports$Blockly$FieldAngle . FieldAngle . HALF , cy : module$exports$Blockly$FieldAngle . FieldAngle . HALF , r : module$exports$Blockly$FieldAngle . FieldAngle . RADIUS , "class" : "blocklyAngleCircle" } , a ) ; this . gauge _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyAngleGauge" } , a ) ; this . line _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE ,
{ x1 : module$exports$Blockly$FieldAngle . FieldAngle . HALF , y1 : module$exports$Blockly$FieldAngle . FieldAngle . HALF , "class" : "blocklyAngleLine" } , a ) ; for ( var c = 0 ; 360 > c ; c += 15 ) ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { x1 : module$exports$Blockly$FieldAngle . FieldAngle . HALF + module$exports$Blockly$FieldAngle . FieldAngle . RADIUS , y1 : module$exports$Blockly$FieldAngle . FieldAngle . HALF , x2 : module$exports$Blockly$FieldAngle . FieldAngle . HALF + module$exports$Blockly$FieldAngle . FieldAngle . RADIUS -
( 0 === c % 45 ? 10 : 5 ) , y2 : module$exports$Blockly$FieldAngle . FieldAngle . HALF , "class" : "blocklyAngleMarks" , transform : "rotate(" + c + "," + module$exports$Blockly$FieldAngle . FieldAngle . HALF + "," + module$exports$Blockly$FieldAngle . FieldAngle . HALF + ")" } , a ) ; this . clickWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , "click" , this , this . hide _ ) ; this . clickSurfaceWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "click" , this , this . onMouseMove _ , ! 0 , ! 0 ) ; this . moveSurfaceWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b ,
"mousemove" , this , this . onMouseMove _ , ! 0 , ! 0 ) ; this . editor _ = a } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . dropdownDispose _ = function ( ) { this . clickWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . clickWrapper _ ) , this . clickWrapper _ = null ) ; this . clickSurfaceWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . clickSurfaceWrapper _ ) , this . clickSurfaceWrapper _ = null ) ; this . moveSurfaceWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . moveSurfaceWrapper _ ) , this . moveSurfaceWrapper _ = null ) ; this . line _ = this . gauge _ = null } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . hide _ = function ( ) { module$exports$Blockly$DropDownDiv . DropDownDiv . hideIfOwner ( this ) ; ( 0 , module$exports$Blockly$WidgetDiv . hide ) ( ) } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . onMouseMove _ = function ( a ) { var b = this . gauge _ . ownerSVGElement . getBoundingClientRect ( ) , c = a . clientX - b . left - module$exports$Blockly$FieldAngle . FieldAngle . HALF ; a = a . clientY - b . top - module$exports$Blockly$FieldAngle . FieldAngle . HALF ; b = Math . atan ( - a / c ) ; isNaN ( b ) || ( b = ( 0 , module$exports$Blockly$utils$math . toDegrees ) ( b ) , 0 > c ? b += 180 : 0 < a && ( b += 360 ) , b = this . clockwise _ ? this . offset _ + 360 - b : 360 - ( this . offset _ - b ) , this . displayMouseOrKeyboardValue _ ( b ) ) } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . displayMouseOrKeyboardValue _ = function ( a ) { this . round _ && ( a = Math . round ( a / this . round _ ) * this . round _ ) ; a = this . wrapValue _ ( a ) ; a !== this . value _ && this . setEditorValue _ ( a ) } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . updateGraph _ = function ( ) { if ( this . gauge _ ) { var a = Number ( this . getText ( ) ) + this . offset _ , b = ( 0 , module$exports$Blockly$utils$math . toRadians ) ( a % 360 ) ; a = [ "M " , module$exports$Blockly$FieldAngle . FieldAngle . HALF , "," , module$exports$Blockly$FieldAngle . FieldAngle . HALF ] ; var c = module$exports$Blockly$FieldAngle . FieldAngle . HALF , d = module$exports$Blockly$FieldAngle . FieldAngle . HALF ; if ( ! isNaN ( b ) ) { var e = Number ( this . clockwise _ ) , f = ( 0 , module$exports$Blockly$utils$math . toRadians ) ( this . offset _ ) ,
g = Math . cos ( f ) * module$exports$Blockly$FieldAngle . FieldAngle . RADIUS , h = Math . sin ( f ) * - module$exports$Blockly$FieldAngle . FieldAngle . RADIUS ; e && ( b = 2 * f - b ) ; c += Math . cos ( b ) * module$exports$Blockly$FieldAngle . FieldAngle . RADIUS ; d -= Math . sin ( b ) * module$exports$Blockly$FieldAngle . FieldAngle . RADIUS ; b = Math . abs ( Math . floor ( ( b - f ) / Math . PI ) % 2 ) ; e && ( b = 1 - b ) ; a . push ( " l " , g , "," , h , " A " , module$exports$Blockly$FieldAngle . FieldAngle . RADIUS , "," , module$exports$Blockly$FieldAngle . FieldAngle . RADIUS , " 0 " , b , " " , e , " " , c , "," , d , " z" ) } this . gauge _ . setAttribute ( "d" ,
a . join ( "" ) ) ; this . line _ . setAttribute ( "x2" , c ) ; this . line _ . setAttribute ( "y2" , d ) } } ;
module$exports$Blockly$FieldAngle . FieldAngle . prototype . onHtmlInputKeyDown _ = function ( a ) { module$exports$Blockly$FieldAngle . FieldAngle . superClass _ . onHtmlInputKeyDown _ . call ( this , a ) ; var b ; a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . LEFT ? b = this . sourceBlock _ . RTL ? 1 : - 1 : a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . RIGHT ? b = this . sourceBlock _ . RTL ? - 1 : 1 : a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . DOWN ? b = - 1 : a . keyCode === module$exports$Blockly$utils$KeyCodes . KeyCodes . UP &&
( b = 1 ) ; if ( b ) { var c = this . getValue ( ) ; this . displayMouseOrKeyboardValue _ ( c + b * this . round _ ) ; a . preventDefault ( ) ; a . stopPropagation ( ) } } ; module$exports$Blockly$FieldAngle . FieldAngle . prototype . doClassValidation _ = function ( a ) { a = Number ( a ) ; return isNaN ( a ) || ! isFinite ( a ) ? null : this . wrapValue _ ( a ) } ; module$exports$Blockly$FieldAngle . FieldAngle . prototype . wrapValue _ = function ( a ) { a %= 360 ; 0 > a && ( a += 360 ) ; a > this . wrap _ && ( a -= 360 ) ; return a } ; ( 0 , module$exports$Blockly$Css . register ) ( "\n .blocklyAngleCircle {\n stroke: #444;\n stroke-width: 1;\n fill: #ddd;\n fill-opacity: .8;\n }\n\n .blocklyAngleMarks {\n stroke: #444;\n stroke-width: 1;\n }\n\n .blocklyAngleGauge {\n fill: #f88;\n fill-opacity: .8;\n pointer-events: none;\n }\n\n .blocklyAngleLine {\n stroke: #f00;\n stroke-width: 2;\n stroke-linecap: round;\n pointer-events: none;\n }\n" ) ;
( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_angle" , module$exports$Blockly$FieldAngle . FieldAngle ) ; var module$exports$Blockly$zelos$TopRow = { TopRow : function ( a ) { module$exports$Blockly$zelos$TopRow . TopRow . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$TopRow . TopRow , module$exports$Blockly$blockRendering$TopRow . TopRow ) ; module$exports$Blockly$zelos$TopRow . TopRow . prototype . endsWithElemSpacer = function ( ) { return ! 1 } ;
module$exports$Blockly$zelos$TopRow . TopRow . prototype . hasLeftSquareCorner = function ( a ) { var b = ( a . hat ? "cap" === a . hat : this . constants _ . ADD _START _HATS ) && ! a . outputConnection && ! a . previousConnection ; return ! ! a . outputConnection || b } ; module$exports$Blockly$zelos$TopRow . TopRow . prototype . hasRightSquareCorner = function ( a ) { return ! ! a . outputConnection && ! a . statementInputCount && ! a . nextConnection } ; var module$exports$Blockly$zelos$StatementInput = { StatementInput : function ( a , b ) { module$exports$Blockly$zelos$StatementInput . StatementInput . superClass _ . constructor . call ( this , a , b ) ; if ( this . connectedBlock ) { for ( a = this . connectedBlock ; b = a . getNextBlock ( ) ; ) a = b ; a . nextConnection || ( this . height = this . connectedBlockHeight , this . connectedBottomNextConnection = ! 0 ) } } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$StatementInput . StatementInput , module$exports$Blockly$blockRendering$StatementInput . StatementInput ) ; var module$exports$Blockly$zelos$RightConnectionShape = { RightConnectionShape : function ( a ) { module$exports$Blockly$zelos$RightConnectionShape . RightConnectionShape . superClass _ . constructor . call ( this , a ) ; this . type |= module$exports$Blockly$blockRendering$Types . Types . getType ( "RIGHT_CONNECTION" ) ; this . width = this . height = 0 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$RightConnectionShape . RightConnectionShape , module$exports$Blockly$blockRendering$Measurable . Measurable ) ; var module$exports$Blockly$zelos$MarkerSvg = { MarkerSvg : function ( a , b , c ) { module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . superClass _ . constructor . call ( this , a , b , c ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$MarkerSvg . MarkerSvg , module$exports$Blockly$blockRendering$MarkerSvg . MarkerSvg ) ;
module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . showWithInputOutput _ = function ( a ) { var b = a . getSourceBlock ( ) ; a = a . getLocation ( ) . getOffsetInBlock ( ) ; this . positionCircle _ ( a . x , a . y ) ; this . setParent _ ( b ) ; this . showCurrent _ ( ) } ; module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . showWithOutput _ = function ( a ) { this . showWithInputOutput _ ( a ) } ; module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . showWithInput _ = function ( a ) { this . showWithInputOutput _ ( a ) } ;
module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . showWithBlock _ = function ( a ) { a = a . getLocation ( ) ; var b = a . getHeightWidth ( ) ; this . positionRect _ ( 0 , 0 , b . width , b . height ) ; this . setParent _ ( a ) ; this . showCurrent _ ( ) } ; module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . positionCircle _ = function ( a , b ) { this . markerCircle _ . setAttribute ( "cx" , a ) ; this . markerCircle _ . setAttribute ( "cy" , b ) ; this . currentMarkerSvg = this . markerCircle _ } ;
module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . hide = function ( ) { module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . superClass _ . hide . call ( this ) ; this . markerCircle _ . style . display = "none" } ;
module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . createDomInternal _ = function ( ) { module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . superClass _ . createDomInternal _ . call ( this ) ; this . markerCircle _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { r : this . constants _ . CURSOR _RADIUS , style : "display: none" , "stroke-width" : this . constants _ . CURSOR _STROKE _WIDTH } , this . markerSvg _ ) ; if ( this . isCursor ( ) ) { var a = this . getBlinkProperties _ ( ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . ANIMATE ,
a , this . markerCircle _ ) } return this . markerSvg _ } ; module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . prototype . applyColour _ = function ( a ) { module$exports$Blockly$zelos$MarkerSvg . MarkerSvg . superClass _ . applyColour _ . call ( this , a ) ; this . markerCircle _ . setAttribute ( "fill" , this . colour _ ) ; this . markerCircle _ . setAttribute ( "stroke" , this . colour _ ) ; this . isCursor ( ) && this . markerCircle _ . firstChild . setAttribute ( "values" , this . colour _ + ";transparent;transparent;" ) } ; var module$exports$Blockly$zelos$ConstantProvider = { ConstantProvider : function ( ) { module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . superClass _ . constructor . call ( this ) ; this . SMALL _PADDING = this . GRID _UNIT = 4 ; this . MEDIUM _PADDING = 2 * this . GRID _UNIT ; this . MEDIUM _LARGE _PADDING = 3 * this . GRID _UNIT ; this . LARGE _PADDING = 4 * this . GRID _UNIT ; this . CORNER _RADIUS = 1 * this . GRID _UNIT ; this . NOTCH _WIDTH = 9 * this . GRID _UNIT ; this . NOTCH _HEIGHT = 2 * this . GRID _UNIT ; this . STATEMENT _INPUT _NOTCH _OFFSET = this . NOTCH _OFFSET _LEFT = 3 * this . GRID _UNIT ;
this . MIN _BLOCK _WIDTH = 2 * this . GRID _UNIT ; this . MIN _BLOCK _HEIGHT = 12 * this . GRID _UNIT ; this . EMPTY _STATEMENT _INPUT _HEIGHT = 6 * this . GRID _UNIT ; this . TAB _OFFSET _FROM _TOP = 0 ; this . TOP _ROW _MIN _HEIGHT = this . CORNER _RADIUS ; this . TOP _ROW _PRECEDES _STATEMENT _MIN _HEIGHT = this . LARGE _PADDING ; this . BOTTOM _ROW _MIN _HEIGHT = this . CORNER _RADIUS ; this . BOTTOM _ROW _AFTER _STATEMENT _MIN _HEIGHT = 6 * this . GRID _UNIT ; this . STATEMENT _BOTTOM _SPACER = - this . NOTCH _HEIGHT ; this . STATEMENT _INPUT _SPACER _MIN _WIDTH = 40 * this . GRID _UNIT ; this . STATEMENT _INPUT _PADDING _LEFT =
4 * this . GRID _UNIT ; this . EMPTY _INLINE _INPUT _PADDING = 4 * this . GRID _UNIT ; this . EMPTY _INLINE _INPUT _HEIGHT = 8 * this . GRID _UNIT ; this . DUMMY _INPUT _MIN _HEIGHT = 8 * this . GRID _UNIT ; this . DUMMY _INPUT _SHADOW _MIN _HEIGHT = 6 * this . GRID _UNIT ; this . CURSOR _WS _WIDTH = 20 * this . GRID _UNIT ; this . CURSOR _COLOUR = "#ffa200" ; this . CURSOR _RADIUS = 5 ; this . JAGGED _TEETH _WIDTH = this . JAGGED _TEETH _HEIGHT = 0 ; this . START _HAT _HEIGHT = 22 ; this . START _HAT _WIDTH = 96 ; this . SHAPES = { HEXAGONAL : 1 , ROUND : 2 , SQUARE : 3 , PUZZLE : 4 , NOTCH : 5 } ; this . SHAPE _IN _SHAPE _PADDING = { 1 : { 0 : 5 * this . GRID _UNIT ,
1 : 2 * this . GRID _UNIT , 2 : 5 * this . GRID _UNIT , 3 : 5 * this . GRID _UNIT } , 2 : { 0 : 3 * this . GRID _UNIT , 1 : 3 * this . GRID _UNIT , 2 : 1 * this . GRID _UNIT , 3 : 2 * this . GRID _UNIT } , 3 : { 0 : 2 * this . GRID _UNIT , 1 : 2 * this . GRID _UNIT , 2 : 2 * this . GRID _UNIT , 3 : 2 * this . GRID _UNIT } } ; this . FULL _BLOCK _FIELDS = ! 0 ; this . FIELD _TEXT _FONTSIZE = 3 * this . GRID _UNIT ; this . FIELD _TEXT _FONTWEIGHT = "bold" ; this . FIELD _TEXT _FONTFAMILY = '"Helvetica Neue", "Segoe UI", Helvetica, sans-serif' ; this . FIELD _BORDER _RECT _RADIUS = this . CORNER _RADIUS ; this . FIELD _BORDER _RECT _X _PADDING = 2 * this . GRID _UNIT ;
this . FIELD _BORDER _RECT _Y _PADDING = 1.625 * this . GRID _UNIT ; this . FIELD _BORDER _RECT _HEIGHT = 8 * this . GRID _UNIT ; this . FIELD _DROPDOWN _BORDER _RECT _HEIGHT = 8 * this . GRID _UNIT ; this . FIELD _DROPDOWN _SVG _ARROW = this . FIELD _DROPDOWN _COLOURED _DIV = this . FIELD _DROPDOWN _NO _BORDER _RECT _SHADOW = ! 0 ; this . FIELD _DROPDOWN _SVG _ARROW _PADDING = this . FIELD _BORDER _RECT _X _PADDING ; this . FIELD _COLOUR _FULL _BLOCK = this . FIELD _TEXTINPUT _BOX _SHADOW = ! 0 ; this . FIELD _COLOUR _DEFAULT _WIDTH = 2 * this . GRID _UNIT ; this . FIELD _COLOUR _DEFAULT _HEIGHT = 4 * this . GRID _UNIT ; this . FIELD _CHECKBOX _X _OFFSET =
1 * this . GRID _UNIT ; this . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH = 12 * this . GRID _UNIT ; this . SELECTED _GLOW _COLOUR = "#fff200" ; this . SELECTED _GLOW _SIZE = . 5 ; this . REPLACEMENT _GLOW _COLOUR = "#fff200" ; this . REPLACEMENT _GLOW _SIZE = 2 ; this . selectedGlowFilterId = "" ; this . selectedGlowFilter _ = null ; this . replacementGlowFilterId = "" ; this . replacementGlowFilter _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$ConstantProvider . ConstantProvider , module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider ) ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . setFontConstants _ = function ( a ) { module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . superClass _ . setFontConstants _ . call ( this , a ) ; this . FIELD _DROPDOWN _BORDER _RECT _HEIGHT = this . FIELD _BORDER _RECT _HEIGHT = this . FIELD _TEXT _HEIGHT + 2 * this . FIELD _BORDER _RECT _Y _PADDING } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . init = function ( ) { module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . superClass _ . init . call ( this ) ; this . HEXAGONAL = this . makeHexagonal ( ) ; this . ROUNDED = this . makeRounded ( ) ; this . SQUARED = this . makeSquared ( ) ; this . STATEMENT _INPUT _NOTCH _OFFSET = this . NOTCH _OFFSET _LEFT + this . INSIDE _CORNERS . rightWidth } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . setDynamicProperties _ = function ( a ) { module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . superClass _ . setDynamicProperties _ . call ( this , a ) ; this . SELECTED _GLOW _COLOUR = a . getComponentStyle ( "selectedGlowColour" ) || this . SELECTED _GLOW _COLOUR ; var b = Number ( a . getComponentStyle ( "selectedGlowSize" ) ) ; this . SELECTED _GLOW _SIZE = b && ! isNaN ( b ) ? b : this . SELECTED _GLOW _SIZE ; this . REPLACEMENT _GLOW _COLOUR = a . getComponentStyle ( "replacementGlowColour" ) ||
this . REPLACEMENT _GLOW _COLOUR ; this . REPLACEMENT _GLOW _SIZE = ( a = Number ( a . getComponentStyle ( "replacementGlowSize" ) ) ) && ! isNaN ( a ) ? a : this . REPLACEMENT _GLOW _SIZE } ; module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . dispose = function ( ) { module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . superClass _ . dispose . call ( this ) ; this . selectedGlowFilter _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . selectedGlowFilter _ ) ; this . replacementGlowFilter _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . replacementGlowFilter _ ) } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . makeStartHat = function ( ) { var a = this . START _HAT _HEIGHT , b = this . START _HAT _WIDTH , c = ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 25 , - a ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 71 , - a ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( b , 0 ) ] ) ; return { height : a , width : b , path : c } } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . makeHexagonal = function ( ) { function a ( c , d , e ) { var f = c / 2 ; f = f > b ? b : f ; e = e ? - 1 : 1 ; c = ( d ? - 1 : 1 ) * c / 2 ; return ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( - e * f , c ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( e * f , c ) } var b = this . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH ; return { type : this . SHAPES . HEXAGONAL , isDynamic : ! 0 , width : function ( c ) { c /= 2 ; return c > b ? b : c } , height : function ( c ) { return c } , connectionOffsetY : function ( c ) { return c / 2 } , connectionOffsetX : function ( c ) { return - c } ,
pathDown : function ( c ) { return a ( c , ! 1 , ! 1 ) } , pathUp : function ( c ) { return a ( c , ! 0 , ! 1 ) } , pathRightDown : function ( c ) { return a ( c , ! 1 , ! 0 ) } , pathRightUp : function ( c ) { return a ( c , ! 1 , ! 0 ) } } } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . makeRounded = function ( ) { function a ( d , e , f ) { var g = d > c ? d - c : 0 ; d = ( d > c ? c : d ) / 2 ; return ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , d , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( ( e ? - 1 : 1 ) * d , ( e ? - 1 : 1 ) * d ) ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , ( f ? 1 : - 1 ) * g ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , d , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( ( e ? 1 : - 1 ) * d , ( e ? - 1 : 1 ) * d ) ) } var b = this . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH ,
c = 2 * b ; return { type : this . SHAPES . ROUND , isDynamic : ! 0 , width : function ( d ) { d /= 2 ; return d > b ? b : d } , height : function ( d ) { return d } , connectionOffsetY : function ( d ) { return d / 2 } , connectionOffsetX : function ( d ) { return - d } , pathDown : function ( d ) { return a ( d , ! 1 , ! 1 ) } , pathUp : function ( d ) { return a ( d , ! 0 , ! 1 ) } , pathRightDown : function ( d ) { return a ( d , ! 1 , ! 0 ) } , pathRightUp : function ( d ) { return a ( d , ! 1 , ! 0 ) } } } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . makeSquared = function ( ) { function a ( c , d , e ) { c -= 2 * b ; return ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( ( d ? - 1 : 1 ) * b , ( d ? - 1 : 1 ) * b ) ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , ( e ? 1 : - 1 ) * c ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( ( d ? 1 : - 1 ) * b , ( d ? - 1 : 1 ) * b ) ) } var b = this . CORNER _RADIUS ; return { type : this . SHAPES . SQUARE ,
isDynamic : ! 0 , width : function ( c ) { return b } , height : function ( c ) { return c } , connectionOffsetY : function ( c ) { return c / 2 } , connectionOffsetX : function ( c ) { return - c } , pathDown : function ( c ) { return a ( c , ! 1 , ! 1 ) } , pathUp : function ( c ) { return a ( c , ! 0 , ! 1 ) } , pathRightDown : function ( c ) { return a ( c , ! 1 , ! 0 ) } , pathRightUp : function ( c ) { return a ( c , ! 1 , ! 0 ) } } } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . shapeFor = function ( a ) { var b = a . getCheck ( ) ; ! b && a . targetConnection && ( b = a . targetConnection . getCheck ( ) ) ; switch ( a . type ) { case $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE : case $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE : a = a . getSourceBlock ( ) . getOutputShape ( ) ; if ( null !== a ) switch ( a ) { case this . SHAPES . HEXAGONAL : return this . HEXAGONAL ; case this . SHAPES . ROUND : return this . ROUNDED ; case this . SHAPES . SQUARE : return this . SQUARED } if ( b &&
- 1 !== b . indexOf ( "Boolean" ) ) return this . HEXAGONAL ; if ( b && - 1 !== b . indexOf ( "Number" ) ) return this . ROUNDED ; b && b . indexOf ( "String" ) ; return this . ROUNDED ; case $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT : case $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT : return this . NOTCH ; default : throw Error ( "Unknown type" ) ; } } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . makeNotch = function ( ) { function a ( l ) { return ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e / 2 , 0 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e * 3 / 4 , g / 2 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e , g ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . line ) ( [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e , f ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l *
e / 4 , g / 2 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e / 2 , g ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e , g ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , l * d ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e / 2 , 0 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e * 3 / 4 , - ( g / 2 ) ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e , - g ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . line ) ( [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l *
e , - f ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e / 4 , - ( g / 2 ) ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e / 2 , - g ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( l * e , - g ) ] ) } var b = this . NOTCH _WIDTH , c = this . NOTCH _HEIGHT , d = b / 3 , e = d / 3 , f = c / 2 , g = f / 2 , h = a ( 1 ) , k = a ( - 1 ) ; return { type : this . SHAPES . NOTCH , width : b , height : c , pathLeft : h , pathRight : k } } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . makeInsideCorners = function ( ) { var a = this . CORNER _RADIUS , b = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - a , a ) ) , c = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - a , a ) ) , d = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a , a ) ) , e = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" ,
"0 0,1" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a , a ) ) ; return { width : a , height : a , pathTop : b , pathBottom : d , rightWidth : a , rightHeight : a , pathTopRight : c , pathBottomRight : e } } ; module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . generateSecondaryColour _ = function ( a ) { return ( 0 , module$exports$Blockly$utils$colour . blend ) ( "#000" , a , . 15 ) || a } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . generateTertiaryColour _ = function ( a ) { return ( 0 , module$exports$Blockly$utils$colour . blend ) ( "#000" , a , . 25 ) || a } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . createDom = function ( a , b , c ) { module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . superClass _ . createDom . call ( this , a , b , c ) ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . DEFS , { } , a ) ; b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FILTER , { id : "blocklySelectedGlowFilter" + this . randomIdentifier , height : "160%" , width : "180%" , y : "-30%" , x : "-40%" } ,
a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEGAUSSIANBLUR , { "in" : "SourceGraphic" , stdDeviation : this . SELECTED _GLOW _SIZE } , b ) ; c = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPONENTTRANSFER , { result : "outBlur" } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEFUNCA , { type : "table" , tableValues : "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" } , c ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEFLOOD ,
{ "flood-color" : this . SELECTED _GLOW _COLOUR , "flood-opacity" : 1 , result : "outColor" } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE , { "in" : "outColor" , in2 : "outBlur" , operator : "in" , result : "outGlow" } , b ) ; this . selectedGlowFilterId = b . id ; this . selectedGlowFilter _ = b ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FILTER , { id : "blocklyReplacementGlowFilter" + this . randomIdentifier , height : "160%" , width : "180%" , y : "-30%" ,
x : "-40%" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEGAUSSIANBLUR , { "in" : "SourceGraphic" , stdDeviation : this . REPLACEMENT _GLOW _SIZE } , a ) ; b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPONENTTRANSFER , { result : "outBlur" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEFUNCA , { type : "table" , tableValues : "0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1" } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FEFLOOD ,
{ "flood-color" : this . REPLACEMENT _GLOW _COLOUR , "flood-opacity" : 1 , result : "outColor" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE , { "in" : "outColor" , in2 : "outBlur" , operator : "in" , result : "outGlow" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FECOMPOSITE , { "in" : "SourceGraphic" , in2 : "outGlow" , operator : "over" } , a ) ; this . replacementGlowFilterId = a . id ; this . replacementGlowFilter _ = a } ;
module$exports$Blockly$zelos$ConstantProvider . ConstantProvider . prototype . getCSS _ = function ( 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 + " .blocklyNonEditableText>rect:not(.blocklyDropdownRect)," , a + " .blocklyEditableText>rect:not(.blocklyDropdownRect) {" , "fill: " + this . FIELD _BORDER _RECT _COLOUR + ";" , "}" , a + " .blocklyNonEditableText>text," , a + " .blocklyEditableText>text," ,
a + " .blocklyNonEditableText>g>text," , a + " .blocklyEditableText>g>text {" , "fill: #575E75;" , "}" , a + " .blocklyFlyoutLabelText {" , "fill: #575E75;" , "}" , a + " .blocklyText.blocklyBubbleText {" , "fill: #575E75;" , "}" , a + " .blocklyDraggable:not(.blocklyDisabled)" , " .blocklyEditableText:not(.editing):hover>rect," , a + " .blocklyDraggable:not(.blocklyDisabled)" , " .blocklyEditableText:not(.editing):hover>.blocklyPath {" , "stroke: #fff;" , "stroke-width: 2;" , "}" , a + " .blocklyHtmlInput {" , "font-family: " + this . FIELD _TEXT _FONTFAMILY +
";" , "font-weight: " + this . FIELD _TEXT _FONTWEIGHT + ";" , "color: #575E75;" , "}" , a + " .blocklyDropdownText {" , "fill: #fff !important;" , "}" , a + ".blocklyWidgetDiv .goog-menuitem," , a + ".blocklyDropDownDiv .goog-menuitem {" , "font-family: " + this . FIELD _TEXT _FONTFAMILY + ";" , "}" , a + ".blocklyDropDownDiv .goog-menuitem-content {" , "color: #fff;" , "}" , a + " .blocklyHighlightedConnectionPath {" , "stroke: " + this . SELECTED _GLOW _COLOUR + ";" , "}" , a + " .blocklyDisabled > .blocklyOutlinePath {" , "fill: url(#blocklyDisabledPattern" + this . randomIdentifier +
")" , "}" , a + " .blocklyInsertionMarker>.blocklyPath {" , "fill-opacity: " + this . INSERTION _MARKER _OPACITY + ";" , "stroke: none;" , "}" ] } ; var module$exports$Blockly$zelos$Drawer = { Drawer : function ( a , b ) { module$exports$Blockly$zelos$Drawer . Drawer . superClass _ . constructor . call ( this , a , b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$Drawer . Drawer , module$exports$Blockly$blockRendering$Drawer . Drawer ) ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . draw = function ( ) { var a = this . block _ . pathObject ; a . beginDrawing ( ) ; this . hideHiddenIcons _ ( ) ; this . drawOutline _ ( ) ; this . drawInternals _ ( ) ; a . setPath ( this . outlinePath _ + "\n" + this . inlinePath _ ) ; this . info _ . RTL && a . flipRTL ( ) ; ( 0 , module$exports$Blockly$blockRendering$debug . isDebuggerEnabled ) ( ) && this . block _ . renderingDebugger . drawDebug ( this . block _ , this . info _ ) ; this . recordSizeOnBlock _ ( ) ; this . info _ . outputConnection && ( a . outputShapeType = this . info _ . outputConnection . shape . type ) ;
a . endDrawing ( ) } ; module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawOutline _ = function ( ) { this . info _ . outputConnection && this . info _ . outputConnection . isDynamicShape && ! this . info _ . hasStatementInput && ! this . info _ . bottomRow . hasNextConnection ? ( this . drawFlatTop _ ( ) , this . drawRightDynamicConnection _ ( ) , this . drawFlatBottom _ ( ) , this . drawLeftDynamicConnection _ ( ) ) : module$exports$Blockly$zelos$Drawer . Drawer . superClass _ . drawOutline _ . call ( this ) } ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawLeft _ = function ( ) { this . info _ . outputConnection && this . info _ . outputConnection . isDynamicShape ? this . drawLeftDynamicConnection _ ( ) : module$exports$Blockly$zelos$Drawer . Drawer . superClass _ . drawLeft _ . call ( this ) } ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawRightSideRow _ = function ( a ) { if ( ! ( 0 >= a . height ) ) if ( a . precedesStatement || a . followsStatement ) { var b = this . constants _ . INSIDE _CORNERS . rightHeight ; b = a . height - ( a . precedesStatement ? b : 0 ) ; this . outlinePath _ += ( a . followsStatement ? this . constants _ . INSIDE _CORNERS . pathBottomRight : "" ) + ( 0 < b ? ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . yPos + b ) : "" ) + ( a . precedesStatement ? this . constants _ . INSIDE _CORNERS . pathTopRight : "" ) } else this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" ,
a . yPos + a . height ) } ; module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawRightDynamicConnection _ = function ( ) { this . outlinePath _ += this . info _ . outputConnection . shape . pathRightDown ( this . info _ . outputConnection . height ) } ; module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawLeftDynamicConnection _ = function ( ) { this . positionOutputConnection _ ( ) ; this . outlinePath _ += this . info _ . outputConnection . shape . pathUp ( this . info _ . outputConnection . height ) ; this . outlinePath _ += "z" } ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawFlatTop _ = function ( ) { var a = this . info _ . topRow ; this . positionPreviousConnection _ ( ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( a . xPos , this . info _ . startY ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , a . width ) } ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawFlatBottom _ = function ( ) { var a = this . info _ . bottomRow ; this . positionNextConnection _ ( ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . baseline ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - a . width ) } ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawInlineInput _ = function ( a ) { this . positionInlineInputConnection _ ( a ) ; var b = a . input . name ; if ( ! a . connectedBlock && ! this . info _ . isInsertionMarker ) { var c = a . width - 2 * a . connectionWidth ; a = ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( a . xPos + a . connectionWidth , a . centerline - a . height / 2 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , c ) + a . shape . pathRightDown ( a . height ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - c ) + a . shape . pathUp ( a . height ) +
"z" ; this . block _ . pathObject . setOutlinePath ( b , a ) } } ;
module$exports$Blockly$zelos$Drawer . Drawer . prototype . drawStatementInput _ = function ( a ) { var b = a . getLastInput ( ) , c = b . xPos + b . notchOffset + b . shape . width , d = b . shape . pathRight + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - ( b . notchOffset - this . constants _ . INSIDE _CORNERS . width ) ) + this . constants _ . INSIDE _CORNERS . pathTop , e = a . height - 2 * this . constants _ . INSIDE _CORNERS . height ; b = this . constants _ . INSIDE _CORNERS . pathBottom + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , b . notchOffset - this . constants _ . INSIDE _CORNERS . width ) +
( b . connectedBottomNextConnection ? "" : b . shape . pathLeft ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , c ) + d + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , e ) + b + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a . xPos + a . width ) ; this . positionStatementInputConnection _ ( a ) } ; var module$exports$Blockly$zelos$PathObject = { PathObject : function ( a , b , c ) { module$exports$Blockly$zelos$PathObject . PathObject . superClass _ . constructor . call ( this , a , b , c ) ; this . constants = c ; this . svgPathSelected _ = null ; this . outlines _ = Object . create ( null ) ; this . outputShapeType = this . remainingOutlines _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$PathObject . PathObject , module$exports$Blockly$blockRendering$PathObject . PathObject ) ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . setPath = function ( a ) { module$exports$Blockly$zelos$PathObject . PathObject . superClass _ . setPath . call ( this , a ) ; this . svgPathSelected _ && this . svgPathSelected _ . setAttribute ( "d" , a ) } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . applyColour = function ( a ) { module$exports$Blockly$zelos$PathObject . PathObject . superClass _ . applyColour . call ( this , a ) ; a . isShadow ( ) && a . getParent ( ) && this . svgPath . setAttribute ( "stroke" , a . getParent ( ) . style . colourTertiary ) ; for ( var b in this . outlines _ ) this . outlines _ [ b ] . setAttribute ( "fill" , this . style . colourTertiary ) } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . flipRTL = function ( ) { module$exports$Blockly$zelos$PathObject . PathObject . superClass _ . flipRTL . call ( this ) ; for ( var a in this . outlines _ ) this . outlines _ [ a ] . setAttribute ( "transform" , "scale(-1 1)" ) } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . updateSelected = function ( a ) { this . setClass _ ( "blocklySelected" , a ) ; a ? this . svgPathSelected _ || ( this . svgPathSelected _ = this . svgPath . cloneNode ( ! 0 ) , this . svgPathSelected _ . setAttribute ( "fill" , "none" ) , this . svgPathSelected _ . setAttribute ( "filter" , "url(#" + this . constants . selectedGlowFilterId + ")" ) , this . svgRoot . appendChild ( this . svgPathSelected _ ) ) : this . svgPathSelected _ && ( this . svgRoot . removeChild ( this . svgPathSelected _ ) , this . svgPathSelected _ = null ) } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . updateReplacementFade = function ( a ) { this . setClass _ ( "blocklyReplaceable" , a ) ; a ? this . svgPath . setAttribute ( "filter" , "url(#" + this . constants . replacementGlowFilterId + ")" ) : this . svgPath . removeAttribute ( "filter" ) } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . updateShapeForInputHighlight = function ( a , b ) { a = a . getParentInput ( ) . name ; ( a = this . getOutlinePath _ ( a ) ) && ( b ? a . setAttribute ( "filter" , "url(#" + this . constants . replacementGlowFilterId + ")" ) : a . removeAttribute ( "filter" ) ) } ; module$exports$Blockly$zelos$PathObject . PathObject . prototype . beginDrawing = function ( ) { this . remainingOutlines _ = Object . create ( null ) ; for ( var a in this . outlines _ ) this . remainingOutlines _ [ a ] = 1 } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . endDrawing = function ( ) { if ( this . remainingOutlines _ ) for ( var a in this . remainingOutlines _ ) this . removeOutlinePath _ ( a ) ; this . remainingOutlines _ = null } ; module$exports$Blockly$zelos$PathObject . PathObject . prototype . setOutlinePath = function ( a , b ) { a = this . getOutlinePath _ ( a ) ; a . setAttribute ( "d" , b ) ; a . setAttribute ( "fill" , this . style . colourTertiary ) } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . getOutlinePath _ = function ( a ) { this . outlines _ [ a ] || ( this . outlines _ [ a ] = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyOutlinePath" , d : "" } , this . svgRoot ) ) ; this . remainingOutlines _ && delete this . remainingOutlines _ [ a ] ; return this . outlines _ [ a ] } ;
module$exports$Blockly$zelos$PathObject . PathObject . prototype . removeOutlinePath _ = function ( a ) { this . outlines _ [ a ] . parentNode . removeChild ( this . outlines _ [ a ] ) ; delete this . outlines _ [ a ] } ; var module$exports$Blockly$zelos$BottomRow = { BottomRow : function ( a ) { module$exports$Blockly$zelos$BottomRow . BottomRow . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$BottomRow . BottomRow , module$exports$Blockly$blockRendering$BottomRow . BottomRow ) ; module$exports$Blockly$zelos$BottomRow . BottomRow . prototype . endsWithElemSpacer = function ( ) { return ! 1 } ; module$exports$Blockly$zelos$BottomRow . BottomRow . prototype . hasLeftSquareCorner = function ( a ) { return ! ! a . outputConnection } ;
module$exports$Blockly$zelos$BottomRow . BottomRow . prototype . hasRightSquareCorner = function ( a ) { return ! ! a . outputConnection && ! a . statementInputCount && ! a . nextConnection } ; $ . module$exports$Blockly$FieldImage = { FieldImage : function ( a , b , c , d , e , f , g ) { if ( ! a ) throw Error ( "Src value of an image field is required" ) ; a = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a ) ; c = Number ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( c ) ) ; b = Number ( ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( b ) ) ; if ( isNaN ( c ) || isNaN ( b ) ) throw Error ( "Height and width values of an image field must cast to numbers." ) ; if ( 0 >= c || 0 >= b ) throw Error ( "Height and width values of an image field must be greater than 0." ) ;
this . flipRtl _ = ! 1 ; this . altText _ = "" ; $ . module$exports$Blockly$FieldImage . FieldImage . superClass _ . constructor . call ( this , a , null , g ) ; g || ( this . flipRtl _ = ! ! f , this . altText _ = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( d ) || "" ) ; this . size _ = new module$exports$Blockly$utils$Size . Size ( b , c + $ . module$exports$Blockly$FieldImage . FieldImage . Y _PADDING ) ; this . imageHeight _ = c ; this . clickHandler _ = null ; "function" === typeof e && ( this . clickHandler _ = e ) ; this . imageElement _ = null } } ;
( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( $ . module$exports$Blockly$FieldImage . FieldImage , module$exports$Blockly$Field . Field ) ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . DEFAULT _VALUE = "" ; $ . module$exports$Blockly$FieldImage . FieldImage . fromJson = function ( a ) { return new this ( a . src , a . width , a . height , void 0 , void 0 , void 0 , a ) } ; $ . module$exports$Blockly$FieldImage . FieldImage . Y _PADDING = 1 ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . EDITABLE = ! 1 ;
$ . module$exports$Blockly$FieldImage . FieldImage . prototype . isDirty _ = ! 1 ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . configure _ = function ( a ) { $ . module$exports$Blockly$FieldImage . FieldImage . superClass _ . configure _ . call ( this , a ) ; this . flipRtl _ = ! ! a . flipRtl ; this . altText _ = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( a . alt ) || "" } ;
$ . module$exports$Blockly$FieldImage . FieldImage . prototype . initView = function ( ) { this . imageElement _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { height : this . imageHeight _ + "px" , width : this . size _ . width + "px" , alt : this . altText _ } , this . fieldGroup _ ) ; this . imageElement _ . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . value _ ) ; this . clickHandler _ && ( this . imageElement _ . style . cursor = "pointer" ) } ;
$ . module$exports$Blockly$FieldImage . FieldImage . prototype . updateSize _ = function ( ) { } ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . doClassValidation _ = function ( a ) { return "string" !== typeof a ? null : a } ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . doValueUpdate _ = function ( a ) { this . value _ = a ; this . imageElement _ && this . imageElement _ . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , String ( this . value _ ) ) } ;
$ . module$exports$Blockly$FieldImage . FieldImage . prototype . getFlipRtl = function ( ) { return this . flipRtl _ } ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . setAlt = function ( a ) { a !== this . altText _ && ( this . altText _ = a || "" , this . imageElement _ && this . imageElement _ . setAttribute ( "alt" , this . altText _ ) ) } ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . showEditor _ = function ( ) { this . clickHandler _ && this . clickHandler _ ( this ) } ;
$ . module$exports$Blockly$FieldImage . FieldImage . prototype . setOnClickHandler = function ( a ) { this . clickHandler _ = a } ; $ . module$exports$Blockly$FieldImage . FieldImage . prototype . getText _ = function ( ) { return this . altText _ } ; ( 0 , module$exports$Blockly$fieldRegistry . register ) ( "field_image" , $ . module$exports$Blockly$FieldImage . FieldImage ) ; var module$exports$Blockly$zelos$RenderInfo = { RenderInfo : function ( a , b ) { module$exports$Blockly$zelos$RenderInfo . RenderInfo . superClass _ . constructor . call ( this , a , b ) ; this . topRow = new module$exports$Blockly$zelos$TopRow . TopRow ( this . constants _ ) ; this . bottomRow = new module$exports$Blockly$zelos$BottomRow . BottomRow ( this . constants _ ) ; this . isInline = ! 0 ; this . isMultiRow = ! b . getInputsInline ( ) || b . isCollapsed ( ) ; this . hasStatementInput = 0 < b . statementInputCount ; this . rightSide = this . outputConnection ? new module$exports$Blockly$zelos$RightConnectionShape . RightConnectionShape ( this . constants _ ) :
null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$RenderInfo . RenderInfo , module$exports$Blockly$blockRendering$RenderInfo . RenderInfo ) ; module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getRenderer = function ( ) { return this . renderer _ } ; module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . measure = function ( ) { this . createRows _ ( ) ; this . addElemSpacing _ ( ) ; this . addRowSpacing _ ( ) ; this . adjustXPosition _ ( ) ; this . computeBounds _ ( ) ; this . alignRowElements _ ( ) ; this . finalize _ ( ) } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . shouldStartNewRow _ = function ( a , b ) { return b ? a . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT || b . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ? ! 0 : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE || a . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ? ! this . isInline || this . isMultiRow : ! 1 : ! 1 } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getDesiredRowWidth _ = function ( a ) { return a . hasStatement ? this . width - this . startX - ( this . constants _ . INSIDE _CORNERS . rightWidth || 0 ) : module$exports$Blockly$zelos$RenderInfo . RenderInfo . superClass _ . getDesiredRowWidth _ . call ( this , a ) } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getInRowSpacing _ = function ( a , b ) { return a && b || ! this . outputConnection || ! this . outputConnection . isDynamicShape || this . hasStatementInput || this . bottomRow . hasNextConnection ? ! a && b && module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ? this . constants _ . STATEMENT _INPUT _PADDING _LEFT : a && module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a ) && b && ( module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( b ) ||
module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ) ? b . notchOffset - this . constants _ . CORNER _RADIUS : a && module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( a ) && b && module$exports$Blockly$blockRendering$Types . Types . isHat ( b ) ? this . constants _ . NO _PADDING : this . constants _ . MEDIUM _PADDING : this . constants _ . NO _PADDING } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getSpacerRowHeight _ = function ( a , b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) && module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( b ) ) return this . constants _ . EMPTY _BLOCK _SPACER _HEIGHT ; var c = module$exports$Blockly$blockRendering$Types . Types . isInputRow ( a ) && a . hasStatement , d = module$exports$Blockly$blockRendering$Types . Types . isInputRow ( b ) && b . hasStatement ; return d || c ? ( a = Math . max ( this . constants _ . NOTCH _HEIGHT , this . constants _ . INSIDE _CORNERS . rightHeight ||
0 ) , d && c ? Math . max ( a , this . constants _ . DUMMY _INPUT _MIN _HEIGHT ) : a ) : module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) ? a . hasPreviousConnection || this . outputConnection && ! this . hasStatementInput ? this . constants _ . NO _PADDING : Math . abs ( this . constants _ . NOTCH _HEIGHT - this . constants _ . CORNER _RADIUS ) : module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( b ) ? this . outputConnection ? ! b . hasNextConnection && this . hasStatementInput ? Math . abs ( this . constants _ . NOTCH _HEIGHT - this . constants _ . CORNER _RADIUS ) : this . constants _ . NO _PADDING :
Math . max ( this . topRow . minHeight , Math . max ( this . constants _ . NOTCH _HEIGHT , this . constants _ . CORNER _RADIUS ) ) - this . constants _ . CORNER _RADIUS : this . constants _ . MEDIUM _PADDING } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getSpacerRowWidth _ = function ( a , b ) { var c = this . width - this . startX ; return module$exports$Blockly$blockRendering$Types . Types . isInputRow ( a ) && a . hasStatement || module$exports$Blockly$blockRendering$Types . Types . isInputRow ( b ) && b . hasStatement ? Math . max ( c , this . constants _ . STATEMENT _INPUT _SPACER _MIN _WIDTH ) : c } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getElemCenterline _ = function ( a , b ) { if ( a . hasStatement && ! module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) && ! module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ) return a . yPos + this . constants _ . EMPTY _STATEMENT _INPUT _HEIGHT / 2 ; if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) ) { var c = b . connectedBlock ; if ( c && c . outputConnection && c . nextConnection ) return a . yPos + c . height / 2 } return module$exports$Blockly$zelos$RenderInfo . RenderInfo . superClass _ . getElemCenterline _ . call ( this ,
a , b ) } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . addInput _ = function ( a , b ) { if ( a . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY && b . hasDummyInput && b . align === $ . module$exports$Blockly$Input . Align . LEFT && a . align === $ . module$exports$Blockly$Input . Align . RIGHT ) b . rightAlignedDummyInput = a ; else if ( a . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ) { b . elements . push ( new module$exports$Blockly$zelos$StatementInput . StatementInput ( this . constants _ , a ) ) ; b . hasStatement = ! 0 ; null === b . align &&
( b . align = a . align ) ; return } module$exports$Blockly$zelos$RenderInfo . RenderInfo . superClass _ . addInput _ . call ( this , a , b ) } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . addAlignmentPadding _ = function ( a , b ) { if ( a . rightAlignedDummyInput ) { for ( var c , d = 0 ; d < a . elements . length ; d ++ ) { var e = a . elements [ d ] ; module$exports$Blockly$blockRendering$Types . Types . isSpacer ( e ) && ( c = e ) ; if ( module$exports$Blockly$blockRendering$Types . Types . isField ( e ) && e . parentInput === a . rightAlignedDummyInput ) break } if ( c ) { c . width += b ; a . width += b ; return } } module$exports$Blockly$zelos$RenderInfo . RenderInfo . superClass _ . addAlignmentPadding _ . call ( this , a , b ) } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . adjustXPosition _ = function ( ) { for ( var a = this . constants _ . NOTCH _OFFSET _LEFT + this . constants _ . NOTCH _WIDTH , b = a , c = 2 ; c < this . rows . length - 1 ; c += 2 ) { var d = this . rows [ c - 1 ] , e = this . rows [ c ] , f = this . rows [ c + 1 ] ; d = 2 === c ? ! ! this . topRow . hasPreviousConnection : ! ! d . followsStatement ; f = c + 2 >= this . rows . length - 1 ? ! ! this . bottomRow . hasNextConnection : ! ! f . precedesStatement ; if ( module$exports$Blockly$blockRendering$Types . Types . isInputRow ( e ) && e . hasStatement ) e . measure ( ) , b = e . width -
e . getLastInput ( ) . width + a ; else if ( d && ( 2 === c || f ) && module$exports$Blockly$blockRendering$Types . Types . isInputRow ( e ) && ! e . hasStatement ) { f = e . xPos ; d = null ; for ( var g = 0 ; g < e . elements . length ; g ++ ) { var h = e . elements [ g ] ; module$exports$Blockly$blockRendering$Types . Types . isSpacer ( h ) && ( d = h ) ; ! ( d && ( module$exports$Blockly$blockRendering$Types . Types . isField ( h ) || module$exports$Blockly$blockRendering$Types . Types . isInput ( h ) ) && f < b ) || module$exports$Blockly$blockRendering$Types . Types . isField ( h ) && ( h . field instanceof $ . module$exports$Blockly$FieldLabel . FieldLabel ||
h . field instanceof $ . module$exports$Blockly$FieldImage . FieldImage ) || ( d . width += b - f ) ; f += h . width } } } } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . finalizeOutputConnection _ = function ( ) { if ( this . outputConnection && this . outputConnection . isDynamicShape ) { for ( var a = 0 , b = 0 ; b < this . rows . length ; b ++ ) { var c = this . rows [ b ] ; c . yPos = a ; a += c . height } this . height = a ; b = this . bottomRow . hasNextConnection ? this . height - this . bottomRow . descenderHeight : this . height ; a = this . outputConnection . shape . height ( b ) ; b = this . outputConnection . shape . width ( b ) ; this . outputConnection . height = a ; this . outputConnection . width = b ; this . outputConnection . startX =
b ; this . outputConnection . connectionOffsetY = this . outputConnection . shape . connectionOffsetY ( a ) ; this . outputConnection . connectionOffsetX = this . outputConnection . shape . connectionOffsetX ( b ) ; c = 0 ; this . hasStatementInput || this . bottomRow . hasNextConnection || ( c = b , this . rightSide . height = a , this . rightSide . width = c , this . rightSide . centerline = a / 2 , this . rightSide . xPos = this . width + c ) ; this . startX = b ; this . width += b + c ; this . widthWithChildren += b + c } } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . finalizeHorizontalAlignment _ = function ( ) { if ( this . outputConnection && ! this . hasStatementInput && ! this . bottomRow . hasNextConnection ) { for ( var a = 0 , b = 0 ; b < this . rows . length ; b ++ ) { var c = this . rows [ b ] ; if ( module$exports$Blockly$blockRendering$Types . Types . isInputRow ( c ) ) { a = c . elements [ c . elements . length - 2 ] ; var d = this . getNegativeSpacing _ ( c . elements [ 1 ] ) , e = this . getNegativeSpacing _ ( a ) ; a = d + e ; var f = this . constants _ . MIN _BLOCK _WIDTH + 2 * this . outputConnection . width ; this . width -
a < f && ( a = this . width - f , d = a / 2 , e = a / 2 ) ; c . elements . unshift ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , - d ) ) ; c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , - e ) ) } } if ( a ) for ( this . width -= a , this . widthWithChildren -= a , this . rightSide . xPos -= a , b = 0 ; b < this . rows . length ; b ++ ) c = this . rows [ b ] , module$exports$Blockly$blockRendering$Types . Types . isTopOrBottomRow ( c ) && ( c . elements [ 1 ] . width -= a , c . elements [ 1 ] . widthWithConnectedBlocks -= a ) , c . width -=
a , c . widthWithConnectedBlocks -= a } } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . getNegativeSpacing _ = function ( a ) { if ( ! a ) return 0 ; var b = this . outputConnection . width , c = this . outputConnection . shape . type , d = this . constants _ ; if ( this . isMultiRow && 1 < this . inputRows . length ) switch ( c ) { case d . SHAPES . ROUND : return c = this . constants _ . MAX _DYNAMIC _CONNECTION _SHAPE _WIDTH , c = this . height / 2 > c ? c : this . height / 2 , b - c * ( 1 - Math . sin ( Math . acos ( ( c - this . constants _ . SMALL _PADDING ) / c ) ) ) ; default : return 0 } if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( a ) ) { var e = a . connectedBlock ;
a = e ? e . pathObject . outputShapeType : a . shape . type ; return e && e . outputConnection && ( e . statementInputCount || e . nextConnection ) || c === d . SHAPES . HEXAGONAL && c !== a ? 0 : b - this . constants _ . SHAPE _IN _SHAPE _PADDING [ c ] [ a ] } return module$exports$Blockly$blockRendering$Types . Types . isField ( a ) ? c === d . SHAPES . ROUND && a . field instanceof $ . module$exports$Blockly$FieldTextInput . FieldTextInput ? b - 2.75 * d . GRID _UNIT : b - this . constants _ . SHAPE _IN _SHAPE _PADDING [ c ] [ 0 ] : module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) ? this . constants _ . SMALL _PADDING :
0 } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . finalizeVerticalAlignment _ = function ( ) { if ( ! this . outputConnection ) for ( var a = 2 ; a < this . rows . length - 1 ; a += 2 ) { var b = this . rows [ a - 1 ] , c = this . rows [ a ] , d = this . rows [ a + 1 ] , e = 2 === a , f = a + 2 >= this . rows . length - 1 ? ! ! this . bottomRow . hasNextConnection : ! ! d . precedesStatement ; if ( e ? this . topRow . hasPreviousConnection : b . followsStatement ) { var g = 3 === c . elements . length && ( c . elements [ 1 ] . field instanceof $ . module$exports$Blockly$FieldLabel . FieldLabel || c . elements [ 1 ] . field instanceof $ . module$exports$Blockly$FieldImage . FieldImage ) ;
if ( ! e && g ) b . height -= this . constants _ . SMALL _PADDING , d . height -= this . constants _ . SMALL _PADDING , c . height -= this . constants _ . MEDIUM _PADDING ; else if ( ! e && ! f ) b . height += this . constants _ . SMALL _PADDING ; else if ( f ) { e = ! 1 ; for ( f = 0 ; f < c . elements . length ; f ++ ) if ( g = c . elements [ f ] , module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( g ) && g . connectedBlock && ! g . connectedBlock . isShadow ( ) && 40 <= g . connectedBlock . getHeightWidth ( ) . height ) { e = ! 0 ; break } e && ( b . height -= this . constants _ . SMALL _PADDING , d . height -= this . constants _ . SMALL _PADDING ) } } } } ;
module$exports$Blockly$zelos$RenderInfo . RenderInfo . prototype . finalize _ = function ( ) { this . finalizeOutputConnection _ ( ) ; this . finalizeHorizontalAlignment _ ( ) ; this . finalizeVerticalAlignment _ ( ) ; module$exports$Blockly$zelos$RenderInfo . RenderInfo . superClass _ . finalize _ . call ( this ) ; this . rightSide && ( this . widthWithChildren += this . rightSide . width ) } ; var module$exports$Blockly$zelos$Renderer = { Renderer : function ( a ) { module$exports$Blockly$zelos$Renderer . Renderer . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$zelos$Renderer . Renderer , module$exports$Blockly$blockRendering$Renderer . Renderer ) ; module$exports$Blockly$zelos$Renderer . Renderer . prototype . makeConstants _ = function ( ) { return new module$exports$Blockly$zelos$ConstantProvider . ConstantProvider } ;
module$exports$Blockly$zelos$Renderer . Renderer . prototype . makeRenderInfo _ = function ( a ) { return new module$exports$Blockly$zelos$RenderInfo . RenderInfo ( this , a ) } ; module$exports$Blockly$zelos$Renderer . Renderer . prototype . makeDrawer _ = function ( a , b ) { return new module$exports$Blockly$zelos$Drawer . Drawer ( a , b ) } ; module$exports$Blockly$zelos$Renderer . Renderer . prototype . makeMarkerDrawer = function ( a , b ) { return new module$exports$Blockly$zelos$MarkerSvg . MarkerSvg ( a , this . getConstants ( ) , b ) } ;
module$exports$Blockly$zelos$Renderer . Renderer . prototype . makePathObject = function ( a , b ) { return new module$exports$Blockly$zelos$PathObject . PathObject ( a , b , this . getConstants ( ) ) } ; module$exports$Blockly$zelos$Renderer . Renderer . prototype . shouldHighlightConnection = function ( a ) { return a . type !== $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE && a . type !== $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE } ;
module$exports$Blockly$zelos$Renderer . Renderer . prototype . getConnectionPreviewMethod = function ( a , b , c ) { return b . type === $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ? a . isConnected ( ) ? module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . REPLACEMENT _FADE : module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager . PREVIEW _TYPE . INPUT _OUTLINE : module$exports$Blockly$zelos$Renderer . Renderer . superClass _ . getConnectionPreviewMethod ( a , b , c ) } ;
( 0 , module$exports$Blockly$blockRendering . register ) ( "zelos" , module$exports$Blockly$zelos$Renderer . Renderer ) ; var module$exports$Blockly$zelos = { } ; module$exports$Blockly$zelos . BottomRow = module$exports$Blockly$zelos$BottomRow . BottomRow ; module$exports$Blockly$zelos . ConstantProvider = module$exports$Blockly$zelos$ConstantProvider . ConstantProvider ; module$exports$Blockly$zelos . Drawer = module$exports$Blockly$zelos$Drawer . Drawer ; module$exports$Blockly$zelos . MarkerSvg = module$exports$Blockly$zelos$MarkerSvg . MarkerSvg ; module$exports$Blockly$zelos . PathObject = module$exports$Blockly$zelos$PathObject . PathObject ;
module$exports$Blockly$zelos . RenderInfo = module$exports$Blockly$zelos$RenderInfo . RenderInfo ; module$exports$Blockly$zelos . Renderer = module$exports$Blockly$zelos$Renderer . Renderer ; module$exports$Blockly$zelos . RightConnectionShape = module$exports$Blockly$zelos$RightConnectionShape . RightConnectionShape ; module$exports$Blockly$zelos . StatementInput = module$exports$Blockly$zelos$StatementInput . StatementInput ; module$exports$Blockly$zelos . TopRow = module$exports$Blockly$zelos$TopRow . TopRow ; var module$exports$Blockly$thrasos$RenderInfo = { RenderInfo : function ( a , b ) { module$exports$Blockly$thrasos$RenderInfo . RenderInfo . superClass _ . constructor . call ( this , a , b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$thrasos$RenderInfo . RenderInfo , module$exports$Blockly$blockRendering$RenderInfo . RenderInfo ) ; module$exports$Blockly$thrasos$RenderInfo . RenderInfo . prototype . getRenderer = function ( ) { return this . renderer _ } ;
module$exports$Blockly$thrasos$RenderInfo . RenderInfo . prototype . addElemSpacing _ = function ( ) { for ( var a = ! 1 , b = 0 ; b < this . rows . length ; b ++ ) if ( this . rows [ b ] . hasExternalInput ) { a = ! 0 ; break } for ( b = 0 ; b < this . rows . length ; b ++ ) { var c = this . rows [ b ] , d = c . elements ; c . elements = [ ] ; c . startsWithElemSpacer ( ) && c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , this . getInRowSpacing _ ( null , d [ 0 ] ) ) ) ; for ( var e = 0 ; e < d . length - 1 ; e ++ ) { c . elements . push ( d [ e ] ) ; var f = this . getInRowSpacing _ ( d [ e ] , d [ e +
1 ] ) ; c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , f ) ) } c . elements . push ( d [ d . length - 1 ] ) ; c . endsWithElemSpacer ( ) && ( d = this . getInRowSpacing _ ( d [ d . length - 1 ] , null ) , a && c . hasDummyInput && ( d += this . constants _ . TAB _WIDTH ) , c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , d ) ) ) } } ;
module$exports$Blockly$thrasos$RenderInfo . RenderInfo . prototype . getInRowSpacing _ = function ( a , b ) { if ( ! a ) return b && module$exports$Blockly$blockRendering$Types . Types . isField ( b ) && b . isEditable ? this . constants _ . MEDIUM _PADDING : b && module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) ? this . constants _ . MEDIUM _LARGE _PADDING : b && module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ? this . constants _ . STATEMENT _INPUT _PADDING _LEFT : this . constants _ . LARGE _PADDING ; if ( ! module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) &&
! b ) return module$exports$Blockly$blockRendering$Types . Types . isField ( a ) && a . isEditable ? this . constants _ . MEDIUM _PADDING : module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) ? 2 * this . constants _ . LARGE _PADDING + 1 : module$exports$Blockly$blockRendering$Types . Types . isHat ( a ) ? this . constants _ . NO _PADDING : module$exports$Blockly$blockRendering$Types . Types . isPreviousOrNextConnection ( a ) ? this . constants _ . LARGE _PADDING : module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a ) ? this . constants _ . MIN _BLOCK _WIDTH :
module$exports$Blockly$blockRendering$Types . Types . isJaggedEdge ( a ) ? this . constants _ . NO _PADDING : this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) && ! b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( a ) ) return this . constants _ . NO _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( a ) ) return this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( a ) ) return this . constants _ . NO _PADDING } if ( ! module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) &&
b && module$exports$Blockly$blockRendering$Types . Types . isInput ( b ) ) { if ( module$exports$Blockly$blockRendering$Types . Types . isField ( a ) && a . isEditable ) { if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) || module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( b ) ) return this . constants _ . SMALL _PADDING } else { if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) || module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( b ) ) return this . constants _ . MEDIUM _LARGE _PADDING ;
if ( module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ) return this . constants _ . LARGE _PADDING } return this . constants _ . LARGE _PADDING - 1 } if ( module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) && b && ! module$exports$Blockly$blockRendering$Types . Types . isInput ( b ) ) return this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( a ) && b && module$exports$Blockly$blockRendering$Types . Types . isField ( b ) ) return b . isEditable ? this . constants _ . MEDIUM _PADDING :
this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( a ) && b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isHat ( b ) ) return this . constants _ . NO _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( b ) || module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ) return b . notchOffset } return module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a ) && b ? b . notchOffset - this . constants _ . CORNER _RADIUS :
module$exports$Blockly$blockRendering$Types . Types . isField ( a ) && b && module$exports$Blockly$blockRendering$Types . Types . isField ( b ) && a . isEditable === b . isEditable || b && module$exports$Blockly$blockRendering$Types . Types . isJaggedEdge ( b ) ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } ;
module$exports$Blockly$thrasos$RenderInfo . RenderInfo . prototype . getSpacerRowHeight _ = function ( a , b ) { return module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) && module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( b ) ? this . constants _ . EMPTY _BLOCK _SPACER _HEIGHT : module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) || module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( b ) ? this . constants _ . NO _PADDING : a . hasExternalInput && b . hasExternalInput ? this . constants _ . LARGE _PADDING : ! a . hasStatement &&
b . hasStatement ? this . constants _ . BETWEEN _STATEMENT _PADDING _Y : a . hasStatement && b . hasStatement || a . hasDummyInput || b . hasDummyInput ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } ;
module$exports$Blockly$thrasos$RenderInfo . RenderInfo . prototype . getElemCenterline _ = function ( a , b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) ) return a . yPos + b . height / 2 ; if ( module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( a ) ) return a = a . yPos + a . height - a . descenderHeight , module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ? a + b . height / 2 : a - b . height / 2 ; if ( module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) ) return module$exports$Blockly$blockRendering$Types . Types . isHat ( b ) ?
a . capline - b . height / 2 : a . capline + b . height / 2 ; var c = a . yPos ; return c = module$exports$Blockly$blockRendering$Types . Types . isField ( b ) && a . hasStatement ? c + ( this . constants _ . TALL _INPUT _FIELD _OFFSET _Y + b . height / 2 ) : c + a . height / 2 } ;
module$exports$Blockly$thrasos$RenderInfo . RenderInfo . prototype . finalize _ = function ( ) { for ( var a = 0 , b = 0 , c = 0 ; c < this . rows . length ; c ++ ) { var d = this . rows [ c ] ; d . yPos = b ; d . xPos = this . startX ; b += d . height ; a = Math . max ( a , d . widthWithConnectedBlocks ) ; var e = b - this . topRow . ascenderHeight ; d === this . bottomRow && e < this . constants _ . MIN _BLOCK _HEIGHT && ( e = this . constants _ . MIN _BLOCK _HEIGHT - e , this . bottomRow . height += e , b += e ) ; this . recordElemPositions _ ( d ) } this . outputConnection && this . block _ . nextConnection && this . block _ . nextConnection . isConnected ( ) &&
( a = Math . max ( a , this . block _ . nextConnection . targetBlock ( ) . getHeightWidth ( ) . width ) ) ; this . bottomRow . baseline = b - this . bottomRow . descenderHeight ; this . widthWithChildren = a + this . startX ; this . height = b ; this . startY = this . topRow . capline } ; var module$exports$Blockly$thrasos$Renderer = { Renderer : function ( a ) { module$exports$Blockly$thrasos$Renderer . Renderer . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$thrasos$Renderer . Renderer , module$exports$Blockly$blockRendering$Renderer . Renderer ) ; module$exports$Blockly$thrasos$Renderer . Renderer . prototype . makeRenderInfo _ = function ( a ) { return new module$exports$Blockly$thrasos$RenderInfo . RenderInfo ( this , a ) } ;
( 0 , module$exports$Blockly$blockRendering . register ) ( "thrasos" , module$exports$Blockly$thrasos$Renderer . Renderer ) ; var module$exports$Blockly$thrasos = { } ; module$exports$Blockly$thrasos . RenderInfo = module$exports$Blockly$thrasos$RenderInfo . RenderInfo ; module$exports$Blockly$thrasos . Renderer = module$exports$Blockly$thrasos$Renderer . Renderer ; var module$exports$Blockly$serialization$workspaces = { save : function ( a ) { var b = Object . create ( null ) , c = ( 0 , module$exports$Blockly$registry . getAllItems ) ( module$exports$Blockly$registry . Type . SERIALIZER , ! 0 ) , d ; for ( d in c ) { var e = c [ d ] . save ( a ) ; e && ( b [ d ] = e ) } return b } , load : function ( a , b , c ) { c = void 0 === c ? { } : c ; var d = void 0 === c . recordUndo ? ! 1 : c . recordUndo ; if ( c = ( 0 , module$exports$Blockly$registry . getAllItems ) ( module$exports$Blockly$registry . Type . SERIALIZER , ! 0 ) ) { var e = Object . entries ( c ) . sort ( function ( h , k ) { return k [ 1 ] . priority -
h [ 1 ] . priority } ) ; c = ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) ; ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( d ) ; ( d = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ) || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; ( 0 , module$exports$Blockly$utils$dom . startTextWidthCache ) ( ) ; b . setResizesEnabled && b . setResizesEnabled ( ! 1 ) ; for ( var f = $jscomp . makeIterator ( e . reverse ( ) ) , g = f . next ( ) ; ! g . done ; g = f . next ( ) ) g = $jscomp . makeIterator ( g . value ) , g . next ( ) , g . next ( ) . value . clear ( b ) ; e = $jscomp . makeIterator ( e . reverse ( ) ) ;
for ( f = e . next ( ) ; ! f . done ; f = e . next ( ) ) g = $jscomp . makeIterator ( f . value ) , f = g . next ( ) . value , g = g . next ( ) . value , a [ f ] && g . load ( a [ f ] , b ) ; b . setResizesEnabled && b . setResizesEnabled ( ! 0 ) ; ( 0 , module$exports$Blockly$utils$dom . stopTextWidthCache ) ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . FINISHED _LOADING ) ) ( b ) ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( d ) ; ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( c ) } } } ; var module$exports$Blockly$serialization$variables = { } , module$contents$Blockly$serialization$variables _VariableSerializer = function ( ) { this . priority = module$exports$Blockly$serialization$priorities . VARIABLES } ; module$contents$Blockly$serialization$variables _VariableSerializer . prototype . save = function ( a ) { var b = [ ] ; a = $jscomp . makeIterator ( a . getAllVariables ( ) ) ; for ( var c = a . next ( ) ; ! c . done ; c = a . next ( ) ) { c = c . value ; var d = { name : c . name , id : c . getId ( ) } ; c . type && ( d . type = c . type ) ; b . push ( d ) } return b . length ? b : null } ;
module$contents$Blockly$serialization$variables _VariableSerializer . prototype . load = function ( a , b ) { a = $jscomp . makeIterator ( a ) ; for ( var c = a . next ( ) ; ! c . done ; c = a . next ( ) ) c = c . value , b . createVariable ( c . name , c . type , c . id ) } ; module$contents$Blockly$serialization$variables _VariableSerializer . prototype . clear = function ( a ) { a . getVariableMap ( ) . clear ( ) } ; ( 0 , module$exports$Blockly$serialization$registry . register ) ( "variables" , new module$contents$Blockly$serialization$variables _VariableSerializer ) ; var module$exports$Blockly$minimalist$ConstantProvider = { ConstantProvider : function ( ) { module$exports$Blockly$minimalist$ConstantProvider . ConstantProvider . superClass _ . constructor . call ( this ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$minimalist$ConstantProvider . ConstantProvider , module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider ) ; var module$exports$Blockly$minimalist$Drawer = { Drawer : function ( a , b ) { module$exports$Blockly$minimalist$Drawer . Drawer . superClass _ . constructor . call ( this , a , b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$minimalist$Drawer . Drawer , module$exports$Blockly$blockRendering$Drawer . Drawer ) ; var module$exports$Blockly$minimalist$RenderInfo = { RenderInfo : function ( a , b ) { module$exports$Blockly$minimalist$RenderInfo . RenderInfo . superClass _ . constructor . call ( this , a , b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$minimalist$RenderInfo . RenderInfo , module$exports$Blockly$blockRendering$RenderInfo . RenderInfo ) ; module$exports$Blockly$minimalist$RenderInfo . RenderInfo . prototype . getRenderer = function ( ) { return this . renderer _ } ; var module$exports$Blockly$minimalist$Renderer = { Renderer : function ( a ) { module$exports$Blockly$minimalist$Renderer . Renderer . superClass _ . constructor . call ( this , a ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$minimalist$Renderer . Renderer , module$exports$Blockly$blockRendering$Renderer . Renderer ) ; module$exports$Blockly$minimalist$Renderer . Renderer . prototype . makeConstants _ = function ( ) { return new module$exports$Blockly$minimalist$ConstantProvider . ConstantProvider } ;
module$exports$Blockly$minimalist$Renderer . Renderer . prototype . makeRenderInfo _ = function ( a ) { return new module$exports$Blockly$minimalist$RenderInfo . RenderInfo ( this , a ) } ; module$exports$Blockly$minimalist$Renderer . Renderer . prototype . makeDrawer _ = function ( a , b ) { return new module$exports$Blockly$minimalist$Drawer . Drawer ( a , b ) } ; ( 0 , module$exports$Blockly$blockRendering . register ) ( "minimalist" , module$exports$Blockly$minimalist$Renderer . Renderer ) ; var module$exports$Blockly$minimalist = { } ; module$exports$Blockly$minimalist . ConstantProvider = module$exports$Blockly$minimalist$ConstantProvider . ConstantProvider ; module$exports$Blockly$minimalist . Drawer = module$exports$Blockly$minimalist$Drawer . Drawer ; module$exports$Blockly$minimalist . RenderInfo = module$exports$Blockly$minimalist$RenderInfo . RenderInfo ; module$exports$Blockly$minimalist . Renderer = module$exports$Blockly$minimalist$Renderer . Renderer ; var module$exports$Blockly$geras$StatementInput = { StatementInput : function ( a , b ) { module$exports$Blockly$geras$StatementInput . StatementInput . superClass _ . constructor . call ( this , a , b ) ; this . connectedBlock && ( this . height += this . constants _ . DARK _PATH _OFFSET ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$StatementInput . StatementInput , module$exports$Blockly$blockRendering$StatementInput . StatementInput ) ; var module$exports$Blockly$geras$PathObject = { PathObject : function ( a , b , c ) { this . constants = c ; this . svgRoot = a ; this . svgPathDark = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyPathDark" , transform : "translate(1,1)" } , this . svgRoot ) ; this . svgPath = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyPath" } , this . svgRoot ) ; this . svgPathLight = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH ,
{ "class" : "blocklyPathLight" } , this . svgRoot ) ; this . colourDark = "#000000" ; this . style = b } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$PathObject . PathObject , module$exports$Blockly$blockRendering$PathObject . PathObject ) ; module$exports$Blockly$geras$PathObject . PathObject . prototype . setPath = function ( a ) { this . svgPath . setAttribute ( "d" , a ) ; this . svgPathDark . setAttribute ( "d" , a ) } ;
module$exports$Blockly$geras$PathObject . PathObject . prototype . setHighlightPath = function ( a ) { this . svgPathLight . setAttribute ( "d" , a ) } ; module$exports$Blockly$geras$PathObject . PathObject . prototype . flipRTL = function ( ) { this . svgPath . setAttribute ( "transform" , "scale(-1 1)" ) ; this . svgPathLight . setAttribute ( "transform" , "scale(-1 1)" ) ; this . svgPathDark . setAttribute ( "transform" , "translate(1,1) scale(-1 1)" ) } ;
module$exports$Blockly$geras$PathObject . PathObject . prototype . applyColour = function ( a ) { this . svgPathLight . style . display = "" ; this . svgPathDark . style . display = "" ; this . svgPathLight . setAttribute ( "stroke" , this . style . colourTertiary ) ; this . svgPathDark . setAttribute ( "fill" , this . colourDark ) ; module$exports$Blockly$geras$PathObject . PathObject . superClass _ . applyColour . call ( this , a ) ; this . svgPath . setAttribute ( "stroke" , "none" ) } ;
module$exports$Blockly$geras$PathObject . PathObject . prototype . setStyle = function ( a ) { this . style = a ; this . colourDark = ( 0 , module$exports$Blockly$utils$colour . blend ) ( "#000" , this . style . colourPrimary , . 2 ) || this . colourDark } ; module$exports$Blockly$geras$PathObject . PathObject . prototype . updateHighlighted = function ( a ) { a ? ( this . svgPath . setAttribute ( "filter" , "url(#" + this . constants . embossFilterId + ")" ) , this . svgPathLight . style . display = "none" ) : ( this . svgPath . setAttribute ( "filter" , "none" ) , this . svgPathLight . style . display = "inline" ) } ;
module$exports$Blockly$geras$PathObject . PathObject . prototype . updateShadow _ = function ( a ) { a && ( this . svgPathLight . style . display = "none" , this . svgPathDark . setAttribute ( "fill" , this . style . colourSecondary ) , this . svgPath . setAttribute ( "stroke" , "none" ) , this . svgPath . setAttribute ( "fill" , this . style . colourSecondary ) ) } ;
module$exports$Blockly$geras$PathObject . PathObject . prototype . updateDisabled _ = function ( a ) { module$exports$Blockly$geras$PathObject . PathObject . superClass _ . updateDisabled _ . call ( this , a ) ; a && this . svgPath . setAttribute ( "stroke" , "none" ) } ; var module$exports$Blockly$geras$ConstantProvider = { ConstantProvider : function ( ) { module$exports$Blockly$geras$ConstantProvider . ConstantProvider . superClass _ . constructor . call ( this ) ; this . FIELD _TEXT _BASELINE _CENTER = ! 1 ; this . DARK _PATH _OFFSET = 1 ; this . MAX _BOTTOM _WIDTH = 30 ; this . STATEMENT _BOTTOM _SPACER = - this . NOTCH _HEIGHT / 2 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$ConstantProvider . ConstantProvider , module$exports$Blockly$blockRendering$ConstantProvider . ConstantProvider ) ;
module$exports$Blockly$geras$ConstantProvider . ConstantProvider . prototype . getCSS _ = function ( a ) { return module$exports$Blockly$geras$ConstantProvider . ConstantProvider . superClass _ . getCSS _ . call ( this , a ) . concat ( [ a + " .blocklyInsertionMarker>.blocklyPathLight," , a + " .blocklyInsertionMarker>.blocklyPathDark {" , "fill-opacity: " + this . INSERTION _MARKER _OPACITY + ";" , "stroke: none;" , "}" ] ) } ; var module$exports$Blockly$geras$Highlighter = { Highlighter : function ( a ) { this . info _ = a ; this . inlineSteps _ = this . steps _ = "" ; this . RTL _ = this . info _ . RTL ; a = a . getRenderer ( ) ; this . constants _ = a . getConstants ( ) ; this . highlightConstants _ = a . getHighlightConstants ( ) ; this . highlightOffset _ = this . highlightConstants _ . OFFSET ; this . outsideCornerPaths _ = this . highlightConstants _ . OUTSIDE _CORNER ; this . insideCornerPaths _ = this . highlightConstants _ . INSIDE _CORNER ; this . puzzleTabPaths _ = this . highlightConstants _ . PUZZLE _TAB ; this . notchPaths _ = this . highlightConstants _ . NOTCH ;
this . startPaths _ = this . highlightConstants _ . START _HAT ; this . jaggedTeethPaths _ = this . highlightConstants _ . JAGGED _TEETH } } ; module$exports$Blockly$geras$Highlighter . Highlighter . prototype . getPath = function ( ) { return this . steps _ + "\n" + this . inlineSteps _ } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawTopCorner = function ( a ) { this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( a . xPos , this . info _ . startY ) ; for ( var b = 0 , c ; c = a . elements [ b ] ; b ++ ) module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( c ) ? this . steps _ += this . highlightConstants _ . START _POINT : module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( c ) ? this . steps _ += this . outsideCornerPaths _ . topLeft ( this . RTL _ ) : module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( c ) ?
this . steps _ += this . notchPaths _ . pathLeft : module$exports$Blockly$blockRendering$Types . Types . isHat ( c ) ? this . steps _ += this . startPaths _ . path ( this . RTL _ ) : module$exports$Blockly$blockRendering$Types . Types . isSpacer ( c ) && 0 !== c . width && ( this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , c . xPos + c . width - this . highlightOffset _ ) ) ; this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a . xPos + a . width - this . highlightOffset _ ) } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawJaggedEdge _ = function ( a ) { this . info _ . RTL && ( this . steps _ += this . jaggedTeethPaths _ . pathLeft + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , a . height - this . jaggedTeethPaths _ . height - this . highlightOffset _ ) ) } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawValueInput = function ( a ) { var b = a . getLastInput ( ) ; if ( this . RTL _ ) { var c = a . height - b . connectionHeight ; this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( b . xPos + b . width - this . highlightOffset _ , a . yPos ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , c ) } else this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( b . xPos + b . width , a . yPos ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawStatementInput = function ( a ) { var b = a . getLastInput ( ) ; if ( this . RTL _ ) { var c = a . height - 2 * this . insideCornerPaths _ . height ; this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( b . xPos , a . yPos ) + this . insideCornerPaths _ . pathTop ( this . RTL _ ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , c ) + this . insideCornerPaths _ . pathBottom ( this . RTL _ ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( a . width - b . xPos - this . insideCornerPaths _ . width , 0 ) } else this . steps _ +=
( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( b . xPos , a . yPos + a . height ) + this . insideCornerPaths _ . pathBottom ( this . RTL _ ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( a . width - b . xPos - this . insideCornerPaths _ . width , 0 ) } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawRightSideRow = function ( a ) { var b = a . xPos + a . width - this . highlightOffset _ ; a . followsStatement && ( this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , b ) ) ; this . RTL _ && ( this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , b ) , a . height > this . highlightOffset _ && ( this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . yPos + a . height - this . highlightOffset _ ) ) ) } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawBottomRow = function ( a ) { if ( this . RTL _ ) this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . baseline - this . highlightOffset _ ) ; else { var b = this . info _ . bottomRow . elements [ 0 ] ; module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( b ) ? this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( a . xPos + this . highlightOffset _ , a . baseline - this . highlightOffset _ ) : module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( b ) &&
( this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( a . xPos , a . baseline ) , this . steps _ += this . outsideCornerPaths _ . bottomLeft ( ) ) } } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawLeft = function ( ) { var a = this . info _ . outputConnection ; a && ( a = a . connectionOffsetY + a . height , this . RTL _ ? this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( this . info _ . startX , a ) : ( this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( this . info _ . startX + this . highlightOffset _ , this . info _ . bottomRow . baseline - this . highlightOffset _ ) , this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a ) ) , this . steps _ += this . puzzleTabPaths _ . pathUp ( this . RTL _ ) ) ;
this . RTL _ || ( a = this . info _ . topRow , module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a . elements [ 0 ] ) ? this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , this . outsideCornerPaths _ . height ) : this . steps _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . capline + this . highlightOffset _ ) ) } ;
module$exports$Blockly$geras$Highlighter . Highlighter . prototype . drawInlineInput = function ( a ) { var b = this . highlightOffset _ , c = a . xPos + a . connectionWidth , d = a . centerline - a . height / 2 , e = a . width - a . connectionWidth , f = d + b ; this . RTL _ ? ( d = a . connectionOffsetY - b , a = a . height - ( a . connectionOffsetY + a . connectionHeight ) + b , this . inlineSteps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( c - b , f ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , d ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" ,
a ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , e ) ) : this . inlineSteps _ += ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( a . xPos + a . width + b , f ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , a . height ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , - e ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( c , d + a . connectionOffsetY ) + this . puzzleTabPaths _ . pathDown ( this . RTL _ ) } ; var module$exports$Blockly$geras$Drawer = { Drawer : function ( a , b ) { module$exports$Blockly$geras$Drawer . Drawer . superClass _ . constructor . call ( this , a , b ) ; this . highlighter _ = new module$exports$Blockly$geras$Highlighter . Highlighter ( b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$Drawer . Drawer , module$exports$Blockly$blockRendering$Drawer . Drawer ) ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . draw = function ( ) { this . hideHiddenIcons _ ( ) ; this . drawOutline _ ( ) ; this . drawInternals _ ( ) ; var a = this . block _ . pathObject ; a . setPath ( this . outlinePath _ + "\n" + this . inlinePath _ ) ; a . setHighlightPath ( this . highlighter _ . getPath ( ) ) ; this . info _ . RTL && a . flipRTL ( ) ; ( 0 , module$exports$Blockly$blockRendering$debug . isDebuggerEnabled ) ( ) && this . block _ . renderingDebugger . drawDebug ( this . block _ , this . info _ ) ; this . recordSizeOnBlock _ ( ) } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . drawTop _ = function ( ) { this . highlighter _ . drawTopCorner ( this . info _ . topRow ) ; this . highlighter _ . drawRightSideRow ( this . info _ . topRow ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawTop _ . call ( this ) } ; module$exports$Blockly$geras$Drawer . Drawer . prototype . drawJaggedEdge _ = function ( a ) { this . highlighter _ . drawJaggedEdge _ ( a ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawJaggedEdge _ . call ( this , a ) } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . drawValueInput _ = function ( a ) { this . highlighter _ . drawValueInput ( a ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawValueInput _ . call ( this , a ) } ; module$exports$Blockly$geras$Drawer . Drawer . prototype . drawStatementInput _ = function ( a ) { this . highlighter _ . drawStatementInput ( a ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawStatementInput _ . call ( this , a ) } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . drawRightSideRow _ = function ( a ) { this . highlighter _ . drawRightSideRow ( a ) ; this . outlinePath _ += ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "H" , a . xPos + a . width ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "V" , a . yPos + a . height ) } ; module$exports$Blockly$geras$Drawer . Drawer . prototype . drawBottom _ = function ( ) { this . highlighter _ . drawBottomRow ( this . info _ . bottomRow ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawBottom _ . call ( this ) } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . drawLeft _ = function ( ) { this . highlighter _ . drawLeft ( ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawLeft _ . call ( this ) } ; module$exports$Blockly$geras$Drawer . Drawer . prototype . drawInlineInput _ = function ( a ) { this . highlighter _ . drawInlineInput ( a ) ; module$exports$Blockly$geras$Drawer . Drawer . superClass _ . drawInlineInput _ . call ( this , a ) } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . positionInlineInputConnection _ = function ( a ) { var b = a . centerline - a . height / 2 ; if ( a . connectionModel ) { var c = a . xPos + a . connectionWidth + this . constants _ . DARK _PATH _OFFSET ; this . info _ . RTL && ( c *= - 1 ) ; a . connectionModel . setOffsetInBlock ( c , b + a . connectionOffsetY + this . constants _ . DARK _PATH _OFFSET ) } } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . positionStatementInputConnection _ = function ( a ) { var b = a . getLastInput ( ) ; if ( b . connectionModel ) { var c = a . xPos + a . statementEdge + b . notchOffset ; c = this . info _ . RTL ? - 1 * c : c + this . constants _ . DARK _PATH _OFFSET ; b . connectionModel . setOffsetInBlock ( c , a . yPos + this . constants _ . DARK _PATH _OFFSET ) } } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . positionExternalValueConnection _ = function ( a ) { var b = a . getLastInput ( ) ; if ( b . connectionModel ) { var c = a . xPos + a . width + this . constants _ . DARK _PATH _OFFSET ; this . info _ . RTL && ( c *= - 1 ) ; b . connectionModel . setOffsetInBlock ( c , a . yPos ) } } ;
module$exports$Blockly$geras$Drawer . Drawer . prototype . positionNextConnection _ = function ( ) { var a = this . info _ . bottomRow ; if ( a . connection ) { var b = a . connection , c = b . xPos ; b . connectionModel . setOffsetInBlock ( ( this . info _ . RTL ? - c : c ) + this . constants _ . DARK _PATH _OFFSET / 2 , a . baseline + this . constants _ . DARK _PATH _OFFSET ) } } ; var module$exports$Blockly$geras$HighlightConstantProvider = { HighlightConstantProvider : function ( a ) { this . constantProvider = a ; this . OFFSET = . 5 ; this . START _POINT = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( this . OFFSET , this . OFFSET ) } } ;
module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . init = function ( ) { this . INSIDE _CORNER = this . makeInsideCorner ( ) ; this . OUTSIDE _CORNER = this . makeOutsideCorner ( ) ; this . PUZZLE _TAB = this . makePuzzleTab ( ) ; this . NOTCH = this . makeNotch ( ) ; this . JAGGED _TEETH = this . makeJaggedTeeth ( ) ; this . START _HAT = this . makeStartHat ( ) } ;
module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . makeInsideCorner = function ( ) { var a = this . constantProvider . CORNER _RADIUS , b = this . OFFSET , c = ( 1 - Math . SQRT1 _2 ) * ( a + b ) - b , d = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( c , c ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - c - b , a - c ) ) , e = ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a + b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a + b , a + b ) ) , f =
( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( c , - c ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,0" , a + b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a - c , c + b ) ) ; return { width : a + b , height : a , pathTop : function ( g ) { return g ? d : "" } , pathBottom : function ( g ) { return g ? e : f } } } ;
module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . makeOutsideCorner = function ( ) { var a = this . constantProvider . CORNER _RADIUS , b = this . OFFSET , c = ( 1 - Math . SQRT1 _2 ) * ( a - b ) + b , d = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( c , c ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a - b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a - c , - c + b ) ) , e = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( b , a ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a - b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( a ,
- a + b ) ) , f = - c , g = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( c , f ) + ( 0 , module$exports$Blockly$utils$svgPaths . arc ) ( "a" , "0 0,1" , a - b , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - c + b , - f - a ) ) ; return { height : a , topLeft : function ( h ) { return h ? d : e } , bottomLeft : function ( ) { return g } } } ;
module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . makePuzzleTab = function ( ) { var a = this . constantProvider . TAB _WIDTH , b = this . constantProvider . TAB _HEIGHT , c = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - 2 , - b + 3.4 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( - . 45 * a , - 2.1 ) , d = ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , 2.5 ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( . 97 * - a , 2.5 ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "q" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( . 05 *
- a , 10 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( . 3 * a , 9.5 ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( . 67 * a , - 1.9 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , 2.5 ) , e = ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "v" , - 1.5 ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - . 92 * a , - . 5 ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "q" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( - . 19 * a , - 5.5 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 0 , - 11 ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( . 92 *
a , 1 ) , f = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - 5 , b - . 7 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( . 46 * a , - 2.1 ) ; return { width : a , height : b , pathUp : function ( g ) { return g ? c : e } , pathDown : function ( g ) { return g ? d : f } } } ; module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . makeNotch = function ( ) { return { pathLeft : ( 0 , module$exports$Blockly$utils$svgPaths . lineOnAxis ) ( "h" , this . OFFSET ) + this . constantProvider . NOTCH . pathLeft } } ;
module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . makeJaggedTeeth = function ( ) { return { pathLeft : ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( 5.1 , 2.6 ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( - 10.2 , 6.8 ) + ( 0 , module$exports$Blockly$utils$svgPaths . lineTo ) ( 5.1 , 2.6 ) , height : 12 , width : 10.2 } } ;
module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider . prototype . makeStartHat = function ( ) { var a = this . constantProvider . START _HAT . height , b = ( 0 , module$exports$Blockly$utils$svgPaths . moveBy ) ( 25 , - 8.7 ) + ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" , [ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 29.7 , - 6.2 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 57.2 , - . 5 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 75 , 8.7 ) ] ) , c = ( 0 , module$exports$Blockly$utils$svgPaths . curve ) ( "c" ,
[ ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 17.8 , - 9.2 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 45.3 , - 14.9 ) , ( 0 , module$exports$Blockly$utils$svgPaths . point ) ( 75 , - 8.7 ) ] ) + ( 0 , module$exports$Blockly$utils$svgPaths . moveTo ) ( 100.5 , a + . 5 ) ; return { path : function ( d ) { return d ? b : c } } } ; var module$exports$Blockly$geras$InlineInput = { InlineInput : function ( a , b ) { module$exports$Blockly$geras$InlineInput . InlineInput . superClass _ . constructor . call ( this , a , b ) ; this . connectedBlock && ( this . width += this . constants _ . DARK _PATH _OFFSET , this . height += this . constants _ . DARK _PATH _OFFSET ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$InlineInput . InlineInput , module$exports$Blockly$blockRendering$InlineInput . InlineInput ) ; var module$exports$Blockly$geras$RenderInfo = { RenderInfo : function ( a , b ) { module$exports$Blockly$geras$RenderInfo . RenderInfo . superClass _ . constructor . call ( this , a , b ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$RenderInfo . RenderInfo , module$exports$Blockly$blockRendering$RenderInfo . RenderInfo ) ; module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . getRenderer = function ( ) { return this . renderer _ } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . populateBottomRow _ = function ( ) { module$exports$Blockly$geras$RenderInfo . RenderInfo . superClass _ . populateBottomRow _ . call ( this ) ; this . block _ . inputList . length && this . block _ . inputList [ this . block _ . inputList . length - 1 ] . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT || ( this . bottomRow . minHeight = this . constants _ . MEDIUM _PADDING - this . constants _ . DARK _PATH _OFFSET ) } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . addInput _ = function ( a , b ) { this . isInline && a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ? ( b . elements . push ( new module$exports$Blockly$geras$InlineInput . InlineInput ( this . constants _ , a ) ) , b . hasInlineInput = ! 0 ) : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ? ( b . elements . push ( new module$exports$Blockly$geras$StatementInput . StatementInput ( this . constants _ , a ) ) , b . hasStatement = ! 0 ) : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . VALUE ?
( b . elements . push ( new module$exports$Blockly$blockRendering$ExternalValueInput . ExternalValueInput ( this . constants _ , a ) ) , b . hasExternalInput = ! 0 ) : a . type === $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY && ( b . minHeight = Math . max ( b . minHeight , this . constants _ . DUMMY _INPUT _MIN _HEIGHT ) , b . hasDummyInput = ! 0 ) ; this . isInline || null !== b . align || ( b . align = a . align ) } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . addElemSpacing _ = function ( ) { for ( var a = ! 1 , b = 0 , c ; c = this . rows [ b ] ; b ++ ) c . hasExternalInput && ( a = ! 0 ) ; for ( b = 0 ; c = this . rows [ b ] ; b ++ ) { var d = c . elements ; c . elements = [ ] ; c . startsWithElemSpacer ( ) && c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , this . getInRowSpacing _ ( null , d [ 0 ] ) ) ) ; if ( d . length ) { for ( var e = 0 ; e < d . length - 1 ; e ++ ) { c . elements . push ( d [ e ] ) ; var f = this . getInRowSpacing _ ( d [ e ] , d [ e + 1 ] ) ; c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ ,
f ) ) } c . elements . push ( d [ d . length - 1 ] ) ; c . endsWithElemSpacer ( ) && ( d = this . getInRowSpacing _ ( d [ d . length - 1 ] , null ) , a && c . hasDummyInput && ( d += this . constants _ . TAB _WIDTH ) , c . elements . push ( new module$exports$Blockly$blockRendering$InRowSpacer . InRowSpacer ( this . constants _ , d ) ) ) } } } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . getInRowSpacing _ = function ( a , b ) { if ( ! a ) return b && module$exports$Blockly$blockRendering$Types . Types . isField ( b ) && b . isEditable ? this . constants _ . MEDIUM _PADDING : b && module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) ? this . constants _ . MEDIUM _LARGE _PADDING : b && module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ? this . constants _ . STATEMENT _INPUT _PADDING _LEFT : this . constants _ . LARGE _PADDING ; if ( ! module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) &&
( ! b || module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ) ) return module$exports$Blockly$blockRendering$Types . Types . isField ( a ) && a . isEditable ? this . constants _ . MEDIUM _PADDING : module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) ? 2 * this . constants _ . LARGE _PADDING + 1 : module$exports$Blockly$blockRendering$Types . Types . isHat ( a ) ? this . constants _ . NO _PADDING : module$exports$Blockly$blockRendering$Types . Types . isPreviousOrNextConnection ( a ) ? this . constants _ . LARGE _PADDING : module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a ) ?
this . constants _ . MIN _BLOCK _WIDTH : module$exports$Blockly$blockRendering$Types . Types . isJaggedEdge ( a ) ? this . constants _ . NO _PADDING : this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) && ! b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( a ) ) return this . constants _ . NO _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( a ) ) return this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( a ) ) return this . constants _ . NO _PADDING } if ( ! module$exports$Blockly$blockRendering$Types . Types . isInput ( a ) &&
b && module$exports$Blockly$blockRendering$Types . Types . isInput ( b ) ) { if ( module$exports$Blockly$blockRendering$Types . Types . isField ( a ) && a . isEditable ) { if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) || module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( b ) ) return this . constants _ . SMALL _PADDING } else { if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) || module$exports$Blockly$blockRendering$Types . Types . isExternalInput ( b ) ) return this . constants _ . MEDIUM _LARGE _PADDING ;
if ( module$exports$Blockly$blockRendering$Types . Types . isStatementInput ( b ) ) return this . constants _ . LARGE _PADDING } return this . constants _ . LARGE _PADDING - 1 } if ( module$exports$Blockly$blockRendering$Types . Types . isIcon ( a ) && b && ! module$exports$Blockly$blockRendering$Types . Types . isInput ( b ) ) return this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( a ) && b && module$exports$Blockly$blockRendering$Types . Types . isField ( b ) ) return b . isEditable ? this . constants _ . MEDIUM _PADDING :
this . constants _ . LARGE _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isLeftSquareCorner ( a ) && b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isHat ( b ) ) return this . constants _ . NO _PADDING ; if ( module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( b ) ) return b . notchOffset ; if ( module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ) return b . notchOffset + ( this . RTL ? 1 : - 1 ) * this . constants _ . DARK _PATH _OFFSET / 2 } if ( module$exports$Blockly$blockRendering$Types . Types . isLeftRoundedCorner ( a ) &&
b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isPreviousConnection ( b ) ) return b . notchOffset - this . constants _ . CORNER _RADIUS ; if ( module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ) return b . notchOffset - this . constants _ . CORNER _RADIUS + ( this . RTL ? 1 : - 1 ) * this . constants _ . DARK _PATH _OFFSET / 2 } return module$exports$Blockly$blockRendering$Types . Types . isField ( a ) && b && module$exports$Blockly$blockRendering$Types . Types . isField ( b ) && a . isEditable === b . isEditable || b && module$exports$Blockly$blockRendering$Types . Types . isJaggedEdge ( b ) ?
2021-01-16 14:07:51 +00:00
this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } ;
2022-01-03 14:02:41 +00:00
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . getSpacerRowHeight _ = function ( a , b ) { return module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) && module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( b ) ? this . constants _ . EMPTY _BLOCK _SPACER _HEIGHT : module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) || module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( b ) ? this . constants _ . NO _PADDING : a . hasExternalInput && b . hasExternalInput ? this . constants _ . LARGE _PADDING : ! a . hasStatement &&
b . hasStatement ? this . constants _ . BETWEEN _STATEMENT _PADDING _Y : a . hasStatement && b . hasStatement || ! a . hasStatement && b . hasDummyInput || a . hasDummyInput ? this . constants _ . LARGE _PADDING : this . constants _ . MEDIUM _PADDING } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . getElemCenterline _ = function ( a , b ) { if ( module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) ) return a . yPos + b . height / 2 ; if ( module$exports$Blockly$blockRendering$Types . Types . isBottomRow ( a ) ) return a = a . yPos + a . height - a . descenderHeight , module$exports$Blockly$blockRendering$Types . Types . isNextConnection ( b ) ? a + b . height / 2 : a - b . height / 2 ; if ( module$exports$Blockly$blockRendering$Types . Types . isTopRow ( a ) ) return module$exports$Blockly$blockRendering$Types . Types . isHat ( b ) ?
a . capline - b . height / 2 : a . capline + b . height / 2 ; var c = a . yPos ; module$exports$Blockly$blockRendering$Types . Types . isField ( b ) || module$exports$Blockly$blockRendering$Types . Types . isIcon ( b ) ? ( c += b . height / 2 , ( a . hasInlineInput || a . hasStatement ) && b . height + this . constants _ . TALL _INPUT _FIELD _OFFSET _Y <= a . height && ( c += this . constants _ . TALL _INPUT _FIELD _OFFSET _Y ) ) : c = module$exports$Blockly$blockRendering$Types . Types . isInlineInput ( b ) ? c + b . height / 2 : c + a . height / 2 ; return c } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . alignRowElements _ = function ( ) { if ( this . isInline ) { for ( var a = 0 , b = null , c = this . rows . length - 1 , d ; d = this . rows [ c ] ; c -- ) d . nextRightEdge = a , module$exports$Blockly$blockRendering$Types . Types . isInputRow ( d ) && ( d . hasStatement && this . alignStatementRow _ ( d ) , b && b . hasStatement && d . width < b . width ? d . nextRightEdge = b . width : a = d . width , b = d ) ; for ( a = c = 0 ; b = this . rows [ a ] ; a ++ ) b . hasStatement ? c = this . getDesiredRowWidth _ ( b ) : module$exports$Blockly$blockRendering$Types . Types . isSpacer ( b ) ?
b . width = Math . max ( c , b . nextRightEdge ) : ( c = Math . max ( c , b . nextRightEdge ) - b . width , 0 < c && this . addAlignmentPadding _ ( b , c ) , c = b . width ) } else module$exports$Blockly$geras$RenderInfo . RenderInfo . superClass _ . alignRowElements _ . call ( this ) } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . getDesiredRowWidth _ = function ( a ) { return this . isInline && a . hasStatement ? this . statementEdge + this . constants _ . MAX _BOTTOM _WIDTH + this . startX : module$exports$Blockly$geras$RenderInfo . RenderInfo . superClass _ . getDesiredRowWidth _ . call ( this , a ) } ;
module$exports$Blockly$geras$RenderInfo . RenderInfo . prototype . finalize _ = function ( ) { for ( var a = 0 , b = 0 , c = 0 , d ; d = this . rows [ c ] ; c ++ ) { d . yPos = b ; d . xPos = this . startX ; b += d . height ; a = Math . max ( a , d . widthWithConnectedBlocks ) ; var e = b - this . topRow . ascenderHeight ; d === this . bottomRow && e < this . constants _ . MIN _BLOCK _HEIGHT && ( e = this . constants _ . MIN _BLOCK _HEIGHT - e , this . bottomRow . height += e , b += e ) ; this . recordElemPositions _ ( d ) } this . outputConnection && this . block _ . nextConnection && this . block _ . nextConnection . isConnected ( ) && ( a = Math . max ( a ,
this . block _ . nextConnection . targetBlock ( ) . 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 } ; var module$exports$Blockly$geras$Renderer = { Renderer : function ( a ) { module$exports$Blockly$geras$Renderer . Renderer . superClass _ . constructor . call ( this , a ) ; this . highlightConstants _ = null } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$geras$Renderer . Renderer , module$exports$Blockly$blockRendering$Renderer . Renderer ) ;
module$exports$Blockly$geras$Renderer . Renderer . prototype . init = function ( a , b ) { module$exports$Blockly$geras$Renderer . Renderer . superClass _ . init . call ( this , a , b ) ; this . highlightConstants _ = this . makeHighlightConstants _ ( ) ; this . highlightConstants _ . init ( ) } ; module$exports$Blockly$geras$Renderer . Renderer . prototype . refreshDom = function ( a , b ) { module$exports$Blockly$geras$Renderer . Renderer . superClass _ . refreshDom . call ( this , a , b ) ; this . getHighlightConstants ( ) . init ( ) } ;
module$exports$Blockly$geras$Renderer . Renderer . prototype . makeConstants _ = function ( ) { return new module$exports$Blockly$geras$ConstantProvider . ConstantProvider } ; module$exports$Blockly$geras$Renderer . Renderer . prototype . makeRenderInfo _ = function ( a ) { return new module$exports$Blockly$geras$RenderInfo . RenderInfo ( this , a ) } ; module$exports$Blockly$geras$Renderer . Renderer . prototype . makeDrawer _ = function ( a , b ) { return new module$exports$Blockly$geras$Drawer . Drawer ( a , b ) } ;
module$exports$Blockly$geras$Renderer . Renderer . prototype . makePathObject = function ( a , b ) { return new module$exports$Blockly$geras$PathObject . PathObject ( a , b , this . getConstants ( ) ) } ; module$exports$Blockly$geras$Renderer . Renderer . prototype . makeHighlightConstants _ = function ( ) { return new module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider ( this . getConstants ( ) ) } ; module$exports$Blockly$geras$Renderer . Renderer . prototype . getHighlightConstants = function ( ) { return this . highlightConstants _ } ;
( 0 , module$exports$Blockly$blockRendering . register ) ( "geras" , module$exports$Blockly$geras$Renderer . Renderer ) ; var module$exports$Blockly$geras = { } ; module$exports$Blockly$geras . ConstantProvider = module$exports$Blockly$geras$ConstantProvider . ConstantProvider ; module$exports$Blockly$geras . Drawer = module$exports$Blockly$geras$Drawer . Drawer ; module$exports$Blockly$geras . HighlightConstantProvider = module$exports$Blockly$geras$HighlightConstantProvider . HighlightConstantProvider ; module$exports$Blockly$geras . Highlighter = module$exports$Blockly$geras$Highlighter . Highlighter ; module$exports$Blockly$geras . InlineInput = module$exports$Blockly$geras$InlineInput . InlineInput ;
module$exports$Blockly$geras . PathObject = module$exports$Blockly$geras$PathObject . PathObject ; module$exports$Blockly$geras . RenderInfo = module$exports$Blockly$geras$RenderInfo . RenderInfo ; module$exports$Blockly$geras . Renderer = module$exports$Blockly$geras$Renderer . Renderer ; module$exports$Blockly$geras . StatementInput = module$exports$Blockly$geras$StatementInput . StatementInput ; var module$exports$Blockly$Themes$Zelos = { } , module$contents$Blockly$Themes$Zelos _defaultBlockStyles = { colour _blocks : { colourPrimary : "#CF63CF" , colourSecondary : "#C94FC9" , colourTertiary : "#BD42BD" } , list _blocks : { colourPrimary : "#9966FF" , colourSecondary : "#855CD6" , colourTertiary : "#774DCB" } , logic _blocks : { colourPrimary : "#4C97FF" , colourSecondary : "#4280D7" , colourTertiary : "#3373CC" } , loop _blocks : { colourPrimary : "#0fBD8C" , colourSecondary : "#0DA57A" , colourTertiary : "#0B8E69" } , math _blocks : { colourPrimary : "#59C059" , colourSecondary : "#46B946" ,
colourTertiary : "#389438" } , procedure _blocks : { colourPrimary : "#FF6680" , colourSecondary : "#FF4D6A" , colourTertiary : "#FF3355" } , text _blocks : { colourPrimary : "#FFBF00" , colourSecondary : "#E6AC00" , colourTertiary : "#CC9900" } , variable _blocks : { colourPrimary : "#FF8C1A" , colourSecondary : "#FF8000" , colourTertiary : "#DB6E00" } , variable _dynamic _blocks : { colourPrimary : "#FF8C1A" , colourSecondary : "#FF8000" , colourTertiary : "#DB6E00" } , hat _blocks : { colourPrimary : "#4C97FF" , colourSecondary : "#4280D7" , colourTertiary : "#3373CC" , hat : "cap" } } ,
module$contents$Blockly$Themes$Zelos _categoryStyles = { colour _category : { colour : "#CF63CF" } , list _category : { colour : "#9966FF" } , logic _category : { colour : "#4C97FF" } , loop _category : { colour : "#0fBD8C" } , math _category : { colour : "#59C059" } , procedure _category : { colour : "#FF6680" } , text _category : { colour : "#FFBF00" } , variable _category : { colour : "#FF8C1A" } , variable _dynamic _category : { colour : "#FF8C1A" } } ;
module$exports$Blockly$Themes$Zelos . Zelos = new module$exports$Blockly$Theme . Theme ( "zelos" , module$contents$Blockly$Themes$Zelos _defaultBlockStyles , module$contents$Blockly$Themes$Zelos _categoryStyles ) ; var module$exports$Blockly$Themes = { } ; module$exports$Blockly$Themes . Classic = module$exports$Blockly$Themes$Classic . Classic ; module$exports$Blockly$Themes . Zelos = module$exports$Blockly$Themes$Zelos . Zelos ; var module$exports$Blockly$ShortcutItems = { names : { ESCAPE : "escape" , DELETE : "delete" , COPY : "copy" , CUT : "cut" , PASTE : "paste" , UNDO : "undo" , REDO : "redo" } , registerEscape : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . ESCAPE , preconditionFn : function ( b ) { return ! b . options . readOnly } , callback : function ( b ) { b . hideChaff ( ) ; return ! 0 } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( module$exports$Blockly$utils$KeyCodes . KeyCodes . ESC ,
a . name ) } , registerDelete : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . DELETE , preconditionFn : function ( b ) { var c = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ; return ! b . options . readOnly && c && c . isDeletable ( ) } , callback : function ( b , c ) { c . preventDefault ( ) ; if ( module$exports$Blockly$Gesture . Gesture . inProgress ( ) ) return ! 1 ; ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . checkAndDelete ( ) ; return ! 0 } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( module$exports$Blockly$utils$KeyCodes . KeyCodes . DELETE ,
a . name ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( module$exports$Blockly$utils$KeyCodes . KeyCodes . BACKSPACE , a . name ) } , registerCopy : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . COPY , preconditionFn : function ( c ) { var d = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ; return ! c . options . readOnly && ! module$exports$Blockly$Gesture . Gesture . inProgress ( ) && d && d . isDeletable ( ) && d . isMovable ( ) } , callback : function ( c , d ) { d . preventDefault ( ) ; c . hideChaff ( ) ; ( 0 , module$exports$Blockly$clipboard . copy ) ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ) ;
return ! 0 } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; var b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . C , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . C ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . ALT ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . C , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . META ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) } , registerCut : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . CUT ,
preconditionFn : function ( c ) { var d = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ; return ! c . options . readOnly && ! module$exports$Blockly$Gesture . Gesture . inProgress ( ) && d && d . isDeletable ( ) && d . isMovable ( ) && ! d . workspace . isFlyout } , callback : function ( ) { var c = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ; if ( ! c ) return ! 1 ; ( 0 , module$exports$Blockly$clipboard . copy ) ( c ) ; c . checkAndDelete ( ) ; return ! 0 } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; var b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . X ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . X , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . ALT ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . X ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . META ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) } , registerPaste : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . PASTE , preconditionFn : function ( c ) { return ! c . options . readOnly && ! module$exports$Blockly$Gesture . Gesture . inProgress ( ) } , callback : function ( ) { return ( 0 , module$exports$Blockly$clipboard . paste ) ( ) } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; var b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . V ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . V , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . ALT ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . V ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . META ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) } , registerUndo : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . UNDO , preconditionFn : function ( c ) { return ! c . options . readOnly && ! module$exports$Blockly$Gesture . Gesture . inProgress ( ) } , callback : function ( c ) { c . hideChaff ( ) ; c . undo ( ! 1 ) ; return ! 0 } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; var b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Z ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Z , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . ALT ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Z ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . META ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) } , registerRedo : function ( ) { var a = { name : module$exports$Blockly$ShortcutItems . names . REDO , preconditionFn : function ( c ) { return ! module$exports$Blockly$Gesture . Gesture . inProgress ( ) && ! c . options . readOnly } , callback : function ( c ) { c . hideChaff ( ) ; c . undo ( ! 0 ) ; return ! 0 } } ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . register ( a ) ; var b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Z ,
[ module$exports$Blockly$utils$KeyCodes . KeyCodes . SHIFT , module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Z , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . SHIFT , module$exports$Blockly$utils$KeyCodes . KeyCodes . ALT ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b ,
a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Z , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . SHIFT , module$exports$Blockly$utils$KeyCodes . KeyCodes . META ] ) ; module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) ; b = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . createSerializedKey ( module$exports$Blockly$utils$KeyCodes . KeyCodes . Y , [ module$exports$Blockly$utils$KeyCodes . KeyCodes . CTRL ] ) ;
module$exports$Blockly$ShortcutRegistry . ShortcutRegistry . registry . addKeyMapping ( b , a . name ) } , registerDefaultShortcuts : function ( ) { ( 0 , module$exports$Blockly$ShortcutItems . registerEscape ) ( ) ; ( 0 , module$exports$Blockly$ShortcutItems . registerDelete ) ( ) ; ( 0 , module$exports$Blockly$ShortcutItems . registerCopy ) ( ) ; ( 0 , module$exports$Blockly$ShortcutItems . registerCut ) ( ) ; ( 0 , module$exports$Blockly$ShortcutItems . registerPaste ) ( ) ; ( 0 , module$exports$Blockly$ShortcutItems . registerUndo ) ( ) ; ( 0 , module$exports$Blockly$ShortcutItems . registerRedo ) ( ) } } ;
( 0 , module$exports$Blockly$ShortcutItems . registerDefaultShortcuts ) ( ) ; var module$exports$Blockly$Events$FinishedLoading = { FinishedLoading : function ( a ) { this . isBlank = "undefined" === typeof a ; this . workspaceId = a ? a . id : "" ; this . group = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; this . recordUndo = ! 1 } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$FinishedLoading . FinishedLoading , module$exports$Blockly$Events$Abstract ) ; module$exports$Blockly$Events$FinishedLoading . FinishedLoading . prototype . type = module$exports$Blockly$Events$utils . FINISHED _LOADING ;
module$exports$Blockly$Events$FinishedLoading . FinishedLoading . prototype . toJson = function ( ) { var a = { type : this . type } ; this . group && ( a . group = this . group ) ; this . workspaceId && ( a . workspaceId = this . workspaceId ) ; return a } ; module$exports$Blockly$Events$FinishedLoading . FinishedLoading . prototype . fromJson = function ( a ) { this . isBlank = ! 1 ; this . workspaceId = a . workspaceId ; this . group = a . group } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . FINISHED _LOADING , module$exports$Blockly$Events$FinishedLoading . FinishedLoading ) ; var module$exports$Blockly$Events$Ui = { Ui : function ( a , b , c , d ) { module$exports$Blockly$Events$Ui . Ui . superClass _ . constructor . call ( this , a ? a . workspace . id : void 0 ) ; this . blockId = a ? a . id : null ; this . element = "undefined" === typeof b ? "" : b ; this . oldValue = "undefined" === typeof c ? "" : c ; this . newValue = "undefined" === typeof d ? "" : d } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$Ui . Ui , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$Ui . Ui . prototype . type = module$exports$Blockly$Events$utils . UI ;
module$exports$Blockly$Events$Ui . Ui . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$Ui . Ui . superClass _ . toJson . call ( this ) ; a . element = this . element ; void 0 !== this . newValue && ( a . newValue = this . newValue ) ; this . blockId && ( a . blockId = this . blockId ) ; return a } ; module$exports$Blockly$Events$Ui . Ui . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$Ui . Ui . superClass _ . fromJson . call ( this , a ) ; this . element = a . element ; this . newValue = a . newValue ; this . blockId = a . blockId } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . UI , module$exports$Blockly$Events$Ui . Ui ) ; var module$exports$Blockly$Events$BubbleOpen = { BubbleOpen : function ( a , b , c ) { module$exports$Blockly$Events$BubbleOpen . BubbleOpen . superClass _ . constructor . call ( this , a ? a . workspace . id : void 0 ) ; this . blockId = a ? a . id : null ; this . isOpen = b ; this . bubbleType = c } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$BubbleOpen . BubbleOpen , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$BubbleOpen . BubbleOpen . prototype . type = module$exports$Blockly$Events$utils . BUBBLE _OPEN ;
module$exports$Blockly$Events$BubbleOpen . BubbleOpen . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$BubbleOpen . BubbleOpen . superClass _ . toJson . call ( this ) ; a . isOpen = this . isOpen ; a . bubbleType = this . bubbleType ; a . blockId = this . blockId ; return a } ; module$exports$Blockly$Events$BubbleOpen . BubbleOpen . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$BubbleOpen . BubbleOpen . superClass _ . fromJson . call ( this , a ) ; this . isOpen = a . isOpen ; this . bubbleType = a . bubbleType ; this . blockId = a . blockId } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . BUBBLE _OPEN , module$exports$Blockly$Events$BubbleOpen . BubbleOpen ) ; var module$exports$Blockly$Events$CommentChange = { CommentChange : function ( a , b , c ) { module$exports$Blockly$Events$CommentChange . CommentChange . superClass _ . constructor . call ( this , a ) ; a && ( this . oldContents _ = "undefined" === typeof b ? "" : b , this . newContents _ = "undefined" === typeof c ? "" : c ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$CommentChange . CommentChange , module$exports$Blockly$Events$CommentBase . CommentBase ) ;
module$exports$Blockly$Events$CommentChange . CommentChange . prototype . type = module$exports$Blockly$Events$utils . COMMENT _CHANGE ; module$exports$Blockly$Events$CommentChange . CommentChange . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$CommentChange . CommentChange . superClass _ . toJson . call ( this ) ; a . oldContents = this . oldContents _ ; a . newContents = this . newContents _ ; return a } ;
module$exports$Blockly$Events$CommentChange . CommentChange . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$CommentChange . CommentChange . superClass _ . fromJson . call ( this , a ) ; this . oldContents _ = a . oldContents ; this . newContents _ = a . newContents } ; module$exports$Blockly$Events$CommentChange . CommentChange . prototype . isNull = function ( ) { return this . oldContents _ === this . newContents _ } ;
module$exports$Blockly$Events$CommentChange . CommentChange . prototype . run = function ( a ) { var b = this . getEventWorkspace _ ( ) . getCommentById ( this . commentId ) ; b ? b . setContent ( a ? this . newContents _ : this . oldContents _ ) : console . warn ( "Can't change non-existent comment: " + this . commentId ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . COMMENT _CHANGE , module$exports$Blockly$Events$CommentChange . CommentChange ) ; var module$exports$Blockly$Events$CommentCreate = { CommentCreate : function ( a ) { module$exports$Blockly$Events$CommentCreate . CommentCreate . superClass _ . constructor . call ( this , a ) ; a && ( this . xml = a . toXmlWithXY ( ) ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$CommentCreate . CommentCreate , module$exports$Blockly$Events$CommentBase . CommentBase ) ; module$exports$Blockly$Events$CommentCreate . CommentCreate . prototype . type = module$exports$Blockly$Events$utils . COMMENT _CREATE ;
module$exports$Blockly$Events$CommentCreate . CommentCreate . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$CommentCreate . CommentCreate . superClass _ . toJson . call ( this ) ; a . xml = ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( this . xml ) ; return a } ; module$exports$Blockly$Events$CommentCreate . CommentCreate . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$CommentCreate . CommentCreate . superClass _ . fromJson . call ( this , a ) ; this . xml = ( 0 , $ . module$exports$Blockly$Xml . textToDom ) ( a . xml ) } ;
module$exports$Blockly$Events$CommentCreate . CommentCreate . prototype . run = function ( a ) { module$exports$Blockly$Events$CommentBase . CommentBase . CommentCreateDeleteHelper ( this , a ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . COMMENT _CREATE , module$exports$Blockly$Events$CommentCreate . CommentCreate ) ; var module$exports$Blockly$Events$CommentDelete = { CommentDelete : function ( a ) { module$exports$Blockly$Events$CommentDelete . CommentDelete . superClass _ . constructor . call ( this , a ) ; a && ( this . xml = a . toXmlWithXY ( ) ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$CommentDelete . CommentDelete , module$exports$Blockly$Events$CommentBase . CommentBase ) ; module$exports$Blockly$Events$CommentDelete . CommentDelete . prototype . type = module$exports$Blockly$Events$utils . COMMENT _DELETE ;
module$exports$Blockly$Events$CommentDelete . CommentDelete . prototype . toJson = function ( ) { return module$exports$Blockly$Events$CommentDelete . CommentDelete . superClass _ . toJson . call ( this ) } ; module$exports$Blockly$Events$CommentDelete . CommentDelete . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$CommentDelete . CommentDelete . superClass _ . fromJson . call ( this , a ) } ;
module$exports$Blockly$Events$CommentDelete . CommentDelete . prototype . run = function ( a ) { module$exports$Blockly$Events$CommentBase . CommentBase . CommentCreateDeleteHelper ( this , ! a ) } ; ( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . COMMENT _DELETE , module$exports$Blockly$Events$CommentDelete . CommentDelete ) ; var module$exports$Blockly$Events$TrashcanOpen = { TrashcanOpen : function ( a , b ) { module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen . superClass _ . constructor . call ( this , b ) ; this . isOpen = a } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen , module$exports$Blockly$Events$UiBase . UiBase ) ; module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen . prototype . type = module$exports$Blockly$Events$utils . TRASHCAN _OPEN ;
module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen . prototype . toJson = function ( ) { var a = module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen . superClass _ . toJson . call ( this ) ; a . isOpen = this . isOpen ; return a } ; module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen . prototype . fromJson = function ( a ) { module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen . superClass _ . fromJson . call ( this , a ) ; this . isOpen = a . isOpen } ;
( 0 , module$exports$Blockly$registry . register ) ( module$exports$Blockly$registry . Type . EVENT , module$exports$Blockly$Events$utils . TRASHCAN _OPEN , module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen ) ; $ . module$exports$Blockly$Events = { Abstract : module$exports$Blockly$Events$Abstract } ; $ . module$exports$Blockly$Events . BubbleOpen = module$exports$Blockly$Events$BubbleOpen . BubbleOpen ; $ . module$exports$Blockly$Events . BlockBase = module$exports$Blockly$Events$BlockBase . BlockBase ; $ . module$exports$Blockly$Events . BlockChange = module$exports$Blockly$Events$BlockChange . BlockChange ; $ . module$exports$Blockly$Events . BlockCreate = module$exports$Blockly$Events$BlockCreate . BlockCreate ;
$ . module$exports$Blockly$Events . BlockDelete = module$exports$Blockly$Events$BlockDelete . BlockDelete ; $ . module$exports$Blockly$Events . BlockDrag = module$exports$Blockly$Events$BlockDrag . BlockDrag ; $ . module$exports$Blockly$Events . BlockMove = module$exports$Blockly$Events$BlockMove . BlockMove ; $ . module$exports$Blockly$Events . Click = module$exports$Blockly$Events$Click . Click ; $ . module$exports$Blockly$Events . CommentBase = module$exports$Blockly$Events$CommentBase . CommentBase ;
$ . module$exports$Blockly$Events . CommentChange = module$exports$Blockly$Events$CommentChange . CommentChange ; $ . module$exports$Blockly$Events . CommentCreate = module$exports$Blockly$Events$CommentCreate . CommentCreate ; $ . module$exports$Blockly$Events . CommentDelete = module$exports$Blockly$Events$CommentDelete . CommentDelete ; $ . module$exports$Blockly$Events . CommentMove = module$exports$Blockly$Events$CommentMove . CommentMove ; $ . module$exports$Blockly$Events . FinishedLoading = module$exports$Blockly$Events$FinishedLoading . FinishedLoading ;
$ . module$exports$Blockly$Events . MarkerMove = module$exports$Blockly$Events$MarkerMove . MarkerMove ; $ . module$exports$Blockly$Events . Selected = module$exports$Blockly$Events$Selected . Selected ; $ . module$exports$Blockly$Events . ThemeChange = module$exports$Blockly$Events$ThemeChange . ThemeChange ; $ . module$exports$Blockly$Events . ToolboxItemSelect = module$exports$Blockly$Events$ToolboxItemSelect . ToolboxItemSelect ; $ . module$exports$Blockly$Events . TrashcanOpen = module$exports$Blockly$Events$TrashcanOpen . TrashcanOpen ;
$ . module$exports$Blockly$Events . Ui = module$exports$Blockly$Events$Ui . Ui ; $ . module$exports$Blockly$Events . UiBase = module$exports$Blockly$Events$UiBase . UiBase ; $ . module$exports$Blockly$Events . VarBase = module$exports$Blockly$Events$VarBase . VarBase ; $ . module$exports$Blockly$Events . VarCreate = module$exports$Blockly$Events$VarCreate . VarCreate ; $ . module$exports$Blockly$Events . VarDelete = module$exports$Blockly$Events$VarDelete . VarDelete ; $ . module$exports$Blockly$Events . VarRename = module$exports$Blockly$Events$VarRename . VarRename ;
$ . module$exports$Blockly$Events . ViewportChange = module$exports$Blockly$Events$ViewportChange . ViewportChange ; $ . module$exports$Blockly$Events . BLOCK _CHANGE = module$exports$Blockly$Events$utils . CHANGE ; $ . module$exports$Blockly$Events . BLOCK _CREATE = module$exports$Blockly$Events$utils . CREATE ; $ . module$exports$Blockly$Events . BLOCK _DELETE = module$exports$Blockly$Events$utils . DELETE ; $ . module$exports$Blockly$Events . BLOCK _DRAG = module$exports$Blockly$Events$utils . BLOCK _DRAG ;
$ . module$exports$Blockly$Events . BLOCK _MOVE = module$exports$Blockly$Events$utils . MOVE ; $ . module$exports$Blockly$Events . BUBBLE _OPEN = module$exports$Blockly$Events$utils . BUBBLE _OPEN ; $ . module$exports$Blockly$Events . BumpEvent = module$exports$Blockly$Events$utils . BumpEvent ; $ . module$exports$Blockly$Events . BUMP _EVENTS = module$exports$Blockly$Events$utils . BUMP _EVENTS ; $ . module$exports$Blockly$Events . CHANGE = module$exports$Blockly$Events$utils . CHANGE ; $ . module$exports$Blockly$Events . CLICK = module$exports$Blockly$Events$utils . CLICK ;
$ . module$exports$Blockly$Events . COMMENT _CHANGE = module$exports$Blockly$Events$utils . COMMENT _CHANGE ; $ . module$exports$Blockly$Events . COMMENT _CREATE = module$exports$Blockly$Events$utils . COMMENT _CREATE ; $ . module$exports$Blockly$Events . COMMENT _DELETE = module$exports$Blockly$Events$utils . COMMENT _DELETE ; $ . module$exports$Blockly$Events . COMMENT _MOVE = module$exports$Blockly$Events$utils . COMMENT _MOVE ; $ . module$exports$Blockly$Events . CREATE = module$exports$Blockly$Events$utils . CREATE ;
$ . module$exports$Blockly$Events . DELETE = module$exports$Blockly$Events$utils . DELETE ; $ . module$exports$Blockly$Events . FINISHED _LOADING = module$exports$Blockly$Events$utils . FINISHED _LOADING ; $ . module$exports$Blockly$Events . MARKER _MOVE = module$exports$Blockly$Events$utils . MARKER _MOVE ; $ . module$exports$Blockly$Events . MOVE = module$exports$Blockly$Events$utils . MOVE ; $ . module$exports$Blockly$Events . SELECTED = module$exports$Blockly$Events$utils . SELECTED ; $ . module$exports$Blockly$Events . THEME _CHANGE = module$exports$Blockly$Events$utils . THEME _CHANGE ;
$ . module$exports$Blockly$Events . TOOLBOX _ITEM _SELECT = module$exports$Blockly$Events$utils . TOOLBOX _ITEM _SELECT ; $ . module$exports$Blockly$Events . TRASHCAN _OPEN = module$exports$Blockly$Events$utils . TRASHCAN _OPEN ; $ . module$exports$Blockly$Events . UI = module$exports$Blockly$Events$utils . UI ; $ . module$exports$Blockly$Events . VAR _CREATE = module$exports$Blockly$Events$utils . VAR _CREATE ; $ . module$exports$Blockly$Events . VAR _DELETE = module$exports$Blockly$Events$utils . VAR _DELETE ;
$ . module$exports$Blockly$Events . VAR _RENAME = module$exports$Blockly$Events$utils . VAR _RENAME ; $ . module$exports$Blockly$Events . VIEWPORT _CHANGE = module$exports$Blockly$Events$utils . VIEWPORT _CHANGE ; $ . module$exports$Blockly$Events . clearPendingUndo = module$exports$Blockly$Events$utils . clearPendingUndo ; $ . module$exports$Blockly$Events . disable = module$exports$Blockly$Events$utils . disable ; $ . module$exports$Blockly$Events . enable = module$exports$Blockly$Events$utils . enable ; $ . module$exports$Blockly$Events . filter = module$exports$Blockly$Events$utils . filter ;
$ . module$exports$Blockly$Events . fire = module$exports$Blockly$Events$utils . fire ; $ . module$exports$Blockly$Events . fromJson = module$exports$Blockly$Events$utils . fromJson ; $ . module$exports$Blockly$Events . getDescendantIds = module$exports$Blockly$Events$utils . getDescendantIds ; $ . module$exports$Blockly$Events . get = module$exports$Blockly$Events$utils . get ; $ . module$exports$Blockly$Events . getGroup = module$exports$Blockly$Events$utils . getGroup ; $ . module$exports$Blockly$Events . getRecordUndo = module$exports$Blockly$Events$utils . getRecordUndo ;
$ . module$exports$Blockly$Events . isEnabled = module$exports$Blockly$Events$utils . isEnabled ; $ . module$exports$Blockly$Events . setGroup = module$exports$Blockly$Events$utils . setGroup ; $ . module$exports$Blockly$Events . setRecordUndo = module$exports$Blockly$Events$utils . setRecordUndo ; $ . module$exports$Blockly$Events . disableOrphans = module$exports$Blockly$Events$utils . disableOrphans ;
Object . defineProperties ( $ . module$exports$Blockly$Events , { recordUndo : { get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.Events.recordUndo" , "September 2021" , "September 2022" , "Blockly.Events.getRecordUndo()" ) ; return ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) } , set : function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.Events.recordUndo" , "September 2021" , "September 2022" , "Blockly.Events.setRecordUndo()" ) ; ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( a ) } } } ) ; var module$exports$Blockly$ContextMenuItems = { registerUndo : function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . UNDO } , preconditionFn : function ( a ) { return 0 < a . workspace . getUndoStack ( ) . length ? "enabled" : "disabled" } , callback : function ( a ) { a . workspace . undo ( ! 1 ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE , id : "undoWorkspace" , weight : 1 } ) } , registerRedo : function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . REDO } ,
preconditionFn : function ( a ) { return 0 < a . workspace . getRedoStack ( ) . length ? "enabled" : "disabled" } , callback : function ( a ) { a . workspace . undo ( ! 0 ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE , id : "redoWorkspace" , weight : 2 } ) } , registerCleanup : function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . CLEAN _UP } , preconditionFn : function ( a ) { return a . workspace . isMovable ( ) ? 1 <
a . workspace . getTopBlocks ( ! 1 ) . length ? "enabled" : "disabled" : "hidden" } , callback : function ( a ) { a . workspace . cleanUp ( ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE , id : "cleanWorkspace" , weight : 3 } ) } } , module$contents$Blockly$ContextMenuItems _toggleOption _ = function ( a , b ) { var c = 0 , d = 0 , e = function ( h ) { d -- ; h . setCollapsed ( a ) ; 0 === d && ( 0 , $ . module$exports$Blockly$Events . setGroup ) ( ! 1 ) } ; ( 0 , $ . module$exports$Blockly$Events . setGroup ) ( ! 0 ) ; for ( var f = 0 ; f < b . length ; f ++ ) for ( var g = b [ f ] ; g ; ) d ++ ,
setTimeout ( e . bind ( null , g ) , c ) , g = g . getNextBlock ( ) , c += 10 } ;
module$exports$Blockly$ContextMenuItems . registerCollapse = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . COLLAPSE _ALL } , preconditionFn : function ( a ) { if ( a . workspace . options . collapse ) { a = a . workspace . getTopBlocks ( ! 1 ) ; for ( var b = 0 ; b < a . length ; b ++ ) for ( var c = a [ b ] ; c ; ) { if ( ! c . isCollapsed ( ) ) return "enabled" ; c = c . getNextBlock ( ) } return "disabled" } return "hidden" } , callback : function ( a ) { module$contents$Blockly$ContextMenuItems _toggleOption _ ( ! 0 ,
a . workspace . getTopBlocks ( ! 0 ) ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE , id : "collapseWorkspace" , weight : 4 } ) } ;
module$exports$Blockly$ContextMenuItems . registerExpand = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . EXPAND _ALL } , preconditionFn : function ( a ) { if ( a . workspace . options . collapse ) { a = a . workspace . getTopBlocks ( ! 1 ) ; for ( var b = 0 ; b < a . length ; b ++ ) for ( var c = a [ b ] ; c ; ) { if ( c . isCollapsed ( ) ) return "enabled" ; c = c . getNextBlock ( ) } return "disabled" } return "hidden" } , callback : function ( a ) { module$contents$Blockly$ContextMenuItems _toggleOption _ ( ! 1 ,
a . workspace . getTopBlocks ( ! 0 ) ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE , id : "expandWorkspace" , weight : 5 } ) } ;
var module$contents$Blockly$ContextMenuItems _addDeletableBlocks _ = function ( a , b ) { if ( a . isDeletable ( ) ) Array . prototype . push . apply ( b , a . getDescendants ( ! 1 ) ) ; else { a = a . getChildren ( ! 1 ) ; for ( var c = 0 ; c < a . length ; c ++ ) module$contents$Blockly$ContextMenuItems _addDeletableBlocks _ ( a [ c ] , b ) } } , module$contents$Blockly$ContextMenuItems _getDeletableBlocks _ = function ( a ) { var b = [ ] ; a = a . getTopBlocks ( ! 0 ) ; for ( var c = 0 ; c < a . length ; c ++ ) module$contents$Blockly$ContextMenuItems _addDeletableBlocks _ ( a [ c ] , b ) ; return b } , module$contents$Blockly$ContextMenuItems _deleteNext _ =
function ( a , b ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( b ) ; var c = a . shift ( ) ; c && ( c . workspace ? ( c . dispose ( ! 1 , ! 0 ) , setTimeout ( module$contents$Blockly$ContextMenuItems _deleteNext _ , 10 , a , b ) ) : module$contents$Blockly$ContextMenuItems _deleteNext _ ( a , b ) ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } ;
module$exports$Blockly$ContextMenuItems . registerDeleteAll = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( a ) { if ( a . workspace ) return a = module$contents$Blockly$ContextMenuItems _getDeletableBlocks _ ( a . workspace ) . length , 1 === a ? $ . module$exports$Blockly$Msg . Msg . DELETE _BLOCK : $ . module$exports$Blockly$Msg . Msg . DELETE _X _BLOCKS . replace ( "%1" , String ( a ) ) } , preconditionFn : function ( a ) { if ( a . workspace ) return 0 < module$contents$Blockly$ContextMenuItems _getDeletableBlocks _ ( a . workspace ) . length ?
"enabled" : "disabled" } , callback : function ( a ) { if ( a . workspace ) { a . workspace . cancelCurrentGesture ( ) ; var b = module$contents$Blockly$ContextMenuItems _getDeletableBlocks _ ( a . workspace ) , c = ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; 2 > b . length ? module$contents$Blockly$ContextMenuItems _deleteNext _ ( b , c ) : ( 0 , module$exports$Blockly$dialog . confirm ) ( $ . module$exports$Blockly$Msg . Msg . DELETE _ALL _BLOCKS . replace ( "%1" , String ( b . length ) ) , function ( d ) { d && module$contents$Blockly$ContextMenuItems _deleteNext _ ( b , c ) } ) } } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . WORKSPACE ,
id : "workspaceDelete" , weight : 6 } ) } ; var module$contents$Blockly$ContextMenuItems _registerWorkspaceOptions _ = function ( ) { ( 0 , module$exports$Blockly$ContextMenuItems . registerUndo ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerRedo ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerCleanup ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerCollapse ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerExpand ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerDeleteAll ) ( ) } ;
module$exports$Blockly$ContextMenuItems . registerDuplicate = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . DUPLICATE _BLOCK } , preconditionFn : function ( a ) { a = a . block ; return ! a . isInFlyout && a . isDeletable ( ) && a . isMovable ( ) ? a . isDuplicatable ( ) ? "enabled" : "disabled" : "hidden" } , callback : function ( a ) { a . block && ( 0 , module$exports$Blockly$clipboard . duplicate ) ( a . block ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK ,
id : "blockDuplicate" , weight : 1 } ) } ;
module$exports$Blockly$ContextMenuItems . registerComment = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( a ) { return a . block . getCommentIcon ( ) ? $ . module$exports$Blockly$Msg . Msg . REMOVE _COMMENT : $ . module$exports$Blockly$Msg . Msg . ADD _COMMENT } , preconditionFn : function ( a ) { a = a . block ; return module$exports$Blockly$utils$userAgent . IE || a . isInFlyout || ! a . workspace . options . comments || a . isCollapsed ( ) || ! a . isEditable ( ) ? "hidden" : "enabled" } , callback : function ( a ) { a =
a . block ; a . getCommentIcon ( ) ? a . setCommentText ( null ) : a . setCommentText ( "" ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK , id : "blockComment" , weight : 2 } ) } ;
module$exports$Blockly$ContextMenuItems . registerInline = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( a ) { return a . block . getInputsInline ( ) ? $ . module$exports$Blockly$Msg . Msg . EXTERNAL _INPUTS : $ . module$exports$Blockly$Msg . Msg . INLINE _INPUTS } , preconditionFn : function ( a ) { a = a . block ; if ( ! a . isInFlyout && a . isMovable ( ) && ! a . isCollapsed ( ) ) for ( var b = 1 ; b < a . inputList . length ; b ++ ) if ( a . inputList [ b - 1 ] . type !== $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT &&
a . inputList [ b ] . type !== $ . module$exports$Blockly$inputTypes . inputTypes . STATEMENT ) return "enabled" ; return "hidden" } , callback : function ( a ) { a . block . setInputsInline ( ! a . block . getInputsInline ( ) ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK , id : "blockInline" , weight : 3 } ) } ;
module$exports$Blockly$ContextMenuItems . registerCollapseExpandBlock = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( a ) { return a . block . isCollapsed ( ) ? $ . module$exports$Blockly$Msg . Msg . EXPAND _BLOCK : $ . module$exports$Blockly$Msg . Msg . COLLAPSE _BLOCK } , preconditionFn : function ( a ) { a = a . block ; return ! a . isInFlyout && a . isMovable ( ) && a . workspace . options . collapse ? "enabled" : "hidden" } , callback : function ( a ) { a . block . setCollapsed ( ! a . block . isCollapsed ( ) ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK ,
id : "blockCollapseExpand" , weight : 4 } ) } ;
module$exports$Blockly$ContextMenuItems . registerDisable = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( a ) { return a . block . isEnabled ( ) ? $ . module$exports$Blockly$Msg . Msg . DISABLE _BLOCK : $ . module$exports$Blockly$Msg . Msg . ENABLE _BLOCK } , preconditionFn : function ( a ) { a = a . block ; return ! a . isInFlyout && a . workspace . options . disable && a . isEditable ( ) ? a . getInheritedDisabled ( ) ? "disabled" : "enabled" : "hidden" } , callback : function ( a ) { a = a . block ; var b = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ;
b || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; a . setEnabled ( ! a . isEnabled ( ) ) ; b || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK , id : "blockDisable" , weight : 5 } ) } ;
module$exports$Blockly$ContextMenuItems . registerDelete = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( a ) { var b = a . block ; a = b . getDescendants ( ! 1 ) . length ; ( b = b . getNextBlock ( ) ) && ( a -= b . getDescendants ( ! 1 ) . length ) ; return 1 === a ? $ . module$exports$Blockly$Msg . Msg . DELETE _BLOCK : $ . module$exports$Blockly$Msg . Msg . DELETE _X _BLOCKS . replace ( "%1" , String ( a ) ) } , preconditionFn : function ( a ) { return ! a . block . isInFlyout && a . block . isDeletable ( ) ? "enabled" : "hidden" } , callback : function ( a ) { a . block &&
a . block . checkAndDelete ( ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK , id : "blockDelete" , weight : 6 } ) } ;
module$exports$Blockly$ContextMenuItems . registerHelp = function ( ) { module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . registry . register ( { displayText : function ( ) { return $ . module$exports$Blockly$Msg . Msg . HELP } , preconditionFn : function ( a ) { a = a . block ; return ( "function" === typeof a . helpUrl ? a . helpUrl ( ) : a . helpUrl ) ? "enabled" : "hidden" } , callback : function ( a ) { a . block . showHelp ( ) } , scopeType : module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry . ScopeType . BLOCK , id : "blockHelp" , weight : 7 } ) } ;
var module$contents$Blockly$ContextMenuItems _registerBlockOptions _ = function ( ) { ( 0 , module$exports$Blockly$ContextMenuItems . registerDuplicate ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerComment ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerInline ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerCollapseExpandBlock ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerDisable ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerDelete ) ( ) ; ( 0 , module$exports$Blockly$ContextMenuItems . registerHelp ) ( ) } ;
module$exports$Blockly$ContextMenuItems . registerDefaultOptions = function ( ) { module$contents$Blockly$ContextMenuItems _registerWorkspaceOptions _ ( ) ; module$contents$Blockly$ContextMenuItems _registerBlockOptions _ ( ) } ; ( 0 , module$exports$Blockly$ContextMenuItems . registerDefaultOptions ) ( ) ; var module$exports$Blockly$Icon = { Icon : function ( a ) { this . block _ = a ; this . iconGroup _ = null } } ; module$exports$Blockly$Icon . Icon . prototype . collapseHidden = ! 0 ; module$exports$Blockly$Icon . Icon . prototype . SIZE = 17 ; module$exports$Blockly$Icon . Icon . prototype . bubble _ = null ; module$exports$Blockly$Icon . Icon . prototype . iconXY _ = null ;
module$exports$Blockly$Icon . Icon . prototype . createIcon = function ( ) { this . iconGroup _ || ( this . iconGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyIconGroup" } , null ) , this . block _ . isInFlyout && ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . iconGroup _ , "blocklyIconGroupReadonly" ) , this . drawIcon _ ( this . iconGroup _ ) , this . block _ . getSvgRoot ( ) . appendChild ( this . iconGroup _ ) , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . iconGroup _ , "mouseup" ,
this , this . iconClick _ ) , this . updateEditable ( ) ) } ; module$exports$Blockly$Icon . Icon . prototype . dispose = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . iconGroup _ ) ; this . iconGroup _ = null ; this . setVisible ( ! 1 ) ; this . block _ = null } ; module$exports$Blockly$Icon . Icon . prototype . updateEditable = function ( ) { } ; module$exports$Blockly$Icon . Icon . prototype . isVisible = function ( ) { return ! ! this . bubble _ } ;
module$exports$Blockly$Icon . Icon . prototype . iconClick _ = function ( a ) { this . block _ . workspace . isDragging ( ) || this . block _ . isInFlyout || ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) || this . setVisible ( ! this . isVisible ( ) ) } ; module$exports$Blockly$Icon . Icon . prototype . applyColour = function ( ) { this . isVisible ( ) && this . bubble _ . setColour ( this . block _ . style . colourPrimary ) } ; module$exports$Blockly$Icon . Icon . prototype . setIconLocation = function ( a ) { this . iconXY _ = a ; this . isVisible ( ) && this . bubble _ . setAnchorLocation ( a ) } ;
module$exports$Blockly$Icon . Icon . prototype . computeIconLocation = function ( ) { var a = this . block _ . getRelativeToSurfaceXY ( ) , b = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( this . iconGroup _ ) ; a = new module$exports$Blockly$utils$Coordinate . Coordinate ( a . x + b . x + this . SIZE / 2 , a . y + b . y + this . SIZE / 2 ) ; module$exports$Blockly$utils$Coordinate . Coordinate . equals ( this . getIconLocation ( ) , a ) || this . setIconLocation ( a ) } ; module$exports$Blockly$Icon . Icon . prototype . getIconLocation = function ( ) { return this . iconXY _ } ;
module$exports$Blockly$Icon . Icon . prototype . getCorrectedSize = function ( ) { return new module$exports$Blockly$utils$Size . Size ( module$exports$Blockly$Icon . Icon . prototype . SIZE , module$exports$Blockly$Icon . Icon . prototype . SIZE - 2 ) } ; var module$exports$Blockly$Warning = { Warning : function ( a ) { module$exports$Blockly$Warning . Warning . superClass _ . constructor . call ( this , a ) ; this . createIcon ( ) ; this . text _ = Object . create ( null ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Warning . Warning , module$exports$Blockly$Icon . Icon ) ; module$exports$Blockly$Warning . Warning . prototype . collapseHidden = ! 1 ;
module$exports$Blockly$Warning . Warning . prototype . drawIcon _ = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . 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" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyIconSymbol" , d : "m7,4.8v3.16l0.27,2.27h1.46l0.27,-2.27v-3.16z" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT ,
{ "class" : "blocklyIconSymbol" , x : "7" , y : "11" , height : "2" , width : "2" } , a ) } ; module$exports$Blockly$Warning . Warning . prototype . setVisible = function ( a ) { a !== this . isVisible ( ) && ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . BUBBLE _OPEN ) ) ( this . block _ , a , "warning" ) ) , a ? this . createBubble _ ( ) : this . disposeBubble _ ( ) ) } ;
module$exports$Blockly$Warning . Warning . prototype . createBubble _ = function ( ) { this . paragraphElement _ = module$exports$Blockly$Bubble . Bubble . textToDom ( this . getText ( ) ) ; this . bubble _ = module$exports$Blockly$Bubble . Bubble . createNonEditableBubble ( this . paragraphElement _ , this . block _ , this . iconXY _ ) ; this . applyColour ( ) } ; module$exports$Blockly$Warning . Warning . prototype . disposeBubble _ = function ( ) { this . bubble _ . dispose ( ) ; this . paragraphElement _ = this . bubble _ = null } ;
module$exports$Blockly$Warning . Warning . prototype . setText = function ( a , b ) { this . text _ [ b ] !== a && ( a ? this . text _ [ b ] = a : delete this . text _ [ b ] , this . isVisible ( ) && ( this . setVisible ( ! 1 ) , this . setVisible ( ! 0 ) ) ) } ; module$exports$Blockly$Warning . Warning . prototype . getText = function ( ) { var a = [ ] , b ; for ( b in this . text _ ) a . push ( this . text _ [ b ] ) ; return a . join ( "\n" ) } ; module$exports$Blockly$Warning . Warning . prototype . dispose = function ( ) { this . block _ . warning = null ; module$exports$Blockly$Icon . Icon . prototype . dispose . call ( this ) } ; var module$exports$Blockly$Comment = { Comment : function ( a ) { module$exports$Blockly$Comment . Comment . superClass _ . constructor . call ( this , a ) ; this . model _ = a . commentModel ; this . model _ . text = this . model _ . text || "" ; this . cachedText _ = "" ; this . onInputWrapper _ = this . onChangeWrapper _ = this . onWheelWrapper _ = this . onMouseUpWrapper _ = null ; this . createIcon ( ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Comment . Comment , module$exports$Blockly$Icon . Icon ) ;
module$exports$Blockly$Comment . Comment . prototype . drawIcon _ = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { "class" : "blocklyIconShape" , r : "8" , cx : "8" , cy : "8" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . PATH , { "class" : "blocklyIconSymbol" , d : "m6.8,10h2c0.003,-0.617 0.271,-0.962 0.633,-1.266 2.875,-2.4050.607,-5.534 -3.765,-3.874v1.7c3.12,-1.657 3.698,0.118 2.336,1.25-1.201,0.998 -1.201,1.528 -1.204,2.19z" } ,
a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyIconSymbol" , x : "6.8" , y : "10.78" , height : "2" , width : "2" } , a ) } ;
module$exports$Blockly$Comment . Comment . prototype . createEditor _ = function ( ) { this . foreignObject _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FOREIGNOBJECT , { x : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH , y : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH } , null ) ; var a = document . createElementNS ( module$exports$Blockly$utils$dom . HTML _NS , "body" ) ; a . setAttribute ( "xmlns" , module$exports$Blockly$utils$dom . HTML _NS ) ; a . className = "blocklyMinimalBody" ; var b = this . textarea _ =
document . createElementNS ( module$exports$Blockly$utils$dom . HTML _NS , "textarea" ) ; b . className = "blocklyCommentTextarea" ; b . setAttribute ( "dir" , this . block _ . RTL ? "RTL" : "LTR" ) ; b . value = this . model _ . text ; this . resizeTextarea _ ( ) ; a . appendChild ( b ) ; this . foreignObject _ . appendChild ( a ) ; this . onMouseUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "mouseup" , this , this . startEdit _ , ! 0 , ! 0 ) ; this . onWheelWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "wheel" , this , function ( c ) { c . stopPropagation ( ) } ) ;
this . onChangeWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "change" , this , function ( c ) { this . cachedText _ !== this . model _ . text && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( this . block _ , "comment" , null , this . cachedText _ , this . model _ . text ) ) } ) ; this . onInputWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "input" , this , function ( c ) { this . model _ . text = b . value } ) ; setTimeout ( b . focus . bind ( b ) ,
0 ) ; return this . foreignObject _ } ; module$exports$Blockly$Comment . Comment . prototype . updateEditable = function ( ) { module$exports$Blockly$Comment . Comment . superClass _ . updateEditable . call ( this ) ; this . isVisible ( ) && ( this . disposeBubble _ ( ) , this . createBubble _ ( ) ) } ; module$exports$Blockly$Comment . Comment . prototype . onBubbleResize _ = function ( ) { this . isVisible ( ) && ( this . model _ . size = this . bubble _ . getBubbleSize ( ) , this . resizeTextarea _ ( ) ) } ;
module$exports$Blockly$Comment . Comment . prototype . resizeTextarea _ = function ( ) { var a = this . model _ . size , b = 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH , c = a . width - b ; a = a . height - b ; this . foreignObject _ . setAttribute ( "width" , c ) ; this . foreignObject _ . setAttribute ( "height" , a ) ; this . textarea _ . style . width = c - 4 + "px" ; this . textarea _ . style . height = a - 4 + "px" } ;
module$exports$Blockly$Comment . Comment . prototype . setVisible = function ( a ) { a !== this . isVisible ( ) && ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . BUBBLE _OPEN ) ) ( this . block _ , a , "comment" ) ) , ( this . model _ . pinned = a ) ? this . createBubble _ ( ) : this . disposeBubble _ ( ) ) } ;
module$exports$Blockly$Comment . Comment . prototype . createBubble _ = function ( ) { ! this . block _ . isEditable ( ) || module$exports$Blockly$utils$userAgent . IE ? this . createNonEditableBubble _ ( ) : this . createEditableBubble _ ( ) } ;
module$exports$Blockly$Comment . Comment . prototype . createEditableBubble _ = function ( ) { this . bubble _ = new module$exports$Blockly$Bubble . Bubble ( this . block _ . workspace , this . createEditor _ ( ) , this . block _ . pathObject . svgPath , this . iconXY _ , this . model _ . size . width , this . model _ . size . height ) ; this . bubble _ . setSvgId ( this . block _ . id ) ; this . bubble _ . registerResizeEvent ( this . onBubbleResize _ . bind ( this ) ) ; this . applyColour ( ) } ;
module$exports$Blockly$Comment . Comment . prototype . createNonEditableBubble _ = function ( ) { this . paragraphElement _ = module$exports$Blockly$Bubble . Bubble . textToDom ( this . block _ . getCommentText ( ) ) ; this . bubble _ = module$exports$Blockly$Bubble . Bubble . createNonEditableBubble ( this . paragraphElement _ , this . block _ , this . iconXY _ ) ; this . applyColour ( ) } ;
module$exports$Blockly$Comment . Comment . prototype . disposeBubble _ = function ( ) { this . onMouseUpWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseUpWrapper _ ) , this . onMouseUpWrapper _ = null ) ; this . onWheelWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onWheelWrapper _ ) , this . onWheelWrapper _ = null ) ; this . onChangeWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onChangeWrapper _ ) , this . onChangeWrapper _ = null ) ; this . onInputWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onInputWrapper _ ) ,
this . onInputWrapper _ = null ) ; this . bubble _ . dispose ( ) ; this . paragraphElement _ = this . foreignObject _ = this . textarea _ = this . bubble _ = null } ; module$exports$Blockly$Comment . Comment . prototype . startEdit _ = function ( a ) { this . bubble _ . promote ( ) && this . textarea _ . focus ( ) ; this . cachedText _ = this . model _ . text } ; module$exports$Blockly$Comment . Comment . prototype . getBubbleSize = function ( ) { return this . model _ . size } ;
module$exports$Blockly$Comment . Comment . prototype . setBubbleSize = function ( a , b ) { this . bubble _ ? this . bubble _ . setBubbleSize ( a , b ) : ( this . model _ . size . width = a , this . model _ . size . height = b ) } ; module$exports$Blockly$Comment . Comment . prototype . updateText = function ( ) { this . textarea _ ? this . textarea _ . value = this . model _ . text : this . paragraphElement _ && ( this . paragraphElement _ . firstChild . textContent = this . model _ . text ) } ; module$exports$Blockly$Comment . Comment . prototype . dispose = function ( ) { this . block _ . comment = null ; module$exports$Blockly$Icon . Icon . prototype . dispose . call ( this ) } ;
( 0 , module$exports$Blockly$Css . register ) ( "\n .blocklyCommentTextarea {\n background-color: #fef49c;\n border: 0;\n display: block;\n margin: 0;\n outline: 0;\n padding: 3px;\n resize: none;\n text-overflow: hidden;\n }\n" ) ; var module$exports$Blockly$uiPosition = { verticalPosition : { TOP : 0 , BOTTOM : 1 } , horizontalPosition : { LEFT : 0 , RIGHT : 1 } , bumpDirection : { UP : 0 , DOWN : 1 } , getStartPositionRect : function ( a , b , c , d , e , f ) { var g = f . scrollbar && f . scrollbar . canScrollVertically ( ) ; a . horizontal === module$exports$Blockly$uiPosition . horizontalPosition . LEFT ? ( c = e . absoluteMetrics . left + c , g && f . RTL && ( c += module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ) ) : ( c = e . absoluteMetrics . left + e . viewMetrics . width - b . width - c , g && ! f . RTL && ( c -= module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ) ) ;
a . vertical === module$exports$Blockly$uiPosition . verticalPosition . TOP ? a = e . absoluteMetrics . top + d : ( a = e . absoluteMetrics . top + e . viewMetrics . height - b . height - d , f . scrollbar && f . scrollbar . canScrollHorizontally ( ) && ( a -= module$exports$Blockly$Scrollbar . Scrollbar . scrollbarThickness ) ) ; return new module$exports$Blockly$utils$Rect . Rect ( a , a + b . height , c , c + b . width ) } , getCornerOppositeToolbox : function ( a , b ) { return { horizontal : b . toolboxMetrics . position === module$exports$Blockly$utils$toolbox . Position . LEFT || a . horizontalLayout &&
! a . RTL ? module$exports$Blockly$uiPosition . horizontalPosition . RIGHT : module$exports$Blockly$uiPosition . horizontalPosition . LEFT , vertical : b . toolboxMetrics . position === module$exports$Blockly$utils$toolbox . Position . BOTTOM ? module$exports$Blockly$uiPosition . verticalPosition . TOP : module$exports$Blockly$uiPosition . verticalPosition . BOTTOM } } , bumpPositionRect : function ( a , b , c , d ) { for ( var e = a . left , f = a . right - a . left , g = a . bottom - a . top , h = 0 ; h < d . length ; h ++ ) { var k = d [ h ] ; a . intersects ( k ) && ( a = c === module$exports$Blockly$uiPosition . bumpDirection . UP ?
k . top - g - b : k . bottom + b , a = new module$exports$Blockly$utils$Rect . Rect ( a , a + g , e , e + f ) , h = - 1 ) } return a } } ; var module$exports$Blockly$IPositionable = { IPositionable : function ( ) { } } ; var module$exports$Blockly$ZoomControls = { ZoomControls : function ( a ) { this . workspace _ = a ; this . id = "zoomControls" ; this . zoomResetGroup _ = this . zoomOutGroup _ = this . zoomInGroup _ = this . onZoomOutWrapper _ = this . onZoomInWrapper _ = this . onZoomResetWrapper _ = null } } ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . WIDTH _ = 32 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . HEIGHT _ = 32 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . SMALL _SPACING _ = 2 ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . LARGE _SPACING _ = 11 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . MARGIN _VERTICAL _ = 20 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . MARGIN _HORIZONTAL _ = 20 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . svgGroup _ = null ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . left _ = 0 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . top _ = 0 ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . initialized _ = ! 1 ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . createDom = function ( ) { this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { } , null ) ; var a = String ( Math . random ( ) ) . substring ( 2 ) ; this . createZoomOutSvg _ ( a ) ; this . createZoomInSvg _ ( a ) ; this . workspace _ . isMovable ( ) && this . createZoomResetSvg _ ( a ) ; return this . svgGroup _ } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . init = function ( ) { this . workspace _ . getComponentManager ( ) . addComponent ( { component : this , weight : 2 , capabilities : [ module$exports$Blockly$ComponentManager . ComponentManager . Capability . POSITIONABLE ] } ) ; this . initialized _ = ! 0 } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . dispose = function ( ) { this . workspace _ . getComponentManager ( ) . removeComponent ( "zoomControls" ) ; this . svgGroup _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) ; this . onZoomResetWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onZoomResetWrapper _ ) ; this . onZoomInWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onZoomInWrapper _ ) ; this . onZoomOutWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onZoomOutWrapper _ ) } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . getBoundingRectangle = function ( ) { var a = this . SMALL _SPACING _ + 2 * this . HEIGHT _ ; this . zoomResetGroup _ && ( a += this . LARGE _SPACING _ + this . HEIGHT _ ) ; return new module$exports$Blockly$utils$Rect . Rect ( this . top _ , this . top _ + a , this . left _ , this . left _ + this . WIDTH _ ) } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . position = function ( a , b ) { if ( this . initialized _ ) { var c = ( 0 , module$exports$Blockly$uiPosition . getCornerOppositeToolbox ) ( this . workspace _ , a ) , d = this . SMALL _SPACING _ + 2 * this . HEIGHT _ ; this . zoomResetGroup _ && ( d += this . LARGE _SPACING _ + this . HEIGHT _ ) ; a = ( 0 , module$exports$Blockly$uiPosition . getStartPositionRect ) ( c , new module$exports$Blockly$utils$Size . Size ( this . WIDTH _ , d ) , this . MARGIN _HORIZONTAL _ , this . MARGIN _VERTICAL _ , a , this . workspace _ ) ; c = c . vertical ; b = ( 0 , module$exports$Blockly$uiPosition . bumpPositionRect ) ( a ,
this . MARGIN _VERTICAL _ , c === module$exports$Blockly$uiPosition . verticalPosition . TOP ? module$exports$Blockly$uiPosition . bumpDirection . DOWN : module$exports$Blockly$uiPosition . bumpDirection . UP , b ) ; c === module$exports$Blockly$uiPosition . verticalPosition . TOP ? ( c = this . SMALL _SPACING _ + this . HEIGHT _ , this . zoomInGroup _ . setAttribute ( "transform" , "translate(0, " + c + ")" ) , this . zoomResetGroup _ && this . zoomResetGroup _ . setAttribute ( "transform" , "translate(0, " + ( c + this . LARGE _SPACING _ + this . HEIGHT _ ) + ")" ) ) : ( c = this . zoomResetGroup _ ? this . LARGE _SPACING _ +
this . HEIGHT _ : 0 , this . zoomInGroup _ . setAttribute ( "transform" , "translate(0, " + c + ")" ) , this . zoomOutGroup _ . setAttribute ( "transform" , "translate(0, " + ( c + this . SMALL _SPACING _ + this . HEIGHT _ ) + ")" ) ) ; this . top _ = b . top ; this . left _ = b . left ; this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . left _ + "," + this . top _ + ")" ) } } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . createZoomOutSvg _ = function ( a ) { this . zoomOutGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyZoom" } , this . svgGroup _ ) ; var b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CLIPPATH , { id : "blocklyZoomoutClipPath" + a } , this . zoomOutGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { width : 32 ,
height : 32 } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { width : $ . module$exports$Blockly$internalConstants . SPRITE . width , height : $ . module$exports$Blockly$internalConstants . SPRITE . height , x : - 64 , y : - 92 , "clip-path" : "url(#blocklyZoomoutClipPath" + a + ")" } , this . zoomOutGroup _ ) . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . workspace _ . options . pathToMedia + $ . module$exports$Blockly$internalConstants . SPRITE . url ) ; this . onZoomOutWrapper _ =
( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . zoomOutGroup _ , "mousedown" , null , this . zoom _ . bind ( this , - 1 ) ) } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . createZoomInSvg _ = function ( a ) { this . zoomInGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyZoom" } , this . svgGroup _ ) ; var b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CLIPPATH , { id : "blocklyZoominClipPath" + a } , this . zoomInGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { width : 32 ,
height : 32 } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { width : $ . module$exports$Blockly$internalConstants . SPRITE . width , height : $ . module$exports$Blockly$internalConstants . SPRITE . height , x : - 32 , y : - 92 , "clip-path" : "url(#blocklyZoominClipPath" + a + ")" } , this . zoomInGroup _ ) . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . workspace _ . options . pathToMedia + $ . module$exports$Blockly$internalConstants . SPRITE . url ) ; this . onZoomInWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . zoomInGroup _ ,
"mousedown" , null , this . zoom _ . bind ( this , 1 ) ) } ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . zoom _ = function ( a , b ) { this . workspace _ . markFocused ( ) ; this . workspace _ . zoomCenter ( a ) ; this . fireZoomEvent _ ( ) ; ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ; b . stopPropagation ( ) ; b . preventDefault ( ) } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . createZoomResetSvg _ = function ( a ) { this . zoomResetGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyZoom" } , this . svgGroup _ ) ; var b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CLIPPATH , { id : "blocklyZoomresetClipPath" + a } , this . zoomResetGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT ,
{ width : 32 , height : 32 } , b ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { width : $ . module$exports$Blockly$internalConstants . SPRITE . width , height : $ . module$exports$Blockly$internalConstants . SPRITE . height , y : - 92 , "clip-path" : "url(#blocklyZoomresetClipPath" + a + ")" } , this . zoomResetGroup _ ) . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . workspace _ . options . pathToMedia + $ . module$exports$Blockly$internalConstants . SPRITE . url ) ; this . onZoomResetWrapper _ =
( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . zoomResetGroup _ , "mousedown" , null , this . resetZoom _ . bind ( this ) ) } ;
module$exports$Blockly$ZoomControls . ZoomControls . prototype . resetZoom _ = function ( a ) { this . workspace _ . markFocused ( ) ; var b = Math . log ( this . workspace _ . options . zoomOptions . startScale / this . workspace _ . scale ) / Math . log ( this . workspace _ . options . zoomOptions . scaleSpeed ) ; this . workspace _ . beginCanvasTransition ( ) ; this . workspace _ . zoomCenter ( b ) ; this . workspace _ . scrollCenter ( ) ; setTimeout ( this . workspace _ . endCanvasTransition . bind ( this . workspace _ ) , 500 ) ; this . fireZoomEvent _ ( ) ; ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ;
a . stopPropagation ( ) ; a . preventDefault ( ) } ; module$exports$Blockly$ZoomControls . ZoomControls . prototype . fireZoomEvent _ = function ( ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CLICK ) ) ( null , this . workspace _ . id , "zoom_controls" ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ; ( 0 , module$exports$Blockly$Css . register ) ( "\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$exports$Blockly$WorkspaceComment = { WorkspaceComment : function ( a , b , c , d , e ) { this . id = e && ! a . getCommentById ( e ) ? e : ( 0 , module$exports$Blockly$utils$idGenerator . genUid ) ( ) ; a . addTopComment ( this ) ; this . xy _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; this . height _ = c ; this . width _ = d ; this . workspace = a ; this . RTL = a . RTL ; this . editable _ = this . movable _ = this . deletable _ = ! 0 ; this . content _ = b ; this . disposed _ = ! 1 ; this . isComment = ! 0 ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . fireCreateEvent ( this ) } } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . dispose = function ( ) { this . disposed _ || ( ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _DELETE ) ) ( this ) ) , this . workspace . removeTopComment ( this ) , this . disposed _ = ! 0 ) } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . getHeight = function ( ) { return this . height _ } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . setHeight = function ( a ) { this . height _ = a } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . getWidth = function ( ) { return this . width _ } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . setWidth = function ( a ) { this . width _ = a } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . getXY = function ( ) { return new module$exports$Blockly$utils$Coordinate . Coordinate ( this . xy _ . x , this . xy _ . y ) } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . moveBy = function ( a , b ) { var c = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _MOVE ) ) ( this ) ; this . xy _ . translate ( a , b ) ; c . recordNew ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( c ) } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . isDeletable = function ( ) { return this . deletable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . setDeletable = function ( a ) { this . deletable _ = a } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . isMovable = function ( ) { return this . movable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . setMovable = function ( a ) { this . movable _ = a } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . isEditable = function ( ) { return this . editable _ && ! ( this . workspace && this . workspace . options . readOnly ) } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . setEditable = function ( a ) { this . editable _ = a } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . getContent = function ( ) { return this . content _ } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . setContent = function ( a ) { this . content _ !== a && ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _CHANGE ) ) ( this , this . content _ , a ) ) , this . content _ = a ) } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . toXmlWithXY = function ( a ) { a = this . toXml ( a ) ; a . setAttribute ( "x" , Math . round ( this . xy _ . x ) ) ; a . setAttribute ( "y" , Math . round ( this . xy _ . y ) ) ; a . setAttribute ( "h" , this . height _ ) ; a . setAttribute ( "w" , this . width _ ) ; return a } ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . prototype . toXml = function ( a ) { var b = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "comment" ) ; a || ( b . id = this . id ) ; b . textContent = this . getContent ( ) ; return b } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . fireCreateEvent = function ( a ) { if ( ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) ) { var b = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; b || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; try { ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _CREATE ) ) ( a ) ) } finally { b || ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } } } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . fromXml = function ( a , b ) { var c = module$exports$Blockly$WorkspaceComment . WorkspaceComment . parseAttributes ( a ) ; b = new module$exports$Blockly$WorkspaceComment . WorkspaceComment ( b , c . content , c . h , c . w , c . id ) ; c = parseInt ( a . getAttribute ( "x" ) , 10 ) ; a = parseInt ( a . getAttribute ( "y" ) , 10 ) ; isNaN ( c ) || isNaN ( a ) || b . moveBy ( c , a ) ; module$exports$Blockly$WorkspaceComment . WorkspaceComment . fireCreateEvent ( b ) ; return b } ;
module$exports$Blockly$WorkspaceComment . WorkspaceComment . parseAttributes = function ( a ) { var b = a . getAttribute ( "h" ) , c = a . getAttribute ( "w" ) ; return { id : a . getAttribute ( "id" ) , h : b ? parseInt ( b , 10 ) : 100 , w : c ? parseInt ( c , 10 ) : 100 , x : parseInt ( a . getAttribute ( "x" ) , 10 ) , y : parseInt ( a . getAttribute ( "y" ) , 10 ) , content : a . textContent } } ; var module$exports$Blockly$WorkspaceCommentSvg = { } , module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE = 8 , module$contents$Blockly$WorkspaceCommentSvg _BORDER _RADIUS = 3 , module$contents$Blockly$WorkspaceCommentSvg _TEXTAREA _OFFSET = 2 ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg = function ( a , b , c , d , e ) { this . onMouseMoveWrapper _ = this . onMouseUpWrapper _ = null ; this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyComment" } , null ) ; this . svgGroup _ . translate _ = "" ; this . svgRect _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyCommentRect" , x : 0 , y : 0 , rx : module$contents$Blockly$WorkspaceCommentSvg _BORDER _RADIUS ,
ry : module$contents$Blockly$WorkspaceCommentSvg _BORDER _RADIUS } ) ; this . svgGroup _ . appendChild ( this . svgRect _ ) ; this . rendered _ = ! 1 ; this . useDragSurface _ = ( 0 , module$exports$Blockly$utils$svgMath . is3dSupported ) ( ) && ! ! a . getBlockDragSurface ( ) ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . superClass _ . constructor . call ( this , a , b , c , d , e ) ; this . render ( ) } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg , module$exports$Blockly$WorkspaceComment . WorkspaceComment ) ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . DEFAULT _SIZE = 100 ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . TOP _OFFSET = 10 ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . dispose = function ( ) { this . disposed _ || ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) === this && ( this . unselect ( ) , this . workspace . cancelCurrentGesture ( ) ) , ( 0 , module$exports$Blockly$Events$utils . isEnabled ) ( ) && ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _DELETE ) ) ( this ) ) , ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) , this . disposeInternal _ ( ) ,
( 0 , module$exports$Blockly$Events$utils . disable ) ( ) , module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . superClass _ . dispose . call ( this ) , ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . initSvg = function ( a ) { if ( ! this . workspace . rendered ) throw TypeError ( "Workspace is headless." ) ; this . workspace . options . readOnly || this . eventsInit _ || ( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgRectTarget _ , "mousedown" , this , this . pathMouseDown _ ) , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgHandleTarget _ , "mousedown" , this , this . pathMouseDown _ ) ) ; this . eventsInit _ = ! 0 ; this . updateMovable ( ) ; this . getSvgRoot ( ) . parentNode ||
this . workspace . getBubbleCanvas ( ) . appendChild ( this . getSvgRoot ( ) ) ; ! a && this . textarea _ && this . textarea _ . select ( ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . pathMouseDown _ = function ( a ) { var b = this . workspace . getGesture ( a ) ; b && b . handleBubbleStart ( a , this ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . showContextMenu = function ( a ) { if ( ! this . workspace . options . readOnly ) { var b = [ ] ; this . isDeletable ( ) && this . isMovable ( ) && ( b . push ( ( 0 , $ . module$exports$Blockly$ContextMenu . commentDuplicateOption ) ( this ) ) , b . push ( ( 0 , $ . module$exports$Blockly$ContextMenu . commentDeleteOption ) ( this ) ) ) ; ( 0 , $ . module$exports$Blockly$ContextMenu . show ) ( a , b , this . RTL ) } } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . select = function ( ) { if ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) !== this ) { var a = null ; if ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) ) { a = ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . id ; ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) . unselect ( ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } } a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . SELECTED ) ) ( a ,
this . id , this . workspace . id ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) ; ( 0 , $ . module$exports$Blockly$common . setSelected ) ( this ) ; this . addSelect ( ) } } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . unselect = function ( ) { if ( ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) === this ) { var a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . SELECTED ) ) ( this . id , null , this . workspace . id ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) ; ( 0 , $ . module$exports$Blockly$common . setSelected ) ( null ) ; this . removeSelect ( ) ; this . blurFocus ( ) } } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . addSelect = function ( ) { ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgGroup _ , "blocklySelected" ) ; this . setFocus ( ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . removeSelect = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgGroup _ , "blocklySelected" ) ; this . blurFocus ( ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . addFocus = function ( ) { ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgGroup _ , "blocklyFocused" ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . removeFocus = function ( ) { ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgGroup _ , "blocklyFocused" ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . getRelativeToSurfaceXY = function ( ) { var a = 0 , b = 0 , c = this . useDragSurface _ ? this . workspace . getBlockDragSurface ( ) . getGroup ( ) : null , d = this . getSvgRoot ( ) ; if ( d ) { do { var e = ( 0 , module$exports$Blockly$utils$svgMath . getRelativeXY ) ( d ) ; a += e . x ; b += e . y ; this . useDragSurface _ && this . workspace . getBlockDragSurface ( ) . getCurrentBlock ( ) === d && ( e = this . workspace . getBlockDragSurface ( ) . getSurfaceTranslation ( ) , a += e . x , b += e . y ) ; d = d . parentNode } while ( d && d !== this . workspace . getBubbleCanvas ( ) &&
d !== c ) } return this . xy _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( a , b ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . moveBy = function ( a , b ) { var c = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . COMMENT _MOVE ) ) ( this ) , d = this . getRelativeToSurfaceXY ( ) ; this . translate ( d . x + a , d . y + b ) ; this . xy _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( d . x + a , d . y + b ) ; c . recordNew ( ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( c ) ; this . workspace . resizeContents ( ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . translate = function ( a , b ) { this . xy _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( a , b ) ; this . getSvgRoot ( ) . setAttribute ( "transform" , "translate(" + a + "," + b + ")" ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . moveToDragSurface = function ( ) { if ( this . useDragSurface _ ) { var a = this . getRelativeToSurfaceXY ( ) ; this . clearTransformAttributes _ ( ) ; this . workspace . getBlockDragSurface ( ) . translateSurface ( a . x , a . y ) ; this . workspace . getBlockDragSurface ( ) . setBlocksAndShow ( this . getSvgRoot ( ) ) } } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . moveDuringDrag = function ( a , b ) { a ? a . translateSurface ( b . x , b . y ) : ( this . svgGroup _ . translate _ = "translate(" + b . x + "," + b . y + ")" , this . svgGroup _ . setAttribute ( "transform" , this . svgGroup _ . translate _ + this . svgGroup _ . skew _ ) ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . moveTo = function ( a , b ) { this . translate ( a , b ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . clearTransformAttributes _ = function ( ) { this . getSvgRoot ( ) . removeAttribute ( "transform" ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . getBoundingRectangle = function ( ) { var a = this . getRelativeToSurfaceXY ( ) , b = this . getHeightWidth ( ) , c = a . y , d = a . y + b . height ; if ( this . RTL ) { var e = a . x - b . width ; a = a . x } else e = a . x , a = a . x + b . width ; return new module$exports$Blockly$utils$Rect . Rect ( c , d , e , a ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . updateMovable = function ( ) { this . isMovable ( ) ? ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgGroup _ , "blocklyDraggable" ) : ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgGroup _ , "blocklyDraggable" ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setMovable = function ( a ) { module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . superClass _ . setMovable . call ( this , a ) ; this . updateMovable ( ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setEditable = function ( a ) { module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . superClass _ . setEditable . call ( this , a ) ; this . textarea _ && ( this . textarea _ . readOnly = ! a ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setDragging = function ( a ) { a ? ( a = this . getSvgRoot ( ) , a . translate _ = "" , a . skew _ = "" , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgGroup _ , "blocklyDragging" ) ) : ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgGroup _ , "blocklyDragging" ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . getSvgRoot = function ( ) { return this . svgGroup _ } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . getContent = function ( ) { return this . textarea _ ? this . textarea _ . value : this . content _ } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setContent = function ( a ) { module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . superClass _ . setContent . call ( this , a ) ; this . textarea _ && ( this . textarea _ . value = a ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setDeleteStyle = function ( a ) { a ? ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . svgGroup _ , "blocklyDraggingDelete" ) : ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . svgGroup _ , "blocklyDraggingDelete" ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setAutoLayout = function ( a ) { } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . fromXml = function ( a , b , c ) { ( 0 , module$exports$Blockly$Events$utils . disable ) ( ) ; try { var d = module$exports$Blockly$WorkspaceComment . WorkspaceComment . parseAttributes ( a ) ; var e = new module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg ( b , d . content , d . h , d . w , d . id ) ; b . rendered && ( e . initSvg ( ! 0 ) , e . render ( ) ) ; if ( ! isNaN ( d . x ) && ! isNaN ( d . y ) ) if ( b . RTL ) { var f = c || b . getWidth ( ) ; e . moveBy ( f - d . x , d . y ) } else e . moveBy ( d . x , d . y ) } finally { ( 0 , module$exports$Blockly$Events$utils . enable ) ( ) } module$exports$Blockly$WorkspaceComment . WorkspaceComment . fireCreateEvent ( e ) ;
return e } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . toXmlWithXY = function ( a ) { var b ; this . workspace . RTL && ( b = this . workspace . getWidth ( ) ) ; a = this . toXml ( a ) ; var c = this . getRelativeToSurfaceXY ( ) ; a . setAttribute ( "x" , Math . round ( this . workspace . RTL ? b - c . x : c . x ) ) ; a . setAttribute ( "y" , Math . round ( c . y ) ) ; a . setAttribute ( "h" , this . getHeight ( ) ) ; a . setAttribute ( "w" , this . getWidth ( ) ) ; return a } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . toCopyData = function ( ) { return { saveInfo : this . toXmlWithXY ( ) , source : this . workspace , typeCounts : null } } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . getHeightWidth = function ( ) { return { width : this . getWidth ( ) , height : this . getHeight ( ) } } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . render = function ( ) { if ( ! this . rendered _ ) { var a = this . getHeightWidth ( ) ; this . createEditor _ ( ) ; this . svgGroup _ . appendChild ( this . foreignObject _ ) ; this . svgHandleTarget _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyCommentHandleTarget" , x : 0 , y : 0 } ) ; this . svgGroup _ . appendChild ( this . svgHandleTarget _ ) ; this . svgRectTarget _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT ,
{ "class" : "blocklyCommentTarget" , x : 0 , y : 0 , rx : module$contents$Blockly$WorkspaceCommentSvg _BORDER _RADIUS , ry : module$contents$Blockly$WorkspaceCommentSvg _BORDER _RADIUS } ) ; this . svgGroup _ . appendChild ( this . svgRectTarget _ ) ; this . addResizeDom _ ( ) ; this . isDeletable ( ) && this . addDeleteDom _ ( ) ; this . setSize _ ( a . width , a . height ) ; this . textarea _ . value = this . content _ ; this . rendered _ = ! 0 ; this . resizeGroup _ && ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . resizeGroup _ , "mousedown" , this , this . resizeMouseDown _ ) ; this . isDeletable ( ) &&
( ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . deleteGroup _ , "mousedown" , this , this . deleteMouseDown _ ) , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . deleteGroup _ , "mouseout" , this , this . deleteMouseOut _ ) , ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . deleteGroup _ , "mouseup" , this , this . deleteMouseUp _ ) ) } } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . createEditor _ = function ( ) { this . foreignObject _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . FOREIGNOBJECT , { x : 0 , y : module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . TOP _OFFSET , "class" : "blocklyCommentForeignObject" } , null ) ; var a = document . createElementNS ( module$exports$Blockly$utils$dom . HTML _NS , "body" ) ; a . setAttribute ( "xmlns" , module$exports$Blockly$utils$dom . HTML _NS ) ; a . className =
"blocklyMinimalBody" ; var b = document . createElementNS ( module$exports$Blockly$utils$dom . HTML _NS , "textarea" ) ; b . className = "blocklyCommentTextarea" ; b . setAttribute ( "dir" , this . RTL ? "RTL" : "LTR" ) ; b . readOnly = ! this . isEditable ( ) ; a . appendChild ( b ) ; this . textarea _ = b ; this . foreignObject _ . appendChild ( a ) ; ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "wheel" , this , function ( c ) { c . stopPropagation ( ) } ) ; ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( b , "change" , this , function ( c ) { this . setContent ( b . value ) } ) ;
return this . foreignObject _ } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . addResizeDom _ = function ( ) { this . resizeGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : this . RTL ? "blocklyResizeSW" : "blocklyResizeSE" } , this . svgGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . POLYGON , { points : "0,x x,x x,0" . replace ( /x/g , module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE . toString ( ) ) } , this . resizeGroup _ ) ;
( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { "class" : "blocklyResizeLine" , x1 : module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE / 3 , y1 : module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE - 1 , x2 : module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE - 1 , y2 : module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE / 3 } , this . resizeGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { "class" : "blocklyResizeLine" ,
x1 : 2 * module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE / 3 , y1 : module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE - 1 , x2 : module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE - 1 , y2 : 2 * module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE / 3 } , this . resizeGroup _ ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . addDeleteDom _ = function ( ) { this . deleteGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyCommentDeleteIcon" } , this . svgGroup _ ) ; this . deleteIconBorder _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { "class" : "blocklyDeleteIconShape" , r : "7" , cx : "7.5" , cy : "7.5" } , this . deleteGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE ,
{ x1 : "5" , y1 : "10" , x2 : "10" , y2 : "5" , stroke : "#fff" , "stroke-width" : "2" } , this . deleteGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . LINE , { x1 : "5" , y1 : "5" , x2 : "10" , y2 : "10" , stroke : "#fff" , "stroke-width" : "2" } , this . deleteGroup _ ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . resizeMouseDown _ = function ( a ) { this . unbindDragEvents _ ( ) ; ( 0 , module$exports$Blockly$browserEvents . isRightButton ) ( a ) || ( this . workspace . startDrag ( a , new module$exports$Blockly$utils$Coordinate . Coordinate ( this . workspace . RTL ? - this . width _ : this . width _ , this . height _ ) ) , this . onMouseUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document , "mouseup" , this , this . resizeMouseUp _ ) , this . onMouseMoveWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( document ,
"mousemove" , this , this . resizeMouseMove _ ) , this . workspace . hideChaff ( ) ) ; a . stopPropagation ( ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . deleteMouseDown _ = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . deleteIconBorder _ , "blocklyDeleteIconHighlighted" ) ; a . stopPropagation ( ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . deleteMouseOut _ = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . deleteIconBorder _ , "blocklyDeleteIconHighlighted" ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . deleteMouseUp _ = function ( a ) { this . dispose ( ) ; a . stopPropagation ( ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . unbindDragEvents _ = function ( ) { this . onMouseUpWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseUpWrapper _ ) , this . onMouseUpWrapper _ = null ) ; this . onMouseMoveWrapper _ && ( ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseMoveWrapper _ ) , this . onMouseMoveWrapper _ = null ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . resizeMouseUp _ = function ( a ) { ( 0 , module$exports$Blockly$Touch . clearTouchIdentifier ) ( ) ; this . unbindDragEvents _ ( ) } ; module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . resizeMouseMove _ = function ( a ) { this . autoLayout _ = ! 1 ; a = this . workspace . moveDrag ( a ) ; this . setSize _ ( this . RTL ? - a . x : a . x , a . y ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . resizeComment _ = function ( ) { var a = this . getHeightWidth ( ) , b = module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . TOP _OFFSET , c = 2 * module$contents$Blockly$WorkspaceCommentSvg _TEXTAREA _OFFSET ; this . foreignObject _ . setAttribute ( "width" , a . width ) ; this . foreignObject _ . setAttribute ( "height" , a . height - b ) ; this . RTL && this . foreignObject _ . setAttribute ( "x" , - a . width ) ; this . textarea _ . style . width = a . width - c + "px" ; this . textarea _ . style . height = a . height -
c - b + "px" } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setSize _ = function ( a , b ) { a = Math . max ( a , 45 ) ; b = Math . max ( b , 20 + module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . TOP _OFFSET ) ; this . width _ = a ; this . height _ = b ; this . svgRect _ . setAttribute ( "width" , a ) ; this . svgRect _ . setAttribute ( "height" , b ) ; this . svgRectTarget _ . setAttribute ( "width" , a ) ; this . svgRectTarget _ . setAttribute ( "height" , b ) ; this . svgHandleTarget _ . setAttribute ( "width" , a ) ; this . svgHandleTarget _ . setAttribute ( "height" , module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . TOP _OFFSET ) ; this . RTL &&
( this . svgRect _ . setAttribute ( "transform" , "scale(-1 1)" ) , this . svgRectTarget _ . setAttribute ( "transform" , "scale(-1 1)" ) ) ; this . resizeGroup _ && ( this . RTL ? ( this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( - a + module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE ) + "," + ( b - module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE ) + ") scale(-1 1)" ) , this . deleteGroup _ . setAttribute ( "transform" , "translate(" + ( - a + module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE ) + "," + - module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE +
") scale(-1 1)" ) ) : ( this . resizeGroup _ . setAttribute ( "transform" , "translate(" + ( a - module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE ) + "," + ( b - module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE ) + ")" ) , this . deleteGroup _ . setAttribute ( "transform" , "translate(" + ( a - module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE ) + "," + - module$contents$Blockly$WorkspaceCommentSvg _RESIZE _SIZE + ")" ) ) ) ; this . resizeComment _ ( ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . disposeInternal _ = function ( ) { this . svgHandleTarget _ = this . svgRectTarget _ = this . foreignObject _ = this . textarea _ = null ; this . disposed _ = ! 0 } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . setFocus = function ( ) { var a = this ; this . focused _ = ! 0 ; setTimeout ( function ( ) { a . disposed _ || ( a . textarea _ . focus ( ) , a . addFocus ( ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a . svgRectTarget _ , "blocklyCommentTargetFocused" ) , ( 0 , module$exports$Blockly$utils$dom . addClass ) ( a . svgHandleTarget _ , "blocklyCommentHandleTargetFocused" ) ) } , 0 ) } ;
module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg . prototype . blurFocus = function ( ) { var a = this ; this . focused _ = ! 1 ; setTimeout ( function ( ) { a . disposed _ || ( a . textarea _ . blur ( ) , a . removeFocus ( ) , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a . svgRectTarget _ , "blocklyCommentTargetFocused" ) , ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( a . svgHandleTarget _ , "blocklyCommentHandleTargetFocused" ) ) } , 0 ) } ; ( 0 , module$exports$Blockly$Css . register ) ( "\n .blocklyCommentForeignObject {\n position: relative;\n z-index: 0;\n }\n\n .blocklyCommentRect {\n fill: #E7DE8E;\n stroke: #bcA903;\n stroke-width: 1px;\n }\n\n .blocklyCommentTarget {\n fill: transparent;\n stroke: #bcA903;\n }\n\n .blocklyCommentTargetFocused {\n fill: none;\n }\n\n .blocklyCommentHandleTarget {\n fill: none;\n }\n\n .blocklyCommentHandleTargetFocused {\n fill: transparent;\n }\n\n .blocklyFocused>.blocklyCommentRect {\n fill: #B9B272;\n stroke: #B9B272;\n }\n\n .blocklySelected>.blocklyCommentTarget {\n stroke: #fc3;\n stroke-width: 3px;\n }\n\n .blocklyCommentDeleteIcon {\n cursor: pointer;\n fill: #000;\n display: none;\n }\n\n .blocklySelected > .blocklyCommentDeleteIcon {\n display: block;\n }\n\n .blocklyDeleteIconShape {\n fill: #000;\n stroke: #000;\n stroke-width: 1px;\n }\n\n .blocklyDeleteIconShape.blocklyDeleteIconHighlighted {\n stroke: #fc3;\n }\n" ) ; var module$exports$Blockly$Trashcan = { Trashcan : function ( a ) { module$exports$Blockly$Trashcan . Trashcan . superClass _ . constructor . call ( this ) ; this . workspace _ = a ; this . id = "trashcan" ; this . contents _ = [ ] ; this . flyout = null ; 0 >= this . workspace _ . options . maxTrashcanContents || ( a = new module$exports$Blockly$Options . Options ( { scrollbars : ! 0 , parentWorkspace : this . workspace _ , rtl : this . workspace _ . RTL , oneBasedIndex : this . workspace _ . options . oneBasedIndex , renderer : this . workspace _ . options . renderer , rendererOverrides : this . workspace _ . options . rendererOverrides ,
move : { scrollbars : ! 0 } } ) , this . workspace _ . horizontalLayout ? ( a . toolboxPosition = this . workspace _ . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . TOP ? module$exports$Blockly$utils$toolbox . Position . BOTTOM : module$exports$Blockly$utils$toolbox . Position . TOP , this . flyout = new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . FLYOUTS _HORIZONTAL _TOOLBOX , this . workspace _ . options , ! 0 ) ) ( a ) ) : ( a . toolboxPosition = this . workspace _ . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . RIGHT ?
module$exports$Blockly$utils$toolbox . Position . LEFT : module$exports$Blockly$utils$toolbox . Position . RIGHT , this . flyout = new ( ( 0 , module$exports$Blockly$registry . getClassFromOptions ) ( module$exports$Blockly$registry . Type . FLYOUTS _VERTICAL _TOOLBOX , this . workspace _ . options , ! 0 ) ) ( a ) ) , this . workspace _ . addChangeListener ( this . onDelete _ . bind ( this ) ) ) } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( module$exports$Blockly$Trashcan . Trashcan , module$exports$Blockly$DeleteArea . DeleteArea ) ;
var module$contents$Blockly$Trashcan _WIDTH = 47 , module$contents$Blockly$Trashcan _BODY _HEIGHT = 44 , module$contents$Blockly$Trashcan _LID _HEIGHT = 16 , module$contents$Blockly$Trashcan _MARGIN _VERTICAL = 20 , module$contents$Blockly$Trashcan _MARGIN _HORIZONTAL = 20 , module$contents$Blockly$Trashcan _MARGIN _HOTSPOT = 10 , module$contents$Blockly$Trashcan _SPRITE _LEFT = 0 , module$contents$Blockly$Trashcan _SPRITE _TOP = 32 , module$contents$Blockly$Trashcan _HAS _BLOCKS _LID _ANGLE = . 1 , module$contents$Blockly$Trashcan _ANIMATION _LENGTH = 80 ,
module$contents$Blockly$Trashcan _ANIMATION _FRAMES = 4 , module$contents$Blockly$Trashcan _OPACITY _MIN = . 4 , module$contents$Blockly$Trashcan _OPACITY _MAX = . 8 , module$contents$Blockly$Trashcan _MAX _LID _ANGLE = 45 ; module$exports$Blockly$Trashcan . Trashcan . prototype . isLidOpen = ! 1 ; module$exports$Blockly$Trashcan . Trashcan . prototype . minOpenness _ = 0 ; module$exports$Blockly$Trashcan . Trashcan . prototype . svgGroup _ = null ; module$exports$Blockly$Trashcan . Trashcan . prototype . svgLid _ = null ;
module$exports$Blockly$Trashcan . Trashcan . prototype . lidTask _ = 0 ; module$exports$Blockly$Trashcan . Trashcan . prototype . lidOpen _ = 0 ; module$exports$Blockly$Trashcan . Trashcan . prototype . left _ = 0 ; module$exports$Blockly$Trashcan . Trashcan . prototype . top _ = 0 ; module$exports$Blockly$Trashcan . Trashcan . prototype . initialized _ = ! 1 ;
module$exports$Blockly$Trashcan . Trashcan . prototype . createDom = function ( ) { this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : "blocklyTrash" } , null ) ; var a = String ( Math . random ( ) ) . substring ( 2 ) ; var b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CLIPPATH , { id : "blocklyTrashBodyClipPath" + a } , this . svgGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT ,
{ width : module$contents$Blockly$Trashcan _WIDTH , height : module$contents$Blockly$Trashcan _BODY _HEIGHT , y : module$contents$Blockly$Trashcan _LID _HEIGHT } , b ) ; var c = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { width : $ . module$exports$Blockly$internalConstants . SPRITE . width , x : - module$contents$Blockly$Trashcan _SPRITE _LEFT , height : $ . module$exports$Blockly$internalConstants . SPRITE . height , y : - module$contents$Blockly$Trashcan _SPRITE _TOP , "clip-path" : "url(#blocklyTrashBodyClipPath" +
a + ")" } , this . svgGroup _ ) ; c . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . workspace _ . options . pathToMedia + $ . module$exports$Blockly$internalConstants . SPRITE . url ) ; b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CLIPPATH , { id : "blocklyTrashLidClipPath" + a } , this . svgGroup _ ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { width : module$contents$Blockly$Trashcan _WIDTH , height : module$contents$Blockly$Trashcan _LID _HEIGHT } ,
b ) ; this . svgLid _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . IMAGE , { width : $ . module$exports$Blockly$internalConstants . SPRITE . width , x : - module$contents$Blockly$Trashcan _SPRITE _LEFT , height : $ . module$exports$Blockly$internalConstants . SPRITE . height , y : - module$contents$Blockly$Trashcan _SPRITE _TOP , "clip-path" : "url(#blocklyTrashLidClipPath" + a + ")" } , this . svgGroup _ ) ; this . svgLid _ . setAttributeNS ( module$exports$Blockly$utils$dom . XLINK _NS , "xlink:href" , this . workspace _ . options . pathToMedia +
$ . module$exports$Blockly$internalConstants . SPRITE . url ) ; ( 0 , module$exports$Blockly$browserEvents . bind ) ( this . svgGroup _ , "mousedown" , this , this . blockMouseDownWhenOpenable _ ) ; ( 0 , module$exports$Blockly$browserEvents . bind ) ( this . svgGroup _ , "mouseup" , this , this . click ) ; ( 0 , module$exports$Blockly$browserEvents . bind ) ( c , "mouseover" , this , this . mouseOver _ ) ; ( 0 , module$exports$Blockly$browserEvents . bind ) ( c , "mouseout" , this , this . mouseOut _ ) ; this . animateLid _ ( ) ; return this . svgGroup _ } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . init = function ( ) { 0 < this . workspace _ . options . maxTrashcanContents && ( ( 0 , module$exports$Blockly$utils$dom . insertAfter ) ( this . flyout . createDom ( module$exports$Blockly$utils$Svg . Svg . SVG ) , this . workspace _ . getParentSvg ( ) ) , this . flyout . init ( this . workspace _ ) ) ; this . workspace _ . getComponentManager ( ) . addComponent ( { component : this , weight : 1 , capabilities : [ module$exports$Blockly$ComponentManager . ComponentManager . Capability . AUTOHIDEABLE , module$exports$Blockly$ComponentManager . ComponentManager . Capability . DELETE _AREA ,
module$exports$Blockly$ComponentManager . ComponentManager . Capability . DRAG _TARGET , module$exports$Blockly$ComponentManager . ComponentManager . Capability . POSITIONABLE ] } ) ; this . initialized _ = ! 0 ; this . setLidOpen ( ! 1 ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . dispose = function ( ) { this . workspace _ . getComponentManager ( ) . removeComponent ( "trashcan" ) ; this . svgGroup _ && ( ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) , this . svgGroup _ = null ) ; this . workspace _ = this . svgLid _ = null ; clearTimeout ( this . lidTask _ ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . hasContents _ = function ( ) { return ! ! this . contents _ . length } ; module$exports$Blockly$Trashcan . Trashcan . prototype . contentsIsOpen = function ( ) { return ! ! this . flyout && this . flyout . isVisible ( ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . openFlyout = function ( ) { if ( ! this . contentsIsOpen ( ) ) { var a = this . contents _ . map ( function ( b ) { return JSON . parse ( b ) } ) ; this . flyout . show ( a ) ; this . fireUiEvent _ ( ! 0 ) } } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . closeFlyout = function ( ) { this . contentsIsOpen ( ) && ( this . flyout . hide ( ) , this . fireUiEvent _ ( ! 1 ) , this . workspace _ . recordDragTargets ( ) ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . autoHide = function ( a ) { ! a && this . flyout && this . closeFlyout ( ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . emptyContents = function ( ) { this . hasContents _ ( ) && ( this . contents _ . length = 0 , this . setMinOpenness _ ( 0 ) , this . closeFlyout ( ) ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . position = function ( a , b ) { if ( this . initialized _ ) { var c = ( 0 , module$exports$Blockly$uiPosition . getCornerOppositeToolbox ) ( this . workspace _ , a ) ; a = ( 0 , module$exports$Blockly$uiPosition . getStartPositionRect ) ( c , new module$exports$Blockly$utils$Size . Size ( module$contents$Blockly$Trashcan _WIDTH , module$contents$Blockly$Trashcan _BODY _HEIGHT + module$contents$Blockly$Trashcan _LID _HEIGHT ) , module$contents$Blockly$Trashcan _MARGIN _HORIZONTAL , module$contents$Blockly$Trashcan _MARGIN _VERTICAL ,
a , this . workspace _ ) ; b = ( 0 , module$exports$Blockly$uiPosition . bumpPositionRect ) ( a , module$contents$Blockly$Trashcan _MARGIN _VERTICAL , c . vertical === module$exports$Blockly$uiPosition . verticalPosition . TOP ? module$exports$Blockly$uiPosition . bumpDirection . DOWN : module$exports$Blockly$uiPosition . bumpDirection . UP , b ) ; this . top _ = b . top ; this . left _ = b . left ; this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . left _ + "," + this . top _ + ")" ) } } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . getBoundingRectangle = function ( ) { return new module$exports$Blockly$utils$Rect . Rect ( this . top _ , this . top _ + module$contents$Blockly$Trashcan _BODY _HEIGHT + module$contents$Blockly$Trashcan _LID _HEIGHT , this . left _ , this . left _ + module$contents$Blockly$Trashcan _WIDTH ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . getClientRect = function ( ) { if ( ! this . svgGroup _ ) return null ; var a = this . svgGroup _ . getBoundingClientRect ( ) , b = a . top + module$contents$Blockly$Trashcan _SPRITE _TOP - module$contents$Blockly$Trashcan _MARGIN _HOTSPOT ; a = a . left + module$contents$Blockly$Trashcan _SPRITE _LEFT - module$contents$Blockly$Trashcan _MARGIN _HOTSPOT ; return new module$exports$Blockly$utils$Rect . Rect ( b , b + module$contents$Blockly$Trashcan _LID _HEIGHT + module$contents$Blockly$Trashcan _BODY _HEIGHT + 2 * module$contents$Blockly$Trashcan _MARGIN _HOTSPOT ,
a , a + module$contents$Blockly$Trashcan _WIDTH + 2 * module$contents$Blockly$Trashcan _MARGIN _HOTSPOT ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . onDragOver = function ( a ) { this . setLidOpen ( this . wouldDelete _ ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . onDragExit = function ( a ) { this . setLidOpen ( ! 1 ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . onDrop = function ( a ) { setTimeout ( this . setLidOpen . bind ( this , ! 1 ) , 100 ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . setLidOpen = function ( a ) { this . isLidOpen !== a && ( clearTimeout ( this . lidTask _ ) , this . isLidOpen = a , this . animateLid _ ( ) ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . animateLid _ = function ( ) { var a = module$contents$Blockly$Trashcan _ANIMATION _FRAMES , b = 1 / ( a + 1 ) ; this . lidOpen _ += this . isLidOpen ? b : - b ; this . lidOpen _ = Math . min ( Math . max ( this . lidOpen _ , this . minOpenness _ ) , 1 ) ; this . setLidAngle _ ( this . lidOpen _ * module$contents$Blockly$Trashcan _MAX _LID _ANGLE ) ; this . svgGroup _ . style . opacity = module$contents$Blockly$Trashcan _OPACITY _MIN + this . lidOpen _ * ( module$contents$Blockly$Trashcan _OPACITY _MAX - module$contents$Blockly$Trashcan _OPACITY _MIN ) ;
this . lidOpen _ > this . minOpenness _ && 1 > this . lidOpen _ && ( this . lidTask _ = setTimeout ( this . animateLid _ . bind ( this ) , module$contents$Blockly$Trashcan _ANIMATION _LENGTH / a ) ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . setLidAngle _ = function ( a ) { var b = this . workspace _ . toolboxPosition === module$exports$Blockly$utils$toolbox . Position . RIGHT || this . workspace _ . horizontalLayout && this . workspace _ . RTL ; this . svgLid _ . setAttribute ( "transform" , "rotate(" + ( b ? - a : a ) + "," + ( b ? 4 : module$contents$Blockly$Trashcan _WIDTH - 4 ) + "," + ( module$contents$Blockly$Trashcan _LID _HEIGHT - 2 ) + ")" ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . setMinOpenness _ = function ( a ) { this . minOpenness _ = a ; this . isLidOpen || this . setLidAngle _ ( a * module$contents$Blockly$Trashcan _MAX _LID _ANGLE ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . closeLid = function ( ) { this . setLidOpen ( ! 1 ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . click = function ( ) { this . hasContents _ ( ) && this . openFlyout ( ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . fireUiEvent _ = function ( a ) { a = new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . TRASHCAN _OPEN ) ) ( a , this . workspace _ . id ) ; ( 0 , module$exports$Blockly$Events$utils . fire ) ( a ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . blockMouseDownWhenOpenable _ = function ( a ) { ! this . contentsIsOpen ( ) && this . hasContents _ ( ) && a . stopPropagation ( ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . mouseOver _ = function ( ) { this . hasContents _ ( ) && this . setLidOpen ( ! 0 ) } ; module$exports$Blockly$Trashcan . Trashcan . prototype . mouseOut _ = function ( ) { this . setLidOpen ( ! 1 ) } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . onDelete _ = function ( a ) { if ( ! ( 0 >= this . workspace _ . options . maxTrashcanContents || a . type !== module$exports$Blockly$Events$utils . DELETE || a . wasShadow ) && ( a = this . cleanBlockJson _ ( a . oldJson ) , - 1 === this . contents _ . indexOf ( a ) ) ) { for ( this . contents _ . unshift ( a ) ; this . contents _ . length > this . workspace _ . options . maxTrashcanContents ; ) this . contents _ . pop ( ) ; this . setMinOpenness _ ( module$contents$Blockly$Trashcan _HAS _BLOCKS _LID _ANGLE ) } } ;
module$exports$Blockly$Trashcan . Trashcan . prototype . cleanBlockJson _ = function ( a ) { function b ( c ) { if ( c ) { delete c . id ; delete c . x ; delete c . y ; delete c . enabled ; if ( c . icons && c . icons . comment ) { var d = c . icons . comment ; delete d . height ; delete d . width ; delete d . pinned } d = c . inputs ; for ( var e in d ) { var f = d [ e ] ; b ( f . block ) ; b ( f . shadow ) } c . next && ( c = c . next , b ( c . block ) , b ( c . shadow ) ) } } a = JSON . parse ( JSON . stringify ( a ) ) ; b ( a ) ; a . kind = "BLOCK" ; return JSON . stringify ( a ) } ; var module$exports$Blockly$FlyoutButton = { FlyoutButton : function ( a , b , c , d ) { this . workspace _ = a ; this . targetWorkspace _ = b ; this . text _ = c . text ; this . position _ = new module$exports$Blockly$utils$Coordinate . Coordinate ( 0 , 0 ) ; this . isLabel _ = d ; this . callbackKey _ = c . callbackKey || c . callbackkey ; this . cssClass _ = c [ "web-class" ] || null ; this . onMouseUpWrapper _ = null ; this . info = c } } ; module$exports$Blockly$FlyoutButton . FlyoutButton . MARGIN _X = 5 ; module$exports$Blockly$FlyoutButton . FlyoutButton . MARGIN _Y = 2 ;
module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . width = 0 ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . height = 0 ;
module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . createDom = function ( ) { var a = this . isLabel _ ? "blocklyFlyoutLabel" : "blocklyFlyoutButton" ; this . cssClass _ && ( a += " " + this . cssClass _ ) ; this . svgGroup _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . G , { "class" : a } , this . workspace _ . getCanvas ( ) ) ; var b ; this . isLabel _ || ( b = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyFlyoutButtonShadow" , rx : 4 , ry : 4 , x : 1 ,
y : 1 } , this . svgGroup _ ) ) ; a = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : this . isLabel _ ? "blocklyFlyoutLabelBackground" : "blocklyFlyoutButtonBackground" , rx : 4 , ry : 4 } , this . svgGroup _ ) ; var c = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . TEXT , { "class" : this . isLabel _ ? "blocklyFlyoutLabelText" : "blocklyText" , x : 0 , y : 0 , "text-anchor" : "middle" } , this . svgGroup _ ) , d = ( 0 , module$exports$Blockly$utils$parsing . replaceMessageReferences ) ( this . text _ ) ;
this . workspace _ . RTL && ( d += "\u200f" ) ; c . textContent = d ; this . isLabel _ && ( this . svgText _ = c , this . workspace _ . getThemeManager ( ) . subscribe ( this . svgText _ , "flyoutForegroundColour" , "fill" ) ) ; var e = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( c , "fontSize" ) , f = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( c , "fontWeight" ) , g = ( 0 , module$exports$Blockly$utils$style . getComputedStyle ) ( c , "fontFamily" ) ; this . width = ( 0 , module$exports$Blockly$utils$dom . getFastTextWidthWithSizeString ) ( c , e , f , g ) ; d = ( 0 , module$exports$Blockly$utils$dom . measureFontMetrics ) ( d ,
e , f , g ) ; this . height = d . height ; this . isLabel _ || ( this . width += 2 * module$exports$Blockly$FlyoutButton . FlyoutButton . MARGIN _X , this . height += 2 * module$exports$Blockly$FlyoutButton . FlyoutButton . MARGIN _Y , b . setAttribute ( "width" , this . width ) , b . setAttribute ( "height" , this . height ) ) ; a . setAttribute ( "width" , this . width ) ; a . setAttribute ( "height" , this . height ) ; c . setAttribute ( "x" , this . width / 2 ) ; c . setAttribute ( "y" , this . height / 2 - d . height / 2 + d . baseline ) ; this . updateTransform _ ( ) ; this . onMouseUpWrapper _ = ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( this . svgGroup _ ,
"mouseup" , this , this . onMouseUp _ ) ; return this . svgGroup _ } ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . show = function ( ) { this . updateTransform _ ( ) ; this . svgGroup _ . setAttribute ( "display" , "block" ) } ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . updateTransform _ = function ( ) { this . svgGroup _ . setAttribute ( "transform" , "translate(" + this . position _ . x + "," + this . position _ . y + ")" ) } ;
module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . moveTo = function ( a , b ) { this . position _ . x = a ; this . position _ . y = b ; this . updateTransform _ ( ) } ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . isLabel = function ( ) { return this . isLabel _ } ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . getPosition = function ( ) { return this . position _ } ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . getButtonText = function ( ) { return this . text _ } ;
module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . getTargetWorkspace = function ( ) { return this . targetWorkspace _ } ; module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . dispose = function ( ) { this . onMouseUpWrapper _ && ( 0 , module$exports$Blockly$browserEvents . unbind ) ( this . onMouseUpWrapper _ ) ; this . svgGroup _ && ( 0 , module$exports$Blockly$utils$dom . removeNode ) ( this . svgGroup _ ) ; this . svgText _ && this . workspace _ . getThemeManager ( ) . unsubscribe ( this . svgText _ ) } ;
module$exports$Blockly$FlyoutButton . FlyoutButton . prototype . onMouseUp _ = function ( a ) { ( a = this . targetWorkspace _ . getGesture ( a ) ) && a . cancel ( ) ; this . isLabel _ && this . callbackKey _ ? console . warn ( "Labels should not have callbacks. Label text: " + this . text _ ) : this . isLabel _ || this . callbackKey _ && this . targetWorkspace _ . getButtonCallback ( this . callbackKey _ ) ? this . isLabel _ || this . targetWorkspace _ . getButtonCallback ( this . callbackKey _ ) ( this ) : console . warn ( "Buttons should have callbacks. Button text: " + this . text _ ) } ; ( 0 , module$exports$Blockly$Css . register ) ( "\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" ) ; var module$exports$Blockly$BlocklyOptions = { BlocklyOptions : function ( ) { } } ; var module$exports$Blockly$VariablesDynamic = { CATEGORY _NAME : "VARIABLE_DYNAMIC" , onCreateVariableButtonClick _String : function ( a ) { ( 0 , $ . module$exports$Blockly$Variables . createVariableButtonHandler ) ( a . getTargetWorkspace ( ) , void 0 , "String" ) } , onCreateVariableButtonClick _Number : function ( a ) { ( 0 , $ . module$exports$Blockly$Variables . createVariableButtonHandler ) ( a . getTargetWorkspace ( ) , void 0 , "Number" ) } , onCreateVariableButtonClick _Colour : function ( a ) { ( 0 , $ . module$exports$Blockly$Variables . createVariableButtonHandler ) ( a . getTargetWorkspace ( ) ,
void 0 , "Colour" ) } , flyoutCategory : function ( a ) { var b = [ ] , c = document . createElement ( "button" ) ; c . setAttribute ( "text" , $ . module$exports$Blockly$Msg . Msg . NEW _STRING _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_STRING" ) ; b . push ( c ) ; c = document . createElement ( "button" ) ; c . setAttribute ( "text" , $ . module$exports$Blockly$Msg . Msg . NEW _NUMBER _VARIABLE ) ; c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_NUMBER" ) ; b . push ( c ) ; c = document . createElement ( "button" ) ; c . setAttribute ( "text" , $ . module$exports$Blockly$Msg . Msg . NEW _COLOUR _VARIABLE ) ;
c . setAttribute ( "callbackKey" , "CREATE_VARIABLE_COLOUR" ) ; b . push ( c ) ; a . registerButtonCallback ( "CREATE_VARIABLE_STRING" , module$exports$Blockly$VariablesDynamic . onCreateVariableButtonClick _String ) ; a . registerButtonCallback ( "CREATE_VARIABLE_NUMBER" , module$exports$Blockly$VariablesDynamic . onCreateVariableButtonClick _Number ) ; a . registerButtonCallback ( "CREATE_VARIABLE_COLOUR" , module$exports$Blockly$VariablesDynamic . onCreateVariableButtonClick _Colour ) ; a = ( 0 , module$exports$Blockly$VariablesDynamic . flyoutCategoryBlocks ) ( a ) ;
return b = b . concat ( a ) } , flyoutCategoryBlocks : function ( a ) { a = a . getAllVariables ( ) ; var b = [ ] ; if ( 0 < a . length ) { if ( $ . module$exports$Blockly$blocks . Blocks . variables _set _dynamic ) { var c = a [ a . length - 1 ] , d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; d . setAttribute ( "type" , "variables_set_dynamic" ) ; d . setAttribute ( "gap" , 24 ) ; d . appendChild ( ( 0 , $ . module$exports$Blockly$Variables . generateVariableFieldDom ) ( c ) ) ; b . push ( d ) } if ( $ . module$exports$Blockly$blocks . Blocks . variables _get _dynamic ) for ( a . sort ( module$exports$Blockly$VariableModel . VariableModel . compareByName ) ,
c = 0 ; d = a [ c ] ; c ++ ) { var e = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; e . setAttribute ( "type" , "variables_get_dynamic" ) ; e . setAttribute ( "gap" , 8 ) ; e . appendChild ( ( 0 , $ . module$exports$Blockly$Variables . generateVariableFieldDom ) ( d ) ) ; b . push ( e ) } } return b } } ; var module$exports$Blockly$IRegistrableField = { IRegistrableField : { } } ; var module$contents$Blockly$Procedures _procTupleComparator ; $ . module$exports$Blockly$Procedures = { CATEGORY _NAME : "PROCEDURE" , DEFAULT _ARG : "x" , allProcedures : function ( a ) { var b = a . getBlocksByType ( "procedures_defnoreturn" , ! 1 ) . map ( function ( c ) { return c . getProcedureDef ( ) } ) ; a = a . getBlocksByType ( "procedures_defreturn" , ! 1 ) . map ( function ( c ) { return c . getProcedureDef ( ) } ) ; b . sort ( module$contents$Blockly$Procedures _procTupleComparator ) ; a . sort ( module$contents$Blockly$Procedures _procTupleComparator ) ; return [ b , a ] } } ;
module$contents$Blockly$Procedures _procTupleComparator = function ( a , b ) { return a [ 0 ] . localeCompare ( b [ 0 ] , void 0 , { sensitivity : "base" } ) } ; $ . module$exports$Blockly$Procedures . findLegalName = function ( a , b ) { if ( b . isInFlyout ) return a ; for ( a = a || $ . module$exports$Blockly$Msg . Msg . UNNAMED _KEY || "unnamed" ; ! module$contents$Blockly$Procedures _isLegalName ( a , b . workspace , b ) ; ) { var c = a . match ( /^(.*?)(\d+)$/ ) ; a = c ? c [ 1 ] + ( parseInt ( c [ 2 ] , 10 ) + 1 ) : a + "2" } return a } ;
var module$contents$Blockly$Procedures _isLegalName = function ( a , b , c ) { return ! ( 0 , $ . module$exports$Blockly$Procedures . isNameUsed ) ( a , b , c ) } ; $ . module$exports$Blockly$Procedures . isNameUsed = function ( a , b , c ) { b = b . getAllBlocks ( ! 1 ) ; for ( var d = 0 ; d < b . length ; d ++ ) if ( b [ d ] !== c && b [ d ] . getProcedureDef ) { var e = b [ d ] . getProcedureDef ( ) ; if ( $ . module$exports$Blockly$Names . Names . equals ( e [ 0 ] , a ) ) return ! 0 } return ! 1 } ;
$ . module$exports$Blockly$Procedures . rename = function ( a ) { a = a . trim ( ) ; var b = ( 0 , $ . module$exports$Blockly$Procedures . findLegalName ) ( a , this . getSourceBlock ( ) ) , c = this . getValue ( ) ; if ( c !== a && c !== b ) { a = this . getSourceBlock ( ) . workspace . getAllBlocks ( ! 1 ) ; for ( var d = 0 ; d < a . length ; d ++ ) a [ d ] . renameProcedure && a [ d ] . renameProcedure ( c , b ) } return b } ;
$ . module$exports$Blockly$Procedures . flyoutCategory = function ( a ) { function b ( f , g ) { for ( var h = 0 ; h < f . length ; h ++ ) { var k = f [ h ] [ 0 ] , l = f [ h ] [ 1 ] , m = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; m . setAttribute ( "type" , g ) ; m . setAttribute ( "gap" , 16 ) ; var n = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "mutation" ) ; n . setAttribute ( "name" , k ) ; m . appendChild ( n ) ; for ( k = 0 ; k < l . length ; k ++ ) { var p = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "arg" ) ; p . setAttribute ( "name" , l [ k ] ) ; n . appendChild ( p ) } c . push ( m ) } }
var c = [ ] ; if ( $ . module$exports$Blockly$blocks . Blocks . procedures _defnoreturn ) { var d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; d . setAttribute ( "type" , "procedures_defnoreturn" ) ; d . setAttribute ( "gap" , 16 ) ; var e = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "field" ) ; e . setAttribute ( "name" , "NAME" ) ; e . appendChild ( ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( $ . module$exports$Blockly$Msg . Msg . PROCEDURES _DEFNORETURN _PROCEDURE ) ) ; d . appendChild ( e ) ; c . push ( d ) } $ . module$exports$Blockly$blocks . Blocks . procedures _defreturn &&
( d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) , d . setAttribute ( "type" , "procedures_defreturn" ) , d . setAttribute ( "gap" , 16 ) , e = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "field" ) , e . setAttribute ( "name" , "NAME" ) , e . appendChild ( ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( $ . module$exports$Blockly$Msg . Msg . PROCEDURES _DEFRETURN _PROCEDURE ) ) , d . appendChild ( e ) , c . push ( d ) ) ; $ . module$exports$Blockly$blocks . Blocks . procedures _ifreturn && ( d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ,
d . setAttribute ( "type" , "procedures_ifreturn" ) , d . setAttribute ( "gap" , 16 ) , c . push ( d ) ) ; c . length && c [ c . length - 1 ] . setAttribute ( "gap" , 24 ) ; a = ( 0 , $ . module$exports$Blockly$Procedures . allProcedures ) ( a ) ; b ( a [ 0 ] , "procedures_callnoreturn" ) ; b ( a [ 1 ] , "procedures_callreturn" ) ; return c } ;
var module$contents$Blockly$Procedures _updateMutatorFlyout = function ( a ) { for ( var b = [ ] , c = a . getBlocksByType ( "procedures_mutatorarg" , ! 1 ) , d = 0 , e ; e = c [ d ] ; d ++ ) b . push ( e . getFieldValue ( "NAME" ) ) ; c = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "xml" ) ; d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ; d . setAttribute ( "type" , "procedures_mutatorarg" ) ; e = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "field" ) ; e . setAttribute ( "name" , "NAME" ) ; b = ( 0 , $ . module$exports$Blockly$Variables . generateUniqueNameFromOptions ) ( $ . module$exports$Blockly$Procedures . DEFAULT _ARG ,
b ) ; b = ( 0 , $ . module$exports$Blockly$utils$xml . createTextNode ) ( b ) ; e . appendChild ( b ) ; d . appendChild ( e ) ; c . appendChild ( d ) ; a . updateToolbox ( c ) } ;
$ . module$exports$Blockly$Procedures . mutatorOpenListener = function ( a ) { if ( a . type === module$exports$Blockly$Events$utils . BUBBLE _OPEN && "mutator" === a . bubbleType && a . isOpen ) { a = module$exports$Blockly$Workspace . Workspace . getById ( a . workspaceId ) . getBlockById ( a . blockId ) ; var b = a . type ; if ( "procedures_defnoreturn" === b || "procedures_defreturn" === b ) a = a . mutator . getWorkspace ( ) , module$contents$Blockly$Procedures _updateMutatorFlyout ( a ) , a . addChangeListener ( module$contents$Blockly$Procedures _mutatorChangeListener ) } } ;
var module$contents$Blockly$Procedures _mutatorChangeListener = function ( a ) { if ( a . type === module$exports$Blockly$Events$utils . CREATE || a . type === module$exports$Blockly$Events$utils . DELETE || a . type === module$exports$Blockly$Events$utils . CHANGE ) a = module$exports$Blockly$Workspace . Workspace . getById ( a . workspaceId ) , module$contents$Blockly$Procedures _updateMutatorFlyout ( a ) } ;
$ . module$exports$Blockly$Procedures . getCallers = function ( a , b ) { var c = [ ] ; b = b . getAllBlocks ( ! 1 ) ; for ( var d = 0 ; d < b . length ; d ++ ) if ( b [ d ] . getProcedureCall ) { var e = b [ d ] . getProcedureCall ( ) ; e && $ . module$exports$Blockly$Names . Names . equals ( e , a ) && c . push ( b [ d ] ) } return c } ;
$ . module$exports$Blockly$Procedures . mutateCallers = function ( a ) { var b = ( 0 , module$exports$Blockly$Events$utils . getRecordUndo ) ( ) , c = a . getProcedureDef ( ) [ 0 ] , d = a . mutationToDom ( ! 0 ) ; a = ( 0 , $ . module$exports$Blockly$Procedures . getCallers ) ( c , a . workspace ) ; c = 0 ; for ( var e ; e = a [ c ] ; c ++ ) { var f = e . mutationToDom ( ) ; f = f && ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( f ) ; e . domToMutation ( d ) ; var g = e . mutationToDom ( ) ; g = g && ( 0 , $ . module$exports$Blockly$Xml . domToText ) ( g ) ; f !== g && ( ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( ! 1 ) , ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( e ,
"mutation" , null , f , g ) ) , ( 0 , module$exports$Blockly$Events$utils . setRecordUndo ) ( b ) ) } } ; $ . module$exports$Blockly$Procedures . getDefinition = function ( a , b ) { b = b . getAllBlocks ( ! 1 ) ; for ( var c = 0 ; c < b . length ; c ++ ) if ( b [ c ] . getProcedureDef ) { var d = b [ c ] . getProcedureDef ( ) ; if ( d && $ . module$exports$Blockly$Names . Names . equals ( d [ 0 ] , a ) ) return b [ c ] } return null } ; $ . module$exports$Blockly$Mutator = { Mutator : function ( a ) { $ . module$exports$Blockly$Mutator . Mutator . superClass _ . constructor . call ( this , null ) ; this . quarkNames _ = a } } ; ( 0 , $ . module$exports$Blockly$utils$object . inherits ) ( $ . module$exports$Blockly$Mutator . Mutator , module$exports$Blockly$Icon . Icon ) ; $ . module$exports$Blockly$Mutator . Mutator . prototype . workspace _ = null ; $ . module$exports$Blockly$Mutator . Mutator . prototype . workspaceWidth _ = 0 ; $ . module$exports$Blockly$Mutator . Mutator . prototype . workspaceHeight _ = 0 ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . setBlock = function ( a ) { this . block _ = a } ; $ . module$exports$Blockly$Mutator . Mutator . prototype . getWorkspace = function ( ) { return this . workspace _ } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . drawIcon _ = function ( a ) { ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . RECT , { "class" : "blocklyIconShape" , rx : "4" , ry : "4" , height : "16" , width : "16" } , a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . 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" } ,
a ) ; ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . CIRCLE , { "class" : "blocklyIconShape" , r : "2.7" , cx : "8" , cy : "8" } , a ) } ; $ . module$exports$Blockly$Mutator . Mutator . prototype . iconClick _ = function ( a ) { this . block _ . isEditable ( ) && module$exports$Blockly$Icon . Icon . prototype . iconClick _ . call ( this , a ) } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . createEditor _ = function ( ) { this . svgDialog _ = ( 0 , module$exports$Blockly$utils$dom . createSvgElement ) ( module$exports$Blockly$utils$Svg . Svg . SVG , { x : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH , y : module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH } , null ) ; if ( this . quarkNames _ . length ) { var a = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "xml" ) ; for ( var b = 0 , c ; c = this . quarkNames _ [ b ] ; b ++ ) { var d = ( 0 , $ . module$exports$Blockly$utils$xml . createElement ) ( "block" ) ;
d . setAttribute ( "type" , c ) ; a . appendChild ( d ) } } else a = null ; b = new module$exports$Blockly$Options . Options ( { disable : ! 1 , parentWorkspace : this . block _ . workspace , media : this . block _ . workspace . options . pathToMedia , rtl : this . block _ . RTL , horizontalLayout : ! 1 , renderer : this . block _ . workspace . options . renderer , rendererOverrides : this . block _ . workspace . options . rendererOverrides } ) ; b . toolboxPosition = this . block _ . RTL ? module$exports$Blockly$utils$toolbox . Position . RIGHT : module$exports$Blockly$utils$toolbox . Position . LEFT ; if ( c = ! ! a ) b . languageTree =
( 0 , module$exports$Blockly$utils$toolbox . convertToolboxDefToJson ) ( a ) ; this . workspace _ = new module$exports$Blockly$WorkspaceSvg . WorkspaceSvg ( b ) ; this . workspace _ . isMutator = ! 0 ; this . workspace _ . addChangeListener ( module$exports$Blockly$Events$utils . disableOrphans ) ; a = c ? this . workspace _ . addFlyout ( module$exports$Blockly$utils$Svg . Svg . G ) : null ; b = this . workspace _ . createDom ( "blocklyMutatorBackground" ) ; a && b . insertBefore ( a , this . workspace _ . svgBlockCanvas _ ) ; this . svgDialog _ . appendChild ( b ) ; return this . svgDialog _ } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . updateEditable = function ( ) { $ . module$exports$Blockly$Mutator . Mutator . superClass _ . updateEditable . call ( this ) ; this . block _ . isInFlyout || ( this . block _ . isEditable ( ) ? this . iconGroup _ && ( 0 , module$exports$Blockly$utils$dom . removeClass ) ( this . iconGroup _ , "blocklyIconGroupReadonly" ) : ( this . setVisible ( ! 1 ) , this . iconGroup _ && ( 0 , module$exports$Blockly$utils$dom . addClass ) ( this . iconGroup _ , "blocklyIconGroupReadonly" ) ) ) } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . resizeBubble _ = function ( ) { var a = 2 * module$exports$Blockly$Bubble . Bubble . BORDER _WIDTH , b = this . workspace _ . getCanvas ( ) . getBBox ( ) , c = b . width + b . x , d = b . height + 3 * a , e = this . workspace _ . getFlyout ( ) ; if ( e ) { var f = e . getWorkspace ( ) . getMetricsManager ( ) . getScrollMetrics ( ) ; d = Math . max ( d , f . height + 20 ) ; c += e . getWidth ( ) } this . block _ . RTL && ( c = - b . x ) ; c += 3 * a ; if ( Math . abs ( this . workspaceWidth _ - c ) > a || Math . abs ( this . workspaceHeight _ - d ) > a ) this . workspaceWidth _ = c , this . workspaceHeight _ = d , this . bubble _ . setBubbleSize ( c +
a , d + a ) , this . svgDialog _ . setAttribute ( "width" , this . workspaceWidth _ ) , this . svgDialog _ . setAttribute ( "height" , this . workspaceHeight _ ) , this . workspace _ . setCachedParentSvgSize ( this . workspaceWidth _ , this . workspaceHeight _ ) ; this . block _ . RTL && ( a = "translate(" + this . workspaceWidth _ + ",0)" , this . workspace _ . getCanvas ( ) . setAttribute ( "transform" , a ) ) ; this . workspace _ . resize ( ) } ; $ . module$exports$Blockly$Mutator . Mutator . prototype . onBubbleMove _ = function ( ) { this . workspace _ && this . workspace _ . recordDragTargets ( ) } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . setVisible = function ( a ) { if ( a !== this . isVisible ( ) ) if ( ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . BUBBLE _OPEN ) ) ( this . block _ , a , "mutator" ) ) , a ) { this . bubble _ = new module$exports$Blockly$Bubble . Bubble ( this . block _ . workspace , this . createEditor _ ( ) , this . block _ . pathObject . svgPath , this . iconXY _ , null , null ) ; this . bubble _ . setSvgId ( this . block _ . id ) ; this . bubble _ . registerMoveEvent ( this . onBubbleMove _ . bind ( this ) ) ;
var b = this . workspace _ . options . languageTree ; a = this . workspace _ . getFlyout ( ) ; b && ( a . init ( this . workspace _ ) , a . show ( b ) ) ; this . rootBlock _ = this . block _ . decompose ( this . workspace _ ) ; b = this . rootBlock _ . getDescendants ( ! 1 ) ; for ( var c = 0 , d = void 0 ; d = b [ c ] ; c ++ ) d . render ( ) ; this . rootBlock _ . setMovable ( ! 1 ) ; this . rootBlock _ . setDeletable ( ! 1 ) ; a ? ( b = 2 * a . CORNER _RADIUS , a = this . rootBlock _ . RTL ? a . getWidth ( ) + b : b ) : a = b = 16 ; this . block _ . RTL && ( a = - a ) ; this . rootBlock _ . moveBy ( a , b ) ; if ( this . block _ . saveConnections ) { var e = this , f = this . block _ ; f . saveConnections ( this . rootBlock _ ) ;
this . sourceListener _ = function ( ) { f . saveConnections ( e . rootBlock _ ) } ; this . block _ . workspace . addChangeListener ( this . sourceListener _ ) } this . resizeBubble _ ( ) ; this . workspace _ . addChangeListener ( this . workspaceChanged _ . bind ( this ) ) ; this . updateWorkspace _ ( ) ; this . applyColour ( ) } else this . svgDialog _ = null , this . workspace _ . dispose ( ) , this . rootBlock _ = this . workspace _ = null , this . bubble _ . dispose ( ) , this . bubble _ = null , this . workspaceHeight _ = this . workspaceWidth _ = 0 , this . sourceListener _ && ( this . block _ . workspace . removeChangeListener ( this . sourceListener _ ) ,
this . sourceListener _ = null ) } ; $ . module$exports$Blockly$Mutator . Mutator . prototype . workspaceChanged _ = function ( a ) { a . isUiEvent || a . type === module$exports$Blockly$Events$utils . CHANGE && "disabled" === a . element || a . type === module$exports$Blockly$Events$utils . CREATE || this . updateWorkspace _ ( ) } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . updateWorkspace _ = function ( ) { if ( ! this . workspace _ . isDragging ( ) ) for ( var a = this . workspace _ . getTopBlocks ( ! 1 ) , b = 0 , c = void 0 ; c = a [ b ] ; b ++ ) { var d = c . getRelativeToSurfaceXY ( ) ; 20 > d . y && c . moveBy ( 0 , 20 - d . y ) ; if ( c . RTL ) { var e = - 20 , f = this . workspace _ . getFlyout ( ) ; f && ( e -= f . getWidth ( ) ) ; d . x > e && c . moveBy ( e - d . x , 0 ) } else 20 > d . x && c . moveBy ( 20 - d . x , 0 ) } if ( this . rootBlock _ . workspace === this . workspace _ ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 0 ) ; var g = this . block _ ; a = module$exports$Blockly$Events$BlockChange . BlockChange . getExtraBlockState _ ( g ) ;
b = g . rendered ; g . rendered = ! 1 ; g . compose ( this . rootBlock _ ) ; g . rendered = b ; g . initSvg ( ) ; g . rendered && g . render ( ) ; b = module$exports$Blockly$Events$BlockChange . BlockChange . getExtraBlockState _ ( g ) ; if ( a !== b ) { ( 0 , module$exports$Blockly$Events$utils . fire ) ( new ( ( 0 , module$exports$Blockly$Events$utils . get ) ( module$exports$Blockly$Events$utils . CHANGE ) ) ( g , "mutation" , null , a , b ) ) ; var h = ( 0 , module$exports$Blockly$Events$utils . getGroup ) ( ) ; setTimeout ( function ( ) { ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( h ) ; g . bumpNeighbours ( ) ;
( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } , $ . module$exports$Blockly$internalConstants . BUMP _DELAY ) } this . workspace _ . isDragging ( ) || this . resizeBubble _ ( ) ; ( 0 , module$exports$Blockly$Events$utils . setGroup ) ( ! 1 ) } } ; $ . module$exports$Blockly$Mutator . Mutator . prototype . dispose = function ( ) { this . block _ . mutator = null ; module$exports$Blockly$Icon . Icon . prototype . dispose . call ( this ) } ;
$ . module$exports$Blockly$Mutator . Mutator . prototype . updateBlockStyle = function ( ) { var a = this . workspace _ ; if ( a && a . getAllBlocks ( ! 1 ) ) { for ( var b = a . getAllBlocks ( ! 1 ) , c = 0 , d ; d = b [ c ] ; c ++ ) d . setStyle ( d . getStyleName ( ) ) ; if ( a = a . getFlyout ( ) ) for ( a = a . workspace _ . getAllBlocks ( ! 1 ) , b = 0 ; c = a [ b ] ; b ++ ) c . setStyle ( c . getStyleName ( ) ) } } ;
$ . module$exports$Blockly$Mutator . Mutator . reconnect = function ( a , b , c ) { if ( ! a || ! a . getSourceBlock ( ) . workspace ) return ! 1 ; c = b . getInput ( c ) . connection ; var d = a . targetBlock ( ) ; return d && d !== b || c . targetConnection === a ? ! 1 : ( c . isConnected ( ) && c . disconnect ( ) , c . connect ( a ) , ! 0 ) } ; $ . module$exports$Blockly$Mutator . Mutator . findParentWs = function ( a ) { var b = null ; if ( a && a . options ) { var c = a . options . parentWorkspace ; a . isFlyout ? c && c . options && ( b = c . options . parentWorkspace ) : c && ( b = c ) } return b } ; $ . Blockly = { VERSION : "7.20211209.1" } ; $ . Blockly . ALIGN _LEFT = $ . module$exports$Blockly$Input . Align . LEFT ; $ . Blockly . ALIGN _CENTRE = $ . module$exports$Blockly$Input . Align . CENTRE ; $ . Blockly . ALIGN _RIGHT = $ . module$exports$Blockly$Input . Align . RIGHT ; $ . Blockly . INPUT _VALUE = $ . module$exports$Blockly$ConnectionType . ConnectionType . INPUT _VALUE ; $ . Blockly . OUTPUT _VALUE = $ . module$exports$Blockly$ConnectionType . ConnectionType . OUTPUT _VALUE ; $ . Blockly . NEXT _STATEMENT = $ . module$exports$Blockly$ConnectionType . ConnectionType . NEXT _STATEMENT ;
$ . Blockly . PREVIOUS _STATEMENT = $ . module$exports$Blockly$ConnectionType . ConnectionType . PREVIOUS _STATEMENT ; $ . Blockly . DUMMY _INPUT = $ . module$exports$Blockly$inputTypes . inputTypes . DUMMY ; $ . Blockly . TOOLBOX _AT _TOP = module$exports$Blockly$utils$toolbox . Position . TOP ; $ . Blockly . TOOLBOX _AT _BOTTOM = module$exports$Blockly$utils$toolbox . Position . BOTTOM ; $ . Blockly . TOOLBOX _AT _LEFT = module$exports$Blockly$utils$toolbox . Position . LEFT ; $ . Blockly . TOOLBOX _AT _RIGHT = module$exports$Blockly$utils$toolbox . Position . RIGHT ;
$ . Blockly . svgResize = $ . module$exports$Blockly$common . svgResize ; var module$contents$Blockly _hideChaff = function ( a ) { ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) . hideChaff ( a ) } ; $ . Blockly . hideChaff = module$contents$Blockly _hideChaff ; $ . Blockly . getMainWorkspace = $ . module$exports$Blockly$common . getMainWorkspace ; $ . Blockly . defineBlocksWithJsonArray = $ . module$exports$Blockly$common . defineBlocksWithJsonArray ; $ . Blockly . setParentContainer = $ . module$exports$Blockly$common . setParentContainer ;
Object . defineProperties ( $ . Blockly , { alert : { set : function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.alert" , "December 2021" , "December 2022" ) ; ( 0 , module$exports$Blockly$dialog . setAlert ) ( a ) } , get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.alert" , "December 2021" , "December 2022" , "Blockly.dialog.alert()" ) ; return module$exports$Blockly$dialog . alert } } , confirm : { set : function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.confirm" , "December 2021" , "December 2022" ) ;
( 0 , module$exports$Blockly$dialog . setConfirm ) ( a ) } , get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.confirm" , "December 2021" , "December 2022" , "Blockly.dialog.confirm()" ) ; return module$exports$Blockly$dialog . confirm } } , mainWorkspace : { set : function ( a ) { ( 0 , $ . module$exports$Blockly$common . setMainWorkspace ) ( a ) } , get : function ( ) { return ( 0 , $ . module$exports$Blockly$common . getMainWorkspace ) ( ) } } , prompt : { set : function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.prompt" , "December 2021" ,
"December 2022" ) ; ( 0 , module$exports$Blockly$dialog . setPrompt ) ( a ) } , get : function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.prompt" , "December 2021" , "December 2022" , "Blockly.dialog.prompt()" ) ; return module$exports$Blockly$dialog . prompt } } , selected : { get : function ( ) { return ( 0 , $ . module$exports$Blockly$common . getSelected ) ( ) } , set : function ( a ) { ( 0 , $ . module$exports$Blockly$common . setSelected ) ( a ) } } , HSV _SATURATION : { get : function ( ) { return module$exports$Blockly$utils . colour . getHsvSaturation ( ) } , set : function ( a ) { module$exports$Blockly$utils . colour . setHsvSaturation ( a ) } } ,
HSV _VALUE : { get : function ( ) { return module$exports$Blockly$utils . colour . getHsvValue ( ) } , set : function ( a ) { module$exports$Blockly$utils . colour . setHsvValue ( a ) } } } ) ; $ . Blockly . svgSize = module$exports$Blockly$utils$svgMath . svgSize ; var module$contents$Blockly _resizeSvgContentsLocal = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.resizeSvgContents" , "December 2021" , "December 2022" , "Blockly.WorkspaceSvg.resizeSvgContents" ) ; ( 0 , module$exports$Blockly$WorkspaceSvg . resizeSvgContents ) ( a ) } ;
$ . Blockly . resizeSvgContents = module$contents$Blockly _resizeSvgContentsLocal ; var module$contents$Blockly _copy = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.copy" , "December 2021" , "December 2022" , "Blockly.clipboard.copy" ) ; ( 0 , module$exports$Blockly$clipboard . copy ) ( a ) } ; $ . Blockly . copy = module$contents$Blockly _copy ;
var module$contents$Blockly _paste = function ( ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.paste" , "December 2021" , "December 2022" , "Blockly.clipboard.paste" ) ; return ( 0 , module$exports$Blockly$clipboard . paste ) ( ) } ; $ . Blockly . paste = module$contents$Blockly _paste ; var module$contents$Blockly _duplicate = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.duplicate" , "December 2021" , "December 2022" , "Blockly.clipboard.duplicate" ) ; ( 0 , module$exports$Blockly$clipboard . duplicate ) ( a ) } ;
$ . Blockly . duplicate = module$contents$Blockly _duplicate ; var module$contents$Blockly _isNumber = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.isNumber" , "December 2021" , "December 2022" , "Blockly.utils.string.isNumber" ) ; return module$exports$Blockly$utils . string . isNumber ( a ) } ; $ . Blockly . isNumber = module$contents$Blockly _isNumber ;
var module$contents$Blockly _hueToHex = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.hueToHex" , "December 2021" , "December 2022" , "Blockly.utils.colour.hueToHex" ) ; return ( 0 , module$exports$Blockly$utils$colour . hueToHex ) ( a ) } ; $ . Blockly . hueToHex = module$contents$Blockly _hueToHex ;
var module$contents$Blockly _bindEvent _ = function ( a , b , c , d ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.bindEvent_" , "December 2021" , "December 2022" , "Blockly.browserEvents.bind" ) ; return ( 0 , module$exports$Blockly$browserEvents . bind ) ( a , b , c , d ) } ; $ . Blockly . bindEvent _ = module$contents$Blockly _bindEvent _ ; var module$contents$Blockly _unbindEvent _ = function ( a ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.unbindEvent_" , "December 2021" , "December 2022" , "Blockly.browserEvents.unbind" ) ; return ( 0 , module$exports$Blockly$browserEvents . unbind ) ( a ) } ;
$ . Blockly . unbindEvent _ = module$contents$Blockly _unbindEvent _ ; var module$contents$Blockly _bindEventWithChecks _ = function ( a , b , c , d , e , f ) { ( 0 , module$exports$Blockly$utils$deprecation . warn ) ( "Blockly.bindEventWithChecks_" , "December 2021" , "December 2022" , "Blockly.browserEvents.conditionalBind" ) ; return ( 0 , module$exports$Blockly$browserEvents . conditionalBind ) ( a , b , c , d , e , f ) } ; $ . Blockly . bindEventWithChecks _ = module$contents$Blockly _bindEventWithChecks _ ; $ . Blockly . LINE _MODE _MULTIPLIER = $ . module$exports$Blockly$internalConstants . LINE _MODE _MULTIPLIER ;
$ . Blockly . PAGE _MODE _MULTIPLIER = $ . module$exports$Blockly$internalConstants . PAGE _MODE _MULTIPLIER ; $ . Blockly . DRAG _RADIUS = $ . module$exports$Blockly$internalConstants . DRAG _RADIUS ; $ . Blockly . FLYOUT _DRAG _RADIUS = $ . module$exports$Blockly$internalConstants . FLYOUT _DRAG _RADIUS ; $ . Blockly . SNAP _RADIUS = $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ; $ . Blockly . CONNECTING _SNAP _RADIUS = $ . module$exports$Blockly$internalConstants . SNAP _RADIUS ; $ . Blockly . CURRENT _CONNECTION _PREFERENCE = $ . module$exports$Blockly$internalConstants . CURRENT _CONNECTION _PREFERENCE ;
$ . Blockly . BUMP _DELAY = $ . module$exports$Blockly$internalConstants . BUMP _DELAY ; $ . Blockly . BUMP _RANDOMNESS = $ . module$exports$Blockly$internalConstants . BUMP _RANDOMNESS ; $ . Blockly . COLLAPSE _CHARS = $ . module$exports$Blockly$internalConstants . COLLAPSE _CHARS ; $ . Blockly . LONGPRESS = $ . module$exports$Blockly$internalConstants . LONGPRESS ; $ . Blockly . SOUND _LIMIT = $ . module$exports$Blockly$internalConstants . SOUND _LIMIT ; $ . Blockly . DRAG _STACK = $ . module$exports$Blockly$internalConstants . DRAG _STACK ; $ . Blockly . SPRITE = $ . module$exports$Blockly$internalConstants . SPRITE ;
$ . Blockly . DRAG _NONE = $ . module$exports$Blockly$internalConstants . DRAG _NONE ; $ . Blockly . DRAG _STICKY = $ . module$exports$Blockly$internalConstants . DRAG _STICKY ; $ . Blockly . DRAG _BEGIN = $ . module$exports$Blockly$internalConstants . DRAG _BEGIN ; $ . Blockly . DRAG _FREE = $ . module$exports$Blockly$internalConstants . DRAG _FREE ; $ . Blockly . OPPOSITE _TYPE = $ . module$exports$Blockly$internalConstants . OPPOSITE _TYPE ; $ . Blockly . RENAME _VARIABLE _ID = $ . module$exports$Blockly$internalConstants . RENAME _VARIABLE _ID ; $ . Blockly . DELETE _VARIABLE _ID = $ . module$exports$Blockly$internalConstants . DELETE _VARIABLE _ID ;
$ . Blockly . COLLAPSED _INPUT _NAME = module$exports$Blockly$constants . COLLAPSED _INPUT _NAME ; $ . Blockly . COLLAPSED _FIELD _NAME = module$exports$Blockly$constants . COLLAPSED _FIELD _NAME ; $ . Blockly . VARIABLE _CATEGORY _NAME = $ . module$exports$Blockly$Variables . CATEGORY _NAME ; $ . Blockly . VARIABLE _DYNAMIC _CATEGORY _NAME = module$exports$Blockly$VariablesDynamic . CATEGORY _NAME ; $ . Blockly . PROCEDURE _CATEGORY _NAME = $ . module$exports$Blockly$Procedures . CATEGORY _NAME ; $ . Blockly . ASTNode = module$exports$Blockly$ASTNode . ASTNode ;
$ . Blockly . BasicCursor = module$exports$Blockly$BasicCursor . BasicCursor ; $ . Blockly . Block = module$exports$Blockly$Block . Block ; $ . Blockly . BlocklyOptions = module$exports$Blockly$BlocklyOptions . BlocklyOptions ; $ . Blockly . BlockDragger = module$exports$Blockly$BlockDragger . BlockDragger ; $ . Blockly . BlockDragSurfaceSvg = module$exports$Blockly$BlockDragSurfaceSvg . BlockDragSurfaceSvg ; $ . Blockly . BlockSvg = module$exports$Blockly$BlockSvg . BlockSvg ; $ . Blockly . Blocks = $ . module$exports$Blockly$blocks . Blocks ; $ . Blockly . Bubble = module$exports$Blockly$Bubble . Bubble ;
$ . Blockly . BubbleDragger = module$exports$Blockly$BubbleDragger . BubbleDragger ; $ . Blockly . CollapsibleToolboxCategory = module$exports$Blockly$CollapsibleToolboxCategory . CollapsibleToolboxCategory ; $ . Blockly . Comment = module$exports$Blockly$Comment . Comment ; $ . Blockly . ComponentManager = module$exports$Blockly$ComponentManager . ComponentManager ; $ . Blockly . Connection = module$exports$Blockly$Connection . Connection ; $ . Blockly . ConnectionType = $ . module$exports$Blockly$ConnectionType . ConnectionType ;
$ . Blockly . ConnectionChecker = module$exports$Blockly$ConnectionChecker . ConnectionChecker ; $ . Blockly . ConnectionDB = module$exports$Blockly$ConnectionDB . ConnectionDB ; $ . Blockly . ContextMenu = $ . module$exports$Blockly$ContextMenu ; $ . Blockly . ContextMenuItems = module$exports$Blockly$ContextMenuItems ; $ . Blockly . ContextMenuRegistry = module$exports$Blockly$ContextMenuRegistry . ContextMenuRegistry ; $ . Blockly . Css = module$exports$Blockly$Css ; $ . Blockly . Cursor = module$exports$Blockly$Cursor . Cursor ; $ . Blockly . DeleteArea = module$exports$Blockly$DeleteArea . DeleteArea ;
$ . Blockly . DragTarget = module$exports$Blockly$DragTarget . DragTarget ; $ . Blockly . DropDownDiv = module$exports$Blockly$DropDownDiv . DropDownDiv ; $ . Blockly . Events = $ . module$exports$Blockly$Events ; $ . Blockly . Extensions = $ . module$exports$Blockly$Extensions ; $ . Blockly . Field = module$exports$Blockly$Field . Field ; $ . Blockly . FieldAngle = module$exports$Blockly$FieldAngle . FieldAngle ; $ . Blockly . FieldCheckbox = $ . module$exports$Blockly$FieldCheckbox . FieldCheckbox ; $ . Blockly . FieldColour = module$exports$Blockly$FieldColour . FieldColour ;
$ . Blockly . FieldDropdown = $ . module$exports$Blockly$FieldDropdown . FieldDropdown ; $ . Blockly . FieldImage = $ . module$exports$Blockly$FieldImage . FieldImage ; $ . Blockly . FieldLabel = $ . module$exports$Blockly$FieldLabel . FieldLabel ; $ . Blockly . FieldLabelSerializable = module$exports$Blockly$FieldLabelSerializable . FieldLabelSerializable ; $ . Blockly . FieldMultilineInput = module$exports$Blockly$FieldMultilineInput . FieldMultilineInput ; $ . Blockly . FieldNumber = module$exports$Blockly$FieldNumber . FieldNumber ;
$ . Blockly . FieldTextInput = $ . module$exports$Blockly$FieldTextInput . FieldTextInput ; $ . Blockly . FieldVariable = module$exports$Blockly$FieldVariable . FieldVariable ; $ . Blockly . Flyout = module$exports$Blockly$Flyout . Flyout ; $ . Blockly . FlyoutButton = module$exports$Blockly$FlyoutButton . FlyoutButton ; $ . Blockly . FlyoutMetricsManager = module$exports$Blockly$FlyoutMetricsManager . FlyoutMetricsManager ; $ . Blockly . Generator = $ . module$exports$Blockly$Generator . Generator ; $ . Blockly . Gesture = module$exports$Blockly$Gesture . Gesture ;
$ . Blockly . Grid = module$exports$Blockly$Grid . Grid ; $ . Blockly . HorizontalFlyout = module$exports$Blockly$HorizontalFlyout . HorizontalFlyout ; $ . Blockly . IASTNodeLocation = module$exports$Blockly$IASTNodeLocation . IASTNodeLocation ; $ . Blockly . IASTNodeLocationSvg = module$exports$Blockly$IASTNodeLocationSvg . IASTNodeLocationSvg ; $ . Blockly . IASTNodeLocationWithBlock = module$exports$Blockly$IASTNodeLocationWithBlock . IASTNodeLocationWithBlock ; $ . Blockly . IAutoHideable = module$exports$Blockly$IAutoHideable . IAutoHideable ;
$ . Blockly . IBlockDragger = module$exports$Blockly$IBlockDragger . IBlockDragger ; $ . Blockly . IBoundedElement = module$exports$Blockly$IBoundedElement . IBoundedElement ; $ . Blockly . IBubble = module$exports$Blockly$IBubble . IBubble ; $ . Blockly . ICollapsibleToolboxItem = module$exports$Blockly$ICollapsibleToolboxItem . ICollapsibleToolboxItem ; $ . Blockly . IComponent = module$exports$Blockly$IComponent . IComponent ; $ . Blockly . IConnectionChecker = module$exports$Blockly$IConnectionChecker . IConnectionChecker ; $ . Blockly . IContextMenu = module$exports$Blockly$IContextMenu . IContextMenu ;
$ . Blockly . Icon = module$exports$Blockly$Icon . Icon ; $ . Blockly . ICopyable = module$exports$Blockly$ICopyable . ICopyable ; $ . Blockly . IDeletable = module$exports$Blockly$IDeletable . IDeletable ; $ . Blockly . IDeleteArea = module$exports$Blockly$IDeleteArea . IDeleteArea ; $ . Blockly . IDragTarget = module$exports$Blockly$IDragTarget . IDragTarget ; $ . Blockly . IDraggable = module$exports$Blockly$IDraggable . IDraggable ; $ . Blockly . IFlyout = module$exports$Blockly$IFlyout . IFlyout ; $ . Blockly . IKeyboardAccessible = module$exports$Blockly$IKeyboardAccessible . IKeyboardAccessible ;
$ . Blockly . IMetricsManager = module$exports$Blockly$IMetricsManager . IMetricsManager ; $ . Blockly . IMovable = module$exports$Blockly$IMovable . IMovable ; $ . Blockly . Input = $ . module$exports$Blockly$Input . Input ; $ . Blockly . InsertionMarkerManager = module$exports$Blockly$InsertionMarkerManager . InsertionMarkerManager ; $ . Blockly . IPositionable = module$exports$Blockly$IPositionable . IPositionable ; $ . Blockly . IRegistrable = module$exports$Blockly$IRegistrable . IRegistrable ; $ . Blockly . IRegistrableField = module$exports$Blockly$IRegistrableField . IRegistrableField ;
$ . Blockly . ISelectable = module$exports$Blockly$ISelectable . ISelectable ; $ . Blockly . ISelectableToolboxItem = module$exports$Blockly$ISelectableToolboxItem . ISelectableToolboxItem ; $ . Blockly . IStyleable = module$exports$Blockly$IStyleable . IStyleable ; $ . Blockly . IToolbox = module$exports$Blockly$IToolbox . IToolbox ; $ . Blockly . IToolboxItem = module$exports$Blockly$IToolboxItem . IToolboxItem ; $ . Blockly . Marker = module$exports$Blockly$Marker . Marker ; $ . Blockly . MarkerManager = module$exports$Blockly$MarkerManager . MarkerManager ;
$ . Blockly . Menu = module$exports$Blockly$Menu . Menu ; $ . Blockly . MenuItem = module$exports$Blockly$MenuItem . MenuItem ; $ . Blockly . MetricsManager = module$exports$Blockly$MetricsManager . MetricsManager ; $ . Blockly . Mutator = $ . module$exports$Blockly$Mutator . Mutator ; $ . Blockly . Msg = $ . module$exports$Blockly$Msg . Msg ; $ . Blockly . Names = $ . module$exports$Blockly$Names . Names ; $ . Blockly . Options = module$exports$Blockly$Options . Options ; $ . Blockly . Procedures = $ . module$exports$Blockly$Procedures ; $ . Blockly . RenderedConnection = module$exports$Blockly$RenderedConnection . RenderedConnection ;
$ . Blockly . Scrollbar = module$exports$Blockly$Scrollbar . Scrollbar ; $ . Blockly . ScrollbarPair = module$exports$Blockly$ScrollbarPair . ScrollbarPair ; $ . Blockly . ShortcutItems = module$exports$Blockly$ShortcutItems ; $ . Blockly . ShortcutRegistry = module$exports$Blockly$ShortcutRegistry . ShortcutRegistry ; $ . Blockly . TabNavigateCursor = module$exports$Blockly$TabNavigateCursor . TabNavigateCursor ; $ . Blockly . Theme = module$exports$Blockly$Theme . Theme ; $ . Blockly . Themes = module$exports$Blockly$Themes ; $ . Blockly . ThemeManager = module$exports$Blockly$ThemeManager . ThemeManager ;
$ . Blockly . Toolbox = module$exports$Blockly$Toolbox . Toolbox ; $ . Blockly . ToolboxCategory = module$exports$Blockly$ToolboxCategory . ToolboxCategory ; $ . Blockly . ToolboxItem = module$exports$Blockly$ToolboxItem . ToolboxItem ; $ . Blockly . ToolboxSeparator = module$exports$Blockly$ToolboxSeparator . ToolboxSeparator ; $ . Blockly . Tooltip = module$exports$Blockly$Tooltip ; $ . Blockly . Touch = module$exports$Blockly$Touch ; $ . Blockly . TouchGesture = module$exports$Blockly$TouchGesture . TouchGesture ; $ . Blockly . Trashcan = module$exports$Blockly$Trashcan . Trashcan ;
$ . Blockly . VariableMap = module$exports$Blockly$VariableMap . VariableMap ; $ . Blockly . VariableModel = module$exports$Blockly$VariableModel . VariableModel ; $ . Blockly . Variables = $ . module$exports$Blockly$Variables ; $ . Blockly . VariablesDynamic = module$exports$Blockly$VariablesDynamic ; $ . Blockly . VerticalFlyout = module$exports$Blockly$VerticalFlyout . VerticalFlyout ; $ . Blockly . Warning = module$exports$Blockly$Warning . Warning ; $ . Blockly . WidgetDiv = module$exports$Blockly$WidgetDiv ; $ . Blockly . Workspace = module$exports$Blockly$Workspace . Workspace ;
$ . Blockly . WorkspaceAudio = module$exports$Blockly$WorkspaceAudio . WorkspaceAudio ; $ . Blockly . WorkspaceComment = module$exports$Blockly$WorkspaceComment . WorkspaceComment ; $ . Blockly . WorkspaceCommentSvg = module$exports$Blockly$WorkspaceCommentSvg . WorkspaceCommentSvg ; $ . Blockly . WorkspaceDragSurfaceSvg = module$exports$Blockly$WorkspaceDragSurfaceSvg . WorkspaceDragSurfaceSvg ; $ . Blockly . WorkspaceDragger = module$exports$Blockly$WorkspaceDragger . WorkspaceDragger ; $ . Blockly . WorkspaceSvg = module$exports$Blockly$WorkspaceSvg . WorkspaceSvg ;
$ . Blockly . Xml = $ . module$exports$Blockly$Xml ; $ . Blockly . ZoomControls = module$exports$Blockly$ZoomControls . ZoomControls ; $ . Blockly . blockAnimations = module$exports$Blockly$blockAnimations ; $ . Blockly . blockRendering = module$exports$Blockly$blockRendering ; $ . Blockly . browserEvents = module$exports$Blockly$browserEvents ; $ . Blockly . bumpObjects = module$exports$Blockly$bumpObjects ; $ . Blockly . clipboard = module$exports$Blockly$clipboard ; $ . Blockly . common = $ . module$exports$Blockly$common ; $ . Blockly . connectionTypes = $ . module$exports$Blockly$ConnectionType . ConnectionType ;
$ . Blockly . constants = module$exports$Blockly$constants ; $ . Blockly . dialog = module$exports$Blockly$dialog ; $ . Blockly . fieldRegistry = module$exports$Blockly$fieldRegistry ; $ . Blockly . geras = module$exports$Blockly$geras ; $ . Blockly . inject = module$exports$Blockly$inject . inject ; $ . Blockly . inputTypes = $ . module$exports$Blockly$inputTypes . inputTypes ; $ . Blockly . minimalist = module$exports$Blockly$minimalist ; $ . Blockly . registry = module$exports$Blockly$registry ;
$ . Blockly . serialization = { blocks : module$exports$Blockly$serialization$blocks , exceptions : module$exports$Blockly$serialization$exceptions , priorities : module$exports$Blockly$serialization$priorities , registry : module$exports$Blockly$serialization$registry , variables : module$exports$Blockly$serialization$variables , workspaces : module$exports$Blockly$serialization$workspaces , ISerializer : module$exports$Blockly$serialization$ISerializer . ISerializer } ; $ . Blockly . thrasos = module$exports$Blockly$thrasos ;
$ . Blockly . uiPosition = module$exports$Blockly$uiPosition ; $ . Blockly . utils = module$exports$Blockly$utils ; $ . Blockly . zelos = module$exports$Blockly$zelos ; "Blockly" in $ . module$exports$Blockly$utils$global . globalThis || ( $ . module$exports$Blockly$utils$global . globalThis . Blockly = { Msg : $ . module$exports$Blockly$Msg . Msg } ) ;
if ( ! COMPILED && "object" === typeof $ . module$exports$Blockly$utils$global . globalThis . Blockly && $ . module$exports$Blockly$utils$global . globalThis . Blockly !== $ . Blockly ) { var descriptors = Object . getOwnPropertyDescriptors ( $ . Blockly ) , accessors = { } , key ; for ( key in descriptors ) if ( descriptors [ key ] . get || descriptors [ key ] . set ) accessors [ key ] = descriptors [ key ] ; Object . defineProperties ( $ . module$exports$Blockly$utils$global . globalThis . Blockly , accessors ) } ;
$ . Blockly . internal _ = $ ;
return $ . Blockly ;
2021-01-16 14:07:51 +00:00
} ) ) ;
//# sourceMappingURL=blockly_compressed.js.map