"use strict";(self.webpackChunk_grafana_ui=self.webpackChunk_grafana_ui||[]).push([[6021],{"./src/components/ColorPicker/ColorPickerPopover.story.tsx":function(I,h,a){a.r(h),a.d(h,{Basic:function(){return g},SeriesColorPickerPopoverExample:function(){return C}});var l=a("../../node_modules/react/index.js"),v=a("./src/themes/ThemeContext.tsx"),y=a("./src/components/ColorPicker/ColorPickerPopover.tsx"),i=a("./src/components/ColorPicker/SeriesColorPickerPopover.tsx"),r=Object.defineProperty,d=Object.defineProperties,_=Object.getOwnPropertyDescriptors,f=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,x=(u,c,P)=>c in u?r(u,c,{enumerable:!0,configurable:!0,writable:!0,value:P}):u[c]=P,E=(u,c)=>{for(var P in c||(c={}))n.call(c,P)&&x(u,P,c[P]);if(f)for(var P of f(c))m.call(c,P)&&x(u,P,c[P]);return u},b=(u,c)=>d(u,_(c)),O,w,s,o,e,t;const p={title:"Pickers and Editors/ColorPicker/Popovers",component:y.$,subcomponents:{SeriesColorPickerPopover:i.o}},g=()=>l.createElement("div",{style:{position:"absolute"}},l.createElement(y.$,{color:"#BC67E6",onChange:u=>{console.log(u)}})),C=()=>{const u=(0,v.$j)();return l.createElement("div",{style:{position:"absolute"}},l.createElement(i.o,{theme:u,color:"#BC67E6",onChange:c=>{console.log(c)}}))};h.default=p,g.parameters=b(E({},g.parameters),{docs:b(E({},(O=g.parameters)==null?void 0:O.docs),{source:E({originalSource:`() => {
  return <div style={{
    position: 'absolute'
  }}>
      <ColorPickerPopover color="#BC67E6" onChange={(color: string) => {
      console.log(color);
    }} />
    </div>;
}`},(s=(w=g.parameters)==null?void 0:w.docs)==null?void 0:s.source)})}),C.parameters=b(E({},C.parameters),{docs:b(E({},(o=C.parameters)==null?void 0:o.docs),{source:E({originalSource:`() => {
  const theme = useTheme2();
  return <div style={{
    position: 'absolute'
  }}>
      <SeriesColorPickerPopover theme={theme} color="#BC67E6" onChange={(color: string) => {
      console.log(color);
    }} />
    </div>;
}`},(t=(e=C.parameters)==null?void 0:e.docs)==null?void 0:t.source)})})},"../grafana-data/src/types/icon.ts":function(I,h,a){a.d(h,{Uo:function(){return y},az:function(){return l},n6:function(){return v}});const l={google:!0,microsoft:!0,github:!0,gitlab:!0,okta:!0,discord:!0,hipchat:!0,amazon:!0,"google-hangouts-alt":!0,pagerduty:!0,line:!0,anchor:!0,"adjust-circle":!0,"angle-double-down":!0,"angle-double-right":!0,"angle-double-up":!0,"angle-down":!0,"angle-left":!0,"angle-right":!0,"angle-up":!0,"align-left":!0,"align-right":!0,"application-observability":!0,apps:!0,"archive-alt":!0,arrow:!0,"arrow-down":!0,"arrow-from-right":!0,"arrow-left":!0,"arrow-random":!0,"arrow-right":!0,"arrow-to-right":!0,"arrow-up":!0,"arrows-h":!0,"arrows-v":!0,asserts:!0,"expand-arrows":!0,at:!0,ai:!0,backward:!0,bars:!0,bell:!0,"bell-slash":!0,bolt:!0,book:!0,bookmark:!0,"book-open":!0,"brackets-curly":!0,bug:!0,building:!0,"calculator-alt":!0,"calendar-alt":!0,"calendar-slash":!0,camera:!0,capture:!0,"channel-add":!0,"chart-line":!0,check:!0,"check-circle":!0,"check-square":!0,circle:!0,"circle-mono":!0,"clipboard-alt":!0,"clock-nine":!0,cloud:!0,"cloud-download":!0,"cloud-upload":!0,"code-branch":!0,cog:!0,columns:!0,"comment-alt":!0,"comment-alt-message":!0,"comment-alt-share":!0,"comments-alt":!0,compass:!0,copy:!0,"corner-down-right-alt":!0,"create-dashboard":!0,"credit-card":!0,crosshair:!0,cube:!0,dashboard:!0,database:!0,"dice-three":!0,docker:!0,"document-info":!0,"download-alt":!0,draggabledots:!0,edit:!0,"ellipsis-v":!0,envelope:!0,"exchange-alt":!0,"exclamation-triangle":!0,"exclamation-circle":!0,"external-link-alt":!0,eye:!0,"eye-slash":!0,"ellipsis-h":!0,"fa fa-spinner":!0,favorite:!0,"file-alt":!0,"file-blank":!0,"file-copy-alt":!0,"file-download":!0,"file-edit-alt":!0,"file-landscape-alt":!0,filter:!0,flip:!0,folder:!0,font:!0,fire:!0,"folder-open":!0,"folder-plus":!0,"folder-upload":!0,forward:!0,"frontend-observability":!0,"gf-bar-alignment-after":!0,"gf-bar-alignment-before":!0,"gf-bar-alignment-center":!0,"gf-glue":!0,"gf-grid":!0,"gf-interpolation-linear":!0,"gf-interpolation-smooth":!0,"gf-interpolation-step-after":!0,"gf-interpolation-step-before":!0,"gf-landscape":!0,"gf-layout-simple":!0,"gf-logs":!0,"gf-ml":!0,"gf-movepane-left":!0,"gf-movepane-right":!0,"gf-portrait":!0,"gf-service-account":!0,"gf-show-context":!0,"gf-pin":!0,"gf-prometheus":!0,"gf-traces":!0,globe:!0,grafana:!0,"graph-bar":!0,heart:!0,"heart-rate":!0,"heart-break":!0,history:!0,"history-alt":!0,home:!0,"home-alt":!0,"horizontal-align-center":!0,"horizontal-align-left":!0,"horizontal-align-right":!0,hourglass:!0,import:!0,info:!0,"info-circle":!0,k6:!0,"key-skeleton-alt":!0,keyboard:!0,"layer-group":!0,"layers-alt":!0,"library-panel":!0,"line-alt":!0,link:!0,"list-ui-alt":!0,"list-ul":!0,"list-ol":!0,lock:!0,"map-marker":!0,"map-marker-plus":!0,"map-marker-minus":!0,message:!0,minus:!0,"minus-circle":!0,"mobile-android":!0,monitor:!0,palette:!0,"panel-add":!0,"pathfinder-unite":!0,pause:!0,pen:!0,percentage:!0,play:!0,plug:!0,plus:!0,"plus-circle":!0,"plus-square":!0,power:!0,"presentation-play":!0,process:!0,"question-circle":!0,"record-audio":!0,repeat:!0,rocket:!0,"ruler-combined":!0,save:!0,search:!0,"search-minus":!0,"search-plus":!0,"share-alt":!0,shield:!0,"shield-exclamation":!0,signal:!0,signin:!0,signout:!0,sitemap:!0,slack:!0,"sliders-v-alt":!0,spinner:!0,"sort-amount-down":!0,"sort-amount-up":!0,"square-shape":!0,star:!0,"step-backward":!0,stopwatch:!0,"stopwatch-slash":!0,sync:!0,"sync-slash":!0,table:!0,"tag-alt":!0,"telegram-alt":!0,"text-fields":!0,"thumbs-up":!0,times:!0,"times-circle":!0,"toggle-on":!0,"toggle-off":!0,"trash-alt":!0,unarchive:!0,unlock:!0,upload:!0,user:!0,"users-alt":!0,"user-arrows":!0,"vertical-align-bottom":!0,"vertical-align-center":!0,"vertical-align-top":!0,"web-section-alt":!0,"wrap-text":!0,rss:!0,x:!0};function v(i){return!i||typeof i!="string"?!1:i in l}function y(i){if(v(i))return i}},"./src/components/Forms/commonStyles.ts":function(I,h,a){a.d(h,{SM:function(){return f},Xb:function(){return i},g$:function(){return r},gm:function(){return y},lH:function(){return d}});var l=a("../../node_modules/@emotion/css/dist/emotion-css.esm.js"),v=a("./src/themes/mixins.ts");const y=n=>(0,l.AH)({"&:focus":(0,v.Hi)(n)}),i=(n,m=!1)=>{const x=m?n.colors.error.border:n.components.input.borderColor,E=m?n.colors.error.shade:n.components.input.borderHover,b=n.components.input.background,O=n.components.input.text,w=n.isDark?"#2e2f35":"#bab4ca";return(0,l.cx)(r(n),(0,l.AH)({background:b,lineHeight:n.typography.body.lineHeight,fontSize:n.typography.size.md,color:O,border:`1px solid ${x}`,"&:-webkit-autofill, &:-webkit-autofill:hover":{boxShadow:`inset 0 0 0 1px rgba(255, 255, 255, 0), inset 0 0 0 100px ${b}!important`,WebkitTextFillColor:`${O} !important`,borderColor:w},"&:-webkit-autofill:focus":{boxShadow:`0 0 0 2px ${n.colors.background.primary}, 0 0 0px 4px ${n.colors.primary.main}, inset 0 0 0 1px rgba(255, 255, 255, 0), inset 0 0 0 100px ${b}!important`,WebkitTextFillColor:`${O} !important`},"&:hover":{borderColor:E},"&:focus":{outline:"none"},"&:disabled":{backgroundColor:n.colors.action.disabledBackground,color:n.colors.action.disabledText,border:`1px solid ${n.colors.action.disabledBackground}`,"&:hover":{borderColor:x}},"&::placeholder":{color:n.colors.text.disabled,opacity:1}}))},r=n=>(0,l.AH)({padding:n.spacing(0,1,0,1)}),d=()=>({sm:(0,l.AH)({width:_("sm")}),md:(0,l.AH)({width:_("md")}),lg:(0,l.AH)({width:_("lg")}),auto:(0,l.AH)({width:_("auto")})}),_=n=>{switch(n){case"sm":return"200px";case"md":return"320px";case"lg":return"580px";case"auto":default:return"auto"}};function f(n,m){switch(n){case"sm":return{padding:1,fontSize:m.typography.size.sm,height:m.components.height.sm};case"lg":return{padding:3,fontSize:m.typography.size.lg,height:m.components.height.lg};case"md":default:return{padding:2,fontSize:m.typography.size.md,height:m.components.height.md}}}},"./src/components/Icon/Icon.tsx":function(I,h,a){a.d(h,{I:function(){return w}});var l=a("../../node_modules/@emotion/css/dist/emotion-css.esm.js"),v=a("../../node_modules/react/index.js"),y=a("../../node_modules/react-inlinesvg/esm/index.js"),i=a("../grafana-data/src/types/icon.ts"),r=a("./src/themes/ThemeContext.tsx"),d=a("./src/components/Icon/utils.ts"),_=Object.defineProperty,f=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,m=Object.prototype.propertyIsEnumerable,x=(s,o,e)=>o in s?_(s,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[o]=e,E=(s,o)=>{for(var e in o||(o={}))n.call(o,e)&&x(s,e,o[e]);if(f)for(var e of f(o))m.call(o,e)&&x(s,e,o[e]);return s},b=(s,o)=>{var e={};for(var t in s)n.call(s,t)&&o.indexOf(t)<0&&(e[t]=s[t]);if(s!=null&&f)for(var t of f(s))o.indexOf(t)<0&&m.call(s,t)&&(e[t]=s[t]);return e};const O=s=>({icon:(0,l.AH)({display:"inline-block",fill:"currentColor",flexShrink:0,label:"Icon",lineHeight:0,verticalAlign:"middle"}),orange:(0,l.AH)({fill:s.v1.palette.orange})}),w=v.forwardRef((s,o)=>{var e=s,{size:t="md",type:p="default",name:g,className:C,style:u,title:c=""}=e,P=b(e,["size","type","name","className","style","title"]);const R=(0,r.of)(O);(0,i.n6)(g)||console.warn("Icon component passed an invalid icon name",g);const S=g==="fa fa-spinner"?"spinner":g,T=(0,d.Wj)(),M=(0,d.cs)(t),k=M,D=g.startsWith("gf-bar-align")?16:g.startsWith("gf-interp")?30:M,B=(0,d.Xi)(S,p),A=`${T}${B}/${S}.svg`,L=(0,l.cx)(R.icon,C,p==="mono"?{[R.orange]:g==="favorite"}:"",S==="spinner"&&"fa-spin");return v.createElement(y.A,E({innerRef:o,src:A,width:D,height:k,title:c,className:L,style:u},P))});w.displayName="Icon";try{w.displayName="Icon",w.__docgenInfo={description:"",displayName:"Icon",props:{name:{defaultValue:null,description:"",name:"name",required:!0,type:{name:"enum",value:[{value:'"play"'},{value:'"google"'},{value:'"microsoft"'},{value:'"github"'},{value:'"gitlab"'},{value:'"okta"'},{value:'"discord"'},{value:'"hipchat"'},{value:'"amazon"'},{value:'"google-hangouts-alt"'},{value:'"pagerduty"'},{value:'"line"'},{value:'"anchor"'},{value:'"adjust-circle"'},{value:'"angle-double-down"'},{value:'"angle-double-right"'},{value:'"angle-double-up"'},{value:'"angle-down"'},{value:'"angle-left"'},{value:'"angle-right"'},{value:'"angle-up"'},{value:'"align-left"'},{value:'"align-right"'},{value:'"application-observability"'},{value:'"apps"'},{value:'"archive-alt"'},{value:'"arrow"'},{value:'"arrow-down"'},{value:'"arrow-from-right"'},{value:'"arrow-left"'},{value:'"arrow-random"'},{value:'"arrow-right"'},{value:'"arrow-to-right"'},{value:'"arrow-up"'},{value:'"arrows-h"'},{value:'"arrows-v"'},{value:'"asserts"'},{value:'"expand-arrows"'},{value:'"at"'},{value:'"ai"'},{value:'"backward"'},{value:'"bars"'},{value:'"bell"'},{value:'"bell-slash"'},{value:'"bolt"'},{value:'"book"'},{value:'"bookmark"'},{value:'"book-open"'},{value:'"brackets-curly"'},{value:'"bug"'},{value:'"building"'},{value:'"calculator-alt"'},{value:'"calendar-alt"'},{value:'"calendar-slash"'},{value:'"camera"'},{value:'"capture"'},{value:'"channel-add"'},{value:'"chart-line"'},{value:'"check"'},{value:'"check-circle"'},{value:'"check-square"'},{value:'"circle"'},{value:'"circle-mono"'},{value:'"clipboard-alt"'},{value:'"clock-nine"'},{value:'"cloud"'},{value:'"cloud-download"'},{value:'"cloud-upload"'},{value:'"code-branch"'},{value:'"cog"'},{value:'"columns"'},{value:'"comment-alt"'},{value:'"comment-alt-message"'},{value:'"comment-alt-share"'},{value:'"comments-alt"'},{value:'"compass"'},{value:'"copy"'},{value:'"corner-down-right-alt"'},{value:'"create-dashboard"'},{value:'"credit-card"'},{value:'"crosshair"'},{value:'"cube"'},{value:'"dashboard"'},{value:'"database"'},{value:'"dice-three"'},{value:'"docker"'},{value:'"document-info"'},{value:'"download-alt"'},{value:'"draggabledots"'},{value:'"edit"'},{value:'"ellipsis-v"'},{value:'"envelope"'},{value:'"exchange-alt"'},{value:'"exclamation-triangle"'},{value:'"exclamation-circle"'},{value:'"external-link-alt"'},{value:'"eye"'},{value:'"eye-slash"'},{value:'"ellipsis-h"'},{value:'"fa fa-spinner"'},{value:'"favorite"'},{value:'"file-alt"'},{value:'"file-blank"'},{value:'"file-copy-alt"'},{value:'"file-download"'},{value:'"file-edit-alt"'},{value:'"file-landscape-alt"'},{value:'"filter"'},{value:'"flip"'},{value:'"folder"'},{value:'"font"'},{value:'"fire"'},{value:'"folder-open"'},{value:'"folder-plus"'},{value:'"folder-upload"'},{value:'"forward"'},{value:'"frontend-observability"'},{value:'"gf-bar-alignment-after"'},{value:'"gf-bar-alignment-before"'},{value:'"gf-bar-alignment-center"'},{value:'"gf-glue"'},{value:'"gf-grid"'},{value:'"gf-interpolation-linear"'},{value:'"gf-interpolation-smooth"'},{value:'"gf-interpolation-step-after"'},{value:'"gf-interpolation-step-before"'},{value:'"gf-landscape"'},{value:'"gf-layout-simple"'},{value:'"gf-logs"'},{value:'"gf-ml"'},{value:'"gf-movepane-left"'},{value:'"gf-movepane-right"'},{value:'"gf-portrait"'},{value:'"gf-service-account"'},{value:'"gf-show-context"'},{value:'"gf-pin"'},{value:'"gf-prometheus"'},{value:'"gf-traces"'},{value:'"globe"'},{value:'"grafana"'},{value:'"graph-bar"'},{value:'"heart"'},{value:'"heart-rate"'},{value:'"heart-break"'},{value:'"history"'},{value:'"history-alt"'},{value:'"home"'},{value:'"home-alt"'},{value:'"horizontal-align-center"'},{value:'"horizontal-align-left"'},{value:'"horizontal-align-right"'},{value:'"hourglass"'},{value:'"import"'},{value:'"info"'},{value:'"info-circle"'},{value:'"k6"'},{value:'"key-skeleton-alt"'},{value:'"keyboard"'},{value:'"layer-group"'},{value:'"layers-alt"'},{value:'"library-panel"'},{value:'"line-alt"'},{value:'"link"'},{value:'"list-ui-alt"'},{value:'"list-ul"'},{value:'"list-ol"'},{value:'"lock"'},{value:'"map-marker"'},{value:'"map-marker-plus"'},{value:'"map-marker-minus"'},{value:'"message"'},{value:'"minus"'},{value:'"minus-circle"'},{value:'"mobile-android"'},{value:'"monitor"'},{value:'"palette"'},{value:'"panel-add"'},{value:'"pathfinder-unite"'},{value:'"pause"'},{value:'"pen"'},{value:'"percentage"'},{value:'"plug"'},{value:'"plus"'},{value:'"plus-circle"'},{value:'"plus-square"'},{value:'"power"'},{value:'"presentation-play"'},{value:'"process"'},{value:'"question-circle"'},{value:'"record-audio"'},{value:'"repeat"'},{value:'"rocket"'},{value:'"ruler-combined"'},{value:'"save"'},{value:'"search"'},{value:'"search-minus"'},{value:'"search-plus"'},{value:'"share-alt"'},{value:'"shield"'},{value:'"shield-exclamation"'},{value:'"signal"'},{value:'"signin"'},{value:'"signout"'},{value:'"sitemap"'},{value:'"slack"'},{value:'"sliders-v-alt"'},{value:'"spinner"'},{value:'"sort-amount-down"'},{value:'"sort-amount-up"'},{value:'"square-shape"'},{value:'"star"'},{value:'"step-backward"'},{value:'"stopwatch"'},{value:'"stopwatch-slash"'},{value:'"sync"'},{value:'"sync-slash"'},{value:'"table"'},{value:'"tag-alt"'},{value:'"telegram-alt"'},{value:'"text-fields"'},{value:'"thumbs-up"'},{value:'"times"'},{value:'"times-circle"'},{value:'"toggle-on"'},{value:'"toggle-off"'},{value:'"trash-alt"'},{value:'"unarchive"'},{value:'"unlock"'},{value:'"upload"'},{value:'"user"'},{value:'"users-alt"'},{value:'"user-arrows"'},{value:'"vertical-align-bottom"'},{value:'"vertical-align-center"'},{value:'"vertical-align-top"'},{value:'"web-section-alt"'},{value:'"wrap-text"'},{value:'"rss"'},{value:'"x"'}]}},size:{defaultValue:{value:"md"},description:"",name:"size",required:!1,type:{name:"enum",value:[{value:'"xs"'},{value:'"sm"'},{value:'"md"'},{value:'"lg"'},{value:'"xl"'},{value:'"xxl"'},{value:'"xxxl"'}]}},type:{defaultValue:{value:"default"},description:"",name:"type",required:!1,type:{name:"enum",value:[{value:'"solid"'},{value:'"default"'},{value:'"mono"'}]}},title:{defaultValue:{value:""},description:"",name:"title",required:!1,type:{name:"string"}}}},typeof STORYBOOK_REACT_CLASSES<"u"&&(STORYBOOK_REACT_CLASSES["src/components/Icon/Icon.tsx#Icon"]={docgenInfo:w.__docgenInfo,name:"Icon",path:"src/components/Icon/Icon.tsx#Icon"})}catch{}},"./src/components/Icon/utils.ts":function(I,h,a){a.d(h,{Wj:function(){return r},Xi:function(){return v},cs:function(){return y}});const l=["grafana","favorite","heart-break","heart","panel-add","library-panel","circle-mono"];function v(d,_){return d?.startsWith("gf-")?"custom":l.includes(d)?"mono":_==="default"?"unicons":_==="solid"?"solid":"mono"}function y(d){switch(d){case"xs":return 12;case"sm":return 14;case"md":return 16;case"lg":return 18;case"xl":return 24;case"xxl":return 36;case"xxxl":return 48}}let i;function r(){if(i)return i;const d=typeof window<"u"&&window.__grafana_public_path__;return d?i=d+"img/icons/":i="public/img/icons/",i}},"./src/components/Portal/Portal.tsx":function(I,h,a){a.d(h,{ZL:function(){return b},gF:function(){return O}});var l=a("../../node_modules/react/index.js"),v=a("../../node_modules/react-dom/index.js"),y=a("./src/themes/ThemeContext.tsx"),i=Object.defineProperty,r=Object.defineProperties,d=Object.getOwnPropertyDescriptors,_=Object.getOwnPropertySymbols,f=Object.prototype.hasOwnProperty,n=Object.prototype.propertyIsEnumerable,m=(o,e,t)=>e in o?i(o,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):o[e]=t,x=(o,e)=>{for(var t in e||(e={}))f.call(e,t)&&m(o,t,e[t]);if(_)for(var t of _(e))n.call(e,t)&&m(o,t,e[t]);return o},E=(o,e)=>r(o,d(e));function b(o){const{children:e,className:t,root:p,forwardedRef:g}=o,C=(0,y.$j)(),u=(0,l.useRef)(null),c=p??O();return u.current||(u.current=document.createElement("div"),t&&(u.current.className=t),u.current.style.position="relative",u.current.style.zIndex=`${C.zIndex.portal}`),(0,l.useLayoutEffect)(()=>(u.current&&c.appendChild(u.current),()=>{u.current&&c.removeChild(u.current)}),[c]),v.createPortal(l.createElement("div",{ref:g},e),u.current)}function O(){var o;return(o=window.document.getElementById("grafana-portal-container"))!=null?o:document.body}function w(){return React.createElement("div",{id:"grafana-portal-container"})}const s=l.forwardRef((o,e)=>l.createElement(b,E(x({},o),{forwardedRef:e})));s.displayName="RefForwardingPortal";try{b.displayName="RefForwardingPortal",b.__docgenInfo={description:"",displayName:"RefForwardingPortal",props:{className:{defaultValue:null,description:"",name:"className",required:!1,type:{name:"string"}},root:{defaultValue:null,description:"",name:"root",required:!1,type:{name:"HTMLElement"}},forwardedRef:{defaultValue:null,description:"",name:"forwardedRef",required:!1,type:{name:"ForwardedRef<HTMLDivElement>"}}}},typeof STORYBOOK_REACT_CLASSES<"u"&&(STORYBOOK_REACT_CLASSES["src/components/Portal/Portal.tsx#RefForwardingPortal"]={docgenInfo:s.__docgenInfo,name:"RefForwardingPortal",path:"src/components/Portal/Portal.tsx#RefForwardingPortal"})}catch{}},"./src/components/Tooltip/Tooltip.tsx":function(I,h,a){a.d(h,{m:function(){return s}});var l=a("../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs"),v=a("../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs"),y=a("../../node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs"),i=a("../../node_modules/@floating-ui/react/dist/floating-ui.react.mjs"),r=a("../../node_modules/react/index.js"),d=a("../grafana-e2e-selectors/src/selectors/index.ts"),_=a("./src/themes/ThemeContext.tsx"),f=a("./src/utils/tooltipUtils.ts"),n=a("./src/components/Portal/Portal.tsx"),m=Object.defineProperty,x=Object.getOwnPropertySymbols,E=Object.prototype.hasOwnProperty,b=Object.prototype.propertyIsEnumerable,O=(e,t,p)=>t in e?m(e,t,{enumerable:!0,configurable:!0,writable:!0,value:p}):e[t]=p,w=(e,t)=>{for(var p in t||(t={}))E.call(t,p)&&O(e,p,t[p]);if(x)for(var p of x(t))b.call(t,p)&&O(e,p,t[p]);return e};const s=r.forwardRef(({children:e,theme:t,interactive:p,show:g,placement:C,content:u},c)=>{const P=(0,r.useRef)(null),[R,S]=(0,r.useState)(g),T=g??R,M=[(0,l.cY)(8),(0,v.UU)({fallbackAxisSideDirection:"end",crossAxis:!1,boundary:document.body}),(0,v.BN)(),(0,y.UE)({element:P})],{context:k,refs:D,floatingStyles:B}=(0,i.we)({open:T,placement:(0,f.O)(C),onOpenChange:S,middleware:M,whileElementsMounted:v.ll}),A=(0,r.useId)(),L=(0,i.Mk)(k,{delay:{close:p?100:0},move:!1}),U=(0,i.iQ)(k),j=(0,i.s9)(k),{getReferenceProps:K,getFloatingProps:H}=(0,i.bv)([j,L,U]),N=typeof u=="function",z=(0,_.of)(o)[t??"info"],$=(0,r.useCallback)(W=>{D.setReference(W),typeof c=="function"?c(W):c&&(c.current=W)},[c,D]),F="aria-label"in e.props&&e.props["aria-label"]===u;return r.createElement(r.Fragment,null,r.cloneElement(e,w({ref:$,tabIndex:0,"aria-describedby":!F&&T?A:void 0},K())),T&&r.createElement(n.ZL,null,r.createElement("div",w({ref:D.setFloating,style:B},H()),r.createElement(i.ie,{className:z.arrow,ref:P,context:k}),r.createElement("div",{"data-testid":d.Tp.components.Tooltip.container,id:A,role:"tooltip",className:z.container},typeof u=="string"&&u,r.isValidElement(u)&&r.cloneElement(u),N&&u({})))))});s.displayName="Tooltip";const o=e=>{const t=(0,f.f)(e,e.components.tooltip.background,e.components.tooltip.background,e.components.tooltip.text,{topBottom:.5,rightLeft:1}),p=(0,f.f)(e,e.colors.error.main,e.colors.error.main,e.colors.error.contrastText,{topBottom:.5,rightLeft:1});return{info:t,["info-alt"]:t,error:p}};try{s.displayName="Tooltip",s.__docgenInfo={description:"",displayName:"Tooltip",props:{theme:{defaultValue:null,description:"",name:"theme",required:!1,type:{name:"enum",value:[{value:'"info"'},{value:'"error"'},{value:'"info-alt"'}]}},show:{defaultValue:null,description:"",name:"show",required:!1,type:{name:"boolean"}},placement:{defaultValue:null,description:"",name:"placement",required:!1,type:{name:"enum",value:[{value:'"auto"'},{value:'"bottom"'},{value:'"top"'},{value:'"right"'},{value:'"left"'},{value:'"bottom-start"'},{value:'"bottom-end"'},{value:'"top-start"'},{value:'"top-end"'},{value:'"right-start"'},{value:'"right-end"'},{value:'"left-start"'},{value:'"left-end"'},{value:'"auto-start"'},{value:'"auto-end"'}]}},content:{defaultValue:null,description:"",name:"content",required:!0,type:{name:"PopoverContent"}},interactive:{defaultValue:null,description:"Set to true if you want the tooltip to stay long enough so the user can move mouse over content to select text or click a link",name:"interactive",required:!1,type:{name:"boolean"}}}},typeof STORYBOOK_REACT_CLASSES<"u"&&(STORYBOOK_REACT_CLASSES["src/components/Tooltip/Tooltip.tsx#Tooltip"]={docgenInfo:s.__docgenInfo,name:"Tooltip",path:"src/components/Tooltip/Tooltip.tsx#Tooltip"})}catch{}},"./src/utils/tooltipUtils.ts":function(I,h,a){a.d(h,{O:function(){return y},f:function(){return i}});var l=a("../../node_modules/@emotion/css/dist/emotion-css.esm.js"),v=a("../grafana-data/src/themes/colorManipulator.ts");function y(r){switch(r){case"auto":return"bottom";case"auto-start":return"bottom-start";case"auto-end":return"bottom-end";default:return r??"bottom"}}function i(r,d,_,f,n){return{arrow:(0,l.AH)({fill:d}),container:(0,l.AH)({backgroundColor:d,borderRadius:r.shape.radius.default,border:`1px solid ${_}`,boxShadow:r.shadows.z2,color:f,fontSize:r.typography.bodySmall.fontSize,padding:r.spacing(n.topBottom,n.rightLeft),transition:"opacity 0.3s",zIndex:r.zIndex.tooltip,maxWidth:"400px",overflowWrap:"break-word","&[data-popper-interactive='false']":{pointerEvents:"none"},code:{border:"none",display:"inline",background:v.e$(d,.1),color:f,whiteSpace:"normal"},pre:{background:v.e$(d,.1),color:f},a:{color:f,textDecoration:"underline"},"a:hover":{textDecoration:"none"}}),headerClose:(0,l.AH)({color:r.colors.text.secondary,position:"absolute",right:r.spacing(1),top:r.spacing(1.5),backgroundColor:"transparent",border:0}),header:(0,l.AH)({paddingTop:r.spacing(1),paddingBottom:r.spacing(2)}),body:(0,l.AH)({paddingTop:r.spacing(1),paddingBottom:r.spacing(1)}),footer:(0,l.AH)({paddingTop:r.spacing(2),paddingBottom:r.spacing(1)})}}}}]);
