{"version":3,"file":"ThentyComponentSwitch.ZPWdUUIe.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/IYwZH8XhD5xhkK14JGUI/MSTxsmAFh6aMUyrjuH45/ThentyComponentSwitch.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{cloneElement}from\"react\";import{hasTier}from\"https://framer.com/m/ThentyHelpers-I0Oh.js\";const fontWeights={100:\"Thin\",200:\"Extra-light\",300:\"Light\",400:\"Regular\",500:\"Medium\",600:\"Semi-bold\",700:\"Bold\",800:\"Extra-bold\",900:\"Black\"};const fallbackFont={fontFamily:\"Inter\",fontWeight:400};/**\n * These annotations control how your component sizes\n * Learn more: https://www.framer.com/developers/#code-components-auto-sizing\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n * @framerSupportedLayoutType any\n */export default function ThentyComponentSwitch(props){const containerStyle={height:\"100%\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",overflow:\"hidden\",position:\"relative\"};const{lockedComponent,unlockedComponent,blockingButton,font,customFont,planIDs,link}=props;const buttonStyle={cursor:\"pointer\",background:blockingButton.buttonFill,color:blockingButton.textColor,borderColor:blockingButton.borderColor,borderWidth:blockingButton.borderWidth?`${blockingButton.borderWidth}px`:0,borderRadius:blockingButton.borderRadius,\"&:hover\":{background:blockingButton.hoverButtonFill,color:blockingButton.hoverTextColor},width:\"fit-content\",padding:blockingButton.customPadding?`${blockingButton.paddingTop}px ${blockingButton.paddingRight}px ${blockingButton.paddingBottom}px ${blockingButton.paddingLeft}px`:`${blockingButton.padding}px`,zIndex:100,...font.customFont?{fontFamily:font.fontFamily,fontWeight:parseInt(font.fontWeight),fontSize:`${font.fontSize}px`}:{fontSize:font.fontSize,...fallbackFont}};const absoluteContainerStyle={position:\"absolute\",height:\"100%\",width:\"100%\",display:\"flex\",flexDirection:\"column\",justifyContent:\"center\",alignItems:\"center\",zIndex:1};const canAccess=hasTier(planIDs);let component=canAccess?unlockedComponent===null||unlockedComponent===void 0?void 0:unlockedComponent[0]:lockedComponent===null||lockedComponent===void 0?void 0:lockedComponent[0];if(component&&props.style){var _component_props;component=/*#__PURE__*/cloneElement(component,{style:{...(_component_props=component.props)===null||_component_props===void 0?void 0:_component_props.style,...props.style}});}if(blockingButton===null||blockingButton===void 0?void 0:blockingButton.label){var _blockingButton_label;return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:canAccess?component:/*#__PURE__*/_jsxs(_Fragment,{children:[component,((_blockingButton_label=blockingButton.label)===null||_blockingButton_label===void 0?void 0:_blockingButton_label.length)?/*#__PURE__*/_jsx(\"div\",{style:absoluteContainerStyle,children:/*#__PURE__*/_jsx(\"a\",{href:link!==null&&link!==void 0?link:\"#\",children:/*#__PURE__*/_jsx(\"button\",{style:buttonStyle,children:blockingButton.label})})}):/*#__PURE__*/_jsx(_Fragment,{})]})});}else{return component;}}ThentyComponentSwitch.defaultProps={blockingButton:{label:\"Unlock Access\",buttonFill:\"#000000\",textColor:\"#FFFFFF\",hoverButtonFill:\"#ffffff\",hoverTextColor:\"#000000\",borderColor:\"#FAFAFA\",borderWidth:0,borderRadius:15,padding:15,customPadding:false},font:{fontSize:20,customFont:false}};/* CONFIG */addPropertyControls(ThentyComponentSwitch,{link:{title:\"Redirect Link\",type:ControlType.Link,defaultValue:\"/login\"},planIDs:{type:ControlType.Array,title:\"Plans Required\",control:{type:ControlType.String,title:\"Plan Dev ids\",defaultValue:\"Plan Dev Id\"}},blockingButton:{title:\"Button Settings\",type:ControlType.Object,controls:{label:{title:\"Button Label\",type:ControlType.String,defaultValue:\"Subscribe\"},buttonFill:{title:\"Button Fill\",type:ControlType.Color,defaultValue:\"#000000\"},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#FFFFFF\"},hoverButtonFill:{title:\"Hover Button Fill\",type:ControlType.Color,defaultValue:\"#ffffff\"},hoverTextColor:{title:\"Hover Text Color\",type:ControlType.Color,defaultValue:\"#000000\"},borderColor:{title:\"Border Color\",type:ControlType.Color,defaultValue:\"#FAFAFA\"},borderWidth:{title:\"Border Width\",type:ControlType.Number,displayStepper:true,defaultValue:0,min:0},borderRadius:{title:\"Border Radius\",type:ControlType.Number,displayStepper:true,defaultValue:15,min:0},padding:{type:ControlType.FusedNumber,toggleKey:\"customPadding\",toggleTitles:[\"Padding\",\"Custom padding\"],valueKeys:[\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\"],valueLabels:[\"Top\",\"Right\",\"Bottom\",\"Left\"],min:0,title:\"Inner Padding\"}}},font:{title:\"Font\",type:ControlType.Object,controls:{customFont:{type:ControlType.Boolean,title:\"Custom Font\",defaultValue:false,disabledTitle:\"Default\",enabledTitle:\"Custom\"},fontFamily:{type:ControlType.String,title:\"Family\",placeholder:\"Inter\",hidden:({customFont})=>!customFont},fontWeight:{type:ControlType.Enum,title:\"Weight\",options:Object.keys(fontWeights),defaultValue:400,optionTitles:Object.values(fontWeights),hidden:({customFont})=>!customFont},fontSize:{title:\"Font Size\",type:ControlType.Number,displayStepper:true,defaultValue:16}}},lockedComponent:{title:\"Locked Component\",type:ControlType.ComponentInstance},unlockedComponent:{title:\"Unlocked Component\",type:ControlType.ComponentInstance}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ThentyComponentSwitch\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutType\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ThentyComponentSwitch.map"],"mappings":"qPAOG,SAAwB,EAAsB,EAAM,CAAC,IAAM,EAAe,CAAC,OAAO,OAAO,QAAQ,OAAO,eAAe,SAAS,WAAW,SAAS,SAAS,SAAS,SAAS,WAAW,CAAM,CAAC,kBAAgB,oBAAkB,iBAAe,OAAK,aA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