/*! (c) Blackbaud - JavaScript Namespace v1.1.0 */(function(t){Function.prototype.bind||(Function.prototype.bind=function(e){if("function"!==typeof this)throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable");var d=Array.prototype.slice.call(arguments,1),n=this,h=function(){},l=function(){return n.apply(this instanceof h&&e?this:e,d.concat(Array.prototype.slice.call(arguments)))};h.prototype=this.prototype;l.prototype=new h;return l});(function(e){function d(b,a){for(var c in g)delete g[c];g=b;for(var d in a)g[d]=
a[d];return g}function n(b,a){if("function"===typeof a)return m[b].push(a),g}function h(c){d(a,{defaults:function(a,g){return f.bind(b).call({},a,g)||!1},options:function(a,b){return f.bind(q).call({},a,b)||!1},settings:function(a,b){return f.bind(r).call({},a,b)||!1},on:n,trigger:l});q="object"===typeof c?c:{};l("preload");k=g.jQuery();r=k.extend(!0,{},b,q);l("init");if("object"===typeof e[r.alias]){c=e[r.alias];for(var h in c)g.hasOwnProperty(h)||(g[h]=c[h]);delete e[r.alias];g.log("[BBI.core.Start] An instance of "+
r.alias+" already exists on the page. For now, the namespace will extend itself to the existing reference; however, it may be a good idea to provide a custom alias to the namespace's initializing function. For example: bbi.init({ alias: 'NewBBI' }).",!1)}e[r.alias]=g;g.isDebugMode()&&g.log("Blackbaud JavaScript namespace set to: window."+r.alias,!1);delete g.on;l("complete")}function l(a,b){if("undefined"!==typeof m[a]){var c=m[a],d=c.length,f;for(f=0;f<d;f++)c[f].call({},g);"function"===typeof b&&
b.call({},g)}}function c(){e.bbiGetInstance=function(){return g};e.bbiGetInstance.done=!1;e.bbiOnPreload=function(a){n("preload",a)}}function f(a,b){if("object"===typeof a)for(var g in a)this[g]=a[g];else if("string"===typeof a)if("undefined"!==typeof b)this[a]=b;else return this[a];return this}var k,a,b={alias:"BBI",version:t},g={},q={},p={},r={},m={complete:[],preload:[],init:[]};(function(){a=function(a,b){"undefined"!==typeof b&&"undefined"!==typeof p[a]&&"undefined"!==typeof e.console&&console.log('[BBI.log][Warning] The key, "'+
a+'", already exists and will be overwritten with: ',b);return f.bind(p).call({},a,b)||!1};d(a,{defaults:function(a,g){return f.bind(b).call({},a,g)||!1},init:h,on:n,trigger:l,yield:function(a){"function"===typeof a&&a.call({},this);return g}});c()})()}).call({},window);(function(e,d){function n(c){var f={defaults:function(){return c.defaults},instances:[],getInstance:function(c){return"undefined"===typeof c?"undefined"!==typeof this.instances[0]?this.instances[0]:this.instances:this.instances[c]}};
f.directive=c.directive;d(c.alias,f);return d}function h(c,f){var h=d(c),a=h.directive,b=h.defaults(),g={},h="function"===typeof d.jQuery?d.jQuery():null,q;for(q in b)g[q]=b[q];for(var e in f)g.hasOwnProperty(e)&&(g[e]=f[e]);a.get=function(a){return this[a]};a.merge=function(a){for(var b in a)this.hasOwnProperty(b)&&(this[b]=a[b]);return this};a.set=function(a,b){this[a]=b;return this};a.defaults=function(){return b};a.settings=function(){return g};a=a.call({},a,d,h);d(c).instances.push(a);return a}
function l(c,f,h){if(!1===d.hasOwnProperty(c)||!0===h)d[c]=f;else throw Error('[BBI.extension.MapTo] The key "'+c+'" is already in use ('+d.settings().alias+"."+c+"). Please choose another key, or specify that you wish to override this key by passing boolean [true] as the third attribute for bbi.map(label, function, override).");}d.on("preload",function(){l("map",l);l("extension",n);l("instantiate",h)})}).call({},window,bbiGetInstance());(function(e,d){d.on("preload",function(){d.extension({alias:"jQuery",
defaults:{jQuery:null},directive:function(d,l){var c=d.settings(),f,k,a={namespace:null,window:null},b={check:function(){var g=b.check.settings(),c=b.check.window();!g&&c&&(f=k,a.namespace=f,a.window=k);if("function"!==typeof f)throw Error("[BBI.jQuery.Check] The BBI namespace requires jQuery 1.7.2 (or greater) to operate.");delete this.check},instance:function(b){return"function"===typeof a[b]?a[b]:"function"===typeof f?f:k},set:function(b,c){a[b]=c}};b.check.settings=function(){return"function"===
typeof c.jQuery?(a.namespace=f=c.jQuery,c.debug&&"object"===typeof e.console&&console.log("[BBI.jQuery.Check] BBI using jQuery.noConflict() v."+f.fn.jquery),!0):!1};b.check.window=function(){return"function"===typeof e.jQuery?(a.window=k=e.jQuery,c.debug&&"object"===typeof e.console&&console.log("[BBI.jQuery.Check] Window using jQuery v.",k.fn.jquery),!0):!1};return{setLocation:b.set,check:b.check,jQuery:b.instance}}});var n=d.instantiate("jQuery",d.options());n.check();d.map("jQuery",n.jQuery)})}).call({},
window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"helper",defaults:{},directive:function(d,l,c){d.settings();var f=e.document,k={arrayFromString:function(a,b){"string"!==typeof a&&(a="");"string"!==typeof b&&(b=",");return c.map(a.split(b),c.trim)},clone:function(a){var b;try{b=JSON.parse(JSON.stringify(a))}catch(g){b=a,!0===l.isDebugMode()&&l.log(g.message,!1)}return b},data:function(a){var b=0,g={},d;"object"===typeof a[0]&&(a=a[0]);a=a.attributes;if("object"!==
typeof a)return!1;for(b=a.length;b--;)a[b]&&(d=a[b].name,0===d.indexOf("data-")&&(d=c.camelCase(d.slice(5)),g[d]=a[b].value));return g},doOnFind:function(a,b,g){var d=100;"undefined"!=typeof g&&0<g&&3E4>g&&(d=g/100);var f=0,h=function(){e.setTimeout(function(){if(f++>d)return!1;0<c(a).length?"function"===typeof b&&b():h()},100)};h()},executeFunctionByName:function(a,b,g){(a=k.functionExists(a,g))&&a.apply(this,b)},functionExists:function(a,b){var g,c;"object"!==typeof b&&(b=e);if("string"!==typeof a)return!1;
g=a.split(".");c=g.pop();for(var d=0,f=g.length;d<f;d++)b=b[g[d]];if("object"===typeof b&&"function"===typeof b[c])return b[c];throw Error('[BBI.helper.functionExists] The function "'+c+'" was not found in the context specified.',!1);},getUrlVars:function(a){var b={};e.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(a,c,d){b[c]=d});return b},isMobile:function(){var a=navigator.userAgent,b={android:function(){return-1<a.indexOf("Android")},blackberry:function(){return-1<a.indexOf("BlackBerry")},
ios:function(){return-1<a.indexOf("iPhone")||-1<a.indexOf("iPad")||-1<a.indexOf("iPod")},opera:function(){return-1<a.indexOf("Opera Mini")},windows:function(){return-1<a.indexOf("IEMobile")}};return{Android:b.android,BlackBerry:b.blackberry,iOS:b.ios,Opera:b.opera,Windows:b.windows,any:function(){return b.android()||b.blackberry()||b.ios()||b.opera()||b.windows()}}}(),loadScript:function(a,b){"function"!==typeof b&&(b=function(){});var g=f.createElement("script");g.type="text/"+(a.type||"javascript");
g.src=a.src||a;g.async=!1;g.onreadystatechange=g.onload=function(){var a=g.readyState;b.done||a&&!/loaded|complete/.test(a)||(b.done=!0,b())};(f.body||head).appendChild(g)},objectLength:function(a){var b=0,g;for(g in a)a.hasOwnProperty(g)&&b++;return b},scrollTo:function(a,b,g){"number"!==typeof b&&(b=500);if("string"===typeof a)a=c(a);else if("object"!==typeof a)return!1;c("html, body").animate({scrollTop:a.offset().top},b,function(){"function"===typeof g&&g()})},urlContains:function(a){return-1<
e.location.href.indexOf(a)}};return k}});var n=d.instantiate("helper");d.map("helper",n)})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"debug",defaults:{bbiStylesHref:"//api.blackbaud.com/bbi/v/"+d.settings("version")+"/css/bbi.min.css",debug:!1,guestbookURL:"//api.blackbaud.com/services/bbi-guestbook/",isAdminView:!1,isPageEditor:!1,isPartEditor:!1,bbiLogContainerDisclaimer:"* This message pane is visible only to administrators.",bbiLogContainerId:"bbi-message",
bbiLogPrependSelector:"body",bbiLogContainerTitle:"Customization Alerts:",loadBBIStyles:!0,pageEditorUrlRegex:"edit=|/cms/",adminViewSelector:".bb_menu"},directive:function(d,l,c){var f=d.settings(),k={info:function(){var a="",b=l.settings(),g;for(g in b)a+="["+g+"] "+b[g]+"\n";console.log("[ "+b.alias+" Scope, exposed via: BBI(slug) ]\n",l());console.log("\nExplicit Settings:\n"+a+"\n")},isAdminView:function(){if(!0===f.isAdminView)return!0;f.isAdminView=!!c(f.adminViewSelector).length;return f.isAdminView},
isDebugMode:function(){return f.debug},isPageEditor:function(){if(!0===f.isPageEditor)return!0;f.isPageEditor=!!e.location.href.match(f.pageEditorUrlRegex);return f.isPageEditor},isPartEditor:function(){if("object"!==typeof BLACKBAUD)return!1;if(!0===f.isPartEditor)return!0;f.isPartEditor="object"===typeof BLACKBAUD.api.customPartEditor;return f.isPartEditor},log:function(a,b){console.log("[BBI.debug.log]",a);"boolean"!==typeof b&&(b=!0);if(!1!==b&&!1!==f.isAdminView){var g=c("#"+f.bbiLogContainerId+
" .bbi-message-list"),d="<li>"+a+"</li>";g.length?c(g).append(d):c(f.bbiLogPrependSelector).prepend('<div id="'+f.bbiLogContainerId+'"><h4 class="bbi-message-title">'+f.bbiLogContainerTitle+'</h4><ul class="bbi-message-list">'+d+'</ul><p class="bbi-message-helplet">'+f.bbiLogContainerDisclaimer+"</p></div>")}},preparePage:function(){var a=e.document.getElementsByTagName("body")[0],b=k.isPageEditor()?"isEditor":"isViewer";!0===k.isAdminView()&&(b+=" isAdmin");!0===k.isDebugMode()&&(b+=" isDebug");
a.className+=(""==a.className?"":" ")+b;f.loadBBIStyles&&(e.document.createStyleSheet?e.document.createStyleSheet(f.bbiStylesHref):c("head").append('<link rel="stylesheet" href="'+f.bbiStylesHref+'" />'),!0===k.isDebugMode()&&k.log("BBI stylesheet loaded.",!1))},safeConsole:function(){e.log=function(){log.history=log.history||[];log.history.push(arguments);if(e.console){arguments.callee=arguments.callee.caller;var a=[].slice.call(arguments);"object"===typeof console.log?log.apply.call(console.log,
console,a):console.log.apply(console,a)}};var a;try{console.log(),a=e.console}catch(b){a=e.console={}}(function(a){for(var b,c="assert count debug dir dirxml error exception group groupCollapsed groupEnd info log timeStamp profile profileEnd time timeEnd trace warn".split(" "),d=function(){};b=c.pop();)a[b]=a[b]||d})(a)},signGuestBook:function(a){"string"!==typeof a&&(a="namespace");encodeURIComponent(a)}};k.info.version=l.settings("version");(function(){k.signGuestBook();k.safeConsole();k.isPageEditor();
l.jQuery()(function(){k.isAdminView();k.preparePage()})})();return{info:k.info,isAdminView:k.isAdminView,isDebugMode:k.isDebugMode,isPageEditor:k.isPageEditor,isPartEditor:k.isPartEditor,log:k.log,signGuestBook:k.signGuestBook}}});var n=d.instantiate("debug",d.options());d.map("info",n.info);d.map("isAdminView",n.isAdminView);d.map("isDebugMode",n.isDebugMode);d.map("isPageEditor",n.isPageEditor);d.map("isPartEditor",n.isPartEditor);d.map("log",n.log)})}).call({},window,bbiGetInstance());(function(e,
d){d.on("init",function(){d.extension({alias:"events",defaults:{},directive:function(d,h,l){d.settings();var c,f=!1;c=h("jQuery").getInstance(0).jQuery;f=c("namespace").fn.jquery!==c("window").fn.jquery;return{trigger:function(d,a){f&&c("namespace")(e.document).trigger(d,[h,l]).unbind(d);c("window")(e.document).trigger(d,[h,l]).unbind(d)}}}});d.instantiate("events")})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"storage",defaults:{},directive:function(d,
l,c){var f={},k={clear:function(a){"string"===typeof a?delete f[a]:f={};k.save()},expose:function(){return f},get:function(a){return"undefined"===typeof f[a]||"undefined"===f[a]?null:f[a]},set:function(a,b){f[a]=b;k.save()},objectToString:function(a){return JSON.stringify(a)},stringToObject:function(a){var b;"undefined"===a&&(a="null");if("function"===typeof JSON.parse){!0===l.isDebugMode()&&l.log("[BBI.storage] Parsing storage via JSON.parse.",!1);try{b=JSON.parse(a)}catch(g){b={},l.log("[BBI.Storage] JSON.parse ERROR: ",
g)}}else"function"===typeof c.parseJSON?(!0===l.isDebugMode()&&l.log("[BBI.storage] Parsing storage via $.parseJSON.",!1),b=c.parseJSON(a)):(!0===l.isDebugMode()&&l.log("[BBI.storage] Parsing storage via eval().",!1),b=eval("("+a+")"));return b},load:function(){var a=e.sessionStorage,b;for(b in a)"string"===typeof a[b]&&(f[b]=k.stringToObject(a[b]))},save:function(){var a;if("object"!==typeof e.sessvars){e.sessionStorage.clear();for(var b in f)a=k.objectToString(f[b]),e.sessionStorage.setItem(b,a)}}};
k.load();e.onunload=k.save;return{clear:k.clear,expose:k.expose,get:k.get,set:k.set}}});var n=d.instantiate("storage");d.map("storage",n)})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"bbnc",defaults:{partTitleKeyword:"Customization"},directive:function(d,e,c){var f=d.settings(),k,a=!1,b={attach:function(b,d,f){c(function(){c.proxy(b,f)(d)});!0===a&&k.add_endRequest(function(){c.proxy(b,f)(d)})},getPageRequestManager:function(){var b={};if("object"===
typeof k)return k;try{b=Sys.WebForms.PageRequestManager.getInstance(),a=!0}catch(c){!0===e.isDebugMode()&&e.log(c.message,!1)}return b},showPartTitle:function(){b.attach(function(){var a=c("#BodyId");0===a.find(".js-part-label").length&&a.find('[id*="_tdPartName"]:contains("'+f.partTitleKeyword+'")').each(function(){var a=c(this);c("#"+a.attr("id").replace("tdPartName","pnlPart")).prepend('<div class="js-part-label">'+a.text()+" <em>(click to modify)</em></div>")})})}};k=b.getPageRequestManager();
e("debug").getInstance(0).isPageEditor()&&b.showPartTitle();return{attach:b.attach,usesMicrosoftAjax:function(){return a}}}});var e=d.instantiate("bbnc");d.map("attach",e.attach)})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"luminate",defaults:{},directive:function(d,h,l){d.settings();var c;return{fetchYahoo:function(d){"function"===typeof c?d(c):("undefined"!==typeof e.Y&&"function"===typeof e.Y.use&&e.Y.use("jquery-ui",function(e){e=h("jQuery").getInstance(0);
c=jQuery;e.setLocation("window",c);e.setLocation("luminate",c);d(c)}),d())}}}});d.instantiate("luminate")})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"online-express",defaults:{},directive:function(d,l,c){d.settings();var f=!1,k=!1,a,b,g,q,p=c(e.document),r={init:[],error:[],validate:[],fail:[],submit:[],success:[],beforeUpdate:[],afterUpdate:[]},m={attach:function(a,b,d){c(function(){c.proxy(a,d)(b)});m.on("afterUpdate",function(){c.proxy(a,d)(b)})},
block:function(){g.block({message:"Processing",css:{padding:"10px",border:"none",fontSize:"16px",backgroundColor:"#000",borderRadius:"10px","-webkit-border-radius":"10px","-moz-border-radius":"10px",opacity:.5,color:"#fff"},overlayCSS:{backgroundColor:"#fff",opacity:.5}})},check:function(){f&&k&&p.trigger("olx-ready")},on:function(a,b){if("undefined"===typeof r[a])throw Error('The Online Express event "'+a+'" does not exist.');r[a].push(b)},overrides:function(){var a="";e.BBOXSectionScripts.BBI_NAMESPACE=
e.BBOXSectionScripts.BBI_NAMESPACE||{};e.BBOXSectionScripts.BBI_NAMESPACE.presubmit=function(){var a={block:m.block,unblock:m.unblock},b=!0,c=r.validate;l.isDebugMode()&&l.log("Online Express Form has been submitted. Validations in progress...",!1);for(var d=0,g=c.length;d<g;d++)if(!1===c[d].call(a,a)){b=!1;break}l.isDebugMode()&&l.log("Online Express validated? "+b,!1);return b};if("object"===typeof e.bbox&&"function"===typeof e.bbox.squirtMarkup)e.bboxOverrides=e.bboxOverrides||{},e.bboxOverrides.handleSubmitCallbackOverride=
function(b){a=b;var d=c(b).find(".BBFormErrorItem").length,g={block:m.block,update:m.triggerFormSubmitted};q=function(){m.update(b)};0<d&&r.fail.length?m.trigger("fail",[g,b],g):m.triggerFormSubmitted();e.bbox.squirtMarkup(b,!0)};else m.on("submit",function(){m.triggerFormSubmitted()});b.on("click",function(){var b={};m.trigger("submit");c("#divClientError").is(":visible")&&m.trigger("error",[b,a],b)})},trigger:function(a,b,c){"object"!==typeof c&&(c={});"[object Array]"!==Object.prototype.toString.call(b)&&
(b=[]);if("undefined"!==typeof r[a]){a=r[a];var d=a.length,g;for(g=0;g<d;g++)"function"===typeof a[g]&&a[g].apply(c,b)}},triggerFormSubmitted:function(){p.trigger("olx-form-submitted")},unblock:function(){g.unblock()},update:function(b){var c={block:m.block,update:m.triggerFormSubmitted};e.setTimeout(function(){m.trigger("beforeUpdate",[c,b],c);g.find(".bbi-olx-message").addClass("bbi-off");g.find(".bbi-olx-form").removeClass("bbi-off");"function"===typeof a.fn.unblock&&g.unblock();m.trigger("afterUpdate",
[c,b],c)},50)}};(function(){p.on("bbi-ready",function(){f=!0;m.check()});p.on("olx-ready",function(){m.overrides()});p.off("olx-form-submitted").on("olx-form-submitted",function(){"function"===typeof q&&q();l.helper.doOnFind(".BBFormConfirmation",function(){var a={block:m.block,update:m.triggerFormSubmitted};m.trigger("success",[a],a)})});e.bboxShowFormComplete=function(){var c=l("jQuery").getInstance(0);c.setLocation("olx",e.bb$);a=c.jQuery("olx");g=a("#bbox-root");0===g.length&&(g=a('div[id^="bbox-root-"]'));
b=g.find(".BBFormSubmitbutton");k=!0;m.check()}})();return{attach:m.attach,block:m.block,on:function(a,b){if(k)m.on(a,b);else p.on("olx-ready",function(){m.on(a,b)})},unblock:m.unblock,update:m.triggerFormSubmitted}}});var n=d.instantiate("online-express");d.map("olx",n);!1===d("bbnc").getInstance(0).usesMicrosoftAjax()&&d.map("attach",n.attach,!0)})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"assets-handler",defaults:{scriptLoaderUrl:"//api.blackbaud.com/services/asset-loader/index.php"},
directive:function(d,h,l){function c(a){var b=a.length,c,d=[];if(0<b)for(var f=0;f<b;f++)c=a[f],g.hasOwnProperty(c)?d.push.apply(d,g[c]):d.push(c);return d}function f(a){var b=!0,c;for(c in q)if(!1===q[c].loaded){p&&h.log("Asset not yet loaded: "+c,!1);b=!1;break}b?a():"undefined"===typeof myTimeout101&&function(){var b=0,c=e.setTimeout(function(){b++;f(a);200<b&&(e.clearTimeout(c),p&&h.log("Asset waiting period reached its max. Quitting.",!1))},50)}()}function k(a,c,d,g){0<a.unique.length?(p&&h.log("Attempt to load assets (with dependencies): "+
a.unique.join(","),!1),c=b.scriptLoaderUrl+"?query="+a.unique.join(",")+"&include_css="+c.toString()+"&jquery_location="+d,p&&h.log("Requesting assets via: "+c,!1),h.helper.loadScript(c,function(){p&&h.log("Required assets loaded: "+a.unique.join(", "),!1);for(var b=0,c=a.unique.length;b<c;b++)q[a.unique[b]].loaded=!0;f(g)})):f(g)}function a(a){for(var b,c={unique:[],requested:a},d=0,g=a.length;d<g;d++){b=a[d];!0===p&&h.log("Is the asset '"+b+"' unique?",!1);var f=b,e=!1===q.hasOwnProperty(f);!0===
p&&console.log("[BBI.debug.log] Assets currently loaded: ",q);e||!0===p&&h.log("Asset already loaded, and will be ignored: "+f,!1);e&&(f=b,!0===p&&h.log("Registering unique asset: "+f,!1),q[f]={loaded:!1},c.unique.push(b))}return c}var b=d.settings();h.settings();var g={"accordion-content":["handlebars","handlebars-helpers","accordion-content"],"bb-twitter-feed":["handlebars","moment","bb-twitter-feed"],"bbnc-carousel":["handlebars","handlebars-helpers","simple-carousel","bbnc-carousel"],"bbnc-carousel-2.0.0":["handlebars",
"handlebars-helpers","simple-carousel-2.0.0","bbnc-carousel-2.0.0"],"bbnc-donation":["handlebars","handlebars-helpers","bbnc-donation"],"bbnc-localize-parts":["sessvars","cookie","bbnc-localize-parts"],"bbnc-virtual-tour":"jquery-tools jquery-easing png-fix hover-intent slideset-1.0.0 bbnc-virtual-tour".split(" "),"flickr-gallery":["swipebox","handlebars","flickr-gallery"],"font-resizer":["cookie","font-resizer"],"google-maps":["handlebars","google-maps"],"handlebars-helpers":["handlebars","handlebars-helpers"],
"mega-menu":["handlebars","handlebars-helpers","mega-menu"],"parse-rss":["handlebars","sessvars","moment","xdomainrequest","parse-rss"],"simple-carousel":["handlebars","handlebars-helpers","simple-carousel"],"simple-carousel-2.0.0":["handlebars","handlebars-helpers","simple-carousel-2.0.0"],slideset:["jquery-tools","slideset"],"slideset-1.0.0":["jquery-tools","slideset-1.0.0"],"youtube-gallery":["handlebars","handlebars-helpers","youtube-gallery"]},q=[];h("events").getInstance();var p=h.isDebugMode();
return{require:function(b,d,g,f){var e=[];p&&h.log("Requesting assets: "+b.join(", "),!1);if("[object Array]"!==Object.prototype.toString.call(b))throw Error("Invalid types passed to BBI.require(). This method accepts two arguments: an Array and a Function.");"boolean"!==typeof g&&(g=!0);"string"!==typeof f&&(f="window");b=c(b);e=a(b);h("debug").getInstance(0).signGuestBook("require|"+b.join(","));k(e,g,f,function(){p&&h.log("Required assets loaded, firing callback.",!1);if("function"==typeof d){var a=
h.jQuery(f);"function"===typeof a?d(a):h("luminate").getInstance(0).fetchYahoo(function(a){d(a)})}})}}}});d.map("require",d.instantiate("assets-handler").require)})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"app",defaults:{alias:"MyApp",assignment_numbers:"",author:"First Last",client:"",created:"mm/dd/yyyy",requires:{assets:[],loadCSS:!0},changelog:[]},directive:function(d,h,l){var c=this,f=h("applications-handler").getInstance(),k=h("events").getInstance();
c.settings=d.settings();c.actions={};c.alias="";c.scope={};c.status={loaded:!1,ready:!1};var a={action:function(b,d){if(c.actions.hasOwnProperty(b))throw Error('The name you provided for the action "'+b+'" already exists in the app "'+c.settings.alias+'". Action names must be unique.');if("function"===typeof b)c.actions.push(b);else if("string"===typeof b&&"function"===typeof d)c.actions[b]=d;else throw Error("The name and function you provided for .action() were incorrect types.");return{action:a.action,
build:a.build}},addScopeHelpers:function(){c.scope.__get=function(a){return c.scope[a]||null};c.scope.__set=function(a,d){c.scope[a]=d;return c.scope}},build:function(){c.status.ready=!0;!0===h.isDebugMode()&&h.log(c.alias+" ready. [Event: bbi-"+c.alias+"-ready]",!1);k.trigger("bbi-"+c.alias+"-ready");c.settings.requires&&c.settings.requires.assets.length?h.require(c.settings.requires.assets,function(){!0===h.isDebugMode()&&h.log(c.alias+"'s assets have been loaded.",!1);c.status.loaded=!0;f.check()},
c.settings.requires.loadCSS):(c.status.loaded=!0,f.check());return{actions:c.actions,scope:c.scope,settings:c.settings}},compile:function(){"function"===typeof c.scope?(c.scope=c.scope({alias:c.alias,settings:c.settings},h,l),"undefined"===typeof c.scope&&(c.scope={})):"object"!==typeof c.scope&&(c.scope={});a.addScopeHelpers();var b,d;for(d in c.actions)b=c.actions[d],"function"===typeof b&&(c.actions[d]=new b({actions:c.actions,alias:c.alias,scope:c.scope,settings:c.settings},h,l));!0===h.isDebugMode()&&
h.log("Adding "+c.alias+" to the Window.",!1);e[c.alias]={actions:c.actions,alias:c.alias,scope:c.scope,settings:c.settings};!0===h.isDebugMode()&&h.log(c.alias+" loaded. [Event: bbi-"+c.alias+"-loaded]",!1);k.trigger("bbi-"+c.alias+"-loaded")},save:function(){f.save(c.alias,c)},scope:function(b){if("function"!==typeof b&&"object"!==typeof b)throw Error("The argument passed to the scope() method either be an object {}, or a function that returns an object. For example: .scope({}) OR .scope(function () { return {} });");
c.scope=b;return{action:a.action,build:a.build}},validate:function(a){var c=h.helper.clone(a);if("object"!==typeof a)throw Error("The options passed via the register method must be of type 'object'.");if("string"!==typeof c.alias)throw Error("The app must have an alias.");if(h.apps()[c.alias])throw Error("The app's alias, \""+c.alias+'", already exists. Please choose another alias.');if("undefined"!==typeof e[c.alias])throw Error("The app's alias, \""+c.alias+"\" is being used by a global object with the same name. This may cause critical issues; changing the application's alias is highly recommended.");
if("string"!==typeof c.author||"First Last"===c.author)throw Error("Please specify the application's author, via: .register({ author: 'First Last' })");"[object Array]"===Object.prototype.toString.call(c.requires)&&(c.requires={assets:a.requires,loadCSS:!0});return c}};c.settings=a.validate(c.settings);c.alias=c.settings.alias;c.compile=a.compile;a.save();return{action:a.action,build:a.build,scope:a.scope}}})})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"applications-handler",
defaults:{},directive:function(d,e,c){d.settings();var f={},k=!1,a=!1,b=e("events").getInstance(),g={activate:function(){!0===e.isDebugMode()&&e.log("Activating "+e.helper.objectLength(f)+" apps.",!1);var a,c;for(c in f)a=f[c],a.compile();!0===e.isDebugMode()&&e.log("Apps loaded. [Event: bbi-apps-loaded]",!1);b.trigger("bbi-apps-loaded")},check:function(){!0===e.isDebugMode()&&e.log("Checking applications' status...",!1);e("applications-script-handler").getInstance(0).done(function(c){if(!0!==k||
!0!==a){var d=!0,h=!0,m=0;c=c.scripts().length;for(var n in f){m++;if(!1===f[n].status.ready){h=!1;break}if(!1===f[n].status.loaded){d=!1;break}}!0===e.isDebugMode()&&e.log("Number of apps loaded vs. number of script tags on page:\n"+m+"/"+c);if(m===c||0===c)!1===a&&!0===h&&(a=!0,!0===e.isDebugMode()&&e.log("Apps ready. [Event: bbi-apps-ready]",!1),b.trigger("bbi-apps-ready")),!1===k&&!0===d&&(k=!0,g.activate())}})},getApps:function(){var a,b={},c;for(c in f)a=f[c],b[c]={actions:a.actions,alias:a.alias,
scope:a.scope,settings:a.settings};return b},register:function(a){return e.instantiate("app",a)},save:function(a,b){f[a]=b}};return{activate:g.activate,check:g.check,getApps:g.getApps,register:g.register,save:g.save}}});var e=d.instantiate("applications-handler");d.map("register",e.register);d.map("apps",e.getApps)})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"applications-script-handler",defaults:{dataAttr_script:"data-bbi-src"},directive:function(d,
h,l){var c=d.settings(),f=[],k=!1,a=[],b={done:function(){k=!0;for(var c=0,d=a.length;c<d;c++)a[c].call({},{scripts:b.getScripts})},find:function(){var a=l("["+c.dataAttr_script+"], [bbi-src]"),d=a.length;!0===h.isDebugMode()&&h.log(d+" application tags found.",!1);var e;if(0<d)for(e=0;e<d;e++)b.process(a[e])},getScripts:function(){return f},isUnique:function(a){for(var b=0,c=f.length;b<c;b++)if(f[b].src===a)return!1;return!0},process:function(a){a={src:a.getAttribute(c.dataAttr_script)||a.getAttribute("bbi-src")};
a.src&&b.isUnique(a.src)&&(f.push(a),h.helper.loadScript(a.src))}};(function(){l(e.document).on("bbi-ready",function(){l(function(){b.find();b.done()})})})();return{done:function(c){k?c.call({},{scripts:b.getScripts}):a.push(c)},scripts:b.getScripts}}});d.instantiate("applications-script-handler")})}).call({},window,bbiGetInstance());(function(e,d){d.on("init",function(){d.extension({alias:"applications-tag-handler",defaults:{dataAttr_action:"data-bbi-action",dataAttr_app:"data-bbi-app"},directive:function(d,
h,l){var c=d.settings();h("applications-handler").getInstance(0);var f=[],k={execute:function(){var a=h.apps(),b,c,d,k=f.length;e.setTimeout(function(){for(d=0;d<k;d++)b=f[d],"string"===typeof b.action&&("object"!==typeof a[b.app]?h.log('The app with the alias "'+b.app+'" does not exist, or the alias on the tag does not match the alias used to register the application: <div data-bbi-action="'+b.app+'" data-bbi-action="'+b.action+'"></div>\nIn some instances this error occurs when the namespace is being overwritten by another reference. Double-check that the namespace is only being initialized once on the page.',
!1):(c=a[b.app].actions[b.action],"object"===typeof c&&"function"===typeof c.init?h.helper.executeFunctionByName("init",[b.data,b.element],c):h.helper.objectLength(b.data)?h.log("The action, "+b.action+", in the app, "+b.app+", is expecting to receive options but does not have an initializing function. Add an 'init' function to your action to receive options.",!1):h.log("The action, "+b.action+", in the app, "+b.app+", does not exist. Double-check the data-bbi-action and data-bbi-app attributes on your tag.",
!1)))},0)},find:function(){var a=l("["+c.dataAttr_app+"], [bbi-app]"),b=a.length,d;if(0<b){for(d=0;d<b;d++)k.process(a[d]);k.execute()}else!0===h.isDebugMode()&&h.log("No tags found.",!1)},process:function(a){var b=a.getAttribute("bbi-app")||a.getAttribute(c.dataAttr_app),d=a.getAttribute("bbi-action")||a.getAttribute(c.dataAttr_action);f.push({app:b,action:d,data:h.helper.data(a),element:a})}};(function(){l(e.document).on("bbi-apps-loaded",function(){l(k.find)})})();return{}}});d.instantiate("applications-tag-handler")})}).call({},
window,bbiGetInstance());(function(e,d){var n,h;d.on("init",function(){var l=d.jQuery();n=d.settings();h=d("events").getInstance(0);l(e.document).on("bbi-apps-loaded",function(){d.log(n.alias+" loaded. [Event: bbi-loaded]",!1);e.bbiGetInstance.done=!0;h.trigger("bbi-loaded");d.log("Type `"+n.alias+".info()` in the console to view customization information for this page.",!1)});!0===d.isDebugMode()&&d.log(n.alias+" ready. [Event: bbi-ready]",!1);h.trigger("bbi-ready")});window.jQuery&&window.jQuery(document).trigger("bbi-extension-service",
[d,window.jQuery]);"object"===typeof e.BBIOPTIONS?(d.init(e.BBIOPTIONS),"object"===typeof e.console&&console.log("[BBI.init] Global options object found. Initialized with options.")):"function"===typeof e.bbiAsyncInit?(e.bbiAsyncInit.call({},d),"object"===typeof e.console&&console.log("[BBI.init] Initialized with options, via bbiAsyncInit().")):(d.init({}),"object"===typeof e.console&&console.log("[BBI.init] Options not found. Initialized with defaults."))}).call({},window,bbiGetInstance())})("1.1.0");
