1import{a0 as e,c as t,r as a,j as i,B as s,M as n,ab as o}from"./index-DfCPROKl.js";import{w as r}from"./windowOpen-0yaTk1Pe.js";import{E as l,C as d,a as h}from"./Code-PtVjnpit.js";import{I as c}from"./index-B_YrIT20.js";import{F as m,L as w,T as p,W as x,i as b}from"./isMobileOrTablet-DOfZXr_S.js";import{L as j}from"./Link-CZfirAlW.js";import{S as f}from"./ShareNetwork-BWdnfqmr.js";const g=()=>i.jsx("style",{children:"\n .share-modal .modal-dialog {\n max-width: 575px;\n }\n\n .share-modal .modal-body,\n .share-modal .modal-header {\n padding: 0 !important;\n }\n .share-modal .modal-header {\n margin-bottom: 2rem;\n }\n @media (max-width: 532px) {\n .share-modal .modal-dialog {\n margin: initial;\n }\n }\n "}),u=u=>{const{onlyButton:$=!1,onlyIconButton:y=!0}=u,k=e(),C=t(),[N,v]=a.useState(!1);a.useEffect((()=>{void 0!==u.isOpen&&v(u.isOpen)}),[u.isOpen]);const B=()=>{v(!1),u.onClose&&u.onClose()},S=e=>{return{onClick:(t=e,()=>{let e="",a=!0;const i=u.url||k,s=h(i,{t:(new Date).toISOString().replace(/[^a-zA-Z0-9]/g,"")});switch(t){case"embed":{const e=`anasaea-embed-${u.embedData.embedId}`,t=`<style>.${e} { height: 720px; } @media (max-width: 768px) { .${e} { height: 480px; }}</style><iframe class="${e}" frameborder="0" width="100%" height="100%" allow="microphone" allowfullscreen="" src="${u.embedData.iframeUrl}"></iframe>`;return navigator.clipboard.writeText(t).then((()=>{C.info("Iframe code copied to clipboard")})).catch((e=>{C.error("Failed to copy iframe code"),console.error("failed to copy",e)})).finally((()=>{setTimeout((()=>B()),0)}))}case"link":try{navigator.clipboard.writeText(s),C.info("Copied to clipboard")}catch{}return void B();case"email":var n=`\n <html>\n <a href=${s}>${u.title}</a>\n <p>${u.description}</p>\n ${u.image?`<img src=${u.image} alt=${u.title} />`:""}\n </html>\n `;e=`mailto:?subject=${u.title}&body=${s}&html-body=${n}`,a=!1;break;case"facebook":e=`https://facebook.com/sharer/sharer.php?u=${s}"e=${u.title}`;break;case"linkedin":e=`https://www.linkedin.com/sharing/share-offsite/?url=${s}`;break;case"twitter":e=`https://twitter.com/intent/tweet?text=${u.title}&url=${s}`;break;case"whatsapp":e=b()?`whatsapp://send?text=${s}`:`https://web.whatsapp.com/send?text=${s}`}Object.entries({top:window.outerHeight/2+(window.screenY||window.screenTop||0)-400,left:window.outerWidth/2+(window.screenX||window.screenLeft||0)-500,width:1e3,height:800}).map((([e,t])=>`${e}=${t}`)).join(", "),a?r(e,""):o(e),B()}),variant:"primary",className:"btn-lg tw-w-[56px] tw-h-[56px] tw-flex tw-justify-center tw-items-center",ariaLabel:e};var t};return i.jsxs(i.Fragment,{children:[i.jsx(g,{}),y&&!u.noButtons&&i.jsxs(i.Fragment,{children:[!u.noIconButton&&!u.onClose&&i.jsx(c,{size:u.size,icon:u.icon?u.icon:i.jsx(f,{width:24,height:24}),text:u.noText?"":"Share",onClick:()=>v(!0),className:u.iconBtnClassName||"text-primary",hideTextOnMobile:!0,"aria-label":"Share"}),u.noIconButton?i.jsx("div",{"aria-label":"Share",className:u.iconBtnClassName||"text-primary",role:"button",onClick:()=>v(!0),children:u.icon?u.icon:i.jsx(f,{width:24,height:24})}):""]}),$&&i.jsx(i.Fragment,{children:i.jsx(s,{"aria-label":"Share",variant:"primary",className:`${u.btnClassName?u.btnClassName:"btn-sm tw-w-[100%] tw-typog-[bodymd]"}`,onClick:()=>v(!0),children:"Share"})}),i.jsx(n,{show:u.noButtons?u.modalIsOpen:N,onHide:u.noButtons?u.onCloseModal:B,centered:!0,className:"share-modal",children:i.jsxs("div",{className:"tw-p-[20px]",children:[i.jsx("p",{className:"tw-mb-[2rem] tw-typog-[head6] text-center tw-font-semibold tw-w-[100%]",children:u.shareTitle}),i.jsxs("div",{className:"tw-font-semibold tw-flex tw-gap-[1rem] tw-flex-wrap tw-justify-center tw-md:tw-flex-nowrap",children:[i.jsx(s,{...S("facebook"),children:i.jsx(m,{width:24,height:24})}),i.jsx(s,{...S("linkedin"),children:i.jsx(w,{width:24,height:24})}),i.jsx(s,{...S("twitter"),children:i.jsx(p,{width:24,height:24})}),i.jsx(s,{...S("whatsapp"),children:i.jsx(x,{width:24,height:24})}),i.jsx(s,{...S("email"),children:i.jsx(l,{width:24,height:24})}
1),i.jsx(s,{...S("link"),children:i.jsx(j,{width:24,height:24})}),u.embedData&&i.jsx(s,{...S("embed"),children:i.jsx(d,{width:24,height:24})})]})]})})]})};export{u as default};
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.