Blockly.WidgetDiv.position=function(a,b,c,d,e){b<d.y&&(b=d.y);e?a>c.width+d.x&&(a=c.width+d.x):a<d.x&&(a=d.x);Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px";Blockly.WidgetDiv.DIV.style.height=c.height-b+"px"};Blockly.inject=function(a,b){goog.isString(a)&&(a=document.getElementById(a));if(!goog.dom.contains(document,a))throw"Error: container is not in current document.";var c=Blockly.parseOptions_(b||{}),d,e=function(){var b=Blockly.createDom_(a,c);d=Blockly.createMainWorkspace_(b,c);Blockly.init_(d);d.markFocused();Blockly.bindEvent_(b,"focus",d,d.markFocused)};if(c.enableRealtime){var f=document.getElementById("realtime");f&&(f.style.display="block");Blockly.Realtime.startRealtime(e,a,c.realtimeOptions)}else e();
Blockly.WidgetDiv.hideIfOwner=function(a){Blockly.WidgetDiv.owner_==a&&Blockly.WidgetDiv.hide()};Blockly.WidgetDiv.position=function(a,b,c,d,e){b<d.y&&(b=d.y);e?a>c.width+d.x&&(a=c.width+d.x):a<d.x&&(a=d.x);Blockly.WidgetDiv.DIV.style.left=a+"px";Blockly.WidgetDiv.DIV.style.top=b+"px";Blockly.WidgetDiv.DIV.style.height=c.height-b+d.y+"px"};Blockly.inject=function(a,b){goog.isString(a)&&(a=document.getElementById(a));if(!goog.dom.contains(document,a))throw"Error: container is not in current document.";var c=Blockly.parseOptions_(b||{}),d,e=function(){var b=Blockly.createDom_(a,c);d=Blockly.createMainWorkspace_(b,c);Blockly.init_(d);d.markFocused();Blockly.bindEvent_(b,"focus",d,d.markFocused)};if(c.enableRealtime){var f=document.getElementById("realtime");f&&(f.style.display="block");Blockly.Realtime.startRealtime(e,a,c.realtimeOptions)}else e();