react-pic-gallery 1.5.7 → 1.5.8
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/dist/react-pic-gallery.es.js +123 -116
- package/dist/react-pic-gallery.umd.js +5 -5
- package/package.json +3 -2
|
@@ -1692,46 +1692,6 @@ var TransformComponent = function(_a) {
|
|
|
1692
1692
|
})
|
|
1693
1693
|
});
|
|
1694
1694
|
};
|
|
1695
|
-
const extraStyle = `
|
|
1696
|
-
.lds-dual-ring {
|
|
1697
|
-
display: inline-block;
|
|
1698
|
-
width: 40px;
|
|
1699
|
-
height: 40px;
|
|
1700
|
-
}
|
|
1701
|
-
.lds-dual-ring:after {
|
|
1702
|
-
content: " ";
|
|
1703
|
-
display: block;
|
|
1704
|
-
width: 32px;
|
|
1705
|
-
height: 32px;
|
|
1706
|
-
margin: 8px;
|
|
1707
|
-
border-radius: 50%;
|
|
1708
|
-
border: 3px solid rgba(185, 185, 185, 0.466);
|
|
1709
|
-
border-color: rgba(185, 185, 185, 0.466) transparent rgba(185, 185, 185, 0.466) transparent;
|
|
1710
|
-
animation: lds-dual-ring 1.2s linear infinite;
|
|
1711
|
-
}
|
|
1712
|
-
@keyframes lds-dual-ring {
|
|
1713
|
-
0% {
|
|
1714
|
-
transform: rotate(0deg);
|
|
1715
|
-
}
|
|
1716
|
-
100% {
|
|
1717
|
-
transform: rotate(360deg);
|
|
1718
|
-
}
|
|
1719
|
-
}
|
|
1720
|
-
`;
|
|
1721
|
-
function CircularLoading() {
|
|
1722
|
-
const styleTag = document.querySelector("#react-pic-style");
|
|
1723
|
-
if (!styleTag) {
|
|
1724
|
-
const sheet = document.createElement("style");
|
|
1725
|
-
sheet.id = "react-pic-style";
|
|
1726
|
-
sheet.innerHTML = extraStyle;
|
|
1727
|
-
document.body.appendChild(sheet);
|
|
1728
|
-
} else {
|
|
1729
|
-
styleTag.innerHTML = styleTag.innerHTML + extraStyle;
|
|
1730
|
-
}
|
|
1731
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1732
|
-
className: "lds-dual-ring"
|
|
1733
|
-
});
|
|
1734
|
-
}
|
|
1735
1695
|
let styles = {};
|
|
1736
1696
|
styles.lightbox = {
|
|
1737
1697
|
position: "fixed",
|
|
@@ -1789,20 +1749,106 @@ styles.Grid = {
|
|
|
1789
1749
|
width: "100%",
|
|
1790
1750
|
height: "auto"
|
|
1791
1751
|
};
|
|
1792
|
-
const
|
|
1793
|
-
|
|
1752
|
+
const extraStyle = `
|
|
1753
|
+
.lds-dual-ring {
|
|
1754
|
+
display: inline-block;
|
|
1755
|
+
width: 40px;
|
|
1756
|
+
height: 40px;
|
|
1757
|
+
}
|
|
1758
|
+
.lds-dual-ring:after {
|
|
1759
|
+
content: " ";
|
|
1760
|
+
display: block;
|
|
1761
|
+
width: 32px;
|
|
1762
|
+
height: 32px;
|
|
1763
|
+
margin: 8px;
|
|
1764
|
+
border-radius: 50%;
|
|
1765
|
+
border: 3px solid rgba(185, 185, 185, 0.466);
|
|
1766
|
+
border-color: rgba(185, 185, 185, 0.466) transparent rgba(185, 185, 185, 0.466) transparent;
|
|
1767
|
+
animation: lds-dual-ring 1.2s linear infinite;
|
|
1768
|
+
}
|
|
1769
|
+
@keyframes lds-dual-ring {
|
|
1770
|
+
0% {
|
|
1771
|
+
transform: rotate(0deg);
|
|
1772
|
+
}
|
|
1773
|
+
100% {
|
|
1774
|
+
transform: rotate(360deg);
|
|
1775
|
+
}
|
|
1776
|
+
}
|
|
1777
|
+
`;
|
|
1778
|
+
function CircularLoading() {
|
|
1779
|
+
useEffect(() => {
|
|
1780
|
+
const styleTag = document.querySelector("#react-pic-style");
|
|
1781
|
+
if (!styleTag) {
|
|
1782
|
+
const sheet = document.createElement("style");
|
|
1783
|
+
sheet.id = "react-pic-style";
|
|
1784
|
+
sheet.innerHTML = extraStyle;
|
|
1785
|
+
document.body.appendChild(sheet);
|
|
1786
|
+
} else {
|
|
1787
|
+
styleTag.innerHTML = styleTag.innerHTML + extraStyle;
|
|
1788
|
+
}
|
|
1789
|
+
return () => {
|
|
1790
|
+
var _a;
|
|
1791
|
+
(_a = document.querySelector("#react-pic-style")) == null ? void 0 : _a.remove();
|
|
1792
|
+
};
|
|
1793
|
+
}, []);
|
|
1794
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1795
|
+
className: "lds-dual-ring"
|
|
1796
|
+
});
|
|
1797
|
+
}
|
|
1798
|
+
const ImgLazyLoading = (props) => {
|
|
1799
|
+
var _a;
|
|
1794
1800
|
const [imgSrcUrl, setImgSrcUrl] = React.useState("");
|
|
1795
1801
|
const Loading = ((_a = props.options) == null ? void 0 : _a.customLoadComponent) !== void 0 ? props.options.customLoadComponent : CircularLoading;
|
|
1802
|
+
const [loadingState, setLoadingState] = useState(true);
|
|
1796
1803
|
React.useEffect(() => {
|
|
1797
|
-
|
|
1798
|
-
const
|
|
1799
|
-
if (imgSrc) {
|
|
1800
|
-
fetch(imgSrc).then((response) => response.blob()).then((blob) => {
|
|
1804
|
+
setLoadingState(true);
|
|
1805
|
+
const ac = new AbortController();
|
|
1806
|
+
if (props.imgSrc) {
|
|
1807
|
+
fetch(props.imgSrc).then((response) => response.blob()).then((blob) => {
|
|
1801
1808
|
setImgSrcUrl(URL.createObjectURL(blob));
|
|
1809
|
+
setLoadingState(false);
|
|
1802
1810
|
});
|
|
1803
1811
|
}
|
|
1812
|
+
return () => {
|
|
1813
|
+
ac.abort();
|
|
1814
|
+
};
|
|
1815
|
+
}, [props.imgSrc]);
|
|
1816
|
+
if (loadingState) {
|
|
1817
|
+
return /* @__PURE__ */ jsx("div", {
|
|
1818
|
+
style: {
|
|
1819
|
+
height: "100%",
|
|
1820
|
+
width: "100%",
|
|
1821
|
+
display: "flex",
|
|
1822
|
+
alignItems: "center",
|
|
1823
|
+
alignContent: "center",
|
|
1824
|
+
justifyContent: "center",
|
|
1825
|
+
background: !props.lightboxMode ? "rgba(0, 0, 0, 0.157)" : "",
|
|
1826
|
+
border: !props.lightboxMode ? "1px solid rgba(0, 0, 0,0.3)" : ""
|
|
1827
|
+
},
|
|
1828
|
+
children: /* @__PURE__ */ jsx(Loading, {})
|
|
1829
|
+
});
|
|
1830
|
+
}
|
|
1831
|
+
return /* @__PURE__ */ jsx("img", {
|
|
1832
|
+
src: imgSrcUrl,
|
|
1833
|
+
alt: "",
|
|
1834
|
+
id: props.id,
|
|
1835
|
+
style: __spreadValues({}, props.style),
|
|
1836
|
+
onClick: props.onClick
|
|
1837
|
+
});
|
|
1838
|
+
};
|
|
1839
|
+
const ImgLightbox = (props) => {
|
|
1840
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1841
|
+
const [imgSrcUrl, setImgSrcUrl] = useState("");
|
|
1842
|
+
const [modalImgIndex, setModalImgIndex] = useState(props.currentImgIndex);
|
|
1843
|
+
useCallback(() => setModalImgIndex(modalImgIndex + 1), [modalImgIndex]);
|
|
1844
|
+
useCallback(() => setModalImgIndex(modalImgIndex - 1), [modalImgIndex]);
|
|
1845
|
+
React.useEffect(() => {
|
|
1846
|
+
var _a2, _b2;
|
|
1847
|
+
const imgSrc = ((_a2 = props.imgList[modalImgIndex]) == null ? void 0 : _a2.fullSrc) ? props.imgList[modalImgIndex].fullSrc : ((_b2 = props.imgList[modalImgIndex]) == null ? void 0 : _b2.thumbnailSrc) ? props.imgList[modalImgIndex].thumbnailSrc : null;
|
|
1848
|
+
if (imgSrc)
|
|
1849
|
+
setImgSrcUrl(imgSrc);
|
|
1804
1850
|
document.body.style.overflow = "hidden";
|
|
1805
|
-
}, [
|
|
1851
|
+
}, [modalImgIndex]);
|
|
1806
1852
|
return /* @__PURE__ */ jsxs("div", {
|
|
1807
1853
|
className: "reactPic-lightbox",
|
|
1808
1854
|
style: styles.lightbox,
|
|
@@ -1816,25 +1862,19 @@ const ImgLightbox = (props) => {
|
|
|
1816
1862
|
children: [/* @__PURE__ */ jsx("div", {
|
|
1817
1863
|
style: styles.topCustomContent,
|
|
1818
1864
|
className: "reactPic-topCustomContent",
|
|
1819
|
-
children: (
|
|
1865
|
+
children: (_a = props.topCustomContent) == null ? void 0 : _a.call(props, {
|
|
1820
1866
|
closeLightbox: props.onClose,
|
|
1821
|
-
imgObject: props.
|
|
1867
|
+
imgObject: props.imgList[modalImgIndex]
|
|
1822
1868
|
})
|
|
1823
|
-
}),
|
|
1824
|
-
style: {
|
|
1825
|
-
display: "block",
|
|
1826
|
-
margin: "auto"
|
|
1827
|
-
},
|
|
1828
|
-
children: /* @__PURE__ */ jsx(Loading, {})
|
|
1829
|
-
}) : /* @__PURE__ */ jsxs("div", {
|
|
1869
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
1830
1870
|
children: [/* @__PURE__ */ jsx(TransformWrapper, {
|
|
1831
1871
|
children: /* @__PURE__ */ jsx(TransformComponent, {
|
|
1832
1872
|
wrapperStyle: {
|
|
1833
1873
|
overflow: "visible"
|
|
1834
1874
|
},
|
|
1835
|
-
children: /* @__PURE__ */ jsx(
|
|
1836
|
-
|
|
1837
|
-
|
|
1875
|
+
children: /* @__PURE__ */ jsx(ImgLazyLoading, {
|
|
1876
|
+
lightboxMode: true,
|
|
1877
|
+
imgSrc: imgSrcUrl,
|
|
1838
1878
|
id: "lightboxImg",
|
|
1839
1879
|
style: {
|
|
1840
1880
|
maxWidth: "80vw",
|
|
@@ -1844,7 +1884,7 @@ const ImgLightbox = (props) => {
|
|
|
1844
1884
|
}
|
|
1845
1885
|
})
|
|
1846
1886
|
})
|
|
1847
|
-
}), props.
|
|
1887
|
+
}), modalImgIndex - 1 >= 0 && !((_b = props.options) == null ? void 0 : _b.hidePagination) && /* @__PURE__ */ jsx("div", {
|
|
1848
1888
|
className: "react-lightbox-prevBtn",
|
|
1849
1889
|
style: {
|
|
1850
1890
|
position: "absolute",
|
|
@@ -1856,9 +1896,9 @@ const ImgLightbox = (props) => {
|
|
|
1856
1896
|
color: "white",
|
|
1857
1897
|
display: ((_c = props.options) == null ? void 0 : _c.hidePagination) ? "none" : "inherit"
|
|
1858
1898
|
},
|
|
1859
|
-
onClick:
|
|
1899
|
+
onClick: modalImgIndex - 1 >= 0 ? () => setModalImgIndex(modalImgIndex - 1) : void 0,
|
|
1860
1900
|
children: "\u2039"
|
|
1861
|
-
}), props.
|
|
1901
|
+
}), modalImgIndex + 1 < props.imgList.length && !((_d = props.options) == null ? void 0 : _d.hidePagination) && /* @__PURE__ */ jsx("div", {
|
|
1862
1902
|
className: "react-lightbox-nextBtn",
|
|
1863
1903
|
style: {
|
|
1864
1904
|
position: "absolute",
|
|
@@ -1868,61 +1908,21 @@ const ImgLightbox = (props) => {
|
|
|
1868
1908
|
fontSize: 50,
|
|
1869
1909
|
cursor: "pointer",
|
|
1870
1910
|
color: "white",
|
|
1871
|
-
display: ((
|
|
1911
|
+
display: ((_e = props.options) == null ? void 0 : _e.hidePagination) ? "none" : "inherit"
|
|
1872
1912
|
},
|
|
1873
|
-
onClick: props.
|
|
1913
|
+
onClick: modalImgIndex + 1 < props.imgList.length ? () => setModalImgIndex(modalImgIndex + 1) : void 0,
|
|
1874
1914
|
children: "\u203A"
|
|
1875
1915
|
})]
|
|
1876
1916
|
}), /* @__PURE__ */ jsx("div", {
|
|
1877
1917
|
style: styles.bottomCustomContent,
|
|
1878
1918
|
className: "reactPic-bottomCustomContent",
|
|
1879
|
-
children: (
|
|
1919
|
+
children: (_f = props.bottomCustomContent) == null ? void 0 : _f.call(props, {
|
|
1880
1920
|
closeLightbox: props.onClose,
|
|
1881
|
-
imgObject: props.
|
|
1921
|
+
imgObject: props.imgList[modalImgIndex]
|
|
1882
1922
|
})
|
|
1883
1923
|
})]
|
|
1884
1924
|
});
|
|
1885
1925
|
};
|
|
1886
|
-
const ImgLazyLoading = (props) => {
|
|
1887
|
-
var _a;
|
|
1888
|
-
const [imgSrcUrl, setImgSrcUrl] = React.useState("");
|
|
1889
|
-
const Loading = ((_a = props.options) == null ? void 0 : _a.customLoadComponent) !== void 0 ? props.options.customLoadComponent : CircularLoading;
|
|
1890
|
-
React.useEffect(() => {
|
|
1891
|
-
const ac = new AbortController();
|
|
1892
|
-
if (props.imgSrc) {
|
|
1893
|
-
fetch(props.imgSrc).then((response) => response.blob()).then((blob) => {
|
|
1894
|
-
setImgSrcUrl(URL.createObjectURL(blob));
|
|
1895
|
-
});
|
|
1896
|
-
}
|
|
1897
|
-
return () => {
|
|
1898
|
-
ac.abort();
|
|
1899
|
-
};
|
|
1900
|
-
}, [props.imgSrc]);
|
|
1901
|
-
if (imgSrcUrl) {
|
|
1902
|
-
return /* @__PURE__ */ jsx("img", {
|
|
1903
|
-
src: imgSrcUrl,
|
|
1904
|
-
alt: "",
|
|
1905
|
-
style: __spreadValues({}, props.style),
|
|
1906
|
-
onClick: () => {
|
|
1907
|
-
props.onClick();
|
|
1908
|
-
}
|
|
1909
|
-
});
|
|
1910
|
-
} else {
|
|
1911
|
-
return /* @__PURE__ */ jsx("div", {
|
|
1912
|
-
style: {
|
|
1913
|
-
height: "100%",
|
|
1914
|
-
width: "100%",
|
|
1915
|
-
display: "flex",
|
|
1916
|
-
alignItems: "center",
|
|
1917
|
-
alignContent: "center",
|
|
1918
|
-
justifyContent: "center",
|
|
1919
|
-
background: "rgba(0, 0, 0, 0.157)",
|
|
1920
|
-
border: "1px solid rgba(0, 0, 0,0.3)"
|
|
1921
|
-
},
|
|
1922
|
-
children: /* @__PURE__ */ jsx(Loading, {})
|
|
1923
|
-
});
|
|
1924
|
-
}
|
|
1925
|
-
};
|
|
1926
1926
|
function ImgGallery(props) {
|
|
1927
1927
|
var _a;
|
|
1928
1928
|
return /* @__PURE__ */ jsx("div", {
|
|
@@ -1981,11 +1981,13 @@ function PicGallery(props) {
|
|
|
1981
1981
|
if (typeof props.setExtLightboxChildren == "function") {
|
|
1982
1982
|
if (open) {
|
|
1983
1983
|
props.setExtLightboxChildren(/* @__PURE__ */ jsx(ImgLightbox, {
|
|
1984
|
-
|
|
1984
|
+
open,
|
|
1985
|
+
currentImgIndex: modalImgIndex,
|
|
1986
|
+
imgList: props.imgList,
|
|
1987
|
+
topCustomContent: props.topCustomContent,
|
|
1988
|
+
bottomCustomContent: props.bottomCustomContent,
|
|
1985
1989
|
options,
|
|
1986
|
-
onClose: () =>
|
|
1987
|
-
setOpen(false);
|
|
1988
|
-
}
|
|
1990
|
+
onClose: () => setOpen(false)
|
|
1989
1991
|
}));
|
|
1990
1992
|
} else {
|
|
1991
1993
|
props.setExtLightboxChildren(void 0);
|
|
@@ -1993,20 +1995,25 @@ function PicGallery(props) {
|
|
|
1993
1995
|
}
|
|
1994
1996
|
}, [open]);
|
|
1995
1997
|
const onOpen = useCallback((count) => {
|
|
1996
|
-
setModalImgIndex(count);
|
|
1997
1998
|
setOpen(true);
|
|
1998
|
-
|
|
1999
|
+
setModalImgIndex(count);
|
|
2000
|
+
console.log("modalImgIndex", modalImgIndex);
|
|
2001
|
+
console.log("count", count);
|
|
2002
|
+
}, [modalImgIndex]);
|
|
1999
2003
|
return /* @__PURE__ */ jsxs("div", {
|
|
2000
2004
|
className: "reactPic-wrapper",
|
|
2001
2005
|
style: styles.Wrapper,
|
|
2002
2006
|
children: [open && !((_a = props.options) == null ? void 0 : _a.externalLightbox) ? /* @__PURE__ */ jsx(ImgLightbox, {
|
|
2003
|
-
|
|
2007
|
+
open,
|
|
2008
|
+
currentImgIndex: modalImgIndex,
|
|
2009
|
+
imgList: props.imgList,
|
|
2004
2010
|
topCustomContent: props.topCustomContent,
|
|
2005
2011
|
bottomCustomContent: props.bottomCustomContent,
|
|
2006
2012
|
options,
|
|
2007
|
-
onClose: () =>
|
|
2008
|
-
|
|
2009
|
-
|
|
2013
|
+
onClose: () => {
|
|
2014
|
+
console.log("close");
|
|
2015
|
+
setOpen(false);
|
|
2016
|
+
}
|
|
2010
2017
|
}) : null, /* @__PURE__ */ jsx(ImgGallery$1, {
|
|
2011
2018
|
options: props.options,
|
|
2012
2019
|
imgList: props.imgList,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var
|
|
1
|
+
var An=Object.defineProperty,On=Object.defineProperties;var zn=Object.getOwnPropertyDescriptors;var ki=Object.getOwnPropertySymbols;var En=Object.prototype.hasOwnProperty,Dn=Object.prototype.propertyIsEnumerable;var Hi=(p,y,b)=>y in p?An(p,y,{enumerable:!0,configurable:!0,writable:!0,value:b}):p[y]=b,B=(p,y)=>{for(var b in y||(y={}))En.call(y,b)&&Hi(p,b,y[b]);if(ki)for(var b of ki(y))Dn.call(y,b)&&Hi(p,b,y[b]);return p},Zi=(p,y)=>On(p,zn(y));(function(p,y){typeof exports=="object"&&typeof module!="undefined"?module.exports=y(require("react")):typeof define=="function"&&define.amd?define(["react"],y):(p=typeof globalThis!="undefined"?globalThis:p||self,p["react-pic-gallery"]=y(p.React))})(this,function(p){"use strict";function y(i){return i&&typeof i=="object"&&"default"in i?i:{default:i}}var b=y(p),U={exports:{}},M={};/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var
|
|
5
|
+
*/var ti=Object.getOwnPropertySymbols,Ki=Object.prototype.hasOwnProperty,Vi=Object.prototype.propertyIsEnumerable;function Qi(i){if(i==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(i)}function Fi(){try{if(!Object.assign)return!1;var i=new String("abc");if(i[5]="de",Object.getOwnPropertyNames(i)[0]==="5")return!1;for(var t={},e=0;e<10;e++)t["_"+String.fromCharCode(e)]=e;var n=Object.getOwnPropertyNames(t).map(function(o){return t[o]});if(n.join("")!=="0123456789")return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(o){r[o]=o}),Object.keys(Object.assign({},r)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}Fi();/** @license React v17.0.2
|
|
6
6
|
* react-jsx-runtime.production.min.js
|
|
7
7
|
*
|
|
8
8
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
9
9
|
*
|
|
10
10
|
* This source code is licensed under the MIT license found in the
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*/var Qi=y.default,ti=60103;if(B.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var oi=Symbol.for;ti=oi("react.element"),B.Fragment=oi("react.fragment")}var Fi=Qi.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qi=Object.prototype.hasOwnProperty,Gi={key:!0,ref:!0,__self:!0,__source:!0};function ai(i,r,e){var n,t={},o=null,a=null;e!==void 0&&(o=""+e),r.key!==void 0&&(o=""+r.key),r.ref!==void 0&&(a=r.ref);for(n in r)qi.call(r,n)&&!Gi.hasOwnProperty(n)&&(t[n]=r[n]);if(i&&i.defaultProps)for(n in r=i.defaultProps,r)t[n]===void 0&&(t[n]=r[n]);return{$$typeof:ti,type:i,key:o,ref:a,props:t,_owner:Fi.current}}B.jsx=ai,B.jsxs=ai,Q.exports=B;const h=Q.exports.jsx,F=Q.exports.jsxs;var q=function(i,r){return q=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t])},q(i,r)};function $i(i,r){if(typeof r!="function"&&r!==null)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");q(i,r);function e(){this.constructor=i}i.prototype=r===null?Object.create(r):(e.prototype=r.prototype,new e)}var O=function(){return O=Object.assign||function(r){for(var e,n=1,t=arguments.length;n<t;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=e[o])}return r},O.apply(this,arguments)};function li(i,r,e){if(e||arguments.length===2)for(var n=0,t=r.length,o;n<t;n++)(o||!(n in r))&&(o||(o=Array.prototype.slice.call(r,0,n)),o[n]=r[n]);return i.concat(o||r)}var Y=function(i,r){return Number(i.toFixed(r))},Ji=function(i,r){return typeof i=="number"?i:r},C=function(i,r,e){e&&typeof e=="function"&&e(i,r)},xi=function(i){return-Math.cos(i*Math.PI)/2+.5},Ii=function(i){return i},ie=function(i){return i*i},ee=function(i){return i*(2-i)},ne=function(i){return i<.5?2*i*i:-1+(4-2*i)*i},re=function(i){return i*i*i},te=function(i){return--i*i*i+1},oe=function(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},ae=function(i){return i*i*i*i},le=function(i){return 1- --i*i*i*i},se=function(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},ue=function(i){return i*i*i*i*i},de=function(i){return 1+--i*i*i*i*i},fe=function(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i},si={easeOut:xi,linear:Ii,easeInQuad:ie,easeOutQuad:ee,easeInOutQuad:ne,easeInCubic:re,easeOutCubic:te,easeInOutCubic:oe,easeInQuart:ae,easeOutQuart:le,easeInOutQuart:se,easeInQuint:ue,easeOutQuint:de,easeInOutQuint:fe},ui=function(i){typeof i=="number"&&cancelAnimationFrame(i)},_=function(i){!i.mounted||(ui(i.animation),i.animate=!1,i.animation=null,i.velocity=null)};function di(i,r,e,n){if(!!i.mounted){var t=new Date().getTime(),o=1;_(i),i.animation=function(){if(!i.mounted)return ui(i.animation);var a=new Date().getTime()-t,l=a/e,s=si[r],u=s(l);a>=e?(n(o),i.animation=null):i.animation&&(n(u),requestAnimationFrame(i.animation))},requestAnimationFrame(i.animation)}}function z(i,r,e,n){var t=me(r);if(!(!i.mounted||!t)){var o=i.setTransformState,a=i.transformState,l=a.scale,s=a.positionX,u=a.positionY,d=r.scale-l,f=r.positionX-s,m=r.positionY-u;e===0?o(r.scale,r.positionX,r.positionY):di(i,n,e,function(v){var c=l+d*v,g=s+f*v,S=u+m*v;o(c,g,S)})}}function me(i){var r=i.scale,e=i.positionX,n=i.positionY;return!(isNaN(r)||isNaN(e)||isNaN(n))}function ve(i,r,e){var n=i.offsetWidth,t=i.offsetHeight,o=r.offsetWidth,a=r.offsetHeight,l=o*e,s=a*e,u=n-l,d=t-s;return{wrapperWidth:n,wrapperHeight:t,newContentWidth:l,newDiffWidth:u,newContentHeight:s,newDiffHeight:d}}var pe=function(i,r,e,n,t,o,a){var l=i>r?e*(a?1:.5):0,s=n>t?o*(a?1:.5):0,u=i-r-l,d=l,f=n-t-s,m=s;return{minPositionX:u,maxPositionX:d,minPositionY:f,maxPositionY:m}},G=function(i,r){var e=i.wrapperComponent,n=i.contentComponent,t=i.setup.centerZoomedOut;if(!e||!n)throw new Error("Components are not mounted");var o=ve(e,n,r),a=o.wrapperWidth,l=o.wrapperHeight,s=o.newContentWidth,u=o.newDiffWidth,d=o.newContentHeight,f=o.newDiffHeight,m=pe(a,s,u,l,d,f,Boolean(t));return m},W=function(i,r){var e=G(i,r);return i.bounds=e,e};function K(i,r,e,n,t,o,a){var l=e.minPositionX,s=e.minPositionY,u=e.maxPositionX,d=e.maxPositionY,f=0,m=0;a&&(f=t,m=o);var v=$(i,l-f,u+f,n),c=$(r,s-m,d+m,n);return{x:v,y:c}}var $=function(i,r,e,n){return n?i<r?Y(r,2):i>e?Y(e,2):Y(i,2):Y(i,2)};function V(i,r,e,n,t,o){var a=i.transformState,l=a.scale,s=a.positionX,u=a.positionY,d=n-l;if(typeof r!="number"||typeof e!="number")return console.error("Mouse X and Y position were not provided!"),{x:s,y:u};var f=s-r*d,m=u-e*d,v=K(f,m,t,o,0,0,null);return v}function M(i,r,e,n,t){var o=t?n:0,a=r-o;return!isNaN(e)&&i>=e?e:!isNaN(r)&&i<=a?a:i}var fi=function(i,r){var e=i.setup.panning.excluded,n=i.isInitialized,t=i.wrapperComponent,o=r.target,a=t==null?void 0:t.contains(o),l=n&&o&&a;if(!l)return!1;var s=U(o,e);return!s},mi=function(i){var r=i.isInitialized,e=i.isPanning,n=i.setup,t=n.panning.disabled,o=r&&e&&!t;return!!o},ce=function(i,r){var e=i.transformState,n=e.positionX,t=e.positionY;i.isPanning=!0;var o=r.clientX,a=r.clientY;i.startCoords={x:o-n,y:a-t}},he=function(i,r){var e=r.touches,n=i.transformState,t=n.positionX,o=n.positionY;i.isPanning=!0;var a=e.length===1;if(a){var l=e[0].clientX,s=e[0].clientY;i.startCoords={x:l-t,y:s-o}}};function ge(i){var r=i.transformState,e=r.positionX,n=r.positionY,t=r.scale,o=i.setup,a=o.disabled,l=o.limitToBounds,s=o.centerZoomedOut,u=i.wrapperComponent;if(!(a||!u||!i.bounds)){var d=i.bounds,f=d.maxPositionX,m=d.minPositionX,v=d.maxPositionY,c=d.minPositionY,g=e>f||e<m,S=n>v||n<c,P=e>f?u.offsetWidth:i.setup.minPositionX||0,A=n>v?u.offsetHeight:i.setup.minPositionY||0,X=V(i,P,A,t,i.bounds,l||s),E=X.x,D=X.y;return{scale:t,positionX:g?E:e,positionY:S?D:n}}}function Se(i,r,e,n,t){var o=i.setup.limitToBounds,a=i.wrapperComponent,l=i.bounds,s=i.transformState,u=s.scale,d=s.positionX,f=s.positionY,m=r!==d,v=e!==f,c=!m||!v;if(!(!a||c||!l)){var g=K(r,e,l,o,n,t,a),S=g.x,P=g.y;i.setTransformState(u,S,P)}}var we=function(i,r,e){var n=i.startCoords,t=i.transformState,o=i.setup.panning,a=o.lockAxisX,l=o.lockAxisY,s=t.positionX,u=t.positionY;if(!n)return{x:s,y:u};var d=r-n.x,f=e-n.y,m=a?s:d,v=l?u:f;return{x:m,y:v}},R=function(i,r){var e=i.setup,n=i.transformState,t=n.scale,o=e.minScale;return r>0&&t>=o?r:0},ye=function(i){var r=i.mounted,e=i.setup,n=e.disabled,t=e.velocityAnimation,o=i.transformState.scale,a=t.disabled,l=!a||o>1||!n||r;return!!l},be=function(i){var r=i.mounted,e=i.velocity,n=i.bounds,t=i.setup,o=t.disabled,a=t.velocityAnimation,l=i.transformState.scale,s=a.disabled,u=!s||l>1||!o||r;return!(!u||!e||!n)};function Ce(i,r){var e=i.setup.velocityAnimation,n=e.equalToMove,t=e.animationTime,o=e.sensitivity;return n?t*r*o:t}function vi(i,r,e,n,t,o,a,l,s,u){if(t){if(r>a&&e>a){var d=a+(i-a)*u;return d>s?s:d<a?a:d}if(r<o&&e<o){var d=o+(i-o)*u;return d<l?l:d>o?o:d}}return n?r:$(i,o,a,t)}function Pe(i,r){var e=1;return r?Math.min(e,i.offsetWidth/window.innerWidth):e}function Te(i,r){var e=ye(i);if(!!e){var n=i.lastMousePosition,t=i.velocityTime,o=i.setup,a=i.wrapperComponent,l=o.velocityAnimation.equalToMove,s=Date.now();if(n&&t&&a){var u=Pe(a,l),d=r.x-n.x,f=r.y-n.y,m=d/u,v=f/u,c=s-t,g=d*d+f*f,S=Math.sqrt(g)/c;i.velocity={velocityX:m,velocityY:v,total:S}}i.lastMousePosition=r,i.velocityTime=s}}function Ye(i){var r=i.velocity,e=i.bounds,n=i.setup,t=i.wrapperComponent,o=be(i);if(!(!o||!r||!e||!t)){var a=r.velocityX,l=r.velocityY,s=r.total,u=e.maxPositionX,d=e.minPositionX,f=e.maxPositionY,m=e.minPositionY,v=n.limitToBounds,c=n.alignmentAnimation,g=n.zoomAnimation,S=n.panning,P=S.lockAxisY,A=S.lockAxisX,X=g.animationType,E=c.sizeX,D=c.sizeY,N=c.velocityAlignmentTime,L=N,Z=Ce(i,s),vn=Math.max(Z,L),pn=R(i,E),cn=R(i,D),Di=pn*t.offsetWidth/100,Ni=cn*t.offsetHeight/100,hn=u+Di,gn=d-Di,Sn=f+Ni,wn=m-Ni,Wi=i.transformState,yn=new Date().getTime();di(i,X,vn,function(bn){var ii=i.transformState,Cn=ii.scale,ei=ii.positionX,ni=ii.positionY,Pn=new Date().getTime()-yn,Tn=Pn/L,Yn=si[c.animationType],ji=1-Yn(Math.min(1,Tn)),Li=1-bn,ki=ei+a*Li,Bi=ni+l*Li,Xn=vi(ki,Wi.positionX,ei,A,v,d,u,gn,hn,ji),On=vi(Bi,Wi.positionY,ni,P,v,m,f,wn,Sn,ji);(ei!==ki||ni!==Bi)&&i.setTransformState(Cn,Xn,On)})}}function pi(i,r){var e=i.transformState.scale;_(i),W(i,e),r.touches?he(i,r):ce(i,r)}function ci(i,r,e){var n=i.startCoords,t=i.setup,o=t.alignmentAnimation,a=o.sizeX,l=o.sizeY;if(!!n){var s=we(i,r,e),u=s.x,d=s.y,f=R(i,a),m=R(i,l);Te(i,{x:u,y:d}),Se(i,u,d,f,m)}}function Xe(i){if(i.isPanning){var r=i.setup.panning.velocityDisabled,e=i.velocity,n=i.wrapperComponent,t=i.contentComponent;i.isPanning=!1,i.animate=!1,i.animation=null;var o=n==null?void 0:n.getBoundingClientRect(),a=t==null?void 0:t.getBoundingClientRect(),l=(o==null?void 0:o.width)||0,s=(o==null?void 0:o.height)||0,u=(a==null?void 0:a.width)||0,d=(a==null?void 0:a.height)||0,f=l<u||s<d,m=!r&&e&&(e==null?void 0:e.total)>.1&&f;m?Ye(i):hi(i)}}function hi(i){var r=i.transformState.scale,e=i.setup,n=e.minScale,t=e.alignmentAnimation,o=t.disabled,a=t.sizeX,l=t.sizeY,s=t.animationTime,u=t.animationType,d=o||r<n||!a&&!l;if(!d){var f=ge(i);f&&z(i,f,s,u)}}function gi(i,r,e){var n=i.transformState.scale,t=i.wrapperComponent,o=i.setup,a=o.minScale,l=o.limitToBounds,s=o.zoomAnimation,u=s.disabled,d=s.animationTime,f=s.animationType,m=u||n>=a;if((n>=1||l)&&hi(i),!(m||!t||!i.mounted)){var v=r||t.offsetWidth/2,c=e||t.offsetHeight/2,g=J(i,a,v,c);g&&z(i,g,d,f)}}function J(i,r,e,n){var t=i.setup,o=t.minScale,a=t.maxScale,l=t.limitToBounds,s=M(Y(r,2),o,a,0,!1),u=W(i,s),d=V(i,e,n,s,u,l),f=d.x,m=d.y;return{scale:s,positionX:f,positionY:m}}var j={previousScale:1,scale:1,positionX:0,positionY:0},Oe=O(O({},j),{setComponents:function(){},contextInstance:null}),H={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},Si=function(i){var r,e,n,t;return{previousScale:(r=i.initialScale)!==null&&r!==void 0?r:j.scale,scale:(e=i.initialScale)!==null&&e!==void 0?e:j.scale,positionX:(n=i.initialPositionX)!==null&&n!==void 0?n:j.positionX,positionY:(t=i.initialPositionY)!==null&&t!==void 0?t:j.positionY}},wi=function(i){var r=O({},H);return Object.keys(i).forEach(function(e){var n=typeof i[e]!="undefined",t=typeof H[e]!="undefined";if(t&&n){var o=Object.prototype.toString.call(H[e]),a=o==="[object Object]",l=o==="[object Array]";a?r[e]=O(O({},H[e]),i[e]):l?r[e]=li(li([],H[e]),i[e]):r[e]=i[e]}}),r},yi=function(i,r,e){var n=i.transformState.scale,t=i.wrapperComponent,o=i.setup,a=o.maxScale,l=o.minScale,s=o.zoomAnimation,u=s.size;if(!t)throw new Error("Wrapper is not mounted");var d=n*Math.exp(r*e),f=M(Y(d,3),l,a,u,!1);return f};function bi(i,r,e,n,t){var o=i.wrapperComponent,a=i.transformState,l=a.scale,s=a.positionX,u=a.positionY;if(!o)return console.error("No WrapperComponent found");var d=o.offsetWidth,f=o.offsetHeight,m=(d/2-s)/l,v=(f/2-u)/l,c=yi(i,r,e),g=J(i,c,m,v);if(!g)return console.error("Error during zoom event. New transformation state was not calculated.");z(i,g,n,t)}function Ci(i,r,e){var n=i.setup,t=i.wrapperComponent,o=n.limitToBounds,a=Si(i.props),l=i.transformState,s=l.scale,u=l.positionX,d=l.positionY;if(!!t){var f=G(i,a.scale),m=K(a.positionX,a.positionY,f,o,0,0,t),v={scale:a.scale,positionX:m.x,positionY:m.y};s===a.scale&&u===a.positionX&&d===a.positionY||z(i,v,r,e)}}function _e(i,r,e){var n=i.wrapperComponent,t=i.setup,o=t.limitToBounds,a=t.minScale,l=t.maxScale;if(!n)return j;var s=n.getBoundingClientRect(),u=Ae(r),d=u.x,f=u.y,m=r.offsetWidth,v=r.offsetHeight,c=n.offsetWidth/m,g=n.offsetHeight/v,S=M(e||Math.min(c,g),a,l,0,!1),P=(s.width-m*S)/2,A=(s.height-v*S)/2,X=(s.left-d)*S+P,E=(s.top-f)*S+A,D=G(i,S),N=K(X,E,D,o,0,0,n),L=N.x,Z=N.y;return{positionX:L,positionY:Z,scale:S}}function Ae(i){for(var r=i,e=0,n=0;r;)e+=r.offsetLeft,n+=r.offsetTop,r=r.offsetParent;return{x:e,y:n}}function ze(i){if(i){if((i==null?void 0:i.offsetWidth)===void 0||(i==null?void 0:i.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var Ee=function(i){return function(r,e,n){r===void 0&&(r=.5),e===void 0&&(e=300),n===void 0&&(n="easeOut"),bi(i,1,r,e,n)}},De=function(i){return function(r,e,n){r===void 0&&(r=.5),e===void 0&&(e=300),n===void 0&&(n="easeOut"),bi(i,-1,r,e,n)}},Ne=function(i){return function(r,e,n,t,o){t===void 0&&(t=300),o===void 0&&(o="easeOut");var a=i.transformState,l=a.positionX,s=a.positionY,u=a.scale,d=i.wrapperComponent,f=i.contentComponent,m=i.setup.disabled;if(!(m||!d||!f)){var v={positionX:isNaN(r)?l:r,positionY:isNaN(e)?s:e,scale:isNaN(n)?u:n};z(i,v,t,o)}}},We=function(i){return function(r,e){r===void 0&&(r=200),e===void 0&&(e="easeOut"),Ci(i,r,e)}},je=function(i){return function(r,e,n){e===void 0&&(e=200),n===void 0&&(n="easeOut");var t=i.transformState,o=i.wrapperComponent,a=i.contentComponent;if(o&&a){var l=Ti(r||t.scale,o,a);z(i,l,e,n)}}},Le=function(i){return function(r,e,n,t){n===void 0&&(n=600),t===void 0&&(t="easeOut"),_(i);var o=i.wrapperComponent,a=typeof r=="string"?document.getElementById(r):r;if(o&&ze(a)&&a&&o.contains(a)){var l=_e(i,a,e);z(i,l,n,t)}}},w=function(i){return{instance:i,state:i.transformState,zoomIn:Ee(i),zoomOut:De(i),setTransform:Ne(i),resetTransform:We(i),centerView:je(i),zoomToElement:Le(i)}},x=!1;function I(){try{var i={get passive(){return x=!0,!1}};return i}catch{return x=!1,x}}var U=function(i,r){var e=i.tagName.toUpperCase(),n=r.find(function(o){return o.toUpperCase()===e});if(n)return!0;var t=r.find(function(o){return i.classList.contains(o)});return!!t},Pi=function(i){i&&clearTimeout(i)},ke=function(i,r,e){return"translate3d("+i+"px, "+r+"px, 0) scale("+e+")"},Ti=function(i,r,e){var n=e.offsetWidth*i,t=e.offsetHeight*i,o=(r.offsetWidth-n)/2,a=(r.offsetHeight-t)/2;return{scale:i,positionX:o,positionY:a}},Be=function(i,r){var e=i.setup.wheel,n=e.disabled,t=e.wheelDisabled,o=e.touchPadDisabled,a=e.excluded,l=i.isInitialized,s=i.isPanning,u=r.target,d=l&&!s&&!n&&u;if(!d||t&&!r.ctrlKey||o&&r.ctrlKey)return!1;var f=U(u,a);return!f};function Me(i,r){var e=i?i.deltaY<0?1:-1:0,n=Ji(r,e);return n}function Yi(i,r,e){var n=r.getBoundingClientRect(),t=0,o=0;if("clientX"in i)t=(i.clientX-n.left)/e,o=(i.clientY-n.top)/e;else{var a=i.touches[0];t=(a.clientX-n.left)/e,o=(a.clientY-n.top)/e}return(isNaN(t)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:t,y:o}}var He=function(i,r,e,n,t){var o=i.transformState.scale,a=i.wrapperComponent,l=i.setup,s=l.maxScale,u=l.minScale,d=l.zoomAnimation,f=d.size,m=d.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+r*(o-o*e)*e;if(t)return v;var c=n?!1:!m,g=M(Y(v,3),u,s,f,c);return g},Ze=function(i,r){var e=i.previousWheelEvent,n=i.transformState.scale,t=i.setup,o=t.maxScale,a=t.minScale;return e?n<o||n>a||Math.sign(e.deltaY)!==Math.sign(r.deltaY)||e.deltaY>0&&e.deltaY<r.deltaY||e.deltaY<0&&e.deltaY>r.deltaY||Math.sign(e.deltaY)!==Math.sign(r.deltaY):!1},Ke=function(i,r){var e=i.setup.pinch,n=e.disabled,t=e.excluded,o=i.isInitialized,a=r.target,l=o&&!n&&a;if(!l)return!1;var s=U(a,t);return!s},Ve=function(i){var r=i.setup.pinch.disabled,e=i.isInitialized,n=i.pinchStartDistance,t=e&&!r&&n;return!!t},Re=function(i,r,e){var n=e.getBoundingClientRect(),t=i.touches,o=Y(t[0].clientX-n.left,5),a=Y(t[0].clientY-n.top,5),l=Y(t[1].clientX-n.left,5),s=Y(t[1].clientY-n.top,5);return{x:(o+l)/2/r,y:(a+s)/2/r}},Xi=function(i){return Math.sqrt(Math.pow(i.touches[0].pageX-i.touches[1].pageX,2)+Math.pow(i.touches[0].pageY-i.touches[1].pageY,2))},Ue=function(i,r){var e=i.pinchStartScale,n=i.pinchStartDistance,t=i.setup,o=t.maxScale,a=t.minScale,l=t.zoomAnimation,s=l.size,u=l.disabled;if(!e||n===null||!r)throw new Error("Pinch touches distance was not provided");if(r<0)return i.transformState.scale;var d=r/n,f=d*e;return M(Y(f,2),a,o,s,!u)},Qe=160,Fe=100,qe=function(i,r){var e=i.props,n=e.onWheelStart,t=e.onZoomStart;i.wheelStopEventTimer||(_(i),C(w(i),r,n),C(w(i),r,t))},Ge=function(i,r){var e=i.props,n=e.onWheel,t=e.onZoom,o=i.contentComponent,a=i.setup,l=i.transformState,s=l.scale,u=a.limitToBounds,d=a.centerZoomedOut,f=a.zoomAnimation,m=a.wheel,v=f.size,c=f.disabled,g=m.step;if(!o)throw new Error("Component not mounted");r.preventDefault(),r.stopPropagation();var S=Me(r,null),P=He(i,S,g,!r.ctrlKey);if(s!==P){var A=W(i,P),X=Yi(r,o,s),E=c||v===0||d,D=u&&E,N=V(i,X.x,X.y,P,A,D),L=N.x,Z=N.y;i.previousWheelEvent=r,i.setTransformState(P,L,Z),C(w(i),r,n),C(w(i),r,t)}},$e=function(i,r){var e=i.props,n=e.onWheelStop,t=e.onZoomStop;Pi(i.wheelAnimationTimer),i.wheelAnimationTimer=setTimeout(function(){!i.mounted||(gi(i,r.x,r.y),i.wheelAnimationTimer=null)},Fe);var o=Ze(i,r);o&&(Pi(i.wheelStopEventTimer),i.wheelStopEventTimer=setTimeout(function(){!i.mounted||(i.wheelStopEventTimer=null,C(w(i),r,n),C(w(i),r,t))},Qe))},Je=function(i,r){var e=Xi(r);i.pinchStartDistance=e,i.lastDistance=e,i.pinchStartScale=i.transformState.scale,i.isPanning=!1,_(i)},xe=function(i,r){var e=i.contentComponent,n=i.pinchStartDistance,t=i.transformState.scale,o=i.setup,a=o.limitToBounds,l=o.centerZoomedOut,s=o.zoomAnimation,u=s.disabled,d=s.size;if(!(n===null||!e)){var f=Re(r,t,e);if(!(!isFinite(f.x)||!isFinite(f.y))){var m=Xi(r),v=Ue(i,m);if(v!==t){var c=W(i,v),g=u||d===0||l,S=a&&g,P=V(i,f.x,f.y,v,c,S),A=P.x,X=P.y;i.pinchMidpoint=f,i.lastDistance=m,i.setTransformState(v,A,X)}}}},Ie=function(i){var r=i.pinchMidpoint;i.velocity=null,i.lastDistance=null,i.pinchMidpoint=null,i.pinchStartScale=null,i.pinchStartDistance=null,gi(i,r==null?void 0:r.x,r==null?void 0:r.y)};function en(i,r){var e=i.setup.doubleClick,n=e.disabled,t=e.mode,o=e.step,a=e.animationTime,l=e.animationType;if(!n){if(t==="reset")return Ci(i,a,l);var s=i.transformState.scale,u=i.contentComponent;if(!u)return console.error("No ContentComponent found");var d=t==="zoomOut"?-1:1,f=yi(i,d,o),m=Yi(r,u,s),v=J(i,f,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");z(i,v,a,l)}}var nn=function(i,r){var e=i.isInitialized,n=i.setup,t=i.wrapperComponent,o=n.doubleClick,a=o.disabled,l=o.excluded,s=r.target,u=t==null?void 0:t.contains(s),d=e&&s&&u&&!a;if(!d)return!1;var f=U(s,l);return!(f||!d)},Oi=y.default.createContext(Oe),rn=function(i){$i(r,i);function r(){var e=i!==null&&i.apply(this,arguments)||this;return e.mounted=!0,e.transformState=Si(e.props),e.setup=wi(e.props),e.wrapperComponent=null,e.contentComponent=null,e.isInitialized=!1,e.bounds=null,e.previousWheelEvent=null,e.wheelStopEventTimer=null,e.wheelAnimationTimer=null,e.isPanning=!1,e.startCoords=null,e.lastTouch=null,e.distance=null,e.lastDistance=null,e.pinchStartDistance=null,e.pinchStartScale=null,e.pinchMidpoint=null,e.velocity=null,e.velocityTime=null,e.lastMousePosition=null,e.animate=!1,e.animation=null,e.maxBounds=null,e.pressedKeys={},e.handleInitializeWrapperEvents=function(n){var t=I();n.addEventListener("wheel",e.onWheelZoom,t),n.addEventListener("dblclick",e.onDoubleClick,t),n.addEventListener("touchstart",e.onTouchPanningStart,t),n.addEventListener("touchmove",e.onTouchPanning,t),n.addEventListener("touchend",e.onTouchPanningStop,t)},e.handleInitialize=function(){var n=e.setup.centerOnInit;e.applyTransformation(),e.forceUpdate(),n&&(setTimeout(function(){e.mounted&&e.setCenter()},50),setTimeout(function(){e.mounted&&e.setCenter()},100),setTimeout(function(){e.mounted&&e.setCenter()},200))},e.onWheelZoom=function(n){var t=e.setup.disabled;if(!t){var o=Be(e,n);if(!!o){var a=e.isPressingKeys(e.setup.wheel.activationKeys);!a||(qe(e,n),Ge(e,n),$e(e,n))}}},e.onPanningStart=function(n){var t=e.setup.disabled,o=e.props.onPanningStart;if(!t){var a=fi(e,n);if(!!a){var l=e.isPressingKeys(e.setup.panning.activationKeys);!l||(n.preventDefault(),n.stopPropagation(),_(e),pi(e,n),C(w(e),n,o))}}},e.onPanning=function(n){var t=e.setup.disabled,o=e.props.onPanning;if(!t){var a=mi(e);if(!!a){var l=e.isPressingKeys(e.setup.panning.activationKeys);!l||(n.preventDefault(),n.stopPropagation(),ci(e,n.clientX,n.clientY),C(w(e),n,o))}}},e.onPanningStop=function(n){var t=e.props.onPanningStop;e.isPanning&&(Xe(e),C(w(e),n,t))},e.onPinchStart=function(n){var t=e.setup.disabled,o=e.props,a=o.onPinchingStart,l=o.onZoomStart;if(!t){var s=Ke(e,n);!s||(Je(e,n),_(e),C(w(e),n,a),C(w(e),n,l))}},e.onPinch=function(n){var t=e.setup.disabled,o=e.props,a=o.onPinching,l=o.onZoom;if(!t){var s=Ve(e);!s||(n.preventDefault(),n.stopPropagation(),xe(e,n),C(w(e),n,a),C(w(e),n,l))}},e.onPinchStop=function(n){var t=e.props,o=t.onPinchingStop,a=t.onZoomStop;e.pinchStartScale&&(Ie(e),C(w(e),n,o),C(w(e),n,a))},e.onTouchPanningStart=function(n){var t=e.setup.disabled,o=e.props.onPanningStart;if(!t){var a=fi(e,n);if(!!a){var l=e.lastTouch&&+new Date-e.lastTouch<200;if(l&&n.touches.length===1)e.onDoubleClick(n);else{e.lastTouch=+new Date,_(e);var s=n.touches,u=s.length===1,d=s.length===2;u&&(_(e),pi(e,n),C(w(e),n,o)),d&&e.onPinchStart(n)}}}},e.onTouchPanning=function(n){var t=e.setup.disabled,o=e.props.onPanning;if(e.isPanning&&n.touches.length===1){if(t)return;var a=mi(e);if(!a)return;n.preventDefault(),n.stopPropagation();var l=n.touches[0];ci(e,l.clientX,l.clientY),C(w(e),n,o)}else n.touches.length>1&&e.onPinch(n)},e.onTouchPanningStop=function(n){e.onPanningStop(n),e.onPinchStop(n)},e.onDoubleClick=function(n){var t=e.setup.disabled;if(!t){var o=nn(e,n);!o||en(e,n)}},e.clearPanning=function(n){e.isPanning&&e.onPanningStop(n)},e.setKeyPressed=function(n){e.pressedKeys[n.key]=!0},e.setKeyUnPressed=function(n){e.pressedKeys[n.key]=!1},e.isPressingKeys=function(n){return n.length?Boolean(n.find(function(t){return e.pressedKeys[t]})):!0},e.setComponents=function(n,t){e.wrapperComponent=n,e.contentComponent=t,W(e,e.transformState.scale),e.handleInitializeWrapperEvents(n),e.handleInitialize(),e.handleRef(),e.isInitialized=!0,C(w(e),void 0,e.props.onInit)},e.setTransformState=function(n,t,o){!isNaN(n)&&!isNaN(t)&&!isNaN(o)?(n!==e.transformState.scale&&(e.transformState.previousScale=e.transformState.scale,e.transformState.scale=n),e.transformState.positionX=t,e.transformState.positionY=o,e.applyTransformation()):console.error("Detected NaN set state values")},e.setCenter=function(){if(e.wrapperComponent&&e.contentComponent){var n=Ti(e.transformState.scale,e.wrapperComponent,e.contentComponent);e.setTransformState(n.scale,n.positionX,n.positionY)}},e.applyTransformation=function(){if(!(!e.mounted||!e.contentComponent)){var n=e.transformState,t=n.scale,o=n.positionX,a=n.positionY,l=ke(o,a,t);e.contentComponent.style.transform=l,e.handleRef()}},e.handleRef=function(){e.props.setRef(w(e))},e}return r.prototype.componentDidMount=function(){var e=I();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},r.prototype.componentWillUnmount=function(){var e=I();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),_(this)},r.prototype.componentDidUpdate=function(e){e!==this.props&&(W(this,this.transformState.scale),this.setup=wi(this.props))},r.prototype.render=function(){var e=w(this),n=this.props.children,t=typeof n=="function"?n(e):n;return h(Oi.Provider,{value:O(O({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:t})},r}(p.Component),tn=y.default.forwardRef(function(i,r){var e=p.useState(null),n=e[0],t=e[1];return p.useImperativeHandle(r,function(){return n},[n]),h(rn,k({},O({},i,{setRef:t})))});function on(i,r){r===void 0&&(r={});var e=r.insertAt;if(!(!i||typeof document=="undefined")){var n=document.head||document.getElementsByTagName("head")[0],t=document.createElement("style");t.type="text/css",e==="top"&&n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t),t.styleSheet?t.styleSheet.cssText=i:t.appendChild(document.createTextNode(i))}}var an=`.transform-component-module_wrapper__1_Fgj {
|
|
12
|
+
*/var Ui=b.default,ri=60103;if(M.Fragment=60107,typeof Symbol=="function"&&Symbol.for){var oi=Symbol.for;ri=oi("react.element"),M.Fragment=oi("react.fragment")}var qi=Ui.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Ri=Object.prototype.hasOwnProperty,Gi={key:!0,ref:!0,__self:!0,__source:!0};function ai(i,t,e){var n,r={},o=null,a=null;e!==void 0&&(o=""+e),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(n in t)Ri.call(t,n)&&!Gi.hasOwnProperty(n)&&(r[n]=t[n]);if(i&&i.defaultProps)for(n in t=i.defaultProps,t)r[n]===void 0&&(r[n]=t[n]);return{$$typeof:ri,type:i,key:o,ref:a,props:r,_owner:qi.current}}M.jsx=ai,M.jsxs=ai,U.exports=M;const g=U.exports.jsx,q=U.exports.jsxs;var R=function(i,t){return R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])},R(i,t)};function $i(i,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");R(i,t);function e(){this.constructor=i}i.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}var _=function(){return _=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},_.apply(this,arguments)};function si(i,t,e){if(e||arguments.length===2)for(var n=0,r=t.length,o;n<r;n++)(o||!(n in t))&&(o||(o=Array.prototype.slice.call(t,0,n)),o[n]=t[n]);return i.concat(o||t)}var Y=function(i,t){return Number(i.toFixed(t))},xi=function(i,t){return typeof i=="number"?i:t},C=function(i,t,e){e&&typeof e=="function"&&e(i,t)},Ji=function(i){return-Math.cos(i*Math.PI)/2+.5},Ii=function(i){return i},ie=function(i){return i*i},ee=function(i){return i*(2-i)},ne=function(i){return i<.5?2*i*i:-1+(4-2*i)*i},te=function(i){return i*i*i},re=function(i){return--i*i*i+1},oe=function(i){return i<.5?4*i*i*i:(i-1)*(2*i-2)*(2*i-2)+1},ae=function(i){return i*i*i*i},se=function(i){return 1- --i*i*i*i},le=function(i){return i<.5?8*i*i*i*i:1-8*--i*i*i*i},ue=function(i){return i*i*i*i*i},de=function(i){return 1+--i*i*i*i*i},fe=function(i){return i<.5?16*i*i*i*i*i:1+16*--i*i*i*i*i},li={easeOut:Ji,linear:Ii,easeInQuad:ie,easeOutQuad:ee,easeInOutQuad:ne,easeInCubic:te,easeOutCubic:re,easeInOutCubic:oe,easeInQuart:ae,easeOutQuart:se,easeInOutQuart:le,easeInQuint:ue,easeOutQuint:de,easeInOutQuint:fe},ui=function(i){typeof i=="number"&&cancelAnimationFrame(i)},A=function(i){!i.mounted||(ui(i.animation),i.animate=!1,i.animation=null,i.velocity=null)};function di(i,t,e,n){if(!!i.mounted){var r=new Date().getTime(),o=1;A(i),i.animation=function(){if(!i.mounted)return ui(i.animation);var a=new Date().getTime()-r,s=a/e,l=li[t],d=l(s);a>=e?(n(o),i.animation=null):i.animation&&(n(d),requestAnimationFrame(i.animation))},requestAnimationFrame(i.animation)}}function z(i,t,e,n){var r=me(t);if(!(!i.mounted||!r)){var o=i.setTransformState,a=i.transformState,s=a.scale,l=a.positionX,d=a.positionY,u=t.scale-s,f=t.positionX-l,m=t.positionY-d;e===0?o(t.scale,t.positionX,t.positionY):di(i,n,e,function(v){var c=s+u*v,h=l+f*v,S=d+m*v;o(c,h,S)})}}function me(i){var t=i.scale,e=i.positionX,n=i.positionY;return!(isNaN(t)||isNaN(e)||isNaN(n))}function ve(i,t,e){var n=i.offsetWidth,r=i.offsetHeight,o=t.offsetWidth,a=t.offsetHeight,s=o*e,l=a*e,d=n-s,u=r-l;return{wrapperWidth:n,wrapperHeight:r,newContentWidth:s,newDiffWidth:d,newContentHeight:l,newDiffHeight:u}}var pe=function(i,t,e,n,r,o,a){var s=i>t?e*(a?1:.5):0,l=n>r?o*(a?1:.5):0,d=i-t-s,u=s,f=n-r-l,m=l;return{minPositionX:d,maxPositionX:u,minPositionY:f,maxPositionY:m}},G=function(i,t){var e=i.wrapperComponent,n=i.contentComponent,r=i.setup.centerZoomedOut;if(!e||!n)throw new Error("Components are not mounted");var o=ve(e,n,t),a=o.wrapperWidth,s=o.wrapperHeight,l=o.newContentWidth,d=o.newDiffWidth,u=o.newContentHeight,f=o.newDiffHeight,m=pe(a,l,d,s,u,f,Boolean(r));return m},L=function(i,t){var e=G(i,t);return i.bounds=e,e};function K(i,t,e,n,r,o,a){var s=e.minPositionX,l=e.minPositionY,d=e.maxPositionX,u=e.maxPositionY,f=0,m=0;a&&(f=r,m=o);var v=$(i,s-f,d+f,n),c=$(t,l-m,u+m,n);return{x:v,y:c}}var $=function(i,t,e,n){return n?i<t?Y(t,2):i>e?Y(e,2):Y(i,2):Y(i,2)};function V(i,t,e,n,r,o){var a=i.transformState,s=a.scale,l=a.positionX,d=a.positionY,u=n-s;if(typeof t!="number"||typeof e!="number")return console.error("Mouse X and Y position were not provided!"),{x:l,y:d};var f=l-t*u,m=d-e*u,v=K(f,m,r,o,0,0,null);return v}function k(i,t,e,n,r){var o=r?n:0,a=t-o;return!isNaN(e)&&i>=e?e:!isNaN(t)&&i<=a?a:i}var fi=function(i,t){var e=i.setup.panning.excluded,n=i.isInitialized,r=i.wrapperComponent,o=t.target,a=r==null?void 0:r.contains(o),s=n&&o&&a;if(!s)return!1;var l=F(o,e);return!l},mi=function(i){var t=i.isInitialized,e=i.isPanning,n=i.setup,r=n.panning.disabled,o=t&&e&&!r;return!!o},ce=function(i,t){var e=i.transformState,n=e.positionX,r=e.positionY;i.isPanning=!0;var o=t.clientX,a=t.clientY;i.startCoords={x:o-n,y:a-r}},he=function(i,t){var e=t.touches,n=i.transformState,r=n.positionX,o=n.positionY;i.isPanning=!0;var a=e.length===1;if(a){var s=e[0].clientX,l=e[0].clientY;i.startCoords={x:s-r,y:l-o}}};function ge(i){var t=i.transformState,e=t.positionX,n=t.positionY,r=t.scale,o=i.setup,a=o.disabled,s=o.limitToBounds,l=o.centerZoomedOut,d=i.wrapperComponent;if(!(a||!d||!i.bounds)){var u=i.bounds,f=u.maxPositionX,m=u.minPositionX,v=u.maxPositionY,c=u.minPositionY,h=e>f||e<m,S=n>v||n<c,P=e>f?d.offsetWidth:i.setup.minPositionX||0,O=n>v?d.offsetHeight:i.setup.minPositionY||0,X=V(i,P,O,r,i.bounds,s||l),E=X.x,D=X.y;return{scale:r,positionX:h?E:e,positionY:S?D:n}}}function Se(i,t,e,n,r){var o=i.setup.limitToBounds,a=i.wrapperComponent,s=i.bounds,l=i.transformState,d=l.scale,u=l.positionX,f=l.positionY,m=t!==u,v=e!==f,c=!m||!v;if(!(!a||c||!s)){var h=K(t,e,s,o,n,r,a),S=h.x,P=h.y;i.setTransformState(d,S,P)}}var we=function(i,t,e){var n=i.startCoords,r=i.transformState,o=i.setup.panning,a=o.lockAxisX,s=o.lockAxisY,l=r.positionX,d=r.positionY;if(!n)return{x:l,y:d};var u=t-n.x,f=e-n.y,m=a?l:u,v=s?d:f;return{x:m,y:v}},Q=function(i,t){var e=i.setup,n=i.transformState,r=n.scale,o=e.minScale;return t>0&&r>=o?t:0},ye=function(i){var t=i.mounted,e=i.setup,n=e.disabled,r=e.velocityAnimation,o=i.transformState.scale,a=r.disabled,s=!a||o>1||!n||t;return!!s},be=function(i){var t=i.mounted,e=i.velocity,n=i.bounds,r=i.setup,o=r.disabled,a=r.velocityAnimation,s=i.transformState.scale,l=a.disabled,d=!l||s>1||!o||t;return!(!d||!e||!n)};function Ce(i,t){var e=i.setup.velocityAnimation,n=e.equalToMove,r=e.animationTime,o=e.sensitivity;return n?r*t*o:r}function vi(i,t,e,n,r,o,a,s,l,d){if(r){if(t>a&&e>a){var u=a+(i-a)*d;return u>l?l:u<a?a:u}if(t<o&&e<o){var u=o+(i-o)*d;return u<s?s:u>o?o:u}}return n?t:$(i,o,a,r)}function Pe(i,t){var e=1;return t?Math.min(e,i.offsetWidth/window.innerWidth):e}function Te(i,t){var e=ye(i);if(!!e){var n=i.lastMousePosition,r=i.velocityTime,o=i.setup,a=i.wrapperComponent,s=o.velocityAnimation.equalToMove,l=Date.now();if(n&&r&&a){var d=Pe(a,s),u=t.x-n.x,f=t.y-n.y,m=u/d,v=f/d,c=l-r,h=u*u+f*f,S=Math.sqrt(h)/c;i.velocity={velocityX:m,velocityY:v,total:S}}i.lastMousePosition=t,i.velocityTime=l}}function Ye(i){var t=i.velocity,e=i.bounds,n=i.setup,r=i.wrapperComponent,o=be(i);if(!(!o||!t||!e||!r)){var a=t.velocityX,s=t.velocityY,l=t.total,d=e.maxPositionX,u=e.minPositionX,f=e.maxPositionY,m=e.minPositionY,v=n.limitToBounds,c=n.alignmentAnimation,h=n.zoomAnimation,S=n.panning,P=S.lockAxisY,O=S.lockAxisX,X=h.animationType,E=c.sizeX,D=c.sizeY,N=c.velocityAlignmentTime,j=N,Z=Ce(i,l),vn=Math.max(Z,j),pn=Q(i,E),cn=Q(i,D),Di=pn*r.offsetWidth/100,Ni=cn*r.offsetHeight/100,hn=d+Di,gn=u-Di,Sn=f+Ni,wn=m-Ni,Li=i.transformState,yn=new Date().getTime();di(i,X,vn,function(bn){var ii=i.transformState,Cn=ii.scale,ei=ii.positionX,ni=ii.positionY,Pn=new Date().getTime()-yn,Tn=Pn/j,Yn=li[c.animationType],Wi=1-Yn(Math.min(1,Tn)),ji=1-bn,Bi=ei+a*ji,Mi=ni+s*ji,Xn=vi(Bi,Li.positionX,ei,O,v,u,d,gn,hn,Wi),_n=vi(Mi,Li.positionY,ni,P,v,m,f,wn,Sn,Wi);(ei!==Bi||ni!==Mi)&&i.setTransformState(Cn,Xn,_n)})}}function pi(i,t){var e=i.transformState.scale;A(i),L(i,e),t.touches?he(i,t):ce(i,t)}function ci(i,t,e){var n=i.startCoords,r=i.setup,o=r.alignmentAnimation,a=o.sizeX,s=o.sizeY;if(!!n){var l=we(i,t,e),d=l.x,u=l.y,f=Q(i,a),m=Q(i,s);Te(i,{x:d,y:u}),Se(i,d,u,f,m)}}function Xe(i){if(i.isPanning){var t=i.setup.panning.velocityDisabled,e=i.velocity,n=i.wrapperComponent,r=i.contentComponent;i.isPanning=!1,i.animate=!1,i.animation=null;var o=n==null?void 0:n.getBoundingClientRect(),a=r==null?void 0:r.getBoundingClientRect(),s=(o==null?void 0:o.width)||0,l=(o==null?void 0:o.height)||0,d=(a==null?void 0:a.width)||0,u=(a==null?void 0:a.height)||0,f=s<d||l<u,m=!t&&e&&(e==null?void 0:e.total)>.1&&f;m?Ye(i):hi(i)}}function hi(i){var t=i.transformState.scale,e=i.setup,n=e.minScale,r=e.alignmentAnimation,o=r.disabled,a=r.sizeX,s=r.sizeY,l=r.animationTime,d=r.animationType,u=o||t<n||!a&&!s;if(!u){var f=ge(i);f&&z(i,f,l,d)}}function gi(i,t,e){var n=i.transformState.scale,r=i.wrapperComponent,o=i.setup,a=o.minScale,s=o.limitToBounds,l=o.zoomAnimation,d=l.disabled,u=l.animationTime,f=l.animationType,m=d||n>=a;if((n>=1||s)&&hi(i),!(m||!r||!i.mounted)){var v=t||r.offsetWidth/2,c=e||r.offsetHeight/2,h=x(i,a,v,c);h&&z(i,h,u,f)}}function x(i,t,e,n){var r=i.setup,o=r.minScale,a=r.maxScale,s=r.limitToBounds,l=k(Y(t,2),o,a,0,!1),d=L(i,l),u=V(i,e,n,l,d,s),f=u.x,m=u.y;return{scale:l,positionX:f,positionY:m}}var W={previousScale:1,scale:1,positionX:0,positionY:0},_e=_(_({},W),{setComponents:function(){},contextInstance:null}),H={disabled:!1,minPositionX:null,maxPositionX:null,minPositionY:null,maxPositionY:null,minScale:1,maxScale:8,limitToBounds:!0,centerZoomedOut:!1,centerOnInit:!1,wheel:{step:.2,disabled:!1,wheelDisabled:!1,touchPadDisabled:!1,activationKeys:[],excluded:[]},panning:{disabled:!1,velocityDisabled:!1,lockAxisX:!1,lockAxisY:!1,activationKeys:[],excluded:[]},pinch:{step:5,disabled:!1,excluded:[]},doubleClick:{disabled:!1,step:.7,mode:"zoomIn",animationType:"easeOut",animationTime:200,excluded:[]},zoomAnimation:{disabled:!1,size:.4,animationTime:200,animationType:"easeOut"},alignmentAnimation:{disabled:!1,sizeX:100,sizeY:100,animationTime:200,velocityAlignmentTime:400,animationType:"easeOut"},velocityAnimation:{disabled:!1,sensitivity:1,animationTime:400,animationType:"easeOut",equalToMove:!0}},Si=function(i){var t,e,n,r;return{previousScale:(t=i.initialScale)!==null&&t!==void 0?t:W.scale,scale:(e=i.initialScale)!==null&&e!==void 0?e:W.scale,positionX:(n=i.initialPositionX)!==null&&n!==void 0?n:W.positionX,positionY:(r=i.initialPositionY)!==null&&r!==void 0?r:W.positionY}},wi=function(i){var t=_({},H);return Object.keys(i).forEach(function(e){var n=typeof i[e]!="undefined",r=typeof H[e]!="undefined";if(r&&n){var o=Object.prototype.toString.call(H[e]),a=o==="[object Object]",s=o==="[object Array]";a?t[e]=_(_({},H[e]),i[e]):s?t[e]=si(si([],H[e]),i[e]):t[e]=i[e]}}),t},yi=function(i,t,e){var n=i.transformState.scale,r=i.wrapperComponent,o=i.setup,a=o.maxScale,s=o.minScale,l=o.zoomAnimation,d=l.size;if(!r)throw new Error("Wrapper is not mounted");var u=n*Math.exp(t*e),f=k(Y(u,3),s,a,d,!1);return f};function bi(i,t,e,n,r){var o=i.wrapperComponent,a=i.transformState,s=a.scale,l=a.positionX,d=a.positionY;if(!o)return console.error("No WrapperComponent found");var u=o.offsetWidth,f=o.offsetHeight,m=(u/2-l)/s,v=(f/2-d)/s,c=yi(i,t,e),h=x(i,c,m,v);if(!h)return console.error("Error during zoom event. New transformation state was not calculated.");z(i,h,n,r)}function Ci(i,t,e){var n=i.setup,r=i.wrapperComponent,o=n.limitToBounds,a=Si(i.props),s=i.transformState,l=s.scale,d=s.positionX,u=s.positionY;if(!!r){var f=G(i,a.scale),m=K(a.positionX,a.positionY,f,o,0,0,r),v={scale:a.scale,positionX:m.x,positionY:m.y};l===a.scale&&d===a.positionX&&u===a.positionY||z(i,v,t,e)}}function Ae(i,t,e){var n=i.wrapperComponent,r=i.setup,o=r.limitToBounds,a=r.minScale,s=r.maxScale;if(!n)return W;var l=n.getBoundingClientRect(),d=Oe(t),u=d.x,f=d.y,m=t.offsetWidth,v=t.offsetHeight,c=n.offsetWidth/m,h=n.offsetHeight/v,S=k(e||Math.min(c,h),a,s,0,!1),P=(l.width-m*S)/2,O=(l.height-v*S)/2,X=(l.left-u)*S+P,E=(l.top-f)*S+O,D=G(i,S),N=K(X,E,D,o,0,0,n),j=N.x,Z=N.y;return{positionX:j,positionY:Z,scale:S}}function Oe(i){for(var t=i,e=0,n=0;t;)e+=t.offsetLeft,n+=t.offsetTop,t=t.offsetParent;return{x:e,y:n}}function ze(i){if(i){if((i==null?void 0:i.offsetWidth)===void 0||(i==null?void 0:i.offsetHeight)===void 0)return console.error("Zoom node is not valid - it must contain offsetWidth and offsetHeight"),!1}else return console.error("Zoom node not found"),!1;return!0}var Ee=function(i){return function(t,e,n){t===void 0&&(t=.5),e===void 0&&(e=300),n===void 0&&(n="easeOut"),bi(i,1,t,e,n)}},De=function(i){return function(t,e,n){t===void 0&&(t=.5),e===void 0&&(e=300),n===void 0&&(n="easeOut"),bi(i,-1,t,e,n)}},Ne=function(i){return function(t,e,n,r,o){r===void 0&&(r=300),o===void 0&&(o="easeOut");var a=i.transformState,s=a.positionX,l=a.positionY,d=a.scale,u=i.wrapperComponent,f=i.contentComponent,m=i.setup.disabled;if(!(m||!u||!f)){var v={positionX:isNaN(t)?s:t,positionY:isNaN(e)?l:e,scale:isNaN(n)?d:n};z(i,v,r,o)}}},Le=function(i){return function(t,e){t===void 0&&(t=200),e===void 0&&(e="easeOut"),Ci(i,t,e)}},We=function(i){return function(t,e,n){e===void 0&&(e=200),n===void 0&&(n="easeOut");var r=i.transformState,o=i.wrapperComponent,a=i.contentComponent;if(o&&a){var s=Ti(t||r.scale,o,a);z(i,s,e,n)}}},je=function(i){return function(t,e,n,r){n===void 0&&(n=600),r===void 0&&(r="easeOut"),A(i);var o=i.wrapperComponent,a=typeof t=="string"?document.getElementById(t):t;if(o&&ze(a)&&a&&o.contains(a)){var s=Ae(i,a,e);z(i,s,n,r)}}},w=function(i){return{instance:i,state:i.transformState,zoomIn:Ee(i),zoomOut:De(i),setTransform:Ne(i),resetTransform:Le(i),centerView:We(i),zoomToElement:je(i)}},J=!1;function I(){try{var i={get passive(){return J=!0,!1}};return i}catch{return J=!1,J}}var F=function(i,t){var e=i.tagName.toUpperCase(),n=t.find(function(o){return o.toUpperCase()===e});if(n)return!0;var r=t.find(function(o){return i.classList.contains(o)});return!!r},Pi=function(i){i&&clearTimeout(i)},Be=function(i,t,e){return"translate3d("+i+"px, "+t+"px, 0) scale("+e+")"},Ti=function(i,t,e){var n=e.offsetWidth*i,r=e.offsetHeight*i,o=(t.offsetWidth-n)/2,a=(t.offsetHeight-r)/2;return{scale:i,positionX:o,positionY:a}},Me=function(i,t){var e=i.setup.wheel,n=e.disabled,r=e.wheelDisabled,o=e.touchPadDisabled,a=e.excluded,s=i.isInitialized,l=i.isPanning,d=t.target,u=s&&!l&&!n&&d;if(!u||r&&!t.ctrlKey||o&&t.ctrlKey)return!1;var f=F(d,a);return!f};function ke(i,t){var e=i?i.deltaY<0?1:-1:0,n=xi(t,e);return n}function Yi(i,t,e){var n=t.getBoundingClientRect(),r=0,o=0;if("clientX"in i)r=(i.clientX-n.left)/e,o=(i.clientY-n.top)/e;else{var a=i.touches[0];r=(a.clientX-n.left)/e,o=(a.clientY-n.top)/e}return(isNaN(r)||isNaN(o))&&console.error("No mouse or touch offset found"),{x:r,y:o}}var He=function(i,t,e,n,r){var o=i.transformState.scale,a=i.wrapperComponent,s=i.setup,l=s.maxScale,d=s.minScale,u=s.zoomAnimation,f=u.size,m=u.disabled;if(!a)throw new Error("Wrapper is not mounted");var v=o+t*(o-o*e)*e;if(r)return v;var c=n?!1:!m,h=k(Y(v,3),d,l,f,c);return h},Ze=function(i,t){var e=i.previousWheelEvent,n=i.transformState.scale,r=i.setup,o=r.maxScale,a=r.minScale;return e?n<o||n>a||Math.sign(e.deltaY)!==Math.sign(t.deltaY)||e.deltaY>0&&e.deltaY<t.deltaY||e.deltaY<0&&e.deltaY>t.deltaY||Math.sign(e.deltaY)!==Math.sign(t.deltaY):!1},Ke=function(i,t){var e=i.setup.pinch,n=e.disabled,r=e.excluded,o=i.isInitialized,a=t.target,s=o&&!n&&a;if(!s)return!1;var l=F(a,r);return!l},Ve=function(i){var t=i.setup.pinch.disabled,e=i.isInitialized,n=i.pinchStartDistance,r=e&&!t&&n;return!!r},Qe=function(i,t,e){var n=e.getBoundingClientRect(),r=i.touches,o=Y(r[0].clientX-n.left,5),a=Y(r[0].clientY-n.top,5),s=Y(r[1].clientX-n.left,5),l=Y(r[1].clientY-n.top,5);return{x:(o+s)/2/t,y:(a+l)/2/t}},Xi=function(i){return Math.sqrt(Math.pow(i.touches[0].pageX-i.touches[1].pageX,2)+Math.pow(i.touches[0].pageY-i.touches[1].pageY,2))},Fe=function(i,t){var e=i.pinchStartScale,n=i.pinchStartDistance,r=i.setup,o=r.maxScale,a=r.minScale,s=r.zoomAnimation,l=s.size,d=s.disabled;if(!e||n===null||!t)throw new Error("Pinch touches distance was not provided");if(t<0)return i.transformState.scale;var u=t/n,f=u*e;return k(Y(f,2),a,o,l,!d)},Ue=160,qe=100,Re=function(i,t){var e=i.props,n=e.onWheelStart,r=e.onZoomStart;i.wheelStopEventTimer||(A(i),C(w(i),t,n),C(w(i),t,r))},Ge=function(i,t){var e=i.props,n=e.onWheel,r=e.onZoom,o=i.contentComponent,a=i.setup,s=i.transformState,l=s.scale,d=a.limitToBounds,u=a.centerZoomedOut,f=a.zoomAnimation,m=a.wheel,v=f.size,c=f.disabled,h=m.step;if(!o)throw new Error("Component not mounted");t.preventDefault(),t.stopPropagation();var S=ke(t,null),P=He(i,S,h,!t.ctrlKey);if(l!==P){var O=L(i,P),X=Yi(t,o,l),E=c||v===0||u,D=d&&E,N=V(i,X.x,X.y,P,O,D),j=N.x,Z=N.y;i.previousWheelEvent=t,i.setTransformState(P,j,Z),C(w(i),t,n),C(w(i),t,r)}},$e=function(i,t){var e=i.props,n=e.onWheelStop,r=e.onZoomStop;Pi(i.wheelAnimationTimer),i.wheelAnimationTimer=setTimeout(function(){!i.mounted||(gi(i,t.x,t.y),i.wheelAnimationTimer=null)},qe);var o=Ze(i,t);o&&(Pi(i.wheelStopEventTimer),i.wheelStopEventTimer=setTimeout(function(){!i.mounted||(i.wheelStopEventTimer=null,C(w(i),t,n),C(w(i),t,r))},Ue))},xe=function(i,t){var e=Xi(t);i.pinchStartDistance=e,i.lastDistance=e,i.pinchStartScale=i.transformState.scale,i.isPanning=!1,A(i)},Je=function(i,t){var e=i.contentComponent,n=i.pinchStartDistance,r=i.transformState.scale,o=i.setup,a=o.limitToBounds,s=o.centerZoomedOut,l=o.zoomAnimation,d=l.disabled,u=l.size;if(!(n===null||!e)){var f=Qe(t,r,e);if(!(!isFinite(f.x)||!isFinite(f.y))){var m=Xi(t),v=Fe(i,m);if(v!==r){var c=L(i,v),h=d||u===0||s,S=a&&h,P=V(i,f.x,f.y,v,c,S),O=P.x,X=P.y;i.pinchMidpoint=f,i.lastDistance=m,i.setTransformState(v,O,X)}}}},Ie=function(i){var t=i.pinchMidpoint;i.velocity=null,i.lastDistance=null,i.pinchMidpoint=null,i.pinchStartScale=null,i.pinchStartDistance=null,gi(i,t==null?void 0:t.x,t==null?void 0:t.y)};function en(i,t){var e=i.setup.doubleClick,n=e.disabled,r=e.mode,o=e.step,a=e.animationTime,s=e.animationType;if(!n){if(r==="reset")return Ci(i,a,s);var l=i.transformState.scale,d=i.contentComponent;if(!d)return console.error("No ContentComponent found");var u=r==="zoomOut"?-1:1,f=yi(i,u,o),m=Yi(t,d,l),v=x(i,f,m.x,m.y);if(!v)return console.error("Error during zoom event. New transformation state was not calculated.");z(i,v,a,s)}}var nn=function(i,t){var e=i.isInitialized,n=i.setup,r=i.wrapperComponent,o=n.doubleClick,a=o.disabled,s=o.excluded,l=t.target,d=r==null?void 0:r.contains(l),u=e&&l&&d&&!a;if(!u)return!1;var f=F(l,s);return!(f||!u)},_i=b.default.createContext(_e),tn=function(i){$i(t,i);function t(){var e=i!==null&&i.apply(this,arguments)||this;return e.mounted=!0,e.transformState=Si(e.props),e.setup=wi(e.props),e.wrapperComponent=null,e.contentComponent=null,e.isInitialized=!1,e.bounds=null,e.previousWheelEvent=null,e.wheelStopEventTimer=null,e.wheelAnimationTimer=null,e.isPanning=!1,e.startCoords=null,e.lastTouch=null,e.distance=null,e.lastDistance=null,e.pinchStartDistance=null,e.pinchStartScale=null,e.pinchMidpoint=null,e.velocity=null,e.velocityTime=null,e.lastMousePosition=null,e.animate=!1,e.animation=null,e.maxBounds=null,e.pressedKeys={},e.handleInitializeWrapperEvents=function(n){var r=I();n.addEventListener("wheel",e.onWheelZoom,r),n.addEventListener("dblclick",e.onDoubleClick,r),n.addEventListener("touchstart",e.onTouchPanningStart,r),n.addEventListener("touchmove",e.onTouchPanning,r),n.addEventListener("touchend",e.onTouchPanningStop,r)},e.handleInitialize=function(){var n=e.setup.centerOnInit;e.applyTransformation(),e.forceUpdate(),n&&(setTimeout(function(){e.mounted&&e.setCenter()},50),setTimeout(function(){e.mounted&&e.setCenter()},100),setTimeout(function(){e.mounted&&e.setCenter()},200))},e.onWheelZoom=function(n){var r=e.setup.disabled;if(!r){var o=Me(e,n);if(!!o){var a=e.isPressingKeys(e.setup.wheel.activationKeys);!a||(Re(e,n),Ge(e,n),$e(e,n))}}},e.onPanningStart=function(n){var r=e.setup.disabled,o=e.props.onPanningStart;if(!r){var a=fi(e,n);if(!!a){var s=e.isPressingKeys(e.setup.panning.activationKeys);!s||(n.preventDefault(),n.stopPropagation(),A(e),pi(e,n),C(w(e),n,o))}}},e.onPanning=function(n){var r=e.setup.disabled,o=e.props.onPanning;if(!r){var a=mi(e);if(!!a){var s=e.isPressingKeys(e.setup.panning.activationKeys);!s||(n.preventDefault(),n.stopPropagation(),ci(e,n.clientX,n.clientY),C(w(e),n,o))}}},e.onPanningStop=function(n){var r=e.props.onPanningStop;e.isPanning&&(Xe(e),C(w(e),n,r))},e.onPinchStart=function(n){var r=e.setup.disabled,o=e.props,a=o.onPinchingStart,s=o.onZoomStart;if(!r){var l=Ke(e,n);!l||(xe(e,n),A(e),C(w(e),n,a),C(w(e),n,s))}},e.onPinch=function(n){var r=e.setup.disabled,o=e.props,a=o.onPinching,s=o.onZoom;if(!r){var l=Ve(e);!l||(n.preventDefault(),n.stopPropagation(),Je(e,n),C(w(e),n,a),C(w(e),n,s))}},e.onPinchStop=function(n){var r=e.props,o=r.onPinchingStop,a=r.onZoomStop;e.pinchStartScale&&(Ie(e),C(w(e),n,o),C(w(e),n,a))},e.onTouchPanningStart=function(n){var r=e.setup.disabled,o=e.props.onPanningStart;if(!r){var a=fi(e,n);if(!!a){var s=e.lastTouch&&+new Date-e.lastTouch<200;if(s&&n.touches.length===1)e.onDoubleClick(n);else{e.lastTouch=+new Date,A(e);var l=n.touches,d=l.length===1,u=l.length===2;d&&(A(e),pi(e,n),C(w(e),n,o)),u&&e.onPinchStart(n)}}}},e.onTouchPanning=function(n){var r=e.setup.disabled,o=e.props.onPanning;if(e.isPanning&&n.touches.length===1){if(r)return;var a=mi(e);if(!a)return;n.preventDefault(),n.stopPropagation();var s=n.touches[0];ci(e,s.clientX,s.clientY),C(w(e),n,o)}else n.touches.length>1&&e.onPinch(n)},e.onTouchPanningStop=function(n){e.onPanningStop(n),e.onPinchStop(n)},e.onDoubleClick=function(n){var r=e.setup.disabled;if(!r){var o=nn(e,n);!o||en(e,n)}},e.clearPanning=function(n){e.isPanning&&e.onPanningStop(n)},e.setKeyPressed=function(n){e.pressedKeys[n.key]=!0},e.setKeyUnPressed=function(n){e.pressedKeys[n.key]=!1},e.isPressingKeys=function(n){return n.length?Boolean(n.find(function(r){return e.pressedKeys[r]})):!0},e.setComponents=function(n,r){e.wrapperComponent=n,e.contentComponent=r,L(e,e.transformState.scale),e.handleInitializeWrapperEvents(n),e.handleInitialize(),e.handleRef(),e.isInitialized=!0,C(w(e),void 0,e.props.onInit)},e.setTransformState=function(n,r,o){!isNaN(n)&&!isNaN(r)&&!isNaN(o)?(n!==e.transformState.scale&&(e.transformState.previousScale=e.transformState.scale,e.transformState.scale=n),e.transformState.positionX=r,e.transformState.positionY=o,e.applyTransformation()):console.error("Detected NaN set state values")},e.setCenter=function(){if(e.wrapperComponent&&e.contentComponent){var n=Ti(e.transformState.scale,e.wrapperComponent,e.contentComponent);e.setTransformState(n.scale,n.positionX,n.positionY)}},e.applyTransformation=function(){if(!(!e.mounted||!e.contentComponent)){var n=e.transformState,r=n.scale,o=n.positionX,a=n.positionY,s=Be(o,a,r);e.contentComponent.style.transform=s,e.handleRef()}},e.handleRef=function(){e.props.setRef(w(e))},e}return t.prototype.componentDidMount=function(){var e=I();window.addEventListener("mousedown",this.onPanningStart,e),window.addEventListener("mousemove",this.onPanning,e),window.addEventListener("mouseup",this.onPanningStop,e),document.addEventListener("mouseleave",this.clearPanning,e),window.addEventListener("keyup",this.setKeyUnPressed,e),window.addEventListener("keydown",this.setKeyPressed,e),this.handleRef()},t.prototype.componentWillUnmount=function(){var e=I();window.removeEventListener("mousedown",this.onPanningStart,e),window.removeEventListener("mousemove",this.onPanning,e),window.removeEventListener("mouseup",this.onPanningStop,e),window.removeEventListener("keyup",this.setKeyUnPressed,e),window.removeEventListener("keydown",this.setKeyPressed,e),A(this)},t.prototype.componentDidUpdate=function(e){e!==this.props&&(L(this,this.transformState.scale),this.setup=wi(this.props))},t.prototype.render=function(){var e=w(this),n=this.props.children,r=typeof n=="function"?n(e):n;return g(_i.Provider,{value:_(_({},this.transformState),{setComponents:this.setComponents,contextInstance:this}),children:r})},t}(p.Component),rn=b.default.forwardRef(function(i,t){var e=p.useState(null),n=e[0],r=e[1];return p.useImperativeHandle(t,function(){return n},[n]),g(tn,B({},_({},i,{setRef:r})))});function on(i,t){t===void 0&&(t={});var e=t.insertAt;if(!(!i||typeof document=="undefined")){var n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=i:r.appendChild(document.createTextNode(i))}}var an=`.transform-component-module_wrapper__1_Fgj {
|
|
13
13
|
position: relative;
|
|
14
14
|
width: -moz-fit-content;
|
|
15
15
|
width: fit-content;
|
|
@@ -39,7 +39,7 @@ object-assign
|
|
|
39
39
|
.transform-component-module_content__2jYgh img {
|
|
40
40
|
pointer-events: none;
|
|
41
41
|
}
|
|
42
|
-
`,
|
|
42
|
+
`,Ai={wrapper:"transform-component-module_wrapper__1_Fgj",content:"transform-component-module_content__2jYgh"};on(an);var sn=function(i){var t=i.children,e=i.wrapperClass,n=e===void 0?"":e,r=i.contentClass,o=r===void 0?"":r,a=i.wrapperStyle,s=i.contentStyle,l=p.useContext(_i).setComponents,d=p.useRef(null),u=p.useRef(null);return p.useEffect(function(){var f=d.current,m=u.current;f!==null&&m!==null&&l&&l(f,m)},[]),g("div",{ref:d,className:"react-transform-wrapper "+Ai.wrapper+" "+n,style:a,children:g("div",{ref:u,className:"react-transform-component "+Ai.content+" "+o,style:s,children:t})})};let T={};T.lightbox={position:"fixed",top:0,left:0,width:"100%",height:"100%",background:"rgba(0, 0, 0, 0.454)",backdropFilter:"blur(6px)",zIndex:9999999,display:"grid",gridTemplateRows:"60px | auto | 300px",justifyContent:"center",alignContent:"center"},T.topCustomContent={position:"absolute",top:0},T.bottomCustomContent={position:"absolute",bottom:0},T.LbButton={float:"right",textDecoration:"none",color:"white",padding:"5px",border:"1px solid white",borderRadius:"5px"},T.ABtn={float:"right",textDecoration:"none",color:"white"},T.DescriptionDiv={background:"white",padding:"10px",color:"#666",textAlign:"center",position:"relative",zIndex:-1},T.Wrapper={display:"flex",width:"100%",minWidth:200,height:"100%"},T.Grid={display:"grid",gridTemplateRows:"1fr",gap:"2px",width:"100%",height:"auto"};const Oi=`
|
|
43
43
|
.lds-dual-ring {
|
|
44
44
|
display: inline-block;
|
|
45
45
|
width: 40px;
|
|
@@ -64,4 +64,4 @@ object-assign
|
|
|
64
64
|
transform: rotate(360deg);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
|
-
`;function
|
|
67
|
+
`;function ln(){return p.useEffect(()=>{const i=document.querySelector("#react-pic-style");if(i)i.innerHTML=i.innerHTML+Oi;else{const t=document.createElement("style");t.id="react-pic-style",t.innerHTML=Oi,document.body.appendChild(t)}return()=>{var t;(t=document.querySelector("#react-pic-style"))==null||t.remove()}},[]),g("div",{className:"lds-dual-ring"})}const zi=i=>{var a;const[t,e]=b.default.useState(""),n=((a=i.options)==null?void 0:a.customLoadComponent)!==void 0?i.options.customLoadComponent:ln,[r,o]=p.useState(!0);return b.default.useEffect(()=>{o(!0);const s=new AbortController;return i.imgSrc&&fetch(i.imgSrc).then(l=>l.blob()).then(l=>{e(URL.createObjectURL(l)),o(!1)}),()=>{s.abort()}},[i.imgSrc]),r?g("div",{style:{height:"100%",width:"100%",display:"flex",alignItems:"center",alignContent:"center",justifyContent:"center",background:i.lightboxMode?"":"rgba(0, 0, 0, 0.157)",border:i.lightboxMode?"":"1px solid rgba(0, 0, 0,0.3)"},children:g(n,{})}):g("img",{src:t,alt:"",id:i.id,style:B({},i.style),onClick:i.onClick})},Ei=i=>{var o,a,s,l,d,u;const[t,e]=p.useState(""),[n,r]=p.useState(i.currentImgIndex);return p.useCallback(()=>r(n+1),[n]),p.useCallback(()=>r(n-1),[n]),b.default.useEffect(()=>{var m,v;const f=((m=i.imgList[n])==null?void 0:m.fullSrc)?i.imgList[n].fullSrc:((v=i.imgList[n])==null?void 0:v.thumbnailSrc)?i.imgList[n].thumbnailSrc:null;f&&e(f),document.body.style.overflow="hidden"},[n]),q("div",{className:"reactPic-lightbox",style:T.lightbox,onClick:f=>{document.body.style.overflow="",f.target.className==="reactPic-lightbox"&&i.onClose()},children:[g("div",{style:T.topCustomContent,className:"reactPic-topCustomContent",children:(o=i.topCustomContent)==null?void 0:o.call(i,{closeLightbox:i.onClose,imgObject:i.imgList[n]})}),q("div",{children:[g(rn,{children:g(sn,{wrapperStyle:{overflow:"visible"},children:g(zi,{lightboxMode:!0,imgSrc:t,id:"lightboxImg",style:{maxWidth:"80vw",maxHeight:"calc(80vh - 20px)",margin:"auto",zIndex:99999999999}})})}),n-1>=0&&!((a=i.options)==null?void 0:a.hidePagination)&&g("div",{className:"react-lightbox-prevBtn",style:{position:"absolute",left:20,height:50,top:"calc(50% - 50px)",fontSize:50,cursor:"pointer",color:"white",display:((s=i.options)==null?void 0:s.hidePagination)?"none":"inherit"},onClick:n-1>=0?()=>r(n-1):void 0,children:"\u2039"}),n+1<i.imgList.length&&!((l=i.options)==null?void 0:l.hidePagination)&&g("div",{className:"react-lightbox-nextBtn",style:{position:"absolute",right:20,height:50,top:"calc(50% - 50px)",fontSize:50,cursor:"pointer",color:"white",display:((d=i.options)==null?void 0:d.hidePagination)?"none":"inherit"},onClick:n+1<i.imgList.length?()=>r(n+1):void 0,children:"\u203A"})]}),g("div",{style:T.bottomCustomContent,className:"reactPic-bottomCustomContent",children:(u=i.bottomCustomContent)==null?void 0:u.call(i,{closeLightbox:i.onClose,imgObject:i.imgList[n]})})]})};function un(i){var t;return g("div",{className:"reactPic-grid",style:Zi(B({},T.Grid),{gridTemplateColumns:`repeat(${((t=i.options)==null?void 0:t.picsPerRow)?i.options.picsPerRow:"3"}, 1fr)`}),children:i.imgList.map((e,n)=>{var r;return g("div",{className:"reactPic-imgDiv",style:{overflow:"hidden",width:"100%",height:"100%",minHeight:"150px"},children:g("div",{className:"reactPic-innerImgDiv",style:{display:"flex",justifyContent:"center",alignItems:"center",overflow:"hidden !important",width:"100%",height:((r=i.options)==null?void 0:r.rowHeight)?i.options.rowHeight:"150px",cursor:"pointer"},children:g(zi,{options:i.options,imgSrc:e.thumbnailSrc?e.thumbnailSrc:e.fullSrc,style:{flexShrink:0,minWidth:"100%",minHeight:"100%"},onClick:()=>i.onOpen(n)})})},e.thumbnailSrc?e.thumbnailSrc:e.fullSrc)})})}var dn=b.default.memo(un);const fn={downloadBtnDisplay:!0,descriptionBoxDisplay:!0,navigation:!0};function mn(i){var s;const[t,e]=p.useState(!1),[n,r]=p.useState(0),o=B(B({},fn),i.options);p.useEffect(()=>{typeof i.setExtLightboxChildren=="function"&&(t?i.setExtLightboxChildren(g(Ei,{open:t,currentImgIndex:n,imgList:i.imgList,topCustomContent:i.topCustomContent,bottomCustomContent:i.bottomCustomContent,options:o,onClose:()=>e(!1)})):i.setExtLightboxChildren(void 0))},[t]);const a=p.useCallback(l=>{e(!0),r(l),console.log("modalImgIndex",n),console.log("count",l)},[n]);return q("div",{className:"reactPic-wrapper",style:T.Wrapper,children:[t&&!((s=i.options)==null?void 0:s.externalLightbox)?g(Ei,{open:t,currentImgIndex:n,imgList:i.imgList,topCustomContent:i.topCustomContent,bottomCustomContent:i.bottomCustomContent,options:o,onClose:()=>{console.log("close"),e(!1)}}):null,g(dn,{options:i.options,imgList:i.imgList,onOpen:a})]})}return mn});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-pic-gallery",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"author": "marcelrsoub",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "marcelrsoub/react-pic-gallery",
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"scripts": {
|
|
19
19
|
"dev": "vite",
|
|
20
20
|
"build": "tsc && vite build",
|
|
21
|
-
"preview": "vite preview",
|
|
21
|
+
"preview": "vite --config vite.github-pages.config.ts preview",
|
|
22
|
+
"build-example": "vite --config vite.github-pages.config.ts build",
|
|
22
23
|
"github-pages": "npx vite --config vite.github-pages.config.ts build && gh-pages -d build",
|
|
23
24
|
"publish-patch": "yarn run build && npx standard-version --release-as patch && git push --follow-tags origin main && npm publish",
|
|
24
25
|
"publish-minor": "yarn run build && npx standard-version --release-as minor && git push --follow-tags origin main && npm publish",
|