(function(context,undefined){function proxy(e,t){if(!t)throw new Error("proxying requires a scope");if(!e)throw new Error("proxying requires a function");return function(){return e.apply(t,arguments)}}function each(e,t){for(var n=0,r=e.length;n<r;n++)t(e[n])}var IS_IE=
eval("/*@cc_on!@*/false"),FILE_STORAGE_TOKEN="INJECT",LSCACHE_SCHEMA_VERSION=1,LSCACHE_SCHEMA_VERSION_STRING="!version",LSCACHE_APP_KEY_STRING="!appCacheKey",AMD_DEFERRED="###DEFERRED###",NAMESPACE="Inject",FILE_SUFFIX_REGEX=/.*?\.(js|txt)(\?.*)?$/,BASIC_FILE_SUFFIX=".js",HOST_PREFIX_REGEX=/^https?:\/\//,HOST_SUFFIX_REGEX=/^(.*?)(\/.*|$)/,RESPONSE_SLICER_REGEX=/^(.+?)[\s]+([\w\W]+?)[\s]+([\w\W]+)$/m,FUNCTION_REGEX=/^[\s\(]*function[^\(]*\(([^)]*)\)/,FUNCTION_NEWLINES_REGEX=/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,FUNCTION_BODY_REGEX=/[\w\W]*?\{([\w\W]*)\}/m,WHITESPACE_REGEX=/\s+/g,REQUIRE_REGEX=/(?:^|[^\w\$_.\(])require\s*\(\s*("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')\s*\)/g,DEFINE_EXTRACTION_REGEX=/(?:^|[\s]+)define[\s]*\([\s]*((?:"|')\S+(?:"|'))?,?[\s]*(?:\[([\w\W]+)\])?/g,BUILTINS={require:!0,exports:!0,module:!0},BUILTINS_REPLACE_REGEX=/[\s]|"|'|(require)|(exports)|(module)/g,GREEDY_REQUIRE_REXEX=/require.*/,JS_COMMENTS_REGEX=/(\/\*([\s\S]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,RELATIVE_PATH_REGEX=/^(\.{1,2}\/).+/,ABSOLUTE_PATH_REGEX=/^([A-Za-z]+:)?\/\//,PROTOCOL_REGEX=/:\/\//,PROTOCOL_STRING="://",PROTOCOL_EXPANDED_REGEX=/__INJECT_PROTOCOL_COLON_SLASH_SLASH__/,PROTOCOL_EXPANDED_STRING="__INJECT_PROTOCOL_COLON_SLASH_SLASH__",HAS_LOCAL_STORAGE=function(){try{return localStorage.setItem("injectLStest","ok"),localStorage.removeItem("injectLStest"),!0}catch(e){return!1}}(),userConfig={moduleRoot:null,fileExpires:300,useSuffix:!0,xd:{relayFile:null,relaySwf:null},debug:{sourceMap:!1,logging:!1}},context=this,userModules={},easyXdm=!1,isHostMethod=function(e,t){var n=typeof e[t];return n=="function"||n=="object"&&!!e[t]||n=="unknown"},getXhr=function(){if(isHostMethod(window,"XMLHttpRequest"))return function(){return new XMLHttpRequest};var e=function(){var t=["Microsoft","Msxml2","Msxml3"],n=t.length;while(n--)try{e=t[n]+".XMLHTTP";var r=new ActiveXObject(e);return e}catch(i){}}();return function(){return new ActiveXObject(e)}}(),debugLog=function(){};(function(){var e=[],t=typeof console!="undefined"&&console.log&&typeof console.log=="function",n=function(e,t){userConfig.debug&&userConfig.debug.logging&&console.log("## "+e+" ##"+"\n"+t)};t&&(debugLog=n)})();var commonJSHeader=["__INJECT_NS__.INTERNAL.execute.__FUNCTION_ID__ = function() {","  with (window) {",'    var module = __INJECT_NS__.INTERNAL.createModule("__MODULE_ID__", "__MODULE_URI__"),','        require = __INJECT_NS__.INTERNAL.createRequire("__MODULE_ID__", "__MODULE_URI__"),','        define = __INJECT_NS__.INTERNAL.createDefine("__MODULE_ID__", "__MODULE_URI__"),',"        __exe = null;","        exports = module.exports;","    __exe = function() {","      __POINTCUT_BEFORE__"].join("\n"),commonJSFooter=["      __POINTCUT_AFTER__","    };","    __INJECT_NS__.INTERNAL.defineExecutingModuleAs(module.id, module.uri);","    __error = window.onerror;","    try {","      __exe.call(module);","    }","    catch (__EXCEPTION__) {","      module.error = __EXCEPTION__;","    }","    __INJECT_NS__.INTERNAL.undefineExecutingModule();","    return module;","  }","};"].join("\n");(function(e){function n(e,t){var n;for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n])}function r(){}var t=!1,i=e.Class;r.noConflict=function(){return e.Class=i,r},r.extend=function(e){function u(){!t&&typeof this.init=="function"&&(this.init.apply(this,arguments),this.init=null)}var i=this.prototype,s=e(i),o;return t=!0,o=u.prototype=new this,t=!1,n(s,o),o.createSuper=function(e){var t=o,n={},r=function(e,t){return function(){return t.apply(e,arguments)}};for(name in t)t.hasOwnProperty(name)&&(n[name]=r(e,t[name]));return n},o.constructor=u,u.__base=i,u.extend=r.extend,u.singleton=r.singleton,u.mixin=function(){var e,t=arguments.length;for(e=0;e<t;e++)n(arguments[e](i),o)},u},r.proxy=function(e,t){var n,r={},i=function(n){return function(){return e[n].apply(t,arguments)}};for(n in e)e.hasOwnProperty(n)&&typeof e[n]=="function"&&(r[n]=i(n));return r},r.decorate=function(e){var t,n=arguments.length,r=e.constructor.__base;for(t=1;t<n;t++)arguments[t].call(e,r)},r.singleton=function(e){var t=this.extend(e),n=arguments;return function(){var e;return{getInstance:function(){var r;return e||(n.length>1?(r=function(){},r.prototype=t.prototype,e=new r,t.prototype.constructor.apply(e,Array.prototype.slice.call(n,1))):e=new t),e}}}()},typeof module!="undefined"?typeof module.setExports=="function"?module.setExports(r):module.exports&&(module.exports=r):e.Class=r})(window);var LOCAL_EASY_XDM=!0;(function(e,t,n,r,i,s){function w(e,t){var n=typeof e[t];return n=="function"||n=="object"&&!!e[t]||n=="unknown"}function E(e,t){return typeof e[t]=="object"&&!!e[t]}function S(e){return Object.prototype.toString.call(e)==="[object Array]"}function x(){try{var e=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");return y=Array.prototype.slice.call(e.GetVariable("$version").match(/(\d+),(\d+),(\d+),(\d+)/),1),b=parseInt(y[0],10)>9&&parseInt(y[1],10)>0,e=null,!0}catch(t){return!1}}function A(){if(C)return;C=!0;for(var e=0;e<k.length;e++)k[e]();k.length=0}function M(e,t){if(C){e.call(t);return}k.push(function(){e.call(t)})}function _(){var e=parent;if(h!=="")for(var t=0,n=h.split(".");t<n.length;t++)e=e[n[t]];return e.easyXDM}function D(t){return e.easyXDM=d,h=t,h&&(v="easyXDM_"+h.replace(".","_")+"_"),p}function P(e){return e.match(f)[3]}function H(e){return e.match(f)[4]||""}function B(e){var t=e.toLowerCase().match(f),n=t[2],r=t[3],i=t[4]||"";if(n=="http:"&&i==":80"||n=="https:"&&i==":443")i="";return n+"//"+r+i}function j(e){e=e.replace(c,"$1/");if(!e.match(/^(http||https):\/\//)){var t=e.substring(0,1)==="/"?"":n.pathname;t.substring(t.length-1)!=="/"&&(t=t.substring(0,t.lastIndexOf("/")+1)),e=n.protocol+"//"+n.host+t+e}while(l.test(e))e=e.replace(l,"");return e}function F(e,t){var n="",r=e.indexOf("#");r!==-1&&(n=e.substring(r),e=e.substring(0,r));var i=[];for(var o in t)t.hasOwnProperty(o)&&i.push(o+"="+s(t[o]));return e+(g?"#":e.indexOf("?")==-1?"?":"&")+i.join("&")+n}function q(e){return typeof e=="undefined"}function U(e,t,n){var r;for(var i in t)t.hasOwnProperty(i)&&(i in e?(r=t[i],typeof r=="object"?U(e[i],r,n):n||(e[i]=t[i])):e[i]=t[i]);return e}function z(){var e=t.body.appendChild(t.createElement("form")),n=e.appendChild(t.createElement("input"));n.name=v+"TEST"+u,m=n!==e.elements[n.name],t.body.removeChild(e)}function W(e){q(m)&&z();var n;m?n=t.createElement('<iframe name="'+e.props.name+'"/>'):(n=t.createElement("IFRAME"),n.name=e.props.name),n.id=n.name=e.props.name,delete e.props.name,e.onLoad&&T(n,"load",e.onLoad),typeof e.container=="string"&&(e.container=t.getElementById(e.container)),e.container||(U(n.style,{position:"absolute",top:"-2000px"}),e.container=t.body);var r=e.props.src;return delete e.props.src,U(n,e.props),n.border=n.frameBorder=0,n.allowTransparency=!0,e.container.appendChild(n),n.src=r,e.props.src=r,n}function X(e,t){typeof e=="string"&&(e=[e]);var n,r=e.length;while(r--){n=e[r],n=new RegExp(n.substr(0,1)=="^"?n:"^"+n.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$");if(n.test(t))return!0}return!1}function V(r){var i=r.protocol,s;r.isHost=r.isHost||q(I.xdm_p),g=r.hash||!1,r.props||(r.props={});if(!r.isHost){r.channel=I.xdm_c,r.secret=I.xdm_s,r.remote=I.xdm_e,i=I.xdm_p;if(r.acl&&!X(r.acl,r.remote))throw new Error("Access denied for "+r.remote)}else r.remote=j(r.remote),r.channel=r.channel||"default"+u++,r.secret=Math.random().toString(16).substring(2),q(i)&&(B(n.href)==B(r.remote)?i="4":w(e,"postMessage")||w(t,"postMessage")?i="1":r.swf&&w(e,"ActiveXObject")&&x()?i="6":navigator.product==="Gecko"&&"frameElement"in e&&navigator.userAgent.indexOf("WebKit")==-1?i="5":r.remoteHelper?(r.remoteHelper=j(r.remoteHelper),i="2"):i="0");r.protocol=i;switch(i){case"0":U(r,{interval:100,delay:2e3,useResize:!0,useParent:!1,usePolling:!1},!0);if(r.isHost){if(!r.local){var o=n.protocol+"//"+n.host,a=t.body.getElementsByTagName("img"),f,l=a.length;while(l--){f=a[l];if(f.src.substring(0,o.length)===o){r.local=f.src;break}}r.local||(r.local=e)}var c={xdm_c:r.channel,xdm_p:0};r.local===e?(r.usePolling=!0,r.useParent=!0,r.local=n.protocol+"//"+n.host+n.pathname+n.search,c.xdm_e=r.local,c.xdm_pa=1):c.xdm_e=j(r.local),r.container&&(r.useResize=!1,c.xdm_po=1),r.remote=F(r.remote,c)}else U(r,{channel:I.xdm_c,remote:I.xdm_e,useParent:!q(I.xdm_pa),usePolling:!q(I.xdm_po),useResize:r.useParent?!1:r.useResize});s=[new p.stack.HashTransport(r),new p.stack.ReliableBehavior({}),new p.stack.QueueBehavior({encode:!0,maxLength:4e3-r.remote.length}),new p.stack.VerifyBehavior({initiate:r.isHost})];break;case"1":s=[new p.stack.PostMessageTransport(r)];break;case"2":s=[new p.stack.NameTransport(r),new p.stack.QueueBehavior,new p.stack.VerifyBehavior({initiate:r.isHost})];break;case"3":s=[new p.stack.NixTransport(r)];break;case"4":s=[new p.stack.SameOriginTransport(r)];break;case"5":s=[new p.stack.FrameElementTransport(r)];break;case"6":y||x(),s=[new p.stack.FlashTransport(r)]}return s.push(new p.stack.QueueBehavior({lazy:r.lazy,remove:!0})),s}function $(e){var t,n={incoming:function(e,t){this.up.incoming(e,t)},outgoing:function(e,t){this.down.outgoing(e,t)},callback:function(e){this.up.callback(e)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}};for(var r=0,i=e.length;r<i;r++)t=e[r],U(t,n,!0),r!==0&&(t.down=e[r-1]),r!==i-1&&(t.up=e[r+1]);return t}function J(e){e.up.down=e.down,e.down.up=e.up,e.up=e.down=null}var o=this,u=Math.floor(Math.random()*1e4),a=Function.prototype,f=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,l=/[\-\w]+\/\.\.\//,c=/([^:])\/\//g,h="",p={},d=e.easyXDM,v="easyXDM_",m,g=!1,y,b,T,N;if(w(e,"addEventListener"))T=function(e,t,n){e.addEventListener(t,n,!1)},N=function(e,t,n){e.removeEventListener(t,n,!1)};else{if(!w(e,"attachEvent"))throw new Error("Browser not supported");T=function(e,t,n){e.attachEvent("on"+t,n)},N=function(e,t,n){e.detachEvent("on"+t,n)}}var C=!1,k=[],L;"readyState"in t?(L=t.readyState,C=L=="complete"||~navigator.userAgent.indexOf("AppleWebKit/")&&(L=="loaded"||L=="interactive")):C=!!t.body;if(!C){if(w(e,"addEventListener"))T(t,"DOMContentLoaded",A);else{T(t,"readystatechange",function(){t.readyState=="complete"&&A()});if(t.documentElement.doScroll&&e===top){var O=function(){if(C)return;try{t.documentElement.doScroll("left")}catch(e){r(O,1);return}A()};O()}}T(e,"load",A)}var I=function(e){e=e.substring(1).split("&");var t={},n,r=e.length;while(r--)n=e[r].split("="),t[n[0]]=i(n[1]);return t}(/xdm_e=/.test(n.search)?n.search:n.hash),R=function(){var e={},t={a:[1,2,3]},n='{"a":[1,2,3]}';return typeof JSON!="undefined"&&typeof JSON.stringify=="function"&&JSON.stringify(t).replace(/\s/g,"")===n?JSON:(Object.toJSON&&Object.toJSON(t).replace(/\s/g,"")===n&&(e.stringify=Object.toJSON),typeof String.prototype.evalJSON=="function"&&(t=n.evalJSON(),t.a&&t.a.length===3&&t.a[2]===3&&(e.parse=function(e){return e.evalJSON()})),e.stringify&&e.parse?(R=function(){return e},e):null)};U(p,{version:"2.4.15.118",query:I,stack:{},apply:U,getJSONObject:R,whenReady:M,noConflict:D}),p.DomHelper={on:T,un:N,requiresJSON:function(n){E(e,"JSON")||t.write('<script type="text/javascript" src="'+n+'"></script>')}},function(){var e={};p.Fn={set:function(t,n){e[t]=n},get:function(t,n){var r=e[t];return n&&delete e[t],r}}}(),p.Socket=function(e){var t=$(V(e).concat([{incoming:function(t,n){e.onMessage(t,n)},callback:function(t){e.onReady&&e.onReady(t)}}])),n=B(e.remote);this.origin=B(e.remote),this.destroy=function(){t.destroy()},this.postMessage=function(e){t.outgoing(e,n)},t.init()},p.Rpc=function(e,t){if(t.local)for(var n in t.local)if(t.local.hasOwnProperty(n)){var r=t.local[n];typeof r=="function"&&(t.local[n]={method:r})}var i=$(V(e).concat([new p.stack.RpcBehavior(this,t),{callback:function(t){e.onReady&&e.onReady(t)}}]));this.origin=B(e.remote),this.destroy=function(){i.destroy()},i.init()},p.stack.SameOriginTransport=function(e){var t,i,s,o;return t={outgoing:function(e,t,n){s(e),n&&n()},destroy:function(){i&&(i.parentNode.removeChild(i),i=null)},onDOMReady:function(){o=B(e.remote),e.isHost?(U(e.props,{src:F(e.remote,{xdm_e:n.protocol+"//"+n.host+n.pathname,xdm_c:e.channel,xdm_p:4}),name:v+e.channel+"_provider"}),i=W(e),p.Fn.set(e.channel,function(e){return s=e,r(function(){t.up.callback(!0)},0),function(e){t.up.incoming(e,o)}})):(s=_().Fn.get(e.channel,!0)(function(e){t.up.incoming(e,o)}),r(function(){t.up.callback(!0)},0))},init:function(){M(t.onDOMReady,t)}}},p.stack.FlashTransport=function(e){function c(e,t){r(function(){i.up.incoming(e,a)},0)}function d(n){var r=e.swf+"?host="+e.isHost,i="easyXDM_swf_"+Math.floor(Math.random()*1e4);p.Fn.set("flash_loaded"+n.replace(/[\-.]/g,"_"),function(){p.stack.FlashTransport[n].swf=f=l.firstChild;var e=p.stack.FlashTransport[n].queue;for(var t=0;t<e.length;t++)e[t]();e.length=0}),e.swfContainer?l=typeof e.swfContainer=="string"?t.getElementById(e.swfContainer):e.swfContainer:(l=t.createElement("div"),U(l.style,b&&e.swfNoThrottle?{height:"20px",width:"20px",position:"fixed",right:0,top:0}:{height:"1px",width:"1px",position:"absolute",overflow:"hidden",right:0,top:0}),t.body.appendChild(l));var s="callback=flash_loaded"+n.replace(/[\-.]/g,"_")+"&proto="+o.location.protocol+"&domain="+P(o.location.href)+"&port="+H(o.location.href)+"&ns="+h;l.innerHTML="<object height='20' width='20' type='application/x-shockwave-flash' id='"+i+"' data='"+r+"'><param name='allowScriptAccess' value='always'></param><param name='wmode' value='transparent'><param name='movie' value='"+r+"'></param><param name='flashvars' value='"+s+"'></param><embed type='application/x-shockwave-flash' FlashVars='"+s+"' allowScriptAccess='always' wmode='transparent' src='"+r+"' height='1' width='1'></embed></object>"}var i,s,u,a,f,l;return i={outgoing:function(t,n,r){f.postMessage(e.channel,t.toString()),r&&r()},destroy:function(){try{f.destroyChannel(e.channel)}catch(t){}f=null,s&&(s.parentNode.removeChild(s),s=null)},onDOMReady:function(){a=e.remote,p.Fn.set("flash_"+e.channel+"_init",function(){r(function(){i.up.callback(!0)})}),p.Fn.set("flash_"+e.channel+"_onMessage",c),e.swf=j(e.swf);var t=P(e.swf),o=function(){p.stack.FlashTransport[t].init=!0,f=p.stack.FlashTransport[t].swf,f.createChannel(e.channel,e.secret,B(e.remote),e.isHost),e.isHost&&(b&&e.swfNoThrottle&&U(e.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"}),U(e.props,{src:F(e.remote,{xdm_e:B(n.href),xdm_c:e.channel,xdm_p:6,xdm_s:e.secret}),name:v+e.channel+"_provider"}),s=W(e))};p.stack.FlashTransport[t]&&p.stack.FlashTransport[t].init?o():p.stack.FlashTransport[t]?p.stack.FlashTransport[t].queue.push(o):(p.stack.FlashTransport[t]={queue:[o]},d(t))},init:function(){M(i.onDOMReady,i)}}},p.stack.PostMessageTransport=function(t){function a(e){if(e.origin)return B(e.origin);if(e.uri)return B(e.uri);if(e.domain)return n.protocol+"//"+e.domain;throw"Unable to retrieve the origin of the event"}function f(e){var n=a(e);n==u&&e.data.substring(0,t.channel.length+1)==t.channel+" "&&i.up.incoming(e.data.substring(t.channel.length+1),n)}var i,s,o,u;return i={outgoing:function(e,n,r){o.postMessage(t.channel+" "+e,n||u),r&&r()},destroy:function(){N(e,"message",f),s&&(o=null,s.parentNode.removeChild(s),s=null)},onDOMReady:function(){u=B(t.remote);if(t.isHost){var a=function(n){n.data==t.channel+"-ready"&&(o="postMessage"in s.contentWindow?s.contentWindow:s.contentWindow.document,N(e,"message",a),T(e,"message",f),r(function(){i.up.callback(!0)},0))};T(e,"message",a),U(t.props,{src:F(t.remote,{xdm_e:B(n.href),xdm_c:t.channel,xdm_p:1}),name:v+t.channel+"_provider"}),s=W(t)}else T(e,"message",f),o="postMessage"in e.parent?e.parent:e.parent.document,o.postMessage(t.channel+"-ready",u),r(function(){i.up.callback(!0)},0)},init:function(){M(i.onDOMReady,i)}}},p.stack.FrameElementTransport=function(i){var s,o,u,a;return s={outgoing:function(e,t,n){u.call(this,e),n&&n()},destroy:function(){o&&(o.parentNode.removeChild(o),o=null)},onDOMReady:function(){a=B(i.remote),i.isHost?(U(i.props,{src:F(i.remote,{xdm_e:B(n.href),xdm_c:i.channel,xdm_p:5}),name:v+i.channel+"_provider"}),o=W(i),o.fn=function(e){return delete o.fn,u=e,r(function(){s.up.callback(!0)},0),function(e){s.up.incoming(e,a)}}):(t.referrer&&B(t.referrer)!=I.xdm_e&&(e.top.location=I.xdm_e),u=e.frameElement.fn(function(e){s.up.incoming(e,a)}),s.up.callback(!0))},init:function(){M(s.onDOMReady,s)}}},p.stack.NameTransport=function(e){function l(t){var r=e.remoteHelper+(n?"#_3":"#_2")+e.channel;i.contentWindow.sendMessage(t,r)}function c(){n?(++o===2||!n)&&t.up.callback(!0):(l("ready"),t.up.callback(!0))}function h(e){t.up.incoming(e,a)}function d(){u&&r(function(){u(!0)},0)}var t,n,i,s,o,u,a,f;return t={outgoing:function(e,t,n){u=n,l(e)},destroy:function(){i.parentNode.removeChild(i),i=null,n&&(s.parentNode.removeChild(s),s=null)},onDOMReady:function(){n=e.isHost,o=0,a=B(e.remote),e.local=j(e.local),n?(p.Fn.set(e.channel,function(t){n&&t==="ready"&&(p.Fn.set(e.channel,h),c())}),f=F(e.remote,{xdm_e:e.local,xdm_c:e.channel,xdm_p:2}),U(e.props,{src:f+"#"+e.channel,name:v+e.channel+"_provider"}),s=W(e)):(e.remoteHelper=e.remote,p.Fn.set(e.channel,h)),i=W({props:{src:e.local+"#_4"+e.channel},onLoad:function t(){var n=i||this;N(n,"load",t),p.Fn.set(e.channel+"_load",d),function s(){typeof n.contentWindow.sendMessage=="function"?c():r(s,50)}()}})},init:function(){M(t.onDOMReady,t)}}},p.stack.HashTransport=function(t){function d(e){if(!c)return;var n=t.remote+"#"+f++ +"_"+e;(s||!h?c.contentWindow:c).location=n}function m(e){a=e,n.up.incoming(a.substring(a.indexOf("_")+1),p)}function g(){if(!l)return;var e=l.location.href,t="",n=e.indexOf("#");n!=-1&&(t=e.substring(n)),t&&t!=a&&m(t)}function y(){o=setInterval(g,u)}var n,i=this,s,o,u,a,f,l,c,h,p;return n={outgoing:function(e,t){d(e)},destroy:function(){e.clearInterval(o),(s||!h)&&c.parentNode.removeChild(c),c=null},onDOMReady:function(){s=t.isHost,u=t.interval,a="#"+t.channel,f=0,h=t.useParent,p=B(t.remote);if(s){t.props={src:t.remote,name:v+t.channel+"_provider"};if(h)t.onLoad=function(){l=e,y(),n.up.callback(!0)};else{var i=0,o=t.delay/50;(function d(){if(++i>o)throw new Error("Unable to reference listenerwindow");try{l=c.contentWindow.frames[v+t.channel+"_consumer"]}catch(e){}l?(y(),n.up.callback(!0)):r(d,50)})()}c=W(t)}else l=e,y(),h?(c=parent,n.up.callback(!0)):(U(t,{props:{src:t.remote+"#"+t.channel+new Date,name:v+t.channel+"_consumer"},onLoad:function(){n.up.callback(!0)}}),c=W(t))},init:function(){M(n.onDOMReady,n)}}},p.stack.ReliableBehavior=function(e){var t,n,r=0,i=0,s="";return t={incoming:function(e,o){var u=e.indexOf("_"),a=e.substring(0,u).split(",");e=e.substring(u+1),a[0]==r&&(s="",n&&n(!0)),e.length>0&&(t.down.outgoing(a[1]+","+r+"_"+s,o),i!=a[1]&&(i=a[1],t.up.incoming(e,o)))},outgoing:function(e,o,u){s=e,n=u,t.down.outgoing(i+","+ ++r+"_"+e,o)}}},p.stack.QueueBehavior=function(e){function h(){if(e.remove&&n.length===0){J(t);return}if(o||n.length===0||a)return;o=!0;var i=n.shift();t.down.outgoing(i.data,i.origin,function(e){o=!1,i.callback&&r(function(){i.callback(e)},0),h()})}var t,n=[],o=!0,u="",a,f=0,l=!1,c=!1;return t={init:function(){q(e)&&(e={}),e.maxLength&&(f=e.maxLength,c=!0),e.lazy?l=!0:t.down.init()},callback:function(e){o=!1;var n=t.up;h(),n.callback(e)},incoming:function(n,r){if(c){var s=n.indexOf("_"),o=parseInt(n.substring(0,s),10);u+=n.substring(s+1),o===0&&(e.encode&&(u=i(u)),t.up.incoming(u,r),u="")}else t.up.incoming(n,r)},outgoing:function(r,i,o){e.encode&&(r=s(r));var u=[],a;if(c){while(r.length!==0)a=r.substring(0,f),r=r.substring(a.length),u.push(a);while(a=u.shift())n.push({data:u.length+"_"+a,origin:i,callback:u.length===0?o:null})}else n.push({data:r,origin:i,callback:o});l?t.down.init():h()},destroy:function(){a=!0,t.down.destroy()}}},p.stack.VerifyBehavior=function(e){function s(){n=Math.random().toString(16).substring(2),t.down.outgoing(n)}var t,n,r,i=!1;return t={incoming:function(i,o){var u=i.indexOf("_");u===-1?i===n?t.up.callback(!0):r||(r=i,e.initiate||s(),t.down.outgoing(i)):i.substring(0,u)===r&&t.up.incoming(i.substring(u+1),o)},outgoing:function(e,r,i){t.down.outgoing(n+"_"+e,r,i)},callback:function(t){e.initiate&&s()}}},p.stack.RpcBehavior=function(e,t){function o(e){e.jsonrpc="2.0",n.down.outgoing(r.stringify(e))}function u(e,t){var n=Array.prototype.slice;return function(){var r=arguments.length,u,a={method:t};r>0&&typeof arguments[r-1]=="function"?(r>1&&typeof arguments[r-2]=="function"?(u={success:arguments[r-2],error:arguments[r-1]},a.params=n.call(arguments,0,r-2)):(u={success:arguments[r-1]},a.params=n.call(arguments,0,r-1)),s[""+ ++i]=u,a.id=i):a.params=n.call(arguments,0),e.namedParams&&a.params.length===1&&(a.params=a.params[0]),o(a)}}function f(e,t,n,r){if(!n){t&&o({id:t,error:{code:-32601,message:"Procedure not found."}});return}var i,s;t?(i=function(e){i=a,o({id:t,result:e})},s=function(e,n){s=a;var r={id:t,error:{code:-32099,message:e}};n&&(r.error.data=n),o(r)}):i=s=a,S(r)||(r=[r]);try{var u=n.method.apply(n.scope,r.concat([i,s]));q(u)||i(u)}catch(f){s(f.message)}}var n,r=t.serializer||R(),i=0,s={};return n={incoming:function(e,n){var i=r.parse(e);if(i.method)t.handle?t.handle(i,o):f(i.method,i.id,t.local[i.method],i.params);else{var u=s[i.id];i.error?u.error&&u.error(i.error):u.success&&u.success(i.result),delete s[i.id]}},init:function(){if(t.remote)for(var r in t.remote)t.remote.hasOwnProperty(r)&&(e[r]=u(t.remote[r],r));n.down.init()},destroy:function(){for(var r in t.remote)t.remote.hasOwnProperty(r)&&e.hasOwnProperty(r)&&delete e[r];n.down.destroy()}}},o.easyXDM=p})(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent);var lscache=function(){function e(){if(void 0!==o)return o;try{n("__lscachetest__","__lscachetest__"),r("__lscachetest__"),o=!0}catch(e){o=!1}return o}function t(){return void 0===u&&(u=null!=window.JSON),u}function n(e,t){localStorage.removeItem(i+a+e),localStorage.setItem(i+a+e,t)}function r(e){localStorage.removeItem(i+a+e)}var i="lscache-",s=Math.floor(144e9),o,u,a="";return{set:function(o,u,h){if(e()){if("string"!=typeof u){if(!t())return;try{u=JSON.stringify(u)}catch(d){return}}try{n(o,u)}catch(v){if("QUOTA_EXCEEDED_ERR"!==v.name&&"NS_ERROR_DOM_QUOTA_REACHED"!==v.name)return;for(var m=[],g,y=0;y<localStorage.length;y++)if(g=localStorage.key(y),0===g.indexOf(i+a)&&0>g.indexOf("-cacheexpiration")){g=g.substr((i+a).length);var b=localStorage.getItem(i+a+(g+"-cacheexpiration")),b=b?parseInt(b,10):s;m.push({key:g,size:(localStorage.getItem(i+a+g)||"").length,expiration:b})}m.sort(function(e,t){return t.expiration-e.expiration});for(y=(u||"").length;m.length&&0<y;)g=m.pop(),r(g.key),r(g.key+"-cacheexpiration"),y-=g.size;try{n(o,u)}catch(w){return}}h?n(o+"-cacheexpiration",(Math.floor((new Date).getTime()/6e4)+h).toString(10)):r(o+"-cacheexpiration")}},get:function(n){if(!e())return null;var s=n+"-cacheexpiration",o=localStorage.getItem(i+a+s);if(o&&(o=parseInt(o,10),Math.floor((new Date).getTime()/6e4)>=o))return r(n),r(s),null;n=localStorage.getItem(i+a+n);if(!n||!t())return n;try{return JSON.parse(n)}catch(u){return n}},remove:function(t){if(!e())return null;r(t),r(t+"-cacheexpiration")},supported:function(){return e()},flush:function(){if(e())for(var t=localStorage.length-1;0<=t;--t){var n=localStorage.key(t);0===n.indexOf(i+a)&&localStorage.removeItem(n)}},setBucket:function(e){a=e},resetBucket:function(){a=""}}}();(function(){var e;HAS_LOCAL_STORAGE&&lscache&&(lscache.setBucket(FILE_STORAGE_TOKEN),e=lscache.get(LSCACHE_SCHEMA_VERSION_STRING),e&&e>0&&e<LSCACHE_SCHEMA_VERSION&&(lscache.flush(),lscache.set(LSCACHE_SCHEMA_VERSION_STRING,LSCACHE_SCHEMA_VERSION))),LOCAL_EASY_XDM&&context.easyXDM?easyXDM=context.easyXDM.noConflict("Inject"):easyXDM=!1})();var Class=this.Class.noConflict(),Analyzer;(function(){var AsStatic=Class.extend(function(){return{init:function(){},stripBuiltins:function(e){var t=[],n;for(var r=0,i=e.length;r<i;r++)n=e[r],n!=="require"&&n!=="exports"&&n!=="module"&&t.push(n);return t},extractRequires:function(file){var requires=[],requireMatches=null,defines=null,uniques={},dirtyRuntimeRequires=[],dirtyStaticRequires=[],staticRequires=[],inlineAMD={},require=function(e){uniques[e]!==!0&&requires.push(e),uniques[e]=!0};file=file.replace(JS_COMMENTS_REGEX,"");while(match=REQUIRE_REGEX.exec(file))dirtyRuntimeRequires.push(match[0].match(GREEDY_REQUIRE_REXEX)[0]);if(dirtyRuntimeRequires.length>0)try{
eval([dirtyRuntimeRequires.join(";"),"//@ sourceURL=Inject-Analyzer.js"].join("\n"))}catch(err){throw new Error("Invalid require() syntax found in file: "+dirtyRuntimeRequires.join(";"))}return defines=file.match(DEFINE_EXTRACTION_REGEX),defines&&defines.length&&(each(defines,function(e){var t=e.replace(DEFINE_EXTRACTION_REGEX,"$1"),n=e.replace(DEFINE_EXTRACTION_REGEX,"$2");t=t.replace(BUILTINS_REPLACE_REGEX,""),n=n.replace(BUILTINS_REPLACE_REGEX,"").split(","),t&&(inlineAMD[t]=!0);if(n&&n.length)for(var r=0,i=n.length;r<i;r++)n[r]&&dirtyStaticRequires.push(n[r])}),each(dirtyStaticRequires,function(e){uniques[e]!==!0&&inlineAMD[e]!==!0&&requires.push(e),uniques[e]=!0})),requires}}});Analyzer=new AsStatic})();var Communicator;(function(){var e=Class.extend(function(){function i(){t=[],n={}}function s(e,t){return lscache.set(e,t,userConfig.fileExpires)}function o(e){return lscache.get(e)}function u(e){return e=e.replace(HOST_PREFIX_REGEX,"").replace(HOST_SUFFIX_REGEX,"$1"),e}function a(e,t,r,i){r=1*r,debugLog("Communicator ("+t+")","status "+r+". Length: "+(i?i.length:"NaN")),r===200&&s(t,i),each(n[t],function(t){r!==200?(Executor&&Executor.flagModuleAsBroken(e),t(!1)):t(i)}),n[t]=[]}function f(){var n=userConfig.xd.relayFile,i=userConfig.xd.relaySwf||"";n+=n.indexOf("?")>=0?"&":"?",n+="swf="+i,r=new easyXDM.Socket({remote:n,swf:i,onMessage:function(e,t){if(typeof userConfig.moduleRoot=="string"&&u(userConfig.moduleRoot)!==u(t))return;var n=e.split("__INJECT_SPLIT__");a(n[0],n[1],n[2],n[3])},onReady:function(){e=!1,each(t,function(e){e()}),t=[]}})}function l(e,t){r.postMessage(e+"__INJECT_SPLIT__"+t)}function c(e,t){var n=getXhr();n.open("GET",t),n.onreadystatechange=function(){n.readyState===4&&a(e,t,n.status,n.responseText)},n.send(null)}var e=!1,t,n,r;return{init:function(){this.clearCaches()},clearCaches:function(){i()},get:function(i,s,u){n[s]||(n[s]=[]),debugLog("Communicator ("+s+")","requesting");var a=o(s);if(a){debugLog("Communicator ("+s+")","retireved from cache. length: "+a.length),u(a);return}debugLog("Communicator ("+s+")","queued");if(n[s].length){n[s].push(u),debugLog("Communicator ("+s+")","request already in progress");return}n[s].push(u),userConfig.xd.relayFile&&!r&&!e&&(e=!0,window.setTimeout(f));var h=function(){l(i,s)};e?t.push(h):userConfig.xd.relayFile?l(i,s):c(i,s)}}});Communicator=new e})();var Executor;(function(){function createEvalScript(e){var t=document.createElement("script");t.type="text/javascript";try{t.text=e}catch(n){try{t.innerHTML=e}catch(r){return!1}}return t}function cleanupEvalScriptNode(e){context.setTimeout(function(){if(docHead)return docHead.removeChild(e)})}function getLineNumberFromException(e){var t,n;if(typeof e.lineNumber!="undefined"&&e.lineNumber!==null)return e.lineNumber;if(typeof e.line!="undefined"&&e.line!==null)return e.line;if(e.stack)return t=e.stack.split("\n"),n=t[1].split(":"),n[n.length-2]}function executeJavaScriptModule(code,options){var errorObject=null,sourceString=IS_IE?"":"//@ sourceURL="+options.url,result;options={moduleId:options.moduleId||null,functionId:options.functionId||null,preamble:options.preamble||"",preambleLength:options.preamble.split("\n").length+1,epilogue:options.epilogue||"",epilogueLength:options.epilogue.split("\n").length+1,originalCode:options.originalCode||code,url:options.url||null},code=[code,sourceString].join("\n");var tempErrorHandler=function(e,t,n,r){var i=n-options.preambleLength,s=options.originalCode.split("\n").length,o="";switch(r){case"runtime":o="Runtime error in "+options.moduleId+" ("+options.url+") on line "+i+":\n  "+e;break;case"parse":default:i=i>s?s:i,o="Parsing error in "+options.moduleId+" ("+options.url+") on line "+i+":\n  "+e}return errorObject=new Error(o),errorObject.line=i,errorObject.stack=null,!0};context.onerror=tempErrorHandler;var scr=createEvalScript(code);scr&&docHead&&(docHead.appendChild(scr),cleanupEvalScriptNode(scr));if(!errorObject)if(!context.Inject.INTERNAL.execute[options.functionId]||userConfig.debug.sourceMap){var toExec=code.replace(/([\w\W]+?)=([\w\W]*})[\w\W]*?$/,"$1 = ($2)();"),relativeE;toExec=[toExec,sourceString].join("\n");if(!context.Inject.INTERNAL.execute[options.functionId])try{try{
eval("+\n//@ sourceURL=Inject-Executor-line.js")}catch(ee){relativeE=ee}
eval(toExec)}catch(e){e.lineNumber&&relativeE.lineNumber?e.lineNumber=e.lineNumber-relativeE.lineNumber+1:e.lineNumber=getLineNumberFromException(e),tempErrorHandler(e.message,null,e.lineNumber,"parse")}else{try{
eval("+\n//@ sourceURL=Inject-Executor-line.js")}catch(ee){relativeE=ee}
eval(toExec)}context.Inject.INTERNAL.execute[options.functionId]&&(result=context.Inject.INTERNAL.execute[options.functionId],result.error&&(result.error.lineNumber&&relativeE.lineNumber?result.error.lineNumber=result.error.lineNumber-relativeE.lineNumber:result.error.lineNumber=getLineNumberFromException(result.error),tempErrorHandler(result.error.message,null,result.error.lineNumber,"runtime")))}else result=context.Inject.INTERNAL.execute[options.functionId](),result.error&&tempErrorHandler(result.error.message,null,getLineNumberFromException(result.error),"runtime");return errorObject&&(result||(result={}),result.error=errorObject),context.onerror=initOldError,context.Inject.INTERNAL.execute[options.functionId]&&delete context.Inject.INTERNAL.execute[options.functionId],result}var docHead=!1,onErrorOffset=0,testScript='function Inject_Test_Known_Error() {\n  function nil() {}\n  nil("Known Syntax Error Line 3";\n}',initOldError=context.onerror,testScriptNode=createEvalScript(testScript);try{docHead=document.getElementsByTagName("head")[0]}catch(e){docHead=!1}context.onerror=function(e,t,n){return onErrorOffset=3-n,cleanupEvalScriptNode(testScriptNode),!0},docHead&&docHead.appendChild(testScriptNode),context.onerror=initOldError;var AsStatic=Class.extend(function(){var e=0;return{init:function(){this.clearCaches()},clearCaches:function(){this.cache={},this.executed={},this.broken={},this.circular={},this.defined={},this.anonymousAMDStack=[]},defineExecutingModuleAs:function(e,t){return this.anonymousAMDStack.push({id:e,path:t})},undefineExecutingModule:function(){return this.anonymousAMDStack.pop()},getCurrentExecutingAMD:function(){return this.anonymousAMDStack[this.anonymousAMDStack.length-1]},runTree:function(e,t,n){var r=[];e.postOrder(function(e){if(!e.getValue().name)return;var n=e.getValue().name,i=e.getValue().path,s=t[n],o=e.getValue().resolvedId,u=RulesEngine.getPointcuts(i,!0);Executor.createModule(o,i),e.isCircular()||r.push(Executor.runModule(o,s,i,u))}),n(r)},createModule:function(e,t){var n;return this.cache[e]||(n={},n.id=e||null,n.uri=t||null,n.exports={},n.error=null,n.setExports=function(e){for(var t in n.exports){debugLog("cannot setExports when exports have already been set. setExports skipped");return}switch(typeof e){case"object":for(var t in e)n.exports[t]=e[t];break;case"function":default:n.exports=e}},e&&(this.cache[e]=n)),e?this.cache[e]:n},isModuleDefined:function(e){return this.defined[e]},flagModuleAsDefined:function(e){this.defined[e]=!0},flagModuleAsBroken:function(e){this.broken[e]=!0},flagModuleAsCircular:function(e){this.circular[e]=!0},isModuleCircular:function(e){return this.circular[e]},getModule:function(e){if(this.broken[e])throw new Error("module "+e+" failed to load successfully");return this.cache[e]||null},runModule:function(t,n,r,i){debugLog("Executor","executing "+r);if(this.cache[t]&&this.executed[t])return this.cache[t];if(this.cache[t]&&this.defined[t])return this.cache[t];var s="exec"+e++,o=commonJSHeader.replace(/__MODULE_ID__/g,t).replace(/__MODULE_URI__/g,r).replace(/__FUNCTION_ID__/g,s).replace(/__INJECT_NS__/g,NAMESPACE).replace(/__POINTCUT_BEFORE__/g,i.before||""),u=commonJSFooter.replace(/__INJECT_NS__/g,NAMESPACE).replace(/__POINTCUT_AFTER__/g,i.after||""),a=[o,";",n,u].join("\n"),f,l,c,h;l=executeJavaScriptModule(a,{moduleId:t,functionId:s,preamble:o,epilogue:u,originalCode:n,url:r});if(l&&l.error)throw Inject.clearCache(),l.error;return DEFINE_EXTRACTION_REGEX.test(n)||(this.cache[t]=l),this.executed[t]=!0,debugLog("Executor","executed",t,r,l),l}}});Executor=new AsStatic})();var InjectCore;(function(){var e=Class.extend(function(){return{init:function(){},createRequire:function(e,t){var n=new RequireContext(e,t),require=proxy(n.require,n);return require.ensure=proxy(n.ensure,n),require.run=proxy(n.run,n),require.toUrl=function(t){var n=RulesEngine.resolveIdentifier(t,e),r=RulesEngine.resolveUrl(n);return r},require},createDefine:function(e,t){var n=new RequireContext(e,t),define=proxy(n.define,n);return define.amd={},define},setModuleRoot:function(e){userConfig.moduleRoot=e},setCrossDomain:function(e){userConfig.xd.relayFile=e.relayFile||null,userConfig.xd.relaySwf=e.relaySwf||null},setUseSuffix:function(e){userConfig.useSuffix=e},clearCache:function(){HAS_LOCAL_STORAGE&&lscache&&lscache.flush()},setExpires:function(e){userConfig.fileExpires=e||0},setCacheKey:function(e){var t,n=!1;if(!HAS_LOCAL_STORAGE||!lscache)return!1;t=lscache.get(LSCACHE_APP_KEY_STRING);if(!e&&t||t!==null&&t!=e||t===null&&e)lscache.flush(),lscache.set(LSCACHE_APP_KEY_STRING,e)},reset:function(){this.clearCache(),Executor.clearCaches(),Communicator.clearCaches()},enableDebug:function(e,t){userConfig.debug[e]=t||!0}}});InjectCore=new e})();var RequireContext=Class.extend(function(){return{init:function(e,t){this.id=e||null,this.path=t||null},log:function(e){debugLog("RequireContext for "+this.path,e)},getPath:function(){if(!userConfig.moduleRoot)throw new Error("moduleRoot must be defined. Please use Inject.setModuleRoot()");return this.path||userConfig.moduleRoot},getId:function(){return this.id||""},getModule:function(e){return Executor.getModule(e).exports},getAllModules:function(e,require,t){var n=[],r=null;for(var i=0,s=e.length;i<s;i++){r=e[i];switch(r){case"require":n.push(require);break;case"module":n.push(t);break;case"exports":n.push(t.exports);break;default:n.push(this.getModule(r))}}return n},require:function(e,t){var n,r,i;if(typeof e=="string"){this.log("CommonJS require(string) of "+e);if(/^[\d]+$/.test(e))throw new Error("require() must be a string containing a-z, slash(/), dash(-), and dots(.)");i=RulesEngine.resolveIdentifier(e,this.getId()),r=Executor.getModule(i);if(!r)throw new Error("module "+e+" not found");return r.exports}this.log("AMD require(Array) of "+e.join(", "));var s=Analyzer.stripBuiltins(e);this.ensure(s,proxy(function(n){var r=Executor.createModule(),i=this.getAllModules(e,n,r);t.apply(context,i)},this))},ensure:function(e,t){if(Object.prototype.toString.call(e)!=="[object Array]")throw new Error("require.ensure() must take an Array as the first argument");this.log("CommonJS require.ensure(array) of "+e.join(", ")),e=Analyzer.stripBuiltins(e);var n,r,i=e.length,s=this.getPath()?this.getPath():userConfig.moduleRoot;if(!i){t&&t(InjectCore.createRequire(this.getId(),this.getPath()));return}for(var o=0,u=e.length;o<u;o++)n=TreeDownloader.createNode(e[o],s),r=new TreeDownloader(n),r.get(proxy(function(e,n){Executor.runTree(e,n,proxy(function(){--i===0&&t&&t(InjectCore.createRequire(this.getId(),this.getPath()))},this))},this))},run:function(e){this.log("AMD require.run(string) of "+e),this.ensure([e])},define:function(){var e=Array.prototype.slice.call(arguments,0),t=null,n=["require","exports","module"],r={},i=[],s=[],o=null,u=null,a,f={"string array object":["id","dependencies","executionFunctionOrLiteral"],"string object":["id","executionFunctionOrLiteral"],"array object":["dependencies","executionFunctionOrLiteral"],object:["executionFunctionOrLiteral"]},l=[],c;for(var h=0,p=e.length;h<p;h++)Object.prototype.toString.apply(e[h])==="[object Array]"?l.push("array"):typeof e[h]=="object"||typeof e[h]=="function"?l.push("object"):l.push(typeof e[h]);l=l.join(" ");if(!f[l])throw new Error("You did not use an AMD compliant interface. Please check your define() calls");l=f[l];for(var h=0,p=l.length;h<p;h++){c=e[h];switch(l[h]){case"id":t=c;break;case"dependencies":n=c;break;case"executionFunctionOrLiteral":r=c}}this.log("AMD define(...) of "+(t?t:"anonymous"));for(var h=0,p=n.length;h<p;h++){if(BUILTINS[n[h]]){s.push(n[h]);continue}u=RulesEngine.resolveIdentifier(n[h],this.getId()),s.push(u),!Executor.isModuleCircular(u)&&!Executor.isModuleDefined(u)&&i.push(n[h])}t||(t=Executor.getCurrentExecutingAMD().id,this.log("AMD identified anonymous module as "+t));if(Executor.isModuleDefined(t)){this.log("AMD module "+t+" has already ran once");return}Executor.flagModuleAsDefined(t),typeof r=="function"&&n.concat(Analyzer.extractRequires(r.toString())),this.log("AMD define(...) of "+t+" depends on: "+n.join(", ")),this.log("AMD define(...) of "+t+" will retrieve: "+i.join(", ")),i.unshift("require"),this.require(i,proxy(function(require){this.log("AMD define(...) of "+t+" all downloads required");var e=Executor.getModule(t);e||(e=Executor.createModule(t));var n=this.getAllModules(s,require,e),i;if(typeof r=="function")i=r.apply(null,n),i&&e.setExports(i);else for(name in r)e.exports[name]=r[name]},this))}}}),RulesEngine;(function(){function n(){e.sort(function(e,t){return t.weight-e.weight}),t=!1}function r(e){return e.toString().replace(FUNCTION_BODY_REGEX,"$1")}var e=[],t=!1,i=Class.extend(function(){return{init:function(){this.pointcuts={}},resolveIdentifier:function(e,t){return t||(t=""),e.indexOf(".")!==0&&(t=""),t&&(t=t.split("/"),t.pop(),t=t.join("/")),e.indexOf("/")===0?e:(e=this.computeRelativePath(e,t),e.indexOf("/")===0&&(e=e.split("/"),e.shift(),e=e.join("/")),e)},resolveUrl:function(e,t){var n;if(!userConfig.moduleRoot)throw new Error("module root needs to be defined for resolving URLs");t&&!userConfig.baseDir?(t=t.replace(PROTOCOL_REGEX,PROTOCOL_EXPANDED_STRING).split("/"),t[t.length-1]&&t.length!==1&&t.pop(),t=t.join("/").replace(PROTOCOL_EXPANDED_REGEX,PROTOCOL_STRING)):t?t=userConfig.baseDir(t):t=userConfig.moduleRoot;if(ABSOLUTE_PATH_REGEX.test(e))return e;var r=this.applyRules(e);return e=r.resolved,ABSOLUTE_PATH_REGEX.test(e)?(this.pointcuts[n]=r.pointcuts,e):(t=t.replace(PROTOCOL_REGEX,PROTOCOL_EXPANDED_STRING),e=e.replace(PROTOCOL_REGEX,PROTOCOL_EXPANDED_STRING),/\?/.test(t)?n=t+e:n=this.computeRelativePath(e,t),n=n.replace(PROTOCOL_EXPANDED_REGEX,PROTOCOL_STRING),userConfig.useSuffix&&!FILE_SUFFIX_REGEX.test(n)&&(n+=BASIC_FILE_SUFFIX),this.pointcuts[n]=r.pointcuts,n)},computeRelativePath:function(e,t){var n,r=[];if(ABSOLUTE_PATH_REGEX.test(e))return e;n=[].concat(t.split("/"),e.split("/"));for(var i=0,s=n.length;i<s;i++){piece=n[i];if(piece==="."||piece===""&&i>0)continue;if(piece===".."){if(r.length===0)throw new Error("could not traverse higher than highest path");r.pop()}else r.push(piece)}return r=r.join("/"),r},getPointcuts:function(e,t){var n=this.pointcuts[e]||{before:[],after:[]},i={before:[],after:[]},s;if(typeof t=="undefined")return{before:n.before,after:n.after};for(var o=0,u=n.before.length;o<u;o++)s=n.before[o],i.before.push(r(s));for(var o=0,u=n.after.length;o<u;o++)s=n.after[o],i.after.push(r(s));return i.before=i.before.join("\n"),i.after=i.after.join("\n"),i},addRule:function(n,r,i){typeof i=="undefined"&&(typeof r=="undefined"&&(i=n,r=null,n=null),i=r,r=null),r||(r=e.length),typeof i=="string"&&(i={path:i}),t=!0,e.push({matches:i.matches||n,weight:i.weight||r,last:i.last||!1,path:i.path,pcAfter:i.pointcuts&&i.pointcuts.after?i.pointcuts.after:null,pcBefore:i.pointcuts&&i.pointcuts.before?i.pointcuts.before:null})},manifest:function(e){var t,n;for(t in e)n=e[t],n.matches&&(t=n.matches),this.addRule(t,n)},applyRules:function(r){t&&n();var i=r,s,o=[],u=[],a=!1;return each(e,function(e){if(a)return;var t=!1;typeof e.matches=="string"&&e.matches===i?t=!0:typeof e.matches=="object"&&e.matches.test(i)&&(t=!0),t&&(typeof e.path=="string"?i=e.path:typeof e.path=="function"&&(i=e.path(i)),e.pcBefore&&o.push(e.pcBefore),e.pcAfter&&u.push(e.pcAfter),e.last&&(a=!0))}),s={resolved:i||"",pointcuts:{before:o,after:u}},s}}});RulesEngine=new i})();var TreeDownloader=Class.extend(function(){return{init:function(e){this.callsRemaining=0,this.root=e,this.files={}},log:function(){var e=[].slice.call(arguments,0),t=this.root.getValue()?this.root.getValue().name:null;debugLog("TreeDownloader ("+t+")",e.join(" "))},reduceCallsRemaining:function(e,t){this.callsRemaining--,this.log("reduce. outstanding",this.callsRemaining),this.callsRemaining<=0&&e.call(null,t)},increaseCallsRemaining:function(e){this.callsRemaining+=e||1,this.log("increase. outstanding",this.callsRemaining)},getFiles:function(){return this.files},get:function(e){this.log("started download"),this.downloadTree(this.root,proxy(function(t){e(this.root,this.getFiles())},this))},downloadTree:function(e,t){var n=e.getParent()&&e.getParent().getValue()?e.getParent().getValue().path:userConfig.moduleRoot,r=e.getParent()&&e.getParent().getValue()?e.getParent().getValue().name:"",i=RulesEngine.resolveIdentifier(e.getValue().name,r);e.getValue().path=RulesEngine.resolveUrl(i),e.getValue().resolvedId=i,e.getParent()||this.increaseCallsRemaining();if(Executor.isModuleDefined(e.getValue().name)){this.log("AMD defined module, no download required",e.getValue().name),this.reduceCallsRemaining(t,e);return}this.log("requesting file",e.getValue().path),Communicator.get(e.getValue().name,e.getValue().path,proxy(function(n){this.log("download complete",e.getValue().path);var r=e,i={},s;i[e.getValue().name]=!0,r=r.getParent();while(r){if(!r.getValue())break;s=r.getValue().name,i[s]&&(this.log("circular reference found",e.getValue().name),e.flagCircular(),Executor.flagModuleAsCircular(e.getValue().name)),i[s]=!0,r=r.getParent()}if(!e.isCircular()&&n){this.files[e.getValue().name]=n;var o=Analyzer.extractRequires(n),u=[],a,f,l;for(var c=0,h=o.length;c<h;c++)f=RulesEngine.resolveIdentifier(o[c],e.getValue().name),!Executor.isModuleDefined(f)&&!Executor.isModuleDefined(o[c])&&u.push(o[c]);this.log("dependencies ("+u.length+"):"+u.join(", ")),u.length&&this.increaseCallsRemaining(u.length);for(var c=0,h=u.length;c<h;c++)f=u[c],l=RulesEngine.resolveUrl(RulesEngine.resolveIdentifier(f,e.getValue().name)),a=TreeDownloader.createNode(f,l),e.addChild(a),this.downloadTree(a,proxy(function(){this.reduceCallsRemaining(t,e)},this))}n===!1&&(e.getValue().failed=!0),this.reduceCallsRemaining(t,e)},this))}}});TreeDownloader.createNode=function(e,t,n){var r=new TreeNode({name:e,path:t,failed:!1});return n&&r.flagCircular(),r};var TreeNode=Class.extend(function(){return{init:function(e){this.value=e,this.children=[],this.left=null,this.right=null,this.parent=null,this.isCircularNode=!1},getValue:function(){return this.value},flagCircular:function(){this.isCircularNode=!0},isCircular:function(){return this.isCircularNode},addChild:function(e){var t;return this.children.length>0&&(t=this.children[this.children.length-1],e.setLeft(t),t.setRight(e)),this.children.push(e),e.setParent(this)},getChildren:function(){return this.children},setLeft:function(e){return this.left=e},getLeft:function(){return this.left},setRight:function(e){return this.right=e},getRight:function(){return this.right},setParent:function(e){return this.parent=e},getParent:function(){return this.parent},postOrder:function(e){var t=this,n=null,r=[],i=0;while(t){if(t.getChildren().length>0&&n!=="up"){n="down",t=t.getChildren()[0];continue}r.push(t.getValue()),e&&e(t);if(t.getRight()){n="right",t=t.getRight();continue}if(t.getParent()){n="up",t=t.getParent();continue}return r}}}}),globalRequire=new RequireContext;context.Inject={INTERNAL:{defineExecutingModuleAs:proxy(Executor.defineExecutingModuleAs,Executor),undefineExecutingModule:proxy(Executor.undefineExecutingModule,Executor),createModule:proxy(Executor.createModule,Executor),setModuleExports:function(){},execute:{},globalRequire:globalRequire,createRequire:proxy(InjectCore.createRequire,InjectCore),createDefine:proxy(InjectCore.createDefine,InjectCore)},easyXDM:easyXDM,reset:proxy(InjectCore.reset,InjectCore),enableDebug:function(){InjectCore.enableDebug.apply(this,arguments)},toUrl:function(){RulesEngine.toUrl.apply(this,arguments)},setModuleRoot:function(){InjectCore.setModuleRoot.apply(this,arguments)},setExpires:function(){InjectCore.setExpires.apply(this,arguments)},setCacheKey:function(){InjectCore.setCacheKey.apply(this,arguments)},setCrossDomain:function(){InjectCore.setCrossDomain.apply(this,arguments)},setUseSuffix:function(e){InjectCore.setUseSuffix(e)},clearCache:proxy(InjectCore.clearCache,InjectCore),manifest:function(){RulesEngine.manifest.apply(RulesEngine,arguments)},addRule:function(){RulesEngine.addRule.apply(RulesEngine,arguments)},require:InjectCore.createRequire(),define:InjectCore.createDefine(),version:"undefined"},context.require=context.Inject.INTERNAL.createRequire(),context.define=context.Inject.INTERNAL.createDefine(),context.Inject.version="0.4.0rc4-4-gb67abc7"})(this)