{"version":3,"file":"CopyPrompt.CSFgSyJz.mjs","names":["React.useState","React.useRef"],"sources":["https:/framerusercontent.com/modules/EfR69E2fsC6fOcaxF9TO/2yOcMAnnPHlYxomypUM9/CopyPrompt.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{addPropertyControls,ControlType}from\"framer\";// Copy with the async clipboard API, falling back to a hidden textarea for older browsers\nasync function copyText(text){try{if(typeof navigator!==\"undefined\"&&navigator.clipboard?.writeText){await navigator.clipboard.writeText(text);return true;}}catch{}if(typeof document===\"undefined\")return false;const area=document.createElement(\"textarea\");area.value=text;area.setAttribute(\"readonly\",\"\");area.style.position=\"fixed\";area.style.opacity=\"0\";document.body.appendChild(area);area.select();let ok=false;try{ok=document.execCommand(\"copy\");}catch{}document.body.removeChild(area);return ok;}// Report a click to Google Tag Manager when it is on the page\nfunction track(event,trackingId,prompt){if(typeof window===\"undefined\")return;const layer=window.dataLayer;if(Array.isArray(layer))layer.push({event,tracking_id:trackingId,prompt});}const css=`\n.mp-card { transition: box-shadow 0.18s cubic-bezier(0.2, 0, 0, 1); }\n.mp-card:hover { box-shadow: 0 8px 24px var(--mp-shadow); }\n.mp-btn { transition: transform 0.18s cubic-bezier(0.2, 0, 0, 1), filter 0.18s, background 0.18s, box-shadow 0.18s; }\n.mp-btn:hover { transform: translateY(-1px); }\n.mp-brand:hover { filter: brightness(1.06); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 10px 28px -6px rgba(85, 93, 255, 0.5); }\n.mp-ghost:hover { background: var(--mp-hover) !important; transform: none; }\n.mp-btn:focus-visible { outline: 2px solid var(--mp-brand); outline-offset: 2px; }\n`;/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any\n */export default function CopyPrompt(props){const{text=\"Upbeat lo-fi beat with warm keys for a YouTube vlog\",meta=\"\",font,textColor=\"#1B1E28\",mutedColor=\"#878895\",background=\"#FFFFFF\",brand=\"#555DFF\",border=\"rgba(0, 0, 0, 0.2)\",hoverFill=\"#F3F4F7\",shadow=\"rgba(85, 93, 255, 0.1)\",radius=20,padding=\"20px\",generateLabel=\"Generate\",generateLink=\"\",copyLabel=\"Copy\",copiedLabel=\"Copied\",trackingId=\"prompt\"}=props;const[copied,setCopied]=React.useState(false);const timer=React.useRef(null);React.useEffect(()=>()=>{if(timer.current)window.clearTimeout(timer.current);},[]);const flash=()=>{setCopied(true);if(timer.current)window.clearTimeout(timer.current);timer.current=window.setTimeout(()=>setCopied(false),1800);};const onCopy=async()=>{track(\"prompt_copy\",trackingId,text);if(await copyText(text))flash();};// Render has no prompt parameter: copy the prompt, then open the generator to paste it there\nconst onGenerate=()=>{track(\"prompt_generate\",trackingId,text);copyText(text).then(ok=>ok&&flash());};const button={height:36,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap:6,padding:\"0 14px\",border:0,borderRadius:12,fontFamily:\"inherit\",fontSize:14,fontWeight:600,lineHeight:1,cursor:\"pointer\",textDecoration:\"none\",whiteSpace:\"nowrap\"};return /*#__PURE__*/_jsxs(\"div\",{className:\"mp-card\",style:{position:\"relative\",width:\"100%\",height:\"100%\",boxSizing:\"border-box\",display:\"flex\",flexDirection:\"column\",gap:10,padding,borderRadius:radius,background,fontFamily:font?.fontFamily,\"--mp-shadow\":shadow,\"--mp-hover\":hoverFill,\"--mp-brand\":brand},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),/*#__PURE__*/_jsx(\"p\",{style:{flex:1,margin:0,color:textColor,fontSize:16,lineHeight:1.5,...font},children:text}),meta?/*#__PURE__*/_jsx(\"p\",{style:{margin:0,color:mutedColor,fontSize:12,lineHeight:1.4},children:meta}):null,/*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",flexWrap:\"wrap\",gap:8,marginTop:4},children:[generateLink?/*#__PURE__*/_jsxs(\"a\",{className:\"mp-btn mp-brand\",href:generateLink,target:\"_blank\",rel:\"noopener\",onClick:onGenerate,style:{...button,background:brand,color:\"#FFFFFF\"},children:[/*#__PURE__*/_jsxs(\"svg\",{viewBox:\"0 0 24 24\",width:\"16\",height:\"16\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",\"aria-hidden\":\"true\",children:[/*#__PURE__*/_jsx(\"circle\",{cx:\"8\",cy:\"18\",r:\"4\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M12 18V2l7 4\"})]}),generateLabel]}):null,/*#__PURE__*/_jsxs(\"button\",{type:\"button\",className:\"mp-btn mp-ghost\",onClick:onCopy,\"aria-live\":\"polite\",style:{...button,background:\"transparent\",color:textColor,boxShadow:`inset 0 0 0 1px ${border}`},children:[copied?/*#__PURE__*/_jsx(\"svg\",{viewBox:\"0 0 16 16\",width:\"14\",height:\"14\",fill:\"none\",\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M3 8.5l3 3 7-7\",stroke:\"currentColor\",strokeWidth:\"1.8\",strokeLinecap:\"round\",strokeLinejoin:\"round\"})}):null,copied?copiedLabel:copyLabel]})]})]});}addPropertyControls(CopyPrompt,{text:{type:ControlType.String,title:\"Prompt\",displayTextArea:true,defaultValue:\"Upbeat lo-fi beat with warm keys for a YouTube vlog\"},meta:{type:ControlType.String,title:\"Meta\",defaultValue:\"\"},generateLabel:{type:ControlType.String,title:\"Generate label\",defaultValue:\"Generate\"},generateLink:{type:ControlType.Link,title:\"Generate link\"},copyLabel:{type:ControlType.String,title:\"Copy label\",defaultValue:\"Copy\"},copiedLabel:{type:ControlType.String,title:\"Copied label\",defaultValue:\"Copied\"},trackingId:{type:ControlType.String,title:\"Tracking ID\",defaultValue:\"prompt\"},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:16,lineHeight:\"1.5em\"}},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#1B1E28\"},mutedColor:{type:ControlType.Color,title:\"Muted\",defaultValue:\"#878895\"},background:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#FFFFFF\"},brand:{type:ControlType.Color,title:\"Brand\",defaultValue:\"#555DFF\"},border:{type:ControlType.Color,title:\"Border\",defaultValue:\"rgba(0, 0, 0, 0.2)\"},hoverFill:{type:ControlType.Color,title:\"Hover fill\",defaultValue:\"#F3F4F7\"},shadow:{type:ControlType.Color,title:\"Shadow\",defaultValue:\"rgba(85, 93, 255, 0.1)\"},radius:{type:ControlType.Number,title:\"Radius\",defaultValue:20,min:0,max:40,unit:\"px\"},padding:{type:ControlType.Padding,title:\"Padding\",defaultValue:\"20px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CopyPrompt\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CopyPrompt.map"],"mappings":"+MACA,eAAe,EAAS,EAAK,CAAC,GAAG,CAAC,GAAU,IAAY,QAAa,EAAU,WAAW,UAAqD,OAA1C,MAAM,EAAU,UAAU,UAAU,CAAI,EAAS,EAAM,MAAM,CAAC,CAAC,GAAG,OAAO,SAAW,IAAY,MAAO,GAAM,IAAM,EAAK,SAAS,cAAc,UAAU,EAAE,EAAK,MAAM,EAAK,EAAK,aAAa,WAAW,EAAE,EAAE,EAAK,MAAM,SAAS,QAAQ,EAAK,MAAM,QAAQ,IAAI,SAAS,KAAK,YAAY,CAAI,EAAE,EAAK,OAAO,EAAE,IAAI,EAAG,GAAM,GAAG,CAAC,EAAG,SAAS,YAAY,MAAM,CAAE,MAAM,CAAC,CAAiC,OAAhC,SAAS,KAAK,YAAY,CAAI,EAAS,CAAG,CACrf,SAAS,EAAM,EAAM,EAAW,EAAO,CAAC,GAAU,IAAS,OAAY,OAAO,IAAM,EAAM,EAAO,UAAa,MAAM,QAAQ,CAAK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