@orderingstack/front-components-product-configurator 1.4.2-beta.35 → 1.4.2-beta.36

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useMenuProduct.d.ts","sourceRoot":"","sources":["useMenuProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAUvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ;;;;;;;;;;;;6BAiGvF,GAAG;;;;EAkDpC"}
1
+ {"version":3,"file":"useMenuProduct.d.ts","sourceRoot":"","sources":["useMenuProduct.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AASvE,wBAAgB,cAAc,CAAC,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ;;;;;;;;;;;;6BAiGvF,GAAG;;;;EA8CpC"}
package/dist/index.cjs.js CHANGED
@@ -8,8 +8,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
8
8
  * This source code is licensed under the MIT license found in the
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  */var Sp=T.default,Op=Symbol.for("react.element"),wp=Symbol.for("react.fragment"),Ep=Object.prototype.hasOwnProperty,xp=Sp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Pp={key:!0,ref:!0,__self:!0,__source:!0};function ys(e,t,r){var n,i={},a=null,o=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)Ep.call(t,n)&&!Pp.hasOwnProperty(n)&&(i[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)i[n]===void 0&&(i[n]=t[n]);return{$$typeof:Op,type:e,key:a,ref:o,props:i,_owner:xp.current}}jr.Fragment=wp;jr.jsx=ys;jr.jsxs=ys;kr.exports=jr;const C=kr.exports.jsx,V=kr.exports.jsxs,Ge=kr.exports.Fragment;function Aa(e){const{isOk:t,isErr:r,info:n}=e;return V("p",{className:`${t?"text-green-600":r&&"text-red-600"} ml-1 flex`,children:[t&&Cp,r&&Ap,n]})}const Cp=C("svg",{className:"w-6 h-6 text-green-600",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","data-testid":"form-check-mark",children:C("polyline",{points:"20 6 9 17 4 12"})}),Ap=C("svg",{className:"w-6 h-6 text-red-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor","data-testid":"form-exclamation-mark",children:C("path",{strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})});var _p={defaultAmount:0,defaultCurrency:"USD",defaultPrecision:2},Tp={globalLocale:"en-US",globalFormat:"$0,0.00",globalRoundingMode:"HALF_EVEN",globalFormatRoundingMode:"HALF_AWAY_FROM_ZERO",globalExchangeRatesApi:{endpoint:void 0,headers:void 0,propertyPath:void 0}};function zt(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?zt=function(t){return typeof t}:zt=function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}function _a(e){return Np(e)||$p(e)||Ip(e)||Lp()}function Np(e){if(Array.isArray(e))return e}function $p(e){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(e))return Array.from(e)}function Ip(e,t){if(!!e){if(typeof e=="string")return Ta(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ta(e,t)}}function Ta(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Lp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
11
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Rp={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=_a(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(t){var r=_a(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function bs(e){return!isNaN(parseInt(e))&&isFinite(e)}function Fp(e){return bs(e)&&e<=100&&e>=0}function Dp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Na(e){return e%2===0}function $a(e){return bs(e)&&!Number.isInteger(e)}function Mp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var r=t.split(".")[1];return r?r.length:0}function kt(e){return Math.abs(e)%1===.5}function kp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),jp(i,t.headers),i.send()})}function jp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r]);return e}function Wt(e){return typeof e=="undefined"}function Ss(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(zt(n[1])==="object"){var i=Ss(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function Up(e){return Boolean(e)&&(zt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Os(){var e=function(n,i){var a=function(u){return Math.pow(10,Mp(u))},o=Math.max(a(n),a(i));return Math.round(n*o)*Math.round(i*o)/(o*o)},t={HALF_ODD:function(n){var i=Math.round(n);return kt(n)&&Na(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return kt(n)?Na(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return kt(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return kt(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return kt(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return $a(n)||$a(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var Vp=Os();function Bp(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Wt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Wt(this.getMatches().find(n))?0:this.getMatches()[Vp.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Wt(this.getMatches().find(function(n){return n===","}))}}}function Hp(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)i=i.replace("{{".concat(o,"}}"),a[o]);return i},r=function(i,a){return kp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(Up(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return Ss(o)[t(e.propertyPath,{from:i,to:a})]})}}}function Zt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Wp(e){Zt(Fp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Gp(e){Zt(Dp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function fn(e){Zt(Number.isInteger(e),"You must provide an integer.",TypeError)}var ee=Os(),Kp=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,a=r.precision;fn(n),fn(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(p){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},d=function(p){Zt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;fn(p);var m=this.getPrecision(),y=p>m,b=y?ee.multiply:ee.divide,O=y?[p,m]:[m,p],A=Math.pow(10,ee.subtract.apply(ee,O));return l.call(this,{amount:ee.round(b(this.getAmount(),A),v),precision:p})},add:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:ee.round(ee.multiply(this.getAmount(),p),v)})},divide:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:ee.round(ee.divide(this.getAmount(),p),v)})},percentage:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Wp(p),this.multiply(ee.divide(p,100),v)},allocate:function(p){var v=this;Gp(p);for(var m=p.reduce(function(A,E){return ee.add(A,E)}),y=this.getAmount(),b=p.map(function(A){var E=Math.floor(ee.divide(ee.multiply(v.getAmount(),A),m));return y=ee.subtract(y,E),l.call(v,{amount:E})}),O=0;y>0;)p[O]>0&&(b[O]=b[O].add(l.call(this,{amount:1})),y=ee.subtract(y,1)),O+=1;return b},convert:function(p){var v=this,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=m.endpoint,b=y===void 0?f.endpoint:y,O=m.propertyPath,A=O===void 0?f.propertyPath||"rates.{{to}}":O,E=m.headers,P=E===void 0?f.headers:E,_=m.roundingMode,I=_===void 0?u:_,F=Object.assign({},{endpoint:b,propertyPath:A,headers:P,roundingMode:I});return Hp(F).getExchangeRate(this.getCurrency(),p).then(function(k){return Zt(!Wt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(v,{amount:ee.round(ee.multiply(v.getAmount(),parseFloat(k)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var v=e.normalizePrecision([this,p]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,m=Bp(p);return this.toRoundedUnit(m.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:m.getCurrencyDisplay(),useGrouping:m.getUseGrouping(),minimumFractionDigits:m.getMinimumFractionDigits(),style:m.getStyle(),currency:this.getCurrency()})},toUnit:function(){return ee.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,m=Math.pow(10,p);return ee.divide(ee.round(ee.multiply(this.toUnit(),m),v),m)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},Yp=Object.assign(Kp,_p,Tp,Rp);const hr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":Yp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},zp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=hr(`${r*n}`);const o=`${hr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${hr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Ur(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=t>s?t:a,c=hr(`${u}`);return!t&&i===!1?null:r?V("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${c}`]}):t<s?V("span",{className:"",children:["\xA0",`od ${c}`]}):C("span",{className:"",children:c})}function Qp(e,t){const{selCtx:r,id:n}=e,i=oe(s=>s.expanded),a=S.useMemo(()=>qp(r,n,t,i),[r,n,t,i]),o=oe(s=>s.toggleExpanded);return{isExpanded:a,toggleExpanded:o}}const qp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var Jp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Zp={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Xp=function(t){return Zp[t]},eh=function(t){return t.replace(Jp,Xp)};function Ia(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 La(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ia(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ia(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Tn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:eh},ws,th=S.createContext();function rh(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn=La(La({},Tn),e)}function nh(){return Tn}var ih=function(){function e(){Ie(this,e),this.usedNamespaces={}}return Le(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function ah(e){ws=e}function oh(){return ws}var sh={type:"3rdParty",init:function(t){rh(t.options.react),ah(t)}};function uh(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Ra={};function Nn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Ra[t[0]]||(typeof t[0]=="string"&&(Ra[t[0]]=new Date),uh.apply(void 0,t))}function Fa(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function lh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var o=function(u,c){var f=t.services.backendConnector.state["".concat(u,"|").concat(c)];return f===-1||f===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}function ch(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Nn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(a,o){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}):lh(e,t,r)}function fh(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function dh(e,t){return qa(e)||fh(e,t)||Ja(e,t)||Za()}function Da(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 dn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Da(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Da(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var gh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function ri(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(th)||{},i=n.i18n,a=n.defaultNS,o=r||i||oh();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new ih),!o){Nn("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&Nn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=dn(dn(dn({},nh()),o.options.react),t),f=c.useSuspense,l=c.keyPrefix,d=e||a||o.options&&o.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(d);var g=(o.isInitialized||o.initializedStoreOnce)&&d.every(function(I){return ch(I,o,c)});function p(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var v=S.useState(p),m=dh(v,2),y=m[0],b=m[1],O=d.join(),A=gh(O),E=S.useRef(!0);S.useEffect(function(){var I=c.bindI18n,F=c.bindI18nStore;E.current=!0,!g&&!f&&Fa(o,d,function(){E.current&&b(p)}),g&&A&&A!==O&&E.current&&b(p);function k(){E.current&&b(p)}return I&&o&&o.on(I,k),F&&o&&o.store.on(F,k),function(){E.current=!1,I&&o&&I.split(" ").forEach(function(W){return o.off(W,k)}),F&&o&&F.split(" ").forEach(function(W){return o.store.off(W,k)})}},[o,O]);var P=S.useRef(!0);S.useEffect(function(){E.current&&!P.current&&b(p),P.current=!1},[o,l]);var _=[y,o,g];if(_.t=y,_.i18n=o,_.ready=g,g||!g&&!f)return _;throw new Promise(function(I){Fa(o,d,function(){I()})})}var Es=[],ph=Es.forEach,hh=Es.slice;function mh(e){return ph.call(hh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Ma=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,vh=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o="".concat(t,"=").concat(a);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Ma.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Ma.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},ka={create:function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=vh(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var a=n[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},yh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=ka.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&ka.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},bh={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),a=i.split("&"),o=0;o<a.length;o++){var s=a[o].indexOf("=");if(s>0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(r=a[o].substring(s+1))}}}return r}},jt=null,ja=function(){if(jt!==null)return jt;try{jt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{jt=!1}return jt},Sh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&ja()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&ja()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Ut=null,Ua=function(){if(Ut!==null)return Ut;try{Ut=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ut=!1}return Ut},Oh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Ua()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Ua()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},wh={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},Eh={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},xh={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},Ph={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function Ch(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var xs=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ie(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Le(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=mh(n,this.options||{},Ch()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(yh),this.addDetector(bh),this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh),this.addDetector(xh),this.addDetector(Ph)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(r,i.options)}))}}]),e}();xs.type="languageDetector";const Ah={"OS.ProductConfigurator.Selected.Message.From":"od","OS.ProductConfigurator.Selected.Message.UpTo":"do","OS.ProductConfigurator.Selected.Message.Choose":"Wybierz","OS.ProductConfigurator.Selected.Message.Options":"opcji","OS.ProductConfigurator.Selected.Message.OneOption":"Wybierz 1 opcj\u0119","OS.ProductConfigurator.Quantity.Message.UpTo":"do","OS.ProductConfigurator.Quantity.Message.From":"od","OS.ProductConfigurator.Quantity.Message.Max":"maksymalnie","OS.ProductConfigurator.Quantity.Message.Quantity":"ilo\u015Bci","OS.ProductConfigurator.Quantity.Message.OneOption":"Wybierz maksymalnie jedn\u0105 opcj\u0119","OS.ProductConfigurator.Add":"Dodaj","OS.ProductConfigurator.Back":"Wr\xF3\u0107","OS.ProductConfigurator.ShowMore":"Poka\u017C wi\u0119cej","OS.ProductConfigurator.ShowLess":"Poka\u017C mniej"},_h={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"},Th={"OS.ProductConfigurator.Selected.Message.From":"ab","OS.ProductConfigurator.Selected.Message.UpTo":"bis","OS.ProductConfigurator.Selected.Message.Choose":"W\xE4hle","OS.ProductConfigurator.Selected.Message.Options":"Optionen","OS.ProductConfigurator.Selected.Message.OneOption":"W\xE4hle eine Option","OS.ProductConfigurator.Quantity.Message.UpTo":"ab","OS.ProductConfigurator.Quantity.Message.From":"aus","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"Menge","OS.ProductConfigurator.Quantity.Message.OneOption":"W\xE4hle bis zu 1 Option aus","OS.ProductConfigurator.Add":"Hinzuf\xFCgen","OS.ProductConfigurator.Back":"Zur\xFCck","OS.ProductConfigurator.ShowMore":"Zeig mehr","OS.ProductConfigurator.ShowLess":"Zeig weniger"},Nh={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};ye.use(xs).use(sh).init({resources:{pl:{translation:Ah},en:{translation:_h},de:{translation:Th},cs:{translation:Nh}}});const $h=(e,t,r,n)=>{let i="",a="";const o=Number(e),s=Number(t);return o>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>r&&(a=Ne.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Ne.TOO_MUCH)),o>=0||s>=0&&r<o?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",a=Ne.IGNORE),r>=o&&r<=s&&(a=Ne.OK),{message:i,validationStatus:a}},Ih=(e,t,r,n)=>{let i="",a="";const o=parseInt(e||"-1"),s=parseInt(t||"-1");return o>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>r&&(a=Ne.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Ne.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Ne.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Ne.OK),{message:i,validationStatus:a}},Lh=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:a,actualSelCnt:o,children:s}=e,{selCtx:u,details:c={},id:f,attrs:l={}}=t,{qtyMin:d,qtyMax:g,selMin:p,selMax:v}=l,{name:m,description:y}=c.literals||{},{t:b}=ri(),{isExpanded:O,toggleExpanded:A}=Qp(t,r),{validationStatus:E,message:P}=Ih(p,v,o,b),{validationStatus:_,message:I}=$h(d,g,a,b),F=E===Ne.OK,k=_===Ne.OK,W=!F&&i&&!!P,D=!k&&i&&!!I;return V("div",{className:"pt-1 mb-3",id:cs(u),children:[V("div",{className:"flex text-xl font-semibold",children:[C("p",{className:"",children:m}),m&&m!==" "&&V(Ge,{children:[C("div",{className:"ml-auto",children:C(Ur,{price:Kn(n,t)})}),C("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!O&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>A(u,f,r),children:C("polyline",{points:"18 15 12 9 6 15"})})]})]}),C("p",{className:`${y&&"mb-2"}`,children:y}),!1,C("div",{className:"flex",children:V("div",{children:[C(Aa,{isOk:F,isErr:W,info:P}),C(Aa,{isOk:k,isErr:D,info:I})]})}),C("div",{className:`${O?"block":"hidden"}`,children:s})]})},Ps=T.default.createContext(null);function Vr(){const e=S.useContext(Ps);if(!e)throw new Error("Missing ComponentsContext");return e}const Rh=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:a}=e,{isFilterValidated:o,selected:s,isOnSubmitted:u,selCnt:c,qtyCnt:f,currency:l}=vs(t,n,i,r),{MenuOptionsUI:d}=Vr();if(!o)return null;const g=C(ni,{productItems:t.items,parentProduct:t,rootProduct:a}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:f,actualSelCnt:c,currency:l};return d?C(d,{...p,children:g}):C(Lh,{...p,children:g})},Fh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:a="lg",children:o}=e,{details:{literals:s}={}}=t,{name:u="",description:c=""}=s||{},f=$o(t),l=fs(t);return V("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[C("input",{type:"checkbox",className:`simple-checkbox checkbox-${a} mr-4`,id:r,disabled:n,value:"1",...i}),l&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:l})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:V("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:u}),C("p",{className:"text-sm text-gray-600",children:c})]})}),C("div",{className:"ml-auto",children:o}),C("label",{htmlFor:r,children:C(Ur,{price:parseFloat(f),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Dh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:a,size:o="lg",children:s}=e,{details:{literals:u}={}}=t,{name:c="",description:f=""}=u||{},l=$o(t),d=fs(t);return V("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[C("input",{type:"radio",className:`simple-radio radio-${o} mr-4`,id:r,...i,value:n,checked:a}),d&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:d})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:V("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:c}),C("p",{className:"text-sm text-gray-600",children:f})]})}),C("div",{className:"ml-auto",children:s}),C("label",{htmlFor:r,children:C(Ur,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Cs(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return V("div",{className:`counter counter-${o} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[C("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:V("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),C("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),C("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,children:V("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Mh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=Ye(),{id:s,selCtx:u,emit:c={},fltCtx:f}=e,l=n(`selected.${u}.${s}`);return S.useEffect(()=>{var v,m,y;if(!r||r>1)return;const d=`filterWithCnt.${f}`,g=`filterWithCnt.${f}.${u}`,p=`filter.${f}`;if(t&&l&&f)if(Me(c)){const b=a(g);(v=Object.keys(b||{}))==null||v.forEach(O=>{o(`${g}.${O}`);const A=Object.keys(a(d)||{});Me(A)?o(`${p}.${O}`):A.forEach(E=>{E!==u&&!a(`${d}.${E}.${O}`)&&o(`${p}.${O}`)})});return}else{const b=a(g),O=a(d);(m=Object.keys(c))==null||m.forEach(A=>{var E;(E=Object.keys(b||{}))==null||E.forEach(P=>{c[P]||(o(`${p}.${P}`),o(`${g}.${P}`))}),Object.keys(O||{}).forEach(P=>{P!==u&&A in a(d==null?void 0:d[P])&&o(`${d}.${P}.${A}`)}),i(`${p}.${A}`,c[A]),i(`${g}.${A}`,{cnt:1,value:c[A]})});return}l&&f&&!Me(c)&&((y=Object.keys(c))==null||y.forEach(b=>{i(`filter.${f}.${b}`,c[b]);const O=a(`${g}.${b}.cnt`)||0;i(`${g}.${b}`,{cnt:O+1,value:c[b]})}))},[l]),{}}function kh(){const e=oe(n=>n.getInvalidSelCtxArray),t=oe(n=>n.isInputEnabled),r=oe(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Va=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},$n=(e,t,r)=>{const n=t(`selected.${e}`);console.log("changedSelCtx",n),r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},jh=(e,t,r,n,i,a)=>{var d,g;const{items:o,state:s,emit:u,fltCtx:c,selCtx:f}=r,{selected:l={}}=s||{};if(console.log("selected/unselected product",r,n),n){Va(l,e);const p=v=>{var m;!Array.isArray(v)||Me(s==null?void 0:s.selected)||(m=v==null?void 0:v.filter(y=>{var b,O;return!!((O=(b=s.selected)==null?void 0:b[`${y.selCtx}`])!=null&&O[`${y.id}`])}))==null||m.map(y=>{if(y.state&&"selected"in y.state){const{state:{selected:b}}=y;Va(b,e)}Array.isArray(y.items)&&p(y.items)})};p(o)}else{Object.keys(l).forEach(v=>{$n(v,t,e)});const p=v=>{!Array.isArray(v)||v.map(m=>{const{selCtx:y}=m;t(`selected.${y}`)&&$n(y,t,e),p(m.items)})};if(p(o),a&&a<2&&!Me(u)){(d=Object.keys(u))==null||d.forEach(b=>{const O=`filterWithCnt.${c}.${b}.${u[b]}`,A=t(O)||0;A<2?i(O):e(O,A-1)});const v=`filterWithCnt.${c}`,m=`filterWithCnt.${c}.${f}`,y=`filter.${c}`;(g=Object.keys(u))==null||g.forEach(b=>{var A,E,P;const O=t(`${m}.${b}`)||0;if(O)if(O>1)e(`${m}.${b}`,O-1);else{i(`${m}.${b}`);const _=t(v)||{},I=(A=Object.keys(_))==null?void 0:A.filter(F=>F!==f);if(!I)i(`${y}.${b}`);else{const F=I==null?void 0:I.find(k=>{var W;return!!((W=_==null?void 0:_[`${k}`])!=null&&W[`${b}`])});if(!F)i(`${y}.${b}`);else{const k=(P=(E=_==null?void 0:_[`${F}`])==null?void 0:E[`${b}`])==null?void 0:P.value;e(`${y}.${b}`,k)}}}})}}},As=(e,t)=>{var r;if(!e.items||Me(e.items))return null;for(let n=0;n<((r=e.items)==null?void 0:r.length);n++){const i=e.items[n];if(i.selCtx&&i.selCtx===t&&i.kind===Je.PRODUCT)return i;if(i.kind===Je.OPTIONS&&i.items&&i.items.length>0){const a=As(i,t);if(a)return a}}return null};function Uh(e,t,r,n){var he;const{id:i,selCtx:a,emit:o={},fltCtx:s}=e,{allowMultiple:u,selMin:c,selMax:f}=t,{isInputEnabled:l,isInputCounterIncrementEnabled:d}=kh(),g=oe(Z=>Z.refreshForm),p=oe(Z=>Z.currency),{watch:v,getValues:m,setValue:y,register:b,unregister:O}=Ye(),A=v(`selected.${a}.${i}`),{selected:E={}}=m(),P=Number(A||0),_=c==="1"&&f==="1";Mh(e,_,r);const I=!_,F=ip(u),k=P>(_?1:0),W=d(e,E)&&(l(e)||P),D=Number(((he=E==null?void 0:E[a])==null?void 0:he[i])||0)>0,j=l(e)||P,U=`${_?"radio":"selected"}.${a}.${i}`,B=b(U,{onChange:Z=>{pe(Z)}}),Q=()=>{y(`selected.${a}.${i}`,`${P+1}`)},G=()=>{var ce,fe;const Z=P-1;if(y(`selected.${a}.${i}`,`${Z}`),I&&Z===0){y(`selected.${a}.${i}`,!1),(ce=Object.keys(o))==null||ce.forEach(K=>{const se=`filterWithCnt.${s}.${K}.${o[K]}`,ne=m(se)||0;ne<2?O(se):y(se,ne-1)});const xe=K=>{!Array.isArray(K)||K.map(se=>{const{selCtx:ne}=se;m(`selected.${ne}`)&&$n(ne,m,y),xe(se.items)})};if(xe(e.items),r&&r<2&&!Me(o)){const K=`filterWithCnt.${s}`,se=`filterWithCnt.${s}.${a}`,ne=`filter.${s}`;(fe=Object.keys(o))==null||fe.forEach(X=>{var Pe,je,H;const me=m(`${se}.${X}`)||0;if(me)if(me>1)y(`${se}.${X}`,me-1);else{O(`${se}.${X}`);const ie=m(K)||{},ae=(Pe=Object.keys(ie))==null?void 0:Pe.filter(be=>be!==a);if(!ae)O(`${ne}.${X}`);else{const be=ae==null?void 0:ae.find(ar=>{var Kr;return!!((Kr=ie==null?void 0:ie[`${ar}`])!=null&&Kr[`${X}`])});if(!be)O(`${ne}.${X}`);else{const ar=(H=(je=ie==null?void 0:ie[`${be}`])==null?void 0:je[`${X}`])==null?void 0:H.value;y(`${ne}.${X}`,ar)}}}})}}},pe=Z=>{var K;const{target:{checked:ce,name:fe,defaultValue:xe}}=Z;if(_||jh(y,m,e,ce,O,r),_){console.log("handleOnInputChange radio",fe,xe);const se=(K=n==null?void 0:n.items)==null?void 0:K.filter(X=>X.id!==e.id);for(const X of Object.keys(E||{})){const me=se!=null&&se.some(Pe=>!!As(Pe,X))?X:!1;console.log("isImportantItem",me),me&&y(`selected.${X}`,!1)}const ne="selected."+fe.replace("radio.","").split(".")[0];y(ne,{[xe]:"1"}),g()}};return{registerProps:B,isRadio:_,isCheckbox:I,isCounter:F,isDecrementEnabled:k,isIncrementEnabled:W,isChecked:D,isCheckboxEnabled:j,handleCounterIncrementQty:Q,handleCounterDecrementQty:G,counterValue:P,handleOnInputChange:pe,inputId:`${a}.${i}`,radioInputValue:i,currency:p}}const Vh=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:a}=e,{registerProps:o,inputId:s,radioInputValue:u,isRadio:c,isCheckbox:f,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:v,counterValue:m,handleCounterIncrementQty:y,handleCounterDecrementQty:b,currency:O}=Uh(t,r,n,i),{MenuProductUI:A}=Vr(),E={product:t,nestedLvl:n,registerProps:o,inputId:s,radioInputValue:u,isRadio:c,isCheckbox:f,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:v,counterValue:m,handleCounterIncrementQty:y,handleCounterDecrementQty:b,currency:O,parentProduct:i},P=C(ni,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return A?C(A,{...E,children:P}):C(Bh,{...E,children:P})},Bh=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:a,isRadio:o,isCheckbox:s,isCounter:u,isDecrementEnabled:c,isIncrementEnabled:f,isChecked:l,isCheckboxEnabled:d,counterValue:g,handleCounterIncrementQty:p,handleCounterDecrementQty:v,children:m}=e,y=C(Cs,{value:g,add:p,subtract:v,disabledSubtract:!c,disabledAdd:!f}),b=()=>o?C(Dh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:C(Ge,{children:u&&y})}):s?C(Fh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:C(Ge,{children:u&&y})}):null,O=!Me(t.items)&&g,A=fi.useTransition(O,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return V("div",{children:[b(),O?A((E,P)=>P&&C(fi.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:E,children:m},r+1)):null]})};function Hh(){return{isMenuProductToShow:r=>r.kind===Je.PRODUCT&&xa(r),isMenuOptionsToShow:r=>[Je.OPTIONS,Je.CONFIG].includes(r.kind)&&xa(r)}}function ni(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:c}=Hh(),{MenuItemsUI:f}=Vr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>c(g)?C(Rh,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?C(Vh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):C(Ge,{}),rootProduct:i};return f?C(f,{...d}):C(Wh,{...d})}function Wh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==Je.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:c}=ri(),f=()=>{u(a)},l=()=>{u(o)};return C(Ge,{children:t.map((d,g)=>{if(g<s)return V("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ba(c("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ba(c("OS.ProductConfigurator.ShowMore"),f,!0)})})}const Ba=(e,t,r)=>C("div",{className:"flex justify-center w-full",children:V("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,V("svg",{className:`-mr-2 w-7 h-7 ${!r&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("polyline",{points:"7 7 12 12 17 7"})," ",C("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),_s=()=>{const{watch:e}=Ye(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=oe(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),V("div",{className:"flex flex-col items-center py-4",children:[C("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(a=>C("div",{children:Object.values(t[a]).filter(o=>o).length>0&&V(Ge,{children:[V("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>C(T.default.Fragment,{children:t[a][o]&&V("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ha(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:c}=ri();return V("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&V("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[V("svg",{className:"w-5 h-5 text-red-600",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),C("span",{className:"uppercase",children:`${c("OS.ProductConfigurator.Back")}`})]}),C("div",{className:"px-3",children:C(Cs,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),V("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[V("svg",{className:"w-5 h-5 mr-2 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C("circle",{cx:"9",cy:"21",r:"1"})," ",C("circle",{cx:"20",cy:"21",r:"1"}),C("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?C("span",{children:`${c("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):C("span",{className:"uppercase",children:`${c("OS.ProductConfigurator.Add")} ${t}`})]})]})}const cr=640,Ts=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=cr),[u,c]=S.useState(window.innerWidth>cr&&!t);function f(){n(window.innerWidth),a(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),S.useEffect(()=>{c(window.innerWidth>cr&&!t),s(window.innerWidth<=cr)},[r,e,t]),{isSm:u,isMobile:o,width:r,windowHeight:i}};function Ns(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ns(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Vt(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ns(e))&&(n&&(n+=" "),n+=t);return n}var Gh=Object.defineProperty,Kh=(e,t,r)=>t in e?Gh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gn=(e,t,r)=>(Kh(e,typeof t!="symbol"?t+"":t,r),r);class Yh{constructor(){gn(this,"current",this.detect()),gn(this,"handoffState","pending"),gn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let Ze=new Yh,$e=(e,t)=>{Ze.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Xe(e){let t=S.useRef(e);return $e(()=>{t.current=e},[e]),t}let re=function(e){let t=Xe(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function Br(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function wt(){let e=[],t={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),t.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Br(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=wt();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let i of e.splice(n,1))i()}},dispose(){for(let r of e.splice(0))r()}};return t}function ii(){let[e]=S.useState(wt);return S.useEffect(()=>()=>e.dispose(),[e]),e}function zh(){let e=typeof document=="undefined";return"useSyncExternalStore"in st?(t=>t.useSyncExternalStore)(st)(()=>()=>{},()=>!1,()=>!e):!1}function Lt(){let e=zh(),[t,r]=st.useState(Ze.isHandoffComplete);return t&&Ze.isHandoffComplete===!1&&r(!1),st.useEffect(()=>{t!==!0&&r(!0)},[t]),st.useEffect(()=>Ze.handoff(),[]),e?!1:t}var Wa;let Rt=(Wa=T.default.useId)!=null?Wa:function(){let e=Lt(),[t,r]=T.default.useState(e?()=>Ze.nextId():null);return $e(()=>{t===null&&r(Ze.nextId())},[t]),t!=null?""+t:void 0};function ve(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ve),n}function $s(e){return Ze.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let In=["[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(",");var gt=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(gt||{}),Is=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Is||{}),Qh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Qh||{});function qh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(In)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ls=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ls||{});function Jh(e,t=0){var r;return e===((r=$s(e))==null?void 0:r.body)?!1:ve(t,{[0](){return e.matches(In)},[1](){let n=e;for(;n!==null;){if(n.matches(In))return!0;n=n.parentElement}return!1}})}var Zh=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Zh||{});typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mt(e){e==null||e.focus({preventScroll:!0})}let Xh=["textarea","input"].join(",");function em(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Xh))!=null?r:!1}function tm(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function mr(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?tm(e):e:qh(e);i.length>0&&o.length>1&&(o=o.filter(g=>!i.includes(g))),n=n!=null?n:a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},f=0,l=o.length,d;do{if(f>=l||f+l<=0)return 0;let g=u+f;if(t&16)g=(g+l)%l;else{if(g<0)return 3;if(g>=l)return 1}d=o[g],d==null||d.focus(c),f+=s}while(d!==a.activeElement);return t&6&&em(d)&&d.select(),2}function Rs(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function rm(){return/Android/gi.test(window.navigator.userAgent)}function nm(){return Rs()||rm()}function fr(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Fs(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function im(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,s){if(!n.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function f(l){return typeof l=="function"?f(l()):Array.isArray(l)||l instanceof Set?l:[l]}(e);for(let f of c){if(f===null)continue;let l=f instanceof HTMLElement?f:f.current;if(l!=null&&l.contains(u)||o.composed&&o.composedPath().includes(l))return}return!Jh(u,Ls.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);fr("pointerdown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),fr("mousedown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),fr("click",o=>{nm()||a.current&&(i(o,()=>a.current),a.current=null)},!0),fr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Fs("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function rr(...e){return S.useMemo(()=>$s(...e),[...e])}let Ds=Symbol();function am(e,t=!0){return Object.assign(e,{[Ds]:t})}function ke(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=re(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Ds]))?void 0:r}function ai(e,t){let r=S.useRef([]),n=re(e);S.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Ar(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var _r=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(_r||{}),ot=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ot||{});function Re({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:om;let u=Ms(t,e);if(a)return dr(u,r,n,o,s);let c=i!=null?i:0;if(c&2){let{static:f=!1,...l}=u;if(f)return dr(l,r,n,o,s)}if(c&1){let{unmount:f=!0,...l}=u;return ve(f?0:1,{[0](){return null},[1](){return dr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return dr(u,r,n,o,s)}function dr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=pn(e,["unmount","static"]),c=e.ref!==void 0?{[s]:e.ref}:{},f=typeof o=="function"?o(t):o;"className"in u&&u.className&&typeof u.className=="function"&&(u.className=u.className(t));let l={};if(t){let d=!1,g=[];for(let[p,v]of Object.entries(t))typeof v=="boolean"&&(d=!0),v===!0&&g.push(p);d&&(l["data-headlessui-state"]=g.join(" "))}if(a===S.Fragment&&Object.keys(Ga(u)).length>0){if(!S.isValidElement(f)||Array.isArray(f)&&f.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u).map(v=>` - ${v}`).join(`
11
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var Rp={normalizePrecision:function(t){var r=t.reduce(function(n,i){return Math.max(n.getPrecision(),i.getPrecision())});return t.map(function(n){return n.getPrecision()!==r?n.convertPrecision(r):n})},minimum:function(t){var r=_a(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.lessThan(o)?a:o}),a},maximum:function(t){var r=_a(t),n=r[0],i=r.slice(1),a=n;return i.forEach(function(o){a=a.greaterThan(o)?a:o}),a}};function bs(e){return!isNaN(parseInt(e))&&isFinite(e)}function Fp(e){return bs(e)&&e<=100&&e>=0}function Dp(e){return e.length>0&&e.every(function(t){return t>=0})&&e.some(function(t){return t>0})}function Na(e){return e%2===0}function $a(e){return bs(e)&&!Number.isInteger(e)}function Mp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,t=e.toString();if(t.indexOf("e-")>0)return parseInt(t.split("e-")[1]);var r=t.split(".")[1];return r?r.length:0}function kt(e){return Math.abs(e)%1===.5}function kp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return new Promise(function(r,n){var i=Object.assign(new XMLHttpRequest,{onreadystatechange:function(){i.readyState===4&&(i.status>=200&&i.status<400?r(JSON.parse(i.responseText)):n(new Error(i.statusText)))},onerror:function(){n(new Error("Network error"))}});i.open("GET",e,!0),jp(i,t.headers),i.send()})}function jp(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(var r in t)e.setRequestHeader(r,t[r]);return e}function Wt(e){return typeof e=="undefined"}function Ss(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:".",r={};return Object.entries(e).forEach(function(n){if(zt(n[1])==="object"){var i=Ss(n[1]);Object.entries(i).forEach(function(a){r[n[0]+t+a[0]]=a[1]})}else r[n[0]]=n[1]}),r}function Up(e){return Boolean(e)&&(zt(e)==="object"||typeof e=="function")&&typeof e.then=="function"}function Os(){var e=function(n,i){var a=function(u){return Math.pow(10,Mp(u))},o=Math.max(a(n),a(i));return Math.round(n*o)*Math.round(i*o)/(o*o)},t={HALF_ODD:function(n){var i=Math.round(n);return kt(n)&&Na(i)?i-1:i},HALF_EVEN:function(n){var i=Math.round(n);return kt(n)?Na(i)?i:i-1:i},HALF_UP:function(n){return Math.round(n)},HALF_DOWN:function(n){return kt(n)?Math.floor(n):Math.round(n)},HALF_TOWARDS_ZERO:function(n){return kt(n)?Math.sign(n)*Math.floor(Math.abs(n)):Math.round(n)},HALF_AWAY_FROM_ZERO:function(n){return kt(n)?Math.sign(n)*Math.ceil(Math.abs(n)):Math.round(n)},DOWN:function(n){return Math.floor(n)}};return{add:function(n,i){return n+i},subtract:function(n,i){return n-i},multiply:function(n,i){return $a(n)||$a(i)?e(n,i):n*i},divide:function(n,i){return n/i},modulo:function(n,i){return n%i},round:function(n){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"HALF_EVEN";return t[i](n)}}}var Vp=Os();function Bp(e){var t=/^(?:(\$|USD)?0(?:(,)0)?(\.)?(0+)?|0(?:(,)0)?(\.)?(0+)?\s?(dollar)?)$/gm.exec(e);return{getMatches:function(){return t!==null?t.slice(1).filter(function(n){return!Wt(n)}):[]},getMinimumFractionDigits:function(){var n=function(a){return a==="."};return Wt(this.getMatches().find(n))?0:this.getMatches()[Vp.add(this.getMatches().findIndex(n),1)].split("").length},getCurrencyDisplay:function(){var n={USD:"code",dollar:"name",$:"symbol"};return n[this.getMatches().find(function(i){return i==="USD"||i==="dollar"||i==="$"})]},getStyle:function(){return Wt(this.getCurrencyDisplay(this.getMatches()))?"decimal":"currency"},getUseGrouping:function(){return!Wt(this.getMatches().find(function(n){return n===","}))}}}function Hp(e){var t=function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=arguments.length>1?arguments[1]:void 0;for(var o in a)i=i.replace("{{".concat(o,"}}"),a[o]);return i},r=function(i,a){return kp(t(e.endpoint,{from:i,to:a}),{headers:e.headers})};return{getExchangeRate:function(i,a){return(Up(e.endpoint)?e.endpoint:r(i,a)).then(function(o){return Ss(o)[t(e.propertyPath,{from:i,to:a})]})}}}function Zt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Error;if(!e)throw new r(t)}function Wp(e){Zt(Fp(e),"You must provide a numeric value between 0 and 100.",RangeError)}function Gp(e){Zt(Dp(e),"You must provide a non-empty array of numeric values greater than 0.",TypeError)}function fn(e){Zt(Number.isInteger(e),"You must provide an integer.",TypeError)}var ee=Os(),Kp=function e(t){var r=Object.assign({},{amount:e.defaultAmount,currency:e.defaultCurrency,precision:e.defaultPrecision},t),n=r.amount,i=r.currency,a=r.precision;fn(n),fn(a);var o=e.globalLocale,s=e.globalFormat,u=e.globalRoundingMode,c=e.globalFormatRoundingMode,f=Object.assign({},e.globalExchangeRatesApi),l=function(p){var v=Object.assign({},Object.assign({},{amount:n,currency:i,precision:a},p),Object.assign({},{locale:this.locale},p));return Object.assign(e({amount:v.amount,currency:v.currency,precision:v.precision}),{locale:v.locale})},d=function(p){Zt(this.hasSameCurrency(p),"You must provide a Dinero instance with the same currency.",TypeError)};return{getAmount:function(){return n},getCurrency:function(){return i},getLocale:function(){return this.locale||o},setLocale:function(p){return l.call(this,{locale:p})},getPrecision:function(){return a},convertPrecision:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c;fn(p);var m=this.getPrecision(),y=p>m,b=y?ee.multiply:ee.divide,O=y?[p,m]:[m,p],A=Math.pow(10,ee.subtract.apply(ee,O));return l.call(this,{amount:ee.round(b(this.getAmount(),A),v),precision:p})},add:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.add(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},subtract:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return l.call(this,{amount:ee.subtract(v[0].getAmount(),v[1].getAmount()),precision:v[0].getPrecision()})},multiply:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:ee.round(ee.multiply(this.getAmount(),p),v)})},divide:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return l.call(this,{amount:ee.round(ee.divide(this.getAmount(),p),v)})},percentage:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:u;return Wp(p),this.multiply(ee.divide(p,100),v)},allocate:function(p){var v=this;Gp(p);for(var m=p.reduce(function(A,E){return ee.add(A,E)}),y=this.getAmount(),b=p.map(function(A){var E=Math.floor(ee.divide(ee.multiply(v.getAmount(),A),m));return y=ee.subtract(y,E),l.call(v,{amount:E})}),O=0;y>0;)p[O]>0&&(b[O]=b[O].add(l.call(this,{amount:1})),y=ee.subtract(y,1)),O+=1;return b},convert:function(p){var v=this,m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},y=m.endpoint,b=y===void 0?f.endpoint:y,O=m.propertyPath,A=O===void 0?f.propertyPath||"rates.{{to}}":O,E=m.headers,P=E===void 0?f.headers:E,_=m.roundingMode,I=_===void 0?u:_,F=Object.assign({},{endpoint:b,propertyPath:A,headers:P,roundingMode:I});return Hp(F).getExchangeRate(this.getCurrency(),p).then(function(k){return Zt(!Wt(k),'No rate was found for the destination currency "'.concat(p,'".'),TypeError),l.call(v,{amount:ee.round(ee.multiply(v.getAmount(),parseFloat(k)),F.roundingMode),currency:p})})},equalsTo:function(p){return this.hasSameAmount(p)&&this.hasSameCurrency(p)},lessThan:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()<v[1].getAmount()},lessThanOrEqual:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()<=v[1].getAmount()},greaterThan:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()>v[1].getAmount()},greaterThanOrEqual:function(p){d.call(this,p);var v=e.normalizePrecision([this,p]);return v[0].getAmount()>=v[1].getAmount()},isZero:function(){return this.getAmount()===0},isPositive:function(){return this.getAmount()>=0},isNegative:function(){return this.getAmount()<0},hasSubUnits:function(){return ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasCents:function(){return ee.modulo(this.getAmount(),Math.pow(10,a))!==0},hasSameCurrency:function(p){return this.getCurrency()===p.getCurrency()},hasSameAmount:function(p){var v=e.normalizePrecision([this,p]);return v[0].getAmount()===v[1].getAmount()},toFormat:function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s,v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,m=Bp(p);return this.toRoundedUnit(m.getMinimumFractionDigits(),v).toLocaleString(this.getLocale(),{currencyDisplay:m.getCurrencyDisplay(),useGrouping:m.getUseGrouping(),minimumFractionDigits:m.getMinimumFractionDigits(),style:m.getStyle(),currency:this.getCurrency()})},toUnit:function(){return ee.divide(this.getAmount(),Math.pow(10,a))},toRoundedUnit:function(p){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:c,m=Math.pow(10,p);return ee.divide(ee.round(ee.multiply(this.toUnit(),m),v),m)},toObject:function(){return{amount:n,currency:i,precision:a}},toJSON:function(){return this.toObject()}}},Yp=Object.assign(Kp,_p,Tp,Rp);const hr=(e,t="PLN")=>{e=e.toString();const r=e.replace(",","."),n=Number(r)*100;return isNaN(n)?"0.00":Yp({amount:Math.round(n),currency:t}).toFormat("0,0.00")},zp=(e,t,r=1)=>{const n=parseFloat(e.toString());let i=!1,a=hr(`${r*n}`);const o=`${hr(`${a}`)}`;return n<parseFloat(t)&&(i=!0,a=`${hr(`${t}`)}`),{displayPriceFrom:i,formattedEndPriceWithPriceMin:a,formattedEndPrice:o}};function Ur(e){const{price:t,addPlusBefore:r=!1,size:n="md",showIfPriceZero:i=!1,minPrice:a="0.00",hiddenIfPriceZero:o=!1}=e,s=parseFloat(a),u=t>s?t:a,c=hr(`${u}`);return!t&&i===!1?null:r?V("span",{style:{visibility:`${!t&&o?"hidden":"visible"}`},className:"",children:["\xA0",`+${c}`]}):t<s?V("span",{className:"",children:["\xA0",`od ${c}`]}):C("span",{className:"",children:c})}function Qp(e,t){const{selCtx:r,id:n}=e,i=oe(s=>s.expanded),a=S.useMemo(()=>qp(r,n,t,i),[r,n,t,i]),o=oe(s=>s.toggleExpanded);return{isExpanded:a,toggleExpanded:o}}const qp=(e,t,r,n)=>{const i=n[e+t+r];return i!==void 0?i:!0};var Jp=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Zp={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"\xA9","&#169;":"\xA9","&reg;":"\xAE","&#174;":"\xAE","&hellip;":"\u2026","&#8230;":"\u2026","&#x2F;":"/","&#47;":"/"},Xp=function(t){return Zp[t]},eh=function(t){return t.replace(Jp,Xp)};function Ia(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 La(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ia(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ia(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var Tn={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:eh},ws,th=S.createContext();function rh(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Tn=La(La({},Tn),e)}function nh(){return Tn}var ih=function(){function e(){Ie(this,e),this.usedNamespaces={}}return Le(e,[{key:"addUsedNamespaces",value:function(r){var n=this;r.forEach(function(i){n.usedNamespaces[i]||(n.usedNamespaces[i]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),e}();function ah(e){ws=e}function oh(){return ws}var sh={type:"3rdParty",init:function(t){rh(t.options.react),ah(t)}};function uh(){if(console&&console.warn){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];typeof r[0]=="string"&&(r[0]="react-i18next:: ".concat(r[0])),(e=console).warn.apply(e,r)}}var Ra={};function Nn(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&Ra[t[0]]||(typeof t[0]=="string"&&(Ra[t[0]]=new Date),uh.apply(void 0,t))}function Fa(e,t,r){e.loadNamespaces(t,function(){if(e.isInitialized)r();else{var n=function i(){setTimeout(function(){e.off("initialized",i)},0),r()};e.on("initialized",n)}})}function lh(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.languages[0],i=t.options?t.options.fallbackLng:!1,a=t.languages[t.languages.length-1];if(n.toLowerCase()==="cimode")return!0;var o=function(u,c){var f=t.services.backendConnector.state["".concat(u,"|").concat(c)];return f===-1||f===2};return r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!o(t.isLanguageChangingTo,e)?!1:!!(t.hasResourceBundle(n,e)||!t.services.backendConnector.backend||t.options.resources&&!t.options.partialBundledLanguages||o(n,e)&&(!i||o(a,e)))}function ch(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!t.languages||!t.languages.length)return Nn("i18n.languages were undefined or empty",t.languages),!0;var n=t.options.ignoreJSONStructure!==void 0;return n?t.hasLoadedNamespace(e,{precheck:function(a,o){if(r.bindI18n&&r.bindI18n.indexOf("languageChanging")>-1&&a.services.backendConnector.backend&&a.isLanguageChangingTo&&!o(a.isLanguageChangingTo,e))return!1}}):lh(e,t,r)}function fh(e,t){var r=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,o,s=[],u=!0,c=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(f){c=!0,i=f}finally{try{if(!u&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(c)throw i}}return s}}function dh(e,t){return qa(e)||fh(e,t)||Ja(e,t)||Za()}function Da(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 dn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Da(Object(r),!0).forEach(function(n){Ke(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Da(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}var gh=function(t,r){var n=S.useRef();return S.useEffect(function(){n.current=r?n.current:t},[t,r]),n.current};function ri(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.i18n,n=S.useContext(th)||{},i=n.i18n,a=n.defaultNS,o=r||i||oh();if(o&&!o.reportNamespaces&&(o.reportNamespaces=new ih),!o){Nn("You will need to pass in an i18next instance by using initReactI18next");var s=function(F){return Array.isArray(F)?F[F.length-1]:F},u=[s,{},!1];return u.t=s,u.i18n={},u.ready=!1,u}o.options.react&&o.options.react.wait!==void 0&&Nn("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var c=dn(dn(dn({},nh()),o.options.react),t),f=c.useSuspense,l=c.keyPrefix,d=e||a||o.options&&o.options.defaultNS;d=typeof d=="string"?[d]:d||["translation"],o.reportNamespaces.addUsedNamespaces&&o.reportNamespaces.addUsedNamespaces(d);var g=(o.isInitialized||o.initializedStoreOnce)&&d.every(function(I){return ch(I,o,c)});function p(){return o.getFixedT(null,c.nsMode==="fallback"?d:d[0],l)}var v=S.useState(p),m=dh(v,2),y=m[0],b=m[1],O=d.join(),A=gh(O),E=S.useRef(!0);S.useEffect(function(){var I=c.bindI18n,F=c.bindI18nStore;E.current=!0,!g&&!f&&Fa(o,d,function(){E.current&&b(p)}),g&&A&&A!==O&&E.current&&b(p);function k(){E.current&&b(p)}return I&&o&&o.on(I,k),F&&o&&o.store.on(F,k),function(){E.current=!1,I&&o&&I.split(" ").forEach(function(W){return o.off(W,k)}),F&&o&&F.split(" ").forEach(function(W){return o.store.off(W,k)})}},[o,O]);var P=S.useRef(!0);S.useEffect(function(){E.current&&!P.current&&b(p),P.current=!1},[o,l]);var _=[y,o,g];if(_.t=y,_.i18n=o,_.ready=g,g||!g&&!f)return _;throw new Promise(function(I){Fa(o,d,function(){I()})})}var Es=[],ph=Es.forEach,hh=Es.slice;function mh(e){return ph.call(hh.call(arguments,1),function(t){if(t)for(var r in t)e[r]===void 0&&(e[r]=t[r])}),e}var Ma=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,vh=function(t,r,n){var i=n||{};i.path=i.path||"/";var a=encodeURIComponent(r),o="".concat(t,"=").concat(a);if(i.maxAge>0){var s=i.maxAge-0;if(Number.isNaN(s))throw new Error("maxAge should be a Number");o+="; Max-Age=".concat(Math.floor(s))}if(i.domain){if(!Ma.test(i.domain))throw new TypeError("option domain is invalid");o+="; Domain=".concat(i.domain)}if(i.path){if(!Ma.test(i.path))throw new TypeError("option path is invalid");o+="; Path=".concat(i.path)}if(i.expires){if(typeof i.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+="; Expires=".concat(i.expires.toUTCString())}if(i.httpOnly&&(o+="; HttpOnly"),i.secure&&(o+="; Secure"),i.sameSite){var u=typeof i.sameSite=="string"?i.sameSite.toLowerCase():i.sameSite;switch(u){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}}return o},ka={create:function(t,r,n,i){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(a.expires=new Date,a.expires.setTime(a.expires.getTime()+n*60*1e3)),i&&(a.domain=i),document.cookie=vh(t,encodeURIComponent(r),a)},read:function(t){for(var r="".concat(t,"="),n=document.cookie.split(";"),i=0;i<n.length;i++){for(var a=n[i];a.charAt(0)===" ";)a=a.substring(1,a.length);if(a.indexOf(r)===0)return a.substring(r.length,a.length)}return null},remove:function(t){this.create(t,"",-1)}},yh={name:"cookie",lookup:function(t){var r;if(t.lookupCookie&&typeof document!="undefined"){var n=ka.read(t.lookupCookie);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupCookie&&typeof document!="undefined"&&ka.create(r.lookupCookie,t,r.cookieMinutes,r.cookieDomain,r.cookieOptions)}},bh={name:"querystring",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.search;!window.location.search&&window.location.hash&&window.location.hash.indexOf("?")>-1&&(n=window.location.hash.substring(window.location.hash.indexOf("?")));for(var i=n.substring(1),a=i.split("&"),o=0;o<a.length;o++){var s=a[o].indexOf("=");if(s>0){var u=a[o].substring(0,s);u===t.lookupQuerystring&&(r=a[o].substring(s+1))}}}return r}},jt=null,ja=function(){if(jt!==null)return jt;try{jt=window!=="undefined"&&window.localStorage!==null;var t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{jt=!1}return jt},Sh={name:"localStorage",lookup:function(t){var r;if(t.lookupLocalStorage&&ja()){var n=window.localStorage.getItem(t.lookupLocalStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupLocalStorage&&ja()&&window.localStorage.setItem(r.lookupLocalStorage,t)}},Ut=null,Ua=function(){if(Ut!==null)return Ut;try{Ut=window!=="undefined"&&window.sessionStorage!==null;var t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Ut=!1}return Ut},Oh={name:"sessionStorage",lookup:function(t){var r;if(t.lookupSessionStorage&&Ua()){var n=window.sessionStorage.getItem(t.lookupSessionStorage);n&&(r=n)}return r},cacheUserLanguage:function(t,r){r.lookupSessionStorage&&Ua()&&window.sessionStorage.setItem(r.lookupSessionStorage,t)}},wh={name:"navigator",lookup:function(t){var r=[];if(typeof navigator!="undefined"){if(navigator.languages)for(var n=0;n<navigator.languages.length;n++)r.push(navigator.languages[n]);navigator.userLanguage&&r.push(navigator.userLanguage),navigator.language&&r.push(navigator.language)}return r.length>0?r:void 0}},Eh={name:"htmlTag",lookup:function(t){var r,n=t.htmlTag||(typeof document!="undefined"?document.documentElement:null);return n&&typeof n.getAttribute=="function"&&(r=n.getAttribute("lang")),r}},xh={name:"path",lookup:function(t){var r;if(typeof window!="undefined"){var n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);if(n instanceof Array)if(typeof t.lookupFromPathIndex=="number"){if(typeof n[t.lookupFromPathIndex]!="string")return;r=n[t.lookupFromPathIndex].replace("/","")}else r=n[0].replace("/","")}return r}},Ph={name:"subdomain",lookup:function(t){var r=typeof t.lookupFromSubdomainIndex=="number"?t.lookupFromSubdomainIndex+1:1,n=typeof window!="undefined"&&window.location&&window.location.hostname&&window.location.hostname.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(!!n)return n[r]}};function Ch(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"]}}var xs=function(){function e(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Ie(this,e),this.type="languageDetector",this.detectors={},this.init(t,r)}return Le(e,[{key:"init",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=r,this.options=mh(n,this.options||{},Ch()),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=i,this.addDetector(yh),this.addDetector(bh),this.addDetector(Sh),this.addDetector(Oh),this.addDetector(wh),this.addDetector(Eh),this.addDetector(xh),this.addDetector(Ph)}},{key:"addDetector",value:function(r){this.detectors[r.name]=r}},{key:"detect",value:function(r){var n=this;r||(r=this.options.order);var i=[];return r.forEach(function(a){if(n.detectors[a]){var o=n.detectors[a].lookup(n.options);o&&typeof o=="string"&&(o=[o]),o&&(i=i.concat(o))}}),this.services.languageUtils.getBestMatchFromCodes?i:i.length>0?i[0]:null}},{key:"cacheUserLanguage",value:function(r,n){var i=this;n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(r)>-1||n.forEach(function(a){i.detectors[a]&&i.detectors[a].cacheUserLanguage(r,i.options)}))}}]),e}();xs.type="languageDetector";const Ah={"OS.ProductConfigurator.Selected.Message.From":"od","OS.ProductConfigurator.Selected.Message.UpTo":"do","OS.ProductConfigurator.Selected.Message.Choose":"Wybierz","OS.ProductConfigurator.Selected.Message.Options":"opcji","OS.ProductConfigurator.Selected.Message.OneOption":"Wybierz 1 opcj\u0119","OS.ProductConfigurator.Quantity.Message.UpTo":"do","OS.ProductConfigurator.Quantity.Message.From":"od","OS.ProductConfigurator.Quantity.Message.Max":"maksymalnie","OS.ProductConfigurator.Quantity.Message.Quantity":"ilo\u015Bci","OS.ProductConfigurator.Quantity.Message.OneOption":"Wybierz maksymalnie jedn\u0105 opcj\u0119","OS.ProductConfigurator.Add":"Dodaj","OS.ProductConfigurator.Back":"Wr\xF3\u0107","OS.ProductConfigurator.ShowMore":"Poka\u017C wi\u0119cej","OS.ProductConfigurator.ShowLess":"Poka\u017C mniej"},_h={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"},Th={"OS.ProductConfigurator.Selected.Message.From":"ab","OS.ProductConfigurator.Selected.Message.UpTo":"bis","OS.ProductConfigurator.Selected.Message.Choose":"W\xE4hle","OS.ProductConfigurator.Selected.Message.Options":"Optionen","OS.ProductConfigurator.Selected.Message.OneOption":"W\xE4hle eine Option","OS.ProductConfigurator.Quantity.Message.UpTo":"ab","OS.ProductConfigurator.Quantity.Message.From":"aus","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"Menge","OS.ProductConfigurator.Quantity.Message.OneOption":"W\xE4hle bis zu 1 Option aus","OS.ProductConfigurator.Add":"Hinzuf\xFCgen","OS.ProductConfigurator.Back":"Zur\xFCck","OS.ProductConfigurator.ShowMore":"Zeig mehr","OS.ProductConfigurator.ShowLess":"Zeig weniger"},Nh={"OS.ProductConfigurator.Selected.Message.From":"from","OS.ProductConfigurator.Selected.Message.UpTo":"up to","OS.ProductConfigurator.Selected.Message.Choose":"Choose","OS.ProductConfigurator.Selected.Message.Options":"options","OS.ProductConfigurator.Selected.Message.OneOption":"Choose one option","OS.ProductConfigurator.Quantity.Message.UpTo":"up to","OS.ProductConfigurator.Quantity.Message.From":"from","OS.ProductConfigurator.Quantity.Message.Max":"max","OS.ProductConfigurator.Quantity.Message.Quantity":"quantity","OS.ProductConfigurator.Quantity.Message.OneOption":"Choose maximum one option","OS.ProductConfigurator.Add":"Add","OS.ProductConfigurator.Back":"Back","OS.ProductConfigurator.ShowMore":"Show more","OS.ProductConfigurator.ShowLess":"Show less"};ye.use(xs).use(sh).init({resources:{pl:{translation:Ah},en:{translation:_h},de:{translation:Th},cs:{translation:Nh}}});const $h=(e,t,r,n)=>{let i="",a="";const o=Number(e),s=Number(t);return o>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.From")} ${o}`,o>r&&(a=Ne.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Quantity.Message.UpTo")} ${s}`,s<r&&(a=Ne.TOO_MUCH)),o>=0||s>=0&&r<o?(i=`${n("OS.ProductConfigurator.Quantity.Message.Max")}${i}`,i+=` ${n("OS.ProductConfigurator.Quantity.Message.Quantity")}`):o===1&&o===1?i=`${n("OS.ProductConfigurator.Quantity.Message.OneOption")}`:(i="",a=Ne.IGNORE),r>=o&&r<=s&&(a=Ne.OK),{message:i,validationStatus:a}},Ih=(e,t,r,n)=>{let i="",a="";const o=parseInt(e||"-1"),s=parseInt(t||"-1");return o>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.From")} ${o}`,o>r&&(a=Ne.NOT_ENOUGHT)),s>0&&(i+=` ${n("OS.ProductConfigurator.Selected.Message.UpTo")} ${s}`,s<r&&(a=Ne.TOO_MUCH)),o>=0||s>=0?(i=`${n("OS.ProductConfigurator.Selected.Message.Choose")}${i}`,i+=` ${n("OS.ProductConfigurator.Selected.Message.Options")}`):(i="",a=Ne.IGNORE),o===1&&s===1&&(i=`${n("OS.ProductConfigurator.Selected.Message.OneOption")}`),r>=o&&r<=s&&(a=Ne.OK),{message:i,validationStatus:a}},Lh=e=>{const{optionsItem:t,parentSelCtx:r,selected:n,isOnSubmitted:i,actualQtyCnt:a,actualSelCnt:o,children:s}=e,{selCtx:u,details:c={},id:f,attrs:l={}}=t,{qtyMin:d,qtyMax:g,selMin:p,selMax:v}=l,{name:m,description:y}=c.literals||{},{t:b}=ri(),{isExpanded:O,toggleExpanded:A}=Qp(t,r),{validationStatus:E,message:P}=Ih(p,v,o,b),{validationStatus:_,message:I}=$h(d,g,a,b),F=E===Ne.OK,k=_===Ne.OK,W=!F&&i&&!!P,D=!k&&i&&!!I;return V("div",{className:"pt-1 mb-3",id:cs(u),children:[V("div",{className:"flex text-xl font-semibold",children:[C("p",{className:"",children:m}),m&&m!==" "&&V(Ge,{children:[C("div",{className:"ml-auto",children:C(Ur,{price:Kn(n,t)})}),C("svg",{className:`w-8 h-8 ml-2 text-black cursor-pointer ${!O&&"rotate-180"}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",onClick:()=>A(u,f,r),children:C("polyline",{points:"18 15 12 9 6 15"})})]})]}),C("p",{className:`${y&&"mb-2"}`,children:y}),!1,C("div",{className:"flex",children:V("div",{children:[C(Aa,{isOk:F,isErr:W,info:P}),C(Aa,{isOk:k,isErr:D,info:I})]})}),C("div",{className:`${O?"block":"hidden"}`,children:s})]})},Ps=T.default.createContext(null);function Vr(){const e=S.useContext(Ps);if(!e)throw new Error("Missing ComponentsContext");return e}const Rh=e=>{const{optionsItem:t,parentSelCtx:r,nestedLvl:n,parentKind:i,rootProduct:a}=e,{isFilterValidated:o,selected:s,isOnSubmitted:u,selCnt:c,qtyCnt:f,currency:l}=vs(t,n,i,r),{MenuOptionsUI:d}=Vr();if(!o)return null;const g=C(ni,{productItems:t.items,parentProduct:t,rootProduct:a}),p={optionsItem:t,parentSelCtx:r,selected:s,isOnSubmitted:u,actualQtyCnt:f,actualSelCnt:c,currency:l};return d?C(d,{...p,children:g}):C(Lh,{...p,children:g})},Fh=e=>{const{product:t,inputId:r,isDisabled:n,registerProps:i,size:a="lg",children:o}=e,{details:{literals:s}={}}=t,{name:u="",description:c=""}=s||{},f=$o(t),l=fs(t);return V("div",{className:`flex items-center justify-center p-2 pl-3 my-1 rounded-lg bg-white border-2 border-gray-200 ${n&&"opacity-50"}`,children:[C("input",{type:"checkbox",className:`simple-checkbox checkbox-${a} mr-4`,id:r,disabled:n,value:"1",...i}),l&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:l})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:V("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:u}),C("p",{className:"text-sm text-gray-600",children:c})]})}),C("div",{className:"ml-auto",children:o}),C("label",{htmlFor:r,children:C(Ur,{price:parseFloat(f),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})},Dh=e=>{const{product:t,inputId:r,inputValue:n,registerProps:i,isChecked:a,size:o="lg",children:s}=e,{details:{literals:u}={}}=t,{name:c="",description:f=""}=u||{},l=$o(t),d=fs(t);return V("div",{className:"flex items-center justify-between p-2 pl-3 my-1 bg-white border-2 border-gray-200 rounded-xl",children:[C("input",{type:"radio",className:`simple-radio radio-${o} mr-4`,id:r,...i,value:n,checked:a}),d&&C("div",{className:"flex w-20 mr-2 max-h-24",children:C("img",{alt:"Product image",className:"h-auto max-w-full",src:d})}),C("label",{htmlFor:r,className:"flex items-center justify-between w-full",children:V("div",{className:"relative",children:[C("p",{className:"w-full text-lg font-semibold",children:c}),C("p",{className:"text-sm text-gray-600",children:f})]})}),C("div",{className:"ml-auto",children:s}),C("label",{htmlFor:r,children:C(Ur,{price:parseFloat(l||"0"),addPlusBefore:!0,showIfPriceZero:!0,hiddenIfPriceZero:!0})})]})};function Cs(e){const{value:t=0,add:r,subtract:n,disabledSubtract:i,disabledAdd:a,size:o="md"}=e;return V("div",{className:`counter counter-${o} flex flex-row justify-center items-center p-1 border-[1px] rounded-md border-[rgba(229,231,235,255)] product-quantity`,children:[C("button",{type:"button",className:"quantity-button small",onClick:n,disabled:i,children:V("svg",{className:"w-4 h-4 text-black",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})}),C("span",{className:"font-semibold text-gray-700 product-quantity-value",children:t}),C("button",{className:"quantity-button small",type:"button",onClick:r,disabled:a,children:V("svg",{className:"w-4 h-4 text-green-600 ",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})]})})]})}function Mh(e,t,r){const{watch:n,setValue:i,getValues:a,unregister:o}=Ye(),{id:s,selCtx:u,emit:c={},fltCtx:f}=e,l=n(`selected.${u}.${s}`);return S.useEffect(()=>{var v,m,y;if(!r||r>1)return;const d=`filterWithCnt.${f}`,g=`filterWithCnt.${f}.${u}`,p=`filter.${f}`;if(t&&l&&f)if(Me(c)){const b=a(g);(v=Object.keys(b||{}))==null||v.forEach(O=>{o(`${g}.${O}`);const A=Object.keys(a(d)||{});Me(A)?o(`${p}.${O}`):A.forEach(E=>{E!==u&&!a(`${d}.${E}.${O}`)&&o(`${p}.${O}`)})});return}else{const b=a(g),O=a(d);(m=Object.keys(c))==null||m.forEach(A=>{var E;(E=Object.keys(b||{}))==null||E.forEach(P=>{c[P]||(o(`${p}.${P}`),o(`${g}.${P}`))}),Object.keys(O||{}).forEach(P=>{P!==u&&A in a(d==null?void 0:d[P])&&o(`${d}.${P}.${A}`)}),i(`${p}.${A}`,c[A]),i(`${g}.${A}`,{cnt:1,value:c[A]})});return}l&&f&&!Me(c)&&((y=Object.keys(c))==null||y.forEach(b=>{i(`filter.${f}.${b}`,c[b]);const O=a(`${g}.${b}.cnt`)||0;i(`${g}.${b}`,{cnt:O+1,value:c[b]})}))},[l]),{}}function kh(){const e=oe(n=>n.getInvalidSelCtxArray),t=oe(n=>n.isInputEnabled),r=oe(n=>n.isInputCounterIncrementEnabled);return{getInvalidSelCtxArray:e,isInputEnabled:t,isInputCounterIncrementEnabled:r}}const Va=(e,t)=>{Object.keys(e).forEach(r=>{t(`selected.${r}`,e[r])})},$n=(e,t,r)=>{const n=t(`selected.${e}`);console.log("changedSelCtx",n),r(`selected.${e}`,Object.keys(n).reduce((i,a)=>(i[a]=!1,i),{}))},jh=(e,t,r,n,i,a)=>{var d,g;const{items:o,state:s,emit:u,fltCtx:c,selCtx:f}=r,{selected:l={}}=s||{};if(console.log("selected/unselected product",r,n),n){Va(l,e);const p=v=>{var m;!Array.isArray(v)||Me(s==null?void 0:s.selected)||(m=v==null?void 0:v.filter(y=>{var b,O;return!!((O=(b=s.selected)==null?void 0:b[`${y.selCtx}`])!=null&&O[`${y.id}`])}))==null||m.map(y=>{if(y.state&&"selected"in y.state){const{state:{selected:b}}=y;Va(b,e)}Array.isArray(y.items)&&p(y.items)})};p(o)}else{Object.keys(l).forEach(v=>{$n(v,t,e)});const p=v=>{!Array.isArray(v)||v.map(m=>{const{selCtx:y}=m;t(`selected.${y}`)&&$n(y,t,e),p(m.items)})};if(p(o),a&&a<2&&!Me(u)){(d=Object.keys(u))==null||d.forEach(b=>{const O=`filterWithCnt.${c}.${b}.${u[b]}`,A=t(O)||0;A<2?i(O):e(O,A-1)});const v=`filterWithCnt.${c}`,m=`filterWithCnt.${c}.${f}`,y=`filter.${c}`;(g=Object.keys(u))==null||g.forEach(b=>{var A,E,P;const O=t(`${m}.${b}`)||0;if(O)if(O>1)e(`${m}.${b}`,O-1);else{i(`${m}.${b}`);const _=t(v)||{},I=(A=Object.keys(_))==null?void 0:A.filter(F=>F!==f);if(!I)i(`${y}.${b}`);else{const F=I==null?void 0:I.find(k=>{var W;return!!((W=_==null?void 0:_[`${k}`])!=null&&W[`${b}`])});if(!F)i(`${y}.${b}`);else{const k=(P=(E=_==null?void 0:_[`${F}`])==null?void 0:E[`${b}`])==null?void 0:P.value;e(`${y}.${b}`,k)}}}})}}},As=(e,t)=>{var r;if(!e.items||Me(e.items))return null;for(let n=0;n<((r=e.items)==null?void 0:r.length);n++){const i=e.items[n];if(i.selCtx&&i.selCtx===t&&i.kind===Je.PRODUCT)return i;if(i.kind===Je.OPTIONS&&i.items&&i.items.length>0){const a=As(i,t);if(a)return a}}return null};function Uh(e,t,r,n){var he;const{id:i,selCtx:a,emit:o={},fltCtx:s}=e,{allowMultiple:u,selMin:c,selMax:f}=t,{isInputEnabled:l,isInputCounterIncrementEnabled:d}=kh(),g=oe(Z=>Z.refreshForm),p=oe(Z=>Z.currency),{watch:v,getValues:m,setValue:y,register:b,unregister:O}=Ye(),A=v(`selected.${a}.${i}`),{selected:E={}}=m(),P=Number(A||0),_=c==="1"&&f==="1";Mh(e,_,r);const I=!_,F=ip(u),k=P>(_?1:0),W=d(e,E)&&(l(e)||P),D=Number(((he=E==null?void 0:E[a])==null?void 0:he[i])||0)>0,j=l(e)||P,U=`${_?"radio":"selected"}.${a}.${i}`,B=b(U,{onChange:Z=>{pe(Z)}}),Q=()=>{y(`selected.${a}.${i}`,`${P+1}`)},G=()=>{var ce,fe;const Z=P-1;if(y(`selected.${a}.${i}`,`${Z}`),I&&Z===0){y(`selected.${a}.${i}`,!1),(ce=Object.keys(o))==null||ce.forEach(K=>{const se=`filterWithCnt.${s}.${K}.${o[K]}`,ne=m(se)||0;ne<2?O(se):y(se,ne-1)});const xe=K=>{!Array.isArray(K)||K.map(se=>{const{selCtx:ne}=se;m(`selected.${ne}`)&&$n(ne,m,y),xe(se.items)})};if(xe(e.items),r&&r<2&&!Me(o)){const K=`filterWithCnt.${s}`,se=`filterWithCnt.${s}.${a}`,ne=`filter.${s}`;(fe=Object.keys(o))==null||fe.forEach(X=>{var Pe,je,H;const me=m(`${se}.${X}`)||0;if(me)if(me>1)y(`${se}.${X}`,me-1);else{O(`${se}.${X}`);const ie=m(K)||{},ae=(Pe=Object.keys(ie))==null?void 0:Pe.filter(be=>be!==a);if(!ae)O(`${ne}.${X}`);else{const be=ae==null?void 0:ae.find(ar=>{var Kr;return!!((Kr=ie==null?void 0:ie[`${ar}`])!=null&&Kr[`${X}`])});if(!be)O(`${ne}.${X}`);else{const ar=(H=(je=ie==null?void 0:ie[`${be}`])==null?void 0:je[`${X}`])==null?void 0:H.value;y(`${ne}.${X}`,ar)}}}})}}},pe=Z=>{var K;const{target:{checked:ce,name:fe,defaultValue:xe}}=Z;if(jh(y,m,e,ce,O,r),_){console.log("handleOnInputChange radio",fe,xe);const se=(K=n==null?void 0:n.items)==null?void 0:K.filter(X=>X.id!==e.id);for(const X of Object.keys(E||{})){const me=se!=null&&se.some(Pe=>!!As(Pe,X))?X:!1;console.log("isImportantItem",me),me&&y(`selected.${X}`,!1)}const ne="selected."+fe.replace("radio.","").split(".")[0];y(ne,{[xe]:"1"}),g()}};return{registerProps:B,isRadio:_,isCheckbox:I,isCounter:F,isDecrementEnabled:k,isIncrementEnabled:W,isChecked:D,isCheckboxEnabled:j,handleCounterIncrementQty:Q,handleCounterDecrementQty:G,counterValue:P,handleOnInputChange:pe,inputId:`${a}.${i}`,radioInputValue:i,currency:p}}const Vh=e=>{const{product:t,parentAttrs:r,nestedLvl:n,parentProduct:i,rootProduct:a}=e,{registerProps:o,inputId:s,radioInputValue:u,isRadio:c,isCheckbox:f,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:v,counterValue:m,handleCounterIncrementQty:y,handleCounterDecrementQty:b,currency:O}=Uh(t,r,n,i),{MenuProductUI:A}=Vr(),E={product:t,nestedLvl:n,registerProps:o,inputId:s,radioInputValue:u,isRadio:c,isCheckbox:f,isCounter:l,isDecrementEnabled:d,isIncrementEnabled:g,isChecked:p,isCheckboxEnabled:v,counterValue:m,handleCounterIncrementQty:y,handleCounterDecrementQty:b,currency:O,parentProduct:i},P=C(ni,{productItems:t.items,parentProduct:t,nestedLvl:n+1,rootProduct:a});return A?C(A,{...E,children:P}):C(Bh,{...E,children:P})},Bh=e=>{const{product:t,nestedLvl:r,registerProps:n,inputId:i,radioInputValue:a,isRadio:o,isCheckbox:s,isCounter:u,isDecrementEnabled:c,isIncrementEnabled:f,isChecked:l,isCheckboxEnabled:d,counterValue:g,handleCounterIncrementQty:p,handleCounterDecrementQty:v,children:m}=e,y=C(Cs,{value:g,add:p,subtract:v,disabledSubtract:!c,disabledAdd:!f}),b=()=>o?C(Dh,{product:t,inputId:i,inputValue:a,registerProps:n,isChecked:l,children:C(Ge,{children:u&&y})}):s?C(Fh,{product:t,inputId:i,registerProps:n,isDisabled:!d,children:C(Ge,{children:u&&y})}):null,O=!Me(t.items)&&g,A=fi.useTransition(O,{from:{opacity:0,transform:"translateY(-10px)"},enter:{opacity:1,transform:"translateY(0)"}});return V("div",{children:[b(),O?A((E,P)=>P&&C(fi.animated.div,{className:`border-l-[2px] border-gray-300 ${r>=1&&"ml-4 pl-4"}`,style:E,children:m},r+1)):null]})};function Hh(){return{isMenuProductToShow:r=>r.kind===Je.PRODUCT&&xa(r),isMenuOptionsToShow:r=>[Je.OPTIONS,Je.CONFIG].includes(r.kind)&&xa(r)}}function ni(e){const{productItems:t,nestedLvl:r=1,parentProduct:n,rootProduct:i}=e,{attrs:a={},selCtx:o,kind:s}=n,{isMenuProductToShow:u,isMenuOptionsToShow:c}=Hh(),{MenuItemsUI:f}=Vr(),d={productItems:t,parentProduct:n,renderMenuItem:g=>c(g)?C(Rh,{optionsItem:g,parentSelCtx:o,parentKind:s,nestedLvl:r,rootProduct:i}):u(g)?C(Vh,{product:g,parentAttrs:a,parentProduct:n,nestedLvl:r,rootProduct:i}):C(Ge,{}),rootProduct:i};return f?C(f,{...d}):C(Wh,{...d})}function Wh(e){const{productItems:t,parentProduct:r,renderMenuItem:n}=e,i=r.kind!==Je.PRODUCT,a=99,o=3,[s,u]=S.useState(i?o:a),{t:c}=ri(),f=()=>{u(a)},l=()=>{u(o)};return C(Ge,{children:t.map((d,g)=>{if(g<s)return V("div",{children:[n(d),s===a&&i&&t.length===g+1&&Ba(c("OS.ProductConfigurator.ShowLess"),l,!1)]},`${r.id}--${d.id}--${g}`);if(g===s)return Ba(c("OS.ProductConfigurator.ShowMore"),f,!0)})})}const Ba=(e,t,r)=>C("div",{className:"flex justify-center w-full",children:V("button",{className:"flex px-2 text-lg font-semibold text-black",onClick:t,children:[e,V("svg",{className:`-mr-2 w-7 h-7 ${!r&&"rotate-180"}`,width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("polyline",{points:"7 7 12 12 17 7"})," ",C("polyline",{points:"7 13 12 18 17 13"})]})]})},`${e}`),_s=()=>{const{watch:e}=Ye(),t=e("selected"),r=e("filter"),n=e("filterWithCnt"),i=oe(a=>a.validationMap);return console.log({selected:t,validationMap:i,filter:r,filterWithCnt:n}),V("div",{className:"flex flex-col items-center py-4",children:[C("h2",{className:"mb-4 text-2xl font-bold tracking-wide",children:"Selected State"}),Object.keys(t).map(a=>C("div",{children:Object.values(t[a]).filter(o=>o).length>0&&V(Ge,{children:[V("p",{className:"text-lg font-semibold",children:[a,":"]}),Object.keys(t[a]).map(o=>C(T.default.Fragment,{children:t[a][o]&&V("p",{children:[o,":",t[a][o].toString()]})},o))]})},a))]})};function Ha(e){const{finalPrice:t,isBackIcon:r=!0,handleGoBack:n,displayPriceFrom:i=!1,productQuantity:a,increaseProductQuantity:o,decreaseProductQuantity:s,handleOnSubmit:u}=e,{t:c}=ri();return V("div",{className:"flex items-center justify-around w-full h-16 px-4",children:[r&&V("button",{className:"inline-flex items-center px-2 py-1 font-bold text-red-600 border-2 border-red-600 border-solid rounded hover:bg-red-200",onClick:n,children:[V("svg",{className:"w-5 h-5 text-red-600",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"}),C("line",{x1:"5",y1:"12",x2:"19",y2:"12"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"18"}),C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]}),C("span",{className:"uppercase",children:`${c("OS.ProductConfigurator.Back")}`})]}),C("div",{className:"px-3",children:C(Cs,{value:a,add:o,subtract:s,disabledSubtract:a===1,size:"lg"})}),V("button",{type:"submit",className:"flex items-center justify-center w-2/4 px-2 py-1 font-bold text-white bg-green-600 border-2 border-green-600 border-solid rounded hover:bg-green-800 sm:w-3/5",style:{opacity:`${i?"0.4":"1"}`},disabled:i,onClick:u,children:[V("svg",{className:"w-5 h-5 mr-2 text-white",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[C("circle",{cx:"9",cy:"21",r:"1"})," ",C("circle",{cx:"20",cy:"21",r:"1"}),C("path",{d:"M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"})]}),i?C("span",{children:`${c("OS.ProductConfigurator.Selected.Message.From")} ${t}`}):C("span",{className:"uppercase",children:`${c("OS.ProductConfigurator.Add")} ${t}`})]})]})}const cr=640,Ts=e=>{const{isModal:t=!1}=e,[r,n]=S.useState(window.innerWidth),[i,a]=S.useState(window.innerHeight),[o,s]=S.useState(window.innerWidth<=cr),[u,c]=S.useState(window.innerWidth>cr&&!t);function f(){n(window.innerWidth),a(window.innerHeight)}return S.useEffect(()=>(window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}),[]),S.useEffect(()=>{c(window.innerWidth>cr&&!t),s(window.innerWidth<=cr)},[r,e,t]),{isSm:u,isMobile:o,width:r,windowHeight:i}};function Ns(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Ns(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Vt(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Ns(e))&&(n&&(n+=" "),n+=t);return n}var Gh=Object.defineProperty,Kh=(e,t,r)=>t in e?Gh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,gn=(e,t,r)=>(Kh(e,typeof t!="symbol"?t+"":t,r),r);class Yh{constructor(){gn(this,"current",this.detect()),gn(this,"handoffState","pending"),gn(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window=="undefined"||typeof document=="undefined"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}}let Ze=new Yh,$e=(e,t)=>{Ze.isServer?S.useEffect(e,t):S.useLayoutEffect(e,t)};function Xe(e){let t=S.useRef(e);return $e(()=>{t.current=e},[e]),t}let re=function(e){let t=Xe(e);return T.default.useCallback((...r)=>t.current(...r),[t])};function Br(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(t=>setTimeout(()=>{throw t}))}function wt(){let e=[],t={addEventListener(r,n,i,a){return r.addEventListener(n,i,a),t.add(()=>r.removeEventListener(n,i,a))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return t.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return t.requestAnimationFrame(()=>t.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return t.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Br(()=>{n.current&&r[0]()}),t.add(()=>{n.current=!1})},style(r,n,i){let a=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:i}),this.add(()=>{Object.assign(r.style,{[n]:a})})},group(r){let n=wt();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let i of e.splice(n,1))i()}},dispose(){for(let r of e.splice(0))r()}};return t}function ii(){let[e]=S.useState(wt);return S.useEffect(()=>()=>e.dispose(),[e]),e}function zh(){let e=typeof document=="undefined";return"useSyncExternalStore"in st?(t=>t.useSyncExternalStore)(st)(()=>()=>{},()=>!1,()=>!e):!1}function Lt(){let e=zh(),[t,r]=st.useState(Ze.isHandoffComplete);return t&&Ze.isHandoffComplete===!1&&r(!1),st.useEffect(()=>{t!==!0&&r(!0)},[t]),st.useEffect(()=>Ze.handoff(),[]),e?!1:t}var Wa;let Rt=(Wa=T.default.useId)!=null?Wa:function(){let e=Lt(),[t,r]=T.default.useState(e?()=>Ze.nextId():null);return $e(()=>{t===null&&r(Ze.nextId())},[t]),t!=null?""+t:void 0};function ve(e,t,...r){if(e in t){let i=t[e];return typeof i=="function"?i(...r):i}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map(i=>`"${i}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,ve),n}function $s(e){return Ze.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let In=["[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(",");var gt=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(gt||{}),Is=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Is||{}),Qh=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Qh||{});function qh(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(In)).sort((t,r)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var Ls=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Ls||{});function Jh(e,t=0){var r;return e===((r=$s(e))==null?void 0:r.body)?!1:ve(t,{[0](){return e.matches(In)},[1](){let n=e;for(;n!==null;){if(n.matches(In))return!0;n=n.parentElement}return!1}})}var Zh=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Zh||{});typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function mt(e){e==null||e.focus({preventScroll:!0})}let Xh=["textarea","input"].join(",");function em(e){var t,r;return(r=(t=e==null?void 0:e.matches)==null?void 0:t.call(e,Xh))!=null?r:!1}function tm(e,t=r=>r){return e.slice().sort((r,n)=>{let i=t(r),a=t(n);if(i===null||a===null)return 0;let o=i.compareDocumentPosition(a);return o&Node.DOCUMENT_POSITION_FOLLOWING?-1:o&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function mr(e,t,{sorted:r=!0,relativeTo:n=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,o=Array.isArray(e)?r?tm(e):e:qh(e);i.length>0&&o.length>1&&(o=o.filter(g=>!i.includes(g))),n=n!=null?n:a.activeElement;let s=(()=>{if(t&5)return 1;if(t&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(t&1)return 0;if(t&2)return Math.max(0,o.indexOf(n))-1;if(t&4)return Math.max(0,o.indexOf(n))+1;if(t&8)return o.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=t&32?{preventScroll:!0}:{},f=0,l=o.length,d;do{if(f>=l||f+l<=0)return 0;let g=u+f;if(t&16)g=(g+l)%l;else{if(g<0)return 3;if(g>=l)return 1}d=o[g],d==null||d.focus(c),f+=s}while(d!==a.activeElement);return t&6&&em(d)&&d.select(),2}function Rs(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function rm(){return/Android/gi.test(window.navigator.userAgent)}function nm(){return Rs()||rm()}function fr(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return document.addEventListener(e,i,r),()=>document.removeEventListener(e,i,r)},[e,r])}function Fs(e,t,r){let n=Xe(t);S.useEffect(()=>{function i(a){n.current(a)}return window.addEventListener(e,i,r),()=>window.removeEventListener(e,i,r)},[e,r])}function im(e,t,r=!0){let n=S.useRef(!1);S.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function i(o,s){if(!n.current||o.defaultPrevented)return;let u=s(o);if(u===null||!u.getRootNode().contains(u)||!u.isConnected)return;let c=function f(l){return typeof l=="function"?f(l()):Array.isArray(l)||l instanceof Set?l:[l]}(e);for(let f of c){if(f===null)continue;let l=f instanceof HTMLElement?f:f.current;if(l!=null&&l.contains(u)||o.composed&&o.composedPath().includes(l))return}return!Jh(u,Ls.Loose)&&u.tabIndex!==-1&&o.preventDefault(),t(o,u)}let a=S.useRef(null);fr("pointerdown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),fr("mousedown",o=>{var s,u;n.current&&(a.current=((u=(s=o.composedPath)==null?void 0:s.call(o))==null?void 0:u[0])||o.target)},!0),fr("click",o=>{nm()||a.current&&(i(o,()=>a.current),a.current=null)},!0),fr("touchend",o=>i(o,()=>o.target instanceof HTMLElement?o.target:null),!0),Fs("blur",o=>i(o,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function rr(...e){return S.useMemo(()=>$s(...e),[...e])}let Ds=Symbol();function am(e,t=!0){return Object.assign(e,{[Ds]:t})}function ke(...e){let t=S.useRef(e);S.useEffect(()=>{t.current=e},[e]);let r=re(n=>{for(let i of t.current)i!=null&&(typeof i=="function"?i(n):i.current=n)});return e.every(n=>n==null||(n==null?void 0:n[Ds]))?void 0:r}function ai(e,t){let r=S.useRef([]),n=re(e);S.useEffect(()=>{let i=[...r.current];for(let[a,o]of t.entries())if(r.current[a]!==o){let s=n(t,i);return r.current=t,s}},[n,...t])}function Ar(...e){return Array.from(new Set(e.flatMap(t=>typeof t=="string"?t.split(" "):[]))).filter(Boolean).join(" ")}var _r=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(_r||{}),ot=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(ot||{});function Re({ourProps:e,theirProps:t,slot:r,defaultTag:n,features:i,visible:a=!0,name:o,mergeRefs:s}){s=s!=null?s:om;let u=Ms(t,e);if(a)return dr(u,r,n,o,s);let c=i!=null?i:0;if(c&2){let{static:f=!1,...l}=u;if(f)return dr(l,r,n,o,s)}if(c&1){let{unmount:f=!0,...l}=u;return ve(f?0:1,{[0](){return null},[1](){return dr({...l,hidden:!0,style:{display:"none"}},r,n,o,s)}})}return dr(u,r,n,o,s)}function dr(e,t={},r,n,i){let{as:a=r,children:o,refName:s="ref",...u}=pn(e,["unmount","static"]),c=e.ref!==void 0?{[s]:e.ref}:{},f=typeof o=="function"?o(t):o;"className"in u&&u.className&&typeof u.className=="function"&&(u.className=u.className(t));let l={};if(t){let d=!1,g=[];for(let[p,v]of Object.entries(t))typeof v=="boolean"&&(d=!0),v===!0&&g.push(p);d&&(l["data-headlessui-state"]=g.join(" "))}if(a===S.Fragment&&Object.keys(Ga(u)).length>0){if(!S.isValidElement(f)||Array.isArray(f)&&f.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(u).map(v=>` - ${v}`).join(`
12
12
  `),"","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(v=>` - ${v}`).join(`
13
13
  `)].join(`
14
- `));let d=f.props,g=typeof(d==null?void 0:d.className)=="function"?(...v)=>Ar(d==null?void 0:d.className(...v),u.className):Ar(d==null?void 0:d.className,u.className),p=g?{className:g}:{};return S.cloneElement(f,Object.assign({},Ms(f.props,Ga(pn(u,["ref"]))),l,c,{ref:i(f.ref,c.ref)},p))}return S.createElement(a,Object.assign({},pn(u,["ref"]),a!==S.Fragment&&c,a!==S.Fragment&&l),f)}function om(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Ms(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...a){let o=r[n];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function _e(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ga(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function pn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let sm="div";var Tr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Tr||{});function um(e,t){var r;let{features:n=1,...i}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Re({ourProps:a,theirProps:i,slot:{},defaultTag:sm,name:"Hidden"})}let Ln=_e(um),oi=S.createContext(null);oi.displayName="OpenClosedContext";var Ae=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ae||{});function si(){return S.useContext(oi)}function lm({value:e,children:t}){return T.default.createElement(oi.Provider,{value:e},t)}function cm(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",t),t())}let it=[];cm(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&it[0]!==t.target&&(it.unshift(t.target),it=it.filter(r=>r!=null&&r.isConnected),it.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function fm(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&dm(r)?!1:n}function dm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var ks=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ks||{});function js(e,t,r,n){let i=Xe(r);S.useEffect(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}function nr(){let e=S.useRef(!1);return $e(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Us(e){let t=re(e),r=S.useRef(!1);S.useEffect(()=>(r.current=!1,()=>{r.current=!0,Br(()=>{r.current&&t()})}),[t])}var Gt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Gt||{});function gm(){let e=S.useRef(0);return Fs("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Vs(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let pm="div";var Bs=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Bs||{});function hm(e,t){let r=S.useRef(null),n=ke(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;Lt()||(o=1);let u=rr(r);ym({ownerDocument:u},Boolean(o&16));let c=bm({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));Sm({ownerDocument:u,container:r,containers:a,previousActiveElement:c},Boolean(o&8));let f=gm(),l=re(v=>{let m=r.current;!m||(y=>y())(()=>{ve(f.current,{[Gt.Forwards]:()=>{mr(m,gt.First,{skipElements:[v.relatedTarget]})},[Gt.Backwards]:()=>{mr(m,gt.Last,{skipElements:[v.relatedTarget]})}})})}),d=ii(),g=S.useRef(!1),p={ref:n,onKeyDown(v){v.key=="Tab"&&(g.current=!0,d.requestAnimationFrame(()=>{g.current=!1}))},onBlur(v){let m=Vs(a);r.current instanceof HTMLElement&&m.add(r.current);let y=v.relatedTarget;y instanceof HTMLElement&&y.dataset.headlessuiFocusGuard!=="true"&&(Hs(m,y)||(g.current?mr(r.current,ve(f.current,{[Gt.Forwards]:()=>gt.Next,[Gt.Backwards]:()=>gt.Previous})|gt.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&mt(v.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(Ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Tr.Focusable}),Re({ourProps:p,theirProps:s,defaultTag:pm,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(Ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Tr.Focusable}))}let mm=_e(hm),Bt=Object.assign(mm,{features:Bs});function vm(e=!0){let t=S.useRef(it.slice());return ai(([r],[n])=>{n===!0&&r===!1&&Br(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=it.slice())},[e,it,t]),re(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function ym({ownerDocument:e},t){let r=vm(t);ai(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&mt(r())},[t]),Us(()=>{t&&mt(r())})}function bm({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),a=nr();return ai(()=>{if(!n)return;let o=t.current;o&&Br(()=>{if(!a.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){i.current=s;return}}else if(o.contains(s)){i.current=s;return}r!=null&&r.current?mt(r.current):mr(o,gt.First)===Is.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function Sm({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=nr();js(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=Vs(r);t.current instanceof HTMLElement&&s.add(t.current);let u=n.current;if(!u)return;let c=o.target;c&&c instanceof HTMLElement?Hs(s,c)?(n.current=c,mt(c)):(o.preventDefault(),o.stopPropagation(),mt(u)):mt(n.current)},!0)}function Hs(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let Ws=S.createContext(!1);function Om(){return S.useContext(Ws)}function Rn(e){return T.default.createElement(Ws.Provider,{value:e.force},e.children)}function wm(e){let t=Om(),r=S.useContext(Gs),n=rr(e),[i,a]=S.useState(()=>{if(!t&&r!==null||Ze.isServer)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return S.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),S.useEffect(()=>{t||r!==null&&a(r.current)},[r,a,t]),i}let Em=S.Fragment;function xm(e,t){let r=e,n=S.useRef(null),i=ke(am(f=>{n.current=f}),t),a=rr(n),o=wm(n),[s]=S.useState(()=>{var f;return Ze.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),u=S.useContext(Fn),c=Lt();return $e(()=>{!o||!s||o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s))},[o,s]),$e(()=>{if(s&&u)return u.register(s)},[u,s]),Us(()=>{var f;!o||!s||(s instanceof Node&&o.contains(s)&&o.removeChild(s),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))}),c?!o||!s?null:tu.createPortal(Re({ourProps:{ref:i},theirProps:r,defaultTag:Em,name:"Portal"}),s):null}let Pm=S.Fragment,Gs=S.createContext(null);function Cm(e,t){let{target:r,...n}=e,i={ref:ke(t)};return T.default.createElement(Gs.Provider,{value:r},Re({ourProps:i,theirProps:n,defaultTag:Pm,name:"Popover.Group"}))}let Fn=S.createContext(null);function Am(){let e=S.useContext(Fn),t=S.useRef([]),r=re(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=re(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),i=S.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,S.useMemo(()=>function({children:a}){return T.default.createElement(Fn.Provider,{value:i},a)},[i])]}let _m=_e(xm),Tm=_e(Cm),Dn=Object.assign(_m,{Group:Tm});function Nm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const $m=typeof Object.is=="function"?Object.is:Nm,{useState:Im,useEffect:Lm,useLayoutEffect:Rm,useDebugValue:Fm}=st;function Dm(e,t,r){const n=t(),[{inst:i},a]=Im({inst:{value:n,getSnapshot:t}});return Rm(()=>{i.value=n,i.getSnapshot=t,hn(i)&&a({inst:i})},[e,n,t]),Lm(()=>(hn(i)&&a({inst:i}),e(()=>{hn(i)&&a({inst:i})})),[e]),Fm(n),n}function hn(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!$m(r,n)}catch{return!0}}function Mm(e,t,r){return t()}const km=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",jm=!km,Um=jm?Mm:Dm,Vm="useSyncExternalStore"in st?(e=>e.useSyncExternalStore)(st):Um;function Bm(e){return Vm(e.subscribe,e.getSnapshot,e.getSnapshot)}function Hm(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(i){return n.add(i),()=>n.delete(i)},dispatch(i,...a){let o=t[i].call(r,...a);o&&(r=o,n.forEach(s=>s()))}}}function Wm(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,i=n.clientWidth-n.offsetWidth,a=e-i;r.style(n,"paddingRight",`${a}px`)}}}function Gm(){return Rs()?{before({doc:e,d:t,meta:r}){function n(i){return r.containers.flatMap(a=>a()).some(a=>a.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=wt();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let a=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let u=s.target.closest("a");if(!u)return;let{hash:c}=new URL(u.href),f=e.querySelector(c);f&&!n(f)&&(o=f)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&n(u.parentElement);)u=u.parentElement;t.style(u,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&u.dataset.headlessuiPortal!==""&&!(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth);)u=u.parentElement;u.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()},{passive:!1}),t.add(()=>{var s;let u=(s=window.scrollY)!=null?s:window.pageYOffset;a!==u&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function Km(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ym(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let ht=Hm(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:wt(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:Ym(r)},i=[Gm(),Wm(),Km()];i.forEach(({before:a})=>a==null?void 0:a(n)),i.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ht.subscribe(()=>{let e=ht.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",i=r.count!==0;(i&&!n||!i&&n)&&ht.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&ht.dispatch("TEARDOWN",r)}});function zm(e,t,r){let n=Bm(ht),i=e?n.get(e):void 0,a=i?i.count>0:!1;return $e(()=>{if(!(!e||!t))return ht.dispatch("PUSH",e,r),()=>ht.dispatch("POP",e,r)},[t,e]),a}let mn=new Map,Ht=new Map;function Ka(e,t=!0){$e(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function i(){var o;if(!n)return;let s=(o=Ht.get(n))!=null?o:1;if(s===1?Ht.delete(n):Ht.set(n,s-1),s!==1)return;let u=mn.get(n);u&&(u["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",u["aria-hidden"]),n.inert=u.inert,mn.delete(n))}let a=(r=Ht.get(n))!=null?r:0;return Ht.set(n,a+1),a!==0||(mn.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),i},[e,t])}function Qm({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let i=S.useRef((n=r==null?void 0:r.current)!=null?n:null),a=rr(i),o=re(()=>{var s,u,c;let f=[];for(let l of e)l!==null&&(l instanceof HTMLElement?f.push(l):"current"in l&&l.current instanceof HTMLElement&&f.push(l.current));if(t!=null&&t.current)for(let l of t.current)f.push(l);for(let l of(s=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(i.current)||l.contains((c=(u=i.current)==null?void 0:u.getRootNode())==null?void 0:c.host)||f.some(d=>l.contains(d))||f.push(l));return f});return{resolveContainers:o,contains:re(s=>o().some(u=>u.contains(s))),mainTreeNodeRef:i,MainTreeNode:S.useMemo(()=>function(){return r!=null?null:T.default.createElement(Ln,{features:Tr.Hidden,ref:i})},[i,r])}}let ui=S.createContext(()=>{});ui.displayName="StackContext";var Mn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Mn||{});function qm(){return S.useContext(ui)}function Jm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=qm(),o=re((...s)=>{t==null||t(...s),a(...s)});return $e(()=>{let s=i===void 0||i===!0;return s&&o(0,r,n),()=>{s&&o(1,r,n)}},[o,r,n,i]),T.default.createElement(ui.Provider,{value:o},e)}let Ks=S.createContext(null);function Ys(){let e=S.useContext(Ks);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,Ys),t}return e}function Zm(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=re(a=>(t(o=>[...o,a]),()=>t(o=>{let s=o.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s}))),i=S.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return T.default.createElement(Ks.Provider,{value:i},r.children)},[t])]}let Xm="p";function ev(e,t){let r=Rt(),{id:n=`headlessui-description-${r}`,...i}=e,a=Ys(),o=ke(t);$e(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return Re({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:Xm,name:a.name||"Description"})}let tv=_e(ev),rv=Object.assign(tv,{});var nv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(nv||{}),iv=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(iv||{});let av={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Nr=S.createContext(null);Nr.displayName="DialogContext";function ir(e){let t=S.useContext(Nr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ir),r}return t}function ov(e,t,r=()=>[document.body]){zm(e,t,n=>{var i;return{containers:[...(i=n.containers)!=null?i:[],r]}})}function sv(e,t){return ve(t.type,av,e,t)}let uv="div",lv=_r.RenderStrategy|_r.Static;function cv(e,t){let r=Rt(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:a,initialFocus:o,role:s="dialog",__demoMode:u=!1,...c}=e,[f,l]=S.useState(0),d=S.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(d.current||(d.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=si();i===void 0&&g!==null&&(i=(g&Ae.Open)===Ae.Open);let p=S.useRef(null),v=ke(p,t),m=rr(p),y=e.hasOwnProperty("open")||g!==null,b=e.hasOwnProperty("onClose");if(!y&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!y)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof a!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let O=i?0:1,[A,E]=S.useReducer(sv,{titleId:null,descriptionId:null,panelRef:S.createRef()}),P=re(()=>a(!1)),_=re(H=>E({type:0,id:H})),I=Lt()?u?!1:O===0:!1,F=f>1,k=S.useContext(Nr)!==null,[W,D]=Am(),j={get current(){var H;return(H=A.panelRef.current)!=null?H:p.current}},{resolveContainers:U,mainTreeNodeRef:B,MainTreeNode:Q}=Qm({portals:W,defaultContainers:[j]}),G=F?"parent":"leaf",pe=g!==null?(g&Ae.Closing)===Ae.Closing:!1,he=(()=>k||pe?!1:I)(),Z=S.useCallback(()=>{var H,ie;return(ie=Array.from((H=m==null?void 0:m.querySelectorAll("body > *"))!=null?H:[]).find(ae=>ae.id==="headlessui-portal-root"?!1:ae.contains(B.current)&&ae instanceof HTMLElement))!=null?ie:null},[B]);Ka(Z,he);let ce=(()=>F?!0:I)(),fe=S.useCallback(()=>{var H,ie;return(ie=Array.from((H=m==null?void 0:m.querySelectorAll("[data-headlessui-portal]"))!=null?H:[]).find(ae=>ae.contains(B.current)&&ae instanceof HTMLElement))!=null?ie:null},[B]);Ka(fe,ce);let xe=(()=>!(!I||F))();im(U,H=>{H.preventDefault(),P()},xe);let K=(()=>!(F||O!==0))();js(m==null?void 0:m.defaultView,"keydown",H=>{K&&(H.defaultPrevented||H.key===ks.Escape&&(H.preventDefault(),H.stopPropagation(),P()))});let se=(()=>!(pe||O!==0||k))();ov(m,se,U),S.useEffect(()=>{if(O!==0||!p.current)return;let H=new ResizeObserver(ie=>{for(let ae of ie){let be=ae.target.getBoundingClientRect();be.x===0&&be.y===0&&be.width===0&&be.height===0&&P()}});return H.observe(p.current),()=>H.disconnect()},[O,p,P]);let[ne,X]=Zm(),me=S.useMemo(()=>[{dialogState:O,close:P,setTitleId:_},A],[O,A,P,_]),Pe=S.useMemo(()=>({open:O===0}),[O]),je={ref:v,id:n,role:s,"aria-modal":O===0?!0:void 0,"aria-labelledby":A.titleId,"aria-describedby":ne};return T.default.createElement(Jm,{type:"Dialog",enabled:O===0,element:p,onUpdate:re((H,ie)=>{ie==="Dialog"&&ve(H,{[Mn.Add]:()=>l(ae=>ae+1),[Mn.Remove]:()=>l(ae=>ae-1)})})},T.default.createElement(Rn,{force:!0},T.default.createElement(Dn,null,T.default.createElement(Nr.Provider,{value:me},T.default.createElement(Dn.Group,{target:p},T.default.createElement(Rn,{force:!1},T.default.createElement(X,{slot:Pe,name:"Dialog.Description"},T.default.createElement(Bt,{initialFocus:o,containers:U,features:I?ve(G,{parent:Bt.features.RestoreFocus,leaf:Bt.features.All&~Bt.features.FocusLock}):Bt.features.None},T.default.createElement(D,null,Re({ourProps:je,theirProps:c,slot:Pe,defaultTag:uv,features:lv,visible:O===0,name:"Dialog"}))))))))),T.default.createElement(Q,null))}let fv="div";function dv(e,t){let r=Rt(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=ir("Dialog.Overlay"),s=ke(t),u=re(f=>{if(f.target===f.currentTarget){if(fm(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),o()}}),c=S.useMemo(()=>({open:a===0}),[a]);return Re({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:c,defaultTag:fv,name:"Dialog.Overlay"})}let gv="div";function pv(e,t){let r=Rt(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Backdrop"),s=ke(t);S.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let u=S.useMemo(()=>({open:a===0}),[a]);return T.default.createElement(Rn,{force:!0},T.default.createElement(Dn,null,Re({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:gv,name:"Dialog.Backdrop"})))}let hv="div";function mv(e,t){let r=Rt(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Panel"),s=ke(t,o.panelRef),u=S.useMemo(()=>({open:a===0}),[a]),c=re(f=>{f.stopPropagation()});return Re({ourProps:{ref:s,id:n,onClick:c},theirProps:i,slot:u,defaultTag:hv,name:"Dialog.Panel"})}let vv="h2";function yv(e,t){let r=Rt(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=ir("Dialog.Title"),s=ke(t);S.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=S.useMemo(()=>({open:a===0}),[a]);return Re({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:vv,name:"Dialog.Title"})}let bv=_e(cv),Sv=_e(pv),Ov=_e(mv),wv=_e(dv),Ev=_e(yv),Ya=Object.assign(bv,{Backdrop:Sv,Panel:Ov,Overlay:wv,Title:Ev,Description:rv});function xv(e=0){let[t,r]=S.useState(e),n=nr(),i=S.useCallback(u=>{n.current&&r(c=>c|u)},[t,n]),a=S.useCallback(u=>Boolean(t&u),[t]),o=S.useCallback(u=>{n.current&&r(c=>c&~u)},[r,n]),s=S.useCallback(u=>{n.current&&r(c=>c^u)},[r]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:s}}function Pv(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function vn(e,...t){e&&t.length>0&&e.classList.add(...t)}function yn(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Cv(e,t){let r=wt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(u=>{let[c=0]=u.split(",").filter(Boolean).map(f=>f.includes("ms")?parseFloat(f):parseFloat(f)*1e3).sort((f,l)=>l-f);return c}),s=a+o;if(s!==0){r.group(c=>{c.setTimeout(()=>{t(),c.dispose()},s),c.addEventListener(e,"transitionrun",f=>{f.target===f.currentTarget&&c.dispose()})});let u=r.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),u())})}else t();return r.add(()=>t()),r.dispose}function Av(e,t,r,n){let i=r?"enter":"leave",a=wt(),o=n!==void 0?Pv(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=ve(i,{enter:()=>t.enter,leave:()=>t.leave}),u=ve(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=ve(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return yn(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),vn(e,...t.base,...s,...c),a.nextFrame(()=>{yn(e,...t.base,...s,...c),vn(e,...t.base,...s,...u),Cv(e,()=>(yn(e,...t.base,...s),vn(e,...t.base,...t.entered),o()))}),a.dispose}function _v({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let o=nr(),s=ii(),u=Xe(r);$e(()=>{e&&(u.current="enter")},[e]),$e(()=>{let c=wt();s.add(c.dispose);let f=t.current;if(f&&u.current!=="idle"&&o.current)return c.dispose(),i.current(u.current),c.add(Av(f,n.current,u.current==="enter",()=>{c.dispose(),a.current(u.current)})),c.dispose},[r])}function nt(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Hr=S.createContext(null);Hr.displayName="TransitionContext";var Tv=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Tv||{});function Nv(){let e=S.useContext(Hr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function $v(){let e=S.useContext(Wr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Wr=S.createContext(null);Wr.displayName="NestingContext";function Gr(e){return"children"in e?Gr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function zs(e,t){let r=Xe(e),n=S.useRef([]),i=nr(),a=ii(),o=re((g,p=ot.Hidden)=>{let v=n.current.findIndex(({el:m})=>m===g);v!==-1&&(ve(p,{[ot.Unmount](){n.current.splice(v,1)},[ot.Hidden](){n.current[v].state="hidden"}}),a.microTask(()=>{var m;!Gr(n)&&i.current&&((m=r.current)==null||m.call(r))}))}),s=re(g=>{let p=n.current.find(({el:v})=>v===g);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:g,state:"visible"}),()=>o(g,ot.Unmount)}),u=S.useRef([]),c=S.useRef(Promise.resolve()),f=S.useRef({enter:[],leave:[],idle:[]}),l=re((g,p,v)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([m])=>m!==g)),t==null||t.chains.current[p].push([g,new Promise(m=>{u.current.push(m)})]),t==null||t.chains.current[p].push([g,new Promise(m=>{Promise.all(f.current[p].map(([y,b])=>b)).then(()=>m())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),d=re((g,p,v)=>{Promise.all(f.current[p].splice(0).map(([m,y])=>y)).then(()=>{var m;(m=u.current.shift())==null||m()}).then(()=>v(p))});return S.useMemo(()=>({children:n,register:s,unregister:o,onStart:l,onStop:d,wait:c,chains:f}),[s,o,n,l,d,f,c])}function Iv(){}let Lv=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function za(e){var t;let r={};for(let n of Lv)r[n]=(t=e[n])!=null?t:Iv;return r}function Rv(e){let t=S.useRef(za(e));return S.useEffect(()=>{t.current=za(e)},[e]),t}let Fv="div",Qs=_r.RenderStrategy;function Dv(e,t){var r,n;let{beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:u,enterFrom:c,enterTo:f,entered:l,leave:d,leaveFrom:g,leaveTo:p,...v}=e,m=S.useRef(null),y=ke(m,t),b=(r=v.unmount)==null||r?ot.Unmount:ot.Hidden,{show:O,appear:A,initial:E}=Nv(),[P,_]=S.useState(O?"visible":"hidden"),I=$v(),{register:F,unregister:k}=I;S.useEffect(()=>F(m),[F,m]),S.useEffect(()=>{if(b===ot.Hidden&&m.current){if(O&&P!=="visible"){_("visible");return}return ve(P,{hidden:()=>k(m),visible:()=>F(m)})}},[P,m,F,k,O,b]);let W=Xe({base:nt(v.className),enter:nt(u),enterFrom:nt(c),enterTo:nt(f),entered:nt(l),leave:nt(d),leaveFrom:nt(g),leaveTo:nt(p)}),D=Rv({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),j=Lt();S.useEffect(()=>{if(j&&P==="visible"&&m.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[m,P,j]);let U=E&&!A,B=A&&O&&E,Q=(()=>!j||U?"idle":O?"enter":"leave")(),G=xv(0),pe=re(K=>ve(K,{enter:()=>{G.addFlag(Ae.Opening),D.current.beforeEnter()},leave:()=>{G.addFlag(Ae.Closing),D.current.beforeLeave()},idle:()=>{}})),he=re(K=>ve(K,{enter:()=>{G.removeFlag(Ae.Opening),D.current.afterEnter()},leave:()=>{G.removeFlag(Ae.Closing),D.current.afterLeave()},idle:()=>{}})),Z=zs(()=>{_("hidden"),k(m)},I),ce=S.useRef(!1);_v({immediate:B,container:m,classes:W,direction:Q,onStart:Xe(K=>{ce.current=!0,Z.onStart(m,K,pe)}),onStop:Xe(K=>{ce.current=!1,Z.onStop(m,K,he),K==="leave"&&!Gr(Z)&&(_("hidden"),k(m))})});let fe=v,xe={ref:y};return B?fe={...fe,className:Ar(v.className,...W.current.enter,...W.current.enterFrom)}:ce.current&&(fe.className=Ar(v.className,(n=m.current)==null?void 0:n.className),fe.className===""&&delete fe.className),T.default.createElement(Wr.Provider,{value:Z},T.default.createElement(lm,{value:ve(P,{visible:Ae.Open,hidden:Ae.Closed})|G.flags},Re({ourProps:xe,theirProps:fe,defaultTag:Fv,features:Qs,visible:P==="visible",name:"Transition.Child"})))}function Mv(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,o=S.useRef(null),s=ke(o,t);Lt();let u=si();if(r===void 0&&u!==null&&(r=(u&Ae.Open)===Ae.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=S.useState(r?"visible":"hidden"),l=zs(()=>{f("hidden")}),[d,g]=S.useState(!0),p=S.useRef([r]);$e(()=>{d!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),g(!1))},[p,r]);let v=S.useMemo(()=>({show:r,appear:n,initial:d}),[r,n,d]);S.useEffect(()=>{if(r)f("visible");else if(!Gr(l))f("hidden");else{let O=o.current;if(!O)return;let A=O.getBoundingClientRect();A.x===0&&A.y===0&&A.width===0&&A.height===0&&f("hidden")}},[r,l]);let m={unmount:i},y=re(()=>{var O;d&&g(!1),(O=e.beforeEnter)==null||O.call(e)}),b=re(()=>{var O;d&&g(!1),(O=e.beforeLeave)==null||O.call(e)});return T.default.createElement(Wr.Provider,{value:l},T.default.createElement(Hr.Provider,{value:v},Re({ourProps:{...m,as:S.Fragment,children:T.default.createElement(qs,{ref:s,...m,...a,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:S.Fragment,features:Qs,visible:c==="visible",name:"Transition"})))}function kv(e,t){let r=S.useContext(Hr)!==null,n=si()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(kn,{ref:t,...e}):T.default.createElement(qs,{ref:t,...e}))}let kn=_e(Mv),qs=_e(Dv),jv=_e(kv),bn=Object.assign(kn,{Child:jv,Root:kn});function Uv(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Ts({isModal:!0});return C(Ge,{children:C(bn,{appear:!0,show:r,as:S.Fragment,children:C(Ya,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:V("div",{className:"min-h-screen text-center sm:px-4",children:[C(bn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:C(Ya.Overlay,{className:"fixed inset-0"})}),C("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),C(bn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:V("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[C("div",{className:"sticky top-0 z-10 flex items-center w-full px-3 text-lg font-medium leading-6 text-gray-900 bg-white h-14 modal-header",children:C("div",{className:"",children:V("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",C("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),C("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function Vv(e){var U,B,Q,G;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:a,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:c,children:f}=e,{minPrice:l="0"}=t,[d,g]=S.useState("auto"),[p,v]=S.useState(0);S.useEffect(()=>{v(1);const pe=setTimeout(()=>{E||v(2)},250);return()=>{clearTimeout(pe)}},[]);const{displayPriceFrom:m,formattedEndPrice:y}=zp(a,l,o),b=S.useRef(),O=S.useRef(),{isSm:A,isMobile:E,windowHeight:P}=Ts({isModal:!0}),_=V(Ge,{children:[V("div",{className:Vt("px-4 w-full",A&&"sm:sticky sm:top-0 sm:w-2/5"),ref:b,children:[t.details.media&&t.details.media[0].url&&C("img",{className:Vt("mx-auto mt-2 mb-6 max-h-[250px]",A&&"max-h-[450px]"),alt:t.details.literals.name,src:(U=t.details)==null?void 0:U.media[0].url}),C("div",{className:Vt(!i&&"hidden"),children:C(_s,{})})]}),V("div",{className:Vt("w-full",A&&"sm:w-3/5"),ref:O,children:[V("div",{className:"items-center w-full p-4",children:[V("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[V("span",{className:"",children:[t.details.literals.name," "]}),C(Ur,{price:e.countedProductPrice,minPrice:l})]}),C("span",{className:"text-gray-600",children:(B=t.details.literals)==null?void 0:B.description})]}),V("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[f,C("div",{className:"sm:h-[64px]"})]}),A&&C("div",{className:"-mt-5 mb-2 bg-gray-100",children:C(Ha,{finalPrice:y,isBackIcon:!1,handleGoBack:n,displayPriceFrom:m})})]})]}),I=(Q=b==null?void 0:b.current)==null?void 0:Q.clientHeight,F=(G=O==null?void 0:O.current)==null?void 0:G.clientHeight,k=I+F;k>window.innerHeight*.8||isNaN(k)?d!=="80vh"&&g("80vh"):d!=="auto"&&g("auto");const W=`${P-64-56}px`,D=!A,j={"--mobile-submit-row-top":`${P-64-80}px`};return C(Uv,{isOpen:Boolean(r),handleClose:n,children:V("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[C("div",{className:Vt("flex relative flex-col items-start w-full form-body stretch",!D&&"sm:flex-row-reverse sm:pb-0",!E&&"mobile-scrollbar"),style:{height:`${E?W:d}`,minHeight:"400px",overflowY:"scroll"},children:_}),D&&C("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${E?"submit-row-mobile":"submit-row"}`,style:j,children:C(Ha,{handleGoBack:n,finalPrice:y,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:c})})]})})}const Bv=e=>{const{product:t}=e,{MenuProductRootUI:r}=Vr(),n=Me(t.items)?C(Ge,{}):C(ni,{productItems:t.items,parentProduct:t,rootProduct:t});return console.log("MenuProductRootUI CHECK",r),r?C(r,{...e,children:n}):C(Vv,{...e,children:n})};const Js=T.default.createContext(null);function Hv({rootProduct:e,children:t}){return C(Js.Provider,{value:{rootProduct:e},children:t})}function Wv(){const e=S.useContext(Js);if(!e)throw new Error("Missing ComponentsContext");return e}function Gv(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:a,handleClose:o,currency:s,showDebugState:u=!1}=e,{price:c}=t,{encodedProduct:f,initSelected:l,initFilter:d,productQuantity:g,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:v,getValidationMap:m,increaseProductQuantity:y,decreaseProductQuantity:b,setCurrency:O}=yp(t),[A,E]=S.useState(m());S.useEffect(()=>{ye.changeLanguage(r)},[r]),S.useEffect(()=>{O(s)},[s]),S.useEffect(()=>{const W=m();qg(W,A)||E(W)});const P=xo({defaultValues:{selected:l,filter:d},shouldUnregister:!1}),{getValues:_}=P,I=Number((parseFloat(c||"0")+Kn(_("selected"),f)).toFixed(2)),F=()=>{var D;console.log("onSubmit"),p();const W=v();if(W.length)ap(cs(W[0])),console.log({invalidContextNames:W});else{console.log("selected",_("selected"));const j=np(ls(_("selected"))),U=_("filter");(D=Object.keys(j||{}))==null||D.forEach(B=>{const Q=ds(B,t);Q&&(ti(Q,U)||delete j[B])}),console.log("decodedCleanedSelected: ",j),n({price:I,quantity:g,selected:j,filter:U})}},k=()=>F();return C(Ge,{children:C(Hv,{rootProduct:t,children:C(Ps.Provider,{value:e.components,children:C(so,{...P,children:V("form",{children:[u&&C("div",{className:"hidden",children:C(_s,{})}),C(Bv,{product:f,productQuantity:g,validationMap:A,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:k,countedProductPrice:I,countedProductTotalPrice:I*g,increaseProductQuantity:y,decreaseProductQuantity:b,currency:s})]})})})})})}exports.ContextType=Wn;exports.MainView=Po;exports.ProductConfigurator=Gv;exports.ProductKinds=Gn;exports.ProductTypes=Co;exports.SelMinSelMaxStatus=Ne;exports.getProductToChangeInForm=hs;exports.hookForm=Xu;exports.selectProductsInForm=ms;exports.unselectProductsInForm=bp;exports.useMenuOptions=vs;exports.useProductData=Wv;exports.validateProductFilter=ti;
14
+ `));let d=f.props,g=typeof(d==null?void 0:d.className)=="function"?(...v)=>Ar(d==null?void 0:d.className(...v),u.className):Ar(d==null?void 0:d.className,u.className),p=g?{className:g}:{};return S.cloneElement(f,Object.assign({},Ms(f.props,Ga(pn(u,["ref"]))),l,c,{ref:i(f.ref,c.ref)},p))}return S.createElement(a,Object.assign({},pn(u,["ref"]),a!==S.Fragment&&c,a!==S.Fragment&&l),f)}function om(...e){return e.every(t=>t==null)?void 0:t=>{for(let r of e)r!=null&&(typeof r=="function"?r(t):r.current=t)}}function Ms(...e){if(e.length===0)return{};if(e.length===1)return e[0];let t={},r={};for(let n of e)for(let i in n)i.startsWith("on")&&typeof n[i]=="function"?(r[i]!=null||(r[i]=[]),r[i].push(n[i])):t[i]=n[i];if(t.disabled||t["aria-disabled"])return Object.assign(t,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(t,{[n](i,...a){let o=r[n];for(let s of o){if((i instanceof Event||(i==null?void 0:i.nativeEvent)instanceof Event)&&i.defaultPrevented)return;s(i,...a)}}});return t}function _e(e){var t;return Object.assign(S.forwardRef(e),{displayName:(t=e.displayName)!=null?t:e.name})}function Ga(e){let t=Object.assign({},e);for(let r in t)t[r]===void 0&&delete t[r];return t}function pn(e,t=[]){let r=Object.assign({},e);for(let n of t)n in r&&delete r[n];return r}let sm="div";var Tr=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Tr||{});function um(e,t){var r;let{features:n=1,...i}=e,a={ref:t,"aria-hidden":(n&2)===2?!0:(r=i["aria-hidden"])!=null?r:void 0,hidden:(n&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return Re({ourProps:a,theirProps:i,slot:{},defaultTag:sm,name:"Hidden"})}let Ln=_e(um),oi=S.createContext(null);oi.displayName="OpenClosedContext";var Ae=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(Ae||{});function si(){return S.useContext(oi)}function lm({value:e,children:t}){return T.default.createElement(oi.Provider,{value:e},t)}function cm(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window!="undefined"&&typeof document!="undefined"&&(document.addEventListener("DOMContentLoaded",t),t())}let it=[];cm(()=>{function e(t){t.target instanceof HTMLElement&&t.target!==document.body&&it[0]!==t.target&&(it.unshift(t.target),it=it.filter(r=>r!=null&&r.isConnected),it.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function fm(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(t==null?void 0:t.getAttribute("disabled"))==="";return n&&dm(r)?!1:n}function dm(e){if(!e)return!1;let t=e.previousElementSibling;for(;t!==null;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}var ks=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ks||{});function js(e,t,r,n){let i=Xe(r);S.useEffect(()=>{e=e!=null?e:window;function a(o){i.current(o)}return e.addEventListener(t,a,n),()=>e.removeEventListener(t,a,n)},[e,t,n])}function nr(){let e=S.useRef(!1);return $e(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Us(e){let t=re(e),r=S.useRef(!1);S.useEffect(()=>(r.current=!1,()=>{r.current=!0,Br(()=>{r.current&&t()})}),[t])}var Gt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Gt||{});function gm(){let e=S.useRef(0);return Fs("keydown",t=>{t.key==="Tab"&&(e.current=t.shiftKey?1:0)},!0),e}function Vs(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}let pm="div";var Bs=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Bs||{});function hm(e,t){let r=S.useRef(null),n=ke(r,t),{initialFocus:i,containers:a,features:o=30,...s}=e;Lt()||(o=1);let u=rr(r);ym({ownerDocument:u},Boolean(o&16));let c=bm({ownerDocument:u,container:r,initialFocus:i},Boolean(o&2));Sm({ownerDocument:u,container:r,containers:a,previousActiveElement:c},Boolean(o&8));let f=gm(),l=re(v=>{let m=r.current;!m||(y=>y())(()=>{ve(f.current,{[Gt.Forwards]:()=>{mr(m,gt.First,{skipElements:[v.relatedTarget]})},[Gt.Backwards]:()=>{mr(m,gt.Last,{skipElements:[v.relatedTarget]})}})})}),d=ii(),g=S.useRef(!1),p={ref:n,onKeyDown(v){v.key=="Tab"&&(g.current=!0,d.requestAnimationFrame(()=>{g.current=!1}))},onBlur(v){let m=Vs(a);r.current instanceof HTMLElement&&m.add(r.current);let y=v.relatedTarget;y instanceof HTMLElement&&y.dataset.headlessuiFocusGuard!=="true"&&(Hs(m,y)||(g.current?mr(r.current,ve(f.current,{[Gt.Forwards]:()=>gt.Next,[Gt.Backwards]:()=>gt.Previous})|gt.WrapAround,{relativeTo:v.target}):v.target instanceof HTMLElement&&mt(v.target)))}};return T.default.createElement(T.default.Fragment,null,Boolean(o&4)&&T.default.createElement(Ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Tr.Focusable}),Re({ourProps:p,theirProps:s,defaultTag:pm,name:"FocusTrap"}),Boolean(o&4)&&T.default.createElement(Ln,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:l,features:Tr.Focusable}))}let mm=_e(hm),Bt=Object.assign(mm,{features:Bs});function vm(e=!0){let t=S.useRef(it.slice());return ai(([r],[n])=>{n===!0&&r===!1&&Br(()=>{t.current.splice(0)}),n===!1&&r===!0&&(t.current=it.slice())},[e,it,t]),re(()=>{var r;return(r=t.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function ym({ownerDocument:e},t){let r=vm(t);ai(()=>{t||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&mt(r())},[t]),Us(()=>{t&&mt(r())})}function bm({ownerDocument:e,container:t,initialFocus:r},n){let i=S.useRef(null),a=nr();return ai(()=>{if(!n)return;let o=t.current;o&&Br(()=>{if(!a.current)return;let s=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===s){i.current=s;return}}else if(o.contains(s)){i.current=s;return}r!=null&&r.current?mt(r.current):mr(o,gt.First)===Is.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),i.current=e==null?void 0:e.activeElement})},[n]),i}function Sm({ownerDocument:e,container:t,containers:r,previousActiveElement:n},i){let a=nr();js(e==null?void 0:e.defaultView,"focus",o=>{if(!i||!a.current)return;let s=Vs(r);t.current instanceof HTMLElement&&s.add(t.current);let u=n.current;if(!u)return;let c=o.target;c&&c instanceof HTMLElement?Hs(s,c)?(n.current=c,mt(c)):(o.preventDefault(),o.stopPropagation(),mt(u)):mt(n.current)},!0)}function Hs(e,t){for(let r of e)if(r.contains(t))return!0;return!1}let Ws=S.createContext(!1);function Om(){return S.useContext(Ws)}function Rn(e){return T.default.createElement(Ws.Provider,{value:e.force},e.children)}function wm(e){let t=Om(),r=S.useContext(Gs),n=rr(e),[i,a]=S.useState(()=>{if(!t&&r!==null||Ze.isServer)return null;let o=n==null?void 0:n.getElementById("headlessui-portal-root");if(o)return o;if(n===null)return null;let s=n.createElement("div");return s.setAttribute("id","headlessui-portal-root"),n.body.appendChild(s)});return S.useEffect(()=>{i!==null&&(n!=null&&n.body.contains(i)||n==null||n.body.appendChild(i))},[i,n]),S.useEffect(()=>{t||r!==null&&a(r.current)},[r,a,t]),i}let Em=S.Fragment;function xm(e,t){let r=e,n=S.useRef(null),i=ke(am(f=>{n.current=f}),t),a=rr(n),o=wm(n),[s]=S.useState(()=>{var f;return Ze.isServer?null:(f=a==null?void 0:a.createElement("div"))!=null?f:null}),u=S.useContext(Fn),c=Lt();return $e(()=>{!o||!s||o.contains(s)||(s.setAttribute("data-headlessui-portal",""),o.appendChild(s))},[o,s]),$e(()=>{if(s&&u)return u.register(s)},[u,s]),Us(()=>{var f;!o||!s||(s instanceof Node&&o.contains(s)&&o.removeChild(s),o.childNodes.length<=0&&((f=o.parentElement)==null||f.removeChild(o)))}),c?!o||!s?null:tu.createPortal(Re({ourProps:{ref:i},theirProps:r,defaultTag:Em,name:"Portal"}),s):null}let Pm=S.Fragment,Gs=S.createContext(null);function Cm(e,t){let{target:r,...n}=e,i={ref:ke(t)};return T.default.createElement(Gs.Provider,{value:r},Re({ourProps:i,theirProps:n,defaultTag:Pm,name:"Popover.Group"}))}let Fn=S.createContext(null);function Am(){let e=S.useContext(Fn),t=S.useRef([]),r=re(a=>(t.current.push(a),e&&e.register(a),()=>n(a))),n=re(a=>{let o=t.current.indexOf(a);o!==-1&&t.current.splice(o,1),e&&e.unregister(a)}),i=S.useMemo(()=>({register:r,unregister:n,portals:t}),[r,n,t]);return[t,S.useMemo(()=>function({children:a}){return T.default.createElement(Fn.Provider,{value:i},a)},[i])]}let _m=_e(xm),Tm=_e(Cm),Dn=Object.assign(_m,{Group:Tm});function Nm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}const $m=typeof Object.is=="function"?Object.is:Nm,{useState:Im,useEffect:Lm,useLayoutEffect:Rm,useDebugValue:Fm}=st;function Dm(e,t,r){const n=t(),[{inst:i},a]=Im({inst:{value:n,getSnapshot:t}});return Rm(()=>{i.value=n,i.getSnapshot=t,hn(i)&&a({inst:i})},[e,n,t]),Lm(()=>(hn(i)&&a({inst:i}),e(()=>{hn(i)&&a({inst:i})})),[e]),Fm(n),n}function hn(e){const t=e.getSnapshot,r=e.value;try{const n=t();return!$m(r,n)}catch{return!0}}function Mm(e,t,r){return t()}const km=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined",jm=!km,Um=jm?Mm:Dm,Vm="useSyncExternalStore"in st?(e=>e.useSyncExternalStore)(st):Um;function Bm(e){return Vm(e.subscribe,e.getSnapshot,e.getSnapshot)}function Hm(e,t){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(i){return n.add(i),()=>n.delete(i)},dispatch(i,...a){let o=t[i].call(r,...a);o&&(r=o,n.forEach(s=>s()))}}}function Wm(){let e;return{before({doc:t}){var r;let n=t.documentElement;e=((r=t.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:t,d:r}){let n=t.documentElement,i=n.clientWidth-n.offsetWidth,a=e-i;r.style(n,"paddingRight",`${a}px`)}}}function Gm(){return Rs()?{before({doc:e,d:t,meta:r}){function n(i){return r.containers.flatMap(a=>a()).some(a=>a.contains(i))}t.microTask(()=>{var i;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=wt();s.style(e.documentElement,"scrollBehavior","auto"),t.add(()=>t.microTask(()=>s.dispose()))}let a=(i=window.scrollY)!=null?i:window.pageYOffset,o=null;t.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let u=s.target.closest("a");if(!u)return;let{hash:c}=new URL(u.href),f=e.querySelector(c);f&&!n(f)&&(o=f)}catch{}},!0),t.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&n(u.parentElement);)u=u.parentElement;t.style(u,"overscrollBehavior","contain")}else t.style(s.target,"touchAction","none")}),t.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement)if(n(s.target)){let u=s.target;for(;u.parentElement&&u.dataset.headlessuiPortal!==""&&!(u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth);)u=u.parentElement;u.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()},{passive:!1}),t.add(()=>{var s;let u=(s=window.scrollY)!=null?s:window.pageYOffset;a!==u&&window.scrollTo(0,a),o&&o.isConnected&&(o.scrollIntoView({block:"nearest"}),o=null)})})}}:{}}function Km(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}}function Ym(e){let t={};for(let r of e)Object.assign(t,r(t));return t}let ht=Hm(()=>new Map,{PUSH(e,t){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:wt(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:r}){let n={doc:e,d:t,meta:Ym(r)},i=[Gm(),Wm(),Km()];i.forEach(({before:a})=>a==null?void 0:a(n)),i.forEach(({after:a})=>a==null?void 0:a(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});ht.subscribe(()=>{let e=ht.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=t.get(r.doc)==="hidden",i=r.count!==0;(i&&!n||!i&&n)&&ht.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&ht.dispatch("TEARDOWN",r)}});function zm(e,t,r){let n=Bm(ht),i=e?n.get(e):void 0,a=i?i.count>0:!1;return $e(()=>{if(!(!e||!t))return ht.dispatch("PUSH",e,r),()=>ht.dispatch("POP",e,r)},[t,e]),a}let mn=new Map,Ht=new Map;function Ka(e,t=!0){$e(()=>{var r;if(!t)return;let n=typeof e=="function"?e():e.current;if(!n)return;function i(){var o;if(!n)return;let s=(o=Ht.get(n))!=null?o:1;if(s===1?Ht.delete(n):Ht.set(n,s-1),s!==1)return;let u=mn.get(n);u&&(u["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",u["aria-hidden"]),n.inert=u.inert,mn.delete(n))}let a=(r=Ht.get(n))!=null?r:0;return Ht.set(n,a+1),a!==0||(mn.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),i},[e,t])}function Qm({defaultContainers:e=[],portals:t,mainTreeNodeRef:r}={}){var n;let i=S.useRef((n=r==null?void 0:r.current)!=null?n:null),a=rr(i),o=re(()=>{var s,u,c;let f=[];for(let l of e)l!==null&&(l instanceof HTMLElement?f.push(l):"current"in l&&l.current instanceof HTMLElement&&f.push(l.current));if(t!=null&&t.current)for(let l of t.current)f.push(l);for(let l of(s=a==null?void 0:a.querySelectorAll("html > *, body > *"))!=null?s:[])l!==document.body&&l!==document.head&&l instanceof HTMLElement&&l.id!=="headlessui-portal-root"&&(l.contains(i.current)||l.contains((c=(u=i.current)==null?void 0:u.getRootNode())==null?void 0:c.host)||f.some(d=>l.contains(d))||f.push(l));return f});return{resolveContainers:o,contains:re(s=>o().some(u=>u.contains(s))),mainTreeNodeRef:i,MainTreeNode:S.useMemo(()=>function(){return r!=null?null:T.default.createElement(Ln,{features:Tr.Hidden,ref:i})},[i,r])}}let ui=S.createContext(()=>{});ui.displayName="StackContext";var Mn=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Mn||{});function qm(){return S.useContext(ui)}function Jm({children:e,onUpdate:t,type:r,element:n,enabled:i}){let a=qm(),o=re((...s)=>{t==null||t(...s),a(...s)});return $e(()=>{let s=i===void 0||i===!0;return s&&o(0,r,n),()=>{s&&o(1,r,n)}},[o,r,n,i]),T.default.createElement(ui.Provider,{value:o},e)}let Ks=S.createContext(null);function Ys(){let e=S.useContext(Ks);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,Ys),t}return e}function Zm(){let[e,t]=S.useState([]);return[e.length>0?e.join(" "):void 0,S.useMemo(()=>function(r){let n=re(a=>(t(o=>[...o,a]),()=>t(o=>{let s=o.slice(),u=s.indexOf(a);return u!==-1&&s.splice(u,1),s}))),i=S.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return T.default.createElement(Ks.Provider,{value:i},r.children)},[t])]}let Xm="p";function ev(e,t){let r=Rt(),{id:n=`headlessui-description-${r}`,...i}=e,a=Ys(),o=ke(t);$e(()=>a.register(n),[n,a.register]);let s={ref:o,...a.props,id:n};return Re({ourProps:s,theirProps:i,slot:a.slot||{},defaultTag:Xm,name:a.name||"Description"})}let tv=_e(ev),rv=Object.assign(tv,{});var nv=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(nv||{}),iv=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(iv||{});let av={[0](e,t){return e.titleId===t.id?e:{...e,titleId:t.id}}},Nr=S.createContext(null);Nr.displayName="DialogContext";function ir(e){let t=S.useContext(Nr);if(t===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,ir),r}return t}function ov(e,t,r=()=>[document.body]){zm(e,t,n=>{var i;return{containers:[...(i=n.containers)!=null?i:[],r]}})}function sv(e,t){return ve(t.type,av,e,t)}let uv="div",lv=_r.RenderStrategy|_r.Static;function cv(e,t){let r=Rt(),{id:n=`headlessui-dialog-${r}`,open:i,onClose:a,initialFocus:o,role:s="dialog",__demoMode:u=!1,...c}=e,[f,l]=S.useState(0),d=S.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(d.current||(d.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let g=si();i===void 0&&g!==null&&(i=(g&Ae.Open)===Ae.Open);let p=S.useRef(null),v=ke(p,t),m=rr(p),y=e.hasOwnProperty("open")||g!==null,b=e.hasOwnProperty("onClose");if(!y&&!b)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!y)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!b)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof i!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if(typeof a!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${a}`);let O=i?0:1,[A,E]=S.useReducer(sv,{titleId:null,descriptionId:null,panelRef:S.createRef()}),P=re(()=>a(!1)),_=re(H=>E({type:0,id:H})),I=Lt()?u?!1:O===0:!1,F=f>1,k=S.useContext(Nr)!==null,[W,D]=Am(),j={get current(){var H;return(H=A.panelRef.current)!=null?H:p.current}},{resolveContainers:U,mainTreeNodeRef:B,MainTreeNode:Q}=Qm({portals:W,defaultContainers:[j]}),G=F?"parent":"leaf",pe=g!==null?(g&Ae.Closing)===Ae.Closing:!1,he=(()=>k||pe?!1:I)(),Z=S.useCallback(()=>{var H,ie;return(ie=Array.from((H=m==null?void 0:m.querySelectorAll("body > *"))!=null?H:[]).find(ae=>ae.id==="headlessui-portal-root"?!1:ae.contains(B.current)&&ae instanceof HTMLElement))!=null?ie:null},[B]);Ka(Z,he);let ce=(()=>F?!0:I)(),fe=S.useCallback(()=>{var H,ie;return(ie=Array.from((H=m==null?void 0:m.querySelectorAll("[data-headlessui-portal]"))!=null?H:[]).find(ae=>ae.contains(B.current)&&ae instanceof HTMLElement))!=null?ie:null},[B]);Ka(fe,ce);let xe=(()=>!(!I||F))();im(U,H=>{H.preventDefault(),P()},xe);let K=(()=>!(F||O!==0))();js(m==null?void 0:m.defaultView,"keydown",H=>{K&&(H.defaultPrevented||H.key===ks.Escape&&(H.preventDefault(),H.stopPropagation(),P()))});let se=(()=>!(pe||O!==0||k))();ov(m,se,U),S.useEffect(()=>{if(O!==0||!p.current)return;let H=new ResizeObserver(ie=>{for(let ae of ie){let be=ae.target.getBoundingClientRect();be.x===0&&be.y===0&&be.width===0&&be.height===0&&P()}});return H.observe(p.current),()=>H.disconnect()},[O,p,P]);let[ne,X]=Zm(),me=S.useMemo(()=>[{dialogState:O,close:P,setTitleId:_},A],[O,A,P,_]),Pe=S.useMemo(()=>({open:O===0}),[O]),je={ref:v,id:n,role:s,"aria-modal":O===0?!0:void 0,"aria-labelledby":A.titleId,"aria-describedby":ne};return T.default.createElement(Jm,{type:"Dialog",enabled:O===0,element:p,onUpdate:re((H,ie)=>{ie==="Dialog"&&ve(H,{[Mn.Add]:()=>l(ae=>ae+1),[Mn.Remove]:()=>l(ae=>ae-1)})})},T.default.createElement(Rn,{force:!0},T.default.createElement(Dn,null,T.default.createElement(Nr.Provider,{value:me},T.default.createElement(Dn.Group,{target:p},T.default.createElement(Rn,{force:!1},T.default.createElement(X,{slot:Pe,name:"Dialog.Description"},T.default.createElement(Bt,{initialFocus:o,containers:U,features:I?ve(G,{parent:Bt.features.RestoreFocus,leaf:Bt.features.All&~Bt.features.FocusLock}):Bt.features.None},T.default.createElement(D,null,Re({ourProps:je,theirProps:c,slot:Pe,defaultTag:uv,features:lv,visible:O===0,name:"Dialog"}))))))))),T.default.createElement(Q,null))}let fv="div";function dv(e,t){let r=Rt(),{id:n=`headlessui-dialog-overlay-${r}`,...i}=e,[{dialogState:a,close:o}]=ir("Dialog.Overlay"),s=ke(t),u=re(f=>{if(f.target===f.currentTarget){if(fm(f.currentTarget))return f.preventDefault();f.preventDefault(),f.stopPropagation(),o()}}),c=S.useMemo(()=>({open:a===0}),[a]);return Re({ourProps:{ref:s,id:n,"aria-hidden":!0,onClick:u},theirProps:i,slot:c,defaultTag:fv,name:"Dialog.Overlay"})}let gv="div";function pv(e,t){let r=Rt(),{id:n=`headlessui-dialog-backdrop-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Backdrop"),s=ke(t);S.useEffect(()=>{if(o.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[o.panelRef]);let u=S.useMemo(()=>({open:a===0}),[a]);return T.default.createElement(Rn,{force:!0},T.default.createElement(Dn,null,Re({ourProps:{ref:s,id:n,"aria-hidden":!0},theirProps:i,slot:u,defaultTag:gv,name:"Dialog.Backdrop"})))}let hv="div";function mv(e,t){let r=Rt(),{id:n=`headlessui-dialog-panel-${r}`,...i}=e,[{dialogState:a},o]=ir("Dialog.Panel"),s=ke(t,o.panelRef),u=S.useMemo(()=>({open:a===0}),[a]),c=re(f=>{f.stopPropagation()});return Re({ourProps:{ref:s,id:n,onClick:c},theirProps:i,slot:u,defaultTag:hv,name:"Dialog.Panel"})}let vv="h2";function yv(e,t){let r=Rt(),{id:n=`headlessui-dialog-title-${r}`,...i}=e,[{dialogState:a,setTitleId:o}]=ir("Dialog.Title"),s=ke(t);S.useEffect(()=>(o(n),()=>o(null)),[n,o]);let u=S.useMemo(()=>({open:a===0}),[a]);return Re({ourProps:{ref:s,id:n},theirProps:i,slot:u,defaultTag:vv,name:"Dialog.Title"})}let bv=_e(cv),Sv=_e(pv),Ov=_e(mv),wv=_e(dv),Ev=_e(yv),Ya=Object.assign(bv,{Backdrop:Sv,Panel:Ov,Overlay:wv,Title:Ev,Description:rv});function xv(e=0){let[t,r]=S.useState(e),n=nr(),i=S.useCallback(u=>{n.current&&r(c=>c|u)},[t,n]),a=S.useCallback(u=>Boolean(t&u),[t]),o=S.useCallback(u=>{n.current&&r(c=>c&~u)},[r,n]),s=S.useCallback(u=>{n.current&&r(c=>c^u)},[r]);return{flags:t,addFlag:i,hasFlag:a,removeFlag:o,toggleFlag:s}}function Pv(e){let t={called:!1};return(...r)=>{if(!t.called)return t.called=!0,e(...r)}}function vn(e,...t){e&&t.length>0&&e.classList.add(...t)}function yn(e,...t){e&&t.length>0&&e.classList.remove(...t)}function Cv(e,t){let r=wt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[a,o]=[n,i].map(u=>{let[c=0]=u.split(",").filter(Boolean).map(f=>f.includes("ms")?parseFloat(f):parseFloat(f)*1e3).sort((f,l)=>l-f);return c}),s=a+o;if(s!==0){r.group(c=>{c.setTimeout(()=>{t(),c.dispose()},s),c.addEventListener(e,"transitionrun",f=>{f.target===f.currentTarget&&c.dispose()})});let u=r.addEventListener(e,"transitionend",c=>{c.target===c.currentTarget&&(t(),u())})}else t();return r.add(()=>t()),r.dispose}function Av(e,t,r,n){let i=r?"enter":"leave",a=wt(),o=n!==void 0?Pv(n):()=>{};i==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=ve(i,{enter:()=>t.enter,leave:()=>t.leave}),u=ve(i,{enter:()=>t.enterTo,leave:()=>t.leaveTo}),c=ve(i,{enter:()=>t.enterFrom,leave:()=>t.leaveFrom});return yn(e,...t.base,...t.enter,...t.enterTo,...t.enterFrom,...t.leave,...t.leaveFrom,...t.leaveTo,...t.entered),vn(e,...t.base,...s,...c),a.nextFrame(()=>{yn(e,...t.base,...s,...c),vn(e,...t.base,...s,...u),Cv(e,()=>(yn(e,...t.base,...s),vn(e,...t.base,...t.entered),o()))}),a.dispose}function _v({immediate:e,container:t,direction:r,classes:n,onStart:i,onStop:a}){let o=nr(),s=ii(),u=Xe(r);$e(()=>{e&&(u.current="enter")},[e]),$e(()=>{let c=wt();s.add(c.dispose);let f=t.current;if(f&&u.current!=="idle"&&o.current)return c.dispose(),i.current(u.current),c.add(Av(f,n.current,u.current==="enter",()=>{c.dispose(),a.current(u.current)})),c.dispose},[r])}function nt(e=""){return e.split(/\s+/).filter(t=>t.length>1)}let Hr=S.createContext(null);Hr.displayName="TransitionContext";var Tv=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Tv||{});function Nv(){let e=S.useContext(Hr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function $v(){let e=S.useContext(Wr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Wr=S.createContext(null);Wr.displayName="NestingContext";function Gr(e){return"children"in e?Gr(e.children):e.current.filter(({el:t})=>t.current!==null).filter(({state:t})=>t==="visible").length>0}function zs(e,t){let r=Xe(e),n=S.useRef([]),i=nr(),a=ii(),o=re((g,p=ot.Hidden)=>{let v=n.current.findIndex(({el:m})=>m===g);v!==-1&&(ve(p,{[ot.Unmount](){n.current.splice(v,1)},[ot.Hidden](){n.current[v].state="hidden"}}),a.microTask(()=>{var m;!Gr(n)&&i.current&&((m=r.current)==null||m.call(r))}))}),s=re(g=>{let p=n.current.find(({el:v})=>v===g);return p?p.state!=="visible"&&(p.state="visible"):n.current.push({el:g,state:"visible"}),()=>o(g,ot.Unmount)}),u=S.useRef([]),c=S.useRef(Promise.resolve()),f=S.useRef({enter:[],leave:[],idle:[]}),l=re((g,p,v)=>{u.current.splice(0),t&&(t.chains.current[p]=t.chains.current[p].filter(([m])=>m!==g)),t==null||t.chains.current[p].push([g,new Promise(m=>{u.current.push(m)})]),t==null||t.chains.current[p].push([g,new Promise(m=>{Promise.all(f.current[p].map(([y,b])=>b)).then(()=>m())})]),p==="enter"?c.current=c.current.then(()=>t==null?void 0:t.wait.current).then(()=>v(p)):v(p)}),d=re((g,p,v)=>{Promise.all(f.current[p].splice(0).map(([m,y])=>y)).then(()=>{var m;(m=u.current.shift())==null||m()}).then(()=>v(p))});return S.useMemo(()=>({children:n,register:s,unregister:o,onStart:l,onStop:d,wait:c,chains:f}),[s,o,n,l,d,f,c])}function Iv(){}let Lv=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function za(e){var t;let r={};for(let n of Lv)r[n]=(t=e[n])!=null?t:Iv;return r}function Rv(e){let t=S.useRef(za(e));return S.useEffect(()=>{t.current=za(e)},[e]),t}let Fv="div",Qs=_r.RenderStrategy;function Dv(e,t){var r,n;let{beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s,enter:u,enterFrom:c,enterTo:f,entered:l,leave:d,leaveFrom:g,leaveTo:p,...v}=e,m=S.useRef(null),y=ke(m,t),b=(r=v.unmount)==null||r?ot.Unmount:ot.Hidden,{show:O,appear:A,initial:E}=Nv(),[P,_]=S.useState(O?"visible":"hidden"),I=$v(),{register:F,unregister:k}=I;S.useEffect(()=>F(m),[F,m]),S.useEffect(()=>{if(b===ot.Hidden&&m.current){if(O&&P!=="visible"){_("visible");return}return ve(P,{hidden:()=>k(m),visible:()=>F(m)})}},[P,m,F,k,O,b]);let W=Xe({base:nt(v.className),enter:nt(u),enterFrom:nt(c),enterTo:nt(f),entered:nt(l),leave:nt(d),leaveFrom:nt(g),leaveTo:nt(p)}),D=Rv({beforeEnter:i,afterEnter:a,beforeLeave:o,afterLeave:s}),j=Lt();S.useEffect(()=>{if(j&&P==="visible"&&m.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[m,P,j]);let U=E&&!A,B=A&&O&&E,Q=(()=>!j||U?"idle":O?"enter":"leave")(),G=xv(0),pe=re(K=>ve(K,{enter:()=>{G.addFlag(Ae.Opening),D.current.beforeEnter()},leave:()=>{G.addFlag(Ae.Closing),D.current.beforeLeave()},idle:()=>{}})),he=re(K=>ve(K,{enter:()=>{G.removeFlag(Ae.Opening),D.current.afterEnter()},leave:()=>{G.removeFlag(Ae.Closing),D.current.afterLeave()},idle:()=>{}})),Z=zs(()=>{_("hidden"),k(m)},I),ce=S.useRef(!1);_v({immediate:B,container:m,classes:W,direction:Q,onStart:Xe(K=>{ce.current=!0,Z.onStart(m,K,pe)}),onStop:Xe(K=>{ce.current=!1,Z.onStop(m,K,he),K==="leave"&&!Gr(Z)&&(_("hidden"),k(m))})});let fe=v,xe={ref:y};return B?fe={...fe,className:Ar(v.className,...W.current.enter,...W.current.enterFrom)}:ce.current&&(fe.className=Ar(v.className,(n=m.current)==null?void 0:n.className),fe.className===""&&delete fe.className),T.default.createElement(Wr.Provider,{value:Z},T.default.createElement(lm,{value:ve(P,{visible:Ae.Open,hidden:Ae.Closed})|G.flags},Re({ourProps:xe,theirProps:fe,defaultTag:Fv,features:Qs,visible:P==="visible",name:"Transition.Child"})))}function Mv(e,t){let{show:r,appear:n=!1,unmount:i=!0,...a}=e,o=S.useRef(null),s=ke(o,t);Lt();let u=si();if(r===void 0&&u!==null&&(r=(u&Ae.Open)===Ae.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[c,f]=S.useState(r?"visible":"hidden"),l=zs(()=>{f("hidden")}),[d,g]=S.useState(!0),p=S.useRef([r]);$e(()=>{d!==!1&&p.current[p.current.length-1]!==r&&(p.current.push(r),g(!1))},[p,r]);let v=S.useMemo(()=>({show:r,appear:n,initial:d}),[r,n,d]);S.useEffect(()=>{if(r)f("visible");else if(!Gr(l))f("hidden");else{let O=o.current;if(!O)return;let A=O.getBoundingClientRect();A.x===0&&A.y===0&&A.width===0&&A.height===0&&f("hidden")}},[r,l]);let m={unmount:i},y=re(()=>{var O;d&&g(!1),(O=e.beforeEnter)==null||O.call(e)}),b=re(()=>{var O;d&&g(!1),(O=e.beforeLeave)==null||O.call(e)});return T.default.createElement(Wr.Provider,{value:l},T.default.createElement(Hr.Provider,{value:v},Re({ourProps:{...m,as:S.Fragment,children:T.default.createElement(qs,{ref:s,...m,...a,beforeEnter:y,beforeLeave:b})},theirProps:{},defaultTag:S.Fragment,features:Qs,visible:c==="visible",name:"Transition"})))}function kv(e,t){let r=S.useContext(Hr)!==null,n=si()!==null;return T.default.createElement(T.default.Fragment,null,!r&&n?T.default.createElement(kn,{ref:t,...e}):T.default.createElement(qs,{ref:t,...e}))}let kn=_e(Mv),qs=_e(Dv),jv=_e(kv),bn=Object.assign(kn,{Child:jv,Root:kn});function Uv(e){const{children:t,isOpen:r,handleClose:n}=e,{isMobile:i}=Ts({isModal:!0});return C(Ge,{children:C(bn,{appear:!0,show:r,as:S.Fragment,children:C(Ya,{as:"div",className:"fixed inset-0 z-10 overflow-y-auto",style:{backgroundColor:"rgba(0,0,0,.75)"},onClose:n,children:V("div",{className:"min-h-screen text-center sm:px-4",children:[C(bn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"ease-in duration-200",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:C(Ya.Overlay,{className:"fixed inset-0"})}),C("span",{className:"inline-block h-screen align-middle","aria-hidden":"true",children:"\u200B"}),C(bn.Child,{as:S.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:V("div",{id:"modal-content",className:"inline-block overflow-hidden sm:rounded-2xl align-middle transition-all bg-white sm:shadow-xl h-[100vh] sm:h-auto sm:max-h-[90vh] w-full sm:w-[640px]",children:[C("div",{className:"sticky top-0 z-10 flex items-center w-full px-3 text-lg font-medium leading-6 text-gray-900 bg-white h-14 modal-header",children:C("div",{className:"",children:V("svg",{className:"w-8 h-8 text-black cursor-pointer",width:"24",height:"24",viewBox:"0 0 24 24",strokeWidth:"2",stroke:"currentColor",fill:"none",strokeLinecap:"round",strokeLinejoin:"round",onClick:n,children:[C("path",{stroke:"none",d:"M0 0h24v24H0z"})," ",C("line",{x1:"5",y1:"12",x2:"19",y2:"12"})," ",C("line",{x1:"5",y1:"12",x2:"11",y2:"18"})," ",C("line",{x1:"5",y1:"12",x2:"11",y2:"6"})]})})}),C("div",{className:"w-full",style:{height:`${i?"calc(100% - 56px)":"auto"}`},children:t})]})})]})})})})}function Vv(e){var U,B,Q,G;const{product:t,isOpen:r,handleGoBack:n,showDebugState:i=!1,countedProductPrice:a,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:c,children:f}=e,{minPrice:l="0"}=t,[d,g]=S.useState("auto"),[p,v]=S.useState(0);S.useEffect(()=>{v(1);const pe=setTimeout(()=>{E||v(2)},250);return()=>{clearTimeout(pe)}},[]);const{displayPriceFrom:m,formattedEndPrice:y}=zp(a,l,o),b=S.useRef(),O=S.useRef(),{isSm:A,isMobile:E,windowHeight:P}=Ts({isModal:!0}),_=V(Ge,{children:[V("div",{className:Vt("px-4 w-full",A&&"sm:sticky sm:top-0 sm:w-2/5"),ref:b,children:[t.details.media&&t.details.media[0].url&&C("img",{className:Vt("mx-auto mt-2 mb-6 max-h-[250px]",A&&"max-h-[450px]"),alt:t.details.literals.name,src:(U=t.details)==null?void 0:U.media[0].url}),C("div",{className:Vt(!i&&"hidden"),children:C(_s,{})})]}),V("div",{className:Vt("w-full",A&&"sm:w-3/5"),ref:O,children:[V("div",{className:"items-center w-full p-4",children:[V("div",{className:"flex justify-between w-full mb-4 text-2xl font-semibold",children:[V("span",{className:"",children:[t.details.literals.name," "]}),C(Ur,{price:e.countedProductPrice,minPrice:l})]}),C("span",{className:"text-gray-600",children:(B=t.details.literals)==null?void 0:B.description})]}),V("div",{className:`items-center justify-center w-full px-4 product-configuration ${(t==null?void 0:t.items)&&"py-2 bg-gray-100"}`,children:[f,C("div",{className:"sm:h-[64px]"})]}),A&&C("div",{className:"-mt-5 mb-2 bg-gray-100",children:C(Ha,{finalPrice:y,isBackIcon:!1,handleGoBack:n,displayPriceFrom:m})})]})]}),I=(Q=b==null?void 0:b.current)==null?void 0:Q.clientHeight,F=(G=O==null?void 0:O.current)==null?void 0:G.clientHeight,k=I+F;k>window.innerHeight*.8||isNaN(k)?d!=="80vh"&&g("80vh"):d!=="auto"&&g("auto");const W=`${P-64-56}px`,D=!A,j={"--mobile-submit-row-top":`${P-64-80}px`};return C(Uv,{isOpen:Boolean(r),handleClose:n,children:V("div",{id:"product-configurator-view",className:"w-full h-full",style:{overflow:"hidden",textAlign:"left"},children:[C("div",{className:Vt("flex relative flex-col items-start w-full form-body stretch",!D&&"sm:flex-row-reverse sm:pb-0",!E&&"mobile-scrollbar"),style:{height:`${E?W:d}`,minHeight:"400px",overflowY:"scroll"},children:_}),D&&C("div",{className:`w-full h-16 bg-white sm:fixed sm:bottom-0 ${E?"submit-row-mobile":"submit-row"}`,style:j,children:C(Ha,{handleGoBack:n,finalPrice:y,isBackIcon:!1,productQuantity:o,increaseProductQuantity:s,decreaseProductQuantity:u,handleOnSubmit:c})})]})})}const Bv=e=>{const{product:t}=e,{MenuProductRootUI:r}=Vr(),n=Me(t.items)?C(Ge,{}):C(ni,{productItems:t.items,parentProduct:t,rootProduct:t});return console.log("MenuProductRootUI CHECK",r),r?C(r,{...e,children:n}):C(Vv,{...e,children:n})};const Js=T.default.createContext(null);function Hv({rootProduct:e,children:t}){return C(Js.Provider,{value:{rootProduct:e},children:t})}function Wv(){const e=S.useContext(Js);if(!e)throw new Error("Missing ComponentsContext");return e}function Gv(e){const{product:t,lang:r="en",handleAddToCart:n,handleGoBack:i,isOpen:a,handleClose:o,currency:s,showDebugState:u=!1}=e,{price:c}=t,{encodedProduct:f,initSelected:l,initFilter:d,productQuantity:g,setIsOnSubmittedOnTrue:p,getInvalidSelCtxArray:v,getValidationMap:m,increaseProductQuantity:y,decreaseProductQuantity:b,setCurrency:O}=yp(t),[A,E]=S.useState(m());S.useEffect(()=>{ye.changeLanguage(r)},[r]),S.useEffect(()=>{O(s)},[s]),S.useEffect(()=>{const W=m();qg(W,A)||E(W)});const P=xo({defaultValues:{selected:l,filter:d},shouldUnregister:!1}),{getValues:_}=P,I=Number((parseFloat(c||"0")+Kn(_("selected"),f)).toFixed(2)),F=()=>{var D;console.log("onSubmit"),p();const W=v();if(W.length)ap(cs(W[0])),console.log({invalidContextNames:W});else{console.log("selected",_("selected"));const j=np(ls(_("selected"))),U=_("filter");(D=Object.keys(j||{}))==null||D.forEach(B=>{const Q=ds(B,t);Q&&(ti(Q,U)||delete j[B])}),console.log("decodedCleanedSelected: ",j),n({price:I,quantity:g,selected:j,filter:U})}},k=()=>F();return C(Ge,{children:C(Hv,{rootProduct:t,children:C(Ps.Provider,{value:e.components,children:C(so,{...P,children:V("form",{children:[u&&C("div",{className:"hidden",children:C(_s,{})}),C(Bv,{product:f,productQuantity:g,validationMap:A,isOpen:a,handleClose:o,handleGoBack:i,handleOnSubmit:k,countedProductPrice:I,countedProductTotalPrice:I*g,increaseProductQuantity:y,decreaseProductQuantity:b,currency:s})]})})})})})}exports.ContextType=Wn;exports.MainView=Po;exports.ProductConfigurator=Gv;exports.ProductKinds=Gn;exports.ProductTypes=Co;exports.SelMinSelMaxStatus=Ne;exports.getProductToChangeInForm=hs;exports.hookForm=Xu;exports.selectProductsInForm=ms;exports.unselectProductsInForm=bp;exports.useMenuOptions=vs;exports.useProductData=Wv;exports.useStore=oe;exports.validateProductFilter=ti;
15
15
  //# sourceMappingURL=index.cjs.js.map