{
  "version": 3,
  "sources": ["ssg:https://framerusercontent.com/modules/XmIPeVSsL5eNnao4xJEU/YSH8vrKEaycMqQFngW3I/Linkdisplay.js"],
  "sourcesContent": ["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerDisableUnlink\n */export default function Link_Display(props){const getStyle=()=>({color:props.fontColor,textDecoration:props.showUnderline?\"underline\":\"none\",cursor:props.isClickable?\"pointer\":\"default\",display:\"inline-flex\",alignItems:\"center\",gap:\"4px\",...props.font});const handleClick=e=>{if(!props.isClickable){e.preventDefault();}};const renderLink=()=>{try{const url=new URL(props.link);const hostname=url.hostname;let displayText=\"\";switch(props.displayStyle){case\"plain\":displayText=url.origin+(props.showPath&&url.pathname!==\"/\"?url.pathname:\"\");break;case\"urlOnly\":displayText=hostname;break;case\"urlNoWww\":displayText=hostname.replace(/^www\\./,\"\");break;case\"nameOnly\":const parts=hostname.replace(/^www\\./,\"\").split(\".\");displayText=parts[0];break;default:displayText=props.link;}if(props.showPath&&url.pathname!==\"/\"&&props.displayStyle!==\"plain\"){displayText+=url.pathname;}return displayText;}catch{return props.link;}};const ExternalIcon=()=>/*#__PURE__*/_jsx(\"svg\",{height:`${parseFloat(props.font.fontSize||\"16px\")*.8}px`,width:`${parseFloat(props.font.fontSize||\"16px\")*.8}px`,viewBox:\"0 0 24 24\",fill:\"none\",style:{minWidth:`${parseFloat(props.font.fontSize||\"16px\")*.8}px`,marginTop:\"1px\"},children:/*#__PURE__*/_jsx(\"path\",{d:\"M21 13v7a1 1 0 01-1 1H4a1 1 0 01-1-1V4a1 1 0 011-1h7m4 0h6m0 0v6m0-6L11 13\",stroke:props.fontColor,strokeWidth:\"2\",strokeLinecap:\"round\"})});return /*#__PURE__*/_jsxs(\"a\",{href:props.link,style:getStyle(),onClick:handleClick,target:props.newTab?\"_blank\":\"_self\",rel:props.newTab?\"noopener noreferrer\":\"\",children:[renderLink(),props.showExternalIcon&&/*#__PURE__*/_jsx(ExternalIcon,{})]});}Link_Display.defaultProps={link:\"https://www.example.com\",fontColor:\"#000000\",showUnderline:true,isClickable:true,displayStyle:\"plain\",newTab:false,showPath:false,showExternalIcon:false};addPropertyControls(Link_Display,{link:{type:ControlType.Link,title:\"Link\"},displayStyle:{type:ControlType.Enum,title:\"Display Style\",options:[\"plain\",\"urlOnly\",\"urlNoWww\",\"nameOnly\"],defaultValue:\"plain\"},font:{type:ControlType.Font,controls:\"extended\",title:\"Font\"},fontColor:{type:ControlType.Color,title:\"Color\"},showUnderline:{type:ControlType.Boolean,title:\"Show Underline\",defaultValue:true},showPath:{type:ControlType.Boolean,title:\"Show Path\",defaultValue:false},showExternalIcon:{type:ControlType.Boolean,title:\"Show External Icon\",defaultValue:false},isClickable:{type:ControlType.Boolean,title:\"Clickable\",defaultValue:true},newTab:{type:ControlType.Boolean,title:\"Open in New Tab\",defaultValue:false,description:\"v1.2 \\n[via SegmentUI](https://www.segmentUI.com)\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Link_Display\",\"slots\":[],\"annotations\":{\"framerDisableUnlink\":\"\",\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Linkdisplay.map"],
  "mappings": "gEAEkB,SAARA,EAA8BC,EAAM,CAAC,IAAMC,EAAS,KAAK,CAAC,MAAMD,EAAM,UAAU,eAAeA,EAAM,cAAc,YAAY,OAAO,OAAOA,EAAM,YAAY,UAAU,UAAU,QAAQ,cAAc,WAAW,SAAS,IAAI,MAAM,GAAGA,EAAM,IAAI,GAASE,EAAYC,GAAG,CAAKH,EAAM,aAAaG,EAAE,eAAe,CAAG,EAAQC,EAAW,IAAI,CAAC,GAAG,CAAC,IAAMC,EAAI,IAAI,IAAIL,EAAM,IAAI,EAAQM,EAASD,EAAI,SAAaE,EAAY,GAAG,OAAOP,EAAM,aAAa,CAAC,IAAI,QAAQO,EAAYF,EAA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