Socket
Socket
Sign inDemoInstall

remix-image

Package Overview
Dependencies
72
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.3 to 1.4.0

2

build/components/Image/BaseImage.d.ts
import * as React from "react";
import { BaseImageProps } from "./types";
export declare const BaseImage: React.ForwardRefExoticComponent<Pick<BaseImageProps, "loaderUrl" | "slot" | "style" | "title" | "key" | "alt" | "crossOrigin" | "decoding" | "height" | "loading" | "referrerPolicy" | "sizes" | "src" | "srcSet" | "useMap" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "loader" | "responsive" | "options" | "dprVariants"> & React.RefAttributes<HTMLImageElement>>;
export declare const BaseImage: React.ForwardRefExoticComponent<Pick<BaseImageProps, "loaderUrl" | "slot" | "style" | "title" | "key" | "alt" | "crossOrigin" | "decoding" | "height" | "loading" | "referrerPolicy" | "sizes" | "src" | "srcSet" | "useMap" | "width" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "nonce" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "loader" | "responsive" | "options" | "dprVariants"> & React.RefAttributes<HTMLImageElement>>;
import { ResponsiveSize } from "../../types";
import { OnLoadingComplete } from "./types";
export declare type ImgElementWithDataProp = HTMLImageElement & {
export type ImgElementWithDataProp = HTMLImageElement & {
"data-loaded-src": string | undefined;

@@ -5,0 +5,0 @@ };

import * as React from "react";
import { ClientLoader, ResponsiveSize, SizelessOptions } from "../../types";
export declare type OnLoadingComplete = (result: {
export type OnLoadingComplete = (result: {
naturalWidth: number;

@@ -14,3 +14,3 @@ naturalHeight: number;

}
export declare type ImageProps = Omit<BaseImageProps, "placeholder"> & ({
export type ImageProps = Omit<BaseImageProps, "placeholder"> & ({
unoptimized: true;

@@ -17,0 +17,0 @@ placeholder?: never;

import { ClientLoader } from "../types/client";
import type { ResponsiveSize } from "../types/image";
import type { SizelessOptions } from "../types/transformer";
export declare type ImageSource = {
export type ImageSource = {
src?: string;
};
export declare type ResponsiveHookResult = {
export type ResponsiveHookResult = {
src: string;

@@ -9,0 +9,0 @@ srcSet?: string;

@@ -6,1 +6,2 @@ export { Image as default } from "./components";

export * from "./types";
export declare const version: string;

@@ -1,2 +0,2 @@

"use strict";function _interopNamespace(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}Object.defineProperty(exports,"__esModule",{value:!0});var e=_interopNamespace(require("react"));const t={"center bottom":"0.5x1","center center":"0.5x0.5","center top":"0.5x0","left bottom":"0x1","left center":"0x0.5","left top":"0x0","right bottom":"1x1","right center":"1x0.5","right top":"1x0",bottom:"bottom",center:"0.5x0.5",left:"left",right:"right",top:"top"},numberToHex$1=e=>("0"+Number(e).toString(16)).slice(-2).toUpperCase(),o={"center bottom":"south","center center":"center","center top":"north","left bottom":"south_west","left center":"west","left top":"north_west","right bottom":"south_east","right center":"east","right top":"north_east",bottom:"south",center:"center",left:"west",right:"east",top:"north"},numberToHex=e=>("0"+Number(e).toString(16)).slice(-2).toUpperCase();var n={},strictUriEncode=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),i=new RegExp("%[a-f0-9]{2}","gi"),a=new RegExp("(%[a-f0-9]{2})+","gi");function decodeComponents(e,t){try{return decodeURIComponent(e.join(""))}catch(e){}if(1===e.length)return e;t=t||1;var o=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],decodeComponents(o),decodeComponents(n))}function decode(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(i),o=1;o<t.length;o++)t=(e=decodeComponents(t,o).join("")).match(i);return e}}var decodeUriComponent=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function customDecodeURIComponent(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},o=a.exec(e);o;){try{t[o[0]]=decodeURIComponent(o[0])}catch(e){var n=decode(o[0]);n!==o[0]&&(t[o[0]]=n)}o=a.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),s=0;s<i.length;s++){var c=i[s];e=e.replace(new RegExp(c,"g"),t[c])}return e}(e)}},splitOnFirst=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const o=e.indexOf(t);return-1===o?[e]:[e.slice(0,o),e.slice(o+t.length)]},filterObj=function(e,t){for(var o={},n=Object.keys(e),i=Array.isArray(t),a=0;a<n.length;a++){var s=n[a],c=e[s];(i?-1!==t.indexOf(s):t(s,c,e))&&(o[s]=c)}return o};!function(e){const t=strictUriEncode,o=decodeUriComponent,n=splitOnFirst,i=filterObj,a=Symbol("encodeFragmentIdentifier");function validateArrayFormatSeparator(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function encode(e,o){return o.encode?o.strict?t(e):encodeURIComponent(e):e}function decode(e,t){return t.decode?o(e):e}function keysSorter(e){return Array.isArray(e)?e.sort():"object"==typeof e?keysSorter(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function removeHash(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function extract(e){const t=(e=removeHash(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function parseValue(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function parse(e,t){validateArrayFormatSeparator((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const o=function parserForArrayFormat(e){let t;switch(e.arrayFormat){case"index":return(e,o,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=o):n[e]=o};case"bracket":return(e,o,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],o):n[e]=[o]:n[e]=o};case"colon-list-separator":return(e,o,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],o):n[e]=[o]:n[e]=o};case"comma":case"separator":return(t,o,n)=>{const i="string"==typeof o&&o.includes(e.arrayFormatSeparator),a="string"==typeof o&&!i&&decode(o,e).includes(e.arrayFormatSeparator);o=a?decode(o,e):o;const s=i||a?o.split(e.arrayFormatSeparator).map((t=>decode(t,e))):null===o?o:decode(o,e);n[t]=s};case"bracket-separator":return(t,o,n)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=o?decode(o,e):o);const a=null===o?[]:o.split(e.arrayFormatSeparator).map((t=>decode(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],a):n[t]=a};default:return(e,t,o)=>{void 0!==o[e]?o[e]=[].concat(o[e],t):o[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const a of e.split("&")){if(""===a)continue;let[e,s]=n(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:decode(s,t),o(decode(e,t),s,i)}for(const e of Object.keys(i)){const o=i[e];if("object"==typeof o&&null!==o)for(const e of Object.keys(o))o[e]=parseValue(o[e],t);else i[e]=parseValue(o,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const o=i[t];return Boolean(o)&&"object"==typeof o&&!Array.isArray(o)?e[t]=keysSorter(o):e[t]=o,e}),Object.create(null))}e.extract=extract,e.parse=parse,e.stringify=(e,t)=>{if(!e)return"";validateArrayFormatSeparator((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const shouldFilter=o=>t.skipNull&&null==e[o]||t.skipEmptyString&&""===e[o],o=function encoderForArrayFormat(e){switch(e.arrayFormat){case"index":return t=>(o,n)=>{const i=o.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,[encode(t,e),"[",i,"]"].join("")]:[...o,[encode(t,e),"[",encode(i,e),"]=",encode(n,e)].join("")]};case"bracket":return t=>(o,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,[encode(t,e),"[]"].join("")]:[...o,[encode(t,e),"[]=",encode(n,e)].join("")];case"colon-list-separator":return t=>(o,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,[encode(t,e),":list="].join("")]:[...o,[encode(t,e),":list=",encode(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return o=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[encode(o,e),t,encode(i,e)].join("")]:[[n,encode(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(o,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,encode(t,e)]:[...o,[encode(t,e),"=",encode(n,e)].join("")]}}(t),n={};for(const t of Object.keys(e))shouldFilter(t)||(n[t]=e[t]);const i=Object.keys(n);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const i=e[n];return void 0===i?"":null===i?encode(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?encode(n,t)+"[]":i.reduce(o(n),[]).join("&"):encode(n,t)+"="+encode(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[o,i]=n(e,"#");return Object.assign({url:o.split("?")[0]||"",query:parse(extract(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:decode(i,t)}:{})},e.stringifyUrl=(t,o)=>{o=Object.assign({encode:!0,strict:!0,[a]:!0},o);const n=removeHash(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),c=Object.assign(s,t.query);let p=e.stringify(c,o);p&&(p=`?${p}`);let u=function getHash(e){let t="";const o=e.indexOf("#");return-1!==o&&(t=e.slice(o)),t}(t.url);return t.fragmentIdentifier&&(u=`#${o[a]?encode(t.fragmentIdentifier,o):t.fragmentIdentifier}`),`${n}${p}${u}`},e.pick=(t,o,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:s,query:c,fragmentIdentifier:p}=e.parseUrl(t,n);return e.stringifyUrl({url:s,query:i(c,o),fragmentIdentifier:p},n)},e.exclude=(t,o,n)=>{const i=Array.isArray(o)?e=>!o.includes(e):(e,t)=>!o(e,t);return e.pick(t,i,n)}}(n);class RemixImageError extends Error{errorCode;constructor(e,t){super(e),Object.setPrototypeOf(this,RemixImageError.prototype),this.errorCode=t||500}toString(){return this.message}}class UnsupportedImageError extends RemixImageError{constructor(e){super(e,415),Object.setPrototypeOf(this,UnsupportedImageError.prototype)}}const remixImageLoader=(e,t,o)=>((e,t)=>{const o=t;return Object.prototype.hasOwnProperty.call(t,"crop")&&(o.crop=JSON.stringify(o.crop)),n.stringifyUrl({url:e,query:o},{skipNull:!0,arrayFormat:"bracket",sort:!1})})(t,{src:encodeURI(e),...o}),sizeComparator=(e,t)=>(e.maxWidth||1/0)-(t.maxWidth||1/0),sizeConverter=e=>e.maxWidth?`(max-width: ${e.maxWidth}px) ${e.size.width}px`:`${e.size.width}px`;function useResponsiveImage(t,o,n={},i=[1],a="/api/image",s=remixImageLoader){return e.useMemo((()=>{let e=t.src||"",c=0;const p=[],u=Array.from(new Set([1,..."number"==typeof i?[i]:i])).sort();for(const i of u)for(const{size:u}of o){const o=s(t.src||"",a,{width:"number"==typeof u.width?u.width*i:u.width,height:"number"==typeof u.height?u.height*i:u.height,fit:"cover",position:"center",background:[0,0,0,0],quality:80,compressionLevel:9,loop:0,delay:100,blurRadius:null,rotate:null,flip:null,crop:null,...n});p.push(o+` ${u.width*i}w`),1===i&&u.width>c&&(c=u.width,e=o)}const l=[...o].sort(sizeComparator).map(sizeConverter);return 1===o.length&&null!=o[0].maxWidth&&l.push(`${o[0].size.width}px`),{...p.length>0&&{srcSet:p.join(", "),sizes:l.join(", ")},src:e}}),[t.src,a,s,o,n,i])}const s=e.forwardRef((({loaderUrl:t="/api/image",loader:o=remixImageLoader,responsive:n=[],options:i={},dprVariants:a=1,decoding:s="async",loading:c="lazy",...p},u)=>{const l=useResponsiveImage(p,n,i,a,t,o);return e.createElement("img",{ref:u,decoding:s,loading:c,...p,...l})}));function r(e){var t,o,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(o=r(e[t]))&&(n&&(n+=" "),n+=o);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,o=0,n="";o<arguments.length;)(e=arguments[o++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}function handleLoading(e,t,o){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;("decode"in e?e.decode():Promise.resolve()).catch((()=>{})).then((()=>{if(e.parentNode&&(e.style.animationDuration="0.125s",e.classList.remove("blur"),o)){const{naturalWidth:t,naturalHeight:n}=e;o({naturalWidth:t,naturalHeight:n})}}))}s.displayName="BaseImage";const c=e.memo(e.forwardRef((({src:t,loaderUrl:o="/api/image",loader:n=remixImageLoader,responsive:i=[],options:a={},dprVariants:s=1,decoding:c="async",loading:p="lazy",unoptimized:u=!1,placeholder:l="empty",blurDataURL:d=(u||"blur"!==l?null:n(t||"",o,{width:15,height:15,fit:a?.fit||"cover",position:a?.position||"center",contentType:a.contentType})),placeholderAspectRatio:h=null,onLoadingComplete:g,className:f,style:m={},onLoad:y,...b},x)=>{const w=useResponsiveImage({src:t},i,a,s,o,n),$=e.useMemo((()=>{if(u)return m;const e=function computePlaceholderSize(e=[],t){let o=t||1,n=0;for(let i=0;i<e.length;i+=1){const a=e[i].size||{};a.width&&(a.width>n&&(n=a.width),!t&&a.height&&(o=a.height/a.width))}return{width:n,height:Math.round(n*o)}}(i,h);return{minWidth:e.width,minHeight:e.height,backgroundSize:a?.fit||"cover",backgroundPosition:a?.position||"center",...d&&{backgroundImage:`url("${d}")`},...m}}),[u,i,h,m,a?.fit,a?.position,d]);return e.createElement("img",{ref:e.useCallback((e=>{null!=e&&(u||("blur"===l&&e.classList.add("blur"),e?.complete&&handleLoading(e,t,g)),x&&("function"==typeof x?x(e):x.current=e))}),[u,x,t,l,g]),decoding:c,loading:p,style:$,className:clsx(!u&&"remix-image",!u&&"blur"===l&&"blur-in",f),...b,...w,onLoad:e=>{if(!u){handleLoading(e.currentTarget,t,g)}y&&y(e)}})})));var p,u;c.displayName="Image",exports.CacheStatus=void 0,(p=exports.CacheStatus||(exports.CacheStatus={})).HIT="hit",p.STALE="stale",p.MISS="miss";exports.MimeType=void 0,(u=exports.MimeType||(exports.MimeType={})).SVG="image/svg+xml",u.JPEG="image/jpeg",u.PNG="image/png",u.GIF="image/gif",u.WEBP="image/webp",u.BMP="image/bmp",u.TIFF="image/tiff",u.AVIF="image/avif",exports.BaseImage=s,exports.Cache=class Cache{},exports.Image=c,exports.RemixImageError=RemixImageError,exports.UnsupportedImageError=UnsupportedImageError,exports.cloudflareImagesLoader=(e,o,n)=>{const i=[];n.background&&i.push(`background=rgba(${n.background[0]},${n.background[1]},${n.background[2]},${Number(n.background[3]/255).toFixed(2)})`),n.crop&&i.push(`trim=${n.crop.y};${n.crop.x+n.crop.width};${n.crop.height};${n.crop.x}`),n.rotate&&i.push(`rotate=${n.rotate}`),n.blurRadius&&i.push(`blur=${n.blurRadius}`),"outside"===n.fit?(i.push("fit=contain"),n.width&&n.height?(i.push(`width=${Math.max(n.width,n.height)}`),i.push(`height=${Math.max(n.width,n.height)}`)):n.width?i.push(`width=${n.width}`):n.height&&i.push(`height=${n.height}`)):("contain"===n.fit?i.push("fit=pad"):"cover"===n.fit?i.push("fit=cover"):"fill"===n.fit?i.push("fit=fill"):"inside"===n.fit&&i.push("fit=contain"),n.width&&i.push(`width=${n.width}`),n.height&&i.push(`height=${n.height}`)),n.position&&i.push(`gravity=${t[n.position]||"0.5x0.5"}`),n.quality&&i.push(`quality=${n.quality}`);return`/cdn-cgi/image/${i.join(",")}/${(e=>e.startsWith("/")?e.slice(1):e)(e)}`},exports.cloudinaryLoader=(e,t,n)=>{const i=[];n.background&&i.push(`b_${numberToHex$1(n.background[0])+numberToHex$1(n.background[1])+numberToHex$1(n.background[2])+numberToHex$1(n.background[3])}`),n.crop&&(i.push("c_crop"),i.push("g_north_west"),i.push(`h_${n.crop.height}`),i.push(`w_${n.crop.width}`),i.push(`x_${n.crop.x}`),i.push(`y_${n.crop.y}`)),n.rotate&&i.push(`a_${n.rotate}`),n.blurRadius&&i.push(`e_blur:${n.blurRadius}`),"outside"===n.fit?(i.push("c_fit"),n.width&&n.height?(i.push(`w_${Math.max(n.width,n.height)}`),i.push(`h_${Math.max(n.width,n.height)}`)):n.width?i.push(`w_${n.width}`):n.height&&i.push(`h_${n.height}`)):("contain"===n.fit?i.push("c_pad"):"cover"===n.fit?i.push("c_fill"):"fill"===n.fit?i.push("c_scale"):"inside"===n.fit&&i.push("c_fit"),n.width&&i.push(`w_${n.width}`),n.height&&i.push(`h_${n.height}`)),n.position&&i.push(`g_${o[n.position]||"center"}`),i.push(`q_${n.quality||"auto"}`),n.contentType?i.push("f_",n.contentType.replace("image/","").replace("jpeg","jpg")):i.push("f_auto");return`${t}${i.join(",")+"/"}${(e=>e.startsWith("/")?e.slice(1):e)(e)}`},exports.default=c,exports.imgixLoader=(e,t,o)=>{const n=new URL(`${t}${(e=>e.startsWith("/")?e.slice(1):e)(e)}`),i=n.searchParams;return o.width&&i.set("w",o.width.toString()),o.height&&i.set("h",o.height.toString()),o.background&&i.set("bg",numberToHex(o.background[3])+numberToHex(o.background[0])+numberToHex(o.background[1])+numberToHex(o.background[2])),o.crop&&i.set("rect",`${o.crop.x},${o.crop.y},${o.crop.width},${o.crop.height}`),"horizontal"===o.flip?i.set("flip","h"):"vertical"===o.flip?i.set("flip","v"):"both"===o.flip&&i.set("flip","hv"),o.rotate&&i.set("rot",o.rotate.toString()),o.blurRadius&&i.set("blur",o.blurRadius.toString()),"contain"===o.fit?i.set("fit","fill"):"cover"===o.fit?i.set("fit","crop"):"fill"===o.fit?i.set("fit","scale"):"inside"===o.fit?i.set("fit","fillmax"):"outside"===o.fit&&i.set("fit","max"),o.quality&&i.set("q",o.quality.toString()),o.contentType?i.set("format",o.contentType.replace("image/","").replace("jpeg","jpg")):i.set("auto","format"),n.href},exports.remixImageLoader=remixImageLoader,exports.useResponsiveImage=useResponsiveImage;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");function _interopNamespaceDefault(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(o){if("default"!==o){var n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n.get?n:{enumerable:!0,get:function(){return e[o]}})}})),t.default=e,Object.freeze(t)}var t=_interopNamespaceDefault(require("react"));const o={"center bottom":"0.5x1","center center":"0.5x0.5","center top":"0.5x0","left bottom":"0x1","left center":"0x0.5","left top":"0x0","right bottom":"1x1","right center":"1x0.5","right top":"1x0",bottom:"bottom",center:"0.5x0.5",left:"left",right:"right",top:"top"},numberToHex$1=e=>("0"+Number(e).toString(16)).slice(-2).toUpperCase(),n={"center bottom":"south","center center":"center","center top":"north","left bottom":"south_west","left center":"west","left top":"north_west","right bottom":"south_east","right center":"east","right top":"north_east",bottom:"south",center:"center",left:"west",right:"east",top:"north"},numberToHex=e=>("0"+Number(e).toString(16)).slice(-2).toUpperCase();var i={},strictUriEncode=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),a="%[a-f0-9]{2}",s=new RegExp("("+a+")|([^%]+?)","gi"),c=new RegExp("("+a+")+","gi");function decodeComponents(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var o=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],decodeComponents(o),decodeComponents(n))}function decode(e){try{return decodeURIComponent(e)}catch(n){for(var t=e.match(s)||[],o=1;o<t.length;o++)t=(e=decodeComponents(t,o).join("")).match(s)||[];return e}}var decodeUriComponent=function(e){if("string"!=typeof e)throw new TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function customDecodeURIComponent(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},o=c.exec(e);o;){try{t[o[0]]=decodeURIComponent(o[0])}catch(e){var n=decode(o[0]);n!==o[0]&&(t[o[0]]=n)}o=c.exec(e)}t["%C2"]="�";for(var i=Object.keys(t),a=0;a<i.length;a++){var s=i[a];e=e.replace(new RegExp(s,"g"),t[s])}return e}(e)}},splitOnFirst=(e,t)=>{if("string"!=typeof e||"string"!=typeof t)throw new TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];const o=e.indexOf(t);return-1===o?[e]:[e.slice(0,o),e.slice(o+t.length)]},filterObj=function(e,t){for(var o={},n=Object.keys(e),i=Array.isArray(t),a=0;a<n.length;a++){var s=n[a],c=e[s];(i?-1!==t.indexOf(s):t(s,c,e))&&(o[s]=c)}return o};!function(e){const t=strictUriEncode,o=decodeUriComponent,n=splitOnFirst,i=filterObj,a=Symbol("encodeFragmentIdentifier");function validateArrayFormatSeparator(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function encode(e,o){return o.encode?o.strict?t(e):encodeURIComponent(e):e}function decode(e,t){return t.decode?o(e):e}function keysSorter(e){return Array.isArray(e)?e.sort():"object"==typeof e?keysSorter(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function removeHash(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function extract(e){const t=(e=removeHash(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function parseValue(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function parse(e,t){validateArrayFormatSeparator((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);const o=function parserForArrayFormat(e){let t;switch(e.arrayFormat){case"index":return(e,o,n)=>{t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===n[e]&&(n[e]={}),n[e][t[1]]=o):n[e]=o};case"bracket":return(e,o,n)=>{t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],o):n[e]=[o]:n[e]=o};case"colon-list-separator":return(e,o,n)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==n[e]?n[e]=[].concat(n[e],o):n[e]=[o]:n[e]=o};case"comma":case"separator":return(t,o,n)=>{const i="string"==typeof o&&o.includes(e.arrayFormatSeparator),a="string"==typeof o&&!i&&decode(o,e).includes(e.arrayFormatSeparator);o=a?decode(o,e):o;const s=i||a?o.split(e.arrayFormatSeparator).map((t=>decode(t,e))):null===o?o:decode(o,e);n[t]=s};case"bracket-separator":return(t,o,n)=>{const i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i)return void(n[t]=o?decode(o,e):o);const a=null===o?[]:o.split(e.arrayFormatSeparator).map((t=>decode(t,e)));void 0!==n[t]?n[t]=[].concat(n[t],a):n[t]=a};default:return(e,t,o)=>{void 0!==o[e]?o[e]=[].concat(o[e],t):o[e]=t}}}(t),i=Object.create(null);if("string"!=typeof e)return i;if(!(e=e.trim().replace(/^[?#&]/,"")))return i;for(const a of e.split("&")){if(""===a)continue;let[e,s]=n(t.decode?a.replace(/\+/g," "):a,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:decode(s,t),o(decode(e,t),s,i)}for(const e of Object.keys(i)){const o=i[e];if("object"==typeof o&&null!==o)for(const e of Object.keys(o))o[e]=parseValue(o[e],t);else i[e]=parseValue(o,t)}return!1===t.sort?i:(!0===t.sort?Object.keys(i).sort():Object.keys(i).sort(t.sort)).reduce(((e,t)=>{const o=i[t];return Boolean(o)&&"object"==typeof o&&!Array.isArray(o)?e[t]=keysSorter(o):e[t]=o,e}),Object.create(null))}e.extract=extract,e.parse=parse,e.stringify=(e,t)=>{if(!e)return"";validateArrayFormatSeparator((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);const shouldFilter=o=>t.skipNull&&null==e[o]||t.skipEmptyString&&""===e[o],o=function encoderForArrayFormat(e){switch(e.arrayFormat){case"index":return t=>(o,n)=>{const i=o.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,[encode(t,e),"[",i,"]"].join("")]:[...o,[encode(t,e),"[",encode(i,e),"]=",encode(n,e)].join("")]};case"bracket":return t=>(o,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,[encode(t,e),"[]"].join("")]:[...o,[encode(t,e),"[]=",encode(n,e)].join("")];case"colon-list-separator":return t=>(o,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,[encode(t,e),":list="].join("")]:[...o,[encode(t,e),":list=",encode(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return o=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length?[[encode(o,e),t,encode(i,e)].join("")]:[[n,encode(i,e)].join(e.arrayFormatSeparator)])}default:return t=>(o,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?o:null===n?[...o,encode(t,e)]:[...o,[encode(t,e),"=",encode(n,e)].join("")]}}(t),n={};for(const t of Object.keys(e))shouldFilter(t)||(n[t]=e[t]);const i=Object.keys(n);return!1!==t.sort&&i.sort(t.sort),i.map((n=>{const i=e[n];return void 0===i?"":null===i?encode(n,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?encode(n,t)+"[]":i.reduce(o(n),[]).join("&"):encode(n,t)+"="+encode(i,t)})).filter((e=>e.length>0)).join("&")},e.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);const[o,i]=n(e,"#");return Object.assign({url:o.split("?")[0]||"",query:parse(extract(e),t)},t&&t.parseFragmentIdentifier&&i?{fragmentIdentifier:decode(i,t)}:{})},e.stringifyUrl=(t,o)=>{o=Object.assign({encode:!0,strict:!0,[a]:!0},o);const n=removeHash(t.url).split("?")[0]||"",i=e.extract(t.url),s=e.parse(i,{sort:!1}),c=Object.assign(s,t.query);let p=e.stringify(c,o);p&&(p=`?${p}`);let u=function getHash(e){let t="";const o=e.indexOf("#");return-1!==o&&(t=e.slice(o)),t}(t.url);return t.fragmentIdentifier&&(u=`#${o[a]?encode(t.fragmentIdentifier,o):t.fragmentIdentifier}`),`${n}${p}${u}`},e.pick=(t,o,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[a]:!1},n);const{url:s,query:c,fragmentIdentifier:p}=e.parseUrl(t,n);return e.stringifyUrl({url:s,query:i(c,o),fragmentIdentifier:p},n)},e.exclude=(t,o,n)=>{const i=Array.isArray(o)?e=>!o.includes(e):(e,t)=>!o(e,t);return e.pick(t,i,n)}}(i);class RemixImageError extends Error{errorCode;constructor(e,t){super(e),Object.setPrototypeOf(this,RemixImageError.prototype),this.errorCode=t||500}toString(){return this.message}}class UnsupportedImageError extends RemixImageError{constructor(e){super(e,415),Object.setPrototypeOf(this,UnsupportedImageError.prototype)}}const remixImageLoader=(e,t,o)=>((e,t)=>{const o=t;return Object.prototype.hasOwnProperty.call(t,"crop")&&(o.crop=JSON.stringify(o.crop)),i.stringifyUrl({url:e,query:o},{skipNull:!0,arrayFormat:"bracket",sort:!1})})(t,{src:encodeURI(e),...o}),sizeComparator=(e,t)=>(e.maxWidth||1/0)-(t.maxWidth||1/0),sizeConverter=e=>e.maxWidth?`(max-width: ${e.maxWidth}px) ${e.size.width}px`:`${e.size.width}px`;function useResponsiveImage(e,o,n={},i=[1],a="/api/image",s=remixImageLoader){return t.useMemo((()=>{let t=e.src||"",c=0;const p=[],u=Array.from(new Set([1,..."number"==typeof i?[i]:i])).sort();for(const i of u)for(const{size:u}of o){const o=s(e.src||"",a,{width:"number"==typeof u.width?u.width*i:u.width,height:"number"==typeof u.height?u.height*i:u.height,fit:"cover",position:"center",background:[0,0,0,0],quality:80,compressionLevel:9,loop:0,delay:100,blurRadius:null,rotate:null,flip:null,crop:null,...n});p.push(o+` ${u.width*i}w`),1===i&&u.width>c&&(c=u.width,t=o)}const l=[...o].sort(sizeComparator).map(sizeConverter);return 1===o.length&&null!=o[0].maxWidth&&l.push(`${o[0].size.width}px`),{...p.length>0&&{srcSet:p.join(", "),sizes:l.join(", ")},src:t}}),[e.src,a,s,o,n,i])}const p=t.forwardRef((({loaderUrl:t="/api/image",loader:o=remixImageLoader,responsive:n=[],options:i={},dprVariants:a=1,decoding:s="async",loading:c="lazy",...p},u)=>{const l=useResponsiveImage(p,n,i,a,t,o);return e.jsx("img",{ref:u,decoding:s,loading:c,...p,...l})}));function r(e){var t,o,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(o=r(e[t]))&&(n&&(n+=" "),n+=o);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,o=0,n="";o<arguments.length;)(e=arguments[o++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}function handleLoading(e,t,o){if(!e||e["data-loaded-src"]===t)return;e["data-loaded-src"]=t;("decode"in e?e.decode():Promise.resolve()).catch((()=>{})).then((()=>{if(e.parentNode&&(e.style.animationDuration="0.125s",e.classList.remove("blur"),o)){const{naturalWidth:t,naturalHeight:n}=e;o({naturalWidth:t,naturalHeight:n})}}))}p.displayName="BaseImage";const u=t.memo(t.forwardRef((({src:o,loaderUrl:n="/api/image",loader:i=remixImageLoader,responsive:a=[],options:s={},dprVariants:c=1,decoding:p="async",loading:u="lazy",unoptimized:l=!1,placeholder:d="empty",blurDataURL:h=(l||"blur"!==d?null:i(o||"",n,{width:15,height:15,fit:s?.fit||"cover",position:s?.position||"center",contentType:s.contentType})),placeholderAspectRatio:g=null,onLoadingComplete:f,className:m,style:y={},onLoad:b,...x},w)=>{const $=useResponsiveImage({src:o},a,s,c,n,i),v=t.useMemo((()=>{if(l)return y;const e=function computePlaceholderSize(e=[],t){let o=t||1,n=0;for(let i=0;i<e.length;i+=1){const a=e[i].size||{};a.width&&(a.width>n&&(n=a.width),!t&&a.height&&(o=a.height/a.width))}return{width:n,height:Math.round(n*o)}}(a,g);return{minWidth:e.width,minHeight:e.height,backgroundSize:s?.fit||"cover",backgroundPosition:s?.position||"center",...h&&{backgroundImage:`url("${h}")`},...y}}),[l,a,g,y,s?.fit,s?.position,h]);return e.jsx("img",{ref:t.useCallback((e=>{null!=e&&(l||("blur"===d&&e.classList.add("blur"),e?.complete&&handleLoading(e,o,f)),w&&("function"==typeof w?w(e):w.current=e))}),[l,w,o,d,f]),decoding:p,loading:u,style:v,className:clsx(!l&&"remix-image",!l&&"blur"===d&&"blur-in",m),...x,...$,onLoad:e=>{if(!l){handleLoading(e.currentTarget,o,f)}b&&b(e)}})})));var l,d;u.displayName="Image",exports.CacheStatus=void 0,(l=exports.CacheStatus||(exports.CacheStatus={})).HIT="hit",l.STALE="stale",l.MISS="miss";exports.MimeType=void 0,(d=exports.MimeType||(exports.MimeType={})).SVG="image/svg+xml",d.JPEG="image/jpeg",d.PNG="image/png",d.GIF="image/gif",d.WEBP="image/webp",d.BMP="image/bmp",d.TIFF="image/tiff",d.AVIF="image/avif";exports.BaseImage=p,exports.Cache=class Cache{},exports.Image=u,exports.RemixImageError=RemixImageError,exports.UnsupportedImageError=UnsupportedImageError,exports.cloudflareImagesLoader=(e,t,n)=>{const i=[];n.background&&i.push(`background=rgba(${n.background[0]},${n.background[1]},${n.background[2]},${Number(n.background[3]/255).toFixed(2)})`),n.crop&&i.push(`trim=${n.crop.y};${n.crop.x+n.crop.width};${n.crop.height};${n.crop.x}`),n.rotate&&i.push(`rotate=${n.rotate}`),n.blurRadius&&i.push(`blur=${n.blurRadius}`),"outside"===n.fit?(i.push("fit=contain"),n.width&&n.height?(i.push(`width=${Math.max(n.width,n.height)}`),i.push(`height=${Math.max(n.width,n.height)}`)):n.width?i.push(`width=${n.width}`):n.height&&i.push(`height=${n.height}`)):("contain"===n.fit?i.push("fit=pad"):"cover"===n.fit?i.push("fit=cover"):"fill"===n.fit?i.push("fit=fill"):"inside"===n.fit&&i.push("fit=contain"),n.width&&i.push(`width=${n.width}`),n.height&&i.push(`height=${n.height}`)),n.position&&i.push(`gravity=${o[n.position]||"0.5x0.5"}`),n.quality&&i.push(`quality=${n.quality}`);return`/cdn-cgi/image/${i.join(",")}/${(e=>e.startsWith("/")?e.slice(1):e)(e)}`},exports.cloudinaryLoader=(e,t,o)=>{const i=[];o.background&&i.push(`b_${numberToHex$1(o.background[0])+numberToHex$1(o.background[1])+numberToHex$1(o.background[2])+numberToHex$1(o.background[3])}`),o.crop&&(i.push("c_crop"),i.push("g_north_west"),i.push(`h_${o.crop.height}`),i.push(`w_${o.crop.width}`),i.push(`x_${o.crop.x}`),i.push(`y_${o.crop.y}`)),o.rotate&&i.push(`a_${o.rotate}`),o.blurRadius&&i.push(`e_blur:${o.blurRadius}`),"outside"===o.fit?(i.push("c_fit"),o.width&&o.height?(i.push(`w_${Math.max(o.width,o.height)}`),i.push(`h_${Math.max(o.width,o.height)}`)):o.width?i.push(`w_${o.width}`):o.height&&i.push(`h_${o.height}`)):("contain"===o.fit?i.push("c_pad"):"cover"===o.fit?i.push("c_fill"):"fill"===o.fit?i.push("c_scale"):"inside"===o.fit&&i.push("c_fit"),o.width&&i.push(`w_${o.width}`),o.height&&i.push(`h_${o.height}`)),o.position&&i.push(`g_${n[o.position]||"center"}`),i.push(`q_${o.quality||"auto"}`),o.contentType?i.push("f_",o.contentType.replace("image/","").replace("jpeg","jpg")):i.push("f_auto");return`${t}${i.join(",")+"/"}${(e=>e.startsWith("/")?e.slice(1):e)(e)}`},exports.default=u,exports.imgixLoader=(e,t,o)=>{const n=new URL(`${t}${(e=>e.startsWith("/")?e.slice(1):e)(e)}`),i=n.searchParams;return o.width&&i.set("w",o.width.toString()),o.height&&i.set("h",o.height.toString()),o.background&&i.set("bg",numberToHex(o.background[3])+numberToHex(o.background[0])+numberToHex(o.background[1])+numberToHex(o.background[2])),o.crop&&i.set("rect",`${o.crop.x},${o.crop.y},${o.crop.width},${o.crop.height}`),"horizontal"===o.flip?i.set("flip","h"):"vertical"===o.flip?i.set("flip","v"):"both"===o.flip&&i.set("flip","hv"),o.rotate&&i.set("rot",o.rotate.toString()),o.blurRadius&&i.set("blur",o.blurRadius.toString()),"contain"===o.fit?i.set("fit","fill"):"cover"===o.fit?i.set("fit","crop"):"fill"===o.fit?i.set("fit","scale"):"inside"===o.fit?i.set("fit","fillmax"):"outside"===o.fit&&i.set("fit","max"),o.quality&&i.set("q",o.quality.toString()),o.contentType?i.set("format",o.contentType.replace("image/","").replace("jpeg","jpg")):i.set("auto","format"),n.href},exports.remixImageLoader=remixImageLoader,exports.useResponsiveImage=useResponsiveImage,exports.version="1.4.0";
//# sourceMappingURL=index.js.map

@@ -7,1 +7,2 @@ export * from "./loaders";

export * from "../types";
export declare const version: string;

@@ -8,1 +8,2 @@ export * from "./caches/memoryCache";

export * from "../types";
export declare const version: string;
import { TransformOptions } from "./transformer";
export declare type ClientLoader = (src: string, loaderUrl: string, loaderOptions: TransformOptions) => string;
export type ClientLoader = (src: string, loaderUrl: string, loaderOptions: TransformOptions) => string;

@@ -1,2 +0,2 @@

export declare type ResponsiveSize = {
export type ResponsiveSize = {
size: {

@@ -9,2 +9,2 @@ width: number;

/** RGBA hex values 0...255 */
export declare type Color = [number, number, number, number];
export type Color = [number, number, number, number];

@@ -34,3 +34,5 @@ import type { Cache } from "./cache";

blacklistedDomains?: string[] | null;
/** Enables verbose logging for debugging */
verbose?: boolean;
}
export declare type AssetLoader = (config: LoaderConfig, request: Request) => Promise<Response>;
export type AssetLoader = (config: LoaderConfig, request: Request) => Promise<Response>;
import { MimeType } from "./file";
import { TransformOptions } from "./transformer";
export declare type Resolver = (asset: string, url: string, options: TransformOptions, basePath: string) => Promise<{
export type Resolver = (asset: string, url: string, options: TransformOptions, basePath: string) => Promise<{
buffer: Uint8Array;
contentType: MimeType;
}>;
import { MimeType } from "./file";
import { Color } from "./image";
export declare type ImageFit =
export type ImageFit =
/** Preserving aspect ratio, contain image within both provided dimensions using a border where necessary. */

@@ -14,6 +14,6 @@ "contain"

| "outside";
export declare type ImagePositionHorizontal = "left" | "center" | "right";
export declare type ImagePositionVertical = "top" | "center" | "bottom";
export declare type ImagePosition = ImagePositionHorizontal | ImagePositionVertical | `${ImagePositionHorizontal} ${ImagePositionVertical}`;
export declare type FlipDirection = "horizontal" | "vertical" | "both";
export type ImagePositionHorizontal = "left" | "center" | "right";
export type ImagePositionVertical = "top" | "center" | "bottom";
export type ImagePosition = ImagePositionHorizontal | ImagePositionVertical | `${ImagePositionHorizontal} ${ImagePositionVertical}`;
export type FlipDirection = "horizontal" | "vertical" | "both";
export interface CropOptions {

@@ -59,4 +59,4 @@ /** The x position of the upper left pixel. */

}
export declare type SizelessOptions = Omit<TransformOptions, "width" | "height">;
export declare type Transformer = {
export type SizelessOptions = Omit<TransformOptions, "width" | "height">;
export type Transformer = {
name: string;

@@ -63,0 +63,0 @@ supportedInputs: Set<MimeType>;

{
"name": "remix-image",
"version": "1.3.3",
"version": "1.4.0",
"description": "A React component for responsive images in Remix",

@@ -47,4 +47,4 @@ "author": "Josh McFarlin <josh@mcfarl.in>",

"prebuild": "rimraf coverage build tmp",
"build": "rollup -c",
"watch": "rollup -c -w",
"build": "rollup -c --bundleConfigAsCjs",
"watch": "rollup -c -w --bundleConfigAsCjs",
"release": "dotenv release-it --"

@@ -57,3 +57,3 @@ },

"lru-cache": "^7.14.0",
"query-string": "^7.1.1"
"query-string": "^7.1.3"
},

@@ -60,0 +60,0 @@ "peerDependencies": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc