(()=>{"use strict";var e,r={4739:()=>{const e=window.wp.components,r=window.wp.element,t=window.wp.i18n,o=window.React,a=e=>{const r=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,r,t)=>t?t.toUpperCase():r.toLowerCase()))(e);return r.charAt(0).toUpperCase()+r.slice(1)},i=(...e)=>e.filter((e,r,t)=>Boolean(e)&&""!==e.trim()&&t.indexOf(e)===r).join(" ").trim(),n=e=>{for(const r in e)if(r.startsWith("aria-")||"role"===r||"title"===r)return!0};var l={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const s=(0,o.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:t=2,absoluteStrokeWidth:a,className:s="",children:d,iconNode:c,...u},p)=>(0,o.createElement)("svg",{ref:p,...l,width:r,height:r,stroke:e,strokeWidth:a?24*Number(t)/Number(r):t,className:i("lucide",s),...!d&&!n(u)&&{"aria-hidden":"true"},...u},[...c.map(([e,r])=>(0,o.createElement)(e,r)),...Array.isArray(d)?d:[d]])),d=((e,r)=>{const t=(0,o.forwardRef)(({className:e,...t},n)=>{return(0,o.createElement)(s,{ref:n,iconNode:r,className:i(`lucide-${l=a("x"),l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,"lucide-x",e),...t});var l});return t.displayName=a("x"),t})(0,[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),c=(window.wp.hooks,window.ReactJSXRuntime),u=16/9,p=({videoUrl:o,videoPlatform:a,onClose:i})=>{const[n,l]=(0,r.useState)(u);let s=null;if("youtube"===a){const e=(e=>{const r=e.match(/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?|shorts)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/\s]{11})/i);return r?r[1]:null})(o);e&&(s=(0,c.jsx)("iframe",{src:`https://www.youtube.com/embed/${e}?autoplay=1`,title:(0,t.__)("Product video","tryaura"),allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}))}else s=(0,c.jsxs)("video",{controls:!0,autoPlay:!0,onLoadedMetadata:e=>{const{videoWidth:r,videoHeight:t}=e.currentTarget;r>0&&t>0&&l(r/t)},children:[(0,c.jsx)("source",{src:o,type:"video/mp4"}),(0,t.__)("Your browser does not support the video tag.","tryaura")]});return(0,c.jsx)(e.Modal,{onRequestClose:i,shouldCloseOnClickOutside:!0,shouldCloseOnEsc:!0,className:"tryaura tryaura-video-modal-root",__experimentalHideHeader:!0,children:(0,c.jsxs)("div",{className:"tryaura-video-modal-player",style:{"--tryaura-video-aspect":String(n)},children:[(0,c.jsx)(d,{className:"absolute top-1 right-1 cursor-pointer z-50 bg-red-50 rounded-full p-1 text-red-400",onClick:i}),s]})})};let m=null;document.addEventListener("click",e=>{const t=e.target.closest(".tryaura-video-item");if(t){const o=t.getAttribute("data-tryaura-video-url");if(o){const a=t.getAttribute("data-tryaura-video-platform")||"";e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),((e,t)=>{const o="tryaura-video-modal-container";let a=document.getElementById(o);a||(a=document.createElement("div"),a.id=o,document.body.appendChild(a));const i=()=>{m?(m.unmount(),m=null):r.render&&(0,r.render)(null,a),a?.remove()};r.createRoot?(m=(0,r.createRoot)(a),m.render((0,c.jsx)(p,{videoUrl:e,videoPlatform:t,onClose:i}))):r.render&&(0,r.render)((0,c.jsx)(p,{videoUrl:e,videoPlatform:t,onClose:i}),a)})(o,a)}}},!0)}},t={};function o(e){var a=t[e];if(void 0!==a)return a.exports;var i=t[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,e=[],o.O=(r,t,a,i)=>{if(!t){var n=1/0;for(c=0;c<e.length;c++){for(var[t,a,i]=e[c],l=!0,s=0;s<t.length;s++)(!1&i||n>=i)&&Object.keys(o.O).every(e=>o.O[e](t[s]))?t.splice(s--,1):(l=!1,i<n&&(n=i));if(l){e.splice(c--,1);var d=a();void 0!==d&&(r=d)}}return r}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[t,a,i]},o.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),(()=>{var e={304:0,176:0};o.O.j=r=>0===e[r];var r=(r,t)=>{var a,i,[n,l,s]=t,d=0;if(n.some(r=>0!==e[r])){for(a in l)o.o(l,a)&&(o.m[a]=l[a]);if(s)var c=s(o)}for(r&&r(t);d<n.length;d++)i=n[d],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return o.O(c)},t=globalThis.webpackChunktryaura=globalThis.webpackChunktryaura||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})();var a=o.O(void 0,[176],()=>o(4739));a=o.O(a)})();