"use strict";const L=require("react/jsx-runtime"),h=require("react"),P=require("@chakra-ui/react"),y=require("./useObjectRef-4v2MxSjQ.cjs.js"),$=require("./mergeProps-DD8aR8go.cjs.js"),D=require("./filterDOMProps-AbzzCIX-.cjs.js"),b=require("./openLink-CkDzR4gQ.cjs.js"),S=require("./usePress-Dh8t0tPF.cjs.js"),j=require("./useFocusable-HmbZyg7l.cjs.js");function v(e,s){let{elementType:t="a",onPress:c,onPressStart:i,onPressEnd:n,onClick:a,isDisabled:r,...d}=e,o={};t!=="a"&&(o={role:"link",tabIndex:r?void 0:0});let{focusableProps:k}=j.$f645667febf57a63$export$4c014de7c8940b4c(e,s),{pressProps:l,isPressed:x}=S.$f6c31cce2adf654f$export$45712eceda6fad21({onPress:c,onPressStart:i,onPressEnd:n,onClick:a,isDisabled:r,ref:s}),m=D.$65484d02dcb7eb3e$export$457c3d6518dd4c6f(d,{labelable:!0}),q=$.$3ef42575df84b30b$export$9d1611c77c2fe928(k,l),C=b.$ea8dcbcb9ea1b556$export$9a302a45f65d0572(),R=b.$ea8dcbcb9ea1b556$export$7e924b3091a3bd18(e);return{isPressed:x,linkProps:$.$3ef42575df84b30b$export$9d1611c77c2fe928(m,R,{...q,...o,"aria-disabled":r||void 0,"aria-current":e["aria-current"],onClick:u=>{var f;(f=l.onClick)===null||f===void 0||f.call(l,u),b.$ea8dcbcb9ea1b556$export$13aea1a3cb5e3f1f(u,C,e.href,e.routerOptions)}})}}const{withContext:E}=P.createRecipeContext({key:"nimbusLink"}),O=E("a"),p=e=>{const{as:s,asChild:t,children:c,ref:i,...n}=e,a=h.useRef(null),r=y.$df56164dff5785e2$export$4338b53315abf666(P.mergeRefs(a,i)),d=s||(t?"span":"a"),{linkProps:o}=v({...n,elementType:d},r);return L.jsx(O,{...$.$3ef42575df84b30b$export$9d1611c77c2fe928(n,o,{as:s,asChild:t,ref:r}),children:c})};p.displayName="Link";exports.Link=p;
//# sourceMappingURL=link-C73zA-FF.cjs.js.map
