Registry.require(["helper"],function(){var k=Registry.get("helper"),g={mkCompat:function(a,b,c,e){if(b){if(b.options.compat_wrappedjsobject||e)a=g.unWrappedJsObjectify(a);if(b.options.compat_metadata||e)a=g.unMetaDataify(a);if(b.options.compat_foreach||e)a=g.unEachify(a);if(b.options.compat_arrayleft||e)a=g.unArrayOnLeftSideify(a);b.options.compat_forvarin&&(a=g.fixForVarXStatements(a))}c||(a=a.replace(/([\'\"]{1,1})use strict([\'\"]{1,1})/g,"$1use\u00a0strict$2"));return a},findPrototypes:function(a){if(-1!=
a.indexOf(".toSource("))return!0;var b="indexOf lastIndexOf filter forEach every map some slice".split(" "),c;for(c in b)if(-1!=a.indexOf("Array."+b[c]+"("))return!0},fixForVarXStatements:function(a){a=a.replace(/for[ \t.]*\([ \t.]*var/gi,"for (var");a=a.split("for (");for(var b=1;b<a.length;b++){var c=a[b],e=c.indexOf(")");if(-1!=e){var f=c.substr(0,e);if(-1!=f.search(/[ \r\n]*in[ \r\n]/)){var d=f.match(/^[ \r\n]*(?:var[ \r\n\t]*)*(.*?)[ \r\n]* in [ \r\n]*(.*?)$/);null==d||3>d.length||(f=d[1],d=
d[2],!f||!d||e>c.length||c.search(/\)[\n\r\t ]*\{/)!=e||(c="",c+="{     if (!"+d+".hasOwnProperty("+f+")) continue;",a[b]=a[b].replace("{",c)))}}}return a.join("for (")},unArrayOnLeftSideify:function(a){var b=a.split("\n");b.forEach(function(a,e){var f=a.replace(/[\t ]/g,""),d=f.search("]="),m=f.search("]=="),h=f.search("\\[");-1!=h&&""!=f.substr(0,h)&&(d=-1);if(-1!=d&&d!=m){var g="",d=a.search("="),d=a.substr(d+1,a.length-d-1),l="__narf"+e.toString(),g=g+("var "+l+" = "+d+";\n");k.getStringBetweenTags(f,
"[","]=").split(",").forEach(function(a,b){""!=a.trim()&&(g+=a+" = "+l+"["+b+"];\n")});b[e]=g}});return b.join("\n")},unEachify:function(a){a=a.replace(/for each[ \t]*\(/gi,"for each(");a=a.split("for each");for(var b=1;b<a.length;b++){var c=a[b];if("("!=c.substr(0,1))a[b]=" each"+a[b];else{var c=k.getStringBetweenTags(c,"(",")"),e=c.split(" "),f=null,d=null,g=null,h;for(h in e)""!=e[h]&&"var"!=e[h]&&(f?d?g||(g=e[h]):d=e[h]:f=e[h]);f&&g?(e="var __kk in "+g,d="",d+="{\n    if (!"+g+".hasOwnProperty(__kk)) continue;",
d+=" \n    var "+f+" = "+g+"[__kk];",a[b]=a[b].replace(c,e).replace("{",d)):a[b]=" each"+a[b]}}return a.join("for")},unMetaDataify:function(a){for(var b=a,c=b.indexOf("<><![CDATA[");-1!=c;){var e=b.substr(0,c),f=e.lastIndexOf("\n"),d="";-1!=f&&(d=e.substr(f,e.length-f));b=b.substr(c,b.length-c);c=d.indexOf("/*");d=d.indexOf("//");-1==c&&-1==d&&(c=d=k.getStringBetweenTags(b,"<><![CDATA[","]]\x3e</>"),c=c.replace(/\\/g,"\\\\"),c=c.replace(/\"/g,'\\"').replace(/\n/g,'\\n" + \n"'),c=c.replace(/^\n/g,
"").replace(/\n$/g,""),c=c.replace(/\r/g,""),a=a.replace("<><![CDATA["+d+"]]\x3e</>",'(new CDATA("'+c+'"))'));b=b.substr(1,b.length-1);c=b.indexOf("<><![CDATA[")}return a},unWrappedJsObjectify:function(a){a=a.split("\n");for(var b=0;b<a.length;b++){var c=a[b].search(".wrappedJSObject");if(-1!=c){var e=a[b].search("\\/\\/");-1!=e&&e<c||(a[b]=a[b].replace(/\.wrappedJSObject/g,""))}}return a.join("\n")}};Registry.register("compat","5770",function(){return g})});
