`}function E(e,t){const o=e.map(({id:n})=>``);t.innerHTML=o.join("")}function I({node:e,id:t}){const o=h(t),n=r.getElementById(o),{width:i,height:A}=e.getBoundingClientRect();if(e.style.setProperty("clip-path",`url(#${o})`),n.innerHTML=v(i,A),!a.ResizeObserver)return;function B(s){const c=s.borderBoxSize||s.contentBoxSize;if(!c)return s.contentRect;const l=Array.isArray(c)?c[0]:c;return{height:l.blockSize,width:l.inlineSize}}new ResizeObserver(([s])=>{const{height:c,width:l}=B(s);n.innerHTML=v(l,c)}).observe(e)}function y(){const e=r.createElement("canvas");return e.getContext&&e.getContext("2d")?!e.toDataURL("image/webp").indexOf("data:image/webp"):!1}function P(e){const t=new Image;t.src=y()?"./sprite.webp":"./sprite.jpg",t.onload=()=>{e.classList.add("photo-loaded"),e.style.setProperty("background-image",`url(${t.src})`)}}d.classList.add(b()?"touch":"notouch"),r.addEventListener("DOMContentLoaded",function(){$(S());const e=Array.from(r.querySelectorAll("[data-squircle]")).map(n=>({node:n,id:n.getAttribute("data-squircle")})),t=r.getElementById("svg-defs");E(e,t),e.forEach(I),P(r.getElementById("photo")),r.querySelectorAll("[toggle]").forEach(n=>{n.addEventListener("click",i=>{i.preventDefault(),f()})});const o=r.getElementById("photo-frame");o.addEventListener("click",()=>f()),o.addEventListener("touchstart",n=>{o.classList.add("active"),n.preventDefault()}),o.addEventListener("touchend",()=>{setTimeout(()=>o.classList.remove("active"),200)})})})(document,window,document.getElementById,document.getElementById,document.documentElement);