{"version":3,"sources":["webpack:///./app/scripts/components/EmptyTable.js","webpack:///./app/scripts/components/Contest.tsx","webpack:///./app/scripts/components/HeadshotCandidateRow.tsx","webpack:///./app/scripts/utils/format-percent.ts","webpack:///./app/scripts/components/PureCanvas.tsx","webpack:///./app/scripts/components/CanvasLayer.tsx","webpack:///./app/scripts/components/Places.tsx","webpack:///./app/scripts/components/SvgLayer.tsx","webpack:///./app/scripts/components/MapLegend.tsx","webpack:///./app/scripts/colors.ts","webpack:///./app/scripts/components/Tooltip.tsx","webpack:///./app/scripts/components/TooltipTable.tsx","webpack:///./app/scripts/utils/get-point.ts","webpack:///./app/scripts/vendor/flatqueue.js","webpack:///./app/scripts/vendor/flatbush.js","webpack:///./app/scripts/utils/prepare-topojson.ts","webpack:///./app/scripts/components/LayeredMap.tsx","webpack:///./app/scripts/utils/clamp.js","webpack:///./app/scripts/utils/platform.ts","webpack:///./app/scripts/election-candidate-colors.ts","webpack:///./app/scripts/components/NewContestShowcase.tsx","webpack:///./config/modern-polyfills.js","webpack:///./app/scripts/components/Portal.js","webpack:///./app/scripts/endpoints.ts","webpack:///./app/scripts/utils/load-json-script.js","webpack:///./app/scripts/components/CandidateRow.tsx","webpack:///./app/scripts/constants.ts","webpack:///./app/scripts/components/FramesChild.js","webpack:///./app/scripts/EmbedApp.tsx","webpack:///./app/scripts/packs/embed.tsx","webpack:///./app/scripts/election-utils.ts","webpack:///./app/scripts/utils/get-json.js","webpack:///./app/scripts/components/OtherCandidate.js","webpack:///./app/scripts/components/SeatPartyDivider.tsx","webpack:///./app/scripts/utils/sum-values.js","webpack:///./app/scripts/utils/shallow-equal.ts","webpack:///./app/scripts/components/PureComponent.tsx","webpack:///../src/utils.mjs","webpack:///../src/constants.mjs","webpack:///../src/framer.mjs","webpack:///../src/frames.mjs","webpack:///./app/scripts/utils/find.ts","webpack:///./app/scripts/components/PartyPill.tsx"],"names":["EmptyTable","_ref","party","h","class","CandidateRow","Header","PreactHTMLConverter","Contest","Component","render","onePrimaryParty","contest","columnCount","contestTitle","isShowcaseRace","showContestTitleInShowcase","renderParty","hideEmptyParty","this","props","onePrimary","length","directory_slug","rowClass","cx","seat__races","seat__highlight_races","get_directory_slug","office","href","concat","title","xlinkHref","map","index","defaultProps","includeCountyRundown","HeadshotCandidateRow","PureComponent","getColor","totalVotesInContest","candidateColors","ballotName","find","colorObj","name","color","candidateId","contestIsCalled","contestResult","isIncumbent","isWinner","isViewable","numDelegates","votes","divStyle","checkStyle","checkClass","PartyPill","style","isCanvass","intcomma","formatPercent","cand","candidate","_defineProperty","isCalled","colSpan","Header_Prez","n","d","toFixed","PureCanvas","shouldComponentUpdate","ref","canvas","contextRef","getContext","CanvasLayer","constructor","super","setContextRef","bind","ctx","draw","geoPath","pixelRatio","scaleCanvas","width","height","window","devicePixelRatio","scale","updateCanvas","componentDidMount","d3GeoPath","projection","componentDidUpdate","position","top","left","zIndex","Places","places","place","idx","key","transform","centroid","dx","properties","dy","text-anchor","anchor","SvgLayer","handleMouseMove","handleMouseLeave","event","onMouseMove","onMouseLeave","setState","strokeLinecap","strokeLinejoin","pointerEvents","viewBox","preserveAspectRatio","state","MapLegend","candidates","includesNoResult","includesTie","backgroundColor","Tooltip","cls","isHidden","tooltipRef","klass","Portal","children","TooltipTable","candidatesMap","county","candidatesRender","source","sortedResults","entries","results","sort","a","b","value","pct_votes","total_votes","estimated_votes_mid","eevp","contestMetricsClass","contest__metrics__canvass","pct_votes_turnout","firstThreeResults","slice","county_pollinglocationsreporting","total_county_pollinglocations","countyHeader","result","get","candColor","filter","id","candidateColor","is_incumbent","is_winner","isMapRow","getPoint","node","x","y","rect","getBoundingClientRect","clientLeft","clientTop","FlatQueue","ids","values","clear","push","pos","parent","parentValue","pop","halfLength","right","bestIndex","bestValue","rightValue","peek","peekValue","ARRAY_TYPES","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array","Flatbush","data","ArrayBuffer","Error","magic","versionAndType","nodeSize","numItems","arguments","undefined","ArrayType","isNaN","Math","min","max","numNodes","_levelBounds","ceil","IndexArrayType","arrayTypeIndex","indexOf","nodesByteSize","BYTES_PER_ELEMENT","_boxes","_indices","_pos","minX","minY","maxX","maxY","Infinity","set","_queue","add","finish","hilbertValues","i","floor","hilbert","boxes","indices","pivot","j","swap","end","nodeMinX","nodeMinY","nodeMaxX","nodeMaxY","nodeIndex","search","filterFn","level","queue","neighbors","maxResults","maxDistance","q","maxDistSquared","upperBound","axisDist","dist","k","arr","m","temp","c","e","A","B","C","D","i0","i1","prepareTopoJSON","topology","object","objects","Object","keys","roadsObject","placesObject","urbanAreasObject","collection","feature","roads","urban_areas","bbox","getBBox","features","forEach","bounds","heightRatio","relocateTooltip","tooltip","innerWidth","innerHeight","LayeredMap","param","typeMap","activeBtn","activeGeometry","candidatesOnMap","geos","onDocumentTouch","getTooltipRef","canvasRenderer","xScale","scaleLinear","yScale","el","setUpCountyMap","counties","countyMap","fips","setUpCandidateMap","candidateMap","clientX","clientY","target","point","coords","invert","found","booleanPointInPolygon","activeCounty","base","contains","embedType","clearRect","fillStyle","leader","second","leadingId","beginPath","fill","closePath","lineCap","lineJoin","strokeStyle","lineWidth","stroke","places_mappable","arc","PI","componentWillReceiveProps","nextProps","getContainerDimensions","offsetWidth","rawWidth","clientWidth","domain","range","fitSize","bboxPolygon","document","addEventListener","precinctsReporting","totalVotes","boxSizing","stroke-width","totalPrecincts","mapType","invisible","Boolean","_ref2","has","userAgent","navigator","colors","raceCandidateColors","isIE","test","ContestShowcase","geoIdentity","reflectY","container","contestContainer","querySelector","mapContainer","countiesContainer","sourceMap","ShowcaseRaceWinner","asOf","notes","annotations","showDelegates","headerUsed","candidacies","colorLookup","office_slug","join","_contestPortal","determineContestTitle","SeatPartyDivider","partyName","partyBallot","tableHeader","renderCandidate","viewAllCandidates","is_called","contest_result","visibleCandidatesCount","_mapPortal","precincts_reporting","require","renderPortal","componentWillUnmount","defaultNode","body","removeChild","portal","createElement","appendChild","RESULTS_IN_USE","loadJsonScript","elementId","element","getElementById","getAttribute","JSON","parse","textContent","candidatesNum","uncontested","IsAsterisk","includes","LENGTH_OF_CHECK_INTERVAL","FramesChild","createRef","polling","initFrameAndPoll","sendFrameHeight","partyRegex","partyShortToLong","App","contests","selectedContests","type","contestsToRender","singlePartyMatch","match","_","officeSlug","partyShort","determineDistrictTitle","renderPartySection","contestIdentifier","parentElement","display","NewContestShowcase","item","parentContest","Row","className","viewAll","fetchData","now","Date","selectedOffices","lastUpdatedFormat","getJSON","then","activeContests","startTimer","timer","setTimeout","clearTimer","clearTimeout","renderOrderedComponents","urlParams","URLSearchParams","location","contestsFromParams","Array","from","EmbedApp","journalize","apdate","formatted_time","aptime","apmonth","getDate","chunk","size","reduce","acc","TT_directory_slugs","slug","CandidateColorsRace1","CandidateColorsRace2","PRESIDENT_ORDER","sort_candidates_presidential","alert_conditionals","vote_pct","cand_num","context","label_conditionals","alert_winners","winner_conditionals","text_conditionals","text_conditional_winner_zero","division_type","office_division","capfirst","trim","determineContestTitleYourRaces","jsonResponse","res","ok","status","statusText","json","input","init","fetch","OtherCandidate","candidateCount","onClick","classes","onViewableToggle","prevState","firstShowcaseRace","isHomepage","converter","shouldDisplayResult","obj","pct_votes_turnout_zero_winner","pct_votes_turnout_w_uncontested","pct_votes_explain","colorWinner","ManualoverrideSource","klaxon","homepage__metrics","precinctsClass","IsAnnotations","IsNoted","pollinglocationsreporting","total_pollinglocations","pollinglocations_reporting_percent","convert","aria-hidden","hOP","prototype","hasOwnProperty","is","shallowEqual","objA","objB","keysA","keysB","call","t","o","allowfullscreen","referrerpolicy","r","sandbox","s","src","f","documentElement","offsetHeight","postMessage","sentinel","v","removeEventListener","w","setInterval","l","remove","iframe","setAttribute","contentWindow","predicate","TypeError","excludeInitial","partyPrefix","toLowerCase","partyInitial","toUpperCase","memoize"],"mappings":"uyrmDAiBeA,EAdIC,IAAgB,IAAf,MAAEC,GAAOD,EAC3B,OACEE,YAAA,OAAKC,MA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d5ae15c9.mjs","sourcesContent":["import { h } from 'preact';\nimport CandidateRow from './CandidateRow';\n\nconst EmptyTable = ({ party }) => {\n  return (\n    <div class=\"seat__race\">\n      <div class=\"race\">\n        <h4 class=\"race__title\">\n          <span>{party}</span>\n        </h4>\n        <table class=\"race__candidates\">{CandidateRow.Header}</table>\n        <div class=\"no_primary_candidates\">No primary candidates running</div>\n      </div>\n    </div>\n  );\n};\n\nexport default EmptyTable;\n","import cx from 'classnames';\nimport { Component, h } from 'preact';\nimport { PreactHTMLConverter } from 'preact-html-converter';\n\n// components\nimport EmptyTable from './EmptyTable';\n\n// internal\nimport { get_directory_slug } from '../election-utils';\n\nconst converter = PreactHTMLConverter();\n\ntype Props = {\n  contest: { [key: string]: any };\n  columnCount: number;\n  contestTitle: string;\n  includeCountyRundown?: boolean;\n  isShowcaseRace?: boolean;\n  renderParty: any;\n  renderCandidate: any;\n  embedType: string;\n  broadcastHeaderImage: string;\n  activeContestId: string;\n  showContestTitleInShowcase?: boolean;\n  hideEmptyParty?: boolean;\n};\n\nclass Contest extends Component<Props> {\n  render() {\n    const {\n      contest,\n      columnCount,\n      contestTitle,\n      isShowcaseRace,\n      showContestTitleInShowcase,\n      renderParty,\n      hideEmptyParty,\n    } = this.props;\n\n    const onePrimary = contest.length == 1;\n\n    let onePrimaryParty;\n\n    if (onePrimary) {\n      onePrimaryParty = contest[0].party;\n    }\n\n    const rowClass = cx({\n      seat__races: !isShowcaseRace,\n      seat__highlight_races: isShowcaseRace,\n    });\n\n    let directory_slug;\n\n    if (contest[0]) {\n      directory_slug = get_directory_slug(contest[0].office);\n    }\n\n    return (\n      <div class=\"seat\">\n        {!isShowcaseRace && (\n          <h3 class=\"seat__title\">\n            <span>{contestTitle}</span>\n            {/* Let's not show U.S. House directory links because the redistricting boundaries have changed and will be reflected in our directory in 2027 */}\n            {directory_slug[0] != null && contest[0].office != 'U.S. House'  && (\n              <a\n                class=\"t-links-unset\"\n                href={`https://www.texastribune.org/directory/districts/${directory_slug[0]['directory-slug']}/${contest[0]['office_division']}`}\n              >\n                <span class=\"icon-div\" title=\"Click to learn more about this district\" >\n                  <svg class=\"icon icon-info\">\n                    <use xlinkHref=\"#icon-info\"></use>\n                  </svg>\n                </span>\n              </a>\n            )}\n          </h3>\n        )}\n        <div class={rowClass}>\n          {onePrimary &&\n            onePrimaryParty == 'Republican' &&\n            !isShowcaseRace &&\n        !hideEmptyParty && <EmptyTable party={'Democrat'} />}\n\n\n          {!isShowcaseRace &&\n        contest.map((party: any, index) => renderParty(party, index))}\n\n          {isShowcaseRace && (\n            <div>\n              {showContestTitleInShowcase && (\n                <h3 class=\"seat__title\">\n                  <span>{contest.office}</span>\n                </h3>\n              )}\n              {renderParty(contest)}\n            </div>\n          )}\n          {onePrimary &&            onePrimaryParty == 'Democrat' &&\n            !isShowcaseRace &&\n            !hideEmptyParty && <EmptyTable party={'Republican'} />}\n        </div>\n      </div>\n    );\n  }\n}\n\nContest.defaultProps = {\n  isShowcaseRace: false,\n  includeCountyRundown: false,\n};\n\nexport default Contest;\n","import cx from 'classnames';\nimport { intcomma } from 'journalize';\nimport { h, VNode } from 'preact';\n\nimport PureComponent from './PureComponent';\n\nimport formatPercent from '../utils/format-percent';\nimport { isCanvass } from '../endpoints';\nimport PartyPill from './PartyPill';\n\ninterface Props {\n  ballotName: string;\n  candidateId: string;\n  contestIsCalled: boolean;\n  contestResult: string;\n  isIncumbent: boolean;\n  isWinner: boolean;\n  numDelegates: any | null;\n  candidateColors: { [key: string]: any };\n  party: string;\n  totalVotesInContest: number;\n  votes: number;\n}\n\nclass HeadshotCandidateRow extends PureComponent<Props> {\n  static columnCount: number;\n  static Header: VNode;\n  static Header_Prez: VNode;\n\n  getColor(totalVotesInContest, candidateColors, ballotName, party) {\n    if (totalVotesInContest === 0) return '#bababa';\n\n    if (candidateColors.length === 0) {\n      return party === 'Republican' ? ['#EF564A'] : ['#1755c5'];\n    }\n\n    if (candidateColors.length > 0) {\n      const candidateMatch = candidateColors.find(colorObj => colorObj.name === ballotName)\n      return candidateMatch.color;\n    }\n\n    return '#EF564A';\n\n  }\n\n  render() {\n    const {\n      ballotName,\n      candidateId,\n      contestIsCalled,\n      contestResult,\n      isIncumbent,\n      isWinner,\n      party,\n      isViewable,\n      office,\n      numDelegates,\n      totalVotesInContest,\n      candidateColors,\n      votes,\n    } = this.props;\n\n    const color = this.getColor(totalVotesInContest, candidateColors, ballotName, party)\n\n    const divStyle = {\n      'background-color': color\n    };\n\n    const checkStyle = {\n      color: color\n    };\n\n    const IsAsterisk = false;\n\n    let rowClass = cx(\n      'candidate',\n      'contest__candidate-row',\n      'contest__candidate-row--headshot',\n      {\n        'contest__candidate-row--winner dem--border':\n          contestIsCalled && isWinner && party == 'Democrat',\n        'contest__candidate-row--winner rep--border':\n          contestIsCalled && isWinner && party == 'Republican',\n      }\n    );\n\n    let checkClass = cx('check', {\n      'dem-winner': party == 'Democrat',\n      'rep-winner': party == 'Republican',\n      'runoff-winner': contestResult == 'runoff',\n    });\n\n    if (!isViewable) {\n      rowClass += ' race__candidate-row--hidden';\n    }\n\n    const checkmark = '\\u2713';\n\n    return (\n      <tr class={rowClass}>\n        <td class=\"candidate__cell candidate__party\">\n          {party == 'Republican' && (\n            <PartyPill party={party} style={divStyle} />\n          )}\n          {party == 'Democrat' && <PartyPill party={party} style={divStyle} />}\n        </td>\n        <th class=\"candidate__cell candidate__name\">\n          {contestIsCalled && isWinner && contestResult != 'runoff' && (\n            <span class={checkClass} style={checkStyle}>\n              {checkmark}\n            </span>\n          )}\n          {contestIsCalled && isWinner && contestResult == 'runoff' && (\n            <span class={checkClass}>{checkmark}</span>\n          )}\n          {contestIsCalled &&\n          isWinner &&\n          isCanvass == true &&\n          contestResult != 'runoff' ? (\n            <span class={checkClass}>{ballotName}</span>\n          ) : (\n            ballotName\n          )}\n          {IsAsterisk && <span class=\"asterisk\">*</span>}{' '}\n          {isIncumbent && (\n            <span class=\"pill pill--basic\" title=\"Currently holds this seat\">\n              Incumbent\n            </span>\n          )}\n        </th>\n        <td class=\"candidate__cell candidate__votes\">{intcomma(votes)}</td>\n        <td class=\"candidate__cell candidate__pct\">\n          {formatPercent(votes, totalVotesInContest)}\n          <span class=\"candidate__pct-symbol\">%</span>\n        </td>\n        {numDelegates && (\n          <td class=\"candidate__cell candidate__votes\">\n            {\n              numDelegates.find(cand => cand.candidate == ballotName)[\n                'delegate-count'\n              ]\n            }\n          </td>\n        )}\n      </tr>\n    );\n  }\n}\n\nHeadshotCandidateRow.defaultProps = {\n  isIncumbent: false,\n  isCalled: false,\n  isWinner: false,\n  isViewable: true,\n};\n\nHeadshotCandidateRow.Header = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n    </tr>\n  </thead>\n);\n\nHeadshotCandidateRow.Header_Prez = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Delegates\n      </th>\n    </tr>\n  </thead>\n);\n\nHeadshotCandidateRow.columnCount = 6;\n\nexport default HeadshotCandidateRow;\n","function formatPercent(n: number, d: number): string {\n  if (d == null || d <= 0) return '0.0';\n\n  return ((n / d) * 100).toFixed(1);\n}\n\nexport default formatPercent;\n","import { Component, h } from 'preact';\n\ninterface Props {\n  style?: any;\n  contextRef: (\n    context: CanvasRenderingContext2D,\n    canvas: HTMLCanvasElement\n  ) => void;\n}\n\nclass PureCanvas extends Component<Props> {\n  shouldComponentUpdate() {\n    return false;\n  }\n\n  render() {\n    return (\n      <canvas\n        style={this.props.style}\n        ref={canvas =>\n          canvas ? this.props.contextRef(canvas.getContext('2d'), canvas) : null\n        }\n      />\n    );\n  }\n}\n\nPureCanvas.defaultProps = {\n  style: {},\n};\n\nexport default PureCanvas;\n","import {\n  geoPath as d3GeoPath,\n  GeoPath,\n  GeoProjection,\n  GeoIdentityTransform,\n} from 'd3-geo';\nimport { h } from 'preact';\n\nimport PureComponent from './PureComponent';\nimport PureCanvas from './PureCanvas';\n\nexport interface CanvasLayerProps {\n  projection: GeoProjection | GeoIdentityTransform;\n  width: number;\n  height: number;\n  typeMap: string;\n  render: (\n    ctx: CanvasRenderingContext2D,\n    geoPath: GeoPath,\n    pixelRatio: number\n  ) => void;\n}\n\nclass CanvasLayer extends PureComponent<CanvasLayerProps> {\n  ctx!: CanvasRenderingContext2D;\n  canvas!: HTMLCanvasElement;\n  geoPath!: GeoPath;\n  pixelRatio!: number;\n\n  constructor() {\n    super();\n\n    this.setContextRef = this.setContextRef.bind(this);\n  }\n\n  setContextRef(ctx: CanvasRenderingContext2D, canvas: HTMLCanvasElement) {\n    this.ctx = ctx;\n    this.canvas = canvas;\n  }\n\n  draw() {\n    const ctx = this.ctx;\n    const geoPath = this.geoPath;\n    const pixelRatio = this.pixelRatio;\n    const { render } = this.props;\n\n    render(ctx, geoPath, pixelRatio);\n  }\n\n  scaleCanvas(\n    canvas: HTMLCanvasElement,\n    ctx: CanvasRenderingContext2D,\n    width: number,\n    height: number\n  ) {\n    const pixelRatio = window.devicePixelRatio || 1;\n    this.pixelRatio = pixelRatio;\n\n    canvas.width = width * pixelRatio;\n    canvas.height = height * pixelRatio;\n\n    canvas.style.width = `${width}px`;\n    canvas.style.height = `${height}px`;\n\n    ctx.scale(pixelRatio, pixelRatio);\n  }\n\n  updateCanvas() {\n    this.scaleCanvas(\n      this.canvas,\n      this.ctx,\n      this.props.width,\n      this.props.height\n    );\n    this.draw();\n  }\n\n  componentDidMount() {\n    // we cannot set up our geoPath until we have a context\n    this.geoPath = d3GeoPath(this.props.projection, this.ctx);\n\n    this.updateCanvas();\n  }\n\n  componentDidUpdate() {\n    this.updateCanvas();\n  }\n\n  render() {\n    return (\n      <PureCanvas\n        style={{ position: 'absolute', top: 0, left: 0, zIndex: 1 }}\n        contextRef={this.setContextRef}\n      />\n    );\n  }\n}\n\nexport default CanvasLayer;\n","import { h } from 'preact';\nimport { GeoPath } from 'd3';\nimport PureComponent from './PureComponent';\nimport { Feature } from 'geojson';\n\nclass Places extends PureComponent<{ geoPath: GeoPath; places: Feature[] }> {\n  render() {\n    const { geoPath, places } = this.props;\n\n    return (\n      <g class=\"places\">\n        <g class=\"place-background-labels\">\n          {places.map((place, idx) => (\n            <text\n              key={`bg-${idx}`}\n              class=\"place-background-label\"\n              transform={`translate(${geoPath.centroid(place)})`}\n              dx={place.properties.dx}\n              dy={place.properties.dy}\n              text-anchor={place.properties.anchor}\n            >\n              {place.properties.name}\n            </text>\n          ))}\n        </g>\n        <g class=\"place-labels\">\n          {places.map((place, idx) => (\n            <text\n              key={`fg-${idx}`}\n              class=\"place-label\"\n              transform={`translate(${geoPath.centroid(place)})`}\n              dx={place.properties.dx}\n              dy={place.properties.dy}\n              text-anchor={place.properties.anchor}\n            >\n              {place.properties.name}\n            </text>\n          ))}\n        </g>\n      </g>\n    );\n  }\n}\n\nexport default Places;\n","import {\n  geoPath as d3GeoPath,\n  GeoPath,\n  GeoIdentityTransform,\n  GeoProjection,\n} from 'd3-geo';\nimport { Component, h, VNode } from 'preact';\n\nimport PureComponent from './PureComponent';\n\nexport interface SvgLayerProps {\n  projection: GeoProjection | GeoIdentityTransform;\n  width: number;\n  height: number;\n  render: (state: SvgLayerState) => VNode | null;\n  onMouseMove?: (event: MouseEvent) => void;\n  onMouseLeave?: (event: MouseEvent) => void;\n}\n\ninterface SvgLayerState {\n  geoPath: GeoPath;\n}\n\nclass SvgLayer extends PureComponent<SvgLayerProps, SvgLayerState> {\n  constructor() {\n    super();\n\n    this.handleMouseMove = this.handleMouseMove.bind(this);\n    this.handleMouseLeave = this.handleMouseLeave.bind(this);\n  }\n\n  handleMouseMove(event: MouseEvent) {\n    const { onMouseMove } = this.props;\n\n    if (onMouseMove) {\n      onMouseMove(event);\n    } else {\n      return;\n    }\n  }\n\n  handleMouseLeave(event: MouseEvent) {\n    const { onMouseLeave } = this.props;\n\n    if (onMouseLeave) {\n      onMouseLeave(event);\n    }\n  }\n\n  componentDidMount() {\n    const geoPath = d3GeoPath(this.props.projection);\n\n    this.setState({ geoPath });\n  }\n\n  render() {\n    const { width, height } = this.props;\n\n    return (\n      <svg\n        width={width}\n        height={height}\n        style={{\n          position: 'relative',\n          top: 0,\n          left: 0,\n          zIndex: 2,\n          strokeLinecap: 'round',\n          strokeLinejoin: 'round',\n          pointerEvents: 'none',\n        }}\n        viewBox={`0 0 ${width} ${height}`}\n        preserveAspectRatio=\"xMidYMid\"\n        onMouseMove={this.handleMouseMove}\n        onMouseLeave={this.handleMouseLeave}\n      >\n        <g>{this.props.render(this.state)}</g>\n      </svg>\n    );\n  }\n}\n\nexport default SvgLayer;\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nimport { DEMOCRAT, NEUTRAL, REPUBLICAN, TIE } from '../colors';\n\nfunction MapLegend({ candidates, includesNoResult, includesTie }) {\n  return (\n    <div class=\"results-map__legend\">\n      {/* <p class=\"results-map__legend-title\">Leader</p> */}\n      <div class=\"results-map__legend-items\">\n        {/* {candidates.map(candidate => {\n          return (\n            <div class=\"results-map__legend-item\">\n              <span\n                class={cx(\n                  'circle-pill',\n                  `pill--${candidate.party.slice(0, 3)}`\n                )}\n              />{' '}\n              <p class=\"results-map__legend-label\">\n                {candidate.ballot_sort_name}\n              </p>\n            </div>\n          );\n        })} */}\n        {includesTie && (\n          <div class=\"results-map__legend-item\">\n            <span class=\"circle-pill\" style={{ backgroundColor: TIE }} />{' '}\n            <p class=\"results-map__legend-label\">Tied</p>\n          </div>\n        )}\n        {includesNoResult && (\n          <div class=\"results-map__legend-item\">\n            <span class=\"circle-pill\" style={{ backgroundColor: NEUTRAL }} />{' '}\n            <p class=\"results-map__legend-label\">No votes</p>\n          </div>\n        )}\n      </div>\n    </div>\n  );\n}\n\nexport default MapLegend;\n","const DEMOCRAT = [\n  '#1755c5',\n  '#ffc200',\n  '#91dfe5',\n  '#fcbec3',\n  '#5acc7d',\n  '#182b4b',\n];\n\nconst REPUBLICAN = [\n  '#1755c5',\n  '#ffc200',\n  '#91dfe5',\n  '#fcbec3',\n  '#5acc7d',\n  '#182b4b',\n];\n\nconst OTHER = '#888888';\n\nconst NEUTRAL = '#F2F2F2';\nconst TIE = '#ffc400';\n\nexport { DEMOCRAT, REPUBLICAN, NEUTRAL, TIE, OTHER };\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nimport Portal from './Portal';\n\ninterface Props {\n  class: string;\n  tooltipRef(any): void;\n  style?: { [key: string]: string };\n  isHidden?: boolean;\n}\n\nfunction Tooltip({ class: cls, style, isHidden, tooltipRef }: Props) {\n  const klass = cx(cls, { 'display-none': isHidden });\n\n  return (\n    <Portal>\n      <div class={klass} style={style} ref={tooltipRef}>\n        {this.props.children}\n      </div>\n    </Portal>\n  );\n}\n\nTooltip.defaultProps = {\n  class: 'tooltip',\n  isHidden: false,\n};\n\nexport default Tooltip;\n","// packages\nimport { entries } from 'd3-collection';\nimport cx from 'classnames';\nimport { h } from 'preact';\n\nimport { isCanvass } from '../endpoints';\n\n// components\nimport CandidateRow from './CandidateRow';\nimport PureComponent from './PureComponent';\n\n// internal\nimport formatPercent from '../utils/format-percent';\n\nclass TooltipTable extends PureComponent<any> {\n  render() {\n    const { candidatesMap, county, candidatesRender, source } = this.props;\n\n    const sortedResults = entries(county.results).sort(\n      (a, b) => b.value - a.value\n    );\n\n    const pct_votes =\n      source == 'Decision Desk HQ'\n        ? formatPercent(county.total_votes, county.estimated_votes_mid)\n        : county.eevp;\n\n    let contestMetricsClass = cx('contest__metrics', {\n      contest__metrics__canvass: isCanvass == true,\n    });\n\n    const pct_votes_turnout =\n      pct_votes < 100\n        ? `An estimated ${pct_votes}% of votes counted`\n        : `An estimated >99% of votes counted`;\n\n    const firstThreeResults = sortedResults.slice(0, 3);\n\n    return (\n      <div class=\"contest\">\n        <table class=\"contest__candidates contest__candidates--tooltip\">\n          <caption>\n            <p class=\"county__title\">{county.county} County</p>\n            <div class={contestMetricsClass}>\n              {isCanvass == false && (\n                <p class=\"contest__precincts\">\n                  {source != 'Associated Press' && source != 'Decision Desk HQ'\n                    ? `${formatPercent(\n                        county.county_pollinglocationsreporting,\n                        county.total_county_pollinglocations\n                      )}% reporting`\n                    : pct_votes_turnout}\n                </p>\n              )}\n            </div>\n          </caption>\n          {CandidateRow.countyHeader}\n          <tbody>\n            {firstThreeResults.map(result => {\n              const candidate = candidatesMap.get(result.key);\n\n              const candColor =\n                county.total_votes > 0\n                  ? candidatesRender.filter(cand => cand.name == candidate.name)\n                  : '#EF564A';\n\n              return (\n                <CandidateRow\n                  key={candidate.id}\n                  ballotName={candidate.name}\n                  candidateId={candidate.id}\n                  contestIsCalled={false}\n                  candidateColor={candColor[0]['color']}\n                  isIncumbent={candidate.is_incumbent}\n                  isWinner={candidate.is_winner}\n                  isMapRow\n                  party={candidate.party}\n                  totalVotesInContest={county.total_votes}\n                  votes={result.value}\n                />\n              );\n            })}\n          </tbody>\n        </table>\n      </div>\n    );\n  }\n}\n\nexport default TooltipTable;\n","function getPoint(node: HTMLElement, x: number, y: number): [number, number] {\n  const rect = node.getBoundingClientRect();\n  return [x - rect.left - node.clientLeft, y - rect.top - node.clientTop];\n}\n\nexport default getPoint;\n","export default class FlatQueue {\n  constructor() {\n    this.ids = [];\n    this.values = [];\n    this.length = 0;\n  }\n\n  clear() {\n    this.length = this.ids.length = this.values.length = 0;\n  }\n\n  push(id, value) {\n    this.ids.push(id);\n    this.values.push(value);\n\n    let pos = this.length++;\n    while (pos > 0) {\n      const parent = (pos - 1) >> 1;\n      const parentValue = this.values[parent];\n      if (value >= parentValue) break;\n      this.ids[pos] = this.ids[parent];\n      this.values[pos] = parentValue;\n      pos = parent;\n    }\n\n    this.ids[pos] = id;\n    this.values[pos] = value;\n  }\n\n  pop() {\n    if (this.length === 0) return undefined;\n\n    const top = this.ids[0];\n    this.length--;\n\n    if (this.length > 0) {\n      const id = (this.ids[0] = this.ids[this.length]);\n      const value = (this.values[0] = this.values[this.length]);\n      const halfLength = this.length >> 1;\n      let pos = 0;\n\n      while (pos < halfLength) {\n        let left = (pos << 1) + 1;\n        const right = left + 1;\n        let bestIndex = this.ids[left];\n        let bestValue = this.values[left];\n        const rightValue = this.values[right];\n\n        if (right < this.length && rightValue < bestValue) {\n          left = right;\n          bestIndex = this.ids[right];\n          bestValue = rightValue;\n        }\n        if (bestValue >= value) break;\n\n        this.ids[pos] = bestIndex;\n        this.values[pos] = bestValue;\n        pos = left;\n      }\n\n      this.ids[pos] = id;\n      this.values[pos] = value;\n    }\n\n    this.ids.pop();\n    this.values.pop();\n\n    return top;\n  }\n\n  peek() {\n    return this.ids[0];\n  }\n\n  peekValue() {\n    return this.values[0];\n  }\n}\n","import FlatQueue from './flatqueue';\n\nconst ARRAY_TYPES = [\n  Int8Array,\n  Uint8Array,\n  Uint8ClampedArray,\n  Int16Array,\n  Uint16Array,\n  Int32Array,\n  Uint32Array,\n  Float32Array,\n  Float64Array,\n];\n\nconst VERSION = 3; // serialized format version\n\nexport default class Flatbush {\n  static from(data) {\n    if (!(data instanceof ArrayBuffer)) {\n      throw new Error('Data must be an instance of ArrayBuffer.');\n    }\n    const [magic, versionAndType] = new Uint8Array(data, 0, 2);\n    if (magic !== 0xfb) {\n      throw new Error('Data does not appear to be in a Flatbush format.');\n    }\n    if (versionAndType >> 4 !== VERSION) {\n      throw new Error(\n        `Got v${versionAndType >> 4} data when expected v${VERSION}.`\n      );\n    }\n    const [nodeSize] = new Uint16Array(data, 2, 1);\n    const [numItems] = new Uint32Array(data, 4, 1);\n\n    return new Flatbush(\n      numItems,\n      nodeSize,\n      ARRAY_TYPES[versionAndType & 0x0f],\n      data\n    );\n  }\n\n  constructor(numItems, nodeSize = 16, ArrayType = Float64Array, data) {\n    if (numItems === undefined)\n      throw new Error('Missing required argument: numItems.');\n    if (isNaN(numItems) || numItems <= 0)\n      throw new Error(`Unpexpected numItems value: ${numItems}.`);\n\n    this.numItems = +numItems;\n    this.nodeSize = Math.min(Math.max(+nodeSize, 2), 65535);\n\n    // calculate the total number of nodes in the R-tree to allocate space for\n    // and the index of each tree level (used in search later)\n    let n = numItems;\n    let numNodes = n;\n    this._levelBounds = [n * 4];\n    do {\n      n = Math.ceil(n / this.nodeSize);\n      numNodes += n;\n      this._levelBounds.push(numNodes * 4);\n    } while (n !== 1);\n\n    this.ArrayType = ArrayType || Float64Array;\n    this.IndexArrayType = numNodes < 16384 ? Uint16Array : Uint32Array;\n\n    const arrayTypeIndex = ARRAY_TYPES.indexOf(this.ArrayType);\n    const nodesByteSize = numNodes * 4 * this.ArrayType.BYTES_PER_ELEMENT;\n\n    if (arrayTypeIndex < 0) {\n      throw new Error(`Unexpected typed array class: ${ArrayType}.`);\n    }\n\n    if (data && data instanceof ArrayBuffer) {\n      this.data = data;\n      this._boxes = new this.ArrayType(this.data, 8, numNodes * 4);\n      this._indices = new this.IndexArrayType(\n        this.data,\n        8 + nodesByteSize,\n        numNodes\n      );\n\n      this._pos = numNodes * 4;\n      this.minX = this._boxes[this._pos - 4];\n      this.minY = this._boxes[this._pos - 3];\n      this.maxX = this._boxes[this._pos - 2];\n      this.maxY = this._boxes[this._pos - 1];\n    } else {\n      this.data = new ArrayBuffer(\n        8 + nodesByteSize + numNodes * this.IndexArrayType.BYTES_PER_ELEMENT\n      );\n      this._boxes = new this.ArrayType(this.data, 8, numNodes * 4);\n      this._indices = new this.IndexArrayType(\n        this.data,\n        8 + nodesByteSize,\n        numNodes\n      );\n      this._pos = 0;\n      this.minX = Infinity;\n      this.minY = Infinity;\n      this.maxX = -Infinity;\n      this.maxY = -Infinity;\n\n      new Uint8Array(this.data, 0, 2).set([\n        0xfb,\n        (VERSION << 4) + arrayTypeIndex,\n      ]);\n      new Uint16Array(this.data, 2, 1)[0] = nodeSize;\n      new Uint32Array(this.data, 4, 1)[0] = numItems;\n    }\n\n    // a priority queue for k-nearest-neighbors queries\n    this._queue = new FlatQueue();\n  }\n\n  add(minX, minY, maxX, maxY) {\n    const index = this._pos >> 2;\n    this._indices[index] = index;\n    this._boxes[this._pos++] = minX;\n    this._boxes[this._pos++] = minY;\n    this._boxes[this._pos++] = maxX;\n    this._boxes[this._pos++] = maxY;\n\n    if (minX < this.minX) this.minX = minX;\n    if (minY < this.minY) this.minY = minY;\n    if (maxX > this.maxX) this.maxX = maxX;\n    if (maxY > this.maxY) this.maxY = maxY;\n  }\n\n  finish() {\n    if (this._pos >> 2 !== this.numItems) {\n      throw new Error(\n        `Added ${this._pos >> 2} items when expected ${this.numItems}.`\n      );\n    }\n\n    const width = this.maxX - this.minX;\n    const height = this.maxY - this.minY;\n    const hilbertValues = new Uint32Array(this.numItems);\n    const hilbertMax = (1 << 16) - 1;\n\n    // map item centers into Hilbert coordinate space and calculate Hilbert values\n    for (let i = 0; i < this.numItems; i++) {\n      let pos = 4 * i;\n      const minX = this._boxes[pos++];\n      const minY = this._boxes[pos++];\n      const maxX = this._boxes[pos++];\n      const maxY = this._boxes[pos++];\n      const x = Math.floor(\n        (hilbertMax * ((minX + maxX) / 2 - this.minX)) / width\n      );\n      const y = Math.floor(\n        (hilbertMax * ((minY + maxY) / 2 - this.minY)) / height\n      );\n      hilbertValues[i] = hilbert(x, y);\n    }\n\n    // sort items by their Hilbert value (for packing later)\n    sort(hilbertValues, this._boxes, this._indices, 0, this.numItems - 1);\n\n    // generate nodes at each tree level, bottom-up\n    for (let i = 0, pos = 0; i < this._levelBounds.length - 1; i++) {\n      const end = this._levelBounds[i];\n\n      // generate a parent node for each block of consecutive <nodeSize> nodes\n      while (pos < end) {\n        let nodeMinX = Infinity;\n        let nodeMinY = Infinity;\n        let nodeMaxX = -Infinity;\n        let nodeMaxY = -Infinity;\n        const nodeIndex = pos;\n\n        // calculate bbox for the new node\n        for (let i = 0; i < this.nodeSize && pos < end; i++) {\n          const minX = this._boxes[pos++];\n          const minY = this._boxes[pos++];\n          const maxX = this._boxes[pos++];\n          const maxY = this._boxes[pos++];\n          if (minX < nodeMinX) nodeMinX = minX;\n          if (minY < nodeMinY) nodeMinY = minY;\n          if (maxX > nodeMaxX) nodeMaxX = maxX;\n          if (maxY > nodeMaxY) nodeMaxY = maxY;\n        }\n\n        // add the new node to the tree data\n        this._indices[this._pos >> 2] = nodeIndex;\n        this._boxes[this._pos++] = nodeMinX;\n        this._boxes[this._pos++] = nodeMinY;\n        this._boxes[this._pos++] = nodeMaxX;\n        this._boxes[this._pos++] = nodeMaxY;\n      }\n    }\n  }\n\n  search(minX, minY, maxX, maxY, filterFn) {\n    if (this._pos !== this._boxes.length) {\n      throw new Error('Data not yet indexed - call index.finish().');\n    }\n\n    let nodeIndex = this._boxes.length - 4;\n    let level = this._levelBounds.length - 1;\n    const queue = [];\n    const results = [];\n\n    while (nodeIndex !== undefined) {\n      // find the end index of the node\n      const end = Math.min(\n        nodeIndex + this.nodeSize * 4,\n        this._levelBounds[level]\n      );\n\n      // search through child nodes\n      for (let pos = nodeIndex; pos < end; pos += 4) {\n        const index = this._indices[pos >> 2];\n\n        // check if node bbox intersects with query bbox\n        if (maxX < this._boxes[pos]) continue; // maxX < nodeMinX\n        if (maxY < this._boxes[pos + 1]) continue; // maxY < nodeMinY\n        if (minX > this._boxes[pos + 2]) continue; // minX > nodeMaxX\n        if (minY > this._boxes[pos + 3]) continue; // minY > nodeMaxY\n\n        if (nodeIndex < this.numItems * 4) {\n          if (filterFn === undefined || filterFn(index)) {\n            results.push(index); // leaf item\n          }\n        } else {\n          queue.push(index); // node; add it to the search queue\n          queue.push(level - 1);\n        }\n      }\n\n      level = queue.pop();\n      nodeIndex = queue.pop();\n    }\n\n    return results;\n  }\n\n  neighbors(x, y, maxResults = Infinity, maxDistance = Infinity, filterFn) {\n    if (this._pos !== this._boxes.length) {\n      throw new Error('Data not yet indexed - call index.finish().');\n    }\n\n    let nodeIndex = this._boxes.length - 4;\n    const q = this._queue;\n    const results = [];\n    const maxDistSquared = maxDistance * maxDistance;\n\n    while (nodeIndex !== undefined) {\n      // find the end index of the node\n      const end = Math.min(\n        nodeIndex + this.nodeSize * 4,\n        upperBound(nodeIndex, this._levelBounds)\n      );\n\n      // add child nodes to the queue\n      for (let pos = nodeIndex; pos < end; pos += 4) {\n        const index = this._indices[pos >> 2];\n\n        const dx = axisDist(x, this._boxes[pos], this._boxes[pos + 2]);\n        const dy = axisDist(y, this._boxes[pos + 1], this._boxes[pos + 3]);\n        const dist = dx * dx + dy * dy;\n\n        if (nodeIndex < this.numItems * 4) {\n          // leaf node\n          if (filterFn === undefined || filterFn(index)) {\n            // put a negative index if it's an item rather than a node, to recognize later\n            q.push(-index - 1, dist);\n          }\n        } else {\n          q.push(index, dist);\n        }\n      }\n\n      // pop items from the queue\n      while (q.length && q.peek() < 0) {\n        const dist = q.peekValue();\n        if (dist > maxDistSquared) {\n          q.clear();\n          return results;\n        }\n        results.push(-q.pop() - 1);\n\n        if (results.length === maxResults) {\n          q.clear();\n          return results;\n        }\n      }\n\n      nodeIndex = q.pop();\n    }\n\n    q.clear();\n    return results;\n  }\n}\n\nfunction axisDist(k, min, max) {\n  return k < min ? min - k : k <= max ? 0 : k - max;\n}\n\n// binary search for the first value in the array bigger than the given\nfunction upperBound(value, arr) {\n  let i = 0;\n  let j = arr.length - 1;\n  while (i < j) {\n    const m = (i + j) >> 1;\n    if (arr[m] > value) {\n      j = m;\n    } else {\n      i = m + 1;\n    }\n  }\n  return arr[i];\n}\n\n// custom quicksort that sorts bbox data alongside the hilbert values\nfunction sort(values, boxes, indices, left, right) {\n  if (left >= right) return;\n\n  const pivot = values[(left + right) >> 1];\n  let i = left - 1;\n  let j = right + 1;\n\n  while (true) {\n    do i++;\n    while (values[i] < pivot);\n    do j--;\n    while (values[j] > pivot);\n    if (i >= j) break;\n    swap(values, boxes, indices, i, j);\n  }\n\n  sort(values, boxes, indices, left, j);\n  sort(values, boxes, indices, j + 1, right);\n}\n\n// swap two values and two corresponding boxes\nfunction swap(values, boxes, indices, i, j) {\n  const temp = values[i];\n  values[i] = values[j];\n  values[j] = temp;\n\n  const k = 4 * i;\n  const m = 4 * j;\n\n  const a = boxes[k];\n  const b = boxes[k + 1];\n  const c = boxes[k + 2];\n  const d = boxes[k + 3];\n  boxes[k] = boxes[m];\n  boxes[k + 1] = boxes[m + 1];\n  boxes[k + 2] = boxes[m + 2];\n  boxes[k + 3] = boxes[m + 3];\n  boxes[m] = a;\n  boxes[m + 1] = b;\n  boxes[m + 2] = c;\n  boxes[m + 3] = d;\n\n  const e = indices[i];\n  indices[i] = indices[j];\n  indices[j] = e;\n}\n\n// Fast Hilbert curve algorithm by http://threadlocalmutex.com/\n// Ported from C++ https://github.com/rawrunprotected/hilbert_curves (public domain)\nfunction hilbert(x, y) {\n  let a = x ^ y;\n  let b = 0xffff ^ a;\n  let c = 0xffff ^ (x | y);\n  let d = x & (y ^ 0xffff);\n\n  let A = a | (b >> 1);\n  let B = (a >> 1) ^ a;\n  let C = (c >> 1) ^ (b & (d >> 1)) ^ c;\n  let D = (a & (c >> 1)) ^ (d >> 1) ^ d;\n\n  a = A;\n  b = B;\n  c = C;\n  d = D;\n  A = (a & (a >> 2)) ^ (b & (b >> 2));\n  B = (a & (b >> 2)) ^ (b & ((a ^ b) >> 2));\n  C ^= (a & (c >> 2)) ^ (b & (d >> 2));\n  D ^= (b & (c >> 2)) ^ ((a ^ b) & (d >> 2));\n\n  a = A;\n  b = B;\n  c = C;\n  d = D;\n  A = (a & (a >> 4)) ^ (b & (b >> 4));\n  B = (a & (b >> 4)) ^ (b & ((a ^ b) >> 4));\n  C ^= (a & (c >> 4)) ^ (b & (d >> 4));\n  D ^= (b & (c >> 4)) ^ ((a ^ b) & (d >> 4));\n\n  a = A;\n  b = B;\n  c = C;\n  d = D;\n  C ^= (a & (c >> 8)) ^ (b & (d >> 8));\n  D ^= (b & (c >> 8)) ^ ((a ^ b) & (d >> 8));\n\n  a = C ^ (C >> 1);\n  b = D ^ (D >> 1);\n\n  let i0 = x ^ y;\n  let i1 = b | (0xffff ^ (i0 | a));\n\n  i0 = (i0 | (i0 << 8)) & 0x00ff00ff;\n  i0 = (i0 | (i0 << 4)) & 0x0f0f0f0f;\n  i0 = (i0 | (i0 << 2)) & 0x33333333;\n  i0 = (i0 | (i0 << 1)) & 0x55555555;\n\n  i1 = (i1 | (i1 << 8)) & 0x00ff00ff;\n  i1 = (i1 | (i1 << 4)) & 0x0f0f0f0f;\n  i1 = (i1 | (i1 << 2)) & 0x33333333;\n  i1 = (i1 | (i1 << 1)) & 0x55555555;\n\n  return ((i1 << 1) | i0) >>> 0;\n}\n","import { feature, mesh } from 'topojson-client';\nimport getBBox from '@turf/bbox';\n\nimport Flatbush from '../vendor/flatbush';\n\nconst innerCompare = (a: TopoJSON.GeometryObject, b: TopoJSON.GeometryObject) =>\n  a !== b;\nconst outerCompare = (a: TopoJSON.GeometryObject, b: TopoJSON.GeometryObject) =>\n  a === b;\n\nfunction prepareTopoJSON(topology: TopoJSON.Topology, key?: string) {\n  const object = topology.objects[\n    key || Object.keys(topology.objects)[0]\n  ] as TopoJSON.GeometryCollection;\n  const roadsObject = topology.objects['roads'] as TopoJSON.GeometryCollection;\n  const placesObject = topology.objects[\n    'places'\n  ] as TopoJSON.GeometryCollection;\n  const urbanAreasObject = topology.objects[\n    'urban_areas'\n  ] as TopoJSON.GeometryCollection;\n\n  const collection = feature(topology, object);\n  const roads = feature(topology, roadsObject);\n  const places = feature(topology, placesObject);\n  const urban_areas = feature(topology, urbanAreasObject);\n  // const innerlines = mesh(topology, object, innerCompare);\n  // const outerlines = mesh(topology, object, outerCompare);\n  const bbox = topology.bbox || getBBox(collection);\n\n  const index = new Flatbush(collection.features.length);\n  collection.features.forEach(feature => {\n    const bounds = getBBox(feature);\n    index.add(...bounds);\n  });\n  index.finish();\n\n  const heightRatio = (bbox[3] - bbox[1]) / (bbox[2] - bbox[0]);\n\n  return {\n    collection,\n    // features,\n    // innerlines,\n    // outerlines,\n    bbox,\n    heightRatio,\n    index,\n    roads,\n    places,\n    urban_areas,\n  };\n}\n\nexport default prepareTopoJSON;\n","// packages\nimport cx from 'classnames';\nimport { entries, map, Map, set, Set } from 'd3-collection';\nimport { GeoPath, GeoIdentityTransform, GeoProjection } from 'd3-geo';\nimport { scaleLinear, ScaleLinear } from 'd3-scale';\nimport { Feature, Point } from 'geojson';\nimport { Component, h } from 'preact';\nimport bboxPolygon from '@turf/bbox-polygon';\nimport booleanPointInPolygon from '@turf/boolean-point-in-polygon';\n\n// components\nimport CanvasLayer from './CanvasLayer';\nimport Places from './Places';\nimport Portal from './Portal';\nimport SvgLayer from './SvgLayer';\nimport MapLegend from './MapLegend';\nimport Tooltip from './Tooltip';\nimport TooltipTable from './TooltipTable';\n\n// internal\nimport clamp from '../utils/clamp';\nimport * as colors from '../colors';\nimport find from '../utils/find';\nimport getPoint from '../utils/get-point';\nimport prepareTopoJSON from '../utils/prepare-topojson';\nimport { Topology } from 'topojson-specification';\n\ninterface LayeredMapProps {\n  projection: GeoProjection | GeoIdentityTransform;\n  topology: Topology;\n  precinctsReporting: number;\n  totalVotes: number;\n  source: string;\n  candidatesRender: { [key: string]: any };\n}\n\ninterface LayeredMapState {\n  activeGeometry: Feature | null;\n  candidatesOnMap: Set;\n  geos: any;\n  width: number;\n  height: number;\n  x: number;\n  y: number;\n  activeBtn: boolean;\n  includesTie: boolean;\n  typeMap: string;\n}\n\nconst tooltipPush = 20;\n\nconst relocateTooltip = (tooltip, x, y) => {\n  const { height, width } = tooltip.getBoundingClientRect();\n\n  const innerWidth = window.innerWidth;\n  const innerHeight = window.innerHeight;\n\n  const left = clamp(\n    x - width / 2,\n    tooltipPush,\n    innerWidth - width - tooltipPush\n  );\n  const top =\n    innerHeight > y + tooltipPush + height\n      ? y + tooltipPush\n      : y - height - tooltipPush;\n\n  tooltip.style.left = `${left}px`;\n  tooltip.style.top = `${top}px`;\n};\n\nclass LayeredMap extends Component<LayeredMapProps, LayeredMapState> {\n  xScale: ScaleLinear<number, number>;\n  yScale: ScaleLinear<number, number>;\n  tooltip!: HTMLElement;\n  candidateMap!: Map<any>;\n  countyMap!: Map<any>;\n  embedType: string;\n  candidatesRender: { [key: string]: any };\n\n  constructor() {\n    super();\n\n    this.state = {\n      activeGeometry: null,\n      candidatesOnMap: set(),\n      geos: {},\n      width: 0,\n      height: 0,\n      includesNoResult: false,\n      includesTie: false,\n      typeMap: 'categorical',\n      activeBtn: 'categorical',\n      x: 0,\n      y: 0,\n    };\n\n    this.onMouseMove = this.onMouseMove.bind(this);\n    this.onMouseLeave = this.onMouseLeave.bind(this);\n    this.onDocumentTouch = this.onDocumentTouch.bind(this);\n    this.getTooltipRef = this.getTooltipRef.bind(this);\n    this.canvasRenderer = this.canvasRenderer.bind(this);\n\n    this.xScale = scaleLinear();\n    this.yScale = scaleLinear();\n  }\n\n  getTooltipRef(el: HTMLElement) {\n    this.tooltip = el;\n  }\n\n  setUpCountyMap(counties: any) {\n    this.countyMap = map(counties, d => d.fips);\n  }\n\n  setUpCandidateMap(candidates: any) {\n    this.candidateMap = map(candidates, d => d.id);\n  }\n\n  handleClick = param => event => {\n    this.setState({\n      typeMap: param,\n      activeBtn: param,\n    });\n  };\n\n  onMouseMove(event: MouseEvent) {\n    const { clientX: x, clientY: y, target } = event;\n    const point = getPoint(target as HTMLElement, x, y);\n\n    const coords = [this.xScale.invert(point[0]), this.yScale.invert(point[1])];\n\n    const { collection, index } = this.state.geos;\n\n    const found = index\n      .search(...coords, ...coords)\n      .map((i: number) => collection.features[i]);\n\n    const activeGeometry = find(\n      found,\n      (feature: Feature<GeoJSON.Polygon | GeoJSON.MultiPolygon>) =>\n        booleanPointInPolygon(coords, feature)\n    );\n\n    let activeCounty = null;\n\n    if (activeGeometry) {\n      const { fips } = activeGeometry.properties;\n      activeCounty = this.countyMap.get(fips);\n    }\n\n    this.setState({ activeCounty, activeGeometry }, () =>\n      relocateTooltip(this.tooltip, x, y)\n    );\n  }\n\n  onMouseLeave() {\n    this.setState({ activeCounty: null, activeGeometry: null });\n  }\n\n  onDocumentTouch(e) {\n    if (!this.base.contains(e.target)) this.onMouseLeave();\n  }\n\n  canvasRenderer(ctx: CanvasRenderingContext2D, geoPath: GeoPath) {\n    const { geos, width, height, typeMap } = this.state;\n\n    const { candidatesRender, embedType } = this.props;\n\n    ctx.clearRect(0, 0, width, height);\n\n    if (!geos.collection) return;\n\n    const candidatesOnMap = set();\n    let includesNoResult = false;\n    let includesTie = false;\n\n    geos.collection.features.forEach((feature: Feature) => {\n      const { fips } = feature.properties;\n      const county = this.countyMap.get(fips);\n\n      let fillStyle;\n\n      if (county.total_votes <= 0) {\n        includesNoResult = true;\n        fillStyle = colors.NEUTRAL;\n      } else {\n        const sortedResults = entries(county.results).sort(\n          (a, b) => b.value - a.value\n        );\n\n        const leader = sortedResults[0];\n        const second = sortedResults[1];\n\n        if (leader.value === second.value) {\n          includesTie = true;\n          fillStyle = colors.TIE;\n        } else {\n          const leadingId = leader.key;\n          candidatesOnMap.add(leadingId);\n\n          const { id, name } = this.candidateMap.get(leadingId);\n          const result = candidatesRender.filter(cand => cand.name == name);\n          fillStyle = result[0]['color'];\n        }\n      }\n\n      ctx.beginPath();\n      geoPath(feature);\n\n      ctx.fillStyle = fillStyle;\n      ctx.fill();\n      ctx.closePath();\n    });\n\n    ctx.beginPath();\n    geoPath(geos.collection);\n\n    ctx.lineCap = 'round';\n    ctx.lineJoin = 'round';\n    ctx.strokeStyle = 'rgba(255, 255, 255, .6)'; //255, 255, 255\n    ctx.lineWidth = 0.8;\n\n    ctx.stroke();\n    ctx.closePath();\n\n    geos.roads.features.forEach((feature: Feature) => {\n      if (feature.properties.level !== 'Interstate') return;\n      ctx.beginPath();\n      geoPath(feature);\n\n      ctx.lineCap = 'round';\n      ctx.lineJoin = 'round';\n\n      if (feature.properties.level === 'Interstate') {\n        ctx.strokeStyle = 'rgba(0, 0, 0, .12)';\n        ctx.lineWidth = 1;\n      } else {\n        ctx.strokeStyle = 'rgba(0, 0, 0, .08)';\n        ctx.lineWidth = 0.8;\n      }\n\n      ctx.stroke();\n      ctx.closePath();\n    });\n\n    let places_mappable = geos.places;\n\n    geos.places = places_mappable;\n\n    geos.places.features.forEach((feature: Feature<Point>) => {\n      const [x, y] = geoPath.centroid(feature);\n\n      ctx.beginPath();\n      ctx.arc(x, y, 3, 0, Math.PI * 2, true);\n      ctx.strokeStyle = 'rgba(33, 33, 33, .75)';\n      ctx.lineWidth = 1.25;\n      ctx.stroke();\n      ctx.closePath();\n    });\n\n    geos.urban_areas.features.forEach((feature: Feature) => {\n      ctx.beginPath();\n      geoPath(feature);\n\n      ctx.fillStyle = 'rgba(153, 160, 175, 0.2)';\n      ctx.fill();\n      ctx.closePath();\n    });\n\n    this.setState({ candidatesOnMap, includesNoResult, includesTie });\n  }\n\n  componentWillReceiveProps(nextProps) {\n    const { candidates, counties } = nextProps;\n\n    this.setUpCandidateMap(candidates);\n    this.setUpCountyMap(counties);\n  }\n\n  getContainerDimensions() {\n    const base = this.base!;\n    const rawWidth = base.offsetWidth;\n\n    this.setState({ width });\n  }\n\n  componentDidMount() {\n    const { candidates, counties, candidatesRender } = this.props;\n\n    this.setUpCandidateMap(candidates);\n    this.setUpCountyMap(counties);\n\n    const base = this.base!;\n    const rawWidth = Math.floor(base.clientWidth);\n\n    const { topology } = this.props;\n    const geos = prepareTopoJSON(topology);\n\n    const { bbox, heightRatio } = geos;\n    const rawHeight = Math.floor(rawWidth * heightRatio);\n\n    const width = rawWidth;\n    const height = rawHeight;\n\n    this.xScale.domain([bbox[0], bbox[2]]).range([0, width]);\n    this.yScale.domain([bbox[1], bbox[3]]).range([height, 0]);\n\n    // Took away a few pixels from the fitSize because of the bubbles. There has to be a better way to do this.\n\n    this.props.projection.fitSize([width - 6, height - 20], bboxPolygon(bbox));\n\n    document.addEventListener('touchstart', this.onDocumentTouch, false);\n\n    this.setState({ geos, width, height });\n  }\n\n  render() {\n    const {\n      candidates,\n      projection,\n      precinctsReporting,\n      totalVotes,\n      candidatesRender,\n      embedType,\n      source,\n    } = this.props;\n    const {\n      activeCounty,\n      activeBtn,\n      activeGeometry,\n      candidatesOnMap,\n      geos,\n      includesNoResult,\n      includesTie,\n      width,\n      height,\n      x,\n      y,\n      typeMap,\n    } = this.state;\n\n    return (\n      <div class=\"all-map-stuff\">\n        <div\n          class=\"layers-map\"\n          style={{\n            boxSizing: 'border-box',\n            width: '100%',\n            height: '100%',\n            position: 'relative',\n          }}\n          onMouseMove={this.onMouseMove}\n          onMouseLeave={this.onMouseLeave}\n        >\n          <SvgLayer\n            width={width}\n            height={height}\n            projection={projection}\n            render={({ geoPath }) => (\n              <g>\n                {geos.places && (\n                  <Places geoPath={geoPath} places={geos.places.features} />\n                )}\n                {activeGeometry && (\n                  <path\n                    fill=\"none\"\n                    stroke=\"black\"\n                    stroke-width=\"2\"\n                    d={geoPath(activeGeometry) || undefined}\n                  />\n                )}\n              </g>\n            )}\n          />\n          <CanvasLayer\n            totalPrecincts={precinctsReporting}\n            totalVotes={totalVotes}\n            projection={projection}\n            width={width}\n            height={height}\n            render={this.canvasRenderer}\n            mapType={typeMap}\n          />\n          <Tooltip\n            class={cx('tooltip map__tooltip', {\n              invisible: !Boolean(activeCounty),\n            })}\n            tooltipRef={this.getTooltipRef}\n          >\n            {activeCounty && (\n              <TooltipTable\n                candidatesRender={candidatesRender}\n                candidatesMap={this.candidateMap}\n                county={activeCounty}\n                source={source}\n              />\n            )}\n          </Tooltip>\n        </div>\n        {/* <MapText\n          typeMap={typeMap}\n        /> */}\n        <MapLegend\n          candidates={candidates.filter(({ id }: { id: string }) =>\n            candidatesOnMap.has(id)\n          )}\n          includesNoResult={includesNoResult}\n          includesTie={includesTie}\n        />\n      </div>\n    );\n  }\n}\n\nexport default LayeredMap;\n","/**\n * Returns the minimum if n is less than the minimum.\n * Returns the maximum if n is more than the maximum.\n * Returns n if n is between the minimum and maximum.\n *\n * @param {Number} n\n * @param {Number} min\n * @param {Number} max\n * @return {Number}\n */\nexport default function clamp(n, min, max) {\n  return Math.min(Math.max(n, min), max);\n}\n","const userAgent = navigator.userAgent;\n\nexport function isThisIE(): boolean {\n  return /Trident|MSIE|IEMobile/i.test(userAgent);\n}\n","const colors = {\n  \"red\": \"#EF564A\",\n  \"pink\": \"#fcbec3\",\n  \"orange\": '#f5af76',\n  \"green\": \"#5acc7d\",\n  \"gray\": '#bababa',\n  \"blue\": '#1755c5'\n}\n\nconst raceCandidateColors = {\n  'us-senate-class-2-Republican': [\n    {\n      name: 'Ken Paxton',\n      color: colors.pink\n    },\n    {\n      name: 'Wesley Hunt',\n      color: colors.orange\n    },\n    {\n      name: 'John Cornyn',\n      color: colors.red\n    },\n    {\n      name: 'Virgil Bierschwale',\n      color: colors.gray\n    },\n    {\n      name: 'Anna Bender',\n      color: colors.gray\n    },\n    {\n      name: 'Gulrez \"Gus\" Khan',\n      color: colors.gray\n    },\n    {\n      name: 'Sara Canady',\n      color: colors.gray\n    },\n    {\n      name: 'John O. Adefope',\n      color: colors.gray\n    },\n    {\n      name: 'Uncommitted',\n      color: colors.gray\n    },\n  ],\n  'us-senate-class-2-Democrat': [\n    {\n      name: 'Jasmine Crockett',\n      color: colors.blue\n    },\n    {\n      name: 'James Talarico',\n      color: colors.green\n    },\n    {\n      name: 'Ahmad R. Hassan',\n      color: colors.pink\n    },\n  ],\n  'attorney-general-Republican': [\n    {\n      name: 'Aaron Reitz',\n      color: colors.orange\n    },\n    {\n      name: 'Chip Roy',\n      color: colors.red\n    },\n    {\n      name: 'Mayes Middleton',\n      color: colors.pink\n    },\n    {\n      name: 'Joan Huffman',\n      color: colors.green\n    },\n  ],\n  'comptroller-Republican': [\n    {\n      name: 'Kelly Hancock',\n      color: colors.red\n    },\n    {\n      name: 'Michael Berlanga',\n      color: colors.gray\n    },\n    {\n      name: 'Christi Craddick',\n      color: colors.orange\n    },\n    {\n      name: 'Don Huffines',\n      color: colors.pink\n    },\n  ],\n};\n\nexport default raceCandidateColors;\n","// packages\nimport { geoIdentity, GeoIdentityTransform } from 'd3-geo';\nimport { Component, h } from 'preact';\n\n// components\nimport Contest from './Contest';\nimport HeadshotCandidateRow from './HeadshotCandidateRow';\nimport SeatPartyDivider from './SeatPartyDivider';\nimport LayeredMap from './LayeredMap';\nimport Portal from './Portal';\n\n// utils\nimport { isThisIE } from '../utils/platform';\nimport {\n  determineContestTitle\n} from '../election-utils';\n\nimport raceCandidateColors from '../election-candidate-colors';\n\nimport { visibleCandidatesCount } from '../endpoints';\n\nimport find from '../utils/find';\n\nimport topology from 'Assets/geography/texas_urban.json';\n\nimport delegates from 'Data/delegates.json';\n\nconst isIE = isThisIE();\n\ninterface ContestShowcaseProps {\n  container: Element;\n  contest: any | null;\n  showDelegates: boolean;\n  showContestTitleInShowcase: boolean;\n  notes: { [key: string]: any };\n  asOf: string;\n  annotations: { [key: string]: any };\n}\n\ninterface ContestShowcaseState {\n  contestContainer: Element;\n  mapContainer: Element;\n  countiesContainer: Element;\n}\n\nclass ContestShowcase extends Component<\n  ContestShowcaseProps,\n  ContestShowcaseState\n> {\n  projection: GeoIdentityTransform;\n\n  constructor() {\n    super();\n\n    this.projection = geoIdentity().reflectY(true);\n  }\n\n  componentDidMount() {\n    const { container } = this.props;\n\n    const contestContainer = container.querySelector('.contest-container');\n    const mapContainer = container.querySelector('.contest-map-container');\n    const countiesContainer = container.querySelector(\n      '.contest-counties-container'\n    );\n\n    this.setState({ contestContainer, mapContainer, countiesContainer });\n  }\n\n  render() {\n    const {\n      contest,\n      asOf,\n      notes,\n      annotations,\n      showDelegates,\n      showContestTitleInShowcase,\n    } = this.props;\n    const { contestContainer, mapContainer, countiesContainer } = this.state;\n\n    // const firstShowcaseRace =\n    // const numDelegates = false;\n    //   contest && contest.office == 'President'\n    //     ? delegates[\n    //         `${contest.office.toLowerCase()}-${contest.party.toLowerCase()}`\n    //       ]\n    //     : false;\n\n\n    // const headerUsed =\n    //   showDelegates == true\n    //     ? HeadshotCandidateRow.Header_Prez\n    //     : HeadshotCandidateRow.Header;\n\n    const numDelegates = false;\n    const headerUsed = HeadshotCandidateRow.Header;\n\n    let candidateColors, sourceMap, ShowcaseRaceWinner;\n\n    if (!contest) return null;\n\n    if (contest) {\n      let candidates = contest.candidacies;\n\n      const colorLookup = [contest.office_slug, '-', contest.party].join('')\n\n      candidateColors = raceCandidateColors[colorLookup] || [];\n\n      sourceMap = contest.source;\n\n      ShowcaseRaceWinner = find(\n        candidates,\n        candidate => candidate.is_winner === true\n      );\n    }\n\n    return (\n      <span>\n        {contestContainer && (\n          <Portal\n            node={contestContainer}\n            ref={ref => (this._contestPortal = ref)}\n          >\n            <Contest\n              contest={contest}\n              contestTitle={determineContestTitle(contest)}\n              showContestTitleInShowcase={showContestTitleInShowcase}\n              isShowcaseRace\n              renderParty={party => (\n                <SeatPartyDivider\n                  partyName={party.party}\n                  partyBallot={party}\n                  isShowcaseRace\n                  annotations={annotations}\n                  notes={notes}\n                  asOf={asOf}\n                  showDelegates={showDelegates == true ? true : false}\n                  ShowcaseRaceWinner={ShowcaseRaceWinner}\n                  source={party.source}\n                  tableHeader={headerUsed}\n                  columnCount={HeadshotCandidateRow.columnCount}\n                  renderCandidate={(\n                    candidate: any,\n                    idx: number,\n                    candidatesRender: any,\n                    viewAllCandidates: any,\n                    { totalVotes }: { totalVotes: number }\n                  ) => (\n                    <HeadshotCandidateRow\n                      key={candidate.id}\n                      ballotName={candidate.name}\n                      candidateId={candidate.id}\n                      office={party['office']}\n                      contestIsCalled={contest.is_called}\n                      contestResult={contest.contest_result}\n                      isIncumbent={candidate.is_incumbent}\n                      isWinner={candidate.is_winner}\n                      numDelegates={numDelegates}\n                      isViewable={\n                        viewAllCandidates || idx < visibleCandidatesCount\n                      }\n                      party={candidate.party}\n                      candidateColors={candidateColors}\n                      totalVotesInContest={totalVotes}\n                      votes={candidate.votes}\n                    />\n                  )}\n                />\n              )}\n            />\n          </Portal>\n        )}\n        {!isIE && mapContainer && (\n          <Portal node={mapContainer} ref={ref => (this._mapPortal = ref)}>\n            <LayeredMap\n              topology={topology}\n              projection={this.projection}\n              candidates={contest.candidacies}\n              candidatesRender={candidateColors}\n              source={sourceMap}\n              counties={contest.counties}\n              precinctsReporting={contest.precincts_reporting}\n              totalVotes={contest.total_votes}\n            />\n          </Portal>\n        )}\n      </span>\n    );\n  }\n}\n\nexport default ContestShowcase;\n","'use strict';\n\n// We depend on intersection-observer enough that it should just be assumed as necessary\nrequire('intersection-observer');\n","import { Component, h, render } from 'preact';\n\nclass Portal extends Component {\n  componentDidMount() {\n    this.renderPortal();\n  }\n\n  componentWillUnmount() {\n    if (this.defaultNode) {\n      document.body.removeChild(this.defaultNode);\n    } else {\n      // Unmount the children rendered in custom node\n      render(null, this.props.node, this.portal);\n    }\n\n    this.defaultNode = null;\n    this.portal = null;\n  }\n\n  componentDidUpdate() {\n    this.renderPortal();\n  }\n\n  renderPortal() {\n    if (!this.props.node && !this.defaultNode) {\n      this.defaultNode = document.createElement('div');\n      document.body.appendChild(this.defaultNode);\n    }\n\n    const children = this.props.children;\n\n    this.portal = render(\n      (children && children[0]) || null,\n      this.props.node || this.defaultNode,\n      this.portal\n    );\n  }\n\n  render() {\n    return null;\n  }\n}\n\nexport default Portal;\n","// Live results being updated by Republic\nconst FLAT_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT.json';\n\n// This has emptied out results i.e. is static\nconst STATIC_FLAT_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_STATIC.json';\n\n// This has the final certified results and is static\nconst FINAL_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_FINAL_RESULTS.json';\n\n// Includes fake results data for testing\nconst FAKE_RESULTS_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_TEST.json';\n\nconst FAKE_RESULTS_URL_TWO =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_AP_test.json';\n\nconst FAKE_RESULTS_MIDDLE =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_AP_test_middle.json';\n\nconst FAKE_RESULTS_LATE =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_AP_test_late_night.json';\n\nconst FAKE_RESULTS_LATE_2 =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/republic_json/results_FLAT_COMPLETE_FEB_23_test.json';\n\n// Used for homepage takeover\nconst HOMEPAGE_URL =\n  'https://s3.amazonaws.com/sos-test-2.texastribune.org/2026_primary/homepage_takeover/2024-primary.json';\n\n// Calls TT stories using the API\nconst STORY_API_URL = (id: number): string =>\n  `https://www.texastribune.org/api/v2/articles/${id}/?format=json&fields=sitewide_image,summary,authors,url,pub_date,updated_date,homepage_headline`;\n\n// This is for the other candidates for the hide/show toggle\nconst visibleCandidatesCount = 4;\n\n// This is for the other candidates for the hide/show toggle just in the homepage\nconst visibleCandidatesCountHomepage = 2;\n\n// Show bubble map toggle option. Set to false if we want to hide it.\nconst showBubbleMap = true;\n\n// Show precincts or estimated votes still being counted text\nconst showPrecinctsReporting = true;\n\n// Adds the checkmark if this is the final official results from local canvass\nconst isCanvass = false;\n\n// Show last updated timestamp, set to true to last updated text\nconst showLastUpdated = true;\n\n// What we are using across the ap\n// will be used on the results page, in the homepage takeover\n// and in the embeds\nconst RESULTS_IN_USE = FLAT_RESULTS_URL;\n\nexport {\n  RESULTS_IN_USE,\n  HOMEPAGE_URL,\n  STORY_API_URL,\n  visibleCandidatesCount,\n  visibleCandidatesCountHomepage,\n  showPrecinctsReporting,\n  isCanvass,\n  showLastUpdated,\n  showBubbleMap,\n};\n","/**\n * Grabs the contents of a `jsonScript` created JSON inline string and returns\n * it as a JSON object. If the element does not exist, or if the script\n * element does not have the JSON MIME type, null is returned instead.\n *\n * @param  {String} elementId the ID of the JSON script element\n * @return {Object|null}\n */\nexport default function loadJsonScript(elementId) {\n  const element = document.getElementById(elementId);\n\n  if (element && element.getAttribute('type') === 'application/json') {\n    return JSON.parse(element.textContent);\n  } else {\n    return null;\n  }\n}\n","import cx from 'classnames';\nimport { capfirst, intcomma } from 'journalize';\nimport { Component, h, VNode } from 'preact';\n\nimport PartyPill from './PartyPill';\nimport PureComponent from './PureComponent';\n\nimport { isCanvass } from '../endpoints';\n\nimport formatPercent from '../utils/format-percent';\n\ninterface Props {\n  ballotName: string;\n  candidateId: string;\n  contestIsCalled: boolean;\n  contestResult: string;\n  isIncumbent: boolean;\n  isWinner: boolean;\n  isMapRow: boolean;\n  candidatesNum: number;\n  party: string;\n  totalVotesInContest: number;\n  votes: number;\n}\n\nclass CandidateRow extends Component<Props> {\n  static Header: VNode;\n  static countyHeader: VNode;\n  static columnCount: number;\n\n  render() {\n    const {\n      ballotName,\n      contestIsCalled,\n      contestResult,\n      isIncumbent,\n      isWinner,\n      isViewable,\n      candidateColor,\n      candidatesNum,\n      isMapRow,\n      party,\n      totalVotesInContest,\n      votes,\n    } = this.props;\n\n    let divStyle;\n\n    let checkStyle;\n\n    if (candidateColor) {\n      divStyle = {\n        'background-color': candidateColor,\n      };\n      checkStyle = {\n        color: candidateColor,\n      };\n    }\n\n    let rowClass = cx('candidate', 'contest__candidate-row', {\n      'contest__candidate-row--winner dem--border':\n        contestIsCalled && isWinner && party == 'Democrat',\n      'contest__candidate-row--winner rep--border':\n        contestIsCalled && isWinner && party == 'Republican',\n    });\n\n    let checkClass = cx('check', {\n      'dem-winner': party == 'Democrat' && contestResult != 'runoff',\n      'rep-winner': party == 'Republican' && contestResult != 'runoff',\n      'runoff-winner': contestResult == 'runoff',\n    });\n\n    if (!isViewable) {\n      rowClass += ' race__candidate-row--hidden';\n    }\n\n    const checkmark = '\\u2713';\n\n    const uncontested = candidatesNum == 1;\n\n    const asteriskNames = [\n      'Andrew White',\n      'Amanda Edwards',\n      'Scott Mandel',\n      'Jay Nagy',\n    ];\n\n    const IsAsterisk = asteriskNames.includes(ballotName);\n\n    return (\n      <tr class={rowClass}>\n        <td class=\"candidate__cell candidate__party\">\n          {!candidateColor && <PartyPill party={party} />}\n          {candidateColor && <PartyPill party={party} style={divStyle} />}\n        </td>\n        <th class=\"candidate__cell candidate__name\">\n          {isWinner &&\n            (contestResult == 'winner' || contestResult == 'uncontested') && (\n              <span class={checkClass}>{checkmark}</span>\n            )}\n          {isWinner && contestResult == 'runoff' && (\n            <span class={checkClass}>{checkmark}</span>\n          )}\n          {isWinner &&\n          isMapRow == null &&\n          isCanvass == true &&\n          contestResult != 'runoff' ? (\n            <span class={checkClass}>{ballotName}</span>\n          ) : (\n            ballotName\n          )}\n          {IsAsterisk && <span class=\"asterisk_out\">*</span>}{' '}\n          {isIncumbent && (\n            <span class=\"pill pill--basic\" title=\"Currently holds this seat\">\n              Incumbent\n            </span>\n          )}\n        </th>\n        <td class=\"candidate__cell candidate__votes\">\n          {uncontested == false ? intcomma(votes) : '—'}\n        </td>\n        <td class=\"candidate__cell candidate__pct\">\n          {uncontested == false\n            ? formatPercent(votes, totalVotesInContest)\n            : '—'}\n          <span class=\"candidate__pct-symbol\">%</span>\n        </td>\n      </tr>\n    );\n  }\n}\n\nCandidateRow.defaultProps = {\n  contestIsCalled: false,\n  isViewable: true,\n};\n\nCandidateRow.Header = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n    </tr>\n  </thead>\n);\n\nCandidateRow.countyHeader = (\n  <thead>\n    <tr>\n      <th class=\"contest__candidate-header\" colSpan={2}>\n        Candidates\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Votes\n      </th>\n      <th class=\"contest__candidate-header contest__candidate-header--numeric\">\n        Pct.\n        <span class=\"candidate__pct-symbol\">%</span>\n      </th>\n    </tr>\n  </thead>\n);\n\nCandidateRow.columnCount = 4;\n\nexport default CandidateRow;\n","const LENGTH_OF_CHECK_INTERVAL = 1000 * 60 * 2; // 2 minutes\nconst TIMERS_SHOULD_RUN = false;\n\nexport { LENGTH_OF_CHECK_INTERVAL, TIMERS_SHOULD_RUN };\n","import { Component, h, createRef } from 'preact';\nimport { initFrameAndPoll, sendFrameHeight } from '@newswire/frames';\n\nclass FramesChild extends Component {\n  constructor(props) {\n    super(props);\n    this.ref = createRef();\n\n    const { polling } = this.props;\n\n    let opts = {};\n    if (polling) opts.polling = polling;\n  }\n\n  componentDidMount() {\n    const { polling } = this.props;\n\n    initFrameAndPoll(polling);\n  }\n\n  componentDidUpdate() {\n    sendFrameHeight();\n  }\n\n  render({ class: klass }) {\n    return (\n      <div class={klass} ref={this.ref}>\n        {this.props.children}\n      </div>\n    );\n  }\n}\n\nexport default FramesChild;\n","// packages\nimport { Component, h } from 'preact';\n\n// components\nimport CandidateRow from './components/CandidateRow';\nimport HeadshotCandidateRow from './components/HeadshotCandidateRow';\nimport Contest from './components/Contest';\nimport NewContestShowcase from './components/NewContestShowcase';\nimport FramesChild from './components/FramesChild';\nimport SeatPartyDivider from './components/SeatPartyDivider';\nimport { DEMOCRAT, NEUTRAL, OTHER } from './colors';\n\n// internal\nimport getJSON from './utils/get-json';\nimport {\n  determineDistrictTitle,\n  lastUpdatedFormat,\n} from './election-utils';\nimport { RESULTS_IN_USE,  visibleCandidatesCount } from './endpoints';\n\nimport { LENGTH_OF_CHECK_INTERVAL } from './constants';\n\nconst partyRegex = /^(.*)-(rep|dem)$/;\n\nconst partyShortToLong = {\n  'rep': 'Republican',\n  'dem': 'Democrat'\n};\n\nclass App extends Component<{ contests: [] }, {}> {\n  constructor() {\n    super();\n\n    this.state = { contests: [] };\n\n    this.fetchData = this.fetchData.bind(this);\n  }\n\n  fetchData() {\n    const now = new Date();\n\n    const selectedContests = this.props.selectedContests;\n\n    const selectedOffices = selectedContests.map(contest => {\n      const singlePartyMatch = contest.office.match(partyRegex);\n      return singlePartyMatch ? singlePartyMatch[1] : contest.office;\n    });\n\n    const asOf = lastUpdatedFormat(now);\n\n    getJSON(RESULTS_IN_USE).then(contests => {\n      const activeContests = contests.filter(contest => selectedOffices.includes(contest.office_slug))\n      this.setState({ contests: activeContests, asOf }, this.startTimer);\n    });\n  }\n\n  startTimer() {\n    this.timer = window.setTimeout(this.fetchData, LENGTH_OF_CHECK_INTERVAL);\n  }\n\n  clearTimer() {\n    window.clearTimeout(this.timer);\n  }\n\n  componentDidMount() {\n    this.fetchData();\n  }\n\n  componentWillUnmount() {\n    this.clearTimer();\n  }\n\n  componentDidUpdate() {}\n\n  renderOrderedComponents = () => {\n    const { contests, asOf } = this.state;\n    const { embedType, notes, annotations, selectedContests } = this.props;\n\n    // We map over the params in the order they were selected\n    return selectedContests.map((param, index) => {\n      const { office, type } = param; // e.g., { office: 'governor-rep', type: 'contest' }\n\n      if (type === 'contest') {\n        let hideEmptyParty = false;\n        let contestsToRender = [];\n        const singlePartyMatch = office.match(partyRegex);\n\n        // handle if a single party is specified\n        if (singlePartyMatch) {\n          const [_, officeSlug, partyShort] = singlePartyMatch;\n          hideEmptyParty = true;\n          const party = partyShortToLong[partyShort];\n          contestsToRender = contests.filter(c => c.office_slug === officeSlug && c.party === party);\n        } else {\n          contestsToRender = contests.filter(c => c.office_slug === office);\n        }\n\n        if (!contestsToRender || contestsToRender.length === 0) return null;\n\n        return (\n          <Contest\n            key={`contest-${office}-${index}`}\n            contest={contestsToRender}\n            hideEmptyParty={hideEmptyParty}\n            columnCount={CandidateRow.columnCount}\n            contestTitle={determineDistrictTitle(contestsToRender[0])}\n            embedType={embedType}\n            renderParty={(party) => this.renderPartySection(party, contestsToRender[0])}\n          />\n        );\n      }\n\n      if (type === 'map') {\n        const singlePartyMatch = office.match(partyRegex);\n        let contest = null;\n\n        // handle if a single party is specified\n        if (singlePartyMatch) {\n          const [_, officeSlug, partyShort] = singlePartyMatch;\n          const party = partyShortToLong[partyShort];\n          contest = contests.find(c => c.office_slug === officeSlug && c.party === party);\n        } else {\n          return null;\n        }\n\n        if (!contest) return null;\n        const contestIdentifier = `${contest.office_slug}-${contest.party}`\n        const container = document.querySelector(`.${office}`);\n        if (container) {\n          container.parentElement.style.display = 'block';\n        }\n\n        // Logic for building a Map\n        return (\n          <NewContestShowcase\n            contest={contest}\n            showContestTitleInShowcase={true}\n            container={container}\n            notes={notes.filter(item => item.type === contestIdentifier)}\n            annotations={annotations.filter(\n              item => item.type === contestIdentifier\n            )}\n            asOf={asOf}\n          />\n        );\n      }\n\n      return null;\n    });\n  }\n\n  renderPartySection = (party, parentContest) => {\n    const { asOf } = this.state;\n    const { annotations, notes, embedType } = this.props;\n\n    party.Row = CandidateRow;\n\n    return (\n      <div className=\"seat__race_wrapper\" key={party.party}>\n        <SeatPartyDivider\n          partyName={party.party}\n          partyBallot={party}\n          tableHeader={HeadshotCandidateRow.Header}\n          asOf={asOf}\n          annotations={annotations.filter(\n            item => item.type === `${party.office_slug}-${party.party}`\n          )}\n          notes={notes.filter(\n            item => item.type === `${party.office_slug}-${party.party}`\n          )}\n          source={party.source}\n          columnCount={party.Row.columnCount}\n          contestTitle={determineDistrictTitle(parentContest)}\n          embedType={embedType}\n          renderCandidate={(candidate, idx, viewAll, { totalVotes }) => (\n            <party.Row\n              key={candidate.id}\n              ballotName={candidate.name}\n              candidateId={candidate.id}\n              contestIsCalled={party.is_called}\n              contestResult={party.contest_result}\n              candidatesNum={party.candidacies.length}\n              isIncumbent={candidate.is_incumbent}\n              isWinner={candidate.is_winner}\n              isViewable={viewAll || idx < 4} // Assuming 4 for visibleCandidatesCount\n              party={candidate.party}\n              totalVotesInContest={totalVotes}\n              votes={candidate.votes}\n            />\n          )}\n        />\n      </div>\n    );\n  }\n\n  render() {\n    return (\n      <FramesChild className=\"embed\">\n        {this.renderOrderedComponents()}\n      </FramesChild>\n    );\n  }\n}\n\nexport default App;\n","import { render, h } from 'preact';\n\nimport loadJsonScript from '../utils/load-json-script';\n\nimport EmbedApp from '../EmbedApp';\nimport parseQueryString from '../utils/parse-query-string';\n\nconst urlParams = new URLSearchParams(location.search);\n\nconst notes = loadJsonScript('notes_data');\nconst annotations = loadJsonScript('annotations_data');\n\nconst contestsFromParams = Array.from(urlParams.entries()).map(\n  ([key, value]) => ({\n    office: value,\n    type: key,\n  })\n);\n\nrender(\n  <EmbedApp\n    selectedContests={contestsFromParams}\n    annotations={annotations}\n    notes={notes}\n    embedType={'internal'}\n  />,\n  document.getElementById('app')\n);\n","var journalize = require('journalize');\n\nimport { capfirst, apdate, aptime, apmonth } from 'journalize';\n\nimport context from 'Data/text.json';\n\nexport function lastUpdatedFormat(now) {\n  // format dates to ap style\n  const formatted_date = journalize.apdate(now),\n    formatted_time = journalize.aptime(now),\n    formatted_month = journalize.apmonth(now),\n    just_day = now.getDate();\n\n  return formatted_time;\n}\n\nexport function format(num) {\n  return num < 10 ? '0' + num : num;\n}\n\nexport const chunk = (arr, size) =>\n  arr.reduce((acc, _, i) => {\n    if (i % size === 0) acc.push(arr.slice(i, i + size));\n    return acc;\n  }, []);\n\nexport const delay = (function() {\n  var timer = 0;\n  return function(callback, ms) {\n    clearTimeout(timer);\n    timer = setTimeout(callback, ms);\n  };\n})();\n\nconst PARTY_SORT_ORDER = [\n  'democrat',\n  'republican',\n  'libertarian',\n  'independent',\n  'write-in',\n];\n\nconst TT_directory_slugs = [\n  { office: 'Texas House', 'directory-slug': 'tx-house' },\n  { office: 'Texas Senate', 'directory-slug': 'tx-senate' },\n  { office: 'U.S. House', 'directory-slug': 'us-house' },\n  { office: 'State Board of Education', 'directory-slug': 'sboe' },\n];\n\nexport function get_directory_slug(office) {\n  return TT_directory_slugs.filter(slug => slug.office == office);\n}\n\nlet opacity = '0.4';\n\nexport const CandidateColorsRace1 = [\n  {\n    name: 'Ken Paxton',\n    color: '#f5af76',\n  },\n  {\n    name: 'Wesley Hunt',\n    color: '#bababa',\n  },\n  {\n    name: 'John Cornyn',\n    color: '#EF564A',\n  },\n  {\n    name: 'Virgil Bierschwale',\n    color: '#bababa',\n  },\n  {\n    name: 'Anne Bender',\n    color: '#bababa',\n  },\n  {\n    name: 'Gulrez \"Gus\" Khan',\n    color: '#bababa',\n  },\n  {\n    name: 'Sara Canady',\n    color: '#bababa',\n  },\n  {\n    name: 'John O. Adefope',\n    color: '#bababa',\n  },\n  {\n    name: 'Uncommitted',\n    color: '#bababa',\n  },\n];\n\nexport const CandidateColorsRace2 = [\n  {\n    name: 'Jasmine Crockett',\n    color: '#fcbec3',\n  },\n  {\n    name: 'James Talarico',\n    color: '#5acc7d',\n  },\n  {\n    name: 'Ahmad R. Hassan',\n    color: '#1755c5',\n  },\n];\n\n// If we need light blue #99d2da; background-color:rgba(153, 210, 218, .1)\n// If we need dark blue #325ba8; background-color:rgba(90, 137, 204, .1)\n\nexport function sort_candidates_by_party(candidates) {\n  return candidates.sort(\n    (a, b) =>\n      PARTY_SORT_ORDER.indexOf(a.party) - PARTY_SORT_ORDER.indexOf(b.party)\n  );\n}\n\nconst PRESIDENT_ORDER = [\n  'Donald J. Trump',\n  'Nikki Haley',\n  'Ron DeSantis',\n  'Vivek Ramaswamy',\n  'Ryan Binkley',\n  'Chris Christie',\n  'Asa Hutchinson',\n  'David Stuckenberg',\n  'Uncommitted',\n];\n\nexport function sort_candidates_presidential(candidates) {\n  return candidates.sort(\n    (a, b) => PRESIDENT_ORDER.indexOf(a.name) - PRESIDENT_ORDER.indexOf(b.name)\n  );\n}\n\nexport function alert_conditionals(vote_pct, cand_num) {\n  if (vote_pct == 0 && cand_num > 1) {\n    return context.label_conditionals['zero-results'];\n  } else if (vote_pct > 0 && vote_pct <= 50 && cand_num > 1) {\n    return context.label_conditionals['more-than-0-less-than-50'];\n  } else if (vote_pct > 50 && vote_pct < 99 && cand_num > 1) {\n    return context.label_conditionals['more-than-50-no-winner'];\n  } else if (vote_pct >= 99 && cand_num > 1) {\n    return context.label_conditionals['all-results-in-no-winner'];\n  } else if (cand_num == 1) {\n    return context.label_conditionals['uncontested'];\n  }\n}\n\nexport function alert_winners(result, office) {\n  if (result == 'winner' && office != 'President') {\n    return context.winner_conditionals['winner'];\n  } else if (result == 'winner' && office == 'President') {\n    return context.winner_conditionals['winner_prez'];\n  } else if (result == 'uncontested') {\n    return context.winner_conditionals['uncontested'];\n  } else if (result == 'runoff') {\n    return context.winner_conditionals['runoff'];\n  }\n}\n\nexport function text_conditionals(vote_pct, cand_num) {\n  if (vote_pct == 0 && cand_num > 1) {\n    return context.text_conditionals['zero-results'];\n  } else if (vote_pct > 1 && vote_pct <= 50 && cand_num > 1) {\n    return context.text_conditionals['more-than-0-less-than-50'];\n  } else if (vote_pct > 50 && vote_pct < 99 && cand_num > 1) {\n    return context.text_conditionals['more-than-50-no-winner'];\n  } else if (vote_pct >= 99 && cand_num > 1) {\n    return context.text_conditionals['all-results-in-no-winner'];\n  } else if (cand_num == 1) {\n    return context.text_conditionals['uncontested'];\n  }\n}\n\nexport function text_conditional_winner_zero(vote_pct, cand_num) {\n  if (vote_pct == 0 && cand_num > 1) {\n    return context.text_conditionals['zero-results_winner'];\n  } else {\n    return ``;\n  }\n}\n\nexport function determineDistrictTitle(contest) {\n  return `${contest.office} ${\n    contest.office === 'President' ||\n    contest.division_type === 'class' ||\n    contest.division_type === 'statewide'\n      ? ''\n      : contest.division_type === 'place' && contest.office_division === 1\n      ? 'Chief Justice'\n      : capfirst(contest.division_type) + ' ' + contest.office_division\n  }`.trim();\n}\n\nexport function determineContestTitle(contest) {\n  if (contest.division_type === 'statewide' || contest.division_type === 'seat')\n    return '';\n\n  return determineDistrictTitle(contest);\n}\n\nexport function determineContestTitleYourRaces(contest) {\n  return determineDistrictTitle(contest);\n}\n","/**\n * A wrapper for the initial response from a fetch call that funnels to\n * res.json().\n *\n * @private\n * @param {Response} res\n * @returns {Promise}\n */\nfunction jsonResponse(res) {\n  if (!res.ok) throw new Error(`${res.status}: ${res.statusText}`);\n\n  return res.json();\n}\n\n/**\n * A light wrapper around fetch that assumes you're seeking a JSON response.\n *\n * @param {String|Request} input\n * @param {Object} init\n * @returns {Promise}\n */\nexport default function getJSON(input, init) {\n  return fetch(input, init).then(jsonResponse);\n}\n","import cx from 'classnames';\nimport { h } from 'preact';\n\nfunction OtherCandidate({\n  isViewable,\n  candidateCount,\n  embedType,\n  onClick,\n  showDelegates,\n}) {\n  const classes = cx('candidate race__candidate-row', {\n    'race__candidate-row--hidden': !isViewable,\n  });\n\n  return (\n    <tr class={classes}>\n      <td\n        class=\"candidate__cell candidate__party t-align-center\"\n        onClick={onClick}\n      >\n        <svg class=\"icon icon-angle-down\">\n          <use xlinkHref=\"#icon-angle-down\" />\n        </svg>\n      </td>\n      <th class=\"candidate__cell candidate__name\">\n        <button class={embedType} onClick={onClick}>\n          Show All ({candidateCount}){' '}\n        </button>\n      </th>\n      <th class=\"candidate__cell candidate__votes\"></th>\n      <th class=\"candidate__cell candidate__pct\"></th>\n      {showDelegates && <td class=\"candidate__cell candidate__votes\">{}</td>}\n    </tr>\n  );\n}\n\nexport default OtherCandidate;\n","import cx from 'classnames';\nimport { intcomma } from 'journalize';\nimport { Component, h } from 'preact';\n\nimport OtherCandidate from './OtherCandidate';\nimport { PreactHTMLConverter } from 'preact-html-converter';\n\n// internal\nimport {\n  sort_candidates_presidential,\n  CandidateColorsRace1,\n  CandidateColorsRace2,\n  alert_conditionals,\n  alert_winners,\n  text_conditionals,\n  text_conditional_winner_zero,\n} from '../election-utils';\nimport sumValues from '../utils/sum-values';\nimport formatPercent from '../utils/format-percent';\n\nimport find from '../utils/find';\n\nimport { isCanvass, visibleCandidatesCount } from '../endpoints';\n\ninterface Props {\n  partyName: string;\n  tableHeader: JSX.Element;\n  annotations: { [key: string]: any };\n  notes: { [key: string]: any };\n  isShowcaseRace?: boolean;\n  isHomepage?: boolean;\n  asOf: string;\n  source: string;\n  showDelegates: boolean;\n  columnCount: number;\n  ShowcaseRaceWinner: any;\n  partyBallot: { [key: string]: any };\n  renderCandidate: any;\n  contestTitle: string;\n  embedType: string;\n}\n\nclass SeatPartyDivider extends Component {\n  constructor() {\n    super();\n\n    this.state = {\n      viewAllCandidates: false,\n    };\n    this.onViewableToggle = this.onViewableToggle.bind(this);\n  }\n\n  onViewableToggle() {\n    this.setState(prevState => ({\n      viewAllCandidates: !prevState.viewAllCandidates, // set viewAllCandidates to what is wasn't before\n    }));\n  }\n  render() {\n    const {\n      partyName,\n      annotations,\n      notes,\n      partyBallot,\n      tableHeader,\n      isShowcaseRace,\n      isHomepage,\n      columnCount,\n      showDelegates,\n      ShowcaseRaceWinner,\n      asOf,\n      source,\n      renderCandidate,\n      contestTitle,\n      embedType,\n    } = this.props;\n\n    const { viewAllCandidates } = this.state;\n\n    const converter = PreactHTMLConverter();\n\n    const shouldDisplayResult = partyBallot.contest_result !== 'not called';\n\n    // console.log(partyBallot.contest_result);\n\n    const totalVotes = sumValues(partyBallot.candidacies, 'votes');\n\n    let candidates = partyBallot.candidacies;\n\n    const uncontested = candidates.length == 1;\n\n    let ap_eevp = partyBallot.eevp;\n\n    const pct_votes =\n      source == 'Decision Desk HQ'\n        ? formatPercent(totalVotes, partyBallot.estimated_votes_mid)\n        : partyBallot.eevp;\n\n    const pct_votes_turnout =\n      pct_votes < 100\n        ? `An estimated ${pct_votes}% of votes have been counted, according to the ${source}.`\n        : `An estimated >99% of votes have been counted, according to the ${source}.`;\n\n    const pct_votes_turnout_zero_winner =\n      pct_votes == 0 && shouldDisplayResult ? `` : pct_votes_turnout;\n\n    const pct_votes_turnout_w_uncontested =\n      uncontested == true\n        ? text_conditionals(pct_votes, partyBallot.candidacies.length)\n        : pct_votes_turnout_zero_winner;\n\n    const pct_votes_explain = !shouldDisplayResult\n      ? text_conditionals(pct_votes, partyBallot.candidacies.length)\n      : text_conditional_winner_zero(pct_votes, partyBallot.candidacies.length);\n\n    let candidatesRender;\n\n    let firstShowcaseRace;\n\n    let embedTypeUsable = 'none';\n\n    if (typeof embedType !== 'undefined') {\n      embedTypeUsable = embedType;\n    }\n\n    let checkStyle;\n\n    if (isShowcaseRace) {\n      firstShowcaseRace =\n        partyBallot.office == 'President' && partyBallot.party == 'Republican';\n      // !isHomepage;\n\n      candidatesRender = firstShowcaseRace\n        ? CandidateColorsRace1\n        : CandidateColorsRace2;\n\n      if (ShowcaseRaceWinner) {\n        const colorWinner = find(\n          candidatesRender,\n          candidate => candidate.name === ShowcaseRaceWinner['name']\n        );\n\n        if (colorWinner) {\n          checkStyle = {\n            color: colorWinner['color'],\n          };\n        }\n      }\n    }\n\n    if (\n      partyBallot.office == 'President' &&\n      partyBallot.party == 'Republican' &&\n      totalVotes == 0\n    ) {\n      candidates = sort_candidates_presidential(candidates);\n    }\n\n    const rowClass = cx('seat__race', {\n      'seat__race--Democrat': partyName == 'Democrat',\n      'seat__race--Republican': partyName == 'Republican',\n    });\n\n    const klaxon_sos = 'Race has been declared'; // if we switch sources to TX SOS and someone else has declared the winner\n\n    const klaxon = shouldDisplayResult\n      ? source == 'Decision Desk HQ' || source == 'Associated Press'\n        ? alert_winners(partyBallot.contest_result, partyBallot.office)\n        : klaxon_sos\n      : alert_conditionals(pct_votes, partyBallot.candidacies.length);\n\n    const checkmark = '\\u2713';\n\n    let checkClass = cx('check', {\n      'dem-winner':\n        partyBallot.party == 'Democrat' &&\n        partyBallot.contest_result != 'runoff',\n      'rep-winner':\n        partyBallot.party == 'Republican' &&\n        partyBallot.contest_result != 'runoff',\n      'runoff-winner': partyBallot.contest_result == 'runoff',\n    });\n\n    const contestMetricsClass = cx('contest__metrics', {\n      homepage__metrics: isHomepage,\n      'non-homepage__metrics': !isHomepage,\n    });\n\n    let hasTurnoutmodel =\n      source == 'Decision Desk HQ' || source == 'Associated Press'\n        ? true\n        : false;\n\n    const precinctsClass = cx('contest__precincts');\n\n    let ManualoverrideSource;\n\n    // If there is a race, that's being manually updated, you can change the Source to whatever the new votes are coming from here if you uncomment the code below. This is only if the source isn't Texas Secretary of State. If it is, then you don't have to do anything.\n\n    // if (partyBallot.office == 'U.S. House' && partyBallot.office_division == 37 && partyBallot.party == 'Republican') {\n    //   ManualoverrideSource = 'Travis County Elections'\n    // }\n    // else {\n    //   ManualoverrideSource = ''\n    // }\n\n    ManualoverrideSource = '';\n\n    const IsAnnotations =\n      annotations && annotations.length > 0 && annotations[0].value != ''\n        ? true\n        : false;\n\n    const IsNoted = notes && notes.length > 0 ? true : false;\n\n    return (\n      <div class={rowClass}>\n        <div class=\"race\">\n          {isHomepage ? (\n            <span>\n              <h2 class=\"office__title\">{contestTitle}</h2>\n              <h3 class=\"race__title\">\n                {partyName}\n                {partyName == 'Democrat' && <span>ic</span>} Primary{' '}\n              </h3>\n            </span>\n          ) : (\n            <span>\n              <h4 class=\"race__title\">{partyName} </h4>\n            </span>\n          )}\n\n          <div class={contestMetricsClass}>\n            {isCanvass == false && (\n              <h4 class=\"klaxon__text\">\n                {shouldDisplayResult &&\n                (source == 'Decision Desk HQ' ||\n                  source == 'Associated Press') ? (\n                  <span class={checkClass} style={checkStyle}>\n                    {checkmark}\n                  </span>\n                ) : (\n                  ''\n                )}\n                {klaxon}\n              </h4>\n            )}\n            {isCanvass == true &&\n              shouldDisplayResult &&\n              partyBallot.contest_result == 'runoff' && (\n                <h4 class=\"klaxon__text klaxon__runoff\">\n                  Nominee to be decided in May runoff\n                </h4>\n              )}\n            {ManualoverrideSource == '' && isCanvass == false && (\n              <p class={precinctsClass}>\n                {source == 'Texas Secretary of State'\n                  ? `${intcomma(\n                      partyBallot.pollinglocationsreporting\n                    )} of ${intcomma(\n                      partyBallot.total_pollinglocations\n                    )} polling locations reporting (${partyBallot.pollinglocations_reporting_percent.toFixed(\n                      1\n                    )}%)`\n                  : pct_votes_turnout_w_uncontested}{' '}\n                {converter.convert(pct_votes_explain)}\n              </p>\n            )}\n            {\n              (ManualoverrideSource = !'' &&\n                source != 'Texas Secretary of State' &&\n                source != 'Decision Desk HQ' &&\n                source != 'Associated Press' &&\n                isCanvass == false && (\n                  <p class={precinctsClass}>\n                    {`${intcomma(\n                      partyBallot.pollinglocationsreporting\n                    )} of ${intcomma(\n                      partyBallot.total_pollinglocations\n                    )} polling locations reporting (${partyBallot.pollinglocations_reporting_percent.toFixed(\n                      1\n                    )}%)`}\n\n                    {/* <span class=\"source\">{` Source: ${ManualoverrideSource}`}</span> */}\n                  </p>\n                ))\n            }\n          </div>\n\n          <table class=\"race__candidates\">\n            {tableHeader}\n            <tbody>\n              {isShowcaseRace &&\n                candidates.map((candidate: any, idx: any) =>\n                  renderCandidate(\n                    candidate,\n                    idx,\n                    candidatesRender,\n                    viewAllCandidates,\n                    { totalVotes }\n                  )\n                )}\n\n              {!isShowcaseRace &&\n                candidates.map((candidate: any, idx: any) =>\n                  renderCandidate(candidate, idx, viewAllCandidates, {\n                    totalVotes,\n                  })\n                )}\n              {candidates.length > visibleCandidatesCount && (\n                <OtherCandidate\n                  isViewable={!viewAllCandidates}\n                  candidateCount={candidates.length}\n                  embedType={embedType}\n                  onClick={() => {\n                    this.onViewableToggle();\n                  }}\n                  showDelegates={showDelegates}\n                />\n              )}\n            </tbody>\n\n            {candidates.length > visibleCandidatesCount && viewAllCandidates && (\n              <tr class=\"candidate race__candidate-row\">\n                <td\n                  class=\"candidate__cell candidate__party t-align-center\"\n                  onClick={() => {\n                    this.onViewableToggle();\n                  }}\n                >\n                  <svg class=\"icon icon-angle-up\">\n                    <use xlinkHref=\"#icon-angle-up\" />\n                  </svg>\n                </td>\n                <th class=\"candidate__cell candidate__name\">\n                  <button\n                    class={embedType}\n                    onClick={() => {\n                      this.onViewableToggle();\n                    }}\n                  >\n                    Show fewer ({visibleCandidatesCount})\n                  </button>\n                </th>\n                <th class=\"candidate__cell candidate__votes\"> </th>\n                <th class=\"candidate__cell candidate__pct\"></th>\n                {showDelegates && (\n                  <td class=\"candidate__cell candidate__votes\"></td>\n                )}\n              </tr>\n            )}\n          </table>\n\n          {IsNoted == true && (\n            <p class=\"note__text\">{converter.convert(notes[0].value)}</p>\n          )}\n          {IsAnnotations == true && (\n            <div class=\"anno-text notes-annotations\">\n              <span class=\"is-sr-only\">Note:</span>\n              <svg class=\"icon note-icon anno-div\" aria-hidden=\"true\">\n                <use xlinkHref=\"#note-icon\" />\n              </svg>\n\n              <p class=\"annotations t-links-underlined\">\n                <span class=\"font-weight-bold\">Noteworthy: </span>\n                {converter.convert(annotations[0].value)}\n              </p>\n            </div>\n          )}\n          <div class=\"below-races\">\n            <div class=\"source\">{` Source: ${source}`}</div>\n\n            {(isHomepage || embedType == 'internal') && (\n              <div class=\"countdown\">\n                <span class=\"counter-homepage\">LAST UPDATED {asOf}</span>\n              </div>\n            )}\n          </div>\n        </div>\n      </div>\n    );\n  }\n}\n\nSeatPartyDivider.defaultProps = {\n  isShowcaseRace: false,\n  isHomepage: false,\n};\n\nexport default SeatPartyDivider;\n","/**\n * Sums up values of a property across objects in an array.\n *\n * @param {Array} arr An array of objects.\n * @param {String} key The property to sum across objects.\n * @return {Number}\n */\nexport default function sumValues(arr, key) {\n  return arr.reduce((acc, obj) => acc + obj[key], 0);\n}\n","const hOP = Object.prototype.hasOwnProperty;\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x: any, y: any): boolean {\n  // SameValue algorithm\n  if (x === y) {\n    // Steps 1-5, 7-10\n    // Steps 6.b-6.e: +0 != -0\n    // Added the nonzero y check to make Flow happy, but it is redundant\n    return x !== 0 || y !== 0 || 1 / x === 1 / y;\n  }\n  // Step 6.a: NaN == NaN\n  return x !== x && y !== y;\n}\n\n/**\n * Performs equality by iterating through keys on an object and returning false\n * when any key has values which are not strictly equal between the arguments.\n * Returns true when the values of all keys are strictly equal.\n */\nfunction shallowEqual(objA: object, objB: object): boolean {\n  if (is(objA, objB)) {\n    return true;\n  }\n\n  if (\n    typeof objA !== 'object' ||\n    objA === null ||\n    typeof objB !== 'object' ||\n    objB === null\n  ) {\n    return false;\n  }\n\n  const keysA = Object.keys(objA);\n  const keysB = Object.keys(objB);\n\n  if (keysA.length !== keysB.length) {\n    return false;\n  }\n\n  // Test for A's keys different from B.\n  for (let i = 0; i < keysA.length; i++) {\n    if (!hOP.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n      return false;\n    }\n  }\n\n  return true;\n}\n\nexport default shallowEqual;\n","// packages\nimport { Component } from 'preact';\n\n// internal\nimport shallowEqual from '../utils/shallow-equal';\n\nabstract class PureComponent<P = {}, S = {}> extends Component<P, S> {\n  shouldComponentUpdate(props, state) {\n    const check =\n      shallowEqual(props, this.props) && shallowEqual(state, this.state);\n    // if (props.projection)\n    //   console.log(\n    //     'projection check:',\n    //     props.projection === this.props.projection,\n    //     !check\n    //   );\n    return !check;\n  }\n}\n\nexport default PureComponent;\n","/**\n * A white-list of attributes to consider booleans for our purposes. Because\n * iframe attributes like \"sandbox\" actually mean something when they're an\n * empty string, we can't assume that means \"true\" across the board.\n *\n * @private\n * @type {Array}\n */\nconst booleans = ['allowfullscreen'];\n\n/**\n * Searches an element's attributes and returns an Object of all the ones that\n * begin with a specified prefix. Each matching attribute name is returned\n * without the prefix.\n *\n * @private\n * @param  {Element} element\n * @param  {string} prefix\n * @return {object}\n */\nfunction getMatchingAttributes(element, prefix) {\n  // prepare the object to return\n  const attrs = {};\n\n  // grab all the attributes off the element\n  const map = element.attributes;\n\n  // get a count of the number of attributes\n  const length = map.length;\n\n  // get the prefix's length\n  const prefixLength = prefix.length;\n\n  // loop through the attributes\n  for (let i = 0; i < length; i++) {\n    // get each attribute key\n    const key = map[i].name;\n\n    // continue if the key begins with supplied prefix\n    if (key.substr(0, prefixLength) === prefix) {\n      // slice off the prefix to get the bare field key\n      const field = key.slice(prefixLength);\n\n      // grab the value associated with the key\n      let value = map[i].value;\n\n      if (booleans.indexOf(field) > -1) {\n        value = true;\n      }\n\n      // add matching key to object\n      attrs[field] = value;\n    }\n  }\n\n  return attrs;\n}\n\nfunction extend(obj, props) {\n  for (let i in props) obj[i] = props[i];\n  return obj;\n}\n\nexport { extend, getMatchingAttributes };\n","const EMBED_SIZE = 'embed-size';\nconst AMP_SENTINEL = 'amp';\nconst FRAME_PREFIX = 'data-frame-';\nconst FRAME_AUTO_INITIALIZED_ATTRIBUTE = `${FRAME_PREFIX}auto-initialized`;\nconst FRAME_SRC_ATTRIBUTE = `${FRAME_PREFIX}src`;\n\nexport {\n  AMP_SENTINEL,\n  EMBED_SIZE,\n  FRAME_PREFIX,\n  FRAME_AUTO_INITIALIZED_ATTRIBUTE,\n  FRAME_SRC_ATTRIBUTE,\n};\n","import { extend, getMatchingAttributes } from './utils.mjs';\nimport {\n  AMP_SENTINEL,\n  EMBED_SIZE,\n  FRAME_PREFIX,\n  FRAME_AUTO_INITIALIZED_ATTRIBUTE,\n  FRAME_SRC_ATTRIBUTE,\n} from './constants.mjs';\n\n/**\n * The Framer object to be called in the host page. Effectively a wrapper around\n * interactions with an embedded iframe.\n *\n * @param {object} options options used to prepare the iframe\n * @param {Element} options.container the containing DOM element for the iframe\n * @param {string} options.src the URL to set as the `src` of the iframe\n * @param {boolean} [options.allowfullscreen] toggles the `allowfullscreen` attribute\n * @param {string} [options.name] sets the `name` attribute\n * @param {string} [options.referrerpolicy] sets the `referrerpolicy` attribute\n * @param {string} [options.sandbox] sets the `sandbox` attribute\n * @param {string} [options.title] sets the `title` attribute\n */\nclass Framer {\n  constructor({\n    allowfullscreen = false,\n    container,\n    name,\n    referrerpolicy,\n    sandbox = 'allow-scripts',\n    src,\n    title,\n  }) {\n    this.container = container;\n    this.src = src;\n    this.allowfullscreen = allowfullscreen;\n    this.name = name;\n    this.referrerpolicy = referrerpolicy;\n    this.sandbox = sandbox;\n    this.title = title;\n\n    this.processMessage_ = this.processMessage_.bind(this);\n    window.addEventListener('message', this.processMessage_, false);\n\n    this.createIframe_();\n  }\n\n  /**\n   * Removes event listeners and removes the iframe from the container.\n   *\n   * @returns {void}\n   * @example\n   *\n   * const framer = new Framer(...);\n   * // tears down the Framer\n   * framer.remove();\n   */\n  remove() {\n    window.removeEventListener('message', this.processMessage_, false);\n    this.container.removeChild(this.iframe);\n    // important to de-reference the iframe so it can be GC'ed\n    this.iframe = null;\n  }\n\n  /**\n   * Creates the iframe element and sets the source of the iframe.\n   *\n   * @private\n   * @returns {void}\n   */\n  createIframe_() {\n    const iframe = (this.iframe = document.createElement('iframe'));\n\n    iframe.setAttribute('src', this.src);\n    iframe.setAttribute('width', '100%');\n    iframe.setAttribute('scrolling', 'no');\n    iframe.setAttribute('marginheight', '0');\n    iframe.setAttribute('frameborder', '0');\n\n    if (this.allowfullscreen) {\n      iframe.setAttribute('allowfullscreen', '');\n    }\n\n    if (this.name) {\n      iframe.setAttribute('name', name);\n    }\n\n    if (this.referrerpolicy) {\n      iframe.setAttribute('referrerpolicy', this.referrerpolicy);\n    }\n\n    iframe.setAttribute('sandbox', this.sandbox);\n\n    if (this.title) {\n      iframe.setAttribute('title', this.title);\n    }\n\n    this.container.appendChild(iframe);\n  }\n\n  /**\n   * Receives a message from the frame. Checks to make sure it is only listening\n   * to the iframe it created, and that the sentinel value and type matches.\n   *\n   * @private\n   * @param {Event} event\n   * @returns {void}\n   */\n  processMessage_(event) {\n    // this message isn't from our created frame, stop here\n    if (event.source !== this.iframe.contentWindow) return;\n\n    const { data } = event;\n\n    // if the sentinel and type matches, update our height\n    if (data.sentinel === AMP_SENTINEL && data.type === EMBED_SIZE) {\n      this.setIframeHeight_(data.height);\n    }\n  }\n\n  /**\n   * Sets the iframe's height.\n   *\n   * @private\n   * @param {number} height\n   * @returns {void}\n   */\n  setIframeHeight_(height) {\n    this.iframe.setAttribute('height', height);\n  }\n}\n\n/**\n * Automatically initializes any frames that have not already been\n * auto-activated.\n *\n * @returns {Array} An array of all the created Framers\n * @example\n *\n * // sets up all frames that have not been initialized yet\n * autoInitFrames();\n */\nfunction autoInitFrames() {\n  const elements = document.querySelectorAll(\n    `[${FRAME_SRC_ATTRIBUTE}]:not([${FRAME_AUTO_INITIALIZED_ATTRIBUTE}])`\n  );\n\n  const activated = [];\n\n  for (let i = 0; i < elements.length; i++) {\n    const container = elements[i];\n\n    const attributes = getMatchingAttributes(container, FRAME_PREFIX);\n    container.setAttribute(FRAME_AUTO_INITIALIZED_ATTRIBUTE, '');\n\n    activated.push(\n      new Framer(\n        extend(\n          {\n            container,\n          },\n          attributes\n        )\n      )\n    );\n  }\n\n  return activated;\n}\n\nexport { autoInitFrames, Framer };\n","// internal\nimport { AMP_SENTINEL, EMBED_SIZE } from './constants.mjs';\nimport { extend } from './utils.mjs';\n\n/**\n * A wrapper around postMessage to normalize the message body. Automatically\n * includes the AMP sentinel value.\n *\n * @private\n * @param {string} type Type of message being sent\n * @param {Object} [data] Any additional data to send\n * @returns {void}\n */\nfunction sendMessage(type, data = {}) {\n  window.parent.postMessage(\n    extend({ sentinel: AMP_SENTINEL, type }, data),\n    '*'\n  );\n}\n\n/**\n * Gets the height of the current document's body. Uses offsetHeight to ensure\n * that margins are accounted for.\n *\n * @private\n * @returns {number}\n */\nfunction getDocumentHeight() {\n  return document.documentElement.offsetHeight;\n}\n\n/**\n * Sends the current document's height or provided value to the host window\n * using postMessage.\n *\n * @param {number} [height] The height to pass to the host page, is determined automatically if not passed\n * @returns {void}\n * @example\n *\n * // Uses the document's height to tell the host page\n * sendFrameHeight();\n *\n * // Pass a height you've determined in another way\n * sendFrameHeight(500);\n *\n */\nfunction sendFrameHeight(height = getDocumentHeight()) {\n  sendMessage(EMBED_SIZE, { height });\n}\n\n/**\n * Sets up an event listener for the load event that sends the new frame\n * height to the host. Automatically removes itself once fired.\n *\n * @returns {void}\n * @example\n *\n * // once the frame's load event is fired, tell the host page its new height\n * sendHeightOnLoad();\n */\nfunction sendHeightOnLoad() {\n  window.addEventListener('load', function cb() {\n    sendFrameHeight();\n\n    window.removeEventListener('load', cb);\n  });\n}\n\n/**\n * Sets up an event listener for the resize event that sends the new frame\n * height to the host.\n *\n * @returns {void}\n * @example\n *\n * // every time the frame is resized, tell the host page what its new height is\n * sendHeightOnResize();\n */\nfunction sendHeightOnResize() {\n  window.addEventListener('resize', () => sendFrameHeight());\n}\n\n/**\n * Sends height updates to the host page on an interval.\n *\n * @param {number} [delay] How long to set the interval\n * @returns {void}\n * @example\n *\n * // will call sendFrameHeight every 300ms\n * sendHeightOnPoll();\n *\n * // will call sendFrameHeight every 150ms\n * sendHeightOnPoll(150);\n */\nfunction sendHeightOnPoll(delay = 300) {\n  setInterval(sendFrameHeight, delay);\n}\n\n/**\n * A helper for running the standard functions for setting up a frame.\n *\n * Automatically calls an sendFrameHeight, sendHeightOnLoad and sendHeightOnResize.\n *\n * @returns {void}\n * @example\n *\n * initFrame();\n */\nfunction initFrame() {\n  sendFrameHeight();\n  sendHeightOnLoad();\n  sendHeightOnResize();\n}\n\n/**\n * Initializes a frame, then sets up a poll to continue to update on an interval.\n *\n * @param {number} [delay] An optional custom delay to pass to sendHeightOnPoll\n * @returns {void}\n * @example\n *\n * // calls initFrame, then calls sendHeightOnPoll\n * initFrameAndPoll();\n */\nfunction initFrameAndPoll(delay) {\n  initFrame();\n  sendHeightOnPoll(delay);\n}\n\nexport {\n  initFrame,\n  initFrameAndPoll,\n  sendFrameHeight,\n  sendHeightOnLoad,\n  sendHeightOnPoll,\n  sendHeightOnResize,\n};\n","/**\n * A for-loop version of Array.prototype.find so IE and friends can play.\n *\n * @private\n * @param  {Array} arr\n * @param  {Function} predicate\n * @return {*|undefined}\n * @throws {TypeError} Argument predicate must be a function\n */\nexport default function find(\n  arr: Array<any>,\n  predicate: Function\n): any | undefined {\n  if (typeof predicate !== 'function') {\n    throw new TypeError('predicate must be a function');\n  }\n\n  for (let i = 0; i < arr.length; i++) {\n    if (predicate(arr[i], i, arr)) {\n      return arr[i];\n    }\n  }\n\n  return undefined;\n}\n","// packages\nimport cx from 'classnames';\nimport { capfirst } from 'journalize';\nimport memoize from 'lodash/memoize';\nimport { h } from 'preact';\n\ntype Props = {\n  excludeInitial?: boolean;\n  party: string;\n  style: string;\n};\n\nfunction PartyPill({ excludeInitial, party, style }: Props) {\n  const partyPrefix = party.slice(0, 3).toLowerCase();\n  const partyInitial = party[0].toUpperCase();\n\n  const classes = cx('circle-pill', `pill--${partyPrefix}`);\n\n  return (\n    <span class={classes} style={style} title={capfirst(party)}>\n      {!excludeInitial && partyInitial}\n    </span>\n  );\n}\n\nPartyPill.defaultProps = {\n  excludeInitial: false,\n};\n\nexport default memoize(PartyPill, ({ party, style }) => ({\n  party: party,\n  style: style,\n}));\n"],"sourceRoot":""}