{"version":3,"file":"LwButton.BF8PpDqa.mjs","names":["useState","useMemo","useCallback"],"sources":["https:/framerusercontent.com/modules/jan6MdtiBAGo3nL4iL6V/anGL04eUYi8uxDecdzWu/LwButton.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{startTransition,useCallback,useMemo,useState}from\"react\";import{addPropertyControls,ControlType,Link}from\"framer\";const EASE=\"cubic-bezier(0.22, 1, 0.36, 1)\";const SANS=\"'Inter Tight', 'Inter', -apple-system, 'Helvetica Neue', Arial, sans-serif\";/**\n * Lightworks chamfered button — the dark inversion of the AIC system.\n * Primary (solid) = paper fill, dark text; secondary (raised) = charcoal.\n * The chamfer corner grows on hover. Orange is never a surface.\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */export default function LwButton(props){const{label=\"Build with us\",link:rawLink,newTab=false,smoothScroll=false,variant=\"solid\",size=\"cta\",fullWidth=false}=props;const link=rawLink||\"/contact\";const[hover,setHover]=useState(false);const sizes={cta:{ch:11,chHover:16,fs:\"0.95rem\",pad:\"0 1.6rem\",minH:\"2.9rem\",minW:\"14rem\"},nav:{ch:8,chHover:12,fs:\"0.85rem\",pad:\"0.7em 1.2em\"},lg:{ch:12,chHover:18,fs:\"1.05rem\",pad:\"1.15em 1.9em\"},sm:{ch:7,chHover:11,fs:\"0.8rem\",pad:\"0.62em 1.05em\"}};const s=sizes[size]||sizes.cta;const ch=hover?s.chHover:s.ch;const solid=variant===\"solid\";const isInternal=useMemo(()=>{if(!link)return false;return link.startsWith(\"/\")||link.startsWith(\"#\");},[link]);const hasHashAnchor=useMemo(()=>link.includes(\"#\"),[link]);const buttonStyle={...props.style,position:\"relative\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",gap:\"0.6em\",width:fullWidth?\"100%\":undefined,fontFamily:SANS,fontSize:s.fs,fontWeight:500,letterSpacing:\"-0.005em\",lineHeight:1,minHeight:s.minH,minWidth:fullWidth?undefined:s.minW,padding:s.pad,textDecoration:\"none\",background:solid?hover?\"#ecece8\":\"#d8d8d4\":hover?\"#272928\":\"#1d1f1e\",color:solid?\"#0c0d0d\":\"#d8d8d4\",clipPath:`polygon(${ch}px 0, 100% 0, 100% calc(100% - ${ch}px), calc(100% - ${ch}px) 100%, 0 100%, 0 ${ch}px)`,transition:`background 0.45s ${EASE}, color 0.45s ${EASE}, clip-path 0.45s ${EASE}`,whiteSpace:\"nowrap\",cursor:\"pointer\"};const handleMouseEnter=()=>{startTransition(()=>setHover(true));};const handleMouseLeave=()=>{startTransition(()=>setHover(false));};const handleSmoothScrollClick=useCallback(event=>{if(!smoothScroll||newTab||!hasHashAnchor)return;if(typeof window===\"undefined\"||typeof document===\"undefined\")return;const hashIndex=link.indexOf(\"#\");if(hashIndex<0)return;const pathPart=link.slice(0,hashIndex);const hashPart=link.slice(hashIndex+1);if(!hashPart)return;const isSamePage=pathPart===\"\"||pathPart===window.location.pathname;if(!isSamePage)return;const targetId=decodeURIComponent(hashPart);const targetElement=document.getElementById(targetId);if(!targetElement)return;event.preventDefault();targetElement.scrollIntoView({behavior:\"smooth\",block:\"start\"});},[hasHashAnchor,link,newTab,smoothScroll]);if(newTab||!isInternal){return /*#__PURE__*/_jsx(\"a\",{href:link,target:newTab?\"_blank\":undefined,rel:newTab?\"noopener noreferrer\":undefined,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,style:buttonStyle,children:label});}return /*#__PURE__*/_jsx(Link,{href:link,children:/*#__PURE__*/_jsx(\"a\",{onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onClick:handleSmoothScrollClick,style:buttonStyle,children:label})});}addPropertyControls(LwButton,{label:{type:ControlType.String,defaultValue:\"Build with us\"},link:{type:ControlType.Link,defaultValue:\"/contact\"},newTab:{type:ControlType.Boolean,defaultValue:false},smoothScroll:{type:ControlType.Boolean,title:\"Smooth Scroll\",defaultValue:false},variant:{type:ControlType.Enum,options:[\"solid\",\"raised\"],optionTitles:[\"Solid (paper)\",\"Raised (charcoal)\"],defaultValue:\"solid\"},size:{type:ControlType.Enum,options:[\"cta\",\"nav\",\"lg\",\"sm\"],defaultValue:\"cta\"},fullWidth:{type:ControlType.Boolean,defaultValue:false}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"LwButton\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"auto\",\"framerSupportedLayoutWidth\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./LwButton.map"],"mappings":"oNAOG,SAAwB,EAAS,EAAM,CAAC,GAAK,CAAC,QAAM,gBAAgB,KAAK,EAAQ,SAAO,GAAM,eAAa,GAAM,UAAQ,QAAQ,OAAK,MAAM,YAAU,IAAO,EAAY,EAAK,GAAS,WAAgB,CAAC,EAAM,GAAUA,EAAS,GAAM,CAAO,EAAM,CAAC,IAAI,CAAC,GAAG,GAAG,QAAQ,GAAG,GAAG,UAAU,IAAI,WAAW,KAAK,SAAS,KAAK,QAAQ,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,UAAU,IAAI,cAAc,CAAC,GAAG,CAAC,GAAG,GAAG,QAAQ,GAAG,GAAG,UAAU,IAAI,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,GAAG,SAAS,IAAI,gBAAgB,CAAC,CAAO,EAAE,EAAM,IAAO,EAAM,IAAU,EAAG,EAAM,EAAE,QAAQ,EAAE,GAAS,EAAM,IAAU,QAAc,EAAWC,MAAiB,EAAyB,EAAK,WAAW,IAAI,EAAE,EAAK,WAAW,IAAI,CAAvD,GAA0D,CAAC,EAAK,CAAC,CAAO,EAAcA,MAAY,EAAK,SAAS,IAAI,CAAC,CAAC,EAAK,CAAC,CAAO,EAAY,CAAC,GAAG,EAAM,MAAM,SAAS,WAAW,QAAQ,cAAc,WAAW,SAAS,eAAe,SAAS,IAAI,QAAQ,MAAM,EAAU,OAAO,I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