1import{a as Y}from"./chunk-NGGOYRP2.js";import{a as J}from"./chunk-7H4USMMB.js";import{a as B}from"./chunk-DUBKU2HS.js";import{a as F}from"./chunk-KASXFZ6P.js";import{a as z}from"./chunk-DJYPL7W2.js";import{a as G}from"./chunk-EGCSG2G2.js";import{a as V}from"./chunk-ZA2VGKQE.js";import{a as x,d as j}from"./chunk-VD3DNBDN.js";import{c as K,e as R}from"./chunk-VISZOBOM.js";import{$b as $,Da as D,Ea as r,Ib as f,Ic as A,Ka as m,Kb as P,Qa as k,Wb as U,ba as S,cb as y,db as v,e as H,eb as N,fa as O,fb as L,ga as b,gb as T,ha as M,hb as C,ib as d,jb as p,kb as u,la as w,ra as h,rb as E,tb as I,vb as _}from"./chunk-NPSW5S2Y.js";var i=H(K());function Q(s,n){s&1&&(d(0,"div",7),M(),d(1,"svg",9)(2,"style"),f(3,".spn_obj{transform-origin:center;animation:spn_il .75s infinite linear} @keyframes spn_il{100%{transform:rotate(360deg)}}"),p(),u(4,"path",10),p()())}function W(s,n){if(s&1&&(d(0,"li")(1,"a",11),f(2),p()()),s&2){let e=n.$implicit,t=_(3);r(),C("href",$("",t.mainLinkPrefix,"",t.cycle,"",t.itemLinkPostfix,"",t.stateLinkName,"/",e.pageLink),D)("title",U(e.title)),r(),P(" ",e.title," ")}}function X(s,n){if(s&1&&(d(0,"div",8)(1,"ul"),L(2,W,3,9,"li",null,N),p()()),s&2){let e=_(2);r(2),T(e.groupedPages1)}}function ee(s,n){if(s&1){let e=E();d(0,"div",4)(1,"p"),f(2),p(),d(3,"div",5)(4,"input",6),I("keyup",function(a){O(e);let o=_();return b(o.applyListFilter(a))}),p(),y(5,Q,5,0,"div",7),y(6,X,4,0,"div",8),p()()}if(s&2){let e=_();r(2),P(" Use the links below to see the total campaign contributions received vs the total spending made by the following ",e.state," state-level candidates. "),r(3),v(e.loadingSearch()?5:-1),r(),v(e.loadingSearch()?-1:6)}}var Z=class s{constructor(n,e,t,a,o,c){this.activatedRoute=n;this.pageService=e;this.uSCountiesDataService=t;this.campDonsService=a;this.paginatorService=o;this.api=c}pageName="us_state_level_camp_cand_contrs_vs_expends_per_cycle_list_of_cands";dateCreated="December 31, 2024";country="";stateLinkName="";dateUpdated="";state="";pageTitle="";chartTopTitle="";chartTopTitle2="";tableTitle="";tableTitle2="";tableTitle3="";shareMessage="";hashTags=[];keywords=[];groupedPages1=[{title:"",url:""}];groupedPagesCopy=[];loadingSearch=h(!1);populationYear=2010;popYears=[2021];chartData=[];loadingData=h(!0);paramsSubscription;mainLinkPrefix="/us-campaign-donations/state-level-campaigns/";itemLinkPostfix="/contributions-received-vs-total-spending-per-cand-per-state/";pageLinkPostfix="/contributions-received-vs-total-spending-per-cand-per-state-list-of-candidates/";cycle="";notDC=!0;showPagination=h(!0);paginator;smallPaginator;pageSize=25;totalList=1e3;pageNum=1;destroyRef=S(w);async ngOnInit(){try{this.loadingData.set(!0),this.paramsSubscription=this.activatedRoute.paramMap.subscribe(n=>{let e=n.get("cycle"),t=n.get("state"),a=n.get("pageNum");this.updatePageData(e,t,a)})}catch{}}async updatePageData(n,e,t){try{this.loadingData.set(!0);let a=(0,i.startCase)(e),o=(0,i.snakeCase)((0,i.toLower)(a));this.state=a,this.stateLinkName=(0,i.kebabCase)((0,i.toLower)(a));let c=n,g=(0,i.snakeCase)(c);this.cycle=c,this.api.get("/resource-data",{resourceName:`us_state_campaigns_contr_received_vs_total_spending_list_of_cands_${g}_${o}_page_${t}`,rType:"c"}).pipe(x(this.destroyRef)).subscribe({next:l=>{this.dataReceived(l,n,t)},error:l=>{}})}catch(a){console.log("error getting pop page.",a);let o=JSON.stringify({stage:"updatePageData",err:`${a}`});this.pageService.writePageError(this.pageName,o)}}async dataReceived(n,e,t){try{let a=await this.campDonsService.getNmGrpStLvl_u(n),o=a.total,c=a.pageList;this.groupedPages1=c.group1,this.groupedPagesCopy=c.group1,this.totalList=o;let g=(0,i.snakeCase)((0,i.toLower)(this.state)),l=(0,i.snakeCase)(e);this.pageTitle=`Campaign Contributions Vs Total Spending For ${this.state} State-Level Candidates 2 in the ${this.cycle} Election Cycle`,this.pageName=`us_state_campaigns_contr_received_vs_total_spending_per_cand_per_state_${l}_${g}_list_of_cands`,this.pageService.performPrePageLoadTasks(this.pageName,this.pageTitle),this.pageService.addNoIndexTag(),this.state=="District of Columbia"&&(this.notDC=!1),this.setPage(Number(t)),this.loadingData.set(!1)}catch(a){let o=JSON.stringify({stage:"dataReceived",err:`${a}`});this.pageService.writePageError(this.pageName,o),this.loadingData.set(!1)}}setPage(n,e=!1){try{let t=this.paginatorService.getPaginator(this.totalList,n,this.pageSize);this.paginator=t,this.pageNum=n}catch(t){let a=JSON.stringify({stage:"setPage",err:`${t}`});this.pageService.writePageError(this.pageName,a)}}async applyListFilter(n){try{let e=n.target.value;if((n.keyCode===13||n.keyCode===9)&&e!==""){this.showPagination.set(!1),this.loadingSearch.set(!0);let t=(0,i.snakeCase)(this.cycle),a=(0,i.snakeCase)((0,i.toLower)(this.state));this.api.get("/resource-data-filter",{searchTerm:e,resourceName:`us_state_campaigns_contr_received_vs_total_spending_list_of_cands_${t}_${a}`,filterName:"name",rType:"c"}).pipe(x(this.destroyRef)).subscribe({next:async o=>{let c=[];for(let g=0;g<o.length;g++){let l=o[g],q={title:l.name,pageLink:(0,i.kebabCase)(l.name)};if(c.push(q),g==200)break}this.groupedPages1=c,this.loadingSearch.set(!1),await this.pageService.writeFilterTerm({pageName:this.pageName,value:e})},error:o=>{console.log("there was an error filtering data",o)}})}e==""&&(this.showPagination.set(!0),this.groupedPages1=this.groupedPagesCopy)}catch(e){let t=JSON.stringify({stage:"applyListFilter",err:`${e}`});this.pageService.writePageError(this.pageName,t)}}async ngOnDestroy(){this.paramsSubscription&&this.paramsSubscription.unsubscribe()}static \u0275fac=function(e){return new(e||s)(m(V),m(j),m(J),m(Y),m(B),m(R))};static \u0275cmp=k({type:s,selectors:[["us-state-level-camp-dons-cands-contrs-vs-expends-per-cycle-list-of-cands"]],decls:8,vars:5,consts:[[3,"pageName"],[1,"page-us-campaign-donations","rowFlex"],[1,"central-container","colFlex"],[1,"vis-page-title"],[1,"sub-section"],[1,"colFlex","grouped-pages-container"],["placeholder","Type name and press Enter to filter list",1,"filter-input",3,"keyup"],[1,"loading-spinner"],[1,"colFlex","grouped-pages-col-1"],["width","24","height","24","viewBox","0 0 24 24","xmlns","http://www.w3.org/2000/svg"],["d","M10.72,19.9a8,8,0,0,1-6.5-9.79A7.77,7.77,0,0,1,10.4,4.16a8,8,0,0,1,9.49,6.52A1.54,1.54,0,0,0,21.38,12h.13a1.37,1.37,0,0,0,1.38-1.54,11,11,0,1,0-12.7,12.39A1.54,1.54,0,0,0,12,21.34h0A1.47,1.47,0,0,0,10.72,19.9Z",1,"spn_obj"],[1,"level-0",3,"href","title"]],template:function(e,t){e&1&&(u(0,"top-ad-group",0),d(1,"div",1)(2,"div",2)(3,"h1",3),f(4),p(),y(5,ee,7,3,"div",4),p(),u(6,"sidebar-ad-group",0),p(),u(7,"bottom-ad-group",0)),e&2&&(C("pageName",t.pageName),r(4),P(" ",t.pageTitle," "),r(),v(t.loadingData()?-1:5),r(),C("pageName",t.pageName),r(),C("pageName",t.pageName))},dependencies:[A,z,F,G],styles:[".page-us-campaign-donations[_ngcontent-%COMP%]{display:flex;justify-content:center}.page-us-campaign-donations[_ngcontent-%COMP%] .see-also-row-txt[_ngcontent-%COMP%]{margin-bottom:-25px}.page-us-campaign-donations[_ngcontent-%COMP%] .see-also-row[_ngcontent-%COMP%]{margin-bottom:25px}.page-us-campaign-donations[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{margin-bottom:20px!important}.page-us-campaign-donations[_ngcontent-%COMP%] .filter-input[_ngcontent-%COMP%]{display:inline-block;vertical-align:top;font-size:17px;border:1px solid;outline:0;padding:5px 20px;border-radius:6px;width:350px;height:30px;margin-top:10px;margin-bottom:10px}.page-us-campaign-donations[_ngcontent-%COMP%] .small-paginator-row[_ngcontent-%COMP%]{display:none;padding:0;margin:40px 0;border-radius:4px}.page-us-campaign-donations[_ngcontent-%COMP%] .paginator-row[_ngcontent-%COMP%]{display:flex;padding:0;margin:40px 0;border-radius:4px;justify-content:center}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%]{white-space:nowrap;margin:0;padding:0}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%]{display:inline-block;padding:0;border:1px solid #ccc;font-size:1em;margin-bottom:2px;text-decoration:none;-webkit-transition:all .15s;-o-transition:all .15s;-moz-transition:all .15s;transition:all .15s;margin-left:2px;cursor:pointer;color:#3333}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{display:inline-block;text-decoration:none;padding:5px 10px;color:#333}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li[_ngcontent-%COMP%] a[_ngcontent-%COMP%]:hover{background:#0e7070f5;color:#fff;border-radius:3px;opacity:.8}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%]{background:#0e7070f5;font-weight:700;border-radius:3px}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li.active[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{color:#fff}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li.hide-btn[_ngcontent-%COMP%]{display:none}.page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li.prev-btn[_ngcontent-%COMP%], .page-us-campaign-donations[_ngcontent-%COMP%] .pagination[_ngcontent-%COMP%] li.next-btn[_ngcontent-%COMP%]{font-weight:700}@media only screen and (max-width:600px){.page-us-campaign-donations[_ngcontent-%COMP%] .filter-input[_ngcontent-%COMP%]{width:80%!important}.page-us-campaign-donations[_ngcontent-%COMP%] .paginator-row[_ngcontent-%COMP%]{display:none!important}.page-us-campaign-donations[_ngcontent-%COMP%] .small-paginator-row[_ngcontent-%COMP%]{display:inline-block!important}}"]})};export{Z as USStateCampCandContrsVsExpendsPerCycleListOfCandsComponent};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.