gatsby-plugin-image 3.16.0-next.0 → 3.17.0-react19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/components/gatsby-image.browser.js +8 -3
- package/dist/gatsby-image.browser.js +1 -1
- package/dist/gatsby-image.browser.modern.js +1 -1
- package/dist/{index.browser-006c3456.js → index.browser-25d2e62c.js} +2 -2
- package/dist/{index.browser-006c3456.js.map → index.browser-25d2e62c.js.map} +1 -1
- package/dist/{index.browser-395cc902.js → index.browser-93c7cf96.js} +2 -2
- package/dist/{index.browser-395cc902.js.map → index.browser-93c7cf96.js.map} +1 -1
- package/dist/lazy-hydrate-93db2ca8.js +2 -0
- package/dist/{lazy-hydrate-62277b8c.js.map → lazy-hydrate-93db2ca8.js.map} +1 -1
- package/dist/{lazy-hydrate-6ff2d17c.js → lazy-hydrate-e25ad5d4.js} +2 -2
- package/dist/{lazy-hydrate-6ff2d17c.js.map → lazy-hydrate-e25ad5d4.js.map} +1 -1
- package/dist/src/components/gatsby-image.browser.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/lazy-hydrate-62277b8c.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.15.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-image@3.15.0/packages/gatsby-plugin-image) (2025-08-27)
|
|
7
|
+
|
|
8
|
+
[🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v5.15)
|
|
9
|
+
|
|
10
|
+
#### Bug Fixes
|
|
11
|
+
|
|
12
|
+
- update dependency chokidar to ^3.6.0 [#39174](https://github.com/gatsbyjs/gatsby/issues/39174) ([5717252](https://github.com/gatsbyjs/gatsby/commit/571725239b77f2b0604b43be3e1aaaf9cda4a5d8))
|
|
13
|
+
|
|
6
14
|
## [3.14.0](https://github.com/gatsbyjs/gatsby/commits/gatsby-plugin-image@3.14.0/packages/gatsby-plugin-image) (2024-11-06)
|
|
7
15
|
|
|
8
16
|
[🧾 Release notes](https://www.gatsbyjs.com/docs/reference/release-notes/v5.14)
|
|
@@ -64,6 +64,13 @@ var GatsbyImageHydrator = function GatsbyImageHydrator(_a) {
|
|
|
64
64
|
className = preactClass;
|
|
65
65
|
}
|
|
66
66
|
var sizer = (0, layout_wrapper_1.getSizer)(layout, width, height);
|
|
67
|
+
// Memoize this { __html } object to work around an undocumented behavioral change in React 19:
|
|
68
|
+
// https://github.com/facebook/react/issues/31660.
|
|
69
|
+
var dangerouslySetInnerHTML = (0, react_1.useMemo)(function () {
|
|
70
|
+
return {
|
|
71
|
+
__html: sizer,
|
|
72
|
+
};
|
|
73
|
+
}, [sizer]);
|
|
67
74
|
(0, react_1.useEffect)(function () {
|
|
68
75
|
if (!renderImageToStringPromise) {
|
|
69
76
|
renderImageToStringPromise = Promise.resolve().then(function () { return __importStar(require("./lazy-hydrate")); }).then(function (_a) {
|
|
@@ -153,9 +160,7 @@ var GatsbyImageHydrator = function GatsbyImageHydrator(_a) {
|
|
|
153
160
|
}
|
|
154
161
|
}, [image]);
|
|
155
162
|
// By keeping all props equal React will keep the component in the DOM
|
|
156
|
-
return (0, react_1.createElement)(as, __assign(__assign({}, wrapperProps), { style: __assign(__assign(__assign({}, wStyle), style), { backgroundColor: backgroundColor }), className: "".concat(wClass).concat(className ? " ".concat(className) : ""), ref: root, dangerouslySetInnerHTML:
|
|
157
|
-
__html: sizer,
|
|
158
|
-
}, suppressHydrationWarning: true }));
|
|
163
|
+
return (0, react_1.createElement)(as, __assign(__assign({}, wrapperProps), { style: __assign(__assign(__assign({}, wStyle), style), { backgroundColor: backgroundColor }), className: "".concat(wClass).concat(className ? " ".concat(className) : ""), ref: root, dangerouslySetInnerHTML: dangerouslySetInnerHTML, suppressHydrationWarning: true }));
|
|
159
164
|
};
|
|
160
165
|
exports.GatsbyImage = (0, react_1.memo)(function GatsbyImage(props) {
|
|
161
166
|
if (!props.image) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
var e=require("./index.browser-
|
|
2
|
+
var e=require("./index.browser-93c7cf96.js");require("react"),require("camelcase"),require("prop-types"),exports.GatsbyImage=e.GatsbyImage,exports.MainImage=e.MainImage,exports.Placeholder=e.Placeholder,exports.StaticImage=e.StaticImage,exports.generateImageData=e.generateImageData,exports.getImage=e.getImage,exports.getImageData=e.getImageData,exports.getLowResolutionImageURL=e.getLowResolutionImageURL,exports.getSrc=e.getSrc,exports.getSrcSet=e.getSrcSet,exports.withArtDirection=e.withArtDirection;
|
|
3
3
|
//# sourceMappingURL=gatsby-image.browser.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
export{G as GatsbyImage,M as MainImage,P as Placeholder,S as StaticImage,i as generateImageData,c as getImage,f as getImageData,j as getLowResolutionImageURL,d as getSrc,e as getSrcSet,w as withArtDirection}from"./index.browser-
|
|
2
|
+
export{G as GatsbyImage,M as MainImage,P as Placeholder,S as StaticImage,i as generateImageData,c as getImage,f as getImageData,j as getLowResolutionImageURL,d as getSrc,e as getSrcSet,w as withArtDirection}from"./index.browser-25d2e62c.js";import"react";import"camelcase";import"prop-types";
|
|
3
3
|
//# sourceMappingURL=gatsby-image.browser.modern.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import e,{Fragment as t,memo as a,createElement as i,useRef as s,useMemo as r,useEffect as n,useLayoutEffect as o}from"react";import l from"camelcase";import*as d from"prop-types";import c from"prop-types";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},h.apply(this,arguments)}function u(e,t){if(null==e)return{};var a,i,s={},r=Object.keys(e);for(i=0;i<r.length;i++)t.indexOf(a=r[i])>=0||(s[a]=e[a]);return s}const g=[.25,.5,1,2],p=[750,1080,1366,1920],m=[320,654,768,1024,1366,1600,1920,2048,2560,3440,3840,4096],f=800,w=800,y=4/3,b=e=>console.warn(e),v=(e,t)=>e-t,E=(e,t)=>{switch(t){case"constrained":return`(min-width: ${e}px) ${e}px, 100vw`;case"fixed":return`${e}px`;case"fullWidth":return"100vw";default:return}},k=e=>e.map(e=>`${e.src} ${e.width}w`).join(",\n");function S(e){const t=e.lastIndexOf(".");if(-1!==t){const a=e.slice(t+1);if("jpeg"===a)return"jpg";if(3===a.length||4===a.length)return a}}function M(e){let{layout:t="constrained",width:a,height:i,sourceMetadata:s,breakpoints:r,aspectRatio:n,formats:o=["auto","webp"]}=e;return o=o.map(e=>e.toLowerCase()),t=l(t),a&&i?h({},e,{formats:o,layout:t,aspectRatio:a/i}):(s.width&&s.height&&!n&&(n=s.width/s.height),"fullWidth"===t?(a=a||s.width||r[r.length-1],i=i||Math.round(a/(n||y))):(a||(a=i&&n?i*n:s.width?s.width:i?Math.round(i/y):w),n&&!i?i=Math.round(a/n):n||(n=a/i)),h({},e,{width:a,height:i,aspectRatio:n,layout:t,formats:o}))}function N(e,t=20){var a;e=M(e);const{generateImageSource:i,filename:s,aspectRatio:r}=e;return null==(a=i(s,t,Math.round(t/r),e.sourceMetadata.format||"jpg",e.fit,e.options))?void 0:a.src}function $(e){e=M(e);let{pluginName:t,sourceMetadata:a,generateImageSource:i,layout:s,fit:r,options:n,width:o,height:l,filename:d,reporter:c={warn:b},backgroundColor:u,placeholderURL:m}=e;if(t||c.warn('[gatsby-plugin-image] "generateImageData" was not passed a plugin name'),"function"!=typeof i)throw new Error("generateImageSource must be a function");var f;a&&(a.width||a.height)?a.format||(a.format=S(d)):a={width:o,height:l,format:(null==(f=a)?void 0:f.format)||S(d)||"auto"};const y=new Set(e.formats);(0===y.size||y.has("auto")||y.has(""))&&(y.delete("auto"),y.delete(""),y.add(a.format)),y.has("jpg")&&y.has("png")&&(c.warn(`[${t}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`),y.delete("jpg"===a.format?"png":"jpg"));const v=function(e){const{width:t,height:a,filename:i,layout:s="constrained",sourceMetadata:r,reporter:n={warn:b},breakpoints:o=p}=e,l=Object.entries({width:t,height:a}).filter(([e,t])=>"number"==typeof t&&t<1);if(l.length)throw new Error(`Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${l.map(e=>e.join(": ")).join(", ")}`);return"fixed"===s?function({filename:e,sourceMetadata:t,width:a,height:i,fit:s="cover",outputPixelDensities:r=g,reporter:n={warn:b}}){let o=t.width/t.height;const l=I(r);if(a&&i){const e=j(t,{width:a,height:i,fit:s});a=e.width,i=e.height,o=e.aspectRatio}a?i||(i=Math.round(a/o)):a=i?Math.round(i*o):w;const d=a;if(t.width<a||t.height<i){const s=t.width<a?"width":"height";n.warn(`\nThe requested ${s} "${"width"===s?a:i}px" for the image ${e} was larger than the actual image ${s} of ${t[s]}px. If possible, replace the current image with a larger one.`),"width"===s?(a=t.width,i=Math.round(a/o)):a=(i=t.height)*o}return{sizes:l.filter(e=>e>=1).map(e=>Math.round(e*a)).filter(e=>e<=t.width),aspectRatio:o,presentationWidth:d,presentationHeight:Math.round(d/o),unscaledWidth:a}}(e):"constrained"===s?x(e):"fullWidth"===s?x(h({breakpoints:o},e)):(n.warn(`No valid layout was provided for the image at ${i}. Valid image layouts are fixed, fullWidth, and constrained. Found ${s}`),{sizes:[r.width],presentationWidth:r.width,presentationHeight:r.height,aspectRatio:r.width/r.height,unscaledWidth:r.width})}(h({},e,{sourceMetadata:a})),N={sources:[]};let $=e.sizes;$||($=E(v.presentationWidth,s)),y.forEach(e=>{const a=v.sizes.map(a=>{const s=i(d,a,Math.round(a/v.aspectRatio),e,r,n);if(null!=s&&s.width&&s.height&&s.src&&s.format)return s;c.warn(`[${t}] The resolver for image ${d} returned an invalid value.`)}).filter(Boolean);if("jpg"===e||"png"===e||"auto"===e){const e=a.find(e=>e.width===v.unscaledWidth)||a[0];e&&(N.fallback={src:e.src,srcSet:k(a),sizes:$})}else{var s;null==(s=N.sources)||s.push({srcSet:k(a),sizes:$,type:`image/${e}`})}});const L={images:N,layout:s,backgroundColor:u};switch(m&&(L.placeholder={fallback:m}),s){case"fixed":L.width=v.presentationWidth,L.height=v.presentationHeight;break;case"fullWidth":L.width=1,L.height=1/v.aspectRatio;break;case"constrained":L.width=e.width||v.presentationWidth||1,L.height=(L.width||1)/v.aspectRatio}return L}const I=e=>Array.from(new Set([1,...e])).sort(v);function x({sourceMetadata:e,width:t,height:a,fit:i="cover",outputPixelDensities:s=g,breakpoints:r,layout:n}){let o,l=e.width/e.height;const d=I(s);if(t&&a){const s=j(e,{width:t,height:a,fit:i});t=s.width,a=s.height,l=s.aspectRatio}t=t&&Math.min(t,e.width),a=a&&Math.min(a,e.height),t||a||(a=(t=Math.min(f,e.width))/l),t||(t=a*l);const c=t;return(e.width<t||e.height<a)&&(t=e.width,a=e.height),t=Math.round(t),(null==r?void 0:r.length)>0?(o=r.filter(t=>t<=e.width),o.length<r.length&&!o.includes(e.width)&&o.push(e.width)):(o=d.map(e=>Math.round(e*t)),o=o.filter(t=>t<=e.width)),"constrained"!==n||o.includes(t)||o.push(t),o=o.sort(v),{sizes:o,aspectRatio:l,presentationWidth:c,presentationHeight:Math.round(c/l),unscaledWidth:t}}function j(e,t){const a=e.width/e.height;let i=t.width,s=t.height;switch(t.fit){case"fill":i=t.width?t.width:e.width,s=t.height?t.height:e.height;break;case"inside":{const e=t.width?t.width:Number.MAX_SAFE_INTEGER,r=t.height?t.height:Number.MAX_SAFE_INTEGER;i=Math.min(e,Math.round(r*a)),s=Math.min(r,Math.round(e/a));break}case"outside":{const e=t.width?t.width:0,r=t.height?t.height:0;i=Math.max(e,Math.round(r*a)),s=Math.max(r,Math.round(e/a));break}default:t.width&&!t.height&&(i=t.width,s=Math.round(t.width/a)),t.height&&!t.width&&(i=Math.round(t.height*a),s=t.height)}return{width:i,height:s,aspectRatio:i/s}}const L=["baseUrl","urlBuilder","sourceWidth","sourceHeight","pluginName","formats","breakpoints","options"],T=["images","placeholder"],W=()=>"undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;function R(){return"undefined"!=typeof GATSBY___IMAGE&&GATSBY___IMAGE}const _=e=>{var t;return(e=>{var t,a;return Boolean(null==e||null==(t=e.images)||null==(a=t.fallback)?void 0:a.src)})(e)?e:(e=>Boolean(null==e?void 0:e.gatsbyImageData))(e)?e.gatsbyImageData:(e=>Boolean(null==e?void 0:e.gatsbyImage))(e)?e.gatsbyImage:null==e||null==(t=e.childImageSharp)?void 0:t.gatsbyImageData},C=e=>{var t,a,i;return null==(t=_(e))||null==(a=t.images)||null==(i=a.fallback)?void 0:i.src},O=e=>{var t,a,i;return null==(t=_(e))||null==(a=t.images)||null==(i=a.fallback)?void 0:i.srcSet};function z(e,t,a){const i={};let s="gatsby-image-wrapper";return R()||(i.position="relative",i.overflow="hidden"),"fixed"===a?(i.width=e,i.height=t):"constrained"===a&&(R()||(i.display="inline-block",i.verticalAlign="top"),s="gatsby-image-wrapper gatsby-image-wrapper-constrained"),{className:s,"data-gatsby-image-wrapper":"",style:i}}function D(e){var t;let{baseUrl:a,urlBuilder:i,sourceWidth:s,sourceHeight:r,pluginName:n="getImageData",formats:o=["auto"],breakpoints:l,options:d}=e,c=u(e,L);return null!=(t=l)&&t.length||"fullWidth"!==c.layout&&"FULL_WIDTH"!==c.layout||(l=m),$(h({},c,{pluginName:n,generateImageSource:(e,t,a,s)=>({width:t,height:a,format:s,src:i({baseUrl:e,width:t,height:a,options:d,format:s})}),filename:a,formats:o,breakpoints:l,sourceMetadata:{width:s,height:r,format:"auto"}}))}function P(e,t,a,i,s={}){return R()||(s=h({height:"100%",left:0,position:"absolute",top:0,transform:"translateZ(0)",transition:"opacity 250ms linear",width:"100%",willChange:"opacity"},s)),h({},a,{loading:i,shouldLoad:e,"data-main-image":"",style:h({},s,{opacity:t?1:0})})}function A(e,t,a,i,s,r,n,o){const l={};r&&(l.backgroundColor=r,"fixed"===a?(l.width=i,l.height=s,l.backgroundColor=r,l.position="relative"):("constrained"===a||"fullWidth"===a)&&(l.position="absolute",l.top=0,l.left=0,l.bottom=0,l.right=0)),n&&(l.objectFit=n),o&&(l.objectPosition=o);const d=h({},e,{"aria-hidden":!0,"data-placeholder-image":"",style:h({opacity:t?0:1,transition:"opacity 500ms linear"},l)});return R()||(d.style={height:"100%",left:0,position:"absolute",top:0,width:"100%"}),d}function q(e,t){const{images:a,placeholder:i}=e,s=h({},u(e,T),{images:h({},a,{sources:[]}),placeholder:i&&h({},i,{sources:[]})});var r;return t.forEach(({media:t,image:a})=>{t?(a.layout!==e.layout&&"development"===process.env.NODE_ENV&&console.warn(`[gatsby-plugin-image] Mismatched image layout: expected "${e.layout}" but received "${a.layout}". All art-directed images use the same layout as the default image`),s.images.sources.push(...a.images.sources.map(e=>h({},e,{media:t})),{media:t,srcSet:a.images.fallback.srcSet}),s.placeholder&&s.placeholder.sources.push({media:t,srcSet:a.placeholder.fallback})):"development"===process.env.NODE_ENV&&console.warn("[gatsby-plugin-image] All art-directed images passed to must have a value set for `media`. Skipping.")}),s.images.sources.push(...a.sources),null!=i&&i.sources&&(null==(r=s.placeholder)||r.sources.push(...i.sources)),s}const H=["children"],F=function({layout:t,width:a,height:i}){return"fullWidth"===t?e.createElement("div",{"aria-hidden":!0,style:{paddingTop:i/a*100+"%"}}):"constrained"===t?e.createElement("div",{style:{maxWidth:a,display:"block"}},e.createElement("img",{alt:"",role:"presentation","aria-hidden":"true",src:`data:image/svg+xml;charset=utf-8,%3Csvg%20height='${i}'%20width='${a}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E`,style:{maxWidth:"100%",display:"block",position:"static"}})):null},G=function(a){let{children:i}=a,s=u(a,H);return e.createElement(t,null,e.createElement(F,h({},s)),i,null)},V=["src","srcSet","loading","alt","shouldLoad"],B=["fallback","sources","shouldLoad"],U=function(t){let{src:a,srcSet:i,loading:s,alt:r="",shouldLoad:n}=t,o=u(t,V);return e.createElement("img",h({},o,{decoding:"async",loading:s,src:n?a:void 0,"data-src":n?void 0:a,srcSet:n?i:void 0,"data-srcset":n?void 0:i,alt:r}))},Y=function(t){let{fallback:a,sources:i=[],shouldLoad:s=!0}=t,r=u(t,B);const n=r.sizes||(null==a?void 0:a.sizes),o=e.createElement(U,h({},r,a,{sizes:n,shouldLoad:s}));return i.length?e.createElement("picture",null,i.map(({media:t,srcSet:a,type:i})=>e.createElement("source",{key:`${t}-${i}-${a}`,type:i,media:t,srcSet:s?a:void 0,"data-srcset":s?void 0:a,sizes:n})),o):o};var X;U.propTypes={src:d.string.isRequired,alt:d.string.isRequired,sizes:d.string,srcSet:d.string,shouldLoad:d.bool},Y.displayName="Picture",Y.propTypes={alt:d.string.isRequired,shouldLoad:d.bool,fallback:d.exact({src:d.string.isRequired,srcSet:d.string,sizes:d.string}),sources:d.arrayOf(d.oneOfType([d.exact({media:d.string.isRequired,type:d.string,sizes:d.string,srcSet:d.string.isRequired}),d.exact({media:d.string,type:d.string.isRequired,sizes:d.string,srcSet:d.string.isRequired})]))};const J=["fallback"],Z=function(t){let{fallback:a}=t,i=u(t,J);return a?e.createElement(Y,h({},i,{fallback:{src:a},"aria-hidden":!0,alt:""})):e.createElement("div",h({},i))};Z.displayName="Placeholder",Z.propTypes={fallback:d.string,sources:null==(X=Y.propTypes)?void 0:X.sources,alt:function(e,t,a){return e[t]?new Error(`Invalid prop \`${t}\` supplied to \`${a}\`. Validation failed.`):null}};const K=function(t){return e.createElement(e.Fragment,null,e.createElement(Y,h({},t)),e.createElement("noscript",null,e.createElement(Y,h({},t,{shouldLoad:!0}))))};K.displayName="MainImage",K.propTypes=Y.propTypes;const Q=["as","className","class","style","image","loading","imgClassName","imgStyle","backgroundColor","objectFit","objectPosition"],ee=["style","className"],te=e=>e.replace(/\n/g,""),ae=(e,t,a,...i)=>e.alt||""===e.alt?c.string(e,t,a,...i):new Error(`The "alt" prop is required in ${a}. If the image is purely presentational then pass an empty string: e.g. alt="". Learn more: https://a11y-style-guide.com/style-guide/section-media.html`),ie={image:c.object.isRequired,alt:ae},se=["as","image","style","backgroundColor","className","class","onStartLoad","onLoad","onError"],re=["style","className"],ne=new Set;let oe,le;const de=function(e){let{as:t="div",image:a,style:l,backgroundColor:d,className:c,class:g,onStartLoad:p,onLoad:m,onError:f}=e,w=u(e,se);const{width:y,height:b,layout:v}=a,E=z(y,b,v),{style:k,className:S}=E,M=u(E,re),N=s(),$=r(()=>JSON.stringify(a.images),[a.images]);g&&(c=g);const I=function(e,t,a){let i="";return"fullWidth"===e&&(i=`<div aria-hidden="true" style="padding-top: ${a/t*100}%;"></div>`),"constrained"===e&&(i=`<div style="max-width: ${t}px; display: block;"><img alt="" role="presentation" aria-hidden="true" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='${a}'%20width='${t}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width: 100%; display: block; position: static;"></div>`),i}(v,y,b);return n(()=>{oe||(oe=import("./lazy-hydrate-62277b8c.js").then(({renderImageToString:e,swapPlaceholderImage:t})=>(le=e,{renderImageToString:e,swapPlaceholderImage:t})));const e=N.current.querySelector("[data-gatsby-image-ssr]");if(e&&W())return e.complete?(null==p||p({wasCached:!0}),null==m||m({wasCached:!0}),setTimeout(()=>{e.removeAttribute("data-gatsby-image-ssr")},0)):(null==p||p({wasCached:!0}),e.addEventListener("load",function t(){e.removeEventListener("load",t),null==m||m({wasCached:!0}),setTimeout(()=>{e.removeAttribute("data-gatsby-image-ssr")},0)})),void ne.add($);if(le&&ne.has($))return;let t,i;return oe.then(({renderImageToString:e,swapPlaceholderImage:s})=>{N.current&&(N.current.innerHTML=e(h({isLoading:!0,isLoaded:ne.has($),image:a},w)),ne.has($)||(t=requestAnimationFrame(()=>{N.current&&(i=s(N.current,$,ne,l,p,m,f))})))}),()=>{t&&cancelAnimationFrame(t),i&&i()}},[a]),o(()=>{ne.has($)&&le&&(N.current.innerHTML=le(h({isLoading:ne.has($),isLoaded:ne.has($),image:a},w)),null==p||p({wasCached:!0}),null==m||m({wasCached:!0}))},[a]),i(t,h({},M,{style:h({},k,l,{backgroundColor:d}),className:`${S}${c?` ${c}`:""}`,ref:N,dangerouslySetInnerHTML:{__html:I},suppressHydrationWarning:!0}))},ce=a(function(e){return e.image?(R()||"development"!==process.env.NODE_ENV||console.warn('[gatsby-plugin-image] You\'re missing out on some cool performance features. Please add "gatsby-plugin-image" to your gatsby-config.js'),i(de,e)):("development"===process.env.NODE_ENV&&console.warn("[gatsby-plugin-image] Missing image prop"),null)});ce.propTypes=ie,ce.displayName="GatsbyImage";const he=["src","__imageData","__error","width","height","aspectRatio","tracedSVGOptions","placeholder","formats","quality","transformOptions","jpgOptions","pngOptions","webpOptions","avifOptions","blurredOptions","breakpoints","outputPixelDensities"];function ue(t){return function(a){let{src:i,__imageData:s,__error:r}=a,n=u(a,he);return r&&console.warn(r),s?e.createElement(t,h({image:s},n)):(console.warn("Image not loaded",i),r||"development"!==process.env.NODE_ENV||console.warn('Please ensure that "gatsby-plugin-image" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78'),null)}}const ge=ue(function(t){let{as:a="div",className:i,class:s,style:r,image:n,loading:o="lazy",imgClassName:l,imgStyle:d,backgroundColor:c,objectFit:g,objectPosition:p}=t,m=u(t,Q);if(!n)return console.warn("[gatsby-plugin-image] Missing image prop"),null;s&&(i=s),d=h({objectFit:g,objectPosition:p,backgroundColor:c},d);const{width:f,height:w,layout:y,images:b,placeholder:v,backgroundColor:E}=n,k=z(f,w,y),{style:S,className:M}=k,N=u(k,ee),$={fallback:void 0,sources:[]};return b.fallback&&($.fallback=h({},b.fallback,{srcSet:b.fallback.srcSet?te(b.fallback.srcSet):void 0})),b.sources&&($.sources=b.sources.map(e=>h({},e,{srcSet:te(e.srcSet)}))),e.createElement(a,h({},N,{style:h({},S,r,{backgroundColor:c}),className:`${M}${i?` ${i}`:""}`}),e.createElement(G,{layout:y,width:f,height:w},e.createElement(Z,h({},A(v,!1,y,f,w,E,g,p))),e.createElement(K,h({"data-gatsby-image-ssr":"",className:l},m,P("eager"===o,!1,$,o,d)))))}),pe=(e,t,...a)=>"fullWidth"!==e.layout||"width"!==t&&"height"!==t||!e[t]?c.number(e,t,...a):new Error(`"${t}" ${e[t]} may not be passed when layout is fullWidth.`),me=new Set(["fixed","fullWidth","constrained"]),fe={src:c.string.isRequired,alt:ae,width:pe,height:pe,sizes:c.string,layout:e=>{if(void 0!==e.layout&&!me.has(e.layout))return new Error(`Invalid value ${e.layout}" provided for prop "layout". Defaulting to "constrained". Valid values are "fixed", "fullWidth" or "constrained".`)}};ge.displayName="StaticImage",ge.propTypes=fe;const we=ue(ce);we.displayName="StaticImage",we.propTypes=fe;export{ce as G,G as L,K as M,Z as P,we as S,u as _,h as a,P as b,_ as c,C as d,O as e,D as f,A as g,W as h,$ as i,N as j,q as w};
|
|
2
|
-
//# sourceMappingURL=index.browser-
|
|
1
|
+
import e,{Fragment as t,memo as a,createElement as i,useRef as s,useMemo as r,useEffect as n,useLayoutEffect as o}from"react";import l from"camelcase";import*as d from"prop-types";import c from"prop-types";function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i])}return e},h.apply(this,arguments)}function u(e,t){if(null==e)return{};var a,i,s={},r=Object.keys(e);for(i=0;i<r.length;i++)t.indexOf(a=r[i])>=0||(s[a]=e[a]);return s}const g=[.25,.5,1,2],p=[750,1080,1366,1920],m=[320,654,768,1024,1366,1600,1920,2048,2560,3440,3840,4096],f=800,w=800,y=4/3,b=e=>console.warn(e),v=(e,t)=>e-t,E=(e,t)=>{switch(t){case"constrained":return`(min-width: ${e}px) ${e}px, 100vw`;case"fixed":return`${e}px`;case"fullWidth":return"100vw";default:return}},k=e=>e.map(e=>`${e.src} ${e.width}w`).join(",\n");function S(e){const t=e.lastIndexOf(".");if(-1!==t){const a=e.slice(t+1);if("jpeg"===a)return"jpg";if(3===a.length||4===a.length)return a}}function M(e){let{layout:t="constrained",width:a,height:i,sourceMetadata:s,breakpoints:r,aspectRatio:n,formats:o=["auto","webp"]}=e;return o=o.map(e=>e.toLowerCase()),t=l(t),a&&i?h({},e,{formats:o,layout:t,aspectRatio:a/i}):(s.width&&s.height&&!n&&(n=s.width/s.height),"fullWidth"===t?(a=a||s.width||r[r.length-1],i=i||Math.round(a/(n||y))):(a||(a=i&&n?i*n:s.width?s.width:i?Math.round(i/y):w),n&&!i?i=Math.round(a/n):n||(n=a/i)),h({},e,{width:a,height:i,aspectRatio:n,layout:t,formats:o}))}function N(e,t=20){var a;e=M(e);const{generateImageSource:i,filename:s,aspectRatio:r}=e;return null==(a=i(s,t,Math.round(t/r),e.sourceMetadata.format||"jpg",e.fit,e.options))?void 0:a.src}function $(e){e=M(e);let{pluginName:t,sourceMetadata:a,generateImageSource:i,layout:s,fit:r,options:n,width:o,height:l,filename:d,reporter:c={warn:b},backgroundColor:u,placeholderURL:m}=e;if(t||c.warn('[gatsby-plugin-image] "generateImageData" was not passed a plugin name'),"function"!=typeof i)throw new Error("generateImageSource must be a function");var f;a&&(a.width||a.height)?a.format||(a.format=S(d)):a={width:o,height:l,format:(null==(f=a)?void 0:f.format)||S(d)||"auto"};const y=new Set(e.formats);(0===y.size||y.has("auto")||y.has(""))&&(y.delete("auto"),y.delete(""),y.add(a.format)),y.has("jpg")&&y.has("png")&&(c.warn(`[${t}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`),y.delete("jpg"===a.format?"png":"jpg"));const v=function(e){const{width:t,height:a,filename:i,layout:s="constrained",sourceMetadata:r,reporter:n={warn:b},breakpoints:o=p}=e,l=Object.entries({width:t,height:a}).filter(([e,t])=>"number"==typeof t&&t<1);if(l.length)throw new Error(`Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${l.map(e=>e.join(": ")).join(", ")}`);return"fixed"===s?function({filename:e,sourceMetadata:t,width:a,height:i,fit:s="cover",outputPixelDensities:r=g,reporter:n={warn:b}}){let o=t.width/t.height;const l=I(r);if(a&&i){const e=j(t,{width:a,height:i,fit:s});a=e.width,i=e.height,o=e.aspectRatio}a?i||(i=Math.round(a/o)):a=i?Math.round(i*o):w;const d=a;if(t.width<a||t.height<i){const s=t.width<a?"width":"height";n.warn(`\nThe requested ${s} "${"width"===s?a:i}px" for the image ${e} was larger than the actual image ${s} of ${t[s]}px. If possible, replace the current image with a larger one.`),"width"===s?(a=t.width,i=Math.round(a/o)):a=(i=t.height)*o}return{sizes:l.filter(e=>e>=1).map(e=>Math.round(e*a)).filter(e=>e<=t.width),aspectRatio:o,presentationWidth:d,presentationHeight:Math.round(d/o),unscaledWidth:a}}(e):"constrained"===s?x(e):"fullWidth"===s?x(h({breakpoints:o},e)):(n.warn(`No valid layout was provided for the image at ${i}. Valid image layouts are fixed, fullWidth, and constrained. Found ${s}`),{sizes:[r.width],presentationWidth:r.width,presentationHeight:r.height,aspectRatio:r.width/r.height,unscaledWidth:r.width})}(h({},e,{sourceMetadata:a})),N={sources:[]};let $=e.sizes;$||($=E(v.presentationWidth,s)),y.forEach(e=>{const a=v.sizes.map(a=>{const s=i(d,a,Math.round(a/v.aspectRatio),e,r,n);if(null!=s&&s.width&&s.height&&s.src&&s.format)return s;c.warn(`[${t}] The resolver for image ${d} returned an invalid value.`)}).filter(Boolean);if("jpg"===e||"png"===e||"auto"===e){const e=a.find(e=>e.width===v.unscaledWidth)||a[0];e&&(N.fallback={src:e.src,srcSet:k(a),sizes:$})}else{var s;null==(s=N.sources)||s.push({srcSet:k(a),sizes:$,type:`image/${e}`})}});const L={images:N,layout:s,backgroundColor:u};switch(m&&(L.placeholder={fallback:m}),s){case"fixed":L.width=v.presentationWidth,L.height=v.presentationHeight;break;case"fullWidth":L.width=1,L.height=1/v.aspectRatio;break;case"constrained":L.width=e.width||v.presentationWidth||1,L.height=(L.width||1)/v.aspectRatio}return L}const I=e=>Array.from(new Set([1,...e])).sort(v);function x({sourceMetadata:e,width:t,height:a,fit:i="cover",outputPixelDensities:s=g,breakpoints:r,layout:n}){let o,l=e.width/e.height;const d=I(s);if(t&&a){const s=j(e,{width:t,height:a,fit:i});t=s.width,a=s.height,l=s.aspectRatio}t=t&&Math.min(t,e.width),a=a&&Math.min(a,e.height),t||a||(a=(t=Math.min(f,e.width))/l),t||(t=a*l);const c=t;return(e.width<t||e.height<a)&&(t=e.width,a=e.height),t=Math.round(t),(null==r?void 0:r.length)>0?(o=r.filter(t=>t<=e.width),o.length<r.length&&!o.includes(e.width)&&o.push(e.width)):(o=d.map(e=>Math.round(e*t)),o=o.filter(t=>t<=e.width)),"constrained"!==n||o.includes(t)||o.push(t),o=o.sort(v),{sizes:o,aspectRatio:l,presentationWidth:c,presentationHeight:Math.round(c/l),unscaledWidth:t}}function j(e,t){const a=e.width/e.height;let i=t.width,s=t.height;switch(t.fit){case"fill":i=t.width?t.width:e.width,s=t.height?t.height:e.height;break;case"inside":{const e=t.width?t.width:Number.MAX_SAFE_INTEGER,r=t.height?t.height:Number.MAX_SAFE_INTEGER;i=Math.min(e,Math.round(r*a)),s=Math.min(r,Math.round(e/a));break}case"outside":{const e=t.width?t.width:0,r=t.height?t.height:0;i=Math.max(e,Math.round(r*a)),s=Math.max(r,Math.round(e/a));break}default:t.width&&!t.height&&(i=t.width,s=Math.round(t.width/a)),t.height&&!t.width&&(i=Math.round(t.height*a),s=t.height)}return{width:i,height:s,aspectRatio:i/s}}const L=["baseUrl","urlBuilder","sourceWidth","sourceHeight","pluginName","formats","breakpoints","options"],T=["images","placeholder"],W=()=>"undefined"!=typeof HTMLImageElement&&"loading"in HTMLImageElement.prototype;function R(){return"undefined"!=typeof GATSBY___IMAGE&&GATSBY___IMAGE}const _=e=>{var t;return(e=>{var t,a;return Boolean(null==e||null==(t=e.images)||null==(a=t.fallback)?void 0:a.src)})(e)?e:(e=>Boolean(null==e?void 0:e.gatsbyImageData))(e)?e.gatsbyImageData:(e=>Boolean(null==e?void 0:e.gatsbyImage))(e)?e.gatsbyImage:null==e||null==(t=e.childImageSharp)?void 0:t.gatsbyImageData},C=e=>{var t,a,i;return null==(t=_(e))||null==(a=t.images)||null==(i=a.fallback)?void 0:i.src},O=e=>{var t,a,i;return null==(t=_(e))||null==(a=t.images)||null==(i=a.fallback)?void 0:i.srcSet};function z(e,t,a){const i={};let s="gatsby-image-wrapper";return R()||(i.position="relative",i.overflow="hidden"),"fixed"===a?(i.width=e,i.height=t):"constrained"===a&&(R()||(i.display="inline-block",i.verticalAlign="top"),s="gatsby-image-wrapper gatsby-image-wrapper-constrained"),{className:s,"data-gatsby-image-wrapper":"",style:i}}function D(e){var t;let{baseUrl:a,urlBuilder:i,sourceWidth:s,sourceHeight:r,pluginName:n="getImageData",formats:o=["auto"],breakpoints:l,options:d}=e,c=u(e,L);return null!=(t=l)&&t.length||"fullWidth"!==c.layout&&"FULL_WIDTH"!==c.layout||(l=m),$(h({},c,{pluginName:n,generateImageSource:(e,t,a,s)=>({width:t,height:a,format:s,src:i({baseUrl:e,width:t,height:a,options:d,format:s})}),filename:a,formats:o,breakpoints:l,sourceMetadata:{width:s,height:r,format:"auto"}}))}function P(e,t,a,i,s={}){return R()||(s=h({height:"100%",left:0,position:"absolute",top:0,transform:"translateZ(0)",transition:"opacity 250ms linear",width:"100%",willChange:"opacity"},s)),h({},a,{loading:i,shouldLoad:e,"data-main-image":"",style:h({},s,{opacity:t?1:0})})}function A(e,t,a,i,s,r,n,o){const l={};r&&(l.backgroundColor=r,"fixed"===a?(l.width=i,l.height=s,l.backgroundColor=r,l.position="relative"):("constrained"===a||"fullWidth"===a)&&(l.position="absolute",l.top=0,l.left=0,l.bottom=0,l.right=0)),n&&(l.objectFit=n),o&&(l.objectPosition=o);const d=h({},e,{"aria-hidden":!0,"data-placeholder-image":"",style:h({opacity:t?0:1,transition:"opacity 500ms linear"},l)});return R()||(d.style={height:"100%",left:0,position:"absolute",top:0,width:"100%"}),d}function q(e,t){const{images:a,placeholder:i}=e,s=h({},u(e,T),{images:h({},a,{sources:[]}),placeholder:i&&h({},i,{sources:[]})});var r;return t.forEach(({media:t,image:a})=>{t?(a.layout!==e.layout&&"development"===process.env.NODE_ENV&&console.warn(`[gatsby-plugin-image] Mismatched image layout: expected "${e.layout}" but received "${a.layout}". All art-directed images use the same layout as the default image`),s.images.sources.push(...a.images.sources.map(e=>h({},e,{media:t})),{media:t,srcSet:a.images.fallback.srcSet}),s.placeholder&&s.placeholder.sources.push({media:t,srcSet:a.placeholder.fallback})):"development"===process.env.NODE_ENV&&console.warn("[gatsby-plugin-image] All art-directed images passed to must have a value set for `media`. Skipping.")}),s.images.sources.push(...a.sources),null!=i&&i.sources&&(null==(r=s.placeholder)||r.sources.push(...i.sources)),s}const H=["children"],F=function({layout:t,width:a,height:i}){return"fullWidth"===t?e.createElement("div",{"aria-hidden":!0,style:{paddingTop:i/a*100+"%"}}):"constrained"===t?e.createElement("div",{style:{maxWidth:a,display:"block"}},e.createElement("img",{alt:"",role:"presentation","aria-hidden":"true",src:`data:image/svg+xml;charset=utf-8,%3Csvg%20height='${i}'%20width='${a}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E`,style:{maxWidth:"100%",display:"block",position:"static"}})):null},G=function(a){let{children:i}=a,s=u(a,H);return e.createElement(t,null,e.createElement(F,h({},s)),i,null)},V=["src","srcSet","loading","alt","shouldLoad"],B=["fallback","sources","shouldLoad"],U=function(t){let{src:a,srcSet:i,loading:s,alt:r="",shouldLoad:n}=t,o=u(t,V);return e.createElement("img",h({},o,{decoding:"async",loading:s,src:n?a:void 0,"data-src":n?void 0:a,srcSet:n?i:void 0,"data-srcset":n?void 0:i,alt:r}))},Y=function(t){let{fallback:a,sources:i=[],shouldLoad:s=!0}=t,r=u(t,B);const n=r.sizes||(null==a?void 0:a.sizes),o=e.createElement(U,h({},r,a,{sizes:n,shouldLoad:s}));return i.length?e.createElement("picture",null,i.map(({media:t,srcSet:a,type:i})=>e.createElement("source",{key:`${t}-${i}-${a}`,type:i,media:t,srcSet:s?a:void 0,"data-srcset":s?void 0:a,sizes:n})),o):o};var X;U.propTypes={src:d.string.isRequired,alt:d.string.isRequired,sizes:d.string,srcSet:d.string,shouldLoad:d.bool},Y.displayName="Picture",Y.propTypes={alt:d.string.isRequired,shouldLoad:d.bool,fallback:d.exact({src:d.string.isRequired,srcSet:d.string,sizes:d.string}),sources:d.arrayOf(d.oneOfType([d.exact({media:d.string.isRequired,type:d.string,sizes:d.string,srcSet:d.string.isRequired}),d.exact({media:d.string,type:d.string.isRequired,sizes:d.string,srcSet:d.string.isRequired})]))};const J=["fallback"],Z=function(t){let{fallback:a}=t,i=u(t,J);return a?e.createElement(Y,h({},i,{fallback:{src:a},"aria-hidden":!0,alt:""})):e.createElement("div",h({},i))};Z.displayName="Placeholder",Z.propTypes={fallback:d.string,sources:null==(X=Y.propTypes)?void 0:X.sources,alt:function(e,t,a){return e[t]?new Error(`Invalid prop \`${t}\` supplied to \`${a}\`. Validation failed.`):null}};const K=function(t){return e.createElement(e.Fragment,null,e.createElement(Y,h({},t)),e.createElement("noscript",null,e.createElement(Y,h({},t,{shouldLoad:!0}))))};K.displayName="MainImage",K.propTypes=Y.propTypes;const Q=["as","className","class","style","image","loading","imgClassName","imgStyle","backgroundColor","objectFit","objectPosition"],ee=["style","className"],te=e=>e.replace(/\n/g,""),ae=(e,t,a,...i)=>e.alt||""===e.alt?c.string(e,t,a,...i):new Error(`The "alt" prop is required in ${a}. If the image is purely presentational then pass an empty string: e.g. alt="". Learn more: https://a11y-style-guide.com/style-guide/section-media.html`),ie={image:c.object.isRequired,alt:ae},se=["as","image","style","backgroundColor","className","class","onStartLoad","onLoad","onError"],re=["style","className"],ne=new Set;let oe,le;const de=function(e){let{as:t="div",image:a,style:l,backgroundColor:d,className:c,class:g,onStartLoad:p,onLoad:m,onError:f}=e,w=u(e,se);const{width:y,height:b,layout:v}=a,E=z(y,b,v),{style:k,className:S}=E,M=u(E,re),N=s(),$=r(()=>JSON.stringify(a.images),[a.images]);g&&(c=g);const I=function(e,t,a){let i="";return"fullWidth"===e&&(i=`<div aria-hidden="true" style="padding-top: ${a/t*100}%;"></div>`),"constrained"===e&&(i=`<div style="max-width: ${t}px; display: block;"><img alt="" role="presentation" aria-hidden="true" src="data:image/svg+xml;charset=utf-8,%3Csvg%20height='${a}'%20width='${t}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E" style="max-width: 100%; display: block; position: static;"></div>`),i}(v,y,b),x=r(()=>({__html:I}),[I]);return n(()=>{oe||(oe=import("./lazy-hydrate-93db2ca8.js").then(({renderImageToString:e,swapPlaceholderImage:t})=>(le=e,{renderImageToString:e,swapPlaceholderImage:t})));const e=N.current.querySelector("[data-gatsby-image-ssr]");if(e&&W())return e.complete?(null==p||p({wasCached:!0}),null==m||m({wasCached:!0}),setTimeout(()=>{e.removeAttribute("data-gatsby-image-ssr")},0)):(null==p||p({wasCached:!0}),e.addEventListener("load",function t(){e.removeEventListener("load",t),null==m||m({wasCached:!0}),setTimeout(()=>{e.removeAttribute("data-gatsby-image-ssr")},0)})),void ne.add($);if(le&&ne.has($))return;let t,i;return oe.then(({renderImageToString:e,swapPlaceholderImage:s})=>{N.current&&(N.current.innerHTML=e(h({isLoading:!0,isLoaded:ne.has($),image:a},w)),ne.has($)||(t=requestAnimationFrame(()=>{N.current&&(i=s(N.current,$,ne,l,p,m,f))})))}),()=>{t&&cancelAnimationFrame(t),i&&i()}},[a]),o(()=>{ne.has($)&&le&&(N.current.innerHTML=le(h({isLoading:ne.has($),isLoaded:ne.has($),image:a},w)),null==p||p({wasCached:!0}),null==m||m({wasCached:!0}))},[a]),i(t,h({},M,{style:h({},k,l,{backgroundColor:d}),className:`${S}${c?` ${c}`:""}`,ref:N,dangerouslySetInnerHTML:x,suppressHydrationWarning:!0}))},ce=a(function(e){return e.image?(R()||"development"!==process.env.NODE_ENV||console.warn('[gatsby-plugin-image] You\'re missing out on some cool performance features. Please add "gatsby-plugin-image" to your gatsby-config.js'),i(de,e)):("development"===process.env.NODE_ENV&&console.warn("[gatsby-plugin-image] Missing image prop"),null)});ce.propTypes=ie,ce.displayName="GatsbyImage";const he=["src","__imageData","__error","width","height","aspectRatio","tracedSVGOptions","placeholder","formats","quality","transformOptions","jpgOptions","pngOptions","webpOptions","avifOptions","blurredOptions","breakpoints","outputPixelDensities"];function ue(t){return function(a){let{src:i,__imageData:s,__error:r}=a,n=u(a,he);return r&&console.warn(r),s?e.createElement(t,h({image:s},n)):(console.warn("Image not loaded",i),r||"development"!==process.env.NODE_ENV||console.warn('Please ensure that "gatsby-plugin-image" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78'),null)}}const ge=ue(function(t){let{as:a="div",className:i,class:s,style:r,image:n,loading:o="lazy",imgClassName:l,imgStyle:d,backgroundColor:c,objectFit:g,objectPosition:p}=t,m=u(t,Q);if(!n)return console.warn("[gatsby-plugin-image] Missing image prop"),null;s&&(i=s),d=h({objectFit:g,objectPosition:p,backgroundColor:c},d);const{width:f,height:w,layout:y,images:b,placeholder:v,backgroundColor:E}=n,k=z(f,w,y),{style:S,className:M}=k,N=u(k,ee),$={fallback:void 0,sources:[]};return b.fallback&&($.fallback=h({},b.fallback,{srcSet:b.fallback.srcSet?te(b.fallback.srcSet):void 0})),b.sources&&($.sources=b.sources.map(e=>h({},e,{srcSet:te(e.srcSet)}))),e.createElement(a,h({},N,{style:h({},S,r,{backgroundColor:c}),className:`${M}${i?` ${i}`:""}`}),e.createElement(G,{layout:y,width:f,height:w},e.createElement(Z,h({},A(v,!1,y,f,w,E,g,p))),e.createElement(K,h({"data-gatsby-image-ssr":"",className:l},m,P("eager"===o,!1,$,o,d)))))}),pe=(e,t,...a)=>"fullWidth"!==e.layout||"width"!==t&&"height"!==t||!e[t]?c.number(e,t,...a):new Error(`"${t}" ${e[t]} may not be passed when layout is fullWidth.`),me=new Set(["fixed","fullWidth","constrained"]),fe={src:c.string.isRequired,alt:ae,width:pe,height:pe,sizes:c.string,layout:e=>{if(void 0!==e.layout&&!me.has(e.layout))return new Error(`Invalid value ${e.layout}" provided for prop "layout". Defaulting to "constrained". Valid values are "fixed", "fullWidth" or "constrained".`)}};ge.displayName="StaticImage",ge.propTypes=fe;const we=ue(ce);we.displayName="StaticImage",we.propTypes=fe;export{ce as G,G as L,K as M,Z as P,we as S,u as _,h as a,P as b,_ as c,C as d,O as e,D as f,A as g,W as h,$ as i,N as j,q as w};
|
|
2
|
+
//# sourceMappingURL=index.browser-25d2e62c.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser-006c3456.js","sources":["../src/image-utils.ts","../src/components/hooks.ts","../src/components/layout-wrapper.tsx","../src/components/picture.tsx","../src/components/placeholder.tsx","../src/components/main-image.tsx","../src/components/gatsby-image.server.tsx","../src/components/gatsby-image.browser.tsx","../src/components/static-image.server.tsx","../src/components/static-image.tsx"],"sourcesContent":["import camelCase from \"camelcase\"\nimport type { IGatsbyImageData } from \"./index\"\n\nconst DEFAULT_PIXEL_DENSITIES = [0.25, 0.5, 1, 2]\nexport const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920]\nexport const EVERY_BREAKPOINT = [\n 320, 654, 768, 1024, 1366, 1600, 1920, 2048, 2560, 3440, 3840, 4096,\n]\nconst DEFAULT_FLUID_WIDTH = 800\nconst DEFAULT_FIXED_WIDTH = 800\nconst DEFAULT_ASPECT_RATIO = 4 / 3\n\nexport type Fit = \"cover\" | \"fill\" | \"inside\" | \"outside\" | \"contain\"\n\nexport type Layout = \"fixed\" | \"fullWidth\" | \"constrained\"\nexport type ImageFormat = \"jpg\" | \"png\" | \"webp\" | \"avif\" | \"auto\" | \"\"\n\n/**\n * The minimal required reporter, as we don't want to import it from gatsby-cli\n */\nexport interface IReporter {\n warn(message: string): void\n}\n\nexport interface ISharpGatsbyImageArgs {\n layout?: Layout\n formats?: Array<ImageFormat>\n placeholder?: \"tracedSVG\" | \"dominantColor\" | \"blurred\" | \"none\"\n tracedSVGOptions?: Record<string, unknown>\n width?: number\n height?: number\n aspectRatio?: number\n sizes?: string\n quality?: number\n transformOptions?: {\n fit?: Fit\n cropFocus?: number | string\n duotone?: {\n highlight: string\n shadow: string\n opacity?: number\n }\n grayscale?: boolean\n rotate?: number\n trim?: number\n }\n jpgOptions?: Record<string, unknown>\n pngOptions?: Record<string, unknown>\n webpOptions?: Record<string, unknown>\n avifOptions?: Record<string, unknown>\n blurredOptions?: { width?: number; toFormat?: ImageFormat }\n breakpoints?: Array<number>\n outputPixelDensities?: Array<number>\n backgroundColor?: string\n}\n\nexport interface IImageSizeArgs {\n width?: number\n height?: number\n layout?: Layout\n filename: string\n outputPixelDensities?: Array<number>\n breakpoints?: Array<number>\n fit?: Fit\n reporter?: IReporter\n sourceMetadata: { width: number; height: number }\n}\n\nexport interface IImageSizes {\n sizes: Array<number>\n presentationWidth: number\n presentationHeight: number\n aspectRatio: number\n unscaledWidth: number\n}\n\nexport interface IImage {\n src: string\n width: number\n height: number\n format: ImageFormat\n}\n\nexport interface IGatsbyImageHelperArgs {\n pluginName: string\n generateImageSource: (\n filename: string,\n width: number,\n height: number,\n format: ImageFormat,\n fit?: Fit,\n options?: Record<string, unknown>\n ) => IImage\n layout?: Layout\n formats?: Array<ImageFormat>\n filename: string\n placeholderURL?: string\n width?: number\n height?: number\n sizes?: string\n reporter?: IReporter\n sourceMetadata?: { width: number; height: number; format: ImageFormat }\n fit?: Fit\n options?: Record<string, unknown>\n breakpoints?: Array<number>\n backgroundColor?: string\n aspectRatio?: number\n}\n\nconst warn = (message: string): void => console.warn(message)\n\nconst sortNumeric = (a: number, b: number): number => a - b\n\nexport const getSizes = (width: number, layout: Layout): string | undefined => {\n switch (layout) {\n // If screen is wider than the max size, image width is the max size,\n // otherwise it's the width of the screen\n case `constrained`:\n return `(min-width: ${width}px) ${width}px, 100vw`\n\n // Image is always the same width, whatever the size of the screen\n case `fixed`:\n return `${width}px`\n\n // Image is always the width of the screen\n case `fullWidth`:\n return `100vw`\n\n default:\n return undefined\n }\n}\n\nexport const getSrcSet = (images: Array<IImage>): string =>\n images.map(image => `${image.src} ${image.width}w`).join(`,\\n`)\n\nexport function formatFromFilename(filename: string): ImageFormat | undefined {\n const dot = filename.lastIndexOf(`.`)\n if (dot !== -1) {\n const ext = filename.slice(dot + 1)\n if (ext === `jpeg`) {\n return `jpg`\n }\n if (ext.length === 3 || ext.length === 4) {\n return ext as ImageFormat\n }\n }\n return undefined\n}\n\nexport function setDefaultDimensions(\n args: IGatsbyImageHelperArgs\n): IGatsbyImageHelperArgs {\n let {\n layout = `constrained`,\n width,\n height,\n sourceMetadata,\n breakpoints,\n aspectRatio,\n formats = [`auto`, `webp`],\n } = args\n formats = formats.map(format => format.toLowerCase() as ImageFormat)\n layout = camelCase(layout) as Layout\n\n if (width && height) {\n return { ...args, formats, layout, aspectRatio: width / height }\n }\n if (sourceMetadata.width && sourceMetadata.height && !aspectRatio) {\n aspectRatio = sourceMetadata.width / sourceMetadata.height\n }\n\n if (layout === `fullWidth`) {\n width = width || sourceMetadata.width || breakpoints[breakpoints.length - 1]\n height = height || Math.round(width / (aspectRatio || DEFAULT_ASPECT_RATIO))\n } else {\n if (!width) {\n if (height && aspectRatio) {\n width = height * aspectRatio\n } else if (sourceMetadata.width) {\n width = sourceMetadata.width\n } else if (height) {\n width = Math.round(height / DEFAULT_ASPECT_RATIO)\n } else {\n width = DEFAULT_FIXED_WIDTH\n }\n }\n\n if (aspectRatio && !height) {\n height = Math.round(width / aspectRatio)\n } else if (!aspectRatio) {\n aspectRatio = width / height\n }\n }\n return { ...args, width, height, aspectRatio, layout, formats }\n}\n\n/**\n * Use this for getting an image for the blurred placeholder. This ensures the\n * aspect ratio and crop match the main image\n */\nexport function getLowResolutionImageURL(\n args: IGatsbyImageHelperArgs,\n width = 20\n): string {\n args = setDefaultDimensions(args)\n const { generateImageSource, filename, aspectRatio } = args\n return generateImageSource(\n filename,\n width,\n Math.round(width / aspectRatio),\n args.sourceMetadata.format || `jpg`,\n args.fit,\n args.options\n )?.src\n}\n\nexport function generateImageData(\n args: IGatsbyImageHelperArgs\n): IGatsbyImageData {\n args = setDefaultDimensions(args)\n\n let {\n pluginName,\n sourceMetadata,\n generateImageSource,\n layout,\n fit,\n options,\n width,\n height,\n filename,\n reporter = { warn },\n backgroundColor,\n placeholderURL,\n } = args\n\n if (!pluginName) {\n reporter.warn(\n `[gatsby-plugin-image] \"generateImageData\" was not passed a plugin name`\n )\n }\n\n if (typeof generateImageSource !== `function`) {\n throw new Error(`generateImageSource must be a function`)\n }\n\n if (!sourceMetadata || (!sourceMetadata.width && !sourceMetadata.height)) {\n // No metadata means we let the CDN handle max size etc, aspect ratio etc\n sourceMetadata = {\n width,\n height,\n format: sourceMetadata?.format || formatFromFilename(filename) || `auto`,\n }\n } else if (!sourceMetadata.format) {\n sourceMetadata.format = formatFromFilename(filename)\n }\n\n const formats = new Set<ImageFormat>(args.formats)\n\n if (formats.size === 0 || formats.has(`auto`) || formats.has(``)) {\n formats.delete(`auto`)\n formats.delete(``)\n formats.add(sourceMetadata.format)\n }\n\n if (formats.has(`jpg`) && formats.has(`png`)) {\n reporter.warn(\n `[${pluginName}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`\n )\n if (sourceMetadata.format === `jpg`) {\n formats.delete(`png`)\n } else {\n formats.delete(`jpg`)\n }\n }\n\n const imageSizes = calculateImageSizes({ ...args, sourceMetadata })\n\n const result: IGatsbyImageData[\"images\"] = {\n sources: [],\n }\n\n let sizes = args.sizes\n if (!sizes) {\n sizes = getSizes(imageSizes.presentationWidth, layout)\n }\n\n formats.forEach(format => {\n const images = imageSizes.sizes\n .map(size => {\n const imageSrc = generateImageSource(\n filename,\n size,\n Math.round(size / imageSizes.aspectRatio),\n format,\n fit,\n options\n )\n if (\n !imageSrc?.width ||\n !imageSrc.height ||\n !imageSrc.src ||\n !imageSrc.format\n ) {\n reporter.warn(\n `[${pluginName}] The resolver for image ${filename} returned an invalid value.`\n )\n return undefined\n }\n return imageSrc\n })\n .filter(Boolean)\n\n if (format === `jpg` || format === `png` || format === `auto`) {\n const unscaled =\n images.find(img => img.width === imageSizes.unscaledWidth) || images[0]\n\n if (unscaled) {\n result.fallback = {\n src: unscaled.src,\n srcSet: getSrcSet(images),\n sizes,\n }\n }\n } else {\n result.sources?.push({\n srcSet: getSrcSet(images),\n sizes,\n type: `image/${format}`,\n })\n }\n })\n\n const imageProps: Partial<IGatsbyImageData> = {\n images: result,\n layout,\n backgroundColor,\n }\n\n if (placeholderURL) {\n imageProps.placeholder = { fallback: placeholderURL }\n }\n\n switch (layout) {\n case `fixed`:\n imageProps.width = imageSizes.presentationWidth\n imageProps.height = imageSizes.presentationHeight\n break\n\n case `fullWidth`:\n imageProps.width = 1\n imageProps.height = 1 / imageSizes.aspectRatio\n break\n\n case `constrained`:\n imageProps.width = args.width || imageSizes.presentationWidth || 1\n imageProps.height = (imageProps.width || 1) / imageSizes.aspectRatio\n }\n\n return imageProps as IGatsbyImageData\n}\n\nconst dedupeAndSortDensities = (values: Array<number>): Array<number> =>\n Array.from(new Set([1, ...values])).sort(sortNumeric)\n\nexport function calculateImageSizes(args: IImageSizeArgs): IImageSizes {\n const {\n width,\n height,\n filename,\n layout = `constrained`,\n sourceMetadata: imgDimensions,\n reporter = { warn },\n breakpoints = DEFAULT_BREAKPOINTS,\n } = args\n\n // check that all dimensions provided are positive\n const userDimensions = { width, height }\n const erroneousUserDimensions = Object.entries(userDimensions).filter(\n ([_, size]) => typeof size === `number` && size < 1\n )\n if (erroneousUserDimensions.length) {\n throw new Error(\n `Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${erroneousUserDimensions\n .map(dim => dim.join(`: `))\n .join(`, `)}`\n )\n }\n\n if (layout === `fixed`) {\n return fixedImageSizes(args)\n } else if (layout === `constrained`) {\n return responsiveImageSizes(args)\n } else if (layout === `fullWidth`) {\n return responsiveImageSizes({ breakpoints, ...args })\n } else {\n reporter.warn(\n `No valid layout was provided for the image at ${filename}. Valid image layouts are fixed, fullWidth, and constrained. Found ${layout}`\n )\n return {\n sizes: [imgDimensions.width],\n presentationWidth: imgDimensions.width,\n presentationHeight: imgDimensions.height,\n aspectRatio: imgDimensions.width / imgDimensions.height,\n unscaledWidth: imgDimensions.width,\n }\n }\n}\nexport function fixedImageSizes({\n filename,\n sourceMetadata: imgDimensions,\n width,\n height,\n fit = `cover`,\n outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n reporter = { warn },\n}: IImageSizeArgs): IImageSizes {\n let aspectRatio = imgDimensions.width / imgDimensions.height\n // Sort, dedupe and ensure there's a 1\n const densities = dedupeAndSortDensities(outputPixelDensities)\n\n // If both are provided then we need to check the fit\n if (width && height) {\n const calculated = getDimensionsAndAspectRatio(imgDimensions, {\n width,\n height,\n fit,\n })\n width = calculated.width\n height = calculated.height\n aspectRatio = calculated.aspectRatio\n }\n\n if (!width) {\n if (!height) {\n width = DEFAULT_FIXED_WIDTH\n } else {\n width = Math.round(height * aspectRatio)\n }\n } else if (!height) {\n height = Math.round(width / aspectRatio)\n }\n\n const originalWidth = width // will use this for presentationWidth, don't want to lose it\n const isTopSizeOverriden =\n imgDimensions.width < width || imgDimensions.height < (height as number)\n\n // If the image is smaller than requested, warn the user that it's being processed as such\n // print out this message with the necessary information before we overwrite it for sizing\n if (isTopSizeOverriden) {\n const fixedDimension = imgDimensions.width < width ? `width` : `height`\n reporter.warn(`\nThe requested ${fixedDimension} \"${\n fixedDimension === `width` ? width : height\n }px\" for the image ${filename} was larger than the actual image ${fixedDimension} of ${\n imgDimensions[fixedDimension]\n }px. If possible, replace the current image with a larger one.`)\n\n if (fixedDimension === `width`) {\n width = imgDimensions.width\n height = Math.round(width / aspectRatio)\n } else {\n height = imgDimensions.height\n width = height * aspectRatio\n }\n }\n\n const sizes = densities\n .filter(size => size >= 1) // remove smaller densities because fixed images don't need them\n .map(density => Math.round(density * (width as number)))\n .filter(size => size <= imgDimensions.width)\n\n return {\n sizes,\n aspectRatio,\n presentationWidth: originalWidth,\n presentationHeight: Math.round(originalWidth / aspectRatio),\n unscaledWidth: width,\n }\n}\n\nexport function responsiveImageSizes({\n sourceMetadata: imgDimensions,\n width,\n height,\n fit = `cover`,\n outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n breakpoints,\n layout,\n}: IImageSizeArgs): IImageSizes {\n let sizes\n let aspectRatio = imgDimensions.width / imgDimensions.height\n // Sort, dedupe and ensure there's a 1\n const densities = dedupeAndSortDensities(outputPixelDensities)\n\n // If both are provided then we need to check the fit\n if (width && height) {\n const calculated = getDimensionsAndAspectRatio(imgDimensions, {\n width,\n height,\n fit,\n })\n width = calculated.width\n height = calculated.height\n aspectRatio = calculated.aspectRatio\n }\n\n // Case 1: width of height were passed in, make sure it isn't larger than the actual image\n width = width && Math.min(width, imgDimensions.width)\n height = height && Math.min(height, imgDimensions.height)\n\n // Case 2: neither width or height were passed in, use default size\n if (!width && !height) {\n width = Math.min(DEFAULT_FLUID_WIDTH, imgDimensions.width)\n height = width / aspectRatio\n }\n\n // if it still hasn't been found, calculate width from the derived height.\n // TS isn't smart enough to realise the type for height has been narrowed here\n if (!width) {\n width = (height as number) * aspectRatio\n }\n\n const originalWidth = width\n const isTopSizeOverriden =\n imgDimensions.width < width || imgDimensions.height < (height as number)\n if (isTopSizeOverriden) {\n width = imgDimensions.width\n height = imgDimensions.height\n }\n\n width = Math.round(width)\n\n if (breakpoints?.length > 0) {\n sizes = breakpoints.filter(size => size <= imgDimensions.width)\n\n // If a larger breakpoint has been filtered-out, add the actual image width instead\n if (\n sizes.length < breakpoints.length &&\n !sizes.includes(imgDimensions.width)\n ) {\n sizes.push(imgDimensions.width)\n }\n } else {\n sizes = densities.map(density => Math.round(density * (width as number)))\n sizes = sizes.filter(size => size <= imgDimensions.width)\n }\n\n // ensure that the size passed in is included in the final output\n if (layout === `constrained` && !sizes.includes(width)) {\n sizes.push(width)\n }\n sizes = sizes.sort(sortNumeric)\n return {\n sizes,\n aspectRatio,\n presentationWidth: originalWidth,\n presentationHeight: Math.round(originalWidth / aspectRatio),\n unscaledWidth: width,\n }\n}\n\nexport function getDimensionsAndAspectRatio(\n dimensions,\n options\n): { width: number; height: number; aspectRatio: number } {\n // Calculate the eventual width/height of the image.\n const imageAspectRatio = dimensions.width / dimensions.height\n\n let width = options.width\n let height = options.height\n\n switch (options.fit) {\n case `fill`: {\n width = options.width ? options.width : dimensions.width\n height = options.height ? options.height : dimensions.height\n break\n }\n case `inside`: {\n const widthOption = options.width\n ? options.width\n : Number.MAX_SAFE_INTEGER\n const heightOption = options.height\n ? options.height\n : Number.MAX_SAFE_INTEGER\n\n width = Math.min(widthOption, Math.round(heightOption * imageAspectRatio))\n height = Math.min(\n heightOption,\n Math.round(widthOption / imageAspectRatio)\n )\n break\n }\n case `outside`: {\n const widthOption = options.width ? options.width : 0\n const heightOption = options.height ? options.height : 0\n\n width = Math.max(widthOption, Math.round(heightOption * imageAspectRatio))\n height = Math.max(\n heightOption,\n Math.round(widthOption / imageAspectRatio)\n )\n break\n }\n\n default: {\n if (options.width && !options.height) {\n width = options.width\n height = Math.round(options.width / imageAspectRatio)\n }\n\n if (options.height && !options.width) {\n width = Math.round(options.height * imageAspectRatio)\n height = options.height\n }\n }\n }\n\n return {\n width,\n height,\n aspectRatio: width / height,\n }\n}\n","/* global GATSBY___IMAGE */\nimport { generateImageData, EVERY_BREAKPOINT } from \"../image-utils\"\nimport type { CSSProperties, HTMLAttributes, ImgHTMLAttributes } from \"react\"\nimport type { Node } from \"gatsby\"\nimport type { PlaceholderProps } from \"./placeholder\"\nimport type { MainImageProps } from \"./main-image\"\nimport type { IGatsbyImageData } from \"./gatsby-image.browser\"\nimport type {\n IGatsbyImageHelperArgs,\n Layout,\n IImage,\n ImageFormat,\n} from \"../image-utils\"\n\n// Native lazy-loading support: https://addyosmani.com/blog/lazy-loading/\nexport const hasNativeLazyLoadSupport = (): boolean =>\n typeof HTMLImageElement !== `undefined` &&\n `loading` in HTMLImageElement.prototype\n\nexport function gatsbyImageIsInstalled(): boolean {\n return typeof GATSBY___IMAGE !== `undefined` && GATSBY___IMAGE\n}\n\nexport type IGatsbyImageDataParent<T = never> = T & {\n gatsbyImageData: IGatsbyImageData\n}\nexport type IGatsbyImageParent<T = never> = T & {\n gatsbyImage: IGatsbyImageData\n}\nexport type FileNode = Partial<Node> & {\n childImageSharp?: IGatsbyImageDataParent<Partial<Node>>\n}\n\nconst isGatsbyImageData = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageData | any\n): node is IGatsbyImageData =>\n // 🦆 check for a deep prop to be sure this is a valid gatsbyImageData object\n Boolean(node?.images?.fallback?.src)\n\nconst isGatsbyImageDataParent = <T>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageDataParent<T> | any\n): node is IGatsbyImageDataParent<T> => Boolean(node?.gatsbyImageData)\n\nconst isGatsbyImageParent = <T>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageParent<T> | any\n): node is IGatsbyImageParent<T> => Boolean(node?.gatsbyImage)\n\nexport type ImageDataLike =\n | FileNode\n | IGatsbyImageDataParent\n | IGatsbyImageParent\n | IGatsbyImageData\n\nexport const getImage = (\n node: ImageDataLike | null\n): IGatsbyImageData | undefined => {\n // This checks both for gatsbyImageData and gatsbyImage\n if (isGatsbyImageData(node)) {\n return node\n }\n // gatsbyImageData GraphQL field\n if (isGatsbyImageDataParent(node)) {\n return node.gatsbyImageData\n }\n // gatsbyImage GraphQL field for Gatsby's Image CDN service\n if (isGatsbyImageParent(node)) {\n return node.gatsbyImage\n }\n return node?.childImageSharp?.gatsbyImageData\n}\n\nexport const getSrc = (node: ImageDataLike): string | undefined =>\n getImage(node)?.images?.fallback?.src\n\nexport const getSrcSet = (node: ImageDataLike): string | undefined =>\n getImage(node)?.images?.fallback?.srcSet\n\nexport function getWrapperProps(\n width: number,\n height: number,\n layout: Layout\n): Pick<HTMLAttributes<HTMLElement>, \"className\" | \"style\"> & {\n \"data-gatsby-image-wrapper\": string\n} {\n const wrapperStyle: CSSProperties = {}\n\n let className = `gatsby-image-wrapper`\n\n // If the plugin isn't installed we need to apply the styles inline\n if (!gatsbyImageIsInstalled()) {\n wrapperStyle.position = `relative`\n wrapperStyle.overflow = `hidden`\n }\n\n if (layout === `fixed`) {\n wrapperStyle.width = width\n wrapperStyle.height = height\n } else if (layout === `constrained`) {\n if (!gatsbyImageIsInstalled()) {\n wrapperStyle.display = `inline-block`\n wrapperStyle.verticalAlign = `top`\n }\n className = `gatsby-image-wrapper gatsby-image-wrapper-constrained`\n }\n\n return {\n className,\n \"data-gatsby-image-wrapper\": ``,\n style: wrapperStyle,\n }\n}\n\nexport interface IUrlBuilderArgs<OptionsType> {\n width: number\n height: number\n baseUrl: string\n format: ImageFormat\n options: OptionsType\n}\nexport interface IGetImageDataArgs<OptionsType = Record<string, unknown>> {\n baseUrl: string\n /**\n * For constrained and fixed images, the size of the image element\n */\n width?: number\n height?: number\n /**\n * If available, pass the source image width and height\n */\n sourceWidth?: number\n sourceHeight?: number\n /**\n * If only one dimension is passed, then this will be used to calculate the other.\n */\n aspectRatio?: number\n layout?: Layout\n /**\n * Returns a URL based on the passed arguments. Should be a pure function\n */\n urlBuilder: (args: IUrlBuilderArgs<OptionsType>) => string\n\n /**\n * Should be a data URI\n */\n placeholderURL?: string\n backgroundColor?: string\n /**\n * Used in error messages etc\n */\n pluginName?: string\n\n /**\n * If you do not support auto-format, pass an array of image types here\n */\n formats?: Array<ImageFormat>\n\n breakpoints?: Array<number>\n\n /**\n * Passed to the urlBuilder function\n */\n options?: OptionsType\n}\n\n/**\n * Use this hook to generate gatsby-plugin-image data in the browser.\n */\nexport function getImageData<OptionsType>({\n baseUrl,\n urlBuilder,\n sourceWidth,\n sourceHeight,\n pluginName = `getImageData`,\n formats = [`auto`],\n breakpoints,\n options,\n ...props\n}: IGetImageDataArgs<OptionsType>): IGatsbyImageData {\n if (\n !breakpoints?.length &&\n (props.layout === `fullWidth` || (props.layout as string) === `FULL_WIDTH`)\n ) {\n breakpoints = EVERY_BREAKPOINT\n }\n const generateImageSource = (\n baseUrl: string,\n width: number,\n height?: number,\n format?: ImageFormat\n ): IImage => {\n return {\n width,\n height,\n format,\n src: urlBuilder({ baseUrl, width, height, options, format }),\n }\n }\n\n const sourceMetadata: IGatsbyImageHelperArgs[\"sourceMetadata\"] = {\n width: sourceWidth,\n height: sourceHeight,\n format: `auto`,\n }\n\n const args: IGatsbyImageHelperArgs = {\n ...props,\n pluginName,\n generateImageSource,\n filename: baseUrl,\n formats,\n breakpoints,\n sourceMetadata,\n }\n return generateImageData(args)\n}\n\nexport function getMainProps(\n isLoading: boolean,\n isLoaded: boolean,\n images: IGatsbyImageData[\"images\"],\n loading?: \"eager\" | \"lazy\",\n style: CSSProperties = {}\n): Partial<MainImageProps> {\n // fallback when it's not configured in gatsby-config.\n if (!gatsbyImageIsInstalled()) {\n style = {\n height: `100%`,\n left: 0,\n position: `absolute`,\n top: 0,\n transform: `translateZ(0)`,\n transition: `opacity 250ms linear`,\n width: `100%`,\n willChange: `opacity`,\n ...style,\n }\n }\n\n const result = {\n ...images,\n loading,\n shouldLoad: isLoading,\n \"data-main-image\": ``,\n style: {\n ...style,\n opacity: isLoaded ? 1 : 0,\n },\n }\n\n return result\n}\n\nexport type PlaceholderImageAttrs = ImgHTMLAttributes<HTMLImageElement> &\n Pick<PlaceholderProps, \"sources\" | \"fallback\"> & {\n \"data-placeholder-image\"?: string\n }\n\nexport function getPlaceholderProps(\n placeholder: PlaceholderImageAttrs | undefined,\n isLoaded: boolean,\n layout: Layout,\n width?: number,\n height?: number,\n backgroundColor?: string,\n objectFit?: CSSProperties[\"objectFit\"],\n objectPosition?: CSSProperties[\"objectPosition\"]\n): PlaceholderImageAttrs {\n const wrapperStyle: CSSProperties = {}\n\n if (backgroundColor) {\n wrapperStyle.backgroundColor = backgroundColor\n\n if (layout === `fixed`) {\n wrapperStyle.width = width\n wrapperStyle.height = height\n wrapperStyle.backgroundColor = backgroundColor\n wrapperStyle.position = `relative`\n } else if (layout === `constrained`) {\n wrapperStyle.position = `absolute`\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n } else if (layout === `fullWidth`) {\n wrapperStyle.position = `absolute`\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n }\n }\n\n if (objectFit) {\n wrapperStyle.objectFit = objectFit\n }\n\n if (objectPosition) {\n wrapperStyle.objectPosition = objectPosition\n }\n const result: PlaceholderImageAttrs = {\n ...placeholder,\n \"aria-hidden\": true,\n \"data-placeholder-image\": ``,\n style: {\n opacity: isLoaded ? 0 : 1,\n transition: `opacity 500ms linear`,\n ...wrapperStyle,\n },\n }\n\n // fallback when it's not configured in gatsby-config.\n if (!gatsbyImageIsInstalled()) {\n result.style = {\n height: `100%`,\n left: 0,\n position: `absolute`,\n top: 0,\n width: `100%`,\n }\n }\n\n return result\n}\n\nexport interface IArtDirectedImage {\n media: string\n image: IGatsbyImageData\n}\n\n/**\n * Generate a Gatsby image data object with multiple, art-directed images that display at different\n * resolutions.\n *\n * @param defaultImage The image displayed when no media query matches.\n * It is also used for all other settings applied to the image, such as width, height and layout.\n * You should pass a className to the component with media queries to adjust the size of the container,\n * as this cannot be adjusted automatically.\n * @param artDirected Array of objects which each contains a `media` string which is a media query\n * such as `(min-width: 320px)`, and the image object to use when that query matches.\n */\nexport function withArtDirection(\n defaultImage: IGatsbyImageData,\n artDirected: Array<IArtDirectedImage>\n): IGatsbyImageData {\n const { images, placeholder, ...props } = defaultImage\n const output: IGatsbyImageData = {\n ...props,\n images: {\n ...images,\n sources: [],\n },\n placeholder: placeholder && {\n ...placeholder,\n sources: [],\n },\n }\n\n artDirected.forEach(({ media, image }) => {\n if (!media) {\n if (process.env.NODE_ENV === `development`) {\n console.warn(\n \"[gatsby-plugin-image] All art-directed images passed to must have a value set for `media`. Skipping.\"\n )\n }\n return\n }\n\n if (\n image.layout !== defaultImage.layout &&\n process.env.NODE_ENV === `development`\n ) {\n console.warn(\n `[gatsby-plugin-image] Mismatched image layout: expected \"${defaultImage.layout}\" but received \"${image.layout}\". All art-directed images use the same layout as the default image`\n )\n }\n\n output.images.sources.push(\n ...image.images.sources.map(source => {\n return { ...source, media }\n }),\n {\n media,\n srcSet: image.images.fallback.srcSet,\n }\n )\n\n if (!output.placeholder) {\n return\n }\n\n output.placeholder.sources.push({\n media,\n srcSet: image.placeholder.fallback,\n })\n })\n output.images.sources.push(...images.sources)\n if (placeholder?.sources) {\n output.placeholder?.sources.push(...placeholder.sources)\n }\n return output\n}\n","import React, { Fragment, FunctionComponent, PropsWithChildren } from \"react\"\nimport terserMacro from \"../../macros/terser.macro\"\nimport { Layout } from \"../image-utils\"\n\nexport interface ILayoutWrapperProps {\n layout: Layout\n width: number\n height: number\n}\n\nconst NativeScriptLoading: FunctionComponent = () => (\n <script\n type=\"module\"\n dangerouslySetInnerHTML={{\n __html: terserMacro`\nconst hasNativeLazyLoadSupport = typeof HTMLImageElement !== \"undefined\" && \"loading\" in HTMLImageElement.prototype;\nif (hasNativeLazyLoadSupport) {\n const gatsbyImages = document.querySelectorAll('img[data-main-image]');\n for (let mainImage of gatsbyImages) {\n if (mainImage.dataset.src) {\n mainImage.setAttribute('src', mainImage.dataset.src)\n mainImage.removeAttribute('data-src')\n }\n if (mainImage.dataset.srcset) {\n mainImage.setAttribute('srcset', mainImage.dataset.srcset)\n mainImage.removeAttribute('data-srcset')\n }\n\n const sources = mainImage.parentNode.querySelectorAll('source[data-srcset]');\n for (let source of sources) {\n source.setAttribute('srcset', source.dataset.srcset)\n source.removeAttribute('data-srcset')\n }\n\n if (mainImage.complete) {\n mainImage.style.opacity = 1;\n\n // also hide the placeholder\n mainImage.parentNode.parentNode.querySelector('[data-placeholder-image]').style.opacity = 0;\n }\n }\n}\n`,\n }}\n />\n)\n\nexport function getSizer(\n layout: Layout,\n width: number,\n height: number\n): string {\n let sizer = ``\n if (layout === `fullWidth`) {\n sizer = `<div aria-hidden=\"true\" style=\"padding-top: ${\n (height / width) * 100\n }%;\"></div>`\n }\n\n if (layout === `constrained`) {\n sizer = `<div style=\"max-width: ${width}px; display: block;\"><img alt=\"\" role=\"presentation\" aria-hidden=\"true\" src=\"data:image/svg+xml;charset=utf-8,%3Csvg%20height='${height}'%20width='${width}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E\" style=\"max-width: 100%; display: block; position: static;\"></div>`\n }\n\n return sizer\n}\n\nconst Sizer: FunctionComponent<ILayoutWrapperProps> = function Sizer({\n layout,\n width,\n height,\n}) {\n if (layout === `fullWidth`) {\n return (\n <div aria-hidden style={{ paddingTop: `${(height / width) * 100}%` }} />\n )\n }\n\n if (layout === `constrained`) {\n return (\n <div style={{ maxWidth: width, display: `block` }}>\n <img\n alt=\"\"\n role=\"presentation\"\n aria-hidden=\"true\"\n src={`data:image/svg+xml;charset=utf-8,%3Csvg%20height='${height}'%20width='${width}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E`}\n style={{\n maxWidth: `100%`,\n display: `block`,\n position: `static`,\n }}\n />\n </div>\n )\n }\n\n return null\n}\n\nexport const LayoutWrapper: FunctionComponent<\n PropsWithChildren<ILayoutWrapperProps>\n> = function LayoutWrapper({ children, ...props }) {\n return (\n <Fragment>\n <Sizer {...props} />\n {children}\n\n {SERVER ? <NativeScriptLoading /> : null}\n </Fragment>\n )\n}\n","import React, { FunctionComponent, ImgHTMLAttributes } from \"react\"\nimport * as PropTypes from \"prop-types\"\n\nexport interface IResponsiveImageProps {\n sizes?: string\n srcSet: string\n}\n\nexport type SourceProps = IResponsiveImageProps &\n (\n | {\n media: string\n type?: string\n }\n | {\n media?: string\n type: string\n }\n )\n\ntype FallbackProps = { src: string } & Partial<IResponsiveImageProps>\n\ntype ImageProps = ImgHTMLAttributes<HTMLImageElement> & {\n src: string\n alt: string\n shouldLoad: boolean\n}\n\nexport type PictureProps = ImgHTMLAttributes<HTMLImageElement> & {\n fallback?: FallbackProps\n sources?: Array<SourceProps>\n alt: string\n shouldLoad?: boolean\n}\n\nconst Image: FunctionComponent<ImageProps> = function Image({\n src,\n srcSet,\n loading,\n alt = ``,\n shouldLoad,\n ...props\n}) {\n return (\n <img\n {...props}\n decoding=\"async\"\n loading={loading}\n src={shouldLoad ? src : undefined}\n data-src={!shouldLoad ? src : undefined}\n srcSet={shouldLoad ? srcSet : undefined}\n data-srcset={!shouldLoad ? srcSet : undefined}\n alt={alt}\n />\n )\n}\n\nexport const Picture: React.FC<PictureProps> = function Picture({\n fallback,\n sources = [],\n shouldLoad = true,\n ...props\n}) {\n const sizes = props.sizes || fallback?.sizes\n const fallbackImage = (\n <Image {...props} {...fallback} sizes={sizes} shouldLoad={shouldLoad} />\n )\n\n if (!sources.length) {\n return fallbackImage\n }\n\n return (\n <picture>\n {sources.map(({ media, srcSet, type }) => (\n <source\n key={`${media}-${type}-${srcSet}`}\n type={type}\n media={media}\n srcSet={shouldLoad ? srcSet : undefined}\n data-srcset={!shouldLoad ? srcSet : undefined}\n sizes={sizes}\n />\n ))}\n {fallbackImage}\n </picture>\n )\n}\n\nImage.propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string.isRequired,\n sizes: PropTypes.string,\n srcSet: PropTypes.string,\n shouldLoad: PropTypes.bool,\n}\n\nPicture.displayName = `Picture`\nPicture.propTypes = {\n alt: PropTypes.string.isRequired,\n shouldLoad: PropTypes.bool,\n fallback: PropTypes.exact({\n src: PropTypes.string.isRequired,\n srcSet: PropTypes.string,\n sizes: PropTypes.string,\n }),\n sources: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.exact({\n media: PropTypes.string.isRequired,\n type: PropTypes.string,\n sizes: PropTypes.string,\n srcSet: PropTypes.string.isRequired,\n }),\n PropTypes.exact({\n media: PropTypes.string,\n type: PropTypes.string.isRequired,\n sizes: PropTypes.string,\n srcSet: PropTypes.string.isRequired,\n }),\n ])\n ),\n}\n","import React, { FunctionComponent, ImgHTMLAttributes } from \"react\"\nimport * as PropTypes from \"prop-types\"\nimport { Picture, SourceProps } from \"./picture\"\n\nexport type PlaceholderProps = ImgHTMLAttributes<HTMLImageElement> & {\n fallback?: string\n sources?: Array<SourceProps>\n}\n\nexport const Placeholder: FunctionComponent<PlaceholderProps> =\n function Placeholder({ fallback, ...props }) {\n if (fallback) {\n return (\n <Picture\n {...props}\n fallback={{\n src: fallback,\n }}\n aria-hidden\n alt=\"\"\n />\n )\n } else {\n return <div {...props}></div>\n }\n }\n\nPlaceholder.displayName = `Placeholder`\nPlaceholder.propTypes = {\n fallback: PropTypes.string,\n sources: Picture.propTypes?.sources,\n alt: function (props, propName, componentName): Error | null {\n if (!props[propName]) {\n return null\n }\n\n return new Error(\n `Invalid prop \\`${propName}\\` supplied to \\`${componentName}\\`. Validation failed.`\n )\n },\n}\n","import React from \"react\"\nimport { Picture, PictureProps } from \"./picture\"\n\nexport type MainImageProps = PictureProps\n\nexport const MainImage: React.FC<PictureProps> = function MainImage(props) {\n return (\n <>\n <Picture {...props} />\n <noscript>\n <Picture {...props} shouldLoad={true} />\n </noscript>\n </>\n )\n}\n\nMainImage.displayName = `MainImage`\nMainImage.propTypes = Picture.propTypes\n","import React from \"react\"\nimport { getWrapperProps, getMainProps, getPlaceholderProps } from \"./hooks\"\nimport { Placeholder } from \"./placeholder\"\nimport { MainImage, MainImageProps } from \"./main-image\"\nimport { LayoutWrapper } from \"./layout-wrapper\"\nimport PropTypes from \"prop-types\"\nimport type { FunctionComponent, WeakValidationMap } from \"react\"\nimport type { GatsbyImageProps, IGatsbyImageData } from \"./gatsby-image.browser\"\n\nconst removeNewLines = (str: string): string => str.replace(/\\n/g, ``)\n\nexport const GatsbyImage: FunctionComponent<GatsbyImageProps> =\n function GatsbyImage({\n as = `div`,\n className,\n class: preactClass,\n style,\n image,\n loading = `lazy`,\n imgClassName,\n imgStyle,\n backgroundColor,\n objectFit,\n objectPosition,\n ...props\n }) {\n if (!image) {\n console.warn(`[gatsby-plugin-image] Missing image prop`)\n return null\n }\n\n if (preactClass) {\n className = preactClass\n }\n\n imgStyle = {\n objectFit,\n objectPosition,\n backgroundColor,\n ...imgStyle,\n }\n\n const {\n width,\n height,\n layout,\n images,\n placeholder,\n backgroundColor: placeholderBackgroundColor,\n } = image\n\n const {\n style: wStyle,\n className: wClass,\n ...wrapperProps\n } = getWrapperProps(width, height, layout)\n\n const cleanedImages: IGatsbyImageData[\"images\"] = {\n fallback: undefined,\n sources: [],\n }\n if (images.fallback) {\n cleanedImages.fallback = {\n ...images.fallback,\n srcSet: images.fallback.srcSet\n ? removeNewLines(images.fallback.srcSet)\n : undefined,\n }\n }\n\n if (images.sources) {\n cleanedImages.sources = images.sources.map(source => {\n return {\n ...source,\n srcSet: removeNewLines(source.srcSet),\n }\n })\n }\n\n return React.createElement(\n as,\n {\n ...wrapperProps,\n style: {\n ...wStyle,\n ...style,\n backgroundColor,\n },\n className: `${wClass}${className ? ` ${className}` : ``}`,\n },\n <LayoutWrapper layout={layout} width={width} height={height}>\n <Placeholder\n {...getPlaceholderProps(\n placeholder,\n false,\n layout,\n width,\n height,\n placeholderBackgroundColor,\n objectFit,\n objectPosition\n )}\n />\n\n <MainImage\n data-gatsby-image-ssr=\"\"\n className={imgClassName}\n {...(props as Omit<\n MainImageProps,\n \"images\" | \"fallback\" | \"onError\" | \"onLoad\"\n >)}\n // When eager is set we want to start the isLoading state on true (we want to load the img without react)\n {...getMainProps(\n loading === `eager`,\n false,\n cleanedImages,\n loading,\n imgStyle\n )}\n />\n </LayoutWrapper>\n )\n }\n\nexport const altValidator: PropTypes.Validator<string> = (\n props: GatsbyImageProps,\n propName,\n componentName,\n ...rest\n): Error | undefined => {\n if (!props.alt && props.alt !== ``) {\n return new Error(\n `The \"alt\" prop is required in ${componentName}. If the image is purely presentational then pass an empty string: e.g. alt=\"\". Learn more: https://a11y-style-guide.com/style-guide/section-media.html`\n )\n }\n\n return PropTypes.string(props, propName, componentName, ...rest)\n}\n\nexport const propTypes = {\n image: PropTypes.object.isRequired,\n alt: altValidator,\n} as WeakValidationMap<GatsbyImageProps>\n","import {\n createElement,\n memo,\n useMemo,\n useEffect,\n useLayoutEffect,\n useRef,\n} from \"react\"\nimport {\n getWrapperProps,\n gatsbyImageIsInstalled,\n hasNativeLazyLoadSupport,\n} from \"./hooks\"\nimport { getSizer } from \"./layout-wrapper\"\nimport { propTypes } from \"./gatsby-image.server\"\nimport type {\n FC,\n ElementType,\n FunctionComponent,\n ImgHTMLAttributes,\n CSSProperties,\n ReactEventHandler,\n} from \"react\"\nimport type { renderImageToString } from \"./lazy-hydrate\"\nimport type { PlaceholderProps } from \"./placeholder\"\nimport type { MainImageProps } from \"./main-image\"\nimport type { Layout } from \"../image-utils\"\n\nconst imageCache = new Set<string>()\nlet renderImageToStringPromise\nlet renderImage: typeof renderImageToString | undefined\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface GatsbyImageProps\n extends Omit<\n ImgHTMLAttributes<HTMLImageElement>,\n \"placeholder\" | \"onLoad\" | \"src\" | \"srcSet\" | \"width\" | \"height\"\n > {\n alt: string\n as?: ElementType\n className?: string\n class?: string\n imgClassName?: string\n image: IGatsbyImageData\n imgStyle?: CSSProperties\n backgroundColor?: string\n objectFit?: CSSProperties[\"objectFit\"]\n objectPosition?: CSSProperties[\"objectPosition\"]\n onLoad?: (props: { wasCached: boolean }) => void\n onError?: ReactEventHandler<HTMLImageElement>\n onStartLoad?: (props: { wasCached: boolean }) => void\n}\n\nexport interface IGatsbyImageData {\n layout: Layout\n width: number\n height: number\n backgroundColor?: string\n images: Pick<MainImageProps, \"sources\" | \"fallback\">\n placeholder?: Pick<PlaceholderProps, \"sources\" | \"fallback\">\n}\n\nconst GatsbyImageHydrator: FC<GatsbyImageProps> = function GatsbyImageHydrator({\n as = `div`,\n image,\n style,\n backgroundColor,\n className,\n class: preactClass,\n onStartLoad,\n onLoad,\n onError,\n ...props\n}) {\n const { width, height, layout } = image\n const {\n style: wStyle,\n className: wClass,\n ...wrapperProps\n } = getWrapperProps(width, height, layout)\n const root = useRef<HTMLElement>()\n const cacheKey = useMemo(() => JSON.stringify(image.images), [image.images])\n\n // Preact uses class instead of className so we need to check for both\n if (preactClass) {\n className = preactClass\n }\n\n const sizer = getSizer(layout, width, height)\n\n useEffect(() => {\n if (!renderImageToStringPromise) {\n renderImageToStringPromise = import(`./lazy-hydrate`).then(\n ({ renderImageToString, swapPlaceholderImage }) => {\n renderImage = renderImageToString\n\n return {\n renderImageToString,\n swapPlaceholderImage,\n }\n }\n )\n }\n\n // The plugin image component is a bit special where if it's server-side rendered, we add extra script tags to support lazy-loading without\n // In this case we stop hydration but fire the correct events.\n const ssrImage = root.current.querySelector(\n `[data-gatsby-image-ssr]`\n ) as HTMLImageElement\n if (ssrImage && hasNativeLazyLoadSupport()) {\n if (ssrImage.complete) {\n // Trigger onStartload and onLoad events\n onStartLoad?.({\n wasCached: true,\n })\n onLoad?.({\n wasCached: true,\n })\n\n // remove ssr key for state updates but add delay to not fight with native code snippt of gatsby-ssr\n setTimeout(() => {\n ssrImage.removeAttribute(`data-gatsby-image-ssr`)\n }, 0)\n } else {\n onStartLoad?.({\n wasCached: true,\n })\n\n ssrImage.addEventListener(`load`, function onLoadListener() {\n ssrImage.removeEventListener(`load`, onLoadListener)\n\n onLoad?.({\n wasCached: true,\n })\n // remove ssr key for state updates but add delay to not fight with native code snippt of gatsby-ssr\n setTimeout(() => {\n ssrImage.removeAttribute(`data-gatsby-image-ssr`)\n }, 0)\n })\n }\n\n imageCache.add(cacheKey)\n\n return\n }\n\n if (renderImage && imageCache.has(cacheKey)) {\n return\n }\n\n let animationFrame\n let cleanupCallback\n renderImageToStringPromise.then(\n ({ renderImageToString, swapPlaceholderImage }) => {\n if (!root.current) {\n return\n }\n\n root.current.innerHTML = renderImageToString({\n isLoading: true,\n isLoaded: imageCache.has(cacheKey),\n image,\n ...props,\n })\n\n if (!imageCache.has(cacheKey)) {\n animationFrame = requestAnimationFrame(() => {\n if (root.current) {\n cleanupCallback = swapPlaceholderImage(\n root.current,\n cacheKey,\n imageCache,\n style,\n onStartLoad,\n onLoad,\n onError\n )\n }\n })\n }\n }\n )\n\n // eslint-disable-next-line consistent-return\n return (): void => {\n if (animationFrame) {\n cancelAnimationFrame(animationFrame)\n }\n if (cleanupCallback) {\n cleanupCallback()\n }\n }\n }, [image])\n\n // useLayoutEffect is ran before React commits to the DOM. This allows us to make sure our HTML is using our cached image version\n useLayoutEffect(() => {\n if (imageCache.has(cacheKey) && renderImage) {\n root.current.innerHTML = renderImage({\n isLoading: imageCache.has(cacheKey),\n isLoaded: imageCache.has(cacheKey),\n image,\n ...props,\n })\n\n // Trigger onStartload and onLoad events\n onStartLoad?.({\n wasCached: true,\n })\n onLoad?.({\n wasCached: true,\n })\n }\n }, [image])\n\n // By keeping all props equal React will keep the component in the DOM\n return createElement(as, {\n ...wrapperProps,\n style: {\n ...wStyle,\n ...style,\n backgroundColor,\n },\n className: `${wClass}${className ? ` ${className}` : ``}`,\n ref: root,\n dangerouslySetInnerHTML: {\n __html: sizer,\n },\n suppressHydrationWarning: true,\n })\n}\n\nexport const GatsbyImage: FunctionComponent<GatsbyImageProps> = memo(\n function GatsbyImage(props) {\n if (!props.image) {\n if (process.env.NODE_ENV === `development`) {\n console.warn(`[gatsby-plugin-image] Missing image prop`)\n }\n\n return null\n }\n\n if (!gatsbyImageIsInstalled() && process.env.NODE_ENV === `development`) {\n console.warn(\n `[gatsby-plugin-image] You're missing out on some cool performance features. Please add \"gatsby-plugin-image\" to your gatsby-config.js`\n )\n }\n\n return createElement(GatsbyImageHydrator, props)\n }\n)\n\nGatsbyImage.propTypes = propTypes\nGatsbyImage.displayName = `GatsbyImage`\n","import React, { FunctionComponent, ReactElement } from \"react\"\nimport {\n altValidator,\n GatsbyImage as GatsbyImageServer,\n} from \"./gatsby-image.server\"\nimport { GatsbyImageProps, IGatsbyImageData } from \"./gatsby-image.browser\"\nimport PropTypes from \"prop-types\"\nimport { ISharpGatsbyImageArgs } from \"../image-utils\"\n\nexport interface IStaticImageProps\n extends Omit<GatsbyImageProps, \"image\">,\n Omit<ISharpGatsbyImageArgs, \"backgroundColor\"> {\n src: string\n filename?: string\n}\n\n// These values are added by Babel. Do not add them manually\ninterface IPrivateProps {\n __imageData?: IGatsbyImageData\n __error?: string\n}\n\nexport function _getStaticImage(\n GatsbyImage: FunctionComponent<GatsbyImageProps>\n): React.FC<IStaticImageProps & IPrivateProps> {\n return function StaticImage({\n src,\n __imageData: imageData,\n __error,\n // We extract these because they're not meant to be passed-down to GatsbyImage\n /* eslint-disable @typescript-eslint/no-unused-vars */\n width,\n height,\n aspectRatio,\n tracedSVGOptions,\n placeholder,\n formats,\n quality,\n transformOptions,\n jpgOptions,\n pngOptions,\n webpOptions,\n avifOptions,\n blurredOptions,\n breakpoints,\n outputPixelDensities,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...props\n }): ReactElement {\n if (__error) {\n console.warn(__error)\n }\n\n if (imageData) {\n return <GatsbyImage image={imageData} {...props} />\n }\n console.warn(`Image not loaded`, src)\n if (!__error && process.env.NODE_ENV === `development`) {\n console.warn(\n `Please ensure that \"gatsby-plugin-image\" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78`\n )\n }\n return null\n }\n}\n\nconst StaticImage: React.FC<IStaticImageProps & IPrivateProps> =\n _getStaticImage(GatsbyImageServer)\n\nconst checkDimensionProps: PropTypes.Validator<number> = (\n props: IStaticImageProps & IPrivateProps,\n propName: keyof IStaticImageProps & IPrivateProps,\n ...rest\n) => {\n if (\n props.layout === `fullWidth` &&\n (propName === `width` || propName === `height`) &&\n props[propName]\n ) {\n return new Error(\n `\"${propName}\" ${props[propName]} may not be passed when layout is fullWidth.`\n )\n }\n return PropTypes.number(props, propName, ...rest)\n}\n\nconst validLayouts = new Set([`fixed`, `fullWidth`, `constrained`])\n\nexport const propTypes = {\n src: PropTypes.string.isRequired,\n alt: altValidator,\n width: checkDimensionProps,\n height: checkDimensionProps,\n sizes: PropTypes.string,\n layout: (props: IStaticImageProps & IPrivateProps): Error | undefined => {\n if (props.layout === undefined) {\n return undefined\n }\n if (validLayouts.has(props.layout)) {\n return undefined\n }\n\n return new Error(\n `Invalid value ${props.layout}\" provided for prop \"layout\". Defaulting to \"constrained\". Valid values are \"fixed\", \"fullWidth\" or \"constrained\".`\n )\n },\n}\n\nStaticImage.displayName = `StaticImage`\nStaticImage.propTypes = propTypes\n\nexport { StaticImage }\n","import {\n GatsbyImage as GatsbyImageBrowser,\n IGatsbyImageData,\n} from \"./gatsby-image.browser\"\nimport React from \"react\"\nimport {\n _getStaticImage,\n propTypes,\n IStaticImageProps,\n} from \"./static-image.server\"\n// These values are added by Babel. Do not add them manually\ninterface IPrivateProps {\n __imageData?: IGatsbyImageData\n __error?: string\n}\n\nconst StaticImage: React.FC<IStaticImageProps & IPrivateProps> =\n _getStaticImage(GatsbyImageBrowser)\n\nStaticImage.displayName = `StaticImage`\nStaticImage.propTypes = propTypes\n\nexport { StaticImage }\n"],"names":["DEFAULT_PIXEL_DENSITIES","DEFAULT_BREAKPOINTS","DEFAULT_FIXED_WIDTH","DEFAULT_ASPECT_RATIO","warn","message","console","sortNumeric","a","b","getSizes","width","layout","images","map","image","src","join","formatFromFilename","filename","dot","lastIndexOf","ext","slice","length","setDefaultDimensions","args","height","sourceMetadata","breakpoints","aspectRatio","formats","format","toLowerCase","camelCase","_extends","Math","round","_generateImageSource","generateImageSource","fit","options","generateImageData","pluginName","reporter","backgroundColor","placeholderURL","_sourceMetadata","Set","size","has","delete","add","imageSizes","imgDimensions","Object","entries","filter","_","erroneousUserDimensions","dim","outputPixelDensities","dedupeAndSortDensities","calculated","getDimensionsAndAspectRatio","originalWidth","fixedDimension","sizes","densities","density","presentationWidth","presentationHeight","unscaledWidth","fixedImageSizes","responsiveImageSizes","calculateImageSizes","result","sources","forEach","imageSrc","Boolean","find","img","unscaled","fallback","srcSet","getSrcSet","_result$sources","push","type","imageProps","placeholder","values","Array","from","sort","min","DEFAULT_FLUID_WIDTH","includes","dimensions","imageAspectRatio","widthOption","Number","MAX_SAFE_INTEGER","heightOption","max","hasNativeLazyLoadSupport","HTMLImageElement","prototype","gatsbyImageIsInstalled","GATSBY___IMAGE","node","_node$childImageSharp","_node$images","_node$images$fallback","isGatsbyImageData","gatsbyImageData","isGatsbyImageDataParent","gatsbyImage","isGatsbyImageParent","childImageSharp","getSrc","getImage","_getImage$images","_getImage","_getImage$images$fall","_getImage2","_getImage2$images","_getImage2$images$fal","wrapperStyle","className","position","overflow","display","verticalAlign","style","getImageData","_ref","_breakpoints","baseUrl","urlBuilder","sourceWidth","sourceHeight","props","_objectWithoutPropertiesLoose","_excluded","EVERY_BREAKPOINT","getMainProps","isLoading","isLoaded","loading","left","top","transform","transition","willChange","shouldLoad","opacity","getPlaceholderProps","objectFit","objectPosition","bottom","right","withArtDirection","defaultImage","artDirected","output","_excluded2","_output$placeholder","media","process","env","NODE_ENV","source","Sizer","React","createElement","paddingTop","maxWidth","alt","role","LayoutWrapper","children","Fragment","Image","decoding","undefined","Picture","_ref2","key","fallbackImage","_Picture$propTypes","propTypes","PropTypes","string","isRequired","bool","displayName","exact","arrayOf","oneOfType","Placeholder","propName","componentName","Error","MainImage","removeNewLines","str","replace","altValidator","rest","object","renderImageToStringPromise","renderImage","GatsbyImageHydrator","as","class","preactClass","onStartLoad","onLoad","onError","getWrapperProps","wStyle","wClass","wrapperProps","root","useRef","useMemo","JSON","stringify","sizer","getSizer","useEffect","import","then","renderImageToString","swapPlaceholderImage","ssrImage","current","querySelector","complete","wasCached","setTimeout","removeAttribute","addEventListener","removeEventListener","onLoadListener","imageCache","cacheKey","animationFrame","cleanupCallback","innerHTML","requestAnimationFrame","cancelAnimationFrame","useLayoutEffect","ref","dangerouslySetInnerHTML","__html","suppressHydrationWarning","GatsbyImage","memo","_getStaticImage","StaticImage","__imageData","imageData","__error","imgClassName","imgStyle","placeholderBackgroundColor","cleanedImages","checkDimensionProps","number","validLayouts","GatsbyImageBrowser"],"mappings":"sjBAGA,MAAMA,EAA0B,CAAC,IAAM,GAAK,EAAG,GACfC,EAAG,CAAC,IAAK,KAAM,KAAM,QACrB,CAC9B,IAAK,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,QAErC,IACtBC,EAAsB,IACFC,EAAG,EAAI,EAmG3BC,EAAQC,GAA0BC,QAAQF,KAAKC,GAE/CE,EAAc,CAACC,EAAWC,IAAsBD,EAAIC,EAErCC,EAAG,CAACC,EAAeC,KACtC,OAAQA,GAGN,IAAkB,cAChB,MAAsB,eAAAD,QAAYA,aAGpC,IAAY,QACV,MAAO,GAAGA,MAGZ,IAAgB,YACd,cAEF,QACE,OAAgB,IAIIE,GACxBA,EAAOC,IAAIC,GAAS,GAAGA,EAAMC,OAAOD,EAAMJ,UAAUM,KAAK,gBAEzBC,EAACC,GACjC,MAASC,EAAGD,EAASE,YAAY,KACjC,IAAa,IAATD,EAAY,CACd,MAASE,EAAGH,EAASI,MAAMH,EAAM,GACjC,GAAY,SAARE,EACF,YAEF,GAAmB,IAAfA,EAAIE,QAA+B,IAAfF,EAAIE,OAC1B,QAEH,CAEH,CAEgBC,SAAAA,EACdC,GAEA,IAAId,OACFA,EAAsB,cAAAD,MACtBA,EAAKgB,OACLA,EAAMC,eACNA,EAAcC,YACdA,EAAWC,YACXA,EAAWC,QACXA,EAAU,CAAC,OAAQ,SACjBL,EAIJ,OAHAK,EAAUA,EAAQjB,IAAIkB,GAAUA,EAAOC,eACvCrB,EAASsB,EAAUtB,GAEfD,GAASgB,EACXQ,EAAA,GAAYT,EAAMK,CAAAA,UAASnB,SAAQkB,YAAanB,EAAQgB,KAEtDC,EAAejB,OAASiB,EAAeD,SAAWG,IACpDA,EAAcF,EAAejB,MAAQiB,EAAeD,QAGvC,cAAXf,GACFD,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,IAAIhO,IAAI,CAAQ,QAAa,YAAe,gBAEpDgJ,GAAY,CACvBhL,IAAKiL,EAAUC,OAAOC,WACtBhB,IAAK8B,GACLtM,MAAOmQ,GACPnP,OAAQmP,GACR3M,MAAO8H,EAAUC,OACjBtL,OAASmI,IACP,QAAqB2C,IAAjB3C,EAAMnI,SAGNoQ,GAAa9N,IAAI6F,EAAMnI,QAI3B,OAAWgM,IAAAA,MACT,iBAAiB7D,EAAMnI,2HAA0H,GAKvJ0P,GAAYjE,YAAc,cAC1BiE,GAAYtE,UAAYA,GC7FlBsE,SACJD,GAAgBY,IAElBX,GAAYjE,YAAc,cAC1BiE,GAAYtE,UAAYA"}
|
|
1
|
+
{"version":3,"file":"index.browser-25d2e62c.js","sources":["../src/image-utils.ts","../src/components/hooks.ts","../src/components/layout-wrapper.tsx","../src/components/picture.tsx","../src/components/placeholder.tsx","../src/components/main-image.tsx","../src/components/gatsby-image.server.tsx","../src/components/gatsby-image.browser.tsx","../src/components/static-image.server.tsx","../src/components/static-image.tsx"],"sourcesContent":["import camelCase from \"camelcase\"\nimport type { IGatsbyImageData } from \"./index\"\n\nconst DEFAULT_PIXEL_DENSITIES = [0.25, 0.5, 1, 2]\nexport const DEFAULT_BREAKPOINTS = [750, 1080, 1366, 1920]\nexport const EVERY_BREAKPOINT = [\n 320, 654, 768, 1024, 1366, 1600, 1920, 2048, 2560, 3440, 3840, 4096,\n]\nconst DEFAULT_FLUID_WIDTH = 800\nconst DEFAULT_FIXED_WIDTH = 800\nconst DEFAULT_ASPECT_RATIO = 4 / 3\n\nexport type Fit = \"cover\" | \"fill\" | \"inside\" | \"outside\" | \"contain\"\n\nexport type Layout = \"fixed\" | \"fullWidth\" | \"constrained\"\nexport type ImageFormat = \"jpg\" | \"png\" | \"webp\" | \"avif\" | \"auto\" | \"\"\n\n/**\n * The minimal required reporter, as we don't want to import it from gatsby-cli\n */\nexport interface IReporter {\n warn(message: string): void\n}\n\nexport interface ISharpGatsbyImageArgs {\n layout?: Layout\n formats?: Array<ImageFormat>\n placeholder?: \"tracedSVG\" | \"dominantColor\" | \"blurred\" | \"none\"\n tracedSVGOptions?: Record<string, unknown>\n width?: number\n height?: number\n aspectRatio?: number\n sizes?: string\n quality?: number\n transformOptions?: {\n fit?: Fit\n cropFocus?: number | string\n duotone?: {\n highlight: string\n shadow: string\n opacity?: number\n }\n grayscale?: boolean\n rotate?: number\n trim?: number\n }\n jpgOptions?: Record<string, unknown>\n pngOptions?: Record<string, unknown>\n webpOptions?: Record<string, unknown>\n avifOptions?: Record<string, unknown>\n blurredOptions?: { width?: number; toFormat?: ImageFormat }\n breakpoints?: Array<number>\n outputPixelDensities?: Array<number>\n backgroundColor?: string\n}\n\nexport interface IImageSizeArgs {\n width?: number\n height?: number\n layout?: Layout\n filename: string\n outputPixelDensities?: Array<number>\n breakpoints?: Array<number>\n fit?: Fit\n reporter?: IReporter\n sourceMetadata: { width: number; height: number }\n}\n\nexport interface IImageSizes {\n sizes: Array<number>\n presentationWidth: number\n presentationHeight: number\n aspectRatio: number\n unscaledWidth: number\n}\n\nexport interface IImage {\n src: string\n width: number\n height: number\n format: ImageFormat\n}\n\nexport interface IGatsbyImageHelperArgs {\n pluginName: string\n generateImageSource: (\n filename: string,\n width: number,\n height: number,\n format: ImageFormat,\n fit?: Fit,\n options?: Record<string, unknown>\n ) => IImage\n layout?: Layout\n formats?: Array<ImageFormat>\n filename: string\n placeholderURL?: string\n width?: number\n height?: number\n sizes?: string\n reporter?: IReporter\n sourceMetadata?: { width: number; height: number; format: ImageFormat }\n fit?: Fit\n options?: Record<string, unknown>\n breakpoints?: Array<number>\n backgroundColor?: string\n aspectRatio?: number\n}\n\nconst warn = (message: string): void => console.warn(message)\n\nconst sortNumeric = (a: number, b: number): number => a - b\n\nexport const getSizes = (width: number, layout: Layout): string | undefined => {\n switch (layout) {\n // If screen is wider than the max size, image width is the max size,\n // otherwise it's the width of the screen\n case `constrained`:\n return `(min-width: ${width}px) ${width}px, 100vw`\n\n // Image is always the same width, whatever the size of the screen\n case `fixed`:\n return `${width}px`\n\n // Image is always the width of the screen\n case `fullWidth`:\n return `100vw`\n\n default:\n return undefined\n }\n}\n\nexport const getSrcSet = (images: Array<IImage>): string =>\n images.map(image => `${image.src} ${image.width}w`).join(`,\\n`)\n\nexport function formatFromFilename(filename: string): ImageFormat | undefined {\n const dot = filename.lastIndexOf(`.`)\n if (dot !== -1) {\n const ext = filename.slice(dot + 1)\n if (ext === `jpeg`) {\n return `jpg`\n }\n if (ext.length === 3 || ext.length === 4) {\n return ext as ImageFormat\n }\n }\n return undefined\n}\n\nexport function setDefaultDimensions(\n args: IGatsbyImageHelperArgs\n): IGatsbyImageHelperArgs {\n let {\n layout = `constrained`,\n width,\n height,\n sourceMetadata,\n breakpoints,\n aspectRatio,\n formats = [`auto`, `webp`],\n } = args\n formats = formats.map(format => format.toLowerCase() as ImageFormat)\n layout = camelCase(layout) as Layout\n\n if (width && height) {\n return { ...args, formats, layout, aspectRatio: width / height }\n }\n if (sourceMetadata.width && sourceMetadata.height && !aspectRatio) {\n aspectRatio = sourceMetadata.width / sourceMetadata.height\n }\n\n if (layout === `fullWidth`) {\n width = width || sourceMetadata.width || breakpoints[breakpoints.length - 1]\n height = height || Math.round(width / (aspectRatio || DEFAULT_ASPECT_RATIO))\n } else {\n if (!width) {\n if (height && aspectRatio) {\n width = height * aspectRatio\n } else if (sourceMetadata.width) {\n width = sourceMetadata.width\n } else if (height) {\n width = Math.round(height / DEFAULT_ASPECT_RATIO)\n } else {\n width = DEFAULT_FIXED_WIDTH\n }\n }\n\n if (aspectRatio && !height) {\n height = Math.round(width / aspectRatio)\n } else if (!aspectRatio) {\n aspectRatio = width / height\n }\n }\n return { ...args, width, height, aspectRatio, layout, formats }\n}\n\n/**\n * Use this for getting an image for the blurred placeholder. This ensures the\n * aspect ratio and crop match the main image\n */\nexport function getLowResolutionImageURL(\n args: IGatsbyImageHelperArgs,\n width = 20\n): string {\n args = setDefaultDimensions(args)\n const { generateImageSource, filename, aspectRatio } = args\n return generateImageSource(\n filename,\n width,\n Math.round(width / aspectRatio),\n args.sourceMetadata.format || `jpg`,\n args.fit,\n args.options\n )?.src\n}\n\nexport function generateImageData(\n args: IGatsbyImageHelperArgs\n): IGatsbyImageData {\n args = setDefaultDimensions(args)\n\n let {\n pluginName,\n sourceMetadata,\n generateImageSource,\n layout,\n fit,\n options,\n width,\n height,\n filename,\n reporter = { warn },\n backgroundColor,\n placeholderURL,\n } = args\n\n if (!pluginName) {\n reporter.warn(\n `[gatsby-plugin-image] \"generateImageData\" was not passed a plugin name`\n )\n }\n\n if (typeof generateImageSource !== `function`) {\n throw new Error(`generateImageSource must be a function`)\n }\n\n if (!sourceMetadata || (!sourceMetadata.width && !sourceMetadata.height)) {\n // No metadata means we let the CDN handle max size etc, aspect ratio etc\n sourceMetadata = {\n width,\n height,\n format: sourceMetadata?.format || formatFromFilename(filename) || `auto`,\n }\n } else if (!sourceMetadata.format) {\n sourceMetadata.format = formatFromFilename(filename)\n }\n\n const formats = new Set<ImageFormat>(args.formats)\n\n if (formats.size === 0 || formats.has(`auto`) || formats.has(``)) {\n formats.delete(`auto`)\n formats.delete(``)\n formats.add(sourceMetadata.format)\n }\n\n if (formats.has(`jpg`) && formats.has(`png`)) {\n reporter.warn(\n `[${pluginName}] Specifying both 'jpg' and 'png' formats is not supported. Using 'auto' instead`\n )\n if (sourceMetadata.format === `jpg`) {\n formats.delete(`png`)\n } else {\n formats.delete(`jpg`)\n }\n }\n\n const imageSizes = calculateImageSizes({ ...args, sourceMetadata })\n\n const result: IGatsbyImageData[\"images\"] = {\n sources: [],\n }\n\n let sizes = args.sizes\n if (!sizes) {\n sizes = getSizes(imageSizes.presentationWidth, layout)\n }\n\n formats.forEach(format => {\n const images = imageSizes.sizes\n .map(size => {\n const imageSrc = generateImageSource(\n filename,\n size,\n Math.round(size / imageSizes.aspectRatio),\n format,\n fit,\n options\n )\n if (\n !imageSrc?.width ||\n !imageSrc.height ||\n !imageSrc.src ||\n !imageSrc.format\n ) {\n reporter.warn(\n `[${pluginName}] The resolver for image ${filename} returned an invalid value.`\n )\n return undefined\n }\n return imageSrc\n })\n .filter(Boolean)\n\n if (format === `jpg` || format === `png` || format === `auto`) {\n const unscaled =\n images.find(img => img.width === imageSizes.unscaledWidth) || images[0]\n\n if (unscaled) {\n result.fallback = {\n src: unscaled.src,\n srcSet: getSrcSet(images),\n sizes,\n }\n }\n } else {\n result.sources?.push({\n srcSet: getSrcSet(images),\n sizes,\n type: `image/${format}`,\n })\n }\n })\n\n const imageProps: Partial<IGatsbyImageData> = {\n images: result,\n layout,\n backgroundColor,\n }\n\n if (placeholderURL) {\n imageProps.placeholder = { fallback: placeholderURL }\n }\n\n switch (layout) {\n case `fixed`:\n imageProps.width = imageSizes.presentationWidth\n imageProps.height = imageSizes.presentationHeight\n break\n\n case `fullWidth`:\n imageProps.width = 1\n imageProps.height = 1 / imageSizes.aspectRatio\n break\n\n case `constrained`:\n imageProps.width = args.width || imageSizes.presentationWidth || 1\n imageProps.height = (imageProps.width || 1) / imageSizes.aspectRatio\n }\n\n return imageProps as IGatsbyImageData\n}\n\nconst dedupeAndSortDensities = (values: Array<number>): Array<number> =>\n Array.from(new Set([1, ...values])).sort(sortNumeric)\n\nexport function calculateImageSizes(args: IImageSizeArgs): IImageSizes {\n const {\n width,\n height,\n filename,\n layout = `constrained`,\n sourceMetadata: imgDimensions,\n reporter = { warn },\n breakpoints = DEFAULT_BREAKPOINTS,\n } = args\n\n // check that all dimensions provided are positive\n const userDimensions = { width, height }\n const erroneousUserDimensions = Object.entries(userDimensions).filter(\n ([_, size]) => typeof size === `number` && size < 1\n )\n if (erroneousUserDimensions.length) {\n throw new Error(\n `Specified dimensions for images must be positive numbers (> 0). Problem dimensions you have are ${erroneousUserDimensions\n .map(dim => dim.join(`: `))\n .join(`, `)}`\n )\n }\n\n if (layout === `fixed`) {\n return fixedImageSizes(args)\n } else if (layout === `constrained`) {\n return responsiveImageSizes(args)\n } else if (layout === `fullWidth`) {\n return responsiveImageSizes({ breakpoints, ...args })\n } else {\n reporter.warn(\n `No valid layout was provided for the image at ${filename}. Valid image layouts are fixed, fullWidth, and constrained. Found ${layout}`\n )\n return {\n sizes: [imgDimensions.width],\n presentationWidth: imgDimensions.width,\n presentationHeight: imgDimensions.height,\n aspectRatio: imgDimensions.width / imgDimensions.height,\n unscaledWidth: imgDimensions.width,\n }\n }\n}\nexport function fixedImageSizes({\n filename,\n sourceMetadata: imgDimensions,\n width,\n height,\n fit = `cover`,\n outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n reporter = { warn },\n}: IImageSizeArgs): IImageSizes {\n let aspectRatio = imgDimensions.width / imgDimensions.height\n // Sort, dedupe and ensure there's a 1\n const densities = dedupeAndSortDensities(outputPixelDensities)\n\n // If both are provided then we need to check the fit\n if (width && height) {\n const calculated = getDimensionsAndAspectRatio(imgDimensions, {\n width,\n height,\n fit,\n })\n width = calculated.width\n height = calculated.height\n aspectRatio = calculated.aspectRatio\n }\n\n if (!width) {\n if (!height) {\n width = DEFAULT_FIXED_WIDTH\n } else {\n width = Math.round(height * aspectRatio)\n }\n } else if (!height) {\n height = Math.round(width / aspectRatio)\n }\n\n const originalWidth = width // will use this for presentationWidth, don't want to lose it\n const isTopSizeOverriden =\n imgDimensions.width < width || imgDimensions.height < (height as number)\n\n // If the image is smaller than requested, warn the user that it's being processed as such\n // print out this message with the necessary information before we overwrite it for sizing\n if (isTopSizeOverriden) {\n const fixedDimension = imgDimensions.width < width ? `width` : `height`\n reporter.warn(`\nThe requested ${fixedDimension} \"${\n fixedDimension === `width` ? width : height\n }px\" for the image ${filename} was larger than the actual image ${fixedDimension} of ${\n imgDimensions[fixedDimension]\n }px. If possible, replace the current image with a larger one.`)\n\n if (fixedDimension === `width`) {\n width = imgDimensions.width\n height = Math.round(width / aspectRatio)\n } else {\n height = imgDimensions.height\n width = height * aspectRatio\n }\n }\n\n const sizes = densities\n .filter(size => size >= 1) // remove smaller densities because fixed images don't need them\n .map(density => Math.round(density * (width as number)))\n .filter(size => size <= imgDimensions.width)\n\n return {\n sizes,\n aspectRatio,\n presentationWidth: originalWidth,\n presentationHeight: Math.round(originalWidth / aspectRatio),\n unscaledWidth: width,\n }\n}\n\nexport function responsiveImageSizes({\n sourceMetadata: imgDimensions,\n width,\n height,\n fit = `cover`,\n outputPixelDensities = DEFAULT_PIXEL_DENSITIES,\n breakpoints,\n layout,\n}: IImageSizeArgs): IImageSizes {\n let sizes\n let aspectRatio = imgDimensions.width / imgDimensions.height\n // Sort, dedupe and ensure there's a 1\n const densities = dedupeAndSortDensities(outputPixelDensities)\n\n // If both are provided then we need to check the fit\n if (width && height) {\n const calculated = getDimensionsAndAspectRatio(imgDimensions, {\n width,\n height,\n fit,\n })\n width = calculated.width\n height = calculated.height\n aspectRatio = calculated.aspectRatio\n }\n\n // Case 1: width of height were passed in, make sure it isn't larger than the actual image\n width = width && Math.min(width, imgDimensions.width)\n height = height && Math.min(height, imgDimensions.height)\n\n // Case 2: neither width or height were passed in, use default size\n if (!width && !height) {\n width = Math.min(DEFAULT_FLUID_WIDTH, imgDimensions.width)\n height = width / aspectRatio\n }\n\n // if it still hasn't been found, calculate width from the derived height.\n // TS isn't smart enough to realise the type for height has been narrowed here\n if (!width) {\n width = (height as number) * aspectRatio\n }\n\n const originalWidth = width\n const isTopSizeOverriden =\n imgDimensions.width < width || imgDimensions.height < (height as number)\n if (isTopSizeOverriden) {\n width = imgDimensions.width\n height = imgDimensions.height\n }\n\n width = Math.round(width)\n\n if (breakpoints?.length > 0) {\n sizes = breakpoints.filter(size => size <= imgDimensions.width)\n\n // If a larger breakpoint has been filtered-out, add the actual image width instead\n if (\n sizes.length < breakpoints.length &&\n !sizes.includes(imgDimensions.width)\n ) {\n sizes.push(imgDimensions.width)\n }\n } else {\n sizes = densities.map(density => Math.round(density * (width as number)))\n sizes = sizes.filter(size => size <= imgDimensions.width)\n }\n\n // ensure that the size passed in is included in the final output\n if (layout === `constrained` && !sizes.includes(width)) {\n sizes.push(width)\n }\n sizes = sizes.sort(sortNumeric)\n return {\n sizes,\n aspectRatio,\n presentationWidth: originalWidth,\n presentationHeight: Math.round(originalWidth / aspectRatio),\n unscaledWidth: width,\n }\n}\n\nexport function getDimensionsAndAspectRatio(\n dimensions,\n options\n): { width: number; height: number; aspectRatio: number } {\n // Calculate the eventual width/height of the image.\n const imageAspectRatio = dimensions.width / dimensions.height\n\n let width = options.width\n let height = options.height\n\n switch (options.fit) {\n case `fill`: {\n width = options.width ? options.width : dimensions.width\n height = options.height ? options.height : dimensions.height\n break\n }\n case `inside`: {\n const widthOption = options.width\n ? options.width\n : Number.MAX_SAFE_INTEGER\n const heightOption = options.height\n ? options.height\n : Number.MAX_SAFE_INTEGER\n\n width = Math.min(widthOption, Math.round(heightOption * imageAspectRatio))\n height = Math.min(\n heightOption,\n Math.round(widthOption / imageAspectRatio)\n )\n break\n }\n case `outside`: {\n const widthOption = options.width ? options.width : 0\n const heightOption = options.height ? options.height : 0\n\n width = Math.max(widthOption, Math.round(heightOption * imageAspectRatio))\n height = Math.max(\n heightOption,\n Math.round(widthOption / imageAspectRatio)\n )\n break\n }\n\n default: {\n if (options.width && !options.height) {\n width = options.width\n height = Math.round(options.width / imageAspectRatio)\n }\n\n if (options.height && !options.width) {\n width = Math.round(options.height * imageAspectRatio)\n height = options.height\n }\n }\n }\n\n return {\n width,\n height,\n aspectRatio: width / height,\n }\n}\n","/* global GATSBY___IMAGE */\nimport { generateImageData, EVERY_BREAKPOINT } from \"../image-utils\"\nimport type { CSSProperties, HTMLAttributes, ImgHTMLAttributes } from \"react\"\nimport type { Node } from \"gatsby\"\nimport type { PlaceholderProps } from \"./placeholder\"\nimport type { MainImageProps } from \"./main-image\"\nimport type { IGatsbyImageData } from \"./gatsby-image.browser\"\nimport type {\n IGatsbyImageHelperArgs,\n Layout,\n IImage,\n ImageFormat,\n} from \"../image-utils\"\n\n// Native lazy-loading support: https://addyosmani.com/blog/lazy-loading/\nexport const hasNativeLazyLoadSupport = (): boolean =>\n typeof HTMLImageElement !== `undefined` &&\n `loading` in HTMLImageElement.prototype\n\nexport function gatsbyImageIsInstalled(): boolean {\n return typeof GATSBY___IMAGE !== `undefined` && GATSBY___IMAGE\n}\n\nexport type IGatsbyImageDataParent<T = never> = T & {\n gatsbyImageData: IGatsbyImageData\n}\nexport type IGatsbyImageParent<T = never> = T & {\n gatsbyImage: IGatsbyImageData\n}\nexport type FileNode = Partial<Node> & {\n childImageSharp?: IGatsbyImageDataParent<Partial<Node>>\n}\n\nconst isGatsbyImageData = (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageData | any\n): node is IGatsbyImageData =>\n // 🦆 check for a deep prop to be sure this is a valid gatsbyImageData object\n Boolean(node?.images?.fallback?.src)\n\nconst isGatsbyImageDataParent = <T>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageDataParent<T> | any\n): node is IGatsbyImageDataParent<T> => Boolean(node?.gatsbyImageData)\n\nconst isGatsbyImageParent = <T>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node: IGatsbyImageParent<T> | any\n): node is IGatsbyImageParent<T> => Boolean(node?.gatsbyImage)\n\nexport type ImageDataLike =\n | FileNode\n | IGatsbyImageDataParent\n | IGatsbyImageParent\n | IGatsbyImageData\n\nexport const getImage = (\n node: ImageDataLike | null\n): IGatsbyImageData | undefined => {\n // This checks both for gatsbyImageData and gatsbyImage\n if (isGatsbyImageData(node)) {\n return node\n }\n // gatsbyImageData GraphQL field\n if (isGatsbyImageDataParent(node)) {\n return node.gatsbyImageData\n }\n // gatsbyImage GraphQL field for Gatsby's Image CDN service\n if (isGatsbyImageParent(node)) {\n return node.gatsbyImage\n }\n return node?.childImageSharp?.gatsbyImageData\n}\n\nexport const getSrc = (node: ImageDataLike): string | undefined =>\n getImage(node)?.images?.fallback?.src\n\nexport const getSrcSet = (node: ImageDataLike): string | undefined =>\n getImage(node)?.images?.fallback?.srcSet\n\nexport function getWrapperProps(\n width: number,\n height: number,\n layout: Layout\n): Pick<HTMLAttributes<HTMLElement>, \"className\" | \"style\"> & {\n \"data-gatsby-image-wrapper\": string\n} {\n const wrapperStyle: CSSProperties = {}\n\n let className = `gatsby-image-wrapper`\n\n // If the plugin isn't installed we need to apply the styles inline\n if (!gatsbyImageIsInstalled()) {\n wrapperStyle.position = `relative`\n wrapperStyle.overflow = `hidden`\n }\n\n if (layout === `fixed`) {\n wrapperStyle.width = width\n wrapperStyle.height = height\n } else if (layout === `constrained`) {\n if (!gatsbyImageIsInstalled()) {\n wrapperStyle.display = `inline-block`\n wrapperStyle.verticalAlign = `top`\n }\n className = `gatsby-image-wrapper gatsby-image-wrapper-constrained`\n }\n\n return {\n className,\n \"data-gatsby-image-wrapper\": ``,\n style: wrapperStyle,\n }\n}\n\nexport interface IUrlBuilderArgs<OptionsType> {\n width: number\n height: number\n baseUrl: string\n format: ImageFormat\n options: OptionsType\n}\nexport interface IGetImageDataArgs<OptionsType = Record<string, unknown>> {\n baseUrl: string\n /**\n * For constrained and fixed images, the size of the image element\n */\n width?: number\n height?: number\n /**\n * If available, pass the source image width and height\n */\n sourceWidth?: number\n sourceHeight?: number\n /**\n * If only one dimension is passed, then this will be used to calculate the other.\n */\n aspectRatio?: number\n layout?: Layout\n /**\n * Returns a URL based on the passed arguments. Should be a pure function\n */\n urlBuilder: (args: IUrlBuilderArgs<OptionsType>) => string\n\n /**\n * Should be a data URI\n */\n placeholderURL?: string\n backgroundColor?: string\n /**\n * Used in error messages etc\n */\n pluginName?: string\n\n /**\n * If you do not support auto-format, pass an array of image types here\n */\n formats?: Array<ImageFormat>\n\n breakpoints?: Array<number>\n\n /**\n * Passed to the urlBuilder function\n */\n options?: OptionsType\n}\n\n/**\n * Use this hook to generate gatsby-plugin-image data in the browser.\n */\nexport function getImageData<OptionsType>({\n baseUrl,\n urlBuilder,\n sourceWidth,\n sourceHeight,\n pluginName = `getImageData`,\n formats = [`auto`],\n breakpoints,\n options,\n ...props\n}: IGetImageDataArgs<OptionsType>): IGatsbyImageData {\n if (\n !breakpoints?.length &&\n (props.layout === `fullWidth` || (props.layout as string) === `FULL_WIDTH`)\n ) {\n breakpoints = EVERY_BREAKPOINT\n }\n const generateImageSource = (\n baseUrl: string,\n width: number,\n height?: number,\n format?: ImageFormat\n ): IImage => {\n return {\n width,\n height,\n format,\n src: urlBuilder({ baseUrl, width, height, options, format }),\n }\n }\n\n const sourceMetadata: IGatsbyImageHelperArgs[\"sourceMetadata\"] = {\n width: sourceWidth,\n height: sourceHeight,\n format: `auto`,\n }\n\n const args: IGatsbyImageHelperArgs = {\n ...props,\n pluginName,\n generateImageSource,\n filename: baseUrl,\n formats,\n breakpoints,\n sourceMetadata,\n }\n return generateImageData(args)\n}\n\nexport function getMainProps(\n isLoading: boolean,\n isLoaded: boolean,\n images: IGatsbyImageData[\"images\"],\n loading?: \"eager\" | \"lazy\",\n style: CSSProperties = {}\n): Partial<MainImageProps> {\n // fallback when it's not configured in gatsby-config.\n if (!gatsbyImageIsInstalled()) {\n style = {\n height: `100%`,\n left: 0,\n position: `absolute`,\n top: 0,\n transform: `translateZ(0)`,\n transition: `opacity 250ms linear`,\n width: `100%`,\n willChange: `opacity`,\n ...style,\n }\n }\n\n const result = {\n ...images,\n loading,\n shouldLoad: isLoading,\n \"data-main-image\": ``,\n style: {\n ...style,\n opacity: isLoaded ? 1 : 0,\n },\n }\n\n return result\n}\n\nexport type PlaceholderImageAttrs = ImgHTMLAttributes<HTMLImageElement> &\n Pick<PlaceholderProps, \"sources\" | \"fallback\"> & {\n \"data-placeholder-image\"?: string\n }\n\nexport function getPlaceholderProps(\n placeholder: PlaceholderImageAttrs | undefined,\n isLoaded: boolean,\n layout: Layout,\n width?: number,\n height?: number,\n backgroundColor?: string,\n objectFit?: CSSProperties[\"objectFit\"],\n objectPosition?: CSSProperties[\"objectPosition\"]\n): PlaceholderImageAttrs {\n const wrapperStyle: CSSProperties = {}\n\n if (backgroundColor) {\n wrapperStyle.backgroundColor = backgroundColor\n\n if (layout === `fixed`) {\n wrapperStyle.width = width\n wrapperStyle.height = height\n wrapperStyle.backgroundColor = backgroundColor\n wrapperStyle.position = `relative`\n } else if (layout === `constrained`) {\n wrapperStyle.position = `absolute`\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n } else if (layout === `fullWidth`) {\n wrapperStyle.position = `absolute`\n wrapperStyle.top = 0\n wrapperStyle.left = 0\n wrapperStyle.bottom = 0\n wrapperStyle.right = 0\n }\n }\n\n if (objectFit) {\n wrapperStyle.objectFit = objectFit\n }\n\n if (objectPosition) {\n wrapperStyle.objectPosition = objectPosition\n }\n const result: PlaceholderImageAttrs = {\n ...placeholder,\n \"aria-hidden\": true,\n \"data-placeholder-image\": ``,\n style: {\n opacity: isLoaded ? 0 : 1,\n transition: `opacity 500ms linear`,\n ...wrapperStyle,\n },\n }\n\n // fallback when it's not configured in gatsby-config.\n if (!gatsbyImageIsInstalled()) {\n result.style = {\n height: `100%`,\n left: 0,\n position: `absolute`,\n top: 0,\n width: `100%`,\n }\n }\n\n return result\n}\n\nexport interface IArtDirectedImage {\n media: string\n image: IGatsbyImageData\n}\n\n/**\n * Generate a Gatsby image data object with multiple, art-directed images that display at different\n * resolutions.\n *\n * @param defaultImage The image displayed when no media query matches.\n * It is also used for all other settings applied to the image, such as width, height and layout.\n * You should pass a className to the component with media queries to adjust the size of the container,\n * as this cannot be adjusted automatically.\n * @param artDirected Array of objects which each contains a `media` string which is a media query\n * such as `(min-width: 320px)`, and the image object to use when that query matches.\n */\nexport function withArtDirection(\n defaultImage: IGatsbyImageData,\n artDirected: Array<IArtDirectedImage>\n): IGatsbyImageData {\n const { images, placeholder, ...props } = defaultImage\n const output: IGatsbyImageData = {\n ...props,\n images: {\n ...images,\n sources: [],\n },\n placeholder: placeholder && {\n ...placeholder,\n sources: [],\n },\n }\n\n artDirected.forEach(({ media, image }) => {\n if (!media) {\n if (process.env.NODE_ENV === `development`) {\n console.warn(\n \"[gatsby-plugin-image] All art-directed images passed to must have a value set for `media`. Skipping.\"\n )\n }\n return\n }\n\n if (\n image.layout !== defaultImage.layout &&\n process.env.NODE_ENV === `development`\n ) {\n console.warn(\n `[gatsby-plugin-image] Mismatched image layout: expected \"${defaultImage.layout}\" but received \"${image.layout}\". All art-directed images use the same layout as the default image`\n )\n }\n\n output.images.sources.push(\n ...image.images.sources.map(source => {\n return { ...source, media }\n }),\n {\n media,\n srcSet: image.images.fallback.srcSet,\n }\n )\n\n if (!output.placeholder) {\n return\n }\n\n output.placeholder.sources.push({\n media,\n srcSet: image.placeholder.fallback,\n })\n })\n output.images.sources.push(...images.sources)\n if (placeholder?.sources) {\n output.placeholder?.sources.push(...placeholder.sources)\n }\n return output\n}\n","import React, { Fragment, FunctionComponent, PropsWithChildren } from \"react\"\nimport terserMacro from \"../../macros/terser.macro\"\nimport { Layout } from \"../image-utils\"\n\nexport interface ILayoutWrapperProps {\n layout: Layout\n width: number\n height: number\n}\n\nconst NativeScriptLoading: FunctionComponent = () => (\n <script\n type=\"module\"\n dangerouslySetInnerHTML={{\n __html: terserMacro`\nconst hasNativeLazyLoadSupport = typeof HTMLImageElement !== \"undefined\" && \"loading\" in HTMLImageElement.prototype;\nif (hasNativeLazyLoadSupport) {\n const gatsbyImages = document.querySelectorAll('img[data-main-image]');\n for (let mainImage of gatsbyImages) {\n if (mainImage.dataset.src) {\n mainImage.setAttribute('src', mainImage.dataset.src)\n mainImage.removeAttribute('data-src')\n }\n if (mainImage.dataset.srcset) {\n mainImage.setAttribute('srcset', mainImage.dataset.srcset)\n mainImage.removeAttribute('data-srcset')\n }\n\n const sources = mainImage.parentNode.querySelectorAll('source[data-srcset]');\n for (let source of sources) {\n source.setAttribute('srcset', source.dataset.srcset)\n source.removeAttribute('data-srcset')\n }\n\n if (mainImage.complete) {\n mainImage.style.opacity = 1;\n\n // also hide the placeholder\n mainImage.parentNode.parentNode.querySelector('[data-placeholder-image]').style.opacity = 0;\n }\n }\n}\n`,\n }}\n />\n)\n\nexport function getSizer(\n layout: Layout,\n width: number,\n height: number\n): string {\n let sizer = ``\n if (layout === `fullWidth`) {\n sizer = `<div aria-hidden=\"true\" style=\"padding-top: ${\n (height / width) * 100\n }%;\"></div>`\n }\n\n if (layout === `constrained`) {\n sizer = `<div style=\"max-width: ${width}px; display: block;\"><img alt=\"\" role=\"presentation\" aria-hidden=\"true\" src=\"data:image/svg+xml;charset=utf-8,%3Csvg%20height='${height}'%20width='${width}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E\" style=\"max-width: 100%; display: block; position: static;\"></div>`\n }\n\n return sizer\n}\n\nconst Sizer: FunctionComponent<ILayoutWrapperProps> = function Sizer({\n layout,\n width,\n height,\n}) {\n if (layout === `fullWidth`) {\n return (\n <div aria-hidden style={{ paddingTop: `${(height / width) * 100}%` }} />\n )\n }\n\n if (layout === `constrained`) {\n return (\n <div style={{ maxWidth: width, display: `block` }}>\n <img\n alt=\"\"\n role=\"presentation\"\n aria-hidden=\"true\"\n src={`data:image/svg+xml;charset=utf-8,%3Csvg%20height='${height}'%20width='${width}'%20xmlns='http://www.w3.org/2000/svg'%20version='1.1'%3E%3C/svg%3E`}\n style={{\n maxWidth: `100%`,\n display: `block`,\n position: `static`,\n }}\n />\n </div>\n )\n }\n\n return null\n}\n\nexport const LayoutWrapper: FunctionComponent<\n PropsWithChildren<ILayoutWrapperProps>\n> = function LayoutWrapper({ children, ...props }) {\n return (\n <Fragment>\n <Sizer {...props} />\n {children}\n\n {SERVER ? <NativeScriptLoading /> : null}\n </Fragment>\n )\n}\n","import React, { FunctionComponent, ImgHTMLAttributes } from \"react\"\nimport * as PropTypes from \"prop-types\"\n\nexport interface IResponsiveImageProps {\n sizes?: string\n srcSet: string\n}\n\nexport type SourceProps = IResponsiveImageProps &\n (\n | {\n media: string\n type?: string\n }\n | {\n media?: string\n type: string\n }\n )\n\ntype FallbackProps = { src: string } & Partial<IResponsiveImageProps>\n\ntype ImageProps = ImgHTMLAttributes<HTMLImageElement> & {\n src: string\n alt: string\n shouldLoad: boolean\n}\n\nexport type PictureProps = ImgHTMLAttributes<HTMLImageElement> & {\n fallback?: FallbackProps\n sources?: Array<SourceProps>\n alt: string\n shouldLoad?: boolean\n}\n\nconst Image: FunctionComponent<ImageProps> = function Image({\n src,\n srcSet,\n loading,\n alt = ``,\n shouldLoad,\n ...props\n}) {\n return (\n <img\n {...props}\n decoding=\"async\"\n loading={loading}\n src={shouldLoad ? src : undefined}\n data-src={!shouldLoad ? src : undefined}\n srcSet={shouldLoad ? srcSet : undefined}\n data-srcset={!shouldLoad ? srcSet : undefined}\n alt={alt}\n />\n )\n}\n\nexport const Picture: React.FC<PictureProps> = function Picture({\n fallback,\n sources = [],\n shouldLoad = true,\n ...props\n}) {\n const sizes = props.sizes || fallback?.sizes\n const fallbackImage = (\n <Image {...props} {...fallback} sizes={sizes} shouldLoad={shouldLoad} />\n )\n\n if (!sources.length) {\n return fallbackImage\n }\n\n return (\n <picture>\n {sources.map(({ media, srcSet, type }) => (\n <source\n key={`${media}-${type}-${srcSet}`}\n type={type}\n media={media}\n srcSet={shouldLoad ? srcSet : undefined}\n data-srcset={!shouldLoad ? srcSet : undefined}\n sizes={sizes}\n />\n ))}\n {fallbackImage}\n </picture>\n )\n}\n\nImage.propTypes = {\n src: PropTypes.string.isRequired,\n alt: PropTypes.string.isRequired,\n sizes: PropTypes.string,\n srcSet: PropTypes.string,\n shouldLoad: PropTypes.bool,\n}\n\nPicture.displayName = `Picture`\nPicture.propTypes = {\n alt: PropTypes.string.isRequired,\n shouldLoad: PropTypes.bool,\n fallback: PropTypes.exact({\n src: PropTypes.string.isRequired,\n srcSet: PropTypes.string,\n sizes: PropTypes.string,\n }),\n sources: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.exact({\n media: PropTypes.string.isRequired,\n type: PropTypes.string,\n sizes: PropTypes.string,\n srcSet: PropTypes.string.isRequired,\n }),\n PropTypes.exact({\n media: PropTypes.string,\n type: PropTypes.string.isRequired,\n sizes: PropTypes.string,\n srcSet: PropTypes.string.isRequired,\n }),\n ])\n ),\n}\n","import React, { FunctionComponent, ImgHTMLAttributes } from \"react\"\nimport * as PropTypes from \"prop-types\"\nimport { Picture, SourceProps } from \"./picture\"\n\nexport type PlaceholderProps = ImgHTMLAttributes<HTMLImageElement> & {\n fallback?: string\n sources?: Array<SourceProps>\n}\n\nexport const Placeholder: FunctionComponent<PlaceholderProps> =\n function Placeholder({ fallback, ...props }) {\n if (fallback) {\n return (\n <Picture\n {...props}\n fallback={{\n src: fallback,\n }}\n aria-hidden\n alt=\"\"\n />\n )\n } else {\n return <div {...props}></div>\n }\n }\n\nPlaceholder.displayName = `Placeholder`\nPlaceholder.propTypes = {\n fallback: PropTypes.string,\n sources: Picture.propTypes?.sources,\n alt: function (props, propName, componentName): Error | null {\n if (!props[propName]) {\n return null\n }\n\n return new Error(\n `Invalid prop \\`${propName}\\` supplied to \\`${componentName}\\`. Validation failed.`\n )\n },\n}\n","import React from \"react\"\nimport { Picture, PictureProps } from \"./picture\"\n\nexport type MainImageProps = PictureProps\n\nexport const MainImage: React.FC<PictureProps> = function MainImage(props) {\n return (\n <>\n <Picture {...props} />\n <noscript>\n <Picture {...props} shouldLoad={true} />\n </noscript>\n </>\n )\n}\n\nMainImage.displayName = `MainImage`\nMainImage.propTypes = Picture.propTypes\n","import React from \"react\"\nimport { getWrapperProps, getMainProps, getPlaceholderProps } from \"./hooks\"\nimport { Placeholder } from \"./placeholder\"\nimport { MainImage, MainImageProps } from \"./main-image\"\nimport { LayoutWrapper } from \"./layout-wrapper\"\nimport PropTypes from \"prop-types\"\nimport type { FunctionComponent, WeakValidationMap } from \"react\"\nimport type { GatsbyImageProps, IGatsbyImageData } from \"./gatsby-image.browser\"\n\nconst removeNewLines = (str: string): string => str.replace(/\\n/g, ``)\n\nexport const GatsbyImage: FunctionComponent<GatsbyImageProps> =\n function GatsbyImage({\n as = `div`,\n className,\n class: preactClass,\n style,\n image,\n loading = `lazy`,\n imgClassName,\n imgStyle,\n backgroundColor,\n objectFit,\n objectPosition,\n ...props\n }) {\n if (!image) {\n console.warn(`[gatsby-plugin-image] Missing image prop`)\n return null\n }\n\n if (preactClass) {\n className = preactClass\n }\n\n imgStyle = {\n objectFit,\n objectPosition,\n backgroundColor,\n ...imgStyle,\n }\n\n const {\n width,\n height,\n layout,\n images,\n placeholder,\n backgroundColor: placeholderBackgroundColor,\n } = image\n\n const {\n style: wStyle,\n className: wClass,\n ...wrapperProps\n } = getWrapperProps(width, height, layout)\n\n const cleanedImages: IGatsbyImageData[\"images\"] = {\n fallback: undefined,\n sources: [],\n }\n if (images.fallback) {\n cleanedImages.fallback = {\n ...images.fallback,\n srcSet: images.fallback.srcSet\n ? removeNewLines(images.fallback.srcSet)\n : undefined,\n }\n }\n\n if (images.sources) {\n cleanedImages.sources = images.sources.map(source => {\n return {\n ...source,\n srcSet: removeNewLines(source.srcSet),\n }\n })\n }\n\n return React.createElement(\n as,\n {\n ...wrapperProps,\n style: {\n ...wStyle,\n ...style,\n backgroundColor,\n },\n className: `${wClass}${className ? ` ${className}` : ``}`,\n },\n <LayoutWrapper layout={layout} width={width} height={height}>\n <Placeholder\n {...getPlaceholderProps(\n placeholder,\n false,\n layout,\n width,\n height,\n placeholderBackgroundColor,\n objectFit,\n objectPosition\n )}\n />\n\n <MainImage\n data-gatsby-image-ssr=\"\"\n className={imgClassName}\n {...(props as Omit<\n MainImageProps,\n \"images\" | \"fallback\" | \"onError\" | \"onLoad\"\n >)}\n // When eager is set we want to start the isLoading state on true (we want to load the img without react)\n {...getMainProps(\n loading === `eager`,\n false,\n cleanedImages,\n loading,\n imgStyle\n )}\n />\n </LayoutWrapper>\n )\n }\n\nexport const altValidator: PropTypes.Validator<string> = (\n props: GatsbyImageProps,\n propName,\n componentName,\n ...rest\n): Error | undefined => {\n if (!props.alt && props.alt !== ``) {\n return new Error(\n `The \"alt\" prop is required in ${componentName}. If the image is purely presentational then pass an empty string: e.g. alt=\"\". Learn more: https://a11y-style-guide.com/style-guide/section-media.html`\n )\n }\n\n return PropTypes.string(props, propName, componentName, ...rest)\n}\n\nexport const propTypes = {\n image: PropTypes.object.isRequired,\n alt: altValidator,\n} as WeakValidationMap<GatsbyImageProps>\n","import {\n createElement,\n memo,\n useMemo,\n useEffect,\n useLayoutEffect,\n useRef,\n} from \"react\"\nimport {\n getWrapperProps,\n gatsbyImageIsInstalled,\n hasNativeLazyLoadSupport,\n} from \"./hooks\"\nimport { getSizer } from \"./layout-wrapper\"\nimport { propTypes } from \"./gatsby-image.server\"\nimport type {\n FC,\n ElementType,\n FunctionComponent,\n ImgHTMLAttributes,\n CSSProperties,\n ReactEventHandler,\n} from \"react\"\nimport type { renderImageToString } from \"./lazy-hydrate\"\nimport type { PlaceholderProps } from \"./placeholder\"\nimport type { MainImageProps } from \"./main-image\"\nimport type { Layout } from \"../image-utils\"\n\nconst imageCache = new Set<string>()\nlet renderImageToStringPromise\nlet renderImage: typeof renderImageToString | undefined\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport interface GatsbyImageProps\n extends Omit<\n ImgHTMLAttributes<HTMLImageElement>,\n \"placeholder\" | \"onLoad\" | \"src\" | \"srcSet\" | \"width\" | \"height\"\n > {\n alt: string\n as?: ElementType\n className?: string\n class?: string\n imgClassName?: string\n image: IGatsbyImageData\n imgStyle?: CSSProperties\n backgroundColor?: string\n objectFit?: CSSProperties[\"objectFit\"]\n objectPosition?: CSSProperties[\"objectPosition\"]\n onLoad?: (props: { wasCached: boolean }) => void\n onError?: ReactEventHandler<HTMLImageElement>\n onStartLoad?: (props: { wasCached: boolean }) => void\n}\n\nexport interface IGatsbyImageData {\n layout: Layout\n width: number\n height: number\n backgroundColor?: string\n images: Pick<MainImageProps, \"sources\" | \"fallback\">\n placeholder?: Pick<PlaceholderProps, \"sources\" | \"fallback\">\n}\n\nconst GatsbyImageHydrator: FC<GatsbyImageProps> = function GatsbyImageHydrator({\n as = `div`,\n image,\n style,\n backgroundColor,\n className,\n class: preactClass,\n onStartLoad,\n onLoad,\n onError,\n ...props\n}) {\n const { width, height, layout } = image\n const {\n style: wStyle,\n className: wClass,\n ...wrapperProps\n } = getWrapperProps(width, height, layout)\n const root = useRef<HTMLElement>()\n const cacheKey = useMemo(() => JSON.stringify(image.images), [image.images])\n\n // Preact uses class instead of className so we need to check for both\n if (preactClass) {\n className = preactClass\n }\n\n const sizer = getSizer(layout, width, height)\n\n // Memoize this { __html } object to work around an undocumented behavioral change in React 19:\n // https://github.com/facebook/react/issues/31660.\n const dangerouslySetInnerHTML = useMemo(() => {\n return {\n __html: sizer,\n }\n }, [sizer])\n\n useEffect(() => {\n if (!renderImageToStringPromise) {\n renderImageToStringPromise = import(`./lazy-hydrate`).then(\n ({ renderImageToString, swapPlaceholderImage }) => {\n renderImage = renderImageToString\n\n return {\n renderImageToString,\n swapPlaceholderImage,\n }\n }\n )\n }\n\n // The plugin image component is a bit special where if it's server-side rendered, we add extra script tags to support lazy-loading without\n // In this case we stop hydration but fire the correct events.\n const ssrImage = root.current.querySelector(\n `[data-gatsby-image-ssr]`\n ) as HTMLImageElement\n if (ssrImage && hasNativeLazyLoadSupport()) {\n if (ssrImage.complete) {\n // Trigger onStartload and onLoad events\n onStartLoad?.({\n wasCached: true,\n })\n onLoad?.({\n wasCached: true,\n })\n\n // remove ssr key for state updates but add delay to not fight with native code snippt of gatsby-ssr\n setTimeout(() => {\n ssrImage.removeAttribute(`data-gatsby-image-ssr`)\n }, 0)\n } else {\n onStartLoad?.({\n wasCached: true,\n })\n\n ssrImage.addEventListener(`load`, function onLoadListener() {\n ssrImage.removeEventListener(`load`, onLoadListener)\n\n onLoad?.({\n wasCached: true,\n })\n // remove ssr key for state updates but add delay to not fight with native code snippt of gatsby-ssr\n setTimeout(() => {\n ssrImage.removeAttribute(`data-gatsby-image-ssr`)\n }, 0)\n })\n }\n\n imageCache.add(cacheKey)\n\n return\n }\n\n if (renderImage && imageCache.has(cacheKey)) {\n return\n }\n\n let animationFrame\n let cleanupCallback\n renderImageToStringPromise.then(\n ({ renderImageToString, swapPlaceholderImage }) => {\n if (!root.current) {\n return\n }\n\n root.current.innerHTML = renderImageToString({\n isLoading: true,\n isLoaded: imageCache.has(cacheKey),\n image,\n ...props,\n })\n\n if (!imageCache.has(cacheKey)) {\n animationFrame = requestAnimationFrame(() => {\n if (root.current) {\n cleanupCallback = swapPlaceholderImage(\n root.current,\n cacheKey,\n imageCache,\n style,\n onStartLoad,\n onLoad,\n onError\n )\n }\n })\n }\n }\n )\n\n // eslint-disable-next-line consistent-return\n return (): void => {\n if (animationFrame) {\n cancelAnimationFrame(animationFrame)\n }\n if (cleanupCallback) {\n cleanupCallback()\n }\n }\n }, [image])\n\n // useLayoutEffect is ran before React commits to the DOM. This allows us to make sure our HTML is using our cached image version\n useLayoutEffect(() => {\n if (imageCache.has(cacheKey) && renderImage) {\n root.current.innerHTML = renderImage({\n isLoading: imageCache.has(cacheKey),\n isLoaded: imageCache.has(cacheKey),\n image,\n ...props,\n })\n\n // Trigger onStartload and onLoad events\n onStartLoad?.({\n wasCached: true,\n })\n onLoad?.({\n wasCached: true,\n })\n }\n }, [image])\n\n // By keeping all props equal React will keep the component in the DOM\n return createElement(as, {\n ...wrapperProps,\n style: {\n ...wStyle,\n ...style,\n backgroundColor,\n },\n className: `${wClass}${className ? ` ${className}` : ``}`,\n ref: root,\n dangerouslySetInnerHTML,\n suppressHydrationWarning: true,\n })\n}\n\nexport const GatsbyImage: FunctionComponent<GatsbyImageProps> = memo(\n function GatsbyImage(props) {\n if (!props.image) {\n if (process.env.NODE_ENV === `development`) {\n console.warn(`[gatsby-plugin-image] Missing image prop`)\n }\n\n return null\n }\n\n if (!gatsbyImageIsInstalled() && process.env.NODE_ENV === `development`) {\n console.warn(\n `[gatsby-plugin-image] You're missing out on some cool performance features. Please add \"gatsby-plugin-image\" to your gatsby-config.js`\n )\n }\n\n return createElement(GatsbyImageHydrator, props)\n }\n)\n\nGatsbyImage.propTypes = propTypes\nGatsbyImage.displayName = `GatsbyImage`\n","import React, { FunctionComponent, ReactElement } from \"react\"\nimport {\n altValidator,\n GatsbyImage as GatsbyImageServer,\n} from \"./gatsby-image.server\"\nimport { GatsbyImageProps, IGatsbyImageData } from \"./gatsby-image.browser\"\nimport PropTypes from \"prop-types\"\nimport { ISharpGatsbyImageArgs } from \"../image-utils\"\n\nexport interface IStaticImageProps\n extends Omit<GatsbyImageProps, \"image\">,\n Omit<ISharpGatsbyImageArgs, \"backgroundColor\"> {\n src: string\n filename?: string\n}\n\n// These values are added by Babel. Do not add them manually\ninterface IPrivateProps {\n __imageData?: IGatsbyImageData\n __error?: string\n}\n\nexport function _getStaticImage(\n GatsbyImage: FunctionComponent<GatsbyImageProps>\n): React.FC<IStaticImageProps & IPrivateProps> {\n return function StaticImage({\n src,\n __imageData: imageData,\n __error,\n // We extract these because they're not meant to be passed-down to GatsbyImage\n /* eslint-disable @typescript-eslint/no-unused-vars */\n width,\n height,\n aspectRatio,\n tracedSVGOptions,\n placeholder,\n formats,\n quality,\n transformOptions,\n jpgOptions,\n pngOptions,\n webpOptions,\n avifOptions,\n blurredOptions,\n breakpoints,\n outputPixelDensities,\n /* eslint-enable @typescript-eslint/no-unused-vars */\n ...props\n }): ReactElement {\n if (__error) {\n console.warn(__error)\n }\n\n if (imageData) {\n return <GatsbyImage image={imageData} {...props} />\n }\n console.warn(`Image not loaded`, src)\n if (!__error && process.env.NODE_ENV === `development`) {\n console.warn(\n `Please ensure that \"gatsby-plugin-image\" is included in the plugins array in gatsby-config.js, and that your version of gatsby is at least 2.24.78`\n )\n }\n return null\n }\n}\n\nconst StaticImage: React.FC<IStaticImageProps & IPrivateProps> =\n _getStaticImage(GatsbyImageServer)\n\nconst checkDimensionProps: PropTypes.Validator<number> = (\n props: IStaticImageProps & IPrivateProps,\n propName: keyof IStaticImageProps & IPrivateProps,\n ...rest\n) => {\n if (\n props.layout === `fullWidth` &&\n (propName === `width` || propName === `height`) &&\n props[propName]\n ) {\n return new Error(\n `\"${propName}\" ${props[propName]} may not be passed when layout is fullWidth.`\n )\n }\n return PropTypes.number(props, propName, ...rest)\n}\n\nconst validLayouts = new Set([`fixed`, `fullWidth`, `constrained`])\n\nexport const propTypes = {\n src: PropTypes.string.isRequired,\n alt: altValidator,\n width: checkDimensionProps,\n height: checkDimensionProps,\n sizes: PropTypes.string,\n layout: (props: IStaticImageProps & IPrivateProps): Error | undefined => {\n if (props.layout === undefined) {\n return undefined\n }\n if (validLayouts.has(props.layout)) {\n return undefined\n }\n\n return new Error(\n `Invalid value ${props.layout}\" provided for prop \"layout\". Defaulting to \"constrained\". Valid values are \"fixed\", \"fullWidth\" or \"constrained\".`\n )\n },\n}\n\nStaticImage.displayName = `StaticImage`\nStaticImage.propTypes = propTypes\n\nexport { StaticImage }\n","import {\n GatsbyImage as GatsbyImageBrowser,\n IGatsbyImageData,\n} from \"./gatsby-image.browser\"\nimport React from \"react\"\nimport {\n _getStaticImage,\n propTypes,\n IStaticImageProps,\n} from \"./static-image.server\"\n// These values are added by Babel. Do not add them manually\ninterface IPrivateProps {\n __imageData?: IGatsbyImageData\n __error?: string\n}\n\nconst StaticImage: React.FC<IStaticImageProps & IPrivateProps> =\n _getStaticImage(GatsbyImageBrowser)\n\nStaticImage.displayName = `StaticImage`\nStaticImage.propTypes = propTypes\n\nexport { StaticImage }\n"],"names":["DEFAULT_PIXEL_DENSITIES","DEFAULT_BREAKPOINTS","DEFAULT_FIXED_WIDTH","DEFAULT_ASPECT_RATIO","warn","message","console","sortNumeric","a","b","getSizes","width","layout","images","map","image","src","join","formatFromFilename","filename","dot","lastIndexOf","ext","slice","length","setDefaultDimensions","args","height","sourceMetadata","breakpoints","aspectRatio","formats","format","toLowerCase","camelCase","_extends","Math","round","_generateImageSource","generateImageSource","fit","options","generateImageData","pluginName","reporter","backgroundColor","placeholderURL","_sourceMetadata","Set","size","has","delete","add","imageSizes","imgDimensions","Object","entries","filter","_","erroneousUserDimensions","dim","outputPixelDensities","dedupeAndSortDensities","calculated","getDimensionsAndAspectRatio","originalWidth","fixedDimension","sizes","densities","density","presentationWidth","presentationHeight","unscaledWidth","fixedImageSizes","responsiveImageSizes","calculateImageSizes","result","sources","forEach","imageSrc","Boolean","find","img","unscaled","fallback","srcSet","getSrcSet","_result$sources","push","type","imageProps","placeholder","values","Array","from","sort","min","DEFAULT_FLUID_WIDTH","includes","dimensions","imageAspectRatio","widthOption","Number","MAX_SAFE_INTEGER","heightOption","max","hasNativeLazyLoadSupport","HTMLImageElement","prototype","gatsbyImageIsInstalled","GATSBY___IMAGE","node","_node$childImageSharp","_node$images","_node$images$fallback","isGatsbyImageData","gatsbyImageData","isGatsbyImageDataParent","gatsbyImage","isGatsbyImageParent","childImageSharp","getSrc","getImage","_getImage$images","_getImage","_getImage$images$fall","_getImage2","_getImage2$images","_getImage2$images$fal","wrapperStyle","className","position","overflow","display","verticalAlign","style","getImageData","_ref","_breakpoints","baseUrl","urlBuilder","sourceWidth","sourceHeight","props","_objectWithoutPropertiesLoose","_excluded","EVERY_BREAKPOINT","getMainProps","isLoading","isLoaded","loading","left","top","transform","transition","willChange","shouldLoad","opacity","getPlaceholderProps","objectFit","objectPosition","bottom","right","withArtDirection","defaultImage","artDirected","output","_excluded2","_output$placeholder","media","process","env","NODE_ENV","source","Sizer","React","createElement","paddingTop","maxWidth","alt","role","LayoutWrapper","children","Fragment","Image","decoding","undefined","Picture","_ref2","key","fallbackImage","_Picture$propTypes","propTypes","PropTypes","string","isRequired","bool","displayName","exact","arrayOf","oneOfType","Placeholder","propName","componentName","Error","MainImage","removeNewLines","str","replace","altValidator","rest","object","imageCache","renderImageToStringPromise","GatsbyImageHydrator","as","class","preactClass","onStartLoad","onLoad","onError","getWrapperProps","wStyle","wClass","wrapperProps","root","useRef","useMemo","JSON","stringify","sizer","getSizer","dangerouslySetInnerHTML","__html","useEffect","import","then","renderImageToString","swapPlaceholderImage","renderImage","ssrImage","current","querySelector","complete","wasCached","setTimeout","removeAttribute","addEventListener","onLoadListener","removeEventListener","cacheKey","animationFrame","cleanupCallback","innerHTML","requestAnimationFrame","cancelAnimationFrame","useLayoutEffect","ref","suppressHydrationWarning","memo","GatsbyImage","_getStaticImage","StaticImage","__imageData","imageData","__error","imgClassName","imgStyle","placeholderBackgroundColor","cleanedImages","checkDimensionProps","number","validLayouts","GatsbyImageBrowser"],"mappings":"sjBAGA,MAAMA,EAA0B,CAAC,IAAM,GAAK,EAAG,GACfC,EAAG,CAAC,IAAK,KAAM,KAAM,QACrB,CAC9B,IAAK,IAAK,IAAK,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,QAErC,IACtBC,EAAsB,IACFC,EAAG,EAAI,EAmG3BC,EAAQC,GAA0BC,QAAQF,KAAKC,GAE/CE,EAAc,CAACC,EAAWC,IAAsBD,EAAIC,EAErCC,EAAG,CAACC,EAAeC,KACtC,OAAQA,GAGN,IAAkB,cAChB,MAAsB,eAAAD,QAAYA,aAGpC,IAAY,QACV,MAAO,GAAGA,MAGZ,IAAgB,YACd,cAEF,QACE,OAAgB,IAIIE,GACxBA,EAAOC,IAAIC,GAAS,GAAGA,EAAMC,OAAOD,EAAMJ,UAAUM,KAAK,gBAEzBC,EAACC,GACjC,MAASC,EAAGD,EAASE,YAAY,KACjC,IAAa,IAATD,EAAY,CACd,MAASE,EAAGH,EAASI,MAAMH,EAAM,GACjC,GAAY,SAARE,EACF,YAEF,GAAmB,IAAfA,EAAIE,QAA+B,IAAfF,EAAIE,OAC1B,QAEH,CAEH,CAEgBC,SAAAA,EACdC,GAEA,IAAId,OACFA,EAAsB,cAAAD,MACtBA,EAAKgB,OACLA,EAAMC,eACNA,EAAcC,YACdA,EAAWC,YACXA,EAAWC,QACXA,EAAU,CAAC,OAAQ,SACjBL,EAIJ,OAHAK,EAAUA,EAAQjB,IAAIkB,GAAUA,EAAOC,eACvCrB,EAASsB,EAAUtB,GAEfD,GAASgB,EACXQ,EAAA,GAAYT,EAAMK,CAAAA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