forked from UnitTestBot/unittestbot.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
/
155-2daea970cc0a43f343aa.js.map
1 lines (1 loc) · 4.33 KB
/
155-2daea970cc0a43f343aa.js.map
1
{"version":3,"file":"155-2daea970cc0a43f343aa.js","mappings":"8NAgBgBA,EAAAA,EAedC,EACAC,EACAC,GAAAA,IAfEC,EAAAA,EAAAA,MACAC,EAAAA,EAAAA,QACAC,EAAAA,EAAAA,UACAC,EAAAA,EAAAA,SACAC,EAAAA,EAAAA,eACAC,EAAAA,EAAAA,IACAC,EAAAA,EAAAA,aAAAA,EAAAA,EACAC,SAAAA,OAAAA,IAAAA,EAAW,GAAAC,EACXC,EAAAA,EAAAA,eACAC,EAAAA,EAAAA,gBAAAA,EAAAA,EACAC,UAAAA,OAAAA,IAAAA,EAAAA,QAAAA,EACGC,GAAAA,EAAAA,EAAAA,GAAAA,EAAAA,CAAAA,QAAAA,UAAAA,YAAAA,WAAAA,iBAAAA,MAAAA,eAAAA,WAAAA,iBAAAA,kBAAAA,cAOHC,EAMEb,EANFa,MACAC,EAKEd,EALFc,OACAC,EAIEf,EAJFe,OACAC,EAGEhB,EAHFgB,OACAC,EAEEjB,EAFFiB,YACiBC,EACflB,EADFU,gBAGIS,EAAWC,KAAKC,UAAUL,GAEhCT,GAAAA,EAAAA,EAAAA,GAAAA,CACEI,UAAAA,EACAF,eAAAA,EACAC,gBAAAA,GACGH,GAGL,IAAMe,EACJC,EAAAA,QAAAA,cAACC,EAAAA,EAAAA,CAAcT,OAAQA,EAAQF,MAAOA,EAAOC,OAAQA,GACnDS,EAAAA,QAAAA,cAACE,EAAAA,EAAAA,OAAAA,OAAAA,IACKC,EAAAA,EAAAA,GACFT,EACAd,EACAY,EACAF,EACAC,EACAI,KAIJK,EAAAA,QAAAA,cAACI,EAAAA,EAAAA,OAAAA,OAAAA,GACMf,EAAAA,CACLC,MAAOA,EACPC,OAAQA,EACRc,UAAWtB,IACPuB,EAAAA,EAAAA,GACF3B,EACAC,EACAa,EACAf,EACAG,EACAe,EACAd,EACAE,MAWR,OAJiBT,EAASgC,SAAW/B,EAAa+B,QAAUC,EAAAA,OAASC,EAAAA,SAC5DV,EAAWzB,EAAKiC,SACzBhC,EAASgC,SAAAA,EAAU,WAGbjC,EAAKiC,UACPC,EAAAA,EAAAA,QAAQ,KAAkClC,EAAKiC,eAAAA,IAAAA,GAAAA,GAAAA,IAAAA,OAAAA,IAAAA,OAAAA,aAAAA,KAAAA,OAAAA,UAAAA,eAAAA,KAAAA,EAAAA,eAAAA,OAAAA,eAAAA,EAAAA,aAAAA,CAAAA,cAAAA,EAAAA,MAAAA,CAAAA,KAAAA,IAAAA,SAAAA","sources":["webpack://unittestbot-web/../src/components/lazy-hydrate.tsx"],"sourcesContent":["import React, { MutableRefObject } from \"react\"\nimport { hydrate, render } from \"react-dom\"\nimport { GatsbyImageProps } from \"./gatsby-image.browser\"\nimport { LayoutWrapper } from \"./layout-wrapper\"\nimport { Placeholder } from \"./placeholder\"\nimport { MainImageProps, MainImage } from \"./main-image\"\nimport { getMainProps, getPlaceholderProps } from \"./hooks\"\nimport { ReactElement } from \"react\"\n\ntype LazyHydrateProps = Omit<GatsbyImageProps, \"as\" | \"style\" | \"className\"> & {\n isLoading: boolean\n isLoaded: boolean // alwaystype SetStateAction<S> = S | ((prevState: S) => S);\n toggleIsLoaded: (toggle: boolean) => void\n ref: MutableRefObject<HTMLImageElement | undefined>\n}\n\nexport function lazyHydrate(\n {\n image,\n loading,\n isLoading,\n isLoaded,\n toggleIsLoaded,\n ref,\n imgClassName,\n imgStyle = {},\n objectPosition,\n backgroundColor,\n objectFit = `cover`,\n ...props\n }: LazyHydrateProps,\n root: MutableRefObject<HTMLElement | undefined>,\n hydrated: MutableRefObject<boolean>,\n forceHydrate: MutableRefObject<boolean>\n): (() => void) | null {\n const {\n width,\n height,\n layout,\n images,\n placeholder,\n backgroundColor: wrapperBackgroundColor,\n } = image\n\n const cacheKey = JSON.stringify(images)\n\n imgStyle = {\n objectFit,\n objectPosition,\n backgroundColor,\n ...imgStyle,\n }\n\n const component = (\n <LayoutWrapper layout={layout} width={width} height={height}>\n <Placeholder\n {...getPlaceholderProps(\n placeholder,\n isLoaded,\n layout,\n width,\n height,\n wrapperBackgroundColor\n )}\n />\n\n <MainImage\n {...(props as Omit<MainImageProps, \"images\" | \"fallback\">)}\n width={width}\n height={height}\n className={imgClassName}\n {...getMainProps(\n isLoading,\n isLoaded,\n images,\n loading,\n toggleIsLoaded,\n cacheKey,\n ref,\n imgStyle\n )}\n />\n </LayoutWrapper>\n )\n\n // Force render to mitigate \"Expected server HTML to contain a matching\" in develop\n const doRender = hydrated.current || forceHydrate.current ? render : hydrate\n doRender(component, root.current)\n hydrated.current = true\n\n return (): void => {\n if (root.current) {\n render((null as unknown) as ReactElement, root.current)\n }\n }\n}\n"],"names":["lazyHydrate","root","hydrated","forceHydrate","image","loading","isLoading","isLoaded","toggleIsLoaded","ref","imgClassName","imgStyle","C","objectPosition","backgroundColor","objectFit","props","width","height","layout","images","placeholder","wrapperBackgroundColor","cacheKey","JSON","stringify","component","React","LayoutWrapper","Placeholder","getPlaceholderProps","MainImage","className","getMainProps","current","render","hydrate"],"sourceRoot":""}