").append(ea.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},ea.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){ea.fn[b]=function(a){return this.on(b,a)}}),ea.expr.filters.animated=function(a){return ea.grep(ea.timers,function(b){return a===b.elem}).length};var dc=a.document.documentElement;ea.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=ea.css(a,"position"),l=ea(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=ea.css(a,"top"),i=ea.css(a,"left"),j=("absolute"===k||"fixed"===k)&&ea.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),ea.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},ea.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){ea.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,ea.contains(b,e)?(typeof e.getBoundingClientRect!==xa&&(d=e.getBoundingClientRect()),c=V(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===ea.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),ea.nodeName(a[0],"html")||(c=a.offset()),c.top+=ea.css(a[0],"borderTopWidth",!0),c.left+=ea.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-ea.css(d,"marginTop",!0),left:b.left-c.left-ea.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||dc;a&&!ea.nodeName(a,"html")&&"static"===ea.css(a,"position");)a=a.offsetParent;return a||dc})}}),ea.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);ea.fn[a]=function(d){return Da(this,function(a,d,e){var f=V(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?ea(f).scrollLeft():e,c?e:ea(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),ea.each(["top","left"],function(a,b){ea.cssHooks[b]=A(ca.pixelPosition,function(a,c){return c?(c=bb(a,b),db.test(c)?ea(a).position()[b]+"px":c):void 0})}),ea.each({Height:"height",Width:"width"},function(a,b){ea.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){ea.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return Da(this,function(b,c,d){var e;return ea.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?ea.css(b,c,g):ea.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),ea.fn.size=function(){return this.length},ea.fn.andSelf=ea.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return ea});var ec=a.jQuery,fc=a.$;return ea.noConflict=function(b){return a.$===ea&&(a.$=fc),b&&a.jQuery===ea&&(a.jQuery=ec),ea},typeof b===xa&&(a.jQuery=a.$=ea),ea});/*!
* This file creates $ and jQuery variables within the F2 closure scope
*/
var $,jQuery=$=window.jQuery.noConflict(!0);!function(a,b){function c(){this._events={},this._conf&&d.call(this,this._conf)}function d(a){a&&(this._conf=a,a.delimiter&&(this.delimiter=a.delimiter),a.maxListeners&&(this._events.maxListeners=a.maxListeners),a.wildcard&&(this.wildcard=a.wildcard),a.newListener&&(this.newListener=a.newListener),this.wildcard&&(this.listenerTree={}))}function e(a){this._events={},this.newListener=!1,d.call(this,a)}function f(a,b,c,d){if(!c)return[];var e,g,h,i,j,k,l,m=[],n=b.length,o=b[d],p=b[d+1];if(d===n&&c._listeners){if("function"==typeof c._listeners)return a&&a.push(c._listeners),[c];for(e=0,g=c._listeners.length;g>e;e++)a&&a.push(c._listeners[e]);return[c]}if("*"===o||"**"===o||c[o]){if("*"===o){for(h in c)"_listeners"!==h&&c.hasOwnProperty(h)&&(m=m.concat(f(a,b,c[h],d+1)));return m}if("**"===o){l=d+1===n||d+2===n&&"*"===p,l&&c._listeners&&(m=m.concat(f(a,b,c,n)));for(h in c)"_listeners"!==h&&c.hasOwnProperty(h)&&("*"===h||"**"===h?(c[h]._listeners&&!l&&(m=m.concat(f(a,b,c[h],n))),m=m.concat(f(a,b,c[h],d))):m=h===p?m.concat(f(a,b,c[h],d+2)):m.concat(f(a,b,c[h],d)));return m}m=m.concat(f(a,b,c[o],d+1))}if(i=c["*"],i&&f(a,b,i,d+1),j=c["**"])if(n>d){j._listeners&&f(a,b,j,n);for(h in j)"_listeners"!==h&&j.hasOwnProperty(h)&&(h===p?f(a,b,j[h],d+2):h===o?f(a,b,j[h],d+1):(k={},k[h]=j[h],f(a,b,{"**":k},d+1)))}else j._listeners?f(a,b,j,n):j["*"]&&j["*"]._listeners&&f(a,b,j["*"],n);return m}function g(a,b){a="string"==typeof a?a.split(this.delimiter):a.slice();for(var c=0,d=a.length;d>c+1;c++)if("**"===a[c]&&"**"===a[c+1])return;for(var e=this.listenerTree,f=a.shift();f;){if(e[f]||(e[f]={}),e=e[f],0===a.length){if(e._listeners){if("function"==typeof e._listeners)e._listeners=[e._listeners,b];else if(h(e._listeners)&&(e._listeners.push(b),!e._listeners.warned)){var g=i;"undefined"!=typeof this._events.maxListeners&&(g=this._events.maxListeners),g>0&&e._listeners.length>g&&(e._listeners.warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",e._listeners.length),console.trace())}}else e._listeners=b;return!0}f=a.shift()}return!0}var h=Array.isArray?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},i=10;e.prototype.delimiter=".",e.prototype.setMaxListeners=function(a){this._events||c.call(this),this._events.maxListeners=a,this._conf||(this._conf={}),this._conf.maxListeners=a},e.prototype.event="",e.prototype.once=function(a,b){return this.many(a,1,b),this},e.prototype.many=function(a,b,c){function d(){0===--b&&e.off(a,d),c.apply(this,arguments)}var e=this;if("function"!=typeof c)throw new Error("many only accepts instances of Function");return d._origin=c,this.on(a,d),e},e.prototype.emit=function(){this._events||c.call(this);var a=arguments[0];if("newListener"===a&&!this.newListener&&!this._events.newListener)return!1;if(this._all){for(var b=arguments.length,d=new Array(b-1),e=1;b>e;e++)d[e-1]=arguments[e];for(e=0,b=this._all.length;b>e;e++)this.event=a,this._all[e].apply(this,d)}if("error"===a&&!(this._all||this._events.error||this.wildcard&&this.listenerTree.error))throw arguments[1]instanceof Error?arguments[1]:new Error("Uncaught, unspecified 'error' event.");var g;if(this.wildcard){g=[];var h="string"==typeof a?a.split(this.delimiter):a.slice();f.call(this,g,h,this.listenerTree,0)}else g=this._events[a];if("function"==typeof g){if(this.event=a,1===arguments.length)g.call(this);else if(arguments.length>1)switch(arguments.length){case 2:g.call(this,arguments[1]);break;case 3:g.call(this,arguments[1],arguments[2]);break;default:for(var b=arguments.length,d=new Array(b-1),e=1;b>e;e++)d[e-1]=arguments[e];g.apply(this,d)}return!0}if(g){for(var b=arguments.length,d=new Array(b-1),e=1;b>e;e++)d[e-1]=arguments[e];for(var i=g.slice(),e=0,b=i.length;b>e;e++)this.event=a,i[e].apply(this,d);return i.length>0||this._all}return this._all},e.prototype.on=function(a,b){if("function"==typeof a)return this.onAny(a),this;if("function"!=typeof b)throw new Error("on only accepts instances of Function");if(this._events||c.call(this),this.emit("newListener",a,b),this.wildcard)return g.call(this,a,b),this;if(this._events[a]){if("function"==typeof this._events[a])this._events[a]=[this._events[a],b];else if(h(this._events[a])&&(this._events[a].push(b),!this._events[a].warned)){var d=i;"undefined"!=typeof this._events.maxListeners&&(d=this._events.maxListeners),d>0&&this._events[a].length>d&&(this._events[a].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[a].length),console.trace())}}else this._events[a]=b;return this},e.prototype.onAny=function(a){if(this._all||(this._all=[]),"function"!=typeof a)throw new Error("onAny only accepts instances of Function");return this._all.push(a),this},e.prototype.addListener=e.prototype.on,e.prototype.off=function(a,b){if("function"!=typeof b)throw new Error("removeListener only takes instances of Function");var c,d=[];if(this.wildcard){var e="string"==typeof a?a.split(this.delimiter):a.slice();d=f.call(this,null,e,this.listenerTree,0)}else{if(!this._events[a])return this;c=this._events[a],d.push({_listeners:c})}for(var g=0;gk;k++)if(c[k]===b||c[k].listener&&c[k].listener===b||c[k]._origin&&c[k]._origin===b){j=k;break}if(0>j)continue;return this.wildcard?i._listeners.splice(j,1):this._events[a].splice(j,1),0===c.length&&(this.wildcard?delete i._listeners:delete this._events[a]),this}(c===b||c.listener&&c.listener===b||c._origin&&c._origin===b)&&(this.wildcard?delete i._listeners:delete this._events[a])}return this},e.prototype.offAny=function(a){var b,c=0,d=0;if(a&&this._all&&this._all.length>0){for(b=this._all,c=0,d=b.length;d>c;c++)if(a===b[c])return b.splice(c,1),this}else this._all=[];return this},e.prototype.removeListener=e.prototype.off,e.prototype.removeAllListeners=function(a){if(0===arguments.length)return!this._events||c.call(this),this;if(this.wildcard)for(var b="string"==typeof a?a.split(this.delimiter):a.slice(),d=f.call(this,null,b,this.listenerTree,0),e=0;e9&&g>0,!0}function k(){if(!S){S=!0;for(var a=0;a'):(c=b.createElement("IFRAME"),c.name=a.props.name),c.id=c.name=a.props.name,delete a.props.name,"string"==typeof a.container&&(a.container=b.getElementById(a.container)),a.container||(u(c.style,{position:"absolute",top:"-2000px",left:"0px"}),a.container=b.body);var d=a.props.src;if(a.props.src="javascript:false",u(c,a.props),c.border=c.frameBorder=0,c.allowTransparency=!0,a.container.appendChild(c),a.onLoad&&E(c,"load",a.onLoad),a.usePost){var e,f=a.container.appendChild(b.createElement("form"));if(f.target=c.name,f.action=d,f.method="POST","object"==typeof a.usePost)for(var g in a.usePost)a.usePost.hasOwnProperty(g)&&(B?e=b.createElement(''):(e=b.createElement("INPUT"),e.name=g),e.value=a.usePost[g],f.appendChild(e));f.submit(),f.parentNode.removeChild(f)}else c.src=d;return a.props.src=d,c}function x(a,b){"string"==typeof a&&(a=[a]);for(var c,d=a.length;d--;)if(c=a[d],c=new RegExp("^"==c.substr(0,1)?c:"^"+c.replace(/(\*)/g,".$1").replace(/\?/g,".")+"$"),c.test(b))return!0;return!1}function y(d){var e,f=d.protocol;if(d.isHost=d.isHost||t(V.xdm_p),Q=d.hash||!1,d.props||(d.props={}),d.isHost)d.remote=r(d.remote),d.channel=d.channel||"default"+H++,d.secret=Math.random().toString(16).substring(2),t(f)&&(f=q(c.href)==q(d.remote)?"4":g(a,"postMessage")||g(b,"postMessage")?"1":d.swf&&g(a,"ActiveXObject")&&j()?"6":"Gecko"===navigator.product&&"frameElement"in a&&-1==navigator.userAgent.indexOf("WebKit")?"5":d.remoteHelper?"2":"0");else if(d.channel=V.xdm_c.replace(/["'<>\\]/g,""),d.secret=V.xdm_s,d.remote=V.xdm_e.replace(/["'<>\\]/g,""),f=V.xdm_p,d.acl&&!x(d.acl,d.remote))throw new Error("Access denied for "+d.remote);switch(d.protocol=f,f){case"0":if(u(d,{interval:100,delay:2e3,useResize:!0,useParent:!1,usePolling:!1},!0),d.isHost){if(!d.local){for(var h,i=c.protocol+"//"+c.host,k=b.body.getElementsByTagName("img"),l=k.length;l--;)if(h=k[l],h.src.substring(0,i.length)===i){d.local=h.src;break}d.local||(d.local=a)}var m={xdm_c:d.channel,xdm_p:0};d.local===a?(d.usePolling=!0,d.useParent=!0,d.local=c.protocol+"//"+c.host+c.pathname+c.search,m.xdm_e=d.local,m.xdm_pa=1):m.xdm_e=r(d.local),d.container&&(d.useResize=!1,m.xdm_po=1),d.remote=s(d.remote,m)}else u(d,{channel:V.xdm_c,remote:V.xdm_e,useParent:!t(V.xdm_pa),usePolling:!t(V.xdm_po),useResize:d.useParent?!1:d.useResize});e=[new N.stack.HashTransport(d),new N.stack.ReliableBehavior({}),new N.stack.QueueBehavior({encode:!0,maxLength:4e3-d.remote.length}),new N.stack.VerifyBehavior({initiate:d.isHost})];break;case"1":e=[new N.stack.PostMessageTransport(d)];break;case"2":d.isHost&&(d.remoteHelper=r(d.remoteHelper)),e=[new N.stack.NameTransport(d),new N.stack.QueueBehavior,new N.stack.VerifyBehavior({initiate:d.isHost})];break;case"3":e=[new N.stack.NixTransport(d)];break;case"4":e=[new N.stack.SameOriginTransport(d)];break;case"5":e=[new N.stack.FrameElementTransport(d)];break;case"6":C||j(),e=[new N.stack.FlashTransport(d)]}return e.push(new N.stack.QueueBehavior({lazy:d.lazy,remove:!0})),e}function z(a){for(var b,c={incoming:function(a,b){this.up.incoming(a,b)},outgoing:function(a,b){this.down.outgoing(a,b)},callback:function(a){this.up.callback(a)},init:function(){this.down.init()},destroy:function(){this.down.destroy()}},d=0,e=a.length;e>d;d++)b=a[d],u(b,c,!0),0!==d&&(b.down=a[d-1]),d!==e-1&&(b.up=a[d+1]);return b}function A(a){a.up.down=a.down,a.down.up=a.up,a.up=a.down=null}var B,C,D,E,F,G=this,H=Math.floor(1e4*Math.random()),I=Function.prototype,J=/^((http.?:)\/\/([^:\/\s]+)(:\d+)*)/,K=/[\-\w]+\/\.\.\//,L=/([^:])\/\//g,M="",N={},O=a.easyXDM,P="easyXDM_",Q=!1;if(g(a,"addEventListener"))E=function(a,b,c){a.addEventListener(b,c,!1)},F=function(a,b,c){a.removeEventListener(b,c,!1)};else{if(!g(a,"attachEvent"))throw new Error("Browser not supported");E=function(a,b,c){a.attachEvent("on"+b,c)},F=function(a,b,c){a.detachEvent("on"+b,c)}}var R,S=!1,T=[];if("readyState"in b?(R=b.readyState,S="complete"==R||~navigator.userAgent.indexOf("AppleWebKit/")&&("loaded"==R||"interactive"==R)):S=!!b.body,!S){if(g(a,"addEventListener"))E(b,"DOMContentLoaded",k);else if(E(b,"readystatechange",function(){"complete"==b.readyState&&k()}),b.documentElement.doScroll&&a===top){var U=function(){if(!S){try{b.documentElement.doScroll("left")}catch(a){return void d(U,1)}k()}};U()}E(a,"load",k)}var V=function(a){a=a.substring(1).split("&");for(var b,c={},d=a.length;d--;)b=a[d].split("="),c[b[0]]=e(b[1]);return c}(/xdm_e=/.test(c.search)?c.search:c.hash),W=function(){var a={},b={a:[1,2,3]},c='{"a":[1,2,3]}';return"undefined"!=typeof JSON&&"function"==typeof JSON.stringify&&JSON.stringify(b).replace(/\s/g,"")===c?JSON:(Object.toJSON&&Object.toJSON(b).replace(/\s/g,"")===c&&(a.stringify=Object.toJSON),"function"==typeof String.prototype.evalJSON&&(b=c.evalJSON(),b.a&&3===b.a.length&&3===b.a[2]&&(a.parse=function(a){return a.evalJSON()})),a.stringify&&a.parse?(W=function(){return a},a):null)};u(N,{version:"2.4.19.3",query:V,stack:{},apply:u,getJSONObject:W,whenReady:l,noConflict:n}),N.DomHelper={on:E,un:F,requiresJSON:function(c){h(a,"JSON")||b.write('')}},function(){var a={};N.Fn={set:function(b,c){a[b]=c},get:function(b,c){if(a.hasOwnProperty(b)){var d=a[b];return c&&delete a[b],d}}}}(),N.Socket=function(a){var b=z(y(a).concat([{incoming:function(b,c){a.onMessage(b,c)},callback:function(b){a.onReady&&a.onReady(b)}}])),c=q(a.remote);this.origin=q(a.remote),this.destroy=function(){b.destroy()},this.postMessage=function(a){b.outgoing(a,c)},b.init()},N.Rpc=function(a,b){if(b.local)for(var c in b.local)if(b.local.hasOwnProperty(c)){var d=b.local[c];"function"==typeof d&&(b.local[c]={method:d})}var e=z(y(a).concat([new N.stack.RpcBehavior(this,b),{callback:function(b){a.onReady&&a.onReady(b)}}]));this.origin=q(a.remote),this.destroy=function(){e.destroy()},e.init()},N.stack.SameOriginTransport=function(a){var b,e,f,g;return b={outgoing:function(a,b,c){f(a),c&&c()},destroy:function(){e&&(e.parentNode.removeChild(e),e=null)},onDOMReady:function(){g=q(a.remote),a.isHost?(u(a.props,{src:s(a.remote,{xdm_e:c.protocol+"//"+c.host+c.pathname,xdm_c:a.channel,xdm_p:4}),name:P+a.channel+"_provider"}),e=w(a),N.Fn.set(a.channel,function(a){return f=a,d(function(){b.up.callback(!0)},0),function(a){b.up.incoming(a,g)}})):(f=m().Fn.get(a.channel,!0)(function(a){b.up.incoming(a,g)}),d(function(){b.up.callback(!0)},0))},init:function(){l(b.onDOMReady,b)}}},N.stack.FlashTransport=function(a){function e(a,b){d(function(){h.up.incoming(a,j)},0)}function g(c){var d=a.swf+"?host="+a.isHost,e="easyXDM_swf_"+Math.floor(1e4*Math.random());N.Fn.set("flash_loaded"+c.replace(/[\-.]/g,"_"),function(){N.stack.FlashTransport[c].swf=k=m.firstChild;for(var a=N.stack.FlashTransport[c].queue,b=0;b"}var h,i,j,k,m;return h={outgoing:function(b,c,d){k.postMessage(a.channel,b.toString()),d&&d()},destroy:function(){try{k.destroyChannel(a.channel)}catch(b){}k=null,i&&(i.parentNode.removeChild(i),i=null)},onDOMReady:function(){j=a.remote,N.Fn.set("flash_"+a.channel+"_init",function(){d(function(){h.up.callback(!0)})}),N.Fn.set("flash_"+a.channel+"_onMessage",e),a.swf=r(a.swf);var b=o(a.swf),f=function(){N.stack.FlashTransport[b].init=!0,k=N.stack.FlashTransport[b].swf,k.createChannel(a.channel,a.secret,q(a.remote),a.isHost),a.isHost&&(D&&a.swfNoThrottle&&u(a.props,{position:"fixed",right:0,top:0,height:"20px",width:"20px"}),u(a.props,{src:s(a.remote,{xdm_e:q(c.href),xdm_c:a.channel,xdm_p:6,xdm_s:a.secret}),name:P+a.channel+"_provider"}),i=w(a))};N.stack.FlashTransport[b]&&N.stack.FlashTransport[b].init?f():N.stack.FlashTransport[b]?N.stack.FlashTransport[b].queue.push(f):(N.stack.FlashTransport[b]={queue:[f]},g(b))},init:function(){l(h.onDOMReady,h)}}},N.stack.PostMessageTransport=function(b){function e(a){if(a.origin)return q(a.origin);if(a.uri)return q(a.uri);if(a.domain)return c.protocol+"//"+a.domain;throw"Unable to retrieve the origin of the event"}function f(a){var c=e(a);c==j&&a.data.substring(0,b.channel.length+1)==b.channel+" "&&g.up.incoming(a.data.substring(b.channel.length+1),c)}var g,h,i,j;return g={outgoing:function(a,c,d){i.postMessage(b.channel+" "+a,c||j),d&&d()},destroy:function(){F(a,"message",f),h&&(i=null,h.parentNode.removeChild(h),h=null)},onDOMReady:function(){if(j=q(b.remote),b.isHost){var e=function(c){c.data==b.channel+"-ready"&&(i="postMessage"in h.contentWindow?h.contentWindow:h.contentWindow.document,F(a,"message",e),E(a,"message",f),d(function(){g.up.callback(!0)},0))};E(a,"message",e),u(b.props,{src:s(b.remote,{xdm_e:q(c.href),xdm_c:b.channel,xdm_p:1}),name:P+b.channel+"_provider"}),h=w(b)}else E(a,"message",f),i="postMessage"in a.parent?a.parent:a.parent.document,i.postMessage(b.channel+"-ready",j),d(function(){g.up.callback(!0)},0)},init:function(){l(g.onDOMReady,g)}}},N.stack.FrameElementTransport=function(e){var f,g,h,i;return f={outgoing:function(a,b,c){h.call(this,a),c&&c()},destroy:function(){g&&(g.parentNode.removeChild(g),g=null)},onDOMReady:function(){i=q(e.remote),e.isHost?(u(e.props,{src:s(e.remote,{xdm_e:q(c.href),xdm_c:e.channel,xdm_p:5}),name:P+e.channel+"_provider"}),g=w(e),g.fn=function(a){return delete g.fn,h=a,d(function(){f.up.callback(!0)},0),function(a){f.up.incoming(a,i)}}):(b.referrer&&q(b.referrer)!=V.xdm_e&&(a.top.location=V.xdm_e),h=a.frameElement.fn(function(a){f.up.incoming(a,i)}),f.up.callback(!0))},init:function(){l(f.onDOMReady,f)}}},N.stack.NameTransport=function(a){function b(b){var c=a.remoteHelper+(h?"#_3":"#_2")+a.channel;i.contentWindow.sendMessage(b,c)}function c(){h?2!==++k&&h||g.up.callback(!0):(b("ready"),g.up.callback(!0))}function e(a){g.up.incoming(a,n)}function f(){m&&d(function(){m(!0)},0)}var g,h,i,j,k,m,n,o;return g={outgoing:function(a,c,d){m=d,b(a)},destroy:function(){i.parentNode.removeChild(i),i=null,h&&(j.parentNode.removeChild(j),j=null)},onDOMReady:function(){h=a.isHost,k=0,n=q(a.remote),a.local=r(a.local),h?(N.Fn.set(a.channel,function(b){h&&"ready"===b&&(N.Fn.set(a.channel,e),c())}),o=s(a.remote,{xdm_e:a.local,xdm_c:a.channel,xdm_p:2}),u(a.props,{src:o+"#"+a.channel,name:P+a.channel+"_provider"}),j=w(a)):(a.remoteHelper=a.remote,N.Fn.set(a.channel,e));var b=function(){var e=i||this;F(e,"load",b),N.Fn.set(a.channel+"_load",f),function g(){"function"==typeof e.contentWindow.sendMessage?c():d(g,50)}()};i=w({props:{src:a.local+"#_4"+a.channel},onLoad:b})},init:function(){l(g.onDOMReady,g)}}},N.stack.HashTransport=function(b){function c(a){if(p){var c=b.remote+"#"+n++ +"_"+a;(i||!r?p.contentWindow:p).location=c}}function e(a){m=a,h.up.incoming(m.substring(m.indexOf("_")+1),s)}function f(){if(o){var a=o.location.href,b="",c=a.indexOf("#");-1!=c&&(b=a.substring(c)),b&&b!=m&&e(b)}}function g(){j=setInterval(f,k)}var h,i,j,k,m,n,o,p,r,s;return h={outgoing:function(a,b){c(a)},destroy:function(){a.clearInterval(j),(i||!r)&&p.parentNode.removeChild(p),p=null},onDOMReady:function(){if(i=b.isHost,k=b.interval,m="#"+b.channel,n=0,r=b.useParent,s=q(b.remote),i){if(u(b.props,{src:b.remote,name:P+b.channel+"_provider"}),r)b.onLoad=function(){o=a,g(),h.up.callback(!0)};else{var c=0,e=b.delay/50;!function f(){if(++c>e)throw new Error("Unable to reference listenerwindow");try{o=p.contentWindow.frames[P+b.channel+"_consumer"]}catch(a){}o?(g(),h.up.callback(!0)):d(f,50)}()}p=w(b)}else o=a,g(),r?(p=parent,h.up.callback(!0)):(u(b,{props:{src:b.remote+"#"+b.channel+new Date,name:P+b.channel+"_consumer"},onLoad:function(){h.up.callback(!0)}}),p=w(b))},init:function(){l(h.onDOMReady,h)}}},N.stack.ReliableBehavior=function(a){var b,c,d=0,e=0,f="";return b={incoming:function(a,g){var h=a.indexOf("_"),i=a.substring(0,h).split(",");a=a.substring(h+1),i[0]==d&&(f="",c&&c(!0)),a.length>0&&(b.down.outgoing(i[1]+","+d+"_"+f,g),e!=i[1]&&(e=i[1],b.up.incoming(a,g)))},outgoing:function(a,g,h){f=a,c=h,b.down.outgoing(e+","+ ++d+"_"+a,g)}}},N.stack.QueueBehavior=function(a){function b(){if(a.remove&&0===h.length)return void A(c);if(!i&&0!==h.length&&!g){i=!0;var e=h.shift();c.down.outgoing(e.data,e.origin,function(a){i=!1,e.callback&&d(function(){e.callback(a)},0),b()})}}var c,g,h=[],i=!0,j="",k=0,l=!1,m=!1;return c={init:function(){t(a)&&(a={}),a.maxLength&&(k=a.maxLength,m=!0),a.lazy?l=!0:c.down.init()},callback:function(a){i=!1;var d=c.up;b(),d.callback(a)},incoming:function(b,d){if(m){var f=b.indexOf("_"),g=parseInt(b.substring(0,f),10);j+=b.substring(f+1),0===g&&(a.encode&&(j=e(j)),c.up.incoming(j,d),j="")}else c.up.incoming(b,d)},outgoing:function(d,e,g){a.encode&&(d=f(d));var i,j=[];if(m){for(;0!==d.length;)i=d.substring(0,k),d=d.substring(i.length),j.push(i);for(;i=j.shift();)h.push({data:j.length+"_"+i,origin:e,callback:0===j.length?g:null})}else h.push({data:d,origin:e,callback:g});l?c.down.init():b()},destroy:function(){g=!0,c.down.destroy()}}},N.stack.VerifyBehavior=function(a){function b(){d=Math.random().toString(16).substring(2),c.down.outgoing(d)}var c,d,e;return c={incoming:function(f,g){var h=f.indexOf("_");-1===h?f===d?c.up.callback(!0):e||(e=f,a.initiate||b(),c.down.outgoing(f)):f.substring(0,h)===e&&c.up.incoming(f.substring(h+1),g)},outgoing:function(a,b,e){c.down.outgoing(d+"_"+a,b,e)},callback:function(c){a.initiate&&b()}}},N.stack.RpcBehavior=function(a,b){function c(a){a.jsonrpc="2.0",f.down.outgoing(g.stringify(a))}function d(a,b){var d=Array.prototype.slice;return function(){var e,f=arguments.length,g={method:b};f>0&&"function"==typeof arguments[f-1]?(f>1&&"function"==typeof arguments[f-2]?(e={success:arguments[f-2],error:arguments[f-1]},g.params=d.call(arguments,0,f-2)):(e={success:arguments[f-1]},g.params=d.call(arguments,0,f-1)),j[""+ ++h]=e,g.id=h):g.params=d.call(arguments,0),a.namedParams&&1===g.params.length&&(g.params=g.params[0]),c(g)}}function e(a,b,d,e){if(!d)return void(b&&c({id:b,error:{code:-32601,message:"Procedure not found."}}));var f,g;b?(f=function(a){f=I,c({id:b,result:a})},g=function(a,d){g=I;var e={id:b,error:{code:-32099,message:a}};d&&(e.error.data=d),c(e)}):f=g=I,i(e)||(e=[e]);try{var h=d.method.apply(d.scope,e.concat([f,g]));t(h)||f(h)}catch(j){g(j.message)}}var f,g=b.serializer||W(),h=0,j={};return f={incoming:function(a,d){var f=g.parse(a);if(f.method)b.handle?b.handle(f,c):e(f.method,f.id,b.local[f.method],f.params);else{var h=j[f.id];f.error?h.error&&h.error(f.error):h.success&&h.success(f.result),delete j[f.id]}},init:function(){if(b.remote)for(var c in b.remote)b.remote.hasOwnProperty(c)&&(a[c]=d(b.remote[c],c));f.down.init()},destroy:function(){for(var c in b.remote)b.remote.hasOwnProperty(c)&&a.hasOwnProperty(c)&&delete a[c];f.down.destroy()}}},G.easyXDM=N}(window,document,location,window.setTimeout,decodeURIComponent,encodeURIComponent);/*!
* F2 v1.4.2 06-20-2016
* Copyright (c) 2014 Markit On Demand, Inc. http://www.openf2.org
*
* "F2" is licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed
* under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
* language governing permissions and limitations under the License.
*
* Please note that F2 ("Software") may contain third party material that Markit
* On Demand Inc. has a license to use and include within the Software (the
* "Third Party Material"). A list of the software comprising the Third Party Material
* and the terms and conditions under which such Third Party Material is distributed
* are reproduced in the ThirdPartyMaterial.md file available at:
*
* https://github.com/OpenF2/F2/blob/master/ThirdPartyMaterial.md
*
* The inclusion of the Third Party Material in the Software does not grant, provide
* nor result in you having acquiring any rights whatsoever, other than as stipulated
* in the terms and conditions related to the specific Third Party Material, if any.
*
*/
var F2;F2=function(){var a=function(a,c){function d(a){var b=[];return a.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(a){"/.."===a?b.pop():b.push(a)}),b.join("").replace(/^\//,"/"===a.charAt(0)?"/":"")}return c=b(c||""),a=b(a||""),c&&a?(c.protocol||a.protocol)+(c.protocol||c.authority?c.authority:a.authority)+d(c.protocol||c.authority||"/"===c.pathname.charAt(0)?c.pathname:c.pathname?(a.authority&&!a.pathname?"/":"")+a.pathname.slice(0,a.pathname.lastIndexOf("/")+1)+c.pathname:a.pathname)+(c.protocol||c.authority||c.pathname?c.search:c.search||a.search)+c.hash:null},b=function(a){var b=String(a).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return b?{href:b[0]||"",protocol:b[1]||"",authority:b[2]||"",host:b[3]||"",hostname:b[4]||"",port:b[5]||"",pathname:b[6]||"",search:b[7]||"",hash:b[8]||""}:null};return{appConfigReplacer:function(a,b){return"root"==a||"ui"==a||"height"==a?void 0:b},Apps:{},extend:function(a,b,c){var d="function"==typeof b,e=a?a.split("."):[],f=this;b=b||{},"F2"===e[0]&&(e=e.slice(1));for(var g=0,h=e.length;h>g;g++)f[e[g]]||(f[e[g]]=d&&g+1==h?b:{}),f=f[e[g]];if(!d)for(var i in b)("undefined"==typeof f[i]||c)&&(f[i]=b[i]);return f},guid:function(){var a=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()},inArray:function(a,b){return jQuery.inArray(a,b)>-1},isLocalRequest:function(b){var c,d,e=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,f=b.toLowerCase(),g=e.exec(f);try{c=location.href}catch(h){c=document.createElement("a"),c.href="",c=c.href}c=c.toLowerCase(),g||(f=a(c,f).toLowerCase(),g=e.exec(f)),d=e.exec(c)||[];var i=!(g&&(g[1]!==d[1]||g[2]!==d[2]||(g[3]||("http:"===g[1]?"80":"443"))!==(d[3]||("http:"===d[1]?"80":"443"))));return i},isNativeDOMNode:function(a){var b="object"==typeof Node?a instanceof Node:a&&"object"==typeof a&&"number"==typeof a.nodeType&&"string"==typeof a.nodeName,c="object"==typeof HTMLElement?a instanceof HTMLElement:a&&"object"==typeof a&&1===a.nodeType&&"string"==typeof a.nodeName;return b||c},log:function(){for(var a,b,c,d="log",e=function(){},f=["assert","clear","count","debug","dir","dirxml","error","exception","group","groupCollapsed","groupEnd","info","log","markTimeline","profile","profileEnd","table","time","timeEnd","timeStamp","trace","warn"],g=f.length,h=window.console=window.console||{};g--;)b=f[g],h[b]||(h[b]=e),arguments&&arguments.length>1&&arguments[0]==b&&(d=b,c=Array.prototype.slice.call(arguments,1));a=Function.prototype.bind?Function.prototype.bind.call(h[d],h):function(){Function.prototype.apply.call(h[d],h,c||arguments)},a.apply(this,c||arguments)},parse:function(a){return JSON.parse(a)},stringify:function(a,b,c){return JSON.stringify(a,b,c)},version:function(){return"1.4.2"}}}(),F2.extend("AppHandlers",function(){var a=F2.guid(),b=F2.guid(),c={appCreateRoot:[],appRenderBefore:[],appDestroyBefore:[],appRenderAfter:[],appDestroyAfter:[],appRender:[],appDestroy:[],appScriptLoadFailed:[]},d={appRender:function(a,b){var c=null;F2.isNativeDOMNode(a.root)?(c=jQuery(a.root),c.append(b)):(a.root=jQuery(b).get(0),c=jQuery(a.root)),jQuery("body").append(c)},appDestroy:function(a){a&&a.app&&a.app.destroy&&"function"==typeof a.app.destroy?a.app.destroy():a&&a.app&&a.app.destroy&&F2.log(a.config.appId+" has a destroy property, but destroy is not of type function and as such will not be executed."),jQuery(a.config.root).fadeOut(500,function(){jQuery(this).remove()})}},e=function(a,b,c,d){f(a);var e={func:c,namespace:b,domNode:F2.isNativeDOMNode(c)?c:null};if(!e.func&&!e.domNode)throw"Invalid or null argument passed. Handler will not be added to collection. A valid dom element or callback function is required.";if(e.domNode&&!d)throw"Invalid argument passed. Handler will not be added to collection. A callback function is required for this event type.";return e},f=function(c){if(a!=c&&b!=c)throw"Invalid token passed. Please verify that you have correctly received and stored token from F2.AppHandlers.getToken()."},g=function(a,b,d){if(f(a),d||b)if(!d&&b)c[b]=[];else if(d&&!b){d=d.toLowerCase();for(var e in c){for(var g=c[e],h=[],i=0,j=g.length;j>i;i++){var k=g[i];k&&(k.namespace&&k.namespace.toLowerCase()==d||h.push(k))}g=h}}else if(d&&c[b]){d=d.toLowerCase();for(var l=[],m=0,n=c[b].length;n>m;m++){var o=c[b][m];o&&(o.namespace&&o.namespace.toLowerCase()==d||l.push(o))}c[b]=l}};return{getToken:function(){return delete this.getToken,a},__f2GetToken:function(){return delete this.__f2GetToken,b},__trigger:function(a,e){if(a!=b)throw"Token passed is invalid. Only F2 is allowed to call F2.AppHandlers.__trigger().";if(!c||!c[e])throw"Invalid EventKey passed. Check your inputs and try again.";for(var f=[],g=2,h=arguments.length;h>g;g++)f.push(arguments[g]);if(0===c[e].length&&d[e])return d[e].apply(F2,f),this;if(0===c[e].length&&!c[e])return this;for(var i=0,j=c[e].length;j>i;i++){var k=c[e][i];if(k.domNode&&arguments[2]&&arguments[2].root&&arguments[3]){var l=jQuery(arguments[2].root).append(arguments[3]);jQuery(k.domNode).append(l)}else k.domNode&&arguments[2]&&!arguments[2].root&&arguments[3]?(arguments[2].root=jQuery(arguments[3]).get(0),jQuery(k.domNode).append(arguments[2].root)):k.func.apply(F2,f)}return this},on:function(a,b,d){var f=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var g=b.split(".");b=g[0],f=g[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return c[b].push(e(a,f,d,"appRender"==b)),this},off:function(a,b){var d=null;if(!b)throw"eventKey must be of type string and not null. For available appHandlers check F2.Constants.AppHandlers.";if(b.indexOf(".")>-1){var e=b.split(".");b=e[0],d=e[1]}if(!c||!c[b])throw"Invalid EventKey passed. Check your inputs and try again.";return g(a,b,d),this}}}()),F2.extend("Constants",{AppHandlers:function(){return{APP_CREATE_ROOT:"appCreateRoot",APP_RENDER_BEFORE:"appRenderBefore",APP_RENDER:"appRender",APP_RENDER_AFTER:"appRenderAfter",APP_DESTROY_BEFORE:"appDestroyBefore",APP_DESTROY:"appDestroy",APP_DESTROY_AFTER:"appDestroyAfter",APP_SCRIPT_LOAD_FAILED:"appScriptLoadFailed"}}()}),F2.extend("",{App:function(a,b,c){return{init:function(){}}},AppConfig:{appId:"",context:{},enableBatchRequests:!1,height:0,instanceId:"",isSecure:!1,containerLocale:null,localeSupport:[],manifestUrl:"",maxWidth:0,minGridSize:4,minWidth:300,name:"",root:void 0,ui:void 0,views:[]},AppManifest:{apps:[],inlineScripts:[],scripts:[],styles:[]},AppContent:{data:{},html:"",status:""},ContainerConfig:{afterAppRender:function(a,b){},appRender:function(a,b){},beforeAppRender:function(a){},debugMode:!1,locale:null,scriptErrorTimeout:7e3,isSecureAppPage:!1,secureAppPagePath:"",supportedViews:[],UI:{Mask:{backgroundColor:"#FFF",loadingIcon:"",opacity:.6,useClasses:!1,zIndex:2}},xhr:{dataType:function(a,b){},type:function(a,b){},url:function(a,b){}},loadScripts:function(a,b,c){},loadStyles:function(a,b){}}}),F2.extend("Constants",{Css:function(){var a="f2-";return{APP:a+"app",APP_CONTAINER:a+"app-container",APP_TITLE:a+"app-title",APP_VIEW:a+"app-view",APP_VIEW_TRIGGER:a+"app-view-trigger",MASK:a+"mask",MASK_CONTAINER:a+"mask-container"}}(),Events:function(){var a="App.",b="Container.";return{APP_SCRIPTS_LOADED:a+"scriptsLoaded",APP_SYMBOL_CHANGE:a+"symbolChange",APP_WIDTH_CHANGE:a+"widthChange.",CONTAINER_SYMBOL_CHANGE:b+"symbolChange",CONTAINER_WIDTH_CHANGE:b+"widthChange",CONTAINER_LOCALE_CHANGE:b+"localeChange",RESOURCE_FAILED_TO_LOAD:b+"resourceFailedToLoad"}}(),JSONP_CALLBACK:"F2_jsonpCallback_",AppStatus:{ERROR:"ERROR",SUCCESS:"SUCCESS"},Sockets:{EVENT:"__event__",LOAD:"__socketLoad__",RPC:"__rpc__",RPC_CALLBACK:"__rpcCallback__",UI_RPC:"__uiRpc__"},Views:{DATA_ATTRIBUTE:"data-f2-view",ABOUT:"about",HELP:"help",HOME:"home",REMOVE:"remove",SETTINGS:"settings"}}),F2.extend("Events",function(){var a=new EventEmitter2({wildcard:!0});return a.setMaxListeners(0),{_socketEmit:function(){return EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},emit:function(){return F2.Rpc.broadcast(F2.Constants.Sockets.EVENT,[].slice.call(arguments)),EventEmitter2.prototype.emit.apply(a,[].slice.call(arguments))},many:function(b,c,d){return a.many(b,c,d)},off:function(b,c){return a.off(b,c)},on:function(b,c){return a.on(b,c)},once:function(b,c){return a.once(b,c)}}}()),F2.extend("Rpc",function(){var a={},b="",c={},d=new RegExp("^"+F2.Constants.Sockets.EVENT),e=new RegExp("^"+F2.Constants.Sockets.RPC),f=new RegExp("^"+F2.Constants.Sockets.RPC_CALLBACK),g=new RegExp("^"+F2.Constants.Sockets.LOAD),h=new RegExp("^"+F2.Constants.Sockets.UI_RPC),i=function(){var a,b=!1,d=[],e=new easyXDM.Socket({onMessage:function(f,h){if(!b&&g.test(f)){f=f.replace(g,"");var i=F2.parse(f);2==i.length&&(a=i[0],c[a.instanceId]={config:a,socket:e},F2.registerApps([a],[i[1]]),jQuery.each(d,function(b,c){l(a,f,h)}),b=!0)}else b?l(a,f,h):d.push(f)}})},j=function(a,c){var d=jQuery(a.root);if(d.is("."+F2.Constants.Css.APP_CONTAINER)||d.find("."+F2.Constants.Css.APP_CONTAINER),!d.length)return void F2.log("Unable to locate app in order to establish secure connection.");var e={scrolling:"no",style:{width:"100%"}};a.height&&(e.style.height=a.height+"px");var f=new easyXDM.Socket({remote:b,container:d.get(0),props:e,onMessage:function(b,c){l(a,b,c)},onReady:function(){f.postMessage(F2.Constants.Sockets.LOAD+F2.stringify([a,c],F2.appConfigReplacer))}});return f},k=function(a,b){return function(){F2.Rpc.call(a,F2.Constants.Sockets.RPC_CALLBACK,b,[].slice.call(arguments).slice(2))}},l=function(b,c,g){function i(a,b){for(var c=String(b).split("."),d=0;d','
','
','
','','
',a,"
","
",'
',b,"
",'","
","
","
"].join("")};return{hideMask:function(a){F2.UI.hideMask(b.instanceId,a)},Modals:function(){var a=function(a){return e("Alert",a)},c=function(a){return e("Confirm",a,!0)};return{alert:function(c,d){return F2.isInit()?void(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.alert",[].slice.call(arguments)):jQuery(a(c)).on("show.bs.modal",function(){var a=this;jQuery(a).find(".btn-primary").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()})}).modal({backdrop:!0})):void F2.log("F2.init() must be called before F2.UI.Modals.alert()")},confirm:function(a,d,e){return F2.isInit()?void(F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Modals.confirm",[].slice.call(arguments)):jQuery(c(a)).on("show.bs.modal",function(){var a=this;jQuery(a).find(".btn-ok").on("click",function(){jQuery(a).modal("hide").remove(),(d||jQuery.noop)()}),jQuery(a).find(".btn-cancel").on("click",function(){jQuery(a).modal("hide").remove(),(e||jQuery.noop)()})}).modal({backdrop:!0})):void F2.log("F2.init() must be called before F2.UI.Modals.confirm()")}}}(),setTitle:function(a){F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"setTitle",[a]):jQuery(b.root).find("."+F2.Constants.Css.APP_TITLE).text(a)},showMask:function(a,c){F2.UI.showMask(b.instanceId,a,c)},updateHeight:d,Views:function(){var a=new EventEmitter2,e=/change/i;a.setMaxListeners(0);var f=function(a){return e.test(a)?!0:(F2.log('"'+a+'" is not a valid F2.UI.Views event name'),!1)};return{change:function(e){"function"==typeof e?this.on("change",e):"string"==typeof e&&(b.isSecure&&!F2.Rpc.isRemote(b.instanceId)?F2.Rpc.call(b.instanceId,F2.Constants.Sockets.UI_RPC,"Views.change",[].slice.call(arguments)):F2.inArray(e,b.views)&&(jQuery("."+F2.Constants.Css.APP_VIEW,c).addClass("hide").filter('[data-f2-view="'+e+'"]',c).removeClass("hide"),d(),a.emit("change",e)))},off:function(b,c){f(b)&&a.off(b,c)},on:function(b,c){f(b)&&a.on(b,c)}}}()}};return b.hideMask=function(a,b){if(!F2.isInit())return void F2.log("F2.init() must be called before F2.UI.hideMask()");if(F2.Rpc.isRemote(a)&&!jQuery(b).is("."+F2.Constants.Css.APP))F2.Rpc.call(a,F2.Constants.Sockets.RPC,"F2.UI.hideMask",[a,jQuery(b).selector]);else{var c=jQuery(b);c.find("> ."+F2.Constants.Css.MASK).remove(),c.removeClass(F2.Constants.Css.MASK_CONTAINER),c.data(F2.Constants.Css.MASK_CONTAINER)&&c.css({position:"static"})}},b.init=function(b){a=b,a.UI=jQuery.extend(!0,{},F2.ContainerConfig.UI,a.UI||{})},b.showMask=function(b,c,d){if(!F2.isInit())return void F2.log("F2.init() must be called before F2.UI.showMask()");if(F2.Rpc.isRemote(b)&&jQuery(c).is("."+F2.Constants.Css.APP))F2.Rpc.call(b,F2.Constants.Sockets.RPC,"F2.UI.showMask",[b,jQuery(c).selector,d]);else{d&&!a.UI.Mask.loadingIcon&&F2.log("Unable to display loading icon. Please set F2.ContainerConfig.UI.Mask.loadingIcon when calling F2.init();");var e=jQuery(c).addClass(F2.Constants.Css.MASK_CONTAINER),f=jQuery("
").height("100%").width("100%").addClass(F2.Constants.Css.MASK);a.UI.Mask.useClasses||f.css({"background-color":a.UI.Mask.backgroundColor,"background-image":a.UI.Mask.loadingIcon?"url("+a.UI.Mask.loadingIcon+")":"","background-position":"50% 50%","background-repeat":"no-repeat",display:"block",left:0,"min-height":30,padding:0,position:"absolute",top:0,"z-index":a.UI.Mask.zIndex,filter:"alpha(opacity="+100*a.UI.Mask.opacity+")",opacity:a.UI.Mask.opacity}),"static"===e.css("position")&&(e.css({position:"relative"}),e.data(F2.Constants.Css.MASK_CONTAINER,!0)),e.append(f)}},b}()),F2.extend("",function(){var _apps={},_config=!1,_bUsesAppHandlers=!1,_sAppHandlerToken=F2.AppHandlers.__f2GetToken(),_loadingScripts={},_afterAppRender=function(a,b){var c=_config.afterAppRender||function(a,b){return jQuery(b).appendTo("body")},d=c(a,b);return _config.afterAppRender&&!d?void F2.log("F2.ContainerConfig.afterAppRender() must return the DOM Element that contains the app"):(jQuery(d).addClass(F2.Constants.Css.APP),d.get(0))},_appRender=function(a,b){return b=_outerHtml(jQuery(b).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId)),_config.appRender&&(b=_config.appRender(a,b)),_outerHtml(b)},_beforeAppRender=function(a){var b=_config.beforeAppRender||jQuery.noop;return b(a)},_appScriptLoadFailed=function(a,b){var c=_config.appScriptLoadFailed||jQuery.noop;return c(a,b)},_createAppConfig=function(a){return a=jQuery.extend(!0,{},a),a.instanceId=a.instanceId||F2.guid(),a.views=a.views||[],F2.inArray(F2.Constants.Views.HOME,a.views)||a.views.push(F2.Constants.Views.HOME),F2.ContainerConfig.locale&&(a.containerLocale=F2.ContainerConfig.locale),a},_getAppConfigFromElement=function(a){var b;if(a){var c=a.getAttribute("data-f2-appid"),d=a.getAttribute("data-f2-manifesturl");if(c&&d){b={appId:c,enableBatchRequests:a.hasAttribute("data-f2-enablebatchrequests"),isSecure:a.hasAttribute("data-f2-issecure"),manifestUrl:d,root:a};var e=a.getAttribute("data-f2-context");if(e)try{b.context=F2.parse(e)}catch(f){console.warn('F2: "data-f2-context" of node is not valid JSON','"'+f+'"')}}}return b},_hasNonTextChildNodes=function(a){var b=!1;if(a.hasChildNodes())for(var c=0,d=a.childNodes.length;d>c;c++)if(1===a.childNodes[c].nodeType){b=!0;break}return b},_hydrateContainerConfig=function(a){a.scriptErrorTimeout||(a.scriptErrorTimeout=F2.ContainerConfig.scriptErrorTimeout),a.debugMode!==!0&&(a.debugMode=F2.ContainerConfig.debugMode),a.locale&&"string"==typeof a.locale&&(F2.ContainerConfig.locale=a.locale)},_initAppEvents=function(a){jQuery(a.root).on("click","."+F2.Constants.Css.APP_VIEW_TRIGGER+"["+F2.Constants.Views.DATA_ATTRIBUTE+"]",function(b){b.preventDefault();var c=jQuery(this).attr(F2.Constants.Views.DATA_ATTRIBUTE).toLowerCase();c==F2.Constants.Views.REMOVE?F2.removeApp(a.instanceId):a.ui.Views.change(c)})},_initContainerEvents=function(){var a,b=function(){F2.Events.emit(F2.Constants.Events.CONTAINER_WIDTH_CHANGE)};jQuery(window).on("resize",function(){clearTimeout(a),a=setTimeout(b,100)}),F2.Events.on(F2.Constants.Events.CONTAINER_LOCALE_CHANGE,function(a){a.locale&&"string"==typeof a.locale&&(F2.ContainerConfig.locale=a.locale)})},_isPlaceholderElement=function(a){return F2.isNativeDOMNode(a)&&!_hasNonTextChildNodes(a)&&!!a.getAttribute("data-f2-appid")&&!!a.getAttribute("data-f2-manifesturl")},_isInit=function(){return!!_config},_createAppInstance=function(a,b){a.ui=new F2.UI(a),void 0!==F2.Apps[a.appId]&&("function"==typeof F2.Apps[a.appId]?setTimeout(function(){_apps[a.instanceId].app=new F2.Apps[a.appId](a,b,a.root),void 0!==_apps[a.instanceId].app.init&&_apps[a.instanceId].app.init()},0):F2.log("app initialization class is defined but not a function. ("+a.appId+")"))},_loadApps=function(appConfigs,appManifest){if(appConfigs=[].concat(appConfigs),1==appConfigs.length&&appConfigs[0].isSecure&&!_config.isSecureAppPage)return void _loadSecureApp(appConfigs[0],appManifest);if(appConfigs.length!=appManifest.apps.length)return void F2.log("The number of apps defined in the AppManifest do not match the number requested.",appManifest);var _findExistingScripts=function(){return jQuery("script[src]").map(function(a,b){return b.src})},_findExistingStyles=function(){return jQuery("link[href]").map(function(a,b){return b.href})},_loadStyles=function(a,b){var c=_findExistingStyles();if(a=jQuery.grep(a,function(a){return a&&-1===jQuery.inArray(a,c)}),_config.loadStyles)return _config.loadStyles(a,b);var d=null,e=!!document.createStyleSheet;jQuery.each(a,function(a,b){e?document.createStyleSheet(b):(d=d||[],d.push(''))}),d&&jQuery("head").append(d.join("")),b()},_loadScripts=function(a,b){var c=_findExistingScripts();if(a=jQuery.grep(a,function(a){return a&&-1===jQuery.inArray(a,c)}),_config.loadScripts)return _config.loadScripts(a,b);if(!a.length)return b();var d=window.document,e=a.length,f=0,g=d&&(d.head||d.getElementsByTagName("head")[0]),h=g&&g.getElementsByTagName("base")[0]||null,i="addEventListener"in window?{}:{loaded:!0,complete:!0},j=function(a){setTimeout(function(){var b={src:a.target.src,appId:appConfigs[0].appId};F2.log("Script defined in '"+b.appId+"' failed to load '"+b.src+"'"),F2.Events.emit(F2.Constants.Events.RESOURCE_FAILED_TO_LOAD,b),_bUsesAppHandlers?F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED,appConfigs[0],b.src):_appScriptLoadFailed(appConfigs[0],b.src)},_config.scriptErrorTimeout)},k=function(){++f===e&&b()},l=function(a,b){var c,d=_loadingScripts[a];if(d){for(var e=0;ei;i++)try{eval(inlines[i])}catch(exception){F2.log("Error loading inline script: "+exception+"\n\n"+inlines[i]),F2.Events.emit("RESOURCE_FAILED_TO_LOAD",{appId:appConfigs[0].appId,src:inlines[i],err:exception}),_bUsesAppHandlers?F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_SCRIPT_LOAD_FAILED,appConfigs[0],exception):_appScriptLoadFailed(appConfigs[0],exception)}cb()}},elementInDocument=function(a){if(a)for(;a.parentNode;)if(a=a.parentNode,a===document)return!0;return!1},_loadHtml=function(a){jQuery.each(a,function(a,b){if(_isPlaceholderElement(appConfigs[a].root))jQuery(appConfigs[a].root).addClass(F2.Constants.Css.APP).append(jQuery(b.html).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[a].appId));else if(_bUsesAppHandlers){F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,appConfigs[a],_outerHtml(jQuery(b.html).addClass(F2.Constants.Css.APP_CONTAINER+" "+appConfigs[a].appId)));var c=appConfigs[a].appId,d=appConfigs[a].root;if(!d)throw"Root for "+c+" must be a native DOM element and cannot be null or undefined. Check your AppHandler callbacks to ensure you have set App root to a native DOM element.";if(!elementInDocument(d))throw"App root for "+c+" was not appended to the DOM. Check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,appConfigs[a]),!F2.isNativeDOMNode(d))throw"App root for "+c+" must be a native DOM element. Check your AppHandler callbacks to ensure you have set app root to a native DOM element."}else appConfigs[a].root=_afterAppRender(appConfigs[a],_appRender(appConfigs[a],b.html));_initAppEvents(appConfigs[a])})},scripts=appManifest.scripts||[],styles=appManifest.styles||[],inlines=appManifest.inlineScripts||[],apps=appManifest.apps||[];_loadStyles(styles,function(){_loadHtml(apps),_loadScripts(scripts,function(){appConfigs[0]&&F2.Events.emit("APP_SCRIPTS_LOADED",{appId:appConfigs[0].appId,scripts:scripts}),_loadInlineScripts(inlines,function(){jQuery.each(appConfigs,function(a,b){_createAppInstance(b,appManifest.apps[a])})})})})},_loadSecureApp=function(a,b){if(_config.secureAppPagePath){if(_isPlaceholderElement(a.root))jQuery(a.root).addClass(F2.Constants.Css.APP).append(jQuery("").addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId));else if(_bUsesAppHandlers){var c=jQuery(a.root);if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER,a,_outerHtml(jQuery(b.html).addClass(F2.Constants.Css.APP_CONTAINER+" "+a.appId))),0===c.parents("body:first").length)throw"App was never rendered on the page. Please check your AppHandler callbacks to ensure you have rendered the app root to the DOM.";if(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_AFTER,a),!a.root)throw"App Root must be a native dom node and can not be null or undefined. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node.";if(!F2.isNativeDOMNode(a.root))throw"App Root must be a native dom node. Please check your AppHandler callbacks to ensure you have set App Root to a native dom node."}else a.root=_afterAppRender(a,_appRender(a,""));a.ui=new F2.UI(a),_initAppEvents(a),F2.Rpc.register(a,b)}else F2.log('Unable to load secure app: "secureAppPagePath" is not defined in F2.ContainerConfig.')},_outerHtml=function(a){return jQuery("").append(a).html()},_validateApp=function(a){return a.appId?a.root||a.manifestUrl?!0:(F2.log('"manifestUrl" missing from app object'),!1):(F2.log('"appId" missing from app object'),!1)},_validateContainerConfig=function(){if(_config&&_config.xhr){if("function"!=typeof _config.xhr&&"object"!=typeof _config.xhr)throw"ContainerConfig.xhr should be a function or an object";if(_config.xhr.dataType&&"function"!=typeof _config.xhr.dataType)throw"ContainerConfig.xhr.dataType should be a function";if(_config.xhr.type&&"function"!=typeof _config.xhr.type)throw"ContainerConfig.xhr.type should be a function";if(_config.xhr.url&&"function"!=typeof _config.xhr.url)throw"ContainerConfig.xhr.url should be a function"}return!0};return{getContainerState:function(){return _isInit()?jQuery.map(_apps,function(a){return{appId:a.config.appId}}):void F2.log("F2.init() must be called before F2.getContainerState()")},getContainerLocale:function(){return _isInit()?F2.ContainerConfig.locale:void F2.log("F2.init() must be called before F2.getContainerLocale()")},init:function(a){_config=a||{},_validateContainerConfig(),_hydrateContainerConfig(_config),_bUsesAppHandlers=!(_config.beforeAppRender||_config.appRender||_config.afterAppRender||_config.appScriptLoadFailed),(_config.secureAppPagePath||_config.isSecureAppPage)&&F2.Rpc.init(_config.secureAppPagePath?_config.secureAppPagePath:!1),F2.UI.init(_config),_config.isSecureAppPage||_initContainerEvents()},isInit:_isInit,loadPlaceholders:function(a){var b=[],c=[],d=function(a){a&&b.push(a)},e=function(a){if(a)for(var b=0,c=a.length;c>b;b++)d(a[b])};if(a&&!F2.isNativeDOMNode(a))throw'"parentNode" must be null or a DOM node';a&&a.hasAttribute("data-f2-appid")?d(a):(a=a||document,a.querySelectorAll&&e(a.querySelectorAll("[data-f2-appid]")));for(var f=0,g=b.length;g>f;f++){var h=_getAppConfigFromElement(b[f]);c.push(h)}c.length&&F2.registerApps(c)},registerApps:function(a,b){if(!_isInit())return void F2.log("F2.init() must be called before F2.registerApps()");if(!a)return void F2.log("At least one AppConfig must be passed when calling F2.registerApps()");var c=[],d={},e={},f=!1;return a=[].concat(a),b=[].concat(b||[]),f=!!b.length,a.length?a.length&&f&&a.length!=b.length?void F2.log('The length of "apps" does not equal the length of "appManifests"'):(jQuery.each(a,function(a,e){if(e=_createAppConfig(e),e.root=e.root||null,_validateApp(e)){if(_apps[e.instanceId]={config:e},e.root&&!_isPlaceholderElement(e.root)){if(!e.root&&"string"!=typeof e.root&&!F2.isNativeDOMNode(e.root))throw F2.log("AppConfig invalid for pre-load, not a valid string and not dom node"),F2.log("AppConfig instance:",e),"Preloaded appConfig.root property must be a native dom node or a string representing a sizzle selector. Please check your inputs and try again.";if(1!=jQuery(e.root).length)throw F2.log("AppConfig invalid for pre-load, root not unique"),F2.log("AppConfig instance:",e),F2.log("Number of dom node instances:",jQuery(e.root).length),"Preloaded appConfig.root property must map to a unique dom node. Please check your inputs and try again.";return _createAppInstance(e,{preloaded:!0,status:F2.Constants.AppStatus.SUCCESS}),void _initAppEvents(e)}_isPlaceholderElement(e.root)||(_bUsesAppHandlers?(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_CREATE_ROOT,e),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_RENDER_BEFORE,e)):e.root=_beforeAppRender(e)),f?_loadApps(e,b[a]):e.enableBatchRequests&&!e.isSecure?(d[e.manifestUrl.toLowerCase()]=d[e.manifestUrl.toLowerCase()]||[],d[e.manifestUrl.toLowerCase()].push(e)):c.push({apps:[e],url:e.manifestUrl})}}),void(f||(jQuery.each(d,function(a,b){c.push({url:a,apps:b})}),jQuery.each(c,function(a,b){var c=F2.Constants.JSONP_CALLBACK+b.apps[0].appId;e[c]=e[c]||[],e[c].push(b)}),jQuery.each(e,function(a,b){var c=function(d,e){if(e){var f=e.url,g="GET",h="jsonp",i=function(){c(a,b.pop())},j=function(){jQuery.each(e.apps,function(a,b){b.name=b.name||b.appId,F2.log("Removed failed "+b.name+" app",b),F2.removeApp(b.instanceId)})},k=function(a){_loadApps(e.apps,a)};if(_config.xhr&&_config.xhr.dataType&&(h=_config.xhr.dataType(e.url,e.apps),"string"!=typeof h))throw"ContainerConfig.xhr.dataType should return a string";if(_config.xhr&&_config.xhr.type&&(g=_config.xhr.type(e.url,e.apps),"string"!=typeof g))throw"ContainerConfig.xhr.type should return a string";if(_config.xhr&&_config.xhr.url&&(f=_config.xhr.url(e.url,e.apps),"string"!=typeof f))throw"ContainerConfig.xhr.url should return a string";var l=_config.xhr;"function"!=typeof l&&(l=function(a,b,c,f,i){jQuery.ajax({url:a,type:g,data:{params:F2.stringify(e.apps,F2.appConfigReplacer)},jsonp:!1,jsonpCallback:d,dataType:h,success:c,error:function(a,b,c){F2.log("Failed to load app(s)",c.toString(),e.apps),f()},complete:i})}),l(f,e.apps,k,j,i)}};c(a,b.pop())})))):void F2.log("At least one AppConfig must be passed when calling F2.registerApps()")},removeAllApps:function(){return _isInit()?void jQuery.each(_apps,function(a,b){F2.removeApp(b.config.instanceId)}):void F2.log("F2.init() must be called before F2.removeAllApps()")},removeApp:function(a){return _isInit()?void(_apps[a]&&(F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_BEFORE,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY,_apps[a]),F2.AppHandlers.__trigger(_sAppHandlerToken,F2.Constants.AppHandlers.APP_DESTROY_AFTER,_apps[a]),delete _apps[a])):void F2.log("F2.init() must be called before F2.removeApp()")}}}()),jQuery(function(){var a=[],b=function(b){b&&a.push(b)},c=function(a){if(a)for(var c=0,d=a.length;d>c;c++)b(a[c])};if(b(document.getElementById("f2-autoload")),document.querySelectorAll&&(c(document.querySelectorAll("[data-f2-autoload]")),c(document.querySelectorAll(".f2-autoload"))),a.length){F2.init();for(var d=0,e=a.length;e>d;d++)F2.loadPlaceholders(a[d])}}),exports.F2=F2,"undefined"!=typeof define&&define.amd&&define(function(){return F2})}}("undefined"!=typeof exports?exports:window);