(self.webpackChunk=self.webpackChunk||[]).push([[235],{"./fec/static/js/modules/maps-event.js":function(e,t,n){"use strict";n.d(t,{T:function(){return c}});var a=n("./fec/static/js/modules/events.js"),i=n("./fec/static/js/modules/maps.js"),s=n("../node_modules/jquery/dist/jquery.js");let o=(0,a.A)();function d(e,t,n,a){const o=t.closest(".dataTables_scrollBody"),d=o.find('span[data-state="'+n+'"]');d.length>0&&((0,i.W0)(s(".state-map"),n),o.find(".row-active").removeClass("row-active"),d.parents("tr").addClass("row-active"),a&&o.animate({scrollTop:d.closest("tr").height()*parseInt(d.attr("data-row"))},500))}function c(e,t){e&&e.on("click","path[data-state]",(function(){const e=s(this).attr("data-state");o.emit("state.map",{state:e})})),t&&t.on("click","tr",(function(){o.emit("state.table",{state:s(this).find("span[data-state]").attr("data-state")})})),o.on("state.table",(function(e){d(0,s(".data-table"),e.state,!1)})),o.on("state.map",(function(e){s(".state-map"),d(0,t,e.state,!0)}))}},"./fec/static/js/modules/maps.js":function(e,t,n){"use strict";n.d(t,{W0:function(){return L},dF:function(){return R},ek:function(){return F},rW:function(){return W}});var a=n("../node_modules/chroma-js/chroma.js"),i=n.n(a),s=n("../node_modules/d3/d3.js"),o=n.n(s),d=n("../node_modules/leaflet/dist/leaflet-src.js"),c=n.n(d),l=n("../node_modules/topojson-client/dist/topojson-client.js"),r=n("../node_modules/underscore/modules/chain.js"),u=n("../node_modules/underscore/modules/each.js"),m=n("../node_modules/underscore/modules/find.js"),p=n("../node_modules/underscore/modules/keys.js"),f=n("../node_modules/underscore/modules/last.js"),_=n("../node_modules/underscore/modules/max.js"),h=n("../node_modules/underscore/modules/min.js"),y=n("../node_modules/underscore/modules/pluck.js"),b=n("../node_modules/underscore/modules/reduce.js"),g=n("../node_modules/underscore/modules/values.js"),v=(n("../node_modules/leaflet-providers/leaflet-providers.js"),n("./fec/static/js/modules/election-utils.js")),j=n("./fec/static/js/modules/fips.js"),w=n("./fec/static/js/modules/helpers.js"),A=n("./fec/static/js/data/us-states-10m.json"),E=n("./fec/static/js/templates/candidateStateMap.hbs"),N=n.n(E),x=n("../node_modules/jquery/dist/jquery.js");const T=(0,l.feature)(A,A.objects.states).features,k=(0,r.A)(T).map((function(e){return[e.id,e]})).object().value(),S="#ffffff",q=["#e2ffff","#278887"],C=[["B",9],["M",6],["k",3],["",0]],M=2,O=e=>`\n
${e.name}
\n ${e.total}
\n`;function F(e,t,n,a,s,d,c,l){const u=o().select(e[0]).append("svg").attr("width",n).attr("height",a),m=o().geo.albersUsa().scale(450).translate([220,150]),p=o().geo.path().projection(m),f=(0,b.A)(t.results,(function(e,t){const n=j.Xz[t.state]||{};return e[n.STATE?parseInt(n.STATE):null]=t.total,e}),{}),y=(0,r.A)(t.results).pluck("total").filter((function(e){return!!e})).value();s=s||(0,h.A)(y),d=d||(0,_.A)(y);const g=i().scale(q).domain([s,d]),v=o().scale.linear().domain([s,d]);u.append("g").selectAll("path").data(T).enter().append("path").attr("fill",(function(e){return f[e.id]?g(f[e.id]):S})).attr("data-state",(function(e){return j.X5[e.id].STATE_NAME})).attr("class","shape").attr("d",p).on("mouseover",(function(e){f[e.id]&&(this.parentNode.appendChild(this),this.classList.add("state--hover"))})),(c||void 0===c)&&I(o().select(".legend-container svg"),g,v,4),l&&function(e,t,n){const a=o().select("body").append("div").attr("id","map-tooltip").attr("class","tooltip tooltip--above tooltip--mouse").style("position","absolute").style("pointer-events","none").style("visibility","hidden");e.selectAll("path").on("mouseover",(function(e){this.parentNode.appendChild(this);const t=O({name:j.X5[e.id].STATE_NAME,total:(0,w.Gl)(n[e.id]||0)});a.style("visibility","visible").html(t),z(a)})).on("mouseout",(function(){a.style("visibility","hidden")})).on("mousemove",(function(){z(a)}))}(u,0,f)}function I(e,t,n,a){const i=n.ticks(a),s=e.selectAll("g.legend").data(i).enter().append("g").attr("class","legend");s.append("rect").attr("x",(function(e,t){return 40*t+2.5})).attr("y",0).attr("width",35).attr("height",20).style("fill",(function(e){return t(e)}));const d=(c=i[Math.ceil(i.length/2)],(0,m.A)(C,(function(e){return c>=Math.pow(10,e[1])})));var c;s.append("text").attr("x",(function(e,t){return 40*(t+.5)})).attr("y",30).attr("width",40).attr("height",20).attr("font-size","10px").attr("text-anchor","middle").text((function(e){return"$"+function(e,t){const n=Math.pow(10,t[1]);return o().round(e/n,1).toString()+t[0]}(e,d).toString()}))}function z(e){const t=o().event.pageX-e[0][0].offsetWidth/2,n=o().event.pageY-e[0][0].offsetHeight;let a=x("#map-tooltip .tooltip__title").innerHeight();a+=x("#map-tooltip .tooltip__value").innerHeight(),a+=30,e.style("left",t+"px").style("top","calc("+n+"px - .8rem)").style("height",a+"px")}function L(e,t){const n='[data-state="'+t+'"]';e.find("path:not("+n+")").each((function(e,t){t.classList.remove("active")}));const a=e.find("path"+n);a.length&&a[0].classList.add("active")}function R(e,t){this.elm=e,this.style=t,this.map=null,this.overlay=null}function B(e){return(0,r.A)(e).map((function(e){return(0,r.A)(e).values().filter((function(e){return!!e})).min().value()})).min().value()}function J(e){return(0,r.A)(e).map((function(e){return(0,_.A)((0,g.A)(e))})).max().value()}function P(e,t){const n=(e=e.closest("#state-maps")).find(".state-map select").map((function(e,t){return x(t).val()})).get();(0,u.A)((0,p.A)(t),(function(e){-1===n.indexOf(e)&&delete t[e]}));const a=B(t),s=J(t),d=i().scale(q).domain([a,s]),c=o().scale.linear().domain([a,s]);e.find(".state-map").each((function(e,n){const a=x(n),i=t[a.find("select").val()];o().select(a.find("g")[0]).selectAll("path").attr("fill",(function(e){return i[e.id]?d(i[e.id]):S}))})),e.find(".legend-container svg g").remove();const l=o().select(e.get(0)).select(".legend-container svg");isFinite(s)&&I(l,d,c,4)}function $(e){const t=e.find(".state-map"),n=t.length1?"block":"none";e.find(".js-add-map").css("display",n),e.find(".js-remove-map").css("display",a)}function G(e,t,n){const a=(0,y.A)(t,"candidate_id"),i=e.find(".candidate-select").map((function(e,t){return x(t).val()})).get(),s=(0,m.A)(a,(function(e){return-1===i.indexOf(e)}))||(0,f.A)(a);e.append(N()(t));const o=e.find(".state-map:last select");o.val(s),o.trigger("change"),$(e),P(e,n)}function W(e){const t={},n=x("#state-maps").find(".choropleths");G(n,e,t),n.on("change","select",(function(e){const n=x(e.target);!function(e,t,n){const a=(0,w.c$)(["schedules","schedule_a","by_state","by_candidate"],{cycle:window.context.election.cycle,candidate_id:t,per_page:99,election_full:!0}),i=e.find(".state-map-choropleth");i.html(""),x.getJSON(a).done((function(a){const s=(0,b.A)(a.results,(function(e,t){const n=t.state?t.state.toUpperCase():t.state,a=j.Xz[n]||{};return e[a.STATE?parseInt(a.STATE):null]=t.total,e}),{});n[t]=s,P(e,n);const o=B(n),d=J(n);F(i,a,400,300,o,d,!1,!0)}))}(n.closest(".state-map"),n.val(),t)})),n.on("click",".js-add-map",(function(){G(n,e,t)})),n.on("click",".js-remove-map",(function(e){const n=x(e.target).closest(".state-map"),a=n.closest("#state-maps");n.remove(),$(a),P(a,t)})),n.find(".state-map").remove(),G(n,e,t)}R.prototype.load=function(e){let t;if(e.district){const n=(0,v.Hf)(e.state,e.district);t=(0,v.UN)(n)}else if(e.state){const n=j.Xz[e.state.toUpperCase()];n&&(t=k[n.STATE])}t&&this.render(t)},R.prototype.render=function(e){this.elm.setAttribute("aria-hidden","false"),this.map=c().map(this.elm),c().tileLayer.provider("Stadia.StamenTonerLite").addTo(this.map),this.overlay=c().geoJson(e,{style:this.style}).addTo(this.map),this.map.fitBounds(this.overlay.getBounds())}},"./fec/static/js/pages/candidate-single.js":function(e,t,n){"use strict";var a=n("../node_modules/urijs/src/URI.js"),i=n.n(a),s=n("./fec/static/js/modules/column-helpers.js"),o=n("./fec/static/js/modules/columns.js"),d=n("./fec/static/js/modules/dropdowns.js"),c=n("./fec/static/js/modules/events.js"),l=n("./fec/static/js/modules/filings.js"),r=n("./fec/static/js/modules/helpers.js"),u=n("./fec/static/js/modules/maps-event.js"),m=n("./fec/static/js/modules/maps.js"),p=n("../node_modules/underscore/modules/chain.js"),f=n("../node_modules/underscore/modules/reduce.js"),_=n("../node_modules/jquery/dist/jquery.js");const h={independentExpenditures:["schedules","schedule_e","by_candidate"],communicationCosts:["communication_costs","by_candidate"],electioneering:["electioneering","by_candidate"]};function y(e){this.$elm=_(".js-other-spending-totals[data-spending-type="+e+"]"),this.type=e,this.data=[],this.init()}y.prototype.fetchData=function(e){var t=this,n=(0,r.c$)(h[this.type],{candidate_id:window.context.candidateID,cycle:window.context.cycle,election_full:window.context.electionFull,page:e,per_page:100});_.getJSON(n).done((function(e){var n=e.pagination.page;if(0===e.results.length)t.$elm.remove();else if(t.data=t.data.concat(e.results),n===e.pagination.pages)t.showTotals(t.data);else{var a=n+1;t.fetchData(a)}}))},y.prototype.init=function(){this.fetchData()},y.prototype.showTotals=function(e){if("electioneering"===this.type){var t=(0,f.A)(e,(function(e,t){return e+t.total}),0);this.$elm.find(".js-total-electioneering").html((0,r.Gl)(t))}else{var n=(0,p.A)(e).filter((function(e){return"S"===e.support_oppose_indicator})).reduce((function(e,t){return e+t.total}),0).value(),a=(0,p.A)(e).filter((function(e){return"O"===e.support_oppose_indicator})).reduce((function(e,t){return e+t.total}),0).value();this.$elm.find(".js-support").html((0,r.Gl)(n)),this.$elm.find(".js-oppose").html((0,r.Gl)(a))}};var b=n("./fec/static/js/modules/tables.js"),g=n("./fec/static/js/templates/reports/reportType.hbs"),v=n.n(g),j=n("../node_modules/jquery/dist/jquery.js");const w=(0,c.A)(),A={afterRender:b.Bx.bind(void 0,void 0)};var E=j(".state-map"),N=(0,r.c$)(["schedules","schedule_a","by_state","by_candidate"],{candidate_id:E.data("candidate-id"),cycle:E.data("cycle"),election_full:!1,per_page:99});const x=[{data:"total",className:"all",orderable:!0,orderSequence:["desc","asc"],render:(0,s.Fr)(["independent-expenditures"],(function(e,t,n){return{support_oppose_indicator:n.support_oppose_indicator,candidate_id:n.candidate_id}}))},(0,o.IJ)({data:"committee_name",className:"all"}),o.IV];var T=[{data:"total",className:"all",orderable:!0,orderSequence:["desc","asc"],render:(0,s.Fr)(["communication-costs"],(function(e,t,n){return{support_oppose_indicator:n.support_oppose_indicator,candidate_id:n.candidate_id}}))},(0,o.IJ)({data:"committee_name",className:"all"}),o.IV],k=[{data:"total",className:"all",orderable:!0,orderSequence:["desc","asc"],render:(0,s.Fr)(["electioneering-communications"],(function(e,t,n){return{candidate_id:n.candidate_id}}))},(0,o.IJ)({data:"committee_name",className:"all"})],S=[(0,s.A7)("pdf_url",{data:"document_description",className:"all column--medium",orderable:!1}),{data:"most_recent",className:"all",orderable:!1,render:function(e,t,n){var a=(0,r.m6)(e);return null!==n.fec_file_id&&(a=a+'
'+n.fec_file_id),a}},(0,o.zi)({data:"receipt_date",className:"min-tablet"})],q=(0,s.GH)(o.Bg,["document_type","receipt_date","beginning_image_number"]),C=[{data:"committee_id",className:"all",orderable:!1,render:function(e,t,n){return(0,s.Cu)(n.committee.name,(0,r.PY)(["committee",n.committee_id]),"committee")}},{data:"recipient_name",className:"all",orderable:!1},{data:"recipient_state",className:"min-tablet hide-panel",orderable:!1},{data:"disbursement_description",className:"all",orderable:!1,defaultContent:"NOT REPORTED"},(0,o.zi)({data:"disbursement_date",className:"min-tablet"}),(0,o.KO)({data:"disbursement_amount",className:"column--number t-mono"})],M=[{data:"contributor_name",className:"all",orderable:!1},{data:"committee",className:"all",orderable:!1,paginator:b.y_,render:function(e,t,n){return(0,s.Cu)(n.committee.name,(0,r.PY)(["committee",n.committee_id]),"committee")}},(0,o.zi)({data:"contribution_receipt_date",className:"min-tablet"}),(0,o.KO)({data:"contribution_receipt_amount",className:"column--number t-mono"})],O=[{data:"document_description",className:"all column--doc-download",orderable:!1,render:function(e,t,n){var a=n.document_description?n.document_description:n.form_type,i=(0,r.UC)(n),s=n.pdf_url?n.pdf_url:null,o=n.csv_url?n.csv_url:null,d=n.fec_url?n.fec_url:null,c=n.html_url?n.html_url:null;return"F3L"==n.form_type&&(a+=" - Lobbyist Bundling Report"),v()({doc_description:a,amendment_version:i,fec_url:d,pdf_url:s,csv_url:o,html_url:c})}},{data:"most_recent",className:"all",orderable:!1,render:function(e,t,n){var a=(0,r.m6)(e);return"Version unknown"===a?'Version unknown
':(null!==n.fec_file_id&&(a=a+'
'+n.fec_file_id),a)}},(0,o.zi)({data:"receipt_date",className:"min-tablet"}),{data:"beginning_image_number",orderable:!1,className:"min-desktop",render:function(e,t,n){return n.beginning_image_number}},{data:"beginning_image_number",orderable:!1,className:"min-desktop",render:function(e,t,n){var a=function(e){return 18===e.toString().length?Number(e.toString().slice(8)):e};return(a(n.ending_image_number)-a(n.beginning_image_number)+1).toLocaleString()}}],F={"independent-expenditures":{path:["schedules","schedule_e","by_candidate"],columns:x,title:"independent expenditures"},"communication-costs":{path:["communication_costs","by_candidate"],columns:T,title:"communication costs"},electioneering:{path:["electioneering","by_candidate"],columns:k,title:"electioneering communications"}};j((function(){const e=i().parseQuery(window.location.search);var t,n,a;!function(){const e=j('table[data-type="other-documents"]'),t=e.data("candidate");b.j.defer(e,{path:["filings"],query:{candidate_id:t,form_type:["F99","RFAI"],request_type:["-1","-2","-3","-4","-5","-6","-7","-8","-9"],sort_hide_null:["false"]},columns:S,order:[[2,"desc"]],dom:b.Fi,pagingType:"simple",lengthMenu:[10,30,50],hideEmpty:!1})}(),j(".data-table").each((function(e,t){var n=j(t),a=n.data("type"),i=F[a],s={candidate_id:n.data("candidate"),cycle:n.data("cycle"),election_full:n.data("election-full")},o=(0,r.Z)(n.data("cycle"),n.data("duration"));null==o&&(o="unspecified cycle"),i&&b.j.defer(n,{path:i.path,query:s,columns:i.columns,order:[[0,"desc"]],dom:b.Fi,pagingType:"simple",lengthChange:!0,pageLength:10,lengthMenu:[10,50,100],hideEmpty:!0,hideEmptyOpts:{dataType:i.title,email:window.WEBMANAGER_EMAIL,name:window.context.name,timePeriod:o,reason:(0,r.VJ)(a)}})})),function(){const e=j('table[data-type="itemized-disbursements"]');var t=e.data("committee-id"),n="";t&&(n=t.split(",").filter(Boolean));var a={committee_id:n,title:"itemized disbursements",name:e.data("name"),cycle:e.data("cycle")},i=(0,r.Z)(e.data("cycle"),e.data("duration"));null==i&&(i="unspecified cycle"),b.j.defer(e,{path:["schedules","schedule_b"],query:{committee_id:a.committee_id,two_year_transaction_period:a.cycle},columns:C,order:[[4,"desc"]],dom:b.Fi,paginator:b.y_,lengthMenu:[10,50,100],useFilters:!0,useExport:!0,singleEntityItemizedExport:!0,hideEmpty:!0,hideEmptyOpts:{email:window.WEBMANAGER_EMAIL,dataType:a.title,name:a.name,timePeriod:i,reason:(0,r.VJ)("disbursements")}})}(),function(){var e=j('table[data-type="individual-contributions"]'),t=j('table[data-type="contribution-size"]'),n=j('table[data-type="contributor-state"]'),a=(0,r.Z)(e.data("cycle"),2),i=e.data("name"),o=e.data("committee-id"),d="";o&&(d=o.split(",").filter(Boolean));var c={committee_id:d,candidate_id:e.data("candidate-id"),title:"individual contributions",name:i,cycle:e.data("cycle")},l=(0,r.VJ)("contributions");b.j.defer(e,{path:["schedules","schedule_a"],query:{committee_id:c.committee_id,is_individual:!0,two_year_transaction_period:c.cycle},columns:M,order:[[2,"desc"]],dom:b.Fi,paginator:b.y_,useFilters:!0,useExport:!0,singleEntityItemizedExport:!0,hideEmpty:!0,hideEmptyOpts:{dataType:"individual contributions",email:window.WEBMANAGER_EMAIL,name:i,timePeriod:a,reason:l}}),b.j.defer(n,{path:["schedules","schedule_a","by_state","by_candidate"],query:{candidate_id:c.candidate_id,cycle:c.cycle,election_full:!1,sort_hide_null:!1,per_page:99},columns:[{data:"state_full",width:"50%",className:"all",render:function(e,t,n,a){var i=document.createElement("span");return i.textContent=e,i.setAttribute("data-state",e),i.setAttribute("data-row",a.row),i.outerHTML}},{data:"total",width:"50%",className:"all",orderSequence:["desc","asc"],render:(0,s.Fr)(["receipts","individual-contributions"],(function(e,t,n){return{contributor_state:n.state,committee_id:c.committee_id}}))}],callbacks:A,dom:"t",order:[[1,"desc"]],paging:!1,scrollY:400,scrollCollapse:!0}),b.j.defer(t,{path:["schedules","schedule_a","by_size","by_candidate"],query:{candidate_id:c.candidate_id,cycle:c.cycle,election_full:!1,sort:"size"},columns:[{data:"size",width:"50%",className:"all",orderable:!1,render:function(e){return s.UZ[e].label}},{data:"total",width:"50%",className:"all",orderSequence:["desc","asc"],orderable:!1,render:(0,s.Fr)(["receipts","individual-contributions"],(function(e,t,n){var a=(0,s.CO)(n.size);return a.committee_id=c.committee_id,a}))}],callbacks:A,dom:"t",order:!1,pagingType:"simple",lengthChange:!1,pageLength:10,hideEmpty:!0,hideEmptyOpts:{dataType:"individual contributions",email:window.WEBMANAGER_EMAIL,name:i,timePeriod:a,reason:l}}),(0,u.T)(E,n)}(),n=(t=j('table[data-type="statements-of-candidacy"]')).data("candidate-id"),a={cycle:t.data("cycle")},b.j.defer(t,{path:["filings"],query:{candidate_id:n,form_type:["F2","RFAI"],request_type:["-1","-2","-3","-4","-6","-7","-8","-9"],cycle:a.cycle,sort_hide_null:["false"]},columns:O,order:[[2,"desc"]],dom:b.Fi,pagingType:"simple",lengthMenu:[10,30,50],hideEmpty:!1,useExport:!0,callbacks:{afterRender:l.wc},drawCallback:function(){this.dropdowns=t.find(".dropdown").map((function(e,t){return new d.A(j(t),{checkboxes:!1})}))}}),function(){var e=j('table[data-type="raw-filings"]'),t=e.attr("data-committee"),n=e.attr("data-min-date");b.j.defer(e,{path:["efile","filings"],query:{committee_id:t,min_receipt_date:n,sort:["-receipt_date"]},columns:q,order:[[2,"desc"]],dom:b.Fi,pagingType:"simple",lengthMenu:[10,30,50],hideEmpty:!1,useExport:!0,callbacks:{afterRender:l.wc},drawCallback:function(){this.dropdowns=e.find(".dropdown").map((function(e,t){return new d.A(j(t),{checkboxes:!1})}))}})}(),"other-spending"===e.tab?(new y("independentExpenditures"),new y("electioneering"),new y("communicationCosts")):w.once("tabs.show.other-spending",(function(){new y("independentExpenditures"),new y("electioneering"),new y("communicationCosts")})),"raising"===e.tab?j.getJSON(N).done((function(e){(0,m.ek)(E,e,400,300,null,null,!0,!0)})):w.once("tabs.show.raising",(function(){j.getJSON(N).done((function(e){(0,m.ek)(E,e,400,300,null,null,!0,!0)}))}))}))},"./fec/static/js/templates/candidateStateMap.hbs":function(e,t,n){var a=n("../node_modules/handlebars/runtime.js");e.exports=(a.default||a).template({1:function(e,t,n,a,i){var s=e.lambda,o=e.escapeExpression,d=e.lookupProperty||function(e,t){if(Object.prototype.hasOwnProperty.call(e,t))return e[t]};return' \n"},compiler:[8,">= 4.3.0"],main:function(e,t,n,a,i){var s;return'\n
\n
\n
\n
\n
\n'},useData:!0})}},function(e){e.O(0,[8680,3652,6067,8894,4987,4612,3906,1767,7058,3163,5284,9854,8096],(function(){return e(e.s="./fec/static/js/pages/candidate-single.js")})),e.O()}]);