{"version":3,"file":"context.js","sourceRoot":"","sources":["../../../../src/testing/internal/profile/context.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,IAAM,eAAe,GAAG,KAAK,CAAC,aAAa,CACzC,SAAS,CACV,CAAC;AAEF,MAAM,UAAU,uBAAuB,CAAC,EAMvC;QALC,QAAQ,cAAA,EACR,KAAK,WAAA;IAKL,IAAM,aAAa,GAAG,kBAAkB,EAAE,CAAC;IAE3C,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;IAED,OAAO,CACL,oBAAC,eAAe,CAAC,QAAQ,IAAC,KAAK,EAAE,KAAK,IACnC,QAAQ,CACgB,CAC5B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,kBAAkB;IAChC,OAAO,KAAK,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["import * as React from \"react\";\n\nexport interface ProfilerContextValue {\n renderedComponents: Array;\n}\n\nconst ProfilerContext = React.createContext(\n undefined\n);\n\nexport function ProfilerContextProvider({\n children,\n value,\n}: {\n children: React.ReactNode;\n value: ProfilerContextValue;\n}) {\n const parentContext = useProfilerContext();\n\n if (parentContext) {\n throw new Error(\"Profilers should not be nested in the same tree\");\n }\n\n return (\n \n {children}\n \n );\n}\n\nexport function useProfilerContext() {\n return React.useContext(ProfilerContext);\n}\n"]}