1"use strict";(globalThis.webpackChunkao_react_app||=[]).push([[1947],{51947(e,t,a){a.r(t),a.d(t,{default:()=>h});var n=a(9950),o=a(32856);const i=[{id:"diwali",name:"Diwali",title:"Let the light find you.",note:"A little light. A lot of love.",color:"#e5b865",paper:"#170f09",art:"diya"},{id:"christmas",name:"Christmas",title:"A little more wonder.",note:"May your days feel warm, kind and full of possibility.",color:"#a8cfb1",paper:"#061813",art:"tree"},{id:"ramji",name:"Ramji",title:"May goodness guide you.",note:"Wishing you peace, courage and a heart full of kindness.",color:"#f4bc7d",paper:"#211109",art:"sun"},{id:"valentine",name:"Valentine",title:"You make ordinary magic.",note:"For all the little ways you make life brighter.",color:"#e5aab4",paper:"#210c16",art:"heart"},{id:"tribute",name:"In remembrance",title:"Always part of our sky.",note:"Remembered with love. Carried in the stories we share.",color:"#d6c6a2",paper:"#090f14",art:"candle"}],r=(e,t)=>"string"===typeof e?e.replace(/[\u0000-\u001f\u007f\u202a-\u202e\u2066-\u2069]/g," ").trim().slice(0,t):"",s=e=>String(e).replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"}[e]));function l(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{occasion:(null===(e=i.find(e=>e.id===t.occasion))||void 0===e?void 0:e.id)||"diwali",name:r(t.name,70),from:r(t.from,60),message:r(t.message,280)}}function c(e,t){const a=[];let n="";for(const o of e.split(/\s+/))for(let e=0;e<o.length;e+=t){const i=o.slice(e,e+t);n.length+i.length+1>t&&(a.push(n),n=""),n+=(n?" ":"")+i}return n&&a.push(n),a}var d=a(44414);function h(){const[e,t]=(0,n.useState)(()=>function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const a=new URLSearchParams(e);return l({occasion:t?"tribute":a.get("occasion"),name:1===a.getAll("name").length?a.get("name"):"",from:1===a.getAll("from").length?a.get("from"):"",message:1===a.getAll("message").length?a.get("message"):""})}(window.location.search,"/tribute"===window.location.pathname)),[a,r]=(0,n.useState)(""),[h,m]=(0,n.use
1State)(!1),u=i.find(t=>t.id===e.occasion),g=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"https://www.appopener.com";const a=l(e),n=new URLSearchParams;for(const[o,i]of Object.entries(a))i&&n.set(o,i);return`${t}${"tribute"===a.occasion?"/tribute":"/occasions"}?${n}`}(e,window.location.origin),p=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(function(e){const t=l(e),a=i.find(e=>e.id===t.occasion),n=c(t.name||("tribute"===t.occasion?"Someone we hold close":"Someone special"),26).slice(0,3),o=c(t.message||a.note,45).slice(0,7),r="tree"===a.art?'<path d="M540 220L395 440H685ZM540 330L355 550H725" fill="none" stroke-width="7"/><path d="M540 195v-28m-14 14h28M540 530v45" stroke-width="5"/>':"heart"===a.art?'<path d="M540 510C220 330 440 190 540 320C640 190 860 330 540 510Z" fill="none" stroke-width="7"/>':"diya"===a.art?'<path d="M410 440Q540 625 670 440ZM540 430C450 370 555 300 550 255C620 385 590 410 540 430Z" fill="none" stroke-width="6"/>':"candle"===a.art?'<path d="M500 550V395H580V550M540 390C480 350 540 295 540 260C605 350 578 380 540 390Z" fill="none" stroke-width="6"/>':'<circle cx="540" cy="395" r="86" fill="none" stroke-width="6"/><path d="M540 245V200M540 545V590M390 395H345M690 395H735M430 285L397 252M650 505L683 538M650 285L683 252M430 505L397 538" stroke-width="5"/>';return`<svg xmlns="http://www.w3.org/2000/svg" width="1080" height="1350" viewBox="0 0 1080 1350"><rect width="1080" height="1350" fill="${a.paper}"/><rect x="35" y="35" width="1010" height="1280" rx="32" fill="none" stroke="${a.color}" stroke-opacity=".4"/><g stroke="${a.color}" fill="${a.color}">${r}<circle cx="235" cy="345" r="3"/><circle cx="835" cy="280" r="4"/><circle cx="790" cy="530" r="3"/></g><g text-anchor="middle" fill="${a.color}" font-family="Georgia,serif"><text x="540" y="125" font-size="20" letter-spacing="5">${s(a.name.toUpperCase())}</text><text x="540" y="665" font-size="38">${s(a.title)}</text>${n.map((e,t)=>`<text x="540" y="${748+65*t}" font-size="56">${s(e)}</text>`).join("")}<g font-size="25" fill="#e5e0d5">${o.map((e,t)=>`<text x="540" y="${970+32*t}">${s(e)}</text>`).join("")}</g><text x="540" y="1240" font-size="22">${s(t.from?`With love, ${t.from}`:"A little universe, shared with love.")}</text><text x="540" y="1290" font-size="15" letter-spacing="3">MADE WITH APPOPENER.COM</text></g></svg>`}(e))}`,f=e=>a=>t(t=>({...t,[e]:a.target.value}));return(0,d.jsxs)("main",{className:"occasion-studio",style:{"--occasion-accent":u.color,"--occasion-paper":u.paper},children:[(0,d.jsxs)(o.mg,{children:[(0,d.jsxs)("title",{children:[e.name?`${e.name} | `:"",u.name," | AppOpener"]}),(0,d.jsx)("meta",{name:"description",content:e.message||u.note}),(0,d.jsx)("meta",{name:"referrer",content:"no-referrer"})]}),(0,d.jsxs)("header",{children:[(0,d.jsx)("a",{href:"/",children:"APPOPENER / OCCASION STUDIO"}),(0,d.jsx)("a",{href:"/all-links",children:"All apps & index"})]}),(0,d.jsx)("nav",{className:"occasion-tabs","aria-label":"Choose your card",children:i.map(a=>(0,d.jsx)("button",{type:"button","aria-pressed":e.occasion===a.id,onClick:()=>t(e=>({...e,occasion:a.id})),children:a.name},a.id))}),(0,d.jsxs)("div",{className:"occasion-layout",children:[(0,d.jsxs)("section",{className:"occasion-editor",children:[(0,d.jsx)("span",{children:"tribute"===u.id?"A MEMORY WORTH KEEPING":"A LITTLE JOY, MADE PERSONAL"}),(0,d.jsx)("h1",{children:u.title}),(0,d.jsx)("p",{children:"tribute"===u.id?"Give a memory a quiet place to live. Share a name, a few words, and the love that remains.":"Put their name in the stars. Add your words. Send a little piece of your universe."}),(0,d.jsxs)("label",{children:["tribute"===u.id?"Remembering":"For",(0,d.jsx)("input",{value:e.name,onChange:f("name"),maxLength:70,placeholder:"Their name"})]}),(0,d.jsxs)("label",{children:["Your message",(0,d.jsx)("textarea",{value:e.message,onChange:f("message"),maxLength:280,rows:4,placeholder:u.note})]}),(0,d.jsxs)("label",{children:["From ",(0,d.jsx)("small",{children:"optional"}),(0,d.jsx)("input",{value:e.from,onChange:f("from"),maxLength:60,placeholder:"Your name"})]}),(0,d.jsxs)("div",{className:"occasion-actions",children:[(0,d.jsx)("button",{onClick:async()=>{try{navigator.share?await navigator.share({title:`${e.name||u.name} | ${u.title}`,url:g}):(await navigator.clipboard.writeText(g),r("Your card link is copied."))}catch(t){"AbortError"!==t.name&&r("Select the card link below to copy it.")}},children:"Share this card"}),(0,d.jsx)("button",{onClick:async()=>{m(!0);try{const e=new Image;await new Promise((t,a)=>{e.onload=t,e.onerror=a,e.src=p});const t=document.createElement("canvas");t.width=1080,t.height=1350;const a=t.getContext("2d");if(!a)throw new Error;a.drawImage(e,0,0);const n=await new Promise(e=>
1t.toBlob(e,"image/png"));if(!n)throw new Error;const o=URL.createObjectURL(n),i=document.createElement("a");i.href=o,i.download=`appopener-${u.id}.png`,i.click(),setTimeout(()=>URL.revokeObjectURL(o),1e3),r("Your card is downloaded, ready for a story or message.")}catch{r("The download could not finish. You can still share the card link.")}finally{m(!1)}},disabled:h,children:h?"Preparing...":"Download PNG"})]}),(0,d.jsxs)("label",{children:["Card link",(0,d.jsx)("input",{readOnly:!0,value:g,onFocus:e=>e.target.select()})]}),(0,d.jsx)("small",{children:"Anyone with this link can read the name and message. Your card needs no account."}),a&&(0,d.jsx)("p",{role:"status",children:a})]}),(0,d.jsxs)("figure",{className:"occasion-preview",children:[(0,d.jsx)("img",{src:p,width:"1080",height:"1350",alt:`${u.name} card for ${e.name||"someone special"}: ${e.message||u.note}`}),(0,d.jsx)("figcaption",{children:"YOUR WORDS / A KEEPSAKE TO SHARE"})]})]}),(0,d.jsxs)("footer",{children:[(0,d.jsx)("span",{children:"A little universe, shared with love."}),(0,d.jsx)("a",{href:"/occasions",children:"Make another person's day"})]})]})}}}]);
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.