{"version":3,"file":"EmbedButton.CodojG3E.mjs","names":["useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/QWdNGJvI02s6pOFWvwkG/v2GhVxB0jBN56XC2MiWs/EmbedButton.js"],"sourcesContent":["// Get Started: https://www.framer.com/developers\nimport{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion,AnimatePresence}from\"framer-motion\";import{useState,useEffect}from\"react\";import{createPortal}from\"react-dom\";/**\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function EmbedButton(props){const{eventId,buttonText,backgroundColor,textColor,borderRadius,ticketIcon,borderColor,buttonWidth,buttonHeight}=props;const[isModalOpen,setIsModalOpen]=useState(false);const[isIframeLoading,setIsIframeLoading]=useState(true);// Calculate responsive icon size based on button dimensions\nconst iconSize=Math.min(buttonWidth||120,buttonHeight||40)*.4;// Ticket icon components with responsive sizing\nconst icons={none:null,ticket:/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v2Z\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M13 5v2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M13 17v2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M13 11v2\"})]}),calendar:/*#__PURE__*/_jsxs(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:[/*#__PURE__*/_jsx(\"path\",{d:\"M8 2v4\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M16 2v4\"}),/*#__PURE__*/_jsx(\"rect\",{width:\"18\",height:\"18\",x:\"3\",y:\"4\",rx:\"2\"}),/*#__PURE__*/_jsx(\"path\",{d:\"M3 10h18\"})]}),star:/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"polygon\",{points:\"12,2 15.09,8.26 22,9.27 17,14.14 18.18,21.02 12,17.77 5.82,21.02 7,14.14 2,9.27 8.91,8.26\"})}),heart:/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z\"})}),shopping:/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"1.5\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M2.25 3h1.386c.51 0 .955.343 1.087.835l.383 1.437M7.5 14.25a3 3 0 0 0-3 3h15.75m-12.75-3h11.218c1.121-2.3 2.1-4.684 2.924-7.138a60.114 60.114 0 0 0-16.536-1.84M7.5 14.25 5.106 5.272M6 20.25a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Zm12.75 0a.75.75 0 1 1-1.5 0 .75.75 0 0 1 1.5 0Z\"})}),arrow:/*#__PURE__*/_jsx(\"svg\",{width:iconSize,height:iconSize,viewBox:\"0 0 24 24\",fill:\"none\",stroke:\"currentColor\",strokeWidth:\"2\",strokeLinecap:\"round\",strokeLinejoin:\"round\",children:/*#__PURE__*/_jsx(\"path\",{d:\"M9 18l6-6-6-6\"})})};const handleBuyTickets=()=>{setIsModalOpen(true);setIsIframeLoading(true);// Prevent body scroll when modal is open\ndocument.body.style.overflow=\"hidden\";};const closeModal=()=>{setIsModalOpen(false);setIsIframeLoading(true);// Restore body scroll when modal is closed\ndocument.body.style.overflow=\"unset\";};// Handle escape key to close modal\nuseEffect(()=>{const handleEscape=event=>{if(event.key===\"Escape\"&&isModalOpen){closeModal();}};if(isModalOpen){document.addEventListener(\"keydown\",handleEscape);return()=>document.removeEventListener(\"keydown\",handleEscape);}},[isModalOpen]);const handleIframeLoad=()=>{setIsIframeLoading(false);};const ticketUrl=`https://tixfox.co/embed/e/${eventId}`;return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs(motion.button,{style:{width:buttonWidth?`${buttonWidth}px`:\"auto\",height:buttonHeight?`${buttonHeight}px`:\"auto\",padding:buttonWidth&&buttonHeight?\"0\":\"8px 16px\",backgroundColor:backgroundColor,color:textColor,border:`2px solid ${borderColor}`,borderRadius:`${borderRadius}px`,fontSize:`${Math.max(12,(buttonHeight||40)*.3)}px`,fontWeight:\"600\",cursor:\"pointer\",fontFamily:\"system-ui, -apple-system, sans-serif\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",gap:`${Math.max(4,iconSize*.3)}px`,minWidth:buttonWidth?`${buttonWidth}px`:\"auto\",minHeight:buttonHeight?`${buttonHeight}px`:\"auto\"},whileHover:{scale:1.05},whileTap:{scale:.95},onClick:handleBuyTickets,children:[icons[ticketIcon],buttonText]}),isModalOpen&&typeof document!==\"undefined\"&&/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(AnimatePresence,{children:/*#__PURE__*/_jsx(motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},style:{position:\"fixed\",top:0,left:0,right:0,bottom:0,backgroundColor:\"rgba(0, 0, 0, 0.8)\",zIndex:999999,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"20px\"},onClick:closeModal,children:/*#__PURE__*/_jsxs(motion.div,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.8,opacity:0},style:{width:\"100%\",height:\"100%\",maxWidth:\"1200px\",maxHeight:\"800px\",backgroundColor:\"white\",borderRadius:\"12px\",overflow:\"hidden\",position:\"relative\",display:\"flex\",flexDirection:\"column\"},onClick:e=>e.stopPropagation(),children:[/*#__PURE__*/_jsx(\"button\",{onClick:closeModal,style:{position:\"absolute\",top:\"16px\",right:\"16px\",width:\"32px\",height:\"32px\",backgroundColor:\"rgba(0, 0, 0, 0.1)\",border:\"none\",borderRadius:\"50%\",cursor:\"pointer\",fontSize:\"18px\",zIndex:10},children:\"\\xd7\"}),isIframeLoading&&/*#__PURE__*/_jsxs(\"div\",{style:{position:\"absolute\",top:0,left:0,right:0,bottom:0,display:\"flex\",alignItems:\"center\",justifyContent:\"center\",backgroundColor:\"white\",zIndex:5},children:[/*#__PURE__*/_jsx(\"div\",{style:{width:\"40px\",height:\"40px\",border:\"3px solid #f3f3f3\",borderTop:\"3px solid #E07A47\",borderRadius:\"50%\",animation:\"spin 1s linear infinite\"}}),/*#__PURE__*/_jsx(\"style\",{children:`\n                                            @keyframes spin {\n                                                0% { transform: rotate(0deg); }\n                                                100% { transform: rotate(360deg); }\n                                            }\n                                        `})]}),/*#__PURE__*/_jsx(\"iframe\",{src:ticketUrl,style:{width:\"100%\",height:\"100%\",minHeight:\"100%\",border:\"none\",flex:1},title:`Buy tickets for event ${eventId}`,onLoad:handleIframeLoad})]})})}),document.body)]});}addPropertyControls(EmbedButton,{eventId:{title:\"Event ID\",type:ControlType.String,defaultValue:\"sample-event-123\"},buttonText:{title:\"Button Text\",type:ControlType.String,defaultValue:\"Buy Tickets\"},ticketIcon:{title:\"Icon\",type:ControlType.Enum,options:[\"none\",\"ticket\",\"calendar\",\"star\",\"heart\",\"shopping\",\"arrow\"],optionTitles:[\"No Icon\",\"Ticket\",\"Calendar\",\"Star\",\"Heart\",\"Shopping Cart\",\"Arrow\"],defaultValue:\"ticket\"},borderRadius:{title:\"Border Radius\",type:ControlType.Number,min:0,max:50,step:1,defaultValue:8,unit:\"px\"},backgroundColor:{title:\"Background Color\",type:ControlType.Color,defaultValue:\"#E07A47\"},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#FFFFFF\"},borderColor:{title:\"Border Color\",type:ControlType.Color,defaultValue:\"#E07A47\"},buttonWidth:{title:\"Button Width\",type:ControlType.Number,min:60,max:400,step:5,defaultValue:120,unit:\"px\"},buttonHeight:{title:\"Button Height\",type:ControlType.Number,min:30,max:100,step:2,defaultValue:40,unit:\"px\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"EmbedButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./EmbedButton.map"],"mappings":"qQAIG,SAAwB,EAAY,EAAM,CAAC,GAAK,CAAC,UAAQ,aAAW,kBAAgB,YAAU,eAAa,aAAW,cAAY,cAAY,gBAAc,EAAW,CAAC,EAAY,GAAgBA,EAAS,GAAM,CAAM,CAAC,EAAgB,GAAoBA,EAAS,GAAK,CACzQ,EAAS,KAAK,IAAI,GAAa,IAAI,GAAc,GAAG,CAAC,GACrD,EAAM,CAAC,KAAK,KAAK,OAAoB,EAAM,MAAM,CAAC,MAAM,EAAS,OAAO,EAAS,QAAQ,YAAY,KAAK,OAAO,OAAO,eAAe,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,SAAS,CAAc,EAAK,OAAO,CAAC,EAAE,0GAA0G,CAAC,CAAc,EAAK,OAAO,CAAC,EAAE,UAAU,CAAC,CAAc,EAAK,OAAO,CAAC,EAAE,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