PageSourceSearch

https://mailbook.nl/build/chunk-gift-b88b6ba75fd17600c85a.js

js mailbook.nl collected 2026-10-08 04:29:58 UTC 98,208 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[453],{652:function(e,t,n){n.r(t),n.d(t,{default:function(){return G}});var a=n(390),o=n(856),r=n(194),i=n(699),s=n(168),l=n(413),c=n(906),m=n(919),d=n(341),u=n(264);const h=352,p=.2,y=1.8,g=(e,t,n)=>Math.min(n,Math.max(t,e));function f(e){const t=43758.5453*Math.sin(12.9898*e+78.233);return t-Math.floor(t)}const b=[],k={radius:150,index:0,count:0,start:0};function v(){k.index>=k.count&&(k.radius+=14,k.count=Math.ceil(2*Math.PI*k.radius/22),k.start=2*f(k.radius)*Math.PI,k.index=0);const e=k.start+2*k.index*Math.PI/k.count;return k.index+=1,{x:Math.cos(e)*k.radius*1.25,y:Math.sin(e)*k.radius}}function w(e,t){const n=1.15*h;return!(Math.abs(e)<438.8&&Math.abs(t)<393.8)&&b.every(a=>(Math.abs(a.x-e)>=n||Math.abs(a.y-t)>=n)&&Math.hypot(a.x-e,a.y-t)>=545.6)}const A="mailbook-board";function E(){const e=new URLSearchParams(window.location.search).get("bord");try{return"auto"===e&&window.localStorage.removeItem(A),"stapel"!==e&&"vrij"!==e||window.localStorage.setItem(A,e),window.localStorage.getItem(A)}catch(t){return"stapel"===e||"vrij"===e?e:null}}function x(e){const t=window.location.hash;t&&!/^#(card|source)=/i.test(t)||window.history.replaceState(null,"",window.location.pathname+window.location.search+(e?`#card=${e}`:""))}function j(e,t){const n=new Set(e.map(e=>e.position)),a=[];for(let e=0;a.length<t;e++)n.has(e)||a.push(e);return a}const N=["#fe9240","#c0392b","#dda159","#e8a0a0","#8fcfae","#f2c14e"],O=["strip","dot","curl","square"];function C(e,t,n,a){return Array.from({length:e},(e,o)=>{const r=2*f(o+101)*Math.PI,i=t+f(o+103)*n;return{shape:O[o%O.length],style:{"--x":`${Math.round(Math.cos(r)*i*1.3)}px`,"--y":`${Math.round(Math.sin(r)*i*.7-a-f(o+105)*a*1.15)}px`,"--fall":`${Math.round((300+360*f(o+107))*(a/140))}px`,"--spin":`${Math.round(1080*(f(o+109)-.5))}deg`,"--flutter":`${(.4+.5*f(o+111)).toFixed(2)}s`,"--time":`${(2+f(o+113)).toFixed(2)}s`,"--color":N[o%N.length]}}})}const $=C(64,260,460,140),S={stapel:'<svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><rect x="5" y="2.5" width="10" height="6" rx="1.5" fill="none" stroke="currentColor" stroke-width="2"/><rect x="5" y="11.5" width="10" height="6" rx="1.5" fill="none" stroke="currentColor" stroke-width="2"/></svg>',vrij:'<svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><rect x="2" y="3" width="7" height="6" rx="1.5" fill="none" stroke="currentColor" stroke-width="2" transform="rotate(-8 5.5 6)"/><rect x="11" y="6" width="7" height="6" rx="1.5" fill="none" stroke="currentColor" stroke-width="2" transform="rotate(7 14.5 9)"/><rect x="5" y="12" width="7" height="6" rx="1.5" fill="none" stroke="currentColor" stroke-width="2" transform="rotate(4 8.5 15)"/></svg>'};function M(e,t){const n=e<700,a=n?Math.min(e-32,.4*t):Math.min(500,.6*t,e-320);return{size:Math.round(a),lift:Math.round(t*(n?.14:.06)),narrow:n}}function P({title:e,description:t,recipientName:n,paper:r,felicitaties:i,owner:s,onClaim:l,editing:k,focusKey:N,off:O}){const C=(0,c.li)(null),P=(0,c.li)(null),D=(0,c.li)({x:0,y:0,z:1}),z=(0,c.li)(new Map),B=(0,c.li)(null),K=(0,c.li)(null),F=(0,c.li)(!1),H=(0,c.li)({x:0,y:0,z:1}),I=(0,c.li)([]),_=(0,c.li)(!1),W=(0,c.li)(!1),Y=(0,c.li)(!1);W.current=null!==k;const[V,J]=(0,c.J0)(1),G=(0,c.li)((window.location.hash.match(/card=([a-z0-9]+)/i)||[])[1]||null),[R,U]=(0,c.J0)(!G.current&&!O),q=(0,c.li)(new Set),[X,Z]=(0,c.J0)(null!==k||!!N||O),[Q,ee]=(0,c.J0)(null),[te,ne]=(0,c.J0)(null),[ae,oe]=(0,c.J0)(!1),[re,ie]=(0,c.J0)(E),[se]=(0,c.J0)(()=>window.innerWidth<700),le=re?"stapel"===re:se,ce=i.filter(e=>Number.isInteger(e.position)),me=le?[...ce].sort((e,t)=>t.created-e.created):[...ce].sort((e,t)=>e.position-t.position),de=j(ce,le?1:(ue=V)>.8?3:ue>.5?4:ue>.32?6:8);var ue;I.current=ce;const he=[j(ce,1)[0],...me.map(e=>e.position)],pe=e=>{return le?{x:((t=Math.max(0,he.indexOf(e)))%2?1:-1)*(12+18*f(t+21)),y:471+412*t,tilt:8*(f(t+3)-.5),sway:5+4*f(t+11),delay:8*-f(t+13)}:function(e){for(;b.length<=e;){const e=b.length;let t=v();for(;!w(t.x,t.y);)t=v();b.push({x:t.x+50*(f(e)-.5),y:t.y+50*(f(e+7)-.5),tilt:14*(f(e+3)-.5),sway:5+4*f(e+11),delay:8*-f(e+13)})}return b[e]}(e);var t},ye=(0,c.li)(pe);ye.current=pe;const ge=(0,c.li)(le);ge.current=le;const fe=(0,c.li)(he[he.length-1]);fe.current=he[he.length-1];const be=()=>{const{x:e,y:t,z:n}=D.current;P.current.style.transform=`translate3d(${e}px, ${t}px, 0) scale(${n})`;const a=Math.round(20*n)/20;J(e=>e===a?e:a)},ke=()=>{K.current&&cancelAnimationFrame(K.current),K.current=null},ve=(e,t=e)=>{const n=C.current.getBoundingClientRect(),a=D.current.z,o=ye.current(fe.current),r=70+205*a,i=Math.min(r,n.height-130-(o.y+176+40)*a);D.current={z:a,x:n.width/2,y:g(e,Math.min(i,t),Math.max(r,t))},be()},we=(e,t,n,a=650)=>new Promise(o=>{ke();const r=C.current.getBoundingClientRect(),i={...D.current},s=n,l=r.width/2-e*n,c=r.height/2-t*n,m=window.performance.now(),d=e=>{const t=Math.min(1,(e-m)/a),n=(e=>e<.5?4*e*e*e:1-Math.pow(-2*e+2,3)/2)(t);D.current={x:i.x+(l-i.x)*n,y:i.y+(c-i.y)*n,z:i.z+(s-i.z)*n},be(),K.current=t<1?requestAnimationFrame(d):null,1===t&&o()};K.current=requestAnimationFrame(d)}),Ae=e=>{const t=C.current.getBoundingClientRect(),n=ye.current(j(I.current,1)[0]);if(le){const e=Math.min(1,(t.width-24)/460);return{x:0,y:(t.height/2-70)/e-165-40,z:e}}const a=Math.max(240,Math.abs(n.x)+176)+50,o=Math.max(190,Math.abs(n.y)+176)+40,r=Math.min(e,t.width/2/a,(t.height-110)/2/o);if(r>=.3)return{x:0,y:55/r,z:r};const i=Math.min(-240,n.x-176)-50,s=Math.max(240,n.x+176)+50,l=Math.min(-190,n.y-176)-40,c=Math.max(190,n.y+176)+40,m=g(Math.min(e,t.width/(s-i),(t.height-110)/(c-l)),p,y);return{x:(i+s)/2,y:(l+c)/2+55/m,z:m}},Ee=(e=650)=>we(H.current.x,H.current.y,H.current.z,e),xe=()=>{const e=C.current.getBoundingClientRect(),t=e.width<700,n=g(Math.min(e.width,1.4*e.height)/1384,.45,1),a=t?Math.min(1,.8*e.width/420):g(.45*e.width/420,n,1.4);return{box:e,zoom:a,rest:t?.7*a:n}};(0,c.vJ)(()=>{const{box:e,zoom:t,rest:n}=xe();D.current={x:e.width/2,y:e.height/2,z:t},be();const a=C.current;a.addEventListener("wheel",Ne,{passive:!1});const o=e=>e.preventDefault();a.addEventListener("dragstart",o),document.documentElement.classList.add("board");const r=window.setTimeout(()=>U(!1),3600),i=window.setTimeout(()=>{Z(!0),H.current=Ae(n),_.current||Ee(O?900:1100)},O?0:2400);return()=>{window.clearTimeout(r),window.clearTimeout(i),a.removeEventListener("wheel",Ne),a.removeEventListener("dragstart",o),document.documentElement.classList.remove("board"),ke()}},[]);const je=(e,t,n)=>{const a=C.current.getBoundingClientRect(),{x:o,y:r,z:i}=D.current,s=g(i*e,p,y),l=t-a.left,c=n-a.top;D.current={z:s,x:l-(l-o)*s/i,y:c-(c-r)*s/i},be()};function Ne(e){if(e.preventDefault(),W.current)return;if(_.current=!0,Z(!0),ke(),ge.current)return void ve(D.current.y-e.deltaY,D.current.y);const t=1===e.deltaMode||0===e.deltaX&&Math.abs(e.deltaY)>=50&&Number.isInteger(e.deltaY);e.ctrlKey||e.metaKey||t?je(Math.exp(-e.deltaY/(t?500:200)),e.clientX,e.clientY):(D.current={...D.current,x:D.current.x-e.deltaX,y:D.current.y-e.deltaY},be())}const Oe=e=>{z.current.delete(e.pointerId);const t=B.current;if(z.current.size)return void(B.current={camera:{...D.current},points:new Map(z.current),trail:[]});B.current=null;const n=t?t.trail:[],a=n[0],o=n[n.length-1];let r=F.current&&n.length>1&&o.t>
1a.t&&e.timeStamp-o.t<80?{x:ge.current?0:(o.x-a.x)/(o.t-a.t),y:(o.y-a.y)/(o.t-a.t)}:{x:0,y:0};if(Math.hypot(r.x,r.y)>.2){const e=ge.current?.998:.995;let t=window.performance.now();const n=a=>{const o=Math.min(48,Math.max(0,a-t));t=a;const i=D.current.y;ge.current?ve(D.current.y+r.y*o,D.current.y):(D.current={...D.current,x:D.current.x+r.x*o,y:D.current.y+r.y*o},be());const s=Math.pow(e,o);r={x:r.x*s,y:r.y*s};const l=ge.current&&o>0&&D.current.y===i;K.current=!l&&Math.hypot(r.x,r.y)>.02?requestAnimationFrame(n):null};K.current=requestAnimationFrame(n)}},Ce=e=>t=>{t.stopPropagation(),F.current||e()},$e=(e,t=!1)=>{if(_.current=!0,Z(!0),ne(e?e.key:null),x(e?e.key:null),!e)return void Ee();const n=C.current.getBoundingClientRect(),a=pe(e.position),o=le&&!t?H.current.z:g((t?.5:.7)*Math.min(n.width,n.height)/h,.5,y);we(le?0:a.x,a.y+24+(t?.2*n.height/o:0),o)},Se=e=>{const t=[null,...me],n=t.findIndex(e=>(e?e.key:null)===te);$e(t[(n+e+t.length)%t.length])};(0,c.vJ)(()=>{const e=C.current.getBoundingClientRect();if(null!==k){const{size:t,lift:n}=M(e.width,e.height),a=pe(k),o=t/h;we(a.x,a.y+n/o,o,600)}else Y.current&&Ee(600);Y.current=null!==k},[k]);const Me=(0,c.li)(le);(0,c.vJ)(()=>{if(Me.current===le)return;Me.current=le;const e=C.current.getBoundingClientRect();ne(null),x(null),H.current=Ae(le?1:g(Math.min(e.width,1.4*e.height)/1384,.45,1)),Ee(700)},[le]),(0,c.vJ)(()=>{const e=N&&ce.find(e=>e.key===N);e&&$e(e,!0)},[N,ce.length]),(0,c.vJ)(()=>{const e=G.current&&ce.find(e=>e.key===G.current);e&&(G.current=null,ce.forEach(e=>q.current.add(e.key)),de.forEach(e=>q.current.add(`ghost-${e}`)),H.current=Ae(xe().rest),$e(e))},[ce.length]);const Pe=e=>{const t=pe(e);ee(e),we(t.x,t.y,1.1,550).then(()=>l(e))};return a.Ay.createElement("div",{className:`felicitatie-board ${le?"stacked":""} ${null!==k?"editing":""} ${ae?"beckon":""}`,style:(0,d.CB)(r)},a.Ay.createElement("div",{className:"board-viewport",ref:C,onPointerDown:e=>{W.current||(_.current=!0,Z(!0),ke(),z.current.set(e.pointerId,{x:e.clientX,y:e.clientY,t:e.timeStamp}),F.current=!1,B.current={camera:{...D.current},points:new Map(z.current),trail:[]})},onPointerMove:e=>{if(!z.current.get(e.pointerId)||!B.current)return;const t={x:e.clientX,y:e.clientY,t:e.timeStamp};z.current.set(e.pointerId,t);const n=B.current,a=[...z.current.values()],o=[...n.points.values()];if(1===a.length){const e=a[0].x-o[0].x,r=a[0].y-o[0].y;if(Math.abs(e)+Math.abs(r)>6&&(F.current=!0),n.trail=[...n.trail.filter(e=>t.t-e.t<=100),t],le)return void ve(n.camera.y+r,n.camera.y);D.current={...n.camera,x:n.camera.x+e,y:n.camera.y+r},be()}else if(a.length>=2&&o.length>=2&&!le){F.current=!0;const e=C.current.getBoundingClientRect(),t=e=>Math.hypot(e[0].x-e[1].x,e[0].y-e[1].y),r=g(n.camera.z*t(a)/t(o),p,y),i={x:(a[0].x+a[1].x)/2-e.left,y:(a[0].y+a[1].y)/2-e.top},s={x:(o[0].x+o[1].x)/2-e.left,y:(o[0].y+o[1].y)/2-e.top};D.current={z:r,x:i.x-(s.x-n.camera.x)*r/n.camera.z,y:i.y-(s.y-n.camera.y)*r/n.camera.z},be()}},onPointerUp:Oe,onPointerCancel:Oe},a.Ay.createElement("div",{className:"board-world",ref:P},R?a.Ay.createElement("div",{className:"board-poef","aria-hidden":"true"},$.map((e,t)=>a.Ay.createElement("span",{key:t,className:"board-poef-bit",style:e.style},a.Ay.createElement("span",{className:"board-poef-fall"},a.Ay.createElement("i",{className:e.shape}))))):null,a.Ay.createElement("div",{className:"board-announcement"},a.Ay.createElement("h1",null,e),t?a.Ay.createElement("p",{className:"board-announcement-text"},t):null,n?a.Ay.createElement("p",{className:"board-announcement-from"},n):null),(X?ce:[]).map((e,t)=>{const n=pe(e.position),r=e.design&&"free"===e.design.layout;return a.Ay.createElement("div",{key:e.key,className:`board-item card ${te===e.key?"focused":""} ${q.current.has(e.key)?"laid":""}`,style:{left:n.x-176+"px",top:n.y-176+"px","--deal":`${(.07*t).toFixed(2)}s`,"--tilt":`${n.tilt.toFixed(1)}deg`,"--sway":`${n.sway.toFixed(1)}s`,"--delay":`${n.delay.toFixed(1)}s`}},a.Ay.createElement("button",{type:"button",className:"board-card",onClick:Ce(()=>$e(e)),"aria-label":(0,u.Oj)({nl:`Felicitatie van ${e.from}`,en:`Congratulations from ${e.from}`})},r?a.Ay.createElement("span",{className:"board-card-face"},a.Ay.createElement("img",{src:e.design.front,alt:"",loading:"lazy",draggable:!1}),(e.design.stickers||[]).filter(e=>m.zQ[e.id]).map((e,t)=>a.Ay.createElement("span",{key:t,className:`board-card-sticker ${m.zQ[e.id]}`,style:{left:`${(e.x/6).toFixed(2)}%`,top:`${(e.y/6).toFixed(2)}%`,width:`${(124*e.s/6).toFixed(2)}%`,"--turn":`${e.r}deg`,"--delay":`${((.7*t+n.delay)%3).toFixed(1)}s`},dangerouslySetInnerHTML:{__html:(0,m.RK)(e.id)}}))):a.Ay.createElement("span",{className:"board-card-face",dangerouslySetInnerHTML:{__html:(0,m.l9)((0,m.zD)(e))}}),e.signers&&e.signers.length?a.Ay.createElement(o.FK,null,a.Ay.createElement("span",{className:"board-card-signed"},(0,u.Oj)({nl:`${e.signers.length} getekend`,en:`${e.signers.length} signed`})),a.Ay.createElement("span",{className:"board-card-signers"},(0,u.Oj)({nl:"Getekend door ",en:"Signed by "}),e.signers.join(", "))):null,!r&&"envelope"===e.type&&e.message?a.Ay.createElement("span",{className:"board-card-words"},e.message,a.Ay.createElement("span",{className:"board-card-sender"},e.from)):null))}),X&&!O&&!ce.length&&de.length?a.Ay.createElement(L,{place:pe(de[0])}):null,(X?de:[]).map((e,t)=>{const n=pe(e);if(e===k)return null;const o=0===t&&!O;return a.Ay.createElement("div",{key:`ghost-${e}`,className:`board-item ghost ${o?"next":""} ${Q===e?"chosen":""} ${q.current.has(`ghost-${e}`)?"laid":""}`,style:{left:n.x-176+"px",top:n.y-176+"px","--deal":`${(.07*ce.length+.07*t).toFixed(2)}s`,"--tilt":`${n.tilt.toFixed(1)}deg`,"--sway":`${n.sway.toFixed(1)}s`,"--delay":`${(.12*t).toFixed(2)}s`}},O?a.Ay.createElement("span",{className:"board-blank"}):a.Ay.createElement("button",{type:"button",className:"board-spot",onClick:Ce(()=>Pe(e)),"aria-label":(0,u.Oj)({nl:"Feliciteer hier",en:"Congratulate here"})},a.Ay.createElement("span",{className:"board-spot-pencil",dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 24 24" width="100%" height="100%" aria-hidden="true"><path d="M4 20l1.2-4.6L15.8 4.8a2 2 0 0 1 2.8 0l.6.6a2 2 0 0 1 0 2.8L8.6 18.8z" fill="#fff8f0" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/>
1<path d="M13.8 6.8l3.4 3.4M5.2 15.4l3.4 3.4" fill="none" stroke="currentColor" stroke-width="1.8"/></svg>'}}),o?a.Ay.createElement("span",{className:"board-spot-label"},(0,u.Oj)({nl:"Jouw felicitatie hier",en:"Your card here"})):null))}))),a.Ay.createElement("a",{className:"board-brand",href:(0,u.Oj)({nl:"/nieuws/felicitatiepagina",en:"/news/congratulations-page"})},"Mailbook"),s?a.Ay.createElement("a",{className:"board-owner",href:`/mailbook/${(0,u.Oj)({nl:"adresboek",en:"addressbook"})}#gifts`},(0,u.Oj)({nl:"Beheer je pagina",en:"Manage your page"})):null,me.length&&!le?a.Ay.createElement(o.FK,null,a.Ay.createElement("button",{type:"button",className:"board-step prev",onClick:()=>Se(-1),"aria-label":(0,u.Oj)({nl:"Vorige felicitatie",en:"Previous congratulations"}),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true"><path d="M12.5 4l-6 6 6 6" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),a.Ay.createElement("button",{type:"button",className:"board-step next",onClick:()=>Se(1),"aria-label":(0,u.Oj)({nl:"Volgende felicitatie",en:"Next congratulations"}),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="20" height="20" aria-hidden="true"><path d="M7.5 4l6 6-6 6" fill="none" stroke="currentColor" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg>'}})):null,!le||re?a.Ay.createElement("div",{className:"board-zoom-group"},re?a.Ay.createElement("button",{type:"button",className:"board-zoom",onClick:()=>{const e=le?"vrij":"stapel";!function(e){try{window.localStorage.setItem(A,e)}catch(e){}}(e),ie(e)},"aria-label":le?(0,u.Oj)({nl:"Naar het vrije bord",en:"To the free board"}):(0,u.Oj)({nl:"Naar de stapel",en:"To the stack"}),title:le?(0,u.Oj)({nl:"Vrij bord",en:"Free board"}):(0,u.Oj)({nl:"Stapel",en:"Stack"}),dangerouslySetInnerHTML:{__html:S[le?"vrij":"stapel"]}}):null,le?null:a.Ay.createElement(o.FK,null,a.Ay.createElement("button",{type:"button",className:"board-zoom",onClick:()=>je(1.35,...T(C)),"aria-label":(0,u.Oj)({nl:"Inzoomen",en:"Zoom in"})},"+"),a.Ay.createElement("button",{type:"button",className:"board-zoom",onClick:()=>((e=650)=>{const t=C.current.getBoundingClientRect(),n=ce.reduce((e,t)=>{const n=pe(t.position);return Math.max(e,Math.abs(n.x),Math.abs(n.y))},516),a=g(Math.min(t.width,t.height)/(2*(n+h)),p,1);return we(0,0,a,e)})(),"aria-label":(0,u.Oj)({nl:"Alles bekijken",en:"See everything"}),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><path d="M3 8V3h5M12 3h5v5M17 12v5h-5M8 17H3v-5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),a.Ay.createElement("button",{type:"button",className:"board-zoom",onClick:()=>je(1/1.35,...T(C)),"aria-label":(0,u.Oj)({nl:"Uitzoomen",en:"Zoom out"})},"−"))):null,O?null:a.Ay.createElement("button",{type:"button",className:"board-claim",onClick:()=>Pe(j(ce,1)[0]),onPointerEnter:()=>oe(!0),onPointerLeave:()=>oe(!1),onFocus:()=>oe(!0),onBlur:()=>oe(!1)},n?(0,u.Oj)({nl:`Feliciteer ${n}`,en:`Congratulate ${n}`}):(0,u.Oj)({nl:"Feliciteer",en:"Congratulate"})))}function L({place:e}){return a.Ay.createElement("div",{className:"board-first",style:{left:`${e.x}px`,top:e.y-176-24+"px"}},a.Ay.createElement("span",{className:"board-first-arrow",dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 120 110" width="100%" height="100%" aria-hidden="true"><path d="M10 12C52 4 80 34 74 96" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"/><path d="M61 84l13 14 12-15" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),a.Ay.createElement("span",{className:"board-first-text"},(0,u.Oj)({nl:"Wees de eerste!",en:"Be the first!"})))}function T(e){const t=e.current.getBoundingClientRect();return[t.left+t.width/2,t.top+t.height/2]}L.propTypes={place:r.A.object},P.propTypes={title:r.A.string.isRequired,description:r.A.string,recipientName:r.A.string,felicitaties:r.A.array.isRequired,owner:r.A.bool,onClaim:r.A.func.isRequired,editing:r.A.number,focusKey:r.A.string,off:r.A.bool},P.defaultProps={description:"",recipientName:"",owner:!1,editing:null,focusKey:null,off:!1};var D=n(689),z=n(368),B=n(20),K=n(253);const F=C(14,36,40,34);function H({tone:e}){return a.Ay.createElement("div",{className:`cheer ${e}`,"aria-hidden":"true"},a.Ay.createElement("div",{className:"cheer-poef"},F.map((e,t)=>a.Ay.createElement("span",{key:t,className:"board-poef-bit",style:e.style},a.Ay.createElement("span",{className:"board-poef-fall"},a.Ay.createElement("i",{className:e.shape}))))),a.Ay.createElement("svg",{className:"cheer-mark",viewBox:"0 0 48 48",width:"48",height:"48"},a.Ay.createElement("circle",{cx:"24",cy:"24",r:"22"}),a.Ay.createElement("path",{d:"M14 25l7 7 13-15"})))}H.propTypes={tone:r.A.string},H.defaultProps={tone:""};var I=n(523),_=n(213);const W=()=>({theme:m.o9[0].id,texts:[{role:"message",style:"brief",text:"",x:300,y:265,s:1,r:0},{role:"from",style:"hand",text:"",x:300,y:400,s:1,r:0}],photos:[],photoData:[],photoStyles:[],photoOriginals:[],frames:[],stickers:[],kado:null}),Y=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,V=e=>"usd"===e?"$":"€";class J extends a.Ay.Component{constructor(e){super(e),this.state={view:"Landing",started:!1,contributor:{from:"",firstName:"",lastName:"",email:"",ph
1one:"",amount:0,customAmount:"",message:"",shipTo:"",streetname:"",housenr:"",postcode:"",city:""},contributionKey:null,contributions:[],loadingContributions:!0,error:{},paymentLink:null,bancontactLink:null,ibanDetails:null,paypalLink:null,venmoLink:null,contributeData:null,contributeLoading:!1,position:null,history:{undo:0,redo:0},design:W(),composer:{selected:null,post:!1,home:!1,group:!1,details:!1,paying:!1,tab:"kaart",tabAway:null},photoBusy:null,focusKey:null,offer:null,requestLink:null,claim:null,signHash:null,sign:{name:"",busy:!1,signed:null},editHash:null,editing:null},this.scrollPos={},this.handleHashChange=this.handleHashChange.bind(this),this.handleKey=this.handleKey.bind(this),this.past=[],this.future=[]}componentDidMount(){window.addEventListener("hashchange",this.handleHashChange),window.addEventListener("keydown",this.handleKey),this.stopHandwriting=(0,D.$E)(()=>this.forceUpdate()),this.handleHashChange(),this.loadContributions();const{gift:e}=this.props;if(e.envelopieKey&&!e.owner&&!e.error){const t=new URLSearchParams(window.location.search).get("src")||(window.location.hash.match(/source=([a-z0-9-]+)/i)||[])[1];(0,l.u4)("envelopie",e.envelopieKey+"."+(t?t.toLowerCase():"direct"))}}componentWillUnmount(){window.removeEventListener("hashchange",this.handleHashChange),window.removeEventListener("keydown",this.handleKey),this.stopHandwriting()}handleKey(e){if("Compose"!==this.state.view||this.state.composer.details)return;const t=/INPUT|TEXTAREA/.test(document.activeElement.tagName),n=e.key.toLowerCase();!e.metaKey&&!e.ctrlKey||"z"!==n||t?!e.metaKey&&!e.ctrlKey||"y"!==n||t?"delete"!==n&&"backspace"!==n||t||!this.state.composer.selected||"text"===this.state.composer.selected.type||(e.preventDefault(),this.removeSelected()):(e.preventDefault(),this.redo()):(e.preventDefault(),e.shiftKey?this.redo():this.undo())}remember(){const{design:e,contributor:t}=this.state,n=this.past[this.past.length-1];n&&n.design===e&&n.amount===t.amount&&n.customAmount===t.customAmount||(this.past.push({design:e,amount:t.amount,customAmount:t.customAmount}),this.past.length>60&&this.past.shift(),this.future=[],this.setState({history:{undo:this.past.length,redo:0}}))}restore(e){this.setState(t=>({design:e.design,contributor:{...t.contributor,amount:e.amount,customAmount:e.customAmount},composer:{...t.composer,selected:null},history:{undo:this.past.length,redo:this.future.length}}))}undo(){if(!this.past.length)return;const{design:e,contributor:t}=this.state;this.future.push({design:e,amount:t.amount,customAmount:t.customAmount}),this.restore(this.past.pop())}redo(){if(!this.future.length)return;const{design:e,contributor:t}=this.state;this.past.push({design:e,amount:t.amount,customAmount:t.customAmount}),this.restore(this.future.pop())}getViewFromHash(){const e=window.location.hash;return/gift-compose|bewerk-/i.test(e)?"Compose":/gift-step-confirmation/i.test(e)?"Confirmation":/claim-/i.test(e)?"Claim":/teken-/i.test(e)?"Sign":/contribute-/i.test(e)?"Contribute":"Landing"}getContributionKeyFromHash(){const e=window.location.hash.match(/contribute-([a-zA-Z0-9]+)/i);return e?e[1]:null}setView(e){return this.scrollPos[this.state.view]=document.documentElement.scrollTop||document.body.scrollTop,"Landing"===e?(window.history.pushState(null,"",window.location.pathname),this.setState({view:"Landing"},()=>this.restoreScroll("Landing")),this.loadContributions()):document.location.hash={Compose:"gift-compose",Confirmation:"gift-step-confirmation"}[e]||e.toLowerCase(),!0}restoreScroll(e){const t=this.scrollPos[e]||1;window.requestAnimationFrame(()=>window.scrollTo(0,t))}handleHashChange(e){const t=this.getViewFromHash();"Landing"===t&&"Landing"!==this.state.view&&this.resetContribution(),"Confirmation"!==t||"Confirmation"===this.state.view||this.state.paymentChecked||this.checkPaymentStatus(),"Contribute"===t&&"Contribute"!==this.state.view&&this.loadContributionPayment(),"Claim"===t&&"Claim"!==this.state.view&&this.loadClaim();const n=window.location.hash.match(/bewerk-([a-zA-Z0-9]+)-([a-f0-9]+)/i);!n||this.state.editing&&this.state.editing.key===n[1]?"Compose"!==t||this.state.started?this.setState({view:t},()=>{e&&this.restoreScroll(t)}):this.setView("Landing"):this.openEdit(n[1],n[2])}checkPaymentStatus(){const e=new URLSearchParams(window.location.search),t=e.get("payment_intent"),n=e.get("redirect_status");if("succeeded"===n){(0,l.u4)("envelopie-paid",this.props.gift.envelopieKey);let e={};try{e=JSON.parse(window.sessionStorage.getItem("felicitatie-paid"))||{}}catch(e){}this.setState({paymentStatus:"succeeded",paymentChecked:!0,focusKey:e.key,skipEnvelope:!e.posted,shipHome:!!e.home,signHash:e.sign||null,editHash:e.edit||null})}else"failed"===n||"canceled"===n?this.setState({paymentStatus:"failed",paymentChecked:!0}):t?(this.setState({paymentStatus:"checking",paymentChecked:!0}),(0,_.FH)("/response",{m:"verify-payment",intent:t}).then(e=>{"succeeded"===e.status?this.setState({paymentStatus:"succeeded"}):this.setState({paymentStatus:e.status||"unknown"})}).catch(()=>{this.setState({paymentStatus:"unknown"})})):this.setState({paymentStatus:"unknown",paymentChecked:!0})}async loadContributionPayment(){const{gift:e}=this.props,t=this.getContributionKeyFromHash();if(t&&e.envelopieKey){this.setState({contributeLoading:!0});try{const n=await(0,_.FH)("/response",{m:"get-contribution-payment",envelopieKey:e.envelopieKey,contributionKey:t});n.success?this.setState({contributeData:{...n,contributionKey:t},contributeLoading:!1}):this.setState({contributeData:{error:n.error},contributeLoading:!1})}catch(e){this.setState({contributeData:{error:"Failed to load payment details."},contributeLoading:!1})}}}paymentMethodFor(e){const{paymentLink:t,bancontactLink:n,ibanDetails:a,paypalLink:o,venmoLink:r}=e||{},i=(window.__LOCAL||"nl").split("-").pop().toUpperCase();return"NL"===i&&t?"tikkie":"BE"===i&&n?"bancontact":"US"===i&&o?"paypal":"US"===i&&r?"venmo":"NL"!==i&&"BE"!==i&&a?"iban":t?"tikkie":n?"bancontact":o?"paypal":r?"venmo":a?"iban":null}sym(){return V(this.props.gift.currency)}resetContribution(){this.setState({started:!1,contributor:{from:"",firstName:"",lastName:"",email:"",ph
1one:"",amount:0,customAmount:"",message:"",shipTo:"",country:"NL"},position:null,design:W(),composer:{selected:null,post:!1,home:!1,group:!1,details:!1,paying:!1,tab:"kaart",tabAway:null},contributionKey:null,error:{},paymentStatus:null,paymentChecked:!1,skipEnvelope:!1,signHash:null,sign:{name:"",busy:!1,signed:null},editHash:null,editing:null})}async loadContributions(){const{gift:e}=this.props;this.setState({loadingContributions:!0});const t={m:"get-gift-contributors",envelopieKey:e.envelopieKey,public:!0};try{const e=await(0,_.FH)("/response",t);e.contributors?this.setState({contributions:e.contributors,loadingContributions:!1}):this.setState({loadingContributions:!1})}catch(e){this.setState({loadingContributions:!1})}}claimSpot(e){(0,D.iM)().catch(()=>{}),(0,l.u4)("envelopie-start",this.props.gift.envelopieKey),this.past=[],this.future=[],this.setState(t=>({started:!0,position:e,design:W(),composer:{selected:null,post:!1,home:!1,group:!1,details:!1,paying:!1,tab:"kaart",tabAway:null},history:{undo:0,redo:0},focusKey:null,contributor:{...t.contributor,shipTo:"digital"}}),()=>this.setView("Compose"))}async openEdit(e,t){const n=await(0,_.FH)("/felicitatie",{m:"edit",contributionKey:e,token:t}).catch(()=>({error:"failed"}));if(!n.success)return this.props.onMessage("printed"===n.error?(0,u.Oj)({nl:"Deze kaart is al gedrukt en kan niet meer veranderen.",en:"This card is printed already and cannot change anymore."}):(0,u.Oj)({nl:"Deze link werkt niet meer.",en:"This link no longer works."})),void this.setView("Landing");(0,D.iM)().catch(()=>{}),this.past=[],this.future=[];const a=n.design,o=a.photos||[];this.setState(r=>({started:!0,editing:{key:e,token:t,paid:!!n.paid},position:n.position,design:{...W(),theme:a.theme,texts:a.texts||[],photos:o,photoData:n.photoData||[],photoStyles:o.map(()=>m.Yu[0].id),photoOriginals:o.map(()=>null),frames:a.frames||[],stickers:a.stickers||[],kado:a.kado||null},composer:{selected:null,post:!1,home:!1,group:!1,details:!1,paying:!1,tab:"kaart",tabAway:null,post:"envelope"===n.type,group:n.group},history:{undo:0,redo:0},focusKey:e,contributor:{...r.contributor,from:n.from,firstName:n.firstName,lastName:n.lastName,shipTo:"envelope"===n.type?"recipient":"digital"}}),()=>this.setState({view:"Compose"}))}async saveEdit(){if(!this.validateCard())return;const{editing:e,design:t}=this.state;this.setState({contributionOnlySubmitting:!0});try{const n=await(0,_.FH)("/felicitatie",{m:"edit-save",contributionKey:e.key,token:e.token,design:await this.prepareDesign(),from:this.senderName(),message:t.texts.filter(e=>"from"!==e.role).map(e=>e.text.trim()).filter(Boolean).join("\n")});if(!n.success)return this.props.onMessage("printed"===n.error?(0,u.Oj)({nl:"Deze kaart is al gedrukt en kan niet meer veranderen.",en:"This card is printed already and cannot change anymore."}):(0,u.Oj)({nl:"Opslaan lukte niet. Probeer het nog eens.",en:"Saving did not work. Please try again."})),void this.setState({contributionOnlySubmitting:!1});this.props.onMessage((0,u.Oj)({nl:"Je kaart is aangepast.",en:"Your card is changed."})),this.setState({started:!1,editing:null,contributionOnlySubmitting:!1,focusKey:e.key}),this.setView("Landing")}catch(e){this.props.onMessage((0,u.Oj)({nl:"Opslaan lukte niet. Probeer het nog eens.",en:"Saving did not work. Please try again."})),this.setState({contributionOnlySubmitting:!1})}}felicitaties(){return this.state.contributions.filter(e=>e.from)}formatDate(e){if(!e)return null;const t=new Date(e),n={day:"numeric",month:"long",year:"numeric"};return(0,u.Oj)({nl:t.toLocaleDateString("nl-NL",n),en:t.toLocaleDateString("en-US",n)})}setContributor(e,t){this.setState(n=>({contributor:{...n.contributor,...e},error:t?{...n.error,[t]:!1}:n.error}))}handleInputState(e){const{contributor:t,error:n}=this.state,a=e.currentTarget,o="checkbox"===a.type?a.checked:a.value;n[a.id]&&o&&o.length>0&&this.setState({error:{...n,[a.id]:!1}}),this.setState({contributor:{...t,[a.id]:o}})}async submitContributionOnly(){const{contributor:e}=this.state,{gift:t}=this.props;this.setState({error:{},contributionOnlySubmitting:!0});const n="custom"===e.amount?parseFloat(e.customAmount):e.amount;try{const a=await(0,_.FH)("/response",{m:"save-envelope",design:await this.prepareDesign(),position:this.state.position,envelopieKey:t.envelopieKey,skipEnvelope:!0,digitalCard:"digital"===e.shipTo,group:this.state.composer.group,contributor:{shipTo:e.shipTo,from:e.from,firstName:e.firstName,lastName:e.lastName,email:e.email,message:e.message,amount:n}});if(a.error)return this.props.onMessage(a.error),void this.setState({contributionOnlySubmitting:!1});(0,l.u4)("envelopie-pledge",t.envelopieKey+".digital-card"+(n>0?".kado":"")),this.loadContributions(),this.setState({contributionKey:a.c
1ontributionKey,paymentLink:a.paymentLink,bancontactLink:a.bancontactLink,ibanDetails:a.ibanDetails,paypalLink:a.paypalLink,venmoLink:a.venmoLink,requestLink:a.requestLink,signHash:a.signHash||null,editHash:a.editHash||null,offer:a.offer,paymentStatus:"succeeded",paymentChecked:!0,skipEnvelope:!0,contributionOnlySubmitting:!1,focusKey:a.contributionKey}),this.setView("Confirmation")}catch(e){this.props.onMessage((0,u.Oj)({nl:"Er is iets misgegaan. Probeer het later opnieuw.",en:"Something went wrong. Please try again later."})),this.setState({contributionOnlySubmitting:!1})}}async handleBeforePay(e){if(!this.validateComposer())return{success:!1};const{gift:t}=this.props,{contributor:n}=this.state;try{const a="custom"===n.amount?parseFloat(n.customAmount):n.amount,o={m:"save-envelope",design:await this.prepareDesign(),position:this.state.position,envelopieKey:t.envelopieKey,digitalCard:"digital"===n.shipTo,group:this.state.composer.group,intent:e,order:{total:this.getOrderTotal(),currency:"eur"},contributor:{from:n.from,firstName:n.firstName,lastName:n.lastName,email:n.email,phone:n.phone,amount:a,message:n.message,shipTo:n.shipTo,..."self"===n.shipTo?{address:{streetname:n.streetname.trim(),housenr:n.housenr.trim(),postcode:n.postcode.trim(),city:n.city.trim(),country:n.country}}:{}}},r=await(0,_.FH)("/response",o);if(r.error)return this.props.onMessage(r.error||(0,u.Oj)({nl:"Er is iets misgegaan. Probeer het later opnieuw.",en:"Something went wrong. Please try again later."})),{success:!1};(0,l.u4)("envelopie-pledge",t.envelopieKey+".card"+(a>0?".kado":""));try{window.sessionStorage.setItem("felicitatie-paid",JSON.stringify({key:r.contributionKey,posted:"digital"!==n.shipTo,home:"self"===n.shipTo,sign:r.signHash,edit:r.editHash}))}catch(e){}return this.setState({contributionKey:r.contributionKey,paymentLink:r.paymentLink,bancontactLink:r.bancontactLink,ibanDetails:r.ibanDetails,paypalLink:r.paypalLink,venmoLink:r.venmoLink,requestLink:r.requestLink,signHash:r.signHash||null,offer:r.offer}),{success:!0}}catch(e){return this.props.onMessage((0,u.Oj)({nl:"Er is iets misgegaan. Probeer het later opnieuw.",en:"Something went wrong. Please try again later."})),{success:!1}}}createPaymentButton(){const{contributor:e}=this.state,t=this.getOrderTotal(),n={firstName:e.firstName,lastName:e.lastName,email:e.email,phone:e.phone,streetname:"",city:"",postcode:"",country:(window.__LOCAL||"nl").split("-").pop().toLowerCase()},o=document.createElement("a");o.href=document.location,o.hash="gift-step-confirmation";const r=o.href;return a.Ay.createElement(I.A,{success:r,tokenType:"envelope-shipping",user:n,order:{total:100*t,currency:"eur"},onMessage:e=>this.props.onMessage(e),onBeforePay:e=>this.handleBeforePay(e)})}getGiftAmount(){const{contributor:e}=this.state;return"custom"===e.amount?parseFloat(e.customAmount)||0:e.amount}extras(){const{design:e,composer:t}=this.state;return[{key:"photo",count:e.frames.length,label:{nl:"Foto",en:"Photo"}},{key:"move",count:e.stickers.filter(e=>m.zQ[e.id]).length,label:{nl:"Bewegende sticker",en:"Moving sticker"}},{key:"post",count:t.post?1:0,label:{nl:"Print + verstuur",en:"Print + post"}}].filter(e=>e.count)}getOrderTotal(){return this.extras().reduce((e,t)=>e+t.count*m.ze[t.key],0)}renderError(){return a.Ay.createElement("div",{className:"saved"},a.Ay.createElement("div",{className:"call-out"},a.Ay.createElement("p",null,(0,u.Oj)({nl:"Deze pagina is niet beschikbaar.",en:"This page is not available."}))))}renderInactive(){const{gift:e}=this.props,t=`/mailbook/${(0,u.Oj)({nl:"adresboek",en:"addressbook"})}#gifts-edit-${e.envelopieKey}`;return a.Ay.createElement("div",{className:"board-off"},a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Deze pagina staat nog even uit",en:"This page is switched off for now"})),e.owner?a.Ay.createElement(o.FK,null,a.Ay.createElement("p",null,(0,u.Oj)({nl:"Zet je pagina aan, dan kan iedereen je feliciteren.",en:"Switch your page on and anyone can congratulate you."})),a.Ay.createElement("a",{href:t,className:"button"},(0,u.Oj)({nl:"Pagina instellen",en:"Set up page"}))):a.Ay.createElement("p",null,(0,u.Oj)({nl:"Probeer het later nog eens. Ben jij de organisator? ",en:"Please try again later. Are you the organizer? "}),a.Ay.createElement("a",{href:t},(0,u.Oj)({nl:"Pagina instellen",en:"Set up page"}))))}recipientLabel(){const{gift:e}=this.props;return e.recipientName||(0,u.Oj)({nl:"de ontvanger",en:"the recipient"})}messageSuggestions(){const{gift:e}=this.props,t=(e.recipientName||"").trim(),n=t?` ${t}`:"",a={wedding:[{label:{nl:"Gefeliciteerd",en:"Congrats"},text:{nl:`Gefeliciteerd${n} met jullie huwelijk! Geniet van deze dag.`,en:`Congratulations${n} on your wedding! Enjoy every moment of it.`}},{label:{nl:"Proost",en:"Cheers"},text:{nl:"Wat mooi dat we erbij mogen zijn. Proost op jullie!",en:"So glad we get to be there. Here is to you both!"}},{label:{nl:"Voor altijd",en:"To you both"},text:{nl:"Van harte! Op een lang en gelukkig leven samen.",en:"Congratulations! To a long and happy life together."}}],baby:[{label:{nl:"Gefeliciteerd",en:"Congrats"},text:{nl:"Gefeliciteerd met jullie kleine wonder!",en:"Congratulations on your little one!"}},{label:{nl:"Mooi nieuws",en:"Wonderful news"},text:{nl:"Wat een prachtig nieuws. Geniet van elk moment.",en:"What wonderful news. Enjoy every moment."}},{label:{nl:"Welkom",en:"Welcome"},text:{nl:"Welkom kleintje! Wat een geluk voor jullie.",en:"Welcome to the world, little one!"}},{label:{nl:"Slaap ze",en:"All the best"},text:{nl:`Van harte${n}! Heel veel geluk met elkaar.`,en:`Congratulations${n}! Wishing you all the best.`}}],graduation:[{label:{nl:"Gefeliciteerd",en:"Congrats"},text:{nl:`Gefeliciteerd${n} met je diploma!`,en:`Congratulations${n} on your diploma!`}},{label:{nl:"Knap",en:"Well done"},text:{nl:"Wat knap, geslaagd! Op naar het volgende avontuur.",en:"Well done, you made it! On to the next adventure."}},{label:{nl:"Trots",en:"Proud"},text:{nl:"Wat zijn we trots op je. Van harte!",en:"We are so proud of you. Congratulations!"}}],birthday:[{label:{nl:"Gefeliciteerd",en:"Happy birthday"},text:{nl:`Gefeliciteerd${n}! Maak er een mooie dag van.`,en:`Happy birthday${n}! Have a wonderful day.`}},{label:{nl:"Hiep hiep",en:"Hip hip"},text:{nl:"Hiep hiep hoera! Geniet van je dag.",en:"Hip hip hooray! Enjoy your day."}},{label:{nl:"Op naar meer",en:"The year ahead"},text:{nl:"Gefeliciteerd! Op naar een fantastisch jaar.",en:"Congratulations! Here is to a brilliant year."}}],default:[{label:{nl:"Gefeliciteerd",en:"Congrats"},text:{nl:`Gefeliciteerd${n}! Wat een mooi nieuws.`,en:`Congratulations${n}! What lovely news.`}},{label:{nl:"Van harte",en:"Warmest wishes"},text:{nl:"Van harte gefeliciteerd, geniet ervan!",en:"Warmest congratulations, enjoy it all!"}},{label:{nl:"Veel liefs",en:"With love"},text:{nl:"Met veel liefs van ons.",en:"With love from us."}}]};return a[e.giftTheme]||a.default}setDesign(e){this.setState(t=>({design:{...t.design,...e}}))}editCard(e=[]){const{design:t}=this.state;return{kind:"card",theme:t.theme,texts:t.texts,hidden:e,photos:t.photos,frames:t.frames,stickers:t.stickers,kado:t.kado&&{...t.kado,label:(0,u.Oj)({nl:"Kado",en:"Gift"})}}}async prepareDesign(){const{gift:e}=this.props,{design:t}=this.state,n=t.frames.map((e,n)=>({frame:e,url:t.photos[n],data:t.photoData[n]})).filter(e=>e.url),a=t.texts.filter(e=>e.text.trim()),o={...this.editCard(),texts:a,photos:n.map(e=>e.data),frames:n.map(e=>e.frame)},r=await(0,m.m0)(o,o.photos),i=new FormData;i.append("m","front"),i.append("envelopieKey",e.envelopieKey),i.append("front",r,"front.png");const s=await window.fetch("/felicitatie",{method:"POST",body:i,credentials:"same-origin"}).then(e=>e.json());if(!s.success)throw new Error(s.error);return{layout:"free",theme:t.theme,front:s.url,texts:a,photos:n.map(e=>e.url),frames:n.map(e=>e.frame),stickers:t.stickers,kado:t.kado}}setComposer(e){this.setState(t=>({composer:{...t.composer,...e}}))}isPosted(){return this.state.composer.post}fromText(){return this.state.design.texts.find(e=>"from"===e.role)}senderName(){const e=this.fromText(),{firstName:t,lastName:n}=this.state.contributor;return(e&&e.text.trim()?e.text:`${t} ${n}`).trim()}cardUnits(e,t){const n=this.cardElement.getBoundingClientRect();return{x:Math.round(Math.min(600,Math.max(0,(e-n.left)/n.width*600))),y:Math.round(Math.min(600,Math.max(0,(t-n.top)/n.height*600)))}}onCard(e,t){const n=this.cardElement&&this.cardElement.getBoundingClientRect();return!!n&&e>=n.left&&e<=n.right&&t>=n.top&&t<=n.bottom}elementBox(e){const{design:t,composer:n}=this.state;if("text"===e.type){const a=t.texts[e.index],o=(0,m.DU)(a),r=n.selected&&"text"===n.selected.type&&n.selected.index===e.index?Math.max(o.w,(0,m.XC)(a.style).wrap):o.w;return{item:a,list:"texts",x:a.x,y:a.y,w:r*a.s,h:o.h*a.s,r:a.r}}if("sticker"===e.type){const n=t.stickers[e.index];return{item:n,list:"stickers",x:n.x,y:n.y,w:100*n.s,h:100*n.s,r:n.r}}if("kado"===e.type){const e=t.kado;return{item:e,list:"kado",x:e.x,y:e.y,w:m.GO.w*e.s,h:m.GO.h*e.s,r
1:e.r}}const a=t.frames[e.index],o=(0,m.h5)(a);return o.bare?{item:a,list:"frames",x:o.cx,y:o.cy,w:o.w,h:o.h,r:o.r}:{item:a,list:"frames",x:o.cx,y:o.cy+12,w:o.w+24,h:o.h+48,r:o.r}}hitTest(e){const{design:t}=this.state,n=[["kado",t.kado?[t.kado]:[]],["sticker",t.stickers],["text",t.texts],["photo",t.frames]];for(const[t,a]of n)for(let n=a.length-1;n>=0;n--){const a=this.elementBox({type:t,index:n}),o=-a.r*Math.PI/180,r=e.x-a.x,i=e.y-a.y,s=r*Math.cos(o)-i*Math.sin(o),l=r*Math.sin(o)+i*Math.cos(o);if(Math.abs(s)<=a.w/2+8&&Math.abs(l)<=a.h/2+8)return{type:t,index:n}}return null}changeElement(e,t){const{list:n}=this.elementBox(e);"kado"!==n?this.setState(a=>({design:{...a.design,[n]:a.design[n].map((n,a)=>a===e.index?{...n,...t}:n)}})):this.setState(e=>({design:{...e.design,kado:{...e.design.kado,...t}}}))}cardPointer(e,t){if("down"===t){if(/INPUT|TEXTAREA/.test(e.target.tagName)||e.target.closest(".composer-handle, .composer-kado-ask, .composer-kado-note"))return;const t=this.cardUnits(e.clientX,e.clientY),n=this.hitTest(t);if(this.setComposer({selected:n}),!n)return;e.currentTarget.setPointerCapture(e.pointerId);const{item:a}=this.elementBox(n);this.dragging={hit:n,dx:a.x-t.x,dy:a.y-t.y,from:t,moved:!1}}else if("move"===t&&this.dragging){const t=this.cardUnits(e.clientX,e.clientY),{hit:n,dx:a,dy:o,from:r}=this.dragging;!this.dragging.moved&&Math.hypot(t.x-r.x,t.y-r.y)>4&&(this.dragging.moved=!0,this.remember()),this.dragging.moved&&this.changeElement(n,{x:t.x+a,y:t.y+o})}else if("up"===t&&this.dragging){const{hit:e,moved:t}=this.dragging;if(this.dragging=null,t)return;"text"===e.type&&this.focusText(e.index),"photo"!==e.type||this.state.design.photos[e.index]||this.pickPhoto(e.index)}}startHandle(e,t){e.preventDefault(),e.stopPropagation();const n=this.state.composer.selected,{item:a}=this.elementBox(n),o=this.cardElement.getBoundingClientRect(),r=o.width/600,i=o.left+a.x*r,s=o.top+a.y*r,l={x:e.clientX,y:e.clientY},c=m.$M[n.type],d=(e,[t,n])=>Math.min(n,Math.max(t,e)),u=e=>180*Math.atan2(e.y-s,e.x-i)/Math.PI,h=e=>Math.max(1,Math.hypot(e.x-i,e.y-s));let p=!1;const y=e=>{const o={x:e.clientX,y:e.clientY};if(p||(p=!0,this.remember()),"size"===t)this.changeElement(n,{s:Math.round(100*d(a.s*h(o)/h(l),c.s))/100});else if("turn"===t){const e=(a.r+u(o)-u(l)+540)%360-180;this.changeElement(n,{r:Math.abs(e)<4?0:Math.round(d(e,c.r))})}else this.changeElement(n,{x:Math.round(d(a.x+(o.x-l.x)/r,[0,600])),y:Math.round(d(a.y+(o.y-l.y)/r,[0,600]))})},g=()=>{window.removeEventListener("pointermove",y),window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",g)};window.addEventListener("pointermove",y),window.addEventListener("pointerup",g),window.addEventListener("pointercancel",g)}removeSelected(){this.remember();const e=this.state.composer.selected;if("kado"===e.type)return void this.setState(e=>({design:{...e.design,kado:null},contributor:{...e.contributor,amount:0,customAmount:""},composer:{...e.composer,selected:null}}));const{list:t}=this.elementBox(e),n=(t,n)=>n!==e.index;this.setState(a=>{const o={...a.design,[t]:a.design[t].filter(n)};return"photo"===e.type&&(o.photos=a.design.photos.filter(n),o.photoData=a.design.photoData.filter(n),o.photoStyles=a.design.photoStyles.filter(n),o.photoOriginals=a.design.photoOriginals.filter(n)),{design:o,composer:{...a.composer,selected:null}}})}startPaletteDrag(e,t,n){e.preventDefault();const a=e.clientX,o=e.clientY,r=document.createElement("div");r.className=`composer-ghost ${t}`,r.innerHTML="sticker"===t?`<svg viewBox="0 0 100 100" width="100%" height="100%">${m.D3.find(e=>e.id===n).svg}</svg>`:"kado"===t?(0,u.Oj)({nl:"Kado",en:"Gift"}):"+",document.body.appendChild(r);const i=e=>{r.style.transform=`translate(${e.clientX}px, ${e.clientY}px)`};i(e);let s=!1;const l=e=>{s=s||Math.hypot(e.clientX-a,e.clientY-o)>6,i(e)},c=e=>{window.removeEventListener("pointermove",l),window.removeEventListener("pointerup",c),r.remove();const a=this.onCard(e.clientX,e.clientY);if(s&&!a)return;const o=s?this.cardUnits(e.clientX,e.clientY):null;"sticker"===t?this.addSticker(n,o):"kado"===t?this.addKado(o):this.addFrame(o)};window.addEventListener("pointermove",l),window.addEventListener("pointerup",c)}freeSpot(e){const{design:t}=this.state,n=[...t.texts.map(e=>({x:e.x,y:e.y,wide:!0})),...t.frames,...t.stickers,...t.kado?[t.kado]:[]],a=(600-2*e)/6;let o=null;for(let t=e;t<=600-e;t+=a)for(let r=e;r<=600-e;r+=a){const e=n.length?Math.min(...n.map(e=>Math.hypot((r-e.x)*(e.wide?.4:1),t-e.y))):0;(!o||e>o.room)&&(o={x:Math.round(r),y:Math.round(t),room:e})}return o}addSticker(e,t){const{design:n}=this.state;if(this.remember(),n.stickers.length>=m.b1.stickers)return;const a=n.stickers.length,o=t||this.freeSpot(70),r={id:e,x:o.x,y:o.y,s:.9,r:37*a%30-15};this.setState(e=>({design:{...e.design,stickers:[...e.design.stickers,r]},composer:{...e.composer,selected:{type:"sticker",index:a}}}))}addFrame(e){const{design:t}=this.state;if(this.remember(),t.frames.length>=m.b1.photos)return;const n=t.frames.length,a=e||this.freeSpot(140),o={x:a.x,y:a.y,s:e?.9:.7,r:[-6,5,-3][n%3]};this.setState(e=>({design:{...e.design,frames:[...e.design.frames,o],photos:[...e.design.photos,""],photoData:[...e.design.photoData,""],photoStyles:[...e.design.photoStyles,m.Yu[0].id],photoOriginals:[...e.design.photoOriginals,null]},composer:{...e.composer,selected:{type:"photo",index:n}}}),()=>this.pickPhoto(n))}addText(){const{design:e}=this.state;if(this.remember(),e.texts.length>=m.b1.texts)return;const t=e.texts.length,n=this.freeSpot(120),a={role:"text",style:"brief",text:"",x:n.x,y:n.y,s:1,r:0};this.setState(e=>({design:{...e.design,texts:[...e.design.texts,a]},composer:{...e.composer,selected:{type:"text",index:t}}}),()=>this.focusText(t))}focusText(e){const t=this.textInputs[e];t&&t.focus()}pickPhoto(e){this.photoTarget=e,this.photoInput&&this.photoInput.click()}async fillPhoto(e){const t=this.photoTarget;if(!e||void 0===t)return;const n=new FormData;n.append("photo",e);const a=await this.sendPhoto(n,t,"upload");a&&(this.remember(),this.setState(e=>({design:{...e.design,photos:e.design.photos.map((e,n)=>n===t?a.url:e),photoData:e.design.photoData.map((e,n)=>n===t?a.data:e),photoStyles:e.design.photoStyles.map((e,n)=>n===t?m.Yu[0].id:e),photoOriginals:e.design.photoOriginals.map((e,n)=>n===t?{url:a.url,data:a.data}:e)}})))}async stylePhoto(e,t){const{design:n}=this.state,a=n.photoOriginals[e];if(!a||n.photoStyles[e]===t)return;let o=a;if(t!==m.Yu[0].id){const n=new FormData;if(n.append("style",t),n.append("source",a.url),o=await this.sendPhoto(n,e,"draw"),!o)return}this.remember(),this.setState(n=>({design:{...n.design,photos:n.design.photos.map((t,n)=>n===e?o.url:t),photoData:n.design.photoData.map((t,n)=>n===e?o.data:t),photoStyles:n.design.photoStyles.map((n,a)=>a===e?t:n),frames:n.design.frames.map((n,a)=>a===e?{...n,cutout:"uitsnede"===t}:n)}}))}toggleFrame(e){this.remember(),this.setState(t=>({design:{...t.design,frames:t.design.frames.map((t,n)=>n===e?{...t,bare:!t.bare}:t)}}))}async sendPhoto(e,t,n){const{gift:a,onMessage:o}=this.props;this.setState({photoBusy:{index:t,doing:n}}),e.append("m","photo"),e.append("envelopieKey",a.envelopieKey);const r=await window.fetch("/felicitatie",{method:"POST",body:e,credentials:"same-origin"}).then(e=>e.json()).catch(()=>({error:"restyle_failed"}));if(this.setState({photoBusy:null}),!r.success){const e={too_many:{nl:"Je hebt vandaag al genoeg foto's toegevoegd.",en:"You have added enough photos for today."},not_an_image:{nl:"Dit bestand kunnen we niet als foto lezen.",en:"We cannot read this file as a photo."}
1,restyle_failed:{nl:"Deze foto lukte niet. Probeer een andere.",en:"This photo did not work. Try another one."}};return o((0,u.Oj)(e[r.error]||e.restyle_failed)),null}return r}addKado(e){const{design:t}=this.state;t.kado||this.remember();const n=t.kado||e||this.freeSpot(110);this.setState(e=>({design:{...e.design,kado:e.design.kado||{x:n.x,y:n.y,s:.8,r:-6}},contributor:{...e.contributor,amount:"custom"},composer:{...e.composer,selected:{type:"kado",index:0}}}),()=>this.kadoInput&&this.kadoInput.focus())}setKadoAmount(e){this.setState(t=>({contributor:{...t.contributor,amount:"custom",customAmount:String(e)},error:{...t.error,customAmount:!1}}))}confirmKado(){if(!(this.getGiftAmount()>=5))return this.setState(e=>({error:{...e.error,customAmount:!0}})),void this.props.onMessage((0,u.Oj)({nl:"Een kado is minimaal €5.",en:"A gift is at least €5."}));this.setComposer({selected:null})}validateCard(){const{design:e,photoBusy:t}=this.state;return null!==t?(this.props.onMessage((0,u.Oj)({nl:"Even geduld, je foto is er bijna.",en:"Hold on, your photo is almost there."})),!1):!e.kado||this.getGiftAmount()>=5||(this.setState({error:{customAmount:!0},composer:{...this.state.composer,selected:{type:"kado",index:0}}}),this.props.onMessage((0,u.Oj)({nl:"Een kado is minimaal €5.",en:"A gift is at least €5."})),!1)}validateDetails(){const{contributor:e}=this.state,t={};return e.firstName.trim().length<2&&(t.firstName=!0),Y.test(e.email)||(t.email=!0),this.isPosted()&&this.state.composer.home&&["streetname","housenr","postcode","city"].forEach(n=>{e[n].trim()||(t[n]=!0)}),this.setState({error:t}),t.firstName?this.props.onMessage((0,u.Oj)({nl:"Vul je voornaam in.",en:"Fill in your first name."})):t.email?this.props.onMessage((0,u.Oj)({nl:"Vul je e-mailadres in, voor je bevestiging.",en:"Fill in your email address, for your confirmation."})):Object.keys(t).length&&this.props.onMessage((0,u.Oj)({nl:"Vul je adres in, dan sturen we de kaart naar jou.",en:"Fill in your address and we post the card to you."})),!Object.keys(t).length}validateComposer(){return this.validateCard()&&this.validateDetails()}send(){this.validateCard()&&this.setState(e=>({composer:{...e.composer,selected:null,details:!0}}))}confirmDetails(){if(!this.validateDetails())return;const e=this.isPosted(),t=this.getOrderTotal()>0,n=this.senderName(),a=this.state.design.texts.filter(e=>"from"!==e.role).map(e=>e.text.trim()).filter(Boolean).join("\n");this.setState(t=>({contributor:{...t.contributor,shipTo:e?t.composer.home?"self":"recipient":"digital",from:n,firstName:t.contributor.firstName.trim(),lastName:t.contributor.lastName.trim(),message:a}}),()=>t?this.setComposer({paying:!0}):this.submitContributionOnly())}renderTextInput(e,t,n,o){const{error:r}=this.state,i=(0,m.XC)(e.style),s=!(!i.row&&!i.drawn)&&e.text.trim(),l=s?16:(0,m.xP)(e)*e.s*n,c=Math.min(1,l/16),d="from"===e.role&&"from"===o,h=this.state.design.texts.filter(t=>t!==e).sort((t,n)=>Math.abs(t.y-e.y)-Math.abs(n.y-e.y))[0],p=!!h&&h.y<e.y,y=s?e.y+(0,m.DU)(e).h/2*e.s+22/n:e.y,g={from:this.state.composer.group?{nl:"Jullie groep, bv. Team Noord",en:"Your group, e.g. Team North"}:{nl:"Je naam",en:"Your name"},message:{nl:"Schrijf je felicitatie",en:"Write your congratulations"},text:{nl:"Tekst",en:"Text"}};return a.Ay.createElement("div",{key:t,className:"composer-text "+(s?"aside":""),style:{left:`${(e.x/6).toFixed(2)}%`,top:`${(y/6).toFixed(2)}%`,width:s?"240px":`${(i.wrap*e.s*n/c).toFixed(1)}px`,fontSize:`${(l/c).toFixed(1)}px`,transform:s?"translate(-50%, 0)":`translate(-50%, -50%) rotate(${e.r}deg) scale(${c.toFixed(3)})`}},d?a.Ay.createElement("span",{className:"composer-tab "+(p?"under":"")},(0,u.Oj)({nl:"Teken hier",en:"Sign here"})):null,a.Ay.createElement("textarea",{ref:e=>{this.textInputs[t]=e},className:`composer-type ${i.id} ${d||"message"===e.role&&"message"===o?"sign":""} ${"from"===e.role&&r.from?"error":""}`,value:e.text,rows:Math.min(12,(0,m.DU)(e).rows),maxLength:m.b1.message,"aria-label":(0,u.Oj)(g[e.role]),placeholder:(0,u.Oj)(g[e.role]),autoComplete:"from"===e.role?"name":"off",onFocus:()=>{this.remember(),this.setComposer({selected:{type:"text",index:t}})},onChange:e=>this.changeElement({type:"text",index:t},{text:e.currentTarget.value})}))}renderWhere(e){const{contributor:t,composer:n,error:r}=this.state,i=(e,n,o,i)=>a.Ay.createElement(B.A,{type:"input",id:`sender-${e}`,className:r[e]?"error":"",style:{gridColumn:`span ${i}`},value:t[e],maxlength:60,placeholder:n,autoComplete:o,onChange:t=>this.setContributor({[e]:t.currentTarget.value},e)});return a.Ay.createElement(o.FK,null,a.Ay.createElement("div",{className:"composer-where",role:"group","aria-label":(0,u.Oj)({nl:"Waar gaat de kaart heen?",en:"Where does the card go?"})},a.Ay.createElement("button",{type:"button",className:"composer-where-choice option "+(n.home?"":"on"),"aria-pressed":!n.home,onClick:()=>this.setComposer({home:!1})},a.Ay.createElement("strong",null,(0,u.Oj)({nl:`Naar ${e}`,en:`To ${e}`})),a.Ay.createElement("span",null,(0,u.Oj)({nl:"zij krijgen hem in de bus",en:"they get it in the post"}))),a.Ay.createElement("button",{type:"button",className:"composer-where-choice option "+(n.home?"on":""),"aria-pressed":n.home,onClick:()=>this.setComposer({home:!0})},a.Ay.createElement("strong",null,(0,u.Oj)({nl:"Naar mij thuis",en:"To my home"})),a.Ay.createElement("span",null,(0,u.Oj)({nl:"om zelf te geven",en:"to give it yourself"})))),n.home?a.Ay.createElement("div",{className:"composer-fields address"},i("streetname",(0,u.Oj)({nl:"Straat",en:"Street"}),"address-line1",4),i("housenr",(0,u.Oj)({nl:"Nr.",en:"No."}),"off",2),i("postcode",(0,u.Oj)({nl:"Postcode",en:"Postcode"}),"postal-code",2),i("city",(0,u.Oj)({nl:"Plaats",en:"City"}),"address-level2",4)):null)}renderDetails(e,t,n){const{contributor:r,composer:i,error:s}=this.state,l=this.recipientLabel(),c=n&&n.text.trim(),d=t?a.Ay.createElement("ul",{className:"composer-receipt"},this.extras().map(e=>a.Ay.createElement("li",{key:e.key},a.Ay.createElement("span",null,e.count>1?`${e.count} × `:"",(0,u.Oj)(e.label)),a.Ay.createElement("span",null,"€",e.count*m.ze[e.key])))):null;return a.Ay.createElement("form",{className:"composer-sheet",onSubmit:e=>e.preventDefault()},a.Ay.createElement("div",{className:"composer-sheet-head"},a.Ay.createElement("strong",null,e?i.home?(0,u.Oj)({nl:"Je kaart, geprint en naar jou",en:"Your card, printed and posted to you"}):(0,u.Oj)({nl:`Je kaart, geprint en naar ${l}`,en:`Your card, printed and posted to ${l}`}):(0,u.Oj)({nl:"Je kaart, op het bord",en:"Your card, on the board"})),a.Ay.createElement("button",{type:"button",className:"composer-action",onClick:()=>this.setComposer(i.paying?{paying:!1}:{details:!1})},(0,u.Oj)({nl:"Terug",en:"Back"}))),i.paying?a.Ay.createElement(o.FK,null,d,this.createPaymentButton()):a.Ay.createElement(o.FK,null,a.Ay.createElement("p",{className:"note composer-sheet-note"}
1,c?(0,u.Oj)({nl:`Op de kaart staat "${c}". Aan wie sturen we de bevestiging?`,en:`The card says "${c}". Who gets the confirmation?`}):(0,u.Oj)({nl:"Van wie is deze kaart?",en:"Who is this card from?"})),a.Ay.createElement("div",{className:"composer-fields"},a.Ay.createElement(B.A,{type:"input",id:"sender-first-name",className:s.firstName?"error":"",value:r.firstName,maxlength:40,placeholder:(0,u.Oj)({nl:"Voornaam",en:"First name"}),autoComplete:"given-name",onChange:e=>this.setContributor({firstName:e.currentTarget.value},"firstName")}),a.Ay.createElement(B.A,{type:"input",id:"sender-last-name",value:r.lastName,maxlength:40,placeholder:(0,u.Oj)({nl:"Achternaam",en:"Last name"}),autoComplete:"family-name",onChange:e=>this.setContributor({lastName:e.currentTarget.value})}),a.Ay.createElement(B.A,{type:"email",id:"sender-email",className:s.email?"error":"",style:{gridColumn:"1 / -1"},value:r.email,placeholder:(0,u.Oj)({nl:"E-mail, voor je bevestiging",en:"Email, for your confirmation"}),autoComplete:"email",onChange:e=>this.setContributor({email:e.currentTarget.value},"email")})),e?this.renderWhere(l):null,i.group?a.Ay.createElement("p",{className:"note composer-sheet-note"}
1,(0,u.Oj)({nl:"Groepskaart: na het prikken krijg je een link om te delen, en iedereen tekent mee.",en:"Group card: once pinned you get a link to share, and everyone signs along."})):null,d,a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.confirmDetails(),disabled:!!this.state.contributionOnlySubmitting},this.state.contributionOnlySubmitting?(0,u.Oj)({nl:"Bezig...",en:"Working..."}):t?(0,u.Oj)({nl:`Naar betalen · €${t}`,en:`To payment · €${t}`}):(0,u.Oj)({nl:"Prik op het bord",en:"Pin it on the board"}))))}renderKadoAmount(e,t){const{design:n,contributor:o,error:r}=this.state,i=n.kado,s=this.recipientLabel(),l=i.y>300,c={left:`${(i.x/6).toFixed(2)}%`,top:`${((i.y+(l?-1:1)*(m.GO.h/2*i.s+18))/6).toFixed(2)}%`},d=this.getGiftAmount();return e?a.Ay.createElement("form",{className:"composer-kado-ask "+(l?"above":""),style:c,onSubmit:e=>{e.preventDefault(),this.confirmKado()}},a.Ay.createElement("label",{className:"composer-kado-field "+(r.customAmount?"error":"")},this.sym(),a.Ay.createElement("input",{ref:e=>{this.kadoInput=e},value:o.customAmount,placeholder:(0,u.Oj)({nl:"bedrag",en:"amount"}),onChange:e=>this.setKadoAmount(e.currentTarget.value)})),a.Ay.createElement(z.A,{type:"submit",className:"small",onClick:()=>this.confirmKado()},(0,u.Oj)({nl:"Klaar",en:"Done"})),a.Ay.createElement("span",{className:"composer-kado-how"},(0,u.Oj)({nl:`Dit kado zeg je toe aan ${s}.`,en:`A gift you commit to giving ${s}.`}))):a.Ay.createElement("button",{type:"button",className:`composer-kado-note ${l?"above":""} ${t?"sign":""}`,style:c,onClick:()=>this.setComposer({selected:{type:"kado",index:0}})},d>=5?`${this.sym()}${d}`:(0,u.Oj)({nl:"Hoeveel?",en:"How much?"}))}renderSelection(e){const{design:t}=this.state,n=this.elementBox(e);return a.Ay.createElement("div",{className:"composer-frame",style:{left:`calc(${((n.x-n.w/2)/6).toFixed(2)}% - 12px)`,top:`calc(${((n.y-n.h/2)/6).toFixed(2)}% - 12px)`,width:`calc(${(n.w/6).toFixed(2)}% + 24px)`,height:`calc(${(n.h/6).toFixed(2)}% + 24px)`,transform:`rotate(${n.r}deg)`}},a.Ay.createElement("button",{type:"button",className:"composer-handle remove","aria-label":(0,u.Oj)({nl:"Weghalen",en:"Remove"}),onClick:()=>this.removeSelected(),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="14" height="14" aria-hidden="true"><path d="M5 5l10 10M15 5L5 15" stroke="currentColor" stroke-width="2.4" stroke-linecap="round"/></svg>'}}),a.Ay.createElement("span",{className:"composer-handle turn",title:(0,u.Oj)({nl:"Sleep om te draaien",en:"Drag to turn"}),onPointerDown:e=>this.startHandle(e,"turn"),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="16" height="16" aria-hidden="true"><path d="M15.5 9.5a5.5 5.5 0 1 1-2-4.3M14 2v4h-4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),a.Ay.createElement("span",{className:"composer-handle size",title:(0,u.Oj)({nl:"Sleep om groter of kleiner te maken",en:"Drag to resize"}),onPointerDown:e=>this.startHandle(e,"size"),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="14" height="14" aria-hidden="true"><path d="M5 5l10 10M5 10V5h5M15 10v5h-5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),"text"===e.type?a.Ay.createElement("span",{className:"composer-handle move",title:(0,u.Oj)({nl:"Sleep om te verplaatsen",en:"Drag to move"}),onPointerDown:e=>this.startHandle(e,"move"),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="16" height="16" aria-hidden="true"><path d="M10 2v16M2 10h16M7 5l3-3 3 3M7 15l3 3 3-3M5 7l-3 3 3 3M15 7l3 3-3 3" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}):null,"photo"===e.type&&t.photos[e.index]?a.Ay.createElement("button",{type:"button",className:"composer-handle photo","aria-label":(0,u.Oj)({nl:"Andere foto",en:"Other photo"}),onClick:()=>this.pickPhoto(e.index),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="15" height="15" aria-hidden="true"><path d="M3 6h3l1.5-2h5L14 6h3v10H3z" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linejoin="round"/><circle cx="10" cy="11" r="3" fill="none" stroke="currentColor" stroke-width="1.8"/></svg>'}}):null)}renderComposer(){const{gift:e}=this.props,{contributor:t,design:n,composer:r,photoBusy:i,error:s,editing:l}=this.state,{size:c,lift:d,narrow:h}=M(window.innerWidth,window.innerHeight),p=!l||l.paid,y=this.isPosted(),g=this.getOrderTotal(),f=this.fromText(),b=n.texts.findIndex(e=>"message"===e.role),k=n.texts[b],v=this.senderName().length>=2,w=n.texts.some(e=>e.text.trim())||n.frames.length||n.stickers.length,A=!n.kado||this.getGiftAmount()>=5,E=k&&!k.text.trim()?"message":!v&&f?"from":A?"send":"kado",x=r.selected,j=x&&"text"===x.type?x.index:null,N=x&&"photo"===x.type&&n.photoOriginals[x.index]?x.index:null;this.recipientLabel();const O=n.texts.map((e,t)=>t===j||!e.text.trim()),C=O.reduce((e,t,a)=>{const o=n.texts[a],r=(0,m.XC)(o.style);return!t||(r.row||r.drawn)&&o.text.trim()?e:[...e,a]},[]);this.textInputs={};const $=[];
1return k&&!k.text.trim()&&$.push(a.Ay.createElement("div",{key:"suggestions",className:"composer-row"},this.messageSuggestions().slice(0,3).map((e,t)=>a.Ay.createElement("button",{type:"button",key:t,className:"option-chip small",onClick:()=>{this.remember(),this.changeElement({type:"text",index:b},{text:(0,u.Oj)(e.text)})}},(0,u.Oj)(e.label))))),l?$.push(a.Ay.createElement("div",{key:"send",className:"composer-row send sign"},a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.saveEdit(),disabled:!!this.state.contributionOnlySubmitting},this.state.contributionOnlySubmitting?(0,u.Oj)({nl:"Bezig...",en:"Working..."}):(0,u.Oj)({nl:"Bewaar je kaart",en:"Save your card"})))):w&&($.push(a.Ay.createElement("div",{key:"ways",className:"composer-row ways"},a.Ay.createElement("button",{type:"button",className:"option-chip small "+(y?"":"selected"),"aria-pressed":!y,onClick:()=>this.setComposer({post:!1})},(0,u.Oj)({nl:"Alleen op het bord",en:"Board only"})),a.Ay.createElement("button",{type:"button",className:"option-chip small "+(y?"selected":""),"aria-pressed":y,onClick:()=>this.setComposer({post:!0})},(0,u.Oj)({nl:`Ook per post · €${m.ze.post}`,en:`Also by post · €${m.ze.post}`})))),$.push(a.Ay.createElement("div",{key:"send",className:"composer-row send "+("send"===E?"sign":"")},a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.send()},y?(0,u.Oj)({nl:`Prik en verstuur · €${g}`,en:`Pin and send · €${g}`}):g?(0,u.Oj)({nl:`Prik op het bord · €${g}`,en:`Pin it on the board · €${g}`}):(0,u.Oj)({nl:"Prik op het bord",en:"Pin it on the board"}))))),a.Ay.createElement("div",{className:`composer ${h?"narrow":"wide"} bar-${r.details?0:$.length} ${null!==j?"picking-letter":""} ${null!==N?"picking-look":""}`,style:{"--card":`${c}px`,"--lift":`${d}px`}},a.Ay.createElement("div",{className:"composer-corner"},a.Ay.createElement("button",{type:"button",className:"composer-step",disabled:!this.state.history.undo,onClick:()=>this.undo(),"aria-label":(0,u.Oj)({nl:"Ongedaan maken",en:"Undo"}),title:(0,u.Oj)({nl:"Ongedaan maken (⌘Z)",en:"Undo (⌘Z)"}),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><path d="M7 5L3 9l4 4M3.5 9H12a4.5 4.5 0 0 1 0 9h-2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),a.Ay.createElement("button",{type:"button",className:"composer-step",disabled:!this.state.history.redo,onClick:()=>this.redo(),"aria-label":(0,u.Oj)({nl:"Opnieuw",en:"Redo"}),title:(0,u.Oj)({nl:"Opnieuw (⇧⌘Z)",en:"Redo (⇧⌘Z)"}),dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="18" height="18" aria-hidden="true"><path d="M13 5l4 4-4 4M16.5 9H8a4.5 4.5 0 0 0 0 9h2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}),a.Ay.createElement("button",{type:"button",className:"composer-close",onClick:()=>{l&&this.setState({editing:null,started:!1}),this.setView("Landing")},"aria-label":(0,u.Oj)({nl:"Stoppen",en:"Stop"})},"×")),a.Ay.createElement("div",{className:"composer-card",ref:e=>{this.cardElement=e},style:{"--ink":(0,m.Bs)(n.theme).ink,"--accent":(0,m.Bs)(n.theme).accent},onPointerDown:e=>this.cardPointer(e,"down"),onPointerMove:e=>this.cardPointer(e,"move"),onPointerUp:e=>this.cardPointer(e,"up"),onPointerCancel:e=>this.cardPointer(e,"up")},a.Ay.createElement("span",{className:"composer-art",dangerouslySetInnerHTML:{__html:(0,m.l9)(this.editCard(C))}}),n.texts.map((e,t)=>O[t]?this.renderTextInput(e,t,c/600,E):null),x?this.renderSelection(x):null,n.kado?this.renderKadoAmount(x&&"kado"===x.type,"kado"===E):null,null!==i?a.Ay.createElement("span",{className:"composer-busy"},"draw"===i.doing?(0,u.Oj)({nl:"Je foto wordt getekend...",en:"Drawing your photo..."}):(0,u.Oj)({nl:"Je foto komt eraan...",en:"Your photo is on its way..."})):null),(()=>{const t=a.Ay.createElement(o.FK,null,m.o9.map(e=>a.Ay.createElement("button",{type:"button",key:e.id,className:"designer-design "+(n.theme===e.id?"selected":""),title:(0,u.Oj)(e.label),onClick:()=>{this.remember(),this.setDesign({theme:e.id})},dangerouslySetInnerHTML:{__html:(0,m.l9)({kind:"front",theme:e.id})}}))),s=a.Ay.createElement(o.FK,null,p?a.Ay.createElement("button",{type:"button",className:"composer-tool photo",onPointerDown:e=>this.startPaletteDrag(e,"photo")},a.Ay.createElement("span",{className:"composer-tool-name"},(0,u.Oj)({nl:"+ Foto",en:"+ Photo"}),a.Ay.createElement("span",{className:"composer-price"},"€",m.ze.photo))):null,l?null:a.Ay.createElement(o.FK,null,a.Ay.createElement("button",{type:"button",className:"composer-tool post "+(y?"on":""),"aria-pressed":y,onClick:()=>this.setComposer({post:!r.post})},a.Ay.createElement("span",{className:"composer-tool-name"},y?a.Ay.createElement("span",{className:"composer-tick",dangerouslySetInnerHTML:{__html:'<svg viewBox="0 0 20 20" width="14" height="14" aria-hidden="true"><path d="M4.5 10.5l3.5 3.5 7.5-8" fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"/></svg>'}}):"+ ",(0,u.Oj)({nl:"Print + verstuur",en:"Print + post"}),a.Ay.createElement("span",{className:"composer-price"},"€",m.ze.post)),a.Ay.createElement("span",{className:"composer-tool-note"},(0,u.Oj)({nl:"een echte kaart per post",en:"a real card by post"}))),a.Ay.createElement("button",{type:"button",className:"composer-tool group "+(r.group?"on":""),"aria-pressed":r.group,onClick:()=>this.setComposer({group:!r.group})},a.Ay.createElement("span",{className:"composer-tool-name"},(0,u.Oj)({nl:"Groepskaart",en:"Group card"})),a.Ay.createElement("span",{className:"composer-tool-note"},(0,u.Oj)({nl:"laat anderen meetekenen",en:"let others sign it"}))),e.canGive?a.Ay.createElement("button",{type:"button",className:"composer-tool kado",onPointerDown:e=>this.startPaletteDrag(e,"kado")},(0,u.Oj)({nl:"+ Kado",en:"+ Gift"})):null),a.Ay.createElement("button",{type:"button",className:"composer-tool",onClick:()=>this.addText()},(0,u.Oj)({nl:"+ Tekst",en:"+ Text"}))),c=a.Ay.createElement(o.FK,null,m.D3.filter(e=>p||!e.move).map(e=>a.Ay.createElement("button",{type:"button",key:e.id,className:`designer-sticker ${e.move||""}`,title:e.move?(0,u.Oj)({nl:"Beweegt op het bord",en:"Moves on the board"}):null,onPointerDown:t=>this.startPaletteDrag(t,"sticker",e.id)},a.Ay.createElement("span",{dangerouslySetInnerHTML:{__html:`<svg viewBox="0 0 100 100" width="100%" height="100%">${e.svg}</svg>`}}),e.move?a.Ay.createElement("span",{className:"composer-price"},"€",m.ze.move):null))),d=null!==j?a.Ay.createElement(o.FK,null,a.Ay.createElement("div",{className:"composer-colors",role:"group","aria-label":(0,u.Oj)({nl:"Kleur",en:"Colour"})},(0,m.XC)(n.texts[j].style).mixed?a.Ay.createElement("button",{type:"button",className:"composer-color mixed "+(null===(0,m.gs)(n.texts[j])?"selected":""),title:(0,u.Oj)({nl:"Bont",en:"Mixed"}),"aria-label":(0,u.Oj)({nl:"Bont",en:"Mixed"}),"aria-pressed":null===(0,m.gs)(n.texts[j]),onPointerDown:e=>e.preventDefault(),onClick:()=>{this.remember(),this.changeElement(x,{color:void 0})}}):null,(0,m.Bs)(n.theme).colors.map((e,t)=>a.Ay.createElement("button",{type:"button",key:t,className:"composer-color "+((0,m.gs)(n.texts[j])===t?"selected":""),style:{background:e},"aria-label":(0,u.Oj)({nl:`Kleur ${t+1}`,en:`Colour ${t+1}`}),"aria-pressed":(0,m.gs)(n.texts[j])===t,onPointerDown:e=>e.preventDefault(),onClick:()=>{this.remember(),this.changeElement(x,{color:t})}}))),m.rL.map(e=>{const t=(0,u.Oj)(e.label);return a.Ay.createElement("button",{type:"button",key:e.id,className:"composer-style "+(n.texts[j].style===e.id?"selected":""),title:(0,u.Oj)(e.label),"aria-label":(0,u.Oj)(e.label),"aria-pressed":n.texts[j].style===e.id,onPointerDown:e=>e.preventDefault(),onClick:()=>{this.remember(),this.changeElement(x,{style:e.id})},dangerouslySetInnerHTML:{__html:(0,m.O6)((0,m.Bs)("creme"),{style:e.id,text:t})}})})):null,g=null!==N?a.Ay.createElement(o.FK,null,m.Yu.map(e=>a.Ay.createElement("button",{type:"button",key:e.id,className:"composer-style look "+(n.photoStyles[N]===e.id?"selected":""),disabled:null!==i,onPointerDown:e=>e.preventDefault(),onClick:()=>this.stylePhoto(N,e.id)},a.Ay.createElement("img",{src:`/img/felicitatie/photo-${e.id}.jpg`,alt:""}),a.Ay.createElement("span",null,(0,u.Oj)(e.label)))),n.frames[N].cutout?null:a.Ay.createElement("button",{type:"button",className:"composer-style look frame "+(n.frames[N].bare?"":"selected"),"aria-pressed":!n.frames[N].bare,onPointerDown:e=>e.preventDefault(),onClick:()=>this.toggleFrame(N)},a.Ay.createElement("span",{className:"composer-frame-sample"}),a.Ay.createElement("span",null,(0,u.Oj)({nl:"Lijst",en:"Frame"})))):null;return h?this.renderTray(t,s,c,d,g,x):a.Ay.createElement(o.FK,null,a.Ay.createElement("div",{className:"composer-rail left",role:"group","aria-label":(0,u.Oj)({nl:"Ontwerp",en:"Design"})},t),a.Ay.createElement("div",{className:"composer-rail right"},s,a.Ay.createElement("div",{className:"composer-stickers"},c)),d?a.Ay.createElement("div",{className:"composer-context",role:"group","aria-label":(0,u.Oj)({nl:"Letter",en:"Lettering"})},d):null,g?a.Ay.createElement("div",{className:"composer-context",role:"group","aria-label":(0,u.Oj)({nl:"Stijl",en:"Look"})},g):null)})(),a.Ay.createElement("input",{type:"file",accept:"image/*",className:"composer-file",ref:e=>{this.photoInput=e},onChange:e=>{this.fillPhoto(e.currentTarget.files[0]),e.currentTarget.value=""}}),r.details||!$.length?null:a.Ay.createElement("div",{className:"composer-bar "+(1===$.length?"single":"")},$),r.details?this.renderDetails(y,g,f):null)}renderTray(e,t,n,o,r,i){const{composer:s}=this.state,l=o?"tekst":r?"foto":null,c=i?i.type+i.index:null,m=l&&s.tabAway!==c?l:s.tab;return a.Ay.createElement("div",{className:"composer-tray"},a.Ay.createElement("div",{className:"composer-tray-tabs",role:"tablist"},l?a.Ay.createElement("button",{type:"button",role:"tab",className:"composer-tray-tab context "+(m===l?"selected":""),"aria-selected":m===l,onPointerDown:e=>e.preventDefault(),onClick:()=>this.setComposer({tabAway:null})},"tekst"===l?(0,u.Oj)({nl:"Letters",en:"Lettering"}):(0,u.Oj)({nl:"Foto",en:"Photo"})):null,[["kaart",{nl:"Kaart",en:"Card"}],["stickers",{nl:"Stickers",en:"Stickers"}],["extra",{nl:"Extra",en:"Extras"}]].map(([e,t])=>a.Ay.createElement("button",{type:"button",role:"tab",key:e,className:"composer-tray-tab "+(m===e?"selected":""),"aria-selected":m===e,onPointerDown:e=>e.preventDefault(),onClick:()=>this.setComposer({tab:e,tabAway:c})},(0,u.Oj)(t)))),a.Ay.createElement("div",{className:`composer-tray-panel ${m}`,role:"tabpanel"},{kaart:e,stickers:n,extra:t,tekst:o,foto:r}[m]))}paymentDescription(e){return`${(0,u.Oj)({nl:"Kado",en:"Gift"})} ${e}`.trim()}renderPaymentMethod(e,{link:t,iban:n,amount:o,recipientName:r,description:i,exp
1anded:s,sym:l="€"}){if("request"===e&&t)return a.Ay.createElement("div",{className:"tikkie-section"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Betaal ${l}${o} via het betaalverzoek van ${r}. Dit gaat direct naar ${r}.`,en:`Pay ${l}${o} through ${r}'s payment request. It goes directly to ${r}.`})),a.Ay.createElement("a",{href:t,className:"button",target:"_blank",rel:"noopener noreferrer"},(0,u.Oj)({nl:`Betaal ${l}${o}`,en:`Pay ${l}${o}`})));if("paypal"===e&&t){const e=t.replace(/\/+$/,"")+"/"+o+("$"===l?"USD":"EUR"),n=a.Ay.createElement("div",{className:"tikkie-section"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Maak ${l}${o} over via onderstaande PayPal link. Dit gaat direct naar ${r}.`,en:`Send ${l}${o} via the PayPal link below. It goes directly to ${r}.`})),a.Ay.createElement("a",{href:e,className:"button paypal-button",target:"_blank",rel:"noopener noreferrer"},(0,u.Oj)({nl:`Betaal ${l}${o} via PayPal`,en:`Pay ${l}${o} with PayPal`})));return s?n:a.Ay.createElement("details",{className:"payment-alt"},a.Ay.createElement("summary",null,(0,u.Oj)({nl:"Betaal via PayPal",en:"Pay with PayPal"})),n)}if("venmo"===e&&t){const e=a.Ay.createElement("div",{className:"tikkie-section"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Betaal ${l}${o} via Venmo. Dit gaat direct naar ${r}.`,en:`Send ${l}${o} on Venmo. It goes directly to ${r}.`})),a.Ay.createElement("a",{href:t,className:"button venmo-button",target:"_blank",rel:"noopener noreferrer"},(0,u.Oj)({nl:"Open Venmo",en:"Open Venmo"}
1)));return s?e:a.Ay.createElement("details",{className:"payment-alt"},a.Ay.createElement("summary",null,(0,u.Oj)({nl:"Betaal via Venmo",en:"Pay with Venmo"})),e)}if("tikkie"===e&&t){const e=a.Ay.createElement("div",{className:"tikkie-section"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Maak ${l}${o} over via onderstaande Tikkie link. Dit gaat direct naar ${r}.`,en:`Transfer ${l}${o} via the Tikkie link below. This goes directly to ${r}.`})),a.Ay.createElement("a",{href:t,className:"button tikkie-button",target:"_blank",rel:"noopener noreferrer"},(0,u.Oj)({nl:`Betaal ${l}${o} via Tikkie`,en:`Pay ${l}${o} via Tikkie`})));return s?e:a.Ay.createElement("details",{className:"payment-alt"},a.Ay.createElement("summary",null,(0,u.Oj)({nl:"Betaal via Tikkie",en:"Pay via Tikkie"})),e)}if("bancontact"===e&&t){const e=a.Ay.createElement("div",{className:"tikkie-section"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Maak ${l}${o} over via onderstaande Bancontact link. Dit gaat direct naar ${r}.`,en:`Transfer ${l}${o} via the Bancontact link below. This goes directly to ${r}.`})),a.Ay.createElement("a",{href:t,className:"button bancontact-button",target:"_blank",rel:"noopener noreferrer"},(0,u.Oj)({nl:`Betaal ${l}${o} via Bancontact`,en:`Pay ${l}${o} via Bancontact`})));return s?e:a.Ay.createElement("details",{className:"payment-alt"},a.Ay.createElement("summary",null,(0,u.Oj)({nl:"Betaal via Bancontact",en:"Pay via Bancontact"})),e)}if("iban"===e&&n){const e=a.Ay.createElement("div",{className:"tikkie-section"},a.Ay.createElement("div",{className:"iban-details"},a.Ay.createElement("div",{className:"iban-row"},a.Ay.createElement("span",{className:"iban-label"},"IBAN"),a.Ay.createElement("span",{className:"iban-value"},n.iban)),a.Ay.createElement("div",{className:"iban-row"},a.Ay.createElement("span",{className:"iban-label"},(0,u.Oj)({nl:"T.n.v.",en:"Name"})),a.Ay.createElement("span",{className:"iban-value"},n.name)),a.Ay.createElement("div",{className:"iban-row"},a.Ay.createElement("span",{className:"iban-label"},(0,u.Oj)({nl:"Bedrag",en:"Amount"})),a.Ay.createElement("span",{className:"iban-value"},l,o)),a.Ay.createElement("div",{className:"iban-row"},a.Ay.createElement("span",{className:"iban-label"},(0,u.Oj)({nl:"Omschrijving",en:"Description"})),a.Ay.createElement("span",{className:"iban-value"},i))));return s?e:a.Ay.createElement("details",{className:"payment-alt"},a.Ay.createElement("summary",null,(0,u.Oj)({nl:"Maak over via IBAN",en:"Transfer via IBAN"})),e)}return null}renderPaymentCTA(){const{gift:e}=this.props,{paymentLink:t,bancontactLink:n,ibanDetails:o,paypalLink:r,venmoLink:i,requestLink:s,contributor:l}=this.state,c=this.getGiftAmount(),m=this.paymentMethodFor(this.state),d=this.recipientLabel(),u=[{type:"tikkie",link:t},{type:"bancontact",link:n},{type:"paypal",link:r},{type:"venmo",link:i},{type:"request",link:s},{type:"iban",iban:o}].filter(e=>e.link||e.iban);if(!u.length)return null;const h=`${l.firstName} ${l.lastName}`.trim(),p={amount:c,recipientName:d,description:this.paymentDescription(h),sym:this.sym()};return a.Ay.createElement("div",{className:"payment-methods"},u.map(e=>a.Ay.createElement(a.Ay.Fragment,{key:e.type},this.renderPaymentMethod(e.type,{...p,...e,expanded:e.type===m}))))}renderConfirmation(){const{paymentStatus:e}=this.state;if(!e||"checking"===e)return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation"},a.Ay.createElement("p",{className:"checking-status"},(0,u.Oj)({nl:"Betaling wordt gecontroleerd...",en:"Verifying payment..."})));if("failed"===e||"canceled"===e)return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation"},a.Ay.createElement("div",{className:"confirmation-icon error"},"✗"),a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Betaling niet gelukt",en:"Payment failed"})),a.Ay.createElement("p",null,(0,u.Oj)({nl:"Je betaling is niet gelukt of geannuleerd. Probeer het opnieuw.",en:"Your payment was not successful or was cancelled. Please try again."})),a.Ay.createElement(z.A,{type:"button",onClick:()=>this.setView("Landing")},(0,u.Oj)({nl:"Terug naar het bord",en:"Back to the board"})));if("unknown"===e||"processing"===e)return a.Ay.createElement("div",{key:"c
1onfirmation",className:"envelope-step envelope-confirmation"},a.Ay.createElement("div",{className:"confirmation-icon warning"},"?"),a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Status onbekend",en:"Status unknown"})),a.Ay.createElement("p",null,(0,u.Oj)({nl:"We konden de status van je betaling niet verifiëren. Controleer je e-mail voor een bevestiging.",en:"We couldn't verify your payment status. Please check your email for confirmation."})),a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.setView("Landing")},(0,u.Oj)({nl:"Terug naar het bord",en:"Back to the board"})));const t=this.recipientLabel(),n=this.getGiftAmount()>0;return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation"},a.Ay.createElement(H,null),a.Ay.createElement("h2",null,this.state.skipEnvelope?(0,u.Oj)({nl:"Je felicitatie staat op de pagina!",en:"Your congratulations are on the page!"}):(0,u.Oj)({nl:"Je kaart wordt verstuurd!",en:"Your card will be sent!"})),a.Ay.createElement("p",null,this.state.skipEnvelope?(0,u.Oj)({nl:`We hebben hem ook naar ${t} gemaild.`,en:`We have emailed them to ${t} too.`}):this.state.shipHome?(0,u.Oj)({nl:"Hij hangt al op het prikbord. De kaart wordt geprint en komt binnen een paar werkdagen bij jou thuis, om zelf te geven.",en:"It is on the board already. The card is printed and reaches your home within a few working days, for you to give."}):(0,u.Oj)({nl:`Hij hangt al op het prikbord. De kaart met je felicitatie wordt geprint en gaat met de eerstvolgende postronde naar ${t}.`,en:`It is on the board already. The card with your congratulations is printed and goes with the next postal run to ${t}.`})),this.renderPaymentCTA(),this.renderSignShare(),this.state.editHash?a.Ay.createElement("p",{className:"note tikkie-note"},(0,u.Oj)({nl:"Een typfout gezien? ",en:"Spotted a typo? "}),a.Ay.createElement("a",{href:`#${this.state.editHash}`},(0,u.Oj)({nl:"Pas je kaart aan",en:"Change your card"})),this.state.skipEnvelope?".":(0,u.Oj)({nl:", zolang hij nog niet gedrukt is.",en:", as long as it is not printed yet."})):null,n&&"open"===this.state.offer?a.Ay.createElement("div",{className:"call-out"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Je kado van ${this.sym()}${this.getGiftAmount()} hebben we aan ${t} doorgegeven. Zodra we weten hoe ${t} het ${(0,_.oz)(t)?"willen":"wil"} ontvangen, mailen we je hoe je het overmaakt.`,en:`We passed your gift of ${this.sym()}${this.getGiftAmount()} on to ${t}. As soon as we know how ${t} ${(0,_.oz)(t)?"want":"wants"} to receive it, we will email you how to transfer it.`}))):n?a.Ay.createElement("p",{className:"note tikkie-note"},(0,u.Oj)({nl:"Je ontvangt ook een e-mail met de betaalinstructies.",en:"You'll also receive an email with payment instructions."})):null,a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.setView("Landing")},(0,u.Oj)({nl:"Bekijk het bord",en:"See the board"})))}signUrl(){return`${window.location.origin}${window.location.pathname}#${this.state.signHash}`}renderSignShare(){if(!this.state.signHash)return null;const e=this.signUrl(),t=(0,u.Oj)({nl:`Teken je mee? Onze kaart voor ${this.recipientLabel()}:`,en:`Will you sign too? Our card for ${this.recipientLabel()}:`});return a.Ay.createElement("div",{className:"sign-share"},a.Ay.createElement("p",null,(0,u.Oj)({nl:"Deel deze link in je groep, dan tekent iedereen mee. We hebben hem je ook gemaild.",en:"Share this link with your group, so everyone can sign. We emailed it to you too."})),a.Ay.createElement(K.A,{id:"sign",url:e,title:(0,u.Oj)({nl:`Onze kaart voor ${this.recipientLabel()}`,en:`Our card for ${this.recipientLabel()}`}),text:t,onMessage:this.props.onMessage}))}signHashParts(){const e=window.location.hash.match(/teken-([a-zA-Z0-9]+)-([a-f0-9]+)/i);return e?{key:e[1],token:e[2]}:null}async sendSign(){const{gift:e,onMessage:t}=this.props,{sign:n}=this.state,a=this.signHashParts();if(!a||n.name.trim().length<2)return void t((0,u.Oj)({nl:"Vul je naam in.",en:"Fill in your name."}));this.setState({sign:{...n,busy:!0}});const o=await(0,_.FH)("/felicitatie",{m:"sign",envelopieKey:e.envelopieKey,contributionKey:a.key,token:a.token,name:n.name.trim()}).catch(()=>({error:"failed"}));if(!o.success){this.setState({sign:{...n,busy:!1}});const e={not_found:{nl:"Deze kaart vinden we niet meer.",en:"We cannot find this card anymore."},name:{nl:"Vul een naam in van 2 tot 40 tekens.",en:"Fill in a name of 2 to 40 characters."},full:{nl:"Deze kaart staat vol.",en:"This card is full."},failed:{nl:"Er ging iets mis. Probeer het opnieuw.",en:"Something went wrong. Please try again."}};return void t((0,u.Oj)(e[o.error]||e.failed))}(0,l.u4)("envelopie-sign",e.envelopieKey),this.setState({sign:{...n,busy:!1,signed:o.signers}}),this.loadContributions()}renderSign(){const{sign:e}=this.state,t=this.signHashParts(),n=t&&this.state.contributions.find(e=>e.key===t.key),o=n?n.from:"";return e.signed?a.Ay.createElement("div",{className:"envelope-step envelope-confirmation"},a.Ay.createElement(H,null),a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Je staat erop!",en:"You are on it!"})),a.Ay.createElement("p",null,(0,u.Oj)({nl:`${e.signed.length} ${1===e.signed.length?"naam":"namen"} op de kaart van ${o}.`,en:`${e.signed.length} ${1===e.signed.length?"name":"names"} on the card from ${o}.`})),a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.setView("Landing")},(0,u.Oj)({nl:"Bekijk het bord",en:"See the board"}))):a.Ay.createElement("div",{className:"envelope-step sign-card"},a.Ay.createElement("h2",null,(0,u.Oj)({nl:`Voeg je naam toe aan de k
1aart voor ${this.recipientLabel()}`,en:`Add your name to the card for ${this.recipientLabel()}`})),a.Ay.createElement("p",null,o?(0,u.Oj)({nl:`${o} maakte een felicitatiekaart voor ${this.recipientLabel()} en vraagt je om mee te tekenen. Vul je naam in, dan staat die erbij.`,en:`${o} made a congratulations card for ${this.recipientLabel()} and asks you to sign it too. Enter your name and it goes on the card.`}):(0,u.Oj)({nl:`Vul je naam in, dan staat die bij de felicitaties voor ${this.recipientLabel()}.`,en:`Enter your name and it goes with the congratulations for ${this.recipientLabel()}.`})),a.Ay.createElement("div",{className:"composer-row"},a.Ay.createElement("input",{className:"composer-name",value:e.name,maxLength:40,autoComplete:"name",placeholder:(0,u.Oj)({nl:"Je naam",en:"Your name"}),onChange:t=>this.setState({sign:{...e,name:t.currentTarget.value}})}),a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.sendSign(),disabled:e.busy},(0,u.Oj)({nl:"Zet mijn naam erbij",en:"Add my name"}))))}async withdrawContribution(){const{contributeData:e}=this.state;try{const t=await(0,_.FH)("/response",{m:"withdraw-contribution",contributionKey:e.contributionKey});t.success?this.setState(e=>({contributeData:{...e.contributeData,withdrawn:!0}})):t.error&&this.props.onMessage((0,u.Oj)({nl:"Verwijderen lukte niet meer: de kaart is al verstuurd.",en:"Removing is no longer possible: the card has been sent."}))}catch(e){this.props.onMessage((0,u.Oj)({nl:"Er ging iets mis. Probeer het opnieuw.",en:"Something went wrong. Please try again."}))}}async flagPaid(e){const{contributeData:t}=this.state;try{const n=await(0,_.FH)("/response",{m:"flag-contribution-paid",contributionKey:t.contributionKey,gifterPaid:e?1:""});n.success&&this.setState(e=>({contributeData:{...e.contributeData,gifterPaid:n.gifterPaid}}))}catch(e){this.props.onMessage((0,u.Oj)({nl:"Er ging iets mis. Probeer het opnieuw.",en:"Something went wrong. Please try again."}))}}renderCardSchedule(){const{contributeData:e}=this.state;if("digital"===e.type){const t=e.recipientName||(0,u.Oj)({nl:"de ontvanger",en:"the recipient"});return a.Ay.createElement("div",{className:"call-out card-schedule"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Je digitale kaart is per e-mail bezorgd bij ${t}.`,en:`Your digital card was delivered to ${t} by email.`})))}if("envelope"!==e.type)return null;const t=e.recipientName||(0,u.Oj)({nl:"de ontvanger",en:"the recipient"});return e.cardSent?a.Ay.createElement("div",{className:"call-out card-schedule"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Je kaart is op ${this.formatDate(e.sendDate)} verstuurd naar ${t}.`,en:`Your card was sent on ${this.formatDate(e.sendDate)} to ${t}.`}))):a.Ay.createElement("div",{className:"call-out card-schedule"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Je kaart wordt geprint en gaat met de eerstvolgende postronde naar ${t}.`,en:`Your card is printed and goes with the next postal run to ${t}.`})))}claimHash(){const e=window.location.hash.match(/claim-([a-zA-Z0-9]+)-([a-f0-9]+)/i);return e?{contributionKey:e[1],token:e[2]}:null}async claimRequest(e){return window.fetch("/felicitatie",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...e,...this.claimHash()}),credentials:"same-origin"}).then(e=>e.json()).catch(()=>({error:"failed"}))}async loadClaim(){this.setState({claim:null});const e=await this.claimRequest({m:"offer"});if(!e.success)return void this.setState({claim:{error:!0}});const t=e.giftDetails;this.setState({claim:{...e,method:"iban",iban:t?t.iban:"",name:t?t.name:"",url:"",remember:!0}})}setClaim(e){this.setState(t=>({claim:{...t.claim,...e},error:{}}))}async sendClaim(){const{claim:e}=this.state;this.setClaim({busy:!0});const t=await this.claimRequest({m:"claim",method:e.method,iban:e.iban,name:e.name,url:e.url,remember:"iban"===e.method&&e.remember});if(!t.success)return this.setClaim({busy:!1}),this.setState({error:"invalid_iban"===t.error?{claimIban:!0}:{claimUrl:!0}}),void this.props.onMessage((0,u.Oj)({invalid_iban:{nl:"Dit rekeningnummer klopt niet. Controleer het IBAN en de naam.",en:"This account number is not right. Check the IBAN and the name."},invalid_link:{nl:"Plak de link van je betaalverzoek, zoals een Tikkie.",en:"Paste the link of your payment request, such as a Tikkie."}}[t.error]||{nl:"Er ging iets mis. Probeer het opnieuw.",en:"Something went wrong. Please try again."}));(0,l.u4)("felicitatie-claim",this.props.gift.envelopieKey),this.setClaim({busy:!1,done:t.sent})}renderClaim(){const{claim:e,error:t}=this.state;if(!e)return a.Ay.createElement("div",{key:"claim",className:"envelope-step envelope-confirmation"},a.Ay.createElement("p",{className:"checking-status"},(0,u.Oj)({nl:"Laden...",en:"Loading..."})));if(e.error)return a.Ay.createElement("div",{key:"claim",className:"envelope-step envelope-confirmation"},a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Niet gevonden",en:"Not found"}
1)),a.Ay.createElement("p",null,(0,u.Oj)({nl:"Dit kado-aanbod vinden we niet meer.",en:"We cannot find this gift offer anymore."})));const n=`${V(e.currency)}${e.amount}`;if(e.done){const t=e.done-1;return a.Ay.createElement("div",{key:"claim",className:"envelope-step envelope-confirmation"},a.Ay.createElement(H,null),a.Ay.createElement("h2",null,(0,u.Oj)({nl:`Verstuurd naar ${e.from}`,en:`Sent to ${e.from}`})),a.Ay.createElement("p",null,t?(0,u.Oj)({nl:`${e.from} en ${t} ${1===t?"ander":"anderen"} die een kado aanboden krijgen nu een mail met hoe ze het overmaken. Nieuwe aanbiedingen krijgen je rekeningnummer meteen.`,en:`${e.from} and ${t} ${1===t?"other":"others"} who offered a gift now get an email with how to transfer it. New offers get your account number right away.`}):(0,u.Oj)({nl:`${e.from} krijgt nu een mail met hoe het kado van ${n} over te maken. Het geld komt rechtstreeks bij jou binnen.`,en:`${e.from} now gets an email with how to transfer the ${n} gift. The money goes straight to you.`})),a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.setView("Landing")},(0,u.Oj)({nl:"Naar je prikbord",en:"To your board"})))}const r=(0,u.Oj)({nl:"Tikkie","nl-be":"Bancontact-betaalverzoek",en:"payment request"});return a.Ay.createElement("div",{key:"claim",className:"envelope-step envelope-claim"},a.Ay.createElement("div",{className:"call-out"},a.Ay.createElement("p",null,"sent"===e.offer?(0,u.Oj)({nl:`${e.from} heeft je betaalgegevens al gekregen. Stuur je nieuwe, dan krijgt ${e.from} die.`,en:`${e.from} already has your payment details. Send new ones and ${e.from} gets those.`}):(0,u.Oj)({nl:`${e.from} wil je ${n} geven. Laat weten hoe je het wilt ontvangen, dan sturen wij het door. Het geld komt rechtstreeks bij jou binnen.`,en:`${e.from} would like to give you ${n}. Say how you would like to receive it and we pass it on. The money goes straight to you.`}))),a.Ay.createElement("form",{className:"gift-form"},a.Ay.createElement("div",{className:"claim-methods"},a.Ay.createElement("button",{type:"button",className:"option-chip "+("iban"===e.method?"selected":""),onClick:()=>this.setClaim({method:"iban"})},(0,u.Oj)({nl:"Rekeningnummer",en:"Account number"})),a.Ay.createElement("button",{type:"button",className:"option-chip "+("request"===e.method?"selected":""),onClick:()=>this.setClaim({method:"request"})},(0,u.Oj)({nl:"Betaalverzoek",en:"Payment request"}))),"iban"===e.method?a.Ay.createElement(o.FK,null,a.Ay.createElement("div",{className:"field row"},a.Ay.createElement(B.A,{label:"IBAN",id:"claimIban",placeholder:"NL00 BANK 0000 0000 00",value:e.iban,error:t,onChange:e=>this.setClaim({iban:e.currentTarget.value})}),a.Ay.createElement(B.A,{label:(0,u.Oj)({nl:"Ten name van",en:"Account holder"}),id:"claimName",placeholder:(0,u.Oj)({nl:"Naam rekeninghouder",en:"Account holder name"}),value:e.name,error:t,onChange:e=>this.setClaim({name:e.currentTarget.value})})),a.Ay.createElement(B.A,{type:"checkbox",id:"claimRemember",label:(0,u.Oj)({nl:"Stuur kado's voortaan meteen met dit rekeningnummer",en:"From now on, send gifts this account number right away"}),value:e.remember,onChange:e=>this.setClaim({remember:e.currentTarget.checked})})):a.Ay.createElement(B.A,{type:"url",id:"claimUrl",label:(0,u.Oj)({nl:`Je ${r} van ${n}`,en:`Your ${r} for ${n}`}),help:(0,u.Oj)({nl:`Maak in je bank-app een betaalverzoek van ${n}, bijvoorbeeld een Tikkie, en plak hier de link.`,en:`Create a payment request for ${n} in your banking app and paste its link here.`}),placeholder:"https://tikkie.me/...",value:e.url,error:t,onChange:e=>this.setClaim({url:e.currentTarget.value})}),a.Ay.createElement("div",{className:"field row end"},a.Ay.createElement(z.A,{type:"button",onClick:()=>this.sendClaim(),disabled:!!e.busy},(0,u.Oj)({nl:`Stuur naar ${e.from}`,en:`Send to ${e.from}`})))))}renderContribute(){const{contributeData:e,contributeLoading:t}=this.state;if(t||!e)return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation"},a.Ay.createElement("p",{className:"checking-status"},(0,u.Oj)({nl:"Laden...",en:"Loading..."})));
1if(e.error)return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation"},a.Ay.createElement("div",{className:"confirmation-icon error"},"✗"),a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Niet gevonden",en:"Not found"})),a.Ay.createElement("p",null,(0,u.Oj)({nl:"Deze betaallink is niet meer geldig.",en:"This payment link is no longer valid."})));if(e.withdrawn)return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation envelope-contribute"},a.Ay.createElement("h2",null,(0,u.Oj)({nl:"Je bijdrage is verwijderd",en:"Your contribution has been removed"})),a.Ay.createElement("p",null,(0,u.Oj)({nl:"Je kunt altijd opnieuw beginnen, met een ander bedrag, of samen met iemand anders.",en:"You can always start again, with a different amount, or together with someone else."})),a.Ay.createElement(z.A,{type:"button",onClick:()=>this.setView("Landing")},(0,u.Oj)({nl:"Naar de pagina",en:"To the page"})));const n=e.amount||0,r=e.recipientName||(0,u.Oj)({nl:"de ontvanger",en:"the recipient"}),i=this.paymentMethodFor(this.state.contributeData);return a.Ay.createElement("div",{key:"confirmation",className:"envelope-step envelope-confirmation envelope-contribute"},a.Ay.createElement("h2",null,(0,u.Oj)({nl:`Betaal €${n} aan ${r}`,en:`Pay €${n} to ${r}`})),e.firstName&&!e.gifterPaid&&a.Ay.createElement("p",null,(0,u.Oj)({nl:`Hoi ${e.firstName}, maak je kadobedrag over via een van de opties hieronder.`,en:`Hi ${e.firstName}, transfer your gift via one of the options below.`})),this.renderCardSchedule(),!e.gifterPaid&&(()=>{const t=[{type:"tikkie",link:e.paymentLink},{type:"bancontact",link:e.bancontactLink},{type:"paypal",link:e.paypalLink},{type:"venmo",link:e.venmoLink},{type:"request",link:e.requestLink},{type:"iban",iban:e.ibanDetails}].filter(e=>e.link||e.iban);if(!t.length)return a.Ay.createElement("div",{className:"call-out"},a.Ay.createElement("p",null,"open"===e.offer?(0,u.Oj)({nl:`${r} ${(0,_.oz)(r)?"hebben":"heeft"} nog niet laten weten hoe je het kado kunt overmaken. Je krijgt een mail zodra het zover is.`,en:`${r} ${(0,_.oz)(r)?"have":"has"} not said yet how to receive your gift. You will get an email as soon as they do.`}):(0,u.Oj)({nl:"Er zijn momenteel geen betaalopties beschikbaar.",en:"No payment options are currently available."})));const o={amount:n,recipientName:r,description:this.paymentDescription(e.contributorName),sym:V(e.currency)};return a.Ay.createElement("div",{className:"payment-methods"},t.map(e=>a.Ay.createElement(a.Ay.Fragment,{key:e.type},this.renderPaymentMethod(e.type,{...o,...e,expanded:e.type===i}))))})(),e.cardSent||e.gifterPaid||e.settled?null:a.Ay.createElement("div",{className:"contribute-withdraw"},this.state.confirmWithdraw?a.Ay.createElement("div",{className:"call-out"},a.Ay.createElement("p",null,e.paid?a.Ay.createElement(o.FK,null,(0,u.Oj)({nl:"Weet je het zeker? Je kaart wordt dan niet gedrukt en verstuurd. De €10 voor de kaart vraag je terug via onze ",en:"Are you sure? Your card will not be printed and sent. You ask for the €10 for the card back through our "}),a.Ay.createElement("a",{href:"/contact"},(0,u.Oj)({nl:"contactpagina",en:"contact page"})),"."):(0,u.Oj)({nl:`Weet je het zeker? Je bijdrage verdwijnt uit het overzicht van ${r}.`,en:`Are you sure? Your contribution disappears from ${r}'s overview.`})),a.Ay.createElement("div",{className:"field row"},a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.withdrawContribution()},(0,u.Oj)({nl:"Ja, verwijder mijn bijdrage",en:"Yes, remove my contribution"})),a.Ay.createElement("button",{type:"button",className:"button text",onClick:()=>this.setState({confirmWithdraw:!1})},a.Ay.createElement("span",null,(0,u.Oj)({nl:"Toch niet",en:"Never mind"}))))):a.Ay.createElement("button",{type:"button",className:"button text",onClick:()=>this.setState({confirmWithdraw:!0})},a.Ay.createElement("span",null,(0,u.Oj)({nl:"Toch geen bijdrage doen? Verwijder deze bijdrage",en:"Changed your mind? Remove this contribution"})))),"open"===e.offer?null:e.gifterPaid?a.Ay.createElement("div",{className:"call-out gifter-paid done"},a.Ay.createElement("p",null,(0,u.Oj)({nl:`Gemarkeerd als betaald op ${this.formatDate(e.gifterPaid)}. ${r} ${(0,_.oz)(r)?"zien":"ziet"} dit in het overzicht.`,en:`Marked as paid on ${this.formatDate(e.gifterPaid)}. ${r} ${(0,_.oz)(r)?"see":"sees"} this in their overview.`})),a.Ay.createElement("button",{type:"button",className:"button text",onClick:()=>this.flagPaid(!1)},a.Ay.createElement("span",null,(0,u.Oj)({nl:"Ongedaan maken",en:"Undo"})))):a.Ay.createElement("div",{className:"gifter-paid"},a.Ay.createElement(z.A,{type:"button",className:"secondary",onClick:()=>this.flagPaid(!0)},(0,u.Oj)({nl:"Ik heb het bedrag overgemaakt",en:"I have transferred the amount"})),a.Ay.createElement("p",{className:"note send-note"},(0,u.Oj)({nl:`Zo ${(0,_.oz)(r)?"weten":"weet"} ${r} dat jouw kado onderweg is.`,en:`So ${r} ${(0,_.oz)(r)?"know":"knows"} your gift is on its way.`}))))}renderContent(){switch(this.state.view){case"Confirmation":return this.renderConfirmation();case"Contribute":return this.renderContribute();case"Claim":return this.renderClaim();default:return null}}getModalTitle(){switch(this.state.view){case"Confirmation":return(0,u.Oj)({nl:"Bevestiging",en:"Confirmation"});case"Contribute":return(0,u.Oj)({nl:"Betaal het kadobedrag",en:"Pay the gift amount"});case"Claim":return this.state.claim&&this.state.claim.from?(0,u.Oj)({nl:`Een kado van ${this.state.claim.from}`,en:`A gift from ${this.state.claim.from}`}):(0,u.Oj)({nl:"Een kado",en:"A gift"});default:return null}}render(){const{gift:e,language:t}=this.props,{view:n,position:r,focusKey:l}=this.state,c=e.giftTitle||e.recipientName||(0,u.Oj)({nl:"Felicitaties",en:"
1Congratulations"}),m="Sign"===n&&this.signHashParts(),d=!e.isActive&&"Contribute"!==n&&"Claim"!==n,h=e.isActive&&("Landing"===n||"Compose"===n||"Confirmation"===n||m);if(!e.error&&(h||d))return a.Ay.createElement(o.FK,null,a.Ay.createElement(P,{title:c,description:e.giftDescription,recipientName:e.recipientName,paper:e.giftPaper,felicitaties:d?[]:this.felicitaties(),owner:!!e.owner,onClaim:e=>this.claimSpot(e),editing:h&&"Compose"===n?r:null,focusKey:h&&"Confirmation"===n?l:h&&m?m.key:null,off:d}),h&&"Compose"===n?this.renderComposer():null,h&&"Confirmation"===n?a.Ay.createElement("div",{className:"board-sheet"},this.renderConfirmation()):null,h&&m?a.Ay.createElement("div",{className:"board-sheet"},this.renderSign()):null,d?a.Ay.createElement("div",{className:"board-sheet"},this.renderInactive()):null);const p=e.error?this.renderError():this.renderContent();return a.Ay.createElement(o.FK,null,a.Ay.createElement(s.A,null),a.Ay.createElement(i.A,{title:this.getModalTitle()||c,language:t},p))}}J.propTypes={gift:r.A.object,onMessage:r.A.func,language:r.A.object},J.defaultProps={gift:{},onMessage:()=>{},language:{local:"nl"}};var G=(0,u.lB)(J)}}]);

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.