politico-assets
Advanced tools
Comparing version 0.4.3 to 0.4.4
@@ -10,2 +10,2 @@ !function(t){function e(s){if(i[s])return i[s].exports;var n=i[s]={i:s,l:!1,exports:{}};return t[s].call(n.exports,n,n.exports,e),n.l=!0,n.exports}var i={};e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,s){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:s})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=5)}([function(t,e,i){"use strict";(function(t){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(){function i(t){var i=Array.isArray(t)?{label:t[0],value:t[1]}:"object"==(void 0===t?"undefined":e(t))&&"label"in t&&"value"in t?t:{label:t,value:t};this.label=i.label||i.value,this.value=i.value}function s(t,e,i){for(var s in e){var n=e[s],a=t.input.getAttribute("data-"+s.toLowerCase());"number"==typeof n?t[s]=parseInt(a):!1===n?t[s]=null!==a:n instanceof Function?t[s]=null:t[s]=a,t[s]||0===t[s]||(t[s]=s in i?i[s]:n)}}function n(t,e){return"string"==typeof t?(e||document).querySelector(t):t||null}function a(t,e){return l.call((e||document).querySelectorAll(t))}function r(){a("input.awesomplete").forEach(function(t){new o(t)})}var o=function t(e,i){var a=this;this.isOpened=!1,this.input=n(e),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("aria-autocomplete","list"),i=i||{},s(this,{minChars:2,maxItems:10,autoFirst:!1,data:t.DATA,filter:t.FILTER_CONTAINS,sort:!1!==i.sort&&t.SORT_BYLENGTH,item:t.ITEM,replace:t.REPLACE},i),this.index=-1,this.container=n.create("div",{className:"awesomplete",around:e}),this.ul=n.create("ul",{hidden:"hidden",inside:this.container}),this.status=n.create("span",{className:"visually-hidden",role:"status","aria-live":"assertive","aria-relevant":"additions",inside:this.container}),this._events={input:{input:this.evaluate.bind(this),blur:this.close.bind(this,{reason:"blur"}),keydown:function(t){var e=t.keyCode;a.opened&&(13===e&&a.selected?(t.preventDefault(),a.select()):27===e?a.close({reason:"esc"}):38!==e&&40!==e||(t.preventDefault(),a[38===e?"previous":"next"]()))}},form:{submit:this.close.bind(this,{reason:"submit"})},ul:{mousedown:function(t){var e=t.target;if(e!==this){for(;e&&!/li/i.test(e.nodeName);)e=e.parentNode;e&&0===t.button&&(t.preventDefault(),a.select(e,t.target))}}}},n.bind(this.input,this._events.input),n.bind(this.input.form,this._events.form),n.bind(this.ul,this._events.ul),this.input.hasAttribute("list")?(this.list="#"+this.input.getAttribute("list"),this.input.removeAttribute("list")):this.list=this.input.getAttribute("data-list")||i.list||[],t.all.push(this)};o.prototype={set list(t){if(Array.isArray(t))this._list=t;else if("string"==typeof t&&t.indexOf(",")>-1)this._list=t.split(/\s*,\s*/);else if((t=n(t))&&t.children){var e=[];l.apply(t.children).forEach(function(t){if(!t.disabled){var i=t.textContent.trim(),s=t.value||i,n=t.label||i;""!==s&&e.push({label:n,value:s})}}),this._list=e}document.activeElement===this.input&&this.evaluate()},get selected(){return this.index>-1},get opened(){return this.isOpened},close:function(t){this.opened&&(this.ul.setAttribute("hidden",""),this.isOpened=!1,this.index=-1,n.fire(this.input,"awesomplete-close",t||{}))},open:function(){this.ul.removeAttribute("hidden"),this.isOpened=!0,this.autoFirst&&-1===this.index&&this.goto(0),n.fire(this.input,"awesomplete-open")},destroy:function(){n.unbind(this.input,this._events.input),n.unbind(this.input.form,this._events.form);var t=this.container.parentNode;t.insertBefore(this.input,this.container),t.removeChild(this.container),this.input.removeAttribute("autocomplete"),this.input.removeAttribute("aria-autocomplete");var e=o.all.indexOf(this);-1!==e&&o.all.splice(e,1)},next:function(){var t=this.ul.children.length;this.goto(this.index<t-1?this.index+1:t?0:-1)},previous:function(){var t=this.ul.children.length,e=this.index-1;this.goto(this.selected&&-1!==e?e:t-1)},goto:function(t){var e=this.ul.children;this.selected&&e[this.index].setAttribute("aria-selected","false"),this.index=t,t>-1&&e.length>0&&(e[t].setAttribute("aria-selected","true"),this.status.textContent=e[t].textContent,this.ul.scrollTop=e[t].offsetTop-this.ul.clientHeight+e[t].clientHeight,n.fire(this.input,"awesomplete-highlight",{text:this.suggestions[this.index]}))},select:function(t,e){if(t?this.index=n.siblingIndex(t):t=this.ul.children[this.index],t){var i=this.suggestions[this.index];n.fire(this.input,"awesomplete-select",{text:i,origin:e||t})&&(this.replace(i),this.close({reason:"select"}),n.fire(this.input,"awesomplete-selectcomplete",{text:i}))}},evaluate:function(){var t=this,e=this.input.value;e.length>=this.minChars&&this._list.length>0?(this.index=-1,this.ul.innerHTML="",this.suggestions=this._list.map(function(s){return new i(t.data(s,e))}).filter(function(i){return t.filter(i,e)}),!1!==this.sort&&(this.suggestions=this.suggestions.sort(this.sort)),this.suggestions=this.suggestions.slice(0,this.maxItems),this.suggestions.forEach(function(i){t.ul.appendChild(t.item(i,e))}),0===this.ul.children.length?this.close({reason:"nomatches"}):this.open()):this.close({reason:"nomatches"})}},o.all=[],o.FILTER_CONTAINS=function(t,e){return RegExp(n.regExpEscape(e.trim()),"i").test(t)},o.FILTER_STARTSWITH=function(t,e){return RegExp("^"+n.regExpEscape(e.trim()),"i").test(t)},o.SORT_BYLENGTH=function(t,e){return t.length!==e.length?t.length-e.length:t<e?-1:1},o.ITEM=function(t,e){return n.create("li",{innerHTML:""===e.trim()?t:t.replace(RegExp(n.regExpEscape(e.trim()),"gi"),"<mark>$&</mark>"),"aria-selected":"false"})},o.REPLACE=function(t){this.input.value=t.value},o.DATA=function(t){return t},Object.defineProperty(i.prototype=Object.create(String.prototype),"length",{get:function(){return this.label.length}}),i.prototype.toString=i.prototype.valueOf=function(){return""+this.label};var l=Array.prototype.slice;n.create=function(t,e){var i=document.createElement(t);for(var s in e){var a=e[s];if("inside"===s)n(a).appendChild(i);else if("around"===s){var r=n(a);r.parentNode.insertBefore(i,r),i.appendChild(r)}else s in i?i[s]=a:i.setAttribute(s,a)}return i},n.bind=function(t,e){if(t)for(var i in e){var s=e[i];i.split(/\s+/).forEach(function(e){t.addEventListener(e,s)})}},n.unbind=function(t,e){if(t)for(var i in e){var s=e[i];i.split(/\s+/).forEach(function(e){t.removeEventListener(e,s)})}},n.fire=function(t,e,i){var s=document.createEvent("HTMLEvents");s.initEvent(e,!0,!0);for(var n in i)s[n]=i[n];return t.dispatchEvent(s)},n.regExpEscape=function(t){return t.replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&")},n.siblingIndex=function(t){for(var e=0;t=t.previousElementSibling;e++);return e},"undefined"!=typeof Document&&("loading"!==document.readyState?r():document.addEventListener("DOMContentLoaded",r)),o.$=n,o.$$=a,"undefined"!=typeof self&&(self.Awesomplete=o),"object"==e(t)&&t.exports&&(t.exports=o)}()}).call(e,i(7)(t))},function(t,e,i){"use strict";var s,n,a;"function"==typeof Symbol&&Symbol.iterator;/*! | ||
*/ | ||
!function(r){n=[i(8)],s=r,void 0!==(a="function"==typeof s?s.apply(e,n):s)&&(t.exports=a)}(function(t){function e(t){return $.call(t).slice(8,-1).toLowerCase()}function i(t){return"string"==typeof t}function s(t){return"number"==typeof t&&!isNaN(t)}function n(t){return void 0===t}function a(t){return"date"===e(t)}function r(t,e){var i=[];return Array.from?Array.from(t).slice(e||0):(s(e)&&i.push(e),i.slice.apply(t,i))}function o(t,e){var i=r(arguments,2);return function(){return t.apply(e,i.concat(r(arguments)))}}function l(t){return t%4==0&&t%100!=0||t%400==0}function h(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}function u(t){var e,i,s=String(t).toLowerCase(),n=s.match(y);if(!n||0===n.length)throw new Error("Invalid date format.");for(t={source:s,parts:n},e=n.length,i=0;i<e;i++)switch(n[i]){case"dd":case"d":t.hasDay=!0;break;case"mm":case"m":t.hasMonth=!0;break;case"yyyy":case"yy":t.hasYear=!0}return t}function c(e,i){i=t.isPlainObject(i)?i:{},i.language&&(i=t.extend({},c.LANGUAGES[i.language],i)),this.$element=t(e),this.options=t.extend({},c.DEFAULTS,i),this.isBuilt=!1,this.isShown=!1,this.isInput=!1,this.isInline=!1,this.initialValue="",this.initialDate=null,this.startDate=null,this.endDate=null,this.init()}var d=t(window),p=window.document,f=t(p),m=window.Number,g="datepicker",v="click.datepicker",y=/(y|m|d)+/g,w=/\d+/g,k=/^\d{2,4}$/,b=["datepicker-top-left","datepicker-top-right","datepicker-bottom-left","datepicker-bottom-right"].join(" "),D="datepicker-hide",x=Math.min,$=Object.prototype.toString;c.prototype={constructor:c,init:function(){var e=this.options,i=this.$element,s=e.startDate,n=e.endDate,a=e.date;this.$trigger=t(e.trigger),this.isInput=i.is("input")||i.is("textarea"),this.isInline=e.inline&&(e.container||!this.isInput),this.format=u(e.format),this.oldValue=this.initialValue=this.getValue(),a=this.parseDate(a||this.initialValue),s&&(s=this.parseDate(s),a.getTime()<s.getTime()&&(a=new Date(s)),this.startDate=s),n&&(n=this.parseDate(n),s&&n.getTime()<s.getTime()&&(n=new Date(s)),a.getTime()>n.getTime()&&(a=new Date(n)),this.endDate=n),this.date=a,this.viewDate=new Date(a),this.initialDate=new Date(this.date),this.bind(),(e.autoShow||this.isInline)&&this.show(),e.autoPick&&this.pick()},build:function(){var e,i=this.options,s=this.$element;this.isBuilt||(this.isBuilt=!0,this.$picker=e=t(i.template),this.$week=e.find('[data-view="week"]'),this.$yearsPicker=e.find('[data-view="years picker"]'),this.$yearsPrev=e.find('[data-view="years prev"]'),this.$yearsNext=e.find('[data-view="years next"]'),this.$yearsCurrent=e.find('[data-view="years current"]'),this.$years=e.find('[data-view="years"]'),this.$monthsPicker=e.find('[data-view="months picker"]'),this.$yearPrev=e.find('[data-view="year prev"]'),this.$yearNext=e.find('[data-view="year next"]'),this.$yearCurrent=e.find('[data-view="year current"]'),this.$months=e.find('[data-view="months"]'),this.$daysPicker=e.find('[data-view="days picker"]'),this.$monthPrev=e.find('[data-view="month prev"]'),this.$monthNext=e.find('[data-view="month next"]'),this.$monthCurrent=e.find('[data-view="month current"]'),this.$days=e.find('[data-view="days"]'),this.isInline?t(i.container||s).append(e.addClass("datepicker-inline")):(t(p.body).append(e.addClass("datepicker-dropdown")),e.addClass(D)),this.fillWeek())},unbuild:function(){this.isBuilt&&(this.isBuilt=!1,this.$picker.remove())},bind:function(){var e=this.options,i=this.$element;t.isFunction(e.show)&&i.on("show.datepicker",e.show),t.isFunction(e.hide)&&i.on("hide.datepicker",e.hide),t.isFunction(e.pick)&&i.on("pick.datepicker",e.pick),this.isInput&&i.on("keyup.datepicker",t.proxy(this.keyup,this)),this.isInline||(e.trigger?this.$trigger.on(v,t.proxy(this.toggle,this)):this.isInput?i.on("focus.datepicker",t.proxy(this.show,this)):i.on(v,t.proxy(this.show,this)))},unbind:function(){var e=this.options,i=this.$element;t.isFunction(e.show)&&i.off("show.datepicker",e.show),t.isFunction(e.hide)&&i.off("hide.datepicker",e.hide),t.isFunction(e.pick)&&i.off("pick.datepicker",e.pick),this.isInput&&i.off("keyup.datepicker",this.keyup),this.isInline||(e.trigger?this.$trigger.off(v,this.toggle):this.isInput?i.off("focus.datepicker",this.show):i.off(v,this.show))},showView:function(t){var e=this.$yearsPicker,i=this.$monthsPicker,s=this.$daysPicker,n=this.format;if(n.hasYear||n.hasMonth||n.hasDay)switch(m(t)){case 2:case"years":i.addClass(D),s.addClass(D),n.hasYear?(this.fillYears(),e.removeClass(D),this.place()):this.showView(0);break;case 1:case"months":e.addClass(D),s.addClass(D),n.hasMonth?(this.fillMonths(),i.removeClass(D),this.place()):this.showView(2);break;default:e.addClass(D),i.addClass(D),n.hasDay?(this.fillDays(),s.removeClass(D),this.place()):this.showView(1)}},hideView:function(){!this.isInline&&this.options.autoHide&&this.hide()},place:function(){if(!this.isInline){var t=this.options,e=this.$element,i=this.$picker,s=f.outerWidth(),n=f.outerHeight(),a=e.outerWidth(),r=e.outerHeight(),o=i.width(),l=i.height(),h=e.offset(),u=h.left,c=h.top,d=parseFloat(t.offset)||10,p="datepicker-top-left";c>l&&c+r+l>n?(c-=l+d,p="datepicker-bottom-left"):c+=r+d,u+o>s&&(u=u+a-o,p=p.replace("left","right")),i.removeClass(b).addClass(p).css({top:c,left:u,zIndex:parseInt(t.zIndex,10)})}},trigger:function(e,i){var s=t.Event(e,i);return this.$element.trigger(s),s},createItem:function(e){var i=this.options,s=i.itemTag,n={text:"",view:"",muted:!1,picked:!1,disabled:!1,highlighted:!1},a=[];return t.extend(n,e),n.muted&&a.push(i.mutedClass),n.highlighted&&a.push(i.highlightedClass),n.picked&&a.push(i.pickedClass),n.disabled&&a.push(i.disabledClass),"<"+s+' class="'+a.join(" ")+'"'+(n.view?' data-view="'+n.view+'"':"")+">"+n.text+"</"+s+">"},fillAll:function(){this.fillYears(),this.fillMonths(),this.fillDays()},fillWeek:function(){var e,i=this.options,s=parseInt(i.weekStart,10)%7,n=i.daysMin,a="";for(n=t.merge(n.slice(s),n.slice(0,s)),e=0;e<=6;e++)a+=this.createItem({text:n[e]});this.$week.html(a)},fillYears:function(){var e,i=this.options,s=i.disabledClass||"",n=i.yearSuffix||"",a=t.isFunction(i.filter)&&i.filter,r=this.startDate,o=this.endDate,l=this.viewDate,h=l.getFullYear(),u=l.getMonth(),c=l.getDate(),d=this.date,p=d.getFullYear(),f=!1,m=!1,g=!1,v=!1,y=!1,w="";for(e=-5;e<=6;e++)d=new Date(h+e,u,c),y=-5===e||6===e,v=h+e===p,g=!1,r&&(g=d.getFullYear()<r.getFullYear(),-5===e&&(f=g)),!g&&o&&(g=d.getFullYear()>o.getFullYear(),6===e&&(m=g)),!g&&a&&(g=!1===a.call(this.$element,d)),w+=this.createItem({text:h+e,view:g?"year disabled":v?"year picked":"year",muted:y,picked:v,disabled:g});this.$yearsPrev.toggleClass(s,f),this.$yearsNext.toggleClass(s,m),this.$yearsCurrent.toggleClass(s,!0).html(h+-5+n+" - "+(h+6)+n),this.$years.html(w)},fillMonths:function(){var e,i=this.options,s=i.disabledClass||"",n=i.monthsShort,a=t.isFunction(i.filter)&&i.filter,r=this.startDate,o=this.endDate,l=this.viewDate,h=l.getFullYear(),u=l.getDate(),c=this.date,d=c.getFullYear(),p=c.getMonth(),f=!1,m=!1,g=!1,v=!1,y="";for(e=0;e<=11;e++)c=new Date(h,e,u),v=h===d&&e===p,g=!1,r&&(f=c.getFullYear()===r.getFullYear(),g=f&&c.getMonth()<r.getMonth()),!g&&o&&(m=c.getFullYear()===o.getFullYear(),g=m&&c.getMonth()>o.getMonth()),!g&&a&&(g=!1===a.call(this.$element,c)),y+=this.createItem({index:e,text:n[e],view:g?"month disabled":v?"month picked":"month",picked:v,disabled:g});this.$yearPrev.toggleClass(s,f),this.$yearNext.toggleClass(s,m),this.$yearCurrent.toggleClass(s,f&&m).html(h+i.yearSuffix||""),this.$months.html(y)},fillDays:function(){var e,i,s,n=this.options,a=n.disabledClass||"",r=n.yearSuffix||"",o=n.monthsShort,l=parseInt(n.weekStart,10)%7,u=t.isFunction(n.filter)&&n.filter,c=this.startDate,d=this.endDate,p=this.viewDate,f=p.getFullYear(),m=p.getMonth(),g=f,v=m,y=f,w=new Date,k=w.getFullYear(),b=w.getMonth(),D=w.getDate(),x=m,$=this.date,C=$.getFullYear(),S=$.getMonth(),A=$.getDate(),T=!1,I=!1,E=!1,F=!1,M=[],_=[],V=[];for(0===m?(g-=1,v=11):v-=1,e=h(g,v),$=new Date(f,m,1),s=$.getDay()-l,s<=0&&(s+=7),c&&(T=$.getTime()<=c.getTime()),i=e-(s-1);i<=e;i++)$=new Date(g,v,i),E=!1,c&&(E=$.getTime()<c.getTime()),!E&&u&&(E=!1===u.call(this.$element,$)),M.push(this.createItem({text:i,view:"day prev",muted:!0,disabled:E,highlighted:g===k&&v===b&&$.getDate()===D}));for(11===m?(y+=1,x=0):x+=1,e=h(f,m),s=42-(M.length+e),$=new Date(f,m,e),d&&(I=$.getTime()>=d.getTime()),i=1;i<=s;i++)$=new Date(y,x,i),E=!1,d&&(E=$.getTime()>d.getTime()),!E&&u&&(E=!1===u.call(this.$element,$)),_.push(this.createItem({text:i,view:"day next",muted:!0,disabled:E,highlighted:y===k&&x===b&&$.getDate()===D}));for(i=1;i<=e;i++)$=new Date(f,m,i),F=f===C&&m===S&&i===A,E=!1,c&&(E=$.getTime()<c.getTime()),!E&&d&&(E=$.getTime()>d.getTime()),!E&&u&&(E=!1===u.call(this.$element,$)),V.push(this.createItem({text:i,view:E?"day disabled":F?"day picked":"day",picked:F,disabled:E,highlighted:f===k&&m===b&&$.getDate()===D}));this.$monthPrev.toggleClass(a,T),this.$monthNext.toggleClass(a,I),this.$monthCurrent.toggleClass(a,T&&I).html(n.yearFirst?f+r+" "+o[m]:o[m]+" "+f+r),this.$days.html(M.join("")+V.join(" ")+_.join(""))},click:function(e){var i,s,n,a,r,o,l=t(e.target),h=this.viewDate;if(e.stopPropagation(),e.preventDefault(),!l.hasClass("disabled"))switch(i=h.getFullYear(),s=h.getMonth(),n=h.getDate(),o=l.data("view")){case"years prev":case"years next":i="years prev"===o?i-10:i+10,r=l.text(),a=k.test(r),a&&(i=parseInt(r,10),this.date=new Date(i,s,x(n,28))),this.viewDate=new Date(i,s,x(n,28)),this.fillYears(),a&&(this.showView(1),this.pick("year"));break;case"year prev":case"year next":i="year prev"===o?i-1:i+1,this.viewDate=new Date(i,s,x(n,28)),this.fillMonths();break;case"year current":this.format.hasYear&&this.showView(2);break;case"year picked":this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"year":i=parseInt(l.text(),10),this.date=new Date(i,s,x(n,28)),this.viewDate=new Date(i,s,x(n,28)),this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"month prev":case"month next":s="month prev"===o?s-1:"month next"===o?s+1:s,this.viewDate=new Date(i,s,x(n,28)),this.fillDays();break;case"month current":this.format.hasMonth&&this.showView(1);break;case"month picked":this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"month":s=t.inArray(l.text(),this.options.monthsShort),this.date=new Date(i,s,x(n,28)),this.viewDate=new Date(i,s,x(n,28)),this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"day prev":case"day next":case"day":s="day prev"===o?s-1:"day next"===o?s+1:s,n=parseInt(l.text(),10),this.date=new Date(i,s,n),this.viewDate=new Date(i,s,n),this.fillDays(),"day"===o&&this.hideView(),this.pick("day");break;case"day picked":this.hideView(),this.pick("day")}},clickDoc:function(t){for(var e,i=t.target,s=this.$element[0],n=this.$trigger[0];i!==p;){if(i===n||i===s){e=!0;break}i=i.parentNode}e||this.hide()},keyup:function(){this.update()},keyupDoc:function(t){this.isInput&&t.target!==this.$element[0]&&this.isShown&&("Tab"===t.key||9===t.keyCode)&&this.hide()},getValue:function(){var t=this.$element,e="";return this.isInput?e=t.val():this.isInline?this.options.container&&(e=t.text()):e=t.text(),e},setValue:function(t){var e=this.$element;t=i(t)?t:"",this.isInput?e.val(t):this.isInline?this.options.container&&e.text(t):e.text(t)},show:function(){this.isBuilt||this.build(),this.isShown||this.trigger("show.datepicker").isDefaultPrevented()||(this.isShown=!0,this.$picker.removeClass(D).on(v,t.proxy(this.click,this)),this.showView(this.options.startView),this.isInline||(d.on("resize.datepicker",this._place=o(this.place,this)),f.on(v,this._clickDoc=o(this.clickDoc,this)),f.on("keyup.datepicker",this._keyupDoc=o(this.keyupDoc,this)),this.place()))},hide:function(){this.isShown&&(this.trigger("hide.datepicker").isDefaultPrevented()||(this.isShown=!1,this.$picker.addClass(D).off(v,this.click),this.isInline||(d.off("resize.datepicker",this._place),f.off(v,this._clickDoc),f.off("keyup.datepicker",this._keyupDoc))))},toggle:function(){this.isShown?this.hide():this.show()},update:function(){var t=this.getValue();t!==this.oldValue&&(this.setDate(t,!0),this.oldValue=t)},pick:function(t){var e=this.$element,i=this.date;this.trigger("pick.datepicker",{view:t||"",date:i}).isDefaultPrevented()||(this.setValue(i=this.formatDate(this.date)),this.isInput&&e.trigger("change"))},reset:function(){this.setDate(this.initialDate,!0),this.setValue(this.initialValue),this.isShown&&this.showView(this.options.startView)},getMonthName:function(e,i){var a=this.options,r=a.months;return t.isNumeric(e)?e=m(e):n(i)&&(i=e),!0===i&&(r=a.monthsShort),r[s(e)?e:this.date.getMonth()]},getDayName:function(e,i,a){var r=this.options,o=r.days;return t.isNumeric(e)?e=m(e):(n(a)&&(a=i),n(i)&&(i=e)),o=!0===a?r.daysMin:!0===i?r.daysShort:o,o[s(e)?e:this.date.getDay()]},getDate:function(t){var e=this.date;return t?this.formatDate(e):new Date(e)},setDate:function(e,s){var n=this.options.filter;if(a(e)||i(e)){if(e=this.parseDate(e),t.isFunction(n)&&!1===n.call(this.$element,e))return;this.date=e,this.viewDate=new Date(e),s||this.pick(),this.isBuilt&&this.fillAll()}},setStartDate:function(t){(a(t)||i(t))&&(this.startDate=this.parseDate(t),this.isBuilt&&this.fillAll())},setEndDate:function(t){(a(t)||i(t))&&(this.endDate=this.parseDate(t),this.isBuilt&&this.fillAll())},parseDate:function(t){var e,s,n,r,o,l,h=this.format,u=[];if(a(t))return new Date(t.getFullYear(),t.getMonth(),t.getDate());if(i(t)&&(u=t.match(w)||[]),t=new Date,s=t.getFullYear(),n=t.getDate(),r=t.getMonth(),e=h.parts.length,u.length===e)for(l=0;l<e;l++)switch(o=parseInt(u[l],10)||1,h.parts[l]){case"dd":case"d":n=o;break;case"mm":case"m":r=o-1;break;case"yy":s=2e3+o;break;case"yyyy":s=o}return new Date(s,r,n)},formatDate:function(t){var e,i,s,n,r,o=this.format,l="";if(a(t))for(l=o.source,i=t.getFullYear(),n={d:t.getDate(),m:t.getMonth()+1,yy:i.toString().substring(2),yyyy:i},n.dd=(n.d<10?"0":"")+n.d,n.mm=(n.m<10?"0":"")+n.m,e=o.parts.length,r=0;r<e;r++)s=o.parts[r],l=l.replace(s,n[s]);return l},destroy:function(){this.unbind(),this.unbuild(),this.$element.removeData(g)}},c.LANGUAGES={},c.DEFAULTS={autoShow:!1,autoHide:!1,autoPick:!1,inline:!1,container:null,trigger:null,language:"",format:"mm/dd/yyyy",date:null,startDate:null,endDate:null,startView:0,weekStart:0,yearFirst:!1,yearSuffix:"",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],itemTag:"li",mutedClass:"muted",pickedClass:"picked",disabledClass:"disabled",highlightedClass:"highlighted",template:'<div class="datepicker-container"><div class="datepicker-panel" data-view="years picker"><ul><li data-view="years prev">‹</li><li data-view="years current"></li><li data-view="years next">›</li></ul><ul data-view="years"></ul></div><div class="datepicker-panel" data-view="months picker"><ul><li data-view="year prev">‹</li><li data-view="year current"></li><li data-view="year next">›</li></ul><ul data-view="months"></ul></div><div class="datepicker-panel" data-view="days picker"><ul><li data-view="month prev">‹</li><li data-view="month current"></li><li data-view="month next">›</li></ul><ul data-view="week"></ul><ul data-view="days"></ul></div></div>',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},c.setDefaults=function(e){e=t.isPlainObject(e)?e:{},e.language&&(e=t.extend({},c.LANGUAGES[e.language],e)),t.extend(c.DEFAULTS,e)},c.other=t.fn.datepicker,t.fn.datepicker=function(e){var s,a=r(arguments,1);return this.each(function(){var n,r,o=t(this),l=o.data(g);if(!l){if(/destroy/.test(e))return;n=t.extend({},o.data(),t.isPlainObject(e)&&e),o.data(g,l=new c(this,n))}i(e)&&t.isFunction(r=l[e])&&(s=r.apply(l,a))}),n(s)?this:s},t.fn.datepicker.Constructor=c,t.fn.datepicker.languages=c.LANGUAGES,t.fn.datepicker.setDefaults=c.setDefaults,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=c.other,this}})},function(t,e,i){"use strict";$(document).on("click","#js-add-bill-to-folder",function(){if(modal.openBg(),document.location.search.indexOf("amendment_id")>0)var t=document.location.search.split("=")[1];else var t=document.location.pathname.split("/")[3];$.get("/legislative-compass/_lc_folder?task=list-name&bill="+t,function(t){var e=$(".js-modal-add-bill-to-folder");if(t.length>0){e.find(".js-bill-folders").removeClass("dn");for(var i=e.find(".js-bill-folders ul"),s="",n=t.length-1;n>=0;n--)s+="<li>"+t[n]+"</li>";i.html(s)}var a=$(".js-modal-add-bill-to-folder").html();modal.open("Add to Folder",a),$(".lc-modal").css("overflow","initial"),$.get("/legislative-compass/_lc_folder?task=list-name",function(t){console.log(t);var e=document.getElementById("js-modal-input-folder");new Awesomplete(e,{minChars:3}).list=t})})})},function(t,e,i){"use strict";function s(t){return(0,r.debounce)(function(){var e=$(this),i=e.val().trim();i.length>1&&0==h&&(h=!0,$.ajax({type:"GET",url:"/legislative-compass/_search_crsIssueArea_lookup",data:{text:i},success:n(t,e)}))},333)}function n(t,e){return function(i){if(h=!1,null!=i&&void 0==i.success){var s=$(t).val()||[],n=i.map(function(t){return t.name||t.term}),r=n.filter(function(t){return-1==s.indexOf(t)}),o=r.concat(s),l=o.map(a),u=e.val();$(t).html(l).val(s).trigger("chosen:updated"),e.val(u)}}}function a(t){var e=document.createElement("option");return e.value=t,e.innerText=t,e}var r=i(6),o=(0,r.debounce)(function(){var t=$(this).val(),e=$(this);if(t.length>1&&0==h){h=!0;var i=null!=$("#states").val()?$("#states").val().toString():"",s={text:t,jurisdiction:""!=i?i:"US"};$.ajax({type:"GET",url:"/legislative-compass/_search_committee_lookup",data:s,success:n("#committee-filter",e)})}},333),l=(0,r.debounce)(function(){var t=$(this),e=t.closest(".awesomplete"),i=$(this).val();i.includes("Rep.")?$("#voteCast").prop("disabled",!1):($("#voteCast").prop("disabled",!0),$("#voteCast").val("")),i.length>1&&0==h&&(h=!0,e.addClass("is-loading"),$.ajax({type:"GET",url:"/legislative-compass/_search_legislator_lookup",data:{text:i}}).done(function(t){if(h=!1,e.removeClass("is-loading"),t.length>0){var s=t.map(function(t){return t.name});c=c.concat(s.filter(function(t){return c.indexOf(t)<0})),c.indexOf(i)&&rollCallVoteSearch(),d.list=c}else d.list=[]}))},333),h=!1;$(document).on("input","#committeeFilterList input",o).on("input","#crsIssueAreaListItem input",s("#crsIssueArea")).on("input","#issueArea_chosen input",s("#issueArea")).on("input","#legislator",l).on("keyup","#legislator",function(t){8==t.which&&p&&(this.value="",p=!1,rollCallVoteSearch()),this.value.length<3&&(d.list=[])});var u=$("#legislator"),c=[],d=void 0,p=!1;u.length&&(u.on("awesomplete-selectcomplete",function(t){p=!0,rollCallVoteSearch();var e=this.value;e.includes("Rep.")||e.includes("Sen.")?$("#voteCast").prop("disabled",!1):($("#voteCast").prop("disabled",!0),$("#voteCast").val(""))}),c=$("#legislatorList option").toArray().map(function(t){return t.value}),d=new Awesomplete(u[0],{minChars:2,maxItems:5}),d.list=c)},function(t,e,i){"use strict";!function(){function t(){var i,s=this.querySelectorAll("template"),n=[],a=0;if(e){for(i=this.cloneNode(!0),s=i.content.querySelectorAll("template");s[a];a++)s[a].clone=t;return i}for(;s[a];a++)n.push(s[a].content);for(i=this.cloneNode(!0),i.content=this.content,i.clone=t,s=i.querySelectorAll("template"),a=0;s[a];a++)s[a].content=n[a],s[a].clone=t;return i}var e="content"in document.createElement("template");if(!e)for(var i,s,n,a,r,o=Array.prototype.slice.call(document.getElementsByTagName("template")),l=0;i=o[l++];){for(s=i.children,n=document.createDocumentFragment(),r=0;a=s[r];r++)n.appendChild(a);i.content=n}for(var i,o=document.querySelectorAll("template"),l=0;i=o[l++];)i.clone=t}()},function(t,e,i){"use strict";i(4),i(1),i(0),i(3),i(2),$(document).ready(function(){var t=new Date;$(".js-datepicker").datepicker({daysMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],endDate:t,offset:-1}),$(".js-chosen").chosen()}),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&$("html").addClass("ios")},function(t,e,i){"use strict";function s(t,e,i){var s;return function(){var n=this,a=arguments,r=function(){s=null,i||t.apply(n,a)},o=i&&!s;clearTimeout(s),s=setTimeout(r,e),o&&t.apply(n,a)}}function n(t,e,i){e||(e=250);var s,n;return function(){var a=i||this,r=+new Date,o=arguments;s&&r<s+e?(clearTimeout(n),n=setTimeout(function(){s=r,t.apply(a,o)},e)):(s=r,t.apply(a,o))}}Object.defineProperty(e,"__esModule",{value:!0}),e.debounce=s,e.throttle=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=jQuery}]); | ||
!function(r){n=[i(8)],s=r,void 0!==(a="function"==typeof s?s.apply(e,n):s)&&(t.exports=a)}(function(t){function e(t){return $.call(t).slice(8,-1).toLowerCase()}function i(t){return"string"==typeof t}function s(t){return"number"==typeof t&&!isNaN(t)}function n(t){return void 0===t}function a(t){return"date"===e(t)}function r(t,e){var i=[];return Array.from?Array.from(t).slice(e||0):(s(e)&&i.push(e),i.slice.apply(t,i))}function o(t,e){var i=r(arguments,2);return function(){return t.apply(e,i.concat(r(arguments)))}}function l(t){return t%4==0&&t%100!=0||t%400==0}function h(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}function u(t){var e,i,s=String(t).toLowerCase(),n=s.match(y);if(!n||0===n.length)throw new Error("Invalid date format.");for(t={source:s,parts:n},e=n.length,i=0;i<e;i++)switch(n[i]){case"dd":case"d":t.hasDay=!0;break;case"mm":case"m":t.hasMonth=!0;break;case"yyyy":case"yy":t.hasYear=!0}return t}function c(e,i){i=t.isPlainObject(i)?i:{},i.language&&(i=t.extend({},c.LANGUAGES[i.language],i)),this.$element=t(e),this.options=t.extend({},c.DEFAULTS,i),this.isBuilt=!1,this.isShown=!1,this.isInput=!1,this.isInline=!1,this.initialValue="",this.initialDate=null,this.startDate=null,this.endDate=null,this.init()}var d=t(window),p=window.document,f=t(p),m=window.Number,g="datepicker",v="click.datepicker",y=/(y|m|d)+/g,w=/\d+/g,b=/^\d{2,4}$/,k=["datepicker-top-left","datepicker-top-right","datepicker-bottom-left","datepicker-bottom-right"].join(" "),D="datepicker-hide",x=Math.min,$=Object.prototype.toString;c.prototype={constructor:c,init:function(){var e=this.options,i=this.$element,s=e.startDate,n=e.endDate,a=e.date;this.$trigger=t(e.trigger),this.isInput=i.is("input")||i.is("textarea"),this.isInline=e.inline&&(e.container||!this.isInput),this.format=u(e.format),this.oldValue=this.initialValue=this.getValue(),a=this.parseDate(a||this.initialValue),s&&(s=this.parseDate(s),a.getTime()<s.getTime()&&(a=new Date(s)),this.startDate=s),n&&(n=this.parseDate(n),s&&n.getTime()<s.getTime()&&(n=new Date(s)),a.getTime()>n.getTime()&&(a=new Date(n)),this.endDate=n),this.date=a,this.viewDate=new Date(a),this.initialDate=new Date(this.date),this.bind(),(e.autoShow||this.isInline)&&this.show(),e.autoPick&&this.pick()},build:function(){var e,i=this.options,s=this.$element;this.isBuilt||(this.isBuilt=!0,this.$picker=e=t(i.template),this.$week=e.find('[data-view="week"]'),this.$yearsPicker=e.find('[data-view="years picker"]'),this.$yearsPrev=e.find('[data-view="years prev"]'),this.$yearsNext=e.find('[data-view="years next"]'),this.$yearsCurrent=e.find('[data-view="years current"]'),this.$years=e.find('[data-view="years"]'),this.$monthsPicker=e.find('[data-view="months picker"]'),this.$yearPrev=e.find('[data-view="year prev"]'),this.$yearNext=e.find('[data-view="year next"]'),this.$yearCurrent=e.find('[data-view="year current"]'),this.$months=e.find('[data-view="months"]'),this.$daysPicker=e.find('[data-view="days picker"]'),this.$monthPrev=e.find('[data-view="month prev"]'),this.$monthNext=e.find('[data-view="month next"]'),this.$monthCurrent=e.find('[data-view="month current"]'),this.$days=e.find('[data-view="days"]'),this.isInline?t(i.container||s).append(e.addClass("datepicker-inline")):(t(p.body).append(e.addClass("datepicker-dropdown")),e.addClass(D)),this.fillWeek())},unbuild:function(){this.isBuilt&&(this.isBuilt=!1,this.$picker.remove())},bind:function(){var e=this.options,i=this.$element;t.isFunction(e.show)&&i.on("show.datepicker",e.show),t.isFunction(e.hide)&&i.on("hide.datepicker",e.hide),t.isFunction(e.pick)&&i.on("pick.datepicker",e.pick),this.isInput&&i.on("keyup.datepicker",t.proxy(this.keyup,this)),this.isInline||(e.trigger?this.$trigger.on(v,t.proxy(this.toggle,this)):this.isInput?i.on("focus.datepicker",t.proxy(this.show,this)):i.on(v,t.proxy(this.show,this)))},unbind:function(){var e=this.options,i=this.$element;t.isFunction(e.show)&&i.off("show.datepicker",e.show),t.isFunction(e.hide)&&i.off("hide.datepicker",e.hide),t.isFunction(e.pick)&&i.off("pick.datepicker",e.pick),this.isInput&&i.off("keyup.datepicker",this.keyup),this.isInline||(e.trigger?this.$trigger.off(v,this.toggle):this.isInput?i.off("focus.datepicker",this.show):i.off(v,this.show))},showView:function(t){var e=this.$yearsPicker,i=this.$monthsPicker,s=this.$daysPicker,n=this.format;if(n.hasYear||n.hasMonth||n.hasDay)switch(m(t)){case 2:case"years":i.addClass(D),s.addClass(D),n.hasYear?(this.fillYears(),e.removeClass(D),this.place()):this.showView(0);break;case 1:case"months":e.addClass(D),s.addClass(D),n.hasMonth?(this.fillMonths(),i.removeClass(D),this.place()):this.showView(2);break;default:e.addClass(D),i.addClass(D),n.hasDay?(this.fillDays(),s.removeClass(D),this.place()):this.showView(1)}},hideView:function(){!this.isInline&&this.options.autoHide&&this.hide()},place:function(){if(!this.isInline){var t=this.options,e=this.$element,i=this.$picker,s=f.outerWidth(),n=f.outerHeight(),a=e.outerWidth(),r=e.outerHeight(),o=i.width(),l=i.height(),h=e.offset(),u=h.left,c=h.top,d=parseFloat(t.offset)||10,p="datepicker-top-left";c>l&&c+r+l>n?(c-=l+d,p="datepicker-bottom-left"):c+=r+d,u+o>s&&(u=u+a-o,p=p.replace("left","right")),i.removeClass(k).addClass(p).css({top:c,left:u,zIndex:parseInt(t.zIndex,10)})}},trigger:function(e,i){var s=t.Event(e,i);return this.$element.trigger(s),s},createItem:function(e){var i=this.options,s=i.itemTag,n={text:"",view:"",muted:!1,picked:!1,disabled:!1,highlighted:!1},a=[];return t.extend(n,e),n.muted&&a.push(i.mutedClass),n.highlighted&&a.push(i.highlightedClass),n.picked&&a.push(i.pickedClass),n.disabled&&a.push(i.disabledClass),"<"+s+' class="'+a.join(" ")+'"'+(n.view?' data-view="'+n.view+'"':"")+">"+n.text+"</"+s+">"},fillAll:function(){this.fillYears(),this.fillMonths(),this.fillDays()},fillWeek:function(){var e,i=this.options,s=parseInt(i.weekStart,10)%7,n=i.daysMin,a="";for(n=t.merge(n.slice(s),n.slice(0,s)),e=0;e<=6;e++)a+=this.createItem({text:n[e]});this.$week.html(a)},fillYears:function(){var e,i=this.options,s=i.disabledClass||"",n=i.yearSuffix||"",a=t.isFunction(i.filter)&&i.filter,r=this.startDate,o=this.endDate,l=this.viewDate,h=l.getFullYear(),u=l.getMonth(),c=l.getDate(),d=this.date,p=d.getFullYear(),f=!1,m=!1,g=!1,v=!1,y=!1,w="";for(e=-5;e<=6;e++)d=new Date(h+e,u,c),y=-5===e||6===e,v=h+e===p,g=!1,r&&(g=d.getFullYear()<r.getFullYear(),-5===e&&(f=g)),!g&&o&&(g=d.getFullYear()>o.getFullYear(),6===e&&(m=g)),!g&&a&&(g=!1===a.call(this.$element,d)),w+=this.createItem({text:h+e,view:g?"year disabled":v?"year picked":"year",muted:y,picked:v,disabled:g});this.$yearsPrev.toggleClass(s,f),this.$yearsNext.toggleClass(s,m),this.$yearsCurrent.toggleClass(s,!0).html(h+-5+n+" - "+(h+6)+n),this.$years.html(w)},fillMonths:function(){var e,i=this.options,s=i.disabledClass||"",n=i.monthsShort,a=t.isFunction(i.filter)&&i.filter,r=this.startDate,o=this.endDate,l=this.viewDate,h=l.getFullYear(),u=l.getDate(),c=this.date,d=c.getFullYear(),p=c.getMonth(),f=!1,m=!1,g=!1,v=!1,y="";for(e=0;e<=11;e++)c=new Date(h,e,u),v=h===d&&e===p,g=!1,r&&(f=c.getFullYear()===r.getFullYear(),g=f&&c.getMonth()<r.getMonth()),!g&&o&&(m=c.getFullYear()===o.getFullYear(),g=m&&c.getMonth()>o.getMonth()),!g&&a&&(g=!1===a.call(this.$element,c)),y+=this.createItem({index:e,text:n[e],view:g?"month disabled":v?"month picked":"month",picked:v,disabled:g});this.$yearPrev.toggleClass(s,f),this.$yearNext.toggleClass(s,m),this.$yearCurrent.toggleClass(s,f&&m).html(h+i.yearSuffix||""),this.$months.html(y)},fillDays:function(){var e,i,s,n=this.options,a=n.disabledClass||"",r=n.yearSuffix||"",o=n.monthsShort,l=parseInt(n.weekStart,10)%7,u=t.isFunction(n.filter)&&n.filter,c=this.startDate,d=this.endDate,p=this.viewDate,f=p.getFullYear(),m=p.getMonth(),g=f,v=m,y=f,w=new Date,b=w.getFullYear(),k=w.getMonth(),D=w.getDate(),x=m,$=this.date,C=$.getFullYear(),S=$.getMonth(),A=$.getDate(),T=!1,I=!1,E=!1,F=!1,M=[],j=[],_=[];for(0===m?(g-=1,v=11):v-=1,e=h(g,v),$=new Date(f,m,1),s=$.getDay()-l,s<=0&&(s+=7),c&&(T=$.getTime()<=c.getTime()),i=e-(s-1);i<=e;i++)$=new Date(g,v,i),E=!1,c&&(E=$.getTime()<c.getTime()),!E&&u&&(E=!1===u.call(this.$element,$)),M.push(this.createItem({text:i,view:"day prev",muted:!0,disabled:E,highlighted:g===b&&v===k&&$.getDate()===D}));for(11===m?(y+=1,x=0):x+=1,e=h(f,m),s=42-(M.length+e),$=new Date(f,m,e),d&&(I=$.getTime()>=d.getTime()),i=1;i<=s;i++)$=new Date(y,x,i),E=!1,d&&(E=$.getTime()>d.getTime()),!E&&u&&(E=!1===u.call(this.$element,$)),j.push(this.createItem({text:i,view:"day next",muted:!0,disabled:E,highlighted:y===b&&x===k&&$.getDate()===D}));for(i=1;i<=e;i++)$=new Date(f,m,i),F=f===C&&m===S&&i===A,E=!1,c&&(E=$.getTime()<c.getTime()),!E&&d&&(E=$.getTime()>d.getTime()),!E&&u&&(E=!1===u.call(this.$element,$)),_.push(this.createItem({text:i,view:E?"day disabled":F?"day picked":"day",picked:F,disabled:E,highlighted:f===b&&m===k&&$.getDate()===D}));this.$monthPrev.toggleClass(a,T),this.$monthNext.toggleClass(a,I),this.$monthCurrent.toggleClass(a,T&&I).html(n.yearFirst?f+r+" "+o[m]:o[m]+" "+f+r),this.$days.html(M.join("")+_.join(" ")+j.join(""))},click:function(e){var i,s,n,a,r,o,l=t(e.target),h=this.viewDate;if(e.stopPropagation(),e.preventDefault(),!l.hasClass("disabled"))switch(i=h.getFullYear(),s=h.getMonth(),n=h.getDate(),o=l.data("view")){case"years prev":case"years next":i="years prev"===o?i-10:i+10,r=l.text(),a=b.test(r),a&&(i=parseInt(r,10),this.date=new Date(i,s,x(n,28))),this.viewDate=new Date(i,s,x(n,28)),this.fillYears(),a&&(this.showView(1),this.pick("year"));break;case"year prev":case"year next":i="year prev"===o?i-1:i+1,this.viewDate=new Date(i,s,x(n,28)),this.fillMonths();break;case"year current":this.format.hasYear&&this.showView(2);break;case"year picked":this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"year":i=parseInt(l.text(),10),this.date=new Date(i,s,x(n,28)),this.viewDate=new Date(i,s,x(n,28)),this.format.hasMonth?this.showView(1):this.hideView(),this.pick("year");break;case"month prev":case"month next":s="month prev"===o?s-1:"month next"===o?s+1:s,this.viewDate=new Date(i,s,x(n,28)),this.fillDays();break;case"month current":this.format.hasMonth&&this.showView(1);break;case"month picked":this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"month":s=t.inArray(l.text(),this.options.monthsShort),this.date=new Date(i,s,x(n,28)),this.viewDate=new Date(i,s,x(n,28)),this.format.hasDay?this.showView(0):this.hideView(),this.pick("month");break;case"day prev":case"day next":case"day":s="day prev"===o?s-1:"day next"===o?s+1:s,n=parseInt(l.text(),10),this.date=new Date(i,s,n),this.viewDate=new Date(i,s,n),this.fillDays(),"day"===o&&this.hideView(),this.pick("day");break;case"day picked":this.hideView(),this.pick("day")}},clickDoc:function(t){for(var e,i=t.target,s=this.$element[0],n=this.$trigger[0];i!==p;){if(i===n||i===s){e=!0;break}i=i.parentNode}e||this.hide()},keyup:function(){this.update()},keyupDoc:function(t){this.isInput&&t.target!==this.$element[0]&&this.isShown&&("Tab"===t.key||9===t.keyCode)&&this.hide()},getValue:function(){var t=this.$element,e="";return this.isInput?e=t.val():this.isInline?this.options.container&&(e=t.text()):e=t.text(),e},setValue:function(t){var e=this.$element;t=i(t)?t:"",this.isInput?e.val(t):this.isInline?this.options.container&&e.text(t):e.text(t)},show:function(){this.isBuilt||this.build(),this.isShown||this.trigger("show.datepicker").isDefaultPrevented()||(this.isShown=!0,this.$picker.removeClass(D).on(v,t.proxy(this.click,this)),this.showView(this.options.startView),this.isInline||(d.on("resize.datepicker",this._place=o(this.place,this)),f.on(v,this._clickDoc=o(this.clickDoc,this)),f.on("keyup.datepicker",this._keyupDoc=o(this.keyupDoc,this)),this.place()))},hide:function(){this.isShown&&(this.trigger("hide.datepicker").isDefaultPrevented()||(this.isShown=!1,this.$picker.addClass(D).off(v,this.click),this.isInline||(d.off("resize.datepicker",this._place),f.off(v,this._clickDoc),f.off("keyup.datepicker",this._keyupDoc))))},toggle:function(){this.isShown?this.hide():this.show()},update:function(){var t=this.getValue();t!==this.oldValue&&(this.setDate(t,!0),this.oldValue=t)},pick:function(t){var e=this.$element,i=this.date;this.trigger("pick.datepicker",{view:t||"",date:i}).isDefaultPrevented()||(this.setValue(i=this.formatDate(this.date)),this.isInput&&e.trigger("change"))},reset:function(){this.setDate(this.initialDate,!0),this.setValue(this.initialValue),this.isShown&&this.showView(this.options.startView)},getMonthName:function(e,i){var a=this.options,r=a.months;return t.isNumeric(e)?e=m(e):n(i)&&(i=e),!0===i&&(r=a.monthsShort),r[s(e)?e:this.date.getMonth()]},getDayName:function(e,i,a){var r=this.options,o=r.days;return t.isNumeric(e)?e=m(e):(n(a)&&(a=i),n(i)&&(i=e)),o=!0===a?r.daysMin:!0===i?r.daysShort:o,o[s(e)?e:this.date.getDay()]},getDate:function(t){var e=this.date;return t?this.formatDate(e):new Date(e)},setDate:function(e,s){var n=this.options.filter;if(a(e)||i(e)){if(e=this.parseDate(e),t.isFunction(n)&&!1===n.call(this.$element,e))return;this.date=e,this.viewDate=new Date(e),s||this.pick(),this.isBuilt&&this.fillAll()}},setStartDate:function(t){(a(t)||i(t))&&(this.startDate=this.parseDate(t),this.isBuilt&&this.fillAll())},setEndDate:function(t){(a(t)||i(t))&&(this.endDate=this.parseDate(t),this.isBuilt&&this.fillAll())},parseDate:function(t){var e,s,n,r,o,l,h=this.format,u=[];if(a(t))return new Date(t.getFullYear(),t.getMonth(),t.getDate());if(i(t)&&(u=t.match(w)||[]),t=new Date,s=t.getFullYear(),n=t.getDate(),r=t.getMonth(),e=h.parts.length,u.length===e)for(l=0;l<e;l++)switch(o=parseInt(u[l],10)||1,h.parts[l]){case"dd":case"d":n=o;break;case"mm":case"m":r=o-1;break;case"yy":s=2e3+o;break;case"yyyy":s=o}return new Date(s,r,n)},formatDate:function(t){var e,i,s,n,r,o=this.format,l="";if(a(t))for(l=o.source,i=t.getFullYear(),n={d:t.getDate(),m:t.getMonth()+1,yy:i.toString().substring(2),yyyy:i},n.dd=(n.d<10?"0":"")+n.d,n.mm=(n.m<10?"0":"")+n.m,e=o.parts.length,r=0;r<e;r++)s=o.parts[r],l=l.replace(s,n[s]);return l},destroy:function(){this.unbind(),this.unbuild(),this.$element.removeData(g)}},c.LANGUAGES={},c.DEFAULTS={autoShow:!1,autoHide:!1,autoPick:!1,inline:!1,container:null,trigger:null,language:"",format:"mm/dd/yyyy",date:null,startDate:null,endDate:null,startView:0,weekStart:0,yearFirst:!1,yearSuffix:"",days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],itemTag:"li",mutedClass:"muted",pickedClass:"picked",disabledClass:"disabled",highlightedClass:"highlighted",template:'<div class="datepicker-container"><div class="datepicker-panel" data-view="years picker"><ul><li data-view="years prev">‹</li><li data-view="years current"></li><li data-view="years next">›</li></ul><ul data-view="years"></ul></div><div class="datepicker-panel" data-view="months picker"><ul><li data-view="year prev">‹</li><li data-view="year current"></li><li data-view="year next">›</li></ul><ul data-view="months"></ul></div><div class="datepicker-panel" data-view="days picker"><ul><li data-view="month prev">‹</li><li data-view="month current"></li><li data-view="month next">›</li></ul><ul data-view="week"></ul><ul data-view="days"></ul></div></div>',offset:10,zIndex:1e3,filter:null,show:null,hide:null,pick:null},c.setDefaults=function(e){e=t.isPlainObject(e)?e:{},e.language&&(e=t.extend({},c.LANGUAGES[e.language],e)),t.extend(c.DEFAULTS,e)},c.other=t.fn.datepicker,t.fn.datepicker=function(e){var s,a=r(arguments,1);return this.each(function(){var n,r,o=t(this),l=o.data(g);if(!l){if(/destroy/.test(e))return;n=t.extend({},o.data(),t.isPlainObject(e)&&e),o.data(g,l=new c(this,n))}i(e)&&t.isFunction(r=l[e])&&(s=r.apply(l,a))}),n(s)?this:s},t.fn.datepicker.Constructor=c,t.fn.datepicker.languages=c.LANGUAGES,t.fn.datepicker.setDefaults=c.setDefaults,t.fn.datepicker.noConflict=function(){return t.fn.datepicker=c.other,this}})},function(t,e,i){"use strict";$(document).on("click",".js-add-bill-to-folder",function(){modal.openBg();var t=$(this),e=t.data("bill-id"),i=t.data("bill-number"),s=t.data("object-type");$.get("/legislative-compass/_lc_folder?task=list-name&bill="+e,function(t){var n=$(".js-modal-add-bill-to-folder");if(t.length>0){n.find(".js-bill-folders").removeClass("dn");for(var a=n.find(".js-bill-folders ul"),r="",o=t.length-1;o>=0;o--)r+="<li>"+t[o]+"</li>";a.html(r)}var l=$(".js-modal-add-bill-to-folder").html().split("{{billId}}").join(e).split("{{billNumber}}").join(i).split("{{objectType}}").join(s);modal.open("Add to Folder",l),$(".lc-modal").css("overflow","initial"),$.get("/legislative-compass/_lc_folder?task=list-name",function(t){var e=document.getElementById("js-modal-input-folder");new Awesomplete(e,{minChars:3}).list=t})})})},function(t,e,i){"use strict";function s(t){return(0,r.debounce)(function(){var e=$(this),i=e.val().trim();i.length>1&&0==h&&(h=!0,$.ajax({type:"GET",url:"/legislative-compass/_search_crsIssueArea_lookup",data:{text:i},success:n(t,e)}))},333)}function n(t,e){return function(i){if(h=!1,null!=i&&void 0==i.success){var s=$(t).val()||[],n=i.map(function(t){return t.name||t.term}),r=n.filter(function(t){return-1==s.indexOf(t)}),o=r.concat(s),l=o.map(a),u=e.val();$(t).html(l).val(s).trigger("chosen:updated"),e.val(u)}}}function a(t){var e=document.createElement("option");return e.value=t,e.innerText=t,e}var r=i(6),o=(0,r.debounce)(function(){var t=$(this).val(),e=$(this);if(t.length>1&&0==h){h=!0;var i=null!=$("#states").val()?$("#states").val().toString():"",s={text:t,jurisdiction:""!=i?i:"US"};$.ajax({type:"GET",url:"/legislative-compass/_search_committee_lookup",data:s,success:n("#committee-filter",e)})}},333),l=(0,r.debounce)(function(){var t=$(this),e=t.closest(".awesomplete"),i=$(this).val();i.includes("Rep.")?$("#voteCast").prop("disabled",!1):($("#voteCast").prop("disabled",!0),$("#voteCast").val("")),i.length>1&&0==h&&(h=!0,e.addClass("is-loading"),$.ajax({type:"GET",url:"/legislative-compass/_search_legislator_lookup",data:{text:i}}).done(function(t){if(h=!1,e.removeClass("is-loading"),t.length>0){var s=t.map(function(t){return t.name});c=c.concat(s.filter(function(t){return c.indexOf(t)<0})),c.indexOf(i)&&rollCallVoteSearch(),d.list=c}else d.list=[]}))},333),h=!1;$(document).on("input","#committeeFilterList input",o).on("input","#crsIssueAreaListItem input",s("#crsIssueArea")).on("input","#issueArea_chosen input",s("#issueArea")).on("input","#legislator",l).on("keyup","#legislator",function(t){8==t.which&&p&&(this.value="",p=!1,rollCallVoteSearch()),this.value.length<3&&(d.list=[])});var u=$("#legislator"),c=[],d=void 0,p=!1;u.length&&(u.on("awesomplete-selectcomplete",function(t){p=!0,rollCallVoteSearch();var e=this.value;e.includes("Rep.")||e.includes("Sen.")?$("#voteCast").prop("disabled",!1):($("#voteCast").prop("disabled",!0),$("#voteCast").val(""))}),c=$("#legislatorList option").toArray().map(function(t){return t.value}),d=new Awesomplete(u[0],{minChars:2,maxItems:5}),d.list=c)},function(t,e,i){"use strict";!function(){function t(){var i,s=this.querySelectorAll("template"),n=[],a=0;if(e){for(i=this.cloneNode(!0),s=i.content.querySelectorAll("template");s[a];a++)s[a].clone=t;return i}for(;s[a];a++)n.push(s[a].content);for(i=this.cloneNode(!0),i.content=this.content,i.clone=t,s=i.querySelectorAll("template"),a=0;s[a];a++)s[a].content=n[a],s[a].clone=t;return i}var e="content"in document.createElement("template");if(!e)for(var i,s,n,a,r,o=Array.prototype.slice.call(document.getElementsByTagName("template")),l=0;i=o[l++];){for(s=i.children,n=document.createDocumentFragment(),r=0;a=s[r];r++)n.appendChild(a);i.content=n}for(var i,o=document.querySelectorAll("template"),l=0;i=o[l++];)i.clone=t}()},function(t,e,i){"use strict";i(4),i(1),i(0),i(3),i(2),$(document).ready(function(){var t=new Date;$(".js-datepicker").datepicker({daysMin:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],endDate:t,offset:-1}),$(".js-chosen").chosen()}),/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream&&$("html").addClass("ios")},function(t,e,i){"use strict";function s(t,e,i){var s;return function(){var n=this,a=arguments,r=function(){s=null,i||t.apply(n,a)},o=i&&!s;clearTimeout(s),s=setTimeout(r,e),o&&t.apply(n,a)}}function n(t,e,i){e||(e=250);var s,n;return function(){var a=i||this,r=+new Date,o=arguments;s&&r<s+e?(clearTimeout(n),n=setTimeout(function(){s=r,t.apply(a,o)},e)):(s=r,t.apply(a,o))}}Object.defineProperty(e,"__esModule",{value:!0}),e.debounce=s,e.throttle=n},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){t.exports=jQuery}]); |
{ | ||
"name": "politico-assets", | ||
"version": "0.4.3", | ||
"version": "0.4.4", | ||
"description": "Minified front end assets used by politico.com", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
170724