1(()=>{"use strict";var e={n:r=>{var a=r&&r.__esModule?()=>r.default:()=>r;return e.d(a,{a}),a},d:(r,a)=>{for(var t in a)e.o(a,t)&&!e.o(r,t)&&Object.defineProperty(r,t,{enumerable:!0,get:a[t]})},o:(e,r)=>Object.prototype.hasOwnProperty.call(e,r)};const r=window.wp.element,a=window.wp.domReady;var t=e.n(a);const i=window.wp.i18n,n=window.ReactJSXRuntime,o=function({type:e="button",onClick:r=()=>{},selected:a=!1,disabled:t=!1,customClass:i,children:o,ariaLabel:s}){const l=["df_button",a&&"df_button--selected",i&&i];return(0,n.jsx)("button",{className:l.filter(Boolean).join(" "),disabled:t,"aria-label":s,onClick:e=>(e=>{e.preventDefault(),r(e)})(e),type:e,children:o})},s=window.React,l=function({autocomplete:e=null,label:r,minlength:a=null,maxlength:t=null,name:i,onChange:o,extraClassName:l=null,pattern:d=null,placeholder:m=null,type:c="text",required:p=!1,disabled:b=!1,value:u,error:h=!1}){const[y,k]=(0,s.useState)(u??!1),[_,f]=(0,s.useState)(!1),v=["df_text",_&&"df_text--used",y&&"df_text--active",h&&"df_text--error",l];return(0,s.useEffect)(()=>{k(u??!1)},[u]),(0,n.jsxs)("div",{className:v.filter(Boolean).join(" "),children:[(0,n.jsx)("input",{"aria-required":p,autoComplete:e,className:"df_text__input",id:i,maxLength:t,minLength:a,name:i,onBlur:()=>(f(!0),void(!u&&k(!1))),onChange:e=>o(e.target.value),onFocus:()=>k(!0),pattern:d,required:p,placeholder:m?m+(p?"*":""):r+(p?"*":""),type:c,value:u,disabled:b}),h&&(0,n.jsx)("div",{children:h.map((e,r)=>(0,n.jsx)("div",{children:e},r))})]})},d=function({checked:e,name:r,id:a,label:t,onChange:i,disabled:o}){return(0,n.jsxs)("div",{className:"df_radio",children:[(0,n.jsx)("input",{checked:e,className:"df_radio__input",id:a??r,name:r,onChange:e=>i(e.target.value),type:"radio",disabled:o}),(0,n.jsx)("label",{className:"df_radio__label",htmlFor:a??r,children:t})]})},m={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let c;const p=new Uint8Array(16),b=[];for(let e=0;e<256;++e)b.push((e+256).toString(16).slice(1));const u=function(e,r,a){if(m.randomUUID&&!r&&!e)return m.randomUUID();const t=(e=e||{}).random??e.rng?.()??function(){if(!c){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");c=crypto.getRandomValues.bind(crypto)}return c(p)}();if(t.length<16)throw new Error("Random bytes length must be >= 16");if(t[6]=15&t[6]|64,t[8]=63&t[8]|128,r){if((a=a||0)<0||a+16>r.length)throw new RangeError(`UUID byte range ${a}:${a+15} is out of buffer bounds`);for(let e=0;e<16;++e)r[a+e]=t[e];return r}
1return function(e,r=0){return(b[e[r+0]]+b[e[r+1]]+b[e[r+2]]+b[e[r+3]]+"-"+b[e[r+4]]+b[e[r+5]]+"-"+b[e[r+6]]+b[e[r+7]]+"-"+b[e[r+8]]+b[e[r+9]]+"-"+b[e[r+10]]+b[e[r+11]]+b[e[r+12]]+b[e[r+13]]+b[e[r+14]]+b[e[r+15]]).toLowerCase()}(t)};function h(e,r,a){window.dataLayer&&window.dataLayer.push({event:"begin_membership",uuid:a.uuid,membershipType:e.membershipTypeValue,paymentMethod:r,value:e.amount,data:e})}function y(e,r,a,t){const i={event:"membership",type:e,label:r,amount:a,paymentMethod:t,timestamp:Date.now()};let n="parkinson_conversion_data="+encodeURIComponent(JSON.stringify(i))+";path=/;max-age=300;SameSite=Lax";"https:"===window.location.protocol&&(n+=";Secure"),document.cookie=n}const k=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("path",{d:"M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",stroke:"#CC071E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M12 8V12",stroke:"#CC071E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M12 16H12.01",stroke:"#CC071E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),_=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"24",viewBox:"0 0 25 24",fill:"none",children:[(0,n.jsx)("path",{d:"M21.5 4H3.5C2.39543 4 1.5 4.89543 1.5 6V18C1.5 19.1046 2.39543 20 3.5 20H21.5C22.6046 20 23.5 19.1046 23.5 18V6C23.5 4.89543 22.6046 4 21.5 4Z",stroke:"black",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M1.5 8H23.5",stroke:"black",strokeWidth:"2",strokeLinejoin:"round"})]}),f=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:[(0,n.jsx)("path",{d:"M19 12H5",stroke:"#214682",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),(0,n.jsx)("path",{d:"M12 19L5 12L12 5",stroke:"#214682",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),v=function({formConfig:e}){const a=e.homeurl??"",t=e.thankyoupageurl??"",s=e.orderdescription??"",m=e.formtitle??(0,i.__)("Become a member","parkinson-block-library"),c=e.formdescription??"",p=JSON.parse(e.membershiptypes)??[],b=parseInt(e.defaultmembershiptype,10)??1001,v=e.forminstance??0,g=p.find(e=>e.value===b)||p[0],[w,N]=(0,r.useReducer)((e,r)=>({...e,...r}),{loading:!1,step:1,membershipTypeValue:g?.value??1001,membershipLabel:g?.label??"",amount:g?.price??550,firstName:"",lastName:"",birthday:"",address:"",postcode:"",city:"",mobile:"",email:"",relativeFirstName:"",relativeLastName:"",errors:{},message:""}),{loading:j,step:x,membershipTypeValue:C,firstName:L,lastName:T,birthday:S,address:P,postcode:U,city:V,mobile:D,email:M,relativeFirstName:O,relativeLastName:E,message:F,errors:I}=w,q=p.find(e=>e.value===C),R=q?.requiresRelativeInfo??!1,B=(e="vipps")=>{const r={},a=(e,a)=>{void 0===r[e]&&(r[e]=[]),r[e].push(a)};"vipps"!==e&&(L.trim()||a("firstName",(0,i.__)("Please enter your first name","parkinson-block-library")),T.trim()||a("lastName",(0,i.__)("Please enter your last name","parkinson-block-library")),S.trim()?(e=>{const r=e.trim().match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!r)return!1;const[,a,t,i]=r,n=new Date(Date.UTC(Number(i),Number(t)-1,Number(a)));return n.getUTCFullYear()===Number(i)&&n.getUTCMonth()===Number(t)-1&&n.getUTCDate()===Number(a)})(S)||a("birthday",(0,i.__)("Please enter your birthday in the format DD.MM.YYYY","parkinson-block-library")):a("birthday",(0,i.__)("Please enter your birthday","parkinson-block-library")),P.trim()||a("address",(0,i.__)("Please enter your address","parkinson-block-library")),U.trim()||a("postcode",(0,i.__)("Please enter your postal code","parkinson-block-library")),V.trim()||a("city",(0,i.__)("Please enter your city","parkinson-block-library")),M.trim()||a("email",(0,i.__)("Please enter your email address","parkinson-block-library")),R&&!O.trim()&&a("relativeFirstName",(0,i.__)("Please enter the first name of your relative","parkinson-block-library")),R&&!E.trim()&&a("relativeLastName",(0,i.__)("Please enter the last name of your relative","parkinson-block-library")),M.length>0&&(function(e){return/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(e).toLowerCase())}(M)||a("email",(0,i.__)("Please enter a valid email address","parkinson-block-library"))),U.length>0&&4!==U.length&&a("postcode",(0,i.__)("Please enter a valid postal code","parkinson-block-library"))),0===Object.keys(r).length?(N({errors:[]}),Y(e)):N({errors:r})},Y=(e="vipps")=>{!function(e,r="vipps",a,t,n,o){o({loading:!0,message:""});const s=(0,i.__)("Sorry, an error occurred - please try again later!","parkinson-block-library"),{membershipTypeValue:l,membershipLabel:d,amount:m,firstName:c,lastName:p,birthday:b,address:k,postcode:_,city:f,mobile:v,email:g,relativeFirstName:w,relativeLastName:N}=a,j=function(e){const r=e.trim().match(/^(\d{2})\.(\d{2})\.(\d{4})$/);if(!r)return e;const[a,t,i]=r,n=new Date(Date.UTC(Number(i),Number(t)-1,Number(a)));return n.getUTCFullYear()!==Number(i)||n.getUTCMonth()!==Number(t)-1||n.getUTCDate()!==Number(a)?e:n.toISOString()}(b);switch(r){case"avtalegiro":fetch(e+"/wp-json/parkinson-become-member/v1/membership/avtalegiro",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({membershipTypeValue:l,membershipLabel:d,amount:m,firstName:c,lastName:p,birthday:j,address:k,postcode:_,city:f,mobile:v,email:g,relativeFirstName:w,relativeLastName:N,thankyouPageUrl:t,orderDescription:n})}).then(e=>{if(200!==e.status)throw new Error((0,i.__)("Network response was not ok","parkinson-block-library"));return e.json()}).then(e=>{const t={datetime:(new Date).toISOString(),uuid:u(),membershipType:a.membershipTypeValue,paymentMethod:r,value:a.amount};if(h(a,r,t),y(a.membershipTypeValue,a.membershipLabel,m,"avtalegiro"),e.url&&e.data){const r=document.createElement("form");
1r.method="POST",r.action=e.url,Object.keys(e.data).forEach(a=>{const t=document.createElement("input");t.type="hidden",t.name=a,t.value=e.data[a],r.appendChild(t)}),document.body.appendChild(r),r.submit()}else e.redirect?window.location.href=e.redirect:o({loading:!1,message:s})}).catch(e=>{console.error(e),o({loading:!1,message:s})});break;case"vipps":fetch(e+"/wp-json/parkinson-become-member/v1/membership/vipps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({membershipTypeValue:l,amount:m,relativeFirstName:w,relativeLastName:N,thankyouPageUrl:t})}).then(e=>{if(200!==e.status)throw new Error((0,i.__)("Network response was not ok","parkinson-block-library"));return e.json()}).then(e=>{if(e.redirect){const t={datetime:(new Date).toISOString(),uuid:u(),membershipType:a.membershipTypeValue,paymentMethod:r,value:a.amount};h(a,r,t),y(a.membershipTypeValue,a.membershipLabel,a.amount,"vipps"),window.location.href=e.redirect}else o({loading:!1,message:s})}).catch(e=>{console.error(e),o({loading:!1,message:s})});break;case"giro":fetch(e+"/wp-json/parkinson-become-member/v1/membership/giro",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({membershipTypeValue:l,amount:m,firstName:c,lastName:p,birthday:j,address:k,postcode:_,city:f,mobile:v,email:g,relativeFirstName:w,relativeLastName:N,thankyouPageUrl:t,orderDescription:n})}).then(e=>{if(200!==e.status)throw new Error((0,i.__)("Network response was not ok","parkinson-block-library"));return e.json()}).then(e=>{if(e.redirect){const t={datetime:(new Date).toISOString(),uuid:u(),membershipType:a.membershipTypeValue,paymentMethod:r,value:a.amount};h(a,r,t),y(a.membershipTypeValue,a.membershipLabel,a.amount,"giro"),window.location.href=e.redirect}else o({loading:!1,message:s})}).catch(e=>{console.error(e),o({loading:!1,message:s})});break;case"card":fetch(e+"/wp-json/parkinson-become-member/v1/membership/card",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({membershipTypeValue:l,amount:m,firstName:c,lastName:p,birthday:j,address:k,postcode:_,city:f,mobile:v,email:g,relativeFirstName:w,relativeLastName:N,thankyouPageUrl:t,orderDescription:n})}).then(e=>{if(200!==e.status)throw new Error((0,i.__)("Network response was not ok","parkinson-block-library"));return e.json()}).then(e=>{if(e.redirect){const t={datetime:(new Date).toISOString(),uuid:u(),membershipType:a.membershipTypeValue,paymentMethod:r,value:a.amount};h(a,r,t),y(a.membershipTypeValue,a.membershipLabel,a.amount,"card"),window.location.href=e.redirect}else o({loading:!1,message:s})}).catch(e=>{console.error(e),o({loading:!1,message:s})});break;default:console.error((0,i.sprintf)( 2// Translators: %s - payment method name. 3// Translators: %s - payment method name. 4(0,i.__)("Unknown payment method: %s","parkinson-block-library"),r))}}(a,e,w,t,s,N)},$=e=>e+v;return(0,n.jsxs)("form",{className:"parkinson-become-member-form",noValidate:!0,children:[1===x&&(0,n.jsxs)("div",{className:"df_step",id:"step1",children:[(m||c)&&(0,n.jsxs)("div",{className:"df_header",children:[m&&(0,n.jsx)("h3",{className:"df_title",children:m}),c&&(0,n.jsx)("p",{className:"df_description",children:c})]}),(0,n.jsxs)("div",{className:"df_membership-types",children:[(0,n.jsx)("p",{children:(0,i.__)("Select membership type","parkinson-block-library")}),p.map(e=>(0,n.jsx)(d,{checked:C===e.value,name:"membershipType",id:$(`membership-type-${e.value}`),label:`${e.label} ${e.price},â`,onChange:()=>(e=>{const r=p.find(r=>r.value===e);r&&N({membershipTypeValue:r.value,membershipLabel:r.label,amount:r.price})})(e.value),disabled:j},e.value))]}),R&&(0,n.jsxs)("div",{className:"df_relative-info",children:[(0,n.jsx)("p",{className:"df_relative-info__title",children:(0,i.__)("The person you are a relative of","parkinson-block-library")}),(0,n.jsxs)("div",{className:"df_relative-info__fields",children:[(0,n.jsx)(l,{name:$("relativeFirstName"),label:(0,i.__)("First name","parkinson-block-library"),onChange:e=>N({relativeFirstName:e}),value:O,error:I.relativeFirstName??null,disabled:j,required:!0}),(0,n.jsx)(l,{name:$("relativeLastName"),label:(0,i.__)("Last name","parkinson-block-library"),onChange:e=>N({relativeLastName:e}),value:E,error:I.relativeLastName??null,disabled:j,required:!0})]})]}),(0,n.jsxs)("div",{className:"df_actions",children:[(0,n.jsx)(o,{onClick:()=>B("vipps"),type:"submit",customClass:j?"df_button--loading":null,disabled:j,ariaLabel:(0,i.__)("Pay by Vipps","parkinson-block-library"),children:(0,i.__)("Pay by Vipps","parkinson-block-library")}),(0,n.jsx)(o,{onClick:()=>N({step:2}),disabled:j,ariaLabel:(0,i.__)("Other payment options","parkinson-block-library"),children:(0,i.__)("Other payment options","parkinson-block-library")})]})]}),2===x&&(0,n.jsxs)("div",{className:"df_step",id:"step2",children:[(0,n.jsx)("div",{className:"df_back",children:(0,n.jsxs)(o,{onClick:()=>N({step:1}),disabled:j,ariaLabel:(0,i.__)("Go back","parkinson-block-library"),children:[(0,n.jsx)(f,{}),(0,i.__)("Go back","parkinson-block-library")]})}),(0,n.jsx)("p",{className:"df_title",children:(0,i.__)("Tell us a little about yourself","parkinson-block-library")}),(0,n.jsxs)("div",{className:"df_fields",children:[(0,n.jsx)(l,{name:$("firstname"),label:(0,i.__)("First name","parkinson-block-library"),onChange:e=>N({firstName:e}),value:L,error:I.firstName??null,disabled:j,required:!0}),(0,n.jsx)(l,{name:$("lastname"),label:(0,i.__)("Last name","parkinson-block-library"),onChange:e=>N({lastName:e}),value:T,error:I.lastName??null,disabled:j,required:!0}),(0,n.jsx)(l,{name:$("birthday"),label:(0,i.__)("Birthday","parkinson-block-library"),placeholder:(0,i.__)("Birthday (DD.MM.YYYY)","parkinson-block-library"),autocomplete:"bday",onChange:e=>N({birthday:e}),value:S,error:I.birthday??null,disabled:j,required:!0}),(0,n.jsx)(l,{name:$("address"),label:(0,i.__)("Address","parkinson-block-library"),onChange:e=>N({address:e}),value:P,error:I.address??null,disabled:j,required:!0}),(0,n.jsxs)("div",{className:"post_city",children:[(0,n.jsx)(l,{name:$("postcode"),label:(0,i.__)("Postal no","parkinson-block-library"),extraClassName:"postcode",onChange:e=>N({postcode:e}),value:U,error:I.postcode??null,disabled:j,required:!0}),(0,n.jsx)(l,{name:$("city"),label:(0,i.__)("City","parkinson-block-library"),extraClassName:"city",onChange:e=>N({city:e}),value:V,error:I.city??null,disabled:j,required:!0})]}),(0,n.jsx)(l,{name:$("email"),label:(0,i.__)("Email","parkinson-block-library"),onChange:e=>N({email:e}),value:M,error:I.email??null,disabled:j,required:!0}),(0,n.jsx)(l,{name:$("mobile"),label:(0,i.__)("Mobile (optional)","parkinson-block-library"),onChange:e=>N({mobile:e}),value:D,disabled:j})]}),(0,n.jsxs)("div",{className:"df_actions df_actions--payment-options",children:[(0,n.jsx)(o,{onClick:()=>B("avtalegiro"),type:"submit",customClass:j?"df_button--loading":null,disabled:j,ariaLabel:(0,i.__)("AvtaleGiro","parkinson-block-library"),children:(0,i.__)("AvtaleGiro","parkinson-block-library")}),(0,n.jsx)(o,{onClick:()=>B("giro"),type:"submit",customClass:j?"df_button--loading":null,disabled:j,ariaLabel:(0,i.__)("Pay by giro","parkinson-block-library"),children:(0,i.__)("Giro","parkinson-block-library")}),(0,n.jsxs)(o,{onClick:()=>B("card"),type:"submit",customClass:j?"df_button--loading":null,disabled:j,ariaLabel:(0,i.__)("Pay by card","parkinson-block-library"),children:[(0,i.__)("Pay by card","parkinson-block-library"),(0,n.jsx)(_,{})]})]})]}),""!==F&&(0,n.jsxs)("div",{className:"df_message df_message--error",children:[(0,n.jsx)(k,{}),F]})]})};t()(()=>{const e=new Event("BecomeMemberFormRenderEvent");document.addEventListener("BecomeMemberFormRenderEvent",()=>{let e=0;document.querySelectorAll(".parkinson-become-member:not(.wp-block)").forEach(a=>{(0,r.render)((0,n.jsx)(v,{formConfig:{...a.dataset,forminstance:e}}),a),window.dataLayer&&window.dataLayer.push({event:"become_member_form_view",formType:"become_member",formInstance:e}),e++})}),document.dispatchEvent(e)})})();
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.