import{__rest as e,__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as t,jsxs as r,Fragment as i}from"react/jsx-runtime";import{withStyles as n,Tooltip as l,makeStyles as a}from"@material-ui/core";import c from"classnames";import s from"@material-ui/icons/Language";import{useDevCenterRouter as d}from"../DevCenter/DevCenterRouterContext/effects/useDevCenterRouter.js";var p=n({tooltip:{padding:"4px 8px",display:"flex",alignItems:"center"}})(l),m=a((function(e){return{root:function(e){var o=e.color;return{color:o,fontSize:"inherit",lineHeight:"inherit",letterSpacing:"0.15px",textDecoration:"none","&:hover":{color:o,textDecoration:"underline"},"&:visited":{color:o}}},disabled:{color:e.palette.primary.dark,fontSize:"inherit",lineHeight:"inherit",letterSpacing:"0.15px"},icon:{marginRight:8},buttonLink:{border:"none",background:"none",padding:0,cursor:"pointer"}}})),u=function(n){var a=n.children,u=n.href,f=n.TooltipProps,h=void 0===f?{}:f,b=n.className,v=void 0===b?"":b,g=n.color,x=void 0===g?"#03bcd4":g,k=n.target,D=void 0===k?"_blank":k,N=n.disabled,T=void 0!==N&&N,C=n.showTooltip,S=void 0!==C&&C,w=n.tooltipText,y=void 0===w?"":w,_=e(n,["children","href","TooltipProps","className","color","target","disabled","showTooltip","tooltipText"]),j=m({color:x}),z=d();if(T)return t(l,{title:"Disabled",placement:"bottom-start",children:t("span",o({className:c(j.disabled,v)},_,{children:a}))});var L=z&&"_self"===D?t("button",o({tabIndex:0,role:"link",className:c(j.buttonLink,j.root,v),onClick:function(e){e.metaKey||e.ctrlKey?window.open(u,"_blank"):z.push(u)}},_,{children:a})):t("a",o({className:c(j.root,v),target:D,href:u,rel:"noopener noreferrer"},_,{children:a})),R=y||(null==u?void 0:u.replaceAll("/","/​"));return S||y?t(p,o({title:r(i,{children:[t(s,{fontSize:"small",className:j.icon}),R]}),placement:"bottom-start"},h,{children:L})):L};export{u as default};
