"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/objectWithoutProperties"),t=require("@babel/runtime/helpers/slicedToArray"),o=require("react/jsx-runtime"),l=require("react"),s=require("../utils.js"),n=require("./Provider/Provider.js"),i=require("./Toggle/Toggle.js"),a=require("./Popover/Popover.js"),u=require("./ToggleDisplayDefault/ToggleDisplayDefault.js");function c(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=c(e),p=c(r),g=c(t),f=["testId","className","disabled","toggleContent"];function b(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function j(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?b(Object(t),!0).forEach((function(r){d.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):b(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}var P=function(e){var r=e.className,t=e.testId,n=e.disabled,u=e.toggleContent,c=l.useState(),d=g.default(c,2),p=d[0],f=d[1],b=l.useCallback((function(e){f(s.findAppHeaderElement(e))}),[]);return o.jsxs(o.Fragment,{children:[o.jsx(i.Toggle,{className:r,testId:t,ref:b,disabled:n,children:u}),o.jsx(a.Popover,{anchorEl:p,disabled:n})]})},v=function(e){var r=e.testId,t=e.className,l=e.disabled,s=e.toggleContent,i=p.default(e,f);return o.jsx(n.Provider,j(j({},i),{},{children:o.jsx(P,{testId:r,className:t,disabled:l,toggleContent:s})}))};v.Provider=n.Provider,v.Toggle=i.Toggle,v.Popover=a.Popover,v.ToggleDisplayDefault=u.ToggleDisplayDefault,v.GetHeaderElement=s.findAppHeaderElement,exports.TemplatesControl=v;
//# sourceMappingURL=TemplatesControl.js.map
