/*! * * PRC Parent Theme * * @author Seth Rubenstein * @version 0.1.0 * @link https://github.com/wpcomvip/pewresearch-org * @license GPL * * Copyright (c) 2023 Seth Rubenstein * * This software is released under the UNLICENSED License * https://opensource.org/licenses/UNLICENSED * * Compiled with the help of https://wpack.io * A zero setup Webpack Bundler Script for WordPress */ (window.wpackioprcParentthemeJsonp=window.wpackioprcParentthemeJsonp||[]).push([[7],{160:function(e,t,n){n(27),e.exports=n(161)},161:function(e,t,n){"use strict";n.r(t);var o=n(35),r=n(17),c=n.n(r),i=n(50),a=n.n(i);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}function u(e){for(var t=1;t{"use strict";var e={n:r=>{var o=r&&r.__esModule?()=>r.default:()=>r;return e.d(o,{a:o}),o},d:(r,o)=>{for(var t in o)e.o(o,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:o[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=window.wp.domReady;e.n(r)()((()=>{}))})(); //# sourceMappingURL=view.js.map; window.addEventListener("load",(()=>{document.querySelectorAll(".wp-block-prc-block-story-item .image").forEach((e=>{e.classList.add("loaded")}))})); //# sourceMappingURL=view.js.map; !function(){var e={472:function(e,t){var a;!function(){"use strict";var n={}.hasOwnProperty;function r(){for(var e=[],t=0;t{let e=document.querySelector('iframe[title="Main content of the hCaptcha challenge"]');if(e=e.parentElement.parentElement,e){const t=e.querySelector("div:last-of-type");null!==t&&(t.style={...t.style,display:"none"})}else g()};function C(t){let{className:a,input:n={style:"",className:"",type:"email",placeholder:""},button:r={wrapperClassName:"",wrapperStyle:"",style:"",className:"",text:""},form:i={segmentId:!1}}=t;const[s,o]=(0,e.useState)(!1),[c,p]=(0,e.useState)(!1),[l,h]=(0,e.useState)(!1),[u,m]=(0,e.useState)(!1),[C,R]=(0,e.useState)(null),[E,S]=(0,e.useState)(r.text),[w,x]=(0,e.useState)(!1),O=(0,e.useRef)(null),A=f()(r.className,{"is-processing":s,"is-disabled":c,"has-error":l,"has-success":u});return(0,e.useEffect)((()=>{p(!C)}),[C]),(0,e.createElement)("form",{className:a},!w&&(0,e.createElement)(e.Fragment,null,(0,e.createElement)("input",{type:n.type,placeholder:n.placeholder,style:n.style,className:n.className,onChange:e=>R(e.target.value),value:C}),(0,e.createElement)("button",{type:"submit",className:r.wrapperClassName,disabled:s||c,style:{opacity:s?.5:1,...r.wrapperStyle},onClick:e=>{e.preventDefault(),!1===c&&x(!w)}},(0,e.createElement)("span",{style:r.style,className:A},E))),w&&(0,e.createElement)(d,{sitekey:b,theme:"light",ref:O,onVerify:e=>{!1!==e&&!0!==s&&(e=>{let{onStart:t,onSuccess:a,onError:n,emailAddress:r,captchaToken:i=!1,closeCaptcha:s,interest:o=!1}=e;if(!b)return n("Invalid captcha key");if(!i)return n("We couldn't verify you're not a robot. Please try again.");t(),s();const c=r,p=document.URL;if(!(0,v.isURL)(p))return n("Invalid URL");const l=(0,v.buildQueryString)({email:c,captcha_token:i,interests:o,api_key:"mailchimp-form",origin_url:p});y()({path:`/prc-api/v2/mailchimp/subscribe/?${l}`,method:"POST"}).then((()=>a())).catch((e=>n(e)))})({onStart:()=>{o(!0),S("Processing...")},onSuccess:()=>(S("Success"),m(!0),o(!1),R(""),h(!1),!0),onError:e=>(h(!0),S("Error"),o(!1),console.log("Error!",e),!1),closeCaptcha:()=>x(!1),emailAddress:C,captchaToken:e,interest:i.segmentId})},onOpen:()=>{g()}}))}function R(e){return e?e.split(";").filter((e=>e)).reduce(((e,t)=>{const[a,n]=t.split(":");return e[a.split("-").map(((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1))).join("")]=n,e}),{}):{}}n()((()=>{document.querySelectorAll(".wp-block-prc-block-mailchimp-form").forEach((t=>{const a=t.getAttribute("class"),n=t.getAttribute("data-segment-id"),r=t.querySelector(".wp-block-prc-block-form-input-text"),i=r.getAttribute("style")||"",s=r.getAttribute("class")||"",o=t.querySelector(".wp-block-button"),c=t.querySelector(".wp-block-button__link"),p=o.getAttribute("class")||"",l=o.getAttribute("style")||"",h=c.getAttribute("style")||"",d=c.getAttribute("class")||"",u=document.createElement("div");t.parentNode.insertBefore(u,t),(0,e.render)((0,e.createElement)(C,{className:a,input:{style:R(i),className:s,type:r.getAttribute("type"),placeholder:r.getAttribute("placeholder")},button:{wrapperClassName:p,wrapperStyle:R(l),style:R(h),className:d,text:c.innerText},form:{segmentId:n}}),u),t.parentNode.removeChild(t)}))}))}()}(); //# sourceMappingURL=view.js.map; /*! This file is auto-generated */ !function(){"use strict";var e={d:function(n,t){for(var o in t)e.o(t,o)&&!e.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:t[o]})},o:function(e,n){return Object.prototype.hasOwnProperty.call(e,n)}},n={};e.d(n,{default:function(){return i}});var t=window.wp.hooks;const o=Object.create(null);function i(e,n={}){const{since:i,version:r,alternative:c,plugin:a,link:d,hint:s}=n,l=`${e} is deprecated${i?` since version ${i}`:""}${r?` and will be removed${a?` from ${a}`:""} in version ${r}`:""}.${c?` Please use ${c} instead.`:""}${d?` See: ${d}`:""}${s?` Note: ${s}`:""}`;l in o||((0,t.doAction)("deprecated",e,n,l),console.warn(l),o[l]=!0)}(window.wp=window.wp||{}).deprecated=n.default}();; /*! This file is auto-generated */ !function(){"use strict";var t={n:function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,{a:n}),n},d:function(e,n){for(var r in n)t.o(n,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},o:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{__unstableStripHTML:function(){return $},computeCaretRect:function(){return b},documentHasSelection:function(){return w},documentHasTextSelection:function(){return N},documentHasUncollapsedSelection:function(){return C},focus:function(){return ct},getFilesFromDataTransfer:function(){return ut},getOffsetParent:function(){return O},getPhrasingContentSchema:function(){return tt},getRectangleFromRange:function(){return g},getScrollContainer:function(){return v},insertAfter:function(){return z},isEmpty:function(){return J},isEntirelySelected:function(){return A},isFormElement:function(){return D},isHorizontalEdge:function(){return x},isNumberInput:function(){return _},isPhrasingContent:function(){return et},isRTL:function(){return P},isTextContent:function(){return nt},isTextField:function(){return E},isVerticalEdge:function(){return F},placeCaretAtHorizontalEdge:function(){return j},placeCaretAtVerticalEdge:function(){return U},remove:function(){return q},removeInvalidHTML:function(){return it},replace:function(){return W},replaceTag:function(){return X},safeHTML:function(){return Y},unwrap:function(){return k},wrap:function(){return G}});var n={};t.r(n),t.d(n,{find:function(){return i}});var r={};function o(t){return t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0}function i(t,{sequential:e=!1}={}){const n=t.querySelectorAll(function(t){return[t?'[tabindex]:not([tabindex^="-"])':"[tabindex]","a[href]","button:not([disabled])",'input:not([type="hidden"]):not([disabled])',"select:not([disabled])","textarea:not([disabled])",'iframe:not([tabindex^="-"])',"object","embed","area[href]","[contenteditable]:not([contenteditable=false])"].join(",")}(e));return Array.from(n).filter((t=>{if(!o(t))return!1;const{nodeName:e}=t;return"AREA"!==e||function(t){const e=t.closest("map[name]");if(!e)return!1;const n=t.ownerDocument.querySelector('img[usemap="#'+e.name+'"]');return!!n&&o(n)}(t)}))}function u(t){const e=t.getAttribute("tabindex");return null===e?0:parseInt(e,10)}function c(t){return-1!==u(t)}function a(t,e){return{element:t,index:e}}function s(t){return t.element}function l(t,e){const n=u(t.element),r=u(e.element);return n===r?t.index-e.index:n-r}function f(t){return t.filter(c).map(a).sort(l).map(s).reduce(function(){const t={};return function(e,n){const{nodeName:r,type:o,checked:i,name:u}=n;if("INPUT"!==r||"radio"!==o||!u)return e.concat(n);const c=t.hasOwnProperty(u);if(!i&&c)return e;if(c){const n=t[u];e=e.filter((t=>t!==n))}return t[u]=n,e.concat(n)}}(),[])}function d(t){return f(i(t))}function m(t){return f(i(t.ownerDocument.body)).reverse().find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_PRECEDING))}function h(t){return f(i(t.ownerDocument.body)).find((e=>t.compareDocumentPosition(e)&t.DOCUMENT_POSITION_FOLLOWING))}function p(t,e){0}function g(t){if(!t.collapsed){const e=Array.from(t.getClientRects());if(1===e.length)return e[0];const n=e.filter((({width:t})=>t>1));if(0===n.length)return t.getBoundingClientRect();if(1===n.length)return n[0];let{top:r,bottom:o,left:i,right:u}=n[0];for(const{top:t,bottom:e,left:c,right:a}of n)to&&(o=e),cu&&(u=a);return new window.DOMRect(i,r,u-i,o-r)}const{startContainer:e}=t,{ownerDocument:n}=e;if("BR"===e.nodeName){const{parentNode:r}=e;p();const o=Array.from(r.childNodes).indexOf(e);p(),(t=n.createRange()).setStart(r,o),t.setEnd(r,o)}const r=t.getClientRects();if(r.length>1)return null;let o=r[0];if(!o||0===o.height){p();const e=n.createTextNode("​");(t=t.cloneRange()).insertNode(e),o=t.getClientRects()[0],p(e.parentNode),e.parentNode.removeChild(e)}return o}function b(t){const e=t.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return n?g(n):null}function N(t){p(t.defaultView);const e=t.defaultView.getSelection();p();const n=e.rangeCount?e.getRangeAt(0):null;return!!n&&!n.collapsed}function y(t){return"INPUT"===t?.nodeName}function E(t){return y(t)&&t.type&&!["button","checkbox","hidden","file","radio","image","range","reset","submit","number","email","time"].includes(t.type)||"TEXTAREA"===t.nodeName||"true"===t.contentEditable}function C(t){return N(t)||!!t.activeElement&&function(t){if(!y(t)&&!E(t))return!1;try{const{selectionStart:e,selectionEnd:n}=t;return null===e||e!==n}catch(t){return!0}}(t.activeElement)}function w(t){return!!t.activeElement&&(y(t.activeElement)||E(t.activeElement)||N(t))}function T(t){return p(t.ownerDocument.defaultView),t.ownerDocument.defaultView.getComputedStyle(t)}function v(t,e="vertical"){if(t){if(("vertical"===e||"all"===e)&&t.scrollHeight>t.clientHeight){const{overflowY:e}=T(t);if(/(auto|scroll)/.test(e))return t}if(("horizontal"===e||"all"===e)&&t.scrollWidth>t.clientWidth){const{overflowX:e}=T(t);if(/(auto|scroll)/.test(e))return t}return t.ownerDocument===t.parentNode?t:v(t.parentNode,e)}}function O(t){let e;for(;(e=t.parentNode)&&e.nodeType!==e.ELEMENT_NODE;);return e?"static"!==T(e).position?e:e.offsetParent:null}function S(t){return"INPUT"===t.tagName||"TEXTAREA"===t.tagName}function A(t){if(S(t))return 0===t.selectionStart&&t.value.length===t.selectionEnd;if(!t.isContentEditable)return!0;const{ownerDocument:e}=t,{defaultView:n}=e;p();const r=n.getSelection();p();const o=r.rangeCount?r.getRangeAt(0):null;if(!o)return!0;const{startContainer:i,endContainer:u,startOffset:c,endOffset:a}=o;if(i===t&&u===t&&0===c&&a===t.childNodes.length)return!0;t.lastChild;p();const s=u.nodeType===u.TEXT_NODE?u.data.length:u.childNodes.length;return R(i,t,"firstChild")&&R(u,t,"lastChild")&&0===c&&a===s}function R(t,e,n){let r=e;do{if(t===r)return!0;r=r[n]}while(r);return!1}function D(t){if(!t)return!1;const{tagName:e}=t;return S(t)||"BUTTON"===e||"SELECT"===e}function P(t){return"rtl"===T(t).direction}function L(t,e,n,r){const o=r.style.zIndex,i=r.style.position,{position:u="static"}=T(r);"static"===u&&(r.style.position="relative"),r.style.zIndex="10000";const c=function(t,e,n){if(t.caretRangeFromPoint)return t.caretRangeFromPoint(e,n);if(!t.caretPositionFromPoint)return null;const r=t.caretPositionFromPoint(e,n);if(!r)return null;const o=t.createRange();return o.setStart(r.offsetNode,r.offset),o.collapse(!0),o}(t,e,n);return r.style.zIndex=o,r.style.position=i,c}function M(t,e,n=!1){if(S(t)&&"number"==typeof t.selectionStart)return t.selectionStart===t.selectionEnd&&(e?0===t.selectionStart:t.value.length===t.selectionStart);if(!t.isContentEditable)return!0;const{ownerDocument:r}=t,{defaultView:o}=r;p();const i=o.getSelection();if(!i||!i.rangeCount)return!1;const u=i.getRangeAt(0),c=u.cloneRange(),a=function(t){const{anchorNode:e,focusNode:n,anchorOffset:r,focusOffset:o}=t;p(),p();const i=e.compareDocumentPosition(n);return!(i&e.DOCUMENT_POSITION_PRECEDING)&&(!!(i&e.DOCUMENT_POSITION_FOLLOWING)||0!==i||r<=o)}(i),s=i.isCollapsed;s||c.collapse(!a);const l=g(c),f=g(u);if(!l||!f)return!1;const d=function(t){const e=Array.from(t.getClientRects());if(!e.length)return;const n=Math.min(...e.map((({top:t})=>t)));return Math.max(...e.map((({bottom:t})=>t)))-n}(u);if(!s&&d&&d>l.height&&a===e)return!1;const m=P(t)?!e:e,h=t.getBoundingClientRect(),b=L(r,m?h.left+1:h.right-1,e?h.top+1:h.bottom-1,t);if(!b)return!1;const N=g(b);if(!N)return!1;const y=e?"top":"bottom",E=m?"left":"right",C=N[y]-f[y],w=N[E]-l[E],T=Math.abs(C)<=1,v=Math.abs(w)<=1;return n?T:T&&v}function x(t,e){return M(t,e)}t.r(r),t.d(r,{find:function(){return d},findNext:function(){return h},findPrevious:function(){return m},isTabbableIndex:function(){return c}});var I=window.wp.deprecated,H=t.n(I);function _(t){return H()("wp.dom.isNumberInput",{since:"6.1",version:"6.5"}),y(t)&&"number"===t.type&&!isNaN(t.valueAsNumber)}function F(t,e){return M(t,e,!0)}function V(t,e,n){const{ownerDocument:r}=t,o=P(t)?!e:e,i=t.getBoundingClientRect();void 0===n?n=e?i.right-1:i.left+1:n<=i.left?n=i.left+1:n>=i.right&&(n=i.right-1);return L(r,n,o?i.bottom-1:i.top+1,t)}function B(t,e,n){if(!t)return;if(t.focus(),S(t)){if("number"!=typeof t.selectionStart)return;return void(e?(t.selectionStart=t.value.length,t.selectionEnd=t.value.length):(t.selectionStart=0,t.selectionEnd=0))}if(!t.isContentEditable)return;let r=V(t,e,n);if(!(r&&r.startContainer&&t.contains(r.startContainer)||(t.scrollIntoView(e),r=r=V(t,e,n),r&&r.startContainer&&t.contains(r.startContainer))))return;const{ownerDocument:o}=t,{defaultView:i}=o;p();const u=i.getSelection();p(),u.removeAllRanges(),u.addRange(r)}function j(t,e){return B(t,e,void 0)}function U(t,e,n){return B(t,e,n?.left)}function z(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e.nextSibling)}function q(t){p(t.parentNode),t.parentNode.removeChild(t)}function W(t,e){p(t.parentNode),z(e,t.parentNode),q(t)}function k(t){const e=t.parentNode;for(p();t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t)}function X(t,e){const n=t.ownerDocument.createElement(e);for(;t.firstChild;)n.appendChild(t.firstChild);return p(t.parentNode),t.parentNode.replaceChild(n,t),n}function G(t,e){p(e.parentNode),e.parentNode.insertBefore(t,e),t.appendChild(e)}function Y(t){const{body:e}=document.implementation.createHTMLDocument("");e.innerHTML=t;const n=e.getElementsByTagName("*");let r=n.length;for(;r--;){const t=n[r];if("SCRIPT"===t.tagName)q(t);else{let e=t.attributes.length;for(;e--;){const{name:n}=t.attributes[e];n.startsWith("on")&&t.removeAttribute(n)}}}return e.innerHTML}function $(t){t=Y(t);const e=document.implementation.createHTMLDocument("");return e.body.innerHTML=t,e.body.textContent||""}function J(t){switch(t.nodeType){case t.TEXT_NODE:return/^[ \f\n\r\t\v\u00a0]*$/.test(t.nodeValue||"");case t.ELEMENT_NODE:return!t.hasAttributes()&&(!t.hasChildNodes()||Array.from(t.childNodes).every(J));default:return!0}}const K={strong:{},em:{},s:{},del:{},ins:{},a:{attributes:["href","target","rel","id"]},code:{},abbr:{attributes:["title"]},sub:{},sup:{},br:{},small:{},q:{attributes:["cite"]},dfn:{attributes:["title"]},data:{attributes:["value"]},time:{attributes:["datetime"]},var:{},samp:{},kbd:{},i:{},b:{},u:{},mark:{},ruby:{},rt:{},rp:{},bdi:{attributes:["dir"]},bdo:{attributes:["dir"]},wbr:{},"#text":{}},Q=["#text","br"];Object.keys(K).filter((t=>!Q.includes(t))).forEach((t=>{const{[t]:e,...n}=K;K[t].children=n}));const Z={...K,audio:{attributes:["src","preload","autoplay","mediagroup","loop","muted"]},canvas:{attributes:["width","height"]},embed:{attributes:["src","type","width","height"]},img:{attributes:["alt","src","srcset","usemap","ismap","width","height"]},object:{attributes:["data","type","name","usemap","form","width","height"]},video:{attributes:["src","poster","preload","autoplay","mediagroup","loop","muted","controls","width","height"]}};function tt(t){if("paste"!==t)return Z;const{u:e,abbr:n,data:r,time:o,wbr:i,bdi:u,bdo:c,...a}={...Z,ins:{children:Z.ins.children},del:{children:Z.del.children}};return a}function et(t){const e=t.nodeName.toLowerCase();return tt().hasOwnProperty(e)||"span"===e}function nt(t){const e=t.nodeName.toLowerCase();return K.hasOwnProperty(e)||"span"===e}const rt=()=>{};function ot(t,e,n,r){Array.from(t).forEach((t=>{const o=t.nodeName.toLowerCase();if(!n.hasOwnProperty(o)||n[o].isMatch&&!n[o].isMatch?.(t))ot(t.childNodes,e,n,r),r&&!et(t)&&t.nextElementSibling&&z(e.createElement("br"),t),k(t);else if(function(t){return!!t&&t.nodeType===t.ELEMENT_NODE}(t)){const{attributes:i=[],classes:u=[],children:c,require:a=[],allowEmpty:s}=n[o];if(c&&!s&&J(t))return void q(t);if(t.hasAttributes()&&(Array.from(t.attributes).forEach((({name:e})=>{"class"===e||i.includes(e)||t.removeAttribute(e)})),t.classList&&t.classList.length)){const e=u.map((t=>"string"==typeof t?e=>e===t:t instanceof RegExp?e=>t.test(e):rt));Array.from(t.classList).forEach((n=>{e.some((t=>t(n)))||t.classList.remove(n)})),t.classList.length||t.removeAttribute("class")}if(t.hasChildNodes()){if("*"===c)return;if(c)a.length&&!t.querySelector(a.join(","))?(ot(t.childNodes,e,n,r),k(t)):t.parentNode&&"BODY"===t.parentNode.nodeName&&et(t)?(ot(t.childNodes,e,n,r),Array.from(t.childNodes).some((t=>!et(t)))&&k(t)):ot(t.childNodes,e,c,r);else for(;t.firstChild;)q(t.firstChild)}}}))}function it(t,e,n){const r=document.implementation.createHTMLDocument("");return r.body.innerHTML=t,ot(r.body.childNodes,r,e,n),r.body.innerHTML}function ut(t){const e=Array.from(t.files);return Array.from(t.items).forEach((t=>{const n=t.getAsFile();n&&!e.find((({name:t,type:e,size:r})=>t===n.name&&e===n.type&&r===n.size))&&e.push(n)})),e}const ct={focusable:n,tabbable:r};(window.wp=window.wp||{}).dom=e}();; /*! This file is auto-generated */ !function(){"use strict";var r={d:function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o:function(r,t){return Object.prototype.hasOwnProperty.call(r,t)},r:function(r){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})}},t={};function e(r,t){if(r===t)return!0;const e=Object.keys(r),n=Object.keys(t);if(e.length!==n.length)return!1;let o=0;for(;o