!function(){var e,t,n,r,o,i={733:function(e,t,n){"use strict";n.d(t,{Cd:function(){return r}}),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 r=e=>{"loading"!=document.readyState?e():document.addEventListener("DOMContentLoaded",e)}},69:function(e,t,n){"use strict";n.d(t,{Vd:function(){return r},Sg:function(){return o}});const r="https://longnow.org",o="pk_live_SOGmWVYZLwxDjw9R9Cn119Yc"},473:function(e,t,n){"use strict";n.a(e,(async function(e){var t=n(955),r=n(894),o=n(69),i=n(733);const c=["bronze","stainless","monel","tungsten","cam","tenthousand","donate","join"],s=await(0,r.loadStripe)(o.Sg),a=s.elements({fonts:[{cssSrc:"https://fonts.googleapis.com/css?family=Overpass"}]}),d={style:{base:{color:"rgba(42, 57, 61, 1)",fontWeight:"400",fontFamily:"Overpass, sans-serif",fontSize:"16px","::placeholder":{color:"rgba(42, 57, 61, .5)"}},invalid:{iconColor:"rgba(221, 85, 85, 1)",color:"rgba(221, 85, 85, 1)"}}},l=a.create("cardNumber",d);l.mount("#stripe-card-number");const u=a.create("cardExpiry",d);u.mount("#stripe-card-expiry");const m=a.create("cardCvc",d);m.mount("#stripe-card-cvc");const p=e=>{document.getElementById(e).classList.toggle("focus")};l.on("focus",(function(e){p("stripe-card-number")})),l.on("blur",(function(e){p("stripe-card-number")})),u.on("focus",(function(e){p("stripe-card-expiry")})),u.on("blur",(function(e){p("stripe-card-expiry")})),m.on("focus",(function(e){p("stripe-card-cvc")})),m.on("blur",(function(e){p("stripe-card-cvc")}));const g=document.getElementById("payment-form"),f=document.getElementById("form-button"),h="Agree and join",y="Donate",v=document.getElementById("loading-indicator"),b=(e,t)=>{let n;if(Array.isArray(e)){n="
";for(let t of e)n+=`- ${t}
`;n+="
"}else n=`${e}
`;const r=document.getElementById("response-error");r.classList.remove("hidden"),r.innerHTML="Uh oh...
"+n,v.classList.add("hidden"),f.disabled=!1,f.value=t?h:y},E=e=>{document.getElementById(e).disabled=!1,document.getElementById(e).required=!0},_=e=>{document.getElementById(e).required=!1,document.getElementById(e).disabled=!0},w=document.getElementById("join-button"),S=document.getElementById("donate-button"),L=e=>{const t=document.getElementById("form-button"),n=document.getElementById("make-contribution");n.classList.remove(...c);const r=["full_name","username","password","membership_level","cc_recurring","shipping_name","shipping_line1","shipping_city","shipping_state","shipping_zip","shipping_country"],o=["donation_amount"];if("donate"==e)window.location="#donate",n.classList.add(e),o.forEach((e=>E(e))),r.forEach((e=>_(e))),_("signup_reason"),_("shipping_line2"),t.value=y;else{const i=document.getElementById("membership_level");switch(n.classList.add(e),n.classList.add("join"),r.forEach((e=>E(e))),o.forEach((e=>_(e))),e){case"bronze":window.location="#bronze",i.value="7",I(8);break;case"stainless":window.location="#stainless",i.value="1",I(12);break;case"monel":window.location="#monel",i.value="2",I(30);break;case"tungsten":window.location="#tungsten",i.value="3",I(80);break;case"cam":window.location="#cam",i.value="4";const e=document.getElementById("per-month"),t=document.getElementById("per-quarter"),n=document.getElementById("per-year"),r=document.getElementById("cc_recurring");n.innerHTML="$2500 per year",r.value="YEAR",e.classList.add("hidden"),t.classList.add("hidden");break;case"tenthousand":window.location="#tenthousand",document.getElementById("details_tenthousand").scrollIntoView()}t.value=h}},I=e=>{const t=document.getElementById("per-month"),n=document.getElementById("per-quarter"),r=document.getElementById("per-year");t.classList.remove("hidden"),n.classList.remove("hidden"),t.innerHTML="$"+e+" per month",n.innerHTML="$"+3*e+" per quarter",r.innerHTML="$"+12*e+" per year"},B=e=>{const t=document.getElementById("donation_amount");"other"==e?(t.value="",t.focus()):(t.value=e,l.focus())};i.Cd((()=>{(()=>{const e=document.getElementById("next-member");fetch(`${o.Vd}/api/v1/membership/next`).then((e=>e.json())).then((t=>{e.innerHTML=t.membership_number.toLocaleString("en-US")}))})();const e=location.hash.substring(1);c.includes(e)&&L(e),w.addEventListener("click",(e=>{L("stainless")})),S.addEventListener("click",(e=>{L("donate")}));document.getElementById("choose-bronze").addEventListener("click",(e=>{L("bronze")}));document.getElementById("choose-stainless").addEventListener("click",(e=>{L("stainless")}));document.getElementById("choose-monel").addEventListener("click",(e=>{L("monel")}));document.getElementById("choose-tungsten").addEventListener("click",(e=>{L("tungsten")}));document.getElementById("choose-cam").addEventListener("click",(e=>{L("cam")}));document.getElementById("choose-tenthousand").addEventListener("click",(e=>{L("tenthousand")}));const n=document.getElementById("membership_level"),r=["","stainless","monel","tungsten","cam","tenthousand","","bronze"];n.addEventListener("change",(e=>{let t=n.options[n.selectedIndex].value;L(r[t])}));document.getElementById("donate-100").addEventListener("click",(e=>{B(100)}));document.getElementById("donate-1000").addEventListener("click",(e=>{B(1e3)}));document.getElementById("donate-10000").addEventListener("click",(e=>{B(1e4)}));document.getElementById("donate-other").addEventListener("click",(e=>{B("other")}));const i=["shipping_name","shipping_line1","shipping_line2","shipping_city","shipping_state","shipping_zip","shipping_country"],a=document.getElementById("single_address"),d=document.getElementById("billing_fields");a.addEventListener("change",(function(){this.checked?(d.classList.add("hidden"),i.forEach((e=>_(e)))):(d.classList.remove("hidden"),i.forEach((e=>E(e))))})),g.addEventListener("submit",(e=>{(e=>{e.preventDefault(),v.classList.remove("hidden"),f.value="Working, please wait...",f.disabled=!0,gtag("event","click",{event_category:"SignupSubmitButtonClicked"});const n=new FormData(e.target);let r=Object.fromEntries(n.entries()),i=!r.donation_amount;const c={name:r.billing_name,address_line1:r.billing_line1,address_line2:r.billing_line2,address_city:r.billing_city,address_state:r.billing_state,address_zip:r.billing_zip,address_country:r.billing_country};s.createToken(l,c).then((function(e){if(e.error)gtag("event","error",{event_category:"SignupStripeError",value:e.error.message}),b(e.error.message,i);else{gtag("event","click",{event_category:"SignupStripeSuccess"}),r.stripe_token=e.token.id,document.getElementById("single_address").checked&&(r.shipping_name=r.billing_name,r.shipping_line1=r.billing_line1,r.shipping_line2=r.billing_line2,r.shipping_city=r.billing_city,r.shipping_state=r.billing_state,r.shipping_zip=r.billing_zip,r.shipping_country=r.billing_country);const c={Accept:"application/json","Content-Type":"application/json"},s=t.Z.get("csrftoken");s&&(c["X-CSRFToken"]=s),fetch(`${o.Vd}/api/v1/membership/`,{method:"post",headers:c,body:JSON.stringify(r)}).then((e=>{if(!e.ok)throw gtag("event","error",{event_category:"SignupDjangoBackendError",value:n.errors}),Error("Something went wrong. You have not been charged. Please contact membership@longnow.org or try again later.");return e.json()})).then((e=>{if(e.errors){gtag("event","error",{event_category:"SignupFormValidationError",value:e.errors});let t=[];document.querySelectorAll(".field-error-msg").forEach((e=>e.remove()));for(const[n,r]of Object.entries(e.errors)){let e=document.getElementById(n);if(e){e.classList.add("field-error");let t=e.parentElement,n=t.parentElement,o=document.createElement("div");o.className="field-error-msg",n.insertBefore(o,t),o.innerHTML=`${r}`}t.push(r)}document.querySelectorAll(".field-error").forEach((e=>{e.addEventListener("input",(t=>{e.parentElement.previousElementSibling.remove(),e.classList.remove("field-error")}),{once:!0})})),b(t,i)}else if(document.getElementById("join-pre-submit").classList.add("hidden"),gtag("event","click",{event_category:"SignupFormSubmitted"}),i){if(e.membership_number){let t=e.membership_number.toLocaleString("en-US");document.getElementById("new_member_number").innerHTML="Long Now Member "+t}document.getElementById("join-post-submit").classList.remove("hidden"),window.scrollTo(0,0)}else document.getElementById("donate-post-submit").classList.remove("hidden"),window.scrollTo(0,0)})).catch((e=>{let t=e.message;"TypeError"==e.name&&(t="There is a problem with the network. You have not been charged. Please check your internet connection and try again."),b(t,i)}))}}))})(e)}))})),e()}),1)},597:function(e,t){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}var r,o="https://js.stripe.com/v3",i=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/,c="loadStripe.setLoadParameters was called but an existing Stripe.js script already exists in the document; existing script parameters will be used",s=null,a=function(e){return null!==s||(s=new Promise((function(t,n){if("undefined"!=typeof window)if(window.Stripe&&e&&console.warn(c),window.Stripe)t(window.Stripe);else try{var r=function(){for(var e=document.querySelectorAll('script[src^="'.concat(o,'"]')),t=0;t element.");return r.appendChild(n),n}(e)),r.addEventListener("load",(function(){window.Stripe?t(window.Stripe):n(new Error("Stripe.js not available"))})),r.addEventListener("error",(function(){n(new Error("Failed to load Stripe.js"))}))}catch(e){return void n(e)}else t(null)}))),s},d=function(e,t,n){if(null===e)return null;var r=e.apply(void 0,t);return function(e,t){e&&e._registerWrapper&&e._registerWrapper({name:"stripe-js",version:"1.20.3",startTime:t})}(r,n),r},l=!1,u=function(){for(var e=arguments.length,t=new Array(e),n=0;n