{"version":3,"file":"TicketButton.7DP8Kq0m.mjs","names":["useState","_Fragment","_jsx"],"sources":["https:/framerusercontent.com/modules/kXocIZTwnqiUUEBTxOQu/CXxytT1btqv3JUFv2xjd/TicketButton.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useState,useEffect}from\"react\";import{createPortal}from\"react-dom\";import{addPropertyControls,ControlType,RenderTarget}from\"framer\";/**\n * MaHalla — Ticket Button\n *\n * A text link styled with MaHalla's type settings that opens the Ticket Tailor\n * checkout in a modal overlay.\n *\n * The Font control gives you the same Font / Weight / Size / Letter / Line\n * panel as a normal Framer text layer, so this matches your text styles exactly.\n *\n * Usage:\n *   1. Insert → Code → paste this as a new code file\n *   2. Drag the component onto the canvas\n *   3. Set \"Checkout URL\" to the event's Ticket Tailor URL\n *   4. Pick MaHallaRed in the Color control\n *\n * No Custom Code needed — the component is fully self-contained.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n * @framerIntrinsicWidth 140\n * @framerIntrinsicHeight 40\n */export default function TicketButton(props){const{label,checkoutUrl,font,textColor,hoverColor,hoverUnderline,background,paddingX,paddingY,radius,modalMaxWidth,modalHeight,modalRadius,overlayColor,style}=props;const[open,setOpen]=useState(false);const[hover,setHover]=useState(false);const[loaded,setLoaded]=useState(false)// iframe loads on first open only\n;const onCanvas=RenderTarget.current()===RenderTarget.canvas;// Escape to close + lock background scroll while the modal is open\nuseEffect(()=>{if(!open)return;const onKey=e=>{if(e.key===\"Escape\")setOpen(false);};document.addEventListener(\"keydown\",onKey);const previousOverflow=document.body.style.overflow;document.body.style.overflow=\"hidden\";return()=>{document.removeEventListener(\"keydown\",onKey);document.body.style.overflow=previousOverflow;};},[open]);// Hard defaults first, then whatever the Font control provides. A <button>\n// does not inherit page typography, so if `font` is ever undefined the\n// browser falls back to ~13px — these defaults prevent that.\nconst fontStyle={fontFamily:'\"Inter Display\", \"Inter\", sans-serif',fontSize:30,fontWeight:700,letterSpacing:\"-0.02em\",lineHeight:\"1.2em\",...font||{}};function handleClick(){// On the Framer canvas the iframe would just show an error, so do nothing.\nif(onCanvas)return;setLoaded(true);setOpen(true);}const button=/*#__PURE__*/_jsx(\"button\",{onClick:handleClick,onMouseEnter:()=>setHover(true),onMouseLeave:()=>setHover(false),style:{// Framer's own layout styles go first so our typography wins.\n...style,...fontStyle,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",whiteSpace:\"nowrap\",color:hover?hoverColor:textColor,background,border:\"none\",borderRadius:radius,padding:`${paddingY}px ${paddingX}px`,margin:0,textDecoration:hover&&hoverUnderline?\"underline\":\"none\",textUnderlineOffset:\"0.12em\",cursor:\"pointer\",transition:\"color 160ms ease, background 160ms ease\",WebkitTapHighlightColor:\"transparent\"},children:label});// The overlay is rendered into document.body. This matters: Framer applies\n// CSS transforms to its containers, and position:fixed inside a transformed\n// ancestor is positioned against that ancestor instead of the viewport.\nconst modal=open&&typeof document!==\"undefined\"?/*#__PURE__*/createPortal(/*#__PURE__*/_jsx(\"div\",{role:\"dialog\",\"aria-modal\":\"true\",\"aria-label\":label,onClick:e=>{if(e.target===e.currentTarget)setOpen(false);},style:{position:\"fixed\",inset:0,zIndex:2147483e3,background:overlayColor,display:\"flex\",alignItems:\"center\",justifyContent:\"center\"},children:/*#__PURE__*/_jsxs(\"div\",{style:{position:\"relative\",width:\"100%\",maxWidth:modalMaxWidth,height:`${modalHeight}vh`,background:\"#fff\",borderRadius:modalRadius,overflow:\"hidden\"},children:[/*#__PURE__*/_jsx(\"button\",{onClick:()=>setOpen(false),\"aria-label\":\"Close\",style:{position:\"absolute\",top:8,right:10,zIndex:2,width:36,height:36,borderRadius:\"50%\",border:\"none\",background:\"rgba(255,255,255,0.92)\",color:\"#000\",fontSize:24,lineHeight:\"34px\",cursor:\"pointer\"},children:\"\\xd7\"}),loaded&&/*#__PURE__*/_jsx(\"iframe\",{src:checkoutUrl,title:\"Ticket checkout\",allow:\"payment *\",style:{width:\"100%\",height:\"100%\",border:0,display:\"block\"}})]})}),document.body):null;return /*#__PURE__*/_jsxs(_Fragment,{children:[button,modal]});}TicketButton.defaultProps={label:\"Tickets\",checkoutUrl:\"https://www.tickettailor.com/events/mahallaevents/2349311/select-date?ref=website_widget&show_search_filter=true&show_date_filter=true&show_sort=true\",font:{fontFamily:'\"Inter Display\", \"Inter\", sans-serif',fontSize:30,fontWeight:700,letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"},textColor:\"#FB0007\",hoverColor:\"#FFFFFF\",hoverUnderline:false,background:\"rgba(0,0,0,0)\",paddingX:0,paddingY:0,radius:0,modalMaxWidth:860,modalHeight:88,modalRadius:6,overlayColor:\"rgba(0,0,0,0.85)\"};addPropertyControls(TicketButton,{label:{type:ControlType.String,title:\"Label\",defaultValue:\"Tickets\"},checkoutUrl:{type:ControlType.String,title:\"Checkout URL\",description:\"The Ticket Tailor event URL — the data-url value from the widget embed code.\",defaultValue:\"https://www.tickettailor.com/events/mahallaevents/2349311/select-date?ref=website_widget\"},// Gives the full Font / Weight / Size / Letter / Line panel.\nfont:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans\",defaultValue:{fontSize:30,fontWeight:700,letterSpacing:\"-0.02em\",lineHeight:\"1.2em\"}},textColor:{type:ControlType.Color,title:\"Color\"},hoverColor:{type:ControlType.Color,title:\"Hover\"},hoverUnderline:{type:ControlType.Boolean,title:\"Underline\",enabledTitle:\"On hover\",disabledTitle:\"Never\"},background:{type:ControlType.Color,title:\"Fill\",description:\"Transparent by default. Set a colour for a boxed button.\"},paddingX:{type:ControlType.Number,title:\"Pad X\",min:0,max:80,step:2},paddingY:{type:ControlType.Number,title:\"Pad Y\",min:0,max:60,step:2},radius:{type:ControlType.Number,title:\"Radius\",min:0,max:60,step:1},modalMaxWidth:{type:ControlType.Number,title:\"Modal width\",min:400,max:1400,step:20},modalHeight:{type:ControlType.Number,title:\"Modal height\",min:50,max:100,step:1,description:\"Percent of the viewport height.\"},modalRadius:{type:ControlType.Number,title:\"Modal radius\",min:0,max:40,step:1},overlayColor:{type:ControlType.Color,title:\"Overlay\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"TicketButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"140\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\",\"framerIntrinsicHeight\":\"40\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./TicketButton.map"],"mappings":"oNAqBG,SAAwB,EAAa,EAAM,CAAC,GAAK,CAAC,QAAM,cAAY,OAAK,YAAU,aAAW,iBAAe,aAAW,WAAS,WAAS,SAAO,gBAAc,cAAY,cAAY,eAAa,SAAO,EAAW,CAAC,EAAK,GAASA,EAAS,EAAK,EAAO,CAAC,EAAM,GAAUA,EAAS,EAAK,EAAO,CAAC,EAAO,GAAWA,EAAS,EAAK,EAC7T,EAAS,EAAa,QAAQ,IAAI,EAAa,OACtD,MAAc,CAAC,GAAG,CAAC,EAAK,OAAO,IAAM,EAAM,GAAG,CAAI,EAAE,MAAM,UAAS,EAAQ,EAAK,CAAE,EAAE,SAAS,iBAAiB,UAAU,CAAK,EAAE,IAAM,EAAiB,SAAS,KAAK,MAAM,SAA+C,MAAtC,UAAS,KAAK,MAAM,SAAS,aAAmB,CAAC,SAAS,oBAAoB,UAAU,CAAK,EAAE,SAAS,KAAK,MAAM,SAAS,CAAiB,CAAE,EAAE,CAAC,CAAI,CAAC,EAG1U,IAAM,EAAU,CAAC,WAAW,uCAAuC,SAAS,GAAG,WAAW,IAAI,cAAc,UAAU,WAAW,QAAQ,GAAG,GAAM,CAAC,CAAC,EAAE,SAAS,GAAa,CACzK,IAAgB,EAAU,EAAI,EAAE,EAAQ,EAAI,EAAE,CAIs8B,OAAoB,EAAMC,EAAU,CAAC,SAAS,CAJz9BC,EAAK,SAAS,CAAC,Q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