{"version":3,"file":"ElevenLabsWidget.CU4S6Apd.mjs","names":[],"sources":["https:/framerusercontent.com/modules/shVf3Vm9vKFObiuo1QnS/tiSMcump40MCcMvzcpPe/ElevenLabsWidget.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";const WIDGET_SCRIPT=\"https://unpkg.com/@elevenlabs/convai-widget-embed\";const WIDGET_ID=\"vp-elevenlabs-convai\";export default function ElevenLabsWidget({agentId=\"YOUR_AGENT_ID\",mode=\"floating\",accentColor=\"#D4A843\"}){useEffect(()=>{window._vpAgentId=agentId;// Load script once — remove old version if present\nif(!document.querySelector(`script[src=\"${WIDGET_SCRIPT}\"]`)){const old=document.querySelector('script[src*=\"elevenlabs.io/convai-widget\"]');if(old)old.remove();const s=document.createElement(\"script\");s.src=WIDGET_SCRIPT;s.async=true;s.type=\"text/javascript\";document.head.appendChild(s);}if(mode===\"floating\"){// Remove any existing widget instance\ndocument.getElementById(WIDGET_ID)?.remove();// Attach directly to body — ElevenLabs handles its own\n// floating positioning via Shadow DOM internally.\n// Do NOT wrap in a positioned div: the new package escapes\n// custom containers and creates a full-page invisible overlay.\nconst widget=document.createElement(\"elevenlabs-convai\");widget.setAttribute(\"agent-id\",agentId);widget.id=WIDGET_ID;// Inject a scoped style to ensure nothing leaks\nconst styleId=\"vp-widget-safe-style\";if(!document.getElementById(styleId)){const style=document.createElement(\"style\");style.id=styleId;style.textContent=`\n                    /* Prevent ElevenLabs backdrop from blocking page clicks when collapsed */\n                    elevenlabs-convai {\n                        pointer-events: none !important;\n                    }\n                    elevenlabs-convai * {\n                        pointer-events: auto;\n                    }\n                `;document.head.appendChild(style);}document.body.appendChild(widget);return()=>{document.getElementById(WIDGET_ID)?.remove();document.getElementById(styleId)?.remove();};}},[agentId,mode]);if(mode===\"inline\"){const openModal=()=>{document.getElementById(\"vp-hope-modal\")?.remove();const id=window._vpAgentId||agentId;const overlay=document.createElement(\"div\");overlay.id=\"vp-hope-modal\";overlay.style.cssText=`\n                position: fixed;\n                inset: 0;\n                z-index: 99999;\n                background: rgba(9,9,18,0.92);\n                display: flex;\n                align-items: center;\n                justify-content: center;\n            `;overlay.addEventListener(\"click\",e=>{if(e.target===overlay)overlay.remove();});const card=document.createElement(\"div\");card.style.cssText=`\n                background: rgb(13,13,26);\n                border: 1px solid rgba(212,168,67,0.35);\n                border-radius: 12px;\n                width: 380px;\n                min-height: 420px;\n                position: relative;\n                transform: translateZ(0);\n                display: flex;\n                flex-direction: column;\n                align-items: center;\n                justify-content: center;\n                gap: 0;\n                overflow: hidden;\n            `;card.innerHTML=`\n                <div style=\"padding: 32px 32px 0; text-align: center; width: 100%; box-sizing: border-box;\">\n                    <div style=\"font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2.5px; text-transform: uppercase; color: rgb(212,168,67); margin-bottom: 12px;\">// HOPE IS LIVE</div>\n                    <div style=\"font-family: 'Inter', sans-serif; font-size: 20px; font-weight: 700; color: #F0EEE8; margin-bottom: 8px; letter-spacing: -0.4px;\">Start your conversation.</div>\n                    <div style=\"font-family: 'Inter', sans-serif; font-size: 12px; color: #4a4a6a; line-height: 1.65;\">Speak with Hope or type a message — switch between voice and text anytime.</div>\n                </div>\n                <div style=\"flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: flex-end; padding: 24px; box-sizing: border-box; min-height: 220px; position: relative;\" id=\"vp-widget-slot\"></div>\n                <div style=\"padding: 0 32px 28px; width: 100%; box-sizing: border-box;\">\n                    <div style=\"font-family: 'IBM Plex Mono', monospace; font-size: 10px; letter-spacing: 2px; text-transform: uppercase; color: #2a2a4a; text-align: center;\">Voice \\xb7 Chat \\xb7 Switch mid-conversation</div>\n                </div>\n            `;const closeBtn=document.createElement(\"button\");closeBtn.textContent=\"✕\";closeBtn.style.cssText=`\n                position: absolute;\n                top: 16px;\n                right: 16px;\n                background: transparent;\n                border: 1px solid rgba(212,168,67,0.25);\n                color: rgba(212,168,67,0.7);\n                width: 32px;\n                height: 32px;\n                border-radius: 50%;\n                cursor: pointer;\n                font-size: 13px;\n                display: flex;\n                align-items: center;\n                justify-content: center;\n                line-height: 1;\n            `;closeBtn.addEventListener(\"click\",()=>overlay.remove());card.appendChild(closeBtn);const widget=document.createElement(\"elevenlabs-convai\");widget.setAttribute(\"agent-id\",id);const slot=card.querySelector(\"#vp-widget-slot\");if(slot)slot.appendChild(widget);overlay.appendChild(card);document.body.appendChild(overlay);};return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",gap:\"12px\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:openModal,style:{background:accentColor,color:\"#090912\",border:\"none\",borderRadius:\"8px\",padding:\"16px 32px\",fontSize:\"13px\",fontWeight:\"700\",fontFamily:\"'Inter', sans-serif\",cursor:\"pointer\",width:\"100%\",letterSpacing:\"-0.01em\"},onMouseEnter:e=>e.currentTarget.style.opacity=\"0.88\",onMouseLeave:e=>e.currentTarget.style.opacity=\"1\",children:\"Start talking to Hope →\"}),/*#__PURE__*/_jsx(\"p\",{style:{fontSize:\"10px\",color:\"#3a3a5a\",fontFamily:\"'IBM Plex Mono', monospace\",letterSpacing:\"2px\",textTransform:\"uppercase\",margin:0,textAlign:\"center\"},children:\"Voice \\xb7 Chat \\xb7 Switch mid-conversation\"})]});}return /*#__PURE__*/_jsx(\"div\",{style:{display:\"none\"}});}addPropertyControls(ElevenLabsWidget,{agentId:{type:ControlType.String,title:\"Agent ID\",defaultValue:\"YOUR_AGENT_ID\"},mode:{type:ControlType.Enum,title:\"Mode\",options:[\"floating\",\"inline\"],optionTitles:[\"Floating (corner button)\",\"Inline (card button)\"],defaultValue:\"floating\"},accentColor:{type:ControlType.Color,title:\"Accent Color\",defaultValue:\"#D4A843\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ElevenLabsWidget\",\"slots\":[],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