function handleBlackBerryLocationTimeout(){bb.blackberryTimeoutId!=-1&&bb.error({message:"Timeout error",code:3})}function handleBlackBerryLocation(){if(clearTimeout(bb.blackberryTimeoutId),bb.blackberryTimeoutId=-1,bb.success&&bb.error){if(blackberry.location.latitude==0&&blackberry.location.longitude==0)bb.error({message:"Position unavailable",code:2});else{var n=null;blackberry.location.timestamp&&(n=new Date(blackberry.location.timestamp));bb.success({timestamp:n,coords:{latitude:blackberry.location.latitude,longitude:blackberry.location.longitude}})}bb.success=null;bb.error=null}}function clippyCopiedCallback(){$("#api_key_copied").fadeIn().delay(1e3).fadeOut()}function log(){window.console&&console.log.apply(console,arguments)}var bb,geoPosition,require,Handlebars,Docs,hljs;Array.prototype.map||Object.defineProperty(Array.prototype,"map",{enumerable:!1,value:function(n){var r=this.length,i,u,t;if(typeof n!="function")throw new TypeError;for(i=new Array(r),u=arguments[1],t=0;t<r;t++)t in this&&(i[t]=n.call(u,this[t],t,this));return i}});Object.defineProperty(Array.prototype,"mergeAll",{enumerable:!1,value:function(){var n=[];return this.forEach(function(t){n.push.apply(n,t)}),n}});+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f=typeof i=="object"&&i;r||u.data("bs.affix",r=new t(this,f));typeof i=="string"&&r[i]()})}var t=function(i,r){this.options=n.extend({},t.DEFAULTS,r);this.$target=n(this.options.target).on("scroll.bs.affix.data-api",n.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",n.proxy(this.checkPositionWithEventLoop,this));this.$element=n(i);this.affixed=this.unpin=this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.2.0";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(t.RESET).addClass("affix");var n=this.$target.scrollTop(),i=this.$element.offset();return this.pinnedOffset=i.top-n};t.prototype.checkPositionWithEventLoop=function(){setTimeout(n.proxy(this.checkPosition,this),1)};t.prototype.checkPosition=function(){var i,e,o;if(this.$element.is(":visible")){var s=n(document).height(),h=this.$target.scrollTop(),c=this.$element.offset(),r=this.options.offset,f=r.top,u=r.bottom;(typeof r!="object"&&(u=f=r),typeof f=="function"&&(f=r.top(this.$element)),typeof u=="function"&&(u=r.bottom(this.$element)),i=this.unpin!=null&&h+this.unpin<=c.top?!1:u!=null&&c.top+this.$element.height()>=s-u?"bottom":f!=null&&h<=f?"top":!1,this.affixed!==i)&&((this.unpin!=null&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())||(this.affixed=i,this.unpin=i=="bottom"?this.getPinnedOffset():null,this.$element.removeClass(t.RESET).addClass(e).trigger(n.Event(e.replace("affix","affixed"))),i=="bottom"&&this.$element.offset({top:s-this.$element.height()-u})))}};r=n.fn.affix;n.fn.affix=i;n.fn.affix.Constructor=t;n.fn.affix.noConflict=function(){return n.fn.affix=r,this};n(window).on("load",function(){n('[data-spy="affix"]').each(function(){var r=n(this),t=r.data();t.offset=t.offset||{};t.offsetBottom&&(t.offset.bottom=t.offsetBottom);t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);+function(n){"use strict";function u(i){return this.each(function(){var r=n(this),u=r.data("bs.alert");u||r.data("bs.alert",u=new t(this));typeof i=="string"&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.2.0";t.prototype.close=function(t){function f(){i.detach().trigger("closed.bs.alert").remove()}var u=n(this),r=u.attr("data-target"),i;(r||(r=u.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=n(r),t&&t.preventDefault(),i.length||(i=u.hasClass("alert")?u:u.parent()),i.trigger(t=n.Event("close.bs.alert")),t.isDefaultPrevented())||(i.removeClass("in"),n.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",f).emulateTransitionEnd(150):f())};r=n.fn.alert;n.fn.alert=u;n.fn.alert.Constructor=t;n.fn.alert.noConflict=function(){return n.fn.alert=r,this};n(document).on("click.bs.alert.data-api",i,t.prototype.close)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.button"),f=typeof i=="object"&&i;r||u.data("bs.button",r=new t(this,f));i=="toggle"?r.toggle():i&&r.setState(i)})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.isLoading=!1},r;t.VERSION="3.2.0";t.DEFAULTS={loadingText:"loading..."};t.prototype.setState=function(t){var r="disabled",i=this.$element,f=i.is("input")?"val":"html",u=i.data();t=t+"Text";u.resetText==null&&i.data("resetText",i[f]());setTimeout(n.proxy(function(){i[f](u[t]==null?this.options[t]:u[t]);t=="loadingText"?(this.isLoading=!0,i.addClass(r).attr(r,r)):this.isLoading&&(this.isLoading=!1,i.removeClass(r).removeAttr(r))},this),0)};t.prototype.toggle=function(){var t=!0,i=this.$element.closest('[data-toggle="buttons"]'),n;i.length&&(n=this.$element.find("input"),n.prop("type")=="radio"&&(n.prop("checked")&&this.$element.hasClass("active")?t=!1:i.find(".active").removeClass("active")),t&&n.prop("checked",!this.$element.hasClass("active")).trigger("change"));t&&this.$element.toggleClass("active")};r=n.fn.button;n.fn.button=i;n.fn.button.Constructor=t;n.fn.button.noConflict=function(){return n.fn.button=r,this};n(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var r=n(t.target);r.hasClass("btn")||(r=r.closest(".btn"));i.call(r,"toggle");t.preventDefault()})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.carousel"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i),e=typeof i=="string"?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));typeof i=="number"?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t).on("keydown.bs.carousel",n.proxy(this.keydown,this));this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=this.sliding=this.interval=this.$active=this.$items=null;this.options.pause=="hover"&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},r;t.VERSION="3.2.0";t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0};t.prototype.keydown=function(n){switch(n.which){case 37:this.prev();break;case 39:this.next();break;default:return}n.preventDefault()};t.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(n.proxy(this.next,this),this.options.interval)),this};t.prototype.getItemIndex=function(n){return this.$items=n.parent().children(".item"),this.$items.index(n||this.$active)};t.prototype.to=function(t){var r=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1)&&!(t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){r.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",n(this.$items[t]))};t.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&n.support.transition&&(this.$element.trigger(n.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this};t.prototype.next=function(){if(!this.sliding)return this.slide("next")};t.prototype.prev=function(){if(!this.sliding)return this.slide("prev")};t.prototype.slide=function(t,i){var u=this.$element.find(".item.active"),r=i||u[t](),c=this.interval,f=t=="next"?"left":"right",a=t=="next"?"first":"last",l=this,e,o,s,h;if(!r.length){if(!this.options.wrap)return;r=this.$element.find(".item")[a]()}return r.hasClass("active")?this.sliding=!1:(e=r[0],o=n.Event("slide.bs.carousel",{relatedTarget:e,direction:f}),this.$element.trigger(o),o.isDefaultPrevented())?void 0:(this.sliding=!0,c&&this.pause(),this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),s=n(this.$indicators.children()[this.getItemIndex(r)]),s&&s.addClass("active")),h=n.Event("slid.bs.carousel",{relatedTarget:e,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(r.addClass(t),r[0].offsetWidth,u.addClass(f),r.addClass(f),u.one("bsTransitionEnd",function(){r.removeClass([t,f].join(" ")).addClass("active");u.removeClass(["active",f].join(" "));l.sliding=!1;setTimeout(function(){l.$element.trigger(h)},0)}).emulateTransitionEnd(u.css("transition-duration").slice(0,-1)*1e3)):(u.removeClass("active"),r.addClass("active"),this.sliding=!1,this.$element.trigger(h)),c&&this.cycle(),this)};r=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=r,this};n(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(t){var o,r=n(this),u=n(r.attr("data-target")||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,"")),e,f;u.hasClass("carousel")&&(e=n.extend({},u.data(),r.data()),f=r.attr("data-slide-to"),f&&(e.interval=!1),i.call(u,e),f&&u.data("bs.carousel").to(f),t.preventDefault())});n(window).on("load",function(){n('[data-ride="carousel"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),typeof i=="object"&&i);!r&&f.toggle&&i=="show"&&(i=!i);r||u.data("bs.collapse",r=new t(this,f));typeof i=="string"&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.transitioning=null;this.options.parent&&(this.$parent=n(this.options.parent));this.options.toggle&&this.toggle()},r;t.VERSION="3.2.0";t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,t,u,r,e,o;if(!this.transitioning&&!this.$element.hasClass("in")&&(f=n.Event("show.bs.collapse"),this.$element.trigger(f),!f.isDefaultPrevented())){if(t=this.$parent&&this.$parent.find("> .panel > .in"),t&&t.length){if(u=t.data("bs.collapse"),u&&u.transitioning)return;i.call(t,"hide");u||t.data("bs.collapse",null)}if(r=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[r](0),this.transitioning=1,e=function(){this.$element.removeClass("collapsing").addClass("collapse in")[r]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return e.call(this);o=n.camelCase(["scroll",r].join("-"));this.$element.one("bsTransitionEnd",n.proxy(e,this)).emulateTransitionEnd(350)[r](this.$element[0][o])}};t.prototype.hide=function(){var i,t,r;if(!this.transitioning&&this.$element.hasClass("in")&&(i=n.Event("hide.bs.collapse"),this.$element.trigger(i),!i.isDefaultPrevented())){if(t=this.dimension(),this.$element[t](this.$element[t]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1,r=function(){this.transitioning=0;this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")},!n.support.transition)return r.call(this);this.$element[t](0).one("bsTransitionEnd",n.proxy(r,this)).emulateTransitionEnd(350)}};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};r=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=r,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var o,r=n(this),h=r.attr("data-target")||t.preventDefault()||(o=r.attr("href"))&&o.replace(/.*(?=#[^\s]+$)/,""),u=n(h),f=u.data("bs.collapse"),c=f?"toggle":r.data(),e=r.attr("data-parent"),s=e&&n(e);f&&f.transitioning||(s&&s.find('[data-toggle="collapse"][data-parent="'+e+'"]').not(r).addClass("collapsed"),r[u.hasClass("in")?"addClass":"removeClass"]("collapsed"));i.call(u,c)})}(jQuery);+function(n){"use strict";function u(t){t&&t.which===3||(n(e).remove(),n(r).each(function(){var r=i(n(this)),u;((r.is("h2")||r.is("h3")||r.is("div.h3")||r.is("h4"))&&(r=i(r)),u={relatedTarget:this},r.hasClass("open"))&&((r.trigger(t=n.Event("hide.bs.dropdown",u)),t.isDefaultPrevented())||r.removeClass("open").trigger("hidden.bs.dropdown",u))}))}function i(t){var i=t.attr("data-target"),r;return i||(i=t.attr("href"),i=i&&/#[A-Za-z]/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,"")),r=i&&n(i),r&&r.length?r:t.parent()}function o(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));typeof i=="string"&&u[i].call(r)})}var e=".dropdown-backdrop",r='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.2.0";t.prototype.toggle=function(t){var f=n(this),r,o,e;if(!f.is(".disabled, :disabled")){if(r=i(f),(r.is("h2")||r.is("h3")||r.is("div.h3")||r.is("h4"))&&(r=i(r)),o=r.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!r.closest(".navbar-nav").length)n('<div class="dropdown-backdrop"/>').insertAfter(n(this)).on("click",u);if(e={relatedTarget:this},r.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus");r.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var o,u,s,h,e,f;if(/(38|40|27)/.test(t.keyCode)&&(o=n(this),t.preventDefault(),t.stopPropagation(),!o.is(".disabled, :disabled"))){if(u=i(o),(u.is("h2")||u.is("h3")||u.is("div.h3")||u.is("h4"))&&(u=i(u)),s=u.hasClass("open"),!s||s&&t.keyCode==27)return t.which==27&&u.find(r).trigger("focus"),o.trigger("click");(h=" li:not(.divider):visible a",e=u.find('[role="menu"]'+h+', [role="listbox"]'+h),e.length)&&(f=e.index(e.filter(":focus")),t.keyCode==38&&f>0&&f--,t.keyCode==40&&f<e.length-1&&f++,~f||(f=0),e.eq(f).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=o;n.fn.dropdown.Constructor=t;n.fn.dropdown.noConflict=function(){return n.fn.dropdown=f,this};n(document).on("click.bs.dropdown.data-api",u).on("click.bs.dropdown.data-api",".dropdown form",function(n){n.stopPropagation()}).on("click.bs.dropdown.data-api",r,t.prototype.toggle).on("keydown.bs.dropdown.data-api",r+', [role="menu"], [role="listbox"]',t.prototype.keydown)}(jQuery);+function(n){"use strict";function i(i,r){return this.each(function(){var f=n(this),u=f.data("bs.modal"),e=n.extend({},t.DEFAULTS,f.data(),typeof i=="object"&&i);u||f.data("bs.modal",u=new t(this,e));typeof i=="string"?u[i](r):e.show&&u.show(r)})}var t=function(t,i){this.options=i;this.$body=n(document.body);this.$element=n(t);this.$backdrop=this.isShown=null;this.scrollbarWidth=0;this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,n.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))},r;t.VERSION="3.2.0";t.DEFAULTS={backdrop:!0,keyboard:!0,show:!0};t.prototype.toggle=function(n){return this.isShown?this.hide():this.show(n)};t.prototype.show=function(t){var i=this,r=n.Event("show.bs.modal",{relatedTarget:t});if(this.$element.trigger(r),!this.isShown&&!r.isDefaultPrevented()){this.isShown=!0;this.checkScrollbar();this.$body.addClass("modal-open");this.setScrollbar();this.escape();this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this));this.backdrop(function(){var u=n.support.transition&&i.$element.hasClass("fade"),r;i.$element.parent().length||i.$element.appendTo(i.$body);i.$element.show().scrollTop(0);u&&i.$element[0].offsetWidth;i.$element.addClass("in").attr("aria-hidden",!1);i.enforceFocus();r=n.Event("shown.bs.modal",{relatedTarget:t});u?i.$element.find(".modal-dialog").one("bsTransitionEnd",function(){i.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(300):i.$element.trigger("focus").trigger(r)})}};t.prototype.hide=function(t){(t&&t.preventDefault(),t=n.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented())&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())};t.prototype.enforceFocus=function(){n(document).off("focusin.bs.modal").on("focusin.bs.modal",n.proxy(function(n){this.$element[0]===n.target||this.$element.has(n.target).length||this.$element.trigger("focus")},this))};t.prototype.escape=function(){if(this.isShown&&this.options.keyboard)this.$element.on("keyup.dismiss.bs.modal",n.proxy(function(n){n.which==27&&this.hide()},this));else this.isShown||this.$element.off("keyup.dismiss.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(t){var f=this,u=this.$element.hasClass("fade")?"fade":"",i,r;if(this.isShown&&this.options.backdrop){i=n.support.transition&&u;this.$backdrop=n('<div class="modal-backdrop '+u+'" />').appendTo(this.$body);this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){n.target===n.currentTarget&&(this.options.backdrop=="static"?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this));if(i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;i?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(150):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),r=function(){f.removeBackdrop();t&&t()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(150):r()):t&&t()};t.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right","")};t.prototype.measureScrollbar=function(){var n=document.createElement("div"),t;return n.className="modal-scrollbar-measure",this.$body.append(n),t=n.offsetWidth-n.clientWidth,this.$body[0].removeChild(n),t};r=n.fn.modal;n.fn.modal=i;n.fn.modal.Constructor=t;n.fn.modal.noConflict=function(){return n.fn.modal=r,this};n(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var r=n(this),f=r.attr("href"),u=n(r.attr("data-target")||f&&f.replace(/.*(?=#[^\s]+$)/,"")),e=u.data("bs.modal")?"toggle":n.extend({remote:!/#/.test(f)&&f},u.data(),r.data());r.is("a")&&t.preventDefault();u.one("show.bs.modal",function(n){if(!n.isDefaultPrevented())u.one("hidden.bs.modal",function(){r.is(":visible")&&r.trigger("focus")})});i.call(u,e,this)})}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.tooltip"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.tooltip",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null;this.init("tooltip",n,t)},i;t.VERSION="3.2.0";t.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}};t.prototype.init=function(t,i,r){var f,e,u,o,s;for(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(this.options.viewport.selector||this.options.viewport),f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],u=="click")this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else if(u!="manual"){o=u=="hover"?"mouseenter":"focusin";s=u=="hover"?"mouseleave":"focusout";this.$element.on(o+"."+this.type,this.options.selector,n.proxy(this.enter,this));this.$element.on(s+"."+this.type,this.options.selector,n.proxy(this.leave,this))}this.options.selector?this._options=n.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()};t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.getOptions=function(t){return t=n.extend({},this.getDefaults(),this.$element.data(),t),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t};t.prototype.getDelegateOptions=function(){var t={},i=this.getDefaults();return this._options&&n.each(this._options,function(n,r){i[n]!=r&&(t[n]=r)}),t};t.prototype.enter=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="in",!i.options.delay||!i.options.delay.show)return i.show();i.timeout=setTimeout(function(){i.hoverState=="in"&&i.show()},i.options.delay.show)};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);if(i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),clearTimeout(i.timeout),i.hoverState="out",!i.options.delay||!i.options.delay.hide)return i.hide();i.timeout=setTimeout(function(){i.hoverState=="out"&&i.hide()},i.options.delay.hide)};t.prototype.show=function(){var h=n.Event("show.bs."+this.type),c,y,s;if(this.hasContent()&&this.enabled){if(this.$element.trigger(h),c=n.contains(document.documentElement,this.$element[0]),h.isDefaultPrevented()||!c)return;var f=this,i=this.tip(),l=this.getUID(this.type);this.setContent();i.attr("id",l);this.$element.attr("aria-describedby",l);this.options.animation&&i.addClass("fade");var t=typeof this.options.placement=="function"?this.options.placement.call(this,i[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,v=a.test(t);v&&(t=t.replace(a,"")||"top");i.detach().css({top:0,left:0,display:"block"}).addClass(t).data("bs."+this.type,this);this.options.container?i.appendTo(this.options.container):i.insertAfter(this.$element);var r=this.getPosition(),e=i[0].offsetWidth,o=i[0].offsetHeight;if(v){var p=t,w=this.$element.parent(),u=this.getPosition(w);t=t=="bottom"&&r.top+r.height+o-u.scroll>u.height?"top":t=="top"&&r.top-u.scroll-o<0?"bottom":t=="right"&&r.right+e>u.width?"left":t=="left"&&r.left-e<u.left?"right":t;i.removeClass(p).addClass(t)}y=this.getCalculatedOffset(t,r,e,o);this.applyPlacement(y,t);s=function(){f.$element.trigger("shown.bs."+f.type);f.hoverState=null};n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",s).emulateTransitionEnd(150):s()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),c=r[0].offsetWidth,e=r[0].offsetHeight,o=parseInt(r.css("margin-top"),10),s=parseInt(r.css("margin-left"),10),h,f,u;isNaN(o)&&(o=0);isNaN(s)&&(s=0);t.top=t.top+o;t.left=t.left+s;n.offset.setOffset(r[0],n.extend({using:function(n){r.css({top:Math.round(n.top),left:Math.round(n.left)})}},t),0);r.addClass("in");h=r[0].offsetWidth;f=r[0].offsetHeight;i=="top"&&f!=e&&(t.top=t.top+e-f);u=this.getViewportAdjustedDelta(i,t,h,f);u.left?t.left+=u.left:t.top+=u.top;var l=u.left?u.left*2-c+h:u.top*2-e+f,a=u.left?"left":"top",v=u.left?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(l,r[0][v],a)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i,n?50*(1-n/t)+"%":"")};t.prototype.setContent=function(){var n=this.tip(),t=this.getTitle();n.find(".tooltip-inner")[this.options.html?"html":"text"](t);n.removeClass("fade in top bottom left right")};t.prototype.hide=function(){function u(){t.hoverState!="in"&&i.detach();t.$element.trigger("hidden.bs."+t.type)}var t=this,i=this.tip(),r=n.Event("hide.bs."+this.type);if(this.$element.removeAttr("aria-describedby"),this.$element.trigger(r),!r.isDefaultPrevented())return i.removeClass("in"),n.support.transition&&this.$tip.hasClass("fade")?i.one("bsTransitionEnd",u).emulateTransitionEnd(150):u(),this.hoverState=null,this};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||typeof n.attr("data-original-title")!="string")&&n.attr("data-original-title",n.attr("title")||"").attr("title","")};t.prototype.hasContent=function(){return this.getTitle()};t.prototype.getPosition=function(t){t=t||this.$element;var r=t[0],i=r.tagName=="BODY";return n.extend({},typeof r.getBoundingClientRect=="function"?r.getBoundingClientRect():null,{scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop(),width:i?n(window).width():t.outerWidth(),height:i?n(window).height():t.outerHeight()},i?{top:0,left:0}:t.offset())};t.prototype.getCalculatedOffset=function(n,t,i,r){return n=="bottom"?{top:t.top+t.height,left:t.left+t.width/2-i/2}:n=="top"?{top:t.top-r,left:t.left+t.width/2-i/2}:n=="left"?{top:t.top+t.height/2-r/2,left:t.left-i}:{top:t.top+t.height/2-r/2,left:t.left+t.width}};t.prototype.getViewportAdjustedDelta=function(n,t,i,r){var f={top:0,left:0},e,u,o,s,h,c;return this.$viewport?(e=this.options.viewport&&this.options.viewport.padding||0,u=this.getPosition(this.$viewport),/right|left/.test(n)?(o=t.top-e-u.scroll,s=t.top+e-u.scroll+r,o<u.top?f.top=u.top-o:s>u.top+u.height&&(f.top=u.top+u.height-s)):(h=t.left-e,c=t.left+e+i,h<u.left?f.left=u.left-h:c>u.width&&(f.left=u.left+u.width-c)),f):f};t.prototype.getTitle=function(){var t=this.$element,n=this.options;return t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(Math.random()*1e6);while(document.getElementById(n));return n};t.prototype.tip=function(){return this.$tip=this.$tip||n(this.options.template)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};t.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)};t.prototype.enable=function(){this.enabled=!0};t.prototype.disable=function(){this.enabled=!1};t.prototype.toggleEnabled=function(){this.enabled=!this.enabled};t.prototype.toggle=function(t){var i=this;t&&(i=n(t.currentTarget).data("bs."+this.type),i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)));i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){clearTimeout(this.timeout);this.hide().$element.off("."+this.type).removeData("bs."+this.type)};i=n.fn.tooltip;n.fn.tooltip=r;n.fn.tooltip.Constructor=t;n.fn.tooltip.noConflict=function(){return n.fn.tooltip=i,this}}(jQuery);+function(n){"use strict";function r(i){return this.each(function(){var u=n(this),r=u.data("bs.popover"),f=typeof i=="object"&&i;(r||i!="destroy")&&(r||u.data("bs.popover",r=new t(this,f)),typeof i=="string"&&r[i]())})}var t=function(n,t){this.init("popover",n,t)},i;if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");t.VERSION="3.2.0";t.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"><\/div><h3 class="popover-title"><\/h3><div class="popover-content"><\/div><\/div>'});t.prototype=n.extend({},n.fn.tooltip.Constructor.prototype);t.prototype.constructor=t;t.prototype.getDefaults=function(){return t.DEFAULTS};t.prototype.setContent=function(){var n=this.tip(),i=this.getTitle(),t=this.getContent();n.find(".popover-title")[this.options.html?"html":"text"](i);n.find(".popover-content").empty()[this.options.html?typeof t=="string"?"html":"append":"text"](t);n.removeClass("fade top bottom left right in");n.find(".popover-title").html()||n.find(".popover-title").hide()};t.prototype.hasContent=function(){return this.getTitle()||this.getContent()};t.prototype.getContent=function(){var t=this.$element,n=this.options;return t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};t.prototype.tip=function(){return this.$tip||(this.$tip=n(this.options.template)),this.$tip};i=n.fn.popover;n.fn.popover=r;n.fn.popover.Constructor=t;n.fn.popover.noConflict=function(){return n.fn.popover=i,this}}(jQuery);+function(n){"use strict";function t(i,r){var u=n.proxy(this.process,this);this.$body=n("body");this.$scrollElement=n(i).is("body")?n(window):n(i);this.options=n.extend({},t.DEFAULTS,r);this.selector=(this.options.target||"")+" .nav li > a";this.offsets=[];this.targets=[];this.activeTarget=null;this.scrollHeight=0;this.$scrollElement.on("scroll.bs.scrollspy",u);this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f=typeof i=="object"&&i;r||u.data("bs.scrollspy",r=new t(this,f));typeof i=="string"&&r[i]()})}t.VERSION="3.2.0";t.DEFAULTS={offset:10};t.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)};t.prototype.refresh=function(){var i="offset",r=0,t;n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();t=this;this.$body.find(this.selector).map(function(){var f=n(this),u=f.data("target")||f.attr("href"),t=/^#./.test(u)&&n(u);return t&&t.length&&t.is(":visible")&&[[t[i]().top+r,u]]||null}).sort(function(n,t){return n[0]-t[0]}).each(function(){t.offsets.push(this[0]);t.targets.push(this[1])})};t.prototype.process=function(){var r=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,i=this.targets,u=this.activeTarget,n;if(this.scrollHeight!=f&&this.refresh(),r>=e)return u!=(n=i[i.length-1])&&this.activate(n);if(u&&r<=t[0])return u!=(n=i[0])&&this.activate(n);for(n=t.length;n--;)u!=i[n]&&r>=t[n]&&(!t[n+1]||r<=t[n+1])&&this.activate(i[n])};t.prototype.activate=function(t){this.activeTarget=t;n(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=n(r).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active"));i.trigger("activate.bs.scrollspy")};var r=n.fn.scrollspy;n.fn.scrollspy=i;n.fn.scrollspy.Constructor=t;n.fn.scrollspy.noConflict=function(){return n.fn.scrollspy=r,this};n(window).on("load.bs.scrollspy.data-api",function(){n('[data-spy="scroll"]').each(function(){var t=n(this);i.call(t,t.data())})})}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));typeof i=="string"&&r[i]()})}var t=function(t){this.element=n(t)},r;t.VERSION="3.2.0";t.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),r,u,f;(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),t.parent("li").hasClass("active"))||(r=e.find(".active:last a")[0],u=n.Event("show.bs.tab",{relatedTarget:r}),t.trigger(u),u.isDefaultPrevented())||(f=n(i),this.activate(t.closest("li"),e),this.activate(f,f.parent(),function(){t.trigger({type:"shown.bs.tab",relatedTarget:r})}))};t.prototype.activate=function(t,i,r){function e(){u.removeClass("active").find("> .dropdown-menu > .active").removeClass("active");t.addClass("active");f?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade");t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active");r&&r()}var u=i.find("> .active"),f=r&&n.support.transition&&u.hasClass("fade");f?u.one("bsTransitionEnd",e).emulateTransitionEnd(150):e();u.removeClass("in")};r=n.fn.tab;n.fn.tab=i;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=r,this};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault();i.call(n(this),"show")})}(jQuery);+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),n={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var t in n)if(i.style[t]!==undefined)return{end:n[t]};return!1}n.fn.emulateTransitionEnd=function(t){var i=!1,u=this,r;n(this).one("bsTransitionEnd",function(){i=!0});return r=function(){i||n(u).trigger(n.support.transition.end)},setTimeout(r,t),this};n(function(){(n.support.transition=t(),n.support.transition)&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(n){function r(){return new Date(Date.UTC.apply(Date,arguments))}function c(t,i){var u=n(t).data(),f={},e,o=new RegExp("^"+i.toLowerCase()+"([A-Z])"),i=new RegExp("^"+i.toLowerCase());for(var r in u)i.test(r)&&(e=r.replace(o,function(n,t){return t.toLowerCase()}),f[e]=u[r]);return f}function l(t){var u={},r;if(i[t]||(t=t.split("-")[0],i[t]))return r=i[t],n.each(h,function(n,t){t in r&&(u[t]=r[t])}),u}var e=n(window),u=function(i,r){var u=this;this._process_options(r);this.element=n(i);this.isInline=!1;this.isInput=this.element.is("input");this.component=this.element.is(".date")?this.element.find(".input-group-addon"):!1;this.hasInput=this.component&&this.element.find("input").length;this.component&&this.component.length===0&&(this.component=!1);this.picker=n(t.template);this._buildEvents();this._attachEvents();this.isInline?this.picker.addClass("datepicker-inline").appendTo(this.element):this.picker.addClass("datepicker-dropdown dropdown-menu");this.o.rtl&&(this.picker.addClass("datepicker-rtl"),this.picker.find(".prev i, .next i").toggleClass("icon-arrow-left icon-arrow-right"));this.viewMode=this.o.startView;this.o.calendarWeeks&&this.picker.find("tfoot th.today").attr("colspan",function(n,t){return parseInt(t)+1});this._allow_update=!1;this.setStartDate(this._o.startDate);this.setEndDate(this._o.endDate);this.setDaysOfWeekDisabled(this.o.daysOfWeekDisabled);this.fillDow();this.fillMonths();this._allow_update=!0;this.update();this.showMode();this.isInline&&this.show()},o,s,f,h,i,t;u.prototype={constructor:u,_process_options:function(r){var u,o,h,e,s;this._o=n.extend({},this._o,r);u=this.o=n.extend({},this._o);o=u.language;i[o]||(o=o.split("-")[0],i[o]||(o=f.language));u.language=o;switch(u.startView){case 2:case"decade":u.startView=2;break;case 1:case"year":u.startView=1;break;default:u.startView=0}switch(u.minViewMode){case 1:case"months":u.minViewMode=1;break;case 2:case"years":u.minViewMode=2;break;default:u.minViewMode=0}if(u.startView=Math.max(u.startView,u.minViewMode),u.weekStart%=7,u.weekEnd=(u.weekStart+6)%7,h=t.parseFormat(u.format),u.startDate!==-Infinity&&(u.startDate=u.startDate?u.startDate instanceof Date?this._local_to_utc(this._zero_time(u.startDate)):t.parseDate(u.startDate,h,u.language):-Infinity),u.endDate!==Infinity&&(u.endDate=u.endDate?u.endDate instanceof Date?this._local_to_utc(this._zero_time(u.endDate)):t.parseDate(u.endDate,h,u.language):Infinity),u.daysOfWeekDisabled=u.daysOfWeekDisabled||[],n.isArray(u.daysOfWeekDisabled)||(u.daysOfWeekDisabled=u.daysOfWeekDisabled.split(/[,\s]*/)),u.daysOfWeekDisabled=n.map(u.daysOfWeekDisabled,function(n){return parseInt(n,10)}),e=String(u.orientation).toLowerCase().split(/\s+/g),s=u.orientation.toLowerCase(),e=n.grep(e,function(n){return/^auto|left|right|top|bottom$/.test(n)}),u.orientation={x:"auto",y:"auto"},s&&s!=="auto")if(e.length===1)switch(e[0]){case"top":case"bottom":u.orientation.y=e[0];break;case"left":case"right":u.orientation.x=e[0]}else s=n.grep(e,function(n){return/^left|right$/.test(n)}),u.orientation.x=s[0]||"auto",s=n.grep(e,function(n){return/^top|bottom$/.test(n)}),u.orientation.y=s[0]||"auto"},_events:[],_secondaryEvents:[],_applyEvents:function(n){for(var t=0,i,r;t<n.length;t++){i=n[t][0];r=n[t][1];i.on(r)}},_unapplyEvents:function(n){for(var t=0,i,r;t<n.length;t++)i=n[t][0],r=n[t][1],i.off(r)},_buildEvents:function(){this.isInput?this._events=[[this.element,{focus:n.proxy(this.show,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}]]:this.component&&this.hasInput?this._events=[[this.element.find("input"),{focus:n.proxy(this.show,this),keyup:n.proxy(this.update,this),keydown:n.proxy(this.keydown,this)}],[this.component,{click:n.proxy(this.show,this)}]]:this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:n.proxy(this.show,this)}]];this._secondaryEvents=[[this.picker,{click:n.proxy(this.click,this)}],[n(window),{resize:n.proxy(this.place,this)}],[n(document),{mousedown:n.proxy(function(n){this.element.is(n.target)||this.element.find(n.target).length||this.picker.is(n.target)||this.picker.find(n.target).length||this.hide()},this)}]]},_attachEvents:function(){this._detachEvents();this._applyEvents(this._events)},_detachEvents:function(){this._unapplyEvents(this._events)},_attachSecondaryEvents:function(){this._detachSecondaryEvents();this._applyEvents(this._secondaryEvents)},_detachSecondaryEvents:function(){this._unapplyEvents(this._secondaryEvents)},_trigger:function(i,r){var u=r||this.date,f=this._utc_to_local(u);this.element.trigger({type:i,date:f,format:n.proxy(function(n){var i=n||this.o.format;return t.formatDate(u,i,this.o.language)},this)})},show:function(n){this.isInline||this.picker.appendTo("body");this.picker.show();this.height=this.component?this.component.outerHeight():this.element.outerHeight();this.place();this._attachSecondaryEvents();n&&n.preventDefault();this._trigger("show")},hide:function(){this.isInline||this.picker.is(":visible")&&(this.picker.hide().detach(),this._detachSecondaryEvents(),this.viewMode=this.o.startView,this.showMode(),this.o.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this._trigger("hide"))},remove:function(){this.hide();this._detachEvents();this._detachSecondaryEvents();this.picker.remove();delete this.element.data().datepicker;this.isInput||delete this.element.data().date},_utc_to_local:function(n){return new Date(n.getTime()+n.getTimezoneOffset()*6e4)},_local_to_utc:function(n){return new Date(n.getTime()-n.getTimezoneOffset()*6e4)},_zero_time:function(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())},_zero_utc_time:function(n){return new Date(Date.UTC(n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()))},getDate:function(){return this._utc_to_local(this.getUTCDate())},getUTCDate:function(){return this.date},setDate:function(n){this.setUTCDate(this._local_to_utc(n))},setUTCDate:function(n){this.date=n;this.setValue()},setValue:function(){var n=this.getFormattedDate();this.isInput?this.element.val(n).change():this.component&&this.element.find("input").val(n).change()},getFormattedDate:function(n){return n===undefined&&(n=this.o.format),t.formatDate(this.date,n,this.o.language)},setStartDate:function(n){this._process_options({startDate:n});this.update();this.updateNavArrows()},setEndDate:function(n){this._process_options({endDate:n});this.update();this.updateNavArrows()},setDaysOfWeekDisabled:function(n){this._process_options({daysOfWeekDisabled:n});this.update();this.updateNavArrows()},place:function(){var i,v,s;if(!this.isInline){var u=this.picker.outerWidth(),f=this.picker.outerHeight(),h=10,c=e.width(),y=e.height(),l=e.scrollTop(),p=parseInt(this.element.parents().filter(function(){return n(this).css("z-index")!="auto"}).first().css("z-index"))+10,t=this.component?this.component.parent().offset():this.element.offset(),a=this.component?this.component.outerHeight(!0):this.element.outerHeight(!1),w=this.component?this.component.outerWidth(!0):this.element.outerWidth(!1),r=t.left,o=t.top;this.picker.removeClass("datepicker-orient-top datepicker-orient-bottom datepicker-orient-right datepicker-orient-left");this.o.orientation.x!=="auto"?(this.picker.addClass("datepicker-orient-"+this.o.orientation.x),this.o.orientation.x==="right"&&(r-=u-w)):(this.picker.addClass("datepicker-orient-left"),t.left<0?r-=t.left-h:t.left+u>c&&(r=c-u-h));i=this.o.orientation.y;i==="auto"&&(v=-l+t.top-f,s=l+y-(t.top+a+f),i=Math.max(v,s)===s?"top":"bottom");this.picker.addClass("datepicker-orient-"+i);i==="top"?o+=a:o-=f+parseInt(this.picker.css("padding-top"));this.picker.css({top:o,left:r,zIndex:p})}},_allow_update:!0,update:function(){if(this._allow_update){var r=new Date(this.date),n,i=!1;arguments&&arguments.length&&(typeof arguments[0]=="string"||arguments[0]instanceof Date)?(n=arguments[0],n instanceof Date&&(n=this._local_to_utc(n)),i=!0):(n=this.isInput?this.element.val():this.element.data("date")||this.element.find("input").val(),delete this.element.data().date);this.date=t.parseDate(n,this.o.format,this.o.language);i?this.setValue():n?r.getTime()!==this.date.getTime()&&this._trigger("changeDate"):this._trigger("clearDate");this.date<this.o.startDate?(this.viewDate=new Date(this.o.startDate),this.date=new Date(this.o.startDate)):this.date>this.o.endDate?(this.viewDate=new Date(this.o.endDate),this.date=new Date(this.o.endDate)):(this.viewDate=new Date(this.date),this.date=new Date(this.date));this.fill()}},fillDow:function(){var r=this.o.weekStart,n="<tr>",t;for(this.o.calendarWeeks&&(t='<th class="cw">&nbsp;<\/th>',n+=t,this.picker.find(".datepicker-days thead tr:first-child").prepend(t));r<this.o.weekStart+7;)n+='<th class="dow">'+i[this.o.language].daysMin[r++%7]+"<\/th>";n+="<\/tr>";this.picker.find(".datepicker-days thead").append(n)},fillMonths:function(){for(var n="",t=0;t<12;)n+='<span class="month">'+i[this.o.language].monthsShort[t++]+"<\/span>";this.picker.find(".datepicker-months td").html(n)},setRange:function(t){t&&t.length?this.range=n.map(t,function(n){return n.valueOf()}):delete this.range;this.fill()},getClassNames:function(t){var i=[],r=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth(),e=this.date.valueOf(),u=new Date;return t.getUTCFullYear()<r||t.getUTCFullYear()==r&&t.getUTCMonth()<f?i.push("old"):(t.getUTCFullYear()>r||t.getUTCFullYear()==r&&t.getUTCMonth()>f)&&i.push("new"),this.o.todayHighlight&&t.getUTCFullYear()==u.getFullYear()&&t.getUTCMonth()==u.getMonth()&&t.getUTCDate()==u.getDate()&&i.push("today"),e&&t.valueOf()==e&&i.push("active"),(t.valueOf()<this.o.startDate||t.valueOf()>this.o.endDate||n.inArray(t.getUTCDay(),this.o.daysOfWeekDisabled)!==-1)&&i.push("disabled"),this.range&&(t>this.range[0]&&t<this.range[this.range.length-1]&&i.push("range"),n.inArray(t.valueOf(),this.range)!=-1&&i.push("selected")),i},fill:function(){var k=new Date(this.viewDate),u=k.getUTCFullYear(),d=k.getUTCMonth(),v=this.o.startDate!==-Infinity?this.o.startDate.getUTCFullYear():-Infinity,it=this.o.startDate!==-Infinity?this.o.startDate.getUTCMonth():-Infinity,y=this.o.endDate!==Infinity?this.o.endDate.getUTCFullYear():Infinity,rt=this.o.endDate!==Infinity?this.o.endDate.getUTCMonth():Infinity,ft=this.date&&this.date.valueOf(),p,f,w,h,o,s,e,a,c,tt,l;for(this.picker.find(".datepicker-days thead th.datepicker-switch").text(i[this.o.language].months[d]+" "+u),this.picker.find("tfoot th.today").text(i[this.o.language].today).toggle(this.o.todayBtn!==!1),this.picker.find("tfoot th.clear").text(i[this.o.language].clear).toggle(this.o.clearBtn!==!1),this.updateNavArrows(),this.fillMonths(),f=r(u,d-1,28,0,0,0,0),w=t.getDaysInMonth(f.getUTCFullYear(),f.getUTCMonth()),f.setUTCDate(w),f.setUTCDate(w-(f.getUTCDay()-this.o.weekStart+7)%7),h=new Date(f),h.setUTCDate(h.getUTCDate()+42),h=h.valueOf(),o=[];f.valueOf()<h;){if(f.getUTCDay()==this.o.weekStart&&(o.push("<tr>"),this.o.calendarWeeks)){var g=new Date(+f+(this.o.weekStart-f.getUTCDay()-7)%7*864e5),nt=new Date(+g+(11-g.getUTCDay())%7*864e5),b=new Date(+(b=r(nt.getUTCFullYear(),0,1))+(11-b.getUTCDay())%7*864e5),ut=(nt-b)/6048e5+1;o.push('<td class="cw">'+ut+"<\/td>")}s=this.getClassNames(f);s.push("day");this.o.beforeShowDay!==n.noop&&(e=this.o.beforeShowDay(this._utc_to_local(f)),e===undefined?e={}:typeof e=="boolean"?e={enabled:e}:typeof e=="string"&&(e={classes:e}),e.enabled===!1&&s.push("disabled"),e.classes&&(s=s.concat(e.classes.split(/\s+/))),e.tooltip&&(p=e.tooltip));s=n.unique(s);o.push('<td class="'+s.join(" ")+'"'+(p?' title="'+p+'"':"")+">"+f.getUTCDate()+"<\/td>");f.getUTCDay()==this.o.weekEnd&&o.push("<\/tr>");f.setUTCDate(f.getUTCDate()+1)}for(this.picker.find(".datepicker-days tbody").empty().append(o.join("")),a=this.date&&this.date.getUTCFullYear(),c=this.picker.find(".datepicker-months").find("th:eq(1)").text(u).end().find("span").removeClass("active"),a&&a==u&&c.eq(this.date.getUTCMonth()).addClass("active"),(u<v||u>y)&&c.addClass("disabled"),u==v&&c.slice(0,it).addClass("disabled"),u==y&&c.slice(rt+1).addClass("disabled"),o="",u=parseInt(u/10,10)*10,tt=this.picker.find(".datepicker-years").find("th:eq(1)").text(u+"-"+(u+9)).end().find("td"),u-=1,l=-1;l<11;l++)o+='<span class="year'+(l==-1?" old":l==10?" new":"")+(a==u?" active":"")+(u<v||u>y?" disabled":"")+'">'+u+"<\/span>",u+=1;tt.html(o)},updateNavArrows:function(){if(this._allow_update){var t=new Date(this.viewDate),n=t.getUTCFullYear(),i=t.getUTCMonth();switch(this.viewMode){case 0:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()&&i<=this.o.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()&&i>=this.o.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:case 2:this.o.startDate!==-Infinity&&n<=this.o.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"});this.o.endDate!==Infinity&&n>=this.o.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}}},click:function(i){var u,h,e,l,s;if(i.preventDefault(),u=n(i.target).closest("span, td, th"),u.length==1)switch(u[0].nodeName.toLowerCase()){case"th":switch(u[0].className){case"datepicker-switch":this.showMode(1);break;case"prev":case"next":h=t.modes[this.viewMode].navStep*(u[0].className=="prev"?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveMonth(this.viewDate,h);this._trigger("changeMonth",this.viewDate);break;case 1:case 2:this.viewDate=this.moveYear(this.viewDate,h);this.viewMode===1&&this._trigger("changeYear",this.viewDate)}this.fill();break;case"today":e=new Date;e=r(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0);this.showMode(-2);l=this.o.todayBtn=="linked"?null:"view";this._setDate(e,l);break;case"clear":this.isInput?s=this.element:this.component&&(s=this.element.find("input"));s&&s.val("").change();this._trigger("changeDate");this.update();this.o.autoclose&&this.hide()}break;case"span":if(!u.is(".disabled")){if(this.viewDate.setUTCDate(1),u.is(".month")){var c=1,f=u.parent().find("span").index(u),o=this.viewDate.getUTCFullYear();this.viewDate.setUTCMonth(f);this._trigger("changeMonth",this.viewDate);this.o.minViewMode===1&&this._setDate(r(o,f,c,0,0,0,0))}else{var o=parseInt(u.text(),10)||0,c=1,f=0;this.viewDate.setUTCFullYear(o);this._trigger("changeYear",this.viewDate);this.o.minViewMode===2&&this._setDate(r(o,f,c,0,0,0,0))}this.showMode(-1);this.fill()}break;case"td":if(u.is(".day")&&!u.is(".disabled")){var c=parseInt(u.text(),10)||1,o=this.viewDate.getUTCFullYear(),f=this.viewDate.getUTCMonth();u.is(".old")?f===0?(f=11,o-=1):f-=1:u.is(".new")&&(f==11?(f=0,o+=1):f+=1);this._setDate(r(o,f,c,0,0,0,0))}}},_setDate:function(n,t){t&&t!="date"||(this.date=new Date(n));t&&t!="view"||(this.viewDate=new Date(n));this.fill();this.setValue();this._trigger("changeDate");var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input"));i&&i.change();this.o.autoclose&&(!t||t=="date")&&this.hide()},moveMonth:function(n,t){var f;if(!t)return n;var i=new Date(n.valueOf()),e=i.getUTCDate(),o=i.getUTCMonth(),s=Math.abs(t),r,u;if(t=t>0?1:-1,s==1)u=t==-1?function(){return i.getUTCMonth()==o}:function(){return i.getUTCMonth()!=r},r=o+t,i.setUTCMonth(r),(r<0||r>11)&&(r=(r+12)%12);else{for(f=0;f<s;f++)i=this.moveMonth(i,t);r=i.getUTCMonth();i.setUTCDate(e);u=function(){return r!=i.getUTCMonth()}}while(u())i.setUTCDate(--e),i.setUTCMonth(r);return i},moveYear:function(n,t){return this.moveMonth(n,t*12)},dateWithinRange:function(n){return n>=this.o.startDate&&n<=this.o.endDate},keydown:function(n){var u,t,i,r,f;if(this.picker.is(":not(:visible)")){n.keyCode==27&&this.show();return}u=!1;switch(n.keyCode){case 27:this.hide();n.preventDefault();break;case 37:case 39:if(!this.o.keyboardNavigation)break;t=n.keyCode==37?-1:1;n.ctrlKey?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+t),r=new Date(this.viewDate),r.setUTCDate(this.viewDate.getUTCDate()+t));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 38:case 40:if(!this.o.keyboardNavigation)break;t=n.keyCode==38?-1:1;n.ctrlKey?(i=this.moveYear(this.date,t),r=this.moveYear(this.viewDate,t),this._trigger("changeYear",this.viewDate)):n.shiftKey?(i=this.moveMonth(this.date,t),r=this.moveMonth(this.viewDate,t),this._trigger("changeMonth",this.viewDate)):(i=new Date(this.date),i.setUTCDate(this.date.getUTCDate()+t*7),r=new Date(this.viewDate),r.setUTCDate(this.viewDate.getUTCDate()+t*7));this.dateWithinRange(i)&&(this.date=i,this.viewDate=r,this.setValue(),this.update(),n.preventDefault(),u=!0);break;case 13:this.hide();n.preventDefault();break;case 9:this.hide()}u&&(this._trigger("changeDate"),this.isInput?f=this.element:this.component&&(f=this.element.find("input")),f&&f.change())},showMode:function(n){n&&(this.viewMode=Math.max(this.o.minViewMode,Math.min(2,this.viewMode+n)));this.picker.find(">div").hide().filter(".datepicker-"+t.modes[this.viewMode].clsName).css("display","block");this.updateNavArrows()}};o=function(t,i){this.element=n(t);this.inputs=n.map(i.inputs,function(n){return n.jquery?n[0]:n});delete i.inputs;n(this.inputs).datepicker(i).bind("changeDate",n.proxy(this.dateUpdated,this));this.pickers=n.map(this.inputs,function(t){return n(t).data("datepicker")});this.updateDates()};o.prototype={updateDates:function(){this.dates=n.map(this.pickers,function(n){return n.date});this.updateRanges()},updateRanges:function(){var t=n.map(this.dates,function(n){return n.valueOf()});n.each(this.pickers,function(n,i){i.setRange(t)})},dateUpdated:function(t){var u=n(t.target).data("datepicker"),r=u.getUTCDate(),i=n.inArray(t.target,this.inputs),f=this.inputs.length;if(i!=-1){if(r<this.dates[i])while(i>=0&&r<this.dates[i])this.pickers[i--].setUTCDate(r);else if(r>this.dates[i])while(i<f&&r>this.dates[i])this.pickers[i++].setUTCDate(r);this.updateDates()}},remove:function(){n.map(this.pickers,function(n){n.remove()});delete this.element.data().datepicker}};s=n.fn.datepicker;n.fn.datepicker=function(t){var r=Array.apply(null,arguments),i;return r.shift(),this.each(function(){var s=n(this),e=s.data("datepicker"),a=typeof t=="object"&&t,y;if(!e){var v=c(this,"date"),p=n.extend({},f,v,a),w=l(p.language),h=n.extend({},f,w,v,a);s.is(".input-daterange")||h.inputs?(y={inputs:h.inputs||s.find("input").toArray()},s.data("datepicker",e=new o(this,n.extend(h,y)))):s.data("datepicker",e=new u(this,h))}if(typeof t=="string"&&typeof e[t]=="function"&&(i=e[t].apply(e,r),i!==undefined))return!1}),i!==undefined?i:this};f=n.fn.datepicker.defaults={autoclose:!1,beforeShowDay:n.noop,calendarWeeks:!1,clearBtn:!1,daysOfWeekDisabled:[],endDate:Infinity,forceParse:!0,format:"m/d/yyyy",keyboardNavigation:!0,language:"en",minViewMode:0,orientation:"auto",rtl:!1,startDate:-Infinity,startView:0,todayBtn:!1,todayHighlight:!1,weekStart:0};h=n.fn.datepicker.locale_opts=["format","rtl","weekStart"];n.fn.datepicker.Constructor=u;i=n.fn.datepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear"}};t={modes:[{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(n){return n%4==0&&n%100!=0||n%400==0},getDaysInMonth:function(n,i){return[31,t.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][i]},validParts:/dd?|DD?|mm?|MM?|yy(?:yy)?/g,nonpunctuation:/[^ -\/:-@\[\u3400-\u9fff-`{-~\t\n\r]+/g,parseFormat:function(n){var t=n.replace(this.validParts,'\0').split('\0'),i=n.match(this.validParts);if(!t||!t.length||!i||i.length===0)throw new Error("Invalid date format.");return{separators:t,parts:i}},parseDate:function(f,e,o){var g,h,a,v,l,nt,s,k,p;if(f instanceof Date)return f;if(typeof e=="string"&&(e=t.parseFormat(e)),/^[\-+]\d+[dmwy]([\s,]+[\-+]\d+[dmwy])*$/.test(f)){for(g=/([\-+]\d+)([dmwy])/,h=f.match(/([\-+]\d+)([dmwy])/g),f=new Date,s=0;s<h.length;s++){a=g.exec(h[s]);v=parseInt(a[1]);switch(a[2]){case"d":f.setUTCDate(f.getUTCDate()+v);break;case"m":f=u.prototype.moveMonth.call(u.prototype,f,v);break;case"w":f.setUTCDate(f.getUTCDate()+v*7);break;case"y":f=u.prototype.moveYear.call(u.prototype,f,v)}}return r(f.getUTCFullYear(),f.getUTCMonth(),f.getUTCDate(),0,0,0)}var h=f&&f.match(this.nonpunctuation)||[],f=new Date,w={},d=["yyyy","yy","M","MM","m","mm","d","dd"],c={yyyy:function(n,t){return n.setUTCFullYear(t)},yy:function(n,t){return n.setUTCFullYear(2e3+t)},m:function(n,t){if(isNaN(n))return n;for(t-=1;t<0;)t+=12;for(t%=12,n.setUTCMonth(t);n.getUTCMonth()!=t;)n.setUTCDate(n.getUTCDate()-1);return n},d:function(n,t){return n.setUTCDate(t)}},y,b,a;if(c.M=c.MM=c.mm=c.m,c.dd=c.d,f=r(f.getFullYear(),f.getMonth(),f.getDate(),0,0,0),l=e.parts.slice(),h.length!=l.length&&(l=n(l).filter(function(t,i){return n.inArray(i,d)!==-1}).toArray()),h.length==l.length){for(s=0,nt=l.length;s<nt;s++){if(y=parseInt(h[s],10),a=l[s],isNaN(y))switch(a){case"MM":b=n(i[o].months).filter(function(){var n=this.slice(0,h[s].length),t=h[s].slice(0,n.length);return n==t});y=n.inArray(b[0],i[o].months)+1;break;case"M":b=n(i[o].monthsShort).filter(function(){var n=this.slice(0,h[s].length),t=h[s].slice(0,n.length);return n==t});y=n.inArray(b[0],i[o].monthsShort)+1}w[a]=y}for(s=0;s<d.length;s++)p=d[s],p in w&&!isNaN(w[p])&&(k=new Date(f),c[p](k,w[p]),isNaN(k)||(f=k))}return f},formatDate:function(r,u,f){var e,r,s,o,h;for(typeof u=="string"&&(u=t.parseFormat(u)),e={d:r.getUTCDate(),D:i[f].daysShort[r.getUTCDay()],DD:i[f].days[r.getUTCDay()],m:r.getUTCMonth()+1,M:i[f].monthsShort[r.getUTCMonth()],MM:i[f].months[r.getUTCMonth()],yy:r.getUTCFullYear().toString().substring(2),yyyy:r.getUTCFullYear()},e.dd=(e.d<10?"0":"")+e.d,e.mm=(e.m<10?"0":"")+e.m,r=[],s=n.extend([],u.separators),o=0,h=u.parts.length;o<=h;o++)s.length&&r.push(s.shift()),r.push(e[u.parts[o]]);return r.join("")},headTemplate:'<thead><tr><th class="prev">&laquo;<\/th><th colspan="5" class="datepicker-switch"><\/th><th class="next">&raquo;<\/th><\/tr><\/thead>',contTemplate:'<tbody><tr><td colspan="7"><\/td><\/tr><\/tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"><\/th><\/tr><tr><th colspan="7" class="clear"><\/th><\/tr><\/tfoot>'};t.template='<div class="datepicker"><div class="datepicker-days"><table class=" table-condensed">'+t.headTemplate+"<tbody><\/tbody>"+t.footTemplate+'<\/table><\/div><div class="datepicker-months"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+'<\/table><\/div><div class="datepicker-years"><table class="table-condensed">'+t.headTemplate+t.contTemplate+t.footTemplate+"<\/table><\/div><\/div>";n.fn.datepicker.DPGlobal=t;n.fn.datepicker.noConflict=function(){return n.fn.datepicker=s,this};n(document).on("focus.datepicker.data-api click.datepicker.data-api",'[data-provide="datepicker"]',function(t){var i=n(this);i.data("datepicker")||(t.preventDefault(),i.datepicker("show"))});n(function(){n('[data-provide="datepicker-inline"]').datepicker()})}(window.jQuery);!function(n){var t=function(t,i){var r,u;this.element=n(t);this.picker=n('<div class="slider"><div class="slider-track"><div class="slider-selection"><\/div><div class="slider-handle"><\/div><div class="slider-handle"><\/div><\/div><div class="tooltip"><div class="tooltip-arrow"><\/div><div class="tooltip-inner"><\/div><\/div><\/div>').insertBefore(this.element).append(this.element);this.id=this.element.data("slider-id")||i.id;this.id&&(this.picker[0].id=this.id);typeof Modernizr!="undefined"&&Modernizr.touch&&(this.touchCapable=!0);r=this.element.data("slider-tooltip")||i.tooltip;this.tooltip=this.picker.find(".tooltip");this.tooltipInner=this.tooltip.find("div.tooltip-inner");this.orientation=this.element.data("slider-orientation")||i.orientation;switch(this.orientation){case"vertical":this.picker.addClass("slider-vertical");this.stylePos="top";this.mousePos="pageY";this.sizePos="offsetHeight";this.tooltip.addClass("right")[0].style.left="100%";break;default:this.picker.addClass("slider-horizontal").css("width",this.element.outerWidth());this.orientation="horizontal";this.stylePos="left";this.mousePos="pageX";this.sizePos="offsetWidth";this.tooltip.addClass("top")[0].style.top=-this.tooltip.outerHeight()-14+"px"}this.min=this.element.data("slider-min")||i.min;this.max=this.element.data("slider-max")||i.max;this.step=this.element.data("slider-step")||i.step;this.value=this.element.data("slider-value")||i.value;this.value[1]&&(this.range=!0);this.selection=this.element.data("slider-selection")||i.selection;this.selectionEl=this.picker.find(".slider-selection");this.selection==="none"&&this.selectionEl.addClass("hide");this.selectionElStyle=this.selectionEl[0].style;this.handle1=this.picker.find(".slider-handle:first");this.handle1Stype=this.handle1[0].style;this.handle2=this.picker.find(".slider-handle:last");this.handle2Stype=this.handle2[0].style;u=this.element.data("slider-handle")||i.handle;switch(u){case"round":this.handle1.addClass("round");this.handle2.addClass("round");break;case"triangle":this.handle1.addClass("triangle");this.handle2.addClass("triangle")}if(this.range?(this.value[0]=Math.max(this.min,Math.min(this.max,this.value[0])),this.value[1]=Math.max(this.min,Math.min(this.max,this.value[1]))):(this.value=[Math.max(this.min,Math.min(this.max,this.value))],this.handle2.addClass("hide"),this.value[1]=this.selection=="after"?this.max:this.min),this.diff=this.max-this.min,this.percentage=[(this.value[0]-this.min)*100/this.diff,(this.value[1]-this.min)*100/this.diff,this.step*100/this.diff],this.offset=this.picker.offset(),this.size=this.picker[0][this.sizePos],this.formater=i.formater,this.layout(),this.touchCapable)this.picker.on({touchstart:n.proxy(this.mousedown,this)});else this.picker.on({mousedown:n.proxy(this.mousedown,this)});if(r==="show")this.picker.on({mouseenter:n.proxy(this.showTooltip,this),mouseleave:n.proxy(this.hideTooltip,this)});else this.tooltip.addClass("hide")};t.prototype={constructor:t,over:!1,inDrag:!1,showTooltip:function(){this.tooltip.addClass("in");this.over=!0},hideTooltip:function(){this.inDrag===!1&&this.tooltip.removeClass("in");this.over=!1},layout:function(){this.handle1Stype[this.stylePos]=this.percentage[0]+"%";this.handle2Stype[this.stylePos]=this.percentage[1]+"%";this.orientation=="vertical"?(this.selectionElStyle.top=Math.min(this.percentage[0],this.percentage[1])+"%",this.selectionElStyle.height=Math.abs(this.percentage[0]-this.percentage[1])+"%"):(this.selectionElStyle.left=Math.min(this.percentage[0],this.percentage[1])+"%",this.selectionElStyle.width=Math.abs(this.percentage[0]-this.percentage[1])+"%");this.range?(this.tooltipInner.text(this.formater(this.value[0])+" : "+this.formater(this.value[1])),this.tooltip[0].style[this.stylePos]=this.size*(this.percentage[0]+(this.percentage[1]-this.percentage[0])/2)/100-(this.orientation==="vertical"?this.tooltip.outerHeight()/2:this.tooltip.outerWidth()/2)+"px"):(this.tooltipInner.text(this.formater(this.value[0])),this.tooltip[0].style[this.stylePos]=this.size*this.percentage[0]/100-(this.orientation==="vertical"?this.tooltip.outerHeight()/2:this.tooltip.outerWidth()/2)+"px")},mousedown:function(t){var i,u,f,r;if(this.touchCapable&&t.type==="touchstart"&&(t=t.originalEvent),this.offset=this.picker.offset(),this.size=this.picker[0][this.sizePos],i=this.getPercentage(t),this.range?(u=Math.abs(this.percentage[0]-i),f=Math.abs(this.percentage[1]-i),this.dragged=u<f?0:1):this.dragged=0,this.percentage[this.dragged]=i,this.layout(),this.touchCapable)n(document).on({touchmove:n.proxy(this.mousemove,this),touchend:n.proxy(this.mouseup,this)});else n(document).on({mousemove:n.proxy(this.mousemove,this),mouseup:n.proxy(this.mouseup,this)});return this.inDrag=!0,r=this.calculateValue(),this.element.trigger({type:"slideStart",value:r}).trigger({type:"slide",value:r}),!1},mousemove:function(n){var t,i;return this.touchCapable&&n.type==="touchmove"&&(n=n.originalEvent),t=this.getPercentage(n),this.range&&(this.dragged===0&&this.percentage[1]<t?(this.percentage[0]=this.percentage[1],this.dragged=1):this.dragged===1&&this.percentage[0]>t&&(this.percentage[1]=this.percentage[0],this.dragged=0)),this.percentage[this.dragged]=t,this.layout(),i=this.calculateValue(),this.element.trigger({type:"slide",value:i}).data("value",i).prop("value",i),!1},mouseup:function(){this.touchCapable?n(document).off({touchmove:this.mousemove,touchend:this.mouseup}):n(document).off({mousemove:this.mousemove,mouseup:this.mouseup});this.inDrag=!1;this.over==!1&&this.hideTooltip();this.element;var t=this.calculateValue();return this.element.trigger({type:"slideStop",value:t}).data("value",t).prop("value",t),!1},calculateValue:function(){var n;return this.range?(n=[this.min+Math.round(this.diff*this.percentage[0]/100/this.step)*this.step,this.min+Math.round(this.diff*this.percentage[1]/100/this.step)*this.step],this.value=n):(n=this.min+Math.round(this.diff*this.percentage[0]/100/this.step)*this.step,this.value=[n,this.value[1]]),n},getPercentage:function(n){this.touchCapable&&(n=n.touches[0]);var t=(n[this.mousePos]-this.offset[this.stylePos])*100/this.size;return t=Math.round(t/this.percentage[2])*this.percentage[2],Math.max(0,Math.min(100,t))},getValue:function(){return this.range?this.value:this.value[0]},setValue:function(n){this.value=n;this.range?(this.value[0]=Math.max(this.min,Math.min(this.max,this.value[0])),this.value[1]=Math.max(this.min,Math.min(this.max,this.value[1]))):(this.value=[Math.max(this.min,Math.min(this.max,this.value))],this.handle2.addClass("hide"),this.value[1]=this.selection=="after"?this.max:this.min);this.diff=this.max-this.min;this.percentage=[(this.value[0]-this.min)*100/this.diff,(this.value[1]-this.min)*100/this.diff,this.step*100/this.diff];this.layout()}};n.fn.slider=function(i,r){return this.each(function(){var f=n(this),u=f.data("slider"),e=typeof i=="object"&&i;u||f.data("slider",u=new t(this,n.extend({},n.fn.slider.defaults,e)));typeof i=="string"&&u[i](r)})};n.fn.slider.defaults={min:0,max:10,step:1,orientation:"horizontal",value:5,selection:"before",tooltip:"show",handle:"round",formater:function(n){return n}};n.fn.slider.Constructor=t}(window.jQuery);$(function(){"use strict";(function(){var n=$(window).height()-60,t=$("<style />").attr("type","text/css").html(".modal-window-height .modal-content{overflow-y: scroll;max-height: "+n+"px;}");$("body").append(t)})()});!function(n){var i=function(){var t=[],i=!1,r,u=function(){clearTimeout(r);r=setTimeout(f,100)},f=function(){for(var n=0,i=t.length;n<i;n++)t[n].apply()};return{register:function(r){t.push(r);i===!1&&(n(window).bind("resize",u),i=!0)},unregister:function(n){for(var i=0,r=t.length;i<r;i++)if(t[i]==n){delete t[i];break}}}}(),t=function(t,r){this.element=n(t);this.dropdown=n('<li class="dropdown hide pull-right tabdrop"><a class="dropdown-toggle" data-toggle="dropdown" href="#">'+r.text+' <b class="caret"><\/b><\/a><ul class="dropdown-menu"><\/ul><\/li>').prependTo(this.element);this.element.parent().is(".tabs-below")&&this.dropdown.addClass("dropup");i.register(n.proxy(this.layout,this));this.layout()};t.prototype={constructor:t,layout:function(){var t=[];this.dropdown.removeClass("hide");this.element.append(this.dropdown.find("li")).find(">li").not(".tabdrop").each(function(){this.offsetTop>0&&t.push(this)});t.length>0?(t=n(t),this.dropdown.find("ul").empty().append(t),this.dropdown.find(".active").length==1?this.dropdown.addClass("active"):this.dropdown.removeClass("active")):this.dropdown.addClass("hide")}};n.fn.tabdrop=function(i){return this.each(function(){var u=n(this),r=u.data("tabdrop"),f=typeof i=="object"&&i;r||u.data("tabdrop",r=new t(this,n.extend({},n.fn.tabdrop.defaults,f)));typeof i=="string"&&r[i]()})};n.fn.tabdrop.defaults={text:'<i class="transinfo cw-nav-menu icon-align-justify"><\/i>'};n.fn.tabdrop.Constructor=t}(window.jQuery),function(n){"use strict";function i(n,t){typeof t!="undefined"&&n.$element.prop("checked",t);var u=n.$element.is(":checked"),r=n.$textButton,i=n.$icon;i.removeClass();u?(i.addClass(i.data("onIcon")),r.removeClass("btn-default").addClass("btn-"+n.color)):(i.addClass(i.data("offIcon")),r.removeClass("btn-"+n.color).addClass("btn-default"))}function f(i){var r=!!arguments&&arguments.length>0?Array.prototype.slice.call(arguments).slice(1):[];return this.each(function(){var f=n(this),u=f.data("bs.checkboxbutton");u||f.data("bs.checkboxbutton",u=new t(this,i));typeof i=="string"&&u[i].apply(u,r)})}var u={hiddenClass:"hidden",color:"primary",buttonText:"",onIcon:"cw-toolbar-success",offIcon:"cw-toolbar-success transparent",noIcon:!1},t=function(t,i){this.$element=n(t);this.build(n.extend(u,i,this.$element.data()))},r;t.prototype.build=function(t){var r=this,u=r.$element.parent();r.$element=r.$element.detach();r.$element.addClass(t.hiddenClass);r.color=t.color;r.$textButton=n("<button/>").addClass("btn btn-"+r.color+" text").data("color",r.color).text(" "+t.buttonText);r.$iconButton=n("<button/>").addClass("btn btn-default icon");r.$iconButton.append(r.$element);r.$icon=n("<span/>").data("onIcon",t.onIcon).data("offIcon",t.offIcon);r.$iconButton.append(r.$icon);r.$wrapper=n("<div/>").addClass("btn-group button-checkbox").attr("role","group");r.$wrapper.append(r.$iconButton).append(r.$textButton);u.prepend(r.$wrapper);t.noIcon&&r.$icon.addClass(t.hiddenClass);r.$element.is(":checked")?r.$icon.addClass(t.onIcon):r.$icon.addClass(t.offIcon);r.$wrapper.on("click",function(){r.$element.prop("checked",!r.$element.is(":checked"));r.$element.triggerHandler("change");r.$element.triggerHandler("click");i(r)});r.$element.on("change",function(){i(r)});i(r)};t.prototype.destroy=function(){var n=this;n.$element.removeClass(options.hiddenClass);n.$wrapper.off("click");n.$element.off("change");n.$iconButton.remove();n.$textButton.remove();n.$icon.remove();n.$element.unwrap()};t.prototype.updateState=function(n){var t=this;i(t,n)};r=n.fn.checkboxbutton;n.fn.checkboxbutton=f;n.fn.checkboxbutton.Constructor=t;n.fn.checkboxbutton.noConflict=function(){return n.fn.checkboxbutton=r,this}}(window.jQuery),function(n){"use strict";function i(t,i){this.itemsArray=[];this.$element=n(t);this.$element.hide();this.isSelect=t.tagName==="SELECT";this.multiple=this.isSelect&&t.hasAttribute("multiple");this.objectItems=i&&i.itemValue;this.placeholderText=t.hasAttribute("placeholder")?this.$element.attr("placeholder"):"";this.inputSize=Math.max(1,this.placeholderText.length);this.$container=n('<div class="bootstrap-tagsinput"><\/div>');this.$input=n('<input type="text" placeholder="'+this.placeholderText+'"/>').appendTo(this.$container);this.$element.after(this.$container);var r=(this.inputSize<3?3:this.inputSize)+"em";this.$input.get(0).style.cssText="width: "+r+" !important;";this.build(i)}function u(n,t){if(typeof n[t]!="function"){var i=n[t];n[t]=function(n){return n[i]}}}function f(n,t){if(typeof n[t]!="function"){var i=n[t];n[t]=function(){return i}}}function t(n){return n?e.text(n).html():""}function o(n){var t=0,i;return document.selection?(n.focus(),i=document.selection.createRange(),i.moveStart("character",-n.value.length),t=i.text.length):(n.selectionStart||n.selectionStart=="0")&&(t=n.selectionStart),t}function s(t,i){var r=!1;return n.each(i,function(n,i){if(typeof i=="number"&&t.which===i)return r=!0,!1;if(t.which===i.which){var u=!i.hasOwnProperty("altKey")||t.altKey===i.altKey,f=!i.hasOwnProperty("shiftKey")||t.shiftKey===i.shiftKey,e=!i.hasOwnProperty("ctrlKey")||t.ctrlKey===i.ctrlKey;if(u&&f&&e)return r=!0,!1}}),r}var r={tagClass:function(){return"label label-info"},itemValue:function(n){return n?n.toString():n},itemText:function(n){return this.itemValue(n)},freeInput:!0,addOnBlur:!0,maxTags:undefined,maxChars:undefined,confirmKeys:[13,44],onTagExists:function(n,t){t.hide().fadeIn()},trimValue:!1,allowDuplicates:!1},e;i.prototype={constructor:i,add:function(i,r){var u=this,f,e,v,c,o,s;if((!u.options.maxTags||!(u.itemsArray.length>=u.options.maxTags))&&(i===!1||i)){if(typeof i=="string"&&u.options.trimValue&&(i=n.trim(i)),typeof i=="object"&&!u.objectItems)throw"Can't add objects when itemValue option is not set";if(!i.toString().match(/^\s*$/)){if(u.isSelect&&!u.multiple&&u.itemsArray.length>0&&u.remove(u.itemsArray[0]),typeof i=="string"&&this.$element[0].tagName==="INPUT"&&(f=i.split(","),f.length>1)){for(e=0;e<f.length;e++)this.add(f[e],!0);r||u.pushVal();return}var h=u.options.itemValue(i),l=u.options.itemText(i),y=u.options.tagClass(i),a=n.grep(u.itemsArray,function(n){return u.options.itemValue(n)===h})[0];if(a&&!u.options.allowDuplicates){if(u.options.onTagExists){v=n(".tag",u.$container).filter(function(){return n(this).data("item")===a});u.options.onTagExists(i,v)}return}u.items().toString().length+i.length+1>u.options.maxInputLength||(c=n.Event("beforeItemAdd",{item:i,cancel:!1}),u.$element.trigger(c),c.cancel)||(u.itemsArray.push(i),o=n('<span class="tag '+t(y)+'">'+t(l)+'<span data-role="remove"><\/span><\/span>'),o.data("item",i),u.findInputWrapper().before(o),o.after(" "),u.isSelect&&!n('option[value="'+encodeURIComponent(h)+'"]',u.$element)[0]&&(s=n("<option selected>"+t(l)+"<\/option>"),s.data("item",i),s.attr("value",h),u.$element.append(s)),r||u.pushVal(),(u.options.maxTags===u.itemsArray.length||u.items().toString().length===u.options.maxInputLength)&&u.$container.addClass("bootstrap-tagsinput-max"),u.$element.trigger(n.Event("itemAdded",{item:i})))}}},remove:function(t,i){var r=this,u;if(r.objectItems&&(t=typeof t=="object"?n.grep(r.itemsArray,function(n){return r.options.itemValue(n)==r.options.itemValue(t)}):n.grep(r.itemsArray,function(n){return r.options.itemValue(n)==t}),t=t[t.length-1]),t){if(u=n.Event("beforeItemRemove",{item:t,cancel:!1}),r.$element.trigger(u),u.cancel)return;n(".tag",r.$container).filter(function(){return n(this).data("item")===t}).remove();n("option",r.$element).filter(function(){return n(this).data("item")===t}).remove();n.inArray(t,r.itemsArray)!==-1&&r.itemsArray.splice(n.inArray(t,r.itemsArray),1)}i||r.pushVal();r.options.maxTags>r.itemsArray.length&&r.$container.removeClass("bootstrap-tagsinput-max");r.$element.trigger(n.Event("itemRemoved",{item:t}))},removeAll:function(){var t=this;for(n(".tag",t.$container).remove(),n("option",t.$element).remove();t.itemsArray.length>0;)t.itemsArray.pop();t.pushVal()},refresh:function(){var i=this;n(".tag",i.$container).each(function(){var r=n(this),u=r.data("item"),e=i.options.itemValue(u),o=i.options.itemText(u),s=i.options.tagClass(u),f;r.attr("class",null);r.addClass("tag "+t(s));r.contents().filter(function(){return this.nodeType==3})[0].nodeValue=t(o);i.isSelect&&(f=n("option",i.$element).filter(function(){return n(this).data("item")===u}),f.attr("value",e))})},items:function(){return this.itemsArray},pushVal:function(){var t=this,i=n.map(t.items(),function(n){return t.options.itemValue(n).toString()});t.$element.val(i,!0).trigger("change")},build:function(t){var i=this,e,h;if(i.options=n.extend({},r,t),i.objectItems&&(i.options.freeInput=!1),u(i.options,"itemValue"),u(i.options,"itemText"),f(i.options,"tagClass"),i.options.typeahead&&(e=i.options.typeahead||{},f(e,"source"),i.$input.typeahead(n.extend({},e,{source:function(t,r){function f(n){for(var u,f=[],t=0;t<n.length;t++)u=i.options.itemText(n[t]),o[u]=n[t],f.push(u);r(f)}this.map={};var o=this.map,u=e.source(t);n.isFunction(u.success)?u.success(f):n.isFunction(u.then)?u.then(f):n.when(u).then(f)},updater:function(n){i.add(this.map[n])},matcher:function(n){return n.toLowerCase().indexOf(this.query.trim().toLowerCase())!==-1},sorter:function(n){return n.sort()},highlighter:function(n){var t=new RegExp("("+this.query+")","gi");return n.replace(t,"<strong>$1<\/strong>")}}))),i.options.typeaheadjs){h=i.options.typeaheadjs||{};i.$input.typeahead(null,h).on("typeahead:selected",n.proxy(function(n,t){h.valueKey?i.add(t[h.valueKey]):i.add(t);i.$input.typeahead("val","")},i))}i.$container.on("click",n.proxy(function(){i.$element.attr("disabled")||i.$input.removeAttr("disabled");i.$input.focus()},i));if(i.options.addOnBlur&&i.options.freeInput)i.$input.on("focusout",n.proxy(function(){n(".typeahead, .twitter-typeahead",i.$container).length===0&&(i.add(i.$input.val()),i.$input.val(""))},i));i.$container.on("keydown","input",n.proxy(function(t){var r=n(t.target),u=i.findInputWrapper(),f,e,s,h;if(i.$element.attr("disabled")){i.$input.attr("disabled","disabled");return}switch(t.which){case 8:o(r[0])===0&&(f=u.prev(),f&&i.remove(f.data("item")));break;case 46:o(r[0])===0&&(e=u.next(),e&&i.remove(e.data("item")));break;case 37:s=u.prev();r.val().length===0&&s[0]&&(s.before(u),r.focus());break;case 39:h=u.next();r.val().length===0&&h[0]&&(h.after(u),r.focus())}var c=r.val().length,l=Math.ceil(c/5),a=c+l+1;r.attr("size",Math.max(this.inputSize,r.val().length))},i));i.$container.on("keypress","input",n.proxy(function(t){var r=n(t.target),u,f;if(i.$element.attr("disabled")){i.$input.attr("disabled","disabled");return}u=r.val();f=i.options.maxChars&&u.length>=i.options.maxChars;i.options.freeInput&&(s(t,i.options.confirmKeys)||f)&&(i.add(f?u.substr(0,i.options.maxChars):u),r.val(""),t.preventDefault());var e=r.val().length,o=Math.ceil(e/5),h=e+o+1;r.attr("size",Math.max(this.inputSize,r.val().length))},i));i.$container.on("click","[data-role=remove]",n.proxy(function(t){i.$element.attr("disabled")||i.remove(n(t.target).closest(".tag").data("item"))},i));i.options.itemValue===r.itemValue&&(i.$element[0].tagName==="INPUT"?i.add(i.$element.val()):n("option",i.$element).each(function(){i.add(n(this).attr("value"),!0)}))},destroy:function(){var n=this;n.$container.off("keypress","input");n.$container.off("click","[role=remove]");n.$container.remove();n.$element.removeData("tagsinput");n.$element.show()},focus:function(){this.$input.focus()},input:function(){return this.$input},findInputWrapper:function(){for(var t=this.$input[0],i=this.$container[0];t&&t.parentNode!==i;)t=t.parentNode;return n(t)}};n.fn.tagsinput=function(t,r){var u=[];return this.each(function(){var f=n(this).data("tagsinput"),e;f?t||r?f[t]!==undefined&&(e=f[t](r),e!==undefined&&u.push(e)):u.push(f):(f=new i(this,t),n(this).data("tagsinput",f),u.push(f),this.tagName==="SELECT"&&n("option",n(this)).attr("selected","selected"),n(this).val(n(this).val()))}),typeof t=="string"?u.length>1?u:u[0]:u};n.fn.tagsinput.Constructor=i;e=n("<div />");n(function(){n("input[data-role=tagsinput], select[multiple][data-role=tagsinput]").tagsinput()})}(window.jQuery),function(n){var t=function(){"use strict";return{isMsie:function(){return/(msie|trident)/i.test(navigator.userAgent)?navigator.userAgent.match(/(msie |rv:)(\d+(.\d+)?)/i)[2]:!1},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return typeof n=="string"},isNumber:function(n){return typeof n=="number"},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return typeof n=="undefined"},toStr:function(n){return t.isUndefined(n)||n===null?"":n+""},bind:n.proxy,each:function(t,i){function r(n,t){return i(t,n)}n.each(t,r)},map:n.map,filter:n.grep,every:function(t,i){var r=!0;return t?(n.each(t,function(n,u){if(!(r=i.call(null,u,n,t)))return!1}),!!r):r},some:function(t,i){var r=!1;return t?(n.each(t,function(n,u){if(r=i.call(null,u,n,t))return!1}),!!r):r},mixin:n.extend,getUniqueId:function(){var n=0;return function(){return n++}}(),templatify:function(t){function i(){return String(t)}return n.isFunction(t)?t:i},defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f=this,e=arguments,o,s;return o=function(){r=null;i||(u=n.apply(f,e))},s=i&&!r,clearTimeout(r),r=setTimeout(o,t),s&&(u=n.apply(f,e)),u}},throttle:function(n,t){var u,f,i,e,r,o;return r=0,o=function(){r=new Date;i=null;e=n.apply(u,f)},function(){var s=new Date,h=t-(s-r);return u=this,f=arguments,h<=0?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},noop:function(){}}}(),l="0.10.5",a=function(){"use strict";function n(n){return n=t.toStr(n),n?n.split(/\s+/):[]}function i(n){return n=t.toStr(n),n?n.split(/\W+/):[]}function r(n){return function(){var i=[].slice.call(arguments,0);return function(r){var u=[];return t.each(i,function(i){u=u.concat(n(t.toStr(r[i])))}),u}}}return{nonword:i,whitespace:n,obj:{nonword:r(i),whitespace:r(n)}}}(),o=function(){"use strict";function i(i){this.maxSize=t.isNumber(i)?i:100;this.reset();this.maxSize<=0&&(this.set=this.get=n.noop)}function r(){this.head=this.tail=null}function u(n,t){this.key=n;this.val=t;this.prev=this.next=null}return t.mixin(i.prototype,{set:function(n,t){var r=this.list.tail,i;this.size>=this.maxSize&&(this.list.remove(r),delete this.hash[r.key]);(i=this.hash[n])?(i.val=t,this.list.moveToFront(i)):(i=new u(n,t),this.list.add(i),this.hash[n]=i,this.size++)},get:function(n){var t=this.hash[n];if(t)return this.list.moveToFront(t),t.val},reset:function(){this.size=0;this.hash={};this.list=new r}}),t.mixin(r.prototype,{add:function(n){this.head&&(n.next=this.head,this.head.prev=n);this.head=n;this.tail=this.tail||n},remove:function(n){n.prev?n.prev.next=n.next:this.head=n.next;n.next?n.next.prev=n.prev:this.tail=n.prev},moveToFront:function(n){this.remove(n);this.add(n)}}),i}(),v=function(){"use strict";function r(n){this.prefix=["__",n,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+t.escapeRegExChars(this.prefix))}function u(){return(new Date).getTime()}function f(n){return JSON.stringify(t.isUndefined(n)?null:n)}function e(n){return JSON.parse(n)}var n,i;try{n=window.localStorage;n.setItem("~~~","!");n.removeItem("~~~")}catch(o){n=null}return i=n&&window.JSON?{_prefix:function(n){return this.prefix+n},_ttlKey:function(n){return this._prefix(n)+this.ttlKey},get:function(t){return this.isExpired(t)&&this.remove(t),e(n.getItem(this._prefix(t)))},set:function(i,r,e){return t.isNumber(e)?n.setItem(this._ttlKey(i),f(u()+e)):n.removeItem(this._ttlKey(i)),n.setItem(this._prefix(i),f(r))},remove:function(t){return n.removeItem(this._ttlKey(t)),n.removeItem(this._prefix(t)),this},clear:function(){for(var r,i=[],u=n.length,t=0;t<u;t++)(r=n.key(t)).match(this.keyMatcher)&&i.push(r.replace(this.keyMatcher,""));for(t=i.length;t--;)this.remove(i[t]);return this},isExpired:function(i){var r=e(n.getItem(this._ttlKey(i)));return t.isNumber(r)&&u()>r?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(r.prototype,i),r}(),s=function(){"use strict";function i(t){t=t||{};this.cancelled=!1;this.lastUrl=null;this._send=t.transport?s(t.transport):n.ajax;this._get=t.rateLimiter?t.rateLimiter(this._get):this._get;this._cache=t.cache===!1?new o(0):e}function s(i){return function(r,u){function e(n){t.defer(function(){f.resolve(n)})}function o(n){t.defer(function(){f.reject(n)})}var f=n.Deferred();return i(r,u,e,o),f}}var r=0,u={},f=6,e=new o(10);return i.setMaxPendingRequests=function(n){f=n},i.resetCache=function(){e.reset()},t.mixin(i.prototype,{_get:function(n,t,i){function s(t){i&&i(null,t);e._cache.set(n,t)}function h(){i&&i(!0)}function c(){r--;delete u[n];e.onDeckRequestArgs&&(e._get.apply(e,e.onDeckRequestArgs),e.onDeckRequestArgs=null)}var e=this,o;this.cancelled||n!==this.lastUrl||((o=u[n])?o.done(s).fail(h):r<f?(r++,u[n]=this._send(n,t).done(s).fail(h).always(c)):this.onDeckRequestArgs=[].slice.call(arguments,0))},get:function(n,i,r){var u;return t.isFunction(i)&&(r=i,i={}),this.cancelled=!1,this.lastUrl=n,(u=this._cache.get(n))?t.defer(function(){r&&r(null,u)}):this._get(n,i,r),!!u},cancel:function(){this.cancelled=!0}}),i}(),y=function(){"use strict";function i(t){t=t||{};t.datumTokenizer&&t.queryTokenizer||n.error("datumTokenizer and queryTokenizer are both required");this.datumTokenizer=t.datumTokenizer;this.queryTokenizer=t.queryTokenizer;this.reset()}function r(n){return n=t.filter(n,function(n){return!!n}),t.map(n,function(n){return n.toLowerCase()})}function u(){return{ids:[],children:{}}}function f(n){for(var i={},r=[],t=0,u=n.length;t<u;t++)i[n[t]]||(i[n[t]]=!0,r.push(n[t]));return r}function e(n,t){function o(n,t){return n-t}var i=0,r=0,u=[],f,e;for(n=n.sort(o),t=t.sort(o),f=n.length,e=t.length;i<f&&r<e;)n[i]<t[r]?i++:n[i]>t[r]?r++:(u.push(n[i]),i++,r++);return u}return t.mixin(i.prototype,{bootstrap:function(n){this.datums=n.datums;this.trie=n.trie},add:function(n){var i=this;n=t.isArray(n)?n:[n];t.each(n,function(n){var f,e;f=i.datums.push(n)-1;e=r(i.datumTokenizer(n));t.each(e,function(n){for(var r,t=i.trie,e=n.split("");r=e.shift();)t=t.children[r]||(t.children[r]=u()),t.ids.push(f)})})},get:function(n){var u=this,o,i;return o=r(this.queryTokenizer(n)),t.each(o,function(n){var t,r,o,f;if(i&&i.length===0)return!1;for(t=u.trie,r=n.split("");t&&(o=r.shift());)t=t.children[o];if(t&&r.length===0)f=t.ids.slice(0),i=i?e(i,f):f;else return i=[],!1}),i?t.map(f(i),function(n){return u.datums[n]}):[]},reset:function(){this.datums=[];this.trie=u()},serialize:function(){return{datums:this.datums,trie:this.trie}}}),i}(),f=function(){"use strict";function i(n){return n.local||null}function r(i){var r,u;return u={url:null,thumbprint:"",ttl:864e5,filter:null,ajax:{}},(r=i.prefetch||null)&&(r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),r.thumbprint=l+r.thumbprint,r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",r.url||n.error("prefetch requires url to be set")),r}function u(i){function f(n){return function(i){return t.debounce(i,n)}}function e(n){return function(i){return t.throttle(i,n)}}var r,u;return u={url:null,cache:!0,wildcard:"%QUERY",replace:null,rateLimitBy:"debounce",rateLimitWait:300,send:null,filter:null,ajax:{}},(r=i.remote||null)&&(r=t.isString(r)?{url:r}:r,r=t.mixin(u,r),r.rateLimiter=/^throttle$/i.test(r.rateLimitBy)?e(r.rateLimitWait):f(r.rateLimitWait),r.ajax.type=r.ajax.type||"GET",r.ajax.dataType=r.ajax.dataType||"json",delete r.rateLimitBy,delete r.rateLimitWait,r.url||n.error("remote requires url to be set")),r}return{local:i,prefetch:r,remote:u}}();(function(i){"use strict";function u(t){t&&(t.local||t.prefetch||t.remote)||n.error("one of local, prefetch, or remote is required");this.limit=t.limit||5;this.sorter=o(t.sorter);this.dupDetector=t.dupDetector||h;this.local=f.local(t);this.prefetch=f.prefetch(t);this.remote=f.remote(t);this.cacheKey=this.prefetch?this.prefetch.cacheKey||this.prefetch.url:null;this.index=new y({datumTokenizer:t.datumTokenizer,queryTokenizer:t.queryTokenizer});this.storage=this.cacheKey?new v(this.cacheKey):null}function o(n){function i(t){return t.sort(n)}function r(n){return n}return t.isFunction(n)?i:r}function h(){return!1}var e,r;return e=i.Bloodhound,r={data:"data",protocol:"protocol",thumbprint:"thumbprint"},i.Bloodhound=u,u.noConflict=function(){return i.Bloodhound=e,u},u.tokenizers=a,t.mixin(u.prototype,{_loadPrefetch:function(t){function f(n){i.clear();i.add(t.filter?t.filter(n):n);i._saveToStorage(i.index.serialize(),t.thumbprint,t.ttl)}var i=this,u,r;return(u=this._readFromStorage(t.thumbprint))?(this.index.bootstrap(u),r=n.Deferred().resolve()):r=n.ajax(t.url,t.ajax).done(f),r},_getFromRemote:function(n,t){function f(n,r){n?t([]):t(i.remote.filter?i.remote.filter(r):r)}var i=this,r,u;if(this.transport)return n=n||"",u=encodeURIComponent(n),r=this.remote.replace?this.remote.replace(this.remote.url,n):this.remote.url.replace(this.remote.wildcard,u),this.transport.get(r,this.remote.ajax,f)},_cancelLastRemoteRequest:function(){this.transport&&this.transport.cancel()},_saveToStorage:function(n,t,i){this.storage&&(this.storage.set(r.data,n,i),this.storage.set(r.protocol,location.protocol,i),this.storage.set(r.thumbprint,t,i))},_readFromStorage:function(n){var t={},i;return this.storage&&(t.data=this.storage.get(r.data),t.protocol=this.storage.get(r.protocol),t.thumbprint=this.storage.get(r.thumbprint)),i=t.thumbprint!==n||t.protocol!==location.protocol,t.data&&!i?t.data:null},_initialize:function(){function f(){u.add(t.isFunction(i)?i():i)}var u=this,i=this.local,r;return r=this.prefetch?this._loadPrefetch(this.prefetch):n.Deferred().resolve(),i&&r.done(f),this.transport=this.remote?new s(this.remote):null,this.initPromise=r.promise()},initialize:function(n){return!this.initPromise||n?this._initialize():this.initPromise},add:function(n){this.index.add(n)},get:function(n,i){function e(n){var f=r.slice(0);t.each(n,function(n){var i;return i=t.some(f,function(t){return u.dupDetector(n,t)}),i||f.push(n),f.length<u.limit});i&&i(u.sorter(f))}var u=this,r=[],f=!1;r=this.index.get(n);r=this.sorter(r).slice(0,this.limit);r.length<this.limit?f=this._getFromRemote(n,e):this._cancelLastRemoteRequest();f||(r.length>0||!this.transport)&&i&&i(r)},clear:function(){this.index.reset()},clearPrefetchCache:function(){this.storage&&this.storage.clear()},clearRemoteCache:function(){this.transport&&s.resetCache()},ttAdapter:function(){return t.bind(this.get,this)}}),u})(this);var r=function(){return{wrapper:'<span class="twitter-typeahead"><\/span>',dropdown:'<span class="tt-dropdown-menu"><\/span>',dataset:'<div class="tt-dataset-%CLASS%"><\/div>',suggestions:'<span class="tt-suggestions"><\/span>',suggestion:'<div class="tt-suggestion"><\/div>'}}(),i=function(){"use strict";var n={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:" 0"}};return t.isMsie()&&t.mixin(n.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&t.mixin(n.input,{marginTop:"-1px"}),n}(),h=function(){"use strict";function i(t){t&&t.el||n.error("EventBus initialized without el");this.$el=n(t.el)}var r="typeahead:";return t.mixin(i.prototype,{trigger:function(n){var t=[].slice.call(arguments,1);this.$el.trigger(r+n,t)}}),i}(),e=function(){"use strict";function t(t,i,r,u){var f;if(!r)return this;for(i=i.split(n),r=u?h(r,u):r,this._callbacks=this._callbacks||{};f=i.shift();)this._callbacks[f]=this._callbacks[f]||{sync:[],async:[]},this._callbacks[f][t].push(r);return this}function u(n,i,r){return t.call(this,"async",n,i,r)}function f(n,i,r){return t.call(this,"sync",n,i,r)}function e(t){var i;if(!this._callbacks)return this;for(t=t.split(n);i=t.shift();)delete this._callbacks[i];return this}function o(t){var u,f,e,o,s;if(!this._callbacks)return this;for(t=t.split(n),e=[].slice.call(arguments,1);(u=t.shift())&&(f=this._callbacks[u]);)o=i(f.sync,this,[u].concat(e)),s=i(f.async,this,[u].concat(e)),o()&&r(s);return this}function i(n,t,i){function r(){for(var r,u=0,f=n.length;!r&&u<f;u+=1)r=n[u].apply(t,i)===!1;return!r}return r}function s(){return window.setImmediate?function(n){setImmediate(function(){n()})}:function(n){setTimeout(function(){n()},0)}}function h(n,t){return n.bind?n.bind(t):function(){n.apply(t,[].slice.call(arguments,0))}}var n=/\s+/,r=s();return{onSync:f,onAsync:u,off:e,trigger:o}}(),p=function(n){"use strict";function r(n,i,r){for(var u=[],f,e=0,o=n.length;e<o;e++)u.push(t.escapeRegExChars(n[e]));return f=r?"\\b("+u.join("|")+")\\b":"("+u.join("|")+")",i?new RegExp(f):new RegExp(f,"i")}var i={node:null,pattern:null,tagName:"strong",className:null,wordsOnly:!1,caseSensitive:!1};return function(u){function o(t){var i,r,e;return(i=f.exec(t.data))&&(e=n.createElement(u.tagName),u.className&&(e.className=u.className),r=t.splitText(i.index),r.splitText(i[0].length),e.appendChild(r.cloneNode(!0)),t.parentNode.replaceChild(e,r)),!!i}function e(n,t){for(var i,r=0;r<n.childNodes.length;r++)i=n.childNodes[r],i.nodeType===3?r+=t(i)?1:0:e(i,t)}var f;(u=t.mixin({},i,u),u.node&&u.pattern)&&(u.pattern=t.isArray(u.pattern)?u.pattern:[u.pattern],f=r(u.pattern,u.caseSensitive,u.wordsOnly),e(u.node,o))}}(window.document),c=function(){"use strict";function i(i){var f=this,e,o,s,h;if(i=i||{},i.input||n.error("input is missing"),e=t.bind(this._onBlur,this),o=t.bind(this._onFocus,this),s=t.bind(this._onKeydown,this),h=t.bind(this._onInput,this),this.$hint=n(i.hint),this.$input=n(i.input).on("blur.tt",e).on("focus.tt",o).on("keydown.tt",s),this.$hint.length===0&&(this.setHint=this.getHint=this.clearHint=this.clearHintIfInvalid=t.noop),t.isMsie())this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(n){r[n.which||n.keyCode]||t.defer(t.bind(f._onInput,f,n))});else this.$input.on("input.tt",h);this.query=this.$input.val();this.$overflowHelper=u(this.$input)}function u(t){return n('<pre aria-hidden="true"><\/pre>').css({position:"absolute",visibility:"hidden",whiteSpace:"pre",fontFamily:t.css("font-family"),fontSize:t.css("font-size"),fontStyle:t.css("font-style"),fontVariant:t.css("font-variant"),fontWeight:t.css("font-weight"),wordSpacing:t.css("word-spacing"),letterSpacing:t.css("letter-spacing"),textIndent:t.css("text-indent"),textRendering:t.css("text-rendering"),textTransform:t.css("text-transform")}).insertAfter(t)}function f(n,t){return i.normalizeQuery(n)===i.normalizeQuery(t)}function o(n){return n.altKey||n.ctrlKey||n.metaKey||n.shiftKey}var r;return r={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"},i.normalizeQuery=function(n){return(n||"").replace(/^\s*/g,"").replace(/\s{2,}/g," ")},t.mixin(i.prototype,e,{_onBlur:function(){this.resetInputValue();this.trigger("blurred")},_onFocus:function(){this.trigger("focused")},_onKeydown:function(n){var t=r[n.which||n.keyCode];this._managePreventDefault(t,n);t&&this._shouldTrigger(t,n)&&this.trigger(t+"Keyed",n)},_onInput:function(){this._checkInputValue()},_managePreventDefault:function(n,t){var i;switch(n){case"tab":break;case"up":case"down":i=!o(t);break;default:i=!1}i&&t.preventDefault()},_shouldTrigger:function(n){var t;switch(n){case"tab":break;default:t=!0}return t},_checkInputValue:function(){var n,t,i;n=this.getInputValue();t=f(n,this.query);i=t?this.query.length!==n.length:!1;this.query=n;t?i&&this.trigger("whitespaceChanged",this.query):this.trigger("queryChanged",this.query)},focus:function(){this.$input.focus()},blur:function(){this.$input.blur()},getQuery:function(){return this.query},setQuery:function(n){this.query=n},getInputValue:function(){return this.$input.val()},setInputValue:function(n,t){this.$input.val(n);t?this.clearHint():this._checkInputValue()},resetInputValue:function(){this.setInputValue(this.query,!0)},getHint:function(){return this.$hint.val()},setHint:function(n){this.$hint.val(n)},clearHint:function(){this.setHint("")},clearHintIfInvalid:function(){var n,t,i,r;n=this.getInputValue();t=this.getHint();i=n!==t&&t.indexOf(n)===0;r=n!==""&&i&&!this.hasOverflow();r||this.clearHint()},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},hasOverflow:function(){var n=this.$input.width()-2;return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>=n},isCursorAtEnd:function(){var n,i,r;return(n=this.$input.val().length,i=this.$input[0].selectionStart,t.isNumber(i))?i===n:document.selection?(r=document.selection.createRange(),r.moveStart("character",-n),n===r.text.length):!0},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$hint=this.$input=this.$overflowHelper=null}}),i}(),u=function(){"use strict";function u(i){i=i||{};i.templates=i.templates||{};i.source||n.error("missing source");i.name&&!l(i.name)&&n.error("invalid dataset name: "+i.name);this.query=null;this.highlight=!!i.highlight;this.name=i.name||t.getUniqueId();this.source=i.source;this.displayFn=h(i.display||i.displayKey);this.templates=c(i.templates,this.displayFn);this.$el=n(r.dataset.replace("%CLASS%",this.name))}function h(n){function i(t){return t[n]}return n=n||"value",t.isFunction(n)?n:i}function c(n,i){function r(n){return"<p>"+i(n)+"<\/p>"}return{empty:n.empty&&t.templatify(n.empty),header:n.header&&t.templatify(n.header),footer:n.footer&&t.templatify(n.footer),suggestion:n.suggestion||r}}function l(n){return/^[_a-zA-Z0-9-]+$/.test(n)}var f="ttDataset",o="ttValue",s="ttDatum";return u.extractDatasetName=function(t){return n(t).data(f)},u.extractValue=function(t){return n(t).data(o)},u.extractDatum=function(t){return n(t).data(s)},t.mixin(u.prototype,e,{_render:function(u,e){function v(){return h.templates.empty({query:u,isEmpty:!0})}function y(){function a(t){var u;return u=n(r.suggestion).append(h.templates.suggestion(t)).data(f,h.name).data(o,h.displayFn(t)).data(s,t),u.children().each(function(){n(this).css(i.suggestionChild)}),u}var c,l;return c=n(r.suggestions).css(i.suggestions),l=t.map(e,a),c.append.apply(c,l),h.highlight&&p({className:"tt-highlight",node:c[0],pattern:u}),c}function l(){return h.templates.header({query:u,isEmpty:!c})}function a(){return h.templates.footer({query:u,isEmpty:!c})}if(this.$el){var h=this,c;this.$el.empty();c=e&&e.length;!c&&this.templates.empty?this.$el.html(v()).prepend(h.templates.header?l():null).append(h.templates.footer?a():null):c&&this.$el.html(y()).prepend(h.templates.header?l():null).append(h.templates.footer?a():null);this.trigger("rendered")}},getRoot:function(){return this.$el},update:function(n){function i(i){t.canceled||n!==t.query||t._render(n,i)}var t=this;this.query=n;this.canceled=!1;this.source(n,i)},cancel:function(){this.canceled=!0},clear:function(){this.cancel();this.$el.empty();this.trigger("rendered")},isEmpty:function(){return this.$el.is(":empty")},destroy:function(){this.$el=null}}),u}(),w=function(){"use strict";function r(i){var r=this,u,e,o;i=i||{};i.menu||n.error("menu is required");this.isOpen=!1;this.isEmpty=!0;this.datasets=t.map(i.datasets,f);u=t.bind(this._onSuggestionClick,this);e=t.bind(this._onSuggestionMouseEnter,this);o=t.bind(this._onSuggestionMouseLeave,this);this.$menu=n(i.menu).on("click.tt",".tt-suggestion",u).on("mouseenter.tt",".tt-suggestion",e).on("mouseleave.tt",".tt-suggestion",o);t.each(this.datasets,function(n){r.$menu.append(n.getRoot());n.onSync("rendered",r._onRendered,r)})}function f(n){return new u(n)}return t.mixin(r.prototype,e,{_onSuggestionClick:function(t){this.trigger("suggestionClicked",n(t.currentTarget))},_onSuggestionMouseEnter:function(t){this._removeCursor();this._setCursor(n(t.currentTarget),!0)},_onSuggestionMouseLeave:function(){this._removeCursor()},_onRendered:function(){function n(n){return n.isEmpty()}this.isEmpty=t.every(this.datasets,n);this.isEmpty?this._hide():this.isOpen&&this._show();this.trigger("datasetRendered")},_hide:function(){this.$menu.hide()},_show:function(){this.$menu.css("display","block")},_getSuggestions:function(){return this.$menu.find(".tt-suggestion")},_getCursor:function(){return this.$menu.find(".tt-cursor").first()},_setCursor:function(n,t){n.first().addClass("tt-cursor");t||this.trigger("cursorMoved")},_removeCursor:function(){this._getCursor().removeClass("tt-cursor")},_moveCursor:function(n){var i,r,t,u;if(this.isOpen){if(r=this._getCursor(),i=this._getSuggestions(),this._removeCursor(),t=i.index(r)+n,t=(t+1)%(i.length+1)-1,t===-1){this.trigger("cursorRemoved");return}t<-1&&(t=i.length-1);this._setCursor(u=i.eq(t));this._ensureVisible(u)}},_ensureVisible:function(n){var t,i,r,u;t=n.position().top;i=t+n.outerHeight(!0);r=this.$menu.scrollTop();u=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10);t<0?this.$menu.scrollTop(r+t):u<i&&this.$menu.scrollTop(r+(i-u))},close:function(){this.isOpen&&(this.isOpen=!1,this._removeCursor(),this._hide(),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,this.isEmpty||this._show(),this.trigger("opened"))},setLanguageDirection:function(n){this.$menu.css(n==="ltr"?i.ltr:i.rtl)},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getDatumForSuggestion:function(n){var t=null;return n.length&&(t={raw:u.extractDatum(n),value:u.extractValue(n),datasetName:u.extractDatasetName(n)}),t},getDatumForCursor:function(){return this.getDatumForSuggestion(this._getCursor().first())},getDatumForTopSuggestion:function(){return this.getDatumForSuggestion(this._getSuggestions().first())},update:function(n){function i(t){t.update(n)}t.each(this.datasets,i)},empty:function(){function n(n){n.clear()}t.each(this.datasets,n);this.isEmpty=!0},isVisible:function(){return this.isOpen&&!this.isEmpty},destroy:function(){function n(n){n.destroy()}this.$menu.off(".tt");this.$menu=null;t.each(this.datasets,n)}}),r}(),b=function(){"use strict";function f(i){var r,u,f;i=i||{};i.input||n.error("missing input");this.isActivated=!1;this.autoselect=!!i.autoselect;this.minLength=t.isNumber(i.minLength)?i.minLength:1;this.$node=e(i.input,i.withHint);r=this.$node.find(".tt-dropdown-menu");u=this.$node.find(".tt-input");f=this.$node.find(".tt-hint");u.on("blur.tt",function(n){var i,f,e;i=document.activeElement;f=r.is(i);e=r.has(i).length>0;t.isMsie()&&(f||e)&&(n.preventDefault(),n.stopImmediatePropagation(),t.defer(function(){u.focus()}))});r.on("mousedown.tt",function(n){n.preventDefault()});this.eventBus=i.eventBus||new h({el:u});this.dropdown=new w({menu:r,datasets:i.datasets}).onSync("suggestionClicked",this._onSuggestionClicked,this).onSync("cursorMoved",this._onCursorMoved,this).onSync("cursorRemoved",this._onCursorRemoved,this).onSync("opened",this._onOpened,this).onSync("closed",this._onClosed,this).onAsync("datasetRendered",this._onDatasetRendered,this);this.input=new c({input:u,hint:f}).onSync("focused",this._onFocused,this).onSync("blurred",this._onBlurred,this).onSync("enterKeyed",this._onEnterKeyed,this).onSync("tabKeyed",this._onTabKeyed,this).onSync("escKeyed",this._onEscKeyed,this).onSync("upKeyed",this._onUpKeyed,this).onSync("downKeyed",this._onDownKeyed,this).onSync("leftKeyed",this._onLeftKeyed,this).onSync("rightKeyed",this._onRightKeyed,this).onSync("queryChanged",this._onQueryChanged,this).onSync("whitespaceChanged",this._onWhitespaceChanged,this);this._setLanguageDirection()}function e(t,f){var e,h,c,s;e=n(t);h=n(r.wrapper).css(i.wrapper);c=n(r.dropdown).css(i.dropdown);s=e.clone().css(i.hint).css(o(e));s.val("").removeData().addClass("tt-hint").removeAttr("id name placeholder required").prop("readonly",!0).attr({autocomplete:"off",spellcheck:"false",tabindex:-1});e.data(u,{dir:e.attr("dir"),autocomplete:e.attr("autocomplete"),spellcheck:e.attr("spellcheck"),style:e.attr("style")});e.addClass("tt-input").attr({autocomplete:"off",spellcheck:!1}).css(f?i.input:i.inputWithNoHint);try{e.attr("dir")||e.attr("dir","auto")}catch(l){}return e.wrap(h).parent().prepend(f?s:null).append(c)}function o(n){return{backgroundAttachment:n.css("background-attachment"),backgroundClip:n.css("background-clip"),backgroundColor:n.css("background-color"),backgroundImage:n.css("background-image"),backgroundOrigin:n.css("background-origin"),backgroundPosition:n.css("background-position"),backgroundRepeat:n.css("background-repeat"),backgroundSize:n.css("background-size")}}function s(n){var i=n.find(".tt-input");t.each(i.data(u),function(n,r){t.isUndefined(n)?i.removeAttr(r):i.attr(r,n)});i.detach().removeData(u).removeClass("tt-input").insertAfter(n);n.remove()}var u="ttAttrs";return t.mixin(f.prototype,{_onSuggestionClicked:function(n,t){var i;(i=this.dropdown.getDatumForSuggestion(t))&&this._select(i)},_onCursorMoved:function(){var n=this.dropdown.getDatumForCursor();this.input.setInputValue(n.value,!0);this.eventBus.trigger("cursorchanged",n.raw,n.datasetName)},_onCursorRemoved:function(){this.input.resetInputValue();this._updateHint()},_onDatasetRendered:function(){this._updateHint()},_onOpened:function(){this._updateHint();this.eventBus.trigger("opened")},_onClosed:function(){this.input.clearHint();this.eventBus.trigger("closed")},_onFocused:function(){this.isActivated=!0;this.dropdown.open()},_onBlurred:function(){this.isActivated=!1;this.dropdown.empty();this.dropdown.close()},_onEnterKeyed:function(n,t){var i,r;i=this.dropdown.getDatumForCursor();r=this.dropdown.getDatumForTopSuggestion();i?(this._select(i),t.preventDefault()):this.autoselect&&r&&(this._select(r),t.preventDefault())},_onTabKeyed:function(n,t){var i;(i=this.dropdown.getDatumForCursor())?(this._select(i),t.preventDefault()):this._autocomplete(!0)},_onEscKeyed:function(){this.dropdown.close();this.input.resetInputValue()},_onUpKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorUp();this.dropdown.open()},_onDownKeyed:function(){var n=this.input.getQuery();this.dropdown.isEmpty&&n.length>=this.minLength?this.dropdown.update(n):this.dropdown.moveCursorDown();this.dropdown.open()},_onLeftKeyed:function(){this.dir==="rtl"&&this._autocomplete()},_onRightKeyed:function(){this.dir==="ltr"&&this._autocomplete()},_onQueryChanged:function(n,t){this.input.clearHintIfInvalid();t.length>=this.minLength?this.dropdown.update(t):this.dropdown.empty();this.dropdown.open();this._setLanguageDirection()},_onWhitespaceChanged:function(){this._updateHint();this.dropdown.open()},_setLanguageDirection:function(){var n;this.dir!==(n=this.input.getLanguageDirection())&&(this.dir=n,this.$node.css("direction",n),this.dropdown.setLanguageDirection(n))},_updateHint:function(){var n,i,u,f,e,r;n=this.dropdown.getDatumForTopSuggestion();n&&this.dropdown.isVisible()&&!this.input.hasOverflow()?(i=this.input.getInputValue(),u=c.normalizeQuery(i),f=t.escapeRegExChars(u),e=new RegExp("^(?:"+f+")(.+$)","i"),r=e.exec(n.value),r?this.input.setHint(i+r[1]):this.input.clearHint()):this.input.clearHint()},_autocomplete:function(n){var i,r,u,t;i=this.input.getHint();r=this.input.getQuery();u=n||this.input.isCursorAtEnd();i&&r!==i&&u&&(t=this.dropdown.getDatumForTopSuggestion(),t&&this.input.setInputValue(t.value),this.eventBus.trigger("autocompleted",t.raw,t.datasetName))},_select:function(n){this.input.setQuery(n.value);this.input.setInputValue(n.value,!0);this._setLanguageDirection();this.eventBus.trigger("selected",n.raw,n.datasetName);this.dropdown.close();t.defer(t.bind(this.dropdown.empty,this.dropdown))},open:function(){this.dropdown.open()},close:function(){this.dropdown.close()},setVal:function(n){n=t.toStr(n);this.isActivated?this.input.setInputValue(n):(this.input.setQuery(n),this.input.setInputValue(n,!0));this._setLanguageDirection()},getVal:function(){return this.input.getQuery()},destroy:function(){this.input.destroy();this.dropdown.destroy();s(this.$node);this.$node=null}}),f}();(function(){"use strict";var u,i,r;u=n.fn.typeahead;i="ttTypeahead";r={initialize:function(r,u){function f(){var f=n(this),o,e;t.each(u,function(n){n.highlight=!!r.highlight});e=new b({input:f,eventBus:o=new h({el:f}),withHint:t.isUndefined(r.hint)?!0:!!r.hint,minLength:r.minLength,autoselect:r.autoselect,datasets:u});f.data(i,e)}return u=t.isArray(u)?u:[].slice.call(arguments,1),r=r||{},this.each(f)},open:function(){function t(){var r=n(this),t;(t=r.data(i))&&t.open()}return this.each(t)},close:function(){function t(){var r=n(this),t;(t=r.data(i))&&t.close()}return this.each(t)},val:function(t){function r(){var u=n(this),r;(r=u.data(i))&&r.setVal(t)}function u(n){var t,r;return(t=n.data(i))&&(r=t.getVal()),r}return arguments.length?this.each(r):u(this.first())},destroy:function(){function t(){var t=n(this),r;(r=t.data(i))&&(r.destroy(),t.removeData(i))}return this.each(t)}};n.fn.typeahead=function(t){var u;return r[t]&&t!=="initialize"?(u=this.filter(function(){return!!n(this).data(i)}),r[t].apply(u,[].slice.call(arguments,1))):r.initialize.apply(this,arguments)};n.fn.typeahead.noConflict=function(){return n.fn.typeahead=u,this}})()}(window.jQuery),function(){var n=!0;(function(t){var u=this||eval("this"),r=u.document,e=u.navigator,i=u.jQuery,f=u.JSON;(function(n){if(typeof require=="function"&&typeof exports=="object"&&typeof module=="object"){var t=module.exports||exports;n(t)}else typeof define=="function"&&define.amd?define(["exports"],n):n(u.ko={})})(function(o){function p(n,t){var i=n===null||typeof n in nt;return i?n===t:!1}function tt(n,i){var r;return function(){r||(r=setTimeout(function(){r=t;n()},i))}}function it(n,t){var i;return function(){clearTimeout(i);i=setTimeout(n,t)}}function rt(n){var t=this;return n&&s.utils.objectForEach(n,function(n,i){var r=s.extenders[n];typeof r=="function"&&(t=r(t,i)||t)}),t}function ut(n){s.bindingHandlers[n]={init:function(t,i,r,u,f){var e=function(){var t={};return t[n]=i(),t};return s.bindingHandlers.event.init.call(this,t,e,r,u,f)}}}function g(n,t,i,r){s.bindingHandlers[n]={init:function(n,u,f,e,o){var c,h;return s.computed(function(){var l=s.utils.unwrapObservable(u()),f=!i!=!l,e=!h,a=e||t||f!==c;a&&(e&&s.computedContext.getDependenciesCount()&&(h=s.utils.cloneNodes(s.virtualElements.childNodes(n),!0)),f?(e||s.virtualElements.setDomNodeChildren(n,s.utils.cloneNodes(h)),s.applyBindingsToDescendants(r?r(o,l):o,n)):s.virtualElements.emptyNode(n),c=f)},null,{disposeWhenNodeIsRemoved:n}),{controlsDescendantBindings:!0}}};s.expressionRewriting.bindingRewriteValidators[n]=!1;s.virtualElements.allowedBindings[n]=!0}var s=typeof o!="undefined"?o:{},nt,l,h,c,a,w,b,k,v,d,y;s.exportSymbol=function(n,t){for(var i=n.split("."),r=s,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};s.exportProperty=function(n,t,i){n[t]=i};s.version="3.1.0";s.exportSymbol("version",s.version);s.utils=function(){function o(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function c(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n}function l(n,t){return n.__proto__=t,n}function k(n,t){if(s.utils.tagNameLower(n)!=="input"||!n.type||t.toLowerCase()!="click")return!1;var i=n.type;return i=="checkbox"||i=="radio"}var a={__proto__:[]}instanceof Array,h={},v={},y=e&&/Firefox\/2/i.test(e.userAgent)?"KeyboardEvent":"UIEvents";h[y]=["keyup","keydown","keypress"];h.MouseEvents=["click","dblclick","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave"];o(h,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)v[t[i]]=n});var p={propertychange:!0},n=r&&function(){for(var n=3,i=r.createElement("div"),u=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->",u[0];);return n>4?n:t}(),w=n===6,b=n===7;return{fieldsIncludedWithJsonPost:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],arrayForEach:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i],i)},arrayIndexOf:function(n,t){if(typeof Array.prototype.indexOf=="function")return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},arrayFirst:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r],r))return n[r];return null},arrayRemoveItem:function(n,t){var i=s.utils.arrayIndexOf(n,t);i>0?n.splice(i,1):i===0&&n.shift()},arrayGetDistinctValues:function(n){var i,t,r;for(n=n||[],i=[],t=0,r=n.length;t<r;t++)s.utils.arrayIndexOf(i,n[t])<0&&i.push(n[t]);return i},arrayMap:function(n,t){var r,i,u;for(n=n||[],r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i],i));return r},arrayFilter:function(n,t){var r,i,u;for(n=n||[],r=[],i=0,u=n.length;i<u;i++)t(n[i],i)&&r.push(n[i]);return r},arrayPushAll:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},addOrRemoveItem:function(n,t,i){var r=s.utils.arrayIndexOf(s.utils.peekObservable(n),t);r<0?i&&n.push(t):i||n.splice(r,1)},canSetPrototype:a,extend:c,setPrototypeOf:l,setPrototypeOfOrExtend:a?l:c,objectForEach:o,objectMap:function(n,t){var r,i;if(!n)return n;r={};for(i in n)n.hasOwnProperty(i)&&(r[i]=t(n[i],i,n));return r},emptyDomNode:function(n){while(n.firstChild)s.removeNode(n.firstChild)},moveCleanedNodesToContainerElement:function(n){for(var i=s.utils.makeArray(n),u=r.createElement("div"),t=0,f=i.length;t<f;t++)u.appendChild(s.cleanNode(i[t]));return u},cloneNodes:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?s.cleanNode(r):r);return u},setDomNodeChildren:function(n,t){if(s.utils.emptyDomNode(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},replaceDomNodes:function(n,t){var r=n.nodeType?[n]:n,f,e,i,u;if(r.length>0){for(f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)s.removeNode(r[i])}},fixUpContinuousNodeArray:function(n,t){if(n.length){for(t=t.nodeType===8&&t.parentNode||t;n.length&&n[0].parentNode!==t;)n.shift();if(n.length>1){var i=n[0],r=n[n.length-1];for(n.length=0;i!==r;)if(n.push(i),i=i.nextSibling,!i)return;n.push(r)}}return n},setOptionNodeSelectionState:function(t,i){n<7?t.setAttribute("selected",i):t.selected=i},stringTrim:function(n){return n===null||n===t?"":n.trim?n.trim():n.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},stringTokenize:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=s.utils.stringTrim(f[i]),r!==""&&u.push(r);return u},stringStartsWith:function(n,t){return(n=n||"",t.length>n.length)?!1:n.substring(0,t.length)===t},domNodeIsContainedBy:function(n,t){if(n===t)return!0;if(n.nodeType===11)return!1;if(t.contains)return t.contains(n.nodeType===3?n.parentNode:n);if(t.compareDocumentPosition)return(t.compareDocumentPosition(n)&16)==16;while(n&&n!=t)n=n.parentNode;return!!n},domNodeIsAttachedToDocument:function(n){return s.utils.domNodeIsContainedBy(n,n.ownerDocument.documentElement)},anyDomNodeIsAttachedToDocument:function(n){return!!s.utils.arrayFirst(n,s.utils.domNodeIsAttachedToDocument)},tagNameLower:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},registerEventHandler:function(t,r,u){var o=n&&p[r],f,e;if(!o&&i)i(t).bind(r,u);else if(o||typeof t.addEventListener!="function")if(typeof t.attachEvent!="undefined")f=function(n){u.call(t,n)},e="on"+r,t.attachEvent(e,f),s.utils.domNodeDisposal.addDisposeCallback(t,function(){t.detachEvent(e,f)});else throw new Error("Browser doesn't support addEventListener or attachEvent");else t.addEventListener(r,u,!1)},triggerEvent:function(n,t){var f,o,e;if(!(n&&n.nodeType))throw new Error("element must be a DOM node when calling triggerEvent");if(f=k(n,t),i&&!f)i(n).trigger(t);else if(typeof r.createEvent=="function")if(typeof n.dispatchEvent=="function")o=v[t]||"HTMLEvents",e=r.createEvent(o),e.initEvent(t,!0,!0,u,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(e);else throw new Error("The supplied element doesn't support dispatchEvent");else if(f&&n.click)n.click();else if(typeof n.fireEvent!="undefined")n.fireEvent("on"+t);else throw new Error("Browser doesn't support triggering events");},unwrapObservable:function(n){return s.isObservable(n)?n():n},peekObservable:function(n){return s.isObservable(n)?n.peek():n},toggleDomNodeCssClass:function(n,t,i){if(t){var r=/\S+/g,u=n.className.match(r)||[];s.utils.arrayForEach(t.match(r),function(n){s.utils.addOrRemoveItem(u,n,i)});n.className=u.join(" ")}},setTextContent:function(n,i){var r=s.utils.unwrapObservable(i),u;(r===null||r===t)&&(r="");u=s.virtualElements.firstChild(n);!u||u.nodeType!=3||s.virtualElements.nextSibling(u)?s.virtualElements.setDomNodeChildren(n,[n.ownerDocument.createTextNode(r)]):u.data=r;s.utils.forceRefresh(n)},setElementName:function(t,i){if(t.name=i,n<=7)try{t.mergeAttributes(r.createElement("<input name='"+t.name+"'/>"),!1)}catch(u){}},forceRefresh:function(t){if(n>=9){var i=t.nodeType==1?t:t.parentNode;i.style&&(i.style.zoom=i.style.zoom)}},ensureSelectElementIsRenderedCorrectly:function(t){if(n){var i=t.style.width;t.style.width=0;t.style.width=i}},range:function(n,t){var r,i;for(n=s.utils.unwrapObservable(n),t=s.utils.unwrapObservable(t),r=[],i=n;i<=t;i++)r.push(i);return r},makeArray:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},isIe6:w,isIe7:b,ieVersion:n,getFormFields:function(n,t){for(var r=s.utils.makeArray(n.getElementsByTagName("input")).concat(s.utils.makeArray(n.getElementsByTagName("textarea"))),f=typeof t=="string"?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;i>=0;i--)f(r[i])&&u.push(r[i]);return u},parseJson:function(n){return typeof n=="string"&&(n=s.utils.stringTrim(n),n)?f&&f.parse?f.parse(n):new Function("return "+n)():null},stringifyJson:function(n,t,i){if(!f||!f.stringify)throw new Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return f.stringify(s.utils.unwrapObservable(n),t,i)},postJson:function(n,t,i){var l,e,h,f,u,a,c;i=i||{};var v=i.params||{},y=i.includeFields||this.fieldsIncludedWithJsonPost,p=n;if(typeof n=="object"&&s.utils.tagNameLower(n)==="form")for(l=n,p=l.action,e=y.length-1;e>=0;e--)for(h=s.utils.getFormFields(l,y[e]),f=h.length-1;f>=0;f--)v[h[f].name]=h[f].value;t=s.utils.unwrapObservable(t);u=r.createElement("form");u.style.display="none";u.action=p;u.method="post";for(a in t)c=r.createElement("input"),c.name=a,c.value=s.utils.stringifyJson(s.utils.unwrapObservable(t[a])),u.appendChild(c);o(v,function(n,t){var i=r.createElement("input");i.name=n;i.value=t;u.appendChild(i)});r.body.appendChild(u);i.submitter?i.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();s.exportSymbol("utils",s.utils);s.exportSymbol("utils.arrayForEach",s.utils.arrayForEach);s.exportSymbol("utils.arrayFirst",s.utils.arrayFirst);s.exportSymbol("utils.arrayFilter",s.utils.arrayFilter);s.exportSymbol("utils.arrayGetDistinctValues",s.utils.arrayGetDistinctValues);s.exportSymbol("utils.arrayIndexOf",s.utils.arrayIndexOf);s.exportSymbol("utils.arrayMap",s.utils.arrayMap);s.exportSymbol("utils.arrayPushAll",s.utils.arrayPushAll);s.exportSymbol("utils.arrayRemoveItem",s.utils.arrayRemoveItem);s.exportSymbol("utils.extend",s.utils.extend);s.exportSymbol("utils.fieldsIncludedWithJsonPost",s.utils.fieldsIncludedWithJsonPost);s.exportSymbol("utils.getFormFields",s.utils.getFormFields);s.exportSymbol("utils.peekObservable",s.utils.peekObservable);s.exportSymbol("utils.postJson",s.utils.postJson);s.exportSymbol("utils.parseJson",s.utils.parseJson);s.exportSymbol("utils.registerEventHandler",s.utils.registerEventHandler);s.exportSymbol("utils.stringifyJson",s.utils.stringifyJson);s.exportSymbol("utils.range",s.utils.range);s.exportSymbol("utils.toggleDomNodeCssClass",s.utils.toggleDomNodeCssClass);s.exportSymbol("utils.triggerEvent",s.utils.triggerEvent);s.exportSymbol("utils.unwrapObservable",s.utils.unwrapObservable);s.exportSymbol("utils.objectForEach",s.utils.objectForEach);s.exportSymbol("utils.addOrRemoveItem",s.utils.addOrRemoveItem);s.exportSymbol("unwrap",s.utils.unwrapObservable);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments),n=t.shift();return function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});s.utils.domData=new function(){function r(r,f){var e=r[n],o=e&&e!=="null"&&i[e];if(!o){if(!f)return t;e=r[n]="ko"+u++;i[e]={}}return i[e]}var u=0,n="__ko__"+(new Date).getTime(),i={};return{get:function(n,i){var u=r(n,!1);return u===t?t:u[i]},set:function(n,i,u){if(u!==t||r(n,!1)!==t){var f=r(n,!0);f[i]=u}},clear:function(t){var r=t[n];return r?(delete i[r],t[n]=null,!0):!1},nextKey:function(){return u+++n}}};s.exportSymbol("utils.domData",s.utils.domData);s.exportSymbol("utils.domData.clear",s.utils.domData.clear);s.utils.domNodeDisposal=new function(){function r(i,r){var u=s.utils.domData.get(i,n);return u===t&&r&&(u=[],s.utils.domData.set(i,n,u)),u}function o(i){s.utils.domData.set(i,n,t)}function u(n){var t=r(n,!1),i;if(t)for(t=t.slice(0),i=0;i<t.length;i++)t[i](n);s.utils.domData.clear(n);s.utils.domNodeDisposal.cleanExternalData(n);f[n.nodeType]&&h(n)}function h(n){for(var t,i=n.firstChild;t=i;)i=t.nextSibling,t.nodeType===8&&u(t)}var n=s.utils.domData.nextKey(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{addDisposeCallback:function(n,t){if(typeof t!="function")throw new Error("Callback must be a function");r(n,!0).push(t)},removeDisposeCallback:function(n,t){var i=r(n,!1);i&&(s.utils.arrayRemoveItem(i,t),i.length==0&&o(n))},cleanNode:function(n){var t,i,r;if(e[n.nodeType]&&(u(n),f[n.nodeType]))for(t=[],s.utils.arrayPushAll(t,n.getElementsByTagName("*")),i=0,r=t.length;i<r;i++)u(t[i]);return n},removeNode:function(n){s.cleanNode(n);n.parentNode&&n.parentNode.removeChild(n)},cleanExternalData:function(n){i&&typeof i.cleanData=="function"&&i.cleanData([n])}}};s.cleanNode=s.utils.domNodeDisposal.cleanNode;s.removeNode=s.utils.domNodeDisposal.removeNode;s.exportSymbol("cleanNode",s.cleanNode);s.exportSymbol("removeNode",s.removeNode);s.exportSymbol("utils.domNodeDisposal",s.utils.domNodeDisposal);s.exportSymbol("utils.domNodeDisposal.addDisposeCallback",s.utils.domNodeDisposal.addDisposeCallback);s.exportSymbol("utils.domNodeDisposal.removeDisposeCallback",s.utils.domNodeDisposal.removeDisposeCallback),function(){function n(n){var i=s.utils.stringTrim(n).toLowerCase(),t=r.createElement("div"),f=i.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],e="ignored<div>"+f[1]+n+f[2]+"<\/div>";for(typeof u.innerShiv=="function"?t.appendChild(u.innerShiv(e)):t.innerHTML=e;f[0]--;)t=t.lastChild;return s.utils.makeArray(t.lastChild.childNodes)}function f(n){var r,t;if(i.parseHTML)return i.parseHTML(n)||[];if(r=i.clean([n]),r&&r[0]){for(t=r[0];t.parentNode&&t.parentNode.nodeType!==11;)t=t.parentNode;t.parentNode&&t.parentNode.removeChild(t)}return r}s.utils.parseHtmlFragment=function(t){return i?f(t):n(t)};s.utils.setHtml=function(n,r){var f,u;if(s.utils.emptyDomNode(n),r=s.utils.unwrapObservable(r),r!==null&&r!==t)if(typeof r!="string"&&(r=r.toString()),i)i(n).html(r);else for(f=s.utils.parseHtmlFragment(r),u=0;u<f.length;u++)n.appendChild(f[u])}}();s.exportSymbol("utils.parseHtmlFragment",s.utils.parseHtmlFragment);s.exportSymbol("utils.setHtml",s.utils.setHtml);s.memoization=function(){function i(){return((1+Math.random())*4294967296|0).toString(16).substring(1)}function u(){return i()+i()}function r(n,t){var i;if(n)if(n.nodeType==8)i=s.memoization.parseMemoText(n.nodeValue),i!=null&&t.push({domNode:n,memoId:i});else if(n.nodeType==1)for(var u=0,f=n.childNodes,e=f.length;u<e;u++)r(f[u],t)}var n={};return{memoize:function(t){if(typeof t!="function")throw new Error("You can only pass a function to ko.memoization.memoize()");var i=u();return n[i]=t,"<!--[ko_memo:"+i+"]-->"},unmemoize:function(i,r){var u=n[i];if(u===t)throw new Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete n[i]}},unmemoizeDomNodeAndDescendants:function(n,t){var f=[],u,o,i,e;for(r(n,f),u=0,o=f.length;u<o;u++)i=f[u].domNode,e=[i],t&&s.utils.arrayPushAll(e,t),s.memoization.unmemoize(f[u].memoId,e),i.nodeValue="",i.parentNode&&i.parentNode.removeChild(i)},parseMemoText:function(n){var t=n.match(/^\[ko_memo\:(.*?)\]$/);return t?t[1]:null}}}();s.exportSymbol("memoization",s.memoization);s.exportSymbol("memoization.memoize",s.memoization.memoize);s.exportSymbol("memoization.unmemoize",s.memoization.unmemoize);s.exportSymbol("memoization.parseMemoText",s.memoization.parseMemoText);s.exportSymbol("memoization.unmemoizeDomNodeAndDescendants",s.memoization.unmemoizeDomNodeAndDescendants);s.extenders={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return s.dependentObservable({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},rateLimit:function(n,t){var i,r,u;typeof t=="number"?i=t:(i=t.timeout,r=t.method);u=r=="notifyWhenChangesStop"?it:tt;n.limit(function(n){return u(n,i)})},notify:function(n,t){n.equalityComparer=t=="always"?null:p}};nt={undefined:1,boolean:1,number:1,string:1};s.exportSymbol("extenders",s.extenders);s.subscription=function(n,t,i){this.target=n;this.callback=t;this.disposeCallback=i;this.isDisposed=!1;s.exportProperty(this,"dispose",this.dispose)};s.subscription.prototype.dispose=function(){this.isDisposed=!0;this.disposeCallback()};s.subscribable=function(){s.utils.setPrototypeOfOrExtend(this,s.subscribable.fn);this._subscriptions={}};l="change";h={subscribe:function(n,t,i){var r=this,f,u;return i=i||l,f=t?n.bind(t):n,u=new s.subscription(r,f,function(){s.utils.arrayRemoveItem(r._subscriptions[i],u)}),r.peek&&r.peek(),r._subscriptions[i]||(r._subscriptions[i]=[]),r._subscriptions[i].push(u),u},notifySubscribers:function(n,t){if(t=t||l,this.hasSubscriptionsForEvent(t))try{s.dependencyDetection.begin();for(var u=this._subscriptions[t].slice(0),r=0,i;i=u[r];++r)i.isDisposed||i.callback(n)}finally{s.dependencyDetection.end()}},limit:function(n){var t=this,o=s.isObservable(t),r,u,i,f="beforeChange",e;t._origNotifySubscribers||(t._origNotifySubscribers=t.notifySubscribers,t.notifySubscribers=function(n,i){i&&i!==l?i===f?t._rateLimitedBeforeChange(n):t._origNotifySubscribers(n,i):t._rateLimitedChange(n)});e=n(function(){o&&i===t&&(i=t());r=!1;t.isDifferent(u,i)&&t._origNotifySubscribers(u=i)});t._rateLimitedChange=function(n){r=!0;i=n;e()};t._rateLimitedBeforeChange=function(n){r||(u=n,t._origNotifySubscribers(n,f))}},hasSubscriptionsForEvent:function(n){return this._subscriptions[n]&&this._subscriptions[n].length},getSubscriptionsCount:function(){var n=0;return s.utils.objectForEach(this._subscriptions,function(t,i){n+=i.length}),n},isDifferent:function(n,t){return!this.equalityComparer||!this.equalityComparer(n,t)},extend:rt};s.exportProperty(h,"subscribe",h.subscribe);s.exportProperty(h,"extend",h.extend);s.exportProperty(h,"getSubscriptionsCount",h.getSubscriptionsCount);s.utils.canSetPrototype&&s.utils.setPrototypeOf(h,Function.prototype);s.subscribable.fn=h;s.isSubscribable=function(n){return n!=null&&typeof n.subscribe=="function"&&typeof n.notifySubscribers=="function"};s.exportSymbol("subscribable",s.subscribable);s.exportSymbol("isSubscribable",s.isSubscribable);s.computedContext=s.dependencyDetection=function(){function f(){return++u}function i(i){t.push(n);n=i}function r(){n=t.pop()}var t=[],n,u=0;return{begin:i,end:r,registerDependency:function(t){if(n){if(!s.isSubscribable(t))throw new Error("Only subscribable things can act as dependencies");n.callback(t,t._id||(t._id=f()))}},ignore:function(n,t,u){try{return i(),n.apply(t,u||[])}finally{r()}},getDependenciesCount:function(){if(n)return n.computed.getDependenciesCount()},isInitial:function(){if(n)return n.isInitial}}}();s.exportSymbol("computedContext",s.computedContext);s.exportSymbol("computedContext.getDependenciesCount",s.computedContext.getDependenciesCount);s.exportSymbol("computedContext.isInitial",s.computedContext.isInitial);s.observable=function(t){function i(){return arguments.length>0?(i.isDifferent(r,arguments[0])&&(i.valueWillMutate(),r=arguments[0],n&&(i._latestValue=r),i.valueHasMutated()),this):(s.dependencyDetection.registerDependency(i),r)}var r=t;return s.subscribable.call(i),s.utils.setPrototypeOfOrExtend(i,s.observable.fn),n&&(i._latestValue=r),i.peek=function(){return r},i.valueHasMutated=function(){i.notifySubscribers(r)},i.valueWillMutate=function(){i.notifySubscribers(r,"beforeChange")},s.exportProperty(i,"peek",i.peek),s.exportProperty(i,"valueHasMutated",i.valueHasMutated),s.exportProperty(i,"valueWillMutate",i.valueWillMutate),i};s.observable.fn={equalityComparer:p};c=s.observable.protoProperty="__ko_proto__";s.observable.fn[c]=s.observable;s.utils.canSetPrototype&&s.utils.setPrototypeOf(s.observable.fn,s.subscribable.fn);s.hasPrototype=function(n,i){return n===null||n===t||n[c]===t?!1:n[c]===i?!0:s.hasPrototype(n[c],i)};s.isObservable=function(n){return s.hasPrototype(n,s.observable)};s.isWriteableObservable=function(n){return typeof n=="function"&&n[c]===s.observable?!0:typeof n=="function"&&n[c]===s.dependentObservable&&n.hasWriteFunction?!0:!1};s.exportSymbol("observable",s.observable);s.exportSymbol("isObservable",s.isObservable);s.exportSymbol("isWriteableObservable",s.isWriteableObservable);s.observableArray=function(n){if(n=n||[],typeof n!="object"||!("length"in n))throw new Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");var t=s.observable(n);return s.utils.setPrototypeOfOrExtend(t,s.observableArray.fn),t.extend({trackArrayChanges:!0})};s.observableArray.fn={remove:function(n){for(var u,r=this.peek(),i=[],f=typeof n=="function"&&!s.isObservable(n)?n:function(t){return t===n},t=0;t<r.length;t++)u=r[t],f(u)&&(i.length===0&&this.valueWillMutate(),i.push(u),r.splice(t,1),t--);return i.length&&this.valueHasMutated(),i},removeAll:function(n){if(n===t){var i=this.peek(),r=i.slice(0);return this.valueWillMutate(),i.splice(0,i.length),this.valueHasMutated(),r}return n?this.remove(function(t){return s.utils.arrayIndexOf(n,t)>=0}):[]},destroy:function(n){var i=this.peek(),u=typeof n=="function"&&!s.isObservable(n)?n:function(t){return t===n},t,r;for(this.valueWillMutate(),t=i.length-1;t>=0;t--)r=i[t],u(r)&&(i[t]._destroy=!0);this.valueHasMutated()},destroyAll:function(n){return n===t?this.destroy(function(){return!0}):n?this.destroy(function(t){return s.utils.arrayIndexOf(n,t)>=0}):[]},indexOf:function(n){var t=this();return s.utils.arrayIndexOf(t,n)},replace:function(n,t){var i=this.indexOf(n);i>=0&&(this.valueWillMutate(),this.peek()[i]=t,this.valueHasMutated())}};s.utils.arrayForEach(["pop","push","reverse","shift","sort","splice","unshift"],function(n){s.observableArray.fn[n]=function(){var t=this.peek(),i;return this.valueWillMutate(),this.cacheDiffForKnownOperation(t,n,arguments),i=t[n].apply(t,arguments),this.valueHasMutated(),i}});s.utils.arrayForEach(["slice"],function(n){s.observableArray.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});s.utils.canSetPrototype&&s.utils.setPrototypeOf(s.observableArray.fn,s.observable.fn);s.exportSymbol("observableArray",s.observableArray);a="arrayChange";s.extenders.trackArrayChanges=function(n){function f(){var f,u;r||(r=!0,f=n.notifySubscribers,n.notifySubscribers=function(n,t){return t&&t!==l||++i,f.apply(this,arguments)},u=[].concat(n.peek()||[]),t=null,n.subscribe(function(r){if(r=[].concat(r||[]),n.hasSubscriptionsForEvent(a)){var f=e(u,r);f.length&&n.notifySubscribers(f,a)}u=r;t=null;i=0}))}function e(n,r){return(!t||i>1)&&(t=s.utils.compareArrays(n,r,{sparse:!0})),t}if(!n.cacheDiffForKnownOperation){var r=!1,t=null,i=0,u=n.subscribe;n.subscribe=n.subscribe=function(n,t,i){return i===a&&f(),u.apply(this,arguments)};n.cacheDiffForKnownOperation=function(n,u,f){function c(n,t,i){return l[l.length]={status:n,value:t,index:i}}var e,y;if(r&&!i){var l=[],o=n.length,a=f.length,h=0;switch(u){case"push":h=o;case"unshift":for(e=0;e<a;e++)c("added",f[e],h+e);break;case"pop":h=o-1;case"shift":o&&c("deleted",n[h],h);break;case"splice":var v=Math.min(Math.max(0,f[0]<0?o+f[0]:f[0]),o),p=a===1?o:Math.min(v+(f[1]||0),o),w=v+a-2,d=Math.max(p,w),b=[],k=[];for(e=v,y=2;e<d;++e,++y)e<p&&k.push(c("deleted",n[e],e)),e<w&&b.push(c("added",f[y],e));s.utils.findMovesInArrayComparison(k,b);break;default:return}t=l}}}};s.computed=s.dependentObservable=function(t,i,r){function rt(n,t){c[t]||(c[t]=n.subscribe(ut),++f)}function d(){w=!0;s.utils.objectForEach(c,function(n,t){t.dispose()});c={};f=0;l=!1}function ut(){var n=u.throttleEvaluation;n&&n>=0?(clearTimeout(tt),tt=setTimeout(v,n)):u._evalRateLimited?u._evalRateLimited():v()}function v(){var t,r,h;if(!y&&!w){if(k&&k()){if(!p){a();return}}else p=!1;y=!0;try{t=c;r=f;s.dependencyDetection.begin({callback:function(n,i){w||(r&&t[i]?(c[i]=t[i],++f,delete t[i],--r):rt(n,i))},computed:u,isInitial:!f});c={};f=0;try{h=i?e.call(i):e()}finally{s.dependencyDetection.end();r&&s.utils.objectForEach(t,function(n,t){t.dispose()});l=!1}u.isDifferent(o,h)&&(u.notifySubscribers(o,"beforeChange"),o=h,n&&(u._latestValue=o),(!u._evalRateLimited||u.throttleEvaluation)&&u.notifySubscribers(o))}finally{y=!1}f||a()}}function u(){if(arguments.length>0){if(typeof nt=="function")nt.apply(i,arguments);else throw new Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return l&&v(),s.dependencyDetection.registerDependency(u),o}function ft(){return l&&!f&&v(),o}function g(){return l||f>0}var o,l=!0,y=!1,p=!1,w=!1,e=t,it;if(e&&typeof e=="object"?(r=e,e=r.read):(r=r||{},e||(e=r.read)),typeof e!="function")throw new Error("Pass a function that returns the value of the ko.computed");var nt=r.write,h=r.disposeWhenNodeIsRemoved||r.disposeWhenNodeIsRemoved||null,b=r.disposeWhen||r.disposeWhen,k=b,a=d,c={},f=0,tt=null;return i||(i=r.owner),s.subscribable.call(u),s.utils.setPrototypeOfOrExtend(u,s.dependentObservable.fn),u.peek=ft,u.getDependenciesCount=function(){return f},u.hasWriteFunction=typeof r.write=="function",u.dispose=function(){a()},u.isActive=g,it=u.limit,u.limit=function(n){it.call(u,n);u._evalRateLimited=function(){u._rateLimitedBeforeChange(o);l=!0;u._rateLimitedChange(u)}},s.exportProperty(u,"peek",u.peek),s.exportProperty(u,"dispose",u.dispose),s.exportProperty(u,"isActive",u.isActive),s.exportProperty(u,"getDependenciesCount",u.getDependenciesCount),h&&(p=!0,h.nodeType&&(k=function(){return!s.utils.domNodeIsAttachedToDocument(h)||b&&b()})),r.deferEvaluation!==!0&&v(),h&&g()&&h.nodeType&&(a=function(){s.utils.domNodeDisposal.removeDisposeCallback(h,a);d()},s.utils.domNodeDisposal.addDisposeCallback(h,a)),u};s.isComputed=function(n){return s.hasPrototype(n,s.dependentObservable)};w=s.observable.protoProperty;s.dependentObservable[w]=s.observable;s.dependentObservable.fn={equalityComparer:p};s.dependentObservable.fn[w]=s.dependentObservable;s.utils.canSetPrototype&&s.utils.setPrototypeOf(s.dependentObservable.fn,s.subscribable.fn);s.exportSymbol("dependentObservable",s.dependentObservable);s.exportSymbol("computed",s.dependentObservable);s.exportSymbol("isComputed",s.isComputed),function(){function i(r,f,e){var s,o;return(e=e||new n,r=f(r),s=typeof r=="object"&&r!==null&&r!==t&&!(r instanceof Date)&&!(r instanceof String)&&!(r instanceof Number)&&!(r instanceof Boolean),!s)?r:(o=r instanceof Array?[]:{},e.save(r,o),u(r,function(n){var u=f(r[n]),s;switch(typeof u){case"boolean":case"number":case"string":case"function":o[n]=u;break;case"object":case"undefined":s=e.get(u);o[n]=s!==t?s:i(u,f,e)}}),o)}function u(n,t){var i,r;if(n instanceof Array){for(i=0;i<n.length;i++)t(i);typeof n.toJSON=="function"&&t("toJSON")}else for(r in n)t(r)}function n(){this.keys=[];this.values=[]}var r=10;s.toJS=function(n){if(arguments.length==0)throw new Error("When calling ko.toJS, pass the object you want to convert.");return i(n,function(n){for(var t=0;s.isObservable(n)&&t<r;t++)n=n();return n})};s.toJSON=function(n,t,i){var r=s.toJS(n);return s.utils.stringifyJson(r,t,i)};n.prototype={constructor:n,save:function(n,t){var i=s.utils.arrayIndexOf(this.keys,n);i>=0?this.values[i]=t:(this.keys.push(n),this.values.push(t))},get:function(n){var i=s.utils.arrayIndexOf(this.keys,n);return i>=0?this.values[i]:t}}}();s.exportSymbol("toJS",s.toJS);s.exportSymbol("toJSON",s.toJSON),function(){var n="__ko__hasDomDataOptionValue__";s.selectExtensions={readValue:function(i){switch(s.utils.tagNameLower(i)){case"option":return i[n]===!0?s.utils.domData.get(i,s.bindingHandlers.options.optionValueDomDataKey):s.utils.ieVersion<=7?i.getAttributeNode("value")&&i.getAttributeNode("value").specified?i.value:i.text:i.value;case"select":return i.selectedIndex>=0?s.selectExtensions.readValue(i.options[i.selectedIndex]):t;default:return i.value}},writeValue:function(i,r,u){var e,f,h,o;switch(s.utils.tagNameLower(i)){case"option":switch(typeof r){case"string":s.utils.domData.set(i,s.bindingHandlers.options.optionValueDomDataKey,t);n in i&&delete i[n];i.value=r;break;default:s.utils.domData.set(i,s.bindingHandlers.options.optionValueDomDataKey,r);i[n]=!0;i.value=typeof r=="number"?r:""}break;case"select":for((r===""||r===null)&&(r=t),e=-1,f=0,h=i.options.length;f<h;++f)if(o=s.selectExtensions.readValue(i.options[f]),o==r||o==""&&r===t){e=f;break}(u||e>=0||r===t&&i.size>1)&&(i.selectedIndex=e);break;default:(r===null||r===t)&&(r="");i.value=r}}}}();s.exportSymbol("selectExtensions",s.selectExtensions);s.exportSymbol("selectExtensions.readValue",s.selectExtensions.readValue);s.exportSymbol("selectExtensions.writeValue",s.selectExtensions.writeValue);s.expressionRewriting=function(){function e(n){if(s.utils.arrayIndexOf(u,n)>=0)return!1;var t=n.match(f);return t===null?!1:t[1]?"Object("+t[1]+")"+t[2]:n}function i(n){var u=s.utils.stringTrim(n),l,r,i,v;u.charCodeAt(0)===123&&(u=u.slice(1,-1));var y=[],e=u.match(t),o,f,a=0;if(e)for(e.push(","),l=0;r=e[l];++l){if(i=r.charCodeAt(0),i===44){if(a<=0){o&&y.push(f?{key:o,value:f.join("")}:{unknown:o});o=f=a=0;continue}}else if(i===58){if(!f)continue}else if(i===47&&l&&r.length>1)v=e[l-1].match(h),v&&!c[v[0]]&&(u=u.substr(u.indexOf(r)+1),e=u.match(t),e.push(","),l=-1,r="/");else if(i===40||i===123||i===91)++a;else if(i===41||i===125||i===93)--a;else if(!o&&!f){o=i===34||i===39?r.slice(1,-1):r;continue}f?f.push(r):f=[r]}return y}function l(n,t){function u(n,t){function c(i){return i&&i.preprocess?t=i.preprocess(t,n,u):!0}var i;c(s.getBindingHandler(n))&&(r[n]&&(i=e(t))&&f.push("'"+n+"':function(_z){"+i+"=_z}"),h&&(t="function(){return "+t+" }"),o.push("'"+n+"':"+t))}t=t||{};var o=[],f=[],h=t.valueAccessors,c=typeof n=="string"?i(n):n;return s.utils.arrayForEach(c,function(n){u(n.key||n.unknown,n.value)}),f.length&&u("_ko_property_writers","{"+f.join(",")+" }"),o.join(",")}var u=["true","false","null","undefined"],f=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,n=",\"'{}()/:[\\]",o="[^\\s:,/][^"+n+"]*[^\\s"+n+"]",t=RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|"+o+"|[^\\s]","g"),h=/[\])"'A-Za-z0-9_$]+$/,c={"in":1,"return":1,"typeof":1},r={};return{bindingRewriteValidators:[],twoWayBindings:r,parseObjectLiteral:i,preProcessBindings:l,keyValueArrayContainsKey:function(n,t){for(var i=0;i<n.length;i++)if(n[i].key==t)return!0;return!1},writeValueToProperty:function(n,t,i,r,u){if(n&&s.isObservable(n))s.isWriteableObservable(n)&&(!u||n.peek()!==r)&&n(r);else{var f=t.get("_ko_property_writers");f&&f[i]&&f[i](r)}}}}();s.exportSymbol("expressionRewriting",s.expressionRewriting);s.exportSymbol("expressionRewriting.bindingRewriteValidators",s.expressionRewriting.bindingRewriteValidators);s.exportSymbol("expressionRewriting.parseObjectLiteral",s.expressionRewriting.parseObjectLiteral);s.exportSymbol("expressionRewriting.preProcessBindings",s.expressionRewriting.preProcessBindings);s.exportSymbol("expressionRewriting._twoWayBindings",s.expressionRewriting.twoWayBindings);s.exportSymbol("jsonExpressionRewriting",s.expressionRewriting);s.exportSymbol("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",s.expressionRewriting.preProcessBindings),function(){function n(n){return n.nodeType==8&&u.test(t?n.text:n.nodeValue)}function i(n){return n.nodeType==8&&o.test(t?n.text:n.nodeValue)}function f(t,r){for(var u=t,f=1,e=[];u=u.nextSibling;){if(i(u)&&(f--,f===0))return e;e.push(u);n(u)&&f++}if(!r)throw new Error("Cannot find closing comment tag to match: "+t.nodeValue);return null}function e(n,t){var i=f(n,t);return i?i.length>0?i[i.length-1].nextSibling:n.nextSibling:null}function c(t){var r=t.firstChild,u=null,f;if(r)do u?u.push(r):n(r)?(f=e(r,!0),f?r=f:u=[r]):i(r)&&(u=[r]);while(r=r.nextSibling);return u}var t=r&&r.createComment("test").text==="<!--test-->",u=t?/^<!--\s*ko(?:\s+([\s\S]+))?\s*-->$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,o=t?/^<!--\s*\/ko\s*-->$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};s.virtualElements={allowedBindings:{},childNodes:function(t){return n(t)?f(t):t.childNodes},emptyNode:function(t){var r,i,u;if(n(t))for(r=s.virtualElements.childNodes(t),i=0,u=r.length;i<u;i++)s.removeNode(r[i]);else s.utils.emptyDomNode(t)},setDomNodeChildren:function(t,i){var u,r,f;if(n(t))for(s.virtualElements.emptyNode(t),u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u);else s.utils.setDomNodeChildren(t,i)},prepend:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},insertAfter:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):s.virtualElements.prepend(t,i)},firstChild:function(t){return n(t)?!t.nextSibling||i(t.nextSibling)?null:t.nextSibling:t.firstChild},nextSibling:function(t){return(n(t)&&(t=e(t)),t.nextSibling&&i(t.nextSibling))?null:t.nextSibling},hasBindingValue:n,virtualNodeBindingValue:function(n){var i=(t?n.text:n.nodeValue).match(u);return i?i[1]:null},normaliseVirtualElementDomStructure:function(n){var t,i,u,r;if(h[s.utils.tagNameLower(n)]&&(t=n.firstChild,t))do if(t.nodeType===1&&(i=c(t),i))for(u=t.nextSibling,r=0;r<i.length;r++)u?n.insertBefore(i[r],u):n.appendChild(i[r]);while(t=t.nextSibling)}}}();s.exportSymbol("virtualElements",s.virtualElements);s.exportSymbol("virtualElements.allowedBindings",s.virtualElements.allowedBindings);s.exportSymbol("virtualElements.emptyNode",s.virtualElements.emptyNode);s.exportSymbol("virtualElements.insertAfter",s.virtualElements.insertAfter);s.exportSymbol("virtualElements.prepend",s.virtualElements.prepend);s.exportSymbol("virtualElements.setDomNodeChildren",s.virtualElements.setDomNodeChildren),function(){function t(n,t,r){var u=n+(r&&r.valueAccessors||"");return t[u]||(t[u]=i(n,r))}function i(n,t){var i=s.expressionRewriting.preProcessBindings(n,t),r="with($context){with($data||{}){return{"+i+"}}}";return new Function("$context","$element",r)}var n="data-bind";s.bindingProvider=function(){this.bindingCache={}};s.utils.extend(s.bindingProvider.prototype,{nodeHasBindings:function(t){switch(t.nodeType){case 1:return t.getAttribute(n)!=null;case 8:return s.virtualElements.hasBindingValue(t);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n):null},getBindingAccessors:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n,{valueAccessors:!0}):null},getBindingsString:function(t){switch(t.nodeType){case 1:return t.getAttribute(n);case 8:return s.virtualElements.virtualNodeBindingValue(t);default:return null}},parseBindingsString:function(n,i,r,u){try{var e=t(n,this.bindingCache,u);return e(i,r)}catch(f){f.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+f.message;throw f;}}});s.bindingProvider.instance=new s.bindingProvider}();s.exportSymbol("bindingProvider",s.bindingProvider),function(){function v(n){return function(){return n}}function r(n){return n()}function h(n){return s.utils.objectMap(s.dependencyDetection.ignore(n),function(t,i){return function(){return n()[i]}})}function y(n,t,i){return typeof n=="function"?h(n.bind(null,t,i)):s.utils.objectMap(n,v)}function p(n,t){return h(this.getBindings.bind(this,n,t))}function w(n){var t=s.virtualElements.allowedBindings[n];if(!t)throw new Error("The binding '"+n+"' cannot be used with virtual elements");}function c(n,t,i){var r,u=s.virtualElements.firstChild(t),f=s.bindingProvider.instance,e=f.preprocessNode;if(e){while(r=u)u=s.virtualElements.nextSibling(r),e.call(f,r);u=s.virtualElements.firstChild(t)}while(r=u)u=s.virtualElements.nextSibling(r),l(n,r,i)}function l(n,t,i){var u=!0,r=t.nodeType===1,f;r&&s.virtualElements.normaliseVirtualElementDomStructure(t);f=r&&i||s.bindingProvider.instance.nodeHasBindings(t);f&&(u=a(t,null,n,i).shouldBindDescendants);u&&!o[s.utils.tagNameLower(t)]&&c(n,t,!r)}function b(n){var i=[],r={},t=[];return s.utils.objectForEach(n,function u(f){if(!r[f]){var e=s.getBindingHandler(f);e&&(e.after&&(t.push(f),s.utils.arrayForEach(e.after,function(i){if(n[i])if(s.utils.arrayIndexOf(t,i)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+t.join(", "));else u(i)}),t.length--),i.push({key:f,handler:e}));r[f]=!0}}),i}function a(n,i,u,e){var v=s.utils.domData.get(n,f),o,c,l,k;if(!i){if(v)throw Error("You cannot apply bindings multiple times to the same element.");s.utils.domData.set(n,f,!0)}if(!v&&e&&s.storedBindingContextForNode(n,u),i&&typeof i!="function")o=i;else{var y=s.bindingProvider.instance,d=y.getBindingAccessors||p,h=s.dependentObservable(function(){return o=i?i(u,n):d.call(y,n,u),o&&u._subscribable&&u._subscribable(),o},null,{disposeWhenNodeIsRemoved:n});o&&h.isActive()||(h=null)}if(o){l=h?function(n){return function(){return r(h()[n])}}:function(n){return o[n]};function a(){return s.utils.objectMap(h?h():o,r)}a.get=function(n){return o[n]&&r(l(n))};a.has=function(n){return n in o};k=b(o);s.utils.arrayForEach(k,function(i){var e=i.handler.init,h=i.handler.update,r=i.key;n.nodeType===8&&w(r);try{typeof e=="function"&&s.dependencyDetection.ignore(function(){var i=e(n,l(r),a,u.$data,u);if(i&&i.controlsDescendantBindings){if(c!==t)throw new Error("Multiple bindings ("+c+" and "+r+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");c=r}});typeof h=="function"&&s.dependentObservable(function(){h(n,l(r),a,u.$data,u)},null,{disposeWhenNodeIsRemoved:n})}catch(f){f.message='Unable to process binding "'+r+": "+o[r]+'"\nMessage: '+f.message;throw f;}})}return{shouldBindDescendants:c===t}}function n(n){return n&&n instanceof s.bindingContext?n:new s.bindingContext(n)}var o,f,e;s.bindingHandlers={};o={script:!0};s.getBindingHandler=function(n){return s.bindingHandlers[n]};s.bindingContext=function(n,i,r,u){function h(){var o=l?n():n,t=s.utils.unwrapObservable(o);return i?(i._subscribable&&i._subscribable(),s.utils.extend(f,i),e&&(f._subscribable=e)):(f.$parents=[],f.$root=t,f.ko=s),f.$rawData=o,f.$data=t,r&&(f[r]=t),u&&u(f,i,t),f.$data}function c(){return o&&!s.utils.anyDomNodeIsAttachedToDocument(o)}var f=this,l=typeof n=="function"&&!s.isObservable(n),o,e=s.dependentObservable(h,null,{disposeWhen:c,disposeWhenNodeIsRemoved:!0});e.isActive()&&(f._subscribable=e,e.equalityComparer=null,o=[],e._addNode=function(n){o.push(n);s.utils.domNodeDisposal.addDisposeCallback(n,function(n){s.utils.arrayRemoveItem(o,n);o.length||(e.dispose(),f._subscribable=e=t)})})};s.bindingContext.prototype.createChildContext=function(n,t,i){return new s.bindingContext(n,this,t,function(n,t){n.$parentContext=t;n.$parent=t.$data;n.$parents=(t.$parents||[]).slice(0);n.$parents.unshift(n.$parent);i&&i(n)})};s.bindingContext.prototype.extend=function(n){return new s.bindingContext(this._subscribable||this.$data,this,null,function(t,i){t.$rawData=i.$rawData;s.utils.extend(t,typeof n=="function"?n():n)})};f=s.utils.domData.nextKey();e=s.utils.domData.nextKey();s.storedBindingContextForNode=function(n,t){if(arguments.length==2)s.utils.domData.set(n,e,t),t._subscribable&&t._subscribable._addNode(n);else return s.utils.domData.get(n,e)};s.applyBindingAccessorsToNode=function(t,i,r){return t.nodeType===1&&s.virtualElements.normaliseVirtualElementDomStructure(t),a(t,i,n(r),!0)};s.applyBindingsToNode=function(t,i,r){var u=n(r);return s.applyBindingAccessorsToNode(t,y(i,u,t),u)};s.applyBindingsToDescendants=function(t,i){(i.nodeType===1||i.nodeType===8)&&c(n(t),i,!0)};s.applyBindings=function(t,r){if(!i&&u.jQuery&&(i=u.jQuery),r&&r.nodeType!==1&&r.nodeType!==8)throw new Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");r=r||u.document.body;l(n(t),r,!0)};s.contextFor=function(n){switch(n.nodeType){case 1:case 8:var i=s.storedBindingContextForNode(n);if(i)return i;if(n.parentNode)return s.contextFor(n.parentNode)}return t};s.dataFor=function(n){var i=s.contextFor(n);return i?i.$data:t};s.exportSymbol("bindingHandlers",s.bindingHandlers);s.exportSymbol("applyBindings",s.applyBindings);s.exportSymbol("applyBindingsToDescendants",s.applyBindingsToDescendants);s.exportSymbol("applyBindingAccessorsToNode",s.applyBindingAccessorsToNode);s.exportSymbol("applyBindingsToNode",s.applyBindingsToNode);s.exportSymbol("contextFor",s.contextFor);s.exportSymbol("dataFor",s.dataFor)}();b={"class":"className","for":"htmlFor"};s.bindingHandlers.attr={update:function(n,i){var r=s.utils.unwrapObservable(i())||{};s.utils.objectForEach(r,function(i,r){r=s.utils.unwrapObservable(r);var u=r===!1||r===null||r===t;u&&n.removeAttribute(i);s.utils.ieVersion<=8&&i in b?(i=b[i],u?n.removeAttribute(i):n[i]=r):u||n.setAttribute(i,r.toString());i==="name"&&s.utils.setElementName(n,u?"":r.toString())})}},function(){s.bindingHandlers.checked={after:["value","attr"],init:function(n,i,r){function u(){return r.has("checkedValue")?s.utils.unwrapObservable(r.get("checkedValue")):n.value}function c(){var c=n.checked,t=a?u():c,o;s.computedContext.isInitial()||(!f||c)&&(o=s.dependencyDetection.ignore(i),e?h!==t?(c&&(s.utils.addOrRemoveItem(o,t,!0),s.utils.addOrRemoveItem(o,h,!1)),h=t):s.utils.addOrRemoveItem(o,t,c):s.expressionRewriting.writeValueToProperty(o,r,"checked",t,!0))}function l(){var t=s.utils.unwrapObservable(i());n.checked=e?s.utils.arrayIndexOf(t,u())>=0:o?t:u()===t}var o=n.type=="checkbox",f=n.type=="radio";if(o||f){var e=o&&s.utils.unwrapObservable(i())instanceof Array,h=e?u():t,a=f||e;f&&!n.name&&s.bindingHandlers.uniqueName.init(n,function(){return!0});s.computed(c,null,{disposeWhenNodeIsRemoved:n});s.utils.registerEventHandler(n,"click",c);s.computed(l,null,{disposeWhenNodeIsRemoved:n})}}};s.expressionRewriting.twoWayBindings.checked=!0;s.bindingHandlers.checkedValue={update:function(n,t){n.value=s.utils.unwrapObservable(t())}}}();k="__ko__cssValue";s.bindingHandlers.css={update:function(n,t){var i=s.utils.unwrapObservable(t());typeof i=="object"?s.utils.objectForEach(i,function(t,i){i=s.utils.unwrapObservable(i);s.utils.toggleDomNodeCssClass(n,t,i)}):(i=String(i||""),s.utils.toggleDomNodeCssClass(n,n[k],!1),n[k]=i,s.utils.toggleDomNodeCssClass(n,i,!0))}};s.bindingHandlers.enable={update:function(n,t){var i=s.utils.unwrapObservable(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};s.bindingHandlers.disable={update:function(n,t){s.bindingHandlers.enable.update(n,function(){return!s.utils.unwrapObservable(t())})}};s.bindingHandlers.event={init:function(n,t,i,r,u){var f=t()||{};s.utils.objectForEach(f,function(f){typeof f=="string"&&s.utils.registerEventHandler(n,f,function(n){var o,h=t()[f],e,c;if(h){try{e=s.utils.makeArray(arguments);r=u.$data;e.unshift(r);o=h.apply(r,e)}finally{o!==!0&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}c=i.get(f+"Bubble")!==!1;c||(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};s.bindingHandlers.foreach={makeTemplateValueAccessor:function(n){return function(){var i=n(),t=s.utils.peekObservable(i);return!t||typeof t.length=="number"?{foreach:i,templateEngine:s.nativeTemplateEngine.instance}:(s.utils.unwrapObservable(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:s.nativeTemplateEngine.instance})}},init:function(n,t){return s.bindingHandlers.template.init(n,s.bindingHandlers.foreach.makeTemplateValueAccessor(t))},update:function(n,t,i,r,u){return s.bindingHandlers.template.update(n,s.bindingHandlers.foreach.makeTemplateValueAccessor(t),i,r,u)}};s.expressionRewriting.bindingRewriteValidators.foreach=!1;s.virtualElements.allowedBindings.foreach=!0;v="__ko_hasfocusUpdating";d="__ko_hasfocusLastValue";s.bindingHandlers.hasfocus={init:function(n,t,i){var r=function(r){var u,f,e;if(n[v]=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(o){f=u.body}r=f===n}e=t();s.expressionRewriting.writeValueToProperty(e,i,"hasfocus",r,!0);n[d]=r;n[v]=!1},u=r.bind(null,!0),f=r.bind(null,!1);s.utils.registerEventHandler(n,"focus",u);s.utils.registerEventHandler(n,"focusin",u);s.utils.registerEventHandler(n,"blur",f);s.utils.registerEventHandler(n,"focusout",f)},update:function(n,t){var i=!!s.utils.unwrapObservable(t());n[v]||n[d]===i||(i?n.focus():n.blur(),s.dependencyDetection.ignore(s.utils.triggerEvent,null,[n,i?"focusin":"focusout"]))}};s.expressionRewriting.twoWayBindings.hasfocus=!0;s.bindingHandlers.hasFocus=s.bindingHandlers.hasfocus;s.expressionRewriting.twoWayBindings.hasFocus=!0;s.bindingHandlers.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){s.utils.setHtml(n,t())}};g("if");g("ifnot",!1,!0);g("with",!0,!1,function(n,t){return n.createChildContext(t)});y={};s.bindingHandlers.options={init:function(n){if(s.utils.tagNameLower(n)!=="select")throw new Error("options binding applies only to SELECT elements");while(n.length>0)n.remove(0);return{controlsDescendantBindings:!0}},update:function(n,i,r){function a(){return s.utils.arrayFilter(n.options,function(n){return n.selected})}function p(n,t,i){var r=typeof t;return r=="function"?t(n):r=="string"?n[t]:i}function d(i,f,e){var o,h,l;return e.length&&(u=e[0].selected?[s.selectExtensions.readValue(e[0])]:[],c=!0),o=n.ownerDocument.createElement("option"),i===y?(s.utils.setTextContent(o,r.get("optionsCaption")),s.selectExtensions.writeValue(o,t)):(h=p(i,r.get("optionsValue"),i),s.selectExtensions.writeValue(o,s.utils.unwrapObservable(h)),l=p(i,r.get("optionsText"),h),s.utils.setTextContent(o,l)),[o]}function w(t,i){if(u.length){var r=s.utils.arrayIndexOf(u,s.selectExtensions.readValue(i[0]))>=0;s.utils.setOptionNodeSelectionState(i[0],r);c&&!r&&s.dependencyDetection.ignore(s.utils.triggerEvent,null,[n,"change"])}}var b=n.length==0,e=!b&&n.multiple?n.scrollTop:null,f=s.utils.unwrapObservable(i()),k=r.get("optionsIncludeDestroyed"),v={},o,h,u,c,l;u=n.multiple?s.utils.arrayMap(a(),s.selectExtensions.readValue):n.selectedIndex>=0?[s.selectExtensions.readValue(n.options[n.selectedIndex])]:[];f&&(typeof f.length=="undefined"&&(f=[f]),h=s.utils.arrayFilter(f,function(n){return k||n===t||n===null||!s.utils.unwrapObservable(n._destroy)}),r.has("optionsCaption")&&(o=s.utils.unwrapObservable(r.get("optionsCaption")),o!==null&&o!==t&&h.unshift(y)));c=!1;v.beforeRemove=function(t){n.removeChild(t)};l=w;r.has("optionsAfterRender")&&(l=function(n,i){w(n,i);s.dependencyDetection.ignore(r.get("optionsAfterRender"),null,[i[0],n!==y?n:t])});s.utils.setDomNodeChildrenFromArrayMapping(n,h,d,v,l);s.dependencyDetection.ignore(function(){if(r.get("valueAllowUnset")&&r.has("value"))s.selectExtensions.writeValue(n,s.utils.unwrapObservable(r.get("value")),!0);else{var t;t=n.multiple?u.length&&a().length<u.length:u.length&&n.selectedIndex>=0?s.selectExtensions.readValue(n.options[n.selectedIndex])!==u[0]:u.length||n.selectedIndex>=0;t&&s.utils.triggerEvent(n,"change")}});s.utils.ensureSelectElementIsRenderedCorrectly(n);e&&Math.abs(e-n.scrollTop)>20&&(n.scrollTop=e)}};s.bindingHandlers.options.optionValueDomDataKey=s.utils.domData.nextKey();s.bindingHandlers.selectedOptions={after:["options","foreach"],init:function(n,t,i){s.utils.registerEventHandler(n,"change",function(){var u=t(),r=[];s.utils.arrayForEach(n.getElementsByTagName("option"),function(n){n.selected&&r.push(s.selectExtensions.readValue(n))});s.expressionRewriting.writeValueToProperty(u,i,"selectedOptions",r)})},update:function(n,t){if(s.utils.tagNameLower(n)!="select")throw new Error("values binding applies only to SELECT elements");var i=s.utils.unwrapObservable(t());i&&typeof i.length=="number"&&s.utils.arrayForEach(n.getElementsByTagName("option"),function(n){var t=s.utils.arrayIndexOf(i,s.selectExtensions.readValue(n))>=0;s.utils.setOptionNodeSelectionState(n,t)})}};s.expressionRewriting.twoWayBindings.selectedOptions=!0;s.bindingHandlers.style={update:function(n,t){var i=s.utils.unwrapObservable(t()||{});s.utils.objectForEach(i,function(t,i){i=s.utils.unwrapObservable(i);n.style[t]=i||""})}};s.bindingHandlers.submit={init:function(n,t,i,r,u){if(typeof t()!="function")throw new Error("The value for a submit binding must be a function");s.utils.registerEventHandler(n,"submit",function(i){var r,f=t();try{r=f.call(u.$data,n)}finally{r!==!0&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};s.bindingHandlers.text={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){s.utils.setTextContent(n,t())}};s.virtualElements.allowedBindings.text=!0;s.bindingHandlers.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++s.bindingHandlers.uniqueName.currentIndex;s.utils.setElementName(n,i)}}};s.bindingHandlers.uniqueName.currentIndex=0;s.bindingHandlers.value={after:["options","foreach"],init:function(n,t,i){var r=["change"],u=i.get("valueUpdate"),f=!1,e,o;u&&(typeof u=="string"&&(u=[u]),s.utils.arrayPushAll(r,u),r=s.utils.arrayGetDistinctValues(r));e=function(){f=!1;var r=t(),u=s.selectExtensions.readValue(n);s.expressionRewriting.writeValueToProperty(r,i,"value",u)};o=s.utils.ieVersion&&n.tagName.toLowerCase()=="input"&&n.type=="text"&&n.autocomplete!="off"&&(!n.form||n.form.autocomplete!="off");o&&s.utils.arrayIndexOf(r,"propertychange")==-1&&(s.utils.registerEventHandler(n,"propertychange",function(){f=!0}),s.utils.registerEventHandler(n,"focus",function(){f=!1}),s.utils.registerEventHandler(n,"blur",function(){f&&e()}));s.utils.arrayForEach(r,function(t){var i=e;s.utils.stringStartsWith(t,"after")&&(i=function(){setTimeout(e,0)},t=t.substring(5));s.utils.registerEventHandler(n,t,i)})},update:function(n,t,i){var r=s.utils.unwrapObservable(t()),e=s.selectExtensions.readValue(n),o=r!==e,u,f;o&&(s.utils.tagNameLower(n)==="select"?(u=i.get("valueAllowUnset"),f=function(){s.selectExtensions.writeValue(n,r,u)},f(),u||r===s.selectExtensions.readValue(n)?setTimeout(f,0):s.dependencyDetection.ignore(s.utils.triggerEvent,null,[n,"change"])):s.selectExtensions.writeValue(n,r))}};s.expressionRewriting.twoWayBindings.value=!0;s.bindingHandlers.visible={update:function(n,t){var i=s.utils.unwrapObservable(t()),r=!(n.style.display=="none");i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}};ut("click");s.templateEngine=function(){};s.templateEngine.prototype.renderTemplateSource=function(){throw new Error("Override renderTemplateSource");};s.templateEngine.prototype.createJavaScriptEvaluatorBlock=function(){throw new Error("Override createJavaScriptEvaluatorBlock");};s.templateEngine.prototype.makeTemplateSource=function(n,t){if(typeof n=="string"){t=t||r;var i=t.getElementById(n);if(!i)throw new Error("Cannot find template with ID "+n);return new s.templateSources.domElement(i)}if(n.nodeType==1||n.nodeType==8)return new s.templateSources.anonymousTemplate(n);throw new Error("Unknown template type: "+n);};s.templateEngine.prototype.renderTemplate=function(n,t,i,r){var u=this.makeTemplateSource(n,r);return this.renderTemplateSource(u,t,i)};s.templateEngine.prototype.isTemplateRewritten=function(n,t){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(n,t).data("isRewritten")};s.templateEngine.prototype.rewriteTemplate=function(n,t,i){var r=this.makeTemplateSource(n,i),u=t(r.text());r.text(u);r.data("isRewritten",!0)};s.exportSymbol("templateEngine",s.templateEngine);s.templateRewriting=function(){function r(n){for(var i,r,u,f=s.expressionRewriting.bindingRewriteValidators,t=0;t<n.length;t++)if(i=n[t].key,f.hasOwnProperty(i))if(r=f[i],typeof r=="function"){if(u=r(n[t].value),u)throw new Error(u);}else if(!r)throw new Error("This template engine does not support the '"+i+"' binding within its templates");}function n(n,t,i,u){var f=s.expressionRewriting.parseObjectLiteral(n),e,o;return r(f),e=s.expressionRewriting.preProcessBindings(f,{valueAccessors:!0}),o="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+e+" } })()},'"+i.toLowerCase()+"')",u.createJavaScriptEvaluatorBlock(o)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/<!--\s*ko\b\s*([\s\S]*?)\s*-->/g;return{ensureTemplateIsRewritten:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return s.templateRewriting.memoizeBindingAttributeSyntax(n,t)},i)},memoizeBindingAttributeSyntax:function(r,u){return r.replace(t,function(){return n(arguments[4],arguments[1],arguments[2],u)}).replace(i,function(){return n(arguments[1],"<!-- ko -->","#comment",u)})},applyMemoizedBindingsToNextSibling:function(n,t){return s.memoization.memoize(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&s.applyBindingAccessorsToNode(u,n,r)})}}}();s.exportSymbol("__tr_ambtns",s.templateRewriting.applyMemoizedBindingsToNextSibling),function(){var i,n;s.templateSources={};s.templateSources.domElement=function(n){this.domElement=n};s.templateSources.domElement.prototype.text=function(){var i=s.utils.tagNameLower(this.domElement),n=i==="script"?"text":i==="textarea"?"value":"innerHTML",t;if(arguments.length==0)return this.domElement[n];t=arguments[0];n==="innerHTML"?s.utils.setHtml(this.domElement,t):this.domElement[n]=t};i=s.utils.domData.nextKey()+"_";s.templateSources.domElement.prototype.data=function(n){if(arguments.length===1)return s.utils.domData.get(this.domElement,i+n);s.utils.domData.set(this.domElement,i+n,arguments[1])};n=s.utils.domData.nextKey();s.templateSources.anonymousTemplate=function(n){this.domElement=n};s.templateSources.anonymousTemplate.prototype=new s.templateSources.domElement;s.templateSources.anonymousTemplate.prototype.constructor=s.templateSources.anonymousTemplate;s.templateSources.anonymousTemplate.prototype.text=function(){var i,r;if(arguments.length==0)return i=s.utils.domData.get(this.domElement,n)||{},i.textData===t&&i.containerData&&(i.textData=i.containerData.innerHTML),i.textData;r=arguments[0];s.utils.domData.set(this.domElement,n,{textData:r})};s.templateSources.domElement.prototype.nodes=function(){var t,i;if(arguments.length==0)return t=s.utils.domData.get(this.domElement,n)||{},t.containerData;i=arguments[0];s.utils.domData.set(this.domElement,n,{containerData:i})};s.exportSymbol("templateSources",s.templateSources);s.exportSymbol("templateSources.domElement",s.templateSources.domElement);s.exportSymbol("templateSources.anonymousTemplate",s.templateSources.anonymousTemplate)}(),function(){function i(n,t,i){for(var u,r=n,f=s.virtualElements.nextSibling(t);r&&(u=r)!==f;)r=s.virtualElements.nextSibling(u),i(u,r)}function f(n,t){if(n.length){var r=n[0],u=n[n.length-1],f=r.parentNode,e=s.bindingProvider.instance,o=e.preprocessNode;if(o){if(i(r,u,function(n,t){var f=n.previousSibling,i=o.call(e,n);i&&(n===r&&(r=i[0]||t),n===u&&(u=i[i.length-1]||f))}),n.length=0,!r)return;r===u?n.push(r):(n.push(r,u),s.utils.fixUpContinuousNodeArray(n,f))}i(r,u,function(n){(n.nodeType===1||n.nodeType===8)&&s.applyBindings(t,n)});i(r,u,function(n){(n.nodeType===1||n.nodeType===8)&&s.memoization.unmemoizeDomNodeAndDescendants(n,[t])});s.utils.fixUpContinuousNodeArray(n,f)}}function r(n){return n.nodeType?n:n.length>0?n[0]:null}function e(t,i,u,e,o){var h,c;o=o||{};var l=t&&r(t),a=l&&l.ownerDocument,v=o.templateEngine||n;if(s.templateRewriting.ensureTemplateIsRewritten(u,v,a),h=v.renderTemplate(u,e,o,a),typeof h.length!="number"||h.length>0&&typeof h[0].nodeType!="number")throw new Error("Template engine must return an array of DOM nodes");c=!1;switch(i){case"replaceChildren":s.virtualElements.setDomNodeChildren(t,h);c=!0;break;case"replaceNode":s.utils.replaceDomNodes(t,h);c=!0;break;case"ignoreTargetNode":break;default:throw new Error("Unknown renderMode: "+i);}return c&&(f(h,e),o.afterRender&&s.dependencyDetection.ignore(o.afterRender,null,[h,e.$data])),h}function o(n,i){var r=s.utils.domData.get(n,u);r&&typeof r.dispose=="function"&&r.dispose();s.utils.domData.set(n,u,i&&i.isActive()?i:t)}var n,u;s.setTemplateEngine=function(i){if(i!=t&&!(i instanceof s.templateEngine))throw new Error("templateEngine must inherit from ko.templateEngine");n=i};s.renderTemplate=function(i,u,f,o,h){if(f=f||{},(f.templateEngine||n)==t)throw new Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",o){var c=r(o),l=function(){return!c||!s.utils.domNodeIsAttachedToDocument(c)},a=c&&h=="replaceNode"?c.parentNode:c;return s.dependentObservable(function(){var n=u&&u instanceof s.bindingContext?u:new s.bindingContext(s.utils.unwrapObservable(u)),t=s.isObservable(i)?i():typeof i=="function"?i(n.$data,n):i,l=e(o,h,t,n,f);h=="replaceNode"&&(o=l,c=r(o))},null,{disposeWhen:l,disposeWhenNodeIsRemoved:a})}return s.memoization.memoize(function(n){s.renderTemplate(i,u,f,n,"replaceNode")})};s.renderTemplateForEach=function(n,i,r,u,o){var h,c=function(t,i){h=o.createChildContext(t,r.as,function(n){n.$index=i});var u=typeof n=="function"?n(t,h):n;return e(null,"ignoreTargetNode",u,h,r)},l=function(n,t){f(t,h);r.afterRender&&r.afterRender(t,n)};return s.dependentObservable(function(){var n=s.utils.unwrapObservable(i)||[],f;typeof n.length=="undefined"&&(n=[n]);f=s.utils.arrayFilter(n,function(n){return r.includeDestroyed||n===t||n===null||!s.utils.unwrapObservable(n._destroy)});s.dependencyDetection.ignore(s.utils.setDomNodeChildrenFromArrayMapping,null,[u,f,c,r,l])},null,{disposeWhenNodeIsRemoved:u})};u=s.utils.domData.nextKey();s.bindingHandlers.template={init:function(n,t){var i=s.utils.unwrapObservable(t()),r,u;return typeof i=="string"||i.name?s.virtualElements.emptyNode(n):(r=s.virtualElements.childNodes(n),u=s.utils.moveCleanedNodesToContainerElement(r),new s.templateSources.anonymousTemplate(n).nodes(u)),{controlsDescendantBindings:!0}},update:function(n,t,i,r,u){var l=t(),a,f=s.utils.unwrapObservable(l),e=!0,c=null,h,v,y;typeof f=="string"?(h=l,f={}):(h=f.name,"if"in f&&(e=s.utils.unwrapObservable(f["if"])),e&&"ifnot"in f&&(e=!s.utils.unwrapObservable(f.ifnot)),a=s.utils.unwrapObservable(f.data));"foreach"in f?(v=e&&f.foreach||[],c=s.renderTemplateForEach(h||n,v,f,n,u)):e?(y="data"in f?u.createChildContext(a,f.as):u,c=s.renderTemplate(h||n,y,f,n)):s.virtualElements.emptyNode(n);o(n,c)}};s.expressionRewriting.bindingRewriteValidators.template=function(n){var t=s.expressionRewriting.parseObjectLiteral(n);return t.length==1&&t[0].unknown?null:s.expressionRewriting.keyValueArrayContainsKey(t,"name")?null:"This template engine does not support anonymous templates nested within its templates"};s.virtualElements.allowedBindings.template=!0}();s.exportSymbol("setTemplateEngine",s.setTemplateEngine);s.exportSymbol("renderTemplate",s.renderTemplate);s.utils.findMovesInArrayComparison=function(n,t,i){if(n.length&&t.length)for(var o,r,f,e,u=o=0;(!i||u<i)&&(f=n[o]);++o){for(r=0;e=t[r];++r)if(f.value===e.value){f.moved=e.index;e.moved=f.index;t.splice(r,1);u=r=0;break}u+=r}};s.utils.compareArrays=function(){function r(r,u,f){return f=typeof f=="boolean"?{dontLimitMoves:f}:f||{},r=r||[],u=u||[],r.length<=u.length?i(r,u,n,t,f):i(u,r,t,n,f)}function i(n,t,i,r,u){for(var p=Math.min,it=Math.max,l=[],c=n.length,f,a=t.length,rt=a-c||1,w=c+a+1,o,v,b,k,d,g,e=0;e<=c;e++)for(v=o,l.push(o=[]),b=p(a,e+rt),k=it(0,e-1),f=k;f<=b;f++)f?e?n[e-1]===t[f-1]?o[f]=v[f-1]:(d=v[f]||w,g=o[f-1]||w,o[f]=p(d,g)+1):o[f]=f+1:o[f]=e+1;var h=[],y,nt=[],tt=[];for(e=c,f=a;e||f;)y=l[e][f]-1,f&&y===l[e][f-1]?nt.push(h[h.length]={status:i,value:t[--f],index:f}):e&&y===l[e-1][f]?tt.push(h[h.length]={status:r,value:n[--e],index:e}):(--f,--e,u.sparse||h.push({status:"retained",value:t[f]}));return s.utils.findMovesInArrayComparison(nt,tt,c*10),h.reverse()}var n="added",t="deleted";return r}();s.exportSymbol("utils.compareArrays",s.utils.compareArrays),function(){function i(n,i,r,u,f){var e=[],o=s.dependentObservable(function(){var t=i(r,f,s.utils.fixUpContinuousNodeArray(e,n))||[];e.length>0&&(s.utils.replaceDomNodes(e,t),u&&s.dependencyDetection.ignore(u,null,[r,t,f]));e.length=0;s.utils.arrayPushAll(e,t)},null,{disposeWhenNodeIsRemoved:n,disposeWhen:function(){return!s.utils.anyDomNodeIsAttachedToDocument(e)}});return{mappedNodes:e,dependentObservable:o.isActive()?o:t}}var n=s.utils.domData.nextKey();s.utils.setDomNodeChildrenFromArrayMapping=function(r,u,f,e,o){function ft(n,t){h=w[t];d!==t&&(nt[n]=h);h.indexObservable(d++);s.utils.fixUpContinuousNodeArray(h.mappedNodes,r);b.push(h);a.push(h)}function v(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&s.utils.arrayForEach(t[i].mappedNodes,function(r){n(r,i,t[i].arrayEntry)})}var y,p,c,tt,et,l,it;u=u||[];e=e||{};var ot=s.utils.domData.get(r,n)===t,w=s.utils.domData.get(r,n)||[],st=s.utils.arrayMap(w,function(n){return n.arrayEntry}),ht=s.utils.compareArrays(st,u,e.dontLimitMoves),b=[],k=0,d=0,g=[],a=[],rt=[],nt=[],ut=[],h;for(c=0;y=ht[c];c++){p=y.moved;switch(y.status){case"deleted":p===t&&(h=w[k],h.dependentObservable&&h.dependentObservable.dispose(),g.push.apply(g,s.utils.fixUpContinuousNodeArray(h.mappedNodes,r)),e.beforeRemove&&(rt[c]=h,a.push(h)));k++;break;case"retained":ft(c,k++);break;case"added":p!==t?ft(c,p):(h={arrayEntry:y.value,indexObservable:s.observable(d++)},b.push(h),a.push(h),ot||(ut[c]=h))}}for(v(e.beforeMove,nt),s.utils.arrayForEach(g,e.beforeRemove?s.cleanNode:s.removeNode),c=0,tt=s.virtualElements.firstChild(r);h=a[c];c++){for(h.mappedNodes||s.utils.extend(h,i(r,f,h.arrayEntry,o,h.indexObservable)),it=0;l=h.mappedNodes[it];tt=l.nextSibling,et=l,it++)l!==tt&&s.virtualElements.insertAfter(r,l,et);!h.initialized&&o&&(o(h.arrayEntry,h.mappedNodes,h.indexObservable),h.initialized=!0)}v(e.beforeRemove,rt);v(e.afterMove,nt);v(e.afterAdd,ut);s.utils.domData.set(r,n,b)}}();s.exportSymbol("utils.setDomNodeChildrenFromArrayMapping",s.utils.setDomNodeChildrenFromArrayMapping);s.nativeTemplateEngine=function(){this.allowTemplateRewriting=!1};s.nativeTemplateEngine.prototype=new s.templateEngine;s.nativeTemplateEngine.prototype.constructor=s.nativeTemplateEngine;s.nativeTemplateEngine.prototype.renderTemplateSource=function(n){var r=!(s.utils.ieVersion<9),u=r?n.nodes:null,t=u?n.nodes():null,i;return t?s.utils.makeArray(t.cloneNode(!0).childNodes):(i=n.text(),s.utils.parseHtmlFragment(i))};s.nativeTemplateEngine.instance=new s.nativeTemplateEngine;s.setTemplateEngine(s.nativeTemplateEngine.instance);s.exportSymbol("nativeTemplateEngine",s.nativeTemplateEngine),function(){s.jqueryTmplTemplateEngine=function(){function t(){if(n<2)throw new Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");}function u(n,t,r){return i.tmpl(n,t,r)}var n=this.jQueryTmplVersion=function(){if(!i||!i.tmpl)return 0;try{if(i.tmpl.tag.tmpl.open.toString().indexOf("__")>=0)return 2}catch(n){}return 1}();this.renderTemplateSource=function(n,f,e){var o,s;e=e||{};t();o=n.data("precompiled");o||(s=n.text()||"",s="{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}",o=i.template(null,s),n.data("precompiled",o));var c=[f.$data],l=i.extend({koBindingContext:f},e.templateOptions),h=u(o,c,l);return h.appendTo(r.createElement("div")),i.fragments={},h};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){r.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};n>0&&(i.tmpl.tag.ko_code={open:"__.push($1 || '');"},i.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};s.jqueryTmplTemplateEngine.prototype=new s.templateEngine;s.jqueryTmplTemplateEngine.prototype.constructor=s.jqueryTmplTemplateEngine;var n=new s.jqueryTmplTemplateEngine;n.jQueryTmplVersion>0&&s.setTemplateEngine(n);s.exportSymbol("jqueryTmplTemplateEngine",s.jqueryTmplTemplateEngine)}()})})()}();Enumerable=function(){var n=function(n){this.GetEnumerator=n},s,u;n.Choice=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments;return new n(function(){return new i(r.Blank,function(){return this.Yield(t[Math.floor(Math.random()*t.length)])},r.Blank)})};n.Cycle=function(){var t=arguments[0]instanceof Array?arguments[0]:arguments;return new n(function(){var n=0;return new i(r.Blank,function(){return n>=t.length&&(n=0),this.Yield(t[n++])},r.Blank)})};n.Empty=function(){return new n(function(){return new i(r.Blank,function(){return!1},r.Blank)})};n.From=function(e){if(e==null)return n.Empty();if(e instanceof n)return e;if(typeof e==f.Number||typeof e==f.Boolean)return n.Repeat(e,1);if(typeof e==f.String)return new n(function(){var n=0;return new i(r.Blank,function(){return n<e.length?this.Yield(e.charAt(n++)):!1},r.Blank)});if(typeof e!=f.Function){if(typeof e.length==f.Number)return new u(e);if(!(e instanceof Object)&&t.IsIEnumerable(e))return new n(function(){var t=!0,n;return new i(function(){n=new Enumerator(e)},function(){return t?t=!1:n.moveNext(),n.atEnd()?!1:this.Yield(n.item())},r.Blank)})}return new n(function(){var n=[],t=0;return new i(function(){for(var t in e)e[t]instanceof Function||n.push({Key:t,Value:e[t]})},function(){return t<n.length?this.Yield(n[t++]):!1},r.Blank)})};n.Return=function(t){return n.Repeat(t,1)};n.Matches=function(t,u,f){return f==null&&(f=""),u instanceof RegExp&&(f+=u.ignoreCase?"i":"",f+=u.multiline?"m":"",u=u.source),f.indexOf("g")===-1&&(f+="g"),new n(function(){var n;return new i(function(){n=new RegExp(u,f)},function(){var i=n.exec(t);return i?this.Yield(i):!1},r.Blank)})};n.Range=function(t,i,r){return r==null&&(r=1),n.ToInfinity(t,r).Take(i)};n.RangeDown=function(t,i,r){return r==null&&(r=1),n.ToNegativeInfinity(t,r).Take(i)};n.RangeTo=function(t,i,r){return r==null&&(r=1),t<i?n.ToInfinity(t,r).TakeWhile(function(n){return n<=i}):n.ToNegativeInfinity(t,r).TakeWhile(function(n){return n>=i})};n.Repeat=function(t,u){return u!=null?n.Repeat(t).Take(u):new n(function(){return new i(r.Blank,function(){return this.Yield(t)},r.Blank)})};n.RepeatWithFinalize=function(r,u){return r=t.CreateLambda(r),u=t.CreateLambda(u),new n(function(){var n;return new i(function(){n=r()},function(){return this.Yield(n)},function(){n!=null&&(u(n),n=null)})})};n.Generate=function(u,f){return f!=null?n.Generate(u).Take(f):(u=t.CreateLambda(u),new n(function(){return new i(r.Blank,function(){return this.Yield(u())},r.Blank)}))};n.ToInfinity=function(t,u){return t==null&&(t=0),u==null&&(u=1),new n(function(){var n;return new i(function(){n=t-u},function(){return this.Yield(n+=u)},r.Blank)})};n.ToNegativeInfinity=function(t,u){return t==null&&(t=0),u==null&&(u=1),new n(function(){var n;return new i(function(){n=t+u},function(){return this.Yield(n-=u)},r.Blank)})};n.Unfold=function(u,f){return f=t.CreateLambda(f),new n(function(){var t=!0,n;return new i(r.Blank,function(){return t?(t=!1,n=u,this.Yield(n)):(n=f(n),this.Yield(n))},r.Blank)})};n.prototype={CascadeBreadthFirst:function(r,u){var f=this;return r=t.CreateLambda(r),u=t.CreateLambda(u),new n(function(){var e,s=0,o=[];return new i(function(){e=f.GetEnumerator()},function(){for(;;){if(e.MoveNext())return o.push(e.Current()),this.Yield(u(e.Current(),s));var i=n.From(o).SelectMany(function(n){return r(n)});if(i.Any())s++,o=[],t.Dispose(e),e=i.GetEnumerator();else return!1}},function(){t.Dispose(e)})})},CascadeDepthFirst:function(r,u){var f=this;return r=t.CreateLambda(r),u=t.CreateLambda(u),new n(function(){var o=[],e;return new i(function(){e=f.GetEnumerator()},function(){for(;;){if(e.MoveNext()){var i=u(e.Current(),o.length);return o.push(e),e=n.From(r(e.Current())).GetEnumerator(),this.Yield(i)}if(o.length<=0)return!1;t.Dispose(e);e=o.pop()}},function(){try{t.Dispose(e)}finally{n.From(o).ForEach(function(n){n.Dispose()})}})})},Flatten:function(){var u=this;return new n(function(){var e,f=null;return new i(function(){e=u.GetEnumerator()},function(){for(;;){if(f!=null){if(f.MoveNext())return this.Yield(f.Current());f=null}if(e.MoveNext())if(e.Current()instanceof Array){t.Dispose(f);f=n.From(e.Current()).SelectMany(r.Identity).Flatten().GetEnumerator();continue}else return this.Yield(e.Current());return!1}},function(){try{t.Dispose(e)}finally{t.Dispose(f)}})})},Pairwise:function(r){var u=this;return r=t.CreateLambda(r),new n(function(){var n;return new i(function(){n=u.GetEnumerator();n.MoveNext()},function(){var t=n.Current();return n.MoveNext()?this.Yield(r(t,n.Current())):!1},function(){t.Dispose(n)})})},Scan:function(r,u,f){var e,o;return f!=null?this.Scan(r,u).Select(f):(u==null?(u=t.CreateLambda(r),e=!1):(u=t.CreateLambda(u),e=!0),o=this,new n(function(){var n,f,s=!0;return new i(function(){n=o.GetEnumerator()},function(){if(s){if(s=!1,e)return this.Yield(f=r);if(n.MoveNext())return this.Yield(f=n.Current())}return n.MoveNext()?this.Yield(f=u(f,n.Current())):!1},function(){t.Dispose(n)})}))},Select:function(r){var u=this;return r=t.CreateLambda(r),new n(function(){var n,f=0;return new i(function(){n=u.GetEnumerator()},function(){return n.MoveNext()?this.Yield(r(n.Current(),f++)):!1},function(){t.Dispose(n)})})},SelectMany:function(r,u){var f=this;return r=t.CreateLambda(r),u==null&&(u=function(n,t){return t}),u=t.CreateLambda(u),new n(function(){var o,e=undefined,s=0;return new i(function(){o=f.GetEnumerator()},function(){if(e===undefined&&!o.MoveNext())return!1;do{if(e==null){var i=r(o.Current(),s++);e=n.From(i).GetEnumerator()}if(e.MoveNext())return this.Yield(u(o.Current(),e.Current()));t.Dispose(e);e=null}while(o.MoveNext());return!1},function(){try{t.Dispose(o)}finally{t.Dispose(e)}})})},Where:function(r){r=t.CreateLambda(r);var u=this;return new n(function(){var n,f=0;return new i(function(){n=u.GetEnumerator()},function(){while(n.MoveNext())if(r(n.Current(),f++))return this.Yield(n.Current());return!1},function(){t.Dispose(n)})})},OfType:function(n){var t;switch(n){case Number:t=f.Number;break;case String:t=f.String;break;case Boolean:t=f.Boolean;break;case Function:t=f.Function;break;default:t=null}return t===null?this.Where(function(t){return t instanceof n}):this.Where(function(n){return typeof n===t})},Zip:function(r,u){u=t.CreateLambda(u);var f=this;return new n(function(){var e,o,s=0;return new i(function(){e=f.GetEnumerator();o=n.From(r).GetEnumerator()},function(){return e.MoveNext()&&o.MoveNext()?this.Yield(u(e.Current(),o.Current(),s++)):!1},function(){try{t.Dispose(e)}finally{t.Dispose(o)}})})},Join:function(u,f,e,o,s){f=t.CreateLambda(f);e=t.CreateLambda(e);o=t.CreateLambda(o);s=t.CreateLambda(s);var h=this;return new n(function(){var c,a,l=null,v=0;return new i(function(){c=h.GetEnumerator();a=n.From(u).ToLookup(e,r.Identity,s)},function(){for(var n,t;;){if(l!=null){if(n=l[v++],n!==undefined)return this.Yield(o(c.Current(),n));n=null;v=0}if(c.MoveNext())t=f(c.Current()),l=a.Get(t).ToArray();else return!1}},function(){t.Dispose(c)})})},GroupJoin:function(u,f,e,o,s){f=t.CreateLambda(f);e=t.CreateLambda(e);o=t.CreateLambda(o);s=t.CreateLambda(s);var h=this;return new n(function(){var c=h.GetEnumerator(),l=null;return new i(function(){c=h.GetEnumerator();l=n.From(u).ToLookup(e,r.Identity,s)},function(){if(c.MoveNext()){var n=l.Get(f(c.Current()));return this.Yield(o(c.Current(),n))}return!1},function(){t.Dispose(c)})})},All:function(n){n=t.CreateLambda(n);var i=!0;return this.ForEach(function(t){if(!n(t))return i=!1,!1}),i},Any:function(n){n=t.CreateLambda(n);var i=this.GetEnumerator();try{if(arguments.length==0)return i.MoveNext();while(i.MoveNext())if(n(i.Current()))return!0;return!1}finally{t.Dispose(i)}},Concat:function(r){var u=this;return new n(function(){var e,f;return new i(function(){e=u.GetEnumerator()},function(){if(f==null){if(e.MoveNext())return this.Yield(e.Current());f=n.From(r).GetEnumerator()}return f.MoveNext()?this.Yield(f.Current()):!1},function(){try{t.Dispose(e)}finally{t.Dispose(f)}})})},Insert:function(r,u){var f=this;return new n(function(){var o,e,s=0,h=!1;return new i(function(){o=f.GetEnumerator();e=n.From(u).GetEnumerator()},function(){return s==r&&e.MoveNext()?(h=!0,this.Yield(e.Current())):o.MoveNext()?(s++,this.Yield(o.Current())):!h&&e.MoveNext()?this.Yield(e.Current()):!1},function(){try{t.Dispose(o)}finally{t.Dispose(e)}})})},Alternate:function(t){return t=n.Return(t),this.SelectMany(function(i){return n.Return(i).Concat(t)}).TakeExceptLast()},Contains:function(n,i){i=t.CreateLambda(i);var r=this.GetEnumerator();try{while(r.MoveNext())if(i(r.Current())===n)return!0;return!1}finally{t.Dispose(r)}},DefaultIfEmpty:function(r){var u=this;return new n(function(){var n,f=!0;return new i(function(){n=u.GetEnumerator()},function(){return n.MoveNext()?(f=!1,this.Yield(n.Current())):f?(f=!1,this.Yield(r)):!1},function(){t.Dispose(n)})})},Distinct:function(t){return this.Except(n.Empty(),t)},Except:function(r,u){u=t.CreateLambda(u);var f=this;return new n(function(){var e,o;return new i(function(){e=f.GetEnumerator();o=new h(u);n.From(r).ForEach(function(n){o.Add(n)})},function(){while(e.MoveNext()){var n=e.Current();if(!o.Contains(n))return o.Add(n),this.Yield(n)}return!1},function(){t.Dispose(e)})})},Intersect:function(r,u){u=t.CreateLambda(u);var f=this;return new n(function(){var e,o,s;return new i(function(){e=f.GetEnumerator();o=new h(u);n.From(r).ForEach(function(n){o.Add(n)});s=new h(u)},function(){while(e.MoveNext()){var n=e.Current();if(!s.Contains(n)&&o.Contains(n))return s.Add(n),this.Yield(n)}return!1},function(){t.Dispose(e)})})},SequenceEqual:function(i,r){var f,u;r=t.CreateLambda(r);f=this.GetEnumerator();try{u=n.From(i).GetEnumerator();try{while(f.MoveNext())if(!u.MoveNext()||r(f.Current())!==r(u.Current()))return!1;return u.MoveNext()?!1:!0}finally{t.Dispose(u)}}finally{t.Dispose(f)}},Union:function(r,u){u=t.CreateLambda(u);var f=this;return new n(function(){var s,e,o;return new i(function(){s=f.GetEnumerator();o=new h(u)},function(){var t;if(e===undefined){while(s.MoveNext())if(t=s.Current(),!o.Contains(t))return o.Add(t),this.Yield(t);e=n.From(r).GetEnumerator()}while(e.MoveNext())if(t=e.Current(),!o.Contains(t))return o.Add(t),this.Yield(t);return!1},function(){try{t.Dispose(s)}finally{t.Dispose(e)}})})},OrderBy:function(n){return new e(this,n,!1)},OrderByDescending:function(n){return new e(this,n,!0)},Reverse:function(){var t=this;return new n(function(){var n,u;return new i(function(){n=t.ToArray();u=n.length},function(){return u>0?this.Yield(n[--u]):!1},r.Blank)})},Shuffle:function(){var t=this;return new n(function(){var n;return new i(function(){n=t.ToArray()},function(){if(n.length>0){var t=Math.floor(Math.random()*n.length);return this.Yield(n.splice(t,1)[0])}return!1},r.Blank)})},GroupBy:function(r,u,f,e){var o=this;return r=t.CreateLambda(r),u=t.CreateLambda(u),f!=null&&(f=t.CreateLambda(f)),e=t.CreateLambda(e),new n(function(){var n;return new i(function(){n=o.ToLookup(r,u,e).ToEnumerable().GetEnumerator()},function(){while(n.MoveNext())return f==null?this.Yield(n.Current()):this.Yield(f(n.Current().Key(),n.Current()));return!1},function(){t.Dispose(n)})})},PartitionBy:function(r,u,f,e){var s=this,o;return r=t.CreateLambda(r),u=t.CreateLambda(u),e=t.CreateLambda(e),f==null?(o=!1,f=function(n,t){return new c(n,t)}):(o=!0,f=t.CreateLambda(f)),new n(function(){var h,l,a,c=[];return new i(function(){h=s.GetEnumerator();h.MoveNext()&&(l=r(h.Current()),a=e(l),c.push(u(h.Current())))},function(){for(var t,i;(t=h.MoveNext())==!0;)if(a===e(r(h.Current())))c.push(u(h.Current()));else break;return c.length>0?(i=o?f(l,n.From(c)):f(l,c),t?(l=r(h.Current()),a=e(l),c=[u(h.Current())]):c=[],this.Yield(i)):!1},function(){t.Dispose(h)})})},BufferWithCount:function(r){var u=this;return new n(function(){var n;return new i(function(){n=u.GetEnumerator()},function(){for(var t=[],i=0;n.MoveNext();)if(t.push(n.Current()),++i>=r)return this.Yield(t);return t.length>0?this.Yield(t):!1},function(){t.Dispose(n)})})},Aggregate:function(n,t,i){return this.Scan(n,t,i).Last()},Average:function(n){n=t.CreateLambda(n);var i=0,r=0;return this.ForEach(function(t){i+=n(t);++r}),i/r},Count:function(n){n=n==null?r.True:t.CreateLambda(n);var i=0;return this.ForEach(function(t,r){n(t,r)&&++i}),i},Max:function(n){return n==null&&(n=r.Identity),this.Select(n).Aggregate(function(n,t){return n>t?n:t})},Min:function(n){return n==null&&(n=r.Identity),this.Select(n).Aggregate(function(n,t){return n<t?n:t})},MaxBy:function(n){return n=t.CreateLambda(n),this.Aggregate(function(t,i){return n(t)>n(i)?t:i})},MinBy:function(n){return n=t.CreateLambda(n),this.Aggregate(function(t,i){return n(t)<n(i)?t:i})},Sum:function(n){return n==null&&(n=r.Identity),this.Select(n).Aggregate(0,function(n,t){return n+t})},ElementAt:function(n){var t,i=!1;if(this.ForEach(function(r,u){if(u==n)return t=r,i=!0,!1}),!i)throw new Error("index is less than 0 or greater than or equal to the number of elements in source.");return t},ElementAtOrDefault:function(n,t){var i,r=!1;return this.ForEach(function(t,u){if(u==n)return i=t,r=!0,!1}),r?i:t},First:function(n){if(n!=null)return this.Where(n).First();var t,i=!1;if(this.ForEach(function(n){return t=n,i=!0,!1}),!i)throw new Error("First:No element satisfies the condition.");return t},FirstOrDefault:function(n,t){if(t!=null)return this.Where(t).FirstOrDefault(n);var i,r=!1;return this.ForEach(function(n){return i=n,r=!0,!1}),r?i:n},Last:function(n){if(n!=null)return this.Where(n).Last();var t,i=!1;if(this.ForEach(function(n){i=!0;t=n}),!i)throw new Error("Last:No element satisfies the condition.");return t},LastOrDefault:function(n,t){if(t!=null)return this.Where(t).LastOrDefault(n);var i,r=!1;return this.ForEach(function(n){r=!0;i=n}),r?i:n},Single:function(n){if(n!=null)return this.Where(n).Single();var i,t=!1;if(this.ForEach(function(n){if(t)throw new Error("Single:sequence contains more than one element.");else t=!0,i=n}),!t)throw new Error("Single:No element satisfies the condition.");return i},SingleOrDefault:function(n,t){if(t!=null)return this.Where(t).SingleOrDefault(n);var r,i=!1;return this.ForEach(function(n){if(i)throw new Error("Single:sequence contains more than one element.");else i=!0,r=n}),i?r:n},Skip:function(r){var u=this;return new n(function(){var n,f=0;return new i(function(){for(n=u.GetEnumerator();f++<r&&n.MoveNext(););},function(){return n.MoveNext()?this.Yield(n.Current()):!1},function(){t.Dispose(n)})})},SkipWhile:function(r){r=t.CreateLambda(r);var u=this;return new n(function(){var n,e=0,f=!1;return new i(function(){n=u.GetEnumerator()},function(){while(!f)if(n.MoveNext()){if(!r(n.Current(),e++))return f=!0,this.Yield(n.Current());continue}else return!1;return n.MoveNext()?this.Yield(n.Current()):!1},function(){t.Dispose(n)})})},Take:function(r){var u=this;return new n(function(){var n,f=0;return new i(function(){n=u.GetEnumerator()},function(){return f++<r&&n.MoveNext()?this.Yield(n.Current()):!1},function(){t.Dispose(n)})})},TakeWhile:function(r){r=t.CreateLambda(r);var u=this;return new n(function(){var n,f=0;return new i(function(){n=u.GetEnumerator()},function(){return n.MoveNext()&&r(n.Current(),f++)?this.Yield(n.Current()):!1},function(){t.Dispose(n)})})},TakeExceptLast:function(r){r==null&&(r=1);var u=this;return new n(function(){if(r<=0)return u.GetEnumerator();var n,f=[];return new i(function(){n=u.GetEnumerator()},function(){while(n.MoveNext()){if(f.length==r)return f.push(n.Current()),this.Yield(f.shift());f.push(n.Current())}return!1},function(){t.Dispose(n)})})},TakeFromLast:function(r){if(r<=0||r==null)return n.Empty();var u=this;return new n(function(){var o,f,e=[];return new i(function(){o=u.GetEnumerator()},function(){while(o.MoveNext())e.length==r&&e.shift(),e.push(o.Current());return f==null&&(f=n.From(e).GetEnumerator()),f.MoveNext()?this.Yield(f.Current()):!1},function(){t.Dispose(f)})})},IndexOf:function(n){var t=null;return this.ForEach(function(i,r){if(i===n)return t=r,!0}),t!==null?t:-1},LastIndexOf:function(n){var t=-1;return this.ForEach(function(i,r){i===n&&(t=r)}),t},ToArray:function(){var n=[];return this.ForEach(function(t){n.push(t)}),n},ToLookup:function(n,i,r){n=t.CreateLambda(n);i=t.CreateLambda(i);r=t.CreateLambda(r);var u=new h(r);return this.ForEach(function(t){var r=n(t),f=i(t),e=u.Get(r);e!==undefined?e.push(f):u.Add(r,[f])}),new a(u)},ToObject:function(n,i){n=t.CreateLambda(n);i=t.CreateLambda(i);var r={};return this.ForEach(function(t){r[n(t)]=i(t)}),r},ToDictionary:function(n,i,r){n=t.CreateLambda(n);i=t.CreateLambda(i);r=t.CreateLambda(r);var u=new h(r);return this.ForEach(function(t){u.Add(n(t),i(t))}),u},ToJSON:function(n,t){return JSON.stringify(this.ToArray(),n,t)},ToString:function(n,t){return n==null&&(n=""),t==null&&(t=r.Identity),this.Select(t).ToArray().join(n)},Do:function(r){var u=this;return r=t.CreateLambda(r),new n(function(){var n,f=0;return new i(function(){n=u.GetEnumerator()},function(){return n.MoveNext()?(r(n.Current(),f++),this.Yield(n.Current())):!1},function(){t.Dispose(n)})})},ForEach:function(n){n=t.CreateLambda(n);var r=0,i=this.GetEnumerator();try{while(i.MoveNext())if(n(i.Current(),r++)===!1)break}finally{t.Dispose(i)}},Write:function(n,i){n==null&&(n="");i=t.CreateLambda(i);var r=!0;this.ForEach(function(t){r?r=!1:document.write(n);document.write(i(t))})},WriteLine:function(n){n=t.CreateLambda(n);this.ForEach(function(t){document.write(n(t));document.write("<br />")})},Force:function(){var n=this.GetEnumerator();try{while(n.MoveNext());}finally{t.Dispose(n)}},Let:function(r){r=t.CreateLambda(r);var u=this;return new n(function(){var f;return new i(function(){f=n.From(r(u)).GetEnumerator()},function(){return f.MoveNext()?this.Yield(f.Current()):!1},function(){t.Dispose(f)})})},Share:function(){var u=this,t;return new n(function(){return new i(function(){t==null&&(t=u.GetEnumerator())},function(){return t.MoveNext()?this.Yield(t.Current()):!1},r.Blank)})},MemoizeAll:function(){var f=this,t,u;return new n(function(){var n=-1;return new i(function(){u==null&&(u=f.GetEnumerator(),t=[])},function(){return(n++,t.length<=n)?u.MoveNext()?this.Yield(t[n]=u.Current()):!1:this.Yield(t[n])},r.Blank)})},Catch:function(r){r=t.CreateLambda(r);var u=this;return new n(function(){var n;return new i(function(){n=u.GetEnumerator()},function(){try{return n.MoveNext()?this.Yield(n.Current()):!1}catch(t){return r(t),!1}},function(){t.Dispose(n)})})},Finally:function(r){r=t.CreateLambda(r);var u=this;return new n(function(){var n;return new i(function(){n=u.GetEnumerator()},function(){return n.MoveNext()?this.Yield(n.Current()):!1},function(){try{t.Dispose(n)}finally{r()}})})},Trace:function(n,i){return n==null&&(n="Trace"),i=t.CreateLambda(i),this.Do(function(t){console.log(n,":",i(t))})}};var r={Identity:function(n){return n},True:function(){return!0},Blank:function(){}},f={Boolean:"boolean",Number:"number",String:"string",Object:"object",Undefined:typeof undefined,Function:typeof function(){}},t={CreateLambda:function(n){if(n==null)return r.Identity;if(typeof n==f.String){if(n=="")return r.Identity;if(n.indexOf("=>")==-1)return new Function("$,$$,$$$,$$$$","return "+n);var t=n.match(/^[(\s]*([^()]*?)[)\s]*=>(.*)/);return new Function(t[1],"return "+t[2])}return n},IsIEnumerable:function(n){if(typeof Enumerator!=f.Undefined)try{return new Enumerator(n),!0}catch(t){}return!1},Compare:function(n,t){return n===t?0:n>t?1:-1},Dispose:function(n){n!=null&&n.Dispose()}},o={Before:0,Running:1,After:2},i=function(n,t,i){var u=new l,r=o.Before;this.Current=u.Current;this.MoveNext=function(){try{switch(r){case o.Before:r=o.Running;n();case o.Running:return t.apply(u)?!0:(this.Dispose(),!1);case o.After:return!1}}catch(i){this.Dispose();throw i;}};this.Dispose=function(){if(r==o.Running)try{i()}finally{r=o.After}}},l=function(){var n=null;this.Current=function(){return n};this.Yield=function(t){return n=t,!0}},e=function(n,i,r,u){this.source=n;this.keySelector=t.CreateLambda(i);this.descending=r;this.parent=u};e.prototype=new n;e.prototype.CreateOrderedEnumerable=function(n,t){return new e(this.source,n,t,this)};e.prototype.ThenBy=function(n){return this.CreateOrderedEnumerable(n,!1)};e.prototype.ThenByDescending=function(n){return this.CreateOrderedEnumerable(n,!0)};e.prototype.GetEnumerator=function(){var u=this,t,n,f=0;return new i(function(){t=[];n=[];u.source.ForEach(function(i,r){t.push(i);n.push(r)});var i=s.Create(u,null);i.GenerateKeys(t);n.sort(function(n,t){return i.Compare(n,t)})},function(){return f<n.length?this.Yield(t[n[f++]]):!1},r.Blank)};s=function(n,t,i){this.keySelector=n;this.descending=t;this.child=i;this.keys=null};s.Create=function(n,t){var i=new s(n.keySelector,n.descending,t);return n.parent!=null?s.Create(n.parent,i):i};s.prototype.GenerateKeys=function(n){for(var i=n.length,u=this.keySelector,r=new Array(i),t=0;t<i;t++)r[t]=u(n[t]);this.keys=r;this.child!=null&&this.child.GenerateKeys(n)};s.prototype.Compare=function(n,i){var r=t.Compare(this.keys[n],this.keys[i]);if(r==0){if(this.child!=null)return this.child.Compare(n,i);r=t.Compare(n,i)}return this.descending?-r:r};u=function(n){this.source=n};u.prototype=new n;u.prototype.Any=function(t){return t==null?this.source.length>0:n.prototype.Any.apply(this,arguments)};u.prototype.Count=function(t){return t==null?this.source.length:n.prototype.Count.apply(this,arguments)};u.prototype.ElementAt=function(t){return 0<=t&&t<this.source.length?this.source[t]:n.prototype.ElementAt.apply(this,arguments)};u.prototype.ElementAtOrDefault=function(n,t){return 0<=n&&n<this.source.length?this.source[n]:t};u.prototype.First=function(t){return t==null&&this.source.length>0?this.source[0]:n.prototype.First.apply(this,arguments)};u.prototype.FirstOrDefault=function(t,i){return i!=null?n.prototype.FirstOrDefault.apply(this,arguments):this.source.length>0?this.source[0]:t};u.prototype.Last=function(t){return t==null&&this.source.length>0?this.source[this.source.length-1]:n.prototype.Last.apply(this,arguments)};u.prototype.LastOrDefault=function(t,i){return i!=null?n.prototype.LastOrDefault.apply(this,arguments):this.source.length>0?this.source[this.source.length-1]:t};u.prototype.Skip=function(t){var u=this.source;return new n(function(){var n;return new i(function(){n=t<0?0:t},function(){return n<u.length?this.Yield(u[n++]):!1},r.Blank)})};u.prototype.TakeExceptLast=function(n){return n==null&&(n=1),this.Take(this.source.length-n)};u.prototype.TakeFromLast=function(n){return this.Skip(this.source.length-n)};u.prototype.Reverse=function(){var t=this.source;return new n(function(){var n;return new i(function(){n=t.length},function(){return n>0?this.Yield(t[--n]):!1},r.Blank)})};u.prototype.SequenceEqual=function(t,i){return(t instanceof u||t instanceof Array)&&i==null&&n.From(t).Count()!=this.Count()?!1:n.prototype.SequenceEqual.apply(this,arguments)};u.prototype.ToString=function(t,i){return i!=null||!(this.source instanceof Array)?n.prototype.ToString.apply(this,arguments):(t==null&&(t=""),this.source.join(t))};u.prototype.GetEnumerator=function(){var n=this.source,t=0;return new i(r.Blank,function(){return t<n.length?this.Yield(n[t++]):!1},r.Blank)};var h=function(){var t=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},u=function(n){return n===null?"null":n===undefined?"undefined":typeof n.toString===f.Function?n.toString():Object.prototype.toString.call(n)},s=function(n,t){this.Key=n;this.Value=t;this.Prev=null;this.Next=null},e=function(){this.First=null;this.Last=null},o;return e.prototype={AddLast:function(n){this.Last!=null?(this.Last.Next=n,n.Prev=this.Last,this.Last=n):this.First=this.Last=n},Replace:function(n,t){n.Prev!=null?(n.Prev.Next=t,t.Prev=n.Prev):this.First=t;n.Next!=null?(n.Next.Prev=t,t.Next=n.Next):this.Last=t},Remove:function(n){n.Prev!=null?n.Prev.Next=n.Next:this.First=n.Next;n.Next!=null?n.Next.Prev=n.Prev:this.Last=n.Prev}},o=function(n){this.count=0;this.entryList=new e;this.buckets={};this.compareSelector=n==null?r.Identity:n},o.prototype={Add:function(n,i){var h=this.compareSelector(n),o=u(h),e=new s(n,i),r,f;if(t(this.buckets,o)){for(r=this.buckets[o],f=0;f<r.length;f++)if(this.compareSelector(r[f].Key)===h){this.entryList.Replace(r[f],e);r[f]=e;return}r.push(e)}else this.buckets[o]=[e];this.count++;this.entryList.AddLast(e)},Get:function(n){var e=this.compareSelector(n),o=u(e),r,i,f;if(!t(this.buckets,o))return undefined;for(r=this.buckets[o],i=0;i<r.length;i++)if(f=r[i],this.compareSelector(f.Key)===e)return f.Value;return undefined},Set:function(n,i){var o=this.compareSelector(n),h=u(o),f,r,e;if(t(this.buckets,h))for(f=this.buckets[h],r=0;r<f.length;r++)if(this.compareSelector(f[r].Key)===o)return e=new s(n,i),this.entryList.Replace(f[r],e),f[r]=e,!0;return!1},Contains:function(n){var f=this.compareSelector(n),e=u(f),r,i;if(!t(this.buckets,e))return!1;for(r=this.buckets[e],i=0;i<r.length;i++)if(this.compareSelector(r[i].Key)===f)return!0;return!1},Clear:function(){this.count=0;this.buckets={};this.entryList=new e},Remove:function(n){var e=this.compareSelector(n),f=u(e),i,r;if(t(this.buckets,f))for(i=this.buckets[f],r=0;r<i.length;r++)if(this.compareSelector(i[r].Key)===e){this.entryList.Remove(i[r]);i.splice(r,1);i.length==0&&delete this.buckets[f];this.count--;return}},Count:function(){return this.count},ToEnumerable:function(){var t=this;return new n(function(){var n;return new i(function(){n=t.entryList.First},function(){if(n!=null){var t={Key:n.Key,Value:n.Value};return n=n.Next,this.Yield(t)}return!1},r.Blank)})}},o}(),a=function(t){this.Count=function(){return t.Count()};this.Get=function(i){return n.From(t.Get(i))};this.Contains=function(n){return t.Contains(n)};this.ToEnumerable=function(){return t.ToEnumerable().Select(function(n){return new c(n.Key,n.Value)})}},c=function(n,t){this.Key=function(){return n};u.call(this,t)};return c.prototype=new u,n}();bb={success:0,error:0,blackberryTimeoutId:-1};geoPosition=function(){var n={},t=null,i="undefined",u="http://freegeoip.net/json/?callback=JSONPCallback";return n.getCurrentPosition=function(n,i,r){t.getCurrentPosition(n,i,r)},n.jsonp={callbackCounter:0,fetch:function(n,t){var r="JSONPCallback_"+this.callbackCounter++,i;window[r]=this.evalJSONP(t);n=n.replace("=JSONPCallback","="+r);i=document.createElement("SCRIPT");i.src=n;document.getElementsByTagName("HEAD")[0].appendChild(i)},evalJSONP:function(n){return function(t){n(t)}}},n.confirmation=function(){return confirm("This Webpage wants to track your physical location.\nDo you allow it?")},n.init=function(){try{var f=typeof navigator.geolocation!=i;if(!f&&!n.confirmation())return!1;if(typeof geoPositionSimulator!=i&&geoPositionSimulator.length>0)t=geoPositionSimulator;else if(typeof bondi!=i&&typeof bondi.geolocation!=i)t=bondi.geolocation;else if(f)t=navigator.geolocation,n.getCurrentPosition=function(n,r,u){function f(t){var r;r=typeof t.latitude!=i?{timestamp:t.timestamp,coords:{latitude:t.latitude,longitude:t.longitude}}:t;n(r)}t.getCurrentPosition(f,r,u)};else if(typeof blackberry!=i&&blackberry.location.GPSSupported){if(typeof blackberry.location.setAidMode==i)return!1;blackberry.location.setAidMode(2);n.getCurrentPosition=function(n,t,i){bb.success=n;bb.error=t;bb.blackberryTimeoutId=i.timeout?setTimeout("handleBlackBerryLocationTimeout()",i.timeout):setTimeout("handleBlackBerryLocationTimeout()",6e4);blackberry.location.onLocationUpdate("handleBlackBerryLocation()");blackberry.location.refreshLocation()};t=blackberry.location}else typeof Mojo!=i&&typeof Mojo.Service.Request!="Mojo.Service.Request"?(t=!0,n.getCurrentPosition=function(n,t,i){parameters={};i&&(i.enableHighAccuracy&&i.enableHighAccuracy==!0&&(parameters.accuracy=1),i.maximumAge&&(parameters.maximumAge=i.maximumAge),i.responseTime&&(i.responseTime<5?parameters.responseTime=1:i.responseTime<20?parameters.responseTime=2:parameters.timeout=3));r=new Mojo.Service.Request("palm://com.palm.location",{method:"getCurrentPosition",parameters:parameters,onSuccess:function(t){n({timestamp:t.timestamp,coords:{latitude:t.latitude,longitude:t.longitude,heading:t.heading}})},onFailure:function(n){n.errorCode==1?t({code:3,message:"Timeout"}):n.errorCode==2?t({code:2,message:"Position unavailable"}):t({code:0,message:"Unknown Error: webOS-code"+errorCode})}})}):typeof device!=i&&typeof device.getServiceObject!=i?(t=device.getServiceObject("Service.Location","ILocation"),n.getCurrentPosition=function(n,i){function u(t,r,u){r==4?i({message:"Position unavailable",code:2}):n({timestamp:null,coords:{latitude:u.ReturnValue.Latitude,longitude:u.ReturnValue.Longitude,altitude:u.ReturnValue.Altitude,heading:u.ReturnValue.Heading}})}var r={};r.LocationInformationClass="BasicLocationInformation";t.ILocation.GetLocation(r,u)}):(n.getCurrentPosition=function(t){n.jsonp.fetch(u,function(n){t({timestamp:n.timestamp,coords:{latitude:n.latitude,longitude:n.longitude,heading:n.heading}})})},t=!0)}catch(e){return typeof console!=i&&console.log(e),!1}return t!=null},n}(),function(n){var t=document.createElement("div"),r=t.getElementsByTagName("i"),i=n(document.documentElement);if(t.innerHTML="<!--[if lte IE 8]><i><\/i><![endif]-->",r[0]&&i.addClass("ie-lte8"),"querySelector"in document&&(!window.blackberry||window.WebKitPoint)&&!window.operamini)i.addClass("tablesaw-enhanced"),n(function(){n(document).trigger("enhance.tablesaw")});else return}(jQuery);typeof Tablesaw=="undefined"&&(Tablesaw={});Tablesaw.config||(Tablesaw.config={}),function(n){var t="table",r={toolbar:"tablesaw-bar"},u={create:"tablesawcreate",destroy:"tablesawdestroy",refresh:"tablesawrefresh"},f="stack",e="table[data-tablesaw-mode],table[data-tablesaw-sortable]",i=function(t){if(!t)throw new Error("Tablesaw requires an element.");this.table=t;this.$table=n(t);this.mode=this.$table.attr("data-tablesaw-mode")||f;this.init()};i.prototype.init=function(){this.$table.attr("id")||this.$table.attr("id",t+"-"+Math.round(Math.random()*1e4));this.createToolbar();var n=this._initCells();this.$table.trigger(u.create,[this,n])};i.prototype._initCells=function(){var t,i=this.table.querySelectorAll("thead tr"),r=this;return n(i).each(function(){var u=0;n(this).children().each(function(){var e=parseInt(this.getAttribute("colspan"),10),o=":nth-child("+(u+1)+")",f;if(t=u+1,e)for(f=0;f<e-1;f++)u++,o+=", :nth-child("+(u+1)+")";this.cells=r.$table.find("tr").not(n(i).eq(0)).not(this).children(o);u++})}),t};i.prototype.refresh=function(){this._initCells();this.$table.trigger(u.refresh)};i.prototype.createToolbar=function(){var t=this.$table.prev("."+r.toolbar);t.length||(t=n("<div>").addClass(r.toolbar).insertBefore(this.$table));this.$toolbar=t;this.mode&&this.$toolbar.addClass("mode-"+this.mode)};i.prototype.destroy=function(){this.$table.prev("."+r.toolbar).each(function(){this.className=this.className.replace(/\bmode\-\w*\b/gi,"")});var i=this.$table.attr("id");n(document).unbind("."+i);n(window).unbind("."+i);this.$table.trigger(u.destroy,[this]);this.$table.removeAttr("data-tablesaw-mode");this.$table.removeData(t)};n.fn[t]=function(){return this.each(function(){var r=n(this),u;r.data(t)||(u=new i(this),r.data(t,u))})};n(document).on("enhance.tablesaw",function(i){n(i.target).find(e)[t]()})}(jQuery),function(n,t){var i={stackTable:"tablesaw-stack",cellLabels:"tablesaw-cell-label",cellContentLabels:"tablesaw-cell-content"},f={obj:"tablesaw-stack"},r={labelless:"data-tablesaw-no-labels",hideempty:"data-tablesaw-hide-empty"},u=function(n){this.$table=t(n);this.labelless=this.$table.is("["+r.labelless+"]");this.hideempty=this.$table.is("["+r.hideempty+"]");this.labelless||(this.allHeaders=this.$table.find("th"));this.$table.data(f.obj,this)};u.prototype.init=function(n){if(this.$table.addClass(i.stackTable),!this.labelless){var u=t(this.allHeaders),f=this.hideempty;u.each(function(){var h=t(this),u=t(this.cells).filter(function(){return!t(this).parent().is("["+r.labelless+"]")&&(!f||!t(this).is(":empty"))}),c=u.not(this).filter("thead th").length&&" tablesaw-cell-label-top",l=h.find(".tablesaw-sortable-btn"),e=l.length?l.html():h.html(),o,s;e!==""&&(c?(o=parseInt(t(this).attr("colspan"),10),s="",o&&(s="td:nth-child("+o+"n + "+n+")"),u.filter(s).prepend("<b class='"+i.cellLabels+c+"'>"+e+"<\/b>")):(u.wrapInner("<span class='"+i.cellContentLabels+"'><\/span>"),u.prepend("<b class='"+i.cellLabels+"'>"+e+"<\/b>")))})}};u.prototype.destroy=function(){this.$table.removeClass(i.stackTable);this.$table.find("."+i.cellLabels).remove();this.$table.find("."+i.cellContentLabels).each(function(){t(this).replaceWith(this.childNodes)})};t(document).on("tablesawcreate",function(n,t,i){if(t.mode==="stack"){var r=new u(t.table);r.init(i)}});t(document).on("tablesawdestroy",function(n,i){i.mode==="stack"&&t(i.table).data(f.obj).destroy()})}(this,jQuery),function(n){var t="tablesawbtn",i=".btn",r={_create:function(){return n(this).each(function(){n(this).trigger("beforecreate."+t)[t]("_init").trigger("create."+t)})},_init:function(){var r=n(this),i=this.getElementsByTagName("select")[0];return i&&n(this).addClass("btn-select")[t]("_select",i),r},_select:function(t){var i=function(t,i){var e=n(i).find("option"),o,r,f,u,s;if(e.each(function(){var n=this;n.selected&&(o=document.createTextNode(n.text))}),f=t.childNodes,e.length>0)for(u=0,s=f.length;u<s;u++)r=f[u],r&&r.nodeType===3&&t.replaceChild(o,r)};i(this,t);n(this).bind("change refresh",function(){i(this,t)})}};n.fn[t]=function(i,r,u,f){return this.each(function(){if(i&&typeof i=="string")return n.fn[t].prototype[i].call(this,r,u,f);if(n(this).data(t+"active"))return n(this);n(this).data(t+"active",!0);n.fn[t].prototype._create.call(this)})};n.extend(n.fn[t].prototype,r);n(document).on("enhance",function(r){n(i,r.target)[t]()})}(jQuery),function(n,t){var i=function(n){this.$table=t(n);this.classes={columnToggleTable:"tablesaw-columntoggle",columnBtnContain:"tablesaw-columntoggle-btnwrap tablesaw-advance",columnBtn:"tablesaw-columntoggle-btn tablesaw-nav-btn down",popup:"tablesaw-columntoggle-popup",priorityPrefix:"tablesaw-priority-",toolbar:"tablesaw-bar"};this.i18n={columnBtnText:"Columns",columnsDialogError:"No eligible columns."};this.headers=this.$table.find("tr:first > th");this.$table.data("tablesaw-coltoggle",this)};i.prototype.init=function(){function l(){n.addClass("visible");u.removeClass("down").addClass("up");t(document).unbind("click."+i,h);window.clearTimeout(c);c=window.setTimeout(function(){t(document).one("click."+i,h)},15)}function h(r){r&&t(r.target).closest("."+f.classes.popup).length||(t(document).unbind("click."+i),u.removeClass("up").addClass("down"),n.removeClass("visible"))}var i,e,u,o,r,n,f=this,s,c;this.$table.addClass(this.classes.columnToggleTable);i=this.$table.attr("id");e=i+"-popup";n=t("<div class='"+this.classes.columnBtnContain+"'><\/div>");u=t("<a href='#"+e+"' class='btn btn-micro "+this.classes.columnBtn+"' data-popup-link><span>"+this.i18n.columnBtnText+"<\/span><\/a>");o=t("<div class='dialog-table-coltoggle "+this.classes.popup+"' id='"+e+"'><\/div>");r=t("<div class='btn-group'><\/div>");s=!1;t(this.headers).not("td").each(function(){var n=t(this),i=n.attr("data-tablesaw-priority"),u=n.add(this.cells);i&&i!=="persist"&&(u.addClass(f.classes.priorityPrefix+i),t("<label><input type='checkbox' checked>"+n.text()+"<\/label>").appendTo(r).children(0).data("cells",u),s=!0)});s||r.append("<label>"+this.i18n.columnsDialogError+"<\/label>");r.appendTo(o);r.find('input[type="checkbox"]').on("change",function(n){var i=n.target.checked;t(n.target).data("cells").toggleClass("tablesaw-cell-hidden",!i).toggleClass("tablesaw-cell-visible",i);f.$table.trigger("tablesawcolumns")});u.appendTo(n);n.appendTo(this.$table.prev("."+this.classes.toolbar));u.on("click.tablesaw",function(t){t.preventDefault();n.is(".visible")?h():l()});o.appendTo(n);this.$menu=r;t(window).on("resize."+i,function(){f.refreshToggle()});this.refreshToggle()};i.prototype.refreshToggle=function(){this.$menu.find("input").each(function(){var n=t(this);this.checked=n.data("cells").eq(0).css("display")==="table-cell"})};i.prototype.refreshPriority=function(){var n=this;t(this.headers).not("td").each(function(){var r=t(this),i=r.attr("data-tablesaw-priority"),u=r.add(this.cells);i&&i!=="persist"&&u.addClass(n.classes.priorityPrefix+i)})};i.prototype.destroy=function(){this.$table.removeClass(this.classes.columnToggleTable);this.$table.find("th, td").each(function(){var n=t(this);n.removeClass("tablesaw-cell-hidden").removeClass("tablesaw-cell-visible");this.className=this.className.replace(/\bui\-table\-priority\-\d\b/g,"")})};t(document).on("tablesawcreate",function(n,t){if(t.mode==="columntoggle"){var r=new i(t.table);r.init()}});t(document).on("tablesawdestroy",function(n,i){i.mode==="columntoggle"&&t(i.table).data("tablesaw-coltoggle").destroy()})}(this,jQuery),function(n,t){function r(r){function l(n){return t(n.cells).add(n)}function g(n){l(n).removeClass("tablesaw-cell-hidden")}function nt(n){l(n).addClass("tablesaw-cell-hidden")}function ut(n){l(n).addClass("tablesaw-cell-persist")}function ft(n){return t(n).is('[data-tablesaw-priority="persist"]')}function tt(){r.removeClass(b);t("#"+f+"-persist").remove()}function et(){var i="#"+f+" ",n=[],e=r.width();u.each(function(r){var u;ft(this)&&(u=t(this).outerWidth(),u<e*.75&&n.push(i+" .tablesaw-cell-persist:nth-child("+(r+1)+") { width: "+u+"px; }"))});tt();r.addClass(b);rt.append(t("<style>"+n.join("\n")+"<\/style>").attr("id",f+"-persist"))}function a(){var n=[],i;return e.each(function(r){var u=t(this),f=u.css("display")==="none"||u.is(".tablesaw-cell-hidden");if(f||i){if(f&&i)return n[1]=r,!1}else i=!0,n[0]=r}),n}function it(){var n=a();return[n[1]-1,n[0]-1]}function ot(n){return n?a():it()}function v(n){return n[1]>-1&&n[1]<e.length}function y(){var h=20,f=r.parent().width(),e=[],n=0,o=[],s=u.length,i;u.each(function(i){var u=t(this),r=u.is('[data-tablesaw-priority="persist"]');e.push(r);n+=k[i]+(r?0:h);o.push(n);(r||n>f)&&s--});i=s===0;u.each(function(n){if(e[n]){ut(this);return}o[n]<=f||i?(i=!1,g(this)):nt(this)});d||tt();r.trigger("tablesawcolumns")}function o(n){var t=ot(n);v(t)&&(isNaN(t[0])&&(t[0]=n?0:e.length-1),d||et(),nt(e.get(t[0])),g(e.get(t[1])),r.trigger("tablesawcolumns"))}function s(n,t){return(n.touches||n.originalEvent.touches)[0][t]}var h=t("<div class='tablesaw-advance'><\/div>"),p=t("<a href='#' class='tablesaw-nav-btn btn btn-micro left' title='Previous Column'><\/a>").appendTo(h),c=t("<a href='#' class='tablesaw-nav-btn btn btn-micro right' title='Next Column'><\/a>").appendTo(h),w="disabled",b="tablesaw-fix-persist",u=r.find("thead th"),e=u.not('[data-tablesaw-priority="persist"]'),k=[],rt=t(document.head||"head"),f=r.attr("id"),d=t("html").is(".ie-lte8");if(!u.length)throw new Error("tablesaw swipe: no header cells found. Are you using <th> inside of <thead>?");r.css("width","auto");u.each(function(){k.push(t(this).outerWidth())});r.css("width","");h.appendTo(r.prev(".tablesaw-bar"));r.addClass("tablesaw-swipe");f||(f="tableswipe-"+Math.round(Math.random()*1e4),r.attr("id",f));p.add(c).click(function(n){o(!!t(n.target).closest(c).length);n.preventDefault()});r.bind("touchstart.swipetoggle",function(n){var u=s(n,"pageX"),e=s(n,"pageY"),r,f;t(this).bind("touchmove",function(n){r=s(n,"pageX");f=s(n,"pageY");Math.abs(r-u)>i.horizontalThreshold&&Math.abs(f-e)<i.verticalThreshold&&n.preventDefault()}).bind("touchend.swipetoggle",function(){r-u<-1*i.horizontalThreshold&&o(!0);r-u>i.horizontalThreshold&&o(!1);t(this).unbind("touchmove touchend")})}).bind("tablesawcolumns.swipetoggle",function(){p[v(it())?"removeClass":"addClass"](w);c[v(a())?"removeClass":"addClass"](w)}).bind("tablesawnext.swipetoggle",function(){o(!0)}).bind("tablesawprev.swipetoggle",function(){o(!1)}).bind("tablesawdestroy.swipetoggle",function(){var i=t(this);i.removeClass("tablesaw-swipe");i.prev(".tablesaw-bar").find(".tablesaw-advance").remove();t(n).off("resize",y);i.unbind(".swipetoggle")});y();t(n).on("resize",y)}t.extend(Tablesaw.config,{swipe:{horizontalThreshold:15,verticalThreshold:30}});var i=Tablesaw.config.swipe;t(document).on("tablesawcreate",function(n,t){t.mode==="swipe"&&r(t.$table)})}(this,jQuery),function(n){function u(t){return n.map(t.childNodes,function(t){var i=n(t);return i.is("input, select")?i.val():i.hasClass("tablesaw-cell-label")?void 0:n.trim(i.text())}).join("")}var t="tablesaw-sortable",f="table[data-"+t+"]",e="[data-"+t+"-switch]",r={defaultCol:"data-tablesaw-sortable-default-col"},i={head:t+"-head",ascend:t+"-ascending",descend:t+"-descending",switcher:t+"-switch",tableToolbar:"tablesaw-toolbar",sortButton:t+"-btn"},o={sort:"Sort"},s={_create:function(i){return n(this).each(function(){var r=n(this).data("init"+t);if(r)return!1;n(this).data("init"+t,!0).trigger("beforecreate."+t)[t]("_init",i).trigger("create."+t)})},_init:function(){var f=n(this),h,s,l=function(){f.addClass(t)},a=function(t){n.each(t,function(t,r){n(r).addClass(i.head)})},v=function(t,r){n.each(t,function(t,u){var f=n("<button class='"+i.sortButton+"'/>");f.bind("click",{col:u},r);n(u).wrapInner(f)})},c=function(t){n.each(t,function(t,u){var f=n(u);f.removeAttr(r.defaultCol);f.removeClass(i.ascend);f.removeClass(i.descend)})},y=function(r){if(!n(r.target).is("a[href]")){r.stopPropagation();var u=n(this).parent(),o=r.data.col,e=h.index(u);c(u.siblings());u.hasClass(i.descend)?(f[t]("sortBy",o,!0),e+="_asc"):(f[t]("sortBy",o),e+="_desc");s&&s.find("select").val(e).trigger("refresh");r.preventDefault()}},p=function(t){n.each(t,function(t,u){var f=n(u);f.is("["+r.defaultCol+"]")&&(f.hasClass(i.descend)||f.addClass(i.ascend))})},w=function(e){s=n("<div>").addClass(i.switcher).addClass(i.tableToolbar).html(function(){var t=["<label>"+o.sort+":"];return t.push('<span class="btn btn-small">&#160;<select>'),e.each(function(f){var e=n(this),s=e.is("["+r.defaultCol+"]"),h=e.hasClass(i.descend),o=!1;n(this.cells).slice(0,3).each(function(){if(!isNaN(parseInt(u(this),10)))return o=!0,!1});t.push("<option"+(s&&!h?" selected":"")+' value="'+f+'_asc">'+e.text()+" "+(o?"↑":"(A-Z)")+"<\/option>");t.push("<option"+(s&&h?" selected":"")+' value="'+f+'_desc">'+e.text()+" "+(o?"↓":"(Z-A)")+"<\/option>")}),t.push("<\/select><\/span><\/label>"),t.join("")});var h=f.prev(".tablesaw-bar"),l=h.children().eq(0);l.length?s.insertBefore(l):s.appendTo(h);s.find(".btn").tablesawbtn();s.find("select").on("change",function(){var i=n(this).val().split("_"),r=e.eq(i[0]);c(r.siblings());f[t]("sortBy",r.get(0),i[1]==="asc")})};l();h=f.find("thead th[data-"+t+"-col]");a(h);v(h,y);p(h);f.is(e)&&w(h,f.find("tbody tr:nth-child(-n+3)"))},getColumnNumber:function(t){return n(t).prevAll().length},getTableRows:function(){return n(this).find("tbody tr")},sortRows:function(t,i,r,f){var e,o,s,h=function(t){var r=[];return n.each(t,function(t,f){r.push({cell:u(n(f).children().get(i)),rowNum:t})}),r},c=function(n,t){var i=/[^\-\+\d\.]/g;return n?function(n,r){return t||!isNaN(parseFloat(n.cell))?parseFloat(n.cell.replace(i,""))-parseFloat(r.cell.replace(i,"")):n.cell.toLowerCase()>r.cell.toLowerCase()?1:-1}:function(n,r){return t||!isNaN(parseFloat(n.cell))?parseFloat(r.cell.replace(i,""))-parseFloat(n.cell.replace(i,"")):n.cell.toLowerCase()<r.cell.toLowerCase()?1:-1}},l=function(n,t){for(var r=[],f,i=0,u=n.length;i<u;i++)f=n[i].rowNum,r.push(t[f]);return r};return e=h(t),o=c(r,n(f).is("[data-sortable-numeric]")),s=e.sort(o),l(s,t)},replaceTableRows:function(t){var i=n(this),r=i.find("tbody");r.html(t)},makeColDefault:function(t,u){var f=n(t);f.attr(r.defaultCol,"true");u?(f.removeClass(i.descend),f.addClass(i.ascend)):(f.removeClass(i.ascend),f.addClass(i.descend))},sortBy:function(i,r){var u=n(this),e,f;e=u[t]("getColumnNumber",i);f=u[t]("getTableRows");f=u[t]("sortRows",f,e,r,i);u[t]("replaceTableRows",f);u[t]("makeColDefault",i,r)}};n.fn[t]=function(i){var u=Array.prototype.slice.call(arguments,1),r;return i&&typeof i=="string"?(r=n.fn[t].prototype[i].apply(this[0],u),typeof r!="undefined"?r:n(this)):(n(this).data(t+"data")||(n(this).data(t+"active",!0),n.fn[t].prototype._create.call(this,i)),n(this))};n.extend(n.fn[t].prototype,s);n(document).on("tablesawcreate",function(n,i){i.$table.is(f)&&i.$table[t]()})}(jQuery),function(n,t){function r(r){function h(t){var r=t.attr(i.attr.init);return!r||n.matchMedia&&n.matchMedia(r).matches}function f(){if(!h(r)){u.hide();return}u.show();var n=e.find("li").removeClass(o);r.find("thead th").each(function(i){t(this).css("display")==="none"&&n.eq(i).addClass(o)})}var u=t('<div class="tablesaw-advance minimap">'),e=t('<ul class="tablesaw-advance-dots">').appendTo(u),o="tablesaw-advance-dots-hide",s=r.find("thead th");s.each(function(){e.append("<li><i><\/i><\/li>")});u.appendTo(r.prev(".tablesaw-bar"));f();t(n).on("resize",f);r.bind("tablesawcolumns.minimap",function(){f()}).bind("tablesawdestroy.minimap",function(){var i=t(this);i.prev(".tablesaw-bar").find(".tablesaw-advance").remove();t(n).off("resize",f);i.unbind(".minimap")})}var i={attr:{init:"data-tablesaw-minimap"}};t(document).on("tablesawcreate",function(n,t){(t.mode==="swipe"||t.mode==="columntoggle")&&t.$table.is("[ "+i.attr.init+"]")&&r(t.$table)})}(this,jQuery),function(n,t){var i={selectors:{init:"table[data-tablesaw-mode-switch]"},attributes:{excludeMode:"data-tablesaw-mode-exclude"},classes:{main:"tablesaw-modeswitch",toolbar:"tablesaw-toolbar"},modes:["stack","swipe","columntoggle"],i18n:{modes:["Stack","Swipe","Toggle"],columns:'Col<span class="a11y-sm">umn<\/span>s'},init:function(n){var u=t(n),f=u.attr(i.attributes.excludeMode),e=u.prev(".tablesaw-bar"),s="",r=t("<div>").addClass(i.classes.main+" "+i.classes.toolbar).html(function(){var t=["<label>"+i.i18n.columns+":"],o=u.attr("data-tablesaw-mode"),r,n,e;for(t.push('<span class="btn btn-small">&#160;<select>'),n=0,e=i.modes.length;n<e;n++)f&&f.toLowerCase()===i.modes[n]||(r=o===i.modes[n],r&&(s=i.modes[n]),t.push("<option"+(r?" selected":"")+' value="'+i.modes[n]+'">'+i.i18n.modes[n]+"<\/option>"));return t.push("<\/select><\/span><\/label>"),t.join("")}),o=e.find(".tablesaw-advance").eq(0);o.length?r.insertBefore(o):r.appendTo(e);r.find(".btn").tablesawbtn();r.find("select").bind("change",i.onModeChange)},onModeChange:function(){var r=t(this),u=r.closest("."+i.classes.main),n=r.closest(".tablesaw-bar").nextUntil(n).eq(0),f=r.val();u.remove();n.data("table").destroy();n.attr("data-tablesaw-mode",f);n.table()}};t(n.document).on("tablesawcreate",function(n,t){t.$table.is(i.selectors.init)&&i.init(t.table)})}(this,jQuery);require=function(n,t){var r=require.resolve(n,t||"/"),i=require.modules[r];if(!i)throw new Error("Failed to resolve module "+n+", tried "+r);return i._cached?i._cached:i()};require.paths=[];require.modules={};require.extensions=[".js",".coffee"];require._core={assert:!0,events:!0,fs:!0,path:!0,vm:!0};require.resolve=function(){return function(n,t){function r(n){var t,i;if(require.modules[n])return n;for(t=0;t<require.extensions.length;t++)if(i=require.extensions[t],require.modules[n+i])return n+i}function o(n){var e,f,u,t;if(n=n.replace(/\/+$/,""),e=n+"/package.json",require.modules[e])if(f=require.modules[e](),u=f.browserify,typeof u=="object"&&u.main){if(t=r(i.resolve(n,u.main)),t)return t}else if(typeof u=="string"){if(t=r(i.resolve(n,u)),t)return t}else if(f.main&&(t=r(i.resolve(n,f.main)),t))return t;return r(n+"/index")}function s(n,t){for(var f,e,i,s=h(t),u=0;u<s.length;u++){if(f=s[u],i=r(f+"/"+n),i)return i;if(e=o(f+"/"+n),e)return e}return i=r(n),i?i:void 0}function h(n){var r,u,t,f;for(r=n==="/"?[""]:i.normalize(n).split("/"),u=[],t=r.length-1;t>=0;t--)r[t]!=="node_modules"&&(f=r.slice(0,t+1).join("/")+"/node_modules",u.push(f));return u}var i,u,f,e;if(t||(t="/"),require._core[n])return n;if(i=require.modules.path(),u=t||".",n.match(/^(?:\.\.?\/|\/)/)&&(f=r(i.resolve(u,n))||o(i.resolve(u,n)),f))return f;if(e=s(n,u),e)return e;throw new Error("Cannot find module '"+n+"'");}}();require.alias=function(n,t){var s=require.modules.path(),f=null,i,e,r,u,o;try{f=require.resolve(n+"/package.json","/")}catch(h){f=require.resolve(n,"/")}for(i=s.dirname(f),e=(Object.keys||function(n){var t=[];for(var i in n)t.push(i);return t})(require.modules),r=0;r<e.length;r++)u=e[r],u.slice(0,i.length+1)===i+"/"?(o=u.slice(i.length),require.modules[t+o]=require.modules[i+o]):u===i&&(require.modules[t]=require.modules[i])};require.define=function(n,t){var u=require._core[n]?"":require.modules.path().dirname(n),r=function(n){return require(n,u)},i;r.resolve=function(n){return require.resolve(n,u)};r.modules=require.modules;r.define=require.define;i={exports:{}};require.modules[n]=function(){return require.modules[n]._cached=i.exports,t.call(i.exports,r,i,i.exports,u,n),require.modules[n]._cached=i.exports,i.exports}};typeof process=="undefined"&&(process={});process.nextTick||(process.nextTick=function(){var n=[],t=typeof window!="undefined"&&window.postMessage&&window.addEventListener;return t&&window.addEventListener("message",function(t){if(t.source===window&&t.data==="browserify-tick"&&(t.stopPropagation(),n.length>0)){var i=n.shift();i()}},!0),function(i){t?(n.push(i),window.postMessage("browserify-tick","*")):setTimeout(i,0)}}());process.title||(process.title="browser");process.binding||(process.binding=function(n){if(n==="evals")return require("vm");throw new Error("No such module");});process.cwd||(process.cwd=function(){return"."});require.define("path",function(n,t,i){function r(n,t){for(var r=[],i=0;i<n.length;i++)t(n[i],i,n)&&r.push(n[i]);return r}function f(n,t){for(var u,r=0,i=n.length;i>=0;i--)u=n[i],u=="."?n.splice(i,1):u===".."?(n.splice(i,1),r++):r&&(n.splice(i,1),r--);if(t)for(;r--;r)n.unshift("..");return n}var u=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;i.resolve=function(){for(var t,n="",i=!1,u=arguments.length;u>=-1&&!i;u--)(t=u>=0?arguments[u]:process.cwd(),typeof t=="string"&&t)&&(n=t+"/"+n,i=t.charAt(0)==="/");return n=f(r(n.split("/"),function(n){return!!n}),!i).join("/"),(i?"/":"")+n||"."};i.normalize=function(n){var t=n.charAt(0)==="/",i=n.slice(-1)==="/";return n=f(r(n.split("/"),function(n){return!!n}),!t).join("/"),n||t||(n="."),n&&i&&(n+="/"),(t?"/":"")+n};i.join=function(){var n=Array.prototype.slice.call(arguments,0);return i.normalize(r(n,function(n){return n&&typeof n=="string"}).join("/"))};i.dirname=function(n){var t=u.exec(n)[1]||"";return t?t.length===1||!1&&t.length<=3&&t.charAt(1)===":"?t:t.substring(0,t.length-1):"."};i.basename=function(n,t){var i=u.exec(n)[2]||"";return t&&i.substr(-1*t.length)===t&&(i=i.substr(0,i.length-t.length)),i};i.extname=function(n){return u.exec(n)[3]||""}});require.define("/shred.js",function(n,t){var r=n("ax"),u=n("cookiejar"),f=u.CookieJar,i=function(n){n=n||{};this.agent=n.agent;this.defaults=n.defaults||{};this.log=n.logger||new r({level:"info"});this._sharedCookieJar=new f;this.logCurl=n.logCurl||!1};i.Request=n("./shred/request");i.Response=n("./shred/response");i.prototype={request:function(n){n.logger=this.log;n.logCurl=n.logCurl||this.logCurl;n.cookieJar="cookieJar"in n?n.cookieJar:this._sharedCookieJar;n.agent=n.agent||this.agent;for(var t in this.defaults)this.defaults.hasOwnProperty(t)&&!n[t]&&(n[t]=this.defaults[t]);return new i.Request(n)}};"get put post delete".split(" ").forEach(function(n){i.prototype[n]=function(t){return t.method=n,this.request(t)}});t.exports=i});require.define("/node_modules/ax/package.json",function(n,t){t.exports={main:"./lib/ax.js"}});require.define("/node_modules/ax/lib/ax.js",function(n,t){var r=n("util").inspect,u=n("fs"),f=function(n,t){var i=n=="debug"||n=="error";return t?typeof t=="object"?t instanceof Error&&i?t.stack:r(t):t.toString():t.toString()},e=function(){return this},o=function(n){return function(t){return this.stream.write(this.format(n,t)+"\n"),this}},i=function(n){var t=this,n=n||{};n.level=n.level||"info";n.timestamp=n.timestamp||!0;n.prefix=n.prefix||"";t.options=n;t.options.module&&(t.options.prefix=t.options.module);t.options.file?t.stream=u.createWriteStream(t.options.file,{flags:"a"}):process.title==="node"?t.stream=process.stderr:process.title==="browser"&&(t.stream=function(){return console[t.options.level].apply(console,arguments)});switch(t.options.level){case"debug":["debug","info","warn"].forEach(function(n){t[n]=i.writer(n)});case"info":["info","warn"].forEach(function(n){t[n]=i.writer(n)});case"warn":t.warn=i.writer("warn")}};i.writer=function(n){return function(t){var i=this;process.title==="node"?i.stream.write(i.format(n,t)+"\n"):process.title==="browser"&&i.stream(i.format(n,t)+"\n")}};i.prototype={info:function(){},debug:function(){},warn:function(){},error:i.writer("error"),format:function(n,t){if(!t)return"";var i=this,r=i.options.prefix,u=i.options.timestamp?" "+(new Date).toISOString():"";return r+u+": "+t}};t.exports=i});require.define("util",function(){});require.define("fs",function(){});require.define("/node_modules/cookiejar/package.json",function(n,t){t.exports={main:"cookiejar.js"}});require.define("/node_modules/cookiejar/cookiejar.js",function(n,t,i){i.CookieAccessInfo=CookieAccessInfo=function CookieAccessInfo(n,t,i,r){return this instanceof CookieAccessInfo?(this.domain=n||undefined,this.path=t||"/",this.secure=!!i,this.script=!!r,this):new CookieAccessInfo(n,t,i,r)};i.Cookie=Cookie=function Cookie(n){return n instanceof Cookie?n:this instanceof Cookie?(this.name=null,this.value=null,this.expiration_date=Infinity,this.path="/",this.domain=null,this.secure=!1,this.noscript=!1,n&&this.parse(n),this):new Cookie(n)};Cookie.prototype.toString=function(){var n=[this.name+"="+this.value];return this.expiration_date!==Infinity&&n.push("expires="+new Date(this.expiration_date).toGMTString()),this.domain&&n.push("domain="+this.domain),this.path&&n.push("path="+this.path),this.secure&&n.push("secure"),this.noscript&&n.push("httponly"),n.join("; ")};Cookie.prototype.toValueString=function(){return this.name+"="+this.value};var r=/[:](?=\s*[a-zA-Z0-9_\-]+\s*[=])/g;Cookie.prototype.parse=function(n){var r;if(this instanceof Cookie){var u=n.split(";"),i=u[0].match(/([^=]+)=((?:.|\n)*)/),f=i[1],t=i[2];for(this.name=f,this.value=t,r=1;r<u.length;r++){i=u[r].match(/([^=]+)(?:=((?:.|\n)*))?/);f=i[1].trim().toLowerCase();t=i[2];switch(f){case"httponly":this.noscript=!0;break;case"expires":this.expiration_date=t?Number(Date.parse(t)):Infinity;break;case"path":this.path=t?t.trim():"";break;case"domain":this.domain=t?t.trim():"";break;case"secure":this.secure=!0}}return this}return(new Cookie).parse(n)};Cookie.prototype.matches=function(n){return this.noscript&&n.script||this.secure&&!n.secure||!this.collidesWith(n)?!1:!0};Cookie.prototype.collidesWith=function(n){if(this.path&&!n.path||this.domain&&!n.domain||this.path&&n.path.indexOf(this.path)!==0)return!1;if(this.domain===n.domain)return!0;if(this.domain&&this.domain.charAt(0)==="."){var t=n.domain.indexOf(this.domain.slice(1));if(t===-1||t!==n.domain.length-this.domain.length+1)return!1}else if(this.domain)return!1;return!0};i.CookieJar=CookieJar=function CookieJar(){if(this instanceof CookieJar){var n={};return this.setCookie=function(t){var u,i,r,f;if(t=Cookie(t),u=t.expiration_date<=Date.now(),t.name in n){for(i=n[t.name],r=0;r<i.length;r++)if(f=i[r],f.collidesWith(t))return u?(i.splice(r,1),i.length===0&&delete n[t.name],!1):i[r]=t;return u?!1:(i.push(t),t)}return u?!1:n[t.name]=[t]},this.getCookie=function(t,i){for(var r,u=n[t],f=0;f<u.length;f++){if(r=u[f],r.expiration_date<=Date.now()){u.length===0&&delete n[r.name];continue}if(r.matches(i))return r}},this.getCookies=function(t){var i=[],u,r;for(u in n)r=this.getCookie(u,t),r&&i.push(r);return i.toString=function(){return i.join(":")},i.toValueString=function(){return i.map(function(n){return n.toValueString()}).join(";")},i},this}return new CookieJar};CookieJar.prototype.setCookies=function(n){var i,t,u;for(n=Array.isArray(n)?n:n.split(r),i=[],t=0;t<n.length;t++)u=Cookie(n[t]),this.setCookie(u)&&i.push(u);return i}});require.define("/shred/request.js",function(n,t){var r=n("http"),e=n("https"),o=n("./parseUri"),s=n("events").EventEmitter,h=n("sprintf").sprintf,c=n("./response"),l=n("./mixins/headers"),a=n("./content"),u=r.STATUS_CODES||{100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version not supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended"},i=function(n){this.log=n.logger;this.cookieJar=n.cookieJar;this.encoding=n.encoding;this.logCurl=n.logCurl;v(this,n||{});f(this)};Object.defineProperties(i.prototype,{url:{get:function(){return this.scheme?h("%s://%s:%s%s",this.scheme,this.host,this.port,(this.proxy?"/":this.path)+(this.query?"?"+this.query:"")):null},set:function(n){return n=o(n),this.scheme=n.protocol,this.host=n.host,this.port=n.port,this.path=n.path,this.query=n.query,this},enumerable:!0},headers:{get:function(){return this.getHeaders()},enumerable:!0},port:{get:function(){if(!this._port)switch(this.scheme){case"https":return this._port=443;case"http":default:return this._port=80}return this._port},set:function(n){return this._port=n,this},enumerable:!0},method:{get:function(){return this._method=this._method||"GET"},set:function(n){return this._method=n,this},enumerable:!0},query:{get:function(){return this._query},set:function(n){var t=function(n){var t="";for(var i in n)t+=encodeURIComponent(i)+"="+encodeURIComponent(n[i])+"&";return t.slice(0,-1)};return n?(typeof n=="object"&&(n=t(n)),this._query=n):this._query="",this},enumerable:!0},parameters:{get:function(){return QueryString.parse(this._query||"")},enumerable:!0},body:{get:function(){return this._body},set:function(n){return this._body=new a({data:n,type:this.getHeader("Content-Type")}),this.setHeader("Content-Type",this.content.type),this.setHeader("Content-Length",this.content.length),this},enumerable:!0},timeout:{get:function(){return this._timeout},set:function(n){var i=this,t=0;return n?(t=typeof n=="number"?n:(n.milliseconds||0)+1e3*((n.seconds||0)+60*((n.minutes||0)+60*(n.hours||0))),this._timeout=t,this):this},enumerable:!0}});Object.defineProperty(i.prototype,"content",Object.getOwnPropertyDescriptor(i.prototype,"body"));i.prototype.inspect=function(){var n=this,t=this.format_headers(),i=["<Shred Request> ",n.method.toUpperCase(),n.url].join(" ");return[i,"- Headers:",t].join("\n")};i.prototype.format_headers=function(){var i=[],t=this._headers,n,r;for(n in t)t.hasOwnProperty(n)&&(r=t[n],i.push("\t"+n+": "+r));return i.join("\n")};i.prototype.on=function(n,t){var r=this.emitter,i;if(arguments.length===1&&typeof n=="function")r.on("response",n);else if(arguments.length===1&&typeof n=="object"){for(i in n)if(n.hasOwnProperty(i))r.on(i,n[i])}else r.on(n,t);return this};l.gettersAndSetters(i);var v=function(n,t){var f,r,i,u;if(n.log.debug("Processing request options .."),n.emitter=new s,n.agent=t.agent,t.on)for(f in t.on)if(t.on.hasOwnProperty(f))n.emitter.on(f,t.on[f]);if(!t.url&&!t.host){n.emitter.emit("request_error",new Error("No url or url options (host, port, etc.)"));return}if(t.url&&(t.proxy?(n.url=t.proxy,n.path=t.url):n.url=t.url),n.query=t.query||t.parameters||n.query,n.method=t.method,n.setHeader("user-agent",t.agent||"Shred"),n.setHeaders(t.headers),n.cookieJar&&(r=n.cookieJar.getCookies(CookieAccessInfo(n.host,n.path)),r.length)){for(i=n.getHeader("cookie")||"",u=0;u<r.length;++u)i.length&&i[i.length-1]!=";"&&(i+=";"),i+=r[u].name+"="+r[u].value+";";n.setHeader("cookie",i)}(t.body||t.content)&&(n.content=t.body||t.content);n.timeout=t.timeout},f=function(n){var t,i,o;n.log.debug("Creating request ..");n.log.debug(n);i={host:n.host,port:n.port,method:n.method,path:n.path+(n.query?"?"+n.query:""),headers:n.getHeaders(),scheme:n.scheme,agent:n.agent};n.logCurl&&y(n);o=n.scheme=="http"?r:e;n._raw=o.request(i,function(i){n.log.debug("Received response ..");clearTimeout(t);i=new c(i,n,function(t){var i=function(i){var r=n.emitter,f=u[t.status]?u[t.status].toLowerCase():null;r.listeners(t.status).length>0||r.listeners(f).length>0?(r.emit(t.status,t),r.emit(f,t)):r.listeners(i).length>0?r.emit(i,t):t.isRedirect||r.emit("response",t)};t.isRedirect?(n.log.debug("Redirecting to "+t.getHeader("Location")),n.url=t.getHeader("Location"),i("redirect"),f(n)):t.isError?i("error"):i("success")})});n._raw.on("error",function(t){n.emitter.emit("request_error",t)});n._raw.on("socket",function(t){n.emitter.emit("socket",t)});n._raw.on("socket",function(){n._raw.socket.on("timeout",function(){n._raw.abort()})});n.content&&(n.log.debug("Streaming body: '"+n.content.data.slice(0,59)+"' ... "),n._raw.write(n.content.data));n.timeout&&(t=setTimeout(function(){n.log.debug("Timeout fired, aborting request ...");n._raw.abort();n.emitter.emit("timeout",n)},n.timeout));n.log.debug("Sending request ...");n._raw.end()},y=function(n){var r=n.getHeaders(),u="",t,i,f;for(t in r)u+='-H "'+t+": "+r[t]+'" ';i="";n.content&&(i+="-d '"+n.content.body+"' ");f=n.query?"?"+n.query:"";console.log("curl -X "+n.method.toUpperCase()+" "+n.scheme+"://"+n.host+":"+n.port+n.path+f+" "+u+i)};t.exports=i});require.define("http",function(){});require.define("https",function(){});require.define("/shred/parseUri.js",function(n,t){function i(n){for(var t=i.options,f=t.parser[t.strictMode?"strict":"loose"].exec(n),r={},u=14;u--;)r[t.key[u]]=f[u]||"";return r[t.q.name]={},r[t.key[12]].replace(t.q.parser,function(n,i,u){i&&(r[t.q.name][i]=u)}),r}i.options={strictMode:!1,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};t.exports=i});require.define("events",function(n,t,i){process.EventEmitter||(process.EventEmitter=function(){});var r=i.EventEmitter=process.EventEmitter,u=typeof Array.isArray=="function"?Array.isArray:function(n){return Object.toString.call(n)==="[object Array]"},f=10;r.prototype.setMaxListeners=function(n){this._events||(this._events={});this._events.maxListeners=n};r.prototype.emit=function(n){var t,i,f,r,e;if(n==="error"&&(!this._events||!this._events.error||u(this._events.error)&&!this._events.error.length)){if(arguments[1]instanceof Error)throw arguments[1];else throw new Error("Uncaught, unspecified 'error' event.");return!1}if(!this._events||(t=this._events[n],!t))return!1;if(typeof t=="function"){switch(arguments.length){case 1:t.call(this);break;case 2:t.call(this,arguments[1]);break;case 3:t.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1);t.apply(this,i)}return!0}if(u(t)){for(i=Array.prototype.slice.call(arguments,1),f=t.slice(),r=0,e=f.length;r<e;r++)f[r].apply(this,i);return!0}return!1};r.prototype.addListener=function(n,t){if("function"!=typeof t)throw new Error("addListener only takes instances of Function");if(this._events||(this._events={}),this.emit("newListener",n,t),this._events[n])if(u(this._events[n])){if(!this._events[n].warned){var i;i=this._events.maxListeners!==undefined?this._events.maxListeners:f;i&&i>0&&this._events[n].length>i&&(this._events[n].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[n].length),console.trace())}this._events[n].push(t)}else this._events[n]=[this._events[n],t];else this._events[n]=t;return this};r.prototype.on=r.prototype.addListener;r.prototype.once=function(n,t){var i=this;i.on(n,function r(){i.removeListener(n,r);t.apply(this,arguments)});return this};r.prototype.removeListener=function(n,t){var i,r;if("function"!=typeof t)throw new Error("removeListener only takes instances of Function");if(!this._events||!this._events[n])return this;if(i=this._events[n],u(i)){if(r=i.indexOf(t),r<0)return this;i.splice(r,1);i.length==0&&delete this._events[n]}else this._events[n]===t&&delete this._events[n];return this};r.prototype.removeAllListeners=function(n){return n&&this._events&&this._events[n]&&(this._events[n]=null),this};r.prototype.listeners=function(n){return this._events||(this._events={}),this._events[n]||(this._events[n]=[]),u(this._events[n])||(this._events[n]=[this._events[n]]),this._events[n]}});require.define("/node_modules/sprintf/package.json",function(n,t){t.exports={main:"./lib/sprintf"}});require.define("/node_modules/sprintf/lib/sprintf.js",function(n,t,i){var r=function(){function t(n){return Object.prototype.toString.call(n).slice(8,-1).toLowerCase()}function i(n,t){for(var i=[];t>0;i[--t]=n);return i.join("")}var n=function(){return n.cache.hasOwnProperty(arguments[0])||(n.cache[arguments[0]]=n.parse(arguments[0])),n.format.call(null,n.cache[arguments[0]],arguments)};return n.format=function(n,u){for(var a=1,p=n.length,h="",f,c=[],s,e,l,v,y,o=0;o<p;o++)if(h=t(n[o]),h==="string")c.push(n[o]);else if(h==="array"){if(e=n[o],e[2])for(f=u[a],s=0;s<e[2].length;s++){if(!f.hasOwnProperty(e[2][s]))throw r('[sprintf] property "%s" does not exist',e[2][s]);f=f[e[2][s]]}else f=e[1]?u[e[1]]:u[a++];if(/[^s]/.test(e[8])&&t(f)!="number")throw r("[sprintf] expecting number but found %s",t(f));switch(e[8]){case"b":f=f.toString(2);break;case"c":f=String.fromCharCode(f);break;case"d":f=parseInt(f,10);break;case"e":f=e[7]?f.toExponential(e[7]):f.toExponential();break;case"f":f=e[7]?parseFloat(f).toFixed(e[7]):parseFloat(f);break;case"o":f=f.toString(8);break;case"s":f=(f=String(f))&&e[7]?f.substring(0,e[7]):f;break;case"u":f=Math.abs(f);break;case"x":f=f.toString(16);break;case"X":f=f.toString(16).toUpperCase()}f=/[def]/.test(e[8])&&e[3]&&f>=0?"+"+f:f;v=e[4]?e[4]=="0"?"0":e[4].charAt(1):" ";y=e[6]-String(f).length;l=e[6]?i(v,y):"";c.push(e[5]?f+l:l+f)}return c.join("")},n.cache={},n.parse=function(n){for(var r=n,t=[],f=[],o=0;r;){if((t=/^[^\x25]+/.exec(r))!==null)f.push(t[0]);else if((t=/^\x25{2}/.exec(r))!==null)f.push("%");else if((t=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(r))!==null){if(t[2]){o|=1;var e=[],u=t[2],i=[];if((i=/^([a-z_][a-z_\d]*)/i.exec(u))!==null)for(e.push(i[1]);(u=u.substring(i[0].length))!=="";)if((i=/^\.([a-z_][a-z_\d]*)/i.exec(u))!==null)e.push(i[1]);else if((i=/^\[(\d+)\]/.exec(u))!==null)e.push(i[1]);else throw"[sprintf] huh?";else throw"[sprintf] huh?";t[2]=e}else o|=2;if(o===3)throw"[sprintf] mixing positional and named placeholders is not (yet) supported";f.push(t)}else throw"[sprintf] huh?";r=r.substring(t[0].length)}return f},n}(),u=function(n,t){return t.unshift(n),r.apply(null,t)};i.sprintf=r;i.vsprintf=u});require.define("/shred/response.js",function(n,t){var o=n("./content"),f=n("./mixins/headers"),s=n("cookiejar"),h=s.Cookie,u=null,r,i,e;try{u=n("zlib")}catch(c){console.warn("no zlib library")}r=null;try{r=n("iconv-lite")}catch(c){console.warn("no iconv library")}i=function(n,t,i){var f=this,l,a,v,c,e,s,y;if(this._raw=n,this._setHeaders.call(this,n.headers),t.cookieJar&&this.getHeader("set-cookie")){for(l=this.getHeader("set-cookie"),a=[],c=0;c<l.length;c++)if(e=l[c],e){e.match(/domain\=/i)||(e+="; domain="+t.host);e.match(/path\=/i)||(e+="; path="+t.path);try{v=new h(e);v&&a.push(v)}catch(p){console.warn("Tried to set bad cookie: "+e)}}t.cookieJar.setCookies(a)}this.request=t;this.client=t.client;this.log=this.request.log;s=[];y=0;n.on("data",function(n){s.push(n);y+=n.length});n.on("end",function(){var n,t,e,h;if(typeof Buffer=="undefined")n=s.join("");else for(n=new Buffer(y),t=0,e=0;t<s.length;t++)s[t].copy(n,e),e+=s[t].length;h=function(n){f._body=new o({body:n,type:f.getHeader("Content-Type")});i(f)};u&&f.getHeader("Content-Encoding")==="gzip"?u.gunzip(n,function(t,i){n=r&&f.request.encoding?r.fromEncoding(i,f.request.encoding):i.toString();h(n)}):(f.request.encoding&&(n=r.fromEncoding(n,f.request.encoding)),h(n))})};i.prototype={inspect:function(){var n=this,t=this.format_headers(),i=["<Shred Response> ",n.status].join(" ");return[i,"- Headers:",t].join("\n")},format_headers:function(){var i=[],t=this._headers,n,r;for(n in t)t.hasOwnProperty(n)&&(r=t[n],i.push("\t"+n+": "+r));return i.join("\n")}};Object.defineProperties(i.prototype,{status:{get:function(){return this._raw.statusCode},enumerable:!0},body:{get:function(){return this._body}},content:{get:function(){return this.body},enumerable:!0},isRedirect:{get:function(){return this.status>299&&this.status<400&&this.getHeader("Location")},enumerable:!0},isError:{get:function(){return this.status===0||this.status>399},enumerable:!0}});f.getters(i);f.privateSetters(i);e=i.prototype.getHeader;i.prototype.getHeader=function(n){return e.call(this,n)||typeof this._raw.getHeader=="function"&&this._raw.getHeader(n)};t.exports=i});require.define("/shred/content.js",function(n,t){var i=function(n){this.body=n.body;this.data=n.data;this.type=n.type},r,u,f;i.prototype={};Object.defineProperties(i.prototype,{type:{get:function(){if(this._type)return this._type;if(this._data)switch(typeof this._data){case"string":return"text/plain";case"object":return"application/json"}return"text/plain"},set:function(n){return this._type=n,this},enumerable:!0},data:{get:function(){return this._body?this.processor.parser(this._body):this._data},set:function(n){return this._body&&n&&f.setDataWithBody(this),this._data=n,this},enumerable:!0},body:{get:function(){return this._data?this.processor.stringify(this._data):this.processor.stringify(this._body)},set:function(n){return this._data&&n&&f.setBodyWithData(this),this._body=n,this},enumerable:!0},processor:{get:function(){var n=i.processors[this.type],e,f,t,o;if(n)return n;for(e=this.type.split(";")[0],f=e.split(/\+|\//),t=0,o=f.length;t<o;t++)n=i.processors[f[t]];return n||{parser:r,stringify:u}},enumerable:!0},length:{get:function(){return typeof Buffer!="undefined"?Buffer.byteLength(this.body):this.body.length}}});i.processors={};i.registerProcessor=function(n,t){n.forEach?n.forEach(function(n){i.processors[n]=t}):i.processors[n]=t};r=function(n){return n};u=function(n){return n.toString()};i.registerProcessor(["text/html","text/plain","text"],{parser:r,stringify:u});i.registerProcessor(["application/json; charset=utf-8","application/json","json"],{parser:function(n){return JSON.parse(n)},stringify:function(n){return JSON.stringify(n)}});f={setDataWithBody:function(){throw new Error("Attempt to set data attribute of a content object when the body attributes was already set.");},setBodyWithData:function(){throw new Error("Attempt to set body attribute of a content object when the data attributes was already set.");}};t.exports=i});require.define("/shred/mixins/headers.js",function(n,t){var e=function(n){return n.toLowerCase().replace(/(^|-)(\w)/g,function(n){return n.toUpperCase()})},s=function(){return{}},r=function(n){return n._headers||(n._headers=s(n))},u=function(n,t){return r(n)[e(t)]},o=function(n,t){var f=t&&t.length>0?t:Object.keys(r(n)),i=f.reduce(function(t,i){return t[i]=u(n,i),t},{});return Object.freeze(i),i},i=function(n,t,i){return r(n)[e(t)]=i,n},f=function(n,t){for(var r in t)i(n,r,t[r]);return this};t.exports={getters:function(n){n.prototype.getHeader=function(n){return u(this,n)};n.prototype.getHeaders=function(){return o(this,arguments)}},privateSetters:function(n){n.prototype._setHeader=function(n,t){return i(this,n,t)};n.prototype._setHeaders=function(n){return f(this,n)}},setters:function(n){n.prototype.setHeader=function(n,t){return i(this,n,t)};n.prototype.setHeaders=function(n){return f(this,n)}},gettersAndSetters:function(n){n.prototype.getHeader=function(n){return u(this,n)};n.prototype.getHeaders=function(){return o(this,arguments)};n.prototype.setHeader=function(n,t){return i(this,n,t)};n.prototype.setHeaders=function(n){return f(this,n)}}}});require.define("/node_modules/iconv-lite/package.json",function(n,t){t.exports={}});require.define("/node_modules/iconv-lite/index.js",function(n,t,i,r){var u=t.exports={toEncoding:function(n,t){return u.getCodec(t).toEncoding(n)},fromEncoding:function(n,t){return u.getCodec(t).fromEncoding(n)},defaultCharUnicode:"�",defaultCharSingleByte:"?",getCodec:function(n){for(var t=n||"utf8",f=undefined,i,r;;)if(h(t)==="String"&&(t=t.replace(/[- ]/g,"").toLowerCase()),i=u.encodings[t],r=h(i),r==="String")f={originalEncoding:t},t=i;else if(r==="Object"&&i.type!=undefined)f=i,t=i.type;else{if(r==="Function")return i(f);throw new Error("Encoding not recognized: '"+n+"' (searched as: '"+t+"')");}},encodings:{internal:function(n){return{toEncoding:function(t){return new Buffer(s(t),n.originalEncoding)},fromEncoding:function(t){return o(t).toString(n.originalEncoding)}}},utf8:"internal",ucs2:"internal",binary:"internal",ascii:"internal",base64:"internal",singlebyte:function(n){var i,t;if(!n.chars||n.chars.length!==128&&n.chars.length!==256)throw new Error("Encoding '"+n.type+"' has incorrect 'chars' (must be of len 128 or 256)");if(n.chars.length===128&&(n.chars=c+n.chars),n.charsBuf||(n.charsBuf=new Buffer(n.chars,"ucs2")),!n.revCharsBuf){for(n.revCharsBuf=new Buffer(65536),i=u.defaultCharSingleByte.charCodeAt(0),t=0;t<n.revCharsBuf.length;t++)n.revCharsBuf[t]=i;for(t=0;t<n.chars.length;t++)n.revCharsBuf[n.chars.charCodeAt(t)]=t}return{toEncoding:function(t){var r,u,i;for(t=s(t),r=new Buffer(t.length),u=n.revCharsBuf,i=0;i<t.length;i++)r[i]=u[t.charCodeAt(i)];return r},fromEncoding:function(t){var i,s;t=o(t);var e=n.charsBuf,r=new Buffer(t.length*2),u=0,f=0;for(i=0,s=t.length;i<s;i++)u=t[i]*2,f=i*2,r[f]=e[u],r[f+1]=e[u+1];return r.toString("ucs2")}}},table:function(n){var i=n.table,r,t=n.revCharsTable;if(!i)throw new Error("Encoding '"+n.type+"' has incorect 'table' option");if(!t){t=n.revCharsTable={};for(r in i)t[i[r]]=parseInt(r)}return{toEncoding:function(n){var f,h,r,c,e,l,i,o;for(n=s(n),f=n.length,h=f,i=0;i<f;i++)n.charCodeAt(i)>>7&&h++;for(r=new Buffer(h),l=t[u.defaultCharUnicode.charCodeAt(0)],i=0,o=0;i<f;i++)e=n.charCodeAt(i),e>>7?(c=t[e]||l,r[o++]=c>>8,r[o++]=c&255):r[o++]=e;return r},fromEncoding:function(n){var h,c,f,e,r,l,t,s;for(n=o(n),h=n.length,c=0,t=0;t<h;t++)c++,n[t]&128&&t++;for(f=new Buffer(c*2),l=u.defaultCharUnicode.charCodeAt(0),t=0,s=0;t<h;t++,s+=2)r=n[t],r&128?(r=(r<<8)+n[++t],e=i[r]||l):e=r,f[s]=e&255,f[s+1]=e>>8;return f.toString("ucs2")}}}}},f,e;u.encode=u.toEncoding;u.decode=u.fromEncoding;f=r+"/encodings/";e=n("fs");e.readdirSync(f).forEach(function(t){var i,r;if(!e.statSync(f+t).isDirectory()){i=n(f+t);for(r in i)u.encodings[r]=i[r]}});var c="\x00\x01\x02\x03\x04\x05\x06\x07\b\t\n\x0b\f\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~",o=function(n){return n=n||new Buffer(0),n instanceof Buffer?n:new Buffer(n.toString(),"utf8")},s=function(n){return n=n||"",n instanceof String?n:n.toString(n instanceof Buffer?"utf8":undefined)},h=function(n){return Object.prototype.toString.call(n).slice(8,-1)}});require.define("/node_modules/http-browserify/package.json",function(n,t){t.exports={main:"index.js",browserify:"browser.js"}});require.define("/node_modules/http-browserify/browser.js",function(n,t){var i=t.exports,f=n("events").EventEmitter,u=n("./lib/request"),r;i.request=function(n,t){n||(n={});n.host||(n.host=window.location.host.split(":")[0]);n.port||(n.port=window.location.port);var i=new u(new r,n);if(t)i.on("response",t);return i};i.get=function(n,t){n.method="GET";var r=i.request(n,t);return r.end(),r};r=function(){var t,n,i;if(typeof window=="undefined")throw new Error("no window object present");else{if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(t=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],n=0;n<t.length;n++)try{return i=new window.ActiveXObject(t[n]),function(){if(i){var r=i;return i=null,r}return new window.ActiveXObject(t[n])}}catch(r){}throw new Error("ajax not supported in this browser");}else throw new Error("ajax not supported in this browser");}}();i.STATUS_CODES={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",300:"Multiple Choices",301:"Moved Permanently",302:"Moved Temporarily",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Time-out",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Request Entity Too Large",414:"Request-URI Too Large",415:"Unsupported Media Type",416:"Requested Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Time-out",505:"HTTP Version not supported",506:"Variant Also Negotiates",507:"Insufficient Storage",509:"Bandwidth Limit Exceeded",510:"Not Extended"}});require.define("/node_modules/http-browserify/lib/request.js",function(n,t){var r=n("events").EventEmitter,u=n("./response"),f=n("./isSafeHeader"),i=t.exports=function(n,t){var r=this,e,i;r.xhr=n;r.body="";e=t.host+":"+t.port+(t.path||"/");n.open(t.method||"GET",(t.scheme||"http")+"://"+e,!0);t.headers&&Object.keys(t.headers).forEach(function(i){if(f(i)){var r=t.headers[i];Array.isArray(r)?r.forEach(function(t){n.setRequestHeader(i,t)}):n.setRequestHeader(i,r)}});i=new u(n);i.on("ready",function(){r.emit("response",i)});n.onreadystatechange=function(){i.handle(n)}};i.prototype=new r;i.prototype.setHeader=function(n,t){if(Array.isArray&&Array.isArray(t)||t instanceof Array)for(var i=0;i<t.length;i++)this.xhr.setRequestHeader(n,t[i]);else this.xhr.setRequestHeader(n,t)};i.prototype.write=function(n){this.body+=n};i.prototype.end=function(n){n!==undefined&&this.write(n);this.xhr.send(this.body)}});require.define("/node_modules/http-browserify/lib/response.js",function(n,t){function u(n){for(var r,u,i,f,o=n.getAllResponseHeaders().split(/\r?\n/),t={},e=0;e<o.length;e++)(r=o[e],r!=="")&&(u=r.match(/^([^:]+):\s*(.*)/),u?(i=u[1].toLowerCase(),f=u[2],t[i]!==undefined?Array.isArray&&Array.isArray(t[i])||t[i]instanceof Array?t[i].push(f):t[i]=[t[i],f]:t[i]=f):t[r]=!0);return t}var f=n("events").EventEmitter,e=n("./isSafeHeader"),r=t.exports=function(n){this.xhr=n;this.offset=0},i;r.prototype=new f;i={streaming:!0,status2:!0};r.prototype.getHeader=function(n){var t=this.headers?this.headers[n.toLowerCase()]:null;return t?t:e(n)?this.xhr.getResponseHeader(n):null};r.prototype.handle=function(){var n=this.xhr;if(n.readyState===2&&i.status2){try{this.statusCode=n.status;this.headers=u(n)}catch(t){i.status2=!1}i.status2&&this.emit("ready")}else if(i.streaming&&n.readyState===3){try{this.statusCode||(this.statusCode=n.status,this.headers=u(n),this.emit("ready"))}catch(t){}try{this.write()}catch(t){i.streaming=!1}}else n.readyState===4&&(this.statusCode||(this.statusCode=n.status,this.emit("ready")),this.write(),n.error?this.emit("error",n.responseText):this.emit("end"))};r.prototype.write=function(){var n=this.xhr;n.responseText.length>this.offset&&(this.emit("data",n.responseText.slice(this.offset)),this.offset=n.responseText.length)}});require.define("/node_modules/http-browserify/lib/isSafeHeader.js",function(n,t){var i=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","content-transfer-encoding","date","expect","host","keep-alive","origin","referer","set-cookie","te","trailer","transfer-encoding","upgrade","user-agent","via"];t.exports=function(n){return n?i.indexOf(n.toLowerCase())===-1:!1}});require.alias("http-browserify","/node_modules/http");require.alias("http-browserify","/node_modules/https"),function(n){n.fn.slideto=function(t){return t=n.extend({slide_duration:"slow",highlight_duration:3e3,highlight:!0,highlight_color:"#FFFF99"},t),this.each(function(){obj=n(this);n("body").animate({scrollTop:obj.offset().top},t.slide_duration,function(){t.highlight&&n.ui.version&&obj.effect("highlight",{color:t.highlight_color},t.highlight_duration)})})}}(jQuery);jQuery.fn.wiggle=function(n){var n=jQuery.extend({speed:50,wiggles:3,travel:5,callback:null},n);return this.each(function(){var t=this,u=jQuery(this).wrap('<div class="wiggle-wrap"><\/div>').css("position","relative"),r=0;for(i=1;i<=n.wiggles;i++)jQuery(this).animate({left:"-="+n.travel},n.speed).animate({left:"+="+n.travel*2},n.speed*2).animate({left:"-="+n.travel},n.speed,function(){r++;jQuery(t).parent().hasClass("wiggle-wrap")&&jQuery(t).parent().replaceWith(t);r==n.wiggles&&jQuery.isFunction(n.callback)&&n.callback()})})},function(n,t){function c(n){return typeof n=="string"}function o(n){var t=b.call(arguments,1);return function(){return n.apply(this,t.concat(b.call(arguments)))}}function ht(n){return n.replace(/^[^#]*#?(.*)$/,"$1")}function ct(n){return n.replace(/(?:^[^?#]*\?([^#]*).*$)?.*/,"$1")}function ft(o,h,l,v,y){var k,p,b,d,g;return v!==i?(b=l.match(o?/^([^#]*)\#?(.*)$/:/^([^#?]*)\??([^#]*)(#?.*)/),g=b[3]||"",y===2&&c(v)?p=v.replace(o?rt:it,""):(d=r(b[2]),v=c(v)?r[o?u:f](v):v,p=y===2?v:y===1?n.extend({},v,d):n.extend({},d,v),p=s(p),o&&(p=p.replace(ut,a))),k=b[1]+(o?"#":p||!b[1]?"?":"")+p+g):k=h(l!==i?l:t[w][e]),k}function et(n,t,e){return t===i||typeof t=="boolean"?(e=t,t=s[n?u:f]()):t=c(t)?t.replace(n?rt:it,""):t,r(t,e)}function ot(t,r,u,f){return c(u)||typeof u=="object"||(f=u,u=r,r=i),this.each(function(){var e=n(this),i=r||g()[(this.nodeName||"").toLowerCase()]||"",o=i&&e.attr(i)||"";e.attr(i,s[t](o,u,f))})}var i,b=Array.prototype.slice,a=decodeURIComponent,s=n.param,h,r,v,y=n.bbq=n.bbq||{},k,d,g,nt=n.event.special,tt="hashchange",f="querystring",u="fragment",p="elemUrlAttr",w="location",e="href",l="src",it=/^.*\?|#.*$/g,rt=/^.*\#/,ut,st={};s[f]=o(ft,0,ct);s[u]=h=o(ft,1,ht);h.noEscape=function(t){t=t||"";var i=n.map(t.split(""),encodeURIComponent);ut=new RegExp(i.join("|"),"g")};h.noEscape(",/");n.deparam=r=function(t,r){var u={},f={"true":!0,"false":!1,"null":null};return n.each(t.replace(/\+/g," ").split("&"),function(t,e){var y=e.split("="),h=a(y[0]),o,v=u,l=0,s=h.split("]["),c=s.length-1;if(/\[/.test(s[0])&&/\]$/.test(s[c])?(s[c]=s[c].replace(/\]$/,""),s=s.shift().split("[").concat(s),c=s.length-1):c=0,y.length===2)if(o=a(y[1]),r&&(o=o&&!isNaN(o)?+o:o==="undefined"?i:f[o]!==i?f[o]:o),c)for(;l<=c;l++)h=s[l]===""?v.length:s[l],v=v[h]=l<c?v[h]||(s[l+1]&&isNaN(s[l+1])?{}:[]):o;else n.isArray(u[h])?u[h].push(o):u[h]=u[h]!==i?[u[h],o]:o;else h&&(u[h]=r?i:"")}),u};r[f]=o(et,0);r[u]=v=o(et,1);n[p]||(n[p]=function(t){return n.extend(st,t)})({a:e,base:e,iframe:l,img:l,input:l,form:"action",link:e,script:l});g=n[p];n.fn[f]=o(ot,f);n.fn[u]=o(ot,u);y.pushState=k=function(n,r){c(n)&&/^#/.test(n)&&r===i&&(r=2);var u=n!==i,f=h(t[w][e],u?n:{},u?r:2);t[w][e]=f+(/#/.test(f)?"":"#")};y.getState=d=function(n,t){return n===i||typeof n=="boolean"?v(n):v(t)[n]};y.removeState=function(t){var r={};t!==i&&(r=d(),n.each(n.isArray(t)?t:arguments,function(n,t){delete r[t]}));k(r,2)};nt[tt]=n.extend(nt[tt],{add:function(t){function e(n){var t=n[u]=h();n.getState=function(n,u){return n===i||typeof n=="boolean"?r(t,n):r(t,u)[n]};f.apply(this,arguments)}var f;if(n.isFunction(t))return f=t,e;f=t.handler;t.handler=e}})}(jQuery,this),function(n,t,i){function e(n){return n=n||t[u][f],n.replace(/^[^#]*#?(.*)$/,"$1")}var o,s=n.event.special,u="location",r="hashchange",f="href",a=n.browser,h=document.documentMode,c=a.msie&&(h===i||h<8),l="on"+r in t&&!c;n[r+"Delay"]=100;s[r]=n.extend(s[r],{setup:function(){if(l)return!1;n(o.start)},teardown:function(){if(l)return!1;n(o.stop)}});o=function(){function a(){o=l=function(n){return n};c&&(s=n('<iframe src="javascript:0"/>').hide().insertAfter("body")[0].contentWindow,l=function(){return e(s.document[u][f])},o=function(n,t){if(n!==t){var i=s.document;i.open().close();i[u].hash="#"+n}},o(e()))}var h={},i,s,o,l;return h.start=function(){if(!i){var s=e();o||a(),function h(){var a=e(),c=l(s);a!==s?(o(s=a,c),n(t).trigger(r)):c!==s&&(t[u][f]=t[u][f].replace(/#.*/,"")+"#"+c);i=setTimeout(h,n[r+"Delay"])}()}},h.stop=function(){s||(i&&clearTimeout(i),i=0)},h}()}(jQuery,this);Handlebars={},function(n,t){var a,o,f,i,u,c,v,s,h;n.VERSION="1.0.0";n.COMPILER_REVISION=4;n.REVISION_CHANGES={1:"<= 1.0.rc.2",2:"== 1.0.0-rc.3",3:"== 1.0.0-rc.4",4:">= 1.0.0"};n.helpers={};n.partials={};var r=Object.prototype.toString,e="[object Function]",l="[object Object]";n.registerHelper=function(t,i,u){if(r.call(t)===l){if(u||i)throw new n.Exception("Arg not supported with multiple helpers");n.Utils.extend(this.helpers,t)}else u&&(i.not=u),this.helpers[t]=i};n.registerPartial=function(t,i){r.call(t)===l?n.Utils.extend(this.partials,t):this.partials[t]=i};n.registerHelper("helperMissing",function(n){if(arguments.length===2)return t;throw new Error("Missing helper: '"+n+"'");});n.registerHelper("blockHelperMissing",function(t,i){var u=i.inverse||function(){},f=i.fn,o=r.call(t);return o===e&&(t=t.call(this)),t===!0?f(this):t===!1||t==null?u(this):o==="[object Array]"?t.length>0?n.helpers.each(t,i):u(this):f(t)});n.K=function(){};n.createFrame=Object.create||function(t){n.K.prototype=t;var i=new n.K;return n.K.prototype=null,i};n.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,methodMap:{0:"debug",1:"info",2:"warn",3:"error"},log:function(t,i){if(n.logger.level<=t){var r=n.logger.methodMap[t];typeof console!="undefined"&&console[r]&&console[r].call(console,i)}}};n.log=function(t,i){n.logger.log(t,i)};n.registerHelper("each",function(t,i){var h=i.fn,l=i.inverse,f=0,o="",u,a=r.call(t),c,s;if(a===e&&(t=t.call(this)),i.data&&(u=n.createFrame(i.data)),t&&typeof t=="object")if(t instanceof Array)for(c=t.length;f<c;f++)u&&(u.index=f),o=o+h(t[f],{data:u});else for(s in t)t.hasOwnProperty(s)&&(u&&(u.key=s),o=o+h(t[s],{data:u}),f++);return f===0&&(o=l(this)),o});n.registerHelper("if",function(t,i){var u=r.call(t);return u===e&&(t=t.call(this)),!t||n.Utils.isEmpty(t)?i.inverse(this):i.fn(this)});n.registerHelper("unless",function(t,i){return n.helpers["if"].call(this,t,{fn:i.inverse,inverse:i.fn})});n.registerHelper("with",function(t,i){var u=r.call(t);return u===e&&(t=t.call(this)),n.Utils.isEmpty(t)?void 0:i.fn(t)});n.registerHelper("log",function(t,i){var r=i.data&&i.data.level!=null?parseInt(i.data.level,10):1;n.log(r,t)});a=function(){function t(){this.yy={}}var n={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,simpleInverse:6,statements:7,statement:8,openInverse:9,closeBlock:10,openBlock:11,mustache:12,partial:13,CONTENT:14,COMMENT:15,OPEN_BLOCK:16,inMustache:17,CLOSE:18,OPEN_INVERSE:19,OPEN_ENDBLOCK:20,path:21,OPEN:22,OPEN_UNESCAPED:23,CLOSE_UNESCAPED:24,OPEN_PARTIAL:25,partialName:26,params:27,hash:28,dataName:29,param:30,STRING:31,INTEGER:32,BOOLEAN:33,hashSegments:34,hashSegment:35,ID:36,EQUALS:37,DATA:38,pathSegments:39,SEP:40,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",14:"CONTENT",15:"COMMENT",16:"OPEN_BLOCK",18:"CLOSE",19:"OPEN_INVERSE",20:"OPEN_ENDBLOCK",22:"OPEN",23:"OPEN_UNESCAPED",24:"CLOSE_UNESCAPED",25:"OPEN_PARTIAL",31:"STRING",32:"INTEGER",33:"BOOLEAN",36:"ID",37:"EQUALS",38:"DATA",40:"SEP"},productions_:[0,[3,2],[4,2],[4,3],[4,2],[4,1],[4,1],[4,0],[7,1],[7,2],[8,3],[8,3],[8,1],[8,1],[8,1],[8,1],[11,3],[9,3],[10,3],[12,3],[12,3],[13,3],[13,4],[6,2],[17,3],[17,2],[17,2],[17,1],[17,1],[27,2],[27,1],[30,1],[30,1],[30,1],[30,1],[30,1],[28,1],[34,2],[34,1],[35,3],[35,3],[35,3],[35,3],[35,3],[26,1],[26,1],[26,1],[29,2],[21,1],[39,3],[39,1]],performAction:function(n,t,i,r,u,f){var e=f.length-1;switch(u){case 1:return f[e-1];case 2:this.$=new r.ProgramNode([],f[e]);break;case 3:this.$=new r.ProgramNode(f[e-2],f[e]);break;case 4:this.$=new r.ProgramNode(f[e-1],[]);break;case 5:this.$=new r.ProgramNode(f[e]);break;case 6:this.$=new r.ProgramNode([],[]);break;case 7:this.$=new r.ProgramNode([]);break;case 8:this.$=[f[e]];break;case 9:f[e-1].push(f[e]);this.$=f[e-1];break;case 10:this.$=new r.BlockNode(f[e-2],f[e-1].inverse,f[e-1],f[e]);break;case 11:this.$=new r.BlockNode(f[e-2],f[e-1],f[e-1].inverse,f[e]);break;case 12:this.$=f[e];break;case 13:this.$=f[e];break;case 14:this.$=new r.ContentNode(f[e]);break;case 15:this.$=new r.CommentNode(f[e]);break;case 16:this.$=new r.MustacheNode(f[e-1][0],f[e-1][1]);break;case 17:this.$=new r.MustacheNode(f[e-1][0],f[e-1][1]);break;case 18:this.$=f[e-1];break;case 19:this.$=new r.MustacheNode(f[e-1][0],f[e-1][1],f[e-2][2]==="&");break;case 20:this.$=new r.MustacheNode(f[e-1][0],f[e-1][1],!0);break;case 21:this.$=new r.PartialNode(f[e-1]);break;case 22:this.$=new r.PartialNode(f[e-2],f[e-1]);break;case 24:this.$=[[f[e-2]].concat(f[e-1]),f[e]];break;case 25:this.$=[[f[e-1]].concat(f[e]),null];break;case 26:this.$=[[f[e-1]],f[e]];break;case 27:this.$=[[f[e]],null];break;case 28:this.$=[[f[e]],null];break;case 29:f[e-1].push(f[e]);this.$=f[e-1];break;case 30:this.$=[f[e]];break;case 31:this.$=f[e];break;case 32:this.$=new r.StringNode(f[e]);break;case 33:this.$=new r.IntegerNode(f[e]);break;case 34:this.$=new r.BooleanNode(f[e]);break;case 35:this.$=f[e];break;case 36:this.$=new r.HashNode(f[e]);break;case 37:f[e-1].push(f[e]);this.$=f[e-1];break;case 38:this.$=[f[e]];break;case 39:this.$=[f[e-2],f[e]];break;case 40:this.$=[f[e-2],new r.StringNode(f[e])];break;case 41:this.$=[f[e-2],new r.IntegerNode(f[e])];break;case 42:this.$=[f[e-2],new r.BooleanNode(f[e])];break;case 43:this.$=[f[e-2],f[e]];break;case 44:this.$=new r.PartialNameNode(f[e]);break;case 45:this.$=new r.PartialNameNode(new r.StringNode(f[e]));break;case 46:this.$=new r.PartialNameNode(new r.IntegerNode(f[e]));break;case 47:this.$=new r.DataNode(f[e]);break;case 48:this.$=new r.IdNode(f[e]);break;case 49:f[e-2].push({part:f[e],separator:f[e-1]});this.$=f[e-2];break;case 50:this.$=[{part:f[e]}]}},table:[{3:1,4:2,5:[2,7],6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],22:[1,14],23:[1,15],25:[1,16]},{1:[3]},{5:[1,17]},{5:[2,6],7:18,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,6],22:[1,14],23:[1,15],25:[1,16]},{5:[2,5],6:20,8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,5],22:[1,14],23:[1,15],25:[1,16]},{17:23,18:[1,22],21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,8],14:[2,8],15:[2,8],16:[2,8],19:[2,8],20:[2,8],22:[2,8],23:[2,8],25:[2,8]},{4:29,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{4:30,6:3,7:4,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,5],20:[2,7],22:[1,14],23:[1,15],25:[1,16]},{5:[2,12],14:[2,12],15:[2,12],16:[2,12],19:[2,12],20:[2,12],22:[2,12],23:[2,12],25:[2,12]},{5:[2,13],14:[2,13],15:[2,13],16:[2,13],19:[2,13],20:[2,13],22:[2,13],23:[2,13],25:[2,13]},{5:[2,14],14:[2,14],15:[2,14],16:[2,14],19:[2,14],20:[2,14],22:[2,14],23:[2,14],25:[2,14]},{5:[2,15],14:[2,15],15:[2,15],16:[2,15],19:[2,15],20:[2,15],22:[2,15],23:[2,15],25:[2,15]},{17:31,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:32,21:24,29:25,36:[1,28],38:[1,27],39:26},{17:33,21:24,29:25,36:[1,28],38:[1,27],39:26},{21:35,26:34,31:[1,36],32:[1,37],36:[1,28],39:26},{1:[2,1]},{5:[2,2],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,2],22:[1,14],23:[1,15],25:[1,16]},{17:23,21:24,29:25,36:[1,28],38:[1,27],39:26},{5:[2,4],7:38,8:6,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,4],22:[1,14],23:[1,15],25:[1,16]},{5:[2,9],14:[2,9],15:[2,9],16:[2,9],19:[2,9],20:[2,9],22:[2,9],23:[2,9],25:[2,9]},{5:[2,23],14:[2,23],15:[2,23],16:[2,23],19:[2,23],20:[2,23],22:[2,23],23:[2,23],25:[2,23]},{18:[1,39]},{18:[2,27],21:44,24:[2,27],27:40,28:41,29:48,30:42,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,28],24:[2,28]},{18:[2,48],24:[2,48],31:[2,48],32:[2,48],33:[2,48],36:[2,48],38:[2,48],40:[1,51]},{21:52,36:[1,28],39:26},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],38:[2,50],40:[2,50]},{10:53,20:[1,54]},{10:55,20:[1,54]},{18:[1,56]},{18:[1,57]},{24:[1,58]},{18:[1,59],21:60,36:[1,28],39:26},{18:[2,44],36:[2,44]},{18:[2,45],36:[2,45]},{18:[2,46],36:[2,46]},{5:[2,3],8:21,9:7,11:8,12:9,13:10,14:[1,11],15:[1,12],16:[1,13],19:[1,19],20:[2,3],22:[1,14],23:[1,15],25:[1,16]},{14:[2,17],15:[2,17],16:[2,17],19:[2,17],20:[2,17],22:[2,17],23:[2,17],25:[2,17]},{18:[2,25],21:44,24:[2,25],28:61,29:48,30:62,31:[1,45],32:[1,46],33:[1,47],34:43,35:49,36:[1,50],38:[1,27],39:26},{18:[2,26],24:[2,26]},{18:[2,30],24:[2,30],31:[2,30],32:[2,30],33:[2,30],36:[2,30],38:[2,30]},{18:[2,36],24:[2,36],35:63,36:[1,64]},{18:[2,31],24:[2,31],31:[2,31],32:[2,31],33:[2,31],36:[2,31],38:[2,31]},{18:[2,32],24:[2,32],31:[2,32],32:[2,32],33:[2,32],36:[2,32],38:[2,32]},{18:[2,33],24:[2,33],31:[2,33],32:[2,33],33:[2,33],36:[2,33],38:[2,33]},{18:[2,34],24:[2,34],31:[2,34],32:[2,34],33:[2,34],36:[2,34],38:[2,34]},{18:[2,35],24:[2,35],31:[2,35],32:[2,35],33:[2,35],36:[2,35],38:[2,35]},{18:[2,38],24:[2,38],36:[2,38]},{18:[2,50],24:[2,50],31:[2,50],32:[2,50],33:[2,50],36:[2,50],37:[1,65],38:[2,50],40:[2,50]},{36:[1,66]},{18:[2,47],24:[2,47],31:[2,47],32:[2,47],33:[2,47],36:[2,47],38:[2,47]},{5:[2,10],14:[2,10],15:[2,10],16:[2,10],19:[2,10],20:[2,10],22:[2,10],23:[2,10],25:[2,10]},{21:67,36:[1,28],39:26},{5:[2,11],14:[2,11],15:[2,11],16:[2,11],19:[2,11],20:[2,11],22:[2,11],23:[2,11],25:[2,11]},{14:[2,16],15:[2,16],16:[2,16],19:[2,16],20:[2,16],22:[2,16],23:[2,16],25:[2,16]},{5:[2,19],14:[2,19],15:[2,19],16:[2,19],19:[2,19],20:[2,19],22:[2,19],23:[2,19],25:[2,19]},{5:[2,20],14:[2,20],15:[2,20],16:[2,20],19:[2,20],20:[2,20],22:[2,20],23:[2,20],25:[2,20]},{5:[2,21],14:[2,21],15:[2,21],16:[2,21],19:[2,21],20:[2,21],22:[2,21],23:[2,21],25:[2,21]},{18:[1,68]},{18:[2,24],24:[2,24]},{18:[2,29],24:[2,29],31:[2,29],32:[2,29],33:[2,29],36:[2,29],38:[2,29]},{18:[2,37],24:[2,37],36:[2,37]},{37:[1,65]},{21:69,29:73,31:[1,70],32:[1,71],33:[1,72],36:[1,28],38:[1,27],39:26},{18:[2,49],24:[2,49],31:[2,49],32:[2,49],33:[2,49],36:[2,49],38:[2,49],40:[2,49]},{18:[1,74]},{5:[2,22],14:[2,22],15:[2,22],16:[2,22],19:[2,22],20:[2,22],22:[2,22],23:[2,22],25:[2,22]},{18:[2,39],24:[2,39],36:[2,39]},{18:[2,40],24:[2,40],36:[2,40]},{18:[2,41],24:[2,41],36:[2,41]},{18:[2,42],24:[2,42],36:[2,42]},{18:[2,43],24:[2,43],36:[2,43]},{5:[2,18],14:[2,18],15:[2,18],16:[2,18],19:[2,18],20:[2,18],22:[2,18],23:[2,18],25:[2,18]}],defaultActions:{17:[2,1]},parseError:function(n){throw new Error(n);},parse:function(n){function it(){var n;return n=k.lexer.lex()||1,typeof n!="number"&&(n=k.symbols_[n]||n),n}var k=this,r=[0],f=[null],t=[],h=this.table,d="",c=0,g=0,y=0,l,nt,i,p,o,u,w,s,a,e,tt,v,b;for(this.lexer.setInput(n),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,typeof this.lexer.yylloc=="undefined"&&(this.lexer.yylloc={}),l=this.lexer.yylloc,t.push(l),nt=this.lexer.options&&this.lexer.options.ranges,typeof this.yy.parseError=="function"&&(this.parseError=this.yy.parseError),s={};;){if(o=r[r.length-1],this.defaultActions[o]?u=this.defaultActions[o]:((i===null||typeof i=="undefined")&&(i=it()),u=h[o]&&h[o][i]),(typeof u=="undefined"||!u.length||!u[0])&&(b="",!y)){v=[];for(a in h[o])this.terminals_[a]&&a>2&&v.push("'"+this.terminals_[a]+"'");b=this.lexer.showPosition?"Parse error on line "+(c+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[i]||i)+"'":"Parse error on line "+(c+1)+": Unexpected "+(i==1?"end of input":"'"+(this.terminals_[i]||i)+"'");this.parseError(b,{text:this.lexer.match,token:this.terminals_[i]||i,line:this.lexer.yylineno,loc:l,expected:v})}if(u[0]instanceof Array&&u.length>1)throw new Error("Parse Error: multiple actions possible at state: "+o+", token: "+i);switch(u[0]){case 1:r.push(i);f.push(this.lexer.yytext);t.push(this.lexer.yylloc);r.push(u[1]);i=null;p?(i=p,p=null):(g=this.lexer.yyleng,d=this.lexer.yytext,c=this.lexer.yylineno,l=this.lexer.yylloc,y>0&&y--);break;case 2:if(e=this.productions_[u[1]][1],s.$=f[f.length-e],s._$={first_line:t[t.length-(e||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(e||1)].first_column,last_column:t[t.length-1].last_column},nt&&(s._$.range=[t[t.length-(e||1)].range[0],t[t.length-1].range[1]]),w=this.performAction.call(s,d,g,c,this.yy,u[1],f,t),typeof w!="undefined")return w;e&&(r=r.slice(0,-2*e),f=f.slice(0,-1*e),t=t.slice(0,-1*e));r.push(this.productions_[u[1]][0]);f.push(s.$);t.push(s._$);tt=h[r[r.length-2]][r[r.length-1]];r.push(tt);break;case 3:return!0}}return!0}},i=function(){var n={EOF:1,parseError:function(n,t){if(this.yy.parser)this.yy.parser.parseError(n,t);else throw new Error(n);},setInput:function(n){return this._input=n,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var n=this._input[0],t;return this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n,t=n.match(/(?:\r\n?|\n).*/g),t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},unput:function(n){var i=n.length,t=n.split(/(?:\r\n?|\n)/g),r,u;return this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i-1),this.offset-=i,r=this.match.split(/(?:\r\n?|\n)/g),this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),t.length-1&&(this.yylineno-=t.length-1),u=this.yylloc.range,this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:t?(t.length===r.length?this.yylloc.first_column:0)+r[r.length-t.length].length-t[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this},more:function(){return this._more=!0,this},less:function(n){this.unput(this.match.slice(n))},pastInput:function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var n=this.pastInput(),t=new Array(n.length+1).join("-");return n+this.upcomingInput()+"\n"+t+"^"},next:function(){var f,n,r,e,t,u,i;if(this.done)return this.EOF;for(this._input||(this.done=!0),this._more||(this.yytext="",this.match=""),u=this._currentRules(),i=0;i<u.length;i++)if(r=this._input.match(this.rules[u[i]]),r&&(!n||r[0].length>n[0].length)&&(n=r,e=i,!this.options.flex))break;return n?(t=n[0].match(/(?:\r\n?|\n).*/g),t&&(this.yylineno+=t.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:t?t[t.length-1].length-t[t.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+n[0].length},this.yytext+=n[0],this.match+=n[0],this.matches=n,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(n[0].length),this.matched+=n[0],f=this.performAction.call(this,this.yy,this,u[e],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),f)?f:void 0:this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var n=this.next();return typeof n!="undefined"?n:this.lex()},begin:function(n){this.conditionStack.push(n)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(n){this.begin(n)}};return n.options={},n.performAction=function(n,t,i,r){var u=r;switch(i){case 0:return t.yytext="\\",14;case 1:if(t.yytext.slice(-1)!=="\\"&&this.begin("mu"),t.yytext.slice(-1)==="\\"&&(t.yytext=t.yytext.substr(0,t.yyleng-1),this.begin("emu")),t.yytext)return 14;break;case 2:return 14;case 3:return t.yytext.slice(-1)!=="\\"&&this.popState(),t.yytext.slice(-1)==="\\"&&(t.yytext=t.yytext.substr(0,t.yyleng-1)),14;case 4:return t.yytext=t.yytext.substr(0,t.yyleng-4),this.popState(),15;case 5:return 25;case 6:return 16;case 7:return 20;case 8:return 19;case 9:return 19;case 10:return 23;case 11:return 22;case 12:this.popState();this.begin("com");break;case 13:return t.yytext=t.yytext.substr(3,t.yyleng-5),this.popState(),15;case 14:return 22;case 15:return 37;case 16:return 36;case 17:return 36;case 18:return 40;case 20:return this.popState(),24;case 21:return this.popState(),18;case 22:return t.yytext=t.yytext.substr(1,t.yyleng-2).replace(/\\"/g,'"'),31;case 23:return t.yytext=t.yytext.substr(1,t.yyleng-2).replace(/\\'/g,"'"),31;case 24:return 38;case 25:return 33;case 26:return 33;case 27:return 32;case 28:return 36;case 29:return t.yytext=t.yytext.substr(1,t.yyleng-2),36;case 30:return"INVALID";case 31:return 5}},n.rules=[/^(?:\\\\(?=(\{\{)))/,/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|$)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\{\{>)/,/^(?:\{\{#)/,/^(?:\{\{\/)/,/^(?:\{\{\^)/,/^(?:\{\{\s*else\b)/,/^(?:\{\{\{)/,/^(?:\{\{&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{)/,/^(?:=)/,/^(?:\.(?=[}\/ ]))/,/^(?:\.\.)/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}\}\})/,/^(?:\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=[}\s]))/,/^(?:false(?=[}\s]))/,/^(?:-?[0-9]+(?=[}\s]))/,/^(?:[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.]))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],n.conditions={mu:{rules:[5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31],inclusive:!1},emu:{rules:[3],inclusive:!1},com:{rules:[4],inclusive:!1},INITIAL:{rules:[0,1,2,31],inclusive:!0}},n}();return n.lexer=i,t.prototype=n,n.Parser=t,new t}();n.Parser=a;n.parse=function(t){return t.constructor===n.AST.ProgramNode?t:(n.Parser.yy=n.AST,n.Parser.parse(t))};n.AST={};n.AST.ProgramNode=function(t,i){this.type="program";this.statements=t;i&&(this.inverse=new n.AST.ProgramNode(i))};n.AST.MustacheNode=function(n,t,i){this.type="mustache";this.escaped=!i;this.hash=t;var r=this.id=n[0],u=this.params=n.slice(1),f=this.eligibleHelper=r.isSimple;this.isHelper=f&&(u.length||t)};n.AST.PartialNode=function(n,t){this.type="partial";this.partialName=n;this.context=t};n.AST.BlockNode=function(t,i,r,u){var f=function(t,i){if(t.original!==i.original)throw new n.Exception(t.original+" doesn't match "+i.original);};f(t.id,u);this.type="block";this.mustache=t;this.program=i;this.inverse=r;this.inverse&&!this.program&&(this.isInverse=!0)};n.AST.ContentNode=function(n){this.type="content";this.string=n};n.AST.HashNode=function(n){this.type="hash";this.pairs=n};n.AST.IdNode=function(t){var r,o,i;this.type="ID";var f="",u=[],e=0;for(r=0,o=t.length;r<o;r++)if(i=t[r].part,f+=(t[r].separator||"")+i,i===".."||i==="."||i==="this")if(u.length>0)throw new n.Exception("Invalid path: "+f);else i===".."?e++:this.isScoped=!0;else u.push(i);this.original=f;this.parts=u;this.string=u.join(".");this.depth=e;this.isSimple=t.length===1&&!this.isScoped&&e===0;this.stringModeValue=this.string};n.AST.PartialNameNode=function(n){this.type="PARTIAL_NAME";this.name=n.original};n.AST.DataNode=function(n){this.type="DATA";this.id=n};n.AST.StringNode=function(n){this.type="STRING";this.original=this.string=this.stringModeValue=n};n.AST.IntegerNode=function(n){this.type="INTEGER";this.original=this.integer=n;this.stringModeValue=Number(n)};n.AST.BooleanNode=function(n){this.type="BOOLEAN";this.bool=n;this.stringModeValue=n==="true"};n.AST.CommentNode=function(n){this.type="comment";this.comment=n};o=["description","fileName","lineNumber","message","name","number","stack"];n.Exception=function(){for(var t=Error.prototype.constructor.apply(this,arguments),n=0;n<o.length;n++)this[o[n]]=t[o[n]]};n.Exception.prototype=new Error;n.SafeString=function(n){this.string=n};n.SafeString.prototype.toString=function(){return this.string.toString()};var y={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},p=/[&<>"'`]/g,w=/[&<>"'`]/,b=function(n){return y[n]||"&amp;"};for(n.Utils={extend:function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},escapeExpression:function(t){return t instanceof n.SafeString?t.toString():t==null||t===!1?"":(t=t.toString(),!w.test(t))?t:t.replace(p,b)},isEmpty:function(n){return n||n===0?r.call(n)==="[object Array]"&&n.length===0?!0:!1:!0}},f=n.Compiler=function(){},i=n.JavaScriptCompiler=function(){},f.prototype={compiler:f,disassemble:function(){for(var i,e=this.opcodes,n,r=[],u,t,f=0,o=e.length;f<o;f++)if(n=e[f],n.opcode==="DECLARE")r.push("DECLARE "+n.name+"="+n.value);else{for(u=[],i=0;i<n.args.length;i++)t=n.args[i],typeof t=="string"&&(t='"'+t.replace("\n","\\n")+'"'),u.push(t);r.push(n.opcode+" "+u.join(" "))}return r.join("\n")},equals:function(n){var i=this.opcodes.length,t,r,f,u;if(n.opcodes.length!==i)return!1;for(t=0;t<i;t++){if(r=this.opcodes[t],f=n.opcodes[t],r.opcode!==f.opcode||r.args.length!==f.args.length)return!1;for(u=0;u<r.args.length;u++)if(r.args[u]!==f.args[u])return!1}if(i=this.children.length,n.children.length!==i)return!1;for(t=0;t<i;t++)if(!this.children[t].equals(n.children[t]))return!1;return!0},guid:0,compile:function(n,t){var i,r;if(this.children=[],this.depths={list:[]},this.options=t,i=this.options.knownHelpers,this.options.knownHelpers={helperMissing:!0,blockHelperMissing:!0,each:!0,"if":!0,unless:!0,"with":!0,log:!0},i)for(r in i)this.options.knownHelpers[r]=i[r];return this.program(n)},accept:function(n){return this[n.type](n)},program:function(n){var u=n.statements,i,t,r;for(this.opcodes=[],t=0,r=u.length;t<r;t++)i=u[t],this[i.type](i);return this.isSimple=r===1,this.depths.list=this.depths.list.sort(function(n,t){return n-t}),this},compileProgram:function(n){var t=(new this.compiler).compile(n,this.options),u=this.guid++,r,i,f;for(this.usePartial=this.usePartial||t.usePartial,this.children[u]=t,i=0,f=t.depths.list.length;i<f;i++)if(r=t.depths.list[i],r<2)continue;else this.addDepth(r-1);return u},block:function(n){var r=n.mustache,t=n.program,i=n.inverse,u;t&&(t=this.compileProgram(t));i&&(i=this.compileProgram(i));u=this.classifyMustache(r);u==="helper"?this.helperMustache(r,t,i):u==="simple"?(this.simpleMustache(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("blockValue")):(this.ambiguousMustache(r,t,i),this.opcode("pushProgram",t),this.opcode("pushProgram",i),this.opcode("emptyHash"),this.opcode("ambiguousBlockValue"));this.opcode("append")},hash:function(n){var u=n.pairs,r,t,i,f;for(this.opcode("pushHash"),i=0,f=u.length;i<f;i++)r=u[i],t=r[1],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type)):this.accept(t),this.opcode("assignToHash",r[0]);this.opcode("popHash")},partial:function(n){var t=n.partialName;this.usePartial=!0;n.context?this.ID(n.context):this.opcode("push","depth0");this.opcode("invokePartial",t.name);this.opcode("append")},content:function(n){this.opcode("appendContent",n.string)},mustache:function(n){var i=this.options,t=this.classifyMustache(n);t==="simple"?this.simpleMustache(n):t==="helper"?this.helperMustache(n):this.ambiguousMustache(n);n.escaped&&!i.noEscape?this.opcode("appendEscaped"):this.opcode("append")},ambiguousMustache:function(n,t,i){var r=n.id,u=r.parts[0],f=t!=null||i!=null;this.opcode("getContext",r.depth);this.opcode("pushProgram",t);this.opcode("pushProgram",i);this.opcode("invokeAmbiguous",u,f)},simpleMustache:function(n){var t=n.id;t.type==="DATA"?this.DATA(t):t.parts.length?this.ID(t):(this.addDepth(t.depth),this.opcode("getContext",t.depth),this.opcode("pushContext"));this.opcode("resolvePossibleLambda")},helperMustache:function(n,t,i){var u=this.setupFullMustacheParams(n,t,i),r=n.id.parts[0];if(this.options.knownHelpers[r])this.opcode("invokeKnownHelper",u.length,r);else if(this.options.knownHelpersOnly)throw new Error("You specified knownHelpersOnly, but used the unknown helper "+r);else this.opcode("invokeHelper",u.length,r)},ID:function(n){var i,t,r;for(this.addDepth(n.depth),this.opcode("getContext",n.depth),i=n.parts[0],i?this.opcode("lookupOnContext",n.parts[0]):this.opcode("pushContext"),t=1,r=n.parts.length;t<r;t++)this.opcode("lookup",n.parts[t])},DATA:function(t){var r,i,u;if(this.options.data=!0,t.id.isScoped||t.id.depth)throw new n.Exception("Scoped data references are not supported: "+t.original);for(this.opcode("lookupData"),r=t.id.parts,i=0,u=r.length;i<u;i++)this.opcode("lookup",r[i])},STRING:function(n){this.opcode("pushString",n.string)},INTEGER:function(n){this.opcode("pushLiteral",n.integer)},BOOLEAN:function(n){this.opcode("pushLiteral",n.bool)},comment:function(){},opcode:function(n){this.opcodes.push({opcode:n,args:[].slice.call(arguments,1)})},declare:function(n,t){this.opcodes.push({opcode:"DECLARE",name:n,value:t})},addDepth:function(n){if(isNaN(n))throw new Error("EWOT");n!==0&&(this.depths[n]||(this.depths[n]=!0,this.depths.list.push(n)))},classifyMustache:function(n){var t=n.isHelper,i=n.eligibleHelper,r=this.options,u;return i&&!t&&(u=n.id.parts[0],r.knownHelpers[u]?t=!0:r.knownHelpersOnly&&(i=!1)),t?"helper":i?"ambiguous":"simple"},pushParams:function(n){for(var i=n.length,t;i--;)t=n[i],this.options.stringParams?(t.depth&&this.addDepth(t.depth),this.opcode("getContext",t.depth||0),this.opcode("pushStringParam",t.stringModeValue,t.type)):this[t.type](t)},setupMustacheParams:function(n){var t=n.params;return this.pushParams(t),n.hash?this.hash(n.hash):this.opcode("emptyHash"),t},setupFullMustacheParams:function(n,t,i){var r=n.params;return this.pushParams(r),this.opcode("pushProgram",t),this.opcode("pushProgram",i),n.hash?this.hash(n.hash):this.opcode("emptyHash"),r}},u=function(n){this.value=n},i.prototype={nameLookup:function(n,t){return/^[0-9]+$/.test(t)?n+"["+t+"]":i.isValidJavaScriptVariableName(t)?n+"."+t:n+"['"+t+"']"},appendToBuffer:function(n){return this.environment.isSimple?"return "+n+";":{appendToBuffer:!0,content:n,toString:function(){return"buffer += "+n+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(t,i,r,u){this.environment=t;this.options=i||{};n.log(n.logger.DEBUG,this.environment.disassemble()+"\n\n");this.name=this.environment.name;this.isChild=!!r;this.context=r||{programs:[],environments:[],aliases:{}};this.preamble();this.stackSlot=0;this.stackVars=[];this.registers={list:[]};this.compileStack=[];this.inlineStack=[];this.compileChildren(t,i);var e=t.opcodes,f;for(this.i=0,h=e.length;this.i<h;this.i++)f=e[this.i],f.opcode==="DECLARE"?this[f.name]=f.value:this[f.opcode].apply(this,f.args);return this.createFunctionContext(u)},nextOpcode:function(){var n=this.environment.opcodes;return n[this.i+1]},eat:function(){this.i=this.i+1},preamble:function(){var t=[],i,n;this.isChild?t.push(""):(i=this.namespace,n="helpers = this.merge(helpers, "+i+".helpers);",this.environment.usePartial&&(n=n+" partials = this.merge(partials, "+i+".partials);"),this.options.data&&(n=n+" data = data || {};"),t.push(n));this.environment.isSimple?t.push(""):t.push(", buffer = "+this.initializeBuffer());this.lastContext=0;this.source=t},createFunctionContext:function(t){var s=this.stackVars.concat(this.registers.list),u,i,f,h,r,e,c,o;if(s.length>0&&(this.source[1]=this.source[1]+", "+s.join(", ")),!this.isChild)for(u in this.context.aliases)this.context.aliases.hasOwnProperty(u)&&(this.source[1]=this.source[1]+", "+u+"="+this.context.aliases[u]);for(this.source[1]&&(this.source[1]="var "+this.source[1].substring(2)+";"),this.isChild||(this.source[1]+="\n"+this.context.programs.join("\n")+"\n"),this.environment.isSimple||this.source.push("return buffer;"),i=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"],f=0,h=this.environment.depths.list.length;f<h;f++)i.push("depth"+this.environment.depths.list[f]);return r=this.mergeSource(),this.isChild||(e=n.COMPILER_REVISION,c=n.REVISION_CHANGES[e],r="this.compilerInfo = ["+e+",'"+c+"'];\n"+r),t?(i.push(r),Function.apply(this,i)):(o="function "+(this.name||"")+"("+i.join(",")+") {\n  "+r+"}",n.log(n.logger.DEBUG,o+"\n\n"),o)},mergeSource:function(){for(var i,r="",n,u=0,f=this.source.length;u<f;u++)i=this.source[u],i.appendToBuffer?n=n?n+"\n    + "+i.content:i.content:(n&&(r+="buffer += "+n+";\n  ",n=t),r+=i+"\n  ");return r},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var n=["depth0"];this.setupParams(0,n);this.replaceStack(function(t){return n.splice(1,0,t),"blockHelperMissing.call("+n.join(", ")+")"})},ambiguousBlockValue:function(){var n,t;this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";n=["depth0"];this.setupParams(0,n);t=this.topStack();n.splice(1,0,t);n[n.length-1]="options";this.source.push("if (!"+this.lastHelper+") { "+t+" = blockHelperMissing.call("+n.join(", ")+"); }")},appendContent:function(n){this.source.push(this.appendToBuffer(this.quotedString(n)))},append:function(){this.flushInline();var n=this.popStack();this.source.push("if("+n+" || "+n+" === 0) { "+this.appendToBuffer(n)+" }");this.environment.isSimple&&this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(n){this.lastContext!==n&&(this.lastContext=n)},lookupOnContext:function(n){this.push(this.nameLookup("depth"+this.lastContext,n,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(n){return"typeof "+n+" === functionType ? "+n+".apply(depth0) : "+n})},lookup:function(n){this.replaceStack(function(t){return t+" == null || "+t+" === false ? "+t+" : "+this.nameLookup(t,n,"context")})},lookupData:function(){this.push("data")},pushStringParam:function(n,t){this.pushStackLiteral("depth"+this.lastContext);this.pushString(t);typeof n=="string"?this.pushString(n):this.pushStackLiteral(n)},emptyHash:function(){this.pushStackLiteral("{}");this.options.stringParams&&(this.register("hashTypes","{}"),this.register("hashContexts","{}"))},pushHash:function(){this.hash={values:[],types:[],contexts:[]}},popHash:function(){var n=this.hash;this.hash=t;this.options.stringParams&&(this.register("hashContexts","{"+n.contexts.join(",")+"}"),this.register("hashTypes","{"+n.types.join(",")+"}"));this.push("{\n    "+n.values.join(",\n    ")+"\n  }")},pushString:function(n){this.pushStackLiteral(this.quotedString(n))},push:function(n){return this.inlineStack.push(n),n},pushLiteral:function(n){this.pushStackLiteral(n)},pushProgram:function(n){n!=null?this.pushStackLiteral(this.programExpression(n)):this.pushStackLiteral(null)},invokeHelper:function(n,t){this.context.aliases.helperMissing="helpers.helperMissing";var i=this.lastHelper=this.setupHelper(n,t,!0),r=this.nameLookup("depth"+this.lastContext,t,"context");this.push(i.name+" || "+r);this.replaceStack(function(n){return n+" ? "+n+".call("+i.callParams+") : helperMissing.call("+i.helperMissingParams+")"})},invokeKnownHelper:function(n,t){var i=this.setupHelper(n,t);this.push(i.name+".call("+i.callParams+")")},invokeAmbiguous:function(n,t){this.context.aliases.functionType='"function"';this.pushStackLiteral("{}");var r=this.setupHelper(0,n,t),u=this.lastHelper=this.nameLookup("helpers",n,"helper"),f=this.nameLookup("depth"+this.lastContext,n,"context"),i=this.nextStack();this.source.push("if ("+i+" = "+u+") { "+i+" = "+i+".call("+r.callParams+"); }");this.source.push("else { "+i+" = "+f+"; "+i+" = typeof "+i+" === functionType ? "+i+".apply(depth0) : "+i+"; }")},invokePartial:function(n){var t=[this.nameLookup("partials",n,"partial"),"'"+n+"'",this.popStack(),"helpers","partials"];this.options.data&&t.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+t.join(", ")+")")},assignToHash:function(n){var u=this.popStack(),i,r,t;this.options.stringParams&&(r=this.popStack(),i=this.popStack());t=this.hash;i&&t.contexts.push("'"+n+"': "+i);r&&t.types.push("'"+n+"': "+r);t.values.push("'"+n+"': ("+u+")")},compiler:i,compileChildren:function(n,t){for(var i,f=n.children,r,e,u=0,o=f.length;u<o;u++)r=f[u],e=new this.compiler,i=this.matchExistingProgram(r),i==null?(this.context.programs.push(""),i=this.context.programs.length,r.index=i,r.name="program"+i,this.context.programs[i]=e.compile(r,t,this.context),this.context.environments[i]=r):(r.index=i,r.name="program"+i)},matchExistingProgram:function(n){for(var i,t=0,r=this.context.environments.length;t<r;t++)if(i=this.context.environments[t],i&&i.equals(n))return t},programExpression:function(n){var t,e;if(this.context.aliases.self="this",n==null)return"self.noop";var i=this.environment.children[n],r=i.depths.list,u,f=[i.index,i.name,"data"];for(t=0,e=r.length;t<e;t++)u=r[t],u===1?f.push("depth0"):f.push("depth"+(u-1));return(r.length===0?"self.program(":"self.programWithDepth(")+f.join(", ")+")"},register:function(n,t){this.useRegister(n);this.source.push(n+" = "+t+";")},useRegister:function(n){this.registers[n]||(this.registers[n]=!0,this.registers.list.push(n))},pushStackLiteral:function(n){return this.push(new u(n))},pushStack:function(n){this.flushInline();var t=this.incrStack();return n&&this.source.push(t+" = "+n+";"),this.compileStack.push(t),t},replaceStack:function(n){var r="",e=this.isInline(),t,i,o,f;return e?(i=this.popStack(!0),i instanceof u?t=i.value:(o=this.stackSlot?this.topStackName():this.incrStack(),r="("+this.push(o)+" = "+i+"),",t=this.topStack())):t=this.topStack(),f=n.call(this,t),e?((this.inlineStack.length||this.compileStack.length)&&this.popStack(),this.push("("+r+f+")")):(/^stack/.test(t)||(t=this.nextStack()),this.source.push(t+" = ("+r+f+");")),t},nextStack:function(){return this.pushStack()},incrStack:function(){return this.stackSlot++,this.stackSlot>this.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var i=this.inlineStack,n,r,t;if(i.length)for(this.inlineStack=[],n=0,r=i.length;n<r;n++)t=i[n],t instanceof u?this.compileStack.push(t):this.pushStack(t)},isInline:function(){return this.inlineStack.length},popStack:function(n){var i=this.isInline(),t=(i?this.inlineStack:this.compileStack).pop();return!n&&t instanceof u?t.value:(i||this.stackSlot--,t)},topStack:function(n){var i=this.isInline()?this.inlineStack:this.compileStack,t=i[i.length-1];return!n&&t instanceof u?t.value:t},quotedString:function(n){return'"'+n.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")+'"'},setupHelper:function(n,t,i){var r=[],u;return this.setupParams(n,r,i),u=this.nameLookup("helpers",t,"helper"),{params:r,name:u,callParams:["depth0"].concat(r).join(", "),helperMissingParams:i&&["depth0",this.quotedString(t)].concat(r).join(", ")}},setupParams:function(n,t,i){var r=[],o=[],s=[],h,u,f,e;for(r.push("hash:"+this.popStack()),u=this.popStack(),f=this.popStack(),(f||u)&&(f||(this.context.aliases.self="this",f="self.noop"),u||(this.context.aliases.self="this",u="self.noop"),r.push("inverse:"+u),r.push("fn:"+f)),e=0;e<n;e++)h=this.popStack(),t.push(h),this.options.stringParams&&(s.push(this.popStack()),o.push(this.popStack()));return this.options.stringParams&&(r.push("contexts:["+o.join(",")+"]"),r.push("types:["+s.join(",")+"]"),r.push("hashContexts:hashContexts"),r.push("hashTypes:hashTypes")),this.options.data&&r.push("data:data"),r="{"+r.join(",")+"}",i?(this.register("options",r),t.push("options")):t.push(r),t.join(", ")}},c="break else new var case finally return void catch for switch while continue function this with default if throw delete in try do instanceof typeof abstract enum int short boolean export interface static byte extends long super char final native synchronized class float package throws const goto private transient debugger implements protected volatile double import public let yield".split(" "),v=i.RESERVED_WORDS={},s=0,h=c.length;s<h;s++)v[c[s]]=!0;i.isValidJavaScriptVariableName=function(n){return!i.RESERVED_WORDS[n]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(n)?!0:!1};n.precompile=function(t,r){if(t==null||typeof t!="string"&&t.constructor!==n.AST.ProgramNode)throw new n.Exception("You must pass a string or Handlebars AST to Handlebars.precompile. You passed "+t);r=r||{};"data"in r||(r.data=!0);var u=n.parse(t),e=(new f).compile(u,r);return(new i).compile(e,r)};n.compile=function(r,u){function o(){var e=n.parse(r),o=(new f).compile(e,u),s=(new i).compile(o,u,t,!0);return n.template(s)}if(r==null||typeof r!="string"&&r.constructor!==n.AST.ProgramNode)throw new n.Exception("You must pass a string or Handlebars AST to Handlebars.compile. You passed "+r);u=u||{};"data"in u||(u.data=!0);var e;return function(n,t){return e||(e=o()),e.call(this,n,t)}};n.VM={template:function(t){var i={escapeExpression:n.Utils.escapeExpression,invokePartial:n.VM.invokePartial,programs:[],program:function(t,i,r){var u=this.programs[t];return r?u=n.VM.program(t,i,r):u||(u=this.programs[t]=n.VM.program(t,i)),u},merge:function(t,i){var r=t||i;return t&&i&&(r={},n.Utils.extend(r,i),n.Utils.extend(r,t)),r},programWithDepth:n.VM.programWithDepth,noop:n.VM.noop,compilerInfo:null};return function(r,u){var s,h;u=u||{};var c=t.call(i,n,r,u.helpers,u.partials,u.data),o=i.compilerInfo||[],f=o[0]||1,e=n.COMPILER_REVISION;if(f!==e)if(f<e){s=n.REVISION_CHANGES[e];h=n.REVISION_CHANGES[f];throw"Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version ("+s+") or downgrade your runtime to an older version ("+h+").";}else throw"Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version ("+o[1]+").";return c}},programWithDepth:function(n,t,i){var u=Array.prototype.slice.call(arguments,3),r=function(n,r){return r=r||{},t.apply(this,[n,r.data||i].concat(u))};return r.program=n,r.depth=u.length,r},program:function(n,t,i){var r=function(n,r){return r=r||{},t(n,r.data||i)};return r.program=n,r.depth=0,r},noop:function(){return""},invokePartial:function(i,r,u,f,e,o){var s={helpers:f,partials:e,data:o};if(i===t)throw new n.Exception("The partial "+r+" could not be found");else{if(i instanceof Function)return i(u,s);if(n.compile)return e[r]=n.compile(i,{data:o!==t}),e[r](u,s);throw new n.Exception("The partial "+r+" could not be compiled when running in runtime-only mode");}}};n.template=n.VM.template}(Handlebars),function(){function l(t,i,r){var s,f,e,o;if(t===i)return 0!==t||1/t==1/i;if(null==t||null==i)return t===i;if(t._chain&&(t=t._wrapped),i._chain&&(i=i._wrapped),t.isEqual&&n.isFunction(t.isEqual))return t.isEqual(i);if(i.isEqual&&n.isFunction(i.isEqual))return i.isEqual(t);if(s=u.call(t),s!=u.call(i))return!1;switch(s){case"[object String]":return t==""+i;case"[object Number]":return t!=+t?i!=+i:0==t?1/t==1/i:t==+i;case"[object Date]":case"[object Boolean]":return+t==+i;case"[object RegExp]":return t.source==i.source&&t.global==i.global&&t.multiline==i.multiline&&t.ignoreCase==i.ignoreCase}if("object"!=typeof t||"object"!=typeof i)return!1;for(f=r.length;f--;)if(r[f]==t)return!0;if(r.push(t),f=0,e=!0,"[object Array]"==s){if(f=t.length,e=f==i.length)for(;f--&&(e=f in t==f in i&&l(t[f],i[f],r)););}else{if("constructor"in t!="constructor"in i||t.constructor!=i.constructor)return!1;for(o in t)if(n.has(t,o)&&(f++,!(e=n.has(i,o)&&l(t[o],i[o],r))))break;if(e){for(o in i)if(n.has(i,o)&&!f--)break;e=!f}}return r.pop(),e}var a=this,st=a._,o={},r=Array.prototype,v=Object.prototype,t=r.slice,ht=r.unshift,u=v.toString,ct=v.hasOwnProperty,d=r.forEach,g=r.map,nt=r.reduce,tt=r.reduceRight,it=r.filter,rt=r.every,ut=r.some,s=r.indexOf,ft=r.lastIndexOf,v=Array.isArray,lt=Object.keys,y=Function.prototype.bind,n=function(n){return new f(n)},i,p,w,et,h,e,b,f,c,ot;"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=n),exports._=n):a._=n;n.VERSION="1.3.3";i=n.each=n.forEach=function(t,i,r){if(t!=null)if(d&&t.forEach===d)t.forEach(i,r);else if(t.length===+t.length){for(var u=0,f=t.length;u<f;u++)if(u in t&&i.call(r,t[u],u,t)===o)break}else for(u in t)if(n.has(t,u)&&i.call(r,t[u],u,t)===o)break};n.map=n.collect=function(n,t,r){var u=[];return n==null?u:g&&n.map===g?n.map(t,r):(i(n,function(n,i,f){u[u.length]=t.call(r,n,i,f)}),n.length===+n.length&&(u.length=n.length),u)};n.reduce=n.foldl=n.inject=function(t,r,u,f){var e=arguments.length>2;if(t==null&&(t=[]),nt&&t.reduce===nt)return f&&(r=n.bind(r,f)),e?t.reduce(r,u):t.reduce(r);if(i(t,function(n,t,i){e?u=r.call(f,u,n,t,i):(u=n,e=!0)}),!e)throw new TypeError("Reduce of empty array with no initial value");return u};n.reduceRight=n.foldr=function(t,i,r,u){var f=arguments.length>2,e;return(t==null&&(t=[]),tt&&t.reduceRight===tt)?(u&&(i=n.bind(i,u)),f?t.reduceRight(i,r):t.reduceRight(i)):(e=n.toArray(t).reverse(),u&&!f&&(i=n.bind(i,u)),f?n.reduce(e,i,r,u):n.reduce(e,i))};n.find=n.detect=function(n,t,i){var r;return p(n,function(n,u,f){if(t.call(i,n,u,f))return r=n,!0}),r};n.filter=n.select=function(n,t,r){var u=[];return n==null?u:it&&n.filter===it?n.filter(t,r):(i(n,function(n,i,f){t.call(r,n,i,f)&&(u[u.length]=n)}),u)};n.reject=function(n,t,r){var u=[];return n==null?u:(i(n,function(n,i,f){t.call(r,n,i,f)||(u[u.length]=n)}),u)};n.every=n.all=function(n,t,r){var u=!0;return n==null?u:rt&&n.every===rt?n.every(t,r):(i(n,function(n,i,f){if(!(u=u&&t.call(r,n,i,f)))return o}),!!u)};p=n.some=n.any=function(t,r,u){r||(r=n.identity);var f=!1;return t==null?f:ut&&t.some===ut?t.some(r,u):(i(t,function(n,t,i){if(f||(f=r.call(u,n,t,i)))return o}),!!f)};n.include=n.contains=function(n,t){return n==null?!1:s&&n.indexOf===s?n.indexOf(t)!=-1:p(n,function(n){return n===t})};n.invoke=function(i,r){var u=t.call(arguments,2);return n.map(i,function(t){return(n.isFunction(r)?r||t:t[r]).apply(t,u)})};n.pluck=function(t,i){return n.map(t,function(n){return n[i]})};n.max=function(t,r,u){if(!r&&n.isArray(t)&&t[0]===+t[0])return Math.max.apply(Math,t);if(!r&&n.isEmpty(t))return-Infinity;var f={computed:-Infinity};return i(t,function(n,t,i){t=r?r.call(u,n,t,i):n;t>=f.computed&&(f={value:n,computed:t})}),f.value};n.min=function(t,r,u){if(!r&&n.isArray(t)&&t[0]===+t[0])return Math.min.apply(Math,t);if(!r&&n.isEmpty(t))return Infinity;var f={computed:Infinity};return i(t,function(n,t,i){t=r?r.call(u,n,t,i):n;t<f.computed&&(f={value:n,computed:t})}),f.value};n.shuffle=function(n){var t=[],r;return i(n,function(n,i){r=Math.floor(Math.random()*(i+1));t[i]=t[r];t[r]=n}),t};n.sortBy=function(t,i,r){var u=n.isFunction(i)?i:function(n){return n[i]};return n.pluck(n.map(t,function(n,t,i){return{value:n,criteria:u.call(r,n,t,i)}}).sort(function(n,t){var i=n.criteria,r=t.criteria;return i===void 0?1:r===void 0?-1:i<r?-1:i>r?1:0}),"value")};n.groupBy=function(t,r){var u={},f=n.isFunction(r)?r:function(n){return n[r]};return i(t,function(n,t){var i=f(n,t);(u[i]||(u[i]=[])).push(n)}),u};n.sortedIndex=function(t,i,r){var u,f,e;for(r||(r=n.identity),u=0,f=t.length;u<f;)e=u+f>>1,r(t[e])<r(i)?u=e+1:f=e;return u};n.toArray=function(i){return i?n.isArray(i)||n.isArguments(i)?t.call(i):i.toArray&&n.isFunction(i.toArray)?i.toArray():n.values(i):[]};n.size=function(t){return n.isArray(t)?t.length:n.keys(t).length};n.first=n.head=n.take=function(n,i,r){return i!=null&&!r?t.call(n,0,i):n[0]};n.initial=function(n,i,r){return t.call(n,0,n.length-(i==null||r?1:i))};n.last=function(n,i,r){return i!=null&&!r?t.call(n,Math.max(n.length-i,0)):n[n.length-1]};n.rest=n.tail=function(n,i,r){return t.call(n,i==null||r?1:i)};n.compact=function(t){return n.filter(t,function(n){return!!n})};n.flatten=function(t,i){return n.reduce(t,function(t,r){return n.isArray(r)?t.concat(i?r:n.flatten(r)):(t[t.length]=r,t)},[])};n.without=function(i){return n.difference(i,t.call(arguments,1))};n.uniq=n.unique=function(t,i,r){var r=r?n.map(t,r):t,u=[];return t.length<3&&(i=!0),n.reduce(r,function(r,f,e){return(i?n.last(r)===f&&r.length:n.include(r,f))||(r.push(f),u.push(t[e])),r},[]),u};n.union=function(){return n.uniq(n.flatten(arguments,!0))};n.intersection=n.intersect=function(i){var r=t.call(arguments,1);return n.filter(n.uniq(i),function(t){return n.every(r,function(i){return n.indexOf(i,t)>=0})})};n.difference=function(i){var r=n.flatten(t.call(arguments,1),!0);return n.filter(i,function(t){return!n.include(r,t)})};n.zip=function(){for(var r=t.call(arguments),u=n.max(n.pluck(r,"length")),f=Array(u),i=0;i<u;i++)f[i]=n.pluck(r,""+i);return f};n.indexOf=function(t,i,r){if(t==null)return-1;var u;if(r)return r=n.sortedIndex(t,i),t[r]===i?r:-1;if(s&&t.indexOf===s)return t.indexOf(i);for(r=0,u=t.length;r<u;r++)if(r in t&&t[r]===i)return r;return-1};n.lastIndexOf=function(n,t){if(n==null)return-1;if(ft&&n.lastIndexOf===ft)return n.lastIndexOf(t);for(var i=n.length;i--;)if(i in n&&n[i]===t)return i;return-1};n.range=function(n,t,i){arguments.length<=1&&(t=n||0,n=0);for(var i=arguments[2]||1,r=Math.max(Math.ceil((t-n)/i),0),u=0,f=Array(r);u<r;)f[u++]=n,n=n+i;return f};w=function(){};n.bind=function(i,r){var f,u;if(i.bind===y&&y)return y.apply(i,t.call(arguments,1));if(!n.isFunction(i))throw new TypeError;return u=t.call(arguments,2),f=function(){if(!(this instanceof f))return i.apply(r,u.concat(t.call(arguments)));w.prototype=i.prototype;var e=new w,n=i.apply(e,u.concat(t.call(arguments)));return Object(n)===n?n:e}};n.bindAll=function(r){var u=t.call(arguments,1);return u.length==0&&(u=n.functions(r)),i(u,function(t){r[t]=n.bind(r[t],r)}),r};n.memoize=function(t,i){var r={};return i||(i=n.identity),function(){var u=i.apply(this,arguments);return n.has(r,u)?r[u]:r[u]=t.apply(this,arguments)}};n.delay=function(n,i){var r=t.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},i)};n.defer=function(i){return n.delay.apply(n,[i,1].concat(t.call(arguments,1)))};n.throttle=function(t,i){var r,u,f,e,o,s,h=n.debounce(function(){o=e=!1},i);return function(){return r=this,u=arguments,f||(f=setTimeout(function(){f=null;o&&t.apply(r,u);h()},i)),e?o=!0:s=t.apply(r,u),h(),e=!0,s}};n.debounce=function(n,t,i){var r;return function(){var u=this,f=arguments;i&&!r&&n.apply(u,f);clearTimeout(r);r=setTimeout(function(){r=null;i||n.apply(u,f)},t)}};n.once=function(n){var t=!1,i;return function(){return t?i:(t=!0,i=n.apply(this,arguments))}};n.wrap=function(n,i){return function(){var r=[n].concat(t.call(arguments,0));return i.apply(this,r)}};n.compose=function(){var n=arguments;return function(){for(var t=arguments,i=n.length-1;i>=0;i--)t=[n[i].apply(this,t)];return t[0]}};n.after=function(n,t){return n<=0?t():function(){if(--n<1)return t.apply(this,arguments)}};n.keys=lt||function(t){if(t!==Object(t))throw new TypeError("Invalid object");var i=[];for(var r in t)n.has(t,r)&&(i[i.length]=r);return i};n.values=function(t){return n.map(t,n.identity)};n.functions=n.methods=function(t){var i=[];for(var r in t)n.isFunction(t[r])&&i.push(r);return i.sort()};n.extend=function(n){return i(t.call(arguments,1),function(t){for(var i in t)n[i]=t[i]}),n};n.pick=function(r){var u={};return i(n.flatten(t.call(arguments,1)),function(n){n in r&&(u[n]=r[n])}),u};n.defaults=function(n){return i(t.call(arguments,1),function(t){for(var i in t)n[i]==null&&(n[i]=t[i])}),n};n.clone=function(t){return n.isObject(t)?n.isArray(t)?t.slice():n.extend({},t):t};n.tap=function(n,t){return t(n),n};n.isEqual=function(n,t){return l(n,t,[])};n.isEmpty=function(t){if(t==null)return!0;if(n.isArray(t)||n.isString(t))return t.length===0;for(var i in t)if(n.has(t,i))return!1;return!0};n.isElement=function(n){return!!(n&&n.nodeType==1)};n.isArray=v||function(n){return u.call(n)=="[object Array]"};n.isObject=function(n){return n===Object(n)};n.isArguments=function(n){return u.call(n)=="[object Arguments]"};n.isArguments(arguments)||(n.isArguments=function(t){return!(!t||!n.has(t,"callee"))});n.isFunction=function(n){return u.call(n)=="[object Function]"};n.isString=function(n){return u.call(n)=="[object String]"};n.isNumber=function(n){return u.call(n)=="[object Number]"};n.isFinite=function(t){return n.isNumber(t)&&isFinite(t)};n.isNaN=function(n){return n!==n};n.isBoolean=function(n){return n===!0||n===!1||u.call(n)=="[object Boolean]"};n.isDate=function(n){return u.call(n)=="[object Date]"};n.isRegExp=function(n){return u.call(n)=="[object RegExp]"};n.isNull=function(n){return n===null};n.isUndefined=function(n){return n===void 0};n.has=function(n,t){return ct.call(n,t)};n.noConflict=function(){return a._=st,this};n.identity=function(n){return n};n.times=function(n,t,i){for(var r=0;r<n;r++)t.call(i,r)};n.escape=function(n){return(""+n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")};n.result=function(t,i){if(t==null)return null;var r=t[i];return n.isFunction(r)?r.call(t):r};n.mixin=function(t){i(n.functions(t),function(i){ot(i,n[i]=t[i])})};et=0;n.uniqueId=function(n){var t=et++;return n?n+t:t};n.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};h=/.^/;e={"\\":"\\","'":"'",r:"\r",n:"\n",t:"\t",u2028:"\u2028",u2029:"\u2029"};for(b in e)e[e[b]]=b;var at=/\\|'|\r|\n|\t|\u2028|\u2029/g,vt=/\\(\\|'|r|n|t|u2028|u2029)/g,k=function(n){return n.replace(vt,function(n,t){return e[t]})};n.template=function(t,i,r){r=n.defaults(r||{},n.templateSettings);t="__p+='"+t.replace(at,function(n){return"\\"+e[n]}).replace(r.escape||h,function(n,t){return"'+\n_.escape("+k(t)+")+\n'"}).replace(r.interpolate||h,function(n,t){return"'+\n("+k(t)+")+\n'"}).replace(r.evaluate||h,function(n,t){return"';\n"+k(t)+"\n;__p+='"})+"';\n";r.variable||(t="with(obj||{}){\n"+t+"}\n");var t="var __p='';var print=function(){__p+=Array.prototype.join.call(arguments, '')};\n"+t+"return __p;\n",u=new Function(r.variable||"obj","_",t);return i?u(i,n):(i=function(t){return u.call(this,t,n)},i.source="function("+(r.variable||"obj")+"){\n"+t+"}",i)};n.chain=function(t){return n(t).chain()};f=function(n){this._wrapped=n};n.prototype=f.prototype;c=function(t,i){return i?n(t).chain():t};ot=function(i,r){f.prototype[i]=function(){var i=t.call(arguments);return ht.call(i,this._wrapped),c(r.apply(n,i),this._chain)}};n.mixin(n);i("pop,push,reverse,shift,sort,splice,unshift".split(","),function(n){var t=r[n];f.prototype[n]=function(){var i=this._wrapped,r;return t.apply(i,arguments),r=i.length,(n=="shift"||n=="splice")&&r===0&&delete i[0],c(i,this._chain)}});i(["concat","join","slice"],function(n){var t=r[n];f.prototype[n]=function(){return c(t.apply(this._wrapped,arguments),this._chain)}});f.prototype.chain=function(){return this._chain=!0,this};f.prototype.value=function(){return this._wrapped}}.call(this),function(){var u=this,b=u.Backbone,k=Array.prototype.slice,d=Array.prototype.splice,t,n,i,s,r,e,h,y;t="undefined"!=typeof exports?exports:u.Backbone={};t.VERSION="0.9.2";n=u._;n||"undefined"==typeof require||(n=require("underscore"));i=u.jQuery||u.Zepto||u.ender;t.setDomLibrary=function(n){i=n};t.noConflict=function(){return u.Backbone=b,this};t.emulateHTTP=!1;t.emulateJSON=!1;s=/\s+/;r=t.Events={on:function(n,t,i){var f,e,r,o,u;if(!t)return this;for(n=n.split(s),f=this._callbacks||(this._callbacks={});e=n.shift();)r=(u=f[e])?u.tail:{},r.next=o={},r.context=i,r.callback=t,f[e]={tail:o,next:u?u.next:r};return this},off:function(t,i,r){var f,e,u,c,o,h;if(e=this._callbacks){if(!t&&!i&&!r)return delete this._callbacks,this;for(t=t?t.split(s):n.keys(e);f=t.shift();)if(u=e[f],delete e[f],u&&(i||r))for(c=u.tail;(u=u.next)!==c;)if(o=u.callback,h=u.context,i&&o!==i||r&&h!==r)this.on(f,o,h);return this}},trigger:function(n){var i,t,u,r,e,f;if(!(u=this._callbacks))return this;for(e=u.all,n=n.split(s),f=k.call(arguments,1);i=n.shift();){if(t=u[i])for(r=t.tail;(t=t.next)!==r;)t.callback.apply(t.context||this,f);if(t=e)for(r=t.tail,i=[i].concat(f);(t=t.next)!==r;)t.callback.apply(t.context||this,i)}return this}};r.bind=r.on;r.unbind=r.off;e=t.Model=function(t,i){var r;t||(t={});i&&i.parse&&(t=this.parse(t));(r=o(this,"defaults"))&&(t=n.extend({},r,t));i&&i.collection&&(this.collection=i.collection);this.attributes={};this._escapedAttributes={};this.cid=n.uniqueId("c");this.changed={};this._silent={};this._pending={};this.set(t,{silent:!0});this.changed={};this._silent={};this._pending={};this._previousAttributes=n.clone(this.attributes);this.initialize.apply(this,arguments)};n.extend(e.prototype,r,{changed:null,_silent:null,_pending:null,idAttribute:"id",initialize:function(){},toJSON:function(){return n.clone(this.attributes)},get:function(n){return this.attributes[n]},escape:function(t){var i;return(i=this._escapedAttributes[t])?i:(i=this.get(t),this._escapedAttributes[t]=n.escape(null==i?"":""+i))},has:function(n){return null!=this.get(n)},set:function(t,i,r){var f,u;if(n.isObject(t)||null==t?(f=t,r=i):(f={},f[t]=i),r||(r={}),!f)return this;if(f instanceof e&&(f=f.attributes),r.unset)for(u in f)f[u]=void 0;if(!this._validate(f,r))return!1;this.idAttribute in f&&(this.id=f[this.idAttribute]);var i=r.changes={},o=this.attributes,h=this._escapedAttributes,s=this._previousAttributes||{};for(u in f)t=f[u],(!n.isEqual(o[u],t)||r.unset&&n.has(o,u))&&(delete h[u],(r.silent?this._silent:i)[u]=!0),r.unset?delete o[u]:o[u]=t,!n.isEqual(s[u],t)||n.has(o,u)!=n.has(s,u)?(this.changed[u]=t,r.silent||(this._pending[u]=!0)):(delete this.changed[u],delete this._pending[u]);return r.silent||this.change(r),this},unset:function(n,t){return(t||(t={})).unset=!0,this.set(n,null,t)},clear:function(t){return(t||(t={})).unset=!0,this.set(n.clone(this.attributes),t)},fetch:function(i){var i=i?n.clone(i):{},r=this,u=i.success;return i.success=function(n,t,f){if(!r.set(r.parse(n,f),i))return!1;u&&u(r,n)},i.error=t.wrapError(i.error,r,i),(this.sync||t.sync).call(this,"read",this,i)},save:function(i,r,u){var f,s,e,o;if(n.isObject(i)||null==i?(f=i,u=r):(f={},f[i]=r),u=u?n.clone(u):{},u.wait){if(!this._validate(f,u))return!1;s=n.clone(this.attributes)}return(i=n.extend({},u,{silent:!0}),f&&!this.set(f,u.wait?i:u))?!1:(e=this,o=u.success,u.success=function(t,i,r){if(i=e.parse(t,r),u.wait&&(delete u.wait,i=n.extend(f||{},i)),!e.set(i,u))return!1;o?o(e,t):e.trigger("sync",e,t,u)},u.error=t.wrapError(u.error,e,u),r=this.isNew()?"create":"update",r=(this.sync||t.sync).call(this,r,this,u),u.wait&&this.set(s,i),r)},destroy:function(i){var i=i?n.clone(i):{},r=this,f=i.success,u=function(){r.trigger("destroy",r,r.collection,i)},e;return this.isNew()?(u(),!1):(i.success=function(n){i.wait&&u();f?f(r,n):r.trigger("sync",r,n,i)},i.error=t.wrapError(i.error,r,i),e=(this.sync||t.sync).call(this,"delete",this,i),i.wait||u(),e)},url:function(){var n=o(this,"urlRoot")||o(this.collection,"url")||w();return this.isNew()?n:n+("/"==n.charAt(n.length-1)?"":"/")+encodeURIComponent(this.id)},parse:function(n){return n},clone:function(){return new this.constructor(this.attributes)},isNew:function(){return null==this.id},change:function(t){var r,i,u;t||(t={});r=this._changing;this._changing=!0;for(i in this._silent)this._pending[i]=!0;u=n.extend({},t.changes,this._silent);this._silent={};for(i in u)this.trigger("change:"+i,this,this.get(i),t);if(r)return this;for(;!n.isEmpty(this._pending);){this._pending={};this.trigger("change",this,t);for(i in this.changed)this._pending[i]||this._silent[i]||delete this.changed[i];this._previousAttributes=n.clone(this.attributes)}return this._changing=!1,this},hasChanged:function(t){return arguments.length?n.has(this.changed,t):!n.isEmpty(this.changed)},changedAttributes:function(t){if(!t)return this.hasChanged()?n.clone(this.changed):!1;var u,i=!1,f=this._previousAttributes;for(var r in t)n.isEqual(f[r],u=t[r])||((i||(i={}))[r]=u);return i},previous:function(n){return!arguments.length||!this._previousAttributes?null:this._previousAttributes[n]},previousAttributes:function(){return n.clone(this._previousAttributes)},isValid:function(){return!this.validate(this.attributes)},_validate:function(t,i){if(i.silent||!this.validate)return!0;var t=n.extend({},this.attributes,t),r=this.validate(t,i);return r?(i&&i.error?i.error(this,r,i):this.trigger("error",this,r,i),!1):!0}});h=t.Collection=function(n,t){t||(t={});t.model&&(this.model=t.model);t.comparator&&(this.comparator=t.comparator);this._reset();this.initialize.apply(this,arguments);n&&this.reset(n,{silent:!0,parse:t.parse})};n.extend(h.prototype,r,{model:e,initialize:function(){},toJSON:function(n){return this.map(function(t){return t.toJSON(n)})},add:function(t,i){var r,f,u,o,e,s={},c={},h=[];for(i||(i={}),t=n.isArray(t)?t.slice():[t],r=0,f=t.length;r<f;r++){if(!(u=t[r]=this._prepareModel(t[r],i)))throw Error("Can't add an invalid model to a collection");o=u.cid;e=u.id;s[o]||this._byCid[o]||null!=e&&(c[e]||this._byId[e])?h.push(r):s[o]=c[e]=u}for(r=h.length;r--;)t.splice(h[r],1);for(r=0,f=t.length;r<f;r++)(u=t[r]).on("all",this._onModelEvent,this),this._byCid[u.cid]=u,null!=u.id&&(this._byId[u.id]=u);if(this.length+=f,d.apply(this.models,[null!=i.at?i.at:this.models.length,0].concat(t)),this.comparator&&this.sort({silent:!0}),i.silent)return this;for(r=0,f=this.models.length;r<f;r++)s[(u=this.models[r]).cid]&&(i.index=r,u.trigger("add",u,this,i));return this},remove:function(t,i){var u,e,f,r;for(i||(i={}),t=n.isArray(t)?t.slice():[t],u=0,e=t.length;u<e;u++)(r=this.getByCid(t[u])||this.get(t[u]))&&(delete this._byId[r.id],delete this._byCid[r.cid],f=this.indexOf(r),this.models.splice(f,1),this.length--,i.silent||(i.index=f,r.trigger("remove",r,this,i)),this._removeReference(r));return this},push:function(n,t){return n=this._prepareModel(n,t),this.add(n,t),n},pop:function(n){var t=this.at(this.length-1);return this.remove(t,n),t},unshift:function(t,i){return t=this._prepareModel(t,i),this.add(t,n.extend({at:0},i)),t},shift:function(n){var t=this.at(0);return this.remove(t,n),t},get:function(n){if(null!=n)return this._byId[null!=n.id?n.id:n]},getByCid:function(n){return n&&this._byCid[n.cid||n]},at:function(n){return this.models[n]},where:function(t){return n.isEmpty(t)?[]:this.filter(function(n){for(var i in t)if(t[i]!==n.get(i))return!1;return!0})},sort:function(t){if(t||(t={}),!this.comparator)throw Error("Cannot sort a set without a comparator");var i=n.bind(this.comparator,this);return 1==this.comparator.length?this.models=this.sortBy(i):this.models.sort(i),t.silent||this.trigger("reset",this,t),this},pluck:function(t){return n.map(this.models,function(n){return n.get(t)})},reset:function(t,i){t||(t=[]);i||(i={});for(var r=0,u=this.models.length;r<u;r++)this._removeReference(this.models[r]);return this._reset(),this.add(t,n.extend({silent:!0},i)),i.silent||this.trigger("reset",this,i),this},fetch:function(i){i=i?n.clone(i):{};void 0===i.parse&&(i.parse=!0);var r=this,u=i.success;return i.success=function(n,t,f){r[i.add?"add":"reset"](r.parse(n,f),i);u&&u(r,n)},i.error=t.wrapError(i.error,r,i),(this.sync||t.sync).call(this,"read",this,i)},create:function(t,i){var u=this,i=i?n.clone(i):{},t=this._prepareModel(t,i),r;return t?(i.wait||u.add(t,i),r=i.success,i.success=function(n,f){i.wait&&u.add(n,i);r?r(n,f):n.trigger("sync",t,f,i)},t.save(null,i),t):!1},parse:function(n){return n},chain:function(){return n(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId={};this._byCid={}},_prepareModel:function(n,t){return t||(t={}),n instanceof e?n.collection||(n.collection=this):(t.collection=this,n=new this.model(n,t),n._validate(n.attributes,t)||(n=!1)),n},_removeReference:function(n){this==n.collection&&delete n.collection;n.off("all",this._onModelEvent,this)},_onModelEvent:function(n,t,i,r){("add"==n||"remove"==n)&&i!=this||("destroy"==n&&this.remove(t,r),t&&n==="change:"+t.idAttribute&&(delete this._byId[t.previous(t.idAttribute)],this._byId[t.id]=t),this.trigger.apply(this,arguments))}});n.each("forEach,each,map,reduce,reduceRight,find,detect,filter,select,reject,every,all,some,any,include,contains,invoke,max,min,sortBy,sortedIndex,toArray,size,first,initial,rest,last,without,indexOf,shuffle,lastIndexOf,isEmpty,groupBy".split(","),function(t){h.prototype[t]=function(){return n[t].apply(n,[this.models].concat(n.toArray(arguments)))}});var l=t.Router=function(n){n||(n={});n.routes&&(this.routes=n.routes);this._bindRoutes();this.initialize.apply(this,arguments)},g=/:\w+/g,nt=/\*\w+/g,tt=/[-[\]{}()+?.,\\^$|#\s]/g;n.extend(l.prototype,r,{initialize:function(){},route:function(i,r,u){return t.history||(t.history=new f),n.isRegExp(i)||(i=this._routeToRegExp(i)),u||(u=this[r]),t.history.route(i,n.bind(function(n){n=this._extractParameters(i,n);u&&u.apply(this,n);this.trigger.apply(this,["route:"+r].concat(n));t.history.trigger("route",this,r,n)},this)),this},navigate:function(n,i){t.history.navigate(n,i)},_bindRoutes:function(){var t,n,i;if(this.routes){t=[];for(n in this.routes)t.unshift([n,this.routes[n]]);for(n=0,i=t.length;n<i;n++)this.route(t[n][0],t[n][1],this[t[n][1]])}},_routeToRegExp:function(n){return n=n.replace(tt,"\\$&").replace(g,"([^/]+)").replace(nt,"(.*?)"),RegExp("^"+n+"$")},_extractParameters:function(n,t){return n.exec(t).slice(1)}});var f=t.History=function(){this.handlers=[];n.bindAll(this,"checkUrl")},c=/^[#\/]/,it=/msie [\w.]+/;f.started=!1;n.extend(f.prototype,r,{interval:50,getHash:function(n){return(n=(n?n.location:window.location).href.match(/#(.*)$/))?n[1]:""},getFragment:function(n,t){if(null==n)if(this._hasPushState||t){var n=window.location.pathname,i=window.location.search;i&&(n+=i)}else n=this.getHash();return n.indexOf(this.options.root)||(n=n.substr(this.options.root.length)),n.replace(c,"")},start:function(t){if(f.started)throw Error("Backbone.history has already been started");f.started=!0;this.options=n.extend({},{root:"/"},this.options,t);this._wantsHashChange=!1!==this.options.hashChange;this._wantsPushState=!!this.options.pushState;this._hasPushState=!(!this.options.pushState||!window.history||!window.history.pushState);var t=this.getFragment(),r=document.documentMode;return((r=it.exec(navigator.userAgent.toLowerCase())&&(!r||7>=r))&&(this.iframe=i('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(t)),this._hasPushState?i(window).bind("popstate",this.checkUrl):this._wantsHashChange&&"onhashchange"in window&&!r?i(window).bind("hashchange",this.checkUrl):this._wantsHashChange&&(this._checkUrlInterval=setInterval(this.checkUrl,this.interval)),this.fragment=t,t=window.location,r=t.pathname==this.options.root,this._wantsHashChange&&this._wantsPushState&&!this._hasPushState&&!r)?(this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0):(this._wantsPushState&&this._hasPushState&&r&&t.hash&&(this.fragment=this.getHash().replace(c,""),window.history.replaceState({},document.title,t.protocol+"//"+t.host+this.options.root+this.fragment)),this.options.silent?void 0:this.loadUrl())},stop:function(){i(window).unbind("popstate",this.checkUrl).unbind("hashchange",this.checkUrl);clearInterval(this._checkUrlInterval);f.started=!1},route:function(n,t){this.handlers.unshift({route:n,callback:t})},checkUrl:function(){var n=this.getFragment();if(n==this.fragment&&this.iframe&&(n=this.getFragment(this.getHash(this.iframe))),n==this.fragment)return!1;this.iframe&&this.navigate(n);this.loadUrl()||this.loadUrl(this.getHash())},loadUrl:function(t){var i=this.fragment=this.getFragment(t);return n.any(this.handlers,function(n){if(n.route.test(i))return n.callback(i),!0})},navigate:function(n,t){if(!f.started)return!1;t&&!0!==t||(t={trigger:t});var i=(n||"").replace(c,"");this.fragment!=i&&(this._hasPushState?(0!=i.indexOf(this.options.root)&&(i=this.options.root+i),this.fragment=i,window.history[t.replace?"replaceState":"pushState"]({},document.title,i)):this._wantsHashChange?(this.fragment=i,this._updateHash(window.location,i,t.replace),this.iframe&&i!=this.getFragment(this.getHash(this.iframe))&&(t.replace||this.iframe.document.open().close(),this._updateHash(this.iframe.location,i,t.replace))):window.location.assign(this.options.root+n),t.trigger&&this.loadUrl(n))},_updateHash:function(n,t,i){i?n.replace(n.toString().replace(/(javascript:|#).*$/,"")+"#"+t):n.hash=t}});var a=t.View=function(t){this.cid=n.uniqueId("view");this._configure(t||{});this._ensureElement();this.initialize.apply(this,arguments);this.delegateEvents()},rt=/^(\S+)\s*(.*)$/,v="model,collection,el,id,attributes,className,tagName".split(",");n.extend(a.prototype,r,{tagName:"div",$:function(n){return this.$el.find(n)},initialize:function(){},render:function(){return this},remove:function(){return this.$el.remove(),this},make:function(n,t,r){return n=document.createElement(n),t&&i(n).attr(t),r&&i(n).html(r),n},setElement:function(n,t){return this.$el&&this.undelegateEvents(),this.$el=n instanceof i?n:i(n),this.el=this.$el[0],!1!==t&&this.delegateEvents(),this},delegateEvents:function(t){var r,i;if(t||(t=o(this,"events"))){this.undelegateEvents();for(r in t){if(i=t[r],n.isFunction(i)||(i=this[t[r]]),!i)throw Error('Method "'+t[r]+'" does not exist');var u=r.match(rt),f=u[1],u=u[2],i=n.bind(i,this),f=f+(".delegateEvents"+this.cid);""===u?this.$el.bind(f,i):this.$el.delegate(u,f,i)}}},undelegateEvents:function(){this.$el.unbind(".delegateEvents"+this.cid)},_configure:function(t){var i,u,r;for(this.options&&(t=n.extend({},this.options,t)),i=0,u=v.length;i<u;i++)r=v[i],t[r]&&(this[r]=t[r]);this.options=t},_ensureElement:function(){if(this.el)this.setElement(this.el,!1);else{var n=o(this,"attributes")||{};this.id&&(n.id=this.id);this.className&&(n["class"]=this.className);this.setElement(this.make(this.tagName,n),!1)}}});e.extend=h.extend=l.extend=a.extend=function(n,t){var i=ut(this,n,t);return i.extend=this.extend,i};y={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};t.sync=function(r,u,f){var s=y[r],e;return f||(f={}),e={type:s,dataType:"json"},f.url||(e.url=o(u,"url")||w()),!f.data&&u&&("create"==r||"update"==r)&&(e.contentType="application/json",e.data=JSON.stringify(u.toJSON())),t.emulateJSON&&(e.contentType="application/x-www-form-urlencoded",e.data=e.data?{model:e.data}:{}),t.emulateHTTP&&("PUT"===s||"DELETE"===s)&&(t.emulateJSON&&(e.data._method=s),e.type="POST",e.beforeSend=function(n){n.setRequestHeader("X-HTTP-Method-Override",s)}),"GET"===e.type||t.emulateJSON||(e.processData=!1),i.ajax(n.extend(e,f))};t.wrapError=function(n,t,i){return function(r,u){u=r===t?u:r;n?n(t,u,i):t.trigger("error",t,u,i)}};var p=function(){},ut=function(t,i,r){var u;return u=i&&i.hasOwnProperty("constructor")?i.constructor:function(){t.apply(this,arguments)},n.extend(u,t),p.prototype=t.prototype,u.prototype=new p,i&&n.extend(u.prototype,i),r&&n.extend(u,r),u.prototype.constructor=u,u.__super__=t.prototype,u},o=function(t,i){return!t||!t[i]?null:n.isFunction(t[i])?t[i]():t[i]},w=function(){throw Error('A "url" property or function must be specified');}}.call(this),function(){var f,e,o,s,t,h,i,r,u,n,c=function(n,t){return function(){return n.apply(t,arguments)}};o=function(){function i(n,t){t==null&&(t={});n?n.url?t=n:this.url=n:t=n;t.url!=null&&(this.url=t.url);t.success!=null&&(this.success=t.success);this.failure=t.failure!=null?t.failure:function(){};this.progress=t.progress!=null?t.progress:function(){};t.success!=null&&this.build()}return i.prototype.url="http://api.wordnik.com/v4/resources.json",i.prototype.debug=!1,i.prototype.basePath=null,i.prototype.authorizations=null,i.prototype.authorizationScheme=null,i.prototype.info=null,i.prototype.build=function(){var i,r,n=this;return this.progress("fetching resource list: "+this.url),r={url:this.url,method:"get",headers:{},on:{error:function(t){return n.url.substring(0,4)!=="http"?n.fail("Please specify the protocol for "+n.url):t.status===0?n.fail("Can't read from server.  It may not have the appropriate access-control-origin settings."):t.status===404?n.fail("Can't read swagger JSON from "+n.url):n.fail(t.status+" : "+t.statusText+" "+n.url)},response:function(t){var i;return i=JSON.parse(t.content.data),n.swaggerVersion=i.swaggerVersion,n.swaggerVersion==="1.2"?n.buildFromSpec(i):n.buildFrom1_1Spec(i)}}},i={},i=typeof window!="undefined"?window:exports,i.authorizations.apply(r),(new t).execute(r),this},i.prototype.buildFromSpec=function(t){var e,o,l,w,i,a,r,u,f,v,y,p,s,h,c;for(t.apiVersion!=null&&(this.apiVersion=t.apiVersion),this.apis={},this.apisArray=[],this.produces=t.produces,this.authSchemes=t.authorizations,t.info!=null&&(this.info=t.info),o=!1,s=t.apis,r=0,v=s.length;r<v;r++)if(e=s[r],e.operations)for(h=e.operations,u=0,y=h.length;u<y;u++)w=h[u],o=!0;if(this.basePath=t.basePath?t.basePath:this.url.indexOf("?")>0?this.url.substring(0,this.url.lastIndexOf("?")):this.url,o)l=t.resourcePath.replace(/\//g,""),this.resourcePath=t.resourcePath,i=new n(t,this),this.apis[l]=i,this.apisArray.push(i);else for(c=t.apis,f=0,p=c.length;f<p;f++)a=c[f],i=new n(a,this),this.apis[i.name]=i,this.apisArray.push(i);return this.success&&this.success(),this},i.prototype.buildFrom1_1Spec=function(t){var e,o,l,w,i,a,r,u,f,v,y,p,s,h,c;for(console.log("This API is using a deprecated version of Swagger!  Please see http://github.com/wordnik/swagger-core/wiki for more info"),t.apiVersion!=null&&(this.apiVersion=t.apiVersion),this.apis={},this.apisArray=[],this.produces=t.produces,t.info!=null&&(this.info=t.info),o=!1,s=t.apis,r=0,v=s.length;r<v;r++)if(e=s[r],e.operations)for(h=e.operations,u=0,y=h.length;u<y;u++)w=h[u],o=!0;if(this.basePath=t.basePath?t.basePath:this.url.indexOf("?")>0?this.url.substring(0,this.url.lastIndexOf("?")):this.url,o)l=t.resourcePath.replace(/\//g,""),this.resourcePath=t.resourcePath,i=new n(t,this),this.apis[l]=i,this.apisArray.push(i);else for(c=t.apis,f=0,p=c.length;f<p;f++)a=c[f],i=new n(a,this),this.apis[i.name]=i,this.apisArray.push(i);return this.success&&this.success(),this},i.prototype.selfReflect=function(){var t,i,n;if(this.apis==null)return!1;n=this.apis;for(i in n)if(t=n[i],t.ready==null)return!1;return this.setConsolidatedModels(),this.ready=!0,this.success!=null?this.success():void 0},i.prototype.fail=function(n){this.failure(n);throw n;},i.prototype.setConsolidatedModels=function(){var e,n,t,o,i,s,r,u,f;this.modelsArray=[];this.models={};r=this.apis;for(o in r){t=r[o];for(n in t.models)this.models[n]==null&&(this.models[n]=t.models[n],this.modelsArray.push(t.models[n]))}for(u=this.modelsArray,f=[],i=0,s=u.length;i<s;i++)e=u[i],f.push(e.setReferencedModels(this.models));return f},i.prototype.help=function(){var i,o,n,s,r,t,h,u,f,e;u=this.apis;for(r in u){s=u[r];console.log(r);f=s.operations;for(o in f)for(i=f[o],console.log("  "+i.nickname),e=i.parameters,t=0,h=e.length;t<h;t++)n=e[t],console.log("    "+n.name+(n.required?" (required)":"")+" - "+n.description)}return this},i}();n=function(){function n(n,i){var o,f,e,r,s,u=this;this.api=i;this.api=this.api;s=[];o=[];this.path=this.api.resourcePath!=null?this.api.resourcePath:n.path;this.description=n.description;r=this.path.split("/");this.name=r[r.length-2].replace(".{format}","")+"/"+r[r.length-1].replace(".{format}","");this.basePath=this.api.basePath;this.operations={};this.operationsArray=[];this.modelsArray=[];this.models={};n.apis!=null&&this.api.resourcePath!=null?this.addApiDeclaration(n):(this.path==null&&this.api.fail("SwaggerResources must have a path."),this.url=this.path.substring(0,4)==="http"?this.path.replace("{format}","json"):this.api.basePath+this.path.replace("{format}","json"),this.api.progress("fetching resource "+this.name+": "+this.url),e={url:this.url,method:"get",headers:{},on:{error:function(n){return u.api.fail("Unable to read api '"+u.name+"' from path "+u.url+" (server returned "+n.statusText+")")},response:function(n){var t;return t=JSON.parse(n.content.data),u.addApiDeclaration(t)}}},f={},f=typeof window!="undefined"?window:exports,f.authorizations.apply(e),(new t).execute(e))}return n.prototype.api=null,n.prototype.produces=null,n.prototype.consumes=null,n.prototype.addApiDeclaration=function(n){var i,t,u,r;if(n.produces!=null&&(this.produces=n.produces),n.consumes!=null&&(this.consumes=n.consumes),n.basePath!=null&&n.basePath.replace(/\s/g,"").length>0&&(this.basePath=n.basePath),this.addModels(n.models),n.apis)for(r=n.apis,t=0,u=r.length;t<u;t++)i=r[t],this.addOperations(i.path,i.operations,n.consumes,n.produces);return this.api[this.name]=this,this.ready=!0,this.api.selfReflect()},n.prototype.addModels=function(n){var e,t,r,i,o,u,f;if(n!=null){for(t in n)this.models[t]==null&&(r=new h(t,n[t]),this.modelsArray.push(r),this.models[t]=r);for(u=this.modelsArray,f=[],i=0,o=u.length;i<o;i++)e=u[i],f.push(e.setReferencedModels(this.models));return f}},n.prototype.addOperations=function(n,t,i,u){var h,f,e,c,l,o,s,v,a;if(t){for(a=[],s=0,v=t.length;s<v;s++)f=t[s],i=this.consumes,u=this.produces,i=f.consumes!=null?f.consumes:this.consumes,u=f.produces!=null?f.produces:this.produces,o=f.type||f.responseClass,o==="array"&&(c=null,f.items&&(c=f.items.type||f.items.$ref),o="array["+c+"]"),l=f.responseMessages,h=f.method,f.httpMethod&&(h=f.httpMethod),f.supportedContentTypes&&(i=f.supportedContentTypes),f.errorResponses&&(l=f.errorResponses),f.nickname=this.sanitize(f.nickname),e=new r(f.nickname,n,h,f.parameters,f.summary,f.notes,o,l,this,i,u),this.operations[e.nickname]=e,a.push(this.operationsArray.push(e));return a}},n.prototype.sanitize=function(n){var t,i=new RegExp('[s!@#$%^&*()_+=[{]};:<>|./?,\\\'""-]',"g");return t=n.replace(i,"_"),t=t.replace(/((_){2,})/g,"_"),t=t.replace(/^(_)*/g,""),t.replace(/([_])*$/g,"")},n.prototype.help=function(){var i,r,o,n,t,s,u,f,e;u=this.operations;e=[];for(o in u){for(r=u[o],i="  "+r.nickname,f=r.parameters,t=0,s=f.length;t<s;t++)n=f[t],i.concat("    "+n.name+(n.required?" (required)":"")+" - "+n.description);e.push(i)}return e},n}();h=function(){function n(n,t){var u,r,f;this.name=t.id!=null?t.id:n;this.properties=[];for(r in t.properties){if(t.required!=null)for(f in t.required)r===t.required[f]&&(t.properties[r].required=!0);u=new i(r,t.properties[r]);this.properties.push(u)}}return n.prototype.setReferencedModels=function(n){var t,u,r,e,f,i;for(f=this.properties,i=[],r=0,e=f.length;r<e;r++)t=f[r],u=t.type||t.dataType,n[u]!=null?i.push(t.refModel=n[u]):t.refDataType!=null&&n[t.refDataType]!=null?i.push(t.refModel=n[t.refDataType]):i.push(void 0);return i},n.prototype.getMockSignature=function(n){var c,l,t,f,i,e,o,y,r,u,a,v,s,h;for(f=[],s=this.properties,r=0,a=s.length;r<a;r++)t=s[r],f.push(t.toString());for(e='<span class="strong">',y='<span class="stronger">',o="<\/span>",l=e+this.name+" {"+o,c=e+"}"+o,i=l+"<div>"+f.join(",<\/div><div>")+"<\/div>"+c,n||(n=[]),n.push(this),h=this.properties,u=0,v=h.length;u<v;u++)t=h[u],t.refModel!=null&&n.indexOf(t.refModel)===-1&&(i=i+("<br>"+t.refModel.getMockSignature(n)));return i},n.prototype.createJSONSample=function(n){var i,r,t,f,u;for(r={},n=n||[],n.push(this.name),u=this.properties,t=0,f=u.length;t<f;t++)i=u[t],r[i.name]=i.getSampleValue(n);return n.pop(this.name),r},n}();i=function(){function n(n,t){this.name=n;this.dataType=t.type||t.dataType||t.$ref;this.isCollection=this.dataType&&(this.dataType.toLowerCase()==="array"||this.dataType.toLowerCase()==="list"||this.dataType.toLowerCase()==="set");this.descr=t.description;this.required=t.required;t.items!=null&&(t.items.type!=null&&(this.refDataType=t.items.type),t.items.$ref!=null&&(this.refDataType=t.items.$ref));this.dataTypeWithRef=this.refDataType!=null?this.dataType+"["+this.refDataType+"]":this.dataType;t.allowableValues!=null&&(this.valueType=t.allowableValues.valueType,this.values=t.allowableValues.values,this.values!=null&&(this.valuesString="'"+this.values.join("' or '")+"'"));t["enum"]!=null&&(this.valueType="string",this.values=t["enum"],this.values!=null&&(this.valueString="'"+this.values.join("' or '")+"'"))}return n.prototype.getSampleValue=function(n){var t;return t=this.refModel!=null&&n.indexOf(this.refModel.name)===-1?this.refModel.createJSONSample(n):this.isCollection?this.refDataType:this.dataType,this.isCollection?[t]:t},n.prototype.toString=function(){var t,n;return t=this.required?"propReq":"propOpt",n='<span class="propName '+t+'">'+this.name+'<\/span> (<span class="propType">'+this.dataTypeWithRef+"<\/span>",this.required||(n+=', <span class="propOptKey">optional<\/span>'),n+=")",this.values!=null&&(n+=" = <span class='propVals'>['"+this.values.join("' or '")+"']<\/span>"),this.descr!=null&&(n+=': <span class="propDesc">'+this.descr+"<\/span>"),n},n}();r=function(){function n(n,t,i,r,u,f,e,o,s,h,l){var a,v,y,p,w,g,nt,tt,it,b,k,d,rt=this;for(this.nickname=n,this.path=t,this.method=i,this.parameters=r!=null?r:[],this.summary=u,this.notes=f,this.type=e,this.responseMessages=o,this.resource=s,this.consumes=h,this.produces=l,this["do"]=c(this["do"],this),this.nickname==null&&this.resource.api.fail("SwaggerOperations must have a nickname."),this.path==null&&this.resource.api.fail("SwaggerOperation "+n+" is missing path."),this.method==null&&this.resource.api.fail("SwaggerOperation "+n+" is missing method."),this.path=this.path.replace("{format}","json"),this.method=this.method.toLowerCase(),this.isGetMethod=this.method==="get",this.resourceName=this.resource.name,((it=this.type)!=null?it.toLowerCase():void 0)==="void"&&(this.type=void 0),this.type!=null&&(this.responseClassSignature=this.getSignature(this.type,this.resource.models),this.responseSampleJSON=this.getSampleJSON(this.type,this.resource.models)),this.responseMessages=this.responseMessages||[],b=this.parameters,y=0,g=b.length;y<g;y++){if(a=b[y],a.name=a.name||a.type||a.dataType,e=a.type||a.dataType,e.toLowerCase()==="boolean"&&(a.allowableValues={},a.allowableValues.values=["true","false"]),a.signature=this.getSignature(e,this.resource.models),a.sampleJSON=this.getSampleJSON(e,this.resource.models),a["enum"]!=null)for(a.isList=!0,a.allowableValues={},a.allowableValues.descriptiveValues=[],k=a["enum"],p=0,nt=k.length;p<nt;p++)v=k[p],a.defaultValue!=null&&a.defaultValue===v?a.allowableValues.descriptiveValues.push({value:v,isDefault:!0}):a.allowableValues.descriptiveValues.push({value:v,isDefault:!1});if(a.allowableValues!=null&&(a.allowableValues.valueType==="RANGE"?a.isRange=!0:a.isList=!0,a.allowableValues.values!=null))for(a.allowableValues.descriptiveValues=[],d=a.allowableValues.values,w=0,tt=d.length;w<tt;w++)v=d[w],a.defaultValue!=null&&a.defaultValue===v?a.allowableValues.descriptiveValues.push({value:v,isDefault:!0}):a.allowableValues.descriptiveValues.push({value:v,isDefault:!1})}this.resource[this.nickname]=function(n,t,i){return rt["do"](n,t,i)};this.resource[this.nickname].help=function(){return rt.help()}}return n.prototype.isListType=function(n){if(n.indexOf("[")>=0)return n.substring(n.indexOf("[")+1,n.indexOf("]"))},n.prototype.getSignature=function(n,t){var r,i;return i=this.isListType(n),r=i!=null&&t[i]||t[n]!=null?!1:!0,r?n:i!=null?t[i].getMockSignature():t[n].getMockSignature()},n.prototype.getSampleJSON=function(n,t){var u,i,r;return i=this.isListType(n),u=i!=null&&t[i]||t[n]!=null?!1:!0,r=u?void 0:i!=null?t[i].createJSONSample():t[n].createJSONSample(),r?(r=i?[r]:r,JSON.stringify(r,null,2)):void 0},n.prototype["do"]=function(n,t,i,r){var l,f,e,o,a,y,p,s,h,v,c;for(n==null&&(n={}),t==null&&(t={}),y=null,p=null,typeof n=="function"&&(r=t,i=n,n={}),typeof t=="function"&&(r=i,i=t),r==null&&(r=function(n,t,i){return console.log(n,t,i)}),i==null&&(i=function(n){var t;return t=null,t=n.content!=null?n.content.data:"no data",console.log("default callback: "+t)}),e={},e.headers=[],n.headers!=null&&(e.headers=n.headers,delete n.headers),c=this.parameters,h=0,v=c.length;h<v;h++)f=c[h],f.paramType==="header"&&n[f.name]&&(e.headers[f.name]=n[f.name]);if(n.body!=null&&(e.body=n.body,delete n.body),o=function(){var n,r,t,i;for(t=this.parameters,i=[],n=0,r=t.length;n<r;n++)f=t[n],(f.paramType==="form"||f.paramType.toLowerCase()==="file")&&i.push(f);return i}.call(this),o)for(l in o)s=o[l],n[s.name]&&(e[s.name]=n[s.name]);return a=new u(this.method,this.urlify(n),e,t,i,r,this),t.mock!=null?a:!0},n.prototype.pathJson=function(){return this.path.replace("{format}","json")},n.prototype.pathXml=function(){return this.path.replace("{format}","xml")},n.prototype.urlify=function(n){var t,i,s,r,u,f,h,c,e,o;for(r=this.resource.basePath+this.pathJson(),e=this.parameters,u=0,h=e.length;u<h;u++)if(t=e[u],t.paramType==="path")if(n[t.name])s=new RegExp("{"+t.name+"[^}]*}","gi"),r=r.replace(s,encodeURIComponent(n[t.name])),delete n[t.name];else throw""+t.name+" is a required path param.";for(i="",o=this.parameters,f=0,c=o.length;f<c;f++)t=o[f],t.paramType==="query"&&n[t.name]&&(i!==""&&(i+="&"),i+=encodeURIComponent(t.name)+"="+encodeURIComponent(n[t.name]));return i!=null&&i.length>0&&(r+="?"+i),r},n.prototype.supportHeaderParams=function(){return this.resource.api.supportHeaderParams},n.prototype.supportedSubmitMethods=function(){return this.resource.api.supportedSubmitMethods},n.prototype.getQueryParams=function(n){return this.getMatchingParams(["query"],n)},n.prototype.getHeaderParams=function(n){return this.getMatchingParams(["header"],n)},n.prototype.getMatchingParams=function(n,t){var i,f,r,s,u,h,e,o;for(i={},e=this.parameters,u=0,h=e.length;u<h;u++)r=e[u],t&&t[r.name]&&(i[r.name]=t[r.name]);o=this.resource.api.headers;for(f in o)s=o[f],i[f]=s;return i},n.prototype.help=function(){var n,t,i,u,r;for(n="",r=this.parameters,i=0,u=r.length;i<u;i++)t=r[i],n!==""&&(n+="\n"),n+="* "+t.name+(t.required?" (required)":"")+" - "+t.description;return n},n}();u=function(){function n(n,i,r,u,f,e,o,s){var d,nt,rt,y,p,w,tt,b,c,ut,it,h,a,k,v,g,l=this;if(this.type=n,this.url=i,this.params=r,this.opts=u,this.successCallback=f,this.errorCallback=e,this.operation=o,this.execution=s,this.type==null)throw"SwaggerRequest type is required (get/post/put/delete).";if(this.url==null)throw"SwaggerRequest url is required.";if(this.successCallback==null)throw"SwaggerRequest successCallback is required.";if(this.errorCallback==null)throw"SwaggerRequest error callback is required.";if(this.operation==null)throw"SwaggerRequest operation is required.";if(this.type=this.type.toUpperCase(),y=r.headers,w={},d=r.body,ut=r.parent,h="application/json",d&&(this.type==="POST"||this.type==="PUT"||this.type==="PATCH")?this.opts.requestContentType&&(h=this.opts.requestContentType):function(){var n,r,t,i;for(t=this.operation.parameters,i=[],n=0,r=t.length;n<r;n++)c=t[n],c.paramType==="form"&&i.push(c);return i}.call(this).length>0?(n=c.type||c.dataType,h=function(){var t,u,i,r;for(i=this.operation.parameters,r=[],t=0,u=i.length;t<u;t++)c=i[t],n.toLowerCase()==="file"&&r.push(c);return r}.call(this).length>0?"multipart/form-data":"application/x-www-form-urlencoded"):this.type!=="DELETE"&&(h=null),h&&this.operation.consumes&&this.operation.consumes.indexOf(h)===-1&&(console.log("server doesn't consume "+h+", try "+JSON.stringify(this.operation.consumes)),this.requestContentType===null&&(h=this.operation.consumes[0])),a=null,a=this.type==="POST"||this.type==="GET"||this.type==="PATCH"?this.opts.responseContentType?this.opts.responseContentType:"application/json":null,a&&this.operation.produces&&this.operation.produces.indexOf(a)===-1&&console.log("server can't produce "+a),h&&h.indexOf("application/x-www-form-urlencoded")===0){rt={};it=function(){var n,r,t,i;for(t=this.operation.parameters,i=[],n=0,r=t.length;n<r;n++)c=t[n],c.paramType==="form"&&i.push(c);return i}.call(this);g={};for(p in it)v=it[p],this.params[v.name]&&(g[v.name]=this.params[v.name]);k="";for(p in g)v=g[p],k!==""&&(k+="&"),k+=encodeURIComponent(p)+"="+encodeURIComponent(v);d=k}for(tt in y)w[tt]=y[tt];if(h&&(w["Content-Type"]=h),a&&(w.Accept=a),!(y!=null&&y.mock!=null))if(b={url:this.url,method:this.type,headers:w,body:d,on:{error:function(n){return l.errorCallback(n,l.opts.parent)},redirect:function(n){return l.successCallback(n,l.opts.parent)},307:function(n){return l.successCallback(n,l.opts.parent)},response:function(n){return l.successCallback(n,l.opts.parent)}}},nt={},nt=typeof window!="undefined"?window:exports,nt.authorizations.apply(b),u.mock==null)(new t).execute(b);else return console.log(b),b}return n.prototype.asCurl=function(){var t,n,i;return t=function(){var t,r;t=this.headers;r=[];for(n in t)i=t[n],r.push('--header "'+n+": "+i+'"');return r}.call(this),"curl "+t.join(" ")+" "+this.url},n}();t=function(){function n(){var n,t,i=this;this.Shred=typeof window!="undefined"?require("./shred"):require("shred");this.shred=new this.Shred;n=function(n){return n};t=function(n){return n.toString()};typeof window!="undefined"?(this.content=require("./shred/content"),this.content.registerProcessor(["application/json; charset=utf-8","application/json","json"],{parser:n,stringify:t})):this.Shred.registerProcessor(["application/json; charset=utf-8","application/json","json"],{parser:n,stringify:t})}return n.prototype.Shred=null,n.prototype.shred=null,n.prototype.content=null,n.prototype.execute=function(n){return this.shred.request(n)},n}();s=function(){function n(){this.authz={}}return n.prototype.authz=null,n.prototype.add=function(n,t){return this.authz[n]=t,t},n.prototype.apply=function(n){var r,u,t,i;t=this.authz;i=[];for(r in t)u=t[r],i.push(u.apply(n));return i},n}();f=function(){function n(n,t,i){this.name=n;this.value=t;this.type=i}return n.prototype.type=null,n.prototype.name=null,n.prototype.value=null,n.prototype.apply=function(n){return this.type==="query"?(n.url=n.url.indexOf("?")>0?n.url+"&"+this.name+"="+this.value:n.url+"?"+this.name+"="+this.value,!0):this.type==="header"?n.headers[this.name]=this.value:void 0},n}();e=function(){function n(n,t,i){this.name=n;this.username=t;this.password=i}return n.prototype.name=null,n.prototype.username=null,n.prototype.password=null,n.prototype.apply=function(n){return n.headers.Authorization="Basic "+btoa(this.username+":"+this.password)},n}();this.SwaggerApi=o;this.SwaggerResource=n;this.SwaggerOperation=r;this.SwaggerRequest=u;this.SwaggerModelProperty=i;this.ApiKeyAuthorization=f;this.PasswordAuthorization=e;this.authorizations=new s}.call(this);$(function(){$.fn.vAlign=function(){return this.each(function(){var n=$(this).height(),t=$(this).parent().height(),i=(t-n)/2;$(this).css("margin-top",i)})};$.fn.stretchFormtasticInputWidthToParent=function(){return this.each(function(){var n=$(this).closest("form").innerWidth(),t=parseInt($(this).closest("form").css("padding-left"),10)+parseInt($(this).closest("form").css("padding-right"),10),i=parseInt($(this).css("padding-left"),10)+parseInt($(this).css("padding-right"),10);$(this).css("width",n-t-i)})};$("form.formtastic li.string input, form.formtastic textarea").stretchFormtasticInputWidthToParent();$("ul.downplayed li div.content p").vAlign();$("form.sandbox").submit(function(){var n=!0;return $(this).find("input.required").each(function(){$(this).removeClass("error");$(this).val()==""&&($(this).addClass("error"),$(this).wiggle(),n=!1)}),n})});Function.prototype.bind&&console&&typeof console.log=="object"&&["log","info","warn","error","assert","dir","clear","profile","profileEnd"].forEach(function(n){console[n]=this.bind(console[n],console)},Function.prototype.call);Docs={shebang:function(){var n=$.param.fragment().split("/"),t,i,r;n.shift();switch(n.length){case 1:t="resource_"+n[0];Docs.expandEndpointListForResource(n[0]);$("#"+t).slideto({highlight:!1});break;case 2:Docs.expandEndpointListForResource(n[0]);$("#"+t).slideto({highlight:!1});i=n.join("_");r=i+"_content";Docs.expandOperation($("#"+r));$("#"+i).slideto({highlight:!1})}},toggleEndpointListForResource:function(n){var t=$("li#resource_"+Docs.escapeResourceName(n)+" ul.endpoints");t.is(":visible")?Docs.collapseEndpointListForResource(n):Docs.expandEndpointListForResource(n)},expandEndpointListForResource:function(n){var n=Docs.escapeResourceName(n),t;if(n==""){$(".resource ul.endpoints").slideDown();return}$("li#resource_"+n).addClass("active");t=$("li#resource_"+n+" ul.endpoints");t.slideDown()},collapseEndpointListForResource:function(n){var n=Docs.escapeResourceName(n),t;$("li#resource_"+n).removeClass("active");t=$("li#resource_"+n+" ul.endpoints");t.slideUp()},expandOperationsForResource:function(n){if(Docs.expandEndpointListForResource(n),n==""){$(".resource ul.endpoints li.operation div.content").slideDown();return}$("li#resource_"+Docs.escapeResourceName(n)+" li.operation div.content").each(function(){Docs.expandOperation($(this))})},collapseOperationsForResource:function(n){Docs.expandEndpointListForResource(n);$("li#resource_"+Docs.escapeResourceName(n)+" li.operation div.content").each(function(){Docs.collapseOperation($(this))})},escapeResourceName:function(n){return n.replace(/[!"#$%&'()*+,.\/:;<=>?@\[\\\]\^`{|}~]/g,"\\$&")},expandOperation:function(n){n.slideDown()},collapseOperation:function(n){n.slideUp()}},function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.content_type=n(function(n,t,i,r,u){function h(n,t){var u="",r;return u+="\n  ",r=i.each.call(n,n.produces,{hash:{},inverse:e.noop,fn:e.program(2,c,t),data:t}),(r||r===0)&&(u+=r),u+"\n"}function c(n){var i="",t;return i+='\n\t<option value="',t=typeof n===s?n.apply(n):n,(t||t===0)&&(i+=t),i+='">',t=typeof n===s?n.apply(n):n,(t||t===0)&&(i+=t),i+"<\/option>\n\t"}function l(){return'\n  <option value="application/json">application/json<\/option>\n'}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var o="",f,s="function",e=this;return o+='<label for="contentType"><\/label>\n<select name="contentType">\n',f=i["if"].call(t,t.produces,{hash:{},inverse:e.program(4,l,u),fn:e.program(1,h,u),data:u}),(f||f===0)&&(o+=f),o+"\n<\/select>\n"})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.main=n(function(n,t,i,r,u){function c(n,t){var f="",r,u;return f+='\n    <div class="info_title">'+s((r=(r=n.info,r==null||r===!1?r:r.title),typeof r===o?r.apply(n):r))+'<\/div>\n    <div class="info_description">',u=(r=(r=n.info,r==null||r===!1?r:r.description),typeof r===o?r.apply(n):r),(u||u===0)&&(f+=u),f+="<\/div>\n    ",u=i["if"].call(n,(r=n.info,r==null||r===!1?r:r.termsOfServiceUrl),{hash:{},inverse:e.noop,fn:e.program(2,l,t),data:t}),(u||u===0)&&(f+=u),f+="\n    ",u=i["if"].call(n,(r=n.info,r==null||r===!1?r:r.contact),{hash:{},inverse:e.noop,fn:e.program(4,a,t),data:t}),(u||u===0)&&(f+=u),f+="\n    ",u=i["if"].call(n,(r=n.info,r==null||r===!1?r:r.license),{hash:{},inverse:e.noop,fn:e.program(6,v,t),data:t}),(u||u===0)&&(f+=u),f+"\n  "}function l(n){var t;return""+('<div class="info_tos"><a href="'+s((t=(t=n.info,t==null||t===!1?t:t.termsOfServiceUrl),typeof t===o?t.apply(n):t))+'">Terms of service<\/a><\/div>')}function a(n){var t;return""+("<div class='info_contact'><a href=\"mailto:"+s((t=(t=n.info,t==null||t===!1?t:t.contact),typeof t===o?t.apply(n):t))+'">Contact the developer<\/a><\/div>')}function v(n){var t;return""+("<div class='info_license'><a href='"+s((t=(t=n.info,t==null||t===!1?t:t.licenseUrl),typeof t===o?t.apply(n):t))+"'>"+s((t=(t=n.info,t==null||t===!1?t:t.license),typeof t===o?t.apply(n):t))+"<\/a><\/div>")}function y(n,t){var u="",r;return u+='\n        , <span style="font-variant: small-caps">api version<\/span>: ',(r=i.apiVersion)?r=r.call(n,{hash:{},data:t}):(r=n.apiVersion,r=typeof r===o?r.apply(n):r),u+(s(r)+"\n        ")}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var h="",f,o="function",s=this.escapeExpression,e=this;return h+="<div class='info' id='api_info'>\n  ",f=i["if"].call(t,t.info,{hash:{},inverse:e.noop,fn:e.program(1,c,u),data:u}),(f||f===0)&&(h+=f),h+="\n<\/div>\n<div class='container' id='resources_container'>\n    <ul id='resources'>\n    <\/ul>\n\n    <div class=\"footer\">\n        <br>\n        <br>\n        <h4 style=\"color: #999\">[ <span style=\"font-variant: small-caps\">base url<\/span>: ",(f=i.basePath)?f=f.call(t,{hash:{},data:u}):(f=t.basePath,f=typeof f===o?f.apply(t):f),h+=s(f)+"\n        ",f=i["if"].call(t,t.apiVersion,{hash:{},inverse:e.noop,fn:e.program(8,y,u),data:u}),(f||f===0)&&(h+=f),h+"]<\/h4>\n    <\/div>\n<\/div>\n"})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.operation=n(function(n,t,i,r,u){function c(n,t){var u="",r;return u+="\n        <h4>Implementation Notes<\/h4>\n        <p>",(r=i.notes)?r=r.call(n,{hash:{},data:t}):(r=n.notes,r=typeof r===o?r.apply(n):r),(r||r===0)&&(u+=r),u+"<\/p>\n        "}function l(){return'\n          <h4>Response Class<\/h4>\n          <p><span class="model-signature" /><\/p>\n          <br/>\n          <div class="response-content-type" />\n        '}function a(){return'\n          <h4>Parameters<\/h4>\n          <table class=\'fullwidth\'>\n          <thead>\n            <tr>\n            <th style="width: 100px; max-width: 100px">Parameter<\/th>\n            <th style="width: 310px; max-width: 310px">Value<\/th>\n            <th style="width: 200px; max-width: 200px">Description<\/th>\n            <th style="width: 100px; max-width: 100px">Parameter Type<\/th>\n            <th style="width: 220px; max-width: 230px">Data Type<\/th>\n            <\/tr>\n          <\/thead>\n          <tbody class="operation-params">\n\n          <\/tbody>\n          <\/table>\n          '}function v(){return"\n          <div style='margin:0;padding:0;display:inline'><\/div>\n          <h4>Error Status Codes<\/h4>\n          <table class='fullwidth'>\n            <thead>\n            <tr>\n              <th>HTTP Status Code<\/th>\n              <th>Reason<\/th>\n            <\/tr>\n            <\/thead>\n            <tbody class=\"operation-status\">\n            \n            <\/tbody>\n          <\/table>\n          "}function y(){return"\n          "}function p(){return"\n          <div class='sandbox_header'>\n            <input class='submit' name='commit' type='button' value='Try it out!' />\n            <a href='#' class='response_hider' style='display:none'>Hide Response<\/a>\n            <img alt='Throbber' class='response_throbber' src='images/throbber.gif' style='display:none' />\n          <\/div>\n          "}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var e="",f,o="function",s=this.escapeExpression,h=this;return e+="\n  <ul class='operations' >\n    <li class='",(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+" operation' id='",(f=i.resourceName)?f=f.call(t,{hash:{},data:u}):(f=t.resourceName,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.nickname)?f=f.call(t,{hash:{},data:u}):(f=t.nickname,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.number)?f=f.call(t,{hash:{},data:u}):(f=t.number,f=typeof f===o?f.apply(t):f),e+=s(f)+"'>\n      <div class='heading'>\n        <h3>\n          <span class='http_method'>\n          <a href='#!/",(f=i.resourceName)?f=f.call(t,{hash:{},data:u}):(f=t.resourceName,f=typeof f===o?f.apply(t):f),e+=s(f)+"/",(f=i.nickname)?f=f.call(t,{hash:{},data:u}):(f=t.nickname,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.number)?f=f.call(t,{hash:{},data:u}):(f=t.number,f=typeof f===o?f.apply(t):f),e+=s(f)+'\' class="toggleOperation">',(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+"<\/a>\n          <\/span>\n          <span class='path'>\n          <a href='#!/",(f=i.resourceName)?f=f.call(t,{hash:{},data:u}):(f=t.resourceName,f=typeof f===o?f.apply(t):f),e+=s(f)+"/",(f=i.nickname)?f=f.call(t,{hash:{},data:u}):(f=t.nickname,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.number)?f=f.call(t,{hash:{},data:u}):(f=t.number,f=typeof f===o?f.apply(t):f),e+=s(f)+'\' class="toggleOperation">',(f=i.path)?f=f.call(t,{hash:{},data:u}):(f=t.path,f=typeof f===o?f.apply(t):f),e+=s(f)+"<\/a>\n          <\/span>\n        <\/h3>\n        <ul class='options'>\n          <li>\n          <a href='#!/",(f=i.resourceName)?f=f.call(t,{hash:{},data:u}):(f=t.resourceName,f=typeof f===o?f.apply(t):f),e+=s(f)+"/",(f=i.nickname)?f=f.call(t,{hash:{},data:u}):(f=t.nickname,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.number)?f=f.call(t,{hash:{},data:u}):(f=t.number,f=typeof f===o?f.apply(t):f),e+=s(f)+'\' class="toggleOperation">',(f=i.summary)?f=f.call(t,{hash:{},data:u}):(f=t.summary,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+="<\/a>\n          <\/li>\n        <\/ul>\n      <\/div>\n      <div class='content' id='",(f=i.resourceName)?f=f.call(t,{hash:{},data:u}):(f=t.resourceName,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.nickname)?f=f.call(t,{hash:{},data:u}):(f=t.nickname,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.method)?f=f.call(t,{hash:{},data:u}):(f=t.method,f=typeof f===o?f.apply(t):f),e+=s(f)+"_",(f=i.number)?f=f.call(t,{hash:{},data:u}):(f=t.number,f=typeof f===o?f.apply(t):f),e+=s(f)+"_content' style='display:none'>\n        ",f=i["if"].call(t,t.notes,{hash:{},inverse:h.noop,fn:h.program(1,c,u),data:u}),(f||f===0)&&(e+=f),e+="\n        ",f=i["if"].call(t,t.type,{hash:{},inverse:h.noop,fn:h.program(3,l,u),data:u}),(f||f===0)&&(e+=f),e+="\n        <form accept-charset='UTF-8' class='sandbox'>\n          <div style='margin:0;padding:0;display:inline'><\/div>\n          ",f=i["if"].call(t,t.parameters,{hash:{},inverse:h.noop,fn:h.program(5,a,u),data:u}),(f||f===0)&&(e+=f),e+="\n          ",f=i["if"].call(t,t.responseMessages,{hash:{},inverse:h.noop,fn:h.program(7,v,u),data:u}),(f||f===0)&&(e+=f),e+="\n          ",f=i["if"].call(t,t.isReadOnly,{hash:{},inverse:h.program(11,p,u),fn:h.program(9,y,u),data:u}),(f||f===0)&&(e+=f),e+"\n        <\/form>\n        <div class='response' style='display:none'>\n          <h4>Request URL<\/h4>\n          <div class='block request_url'><\/div>\n          <h4>Response Body<\/h4>\n          <div class='block response_body'><\/div>\n          <h4>Response Code<\/h4>\n          <div class='block response_code'><\/div>\n          <h4>Response Headers<\/h4>\n          <div class='block response_headers'><\/div>\n        <\/div>\n      <\/div>\n    <\/li>\n  <\/ul>\n"})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param=n(function(n,t,i,r,u){function c(n,t){var u="",r;return u+="\n\t\t",r=i["if"].call(n,n.isFile,{hash:{},inverse:h.program(4,a,t),fn:h.program(2,l,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t"}function l(n,t){var u="",r;return u+='\n\t\t\t<input type="file" name=\'',(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+'\'/>\n\t\t\t<div class="parameter-content-type" />\n\t\t')}function a(n,t){var u="",r;return u+="\n\t\t\t",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:h.program(7,y,t),fn:h.program(5,v,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t\t"}function v(n,t){var u="",r;return u+="\n\t\t\t\t<textarea class='body-textarea' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+=s(r)+"'>",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===e?r.apply(n):r),u+(s(r)+"<\/textarea>\n\t\t\t")}function y(n,t){var u="",r;return u+="\n\t\t\t\t<textarea class='body-textarea' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+'\'><\/textarea>\n\t\t\t\t<br />\n\t\t\t\t<div class="parameter-content-type" />\n\t\t\t')}function p(n,t){var u="",r;return u+="\n\t\t",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:h.program(12,b,t),fn:h.program(10,w,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t"}function w(n,t){var u="",r;return u+="\n\t\t\t<input class='parameter' minlength='0' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+=s(r)+"' placeholder='' type='text' value='",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===e?r.apply(n):r),u+(s(r)+"'/>\n\t\t")}function b(n,t){var u="",r;return u+="\n\t\t\t<input class='parameter' minlength='0' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+"' placeholder='' type='text' value=''/>\n\t\t")}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var o="",f,e="function",s=this.escapeExpression,h=this;return o+="<td class='code'>",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===e?f.apply(t):f),o+=s(f)+"<\/td>\n<td>\n\n\t",f=i["if"].call(t,t.isBody,{hash:{},inverse:h.program(9,p,u),fn:h.program(1,c,u),data:u}),(f||f===0)&&(o+=f),o+="\n\n<\/td>\n<td>",(f=i.description)?f=f.call(t,{hash:{},data:u}):(f=t.description,f=typeof f===e?f.apply(t):f),(f||f===0)&&(o+=f),o+="<\/td>\n<td>",(f=i.paramType)?f=f.call(t,{hash:{},data:u}):(f=t.paramType,f=typeof f===e?f.apply(t):f),(f||f===0)&&(o+=f),o+'<\/td>\n<td>\n\t<span class="model-signature"><\/span>\n<\/td>\n'})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_list=n(function(n,t,i,r,u){function l(){return" multiple='multiple'"}function a(){return"\n    "}function v(n,t){var u="",r;return u+="\n      ",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:s.program(8,p,t),fn:s.program(6,y,t),data:t}),(r||r===0)&&(u+=r),u+"\n    "}function y(){return"\n      "}function p(n,t){var u="",r;return u+="\n        ",r=i["if"].call(n,n.allowMultiple,{hash:{},inverse:s.program(11,b,t),fn:s.program(9,w,t),data:t}),(r||r===0)&&(u+=r),u+"\n      "}function w(){return"\n         "}function b(){return"\n          <option selected=\"\" value=''><\/option>\n         "}function k(n,t){var u="",r;return u+="\n      ",r=i["if"].call(n,n.isDefault,{hash:{},inverse:s.program(16,g,t),fn:s.program(14,d,t),data:t}),(r||r===0)&&(u+=r),u+"\n    "}function d(n,t){var u="",r;return u+='\n        <option selected="" value=\'',(r=i.value)?r=r.call(n,{hash:{},data:t}):(r=n.value,r=typeof r===h?r.apply(n):r),u+=c(r)+"'>",(r=i.value)?r=r.call(n,{hash:{},data:t}):(r=n.value,r=typeof r===h?r.apply(n):r),u+(c(r)+" (default)<\/option>\n      ")}function g(n,t){var u="",r;return u+="\n        <option value='",(r=i.value)?r=r.call(n,{hash:{},data:t}):(r=n.value,r=typeof r===h?r.apply(n):r),u+=c(r)+"'>",(r=i.value)?r=r.call(n,{hash:{},data:t}):(r=n.value,r=typeof r===h?r.apply(n):r),u+(c(r)+"<\/option>\n      ")}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var o="",f,e,s=this,h="function",c=this.escapeExpression;return o+="<td class='code'>",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===h?f.apply(t):f),o+=c(f)+"<\/td>\n<td>\n  <select ",f=i["if"].call(t,t.allowMultiple,{hash:{},inverse:s.noop,fn:s.program(1,l,u),data:u}),(f||f===0)&&(o+=f),o+=" class='parameter' name='",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===h?f.apply(t):f),o+=c(f)+"'>\n    ",f=i["if"].call(t,t.required,{hash:{},inverse:s.program(5,v,u),fn:s.program(3,a,u),data:u}),(f||f===0)&&(o+=f),o+="\n    ",e=i.each.call(t,(f=t.allowableValues,f==null||f===!1?f:f.descriptiveValues),{hash:{},inverse:s.noop,fn:s.program(13,k,u),data:u}),(e||e===0)&&(o+=e),o+="\n  <\/select>\n<\/td>\n<td>",(e=i.description)?e=e.call(t,{hash:{},data:u}):(e=t.description,e=typeof e===h?e.apply(t):e),(e||e===0)&&(o+=e),o+="<\/td>\n<td>",(e=i.paramType)?e=e.call(t,{hash:{},data:u}):(e=t.paramType,e=typeof e===h?e.apply(t):e),(e||e===0)&&(o+=e),o+'<\/td>\n<td><span class="model-signature"><\/span><\/td>'})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_readonly=n(function(n,t,i,r,u){function c(n,t){var u="",r;return u+="\n        <textarea class='body-textarea' readonly='readonly' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===o?r.apply(n):r),u+=s(r)+"'>",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===o?r.apply(n):r),u+(s(r)+"<\/textarea>\n    ")}function l(n,t){var u="",r;return u+="\n        ",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:h.program(6,v,t),fn:h.program(4,a,t),data:t}),(r||r===0)&&(u+=r),u+"\n    "}function a(n,t){var u="",r;return u+="\n            ",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===o?r.apply(n):r),u+(s(r)+"\n        ")}function v(){return"\n            (empty)\n        "}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var e="",f,o="function",s=this.escapeExpression,h=this;return e+="<td class='code'>",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"<\/td>\n<td>\n    ",f=i["if"].call(t,t.isBody,{hash:{},inverse:h.program(3,l,u),fn:h.program(1,c,u),data:u}),(f||f===0)&&(e+=f),e+="\n<\/td>\n<td>",(f=i.description)?f=f.call(t,{hash:{},data:u}):(f=t.description,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+="<\/td>\n<td>",(f=i.paramType)?f=f.call(t,{hash:{},data:u}):(f=t.paramType,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+'<\/td>\n<td><span class="model-signature"><\/span><\/td>\n'})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_readonly_required=n(function(n,t,i,r,u){function c(n,t){var u="",r;return u+="\n        <textarea class='body-textarea'  readonly='readonly' placeholder='(required)' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===o?r.apply(n):r),u+=s(r)+"'>",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===o?r.apply(n):r),u+(s(r)+"<\/textarea>\n    ")}function l(n,t){var u="",r;return u+="\n        ",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:h.program(6,v,t),fn:h.program(4,a,t),data:t}),(r||r===0)&&(u+=r),u+"\n    "}function a(n,t){var u="",r;return u+="\n            ",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===o?r.apply(n):r),u+(s(r)+"\n        ")}function v(){return"\n            (empty)\n        "}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var e="",f,o="function",s=this.escapeExpression,h=this;return e+="<td class='code required'>",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"<\/td>\n<td>\n    ",f=i["if"].call(t,t.isBody,{hash:{},inverse:h.program(3,l,u),fn:h.program(1,c,u),data:u}),(f||f===0)&&(e+=f),e+="\n<\/td>\n<td>",(f=i.description)?f=f.call(t,{hash:{},data:u}):(f=t.description,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+="<\/td>\n<td>",(f=i.paramType)?f=f.call(t,{hash:{},data:u}):(f=t.paramType,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+'<\/td>\n<td><span class="model-signature"><\/span><\/td>\n'})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.param_required=n(function(n,t,i,r,u){function c(n,t){var u="",r;return u+="\n\t\t",r=i["if"].call(n,n.isFile,{hash:{},inverse:o.program(4,a,t),fn:o.program(2,l,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t"}function l(n,t){var u="",r;return u+='\n\t\t\t<input type="file" name=\'',(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+"'/>\n\t\t")}function a(n,t){var u="",r;return u+="\n\t\t\t",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:o.program(7,y,t),fn:o.program(5,v,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t\t"}function v(n,t){var u="",r;return u+="\n\t\t\t\t<textarea class='body-textarea' placeholder='(required)' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+=s(r)+"'>",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===e?r.apply(n):r),u+(s(r)+"<\/textarea>\n\t\t\t")}function y(n,t){var u="",r;return u+="\n\t\t\t\t<textarea class='body-textarea' placeholder='(required)' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+'\'><\/textarea>\n\t\t\t\t<br />\n\t\t\t\t<div class="parameter-content-type" />\n\t\t\t')}function p(n,t){var u="",r;return u+="\n\t\t",r=i["if"].call(n,n.isFile,{hash:{},inverse:o.program(12,b,t),fn:o.program(10,w,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t"}function w(n,t){var u="",r;return u+="\n\t\t\t<input class='parameter' class='required' type='file' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+"'/>\n\t\t")}function b(n,t){var u="",r;return u+="\n\t\t\t",r=i["if"].call(n,n.defaultValue,{hash:{},inverse:o.program(15,d,t),fn:o.program(13,k,t),data:t}),(r||r===0)&&(u+=r),u+"\n\t\t"}function k(n,t){var u="",r;return u+="\n\t\t\t\t<input class='parameter required' minlength='1' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+=s(r)+"' placeholder='(required)' type='text' value='",(r=i.defaultValue)?r=r.call(n,{hash:{},data:t}):(r=n.defaultValue,r=typeof r===e?r.apply(n):r),u+(s(r)+"'/>\n\t\t\t")}function d(n,t){var u="",r;return u+="\n\t\t\t\t<input class='parameter required' minlength='1' name='",(r=i.name)?r=r.call(n,{hash:{},data:t}):(r=n.name,r=typeof r===e?r.apply(n):r),u+(s(r)+"' placeholder='(required)' type='text' value=''/>\n\t\t\t")}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var h="",f,e="function",s=this.escapeExpression,o=this;return h+="<td class='code required'>",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===e?f.apply(t):f),h+=s(f)+"<\/td>\n<td>\n\t",f=i["if"].call(t,t.isBody,{hash:{},inverse:o.program(9,p,u),fn:o.program(1,c,u),data:u}),(f||f===0)&&(h+=f),h+="\n<\/td>\n<td>\n\t<strong>",(f=i.description)?f=f.call(t,{hash:{},data:u}):(f=t.description,f=typeof f===e?f.apply(t):f),(f||f===0)&&(h+=f),h+="<\/strong>\n<\/td>\n<td>",(f=i.paramType)?f=f.call(t,{hash:{},data:u}):(f=t.paramType,f=typeof f===e?f.apply(t):f),(f||f===0)&&(h+=f),h+'<\/td>\n<td><span class="model-signature"><\/span><\/td>\n'})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.parameter_content_type=n(function(n,t,i,r,u){function h(n,t){var u="",r;return u+="\n  ",r=i.each.call(n,n.consumes,{hash:{},inverse:e.noop,fn:e.program(2,c,t),data:t}),(r||r===0)&&(u+=r),u+"\n"}function c(n){var i="",t;return i+='\n  <option value="',t=typeof n===s?n.apply(n):n,(t||t===0)&&(i+=t),i+='">',t=typeof n===s?n.apply(n):n,(t||t===0)&&(i+=t),i+"<\/option>\n  "}function l(){return'\n  <option value="application/json">application/json<\/option>\n'}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var o="",f,s="function",e=this;return o+='<label for="parameterContentType"><\/label>\n<select name="parameterContentType">\n',f=i["if"].call(t,t.consumes,{hash:{},inverse:e.program(4,l,u),fn:e.program(1,h,u),data:u}),(f||f===0)&&(o+=f),o+"\n<\/select>\n"})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.resource=n(function(n,t,i,r,u){function a(){return" : "}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var e="",f,h,o="function",s=this.escapeExpression,c=this,l=i.blockHelperMissing;return e+="<div class='heading'>\n  <h2>\n    <a href='#!/",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"' onclick=\"Docs.toggleEndpointListForResource('",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"');\">",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"<\/a> ",h={hash:{},inverse:c.noop,fn:c.program(1,a,u),data:u},(f=i.description)?f=f.call(t,h):(f=t.description,f=typeof f===o?f.apply(t):f),i.description||(f=l.call(t,f,h)),(f||f===0)&&(e+=f),(f=i.description)?f=f.call(t,{hash:{},data:u}):(f=t.description,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+="\n  <\/h2>\n  <ul class='options'>\n    <li>\n      <a href='#!/",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"' id='endpointListTogger_",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"'\n         onclick=\"Docs.toggleEndpointListForResource('",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"');\">Show/Hide<\/a>\n    <\/li>\n    <li>\n      <a href='#' onclick=\"Docs.collapseOperationsForResource('",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"'); return false;\">\n        List Operations\n      <\/a>\n    <\/li>\n    <li>\n      <a href='#' onclick=\"Docs.expandOperationsForResource('",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+=s(f)+"'); return false;\">\n        Expand Operations\n      <\/a>\n    <\/li>\n    <li>\n      <a href='",(f=i.url)?f=f.call(t,{hash:{},data:u}):(f=t.url,f=typeof f===o?f.apply(t):f),e+=s(f)+"'>Raw<\/a>\n    <\/li>\n  <\/ul>\n<\/div>\n<ul class='endpoints' id='",(f=i.name)?f=f.call(t,{hash:{},data:u}):(f=t.name,f=typeof f===o?f.apply(t):f),e+(s(f)+"_endpoint_list' style='display:none'>\n\n<\/ul>\n")})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.response_content_type=n(function(n,t,i,r,u){function h(n,t){var u="",r;return u+="\n  ",r=i.each.call(n,n.produces,{hash:{},inverse:e.noop,fn:e.program(2,c,t),data:t}),(r||r===0)&&(u+=r),u+"\n"}function c(n){var i="",t;return i+='\n  <option value="',t=typeof n===s?n.apply(n):n,(t||t===0)&&(i+=t),i+='">',t=typeof n===s?n.apply(n):n,(t||t===0)&&(i+=t),i+"<\/option>\n  "}function l(){return'\n  <option value="application/json">application/json<\/option>\n'}this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var o="",f,s="function",e=this;return o+='<label for="responseContentType"><\/label>\n<select name="responseContentType">\n',f=i["if"].call(t,t.produces,{hash:{},inverse:e.program(4,l,u),fn:e.program(1,h,u),data:u}),(f||f===0)&&(o+=f),o+"\n<\/select>\n"})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.signature=n(function(n,t,i,r,u){this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var e="",f,o="function",s=this.escapeExpression;return e+='<div>\n<ul class="signature-nav">\n    <li><a class="description-link" href="#">Model<\/a><\/li>\n    <li><a class="snippet-link" href="#">Model Schema<\/a><\/li>\n<\/ul>\n<div>\n\n<div class="signature-container">\n    <div class="description">\n        ',(f=i.signature)?f=f.call(t,{hash:{},data:u}):(f=t.signature,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+='\n    <\/div>\n\n    <div class="snippet">\n        <pre><code>',(f=i.sampleJSON)?f=f.call(t,{hash:{},data:u}):(f=t.sampleJSON,f=typeof f===o?f.apply(t):f),e+(s(f)+'<\/code><\/pre>\n        <small class="notice"><\/small>\n    <\/div>\n<\/div>\n\n')})}(),function(){var n=Handlebars.template,t=Handlebars.templates=Handlebars.templates||{};t.status_code=n(function(n,t,i,r,u){this.compilerInfo=[4,">= 1.0.0"];i=this.merge(i,n.helpers);u=u||{};var e="",f,o="function",s=this.escapeExpression;return e+="<td width='15%' class='code'>",(f=i.code)?f=f.call(t,{hash:{},data:u}):(f=t.code,f=typeof f===o?f.apply(t):f),e+=s(f)+"<\/td>\n<td>",(f=i.message)?f=f.call(t,{hash:{},data:u}):(f=t.message,f=typeof f===o?f.apply(t):f),(f||f===0)&&(e+=f),e+"<\/td>\n"})}(),function(){var tt,r,u,f,e,o,s,t,i,h,c,l,a,v,y,p,w,b,k,d,g,nt,it={}.hasOwnProperty,n=function(n,t){function r(){this.constructor=n}for(var i in t)it.call(t,i)&&(n[i]=t[i]);return r.prototype=t.prototype,n.prototype=new r,n.__super__=t.prototype,n};c=function(t){function i(){return l=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.dom_id="swagger_ui",i.prototype.options=null,i.prototype.api=null,i.prototype.headerView=null,i.prototype.mainView=null,i.prototype.initialize=function(n){var t=this;n==null&&(n={});n.dom_id!=null&&(this.dom_id=n.dom_id,delete n.dom_id);$("#"+this.dom_id)==null&&$("body").append('<div id="'+this.dom_id+'"><\/div>');this.options=n;this.options.success=function(){return t.render()};this.options.progress=function(n){return t.showMessage(n)};this.options.failure=function(n){return t.onLoadFailure(n)};this.headerView=new r({el:$("#header")});return this.headerView.on("update-swagger-ui",function(n){return t.updateSwaggerUi(n)})},i.prototype.updateSwaggerUi=function(n){return this.options.url=n.url,this.load()},i.prototype.load=function(){var n,t;return(t=this.mainView)!=null&&t.clear(),n=this.options.url,n.indexOf("http")!==0&&(n=this.buildUrl(window.location.href.toString(),n)),this.options.url=n,this.headerView.update(n),this.api=new SwaggerApi(this.options),this.api.build(),this.api},i.prototype.render=function(){var n=this;this.showMessage("Finished Loading Resource Information. Rendering Swagger UI...");this.mainView=new u({model:this.api,el:$("#"+this.dom_id)}).render();this.showMessage();switch(this.options.docExpansion){case"full":Docs.expandOperationsForResource("");break;case"list":Docs.collapseOperationsForResource("")}if(this.options.onComplete)this.options.onComplete(this.api,this);return setTimeout(function(){return Docs.shebang()},400)},i.prototype.buildUrl=function(n,t){var i;return console.log("base is "+n),i=n.split("/"),n=i[0]+"//"+i[2],t.indexOf("/")===0?n+t:n+"/"+t},i.prototype.showMessage=function(n){return n==null&&(n=""),$("#message-bar").removeClass("message-fail"),$("#message-bar").addClass("message-success"),$("#message-bar").html(n)},i.prototype.onLoadFailure=function(n){var t;if(n==null&&(n=""),$("#message-bar").removeClass("message-success"),$("#message-bar").addClass("message-fail"),t=$("#message-bar").html(n),this.options.onFailure!=null)this.options.onFailure(n);return t},i}(Backbone.Router);window.SwaggerUi=c;r=function(t){function i(){return a=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.events={"click #show-pet-store-icon":"showPetStore","click #show-wordnik-dev-icon":"showWordnikDev","click #explore":"showCustom","keyup #input_baseUrl":"showCustomOnKeyup","keyup #input_apiKey":"showCustomOnKeyup"},i.prototype.initialize=function(){},i.prototype.showPetStore=function(){return this.trigger("update-swagger-ui",{url:"http://petstore.swagger.wordnik.com/api/api-docs"})},i.prototype.showWordnikDev=function(){return this.trigger("update-swagger-ui",{url:"http://api.wordnik.com/v4/resources.json"})},i.prototype.showCustomOnKeyup=function(n){if(n.keyCode===13)return this.showCustom()},i.prototype.showCustom=function(n){return n!=null&&n.preventDefault(),this.trigger("update-swagger-ui",{url:$("#input_baseUrl").val(),apiKey:$("#input_apiKey").val()})},i.prototype.update=function(n,t,i){return i==null&&(i=!1),$("#input_baseUrl").val(n),i?this.trigger("update-swagger-ui",{url:n}):void 0},i}(Backbone.View);u=function(t){function i(){return y=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.initialize=function(){},i.prototype.render=function(){var i,n,r,t;for($(this.el).html(Handlebars.templates.main(this.model)),t=this.model.apisArray,n=0,r=t.length;n<r;n++)i=t[n],this.addResource(i);return this},i.prototype.addResource=function(n){var t;return t=new s({model:n,tagName:"li",id:"resource_"+n.name,className:"resource"}),$("#resources").append(t.render().el)},i.prototype.clear=function(){return $(this.el).html("")},i}(Backbone.View);s=function(t){function i(){return p=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.initialize=function(){},i.prototype.render=function(){var i,n,r,t;for(console.log(this.model.description),$(this.el).html(Handlebars.templates.resource(this.model)),this.number=0,t=this.model.operationsArray,n=0,r=t.length;n<r;n++)i=t[n],this.addOperation(i);return this},i.prototype.addOperation=function(n){var t;return n.number=this.number,t=new f({model:n,tagName:"li",className:"endpoint"}),$(".endpoints",$(this.el)).append(t.render().el),this.number++},i}(Backbone.View);f=function(r){function u(){return w=u.__super__.constructor.apply(this,arguments)}return n(u,r),u.prototype.events={"submit .sandbox":"submitOperation","click .submit":"submitOperation","click .response_hider":"hideResponse","click .toggleOperation":"toggleOperationContent"},u.prototype.initialize=function(){},u.prototype.render=function(){var n,c,r,l,a,v,y,p,u,f,e,w,b,k,o,s,h;for(c=!0,c||(this.model.isReadOnly=!0),$(this.el).html(Handlebars.templates.operation(this.model)),this.model.responseClassSignature&&this.model.responseClassSignature!=="string"?(v={sampleJSON:this.model.responseSampleJSON,isParam:!1,signature:this.model.responseClassSignature},a=new i({model:v,tagName:"div"}),$(".model-signature",$(this.el)).append(a.render().el)):$(".model-signature",$(this.el)).html(this.model.type),n={isParam:!1},n.consumes=this.model.consumes,n.produces=this.model.produces,o=this.model.parameters,u=0,w=o.length;u<w;u++)r=o[u],p=r.type||r.dataType,p.toLowerCase()==="file"&&(n.consumes||(console.log("set content type "),n.consumes="multipart/form-data"));for(l=new t({model:n}),$(".response-content-type",$(this.el)).append(l.render().el),s=this.model.parameters,f=0,b=s.length;f<b;f++)r=s[f],this.addParameter(r,n.consumes);for(h=this.model.responseMessages,e=0,k=h.length;e<k;e++)y=h[e],this.addStatusCode(y);return this},u.prototype.addParameter=function(n,t){var i;return n.consumes=t,i=new o({model:n,tagName:"tr",readOnly:this.model.isReadOnly}),$(".operation-params",$(this.el)).append(i.render().el)},u.prototype.addStatusCode=function(n){var t;return t=new h({model:n,tagName:"tr"}),$(".operation-status",$(this.el)).append(t.render().el)},u.prototype.submitOperation=function(n){var h,i,r,t,u,f,e,o,s,v,y,p,c,l,a;if(n!=null&&n.preventDefault(),i=$(".sandbox",$(this.el)),h=!0,i.find("input.required").each(function(){var n=this;return $(this).removeClass("error"),jQuery.trim($(this).val())===""?($(this).addClass("error"),$(this).wiggle({callback:function(){return $(n).focus()}}),h=!1):void 0}),h){for(r={},u={parent:this},c=i.find("input"),e=0,v=c.length;e<v;e++)t=c[e],t.value!=null&&jQuery.trim(t.value).length>0&&(r[t.name]=t.value);for(l=i.find("textarea"),o=0,y=l.length;o<y;o++)t=l[o],t.value!=null&&jQuery.trim(t.value).length>0&&(r.body=t.value);for(a=i.find("select"),s=0,p=a.length;s<p;s++)t=a[s],f=this.getSelectedValue(t),f!=null&&jQuery.trim(f).length>0&&(r[t.name]=f);return u.responseContentType=$("div select[name=responseContentType]",$(this.el)).val(),u.requestContentType=$("div select[name=parameterContentType]",$(this.el)).val(),$(".response_throbber",$(this.el)).show(),this.model["do"](r,u,this.showCompleteStatus,this.showErrorStatus,this)}},u.prototype.success=function(n,t){return t.showCompleteStatus(n)},u.prototype.getSelectedValue=function(n){var r,t,i,f,u;if(n.multiple){for(t=[],u=n.options,i=0,f=u.length;i<f;i++)r=u[i],r.selected&&t.push(r.value);return t.length>0?t.join(","):null}return n.value},u.prototype.hideResponse=function(n){return n!=null&&n.preventDefault(),$(".response",$(this.el)).slideUp(),$(".response_hider",$(this.el)).fadeOut()},u.prototype.showResponse=function(n){var t;return t=JSON.stringify(n,null,"\t").replace(/\n/g,"<br>"),$(".response_body",$(this.el)).html(escape(t))},u.prototype.showErrorStatus=function(n,t){return t.showStatus(n)},u.prototype.showCompleteStatus=function(n,t){return t.showStatus(n)},u.prototype.formatXml=function(n){var e,t,r,u,f,o,v,s,h,c,l,i,a;for(s=/(>)(<)(\/*)/g,c=/[ ]*(.*)[ ]+\n/g,e=/(<.+>)(.+\n)/g,n=n.replace(s,"$1\n$2$3").replace(c,"$1\n").replace(e,"$1\n$2"),v=0,t="",f=n.split("\n"),r=0,u="other",h={"single->single":0,"single->closing":-1,"single->opening":0,"single->other":0,"closing->single":0,"closing->closing":-1,"closing->opening":0,"closing->other":0,"opening->single":1,"opening->closing":0,"opening->opening":1,"opening->other":1,"other->single":0,"other->closing":-1,"other->opening":0,"other->other":0},l=function(n){var f,c,e,o,i,s,l;return s={single:Boolean(n.match(/<.+\/>/)),closing:Boolean(n.match(/<\/.+>/)),opening:Boolean(n.match(/<[^!?].*>/))},i=function(){var n=[];for(e in s)l=s[e],l&&n.push(e);return n}()[0],i=i===void 0?"other":i,f=u+"->"+i,u=i,o="",r+=h[f],o=function(){var n,t,i;for(i=[],c=n=0,t=r;0<=t?n<t:n>t;c=0<=t?++n:--n)i.push("  ");return i}().join(""),f==="opening->closing"?t=t.substr(0,t.length-1)+n+"\n":t+=o+n+"\n"},i=0,a=f.length;i<a;i++)o=f[i],l(o);return t},u.prototype.showStatus=function(n){var t,i,u,f,r,e;return i=n.content.data,f=n.getHeaders(),u=f["Content-Type"],i===void 0?(t=$("<code />").text("no content"),r=$('<pre class="json" />').append(t)):u.indexOf("application/json")===0||u.indexOf("application/hal+json")===0?(t=$("<code />").text(JSON.stringify(JSON.parse(i),null,2)),r=$('<pre class="json" />').append(t)):u.indexOf("application/xml")===0?(t=$("<code />").text(this.formatXml(i)),r=$('<pre class="xml" />').append(t)):u.indexOf("text/html")===0?(t=$("<code />").html(i),r=$('<pre class="xml" />').append(t)):(t=$("<code />").text(i),r=$('<pre class="json" />').append(t)),e=r,$(".request_url").html("<pre>"+n.request.url+"<\/pre>"),$(".response_code",$(this.el)).html("<pre>"+n.status+"<\/pre>"),$(".response_body",$(this.el)).html(e),$(".response_headers",$(this.el)).html("<pre>"+JSON.stringify(n.getHeaders())+"<\/pre>"),$(".response",$(this.el)).slideDown(),$(".response_hider",$(this.el)).show(),$(".response_throbber",$(this.el)).hide(),hljs.highlightBlock($(".response_body",$(this.el))[0])},u.prototype.toggleOperationContent=function(){var n;return n=$("#"+Docs.escapeResourceName(this.model.resourceName)+"_"+this.model.nickname+"_"+this.model.method+"_"+this.model.number+"_content"),n.is(":visible")?Docs.collapseOperation(n):Docs.expandOperation(n)},u}(Backbone.View);h=function(t){function i(){return b=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.initialize=function(){},i.prototype.render=function(){var n;return n=this.template(),$(this.el).html(n(this.model)),this},i.prototype.template=function(){return Handlebars.templates.status_code},i}(Backbone.View);o=function(r){function u(){return k=u.__super__.constructor.apply(this,arguments)}return n(u,r),u.prototype.initialize=function(){},u.prototype.render=function(){var n,r,u,f,o,s,h,c;return c=this.model.type||this.model.dataType,this.model.paramType==="body"&&(this.model.isBody=!0),c.toLowerCase()==="file"&&(this.model.isFile=!0),h=this.template(),$(this.el).html(h(this.model)),o={sampleJSON:this.model.sampleJSON,isParam:!0,signature:this.model.signature},this.model.sampleJSON?(s=new i({model:o,tagName:"div"}),$(".model-signature",$(this.el)).append(s.render().el)):$(".model-signature",$(this.el)).html(this.model.signature),r=!1,this.model.isBody&&(r=!0),n={isParam:r},n.consumes=this.model.consumes,r?(u=new e({model:n}),$(".parameter-content-type",$(this.el)).append(u.render().el)):(f=new t({model:n}),$(".response-content-type",$(this.el)).append(f.render().el)),this},u.prototype.template=function(){return this.model.isList?Handlebars.templates.param_list:this.options.readOnly?this.model.required?Handlebars.templates.param_readonly_required:Handlebars.templates.param_readonly:this.model.required?Handlebars.templates.param_required:Handlebars.templates.param},u}(Backbone.View);i=function(t){function i(){return d=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.events={"click a.description-link":"switchToDescription","click a.snippet-link":"switchToSnippet","mousedown .snippet":"snippetToTextArea"},i.prototype.initialize=function(){},i.prototype.render=function(){var n;return n=this.template(),$(this.el).html(n(this.model)),this.switchToDescription(),this.isParam=this.model.isParam,this.isParam&&$(".notice",$(this.el)).text("Click to set as parameter value"),this},i.prototype.template=function(){return Handlebars.templates.signature},i.prototype.switchToDescription=function(n){return n!=null&&n.preventDefault(),$(".snippet",$(this.el)).hide(),$(".description",$(this.el)).show(),$(".description-link",$(this.el)).addClass("selected"),$(".snippet-link",$(this.el)).removeClass("selected")},i.prototype.switchToSnippet=function(n){return n!=null&&n.preventDefault(),$(".description",$(this.el)).hide(),$(".snippet",$(this.el)).show(),$(".snippet-link",$(this.el)).addClass("selected"),$(".description-link",$(this.el)).removeClass("selected")},i.prototype.snippetToTextArea=function(n){var t;if(this.isParam&&(n!=null&&n.preventDefault(),t=$("textarea",$(this.el.parentNode.parentNode.parentNode)),$.trim(t.val())===""))return t.val(this.model.sampleJSON)},i}(Backbone.View);tt=function(t){function i(){return g=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.initialize=function(){},i.prototype.render=function(){var n;return n=this.template(),$(this.el).html(n(this.model)),$("label[for=contentType]",$(this.el)).text("Response Content Type"),this},i.prototype.template=function(){return Handlebars.templates.content_type},i}(Backbone.View);t=function(t){function i(){return nt=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.initialize=function(){},i.prototype.render=function(){var n;return n=this.template(),$(this.el).html(n(this.model)),$("label[for=responseContentType]",$(this.el)).text("Response Content Type"),this},i.prototype.template=function(){return Handlebars.templates.response_content_type},i}(Backbone.View);e=function(t){function i(){return v=i.__super__.constructor.apply(this,arguments)}return n(i,t),i.prototype.initialize=function(){},i.prototype.render=function(){var n;return n=this.template(),$(this.el).html(n(this.model)),$("label[for=parameterContentType]",$(this.el)).text("Parameter content type:"),this},i.prototype.template=function(){return Handlebars.templates.parameter_content_type},i}(Backbone.View)}.call(this);hljs=new function(){function n(n){return n.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function h(n){for(var t=n.firstChild;t;t=t.nextSibling){if(t.nodeName=="CODE")return t;if(!(t.nodeType==3&&t.nodeValue.match(/\s+/)))break}}function f(n,t){return Array.prototype.map.call(n.childNodes,function(n){return n.nodeType==3?t?n.nodeValue.replace(/\n/g,""):n.nodeValue:n.nodeName=="BR"?"\n":f(n,t)}).join("")}function c(n){for(var i=(n.className+" "+n.parentNode.className).split(/\s+/),i=i.map(function(n){return n.replace(/^language-/,"")}),r=0;r<i.length;r++)if(t[i[r]]||i[r]=="no-highlight")return i[r]}function e(n){var t=[];return function i(n,r){for(var u=n.firstChild;u;u=u.nextSibling)u.nodeType==3?r+=u.nodeValue.length:u.nodeName=="BR"?r+=1:u.nodeType==1&&(t.push({event:"start",offset:r,node:u}),r=i(u,r),t.push({event:"stop",offset:r,node:u}));return r}(n,0),t}function l(t,i,r){function l(){return t.length&&i.length?t[0].offset!=i[0].offset?t[0].offset<i[0].offset?t:i:i[0].event=="start"?t:i:t.length?t:i}function c(t){function i(t){return" "+t.nodeName+'="'+n(t.value)+'"'}return"<"+t.nodeName+Array.prototype.map.call(t.attributes,i).join("")+">"}for(var s=0,o="",e=[],u,h,f;t.length||i.length;)if(u=l().splice(0,1)[0],o+=n(r.substr(s,u.offset-s)),s=u.offset,u.event=="start")o+=c(u.node),e.push(u.node);else if(u.event=="stop"){f=e.length;do f--,h=e[f],o+="<\/"+h.nodeName.toLowerCase()+">";while(h!=u.node);for(e.splice(f,1);f<e.length;)o+=c(e[f]),f++}return o+n(r.substr(s))}function a(n){function t(t,i){return RegExp(t,"m"+(n.cI?"i":"")+(i?"g":""))}function i(n,r){var o,s,e,f,u;if(!n.compiled){if(n.compiled=!0,o=[],n.k){s={};function h(n,t){t.split(" ").forEach(function(t){var i=t.split("|");s[i[0]]=[n,i[1]?Number(i[1]):1];o.push(i[0])})}if(n.lR=t(n.l||hljs.IR,!0),typeof n.k=="string")h("keyword",n.k);else for(e in n.k)n.k.hasOwnProperty(e)&&h(e,n.k[e]);n.k=s}for(r&&(n.bWK&&(n.b="\\b("+o.join("|")+")\\s"),n.bR=t(n.b?n.b:"\\B|\\b"),n.e||n.eW||(n.e="\\B|\\b"),n.e&&(n.eR=t(n.e)),n.tE=n.e||"",n.eW&&r.tE&&(n.tE+=(n.e?"|":"")+r.tE)),n.i&&(n.iR=t(n.i)),n.r===undefined&&(n.r=1),n.c||(n.c=[]),u=0;u<n.c.length;u++)n.c[u]=="self"&&(n.c[u]=n),i(n.c[u],n);for(n.starts&&i(n.starts,r),f=[],u=0;u<n.c.length;u++)f.push(n.c[u].b);n.tE&&f.push(n.tE);n.i&&f.push(n.i);n.t=f.length?t(f.join("|"),!0):{exec:function(){return null}}}}i(n)}function r(i,f){function nt(n,t){for(var r,i=0;i<t.c.length;i++)if(r=t.c[i].bR.exec(n),r&&r.index==0)return t.c[i]}function w(n,t){return n.e&&n.eR.test(t)?n:n.eW?w(n.parent,t):void 0}function tt(n,t){return t.i&&t.iR.test(n)}function it(n,t){var i=v.cI?t[0].toLowerCase():t[0];return n.k.hasOwnProperty(i)&&n.k[i]}function rt(){var i=n(o),r,u,t,f;if(!e.k)return i;for(r="",u=0,e.lR.lastIndex=0,t=e.lR.exec(i);t;)r+=i.substr(u,t.index-u),f=it(e,t),f?(p+=f[1],r+='<span class="'+f[0]+'">'+t[0]+"<\/span>"):r+=t[0],u=e.lR.lastIndex,t=e.lR.exec(i);return r+i.substr(u)}function ut(){if(e.sL&&!t[e.sL])return n(o);var i=e.sL?r(e.sL,o):u(o);return e.r>0&&(p+=i.keyword_count,y+=i.r),'<span class="'+i.language+'">'+i.value+"<\/span>"}function l(){return e.sL!==undefined?ut():rt()}function b(t,i){var r=t.cN?'<span class="'+t.cN+'">':"";t.rB?(s+=r,o=""):t.eB?(s+=n(i)+r,o=""):(s+=r,o=i);e=Object.create(t,{parent:{value:e}});y+=t.r}function k(t,i){var u,r;if(o+=t,i===undefined)return s+=l(),0;if(u=nt(i,e),u)return s+=l(),b(u,i),u.rB?0:i.length;if(r=w(e,i),r){r.rE||r.eE||(o+=i);s+=l();do e.cN&&(s+="<\/span>"),e=e.parent;while(e!=r.parent);return r.eE&&(s+=n(i)),o="",r.starts&&b(r.starts,""),r.rE?0:i.length}if(tt(i,e))throw"Illegal";return o+=i,i.length||1}var v=t[i],c,d,h;a(v);var e=v,o="",y=0,p=0,s="";try{for(h=0;;){if(e.t.lastIndex=h,c=e.t.exec(f),!c)break;d=k(f.substr(h,c.index-h),c[0]);h=c.index+d}return k(f.substr(h)),{r:y,keyword_count:p,value:s,language:i}}catch(g){if(g=="Illegal")return{r:0,keyword_count:0,value:n(f)};throw g;}}function u(i){var f={keyword_count:0,r:0,value:n(i)},e=f,o,u;for(o in t)t.hasOwnProperty(o)&&(u=r(o,i),u.language=o,u.keyword_count+u.r>e.keyword_count+e.r&&(e=u),u.keyword_count+u.r>f.keyword_count+f.r&&(e=f,f=u));return e.language&&(f.second_best=e),f}function o(n,t,i){return t&&(n=n.replace(/^((<[^>]+>|\t)+)/gm,function(n,i){return i.replace(/\t/g,t)})),i&&(n=n.replace(/\n/g,"<br>")),n}function s(n,t,i){var v=f(n,i),h=c(n),s,y,p,a;h!="no-highlight"&&(s=h?r(h,v):u(v),h=s.language,y=e(n),y.length&&(p=document.createElement("pre"),p.innerHTML=s.value,s.value=l(y,e(p),v)),s.value=o(s.value,t,i),a=n.className,a.match("(\\s|^)(language-)?"+h+"(\\s|$)")||(a=a?a+" "+h:h),n.innerHTML=s.value,n.className=a,n.result={language:h,kw:s.keyword_count,re:s.r},s.second_best&&(n.second_best={language:s.second_best.language,kw:s.second_best.keyword_count,re:s.second_best.r}))}function i(){i.called||(i.called=!0,Array.prototype.map.call(document.getElementsByTagName("pre"),h).filter(Boolean).forEach(function(n){s(n,hljs.tabReplace)}))}function v(){window.addEventListener("DOMContentLoaded",i,!1);window.addEventListener("load",i,!1)}var t={};this.LANGUAGES=t;this.highlight=r;this.highlightAuto=u;this.fixMarkup=o;this.highlightBlock=s;this.initHighlighting=i;this.initHighlightingOnLoad=v;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(n,t){var r={};for(var i in n)r[i]=n[i];if(t)for(i in t)r[i]=t[i];return r}};hljs.LANGUAGES.xml=function(){var n={eW:!0,c:[{cN:"attribute",b:"[A-Za-z0-9\\._:-]+",r:0},{b:'="',rB:!0,e:'"',c:[{cN:"value",b:'"',eW:!0}]},{b:"='",rB:!0,e:"'",c:[{cN:"value",b:"'",eW:!0}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:!0,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[n],starts:{e:"<\/style>",rE:!0,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[n],starts:{e:"<\/script>",rE:!0,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"<\/?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},n]}]}}(hljs);hljs.LANGUAGES.json=function(n){var i={literal:"true false null"},t=[n.QSM,n.CNM],r={cN:"value",e:",",eW:!0,eE:!0,c:t,k:i},u={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:!0,eE:!0,c:[n.BE],i:"\\n",starts:r}],i:"\\S"},f={b:"\\[",e:"\\]",c:[n.inherit(r,{cN:null})],i:"\\S"};return t.splice(t.length,0,u,f),{c:t,k:i,i:"\\S"}}(hljs),function(n,t){typeof define=="function"&&define.amd?define(["is"],function(i){return n.is=t(i)}):typeof exports=="object"?module.exports=t(require("is_js")):n.is=t(n.is)}(this,function(n){function u(n){return function(){return!n.apply(null,f.call(arguments))}}function y(t){return function(){var i=f.call(arguments),u=i.length,r;for(u===1&&n.array(i[0])&&(i=i[0],u=i.length),r=0;r<u;r++)if(!t.call(null,i[r]))return!1;return!0}}function p(t){return function(){var i=f.call(arguments),u=i.length,r;for(u===1&&n.array(i[0])&&(i=i[0],u=i.length),r=0;r<u;r++)if(t.call(null,i[r]))return!0;return!1}}function w(t,i){n[t]=function(n){return i[t].test(n)}}function b(){var f=n,t,r,i;for(t in f)if(e.call(f,t)&&n.function(f[t]))for(r=f[t].api||["not","all","any"],i=0;i<r.length;i++)r[i]==="not"&&(n.not[t]=u(n[t])),r[i]==="all"&&(n.all[t]=y(n[t])),r[i]==="any"&&(n.any[t]=p(n[t]))}var h=this||global,v=h.is,r,o,c,l;n={};n.VERSION="0.7.4";n.not={};n.all={};n.any={};var i=Object.prototype.toString,f=Array.prototype.slice,e=Object.prototype.hasOwnProperty;n.arguments=function(t){return n.not.null(t)&&(i.call(t)==="[object Arguments]"||typeof t=="object"&&"callee"in t)};n.array=Array.isArray||function(n){return i.call(n)==="[object Array]"};n.boolean=function(n){return n===!0||n===!1||i.call(n)==="[object Boolean]"};n.date=function(n){return i.call(n)==="[object Date]"};n.error=function(n){return i.call(n)==="[object Error]"};n.function=function(n){return i.call(n)==="[object Function]"||typeof n=="function"};n.nan=function(n){return n!==n};n.null=function(n){return n===null};n.number=function(t){return n.not.nan(t)&&i.call(t)==="[object Number]"};n.object=function(n){var t=typeof n;return t==="function"||t==="object"&&!!n};n.json=function(n){return i.call(n)==="[object Object]"};n.regexp=function(n){return i.call(n)==="[object RegExp]"};n.sameType=function(t,r){return n.nan(t)||n.nan(r)?n.nan(t)===n.nan(r):i.call(t)===i.call(r)};n.sameType.api=["not"];n.string=function(n){return i.call(n)==="[object String]"};n.char=function(t){return n.string(t)&&t.length===1};n.undefined=function(n){return n===void 0};n.empty=function(t){if(n.object(t)){var i=Object.getOwnPropertyNames(t).length;return i===0||i===1&&n.array(t)||i===2&&n.arguments(t)?!0:!1}return t===""};n.existy=function(n){return n!==null&&n!==undefined};n.truthy=function(t){return n.existy(t)&&t!==!1&&n.not.nan(t)&&t!==""&&t!==0};n.falsy=u(n.truthy);n.space=function(t){if(n.char(t)){var i=t.charCodeAt(0);return i>8&&i<14||i===32}return!1};n.equal=function(t,i){return n.all.number(t,i)?t===i&&1/t==1/i:n.all.string(t,i)||n.all.regexp(t,i)?""+t==""+i:n.all.boolean(t,i)?t===i:!1};n.equal.api=["not"];n.even=function(t){return n.number(t)&&t%2==0};n.odd=function(t){return n.number(t)&&t%2!=0};n.positive=function(t){return n.number(t)&&t>0};n.negative=function(t){return n.number(t)&&t<0};n.above=function(t,i){return n.all.number(t,i)&&t>i};n.above.api=["not"];n.under=function(t,i){return n.all.number(t,i)&&t<i};n.under.api=["not"];n.within=function(t,i,r){return n.all.number(t,i,r)&&t>i&&t<r};n.within.api=["not"];n.decimal=function(t){return n.number(t)&&t%1!=0};n.integer=function(t){return n.number(t)&&t%1==0};n.finite=isFinite||function(t){return t!==Infinity&&t!==-Infinity&&n.not.nan(t)};n.infinite=u(n.finite);r={url:/^(?:(?:https?|ftp):\/\/)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,})))(?::\d{2,5})?(?:\/\S*)?$/i,email:/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,creditCard:/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/,alphaNumeric:/^[A-Za-z0-9]+$/,timeString:/^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/,dateString:/^(1[0-2]|0?[1-9])\/(3[01]|[12][0-9]|0?[1-9])\/(?:[0-9]{2})?[0-9]{2}$/,usZipCode:/^[0-9]{5}(?:-[0-9]{4})?$/,caPostalCode:/^(?!.*[DFIOQU])[A-VXY][0-9][A-Z]\s?[0-9][A-Z][0-9]$/,ukPostCode:/^[A-Z]{1,2}[0-9RCHNQ][0-9A-Z]?\s?[0-9][ABD-HJLNP-UW-Z]{2}$|^[A-Z]{2}-?[0-9]{4}$/,nanpPhone:/^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,eppPhone:/^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/,socialSecurityNumber:/^(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$/,affirmative:/^(?:1|t(?:rue)?|y(?:es)?|ok(?:ay)?)$/,hexadecimal:/^[0-9a-fA-F]+$/,hexColor:/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,ipv4:/^(?:(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/,ipv6:/^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,ip:/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/};for(o in r)r.hasOwnProperty(o)&&w(o,r);if(n.include=function(n,t){return n.indexOf(t)>-1},n.include.api=["not"],n.upperCase=function(t){return n.string(t)&&t===t.toUpperCase()},n.lowerCase=function(t){return n.string(t)&&t===t.toLowerCase()},n.startWith=function(t,i){return n.string(t)&&t.indexOf(i)===0},n.startWith.api=["not"],n.endWith=function(t,i){return n.string(t)&&t.indexOf(i)>-1&&t.indexOf(i)===t.length-i.length},n.endWith.api=["not"],n.capitalized=function(t){var r,u,i;if(n.not.string(t))return!1;for(r=t.split(" "),u=[],i=0;i<r.length;i++)u.push(r[i][0]===r[i][0].toUpperCase());return n.all.truthy.apply(null,u)},n.palindrome=function(t){return n.string(t)&&t==t.split("").reverse().join("")},c=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],l=["january","february","march","april","may","june","july","august","september","october","november","december"],n.today=function(t){var i=new Date,r=i.toDateString();return n.date(t)&&t.toDateString()===r},n.yesterday=function(t){var i=new Date,r=new Date(i.setDate(i.getDate()-1)).toDateString();return n.date(t)&&t.toDateString()===r},n.tomorrow=function(t){var i=new Date,r=new Date(i.setDate(i.getDate()+1)).toDateString();return n.date(t)&&t.toDateString()===r},n.past=function(t){var i=new Date;return n.date(t)&&t.getTime()<i.getTime()},n.future=u(n.past),n.day=function(t,i){return n.date(t)&&i.toLowerCase()===c[t.getDay()]},n.day.api=["not"],n.month=function(t,i){return n.date(t)&&i.toLowerCase()===l[t.getMonth()]},n.month.api=["not"],n.year=function(t,i){return n.date(t)&&n.number(i)&&i===t.getFullYear()},n.year.api=["not"],n.leapYear=function(t){return n.number(t)&&(t%4==0&&t%100!=0||t%400==0)},n.weekend=function(t){return n.date(t)&&(t.getDay()===6||t.getDay()===0)},n.weekday=u(n.weekend),n.inDateRange=function(t,i,r){if(n.not.date(t)||n.not.date(i)||n.not.date(r))return!1;var u=t.getTime(),f=i.getTime(),e=r.getTime();return u>f&&u<e},n.inDateRange.api=["not"],n.inLastWeek=function(t){return n.inDateRange(t,new Date((new Date).setDate((new Date).getDate()-7)),new Date)},n.inLastMonth=function(t){return n.inDateRange(t,new Date((new Date).setMonth((new Date).getMonth()-1)),new Date)},n.inLastYear=function(t){return n.inDateRange(t,new Date((new Date).setFullYear((new Date).getFullYear()-1)),new Date)},n.inNextWeek=function(t){return n.inDateRange(t,new Date,new Date((new Date).setDate((new Date).getDate()+7)))},n.inNextMonth=function(t){return n.inDateRange(t,new Date,new Date((new Date).setMonth((new Date).getMonth()+1)))},n.inNextYear=function(t){return n.inDateRange(t,new Date,new Date((new Date).setFullYear((new Date).getFullYear()+1)))},n.quarterOfYear=function(t,i){return n.date(t)&&n.number(i)&&i===Math.floor((t.getMonth()+3)/3)},n.quarterOfYear.api=["not"],n.dayLightSavingTime=function(n){var t=new Date(n.getFullYear(),0,1),i=new Date(n.getFullYear(),6,1),r=Math.max(t.getTimezoneOffset(),i.getTimezoneOffset());return n.getTimezoneOffset()<r},typeof window!="undefined"){var t="navigator"in window&&"userAgent"in navigator&&navigator.userAgent.toLowerCase()||"",a="navigator"in window&&"vendor"in navigator&&navigator.vendor.toLowerCase()||"",s="navigator"in window&&"appVersion"in navigator&&navigator.appVersion.toLowerCase()||"";n.chrome=function(){return/chrome|chromium/i.test(t)&&/google inc/.test(a)};n.chrome.api=["not"];n.firefox=function(){return/firefox/i.test(t)};n.firefox.api=["not"];n.ie=function(n){return n?n>=11?"ActiveXObject"in window:new RegExp("msie "+n).test(t):/msie/i.test(t)||"ActiveXObject"in window};n.ie.api=["not"];n.opera=function(){return/^Opera\//.test(t)||/\x20OPR\//.test(t)};n.opera.api=["not"];n.safari=function(){return/safari/i.test(t)&&/apple computer/i.test(a)};n.safari.api=["not"];n.ios=function(){return n.iphone()||n.ipad()||n.ipod()};n.ios.api=["not"];n.iphone=function(){return/iphone/i.test(t)};n.iphone.api=["not"];n.ipad=function(){return/ipad/i.test(t)};n.ipad.api=["not"];n.ipod=function(){return/ipod/i.test(t)};n.ipod.api=["not"];n.android=function(){return/android/i.test(t)};n.android.api=["not"];n.androidPhone=function(){return/android/i.test(t)&&/mobile/i.test(t)};n.androidPhone.api=["not"];n.androidTablet=function(){return/android/i.test(t)&&!/mobile/i.test(t)};n.androidTablet.api=["not"];n.blackberry=function(){return/blackberry/i.test(t)||/BB10/i.test(t)};n.blackberry.api=["not"];n.desktop=function(){return n.not.mobile()&&n.not.tablet()};n.desktop.api=["not"];n.linux=function(){return/linux/i.test(s)};n.linux.api=["not"];n.mac=function(){return/mac/i.test(s)};n.mac.api=["not"];n.windows=function(){return/win/i.test(s)};n.windows.api=["not"];n.windowsPhone=function(){return n.windows()&&/phone/i.test(t)};n.windowsPhone.api=["not"];n.windowsTablet=function(){return n.windows()&&n.not.windowsPhone()&&/touch/i.test(t)};n.windowsTablet.api=["not"];n.mobile=function(){return n.iphone()||n.ipod()||n.androidPhone()||n.blackberry()||n.windowsPhone()};n.mobile.api=["not"];n.tablet=function(){return n.ipad()||n.androidTablet()||n.windowsTablet()};n.tablet.api=["not"];n.online=function(){return navigator.onLine};n.online.api=["not"];n.offline=u(n.online);n.offline.api=["not"];n.touchDevice=function(){return"ontouchstart"in window||"DocumentTouch"in window&&document instanceof DocumentTouch};n.touchDevice.api=["not"]}return n.propertyCount=function(t,i){if(!n.object(t)||!n.number(i))return!1;if(Object.keys)return Object.keys(t).length===i;var r=[];for(var u in t)e.call(t,u)&&r.push(u);return r.length===i},n.propertyCount.api=["not"],n.propertyDefined=function(t,i){return n.object(t)&&n.string(i)&&i in t},n.propertyDefined.api=["not"],n.windowObject=function(n){return typeof n=="object"&&"setInterval"in n},n.domNode=function(t){return n.object(t)&&t.nodeType>0},n.inArray=function(t,i){if(n.not.array(i))return!1;for(var r=0;r<i.length;r++)if(i[r]===t)return!0;return!1},n.inArray.api=["not"],n.sorted=function(t){if(n.not.array(t))return!1;for(var i=0;i<t.length;i++)if(t[i]>t[i+1])return!1;return!0},b(),n.setRegexp=function(n,t){for(var i in r)e.call(r,i)&&t===i&&(r[i]=n)},n.setNamespace=function(){return h.is=v,this},n})