diff --git a/bin/js/haxestudio.js b/bin/js/haxestudio.js index cda7b33..30b5342 100644 --- a/bin/js/haxestudio.js +++ b/bin/js/haxestudio.js @@ -68,7 +68,7 @@ var Main = $hx_exports.Main = function() { }; Main.main = function() { }; Main.run_haxe_studio = function() { - Main.version = "0.2 alpha"; + Main.version = "0.2 beta"; Main.session = new Session(); Main.file_stack = new FileObject(); Main.message = new Message(); diff --git a/bin/js/haxestudio.js.map b/bin/js/haxestudio.js.map index a874f37..b754d2c 100644 --- a/bin/js/haxestudio.js.map +++ b/bin/js/haxestudio.js.map @@ -3,7 +3,7 @@ "file":"haxestudio.js", "sourceRoot":"file://", "sources":["/home/pah/github/Haxe-Studio/source/FileObject.hx","/usr/lib/haxe/std/js/_std/HxOverrides.hx","/home/pah/github/Haxe-Studio/source/Main.hx","/home/pah/github/Haxe-Studio/source/Message.hx","/usr/lib/haxe/std/js/_std/Reflect.hx","/home/pah/github/Haxe-Studio/source/Session.hx","/usr/lib/haxe/std/js/_std/Std.hx","/usr/lib/haxe/std/StringBuf.hx","/usr/lib/haxe/std/StringTools.hx","/home/pah/github/Haxe-Studio/source/externs/nodejs-std/src/js/Node.hx","/home/pah/github/Haxe-Studio/source/Utils.hx","/home/pah/github/Haxe-Studio/source/externs/nodejs-std/src/haxe/io/Bytes.hx","/home/pah/github/Haxe-Studio/source/ui/FileDialog.hx","/home/pah/github/Haxe-Studio/source/ui/ModalDialog.hx","/home/pah/github/Haxe-Studio/source/ui/Notify.hx"], -"sourcesContent":["package ;\r\n\r\n@:keep @:expose class FileObject\r\n{\r\n\tprivate var file_stack:Array;\r\n\t// array[0] = path\r\n\t// array[1] = content\r\n\t// array[2] = className\r\n\r\n\tpublic function new()\r\n\t\t{\r\n\t\tfile_stack = new Array();\r\n\t\t}\r\n\r\n\r\n\tpublic function add(path:String,content:String,className:String)\r\n\t\t{\r\n\t\tvar a = new Array();\r\n\t\ta[0] = path;\r\n\t\ta[1] = content;\r\n\t\ta[2] = className;\r\n\t\treturn file_stack.push(a);\r\n\t\t}\r\n\r\n\tpublic function find(path:String):Array\r\n\t\t{\r\n\t\tif (file_stack.length > 0)\r\n\t\t\t{\r\n\t\t\tvar position = 0;\r\n\t\t\tfor (each in file_stack)\r\n\t\t\t\t{\r\n\t\t\t\tif (each[0] == path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\treturn each;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition += 1;\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\treturn [\"not found\"];\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\treturn [\"null\"];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tpublic function update_content(path:String,new_content:String)\r\n\t\t{\r\n\t\tif (file_stack.length > 0)\r\n\t\t\t{\t\t\t\r\n\t\t\tvar position = 0;\r\n\t\t\tfor (each in file_stack)\r\n\t\t\t\t{\r\n\t\t\t\tif (each[0] == path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfile_stack[position][1] = new_content;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition += 1;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tpublic function remove(path:String)\r\n\t\t{\r\n\t\tif (file_stack.length > 0)\r\n\t\t\t{\t\t\t\r\n\t\t\tvar position = 0;\r\n\t\t\tfor (each in file_stack)\r\n\t\t\t\t{\r\n\t\t\t\tif (each[0] == path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t//return each;\r\n\t\t\t\t\t//each[1] = new_content;\r\n\t\t\t\t\tfile_stack.splice(position,1);\r\n\t\t\t\t\t//[position][1] = new_content;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition += 1;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:noDoc\nclass HxOverrides {\n\n\tstatic function dateStr( date :Date ) : String {\n\t\tvar m = date.getMonth() + 1;\n\t\tvar d = date.getDate();\n\t\tvar h = date.getHours();\n\t\tvar mi = date.getMinutes();\n\t\tvar s = date.getSeconds();\n\t\treturn date.getFullYear()\n\t\t\t+\"-\"+(if( m < 10 ) \"0\"+m else \"\"+m)\n\t\t\t+\"-\"+(if( d < 10 ) \"0\"+d else \"\"+d)\n\t\t\t+\" \"+(if( h < 10 ) \"0\"+h else \"\"+h)\n\t\t\t+\":\"+(if( mi < 10 ) \"0\"+mi else \"\"+mi)\n\t\t\t+\":\"+(if( s < 10 ) \"0\"+s else \"\"+s);\n\t}\n\n\tstatic function strDate( s : String ) : Date {\n\t\tswitch( s.length ) {\n\t\tcase 8: // hh:mm:ss\n\t\t\tvar k = s.split(\":\");\n\t\t\tvar d : Date = untyped __new__(Date);\n\t\t\tuntyped d[\"setTime\"](0);\n\t\t\tuntyped d[\"setUTCHours\"](k[0]);\n\t\t\tuntyped d[\"setUTCMinutes\"](k[1]);\n\t\t\tuntyped d[\"setUTCSeconds\"](k[2]);\n\t\t\treturn d;\n\t\tcase 10: // YYYY-MM-DD\n\t\t\tvar k = s.split(\"-\");\n\t\t\treturn new Date(cast k[0],cast untyped k[1] - 1,cast k[2],0,0,0);\n\t\tcase 19: // YYYY-MM-DD hh:mm:ss\n\t\t\tvar k = s.split(\" \");\n\t\t\tvar y = k[0].split(\"-\");\n\t\t\tvar t = k[1].split(\":\");\n\t\t\treturn new Date(cast y[0],cast untyped y[1] - 1,cast y[2],cast t[0],cast t[1],cast t[2]);\n\t\tdefault:\n\t\t\tthrow \"Invalid date format : \" + s;\n\t\t}\n\t}\n\n\tstatic function cca( s : String, index : Int ) : Null {\n\t\t#if mt\n\t\tvar x = (cast s).cca(index);\n\t\t#else\n\t\tvar x = (cast s).charCodeAt(index);\n\t\t#end\n\t\tif( x != x ) // fast isNaN\n\t\t\treturn untyped undefined; // isNaN will still return true\n\t\treturn x;\n\t}\n\n\tstatic function substr( s : String, pos : Int, ?len : Int ) : String {\n\t\tif( pos != null && pos != 0 && len != null && len < 0 ) return \"\";\n\t\tif( len == null ) len = s.length;\n\t\tif( pos < 0 ){\n\t\t\tpos = s.length + pos;\n\t\t\tif( pos < 0 ) pos = 0;\n\t\t}else if( len < 0 ){\n\t\t\tlen = s.length + len - pos;\n\t\t}\n\n\t\treturn (untyped s).substr(pos, len);\n\t}\n\n\tstatic function indexOf( a : Array, obj : T, i : Int) {\n\t\tvar len = a.length;\n\t\tif (i < 0) {\n\t\t\ti += len;\n\t\t\tif (i < 0) i = 0;\n\t\t}\n\t\twhile (i < len)\n\t\t{\n\t\t\tif (untyped __js__(\"a[i] === obj\"))\n\t\t\t\treturn i;\n\t\t\ti++;\n\t\t}\n\t\treturn -1;\n\t}\n\n\tstatic function lastIndexOf( a : Array, obj : T, i : Int) {\n\t\tvar len = a.length;\n\t\tif (i >= len)\n\t\t\ti = len - 1;\n\t\telse if (i < 0)\n\t\t\ti += len;\n\t\twhile (i >= 0)\n\t\t{\n\t\t\tif (untyped __js__(\"a[i] === obj\"))\n\t\t\t\treturn i;\n\t\t\ti--;\n\t\t}\n\t\treturn -1;\n\t}\n\n\tstatic function remove( a : Array, obj : T ) {\n\t\tvar i = a.indexOf(obj);\n\t\tif( i == -1 ) return false;\n\t\ta.splice(i,1);\n\t\treturn true;\n\t}\n\n\tstatic function iter( a : Array ) : Iterator untyped {\n\t\treturn {\n\t\t\tcur : 0,\n\t\t\tarr : a,\n\t\t\thasNext : function() {\n\t\t\t\treturn __this__.cur < __this__.arr.length;\n\t\t\t},\n\t\t\tnext : function() {\n\t\t\t\treturn __this__.arr[__this__.cur++];\n\t\t\t}\n\t\t};\n\t}\n\n\tstatic function __init__() untyped {\n#if !js_es5\n\t\t__feature__('HxOverrides.indexOf', if( Array.prototype.indexOf ) __js__(\"HxOverrides\").indexOf = function(a,o,i) return Array.prototype.indexOf.call(a, o, i));\n\t\t__feature__('HxOverrides.lastIndexOf', if( Array.prototype.lastIndexOf ) __js__(\"HxOverrides\").lastIndexOf = function(a,o,i) return Array.prototype.lastIndexOf.call(a, o, i));\n#end\n\n#if mt\n\t\tif( String.prototype.cca == null ) String.prototype.cca = String.prototype.charCodeAt;\n#end\n\t}\n\n}\n","package;\r\nimport Utils;\r\nimport core.*;\r\nimport js.html.Document;\r\nimport jQuery.*;\r\n@:keep @:expose class Main \r\n{\r\n\tstatic public var session:Session;\r\n\tstatic public var message:Message;\r\n\tstatic public var file_stack:FileObject;\r\n\tstatic public var version:String;\r\n\tprivate static var plugin_loading_sequence:Array;\r\n\t\r\n\t\r\n\tstatic public function main():Void\r\n\t\t{\r\n\t\t}\r\n\r\n\tstatic public function run_haxe_studio():Void\r\n\t\t{\r\n\t\tversion = \"0.2 alpha\";\r\n\t\tsession = new Session();\r\n\t\tfile_stack = new FileObject();\r\n\t\tmessage = new Message();\r\n\t\t\r\n\t\t// init ui\r\n\t\tnew ui.Notify();\r\n\t\tnew ui.FileDialog();\r\n \tnew ui.ModalDialog();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tvar root_path = untyped root;\r\n\t\tplugin_solve_dependency(root_path+\"/plugin\");\r\n\t\tplugin_loading_sequence.reverse();\r\n\t\tplugin_load_all(root_path+\"/plugin\",plugin_loading_sequence);\r\n\t\t\r\n\t\t}\r\n\t\r\n\t\r\n\tstatic public function plugin_load_all(path:String,dependency_sequence:Array)\r\n\t\t{\r\n\t\tfor (each in dependency_sequence)\r\n\t\t\t{\r\n\t\t\tif (each != \"\")\r\n\t\t\t\t{\r\n\t\t\t\ttrace(each);\r\n\t\t\t\tUtils.loadJS(path+\"/\"+each+\"/bin/plugin.js\",function(script){});\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\r\n\tstatic public function plugin_solve_dependency(path:String)\r\n\t\t{\r\n\t\tvar available_plugin = Utils.readDir(path);\r\n\t\t\r\n\t\tvar plugin = new Array();\r\n\t\tfor (each in available_plugin)\r\n\t\t\t{\r\n\t\t\tplugin.push(JSON.parse(Utils.readFile(path+\"/\"+each+\"/bin/plugin.json\")));\r\n\t\t\t}\r\n\t\t\r\n\t\tvar build_load_sequence = new Array();\r\n\t\tfor (each in plugin)\r\n\t\t\t{\r\n\t\t\tif (each.dependency.length >= 1)\r\n\t\t\t\t{\r\n\t\t\t\tvar temp = new Array();\r\n\t\t\t\r\n\t\t\t\t// reconstruct variable because \"each.dependency\" can't be access by array;\r\n\t\t\t\tvar key = Reflect.fields(each.dependency);\r\n\t\t\t\tfor (each_key in key)\r\n\t\t\t\t\t{\r\n\t\t\t\t\ttemp.push(Reflect.field(each.dependency, each_key));\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (each2 in temp)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tbuild_load_sequence.push([each.actualName,each2]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\tbuild_load_sequence.push( [each.actualName,\"\"]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tvar plugin_loading_sequence_obj = untyped tsort(build_load_sequence);\r\n\t\tplugin_loading_sequence = untyped plugin_loading_sequence_obj.path;\t\t\r\n\t\t}\r\n\t\t\r\n}\r\n","package;\r\nimport jQuery.*;\r\n\r\nclass Message\r\n{\r\n\tprivate var broadcast_message:Array>;\r\n\tprivate var listen_message:Array>;\r\n\t\r\n\tpublic function new()\r\n\t{\r\n\t\tbroadcast_message = new Array();\r\n\t\tlisten_message = new Array();\r\n\t}\r\n\t\r\n\tpublic function broadcast(message:String,caller_name:String,parameter:Array)\r\n\t{\r\n\t\tvar temp = new Array();\r\n\t\ttemp.push(message);\r\n\t\ttemp.push(caller_name);\t\r\n\t\tbroadcast_message.push(temp);\r\n\t\tuntyped EventBus.dispatch(message,caller_name,parameter);\r\n\t}\r\n\t\r\n\tpublic function listen(message:String,caller_name:String,callback_function:Dynamic)\r\n\t{\r\n\t\tvar temp = new Array();\r\n\t\ttemp.push(message);\t\r\n\t\ttemp.push(caller_name);\r\n\t\tlisten_message.push(temp);\r\n\t\tuntyped EventBus.addEventListener(message,callback_function, caller_name);\r\n\t}\r\n\t\r\n\tpublic function list_broadcast()\r\n\t{\r\n\t\treturn broadcast_message;\r\n\t}\r\n\r\n\tpublic function list_listen()\r\n\t{\r\n\t\treturn listen_message;\r\n\t}\t\r\n}\r\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic untyped {\n\t\treturn try o[field] catch( e : Dynamic ) null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : Dynamic, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package ;\r\n\r\n@:keep @:expose class Session\r\n{\r\n\tpublic var project_xml:String;\r\n\tpublic var project_xml_parameter:String;\r\n\tpublic var project_folder:String;\r\n\tpublic var active_file:String;\r\n\r\n\tpublic function new()\r\n\t{\r\n\t\tproject_xml = \"\";\r\n\t\tproject_xml_parameter = \"\";\r\n\t\tproject_folder = \"\";\r\n\t\tactive_file = \"\";\r\n\t}\r\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn cast(x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n\tA String buffer is an efficient way to build a big string by appending small\n\telements together.\n\n\tIts cross-platform implementation uses String concatenation internally, but\n\tStringBuf may be optimized for different targets.\n\n\tUnlike String, an instance of StringBuf is not immutable in the sense that\n\tit can be passed as argument to functions which modify it by appending more\n\tvalues. However, the internal buffer cannot be modified.\n**/\nclass StringBuf {\n\n\tvar b:String = \"\";\n\n\t/**\n\t\tThe length of `this` StringBuf in characters.\n\t**/\n\tpublic var length(get,never) : Int;\n\n\t/**\n\t\tCreates a new StringBuf instance.\n\n\t\tThis may involve initialization of the internal buffer.\n\t**/\n\tpublic function new() {}\n\n\tinline function get_length() : Int {\n\t\treturn b.length;\n\t}\n\n\t/**\n\t\tAppends the representation of `x` to `this` StringBuf.\n\n\t\tThe exact representation of `x` may vary per platform. To get more\n\t\tconsistent behavior, this function should be called with\n\t\tStd.string(x).\n\n\t\tIf `x` is null, the String \"null\" is appended.\n\t**/\n\tpublic inline function add( x : T ) : Void {\n\t\tb += x;\n\t}\n\n\t/**\n\t\tAppends the character identified by `c` to `this` StringBuf.\n\n\t\tIf `c` is negative or has another invalid value, the result is\n\t\tunspecified.\n\t**/\n\tpublic inline function addChar( c : Int ) : Void {\n\t\tb += String.fromCharCode(c);\n\t}\n\n\t/**\n\t\tAppends a substring of `s` to `this` StringBuf.\n\n\t\tThis function expects `pos` and `len` to describe a valid substring of\n\t\t`s`, or else the result is unspecified. To get more robust behavior,\n\t\t`this.add(s.substr(pos,len))` can be used instead.\n\n\t\tIf `s` or `pos` are null, the result is unspecified.\n\n\t\tIf `len` is omitted or null, the substring ranges from `pos` to the end\n\t\tof `s`.\n\t**/\n\tpublic inline function addSub( s : String, pos : Int, ?len : Int) : Void {\n\t\tb += (len == null ? s.substr(pos) : s.substr(pos, len));\n\t}\n\n\t/**\n\t\tReturns the content of `this` StringBuf as String.\n\n\t\tThe buffer is not emptied by this operation.\n\t**/\n\tpublic inline function toString() : String {\n\t\treturn b;\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n\tThis class provides advanced methods on Strings. It is ideally used with\n\t'using StringTools' and then acts as an extension to the String class.\n\n\tIf the first argument to any of the methods is null, the result is\n\tunspecified.\n**/\n#if cs\n@:keep\n#end\nclass StringTools {\n\t/**\n\t\tEncode an URL by using the standard format.\n\t**/\n\t#if (!java && !cpp) inline #end public static function urlEncode( s : String ) : String untyped {\n\t\t#if flash9\n\t\t\treturn __global__[\"encodeURIComponent\"](s);\n\t\t#elseif flash\n\t\t\treturn _global[\"escape\"](s);\n\t\t#elseif neko\n\t\t\treturn new String(_urlEncode(s.__s));\n\t\t#elseif js\n\t\t\treturn encodeURIComponent(s);\n\t\t#elseif cpp\n\t\t\treturn s.__URLEncode();\n\t\t#elseif java\n\t\t\ttry\n\t\t\t\treturn untyped __java__(\"java.net.URLEncoder.encode(s, \\\"UTF-8\\\")\")\n\t\t\tcatch (e:Dynamic) throw e;\n\t\t#elseif cs\n\t\t\treturn cs.system.Uri.EscapeUriString(s);\n\t\t#else\n\t\t\treturn null;\n\t\t#end\n\t}\n\n\t/**\n\t\tDecode an URL using the standard format.\n\t**/\n\t#if (!java && !cpp) inline #end public static function urlDecode( s : String ) : String untyped {\n\t\t#if flash9\n\t\t\treturn __global__[\"decodeURIComponent\"](s.split(\"+\").join(\" \"));\n\t\t#elseif flash\n\t\t\treturn _global[\"unescape\"](s);\n\t\t#elseif neko\n\t\t\treturn new String(_urlDecode(s.__s));\n\t\t#elseif js\n\t\t\treturn decodeURIComponent(s.split(\"+\").join(\" \"));\n\t\t#elseif cpp\n\t\t\treturn s.__URLDecode();\n\t\t#elseif java\n\t\t\ttry\n\t\t\t\treturn untyped __java__(\"java.net.URLDecoder.decode(s, \\\"UTF-8\\\")\")\n\t\t\tcatch (e:Dynamic) throw e;\n\t\t#elseif cs\n\t\t\treturn cs.system.Uri.UnescapeDataString(s);\n\t\t#else\n\t\t\treturn null;\n\t\t#end\n\t}\n\n\t/**\n\t\tEscapes HTML special characters of the string `s`.\n\n\t\tThe following replacements are made:\n\n\t\t- `&` becomes `&`;\n\t\t- `<` becomes `<`;\n\t\t- `>` becomes `>`;\n\n\t\tIf `quotes` is true, the following characters are also replaced:\n\n\t\t- `\"` becomes `"`;\n\t\t- `'` becomes `'`;\n\t**/\n\tpublic static function htmlEscape( s : String, ?quotes : Bool ) : String {\n\t\ts = s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t\treturn quotes ? s.split('\"').join(\""\").split(\"'\").join(\"'\") : s;\n\t}\n\n\t/**\n\t\tUnescapes HTML special characters of the string `s`.\n\n\t\tThis is the inverse operation to htmlEscape, i.e. the following always\n\t\tholds: htmlUnescape(htmlEscape(s)) == s\n\n\t\tThe replacements follow:\n\n\t\t- `&` becomes `&`\n\t\t- `<` becomes `<`\n\t\t- `>` becomes `>`\n\t\t- `"` becomes `\"`\n\t\t- `'` becomes `'`\n\t**/\n\tpublic static function htmlUnescape( s : String ) : String {\n\t\treturn s.split(\">\").join(\">\").split(\"<\").join(\"<\").split(\""\").join('\"').split(\"'\").join(\"'\").split(\"&\").join(\"&\");\n\t}\n\n\t/**\n\t\tTells if the string `s` starts with the string `start`.\n\n\t\tIf `start` is null, the result is unspecified.\n\n\t\tIf `start` is the empty String \"\", the result is true.\n\t**/\n\tpublic static #if (cs || java) inline #end function startsWith( s : String, start : String ) : Bool {\n\t\t#if java\n\t\treturn untyped s.startsWith(start);\n\t\t#elseif cs\n\t\treturn untyped s.StartsWith(start);\n\t\t#else\n\t\treturn( s.length >= start.length && s.substr(0, start.length) == start );\n\t\t#end\n\t}\n\n\t/**\n\t\tTells if the string `s` ends with the string `end`.\n\n\t\tIf `end` is null, the result is unspecified.\n\n\t\tIf `end` is the empty String \"\", the result is true.\n\t**/\n\tpublic static #if (cs || java) inline #end function endsWith( s : String, end : String ) : Bool {\n\t\t#if java\n\t\treturn untyped s.endsWith(end);\n\t\t#elseif cs\n\t\treturn untyped s.EndsWith(end);\n\t\t#else\n\t\tvar elen = end.length;\n\t\tvar slen = s.length;\n\t\treturn( slen >= elen && s.substr(slen - elen, elen) == end );\n\t\t#end\n\t}\n\n\t/**\n\t\tTells if the character in the string `s` at position `pos` is a space.\n\n\t\tA character is considered to be a space character if its character code\n\t\tis 9,10,11,12,13 or 32.\n\n\t\tIf `s` is the empty String \"\", or if pos is not a valid position within\n\t\t`s`, the result is false.\n\t**/\n\tpublic static function isSpace( s : String, pos : Int ) : Bool {\n\t\tvar c = s.charCodeAt( pos );\n\t\treturn (c > 8 && c < 14) || c == 32;\n\t}\n\n\t/**\n\t\tRemoves leading space characters of `s`.\n\n\t\tThis function internally calls isSpace() to decide which characters to\n\t\tremove.\n\n\t\tIf `s` is the empty String \"\" or consists only of space characters, the\n\t\tresult is the empty String \"\".\n\t**/\n\tpublic #if cs inline #end static function ltrim( s : String ) : String {\n\t\t#if cs\n\t\treturn untyped s.TrimStart();\n\t\t#else\n\t\tvar l = s.length;\n\t\tvar r = 0;\n\t\twhile( r < l && isSpace(s,r) ){\n\t\t\tr++;\n\t\t}\n\t\tif( r > 0 )\n\t\t\treturn s.substr(r, l-r);\n\t\telse\n\t\t\treturn s;\n\t\t#end\n\t}\n\n\t/**\n\t\tRemoves trailing space characters of `s`.\n\n\t\tThis function internally calls isSpace() to decide which characters to\n\t\tremove.\n\n\t\tIf `s` is the empty String \"\" or consists only of space characters, the\n\t\tresult is the empty String \"\".\n\t**/\n\tpublic #if cs inline #end static function rtrim( s : String ) : String {\n\t\t#if cs\n\t\treturn untyped s.TrimEnd();\n\t\t#else\n\t\tvar l = s.length;\n\t\tvar r = 0;\n\t\twhile( r < l && isSpace(s,l-r-1) ){\n\t\t\tr++;\n\t\t}\n\t\tif( r > 0 ){\n\t\t\treturn s.substr(0, l-r);\n\t\t}else{\n\t\t\treturn s;\n\t\t}\n\t\t#end\n\t}\n\n\t/**\n\t\tRemoves leading and trailing space characters of `s`.\n\n\t\tThis is a convenience function for ltrim(rtrim(s)).\n\t**/\n\tpublic #if (cs || java) inline #end static function trim( s : String ) : String {\n\t\t#if cs\n\t\treturn untyped s.Trim();\n\t\t#elseif java\n\t\treturn untyped s.trim();\n\t\t#else\n\t\treturn ltrim(rtrim(s));\n\t\t#end\n\t}\n\n\t/**\n\t\tConcatenates `c` to `s` until `s.length` is at least `l`.\n\n\t\tIf `c` is the empty String \"\" or if `l` does not exceed `s.length`,\n\t\t`s` is returned unchanged.\n\n\t\tIf `c.length` is 1, the resulting String length is exactly `l`.\n\n\t\tOtherwise the length may exceed `l`.\n\n\t\tIf `c` is null, the result is unspecified.\n\t**/\n\tpublic static function lpad( s : String, c : String, l : Int ) : String {\n\t\tif (c.length <= 0)\n\t\t\treturn s;\n\n\t\twhile (s.length < l) {\n\t\t\ts = c + s;\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t\tAppends `c` to `s` until `s.length` is at least `l`.\n\n\t\tIf `c` is the empty String \"\" or if `l` does not exceed `s.length`,\n\t\t`s` is returned unchanged.\n\n\t\tIf `c.length` is 1, the resulting String length is exactly `l`.\n\n\t\tOtherwise the length may exceed `l`.\n\n\t\tIf `c` is null, the result is unspecified.\n\t**/\n\tpublic static function rpad( s : String, c : String, l : Int ) : String {\n\t\tif (c.length <= 0)\n\t\t\treturn s;\n\n\t\twhile (s.length < l) {\n\t\t\ts = s + c;\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t\tReplace all occurences of the String `sub` in the String `s` by the\n\t\tString `by`.\n\n\t\tIf `sub` is the empty String \"\", `by` is inserted after each character\n\t\tof `s`. If `by` is also the empty String \"\", `s` remains unchanged.\n\n\t\tThis is a convenience function for `s.split(sub).join(by)`.\n\n\t\tIf `sub` or `by` are null, the result is unspecified.\n\t**/\n\tpublic static function replace( s : String, sub : String, by : String ) : String {\n\t\t#if java\n\t\tif (sub.length == 0)\n\t\t\treturn s.split(sub).join(by);\n\t\telse\n\t\t\treturn untyped s.replace(sub, by);\n\t\t#elseif cs\n\t\tif (sub.length == 0)\n\t\t\treturn s.split(sub).join(by);\n\t\telse\n\t\t\treturn untyped s.Replace(sub, by);\n\t\t#else\n\t\treturn s.split(sub).join(by);\n\t\t#end\n\t}\n\n\t/**\n\t\tEncodes `n` into a hexadecimal representation.\n\n\t\tIf `digits` is specified, the resulting String is padded with \"0\" until\n\t\tits length equals `digits`.\n\t**/\n\tpublic static function hex( n : Int, ?digits : Int ) {\n\t\t#if flash9\n\t\t\tvar n : UInt = n;\n\t\t\tvar s : String = untyped n.toString(16);\n\t\t\ts = s.toUpperCase();\n\t\t#else\n\t\t\tvar s = \"\";\n\t\t\tvar hexChars = \"0123456789ABCDEF\";\n\t\t\tdo {\n\t\t\t\ts = hexChars.charAt(n&15) + s;\n\t\t\t\tn >>>= 4;\n\t\t\t} while( n > 0 );\n\t\t#end\n\t\tif( digits != null )\n\t\t\twhile( s.length < digits )\n\t\t\t\ts = \"0\"+s;\n\t\treturn s;\n\t}\n\n\t/**\n\t\tReturns the character code at position `index` of String `s`.\n\n\t\tThis method is faster than String.charCodeAt() on most platforms.\n\t\tHowever, unlike String.charCodeAt(), the result is unspecified if\n\t\t`index` is negative or exceeds `s.length`.\n\n\t\tThis operation is not guaranteed to work if `s` contains the \\0\n\t\tcharacter.\n\t**/\n\tpublic static inline function fastCodeAt( s : String, index : Int ) : Int untyped {\n\t\t#if neko\n\t\treturn untyped __dollar__sget(s.__s, index);\n\t\t#elseif cpp\n\t\treturn s.cca(index);\n\t\t#elseif flash9\n\t\treturn s.cca(index);\n\t\t#elseif flash\n\t\treturn s[\"cca\"](index);\n\t\t#elseif java\n\t\treturn ( index < s.length ) ? cast(_charAt(s, index), Int) : -1;\n\t\t#elseif cs\n\t\treturn ( cast(index, UInt) < s.length ) ? cast(untyped s[index], Int) : -1;\n\t\t#elseif js\n\t\t\t#if mt\n\t\treturn (untyped s).cca(index);\n\t\t\t#else\n\t\treturn (untyped s).charCodeAt(index);\n\t\t\t#end\n\t\t#else\n\t\treturn s.cca(index);\n\t\t#end\n\t}\n\n\t/*\n\t\tTells if `c` represents the end-of-file (EOF) character.\n\t*/\n\t@:noUsing public static inline function isEof( c : Int ) : Bool {\n\t\t#if (flash9 || cpp)\n\t\treturn c == 0;\n\t\t#elseif flash8\n\t\treturn c <= 0; // fast NaN\n\t\t#elseif js\n\t\treturn c != c; // fast NaN\n\t\t#elseif neko\n\t\treturn c == null;\n\t\t#elseif cs\n\t\treturn c == -1;\n\t\t#elseif java\n\t\treturn c == -1;\n\t\t#else\n\t\treturn false;\n\t\t#end\n\t}\n\n\t#if java\n\tprivate static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 return untyped str._charAt(idx);\n\t#end\n\n\t#if neko\n\tprivate static var _urlEncode = neko.Lib.load(\"std\",\"url_encode\",1);\n\tprivate static var _urlDecode = neko.Lib.load(\"std\",\"url_decode\",1);\n\t#end\n\n}\n","/* Same license as Node.js\r\n\r\n\tMaintainer: Dion Amago, dion@transition9.com\r\n\r\n\tCopied from Ritchie Turner's (blackdog@cloudshift.cl) repo due to a lack of contact with Ritchie and a desire to\r\n\tkeep node.js libraries updated\r\n\r\n\tFrom Ritchie's docs:\r\n\t\"Node.js 0.8 api without haXe embellishments so that other apis may be implemented\r\n\ton top without being hindered by design choices here.\r\n\tDomain not added.\"\r\n*/\r\n\r\npackage js;\r\n\r\ntypedef NodeListener = Dynamic;\r\ntypedef NodeErr = Null;\r\n\r\n/*\r\n\t emits: newListener\r\n */\r\ntypedef NodeEventEmitter = {\r\n\tfunction addListener(event:String,fn:NodeListener):Dynamic;\r\n\tfunction on(event:String,fn:NodeListener):Dynamic;\r\n\tfunction once(event:String,fn:NodeListener):Void;\r\n\tfunction removeListener(event:String,listener:NodeListener):Void;\r\n\tfunction removeAllListeners(event:String):Void;\r\n\tfunction listeners(event:String):Array;\r\n\tfunction setMaxListeners(m:Int):Void;\r\n\tfunction emit(event:String,?arg1:Dynamic,?arg2:Dynamic,?arg3:Dynamic):Void;\r\n}\r\n\r\ntypedef NodeWatchOpt = {\r\n\tvar persistent:Bool;\r\n\t@:optional\r\n\tvar interval:Int;\r\n};\r\n\r\ntypedef NodeExecOpt = {\r\n\tvar encoding:String;\r\n\tvar timeout:Int;\r\n\tvar maxBuffer:Int;\r\n\tvar killSignal:String;\r\n\tvar env:Dynamic;\r\n\tvar cwd:String;\r\n}\r\n\r\ntypedef NodeSpawnOpt = {\r\n\tvar cwd:String;\r\n\tvar env:Dynamic;\r\n\tvar customFds:Array;\r\n\tvar setsid:Bool;\r\n}\r\n\r\n/* note:can't spec multiple optional args, so adding an arbitrary 3 */\r\ntypedef NodeConsole = {\r\n\tfunction log(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction info(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction warn(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction error(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction time(label:String):Void;\r\n\tfunction timeEnd(label:String):Void;\r\n\tfunction dir(obj:Dynamic):Void;\r\n\tfunction trace():Void;\r\n\tfunction assert():Void;\r\n}\r\n\r\ntypedef NodePath = {\r\n\tfunction join(?p1:String,?p2:String,?p3:String):String;\r\n\tfunction normalize(p:String):String;\r\n\tfunction resolve(?from:Array,to:String):String;\r\n\tfunction dirname(p:String):String;\r\n\tfunction basename(p:String,?ext:String):String;\r\n\tfunction extname(p:String):String;\r\n\tvar sep :String;\r\n\tvar delimiter :String;\r\n}\r\n\r\ntypedef NodeUrlObj = {\r\n\tvar href:String;\r\n\tvar host:String;\r\n\tvar protocol:String;\r\n\tvar auth:String;\r\n\tvar hostname:String;\r\n\tvar port:String;\r\n\tvar pathname:String;\r\n\tvar search:String;\r\n\tvar query:Dynamic;\r\n\tvar hash:String;\r\n}\r\n\r\ntypedef NodeUrl = {\r\n\tfunction parse(p:String,?andQueryString:Bool):NodeUrlObj;\r\n\tfunction format(o:NodeUrlObj):String;\r\n\tfunction resolve(from:Array,to:String):String;\r\n}\r\n\r\ntypedef NodeQueryString = {\r\n\tfunction parse(s:String,?sep:String,?eq:String,?options:{maxKeys:Int}):Dynamic;\r\n\tfunction escape(s:String):String;\r\n\tfunction unescape(s:String):String;\r\n\tfunction stringify(obj:Dynamic,?sep:String,?eq:String):String;\r\n}\r\n\r\n@:native(\"Buffer\") extern class NodeBuffer implements ArrayAccess {\r\n\r\n\t@:overload(function(str:String,?enc:String):Void {})\r\n\t@:overload(function(arr:Array):Void {})\r\n\tfunction new(size:Int):Void;\r\n\r\n\tvar length(default,null) : Int;\r\n\tvar INSPECT_MAX_BYTES:Int;\r\n\r\n\tfunction copy(targetBuffer:NodeBuffer,targetStart:Int,sourceStart:Int,sourceEnd:Int):Void;\r\n\tfunction slice(start:Int,end:Int):NodeBuffer;\r\n\tfunction write(s:String,?offset:Int,?length:Int,?enc:String):Int;\r\n\tfunction toString(enc:String,?start:Int,?end:Int):String;\r\n\tfunction fill(value:Float,offset:Int,?end:Int):Void;\r\n\tstatic function isBuffer(o:Dynamic):Bool;\r\n\tstatic function byteLength(s:String,?enc:String):Int;\r\n\r\n\tfunction readUInt8(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt16LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt16BE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt32LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt32BE(offset:Int,?noAssert:Bool):Int;\r\n\r\n\tfunction readInt8(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt16LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt16BE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt32LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt32BE(offset:Int,?noAssert:Bool):Int;\r\n\r\n\tfunction readFloatLE(offset:Int,?noAssert:Bool):Float;\r\n\tfunction readFloatBE(offset:Int,?noAssert:Bool):Float;\r\n\tfunction readDoubleLE(offset:Int,?noAssert:Bool):Float; // is this right?\r\n\tfunction readDoubleBE(offset:Int,?noAssert:Bool):Float; // is this right?\r\n\r\n\tfunction writeUInt8(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt16LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt16BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt32LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt32BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\r\n\tfunction writeInt8(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt16LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt16BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt32LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt32BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\r\n\tfunction writeFloatLE(value:Float,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeFloatBE(value:Float,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeDoubleLE(value:Float,offset:Int,?noAssert:Bool):Void; // is this right?\r\n\tfunction writeDoubleBE(value:Float,offset:Int,?noAssert:Bool):Void; // is this right?\r\n}\r\n\r\ntypedef NodeScript = {\r\n\tfunction runInThisContext():Dynamic;\r\n\tfunction runInNewContext(?sandbox:Dynamic):Void;\r\n}\r\n\r\ntypedef NodeVM = {\r\n\tfunction runInThisContext(code:String,?fileName:String):Dynamic;\r\n\tfunction runInNewContext(?sandbox:Dynamic):Void;\r\n\tfunction createScript(code:Dynamic,?fileName:String):NodeScript;\r\n}\r\n\r\ntypedef ReadStreamOpt = {\r\n\tflags:String,\r\n\tencoding:String,\r\n\tfd:Null,\r\n\tmode:Int,\r\n\tbufferSize:Int,\r\n\t?start:Int,\r\n\t?end:Int\r\n}\r\n\r\ntypedef WriteStreamOpt = {\r\n\tvar flags:String;\r\n\tvar encoding:String;\r\n\tvar mode:Int;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t data,end,error,close\r\n*/\r\ntypedef NodeReadStream = { > NodeEventEmitter,\r\n\tvar readable:Bool;\r\n\tfunction pause():Void;\r\n\tfunction resume():Void;\r\n\tfunction destroy():Void;\r\n\tfunction destroySoon():Void;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction pipe(dest:NodeWriteStream,?opts:{end:Bool}):Void;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t drain,error,close,pipe\r\n*/\r\ntypedef NodeWriteStream = { > NodeEventEmitter,\r\n\tvar writeable:Bool;\r\n\t@:overload(function(chunk:NodeBuffer):Bool {})\r\n\tfunction write(d:String,?enc:String,?fd:Int):Bool;\r\n\t@:overload(function(b:NodeBuffer):Void {})\r\n\tfunction end(?s:String,?enc:String):Void;\r\n\tfunction destroy():Void;\r\n\tfunction destroySoon():Void;\r\n}\r\n\r\ntypedef NodeNetworkInterface = {\r\n\tvar address :String;\r\n\tvar family :String;\r\n\tvar internal :Bool;\r\n}\r\n\r\ntypedef NodeOs = {\r\n\tfunction hostname():String;\r\n\tfunction type():String;\r\n\tfunction release():String;\r\n\tfunction uptime():Int;\r\n\tfunction loadavg():Array;\r\n\tfunction totalmem():Int;\r\n\tfunction freemem():Int;\r\n\tfunction cpus():Int;\r\n\tfunction platform():String;\r\n\tfunction arch():String;\r\n\tfunction networkInterfaces():Dynamic;\r\n}\r\n\r\n\r\ntypedef NodeJsDate = {\r\n\t\tfunction getTime():Int;\r\n\t\tfunction toDateString():String;\r\n\t\tfunction toUTCString():String;\r\n}\r\n\r\ntypedef NodeStat = {\r\n\tvar dev:Int;\r\n\tvar ino:Int;\r\n\tvar mode:Int;\r\n\tvar nlink:Int;\r\n\tvar uid:Int;\r\n\tvar gid:Int;\r\n\tvar rdev:Int;\r\n\tvar size:Int;\r\n\tvar blkSize:Int;\r\n\tvar blocks:Int;\r\n\tvar atime:NodeJsDate;\r\n\tvar mtime:NodeJsDate;\r\n\tvar ctime:NodeJsDate;\r\n\r\n\tfunction isFile():Bool;\r\n\tfunction isDirectory():Bool;\r\n\tfunction isBlockDevice():Bool;\r\n\tfunction isCharacterDevice():Bool;\r\n\tfunction isSymbolicLink():Bool;\r\n\tfunction isFIFO():Bool;\r\n\tfunction isSocket():Bool;\r\n}\r\n\r\n/*\r\n\tEmits: error,change\r\n */\r\ntypedef NodeFSWatcher = { > NodeEventEmitter,\r\n\t function close():Void;\r\n}\r\n\r\ntypedef NodeFS = {\r\n\tfunction rename(from:String,to:String,cb:NodeErr->Void):Void;\r\n\tfunction renameSync(from:String,to:String):Void;\r\n\r\n\tfunction stat(path:String,cb:NodeErr->NodeStat->Void):Void;\r\n\tfunction statSync(path:String):NodeStat;\r\n\r\n\tfunction lstat(path:Dynamic,cb:NodeErr->NodeStat->Void):Void;\r\n\tfunction lstatSync(path:String):NodeStat;\r\n\r\n\tfunction fstat(fd:Int,cb:NodeErr->NodeStat->Void):Void;\r\n\tfunction fstatSync(fd:Int):NodeStat;\r\n\r\n\tfunction link(srcPath:String,dstPath:String,cb:NodeErr->Void):Void;\r\n\tfunction linkSync(srcPath:String,dstPath:String):Void;\r\n\r\n\tfunction unlink(path:String,cn:NodeErr->Void):Void;\r\n\tfunction unlinkSync(path:String):Void;\r\n\r\n\tfunction symlink(linkData:Dynamic,path:String,?type:String,?cb:NodeErr->Void):Void;\r\n\tfunction symlinkSync(linkData:Dynamic,path:String,?type:String):Void;\r\n\r\n\tfunction readlink(path:String,cb:NodeErr->String->Void):Void;\r\n\tfunction readlinkSync(path:String):String;\r\n\r\n\tfunction realpath(path:String,cb:NodeErr->String->Void):Void;\r\n\tfunction realpathSync(path:String):String;\r\n\r\n\tfunction chmod(path:String,mode:Int,cb:NodeErr->Void):Void;\r\n\tfunction chmodSync(path:String,?mode:Int):Void;\r\n\r\n\tfunction fchmod(fd:Int,mode:Int,cb:NodeErr->Void):Void;\r\n\tfunction fchmodSync(fd:Int,?mode:Int):Void;\r\n\r\n\tfunction chown(path:String,uid:Int,gid:Int,cb:NodeErr->Void):Void ;\r\n\tfunction chownSync(path:String,uid:Int,gid:Int):Void;\r\n\r\n\tfunction fchown(fd:Int,uid:Int,gid:Int,cb:NodeErr->Void):Void ;\r\n\tfunction fchownSync(fd:Int,uid:Int,gid:Int):Void;\r\n\r\n\tfunction rmdir(path:String,cb:NodeErr->Void):Void;\r\n\tfunction rmdirSync(path:String):Void;\r\n\r\n\tfunction mkdir(path:String,?mode:Int,?cb:NodeErr->Void):Void;\r\n\tfunction mkdirSync(path:String,?mode:Int):Void;\r\n\r\n\tfunction readdir(path:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction readdirSync(path:String):Array;\r\n\r\n\tfunction close(fd:Int,cb:NodeErr->Void):Void;\r\n\tfunction closeSync(fd:Int):Void;\r\n\r\n\tfunction open(path:String,flags:String,?mode:Int,cb:NodeErr->Int->Void):Void;\r\n\r\n\tfunction openSync(path:String,flags:String,?mode:Int):Int;\r\n\r\n\tfunction write(fd:Int,bufOrStr:Dynamic,offset:Int,length:Int,position:Null,?cb:NodeErr->Int->Void):Void;\r\n\tfunction writeSync(fd:Int,bufOrStr:Dynamic,offset:Int,length:Int,position:Null):Int;\r\n\r\n\tfunction read(fd:Int,buffer:NodeBuffer,offset:Int,length:Int,position:Int,cb:NodeErr->Int->NodeBuffer->Void):Void;\r\n\tfunction readSync(fd:Int,buffer:NodeBuffer,offset:Int,length:Int,position:Int):Int;\r\n\r\n\tfunction truncate(fd:Int,len:Int,cb:NodeErr->Void):Void;\r\n\tfunction truncateSync(fd:Int,len:Int):NodeErr;\r\n\r\n\tfunction readFile(path:String,?enc:String,cb:NodeErr->String->Void):Void;\r\n\tfunction readFileSync(path:String,?enc:String):String;\r\n\r\n\t@:overload(function(fileName:String,data:NodeBuffer,cb:NodeErr->Void):Void {})\r\n\tfunction writeFile(fileName:String,contents:String,?enc:String,cb:NodeErr->Void):Void;\r\n\t@:overload(function(fileName:String,data:NodeBuffer):Void {})\r\n\tfunction writeFileSync(fileName:String,contents:String,?enc:String):Void;\r\n\r\n\t@:overload(function(fileName:String,data:NodeBuffer,cb:NodeErr->Void):Void {})\r\n\tfunction appendFile(fileName:String,contents:String,?enc:String,cb:NodeErr->Void):Void;\r\n\r\n\t@:overload(function(fileName:String,data:NodeBuffer):Void {})\r\n\tfunction appendFileSync(fileName:String,contents:String,?enc:String):Void;\r\n\r\n\r\n\tfunction utimes(path:String,atime:Dynamic,mtime:Dynamic,cb:NodeErr->Void):Void;\r\n\tfunction utimeSync(path:String,atime:Dynamic,mtime:Dynamic):Void;\r\n\r\n\tfunction futimes(fd:Int,atime:Dynamic,mtime:Dynamic,cb:NodeErr->Void):Void;\r\n\tfunction futimeSync(fd:Int,atime:Dynamic,mtime:Dynamic):Void;\r\n\r\n\tfunction fsync(fd:Int,cb:NodeErr->Void):Void;\r\n\tfunction fsyncSync(fd:Int):Void;\r\n\r\n\tfunction watchFile(fileName:String,?options:NodeWatchOpt,listener:NodeStat->NodeStat->Void):Void;\r\n\tfunction unwatchFile(fileName:String):Void;\r\n\tfunction watch(fileName:String,?options:NodeWatchOpt,listener:String->String->Void):NodeFSWatcher;\r\n\tfunction createReadStream(path:String,?options:ReadStreamOpt):NodeReadStream;\r\n\tfunction createWriteStream(path:String,?options:WriteStreamOpt):NodeWriteStream;\r\n\r\n\tfunction exists(p:String,cb:Bool->Void):Void;\r\n\tfunction existsSync(p:String):Bool;\r\n}\r\n\r\ntypedef NodeUtil = {\r\n\tfunction debug(s:String):Void;\r\n\tfunction inspect(o:Dynamic,?showHidden:Bool,?depth:Int):Void;\r\n\tfunction log(s:String):Void;\r\n\tfunction pump(rs:NodeReadStream,ws:NodeWriteStream,cb:Dynamic->Void):Void;\r\n\tfunction inherits(constructor:Dynamic,superConstructor:Dynamic):Void;\r\n\tfunction isArray(o:Dynamic):Bool;\r\n\tfunction isRegExp(o:Dynamic):Bool;\r\n\tfunction isDate(o:Dynamic):Bool;\r\n\tfunction isError(o:Dynamic):Bool;\r\n\tfunction format(out:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void; // should be arbitrary # of args\r\n}\r\n\r\n/*\r\n\tEmits:\r\n\texit, uncaughtException + SIGNAL events (SIGINT etc)\r\n */\r\ntypedef NodeProcess = { > NodeEventEmitter,\r\n\tvar stdout:NodeWriteStream;\r\n\tvar stdin:NodeReadStream;\r\n\tvar stderr:NodeWriteStream;\r\n\tvar argv:Array;\r\n\tvar env:Dynamic;\r\n\tvar pid:Int;\r\n\tvar title:String;\r\n\tvar arch:String;\r\n\tvar platform:String;\r\n\tvar installPrefix:String;\r\n\tvar execPath:String;\r\n\tvar version:String;\r\n\tvar versions:Dynamic;\r\n\r\n\tfunction memoryUsage():{rss:Int,vsize:Int,heapUsed:Int,heapTotal:Int};\r\n\tfunction nextTick(fn:Void->Void):Void;\r\n\tfunction exit(code:Int):Void;\r\n\tfunction cwd():String;\r\n\tfunction getuid():Int;\r\n\tfunction getgid():Int;\r\n\tfunction setuid(u:Int):Void;\r\n\tfunction setgid(g:Int):Void;\r\n\tfunction umask(?m:Int):Int;\r\n\tfunction chdir(d:String):Void;\r\n\tfunction kill(pid:Int,?signal:String):Void;\r\n\tfunction uptime():Int;\r\n\tfunction abort():Void;\r\n\tfunction hrtime():Array;\r\n}\r\n\r\n/*\r\n\tEmits: exit,close\r\n*/\r\ntypedef NodeChildProcess = { > NodeEventEmitter,\r\n\tvar stdin:NodeWriteStream;\r\n\tvar stdout:NodeReadStream;\r\n\tvar stderr:NodeReadStream;\r\n\tvar pid:Int;\r\n\tfunction kill(?signal:String):Void;\r\n}\r\n\r\n/*\r\n\tEmits: message\r\n*/\r\ntypedef NodeChildForkProcess = { > NodeChildProcess,\r\n\t @:overload(function(o:Dynamic,?socket:NodeNetSocket):Void {})\r\n\t function send(o:Dynamic,?server:NodeNetServer):Void;\r\n}\r\n\r\ntypedef NodeChildProcessCommands = {\r\n\tfunction spawn(command: String,args: Array,?options: Dynamic ) : NodeChildProcess;\r\n\tfunction exec(command: String,?options:Dynamic,cb: {code:Int}->String->String->Void ): NodeChildProcess;\r\n\tfunction execFile(command: String,?options:Dynamic,cb: {code:Int}->String->String->Void ): NodeChildProcess;\r\n\tfunction fork(path:String,?args:Dynamic,?options:Dynamic):NodeChildForkProcess;\r\n}\r\n\r\ntypedef NodeClusterSettings = {\r\n\tvar exec:String;\r\n\tvar args:Array;\r\n\tvar silent:Bool;\r\n}\r\n\r\n\r\n/* emits: message, online,listening,disconnect,exit, setup */\r\ntypedef NodeWorker = { > NodeEventEmitter,\r\n\tvar uniqueID:String; // indexes into cluster.workers\r\n\tvar process:NodeChildProcess;\r\n\tvar suicide:Bool;\r\n\tfunction send(message:Dynamic,?sendHandle:Dynamic):Void;\r\n\tfunction destroy():Void;\r\n}\r\n\r\n/* Emits: death,message, fork, online, listening\t*/\r\ntypedef NodeCluster = { > NodeEventEmitter,\r\n\tvar isMaster:Bool;\r\n\tvar isWorker:Bool;\r\n\tvar workers:Array;\r\n\tfunction fork(?env:Dynamic):NodeWorker;\r\n\tfunction send(o:Dynamic):Void;\r\n\tfunction setupMaster(?settings:NodeClusterSettings):Void;\r\n\tfunction disconnect(?cb:Void->Void):Void;\r\n}\r\n\r\n\r\n/* NET ............................................. */\r\n\r\n/*\r\n\t Emits:\r\n\t connection\r\n*/\r\ntypedef NodeNet = { > NodeEventEmitter,\r\n\tfunction createServer(?options:{allowHalfOpen:Bool},fn:NodeNetSocket->Void):NodeNetServer;\r\n\t@:overload(function(cs:String):NodeNetSocket {})\r\n\tfunction createConnection(port:Int,host:String):NodeNetSocket;\r\n\t@:overload(function(cs:String):NodeNetSocket {})\r\n\tfunction connect(port:Int,host:String):NodeNetSocket;\r\n\tfunction isIP(input:String):Int; // 4 or 6\r\n\tfunction isIPv4(input:String):Bool;\r\n\tfunction isIPv6(input:String):Bool;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t connection,close,error,listening\r\n*/\r\ntypedef NodeNetServer = { > NodeEventEmitter,\r\n\tvar maxConnections:Int;\r\n\tvar connections:Int;\r\n\r\n\t@:overload(function(path:String,?cb:Void->Void):Void {})\r\n\t@:overload(function(fd:Int,?cb:Void->Void):Void {})\r\n\tfunction listen(port:Int,?host:String,?cb:Void->Void):Void;\r\n\tfunction close(cb:Void->Void):Void;\r\n\tfunction address():Void;\r\n\tfunction pause(msecs:Int):Void;\r\n}\r\n\r\ntypedef NodeConnectionOpt = {\r\n\tport:Int,\r\n\t?host:String,\r\n\t?localAddress:String\r\n}\r\n\r\n/*\r\n\r\n\tEmits:\r\n\tconnect,data,end,timeout,drain,error,close\r\n\r\n\timplements a duplex stream interface\r\n*/\r\ntypedef NodeNetSocket = { > NodeEventEmitter,\r\n\tvar remoteAddress:String;\r\n\tvar remotePort:Int;\r\n\tvar bufferSize:Int;\r\n\tvar bytesRead:Int;\r\n\tvar bytesWritten:Int;\r\n\r\n\t@:overload(function(path:String,?cb:Void->Void):Void {})\r\n\t@:overload(function(options:NodeConnectionOpt,connectionListener:Void->Void):Void {})\r\n\tfunction connect(port:Int,?host:String,?cb:Void->Void):Void;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction setSecure():Void;\r\n\t@:overload(function(data:Dynamic,?enc:String,?fileDesc:Int,?cb:Void->Void):Bool {})\r\n\tfunction write(data:Dynamic,?enc:String,?cb:Void->Void):Bool;\r\n\tfunction end(?data:Dynamic,?enc:String):Void;\r\n\tfunction destroy():Void;\r\n\tfunction pause():Void;\r\n\tfunction resume():Void;\r\n\tfunction setTimeout(timeout:Int,?cb:Void->Void):Void;\r\n\tfunction setNoDelay(?noDelay:Bool):Void;\r\n\tfunction setKeepAlive(enable:Bool,?delay:Int):Void;\r\n\tfunction address():{address:String,port:Int};\r\n}\r\n\r\n/* HTTP ............................................*/\r\n\r\n\r\n/*\r\n\t Emits:\r\n\t data,end,close\r\n */\r\ntypedef NodeHttpServerReq = { >NodeEventEmitter,\r\n\tvar method:String;\r\n\tvar url:String;\r\n\tvar headers:Dynamic;\r\n\tvar trailers:Dynamic;\r\n\tvar httpVersion:String;\r\n\tvar connection:NodeNetSocket;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction pause():Void;\r\n\tfunction resume():Void;\r\n}\r\n\r\n/*\r\n */\r\ntypedef NodeHttpServerResp = { > NodeWriteStream,\r\n\tvar statusCode:Int;\r\n\tfunction writeContinue():Void;\r\n\t@:overload(function(statusCode:Int,?reasonPhrase:String,?headers:Dynamic):Void {})\r\n\tfunction writeHead(statusCode:Int,headers:Dynamic):Void;\r\n\tfunction setHeader(name:String,value:Dynamic):Void;\r\n\tfunction getHeader(name:String):Dynamic;\r\n\tfunction removeHeader(name:String):Void;\r\n\tfunction addTrailers(headers:Dynamic):Void;\r\n}\r\n\r\n/* Emits:\r\n\t continue,response\r\n*/\r\ntypedef NodeHttpClientReq = { > NodeEventEmitter,\r\n\tfunction write(data:Dynamic,?enc:String):Void;\r\n\tfunction end(?data:Dynamic,?enc:String):Void;\r\n\tfunction abort():Void;\r\n}\r\n\r\n/* Emits:\r\n\t data,end,close\r\n*/\r\ntypedef NodeHttpClientResp = { > NodeEventEmitter,\r\n\tvar statusCode:Int;\r\n\tvar httpVersion:String;\r\n\tvar headers:Dynamic;\r\n\tvar client:NodeHttpClient;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction resume():Void;\r\n\tfunction pause():Void;\r\n}\r\n\r\n\r\ntypedef NodeHttpClient = { > NodeEventEmitter,\r\n\tfunction request(method:String,path:String,?headers:Dynamic):NodeHttpClientReq;\r\n\tfunction verifyPeer():Bool;\r\n\tfunction getPeerCertificate():NodePeerCert;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t request,connection,checkContinue,connect,clientError,close\r\n */\r\ntypedef NodeHttpServer = { > NodeEventEmitter,\r\n\t@:overload(function(path:String,?cb:Void->Void):Void {})\r\n\tfunction listen(port:Int,?host:String,?cb:Void->Void):Void;\r\n\tfunction close(?cb:Void->Void):Void;\r\n}\r\n\r\n/*\r\n */\r\ntypedef NodeHttpReqOpt = {\r\n\tvar host:String;\r\n\tvar port:Int;\r\n\tvar path:String;\r\n\tvar method:String;\r\n\tvar headers:Dynamic;\r\n}\r\n\r\ntypedef NodeHttpsReqOpt = { > NodeHttpReqOpt,\r\n\tvar ciphers:Dynamic;\r\n\tvar rejectUnauthorized:Dynamic;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t upgrade,continue\r\n*/\r\ntypedef NodeAgent = { > NodeEventEmitter,\r\n\tvar maxSockets:Int;\r\n\tvar sockets:Array;\r\n\tvar queue:Array;\r\n}\r\n\r\ntypedef NodeHttp = {\r\n\tfunction createServer(listener:NodeHttpServerReq->NodeHttpServerResp->Void):NodeHttpServer;\r\n\tfunction createClient(port:Int,host:String):NodeHttpClient;\r\n\t@:overload(function(parsedUrl:NodeUrlObj,res:NodeHttpClientResp->Void):NodeHttpClientReq {})\r\n\tfunction request(options:NodeHttpReqOpt,res:NodeHttpClientResp->Void):NodeHttpClientReq;\r\n\t@:overload(function(parsedUrl:NodeUrlObj,res:NodeHttpClientResp->Void):Void {})\r\n\tfunction get(options:NodeHttpReqOpt,res:NodeHttpClientResp->Void):Void;\r\n\tfunction getAgent(host:String,port:Int):NodeAgent;\r\n}\r\n\r\ntypedef NodeHttps = {\r\n\tfunction createServer(options:{key:String,cert:String},\r\n\t\t\t\t\t\t\t\t\t\t\t\tlistener:NodeHttpServerReq->NodeHttpServerResp->Void):NodeHttpServer;\r\n\tfunction request(options:NodeHttpsReqOpt,res:NodeHttpClientResp->Void):NodeHttpClientReq;\r\n\tfunction get(options:NodeHttpsReqOpt,res:NodeHttpClientResp->Void):Void;\r\n}\r\n\r\ntypedef NodeDns = {\r\n\tfunction resolve(domain:String,?rrtype:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolveNs(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolve4(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolve6(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolveMx(domain:String,cb:NodeErr->Array<{priority:Int,exchange:String}>->Void):Void;\r\n\tfunction resolveSrv(domain:String,cb:NodeErr->Array<{priority:Int,weight:Int,port:Int,name:String}->Void>):Void;\r\n\tfunction resolveCname(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction reverse(ip:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolveTxt(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction lookup(domain:String,?family:String,cb:NodeErr->String->Int->Void):Void;\r\n}\r\n\r\n/* UDP ........................................ */\r\n\r\ntypedef NodeUDPCallback = NodeErr->haxe.io.Bytes->Void;\r\n\r\ntypedef NodeUDP = {\r\n\t// Valid types: udp6, and unix_dgram.\r\n\tfunction createSocket(type:String,cb:NodeUDPCallback):NodeDGSocket;\r\n}\r\n\r\n/*\r\n\t Emits: message,listening,close\r\n*/\r\ntypedef NodeDGSocket = { > NodeEventEmitter,\r\n\tfunction send(buf:NodeBuffer,offset:Int,length:Int,port:Int,address:String,cb:NodeUDPCallback):Void;\r\n\tfunction bind(port:Int,?address:String):Void;\r\n\tfunction close():Void;\r\n\tfunction address():Dynamic;\r\n\tfunction setBroadcast(flag:Bool):Void;\r\n\tfunction setTTL(ttl:Int):Void;\r\n\tfunction setMulticastTTL(ttl:Int):Void;\r\n\tfunction setMulticastLoopback(flag:Bool):Void;\r\n\tfunction addMembership(multicastAddress:String,?multicastInterface:String):Void;\r\n\tfunction dropMembership(multicastAddress:String,?multicastInterface:String):Void;\r\n}\r\n\r\n\r\n/* CRYPTO ..................................... */\r\n\r\ntypedef NodeCredDetails = {\r\n\tvar key:String;\r\n\tvar cert:String;\r\n\tvar ca:Array;\r\n\t/*\r\n\t\tTODO\r\n\t*/\r\n}\r\n\r\ntypedef NodePeerCert = {\r\n\tvar subject:String;\r\n\tvar issuer:String;\r\n\tvar valid_from:String;\r\n\tvar valid_to:String;\r\n}\r\n\r\ntypedef NodeCreds = Dynamic;\r\n\r\ntypedef NodeHmac = {\r\n\tfunction update(data:Dynamic):Void;\r\n\tfunction digest(?enc:String):String;\r\n}\r\n\r\ntypedef NodeHash = {\r\n\tfunction update(data:Dynamic):NodeHash;\r\n\tfunction digest(?enc:String):String;\r\n\tfunction createHmac(algo:String,key:String):NodeHmac;\r\n}\r\n\r\ntypedef NodeCipher = {\r\n\tfunction update(data:Dynamic,?input_enc:String,?output_enc:String):Dynamic;\r\n\tfunction final(output_enc:String):Void;\r\n\tfunction setAutoPadding(padding:Bool):Void; // default true\r\n}\r\n\r\ntypedef NodeDecipher = {\r\n\tfunction update(data:Dynamic,?input_enc:String,?output_enc:String):Dynamic;\r\n\tfunction final(?output_enc:String):Dynamic;\r\n\tfunction setAutoPadding(padding:Bool):Void; // default true\r\n}\r\n\r\ntypedef NodeSigner = {\r\n\tfunction update(data:Dynamic):Void;\r\n\tfunction sign(private_key:String,?output_format:String):Dynamic;\r\n}\r\n\r\ntypedef NodeVerify = {\r\n\tfunction update(data:Dynamic):Void;\r\n\tfunction verify(cert:String,?sig_format:String):Bool;\r\n}\r\n\r\ntypedef NodeDiffieHellman = {\r\n\tfunction generateKeys(?enc:String):String;\r\n\tfunction computeSecret(otherPublicKey:String,?inputEnc:String,?outputEnc:String):String;\r\n\tfunction getPrime(?enc:String):Int;\r\n\tfunction getGenerator(?enc:String):String;\r\n\tfunction getPublicKey(?enc:String):String;\r\n\tfunction getPrivateKey(?enc:String):String;\r\n\tfunction setPublicKey(pubKey:String,?enc:String):Void;\r\n\tfunction setPrivateKey(privKey:String,?enc:String):Void;\r\n}\r\n\r\ntypedef NodeCrypto = {\r\n\tfunction createCredentials(details:NodeCredDetails):NodeCreds;\r\n\tfunction createHash(algo:String):NodeHash; // 'sha1', 'md5', 'sha256', 'sha512'\r\n\tfunction createCipher(algo:String,password:String):NodeCipher;\r\n\tfunction createCipheriv(algo:String,key:String,iv:String):NodeCipher;\r\n\tfunction createDecipher(algo:String,key:String):NodeDecipher;\r\n\tfunction createDecipheriv(algo:String,key:String,iv:String):NodeDecipher;\r\n\tfunction createSign(algo:String):NodeSigner;\r\n\tfunction createVerify(algo:String):NodeVerify;\r\n\t@:overload(function(prime_length:Int):NodeDiffieHellman {})\r\n\tfunction createDiffieHellman(prime:String,?enc:String):NodeDiffieHellman;\r\n\tfunction getDiffieHellman(groupName:String):NodeDiffieHellman;\r\n\tfunction pbkdf2(password:String,salt:String,iterations:Int,keylen:Int,cb:NodeErr->String):Void;\r\n\tfunction randomBytes(size:Int,cb:NodeErr->NodeBuffer):Void;\r\n\r\n}\r\n\r\n/* TLS/SSL ................................................ */\r\n\r\n/*\r\n\t Emits:\r\n\t secureConnection\r\n*/\r\ntypedef NodeTLSServer =\t{ > NodeNetServer,\r\n\t\tfunction addContext(hostName:String,credentials:NodeCreds):Void;\r\n\r\n}\r\n\r\n/* Emits: secure */\r\ntypedef NodeSecurePair = { > NodeEventEmitter,\r\n\t // ?? todo\r\n}\r\ntypedef NodeTLS ={\r\n\tfunction connect(port:Int,host:String,opts:Dynamic,cb:Void->Void):Void;\r\n\tfunction createServer(opts:Dynamic,cb:NodeTLSServer->Void):Void;\r\n\tfunction createSecurePair(creds:NodeCreds,isServer:Bool,requestCert:Bool,rejectUnauthorized:Bool):NodeSecurePair;\r\n}\r\n\r\n/*\r\n\tSnarfed from Tong's version ...\r\n */\r\ntypedef NodeAssert = {\r\n\tfunction fail(actual:Dynamic,expected:Dynamic,message:Dynamic,operator:Dynamic): Void;\r\n\tfunction ok(value:Dynamic,?message:Dynamic):Void;\r\n\tfunction equal(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction notEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction deepEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction notDeepEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction strictEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction notStrictEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction throws(block:Dynamic,error:Dynamic,?message:Dynamic):Void;\r\n\tfunction doesNotThrow(block:Dynamic,error:Dynamic,?message:Dynamic):Void;\r\n\tfunction ifError(value:Dynamic):Void;\r\n}\r\n\r\ntypedef NodeREPL = {\r\n\tfunction start( prompt : String, ?stream : Dynamic ) : Void;\r\n}\r\n\r\ntypedef NodeGZip = {}\r\ntypedef NodeGUnzip = {}\r\ntypedef NodeDeflate = {}\r\ntypedef NodeInflate = {}\r\ntypedef NodeDeflateRaw = {}\r\ntypedef NodeInflateRaw = {}\r\ntypedef NodeUnzip = {}\r\n\r\n\r\ntypedef NodeZLib = {\r\n\tfunction createGzip(?options:Dynamic):NodeGZip;\r\n\tfunction createGunzip(?options:Dynamic):NodeGUnzip;\r\n\tfunction createDeflate(?options:Dynamic):NodeDeflate;\r\n\tfunction createInflate(?options:Dynamic):NodeInflate;\r\n\tfunction createInflateRaw(?options:Dynamic):NodeInflateRaw;\r\n\tfunction createDeflateRaw(?options:Dynamic):NodeDeflateRaw;\r\n\tfunction createUnzip(?options:Dynamic):NodeUnzip;\r\n\r\n\t// convenience\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction deflate(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction deflateRaw(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction gzip(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction gunzip(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction inflate(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction inflateRaw(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction unzip(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n}\r\n\r\n@:native(\"Error\")\r\nextern class Error\r\n{\r\n\tpublic function new(msg : String) : Void;\r\n}\r\n\r\n// Node Constants\r\nclass NodeC {\r\n\tpublic static inline var UTF8 = \"utf8\";\r\n\tpublic static inline var ASCII = \"ascii\";\r\n\tpublic static inline var BINARY = \"binary\";\r\n\tpublic static inline var BASE64 = \"base64\";\r\n\tpublic static inline var HEX = \"hex\";\r\n\r\n\t//events - thanks tmedema\r\n\tpublic static inline var EVENT_EVENTEMITTER_NEWLISTENER = \"newListener\";\r\n\tpublic static inline var EVENT_EVENTEMITTER_ERROR = \"error\";\r\n\r\n\tpublic static inline var EVENT_STREAM_DATA = \"data\";\r\n\tpublic static inline var EVENT_STREAM_END = \"end\";\r\n\tpublic static inline var EVENT_STREAM_ERROR = \"error\";\r\n\tpublic static inline var EVENT_STREAM_CLOSE = \"close\";\r\n\tpublic static inline var EVENT_STREAM_DRAIN = \"drain\";\r\n\tpublic static inline var EVENT_STREAM_CONNECT = \"connect\";\r\n\tpublic static inline var EVENT_STREAM_SECURE = \"secure\";\r\n\tpublic static inline var EVENT_STREAM_TIMEOUT = \"timeout\";\r\n\tpublic static inline var EVENT_STREAM_PIPE = \"pipe\";\r\n\r\n\tpublic static inline var EVENT_PROCESS_EXIT = \"exit\";\r\n\tpublic static inline var EVENT_PROCESS_UNCAUGHTEXCEPTION = \"uncaughtException\";\r\n\tpublic static inline var EVENT_PROCESS_SIGINT = \"SIGINT\";\r\n\tpublic static inline var EVENT_PROCESS_SIGUSR1 = \"SIGUSR1\";\r\n\tpublic static inline var EVENT_CHILDPROCESS_EXIT = \"exit\";\r\n\tpublic static inline var EVENT_HTTPSERVER_REQUEST = \"request\";\r\n\tpublic static inline var EVENT_HTTPSERVER_CONNECTION = \"connection\";\r\n\tpublic static inline var EVENT_HTTPSERVER_CLOSE = \"close\";\r\n\tpublic static inline var EVENT_HTTPSERVER_UPGRADE = \"upgrade\";\r\n\tpublic static inline var EVENT_HTTPSERVER_CLIENTERROR = \"clientError\";\r\n\tpublic static inline var EVENT_HTTPSERVERREQUEST_DATA = \"data\";\r\n\tpublic static inline var EVENT_HTTPSERVERREQUEST_END = \"end\";\r\n\tpublic static inline var EVENT_CLIENTREQUEST_RESPONSE = \"response\";\r\n\tpublic static inline var EVENT_CLIENTRESPONSE_DATA = \"data\";\r\n\tpublic static inline var EVENT_CLIENTRESPONSE_END = \"end\";\r\n\tpublic static inline var EVENT_NETSERVER_CONNECTION = \"connection\";\r\n\tpublic static inline var EVENT_NETSERVER_CLOSE = \"close\";\r\n\r\n\tpublic static inline var FILE_READ = \"r\";\r\n\tpublic static inline var FILE_READ_APPEND = \"r+\";\r\n\tpublic static inline var FILE_WRITE = \"w\";\r\n\tpublic static inline var FILE_WRITE_APPEND = \"a+\";\r\n\tpublic static inline var FILE_READWRITE = \"a\";\r\n\tpublic static inline var FILE_READWRITE_APPEND = \"a+\";\r\n}\r\n\r\nclass Node {\r\n\tpublic static var assert(get,null) : NodeAssert;\r\n\tpublic static var childProcess(get,null) : NodeChildProcessCommands;\r\n\tpublic static var cluster(get,null) : NodeCluster;\r\n\tpublic static var console(default,null) : NodeConsole;\r\n\tpublic static var crypto(get,null) : NodeCrypto;\r\n\tpublic static var dgram(get,null) :NodeUDP ;\r\n\tpublic static var dns(get,null) : NodeDns;\r\n\tpublic static var fs(get,null) : NodeFS;\r\n\tpublic static var http(get,null) : NodeHttp;\r\n\tpublic static var https(get,null) : NodeHttps;\r\n\tpublic static var net(get,null) : NodeNet;\r\n\tpublic static var os(get,null) : NodeOs;\r\n\tpublic static var path(get,null) : NodePath;\r\n\tpublic static var process(default,null) : NodeProcess;\r\n\tpublic static var querystring(get,null) : NodeQueryString;\r\n\tpublic static var repl(get,null) : NodeREPL;\r\n\tpublic static var require(default,null) : String->Dynamic;\r\n\tpublic static var tls(get,null) : NodeTLS;\r\n\tpublic static var url(get,null) : NodeUrl;\r\n\tpublic static var util(get,null) : NodeUtil;\r\n\tpublic static var vm(get,null) : NodeVM;\r\n\r\n\t//\tpublic static var paths:Array;\r\n\tpublic static var setTimeout:Dynamic->Int->?Array->Int;\r\n\tpublic static var clearTimeout:Int->Void;\r\n\tpublic static var setInterval:Dynamic->Int->?Array->Int;\r\n\tpublic static var clearInterval:Int->Void;\r\n\tpublic static var setImmediate:Dynamic->?Array->Int;\r\n\tpublic static var clearImmediate:Int->Void;\r\n\tpublic static var global:Dynamic;\r\n\r\n\tpublic static var __filename(get, null):String;\r\n\tpublic static var __dirname(get, null):String;\r\n\tpublic static var module:Dynamic;\r\n\tpublic static var stringify:Dynamic->?Dynamic->?Dynamic->String;\r\n\tpublic static var parse:String->Dynamic;\r\n\tpublic static var queryString:NodeQueryString;\r\n\r\n\tstatic inline function get_assert() : NodeAssert return require(\"assert\");\r\n\tstatic inline function get_childProcess() : NodeChildProcessCommands return require(\"child_process\");\r\n\tstatic inline function get_cluster() : NodeCluster return require(\"cluster\");\r\n\tstatic inline function get_crypto() : NodeCrypto return require(\"crypto\");\r\n\tstatic inline function get_dgram() : NodeUDP return require(\"dgram\");\r\n\tstatic inline function get_dns() : NodeDns return require(\"dns\");\r\n\tstatic inline function get_fs() : NodeFS return require(\"fs\");\r\n\tstatic inline function get_http() : NodeHttp return require(\"http\");\r\n\tstatic inline function get_https() : NodeHttps return require(\"https\");\r\n\tstatic inline function get_net() : NodeNet return require(\"net\");\r\n\tstatic inline function get_os() : NodeOs return require(\"os\");\r\n\tstatic inline function get_path() : NodePath return require(\"path\");\r\n\tstatic inline function get_querystring() : NodeQueryString return require(\"querystring\");\r\n\tstatic inline function get_repl() : NodeREPL return require(\"repl\");\r\n\tstatic inline function get_tls() : NodeTLS return require(\"tls\");\r\n\tstatic inline function get_url() : NodeUrl return require(\"url\");\r\n\tstatic inline function get_util() : NodeUtil return require(\"util\");\r\n\tstatic inline function get_vm() : NodeVM return require(\"vm\");\r\n\r\n\tstatic inline function get___filename() : String return untyped __js__('__filename');\r\n\tstatic inline function get___dirname() : String return untyped __js__('__dirname');\r\n\r\n\tpublic static function newSocket(?options):NodeNetSocket {\r\n\t\treturn untyped __js__(\"new js.Node.net.Socket(options)\");\r\n\t}\r\n\r\n\t#if !macro\r\n\tpublic static function __init__()\r\n\t{\r\n\t\tuntyped __js__(\"var module, setImmediate, clearImmediate\");\r\n\t\tsetTimeout = untyped __js__('setTimeout');\r\n\t\tclearTimeout = untyped __js__('clearTimeout');\r\n\t\tsetInterval = untyped __js__('setInterval');\r\n\t\tclearInterval = untyped __js__('clearInterval');\r\n\t\tglobal = untyped __js__('global');\r\n\t\tprocess = untyped __js__('process');\r\n\t\trequire = untyped __js__('require');\r\n\t\tconsole = untyped __js__('console');\r\n\t\tmodule = untyped __js__('module');\t// ref to the current module\r\n\t\tstringify = untyped __js__('JSON.stringify');\r\n\t\tparse = untyped __js__('JSON.parse');\r\n\t\t// Not present in Node < 0.9\r\n\t\tvar version = process.version.substr(1).split(\".\").map(Std.parseInt);\r\n\t\tif (version[0] > 0 || version[1] >= 9) {\r\n\t\t\tsetImmediate = untyped __js__('setImmediate');\r\n\t\t\tclearImmediate = untyped __js__('clearImmediate');\r\n\t\t}\r\n\t}\r\n\t#end\r\n}\r\n\r\n\r\n","package;\nimport jQuery.*;\nimport js.Browser;\nimport js.Node;\n\n@:keep @:expose class Utils\n\t{\n\tpublic static var gui = Node.require(\"nw.gui\");\n\tpublic static var path = Node.path;\n\t\n\t\n\tprivate static var fs:js.Node.NodeFS = Node.fs;\n\tprivate static var node_exec = Node.childProcess.exec;\n\tprivate static var node_os = Node.os;\n\t\n\t\n\tpublic static function checkFileExist(filename:String):Bool\n\t\t{\n\t\treturn Utils.fs.existsSync(filename);\n\t\t}\n\t\n\t// file manipulation\n\tpublic static function newFile(filename:String):Void\n\t\t{\n\t\tfs.openSync(filename,\"a+\");\n\t\t}\n\n\tpublic static function readFile(filename:String):String\n \t{\n\t\tvar ret = fs.readFileSync(filename,\"utf-8\");\n\t\treturn ret;\n \t}\n\n\n\tpublic static function saveFile(filename:String, content:String):Void\n \t{\n\t\tfs.writeFileSync(filename, content);\n\t\ttrace(\"SYSTEM: file saved \"+filename);\n \t}\n \n\n\n\n\n\t// folder manipulation\n public static function readDir(path:String):Array\n \t{\n \treturn fs.readdirSync(path);\n\t }\n \n \n // support\n \n\tpublic static function loadJS(script:String,callback:Dynamic):Void\n\t\t{\n\t\tJQueryStatic.ajaxSetup({async:false});\n\t\tJQueryStatic.getScript(script,callback(script));\n\t\tJQueryStatic.ajaxSetup({async:true});\n\t\t}\n\t\t\n\tpublic static function loadCSS(css:String):Void\n\t\t{\n\t\tnew JQuery(\"head\").append(\"\");\n\t\t}\n\t\t\n\t\t\n\tpublic static function repair_path(path:String):String\n\t\t{\n\t\tif (node_os.type() == \"Windows_NT\")\n\t\t\t{\n\t\t\tpath = StringTools.replace(path,\"\\\\\", \"\\\\\\\\\");\t\t\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t}\n\t\treturn path;\n\t\t}\t\t\n\t\t\n\tpublic static function exec(lines_to_exec:Array,callback:Dynamic)\n\t\t{\n\t\tvar os_type = \"\";\n\t\tvar join_str = \"\";\n\t\tvar join_str_cd = \"\";\n\t\tvar cat_service = \"\";\n\t\tvar quote = \"\";\n\t\t\n\t\tswitch(node_os.type())\n\t {\n\t\t\tcase \"Windows_NT\":\n\t\t\t\tos_type = \"WINDOWS\";\n\t\t\tcase \"Linux\":\n\t\t\t\tos_type = \"LINUX\";\n\t\t\tcase _:\n\t\t\t\tos_type = \"OTHER\";\n \t }\n\n\t\tif (os_type == \"LINUX\")\n\t\t\t{\n\t\t\tjoin_str = \" ; \";\n\t\t\tjoin_str_cd = \"\";\n\t\t\tcat_service = \" cat \";\n\t\t\tquote = '\"';\n\t\t\t}\n\t\telse if (os_type == \"WINDOWS\")\n\t\t\t{\n\t\t\tjoin_str = \" & \";\n\t\t\tjoin_str_cd = \" /D \";\n\t\t\tcat_service = \" type \";\n\t\t\tquote = '\"';\n\t\t\t}\t\t\t\n\t\telse // mac\n\t\t\t{\n\t\t\tjoin_str = \" ; \";\n\t\t\tjoin_str_cd = \"\";\n\t\t\tcat_service = \" cat \";\n\t\t\tquote = '\"';\n\t\t\t}\n\t\t\n\t\tvar exec_str = \"\";\n\t\tvar temp = \"\";\n\t\tvar exec_array:Array = [];\n\t\tfor (each in lines_to_exec)\n\t\t\t{\n\t\t\ttemp = StringTools.replace(each,\"%CD%\", join_str_cd);\n\t\t\ttemp = StringTools.replace(temp,\"%CAT%\", cat_service);\n\t\t\ttemp = StringTools.replace(temp,\"%QUOTE%\", quote);\n\t\t\texec_array.push(temp);\n\t\t\t}\n\t\texec_str = exec_array.join(join_str);\n\t\t//trace (exec_str);\n\t\tnode_exec(exec_str,{},function(error, stdout:String,stderr:String){\n\t\t\tif (error != null) // error\n\t\t\t\t{\n\t\t\t\tif (stdout!=\"\")\n\t\t\t\t\t{\n\t\t\t\t\tuntyped notify(stdout,\"danger\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcallback(error, stdout,stderr);\n\t\t\t});\n\t\t}\t\n\t\t\n \n\t}\n","/*\r\n * Copyright (c) 2005-2008, The haXe Project Contributors\r\n * All rights reserved.\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * - Redistributions of source code must retain the above copyright\r\n * notice, this list of conditions and the following disclaimer.\r\n * - Redistributions in binary form must reproduce the above copyright\r\n * notice, this list of conditions and the following disclaimer in the\r\n * documentation and/or other materials provided with the distribution.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE HAXE PROJECT CONTRIBUTORS \"AS IS\" AND ANY\r\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n * DISCLAIMED. IN NO EVENT SHALL THE HAXE PROJECT CONTRIBUTORS BE LIABLE FOR\r\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\r\n * DAMAGE.\r\n */\r\npackage haxe.io;\r\n\r\nclass Bytes {\r\n\r\n\tpublic var length(default,null) : Int;\r\n\tvar b : BytesData;\r\n\r\n\tfunction new(length,b) {\r\n\t\tthis.length = length;\r\n\t\tthis.b = b;\r\n\t}\r\n\r\n\tpublic inline function get( pos : Int ) : Int {\r\n\t\t#if neko\r\n\t\treturn untyped __dollar__sget(b,pos);\r\n\t\t#elseif flash9\r\n\t\treturn b[pos];\r\n\t\t#elseif php\r\n\t\treturn untyped __call__(\"ord\", b[pos]);\r\n\t\t#elseif cpp\r\n\t\treturn untyped b[pos];\r\n\t\t#else\r\n\t\treturn b[pos];\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic inline function set( pos : Int, v : Int ) : Void {\r\n\t\t#if neko\r\n\t\tuntyped __dollar__sset(b,pos,v);\r\n\t\t#elseif flash9\r\n\t\tb[pos] = v;\r\n\t\t#elseif php\r\n\t\tb[pos] = untyped __call__(\"chr\", v);\r\n\t\t#elseif cpp\r\n\t\tuntyped b[pos] = v;\r\n #elseif (nodejs || nodejs_std)\r\n b[pos] = v;\r\n\t\t#else\r\n\t\tb[pos] = v & 0xFF;\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function blit( pos : Int, src : Bytes, srcpos : Int, len : Int ) : Void {\r\n\t\t#if !neko\r\n\t\tif( pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length ) throw Error.OutsideBounds;\r\n\t\t#end\r\n\t\t#if neko\r\n\t\ttry untyped __dollar__sblit(b,pos,src.b,srcpos,len) catch( e : Dynamic ) throw Error.OutsideBounds;\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\tb = untyped __php__(\"substr($this->b, 0, $pos) . substr($src->b, $srcpos, $len) . substr($this->b, $pos+$len)\"); //__call__(\"substr\", b, 0, pos)+__call__(\"substr\", src.b, srcpos, len)+__call__(\"substr\", b, pos+len);\r\n\t\t#elseif flash9\r\n\t\tb.position = pos;\r\n\t\tb.writeBytes(src.b,srcpos,len);\r\n\t\t#elseif (nodejs || nodejs_std)\r\n src.getData().copy(b,pos,srcpos,srcpos+len);\r\n #else\r\n\t\tvar b1 = b;\r\n\t\tvar b2 = src.b;\r\n\t\tif( b1 == b2 && pos > srcpos ) {\r\n\t\t\tvar i = len;\r\n\t\t\twhile( i > 0 ) {\r\n\t\t\t\ti--;\r\n\t\t\t\tb1[i + pos] = b2[i + srcpos];\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor( i in 0...len )\r\n\t\t\tb1[i+pos] = b2[i+srcpos];\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function sub( pos : Int, len : Int ) : Bytes {\r\n\t\t#if !neko\r\n\t\tif( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;\r\n\t\t#end\r\n\t\t#if neko\r\n\t\treturn try new Bytes(len,untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;\r\n\t\t#elseif flash9\r\n\t\tb.position = pos;\r\n\t\tvar b2 = new flash.utils.ByteArray();\r\n\t\tb.readBytes(b2,0,len);\r\n\t\treturn new Bytes(len,b2);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn new Bytes(len, untyped __call__(\"substr\", b, pos, len));\r\n\t\t#elseif (nodejs || nodejs_std)\r\n\r\n /* node slice does not return a copy, so need a blit(copy) */\r\n var\r\n nb = new js.Node.NodeBuffer(len),\r\n slice:js.Node.NodeBuffer = b.slice(pos,pos+len);\r\n\r\n slice.copy(nb,0,0,len);\r\n\t\treturn new Bytes(len,nb);\r\n\t\t#else\r\n\t\treturn new Bytes(len,b.slice(pos,pos+len));\r\n #end\r\n\t}\r\n\r\n\tpublic function compare( other : Bytes ) : Int {\r\n\t\t#if neko\r\n\t\treturn untyped __dollar__compare(b,other.b);\r\n\t\t#elseif flash9\r\n\t\tvar len = (length < other.length) ? length : other.length;\r\n\t\tvar b1 = b;\r\n\t\tvar b2 = other.b;\r\n\t\tb1.position = 0;\r\n\t\tb2.position = 0;\r\n\t\tfor( i in 0...len>>2 )\r\n\t\t\tif( b1.readUnsignedInt() != b2.readUnsignedInt() ) {\r\n\t\t\t\tb1.position -= 4;\r\n\t\t\t\tb2.position -= 4;\r\n\t\t\t\treturn b1.readUnsignedInt() - b2.readUnsignedInt();\r\n\t\t\t}\r\n\t\tfor( i in 0...len & 3 )\r\n\t\t\tif( b1.readUnsignedByte() != b2.readUnsignedByte() )\r\n\t\t\t\treturn b1[b1.position-1] - b2[b2.position-1];\r\n\t\treturn length - other.length;\r\n\t\t#elseif php\r\n\t\treturn untyped __php__(\"$this->b < $other->b ? -1 : ($this->b == $other->b ? 0 : 1)\");\r\n\t\t#else\r\n\t\tvar b1 = b;\r\n\t\tvar b2 = other.b;\r\n\t\tvar len = (length < other.length) ? length : other.length;\r\n\t\tfor( i in 0...len )\r\n\t\t\tif( b1[i] != b2[i] )\r\n\t\t\t\t#if cpp\r\n\t\t\t\treturn untyped b1[i] - untyped b2[i];\r\n\t\t\t\t#else\r\n\t\t\t\treturn b1[i] - b2[i];\r\n\t\t\t\t#end\r\n\t\treturn length - other.length;\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function readString( pos : Int, len : Int ) : String {\r\n\t\t#if !neko\r\n\t\tif( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;\r\n\t\t#end\r\n\t\t#if neko\r\n\t\treturn try new String(untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;\r\n\t\t#elseif flash9\r\n\t\tb.position = pos;\r\n\t\treturn b.readUTFBytes(len);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn untyped __call__(\"substr\", b, pos, len);\r\n//\t\treturn untyped __call__(\"call_user_func_array\", \"pack\", __call__(\"array_merge\", __call__(\"array\", \"C*\"), __call__(\"array_slice\", b.ťa, pos, len)));\r\n\t\t#elseif cpp\r\n\t\tvar result:String=\"\";\r\n\t\tuntyped __global__.__hxcpp_string_of_bytes(b,result,pos,len);\r\n\t\treturn result;\r\n\t\t#else\r\n\t\tvar s = \"\";\r\n\t\tvar b = b;\r\n\t\tvar fcc = String.fromCharCode;\r\n\t\tvar i = pos;\r\n\t\tvar max = pos+len;\r\n\t\t// utf8-encode\r\n\t\twhile( i < max ) {\r\n\t\t\tvar c = b[i++];\r\n\t\t\tif( c < 0x80 ) {\r\n\t\t\t\tif( c == 0 ) break;\r\n\t\t\t\ts += fcc(c);\r\n\t\t\t} else if( c < 0xE0 )\r\n\t\t\t\ts += fcc( ((c & 0x3F) << 6) | (b[i++] & 0x7F) );\r\n\t\t\telse if( c < 0xF0 ) {\r\n\t\t\t\tvar c2 = b[i++];\r\n\t\t\t\ts += fcc( ((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (b[i++] & 0x7F) );\r\n\t\t\t} else {\r\n\t\t\t\tvar c2 = b[i++];\r\n\t\t\t\tvar c3 = b[i++];\r\n\t\t\t\ts += fcc( ((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 << 6) & 0x7F) | (b[i++] & 0x7F) );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn s;\r\n #else (nodejs || nodejs_std)\r\n return b.toString(js.Node.UTF8,pos,pos+len);\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function toString() : String {\r\n\t\t#if neko\r\n\t\treturn new String(untyped __dollar__ssub(b,0,length));\r\n\t\t#elseif flash9\r\n\t\tb.position = 0;\r\n\t\treturn b.readUTFBytes(length);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn cast b;\r\n//\t\treturn untyped __call__(\"call_user_func_array\", \"pack\", __call__(\"array_merge\", __call__(\"array\", \"C*\"), b.ťa));\r\n\t\t#else\r\n\t\treturn readString(0,length);\r\n\t\t#end\r\n\t}\r\n\t\r\n\tpublic function toHex() : String {\r\n\t\tvar s = new StringBuf();\r\n\t\tvar chars = [];\r\n\t\tvar str = \"0123456789abcdef\";\r\n\t\tfor( i in 0...str.length )\r\n\t\t\tchars.push(str.charCodeAt(i));\r\n\t\tfor( i in 0...length ) {\r\n\t\t\tvar c = get(i);\r\n\t\t\ts.addChar(chars[c >> 4]);\r\n\t\t\ts.addChar(chars[c & 15]);\r\n\t\t}\r\n\t\treturn s.toString();\r\n\t}\r\n\r\n\tpublic inline function getData() : BytesData {\r\n\t\treturn b;\r\n\t}\r\n\r\n\tpublic static function alloc( length : Int ) : Bytes {\r\n\t\t#if neko\r\n\t\treturn new Bytes(length,untyped __dollar__smake(length));\r\n\t\t#elseif flash9\r\n\t\tvar b = new flash.utils.ByteArray();\r\n\t\tb.length = length;\r\n\t\treturn new Bytes(length,b);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn new Bytes(length, untyped __call__(\"str_repeat\", __call__(\"chr\", 0), length));\r\n\t\t/*\r\n\t\tif(length > 0)\r\n\t\t\treturn new Bytes(length, untyped __call__(\"new _hx_array\", __call__(\"array_fill\", 0, length, 0)));\r\n\t\telse\r\n\t\t\treturn new Bytes(0, untyped __call__(\"new _hx_array\", __call__(\"array\")));\r\n\t\t*/\r\n\t\t#elseif cpp\r\n\t\tvar a = new BytesData();\r\n\t\tif (length>0) a[length-1] = untyped 0;\r\n\t\treturn new Bytes(length,a);\r\n\t\t#elseif (nodejs || nodejs_std)\r\n return new Bytes(length,new js.Node.NodeBuffer(length));\r\n\r\n #else\r\n\t\tvar a = new Array();\r\n\t\tfor( i in 0...length )\r\n\t\t\ta.push(0);\r\n\t\treturn new Bytes(length,a);\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic static function ofString( s : String ) : Bytes {\r\n\t\t#if neko\r\n\t\treturn new Bytes(s.length,untyped __dollar__ssub(s.__s,0,s.length));\r\n\t\t#elseif flash9\r\n\t\tvar b = new flash.utils.ByteArray();\r\n\t\tb.writeUTFBytes(s);\r\n\t\treturn new Bytes(b.length,b);\r\n\t\t#elseif php\r\n\t\treturn new Bytes(untyped __call__(\"strlen\", s), cast s);\r\n//\t\treturn ofData(untyped __call__(\"new _hx_array\", __call__(\"array_values\", __call__(\"unpack\", \"C*\", s))));\r\n\t\t#elseif cpp\r\n\t\tvar a = new BytesData();\r\n\t\tuntyped __global__.__hxcpp_bytes_of_string(a,s);\r\n\t\treturn new Bytes(a.length,a);\r\n\t\t#elseif (nodejs || nodejs_std)\r\n var nb = new js.Node.NodeBuffer(s, js.Node.NodeC.UTF8);\r\n return new Bytes(nb.length,nb);\r\n #else\r\n\t\tvar a = new Array();\r\n\t\t// utf8-decode\r\n\t\tfor( i in 0...s.length ) {\r\n\t\t\tvar c : Int = untyped s[\"cca\"](i);\r\n\t\t\tif( c <= 0x7F )\r\n\t\t\t\ta.push(c);\r\n\t\t\telse if( c <= 0x7FF ) {\r\n\t\t\t\ta.push( 0xC0 | (c >> 6) );\r\n\t\t\t\ta.push( 0x80 | (c & 63) );\r\n\t\t\t} else if( c <= 0xFFFF ) {\r\n\t\t\t\ta.push( 0xE0 | (c >> 12) );\r\n\t\t\t\ta.push( 0x80 | ((c >> 6) & 63) );\r\n\t\t\t\ta.push( 0x80 | (c & 63) );\r\n\t\t\t} else {\r\n\t\t\t\ta.push( 0xF0 | (c >> 18) );\r\n\t\t\t\ta.push( 0x80 | ((c >> 12) & 63) );\r\n\t\t\t\ta.push( 0x80 | ((c >> 6) & 63) );\r\n\t\t\t\ta.push( 0x80 | (c & 63) );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Bytes(a.length,a);\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic static function ofData( b : BytesData ) {\r\n\t\t#if flash9\r\n\t\treturn new Bytes(b.length,b);\r\n\t\t#elseif neko\r\n\t\treturn new Bytes(untyped __dollar__ssize(b),b);\r\n\t\t#elseif php\r\n\t\treturn new Bytes(untyped __call__(\"strlen\", b), b);\r\n\t\t#else\r\n\t\treturn new Bytes(b.length,b);\r\n\t\t#end\r\n\t}\r\n\r\n}\r\n","package ui;\r\n\r\nimport jQuery.*;\r\nimport js.Browser;\r\n\r\n\r\n@:keep @:expose @:native(\"ui.FileDialog\") class FileDialog\r\n{\r\n\tpublic function new():Void\r\n\t{\r\n\t}\r\n\t\r\n\tpublic function show(function_name, saveAs:Bool=false)\r\n\t{\r\n\t\tif (saveAs == false)\r\n\t\t{\r\n\t\tnew JQuery('#temp').html(\"\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\tnew JQuery('#temp').html(\"\");\t\t\t\r\n\t\t}\r\n\r\n\r\n\t\tvar chooser = new JQuery(\"#temp_fileDialog\");\r\n\t\tchooser.change(function(evt) {\r\n\t\t\tvar filepath = chooser.val();\r\n\t\t\t//new JQuery(js.Browser.document).triggerHandler(event_name,filepath);\r\n\t\t\t//untyped $(document).triggerHandler(event_name,filepath);\r\n\t\t\tfunction_name(filepath);\r\n\t\t\t});\r\n\t\tchooser.trigger('click'); \r\n\r\n\t}\r\n}\r\n","package ui;\r\n\r\nimport jQuery.*;\r\n\r\n@:keep @:expose @:native(\"ui.ModalDialog\") class ModalDialog\r\n{\r\n\tpublic var id:String;\r\n\tpublic var title:String;\r\n\tpublic var content:String;\r\n\tpublic var ok_text:String;\r\n\tpublic var cancel_text:String;\r\n\tpublic var footer:Bool;\r\n\tpublic var header:Bool;\r\n\t\r\n\t\r\n\t\r\n\tpublic function new()\r\n\t{\r\n\t\ttitle = '';\r\n\t\tid = '';\r\n\t\tcontent = '';\r\n\t\theader = true;\r\n\t\tfooter = true;\r\n\t\tok_text = '';\r\n\t\tcancel_text = '';\r\n\t}\r\n\t\r\n\tpublic function updateModalDialog()\r\n\t{\r\n\t\tvar retStr = [\"\"].join(\"\\n\");\r\n\r\n\t\tnew JQuery(\"#modal_position\").html(retStr);\r\n\t\tnew JQuery(\"#style_overide\").append(\"\");\r\n\t}\r\n\t\r\n\tpublic function show()\r\n\t{\r\n\t\tupdateModalDialog();\t\r\n\t\r\n\t\t// using untyped\r\n\t\t// http://haxe.org/doc/js/extern_libraries\r\n\t\tuntyped new JQuery(\"#\"+id).modal(\"show\");\r\n\t\t\r\n\t\tnew JQuery('#'+id).on('hidden.bs.modal', function () {\r\n\t\t\tnew JQuery(\"#\"+id).remove();\r\n\t\t});\t\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\tpublic function hide()\r\n\t{\r\n\t\t// using untyped\r\n\t\t// http://haxe.org/doc/js/extern_libraries\r\n\t\tuntyped new JQuery(\"#\"+id).modal(\"hide\");\r\n\t}\r\n}","package ui;\r\n\r\nimport jQuery.*;\r\n\r\n@:keep @:expose @:native(\"ui.Notify\") class Notify\r\n{\r\n\tpublic var type:String;\r\n\tpublic var content:String;\r\n\t\r\n\t\r\n\t\r\n\tpublic function new()\r\n\t{\t\r\n\t\ttype = '';\r\n\t\tcontent = '';\r\n\t}// end new\r\n\t\r\n\t\r\n\t\r\n\tpublic function show()\r\n\t{\r\n\t\tvar type_error = '';\r\n\t\tvar type_error_text = '';\r\n\t\tvar skip = true;\r\n\t\t\r\n\t\tif (type == \"error\")\r\n\t\t{\r\n\t\t\ttype_error = \"danger\";\r\n\t\t\ttype_error_text = \"Error\";\r\n\t\t\tskip = false;\r\n\t\t}\r\n\t\telse if (type == \"warning\")\r\n\t\t{\r\n\t\t\ttype_error = \"warning\";\r\n\t\t\ttype_error_text = \"Warning\";\r\n\t\t\tskip = false;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\ttype_error = \"warning\";\r\n\t\t\ttype_error_text = \"\";\r\n\t\t\tskip = false;\t\t\t\r\n\t\t}\r\n\r\n\t\r\n\t\tif (skip == false)\r\n\t\t{\r\n\t\t\tvar retStr = ['
',\r\n\t\t\t'×',\r\n\t\t\t''+type_error_text+'
'+content,\r\n\t\t\t'
'].join(\"\\n\");\r\n\t\t\t\r\n\t\t\t new JQuery('#notify_position').html(retStr); \r\n\t\t}\r\n\t} // end show\r\n}"], +"sourcesContent":["package ;\r\n\r\n@:keep @:expose class FileObject\r\n{\r\n\tprivate var file_stack:Array;\r\n\t// array[0] = path\r\n\t// array[1] = content\r\n\t// array[2] = className\r\n\r\n\tpublic function new()\r\n\t\t{\r\n\t\tfile_stack = new Array();\r\n\t\t}\r\n\r\n\r\n\tpublic function add(path:String,content:String,className:String)\r\n\t\t{\r\n\t\tvar a = new Array();\r\n\t\ta[0] = path;\r\n\t\ta[1] = content;\r\n\t\ta[2] = className;\r\n\t\treturn file_stack.push(a);\r\n\t\t}\r\n\r\n\tpublic function find(path:String):Array\r\n\t\t{\r\n\t\tif (file_stack.length > 0)\r\n\t\t\t{\r\n\t\t\tvar position = 0;\r\n\t\t\tfor (each in file_stack)\r\n\t\t\t\t{\r\n\t\t\t\tif (each[0] == path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\treturn each;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition += 1;\t\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\treturn [\"not found\"];\r\n\t\t\t}\r\n\t\telse\r\n\t\t\t{\r\n\t\t\treturn [\"null\"];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tpublic function update_content(path:String,new_content:String)\r\n\t\t{\r\n\t\tif (file_stack.length > 0)\r\n\t\t\t{\t\t\t\r\n\t\t\tvar position = 0;\r\n\t\t\tfor (each in file_stack)\r\n\t\t\t\t{\r\n\t\t\t\tif (each[0] == path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tfile_stack[position][1] = new_content;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition += 1;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\tpublic function remove(path:String)\r\n\t\t{\r\n\t\tif (file_stack.length > 0)\r\n\t\t\t{\t\t\t\r\n\t\t\tvar position = 0;\r\n\t\t\tfor (each in file_stack)\r\n\t\t\t\t{\r\n\t\t\t\tif (each[0] == path)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t//return each;\r\n\t\t\t\t\t//each[1] = new_content;\r\n\t\t\t\t\tfile_stack.splice(position,1);\r\n\t\t\t\t\t//[position][1] = new_content;\r\n\t\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\tposition += 1;\r\n\t\t\t\t\t}\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:noDoc\nclass HxOverrides {\n\n\tstatic function dateStr( date :Date ) : String {\n\t\tvar m = date.getMonth() + 1;\n\t\tvar d = date.getDate();\n\t\tvar h = date.getHours();\n\t\tvar mi = date.getMinutes();\n\t\tvar s = date.getSeconds();\n\t\treturn date.getFullYear()\n\t\t\t+\"-\"+(if( m < 10 ) \"0\"+m else \"\"+m)\n\t\t\t+\"-\"+(if( d < 10 ) \"0\"+d else \"\"+d)\n\t\t\t+\" \"+(if( h < 10 ) \"0\"+h else \"\"+h)\n\t\t\t+\":\"+(if( mi < 10 ) \"0\"+mi else \"\"+mi)\n\t\t\t+\":\"+(if( s < 10 ) \"0\"+s else \"\"+s);\n\t}\n\n\tstatic function strDate( s : String ) : Date {\n\t\tswitch( s.length ) {\n\t\tcase 8: // hh:mm:ss\n\t\t\tvar k = s.split(\":\");\n\t\t\tvar d : Date = untyped __new__(Date);\n\t\t\tuntyped d[\"setTime\"](0);\n\t\t\tuntyped d[\"setUTCHours\"](k[0]);\n\t\t\tuntyped d[\"setUTCMinutes\"](k[1]);\n\t\t\tuntyped d[\"setUTCSeconds\"](k[2]);\n\t\t\treturn d;\n\t\tcase 10: // YYYY-MM-DD\n\t\t\tvar k = s.split(\"-\");\n\t\t\treturn new Date(cast k[0],cast untyped k[1] - 1,cast k[2],0,0,0);\n\t\tcase 19: // YYYY-MM-DD hh:mm:ss\n\t\t\tvar k = s.split(\" \");\n\t\t\tvar y = k[0].split(\"-\");\n\t\t\tvar t = k[1].split(\":\");\n\t\t\treturn new Date(cast y[0],cast untyped y[1] - 1,cast y[2],cast t[0],cast t[1],cast t[2]);\n\t\tdefault:\n\t\t\tthrow \"Invalid date format : \" + s;\n\t\t}\n\t}\n\n\tstatic function cca( s : String, index : Int ) : Null {\n\t\t#if mt\n\t\tvar x = (cast s).cca(index);\n\t\t#else\n\t\tvar x = (cast s).charCodeAt(index);\n\t\t#end\n\t\tif( x != x ) // fast isNaN\n\t\t\treturn untyped undefined; // isNaN will still return true\n\t\treturn x;\n\t}\n\n\tstatic function substr( s : String, pos : Int, ?len : Int ) : String {\n\t\tif( pos != null && pos != 0 && len != null && len < 0 ) return \"\";\n\t\tif( len == null ) len = s.length;\n\t\tif( pos < 0 ){\n\t\t\tpos = s.length + pos;\n\t\t\tif( pos < 0 ) pos = 0;\n\t\t}else if( len < 0 ){\n\t\t\tlen = s.length + len - pos;\n\t\t}\n\n\t\treturn (untyped s).substr(pos, len);\n\t}\n\n\tstatic function indexOf( a : Array, obj : T, i : Int) {\n\t\tvar len = a.length;\n\t\tif (i < 0) {\n\t\t\ti += len;\n\t\t\tif (i < 0) i = 0;\n\t\t}\n\t\twhile (i < len)\n\t\t{\n\t\t\tif (untyped __js__(\"a[i] === obj\"))\n\t\t\t\treturn i;\n\t\t\ti++;\n\t\t}\n\t\treturn -1;\n\t}\n\n\tstatic function lastIndexOf( a : Array, obj : T, i : Int) {\n\t\tvar len = a.length;\n\t\tif (i >= len)\n\t\t\ti = len - 1;\n\t\telse if (i < 0)\n\t\t\ti += len;\n\t\twhile (i >= 0)\n\t\t{\n\t\t\tif (untyped __js__(\"a[i] === obj\"))\n\t\t\t\treturn i;\n\t\t\ti--;\n\t\t}\n\t\treturn -1;\n\t}\n\n\tstatic function remove( a : Array, obj : T ) {\n\t\tvar i = a.indexOf(obj);\n\t\tif( i == -1 ) return false;\n\t\ta.splice(i,1);\n\t\treturn true;\n\t}\n\n\tstatic function iter( a : Array ) : Iterator untyped {\n\t\treturn {\n\t\t\tcur : 0,\n\t\t\tarr : a,\n\t\t\thasNext : function() {\n\t\t\t\treturn __this__.cur < __this__.arr.length;\n\t\t\t},\n\t\t\tnext : function() {\n\t\t\t\treturn __this__.arr[__this__.cur++];\n\t\t\t}\n\t\t};\n\t}\n\n\tstatic function __init__() untyped {\n#if !js_es5\n\t\t__feature__('HxOverrides.indexOf', if( Array.prototype.indexOf ) __js__(\"HxOverrides\").indexOf = function(a,o,i) return Array.prototype.indexOf.call(a, o, i));\n\t\t__feature__('HxOverrides.lastIndexOf', if( Array.prototype.lastIndexOf ) __js__(\"HxOverrides\").lastIndexOf = function(a,o,i) return Array.prototype.lastIndexOf.call(a, o, i));\n#end\n\n#if mt\n\t\tif( String.prototype.cca == null ) String.prototype.cca = String.prototype.charCodeAt;\n#end\n\t}\n\n}\n","package;\r\nimport Utils;\r\nimport core.*;\r\nimport js.html.Document;\r\nimport jQuery.*;\r\n@:keep @:expose class Main \r\n{\r\n\tstatic public var session:Session;\r\n\tstatic public var message:Message;\r\n\tstatic public var file_stack:FileObject;\r\n\tstatic public var version:String;\r\n\tprivate static var plugin_loading_sequence:Array;\r\n\t\r\n\t\r\n\tstatic public function main():Void\r\n\t\t{\r\n\t\t}\r\n\r\n\tstatic public function run_haxe_studio():Void\r\n\t\t{\r\n\t\tversion = \"0.2 beta\";\r\n\t\tsession = new Session();\r\n\t\tfile_stack = new FileObject();\r\n\t\tmessage = new Message();\r\n\t\t\r\n\t\t// init ui\r\n\t\tnew ui.Notify();\r\n\t\tnew ui.FileDialog();\r\n \tnew ui.ModalDialog();\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\tvar root_path = untyped root;\r\n\t\tplugin_solve_dependency(root_path+\"/plugin\");\r\n\t\tplugin_loading_sequence.reverse();\r\n\t\tplugin_load_all(root_path+\"/plugin\",plugin_loading_sequence);\r\n\t\t\r\n\t\t}\r\n\t\r\n\t\r\n\tstatic public function plugin_load_all(path:String,dependency_sequence:Array)\r\n\t\t{\r\n\t\tfor (each in dependency_sequence)\r\n\t\t\t{\r\n\t\t\tif (each != \"\")\r\n\t\t\t\t{\r\n\t\t\t\ttrace(each);\r\n\t\t\t\tUtils.loadJS(path+\"/\"+each+\"/bin/plugin.js\",function(script){});\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\r\n\tstatic public function plugin_solve_dependency(path:String)\r\n\t\t{\r\n\t\tvar available_plugin = Utils.readDir(path);\r\n\t\t\r\n\t\tvar plugin = new Array();\r\n\t\tfor (each in available_plugin)\r\n\t\t\t{\r\n\t\t\tplugin.push(JSON.parse(Utils.readFile(path+\"/\"+each+\"/bin/plugin.json\")));\r\n\t\t\t}\r\n\t\t\r\n\t\tvar build_load_sequence = new Array();\r\n\t\tfor (each in plugin)\r\n\t\t\t{\r\n\t\t\tif (each.dependency.length >= 1)\r\n\t\t\t\t{\r\n\t\t\t\tvar temp = new Array();\r\n\t\t\t\r\n\t\t\t\t// reconstruct variable because \"each.dependency\" can't be access by array;\r\n\t\t\t\tvar key = Reflect.fields(each.dependency);\r\n\t\t\t\tfor (each_key in key)\r\n\t\t\t\t\t{\r\n\t\t\t\t\ttemp.push(Reflect.field(each.dependency, each_key));\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tfor (each2 in temp)\r\n\t\t\t\t\t{\r\n\t\t\t\t\tbuild_load_sequence.push([each.actualName,each2]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\tbuild_load_sequence.push( [each.actualName,\"\"]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\tvar plugin_loading_sequence_obj = untyped tsort(build_load_sequence);\r\n\t\tplugin_loading_sequence = untyped plugin_loading_sequence_obj.path;\t\t\r\n\t\t}\r\n\t\t\r\n}\r\n","package;\r\nimport jQuery.*;\r\n\r\nclass Message\r\n{\r\n\tprivate var broadcast_message:Array>;\r\n\tprivate var listen_message:Array>;\r\n\t\r\n\tpublic function new()\r\n\t{\r\n\t\tbroadcast_message = new Array();\r\n\t\tlisten_message = new Array();\r\n\t}\r\n\t\r\n\tpublic function broadcast(message:String,caller_name:String,parameter:Array)\r\n\t{\r\n\t\tvar temp = new Array();\r\n\t\ttemp.push(message);\r\n\t\ttemp.push(caller_name);\t\r\n\t\tbroadcast_message.push(temp);\r\n\t\tuntyped EventBus.dispatch(message,caller_name,parameter);\r\n\t}\r\n\t\r\n\tpublic function listen(message:String,caller_name:String,callback_function:Dynamic)\r\n\t{\r\n\t\tvar temp = new Array();\r\n\t\ttemp.push(message);\t\r\n\t\ttemp.push(caller_name);\r\n\t\tlisten_message.push(temp);\r\n\t\tuntyped EventBus.addEventListener(message,callback_function, caller_name);\r\n\t}\r\n\t\r\n\tpublic function list_broadcast()\r\n\t{\r\n\t\treturn broadcast_message;\r\n\t}\r\n\r\n\tpublic function list_listen()\r\n\t{\r\n\t\treturn listen_message;\r\n\t}\t\r\n}\r\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n@:coreApi class Reflect {\n\n\tpublic inline static function hasField( o : Dynamic, field : String ) : Bool {\n\t\treturn untyped __js__('Object').prototype.hasOwnProperty.call(o, field);\n\t}\n\n\tpublic static function field( o : Dynamic, field : String ) : Dynamic untyped {\n\t\treturn try o[field] catch( e : Dynamic ) null;\n\t}\n\n\tpublic inline static function setField( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\to[field] = value;\n\t}\n\n\tpublic static inline function getProperty( o : Dynamic, field : String ) : Dynamic untyped {\n\t\tvar tmp;\n\t\treturn if( o == null ) __define_feature__(\"Reflect.getProperty\",null) else if( o.__properties__ && (tmp=o.__properties__[\"get_\"+field]) ) o[tmp]() else o[field];\n\t}\n\n\tpublic static inline function setProperty( o : Dynamic, field : String, value : Dynamic ) : Void untyped {\n\t\tvar tmp;\n\t\tif( o.__properties__ && (tmp=o.__properties__[\"set_\"+field]) ) o[tmp](value) else o[field] = __define_feature__(\"Reflect.setProperty\",value);\n\t}\n\n\tpublic inline static function callMethod( o : Dynamic, func : Dynamic, args : Array ) : Dynamic untyped {\n\t\treturn func.apply(o,args);\n\t}\n\n\tpublic static function fields( o : Dynamic ) : Array {\n\t\tvar a = [];\n\t\tif (o != null) untyped {\n\t\t\tvar hasOwnProperty = __js__('Object').prototype.hasOwnProperty;\n\t\t\t__js__(\"for( var f in o ) {\");\n\t\t\tif( f != \"__id__\" && f != \"hx__closures__\" && hasOwnProperty.call(o, f) ) a.push(f);\n\t\t\t__js__(\"}\");\n\t\t}\n\t\treturn a;\n\t}\n\n\tpublic static function isFunction( f : Dynamic ) : Bool untyped {\n\t\treturn __js__(\"typeof(f)\") == \"function\" && !(js.Boot.isClass(f) || js.Boot.isEnum(f));\n\t}\n\n\tpublic static function compare( a : T, b : T ) : Int {\n\t\treturn ( a == b ) ? 0 : (((cast a) > (cast b)) ? 1 : -1);\n\t}\n\n\tpublic static function compareMethods( f1 : Dynamic, f2 : Dynamic ) : Bool {\n\t\tif( f1 == f2 )\n\t\t\treturn true;\n\t\tif( !isFunction(f1) || !isFunction(f2) )\n\t\t\treturn false;\n\t\treturn f1.scope == f2.scope && f1.method == f2.method && f1.method != null;\n\t}\n\n\tpublic static function isObject( v : Dynamic ) : Bool untyped {\n\t\tif( v == null )\n\t\t\treturn false;\n\t\tvar t = __js__(\"typeof(v)\");\n\t\treturn (t == \"string\" || (t == \"object\" && v.__enum__ == null)) || (t == \"function\" && (js.Boot.isClass(v) || js.Boot.isEnum(v)) != null);\n\t}\n\n\tpublic static function isEnumValue( v : Dynamic ) : Bool {\n\t\treturn v != null && v.__enum__ != null;\n\t}\n\n\tpublic static function deleteField( o : Dynamic, field : String ) : Bool untyped {\n\t\tif( !hasField(o,field) ) return false;\n\t\t__js__(\"delete\")(o[field]);\n\t\treturn true;\n\t}\n\n\tpublic static function copy( o : T ) : T {\n\t\tvar o2 : Dynamic = {};\n\t\tfor( f in Reflect.fields(o) )\n\t\t\tReflect.setField(o2,f,Reflect.field(o,f));\n\t\treturn o2;\n\t}\n\n\t@:overload(function( f : Array -> Void ) : Dynamic {})\n\tpublic static function makeVarArgs( f : Array -> Dynamic ) : Dynamic {\n\t\treturn function() {\n\t\t\tvar a = untyped Array.prototype.slice.call(__js__(\"arguments\"));\n\t\t\treturn f(a);\n\t\t};\n\t}\n\n}\n","package ;\r\n\r\n@:keep @:expose class Session\r\n{\r\n\tpublic var project_xml:String;\r\n\tpublic var project_xml_parameter:String;\r\n\tpublic var project_folder:String;\r\n\tpublic var active_file:String;\r\n\r\n\tpublic function new()\r\n\t{\r\n\t\tproject_xml = \"\";\r\n\t\tproject_xml_parameter = \"\";\r\n\t\tproject_folder = \"\";\r\n\t\tactive_file = \"\";\r\n\t}\r\n}","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\nimport js.Boot;\n\n@:keepInit\n@:coreApi class Std {\n\n\tpublic static inline function is( v : Dynamic, t : Dynamic ) : Bool {\n\t\treturn untyped js.Boot.__instanceof(v,t);\n\t}\n\n\tpublic static inline function instance( value : T, c : Class ) : S {\n\t\treturn untyped __instanceof__(value, c) ? cast value : null;\n\t}\n\n\tpublic static function string( s : Dynamic ) : String {\n\t\treturn untyped js.Boot.__string_rec(s,\"\");\n\t}\n\n\tpublic static inline function int( x : Float ) : Int {\n\t\treturn cast(x) | 0;\n\t}\n\n\tpublic static function parseInt( x : String ) : Null {\n\t\tvar v = untyped __js__(\"parseInt\")(x, 10);\n\t\t// parse again if hexadecimal\n\t\tif( v == 0 && (x.charCodeAt(1) == 'x'.code || x.charCodeAt(1) == 'X'.code) )\n\t\t\tv = untyped __js__(\"parseInt\")(x);\n\t\tif( untyped __js__(\"isNaN\")(v) )\n\t\t\treturn null;\n\t\treturn cast v;\n\t}\n\n\tpublic static function parseFloat( x : String ) : Float {\n\t\treturn untyped __js__(\"parseFloat\")(x);\n\t}\n\n\tpublic static function random( x : Int ) : Int {\n\t\treturn untyped x <= 0 ? 0 : Math.floor(Math.random()*x);\n\t}\n\n\tstatic function __init__() : Void untyped {\n\t\t__feature__(\"js.Boot.getClass\",String.prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"String\"] = String,String));\n\t\t__feature__(\"js.Boot.isClass\",String.__name__ = __feature__(\"Type.getClassName\",[\"String\"],true));\n\t\t__feature__(\"Type.resolveClass\",$hxClasses[\"Array\"] = Array);\n\t\t__feature__(\"js.Boot.isClass\",Array.__name__ = __feature__(\"Type.getClassName\",[\"Array\"],true));\n\t\t__feature__(\"Date.*\", {\n\t\t\t__feature__(\"js.Boot.getClass\",__js__('Date').prototype.__class__ = __feature__(\"Type.resolveClass\",$hxClasses[\"Date\"] = __js__('Date'),__js__('Date')));\n\t\t\t__feature__(\"js.Boot.isClass\",__js__('Date').__name__ = [\"Date\"]);\n\t\t});\n\t\t__feature__(\"Int.*\",{\n\t\t\tvar Int = __feature__(\"Type.resolveClass\", $hxClasses[\"Int\"] = { __name__ : [\"Int\"] }, { __name__ : [\"Int\"] });\n\t\t});\n\t\t__feature__(\"Dynamic.*\",{\n\t\t\tvar Dynamic = __feature__(\"Type.resolveClass\", $hxClasses[\"Dynamic\"] = { __name__ : [\"Dynamic\"] }, { __name__ : [\"Dynamic\"] });\n\t\t});\n\t\t__feature__(\"Float.*\",{\n\t\t\tvar Float = __feature__(\"Type.resolveClass\", $hxClasses[\"Float\"] = __js__(\"Number\"), __js__(\"Number\"));\n\t\t\tFloat.__name__ = [\"Float\"];\n\t\t});\n\t\t__feature__(\"Bool.*\",{\n\t\t\tvar Bool = __feature__(\"Type.resolveEnum\",$hxClasses[\"Bool\"] = __js__(\"Boolean\"), __js__(\"Boolean\"));\n\t\t\tBool.__ename__ = [\"Bool\"];\n\t\t});\n\t\t__feature__(\"Class.*\",{\n\t\t\tvar Class = __feature__(\"Type.resolveClass\", $hxClasses[\"Class\"] = { __name__ : [\"Class\"] }, { __name__ : [\"Class\"] });\n\t\t});\n\t\t__feature__(\"Enum.*\",{\n\t\t\tvar Enum = {};\n\t\t});\n\t\t__feature__(\"Void.*\",{\n\t\t\tvar Void = __feature__(\"Type.resolveEnum\", $hxClasses[\"Void\"] = { __ename__ : [\"Void\"] }, { __ename__ : [\"Void\"] });\n\t\t});\n\n#if !js_es5\n\t\t__feature__(\"Array.map\",\n\t\t\tif( Array.prototype.map == null )\n\t\t\t\tArray.prototype.map = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length )\n\t\t\t\t\t\ta[i] = f(__this__[i]);\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n\t\t__feature__(\"Array.filter\",\n\t\t\tif( Array.prototype.filter == null )\n\t\t\t\tArray.prototype.filter = function(f) {\n\t\t\t\t\tvar a = [];\n\t\t\t\t\tfor( i in 0...__this__.length ) {\n\t\t\t\t\t\tvar e = __this__[i];\n\t\t\t\t\t\tif( f(e) ) a.push(e);\n\t\t\t\t\t}\n\t\t\t\t\treturn a;\n\t\t\t\t}\n\t\t);\n#end\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n\tA String buffer is an efficient way to build a big string by appending small\n\telements together.\n\n\tIts cross-platform implementation uses String concatenation internally, but\n\tStringBuf may be optimized for different targets.\n\n\tUnlike String, an instance of StringBuf is not immutable in the sense that\n\tit can be passed as argument to functions which modify it by appending more\n\tvalues. However, the internal buffer cannot be modified.\n**/\nclass StringBuf {\n\n\tvar b:String = \"\";\n\n\t/**\n\t\tThe length of `this` StringBuf in characters.\n\t**/\n\tpublic var length(get,never) : Int;\n\n\t/**\n\t\tCreates a new StringBuf instance.\n\n\t\tThis may involve initialization of the internal buffer.\n\t**/\n\tpublic function new() {}\n\n\tinline function get_length() : Int {\n\t\treturn b.length;\n\t}\n\n\t/**\n\t\tAppends the representation of `x` to `this` StringBuf.\n\n\t\tThe exact representation of `x` may vary per platform. To get more\n\t\tconsistent behavior, this function should be called with\n\t\tStd.string(x).\n\n\t\tIf `x` is null, the String \"null\" is appended.\n\t**/\n\tpublic inline function add( x : T ) : Void {\n\t\tb += x;\n\t}\n\n\t/**\n\t\tAppends the character identified by `c` to `this` StringBuf.\n\n\t\tIf `c` is negative or has another invalid value, the result is\n\t\tunspecified.\n\t**/\n\tpublic inline function addChar( c : Int ) : Void {\n\t\tb += String.fromCharCode(c);\n\t}\n\n\t/**\n\t\tAppends a substring of `s` to `this` StringBuf.\n\n\t\tThis function expects `pos` and `len` to describe a valid substring of\n\t\t`s`, or else the result is unspecified. To get more robust behavior,\n\t\t`this.add(s.substr(pos,len))` can be used instead.\n\n\t\tIf `s` or `pos` are null, the result is unspecified.\n\n\t\tIf `len` is omitted or null, the substring ranges from `pos` to the end\n\t\tof `s`.\n\t**/\n\tpublic inline function addSub( s : String, pos : Int, ?len : Int) : Void {\n\t\tb += (len == null ? s.substr(pos) : s.substr(pos, len));\n\t}\n\n\t/**\n\t\tReturns the content of `this` StringBuf as String.\n\n\t\tThe buffer is not emptied by this operation.\n\t**/\n\tpublic inline function toString() : String {\n\t\treturn b;\n\t}\n\n}\n","/*\n * Copyright (C)2005-2012 Haxe Foundation\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the \"Software\"),\n * to deal in the Software without restriction, including without limitation\n * the rights to use, copy, modify, merge, publish, distribute, sublicense,\n * and/or sell copies of the Software, and to permit persons to whom the\n * Software is furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER\n * DEALINGS IN THE SOFTWARE.\n */\n/**\n\tThis class provides advanced methods on Strings. It is ideally used with\n\t'using StringTools' and then acts as an extension to the String class.\n\n\tIf the first argument to any of the methods is null, the result is\n\tunspecified.\n**/\n#if cs\n@:keep\n#end\nclass StringTools {\n\t/**\n\t\tEncode an URL by using the standard format.\n\t**/\n\t#if (!java && !cpp) inline #end public static function urlEncode( s : String ) : String untyped {\n\t\t#if flash9\n\t\t\treturn __global__[\"encodeURIComponent\"](s);\n\t\t#elseif flash\n\t\t\treturn _global[\"escape\"](s);\n\t\t#elseif neko\n\t\t\treturn new String(_urlEncode(s.__s));\n\t\t#elseif js\n\t\t\treturn encodeURIComponent(s);\n\t\t#elseif cpp\n\t\t\treturn s.__URLEncode();\n\t\t#elseif java\n\t\t\ttry\n\t\t\t\treturn untyped __java__(\"java.net.URLEncoder.encode(s, \\\"UTF-8\\\")\")\n\t\t\tcatch (e:Dynamic) throw e;\n\t\t#elseif cs\n\t\t\treturn cs.system.Uri.EscapeUriString(s);\n\t\t#else\n\t\t\treturn null;\n\t\t#end\n\t}\n\n\t/**\n\t\tDecode an URL using the standard format.\n\t**/\n\t#if (!java && !cpp) inline #end public static function urlDecode( s : String ) : String untyped {\n\t\t#if flash9\n\t\t\treturn __global__[\"decodeURIComponent\"](s.split(\"+\").join(\" \"));\n\t\t#elseif flash\n\t\t\treturn _global[\"unescape\"](s);\n\t\t#elseif neko\n\t\t\treturn new String(_urlDecode(s.__s));\n\t\t#elseif js\n\t\t\treturn decodeURIComponent(s.split(\"+\").join(\" \"));\n\t\t#elseif cpp\n\t\t\treturn s.__URLDecode();\n\t\t#elseif java\n\t\t\ttry\n\t\t\t\treturn untyped __java__(\"java.net.URLDecoder.decode(s, \\\"UTF-8\\\")\")\n\t\t\tcatch (e:Dynamic) throw e;\n\t\t#elseif cs\n\t\t\treturn cs.system.Uri.UnescapeDataString(s);\n\t\t#else\n\t\t\treturn null;\n\t\t#end\n\t}\n\n\t/**\n\t\tEscapes HTML special characters of the string `s`.\n\n\t\tThe following replacements are made:\n\n\t\t- `&` becomes `&`;\n\t\t- `<` becomes `<`;\n\t\t- `>` becomes `>`;\n\n\t\tIf `quotes` is true, the following characters are also replaced:\n\n\t\t- `\"` becomes `"`;\n\t\t- `'` becomes `'`;\n\t**/\n\tpublic static function htmlEscape( s : String, ?quotes : Bool ) : String {\n\t\ts = s.split(\"&\").join(\"&\").split(\"<\").join(\"<\").split(\">\").join(\">\");\n\t\treturn quotes ? s.split('\"').join(\""\").split(\"'\").join(\"'\") : s;\n\t}\n\n\t/**\n\t\tUnescapes HTML special characters of the string `s`.\n\n\t\tThis is the inverse operation to htmlEscape, i.e. the following always\n\t\tholds: htmlUnescape(htmlEscape(s)) == s\n\n\t\tThe replacements follow:\n\n\t\t- `&` becomes `&`\n\t\t- `<` becomes `<`\n\t\t- `>` becomes `>`\n\t\t- `"` becomes `\"`\n\t\t- `'` becomes `'`\n\t**/\n\tpublic static function htmlUnescape( s : String ) : String {\n\t\treturn s.split(\">\").join(\">\").split(\"<\").join(\"<\").split(\""\").join('\"').split(\"'\").join(\"'\").split(\"&\").join(\"&\");\n\t}\n\n\t/**\n\t\tTells if the string `s` starts with the string `start`.\n\n\t\tIf `start` is null, the result is unspecified.\n\n\t\tIf `start` is the empty String \"\", the result is true.\n\t**/\n\tpublic static #if (cs || java) inline #end function startsWith( s : String, start : String ) : Bool {\n\t\t#if java\n\t\treturn untyped s.startsWith(start);\n\t\t#elseif cs\n\t\treturn untyped s.StartsWith(start);\n\t\t#else\n\t\treturn( s.length >= start.length && s.substr(0, start.length) == start );\n\t\t#end\n\t}\n\n\t/**\n\t\tTells if the string `s` ends with the string `end`.\n\n\t\tIf `end` is null, the result is unspecified.\n\n\t\tIf `end` is the empty String \"\", the result is true.\n\t**/\n\tpublic static #if (cs || java) inline #end function endsWith( s : String, end : String ) : Bool {\n\t\t#if java\n\t\treturn untyped s.endsWith(end);\n\t\t#elseif cs\n\t\treturn untyped s.EndsWith(end);\n\t\t#else\n\t\tvar elen = end.length;\n\t\tvar slen = s.length;\n\t\treturn( slen >= elen && s.substr(slen - elen, elen) == end );\n\t\t#end\n\t}\n\n\t/**\n\t\tTells if the character in the string `s` at position `pos` is a space.\n\n\t\tA character is considered to be a space character if its character code\n\t\tis 9,10,11,12,13 or 32.\n\n\t\tIf `s` is the empty String \"\", or if pos is not a valid position within\n\t\t`s`, the result is false.\n\t**/\n\tpublic static function isSpace( s : String, pos : Int ) : Bool {\n\t\tvar c = s.charCodeAt( pos );\n\t\treturn (c > 8 && c < 14) || c == 32;\n\t}\n\n\t/**\n\t\tRemoves leading space characters of `s`.\n\n\t\tThis function internally calls isSpace() to decide which characters to\n\t\tremove.\n\n\t\tIf `s` is the empty String \"\" or consists only of space characters, the\n\t\tresult is the empty String \"\".\n\t**/\n\tpublic #if cs inline #end static function ltrim( s : String ) : String {\n\t\t#if cs\n\t\treturn untyped s.TrimStart();\n\t\t#else\n\t\tvar l = s.length;\n\t\tvar r = 0;\n\t\twhile( r < l && isSpace(s,r) ){\n\t\t\tr++;\n\t\t}\n\t\tif( r > 0 )\n\t\t\treturn s.substr(r, l-r);\n\t\telse\n\t\t\treturn s;\n\t\t#end\n\t}\n\n\t/**\n\t\tRemoves trailing space characters of `s`.\n\n\t\tThis function internally calls isSpace() to decide which characters to\n\t\tremove.\n\n\t\tIf `s` is the empty String \"\" or consists only of space characters, the\n\t\tresult is the empty String \"\".\n\t**/\n\tpublic #if cs inline #end static function rtrim( s : String ) : String {\n\t\t#if cs\n\t\treturn untyped s.TrimEnd();\n\t\t#else\n\t\tvar l = s.length;\n\t\tvar r = 0;\n\t\twhile( r < l && isSpace(s,l-r-1) ){\n\t\t\tr++;\n\t\t}\n\t\tif( r > 0 ){\n\t\t\treturn s.substr(0, l-r);\n\t\t}else{\n\t\t\treturn s;\n\t\t}\n\t\t#end\n\t}\n\n\t/**\n\t\tRemoves leading and trailing space characters of `s`.\n\n\t\tThis is a convenience function for ltrim(rtrim(s)).\n\t**/\n\tpublic #if (cs || java) inline #end static function trim( s : String ) : String {\n\t\t#if cs\n\t\treturn untyped s.Trim();\n\t\t#elseif java\n\t\treturn untyped s.trim();\n\t\t#else\n\t\treturn ltrim(rtrim(s));\n\t\t#end\n\t}\n\n\t/**\n\t\tConcatenates `c` to `s` until `s.length` is at least `l`.\n\n\t\tIf `c` is the empty String \"\" or if `l` does not exceed `s.length`,\n\t\t`s` is returned unchanged.\n\n\t\tIf `c.length` is 1, the resulting String length is exactly `l`.\n\n\t\tOtherwise the length may exceed `l`.\n\n\t\tIf `c` is null, the result is unspecified.\n\t**/\n\tpublic static function lpad( s : String, c : String, l : Int ) : String {\n\t\tif (c.length <= 0)\n\t\t\treturn s;\n\n\t\twhile (s.length < l) {\n\t\t\ts = c + s;\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t\tAppends `c` to `s` until `s.length` is at least `l`.\n\n\t\tIf `c` is the empty String \"\" or if `l` does not exceed `s.length`,\n\t\t`s` is returned unchanged.\n\n\t\tIf `c.length` is 1, the resulting String length is exactly `l`.\n\n\t\tOtherwise the length may exceed `l`.\n\n\t\tIf `c` is null, the result is unspecified.\n\t**/\n\tpublic static function rpad( s : String, c : String, l : Int ) : String {\n\t\tif (c.length <= 0)\n\t\t\treturn s;\n\n\t\twhile (s.length < l) {\n\t\t\ts = s + c;\n\t\t}\n\t\treturn s;\n\t}\n\n\t/**\n\t\tReplace all occurences of the String `sub` in the String `s` by the\n\t\tString `by`.\n\n\t\tIf `sub` is the empty String \"\", `by` is inserted after each character\n\t\tof `s`. If `by` is also the empty String \"\", `s` remains unchanged.\n\n\t\tThis is a convenience function for `s.split(sub).join(by)`.\n\n\t\tIf `sub` or `by` are null, the result is unspecified.\n\t**/\n\tpublic static function replace( s : String, sub : String, by : String ) : String {\n\t\t#if java\n\t\tif (sub.length == 0)\n\t\t\treturn s.split(sub).join(by);\n\t\telse\n\t\t\treturn untyped s.replace(sub, by);\n\t\t#elseif cs\n\t\tif (sub.length == 0)\n\t\t\treturn s.split(sub).join(by);\n\t\telse\n\t\t\treturn untyped s.Replace(sub, by);\n\t\t#else\n\t\treturn s.split(sub).join(by);\n\t\t#end\n\t}\n\n\t/**\n\t\tEncodes `n` into a hexadecimal representation.\n\n\t\tIf `digits` is specified, the resulting String is padded with \"0\" until\n\t\tits length equals `digits`.\n\t**/\n\tpublic static function hex( n : Int, ?digits : Int ) {\n\t\t#if flash9\n\t\t\tvar n : UInt = n;\n\t\t\tvar s : String = untyped n.toString(16);\n\t\t\ts = s.toUpperCase();\n\t\t#else\n\t\t\tvar s = \"\";\n\t\t\tvar hexChars = \"0123456789ABCDEF\";\n\t\t\tdo {\n\t\t\t\ts = hexChars.charAt(n&15) + s;\n\t\t\t\tn >>>= 4;\n\t\t\t} while( n > 0 );\n\t\t#end\n\t\tif( digits != null )\n\t\t\twhile( s.length < digits )\n\t\t\t\ts = \"0\"+s;\n\t\treturn s;\n\t}\n\n\t/**\n\t\tReturns the character code at position `index` of String `s`.\n\n\t\tThis method is faster than String.charCodeAt() on most platforms.\n\t\tHowever, unlike String.charCodeAt(), the result is unspecified if\n\t\t`index` is negative or exceeds `s.length`.\n\n\t\tThis operation is not guaranteed to work if `s` contains the \\0\n\t\tcharacter.\n\t**/\n\tpublic static inline function fastCodeAt( s : String, index : Int ) : Int untyped {\n\t\t#if neko\n\t\treturn untyped __dollar__sget(s.__s, index);\n\t\t#elseif cpp\n\t\treturn s.cca(index);\n\t\t#elseif flash9\n\t\treturn s.cca(index);\n\t\t#elseif flash\n\t\treturn s[\"cca\"](index);\n\t\t#elseif java\n\t\treturn ( index < s.length ) ? cast(_charAt(s, index), Int) : -1;\n\t\t#elseif cs\n\t\treturn ( cast(index, UInt) < s.length ) ? cast(untyped s[index], Int) : -1;\n\t\t#elseif js\n\t\t\t#if mt\n\t\treturn (untyped s).cca(index);\n\t\t\t#else\n\t\treturn (untyped s).charCodeAt(index);\n\t\t\t#end\n\t\t#else\n\t\treturn s.cca(index);\n\t\t#end\n\t}\n\n\t/*\n\t\tTells if `c` represents the end-of-file (EOF) character.\n\t*/\n\t@:noUsing public static inline function isEof( c : Int ) : Bool {\n\t\t#if (flash9 || cpp)\n\t\treturn c == 0;\n\t\t#elseif flash8\n\t\treturn c <= 0; // fast NaN\n\t\t#elseif js\n\t\treturn c != c; // fast NaN\n\t\t#elseif neko\n\t\treturn c == null;\n\t\t#elseif cs\n\t\treturn c == -1;\n\t\t#elseif java\n\t\treturn c == -1;\n\t\t#else\n\t\treturn false;\n\t\t#end\n\t}\n\n\t#if java\n\tprivate static inline function _charAt(str:String, idx:Int):java.StdTypes.Char16 return untyped str._charAt(idx);\n\t#end\n\n\t#if neko\n\tprivate static var _urlEncode = neko.Lib.load(\"std\",\"url_encode\",1);\n\tprivate static var _urlDecode = neko.Lib.load(\"std\",\"url_decode\",1);\n\t#end\n\n}\n","/* Same license as Node.js\r\n\r\n\tMaintainer: Dion Amago, dion@transition9.com\r\n\r\n\tCopied from Ritchie Turner's (blackdog@cloudshift.cl) repo due to a lack of contact with Ritchie and a desire to\r\n\tkeep node.js libraries updated\r\n\r\n\tFrom Ritchie's docs:\r\n\t\"Node.js 0.8 api without haXe embellishments so that other apis may be implemented\r\n\ton top without being hindered by design choices here.\r\n\tDomain not added.\"\r\n*/\r\n\r\npackage js;\r\n\r\ntypedef NodeListener = Dynamic;\r\ntypedef NodeErr = Null;\r\n\r\n/*\r\n\t emits: newListener\r\n */\r\ntypedef NodeEventEmitter = {\r\n\tfunction addListener(event:String,fn:NodeListener):Dynamic;\r\n\tfunction on(event:String,fn:NodeListener):Dynamic;\r\n\tfunction once(event:String,fn:NodeListener):Void;\r\n\tfunction removeListener(event:String,listener:NodeListener):Void;\r\n\tfunction removeAllListeners(event:String):Void;\r\n\tfunction listeners(event:String):Array;\r\n\tfunction setMaxListeners(m:Int):Void;\r\n\tfunction emit(event:String,?arg1:Dynamic,?arg2:Dynamic,?arg3:Dynamic):Void;\r\n}\r\n\r\ntypedef NodeWatchOpt = {\r\n\tvar persistent:Bool;\r\n\t@:optional\r\n\tvar interval:Int;\r\n};\r\n\r\ntypedef NodeExecOpt = {\r\n\tvar encoding:String;\r\n\tvar timeout:Int;\r\n\tvar maxBuffer:Int;\r\n\tvar killSignal:String;\r\n\tvar env:Dynamic;\r\n\tvar cwd:String;\r\n}\r\n\r\ntypedef NodeSpawnOpt = {\r\n\tvar cwd:String;\r\n\tvar env:Dynamic;\r\n\tvar customFds:Array;\r\n\tvar setsid:Bool;\r\n}\r\n\r\n/* note:can't spec multiple optional args, so adding an arbitrary 3 */\r\ntypedef NodeConsole = {\r\n\tfunction log(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction info(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction warn(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction error(s:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void;\r\n\tfunction time(label:String):Void;\r\n\tfunction timeEnd(label:String):Void;\r\n\tfunction dir(obj:Dynamic):Void;\r\n\tfunction trace():Void;\r\n\tfunction assert():Void;\r\n}\r\n\r\ntypedef NodePath = {\r\n\tfunction join(?p1:String,?p2:String,?p3:String):String;\r\n\tfunction normalize(p:String):String;\r\n\tfunction resolve(?from:Array,to:String):String;\r\n\tfunction dirname(p:String):String;\r\n\tfunction basename(p:String,?ext:String):String;\r\n\tfunction extname(p:String):String;\r\n\tvar sep :String;\r\n\tvar delimiter :String;\r\n}\r\n\r\ntypedef NodeUrlObj = {\r\n\tvar href:String;\r\n\tvar host:String;\r\n\tvar protocol:String;\r\n\tvar auth:String;\r\n\tvar hostname:String;\r\n\tvar port:String;\r\n\tvar pathname:String;\r\n\tvar search:String;\r\n\tvar query:Dynamic;\r\n\tvar hash:String;\r\n}\r\n\r\ntypedef NodeUrl = {\r\n\tfunction parse(p:String,?andQueryString:Bool):NodeUrlObj;\r\n\tfunction format(o:NodeUrlObj):String;\r\n\tfunction resolve(from:Array,to:String):String;\r\n}\r\n\r\ntypedef NodeQueryString = {\r\n\tfunction parse(s:String,?sep:String,?eq:String,?options:{maxKeys:Int}):Dynamic;\r\n\tfunction escape(s:String):String;\r\n\tfunction unescape(s:String):String;\r\n\tfunction stringify(obj:Dynamic,?sep:String,?eq:String):String;\r\n}\r\n\r\n@:native(\"Buffer\") extern class NodeBuffer implements ArrayAccess {\r\n\r\n\t@:overload(function(str:String,?enc:String):Void {})\r\n\t@:overload(function(arr:Array):Void {})\r\n\tfunction new(size:Int):Void;\r\n\r\n\tvar length(default,null) : Int;\r\n\tvar INSPECT_MAX_BYTES:Int;\r\n\r\n\tfunction copy(targetBuffer:NodeBuffer,targetStart:Int,sourceStart:Int,sourceEnd:Int):Void;\r\n\tfunction slice(start:Int,end:Int):NodeBuffer;\r\n\tfunction write(s:String,?offset:Int,?length:Int,?enc:String):Int;\r\n\tfunction toString(enc:String,?start:Int,?end:Int):String;\r\n\tfunction fill(value:Float,offset:Int,?end:Int):Void;\r\n\tstatic function isBuffer(o:Dynamic):Bool;\r\n\tstatic function byteLength(s:String,?enc:String):Int;\r\n\r\n\tfunction readUInt8(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt16LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt16BE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt32LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readUInt32BE(offset:Int,?noAssert:Bool):Int;\r\n\r\n\tfunction readInt8(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt16LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt16BE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt32LE(offset:Int,?noAssert:Bool):Int;\r\n\tfunction readInt32BE(offset:Int,?noAssert:Bool):Int;\r\n\r\n\tfunction readFloatLE(offset:Int,?noAssert:Bool):Float;\r\n\tfunction readFloatBE(offset:Int,?noAssert:Bool):Float;\r\n\tfunction readDoubleLE(offset:Int,?noAssert:Bool):Float; // is this right?\r\n\tfunction readDoubleBE(offset:Int,?noAssert:Bool):Float; // is this right?\r\n\r\n\tfunction writeUInt8(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt16LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt16BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt32LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeUInt32BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\r\n\tfunction writeInt8(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt16LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt16BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt32LE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeInt32BE(value:Int,offset:Int,?noAssert:Bool):Void;\r\n\r\n\tfunction writeFloatLE(value:Float,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeFloatBE(value:Float,offset:Int,?noAssert:Bool):Void;\r\n\tfunction writeDoubleLE(value:Float,offset:Int,?noAssert:Bool):Void; // is this right?\r\n\tfunction writeDoubleBE(value:Float,offset:Int,?noAssert:Bool):Void; // is this right?\r\n}\r\n\r\ntypedef NodeScript = {\r\n\tfunction runInThisContext():Dynamic;\r\n\tfunction runInNewContext(?sandbox:Dynamic):Void;\r\n}\r\n\r\ntypedef NodeVM = {\r\n\tfunction runInThisContext(code:String,?fileName:String):Dynamic;\r\n\tfunction runInNewContext(?sandbox:Dynamic):Void;\r\n\tfunction createScript(code:Dynamic,?fileName:String):NodeScript;\r\n}\r\n\r\ntypedef ReadStreamOpt = {\r\n\tflags:String,\r\n\tencoding:String,\r\n\tfd:Null,\r\n\tmode:Int,\r\n\tbufferSize:Int,\r\n\t?start:Int,\r\n\t?end:Int\r\n}\r\n\r\ntypedef WriteStreamOpt = {\r\n\tvar flags:String;\r\n\tvar encoding:String;\r\n\tvar mode:Int;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t data,end,error,close\r\n*/\r\ntypedef NodeReadStream = { > NodeEventEmitter,\r\n\tvar readable:Bool;\r\n\tfunction pause():Void;\r\n\tfunction resume():Void;\r\n\tfunction destroy():Void;\r\n\tfunction destroySoon():Void;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction pipe(dest:NodeWriteStream,?opts:{end:Bool}):Void;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t drain,error,close,pipe\r\n*/\r\ntypedef NodeWriteStream = { > NodeEventEmitter,\r\n\tvar writeable:Bool;\r\n\t@:overload(function(chunk:NodeBuffer):Bool {})\r\n\tfunction write(d:String,?enc:String,?fd:Int):Bool;\r\n\t@:overload(function(b:NodeBuffer):Void {})\r\n\tfunction end(?s:String,?enc:String):Void;\r\n\tfunction destroy():Void;\r\n\tfunction destroySoon():Void;\r\n}\r\n\r\ntypedef NodeNetworkInterface = {\r\n\tvar address :String;\r\n\tvar family :String;\r\n\tvar internal :Bool;\r\n}\r\n\r\ntypedef NodeOs = {\r\n\tfunction hostname():String;\r\n\tfunction type():String;\r\n\tfunction release():String;\r\n\tfunction uptime():Int;\r\n\tfunction loadavg():Array;\r\n\tfunction totalmem():Int;\r\n\tfunction freemem():Int;\r\n\tfunction cpus():Int;\r\n\tfunction platform():String;\r\n\tfunction arch():String;\r\n\tfunction networkInterfaces():Dynamic;\r\n}\r\n\r\n\r\ntypedef NodeJsDate = {\r\n\t\tfunction getTime():Int;\r\n\t\tfunction toDateString():String;\r\n\t\tfunction toUTCString():String;\r\n}\r\n\r\ntypedef NodeStat = {\r\n\tvar dev:Int;\r\n\tvar ino:Int;\r\n\tvar mode:Int;\r\n\tvar nlink:Int;\r\n\tvar uid:Int;\r\n\tvar gid:Int;\r\n\tvar rdev:Int;\r\n\tvar size:Int;\r\n\tvar blkSize:Int;\r\n\tvar blocks:Int;\r\n\tvar atime:NodeJsDate;\r\n\tvar mtime:NodeJsDate;\r\n\tvar ctime:NodeJsDate;\r\n\r\n\tfunction isFile():Bool;\r\n\tfunction isDirectory():Bool;\r\n\tfunction isBlockDevice():Bool;\r\n\tfunction isCharacterDevice():Bool;\r\n\tfunction isSymbolicLink():Bool;\r\n\tfunction isFIFO():Bool;\r\n\tfunction isSocket():Bool;\r\n}\r\n\r\n/*\r\n\tEmits: error,change\r\n */\r\ntypedef NodeFSWatcher = { > NodeEventEmitter,\r\n\t function close():Void;\r\n}\r\n\r\ntypedef NodeFS = {\r\n\tfunction rename(from:String,to:String,cb:NodeErr->Void):Void;\r\n\tfunction renameSync(from:String,to:String):Void;\r\n\r\n\tfunction stat(path:String,cb:NodeErr->NodeStat->Void):Void;\r\n\tfunction statSync(path:String):NodeStat;\r\n\r\n\tfunction lstat(path:Dynamic,cb:NodeErr->NodeStat->Void):Void;\r\n\tfunction lstatSync(path:String):NodeStat;\r\n\r\n\tfunction fstat(fd:Int,cb:NodeErr->NodeStat->Void):Void;\r\n\tfunction fstatSync(fd:Int):NodeStat;\r\n\r\n\tfunction link(srcPath:String,dstPath:String,cb:NodeErr->Void):Void;\r\n\tfunction linkSync(srcPath:String,dstPath:String):Void;\r\n\r\n\tfunction unlink(path:String,cn:NodeErr->Void):Void;\r\n\tfunction unlinkSync(path:String):Void;\r\n\r\n\tfunction symlink(linkData:Dynamic,path:String,?type:String,?cb:NodeErr->Void):Void;\r\n\tfunction symlinkSync(linkData:Dynamic,path:String,?type:String):Void;\r\n\r\n\tfunction readlink(path:String,cb:NodeErr->String->Void):Void;\r\n\tfunction readlinkSync(path:String):String;\r\n\r\n\tfunction realpath(path:String,cb:NodeErr->String->Void):Void;\r\n\tfunction realpathSync(path:String):String;\r\n\r\n\tfunction chmod(path:String,mode:Int,cb:NodeErr->Void):Void;\r\n\tfunction chmodSync(path:String,?mode:Int):Void;\r\n\r\n\tfunction fchmod(fd:Int,mode:Int,cb:NodeErr->Void):Void;\r\n\tfunction fchmodSync(fd:Int,?mode:Int):Void;\r\n\r\n\tfunction chown(path:String,uid:Int,gid:Int,cb:NodeErr->Void):Void ;\r\n\tfunction chownSync(path:String,uid:Int,gid:Int):Void;\r\n\r\n\tfunction fchown(fd:Int,uid:Int,gid:Int,cb:NodeErr->Void):Void ;\r\n\tfunction fchownSync(fd:Int,uid:Int,gid:Int):Void;\r\n\r\n\tfunction rmdir(path:String,cb:NodeErr->Void):Void;\r\n\tfunction rmdirSync(path:String):Void;\r\n\r\n\tfunction mkdir(path:String,?mode:Int,?cb:NodeErr->Void):Void;\r\n\tfunction mkdirSync(path:String,?mode:Int):Void;\r\n\r\n\tfunction readdir(path:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction readdirSync(path:String):Array;\r\n\r\n\tfunction close(fd:Int,cb:NodeErr->Void):Void;\r\n\tfunction closeSync(fd:Int):Void;\r\n\r\n\tfunction open(path:String,flags:String,?mode:Int,cb:NodeErr->Int->Void):Void;\r\n\r\n\tfunction openSync(path:String,flags:String,?mode:Int):Int;\r\n\r\n\tfunction write(fd:Int,bufOrStr:Dynamic,offset:Int,length:Int,position:Null,?cb:NodeErr->Int->Void):Void;\r\n\tfunction writeSync(fd:Int,bufOrStr:Dynamic,offset:Int,length:Int,position:Null):Int;\r\n\r\n\tfunction read(fd:Int,buffer:NodeBuffer,offset:Int,length:Int,position:Int,cb:NodeErr->Int->NodeBuffer->Void):Void;\r\n\tfunction readSync(fd:Int,buffer:NodeBuffer,offset:Int,length:Int,position:Int):Int;\r\n\r\n\tfunction truncate(fd:Int,len:Int,cb:NodeErr->Void):Void;\r\n\tfunction truncateSync(fd:Int,len:Int):NodeErr;\r\n\r\n\tfunction readFile(path:String,?enc:String,cb:NodeErr->String->Void):Void;\r\n\tfunction readFileSync(path:String,?enc:String):String;\r\n\r\n\t@:overload(function(fileName:String,data:NodeBuffer,cb:NodeErr->Void):Void {})\r\n\tfunction writeFile(fileName:String,contents:String,?enc:String,cb:NodeErr->Void):Void;\r\n\t@:overload(function(fileName:String,data:NodeBuffer):Void {})\r\n\tfunction writeFileSync(fileName:String,contents:String,?enc:String):Void;\r\n\r\n\t@:overload(function(fileName:String,data:NodeBuffer,cb:NodeErr->Void):Void {})\r\n\tfunction appendFile(fileName:String,contents:String,?enc:String,cb:NodeErr->Void):Void;\r\n\r\n\t@:overload(function(fileName:String,data:NodeBuffer):Void {})\r\n\tfunction appendFileSync(fileName:String,contents:String,?enc:String):Void;\r\n\r\n\r\n\tfunction utimes(path:String,atime:Dynamic,mtime:Dynamic,cb:NodeErr->Void):Void;\r\n\tfunction utimeSync(path:String,atime:Dynamic,mtime:Dynamic):Void;\r\n\r\n\tfunction futimes(fd:Int,atime:Dynamic,mtime:Dynamic,cb:NodeErr->Void):Void;\r\n\tfunction futimeSync(fd:Int,atime:Dynamic,mtime:Dynamic):Void;\r\n\r\n\tfunction fsync(fd:Int,cb:NodeErr->Void):Void;\r\n\tfunction fsyncSync(fd:Int):Void;\r\n\r\n\tfunction watchFile(fileName:String,?options:NodeWatchOpt,listener:NodeStat->NodeStat->Void):Void;\r\n\tfunction unwatchFile(fileName:String):Void;\r\n\tfunction watch(fileName:String,?options:NodeWatchOpt,listener:String->String->Void):NodeFSWatcher;\r\n\tfunction createReadStream(path:String,?options:ReadStreamOpt):NodeReadStream;\r\n\tfunction createWriteStream(path:String,?options:WriteStreamOpt):NodeWriteStream;\r\n\r\n\tfunction exists(p:String,cb:Bool->Void):Void;\r\n\tfunction existsSync(p:String):Bool;\r\n}\r\n\r\ntypedef NodeUtil = {\r\n\tfunction debug(s:String):Void;\r\n\tfunction inspect(o:Dynamic,?showHidden:Bool,?depth:Int):Void;\r\n\tfunction log(s:String):Void;\r\n\tfunction pump(rs:NodeReadStream,ws:NodeWriteStream,cb:Dynamic->Void):Void;\r\n\tfunction inherits(constructor:Dynamic,superConstructor:Dynamic):Void;\r\n\tfunction isArray(o:Dynamic):Bool;\r\n\tfunction isRegExp(o:Dynamic):Bool;\r\n\tfunction isDate(o:Dynamic):Bool;\r\n\tfunction isError(o:Dynamic):Bool;\r\n\tfunction format(out:String,?a1:Dynamic,?a2:Dynamic,?a3:Dynamic):Void; // should be arbitrary # of args\r\n}\r\n\r\n/*\r\n\tEmits:\r\n\texit, uncaughtException + SIGNAL events (SIGINT etc)\r\n */\r\ntypedef NodeProcess = { > NodeEventEmitter,\r\n\tvar stdout:NodeWriteStream;\r\n\tvar stdin:NodeReadStream;\r\n\tvar stderr:NodeWriteStream;\r\n\tvar argv:Array;\r\n\tvar env:Dynamic;\r\n\tvar pid:Int;\r\n\tvar title:String;\r\n\tvar arch:String;\r\n\tvar platform:String;\r\n\tvar installPrefix:String;\r\n\tvar execPath:String;\r\n\tvar version:String;\r\n\tvar versions:Dynamic;\r\n\r\n\tfunction memoryUsage():{rss:Int,vsize:Int,heapUsed:Int,heapTotal:Int};\r\n\tfunction nextTick(fn:Void->Void):Void;\r\n\tfunction exit(code:Int):Void;\r\n\tfunction cwd():String;\r\n\tfunction getuid():Int;\r\n\tfunction getgid():Int;\r\n\tfunction setuid(u:Int):Void;\r\n\tfunction setgid(g:Int):Void;\r\n\tfunction umask(?m:Int):Int;\r\n\tfunction chdir(d:String):Void;\r\n\tfunction kill(pid:Int,?signal:String):Void;\r\n\tfunction uptime():Int;\r\n\tfunction abort():Void;\r\n\tfunction hrtime():Array;\r\n}\r\n\r\n/*\r\n\tEmits: exit,close\r\n*/\r\ntypedef NodeChildProcess = { > NodeEventEmitter,\r\n\tvar stdin:NodeWriteStream;\r\n\tvar stdout:NodeReadStream;\r\n\tvar stderr:NodeReadStream;\r\n\tvar pid:Int;\r\n\tfunction kill(?signal:String):Void;\r\n}\r\n\r\n/*\r\n\tEmits: message\r\n*/\r\ntypedef NodeChildForkProcess = { > NodeChildProcess,\r\n\t @:overload(function(o:Dynamic,?socket:NodeNetSocket):Void {})\r\n\t function send(o:Dynamic,?server:NodeNetServer):Void;\r\n}\r\n\r\ntypedef NodeChildProcessCommands = {\r\n\tfunction spawn(command: String,args: Array,?options: Dynamic ) : NodeChildProcess;\r\n\tfunction exec(command: String,?options:Dynamic,cb: {code:Int}->String->String->Void ): NodeChildProcess;\r\n\tfunction execFile(command: String,?options:Dynamic,cb: {code:Int}->String->String->Void ): NodeChildProcess;\r\n\tfunction fork(path:String,?args:Dynamic,?options:Dynamic):NodeChildForkProcess;\r\n}\r\n\r\ntypedef NodeClusterSettings = {\r\n\tvar exec:String;\r\n\tvar args:Array;\r\n\tvar silent:Bool;\r\n}\r\n\r\n\r\n/* emits: message, online,listening,disconnect,exit, setup */\r\ntypedef NodeWorker = { > NodeEventEmitter,\r\n\tvar uniqueID:String; // indexes into cluster.workers\r\n\tvar process:NodeChildProcess;\r\n\tvar suicide:Bool;\r\n\tfunction send(message:Dynamic,?sendHandle:Dynamic):Void;\r\n\tfunction destroy():Void;\r\n}\r\n\r\n/* Emits: death,message, fork, online, listening\t*/\r\ntypedef NodeCluster = { > NodeEventEmitter,\r\n\tvar isMaster:Bool;\r\n\tvar isWorker:Bool;\r\n\tvar workers:Array;\r\n\tfunction fork(?env:Dynamic):NodeWorker;\r\n\tfunction send(o:Dynamic):Void;\r\n\tfunction setupMaster(?settings:NodeClusterSettings):Void;\r\n\tfunction disconnect(?cb:Void->Void):Void;\r\n}\r\n\r\n\r\n/* NET ............................................. */\r\n\r\n/*\r\n\t Emits:\r\n\t connection\r\n*/\r\ntypedef NodeNet = { > NodeEventEmitter,\r\n\tfunction createServer(?options:{allowHalfOpen:Bool},fn:NodeNetSocket->Void):NodeNetServer;\r\n\t@:overload(function(cs:String):NodeNetSocket {})\r\n\tfunction createConnection(port:Int,host:String):NodeNetSocket;\r\n\t@:overload(function(cs:String):NodeNetSocket {})\r\n\tfunction connect(port:Int,host:String):NodeNetSocket;\r\n\tfunction isIP(input:String):Int; // 4 or 6\r\n\tfunction isIPv4(input:String):Bool;\r\n\tfunction isIPv6(input:String):Bool;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t connection,close,error,listening\r\n*/\r\ntypedef NodeNetServer = { > NodeEventEmitter,\r\n\tvar maxConnections:Int;\r\n\tvar connections:Int;\r\n\r\n\t@:overload(function(path:String,?cb:Void->Void):Void {})\r\n\t@:overload(function(fd:Int,?cb:Void->Void):Void {})\r\n\tfunction listen(port:Int,?host:String,?cb:Void->Void):Void;\r\n\tfunction close(cb:Void->Void):Void;\r\n\tfunction address():Void;\r\n\tfunction pause(msecs:Int):Void;\r\n}\r\n\r\ntypedef NodeConnectionOpt = {\r\n\tport:Int,\r\n\t?host:String,\r\n\t?localAddress:String\r\n}\r\n\r\n/*\r\n\r\n\tEmits:\r\n\tconnect,data,end,timeout,drain,error,close\r\n\r\n\timplements a duplex stream interface\r\n*/\r\ntypedef NodeNetSocket = { > NodeEventEmitter,\r\n\tvar remoteAddress:String;\r\n\tvar remotePort:Int;\r\n\tvar bufferSize:Int;\r\n\tvar bytesRead:Int;\r\n\tvar bytesWritten:Int;\r\n\r\n\t@:overload(function(path:String,?cb:Void->Void):Void {})\r\n\t@:overload(function(options:NodeConnectionOpt,connectionListener:Void->Void):Void {})\r\n\tfunction connect(port:Int,?host:String,?cb:Void->Void):Void;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction setSecure():Void;\r\n\t@:overload(function(data:Dynamic,?enc:String,?fileDesc:Int,?cb:Void->Void):Bool {})\r\n\tfunction write(data:Dynamic,?enc:String,?cb:Void->Void):Bool;\r\n\tfunction end(?data:Dynamic,?enc:String):Void;\r\n\tfunction destroy():Void;\r\n\tfunction pause():Void;\r\n\tfunction resume():Void;\r\n\tfunction setTimeout(timeout:Int,?cb:Void->Void):Void;\r\n\tfunction setNoDelay(?noDelay:Bool):Void;\r\n\tfunction setKeepAlive(enable:Bool,?delay:Int):Void;\r\n\tfunction address():{address:String,port:Int};\r\n}\r\n\r\n/* HTTP ............................................*/\r\n\r\n\r\n/*\r\n\t Emits:\r\n\t data,end,close\r\n */\r\ntypedef NodeHttpServerReq = { >NodeEventEmitter,\r\n\tvar method:String;\r\n\tvar url:String;\r\n\tvar headers:Dynamic;\r\n\tvar trailers:Dynamic;\r\n\tvar httpVersion:String;\r\n\tvar connection:NodeNetSocket;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction pause():Void;\r\n\tfunction resume():Void;\r\n}\r\n\r\n/*\r\n */\r\ntypedef NodeHttpServerResp = { > NodeWriteStream,\r\n\tvar statusCode:Int;\r\n\tfunction writeContinue():Void;\r\n\t@:overload(function(statusCode:Int,?reasonPhrase:String,?headers:Dynamic):Void {})\r\n\tfunction writeHead(statusCode:Int,headers:Dynamic):Void;\r\n\tfunction setHeader(name:String,value:Dynamic):Void;\r\n\tfunction getHeader(name:String):Dynamic;\r\n\tfunction removeHeader(name:String):Void;\r\n\tfunction addTrailers(headers:Dynamic):Void;\r\n}\r\n\r\n/* Emits:\r\n\t continue,response\r\n*/\r\ntypedef NodeHttpClientReq = { > NodeEventEmitter,\r\n\tfunction write(data:Dynamic,?enc:String):Void;\r\n\tfunction end(?data:Dynamic,?enc:String):Void;\r\n\tfunction abort():Void;\r\n}\r\n\r\n/* Emits:\r\n\t data,end,close\r\n*/\r\ntypedef NodeHttpClientResp = { > NodeEventEmitter,\r\n\tvar statusCode:Int;\r\n\tvar httpVersion:String;\r\n\tvar headers:Dynamic;\r\n\tvar client:NodeHttpClient;\r\n\tfunction setEncoding(enc:String):Void;\r\n\tfunction resume():Void;\r\n\tfunction pause():Void;\r\n}\r\n\r\n\r\ntypedef NodeHttpClient = { > NodeEventEmitter,\r\n\tfunction request(method:String,path:String,?headers:Dynamic):NodeHttpClientReq;\r\n\tfunction verifyPeer():Bool;\r\n\tfunction getPeerCertificate():NodePeerCert;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t request,connection,checkContinue,connect,clientError,close\r\n */\r\ntypedef NodeHttpServer = { > NodeEventEmitter,\r\n\t@:overload(function(path:String,?cb:Void->Void):Void {})\r\n\tfunction listen(port:Int,?host:String,?cb:Void->Void):Void;\r\n\tfunction close(?cb:Void->Void):Void;\r\n}\r\n\r\n/*\r\n */\r\ntypedef NodeHttpReqOpt = {\r\n\tvar host:String;\r\n\tvar port:Int;\r\n\tvar path:String;\r\n\tvar method:String;\r\n\tvar headers:Dynamic;\r\n}\r\n\r\ntypedef NodeHttpsReqOpt = { > NodeHttpReqOpt,\r\n\tvar ciphers:Dynamic;\r\n\tvar rejectUnauthorized:Dynamic;\r\n}\r\n\r\n/*\r\n\t Emits:\r\n\t upgrade,continue\r\n*/\r\ntypedef NodeAgent = { > NodeEventEmitter,\r\n\tvar maxSockets:Int;\r\n\tvar sockets:Array;\r\n\tvar queue:Array;\r\n}\r\n\r\ntypedef NodeHttp = {\r\n\tfunction createServer(listener:NodeHttpServerReq->NodeHttpServerResp->Void):NodeHttpServer;\r\n\tfunction createClient(port:Int,host:String):NodeHttpClient;\r\n\t@:overload(function(parsedUrl:NodeUrlObj,res:NodeHttpClientResp->Void):NodeHttpClientReq {})\r\n\tfunction request(options:NodeHttpReqOpt,res:NodeHttpClientResp->Void):NodeHttpClientReq;\r\n\t@:overload(function(parsedUrl:NodeUrlObj,res:NodeHttpClientResp->Void):Void {})\r\n\tfunction get(options:NodeHttpReqOpt,res:NodeHttpClientResp->Void):Void;\r\n\tfunction getAgent(host:String,port:Int):NodeAgent;\r\n}\r\n\r\ntypedef NodeHttps = {\r\n\tfunction createServer(options:{key:String,cert:String},\r\n\t\t\t\t\t\t\t\t\t\t\t\tlistener:NodeHttpServerReq->NodeHttpServerResp->Void):NodeHttpServer;\r\n\tfunction request(options:NodeHttpsReqOpt,res:NodeHttpClientResp->Void):NodeHttpClientReq;\r\n\tfunction get(options:NodeHttpsReqOpt,res:NodeHttpClientResp->Void):Void;\r\n}\r\n\r\ntypedef NodeDns = {\r\n\tfunction resolve(domain:String,?rrtype:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolveNs(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolve4(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolve6(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolveMx(domain:String,cb:NodeErr->Array<{priority:Int,exchange:String}>->Void):Void;\r\n\tfunction resolveSrv(domain:String,cb:NodeErr->Array<{priority:Int,weight:Int,port:Int,name:String}->Void>):Void;\r\n\tfunction resolveCname(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction reverse(ip:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction resolveTxt(domain:String,cb:NodeErr->Array->Void):Void;\r\n\tfunction lookup(domain:String,?family:String,cb:NodeErr->String->Int->Void):Void;\r\n}\r\n\r\n/* UDP ........................................ */\r\n\r\ntypedef NodeUDPCallback = NodeErr->haxe.io.Bytes->Void;\r\n\r\ntypedef NodeUDP = {\r\n\t// Valid types: udp6, and unix_dgram.\r\n\tfunction createSocket(type:String,cb:NodeUDPCallback):NodeDGSocket;\r\n}\r\n\r\n/*\r\n\t Emits: message,listening,close\r\n*/\r\ntypedef NodeDGSocket = { > NodeEventEmitter,\r\n\tfunction send(buf:NodeBuffer,offset:Int,length:Int,port:Int,address:String,cb:NodeUDPCallback):Void;\r\n\tfunction bind(port:Int,?address:String):Void;\r\n\tfunction close():Void;\r\n\tfunction address():Dynamic;\r\n\tfunction setBroadcast(flag:Bool):Void;\r\n\tfunction setTTL(ttl:Int):Void;\r\n\tfunction setMulticastTTL(ttl:Int):Void;\r\n\tfunction setMulticastLoopback(flag:Bool):Void;\r\n\tfunction addMembership(multicastAddress:String,?multicastInterface:String):Void;\r\n\tfunction dropMembership(multicastAddress:String,?multicastInterface:String):Void;\r\n}\r\n\r\n\r\n/* CRYPTO ..................................... */\r\n\r\ntypedef NodeCredDetails = {\r\n\tvar key:String;\r\n\tvar cert:String;\r\n\tvar ca:Array;\r\n\t/*\r\n\t\tTODO\r\n\t*/\r\n}\r\n\r\ntypedef NodePeerCert = {\r\n\tvar subject:String;\r\n\tvar issuer:String;\r\n\tvar valid_from:String;\r\n\tvar valid_to:String;\r\n}\r\n\r\ntypedef NodeCreds = Dynamic;\r\n\r\ntypedef NodeHmac = {\r\n\tfunction update(data:Dynamic):Void;\r\n\tfunction digest(?enc:String):String;\r\n}\r\n\r\ntypedef NodeHash = {\r\n\tfunction update(data:Dynamic):NodeHash;\r\n\tfunction digest(?enc:String):String;\r\n\tfunction createHmac(algo:String,key:String):NodeHmac;\r\n}\r\n\r\ntypedef NodeCipher = {\r\n\tfunction update(data:Dynamic,?input_enc:String,?output_enc:String):Dynamic;\r\n\tfunction final(output_enc:String):Void;\r\n\tfunction setAutoPadding(padding:Bool):Void; // default true\r\n}\r\n\r\ntypedef NodeDecipher = {\r\n\tfunction update(data:Dynamic,?input_enc:String,?output_enc:String):Dynamic;\r\n\tfunction final(?output_enc:String):Dynamic;\r\n\tfunction setAutoPadding(padding:Bool):Void; // default true\r\n}\r\n\r\ntypedef NodeSigner = {\r\n\tfunction update(data:Dynamic):Void;\r\n\tfunction sign(private_key:String,?output_format:String):Dynamic;\r\n}\r\n\r\ntypedef NodeVerify = {\r\n\tfunction update(data:Dynamic):Void;\r\n\tfunction verify(cert:String,?sig_format:String):Bool;\r\n}\r\n\r\ntypedef NodeDiffieHellman = {\r\n\tfunction generateKeys(?enc:String):String;\r\n\tfunction computeSecret(otherPublicKey:String,?inputEnc:String,?outputEnc:String):String;\r\n\tfunction getPrime(?enc:String):Int;\r\n\tfunction getGenerator(?enc:String):String;\r\n\tfunction getPublicKey(?enc:String):String;\r\n\tfunction getPrivateKey(?enc:String):String;\r\n\tfunction setPublicKey(pubKey:String,?enc:String):Void;\r\n\tfunction setPrivateKey(privKey:String,?enc:String):Void;\r\n}\r\n\r\ntypedef NodeCrypto = {\r\n\tfunction createCredentials(details:NodeCredDetails):NodeCreds;\r\n\tfunction createHash(algo:String):NodeHash; // 'sha1', 'md5', 'sha256', 'sha512'\r\n\tfunction createCipher(algo:String,password:String):NodeCipher;\r\n\tfunction createCipheriv(algo:String,key:String,iv:String):NodeCipher;\r\n\tfunction createDecipher(algo:String,key:String):NodeDecipher;\r\n\tfunction createDecipheriv(algo:String,key:String,iv:String):NodeDecipher;\r\n\tfunction createSign(algo:String):NodeSigner;\r\n\tfunction createVerify(algo:String):NodeVerify;\r\n\t@:overload(function(prime_length:Int):NodeDiffieHellman {})\r\n\tfunction createDiffieHellman(prime:String,?enc:String):NodeDiffieHellman;\r\n\tfunction getDiffieHellman(groupName:String):NodeDiffieHellman;\r\n\tfunction pbkdf2(password:String,salt:String,iterations:Int,keylen:Int,cb:NodeErr->String):Void;\r\n\tfunction randomBytes(size:Int,cb:NodeErr->NodeBuffer):Void;\r\n\r\n}\r\n\r\n/* TLS/SSL ................................................ */\r\n\r\n/*\r\n\t Emits:\r\n\t secureConnection\r\n*/\r\ntypedef NodeTLSServer =\t{ > NodeNetServer,\r\n\t\tfunction addContext(hostName:String,credentials:NodeCreds):Void;\r\n\r\n}\r\n\r\n/* Emits: secure */\r\ntypedef NodeSecurePair = { > NodeEventEmitter,\r\n\t // ?? todo\r\n}\r\ntypedef NodeTLS ={\r\n\tfunction connect(port:Int,host:String,opts:Dynamic,cb:Void->Void):Void;\r\n\tfunction createServer(opts:Dynamic,cb:NodeTLSServer->Void):Void;\r\n\tfunction createSecurePair(creds:NodeCreds,isServer:Bool,requestCert:Bool,rejectUnauthorized:Bool):NodeSecurePair;\r\n}\r\n\r\n/*\r\n\tSnarfed from Tong's version ...\r\n */\r\ntypedef NodeAssert = {\r\n\tfunction fail(actual:Dynamic,expected:Dynamic,message:Dynamic,operator:Dynamic): Void;\r\n\tfunction ok(value:Dynamic,?message:Dynamic):Void;\r\n\tfunction equal(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction notEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction deepEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction notDeepEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction strictEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction notStrictEqual(actual:Dynamic,expected:Dynamic,?message:Dynamic):Void;\r\n\tfunction throws(block:Dynamic,error:Dynamic,?message:Dynamic):Void;\r\n\tfunction doesNotThrow(block:Dynamic,error:Dynamic,?message:Dynamic):Void;\r\n\tfunction ifError(value:Dynamic):Void;\r\n}\r\n\r\ntypedef NodeREPL = {\r\n\tfunction start( prompt : String, ?stream : Dynamic ) : Void;\r\n}\r\n\r\ntypedef NodeGZip = {}\r\ntypedef NodeGUnzip = {}\r\ntypedef NodeDeflate = {}\r\ntypedef NodeInflate = {}\r\ntypedef NodeDeflateRaw = {}\r\ntypedef NodeInflateRaw = {}\r\ntypedef NodeUnzip = {}\r\n\r\n\r\ntypedef NodeZLib = {\r\n\tfunction createGzip(?options:Dynamic):NodeGZip;\r\n\tfunction createGunzip(?options:Dynamic):NodeGUnzip;\r\n\tfunction createDeflate(?options:Dynamic):NodeDeflate;\r\n\tfunction createInflate(?options:Dynamic):NodeInflate;\r\n\tfunction createInflateRaw(?options:Dynamic):NodeInflateRaw;\r\n\tfunction createDeflateRaw(?options:Dynamic):NodeDeflateRaw;\r\n\tfunction createUnzip(?options:Dynamic):NodeUnzip;\r\n\r\n\t// convenience\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction deflate(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction deflateRaw(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction gzip(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction gunzip(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction inflate(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction inflateRaw(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n\t@:overload(function (str:String,cb:NodeErr->Dynamic->Void):Void {})\r\n\tfunction unzip(buf:NodeBuffer,cb:NodeErr->Dynamic->Void):Void;\r\n}\r\n\r\n@:native(\"Error\")\r\nextern class Error\r\n{\r\n\tpublic function new(msg : String) : Void;\r\n}\r\n\r\n// Node Constants\r\nclass NodeC {\r\n\tpublic static inline var UTF8 = \"utf8\";\r\n\tpublic static inline var ASCII = \"ascii\";\r\n\tpublic static inline var BINARY = \"binary\";\r\n\tpublic static inline var BASE64 = \"base64\";\r\n\tpublic static inline var HEX = \"hex\";\r\n\r\n\t//events - thanks tmedema\r\n\tpublic static inline var EVENT_EVENTEMITTER_NEWLISTENER = \"newListener\";\r\n\tpublic static inline var EVENT_EVENTEMITTER_ERROR = \"error\";\r\n\r\n\tpublic static inline var EVENT_STREAM_DATA = \"data\";\r\n\tpublic static inline var EVENT_STREAM_END = \"end\";\r\n\tpublic static inline var EVENT_STREAM_ERROR = \"error\";\r\n\tpublic static inline var EVENT_STREAM_CLOSE = \"close\";\r\n\tpublic static inline var EVENT_STREAM_DRAIN = \"drain\";\r\n\tpublic static inline var EVENT_STREAM_CONNECT = \"connect\";\r\n\tpublic static inline var EVENT_STREAM_SECURE = \"secure\";\r\n\tpublic static inline var EVENT_STREAM_TIMEOUT = \"timeout\";\r\n\tpublic static inline var EVENT_STREAM_PIPE = \"pipe\";\r\n\r\n\tpublic static inline var EVENT_PROCESS_EXIT = \"exit\";\r\n\tpublic static inline var EVENT_PROCESS_UNCAUGHTEXCEPTION = \"uncaughtException\";\r\n\tpublic static inline var EVENT_PROCESS_SIGINT = \"SIGINT\";\r\n\tpublic static inline var EVENT_PROCESS_SIGUSR1 = \"SIGUSR1\";\r\n\tpublic static inline var EVENT_CHILDPROCESS_EXIT = \"exit\";\r\n\tpublic static inline var EVENT_HTTPSERVER_REQUEST = \"request\";\r\n\tpublic static inline var EVENT_HTTPSERVER_CONNECTION = \"connection\";\r\n\tpublic static inline var EVENT_HTTPSERVER_CLOSE = \"close\";\r\n\tpublic static inline var EVENT_HTTPSERVER_UPGRADE = \"upgrade\";\r\n\tpublic static inline var EVENT_HTTPSERVER_CLIENTERROR = \"clientError\";\r\n\tpublic static inline var EVENT_HTTPSERVERREQUEST_DATA = \"data\";\r\n\tpublic static inline var EVENT_HTTPSERVERREQUEST_END = \"end\";\r\n\tpublic static inline var EVENT_CLIENTREQUEST_RESPONSE = \"response\";\r\n\tpublic static inline var EVENT_CLIENTRESPONSE_DATA = \"data\";\r\n\tpublic static inline var EVENT_CLIENTRESPONSE_END = \"end\";\r\n\tpublic static inline var EVENT_NETSERVER_CONNECTION = \"connection\";\r\n\tpublic static inline var EVENT_NETSERVER_CLOSE = \"close\";\r\n\r\n\tpublic static inline var FILE_READ = \"r\";\r\n\tpublic static inline var FILE_READ_APPEND = \"r+\";\r\n\tpublic static inline var FILE_WRITE = \"w\";\r\n\tpublic static inline var FILE_WRITE_APPEND = \"a+\";\r\n\tpublic static inline var FILE_READWRITE = \"a\";\r\n\tpublic static inline var FILE_READWRITE_APPEND = \"a+\";\r\n}\r\n\r\nclass Node {\r\n\tpublic static var assert(get,null) : NodeAssert;\r\n\tpublic static var childProcess(get,null) : NodeChildProcessCommands;\r\n\tpublic static var cluster(get,null) : NodeCluster;\r\n\tpublic static var console(default,null) : NodeConsole;\r\n\tpublic static var crypto(get,null) : NodeCrypto;\r\n\tpublic static var dgram(get,null) :NodeUDP ;\r\n\tpublic static var dns(get,null) : NodeDns;\r\n\tpublic static var fs(get,null) : NodeFS;\r\n\tpublic static var http(get,null) : NodeHttp;\r\n\tpublic static var https(get,null) : NodeHttps;\r\n\tpublic static var net(get,null) : NodeNet;\r\n\tpublic static var os(get,null) : NodeOs;\r\n\tpublic static var path(get,null) : NodePath;\r\n\tpublic static var process(default,null) : NodeProcess;\r\n\tpublic static var querystring(get,null) : NodeQueryString;\r\n\tpublic static var repl(get,null) : NodeREPL;\r\n\tpublic static var require(default,null) : String->Dynamic;\r\n\tpublic static var tls(get,null) : NodeTLS;\r\n\tpublic static var url(get,null) : NodeUrl;\r\n\tpublic static var util(get,null) : NodeUtil;\r\n\tpublic static var vm(get,null) : NodeVM;\r\n\r\n\t//\tpublic static var paths:Array;\r\n\tpublic static var setTimeout:Dynamic->Int->?Array->Int;\r\n\tpublic static var clearTimeout:Int->Void;\r\n\tpublic static var setInterval:Dynamic->Int->?Array->Int;\r\n\tpublic static var clearInterval:Int->Void;\r\n\tpublic static var setImmediate:Dynamic->?Array->Int;\r\n\tpublic static var clearImmediate:Int->Void;\r\n\tpublic static var global:Dynamic;\r\n\r\n\tpublic static var __filename(get, null):String;\r\n\tpublic static var __dirname(get, null):String;\r\n\tpublic static var module:Dynamic;\r\n\tpublic static var stringify:Dynamic->?Dynamic->?Dynamic->String;\r\n\tpublic static var parse:String->Dynamic;\r\n\tpublic static var queryString:NodeQueryString;\r\n\r\n\tstatic inline function get_assert() : NodeAssert return require(\"assert\");\r\n\tstatic inline function get_childProcess() : NodeChildProcessCommands return require(\"child_process\");\r\n\tstatic inline function get_cluster() : NodeCluster return require(\"cluster\");\r\n\tstatic inline function get_crypto() : NodeCrypto return require(\"crypto\");\r\n\tstatic inline function get_dgram() : NodeUDP return require(\"dgram\");\r\n\tstatic inline function get_dns() : NodeDns return require(\"dns\");\r\n\tstatic inline function get_fs() : NodeFS return require(\"fs\");\r\n\tstatic inline function get_http() : NodeHttp return require(\"http\");\r\n\tstatic inline function get_https() : NodeHttps return require(\"https\");\r\n\tstatic inline function get_net() : NodeNet return require(\"net\");\r\n\tstatic inline function get_os() : NodeOs return require(\"os\");\r\n\tstatic inline function get_path() : NodePath return require(\"path\");\r\n\tstatic inline function get_querystring() : NodeQueryString return require(\"querystring\");\r\n\tstatic inline function get_repl() : NodeREPL return require(\"repl\");\r\n\tstatic inline function get_tls() : NodeTLS return require(\"tls\");\r\n\tstatic inline function get_url() : NodeUrl return require(\"url\");\r\n\tstatic inline function get_util() : NodeUtil return require(\"util\");\r\n\tstatic inline function get_vm() : NodeVM return require(\"vm\");\r\n\r\n\tstatic inline function get___filename() : String return untyped __js__('__filename');\r\n\tstatic inline function get___dirname() : String return untyped __js__('__dirname');\r\n\r\n\tpublic static function newSocket(?options):NodeNetSocket {\r\n\t\treturn untyped __js__(\"new js.Node.net.Socket(options)\");\r\n\t}\r\n\r\n\t#if !macro\r\n\tpublic static function __init__()\r\n\t{\r\n\t\tuntyped __js__(\"var module, setImmediate, clearImmediate\");\r\n\t\tsetTimeout = untyped __js__('setTimeout');\r\n\t\tclearTimeout = untyped __js__('clearTimeout');\r\n\t\tsetInterval = untyped __js__('setInterval');\r\n\t\tclearInterval = untyped __js__('clearInterval');\r\n\t\tglobal = untyped __js__('global');\r\n\t\tprocess = untyped __js__('process');\r\n\t\trequire = untyped __js__('require');\r\n\t\tconsole = untyped __js__('console');\r\n\t\tmodule = untyped __js__('module');\t// ref to the current module\r\n\t\tstringify = untyped __js__('JSON.stringify');\r\n\t\tparse = untyped __js__('JSON.parse');\r\n\t\t// Not present in Node < 0.9\r\n\t\tvar version = process.version.substr(1).split(\".\").map(Std.parseInt);\r\n\t\tif (version[0] > 0 || version[1] >= 9) {\r\n\t\t\tsetImmediate = untyped __js__('setImmediate');\r\n\t\t\tclearImmediate = untyped __js__('clearImmediate');\r\n\t\t}\r\n\t}\r\n\t#end\r\n}\r\n\r\n\r\n","package;\nimport jQuery.*;\nimport js.Browser;\nimport js.Node;\n\n@:keep @:expose class Utils\n\t{\n\tpublic static var gui = Node.require(\"nw.gui\");\n\tpublic static var path = Node.path;\n\t\n\t\n\tprivate static var fs:js.Node.NodeFS = Node.fs;\n\tprivate static var node_exec = Node.childProcess.exec;\n\tprivate static var node_os = Node.os;\n\t\n\t\n\tpublic static function checkFileExist(filename:String):Bool\n\t\t{\n\t\treturn Utils.fs.existsSync(filename);\n\t\t}\n\t\n\t// file manipulation\n\tpublic static function newFile(filename:String):Void\n\t\t{\n\t\tfs.openSync(filename,\"a+\");\n\t\t}\n\n\tpublic static function readFile(filename:String):String\n \t{\n\t\tvar ret = fs.readFileSync(filename,\"utf-8\");\n\t\treturn ret;\n \t}\n\n\n\tpublic static function saveFile(filename:String, content:String):Void\n \t{\n\t\tfs.writeFileSync(filename, content);\n\t\ttrace(\"SYSTEM: file saved \"+filename);\n \t}\n \n\n\n\n\n\t// folder manipulation\n public static function readDir(path:String):Array\n \t{\n \treturn fs.readdirSync(path);\n\t }\n \n \n // support\n \n\tpublic static function loadJS(script:String,callback:Dynamic):Void\n\t\t{\n\t\tJQueryStatic.ajaxSetup({async:false});\n\t\tJQueryStatic.getScript(script,callback(script));\n\t\tJQueryStatic.ajaxSetup({async:true});\n\t\t}\n\t\t\n\tpublic static function loadCSS(css:String):Void\n\t\t{\n\t\tnew JQuery(\"head\").append(\"\");\n\t\t}\n\t\t\n\t\t\n\tpublic static function repair_path(path:String):String\n\t\t{\n\t\tif (node_os.type() == \"Windows_NT\")\n\t\t\t{\n\t\t\tpath = StringTools.replace(path,\"\\\\\", \"\\\\\\\\\");\t\t\n\t\t\t}\n\t\telse\n\t\t\t{\n\t\t\t}\n\t\treturn path;\n\t\t}\t\t\n\t\t\n\tpublic static function exec(lines_to_exec:Array,callback:Dynamic)\n\t\t{\n\t\tvar os_type = \"\";\n\t\tvar join_str = \"\";\n\t\tvar join_str_cd = \"\";\n\t\tvar cat_service = \"\";\n\t\tvar quote = \"\";\n\t\t\n\t\tswitch(node_os.type())\n\t {\n\t\t\tcase \"Windows_NT\":\n\t\t\t\tos_type = \"WINDOWS\";\n\t\t\tcase \"Linux\":\n\t\t\t\tos_type = \"LINUX\";\n\t\t\tcase _:\n\t\t\t\tos_type = \"OTHER\";\n \t }\n\n\t\tif (os_type == \"LINUX\")\n\t\t\t{\n\t\t\tjoin_str = \" ; \";\n\t\t\tjoin_str_cd = \"\";\n\t\t\tcat_service = \" cat \";\n\t\t\tquote = '\"';\n\t\t\t}\n\t\telse if (os_type == \"WINDOWS\")\n\t\t\t{\n\t\t\tjoin_str = \" & \";\n\t\t\tjoin_str_cd = \" /D \";\n\t\t\tcat_service = \" type \";\n\t\t\tquote = '\"';\n\t\t\t}\t\t\t\n\t\telse // mac\n\t\t\t{\n\t\t\tjoin_str = \" ; \";\n\t\t\tjoin_str_cd = \"\";\n\t\t\tcat_service = \" cat \";\n\t\t\tquote = '\"';\n\t\t\t}\n\t\t\n\t\tvar exec_str = \"\";\n\t\tvar temp = \"\";\n\t\tvar exec_array:Array = [];\n\t\tfor (each in lines_to_exec)\n\t\t\t{\n\t\t\ttemp = StringTools.replace(each,\"%CD%\", join_str_cd);\n\t\t\ttemp = StringTools.replace(temp,\"%CAT%\", cat_service);\n\t\t\ttemp = StringTools.replace(temp,\"%QUOTE%\", quote);\n\t\t\texec_array.push(temp);\n\t\t\t}\n\t\texec_str = exec_array.join(join_str);\n\t\t//trace (exec_str);\n\t\tnode_exec(exec_str,{},function(error, stdout:String,stderr:String){\n\t\t\tif (error != null) // error\n\t\t\t\t{\n\t\t\t\tif (stdout!=\"\")\n\t\t\t\t\t{\n\t\t\t\t\tuntyped notify(stdout,\"danger\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\tcallback(error, stdout,stderr);\n\t\t\t});\n\t\t}\t\n\t\t\n \n\t}\n","/*\r\n * Copyright (c) 2005-2008, The haXe Project Contributors\r\n * All rights reserved.\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * - Redistributions of source code must retain the above copyright\r\n * notice, this list of conditions and the following disclaimer.\r\n * - Redistributions in binary form must reproduce the above copyright\r\n * notice, this list of conditions and the following disclaimer in the\r\n * documentation and/or other materials provided with the distribution.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE HAXE PROJECT CONTRIBUTORS \"AS IS\" AND ANY\r\n * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\r\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\r\n * DISCLAIMED. IN NO EVENT SHALL THE HAXE PROJECT CONTRIBUTORS BE LIABLE FOR\r\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\r\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\r\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\r\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\r\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\r\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\r\n * DAMAGE.\r\n */\r\npackage haxe.io;\r\n\r\nclass Bytes {\r\n\r\n\tpublic var length(default,null) : Int;\r\n\tvar b : BytesData;\r\n\r\n\tfunction new(length,b) {\r\n\t\tthis.length = length;\r\n\t\tthis.b = b;\r\n\t}\r\n\r\n\tpublic inline function get( pos : Int ) : Int {\r\n\t\t#if neko\r\n\t\treturn untyped __dollar__sget(b,pos);\r\n\t\t#elseif flash9\r\n\t\treturn b[pos];\r\n\t\t#elseif php\r\n\t\treturn untyped __call__(\"ord\", b[pos]);\r\n\t\t#elseif cpp\r\n\t\treturn untyped b[pos];\r\n\t\t#else\r\n\t\treturn b[pos];\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic inline function set( pos : Int, v : Int ) : Void {\r\n\t\t#if neko\r\n\t\tuntyped __dollar__sset(b,pos,v);\r\n\t\t#elseif flash9\r\n\t\tb[pos] = v;\r\n\t\t#elseif php\r\n\t\tb[pos] = untyped __call__(\"chr\", v);\r\n\t\t#elseif cpp\r\n\t\tuntyped b[pos] = v;\r\n #elseif (nodejs || nodejs_std)\r\n b[pos] = v;\r\n\t\t#else\r\n\t\tb[pos] = v & 0xFF;\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function blit( pos : Int, src : Bytes, srcpos : Int, len : Int ) : Void {\r\n\t\t#if !neko\r\n\t\tif( pos < 0 || srcpos < 0 || len < 0 || pos + len > length || srcpos + len > src.length ) throw Error.OutsideBounds;\r\n\t\t#end\r\n\t\t#if neko\r\n\t\ttry untyped __dollar__sblit(b,pos,src.b,srcpos,len) catch( e : Dynamic ) throw Error.OutsideBounds;\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\tb = untyped __php__(\"substr($this->b, 0, $pos) . substr($src->b, $srcpos, $len) . substr($this->b, $pos+$len)\"); //__call__(\"substr\", b, 0, pos)+__call__(\"substr\", src.b, srcpos, len)+__call__(\"substr\", b, pos+len);\r\n\t\t#elseif flash9\r\n\t\tb.position = pos;\r\n\t\tb.writeBytes(src.b,srcpos,len);\r\n\t\t#elseif (nodejs || nodejs_std)\r\n src.getData().copy(b,pos,srcpos,srcpos+len);\r\n #else\r\n\t\tvar b1 = b;\r\n\t\tvar b2 = src.b;\r\n\t\tif( b1 == b2 && pos > srcpos ) {\r\n\t\t\tvar i = len;\r\n\t\t\twhile( i > 0 ) {\r\n\t\t\t\ti--;\r\n\t\t\t\tb1[i + pos] = b2[i + srcpos];\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor( i in 0...len )\r\n\t\t\tb1[i+pos] = b2[i+srcpos];\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function sub( pos : Int, len : Int ) : Bytes {\r\n\t\t#if !neko\r\n\t\tif( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;\r\n\t\t#end\r\n\t\t#if neko\r\n\t\treturn try new Bytes(len,untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;\r\n\t\t#elseif flash9\r\n\t\tb.position = pos;\r\n\t\tvar b2 = new flash.utils.ByteArray();\r\n\t\tb.readBytes(b2,0,len);\r\n\t\treturn new Bytes(len,b2);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn new Bytes(len, untyped __call__(\"substr\", b, pos, len));\r\n\t\t#elseif (nodejs || nodejs_std)\r\n\r\n /* node slice does not return a copy, so need a blit(copy) */\r\n var\r\n nb = new js.Node.NodeBuffer(len),\r\n slice:js.Node.NodeBuffer = b.slice(pos,pos+len);\r\n\r\n slice.copy(nb,0,0,len);\r\n\t\treturn new Bytes(len,nb);\r\n\t\t#else\r\n\t\treturn new Bytes(len,b.slice(pos,pos+len));\r\n #end\r\n\t}\r\n\r\n\tpublic function compare( other : Bytes ) : Int {\r\n\t\t#if neko\r\n\t\treturn untyped __dollar__compare(b,other.b);\r\n\t\t#elseif flash9\r\n\t\tvar len = (length < other.length) ? length : other.length;\r\n\t\tvar b1 = b;\r\n\t\tvar b2 = other.b;\r\n\t\tb1.position = 0;\r\n\t\tb2.position = 0;\r\n\t\tfor( i in 0...len>>2 )\r\n\t\t\tif( b1.readUnsignedInt() != b2.readUnsignedInt() ) {\r\n\t\t\t\tb1.position -= 4;\r\n\t\t\t\tb2.position -= 4;\r\n\t\t\t\treturn b1.readUnsignedInt() - b2.readUnsignedInt();\r\n\t\t\t}\r\n\t\tfor( i in 0...len & 3 )\r\n\t\t\tif( b1.readUnsignedByte() != b2.readUnsignedByte() )\r\n\t\t\t\treturn b1[b1.position-1] - b2[b2.position-1];\r\n\t\treturn length - other.length;\r\n\t\t#elseif php\r\n\t\treturn untyped __php__(\"$this->b < $other->b ? -1 : ($this->b == $other->b ? 0 : 1)\");\r\n\t\t#else\r\n\t\tvar b1 = b;\r\n\t\tvar b2 = other.b;\r\n\t\tvar len = (length < other.length) ? length : other.length;\r\n\t\tfor( i in 0...len )\r\n\t\t\tif( b1[i] != b2[i] )\r\n\t\t\t\t#if cpp\r\n\t\t\t\treturn untyped b1[i] - untyped b2[i];\r\n\t\t\t\t#else\r\n\t\t\t\treturn b1[i] - b2[i];\r\n\t\t\t\t#end\r\n\t\treturn length - other.length;\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function readString( pos : Int, len : Int ) : String {\r\n\t\t#if !neko\r\n\t\tif( pos < 0 || len < 0 || pos + len > length ) throw Error.OutsideBounds;\r\n\t\t#end\r\n\t\t#if neko\r\n\t\treturn try new String(untyped __dollar__ssub(b,pos,len)) catch( e : Dynamic ) throw Error.OutsideBounds;\r\n\t\t#elseif flash9\r\n\t\tb.position = pos;\r\n\t\treturn b.readUTFBytes(len);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn untyped __call__(\"substr\", b, pos, len);\r\n//\t\treturn untyped __call__(\"call_user_func_array\", \"pack\", __call__(\"array_merge\", __call__(\"array\", \"C*\"), __call__(\"array_slice\", b.ťa, pos, len)));\r\n\t\t#elseif cpp\r\n\t\tvar result:String=\"\";\r\n\t\tuntyped __global__.__hxcpp_string_of_bytes(b,result,pos,len);\r\n\t\treturn result;\r\n\t\t#else\r\n\t\tvar s = \"\";\r\n\t\tvar b = b;\r\n\t\tvar fcc = String.fromCharCode;\r\n\t\tvar i = pos;\r\n\t\tvar max = pos+len;\r\n\t\t// utf8-encode\r\n\t\twhile( i < max ) {\r\n\t\t\tvar c = b[i++];\r\n\t\t\tif( c < 0x80 ) {\r\n\t\t\t\tif( c == 0 ) break;\r\n\t\t\t\ts += fcc(c);\r\n\t\t\t} else if( c < 0xE0 )\r\n\t\t\t\ts += fcc( ((c & 0x3F) << 6) | (b[i++] & 0x7F) );\r\n\t\t\telse if( c < 0xF0 ) {\r\n\t\t\t\tvar c2 = b[i++];\r\n\t\t\t\ts += fcc( ((c & 0x1F) << 12) | ((c2 & 0x7F) << 6) | (b[i++] & 0x7F) );\r\n\t\t\t} else {\r\n\t\t\t\tvar c2 = b[i++];\r\n\t\t\t\tvar c3 = b[i++];\r\n\t\t\t\ts += fcc( ((c & 0x0F) << 18) | ((c2 & 0x7F) << 12) | ((c3 << 6) & 0x7F) | (b[i++] & 0x7F) );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn s;\r\n #else (nodejs || nodejs_std)\r\n return b.toString(js.Node.UTF8,pos,pos+len);\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic function toString() : String {\r\n\t\t#if neko\r\n\t\treturn new String(untyped __dollar__ssub(b,0,length));\r\n\t\t#elseif flash9\r\n\t\tb.position = 0;\r\n\t\treturn b.readUTFBytes(length);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn cast b;\r\n//\t\treturn untyped __call__(\"call_user_func_array\", \"pack\", __call__(\"array_merge\", __call__(\"array\", \"C*\"), b.ťa));\r\n\t\t#else\r\n\t\treturn readString(0,length);\r\n\t\t#end\r\n\t}\r\n\t\r\n\tpublic function toHex() : String {\r\n\t\tvar s = new StringBuf();\r\n\t\tvar chars = [];\r\n\t\tvar str = \"0123456789abcdef\";\r\n\t\tfor( i in 0...str.length )\r\n\t\t\tchars.push(str.charCodeAt(i));\r\n\t\tfor( i in 0...length ) {\r\n\t\t\tvar c = get(i);\r\n\t\t\ts.addChar(chars[c >> 4]);\r\n\t\t\ts.addChar(chars[c & 15]);\r\n\t\t}\r\n\t\treturn s.toString();\r\n\t}\r\n\r\n\tpublic inline function getData() : BytesData {\r\n\t\treturn b;\r\n\t}\r\n\r\n\tpublic static function alloc( length : Int ) : Bytes {\r\n\t\t#if neko\r\n\t\treturn new Bytes(length,untyped __dollar__smake(length));\r\n\t\t#elseif flash9\r\n\t\tvar b = new flash.utils.ByteArray();\r\n\t\tb.length = length;\r\n\t\treturn new Bytes(length,b);\r\n\t\t#elseif php\r\n\t\t// TODO: test me\r\n\t\treturn new Bytes(length, untyped __call__(\"str_repeat\", __call__(\"chr\", 0), length));\r\n\t\t/*\r\n\t\tif(length > 0)\r\n\t\t\treturn new Bytes(length, untyped __call__(\"new _hx_array\", __call__(\"array_fill\", 0, length, 0)));\r\n\t\telse\r\n\t\t\treturn new Bytes(0, untyped __call__(\"new _hx_array\", __call__(\"array\")));\r\n\t\t*/\r\n\t\t#elseif cpp\r\n\t\tvar a = new BytesData();\r\n\t\tif (length>0) a[length-1] = untyped 0;\r\n\t\treturn new Bytes(length,a);\r\n\t\t#elseif (nodejs || nodejs_std)\r\n return new Bytes(length,new js.Node.NodeBuffer(length));\r\n\r\n #else\r\n\t\tvar a = new Array();\r\n\t\tfor( i in 0...length )\r\n\t\t\ta.push(0);\r\n\t\treturn new Bytes(length,a);\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic static function ofString( s : String ) : Bytes {\r\n\t\t#if neko\r\n\t\treturn new Bytes(s.length,untyped __dollar__ssub(s.__s,0,s.length));\r\n\t\t#elseif flash9\r\n\t\tvar b = new flash.utils.ByteArray();\r\n\t\tb.writeUTFBytes(s);\r\n\t\treturn new Bytes(b.length,b);\r\n\t\t#elseif php\r\n\t\treturn new Bytes(untyped __call__(\"strlen\", s), cast s);\r\n//\t\treturn ofData(untyped __call__(\"new _hx_array\", __call__(\"array_values\", __call__(\"unpack\", \"C*\", s))));\r\n\t\t#elseif cpp\r\n\t\tvar a = new BytesData();\r\n\t\tuntyped __global__.__hxcpp_bytes_of_string(a,s);\r\n\t\treturn new Bytes(a.length,a);\r\n\t\t#elseif (nodejs || nodejs_std)\r\n var nb = new js.Node.NodeBuffer(s, js.Node.NodeC.UTF8);\r\n return new Bytes(nb.length,nb);\r\n #else\r\n\t\tvar a = new Array();\r\n\t\t// utf8-decode\r\n\t\tfor( i in 0...s.length ) {\r\n\t\t\tvar c : Int = untyped s[\"cca\"](i);\r\n\t\t\tif( c <= 0x7F )\r\n\t\t\t\ta.push(c);\r\n\t\t\telse if( c <= 0x7FF ) {\r\n\t\t\t\ta.push( 0xC0 | (c >> 6) );\r\n\t\t\t\ta.push( 0x80 | (c & 63) );\r\n\t\t\t} else if( c <= 0xFFFF ) {\r\n\t\t\t\ta.push( 0xE0 | (c >> 12) );\r\n\t\t\t\ta.push( 0x80 | ((c >> 6) & 63) );\r\n\t\t\t\ta.push( 0x80 | (c & 63) );\r\n\t\t\t} else {\r\n\t\t\t\ta.push( 0xF0 | (c >> 18) );\r\n\t\t\t\ta.push( 0x80 | ((c >> 12) & 63) );\r\n\t\t\t\ta.push( 0x80 | ((c >> 6) & 63) );\r\n\t\t\t\ta.push( 0x80 | (c & 63) );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn new Bytes(a.length,a);\r\n\t\t#end\r\n\t}\r\n\r\n\tpublic static function ofData( b : BytesData ) {\r\n\t\t#if flash9\r\n\t\treturn new Bytes(b.length,b);\r\n\t\t#elseif neko\r\n\t\treturn new Bytes(untyped __dollar__ssize(b),b);\r\n\t\t#elseif php\r\n\t\treturn new Bytes(untyped __call__(\"strlen\", b), b);\r\n\t\t#else\r\n\t\treturn new Bytes(b.length,b);\r\n\t\t#end\r\n\t}\r\n\r\n}\r\n","package ui;\r\n\r\nimport jQuery.*;\r\nimport js.Browser;\r\n\r\n\r\n@:keep @:expose @:native(\"ui.FileDialog\") class FileDialog\r\n{\r\n\tpublic function new():Void\r\n\t{\r\n\t}\r\n\t\r\n\tpublic function show(function_name, saveAs:Bool=false)\r\n\t{\r\n\t\tif (saveAs == false)\r\n\t\t{\r\n\t\tnew JQuery('#temp').html(\"\");\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\tnew JQuery('#temp').html(\"\");\t\t\t\r\n\t\t}\r\n\r\n\r\n\t\tvar chooser = new JQuery(\"#temp_fileDialog\");\r\n\t\tchooser.change(function(evt) {\r\n\t\t\tvar filepath = chooser.val();\r\n\t\t\t//new JQuery(js.Browser.document).triggerHandler(event_name,filepath);\r\n\t\t\t//untyped $(document).triggerHandler(event_name,filepath);\r\n\t\t\tfunction_name(filepath);\r\n\t\t\t});\r\n\t\tchooser.trigger('click'); \r\n\r\n\t}\r\n}\r\n","package ui;\r\n\r\nimport jQuery.*;\r\n\r\n@:keep @:expose @:native(\"ui.ModalDialog\") class ModalDialog\r\n{\r\n\tpublic var id:String;\r\n\tpublic var title:String;\r\n\tpublic var content:String;\r\n\tpublic var ok_text:String;\r\n\tpublic var cancel_text:String;\r\n\tpublic var footer:Bool;\r\n\tpublic var header:Bool;\r\n\t\r\n\t\r\n\t\r\n\tpublic function new()\r\n\t{\r\n\t\ttitle = '';\r\n\t\tid = '';\r\n\t\tcontent = '';\r\n\t\theader = true;\r\n\t\tfooter = true;\r\n\t\tok_text = '';\r\n\t\tcancel_text = '';\r\n\t}\r\n\t\r\n\tpublic function updateModalDialog()\r\n\t{\r\n\t\tvar retStr = [\"\"].join(\"\\n\");\r\n\r\n\t\tnew JQuery(\"#modal_position\").html(retStr);\r\n\t\tnew JQuery(\"#style_overide\").append(\"\");\r\n\t}\r\n\t\r\n\tpublic function show()\r\n\t{\r\n\t\tupdateModalDialog();\t\r\n\t\r\n\t\t// using untyped\r\n\t\t// http://haxe.org/doc/js/extern_libraries\r\n\t\tuntyped new JQuery(\"#\"+id).modal(\"show\");\r\n\t\t\r\n\t\tnew JQuery('#'+id).on('hidden.bs.modal', function () {\r\n\t\t\tnew JQuery(\"#\"+id).remove();\r\n\t\t});\t\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\tpublic function hide()\r\n\t{\r\n\t\t// using untyped\r\n\t\t// http://haxe.org/doc/js/extern_libraries\r\n\t\tuntyped new JQuery(\"#\"+id).modal(\"hide\");\r\n\t}\r\n}","package ui;\r\n\r\nimport jQuery.*;\r\n\r\n@:keep @:expose @:native(\"ui.Notify\") class Notify\r\n{\r\n\tpublic var type:String;\r\n\tpublic var content:String;\r\n\t\r\n\t\r\n\t\r\n\tpublic function new()\r\n\t{\t\r\n\t\ttype = '';\r\n\t\tcontent = '';\r\n\t}// end new\r\n\t\r\n\t\r\n\t\r\n\tpublic function show()\r\n\t{\r\n\t\tvar type_error = '';\r\n\t\tvar type_error_text = '';\r\n\t\tvar skip = true;\r\n\t\t\r\n\t\tif (type == \"error\")\r\n\t\t{\r\n\t\t\ttype_error = \"danger\";\r\n\t\t\ttype_error_text = \"Error\";\r\n\t\t\tskip = false;\r\n\t\t}\r\n\t\telse if (type == \"warning\")\r\n\t\t{\r\n\t\t\ttype_error = \"warning\";\r\n\t\t\ttype_error_text = \"Warning\";\r\n\t\t\tskip = false;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\ttype_error = \"warning\";\r\n\t\t\ttype_error_text = \"\";\r\n\t\t\tskip = false;\t\t\t\r\n\t\t}\r\n\r\n\t\r\n\t\tif (skip == false)\r\n\t\t{\r\n\t\t\tvar retStr = ['
',\r\n\t\t\t'×',\r\n\t\t\t''+type_error_text+'
'+content,\r\n\t\t\t'
'].join(\"\\n\");\r\n\t\t\t\r\n\t\t\t new JQuery('#notify_position').html(retStr); \r\n\t\t}\r\n\t} // end show\r\n}"], "names":[], "mappings":";;yBASO,dAEN;GAAa;;;KAIP,4BACN;EACQ;EACR,DAAE,EAAK;EACP,DAAE,EAAK;EACP,DAAE,EAAK;EACA,DAAgB;;MAGjB,SAEN;EAAI,CAAoB,FACvB;GACe;GACf;GAAa;GAAb,AAAa,FACZ;IADD,DAAa,FAAb;;IAEC,FAAI,DAAK,GAAM,HAEP,KAIP,FAAY;;GAGN,FAAC;MAIF,LAAC;;gBAIH,WAEN;EAAI,CAAoB,FACvB;GACe;GACf;GAAa;GAAb,AAAa,FACZ;IADD,DAAa,FAAb;;IAEC,FAAI,DAAK,GAAM,HAEd,AAAW,AAAU,EAAK,GAI1B,FAAY;;;;QAMT,OAEN;EAAI,CAAoB,FACvB;GACe;GACf;GAAa;GAAb,AAAa,FACZ;IADD,DAAa,FAAb;;IAEC,FAAI,DAAK,GAAM,HAId,AAAkB,AAAS,KAK3B,FAAY;;;;;;kBCtBT,AAAoD;CAIlD,EAAM,FAAc;CAE5B,CAAI,EAAK,HACO;CACT;;qBAGD,DAA8D;CACpE,CAAI,EAAO,AAAQ,AAAO,AAAK,AAAO,AAAQ,DAAM,FAAW;CAC/D,CAAI,EAAO,HAAO,EAAM;CACxB,CAAI,CAAM,FAAG;EACZ,CAAM,AAAW;EACjB,AAAI,CAAM,FAAI,EAAM;MACf,JAAI,CAAM,FACf,EAAM,AAAW,AAAM;CAGjB,AAAmB,AAAK;;;YCpElB,DACb;;uBAGa,ZACb;CACA,EAAU;CACV,EAAU;CACV,EAAa;CACb,EAAU;CAGV;CACA;CACG;CAIqB;CACxB,AAAwB,EAAU;CAClC;CACA,AAAgB,EAAU,FAAU;;uBAKvB,YAEb;;GAAa,FACZ;EADD,CAAa,FAAb;;EAEC,AAAI,EAAQ,HACX;GACA,SAAM;GACN,FAAa,EAAK,AAAI,AAAK,FAAiB,gBAAgB;;MAI5D;;;+BAKW,hBACb;CACuB,AAAc;CAExB;CACb;GAAa,FACZ;EADD,CAAa,FAAb;;EAEC,DAAY,AAAW,AAAe,EAAK,AAAI,AAAK;;CAG3B;CAC1B;GAAa,FACZ;EADD,CAAa,FAAb;;EAEC,AAAI,EAA0B,HAC7B;GACW;GAGD,FAAe;GACzB;GAAiB,FAChB;IADD,DAAiB,FAAjB;;IAEC,HAAU,AAAc,AAAiB;;GAG1C;GAAc,FACb;IADD,DAAc,FAAd;;IAEC,HAAyB,AAAC,AAAgB;;MAK3C,LAA0B,AAAC,AAAgB;;CAGH,AAAM;CAChD,EAAkC;;UCnF5B,CACP;CACC,EAAoB;CACpB,EAAiB;;;WAGX,6BACP;EACY;EACX,DAAU;EACV,DAAU;EACV,DAAuB;EACf,DAAkB,AAAQ,AAAY;;QAGxC,wCACP;EACY;EACX,DAAU;EACV,DAAU;EACV,DAAoB;EACZ,DAA0B,AAAQ,AAAmB;;gBAGvD,LAEN;EAAO;;aAGD,FAEN;EAAO;;;;gBCZM,EACb;CAAO,GAAI;CAAE;;EAA4B;;;iBAqB5B,LAA+C;CACpD;CACR,CAAI,EAAK,HAAc;EACD;EACrB;EACA,AAAI,EAAK,AAAY,AAAK,AAAoB,HAAoB,AAAG,AAAK,AAAO;EACjF;;CAEM;;sBChDD,XACP;CACC,EAAc;CACd,EAAwB;CACxB,EAAiB;CACjB,EAAc;;;eC4BD,HAA4C;CACzC,AAAmB,AAAG;CAEtC,CAAI,EAAK,AAAK,HAAC,AAAa,GAAM,AAAY,HAAa,GAAM,HAChE,EAAY,FAAmB;CAChC,CAAY,DAAgB,AACpB;CACI;;YCHN,DAdR;CAEgB,AAFhB,EAEgB;;;sBCgQD,HAYb;CAAO,AAAQ,AAAU;;;;qBCioBZ,VAAmC;CAAO,AAAQ;;2BAClD,hBAAuD;CAAO,AAAQ;;sBACtE,XAAqC;CAAO,AAAQ;;qBACpD,VAAmC;CAAO,AAAQ;;oBAClD,TAA+B;CAAO,AAAQ;;kBAC9C,PAA6B;CAAO,AAAQ;;iBAC5C,NAA2B;CAAO,AAAQ;;mBAC1C,RAA+B;CAAO,AAAQ;;oBAC9C,TAAiC;CAAO,AAAQ;;kBAChD,PAA6B;CAAO,AAAQ;;iBAC5C,NAA2B;CAAO,AAAQ;;mBAC1C,RAA+B;CAAO,AAAQ;;0BAC9C,fAA6C;CAAO,AAAQ;;mBAC5D,RAA+B;CAAO,AAAQ;;kBAC9C,PAA6B;CAAO,AAAQ;;kBAC5C,PAA6B;CAAO,AAAQ;;mBAC5C,RAA+B;CAAO,AAAQ;;iBAC9C,NAA2B;CAAO,AAAQ;;yBAE1C,dAAmC;CAAe;;wBAClD,bAAkC;CAAe;;oBAEjD,FACb;CAAe;;;uBCt7BF,JAEb;CAAO,AAAoB;;gBAId,GAEb;CAAY,AAAS;;iBAGR,EACV;CACO,AAAgB,AAAS;CAC5B;;iBAIM,UACV;CACH,AAAiB,AAAU;CAC3B,WAAM,TAAsB;;gBAQZ,DAEb;CAAO,AAAe;;eAMZ,WACb;CACA,AAAuB,OAAO;CAC9B,AAAuB,AAAO,AAAS;CACvC,AAAuB,OAAO;;gBAGjB,FAEb;MAAW,LAAe,EAAgD,AAAI;;oBAIjE,LACb;CACA,CAAI,EAAkB,HAErB,EAAO,FAAoB,AAAK,AAAM,KAGtC;;CAEM;;aAGM,oBACb;CACc;CACC;CACG;CACA;CACN;CAEL;CAAP,KAAO;KAED;EACJ,CAAU;;KACN;EACJ,CAAU;;;EAEV,CAAU;;CAGZ,CAAI,EAAY,HACf;EACA,CAAW;EACX,CAAc;EACd,CAAc;EACd,CAAS;MAEL,JAAI,EAAY,HACpB;EACA,CAAW;EACX,CAAc;EACd,CAAc;EACd,CAAS;MAGT;EACA,CAAW;EACX,CAAc;EACd,CAAc;EACd,CAAS;;CAGK;CACJ;CACoB;CAC/B;GAAa,FACZ;EADD,CAAa,FAAb;;EAEC,CAAO,FAAoB,AAAK,AAAQ;EACxC,CAAO,FAAoB,AAAK,AAAS;EACzC,CAAO,FAAoB,AAAK,AAAW;EAC3C,DAAgB;;CAEjB,EAAW,FAAgB;CAE3B,AAAU,AAAS,AAAG,6BAA4C;EACjE,AAAI,EAAS,HAEZ;EAAI,EAAQ,HAEH,AAAO,AAAO;;EAGxB,DAAS,AAAO,AAAO;;;;;gBC3GzB,GAAuB;CACtB,EAAc;CACd,EAAS;;sBA8MI,LAAuC;CAwB5C;CACE;CAAV,EAAc,FAAd;;EACC,DAAO;;CACD,iBAAU,jBAAO;;yBAIX,bAAwC;CAkB7C;CAEE;CAAI;CAAd,AAAyB;EAAzB;EACuB,DAAS;EAC/B,AAAI,EAAK,HACR,AAAO,KACH,JAAI,EAAK,HAAQ;GACrB,FAAQ,EAAO,AAAC,CAAK;GACrB,FAAQ,EAAO,AAAC,AAAI;MACd,JAAI,EAAK,HAAS;GACxB,FAAQ,EAAO,AAAC,CAAK;GACrB,FAAQ,EAAO,AAAC,AAAC,CAAK,DAAK;GAC3B,FAAQ,EAAO,AAAC,AAAI;MACd;GACN,FAAQ,EAAO,AAAC,CAAK;GACrB,FAAQ,EAAO,AAAC,AAAC,CAAK,DAAM;GAC5B,FAAQ,EAAO,AAAC,AAAC,CAAK,DAAK;GAC3B,FAAQ,EAAO,AAAC,AAAI;;;CAGf,iBAAU,jBAAS;;uBAIb,XAQb;CAAO,iBAAU,jBAAS;;;KA5Rb,SAUb;EAAO,DAAE;;KAII,WAYb;CAAE,EAAO,AAAI;;MAIP,uBAAwE;EAE9E,AAAI,CAAM,CAAK,DAAS,CAAK,DAAM,CAAK,DAAM,AAAM,CAAU,DAAS,AAAM,FAAa,KAAM;EAavF;EACA;EACT,AAAI,EAAM,AAAM,DAAM,FAAS;GACtB;GACR,EAAO,FAAI,FAAI;IACd;IACA,HAAG,EAAI,AAAO,FAAG,EAAI;;GAEtB;;EAES;EAAV,CAAc,FAAd;;GACC,FAAG,EAAE,AAAO,FAAG,EAAE;;;KAIZ,aAA6C;EAEnD,AAAI,CAAM,CAAK,DAAM,CAAK,DAAM,AAAM,FAAS,KAAM;EAsB9C,gBAAU,jBAAI,AAAQ,AAAI,EAAI;;SAI/B,OAAwC;EAsBrC;EACA;EACC;CAAC,EAAS,FAAgB,KAAS;EACnC;EAAV,CAAc,FAAd;;GACC,DAAI,DAAG,GAAM,HAAG,AAIR,AAAG,EAAK,FAAG;;EAEb,CAAS;;YAIV,MAAqD;EAE3D,AAAI,CAAM,CAAK,DAAM,CAAK,DAAM,AAAM,FAAS,KAAM;EAgB7C;EACA;EACE;EACF;EACE,CAAI;EAEd,GAAO,FAAI,FAAM;GACR,FAAE;GACV,DAAI,CAAI,FAAO;IACd,FAAI,EAAK,HAAI;IACb,AAAK,HAAI;MACH,JAAI,CAAI,FACd,GAAK,HAAK,AAAC,AAAC,EAAI,CAAS,DAAK,AAAC,FAAE,EAAO,GACpC,JAAI,CAAI,FAAO;IACV,HAAE;IACX,AAAK,HAAK,AAAC,AAAC,EAAI,CAAS,DAAM,AAAC,FAAC,EAAK,CAAS,DAAK,AAAC,FAAE,EAAO;MACxD;IACG,HAAE;IACF,HAAE;IACX,AAAK,HAAK,AAAC,AAAC,EAAI,CAAS,DAAM,AAAC,FAAC,EAAK,CAAS,DAAM,AAAC,AAAC,CAAM,DAAK,AAAQ,AAAC,FAAE,EAAO;;;EAG/E;;UAMD,CAWN;EAAO,DAAW,AAAE;;OAId,IAA0B;EACxB;EACI;EACF;EACA;EAAI;EAAd;;GACC,FAAW,AAAe;;EACjB;EAAI;EAAd,DAAuB;GAAvB;GACS,FAAI;GACZ,FAAU,AAAM,GAAK;GACrB,FAAU,AAAM,EAAI;;EAEd;;SAGM,EACb;EAAO;;;;;;;;;;;;;4BCpOD,jBACP;;;MAGO;;EAEN,AAAI,EAAU,HAEd,KAAY,LAAa,KAIzB,AAAY,LAAa;EAIX,IAAW;EACzB,DAAe,aAAc;GACb;GAGf,FAAc;;EAEf,DAAiB;;;6BCfX,lBACP;CACC,EAAS;CACT,EAAM;CACN,EAAW;CACX,EAAS;CACT,EAAS;CACT,EAAW;CACX,EAAe;;;mBAGT,RACP;EACc,DAAC,EAA+B,AAAG,FAC3C,AACA,AAAoC;EAEzC,AAAI,EAAU,HAEb,GAAU,HAAC,AACX,AACA,EAA2B,AAAM,FACjC,AAAe;EAGhB,EAAW,HAAC,AACT,AACA,AAAe;EAGlB,AAAI,EAAU,HAEb,GAAU,HAAE,AACT,EAAsE,AAAY,FAClF,EAA2D,AAAQ,FACnE,AAAe;EAInB,EAAU,HAAC,AACR,AACA,AAAe;EAElB,IAAW,LAAwB;EACnC,IAAW,LAAyB;;MAG9B,KACP;EADO;EAEN;EAIQ,IAAW,HAAI,FAAU;EAEjC,IAAW,AAAC,HAAG,FAAQ,AAAvB,AAAyC,UACxC;MAAW,HAAI;;;MAKV,KAIE;MAAW,HAAI,FAAU;;;wBCtE3B,bACP;CACC,EAAQ;CACR,EAAW;;;MAKJ,KACR;EACmB;EACK;EACZ;EAEX,AAAI,EAAQ,HACZ;GACC,AAAa;GACb,AAAkB;GAClB,AAAO;MAEH,JAAI,EAAQ,HACjB;GACC,AAAa;GACb,AAAkB;GAClB,AAAO;MAGR;GACC,AAAa;GACb,AAAkB;GAClB,AAAO;;EAIR,AAAI,EAAQ,HACZ;GACc,FAAC,AAAC,EAAsF,AAAY,FAChH,AACD,AAAC,EAAU,AAAiB,AAAiB,FAC5C,AAAc;GAEd,GAAY,LAAwB;;;;;;AR2CrC,EAAI,EAAuB,HAC1B,EAAsB,SAAY;CACzB;CACE;CAAI;CAAd;;EACC,DAAE,EAAK,FAAE,AAAS;;CACZ;;AGw2BF;AACR,GAAqB;AACrB,GAAuB;AACvB,GAAsB;AACtB,GAAwB;AACxB,GAAiB;AACjB,GAAkB;AAClB,GAAkB;AAClB,GAAkB;AAClB,GAAiB;AACjB,GAAoB;AACpB,GAAgB;AAEF,CAAuB,AAAvB,AAAgC,AAAS;AACvD,EAAI,DAAQ,EAAK,CAAK,HAAQ,GAAM,HAAG;CACtC,EAAuB;CACvB,EAAyB;;YCr9BH,XAAa;aACZ;WAGc;kBACR;gBACF;gBD60BG;iBACC;kBACC;kBACA;eACH;0CAG2B;oCACN;6BAEP;4BACD;8BACE;8BACA;8BACA;gCACE;+BACD;gCACC;6BACH;8BAEC;2CACa;gCACX;iCACC;mCACE;oCACC;uCACG;kCACL;oCACE;wCACI;wCACA;uCACD;wCACC;qCACH;oCACD;sCACE;iCACL;qBAEZ;4BACO;sBACN;6BACO;0BACH;iCACO;;;;" } \ No newline at end of file diff --git a/source/Main.hx b/source/Main.hx index 61fd310..13c0e53 100755 --- a/source/Main.hx +++ b/source/Main.hx @@ -18,7 +18,7 @@ import jQuery.*; static public function run_haxe_studio():Void { - version = "0.2 alpha"; + version = "0.2 beta"; session = new Session(); file_stack = new FileObject(); message = new Message();