@trafilea/afrodita-components 5.0.0-beta.35 → 5.0.0-beta.38
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/build/index.css +3 -1
- package/build/index.esm.css +3 -1
- package/build/index.esm.js +1927 -346
- package/build/index.esm.js.map +1 -1
- package/build/index.js +1927 -346
- package/build/index.js.map +1 -1
- package/package.json +3 -1
package/build/index.esm.js
CHANGED
|
@@ -472,8 +472,8 @@ var Icon = {
|
|
|
472
472
|
Emoji: Emoji,
|
|
473
473
|
};
|
|
474
474
|
|
|
475
|
-
function _extends$
|
|
476
|
-
_extends$
|
|
475
|
+
function _extends$2() {
|
|
476
|
+
_extends$2 = Object.assign || function (target) {
|
|
477
477
|
for (var i = 1; i < arguments.length; i++) {
|
|
478
478
|
var source = arguments[i];
|
|
479
479
|
|
|
@@ -487,7 +487,7 @@ function _extends$1() {
|
|
|
487
487
|
return target;
|
|
488
488
|
};
|
|
489
489
|
|
|
490
|
-
return _extends$
|
|
490
|
+
return _extends$2.apply(this, arguments);
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
function memoize(fn) {
|
|
@@ -688,7 +688,7 @@ var from = String.fromCharCode;
|
|
|
688
688
|
* @param {object}
|
|
689
689
|
* @return {object}
|
|
690
690
|
*/
|
|
691
|
-
var assign = Object.assign;
|
|
691
|
+
var assign$1 = Object.assign;
|
|
692
692
|
|
|
693
693
|
/**
|
|
694
694
|
* @param {string} value
|
|
@@ -814,7 +814,7 @@ function node$1 (value, root, parent, type, props, children, length) {
|
|
|
814
814
|
* @return {object}
|
|
815
815
|
*/
|
|
816
816
|
function copy (root, props) {
|
|
817
|
-
return assign(node$1('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
817
|
+
return assign$1(node$1('', null, null, '', null, null, 0), root, {length: -root.length}, props)
|
|
818
818
|
}
|
|
819
819
|
|
|
820
820
|
/**
|
|
@@ -1818,9 +1818,9 @@ var createCache = function createCache(options) {
|
|
|
1818
1818
|
|
|
1819
1819
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
1820
1820
|
|
|
1821
|
-
var reactIs$
|
|
1821
|
+
var reactIs$2 = {exports: {}};
|
|
1822
1822
|
|
|
1823
|
-
var reactIs_production_min = {};
|
|
1823
|
+
var reactIs_production_min$1 = {};
|
|
1824
1824
|
|
|
1825
1825
|
/** @license React v16.13.1
|
|
1826
1826
|
* react-is.production.min.js
|
|
@@ -1830,14 +1830,14 @@ var reactIs_production_min = {};
|
|
|
1830
1830
|
* This source code is licensed under the MIT license found in the
|
|
1831
1831
|
* LICENSE file in the root directory of this source tree.
|
|
1832
1832
|
*/
|
|
1833
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k$
|
|
1834
|
-
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w$
|
|
1835
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k$
|
|
1836
|
-
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A$
|
|
1837
|
-
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
1838
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q$
|
|
1833
|
+
var b$1="function"===typeof Symbol&&Symbol.for,c$1=b$1?Symbol.for("react.element"):60103,d$1=b$1?Symbol.for("react.portal"):60106,e$1=b$1?Symbol.for("react.fragment"):60107,f$1=b$1?Symbol.for("react.strict_mode"):60108,g$1=b$1?Symbol.for("react.profiler"):60114,h$1=b$1?Symbol.for("react.provider"):60109,k$2=b$1?Symbol.for("react.context"):60110,l$1=b$1?Symbol.for("react.async_mode"):60111,m$1=b$1?Symbol.for("react.concurrent_mode"):60111,n$1=b$1?Symbol.for("react.forward_ref"):60112,p$1=b$1?Symbol.for("react.suspense"):60113,q$2=b$1?
|
|
1834
|
+
Symbol.for("react.suspense_list"):60120,r$1=b$1?Symbol.for("react.memo"):60115,t$1=b$1?Symbol.for("react.lazy"):60116,v$1=b$1?Symbol.for("react.block"):60121,w$2=b$1?Symbol.for("react.fundamental"):60117,x$2=b$1?Symbol.for("react.responder"):60118,y$1=b$1?Symbol.for("react.scope"):60119;
|
|
1835
|
+
function z$1(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$1:switch(a=a.type,a){case l$1:case m$1:case e$1:case g$1:case f$1:case p$1:return a;default:switch(a=a&&a.$$typeof,a){case k$2:case n$1:case t$1:case r$1:case h$1:return a;default:return u}}case d$1:return u}}}function A$2(a){return z$1(a)===m$1}reactIs_production_min$1.AsyncMode=l$1;reactIs_production_min$1.ConcurrentMode=m$1;reactIs_production_min$1.ContextConsumer=k$2;reactIs_production_min$1.ContextProvider=h$1;reactIs_production_min$1.Element=c$1;reactIs_production_min$1.ForwardRef=n$1;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$1;reactIs_production_min$1.Memo=r$1;reactIs_production_min$1.Portal=d$1;
|
|
1836
|
+
reactIs_production_min$1.Profiler=g$1;reactIs_production_min$1.StrictMode=f$1;reactIs_production_min$1.Suspense=p$1;reactIs_production_min$1.isAsyncMode=function(a){return A$2(a)||z$1(a)===l$1};reactIs_production_min$1.isConcurrentMode=A$2;reactIs_production_min$1.isContextConsumer=function(a){return z$1(a)===k$2};reactIs_production_min$1.isContextProvider=function(a){return z$1(a)===h$1};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$1};reactIs_production_min$1.isForwardRef=function(a){return z$1(a)===n$1};reactIs_production_min$1.isFragment=function(a){return z$1(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z$1(a)===t$1};
|
|
1837
|
+
reactIs_production_min$1.isMemo=function(a){return z$1(a)===r$1};reactIs_production_min$1.isPortal=function(a){return z$1(a)===d$1};reactIs_production_min$1.isProfiler=function(a){return z$1(a)===g$1};reactIs_production_min$1.isStrictMode=function(a){return z$1(a)===f$1};reactIs_production_min$1.isSuspense=function(a){return z$1(a)===p$1};
|
|
1838
|
+
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$1||a===g$1||a===f$1||a===p$1||a===q$2||"object"===typeof a&&null!==a&&(a.$$typeof===t$1||a.$$typeof===r$1||a.$$typeof===h$1||a.$$typeof===k$2||a.$$typeof===n$1||a.$$typeof===w$2||a.$$typeof===x$2||a.$$typeof===y$1||a.$$typeof===v$1)};reactIs_production_min$1.typeOf=z$1;
|
|
1839
1839
|
|
|
1840
|
-
var reactIs_development = {};
|
|
1840
|
+
var reactIs_development$1 = {};
|
|
1841
1841
|
|
|
1842
1842
|
/** @license React v16.13.1
|
|
1843
1843
|
* react-is.development.js
|
|
@@ -1987,44 +1987,44 @@ function isSuspense(object) {
|
|
|
1987
1987
|
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1988
1988
|
}
|
|
1989
1989
|
|
|
1990
|
-
reactIs_development.AsyncMode = AsyncMode;
|
|
1991
|
-
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
1992
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
1993
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
1994
|
-
reactIs_development.Element = Element;
|
|
1995
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
1996
|
-
reactIs_development.Fragment = Fragment;
|
|
1997
|
-
reactIs_development.Lazy = Lazy;
|
|
1998
|
-
reactIs_development.Memo = Memo;
|
|
1999
|
-
reactIs_development.Portal = Portal;
|
|
2000
|
-
reactIs_development.Profiler = Profiler;
|
|
2001
|
-
reactIs_development.StrictMode = StrictMode;
|
|
2002
|
-
reactIs_development.Suspense = Suspense;
|
|
2003
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
2004
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
2005
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
2006
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
2007
|
-
reactIs_development.isElement = isElement;
|
|
2008
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
2009
|
-
reactIs_development.isFragment = isFragment;
|
|
2010
|
-
reactIs_development.isLazy = isLazy;
|
|
2011
|
-
reactIs_development.isMemo = isMemo;
|
|
2012
|
-
reactIs_development.isPortal = isPortal;
|
|
2013
|
-
reactIs_development.isProfiler = isProfiler;
|
|
2014
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
2015
|
-
reactIs_development.isSuspense = isSuspense;
|
|
2016
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
2017
|
-
reactIs_development.typeOf = typeOf;
|
|
1990
|
+
reactIs_development$1.AsyncMode = AsyncMode;
|
|
1991
|
+
reactIs_development$1.ConcurrentMode = ConcurrentMode;
|
|
1992
|
+
reactIs_development$1.ContextConsumer = ContextConsumer;
|
|
1993
|
+
reactIs_development$1.ContextProvider = ContextProvider;
|
|
1994
|
+
reactIs_development$1.Element = Element;
|
|
1995
|
+
reactIs_development$1.ForwardRef = ForwardRef;
|
|
1996
|
+
reactIs_development$1.Fragment = Fragment;
|
|
1997
|
+
reactIs_development$1.Lazy = Lazy;
|
|
1998
|
+
reactIs_development$1.Memo = Memo;
|
|
1999
|
+
reactIs_development$1.Portal = Portal;
|
|
2000
|
+
reactIs_development$1.Profiler = Profiler;
|
|
2001
|
+
reactIs_development$1.StrictMode = StrictMode;
|
|
2002
|
+
reactIs_development$1.Suspense = Suspense;
|
|
2003
|
+
reactIs_development$1.isAsyncMode = isAsyncMode;
|
|
2004
|
+
reactIs_development$1.isConcurrentMode = isConcurrentMode;
|
|
2005
|
+
reactIs_development$1.isContextConsumer = isContextConsumer;
|
|
2006
|
+
reactIs_development$1.isContextProvider = isContextProvider;
|
|
2007
|
+
reactIs_development$1.isElement = isElement;
|
|
2008
|
+
reactIs_development$1.isForwardRef = isForwardRef;
|
|
2009
|
+
reactIs_development$1.isFragment = isFragment;
|
|
2010
|
+
reactIs_development$1.isLazy = isLazy;
|
|
2011
|
+
reactIs_development$1.isMemo = isMemo;
|
|
2012
|
+
reactIs_development$1.isPortal = isPortal;
|
|
2013
|
+
reactIs_development$1.isProfiler = isProfiler;
|
|
2014
|
+
reactIs_development$1.isStrictMode = isStrictMode;
|
|
2015
|
+
reactIs_development$1.isSuspense = isSuspense;
|
|
2016
|
+
reactIs_development$1.isValidElementType = isValidElementType;
|
|
2017
|
+
reactIs_development$1.typeOf = typeOf;
|
|
2018
2018
|
})();
|
|
2019
2019
|
}
|
|
2020
2020
|
|
|
2021
2021
|
if (process.env.NODE_ENV === 'production') {
|
|
2022
|
-
reactIs$
|
|
2022
|
+
reactIs$2.exports = reactIs_production_min$1;
|
|
2023
2023
|
} else {
|
|
2024
|
-
reactIs$
|
|
2024
|
+
reactIs$2.exports = reactIs_development$1;
|
|
2025
2025
|
}
|
|
2026
2026
|
|
|
2027
|
-
var reactIs = reactIs$
|
|
2027
|
+
var reactIs$1 = reactIs$2.exports;
|
|
2028
2028
|
var FORWARD_REF_STATICS = {
|
|
2029
2029
|
'$$typeof': true,
|
|
2030
2030
|
render: true,
|
|
@@ -2041,8 +2041,8 @@ var MEMO_STATICS = {
|
|
|
2041
2041
|
type: true
|
|
2042
2042
|
};
|
|
2043
2043
|
var TYPE_STATICS = {};
|
|
2044
|
-
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
2045
|
-
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
2044
|
+
TYPE_STATICS[reactIs$1.ForwardRef] = FORWARD_REF_STATICS;
|
|
2045
|
+
TYPE_STATICS[reactIs$1.Memo] = MEMO_STATICS;
|
|
2046
2046
|
|
|
2047
2047
|
var isBrowser$4 = typeof document !== 'undefined';
|
|
2048
2048
|
function getRegisteredStyles(registered, registeredStyles, classNames) {
|
|
@@ -2509,7 +2509,7 @@ var serializeStyles = function serializeStyles(args, registered, mergedProps) {
|
|
|
2509
2509
|
};
|
|
2510
2510
|
|
|
2511
2511
|
var isBrowser$3 = typeof document !== 'undefined';
|
|
2512
|
-
var hasOwnProperty$
|
|
2512
|
+
var hasOwnProperty$2 = {}.hasOwnProperty;
|
|
2513
2513
|
|
|
2514
2514
|
var EmotionCacheContext = /* #__PURE__ */createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case
|
|
2515
2515
|
// because this module is primarily intended for the browser and node
|
|
@@ -2585,7 +2585,7 @@ var getTheme = function getTheme(outerTheme, theme) {
|
|
|
2585
2585
|
throw new Error('[ThemeProvider] Please make your theme prop a plain object');
|
|
2586
2586
|
}
|
|
2587
2587
|
|
|
2588
|
-
return _extends$
|
|
2588
|
+
return _extends$2({}, outerTheme, theme);
|
|
2589
2589
|
};
|
|
2590
2590
|
|
|
2591
2591
|
var createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {
|
|
@@ -2671,7 +2671,7 @@ var createEmotionProps = function createEmotionProps(type, props) {
|
|
|
2671
2671
|
var newProps = {};
|
|
2672
2672
|
|
|
2673
2673
|
for (var key in props) {
|
|
2674
|
-
if (hasOwnProperty$
|
|
2674
|
+
if (hasOwnProperty$2.call(props, key)) {
|
|
2675
2675
|
newProps[key] = props[key];
|
|
2676
2676
|
}
|
|
2677
2677
|
}
|
|
@@ -2748,7 +2748,7 @@ var Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {
|
|
|
2748
2748
|
var newProps = {};
|
|
2749
2749
|
|
|
2750
2750
|
for (var key in props) {
|
|
2751
|
-
if (hasOwnProperty$
|
|
2751
|
+
if (hasOwnProperty$2.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName)) {
|
|
2752
2752
|
newProps[key] = props[key];
|
|
2753
2753
|
}
|
|
2754
2754
|
}
|
|
@@ -3312,7 +3312,7 @@ var createStyled = function createStyled(tag, options) {
|
|
|
3312
3312
|
});
|
|
3313
3313
|
|
|
3314
3314
|
Styled.withComponent = function (nextTag, nextOptions) {
|
|
3315
|
-
return createStyled(nextTag, _extends$
|
|
3315
|
+
return createStyled(nextTag, _extends$2({}, options, nextOptions, {
|
|
3316
3316
|
shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)
|
|
3317
3317
|
})).apply(void 0, styles);
|
|
3318
3318
|
};
|
|
@@ -3543,14 +3543,14 @@ var templateObject_1$17;
|
|
|
3543
3543
|
|
|
3544
3544
|
var Fragment = Fragment$1;
|
|
3545
3545
|
function jsx(type, props, key) {
|
|
3546
|
-
if (!hasOwnProperty$
|
|
3546
|
+
if (!hasOwnProperty$2.call(props, 'css')) {
|
|
3547
3547
|
return jsx$1(type, props, key);
|
|
3548
3548
|
}
|
|
3549
3549
|
|
|
3550
3550
|
return jsx$1(Emotion, createEmotionProps(type, props), key);
|
|
3551
3551
|
}
|
|
3552
3552
|
function jsxs(type, props, key) {
|
|
3553
|
-
if (!hasOwnProperty$
|
|
3553
|
+
if (!hasOwnProperty$2.call(props, 'css')) {
|
|
3554
3554
|
return jsxs$1(type, props, key);
|
|
3555
3555
|
}
|
|
3556
3556
|
|
|
@@ -3659,10 +3659,10 @@ var ButtonSecondaryOutline = function (props) {
|
|
|
3659
3659
|
} }), void 0));
|
|
3660
3660
|
};
|
|
3661
3661
|
|
|
3662
|
-
function k(){let e=[],t=[],r={enqueue(o){t.push(o);},requestAnimationFrame(...o){let n=requestAnimationFrame(...o);r.add(()=>cancelAnimationFrame(n));},nextFrame(...o){r.requestAnimationFrame(()=>{r.requestAnimationFrame(...o);});},setTimeout(...o){let n=setTimeout(...o);r.add(()=>clearTimeout(n));},add(o){e.push(o);},dispose(){for(let o of e.splice(0))o();},async workQueue(){for(let o of t.splice(0))await o();}};return r}function Q(){let[e]=useState(k);return useEffect(()=>()=>e.dispose(),[e]),e}var x=typeof window!="undefined"?useLayoutEffect:useEffect;var yt={serverHandoffComplete:!1};function q(){let[e,t]=useState(yt.serverHandoffComplete);return useEffect(()=>{e!==!0&&t(!0);},[e]),useEffect(()=>{yt.serverHandoffComplete===!1&&(yt.serverHandoffComplete=!0);},[]),e}var or=0;function to(){return ++or}function A(){let e=q(),[t,r]=useState(e?to:null);return x(()=>{t===null&&r(to());},[t]),t!=null?""+t:void 0}function ke(e){let t=useRef(e);return useEffect(()=>{t.current=e;},[e]),t}function ee(e,t){let[r,o]=useState(e),n=ke(e);return x(()=>o(n.current),[n,o,...t]),r}function I(...e){let t=useRef(e);return useEffect(()=>{t.current=e;},[e]),useCallback(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r);},[t])}function S(e,t,...r){if(e in t){let n=t[e];return typeof n=="function"?n(...r):n}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,S),o}function E({props:e,slot:t,defaultTag:r,features:o,visible:n=!0,name:i}){if(n)return _e(e,t,r,i);let a=o!=null?o:0;if(a&2){let{static:l=!1,...s}=e;if(l)return _e(s,t,r,i)}if(a&1){let{unmount:l=!0,...s}=e;return S(l?0:1,{[0](){return null},[1](){return _e({...s,hidden:!0,style:{display:"none"}},t,r,i)}})}return _e(e,t,r,i)}function _e(e,t={},r,o){let{as:n=r,children:i,refName:a="ref",...l}=gt(e,["unmount","static"]),s=e.ref!==void 0?{[a]:e.ref}:{},u=typeof i=="function"?i(t):i;if(l.className&&typeof l.className=="function"&&(l.className=l.className(t)),n===Fragment$2&&Object.keys(l).length>0){if(!isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${o} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(c=>` - ${c}`).join(`
|
|
3662
|
+
function k$1(){let e=[],t=[],r={enqueue(o){t.push(o);},requestAnimationFrame(...o){let n=requestAnimationFrame(...o);r.add(()=>cancelAnimationFrame(n));},nextFrame(...o){r.requestAnimationFrame(()=>{r.requestAnimationFrame(...o);});},setTimeout(...o){let n=setTimeout(...o);r.add(()=>clearTimeout(n));},add(o){e.push(o);},dispose(){for(let o of e.splice(0))o();},async workQueue(){for(let o of t.splice(0))await o();}};return r}function Q(){let[e]=useState(k$1);return useEffect(()=>()=>e.dispose(),[e]),e}var x$1=typeof window!="undefined"?useLayoutEffect:useEffect;var yt={serverHandoffComplete:!1};function q$1(){let[e,t]=useState(yt.serverHandoffComplete);return useEffect(()=>{e!==!0&&t(!0);},[e]),useEffect(()=>{yt.serverHandoffComplete===!1&&(yt.serverHandoffComplete=!0);},[]),e}var or=0;function to(){return ++or}function A$1(){let e=q$1(),[t,r]=useState(e?to:null);return x$1(()=>{t===null&&r(to());},[t]),t!=null?""+t:void 0}function ke(e){let t=useRef(e);return useEffect(()=>{t.current=e;},[e]),t}function ee(e,t){let[r,o]=useState(e),n=ke(e);return x$1(()=>o(n.current),[n,o,...t]),r}function I(...e){let t=useRef(e);return useEffect(()=>{t.current=e;},[e]),useCallback(r=>{for(let o of t.current)o!=null&&(typeof o=="function"?o(r):o.current=r);},[t])}function S(e,t,...r){if(e in t){let n=t[e];return typeof n=="function"?n(...r):n}let o=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(n=>`"${n}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(o,S),o}function E({props:e,slot:t,defaultTag:r,features:o,visible:n=!0,name:i}){if(n)return _e(e,t,r,i);let a=o!=null?o:0;if(a&2){let{static:l=!1,...s}=e;if(l)return _e(s,t,r,i)}if(a&1){let{unmount:l=!0,...s}=e;return S(l?0:1,{[0](){return null},[1](){return _e({...s,hidden:!0,style:{display:"none"}},t,r,i)}})}return _e(e,t,r,i)}function _e(e,t={},r,o){let{as:n=r,children:i,refName:a="ref",...l}=gt(e,["unmount","static"]),s=e.ref!==void 0?{[a]:e.ref}:{},u=typeof i=="function"?i(t):i;if(l.className&&typeof l.className=="function"&&(l.className=l.className(t)),n===Fragment$2&&Object.keys(l).length>0){if(!isValidElement(u)||Array.isArray(u)&&u.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${o} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(l).map(c=>` - ${c}`).join(`
|
|
3663
3663
|
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(c=>` - ${c}`).join(`
|
|
3664
3664
|
`)].join(`
|
|
3665
|
-
`));return cloneElement(u,Object.assign({},fr(mr(gt(l,["ref"])),u.props,["onClick"]),s))}return createElement(n,Object.assign({},gt(l,["ref"]),n!==Fragment$2&&s),u)}function fr(e,t,r){let o=Object.assign({},e);for(let n of r)e[n]!==void 0&&t[n]!==void 0&&Object.assign(o,{[n](i){i.defaultPrevented||e[n](i),i.defaultPrevented||t[n](i);}});return o}function D(e){var t;return Object.assign(forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function mr(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function gt(e,t=[]){let r=Object.assign({},e);for(let o of t)o in r&&delete r[o];return r}function br(e){throw new Error("Unexpected object: "+e)}function ae(e,t){let r=t.resolveItems();if(r.length<=0)return null;let o=t.resolveActiveIndex(),n=o!=null?o:-1,i=(()=>{switch(e.focus){case 0:return r.findIndex(a=>!t.resolveDisabled(a));case 1:{let a=r.slice().reverse().findIndex((l,s,u)=>n!==-1&&u.length-s-1>=n?!1:!t.resolveDisabled(l));return a===-1?a:r.length-1-a}case 2:return r.findIndex((a,l)=>l<=n?!1:!t.resolveDisabled(a));case 3:{let a=r.slice().reverse().findIndex(l=>!t.resolveDisabled(l));return a===-1?a:r.length-1-a}case 4:return r.findIndex(a=>t.resolveId(a)===e.id);case 5:return null;default:br(e);}})();return i===-1?o:i}function G(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let o=(t==null?void 0:t.getAttribute("disabled"))==="";return o&&Tr(r)?!1:o}function Tr(e){if(!e)return !1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return !1;t=t.previousElementSibling;}return !0}function w(e,t,r){let o=useRef(t);o.current=t,useEffect(()=>{function n(i){o.current.call(window,i);}return window.addEventListener(e,n,r),()=>window.removeEventListener(e,n,r)},[e,r]);}var Pt=createContext(null);Pt.displayName="OpenClosedContext";function _(){return useContext(Pt)}function W({value:e,children:t}){return React__default.createElement(Pt.Provider,{value:e},t)}function ro(e){var r;if(e.type)return e.type;let t=(r=e.as)!=null?r:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return "button"}function U(e,t){let[r,o]=useState(()=>ro(e));return x(()=>{o(ro(e));},[e.type,e.as]),x(()=>{r||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&o("button");},[r,t]),r}function se({container:e,accept:t,walk:r,enabled:o=!0}){let n=useRef(t),i=useRef(r);useEffect(()=>{n.current=t,i.current=r;},[t,r]),x(()=>{if(!e||!o)return;let a=n.current,l=i.current,s=Object.assign(c=>a(c),{acceptNode:a}),u=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;u.nextNode();)l(u.currentNode);},[e,o,n,i]);}var Ar={[1](e){return e.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},[0](e){return e.disabled||e.comboboxState===0?e:{...e,comboboxState:0}},[2](e,t){return e.disabled===t.disabled?e:{...e,disabled:t.disabled}},[3](e,t){if(e.disabled||e.optionsRef.current&&!e.optionsPropsRef.current.static&&e.comboboxState===1)return e;let r=ae(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return e.activeOptionIndex===r?e:{...e,activeOptionIndex:r}},[4]:(e,t)=>{var i;let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,o=Array.from((i=e.optionsRef.current)==null?void 0:i.querySelectorAll('[id^="headlessui-combobox-option-"]')).reduce((a,l,s)=>Object.assign(a,{[l.id]:s}),{}),n=[...e.options,{id:t.id,dataRef:t.dataRef}].sort((a,l)=>o[a.id]-o[l.id]);return {...e,options:n,activeOptionIndex:(()=>r===null?null:n.indexOf(r))()}},[5]:(e,t)=>{let r=e.options.slice(),o=e.activeOptionIndex!==null?r[e.activeOptionIndex]:null,n=r.findIndex(i=>i.id===t.id);return n!==-1&&r.splice(n,1),{...e,options:r,activeOptionIndex:(()=>n===e.activeOptionIndex||o===null?null:r.indexOf(o))()}}},vt=createContext(null);vt.displayName="ComboboxContext";function pe(e){let t=useContext(vt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,pe),r}return t}var Rt=createContext(null);Rt.displayName="ComboboxActions";function Ue(){let e=useContext(Rt);if(e===null){let t=new Error("ComboboxActions is missing a parent <Combobox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ue),t}return e}function hr(e,t){return S(t.type,Ar,e,t)}var Or=Fragment$2,Ir=D(function(t,r){let{value:o,onChange:n,disabled:i=!1,...a}=t,l=useRef({value:o,onChange:n}),s=useRef({static:!1,hold:!1}),u=useRef({displayValue:void 0}),c=useReducer(hr,{comboboxState:1,comboboxPropsRef:l,optionsPropsRef:s,inputPropsRef:u,labelRef:createRef(),inputRef:createRef(),buttonRef:createRef(),optionsRef:createRef(),disabled:i,options:[],activeOptionIndex:null}),[{comboboxState:m,options:b,activeOptionIndex:T,optionsRef:y,inputRef:p,buttonRef:f},d]=c;x(()=>{l.current.value=o;},[o,l]),x(()=>{l.current.onChange=n;},[n,l]),x(()=>d({type:2,disabled:i}),[i]),w("mousedown",O=>{var N,K,V;let L=O.target;m===0&&(((N=f.current)==null?void 0:N.contains(L))||((K=p.current)==null?void 0:K.contains(L))||((V=y.current)==null?void 0:V.contains(L))||d({type:1}));});let P=T===null?null:b[T].dataRef.current.value,C=useMemo(()=>({open:m===0,disabled:i,activeIndex:T,activeOption:P}),[m,i,b,T]),R=useCallback(()=>{if(!p.current||o===void 0)return;let O=u.current.displayValue;typeof O=="function"?p.current.value=O(o):typeof o=="string"&&(p.current.value=o);},[o,p,u]),g=useCallback(O=>{let L=b.find(K=>K.id===O);if(!L)return;let{dataRef:N}=L;l.current.onChange(N.current.value),R();},[b,l,p]),v=useCallback(()=>{if(T!==null){let{dataRef:O}=b[T];l.current.onChange(O.current.value),R();}},[T,b,l,p]),h=useMemo(()=>({selectOption:g,selectActiveOption:v}),[g,v]);return x(()=>{m===1&&R();},[R,m]),x(R,[R]),React__default.createElement(Rt.Provider,{value:h},React__default.createElement(vt.Provider,{value:c},React__default.createElement(W,{value:S(m,{[0]:0,[1]:1})},E({props:r===null?a:{...a,ref:r},slot:C,defaultTag:Or,name:"Combobox"}))))}),Lr="input",Dr=D(function(t,r){var R,g;let{value:o,onChange:n,displayValue:i,...a}=t,[l,s]=pe("Combobox.Input"),u=Ue(),c=I(l.inputRef,r),m=l.inputPropsRef,b=`headlessui-combobox-input-${A()}`,T=Q(),y=ke(n);x(()=>{m.current.displayValue=i;},[i,m]);let p=useCallback(v=>{switch(v.key){case"Enter":v.preventDefault(),v.stopPropagation(),u.selectActiveOption(),s({type:1});break;case"ArrowDown":return v.preventDefault(),v.stopPropagation(),S(l.comboboxState,{[0]:()=>s({type:3,focus:2}),[1]:()=>{s({type:0}),T.nextFrame(()=>{l.comboboxPropsRef.current.value||s({type:3,focus:0});});}});case"ArrowUp":return v.preventDefault(),v.stopPropagation(),S(l.comboboxState,{[0]:()=>s({type:3,focus:1}),[1]:()=>{s({type:0}),T.nextFrame(()=>{l.comboboxPropsRef.current.value||s({type:3,focus:3});});}});case"Home":case"PageUp":return v.preventDefault(),v.stopPropagation(),s({type:3,focus:0});case"End":case"PageDown":return v.preventDefault(),v.stopPropagation(),s({type:3,focus:3});case"Escape":return v.preventDefault(),l.optionsRef.current&&!l.optionsPropsRef.current.static&&v.stopPropagation(),s({type:1});case"Tab":u.selectActiveOption(),s({type:1});break}},[T,s,l,u]),f=useCallback(v=>{var h;s({type:0}),(h=y.current)==null||h.call(y,v);},[s,y]),d=ee(()=>{if(!!l.labelRef.current)return [l.labelRef.current.id].join(" ")},[l.labelRef.current]),P=useMemo(()=>({open:l.comboboxState===0,disabled:l.disabled}),[l]),C={ref:c,id:b,role:"combobox",type:"text","aria-controls":(R=l.optionsRef.current)==null?void 0:R.id,"aria-expanded":l.disabled?void 0:l.comboboxState===0,"aria-activedescendant":l.activeOptionIndex===null||(g=l.options[l.activeOptionIndex])==null?void 0:g.id,"aria-labelledby":d,disabled:l.disabled,onKeyDown:p,onChange:f};return E({props:{...a,...C},slot:P,defaultTag:Lr,name:"Combobox.Input"})}),Mr="button",Fr=D(function(t,r){var p;let[o,n]=pe("Combobox.Button"),i=Ue(),a=I(o.buttonRef,r),l=`headlessui-combobox-button-${A()}`,s=Q(),u=useCallback(f=>{switch(f.key){case"ArrowDown":return f.preventDefault(),f.stopPropagation(),o.comboboxState===1&&(n({type:0}),s.nextFrame(()=>{o.comboboxPropsRef.current.value||n({type:3,focus:0});})),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})});case"ArrowUp":return f.preventDefault(),f.stopPropagation(),o.comboboxState===1&&(n({type:0}),s.nextFrame(()=>{o.comboboxPropsRef.current.value||n({type:3,focus:3});})),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})});case"Escape":return f.preventDefault(),o.optionsRef.current&&!o.optionsPropsRef.current.static&&f.stopPropagation(),n({type:1}),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})})}},[s,n,o,i]),c=useCallback(f=>{if(G(f.currentTarget))return f.preventDefault();o.comboboxState===0?n({type:1}):(f.preventDefault(),n({type:0})),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})});},[n,s,o]),m=ee(()=>{if(!!o.labelRef.current)return [o.labelRef.current.id,l].join(" ")},[o.labelRef.current,l]),b=useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]),T=t,y={ref:a,id:l,type:U(t,o.buttonRef),tabIndex:-1,"aria-haspopup":!0,"aria-controls":(p=o.optionsRef.current)==null?void 0:p.id,"aria-expanded":o.disabled?void 0:o.comboboxState===0,"aria-labelledby":m,disabled:o.disabled,onClick:c,onKeyDown:u};return E({props:{...T,...y},slot:b,defaultTag:Mr,name:"Combobox.Button"})}),wr="label";function kr(e){let[t]=pe("Combobox.Label"),r=`headlessui-combobox-label-${A()}`,o=useCallback(()=>{var a;return (a=t.inputRef.current)==null?void 0:a.focus({preventScroll:!0})},[t.inputRef]),n=useMemo(()=>({open:t.comboboxState===0,disabled:t.disabled}),[t]),i={ref:t.labelRef,id:r,onClick:o};return E({props:{...e,...i},slot:n,defaultTag:wr,name:"Combobox.Label"})}var _r="ul",Gr=1|2,Hr=D(function(t,r){var y;let{hold:o=!1,...n}=t,[i]=pe("Combobox.Options"),{optionsPropsRef:a}=i,l=I(i.optionsRef,r),s=`headlessui-combobox-options-${A()}`,u=_(),c=(()=>u!==null?u===0:i.comboboxState===0)();x(()=>{var p;a.current.static=(p=t.static)!=null?p:!1;},[a,t.static]),x(()=>{a.current.hold=o;},[o,a]),se({container:i.optionsRef.current,enabled:i.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none");}});let m=ee(()=>{var p,f,d;return (d=(p=i.labelRef.current)==null?void 0:p.id)!=null?d:(f=i.buttonRef.current)==null?void 0:f.id},[i.labelRef.current,i.buttonRef.current]),b=useMemo(()=>({open:i.comboboxState===0}),[i]),T={"aria-activedescendant":i.activeOptionIndex===null||(y=i.options[i.activeOptionIndex])==null?void 0:y.id,"aria-labelledby":m,role:"listbox",id:s,ref:l};return E({props:{...n,...T},slot:b,defaultTag:_r,features:Gr,visible:c,name:"Combobox.Options"})}),Ur="li";function Br(e){let{disabled:t=!1,value:r,...o}=e,[n,i]=pe("Combobox.Option"),a=Ue(),l=`headlessui-combobox-option-${A()}`,s=n.activeOptionIndex!==null?n.options[n.activeOptionIndex].id===l:!1,u=n.comboboxPropsRef.current.value===r,c=useRef({disabled:t,value:r});x(()=>{c.current.disabled=t;},[c,t]),x(()=>{c.current.value=r;},[c,r]),x(()=>{var P,C;c.current.textValue=(C=(P=document.getElementById(l))==null?void 0:P.textContent)==null?void 0:C.toLowerCase();},[c,l]);let m=useCallback(()=>a.selectOption(l),[a,l]);x(()=>(i({type:4,id:l,dataRef:c}),()=>i({type:5,id:l})),[c,l]),x(()=>{n.comboboxState===0&&(!u||i({type:3,focus:4,id:l}));},[n.comboboxState,u,l]),x(()=>{if(n.comboboxState!==0||!s)return;let P=k();return P.requestAnimationFrame(()=>{var C,R;(R=(C=document.getElementById(l))==null?void 0:C.scrollIntoView)==null||R.call(C,{block:"nearest"});}),P.dispose},[l,s,n.comboboxState,n.activeOptionIndex]);let b=useCallback(P=>{if(t)return P.preventDefault();m(),i({type:1}),k().nextFrame(()=>{var C;return (C=n.inputRef.current)==null?void 0:C.focus({preventScroll:!0})});},[i,n.inputRef,t,m]),T=useCallback(()=>{if(t)return i({type:3,focus:5});i({type:3,focus:4,id:l});},[t,l,i]),y=useCallback(()=>{t||s||i({type:3,focus:4,id:l});},[t,s,l,i]),p=useCallback(()=>{t||!s||n.optionsPropsRef.current.hold||i({type:3,focus:5});},[t,s,i,n.comboboxState,n.comboboxPropsRef]),f=useMemo(()=>({active:s,selected:u,disabled:t}),[s,u,t]);return E({props:{...o,...{id:l,role:"option",tabIndex:t===!0?void 0:-1,"aria-disabled":t===!0?!0:void 0,"aria-selected":u===!0?!0:void 0,disabled:void 0,onClick:b,onFocus:T,onPointerMove:y,onMouseMove:y,onPointerLeave:p,onMouseLeave:p}},slot:f,defaultTag:Ur,name:"Combobox.Option"})}Object.assign(Ir,{Input:Dr,Button:Fr,Label:kr,Options:Hr,Option:Br});var Et=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");function xe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Et))}function de(e,t=0){return e===document.body?!1:S(t,{[0](){return e.matches(Et)},[1](){let r=e;for(;r!==null;){if(r.matches(Et))return !0;r=r.parentElement;}return !1}})}function ce(e){e==null||e.focus({preventScroll:!0});}function M(e,t){let r=Array.isArray(e)?e.slice().sort((c,m)=>{let b=c.compareDocumentPosition(m);return b&Node.DOCUMENT_POSITION_FOLLOWING?-1:b&Node.DOCUMENT_POSITION_PRECEDING?1:0}):xe(e),o=document.activeElement,n=(()=>{if(t&(1|4))return 1;if(t&(2|8))return -1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,r.indexOf(o))-1;if(t&4)return Math.max(0,r.indexOf(o))+1;if(t&8)return r.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=t&32?{preventScroll:!0}:{},l=0,s=r.length,u;do{if(l>=s||l+s<=0)return 0;let c=i+l;if(t&16)c=(c+s)%s;else {if(c<0)return 3;if(c>=s)return 1}u=r[c],u==null||u.focus(a),l+=n;}while(u!==document.activeElement);return u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}function Be(){let e=useRef(!1);return useEffect(()=>(e.current=!0,()=>{e.current=!1;}),[]),e}function Ne(e,t=30,{initialFocus:r,containers:o}={}){let n=useRef(typeof window!="undefined"?document.activeElement:null),i=useRef(null),a=Be(),l=Boolean(t&16),s=Boolean(t&2);useEffect(()=>{!l||(n.current=document.activeElement);},[l]),useEffect(()=>{if(!!l)return ()=>{ce(n.current),n.current=null;}},[l]),useEffect(()=>{if(!s||!e.current)return;let u=document.activeElement;if(r==null?void 0:r.current){if((r==null?void 0:r.current)===u){i.current=u;return}}else if(e.current.contains(u)){i.current=u;return}(r==null?void 0:r.current)?ce(r.current):M(e.current,1)===0&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=document.activeElement;},[e,r,s]),w("keydown",u=>{!(t&4)||!e.current||u.key==="Tab"&&(u.preventDefault(),M(e.current,(u.shiftKey?2:4)|16)===2&&(i.current=document.activeElement));}),w("focus",u=>{if(!(t&8))return;let c=new Set(o==null?void 0:o.current);if(c.add(e),!c.size)return;let m=i.current;if(!m||!a.current)return;let b=u.target;b&&b instanceof HTMLElement?Kr(c,b)?(i.current=b,ce(b)):(u.preventDefault(),u.stopPropagation(),ce(m)):ce(i.current);},!0);}function Kr(e,t){var r;for(let o of e)if((r=o.current)==null?void 0:r.contains(t))return !0;return !1}var fe=new Set,J=new Map;function po(e){e.setAttribute("aria-hidden","true"),e.inert=!0;}function co(e){let t=J.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert);}function fo(e,t=!0){x(()=>{if(!t||!e.current)return;let r=e.current;fe.add(r);for(let o of J.keys())o.contains(r)&&(co(o),J.delete(o));return document.querySelectorAll("body > *").forEach(o=>{if(o instanceof HTMLElement){for(let n of fe)if(o.contains(n))return;fe.size===1&&(J.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),po(o));}}),()=>{if(fe.delete(r),fe.size>0)document.querySelectorAll("body > *").forEach(o=>{if(o instanceof HTMLElement&&!J.has(o)){for(let n of fe)if(o.contains(n))return;J.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),po(o);}});else for(let o of J.keys())co(o),J.delete(o);}},[t]);}var mo=createContext(!1);function bo(){return useContext(mo)}function At(e){return React__default.createElement(mo.Provider,{value:e.force},e.children)}function Xr(){let e=bo(),t=useContext(Po),[r,o]=useState(()=>{if(!e&&t!==null||typeof window=="undefined")return null;let n=document.getElementById("headlessui-portal-root");if(n)return n;let i=document.createElement("div");return i.setAttribute("id","headlessui-portal-root"),document.body.appendChild(i)});return useEffect(()=>{r!==null&&(document.body.contains(r)||document.body.appendChild(r));},[r]),useEffect(()=>{e||t!==null&&o(t.current);},[t,o,e]),r}var Jr=Fragment$2;function We(e){let t=e,r=Xr(),[o]=useState(()=>typeof window=="undefined"?null:document.createElement("div")),n=q();return x(()=>{if(!!r&&!!o)return r.appendChild(o),()=>{var i;!r||!o||(r.removeChild(o),r.childNodes.length<=0&&((i=r.parentElement)==null||i.removeChild(r)));}},[r,o]),n?!r||!o?null:createPortal(E({props:t,defaultTag:Jr,name:"Portal"}),o):null}var Zr=Fragment$2,Po=createContext(null);function en(e){let{target:t,...r}=e;return React__default.createElement(Po.Provider,{value:t},E({props:r,defaultTag:Zr,name:"Popover.Group"}))}We.Group=en;var vo=createContext(null);function Ro(){let e=useContext(vo);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ro),t}return e}function re(){let[e,t]=useState([]);return [e.length>0?e.join(" "):void 0,useMemo(()=>function(o){let n=useCallback(a=>(t(l=>[...l,a]),()=>t(l=>{let s=l.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s})),[]),i=useMemo(()=>({register:n,slot:o.slot,name:o.name,props:o.props}),[n,o.slot,o.name,o.props]);return React__default.createElement(vo.Provider,{value:i},o.children)},[t])]}var an="p";function me(e){let t=Ro(),r=`headlessui-description-${A()}`;x(()=>t.register(r),[r,t.register]);let o=e,n={...t.props,id:r};return E({props:{...o,...n},slot:t.slot||{},defaultTag:an,name:t.name||"Description"})}var ht=createContext(()=>{});ht.displayName="StackContext";function cn(){return useContext(ht)}function Eo({children:e,onUpdate:t,type:r,element:o}){let n=cn(),i=useCallback((...a)=>{t==null||t(...a),n(...a);},[n,t]);return x(()=>(i(0,r,o),()=>i(1,r,o)),[i,r,o]),React__default.createElement(ht.Provider,{value:i},e)}var yn={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Ve=createContext(null);Ve.displayName="DialogContext";function It(e){let t=useContext(Ve);if(t===null){let r=new Error(`<${e} /> is missing a parent <${An.displayName} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,It),r}return t}function gn(e,t){return S(t.type,yn,e,t)}var Pn="div",xn=1|2,vn=D(function(t,r){let{open:o,onClose:n,initialFocus:i,...a}=t,[l,s]=useState(0),u=_();o===void 0&&u!==null&&(o=S(u,{[0]:!0,[1]:!1}));let c=useRef(new Set),m=useRef(null),b=I(m,r),T=t.hasOwnProperty("open")||u!==null,y=t.hasOwnProperty("onClose");if(!T&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!T)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof n!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n}`);let p=o?0:1,f=(()=>u!==null?u===0:p===0)(),[d,P]=useReducer(gn,{titleId:null,descriptionId:null}),C=useCallback(()=>n(!1),[n]),R=useCallback(F=>P({type:0,id:F}),[P]),v=q()&&p===0,h=l>1,O=useContext(Ve)!==null;Ne(m,v?S(h?"parent":"leaf",{parent:16,leaf:30}):1,{initialFocus:i,containers:c}),fo(m,h?v:!1),w("mousedown",F=>{var H;let $=F.target;p===0&&(h||((H=m.current)==null?void 0:H.contains($))||C());}),w("keydown",F=>{F.key==="Escape"&&p===0&&(h||(F.preventDefault(),F.stopPropagation(),C()));}),useEffect(()=>{if(p!==0||O)return;let F=document.documentElement.style.overflow,$=document.documentElement.style.paddingRight,H=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${H}px`,()=>{document.documentElement.style.overflow=F,document.documentElement.style.paddingRight=$;}},[p,O]),useEffect(()=>{if(p!==0||!m.current)return;let F=new IntersectionObserver($=>{for(let H of $)H.boundingClientRect.x===0&&H.boundingClientRect.y===0&&H.boundingClientRect.width===0&&H.boundingClientRect.height===0&&C();});return F.observe(m.current),()=>F.disconnect()},[p,m,C]);let[N,K]=re(),V=`headlessui-dialog-${A()}`,Fe=useMemo(()=>[{dialogState:p,close:C,setTitleId:R},d],[p,d,C,R]),ge=useMemo(()=>({open:p===0}),[p]),we={ref:b,id:V,role:"dialog","aria-modal":p===0?!0:void 0,"aria-labelledby":d.titleId,"aria-describedby":N,onClick(F){F.stopPropagation();}},X=a;return React__default.createElement(Eo,{type:"Dialog",element:m,onUpdate:useCallback((F,$,H)=>{$==="Dialog"&&S(F,{[0](){c.current.add(H),s(Pe=>Pe+1);},[1](){c.current.add(H),s(Pe=>Pe-1);}});},[])},React__default.createElement(At,{force:!0},React__default.createElement(We,null,React__default.createElement(Ve.Provider,{value:Fe},React__default.createElement(We.Group,{target:m},React__default.createElement(At,{force:!1},React__default.createElement(K,{slot:ge,name:"Dialog.Description"},E({props:{...X,...we},slot:ge,defaultTag:Pn,features:xn,visible:f,name:"Dialog"}))))))))}),Rn="div",En=D(function(t,r){let[{dialogState:o,close:n}]=It("Dialog.Overlay"),i=I(r),a=`headlessui-dialog-overlay-${A()}`,l=useCallback(m=>{if(m.target===m.currentTarget){if(G(m.currentTarget))return m.preventDefault();m.preventDefault(),m.stopPropagation(),n();}},[n]),s=useMemo(()=>({open:o===0}),[o]);return E({props:{...t,...{ref:i,id:a,"aria-hidden":!0,onClick:l}},slot:s,defaultTag:Rn,name:"Dialog.Overlay"})}),Cn="h2";function Sn(e){let[{dialogState:t,setTitleId:r}]=It("Dialog.Title"),o=`headlessui-dialog-title-${A()}`;useEffect(()=>(r(o),()=>r(null)),[o,r]);let n=useMemo(()=>({open:t===0}),[t]);return E({props:{...e,...{id:o}},slot:n,defaultTag:Cn,name:"Dialog.Title"})}var An=Object.assign(vn,{Overlay:En,Title:Sn,Description:me});var Ln={[0]:e=>({...e,disclosureState:S(e.disclosureState,{[0]:1,[1]:0})}),[1]:e=>e.disclosureState===1?e:{...e,disclosureState:1},[4](e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},[5](e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},[2](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[3](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Mt=createContext(null);Mt.displayName="DisclosureContext";function Ft(e){let t=useContext(Mt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ye.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ft),r}return t}var wt=createContext(null);wt.displayName="DisclosureAPIContext";function Ao(e){let t=useContext(wt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ye.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ao),r}return t}var kt=createContext(null);kt.displayName="DisclosurePanelContext";function Dn(){return useContext(kt)}function Mn(e,t){return S(t.type,Ln,e,t)}var Fn=Fragment$2;function Ye(e){let{defaultOpen:t=!1,...r}=e,o=`headlessui-disclosure-button-${A()}`,n=`headlessui-disclosure-panel-${A()}`,i=useReducer(Mn,{disclosureState:t?0:1,linkedPanel:!1,buttonId:o,panelId:n}),[{disclosureState:a},l]=i;useEffect(()=>l({type:2,buttonId:o}),[o,l]),useEffect(()=>l({type:3,panelId:n}),[n,l]);let s=useCallback(m=>{l({type:1});let b=(()=>m?m instanceof HTMLElement?m:m.current instanceof HTMLElement?m.current:document.getElementById(o):document.getElementById(o))();b==null||b.focus();},[l,o]),u=useMemo(()=>({close:s}),[s]),c=useMemo(()=>({open:a===0,close:s}),[a,s]);return React__default.createElement(Mt.Provider,{value:i},React__default.createElement(wt.Provider,{value:u},React__default.createElement(W,{value:S(a,{[0]:0,[1]:1})},E({props:r,slot:c,defaultTag:Fn,name:"Disclosure"}))))}var wn="button",kn=D(function(t,r){let[o,n]=Ft("Disclosure.Button"),i=useRef(null),a=I(i,r),l=Dn(),s=l===null?!1:l===o.panelId,u=useCallback(f=>{var d;if(s){if(o.disclosureState===1)return;switch(f.key){case" ":case"Enter":f.preventDefault(),f.stopPropagation(),n({type:0}),(d=document.getElementById(o.buttonId))==null||d.focus();break}}else switch(f.key){case" ":case"Enter":f.preventDefault(),f.stopPropagation(),n({type:0});break}},[n,s,o.disclosureState,o.buttonId]),c=useCallback(f=>{switch(f.key){case" ":f.preventDefault();break}},[]),m=useCallback(f=>{var d;G(f.currentTarget)||t.disabled||(s?(n({type:0}),(d=document.getElementById(o.buttonId))==null||d.focus()):n({type:0}));},[n,t.disabled,o.buttonId,s]),b=useMemo(()=>({open:o.disclosureState===0}),[o]),T=U(t,i),y=t,p=s?{ref:a,type:T,onKeyDown:u,onClick:m}:{ref:a,id:o.buttonId,type:T,"aria-expanded":t.disabled?void 0:o.disclosureState===0,"aria-controls":o.linkedPanel?o.panelId:void 0,onKeyDown:u,onKeyUp:c,onClick:m};return E({props:{...y,...p},slot:b,defaultTag:wn,name:"Disclosure.Button"})}),_n="div",Gn=1|2,Hn=D(function(t,r){let[o,n]=Ft("Disclosure.Panel"),{close:i}=Ao("Disclosure.Panel"),a=I(r,()=>{o.linkedPanel||n({type:4});}),l=_(),s=(()=>l!==null?l===0:o.disclosureState===0)();useEffect(()=>()=>n({type:5}),[n]),useEffect(()=>{var b;o.disclosureState===1&&((b=t.unmount)!=null?b:!0)&&n({type:5});},[o.disclosureState,t.unmount,n]);let u=useMemo(()=>({open:o.disclosureState===0,close:i}),[o,i]),c={ref:a,id:o.panelId},m=t;return React__default.createElement(kt.Provider,{value:o.panelId},E({props:{...m,...c},slot:u,defaultTag:_n,features:Gn,visible:s,name:"Disclosure.Panel"}))});Ye.Button=kn;Ye.Panel=Hn;var $n={[1](e){return e.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},[0](e){return e.disabled||e.listboxState===0?e:{...e,listboxState:0}},[2](e,t){return e.disabled===t.disabled?e:{...e,disabled:t.disabled}},[3](e,t){return e.orientation===t.orientation?e:{...e,orientation:t.orientation}},[4](e,t){if(e.disabled||e.listboxState===1)return e;let r=ae(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return e.searchQuery===""&&e.activeOptionIndex===r?e:{...e,searchQuery:"",activeOptionIndex:r}},[5]:(e,t)=>{if(e.disabled||e.listboxState===1)return e;let o=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),a=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+o).concat(e.options.slice(0,e.activeOptionIndex+o)):e.options).find(s=>{var u;return !s.dataRef.current.disabled&&((u=s.dataRef.current.textValue)==null?void 0:u.startsWith(n))}),l=a?e.options.indexOf(a):-1;return l===-1||l===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:l}},[6](e){return e.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},[7]:(e,t)=>{var n;let r=Array.from((n=e.optionsRef.current)==null?void 0:n.querySelectorAll('[id^="headlessui-listbox-option-"]')).reduce((i,a,l)=>Object.assign(i,{[a.id]:l}),{}),o=[...e.options,{id:t.id,dataRef:t.dataRef}].sort((i,a)=>r[i.id]-r[a.id]);return {...e,options:o}},[8]:(e,t)=>{let r=e.options.slice(),o=e.activeOptionIndex!==null?r[e.activeOptionIndex]:null,n=r.findIndex(i=>i.id===t.id);return n!==-1&&r.splice(n,1),{...e,options:r,activeOptionIndex:(()=>n===e.activeOptionIndex||o===null?null:r.indexOf(o))()}}},Gt=createContext(null);Gt.displayName="ListboxContext";function Re(e){let t=useContext(Gt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ee.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Re),r}return t}function Qn(e,t){return S(t.type,$n,e,t)}var qn=Fragment$2;function Ee(e){let{value:t,onChange:r,disabled:o=!1,horizontal:n=!1,...i}=e,a=n?"horizontal":"vertical",l=useReducer(Qn,{listboxState:1,propsRef:{current:{value:t,onChange:r}},labelRef:createRef(),buttonRef:createRef(),optionsRef:createRef(),disabled:o,orientation:a,options:[],searchQuery:"",activeOptionIndex:null}),[{listboxState:s,propsRef:u,optionsRef:c,buttonRef:m},b]=l;x(()=>{u.current.value=t;},[t,u]),x(()=>{u.current.onChange=r;},[r,u]),x(()=>b({type:2,disabled:o}),[o]),x(()=>b({type:3,orientation:a}),[a]),w("mousedown",y=>{var f,d,P;let p=y.target;s===0&&(((f=m.current)==null?void 0:f.contains(p))||((d=c.current)==null?void 0:d.contains(p))||(b({type:1}),de(p,1)||(y.preventDefault(),(P=m.current)==null||P.focus())));});let T=useMemo(()=>({open:s===0,disabled:o}),[s,o]);return React__default.createElement(Gt.Provider,{value:l},React__default.createElement(W,{value:S(s,{[0]:0,[1]:1})},E({props:i,slot:T,defaultTag:qn,name:"Listbox"})))}var zn="button",Yn=D(function(t,r){var p;let[o,n]=Re("Listbox.Button"),i=I(o.buttonRef,r),a=`headlessui-listbox-button-${A()}`,l=Q(),s=useCallback(f=>{switch(f.key){case" ":case"Enter":case"ArrowDown":f.preventDefault(),n({type:0}),l.nextFrame(()=>{o.propsRef.current.value||n({type:4,focus:0});});break;case"ArrowUp":f.preventDefault(),n({type:0}),l.nextFrame(()=>{o.propsRef.current.value||n({type:4,focus:3});});break}},[n,o,l]),u=useCallback(f=>{switch(f.key){case" ":f.preventDefault();break}},[]),c=useCallback(f=>{if(G(f.currentTarget))return f.preventDefault();o.listboxState===0?(n({type:1}),l.nextFrame(()=>{var d;return (d=o.buttonRef.current)==null?void 0:d.focus({preventScroll:!0})})):(f.preventDefault(),n({type:0}));},[n,l,o]),m=ee(()=>{if(!!o.labelRef.current)return [o.labelRef.current.id,a].join(" ")},[o.labelRef.current,a]),b=useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]),T=t,y={ref:i,id:a,type:U(t,o.buttonRef),"aria-haspopup":!0,"aria-controls":(p=o.optionsRef.current)==null?void 0:p.id,"aria-expanded":o.disabled?void 0:o.listboxState===0,"aria-labelledby":m,disabled:o.disabled,onKeyDown:s,onKeyUp:u,onClick:c};return E({props:{...T,...y},slot:b,defaultTag:zn,name:"Listbox.Button"})}),Xn="label";function Jn(e){let[t]=Re("Listbox.Label"),r=`headlessui-listbox-label-${A()}`,o=useCallback(()=>{var a;return (a=t.buttonRef.current)==null?void 0:a.focus({preventScroll:!0})},[t.buttonRef]),n=useMemo(()=>({open:t.listboxState===0,disabled:t.disabled}),[t]),i={ref:t.labelRef,id:r,onClick:o};return E({props:{...e,...i},slot:n,defaultTag:Xn,name:"Listbox.Label"})}var Zn="ul",ei=1|2,ti=D(function(t,r){var f;let[o,n]=Re("Listbox.Options"),i=I(o.optionsRef,r),a=`headlessui-listbox-options-${A()}`,l=Q(),s=Q(),u=_(),c=(()=>u!==null?u===0:o.listboxState===0)();x(()=>{let d=o.optionsRef.current;!d||o.listboxState===0&&d!==document.activeElement&&d.focus({preventScroll:!0});},[o.listboxState,o.optionsRef]);let m=useCallback(d=>{switch(s.dispose(),d.key){case" ":if(o.searchQuery!=="")return d.preventDefault(),d.stopPropagation(),n({type:5,value:d.key});case"Enter":if(d.preventDefault(),d.stopPropagation(),n({type:1}),o.activeOptionIndex!==null){let{dataRef:P}=o.options[o.activeOptionIndex];o.propsRef.current.onChange(P.current.value);}k().nextFrame(()=>{var P;return (P=o.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})});break;case S(o.orientation,{vertical:"ArrowDown",horizontal:"ArrowRight"}):return d.preventDefault(),d.stopPropagation(),n({type:4,focus:2});case S(o.orientation,{vertical:"ArrowUp",horizontal:"ArrowLeft"}):return d.preventDefault(),d.stopPropagation(),n({type:4,focus:1});case"Home":case"PageUp":return d.preventDefault(),d.stopPropagation(),n({type:4,focus:0});case"End":case"PageDown":return d.preventDefault(),d.stopPropagation(),n({type:4,focus:3});case"Escape":return d.preventDefault(),d.stopPropagation(),n({type:1}),l.nextFrame(()=>{var P;return (P=o.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})});case"Tab":d.preventDefault(),d.stopPropagation();break;default:d.key.length===1&&(n({type:5,value:d.key}),s.setTimeout(()=>n({type:6}),350));break}},[l,n,s,o]),b=ee(()=>{var d,P,C;return (C=(d=o.labelRef.current)==null?void 0:d.id)!=null?C:(P=o.buttonRef.current)==null?void 0:P.id},[o.labelRef.current,o.buttonRef.current]),T=useMemo(()=>({open:o.listboxState===0}),[o]),y={"aria-activedescendant":o.activeOptionIndex===null||(f=o.options[o.activeOptionIndex])==null?void 0:f.id,"aria-labelledby":b,"aria-orientation":o.orientation,id:a,onKeyDown:m,role:"listbox",tabIndex:0,ref:i};return E({props:{...t,...y},slot:T,defaultTag:Zn,features:ei,visible:c,name:"Listbox.Options"})}),oi="li";function ri(e){let{disabled:t=!1,value:r,...o}=e,[n,i]=Re("Listbox.Option"),a=`headlessui-listbox-option-${A()}`,l=n.activeOptionIndex!==null?n.options[n.activeOptionIndex].id===a:!1,s=n.propsRef.current.value===r,u=useRef({disabled:t,value:r});x(()=>{u.current.disabled=t;},[u,t]),x(()=>{u.current.value=r;},[u,r]),x(()=>{var d,P;u.current.textValue=(P=(d=document.getElementById(a))==null?void 0:d.textContent)==null?void 0:P.toLowerCase();},[u,a]);let c=useCallback(()=>n.propsRef.current.onChange(r),[n.propsRef,r]);x(()=>(i({type:7,id:a,dataRef:u}),()=>i({type:8,id:a})),[u,a]),x(()=>{var d,P;n.listboxState===0&&(!s||(i({type:4,focus:4,id:a}),(P=(d=document.getElementById(a))==null?void 0:d.focus)==null||P.call(d)));},[n.listboxState]),x(()=>{if(n.listboxState!==0||!l)return;let d=k();return d.requestAnimationFrame(()=>{var P,C;(C=(P=document.getElementById(a))==null?void 0:P.scrollIntoView)==null||C.call(P,{block:"nearest"});}),d.dispose},[a,l,n.listboxState,n.activeOptionIndex]);let m=useCallback(d=>{if(t)return d.preventDefault();c(),i({type:1}),k().nextFrame(()=>{var P;return (P=n.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})});},[i,n.buttonRef,t,c]),b=useCallback(()=>{if(t)return i({type:4,focus:5});i({type:4,focus:4,id:a});},[t,a,i]),T=useCallback(()=>{t||l||i({type:4,focus:4,id:a});},[t,l,a,i]),y=useCallback(()=>{t||!l||i({type:4,focus:5});},[t,l,i]),p=useMemo(()=>({active:l,selected:s,disabled:t}),[l,s,t]);return E({props:{...o,...{id:a,role:"option",tabIndex:t===!0?void 0:-1,"aria-disabled":t===!0?!0:void 0,"aria-selected":s===!0?!0:void 0,disabled:void 0,onClick:m,onFocus:b,onPointerMove:T,onMouseMove:T,onPointerLeave:y,onMouseLeave:y}},slot:p,defaultTag:oi,name:"Listbox.Option"})}Ee.Button=Yn;Ee.Label=Jn;Ee.Options=ti;Ee.Option=ri;var ui={[1](e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},[0](e){return e.menuState===0?e:{...e,menuState:0}},[2]:(e,t)=>{let r=ae(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return e.searchQuery===""&&e.activeItemIndex===r?e:{...e,searchQuery:"",activeItemIndex:r}},[3]:(e,t)=>{let o=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),a=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+o).concat(e.items.slice(0,e.activeItemIndex+o)):e.items).find(s=>{var u;return ((u=s.dataRef.current.textValue)==null?void 0:u.startsWith(n))&&!s.dataRef.current.disabled}),l=a?e.items.indexOf(a):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeItemIndex:l}},[4](e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},[5]:(e,t)=>{var n;let r=Array.from((n=e.itemsRef.current)==null?void 0:n.querySelectorAll('[id^="headlessui-menu-item-"]')).reduce((i,a,l)=>Object.assign(i,{[a.id]:l}),{}),o=[...e.items,{id:t.id,dataRef:t.dataRef}].sort((i,a)=>r[i.id]-r[a.id]);return {...e,items:o}},[6]:(e,t)=>{let r=e.items.slice(),o=e.activeItemIndex!==null?r[e.activeItemIndex]:null,n=r.findIndex(i=>i.id===t.id);return n!==-1&&r.splice(n,1),{...e,items:r,activeItemIndex:(()=>n===e.activeItemIndex||o===null?null:r.indexOf(o))()}}},Ht=createContext(null);Ht.displayName="MenuContext";function Je(e){let t=useContext(Ht);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ze.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Je),r}return t}function pi(e,t){return S(t.type,ui,e,t)}var di=Fragment$2;function Ze(e){let t=useReducer(pi,{menuState:1,buttonRef:createRef(),itemsRef:createRef(),items:[],searchQuery:"",activeItemIndex:null}),[{menuState:r,itemsRef:o,buttonRef:n},i]=t;w("mousedown",l=>{var u,c,m;let s=l.target;r===0&&(((u=n.current)==null?void 0:u.contains(s))||((c=o.current)==null?void 0:c.contains(s))||(i({type:1}),de(s,1)||(l.preventDefault(),(m=n.current)==null||m.focus())));});let a=useMemo(()=>({open:r===0}),[r]);return React__default.createElement(Ht.Provider,{value:t},React__default.createElement(W,{value:S(r,{[0]:0,[1]:1})},E({props:e,slot:a,defaultTag:di,name:"Menu"})))}var ci="button",fi=D(function(t,r){var y;let[o,n]=Je("Menu.Button"),i=I(o.buttonRef,r),a=`headlessui-menu-button-${A()}`,l=Q(),s=useCallback(p=>{switch(p.key){case" ":case"Enter":case"ArrowDown":p.preventDefault(),p.stopPropagation(),n({type:0}),l.nextFrame(()=>n({type:2,focus:0}));break;case"ArrowUp":p.preventDefault(),p.stopPropagation(),n({type:0}),l.nextFrame(()=>n({type:2,focus:3}));break}},[n,l]),u=useCallback(p=>{switch(p.key){case" ":p.preventDefault();break}},[]),c=useCallback(p=>{if(G(p.currentTarget))return p.preventDefault();t.disabled||(o.menuState===0?(n({type:1}),l.nextFrame(()=>{var f;return (f=o.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})})):(p.preventDefault(),p.stopPropagation(),n({type:0})));},[n,l,o,t.disabled]),m=useMemo(()=>({open:o.menuState===0}),[o]),b=t,T={ref:i,id:a,type:U(t,o.buttonRef),"aria-haspopup":!0,"aria-controls":(y=o.itemsRef.current)==null?void 0:y.id,"aria-expanded":t.disabled?void 0:o.menuState===0,onKeyDown:s,onKeyUp:u,onClick:c};return E({props:{...b,...T},slot:m,defaultTag:ci,name:"Menu.Button"})}),mi="div",bi=1|2,Ti=D(function(t,r){var p,f;let[o,n]=Je("Menu.Items"),i=I(o.itemsRef,r),a=`headlessui-menu-items-${A()}`,l=Q(),s=_(),u=(()=>s!==null?s===0:o.menuState===0)();useEffect(()=>{let d=o.itemsRef.current;!d||o.menuState===0&&d!==document.activeElement&&d.focus({preventScroll:!0});},[o.menuState,o.itemsRef]),se({container:o.itemsRef.current,enabled:o.menuState===0,accept(d){return d.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:d.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(d){d.setAttribute("role","none");}});let c=useCallback(d=>{var P;switch(l.dispose(),d.key){case" ":if(o.searchQuery!=="")return d.preventDefault(),d.stopPropagation(),n({type:3,value:d.key});case"Enter":if(d.preventDefault(),d.stopPropagation(),n({type:1}),o.activeItemIndex!==null){let{id:C}=o.items[o.activeItemIndex];(P=document.getElementById(C))==null||P.click();}k().nextFrame(()=>{var C;return (C=o.buttonRef.current)==null?void 0:C.focus({preventScroll:!0})});break;case"ArrowDown":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:2});case"ArrowUp":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:1});case"Home":case"PageUp":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:0});case"End":case"PageDown":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:3});case"Escape":d.preventDefault(),d.stopPropagation(),n({type:1}),k().nextFrame(()=>{var C;return (C=o.buttonRef.current)==null?void 0:C.focus({preventScroll:!0})});break;case"Tab":d.preventDefault(),d.stopPropagation();break;default:d.key.length===1&&(n({type:3,value:d.key}),l.setTimeout(()=>n({type:4}),350));break}},[n,l,o]),m=useCallback(d=>{switch(d.key){case" ":d.preventDefault();break}},[]),b=useMemo(()=>({open:o.menuState===0}),[o]),T={"aria-activedescendant":o.activeItemIndex===null||(p=o.items[o.activeItemIndex])==null?void 0:p.id,"aria-labelledby":(f=o.buttonRef.current)==null?void 0:f.id,id:a,onKeyDown:c,onKeyUp:m,role:"menu",tabIndex:0,ref:i};return E({props:{...t,...T},slot:b,defaultTag:mi,features:bi,visible:u,name:"Menu.Items"})}),yi=Fragment$2;function gi(e){let{disabled:t=!1,onClick:r,...o}=e,[n,i]=Je("Menu.Item"),a=`headlessui-menu-item-${A()}`,l=n.activeItemIndex!==null?n.items[n.activeItemIndex].id===a:!1;x(()=>{if(n.menuState!==0||!l)return;let p=k();return p.requestAnimationFrame(()=>{var f,d;(d=(f=document.getElementById(a))==null?void 0:f.scrollIntoView)==null||d.call(f,{block:"nearest"});}),p.dispose},[a,l,n.menuState,n.activeItemIndex]);let s=useRef({disabled:t});x(()=>{s.current.disabled=t;},[s,t]),x(()=>{var p,f;s.current.textValue=(f=(p=document.getElementById(a))==null?void 0:p.textContent)==null?void 0:f.toLowerCase();},[s,a]),x(()=>(i({type:5,id:a,dataRef:s}),()=>i({type:6,id:a})),[s,a]);let u=useCallback(p=>{if(t)return p.preventDefault();if(i({type:1}),k().nextFrame(()=>{var f;return (f=n.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})}),r)return r(p)},[i,n.buttonRef,t,r]),c=useCallback(()=>{if(t)return i({type:2,focus:5});i({type:2,focus:4,id:a});},[t,a,i]),m=useCallback(()=>{t||l||i({type:2,focus:4,id:a});},[t,l,a,i]),b=useCallback(()=>{t||!l||i({type:2,focus:5});},[t,l,i]),T=useMemo(()=>({active:l,disabled:t}),[l,t]);return E({props:{...o,...{id:a,role:"menuitem",tabIndex:t===!0?void 0:-1,"aria-disabled":t===!0?!0:void 0,disabled:void 0,onClick:u,onFocus:c,onPointerMove:m,onMouseMove:m,onPointerLeave:b,onMouseLeave:b}},slot:T,defaultTag:yi,name:"Menu.Item"})}Ze.Button=fi;Ze.Items=Ti;Ze.Item=gi;var vi={[0]:e=>({...e,popoverState:S(e.popoverState,{[0]:1,[1]:0})}),[1](e){return e.popoverState===1?e:{...e,popoverState:1}},[2](e,t){return e.button===t.button?e:{...e,button:t.button}},[3](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[4](e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},[5](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Ut=createContext(null);Ut.displayName="PopoverContext";function ot(e){let t=useContext(Ut);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Te.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ot),r}return t}var Bt=createContext(null);Bt.displayName="PopoverAPIContext";function Mo(e){let t=useContext(Bt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Te.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Mo),r}return t}var Nt=createContext(null);Nt.displayName="PopoverGroupContext";function Fo(){return useContext(Nt)}var Wt=createContext(null);Wt.displayName="PopoverPanelContext";function Ri(){return useContext(Wt)}function Ei(e,t){return S(t.type,vi,e,t)}var Ci="div";function Te(e){let t=`headlessui-popover-button-${A()}`,r=`headlessui-popover-panel-${A()}`,o=useReducer(Ei,{popoverState:1,button:null,buttonId:t,panel:null,panelId:r}),[{popoverState:n,button:i,panel:a},l]=o;useEffect(()=>l({type:3,buttonId:t}),[t,l]),useEffect(()=>l({type:5,panelId:r}),[r,l]);let s=useMemo(()=>({buttonId:t,panelId:r,close:()=>l({type:1})}),[t,r,l]),u=Fo(),c=u==null?void 0:u.registerPopover,m=useCallback(()=>{var p;return (p=u==null?void 0:u.isFocusWithinPopoverGroup())!=null?p:(i==null?void 0:i.contains(document.activeElement))||(a==null?void 0:a.contains(document.activeElement))},[u,i,a]);useEffect(()=>c==null?void 0:c(s),[c,s]),w("focus",()=>{n===0&&(m()||!i||!a||l({type:1}));},!0),w("mousedown",p=>{let f=p.target;n===0&&((i==null?void 0:i.contains(f))||(a==null?void 0:a.contains(f))||(l({type:1}),de(f,1)||(p.preventDefault(),i==null||i.focus())));});let b=useCallback(p=>{l({type:1});let f=(()=>p?p instanceof HTMLElement?p:p.current instanceof HTMLElement?p.current:i:i)();f==null||f.focus();},[l,i]),T=useMemo(()=>({close:b}),[b]),y=useMemo(()=>({open:n===0,close:b}),[n,b]);return React__default.createElement(Ut.Provider,{value:o},React__default.createElement(Bt.Provider,{value:T},React__default.createElement(W,{value:S(n,{[0]:0,[1]:1})},E({props:e,slot:y,defaultTag:Ci,name:"Popover"}))))}var Si="button",Ai=D(function(t,r){let[o,n]=ot("Popover.Button"),i=useRef(null),a=Fo(),l=a==null?void 0:a.closeOthers,s=Ri(),u=s===null?!1:s===o.panelId,c=I(i,r,u?null:g=>n({type:2,button:g})),m=I(i,r),b=useRef(null),T=useRef(typeof window=="undefined"?null:document.activeElement);w("focus",()=>{T.current=b.current,b.current=document.activeElement;},!0);let y=useCallback(g=>{var v,h;if(u){if(o.popoverState===1)return;switch(g.key){case" ":case"Enter":g.preventDefault(),g.stopPropagation(),n({type:1}),(v=o.button)==null||v.focus();break}}else switch(g.key){case" ":case"Enter":g.preventDefault(),g.stopPropagation(),o.popoverState===1&&(l==null||l(o.buttonId)),n({type:0});break;case"Escape":if(o.popoverState!==0)return l==null?void 0:l(o.buttonId);if(!i.current||!i.current.contains(document.activeElement))return;g.preventDefault(),g.stopPropagation(),n({type:1});break;case"Tab":if(o.popoverState!==0||!o.panel||!o.button)return;if(g.shiftKey){if(!T.current||((h=o.button)==null?void 0:h.contains(T.current))||o.panel.contains(T.current))return;let O=xe(),L=O.indexOf(T.current);if(O.indexOf(o.button)>L)return;g.preventDefault(),g.stopPropagation(),M(o.panel,8);}else g.preventDefault(),g.stopPropagation(),M(o.panel,1);break}},[n,o.popoverState,o.buttonId,o.button,o.panel,i,l,u]),p=useCallback(g=>{var v;if(!u&&(g.key===" "&&g.preventDefault(),o.popoverState===0&&!!o.panel&&!!o.button))switch(g.key){case"Tab":if(!T.current||((v=o.button)==null?void 0:v.contains(T.current))||o.panel.contains(T.current))return;let h=xe(),O=h.indexOf(T.current);if(h.indexOf(o.button)>O)return;g.preventDefault(),g.stopPropagation(),M(o.panel,8);break}},[o.popoverState,o.panel,o.button,u]),f=useCallback(g=>{var v,h;G(g.currentTarget)||t.disabled||(u?(n({type:1}),(v=o.button)==null||v.focus()):(o.popoverState===1&&(l==null||l(o.buttonId)),(h=o.button)==null||h.focus(),n({type:0})));},[n,o.button,o.popoverState,o.buttonId,t.disabled,l,u]),d=useMemo(()=>({open:o.popoverState===0}),[o]),P=U(t,i),C=t,R=u?{ref:m,type:P,onKeyDown:y,onClick:f}:{ref:c,id:o.buttonId,type:P,"aria-expanded":t.disabled?void 0:o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:y,onKeyUp:p,onClick:f};return E({props:{...C,...R},slot:d,defaultTag:Si,name:"Popover.Button"})}),hi="div",Oi=1|2,Ii=D(function(t,r){let[{popoverState:o},n]=ot("Popover.Overlay"),i=I(r),a=`headlessui-popover-overlay-${A()}`,l=_(),s=(()=>l!==null?l===0:o===0)(),u=useCallback(T=>{if(G(T.currentTarget))return T.preventDefault();n({type:1});},[n]),c=useMemo(()=>({open:o===0}),[o]);return E({props:{...t,...{ref:i,id:a,"aria-hidden":!0,onClick:u}},slot:c,defaultTag:hi,features:Oi,visible:s,name:"Popover.Overlay"})}),Li$1="div",Di=1|2,Mi=D(function(t,r){let{focus:o=!1,...n}=t,[i,a]=ot("Popover.Panel"),{close:l}=Mo("Popover.Panel"),s=useRef(null),u=I(s,r,p=>{a({type:4,panel:p});}),c=_(),m=(()=>c!==null?c===0:i.popoverState===0)(),b=useCallback(p=>{var f;switch(p.key){case"Escape":if(i.popoverState!==0||!s.current||!s.current.contains(document.activeElement))return;p.preventDefault(),p.stopPropagation(),a({type:1}),(f=i.button)==null||f.focus();break}},[i,s,a]);useEffect(()=>()=>a({type:4,panel:null}),[a]),useEffect(()=>{var p;t.static||i.popoverState===1&&((p=t.unmount)!=null?p:!0)&&a({type:4,panel:null});},[i.popoverState,t.unmount,t.static,a]),useEffect(()=>{if(!o||i.popoverState!==0||!s.current)return;let p=document.activeElement;s.current.contains(p)||M(s.current,1);},[o,s,i.popoverState]),w("keydown",p=>{var d;if(i.popoverState!==0||!s.current||p.key!=="Tab"||!document.activeElement||!s.current||!s.current.contains(document.activeElement))return;p.preventDefault();let f=M(s.current,p.shiftKey?2:4);if(f===3)return (d=i.button)==null?void 0:d.focus();if(f===1){if(!i.button)return;let P=xe(),C=P.indexOf(i.button),R=P.splice(C+1).filter(g=>{var v;return !((v=s.current)==null?void 0:v.contains(g))});M(R,1)===0&&M(document.body,1);}}),w("focus",()=>{var p;!o||i.popoverState===0&&(!s.current||((p=s.current)==null?void 0:p.contains(document.activeElement))||a({type:1}));},!0);let T=useMemo(()=>({open:i.popoverState===0,close:l}),[i,l]),y={ref:u,id:i.panelId,onKeyDown:b};return React__default.createElement(Wt.Provider,{value:i.panelId},E({props:{...n,...y},slot:T,defaultTag:Li$1,features:Di,visible:m,name:"Popover.Panel"}))}),Fi="div";function wi(e){let t=useRef(null),[r,o]=useState([]),n=useCallback(b=>{o(T=>{let y=T.indexOf(b);if(y!==-1){let p=T.slice();return p.splice(y,1),p}return T});},[o]),i=useCallback(b=>(o(T=>[...T,b]),()=>n(b)),[o,n]),a=useCallback(()=>{var T;let b=document.activeElement;return ((T=t.current)==null?void 0:T.contains(b))?!0:r.some(y=>{var p,f;return ((p=document.getElementById(y.buttonId))==null?void 0:p.contains(b))||((f=document.getElementById(y.panelId))==null?void 0:f.contains(b))})},[t,r]),l=useCallback(b=>{for(let T of r)T.buttonId!==b&&T.close();},[r]),s=useMemo(()=>({registerPopover:i,unregisterPopover:n,isFocusWithinPopoverGroup:a,closeOthers:l}),[i,n,a,l]),u=useMemo(()=>({}),[]),c={ref:t},m=e;return React__default.createElement(Nt.Provider,{value:s},E({props:{...m,...c},slot:u,defaultTag:Fi,name:"Popover.Group"}))}Te.Button=Ai;Te.Overlay=Ii;Te.Panel=Mi;Te.Group=wi;function wo(e=0){let[t,r]=useState(e),o=useCallback(l=>r(s=>s|l),[r]),n=useCallback(l=>Boolean(t&l),[t]),i=useCallback(l=>r(s=>s&~l),[r]),a=useCallback(l=>r(s=>s^l),[r]);return {addFlag:o,hasFlag:n,removeFlag:i,toggleFlag:a}}var _o=createContext(null);function Go(){let e=useContext(_o);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Go),t}return e}function Ae(){let[e,t]=useState([]);return [e.length>0?e.join(" "):void 0,useMemo(()=>function(o){let n=useCallback(a=>(t(l=>[...l,a]),()=>t(l=>{let s=l.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s})),[]),i=useMemo(()=>({register:n,slot:o.slot,name:o.name,props:o.props}),[n,o.slot,o.name,o.props]);return React__default.createElement(_o.Provider,{value:i},o.children)},[t])]}var Ni="label";function nt(e){let{passive:t=!1,...r}=e,o=Go(),n=`headlessui-label-${A()}`;x(()=>o.register(n),[n,o.register]);let i={...o.props,id:n},a={...r,...i};return t&&delete a.onClick,E({props:a,slot:o.slot||{},defaultTag:Ni,name:o.name||"Label"})}var Vi={[0](e,t){return {...e,options:[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}]}},[1](e,t){let r=e.options.slice(),o=e.options.findIndex(n=>n.id===t.id);return o===-1?e:(r.splice(o,1),{...e,options:r})}},jt=createContext(null);jt.displayName="RadioGroupContext";function Ho(e){let t=useContext(jt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${lt.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ho),r}return t}function $i(e,t){return S(t.type,Vi,e,t)}var Qi="div";function lt(e){let{value:t,onChange:r,disabled:o=!1,...n}=e,[{options:i},a]=useReducer($i,{options:[]}),[l,s]=Ae(),[u,c]=re(),m=`headlessui-radiogroup-${A()}`,b=useRef(null),T=useMemo(()=>i.find(R=>!R.propsRef.current.disabled),[i]),y=useMemo(()=>i.some(R=>R.propsRef.current.value===t),[i,t]),p=useCallback(R=>{var v;if(o||R===t)return !1;let g=(v=i.find(h=>h.propsRef.current.value===R))==null?void 0:v.propsRef.current;return (g==null?void 0:g.disabled)?!1:(r(R),!0)},[r,t,o,i]);se({container:b.current,accept(R){return R.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:R.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(R){R.setAttribute("role","none");}});let f=useCallback(R=>{if(!b.current)return;let v=i.filter(h=>h.propsRef.current.disabled===!1).map(h=>h.element.current);switch(R.key){case"ArrowLeft":case"ArrowUp":if(R.preventDefault(),R.stopPropagation(),M(v,2|16)===2){let O=i.find(L=>L.element.current===document.activeElement);O&&p(O.propsRef.current.value);}break;case"ArrowRight":case"ArrowDown":if(R.preventDefault(),R.stopPropagation(),M(v,4|16)===2){let O=i.find(L=>L.element.current===document.activeElement);O&&p(O.propsRef.current.value);}break;case" ":{R.preventDefault(),R.stopPropagation();let h=i.find(O=>O.element.current===document.activeElement);h&&p(h.propsRef.current.value);}break}},[b,i,p]),d=useCallback(R=>(a({type:0,...R}),()=>a({type:1,id:R.id})),[a]),P=useMemo(()=>({registerOption:d,firstOption:T,containsCheckedOption:y,change:p,disabled:o,value:t}),[d,T,y,p,o,t]),C={ref:b,id:m,role:"radiogroup","aria-labelledby":l,"aria-describedby":u,onKeyDown:f};return React__default.createElement(c,{name:"RadioGroup.Description"},React__default.createElement(s,{name:"RadioGroup.Label"},React__default.createElement(jt.Provider,{value:P},E({props:{...n,...C},defaultTag:Qi,name:"RadioGroup"}))))}var qi="div";function zi(e){let t=useRef(null),r=`headlessui-radiogroup-option-${A()}`,[o,n]=Ae(),[i,a]=re(),{addFlag:l,removeFlag:s,hasFlag:u}=wo(1),{value:c,disabled:m=!1,...b}=e,T=useRef({value:c,disabled:m});x(()=>{T.current.value=c;},[c,T]),x(()=>{T.current.disabled=m;},[m,T]);let{registerOption:y,disabled:p,change:f,firstOption:d,containsCheckedOption:P,value:C}=Ho("RadioGroup.Option");x(()=>y({id:r,element:t,propsRef:T}),[r,y,t,e]);let R=useCallback(()=>{var V;!f(c)||(l(2),(V=t.current)==null||V.focus());},[l,f,c]),g=useCallback(()=>l(2),[l]),v=useCallback(()=>s(2),[s]),h=(d==null?void 0:d.id)===r,O=p||m,L=C===c,N={ref:t,id:r,role:"radio","aria-checked":L?"true":"false","aria-labelledby":o,"aria-describedby":i,"aria-disabled":O?!0:void 0,tabIndex:(()=>O?-1:L||!P&&h?0:-1)(),onClick:O?void 0:R,onFocus:O?void 0:g,onBlur:O?void 0:v},K=useMemo(()=>({checked:L,disabled:O,active:u(2)}),[L,O,u]);return React__default.createElement(a,{name:"RadioGroup.Description"},React__default.createElement(n,{name:"RadioGroup.Label"},E({props:{...b,...N},slot:K,defaultTag:qi,name:"RadioGroup.Option"})))}lt.Option=zi;lt.Label=nt;lt.Description=me;var $t=createContext(null);$t.displayName="GroupContext";var zt=createContext(null);zt.displayName="TabsContext";var dt=createContext(null);dt.displayName="TransitionContext";var ct=createContext(null);ct.displayName="NestingContext";
|
|
3665
|
+
`));return cloneElement(u,Object.assign({},fr(mr(gt(l,["ref"])),u.props,["onClick"]),s))}return createElement(n,Object.assign({},gt(l,["ref"]),n!==Fragment$2&&s),u)}function fr(e,t,r){let o=Object.assign({},e);for(let n of r)e[n]!==void 0&&t[n]!==void 0&&Object.assign(o,{[n](i){i.defaultPrevented||e[n](i),i.defaultPrevented||t[n](i);}});return o}function D(e){var t;return Object.assign(forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function mr(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function gt(e,t=[]){let r=Object.assign({},e);for(let o of t)o in r&&delete r[o];return r}function br(e){throw new Error("Unexpected object: "+e)}function ae(e,t){let r=t.resolveItems();if(r.length<=0)return null;let o=t.resolveActiveIndex(),n=o!=null?o:-1,i=(()=>{switch(e.focus){case 0:return r.findIndex(a=>!t.resolveDisabled(a));case 1:{let a=r.slice().reverse().findIndex((l,s,u)=>n!==-1&&u.length-s-1>=n?!1:!t.resolveDisabled(l));return a===-1?a:r.length-1-a}case 2:return r.findIndex((a,l)=>l<=n?!1:!t.resolveDisabled(a));case 3:{let a=r.slice().reverse().findIndex(l=>!t.resolveDisabled(l));return a===-1?a:r.length-1-a}case 4:return r.findIndex(a=>t.resolveId(a)===e.id);case 5:return null;default:br(e);}})();return i===-1?o:i}function G(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let o=(t==null?void 0:t.getAttribute("disabled"))==="";return o&&Tr(r)?!1:o}function Tr(e){if(!e)return !1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return !1;t=t.previousElementSibling;}return !0}function w$1(e,t,r){let o=useRef(t);o.current=t,useEffect(()=>{function n(i){o.current.call(window,i);}return window.addEventListener(e,n,r),()=>window.removeEventListener(e,n,r)},[e,r]);}var Pt=createContext(null);Pt.displayName="OpenClosedContext";function _(){return useContext(Pt)}function W({value:e,children:t}){return React__default.createElement(Pt.Provider,{value:e},t)}function ro(e){var r;if(e.type)return e.type;let t=(r=e.as)!=null?r:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return "button"}function U(e,t){let[r,o]=useState(()=>ro(e));return x$1(()=>{o(ro(e));},[e.type,e.as]),x$1(()=>{r||!t.current||t.current instanceof HTMLButtonElement&&!t.current.hasAttribute("type")&&o("button");},[r,t]),r}function se({container:e,accept:t,walk:r,enabled:o=!0}){let n=useRef(t),i=useRef(r);useEffect(()=>{n.current=t,i.current=r;},[t,r]),x$1(()=>{if(!e||!o)return;let a=n.current,l=i.current,s=Object.assign(c=>a(c),{acceptNode:a}),u=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,s,!1);for(;u.nextNode();)l(u.currentNode);},[e,o,n,i]);}var Ar={[1](e){return e.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},[0](e){return e.disabled||e.comboboxState===0?e:{...e,comboboxState:0}},[2](e,t){return e.disabled===t.disabled?e:{...e,disabled:t.disabled}},[3](e,t){if(e.disabled||e.optionsRef.current&&!e.optionsPropsRef.current.static&&e.comboboxState===1)return e;let r=ae(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return e.activeOptionIndex===r?e:{...e,activeOptionIndex:r}},[4]:(e,t)=>{var i;let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,o=Array.from((i=e.optionsRef.current)==null?void 0:i.querySelectorAll('[id^="headlessui-combobox-option-"]')).reduce((a,l,s)=>Object.assign(a,{[l.id]:s}),{}),n=[...e.options,{id:t.id,dataRef:t.dataRef}].sort((a,l)=>o[a.id]-o[l.id]);return {...e,options:n,activeOptionIndex:(()=>r===null?null:n.indexOf(r))()}},[5]:(e,t)=>{let r=e.options.slice(),o=e.activeOptionIndex!==null?r[e.activeOptionIndex]:null,n=r.findIndex(i=>i.id===t.id);return n!==-1&&r.splice(n,1),{...e,options:r,activeOptionIndex:(()=>n===e.activeOptionIndex||o===null?null:r.indexOf(o))()}}},vt=createContext(null);vt.displayName="ComboboxContext";function pe(e){let t=useContext(vt);if(t===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,pe),r}return t}var Rt=createContext(null);Rt.displayName="ComboboxActions";function Ue(){let e=useContext(Rt);if(e===null){let t=new Error("ComboboxActions is missing a parent <Combobox /> component.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ue),t}return e}function hr(e,t){return S(t.type,Ar,e,t)}var Or=Fragment$2,Ir=D(function(t,r){let{value:o,onChange:n,disabled:i=!1,...a}=t,l=useRef({value:o,onChange:n}),s=useRef({static:!1,hold:!1}),u=useRef({displayValue:void 0}),c=useReducer(hr,{comboboxState:1,comboboxPropsRef:l,optionsPropsRef:s,inputPropsRef:u,labelRef:createRef(),inputRef:createRef(),buttonRef:createRef(),optionsRef:createRef(),disabled:i,options:[],activeOptionIndex:null}),[{comboboxState:m,options:b,activeOptionIndex:T,optionsRef:y,inputRef:p,buttonRef:f},d]=c;x$1(()=>{l.current.value=o;},[o,l]),x$1(()=>{l.current.onChange=n;},[n,l]),x$1(()=>d({type:2,disabled:i}),[i]),w$1("mousedown",O=>{var N,K,V;let L=O.target;m===0&&(((N=f.current)==null?void 0:N.contains(L))||((K=p.current)==null?void 0:K.contains(L))||((V=y.current)==null?void 0:V.contains(L))||d({type:1}));});let P=T===null?null:b[T].dataRef.current.value,C=useMemo(()=>({open:m===0,disabled:i,activeIndex:T,activeOption:P}),[m,i,b,T]),R=useCallback(()=>{if(!p.current||o===void 0)return;let O=u.current.displayValue;typeof O=="function"?p.current.value=O(o):typeof o=="string"&&(p.current.value=o);},[o,p,u]),g=useCallback(O=>{let L=b.find(K=>K.id===O);if(!L)return;let{dataRef:N}=L;l.current.onChange(N.current.value),R();},[b,l,p]),v=useCallback(()=>{if(T!==null){let{dataRef:O}=b[T];l.current.onChange(O.current.value),R();}},[T,b,l,p]),h=useMemo(()=>({selectOption:g,selectActiveOption:v}),[g,v]);return x$1(()=>{m===1&&R();},[R,m]),x$1(R,[R]),React__default.createElement(Rt.Provider,{value:h},React__default.createElement(vt.Provider,{value:c},React__default.createElement(W,{value:S(m,{[0]:0,[1]:1})},E({props:r===null?a:{...a,ref:r},slot:C,defaultTag:Or,name:"Combobox"}))))}),Lr="input",Dr=D(function(t,r){var R,g;let{value:o,onChange:n,displayValue:i,...a}=t,[l,s]=pe("Combobox.Input"),u=Ue(),c=I(l.inputRef,r),m=l.inputPropsRef,b=`headlessui-combobox-input-${A$1()}`,T=Q(),y=ke(n);x$1(()=>{m.current.displayValue=i;},[i,m]);let p=useCallback(v=>{switch(v.key){case"Enter":v.preventDefault(),v.stopPropagation(),u.selectActiveOption(),s({type:1});break;case"ArrowDown":return v.preventDefault(),v.stopPropagation(),S(l.comboboxState,{[0]:()=>s({type:3,focus:2}),[1]:()=>{s({type:0}),T.nextFrame(()=>{l.comboboxPropsRef.current.value||s({type:3,focus:0});});}});case"ArrowUp":return v.preventDefault(),v.stopPropagation(),S(l.comboboxState,{[0]:()=>s({type:3,focus:1}),[1]:()=>{s({type:0}),T.nextFrame(()=>{l.comboboxPropsRef.current.value||s({type:3,focus:3});});}});case"Home":case"PageUp":return v.preventDefault(),v.stopPropagation(),s({type:3,focus:0});case"End":case"PageDown":return v.preventDefault(),v.stopPropagation(),s({type:3,focus:3});case"Escape":return v.preventDefault(),l.optionsRef.current&&!l.optionsPropsRef.current.static&&v.stopPropagation(),s({type:1});case"Tab":u.selectActiveOption(),s({type:1});break}},[T,s,l,u]),f=useCallback(v=>{var h;s({type:0}),(h=y.current)==null||h.call(y,v);},[s,y]),d=ee(()=>{if(!!l.labelRef.current)return [l.labelRef.current.id].join(" ")},[l.labelRef.current]),P=useMemo(()=>({open:l.comboboxState===0,disabled:l.disabled}),[l]),C={ref:c,id:b,role:"combobox",type:"text","aria-controls":(R=l.optionsRef.current)==null?void 0:R.id,"aria-expanded":l.disabled?void 0:l.comboboxState===0,"aria-activedescendant":l.activeOptionIndex===null||(g=l.options[l.activeOptionIndex])==null?void 0:g.id,"aria-labelledby":d,disabled:l.disabled,onKeyDown:p,onChange:f};return E({props:{...a,...C},slot:P,defaultTag:Lr,name:"Combobox.Input"})}),Mr="button",Fr=D(function(t,r){var p;let[o,n]=pe("Combobox.Button"),i=Ue(),a=I(o.buttonRef,r),l=`headlessui-combobox-button-${A$1()}`,s=Q(),u=useCallback(f=>{switch(f.key){case"ArrowDown":return f.preventDefault(),f.stopPropagation(),o.comboboxState===1&&(n({type:0}),s.nextFrame(()=>{o.comboboxPropsRef.current.value||n({type:3,focus:0});})),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})});case"ArrowUp":return f.preventDefault(),f.stopPropagation(),o.comboboxState===1&&(n({type:0}),s.nextFrame(()=>{o.comboboxPropsRef.current.value||n({type:3,focus:3});})),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})});case"Escape":return f.preventDefault(),o.optionsRef.current&&!o.optionsPropsRef.current.static&&f.stopPropagation(),n({type:1}),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})})}},[s,n,o,i]),c=useCallback(f=>{if(G(f.currentTarget))return f.preventDefault();o.comboboxState===0?n({type:1}):(f.preventDefault(),n({type:0})),s.nextFrame(()=>{var d;return (d=o.inputRef.current)==null?void 0:d.focus({preventScroll:!0})});},[n,s,o]),m=ee(()=>{if(!!o.labelRef.current)return [o.labelRef.current.id,l].join(" ")},[o.labelRef.current,l]),b=useMemo(()=>({open:o.comboboxState===0,disabled:o.disabled}),[o]),T=t,y={ref:a,id:l,type:U(t,o.buttonRef),tabIndex:-1,"aria-haspopup":!0,"aria-controls":(p=o.optionsRef.current)==null?void 0:p.id,"aria-expanded":o.disabled?void 0:o.comboboxState===0,"aria-labelledby":m,disabled:o.disabled,onClick:c,onKeyDown:u};return E({props:{...T,...y},slot:b,defaultTag:Mr,name:"Combobox.Button"})}),wr="label";function kr(e){let[t]=pe("Combobox.Label"),r=`headlessui-combobox-label-${A$1()}`,o=useCallback(()=>{var a;return (a=t.inputRef.current)==null?void 0:a.focus({preventScroll:!0})},[t.inputRef]),n=useMemo(()=>({open:t.comboboxState===0,disabled:t.disabled}),[t]),i={ref:t.labelRef,id:r,onClick:o};return E({props:{...e,...i},slot:n,defaultTag:wr,name:"Combobox.Label"})}var _r="ul",Gr=1|2,Hr=D(function(t,r){var y;let{hold:o=!1,...n}=t,[i]=pe("Combobox.Options"),{optionsPropsRef:a}=i,l=I(i.optionsRef,r),s=`headlessui-combobox-options-${A$1()}`,u=_(),c=(()=>u!==null?u===0:i.comboboxState===0)();x$1(()=>{var p;a.current.static=(p=t.static)!=null?p:!1;},[a,t.static]),x$1(()=>{a.current.hold=o;},[o,a]),se({container:i.optionsRef.current,enabled:i.comboboxState===0,accept(p){return p.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:p.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(p){p.setAttribute("role","none");}});let m=ee(()=>{var p,f,d;return (d=(p=i.labelRef.current)==null?void 0:p.id)!=null?d:(f=i.buttonRef.current)==null?void 0:f.id},[i.labelRef.current,i.buttonRef.current]),b=useMemo(()=>({open:i.comboboxState===0}),[i]),T={"aria-activedescendant":i.activeOptionIndex===null||(y=i.options[i.activeOptionIndex])==null?void 0:y.id,"aria-labelledby":m,role:"listbox",id:s,ref:l};return E({props:{...n,...T},slot:b,defaultTag:_r,features:Gr,visible:c,name:"Combobox.Options"})}),Ur="li";function Br(e){let{disabled:t=!1,value:r,...o}=e,[n,i]=pe("Combobox.Option"),a=Ue(),l=`headlessui-combobox-option-${A$1()}`,s=n.activeOptionIndex!==null?n.options[n.activeOptionIndex].id===l:!1,u=n.comboboxPropsRef.current.value===r,c=useRef({disabled:t,value:r});x$1(()=>{c.current.disabled=t;},[c,t]),x$1(()=>{c.current.value=r;},[c,r]),x$1(()=>{var P,C;c.current.textValue=(C=(P=document.getElementById(l))==null?void 0:P.textContent)==null?void 0:C.toLowerCase();},[c,l]);let m=useCallback(()=>a.selectOption(l),[a,l]);x$1(()=>(i({type:4,id:l,dataRef:c}),()=>i({type:5,id:l})),[c,l]),x$1(()=>{n.comboboxState===0&&(!u||i({type:3,focus:4,id:l}));},[n.comboboxState,u,l]),x$1(()=>{if(n.comboboxState!==0||!s)return;let P=k$1();return P.requestAnimationFrame(()=>{var C,R;(R=(C=document.getElementById(l))==null?void 0:C.scrollIntoView)==null||R.call(C,{block:"nearest"});}),P.dispose},[l,s,n.comboboxState,n.activeOptionIndex]);let b=useCallback(P=>{if(t)return P.preventDefault();m(),i({type:1}),k$1().nextFrame(()=>{var C;return (C=n.inputRef.current)==null?void 0:C.focus({preventScroll:!0})});},[i,n.inputRef,t,m]),T=useCallback(()=>{if(t)return i({type:3,focus:5});i({type:3,focus:4,id:l});},[t,l,i]),y=useCallback(()=>{t||s||i({type:3,focus:4,id:l});},[t,s,l,i]),p=useCallback(()=>{t||!s||n.optionsPropsRef.current.hold||i({type:3,focus:5});},[t,s,i,n.comboboxState,n.comboboxPropsRef]),f=useMemo(()=>({active:s,selected:u,disabled:t}),[s,u,t]);return E({props:{...o,...{id:l,role:"option",tabIndex:t===!0?void 0:-1,"aria-disabled":t===!0?!0:void 0,"aria-selected":u===!0?!0:void 0,disabled:void 0,onClick:b,onFocus:T,onPointerMove:y,onMouseMove:y,onPointerLeave:p,onMouseLeave:p}},slot:f,defaultTag:Ur,name:"Combobox.Option"})}Object.assign(Ir,{Input:Dr,Button:Fr,Label:kr,Options:Hr,Option:Br});var Et=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");function xe(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Et))}function de(e,t=0){return e===document.body?!1:S(t,{[0](){return e.matches(Et)},[1](){let r=e;for(;r!==null;){if(r.matches(Et))return !0;r=r.parentElement;}return !1}})}function ce(e){e==null||e.focus({preventScroll:!0});}function M(e,t){let r=Array.isArray(e)?e.slice().sort((c,m)=>{let b=c.compareDocumentPosition(m);return b&Node.DOCUMENT_POSITION_FOLLOWING?-1:b&Node.DOCUMENT_POSITION_PRECEDING?1:0}):xe(e),o=document.activeElement,n=(()=>{if(t&(1|4))return 1;if(t&(2|8))return -1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),i=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,r.indexOf(o))-1;if(t&4)return Math.max(0,r.indexOf(o))+1;if(t&8)return r.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=t&32?{preventScroll:!0}:{},l=0,s=r.length,u;do{if(l>=s||l+s<=0)return 0;let c=i+l;if(t&16)c=(c+s)%s;else {if(c<0)return 3;if(c>=s)return 1}u=r[c],u==null||u.focus(a),l+=n;}while(u!==document.activeElement);return u.hasAttribute("tabindex")||u.setAttribute("tabindex","0"),2}function Be(){let e=useRef(!1);return useEffect(()=>(e.current=!0,()=>{e.current=!1;}),[]),e}function Ne(e,t=30,{initialFocus:r,containers:o}={}){let n=useRef(typeof window!="undefined"?document.activeElement:null),i=useRef(null),a=Be(),l=Boolean(t&16),s=Boolean(t&2);useEffect(()=>{!l||(n.current=document.activeElement);},[l]),useEffect(()=>{if(!!l)return ()=>{ce(n.current),n.current=null;}},[l]),useEffect(()=>{if(!s||!e.current)return;let u=document.activeElement;if(r==null?void 0:r.current){if((r==null?void 0:r.current)===u){i.current=u;return}}else if(e.current.contains(u)){i.current=u;return}(r==null?void 0:r.current)?ce(r.current):M(e.current,1)===0&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=document.activeElement;},[e,r,s]),w$1("keydown",u=>{!(t&4)||!e.current||u.key==="Tab"&&(u.preventDefault(),M(e.current,(u.shiftKey?2:4)|16)===2&&(i.current=document.activeElement));}),w$1("focus",u=>{if(!(t&8))return;let c=new Set(o==null?void 0:o.current);if(c.add(e),!c.size)return;let m=i.current;if(!m||!a.current)return;let b=u.target;b&&b instanceof HTMLElement?Kr(c,b)?(i.current=b,ce(b)):(u.preventDefault(),u.stopPropagation(),ce(m)):ce(i.current);},!0);}function Kr(e,t){var r;for(let o of e)if((r=o.current)==null?void 0:r.contains(t))return !0;return !1}var fe=new Set,J=new Map;function po(e){e.setAttribute("aria-hidden","true"),e.inert=!0;}function co(e){let t=J.get(e);!t||(t["aria-hidden"]===null?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",t["aria-hidden"]),e.inert=t.inert);}function fo(e,t=!0){x$1(()=>{if(!t||!e.current)return;let r=e.current;fe.add(r);for(let o of J.keys())o.contains(r)&&(co(o),J.delete(o));return document.querySelectorAll("body > *").forEach(o=>{if(o instanceof HTMLElement){for(let n of fe)if(o.contains(n))return;fe.size===1&&(J.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),po(o));}}),()=>{if(fe.delete(r),fe.size>0)document.querySelectorAll("body > *").forEach(o=>{if(o instanceof HTMLElement&&!J.has(o)){for(let n of fe)if(o.contains(n))return;J.set(o,{"aria-hidden":o.getAttribute("aria-hidden"),inert:o.inert}),po(o);}});else for(let o of J.keys())co(o),J.delete(o);}},[t]);}var mo=createContext(!1);function bo(){return useContext(mo)}function At(e){return React__default.createElement(mo.Provider,{value:e.force},e.children)}function Xr(){let e=bo(),t=useContext(Po),[r,o]=useState(()=>{if(!e&&t!==null||typeof window=="undefined")return null;let n=document.getElementById("headlessui-portal-root");if(n)return n;let i=document.createElement("div");return i.setAttribute("id","headlessui-portal-root"),document.body.appendChild(i)});return useEffect(()=>{r!==null&&(document.body.contains(r)||document.body.appendChild(r));},[r]),useEffect(()=>{e||t!==null&&o(t.current);},[t,o,e]),r}var Jr=Fragment$2;function We(e){let t=e,r=Xr(),[o]=useState(()=>typeof window=="undefined"?null:document.createElement("div")),n=q$1();return x$1(()=>{if(!!r&&!!o)return r.appendChild(o),()=>{var i;!r||!o||(r.removeChild(o),r.childNodes.length<=0&&((i=r.parentElement)==null||i.removeChild(r)));}},[r,o]),n?!r||!o?null:createPortal(E({props:t,defaultTag:Jr,name:"Portal"}),o):null}var Zr=Fragment$2,Po=createContext(null);function en(e){let{target:t,...r}=e;return React__default.createElement(Po.Provider,{value:t},E({props:r,defaultTag:Zr,name:"Popover.Group"}))}We.Group=en;var vo=createContext(null);function Ro(){let e=useContext(vo);if(e===null){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Ro),t}return e}function re(){let[e,t]=useState([]);return [e.length>0?e.join(" "):void 0,useMemo(()=>function(o){let n=useCallback(a=>(t(l=>[...l,a]),()=>t(l=>{let s=l.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s})),[]),i=useMemo(()=>({register:n,slot:o.slot,name:o.name,props:o.props}),[n,o.slot,o.name,o.props]);return React__default.createElement(vo.Provider,{value:i},o.children)},[t])]}var an="p";function me(e){let t=Ro(),r=`headlessui-description-${A$1()}`;x$1(()=>t.register(r),[r,t.register]);let o=e,n={...t.props,id:r};return E({props:{...o,...n},slot:t.slot||{},defaultTag:an,name:t.name||"Description"})}var ht=createContext(()=>{});ht.displayName="StackContext";function cn(){return useContext(ht)}function Eo({children:e,onUpdate:t,type:r,element:o}){let n=cn(),i=useCallback((...a)=>{t==null||t(...a),n(...a);},[n,t]);return x$1(()=>(i(0,r,o),()=>i(1,r,o)),[i,r,o]),React__default.createElement(ht.Provider,{value:i},e)}var yn={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Ve=createContext(null);Ve.displayName="DialogContext";function It(e){let t=useContext(Ve);if(t===null){let r=new Error(`<${e} /> is missing a parent <${An.displayName} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,It),r}return t}function gn(e,t){return S(t.type,yn,e,t)}var Pn="div",xn=1|2,vn=D(function(t,r){let{open:o,onClose:n,initialFocus:i,...a}=t,[l,s]=useState(0),u=_();o===void 0&&u!==null&&(o=S(u,{[0]:!0,[1]:!1}));let c=useRef(new Set),m=useRef(null),b=I(m,r),T=t.hasOwnProperty("open")||u!==null,y=t.hasOwnProperty("onClose");if(!T&&!y)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!T)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!y)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof n!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${n}`);let p=o?0:1,f=(()=>u!==null?u===0:p===0)(),[d,P]=useReducer(gn,{titleId:null,descriptionId:null}),C=useCallback(()=>n(!1),[n]),R=useCallback(F=>P({type:0,id:F}),[P]),v=q$1()&&p===0,h=l>1,O=useContext(Ve)!==null;Ne(m,v?S(h?"parent":"leaf",{parent:16,leaf:30}):1,{initialFocus:i,containers:c}),fo(m,h?v:!1),w$1("mousedown",F=>{var H;let $=F.target;p===0&&(h||((H=m.current)==null?void 0:H.contains($))||C());}),w$1("keydown",F=>{F.key==="Escape"&&p===0&&(h||(F.preventDefault(),F.stopPropagation(),C()));}),useEffect(()=>{if(p!==0||O)return;let F=document.documentElement.style.overflow,$=document.documentElement.style.paddingRight,H=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${H}px`,()=>{document.documentElement.style.overflow=F,document.documentElement.style.paddingRight=$;}},[p,O]),useEffect(()=>{if(p!==0||!m.current)return;let F=new IntersectionObserver($=>{for(let H of $)H.boundingClientRect.x===0&&H.boundingClientRect.y===0&&H.boundingClientRect.width===0&&H.boundingClientRect.height===0&&C();});return F.observe(m.current),()=>F.disconnect()},[p,m,C]);let[N,K]=re(),V=`headlessui-dialog-${A$1()}`,Fe=useMemo(()=>[{dialogState:p,close:C,setTitleId:R},d],[p,d,C,R]),ge=useMemo(()=>({open:p===0}),[p]),we={ref:b,id:V,role:"dialog","aria-modal":p===0?!0:void 0,"aria-labelledby":d.titleId,"aria-describedby":N,onClick(F){F.stopPropagation();}},X=a;return React__default.createElement(Eo,{type:"Dialog",element:m,onUpdate:useCallback((F,$,H)=>{$==="Dialog"&&S(F,{[0](){c.current.add(H),s(Pe=>Pe+1);},[1](){c.current.add(H),s(Pe=>Pe-1);}});},[])},React__default.createElement(At,{force:!0},React__default.createElement(We,null,React__default.createElement(Ve.Provider,{value:Fe},React__default.createElement(We.Group,{target:m},React__default.createElement(At,{force:!1},React__default.createElement(K,{slot:ge,name:"Dialog.Description"},E({props:{...X,...we},slot:ge,defaultTag:Pn,features:xn,visible:f,name:"Dialog"}))))))))}),Rn="div",En=D(function(t,r){let[{dialogState:o,close:n}]=It("Dialog.Overlay"),i=I(r),a=`headlessui-dialog-overlay-${A$1()}`,l=useCallback(m=>{if(m.target===m.currentTarget){if(G(m.currentTarget))return m.preventDefault();m.preventDefault(),m.stopPropagation(),n();}},[n]),s=useMemo(()=>({open:o===0}),[o]);return E({props:{...t,...{ref:i,id:a,"aria-hidden":!0,onClick:l}},slot:s,defaultTag:Rn,name:"Dialog.Overlay"})}),Cn="h2";function Sn(e){let[{dialogState:t,setTitleId:r}]=It("Dialog.Title"),o=`headlessui-dialog-title-${A$1()}`;useEffect(()=>(r(o),()=>r(null)),[o,r]);let n=useMemo(()=>({open:t===0}),[t]);return E({props:{...e,...{id:o}},slot:n,defaultTag:Cn,name:"Dialog.Title"})}var An=Object.assign(vn,{Overlay:En,Title:Sn,Description:me});var Ln={[0]:e=>({...e,disclosureState:S(e.disclosureState,{[0]:1,[1]:0})}),[1]:e=>e.disclosureState===1?e:{...e,disclosureState:1},[4](e){return e.linkedPanel===!0?e:{...e,linkedPanel:!0}},[5](e){return e.linkedPanel===!1?e:{...e,linkedPanel:!1}},[2](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[3](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Mt=createContext(null);Mt.displayName="DisclosureContext";function Ft(e){let t=useContext(Mt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ye.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ft),r}return t}var wt=createContext(null);wt.displayName="DisclosureAPIContext";function Ao(e){let t=useContext(wt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ye.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ao),r}return t}var kt=createContext(null);kt.displayName="DisclosurePanelContext";function Dn(){return useContext(kt)}function Mn(e,t){return S(t.type,Ln,e,t)}var Fn=Fragment$2;function Ye(e){let{defaultOpen:t=!1,...r}=e,o=`headlessui-disclosure-button-${A$1()}`,n=`headlessui-disclosure-panel-${A$1()}`,i=useReducer(Mn,{disclosureState:t?0:1,linkedPanel:!1,buttonId:o,panelId:n}),[{disclosureState:a},l]=i;useEffect(()=>l({type:2,buttonId:o}),[o,l]),useEffect(()=>l({type:3,panelId:n}),[n,l]);let s=useCallback(m=>{l({type:1});let b=(()=>m?m instanceof HTMLElement?m:m.current instanceof HTMLElement?m.current:document.getElementById(o):document.getElementById(o))();b==null||b.focus();},[l,o]),u=useMemo(()=>({close:s}),[s]),c=useMemo(()=>({open:a===0,close:s}),[a,s]);return React__default.createElement(Mt.Provider,{value:i},React__default.createElement(wt.Provider,{value:u},React__default.createElement(W,{value:S(a,{[0]:0,[1]:1})},E({props:r,slot:c,defaultTag:Fn,name:"Disclosure"}))))}var wn="button",kn=D(function(t,r){let[o,n]=Ft("Disclosure.Button"),i=useRef(null),a=I(i,r),l=Dn(),s=l===null?!1:l===o.panelId,u=useCallback(f=>{var d;if(s){if(o.disclosureState===1)return;switch(f.key){case" ":case"Enter":f.preventDefault(),f.stopPropagation(),n({type:0}),(d=document.getElementById(o.buttonId))==null||d.focus();break}}else switch(f.key){case" ":case"Enter":f.preventDefault(),f.stopPropagation(),n({type:0});break}},[n,s,o.disclosureState,o.buttonId]),c=useCallback(f=>{switch(f.key){case" ":f.preventDefault();break}},[]),m=useCallback(f=>{var d;G(f.currentTarget)||t.disabled||(s?(n({type:0}),(d=document.getElementById(o.buttonId))==null||d.focus()):n({type:0}));},[n,t.disabled,o.buttonId,s]),b=useMemo(()=>({open:o.disclosureState===0}),[o]),T=U(t,i),y=t,p=s?{ref:a,type:T,onKeyDown:u,onClick:m}:{ref:a,id:o.buttonId,type:T,"aria-expanded":t.disabled?void 0:o.disclosureState===0,"aria-controls":o.linkedPanel?o.panelId:void 0,onKeyDown:u,onKeyUp:c,onClick:m};return E({props:{...y,...p},slot:b,defaultTag:wn,name:"Disclosure.Button"})}),_n="div",Gn=1|2,Hn=D(function(t,r){let[o,n]=Ft("Disclosure.Panel"),{close:i}=Ao("Disclosure.Panel"),a=I(r,()=>{o.linkedPanel||n({type:4});}),l=_(),s=(()=>l!==null?l===0:o.disclosureState===0)();useEffect(()=>()=>n({type:5}),[n]),useEffect(()=>{var b;o.disclosureState===1&&((b=t.unmount)!=null?b:!0)&&n({type:5});},[o.disclosureState,t.unmount,n]);let u=useMemo(()=>({open:o.disclosureState===0,close:i}),[o,i]),c={ref:a,id:o.panelId},m=t;return React__default.createElement(kt.Provider,{value:o.panelId},E({props:{...m,...c},slot:u,defaultTag:_n,features:Gn,visible:s,name:"Disclosure.Panel"}))});Ye.Button=kn;Ye.Panel=Hn;var $n={[1](e){return e.disabled||e.listboxState===1?e:{...e,activeOptionIndex:null,listboxState:1}},[0](e){return e.disabled||e.listboxState===0?e:{...e,listboxState:0}},[2](e,t){return e.disabled===t.disabled?e:{...e,disabled:t.disabled}},[3](e,t){return e.orientation===t.orientation?e:{...e,orientation:t.orientation}},[4](e,t){if(e.disabled||e.listboxState===1)return e;let r=ae(t,{resolveItems:()=>e.options,resolveActiveIndex:()=>e.activeOptionIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return e.searchQuery===""&&e.activeOptionIndex===r?e:{...e,searchQuery:"",activeOptionIndex:r}},[5]:(e,t)=>{if(e.disabled||e.listboxState===1)return e;let o=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),a=(e.activeOptionIndex!==null?e.options.slice(e.activeOptionIndex+o).concat(e.options.slice(0,e.activeOptionIndex+o)):e.options).find(s=>{var u;return !s.dataRef.current.disabled&&((u=s.dataRef.current.textValue)==null?void 0:u.startsWith(n))}),l=a?e.options.indexOf(a):-1;return l===-1||l===e.activeOptionIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeOptionIndex:l}},[6](e){return e.disabled||e.listboxState===1||e.searchQuery===""?e:{...e,searchQuery:""}},[7]:(e,t)=>{var n;let r=Array.from((n=e.optionsRef.current)==null?void 0:n.querySelectorAll('[id^="headlessui-listbox-option-"]')).reduce((i,a,l)=>Object.assign(i,{[a.id]:l}),{}),o=[...e.options,{id:t.id,dataRef:t.dataRef}].sort((i,a)=>r[i.id]-r[a.id]);return {...e,options:o}},[8]:(e,t)=>{let r=e.options.slice(),o=e.activeOptionIndex!==null?r[e.activeOptionIndex]:null,n=r.findIndex(i=>i.id===t.id);return n!==-1&&r.splice(n,1),{...e,options:r,activeOptionIndex:(()=>n===e.activeOptionIndex||o===null?null:r.indexOf(o))()}}},Gt=createContext(null);Gt.displayName="ListboxContext";function Re(e){let t=useContext(Gt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ee.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Re),r}return t}function Qn(e,t){return S(t.type,$n,e,t)}var qn=Fragment$2;function Ee(e){let{value:t,onChange:r,disabled:o=!1,horizontal:n=!1,...i}=e,a=n?"horizontal":"vertical",l=useReducer(Qn,{listboxState:1,propsRef:{current:{value:t,onChange:r}},labelRef:createRef(),buttonRef:createRef(),optionsRef:createRef(),disabled:o,orientation:a,options:[],searchQuery:"",activeOptionIndex:null}),[{listboxState:s,propsRef:u,optionsRef:c,buttonRef:m},b]=l;x$1(()=>{u.current.value=t;},[t,u]),x$1(()=>{u.current.onChange=r;},[r,u]),x$1(()=>b({type:2,disabled:o}),[o]),x$1(()=>b({type:3,orientation:a}),[a]),w$1("mousedown",y=>{var f,d,P;let p=y.target;s===0&&(((f=m.current)==null?void 0:f.contains(p))||((d=c.current)==null?void 0:d.contains(p))||(b({type:1}),de(p,1)||(y.preventDefault(),(P=m.current)==null||P.focus())));});let T=useMemo(()=>({open:s===0,disabled:o}),[s,o]);return React__default.createElement(Gt.Provider,{value:l},React__default.createElement(W,{value:S(s,{[0]:0,[1]:1})},E({props:i,slot:T,defaultTag:qn,name:"Listbox"})))}var zn="button",Yn=D(function(t,r){var p;let[o,n]=Re("Listbox.Button"),i=I(o.buttonRef,r),a=`headlessui-listbox-button-${A$1()}`,l=Q(),s=useCallback(f=>{switch(f.key){case" ":case"Enter":case"ArrowDown":f.preventDefault(),n({type:0}),l.nextFrame(()=>{o.propsRef.current.value||n({type:4,focus:0});});break;case"ArrowUp":f.preventDefault(),n({type:0}),l.nextFrame(()=>{o.propsRef.current.value||n({type:4,focus:3});});break}},[n,o,l]),u=useCallback(f=>{switch(f.key){case" ":f.preventDefault();break}},[]),c=useCallback(f=>{if(G(f.currentTarget))return f.preventDefault();o.listboxState===0?(n({type:1}),l.nextFrame(()=>{var d;return (d=o.buttonRef.current)==null?void 0:d.focus({preventScroll:!0})})):(f.preventDefault(),n({type:0}));},[n,l,o]),m=ee(()=>{if(!!o.labelRef.current)return [o.labelRef.current.id,a].join(" ")},[o.labelRef.current,a]),b=useMemo(()=>({open:o.listboxState===0,disabled:o.disabled}),[o]),T=t,y={ref:i,id:a,type:U(t,o.buttonRef),"aria-haspopup":!0,"aria-controls":(p=o.optionsRef.current)==null?void 0:p.id,"aria-expanded":o.disabled?void 0:o.listboxState===0,"aria-labelledby":m,disabled:o.disabled,onKeyDown:s,onKeyUp:u,onClick:c};return E({props:{...T,...y},slot:b,defaultTag:zn,name:"Listbox.Button"})}),Xn="label";function Jn(e){let[t]=Re("Listbox.Label"),r=`headlessui-listbox-label-${A$1()}`,o=useCallback(()=>{var a;return (a=t.buttonRef.current)==null?void 0:a.focus({preventScroll:!0})},[t.buttonRef]),n=useMemo(()=>({open:t.listboxState===0,disabled:t.disabled}),[t]),i={ref:t.labelRef,id:r,onClick:o};return E({props:{...e,...i},slot:n,defaultTag:Xn,name:"Listbox.Label"})}var Zn="ul",ei=1|2,ti=D(function(t,r){var f;let[o,n]=Re("Listbox.Options"),i=I(o.optionsRef,r),a=`headlessui-listbox-options-${A$1()}`,l=Q(),s=Q(),u=_(),c=(()=>u!==null?u===0:o.listboxState===0)();x$1(()=>{let d=o.optionsRef.current;!d||o.listboxState===0&&d!==document.activeElement&&d.focus({preventScroll:!0});},[o.listboxState,o.optionsRef]);let m=useCallback(d=>{switch(s.dispose(),d.key){case" ":if(o.searchQuery!=="")return d.preventDefault(),d.stopPropagation(),n({type:5,value:d.key});case"Enter":if(d.preventDefault(),d.stopPropagation(),n({type:1}),o.activeOptionIndex!==null){let{dataRef:P}=o.options[o.activeOptionIndex];o.propsRef.current.onChange(P.current.value);}k$1().nextFrame(()=>{var P;return (P=o.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})});break;case S(o.orientation,{vertical:"ArrowDown",horizontal:"ArrowRight"}):return d.preventDefault(),d.stopPropagation(),n({type:4,focus:2});case S(o.orientation,{vertical:"ArrowUp",horizontal:"ArrowLeft"}):return d.preventDefault(),d.stopPropagation(),n({type:4,focus:1});case"Home":case"PageUp":return d.preventDefault(),d.stopPropagation(),n({type:4,focus:0});case"End":case"PageDown":return d.preventDefault(),d.stopPropagation(),n({type:4,focus:3});case"Escape":return d.preventDefault(),d.stopPropagation(),n({type:1}),l.nextFrame(()=>{var P;return (P=o.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})});case"Tab":d.preventDefault(),d.stopPropagation();break;default:d.key.length===1&&(n({type:5,value:d.key}),s.setTimeout(()=>n({type:6}),350));break}},[l,n,s,o]),b=ee(()=>{var d,P,C;return (C=(d=o.labelRef.current)==null?void 0:d.id)!=null?C:(P=o.buttonRef.current)==null?void 0:P.id},[o.labelRef.current,o.buttonRef.current]),T=useMemo(()=>({open:o.listboxState===0}),[o]),y={"aria-activedescendant":o.activeOptionIndex===null||(f=o.options[o.activeOptionIndex])==null?void 0:f.id,"aria-labelledby":b,"aria-orientation":o.orientation,id:a,onKeyDown:m,role:"listbox",tabIndex:0,ref:i};return E({props:{...t,...y},slot:T,defaultTag:Zn,features:ei,visible:c,name:"Listbox.Options"})}),oi="li";function ri(e){let{disabled:t=!1,value:r,...o}=e,[n,i]=Re("Listbox.Option"),a=`headlessui-listbox-option-${A$1()}`,l=n.activeOptionIndex!==null?n.options[n.activeOptionIndex].id===a:!1,s=n.propsRef.current.value===r,u=useRef({disabled:t,value:r});x$1(()=>{u.current.disabled=t;},[u,t]),x$1(()=>{u.current.value=r;},[u,r]),x$1(()=>{var d,P;u.current.textValue=(P=(d=document.getElementById(a))==null?void 0:d.textContent)==null?void 0:P.toLowerCase();},[u,a]);let c=useCallback(()=>n.propsRef.current.onChange(r),[n.propsRef,r]);x$1(()=>(i({type:7,id:a,dataRef:u}),()=>i({type:8,id:a})),[u,a]),x$1(()=>{var d,P;n.listboxState===0&&(!s||(i({type:4,focus:4,id:a}),(P=(d=document.getElementById(a))==null?void 0:d.focus)==null||P.call(d)));},[n.listboxState]),x$1(()=>{if(n.listboxState!==0||!l)return;let d=k$1();return d.requestAnimationFrame(()=>{var P,C;(C=(P=document.getElementById(a))==null?void 0:P.scrollIntoView)==null||C.call(P,{block:"nearest"});}),d.dispose},[a,l,n.listboxState,n.activeOptionIndex]);let m=useCallback(d=>{if(t)return d.preventDefault();c(),i({type:1}),k$1().nextFrame(()=>{var P;return (P=n.buttonRef.current)==null?void 0:P.focus({preventScroll:!0})});},[i,n.buttonRef,t,c]),b=useCallback(()=>{if(t)return i({type:4,focus:5});i({type:4,focus:4,id:a});},[t,a,i]),T=useCallback(()=>{t||l||i({type:4,focus:4,id:a});},[t,l,a,i]),y=useCallback(()=>{t||!l||i({type:4,focus:5});},[t,l,i]),p=useMemo(()=>({active:l,selected:s,disabled:t}),[l,s,t]);return E({props:{...o,...{id:a,role:"option",tabIndex:t===!0?void 0:-1,"aria-disabled":t===!0?!0:void 0,"aria-selected":s===!0?!0:void 0,disabled:void 0,onClick:m,onFocus:b,onPointerMove:T,onMouseMove:T,onPointerLeave:y,onMouseLeave:y}},slot:p,defaultTag:oi,name:"Listbox.Option"})}Ee.Button=Yn;Ee.Label=Jn;Ee.Options=ti;Ee.Option=ri;var ui={[1](e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},[0](e){return e.menuState===0?e:{...e,menuState:0}},[2]:(e,t)=>{let r=ae(t,{resolveItems:()=>e.items,resolveActiveIndex:()=>e.activeItemIndex,resolveId:o=>o.id,resolveDisabled:o=>o.dataRef.current.disabled});return e.searchQuery===""&&e.activeItemIndex===r?e:{...e,searchQuery:"",activeItemIndex:r}},[3]:(e,t)=>{let o=e.searchQuery!==""?0:1,n=e.searchQuery+t.value.toLowerCase(),a=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+o).concat(e.items.slice(0,e.activeItemIndex+o)):e.items).find(s=>{var u;return ((u=s.dataRef.current.textValue)==null?void 0:u.startsWith(n))&&!s.dataRef.current.disabled}),l=a?e.items.indexOf(a):-1;return l===-1||l===e.activeItemIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeItemIndex:l}},[4](e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},[5]:(e,t)=>{var n;let r=Array.from((n=e.itemsRef.current)==null?void 0:n.querySelectorAll('[id^="headlessui-menu-item-"]')).reduce((i,a,l)=>Object.assign(i,{[a.id]:l}),{}),o=[...e.items,{id:t.id,dataRef:t.dataRef}].sort((i,a)=>r[i.id]-r[a.id]);return {...e,items:o}},[6]:(e,t)=>{let r=e.items.slice(),o=e.activeItemIndex!==null?r[e.activeItemIndex]:null,n=r.findIndex(i=>i.id===t.id);return n!==-1&&r.splice(n,1),{...e,items:r,activeItemIndex:(()=>n===e.activeItemIndex||o===null?null:r.indexOf(o))()}}},Ht=createContext(null);Ht.displayName="MenuContext";function Je(e){let t=useContext(Ht);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Ze.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Je),r}return t}function pi(e,t){return S(t.type,ui,e,t)}var di=Fragment$2;function Ze(e){let t=useReducer(pi,{menuState:1,buttonRef:createRef(),itemsRef:createRef(),items:[],searchQuery:"",activeItemIndex:null}),[{menuState:r,itemsRef:o,buttonRef:n},i]=t;w$1("mousedown",l=>{var u,c,m;let s=l.target;r===0&&(((u=n.current)==null?void 0:u.contains(s))||((c=o.current)==null?void 0:c.contains(s))||(i({type:1}),de(s,1)||(l.preventDefault(),(m=n.current)==null||m.focus())));});let a=useMemo(()=>({open:r===0}),[r]);return React__default.createElement(Ht.Provider,{value:t},React__default.createElement(W,{value:S(r,{[0]:0,[1]:1})},E({props:e,slot:a,defaultTag:di,name:"Menu"})))}var ci="button",fi=D(function(t,r){var y;let[o,n]=Je("Menu.Button"),i=I(o.buttonRef,r),a=`headlessui-menu-button-${A$1()}`,l=Q(),s=useCallback(p=>{switch(p.key){case" ":case"Enter":case"ArrowDown":p.preventDefault(),p.stopPropagation(),n({type:0}),l.nextFrame(()=>n({type:2,focus:0}));break;case"ArrowUp":p.preventDefault(),p.stopPropagation(),n({type:0}),l.nextFrame(()=>n({type:2,focus:3}));break}},[n,l]),u=useCallback(p=>{switch(p.key){case" ":p.preventDefault();break}},[]),c=useCallback(p=>{if(G(p.currentTarget))return p.preventDefault();t.disabled||(o.menuState===0?(n({type:1}),l.nextFrame(()=>{var f;return (f=o.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})})):(p.preventDefault(),p.stopPropagation(),n({type:0})));},[n,l,o,t.disabled]),m=useMemo(()=>({open:o.menuState===0}),[o]),b=t,T={ref:i,id:a,type:U(t,o.buttonRef),"aria-haspopup":!0,"aria-controls":(y=o.itemsRef.current)==null?void 0:y.id,"aria-expanded":t.disabled?void 0:o.menuState===0,onKeyDown:s,onKeyUp:u,onClick:c};return E({props:{...b,...T},slot:m,defaultTag:ci,name:"Menu.Button"})}),mi="div",bi=1|2,Ti=D(function(t,r){var p,f;let[o,n]=Je("Menu.Items"),i=I(o.itemsRef,r),a=`headlessui-menu-items-${A$1()}`,l=Q(),s=_(),u=(()=>s!==null?s===0:o.menuState===0)();useEffect(()=>{let d=o.itemsRef.current;!d||o.menuState===0&&d!==document.activeElement&&d.focus({preventScroll:!0});},[o.menuState,o.itemsRef]),se({container:o.itemsRef.current,enabled:o.menuState===0,accept(d){return d.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:d.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(d){d.setAttribute("role","none");}});let c=useCallback(d=>{var P;switch(l.dispose(),d.key){case" ":if(o.searchQuery!=="")return d.preventDefault(),d.stopPropagation(),n({type:3,value:d.key});case"Enter":if(d.preventDefault(),d.stopPropagation(),n({type:1}),o.activeItemIndex!==null){let{id:C}=o.items[o.activeItemIndex];(P=document.getElementById(C))==null||P.click();}k$1().nextFrame(()=>{var C;return (C=o.buttonRef.current)==null?void 0:C.focus({preventScroll:!0})});break;case"ArrowDown":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:2});case"ArrowUp":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:1});case"Home":case"PageUp":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:0});case"End":case"PageDown":return d.preventDefault(),d.stopPropagation(),n({type:2,focus:3});case"Escape":d.preventDefault(),d.stopPropagation(),n({type:1}),k$1().nextFrame(()=>{var C;return (C=o.buttonRef.current)==null?void 0:C.focus({preventScroll:!0})});break;case"Tab":d.preventDefault(),d.stopPropagation();break;default:d.key.length===1&&(n({type:3,value:d.key}),l.setTimeout(()=>n({type:4}),350));break}},[n,l,o]),m=useCallback(d=>{switch(d.key){case" ":d.preventDefault();break}},[]),b=useMemo(()=>({open:o.menuState===0}),[o]),T={"aria-activedescendant":o.activeItemIndex===null||(p=o.items[o.activeItemIndex])==null?void 0:p.id,"aria-labelledby":(f=o.buttonRef.current)==null?void 0:f.id,id:a,onKeyDown:c,onKeyUp:m,role:"menu",tabIndex:0,ref:i};return E({props:{...t,...T},slot:b,defaultTag:mi,features:bi,visible:u,name:"Menu.Items"})}),yi=Fragment$2;function gi(e){let{disabled:t=!1,onClick:r,...o}=e,[n,i]=Je("Menu.Item"),a=`headlessui-menu-item-${A$1()}`,l=n.activeItemIndex!==null?n.items[n.activeItemIndex].id===a:!1;x$1(()=>{if(n.menuState!==0||!l)return;let p=k$1();return p.requestAnimationFrame(()=>{var f,d;(d=(f=document.getElementById(a))==null?void 0:f.scrollIntoView)==null||d.call(f,{block:"nearest"});}),p.dispose},[a,l,n.menuState,n.activeItemIndex]);let s=useRef({disabled:t});x$1(()=>{s.current.disabled=t;},[s,t]),x$1(()=>{var p,f;s.current.textValue=(f=(p=document.getElementById(a))==null?void 0:p.textContent)==null?void 0:f.toLowerCase();},[s,a]),x$1(()=>(i({type:5,id:a,dataRef:s}),()=>i({type:6,id:a})),[s,a]);let u=useCallback(p=>{if(t)return p.preventDefault();if(i({type:1}),k$1().nextFrame(()=>{var f;return (f=n.buttonRef.current)==null?void 0:f.focus({preventScroll:!0})}),r)return r(p)},[i,n.buttonRef,t,r]),c=useCallback(()=>{if(t)return i({type:2,focus:5});i({type:2,focus:4,id:a});},[t,a,i]),m=useCallback(()=>{t||l||i({type:2,focus:4,id:a});},[t,l,a,i]),b=useCallback(()=>{t||!l||i({type:2,focus:5});},[t,l,i]),T=useMemo(()=>({active:l,disabled:t}),[l,t]);return E({props:{...o,...{id:a,role:"menuitem",tabIndex:t===!0?void 0:-1,"aria-disabled":t===!0?!0:void 0,disabled:void 0,onClick:u,onFocus:c,onPointerMove:m,onMouseMove:m,onPointerLeave:b,onMouseLeave:b}},slot:T,defaultTag:yi,name:"Menu.Item"})}Ze.Button=fi;Ze.Items=Ti;Ze.Item=gi;var vi={[0]:e=>({...e,popoverState:S(e.popoverState,{[0]:1,[1]:0})}),[1](e){return e.popoverState===1?e:{...e,popoverState:1}},[2](e,t){return e.button===t.button?e:{...e,button:t.button}},[3](e,t){return e.buttonId===t.buttonId?e:{...e,buttonId:t.buttonId}},[4](e,t){return e.panel===t.panel?e:{...e,panel:t.panel}},[5](e,t){return e.panelId===t.panelId?e:{...e,panelId:t.panelId}}},Ut=createContext(null);Ut.displayName="PopoverContext";function ot(e){let t=useContext(Ut);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Te.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ot),r}return t}var Bt=createContext(null);Bt.displayName="PopoverAPIContext";function Mo(e){let t=useContext(Bt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${Te.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Mo),r}return t}var Nt=createContext(null);Nt.displayName="PopoverGroupContext";function Fo(){return useContext(Nt)}var Wt=createContext(null);Wt.displayName="PopoverPanelContext";function Ri(){return useContext(Wt)}function Ei(e,t){return S(t.type,vi,e,t)}var Ci="div";function Te(e){let t=`headlessui-popover-button-${A$1()}`,r=`headlessui-popover-panel-${A$1()}`,o=useReducer(Ei,{popoverState:1,button:null,buttonId:t,panel:null,panelId:r}),[{popoverState:n,button:i,panel:a},l]=o;useEffect(()=>l({type:3,buttonId:t}),[t,l]),useEffect(()=>l({type:5,panelId:r}),[r,l]);let s=useMemo(()=>({buttonId:t,panelId:r,close:()=>l({type:1})}),[t,r,l]),u=Fo(),c=u==null?void 0:u.registerPopover,m=useCallback(()=>{var p;return (p=u==null?void 0:u.isFocusWithinPopoverGroup())!=null?p:(i==null?void 0:i.contains(document.activeElement))||(a==null?void 0:a.contains(document.activeElement))},[u,i,a]);useEffect(()=>c==null?void 0:c(s),[c,s]),w$1("focus",()=>{n===0&&(m()||!i||!a||l({type:1}));},!0),w$1("mousedown",p=>{let f=p.target;n===0&&((i==null?void 0:i.contains(f))||(a==null?void 0:a.contains(f))||(l({type:1}),de(f,1)||(p.preventDefault(),i==null||i.focus())));});let b=useCallback(p=>{l({type:1});let f=(()=>p?p instanceof HTMLElement?p:p.current instanceof HTMLElement?p.current:i:i)();f==null||f.focus();},[l,i]),T=useMemo(()=>({close:b}),[b]),y=useMemo(()=>({open:n===0,close:b}),[n,b]);return React__default.createElement(Ut.Provider,{value:o},React__default.createElement(Bt.Provider,{value:T},React__default.createElement(W,{value:S(n,{[0]:0,[1]:1})},E({props:e,slot:y,defaultTag:Ci,name:"Popover"}))))}var Si="button",Ai=D(function(t,r){let[o,n]=ot("Popover.Button"),i=useRef(null),a=Fo(),l=a==null?void 0:a.closeOthers,s=Ri(),u=s===null?!1:s===o.panelId,c=I(i,r,u?null:g=>n({type:2,button:g})),m=I(i,r),b=useRef(null),T=useRef(typeof window=="undefined"?null:document.activeElement);w$1("focus",()=>{T.current=b.current,b.current=document.activeElement;},!0);let y=useCallback(g=>{var v,h;if(u){if(o.popoverState===1)return;switch(g.key){case" ":case"Enter":g.preventDefault(),g.stopPropagation(),n({type:1}),(v=o.button)==null||v.focus();break}}else switch(g.key){case" ":case"Enter":g.preventDefault(),g.stopPropagation(),o.popoverState===1&&(l==null||l(o.buttonId)),n({type:0});break;case"Escape":if(o.popoverState!==0)return l==null?void 0:l(o.buttonId);if(!i.current||!i.current.contains(document.activeElement))return;g.preventDefault(),g.stopPropagation(),n({type:1});break;case"Tab":if(o.popoverState!==0||!o.panel||!o.button)return;if(g.shiftKey){if(!T.current||((h=o.button)==null?void 0:h.contains(T.current))||o.panel.contains(T.current))return;let O=xe(),L=O.indexOf(T.current);if(O.indexOf(o.button)>L)return;g.preventDefault(),g.stopPropagation(),M(o.panel,8);}else g.preventDefault(),g.stopPropagation(),M(o.panel,1);break}},[n,o.popoverState,o.buttonId,o.button,o.panel,i,l,u]),p=useCallback(g=>{var v;if(!u&&(g.key===" "&&g.preventDefault(),o.popoverState===0&&!!o.panel&&!!o.button))switch(g.key){case"Tab":if(!T.current||((v=o.button)==null?void 0:v.contains(T.current))||o.panel.contains(T.current))return;let h=xe(),O=h.indexOf(T.current);if(h.indexOf(o.button)>O)return;g.preventDefault(),g.stopPropagation(),M(o.panel,8);break}},[o.popoverState,o.panel,o.button,u]),f=useCallback(g=>{var v,h;G(g.currentTarget)||t.disabled||(u?(n({type:1}),(v=o.button)==null||v.focus()):(o.popoverState===1&&(l==null||l(o.buttonId)),(h=o.button)==null||h.focus(),n({type:0})));},[n,o.button,o.popoverState,o.buttonId,t.disabled,l,u]),d=useMemo(()=>({open:o.popoverState===0}),[o]),P=U(t,i),C=t,R=u?{ref:m,type:P,onKeyDown:y,onClick:f}:{ref:c,id:o.buttonId,type:P,"aria-expanded":t.disabled?void 0:o.popoverState===0,"aria-controls":o.panel?o.panelId:void 0,onKeyDown:y,onKeyUp:p,onClick:f};return E({props:{...C,...R},slot:d,defaultTag:Si,name:"Popover.Button"})}),hi="div",Oi=1|2,Ii=D(function(t,r){let[{popoverState:o},n]=ot("Popover.Overlay"),i=I(r),a=`headlessui-popover-overlay-${A$1()}`,l=_(),s=(()=>l!==null?l===0:o===0)(),u=useCallback(T=>{if(G(T.currentTarget))return T.preventDefault();n({type:1});},[n]),c=useMemo(()=>({open:o===0}),[o]);return E({props:{...t,...{ref:i,id:a,"aria-hidden":!0,onClick:u}},slot:c,defaultTag:hi,features:Oi,visible:s,name:"Popover.Overlay"})}),Li$1="div",Di=1|2,Mi=D(function(t,r){let{focus:o=!1,...n}=t,[i,a]=ot("Popover.Panel"),{close:l}=Mo("Popover.Panel"),s=useRef(null),u=I(s,r,p=>{a({type:4,panel:p});}),c=_(),m=(()=>c!==null?c===0:i.popoverState===0)(),b=useCallback(p=>{var f;switch(p.key){case"Escape":if(i.popoverState!==0||!s.current||!s.current.contains(document.activeElement))return;p.preventDefault(),p.stopPropagation(),a({type:1}),(f=i.button)==null||f.focus();break}},[i,s,a]);useEffect(()=>()=>a({type:4,panel:null}),[a]),useEffect(()=>{var p;t.static||i.popoverState===1&&((p=t.unmount)!=null?p:!0)&&a({type:4,panel:null});},[i.popoverState,t.unmount,t.static,a]),useEffect(()=>{if(!o||i.popoverState!==0||!s.current)return;let p=document.activeElement;s.current.contains(p)||M(s.current,1);},[o,s,i.popoverState]),w$1("keydown",p=>{var d;if(i.popoverState!==0||!s.current||p.key!=="Tab"||!document.activeElement||!s.current||!s.current.contains(document.activeElement))return;p.preventDefault();let f=M(s.current,p.shiftKey?2:4);if(f===3)return (d=i.button)==null?void 0:d.focus();if(f===1){if(!i.button)return;let P=xe(),C=P.indexOf(i.button),R=P.splice(C+1).filter(g=>{var v;return !((v=s.current)==null?void 0:v.contains(g))});M(R,1)===0&&M(document.body,1);}}),w$1("focus",()=>{var p;!o||i.popoverState===0&&(!s.current||((p=s.current)==null?void 0:p.contains(document.activeElement))||a({type:1}));},!0);let T=useMemo(()=>({open:i.popoverState===0,close:l}),[i,l]),y={ref:u,id:i.panelId,onKeyDown:b};return React__default.createElement(Wt.Provider,{value:i.panelId},E({props:{...n,...y},slot:T,defaultTag:Li$1,features:Di,visible:m,name:"Popover.Panel"}))}),Fi="div";function wi(e){let t=useRef(null),[r,o]=useState([]),n=useCallback(b=>{o(T=>{let y=T.indexOf(b);if(y!==-1){let p=T.slice();return p.splice(y,1),p}return T});},[o]),i=useCallback(b=>(o(T=>[...T,b]),()=>n(b)),[o,n]),a=useCallback(()=>{var T;let b=document.activeElement;return ((T=t.current)==null?void 0:T.contains(b))?!0:r.some(y=>{var p,f;return ((p=document.getElementById(y.buttonId))==null?void 0:p.contains(b))||((f=document.getElementById(y.panelId))==null?void 0:f.contains(b))})},[t,r]),l=useCallback(b=>{for(let T of r)T.buttonId!==b&&T.close();},[r]),s=useMemo(()=>({registerPopover:i,unregisterPopover:n,isFocusWithinPopoverGroup:a,closeOthers:l}),[i,n,a,l]),u=useMemo(()=>({}),[]),c={ref:t},m=e;return React__default.createElement(Nt.Provider,{value:s},E({props:{...m,...c},slot:u,defaultTag:Fi,name:"Popover.Group"}))}Te.Button=Ai;Te.Overlay=Ii;Te.Panel=Mi;Te.Group=wi;function wo(e=0){let[t,r]=useState(e),o=useCallback(l=>r(s=>s|l),[r]),n=useCallback(l=>Boolean(t&l),[t]),i=useCallback(l=>r(s=>s&~l),[r]),a=useCallback(l=>r(s=>s^l),[r]);return {addFlag:o,hasFlag:n,removeFlag:i,toggleFlag:a}}var _o=createContext(null);function Go(){let e=useContext(_o);if(e===null){let t=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Go),t}return e}function Ae(){let[e,t]=useState([]);return [e.length>0?e.join(" "):void 0,useMemo(()=>function(o){let n=useCallback(a=>(t(l=>[...l,a]),()=>t(l=>{let s=l.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s})),[]),i=useMemo(()=>({register:n,slot:o.slot,name:o.name,props:o.props}),[n,o.slot,o.name,o.props]);return React__default.createElement(_o.Provider,{value:i},o.children)},[t])]}var Ni="label";function nt(e){let{passive:t=!1,...r}=e,o=Go(),n=`headlessui-label-${A$1()}`;x$1(()=>o.register(n),[n,o.register]);let i={...o.props,id:n},a={...r,...i};return t&&delete a.onClick,E({props:a,slot:o.slot||{},defaultTag:Ni,name:o.name||"Label"})}var Vi={[0](e,t){return {...e,options:[...e.options,{id:t.id,element:t.element,propsRef:t.propsRef}]}},[1](e,t){let r=e.options.slice(),o=e.options.findIndex(n=>n.id===t.id);return o===-1?e:(r.splice(o,1),{...e,options:r})}},jt=createContext(null);jt.displayName="RadioGroupContext";function Ho(e){let t=useContext(jt);if(t===null){let r=new Error(`<${e} /> is missing a parent <${lt.name} /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ho),r}return t}function $i(e,t){return S(t.type,Vi,e,t)}var Qi="div";function lt(e){let{value:t,onChange:r,disabled:o=!1,...n}=e,[{options:i},a]=useReducer($i,{options:[]}),[l,s]=Ae(),[u,c]=re(),m=`headlessui-radiogroup-${A$1()}`,b=useRef(null),T=useMemo(()=>i.find(R=>!R.propsRef.current.disabled),[i]),y=useMemo(()=>i.some(R=>R.propsRef.current.value===t),[i,t]),p=useCallback(R=>{var v;if(o||R===t)return !1;let g=(v=i.find(h=>h.propsRef.current.value===R))==null?void 0:v.propsRef.current;return (g==null?void 0:g.disabled)?!1:(r(R),!0)},[r,t,o,i]);se({container:b.current,accept(R){return R.getAttribute("role")==="radio"?NodeFilter.FILTER_REJECT:R.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(R){R.setAttribute("role","none");}});let f=useCallback(R=>{if(!b.current)return;let v=i.filter(h=>h.propsRef.current.disabled===!1).map(h=>h.element.current);switch(R.key){case"ArrowLeft":case"ArrowUp":if(R.preventDefault(),R.stopPropagation(),M(v,2|16)===2){let O=i.find(L=>L.element.current===document.activeElement);O&&p(O.propsRef.current.value);}break;case"ArrowRight":case"ArrowDown":if(R.preventDefault(),R.stopPropagation(),M(v,4|16)===2){let O=i.find(L=>L.element.current===document.activeElement);O&&p(O.propsRef.current.value);}break;case" ":{R.preventDefault(),R.stopPropagation();let h=i.find(O=>O.element.current===document.activeElement);h&&p(h.propsRef.current.value);}break}},[b,i,p]),d=useCallback(R=>(a({type:0,...R}),()=>a({type:1,id:R.id})),[a]),P=useMemo(()=>({registerOption:d,firstOption:T,containsCheckedOption:y,change:p,disabled:o,value:t}),[d,T,y,p,o,t]),C={ref:b,id:m,role:"radiogroup","aria-labelledby":l,"aria-describedby":u,onKeyDown:f};return React__default.createElement(c,{name:"RadioGroup.Description"},React__default.createElement(s,{name:"RadioGroup.Label"},React__default.createElement(jt.Provider,{value:P},E({props:{...n,...C},defaultTag:Qi,name:"RadioGroup"}))))}var qi="div";function zi(e){let t=useRef(null),r=`headlessui-radiogroup-option-${A$1()}`,[o,n]=Ae(),[i,a]=re(),{addFlag:l,removeFlag:s,hasFlag:u}=wo(1),{value:c,disabled:m=!1,...b}=e,T=useRef({value:c,disabled:m});x$1(()=>{T.current.value=c;},[c,T]),x$1(()=>{T.current.disabled=m;},[m,T]);let{registerOption:y,disabled:p,change:f,firstOption:d,containsCheckedOption:P,value:C}=Ho("RadioGroup.Option");x$1(()=>y({id:r,element:t,propsRef:T}),[r,y,t,e]);let R=useCallback(()=>{var V;!f(c)||(l(2),(V=t.current)==null||V.focus());},[l,f,c]),g=useCallback(()=>l(2),[l]),v=useCallback(()=>s(2),[s]),h=(d==null?void 0:d.id)===r,O=p||m,L=C===c,N={ref:t,id:r,role:"radio","aria-checked":L?"true":"false","aria-labelledby":o,"aria-describedby":i,"aria-disabled":O?!0:void 0,tabIndex:(()=>O?-1:L||!P&&h?0:-1)(),onClick:O?void 0:R,onFocus:O?void 0:g,onBlur:O?void 0:v},K=useMemo(()=>({checked:L,disabled:O,active:u(2)}),[L,O,u]);return React__default.createElement(a,{name:"RadioGroup.Description"},React__default.createElement(n,{name:"RadioGroup.Label"},E({props:{...b,...N},slot:K,defaultTag:qi,name:"RadioGroup.Option"})))}lt.Option=zi;lt.Label=nt;lt.Description=me;var $t=createContext(null);$t.displayName="GroupContext";var zt=createContext(null);zt.displayName="TabsContext";var dt=createContext(null);dt.displayName="TransitionContext";var ct=createContext(null);ct.displayName="NestingContext";
|
|
3666
3666
|
|
|
3667
3667
|
var BaseSelectButton = function (_a) {
|
|
3668
3668
|
var children = _a.children, as = _a.as;
|
|
@@ -4460,12 +4460,12 @@ var Container$C = newStyled.div(templateObject_1$Z || (templateObject_1$Z = __ma
|
|
|
4460
4460
|
var borderColor = _a.borderColor;
|
|
4461
4461
|
return borderColor;
|
|
4462
4462
|
});
|
|
4463
|
-
var Image$
|
|
4463
|
+
var Image$3 = newStyled.img(templateObject_2$C || (templateObject_2$C = __makeTemplateObject(["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n"], ["\n width: 100%;\n height: 100%;\n border-radius: 50%;\n"])));
|
|
4464
4464
|
var PatternSelector = function (_a) {
|
|
4465
4465
|
var url = _a.url, selected = _a.selected, testId = _a.testId;
|
|
4466
4466
|
var theme = useTheme();
|
|
4467
4467
|
var outerBorder = selected ? theme.colors.shades['550'].color : 'transparent';
|
|
4468
|
-
return (jsx$1(Container$C, __assign$1({ "data-testid": testId, borderColor: outerBorder }, { children: jsx$1(Image$
|
|
4468
|
+
return (jsx$1(Container$C, __assign$1({ "data-testid": testId, borderColor: outerBorder }, { children: jsx$1(Image$3, { src: url, alt: "pattern" }, void 0) }), void 0));
|
|
4469
4469
|
};
|
|
4470
4470
|
var templateObject_1$Z, templateObject_2$C;
|
|
4471
4471
|
|
|
@@ -4525,14 +4525,14 @@ var MultiColorPicker = function (_a) {
|
|
|
4525
4525
|
return (jsxs$1(ColorRadioGroup$1, __assign$1({ value: selectedColor, onChange: onChangeHandler }, { children: [jsx$1(ColorRadioGroup$1.Label, { label: label, values: valueLabels }, void 0), jsx$1(ColorRadioGroup$1.OptionsContainer, { children: renderOptions(selectedColor, options) }, void 0)] }), void 0));
|
|
4526
4526
|
};
|
|
4527
4527
|
|
|
4528
|
-
var Image$
|
|
4528
|
+
var Image$2 = newStyled.img(templateObject_1$Y || (templateObject_1$Y = __makeTemplateObject(["\n width: 4.063rem;\n height: 5.375rem;\n box-sizing: border-box;\n cursor: pointer;\n border: ", ";\n"], ["\n width: 4.063rem;\n height: 5.375rem;\n box-sizing: border-box;\n cursor: pointer;\n border: ", ";\n"])), function (_a) {
|
|
4529
4529
|
var selected = _a.selected, theme = _a.theme;
|
|
4530
4530
|
return selected ? "0.063rem solid ".concat(theme.colors.shades['700'].color) : 'inherit';
|
|
4531
4531
|
});
|
|
4532
4532
|
var ImageSmallPreview = function (_a) {
|
|
4533
4533
|
var imageUrl = _a.imageUrl, alt = _a.alt, _b = _a.selected, selected = _b === void 0 ? false : _b, className = _a.className;
|
|
4534
4534
|
var theme = useTheme();
|
|
4535
|
-
return jsx$1(Image$
|
|
4535
|
+
return jsx$1(Image$2, { className: className, src: imageUrl, alt: alt, selected: selected, theme: theme }, void 0);
|
|
4536
4536
|
};
|
|
4537
4537
|
var templateObject_1$Y;
|
|
4538
4538
|
|
|
@@ -4902,7 +4902,7 @@ var Symbol$2 = _Symbol;
|
|
|
4902
4902
|
var objectProto$1 = Object.prototype;
|
|
4903
4903
|
|
|
4904
4904
|
/** Used to check objects for own properties. */
|
|
4905
|
-
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
4905
|
+
var hasOwnProperty$1 = objectProto$1.hasOwnProperty;
|
|
4906
4906
|
|
|
4907
4907
|
/**
|
|
4908
4908
|
* Used to resolve the
|
|
@@ -4922,7 +4922,7 @@ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : undefined;
|
|
|
4922
4922
|
* @returns {string} Returns the raw `toStringTag`.
|
|
4923
4923
|
*/
|
|
4924
4924
|
function getRawTag$1(value) {
|
|
4925
|
-
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
4925
|
+
var isOwn = hasOwnProperty$1.call(value, symToStringTag$1),
|
|
4926
4926
|
tag = value[symToStringTag$1];
|
|
4927
4927
|
|
|
4928
4928
|
try {
|
|
@@ -6427,7 +6427,7 @@ var Track = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
6427
6427
|
onMouseOver: onMouseOver,
|
|
6428
6428
|
onMouseLeave: onMouseLeave
|
|
6429
6429
|
};
|
|
6430
|
-
return /*#__PURE__*/React__default.createElement("div", _extends$
|
|
6430
|
+
return /*#__PURE__*/React__default.createElement("div", _extends$2({
|
|
6431
6431
|
ref: this.handleRef,
|
|
6432
6432
|
className: "slick-track",
|
|
6433
6433
|
style: this.props.trackStyle
|
|
@@ -6583,7 +6583,7 @@ var PrevArrow = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
6583
6583
|
if (this.props.prevArrow) {
|
|
6584
6584
|
prevArrow = /*#__PURE__*/React__default.cloneElement(this.props.prevArrow, _objectSpread2(_objectSpread2({}, prevArrowProps), customProps));
|
|
6585
6585
|
} else {
|
|
6586
|
-
prevArrow = /*#__PURE__*/React__default.createElement("button", _extends$
|
|
6586
|
+
prevArrow = /*#__PURE__*/React__default.createElement("button", _extends$2({
|
|
6587
6587
|
key: "0",
|
|
6588
6588
|
type: "button"
|
|
6589
6589
|
}, prevArrowProps), " ", "Previous");
|
|
@@ -6649,7 +6649,7 @@ var NextArrow = /*#__PURE__*/function (_React$PureComponent2) {
|
|
|
6649
6649
|
if (this.props.nextArrow) {
|
|
6650
6650
|
nextArrow = /*#__PURE__*/React__default.cloneElement(this.props.nextArrow, _objectSpread2(_objectSpread2({}, nextArrowProps), customProps));
|
|
6651
6651
|
} else {
|
|
6652
|
-
nextArrow = /*#__PURE__*/React__default.createElement("button", _extends$
|
|
6652
|
+
nextArrow = /*#__PURE__*/React__default.createElement("button", _extends$2({
|
|
6653
6653
|
key: "1",
|
|
6654
6654
|
type: "button"
|
|
6655
6655
|
}, nextArrowProps), " ", "Next");
|
|
@@ -8352,9 +8352,9 @@ var InnerSlider = /*#__PURE__*/function (_React$Component) {
|
|
|
8352
8352
|
};
|
|
8353
8353
|
}
|
|
8354
8354
|
|
|
8355
|
-
return /*#__PURE__*/React__default.createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", /*#__PURE__*/React__default.createElement("div", _extends$
|
|
8355
|
+
return /*#__PURE__*/React__default.createElement("div", innerSliderProps, !_this.props.unslick ? prevArrow : "", /*#__PURE__*/React__default.createElement("div", _extends$2({
|
|
8356
8356
|
ref: _this.listRefHandler
|
|
8357
|
-
}, listProps), /*#__PURE__*/React__default.createElement(Track, _extends$
|
|
8357
|
+
}, listProps), /*#__PURE__*/React__default.createElement(Track, _extends$2({
|
|
8358
8358
|
ref: _this.trackRefHandler
|
|
8359
8359
|
}, trackProps), _this.props.children)), !_this.props.unslick ? nextArrow : "", !_this.props.unslick ? dots : "");
|
|
8360
8360
|
});
|
|
@@ -8767,7 +8767,7 @@ var Slider = /*#__PURE__*/function (_React$Component) {
|
|
|
8767
8767
|
settings.unslick = true;
|
|
8768
8768
|
}
|
|
8769
8769
|
|
|
8770
|
-
return /*#__PURE__*/React__default.createElement(InnerSlider, _extends$
|
|
8770
|
+
return /*#__PURE__*/React__default.createElement(InnerSlider, _extends$2({
|
|
8771
8771
|
style: this.props.style,
|
|
8772
8772
|
ref: this.innerSliderRefHandler
|
|
8773
8773
|
}, settings), newChildren);
|
|
@@ -8849,7 +8849,7 @@ var Container$B = newStyled.div(templateObject_3$q || (templateObject_3$q = __ma
|
|
|
8849
8849
|
var position = _a.position;
|
|
8850
8850
|
return (position == 'horizontal' ? horizontalStyles : verticalStyles);
|
|
8851
8851
|
});
|
|
8852
|
-
var Button$3 = newStyled.button(templateObject_4$i || (templateObject_4$i = __makeTemplateObject(["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n"], ["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n"])));
|
|
8852
|
+
var Button$3 = newStyled.button(templateObject_4$i || (templateObject_4$i = __makeTemplateObject(["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n outline: none;\n"], ["\n padding: 0;\n border: none;\n text-decoration: none;\n background: transparent;\n outline: none;\n"])));
|
|
8853
8853
|
var ImagePreviewList = function (_a) {
|
|
8854
8854
|
var images = _a.images, selectedImage = _a.selectedImage, onClick = _a.onClick, dataTestId = _a.dataTestId, position = _a.position;
|
|
8855
8855
|
return (jsx$1(Container$B, __assign$1({ "data-testid": dataTestId, position: position, className: position }, { children: position == 'horizontal' ? (jsx$1("div", __assign$1({ style: { maxWidth: '360px' } }, { children: jsx$1(SliderNavigation, __assign$1({ speed: 200, infinite: false, arrows: {
|
|
@@ -8860,238 +8860,1818 @@ var ImagePreviewList = function (_a) {
|
|
|
8860
8860
|
};
|
|
8861
8861
|
var templateObject_1$W, templateObject_2$B, templateObject_3$q, templateObject_4$i;
|
|
8862
8862
|
|
|
8863
|
-
var
|
|
8864
|
-
var Image = function (_a) {
|
|
8865
|
-
var src = _a.src, alt = _a.alt, height = _a.height, width = _a.width, borderRadius = _a.borderRadius, objectFit = _a.objectFit, objectPosition = _a.objectPosition, className = _a.className;
|
|
8866
|
-
return (jsx$1(Img, { src: src, alt: alt, height: height, width: width, borderRadius: borderRadius, objectFit: objectFit, objectPosition: objectPosition, className: className }, void 0));
|
|
8867
|
-
};
|
|
8868
|
-
var templateObject_1$V;
|
|
8863
|
+
var propTypes = {exports: {}};
|
|
8869
8864
|
|
|
8870
|
-
var
|
|
8871
|
-
var TopTagContainer$2 = newStyled.div(templateObject_2$A || (templateObject_2$A = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n"])));
|
|
8872
|
-
var BottomTagContainer$2 = newStyled.div(templateObject_3$p || (templateObject_3$p = __makeTemplateObject(["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"], ["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"])));
|
|
8873
|
-
var ImageProductWithTags$1 = function (_a) {
|
|
8874
|
-
var image = _a.image, topTag = _a.topTag, bottomTag = _a.bottomTag, testId = _a.testId, position = _a.position;
|
|
8875
|
-
return (jsxs$1(Container$A, __assign$1({ "data-testid": testId, className: "stylefor".concat(position) }, { children: [jsx$1(Image, { src: image.imageUrl, alt: image.alt, objectFit: "cover", objectPosition: "center", width: position == 'horizontal' ? '360px' : '530px', height: position == 'horizontal' ? 'auto' : '720px' }, void 0), jsx$1(TopTagContainer$2, { children: topTag }, void 0), jsx$1(BottomTagContainer$2, { children: bottomTag }, void 0)] }), void 0));
|
|
8876
|
-
};
|
|
8877
|
-
var templateObject_1$U, templateObject_2$A, templateObject_3$p;
|
|
8865
|
+
var reactIs = {exports: {}};
|
|
8878
8866
|
|
|
8879
|
-
var
|
|
8880
|
-
var ProductGallery = function (_a) {
|
|
8881
|
-
var images = _a.images, selectedValue = _a.selectedValue, topTag = _a.topTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, previewListDataTestId = _a.previewListDataTestId, thumbnailPosition = _a.thumbnailPosition;
|
|
8882
|
-
var initialValue = selectedValue && images.includes(selectedValue) ? selectedValue : images[0];
|
|
8883
|
-
var _b = useState(initialValue), selectedImage = _b[0], setSelectedImage = _b[1];
|
|
8884
|
-
useEffect(function () {
|
|
8885
|
-
setSelectedImage(initialValue);
|
|
8886
|
-
}, [initialValue]);
|
|
8887
|
-
return (jsxs$1(Container$z, { children: [jsx$1(ImagePreviewList, { images: images, selectedImage: selectedImage, dataTestId: previewListDataTestId, onClick: function (value) {
|
|
8888
|
-
setSelectedImage(value);
|
|
8889
|
-
}, position: thumbnailPosition }, void 0), jsx$1(ImageProductWithTags$1, { image: selectedImage, topTag: topTag, bottomTag: bottomTag, testId: productImageDataTestId, position: thumbnailPosition }, void 0)] }, void 0));
|
|
8890
|
-
};
|
|
8891
|
-
var templateObject_1$T;
|
|
8867
|
+
var reactIs_production_min = {};
|
|
8892
8868
|
|
|
8893
|
-
|
|
8894
|
-
|
|
8895
|
-
|
|
8896
|
-
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
|
|
8901
|
-
|
|
8902
|
-
|
|
8903
|
-
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
});
|
|
8908
|
-
},
|
|
8909
|
-
small: function (theme) {
|
|
8910
|
-
return css({
|
|
8911
|
-
svg: {
|
|
8912
|
-
width: theme.component.stars.element.small.width,
|
|
8913
|
-
height: theme.component.stars.element.small.height,
|
|
8914
|
-
marginRight: theme.component.stars.element.small.marginRight,
|
|
8915
|
-
},
|
|
8916
|
-
});
|
|
8917
|
-
},
|
|
8918
|
-
medium: function (theme) {
|
|
8919
|
-
return css({
|
|
8920
|
-
svg: {
|
|
8921
|
-
width: theme.component.stars.element.medium.width,
|
|
8922
|
-
height: theme.component.stars.element.medium.height,
|
|
8923
|
-
marginRight: theme.component.stars.element.medium.marginRight,
|
|
8924
|
-
},
|
|
8925
|
-
});
|
|
8926
|
-
},
|
|
8927
|
-
large: function (theme) {
|
|
8928
|
-
return css({
|
|
8929
|
-
svg: {
|
|
8930
|
-
width: theme.component.stars.element.large.width,
|
|
8931
|
-
height: theme.component.stars.element.large.height,
|
|
8932
|
-
marginRight: theme.component.stars.element.large.marginRight,
|
|
8933
|
-
},
|
|
8934
|
-
});
|
|
8935
|
-
},
|
|
8936
|
-
};
|
|
8937
|
-
var Container$y = newStyled.div(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
8938
|
-
var templateObject_1$S;
|
|
8869
|
+
/** @license React v16.13.1
|
|
8870
|
+
* react-is.production.min.js
|
|
8871
|
+
*
|
|
8872
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8873
|
+
*
|
|
8874
|
+
* This source code is licensed under the MIT license found in the
|
|
8875
|
+
* LICENSE file in the root directory of this source tree.
|
|
8876
|
+
*/
|
|
8877
|
+
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
8878
|
+
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
8879
|
+
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min.AsyncMode=l;reactIs_production_min.ConcurrentMode=m;reactIs_production_min.ContextConsumer=k;reactIs_production_min.ContextProvider=h;reactIs_production_min.Element=c;reactIs_production_min.ForwardRef=n;reactIs_production_min.Fragment=e;reactIs_production_min.Lazy=t;reactIs_production_min.Memo=r;reactIs_production_min.Portal=d;
|
|
8880
|
+
reactIs_production_min.Profiler=g;reactIs_production_min.StrictMode=f;reactIs_production_min.Suspense=p;reactIs_production_min.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min.isConcurrentMode=A;reactIs_production_min.isContextConsumer=function(a){return z(a)===k};reactIs_production_min.isContextProvider=function(a){return z(a)===h};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min.isForwardRef=function(a){return z(a)===n};reactIs_production_min.isFragment=function(a){return z(a)===e};reactIs_production_min.isLazy=function(a){return z(a)===t};
|
|
8881
|
+
reactIs_production_min.isMemo=function(a){return z(a)===r};reactIs_production_min.isPortal=function(a){return z(a)===d};reactIs_production_min.isProfiler=function(a){return z(a)===g};reactIs_production_min.isStrictMode=function(a){return z(a)===f};reactIs_production_min.isSuspense=function(a){return z(a)===p};
|
|
8882
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min.typeOf=z;
|
|
8939
8883
|
|
|
8940
|
-
var
|
|
8941
|
-
var size = _a.size, theme = _a.theme;
|
|
8942
|
-
return [
|
|
8943
|
-
StarStyles.baseStyles(),
|
|
8944
|
-
StarStyles[size](theme),
|
|
8945
|
-
];
|
|
8946
|
-
});
|
|
8947
|
-
var sizes = {
|
|
8948
|
-
xsmall: { width: 0.75, height: 0.75 },
|
|
8949
|
-
small: { width: 1, height: 1 },
|
|
8950
|
-
medium: { width: 1.5, height: 1.5 },
|
|
8951
|
-
large: { width: 2.5, height: 2.5 },
|
|
8952
|
-
};
|
|
8953
|
-
var StarList = function (_a) {
|
|
8954
|
-
var rating = _a.rating, starsNumber = _a.starsNumber, fill = _a.fill, _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b;
|
|
8955
|
-
var theme = useTheme();
|
|
8956
|
-
return (jsx$1(Container$y, { children: __spreadArray([], new Array(starsNumber), true).map(function (_, index) {
|
|
8957
|
-
return (jsx$1(StarContainer, __assign$1({ "data-testid": "star-container", size: size, theme: theme }, { children: index < Math.floor(rating) ? (jsx$1(Icon.PDP.Star, __assign$1({}, sizes[size], { fill: fill }), void 0)) : index === Math.floor(rating) && rating % 1 != 0 ? (jsx$1(Icon.PDP.StarHalf, __assign$1({}, sizes[size], { fill: fill }), void 0)) : (jsx$1(Icon.PDP.StarEmpty, __assign$1({}, sizes[size], { fill: fill }), void 0)) }), index));
|
|
8958
|
-
}) }, void 0));
|
|
8959
|
-
};
|
|
8884
|
+
var reactIs_development = {};
|
|
8960
8885
|
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8964
|
-
|
|
8965
|
-
|
|
8966
|
-
|
|
8967
|
-
|
|
8968
|
-
|
|
8969
|
-
});
|
|
8970
|
-
},
|
|
8971
|
-
xsmall: function (theme) {
|
|
8972
|
-
return css({
|
|
8973
|
-
fontSize: theme.component.rating.size.xsmall.fontSize,
|
|
8974
|
-
lineHeight: theme.component.rating.size.xsmall.lineHeight,
|
|
8975
|
-
marginLeft: '0.172rem',
|
|
8976
|
-
});
|
|
8977
|
-
},
|
|
8978
|
-
small: function (theme) {
|
|
8979
|
-
return css({
|
|
8980
|
-
fontSize: theme.component.rating.size.small.fontSize,
|
|
8981
|
-
lineHeight: theme.component.rating.size.small.lineHeight,
|
|
8982
|
-
marginLeft: '0.313rem',
|
|
8983
|
-
});
|
|
8984
|
-
},
|
|
8985
|
-
medium: function (theme) {
|
|
8986
|
-
return css({
|
|
8987
|
-
fontSize: theme.component.rating.size.medium.fontSize,
|
|
8988
|
-
lineHeight: theme.component.rating.size.medium.lineHeight,
|
|
8989
|
-
marginLeft: '0.438rem',
|
|
8990
|
-
});
|
|
8991
|
-
},
|
|
8992
|
-
large: function (theme) {
|
|
8993
|
-
return css({
|
|
8994
|
-
fontSize: theme.component.rating.size.large.fontSize,
|
|
8995
|
-
lineHeight: theme.component.rating.size.large.lineHeight,
|
|
8996
|
-
marginLeft: '0.563rem',
|
|
8997
|
-
});
|
|
8998
|
-
},
|
|
8999
|
-
};
|
|
9000
|
-
var Container$x = newStyled.div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
9001
|
-
var templateObject_1$R;
|
|
8886
|
+
/** @license React v16.13.1
|
|
8887
|
+
* react-is.development.js
|
|
8888
|
+
*
|
|
8889
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8890
|
+
*
|
|
8891
|
+
* This source code is licensed under the MIT license found in the
|
|
8892
|
+
* LICENSE file in the root directory of this source tree.
|
|
8893
|
+
*/
|
|
9002
8894
|
|
|
9003
|
-
var CustomLabel = newStyled.div(function (_a) {
|
|
9004
|
-
var theme = _a.theme, size = _a.size, wrapWithParenthesis = _a.wrapWithParenthesis;
|
|
9005
|
-
return [
|
|
9006
|
-
LabelStyles.baseStyles(theme),
|
|
9007
|
-
LabelStyles[size](theme),
|
|
9008
|
-
{
|
|
9009
|
-
':before': {
|
|
9010
|
-
content: wrapWithParenthesis ? '"("' : '""',
|
|
9011
|
-
},
|
|
9012
|
-
':after': {
|
|
9013
|
-
content: wrapWithParenthesis ? '")"' : '""',
|
|
9014
|
-
},
|
|
9015
|
-
},
|
|
9016
|
-
];
|
|
9017
|
-
});
|
|
9018
|
-
var starsNumber = 5;
|
|
9019
|
-
var Rating = function (_a) {
|
|
9020
|
-
var _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b, reviews = _a.reviews, reviewsText = _a.reviewsText, rating = _a.rating, _c = _a.wrapWithParenthesis, wrapWithParenthesis = _c === void 0 ? false : _c;
|
|
9021
|
-
var theme = useTheme();
|
|
9022
|
-
return (jsxs$1(Container$x, { children: [jsx$1(StarList, { rating: rating, size: size, starsNumber: starsNumber, fill: theme.component.stars.element.color }, void 0), jsxs$1(CustomLabel, __assign$1({ theme: theme, size: size, wrapWithParenthesis: wrapWithParenthesis, "data-testid": "CustomLabel" }, { children: [reviews, " ", reviewsText] }), void 0)] }, void 0));
|
|
9023
|
-
};
|
|
9024
8895
|
|
|
9025
|
-
var Container$w = newStyled.div(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"], ["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"])));
|
|
9026
|
-
var P$2 = newStyled.p(templateObject_2$z || (templateObject_2$z = __makeTemplateObject(["\n margin: 0 0.25rem;\n font-weight: 700;\n color: ", ";\n"], ["\n margin: 0 0.25rem;\n font-weight: 700;\n color: ", ";\n"])), function (props) { return props.theme.colors.shades['550'].color; });
|
|
9027
|
-
var textButtonStyles = function (theme) { return ({
|
|
9028
|
-
border: 'none',
|
|
9029
|
-
background: 'transparent',
|
|
9030
|
-
padding: 0,
|
|
9031
|
-
textDecoration: 'underline',
|
|
9032
|
-
color: theme.colors.shades['400'].color,
|
|
9033
|
-
lineHeight: '1.13rem',
|
|
9034
|
-
cursor: 'pointer',
|
|
9035
|
-
}); };
|
|
9036
|
-
var FitPredictor = function (_a) {
|
|
9037
|
-
var onClick = _a.onClick;
|
|
9038
|
-
var theme = useTheme();
|
|
9039
|
-
return (jsxs(Container$w, __assign$1({ theme: theme }, { children: [jsx(Container$w, { children: jsx(Icon.Other.FitPredictor, { width: 1.125, height: 1.125, fill: theme.colors.shades['550'].color }, void 0) }, void 0), jsx(P$2, __assign$1({ theme: theme }, { children: "FIT PREDICTOR" }), void 0), jsx(BaseButton, __assign$1({ css: textButtonStyles(theme), onClick: onClick }, { children: "Calculate your size" }), void 0)] }), void 0));
|
|
9040
|
-
};
|
|
9041
|
-
var templateObject_1$Q, templateObject_2$z;
|
|
9042
8896
|
|
|
9043
|
-
|
|
9044
|
-
|
|
9045
|
-
|
|
9046
|
-
|
|
9047
|
-
|
|
9048
|
-
|
|
9049
|
-
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
var
|
|
9056
|
-
|
|
9057
|
-
|
|
9058
|
-
|
|
9059
|
-
|
|
9060
|
-
|
|
9061
|
-
|
|
9062
|
-
|
|
9063
|
-
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
|
|
9067
|
-
|
|
9068
|
-
var
|
|
9069
|
-
|
|
9070
|
-
|
|
9071
|
-
|
|
9072
|
-
|
|
9073
|
-
|
|
9074
|
-
|
|
9075
|
-
|
|
9076
|
-
|
|
9077
|
-
|
|
9078
|
-
|
|
9079
|
-
|
|
9080
|
-
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
|
|
9084
|
-
|
|
9085
|
-
|
|
9086
|
-
|
|
9087
|
-
|
|
9088
|
-
|
|
8897
|
+
if (process.env.NODE_ENV !== "production") {
|
|
8898
|
+
(function() {
|
|
8899
|
+
|
|
8900
|
+
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
8901
|
+
// nor polyfill, then a plain number is used for performance.
|
|
8902
|
+
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
8903
|
+
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
8904
|
+
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
8905
|
+
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
8906
|
+
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
8907
|
+
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
8908
|
+
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
8909
|
+
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
8910
|
+
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
8911
|
+
|
|
8912
|
+
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
8913
|
+
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
8914
|
+
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
8915
|
+
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
8916
|
+
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
8917
|
+
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
8918
|
+
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
8919
|
+
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
8920
|
+
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
8921
|
+
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
8922
|
+
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
8923
|
+
|
|
8924
|
+
function isValidElementType(type) {
|
|
8925
|
+
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
8926
|
+
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
8927
|
+
}
|
|
8928
|
+
|
|
8929
|
+
function typeOf(object) {
|
|
8930
|
+
if (typeof object === 'object' && object !== null) {
|
|
8931
|
+
var $$typeof = object.$$typeof;
|
|
8932
|
+
|
|
8933
|
+
switch ($$typeof) {
|
|
8934
|
+
case REACT_ELEMENT_TYPE:
|
|
8935
|
+
var type = object.type;
|
|
8936
|
+
|
|
8937
|
+
switch (type) {
|
|
8938
|
+
case REACT_ASYNC_MODE_TYPE:
|
|
8939
|
+
case REACT_CONCURRENT_MODE_TYPE:
|
|
8940
|
+
case REACT_FRAGMENT_TYPE:
|
|
8941
|
+
case REACT_PROFILER_TYPE:
|
|
8942
|
+
case REACT_STRICT_MODE_TYPE:
|
|
8943
|
+
case REACT_SUSPENSE_TYPE:
|
|
8944
|
+
return type;
|
|
8945
|
+
|
|
8946
|
+
default:
|
|
8947
|
+
var $$typeofType = type && type.$$typeof;
|
|
8948
|
+
|
|
8949
|
+
switch ($$typeofType) {
|
|
8950
|
+
case REACT_CONTEXT_TYPE:
|
|
8951
|
+
case REACT_FORWARD_REF_TYPE:
|
|
8952
|
+
case REACT_LAZY_TYPE:
|
|
8953
|
+
case REACT_MEMO_TYPE:
|
|
8954
|
+
case REACT_PROVIDER_TYPE:
|
|
8955
|
+
return $$typeofType;
|
|
8956
|
+
|
|
8957
|
+
default:
|
|
8958
|
+
return $$typeof;
|
|
8959
|
+
}
|
|
8960
|
+
|
|
8961
|
+
}
|
|
8962
|
+
|
|
8963
|
+
case REACT_PORTAL_TYPE:
|
|
8964
|
+
return $$typeof;
|
|
8965
|
+
}
|
|
8966
|
+
}
|
|
8967
|
+
|
|
8968
|
+
return undefined;
|
|
8969
|
+
} // AsyncMode is deprecated along with isAsyncMode
|
|
8970
|
+
|
|
8971
|
+
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
8972
|
+
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
8973
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
8974
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
8975
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
8976
|
+
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
8977
|
+
var Fragment = REACT_FRAGMENT_TYPE;
|
|
8978
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
8979
|
+
var Memo = REACT_MEMO_TYPE;
|
|
8980
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
8981
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
8982
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
8983
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
8984
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
8985
|
+
|
|
8986
|
+
function isAsyncMode(object) {
|
|
8987
|
+
{
|
|
8988
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
8989
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
8990
|
+
|
|
8991
|
+
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
8992
|
+
}
|
|
8993
|
+
}
|
|
8994
|
+
|
|
8995
|
+
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
8996
|
+
}
|
|
8997
|
+
function isConcurrentMode(object) {
|
|
8998
|
+
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
8999
|
+
}
|
|
9000
|
+
function isContextConsumer(object) {
|
|
9001
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
9002
|
+
}
|
|
9003
|
+
function isContextProvider(object) {
|
|
9004
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
9005
|
+
}
|
|
9006
|
+
function isElement(object) {
|
|
9007
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
9008
|
+
}
|
|
9009
|
+
function isForwardRef(object) {
|
|
9010
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
9011
|
+
}
|
|
9012
|
+
function isFragment(object) {
|
|
9013
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
9014
|
+
}
|
|
9015
|
+
function isLazy(object) {
|
|
9016
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
9017
|
+
}
|
|
9018
|
+
function isMemo(object) {
|
|
9019
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
9020
|
+
}
|
|
9021
|
+
function isPortal(object) {
|
|
9022
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
9023
|
+
}
|
|
9024
|
+
function isProfiler(object) {
|
|
9025
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
9026
|
+
}
|
|
9027
|
+
function isStrictMode(object) {
|
|
9028
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
9029
|
+
}
|
|
9030
|
+
function isSuspense(object) {
|
|
9031
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
9032
|
+
}
|
|
9033
|
+
|
|
9034
|
+
reactIs_development.AsyncMode = AsyncMode;
|
|
9035
|
+
reactIs_development.ConcurrentMode = ConcurrentMode;
|
|
9036
|
+
reactIs_development.ContextConsumer = ContextConsumer;
|
|
9037
|
+
reactIs_development.ContextProvider = ContextProvider;
|
|
9038
|
+
reactIs_development.Element = Element;
|
|
9039
|
+
reactIs_development.ForwardRef = ForwardRef;
|
|
9040
|
+
reactIs_development.Fragment = Fragment;
|
|
9041
|
+
reactIs_development.Lazy = Lazy;
|
|
9042
|
+
reactIs_development.Memo = Memo;
|
|
9043
|
+
reactIs_development.Portal = Portal;
|
|
9044
|
+
reactIs_development.Profiler = Profiler;
|
|
9045
|
+
reactIs_development.StrictMode = StrictMode;
|
|
9046
|
+
reactIs_development.Suspense = Suspense;
|
|
9047
|
+
reactIs_development.isAsyncMode = isAsyncMode;
|
|
9048
|
+
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
9049
|
+
reactIs_development.isContextConsumer = isContextConsumer;
|
|
9050
|
+
reactIs_development.isContextProvider = isContextProvider;
|
|
9051
|
+
reactIs_development.isElement = isElement;
|
|
9052
|
+
reactIs_development.isForwardRef = isForwardRef;
|
|
9053
|
+
reactIs_development.isFragment = isFragment;
|
|
9054
|
+
reactIs_development.isLazy = isLazy;
|
|
9055
|
+
reactIs_development.isMemo = isMemo;
|
|
9056
|
+
reactIs_development.isPortal = isPortal;
|
|
9057
|
+
reactIs_development.isProfiler = isProfiler;
|
|
9058
|
+
reactIs_development.isStrictMode = isStrictMode;
|
|
9059
|
+
reactIs_development.isSuspense = isSuspense;
|
|
9060
|
+
reactIs_development.isValidElementType = isValidElementType;
|
|
9061
|
+
reactIs_development.typeOf = typeOf;
|
|
9062
|
+
})();
|
|
9063
|
+
}
|
|
9064
|
+
|
|
9065
|
+
if (process.env.NODE_ENV === 'production') {
|
|
9066
|
+
reactIs.exports = reactIs_production_min;
|
|
9067
|
+
} else {
|
|
9068
|
+
reactIs.exports = reactIs_development;
|
|
9069
|
+
}
|
|
9070
|
+
|
|
9071
|
+
/*
|
|
9072
|
+
object-assign
|
|
9073
|
+
(c) Sindre Sorhus
|
|
9074
|
+
@license MIT
|
|
9075
|
+
*/
|
|
9076
|
+
/* eslint-disable no-unused-vars */
|
|
9077
|
+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
9078
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
9079
|
+
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
9080
|
+
|
|
9081
|
+
function toObject(val) {
|
|
9082
|
+
if (val === null || val === undefined) {
|
|
9083
|
+
throw new TypeError('Object.assign cannot be called with null or undefined');
|
|
9084
|
+
}
|
|
9085
|
+
|
|
9086
|
+
return Object(val);
|
|
9087
|
+
}
|
|
9088
|
+
|
|
9089
|
+
function shouldUseNative() {
|
|
9090
|
+
try {
|
|
9091
|
+
if (!Object.assign) {
|
|
9092
|
+
return false;
|
|
9093
|
+
}
|
|
9094
|
+
|
|
9095
|
+
// Detect buggy property enumeration order in older V8 versions.
|
|
9096
|
+
|
|
9097
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=4118
|
|
9098
|
+
var test1 = new String('abc'); // eslint-disable-line no-new-wrappers
|
|
9099
|
+
test1[5] = 'de';
|
|
9100
|
+
if (Object.getOwnPropertyNames(test1)[0] === '5') {
|
|
9101
|
+
return false;
|
|
9102
|
+
}
|
|
9103
|
+
|
|
9104
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
9105
|
+
var test2 = {};
|
|
9106
|
+
for (var i = 0; i < 10; i++) {
|
|
9107
|
+
test2['_' + String.fromCharCode(i)] = i;
|
|
9108
|
+
}
|
|
9109
|
+
var order2 = Object.getOwnPropertyNames(test2).map(function (n) {
|
|
9110
|
+
return test2[n];
|
|
9111
|
+
});
|
|
9112
|
+
if (order2.join('') !== '0123456789') {
|
|
9113
|
+
return false;
|
|
9114
|
+
}
|
|
9115
|
+
|
|
9116
|
+
// https://bugs.chromium.org/p/v8/issues/detail?id=3056
|
|
9117
|
+
var test3 = {};
|
|
9118
|
+
'abcdefghijklmnopqrst'.split('').forEach(function (letter) {
|
|
9119
|
+
test3[letter] = letter;
|
|
9120
|
+
});
|
|
9121
|
+
if (Object.keys(Object.assign({}, test3)).join('') !==
|
|
9122
|
+
'abcdefghijklmnopqrst') {
|
|
9123
|
+
return false;
|
|
9124
|
+
}
|
|
9125
|
+
|
|
9126
|
+
return true;
|
|
9127
|
+
} catch (err) {
|
|
9128
|
+
// We don't expect any of the above to throw, but better to be safe.
|
|
9129
|
+
return false;
|
|
9130
|
+
}
|
|
9131
|
+
}
|
|
9132
|
+
|
|
9133
|
+
var objectAssign = shouldUseNative() ? Object.assign : function (target, source) {
|
|
9134
|
+
var from;
|
|
9135
|
+
var to = toObject(target);
|
|
9136
|
+
var symbols;
|
|
9137
|
+
|
|
9138
|
+
for (var s = 1; s < arguments.length; s++) {
|
|
9139
|
+
from = Object(arguments[s]);
|
|
9140
|
+
|
|
9141
|
+
for (var key in from) {
|
|
9142
|
+
if (hasOwnProperty.call(from, key)) {
|
|
9143
|
+
to[key] = from[key];
|
|
9144
|
+
}
|
|
9145
|
+
}
|
|
9146
|
+
|
|
9147
|
+
if (getOwnPropertySymbols) {
|
|
9148
|
+
symbols = getOwnPropertySymbols(from);
|
|
9149
|
+
for (var i = 0; i < symbols.length; i++) {
|
|
9150
|
+
if (propIsEnumerable.call(from, symbols[i])) {
|
|
9151
|
+
to[symbols[i]] = from[symbols[i]];
|
|
9152
|
+
}
|
|
9153
|
+
}
|
|
9154
|
+
}
|
|
9155
|
+
}
|
|
9156
|
+
|
|
9157
|
+
return to;
|
|
9158
|
+
};
|
|
9159
|
+
|
|
9160
|
+
/**
|
|
9161
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9162
|
+
*
|
|
9163
|
+
* This source code is licensed under the MIT license found in the
|
|
9164
|
+
* LICENSE file in the root directory of this source tree.
|
|
9165
|
+
*/
|
|
9166
|
+
|
|
9167
|
+
var ReactPropTypesSecret$3 = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';
|
|
9168
|
+
|
|
9169
|
+
var ReactPropTypesSecret_1 = ReactPropTypesSecret$3;
|
|
9170
|
+
|
|
9171
|
+
var has$2 = Function.call.bind(Object.prototype.hasOwnProperty);
|
|
9172
|
+
|
|
9173
|
+
/**
|
|
9174
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9175
|
+
*
|
|
9176
|
+
* This source code is licensed under the MIT license found in the
|
|
9177
|
+
* LICENSE file in the root directory of this source tree.
|
|
9178
|
+
*/
|
|
9179
|
+
|
|
9180
|
+
var printWarning$1 = function() {};
|
|
9181
|
+
|
|
9182
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9183
|
+
var ReactPropTypesSecret$2 = ReactPropTypesSecret_1;
|
|
9184
|
+
var loggedTypeFailures = {};
|
|
9185
|
+
var has$1 = has$2;
|
|
9186
|
+
|
|
9187
|
+
printWarning$1 = function(text) {
|
|
9188
|
+
var message = 'Warning: ' + text;
|
|
9189
|
+
if (typeof console !== 'undefined') {
|
|
9190
|
+
console.error(message);
|
|
9191
|
+
}
|
|
9192
|
+
try {
|
|
9193
|
+
// --- Welcome to debugging React ---
|
|
9194
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
9195
|
+
// to find the callsite that caused this warning to fire.
|
|
9196
|
+
throw new Error(message);
|
|
9197
|
+
} catch (x) { /**/ }
|
|
9198
|
+
};
|
|
9199
|
+
}
|
|
9200
|
+
|
|
9201
|
+
/**
|
|
9202
|
+
* Assert that the values match with the type specs.
|
|
9203
|
+
* Error messages are memorized and will only be shown once.
|
|
9204
|
+
*
|
|
9205
|
+
* @param {object} typeSpecs Map of name to a ReactPropType
|
|
9206
|
+
* @param {object} values Runtime values that need to be type-checked
|
|
9207
|
+
* @param {string} location e.g. "prop", "context", "child context"
|
|
9208
|
+
* @param {string} componentName Name of the component for error messages.
|
|
9209
|
+
* @param {?Function} getStack Returns the component stack.
|
|
9210
|
+
* @private
|
|
9211
|
+
*/
|
|
9212
|
+
function checkPropTypes$1(typeSpecs, values, location, componentName, getStack) {
|
|
9213
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9214
|
+
for (var typeSpecName in typeSpecs) {
|
|
9215
|
+
if (has$1(typeSpecs, typeSpecName)) {
|
|
9216
|
+
var error;
|
|
9217
|
+
// Prop type validation may throw. In case they do, we don't want to
|
|
9218
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
9219
|
+
// After these have been cleaned up, we'll let them throw.
|
|
9220
|
+
try {
|
|
9221
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
9222
|
+
// behavior as without this statement except with a better message.
|
|
9223
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
9224
|
+
var err = Error(
|
|
9225
|
+
(componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' +
|
|
9226
|
+
'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' +
|
|
9227
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
9228
|
+
);
|
|
9229
|
+
err.name = 'Invariant Violation';
|
|
9230
|
+
throw err;
|
|
9231
|
+
}
|
|
9232
|
+
error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret$2);
|
|
9233
|
+
} catch (ex) {
|
|
9234
|
+
error = ex;
|
|
9235
|
+
}
|
|
9236
|
+
if (error && !(error instanceof Error)) {
|
|
9237
|
+
printWarning$1(
|
|
9238
|
+
(componentName || 'React class') + ': type specification of ' +
|
|
9239
|
+
location + ' `' + typeSpecName + '` is invalid; the type checker ' +
|
|
9240
|
+
'function must return `null` or an `Error` but returned a ' + typeof error + '. ' +
|
|
9241
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
9242
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
9243
|
+
'shape all require an argument).'
|
|
9244
|
+
);
|
|
9245
|
+
}
|
|
9246
|
+
if (error instanceof Error && !(error.message in loggedTypeFailures)) {
|
|
9247
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
9248
|
+
// same error.
|
|
9249
|
+
loggedTypeFailures[error.message] = true;
|
|
9250
|
+
|
|
9251
|
+
var stack = getStack ? getStack() : '';
|
|
9252
|
+
|
|
9253
|
+
printWarning$1(
|
|
9254
|
+
'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '')
|
|
9255
|
+
);
|
|
9256
|
+
}
|
|
9257
|
+
}
|
|
9258
|
+
}
|
|
9259
|
+
}
|
|
9260
|
+
}
|
|
9261
|
+
|
|
9262
|
+
/**
|
|
9263
|
+
* Resets warning cache when testing.
|
|
9264
|
+
*
|
|
9265
|
+
* @private
|
|
9266
|
+
*/
|
|
9267
|
+
checkPropTypes$1.resetWarningCache = function() {
|
|
9268
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9269
|
+
loggedTypeFailures = {};
|
|
9270
|
+
}
|
|
9271
|
+
};
|
|
9272
|
+
|
|
9273
|
+
var checkPropTypes_1 = checkPropTypes$1;
|
|
9274
|
+
|
|
9275
|
+
/**
|
|
9276
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9277
|
+
*
|
|
9278
|
+
* This source code is licensed under the MIT license found in the
|
|
9279
|
+
* LICENSE file in the root directory of this source tree.
|
|
9280
|
+
*/
|
|
9281
|
+
|
|
9282
|
+
var ReactIs$1 = reactIs.exports;
|
|
9283
|
+
var assign = objectAssign;
|
|
9284
|
+
|
|
9285
|
+
var ReactPropTypesSecret$1 = ReactPropTypesSecret_1;
|
|
9286
|
+
var has = has$2;
|
|
9287
|
+
var checkPropTypes = checkPropTypes_1;
|
|
9288
|
+
|
|
9289
|
+
var printWarning = function() {};
|
|
9290
|
+
|
|
9291
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9292
|
+
printWarning = function(text) {
|
|
9293
|
+
var message = 'Warning: ' + text;
|
|
9294
|
+
if (typeof console !== 'undefined') {
|
|
9295
|
+
console.error(message);
|
|
9296
|
+
}
|
|
9297
|
+
try {
|
|
9298
|
+
// --- Welcome to debugging React ---
|
|
9299
|
+
// This error was thrown as a convenience so that you can use this stack
|
|
9300
|
+
// to find the callsite that caused this warning to fire.
|
|
9301
|
+
throw new Error(message);
|
|
9302
|
+
} catch (x) {}
|
|
9303
|
+
};
|
|
9304
|
+
}
|
|
9305
|
+
|
|
9306
|
+
function emptyFunctionThatReturnsNull() {
|
|
9307
|
+
return null;
|
|
9308
|
+
}
|
|
9309
|
+
|
|
9310
|
+
var factoryWithTypeCheckers = function(isValidElement, throwOnDirectAccess) {
|
|
9311
|
+
/* global Symbol */
|
|
9312
|
+
var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;
|
|
9313
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.
|
|
9314
|
+
|
|
9315
|
+
/**
|
|
9316
|
+
* Returns the iterator method function contained on the iterable object.
|
|
9317
|
+
*
|
|
9318
|
+
* Be sure to invoke the function with the iterable as context:
|
|
9319
|
+
*
|
|
9320
|
+
* var iteratorFn = getIteratorFn(myIterable);
|
|
9321
|
+
* if (iteratorFn) {
|
|
9322
|
+
* var iterator = iteratorFn.call(myIterable);
|
|
9323
|
+
* ...
|
|
9324
|
+
* }
|
|
9325
|
+
*
|
|
9326
|
+
* @param {?object} maybeIterable
|
|
9327
|
+
* @return {?function}
|
|
9328
|
+
*/
|
|
9329
|
+
function getIteratorFn(maybeIterable) {
|
|
9330
|
+
var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);
|
|
9331
|
+
if (typeof iteratorFn === 'function') {
|
|
9332
|
+
return iteratorFn;
|
|
9333
|
+
}
|
|
9334
|
+
}
|
|
9335
|
+
|
|
9336
|
+
/**
|
|
9337
|
+
* Collection of methods that allow declaration and validation of props that are
|
|
9338
|
+
* supplied to React components. Example usage:
|
|
9339
|
+
*
|
|
9340
|
+
* var Props = require('ReactPropTypes');
|
|
9341
|
+
* var MyArticle = React.createClass({
|
|
9342
|
+
* propTypes: {
|
|
9343
|
+
* // An optional string prop named "description".
|
|
9344
|
+
* description: Props.string,
|
|
9345
|
+
*
|
|
9346
|
+
* // A required enum prop named "category".
|
|
9347
|
+
* category: Props.oneOf(['News','Photos']).isRequired,
|
|
9348
|
+
*
|
|
9349
|
+
* // A prop named "dialog" that requires an instance of Dialog.
|
|
9350
|
+
* dialog: Props.instanceOf(Dialog).isRequired
|
|
9351
|
+
* },
|
|
9352
|
+
* render: function() { ... }
|
|
9353
|
+
* });
|
|
9354
|
+
*
|
|
9355
|
+
* A more formal specification of how these methods are used:
|
|
9356
|
+
*
|
|
9357
|
+
* type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)
|
|
9358
|
+
* decl := ReactPropTypes.{type}(.isRequired)?
|
|
9359
|
+
*
|
|
9360
|
+
* Each and every declaration produces a function with the same signature. This
|
|
9361
|
+
* allows the creation of custom validation functions. For example:
|
|
9362
|
+
*
|
|
9363
|
+
* var MyLink = React.createClass({
|
|
9364
|
+
* propTypes: {
|
|
9365
|
+
* // An optional string or URI prop named "href".
|
|
9366
|
+
* href: function(props, propName, componentName) {
|
|
9367
|
+
* var propValue = props[propName];
|
|
9368
|
+
* if (propValue != null && typeof propValue !== 'string' &&
|
|
9369
|
+
* !(propValue instanceof URI)) {
|
|
9370
|
+
* return new Error(
|
|
9371
|
+
* 'Expected a string or an URI for ' + propName + ' in ' +
|
|
9372
|
+
* componentName
|
|
9373
|
+
* );
|
|
9374
|
+
* }
|
|
9375
|
+
* }
|
|
9376
|
+
* },
|
|
9377
|
+
* render: function() {...}
|
|
9378
|
+
* });
|
|
9379
|
+
*
|
|
9380
|
+
* @internal
|
|
9381
|
+
*/
|
|
9382
|
+
|
|
9383
|
+
var ANONYMOUS = '<<anonymous>>';
|
|
9384
|
+
|
|
9385
|
+
// Important!
|
|
9386
|
+
// Keep this list in sync with production version in `./factoryWithThrowingShims.js`.
|
|
9387
|
+
var ReactPropTypes = {
|
|
9388
|
+
array: createPrimitiveTypeChecker('array'),
|
|
9389
|
+
bigint: createPrimitiveTypeChecker('bigint'),
|
|
9390
|
+
bool: createPrimitiveTypeChecker('boolean'),
|
|
9391
|
+
func: createPrimitiveTypeChecker('function'),
|
|
9392
|
+
number: createPrimitiveTypeChecker('number'),
|
|
9393
|
+
object: createPrimitiveTypeChecker('object'),
|
|
9394
|
+
string: createPrimitiveTypeChecker('string'),
|
|
9395
|
+
symbol: createPrimitiveTypeChecker('symbol'),
|
|
9396
|
+
|
|
9397
|
+
any: createAnyTypeChecker(),
|
|
9398
|
+
arrayOf: createArrayOfTypeChecker,
|
|
9399
|
+
element: createElementTypeChecker(),
|
|
9400
|
+
elementType: createElementTypeTypeChecker(),
|
|
9401
|
+
instanceOf: createInstanceTypeChecker,
|
|
9402
|
+
node: createNodeChecker(),
|
|
9403
|
+
objectOf: createObjectOfTypeChecker,
|
|
9404
|
+
oneOf: createEnumTypeChecker,
|
|
9405
|
+
oneOfType: createUnionTypeChecker,
|
|
9406
|
+
shape: createShapeTypeChecker,
|
|
9407
|
+
exact: createStrictShapeTypeChecker,
|
|
9408
|
+
};
|
|
9409
|
+
|
|
9410
|
+
/**
|
|
9411
|
+
* inlined Object.is polyfill to avoid requiring consumers ship their own
|
|
9412
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
|
|
9413
|
+
*/
|
|
9414
|
+
/*eslint-disable no-self-compare*/
|
|
9415
|
+
function is(x, y) {
|
|
9416
|
+
// SameValue algorithm
|
|
9417
|
+
if (x === y) {
|
|
9418
|
+
// Steps 1-5, 7-10
|
|
9419
|
+
// Steps 6.b-6.e: +0 != -0
|
|
9420
|
+
return x !== 0 || 1 / x === 1 / y;
|
|
9421
|
+
} else {
|
|
9422
|
+
// Step 6.a: NaN == NaN
|
|
9423
|
+
return x !== x && y !== y;
|
|
9424
|
+
}
|
|
9425
|
+
}
|
|
9426
|
+
/*eslint-enable no-self-compare*/
|
|
9427
|
+
|
|
9428
|
+
/**
|
|
9429
|
+
* We use an Error-like object for backward compatibility as people may call
|
|
9430
|
+
* PropTypes directly and inspect their output. However, we don't use real
|
|
9431
|
+
* Errors anymore. We don't inspect their stack anyway, and creating them
|
|
9432
|
+
* is prohibitively expensive if they are created too often, such as what
|
|
9433
|
+
* happens in oneOfType() for any type before the one that matched.
|
|
9434
|
+
*/
|
|
9435
|
+
function PropTypeError(message, data) {
|
|
9436
|
+
this.message = message;
|
|
9437
|
+
this.data = data && typeof data === 'object' ? data: {};
|
|
9438
|
+
this.stack = '';
|
|
9439
|
+
}
|
|
9440
|
+
// Make `instanceof Error` still work for returned errors.
|
|
9441
|
+
PropTypeError.prototype = Error.prototype;
|
|
9442
|
+
|
|
9443
|
+
function createChainableTypeChecker(validate) {
|
|
9444
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9445
|
+
var manualPropTypeCallCache = {};
|
|
9446
|
+
var manualPropTypeWarningCount = 0;
|
|
9447
|
+
}
|
|
9448
|
+
function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {
|
|
9449
|
+
componentName = componentName || ANONYMOUS;
|
|
9450
|
+
propFullName = propFullName || propName;
|
|
9451
|
+
|
|
9452
|
+
if (secret !== ReactPropTypesSecret$1) {
|
|
9453
|
+
if (throwOnDirectAccess) {
|
|
9454
|
+
// New behavior only for users of `prop-types` package
|
|
9455
|
+
var err = new Error(
|
|
9456
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
9457
|
+
'Use `PropTypes.checkPropTypes()` to call them. ' +
|
|
9458
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
9459
|
+
);
|
|
9460
|
+
err.name = 'Invariant Violation';
|
|
9461
|
+
throw err;
|
|
9462
|
+
} else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {
|
|
9463
|
+
// Old behavior for people using React.PropTypes
|
|
9464
|
+
var cacheKey = componentName + ':' + propName;
|
|
9465
|
+
if (
|
|
9466
|
+
!manualPropTypeCallCache[cacheKey] &&
|
|
9467
|
+
// Avoid spamming the console because they are often not actionable except for lib authors
|
|
9468
|
+
manualPropTypeWarningCount < 3
|
|
9469
|
+
) {
|
|
9470
|
+
printWarning(
|
|
9471
|
+
'You are manually calling a React.PropTypes validation ' +
|
|
9472
|
+
'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' +
|
|
9473
|
+
'and will throw in the standalone `prop-types` package. ' +
|
|
9474
|
+
'You may be seeing this warning due to a third-party PropTypes ' +
|
|
9475
|
+
'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.'
|
|
9476
|
+
);
|
|
9477
|
+
manualPropTypeCallCache[cacheKey] = true;
|
|
9478
|
+
manualPropTypeWarningCount++;
|
|
9479
|
+
}
|
|
9480
|
+
}
|
|
9481
|
+
}
|
|
9482
|
+
if (props[propName] == null) {
|
|
9483
|
+
if (isRequired) {
|
|
9484
|
+
if (props[propName] === null) {
|
|
9485
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));
|
|
9486
|
+
}
|
|
9487
|
+
return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));
|
|
9488
|
+
}
|
|
9489
|
+
return null;
|
|
9490
|
+
} else {
|
|
9491
|
+
return validate(props, propName, componentName, location, propFullName);
|
|
9492
|
+
}
|
|
9493
|
+
}
|
|
9494
|
+
|
|
9495
|
+
var chainedCheckType = checkType.bind(null, false);
|
|
9496
|
+
chainedCheckType.isRequired = checkType.bind(null, true);
|
|
9497
|
+
|
|
9498
|
+
return chainedCheckType;
|
|
9499
|
+
}
|
|
9500
|
+
|
|
9501
|
+
function createPrimitiveTypeChecker(expectedType) {
|
|
9502
|
+
function validate(props, propName, componentName, location, propFullName, secret) {
|
|
9503
|
+
var propValue = props[propName];
|
|
9504
|
+
var propType = getPropType(propValue);
|
|
9505
|
+
if (propType !== expectedType) {
|
|
9506
|
+
// `propValue` being instance of, say, date/regexp, pass the 'object'
|
|
9507
|
+
// check, but we can offer a more precise error message here rather than
|
|
9508
|
+
// 'of type `object`'.
|
|
9509
|
+
var preciseType = getPreciseType(propValue);
|
|
9510
|
+
|
|
9511
|
+
return new PropTypeError(
|
|
9512
|
+
'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'),
|
|
9513
|
+
{expectedType: expectedType}
|
|
9514
|
+
);
|
|
9515
|
+
}
|
|
9516
|
+
return null;
|
|
9517
|
+
}
|
|
9518
|
+
return createChainableTypeChecker(validate);
|
|
9519
|
+
}
|
|
9520
|
+
|
|
9521
|
+
function createAnyTypeChecker() {
|
|
9522
|
+
return createChainableTypeChecker(emptyFunctionThatReturnsNull);
|
|
9523
|
+
}
|
|
9524
|
+
|
|
9525
|
+
function createArrayOfTypeChecker(typeChecker) {
|
|
9526
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9527
|
+
if (typeof typeChecker !== 'function') {
|
|
9528
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');
|
|
9529
|
+
}
|
|
9530
|
+
var propValue = props[propName];
|
|
9531
|
+
if (!Array.isArray(propValue)) {
|
|
9532
|
+
var propType = getPropType(propValue);
|
|
9533
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));
|
|
9534
|
+
}
|
|
9535
|
+
for (var i = 0; i < propValue.length; i++) {
|
|
9536
|
+
var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret$1);
|
|
9537
|
+
if (error instanceof Error) {
|
|
9538
|
+
return error;
|
|
9539
|
+
}
|
|
9540
|
+
}
|
|
9541
|
+
return null;
|
|
9542
|
+
}
|
|
9543
|
+
return createChainableTypeChecker(validate);
|
|
9544
|
+
}
|
|
9545
|
+
|
|
9546
|
+
function createElementTypeChecker() {
|
|
9547
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9548
|
+
var propValue = props[propName];
|
|
9549
|
+
if (!isValidElement(propValue)) {
|
|
9550
|
+
var propType = getPropType(propValue);
|
|
9551
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));
|
|
9552
|
+
}
|
|
9553
|
+
return null;
|
|
9554
|
+
}
|
|
9555
|
+
return createChainableTypeChecker(validate);
|
|
9556
|
+
}
|
|
9557
|
+
|
|
9558
|
+
function createElementTypeTypeChecker() {
|
|
9559
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9560
|
+
var propValue = props[propName];
|
|
9561
|
+
if (!ReactIs$1.isValidElementType(propValue)) {
|
|
9562
|
+
var propType = getPropType(propValue);
|
|
9563
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.'));
|
|
9564
|
+
}
|
|
9565
|
+
return null;
|
|
9566
|
+
}
|
|
9567
|
+
return createChainableTypeChecker(validate);
|
|
9568
|
+
}
|
|
9569
|
+
|
|
9570
|
+
function createInstanceTypeChecker(expectedClass) {
|
|
9571
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9572
|
+
if (!(props[propName] instanceof expectedClass)) {
|
|
9573
|
+
var expectedClassName = expectedClass.name || ANONYMOUS;
|
|
9574
|
+
var actualClassName = getClassName(props[propName]);
|
|
9575
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));
|
|
9576
|
+
}
|
|
9577
|
+
return null;
|
|
9578
|
+
}
|
|
9579
|
+
return createChainableTypeChecker(validate);
|
|
9580
|
+
}
|
|
9581
|
+
|
|
9582
|
+
function createEnumTypeChecker(expectedValues) {
|
|
9583
|
+
if (!Array.isArray(expectedValues)) {
|
|
9584
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9585
|
+
if (arguments.length > 1) {
|
|
9586
|
+
printWarning(
|
|
9587
|
+
'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' +
|
|
9588
|
+
'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).'
|
|
9589
|
+
);
|
|
9590
|
+
} else {
|
|
9591
|
+
printWarning('Invalid argument supplied to oneOf, expected an array.');
|
|
9592
|
+
}
|
|
9593
|
+
}
|
|
9594
|
+
return emptyFunctionThatReturnsNull;
|
|
9595
|
+
}
|
|
9596
|
+
|
|
9597
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9598
|
+
var propValue = props[propName];
|
|
9599
|
+
for (var i = 0; i < expectedValues.length; i++) {
|
|
9600
|
+
if (is(propValue, expectedValues[i])) {
|
|
9601
|
+
return null;
|
|
9602
|
+
}
|
|
9603
|
+
}
|
|
9604
|
+
|
|
9605
|
+
var valuesString = JSON.stringify(expectedValues, function replacer(key, value) {
|
|
9606
|
+
var type = getPreciseType(value);
|
|
9607
|
+
if (type === 'symbol') {
|
|
9608
|
+
return String(value);
|
|
9609
|
+
}
|
|
9610
|
+
return value;
|
|
9611
|
+
});
|
|
9612
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));
|
|
9613
|
+
}
|
|
9614
|
+
return createChainableTypeChecker(validate);
|
|
9615
|
+
}
|
|
9616
|
+
|
|
9617
|
+
function createObjectOfTypeChecker(typeChecker) {
|
|
9618
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9619
|
+
if (typeof typeChecker !== 'function') {
|
|
9620
|
+
return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');
|
|
9621
|
+
}
|
|
9622
|
+
var propValue = props[propName];
|
|
9623
|
+
var propType = getPropType(propValue);
|
|
9624
|
+
if (propType !== 'object') {
|
|
9625
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));
|
|
9626
|
+
}
|
|
9627
|
+
for (var key in propValue) {
|
|
9628
|
+
if (has(propValue, key)) {
|
|
9629
|
+
var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
9630
|
+
if (error instanceof Error) {
|
|
9631
|
+
return error;
|
|
9632
|
+
}
|
|
9633
|
+
}
|
|
9634
|
+
}
|
|
9635
|
+
return null;
|
|
9636
|
+
}
|
|
9637
|
+
return createChainableTypeChecker(validate);
|
|
9638
|
+
}
|
|
9639
|
+
|
|
9640
|
+
function createUnionTypeChecker(arrayOfTypeCheckers) {
|
|
9641
|
+
if (!Array.isArray(arrayOfTypeCheckers)) {
|
|
9642
|
+
process.env.NODE_ENV !== 'production' ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;
|
|
9643
|
+
return emptyFunctionThatReturnsNull;
|
|
9644
|
+
}
|
|
9645
|
+
|
|
9646
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
9647
|
+
var checker = arrayOfTypeCheckers[i];
|
|
9648
|
+
if (typeof checker !== 'function') {
|
|
9649
|
+
printWarning(
|
|
9650
|
+
'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +
|
|
9651
|
+
'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.'
|
|
9652
|
+
);
|
|
9653
|
+
return emptyFunctionThatReturnsNull;
|
|
9654
|
+
}
|
|
9655
|
+
}
|
|
9656
|
+
|
|
9657
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9658
|
+
var expectedTypes = [];
|
|
9659
|
+
for (var i = 0; i < arrayOfTypeCheckers.length; i++) {
|
|
9660
|
+
var checker = arrayOfTypeCheckers[i];
|
|
9661
|
+
var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret$1);
|
|
9662
|
+
if (checkerResult == null) {
|
|
9663
|
+
return null;
|
|
9664
|
+
}
|
|
9665
|
+
if (checkerResult.data && has(checkerResult.data, 'expectedType')) {
|
|
9666
|
+
expectedTypes.push(checkerResult.data.expectedType);
|
|
9667
|
+
}
|
|
9668
|
+
}
|
|
9669
|
+
var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': '';
|
|
9670
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.'));
|
|
9671
|
+
}
|
|
9672
|
+
return createChainableTypeChecker(validate);
|
|
9673
|
+
}
|
|
9674
|
+
|
|
9675
|
+
function createNodeChecker() {
|
|
9676
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9677
|
+
if (!isNode(props[propName])) {
|
|
9678
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));
|
|
9679
|
+
}
|
|
9680
|
+
return null;
|
|
9681
|
+
}
|
|
9682
|
+
return createChainableTypeChecker(validate);
|
|
9683
|
+
}
|
|
9684
|
+
|
|
9685
|
+
function invalidValidatorError(componentName, location, propFullName, key, type) {
|
|
9686
|
+
return new PropTypeError(
|
|
9687
|
+
(componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' +
|
|
9688
|
+
'it must be a function, usually from the `prop-types` package, but received `' + type + '`.'
|
|
9689
|
+
);
|
|
9690
|
+
}
|
|
9691
|
+
|
|
9692
|
+
function createShapeTypeChecker(shapeTypes) {
|
|
9693
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9694
|
+
var propValue = props[propName];
|
|
9695
|
+
var propType = getPropType(propValue);
|
|
9696
|
+
if (propType !== 'object') {
|
|
9697
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
9698
|
+
}
|
|
9699
|
+
for (var key in shapeTypes) {
|
|
9700
|
+
var checker = shapeTypes[key];
|
|
9701
|
+
if (typeof checker !== 'function') {
|
|
9702
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
9703
|
+
}
|
|
9704
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
9705
|
+
if (error) {
|
|
9706
|
+
return error;
|
|
9707
|
+
}
|
|
9708
|
+
}
|
|
9709
|
+
return null;
|
|
9710
|
+
}
|
|
9711
|
+
return createChainableTypeChecker(validate);
|
|
9712
|
+
}
|
|
9713
|
+
|
|
9714
|
+
function createStrictShapeTypeChecker(shapeTypes) {
|
|
9715
|
+
function validate(props, propName, componentName, location, propFullName) {
|
|
9716
|
+
var propValue = props[propName];
|
|
9717
|
+
var propType = getPropType(propValue);
|
|
9718
|
+
if (propType !== 'object') {
|
|
9719
|
+
return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));
|
|
9720
|
+
}
|
|
9721
|
+
// We need to check all keys in case some are required but missing from props.
|
|
9722
|
+
var allKeys = assign({}, props[propName], shapeTypes);
|
|
9723
|
+
for (var key in allKeys) {
|
|
9724
|
+
var checker = shapeTypes[key];
|
|
9725
|
+
if (has(shapeTypes, key) && typeof checker !== 'function') {
|
|
9726
|
+
return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker));
|
|
9727
|
+
}
|
|
9728
|
+
if (!checker) {
|
|
9729
|
+
return new PropTypeError(
|
|
9730
|
+
'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +
|
|
9731
|
+
'\nBad object: ' + JSON.stringify(props[propName], null, ' ') +
|
|
9732
|
+
'\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')
|
|
9733
|
+
);
|
|
9734
|
+
}
|
|
9735
|
+
var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret$1);
|
|
9736
|
+
if (error) {
|
|
9737
|
+
return error;
|
|
9738
|
+
}
|
|
9739
|
+
}
|
|
9740
|
+
return null;
|
|
9741
|
+
}
|
|
9742
|
+
|
|
9743
|
+
return createChainableTypeChecker(validate);
|
|
9744
|
+
}
|
|
9745
|
+
|
|
9746
|
+
function isNode(propValue) {
|
|
9747
|
+
switch (typeof propValue) {
|
|
9748
|
+
case 'number':
|
|
9749
|
+
case 'string':
|
|
9750
|
+
case 'undefined':
|
|
9751
|
+
return true;
|
|
9752
|
+
case 'boolean':
|
|
9753
|
+
return !propValue;
|
|
9754
|
+
case 'object':
|
|
9755
|
+
if (Array.isArray(propValue)) {
|
|
9756
|
+
return propValue.every(isNode);
|
|
9757
|
+
}
|
|
9758
|
+
if (propValue === null || isValidElement(propValue)) {
|
|
9759
|
+
return true;
|
|
9760
|
+
}
|
|
9761
|
+
|
|
9762
|
+
var iteratorFn = getIteratorFn(propValue);
|
|
9763
|
+
if (iteratorFn) {
|
|
9764
|
+
var iterator = iteratorFn.call(propValue);
|
|
9765
|
+
var step;
|
|
9766
|
+
if (iteratorFn !== propValue.entries) {
|
|
9767
|
+
while (!(step = iterator.next()).done) {
|
|
9768
|
+
if (!isNode(step.value)) {
|
|
9769
|
+
return false;
|
|
9770
|
+
}
|
|
9771
|
+
}
|
|
9772
|
+
} else {
|
|
9773
|
+
// Iterator will provide entry [k,v] tuples rather than values.
|
|
9774
|
+
while (!(step = iterator.next()).done) {
|
|
9775
|
+
var entry = step.value;
|
|
9776
|
+
if (entry) {
|
|
9777
|
+
if (!isNode(entry[1])) {
|
|
9778
|
+
return false;
|
|
9779
|
+
}
|
|
9780
|
+
}
|
|
9781
|
+
}
|
|
9782
|
+
}
|
|
9783
|
+
} else {
|
|
9784
|
+
return false;
|
|
9785
|
+
}
|
|
9786
|
+
|
|
9787
|
+
return true;
|
|
9788
|
+
default:
|
|
9789
|
+
return false;
|
|
9790
|
+
}
|
|
9791
|
+
}
|
|
9792
|
+
|
|
9793
|
+
function isSymbol(propType, propValue) {
|
|
9794
|
+
// Native Symbol.
|
|
9795
|
+
if (propType === 'symbol') {
|
|
9796
|
+
return true;
|
|
9797
|
+
}
|
|
9798
|
+
|
|
9799
|
+
// falsy value can't be a Symbol
|
|
9800
|
+
if (!propValue) {
|
|
9801
|
+
return false;
|
|
9802
|
+
}
|
|
9803
|
+
|
|
9804
|
+
// 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'
|
|
9805
|
+
if (propValue['@@toStringTag'] === 'Symbol') {
|
|
9806
|
+
return true;
|
|
9807
|
+
}
|
|
9808
|
+
|
|
9809
|
+
// Fallback for non-spec compliant Symbols which are polyfilled.
|
|
9810
|
+
if (typeof Symbol === 'function' && propValue instanceof Symbol) {
|
|
9811
|
+
return true;
|
|
9812
|
+
}
|
|
9813
|
+
|
|
9814
|
+
return false;
|
|
9815
|
+
}
|
|
9816
|
+
|
|
9817
|
+
// Equivalent of `typeof` but with special handling for array and regexp.
|
|
9818
|
+
function getPropType(propValue) {
|
|
9819
|
+
var propType = typeof propValue;
|
|
9820
|
+
if (Array.isArray(propValue)) {
|
|
9821
|
+
return 'array';
|
|
9822
|
+
}
|
|
9823
|
+
if (propValue instanceof RegExp) {
|
|
9824
|
+
// Old webkits (at least until Android 4.0) return 'function' rather than
|
|
9825
|
+
// 'object' for typeof a RegExp. We'll normalize this here so that /bla/
|
|
9826
|
+
// passes PropTypes.object.
|
|
9827
|
+
return 'object';
|
|
9828
|
+
}
|
|
9829
|
+
if (isSymbol(propType, propValue)) {
|
|
9830
|
+
return 'symbol';
|
|
9831
|
+
}
|
|
9832
|
+
return propType;
|
|
9833
|
+
}
|
|
9834
|
+
|
|
9835
|
+
// This handles more types than `getPropType`. Only used for error messages.
|
|
9836
|
+
// See `createPrimitiveTypeChecker`.
|
|
9837
|
+
function getPreciseType(propValue) {
|
|
9838
|
+
if (typeof propValue === 'undefined' || propValue === null) {
|
|
9839
|
+
return '' + propValue;
|
|
9840
|
+
}
|
|
9841
|
+
var propType = getPropType(propValue);
|
|
9842
|
+
if (propType === 'object') {
|
|
9843
|
+
if (propValue instanceof Date) {
|
|
9844
|
+
return 'date';
|
|
9845
|
+
} else if (propValue instanceof RegExp) {
|
|
9846
|
+
return 'regexp';
|
|
9847
|
+
}
|
|
9848
|
+
}
|
|
9849
|
+
return propType;
|
|
9850
|
+
}
|
|
9851
|
+
|
|
9852
|
+
// Returns a string that is postfixed to a warning about an invalid type.
|
|
9853
|
+
// For example, "undefined" or "of type array"
|
|
9854
|
+
function getPostfixForTypeWarning(value) {
|
|
9855
|
+
var type = getPreciseType(value);
|
|
9856
|
+
switch (type) {
|
|
9857
|
+
case 'array':
|
|
9858
|
+
case 'object':
|
|
9859
|
+
return 'an ' + type;
|
|
9860
|
+
case 'boolean':
|
|
9861
|
+
case 'date':
|
|
9862
|
+
case 'regexp':
|
|
9863
|
+
return 'a ' + type;
|
|
9864
|
+
default:
|
|
9865
|
+
return type;
|
|
9866
|
+
}
|
|
9867
|
+
}
|
|
9868
|
+
|
|
9869
|
+
// Returns class name of the object, if any.
|
|
9870
|
+
function getClassName(propValue) {
|
|
9871
|
+
if (!propValue.constructor || !propValue.constructor.name) {
|
|
9872
|
+
return ANONYMOUS;
|
|
9873
|
+
}
|
|
9874
|
+
return propValue.constructor.name;
|
|
9875
|
+
}
|
|
9876
|
+
|
|
9877
|
+
ReactPropTypes.checkPropTypes = checkPropTypes;
|
|
9878
|
+
ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache;
|
|
9879
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
9880
|
+
|
|
9881
|
+
return ReactPropTypes;
|
|
9882
|
+
};
|
|
9883
|
+
|
|
9884
|
+
/**
|
|
9885
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9886
|
+
*
|
|
9887
|
+
* This source code is licensed under the MIT license found in the
|
|
9888
|
+
* LICENSE file in the root directory of this source tree.
|
|
9889
|
+
*/
|
|
9890
|
+
|
|
9891
|
+
var ReactPropTypesSecret = ReactPropTypesSecret_1;
|
|
9892
|
+
|
|
9893
|
+
function emptyFunction() {}
|
|
9894
|
+
function emptyFunctionWithReset() {}
|
|
9895
|
+
emptyFunctionWithReset.resetWarningCache = emptyFunction;
|
|
9896
|
+
|
|
9897
|
+
var factoryWithThrowingShims = function() {
|
|
9898
|
+
function shim(props, propName, componentName, location, propFullName, secret) {
|
|
9899
|
+
if (secret === ReactPropTypesSecret) {
|
|
9900
|
+
// It is still safe when called from React.
|
|
9901
|
+
return;
|
|
9902
|
+
}
|
|
9903
|
+
var err = new Error(
|
|
9904
|
+
'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +
|
|
9905
|
+
'Use PropTypes.checkPropTypes() to call them. ' +
|
|
9906
|
+
'Read more at http://fb.me/use-check-prop-types'
|
|
9907
|
+
);
|
|
9908
|
+
err.name = 'Invariant Violation';
|
|
9909
|
+
throw err;
|
|
9910
|
+
} shim.isRequired = shim;
|
|
9911
|
+
function getShim() {
|
|
9912
|
+
return shim;
|
|
9913
|
+
} // Important!
|
|
9914
|
+
// Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.
|
|
9915
|
+
var ReactPropTypes = {
|
|
9916
|
+
array: shim,
|
|
9917
|
+
bigint: shim,
|
|
9918
|
+
bool: shim,
|
|
9919
|
+
func: shim,
|
|
9920
|
+
number: shim,
|
|
9921
|
+
object: shim,
|
|
9922
|
+
string: shim,
|
|
9923
|
+
symbol: shim,
|
|
9924
|
+
|
|
9925
|
+
any: shim,
|
|
9926
|
+
arrayOf: getShim,
|
|
9927
|
+
element: shim,
|
|
9928
|
+
elementType: shim,
|
|
9929
|
+
instanceOf: getShim,
|
|
9930
|
+
node: shim,
|
|
9931
|
+
objectOf: getShim,
|
|
9932
|
+
oneOf: getShim,
|
|
9933
|
+
oneOfType: getShim,
|
|
9934
|
+
shape: getShim,
|
|
9935
|
+
exact: getShim,
|
|
9936
|
+
|
|
9937
|
+
checkPropTypes: emptyFunctionWithReset,
|
|
9938
|
+
resetWarningCache: emptyFunction
|
|
9939
|
+
};
|
|
9940
|
+
|
|
9941
|
+
ReactPropTypes.PropTypes = ReactPropTypes;
|
|
9942
|
+
|
|
9943
|
+
return ReactPropTypes;
|
|
9944
|
+
};
|
|
9945
|
+
|
|
9946
|
+
/**
|
|
9947
|
+
* Copyright (c) 2013-present, Facebook, Inc.
|
|
9948
|
+
*
|
|
9949
|
+
* This source code is licensed under the MIT license found in the
|
|
9950
|
+
* LICENSE file in the root directory of this source tree.
|
|
9951
|
+
*/
|
|
9952
|
+
|
|
9953
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
9954
|
+
var ReactIs = reactIs.exports;
|
|
9955
|
+
|
|
9956
|
+
// By explicitly using `prop-types` you are opting into new development behavior.
|
|
9957
|
+
// http://fb.me/prop-types-in-prod
|
|
9958
|
+
var throwOnDirectAccess = true;
|
|
9959
|
+
propTypes.exports = factoryWithTypeCheckers(ReactIs.isElement, throwOnDirectAccess);
|
|
9960
|
+
} else {
|
|
9961
|
+
// By explicitly using `prop-types` you are opting into new production behavior.
|
|
9962
|
+
// http://fb.me/prop-types-in-prod
|
|
9963
|
+
propTypes.exports = factoryWithThrowingShims();
|
|
9964
|
+
}
|
|
9965
|
+
|
|
9966
|
+
var PropTypes = propTypes.exports;
|
|
9967
|
+
|
|
9968
|
+
function _extends$1() { _extends$1 = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends$1.apply(this, arguments); }
|
|
9969
|
+
|
|
9970
|
+
var Image$1 = function Image(_ref) {
|
|
9971
|
+
var src = _ref.src,
|
|
9972
|
+
sources = _ref.sources,
|
|
9973
|
+
width = _ref.width,
|
|
9974
|
+
height = _ref.height,
|
|
9975
|
+
hasSpacer = _ref.hasSpacer,
|
|
9976
|
+
imgAttributes = _ref.imgAttributes,
|
|
9977
|
+
isZoomed = _ref.isZoomed,
|
|
9978
|
+
fadeDuration = _ref.fadeDuration;
|
|
9979
|
+
var createSpacer = width && height && hasSpacer;
|
|
9980
|
+
return /*#__PURE__*/React__default.createElement("div", {
|
|
9981
|
+
style: {
|
|
9982
|
+
paddingTop: createSpacer ? height / width * 100 + "%" : null
|
|
9983
|
+
}
|
|
9984
|
+
}, sources && sources.length > 0 ? /*#__PURE__*/React__default.createElement("picture", null, sources.map(function (source, i) {
|
|
9985
|
+
return /*#__PURE__*/React__default.createElement(Fragment$2, {
|
|
9986
|
+
key: i
|
|
9987
|
+
}, source.srcSet && /*#__PURE__*/React__default.createElement("source", source));
|
|
9988
|
+
}), /*#__PURE__*/React__default.createElement("img", _extends$1({}, imgAttributes, {
|
|
9989
|
+
className: "iiz__img " + (imgAttributes.className || '') + " " + (isZoomed ? 'iiz__img--hidden' : '') + " " + (createSpacer ? 'iiz__img--abs' : ''),
|
|
9990
|
+
style: {
|
|
9991
|
+
transition: "linear 0ms opacity " + (isZoomed ? fadeDuration : 0) + "ms, linear " + fadeDuration + "ms visibility " + (isZoomed ? fadeDuration : 0) + "ms"
|
|
9992
|
+
},
|
|
9993
|
+
src: src,
|
|
9994
|
+
width: width,
|
|
9995
|
+
height: height
|
|
9996
|
+
}))) : /*#__PURE__*/React__default.createElement("img", _extends$1({}, imgAttributes, {
|
|
9997
|
+
className: "iiz__img " + (imgAttributes.className || '') + " " + (isZoomed ? 'iiz__img--hidden' : '') + " " + (createSpacer ? 'iiz__img--abs' : ''),
|
|
9998
|
+
style: {
|
|
9999
|
+
transition: "linear 0ms opacity " + (isZoomed ? fadeDuration : 0) + "ms, linear " + fadeDuration + "ms visibility " + (isZoomed ? fadeDuration : 0) + "ms"
|
|
10000
|
+
},
|
|
10001
|
+
src: src,
|
|
10002
|
+
width: width,
|
|
10003
|
+
height: height
|
|
10004
|
+
})));
|
|
10005
|
+
};
|
|
10006
|
+
|
|
10007
|
+
Image$1.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
10008
|
+
src: PropTypes.string.isRequired,
|
|
10009
|
+
sources: PropTypes.array,
|
|
10010
|
+
width: PropTypes.number,
|
|
10011
|
+
height: PropTypes.number,
|
|
10012
|
+
hasSpacer: PropTypes.bool,
|
|
10013
|
+
imgAttributes: PropTypes.object,
|
|
10014
|
+
fadeDuration: PropTypes.number,
|
|
10015
|
+
isZoomed: PropTypes.bool
|
|
10016
|
+
} : {};
|
|
10017
|
+
|
|
10018
|
+
var ZoomImage = function ZoomImage(_ref) {
|
|
10019
|
+
var src = _ref.src,
|
|
10020
|
+
fadeDuration = _ref.fadeDuration,
|
|
10021
|
+
top = _ref.top,
|
|
10022
|
+
left = _ref.left,
|
|
10023
|
+
isZoomed = _ref.isZoomed,
|
|
10024
|
+
onLoad = _ref.onLoad,
|
|
10025
|
+
onDragStart = _ref.onDragStart,
|
|
10026
|
+
onDragEnd = _ref.onDragEnd,
|
|
10027
|
+
onClose = _ref.onClose,
|
|
10028
|
+
onFadeOut = _ref.onFadeOut;
|
|
10029
|
+
return /*#__PURE__*/React__default.createElement(Fragment$2, null, /*#__PURE__*/React__default.createElement("img", {
|
|
10030
|
+
className: "iiz__zoom-img " + (isZoomed ? 'iiz__zoom-img--visible' : ''),
|
|
10031
|
+
style: {
|
|
10032
|
+
top: top,
|
|
10033
|
+
left: left,
|
|
10034
|
+
transition: "linear " + fadeDuration + "ms opacity, linear " + fadeDuration + "ms visibility"
|
|
10035
|
+
},
|
|
10036
|
+
src: src,
|
|
10037
|
+
onLoad: onLoad,
|
|
10038
|
+
onTouchStart: onDragStart,
|
|
10039
|
+
onTouchEnd: onDragEnd,
|
|
10040
|
+
onMouseDown: onDragStart,
|
|
10041
|
+
onMouseUp: onDragEnd,
|
|
10042
|
+
onTransitionEnd: onFadeOut,
|
|
10043
|
+
draggable: "false",
|
|
10044
|
+
alt: ""
|
|
10045
|
+
}), onClose && /*#__PURE__*/React__default.createElement("button", {
|
|
10046
|
+
className: "iiz__btn iiz__close " + (isZoomed ? 'iiz__close--visible' : ''),
|
|
10047
|
+
style: {
|
|
10048
|
+
transition: "linear " + fadeDuration + "ms opacity, linear " + fadeDuration + "ms visibility"
|
|
10049
|
+
},
|
|
10050
|
+
onClick: onClose,
|
|
10051
|
+
"aria-label": "Zoom Out"
|
|
10052
|
+
}));
|
|
10053
|
+
};
|
|
10054
|
+
|
|
10055
|
+
ZoomImage.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
10056
|
+
src: PropTypes.string,
|
|
10057
|
+
fadeDuration: PropTypes.number,
|
|
10058
|
+
top: PropTypes.number,
|
|
10059
|
+
left: PropTypes.number,
|
|
10060
|
+
isZoomed: PropTypes.bool,
|
|
10061
|
+
onLoad: PropTypes.func,
|
|
10062
|
+
onDragStart: PropTypes.func,
|
|
10063
|
+
onDragEnd: PropTypes.func,
|
|
10064
|
+
onClose: PropTypes.func,
|
|
10065
|
+
onFadeOut: PropTypes.func
|
|
10066
|
+
} : {};
|
|
10067
|
+
|
|
10068
|
+
var FullscreenPortal = function FullscreenPortal(_ref) {
|
|
10069
|
+
var children = _ref.children;
|
|
10070
|
+
|
|
10071
|
+
var _useState = useState(function () {
|
|
10072
|
+
var el = document.createElement('div');
|
|
10073
|
+
el.classList.add('iiz__zoom-portal');
|
|
10074
|
+
return el;
|
|
10075
|
+
}),
|
|
10076
|
+
portal = _useState[0];
|
|
10077
|
+
|
|
10078
|
+
useEffect(function () {
|
|
10079
|
+
document.body.appendChild(portal);
|
|
10080
|
+
return function () {
|
|
10081
|
+
return document.body.removeChild(portal);
|
|
10082
|
+
};
|
|
10083
|
+
}, [portal]);
|
|
10084
|
+
return createPortal(children, portal);
|
|
10085
|
+
};
|
|
10086
|
+
|
|
10087
|
+
FullscreenPortal.propTypes = {
|
|
10088
|
+
children: PropTypes.element
|
|
10089
|
+
};
|
|
10090
|
+
|
|
10091
|
+
var _this = undefined;
|
|
10092
|
+
|
|
10093
|
+
var InnerImageZoom = function InnerImageZoom(_ref) {
|
|
10094
|
+
var _ref$moveType = _ref.moveType,
|
|
10095
|
+
moveType = _ref$moveType === void 0 ? 'pan' : _ref$moveType,
|
|
10096
|
+
_ref$zoomType = _ref.zoomType,
|
|
10097
|
+
zoomType = _ref$zoomType === void 0 ? 'click' : _ref$zoomType,
|
|
10098
|
+
src = _ref.src,
|
|
10099
|
+
sources = _ref.sources,
|
|
10100
|
+
width = _ref.width,
|
|
10101
|
+
height = _ref.height,
|
|
10102
|
+
hasSpacer = _ref.hasSpacer,
|
|
10103
|
+
_ref$imgAttributes = _ref.imgAttributes,
|
|
10104
|
+
imgAttributes = _ref$imgAttributes === void 0 ? {} : _ref$imgAttributes,
|
|
10105
|
+
zoomSrc = _ref.zoomSrc,
|
|
10106
|
+
_ref$zoomScale = _ref.zoomScale,
|
|
10107
|
+
zoomScale = _ref$zoomScale === void 0 ? 1 : _ref$zoomScale,
|
|
10108
|
+
zoomPreload = _ref.zoomPreload,
|
|
10109
|
+
_ref$fadeDuration = _ref.fadeDuration,
|
|
10110
|
+
fadeDuration = _ref$fadeDuration === void 0 ? 150 : _ref$fadeDuration,
|
|
10111
|
+
fullscreenOnMobile = _ref.fullscreenOnMobile,
|
|
10112
|
+
_ref$mobileBreakpoint = _ref.mobileBreakpoint,
|
|
10113
|
+
mobileBreakpoint = _ref$mobileBreakpoint === void 0 ? 640 : _ref$mobileBreakpoint,
|
|
10114
|
+
hideCloseButton = _ref.hideCloseButton,
|
|
10115
|
+
hideHint = _ref.hideHint,
|
|
10116
|
+
className = _ref.className,
|
|
10117
|
+
afterZoomIn = _ref.afterZoomIn,
|
|
10118
|
+
afterZoomOut = _ref.afterZoomOut;
|
|
10119
|
+
var img = useRef(null);
|
|
10120
|
+
var zoomImg = useRef(null);
|
|
10121
|
+
var imgProps = useRef({});
|
|
10122
|
+
|
|
10123
|
+
var _useState = useState(zoomPreload),
|
|
10124
|
+
isActive = _useState[0],
|
|
10125
|
+
setIsActive = _useState[1];
|
|
10126
|
+
|
|
10127
|
+
var _useState2 = useState(false),
|
|
10128
|
+
isTouch = _useState2[0],
|
|
10129
|
+
setIsTouch = _useState2[1];
|
|
10130
|
+
|
|
10131
|
+
var _useState3 = useState(false),
|
|
10132
|
+
isZoomed = _useState3[0],
|
|
10133
|
+
setIsZoomed = _useState3[1];
|
|
10134
|
+
|
|
10135
|
+
var _useState4 = useState(false),
|
|
10136
|
+
isFullscreen = _useState4[0],
|
|
10137
|
+
setIsFullscreen = _useState4[1];
|
|
10138
|
+
|
|
10139
|
+
var _useState5 = useState(false),
|
|
10140
|
+
isDragging = _useState5[0],
|
|
10141
|
+
setIsDragging = _useState5[1];
|
|
10142
|
+
|
|
10143
|
+
var _useState6 = useState(false),
|
|
10144
|
+
isValidDrag = _useState6[0],
|
|
10145
|
+
setIsValidDrag = _useState6[1];
|
|
10146
|
+
|
|
10147
|
+
var _useState7 = useState(false),
|
|
10148
|
+
isFading = _useState7[0],
|
|
10149
|
+
setIsFading = _useState7[1];
|
|
10150
|
+
|
|
10151
|
+
var _useState8 = useState(moveType),
|
|
10152
|
+
currentMoveType = _useState8[0],
|
|
10153
|
+
setCurrentMoveType = _useState8[1];
|
|
10154
|
+
|
|
10155
|
+
var _useState9 = useState(0),
|
|
10156
|
+
left = _useState9[0],
|
|
10157
|
+
setLeft = _useState9[1];
|
|
10158
|
+
|
|
10159
|
+
var _useState10 = useState(0),
|
|
10160
|
+
top = _useState10[0],
|
|
10161
|
+
setTop = _useState10[1];
|
|
10162
|
+
|
|
10163
|
+
var handleMouseEnter = function handleMouseEnter(e) {
|
|
10164
|
+
setIsActive(true);
|
|
10165
|
+
zoomType === 'hover' && !isZoomed && handleClick(e);
|
|
10166
|
+
};
|
|
10167
|
+
|
|
10168
|
+
var handleTouchStart = function handleTouchStart() {
|
|
10169
|
+
setIsTouch(true);
|
|
10170
|
+
setIsFullscreen(getFullscreenStatus(fullscreenOnMobile, mobileBreakpoint));
|
|
10171
|
+
setCurrentMoveType('drag');
|
|
10172
|
+
};
|
|
10173
|
+
|
|
10174
|
+
var handleClick = function handleClick(e) {
|
|
10175
|
+
if (isZoomed) {
|
|
10176
|
+
if (isTouch) {
|
|
10177
|
+
hideCloseButton && handleClose();
|
|
10178
|
+
} else {
|
|
10179
|
+
!isValidDrag && zoomOut();
|
|
10180
|
+
}
|
|
10181
|
+
|
|
10182
|
+
return;
|
|
10183
|
+
}
|
|
10184
|
+
|
|
10185
|
+
isTouch && setIsActive(true);
|
|
10186
|
+
|
|
10187
|
+
if (zoomImg.current) {
|
|
10188
|
+
handleLoad({
|
|
10189
|
+
target: zoomImg.current
|
|
10190
|
+
});
|
|
10191
|
+
zoomIn(e.pageX, e.pageY);
|
|
10192
|
+
} else {
|
|
10193
|
+
imgProps.current.onLoadCallback = zoomIn.bind(_this, e.pageX, e.pageY);
|
|
10194
|
+
}
|
|
10195
|
+
};
|
|
10196
|
+
|
|
10197
|
+
var handleLoad = function handleLoad(e) {
|
|
10198
|
+
var scaledDimensions = getScaledDimensions(e.target, zoomScale);
|
|
10199
|
+
zoomImg.current = e.target;
|
|
10200
|
+
zoomImg.current.setAttribute('width', scaledDimensions.width);
|
|
10201
|
+
zoomImg.current.setAttribute('height', scaledDimensions.height);
|
|
10202
|
+
imgProps.current.scaledDimensions = scaledDimensions;
|
|
10203
|
+
imgProps.current.bounds = getBounds(img.current, false);
|
|
10204
|
+
imgProps.current.ratios = getRatios(imgProps.current.bounds, scaledDimensions);
|
|
10205
|
+
|
|
10206
|
+
if (imgProps.current.onLoadCallback) {
|
|
10207
|
+
imgProps.current.onLoadCallback();
|
|
10208
|
+
imgProps.current.onLoadCallback = null;
|
|
10209
|
+
}
|
|
10210
|
+
};
|
|
10211
|
+
|
|
10212
|
+
var handleMouseMove = function handleMouseMove(e) {
|
|
10213
|
+
var left = e.pageX - imgProps.current.offsets.x;
|
|
10214
|
+
var top = e.pageY - imgProps.current.offsets.y;
|
|
10215
|
+
left = Math.max(Math.min(left, imgProps.current.bounds.width), 0);
|
|
10216
|
+
top = Math.max(Math.min(top, imgProps.current.bounds.height), 0);
|
|
10217
|
+
setLeft(left * -imgProps.current.ratios.x);
|
|
10218
|
+
setTop(top * -imgProps.current.ratios.y);
|
|
10219
|
+
};
|
|
10220
|
+
|
|
10221
|
+
var handleDragStart = function handleDragStart(e) {
|
|
10222
|
+
imgProps.current.offsets = getOffsets(e.pageX || e.changedTouches[0].pageX, e.pageY || e.changedTouches[0].pageY, zoomImg.current.offsetLeft, zoomImg.current.offsetTop);
|
|
10223
|
+
setIsDragging(true);
|
|
10224
|
+
|
|
10225
|
+
if (!isTouch) {
|
|
10226
|
+
imgProps.current.eventPosition = {
|
|
10227
|
+
x: e.pageX,
|
|
10228
|
+
y: e.pageY
|
|
10229
|
+
};
|
|
10230
|
+
}
|
|
10231
|
+
};
|
|
10232
|
+
|
|
10233
|
+
var handleDragMove = useCallback(function (e) {
|
|
10234
|
+
e.stopPropagation();
|
|
10235
|
+
var left = (e.pageX || e.changedTouches[0].pageX) - imgProps.current.offsets.x;
|
|
10236
|
+
var top = (e.pageY || e.changedTouches[0].pageY) - imgProps.current.offsets.y;
|
|
10237
|
+
left = Math.max(Math.min(left, 0), (imgProps.current.scaledDimensions.width - imgProps.current.bounds.width) * -1);
|
|
10238
|
+
top = Math.max(Math.min(top, 0), (imgProps.current.scaledDimensions.height - imgProps.current.bounds.height) * -1);
|
|
10239
|
+
setLeft(left);
|
|
10240
|
+
setTop(top);
|
|
10241
|
+
}, []);
|
|
10242
|
+
|
|
10243
|
+
var handleDragEnd = function handleDragEnd(e) {
|
|
10244
|
+
setIsDragging(false);
|
|
10245
|
+
|
|
10246
|
+
if (!isTouch) {
|
|
10247
|
+
var moveX = Math.abs(e.pageX - imgProps.current.eventPosition.x);
|
|
10248
|
+
var moveY = Math.abs(e.pageY - imgProps.current.eventPosition.y);
|
|
10249
|
+
setIsValidDrag(moveX > 5 || moveY > 5);
|
|
10250
|
+
}
|
|
10251
|
+
};
|
|
10252
|
+
|
|
10253
|
+
var handleMouseLeave = function handleMouseLeave(e) {
|
|
10254
|
+
currentMoveType === 'drag' && isZoomed ? handleDragEnd(e) : handleClose();
|
|
10255
|
+
};
|
|
10256
|
+
|
|
10257
|
+
var handleClose = function handleClose() {
|
|
10258
|
+
if (!isZoomed || isFullscreen || !fadeDuration) {
|
|
10259
|
+
handleFadeOut({}, true);
|
|
10260
|
+
} else {
|
|
10261
|
+
setIsFading(true);
|
|
10262
|
+
}
|
|
10263
|
+
|
|
10264
|
+
zoomOut();
|
|
10265
|
+
};
|
|
10266
|
+
|
|
10267
|
+
var handleFadeOut = function handleFadeOut(e, noTransition) {
|
|
10268
|
+
if (noTransition || e.propertyName === 'opacity' && img.current.contains(e.target)) {
|
|
10269
|
+
if (zoomPreload && isTouch || !zoomPreload) {
|
|
10270
|
+
zoomImg.current = null;
|
|
10271
|
+
imgProps.current = getDefaults();
|
|
10272
|
+
setIsActive(false);
|
|
10273
|
+
}
|
|
10274
|
+
|
|
10275
|
+
setIsTouch(false);
|
|
10276
|
+
setIsFullscreen(false);
|
|
10277
|
+
setCurrentMoveType(moveType);
|
|
10278
|
+
setIsFading(false);
|
|
10279
|
+
}
|
|
10280
|
+
};
|
|
10281
|
+
|
|
10282
|
+
var initialMove = function initialMove(pageX, pageY) {
|
|
10283
|
+
imgProps.current.offsets = getOffsets(window.pageXOffset, window.pageYOffset, -imgProps.current.bounds.left, -imgProps.current.bounds.top);
|
|
10284
|
+
handleMouseMove({
|
|
10285
|
+
pageX: pageX,
|
|
10286
|
+
pageY: pageY
|
|
10287
|
+
});
|
|
10288
|
+
};
|
|
10289
|
+
|
|
10290
|
+
var initialDrag = function initialDrag(pageX, pageY) {
|
|
10291
|
+
var initialPageX = (pageX - (window.pageXOffset + imgProps.current.bounds.left)) * -imgProps.current.ratios.x;
|
|
10292
|
+
var initialPageY = (pageY - (window.pageYOffset + imgProps.current.bounds.top)) * -imgProps.current.ratios.y;
|
|
10293
|
+
initialPageX = initialPageX + (isFullscreen ? (window.innerWidth - imgProps.current.bounds.width) / 2 : 0);
|
|
10294
|
+
initialPageY = initialPageY + (isFullscreen ? (window.innerHeight - imgProps.current.bounds.height) / 2 : 0);
|
|
10295
|
+
imgProps.current.bounds = getBounds(img.current, isFullscreen);
|
|
10296
|
+
imgProps.current.offsets = getOffsets(0, 0, 0, 0);
|
|
10297
|
+
handleDragMove({
|
|
10298
|
+
changedTouches: [{
|
|
10299
|
+
pageX: initialPageX,
|
|
10300
|
+
pageY: initialPageY
|
|
10301
|
+
}],
|
|
10302
|
+
preventDefault: function preventDefault() {},
|
|
10303
|
+
stopPropagation: function stopPropagation() {}
|
|
10304
|
+
});
|
|
10305
|
+
};
|
|
10306
|
+
|
|
10307
|
+
var zoomIn = function zoomIn(pageX, pageY) {
|
|
10308
|
+
setIsZoomed(true);
|
|
10309
|
+
currentMoveType === 'drag' ? initialDrag(pageX, pageY) : initialMove(pageX, pageY);
|
|
10310
|
+
afterZoomIn && afterZoomIn();
|
|
10311
|
+
};
|
|
10312
|
+
|
|
10313
|
+
var zoomOut = function zoomOut() {
|
|
10314
|
+
setIsZoomed(false);
|
|
10315
|
+
afterZoomOut && afterZoomOut();
|
|
10316
|
+
};
|
|
10317
|
+
|
|
10318
|
+
var getDefaults = function getDefaults() {
|
|
10319
|
+
return {
|
|
10320
|
+
onLoadCallback: null,
|
|
10321
|
+
bounds: {},
|
|
10322
|
+
offsets: {},
|
|
10323
|
+
ratios: {},
|
|
10324
|
+
eventPosition: {},
|
|
10325
|
+
scaledDimensions: {}
|
|
10326
|
+
};
|
|
10327
|
+
};
|
|
10328
|
+
|
|
10329
|
+
var getBounds = function getBounds(img, isFullscreen) {
|
|
10330
|
+
if (isFullscreen) {
|
|
10331
|
+
return {
|
|
10332
|
+
width: window.innerWidth,
|
|
10333
|
+
height: window.innerHeight,
|
|
10334
|
+
left: 0,
|
|
10335
|
+
top: 0
|
|
10336
|
+
};
|
|
10337
|
+
}
|
|
10338
|
+
|
|
10339
|
+
return img.getBoundingClientRect();
|
|
10340
|
+
};
|
|
10341
|
+
|
|
10342
|
+
var getOffsets = function getOffsets(pageX, pageY, left, top) {
|
|
10343
|
+
return {
|
|
10344
|
+
x: pageX - left,
|
|
10345
|
+
y: pageY - top
|
|
10346
|
+
};
|
|
10347
|
+
};
|
|
10348
|
+
|
|
10349
|
+
var getRatios = function getRatios(bounds, dimensions) {
|
|
10350
|
+
return {
|
|
10351
|
+
x: (dimensions.width - bounds.width) / bounds.width,
|
|
10352
|
+
y: (dimensions.height - bounds.height) / bounds.height
|
|
10353
|
+
};
|
|
10354
|
+
};
|
|
10355
|
+
|
|
10356
|
+
var getFullscreenStatus = function getFullscreenStatus(fullscreenOnMobile, mobileBreakpoint) {
|
|
10357
|
+
return fullscreenOnMobile && window.matchMedia && window.matchMedia("(max-width: " + mobileBreakpoint + "px)").matches;
|
|
10358
|
+
};
|
|
10359
|
+
|
|
10360
|
+
var getScaledDimensions = function getScaledDimensions(zoomImg, zoomScale) {
|
|
10361
|
+
return {
|
|
10362
|
+
width: zoomImg.naturalWidth * zoomScale,
|
|
10363
|
+
height: zoomImg.naturalHeight * zoomScale
|
|
10364
|
+
};
|
|
10365
|
+
};
|
|
10366
|
+
|
|
10367
|
+
var zoomImageProps = {
|
|
10368
|
+
src: zoomSrc || src,
|
|
10369
|
+
fadeDuration: isFullscreen ? 0 : fadeDuration,
|
|
10370
|
+
top: top,
|
|
10371
|
+
left: left,
|
|
10372
|
+
isZoomed: isZoomed,
|
|
10373
|
+
onLoad: handleLoad,
|
|
10374
|
+
onDragStart: currentMoveType === 'drag' ? handleDragStart : null,
|
|
10375
|
+
onDragEnd: currentMoveType === 'drag' ? handleDragEnd : null,
|
|
10376
|
+
onClose: !hideCloseButton && currentMoveType === 'drag' ? handleClose : null,
|
|
10377
|
+
onFadeOut: isFading ? handleFadeOut : null
|
|
10378
|
+
};
|
|
10379
|
+
useEffect(function () {
|
|
10380
|
+
imgProps.current = getDefaults();
|
|
10381
|
+
}, []);
|
|
10382
|
+
useEffect(function () {
|
|
10383
|
+
getFullscreenStatus(fullscreenOnMobile, mobileBreakpoint) && setIsActive(false);
|
|
10384
|
+
}, [fullscreenOnMobile, mobileBreakpoint]);
|
|
10385
|
+
useEffect(function () {
|
|
10386
|
+
if (!zoomImg.current) {
|
|
10387
|
+
return;
|
|
10388
|
+
}
|
|
10389
|
+
|
|
10390
|
+
var eventType = isTouch ? 'touchmove' : 'mousemove';
|
|
10391
|
+
|
|
10392
|
+
if (isDragging) {
|
|
10393
|
+
zoomImg.current.addEventListener(eventType, handleDragMove, {
|
|
10394
|
+
passive: true
|
|
10395
|
+
});
|
|
10396
|
+
} else {
|
|
10397
|
+
zoomImg.current.removeEventListener(eventType, handleDragMove);
|
|
10398
|
+
}
|
|
10399
|
+
}, [isDragging, isTouch, handleDragMove]);
|
|
10400
|
+
return /*#__PURE__*/React__default.createElement("figure", {
|
|
10401
|
+
className: "iiz " + (currentMoveType === 'drag' ? 'iiz--drag' : '') + " " + (className ? className : ''),
|
|
10402
|
+
style: {
|
|
10403
|
+
width: width
|
|
10404
|
+
},
|
|
10405
|
+
ref: img,
|
|
10406
|
+
onTouchStart: isZoomed ? null : handleTouchStart,
|
|
10407
|
+
onClick: handleClick,
|
|
10408
|
+
onMouseEnter: isTouch ? null : handleMouseEnter,
|
|
10409
|
+
onMouseMove: currentMoveType === 'drag' || !isZoomed ? null : handleMouseMove,
|
|
10410
|
+
onMouseLeave: isTouch ? null : handleMouseLeave
|
|
10411
|
+
}, /*#__PURE__*/React__default.createElement(Image$1, {
|
|
10412
|
+
src: src,
|
|
10413
|
+
sources: sources,
|
|
10414
|
+
width: width,
|
|
10415
|
+
height: height,
|
|
10416
|
+
hasSpacer: hasSpacer,
|
|
10417
|
+
imgAttributes: imgAttributes,
|
|
10418
|
+
fadeDuration: fadeDuration,
|
|
10419
|
+
isZoomed: isZoomed
|
|
10420
|
+
}), isActive && /*#__PURE__*/React__default.createElement(Fragment$2, null, isFullscreen ? /*#__PURE__*/React__default.createElement(FullscreenPortal, null, /*#__PURE__*/React__default.createElement(ZoomImage, zoomImageProps)) : /*#__PURE__*/React__default.createElement(ZoomImage, zoomImageProps)), !hideHint && !isZoomed && /*#__PURE__*/React__default.createElement("span", {
|
|
10421
|
+
className: "iiz__btn iiz__hint"
|
|
10422
|
+
}));
|
|
10423
|
+
};
|
|
10424
|
+
|
|
10425
|
+
InnerImageZoom.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
10426
|
+
moveType: PropTypes.string,
|
|
10427
|
+
zoomType: PropTypes.string,
|
|
10428
|
+
src: PropTypes.string.isRequired,
|
|
10429
|
+
sources: PropTypes.array,
|
|
10430
|
+
width: PropTypes.number,
|
|
10431
|
+
height: PropTypes.number,
|
|
10432
|
+
hasSpacer: PropTypes.bool,
|
|
10433
|
+
imgAttributes: PropTypes.object,
|
|
10434
|
+
zoomSrc: PropTypes.string,
|
|
10435
|
+
zoomScale: PropTypes.number,
|
|
10436
|
+
zoomPreload: PropTypes.bool,
|
|
10437
|
+
fadeDuration: PropTypes.number,
|
|
10438
|
+
fullscreenOnMobile: PropTypes.bool,
|
|
10439
|
+
mobileBreakpoint: PropTypes.number,
|
|
10440
|
+
hideCloseButton: PropTypes.bool,
|
|
10441
|
+
hideHint: PropTypes.bool,
|
|
10442
|
+
className: PropTypes.string,
|
|
10443
|
+
afterZoomIn: PropTypes.func,
|
|
10444
|
+
afterZoomOut: PropTypes.func
|
|
10445
|
+
} : {};
|
|
10446
|
+
|
|
10447
|
+
var Container$A = newStyled.div(templateObject_1$V || (templateObject_1$V = __makeTemplateObject(["\n position: relative;\n height: '45rem' &.styleforhorizontal {\n height: '30rem';\n }\n"], ["\n position: relative;\n height: '45rem' &.styleforhorizontal {\n height: '30rem';\n }\n"])));
|
|
10448
|
+
var TopTagContainer$2 = newStyled.div(templateObject_2$A || (templateObject_2$A = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n"])));
|
|
10449
|
+
var BottomTagContainer$2 = newStyled.div(templateObject_3$p || (templateObject_3$p = __makeTemplateObject(["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"], ["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"])));
|
|
10450
|
+
var ImageProductWithTags$1 = function (_a) {
|
|
10451
|
+
var image = _a.image, topTag = _a.topTag, bottomTag = _a.bottomTag, testId = _a.testId, position = _a.position;
|
|
10452
|
+
return (jsxs$1(Container$A, __assign$1({ "data-testid": testId, className: "stylefor".concat(position) }, { children: [jsx$1(InnerImageZoom, { src: image.imageUrl, zoomSrc: image.imageUrl, zoomType: "hover", imgAttributes: {
|
|
10453
|
+
alt: image.alt,
|
|
10454
|
+
style: { objectFit: 'cover', objectPosition: 'center' },
|
|
10455
|
+
}, width: position == 'horizontal' ? 360 : 530, height: position == 'horizontal' ? 480 : 720, hideHint: true }, void 0), jsx$1(TopTagContainer$2, { children: topTag }, void 0), jsx$1(BottomTagContainer$2, { children: bottomTag }, void 0)] }), void 0));
|
|
10456
|
+
};
|
|
10457
|
+
var templateObject_1$V, templateObject_2$A, templateObject_3$p;
|
|
10458
|
+
|
|
10459
|
+
var Container$z = newStyled.div(templateObject_1$U || (templateObject_1$U = __makeTemplateObject(["\n display: grid;\n grid-template-columns: auto auto;\n grid-column-gap: 20px;\n max-height: 45rem;\n width: fit-content;\n"], ["\n display: grid;\n grid-template-columns: auto auto;\n grid-column-gap: 20px;\n max-height: 45rem;\n width: fit-content;\n"])));
|
|
10460
|
+
var ProductGallery = function (_a) {
|
|
10461
|
+
var images = _a.images, selectedValue = _a.selectedValue, topTag = _a.topTag, bottomTag = _a.bottomTag, productImageDataTestId = _a.productImageDataTestId, previewListDataTestId = _a.previewListDataTestId, thumbnailPosition = _a.thumbnailPosition;
|
|
10462
|
+
var initialValue = selectedValue && images.includes(selectedValue) ? selectedValue : images[0];
|
|
10463
|
+
var _b = useState(initialValue), selectedImage = _b[0], setSelectedImage = _b[1];
|
|
10464
|
+
useEffect(function () {
|
|
10465
|
+
setSelectedImage(initialValue);
|
|
10466
|
+
}, [initialValue]);
|
|
10467
|
+
return (jsxs$1(Container$z, { children: [jsx$1(ImagePreviewList, { images: images, selectedImage: selectedImage, dataTestId: previewListDataTestId, onClick: function (value) {
|
|
10468
|
+
setSelectedImage(value);
|
|
10469
|
+
}, position: thumbnailPosition }, void 0), jsx$1(ImageProductWithTags$1, { image: selectedImage, topTag: topTag, bottomTag: bottomTag, testId: productImageDataTestId, position: thumbnailPosition }, void 0)] }, void 0));
|
|
10470
|
+
};
|
|
10471
|
+
var templateObject_1$U;
|
|
10472
|
+
|
|
10473
|
+
/* base styles & size variants */
|
|
10474
|
+
var StarStyles = {
|
|
10475
|
+
baseStyles: function () {
|
|
10476
|
+
return css({
|
|
10477
|
+
display: 'flex',
|
|
10478
|
+
});
|
|
10479
|
+
},
|
|
10480
|
+
xsmall: function (theme) {
|
|
10481
|
+
return css({
|
|
10482
|
+
svg: {
|
|
10483
|
+
width: theme.component.stars.element.xsmall.width,
|
|
10484
|
+
height: theme.component.stars.element.xsmall.height,
|
|
10485
|
+
marginRight: theme.component.stars.element.xsmall.marginRight,
|
|
10486
|
+
},
|
|
10487
|
+
});
|
|
10488
|
+
},
|
|
10489
|
+
small: function (theme) {
|
|
10490
|
+
return css({
|
|
10491
|
+
svg: {
|
|
10492
|
+
width: theme.component.stars.element.small.width,
|
|
10493
|
+
height: theme.component.stars.element.small.height,
|
|
10494
|
+
marginRight: theme.component.stars.element.small.marginRight,
|
|
10495
|
+
},
|
|
10496
|
+
});
|
|
10497
|
+
},
|
|
10498
|
+
medium: function (theme) {
|
|
10499
|
+
return css({
|
|
10500
|
+
svg: {
|
|
10501
|
+
width: theme.component.stars.element.medium.width,
|
|
10502
|
+
height: theme.component.stars.element.medium.height,
|
|
10503
|
+
marginRight: theme.component.stars.element.medium.marginRight,
|
|
10504
|
+
},
|
|
10505
|
+
});
|
|
10506
|
+
},
|
|
10507
|
+
large: function (theme) {
|
|
10508
|
+
return css({
|
|
10509
|
+
svg: {
|
|
10510
|
+
width: theme.component.stars.element.large.width,
|
|
10511
|
+
height: theme.component.stars.element.large.height,
|
|
10512
|
+
marginRight: theme.component.stars.element.large.marginRight,
|
|
10513
|
+
},
|
|
10514
|
+
});
|
|
10515
|
+
},
|
|
10516
|
+
};
|
|
10517
|
+
var Container$y = newStyled.div(templateObject_1$T || (templateObject_1$T = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
10518
|
+
var templateObject_1$T;
|
|
10519
|
+
|
|
10520
|
+
var StarContainer = newStyled.div(function (_a) {
|
|
10521
|
+
var size = _a.size, theme = _a.theme;
|
|
10522
|
+
return [
|
|
10523
|
+
StarStyles.baseStyles(),
|
|
10524
|
+
StarStyles[size](theme),
|
|
10525
|
+
];
|
|
10526
|
+
});
|
|
10527
|
+
var sizes = {
|
|
10528
|
+
xsmall: { width: 0.75, height: 0.75 },
|
|
10529
|
+
small: { width: 1, height: 1 },
|
|
10530
|
+
medium: { width: 1.5, height: 1.5 },
|
|
10531
|
+
large: { width: 2.5, height: 2.5 },
|
|
10532
|
+
};
|
|
10533
|
+
var StarList = function (_a) {
|
|
10534
|
+
var rating = _a.rating, starsNumber = _a.starsNumber, fill = _a.fill, _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b;
|
|
10535
|
+
var theme = useTheme();
|
|
10536
|
+
return (jsx$1(Container$y, { children: __spreadArray([], new Array(starsNumber), true).map(function (_, index) {
|
|
10537
|
+
return (jsx$1(StarContainer, __assign$1({ "data-testid": "star-container", size: size, theme: theme }, { children: index < Math.floor(rating) ? (jsx$1(Icon.PDP.Star, __assign$1({}, sizes[size], { fill: fill }), void 0)) : index === Math.floor(rating) && rating % 1 != 0 ? (jsx$1(Icon.PDP.StarHalf, __assign$1({}, sizes[size], { fill: fill }), void 0)) : (jsx$1(Icon.PDP.StarEmpty, __assign$1({}, sizes[size], { fill: fill }), void 0)) }), index));
|
|
10538
|
+
}) }, void 0));
|
|
10539
|
+
};
|
|
10540
|
+
|
|
10541
|
+
/* base styles & size variants */
|
|
10542
|
+
var LabelStyles = {
|
|
10543
|
+
baseStyles: function (theme) {
|
|
10544
|
+
return css({
|
|
10545
|
+
margin: '0',
|
|
10546
|
+
display: 'flex',
|
|
10547
|
+
color: theme.colors.pallete.secondary.color,
|
|
10548
|
+
fontWeight: theme.component.rating.fontWeight,
|
|
10549
|
+
});
|
|
10550
|
+
},
|
|
10551
|
+
xsmall: function (theme) {
|
|
10552
|
+
return css({
|
|
10553
|
+
fontSize: theme.component.rating.size.xsmall.fontSize,
|
|
10554
|
+
lineHeight: theme.component.rating.size.xsmall.lineHeight,
|
|
10555
|
+
marginLeft: '0.172rem',
|
|
10556
|
+
});
|
|
10557
|
+
},
|
|
10558
|
+
small: function (theme) {
|
|
10559
|
+
return css({
|
|
10560
|
+
fontSize: theme.component.rating.size.small.fontSize,
|
|
10561
|
+
lineHeight: theme.component.rating.size.small.lineHeight,
|
|
10562
|
+
marginLeft: '0.313rem',
|
|
10563
|
+
});
|
|
10564
|
+
},
|
|
10565
|
+
medium: function (theme) {
|
|
10566
|
+
return css({
|
|
10567
|
+
fontSize: theme.component.rating.size.medium.fontSize,
|
|
10568
|
+
lineHeight: theme.component.rating.size.medium.lineHeight,
|
|
10569
|
+
marginLeft: '0.438rem',
|
|
10570
|
+
});
|
|
10571
|
+
},
|
|
10572
|
+
large: function (theme) {
|
|
10573
|
+
return css({
|
|
10574
|
+
fontSize: theme.component.rating.size.large.fontSize,
|
|
10575
|
+
lineHeight: theme.component.rating.size.large.lineHeight,
|
|
10576
|
+
marginLeft: '0.563rem',
|
|
10577
|
+
});
|
|
10578
|
+
},
|
|
10579
|
+
};
|
|
10580
|
+
var Container$x = newStyled.div(templateObject_1$S || (templateObject_1$S = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
10581
|
+
var templateObject_1$S;
|
|
10582
|
+
|
|
10583
|
+
var CustomLabel = newStyled.div(function (_a) {
|
|
10584
|
+
var theme = _a.theme, size = _a.size, wrapWithParenthesis = _a.wrapWithParenthesis;
|
|
10585
|
+
return [
|
|
10586
|
+
LabelStyles.baseStyles(theme),
|
|
10587
|
+
LabelStyles[size](theme),
|
|
10588
|
+
{
|
|
10589
|
+
':before': {
|
|
10590
|
+
content: wrapWithParenthesis ? '"("' : '""',
|
|
10591
|
+
},
|
|
10592
|
+
':after': {
|
|
10593
|
+
content: wrapWithParenthesis ? '")"' : '""',
|
|
10594
|
+
},
|
|
10595
|
+
},
|
|
10596
|
+
];
|
|
10597
|
+
});
|
|
10598
|
+
var starsNumber = 5;
|
|
10599
|
+
var Rating = function (_a) {
|
|
10600
|
+
var _b = _a.size, size = _b === void 0 ? ComponentSize.Medium : _b, reviews = _a.reviews, reviewsText = _a.reviewsText, rating = _a.rating, _c = _a.wrapWithParenthesis, wrapWithParenthesis = _c === void 0 ? false : _c;
|
|
10601
|
+
var theme = useTheme();
|
|
10602
|
+
return (jsxs$1(Container$x, { children: [jsx$1(StarList, { rating: rating, size: size, starsNumber: starsNumber, fill: theme.component.stars.element.color }, void 0), jsxs$1(CustomLabel, __assign$1({ theme: theme, size: size, wrapWithParenthesis: wrapWithParenthesis, "data-testid": "CustomLabel" }, { children: [reviews, " ", reviewsText] }), void 0)] }, void 0));
|
|
10603
|
+
};
|
|
10604
|
+
|
|
10605
|
+
var Container$w = newStyled.div(templateObject_1$R || (templateObject_1$R = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"], ["\n display: flex;\n align-items: center;\n font-size: 0.88rem;\n"])));
|
|
10606
|
+
var P$2 = newStyled.p(templateObject_2$z || (templateObject_2$z = __makeTemplateObject(["\n margin: 0 0.25rem;\n font-weight: 700;\n color: ", ";\n"], ["\n margin: 0 0.25rem;\n font-weight: 700;\n color: ", ";\n"])), function (props) { return props.theme.colors.shades['550'].color; });
|
|
10607
|
+
var textButtonStyles = function (theme) { return ({
|
|
10608
|
+
border: 'none',
|
|
10609
|
+
background: 'transparent',
|
|
10610
|
+
padding: 0,
|
|
10611
|
+
textDecoration: 'underline',
|
|
10612
|
+
color: theme.colors.shades['400'].color,
|
|
10613
|
+
lineHeight: '1.13rem',
|
|
10614
|
+
cursor: 'pointer',
|
|
10615
|
+
}); };
|
|
10616
|
+
var FitPredictor = function (_a) {
|
|
10617
|
+
var onClick = _a.onClick;
|
|
10618
|
+
var theme = useTheme();
|
|
10619
|
+
return (jsxs(Container$w, __assign$1({ theme: theme }, { children: [jsx(Container$w, { children: jsx(Icon.Other.FitPredictor, { width: 1.125, height: 1.125, fill: theme.colors.shades['550'].color }, void 0) }, void 0), jsx(P$2, __assign$1({ theme: theme }, { children: "FIT PREDICTOR" }), void 0), jsx(BaseButton, __assign$1({ css: textButtonStyles(theme), onClick: onClick }, { children: "Calculate your size" }), void 0)] }), void 0));
|
|
10620
|
+
};
|
|
10621
|
+
var templateObject_1$R, templateObject_2$z;
|
|
10622
|
+
|
|
10623
|
+
var H2$2 = newStyled.h2(function (_a) {
|
|
10624
|
+
var color = _a.color;
|
|
10625
|
+
return ({
|
|
10626
|
+
textAlign: 'center',
|
|
10627
|
+
fontWeight: 400,
|
|
10628
|
+
fontStyle: 'normal',
|
|
10629
|
+
fontSize: '0.875rem',
|
|
10630
|
+
lineHeight: '1.375rem',
|
|
10631
|
+
color: color,
|
|
10632
|
+
margin: '0.938rem 4.188rem',
|
|
10633
|
+
});
|
|
10634
|
+
});
|
|
10635
|
+
var Bar = newStyled.div(templateObject_1$Q || (templateObject_1$Q = __makeTemplateObject(["\n @keyframes loading {\n 0% {\n transform: translateX(0);\n }\n to {\n transform: translateX(400%);\n }\n }\n\n height: 0.5rem;\n background-color: ", ";\n width: ", ";\n border-radius: 0.25rem;\n position: absolute;\n left: ", ";\n animation: ", ";\n"], ["\n @keyframes loading {\n 0% {\n transform: translateX(0);\n }\n to {\n transform: translateX(400%);\n }\n }\n\n height: 0.5rem;\n background-color: ", ";\n width: ", ";\n border-radius: 0.25rem;\n position: absolute;\n left: ", ";\n animation: ", ";\n"])), function (_a) {
|
|
10636
|
+
var backgroundColor = _a.backgroundColor;
|
|
10637
|
+
return backgroundColor;
|
|
10638
|
+
}, function (_a) {
|
|
10639
|
+
var percent = _a.percent;
|
|
10640
|
+
return (percent ? getBarWithBasedOnPercent(percent) : '50%');
|
|
10641
|
+
}, function (_a) {
|
|
10642
|
+
var percent = _a.percent;
|
|
10643
|
+
return (percent ? '0' : '-50%');
|
|
10644
|
+
}, function (_a) {
|
|
10645
|
+
var percent = _a.percent;
|
|
10646
|
+
return (percent ? 'none' : 'loading 1s ease-in 0.5s infinite');
|
|
10647
|
+
});
|
|
10648
|
+
var Background = newStyled.div(function (_a) {
|
|
10649
|
+
var backgroundColor = _a.backgroundColor;
|
|
10650
|
+
return ({
|
|
10651
|
+
height: '0.5rem',
|
|
10652
|
+
width: '100%',
|
|
10653
|
+
backgroundColor: backgroundColor,
|
|
10654
|
+
borderRadius: '0.25rem',
|
|
10655
|
+
position: 'absolute',
|
|
10656
|
+
});
|
|
10657
|
+
});
|
|
10658
|
+
var Container$v = newStyled.div(function (_a) {
|
|
10659
|
+
var widthAuto = _a.widthAuto;
|
|
10660
|
+
return ({
|
|
10661
|
+
width: widthAuto ? 'auto' : 'fit-content',
|
|
10662
|
+
position: 'relative',
|
|
10663
|
+
overflow: 'hidden',
|
|
10664
|
+
});
|
|
10665
|
+
});
|
|
10666
|
+
var getBarWithBasedOnPercent = function (percent) {
|
|
10667
|
+
return percent <= 100 && percent >= 0 ? "".concat(percent, "%") : '0%';
|
|
10668
|
+
};
|
|
9089
10669
|
var ProgressBar = function (_a) {
|
|
9090
10670
|
var description = _a.description, fillColor = _a.fillColor, _b = _a.widthAuto, widthAuto = _b === void 0 ? true : _b, percent = _a.percent;
|
|
9091
10671
|
var theme = useTheme();
|
|
9092
10672
|
return (jsxs$1(Container$v, __assign$1({ "data-testid": "PBContainer", widthAuto: widthAuto }, { children: [jsx$1(Background, __assign$1({ backgroundColor: theme.colors.shades['100'].color }, { children: jsx$1(Bar, { "data-testid": "PBBar", backgroundColor: fillColor, percent: percent }, void 0) }), void 0), description && jsx$1(H2$2, __assign$1({ color: theme.colors.pallete.secondary.color }, { children: description }), void 0)] }), void 0));
|
|
9093
10673
|
};
|
|
9094
|
-
var templateObject_1$
|
|
10674
|
+
var templateObject_1$Q;
|
|
9095
10675
|
|
|
9096
10676
|
var getStylesBySize$3 = function (size) {
|
|
9097
10677
|
switch (size) {
|
|
@@ -9112,7 +10692,7 @@ var getStylesBySize$3 = function (size) {
|
|
|
9112
10692
|
};
|
|
9113
10693
|
}
|
|
9114
10694
|
};
|
|
9115
|
-
var Container$u = newStyled.div(templateObject_1$
|
|
10695
|
+
var Container$u = newStyled.div(templateObject_1$P || (templateObject_1$P = __makeTemplateObject(["\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n\n svg {\n margin: ", ";\n }\n\n &:hover {\n background-color: ", ";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ", ";\n cursor: not-allowed;\n\n svg path {\n fill: ", ";\n }\n }\n"], ["\n background-color: ", ";\n width: ", ";\n height: ", ";\n border-radius: 50%;\n display: flex;\n justify-content: center;\n align-items: center;\n transition: background-color 0.1s ease;\n\n svg {\n margin: ", ";\n }\n\n &:hover {\n background-color: ", ";\n cursor: pointer;\n }\n\n &.disabled {\n background-color: ", ";\n cursor: not-allowed;\n\n svg path {\n fill: ", ";\n }\n }\n"])), function (_a) {
|
|
9116
10696
|
var backgroundColor = _a.backgroundColor;
|
|
9117
10697
|
return backgroundColor;
|
|
9118
10698
|
}, function (_a) {
|
|
@@ -9142,7 +10722,7 @@ var IconButton = function (_a) {
|
|
|
9142
10722
|
var theme = useTheme();
|
|
9143
10723
|
return (jsx$1(Container$u, __assign$1({ className: disabled ? 'disabled' : '', backgroundColor: theme.component.button.primary.active.backgroundColor, hoverBackgroundColor: theme.component.button.secondary.active.backgroundColor, disabledColor: theme.colors.shades['50'].color, disabledIconColor: theme.colors.shades['200'].color, size: size, "data-testid": "Container", onClick: disabled ? function () { } : onClick }, { children: children }), void 0));
|
|
9144
10724
|
};
|
|
9145
|
-
var templateObject_1$
|
|
10725
|
+
var templateObject_1$P;
|
|
9146
10726
|
|
|
9147
10727
|
var TooltipArrow = function (_a) {
|
|
9148
10728
|
var height = _a.height, width = _a.width, fill = _a.fill, stroke = _a.stroke;
|
|
@@ -9222,7 +10802,7 @@ var getTooltipAlignItems = function (position, align) {
|
|
|
9222
10802
|
}
|
|
9223
10803
|
};
|
|
9224
10804
|
|
|
9225
|
-
var Wrapper$5 = newStyled.div(templateObject_1$
|
|
10805
|
+
var Wrapper$5 = newStyled.div(templateObject_1$O || (templateObject_1$O = __makeTemplateObject(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n cursor: pointer;\n\n &:hover {\n .tooltip-container {\n visibility: visible;\n opacity: 1;\n }\n }\n"], ["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n cursor: pointer;\n\n &:hover {\n .tooltip-container {\n visibility: visible;\n opacity: 1;\n }\n }\n"])), function (_a) {
|
|
9226
10806
|
var position = _a.position;
|
|
9227
10807
|
return getWrapperFlexDirection(position);
|
|
9228
10808
|
});
|
|
@@ -9270,7 +10850,7 @@ var Title$5 = newStyled.h1(templateObject_6$7 || (templateObject_6$7 = __makeTem
|
|
|
9270
10850
|
return color;
|
|
9271
10851
|
});
|
|
9272
10852
|
var IconContainer$5 = newStyled.div(templateObject_7$4 || (templateObject_7$4 = __makeTemplateObject(["\n width: 1.375rem;\n height: 1.125rem;\n margin-right: 0.563rem;\n"], ["\n width: 1.375rem;\n height: 1.125rem;\n margin-right: 0.563rem;\n"])));
|
|
9273
|
-
var templateObject_1$
|
|
10853
|
+
var templateObject_1$O, templateObject_2$y, templateObject_3$o, templateObject_4$h, templateObject_5$a, templateObject_6$7, templateObject_7$4;
|
|
9274
10854
|
|
|
9275
10855
|
var Tooltip = function (_a) {
|
|
9276
10856
|
var children = _a.children, position = _a.position, text = _a.text, _b = _a.align, align = _b === void 0 ? 'center' : _b, onClick = _a.onClick, header = _a.header;
|
|
@@ -9422,7 +11002,7 @@ var ContainerStyles = {
|
|
|
9422
11002
|
},
|
|
9423
11003
|
};
|
|
9424
11004
|
|
|
9425
|
-
var Wrapper$4 = newStyled.div(templateObject_1$
|
|
11005
|
+
var Wrapper$4 = newStyled.div(templateObject_1$N || (templateObject_1$N = __makeTemplateObject(["\n display: flex;\n align-items: center;\n"], ["\n display: flex;\n align-items: center;\n"])));
|
|
9426
11006
|
var Container$t = newStyled.div(__assign$1({}, ContainerStyles.baseStyles), function (props) { return [ContainerStyles[props.size](props.theme)]; });
|
|
9427
11007
|
var Input$2 = newStyled.input(templateObject_2$x || (templateObject_2$x = __makeTemplateObject(["\n position: absolute;\n opacity: 0;\n cursor: ", ";\n height: 100%;\n width: 100%;\n margin: 0;\n"], ["\n position: absolute;\n opacity: 0;\n cursor: ", ";\n height: 100%;\n width: 100%;\n margin: 0;\n"])), function (_a) {
|
|
9428
11008
|
var disabled = _a.disabled;
|
|
@@ -9441,7 +11021,7 @@ var RadioInput = function (_a) {
|
|
|
9441
11021
|
};
|
|
9442
11022
|
return (jsxs$1(Wrapper$4, { children: [jsxs$1(Container$t, __assign$1({ theme: theme, size: size, "data-testid": "container" }, { children: [jsx$1(Input$2, { id: "".concat(name, "-").concat(id), type: "radio", name: name, value: value, checked: checked, onChange: function (e) { return (disabled ? null : handleChange(e, label)); }, disabled: disabled }, void 0), jsx$1(CustomRadio, { size: size, isChecked: checked, disabled: disabled, theme: theme, "data-testid": "custom-radio" }, void 0)] }), void 0), jsx$1(Label$3, __assign$1({ htmlFor: "".concat(name, "-").concat(id), "data-testid": "label", variant: "regular", size: size, disabled: disabled }, { children: label }), void 0)] }, void 0));
|
|
9443
11023
|
};
|
|
9444
|
-
var templateObject_1$
|
|
11024
|
+
var templateObject_1$N, templateObject_2$x;
|
|
9445
11025
|
|
|
9446
11026
|
var RadioGroupInput = function (_a) {
|
|
9447
11027
|
var name = _a.name, _b = _a.options, options = _b === void 0 ? [] : _b, value = _a.value, onChange = _a.onChange, _c = _a.size, size = _c === void 0 ? ComponentSize.Medium : _c, _d = _a.disabled, disabled = _d === void 0 ? false : _d;
|
|
@@ -9455,16 +11035,16 @@ var RadioGroupInput = function (_a) {
|
|
|
9455
11035
|
}) }), void 0));
|
|
9456
11036
|
};
|
|
9457
11037
|
|
|
9458
|
-
var Wrapper$3 = newStyled.div(templateObject_1$
|
|
11038
|
+
var Wrapper$3 = newStyled.div(templateObject_1$M || (templateObject_1$M = __makeTemplateObject(["\n padding: 0.625rem 1.5rem;\n"], ["\n padding: 0.625rem 1.5rem;\n"])));
|
|
9459
11039
|
var Container$s = newStyled.div(templateObject_2$w || (templateObject_2$w = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"], ["\n display: flex;\n justify-content: space-between;\n align-items: center;\n"])));
|
|
9460
11040
|
var Minimalistic = function (_a) {
|
|
9461
11041
|
var _b = _a.backgroundColor, backgroundColor = _b === void 0 ? '#FFF6EF' : _b, _c = _a.borderColor, borderColor = _c === void 0 ? '#E7C9B2' : _c, originalPrice = _a.originalPrice, price = _a.price, savingPrice = _a.savingPrice, getMorePayLessText = _a.getMorePayLessText, youAreSavingText = _a.youAreSavingText, getQtyForText = _a.getQtyForText, discount = _a.discount, offText = _a.offText, _d = _a.widthAuto, widthAuto = _d === void 0 ? false : _d, _e = _a.testId, testId = _e === void 0 ? 'minimalistic' : _e;
|
|
9462
11042
|
var theme = useTheme();
|
|
9463
11043
|
return (jsx$1(Card$2, __assign$1({ backgroundColor: backgroundColor, widthAuto: widthAuto, border: { borderColor: borderColor, borderWidth: '0.063rem' }, flex: false }, { children: jsxs$1(Wrapper$3, { children: [jsxs$1(Container$s, __assign$1({ "data-testid": "".concat(testId, "-section") }, { children: [jsx$1(Text$5, __assign$1({ variant: "body", weight: "demi", size: "small", style: { margin: '0.1rem 1.25rem 0.1rem 0' } }, { children: getMorePayLessText }), void 0), jsx$1(PriceLabel, { finalPrice: price, originalPrice: originalPrice, color: theme.colors.pallete.secondary.color, size: ComponentSize.Small, testId: testId }, void 0)] }), void 0), jsxs$1(Container$s, __assign$1({ "data-testid": "".concat(testId, "-section-bottom") }, { children: [jsxs$1(Text$5, __assign$1({ variant: "body", weight: "demi", style: { color: '#d3373c', margin: '0.1rem 1.25rem 0.1rem 0' }, size: "small" }, { children: [getQtyForText, " ", discount, "% ", offText.toLocaleUpperCase()] }), void 0), jsxs$1(Text$5, __assign$1({ variant: "body", weight: "regular", size: "small" }, { children: [youAreSavingText, ": ", savingPrice] }), void 0)] }), void 0)] }, void 0) }), void 0));
|
|
9464
11044
|
};
|
|
9465
|
-
var templateObject_1$
|
|
11045
|
+
var templateObject_1$M, templateObject_2$w;
|
|
9466
11046
|
|
|
9467
|
-
var Container$r = newStyled.div(templateObject_1$
|
|
11047
|
+
var Container$r = newStyled.div(templateObject_1$L || (templateObject_1$L = __makeTemplateObject(["\n padding: 0.625rem 1.5rem;\n"], ["\n padding: 0.625rem 1.5rem;\n"])));
|
|
9468
11048
|
var Title$4 = newStyled.h1(templateObject_2$v || (templateObject_2$v = __makeTemplateObject(["\n font-weight: 700;\n font-size: 1rem;\n line-height: 1.25rem;\n color: ", ";\n margin: 0;\n margin-bottom: 0.125rem;\n text-align: center;\n"], ["\n font-weight: 700;\n font-size: 1rem;\n line-height: 1.25rem;\n color: ", ";\n margin: 0;\n margin-bottom: 0.125rem;\n text-align: center;\n"])), function (props) { return props.color; });
|
|
9469
11049
|
var Details$1 = newStyled.span(templateObject_3$n || (templateObject_3$n = __makeTemplateObject(["\n display: flex;\n align-items: center;\n font-weight: 400;\n font-size: 1rem;\n margin: 0;\n line-height: 1.5rem;\n justify-content: center;\n color: ", ";\n"], ["\n display: flex;\n align-items: center;\n font-weight: 400;\n font-size: 1rem;\n margin: 0;\n line-height: 1.5rem;\n justify-content: center;\n color: ", ";\n"])), function (props) { return props.color; });
|
|
9470
11050
|
var PriceContainer$1 = newStyled.span(templateObject_4$g || (templateObject_4$g = __makeTemplateObject(["\n margin: 0 0.313rem;\n display: flex;\n align-items: center;\n"], ["\n margin: 0 0.313rem;\n display: flex;\n align-items: center;\n"])));
|
|
@@ -9473,19 +11053,19 @@ var Simple = function (_a) {
|
|
|
9473
11053
|
var theme = useTheme();
|
|
9474
11054
|
return (jsx$1(Card$2, __assign$1({ backgroundColor: backgroundColor, widthAuto: widthAuto }, { children: jsxs$1(Container$r, { children: [jsx$1(Title$4, __assign$1({ color: theme.colors.pallete.secondary.color, "data-testid": "Title" }, { children: title }), void 0), jsxs$1(Details$1, __assign$1({ color: theme.colors.pallete.secondary.color, "data-testid": "Details" }, { children: [anyQtyForText, jsx$1(PriceContainer$1, __assign$1({ "data-testid": "Price" }, { children: jsx$1(PriceLabel, { finalPrice: price, color: "#d3373c", size: ComponentSize.Small }, void 0) }), void 0), "+ ", freeShippingText] }), void 0)] }, void 0) }), void 0));
|
|
9475
11055
|
};
|
|
9476
|
-
var templateObject_1$
|
|
11056
|
+
var templateObject_1$L, templateObject_2$v, templateObject_3$n, templateObject_4$g;
|
|
9477
11057
|
|
|
9478
11058
|
var Bundle = {
|
|
9479
11059
|
Minimalistic: Minimalistic,
|
|
9480
11060
|
Simple: Simple,
|
|
9481
11061
|
};
|
|
9482
11062
|
|
|
9483
|
-
var Container$q = newStyled.div(templateObject_1$
|
|
11063
|
+
var Container$q = newStyled.div(templateObject_1$K || (templateObject_1$K = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n width: fit-content;\n"])));
|
|
9484
11064
|
var Tag$1 = function (_a) {
|
|
9485
11065
|
var text = _a.text, className = _a.className;
|
|
9486
11066
|
return jsx$1(Container$q, __assign$1({ className: className }, { children: text }), void 0);
|
|
9487
11067
|
};
|
|
9488
|
-
var templateObject_1$
|
|
11068
|
+
var templateObject_1$K;
|
|
9489
11069
|
|
|
9490
11070
|
var getStylesBySize$2 = function (size) {
|
|
9491
11071
|
switch (size) {
|
|
@@ -9588,7 +11168,7 @@ var Timer = function (_a) {
|
|
|
9588
11168
|
return (jsxs$1("div", __assign$1({ "data-testid": "Time" }, { children: [(hours || displayZeroValues) && "".concat(hours, "h "), (minutes || displayZeroValues) && "".concat(minutes, "m "), seconds, "s"] }), void 0));
|
|
9589
11169
|
};
|
|
9590
11170
|
|
|
9591
|
-
var Label$1 = newStyled.span(templateObject_1$
|
|
11171
|
+
var Label$1 = newStyled.span(templateObject_1$J || (templateObject_1$J = __makeTemplateObject(["\n font-weight: 600;\n color: ", ";\n font-size: 1.125rem;\n line-height: 1.75rem;\n"], ["\n font-weight: 600;\n color: ", ";\n font-size: 1.125rem;\n line-height: 1.75rem;\n"])), function (_a) {
|
|
9592
11172
|
var color = _a.color;
|
|
9593
11173
|
return color;
|
|
9594
11174
|
});
|
|
@@ -9601,7 +11181,7 @@ var InputLabel = function (_a) {
|
|
|
9601
11181
|
var theme = useTheme();
|
|
9602
11182
|
return (jsxs$1(Label$1, __assign$1({ color: isDisabled ? theme.colors.shades['250'].color : theme.colors.shades['700'].color }, { children: [label, isRequired && jsx$1(MandatoryIcon, __assign$1({ color: theme.colors.semantic.urgent.color }, { children: "*" }), void 0)] }), void 0));
|
|
9603
11183
|
};
|
|
9604
|
-
var templateObject_1$
|
|
11184
|
+
var templateObject_1$J, templateObject_2$u;
|
|
9605
11185
|
|
|
9606
11186
|
/**
|
|
9607
11187
|
* @returns number formatted with "," and 2 decimals as string
|
|
@@ -9655,16 +11235,16 @@ var formatPrice = function (value, _a) {
|
|
|
9655
11235
|
}).format(valueToFormat);
|
|
9656
11236
|
};
|
|
9657
11237
|
|
|
9658
|
-
var ErrorText = newStyled.h3(templateObject_1$
|
|
11238
|
+
var ErrorText = newStyled.h3(templateObject_1$I || (templateObject_1$I = __makeTemplateObject(["\n color: ", " !important;\n font-size: 0.75rem;\n font-weight: 600;\n margin: 0;\n font-height: 1rem;\n margin-left: 0.313rem;\n"], ["\n color: ", " !important;\n font-size: 0.75rem;\n font-weight: 600;\n margin: 0;\n font-height: 1rem;\n margin-left: 0.313rem;\n"])), function (props) { return props.color; });
|
|
9659
11239
|
var ErrorContainer = newStyled.div(templateObject_2$t || (templateObject_2$t = __makeTemplateObject(["\n display: flex;\n align-items: center;\n margin-top: 0.25rem;\n"], ["\n display: flex;\n align-items: center;\n margin-top: 0.25rem;\n"])));
|
|
9660
11240
|
var Error$1 = function (_a) {
|
|
9661
11241
|
var error = _a.error;
|
|
9662
11242
|
var theme = useTheme();
|
|
9663
11243
|
return (jsxs$1(ErrorContainer, { children: [jsx$1(Icon.Actions.LightExclamation, { fill: theme.colors.semantic.urgent.color, width: 0.875, height: 0.875 }, void 0), jsx$1(ErrorText, __assign$1({ color: theme.colors.semantic.urgent.color }, { children: error }), void 0)] }, void 0));
|
|
9664
11244
|
};
|
|
9665
|
-
var templateObject_1$
|
|
11245
|
+
var templateObject_1$I, templateObject_2$t;
|
|
9666
11246
|
|
|
9667
|
-
var Container$p = newStyled.div(templateObject_1$
|
|
11247
|
+
var Container$p = newStyled.div(templateObject_1$H || (templateObject_1$H = __makeTemplateObject(["\n input {\n border-color: ", ";\n }\n"], ["\n input {\n border-color: ", ";\n }\n"])), function (_a) {
|
|
9668
11248
|
var color = _a.color;
|
|
9669
11249
|
return color;
|
|
9670
11250
|
});
|
|
@@ -9715,7 +11295,7 @@ var InputWrapper = newStyled.div(templateObject_3$m || (templateObject_3$m = __m
|
|
|
9715
11295
|
var size = _a.size;
|
|
9716
11296
|
return (size === 'small' ? '36px' : '44px');
|
|
9717
11297
|
});
|
|
9718
|
-
var templateObject_1$
|
|
11298
|
+
var templateObject_1$H, templateObject_2$s, templateObject_3$m;
|
|
9719
11299
|
|
|
9720
11300
|
var BaseInput = function (_a) {
|
|
9721
11301
|
var _b;
|
|
@@ -9789,7 +11369,7 @@ var Button$2 = function (_a) {
|
|
|
9789
11369
|
throw new Error("Invalid button variant ".concat(variant));
|
|
9790
11370
|
};
|
|
9791
11371
|
|
|
9792
|
-
var Container$o = newStyled.div(templateObject_1$
|
|
11372
|
+
var Container$o = newStyled.div(templateObject_1$G || (templateObject_1$G = __makeTemplateObject(["\n overflow: hidden;\n\n input {\n border-radius: ", ";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n width: 100%;\n }\n"], ["\n overflow: hidden;\n\n input {\n border-radius: ", ";\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n border-right: none;\n width: 100%;\n }\n"])), function (_a) {
|
|
9793
11373
|
var theme = _a.theme;
|
|
9794
11374
|
return theme.component.inputCustom.input.borderRadius;
|
|
9795
11375
|
});
|
|
@@ -9808,9 +11388,9 @@ var Custom = function (_a) {
|
|
|
9808
11388
|
}); }, [variant, onClick, text, rest.disabled]);
|
|
9809
11389
|
return (jsx$1(Container$o, __assign$1({ theme: theme }, { children: jsx$1(BaseInput, __assign$1({}, rest, { children: jsx$1(ButtonContainer$1, __assign$1({ theme: theme }, { children: jsx$1(Button$2, __assign$1({}, props), void 0) }), void 0) }), void 0) }), void 0));
|
|
9810
11390
|
};
|
|
9811
|
-
var templateObject_1$
|
|
11391
|
+
var templateObject_1$G, templateObject_2$r;
|
|
9812
11392
|
|
|
9813
|
-
var SuccessContainer = newStyled.div(templateObject_1$
|
|
11393
|
+
var SuccessContainer = newStyled.div(templateObject_1$F || (templateObject_1$F = __makeTemplateObject(["\n height: ", ";\n display: flex;\n"], ["\n height: ", ";\n display: flex;\n"])), function (_a) {
|
|
9814
11394
|
var size = _a.size;
|
|
9815
11395
|
return (size === 'small' ? '36px' : '');
|
|
9816
11396
|
});
|
|
@@ -9820,9 +11400,9 @@ var Success = function (_a) {
|
|
|
9820
11400
|
var children = _a.children, successText = _a.successText, size = _a.size;
|
|
9821
11401
|
return (jsxs$1(SuccessContainer, __assign$1({ size: size }, { children: [jsxs$1(SuccessMessage, { children: [jsx$1(Icon.Actions.Check, { fill: "#5EAD63", width: 1.375, height: 1.063 }, void 0), jsx$1(SuccessText, { children: successText }, void 0)] }, void 0), children] }), void 0));
|
|
9822
11402
|
};
|
|
9823
|
-
var templateObject_1$
|
|
11403
|
+
var templateObject_1$F, templateObject_2$q, templateObject_3$l;
|
|
9824
11404
|
|
|
9825
|
-
var ButtonContainer = newStyled.div(templateObject_1$
|
|
11405
|
+
var ButtonContainer = newStyled.div(templateObject_1$E || (templateObject_1$E = __makeTemplateObject(["\n margin-left: 0.625rem;\n\n button {\n width: 100%;\n height: 100%;\n background-color: ", ";\n }\n"], ["\n margin-left: 0.625rem;\n\n button {\n width: 100%;\n height: 100%;\n background-color: ", ";\n }\n"])), function (_a) {
|
|
9826
11406
|
var status = _a.status, type = _a.type, theme = _a.theme;
|
|
9827
11407
|
return status === InputValidationType.Empty &&
|
|
9828
11408
|
type === 'primary' &&
|
|
@@ -9839,9 +11419,9 @@ var BasePlusButton = function (_a) {
|
|
|
9839
11419
|
}
|
|
9840
11420
|
return (jsx$1(BaseInput, __assign$1({}, rest, { onValidation: setStatus, onChange: onChangeInput }, { children: jsx$1(ButtonContainer, __assign$1({ status: status, type: "primary", theme: theme }, { children: jsx$1(ButtonSecondary, { text: text, onClick: function () { return onClick(inputValue); }, disabled: rest.disabled || status === InputValidationType.Error }, void 0) }), void 0) }), void 0));
|
|
9841
11421
|
};
|
|
9842
|
-
var templateObject_1$
|
|
11422
|
+
var templateObject_1$E;
|
|
9843
11423
|
|
|
9844
|
-
var Container$n = newStyled.div(templateObject_1$
|
|
11424
|
+
var Container$n = newStyled.div(templateObject_1$D || (templateObject_1$D = __makeTemplateObject(["\n input {\n padding-right: 2.688rem;\n }\n"], ["\n input {\n padding-right: 2.688rem;\n }\n"])));
|
|
9845
11425
|
var IconContainer$4 = newStyled.div(templateObject_2$p || (templateObject_2$p = __makeTemplateObject(["\n position: absolute;\n right: 0.875rem;\n width: 1.125rem;\n height: 100%;\n display: flex;\n align-items: center;\n\n svg path {\n fill: ", ";\n }\n"], ["\n position: absolute;\n right: 0.875rem;\n width: 1.125rem;\n height: 100%;\n display: flex;\n align-items: center;\n\n svg path {\n fill: ", ";\n }\n"])), function (props) { return props.color; });
|
|
9846
11426
|
var BasePlusIcon = function (_a) {
|
|
9847
11427
|
var Icon = _a.Icon, rest = __rest(_a, ["Icon"]);
|
|
@@ -9853,7 +11433,7 @@ var BasePlusIcon = function (_a) {
|
|
|
9853
11433
|
? theme.colors.semantic.urgent.color
|
|
9854
11434
|
: '' }, { children: createElement(Icon, { fill: theme.colors.shades['250'].color }) }), void 0) }), void 0) }, void 0));
|
|
9855
11435
|
};
|
|
9856
|
-
var templateObject_1$
|
|
11436
|
+
var templateObject_1$D, templateObject_2$p;
|
|
9857
11437
|
|
|
9858
11438
|
var Input$1 = {
|
|
9859
11439
|
Simple: BaseInput,
|
|
@@ -9862,7 +11442,7 @@ var Input$1 = {
|
|
|
9862
11442
|
SimplePlusIcon: BasePlusIcon,
|
|
9863
11443
|
};
|
|
9864
11444
|
|
|
9865
|
-
var Container$m = newStyled.div(templateObject_1$
|
|
11445
|
+
var Container$m = newStyled.div(templateObject_1$C || (templateObject_1$C = __makeTemplateObject(["\n width: ", ";\n height: ", ";\n border: 0.063rem solid ", ";\n border-radius: 0.25rem;\n padding: 0.375rem;\n cursor: ", ";\n"], ["\n width: ", ";\n height: ", ";\n border: 0.063rem solid ", ";\n border-radius: 0.25rem;\n padding: 0.375rem;\n cursor: ", ";\n"])), function (_a) {
|
|
9866
11446
|
var width = _a.width;
|
|
9867
11447
|
return width;
|
|
9868
11448
|
}, function (_a) {
|
|
@@ -9880,9 +11460,9 @@ var PaymentMethod = function (_a) {
|
|
|
9880
11460
|
var theme = useTheme();
|
|
9881
11461
|
return (jsx$1(Container$m, __assign$1({ width: width, height: height, borderColor: theme.colors.shades['100'].color, isClickable: Boolean(onClick), onClick: onClick, "data-testid": "payment-method-container" }, { children: createElement(Icon) }), void 0));
|
|
9882
11462
|
};
|
|
9883
|
-
var templateObject_1$
|
|
11463
|
+
var templateObject_1$C;
|
|
9884
11464
|
|
|
9885
|
-
var Text$4 = newStyled.h3(templateObject_1$
|
|
11465
|
+
var Text$4 = newStyled.h3(templateObject_1$B || (templateObject_1$B = __makeTemplateObject(["\n background-color: ", ";\n margin: 0;\n padding: 0.25rem 0.5rem;\n font-size: 0.625rem;\n font-weight: 700;\n line-height: 0.875rem;\n border-radius: 0.125rem;\n display: initial;\n color: ", ";\n"], ["\n background-color: ", ";\n margin: 0;\n padding: 0.25rem 0.5rem;\n font-size: 0.625rem;\n font-weight: 700;\n line-height: 0.875rem;\n border-radius: 0.125rem;\n display: initial;\n color: ", ";\n"])), function (_a) {
|
|
9886
11466
|
var backgroundColor = _a.backgroundColor;
|
|
9887
11467
|
return backgroundColor;
|
|
9888
11468
|
}, function (_a) {
|
|
@@ -9894,9 +11474,9 @@ var OfferBanner = function (_a) {
|
|
|
9894
11474
|
var theme = useTheme();
|
|
9895
11475
|
return (jsx$1(Text$4, __assign$1({ backgroundColor: backgroundColor, color: theme.colors.shades['700'].color, "data-testid": "OfferBanner" }, { children: discountAppliedText }), void 0));
|
|
9896
11476
|
};
|
|
9897
|
-
var templateObject_1$
|
|
11477
|
+
var templateObject_1$B;
|
|
9898
11478
|
|
|
9899
|
-
var Wrapper$2 = newStyled.div(templateObject_1$
|
|
11479
|
+
var Wrapper$2 = newStyled.div(templateObject_1$A || (templateObject_1$A = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n"], ["\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n"])));
|
|
9900
11480
|
var GrandTotal = newStyled.h1(templateObject_2$o || (templateObject_2$o = __makeTemplateObject(["\n margin: 0;\n font-size: 1.5rem;\n line-height: 2rem;\n font-weight: 700;\n color: ", ";\n display: flex;\n align-items: center;\n"], ["\n margin: 0;\n font-size: 1.5rem;\n line-height: 2rem;\n font-weight: 700;\n color: ", ";\n display: flex;\n align-items: center;\n"])), function (props) { return props.color; });
|
|
9901
11481
|
var Currency = newStyled.span(templateObject_3$k || (templateObject_3$k = __makeTemplateObject(["\n margin: 0;\n margin-right: 0.625rem;\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 600;\n"], ["\n margin: 0;\n margin-right: 0.625rem;\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 600;\n"])));
|
|
9902
11482
|
var Container$l = newStyled.div(templateObject_4$f || (templateObject_4$f = __makeTemplateObject(["\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: 0.625rem;\n color: ", ";\n"], ["\n display: flex;\n justify-content: space-between;\n width: 100%;\n margin-top: 0.625rem;\n color: ", ";\n"])), function (props) { return props.highlightColor; });
|
|
@@ -9906,9 +11486,9 @@ var Total = function (_a) {
|
|
|
9906
11486
|
var theme = useTheme();
|
|
9907
11487
|
return (jsxs$1(Wrapper$2, __assign$1({ "data-testid": "total-wrapper" }, { children: [jsxs$1(GrandTotal, __assign$1({ color: theme.colors.shades['550'].color }, { children: [jsx$1(Currency, { children: currency }, void 0), total] }), void 0), saving && (jsxs$1(Container$l, __assign$1({ "data-testid": "subtotal-container", highlightColor: highlightColor }, { children: [jsx$1(Discount, { children: saving.savingText }, void 0), jsx$1(Discount, { children: saving.amount }, void 0)] }), void 0))] }), void 0));
|
|
9908
11488
|
};
|
|
9909
|
-
var templateObject_1$
|
|
11489
|
+
var templateObject_1$A, templateObject_2$o, templateObject_3$k, templateObject_4$f, templateObject_5$9;
|
|
9910
11490
|
|
|
9911
|
-
var Wrapper$1 = newStyled.div(templateObject_1$
|
|
11491
|
+
var Wrapper$1 = newStyled.div(templateObject_1$z || (templateObject_1$z = __makeTemplateObject(["\n color: ", ";\n"], ["\n color: ", ";\n"])), function (_a) {
|
|
9912
11492
|
var color = _a.color;
|
|
9913
11493
|
return color;
|
|
9914
11494
|
});
|
|
@@ -9926,14 +11506,14 @@ var Subtotal = function (_a) {
|
|
|
9926
11506
|
return (jsxs$1(ItemContainer, { children: [jsxs$1(CouponItem, __assign$1({ color: highlightColor }, { children: [coupon.couponText, " ", c.code, " ", coupon.appliedText] }), void 0), jsx$1(CouponItem, __assign$1({ color: highlightColor }, { children: c.amount }), void 0)] }, i));
|
|
9927
11507
|
})] }), void 0));
|
|
9928
11508
|
};
|
|
9929
|
-
var templateObject_1$
|
|
11509
|
+
var templateObject_1$z, templateObject_2$n, templateObject_3$j, templateObject_4$e;
|
|
9930
11510
|
|
|
9931
11511
|
var Totals = {
|
|
9932
11512
|
Total: Total,
|
|
9933
11513
|
Subtotal: Subtotal,
|
|
9934
11514
|
};
|
|
9935
11515
|
|
|
9936
|
-
var Container$k = newStyled.div(templateObject_1$
|
|
11516
|
+
var Container$k = newStyled.div(templateObject_1$y || (templateObject_1$y = __makeTemplateObject(["\n padding: 0.625rem 1.25rem;\n background-color: ", ";\n border-radius: 0.313rem;\n display: flex;\n margin-bottom: 0.938rem;\n"], ["\n padding: 0.625rem 1.25rem;\n background-color: ", ";\n border-radius: 0.313rem;\n display: flex;\n margin-bottom: 0.938rem;\n"])), function (props) { return props.color; });
|
|
9937
11517
|
var IconContainer$3 = newStyled.div(templateObject_2$m || (templateObject_2$m = __makeTemplateObject(["\n width: 1rem;\n height: 0.875rem;\n margin-right: 0.5rem;\n margin-top: 0.125rem;\n"], ["\n width: 1rem;\n height: 0.875rem;\n margin-right: 0.5rem;\n margin-top: 0.125rem;\n"])));
|
|
9938
11518
|
var Text$3 = newStyled.p(templateObject_3$i || (templateObject_3$i = __makeTemplateObject(["\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 400;\n margin: 0;\n color: ", ";\n"], ["\n font-size: 0.875rem;\n line-height: 1.375rem;\n font-weight: 400;\n margin: 0;\n color: ", ";\n"])), function (props) { return props.color; });
|
|
9939
11519
|
var Details = newStyled.span(templateObject_4$d || (templateObject_4$d = __makeTemplateObject(["\n color: ", ";\n font-weight: 700;\n"], ["\n color: ", ";\n font-weight: 700;\n"])), function (props) { return props.color; });
|
|
@@ -9941,7 +11521,7 @@ var Note = function (_a) {
|
|
|
9941
11521
|
var accentColor = _a.accentColor, color = _a.color, backgroundColor = _a.backgroundColor, importantNoteText = _a.importantNoteText, text = _a.text;
|
|
9942
11522
|
return (jsxs$1(Container$k, __assign$1({ color: backgroundColor, "data-testid": "Container" }, { children: [jsx$1(IconContainer$3, { children: jsx$1(Icon.Actions.LightExclamation, { fill: accentColor }, void 0) }, void 0), jsx$1("div", { children: jsxs$1(Text$3, __assign$1({ color: color }, { children: [jsxs$1(Details, __assign$1({ color: accentColor }, { children: [importantNoteText, ":"] }), void 0), " ", text] }), void 0) }, void 0)] }), void 0));
|
|
9943
11523
|
};
|
|
9944
|
-
var templateObject_1$
|
|
11524
|
+
var templateObject_1$y, templateObject_2$m, templateObject_3$i, templateObject_4$d;
|
|
9945
11525
|
|
|
9946
11526
|
/* eslint-disable no-param-reassign */
|
|
9947
11527
|
var index$1 = function (breakpoints) {
|
|
@@ -10027,7 +11607,7 @@ var mediaQueries = index$1(["@media(max-width: 900px)", "@media(min-width: 900px
|
|
|
10027
11607
|
literal: true,
|
|
10028
11608
|
});
|
|
10029
11609
|
|
|
10030
|
-
var Title$3 = newStyled.h1(templateObject_1$
|
|
11610
|
+
var Title$3 = newStyled.h1(templateObject_1$x || (templateObject_1$x = __makeTemplateObject(["\n color: ", ";\n font-size: 1.25rem;\n line-height: 1.75rem;\n font-weight: 600;\n margin: 0;\n text-align: center;\n"], ["\n color: ", ";\n font-size: 1.25rem;\n line-height: 1.75rem;\n font-weight: 600;\n margin: 0;\n text-align: center;\n"])), function (props) { return props.color; });
|
|
10031
11611
|
var Line = newStyled.div(templateObject_2$l || (templateObject_2$l = __makeTemplateObject(["\n width: 100%;\n height: 0.063rem;\n background-color: ", ";\n margin: 0.938rem 0;\n"], ["\n width: 100%;\n height: 0.063rem;\n background-color: ", ";\n margin: 0.938rem 0;\n"])), function (props) { return props.backgroundColor; });
|
|
10032
11612
|
var Row$1 = newStyled.div(templateObject_3$h || (templateObject_3$h = __makeTemplateObject(["\n display: flex;\n ", "\n justify-content: space-between;\n align-items: flex-start;\n"], ["\n display: flex;\n ", "\n justify-content: space-between;\n align-items: flex-start;\n"])), mediaQueries({
|
|
10033
11613
|
flexDirection: ['column', 'row'],
|
|
@@ -10056,27 +11636,27 @@ var DeliveryDetails = function (_a) {
|
|
|
10056
11636
|
var theme = useTheme();
|
|
10057
11637
|
return (jsxs$1("div", __assign$1({ "data-testid": "DeliveryDetails" }, { children: [jsx$1(Title$3, __assign$1({ color: theme.colors.pallete.secondary.color }, { children: deliveryDetailsText }), void 0), jsx$1(Line, { backgroundColor: theme.colors.shades['100'].color }, void 0), note && jsx$1(Note, __assign$1({}, note), void 0), jsxs$1(Row$1, __assign$1({ "data-testid": "DD-row", theme: theme }, { children: [jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.PDP.Clock, {}, void 0) }), void 0), arrivingBy.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: arrivingBy.details }), void 0)] }), void 0), jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.Navigation.MapMarker, {}, void 0) }), void 0), shippingTo.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: shippingTo.details }), void 0)] }), void 0), jsxs$1(Col$1, __assign$1({ theme: theme }, { children: [jsxs$1(SectionTitle, __assign$1({ theme: theme }, { children: [jsx$1(IconContainer$2, __assign$1({ theme: theme }, { children: jsx$1(Icon.Messaging.Messenger, {}, void 0) }), void 0), instantOrderUpdate.title] }), void 0), jsx$1(SectionDetails, __assign$1({ color: theme.colors.shades['700'].color }, { children: instantOrderUpdate.details }), void 0), jsxs$1(KeepMeUpdated, __assign$1({ onClick: instantOrderUpdate.keepMeUpdated.onClick, borderColor: theme.colors.shades['150'].color }, { children: [jsx$1(Icon.Messaging.Messenger, { width: 1, height: 1, fill: "#0078FF" }, void 0), instantOrderUpdate.keepMeUpdated.title] }), void 0)] }), void 0)] }), void 0)] }), void 0));
|
|
10058
11638
|
};
|
|
10059
|
-
var templateObject_1$
|
|
11639
|
+
var templateObject_1$x, templateObject_2$l, templateObject_3$h, templateObject_4$c, templateObject_5$8, templateObject_6$6, templateObject_7$3, templateObject_8$1;
|
|
10060
11640
|
|
|
10061
|
-
var Container$j = newStyled.div(templateObject_1$
|
|
11641
|
+
var Container$j = newStyled.div(templateObject_1$w || (templateObject_1$w = __makeTemplateObject(["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: none;\n"], ["\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n user-select: none;\n"])));
|
|
10062
11642
|
var H1$2 = newStyled.h1(templateObject_2$k || (templateObject_2$k = __makeTemplateObject(["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 700;\n color: ", ";\n margin-right: 0.313rem;\n"], ["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 700;\n color: ", ";\n margin-right: 0.313rem;\n"])), function (props) { return props.color; });
|
|
10063
11643
|
var ScrollToTop = function (_a) {
|
|
10064
11644
|
var scrollToTopText = _a.scrollToTopText, onClick = _a.onClick;
|
|
10065
11645
|
var theme = useTheme();
|
|
10066
11646
|
return (jsxs$1(Container$j, __assign$1({ onClick: onClick, "data-testid": "Container" }, { children: [jsx$1(H1$2, __assign$1({ color: theme.colors.shades['700'].color }, { children: scrollToTopText }), void 0), jsx$1(Icon.Arrows.ChevronUpSolid, { width: 1.375, height: 1.375, fill: theme.colors.pallete.primary.color }, void 0)] }), void 0));
|
|
10067
11647
|
};
|
|
10068
|
-
var templateObject_1$
|
|
11648
|
+
var templateObject_1$w, templateObject_2$k;
|
|
10069
11649
|
|
|
10070
|
-
var Container$i = newStyled.div(templateObject_1$
|
|
11650
|
+
var Container$i = newStyled.div(templateObject_1$v || (templateObject_1$v = __makeTemplateObject(["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #dfefeb;\n padding: 0.75rem 0;\n"], ["\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: #dfefeb;\n padding: 0.75rem 0;\n"])));
|
|
10071
11651
|
var H1$1 = newStyled.h1(templateObject_2$j || (templateObject_2$j = __makeTemplateObject(["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 600;\n color: ", ";\n margin-left: 0.625rem;\n"], ["\n margin: 0;\n font-size: 1rem;\n line-height: 1.5rem;\n font-weight: 600;\n color: ", ";\n margin-left: 0.625rem;\n"])), function (props) { return props.color; });
|
|
10072
11652
|
var OrderBar = function (_a) {
|
|
10073
11653
|
var message = _a.message;
|
|
10074
11654
|
var theme = useTheme();
|
|
10075
11655
|
return (jsxs$1(Container$i, { children: [jsx$1(Icon.Actions.Check, { width: 1.25, height: 0.875, fill: "#2F806A" }, void 0), jsx$1(H1$1, __assign$1({ color: theme.colors.shades['700'].color }, { children: message }), void 0)] }, void 0));
|
|
10076
11656
|
};
|
|
10077
|
-
var templateObject_1$
|
|
11657
|
+
var templateObject_1$v, templateObject_2$j;
|
|
10078
11658
|
|
|
10079
|
-
var TableElement = newStyled.table(templateObject_1$
|
|
11659
|
+
var TableElement = newStyled.table(templateObject_1$u || (templateObject_1$u = __makeTemplateObject(["\n box-sizing: border-box;\n border-radius: 0.5rem;\n border: 0.063rem solid ", ";\n border-spacing: 0;\n font-size: 0.875rem;\n line-height: 3.125rem;\n width: 100%;\n color: ", ";\n"], ["\n box-sizing: border-box;\n border-radius: 0.5rem;\n border: 0.063rem solid ", ";\n border-spacing: 0;\n font-size: 0.875rem;\n line-height: 3.125rem;\n width: 100%;\n color: ", ";\n"])), function (props) { return props.borderColor; }, function (props) { return props.color; });
|
|
10080
11660
|
var TableCell = newStyled.td(templateObject_2$i || (templateObject_2$i = __makeTemplateObject(["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n padding: 0 1.25rem;\n text-align: center;\n\n &:last-child {\n border-right: none;\n }\n\n &:first-of-type {\n font-weight: 700;\n }\n"], ["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n padding: 0 1.25rem;\n text-align: center;\n\n &:last-child {\n border-right: none;\n }\n\n &:first-of-type {\n font-weight: 700;\n }\n"])), function (props) { return props.borderColor; }, function (props) { return props.borderColor; });
|
|
10081
11661
|
var TableHead = newStyled.th(templateObject_3$g || (templateObject_3$g = __makeTemplateObject(["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n font-weight: 700;\n\n &:last-child {\n border-right: none;\n }\n"], ["\n border-bottom: 0.063rem solid ", ";\n border-right: 0.063rem solid ", ";\n font-weight: 700;\n\n &:last-child {\n border-right: none;\n }\n"])), function (props) { return props.borderColor; }, function (props) { return props.borderColor; });
|
|
10082
11662
|
var TableRow = newStyled.tr(templateObject_4$b || (templateObject_4$b = __makeTemplateObject(["\n &:last-child {\n td {\n border-bottom: none;\n }\n }\n\n &.background {\n background-color: ", ";\n }\n"], ["\n &:last-child {\n td {\n border-bottom: none;\n }\n }\n\n &.background {\n background-color: ", ";\n }\n"])), function (props) { return props.backgroundColor; });
|
|
@@ -10085,7 +11665,14 @@ var SizeTable = function (_a) {
|
|
|
10085
11665
|
var theme = useTheme();
|
|
10086
11666
|
return (jsxs$1(TableElement, __assign$1({ color: theme.colors.shades['700'].color, borderColor: theme.colors.shades['100'].color }, { children: [jsx$1("thead", { children: jsx$1(TableRow, __assign$1({ backgroundColor: theme.colors.shades['10'].color }, { children: headers.map(function (header, index) { return (jsx$1(TableHead, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: header }), index)); }) }), void 0) }, void 0), jsx$1("tbody", { children: data.map(function (row, index) { return (jsx$1(TableRow, __assign$1({ className: index % 2 !== 0 ? '' : 'background', backgroundColor: theme.colors.shades['10'].color }, { children: row.map(function (cell, index) { return (jsx$1(TableCell, __assign$1({ borderColor: theme.colors.shades['100'].color }, { children: cell }), index)); }) }), index)); }) }, void 0)] }), void 0));
|
|
10087
11667
|
};
|
|
10088
|
-
var templateObject_1$
|
|
11668
|
+
var templateObject_1$u, templateObject_2$i, templateObject_3$g, templateObject_4$b;
|
|
11669
|
+
|
|
11670
|
+
var Img = newStyled.img(templateObject_1$t || (templateObject_1$t = __makeTemplateObject(["\n height: ", ";\n width: ", ";\n border-radius: ", ";\n object-fit: ", ";\n object-position: ", ";\n"], ["\n height: ", ";\n width: ", ";\n border-radius: ", ";\n object-fit: ", ";\n object-position: ", ";\n"])), function (props) { return props.height; }, function (props) { return props.width; }, function (props) { return props.borderRadius; }, function (props) { return props.objectFit; }, function (props) { return props.objectPosition; });
|
|
11671
|
+
var Image = function (_a) {
|
|
11672
|
+
var src = _a.src, alt = _a.alt, height = _a.height, width = _a.width, borderRadius = _a.borderRadius, objectFit = _a.objectFit, objectPosition = _a.objectPosition, className = _a.className;
|
|
11673
|
+
return (jsx$1(Img, { src: src, alt: alt, height: height, width: width, borderRadius: borderRadius, objectFit: objectFit, objectPosition: objectPosition, className: className }, void 0));
|
|
11674
|
+
};
|
|
11675
|
+
var templateObject_1$t;
|
|
10089
11676
|
|
|
10090
11677
|
var Container$h = newStyled.div(templateObject_1$s || (templateObject_1$s = __makeTemplateObject(["\n display: flex;\n flex-direction: row;\n width: auto;\n"], ["\n display: flex;\n flex-direction: row;\n width: auto;\n"])));
|
|
10091
11678
|
var ImageContainer$1 = newStyled.div(templateObject_2$h || (templateObject_2$h = __makeTemplateObject(["\n position: relative;\n"], ["\n position: relative;\n"])));
|
|
@@ -10928,16 +12515,16 @@ function useSwipeable(options) {
|
|
|
10928
12515
|
return handlers;
|
|
10929
12516
|
}
|
|
10930
12517
|
|
|
10931
|
-
var Container$7 = newStyled.div(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n position: relative;\n max-height: 31.875rem;\n"], ["\n position: relative;\n max-height: 31.875rem;\n"])));
|
|
12518
|
+
var Container$7 = newStyled.div(templateObject_1$e || (templateObject_1$e = __makeTemplateObject(["\n position: relative;\n max-height: 31.875rem;\n overflow: hidden;\n"], ["\n position: relative;\n max-height: 31.875rem;\n overflow: hidden;\n"])));
|
|
10932
12519
|
var TopTagContainer = newStyled.div(templateObject_2$7 || (templateObject_2$7 = __makeTemplateObject(["\n position: absolute;\n left: 0;\n top: 0;\n"], ["\n position: absolute;\n left: 0;\n top: 0;\n"])));
|
|
10933
12520
|
var BottomTagContainer = newStyled.div(templateObject_3$7 || (templateObject_3$7 = __makeTemplateObject(["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"], ["\n position: absolute;\n bottom: 3.75rem;\n left: 0;\n"])));
|
|
10934
12521
|
var ImageProductWithTags = forwardRef(function ImageProductWithTags(_a, ref) {
|
|
10935
12522
|
var image = _a.image, topTag = _a.topTag, bottomTag = _a.bottomTag, testId = _a.testId;
|
|
10936
|
-
return (jsxs$1(Container$7, __assign$1({ "data-testid": testId, ref: ref }, { children: [jsx$1(
|
|
12523
|
+
return (jsxs$1(Container$7, __assign$1({ "data-testid": testId, ref: ref }, { children: [jsx$1(InnerImageZoom, { src: image.imageUrl, zoomSrc: image.imageUrl, zoomType: "hover", imgAttributes: { alt: image.alt, width: '100%', height: '510px' }, height: 510, fullscreenOnMobile: true, className: "zoomWrapper" }, void 0), jsx$1(TopTagContainer, { children: topTag }, void 0), jsx$1(BottomTagContainer, { children: bottomTag }, void 0)] }), void 0));
|
|
10937
12524
|
});
|
|
10938
12525
|
var templateObject_1$e, templateObject_2$7, templateObject_3$7;
|
|
10939
12526
|
|
|
10940
|
-
var Button = newStyled.button(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n background: transparent;\n border: none;\n padding: 0.188rem 0.625rem;\n"], ["\n background: transparent;\n border: none;\n padding: 0.188rem 0.625rem;\n"])));
|
|
12527
|
+
var Button = newStyled.button(templateObject_1$d || (templateObject_1$d = __makeTemplateObject(["\n background: transparent;\n border: none;\n padding: 0.188rem 0.625rem;\n z-index: 5;\n top: calc(50% - 40px);\n height: 40px !important;\n"], ["\n background: transparent;\n border: none;\n padding: 0.188rem 0.625rem;\n z-index: 5;\n top: calc(50% - 40px);\n height: 40px !important;\n"])));
|
|
10941
12528
|
var ArrowButton = function (_a) {
|
|
10942
12529
|
var Icon = _a.Icon, onClick = _a.onClick, className = _a.className;
|
|
10943
12530
|
return (jsx$1(Button, __assign$1({ className: className, type: "button", onClick: onClick }, { children: Icon }), void 0));
|
|
@@ -10983,18 +12570,12 @@ var ProductGalleryMobile = function (_a) {
|
|
|
10983
12570
|
}, [selectedValue, images]);
|
|
10984
12571
|
var _c = useState(function () { return images[index]; }), selectedImage = _c[0], setSelectedImage = _c[1];
|
|
10985
12572
|
var handlers = useSwipeable({
|
|
10986
|
-
|
|
10987
|
-
|
|
10988
|
-
setIndex(function (index) {
|
|
10989
|
-
if (dir === 'Left') {
|
|
10990
|
-
return Math.min(index + 1, images.length - 1);
|
|
10991
|
-
}
|
|
10992
|
-
if (dir === 'Right') {
|
|
10993
|
-
return Math.max(index - 1, 0);
|
|
10994
|
-
}
|
|
10995
|
-
return index;
|
|
10996
|
-
});
|
|
12573
|
+
onSwipedLeft: useCallback(function () {
|
|
12574
|
+
setIndex(function (index) { return Math.min(index + 1, images.length - 1); });
|
|
10997
12575
|
}, [images.length]),
|
|
12576
|
+
onSwipedRight: useCallback(function () {
|
|
12577
|
+
setIndex(function (index) { return Math.max(index - 1, 0); });
|
|
12578
|
+
}, []),
|
|
10998
12579
|
});
|
|
10999
12580
|
useEffect(function () {
|
|
11000
12581
|
setSelectedImage(images[index]);
|