{"version":3,"file":"FC_GlobalSmartModalClose.DecM8mMR.mjs","names":["e"],"sources":["https:/framerusercontent.com/modules/vx0hU5obAvqfYnWvnwr9/UIQTPgXl7TcAZzWWkUW4/FC_GlobalSmartModalClose.js"],"sourcesContent":["/*\n * Framer Commerce\n * Confidential and Proprietary - All Rights Reserved\n * Unauthorized use, reproduction, distribution, or disclosure of this\n * source code or any related information is strictly prohibited.\n *\n * This software is the exclusive property of Framer Commerce (\"Company\").\n * It is considered highly confidential and proprietary information.\n *\n * Any use, copying, modification, distribution, or sharing of this software,\n * in whole or in part, without the express written permission of the Company\n * is strictly prohibited and may result in legal action.\n *\n * DISCLAIMER: This software does not provide any express or\n * implied warranties, including, but not limited to, the implied warranties\n * of merchantability and fitness for a particular purpose. In no event shall\n * Framer Commerce be liable for any direct, indirect, incidental, special,\n * exemplary, or consequential damages (including, but not limited to, procurement\n * of substitute goods or services; loss of use, data, or profits; or business\n * interruption) however caused and on any theory of liability, whether in\n * contract, strict liability, or tort (including negligence or otherwise)\n * arising in any way out of the use of this software, even if advised of\n * the possibility of such damage.\n *\n * Any unauthorized possession, use, copying, distribution, or dissemination\n * of this software will be considered a breach of confidentiality and may\n * result in legal action.\n *\n * For inquiries, contact:\n * Framer Commerce\n * Email: hello@framercommerce.com\n *\n * © 2025 Butter Supply Inc. All Rights Reserved.\n */import{jsx as _jsx}from\"react/jsx-runtime\";import React from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n */export default function FC_GlobalSmartModalClose({componentInstance}){// Check if we're in Framer canvas\nconst isFramerCanvas=!window?.shopXtools;const handleClose=e=>{e.preventDefault();e.stopPropagation();if(!isFramerCanvas){// Dispatch the event synchronously\ndocument.dispatchEvent(new CustomEvent(\"global_modal_close\",{bubbles:true,cancelable:true}));}else{console.log(\"In Framer canvas - close event not dispatched\");}};const content=Array.isArray(componentInstance)?componentInstance[0]:componentInstance;if(!content||!/*#__PURE__*/React.isValidElement(content)){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",display:\"flex\",alignItems:\"center\",justifyContent:\"center\",color:\"#666\",fontSize:\"14px\"},onClick:handleClose,role:\"button\",tabIndex:0,onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \"){e.preventDefault()// Prevent scrolling with spacebar\n;handleClose(e);}},\"aria-label\":\"Close modal\",children:\"Connect Instance\"});}return /*#__PURE__*/_jsx(\"div\",{style:{height:\"100%\",width:\"100%\"},children:/*#__PURE__*/React.cloneElement(content,{style:{...content.props?.style||{},width:\"100%\",height:\"100%\"},onClick:e=>{handleClose(e);// Call the original onClick after our close handler\nif(content.props?.onClick){content.props.onClick(e);}},role:\"button\",tabIndex:0,onKeyDown:e=>{if(e.key===\"Enter\"||e.key===\" \"){e.preventDefault()// Prevent scrolling with spacebar\n;handleClose(e);}},\"aria-label\":\"Close modal\"})});}// Add Framer property controls\naddPropertyControls(FC_GlobalSmartModalClose,{componentInstance:{type:ControlType.ComponentInstance,title:\"Component\",description:\"Connect to your close button design on canvas\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"FC_GlobalSmartModalClose\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./FC_GlobalSmartModalClose.map"],"mappings":"wLAmCG,SAAwB,EAAyB,CAAC,qBAAmB,CACxE,IAAM,EAAe,CAAC,GAAQ,WAAiB,EAAY,GAAG,CAAC,EAAE,gBAAgB,CAAC,EAAE,iBAAiB,CAAK,EACP,QAAQ,IAAI,gDAAgD,CAA/J,SAAS,cAAc,IAAI,YAAY,qBAAqB,CAAC,QAAQ,GAAK,WAAW,GAAK,CAAC,CAAC,EAA6E,EAAQ,MAAM,QAAQ,EAAkB,CAAC,EAAkB,GAAG,EAC1J,MAD+K,CAAC,GAAS,CAAc,EAAM,eAAe,EAAQ,CAAsB,EAAK,MAAM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