if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(n){"use strict";var t=n.fn.jquery.split(" ")[0].split(".");if(t[0]<2&&t[1]<9||1==t[0]&&9==t[1]&&t[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher");}(jQuery);+function(n){"use strict";function t(){var i=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(void 0!==i.style[n])return{end:t[n]};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){"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));"string"==typeof i&&u[i].call(r)})}var i='[data-dismiss="alert"]',t=function(t){n(t).on("click",i,this.close)},r;t.VERSION="3.3.5";t.TRANSITION_DURATION=150;t.prototype.close=function(i){function e(){r.detach().trigger("closed.bs.alert").remove()}var f=n(this),u=f.attr("data-target"),r;u||(u=f.attr("href"),u=u&&u.replace(/.*(?=#[^\s]*$)/,""));r=n(u);i&&i.preventDefault();r.length||(r=f.closest(".alert"));r.trigger(i=n.Event("close.bs.alert"));i.isDefaultPrevented()||(r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e())};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="object"==typeof i&&i;r||u.data("bs.button",r=new t(this,f));"toggle"==i?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.3.5";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+="Text";null==u.resetText&&i.data("resetText",i[f]());setTimeout(n.proxy(function(){i[f](null==u[t]?this.options[t]:u[t]);"loadingText"==t?(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"),"radio"==n.prop("type")?(n.prop("checked")&&(t=!1),i.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==n.prop("type")&&(n.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),n.prop("checked",this.$element.hasClass("active")),t&&n.trigger("change")):(this.$element.attr("aria-pressed",!this.$element.hasClass("active")),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");n(t.target).is('input[type="radio"]')||n(t.target).is('input[type="checkbox"]')||t.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){n(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(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(),"object"==typeof i&&i),e="string"==typeof i?i:f.slide;r||u.data("bs.carousel",r=new t(this,f));"number"==typeof i?r.to(i):e?r[e]():f.interval&&r.pause().cycle()})}var t=function(t,i){this.$element=n(t);this.$indicators=this.$element.find(".carousel-indicators");this.options=i;this.paused=null;this.sliding=null;this.interval=null;this.$active=null;this.$items=null;this.options.keyboard&&this.$element.on("keydown.bs.carousel",n.proxy(this.keydown,this));"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",n.proxy(this.pause,this)).on("mouseleave.bs.carousel",n.proxy(this.cycle,this))},u,r;t.VERSION="3.3.5";t.TRANSITION_DURATION=600;t.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0};t.prototype.keydown=function(n){if(!/input|textarea/i.test(n.target.tagName)){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.getItemForDirection=function(n,t){var i=this.getItemIndex(t),f="prev"==n&&0===i||"next"==n&&i==this.$items.length-1,r,u;return f&&!this.options.wrap?t:(r="prev"==n?-1:1,u=(i+r)%this.$items.length,this.$items.eq(u))};t.prototype.to=function(n){var i=this,t=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(n>this.$items.length-1)&&!(0>n))return this.sliding?this.$element.one("slid.bs.carousel",function(){i.to(n)}):t==n?this.pause().cycle():this.slide(n>t?"next":"prev",this.$items.eq(n))};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(i,r){var e=this.$element.find(".item.active"),u=r||this.getItemForDirection(i,e),l=this.interval,f="next"==i?"left":"right",a=this,o,s,h,c;return u.hasClass("active")?this.sliding=!1:(o=u[0],s=n.Event("slide.bs.carousel",{relatedTarget:o,direction:f}),(this.$element.trigger(s),!s.isDefaultPrevented())?((this.sliding=!0,l&&this.pause(),this.$indicators.length)&&(this.$indicators.find(".active").removeClass("active"),h=n(this.$indicators.children()[this.getItemIndex(u)]),h&&h.addClass("active")),c=n.Event("slid.bs.carousel",{relatedTarget:o,direction:f}),n.support.transition&&this.$element.hasClass("slide")?(u.addClass(i),u[0].offsetWidth,e.addClass(f),u.addClass(f),e.one("bsTransitionEnd",function(){u.removeClass([i,f].join(" ")).addClass("active");e.removeClass(["active",f].join(" "));a.sliding=!1;setTimeout(function(){a.$element.trigger(c)},0)}).emulateTransitionEnd(t.TRANSITION_DURATION)):(e.removeClass("active"),u.addClass("active"),this.sliding=!1,this.$element.trigger(c)),l&&this.cycle(),this):void 0)};u=n.fn.carousel;n.fn.carousel=i;n.fn.carousel.Constructor=t;n.fn.carousel.noConflict=function(){return n.fn.carousel=u,this};r=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(document).on("click.bs.carousel.data-api","[data-slide]",r).on("click.bs.carousel.data-api","[data-slide-to]",r);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 r(t){var i,r=t.attr("data-target")||(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"");return n(r)}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.collapse"),f=n.extend({},t.DEFAULTS,u.data(),"object"==typeof i&&i);!r&&f.toggle&&/show|hide/.test(i)&&(f.toggle=!1);r||u.data("bs.collapse",r=new t(this,f));"string"==typeof i&&r[i]()})}var t=function(i,r){this.$element=n(i);this.options=n.extend({},t.DEFAULTS,r);this.$trigger=n('[data-toggle="collapse"][href="#'+i.id+'"],[data-toggle="collapse"][data-target="#'+i.id+'"]');this.transitioning=null;this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger);this.options.toggle&&this.toggle()},u;t.VERSION="3.3.5";t.TRANSITION_DURATION=350;t.DEFAULTS={toggle:!0};t.prototype.dimension=function(){var n=this.$element.hasClass("width");return n?"width":"height"};t.prototype.show=function(){var f,r,e,u,o,s;if(!this.transitioning&&!this.$element.hasClass("in")&&(r=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing"),!(r&&r.length&&(f=r.data("bs.collapse"),f&&f.transitioning))&&(e=n.Event("show.bs.collapse"),this.$element.trigger(e),!e.isDefaultPrevented()))){if(r&&r.length&&(i.call(r,"hide"),f||r.data("bs.collapse",null)),u=this.dimension(),this.$element.removeClass("collapse").addClass("collapsing")[u](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1,o=function(){this.$element.removeClass("collapsing").addClass("collapse in")[u]("");this.transitioning=0;this.$element.trigger("shown.bs.collapse")},!n.support.transition)return o.call(this);s=n.camelCase(["scroll",u].join("-"));this.$element.one("bsTransitionEnd",n.proxy(o,this)).emulateTransitionEnd(t.TRANSITION_DURATION)[u](this.$element[0][s])}};t.prototype.hide=function(){var r,i,u;if(!this.transitioning&&this.$element.hasClass("in")&&(r=n.Event("hide.bs.collapse"),this.$element.trigger(r),!r.isDefaultPrevented()))return i=this.dimension(),this.$element[i](this.$element[i]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1,u=function(){this.transitioning=0;this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")},n.support.transition?void this.$element[i](0).one("bsTransitionEnd",n.proxy(u,this)).emulateTransitionEnd(t.TRANSITION_DURATION):u.call(this)};t.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};t.prototype.getParent=function(){return n(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(n.proxy(function(t,i){var u=n(i);this.addAriaAndCollapsedClass(r(u),u)},this)).end()};t.prototype.addAriaAndCollapsedClass=function(n,t){var i=n.hasClass("in");n.attr("aria-expanded",i);t.toggleClass("collapsed",!i).attr("aria-expanded",i)};u=n.fn.collapse;n.fn.collapse=i;n.fn.collapse.Constructor=t;n.fn.collapse.noConflict=function(){return n.fn.collapse=u,this};n(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var u=n(this);u.attr("data-target")||t.preventDefault();var f=r(u),e=f.data("bs.collapse"),o=e?"toggle":u.data();i.call(f,o)})}(jQuery);+function(n){"use strict";function r(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 u(t){t&&3===t.which||(n(o).remove(),n(i).each(function(){var u=n(this),i=r(u),f={relatedTarget:this};i.hasClass("open")&&(t&&"click"==t.type&&/input|textarea/i.test(t.target.tagName)&&n.contains(i[0],t.target)||(i.trigger(t=n.Event("hide.bs.dropdown",f)),t.isDefaultPrevented()||(u.attr("aria-expanded","false"),i.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function e(i){return this.each(function(){var r=n(this),u=r.data("bs.dropdown");u||r.data("bs.dropdown",u=new t(this));"string"==typeof i&&u[i].call(r)})}var o=".dropdown-backdrop",i='[data-toggle="dropdown"]',t=function(t){n(t).on("click.bs.dropdown",this.toggle)},f;t.VERSION="3.3.5";t.prototype.toggle=function(t){var f=n(this),i,o,e;if(!f.is(".disabled, :disabled")){if(i=r(f),o=i.hasClass("open"),u(),!o){if("ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&n(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(n(this)).on("click",u),e={relatedTarget:this},i.trigger(t=n.Event("show.bs.dropdown",e)),t.isDefaultPrevented())return;f.trigger("focus").attr("aria-expanded","true");i.toggleClass("open").trigger("shown.bs.dropdown",e)}return!1}};t.prototype.keydown=function(t){var e,o,s,h,f,u;if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)&&(e=n(this),t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled"))){if(o=r(e),s=o.hasClass("open"),!s&&27!=t.which||s&&27==t.which)return 27==t.which&&o.find(i).trigger("focus"),e.trigger("click");h=" li:not(.disabled):visible a";f=o.find(".dropdown-menu"+h);f.length&&(u=f.index(t.target),38==t.which&&u>0&&u--,40==t.which&&u<f.length-1&&u++,~u||(u=0),f.eq(u).trigger("focus"))}};f=n.fn.dropdown;n.fn.dropdown=e;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",i,t.prototype.toggle).on("keydown.bs.dropdown.data-api",i,t.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",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(),"object"==typeof i&&i);u||f.data("bs.modal",u=new t(this,e));"string"==typeof i?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.$dialog=this.$element.find(".modal-dialog");this.$backdrop=null;this.isShown=null;this.originalBodyPad=null;this.scrollbarWidth=0;this.ignoreBackdropClick=!1;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.3.5";t.TRANSITION_DURATION=300;t.BACKDROP_TRANSITION_DURATION=150;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(i){var r=this,u=n.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(u);this.isShown||u.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',n.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){r.$element.one("mouseup.dismiss.bs.modal",function(t){n(t.target).is(r.$element)&&(r.ignoreBackdropClick=!0)})}),this.backdrop(function(){var f=n.support.transition&&r.$element.hasClass("fade"),u;r.$element.parent().length||r.$element.appendTo(r.$body);r.$element.show().scrollTop(0);r.adjustDialog();f&&r.$element[0].offsetWidth;r.$element.addClass("in");r.enforceFocus();u=n.Event("shown.bs.modal",{relatedTarget:i});f?r.$dialog.one("bsTransitionEnd",function(){r.$element.trigger("focus").trigger(u)}).emulateTransitionEnd(t.TRANSITION_DURATION):r.$element.trigger("focus").trigger(u)}))};t.prototype.hide=function(i){i&&i.preventDefault();i=n.Event("hide.bs.modal");this.$element.trigger(i);this.isShown&&!i.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),n(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),n.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",n.proxy(this.hideModal,this)).emulateTransitionEnd(t.TRANSITION_DURATION):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(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",n.proxy(function(n){27==n.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")};t.prototype.resize=function(){this.isShown?n(window).on("resize.bs.modal",n.proxy(this.handleUpdate,this)):n(window).off("resize.bs.modal")};t.prototype.hideModal=function(){var n=this;this.$element.hide();this.backdrop(function(){n.$body.removeClass("modal-open");n.resetAdjustments();n.resetScrollbar();n.$element.trigger("hidden.bs.modal")})};t.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove();this.$backdrop=null};t.prototype.backdrop=function(i){var e=this,f=this.$element.hasClass("fade")?"fade":"",r,u;if(this.isShown&&this.options.backdrop){if(r=n.support.transition&&f,this.$backdrop=n(document.createElement("div")).addClass("modal-backdrop "+f).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",n.proxy(function(n){return this.ignoreBackdropClick?void(this.ignoreBackdropClick=!1):void(n.target===n.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide()))},this)),r&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!i)return;r?this.$backdrop.one("bsTransitionEnd",i).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):i()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),u=function(){e.removeBackdrop();i&&i()},n.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",u).emulateTransitionEnd(t.BACKDROP_TRANSITION_DURATION):u()):i&&i()};t.prototype.handleUpdate=function(){this.adjustDialog()};t.prototype.adjustDialog=function(){var n=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&n?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!n?this.scrollbarWidth:""})};t.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})};t.prototype.checkScrollbar=function(){var n=window.innerWidth,t;n||(t=document.documentElement.getBoundingClientRect(),n=t.right-Math.abs(t.left));this.bodyIsOverflowing=document.body.clientWidth<n;this.scrollbarWidth=this.measureScrollbar()};t.prototype.setScrollbar=function(){var n=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";this.bodyIsOverflowing&&this.$body.css("padding-right",n+this.scrollbarWidth)};t.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad)};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){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="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("bs.tooltip",r=new t(this,f)),"string"==typeof i&&r[i]())})}var t=function(n,t){this.type=null;this.options=null;this.enabled=null;this.timeout=null;this.hoverState=null;this.$element=null;this.inState=null;this.init("tooltip",n,t)},i;t.VERSION="3.3.5";t.TRANSITION_DURATION=150;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;if(this.enabled=!0,this.type=t,this.$element=n(i),this.options=this.getOptions(r),this.$viewport=this.options.viewport&&n(n.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(f=this.options.trigger.split(" "),e=f.length;e--;)if(u=f[e],"click"==u)this.$element.on("click."+this.type,this.options.selector,n.proxy(this.toggle,this));else"manual"!=u&&(o="hover"==u?"mouseenter":"focusin",s="hover"==u?"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&&"number"==typeof t.delay&&(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);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusin"==t.type?"focus":"hover"]=!0),i.tip().hasClass("in")||"in"==i.hoverState?void(i.hoverState="in"):(clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show())};t.prototype.isInStateTrue=function(){for(var n in this.inState)if(this.inState[n])return!0;return!1};t.prototype.leave=function(t){var i=t instanceof this.constructor?t:n(t.currentTarget).data("bs."+this.type);return i||(i=new this.constructor(t.currentTarget,this.getDelegateOptions()),n(t.currentTarget).data("bs."+this.type,i)),t instanceof n.Event&&(i.inState["focusout"==t.type?"focus":"hover"]=!1),i.isInStateTrue()?void 0:(clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide())};t.prototype.show=function(){var c=n.Event("show.bs."+this.type),l,p,e,w,h;if(this.hasContent()&&this.enabled){if(this.$element.trigger(c),l=n.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]),c.isDefaultPrevented()||!l)return;var u=this,r=this.tip(),a=this.getUID(this.type);this.setContent();r.attr("id",a);this.$element.attr("aria-describedby",a);this.options.animation&&r.addClass("fade");var i="function"==typeof this.options.placement?this.options.placement.call(this,r[0],this.$element[0]):this.options.placement,v=/\s?auto?\s?/i,y=v.test(i);y&&(i=i.replace(v,"")||"top");r.detach().css({top:0,left:0,display:"block"}).addClass(i).data("bs."+this.type,this);this.options.container?r.appendTo(this.options.container):r.insertAfter(this.$element);this.$element.trigger("inserted.bs."+this.type);var f=this.getPosition(),o=r[0].offsetWidth,s=r[0].offsetHeight;y&&(p=i,e=this.getPosition(this.$viewport),i="bottom"==i&&f.bottom+s>e.bottom?"top":"top"==i&&f.top-s<e.top?"bottom":"right"==i&&f.right+o>e.width?"left":"left"==i&&f.left-o<e.left?"right":i,r.removeClass(p).addClass(i));w=this.getCalculatedOffset(i,f,o,s);this.applyPlacement(w,i);h=function(){var n=u.hoverState;u.$element.trigger("shown.bs."+u.type);u.hoverState=null;"out"==n&&u.leave(u)};n.support.transition&&this.$tip.hasClass("fade")?r.one("bsTransitionEnd",h).emulateTransitionEnd(t.TRANSITION_DURATION):h()}};t.prototype.applyPlacement=function(t,i){var r=this.tip(),l=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+=o;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;"top"==i&&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 c=/top|bottom/.test(i),a=c?2*u.left-l+h:2*u.top-e+f,v=c?"offsetWidth":"offsetHeight";r.offset(t);this.replaceArrow(a,r[0][v],c)};t.prototype.replaceArrow=function(n,t,i){this.arrow().css(i?"left":"top",50*(1-n/t)+"%").css(i?"top":"left","")};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(i){function f(){"in"!=u.hoverState&&r.detach();u.$element.removeAttr("aria-describedby").trigger("hidden.bs."+u.type);i&&i()}var u=this,r=n(this.$tip),e=n.Event("hide.bs."+this.type);return this.$element.trigger(e),e.isDefaultPrevented()?void 0:(r.removeClass("in"),n.support.transition&&r.hasClass("fade")?r.one("bsTransitionEnd",f).emulateTransitionEnd(t.TRANSITION_DURATION):f(),this.hoverState=null,this)};t.prototype.fixTitle=function(){var n=this.$element;(n.attr("title")||"string"!=typeof n.attr("data-original-title"))&&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 u=t[0],r="BODY"==u.tagName,i=u.getBoundingClientRect();null==i.width&&(i=n.extend({},i,{width:i.right-i.left,height:i.bottom-i.top}));var f=r?{top:0,left:0}:t.offset(),e={scroll:r?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},o=r?{width:n(window).width(),height:n(window).height()}:null;return n.extend({},i,e,o,f)};t.prototype.getCalculatedOffset=function(n,t,i,r){return"bottom"==n?{top:t.top+t.height,left:t.left+t.width/2-i/2}:"top"==n?{top:t.top-r,left:t.left+t.width/2-i/2}:"left"==n?{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.right&&(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")||("function"==typeof n.title?n.title.call(t[0]):n.title)};t.prototype.getUID=function(n){do n+=~~(1e6*Math.random());while(document.getElementById(n));return n};t.prototype.tip=function(){if(!this.$tip&&(this.$tip=n(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")};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)));t?(i.inState.click=!i.inState.click,i.isInStateTrue()?i.enter(i):i.leave(i)):i.tip().hasClass("in")?i.leave(i):i.enter(i)};t.prototype.destroy=function(){var n=this;clearTimeout(this.timeout);this.hide(function(){n.$element.off("."+n.type).removeData("bs."+n.type);n.$tip&&n.$tip.detach();n.$tip=null;n.$arrow=null;n.$viewport=null})};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="object"==typeof i&&i;(r||!/destroy|hide/.test(i))&&(r||u.data("bs.popover",r=new t(this,f)),"string"==typeof i&&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.3.5";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").children().detach().end()[this.options.html?"string"==typeof t?"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")||("function"==typeof n.content?n.content.call(t[0]):n.content)};t.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};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){this.$body=n(document.body);this.$scrollElement=n(n(i).is(document.body)?window: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",n.proxy(this.process,this));this.refresh();this.process()}function i(i){return this.each(function(){var u=n(this),r=u.data("bs.scrollspy"),f="object"==typeof i&&i;r||u.data("bs.scrollspy",r=new t(this,f));"string"==typeof i&&r[i]()})}t.VERSION="3.3.5";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 t=this,i="offset",r=0;this.offsets=[];this.targets=[];this.scrollHeight=this.getScrollHeight();n.isWindow(this.$scrollElement[0])||(i="position",r=this.$scrollElement.scrollTop());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 n,i=this.$scrollElement.scrollTop()+this.options.offset,f=this.getScrollHeight(),e=this.options.offset+f-this.$scrollElement.height(),t=this.offsets,r=this.targets,u=this.activeTarget;if(this.scrollHeight!=f&&this.refresh(),i>=e)return u!=(n=r[r.length-1])&&this.activate(n);if(u&&i<t[0])return this.activeTarget=null,this.clear();for(n=t.length;n--;)u!=r[n]&&i>=t[n]&&(void 0===t[n+1]||i<t[n+1])&&this.activate(r[n])};t.prototype.activate=function(t){this.activeTarget=t;this.clear();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")};t.prototype.clear=function(){n(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};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 r(i){return this.each(function(){var u=n(this),r=u.data("bs.tab");r||u.data("bs.tab",r=new t(this));"string"==typeof i&&r[i]()})}var t=function(t){this.element=n(t)},u,i;t.VERSION="3.3.5";t.TRANSITION_DURATION=150;t.prototype.show=function(){var t=this.element,f=t.closest("ul:not(.dropdown-menu)"),i=t.data("target"),u;if(i||(i=t.attr("href"),i=i&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var r=f.find(".active:last a"),e=n.Event("hide.bs.tab",{relatedTarget:t[0]}),o=n.Event("show.bs.tab",{relatedTarget:r[0]});(r.trigger(e),t.trigger(o),o.isDefaultPrevented()||e.isDefaultPrevented())||(u=n(i),this.activate(t.closest("li"),f),this.activate(u,u.parent(),function(){r.trigger({type:"hidden.bs.tab",relatedTarget:t[0]});t.trigger({type:"shown.bs.tab",relatedTarget:r[0]})}))}};t.prototype.activate=function(i,r,u){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1);i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0);o?(i[0].offsetWidth,i.addClass("in")):i.removeClass("fade");i.parent(".dropdown-menu").length&&i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0);u&&u()}var f=r.find("> .active"),o=u&&n.support.transition&&(f.length&&f.hasClass("fade")||!!r.find("> .fade").length);f.length&&o?f.one("bsTransitionEnd",e).emulateTransitionEnd(t.TRANSITION_DURATION):e();f.removeClass("in")};u=n.fn.tab;n.fn.tab=r;n.fn.tab.Constructor=t;n.fn.tab.noConflict=function(){return n.fn.tab=u,this};i=function(t){t.preventDefault();r.call(n(this),"show")};n(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery);+function(n){"use strict";function i(i){return this.each(function(){var u=n(this),r=u.data("bs.affix"),f="object"==typeof i&&i;r||u.data("bs.affix",r=new t(this,f));"string"==typeof i&&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=null;this.unpin=null;this.pinnedOffset=null;this.checkPosition()},r;t.VERSION="3.3.5";t.RESET="affix affix-top affix-bottom";t.DEFAULTS={offset:0,target:window};t.prototype.getState=function(n,t,i,r){var u=this.$target.scrollTop(),f=this.$element.offset(),e=this.$target.height();if(null!=i&&"top"==this.affixed)return i>u?"top":!1;if("bottom"==this.affixed)return null!=i?u+this.unpin<=f.top?!1:"bottom":n-r>=u+e?!1:"bottom";var o=null==this.affixed,s=o?u:f.top,h=o?e:t;return null!=i&&i>=u?"top":null!=r&&s+h>=n-r?"bottom":!1};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=this.$element.height(),r=this.options.offset,f=r.top,u=r.bottom,h=Math.max(n(document).height(),n(document.body).height());if("object"!=typeof r&&(u=f=r),"function"==typeof f&&(f=r.top(this.$element)),"function"==typeof u&&(u=r.bottom(this.$element)),i=this.getState(h,s,f,u),this.affixed!=i){if(null!=this.unpin&&this.$element.css("top",""),e="affix"+(i?"-"+i:""),o=n.Event(e+".bs.affix"),this.$element.trigger(o),o.isDefaultPrevented())return;this.affixed=i;this.unpin="bottom"==i?this.getPinnedOffset():null;this.$element.removeClass(t.RESET).addClass(e).trigger(e.replace("affix","affixed")+".bs.affix")}"bottom"==i&&this.$element.offset({top:h-s-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||{};null!=t.offsetBottom&&(t.offset.bottom=t.offsetBottom);null!=t.offsetTop&&(t.offset.top=t.offsetTop);i.call(r,t)})})}(jQuery);window.matchMedia=window.matchMedia||function(n){var u,i=n.documentElement,f=i.firstElementChild||i.firstChild,r=n.createElement("body"),t=n.createElement("div");return t.id="mq-test-1",t.style.cssText="position:absolute;top:-100em",r.style.background="none",r.appendChild(t),function(n){return t.innerHTML='&shy;<style media="'+n+'"> #mq-test-1 { width: 42px; }<\/style>',i.insertBefore(r,f),u=t.offsetWidth==42,i.removeChild(r),{matches:u,media:n}}}(document),function(n){function d(){a(!0)}if(n.respond={},respond.update=function(){},respond.mediaQueriesSupported=n.matchMedia&&n.matchMedia("only all").matches,!respond.mediaQueriesSupported){var t=n.document,i=t.documentElement,e=[],u=[],r=[],o={},v=30,f=t.getElementsByTagName("head")[0]||i,g=t.getElementsByTagName("base")[0],s=f.getElementsByTagName("link"),h=[],y=function(){for(var f=s,c=f.length,r=0,t,i,u,e;r<c;r++)t=f[r],i=t.href,u=t.media,e=t.rel&&t.rel.toLowerCase()==="stylesheet",!i||!e||o[i]||(t.styleSheet&&t.styleSheet.rawCssText?(w(t.styleSheet.rawCssText,i,u),o[i]=!0):(/^([a-zA-Z:]*\/\/)/.test(i)||g)&&i.replace(RegExp.$1,"").split("/")[0]!==n.location.host||h.push({href:i,media:u}));p()},p=function(){if(h.length){var n=h.shift();nt(n.href,function(t){w(t,n.href,n.media);o[n.href]=!0;p()})}},w=function(n,t,i){var o=n.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),s=o&&o.length||0,t=t.substring(0,t.lastIndexOf("/")),v=function(n){return n.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+t+"$2$3")},y=!s&&i,h=0,f,c,r,l,p;for(t.length&&(t+="/"),y&&(s=1);h<s;h++)for(f=0,y?(c=i,u.push(v(n))):(c=o[h].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1,u.push(RegExp.$2&&v(RegExp.$2))),l=c.split(","),p=l.length;f<p;f++)r=l[f],e.push({media:r.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:u.length-1,hasquery:r.indexOf("(")>-1,minw:r.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:r.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")});a()},c,b,k=function(){var u,r=t.createElement("div"),n=t.body,f=!1;return r.style.cssText="position:absolute;font-size:1em;width:1em",n||(n=f=t.createElement("body"),n.style.background="none"),n.appendChild(r),i.insertBefore(n,i.firstChild),u=r.offsetWidth,f?i.removeChild(n):n.removeChild(r),l=parseFloat(u)},l,a=function(n){var nt="clientWidth",tt=i[nt],it=t.compatMode==="CSS1Compat"&&tt||t.body[nt]||tt,d={},ot=s[s.length-1],rt=(new Date).getTime(),o,h,g;if(n&&c&&rt-c<v){clearTimeout(b);b=setTimeout(a,v);return}c=rt;for(o in e){var y=e[o],p=y.minw,w=y.maxw,ut=p===null,ft=w===null,et="em";!p||(p=parseFloat(p)*(p.indexOf(et)>-1?l||k():1));!w||(w=parseFloat(w)*(w.indexOf(et)>-1?l||k():1));y.hasquery&&(ut&&ft||!(ut||it>=p)||!(ft||it<=w))||(d[y.media]||(d[y.media]=[]),d[y.media].push(u[y.rules]))}for(o in r)r[o]&&r[o].parentNode===f&&f.removeChild(r[o]);for(o in d)h=t.createElement("style"),g=d[o].join("\n"),h.type="text/css",h.media=o,f.insertBefore(h,ot.nextSibling),h.styleSheet?h.styleSheet.cssText=g:h.appendChild(t.createTextNode(g)),r.push(h)},nt=function(n,t){var i=tt();i&&(i.open("GET",n,!0),i.onreadystatechange=function(){i.readyState==4&&(i.status==200||i.status==304)&&t(i.responseText)},i.readyState!=4)&&i.send(null)},tt=function(){var n=!1;try{n=new XMLHttpRequest}catch(t){n=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return n}}();y();respond.update=y;n.addEventListener?n.addEventListener("resize",d,!1):n.attachEvent&&n.attachEvent("onresize",d)}}(this);!function(n){var u="0.9.3",t={isMsie:function(){var n=/(msie) ([\w.]+)/i.exec(navigator.userAgent);return n?parseInt(n[2],10):!1},isBlankString:function(n){return!n||/^\s*$/.test(n)},escapeRegExChars:function(n){return n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")},isString:function(n){return"string"==typeof n},isNumber:function(n){return"number"==typeof n},isArray:n.isArray,isFunction:n.isFunction,isObject:n.isPlainObject,isUndefined:function(n){return"undefined"==typeof n},bind:n.proxy,bindAll:function(t){var r,i;for(i in t)n.isFunction(r=t[i])&&(t[i]=n.proxy(r,t))},indexOf:function(n,t){for(var i=0;i<n.length;i++)if(n[i]===t)return i;return-1},each:n.each,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++}}(),defer:function(n){setTimeout(n,0)},debounce:function(n,t,i){var r,u;return function(){var f,e,o=this,s=arguments;return f=function(){r=null;i||(u=n.apply(o,s))},e=i&&!r,clearTimeout(r),r=setTimeout(f,t),e&&(u=n.apply(o,s)),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,0>=h?(clearTimeout(i),i=null,r=s,e=n.apply(u,f)):i||(i=setTimeout(o,h)),e}},tokenizeQuery:function(t){return n.trim(t).toLowerCase().split(/[\s]+/)},tokenizeText:function(t){return n.trim(t).toLowerCase().split(/[\s\-_]+/)},getProtocol:function(){return location.protocol},noop:function(){}},i=function(){var n=/\s+/;return{on:function(t,i){var r;if(!i)return this;for(this._callbacks=this._callbacks||{},t=t.split(n);r=t.shift();)this._callbacks[r]=this._callbacks[r]||[],this._callbacks[r].push(i);return this},trigger:function(t,i){var u,f,r;if(!this._callbacks)return this;for(t=t.split(n);u=t.shift();)if(f=this._callbacks[u])for(r=0;r<f.length;r+=1)f[r].call(this,{type:u,data:i});return this}}}(),r=function(){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}(),f=function(){function i(n){this.prefix=["__",n,"__"].join("");this.ttlKey="__ttl__";this.keyMatcher=new RegExp("^"+this.prefix)}function r(){return(new Date).getTime()}function u(n){return JSON.stringify(t.isUndefined(n)?null:n)}function f(n){return JSON.parse(n)}var n,e;try{n=window.localStorage;n.setItem("~~~","!");n.removeItem("~~~")}catch(o){n=null}return e=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),f(n.getItem(this._prefix(t)))},set:function(i,f,e){return t.isNumber(e)?n.setItem(this._ttlKey(i),u(r()+e)):n.removeItem(this._ttlKey(i)),n.setItem(this._prefix(i),u(f))},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;u>t;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 u=f(n.getItem(this._ttlKey(i)));return t.isNumber(u)&&r()>u?!0:!1}}:{get:t.noop,set:t.noop,remove:t.noop,clear:t.noop,isExpired:t.noop},t.mixin(i.prototype,e),i}(),e=function(){function n(n){t.bindAll(this);n=n||{};this.sizeLimit=n.sizeLimit||10;this.cache={};this.cachedKeysByAge=[]}return t.mixin(n.prototype,{get:function(n){return this.cache[n]},set:function(n,t){var i;this.cachedKeysByAge.length===this.sizeLimit&&(i=this.cachedKeysByAge.shift(),delete this.cache[i]);this.cache[n]=t;this.cachedKeysByAge.push(n)}}),n}(),o=function(){function o(n){t.bindAll(this);n=t.isString(n)?{url:n}:n;i=i||new e;r=t.isNumber(n.maxParallelRequests)?n.maxParallelRequests:r||6;this.url=n.url;this.wildcard=n.wildcard||"%QUERY";this.filter=n.filter;this.replace=n.replace;this.ajaxSettings={type:"get",cache:n.cache,timeout:n.timeout,dataType:n.dataType||"json",beforeSend:n.beforeSend};this._get=(/^throttle$/i.test(n.rateLimitFn)?t.throttle:t.debounce)(this._get,n.rateLimitWait||300)}function s(){u++}function h(){u--}function c(){return r>u}var r,i,u=0,f={};return t.mixin(o.prototype,{_get:function(n,t){function u(u){var f=r.filter?r.filter(u):u;t&&t(f);i.set(n,u)}var r=this;c()?this._sendRequest(n).done(u):this.onDeckRequestArgs=[].slice.call(arguments,0)},_sendRequest:function(t){function u(){h();f[t]=null;i.onDeckRequestArgs&&(i._get.apply(i,i.onDeckRequestArgs),i.onDeckRequestArgs=null)}var i=this,r=f[t];return r||(s(),r=f[t]=n.ajax(t,this.ajaxSettings).always(u)),r},get:function(n,r){var f,u,e=this,o=encodeURIComponent(n||"");return r=r||t.noop,f=this.replace?this.replace(this.url,o):this.url.replace(this.wildcard,o),(u=i.get(f))?t.defer(function(){r(e.filter?e.filter(u):u)}):this._get(f,r),!!u}}),o}(),s=function(){function r(i){t.bindAll(this);t.isString(i.template)&&!i.engine&&n.error("no template engine specified");i.local||i.prefetch||i.remote||n.error("one of local, prefetch, or remote is required");this.name=i.name||t.getUniqueId();this.limit=i.limit||5;this.minLength=i.minLength||1;this.header=i.header;this.footer=i.footer;this.valueKey=i.valueKey||"value";this.template=e(i.template,i.engine,this.valueKey);this.local=i.local;this.prefetch=i.prefetch;this.remote=i.remote;this.itemHash={};this.adjacencyList={};this.storage=i.name?new f(i.name):null}function e(n,i,r){var u,f;return t.isFunction(n)?u=n:t.isString(n)?(f=i.compile(n),u=t.bind(f.render,f)):u=function(n){return"<p>"+n[r]+"<\/p>"},u}var i={thumbprint:"thumbprint",protocol:"protocol",itemHash:"itemHash",adjacencyList:"adjacencyList"};return t.mixin(r.prototype,{_processLocalData:function(n){this._mergeProcessedData(this._processData(n))},_loadPrefetchData:function(r){function v(n){var e=r.filter?r.filter(n):n,u=f._processData(e),o=u.itemHash,s=u.adjacencyList;f.storage&&(f.storage.set(i.itemHash,o,r.ttl),f.storage.set(i.adjacencyList,s,r.ttl),f.storage.set(i.thumbprint,a,r.ttl),f.storage.set(i.protocol,t.getProtocol(),r.ttl));f._mergeProcessedData(u)}var h,c,e,o,l,s,f=this,a=u+(r.thumbprint||"");return this.storage&&(h=this.storage.get(i.thumbprint),c=this.storage.get(i.protocol),e=this.storage.get(i.itemHash),o=this.storage.get(i.adjacencyList)),l=h!==a||c!==t.getProtocol(),r=t.isString(r)?{url:r}:r,r.ttl=t.isNumber(r.ttl)?r.ttl:864e5,e&&o&&!l?(this._mergeProcessedData({itemHash:e,adjacencyList:o}),s=n.Deferred().resolve()):s=n.getJSON(r.url).done(v),s},_transformDatum:function(n){var r=t.isString(n)?n:n[this.valueKey],u=n.tokens||t.tokenizeText(r),i={value:r,tokens:u};return t.isString(n)?(i.datum={},i.datum[this.valueKey]=n):i.datum=n,i.tokens=t.filter(i.tokens,function(n){return!t.isBlankString(n)}),i.tokens=t.map(i.tokens,function(n){return n.toLowerCase()}),i},_processData:function(n){var u=this,r={},i={};return t.each(n,function(n,f){var o=u._transformDatum(f),e=t.getUniqueId(o.value);r[e]=o;t.each(o.tokens,function(n,r){var u=r.charAt(0),f=i[u]||(i[u]=[e]);~t.indexOf(f,e)||f.push(e)})}),{itemHash:r,adjacencyList:i}},_mergeProcessedData:function(n){var i=this;t.mixin(this.itemHash,n.itemHash);t.each(n.adjacencyList,function(n,t){var r=i.adjacencyList[n];i.adjacencyList[n]=r?r.concat(t):t})},_getLocalSuggestions:function(n){var i,f=this,r=[],u=[],e=[];return t.each(n,function(n,i){var u=i.charAt(0);~t.indexOf(r,u)||r.push(u)}),t.each(r,function(n,t){var r=f.adjacencyList[t];return r?(u.push(r),(!i||r.length<i.length)&&(i=r),void 0):!1}),u.length<r.length?[]:(t.each(i,function(i,r){var o,s,h=f.itemHash[r];o=t.every(u,function(n){return~t.indexOf(n,r)});s=o&&t.every(n,function(n){return t.some(h.tokens,function(t){return 0===t.indexOf(n)})});s&&e.push(h)}),e)},initialize:function(){var t;return this.local&&this._processLocalData(this.local),this.transport=this.remote?new o(this.remote):null,t=this.prefetch?this._loadPrefetchData(this.prefetch):n.Deferred().resolve(),this.local=this.prefetch=this.remote=null,this.initialize=function(){return t},t},getSuggestions:function(n,i){function o(n){r=r.slice(0);t.each(n,function(n,i){var u,e=f._transformDatum(i);return u=t.some(r,function(n){return e.value===n.value}),!u&&r.push(e),r.length<f.limit});i&&i(r)}var u,r,f=this,e=!1;n.length<this.minLength||(u=t.tokenizeQuery(n),r=this._getLocalSuggestions(u).slice(0,this.limit),r.length<this.limit&&this.transport&&(e=this.transport.get(n,o)),!e&&i&&i(r))}}),r}(),h=function(){function r(i){var r=this;t.bindAll(this);this.specialKeyCodeMap={9:"tab",27:"esc",37:"left",39:"right",13:"enter",38:"up",40:"down"};this.$hint=n(i.hint);this.$input=n(i.input).on("blur.tt",this._handleBlur).on("focus.tt",this._handleFocus).on("keydown.tt",this._handleSpecialKeyEvent);t.isMsie()?this.$input.on("keydown.tt keypress.tt cut.tt paste.tt",function(n){r.specialKeyCodeMap[n.which||n.keyCode]||t.defer(r._compareQueryToInputValue)}):this.$input.on("input.tt",this._compareQueryToInputValue);this.query=this.$input.val();this.$overflowHelper=u(this.$input)}function u(t){return n("<span><\/span>").css({position:"absolute",left:"-9999px",visibility:"hidden",whiteSpace:"nowrap",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 n=(n||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),t=(t||"").replace(/^\s*/g,"").replace(/\s{2,}/g," "),n===t}return t.mixin(r.prototype,i,{_handleFocus:function(){this.trigger("focused")},_handleBlur:function(){this.trigger("blured")},_handleSpecialKeyEvent:function(n){var t=this.specialKeyCodeMap[n.which||n.keyCode];t&&this.trigger(t+"Keyed",n)},_compareQueryToInputValue:function(){var n=this.getInputValue(),t=f(this.query,n),i=t?this.query.length!==n.length:!1;i?this.trigger("whitespaceChanged",{value:this.query}):t||this.trigger("queryChanged",{value:this.query=n})},destroy:function(){this.$hint.off(".tt");this.$input.off(".tt");this.$hint=this.$input=this.$overflowHelper=null},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._compareQueryToInputValue()},getHintValue:function(){return this.$hint.val()},setHintValue:function(n){this.$hint.val(n)},getLanguageDirection:function(){return(this.$input.css("direction")||"ltr").toLowerCase()},isOverflow:function(){return this.$overflowHelper.text(this.getInputValue()),this.$overflowHelper.width()>this.$input.width()},isCursorAtEnd:function(){var n,i=this.$input.val().length,r=this.$input[0].selectionStart;return t.isNumber(r)?r===i:document.selection?(n=document.selection.createRange(),n.moveStart("character",-i),i===n.text.length):!0}}),r}(),c=function(){function f(i){t.bindAll(this);this.isOpen=!1;this.isEmpty=!0;this.isMouseOverDropdown=!1;this.$menu=n(i.menu).on("mouseenter.tt",this._handleMouseenter).on("mouseleave.tt",this._handleMouseleave).on("click.tt",".tt-suggestion",this._handleSelection).on("mouseover.tt",".tt-suggestion",this._handleMouseover)}function r(n){return n.data("suggestion")}var e={suggestionsList:'<span class="tt-suggestions"><\/span>'},u={suggestionsList:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"}};return t.mixin(f.prototype,i,{_handleMouseenter:function(){this.isMouseOverDropdown=!0},_handleMouseleave:function(){this.isMouseOverDropdown=!1},_handleMouseover:function(t){var i=n(t.currentTarget);this._getSuggestions().removeClass("tt-is-under-cursor");i.addClass("tt-is-under-cursor")},_handleSelection:function(t){var i=n(t.currentTarget);this.trigger("suggestionSelected",r(i))},_show:function(){this.$menu.css("display","block")},_hide:function(){this.$menu.hide()},_moveCursor:function(n){var i,u,t,f;if(this.isVisible()){if(i=this._getSuggestions(),u=i.filter(".tt-is-under-cursor"),u.removeClass("tt-is-under-cursor"),t=i.index(u)+n,t=(t+1)%(i.length+1)-1,-1===t)return this.trigger("cursorRemoved"),void 0;-1>t&&(t=i.length-1);f=i.eq(t).addClass("tt-is-under-cursor");this._ensureVisibility(f);this.trigger("cursorMoved",r(f))}},_getSuggestions:function(){return this.$menu.find(".tt-suggestions > .tt-suggestion")},_ensureVisibility:function(n){var i=this.$menu.height()+parseInt(this.$menu.css("paddingTop"),10)+parseInt(this.$menu.css("paddingBottom"),10),r=this.$menu.scrollTop(),t=n.position().top,u=t+n.outerHeight(!0);0>t?this.$menu.scrollTop(r+t):u>i&&this.$menu.scrollTop(r+(u-i))},destroy:function(){this.$menu.off(".tt");this.$menu=null},isVisible:function(){return this.isOpen&&!this.isEmpty},closeUnlessMouseIsOverDropdown:function(){this.isMouseOverDropdown||this.close()},close:function(){this.isOpen&&(this.isOpen=!1,this.isMouseOverDropdown=!1,this._hide(),this.$menu.find(".tt-suggestions > .tt-suggestion").removeClass("tt-is-under-cursor"),this.trigger("closed"))},open:function(){this.isOpen||(this.isOpen=!0,!this.isEmpty&&this._show(),this.trigger("opened"))},setLanguageDirection:function(n){"ltr"===n?this.$menu.css({left:"0",right:"auto"}):this.$menu.css({left:"auto",right:" 0"})},moveCursorUp:function(){this._moveCursor(-1)},moveCursorDown:function(){this._moveCursor(1)},getSuggestionUnderCursor:function(){var n=this._getSuggestions().filter(".tt-is-under-cursor").first();return n.length>0?r(n):null},getFirstSuggestion:function(){var n=this._getSuggestions().first();return n.length>0?r(n):null},renderSuggestions:function(i,r){var c,l,f,o,s,a="tt-dataset-"+i.name,v='<div class="tt-suggestion">%body<\/div>',h=this.$menu.find("."+a);0===h.length&&(l=n(e.suggestionsList).css(u.suggestionsList),h=n("<div><\/div>").addClass(a).append(i.header).append(l).append(i.footer).appendTo(this.$menu));r.length>0?(this.isEmpty=!1,this.isOpen&&this._show(),f=document.createElement("div"),o=document.createDocumentFragment(),t.each(r,function(t,r){r.dataset=i.name;c=i.template(r.datum);f.innerHTML=v.replace("%body",c);s=n(f.firstChild).css(u.suggestion).data("suggestion",r);s.children().each(function(){n(this).css(u.suggestionChild)});o.appendChild(s[0])}),h.show().find(".tt-suggestions").html(o)):this.clearSuggestions(i.name);this.trigger("suggestionsRendered")},clearSuggestions:function(n){var t=n?this.$menu.find(".tt-dataset-"+n):this.$menu.find('[class^="tt-dataset-"]'),i=t.find(".tt-suggestions");t.hide();i.empty();0===this._getSuggestions().length&&(this.isEmpty=!0,this._hide())}}),f}(),l=function(){function f(n){var i,r,u;t.bindAll(this);this.$node=e(n.input);this.datasets=n.datasets;this.dir=null;this.eventBus=n.eventBus;i=this.$node.find(".tt-dropdown-menu");r=this.$node.find(".tt-query");u=this.$node.find(".tt-hint");this.dropdownView=new c({menu:i}).on("suggestionSelected",this._handleSelection).on("cursorMoved",this._clearHint).on("cursorMoved",this._setInputValueToSuggestionUnderCursor).on("cursorRemoved",this._setInputValueToQuery).on("cursorRemoved",this._updateHint).on("suggestionsRendered",this._updateHint).on("opened",this._updateHint).on("closed",this._clearHint).on("opened closed",this._propagateEvent);this.inputView=new h({input:r,hint:u}).on("focused",this._openDropdown).on("blured",this._closeDropdown).on("blured",this._setInputValueToQuery).on("enterKeyed tabKeyed",this._handleSelection).on("queryChanged",this._clearHint).on("queryChanged",this._clearSuggestions).on("queryChanged",this._getSuggestions).on("whitespaceChanged",this._updateHint).on("queryChanged whitespaceChanged",this._openDropdown).on("queryChanged whitespaceChanged",this._setLanguageDirection).on("escKeyed",this._closeDropdown).on("escKeyed",this._setInputValueToQuery).on("tabKeyed upKeyed downKeyed",this._managePreventDefault).on("upKeyed downKeyed",this._moveDropdownCursor).on("upKeyed downKeyed",this._openDropdown).on("tabKeyed leftKeyed rightKeyed",this._autocomplete)}function e(t){var f=n(u.wrapper),e=n(u.dropdown),i=n(t),o=n(u.hint);f=f.css(r.wrapper);e=e.css(r.dropdown);o.css(r.hint).css({backgroundAttachment:i.css("background-attachment"),backgroundClip:i.css("background-clip"),backgroundColor:i.css("background-color"),backgroundImage:i.css("background-image"),backgroundOrigin:i.css("background-origin"),backgroundPosition:i.css("background-position"),backgroundRepeat:i.css("background-repeat"),backgroundSize:i.css("background-size")});i.data("ttAttrs",{dir:i.attr("dir"),autocomplete:i.attr("autocomplete"),spellcheck:i.attr("spellcheck"),style:i.attr("style")});i.addClass("tt-query").attr({autocomplete:"off",spellcheck:!1}).css(r.query);try{i.attr("dir")||i.attr("dir","auto")}catch(s){}return i.wrap(f).parent().prepend(o).append(e)}function o(n){var i=n.find(".tt-query");t.each(i.data("ttAttrs"),function(n,r){t.isUndefined(r)?i.removeAttr(n):i.attr(n,r)});i.detach().removeData("ttAttrs").removeClass("tt-query").insertAfter(n);n.remove()}var u={wrapper:'<span class="twitter-typeahead"><\/span>',hint:'<input class="tt-hint" type="text" autocomplete="off" spellcheck="off" disabled>',dropdown:'<span class="tt-dropdown-menu"><\/span>'},r={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none"},query:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"}};return t.isMsie()&&t.mixin(r.query,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),t.isMsie()&&t.isMsie()<=7&&(t.mixin(r.wrapper,{display:"inline",zoom:"1"}),t.mixin(r.query,{marginTop:"-1px"})),t.mixin(f.prototype,i,{_managePreventDefault:function(n){var i,u,t=n.data,r=!1;switch(n.type){case"tabKeyed":i=this.inputView.getHintValue();u=this.inputView.getInputValue();r=i&&i!==u;break;case"upKeyed":case"downKeyed":r=!t.shiftKey&&!t.ctrlKey&&!t.metaKey}r&&t.preventDefault()},_setLanguageDirection:function(){var n=this.inputView.getLanguageDirection();n!==this.dir&&(this.dir=n,this.$node.css("direction",n),this.dropdownView.setLanguageDirection(n))},_updateHint:function(){var n,r,u,f,i,e=this.dropdownView.getFirstSuggestion(),o=e?e.value:null,s=this.dropdownView.isVisible(),h=this.inputView.isOverflow();o&&s&&!h&&(n=this.inputView.getInputValue(),r=n.replace(/\s{2,}/g," ").replace(/^\s+/g,""),u=t.escapeRegExChars(r),f=new RegExp("^(?:"+u+")(.*$)","i"),i=f.exec(o),this.inputView.setHintValue(n+(i?i[1]:"")))},_clearHint:function(){this.inputView.setHintValue("")},_clearSuggestions:function(){this.dropdownView.clearSuggestions()},_setInputValueToQuery:function(){this.inputView.setInputValue(this.inputView.getQuery())},_setInputValueToSuggestionUnderCursor:function(n){var t=n.data;this.inputView.setInputValue(t.value,!0)},_openDropdown:function(){this.dropdownView.open()},_closeDropdown:function(n){this.dropdownView["blured"===n.type?"closeUnlessMouseIsOverDropdown":"close"]()},_moveDropdownCursor:function(n){var t=n.data;t.shiftKey||t.ctrlKey||t.metaKey||this.dropdownView["upKeyed"===n.type?"moveCursorUp":"moveCursorDown"]()},_handleSelection:function(n){var r="suggestionSelected"===n.type,i=r?n.data:this.dropdownView.getSuggestionUnderCursor();i&&(this.inputView.setInputValue(i.value),r?this.inputView.focus():n.data.preventDefault(),r&&t.isMsie()?t.defer(this.dropdownView.close):this.dropdownView.close(),this.eventBus.trigger("selected",i.datum,i.dataset))},_getSuggestions:function(){var i=this,n=this.inputView.getQuery();t.isBlankString(n)||t.each(this.datasets,function(t,r){r.getSuggestions(n,function(t){n===i.inputView.getQuery()&&i.dropdownView.renderSuggestions(r,t)})})},_autocomplete:function(n){var r,u,f,i,t;("rightKeyed"!==n.type&&"leftKeyed"!==n.type||(r=this.inputView.isCursorAtEnd(),u="ltr"===this.inputView.getLanguageDirection()?"leftKeyed"===n.type:"rightKeyed"===n.type,r&&!u))&&(f=this.inputView.getQuery(),i=this.inputView.getHintValue(),""!==i&&f!==i&&(t=this.dropdownView.getFirstSuggestion(),this.inputView.setInputValue(t.value),this.eventBus.trigger("autocompleted",t.datum,t.dataset)))},_propagateEvent:function(n){this.eventBus.trigger(n.type)},destroy:function(){this.inputView.destroy();this.dropdownView.destroy();o(this.$node);this.$node=null},setQuery:function(n){this.inputView.setQuery(n);this.inputView.setInputValue(n);this._clearHint();this._clearSuggestions();this._getSuggestions()}}),f}();!function(){var i,f={},u="ttView";i={initialize:function(i){function o(){var f,i=n(this),o=new r({el:i});f=t.map(e,function(n){return n.initialize()});i.data(u,new l({input:i,eventBus:o=new r({el:i}),datasets:e}));n.when.apply(n,f).always(function(){t.defer(function(){o.trigger("initialized")})})}var e;return i=t.isArray(i)?i:[i],0===i.length&&n.error("no datasets provided"),e=t.map(i,function(n){var t=f[n.name]?f[n.name]:new s(n);return n.name&&(f[n.name]=t),t}),this.each(o)},destroy:function(){function t(){var t=n(this),i=t.data(u);i&&(i.destroy(),t.removeData(u))}return this.each(t)},setQuery:function(t){function i(){var i=n(this).data(u);i&&i.setQuery(t)}return this.each(i)}};jQuery.fn.typeahead=function(n){return i[n]?i[n].apply(this,[].slice.call(arguments,1)):i.initialize.apply(this,arguments)}}()}(window.jQuery),function(n,t){typeof define=="function"&&define.amd?define(["exports"],t):typeof exports=="object"&&typeof exports.nodeName!="string"?t(exports):t(n.commonJsStrict={})}(this,function(n){function d(n){if(n in k)return n;for(var i=n[0].toUpperCase()+n.slice(1),t=b.length;t--;)if(n=b[t]+i,n in k)return n}function s(n,t){n=n||{};for(var i in t)t[i]&&t[i].constructor&&t[i].constructor===Object?(n[i]=n[i]||{},s(n[i],t[i])):n[i]=t[i];return n}function at(n,t,i){var r;return function(){var u=this,f=arguments,e=function(){r=null;i||n.apply(u,f)},o=i&&!r;clearTimeout(r);r=setTimeout(e,t);o&&n.apply(u,f)}}function g(n){if("createEvent"in document){var t=document.createEvent("HTMLEvents");t.initEvent("change",!1,!0);n.dispatchEvent(t)}else n.fireEvent("onchange")}function r(n,t,i){var u,r;typeof t=="string"&&(u=t,t={},t[u]=i);for(r in t)n.style[r]=t[r]}function i(n,t){n.classList?n.classList.add(t):n.className+=" "+t}function vt(n,t){n.classList?n.classList.remove(t):n.className=n.className.replace(t,"")}function a(n){return parseInt(n,10)}function yt(n,t,i){var r=t||new Image,u;return r.src===n?u=new Promise(function(n){n(r)}):(u=new Promise(function(t){i&&n.substring(0,4).toLowerCase()==="http"&&r.setAttribute("crossOrigin","anonymous");r.onload=function(){setTimeout(function(){t(r)},1)}}),r.src=n),r.style.opacity=0,u}function wt(n,t){window.EXIF||t(0);EXIF.getData(n,function(){var n=EXIF.getTag(this,"Orientation");t(n)})}function p(n,t,i){var u=t.width,f=t.height,r=n.getContext("2d");n.width=t.width;n.height=t.height;r.save();switch(i){case 2:r.translate(u,0);r.scale(-1,1);break;case 3:r.translate(u,f);r.rotate(Math.PI/1);break;case 4:r.translate(0,f);r.scale(1,-1);break;case 5:n.width=f;n.height=u;r.rotate(Math.PI/2);r.scale(1,-1);break;case 6:n.width=f;n.height=u;r.rotate(Math.PI/2);r.translate(0,-f);break;case 7:n.width=f;n.height=u;r.rotate(Math.PI/-2);r.translate(-u,f);r.scale(1,-1);break;case 8:n.width=f;n.height=u;r.translate(0,u);r.rotate(Math.PI/-2)}r.drawImage(t,0,0,u,f);r.restore()}function bt(){var n=this,s=n.options.viewport.type?"cr-vp-"+n.options.viewport.type:null,t,h,u,f,e,o;n.options.useCanvas=n.options.enableOrientation||ut.call(n);n.data={};n.elements={};t=n.elements.boundary=document.createElement("div");u=n.elements.viewport=document.createElement("div");h=n.elements.img=document.createElement("img");f=n.elements.overlay=document.createElement("div");n.options.useCanvas?(n.elements.canvas=document.createElement("canvas"),n.elements.preview=n.elements.canvas):n.elements.preview=n.elements.img;i(t,"cr-boundary");e=n.options.boundary.width;o=n.options.boundary.height;r(t,{width:e+(isNaN(e)?"":"px"),height:o+(isNaN(o)?"":"px")});i(u,"cr-viewport");s&&i(u,s);r(u,{width:n.options.viewport.width+"px",height:n.options.viewport.height+"px"});u.setAttribute("tabindex",0);i(n.elements.preview,"cr-image");i(f,"cr-overlay");n.element.appendChild(t);t.appendChild(n.elements.preview);t.appendChild(u);t.appendChild(f);i(n.element,"croppie-container");n.options.customClass&&i(n.element,n.options.customClass);gt.call(this);n.options.enableZoom&&kt.call(n)}function ut(){return this.options.enableExif&&window.EXIF}function v(n){if(this.options.enableZoom){var t=this.elements.zoomer,i=o(n,4);t.value=Math.max(t.min,Math.min(t.max,i))}}function kt(){function f(){ft.call(n,{value:parseFloat(r.value),origin:new h(n.elements.preview),viewportRect:n.elements.viewport.getBoundingClientRect(),transform:t.parse(n.elements.preview)})}function e(t){var i,r;i=t.wheelDelta?t.wheelDelta/1200:t.deltaY?t.deltaY/1060:t.detail?t.detail/-60:0;r=n._currentZoom+i*n._currentZoom;t.preventDefault();v.call(n,r);f.call(n)}var n=this,u=n.elements.zoomerWrap=document.createElement("div"),r=n.elements.zoomer=document.createElement("input");i(u,"cr-slider-wrap");i(r,"cr-slider");r.type="range";r.step="0.0001";r.value=1;r.style.display=n.options.showZoomer?"":"none";n.element.appendChild(u);u.appendChild(r);n._currentZoom=1;n.elements.zoomer.addEventListener("input",f);n.elements.zoomer.addEventListener("change",f);n.options.mouseWheelZoom&&(n.elements.boundary.addEventListener("mousewheel",e),n.elements.boundary.addEventListener("DOMMouseScroll",e))}function ft(n){function l(){var n={};n[u]=f.toString();n[e]=s.toString();r(i.elements.preview,n)}var i=this,f=n?n.transform:t.parse(i.elements.preview),v=n?n.viewportRect:i.elements.viewport.getBoundingClientRect(),s=n?n.origin:new h(i.elements.preview);if(i._currentZoom=n?n.value:i._currentZoom,f.scale=i._currentZoom,l(),i.options.enforceBoundary){var a=dt.call(i,v),o=a.translate,c=a.origin;f.x>=o.maxX&&(s.x=c.minX,f.x=o.maxX);f.x<=o.minX&&(s.x=c.maxX,f.x=o.minX);f.y>=o.maxY&&(s.y=c.minY,f.y=o.maxY);f.y<=o.minY&&(s.y=c.maxY,f.y=o.minY)}l();et.call(i);y.call(i)}function dt(n){var i=this,t=i._currentZoom,r=n.width,u=n.height,y=i.elements.boundary.clientWidth/2,p=i.elements.boundary.clientHeight/2,f=i.elements.preview.getBoundingClientRect(),e=f.width,o=f.height,s=r/2,h=u/2,c=(s/t-y)*-1,w=c-(e*(1/t)-r*(1/t)),l=(h/t-p)*-1,b=l-(o*(1/t)-u*(1/t)),a=1/t*s,k=e*(1/t)-a,v=1/t*h,d=o*(1/t)-v;return{translate:{maxX:c,minX:w,maxY:l,minY:b},origin:{maxX:k,minX:a,maxY:d,minY:v}}}function nt(){var n=this,f=n._currentZoom,a=n.elements.preview.getBoundingClientRect(),o=n.elements.viewport.getBoundingClientRect(),l=t.parse(n.elements.preview.style[u]),v=new h(n.elements.preview),y=o.top-a.top+o.height/2,p=o.left-a.left+o.width/2,i={},s={},c;i.y=y/f;i.x=p/f;s.y=(i.y-v.y)*(1-f);s.x=(i.x-v.x)*(1-f);l.x-=s.x;l.y-=s.y;c={};c[e]=i.x+"px "+i.y+"px";c[u]=l.toString();r(n.elements.preview,c)}function gt(){function p(t,r){var u=n.elements.preview.getBoundingClientRect(),e=i.y+r,o=i.x+t;n.options.enforceBoundary?(f.top>u.top+r&&f.bottom<u.bottom+r&&(i.y=e),f.left>u.left+t&&f.right<u.right+t&&(i.x=o)):(i.y=e,i.x=o)}function k(r){function a(n){switch(n){case h:return[1,0];case u:return[0,1];case c:return[-1,0];case o:return[0,-1]}}var h=37,u=38,c=39,o=40,e,s;r.shiftKey&&(r.keyCode==u||r.keyCode==o)?(e=0,e=r.keyCode==u?parseFloat(n.elements.zoomer.value,10)+parseFloat(n.elements.zoomer.step,10):parseFloat(n.elements.zoomer.value,10)-parseFloat(n.elements.zoomer.step,10),n.setZoom(e)):r.keyCode>=37&&r.keyCode<=40&&(r.preventDefault(),s=a(r.keyCode),i=t.parse(n.elements.preview),document.body.style[l]="none",f=n.elements.viewport.getBoundingClientRect(),d(s))}function d(t){var o=t[0],s=t[1],f={};p(o,s);f[u]=i.toString();r(n.elements.preview,f);w.call(n);document.body.style[l]="";nt.call(n);y.call(n);e=0}function b(r){if(r.preventDefault(),!a){if(a=!0,o=r.pageX,s=r.pageY,r.touches){var u=r.touches[0];o=u.pageX;s=u.pageY}i=t.parse(n.elements.preview);window.addEventListener("mousemove",h);window.addEventListener("touchmove",h);window.addEventListener("mouseup",c);window.addEventListener("touchend",c);document.body.style[l]="none";f=n.elements.viewport.getBoundingClientRect()}}function h(t){var f,h,a,k;t.preventDefault();f=t.pageX;h=t.pageY;t.touches&&(a=t.touches[0],f=a.pageX,h=a.pageY);var d=f-o,nt=h-s,y={};if(t.type=="touchmove"&&t.touches.length>1){var c=t.touches[0],l=t.touches[1],b=Math.sqrt((c.pageX-l.pageX)*(c.pageX-l.pageX)+(c.pageY-l.pageY)*(c.pageY-l.pageY));e||(e=b/n._currentZoom);k=b/e;v.call(n,k);g(n.elements.zoomer);return}p(d,nt);y[u]=i.toString();r(n.elements.preview,y);w.call(n);s=h;o=f}function c(){a=!1;window.removeEventListener("mousemove",h);window.removeEventListener("touchmove",h);window.removeEventListener("mouseup",c);window.removeEventListener("touchend",c);document.body.style[l]="";nt.call(n);y.call(n);e=0}var n=this,a=!1,o,s,e,f,i;n.elements.overlay.addEventListener("mousedown",b);n.elements.viewport.addEventListener("keydown",k);n.elements.overlay.addEventListener("touchstart",b)}function w(){var t=this,i=t.elements.boundary.getBoundingClientRect(),n=t.elements.preview.getBoundingClientRect();r(t.elements.overlay,{width:n.width+"px",height:n.height+"px",top:n.top-i.top+"px",left:n.left-i.left+"px"})}function y(){var n=this,t=n.get(),i;ot.call(n)&&(n.options.update.call(n,t),n.$?n.$(n.element).trigger("update",t):(window.CustomEvent?i=new CustomEvent("update",{detail:t}):(i=document.createEvent("CustomEvent"),i.initCustomEvent("update",!0,!0,t)),n.element.dispatchEvent(i)))}function ot(){return this.elements.preview.offsetHeight>0&&this.elements.preview.offsetWidth>0}function tt(){var n=this,s=0,l=1.5,c=1,f={},a=n.elements.preview,y=n.elements.zoomer,p=new t(0,0,c),rt=new h,ut=ot.call(n),i,b,k,d,tt,it;ut&&!n.data.bound&&(n.data.bound=!0,f[u]=p.toString(),f[e]=rt.toString(),f.opacity=1,r(a,f),i=a.getBoundingClientRect(),b=n.elements.viewport.getBoundingClientRect(),k=n.elements.boundary.getBoundingClientRect(),n._originalImageWidth=i.width,n._originalImageHeight=i.height,n.options.enableZoom?(n.options.enforceBoundary&&(d=b.width/i.width,tt=b.height/i.height,s=Math.max(d,tt)),s>=l&&(l=s+1),y.min=o(s,4),y.max=o(l,4),it=Math.max(k.width/i.width,k.height/i.height),c=n.data.boundZoom!==null?n.data.boundZoom:it,v.call(n,c),g(y)):n._currentZoom=c,p.scale=n._currentZoom,f[u]=p.toString(),r(a,f),n.data.points.length?ni.call(n,n.data.points):ti.call(n),nt.call(n),w.call(n))}function ni(n){if(n.length!=4)throw"Croppie - Invalid number of points supplied: "+n;var i=this,l=n[2]-n[0],f=i.elements.viewport.getBoundingClientRect(),h=i.elements.boundary.getBoundingClientRect(),c={left:f.left-h.left,top:f.top-h.top},o=f.width/l,a=n[1],y=n[0],p=-1*n[1]+c.top,w=-1*n[0]+c.left,s={};s[e]=y+"px "+a+"px";s[u]=new t(w,p,o).toString();r(i.elements.preview,s);v.call(i,o);i._currentZoom=o}function ti(){var n=this,f=n.elements.preview.getBoundingClientRect(),i=n.elements.viewport.getBoundingClientRect(),e=n.elements.boundary.getBoundingClientRect(),o=i.left-e.left,s=i.top-e.top,h=o-(f.width-i.width)/2,c=s-(f.height-i.height)/2,l=new t(h,c,n._currentZoom);r(n.elements.preview,u,l.toString())}function ii(n){var r=this,t=r.elements.canvas,i=r.elements.img,u=t.getContext("2d"),f=ut.call(r),n=r.options.enableOrientation&&n;u.clearRect(0,0,t.width,t.height);t.width=i.width;t.height=i.height;f?wt(i,function(r){p(t,i,a(r,10));n&&p(t,i,n)}):n&&p(t,i,n)}function it(n){var h=this,r=n.points,u=a(r[0]),f=a(r[1]),o=r[2]-r[0],s=r[3]-r[1],y=n.circle,c=document.createElement("canvas"),t=c.getContext("2d"),i=o,e=s,l=0,v=0;return n.outputWidth&&n.outputHeight&&(i=n.outputWidth,e=n.outputHeight),c.width=i,c.height=e,n.backgroundColor&&(t.fillStyle=n.backgroundColor,t.fillRect(0,0,i,e)),u<0&&(l=Math.abs(u),u=0),f<0&&(v=Math.abs(f),f=0),u+o>h._originalImageWidth&&(o=h._originalImageWidth-u,i=o),f+s>h._originalImageHeight&&(s=h._originalImageHeight-f,e=s),t.drawImage(this.elements.preview,u,f,o,s,l,v,i,e),y&&(t.fillStyle="#fff",t.globalCompositeOperation="destination-in",t.beginPath(),t.arc(i/2,e/2,i/2,0,Math.PI*2,!0),t.closePath(),t.fill()),c}function ri(n){var t=n.points,u=document.createElement("div"),f=document.createElement("img"),e=t[2]-t[0],o=t[3]-t[1];return i(u,"croppie-result"),u.appendChild(f),r(f,{left:-1*t[0]+"px",top:-1*t[1]+"px"}),f.src=n.url,r(u,{width:e+"px",height:o+"px"}),u}function ui(n){return it.call(this,n).toDataURL(n.format,n.quality)}function fi(n){var t=this;return new Promise(function(i){it.call(t,n).toBlob(function(n){i(n)},n.format,n.quality)})}function st(n,t){var i=this,r,u=[],e=null,f;if(typeof n=="string")r=n,n={};else if(Array.isArray(n))u=n.slice();else{if(typeof n=="undefined"&&i.data.url)return tt.call(i),y.call(i),null;r=n.url;u=n.points||[];e=typeof n.zoom=="undefined"?null:n.zoom}return i.data.bound=!1,i.data.url=r||i.data.url,i.data.points=(u||i.data.points).map(function(n){return parseFloat(n)}),i.data.boundZoom=e,f=yt(r,i.elements.img,i.options.useCanvas),f.then(function(){i.options.useCanvas&&(i.elements.img.exifdata=null,ii.call(i,n.orientation||1));tt.call(i);y.call(i);t&&t()}),f}function o(n,t){return parseFloat(n).toFixed(t||0)}function ht(){var n=this,h=n.elements.preview.getBoundingClientRect(),r=n.elements.viewport.getBoundingClientRect(),u=r.left-h.left,f=r.top-h.top,c=(r.width-n.elements.viewport.offsetWidth)/2,l=(r.height-n.elements.viewport.offsetHeight)/2,e=u+n.elements.viewport.offsetWidth+c,s=f+n.elements.viewport.offsetHeight+l,t=n._currentZoom,i;return(t===Infinity||isNaN(t))&&(t=1),i=n.options.enforceBoundary?0:Number.NEGATIVE_INFINITY,u=Math.max(i,u/t),f=Math.max(i,f/t),e=Math.max(i,e/t),s=Math.max(i,s/t),{points:[o(u),o(f),o(e),o(s)],zoom:t}}function ei(n){var r=this,t=ht.call(r),u=s(ct,s({},n)),h=typeof n=="string"?n:u.type||"base64",i=u.size,e=u.format,c=u.quality,l=u.backgroundColor,a=typeof u.circle=="boolean"?u.circle:r.options.viewport.type==="circle",f=r.elements.viewport.getBoundingClientRect(),o=f.width/f.height;return i==="viewport"?(t.outputWidth=f.width,t.outputHeight=f.height):typeof i=="object"&&(i.width&&i.height?(t.outputWidth=i.width,t.outputHeight=i.height):i.width?(t.outputWidth=i.width,t.outputHeight=i.width/o):i.height&&(t.outputWidth=i.height*o,t.outputHeight=i.height)),lt.indexOf(e)>-1&&(t.format="image/"+e,t.quality=c),t.circle=a,t.url=r.data.url,t.backgroundColor=l,new Promise(function(n){switch(h.toLowerCase()){case"rawcanvas":n(it.call(r,t));break;case"canvas":case"base64":n(ui.call(r,t));break;case"blob":fi.call(r,t).then(n);break;default:n(ri.call(r,t))}})}function oi(){tt.call(this)}function si(n){var f;if(!this.options.useCanvas)throw"Croppie: Cannot rotate without enableOrientation";var u=this,t=u.elements.canvas,e=u.elements.img,i=document.createElement("canvas"),r=1;i.width=t.width;i.height=t.height;f=i.getContext("2d");f.drawImage(t,0,0);(n===90||n===-270)&&(r=6);(n===-90||n===270)&&(r=8);(n===180||n===-180)&&(r=3);p(t,i,r);ft.call(u)}function hi(){var n=this;n.element.removeChild(n.elements.boundary);vt(n.element,"croppie-container");n.options.enableZoom&&n.element.removeChild(n.elements.zoomerWrap);delete n.elements}function c(n,t){var r,u,f;this.element=n;this.options=s(s({},c.defaults),t);this.element.tagName.toLowerCase()==="img"&&(r=this.element,i(r,"cr-original-image"),u=document.createElement("div"),this.element.parentNode.appendChild(u),u.appendChild(r),this.element=u,this.options.url=this.options.url||r.src);bt.call(this);this.options.url&&(f={url:this.options.url,points:this.options.points},delete this.options.url,delete this.options.points,st.call(this,f))}var b,k,e,u,l,h,et,ct,lt,f;typeof Promise!="function"&&!function(n){function i(n,t){return function(){n.apply(t,arguments)}}function t(n){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof n)throw new TypeError("not a function");this._state=null;this._value=null;this._deferreds=[];o(n,i(f,this),i(r,this))}function u(n){var t=this;return null===this._state?void this._deferreds.push(n):void s(function(){var i=t._state?n.onFulfilled:n.onRejected,r;if(null===i)return void(t._state?n.resolve:n.reject)(t._value);try{r=i(t._value)}catch(u){return void n.reject(u)}n.resolve(r)})}function f(n){try{if(n===this)throw new TypeError("A promise cannot be resolved with itself.");if(n&&("object"==typeof n||"function"==typeof n)){var t=n.then;if("function"==typeof t)return void o(i(t,n),i(f,this),i(r,this))}this._state=!0;this._value=n;e.call(this)}catch(u){r.call(this,u)}}function r(n){this._state=!1;this._value=n;e.call(this)}function e(){for(var n=0,t=this._deferreds.length;t>n;n++)u.call(this,this._deferreds[n]);this._deferreds=null}function h(n,t,i,r){this.onFulfilled="function"==typeof n?n:null;this.onRejected="function"==typeof t?t:null;this.resolve=i;this.reject=r}function o(n,t,i){var r=!1;try{n(function(n){r||(r=!0,t(n))},function(n){r||(r=!0,i(n))})}catch(u){if(r)return;r=!0;i(u)}}var c=setTimeout,s="function"==typeof setImmediate&&setImmediate||function(n){c(n,1)},l=Array.isArray||function(n){return"[object Array]"===Object.prototype.toString.call(n)};t.prototype["catch"]=function(n){return this.then(null,n)};t.prototype.then=function(n,i){var r=this;return new t(function(t,f){u.call(r,new h(n,i,t,f))})};t.all=function(){var n=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new t(function(t,i){function u(r,e){try{if(e&&("object"==typeof e||"function"==typeof e)){var o=e.then;if("function"==typeof o)return void o.call(e,function(n){u(r,n)},i)}n[r]=e;0==--f&&t(n)}catch(s){i(s)}}if(0===n.length)return t([]);for(var f=n.length,r=0;r<n.length;r++)u(r,n[r])})};t.resolve=function(n){return n&&"object"==typeof n&&n.constructor===t?n:new t(function(t){t(n)})};t.reject=function(n){return new t(function(t,i){i(n)})};t.race=function(n){return new t(function(t,i){for(var r=0,u=n.length;u>r;r++)n[r].then(t,i)})};t._setImmediateFn=function(n){s=n};"undefined"!=typeof module&&module.exports?module.exports=t:n.Promise||(n.Promise=t)}(this);typeof window.CustomEvent!="function"&&function(){function n(n,t){t=t||{bubbles:!1,cancelable:!1,detail:undefined};var i=document.createEvent("CustomEvent");return i.initCustomEvent(n,t.bubbles,t.cancelable,t.detail),i}n.prototype=window.Event.prototype;window.CustomEvent=n}();HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(n,t,i){for(var u=atob(this.toDataURL(t,i).split(",")[1]),f=u.length,e=new Uint8Array(f),r=0;r<f;r++)e[r]=u.charCodeAt(r);n(new Blob([e],{type:t||"image/png"}))}});b=["Webkit","Moz","ms"];k=document.createElement("div").style;u=d("transform");e=d("transformOrigin");l=d("userSelect");var rt="translate3d",pt=", 0px",t=function(n,t,i){this.x=parseFloat(n);this.y=parseFloat(t);this.scale=parseFloat(i)};t.parse=function(n){return n.style?t.parse(n.style[u]):n.indexOf("matrix")>-1||n.indexOf("none")>-1?t.fromMatrix(n):t.fromString(n)};t.fromMatrix=function(n){var i=n.substring(7).split(",");return i.length&&n!=="none"||(i=[1,0,0,1,0,0]),new t(a(i[4]),a(i[5]),parseFloat(i[0]))};t.fromString=function(n){var r=n.split(") "),i=r[0].substring(rt.length+1).split(","),u=r.length>1?r[1].substring(6):1,f=i.length>1?i[0]:0,e=i.length>1?i[1]:0;return new t(f,e,u)};t.prototype.toString=function(){return rt+"("+this.x+"px, "+this.y+"px"+pt+") scale("+this.scale+")"};h=function(n){if(!n||!n.style[e]){this.x=0;this.y=0;return}var t=n.style[e].split(" ");this.x=parseFloat(t[0]);this.y=parseFloat(t[1])};h.prototype.toString=function(){return this.x+"px "+this.y+"px"};et=at(w,500);ct={type:"canvas",format:"png",quality:1};lt=["jpeg","webp","png"];window.jQuery&&(f=window.jQuery,f.fn.croppie=function(n){var r=typeof n,i,t;return r==="string"?(i=Array.prototype.slice.call(arguments,1),t=f(this).data("croppie"),n==="get")?t.get():n==="result"?t.result.apply(t,i):n==="bind"?t.bind.apply(t,i):this.each(function(){var t=f(this).data("croppie"),r;if(t)if(r=t[n],f.isFunction(r))r.apply(t,i),n==="destroy"&&f(this).removeData("croppie");else throw"Croppie "+n+" method not found";}):this.each(function(){var t=new c(this,n);t.$=f;f(this).data("croppie",t)})});c.defaults={viewport:{width:100,height:100,type:"square"},boundary:{},orientationControls:{enabled:!0,leftClass:"",rightClass:""},customClass:"",showZoomer:!0,enableZoom:!0,mouseWheelZoom:!0,enableExif:!1,enforceBoundary:!0,enableOrientation:!1,update:function(){}};s(c.prototype,{bind:function(n,t){return st.call(this,n,t)},get:function(){return ht.call(this)},result:function(n){return ei.call(this,n)},refresh:function(){return oi.call(this)},setZoom:function(n){v.call(this,n);g(this.elements.zoomer)},rotate:function(n){si.call(this,n)},destroy:function(){return hi.call(this)}});n.Croppie=window.Croppie=c;typeof module!="object"||!module.exports||(module.exports=c)}),function(){function u(n){return!!n.exifdata}function v(n,t){var i;t=t||n.match(/^data\:([^\;]+)\;base64,/mi)[1]||"";n=n.replace(/^data\:([^\;]+)\;base64,/gmi,"");var r=atob(n),u=r.length,f=new ArrayBuffer(u),e=new Uint8Array(f);for(i=0;i<u;i++)e[i]=r.charCodeAt(i);return f}function y(n,t){var i=new XMLHttpRequest;i.open("GET",n,!0);i.responseType="blob";i.onload=function(){(this.status==200||this.status===0)&&t(this.response)};i.send()}function p(n,t){function f(i){var r=s(i),u=w(i);n.exifdata=r||{};n.iptcdata=u||{};t&&t.call(n)}var e,u,r;n.src?/^data\:/i.test(n.src)?(e=v(n.src),f(e)):/^blob\:/i.test(n.src)?(r=new FileReader,r.onload=function(n){f(n.target.result)},y(n.src,function(n){r.readAsArrayBuffer(n)})):(u=new XMLHttpRequest,u.onload=function(){if(this.status==200||this.status===0)f(u.response);else throw"Could not load image";u=null},u.open("GET",n.src,!0),u.responseType="arraybuffer",u.send(null)):window.FileReader&&(n instanceof window.Blob||n instanceof window.File)&&(r=new FileReader,r.onload=function(n){i&&console.log("Got file of length "+n.target.result.byteLength);f(n.target.result)},r.readAsArrayBuffer(n))}function s(n){var r=new DataView(n),t,f,u;if(i&&console.log("Got file of length "+n.byteLength),r.getUint8(0)!=255||r.getUint8(1)!=216)return i&&console.log("Not a valid JPEG"),!1;for(t=2,f=n.byteLength;t<f;){if(r.getUint8(t)!=255)return i&&console.log("Not a valid marker at offset "+t+", found: "+r.getUint8(t)),!1;if(u=r.getUint8(t+1),i&&console.log(u),u==225)return i&&console.log("Found 0xFFE1 marker"),d(r,t+4,r.getUint16(t+2)-2);t+=2+r.getUint16(t+2)}}function w(n){var u=new DataView(n),t,f,e;if(i&&console.log("Got file of length "+n.byteLength),u.getUint8(0)!=255||u.getUint8(1)!=216)return i&&console.log("Not a valid JPEG"),!1;for(var r=2,o=n.byteLength,s=function(n,t){return n.getUint8(t)===56&&n.getUint8(t+1)===66&&n.getUint8(t+2)===73&&n.getUint8(t+3)===77&&n.getUint8(t+4)===4&&n.getUint8(t+5)===4};r<o;){if(s(u,r))return t=u.getUint8(r+7),t%2!=0&&(t+=1),t===0&&(t=4),f=r+8+t,e=u.getUint16(r+6+t),b(n,f,e);r++}}function b(n,t,i){for(var s=new DataView(n),r={},h,u,c,l,a,o=t;o<t+i;)s.getUint8(o)===28&&s.getUint8(o+1)===2&&(l=s.getUint8(o+2),l in e&&(c=s.getInt16(o+3),a=c+5,u=e[l],h=f(s,o+5,c),r.hasOwnProperty(u)?r[u]instanceof Array?r[u].push(h):r[u]=[r[u],h]:r[u]=h)),o++;return r}function o(n,t,r,u,f){for(var c=n.getUint16(r,!f),h={},e,s,o=0;o<c;o++)e=r+o*12+2,s=u[n.getUint16(e,!f)],!s&&i&&console.log("Unknown tag: "+n.getUint16(e,!f)),h[s]=k(n,e,t,r,f);return h}function k(n,t,i,r,u){var y=n.getUint16(t+2,!u),s=n.getUint32(t+4,!u),h=n.getUint32(t+8,!u)+i,c,o,v,e,l,a;switch(y){case 1:case 7:if(s==1)return n.getUint8(t+8,!u);for(c=s>4?h:t+8,o=[],e=0;e<s;e++)o[e]=n.getUint8(c+e);return o;case 2:return c=s>4?h:t+8,f(n,c,s-1);case 3:if(s==1)return n.getUint16(t+8,!u);for(c=s>2?h:t+8,o=[],e=0;e<s;e++)o[e]=n.getUint16(c+2*e,!u);return o;case 4:if(s==1)return n.getUint32(t+8,!u);for(o=[],e=0;e<s;e++)o[e]=n.getUint32(h+4*e,!u);return o;case 5:if(s==1)return l=n.getUint32(h,!u),a=n.getUint32(h+4,!u),v=new Number(l/a),v.numerator=l,v.denominator=a,v;for(o=[],e=0;e<s;e++)l=n.getUint32(h+8*e,!u),a=n.getUint32(h+4+8*e,!u),o[e]=new Number(l/a),o[e].numerator=l,o[e].denominator=a;return o;case 9:if(s==1)return n.getInt32(t+8,!u);for(o=[],e=0;e<s;e++)o[e]=n.getInt32(h+4*e,!u);return o;case 10:if(s==1)return n.getInt32(h,!u)/n.getInt32(h+4,!u);for(o=[],e=0;e<s;e++)o[e]=n.getInt32(h+8*e,!u)/n.getInt32(h+4+8*e,!u);return o}}function f(t,i,r){var u="";for(n=i;n<i+r;n++)u+=String.fromCharCode(t.getUint8(n));return u}function d(n,t){var h,v,u,e,y,s,p;if(f(n,t,4)!="Exif")return i&&console.log("Not valid EXIF data! "+f(n,t,4)),!1;if(s=t+6,n.getUint16(s)==18761)h=!1;else if(n.getUint16(s)==19789)h=!0;else return i&&console.log("Not valid TIFF data! (no 0x4949 or 0x4D4D)"),!1;if(n.getUint16(s+2,!h)!=42)return i&&console.log("Not valid TIFF data! (no 0x002A)"),!1;if(p=n.getUint32(s+4,!h),p<8)return i&&console.log("Not valid TIFF data! (First offset less than 8)",n.getUint32(s+4,!h)),!1;if(v=o(n,s,s+p,l,h),v.ExifIFDPointer){e=o(n,s,s+v.ExifIFDPointer,c,h);for(u in e){switch(u){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":e[u]=r[u][e[u]];break;case"ExifVersion":case"FlashpixVersion":e[u]=String.fromCharCode(e[u][0],e[u][1],e[u][2],e[u][3]);break;case"ComponentsConfiguration":e[u]=r.Components[e[u][0]]+r.Components[e[u][1]]+r.Components[e[u][2]]+r.Components[e[u][3]]}v[u]=e[u]}}if(v.GPSInfoIFDPointer){y=o(n,s,s+v.GPSInfoIFDPointer,a,h);for(u in y){switch(u){case"GPSVersionID":y[u]=y[u][0]+"."+y[u][1]+"."+y[u][2]+"."+y[u][3]}v[u]=y[u]}}return v}var i=!1,h=this,t=function(n){if(n instanceof t)return n;if(!(this instanceof t))return new t(n);this.EXIFwrapped=n},e;typeof exports!="undefined"?(typeof module!="undefined"&&module.exports&&(exports=module.exports=t),exports.EXIF=t):h.EXIF=t;var c=t.Tags={36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubsecTime",37521:"SubsecTimeOriginal",37522:"SubsecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:"OECF",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRation",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",40965:"InteroperabilityIFDPointer",42016:"ImageUniqueID"},l=t.TiffTags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright"},a=t.GPSTags={0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential"},r=t.StringValues={ExposureProgram:{0:"Not defined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Not defined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},Components:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"}};e={120:"caption",110:"credit",25:"keywords",55:"dateCreated",80:"byline",85:"bylineTitle",122:"captionWriter",105:"headline",116:"copyright",15:"category"};t.getData=function(n,t){return(n instanceof Image||n instanceof HTMLImageElement)&&!n.complete?!1:(u(n)?t&&t.call(n):p(n,t),!0)};t.getTag=function(n,t){if(u(n))return n.exifdata[t]};t.getAllTags=function(n){if(!u(n))return{};var t,i=n.exifdata,r={};for(t in i)i.hasOwnProperty(t)&&(r[t]=i[t]);return r};t.pretty=function(n){if(!u(n))return"";var t,i=n.exifdata,r="";for(t in i)i.hasOwnProperty(t)&&(r+=typeof i[t]=="object"?i[t]instanceof Number?t+" : "+i[t]+" ["+i[t].numerator+"/"+i[t].denominator+"]\r\n":t+" : ["+i[t].length+" values]\r\n":t+" : "+i[t]+"\r\n");return r};t.readFromBinaryFile=function(n){return s(n)};typeof define=="function"&&define.amd&&define("exif-js",[],function(){return t})}.call(this)