1(self.webpackChunk=self.webpackChunk||[]).push([[1296],{58666(e,t,a){var o;o=e=>(()=>{var t={540:e=>{e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},968:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});var o=a(5072),n=a.n(o),r=a(7825),l=a.n(r),i=a(7659),c=a.n(i),s=a(5056),d=a.n(s),u=a(540),p=a.n(u),v=a(1113),f=a.n(v),h=a(2791),b={};b.styleTagTransform=f(),b.setAttributes=d(),b.insert=c().bind(null,"head"),b.domAPI=l(),b.insertStyleElement=p(),n()(h.A,b);const m=h.A&&h.A.locals?h.A.locals:void 0},1113:e=>{e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},1601:e=>{e.exports=function(e){return e[1]}},2791:(e,t,a)=>{a.d(t,{A:()=>i});var o=a(1601),n=a.n(o),r=a(6314),l=a.n(r)()(n());l.push([e.id,'.il-election-akv-search-candidate{--il-election-text-color: #222;--il-election-secondary-text-color: #666;--il-election-bg-color: #fff;--il-election-card-color: #eee;--il-election-link-color: #dc0000;--il-election-border-color: #ddd;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #fff;--il-election-input-border-color: #b3b3b3;--il-election-input-text-color: #666;--il-election-hover-gray: #eee;--il-election-hover-color: #f5f5f5;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff;box-sizing:border-box;background-color:var(--il-election-bg-color);color:var(--il-election-text-color);font-family:"Encode Sans Condensed",arial,sans-serif;width:100%;position:relative}.il-election-akv-search-candidate .search-section{margin-bottom:14px;position:relative;background-color:var(--il-election-card-color);padding:14px;border-radius:4px}.il-election-akv-search-candidate .search-section:last-child{margin-bottom:0}.il-election-akv-search-candidate .akv-search-label{font-size:20px;font-weight:700;display:inline-block;margin:0 0 14px}.il-election-akv-search-candidate .akv-search-input-wrapper{display:flex;position:relative;margin:0}.il-election-akv-search-candidate .akv-search-input{font-family:"Encode Sans Condensed",arial,sans-serif;font-size:16px;font-weight:500;padding:0 10px;background-color:var(--il-election-input-bg-color);border:1px solid var(--il-election-input-border-color);border-radius:4px;color:var(--il-election-text-color);height:40px;width:100%;outline:none}.il-election-akv-search-candidate .akv-search-input::-moz-placeholder{opacity:1;color:var(--il-election-secondary-text-color)}.il-election-akv-search-candidate .akv-search-input::placeholder{opacity:1;color:var(--il-election-secondary-text-color)}.il-election-akv-search-candidate .akv-search-input.akv-dropdown-open{border-radius:4px 4px 0 0}.il-election-akv-search-candidate .akv-search-icon{position:absolute;background-color:var(--il-election-secondary-text-color);pointer-events:none;height:22px;width:22px;right:7px;top:11px;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:url("https://assets.ilcdn.fi/6915bbf3d2bcf945fc18098594ac8b0c8cbbdfa8191b146f32e6186360dd1d13.svg");mask-image:url("https://assets.ilcdn.fi/6915bbf3d2bcf945fc18098594ac8b0c8cbbdfa8191b146f32e6186360dd1d13.svg")}.il-election-akv-search-candidate .akv-search-dropdown-container{position:absolute;z-index:1000;background-color:var(--il-election-input-bg-color);border:1px solid var(--il-election-input-border-color);border-radius:0 0 4px 4px;max-height:300px;overflow-y:auto;box-shadow:0 4px 8px rgba(0,0,0,.1);left:14px;right:14px;top:calc(100% - 14px - 1px)}.il-election-akv-search-candidate .akv-search-dropdown-container a{text-decoration:none !important;color:var(--il-election-text-color)}.il-election-akv-search-candidate .akv-search-dropdown-container .akv-search-candidate{display:flex;justify-content:space-between;padding:7px 14px}.il-election-akv-search-candidate .akv-search-dropdown-container .akv-search-candidate:hover{background-color:var(--il-election-hover-gray)}.il-election-akv-search-candidate .akv-search-dropdown-container .akv-search-no-results{padding:14px;color:var(--il-election-secondary-text-color);font-style:italic;font-weight:500}html.theme-light .il-election-akv-search-candidate.dark-theme-enabled{--il-election-text-color: #222;--il-election-secondary-text-color: #666;--il-election-bg-color: #fff;--il-election-card-color: #eee;--il-election-link-color: #dc0000;--il-election-border-color: #ddd;
1--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #fff;--il-election-input-border-color: #b3b3b3;--il-election-input-text-color: #666;--il-election-hover-gray: #eee;--il-election-hover-color: #f5f5f5;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff}html.theme-dark .il-election-akv-search-candidate.dark-theme-enabled{--il-election-text-color: #fff;--il-election-secondary-text-color: #ccc;--il-election-bg-color: #2b2b2b;--il-election-card-color: #3f3f3f;--il-election-link-color: #ff0000;--il-election-border-color: #666;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #2b2b2b;--il-election-input-border-color: #999;--il-election-input-text-color: #fff;--il-election-hover-gray: #666;--il-election-hover-color: #3f3f3f;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff}@media(prefers-color-scheme: dark){.il-election-akv-search-candidate.dark-theme-enabled{--il-election-text-color: #fff;--il-election-secondary-text-color: #ccc;--il-election-bg-color: #2b2b2b;--il-election-card-color: #3f3f3f;--il-election-link-color: #ff0000;--il-election-border-color: #666;--il-election-default-gray: #aeb9bc;--il-election-input-bg-color: #2b2b2b;--il-election-input-border-color: #999;--il-election-input-text-color: #fff;--il-election-hover-gray: #666;--il-election-hover-color: #3f3f3f;--il-election-active-color: #dc0000;--il-election-active-text-color: #fff}}',""]);const i=l},5056:(e,t,a)=>{e.exports=function(e){var t=a.nc;t&&e.setAttribute("nonce",t)}},5072:e=>{var t=[];function a(e){for(var a=-1,o=0;o<t.length;o++)if(t[o].identifier===e){a=o;break}return a}function o(e,o){for(var r={},l=[],i=0;i<e.length;i++){var c=e[i],s=o.base?c[0]+o.base:c[0],d=r[s]||0,u="".concat(s," ").concat(d);r[s]=d+1;var p=a(u),v={css:c[1],media:c[2],sourceMap:c[3],supports:c[4],layer:c[5]};if(-1!==p)t[p].references++,t[p].updater(v);else{var f=n(v,o);o.byIndex=i,t.splice(i,0,{identifier:u,updater:f,references:1})}l.push(u)}return l}function n(e,t){var a=t.domAPI(t);return a.update(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap&&t.supports===e.supports&&t.layer===e.layer)return;a.update(e=t)}else a.remove()}}e.exports=function(e,n){var r=o(e=e||[],n=n||{});return function(e){e=e||[];for(var l=0;l<r.length;l++){var i=a(r[l]);t[i].references--}for(var c=o(e,n),s=0;s<r.length;s++){var d=a(r[s]);0===t[d].references&&(t[d].updater(),t.splice(d,1))}r=c}}},6314:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var a="",o=void 0!==t[5];return t[4]&&(a+="@supports (".concat(t[4],") {")),t[2]&&(a+="@media ".concat(t[2]," {")),o&&(a+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),a+=e(t),o&&(a+="}"),t[2]&&(a+="}"),t[4]&&(a+="}"),a}).join("")},t.i=function(e,a,o,n,r){"string"==typeof e&&(e=[[null,e,void 0]]);var l={};if(o)for(var i=0;i<this.length;i++){var c=this[i][0];null!=c&&(l[c]=!0)}for(var s=0;s<e.length;s++){var d=[].concat(e[s]);o&&l[d[0]]||(void 0!==r&&(void 0===d[5]||(d[1]="@layer".concat(d[5].length>0?" ".concat(d[5]):""," {").concat(d[1],"}")),d[5]=r),a&&(d[2]?(d[1]="@media ".concat(d[2]," {").concat(d[1],"}"),d[2]=a):d[2]=a),n&&(d[4]?(d[1]="@supports (".concat(d[4],") {").concat(d[1],"}"),d[4]=n):d[4]="".concat(n)),t.push(d))}},t}},7659:e=>{var t={};e.exports=function(e,a){var o=function(e){if(void 0===t[e]){var a=document.querySelector(e);if(window.HTMLIFrameElement&&a instanceof window.HTMLIFrameElement)try{a=a.contentDocument.head}catch(e){a=null}t[e]=a}return t[e]}(e);if(!o)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");o.appendChild(a)}},7825:e=>{e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(a){!function(e,t,a){var o="";a.supports&&(o+="@supports (".concat(a.supports,") {")),a.media&&(o+="@media ".concat(a.media," {"));var n=void 0!==a.layer;n&&(o+="@layer".concat(a.layer.length>0?" ".concat(a.layer):""," {")),o+=a.css,n&&(o+="}"),a.media&&(o+="}"),a.supports&&(o+="}");var r=a.sourceMap;r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleTagTransform(o,e,t.options)}(t,e,a)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},9155:t=>{t.exports=e}},a={};function o(e){var n=a[e];if(void 0!==n)return n.exports;var r=a[e]={id:e,exports:{}};return t[e](r,r.exports,o),r.exports}o.n=e=>
1{var t=e&&e.__esModule?()=>e.default:()=>e;return o.d(t,{a:t}),t},o.d=(e,t)=>{for(var a in t)o.o(t,a)&&!o.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},o.nc=void 0;var n={};o.r(n),o.d(n,{ILElectionAKVSearchCandidate:()=>u});var r=o(9155),l=o.n(r);const i=({openInNew:e,Link:t,url:a,children:o,className:n})=>{const r=e?{target:"_blank",rel:"noreferrer"}:{};return t?l().createElement(t,{className:`il-election-link ${n||""}`,to:a,openInNew:e},o):l().createElement("a",{className:`il-election-link ${n||""}`,href:a,...r},o)},c={dev:"https://tp.dev.vaalit.almamedia.fi",prod:"https://tp.prod.vaalit.almamedia.fi"},s=(e,t,a="prod")=>{const[o,n]=(0,r.useState)(e.searchValue),[l,i]=(0,r.useState)(e.candidates);return(0,r.useEffect)(()=>{(async()=>{try{const e=await fetch(`${c[a]}${t}`);if(e.ok){const t=await e.json();i(t)}}catch(e){console.error(e)}})()},[a,t]),{searchValue:o,setSearchValue:n,candidates:l,filteredCandidates:(()=>{if(l&&!(o?.length<3))return l.filter(e=>{const t=void 0!==e.value||void 0!==e.candidateNumber,a=e.label||e.firstName&&e.lastName;return t&&a}).filter(e=>e.label?e.label.toLowerCase().includes(o.toLowerCase()):!(!e.firstName||!e.lastName)&&`${e.firstName} ${e.lastName}`.toLowerCase().includes(o.toLowerCase()))})()}},d=(e,t,a,o,n,r,c)=>{if(!e?.length)return null;const s=e.filter(e=>{const t=void 0!==e.value||void 0!==e.candidateNumber,a=e.label||e.firstName&&e.lastName;return t&&a});return s.length?l().createElement("div",{ref:c,className:n||"search-dropdown-container"},s.map((e,n)=>{const c=e.value??e.candidateNumber??0,s=e.label??`${e.firstName??""} ${e.lastName??""}`.trim(),d=e.secondaryLabel??e.nominatorAbbreviation??"",u=e.path||`/ehdokas/koko_maa/${c}`;return l().createElement(i,{className:r,key:`candidate-${n}-${c}`,openInNew:a,Link:o,url:`${t}${u}`},l().createElement("span",null,s),l().createElement("span",null,d))})):null},u=(p=({env:e="prod",Link:t,darkThemeEnabled:a=!1,openInNew:o=!0,linkUrl:n,adjustHeight:i=!1})=>{const c=(0,r.useRef)(null),u=(0,r.useRef)(null),p=(0,r.useRef)(null),{searchValue:v,setSearchValue:f,filteredCandidates:h}=s({searchValue:""},"/kv-2025/search-candidates.json",e),{searchValue:b,setSearchValue:m,filteredCandidates:k}=s({searchValue:""},"/av-2025/search-candidates.json",e),[g,x]=l().useState(null),y=`${n??""}/${"kv"===g?"kuntavaalit-2025":"aluevaalit-2025"}/tulospalvelu#`;return(0,r.useEffect)(()=>{v.length>=3&&"kv"!==g?(x("kv"),b&&m("")):b.length>=3&&"av"!==g?(x("av"),v&&f("")):v.length<3&&b.length<3&&x(null)},[v,b,g,m,f]),(({containerRef:e,dropdownRef:t,shouldAdjustHeight:a,resultsLength:o})=>{(0,r.useEffect)(()=>{const o=e.current;if(!a||!o)return void(o&&(o.style.paddingBottom="0"));const n=t.current;if(n){const e=o.getBoundingClientRect(),t=n.getBoundingClientRect().bottom-e.bottom;o.style.paddingBottom=`${Math.max(0,t)}px`}else o.style.paddingBottom="0";return()=>{o&&(o.style.paddingBottom="0")}},[e,t,a,o])})({containerRef:c,dropdownRef:"kv"===g?u:p,shouldAdjustHeight:i&&("kv"===g&&(h?.length||0)>0||"av"===g&&(k?.length||0)>0),resultsLength:(h?.length||0)+(k?.length||0)}),l().createElement("div",{ref:c,className:"il-election-akv-search-candidate"+(a?" dark-theme-enabled":"")},l().createElement("div",{className:"search-section kv-search-section"},l().createElement("label",{htmlFor:"kv-search-input",className:"akv-search-label"},"Hae kuntavaaliehdokasta"),l().createElement("div",{className:"akv-search-input-wrapper"},l().createElement("input",{id:"kv-search-input",className:"akv-search-input "+(v.length>=3&&"kv"===g?"akv-dropdown-open":""),type:"text",placeholder:"Kirjoita ehdokkaan nimi",value:v,onChange:e=>{f(e.target.value),e.target.value.length>=3&&"kv"!==g?(x("kv"),m("")):e.target.value.length<3&&!b&&x(null)}}),l().createElement("div",{className:"akv-search-icon"})),"kv"===g&&d(h,y,o,t,"akv-search-dropdown-container","akv-search-candidate",u)),l().createElement("div",{className:"search-section av-search-section"},l().createElement("label",{htmlFor:"av-search-input",className:"akv-search-label"},"Hae aluevaaliehdokasta"),l().createElement("div",{className:"akv-search-input-wrapper"},l().createElement("input",{id:"av-search-input",className:"akv-search-input "+(b.length>=3&&"av"===g?"akv-dropdown-open":""),type:"text",placeholder:"Kirjoita ehdokkaan nimi",value:b,onChange:e=>{m(e.target.value),e.target.value.length>=3&&"av"!==g?(x("av"),f("")):e.target.value.length<3&&!v&&x(null)}}),l().createElement("div",{className:"akv-search-icon"})),"av"===g&&d(k,y,o,t,"akv-search-dropdown-container","akv-search-candidate",p)))},function(e){const[t,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{o(968),a(!0)},[]),t?l().createElement(p,{...e}):null});var p;return n})(),e.exports=o(a(96540))}}]); 2//# sourceMappingURL=ILElectionAKVSearchCandidate.21f6acf0d.chunk.js.map
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.