ecars-web-lib 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Dropdown/DropdownComponent.d.ts +2 -1
- package/dist/components/Dropdown/constants.d.ts +5 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.es.js +6 -5
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { FC } from 'react';
|
|
2
2
|
import { ElementProps } from '../../services/types';
|
|
3
|
-
import { DropdownProps } from './constants';
|
|
3
|
+
import { DropdownProps, DropdownThemeType } from './constants';
|
|
4
4
|
export interface Props extends ElementProps, DropdownProps {
|
|
5
5
|
handleOpen: () => void;
|
|
6
6
|
onClickOutside: (isOpen: boolean) => void;
|
|
7
7
|
isOpen: boolean;
|
|
8
|
+
theme: DropdownThemeType;
|
|
8
9
|
}
|
|
9
10
|
export declare const DropdownComponent: FC<Props>;
|
|
@@ -9,3 +9,8 @@ export interface DropdownProps {
|
|
|
9
9
|
options: DropdownOption[];
|
|
10
10
|
}
|
|
11
11
|
export declare const DROPDOWN_TEST_ID = "dropdownTestId";
|
|
12
|
+
export declare const DROPDOWN_THEME: Readonly<{
|
|
13
|
+
DARK: "dark";
|
|
14
|
+
LIGHT: "light";
|
|
15
|
+
}>;
|
|
16
|
+
export type DropdownThemeType = (typeof DROPDOWN_THEME)[keyof typeof DROPDOWN_THEME];
|
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const cr=require("clsx"),P=require("react"),w=require("react/jsx-runtime"),ur=require("react-image-gallery"),fr=require("rc-slider");function pr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=pr(P),k=(e="",t,...r)=>{const n=e?`${e}__${t} ${t}`:t;return cr.clsx(n,r)},Tt=e=>e.charAt(0).toUpperCase()+e.slice(1);var yt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},at=P.createContext&&P.createContext(yt),hr=["attr","size","title"];function mr(e,t){if(e==null)return{};var r=gr(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gr(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},be.apply(this,arguments)}function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ot(Object(r),!0).forEach(function(n){vr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vr(e,t,r){return t=wr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wr(e){var t=Sr(e,"string");return typeof t=="symbol"?t:t+""}function Sr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Et(e){return e&&e.map((t,r)=>P.createElement(t.tag,Te({key:r},t.attr),Et(t.child)))}function $(e){return t=>P.createElement(xr,be({attr:Te({},e.attr)},t),Et(e.child))}function xr(e){var t=r=>{var{attr:n,size:i,title:s}=e,o=mr(e,hr),a=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),P.createElement("svg",be({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:l,style:Te(Te({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&P.createElement("title",null,s),e.children)};return at!==void 0?P.createElement(at.Consumer,null,r=>t(r)):t(yt)}function br(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(e)}function Tr(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},child:[]}]})(e)}function yr(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"},child:[]}]})(e)}function Er(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"},child:[]}]})(e)}function Cr(e){return $({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"},child:[]}]})(e)}function Pr(e){return $({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"},child:[]}]})(e)}function Ir(e){return $({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M278.6 256l68.2-68.2c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-68.2-68.2c-6.2-6.2-16.4-6.2-22.6 0-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3l68.2 68.2-68.2 68.2c-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3 6.2 6.2 16.4 6.2 22.6 0l68.2-68.2 68.2 68.2c6.2 6.2 16.4 6.2 22.6 0 6.2-6.2 6.2-16.4 0-22.6L278.6 256z"},child:[]}]})(e)}function Mr(e){return $({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M260.062 32C138.605 32 40.134 129.701 40.134 250.232c0 41.23 11.532 79.79 31.559 112.687L32 480l121.764-38.682c31.508 17.285 67.745 27.146 106.298 27.146C381.535 468.464 480 370.749 480 250.232 480 129.701 381.535 32 260.062 32zm109.362 301.11c-5.174 12.827-28.574 24.533-38.899 25.072-10.314.547-10.608 7.994-66.84-16.434-56.225-24.434-90.052-83.844-92.719-87.67-2.669-3.812-21.78-31.047-20.749-58.455 1.038-27.413 16.047-40.346 21.404-45.725 5.351-5.387 11.486-6.352 15.232-6.413 4.428-.072 7.296-.132 10.573-.011 3.274.124 8.192-.685 12.45 10.639 4.256 11.323 14.443 39.153 15.746 41.989 1.302 2.839 2.108 6.126.102 9.771-2.012 3.653-3.042 5.935-5.961 9.083-2.935 3.148-6.174 7.042-8.792 9.449-2.92 2.665-5.97 5.572-2.9 11.269 3.068 5.693 13.653 24.356 29.779 39.736 20.725 19.771 38.598 26.329 44.098 29.317 5.515 3.004 8.806 2.67 12.226-.929 3.404-3.599 14.639-15.746 18.596-21.169 3.955-5.438 7.661-4.373 12.742-2.329 5.078 2.052 32.157 16.556 37.673 19.551 5.51 2.989 9.193 4.529 10.51 6.9 1.317 2.38.901 13.531-4.271 26.359z"},child:[]}]})(e)}function Or(e){return $({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"},child:[]}]})(e)}function _r(e){return $({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function Lr(e){return $({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M923 283.6a260.04 260.04 0 0 0-56.9-82.8 264.4 264.4 0 0 0-84-55.5A265.34 265.34 0 0 0 679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 0 0-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9z"},child:[]}]})(e)}function Ar(e){return $({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 378.7c-73.4 0-133.3 59.9-133.3 133.3S438.6 645.3 512 645.3 645.3 585.4 645.3 512 585.4 378.7 512 378.7zM911.8 512c0-55.2.5-109.9-2.6-165-3.1-64-17.7-120.8-64.5-167.6-46.9-46.9-103.6-61.4-167.6-64.5-55.2-3.1-109.9-2.6-165-2.6-55.2 0-109.9-.5-165 2.6-64 3.1-120.8 17.7-167.6 64.5C132.6 226.3 118.1 283 115 347c-3.1 55.2-2.6 109.9-2.6 165s-.5 109.9 2.6 165c3.1 64 17.7 120.8 64.5 167.6 46.9 46.9 103.6 61.4 167.6 64.5 55.2 3.1 109.9 2.6 165 2.6 55.2 0 109.9.5 165-2.6 64-3.1 120.8-17.7 167.6-64.5 46.9-46.9 61.4-103.6 64.5-167.6 3.2-55.1 2.6-109.8 2.6-165zM512 717.1c-113.5 0-205.1-91.6-205.1-205.1S398.5 306.9 512 306.9 717.1 398.5 717.1 512 625.5 717.1 512 717.1zm213.5-370.7c-26.5 0-47.9-21.4-47.9-47.9s21.4-47.9 47.9-47.9 47.9 21.4 47.9 47.9a47.84 47.84 0 0 1-47.9 47.9z"},child:[]}]})(e)}function Nr(e){return $({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M923 283.6a260.04 260.04 0 0 0-56.9-82.8 264.4 264.4 0 0 0-84-55.5A265.34 265.34 0 0 0 679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 0 0-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9zM512 814.8S156 586.7 156 385.5C156 283.6 240.3 201 344.3 201c73.1 0 136.5 40.8 167.7 100.4C543.2 241.8 606.6 201 679.7 201c104 0 188.3 82.6 188.3 184.5 0 201.2-356 429.3-356 429.3z"},child:[]}]})(e)}const W={ArrowNarrowRight:Er,ArrowNarrowLeft:yr,ArrowNarrowDown:Tr,Check:Pr,Close:Ir,Facebook:Or,Twitter:Cr,Youtube:_r,Instagram:Ar,Whatsapp:Mr,Email:br},Rr=["Option 1","Option 2","Another Option"],kr=100,zr=10,Dr=Array.from({length:6},e=>({original:"src/assets/react.svg",thumbnail:"src/assets/react.svg"})),jr=[{value:"1"},{value:"2"}],Br=[10,500],Fr=[1,2,3],$r=Object.freeze({GUIDES:"guides",REVIEWS:"reviews",NEWS:"news"}),Ct="categoryTestId",Be=(e,t)=>{if(!e)return e;if(Array.isArray(e))return e.map(s=>Be(s,t));if(!P.isValidElement(e)||!P.isValidElement(e))return e;const r=e.props.block??t,n=e.props.block?{}:{block:t},i=e.props.children?Be(e.props.children,r):e.props.children;return P.cloneElement(e,n,i)},Ue=(e,t,r)=>({children:n,block:i=t,...s})=>{const o=Be(n,i);return w.jsx(e,{...s,block:i,className:[r,t].filter(Boolean).join(" "),children:o})},Ye=e=>{const t=P.useRef(null),r=P.useMemo(()=>{var n;return{height:e?(n=t.current)==null?void 0:n.scrollHeight:0}},[e]);return{contentRef:t,style:r}},Gr=e=>{const[t,r]=P.useState(!1);return P.useEffect(()=>{const n=window.matchMedia(e);n.matches!==t&&r(n.matches);const i=()=>{r(n.matches)};return n.addEventListener("change",i),()=>{n.removeEventListener("change",i)}},[t,e]),t},qe=e=>{const t=P.useRef(null);return P.useEffect(()=>{const r=n=>{const i=n.target;t.current&&i instanceof Node&&!t.current.contains(i)&&e(!1)};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t,e]),t},Vr=({category:e,block:t})=>{const r=k(t,"category",`category--${e}`);return w.jsx("span",{"data-testid":Ct,className:r,children:Tt(e)})},Hr=({id:e,block:t,...r})=>w.jsxs(ve.Block,{htmlFor:e,block:t,children:[w.jsx(ve.Input,{...r,id:e}),w.jsx(ve.Indicator,{})]}),Wr="checkboxTestId",Ur="checkboxTestInputId",Yr=({children:e,block:t,htmlFor:r="checkbox"})=>{const n=k(t,"checkbox");return w.jsx("label",{"data-testid":Wr,className:n,htmlFor:r,children:e})},qr=()=>w.jsx("span",{className:"checkbox__indicator",children:w.jsx(W.Check,{})}),Xr=({onChange:e,id:t="checkbox",checked:r=!1,disabled:n=!1,name:i="checkbox",hasError:s=!1})=>{const o=k("","checkbox__input",{error:s}),a=l=>{e&&e(l.target.checked)};return w.jsx("input",{"data-testid":Ur,name:i,disabled:n,className:o,checked:r,onChange:a,id:t,type:"checkbox"})},ve=Object.assign(Hr,{Block:Yr,Indicator:qr,Input:Xr}),Kr="dropdownTestId",Jr=({category:e,block:t,options:r,onSelect:n,handleOpen:i,isOpen:s,onClickOutside:o})=>{const a=r.find(d=>d.value===e),l=qe(o);return w.jsxs("div",{"data-testid":Kr,ref:l,className:k(t,"dropdown-menu",{"_dropdown-active":s}),children:[w.jsx(ce.Block,{children:w.jsx(ce.Category,{handleOpen:i,item:a})}),w.jsx(ce.List,{onSelect:n,options:r,category:e})]})},Qr=({category:e,options:t,onSelect:r})=>w.jsx("ul",{className:"dropdown-menu__list",children:t.map(n=>{const{value:i,label:s}=n,o=i===e;return w.jsx(ce.Option,{value:i,label:s,onSelect:r,isSelected:o},i)})}),Zr=({label:e,value:t,isSelected:r,onSelect:n})=>{const i=()=>{n(t)};return w.jsxs("li",{onClick:i,className:k("","dropdown-menu__option",{"_selected-option":r}),children:[e&&e," ",t]})},en=({item:e,handleOpen:t})=>w.jsxs("button",{onClick:t,className:"dropdown-menu__category",children:[e==null?void 0:e.label,e==null?void 0:e.value,w.jsx(W.ArrowNarrowDown,{className:"dropdown-menu__arrow"})]}),tn=({children:e})=>w.jsx("div",{className:"dropdown-menu__block",children:e}),ce=Object.assign(Jr,{List:Qr,Option:Zr,Category:en,Block:tn}),rn="favButtonTestId",nn=({disabled:e,block:t,isFavorite:r,type:n,onClick:i})=>{const s=k(t,"favorite-button",`favorite-button--${n}`,{active:r});return w.jsx("button",{"data-testid":rn,disabled:e,className:s,onClick:i,type:"button",children:r?w.jsx(Lr,{}):w.jsx(Nr,{})})},sn="fieldTestId",an="fieldLabelTestId",on=({label:e,block:t,children:r,error:n,id:i="input"})=>{const s=k(t,"field");return w.jsxs("div",{"data-testid":sn,className:s,children:[!!e&&w.jsx(Fe.Label,{text:e,htmlFor:i}),P.cloneElement(r,{id:i,hasError:!!n}),!!n&&w.jsx(Fe.Error,{errorText:n})]})},ln=({text:e,htmlFor:t="input"})=>w.jsx("label",{"data-testid":an,className:"field__label",htmlFor:t,children:e}),dn=({errorText:e})=>w.jsx("p",{className:"field__error",children:e}),Fe=Object.assign(on,{Label:ln,Error:dn}),cn=({children:e})=>w.jsx("div",{className:"filter-accordion__block",children:e}),Pt="filter-accordion",un="filterAccordionTestId",fn=Ue(cn,Pt),pn=({onClick:e,title:t,isOpen:r,children:n})=>w.jsxs(se.Layout,{isOpen:r,children:[w.jsxs(se.Block,{block:Pt,children:[w.jsx("h2",{className:"filter-accordion__title",children:t}),w.jsx(se.Reset,{}),w.jsx(se.Arrow,{onClick:e})]}),w.jsx(se.Content,{isOpen:r,children:n})]}),hn=({isOpen:e,block:t,children:r})=>w.jsx("div",{"data-testid":un,className:k(t,"filter-accordion",{"_active-accordion":e}),children:r}),mn=({onClick:e})=>w.jsx("button",{onClick:e,className:"filter-accordion__arrow",children:w.jsx(W.ArrowNarrowDown,{})}),gn="buttonTestId",Xe=({children:e,size:t,color:r,onClick:n,type:i="button",disabled:s=!1,isTransparent:o=!1,withIcon:a=!1,block:l})=>{const d=k(l,"button",`button--${t} button--${r}`,{"button--transparent":o,"button--icon":a});return w.jsx("button",{"data-testid":gn,disabled:s,type:i,className:d,onClick:n,children:e})},vn=({block:e})=>w.jsx(Xe,{block:e,isTransparent:!0,size:"small",color:"gray",children:"Reset"}),wn=({isOpen:e,children:t})=>{const{style:r,contentRef:n}=Ye(e);return w.jsx("div",{style:r,ref:n,className:"filter-accordion__content",children:w.jsx("div",{className:"filter-accordion__body",children:t})})},se=Object.assign(pn,{Layout:hn,Arrow:mn,Reset:vn,Block:fn,Content:wn}),Sn="leftIconButtonTestId",xn="rightIconButtonTestId",It=({RightIcon:e,LeftIcon:t,children:r,className:n,...i})=>w.jsxs(Xe,{withIcon:!0,...i,children:[!!t&&w.jsx(t,{className:n,"data-testid":Sn}),r,!!e&&w.jsx(e,{className:n,"data-testid":xn})]}),bn=({children:e,onClick:t,block:r})=>w.jsx(It,{type:"button",block:r,onClick:t,className:"button__close",RightIcon:W.Close,size:"small",color:"gray",children:e}),Tn=({images:e,block:t})=>w.jsx(ur,{items:e,additionalClass:t,showFullscreenButton:!1,showPlayButton:!1}),yn="inputTestId",Mt=({value:e,onChange:t,hasError:r,placeholder:n,block:i,disabled:s=!1,type:o="text",id:a="input",name:l="input",isReadOnly:d=!1,isTransparent:c=!1})=>{const u=k(i,"input",{error:r,transparent:c}),f=m=>{t&&t(m.currentTarget.value)};return w.jsx("input",{readOnly:d,onChange:f,disabled:s,autoComplete:"off","data-testid":yn,className:u,id:a,name:l,placeholder:n,value:e,type:o})};var le={},lt;function En(){if(lt)return le;lt=1,Object.defineProperty(le,"__esModule",{value:!0}),le.parse=o,le.serialize=d;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function o(f,m){const p=new s,v=f.length;if(v<2)return p;const b=(m==null?void 0:m.decode)||c;let h=0;do{const g=f.indexOf("=",h);if(g===-1)break;const S=f.indexOf(";",h),C=S===-1?v:S;if(g>C){h=f.lastIndexOf(";",g-1)+1;continue}const y=a(f,h,g),_=l(f,g,y),O=f.slice(y,_);if(p[O]===void 0){let I=a(f,g+1,C),E=l(f,C,I);const T=b(f.slice(I,E));p[O]=T}h=C+1}while(h<v);return p}function a(f,m,p){do{const v=f.charCodeAt(m);if(v!==32&&v!==9)return m}while(++m<p);return p}function l(f,m,p){for(;m>p;){const v=f.charCodeAt(--m);if(v!==32&&v!==9)return m+1}return p}function d(f,m,p){const v=(p==null?void 0:p.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const b=v(m);if(!t.test(b))throw new TypeError(`argument val is invalid: ${m}`);let h=f+"="+b;if(!p)return h;if(p.maxAge!==void 0){if(!Number.isInteger(p.maxAge))throw new TypeError(`option maxAge is invalid: ${p.maxAge}`);h+="; Max-Age="+p.maxAge}if(p.domain){if(!r.test(p.domain))throw new TypeError(`option domain is invalid: ${p.domain}`);h+="; Domain="+p.domain}if(p.path){if(!n.test(p.path))throw new TypeError(`option path is invalid: ${p.path}`);h+="; Path="+p.path}if(p.expires){if(!u(p.expires)||!Number.isFinite(p.expires.valueOf()))throw new TypeError(`option expires is invalid: ${p.expires}`);h+="; Expires="+p.expires.toUTCString()}if(p.httpOnly&&(h+="; HttpOnly"),p.secure&&(h+="; Secure"),p.partitioned&&(h+="; Partitioned"),p.priority)switch(typeof p.priority=="string"?p.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${p.priority}`)}if(p.sameSite)switch(typeof p.sameSite=="string"?p.sameSite.toLowerCase():p.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${p.sameSite}`)}return h}function c(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function u(f){return i.call(f)==="[object Date]"}return le}En();/**
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require('./index.css');const cr=require("clsx"),P=require("react"),w=require("react/jsx-runtime"),ur=require("react-image-gallery"),fr=require("rc-slider");function pr(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const x=pr(P),k=(e="",t,...r)=>{const n=e?`${e}__${t} ${t}`:t;return cr.clsx(n,r)},Tt=e=>e.charAt(0).toUpperCase()+e.slice(1);var yt={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},at=P.createContext&&P.createContext(yt),hr=["attr","size","title"];function mr(e,t){if(e==null)return{};var r=gr(e,t),n,i;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(i=0;i<s.length;i++)n=s[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function gr(e,t){if(e==null)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}function be(){return be=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},be.apply(this,arguments)}function ot(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ot(Object(r),!0).forEach(function(n){vr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ot(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vr(e,t,r){return t=wr(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wr(e){var t=Sr(e,"string");return typeof t=="symbol"?t:t+""}function Sr(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Et(e){return e&&e.map((t,r)=>P.createElement(t.tag,Te({key:r},t.attr),Et(t.child)))}function $(e){return t=>P.createElement(xr,be({attr:Te({},e.attr)},t),Et(e.child))}function xr(e){var t=r=>{var{attr:n,size:i,title:s}=e,o=mr(e,hr),a=i||r.size||"1em",l;return r.className&&(l=r.className),e.className&&(l=(l?l+" ":"")+e.className),P.createElement("svg",be({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},r.attr,n,o,{className:l,style:Te(Te({color:e.color||r.color},r.style),e.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),s&&P.createElement("title",null,s),e.children)};return at!==void 0?P.createElement(at.Consumer,null,r=>t(r)):t(yt)}function br(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(e)}function Tr(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"},child:[]}]})(e)}function yr(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6 1.41-1.41z"},child:[]}]})(e)}function Er(e){return $({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6-1.41-1.41z"},child:[]}]})(e)}function Cr(e){return $({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z"},child:[]}]})(e)}function Pr(e){return $({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"},child:[]}]})(e)}function Ir(e){return $({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M278.6 256l68.2-68.2c6.2-6.2 6.2-16.4 0-22.6-6.2-6.2-16.4-6.2-22.6 0L256 233.4l-68.2-68.2c-6.2-6.2-16.4-6.2-22.6 0-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3l68.2 68.2-68.2 68.2c-3.1 3.1-4.7 7.2-4.7 11.3 0 4.1 1.6 8.2 4.7 11.3 6.2 6.2 16.4 6.2 22.6 0l68.2-68.2 68.2 68.2c6.2 6.2 16.4 6.2 22.6 0 6.2-6.2 6.2-16.4 0-22.6L278.6 256z"},child:[]}]})(e)}function Mr(e){return $({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M260.062 32C138.605 32 40.134 129.701 40.134 250.232c0 41.23 11.532 79.79 31.559 112.687L32 480l121.764-38.682c31.508 17.285 67.745 27.146 106.298 27.146C381.535 468.464 480 370.749 480 250.232 480 129.701 381.535 32 260.062 32zm109.362 301.11c-5.174 12.827-28.574 24.533-38.899 25.072-10.314.547-10.608 7.994-66.84-16.434-56.225-24.434-90.052-83.844-92.719-87.67-2.669-3.812-21.78-31.047-20.749-58.455 1.038-27.413 16.047-40.346 21.404-45.725 5.351-5.387 11.486-6.352 15.232-6.413 4.428-.072 7.296-.132 10.573-.011 3.274.124 8.192-.685 12.45 10.639 4.256 11.323 14.443 39.153 15.746 41.989 1.302 2.839 2.108 6.126.102 9.771-2.012 3.653-3.042 5.935-5.961 9.083-2.935 3.148-6.174 7.042-8.792 9.449-2.92 2.665-5.97 5.572-2.9 11.269 3.068 5.693 13.653 24.356 29.779 39.736 20.725 19.771 38.598 26.329 44.098 29.317 5.515 3.004 8.806 2.67 12.226-.929 3.404-3.599 14.639-15.746 18.596-21.169 3.955-5.438 7.661-4.373 12.742-2.329 5.078 2.052 32.157 16.556 37.673 19.551 5.51 2.989 9.193 4.529 10.51 6.9 1.317 2.38.901 13.531-4.271 26.359z"},child:[]}]})(e)}function Or(e){return $({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M279.14 288l14.22-92.66h-88.91v-60.13c0-25.35 12.42-50.06 52.24-50.06h40.42V6.26S260.43 0 225.36 0c-73.22 0-121.08 44.38-121.08 124.72v70.62H22.89V288h81.39v224h100.17V288z"},child:[]}]})(e)}function _r(e){return $({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M549.655 124.083c-6.281-23.65-24.787-42.276-48.284-48.597C458.781 64 288 64 288 64S117.22 64 74.629 75.486c-23.497 6.322-42.003 24.947-48.284 48.597-11.412 42.867-11.412 132.305-11.412 132.305s0 89.438 11.412 132.305c6.281 23.65 24.787 41.5 48.284 47.821C117.22 448 288 448 288 448s170.78 0 213.371-11.486c23.497-6.321 42.003-24.171 48.284-47.821 11.412-42.867 11.412-132.305 11.412-132.305s0-89.438-11.412-132.305zm-317.51 213.508V175.185l142.739 81.205-142.739 81.201z"},child:[]}]})(e)}function Lr(e){return $({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M923 283.6a260.04 260.04 0 0 0-56.9-82.8 264.4 264.4 0 0 0-84-55.5A265.34 265.34 0 0 0 679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 0 0-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9z"},child:[]}]})(e)}function Ar(e){return $({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M512 378.7c-73.4 0-133.3 59.9-133.3 133.3S438.6 645.3 512 645.3 645.3 585.4 645.3 512 585.4 378.7 512 378.7zM911.8 512c0-55.2.5-109.9-2.6-165-3.1-64-17.7-120.8-64.5-167.6-46.9-46.9-103.6-61.4-167.6-64.5-55.2-3.1-109.9-2.6-165-2.6-55.2 0-109.9-.5-165 2.6-64 3.1-120.8 17.7-167.6 64.5C132.6 226.3 118.1 283 115 347c-3.1 55.2-2.6 109.9-2.6 165s-.5 109.9 2.6 165c3.1 64 17.7 120.8 64.5 167.6 46.9 46.9 103.6 61.4 167.6 64.5 55.2 3.1 109.9 2.6 165 2.6 55.2 0 109.9.5 165-2.6 64-3.1 120.8-17.7 167.6-64.5 46.9-46.9 61.4-103.6 64.5-167.6 3.2-55.1 2.6-109.8 2.6-165zM512 717.1c-113.5 0-205.1-91.6-205.1-205.1S398.5 306.9 512 306.9 717.1 398.5 717.1 512 625.5 717.1 512 717.1zm213.5-370.7c-26.5 0-47.9-21.4-47.9-47.9s21.4-47.9 47.9-47.9 47.9 21.4 47.9 47.9a47.84 47.84 0 0 1-47.9 47.9z"},child:[]}]})(e)}function Nr(e){return $({attr:{viewBox:"0 0 1024 1024"},child:[{tag:"path",attr:{d:"M923 283.6a260.04 260.04 0 0 0-56.9-82.8 264.4 264.4 0 0 0-84-55.5A265.34 265.34 0 0 0 679.7 125c-49.3 0-97.4 13.5-139.2 39-10 6.1-19.5 12.8-28.5 20.1-9-7.3-18.5-14-28.5-20.1-41.8-25.5-89.9-39-139.2-39-35.5 0-69.9 6.8-102.4 20.3-31.4 13-59.7 31.7-84 55.5a258.44 258.44 0 0 0-56.9 82.8c-13.9 32.3-21 66.6-21 101.9 0 33.3 6.8 68 20.3 103.3 11.3 29.5 27.5 60.1 48.2 91 32.8 48.9 77.9 99.9 133.9 151.6 92.8 85.7 184.7 144.9 188.6 147.3l23.7 15.2c10.5 6.7 24 6.7 34.5 0l23.7-15.2c3.9-2.5 95.7-61.6 188.6-147.3 56-51.7 101.1-102.7 133.9-151.6 20.7-30.9 37-61.5 48.2-91 13.5-35.3 20.3-70 20.3-103.3.1-35.3-7-69.6-20.9-101.9zM512 814.8S156 586.7 156 385.5C156 283.6 240.3 201 344.3 201c73.1 0 136.5 40.8 167.7 100.4C543.2 241.8 606.6 201 679.7 201c104 0 188.3 82.6 188.3 184.5 0 201.2-356 429.3-356 429.3z"},child:[]}]})(e)}const W={ArrowNarrowRight:Er,ArrowNarrowLeft:yr,ArrowNarrowDown:Tr,Check:Pr,Close:Ir,Facebook:Or,Twitter:Cr,Youtube:_r,Instagram:Ar,Whatsapp:Mr,Email:br},Rr=["Option 1","Option 2","Another Option"],kr=100,zr=10,Dr=Array.from({length:6},e=>({original:"src/assets/react.svg",thumbnail:"src/assets/react.svg"})),jr=[{value:"1"},{value:"2"}],Br=[10,500],Fr=[1,2,3],$r=Object.freeze({GUIDES:"guides",REVIEWS:"reviews",NEWS:"news"}),Ct="categoryTestId",Be=(e,t)=>{if(!e)return e;if(Array.isArray(e))return e.map(s=>Be(s,t));if(!P.isValidElement(e)||!P.isValidElement(e))return e;const r=e.props.block??t,n=e.props.block?{}:{block:t},i=e.props.children?Be(e.props.children,r):e.props.children;return P.cloneElement(e,n,i)},Ue=(e,t,r)=>({children:n,block:i=t,...s})=>{const o=Be(n,i);return w.jsx(e,{...s,block:i,className:[r,t].filter(Boolean).join(" "),children:o})},Ye=e=>{const t=P.useRef(null),r=P.useMemo(()=>{var n;return{height:e?(n=t.current)==null?void 0:n.scrollHeight:0}},[e]);return{contentRef:t,style:r}},Gr=e=>{const[t,r]=P.useState(!1);return P.useEffect(()=>{const n=window.matchMedia(e);n.matches!==t&&r(n.matches);const i=()=>{r(n.matches)};return n.addEventListener("change",i),()=>{n.removeEventListener("change",i)}},[t,e]),t},qe=e=>{const t=P.useRef(null);return P.useEffect(()=>{const r=n=>{const i=n.target;t.current&&i instanceof Node&&!t.current.contains(i)&&e(!1)};return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[t,e]),t},Vr=({category:e,block:t})=>{const r=k(t,"category",`category--${e}`);return w.jsx("span",{"data-testid":Ct,className:r,children:Tt(e)})},Hr=({id:e,block:t,...r})=>w.jsxs(ve.Block,{htmlFor:e,block:t,children:[w.jsx(ve.Input,{...r,id:e}),w.jsx(ve.Indicator,{})]}),Wr="checkboxTestId",Ur="checkboxTestInputId",Yr=({children:e,block:t,htmlFor:r="checkbox"})=>{const n=k(t,"checkbox");return w.jsx("label",{"data-testid":Wr,className:n,htmlFor:r,children:e})},qr=()=>w.jsx("span",{className:"checkbox__indicator",children:w.jsx(W.Check,{})}),Xr=({onChange:e,id:t="checkbox",checked:r=!1,disabled:n=!1,name:i="checkbox",hasError:s=!1})=>{const o=k("","checkbox__input",{error:s}),a=l=>{e&&e(l.target.checked)};return w.jsx("input",{"data-testid":Ur,name:i,disabled:n,className:o,checked:r,onChange:a,id:t,type:"checkbox"})},ve=Object.assign(Hr,{Block:Yr,Indicator:qr,Input:Xr}),Kr="dropdownTestId",Jr=({category:e,block:t,options:r,onSelect:n,handleOpen:i,isOpen:s,onClickOutside:o,theme:a})=>{const l=r.find(c=>c.value===e),d=qe(o);return w.jsxs("div",{"data-testid":Kr,ref:d,className:k(t,"dropdown-menu",`dropdown-menu--${a}`,{"_dropdown-active":s}),children:[w.jsx(ce.Block,{children:w.jsx(ce.Category,{handleOpen:i,item:l})}),w.jsx(ce.List,{onSelect:n,options:r,category:e})]})},Qr=({category:e,options:t,onSelect:r})=>w.jsx("ul",{className:"dropdown-menu__list",children:t.map(n=>{const{value:i,label:s}=n,o=i===e;return w.jsx(ce.Option,{value:i,label:s,onSelect:r,isSelected:o},i)})}),Zr=({label:e,value:t,isSelected:r,onSelect:n})=>{const i=()=>{n(t)};return w.jsxs("li",{onClick:i,className:k("","dropdown-menu__option",{"_selected-option":r}),children:[e&&e," ",t]})},en=({item:e,handleOpen:t})=>w.jsxs("button",{onClick:t,className:"dropdown-menu__category",children:[e==null?void 0:e.label,e==null?void 0:e.value,w.jsx(W.ArrowNarrowDown,{className:"dropdown-menu__arrow"})]}),tn=({children:e})=>w.jsx("div",{className:"dropdown-menu__block",children:e}),ce=Object.assign(Jr,{List:Qr,Option:Zr,Category:en,Block:tn}),rn="favButtonTestId",nn=({disabled:e,block:t,isFavorite:r,type:n,onClick:i})=>{const s=k(t,"favorite-button",`favorite-button--${n}`,{active:r});return w.jsx("button",{"data-testid":rn,disabled:e,className:s,onClick:i,type:"button",children:r?w.jsx(Lr,{}):w.jsx(Nr,{})})},sn="fieldTestId",an="fieldLabelTestId",on=({label:e,block:t,children:r,error:n,id:i="input"})=>{const s=k(t,"field");return w.jsxs("div",{"data-testid":sn,className:s,children:[!!e&&w.jsx(Fe.Label,{text:e,htmlFor:i}),P.cloneElement(r,{id:i,hasError:!!n}),!!n&&w.jsx(Fe.Error,{errorText:n})]})},ln=({text:e,htmlFor:t="input"})=>w.jsx("label",{"data-testid":an,className:"field__label",htmlFor:t,children:e}),dn=({errorText:e})=>w.jsx("p",{className:"field__error",children:e}),Fe=Object.assign(on,{Label:ln,Error:dn}),cn=({children:e})=>w.jsx("div",{className:"filter-accordion__block",children:e}),Pt="filter-accordion",un="filterAccordionTestId",fn=Ue(cn,Pt),pn=({onClick:e,title:t,isOpen:r,children:n})=>w.jsxs(se.Layout,{isOpen:r,children:[w.jsxs(se.Block,{block:Pt,children:[w.jsx("h2",{className:"filter-accordion__title",children:t}),w.jsx(se.Reset,{}),w.jsx(se.Arrow,{onClick:e})]}),w.jsx(se.Content,{isOpen:r,children:n})]}),hn=({isOpen:e,block:t,children:r})=>w.jsx("div",{"data-testid":un,className:k(t,"filter-accordion",{"_active-accordion":e}),children:r}),mn=({onClick:e})=>w.jsx("button",{onClick:e,className:"filter-accordion__arrow",children:w.jsx(W.ArrowNarrowDown,{})}),gn="buttonTestId",Xe=({children:e,size:t,color:r,onClick:n,type:i="button",disabled:s=!1,isTransparent:o=!1,withIcon:a=!1,block:l})=>{const d=k(l,"button",`button--${t} button--${r}`,{"button--transparent":o,"button--icon":a});return w.jsx("button",{"data-testid":gn,disabled:s,type:i,className:d,onClick:n,children:e})},vn=({block:e})=>w.jsx(Xe,{block:e,isTransparent:!0,size:"small",color:"gray",children:"Reset"}),wn=({isOpen:e,children:t})=>{const{style:r,contentRef:n}=Ye(e);return w.jsx("div",{style:r,ref:n,className:"filter-accordion__content",children:w.jsx("div",{className:"filter-accordion__body",children:t})})},se=Object.assign(pn,{Layout:hn,Arrow:mn,Reset:vn,Block:fn,Content:wn}),Sn="leftIconButtonTestId",xn="rightIconButtonTestId",It=({RightIcon:e,LeftIcon:t,children:r,className:n,...i})=>w.jsxs(Xe,{withIcon:!0,...i,children:[!!t&&w.jsx(t,{className:n,"data-testid":Sn}),r,!!e&&w.jsx(e,{className:n,"data-testid":xn})]}),bn=({children:e,onClick:t,block:r})=>w.jsx(It,{type:"button",block:r,onClick:t,className:"button__close",RightIcon:W.Close,size:"small",color:"gray",children:e}),Tn=({images:e,block:t})=>w.jsx(ur,{items:e,additionalClass:t,showFullscreenButton:!1,showPlayButton:!1}),yn="inputTestId",Mt=({value:e,onChange:t,hasError:r,placeholder:n,block:i,disabled:s=!1,type:o="text",id:a="input",name:l="input",isReadOnly:d=!1,isTransparent:c=!1})=>{const u=k(i,"input",{error:r,transparent:c}),f=m=>{t&&t(m.currentTarget.value)};return w.jsx("input",{readOnly:d,onChange:f,disabled:s,autoComplete:"off","data-testid":yn,className:u,id:a,name:l,placeholder:n,value:e,type:o})};var le={},lt;function En(){if(lt)return le;lt=1,Object.defineProperty(le,"__esModule",{value:!0}),le.parse=o,le.serialize=d;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,i=Object.prototype.toString,s=(()=>{const f=function(){};return f.prototype=Object.create(null),f})();function o(f,m){const p=new s,v=f.length;if(v<2)return p;const b=(m==null?void 0:m.decode)||c;let h=0;do{const g=f.indexOf("=",h);if(g===-1)break;const S=f.indexOf(";",h),C=S===-1?v:S;if(g>C){h=f.lastIndexOf(";",g-1)+1;continue}const y=a(f,h,g),_=l(f,g,y),O=f.slice(y,_);if(p[O]===void 0){let I=a(f,g+1,C),E=l(f,C,I);const T=b(f.slice(I,E));p[O]=T}h=C+1}while(h<v);return p}function a(f,m,p){do{const v=f.charCodeAt(m);if(v!==32&&v!==9)return m}while(++m<p);return p}function l(f,m,p){for(;m>p;){const v=f.charCodeAt(--m);if(v!==32&&v!==9)return m+1}return p}function d(f,m,p){const v=(p==null?void 0:p.encode)||encodeURIComponent;if(!e.test(f))throw new TypeError(`argument name is invalid: ${f}`);const b=v(m);if(!t.test(b))throw new TypeError(`argument val is invalid: ${m}`);let h=f+"="+b;if(!p)return h;if(p.maxAge!==void 0){if(!Number.isInteger(p.maxAge))throw new TypeError(`option maxAge is invalid: ${p.maxAge}`);h+="; Max-Age="+p.maxAge}if(p.domain){if(!r.test(p.domain))throw new TypeError(`option domain is invalid: ${p.domain}`);h+="; Domain="+p.domain}if(p.path){if(!n.test(p.path))throw new TypeError(`option path is invalid: ${p.path}`);h+="; Path="+p.path}if(p.expires){if(!u(p.expires)||!Number.isFinite(p.expires.valueOf()))throw new TypeError(`option expires is invalid: ${p.expires}`);h+="; Expires="+p.expires.toUTCString()}if(p.httpOnly&&(h+="; HttpOnly"),p.secure&&(h+="; Secure"),p.partitioned&&(h+="; Partitioned"),p.priority)switch(typeof p.priority=="string"?p.priority.toLowerCase():void 0){case"low":h+="; Priority=Low";break;case"medium":h+="; Priority=Medium";break;case"high":h+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${p.priority}`)}if(p.sameSite)switch(typeof p.sameSite=="string"?p.sameSite.toLowerCase():p.sameSite){case!0:case"strict":h+="; SameSite=Strict";break;case"lax":h+="; SameSite=Lax";break;case"none":h+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${p.sameSite}`)}return h}function c(f){if(f.indexOf("%")===-1)return f;try{return decodeURIComponent(f)}catch{return f}}function u(f){return i.call(f)==="[object Date]"}return le}En();/**
|
|
2
2
|
* react-router v7.5.0
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Remix Software Inc.
|