!function(){"use strict";var e={69:function(e,t,r){r.d(t,{Vd:function(){return n}});const n="https://longnow.org"}},t={};function r(n){var o=t[n];if(void 0!==o)return o.exports;var i=t[n]={exports:{}};return e[n](i,i.exports,r),i.exports}r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){function e(e){for(var t=1;t-1)){var o=e.getAttribute("height")||e.offsetHeight,i=e.getAttribute("width")||e.offsetWidth,a=("string"==typeof o?parseInt(o):o)/("string"==typeof i?parseInt(i):i)*100,s=document.createElement("div");s.className=t;var l=s.style;l.position="relative",l.width="100%",l.paddingTop=a+"%";var c=e.style;c.position="absolute",c.width="100%",c.height="100%",c.left="0",c.top="0",null===(r=e.parentNode)||void 0===r||r.insertBefore(s,e),null===(n=e.parentNode)||void 0===n||n.removeChild(e),s.appendChild(e)}}))},a=r(69);Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(e){var t=this;do{if(t.matches(e))return t;t=t.parentElement||t.parentNode}while(null!==t&&1===t.nodeType);return null});const s=(e,t)=>{if(!e)throw new Error("Dom needs a selector");return t?t.querySelector(e):document.querySelector(e)},l=e=>document.createElement(e),c=function(e,t,r,n){if(!e)throw new Error("Dom needs an el to attach event to");if(!t)throw new Error("Dom needs an event to listen for");if(!r||"function"!=typeof r)throw new Error("Dom needs a valid callback");e.addEventListener(t,r,n||!1)},d=["January","February","March","April","May","June","July","August","September","October","November","December"],u=e=>{let t=e.substring(0,10);t=t.split("-");return`${d[t[1]-1]} ${t[2].replace(/(^|-)0+/g,"$1")}, 0${t[0]}`},p=(e,t)=>{for(let r of t.media)if("full-video-youtube"==r.kind){e.classList.add("talk-video");const t=l("div");t.setAttribute("id","talk-video-frame"),t.setAttribute("class","talk-video-frame"),t.innerHTML=``,e.insertBefore(t,e.firstChild),i("#talk-video-frame iframe")}},f=(e,t)=>{fetch(`${a.Vd}/api/v1/event/${e}/`).then((e=>e.json())).then((e=>{if("page-talk"==t.id){const t=s("#talk-data-photo");if(t&&e.icon){const r=l("div");r.className="person-photo",r.style.backgroundImage=`url(${e.icon})`,t.appendChild(r);const o=s("#talk-data-series");o&&e.series&&"interval"==e.series[0].slug&&(o.classList.add("talk-series-interval"),c(o,"click",(()=>{window.location="/ideas/category/conversations-at-the-interval/"})));const i=s("#talk-data-details-archived");if(i&&e.date){const t=l("p");t.classList.add("talk-date"),t.textContent=u(e.date),i.appendChild(t)}const a=s("#talk-data-details-upcoming");if(a){let t="";if(e.date&&(t+=u(e.date),t+=(e=>{let t=e.substring(11,16);t=t.split(":");let r="am";return t[0]>=13&&(t[0]=t[0]-12,r="pm"),` at ${t[0]}:${t[1]}${r} PT`})(e.date)),e.location&&e.location.name&&(e.is_virtual?t="Watch the livestream here on "+t:e.location.map_url?t+=` at ${e.location.name}`:t+=` at ${e.location.name}`),""!==t){const e=l("p");e.classList.add("talk-location"),e.innerHTML=t,a.appendChild(e)}if(e.ticket_url){const t=l("a");t.setAttribute("target","_blank"),t.setAttribute("rel","noopener"),t.classList.add("talk-tickets"),t.classList.add("button"),t.classList.add("primary");const r=l("span");r.classList.add("talk-ticketmessage"),e.member_rsvp_url?(t.textContent="Tickets / RSVP",n.get("lnu")?(t.setAttribute("href",e.member_rsvp_url),e.member_discount_code&&(r.textContent=`Member code: ${e.member_discount_code}`)):(t.setAttribute("href",e.ticket_url),c(r,"click",(()=>{s("#membership-opener").click()})),r.setAttribute("style","cursor: default;"),r.textContent="Sign in for member code")):(t.textContent="Buy Tickets",t.setAttribute("href",e.ticket_url)),a.appendChild(t),a.appendChild(r)}else if(!e.is_virtual){const e=l("input");e.setAttribute("type","submit"),e.setAttribute("disabled","disabled"),e.classList.add("button"),e.value="Tickets on sale soon",a.appendChild(e)}}const d=s("#talk-video");d&&e.media&&p(d,e);const f=document.getElementById("editor-content");if(e.presenters)for(let t of e.presenters){const e=document.createElement("div");e.innerHTML=`

About ${t.first_name} ${t.last_name}

${t.bio}`,f.appendChild(e)}}}else if("talks-livenow"==t.id){const t=s("#talk-livenow");t&&e.media&&p(t,e)}else{const r=s(".card-content",t);if(e.date&&r){const t=l("p");t.classList.add("talk-date"),t.textContent=u(e.date),r.insertBefore(t,r.firstChild)}}}))};var m;m=()=>{const e=s("#page-talk");e&&f(e.dataset.slug,e);const t=s("#talks-livenow");t&&f(t.dataset.slug,t);for(let e of((e,t)=>{if(!e)throw new Error("Dom needs a selector");return t?t.querySelectorAll(e):document.querySelectorAll(e)})(".talk-card"))f(e.dataset.slug,e)},"loading"!=document.readyState?m():document.addEventListener("DOMContentLoaded",m)}()}();