{"version":3,"file":"Linkdisplay.VeeP8FZ5.mjs","names":[],"sources":["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":"wOAEG,SAAwB,EAAa,EAAM,CAAmzC,OAAoB,EAAM,IAAI,CAAC,KAAK,EAAM,KAAK,YAA70C,CAAC,MAAM,EAAM,UAAU,eAAe,EAAM,cAAc,YAAY,OAAO,OAAO,EAAM,YAAY,UAAU,UAAU,QAAQ,cAAc,WAAW,SAAS,IAAI,MAAM,GAAG,EAAM,KAAK,IAAiqC,CAAC,QAA9oC,GAAG,CAAK,EAAM,aAAa,EAAE,gBAAgB,EAAqnC,OAAO,EAAM,OAAO,SAAS,QAAQ,IAAI,EAAM,OAAO,sBAAsB,GAAG,SAAS,MAAprC,CAAC,GAAG,CAAC,IAAM,EAAI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