{"version":3,"sources":["webpack:///../src/apmonth.js","webpack:///../src/apdate.js","webpack:///../src/apmonthtab.js","webpack:///../src/apdatetab.js","webpack:///../src/utils.js","webpack:///../src/apnumber.js","webpack:///../src/aptime.js","webpack:///../src/capfirst.js","webpack:///../src/intcomma.js","webpack:///../src/intword.js","webpack:///../src/ordinalsuffix.js","webpack:///../src/ordinal.js","webpack:///../src/pluralize.js","webpack:///../src/widont.js","webpack:///../src/yesno.js","webpack:///./app/scripts/utils/utils.js","webpack:///./app/scripts/components/PartyBarChart.js","webpack:///./app/scripts/packs/party-comparison-main.js","webpack:///./config/modern-polyfills.js","webpack:///../src/utils.mjs","webpack:///../src/constants.mjs","webpack:///../src/framer.mjs","webpack:///../src/frames.mjs","webpack:///../src/vnode.js","webpack:///../src/options.js","webpack:///../src/h.js","webpack:///../src/util.js","webpack:///../src/clone-element.js","webpack:///../src/constants.js","webpack:///../src/render-queue.js","webpack:///../src/vdom/index.js","webpack:///../src/dom/index.js","webpack:///../src/vdom/diff.js","webpack:///../src/vdom/component.js","webpack:///../src/vdom/component-recycler.js","webpack:///../src/component.js","webpack:///../src/render.js","webpack:///../src/preact.js"],"names":["0","1","2","3","4","5","6","7","8","9","10","11","n","Date","t","getMonth","r","getDate","getFullYear","e","i","o","u","a","isFinite","l","Math","floor","f","v","toString","h","getHours","getMinutes","c","String","charAt","toUpperCase","slice","g","split","replace","join","d","s","abs","ceil","log","LN10","pow","round","p","M","S","indexOf","D","w","y","Array","isArray","length","Number","b","RegExp","m","A","arguments","titleCase","require","str","toLowerCase","map","word","formatNumberWithCommas","num","format","formatNumberAnnotation","ft","includes","formatNumberPct","concat","formatCountiesTitle","county","exceptions","upper","title","find","formatYAxisTicks","formatted","Component","COLORS","republican","democratic","didnotvote","CATEGORIES","PartyBarChart","constructor","super","this","state","drawChart","bind","redrawChart","yearData","statewideMax","props","container","select","year","node","width","clientWidth","margin","chartWidth","height","xScale","scaleBand","domain","range","padding","yScale","scaleLinear","svg","append","attr","call","axisLeft","tickValues","tickSize","tickFormat","grouped","cat","category","value","selectAll","data","enter","bandwidth","text","registered_voters","labelG","forEach","cx","style","dvX","dvG","remove","componentDidMount","window","addEventListener","componentDidUpdate","prevProps","render","totalPct","class","label","toFixed","partiesData","id","document","getElementById","initFrameAndPoll","allowfullscreen","name","referrerpolicy","sandbox","src","documentElement","offsetHeight","parent","postMessage","sentinel","type","removeEventListener","setInterval","prototype","removeChild","iframe","createElement","setAttribute","appendChild","source","contentWindow","VNode","options","stack","EMPTY_CHILDREN","nodeName","attributes","lastSimple","child","simple","children","push","pop","undefined","key","vnode","extend","obj","applyRef","ref","current","defer","Promise","resolve","then","setTimeout","cloneElement","IS_NON_DIMENSIONAL","items","enqueueRender","component","debounceRendering","rerender","_componentConstructor","isNamedNode","normalizedNodeName","getNodeProps","defaultProps","parentNode","setAccessor","old","isSvg","cssText","test","innerHTML","__html","eventProxy","useCapture","_listeners","removeAttribute","ns","removeAttributeNS","setAttributeNS","className","mounts","hydrating","shift","diff","dom","context","mountAll","componentRoot","isSvgMode","ownerSVGElement","diffLevel","flushMounts","ret","out","splitText","_component","createTextNode","replaceChild","isDirectOwner","isOwner","_parentComponent","base","originalComponent","oldDom","nextBase","vnodeName","createElementNS","firstChild","vchildren","fc","nextSibling","nodeValue","isHydrating","vchild","len","_child","originalChildren","vlen","__key","trim","keyedLen","min","childrenLen","j","idiff","keyed","recollectNodeTree","dangerouslySetInnerHTML","attrs","prevSvgMode","unmountOnly","removeChildren","previousSibling","recyclerComponents","inst","doRender","Ctor","splice","componentWillMount","componentWillReceiveProps","renderMode","syncComponentUpdates","__ref","renderComponent","isChild","rendered","cbase","prevState","initialBase","isUpdate","skip","snapshot","previousContext","getDerivedStateFromProps","previousProps","previousState","componentWillUpdate","prevContext","_dirty","getChildContext","getSnapshotBeforeUpdate","childProps","createComponent","childComponent","initialChildComponent","toUnmount","componentRef","_renderCallbacks","beforeUnmount","componentWillUnmount","inner","merge","createRef","callback","preact"],"mappings":"stBAOyB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zBOxJ,cAAgBnJ,E,aACViL,E,wBCbbxD,OAASA,E,SACR8D,E,WAGcoH,c","file":"party-comparison-main.b19502a637.mjs","sourcesContent":["/**\n * Map of AP month abbreviations. Note that they are zero-indexed due to\n * JavaScript's life choices. Exported for testing purposes.\n *\n * @private\n * @type {object}\n */\nexport const AP_MONTHS = {\n  0: 'Jan.',\n  1: 'Feb.',\n  2: 'March',\n  3: 'April',\n  4: 'May',\n  5: 'June',\n  6: 'July',\n  7: 'Aug.',\n  8: 'Sept.',\n  9: 'Oct.',\n  10: 'Nov.',\n  11: 'Dec.',\n};\n\n/**\n * Returns an AP-formatted month string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apmonth(new Date(2016, 10, 8));\n * // returns 'Nov.'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apmonth();\n * // returns 'July' (pretend it is actually July)\n */\nexport default function apmonth(date = new Date()) {\n  return AP_MONTHS[date.getMonth()];\n}\n","import apmonth from './apmonth';\n\n/**\n * Returns an AP-formatted date string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apdate(new Date(2016, 10, 8));\n * // returns 'Nov. 8, 2016'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apdate();\n * // returns 'July 4, 2016' (pretend it is actually July 4, 2016)\n */\nexport default function apdate(date = new Date()) {\n  const month = apmonth(date);\n  const dayOfMonth = date.getDate();\n  const year = date.getFullYear();\n\n  return `${month} ${dayOfMonth}, ${year}`;\n}\n","/**\n * Map of AP month abbreviations. Note that they are zero-indexed due to\n * JavaScript's life choices. Exported for testing purposes.\n *\n * @private\n * @type {object}\n */\nexport const AP_MONTHS_TAB = {\n  0: 'Jan',\n  1: 'Feb',\n  2: 'Mar',\n  3: 'Apr',\n  4: 'May',\n  5: 'Jun',\n  6: 'Jul',\n  7: 'Aug',\n  8: 'Sep',\n  9: 'Oct',\n  10: 'Nov',\n  11: 'Dec',\n};\n\n/**\n * Returns a tabular AP-formatted month string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apmonth(new Date(2016, 10, 8));\n * // returns 'Nov'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apmonth();\n * // returns 'Jul' (pretend it is actually July)\n */\nexport default function apmonthtab(date = new Date()) {\n  return AP_MONTHS_TAB[date.getMonth()];\n}\n","import apmonthtab from './apmonthtab';\n\n/**\n * Returns a tabular AP-formatted date string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Remember that JavaScript zero-indexes months!\n * journalize.apdate(new Date(2016, 10, 8));\n * // returns 'Nov 8, 2016'\n *\n * // Uses the current date if no parameter is passed\n * journalize.apdate();\n * // returns 'Jul 4, 2016' (pretend it is actually July 4, 2016)\n */\nexport default function apdatetab(date = new Date()) {\n  const month = apmonthtab(date);\n  const dayOfMonth = date.getDate();\n  const year = date.getFullYear();\n\n  return `${month} ${dayOfMonth}, ${year}`;\n}\n","/**\n * Returns true if `value` is null or undefined;\n *\n * @private\n * @param  {*}  value\n * @return {boolean}\n */\nexport function isNil(value) {\n  return value == null;\n}\n\n/**\n * Returns true if `value` is a finite number.\n *\n * Based on: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isFinite\n *\n * @private\n * @param  {*}  value\n * @return {boolean}\n */\nexport function _isFinite(value) {\n  return typeof value === 'number' && isFinite(value);\n}\n\n/**\n * Returns true if `value` is an integer.\n *\n * Based on: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isInteger\n *\n * @private\n * @param  {*}  value\n * @return {boolean}\n */\nexport function isInteger(value) {\n  return _isFinite(value) && Math.floor(value) === value;\n}\n","import { isInteger, isNil } from './utils';\n\n/**\n * List of spelled out numbers per AP style.\n * @private\n * @type {string[]}\n */\nconst AP_NUMBERS = [\n  'one',\n  'two',\n  'three',\n  'four',\n  'five',\n  'six',\n  'seven',\n  'eight',\n  'nine',\n];\n\n/**\n * Converts an integer to string representation per AP style rules. If an\n * integer is not one that would be converted, it is returned in its original\n * form.\n *\n * If a non-integer is given, it will be returned in its original form as\n * well.\n *\n * @param  {number|string} val\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.apnumber(8);\n * // returns 'eight'\n *\n * journalize.apnumber(42);\n * // returns 42\n *\n */\nexport default function apnumber(val) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // convert `val` to a number\n  const convertedVal = +val;\n\n  // if `convertedVal` is not an integer, return `val` coerced to a string\n  if (!isInteger(convertedVal)) return val.toString();\n\n  // if `convertedVal` is not between 0 and 10, return `val` coerced to a string\n  if (convertedVal <= 0 || convertedVal >= 10) return val.toString();\n\n  return AP_NUMBERS[convertedVal - 1];\n}\n","/**\n * Returns an AP-formatted time string that corresponds with the supplied\n * Date. If an `input` is not passed, it will use the result of `new Date();`.\n *\n * @param  {Date} [date] JavaScript Date object, defaults to current date if\n *                       not passed\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // Bright and early\n * journalize.aptime(new Date(2016, 10, 8, 6, 30));\n * // returns '6:30 a.m.'\n *\n * // It can handle `p.m.` too\n * journalize.aptime(new Date(2016, 10, 8, 16, 30));\n * // returns '4:30 p.m.'\n *\n * // Uses the current time if no parameter is passed\n * journalize.aptime();\n * // returns '6:45 p.m.' (pretend it is actually 6:45 p.m. right now)\n */\nexport default function aptime(date = new Date()) {\n  const hours = date.getHours();\n  const minutes = date.getMinutes();\n\n  const minutesAreZero = minutes === 0;\n\n  if (minutesAreZero) {\n    if (hours === 0) return 'midnight';\n    if (hours === 12) return 'noon';\n  }\n\n  let period, hour;\n\n  if (hours < 12) {\n    period = 'a.m.';\n    // account for how Date() returns 12 a.m. as 0\n    if (hours > 0) {\n      hour = hours;\n    } else {\n      hour = 12;\n    }\n  } else {\n    period = 'p.m.';\n\n    if (hours === 12) {\n      hour = hours;\n    } else {\n      hour = hours - 12;\n    }\n  }\n\n  if (minutesAreZero) {\n    return hour + ' ' + period;\n  }\n\n  const minute = minutes < 10 ? '0' + minutes : minutes;\n  return hour + ':' + minute + ' ' + period;\n}\n","import { isNil } from './utils';\n\n/**\n * Capitalizes the first character of a value and returns it.\n *\n * @param {any} val\n * @returns {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.capfirst('hello world');\n * // returns 'Hello world'\n */\nexport default function capfirst(val) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // coerce value to a String\n  const str = String(val);\n\n  return `${str.charAt(0).toUpperCase()}${str.slice(1)}`;\n}\n","import { _isFinite, isNil } from './utils';\n\n/**\n * Converts a number to include commas, if necessary.\n *\n * Source: http://stackoverflow.com/a/2901298\n *\n * @private\n * @param  {number|string} n\n * @return {string}\n */\nfunction numberWithCommas(n) {\n  const parts = n.toString().split('.');\n  parts[0] = parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, ',');\n  return parts.join('.');\n}\n\n/**\n * Alters a string or number to include commas. If `val` is undefined or null,\n * an empty string is returned.\n *\n * @param  {number|string} val\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.intcomma(10311);\n * // returns '10,311'\n *\n * journalize.intcomma('1234567.1234567');\n * // returns '1,234,567.1234567'\n */\nexport default function intcomma(val) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  const convertedVal = +val;\n\n  // if `convertedVal` is not a number, don't waste time converting it\n  if (!_isFinite(convertedVal)) return val.toString();\n\n  return numberWithCommas(convertedVal);\n}\n","import { isInteger, isNil } from './utils';\n\n/**\n * Array of suffixes to be used by intword.\n * @private\n * @type {string[]}\n */\nconst SUFFIXES = [\n  'million',\n  'billion',\n  'trillion',\n  'quadrillion',\n  'quintillion',\n  'sextillion',\n  'septillion',\n  'octillion',\n  'nonillion',\n  'decillion',\n];\n\n/**\n * Returns the number of digits found in a number. Accounts for exponents, too.\n *\n * @private\n * @param  {number} n\n * @return {number}\n */\nfunction getLengthOfNumber(n) {\n  return Math.ceil(Math.log(n + 1) / Math.LN10);\n}\n\n/**\n * Converts a large integer into a string representation. Only makes sense for\n * numbers at least 1 million or more.\n *\n * @param  {number|string} val\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.intword(1000000);\n * // returns '1 million'\n *\n * journalize.intword(6500000000000);\n * // returns '6.5 trillion'\n */\nexport default function intword(val) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  const convertedVal = +val;\n\n  // if `convertedVal` is not an integer, return `val`\n  if (!isInteger(convertedVal)) return val.toString();\n\n  // get the absolute value to de-sign it\n  const absConvertedVal = Math.abs(convertedVal);\n\n  // if `convertedVal` is less than 1 million, no conversion is needed\n  if (absConvertedVal < 1000000) return val.toString();\n\n  // get the number of digits in the number, and substract remainder to get\n  // exponent value\n  const numDigits = getLengthOfNumber(absConvertedVal) - 1;\n  const exponent = numDigits - (numDigits % 3);\n\n  // calculate the rounded version of `convertedVal`\n  let newVal = convertedVal / Math.pow(10, exponent);\n  newVal = Math.round(newVal * 10) / 10;\n\n  return newVal + ' ' + SUFFIXES[Math.floor(exponent / 3) - 2];\n}\n","import { isInteger, isNil } from './utils.js';\n\n/**\n * A list of suffixes for conversions.\n * @private\n * @type {string[]}\n */\nconst SUFFIXES = ['th', 'st', 'nd', 'rd', 'th', 'th', 'th', 'th', 'th', 'th'];\n\n/**\n * A list of funky English ordinals.\n * @private\n * @type {number[]}\n */\nconst ENGLISH_ORDINAL_EXCEPTIONS = [11, 12, 13];\n\n/**\n * Determines the ordinal suffix for a given integer. Handles the special\n * cases of 11, 12 and 13. If a non-integer is submitted an empty string will\n * be returned.\n *\n * @param  {number|string} val\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.ordinalsuffix(5);\n * // returns 'th'\n *\n * journalize.ordinalsuffix(13);\n * // returns 'th'\n *\n * journalize.ordinalsuffix(103);\n * // returns 'rd'\n *\n * journalize.ordinalsuffix(7);\n * // returns 'th'\n *\n * journalize.ordinalsuffix('foo');\n * // returns ''\n */\nexport default function ordinalsuffix(val) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // ensure `val` is a number\n  const convertedVal = +val;\n\n  // if `convertedVal` is not an integer, return an empty string\n  if (!isInteger(convertedVal)) return '';\n\n  // if `convertedVal` is 11, 12 or 13, English gets weird\n  if (ENGLISH_ORDINAL_EXCEPTIONS.indexOf(convertedVal % 100) > -1) {\n    return SUFFIXES[0];\n  }\n\n  // return the appropriate suffix\n  return SUFFIXES[convertedVal % 10];\n}\n","import { isInteger, isNil } from './utils';\nimport ordinalsuffix from './ordinalsuffix';\n\n/**\n * List of spelled out ordinals per AP style.\n * @private\n * @type {string[]}\n */\nconst AP_ORDINALS = [\n  'first',\n  'second',\n  'third',\n  'fourth',\n  'fifth',\n  'sixth',\n  'seventh',\n  'eighth',\n  'ninth',\n];\n\n/**\n * Converts an integer into its ordinal form. If `spellOutOrdinals` is `true`,\n * 1 through 9 will be spelled out per AP style. Handles the special cases of\n * 11, 12 and 13, too. If a non-integer is submitted it will be returned in\n * its original form.\n *\n * @param  {number|string} val\n * @param {boolean} [spellOutOrdinals]\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.ordinal(5);\n * // returns '5th'\n *\n * journalize.ordinal(13);\n * // returns '13th'\n *\n * journalize.ordinal(103);\n * // returns '103rd'\n *\n * journalize.ordinal(7, true);\n * // returns 'seventh'\n */\nexport default function ordinal(val, spellOutOrdinals = false) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // ensure `val` is a number\n  const convertedVal = +val;\n\n  // if `convertedVal` is not an integer, return `val`\n  if (!isInteger(convertedVal)) return val.toString();\n\n  // if `spellOutOrdinals` is true, return the spelled out versions of 1-9\n  if (spellOutOrdinals && convertedVal < 10) {\n    return AP_ORDINALS[convertedVal - 1];\n  }\n\n  // get the suffix\n  const suffix = ordinalsuffix(convertedVal);\n\n  // return the original value with the suffix\n  return convertedVal + suffix;\n}\n","/**\n * Returns a plural suffix if the value is not 1. By default, `pluralize`\n * uses \"s\" as the suffix. If a `String` is provided, `pluralize` will attempt\n * to convert it into a `Number`. If an `Array` is provided instead of a\n * number, the length of the `Array` is used to determine the suffix. An\n * alternative plural suffix can be provided as the second parameter, and if\n * necessary, an alternative singular suffix can be provided as the third.\n *\n * @param {number|string|array} value\n * @param {string} [pluralSuffix='s']\n * @param {string} [singularSuffix='']\n * @return {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * // typical usage\n * 'vote' + journalize.pluralize(0); // votes\n * 'vote' + journalize.pluralize(1); // vote\n * 'vote' + journalize.pluralize(2); // votes\n *\n * // the plural suffix may be changed\n * 'class' + journalize.pluralize(0, 'es'); // classes\n * 'class' + journalize.pluralize(1, 'es'); // class\n * 'class' + journalize.pluralize(2, 'es'); // classes\n *\n * // some words also need a custom singular suffix\n * 'cand' + journalize.pluralize(0, 'ies', 'y'); // candies\n * 'cand' + journalize.pluralize(1, 'ies', 'y'); // candy\n * 'cand' + journalize.pluralize(2, 'ies', 'y'); // candies\n */\nexport default function pluralize(\n  value,\n  pluralSuffix = 's',\n  singularSuffix = ''\n) {\n  // if this is an array, base the return value on the length\n  if (Array.isArray(value)) {\n    if (value.length !== 1) {\n      return pluralSuffix;\n    } else {\n      return singularSuffix;\n    }\n  }\n\n  // otherwise we have a string or number - convert it and test if its 1\n  if (Number(value) !== 1) {\n    return pluralSuffix;\n  }\n\n  return singularSuffix;\n}\n","import { isNil } from './utils';\n\n/**\n * The non-breaking space character added to the string passed to widont.\n * Exported for testing purposes.\n *\n * @private\n * @type {string}\n */\nexport const nbsp = '\\xA0';\n\n/**\n * The regular expression to find the final space in a string for widont.\n *\n * @private\n * @type {RegExp}\n */\nconst widontRegex = new RegExp(/\\s+([^\\s]*)\\s*$/);\n\n/**\n * Prevents \"widows\" - a word by itself on a line - from appearing in strings\n * by replacing the space between the last two words with a non-breaking space\n * character.\n *\n * @param {string} val\n * @param {string} [replaceChar='\\xA0'] The character to replace the space with\n * @returns {string}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.widont('this is a string');\n * // returns 'this is a&nbsp;string'\n *\n * journalize.widont('this is a string', 'HELLO');\n * // returns 'this is aHELLOstring'\n *\n */\nexport default function widont(val, replaceChar = nbsp) {\n  // if `val` is undefined or null, return an empty string\n  if (isNil(val)) return '';\n\n  // coerce value to a String\n  const str = String(val);\n\n  return str.replace(widontRegex, `${replaceChar}$1`);\n}\n","import { isNil } from './utils';\n\n/**\n * Given a mapping of arguments for `true`, `false`, and (optionally)\n * `null`/`undefined`, return a string according to the value. If `maybe` is not\n * provided, a `null` or `undefined` value will return the `no` argument.\n *\n * @param {boolean|Null|undefined} val\n * @param {string} [yes='yes']\n * @param {string} [no='no']\n * @param {string} [maybe='maybe']\n * @returns {string|boolean|Null|undefined}\n * @example\n *\n * var journalize = require('journalize');\n *\n * journalize.yesno(true);\n * // returns 'yes'\n * journalize.yesno(false);\n * // returns 'no'\n * journalize.yesno(null);\n * // returns 'maybe'\n *\n * journalize.yesno(true, 'yay', 'nay', 'shruggie');\n * // returns 'yay'\n * journalize.yesno(false, 'yay', 'nay', 'shruggie');\n * // returns 'nay'\n * journalize.yesno(null, 'yay', 'nay', 'shruggie');\n * // returns 'shruggie'\n */\nexport default function yesno(val, yes = 'yes', no = 'no', maybe = 'maybe') {\n  const numberOfArguments = arguments.length;\n\n  // if the user only passes the value and a `yes` argument that's too\n  // ambiguous, so we give up\n  if (numberOfArguments === 2) return val;\n  // if the user passes the value, a `yes` and a `no` argument, don't assume\n  // the default `maybe` is what they want and use `no` instead\n  if (numberOfArguments === 3) maybe = no;\n\n  // if null or undefined, use `maybe`\n  if (isNil(val)) return maybe;\n\n  // if true, use `yes`\n  if (val) {\n    return yes;\n  }\n\n  // otherwise, must be `no`\n  return no;\n}\n","// Packages\nconst journalize = require('journalize');\nimport { timeFormat, format, precisionPrefix, formatPrefix, precisionFixed } from 'd3';\n\nconst titleCase = str => {\n  return str.toLowerCase().split(' ').map(word => {\n    return (word.charAt(0).toUpperCase() + word.slice(1));\n  }).join(' ');\n}\n\nexport const formatDate = date => {\n  let month = journalize.apmonth(date);\n  let day = timeFormat(\"%e\")(date);\n  return `${month} ${day}`;\n}\n\nexport const formatNumberWithCommas = num => {\n  return format(',')(num);\n}\n\nexport const formatNumberPrefix = num => {\n  // const p = precisionPrefix(1e5, 1.3e6);\n  // const f = formatPrefix(\".\" + p, 1.3e6);\n  const f = format('.2s');\n  return f(num);\n}\n\nexport const formatNumberAnnotation = num => {\n  const f = format('.3s');\n  const ft = format(\",\");\n  let formatted;\n  if(f(num).includes(\"M\")) {\n    formatted = f(num).replace(\"M\", \" million\");\n    return formatted;\n  } \n  // else if(f(num).includes(\"k\")) {\n  //   formatted = f(num).replace(\"k\", \" thousand\")\n  // }\n  return ft(num);\n}\n\nexport const formatNumberPrefixWithoutUnit = num => {\n  const f = format('.2s');\n  let formatted;\n  if(f(num).includes(\"M\")) {\n    formatted = f(num).replace(\"M\", \"\");\n  } else if(f(num).includes(\"k\")) {\n    formatted = f(num).replace(\"k\", \"\")\n  }\n  return formatted;\n}\n\nexport const formatNumberPct = num => {\n  const p = format(\",.1f\");\n  return `${p(num)}%`;\n}\n\nexport const formatCounties = county => {\n  const exceptions = [\n    {upper: \"MCMULLEN\", title: \"McMullen\"},\n    {upper: \"MCLENNAN\", title: \"McLennan\"},\n    {upper: \"MCCULLOCH\", title: \"McCulloch\"},\n    {upper: \"DEWITT\", title: \"DeWitt\"},\n  ]\n  if(exceptions.map(e => e.upper).includes(county)) {\n    return `${exceptions.find(e => e.upper == county).title} County`;\n  } else if(county == \"TOTAL\") {\n    return 'Texas';\n  } else {\n    return `${titleCase(county)} County`\n  }\n}\n\nexport const formatCountiesTitle = county => {\n  const exceptions = [\n    {upper: \"MCMULLEN\", title: \"McMullen\"},\n    {upper: \"MCLENNAN\", title: \"McLennan\"},\n    {upper: \"MCCULLOCH\", title: \"McCulloch\"},\n    {upper: \"DEWITT\", title: \"DeWitt\"},\n  ]\n  if(exceptions.map(e => e.upper).includes(county)) {\n    return `${exceptions.find(e => e.upper == county).title} County`;\n  } else if(county == \"TOTAL\") {\n    return 'Texas';\n  } else {\n    return `${titleCase(county)} County`\n  }\n}\n\nexport const formatCountiesShort = county => {\n  const exceptions = [\n    {upper: \"MCMULLEN\", title: \"McMullen\"},\n    {upper: \"MCLENNAN\", title: \"McLennan\"},\n    {upper: \"MCCULLOCH\", title: \"McCulloch\"},\n    {upper: \"DEWITT\", title: \"DeWitt\"},\n  ]\n  if(exceptions.map(e => e.upper).includes(county)) {\n    return exceptions.find(e => e.upper == county).title;\n  } else if(county == \"TOTAL\") {\n    return 'Texas';\n  } else {\n    return `${titleCase(county)}`\n  }\n}\n\nexport const formatYAxisTicks = num => {\n  if (num >= 1000000 && num % 1000000 === 0) {\n    return `${num / 1000000}M`;\n  }\n\n  const f = format('.2s');\n  let formatted = f(num);\n\n  if (formatted.includes('.0')) {\n    formatted = formatted.replace('.0', '');\n  }\n\n  if (formatted.includes('k')) {\n    formatted = formatted.replace('k', 'K');\n  }\n\n  return formatted;\n}\n","// packages\nconst { h, Component } = require('preact');\nimport { select, scaleBand, scaleLinear, axisLeft } from 'd3';\nimport { formatNumberPct, formatYAxisTicks } from '../utils/utils';\n\nconst COLORS = {\n  republican: '#f2593b',\n  democratic: '#1755c5',\n  didnotvote: '#99a0af',\n};\n\nconst CATEGORIES = ['republican', 'democratic', 'didnotvote'];\n\nclass PartyBarChart extends Component {\n  constructor() {\n    super();\n    this.state = {};\n    this.drawChart = this.drawChart.bind(this);\n    this.redrawChart = this.redrawChart.bind(this);\n  }\n\n  drawChart() {\n    const { yearData, statewideMax } = this.props;\n    const container = select(`.party-bar-container-${yearData.year}`);\n    if (!container.node()) return;\n\n    const width = container.node().clientWidth;\n    const margin = { t: 25, r: 10, b: 65, l: 40 };\n    const chartWidth = width - margin.l - margin.r;\n    const chartHeight = 220;\n    const height = chartHeight + margin.t + margin.b;\n\n    const xScale = scaleBand()\n      .domain(CATEGORIES)\n      .range([0, chartWidth])\n      .padding(0.3);\n\n    const yScale = scaleLinear()\n      .domain([0, statewideMax])\n      .range([chartHeight, 0]);\n\n    const svg = select(`.party-bar-container-${yearData.year}`)\n      .append('svg')\n      .attr('width', width)\n      .attr('height', height)\n      .append('g')\n      .attr('transform', `translate(${margin.l},${margin.t})`);\n\n    // y-axis\n    svg.append('g')\n      .attr('class', 'axis axis--y')\n      .call(\n        axisLeft(yScale)\n          .tickValues([0, 5000000, 10000000, 15000000])\n          .tickSize(-chartWidth)\n          .tickFormat(d => formatYAxisTicks(d))\n      );\n\n    // bars\n    const grouped = CATEGORIES.map(cat => ({ category: cat, value: +yearData[cat] }));\n\n    svg.selectAll('.party-bar')\n      .data(grouped)\n      .enter()\n      .append('rect')\n      .attr('class', 'party-bar')\n      .attr('x', d => xScale(d.category))\n      .attr('y', d => yScale(d.value))\n      .attr('width', xScale.bandwidth())\n      .attr('height', d => chartHeight - yScale(d.value))\n      .attr('fill', d => COLORS[d.category]);\n\n    // percentage labels above bars\n    svg.selectAll('.pct-label')\n      .data(grouped)\n      .enter()\n      .append('text')\n      .attr('class', 'pct-label')\n      .attr('x', d => xScale(d.category) + xScale.bandwidth() / 2)\n      .attr('y', d => yScale(d.value) - 12)\n      .attr('text-anchor', 'middle')\n      .text(d => formatNumberPct(d.value / yearData.registered_voters * 100));\n\n    // party labels below x-axis\n    const labelG = svg.append('g').attr('transform', `translate(0,${chartHeight})`);\n\n    ['republican', 'democratic'].forEach(cat => {\n      const cx = xScale(cat) + xScale.bandwidth() / 2;\n      const g = labelG.append('g').attr('transform', `translate(${cx},20)`);\n      g.append('circle')\n        .attr('r', 10)\n        .attr('fill', COLORS[cat]);\n      g.append('text')\n        .attr('text-anchor', 'middle')\n        .attr('dy', 4)\n        .attr('fill', 'white')\n        .style('font-weight', 'bold')\n        .style('font-size', '11px')\n        .text(cat[0].toUpperCase());\n    });\n\n    const dvX = xScale('didnotvote') + xScale.bandwidth() / 2;\n    const dvG = labelG.append('g').attr('transform', `translate(${dvX},20)`);\n    dvG.append('text')\n      .attr('text-anchor', 'middle')\n      .attr('dy', 0)\n      .attr('fill', '#99a0af')\n      .style('font-size', '12px')\n      .text('Did not');\n    dvG.append('text')\n      .attr('text-anchor', 'middle')\n      .attr('dy', 14)\n      .attr('fill', '#99a0af')\n      .style('font-size', '12px')\n      .text('vote');\n  }\n\n  redrawChart() {\n    select(`.party-bar-container-${this.props.yearData.year}`)\n      .select('svg')\n      .remove();\n    this.drawChart();\n  }\n\n  componentDidMount() {\n    this.drawChart();\n    window.addEventListener('resize', () => this.redrawChart());\n  }\n\n  componentDidUpdate(prevProps) {\n    if (prevProps.yearData !== this.props.yearData) {\n      this.redrawChart();\n    }\n  }\n\n  render() {\n    const { yearData } = this.props;\n    const totalPct = formatNumberPct(\n      (yearData.republican + yearData.democratic) / yearData.registered_voters * 100\n    );\n    return (\n      <div class=\"party-chart-wrapper\">\n        <div class=\"party-chart-header\">\n          <p class=\"party-chart-label\">{yearData.label} primary</p>\n          <h2 class=\"party-chart-year\">{yearData.year}</h2>\n          <p class=\"party-chart-total\">{totalPct} of {(yearData.registered_voters / 1e6).toFixed(1)}M registered voters</p>\n        </div>\n        <div class={`party-bar-container-${yearData.year}`}></div>\n      </div>\n    );\n  }\n}\n\nexport default PartyBarChart;\n","import { h, render } from 'preact';\nimport { initFrameAndPoll } from '@newswire/frames';\n\nimport data from '../../../data/data.json';\nimport PartyBarChart from '../components/PartyBarChart';\n\nconst partiesData = data['parties'];\nconst statewideMax = 15000000;\n\nrender(\n  <div id=\"party-charts-container\" class=\"three-column\">\n    <PartyBarChart\n      yearData={partiesData.find(d => d.year === 2018)}\n      statewideMax={statewideMax}\n    />\n    <PartyBarChart\n      yearData={partiesData.find(d => d.year === 2022)}\n      statewideMax={statewideMax}\n    />\n    <PartyBarChart\n      yearData={partiesData.find(d => d.year === 2026)}\n      statewideMax={statewideMax}\n    />\n  </div>,\n  document.getElementById('party-comparison')\n);\n\ninitFrameAndPoll(200);\n\nif (process.env.NODE_ENV === 'development') {\n  require('preact/debug');\n}\n","'use strict';\n\n// We depend on intersection-observer enough that it should just be assumed as necessary\nrequire('intersection-observer');\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 * Virtual DOM Node\n * @typedef VNode\n * @property {string | function} nodeName The string of the DOM node to create or Component constructor to render\n * @property {Array<VNode | string>} children The children of node\n * @property {string | number | undefined} key The key used to identify this VNode in a list\n * @property {object} attributes The properties of this VNode\n */\nexport const VNode = function VNode() {};\n","/**\n * @typedef {import('./component').Component} Component\n * @typedef {import('./vnode').VNode} VNode\n */\n\n/**\n * Global options\n * @public\n * @typedef Options\n * @property {boolean} [syncComponentUpdates] If `true`, `prop` changes trigger synchronous component updates. Defaults to true.\n * @property {(vnode: VNode) => void} [vnode] Processes all created VNodes.\n * @property {(component: Component) => void} [afterMount] Hook invoked after a component is mounted.\n * @property {(component: Component) => void} [afterUpdate] Hook invoked after the DOM is updated with a component's latest render.\n * @property {(component: Component) => void} [beforeUnmount] Hook invoked immediately before a component is unmounted.\n * @property {(rerender: function) => void} [debounceRendering] Hook invoked whenever a rerender is requested. Can be used to debounce rerenders.\n * @property {(event: Event) => Event | void} [event] Hook invoked before any Preact event listeners. The return value (if any) replaces the native browser event given to event listeners\n */\n\n/** @type {Options}  */\nconst options = {};\n\nexport default options;\n","import { VNode } from './vnode';\nimport options from './options';\n\n\nconst stack = [];\n\nconst EMPTY_CHILDREN = [];\n\n/**\n * JSX/hyperscript reviver.\n * @see http://jasonformat.com/wtf-is-jsx\n * Benchmarks: https://esbench.com/bench/57ee8f8e330ab09900a1a1a0\n *\n * Note: this is exported as both `h()` and `createElement()` for compatibility\n * reasons.\n *\n * Creates a VNode (virtual DOM element). A tree of VNodes can be used as a\n * lightweight representation of the structure of a DOM tree. This structure can\n * be realized by recursively comparing it against the current _actual_ DOM\n * structure, and applying only the differences.\n *\n * `h()`/`createElement()` accepts an element name, a list of attributes/props,\n * and optionally children to append to the element.\n *\n * @example The following DOM tree\n *\n * `<div id=\"foo\" name=\"bar\">Hello!</div>`\n *\n * can be constructed using this function as:\n *\n * `h('div', { id: 'foo', name : 'bar' }, 'Hello!');`\n *\n * @param {string | function} nodeName An element name. Ex: `div`, `a`, `span`, etc.\n * @param {object | null} attributes Any attributes/props to set on the created element.\n * @param {VNode[]} [rest] Additional arguments are taken to be children to\n *  append. Can be infinitely nested Arrays.\n *\n * @public\n */\nexport function h(nodeName, attributes) {\n\tlet children=EMPTY_CHILDREN, lastSimple, child, simple, i;\n\tfor (i=arguments.length; i-- > 2; ) {\n\t\tstack.push(arguments[i]);\n\t}\n\tif (attributes && attributes.children!=null) {\n\t\tif (!stack.length) stack.push(attributes.children);\n\t\tdelete attributes.children;\n\t}\n\twhile (stack.length) {\n\t\tif ((child = stack.pop()) && child.pop!==undefined) {\n\t\t\tfor (i=child.length; i--; ) stack.push(child[i]);\n\t\t}\n\t\telse {\n\t\t\tif (typeof child==='boolean') child = null;\n\n\t\t\tif ((simple = typeof nodeName!=='function')) {\n\t\t\t\tif (child==null) child = '';\n\t\t\t\telse if (typeof child==='number') child = String(child);\n\t\t\t\telse if (typeof child!=='string') simple = false;\n\t\t\t}\n\n\t\t\tif (simple && lastSimple) {\n\t\t\t\tchildren[children.length-1] += child;\n\t\t\t}\n\t\t\telse if (children===EMPTY_CHILDREN) {\n\t\t\t\tchildren = [child];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tchildren.push(child);\n\t\t\t}\n\n\t\t\tlastSimple = simple;\n\t\t}\n\t}\n\n\tlet p = new VNode();\n\tp.nodeName = nodeName;\n\tp.children = children;\n\tp.attributes = attributes==null ? undefined : attributes;\n\tp.key = attributes==null ? undefined : attributes.key;\n\n\t// if a \"vnode hook\" is defined, pass every created VNode to it\n\tif (options.vnode!==undefined) options.vnode(p);\n\n\treturn p;\n}\n","/**\n * Copy all properties from `props` onto `obj`.\n * @param {object} obj Object onto which properties should be copied.\n * @param {object} props Object from which to copy properties.\n * @returns {object}\n * @private\n */\nexport function extend(obj, props) {\n\tfor (let i in props) obj[i] = props[i];\n\treturn obj;\n}\n\n/** Invoke or update a ref, depending on whether it is a function or object ref.\n *  @param {object|function} [ref=null]\n *  @param {any} [value]\n */\nexport function applyRef(ref, value) {\n\tif (ref) {\n\t\tif (typeof ref=='function') ref(value);\n\t\telse ref.current = value;\n\t}\n}\n\n/**\n * Call a function asynchronously, as soon as possible. Makes\n * use of HTML Promise to schedule the callback if available,\n * otherwise falling back to `setTimeout` (mainly for IE<11).\n * @type {(callback: function) => void}\n */\nexport const defer = typeof Promise=='function' ? Promise.resolve().then.bind(Promise.resolve()) : setTimeout;\n","import { extend } from './util';\nimport { h } from './h';\n\n/**\n * Clones the given VNode, optionally adding attributes/props and replacing its\n * children.\n * @param {import('./vnode').VNode} vnode The virtual DOM element to clone\n * @param {object} props Attributes/props to add when cloning\n * @param {Array<import('./vnode').VNode>} [rest] Any additional arguments will be used as replacement\n *  children.\n */\nexport function cloneElement(vnode, props) {\n\treturn h(\n\t\tvnode.nodeName,\n\t\textend(extend({}, vnode.attributes), props),\n\t\targuments.length>2 ? [].slice.call(arguments, 2) : vnode.children\n\t);\n}\n","// render modes\n\n/** Do not re-render a component */\nexport const NO_RENDER = 0;\n/** Synchronously re-render a component and its children */\nexport const SYNC_RENDER = 1;\n/** Synchronously re-render a component, even if its lifecycle methods attempt to prevent it. */\nexport const FORCE_RENDER = 2;\n/** Queue asynchronous re-render of a component and it's children */\nexport const ASYNC_RENDER = 3;\n\n\nexport const ATTR_KEY = '__preactattr_';\n\n/** DOM properties that should NOT have \"px\" added when numeric */\nexport const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i;\n\n","import options from './options';\nimport { defer } from './util';\nimport { renderComponent } from './vdom/component';\n\n/**\n * Managed queue of dirty components to be re-rendered\n * @type {Array<import('./component').Component>}\n */\nlet items = [];\n\n/**\n * Enqueue a rerender of a component\n * @param {import('./component').Component} component The component to rerender\n */\nexport function enqueueRender(component) {\n\tif (!component._dirty && (component._dirty = true) && items.push(component)==1) {\n\t\t(options.debounceRendering || defer)(rerender);\n\t}\n}\n\n/** Rerender all enqueued dirty components */\nexport function rerender() {\n\tlet p;\n\twhile ( (p = items.pop()) ) {\n\t\tif (p._dirty) renderComponent(p);\n\t}\n}\n","import { extend } from '../util';\n\n\n/**\n * Check if two nodes are equivalent.\n * @param {import('../dom').PreactElement} node DOM Node to compare\n * @param {import('../vnode').VNode} vnode Virtual DOM node to compare\n * @param {boolean} [hydrating=false] If true, ignores component constructors\n *  when comparing.\n * @private\n */\nexport function isSameNodeType(node, vnode, hydrating) {\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\t\treturn node.splitText!==undefined;\n\t}\n\tif (typeof vnode.nodeName==='string') {\n\t\treturn !node._componentConstructor && isNamedNode(node, vnode.nodeName);\n\t}\n\treturn hydrating || node._componentConstructor===vnode.nodeName;\n}\n\n\n/**\n * Check if an Element has a given nodeName, case-insensitively.\n * @param {import('../dom').PreactElement} node A DOM Element to inspect the name of.\n * @param {string} nodeName Unnormalized name to compare against.\n */\nexport function isNamedNode(node, nodeName) {\n\treturn node.normalizedNodeName===nodeName || node.nodeName.toLowerCase()===nodeName.toLowerCase();\n}\n\n\n/**\n * Reconstruct Component-style `props` from a VNode.\n * Ensures default/fallback values from `defaultProps`:\n * Own-properties of `defaultProps` not present in `vnode.attributes` are added.\n * @param {import('../vnode').VNode} vnode The VNode to get props for\n * @returns {object} The props to use for this VNode\n */\nexport function getNodeProps(vnode) {\n\tlet props = extend({}, vnode.attributes);\n\tprops.children = vnode.children;\n\n\tlet defaultProps = vnode.nodeName.defaultProps;\n\tif (defaultProps!==undefined) {\n\t\tfor (let i in defaultProps) {\n\t\t\tif (props[i]===undefined) {\n\t\t\t\tprops[i] = defaultProps[i];\n\t\t\t}\n\t\t}\n\t}\n\n\treturn props;\n}\n","import { IS_NON_DIMENSIONAL } from '../constants';\nimport { applyRef } from '../util';\nimport options from '../options';\n\n/**\n * A DOM event listener\n * @typedef {(e: Event) => void} EventListner\n */\n\n/**\n * A mapping of event types to event listeners\n * @typedef {Object.<string, EventListener>} EventListenerMap\n */\n\n/**\n * Properties Preact adds to elements it creates\n * @typedef PreactElementExtensions\n * @property {string} [normalizedNodeName] A normalized node name to use in diffing\n * @property {EventListenerMap} [_listeners] A map of event listeners added by components to this DOM node\n * @property {import('../component').Component} [_component] The component that rendered this DOM node\n * @property {function} [_componentConstructor] The constructor of the component that rendered this DOM node\n */\n\n/**\n * A DOM element that has been extended with Preact properties\n * @typedef {Element & ElementCSSInlineStyle & PreactElementExtensions} PreactElement\n */\n\n/**\n * Create an element with the given nodeName.\n * @param {string} nodeName The DOM node to create\n * @param {boolean} [isSvg=false] If `true`, creates an element within the SVG\n *  namespace.\n * @returns {PreactElement} The created DOM node\n */\nexport function createNode(nodeName, isSvg) {\n\t/** @type {PreactElement} */\n\tlet node = isSvg ? document.createElementNS('http://www.w3.org/2000/svg', nodeName) : document.createElement(nodeName);\n\tnode.normalizedNodeName = nodeName;\n\treturn node;\n}\n\n\n/**\n * Remove a child node from its parent if attached.\n * @param {Node} node The node to remove\n */\nexport function removeNode(node) {\n\tlet parentNode = node.parentNode;\n\tif (parentNode) parentNode.removeChild(node);\n}\n\n\n/**\n * Set a named attribute on the given Node, with special behavior for some names\n * and event handlers. If `value` is `null`, the attribute/handler will be\n * removed.\n * @param {PreactElement} node An element to mutate\n * @param {string} name The name/key to set, such as an event or attribute name\n * @param {*} old The last value that was set for this name/node pair\n * @param {*} value An attribute value, such as a function to be used as an\n *  event handler\n * @param {boolean} isSvg Are we currently diffing inside an svg?\n * @private\n */\nexport function setAccessor(node, name, old, value, isSvg) {\n\tif (name==='className') name = 'class';\n\n\n\tif (name==='key') {\n\t\t// ignore\n\t}\n\telse if (name==='ref') {\n\t\tapplyRef(old, null);\n\t\tapplyRef(value, node);\n\t}\n\telse if (name==='class' && !isSvg) {\n\t\tnode.className = value || '';\n\t}\n\telse if (name==='style') {\n\t\tif (!value || typeof value==='string' || typeof old==='string') {\n\t\t\tnode.style.cssText = value || '';\n\t\t}\n\t\tif (value && typeof value==='object') {\n\t\t\tif (typeof old!=='string') {\n\t\t\t\tfor (let i in old) if (!(i in value)) node.style[i] = '';\n\t\t\t}\n\t\t\tfor (let i in value) {\n\t\t\t\tnode.style[i] = typeof value[i]==='number' && IS_NON_DIMENSIONAL.test(i)===false ? (value[i]+'px') : value[i];\n\t\t\t}\n\t\t}\n\t}\n\telse if (name==='dangerouslySetInnerHTML') {\n\t\tif (value) node.innerHTML = value.__html || '';\n\t}\n\telse if (name[0]=='o' && name[1]=='n') {\n\t\tlet useCapture = name !== (name=name.replace(/Capture$/, ''));\n\t\tname = name.toLowerCase().substring(2);\n\t\tif (value) {\n\t\t\tif (!old) node.addEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\telse {\n\t\t\tnode.removeEventListener(name, eventProxy, useCapture);\n\t\t}\n\t\t(node._listeners || (node._listeners = {}))[name] = value;\n\t}\n\telse if (name!=='list' && name!=='type' && !isSvg && name in node) {\n\t\t// Attempt to set a DOM property to the given value.\n\t\t// IE & FF throw for certain property-value combinations.\n\t\ttry {\n\t\t\tnode[name] = value==null ? '' : value;\n\t\t} catch (e) { }\n\t\tif ((value==null || value===false) && name!='spellcheck') node.removeAttribute(name);\n\t}\n\telse {\n\t\tlet ns = isSvg && (name !== (name = name.replace(/^xlink:?/, '')));\n\t\t// spellcheck is treated differently than all other boolean values and\n\t\t// should not be removed when the value is `false`. See:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-spellcheck\n\t\tif (value==null || value===false) {\n\t\t\tif (ns) node.removeAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase());\n\t\t\telse node.removeAttribute(name);\n\t\t}\n\t\telse if (typeof value!=='function') {\n\t\t\tif (ns) node.setAttributeNS('http://www.w3.org/1999/xlink', name.toLowerCase(), value);\n\t\t\telse node.setAttribute(name, value);\n\t\t}\n\t}\n}\n\n\n/**\n * Proxy an event to hooked event handlers\n * @param {Event} e The event object from the browser\n * @private\n */\nfunction eventProxy(e) {\n\treturn this._listeners[e.type](options.event && options.event(e) || e);\n}\n","import { ATTR_KEY } from '../constants';\nimport { isSameNodeType, isNamedNode } from './index';\nimport { buildComponentFromVNode } from './component';\nimport { createNode, setAccessor } from '../dom/index';\nimport { unmountComponent } from './component';\nimport options from '../options';\nimport { applyRef } from '../util';\nimport { removeNode } from '../dom/index';\n\n/**\n * Queue of components that have been mounted and are awaiting componentDidMount\n * @type {Array<import('../component').Component>}\n */\nexport const mounts = [];\n\n/** Diff recursion count, used to track the end of the diff cycle. */\nexport let diffLevel = 0;\n\n/** Global flag indicating if the diff is currently within an SVG */\nlet isSvgMode = false;\n\n/** Global flag indicating if the diff is performing hydration */\nlet hydrating = false;\n\n/** Invoke queued componentDidMount lifecycle methods */\nexport function flushMounts() {\n\tlet c;\n\twhile ((c = mounts.shift())) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}\n\n\n/**\n * Apply differences in a given vnode (and it's deep children) to a real DOM Node.\n * @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`\n * @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing\n *  the desired DOM structure\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {Element} parent ?\n * @param {boolean} componentRoot ?\n * @returns {import('../dom').PreactElement} The created/mutated element\n * @private\n */\nexport function diff(dom, vnode, context, mountAll, parent, componentRoot) {\n\t// diffLevel having been 0 here indicates initial entry into the diff (not a subdiff)\n\tif (!diffLevel++) {\n\t\t// when first starting the diff, check if we're diffing an SVG or within an SVG\n\t\tisSvgMode = parent!=null && parent.ownerSVGElement!==undefined;\n\n\t\t// hydration is indicated by the existing element to be diffed not having a prop cache\n\t\thydrating = dom!=null && !(ATTR_KEY in dom);\n\t}\n\n\tlet ret = idiff(dom, vnode, context, mountAll, componentRoot);\n\n\t// append the element if its a new parent\n\tif (parent && ret.parentNode!==parent) parent.appendChild(ret);\n\n\t// diffLevel being reduced to 0 means we're exiting the diff\n\tif (!--diffLevel) {\n\t\thydrating = false;\n\t\t// invoke queued componentDidMount lifecycle methods\n\t\tif (!componentRoot) flushMounts();\n\t}\n\n\treturn ret;\n}\n\n\n/**\n * Internals of `diff()`, separated to allow bypassing diffLevel / mount flushing.\n * @param {import('../dom').PreactElement} dom A DOM node to mutate into the shape of a `vnode`\n * @param {import('../vnode').VNode} vnode A VNode (with descendants forming a tree) representing the desired DOM structure\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {boolean} [componentRoot] ?\n * @private\n */\nfunction idiff(dom, vnode, context, mountAll, componentRoot) {\n\tlet out = dom,\n\t\tprevSvgMode = isSvgMode;\n\n\t// empty values (null, undefined, booleans) render as empty Text nodes\n\tif (vnode==null || typeof vnode==='boolean') vnode = '';\n\n\n\t// Fast case: Strings & Numbers create/update Text nodes.\n\tif (typeof vnode==='string' || typeof vnode==='number') {\n\n\t\t// update if it's already a Text node:\n\t\tif (dom && dom.splitText!==undefined && dom.parentNode && (!dom._component || componentRoot)) {\n\t\t\t/* istanbul ignore if */ /* Browser quirk that can't be covered: https://github.com/developit/preact/commit/fd4f21f5c45dfd75151bd27b4c217d8003aa5eb9 */\n\t\t\tif (dom.nodeValue!=vnode) {\n\t\t\t\tdom.nodeValue = vnode;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t// it wasn't a Text node: replace it with one and recycle the old Element\n\t\t\tout = document.createTextNode(vnode);\n\t\t\tif (dom) {\n\t\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\t\t\t\trecollectNodeTree(dom, true);\n\t\t\t}\n\t\t}\n\n\t\tout[ATTR_KEY] = true;\n\n\t\treturn out;\n\t}\n\n\n\t// If the VNode represents a Component, perform a component diff:\n\tlet vnodeName = vnode.nodeName;\n\tif (typeof vnodeName==='function') {\n\t\treturn buildComponentFromVNode(dom, vnode, context, mountAll);\n\t}\n\n\n\t// Tracks entering and exiting SVG namespace when descending through the tree.\n\tisSvgMode = vnodeName==='svg' ? true : vnodeName==='foreignObject' ? false : isSvgMode;\n\n\n\t// If there's no existing element or it's the wrong type, create a new one:\n\tvnodeName = String(vnodeName);\n\tif (!dom || !isNamedNode(dom, vnodeName)) {\n\t\tout = createNode(vnodeName, isSvgMode);\n\n\t\tif (dom) {\n\t\t\t// move children into the replacement node\n\t\t\twhile (dom.firstChild) out.appendChild(dom.firstChild);\n\n\t\t\t// if the previous Element was mounted into the DOM, replace it inline\n\t\t\tif (dom.parentNode) dom.parentNode.replaceChild(out, dom);\n\n\t\t\t// recycle the old element (skips non-Element node types)\n\t\t\trecollectNodeTree(dom, true);\n\t\t}\n\t}\n\n\n\tlet fc = out.firstChild,\n\t\tprops = out[ATTR_KEY],\n\t\tvchildren = vnode.children;\n\n\tif (props==null) {\n\t\tprops = out[ATTR_KEY] = {};\n\t\tfor (let a=out.attributes, i=a.length; i--; ) props[a[i].name] = a[i].value;\n\t}\n\n\t// Optimization: fast-path for elements containing a single TextNode:\n\tif (!hydrating && vchildren && vchildren.length===1 && typeof vchildren[0]==='string' && fc!=null && fc.splitText!==undefined && fc.nextSibling==null) {\n\t\tif (fc.nodeValue!=vchildren[0]) {\n\t\t\tfc.nodeValue = vchildren[0];\n\t\t}\n\t}\n\t// otherwise, if there are existing or new children, diff them:\n\telse if (vchildren && vchildren.length || fc!=null) {\n\t\tinnerDiffNode(out, vchildren, context, mountAll, hydrating || props.dangerouslySetInnerHTML!=null);\n\t}\n\n\n\t// Apply attributes/props from VNode to the DOM Element:\n\tdiffAttributes(out, vnode.attributes, props);\n\n\n\t// restore previous SVG mode: (in case we're exiting an SVG namespace)\n\tisSvgMode = prevSvgMode;\n\n\treturn out;\n}\n\n\n/**\n * Apply child and attribute changes between a VNode and a DOM Node to the DOM.\n * @param {import('../dom').PreactElement} dom Element whose children should be compared & mutated\n * @param {Array<import('../vnode').VNode>} vchildren Array of VNodes to compare to `dom.childNodes`\n * @param {object} context Implicitly descendant context object (from most\n *  recent `getChildContext()`)\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @param {boolean} isHydrating if `true`, consumes externally created elements\n *  similar to hydration\n */\nfunction innerDiffNode(dom, vchildren, context, mountAll, isHydrating) {\n\tlet originalChildren = dom.childNodes,\n\t\tchildren = [],\n\t\tkeyed = {},\n\t\tkeyedLen = 0,\n\t\tmin = 0,\n\t\tlen = originalChildren.length,\n\t\tchildrenLen = 0,\n\t\tvlen = vchildren ? vchildren.length : 0,\n\t\tj, c, f, vchild, child;\n\n\t// Build up a map of keyed children and an Array of unkeyed children:\n\tif (len!==0) {\n\t\tfor (let i=0; i<len; i++) {\n\t\t\tlet child = originalChildren[i],\n\t\t\t\tprops = child[ATTR_KEY],\n\t\t\t\tkey = vlen && props ? child._component ? child._component.__key : props.key : null;\n\t\t\tif (key!=null) {\n\t\t\t\tkeyedLen++;\n\t\t\t\tkeyed[key] = child;\n\t\t\t}\n\t\t\telse if (props || (child.splitText!==undefined ? (isHydrating ? child.nodeValue.trim() : true) : isHydrating)) {\n\t\t\t\tchildren[childrenLen++] = child;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (vlen!==0) {\n\t\tfor (let i=0; i<vlen; i++) {\n\t\t\tvchild = vchildren[i];\n\t\t\tchild = null;\n\n\t\t\t// attempt to find a node based on key matching\n\t\t\tlet key = vchild.key;\n\t\t\tif (key!=null) {\n\t\t\t\tif (keyedLen && keyed[key]!==undefined) {\n\t\t\t\t\tchild = keyed[key];\n\t\t\t\t\tkeyed[key] = undefined;\n\t\t\t\t\tkeyedLen--;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// attempt to pluck a node of the same type from the existing children\n\t\t\telse if (min<childrenLen) {\n\t\t\t\tfor (j=min; j<childrenLen; j++) {\n\t\t\t\t\tif (children[j]!==undefined && isSameNodeType(c = children[j], vchild, isHydrating)) {\n\t\t\t\t\t\tchild = c;\n\t\t\t\t\t\tchildren[j] = undefined;\n\t\t\t\t\t\tif (j===childrenLen-1) childrenLen--;\n\t\t\t\t\t\tif (j===min) min++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// morph the matched/found/created DOM child to match vchild (deep)\n\t\t\tchild = idiff(child, vchild, context, mountAll);\n\n\t\t\tf = originalChildren[i];\n\t\t\tif (child && child!==dom && child!==f) {\n\t\t\t\tif (f==null) {\n\t\t\t\t\tdom.appendChild(child);\n\t\t\t\t}\n\t\t\t\telse if (child===f.nextSibling) {\n\t\t\t\t\tremoveNode(f);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdom.insertBefore(child, f);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\n\t// remove unused keyed children:\n\tif (keyedLen) {\n\t\tfor (let i in keyed) if (keyed[i]!==undefined) recollectNodeTree(keyed[i], false);\n\t}\n\n\t// remove orphaned unkeyed children:\n\twhile (min<=childrenLen) {\n\t\tif ((child = children[childrenLen--])!==undefined) recollectNodeTree(child, false);\n\t}\n}\n\n\n\n/**\n * Recursively recycle (or just unmount) a node and its descendants.\n * @param {import('../dom').PreactElement} node DOM node to start\n *  unmount/removal from\n * @param {boolean} [unmountOnly=false] If `true`, only triggers unmount\n *  lifecycle, skips removal\n */\nexport function recollectNodeTree(node, unmountOnly) {\n\tlet component = node._component;\n\tif (component) {\n\t\t// if node is owned by a Component, unmount that component (ends up recursing back here)\n\t\tunmountComponent(component);\n\t}\n\telse {\n\t\t// If the node's VNode had a ref function, invoke it with null here.\n\t\t// (this is part of the React spec, and smart for unsetting references)\n\t\tif (node[ATTR_KEY]!=null) applyRef(node[ATTR_KEY].ref, null);\n\n\t\tif (unmountOnly===false || node[ATTR_KEY]==null) {\n\t\t\tremoveNode(node);\n\t\t}\n\n\t\tremoveChildren(node);\n\t}\n}\n\n\n/**\n * Recollect/unmount all children.\n *\t- we use .lastChild here because it causes less reflow than .firstChild\n *\t- it's also cheaper than accessing the .childNodes Live NodeList\n */\nexport function removeChildren(node) {\n\tnode = node.lastChild;\n\twhile (node) {\n\t\tlet next = node.previousSibling;\n\t\trecollectNodeTree(node, true);\n\t\tnode = next;\n\t}\n}\n\n\n/**\n * Apply differences in attributes from a VNode to the given DOM Element.\n * @param {import('../dom').PreactElement} dom Element with attributes to diff `attrs` against\n * @param {object} attrs The desired end-state key-value attribute pairs\n * @param {object} old Current/previous attributes (from previous VNode or\n *  element's prop cache)\n */\nfunction diffAttributes(dom, attrs, old) {\n\tlet name;\n\n\t// remove attributes no longer present on the vnode by setting them to undefined\n\tfor (name in old) {\n\t\tif (!(attrs && attrs[name]!=null) && old[name]!=null) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = undefined, isSvgMode);\n\t\t}\n\t}\n\n\t// add new & update changed attributes\n\tfor (name in attrs) {\n\t\tif (name!=='children' && name!=='innerHTML' && (!(name in old) || attrs[name]!==(name==='value' || name==='checked' ? dom[name] : old[name]))) {\n\t\t\tsetAccessor(dom, name, old[name], old[name] = attrs[name], isSvgMode);\n\t\t}\n\t}\n}\n","import { SYNC_RENDER, NO_RENDER, FORCE_RENDER, ASYNC_RENDER, ATTR_KEY } from '../constants';\nimport options from '../options';\nimport { extend, applyRef } from '../util';\nimport { enqueueRender } from '../render-queue';\nimport { getNodeProps } from './index';\nimport { diff, mounts, diffLevel, flushMounts, recollectNodeTree, removeChildren } from './diff';\nimport { createComponent, recyclerComponents } from './component-recycler';\nimport { removeNode } from '../dom/index';\n\n/**\n * Set a component's `props` and possibly re-render the component\n * @param {import('../component').Component} component The Component to set props on\n * @param {object} props The new props\n * @param {number} renderMode Render options - specifies how to re-render the component\n * @param {object} context The new context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n */\nexport function setComponentProps(component, props, renderMode, context, mountAll) {\n\tif (component._disable) return;\n\tcomponent._disable = true;\n\n\tcomponent.__ref = props.ref;\n\tcomponent.__key = props.key;\n\tdelete props.ref;\n\tdelete props.key;\n\n\tif (typeof component.constructor.getDerivedStateFromProps === 'undefined') {\n\t\tif (!component.base || mountAll) {\n\t\t\tif (component.componentWillMount) component.componentWillMount();\n\t\t}\n\t\telse if (component.componentWillReceiveProps) {\n\t\t\tcomponent.componentWillReceiveProps(props, context);\n\t\t}\n\t}\n\n\tif (context && context!==component.context) {\n\t\tif (!component.prevContext) component.prevContext = component.context;\n\t\tcomponent.context = context;\n\t}\n\n\tif (!component.prevProps) component.prevProps = component.props;\n\tcomponent.props = props;\n\n\tcomponent._disable = false;\n\n\tif (renderMode!==NO_RENDER) {\n\t\tif (renderMode===SYNC_RENDER || options.syncComponentUpdates!==false || !component.base) {\n\t\t\trenderComponent(component, SYNC_RENDER, mountAll);\n\t\t}\n\t\telse {\n\t\t\tenqueueRender(component);\n\t\t}\n\t}\n\n\tapplyRef(component.__ref, component);\n}\n\n\n\n/**\n * Render a Component, triggering necessary lifecycle events and taking\n * High-Order Components into account.\n * @param {import('../component').Component} component The component to render\n * @param {number} [renderMode] render mode, see constants.js for available options.\n * @param {boolean} [mountAll] Whether or not to immediately mount all components\n * @param {boolean} [isChild] ?\n * @private\n */\nexport function renderComponent(component, renderMode, mountAll, isChild) {\n\tif (component._disable) return;\n\n\tlet props = component.props,\n\t\tstate = component.state,\n\t\tcontext = component.context,\n\t\tpreviousProps = component.prevProps || props,\n\t\tpreviousState = component.prevState || state,\n\t\tpreviousContext = component.prevContext || context,\n\t\tisUpdate = component.base,\n\t\tnextBase = component.nextBase,\n\t\tinitialBase = isUpdate || nextBase,\n\t\tinitialChildComponent = component._component,\n\t\tskip = false,\n\t\tsnapshot = previousContext,\n\t\trendered, inst, cbase;\n\n\tif (component.constructor.getDerivedStateFromProps) {\n\t\tstate = extend(extend({}, state), component.constructor.getDerivedStateFromProps(props, state));\n\t\tcomponent.state = state;\n\t}\n\n\t// if updating\n\tif (isUpdate) {\n\t\tcomponent.props = previousProps;\n\t\tcomponent.state = previousState;\n\t\tcomponent.context = previousContext;\n\t\tif (renderMode!==FORCE_RENDER\n\t\t\t&& component.shouldComponentUpdate\n\t\t\t&& component.shouldComponentUpdate(props, state, context) === false) {\n\t\t\tskip = true;\n\t\t}\n\t\telse if (component.componentWillUpdate) {\n\t\t\tcomponent.componentWillUpdate(props, state, context);\n\t\t}\n\t\tcomponent.props = props;\n\t\tcomponent.state = state;\n\t\tcomponent.context = context;\n\t}\n\n\tcomponent.prevProps = component.prevState = component.prevContext = component.nextBase = null;\n\tcomponent._dirty = false;\n\n\tif (!skip) {\n\t\trendered = component.render(props, state, context);\n\n\t\t// context to pass to the child, can be updated via (grand-)parent component\n\t\tif (component.getChildContext) {\n\t\t\tcontext = extend(extend({}, context), component.getChildContext());\n\t\t}\n\n\t\tif (isUpdate && component.getSnapshotBeforeUpdate) {\n\t\t\tsnapshot = component.getSnapshotBeforeUpdate(previousProps, previousState);\n\t\t}\n\n\t\tlet childComponent = rendered && rendered.nodeName,\n\t\t\ttoUnmount, base;\n\n\t\tif (typeof childComponent==='function') {\n\t\t\t// set up high order component link\n\n\t\t\tlet childProps = getNodeProps(rendered);\n\t\t\tinst = initialChildComponent;\n\n\t\t\tif (inst && inst.constructor===childComponent && childProps.key==inst.__key) {\n\t\t\t\tsetComponentProps(inst, childProps, SYNC_RENDER, context, false);\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttoUnmount = inst;\n\n\t\t\t\tcomponent._component = inst = createComponent(childComponent, childProps, context);\n\t\t\t\tinst.nextBase = inst.nextBase || nextBase;\n\t\t\t\tinst._parentComponent = component;\n\t\t\t\tsetComponentProps(inst, childProps, NO_RENDER, context, false);\n\t\t\t\trenderComponent(inst, SYNC_RENDER, mountAll, true);\n\t\t\t}\n\n\t\t\tbase = inst.base;\n\t\t}\n\t\telse {\n\t\t\tcbase = initialBase;\n\n\t\t\t// destroy high order component link\n\t\t\ttoUnmount = initialChildComponent;\n\t\t\tif (toUnmount) {\n\t\t\t\tcbase = component._component = null;\n\t\t\t}\n\n\t\t\tif (initialBase || renderMode===SYNC_RENDER) {\n\t\t\t\tif (cbase) cbase._component = null;\n\t\t\t\tbase = diff(cbase, rendered, context, mountAll || !isUpdate, initialBase && initialBase.parentNode, true);\n\t\t\t}\n\t\t}\n\n\t\tif (initialBase && base!==initialBase && inst!==initialChildComponent) {\n\t\t\tlet baseParent = initialBase.parentNode;\n\t\t\tif (baseParent && base!==baseParent) {\n\t\t\t\tbaseParent.replaceChild(base, initialBase);\n\n\t\t\t\tif (!toUnmount) {\n\t\t\t\t\tinitialBase._component = null;\n\t\t\t\t\trecollectNodeTree(initialBase, false);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif (toUnmount) {\n\t\t\tunmountComponent(toUnmount);\n\t\t}\n\n\t\tcomponent.base = base;\n\t\tif (base && !isChild) {\n\t\t\tlet componentRef = component,\n\t\t\t\tt = component;\n\t\t\twhile ((t=t._parentComponent)) {\n\t\t\t\t(componentRef = t).base = base;\n\t\t\t}\n\t\t\tbase._component = componentRef;\n\t\t\tbase._componentConstructor = componentRef.constructor;\n\t\t}\n\t}\n\n\tif (!isUpdate || mountAll) {\n\t\tmounts.push(component);\n\t}\n\telse if (!skip) {\n\t\t// Ensure that pending componentDidMount() hooks of child components\n\t\t// are called before the componentDidUpdate() hook in the parent.\n\t\t// Note: disabled as it causes duplicate hooks, see https://github.com/developit/preact/issues/750\n\t\t// flushMounts();\n\n\t\tif (component.componentDidUpdate) {\n\t\t\tcomponent.componentDidUpdate(previousProps, previousState, snapshot);\n\t\t}\n\t\tif (options.afterUpdate) options.afterUpdate(component);\n\t}\n\n\twhile (component._renderCallbacks.length) component._renderCallbacks.pop().call(component);\n\n\tif (!diffLevel && !isChild) flushMounts();\n}\n\n\n\n/**\n * Apply the Component referenced by a VNode to the DOM.\n * @param {import('../dom').PreactElement} dom The DOM node to mutate\n * @param {import('../vnode').VNode} vnode A Component-referencing VNode\n * @param {object} context The current context\n * @param {boolean} mountAll Whether or not to immediately mount all components\n * @returns {import('../dom').PreactElement} The created/mutated element\n * @private\n */\nexport function buildComponentFromVNode(dom, vnode, context, mountAll) {\n\tlet c = dom && dom._component,\n\t\toriginalComponent = c,\n\t\toldDom = dom,\n\t\tisDirectOwner = c && dom._componentConstructor===vnode.nodeName,\n\t\tisOwner = isDirectOwner,\n\t\tprops = getNodeProps(vnode);\n\twhile (c && !isOwner && (c=c._parentComponent)) {\n\t\tisOwner = c.constructor===vnode.nodeName;\n\t}\n\n\tif (c && isOwner && (!mountAll || c._component)) {\n\t\tsetComponentProps(c, props, ASYNC_RENDER, context, mountAll);\n\t\tdom = c.base;\n\t}\n\telse {\n\t\tif (originalComponent && !isDirectOwner) {\n\t\t\tunmountComponent(originalComponent);\n\t\t\tdom = oldDom = null;\n\t\t}\n\n\t\tc = createComponent(vnode.nodeName, props, context);\n\t\tif (dom && !c.nextBase) {\n\t\t\tc.nextBase = dom;\n\t\t\t// passing dom/oldDom as nextBase will recycle it if unused, so bypass recycling on L229:\n\t\t\toldDom = null;\n\t\t}\n\t\tsetComponentProps(c, props, SYNC_RENDER, context, mountAll);\n\t\tdom = c.base;\n\n\t\tif (oldDom && dom!==oldDom) {\n\t\t\toldDom._component = null;\n\t\t\trecollectNodeTree(oldDom, false);\n\t\t}\n\t}\n\n\treturn dom;\n}\n\n\n\n/**\n * Remove a component from the DOM and recycle it.\n * @param {import('../component').Component} component The Component instance to unmount\n * @private\n */\nexport function unmountComponent(component) {\n\tif (options.beforeUnmount) options.beforeUnmount(component);\n\n\tlet base = component.base;\n\n\tcomponent._disable = true;\n\n\tif (component.componentWillUnmount) component.componentWillUnmount();\n\n\tcomponent.base = null;\n\n\t// recursively tear down & recollect high-order component children:\n\tlet inner = component._component;\n\tif (inner) {\n\t\tunmountComponent(inner);\n\t}\n\telse if (base) {\n\t\tif (base[ATTR_KEY]!=null) applyRef(base[ATTR_KEY].ref, null);\n\n\t\tcomponent.nextBase = base;\n\n\t\tremoveNode(base);\n\t\trecyclerComponents.push(component);\n\n\t\tremoveChildren(base);\n\t}\n\n\tapplyRef(component.__ref, null);\n}\n","import { Component } from '../component';\n\n/**\n * Retains a pool of Components for re-use.\n * @type {Component[]}\n * @private\n */\nexport const recyclerComponents = [];\n\n\n/**\n * Create a component. Normalizes differences between PFC's and classful\n * Components.\n * @param {function} Ctor The constructor of the component to create\n * @param {object} props The initial props of the component\n * @param {object} context The initial context of the component\n * @returns {import('../component').Component}\n */\nexport function createComponent(Ctor, props, context) {\n\tlet inst, i = recyclerComponents.length;\n\n\tif (Ctor.prototype && Ctor.prototype.render) {\n\t\tinst = new Ctor(props, context);\n\t\tComponent.call(inst, props, context);\n\t}\n\telse {\n\t\tinst = new Component(props, context);\n\t\tinst.constructor = Ctor;\n\t\tinst.render = doRender;\n\t}\n\n\n\twhile (i--) {\n\t\tif (recyclerComponents[i].constructor===Ctor) {\n\t\t\tinst.nextBase = recyclerComponents[i].nextBase;\n\t\t\trecyclerComponents.splice(i, 1);\n\t\t\treturn inst;\n\t\t}\n\t}\n\n\treturn inst;\n}\n\n\n/** The `.render()` method for a PFC backing instance. */\nfunction doRender(props, state, context) {\n\treturn this.constructor(props, context);\n}\n","import { FORCE_RENDER } from './constants';\nimport { extend } from './util';\nimport { renderComponent } from './vdom/component';\nimport { enqueueRender } from './render-queue';\n/**\n * Base Component class.\n * Provides `setState()` and `forceUpdate()`, which trigger rendering.\n * @typedef {object} Component\n * @param {object} props The initial component props\n * @param {object} context The initial context from parent components' getChildContext\n * @public\n *\n * @example\n * class MyFoo extends Component {\n *   render(props, state) {\n *     return <div />;\n *   }\n * }\n */\nexport function Component(props, context) {\n\tthis._dirty = true;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.context = context;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.props = props;\n\n\t/**\n\t * @public\n\t * @type {object}\n\t */\n\tthis.state = this.state || {};\n\n\tthis._renderCallbacks = [];\n}\n\n\nextend(Component.prototype, {\n\n\t/**\n\t * Update component state and schedule a re-render.\n\t * @param {object} state A dict of state properties to be shallowly merged\n\t * \tinto the current state, or a function that will produce such a dict. The\n\t * \tfunction is called with the current state and props.\n\t * @param {() => void} callback A function to be called once component state is\n\t * \tupdated\n\t */\n\tsetState(state, callback) {\n\t\tif (!this.prevState) this.prevState = this.state;\n\t\tthis.state = extend(\n\t\t\textend({}, this.state),\n\t\t\ttypeof state === 'function' ? state(this.state, this.props) : state\n\t\t);\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\tenqueueRender(this);\n\t},\n\n\n\t/**\n\t * Immediately perform a synchronous re-render of the component.\n\t * @param {() => void} callback A function to be called after component is\n\t * \tre-rendered.\n\t * @private\n\t */\n\tforceUpdate(callback) {\n\t\tif (callback) this._renderCallbacks.push(callback);\n\t\trenderComponent(this, FORCE_RENDER);\n\t},\n\n\n\t/**\n\t * Accepts `props` and `state`, and returns a new Virtual DOM tree to build.\n\t * Virtual DOM is generally constructed via [JSX](http://jasonformat.com/wtf-is-jsx).\n\t * @param {object} props Props (eg: JSX attributes) received from parent\n\t * \telement/component\n\t * @param {object} state The component's current state\n\t * @param {object} context Context object, as returned by the nearest\n\t *  ancestor's `getChildContext()`\n\t * @returns {import('./vnode').VNode | void}\n\t */\n\trender() {}\n\n});\n","import { diff } from './vdom/diff';\n\n/**\n * Render JSX into a `parent` Element.\n * @param {import('./vnode').VNode} vnode A (JSX) VNode to render\n * @param {import('./dom').PreactElement} parent DOM element to render into\n * @param {import('./dom').PreactElement} [merge] Attempt to re-use an existing DOM tree rooted at\n *  `merge`\n * @public\n *\n * @example\n * // render a div into <body>:\n * render(<div id=\"hello\">hello!</div>, document.body);\n *\n * @example\n * // render a \"Thing\" component into #foo:\n * const Thing = ({ name }) => <span>{ name }</span>;\n * render(<Thing name=\"one\" />, document.querySelector('#foo'));\n */\nexport function render(vnode, parent, merge) {\n\treturn diff(merge, vnode, {}, false, parent, false);\n}\n","import { h, h as createElement } from './h';\nimport { cloneElement } from './clone-element';\nimport { Component } from './component';\nimport { render } from './render';\nimport { rerender } from './render-queue';\nimport options from './options';\n\nfunction createRef() {\n\treturn {};\n}\n\nexport default {\n\th,\n\tcreateElement,\n\tcloneElement,\n\tcreateRef,\n\tComponent,\n\trender,\n\trerender,\n\toptions\n};\n\nexport {\n\th,\n\tcreateElement,\n\tcloneElement,\n\tcreateRef,\n\tComponent,\n\trender,\n\trerender,\n\toptions\n};\n"],"sourceRoot":""}